From 6fd7ef2bbf1f941c8dee302ffdeb44e603148723 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 7 Feb 2014 02:19:48 +0100 Subject: [PATCH 0001/1288] Also switch the (unused) verification code to low-s instead of even-s. a81cd968 introduced a malleability breaker for signatures (using an even value for S). In e0e14e43 this was changed to the lower of two potential values, rather than the even one. Only the signing code was changed though, the (for now unused) verification code wasn't adapted. --- src/key.cpp | 72 +++++++++++++++++++++++++----------- src/key.h | 3 ++ src/script.cpp | 9 +++-- src/script.h | 2 +- src/test/canonical_tests.cpp | 17 +++++++++ 5 files changed, 78 insertions(+), 25 deletions(-) diff --git a/src/key.cpp b/src/key.cpp index b57b7c506c..2199996cf3 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -332,30 +332,60 @@ public: } }; +int CompareBigEndian(const unsigned char *c1, size_t c1len, const unsigned char *c2, size_t c2len) { + while (c1len > c2len) { + if (*c1) + return 1; + c1++; + c1len--; + } + while (c2len > c1len) { + if (*c2) + return -1; + c2++; + c2len--; + } + while (c1len > 0) { + if (*c1 > *c2) + return 1; + if (*c2 > *c1) + return -1; + c1++; + c2++; + c1len--; + } + return 0; +} + +// Order of secp256k1's generator minus 1. +const unsigned char vchMaxModOrder[32] = { + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE, + 0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B, + 0xBF,0xD2,0x5E,0x8C,0xD0,0x36,0x41,0x40 +}; + +// Half of the order of secp256k1's generator minus 1. +const unsigned char vchMaxModHalfOrder[32] = { + 0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0x5D,0x57,0x6E,0x73,0x57,0xA4,0x50,0x1D, + 0xDF,0xE9,0x2F,0x46,0x68,0x1B,0x20,0xA0 +}; + +const unsigned char vchZero[0] = {}; + + }; // end of anonymous namespace bool CKey::Check(const unsigned char *vch) { - // Do not convert to OpenSSL's data structures for range-checking keys, - // it's easy enough to do directly. - static const unsigned char vchMax[32] = { - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE, - 0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B, - 0xBF,0xD2,0x5E,0x8C,0xD0,0x36,0x41,0x40 - }; - bool fIsZero = true; - for (int i=0; i<32 && fIsZero; i++) - if (vch[i] != 0) - fIsZero = false; - if (fIsZero) - return false; - for (int i=0; i<32; i++) { - if (vch[i] < vchMax[i]) - return true; - if (vch[i] > vchMax[i]) - return false; - } - return true; + return CompareBigEndian(vch, 32, vchZero, 0) > 0 && + CompareBigEndian(vch, 32, vchMaxModOrder, 32) <= 0; +} + +bool CKey::CheckSignatureElement(const unsigned char *vch, int len, bool half) { + return CompareBigEndian(vch, len, vchZero, 0) > 0 && + CompareBigEndian(vch, len, half ? vchMaxModHalfOrder : vchMaxModOrder, 32) <= 0; } void CKey::MakeNewKey(bool fCompressedIn) { diff --git a/src/key.h b/src/key.h index cf1165d3d0..37a06810b4 100644 --- a/src/key.h +++ b/src/key.h @@ -269,6 +269,9 @@ public: // Load private key and check that public key matches. bool Load(CPrivKey &privkey, CPubKey &vchPubKey, bool fSkipCheck); + + // Check whether an element of a signature (r or s) is valid. + static bool CheckSignatureElement(const unsigned char *vch, int len, bool half); }; struct CExtPubKey { diff --git a/src/script.cpp b/src/script.cpp index 810ba16d28..84a2a629e8 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -296,9 +296,12 @@ bool IsCanonicalSignature(const valtype &vchSig, unsigned int flags) { if (nLenS > 1 && (S[0] == 0x00) && !(S[1] & 0x80)) return error("Non-canonical signature: S value excessively padded"); - if (flags & SCRIPT_VERIFY_EVEN_S) { - if (S[nLenS-1] & 1) - return error("Non-canonical signature: S value odd"); + if (flags & SCRIPT_VERIFY_LOW_S) { + // If the S value is above the order of the curve divided by two, its + // complement modulo the order could have been used instead, which is + // one byte shorter when encoded correctly. + if (!CKey::CheckSignatureElement(S, nLenS, true)) + return error("Non-canonical signature: S value is unnecessarily high"); } return true; diff --git a/src/script.h b/src/script.h index 657ac0b388..b96bbc45c3 100644 --- a/src/script.h +++ b/src/script.h @@ -40,7 +40,7 @@ enum SCRIPT_VERIFY_NONE = 0, SCRIPT_VERIFY_P2SH = (1U << 0), // evaluate P2SH (BIP16) subscripts SCRIPT_VERIFY_STRICTENC = (1U << 1), // enforce strict conformance to DER and SEC2 for signatures and pubkeys - SCRIPT_VERIFY_EVEN_S = (1U << 2), // enforce even S values in signatures (depends on STRICTENC) + SCRIPT_VERIFY_LOW_S = (1U << 2), // enforce low S values ( sig; + uint256 hash = GetRandHash(); + + BOOST_CHECK(key.Sign(hash, sig)); // Generate a random signature. + BOOST_CHECK(key.GetPubKey().Verify(hash, sig)); // Check it. + sig.push_back(0x01); // Append a sighash type. + + BOOST_CHECK(IsCanonicalSignature(sig, SCRIPT_VERIFY_STRICTENC | SCRIPT_VERIFY_LOW_S)); + BOOST_CHECK(IsCanonicalSignature_OpenSSL(sig)); + } +} + BOOST_AUTO_TEST_SUITE_END() From b41e5947735097d12eb795f2d1dc9c79ff391aba Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Wed, 12 Mar 2014 20:07:51 -0400 Subject: [PATCH 0002/1288] Fix script test handling of empty scripts Previously an empty script would evaluate to OP_0 --- src/test/data/script_invalid.json | 10 ++++++++++ src/test/data/script_valid.json | 12 ++++++++++++ src/test/script_tests.cpp | 6 +++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index 8cb365a46f..609c89be06 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -1,8 +1,18 @@ [ +["", "DEPTH", "Test the test: we should have an empty stack after scriptSig evaluation"], +[" ", "DEPTH", "and multiple spaces should not change that."], +[" ", "DEPTH"], +[" ", "DEPTH"], + ["", ""], ["", "NOP"], +["", "NOP DEPTH"], ["NOP", ""], +["NOP", "DEPTH"], ["NOP","NOP"], +["NOP","NOP DEPTH"], + +["DEPTH", ""], ["0x4c01","0x01 NOP", "PUSHDATA1 with not enough bytes"], ["0x4d0200ff","0x01 NOP", "PUSHDATA2 with not enough bytes"], diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index 3b4c191865..c50767071a 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -1,4 +1,16 @@ [ +["", "DEPTH 0 EQUAL", "Test the test: we should have an empty stack after scriptSig evaluation"], +[" ", "DEPTH 0 EQUAL", "and multiple spaces should not change that."], +[" ", "DEPTH 0 EQUAL"], +[" ", "DEPTH 0 EQUAL"], +["1 2", "2 EQUALVERIFY 1 EQUAL", "Similarly whitespace around and between symbols"], +["1 2", "2 EQUALVERIFY 1 EQUAL"], +[" 1 2", "2 EQUALVERIFY 1 EQUAL"], +["1 2 ", "2 EQUALVERIFY 1 EQUAL"], +[" 1 2 ", "2 EQUALVERIFY 1 EQUAL"], + +["1", ""], + ["0x01 0x0b", "11 EQUAL", "push 1 byte"], ["0x02 0x417a", "'Az' EQUAL"], ["0x4b 0x417a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a", diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index dd1b613047..f9ca65653b 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -63,7 +63,11 @@ ParseScript(string s) BOOST_FOREACH(string w, words) { - if (all(w, is_digit()) || + if (w.size() == 0) + { + // Empty string, ignore. (boost::split given '' will return one word) + } + else if (all(w, is_digit()) || (starts_with(w, "-") && all(string(w.begin()+1, w.end()), is_digit()))) { // Number From d3a33fc869d23fb13c010a6e9995bdf6574a621e Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Wed, 12 Mar 2014 21:18:07 -0400 Subject: [PATCH 0003/1288] Test CHECKMULTISIG with m == 0 and n == 0 --- src/test/data/script_invalid.json | 16 ++++++++ src/test/data/script_valid.json | 64 +++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index 609c89be06..c2824cb6f7 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -331,6 +331,22 @@ ["NOP", "HASH160 1"], ["NOP", "HASH256 1"], +["", +"0 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG", +"202 CHECKMULTISIGS, fails due to 201 op limit"], + +["1", +"0 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY"], + +["", +"NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG", +"Fails due to 201 sig op limit"], + +["1", +"NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY"], + + + ["NOP 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL", "Tests for Script.IsPushOnly()"], ["NOP1 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL"], diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index c50767071a..162e5c3abd 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -414,6 +414,70 @@ ["NOP", "NOP9 1"], ["NOP", "NOP10 1"], +["", "0 0 0 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "CHECKMULTISIG is allowed to have zero keys and/or sigs"], +["", "0 0 0 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 0 1 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "Zero sigs means no sigs are checked"], +["", "0 0 0 1 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], + +["", "0 0 0 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "CHECKMULTISIG is allowed to have zero keys and/or sigs"], +["", "0 0 0 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 0 1 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "Zero sigs means no sigs are checked"], +["", "0 0 0 1 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], + +["", "0 0 'a' 'b' 2 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "Test from up to 20 pubkeys, all not checked"], +["", "0 0 'a' 'b' 'c' 3 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 4 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 5 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 6 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 7 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 8 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 9 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 10 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 11 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 12 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 13 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 14 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 15 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 16 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 17 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 18 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 19 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 1 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 2 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 3 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 4 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 5 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 6 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 7 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 8 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 9 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 10 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 11 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 12 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 13 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 14 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 15 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 16 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 17 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 18 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 19 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], + +["", +"0 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG", +"nOpCount is incremented by the number of keys evaluated in addition to the usual one op per op. In this case we have zero keys, so we can execute 201 CHECKMULTISIGS"], + +["1", +"0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY"], + +["", +"NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG", +"Even though there are no signatures being checked nOpCount is incremented by the number of keys."], + +["1", +"NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY"], + ["0 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL", "Very basic P2SH"], ["0x4c 0 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL"], From 75ebced4992aab97b63c1a0842faf7dc37b86768 Mon Sep 17 00:00:00 2001 From: Alon Muroch Date: Mon, 10 Mar 2014 19:23:19 +0100 Subject: [PATCH 0004/1288] added many rpc wallet tests deleted the empty no throw test in rpc_wallet_tests line 65 fixed some comments starting verify tests finished verify message tests changed some comments --- src/test/rpc_wallet_tests.cpp | 87 +++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/src/test/rpc_wallet_tests.cpp b/src/test/rpc_wallet_tests.cpp index af34e496e2..ac6d8ad8f0 100644 --- a/src/test/rpc_wallet_tests.cpp +++ b/src/test/rpc_wallet_tests.cpp @@ -67,6 +67,31 @@ BOOST_AUTO_TEST_CASE(rpc_wallet) LOCK(pwalletMain->cs_wallet); + CPubKey demoPubkey = pwalletMain->GenerateNewKey(); + CBitcoinAddress demoAddress = CBitcoinAddress(CTxDestination(demoPubkey.GetID())); + Value retValue; + string strAccount = "walletDemoAccount"; + string strPurpose = "receive"; + BOOST_CHECK_NO_THROW({ /*Initialize Wallet with an account */ + CWalletDB walletdb(pwalletMain->strWalletFile); + CAccount account; + account.vchPubKey = demoPubkey; + pwalletMain->SetAddressBook(account.vchPubKey.GetID(), strAccount, strPurpose); + walletdb.WriteAccount(strAccount, account); + }); + + + /********************************* + * setaccount + *********************************/ + BOOST_CHECK_NO_THROW(CallRPC("setaccount 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ nullaccount")); + BOOST_CHECK_THROW(CallRPC("setaccount"), runtime_error); + /* 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4X (33 chars) is an illegal address (should be 34 chars) */ + BOOST_CHECK_THROW(CallRPC("setaccount 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4X nullaccount"), runtime_error); + + /********************************* + * listunspent + *********************************/ BOOST_CHECK_NO_THROW(CallRPC("listunspent")); BOOST_CHECK_THROW(CallRPC("listunspent string"), runtime_error); BOOST_CHECK_THROW(CallRPC("listunspent 0 string"), runtime_error); @@ -75,6 +100,9 @@ BOOST_AUTO_TEST_CASE(rpc_wallet) BOOST_CHECK_NO_THROW(r=CallRPC("listunspent 0 1 []")); BOOST_CHECK(r.get_array().empty()); + /********************************* + * listreceivedbyaddress + *********************************/ BOOST_CHECK_NO_THROW(CallRPC("listreceivedbyaddress")); BOOST_CHECK_NO_THROW(CallRPC("listreceivedbyaddress 0")); BOOST_CHECK_THROW(CallRPC("listreceivedbyaddress not_int"), runtime_error); @@ -82,12 +110,71 @@ BOOST_AUTO_TEST_CASE(rpc_wallet) BOOST_CHECK_NO_THROW(CallRPC("listreceivedbyaddress 0 true")); BOOST_CHECK_THROW(CallRPC("listreceivedbyaddress 0 true extra"), runtime_error); + /********************************* + * listreceivedbyaccount + *********************************/ BOOST_CHECK_NO_THROW(CallRPC("listreceivedbyaccount")); BOOST_CHECK_NO_THROW(CallRPC("listreceivedbyaccount 0")); BOOST_CHECK_THROW(CallRPC("listreceivedbyaccount not_int"), runtime_error); BOOST_CHECK_THROW(CallRPC("listreceivedbyaccount 0 not_bool"), runtime_error); BOOST_CHECK_NO_THROW(CallRPC("listreceivedbyaccount 0 true")); BOOST_CHECK_THROW(CallRPC("listreceivedbyaccount 0 true extra"), runtime_error); + + /********************************* + * getrawchangeaddress + *********************************/ + BOOST_CHECK_NO_THROW(CallRPC("getrawchangeaddress")); + + /********************************* + * getnewaddress + *********************************/ + BOOST_CHECK_NO_THROW(CallRPC("getnewaddress")); + BOOST_CHECK_NO_THROW(CallRPC("getnewaddress getnewaddress_demoaccount")); + + /********************************* + * getaccountaddress + *********************************/ + BOOST_CHECK_NO_THROW(CallRPC("getaccountaddress \"\"")); + BOOST_CHECK_NO_THROW(CallRPC("getaccountaddress accountThatDoesntExists")); // Should generate a new account + BOOST_CHECK_NO_THROW(retValue = CallRPC("getaccountaddress " + strAccount)); + BOOST_CHECK(CBitcoinAddress(retValue.get_str()).Get() == demoAddress.Get()); + + /********************************* + * getaccount + *********************************/ + BOOST_CHECK_THROW(CallRPC("getaccount"), runtime_error); + BOOST_CHECK_NO_THROW(CallRPC("getaccount " + demoAddress.ToString())); + + /********************************* + * signmessage + verifymessage + *********************************/ + BOOST_CHECK_NO_THROW(retValue = CallRPC("signmessage " + demoAddress.ToString() + " mymessage")); + BOOST_CHECK_THROW(CallRPC("signmessage"), runtime_error); + /* Should throw error because this address is not loaded in the wallet */ + BOOST_CHECK_THROW(CallRPC("signmessage 1QFqqMUD55ZV3PJEJZtaKCsQmjLT6JkjvJ mymessage"), runtime_error); + + /* missing arguments */ + BOOST_CHECK_THROW(CallRPC("verifymessage "+ demoAddress.ToString()), runtime_error); + BOOST_CHECK_THROW(CallRPC("verifymessage "+ demoAddress.ToString() + " " + retValue.get_str()), runtime_error); + /* Illegal address */ + BOOST_CHECK_THROW(CallRPC("verifymessage 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4X " + retValue.get_str() + " mymessage"), runtime_error); + /* wrong address */ + BOOST_CHECK(CallRPC("verifymessage 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ " + retValue.get_str() + " mymessage").get_bool() == false); + /* Correct address and signature but wrong message */ + BOOST_CHECK(CallRPC("verifymessage "+ demoAddress.ToString() + " " + retValue.get_str() + " wrongmessage").get_bool() == false); + /* Correct address, message and signature*/ + BOOST_CHECK(CallRPC("verifymessage "+ demoAddress.ToString() + " " + retValue.get_str() + " mymessage").get_bool() == true); + + /********************************* + * getaddressesbyaccount + *********************************/ + BOOST_CHECK_THROW(CallRPC("getaddressesbyaccount"), runtime_error); + BOOST_CHECK_NO_THROW(retValue = CallRPC("getaddressesbyaccount " + strAccount)); + Array arr = retValue.get_array(); + BOOST_CHECK(arr.size() > 0); + BOOST_CHECK(CBitcoinAddress(arr[0].get_str()).Get() == demoAddress.Get()); + } + BOOST_AUTO_TEST_SUITE_END() From 3f9a01995e8d43c492eba8e1a08571705bceaef1 Mon Sep 17 00:00:00 2001 From: Alon Muroch Date: Tue, 25 Mar 2014 14:33:44 +0100 Subject: [PATCH 0005/1288] added list/get received by address/ account tests fixed some annotations and cleaned a bit received by tests d --- qa/rpc-tests/receivedby.py | 225 +++++++++++++++++++++++++++++++++++++ 1 file changed, 225 insertions(+) create mode 100755 qa/rpc-tests/receivedby.py diff --git a/qa/rpc-tests/receivedby.py b/qa/rpc-tests/receivedby.py new file mode 100755 index 0000000000..7f2d79b3c1 --- /dev/null +++ b/qa/rpc-tests/receivedby.py @@ -0,0 +1,225 @@ +#!/usr/bin/env python +# Copyright (c) 2014 The Bitcoin Core developers +# Distributed under the MIT/X11 software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +# Exercise the listtransactions API + +# Add python-bitcoinrpc to module search path: + +import os +import sys +sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc")) + +import json +import shutil +import subprocess +import tempfile +import traceback + +from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException +from util import * + +def get_sub_array_from_array(object_array, to_match): + ''' + Finds and returns a sub array from an array of arrays. + to_match should be a unique idetifier of a sub array + ''' + num_matched = 0 + for item in object_array: + all_match = True + for key,value in to_match.items(): + if item[key] != value: + all_match = False + if not all_match: + continue + return item + return [] + +def check_array_result(object_array, to_match, expected, should_not_find = False): + """ + Pass in array of JSON objects, a dictionary with key/value pairs + to match against, and another dictionary with expected key/value + pairs. + If the should_not_find flag is true, to_match should not be found in object_array + """ + if should_not_find == True: + expected = { } + num_matched = 0 + for item in object_array: + all_match = True + for key,value in to_match.items(): + if item[key] != value: + all_match = False + if not all_match: + continue + for key,value in expected.items(): + if item[key] != value: + raise AssertionError("%s : expected %s=%s"%(str(item), str(key), str(value))) + num_matched = num_matched+1 + if num_matched == 0 and should_not_find != True: + raise AssertionError("No objects matched %s"%(str(to_match))) + if num_matched > 0 and should_not_find == True: + raise AssertionError("Objects was matched %s"%(str(to_match))) + +def run_test(nodes): + ''' + listreceivedbyaddress Test + ''' + # Send from node 0 to 1 + addr = nodes[1].getnewaddress() + txid = nodes[0].sendtoaddress(addr, 0.1) + sync_mempools(nodes) + + #Check not listed in listreceivedbyaddress because has 0 confirmations + check_array_result(nodes[1].listreceivedbyaddress(), + {"address":addr}, + { }, + True) + #Bury Tx under 10 block so it will be returned by listreceivedbyaddress + nodes[1].setgenerate(True, 10) + sync_blocks(nodes) + check_array_result(nodes[1].listreceivedbyaddress(), + {"address":addr}, + {"address":addr, "account":"", "amount":Decimal("0.1"), "confirmations":10, "txids":[txid,]}) + #With min confidence < 10 + check_array_result(nodes[1].listreceivedbyaddress(5), + {"address":addr}, + {"address":addr, "account":"", "amount":Decimal("0.1"), "confirmations":10, "txids":[txid,]}) + #With min confidence > 10, should not find Tx + check_array_result(nodes[1].listreceivedbyaddress(11),{"address":addr},{ },True) + + #Empty Tx + addr = nodes[1].getnewaddress() + check_array_result(nodes[1].listreceivedbyaddress(0,True), + {"address":addr}, + {"address":addr, "account":"", "amount":0, "confirmations":0, "txids":[]}) + + ''' + getreceivedbyaddress Test + ''' + # Send from node 0 to 1 + addr = nodes[1].getnewaddress() + txid = nodes[0].sendtoaddress(addr, 0.1) + sync_mempools(nodes) + + #Check balance is 0 because of 0 confirmations + balance = nodes[1].getreceivedbyaddress(addr) + if balance != Decimal("0.0"): + raise AssertionError("Wrong balance returned by getreceivedbyaddress, %0.2f"%(balance)) + + #Check balance is 0.1 + balance = nodes[1].getreceivedbyaddress(addr,0) + if balance != Decimal("0.1"): + raise AssertionError("Wrong balance returned by getreceivedbyaddress, %0.2f"%(balance)) + + #Bury Tx under 10 block so it will be returned by the default getreceivedbyaddress + nodes[1].setgenerate(True, 10) + sync_blocks(nodes) + balance = nodes[1].getreceivedbyaddress(addr) + if balance != Decimal("0.1"): + raise AssertionError("Wrong balance returned by getreceivedbyaddress, %0.2f"%(balance)) + + ''' + listreceivedbyaccount + getreceivedbyaccount Test + ''' + #set pre-state + addrArr = nodes[1].getnewaddress() + account = nodes[1].getaccount(addrArr) + received_by_account_json = get_sub_array_from_array(nodes[1].listreceivedbyaccount(),{"account":account}) + if len(received_by_account_json) == 0: + raise AssertionError("No accounts found in node") + balance_by_account = rec_by_accountArr = nodes[1].getreceivedbyaccount(account) + + txid = nodes[0].sendtoaddress(addr, 0.1) + + # listreceivedbyaccount should return received_by_account_json because of 0 confirmations + check_array_result(nodes[1].listreceivedbyaccount(), + {"account":account}, + received_by_account_json) + + # getreceivedbyaddress should return same balance because of 0 confirmations + balance = nodes[1].getreceivedbyaccount(account) + if balance != balance_by_account: + raise AssertionError("Wrong balance returned by getreceivedbyaccount, %0.2f"%(balance)) + + nodes[1].setgenerate(True, 10) + sync_blocks(nodes) + # listreceivedbyaccount should return updated account balance + check_array_result(nodes[1].listreceivedbyaccount(), + {"account":account}, + {"account":received_by_account_json["account"], "amount":(received_by_account_json["amount"] + Decimal("0.1"))}) + + # getreceivedbyaddress should return updates balance + balance = nodes[1].getreceivedbyaccount(account) + if balance != balance_by_account + Decimal("0.1"): + raise AssertionError("Wrong balance returned by getreceivedbyaccount, %0.2f"%(balance)) + + #Create a new account named "mynewaccount" that has a 0 balance + nodes[1].getaccountaddress("mynewaccount") + received_by_account_json = get_sub_array_from_array(nodes[1].listreceivedbyaccount(0,True),{"account":"mynewaccount"}) + if len(received_by_account_json) == 0: + raise AssertionError("No accounts found in node") + + # Test includeempty of listreceivedbyaccount + if received_by_account_json["amount"] != Decimal("0.0"): + raise AssertionError("Wrong balance returned by listreceivedbyaccount, %0.2f"%(received_by_account_json["amount"])) + + # Test getreceivedbyaccount for 0 amount accounts + balance = nodes[1].getreceivedbyaccount("mynewaccount") + if balance != Decimal("0.0"): + raise AssertionError("Wrong balance returned by getreceivedbyaccount, %0.2f"%(balance)) + +def main(): + import optparse + + parser = optparse.OptionParser(usage="%prog [options]") + parser.add_option("--nocleanup", dest="nocleanup", default=False, action="store_true", + help="Leave bitcoinds and test.* datadir on exit or error") + parser.add_option("--srcdir", dest="srcdir", default="../../src", + help="Source directory containing bitcoind/bitcoin-cli (default: %default%)") + parser.add_option("--tmpdir", dest="tmpdir", default=tempfile.mkdtemp(prefix="test"), + help="Root directory for datadirs") + (options, args) = parser.parse_args() + + os.environ['PATH'] = options.srcdir+":"+os.environ['PATH'] + + check_json_precision() + + success = False + nodes = [] + try: + print("Initializing test directory "+options.tmpdir) + if not os.path.isdir(options.tmpdir): + os.makedirs(options.tmpdir) + initialize_chain(options.tmpdir) + + nodes = start_nodes(2, options.tmpdir) + connect_nodes(nodes[1], 0) + sync_blocks(nodes) + + run_test(nodes) + + success = True + + except AssertionError as e: + print("Assertion failed: "+e.message) + except Exception as e: + print("Unexpected exception caught during testing: "+str(e)) + traceback.print_tb(sys.exc_info()[2]) + + if not options.nocleanup: + print("Cleaning up") + stop_nodes(nodes) + wait_bitcoinds() + shutil.rmtree(options.tmpdir) + + if success: + print("Tests successful") + sys.exit(0) + else: + print("Failed") + sys.exit(1) + +if __name__ == '__main__': + main() From 48d8eb1847d4218ee24ec1c27c73b90e03b1f007 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 26 Mar 2014 15:50:29 -0400 Subject: [PATCH 0006/1288] script: add CScriptNum class This class holds an int64_t and replaces the use of CBigInt for script integrals. --- src/script.h | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) diff --git a/src/script.h b/src/script.h index 657ac0b388..9bc06b2e07 100644 --- a/src/script.h +++ b/src/script.h @@ -25,6 +25,155 @@ class CTransaction; static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; // bytes static const unsigned int MAX_OP_RETURN_RELAY = 40; // bytes +class scriptnum_error : public std::runtime_error +{ +public: + explicit scriptnum_error(const std::string& str) : std::runtime_error(str) {} +}; + +class CScriptNum +{ +// Numeric opcodes (OP_1ADD, etc) are restricted to operating on 4-byte integers. +// The semantics are subtle, though: operands must be in the range [-2^31 +1...2^31 -1], +// but results may overflow (and are valid as long as they are not used in a subsequent +// numeric operation). CScriptNum enforces those semantics by storing results as +// an int64 and allowing out-of-range values to be returned as a vector of bytes but +// throwing an exception if arithmetic is done or the result is interpreted as an integer. +public: + + explicit CScriptNum(const int64_t& n) + { + m_value = n; + } + + explicit CScriptNum(const std::vector& vch) + { + if (vch.size() > nMaxNumSize) + throw scriptnum_error("CScriptNum(const std::vector&) : overflow"); + m_value = set_vch(vch); + } + + inline bool operator==(const int64_t& rhs) const { return m_value == rhs; } + inline bool operator!=(const int64_t& rhs) const { return m_value != rhs; } + inline bool operator<=(const int64_t& rhs) const { return m_value <= rhs; } + inline bool operator< (const int64_t& rhs) const { return m_value < rhs; } + inline bool operator>=(const int64_t& rhs) const { return m_value >= rhs; } + inline bool operator> (const int64_t& rhs) const { return m_value > rhs; } + + inline bool operator==(const CScriptNum& rhs) const { return operator==(rhs.m_value); } + inline bool operator!=(const CScriptNum& rhs) const { return operator!=(rhs.m_value); } + inline bool operator<=(const CScriptNum& rhs) const { return operator<=(rhs.m_value); } + inline bool operator< (const CScriptNum& rhs) const { return operator< (rhs.m_value); } + inline bool operator>=(const CScriptNum& rhs) const { return operator>=(rhs.m_value); } + inline bool operator> (const CScriptNum& rhs) const { return operator> (rhs.m_value); } + + inline CScriptNum operator+( const int64_t& rhs) const { return CScriptNum(m_value + rhs);} + inline CScriptNum operator-( const int64_t& rhs) const { return CScriptNum(m_value - rhs);} + inline CScriptNum operator+( const CScriptNum& rhs) const { return operator+(rhs.m_value); } + inline CScriptNum operator-( const CScriptNum& rhs) const { return operator-(rhs.m_value); } + + inline CScriptNum& operator+=( const CScriptNum& rhs) { return operator+=(rhs.m_value); } + inline CScriptNum& operator-=( const CScriptNum& rhs) { return operator-=(rhs.m_value); } + + inline CScriptNum operator-() const + { + assert(m_value != std::numeric_limits::min()); + return CScriptNum(-m_value); + } + + inline CScriptNum& operator=( const int64_t& rhs) + { + m_value = rhs; + return *this; + } + + inline CScriptNum& operator+=( const int64_t& rhs) + { + assert(rhs == 0 || (rhs > 0 && m_value <= std::numeric_limits::max() - rhs) || + (rhs < 0 && m_value >= std::numeric_limits::min() - rhs)); + m_value += rhs; + return *this; + } + + inline CScriptNum& operator-=( const int64_t& rhs) + { + assert(rhs == 0 || (rhs > 0 && m_value >= std::numeric_limits::min() + rhs) || + (rhs < 0 && m_value <= std::numeric_limits::max() + rhs)); + m_value -= rhs; + return *this; + } + + int getint() const + { + if (m_value > std::numeric_limits::max()) + return std::numeric_limits::max(); + else if (m_value < std::numeric_limits::min()) + return std::numeric_limits::min(); + return m_value; + } + + std::vector getvch() const + { + return serialize(m_value); + } + + static std::vector serialize(const int64_t& value) + { + if(value == 0) + return std::vector(); + + std::vector result; + const bool neg = value < 0; + uint64_t absvalue = neg ? -value : value; + + while(absvalue) + { + result.push_back(absvalue & 0xff); + absvalue >>= 8; + } + + +// - If the most significant byte is >= 0x80 and the value is positive, push a +// new zero-byte to make the significant byte < 0x80 again. + +// - If the most significant byte is >= 0x80 and the value is negative, push a +// new 0x80 byte that will be popped off when converting to an integral. + +// - If the most significant byte is < 0x80 and the value is negative, add +// 0x80 to it, since it will be subtracted and interpreted as a negative when +// converting to an integral. + + if (result.back() & 0x80) + result.push_back(neg ? 0x80 : 0); + else if (neg) + result.back() |= 0x80; + + return result; + } + + static const size_t nMaxNumSize = 4; + +private: + static int64_t set_vch(const std::vector& vch) + { + if (vch.empty()) + return 0; + + int64_t result = 0; + for (size_t i = 0; i != vch.size(); ++i) + result |= static_cast(vch[i]) << 8*i; + + // If the input vector's most significant byte is 0x80, remove it from + // the result's msb and return a negative. + if (vch.back() & 0x80) + return -(result & ~(0x80 << (8 * (vch.size() - 1)))); + + return result; + } + + int64_t m_value; +}; + /** Signature hash types/flags */ enum { From 27bff74e39c4c2951a709114e0d565568a0554fa Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 26 Mar 2014 15:55:35 -0400 Subject: [PATCH 0007/1288] script: switch to CScriptNum usage for scripts --- src/script.cpp | 44 +++++++++++++++++-------------------------- src/script.h | 51 +++++++++++--------------------------------------- 2 files changed, 28 insertions(+), 67 deletions(-) diff --git a/src/script.cpp b/src/script.cpp index 810ba16d28..25180e0bbb 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -25,22 +25,13 @@ typedef vector valtype; static const valtype vchFalse(0); static const valtype vchZero(0); static const valtype vchTrue(1, 1); -static const CBigNum bnZero(0); -static const CBigNum bnOne(1); -static const CBigNum bnFalse(0); -static const CBigNum bnTrue(1); -static const size_t nMaxNumSize = 4; +static const CScriptNum bnZero(0); +static const CScriptNum bnOne(1); +static const CScriptNum bnFalse(0); +static const CScriptNum bnTrue(1); bool CheckSig(vector vchSig, const vector &vchPubKey, const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, int flags); -CBigNum CastToBigNum(const valtype& vch) -{ - if (vch.size() > nMaxNumSize) - throw runtime_error("CastToBigNum() : overflow"); - // Get rid of extra leading zeros - return CBigNum(CBigNum(vch).getvch()); -} - bool CastToBool(const valtype& vch) { for (unsigned int i = 0; i < vch.size(); i++) @@ -306,7 +297,6 @@ bool IsCanonicalSignature(const valtype &vchSig, unsigned int flags) { bool EvalScript(vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType) { - CAutoBN_CTX pctx; CScript::const_iterator pc = script.begin(); CScript::const_iterator pend = script.end(); CScript::const_iterator pbegincodehash = script.begin(); @@ -380,7 +370,7 @@ bool EvalScript(vector >& stack, const CScript& script, co case OP_16: { // ( -- value) - CBigNum bn((int)opcode - (int)(OP_1 - 1)); + CScriptNum bn((int)opcode - (int)(OP_1 - 1)); stack.push_back(bn.getvch()); } break; @@ -556,7 +546,7 @@ bool EvalScript(vector >& stack, const CScript& script, co case OP_DEPTH: { // -- stacksize - CBigNum bn(stack.size()); + CScriptNum bn(stack.size()); stack.push_back(bn.getvch()); } break; @@ -606,7 +596,7 @@ bool EvalScript(vector >& stack, const CScript& script, co // (xn ... x2 x1 x0 n - ... x2 x1 x0 xn) if (stack.size() < 2) return false; - int n = CastToBigNum(stacktop(-1)).getint(); + int n = CScriptNum(stacktop(-1)).getint(); popstack(stack); if (n < 0 || n >= (int)stack.size()) return false; @@ -654,7 +644,7 @@ bool EvalScript(vector >& stack, const CScript& script, co // (in -- in size) if (stack.size() < 1) return false; - CBigNum bn(stacktop(-1).size()); + CScriptNum bn(stacktop(-1).size()); stack.push_back(bn.getvch()); } break; @@ -705,7 +695,7 @@ bool EvalScript(vector >& stack, const CScript& script, co // (in -- out) if (stack.size() < 1) return false; - CBigNum bn = CastToBigNum(stacktop(-1)); + CScriptNum bn(stacktop(-1)); switch (opcode) { case OP_1ADD: bn += bnOne; break; @@ -738,9 +728,9 @@ bool EvalScript(vector >& stack, const CScript& script, co // (x1 x2 -- out) if (stack.size() < 2) return false; - CBigNum bn1 = CastToBigNum(stacktop(-2)); - CBigNum bn2 = CastToBigNum(stacktop(-1)); - CBigNum bn; + CScriptNum bn1(stacktop(-2)); + CScriptNum bn2(stacktop(-1)); + CScriptNum bn(0); switch (opcode) { case OP_ADD: @@ -783,9 +773,9 @@ bool EvalScript(vector >& stack, const CScript& script, co // (x min max -- out) if (stack.size() < 3) return false; - CBigNum bn1 = CastToBigNum(stacktop(-3)); - CBigNum bn2 = CastToBigNum(stacktop(-2)); - CBigNum bn3 = CastToBigNum(stacktop(-1)); + CScriptNum bn1(stacktop(-3)); + CScriptNum bn2(stacktop(-2)); + CScriptNum bn3(stacktop(-1)); bool fValue = (bn2 <= bn1 && bn1 < bn3); popstack(stack); popstack(stack); @@ -882,7 +872,7 @@ bool EvalScript(vector >& stack, const CScript& script, co if ((int)stack.size() < i) return false; - int nKeysCount = CastToBigNum(stacktop(-i)).getint(); + int nKeysCount = CScriptNum(stacktop(-i)).getint(); if (nKeysCount < 0 || nKeysCount > 20) return false; nOpCount += nKeysCount; @@ -893,7 +883,7 @@ bool EvalScript(vector >& stack, const CScript& script, co if ((int)stack.size() < i) return false; - int nSigsCount = CastToBigNum(stacktop(-i)).getint(); + int nSigsCount = CScriptNum(stacktop(-i)).getint(); if (nSigsCount < 0 || nSigsCount > nKeysCount) return false; int isig = ++i; diff --git a/src/script.h b/src/script.h index 9bc06b2e07..7781ea61c7 100644 --- a/src/script.h +++ b/src/script.h @@ -374,7 +374,7 @@ const char* GetOpName(opcodetype opcode); inline std::string ValueString(const std::vector& vch) { if (vch.size() <= 4) - return strprintf("%d", CBigNum(vch).getint()); + return strprintf("%d", CScriptNum(vch).getint()); else return HexStr(vch); } @@ -410,26 +410,10 @@ protected: } else { - CBigNum bn(n); - *this << bn.getvch(); + *this << CScriptNum::serialize(n); } return *this; } - - CScript& push_uint64(uint64_t n) - { - if (n >= 1 && n <= 16) - { - push_back(n + (OP_1 - 1)); - } - else - { - CBigNum bn(n); - *this << bn.getvch(); - } - return *this; - } - public: CScript() { } CScript(const CScript& b) : std::vector(b.begin(), b.end()) { } @@ -452,35 +436,16 @@ public: } - //explicit CScript(char b) is not portable. Use 'signed char' or 'unsigned char'. - explicit CScript(signed char b) { operator<<(b); } - explicit CScript(short b) { operator<<(b); } - explicit CScript(int b) { operator<<(b); } - explicit CScript(long b) { operator<<(b); } - explicit CScript(long long b) { operator<<(b); } - explicit CScript(unsigned char b) { operator<<(b); } - explicit CScript(unsigned int b) { operator<<(b); } - explicit CScript(unsigned short b) { operator<<(b); } - explicit CScript(unsigned long b) { operator<<(b); } - explicit CScript(unsigned long long b) { operator<<(b); } + CScript(int64_t b) { operator<<(b); } explicit CScript(opcodetype b) { operator<<(b); } explicit CScript(const uint256& b) { operator<<(b); } + explicit CScript(const CScriptNum& b) { operator<<(b); } explicit CScript(const CBigNum& b) { operator<<(b); } explicit CScript(const std::vector& b) { operator<<(b); } - //CScript& operator<<(char b) is not portable. Use 'signed char' or 'unsigned char'. - CScript& operator<<(signed char b) { return push_int64(b); } - CScript& operator<<(short b) { return push_int64(b); } - CScript& operator<<(int b) { return push_int64(b); } - CScript& operator<<(long b) { return push_int64(b); } - CScript& operator<<(long long b) { return push_int64(b); } - CScript& operator<<(unsigned char b) { return push_uint64(b); } - CScript& operator<<(unsigned int b) { return push_uint64(b); } - CScript& operator<<(unsigned short b) { return push_uint64(b); } - CScript& operator<<(unsigned long b) { return push_uint64(b); } - CScript& operator<<(unsigned long long b) { return push_uint64(b); } + CScript& operator<<(int64_t b) { return push_int64(b); } CScript& operator<<(opcodetype opcode) { @@ -518,6 +483,12 @@ public: return *this; } + CScript& operator<<(const CScriptNum& b) + { + *this << b.getvch(); + return *this; + } + CScript& operator<<(const std::vector& b) { if (b.size() < OP_PUSHDATA1) From 4f497cd97da4f9c88790a5f4e97926804669dfca Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 26 Mar 2014 15:56:45 -0400 Subject: [PATCH 0008/1288] script: switch outside users to CScriptNum --- src/chainparams.cpp | 2 +- src/miner.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index b52774ee20..eb56800b92 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -125,7 +125,7 @@ public: CTransaction txNew; txNew.vin.resize(1); txNew.vout.resize(1); - txNew.vin[0].scriptSig = CScript() << 486604799 << CBigNum(4) << vector((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp)); + txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << vector((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp)); txNew.vout[0].nValue = 50 * COIN; txNew.vout[0].scriptPubKey = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG; genesis.vtx.push_back(txNew); diff --git a/src/miner.cpp b/src/miner.cpp index 3351908e65..f21ee0c3a8 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -355,7 +355,7 @@ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& } ++nExtraNonce; unsigned int nHeight = pindexPrev->nHeight+1; // Height first in coinbase required for block.version=2 - pblock->vtx[0].vin[0].scriptSig = (CScript() << nHeight << CBigNum(nExtraNonce)) + COINBASE_FLAGS; + pblock->vtx[0].vin[0].scriptSig = (CScript() << nHeight << CScriptNum(nExtraNonce)) + COINBASE_FLAGS; assert(pblock->vtx[0].vin[0].scriptSig.size() <= 100); pblock->hashMerkleRoot = pblock->BuildMerkleTree(); From 05e3ecffa495c0905b88cfc92b23bb519b7fe70b Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 26 Mar 2014 15:57:21 -0400 Subject: [PATCH 0009/1288] script: remove bignum dependency --- src/script.cpp | 1 - src/script.h | 8 -------- 2 files changed, 9 deletions(-) diff --git a/src/script.cpp b/src/script.cpp index 25180e0bbb..81d2754453 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -5,7 +5,6 @@ #include "script.h" -#include "bignum.h" #include "core.h" #include "hash.h" #include "key.h" diff --git a/src/script.h b/src/script.h index 7781ea61c7..1742ce81f8 100644 --- a/src/script.h +++ b/src/script.h @@ -6,7 +6,6 @@ #ifndef H_BITCOIN_SCRIPT #define H_BITCOIN_SCRIPT -#include "bignum.h" #include "key.h" #include "util.h" @@ -441,7 +440,6 @@ public: explicit CScript(opcodetype b) { operator<<(b); } explicit CScript(const uint256& b) { operator<<(b); } explicit CScript(const CScriptNum& b) { operator<<(b); } - explicit CScript(const CBigNum& b) { operator<<(b); } explicit CScript(const std::vector& b) { operator<<(b); } @@ -477,12 +475,6 @@ public: return *this; } - CScript& operator<<(const CBigNum& b) - { - *this << b.getvch(); - return *this; - } - CScript& operator<<(const CScriptNum& b) { *this << b.getvch(); From 90320d67779be5c97061380c035d3fe51b7ce74b Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 22 Apr 2014 00:10:33 -0400 Subject: [PATCH 0010/1288] script: add additional script tests --- src/test/data/script_invalid.json | 3 +++ src/test/data/script_valid.json | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index 8cb365a46f..fdceb1ffa9 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -257,7 +257,10 @@ ["1","0xba", "0xba == OP_NOP10 + 1"], ["2147483648", "1ADD 1", "We cannot do math on 5-byte integers"], +["2147483648", "NEGATE 1", "We cannot do math on 5-byte integers"], ["-2147483648", "1ADD 1", "Because we use a sign bit, -2147483648 is also 5 bytes"], +["2147483647", "1ADD 1SUB 1", "We cannot do math on 5-byte integers, even if the result is 4-bytes"], +["2147483648", "1SUB 1", "We cannot do math on 5-byte integers, even if the result is 4-bytes"], ["1", "1 ENDIF", "ENDIF without IF"], ["1", "IF 1", "IF without ENDIF"], diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index 3b4c191865..67b985e355 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -97,6 +97,9 @@ ["8388608", "SIZE 4 EQUAL"], ["2147483647", "SIZE 4 EQUAL"], ["2147483648", "SIZE 5 EQUAL"], +["549755813887", "SIZE 5 EQUAL"], +["549755813888", "SIZE 6 EQUAL"], +["9223372036854775807", "SIZE 8 EQUAL"], ["-1", "SIZE 1 EQUAL"], ["-127", "SIZE 1 EQUAL"], ["-128", "SIZE 2 EQUAL"], @@ -106,6 +109,9 @@ ["-8388608", "SIZE 4 EQUAL"], ["-2147483647", "SIZE 4 EQUAL"], ["-2147483648", "SIZE 5 EQUAL"], +["-549755813887", "SIZE 5 EQUAL"], +["-549755813888", "SIZE 6 EQUAL"], +["-9223372036854775807", "SIZE 8 EQUAL"], ["'abcdefghijklmnopqrstuvwxyz'", "SIZE 26 EQUAL"], @@ -306,6 +312,9 @@ ["8388608", "0x04 0x00008000 EQUAL"], ["2147483647", "0x04 0xFFFFFF7F EQUAL"], ["2147483648", "0x05 0x0000008000 EQUAL"], +["549755813887", "0x05 0xFFFFFFFF7F EQUAL"], +["549755813888", "0x06 0xFFFFFFFF7F EQUAL"], +["9223372036854775807", "0x08 0xFFFFFFFFFFFFFF7F EQUAL"], ["-1", "0x01 0x81 EQUAL", "Numbers are little-endian with the MSB being a sign bit"], ["-127", "0x01 0xFF EQUAL"], ["-128", "0x02 0x8080 EQUAL"], @@ -315,6 +324,10 @@ ["-8388608", "0x04 0x00008080 EQUAL"], ["-2147483647", "0x04 0xFFFFFFFF EQUAL"], ["-2147483648", "0x05 0x0000008080 EQUAL"], +["-4294967295", "0x05 0xFFFFFFFF80 EQUAL"], +["-549755813887", "0x05 0xFFFFFFFFFF EQUAL"], +["-549755813888", "0x06 0x000000008080 EQUAL"], +["-9223372036854775807", "0x08 0xFFFFFFFFFFFFFFFF EQUAL"], ["2147483647", "1ADD 2147483648 EQUAL", "We can do math on 4-byte integers, and compare 5-byte ones"], ["2147483647", "1ADD 1"], From b1fdd5475d9040445d7655730f262f214ea87c5f Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 22 Apr 2014 00:11:39 -0400 Subject: [PATCH 0011/1288] script: Add test for CScriptNum Because this class replaces some usages of CBigNum, tests have been added to verify that they function the same way. The only difference in their usage is the handling of out-of-range numbers. While operands are constrained to [-0x7FFFFFFF,0x7FFFFFFF], the results may overflow. The overflowing result is technically unbounded, but in practice it can be no bigger than the result of an operation on two operands. This implementation limits them to the size of an int64. CBigNum was unaware of this constraint, so it allowed for unbounded results, which were then checked before use. CScriptNum asserts if an arithmetic operation will overflow an int64_t, since scripts are not able to reach those numbers anyway. Additionally, CScriptNum will throw an exception when constructed from a vector containing more than 4 bytes This mimics the previous CastToBigNum behavior. --- src/test/Makefile.am | 1 + src/test/scriptnum_tests.cpp | 196 +++++++++++++++++++++++++++++++++++ 2 files changed, 197 insertions(+) create mode 100644 src/test/scriptnum_tests.cpp diff --git a/src/test/Makefile.am b/src/test/Makefile.am index b375ba1306..e12f4904f1 100644 --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -61,6 +61,7 @@ test_bitcoin_SOURCES = \ transaction_tests.cpp \ uint256_tests.cpp \ util_tests.cpp \ + scriptnum_tests.cpp \ sighash_tests.cpp \ $(JSON_TEST_FILES) $(RAW_TEST_FILES) diff --git a/src/test/scriptnum_tests.cpp b/src/test/scriptnum_tests.cpp new file mode 100644 index 0000000000..cd194cc4d9 --- /dev/null +++ b/src/test/scriptnum_tests.cpp @@ -0,0 +1,196 @@ +// Copyright (c) 2012-2014 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "bignum.h" +#include "script.h" +#include +#include +#include +BOOST_AUTO_TEST_SUITE(scriptnum_tests) + +static const int64_t values[] = \ +{ 0, 1, CHAR_MIN, CHAR_MAX, UCHAR_MAX, SHRT_MIN, USHRT_MAX, INT_MIN, INT_MAX, UINT_MAX, LONG_MIN, LONG_MAX }; +static const int64_t offsets[] = { 1, 0x79, 0x80, 0x81, 0xFF, 0x7FFF, 0x8000, 0xFFFF, 0x10000}; + +static bool verify(const CBigNum& bignum, const CScriptNum& scriptnum) +{ + return bignum.getvch() == scriptnum.getvch() && bignum.getint() == scriptnum.getint(); +} + +static void CheckCreateVch(const int64_t& num) +{ + CBigNum bignum(num); + CScriptNum scriptnum(num); + BOOST_CHECK(verify(bignum, scriptnum)); + + CBigNum bignum2(bignum.getvch()); + CScriptNum scriptnum2(scriptnum.getvch()); + BOOST_CHECK(verify(bignum2, scriptnum2)); + + CBigNum bignum3(scriptnum2.getvch()); + CScriptNum scriptnum3(bignum2.getvch()); + BOOST_CHECK(verify(bignum3, scriptnum3)); +} + +static void CheckCreateInt(const int64_t& num) +{ + CBigNum bignum(num); + CScriptNum scriptnum(num); + BOOST_CHECK(verify(bignum, scriptnum)); + BOOST_CHECK(verify(bignum.getint(), CScriptNum(scriptnum.getint()))); + BOOST_CHECK(verify(scriptnum.getint(), CScriptNum(bignum.getint()))); + BOOST_CHECK(verify(CBigNum(scriptnum.getint()).getint(), CScriptNum(CScriptNum(bignum.getint()).getint()))); +} + + +static void CheckAdd(const int64_t& num1, const int64_t& num2) +{ + const CBigNum bignum1(num1); + const CBigNum bignum2(num2); + const CScriptNum scriptnum1(num1); + const CScriptNum scriptnum2(num2); + CBigNum bignum3(num1); + CBigNum bignum4(num1); + CScriptNum scriptnum3(num1); + CScriptNum scriptnum4(num1); + + // int64_t overflow is undefined. + bool invalid = (((num2 > 0) && (num1 > (std::numeric_limits::max() - num2))) || + ((num2 < 0) && (num1 < (std::numeric_limits::min() - num2)))); + if (!invalid) + { + BOOST_CHECK(verify(bignum1 + bignum2, scriptnum1 + scriptnum2)); + BOOST_CHECK(verify(bignum1 + bignum2, scriptnum1 + num2)); + BOOST_CHECK(verify(bignum1 + bignum2, scriptnum2 + num1)); + } +} + +static void CheckNegate(const int64_t& num) +{ + const CBigNum bignum(num); + const CScriptNum scriptnum(num); + + // -INT64_MIN is undefined + if (num != std::numeric_limits::min()) + BOOST_CHECK(verify(-bignum, -scriptnum)); +} + +static void CheckSubtract(const int64_t& num1, const int64_t& num2) +{ + const CBigNum bignum1(num1); + const CBigNum bignum2(num2); + const CScriptNum scriptnum1(num1); + const CScriptNum scriptnum2(num2); + bool invalid = false; + + // int64_t overflow is undefined. + invalid = ((num2 > 0 && num1 < std::numeric_limits::min() + num2) || + (num2 < 0 && num1 > std::numeric_limits::max() + num2)); + if (!invalid) + { + BOOST_CHECK(verify(bignum1 - bignum2, scriptnum1 - scriptnum2)); + BOOST_CHECK(verify(bignum1 - bignum2, scriptnum1 - num2)); + } + + invalid = ((num1 > 0 && num2 < std::numeric_limits::min() + num1) || + (num1 < 0 && num2 > std::numeric_limits::max() + num1)); + if (!invalid) + { + BOOST_CHECK(verify(bignum2 - bignum1, scriptnum2 - scriptnum1)); + BOOST_CHECK(verify(bignum2 - bignum1, scriptnum2 - num1)); + } +} + +static void CheckCompare(const int64_t& num1, const int64_t& num2) +{ + const CBigNum bignum1(num1); + const CBigNum bignum2(num2); + const CScriptNum scriptnum1(num1); + const CScriptNum scriptnum2(num2); + + BOOST_CHECK((bignum1 == bignum1) == (scriptnum1 == scriptnum1)); + BOOST_CHECK((bignum1 != bignum1) == (scriptnum1 != scriptnum1)); + BOOST_CHECK((bignum1 < bignum1) == (scriptnum1 < scriptnum1)); + BOOST_CHECK((bignum1 > bignum1) == (scriptnum1 > scriptnum1)); + BOOST_CHECK((bignum1 >= bignum1) == (scriptnum1 >= scriptnum1)); + BOOST_CHECK((bignum1 <= bignum1) == (scriptnum1 <= scriptnum1)); + + BOOST_CHECK((bignum1 == bignum1) == (scriptnum1 == num1)); + BOOST_CHECK((bignum1 != bignum1) == (scriptnum1 != num1)); + BOOST_CHECK((bignum1 < bignum1) == (scriptnum1 < num1)); + BOOST_CHECK((bignum1 > bignum1) == (scriptnum1 > num1)); + BOOST_CHECK((bignum1 >= bignum1) == (scriptnum1 >= num1)); + BOOST_CHECK((bignum1 <= bignum1) == (scriptnum1 <= num1)); + + BOOST_CHECK((bignum1 == bignum2) == (scriptnum1 == scriptnum2)); + BOOST_CHECK((bignum1 != bignum2) == (scriptnum1 != scriptnum2)); + BOOST_CHECK((bignum1 < bignum2) == (scriptnum1 < scriptnum2)); + BOOST_CHECK((bignum1 > bignum2) == (scriptnum1 > scriptnum2)); + BOOST_CHECK((bignum1 >= bignum2) == (scriptnum1 >= scriptnum2)); + BOOST_CHECK((bignum1 <= bignum2) == (scriptnum1 <= scriptnum2)); + + BOOST_CHECK((bignum1 == bignum2) == (scriptnum1 == num2)); + BOOST_CHECK((bignum1 != bignum2) == (scriptnum1 != num2)); + BOOST_CHECK((bignum1 < bignum2) == (scriptnum1 < num2)); + BOOST_CHECK((bignum1 > bignum2) == (scriptnum1 > num2)); + BOOST_CHECK((bignum1 >= bignum2) == (scriptnum1 >= num2)); + BOOST_CHECK((bignum1 <= bignum2) == (scriptnum1 <= num2)); +} + +static void RunCreate(const int64_t& num) +{ + CheckCreateInt(num); + CScriptNum scriptnum(num); + if (scriptnum.getvch().size() <= CScriptNum::nMaxNumSize) + CheckCreateVch(num); + else + { + BOOST_CHECK_THROW (CheckCreateVch(num), scriptnum_error); + } +} + +static void RunOperators(const int64_t& num1, const int64_t& num2) +{ + CheckAdd(num1, num2); + CheckSubtract(num1, num2); + CheckNegate(num1); + CheckCompare(num1, num2); +} + +BOOST_AUTO_TEST_CASE(creation) +{ + for(size_t i = 0; i < sizeof(values) / sizeof(values[0]); ++i) + { + for(size_t j = 0; j < sizeof(offsets) / sizeof(offsets[0]); ++j) + { + RunCreate(values[i]); + RunCreate(values[i] + offsets[j]); + RunCreate(values[i] - offsets[j]); + } + } +} + +BOOST_AUTO_TEST_CASE(operators) +{ + for(size_t i = 0; i < sizeof(values) / sizeof(values[0]); ++i) + { + for(size_t j = 0; j < sizeof(offsets) / sizeof(offsets[0]); ++j) + { + RunOperators(values[i], values[i]); + RunOperators(values[i], -values[i]); + RunOperators(values[i], values[j]); + RunOperators(values[i], -values[j]); + RunOperators(values[i] + values[j], values[j]); + RunOperators(values[i] + values[j], -values[j]); + RunOperators(values[i] - values[j], values[j]); + RunOperators(values[i] - values[j], -values[j]); + RunOperators(values[i] + values[j], values[i] + values[j]); + RunOperators(values[i] + values[j], values[i] - values[j]); + RunOperators(values[i] - values[j], values[i] + values[j]); + RunOperators(values[i] - values[j], values[i] - values[j]); + } + } +} + +BOOST_AUTO_TEST_SUITE_END() From f457347053029d6a0248036a1ffeb7127108fd6d Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 11 Mar 2014 17:36:21 +0100 Subject: [PATCH 0012/1288] Split up CheckBlock in a block and header version --- src/main.cpp | 26 +++++++++++++++++--------- src/main.h | 1 + 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 7a6d4b39de..66800cc224 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2288,16 +2288,8 @@ bool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos, unsigne } -bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bool fCheckMerkleRoot) +bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool fCheckPOW) { - // These are checks that are independent of context - // that can be verified before saving an orphan block. - - // Size limits - if (block.vtx.empty() || block.vtx.size() > MAX_BLOCK_SIZE || ::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION) > MAX_BLOCK_SIZE) - return state.DoS(100, error("CheckBlock() : size limits failed"), - REJECT_INVALID, "bad-blk-length"); - // Check proof of work matches claimed amount if (fCheckPOW && !CheckProofOfWork(block.GetHash(), block.nBits)) return state.DoS(50, error("CheckBlock() : proof of work failed"), @@ -2308,6 +2300,22 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo return state.Invalid(error("CheckBlock() : block timestamp too far in the future"), REJECT_INVALID, "time-too-new"); + return true; +} + +bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bool fCheckMerkleRoot) +{ + // These are checks that are independent of context + // that can be verified before saving an orphan block. + + if (!CheckBlockHeader(block, state, fCheckPOW)) + return false; + + // Size limits + if (block.vtx.empty() || block.vtx.size() > MAX_BLOCK_SIZE || ::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION) > MAX_BLOCK_SIZE) + return state.DoS(100, error("CheckBlock() : size limits failed"), + REJECT_INVALID, "bad-blk-length"); + // First transaction must be coinbase, the rest must not be if (block.vtx.empty() || !block.vtx[0].IsCoinBase()) return state.DoS(100, error("CheckBlock() : first tx is not coinbase"), diff --git a/src/main.h b/src/main.h index aff20d0379..8e3f1d95ce 100644 --- a/src/main.h +++ b/src/main.h @@ -603,6 +603,7 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C bool AddToBlockIndex(CBlock& block, CValidationState& state, const CDiskBlockPos& pos); // Context-independent validity checks +bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool fCheckPOW = true); bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW = true, bool fCheckMerkleRoot = true); // Store block on disk From 942b33a19d3aa96326acc044c1834c48beff777c Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 13 Mar 2014 03:48:27 +0100 Subject: [PATCH 0013/1288] Split AcceptBlockHeader from AcceptBlock. Also modify some connection logic to deal with non-full blocks in the index. --- src/main.cpp | 200 +++++++++++++++++++++++++++++++++++---------------- src/main.h | 26 ++++++- 2 files changed, 162 insertions(+), 64 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 66800cc224..05f13dfda6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1849,8 +1849,13 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C if (fJustCheck) return true; + // Correct transaction counts. + pindex->nTx = block.vtx.size(); + if (pindex->pprev) + pindex->nChainTx = pindex->pprev->nChainTx + block.vtx.size(); + // Write undo information to disk - if (pindex->GetUndoPos().IsNull() || (pindex->nStatus & BLOCK_VALID_MASK) < BLOCK_VALID_SCRIPTS) + if (pindex->GetUndoPos().IsNull() || !pindex->IsValid(BLOCK_VALID_SCRIPTS)) { if (pindex->GetUndoPos().IsNull()) { CDiskBlockPos pos; @@ -1864,7 +1869,7 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C pindex->nStatus |= BLOCK_HAVE_UNDO; } - pindex->nStatus = (pindex->nStatus & ~BLOCK_VALID_MASK) | BLOCK_VALID_SCRIPTS; + pindex->RaiseValidity(BLOCK_VALID_SCRIPTS); CDiskBlockIndex blockindex(pindex); if (!pblocktree->WriteBlockIndex(blockindex)) @@ -2058,10 +2063,11 @@ void static FindMostWorkChain() { CBlockIndex *pindexTest = pindexNew; bool fInvalidAncestor = false; while (pindexTest && !chainActive.Contains(pindexTest)) { - if (pindexTest->nStatus & BLOCK_FAILED_MASK) { + if (!pindexTest->IsValid(BLOCK_VALID_TRANSACTIONS) || !(pindexTest->nStatus & BLOCK_HAVE_DATA)) { // Candidate has an invalid ancestor, remove entire chain from the set. if (pindexBestInvalid == NULL || pindexNew->nChainWork > pindexBestInvalid->nChainWork) - pindexBestInvalid = pindexNew; CBlockIndex *pindexFailed = pindexNew; + pindexBestInvalid = pindexNew; + CBlockIndex *pindexFailed = pindexNew; while (pindexTest != pindexFailed) { pindexFailed->nStatus |= BLOCK_FAILED_CHILD; setBlockIndexValid.erase(pindexFailed); @@ -2135,12 +2141,14 @@ bool ActivateBestChain(CValidationState &state) { return true; } -bool AddToBlockIndex(CBlock& block, CValidationState& state, const CDiskBlockPos& pos) + +CBlockIndex* AddToBlockIndex(CBlockHeader& block) { // Check for duplicate uint256 hash = block.GetHash(); - if (mapBlockIndex.count(hash)) - return state.Invalid(error("AddToBlockIndex() : %s already exists", hash.ToString()), 0, "duplicate"); + std::map::iterator it = mapBlockIndex.find(hash); + if (it != mapBlockIndex.end()) + return it->second; // Construct new block index object CBlockIndex* pindexNew = new CBlockIndex(block); @@ -2157,14 +2165,38 @@ bool AddToBlockIndex(CBlock& block, CValidationState& state, const CDiskBlockPos pindexNew->pprev = (*miPrev).second; pindexNew->nHeight = pindexNew->pprev->nHeight + 1; } - pindexNew->nTx = block.vtx.size(); pindexNew->nChainWork = (pindexNew->pprev ? pindexNew->pprev->nChainWork : 0) + pindexNew->GetBlockWork().getuint256(); - pindexNew->nChainTx = (pindexNew->pprev ? pindexNew->pprev->nChainTx : 0) + pindexNew->nTx; + pindexNew->RaiseValidity(BLOCK_VALID_TREE); + + return pindexNew; +} + + +// Mark a block as having its data received and checked (up to BLOCK_VALID_TRANSACTIONS). +bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBlockIndex *pindexNew, const CDiskBlockPos& pos) +{ + pindexNew->nTx = block.vtx.size(); + if (pindexNew->pprev) { + // Not the genesis block. + if (pindexNew->pprev->nChainTx) { + // This parent's block's total number transactions is known, so compute outs. + pindexNew->nChainTx = pindexNew->pprev->nChainTx + pindexNew->nTx; + } else { + // The total number of transactions isn't known yet. + // We will compute it when the block is connected. + pindexNew->nChainTx = 0; + } + } else { + // Genesis block. + pindexNew->nChainTx = pindexNew->nTx; + } pindexNew->nFile = pos.nFile; pindexNew->nDataPos = pos.nPos; pindexNew->nUndoPos = 0; - pindexNew->nStatus = BLOCK_VALID_TRANSACTIONS | BLOCK_HAVE_DATA; - setBlockIndexValid.insert(pindexNew); + pindexNew->nStatus |= BLOCK_HAVE_DATA; + + if (pindexNew->RaiseValidity(BLOCK_VALID_TRANSACTIONS)) + setBlockIndexValid.insert(pindexNew); if (!pblocktree->WriteBlockIndex(CDiskBlockIndex(pindexNew))) return state.Abort(_("Failed to write block index")); @@ -2292,14 +2324,35 @@ bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool f { // Check proof of work matches claimed amount if (fCheckPOW && !CheckProofOfWork(block.GetHash(), block.nBits)) - return state.DoS(50, error("CheckBlock() : proof of work failed"), + return state.DoS(50, error("CheckBlockHeader() : proof of work failed"), REJECT_INVALID, "high-hash"); // Check timestamp if (block.GetBlockTime() > GetAdjustedTime() + 2 * 60 * 60) - return state.Invalid(error("CheckBlock() : block timestamp too far in the future"), + return state.Invalid(error("CheckBlockHeader() : block timestamp too far in the future"), REJECT_INVALID, "time-too-new"); + CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(mapBlockIndex); + if (pcheckpoint && block.hashPrevBlock != (chainActive.Tip() ? chainActive.Tip()->GetBlockHash() : uint256(0))) + { + // Extra checks to prevent "fill up memory by spamming with bogus blocks" + int64_t deltaTime = block.GetBlockTime() - pcheckpoint->nTime; + if (deltaTime < 0) + { + return state.DoS(100, error("CheckBlockHeader() : block with timestamp before last checkpoint"), + REJECT_CHECKPOINT, "time-too-old"); + } + CBigNum bnNewBlock; + bnNewBlock.SetCompact(block.nBits); + CBigNum bnRequired; + bnRequired.SetCompact(ComputeMinWork(pcheckpoint->nBits, deltaTime)); + if (bnNewBlock > bnRequired) + { + return state.DoS(100, error("CheckBlockHeader() : block with too little proof-of-work"), + REJECT_INVALID, "bad-diffbits"); + } + } + return true; } @@ -2362,13 +2415,18 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo return true; } -bool AcceptBlock(CBlock& block, CValidationState& state, CDiskBlockPos* dbp) +bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex** ppindex) { AssertLockHeld(cs_main); // Check for duplicate uint256 hash = block.GetHash(); - if (mapBlockIndex.count(hash)) - return state.Invalid(error("AcceptBlock() : block already in mapBlockIndex"), 0, "duplicate"); + std::map::iterator miSelf = mapBlockIndex.find(hash); + CBlockIndex *pindex = NULL; + if (miSelf != mapBlockIndex.end()) { + pindex = miSelf->second; + if (pindex->nStatus & BLOCK_FAILED_MASK) + return state.Invalid(error("AcceptBlock() : block is marked invalid"), 0, "duplicate"); + } // Get prev block index CBlockIndex* pindexPrev = NULL; @@ -2390,12 +2448,6 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CDiskBlockPos* dbp) return state.Invalid(error("AcceptBlock() : block's timestamp is too early"), REJECT_INVALID, "time-too-old"); - // Check that all transactions are finalized - BOOST_FOREACH(const CTransaction& tx, block.vtx) - if (!IsFinalTx(tx, nHeight, block.GetBlockTime())) - return state.DoS(10, error("AcceptBlock() : contains a non-final transaction"), - REJECT_INVALID, "bad-txns-nonfinal"); - // Check that the block chain matches the known block chain up to a checkpoint if (!Checkpoints::CheckBlock(nHeight, hash)) return state.DoS(100, error("AcceptBlock() : rejected by checkpoint lock-in at %d", nHeight), @@ -2416,18 +2468,57 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CDiskBlockPos* dbp) REJECT_OBSOLETE, "bad-version"); } } - // Enforce block.nVersion=2 rule that the coinbase starts with serialized block height - if (block.nVersion >= 2) + } + + if (pindex == NULL) + pindex = AddToBlockIndex(block); + + if (ppindex) + *ppindex = pindex; + + return true; +} + +bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex, CDiskBlockPos* dbp) +{ + AssertLockHeld(cs_main); + + CBlockIndex *&pindex = *ppindex; + + if (!AcceptBlockHeader(block, state, &pindex)) + return false; + + if (!CheckBlock(block, state)) { + if (state.Invalid() && !state.CorruptionPossible()) { + pindex->nStatus |= BLOCK_FAILED_VALID; + } + return false; + } + + int nHeight = pindex->nHeight; + uint256 hash = pindex->GetBlockHash(); + + // Check that all transactions are finalized + BOOST_FOREACH(const CTransaction& tx, block.vtx) + if (!IsFinalTx(tx, nHeight, block.GetBlockTime())) { + pindex->nStatus |= BLOCK_FAILED_VALID; + return state.DoS(10, error("AcceptBlock() : contains a non-final transaction"), + REJECT_INVALID, "bad-txns-nonfinal"); + } + + // Enforce block.nVersion=2 rule that the coinbase starts with serialized block height + if (block.nVersion >= 2) + { + // if 750 of the last 1,000 blocks are version 2 or greater (51/100 if testnet): + if ((!TestNet() && CBlockIndex::IsSuperMajority(2, pindex->pprev, 750, 1000)) || + (TestNet() && CBlockIndex::IsSuperMajority(2, pindex->pprev, 51, 100))) { - // if 750 of the last 1,000 blocks are version 2 or greater (51/100 if testnet): - if ((!TestNet() && CBlockIndex::IsSuperMajority(2, pindexPrev, 750, 1000)) || - (TestNet() && CBlockIndex::IsSuperMajority(2, pindexPrev, 51, 100))) - { - CScript expect = CScript() << nHeight; - if (block.vtx[0].vin[0].scriptSig.size() < expect.size() || - !std::equal(expect.begin(), expect.end(), block.vtx[0].vin[0].scriptSig.begin())) - return state.DoS(100, error("AcceptBlock() : block height mismatch in coinbase"), - REJECT_INVALID, "bad-cb-height"); + CScript expect = CScript() << nHeight; + if (block.vtx[0].vin[0].scriptSig.size() < expect.size() || + !std::equal(expect.begin(), expect.end(), block.vtx[0].vin[0].scriptSig.begin())) { + pindex->nStatus |= BLOCK_FAILED_VALID; + return state.DoS(100, error("AcceptBlock() : block height mismatch in coinbase"), + REJECT_INVALID, "bad-cb-height"); } } } @@ -2443,8 +2534,8 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CDiskBlockPos* dbp) if (dbp == NULL) if (!WriteBlockToDisk(block, blockPos)) return state.Abort(_("Failed to write block")); - if (!AddToBlockIndex(block, state, blockPos)) - return error("AcceptBlock() : AddToBlockIndex failed"); + if (!ReceivedBlockTransactions(block, state, pindex, blockPos)) + return error("AcceptBlock() : ReceivedBlockTransactions failed"); } catch(std::runtime_error &e) { return state.Abort(_("System error: ") + e.what()); } @@ -2514,30 +2605,9 @@ bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBl if (!CheckBlock(*pblock, state)) return error("ProcessBlock() : CheckBlock FAILED"); - CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(mapBlockIndex); - if (pcheckpoint && pblock->hashPrevBlock != (chainActive.Tip() ? chainActive.Tip()->GetBlockHash() : uint256(0))) - { - // Extra checks to prevent "fill up memory by spamming with bogus blocks" - int64_t deltaTime = pblock->GetBlockTime() - pcheckpoint->nTime; - if (deltaTime < 0) - { - return state.DoS(100, error("ProcessBlock() : block with timestamp before last checkpoint"), - REJECT_CHECKPOINT, "time-too-old"); - } - CBigNum bnNewBlock; - bnNewBlock.SetCompact(pblock->nBits); - CBigNum bnRequired; - bnRequired.SetCompact(ComputeMinWork(pcheckpoint->nBits, deltaTime)); - if (bnNewBlock > bnRequired) - { - return state.DoS(100, error("ProcessBlock() : block with too little proof-of-work"), - REJECT_INVALID, "bad-diffbits"); - } - } - - - // If we don't already have its previous block, shunt it off to holding area until we get it - if (pblock->hashPrevBlock != 0 && !mapBlockIndex.count(pblock->hashPrevBlock)) + // If we don't already have its previous block (with full data), shunt it off to holding area until we get it + std::map::iterator it = mapBlockIndex.find(pblock->hashPrevBlock); + if (pblock->hashPrevBlock != 0 && (it == mapBlockIndex.end() || !(it->second->nStatus & BLOCK_HAVE_DATA))) { LogPrintf("ProcessBlock: ORPHAN BLOCK %lu, prev=%s\n", (unsigned long)mapOrphanBlocks.size(), pblock->hashPrevBlock.ToString()); @@ -2562,7 +2632,9 @@ bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBl } // Store to disk - if (!AcceptBlock(*pblock, state, dbp)) + CBlockIndex *pindex = NULL; + bool ret = AcceptBlock(*pblock, state, &pindex, dbp); + if (!ret) return error("ProcessBlock() : AcceptBlock FAILED"); // Recursively process any orphan blocks that depended on this one @@ -2583,7 +2655,8 @@ bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBl block.BuildMerkleTree(); // Use a dummy CValidationState so someone can't setup nodes to counter-DoS based on orphan resolution (that is, feeding people an invalid block based on LegitBlockX in order to get anyone relaying LegitBlockX banned) CValidationState stateDummy; - if (AcceptBlock(block, stateDummy)) + CBlockIndex *pindexChild = NULL; + if (AcceptBlock(block, stateDummy, &pindexChild)) vWorkQueue.push_back(mi->second->hashBlock); mapOrphanBlocks.erase(mi->second->hashBlock); delete mi->second; @@ -2846,7 +2919,7 @@ bool static LoadBlockIndexDB() CBlockIndex* pindex = item.second; pindex->nChainWork = (pindex->pprev ? pindex->pprev->nChainWork : 0) + pindex->GetBlockWork().getuint256(); pindex->nChainTx = (pindex->pprev ? pindex->pprev->nChainTx : 0) + pindex->nTx; - if ((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_TRANSACTIONS && !(pindex->nStatus & BLOCK_FAILED_MASK)) + if (pindex->IsValid(BLOCK_VALID_TRANSACTIONS)) setBlockIndexValid.insert(pindex); if (pindex->nStatus & BLOCK_FAILED_MASK && (!pindexBestInvalid || pindex->nChainWork > pindexBestInvalid->nChainWork)) pindexBestInvalid = pindex; @@ -2993,7 +3066,8 @@ bool InitBlockIndex() { return error("LoadBlockIndex() : FindBlockPos failed"); if (!WriteBlockToDisk(block, blockPos)) return error("LoadBlockIndex() : writing genesis block to disk failed"); - if (!AddToBlockIndex(block, state, blockPos)) + CBlockIndex *pindex = AddToBlockIndex(block); + if (!ReceivedBlockTransactions(block, state, pindex, blockPos)) return error("LoadBlockIndex() : genesis block not accepted"); } catch(std::runtime_error &e) { return error("LoadBlockIndex() : failed to initialize block database: %s", e.what()); diff --git a/src/main.h b/src/main.h index 8e3f1d95ce..77a6fbe9dc 100644 --- a/src/main.h +++ b/src/main.h @@ -608,7 +608,8 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW = t // Store block on disk // if dbp is provided, the file is known to already reside on disk -bool AcceptBlock(CBlock& block, CValidationState& state, CDiskBlockPos* dbp = NULL); +bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex **pindex, CDiskBlockPos* dbp = NULL); +bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex **ppindex= NULL); @@ -866,6 +867,29 @@ public: { LogPrintf("%s\n", ToString().c_str()); } + + // Check whether this block index entry is valid up to the passed validity level. + bool IsValid(enum BlockStatus nUpTo = BLOCK_VALID_TRANSACTIONS) const + { + assert(!(nUpTo & ~BLOCK_VALID_MASK)); // Only validity flags allowed. + if (nStatus & BLOCK_FAILED_MASK) + return false; + return ((nStatus & BLOCK_VALID_MASK) >= nUpTo); + } + + // Raise the validity level of this block index entry. + // Returns true if the validity was changed. + bool RaiseValidity(enum BlockStatus nUpTo) + { + assert(!(nUpTo & ~BLOCK_VALID_MASK)); // Only validity flags allowed. + if (nStatus & BLOCK_FAILED_MASK) + return false; + if ((nStatus & BLOCK_VALID_MASK) < nUpTo) { + nStatus = (nStatus & ~BLOCK_VALID_MASK) | nUpTo; + return true; + } + return false; + } }; From 68aa01e51fb9673ff2739825529a3fee36df79b4 Mon Sep 17 00:00:00 2001 From: Ian Carroll Date: Mon, 28 Apr 2014 19:36:28 -0400 Subject: [PATCH 0014/1288] Fixes error --- contrib/macdeploy/macdeployqtplus | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index 5c310df1fc..b0d85171da 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -17,7 +17,7 @@ # along with this program. If not, see . # -import subprocess, sys, re, os, shutil, stat, os.path +import subprocess, sys, re, os, shutil, stat, os.path, time from string import Template from time import sleep from argparse import ArgumentParser @@ -814,6 +814,7 @@ if config.dmg is not None: if verbose >= 2: print "+ Finalizing .dmg disk image +" + time.sleep(5) try: runHDIUtil("convert", dmg_name + ".temp", format="UDBZ", o=dmg_name + ".dmg", ov=True) From 68f7d1d7af39a8ea6510f888e8e058e8e8faa007 Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Mon, 10 Mar 2014 17:31:46 -0400 Subject: [PATCH 0015/1288] Create (MANDATORY|STANDARD)_SCRIPT_VERIFY_FLAGS constants --- src/main.cpp | 2 +- src/main.h | 2 +- src/miner.cpp | 5 ++++- src/rpcrawtransaction.cpp | 2 +- src/script.cpp | 2 +- src/script.h | 12 ++++++++++++ 6 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 40c713ce93..cee9d027f5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -945,7 +945,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa // Check against previous transactions // This is done last to help prevent CPU exhaustion denial-of-service attacks. - if (!CheckInputs(tx, state, view, true, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC)) + if (!CheckInputs(tx, state, view, true, STANDARD_SCRIPT_VERIFY_FLAGS)) { return error("AcceptToMemoryPool: : ConnectInputs failed %s", hash.ToString()); } diff --git a/src/main.h b/src/main.h index 825e577d1e..470f158287 100644 --- a/src/main.h +++ b/src/main.h @@ -309,7 +309,7 @@ inline bool AllowFree(double dPriority) // This does not modify the UTXO set. If pvChecks is not NULL, script checks are pushed onto it // instead of being performed inline. bool CheckInputs(const CTransaction& tx, CValidationState &state, CCoinsViewCache &view, bool fScriptChecks = true, - unsigned int flags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC, + unsigned int flags = STANDARD_SCRIPT_VERIFY_FLAGS, std::vector *pvChecks = NULL); // Apply the effects of this transaction on the UTXO set represented by view diff --git a/src/miner.cpp b/src/miner.cpp index 3351908e65..12a5e7f845 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -276,8 +276,11 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS) continue; + // Note that flags: we don't want to set mempool/IsStandard() + // policy here, but we still have to ensure that the block we + // create only contains transactions that are valid in new blocks. CValidationState state; - if (!CheckInputs(tx, state, view, true, SCRIPT_VERIFY_P2SH)) + if (!CheckInputs(tx, state, view, true, MANDATORY_SCRIPT_VERIFY_FLAGS)) continue; CTxUndo txundo; diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 4b7dd617e0..70a5bdf29b 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -722,7 +722,7 @@ Value signrawtransaction(const Array& params, bool fHelp) { txin.scriptSig = CombineSignatures(prevPubKey, mergedTx, i, txin.scriptSig, txv.vin[i].scriptSig); } - if (!VerifyScript(txin.scriptSig, prevPubKey, mergedTx, i, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC, 0)) + if (!VerifyScript(txin.scriptSig, prevPubKey, mergedTx, i, STANDARD_SCRIPT_VERIFY_FLAGS, 0)) fComplete = false; } diff --git a/src/script.cpp b/src/script.cpp index 810ba16d28..dc0cd28bf8 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1670,7 +1670,7 @@ bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CTransa } // Test solution - return VerifyScript(txin.scriptSig, fromPubKey, txTo, nIn, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC, 0); + return VerifyScript(txin.scriptSig, fromPubKey, txTo, nIn, STANDARD_SCRIPT_VERIFY_FLAGS, 0); } bool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CTransaction& txTo, unsigned int nIn, int nHashType) diff --git a/src/script.h b/src/script.h index 657ac0b388..0f26fb556d 100644 --- a/src/script.h +++ b/src/script.h @@ -44,6 +44,18 @@ enum SCRIPT_VERIFY_NOCACHE = (1U << 3), // do not store results in signature cache (but do query it) }; +// Mandatory script verification flags that all new blocks must comply with for +// them to be valid. (but old blocks may not comply with) Currently just P2SH, +// but in the future other flags may be added, such as a soft-fork to enforce +// strict DER encoding. +static const unsigned int MANDATORY_SCRIPT_VERIFY_FLAGS = SCRIPT_VERIFY_P2SH; + +// Standard script verification flags that standard transactions will comply +// with. However scripts violating these flags may still be present in valid +// blocks and we must accept those blocks. +static const unsigned int STANDARD_SCRIPT_VERIFY_FLAGS = MANDATORY_SCRIPT_VERIFY_FLAGS | + SCRIPT_VERIFY_STRICTENC; + enum txnouttype { TX_NONSTANDARD, From 29c17498a5d030f9d0a78cead3fbd37965b3cd40 Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Mon, 10 Mar 2014 18:17:56 -0400 Subject: [PATCH 0016/1288] Let tx (in)valid tests use any SCRIPT_VERIFY flag Previously only P2SH could be set. --- src/test/data/tx_invalid.json | 34 +++++++++++----------- src/test/data/tx_valid.json | 52 +++++++++++++++++----------------- src/test/transaction_tests.cpp | 49 ++++++++++++++++++++++++++++---- 3 files changed, 86 insertions(+), 49 deletions(-) diff --git a/src/test/data/tx_invalid.json b/src/test/data/tx_invalid.json index faf40ef23d..b9472ce00a 100644 --- a/src/test/data/tx_invalid.json +++ b/src/test/data/tx_invalid.json @@ -2,79 +2,79 @@ ["The following are deserialized transactions which are invalid."], ["They are in the form"], ["[[[prevout hash, prevout index, prevout scriptPubKey], [input 2], ...],"], -["serializedTransaction, enforceP2SH]"], +["serializedTransaction, verifyFlags]"], ["Objects that are only a single string (like this one) are ignored"], ["0e1b5688cf179cd9f7cbda1fac0090f6e684bbf8cd946660120197c3f3681809 but with extra junk appended to the end of the scriptPubKey"], [[["6ca7ec7b1847f6bdbd737176050e6a08d66ccd55bb94ad24f4018024107a5827", 0, "0x41 0x043b640e983c9690a14c039a2037ecc3467b27a0dcd58f19d76c7bc118d09fec45adc5370a1c5bf8067ca9f5557a4cf885fdb0fe0dcc9c3a7137226106fbc779a5 CHECKSIG VERIFY 1"]], -"010000000127587a10248001f424ad94bb55cd6cd6086a0e05767173bdbdf647187beca76c000000004948304502201b822ad10d6adc1a341ae8835be3f70a25201bbff31f59cbb9c5353a5f0eca18022100ea7b2f7074e9aa9cf70aa8d0ffee13e6b45dddabf1ab961bda378bcdb778fa4701ffffffff0100f2052a010000001976a914fc50c5907d86fed474ba5ce8b12a66e0a4c139d888ac00000000", true], +"010000000127587a10248001f424ad94bb55cd6cd6086a0e05767173bdbdf647187beca76c000000004948304502201b822ad10d6adc1a341ae8835be3f70a25201bbff31f59cbb9c5353a5f0eca18022100ea7b2f7074e9aa9cf70aa8d0ffee13e6b45dddabf1ab961bda378bcdb778fa4701ffffffff0100f2052a010000001976a914fc50c5907d86fed474ba5ce8b12a66e0a4c139d888ac00000000", "P2SH"], ["This is the nearly-standard transaction with CHECKSIGVERIFY 1 instead of CHECKSIG from tx_valid.json"], ["but with the signature duplicated in the scriptPubKey with a non-standard pushdata prefix"], ["See FindAndDelete, which will only remove if it uses the same pushdata prefix as is standard"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1 0x4c 0x47 0x3044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a01"]], -"01000000010001000000000000000000000000000000000000000000000000000000000000000000006a473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000", true], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006a473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000", "P2SH"], ["Same as above, but with the sig in the scriptSig also pushed with the same non-standard OP_PUSHDATA"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1 0x4c 0x47 0x3044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a01"]], -"01000000010001000000000000000000000000000000000000000000000000000000000000000000006b4c473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000", true], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006b4c473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000", "P2SH"], ["An invalid P2SH Transaction"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x7a052c840ba73af26755de42cf01cc9e0a49fef0 EQUAL"]], -"010000000100010000000000000000000000000000000000000000000000000000000000000000000009085768617420697320ffffffff010000000000000000015100000000", true], +"010000000100010000000000000000000000000000000000000000000000000000000000000000000009085768617420697320ffffffff010000000000000000015100000000", "P2SH"], ["Tests for CheckTransaction()"], ["No inputs"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x7a052c840ba73af26755de42cf01cc9e0a49fef0 EQUAL"]], -"0100000000010000000000000000015100000000", true], +"0100000000010000000000000000015100000000", "P2SH"], ["No outputs"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x05ab9e14d983742513f0f451e105ffb4198d1dd4 EQUAL"]], -"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d483045022100f16703104aab4e4088317c862daec83440242411b039d14280e03dd33b487ab802201318a7be236672c5c56083eb7a5a195bc57a40af7923ff8545016cd3b571e2a601232103c40e5d339df3f30bf753e7e04450ae4ef76c9e45587d1d993bdc4cd06f0651c7acffffffff0000000000", true], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d483045022100f16703104aab4e4088317c862daec83440242411b039d14280e03dd33b487ab802201318a7be236672c5c56083eb7a5a195bc57a40af7923ff8545016cd3b571e2a601232103c40e5d339df3f30bf753e7e04450ae4ef76c9e45587d1d993bdc4cd06f0651c7acffffffff0000000000", "P2SH"], ["Negative output"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0xae609aca8061d77c5e111f6bb62501a6bbe2bfdb EQUAL"]], -"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d4830450220063222cbb128731fc09de0d7323746539166544d6c1df84d867ccea84bcc8903022100bf568e8552844de664cd41648a031554327aa8844af34b4f27397c65b92c04de0123210243ec37dee0e2e053a9c976f43147e79bc7d9dc606ea51010af1ac80db6b069e1acffffffff01ffffffffffffffff015100000000", true], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d4830450220063222cbb128731fc09de0d7323746539166544d6c1df84d867ccea84bcc8903022100bf568e8552844de664cd41648a031554327aa8844af34b4f27397c65b92c04de0123210243ec37dee0e2e053a9c976f43147e79bc7d9dc606ea51010af1ac80db6b069e1acffffffff01ffffffffffffffff015100000000", "P2SH"], ["MAX_MONEY + 1 output"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x32afac281462b822adbec5094b8d4d337dd5bd6a EQUAL"]], -"01000000010001000000000000000000000000000000000000000000000000000000000000000000006e493046022100e1eadba00d9296c743cb6ecc703fd9ddc9b3cd12906176a226ae4c18d6b00796022100a71aef7d2874deff681ba6080f1b278bac7bb99c61b08a85f4311970ffe7f63f012321030c0588dc44d92bdcbf8e72093466766fdc265ead8db64517b0c542275b70fffbacffffffff010140075af0750700015100000000", true], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006e493046022100e1eadba00d9296c743cb6ecc703fd9ddc9b3cd12906176a226ae4c18d6b00796022100a71aef7d2874deff681ba6080f1b278bac7bb99c61b08a85f4311970ffe7f63f012321030c0588dc44d92bdcbf8e72093466766fdc265ead8db64517b0c542275b70fffbacffffffff010140075af0750700015100000000", "P2SH"], ["MAX_MONEY output + 1 output"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0xb558cbf4930954aa6a344363a15668d7477ae716 EQUAL"]], -"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d483045022027deccc14aa6668e78a8c9da3484fbcd4f9dcc9bb7d1b85146314b21b9ae4d86022100d0b43dece8cfb07348de0ca8bc5b86276fa88f7f2138381128b7c36ab2e42264012321029bb13463ddd5d2cc05da6e84e37536cb9525703cfd8f43afdb414988987a92f6acffffffff020040075af075070001510001000000000000015100000000", true], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d483045022027deccc14aa6668e78a8c9da3484fbcd4f9dcc9bb7d1b85146314b21b9ae4d86022100d0b43dece8cfb07348de0ca8bc5b86276fa88f7f2138381128b7c36ab2e42264012321029bb13463ddd5d2cc05da6e84e37536cb9525703cfd8f43afdb414988987a92f6acffffffff020040075af075070001510001000000000000015100000000", "P2SH"], ["Duplicate inputs"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x236d0639db62b0773fd8ac34dc85ae19e9aba80a EQUAL"]], -"01000000020001000000000000000000000000000000000000000000000000000000000000000000006c47304402204bb1197053d0d7799bf1b30cd503c44b58d6240cccbdc85b6fe76d087980208f02204beeed78200178ffc6c74237bb74b3f276bbb4098b5605d814304fe128bf1431012321039e8815e15952a7c3fada1905f8cf55419837133bd7756c0ef14fc8dfe50c0deaacffffffff0001000000000000000000000000000000000000000000000000000000000000000000006c47304402202306489afef52a6f62e90bf750bbcdf40c06f5c6b138286e6b6b86176bb9341802200dba98486ea68380f47ebb19a7df173b99e6bc9c681d6ccf3bde31465d1f16b3012321039e8815e15952a7c3fada1905f8cf55419837133bd7756c0ef14fc8dfe50c0deaacffffffff010000000000000000015100000000", true], +"01000000020001000000000000000000000000000000000000000000000000000000000000000000006c47304402204bb1197053d0d7799bf1b30cd503c44b58d6240cccbdc85b6fe76d087980208f02204beeed78200178ffc6c74237bb74b3f276bbb4098b5605d814304fe128bf1431012321039e8815e15952a7c3fada1905f8cf55419837133bd7756c0ef14fc8dfe50c0deaacffffffff0001000000000000000000000000000000000000000000000000000000000000000000006c47304402202306489afef52a6f62e90bf750bbcdf40c06f5c6b138286e6b6b86176bb9341802200dba98486ea68380f47ebb19a7df173b99e6bc9c681d6ccf3bde31465d1f16b3012321039e8815e15952a7c3fada1905f8cf55419837133bd7756c0ef14fc8dfe50c0deaacffffffff010000000000000000015100000000", "P2SH"], ["Coinbase of size 1"], ["Note the input is just required to make the tester happy"], [[["0000000000000000000000000000000000000000000000000000000000000000", -1, "1"]], -"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0151ffffffff010000000000000000015100000000", true], +"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0151ffffffff010000000000000000015100000000", "P2SH"], ["Coinbase of size 101"], ["Note the input is just required to make the tester happy"], [[["0000000000000000000000000000000000000000000000000000000000000000", -1, "1"]], -"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff655151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151ffffffff010000000000000000015100000000", true], +"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff655151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151ffffffff010000000000000000015100000000", "P2SH"], ["Null txin"], [[["0000000000000000000000000000000000000000000000000000000000000000", -1, "HASH160 0x14 0x02dae7dbbda56097959cba59b1989dd3e47937bf EQUAL"]], -"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff6e49304602210086f39e028e46dafa8e1e3be63906465f4cf038fbe5ed6403dc3e74ae876e6431022100c4625c675cfc5c7e3a0e0d7eaec92ac24da20c73a88eb40d09253e51ac6def5201232103a183ddc41e84753aca47723c965d1b5c8b0e2b537963518355e6dd6cf8415e50acffffffff010000000000000000015100000000", true], +"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff6e49304602210086f39e028e46dafa8e1e3be63906465f4cf038fbe5ed6403dc3e74ae876e6431022100c4625c675cfc5c7e3a0e0d7eaec92ac24da20c73a88eb40d09253e51ac6def5201232103a183ddc41e84753aca47723c965d1b5c8b0e2b537963518355e6dd6cf8415e50acffffffff010000000000000000015100000000", "P2SH"], ["Same as the transactions in valid with one input SIGHASH_ALL and one SIGHASH_ANYONECANPAY, but we set the _ANYONECANPAY sequence number, invalidating the SIGHASH_ALL signature"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"], ["0000000000000000000000000000000000000000000000000000000000000200", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"]], - "01000000020001000000000000000000000000000000000000000000000000000000000000000000004948304502203a0f5f0e1f2bdbcd04db3061d18f3af70e07f4f467cbc1b8116f267025f5360b022100c792b6e215afc5afc721a351ec413e714305cb749aae3d7fee76621313418df10101000000000200000000000000000000000000000000000000000000000000000000000000000000484730440220201dc2d030e380e8f9cfb41b442d930fa5a685bb2c8db5906671f865507d0670022018d9e7a8d4c8d86a73c2a724ee38ef983ec249827e0e464841735955c707ece98101000000010100000000000000015100000000", true], + "01000000020001000000000000000000000000000000000000000000000000000000000000000000004948304502203a0f5f0e1f2bdbcd04db3061d18f3af70e07f4f467cbc1b8116f267025f5360b022100c792b6e215afc5afc721a351ec413e714305cb749aae3d7fee76621313418df10101000000000200000000000000000000000000000000000000000000000000000000000000000000484730440220201dc2d030e380e8f9cfb41b442d930fa5a685bb2c8db5906671f865507d0670022018d9e7a8d4c8d86a73c2a724ee38ef983ec249827e0e464841735955c707ece98101000000010100000000000000015100000000", "P2SH"], ["Incorrect signature order"], ["Note the input is just required to make the tester happy"], [[["b3da01dd4aae683c7aee4d5d8b52a540a508e1115f77cd7fa9a291243f501223", 0, "HASH160 0x14 0xb1ce99298d5f07364b57b1e5c9cc00be0b04a954 EQUAL"]], -"01000000012312503f2491a2a97fcd775f11e108a540a5528b5d4dee7a3c68ae4add01dab300000000fdfe000048304502207aacee820e08b0b174e248abd8d7a34ed63b5da3abedb99934df9fddd65c05c4022100dfe87896ab5ee3df476c2655f9fbe5bd089dccbef3e4ea05b5d121169fe7f5f401483045022100f6649b0eddfdfd4ad55426663385090d51ee86c3481bdc6b0c18ea6c0ece2c0b0220561c315b07cffa6f7dd9df96dbae9200c2dee09bf93cc35ca05e6cdf613340aa014c695221031d11db38972b712a9fe1fc023577c7ae3ddb4a3004187d41c45121eecfdbb5b7210207ec36911b6ad2382860d32989c7b8728e9489d7bbc94a6b5509ef0029be128821024ea9fac06f666a4adc3fc1357b7bec1fd0bdece2b9d08579226a8ebde53058e453aeffffffff0180380100000000001976a914c9b99cddf847d10685a4fabaa0baf505f7c3dfab88ac00000000", true], +"01000000012312503f2491a2a97fcd775f11e108a540a5528b5d4dee7a3c68ae4add01dab300000000fdfe000048304502207aacee820e08b0b174e248abd8d7a34ed63b5da3abedb99934df9fddd65c05c4022100dfe87896ab5ee3df476c2655f9fbe5bd089dccbef3e4ea05b5d121169fe7f5f401483045022100f6649b0eddfdfd4ad55426663385090d51ee86c3481bdc6b0c18ea6c0ece2c0b0220561c315b07cffa6f7dd9df96dbae9200c2dee09bf93cc35ca05e6cdf613340aa014c695221031d11db38972b712a9fe1fc023577c7ae3ddb4a3004187d41c45121eecfdbb5b7210207ec36911b6ad2382860d32989c7b8728e9489d7bbc94a6b5509ef0029be128821024ea9fac06f666a4adc3fc1357b7bec1fd0bdece2b9d08579226a8ebde53058e453aeffffffff0180380100000000001976a914c9b99cddf847d10685a4fabaa0baf505f7c3dfab88ac00000000", "P2SH"], ["Empty stack when we try to run CHECKSIG"], [[["ad503f72c18df5801ee64d76090afe4c607fb2b822e9b7b63c5826c50e22fc3b", 0, "0x21 0x027c3a97665bf283a102a587a62a30a0c102d4d3b141015e2cae6f64e2543113e5 CHECKSIG NOT"]], -"01000000013bfc220ec526583cb6b7e922b8b27f604cfe0a09764de61e80f58dc1723f50ad0000000000ffffffff0101000000000000002321027c3a97665bf283a102a587a62a30a0c102d4d3b141015e2cae6f64e2543113e5ac00000000", true], +"01000000013bfc220ec526583cb6b7e922b8b27f604cfe0a09764de61e80f58dc1723f50ad0000000000ffffffff0101000000000000002321027c3a97665bf283a102a587a62a30a0c102d4d3b141015e2cae6f64e2543113e5ac00000000", "P2SH"], ["Make diffs cleaner by leaving a comment here without comma at the end"] ] diff --git a/src/test/data/tx_valid.json b/src/test/data/tx_valid.json index c206f7a722..ddcb12ff14 100644 --- a/src/test/data/tx_valid.json +++ b/src/test/data/tx_valid.json @@ -2,7 +2,7 @@ ["The following are deserialized transactions which are valid."], ["They are in the form"], ["[[[prevout hash, prevout index, prevout scriptPubKey], [input 2], ...],"], -["serializedTransaction, enforceP2SH]"], +["serializedTransaction, verifyFlags]"], ["Objects that are only a single string (like this one) are ignored"], ["The following is 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63"], @@ -10,113 +10,113 @@ ["See http://r6.ca/blog/20111119T211504Z.html"], ["It is also the first OP_CHECKMULTISIG transaction in standard form"], [[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], -"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000490047304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", true], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000490047304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH"], ["The following is a tweaked form of 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63"], ["It has an arbitrary extra byte stuffed into the signature at pos length - 2"], [[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], -"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004A0048304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2bab01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", true], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004A0048304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2bab01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH"], ["The following is c99c49da4c38af669dea436d3e73780dfdb6c1ecf9958baa52960e8baee30e73"], ["It is of interest because it contains a 0-sequence as well as a signature of SIGHASH type 0 (which is not a real type)"], [[["406b2b06bcd34d3c8733e6b79f7a394c8a431fbf4ff5ac705c93f4076bb77602", 0, "DUP HASH160 0x14 0xdc44b1164188067c3a32d4780f5996fa14a4f2d9 EQUALVERIFY CHECKSIG"]], -"01000000010276b76b07f4935c70acf54fbf1f438a4c397a9fb7e633873c4dd3bc062b6b40000000008c493046022100d23459d03ed7e9511a47d13292d3430a04627de6235b6e51a40f9cd386f2abe3022100e7d25b080f0bb8d8d5f878bba7d54ad2fda650ea8d158a33ee3cbd11768191fd004104b0e2c879e4daf7b9ab68350228c159766676a14f5815084ba166432aab46198d4cca98fa3e9981d0a90b2effc514b76279476550ba3663fdcaff94c38420e9d5000000000100093d00000000001976a9149a7b0f3b80c6baaeedce0a0842553800f832ba1f88ac00000000", true], +"01000000010276b76b07f4935c70acf54fbf1f438a4c397a9fb7e633873c4dd3bc062b6b40000000008c493046022100d23459d03ed7e9511a47d13292d3430a04627de6235b6e51a40f9cd386f2abe3022100e7d25b080f0bb8d8d5f878bba7d54ad2fda650ea8d158a33ee3cbd11768191fd004104b0e2c879e4daf7b9ab68350228c159766676a14f5815084ba166432aab46198d4cca98fa3e9981d0a90b2effc514b76279476550ba3663fdcaff94c38420e9d5000000000100093d00000000001976a9149a7b0f3b80c6baaeedce0a0842553800f832ba1f88ac00000000", "P2SH"], ["A nearly-standard transaction with CHECKSIGVERIFY 1 instead of CHECKSIG"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1"]], -"01000000010001000000000000000000000000000000000000000000000000000000000000000000006a473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000", true], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006a473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000", "P2SH"], ["Same as above, but with the signature duplicated in the scriptPubKey with the proper pushdata prefix"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1 0x47 0x3044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a01"]], -"01000000010001000000000000000000000000000000000000000000000000000000000000000000006a473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000", true], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006a473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000", "P2SH"], ["The following is f7fdd091fa6d8f5e7a8c2458f5c38faffff2d3f1406b6e4fe2c99dcc0d2d1cbb"], ["It caught a bug in the workaround for 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63 in an overly simple implementation"], [[["b464e85df2a238416f8bdae11d120add610380ea07f4ef19c5f9dfd472f96c3d", 0, "DUP HASH160 0x14 0xbef80ecf3a44500fda1bc92176e442891662aed2 EQUALVERIFY CHECKSIG"], ["b7978cc96e59a8b13e0865d3f95657561a7f725be952438637475920bac9eb21", 1, "DUP HASH160 0x14 0xbef80ecf3a44500fda1bc92176e442891662aed2 EQUALVERIFY CHECKSIG"]], -"01000000023d6cf972d4dff9c519eff407ea800361dd0a121de1da8b6f4138a2f25de864b4000000008a4730440220ffda47bfc776bcd269da4832626ac332adfca6dd835e8ecd83cd1ebe7d709b0e022049cffa1cdc102a0b56e0e04913606c70af702a1149dc3b305ab9439288fee090014104266abb36d66eb4218a6dd31f09bb92cf3cfa803c7ea72c1fc80a50f919273e613f895b855fb7465ccbc8919ad1bd4a306c783f22cd3227327694c4fa4c1c439affffffff21ebc9ba20594737864352e95b727f1a565756f9d365083eb1a8596ec98c97b7010000008a4730440220503ff10e9f1e0de731407a4a245531c9ff17676eda461f8ceeb8c06049fa2c810220c008ac34694510298fa60b3f000df01caa244f165b727d4896eb84f81e46bcc4014104266abb36d66eb4218a6dd31f09bb92cf3cfa803c7ea72c1fc80a50f919273e613f895b855fb7465ccbc8919ad1bd4a306c783f22cd3227327694c4fa4c1c439affffffff01f0da5200000000001976a914857ccd42dded6df32949d4646dfa10a92458cfaa88ac00000000", true], +"01000000023d6cf972d4dff9c519eff407ea800361dd0a121de1da8b6f4138a2f25de864b4000000008a4730440220ffda47bfc776bcd269da4832626ac332adfca6dd835e8ecd83cd1ebe7d709b0e022049cffa1cdc102a0b56e0e04913606c70af702a1149dc3b305ab9439288fee090014104266abb36d66eb4218a6dd31f09bb92cf3cfa803c7ea72c1fc80a50f919273e613f895b855fb7465ccbc8919ad1bd4a306c783f22cd3227327694c4fa4c1c439affffffff21ebc9ba20594737864352e95b727f1a565756f9d365083eb1a8596ec98c97b7010000008a4730440220503ff10e9f1e0de731407a4a245531c9ff17676eda461f8ceeb8c06049fa2c810220c008ac34694510298fa60b3f000df01caa244f165b727d4896eb84f81e46bcc4014104266abb36d66eb4218a6dd31f09bb92cf3cfa803c7ea72c1fc80a50f919273e613f895b855fb7465ccbc8919ad1bd4a306c783f22cd3227327694c4fa4c1c439affffffff01f0da5200000000001976a914857ccd42dded6df32949d4646dfa10a92458cfaa88ac00000000", "P2SH"], ["The following tests for the presence of a bug in the handling of SIGHASH_SINGLE"], ["It results in signing the constant 1, instead of something generated based on the transaction,"], ["when the input doing the signing has an index greater than the maximum output index"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "DUP HASH160 0x14 0xe52b482f2faa8ecbf0db344f93c84ac908557f33 EQUALVERIFY CHECKSIG"], ["0000000000000000000000000000000000000000000000000000000000000200", 0, "1"]], -"01000000020002000000000000000000000000000000000000000000000000000000000000000000000151ffffffff0001000000000000000000000000000000000000000000000000000000000000000000006b483045022100c9cdd08798a28af9d1baf44a6c77bcc7e279f47dc487c8c899911bc48feaffcc0220503c5c50ae3998a733263c5c0f7061b483e2b56c4c41b456e7d2f5a78a74c077032102d5c25adb51b61339d2b05315791e21bbe80ea470a49db0135720983c905aace0ffffffff010000000000000000015100000000", true], +"01000000020002000000000000000000000000000000000000000000000000000000000000000000000151ffffffff0001000000000000000000000000000000000000000000000000000000000000000000006b483045022100c9cdd08798a28af9d1baf44a6c77bcc7e279f47dc487c8c899911bc48feaffcc0220503c5c50ae3998a733263c5c0f7061b483e2b56c4c41b456e7d2f5a78a74c077032102d5c25adb51b61339d2b05315791e21bbe80ea470a49db0135720983c905aace0ffffffff010000000000000000015100000000", "P2SH"], ["An invalid P2SH Transaction"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x7a052c840ba73af26755de42cf01cc9e0a49fef0 EQUAL"]], -"010000000100010000000000000000000000000000000000000000000000000000000000000000000009085768617420697320ffffffff010000000000000000015100000000", false], +"010000000100010000000000000000000000000000000000000000000000000000000000000000000009085768617420697320ffffffff010000000000000000015100000000", "NONE"], ["A valid P2SH Transaction using the standard transaction type put forth in BIP 16"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x8febbed40483661de6958d957412f82deed8e2f7 EQUAL"]], -"01000000010001000000000000000000000000000000000000000000000000000000000000000000006e493046022100c66c9cdf4c43609586d15424c54707156e316d88b0a1534c9e6b0d4f311406310221009c0fe51dbc9c4ab7cc25d3fdbeccf6679fe6827f08edf2b4a9f16ee3eb0e438a0123210338e8034509af564c62644c07691942e0c056752008a173c89f60ab2a88ac2ebfacffffffff010000000000000000015100000000", true], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006e493046022100c66c9cdf4c43609586d15424c54707156e316d88b0a1534c9e6b0d4f311406310221009c0fe51dbc9c4ab7cc25d3fdbeccf6679fe6827f08edf2b4a9f16ee3eb0e438a0123210338e8034509af564c62644c07691942e0c056752008a173c89f60ab2a88ac2ebfacffffffff010000000000000000015100000000", "P2SH"], ["Tests for CheckTransaction()"], ["MAX_MONEY output"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x32afac281462b822adbec5094b8d4d337dd5bd6a EQUAL"]], -"01000000010001000000000000000000000000000000000000000000000000000000000000000000006e493046022100e1eadba00d9296c743cb6ecc703fd9ddc9b3cd12906176a226ae4c18d6b00796022100a71aef7d2874deff681ba6080f1b278bac7bb99c61b08a85f4311970ffe7f63f012321030c0588dc44d92bdcbf8e72093466766fdc265ead8db64517b0c542275b70fffbacffffffff010040075af0750700015100000000", true], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006e493046022100e1eadba00d9296c743cb6ecc703fd9ddc9b3cd12906176a226ae4c18d6b00796022100a71aef7d2874deff681ba6080f1b278bac7bb99c61b08a85f4311970ffe7f63f012321030c0588dc44d92bdcbf8e72093466766fdc265ead8db64517b0c542275b70fffbacffffffff010040075af0750700015100000000", "P2SH"], ["MAX_MONEY output + 0 output"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0xb558cbf4930954aa6a344363a15668d7477ae716 EQUAL"]], -"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d483045022027deccc14aa6668e78a8c9da3484fbcd4f9dcc9bb7d1b85146314b21b9ae4d86022100d0b43dece8cfb07348de0ca8bc5b86276fa88f7f2138381128b7c36ab2e42264012321029bb13463ddd5d2cc05da6e84e37536cb9525703cfd8f43afdb414988987a92f6acffffffff020040075af075070001510000000000000000015100000000", true], +"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d483045022027deccc14aa6668e78a8c9da3484fbcd4f9dcc9bb7d1b85146314b21b9ae4d86022100d0b43dece8cfb07348de0ca8bc5b86276fa88f7f2138381128b7c36ab2e42264012321029bb13463ddd5d2cc05da6e84e37536cb9525703cfd8f43afdb414988987a92f6acffffffff020040075af075070001510000000000000000015100000000", "P2SH"], ["Coinbase of size 2"], ["Note the input is just required to make the tester happy"], [[["0000000000000000000000000000000000000000000000000000000000000000", -1, "1"]], -"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff025151ffffffff010000000000000000015100000000", true], +"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff025151ffffffff010000000000000000015100000000", "P2SH"], ["Coinbase of size 100"], ["Note the input is just required to make the tester happy"], [[["0000000000000000000000000000000000000000000000000000000000000000", -1, "1"]], -"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff6451515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151ffffffff010000000000000000015100000000", true], +"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff6451515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151ffffffff010000000000000000015100000000", "P2SH"], ["Simple transaction with first input is signed with SIGHASH_ALL, second with SIGHASH_ANYONECANPAY"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"], ["0000000000000000000000000000000000000000000000000000000000000200", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"]], - "010000000200010000000000000000000000000000000000000000000000000000000000000000000049483045022100d180fd2eb9140aeb4210c9204d3f358766eb53842b2a9473db687fa24b12a3cc022079781799cd4f038b85135bbe49ec2b57f306b2bb17101b17f71f000fcab2b6fb01ffffffff0002000000000000000000000000000000000000000000000000000000000000000000004847304402205f7530653eea9b38699e476320ab135b74771e1c48b81a5d041e2ca84b9be7a802200ac8d1f40fb026674fe5a5edd3dea715c27baa9baca51ed45ea750ac9dc0a55e81ffffffff010100000000000000015100000000", true], + "010000000200010000000000000000000000000000000000000000000000000000000000000000000049483045022100d180fd2eb9140aeb4210c9204d3f358766eb53842b2a9473db687fa24b12a3cc022079781799cd4f038b85135bbe49ec2b57f306b2bb17101b17f71f000fcab2b6fb01ffffffff0002000000000000000000000000000000000000000000000000000000000000000000004847304402205f7530653eea9b38699e476320ab135b74771e1c48b81a5d041e2ca84b9be7a802200ac8d1f40fb026674fe5a5edd3dea715c27baa9baca51ed45ea750ac9dc0a55e81ffffffff010100000000000000015100000000", "P2SH"], ["Same as above, but we change the sequence number of the first input to check that SIGHASH_ANYONECANPAY is being followed"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"], ["0000000000000000000000000000000000000000000000000000000000000200", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"]], - "01000000020001000000000000000000000000000000000000000000000000000000000000000000004948304502203a0f5f0e1f2bdbcd04db3061d18f3af70e07f4f467cbc1b8116f267025f5360b022100c792b6e215afc5afc721a351ec413e714305cb749aae3d7fee76621313418df101010000000002000000000000000000000000000000000000000000000000000000000000000000004847304402205f7530653eea9b38699e476320ab135b74771e1c48b81a5d041e2ca84b9be7a802200ac8d1f40fb026674fe5a5edd3dea715c27baa9baca51ed45ea750ac9dc0a55e81ffffffff010100000000000000015100000000", true], + "01000000020001000000000000000000000000000000000000000000000000000000000000000000004948304502203a0f5f0e1f2bdbcd04db3061d18f3af70e07f4f467cbc1b8116f267025f5360b022100c792b6e215afc5afc721a351ec413e714305cb749aae3d7fee76621313418df101010000000002000000000000000000000000000000000000000000000000000000000000000000004847304402205f7530653eea9b38699e476320ab135b74771e1c48b81a5d041e2ca84b9be7a802200ac8d1f40fb026674fe5a5edd3dea715c27baa9baca51ed45ea750ac9dc0a55e81ffffffff010100000000000000015100000000", "P2SH"], ["afd9c17f8913577ec3509520bd6e5d63e9c0fd2a5f70c787993b097ba6ca9fae which has several SIGHASH_SINGLE signatures"], [[["63cfa5a09dc540bf63e53713b82d9ea3692ca97cd608c384f2aa88e51a0aac70", 0, "DUP HASH160 0x14 0xdcf72c4fd02f5a987cf9b02f2fabfcac3341a87d EQUALVERIFY CHECKSIG"], ["04e8d0fcf3846c6734477b98f0f3d4badfb78f020ee097a0be5fe347645b817d", 1, "DUP HASH160 0x14 0xdcf72c4fd02f5a987cf9b02f2fabfcac3341a87d EQUALVERIFY CHECKSIG"], ["ee1377aff5d0579909e11782e1d2f5f7b84d26537be7f5516dd4e43373091f3f", 1, "DUP HASH160 0x14 0xdcf72c4fd02f5a987cf9b02f2fabfcac3341a87d EQUALVERIFY CHECKSIG"]], - "010000000370ac0a1ae588aaf284c308d67ca92c69a39e2db81337e563bf40c59da0a5cf63000000006a4730440220360d20baff382059040ba9be98947fd678fb08aab2bb0c172efa996fd8ece9b702201b4fb0de67f015c90e7ac8a193aeab486a1f587e0f54d0fb9552ef7f5ce6caec032103579ca2e6d107522f012cd00b52b9a65fb46f0c57b9b8b6e377c48f526a44741affffffff7d815b6447e35fbea097e00e028fb7dfbad4f3f0987b4734676c84f3fcd0e804010000006b483045022100c714310be1e3a9ff1c5f7cacc65c2d8e781fc3a88ceb063c6153bf950650802102200b2d0979c76e12bb480da635f192cc8dc6f905380dd4ac1ff35a4f68f462fffd032103579ca2e6d107522f012cd00b52b9a65fb46f0c57b9b8b6e377c48f526a44741affffffff3f1f097333e4d46d51f5e77b53264db8f7f5d2e18217e1099957d0f5af7713ee010000006c493046022100b663499ef73273a3788dea342717c2640ac43c5a1cf862c9e09b206fcb3f6bb8022100b09972e75972d9148f2bdd462e5cb69b57c1214b88fc55ca638676c07cfc10d8032103579ca2e6d107522f012cd00b52b9a65fb46f0c57b9b8b6e377c48f526a44741affffffff0380841e00000000001976a914bfb282c70c4191f45b5a6665cad1682f2c9cfdfb88ac80841e00000000001976a9149857cc07bed33a5cf12b9c5e0500b675d500c81188ace0fd1c00000000001976a91443c52850606c872403c0601e69fa34b26f62db4a88ac00000000", true], + "010000000370ac0a1ae588aaf284c308d67ca92c69a39e2db81337e563bf40c59da0a5cf63000000006a4730440220360d20baff382059040ba9be98947fd678fb08aab2bb0c172efa996fd8ece9b702201b4fb0de67f015c90e7ac8a193aeab486a1f587e0f54d0fb9552ef7f5ce6caec032103579ca2e6d107522f012cd00b52b9a65fb46f0c57b9b8b6e377c48f526a44741affffffff7d815b6447e35fbea097e00e028fb7dfbad4f3f0987b4734676c84f3fcd0e804010000006b483045022100c714310be1e3a9ff1c5f7cacc65c2d8e781fc3a88ceb063c6153bf950650802102200b2d0979c76e12bb480da635f192cc8dc6f905380dd4ac1ff35a4f68f462fffd032103579ca2e6d107522f012cd00b52b9a65fb46f0c57b9b8b6e377c48f526a44741affffffff3f1f097333e4d46d51f5e77b53264db8f7f5d2e18217e1099957d0f5af7713ee010000006c493046022100b663499ef73273a3788dea342717c2640ac43c5a1cf862c9e09b206fcb3f6bb8022100b09972e75972d9148f2bdd462e5cb69b57c1214b88fc55ca638676c07cfc10d8032103579ca2e6d107522f012cd00b52b9a65fb46f0c57b9b8b6e377c48f526a44741affffffff0380841e00000000001976a914bfb282c70c4191f45b5a6665cad1682f2c9cfdfb88ac80841e00000000001976a9149857cc07bed33a5cf12b9c5e0500b675d500c81188ace0fd1c00000000001976a91443c52850606c872403c0601e69fa34b26f62db4a88ac00000000", "P2SH"], ["ddc454a1c0c35c188c98976b17670f69e586d9c0f3593ea879928332f0a069e7, which spends an input that pushes using a PUSHDATA1 that is negative when read as signed"], [[["c5510a5dd97a25f43175af1fe649b707b1df8e1a41489bac33a23087027a2f48", 0, "0x4c 0xae 0x606563686f2022553246736447566b58312b5a536e587574356542793066794778625456415675534a6c376a6a334878416945325364667657734f53474f36633338584d7439435c6e543249584967306a486956304f376e775236644546673d3d22203e20743b206f70656e73736c20656e63202d7061737320706173733a5b314a564d7751432d707269766b65792d6865785d202d64202d6165732d3235362d636263202d61202d696e207460 DROP DUP HASH160 0x14 0xbfd7436b6265aa9de506f8a994f881ff08cc2872 EQUALVERIFY CHECKSIG"]], - "0100000001482f7a028730a233ac9b48411a8edfb107b749e61faf7531f4257ad95d0a51c5000000008b483045022100bf0bbae9bde51ad2b222e87fbf67530fbafc25c903519a1e5dcc52a32ff5844e022028c4d9ad49b006dd59974372a54291d5764be541574bb0c4dc208ec51f80b7190141049dd4aad62741dc27d5f267f7b70682eee22e7e9c1923b9c0957bdae0b96374569b460eb8d5b40d972e8c7c0ad441de3d94c4a29864b212d56050acb980b72b2bffffffff0180969800000000001976a914e336d0017a9d28de99d16472f6ca6d5a3a8ebc9988ac00000000", true], + "0100000001482f7a028730a233ac9b48411a8edfb107b749e61faf7531f4257ad95d0a51c5000000008b483045022100bf0bbae9bde51ad2b222e87fbf67530fbafc25c903519a1e5dcc52a32ff5844e022028c4d9ad49b006dd59974372a54291d5764be541574bb0c4dc208ec51f80b7190141049dd4aad62741dc27d5f267f7b70682eee22e7e9c1923b9c0957bdae0b96374569b460eb8d5b40d972e8c7c0ad441de3d94c4a29864b212d56050acb980b72b2bffffffff0180969800000000001976a914e336d0017a9d28de99d16472f6ca6d5a3a8ebc9988ac00000000", "P2SH"], ["Correct signature order"], ["Note the input is just required to make the tester happy"], [[["b3da01dd4aae683c7aee4d5d8b52a540a508e1115f77cd7fa9a291243f501223", 0, "HASH160 0x14 0xb1ce99298d5f07364b57b1e5c9cc00be0b04a954 EQUAL"]], -"01000000012312503f2491a2a97fcd775f11e108a540a5528b5d4dee7a3c68ae4add01dab300000000fdfe0000483045022100f6649b0eddfdfd4ad55426663385090d51ee86c3481bdc6b0c18ea6c0ece2c0b0220561c315b07cffa6f7dd9df96dbae9200c2dee09bf93cc35ca05e6cdf613340aa0148304502207aacee820e08b0b174e248abd8d7a34ed63b5da3abedb99934df9fddd65c05c4022100dfe87896ab5ee3df476c2655f9fbe5bd089dccbef3e4ea05b5d121169fe7f5f4014c695221031d11db38972b712a9fe1fc023577c7ae3ddb4a3004187d41c45121eecfdbb5b7210207ec36911b6ad2382860d32989c7b8728e9489d7bbc94a6b5509ef0029be128821024ea9fac06f666a4adc3fc1357b7bec1fd0bdece2b9d08579226a8ebde53058e453aeffffffff0180380100000000001976a914c9b99cddf847d10685a4fabaa0baf505f7c3dfab88ac00000000", true], +"01000000012312503f2491a2a97fcd775f11e108a540a5528b5d4dee7a3c68ae4add01dab300000000fdfe0000483045022100f6649b0eddfdfd4ad55426663385090d51ee86c3481bdc6b0c18ea6c0ece2c0b0220561c315b07cffa6f7dd9df96dbae9200c2dee09bf93cc35ca05e6cdf613340aa0148304502207aacee820e08b0b174e248abd8d7a34ed63b5da3abedb99934df9fddd65c05c4022100dfe87896ab5ee3df476c2655f9fbe5bd089dccbef3e4ea05b5d121169fe7f5f4014c695221031d11db38972b712a9fe1fc023577c7ae3ddb4a3004187d41c45121eecfdbb5b7210207ec36911b6ad2382860d32989c7b8728e9489d7bbc94a6b5509ef0029be128821024ea9fac06f666a4adc3fc1357b7bec1fd0bdece2b9d08579226a8ebde53058e453aeffffffff0180380100000000001976a914c9b99cddf847d10685a4fabaa0baf505f7c3dfab88ac00000000", "P2SH"], ["cc60b1f899ec0a69b7c3f25ddf32c4524096a9c5b01cbd84c6d0312a0c478984, which is a fairly strange transaction which relies on OP_CHECKSIG returning 0 when checking a completely invalid sig of length 0"], [[["cbebc4da731e8995fe97f6fadcd731b36ad40e5ecb31e38e904f6e5982fa09f7", 0, "0x2102085c6600657566acc2d6382a47bc3f324008d2aa10940dd7705a48aa2a5a5e33ac7c2103f5d0fb955f95dd6be6115ce85661db412ec6a08abcbfce7da0ba8297c6cc0ec4ac7c5379a820d68df9e32a147cffa36193c6f7c43a1c8c69cda530e1c6db354bfabdcfefaf3c875379a820f531f3041d3136701ea09067c53e7159c8f9b2746a56c3d82966c54bbc553226879a5479827701200122a59a5379827701200122a59a6353798277537982778779679a68"]], -"0100000001f709fa82596e4f908ee331cb5e0ed46ab331d7dcfaf697fe95891e73dac4ebcb000000008c20ca42095840735e89283fec298e62ac2ddea9b5f34a8cbb7097ad965b87568100201b1b01dc829177da4a14551d2fc96a9db00c6501edfa12f22cd9cefd335c227f483045022100a9df60536df5733dd0de6bc921fab0b3eee6426501b43a228afa2c90072eb5ca02201c78b74266fac7d1db5deff080d8a403743203f109fbcabf6d5a760bf87386d20100ffffffff01c075790000000000232103611f9a45c18f28f06f19076ad571c344c82ce8fcfe34464cf8085217a2d294a6ac00000000", true], +"0100000001f709fa82596e4f908ee331cb5e0ed46ab331d7dcfaf697fe95891e73dac4ebcb000000008c20ca42095840735e89283fec298e62ac2ddea9b5f34a8cbb7097ad965b87568100201b1b01dc829177da4a14551d2fc96a9db00c6501edfa12f22cd9cefd335c227f483045022100a9df60536df5733dd0de6bc921fab0b3eee6426501b43a228afa2c90072eb5ca02201c78b74266fac7d1db5deff080d8a403743203f109fbcabf6d5a760bf87386d20100ffffffff01c075790000000000232103611f9a45c18f28f06f19076ad571c344c82ce8fcfe34464cf8085217a2d294a6ac00000000", "P2SH"], ["Empty pubkey"], [[["229257c295e7f555421c1bfec8538dd30a4b5c37c1c8810bbe83cafa7811652c", 0, "0x00 CHECKSIG NOT"]], -"01000000012c651178faca83be0b81c8c1375c4b0ad38d53c8fe1b1c4255f5e795c25792220000000049483045022100d6044562284ac76c985018fc4a90127847708c9edb280996c507b28babdc4b2a02203d74eca3f1a4d1eea7ff77b528fde6d5dc324ec2dbfdb964ba885f643b9704cd01ffffffff010100000000000000232102c2410f8891ae918cab4ffc4bb4a3b0881be67c7a1e7faa8b5acf9ab8932ec30cac00000000", true], +"01000000012c651178faca83be0b81c8c1375c4b0ad38d53c8fe1b1c4255f5e795c25792220000000049483045022100d6044562284ac76c985018fc4a90127847708c9edb280996c507b28babdc4b2a02203d74eca3f1a4d1eea7ff77b528fde6d5dc324ec2dbfdb964ba885f643b9704cd01ffffffff010100000000000000232102c2410f8891ae918cab4ffc4bb4a3b0881be67c7a1e7faa8b5acf9ab8932ec30cac00000000", "P2SH"], ["Empty signature"], [[["9ca93cfd8e3806b9d9e2ba1cf64e3cc6946ee0119670b1796a09928d14ea25f7", 0, "0x21 0x028a1d66975dbdf97897e3a4aef450ebeb5b5293e4a0b4a6d3a2daaa0b2b110e02 CHECKSIG NOT"]], -"0100000001f725ea148d92096a79b1709611e06e94c63c4ef61cbae2d9b906388efd3ca99c000000000100ffffffff0101000000000000002321028a1d66975dbdf97897e3a4aef450ebeb5b5293e4a0b4a6d3a2daaa0b2b110e02ac00000000", true], +"0100000001f725ea148d92096a79b1709611e06e94c63c4ef61cbae2d9b906388efd3ca99c000000000100ffffffff0101000000000000002321028a1d66975dbdf97897e3a4aef450ebeb5b5293e4a0b4a6d3a2daaa0b2b110e02ac00000000", "P2SH"], [[["444e00ed7840d41f20ecd9c11d3f91982326c731a02f3c05748414a4fa9e59be", 0, "1 0x00 0x21 0x02136b04758b0b6e363e7a6fbe83aaf527a153db2b060d36cc29f7f8309ba6e458 2 CHECKMULTISIG"]], -"0100000001be599efaa4148474053c2fa031c7262398913f1dc1d9ec201fd44078ed004e44000000004900473044022022b29706cb2ed9ef0cb3c97b72677ca2dfd7b4160f7b4beb3ba806aa856c401502202d1e52582412eba2ed474f1f437a427640306fd3838725fab173ade7fe4eae4a01ffffffff010100000000000000232103ac4bba7e7ca3e873eea49e08132ad30c7f03640b6539e9b59903cf14fd016bbbac00000000", true], +"0100000001be599efaa4148474053c2fa031c7262398913f1dc1d9ec201fd44078ed004e44000000004900473044022022b29706cb2ed9ef0cb3c97b72677ca2dfd7b4160f7b4beb3ba806aa856c401502202d1e52582412eba2ed474f1f437a427640306fd3838725fab173ade7fe4eae4a01ffffffff010100000000000000232103ac4bba7e7ca3e873eea49e08132ad30c7f03640b6539e9b59903cf14fd016bbbac00000000", "P2SH"], [[["e16abbe80bf30c080f63830c8dbf669deaef08957446e95940227d8c5e6db612", 0, "1 0x21 0x03905380c7013e36e6e19d305311c1b81fce6581f5ee1c86ef0627c68c9362fc9f 0x00 2 CHECKMULTISIG"]], -"010000000112b66d5e8c7d224059e946749508efea9d66bf8d0c83630f080cf30be8bb6ae100000000490047304402206ffe3f14caf38ad5c1544428e99da76ffa5455675ec8d9780fac215ca17953520220779502985e194d84baa36b9bd40a0dbd981163fa191eb884ae83fc5bd1c86b1101ffffffff010100000000000000232103905380c7013e36e6e19d305311c1b81fce6581f5ee1c86ef0627c68c9362fc9fac00000000", true], +"010000000112b66d5e8c7d224059e946749508efea9d66bf8d0c83630f080cf30be8bb6ae100000000490047304402206ffe3f14caf38ad5c1544428e99da76ffa5455675ec8d9780fac215ca17953520220779502985e194d84baa36b9bd40a0dbd981163fa191eb884ae83fc5bd1c86b1101ffffffff010100000000000000232103905380c7013e36e6e19d305311c1b81fce6581f5ee1c86ef0627c68c9362fc9fac00000000", "P2SH"], [[["ebbcf4bfce13292bd791d6a65a2a858d59adbf737e387e40370d4e64cc70efb0", 0, "2 0x21 0x033bcaa0a602f0d44cc9d5637c6e515b0471db514c020883830b7cefd73af04194 0x21 0x03a88b326f8767f4f192ce252afe33c94d25ab1d24f27f159b3cb3aa691ffe1423 2 CHECKMULTISIG NOT"]], -"0100000001b0ef70cc644e0d37407e387e73bfad598d852a5aa6d691d72b2913cebff4bceb000000004a00473044022068cd4851fc7f9a892ab910df7a24e616f293bcb5c5fbdfbc304a194b26b60fba022078e6da13d8cb881a22939b952c24f88b97afd06b4c47a47d7f804c9a352a6d6d0100ffffffff0101000000000000002321033bcaa0a602f0d44cc9d5637c6e515b0471db514c020883830b7cefd73af04194ac00000000", true], +"0100000001b0ef70cc644e0d37407e387e73bfad598d852a5aa6d691d72b2913cebff4bceb000000004a00473044022068cd4851fc7f9a892ab910df7a24e616f293bcb5c5fbdfbc304a194b26b60fba022078e6da13d8cb881a22939b952c24f88b97afd06b4c47a47d7f804c9a352a6d6d0100ffffffff0101000000000000002321033bcaa0a602f0d44cc9d5637c6e515b0471db514c020883830b7cefd73af04194ac00000000", "P2SH"], [[["ba4cd7ae2ad4d4d13ebfc8ab1d93a63e4a6563f25089a18bf0fc68f282aa88c1", 0, "2 0x21 0x037c615d761e71d38903609bf4f46847266edc2fb37532047d747ba47eaae5ffe1 0x21 0x02edc823cd634f2c4033d94f5755207cb6b60c4b1f1f056ad7471c47de5f2e4d50 2 CHECKMULTISIG NOT"]], -"0100000001c188aa82f268fcf08ba18950f263654a3ea6931dabc8bf3ed1d4d42aaed74cba000000004b0000483045022100940378576e069aca261a6b26fb38344e4497ca6751bb10905c76bb689f4222b002204833806b014c26fd801727b792b1260003c55710f87c5adbd7a9cb57446dbc9801ffffffff0101000000000000002321037c615d761e71d38903609bf4f46847266edc2fb37532047d747ba47eaae5ffe1ac00000000", true], +"0100000001c188aa82f268fcf08ba18950f263654a3ea6931dabc8bf3ed1d4d42aaed74cba000000004b0000483045022100940378576e069aca261a6b26fb38344e4497ca6751bb10905c76bb689f4222b002204833806b014c26fd801727b792b1260003c55710f87c5adbd7a9cb57446dbc9801ffffffff0101000000000000002321037c615d761e71d38903609bf4f46847266edc2fb37532047d747ba47eaae5ffe1ac00000000", "P2SH"], ["Make diffs cleaner by leaving a comment here without comma at the end"] ] diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 24647950c4..9edc07ab16 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -13,16 +13,44 @@ #include #include +#include +#include #include #include "json/json_spirit_writer_template.h" using namespace std; using namespace json_spirit; +using namespace boost::algorithm; // In script_tests.cpp extern Array read_json(const std::string& jsondata); extern CScript ParseScript(string s); +unsigned int ParseFlags(string strFlags){ + unsigned int flags = 0; + vector words; + split(words, strFlags, is_any_of(",")); + + // Note how NOCACHE is not included as it is a runtime-only flag. + static map mapFlagNames; + if (mapFlagNames.size() == 0) + { + mapFlagNames["NONE"] = SCRIPT_VERIFY_NONE; + mapFlagNames["P2SH"] = SCRIPT_VERIFY_P2SH; + mapFlagNames["STRICTENC"] = SCRIPT_VERIFY_STRICTENC; + mapFlagNames["EVEN_S"] = SCRIPT_VERIFY_EVEN_S; + } + + BOOST_FOREACH(string word, words) + { + if (!mapFlagNames.count(word)) + BOOST_ERROR("Bad test: unknown verification flag '" << word << "'"); + flags |= mapFlagNames[word]; + } + + return flags; +} + BOOST_AUTO_TEST_SUITE(transaction_tests) BOOST_AUTO_TEST_CASE(tx_valid) @@ -30,8 +58,10 @@ BOOST_AUTO_TEST_CASE(tx_valid) // Read tests from test/data/tx_valid.json // Format is an array of arrays // Inner arrays are either [ "comment" ] - // or [[[prevout hash, prevout index, prevout scriptPubKey], [input 2], ...],"], serializedTransaction, enforceP2SH + // or [[[prevout hash, prevout index, prevout scriptPubKey], [input 2], ...],"], serializedTransaction, verifyFlags // ... where all scripts are stringified scripts. + // + // verifyFlags is a comma separated list of script verification flags to apply, or "NONE" Array tests = read_json(std::string(json_tests::tx_valid, json_tests::tx_valid + sizeof(json_tests::tx_valid))); BOOST_FOREACH(Value& tv, tests) @@ -40,7 +70,7 @@ BOOST_AUTO_TEST_CASE(tx_valid) string strTest = write_string(tv, false); if (test[0].type() == array_type) { - if (test.size() != 3 || test[1].type() != str_type || test[2].type() != bool_type) + if (test.size() != 3 || test[1].type() != str_type || test[2].type() != str_type) { BOOST_ERROR("Bad test: " << strTest); continue; @@ -88,7 +118,10 @@ BOOST_AUTO_TEST_CASE(tx_valid) break; } - BOOST_CHECK_MESSAGE(VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout], tx, i, test[2].get_bool() ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE, 0), strTest); + unsigned int verify_flags = ParseFlags(test[2].get_str()); + BOOST_CHECK_MESSAGE(VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout], + tx, i, verify_flags, 0), + strTest); } } } @@ -99,8 +132,10 @@ BOOST_AUTO_TEST_CASE(tx_invalid) // Read tests from test/data/tx_invalid.json // Format is an array of arrays // Inner arrays are either [ "comment" ] - // or [[[prevout hash, prevout index, prevout scriptPubKey], [input 2], ...],"], serializedTransaction, enforceP2SH + // or [[[prevout hash, prevout index, prevout scriptPubKey], [input 2], ...],"], serializedTransaction, verifyFlags // ... where all scripts are stringified scripts. + // + // verifyFlags is a comma separated list of script verification flags to apply, or "NONE" Array tests = read_json(std::string(json_tests::tx_invalid, json_tests::tx_invalid + sizeof(json_tests::tx_invalid))); BOOST_FOREACH(Value& tv, tests) @@ -109,7 +144,7 @@ BOOST_AUTO_TEST_CASE(tx_invalid) string strTest = write_string(tv, false); if (test[0].type() == array_type) { - if (test.size() != 3 || test[1].type() != str_type || test[2].type() != bool_type) + if (test.size() != 3 || test[1].type() != str_type || test[2].type() != str_type) { BOOST_ERROR("Bad test: " << strTest); continue; @@ -156,7 +191,9 @@ BOOST_AUTO_TEST_CASE(tx_invalid) break; } - fValid = VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout], tx, i, test[2].get_bool() ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE, 0); + unsigned int verify_flags = ParseFlags(test[2].get_str()); + fValid = VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout], + tx, i, verify_flags, 0); } BOOST_CHECK_MESSAGE(!fValid, strTest); From aa250f0453029afbf3c903899a3770c61e389468 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 5 May 2014 19:43:14 +0200 Subject: [PATCH 0017/1288] Remove NumBlocksOfPeers Generally useless information. Only updates on connect time, not after that. Peers can easily lie and the median filter is not effective in preventing that. In the past it was used for progress display in the GUI but `CheckPoints::guessVerificationProgress` provides a better way that is now used. It was too easy to mislead it. Peers do lie about it in practice, see issue #4065. From the RPC, `getpeerinfo` gives the peer raw values, which are more useful. --- src/main.cpp | 11 ----------- src/main.h | 2 -- src/qt/bitcoingui.cpp | 17 +++++------------ src/qt/bitcoingui.h | 2 +- src/qt/clientmodel.cpp | 14 +++----------- src/qt/clientmodel.h | 5 +---- src/qt/forms/rpcconsole.ui | 33 +++++---------------------------- src/qt/rpcconsole.cpp | 8 +++----- src/qt/rpcconsole.h | 2 +- 9 files changed, 19 insertions(+), 75 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 40c713ce93..46183bf431 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -54,8 +54,6 @@ int64_t CTransaction::nMinTxFee = 10000; // Override with -mintxfee /** Fees smaller than this (in satoshi) are considered zero fee (for relaying and mining) */ int64_t CTransaction::nMinRelayTxFee = 1000; -static CMedianFilter cPeerBlockCounts(8, 0); // Amount of blocks that other nodes claim to have - struct COrphanBlock { uint256 hashBlock; uint256 hashPrev; @@ -1303,12 +1301,6 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits) return true; } -// Return maximum amount of blocks that other nodes claim to have -int GetNumBlocksOfPeers() -{ - return std::max(cPeerBlockCounts.median(), Checkpoints::GetTotalBlocksEstimate()); -} - bool IsInitialBlockDownload() { LOCK(cs_main); @@ -3484,9 +3476,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) LogPrintf("receive version message: %s: version %d, blocks=%d, us=%s, them=%s, peer=%s\n", pfrom->cleanSubVer, pfrom->nVersion, pfrom->nStartingHeight, addrMe.ToString(), addrFrom.ToString(), pfrom->addr.ToString()); AddTimeData(pfrom->addr, nTime); - - LOCK(cs_main); - cPeerBlockCounts.input(pfrom->nStartingHeight); } diff --git a/src/main.h b/src/main.h index 825e577d1e..e459772e88 100644 --- a/src/main.h +++ b/src/main.h @@ -160,8 +160,6 @@ void ThreadScriptCheck(); bool CheckProofOfWork(uint256 hash, unsigned int nBits); /** Calculate the minimum amount of work a received block needs, without knowing its direct parent */ unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime); -/** Get the number of active peers */ -int GetNumBlocksOfPeers(); /** Check whether we are doing an initial block download (synchronizing from disk or network) */ bool IsInitialBlockDownload(); /** Format a string that describes several potential problems detected by the core */ diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index da7762282a..e6190aec13 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -403,8 +403,8 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel) setNumConnections(clientModel->getNumConnections()); connect(clientModel, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int))); - setNumBlocks(clientModel->getNumBlocks(), clientModel->getNumBlocksOfPeers()); - connect(clientModel, SIGNAL(numBlocksChanged(int,int)), this, SLOT(setNumBlocks(int,int))); + setNumBlocks(clientModel->getNumBlocks()); + connect(clientModel, SIGNAL(numBlocksChanged(int)), this, SLOT(setNumBlocks(int))); // Receive and report messages from client model connect(clientModel, SIGNAL(message(QString,QString,unsigned int)), this, SLOT(message(QString,QString,unsigned int))); @@ -617,7 +617,7 @@ void BitcoinGUI::setNumConnections(int count) labelConnectionsIcon->setToolTip(tr("%n active connection(s) to Bitcoin network", "", count)); } -void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) +void BitcoinGUI::setNumBlocks(int count) { // Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbelled text) statusBar()->clearMessage(); @@ -646,17 +646,10 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) QDateTime currentDate = QDateTime::currentDateTime(); int secs = lastBlockDate.secsTo(currentDate); - if(count < nTotalBlocks) - { - tooltip = tr("Processed %1 of %2 (estimated) blocks of transaction history.").arg(count).arg(nTotalBlocks); - } - else - { - tooltip = tr("Processed %1 blocks of transaction history.").arg(count); - } + tooltip = tr("Processed %1 blocks of transaction history.").arg(count); // Set icon state: spinning if catching up, tick otherwise - if(secs < 90*60 && count >= nTotalBlocks) + if(secs < 90*60) { tooltip = tr("Up to date") + QString(".
") + tooltip; labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE)); diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 0cc1ebc502..b4675b95ac 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -130,7 +130,7 @@ public slots: /** Set number of connections shown in the UI */ void setNumConnections(int count); /** Set number of blocks shown in the UI */ - void setNumBlocks(int count, int nTotalBlocks); + void setNumBlocks(int count); /** Notify the user of an event from the core network or transaction handling code. @param[in] title the message box / notification title diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 3c0564c208..d1f68ebd22 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -23,7 +23,7 @@ static const int64_t nClientStartupTime = GetTime(); ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) : QObject(parent), optionsModel(optionsModel), - cachedNumBlocks(0), cachedNumBlocksOfPeers(0), + cachedNumBlocks(0), cachedReindexing(0), cachedImporting(0), numBlocksAtStartup(-1), pollTimer(0) { @@ -101,19 +101,16 @@ void ClientModel::updateTimer() // Some quantities (such as number of blocks) change so fast that we don't want to be notified for each change. // Periodically check and update with a timer. int newNumBlocks = getNumBlocks(); - int newNumBlocksOfPeers = getNumBlocksOfPeers(); // check for changed number of blocks we have, number of blocks peers claim to have, reindexing state and importing state - if (cachedNumBlocks != newNumBlocks || cachedNumBlocksOfPeers != newNumBlocksOfPeers || + if (cachedNumBlocks != newNumBlocks || cachedReindexing != fReindex || cachedImporting != fImporting) { cachedNumBlocks = newNumBlocks; - cachedNumBlocksOfPeers = newNumBlocksOfPeers; cachedReindexing = fReindex; cachedImporting = fImporting; - // ensure we return the maximum of newNumBlocksOfPeers and newNumBlocks to not create weird displays in the GUI - emit numBlocksChanged(newNumBlocks, std::max(newNumBlocksOfPeers, newNumBlocks)); + emit numBlocksChanged(newNumBlocks); } emit bytesChanged(getTotalBytesRecv(), getTotalBytesSent()); @@ -166,11 +163,6 @@ enum BlockSource ClientModel::getBlockSource() const return BLOCK_SOURCE_NONE; } -int ClientModel::getNumBlocksOfPeers() const -{ - return GetNumBlocksOfPeers(); -} - QString ClientModel::getStatusBarWarnings() const { return QString::fromStdString(GetWarnings("statusbar")); diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h index f29b695ea1..cab853d92d 100644 --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -60,8 +60,6 @@ public: bool inInitialBlockDownload() const; //! Return true if core is importing blocks enum BlockSource getBlockSource() const; - //! Return conservative estimate of total number of blocks, or 0 if unknown - int getNumBlocksOfPeers() const; //! Return warnings to be displayed in status bar QString getStatusBarWarnings() const; @@ -75,7 +73,6 @@ private: OptionsModel *optionsModel; int cachedNumBlocks; - int cachedNumBlocksOfPeers; bool cachedReindexing; bool cachedImporting; @@ -88,7 +85,7 @@ private: signals: void numConnectionsChanged(int count); - void numBlocksChanged(int count, int countOfPeers); + void numBlocksChanged(int count); void alertsChanged(const QString &warnings); void bytesChanged(quint64 totalBytesIn, quint64 totalBytesOut); diff --git a/src/qt/forms/rpcconsole.ui b/src/qt/forms/rpcconsole.ui index 31d61ec468..fcb6bb60bb 100644 --- a/src/qt/forms/rpcconsole.ui +++ b/src/qt/forms/rpcconsole.ui @@ -254,36 +254,13 @@ - - - Estimated total blocks - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - Last block time - + IBeamCursor @@ -299,7 +276,7 @@ - + Qt::Vertical @@ -312,7 +289,7 @@ - + @@ -325,7 +302,7 @@ - + Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. @@ -338,7 +315,7 @@ - + Qt::Vertical diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index ba5871ae2b..0a46a722e4 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -271,8 +271,8 @@ void RPCConsole::setClientModel(ClientModel *model) setNumConnections(model->getNumConnections()); connect(model, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int))); - setNumBlocks(model->getNumBlocks(), model->getNumBlocksOfPeers()); - connect(model, SIGNAL(numBlocksChanged(int,int)), this, SLOT(setNumBlocks(int,int))); + setNumBlocks(model->getNumBlocks()); + connect(model, SIGNAL(numBlocksChanged(int)), this, SLOT(setNumBlocks(int))); updateTrafficStats(model->getTotalBytesRecv(), model->getTotalBytesSent()); connect(model, SIGNAL(bytesChanged(quint64,quint64)), this, SLOT(updateTrafficStats(quint64, quint64))); @@ -366,11 +366,9 @@ void RPCConsole::setNumConnections(int count) ui->numberOfConnections->setText(connections); } -void RPCConsole::setNumBlocks(int count, int countOfPeers) +void RPCConsole::setNumBlocks(int count) { ui->numberOfBlocks->setText(QString::number(count)); - // If there is no current countOfPeers available display N/A instead of 0, which can't ever be true - ui->totalBlocks->setText(countOfPeers == 0 ? tr("N/A") : QString::number(countOfPeers)); if(clientModel) ui->lastBlockTime->setText(clientModel->getLastBlockDate().toString()); } diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index f7a7772050..091a6d294f 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -52,7 +52,7 @@ public slots: /** Set number of connections shown in the UI */ void setNumConnections(int count); /** Set number of blocks shown in the UI */ - void setNumBlocks(int count, int countOfPeers); + void setNumBlocks(int count); /** Go forward or back in history */ void browseHistory(int offset); /** Scroll console view to end */ From 783b182c8fa92674fa609b584c0b187469893ca4 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 6 May 2014 15:25:01 +0200 Subject: [PATCH 0018/1288] Remove dummy PRIszX macros for formatting Size specifiers are no longer needed now that we use typesafe tinyformat for string formatting, instead of the system's sprintf. No functional changes. This continues the work in #3735. --- src/core.cpp | 4 ++-- src/init.cpp | 8 ++++---- src/main.cpp | 22 +++++++++++----------- src/miner.cpp | 2 +- src/rpcmisc.cpp | 2 +- src/rpcprotocol.cpp | 2 +- src/test/util_tests.cpp | 12 ++++++------ src/util.h | 12 ------------ src/wallet.cpp | 2 +- src/walletdb.cpp | 2 +- 10 files changed, 28 insertions(+), 40 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index cbdd24e806..7651ce9957 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -140,7 +140,7 @@ double CTransaction::ComputePriority(double dPriorityInputs, unsigned int nTxSiz std::string CTransaction::ToString() const { std::string str; - str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%"PRIszu", vout.size=%"PRIszu", nLockTime=%u)\n", + str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%u, vout.size=%u, nLockTime=%u)\n", GetHash().ToString().substr(0,10), nVersion, vin.size(), @@ -269,7 +269,7 @@ uint256 CBlock::CheckMerkleBranch(uint256 hash, const std::vector& vMer void CBlock::print() const { - LogPrintf("CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%"PRIszu")\n", + LogPrintf("CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%u)\n", GetHash().ToString(), nVersion, hashPrevBlock.ToString(), diff --git a/src/init.cpp b/src/init.cpp index 77c32d0b49..821ac4c875 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1078,12 +1078,12 @@ bool AppInit2(boost::thread_group& threadGroup) RandAddSeedPerfmon(); //// debug print - LogPrintf("mapBlockIndex.size() = %"PRIszu"\n", mapBlockIndex.size()); + LogPrintf("mapBlockIndex.size() = %u\n", mapBlockIndex.size()); LogPrintf("nBestHeight = %d\n", chainActive.Height()); #ifdef ENABLE_WALLET - LogPrintf("setKeyPool.size() = %"PRIszu"\n", pwalletMain ? pwalletMain->setKeyPool.size() : 0); - LogPrintf("mapWallet.size() = %"PRIszu"\n", pwalletMain ? pwalletMain->mapWallet.size() : 0); - LogPrintf("mapAddressBook.size() = %"PRIszu"\n", pwalletMain ? pwalletMain->mapAddressBook.size() : 0); + LogPrintf("setKeyPool.size() = %u\n", pwalletMain ? pwalletMain->setKeyPool.size() : 0); + LogPrintf("mapWallet.size() = %u\n", pwalletMain ? pwalletMain->mapWallet.size() : 0); + LogPrintf("mapAddressBook.size() = %u\n", pwalletMain ? pwalletMain->mapAddressBook.size() : 0); #endif StartNode(threadGroup); diff --git a/src/main.cpp b/src/main.cpp index 40c713ce93..77418bbd15 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -432,7 +432,7 @@ bool AddOrphanTx(const CTransaction& tx) BOOST_FOREACH(const CTxIn& txin, tx.vin) mapOrphanTransactionsByPrev[txin.prevout.hash].insert(hash); - LogPrint("mempool", "stored orphan tx %s (mapsz %"PRIszu")\n", hash.ToString(), + LogPrint("mempool", "stored orphan tx %s (mapsz %u)\n", hash.ToString(), mapOrphanTransactions.size()); return true; } @@ -3044,7 +3044,7 @@ void PrintBlockTree() // print item CBlock block; ReadBlockFromDisk(block, pindex); - LogPrintf("%d (blk%05u.dat:0x%x) %s tx %"PRIszu"\n", + LogPrintf("%d (blk%05u.dat:0x%x) %s tx %u\n", pindex->nHeight, pindex->GetBlockPos().nFile, pindex->GetBlockPos().nPos, DateTimeStrFormat("%Y-%m-%d %H:%M:%S", block.GetBlockTime()), @@ -3371,7 +3371,7 @@ void static ProcessGetData(CNode* pfrom) bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) { RandAddSeedPerfmon(); - LogPrint("net", "received: %s (%"PRIszu" bytes)\n", strCommand, vRecv.size()); + LogPrint("net", "received: %s (%u bytes)\n", strCommand, vRecv.size()); if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0) { LogPrintf("dropmessagestest DROPPING RECV MESSAGE\n"); @@ -3515,7 +3515,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) if (vAddr.size() > 1000) { Misbehaving(pfrom->GetId(), 20); - return error("message addr size() = %"PRIszu"", vAddr.size()); + return error("message addr size() = %u", vAddr.size()); } // Store the new addresses @@ -3578,7 +3578,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) if (vInv.size() > MAX_INV_SZ) { Misbehaving(pfrom->GetId(), 20); - return error("message inv size() = %"PRIszu"", vInv.size()); + return error("message inv size() = %u", vInv.size()); } LOCK(cs_main); @@ -3617,11 +3617,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) if (vInv.size() > MAX_INV_SZ) { Misbehaving(pfrom->GetId(), 20); - return error("message getdata size() = %"PRIszu"", vInv.size()); + return error("message getdata size() = %u", vInv.size()); } if (fDebug || (vInv.size() != 1)) - LogPrint("net", "received getdata (%"PRIszu" invsz)\n", vInv.size()); + LogPrint("net", "received getdata (%u invsz)\n", vInv.size()); if ((fDebug && vInv.size() > 0) || (vInv.size() == 1)) LogPrint("net", "received getdata for: %s\n", vInv[0].ToString()); @@ -3729,7 +3729,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) vEraseQueue.push_back(inv.hash); - LogPrint("mempool", "AcceptToMemoryPool: %s %s : accepted %s (poolsz %"PRIszu")\n", + LogPrint("mempool", "AcceptToMemoryPool: %s %s : accepted %s (poolsz %u)\n", pfrom->addr.ToString(), pfrom->cleanSubVer, tx.GetHash().ToString(), mempool.mapTx.size()); @@ -3914,7 +3914,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) } if (!(sProblem.empty())) { - LogPrint("net", "pong %s %s: %s, %x expected, %x received, %"PRIszu" bytes\n", + LogPrint("net", "pong %s %s: %s, %x expected, %x received, %u bytes\n", pfrom->addr.ToString(), pfrom->cleanSubVer, sProblem, @@ -4049,7 +4049,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) bool ProcessMessages(CNode* pfrom) { //if (fDebug) - // LogPrintf("ProcessMessages(%"PRIszu" messages)\n", pfrom->vRecvMsg.size()); + // LogPrintf("ProcessMessages(%u messages)\n", pfrom->vRecvMsg.size()); // // Message format @@ -4077,7 +4077,7 @@ bool ProcessMessages(CNode* pfrom) CNetMessage& msg = *it; //if (fDebug) - // LogPrintf("ProcessMessages(message %u msgsz, %"PRIszu" bytes, complete:%s)\n", + // LogPrintf("ProcessMessages(message %u msgsz, %u bytes, complete:%s)\n", // msg.hdr.nMessageSize, msg.vRecv.size(), // msg.complete() ? "Y" : "N"); diff --git a/src/miner.cpp b/src/miner.cpp index 3351908e65..6bc6edf34f 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -528,7 +528,7 @@ void static BitcoinMiner(CWallet *pwallet) CBlock *pblock = &pblocktemplate->block; IncrementExtraNonce(pblock, pindexPrev, nExtraNonce); - LogPrintf("Running BitcoinMiner with %"PRIszu" transactions in block (%u bytes)\n", pblock->vtx.size(), + LogPrintf("Running BitcoinMiner with %u transactions in block (%u bytes)\n", pblock->vtx.size(), ::GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION)); // diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index ae154f2ae4..6964b97be3 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -187,7 +187,7 @@ CScript _createmultisig(const Array& params) if ((int)keys.size() < nRequired) throw runtime_error( strprintf("not enough keys supplied " - "(got %"PRIszu" keys, but need at least %d to redeem)", keys.size(), nRequired)); + "(got %u keys, but need at least %d to redeem)", keys.size(), nRequired)); std::vector pubkeys; pubkeys.resize(keys.size()); for (unsigned int i = 0; i < keys.size(); i++) diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp index 652b14d187..5cbaa535ab 100644 --- a/src/rpcprotocol.cpp +++ b/src/rpcprotocol.cpp @@ -92,7 +92,7 @@ string HTTPReply(int nStatus, const string& strMsg, bool keepalive) "HTTP/1.1 %d %s\r\n" "Date: %s\r\n" "Connection: %s\r\n" - "Content-Length: %"PRIszu"\r\n" + "Content-Length: %u\r\n" "Content-Type: application/json\r\n" "Server: bitcoin-json-rpc/%s\r\n" "\r\n" diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index b8f107f644..44998cbda7 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -321,15 +321,15 @@ BOOST_AUTO_TEST_CASE(strprintf_numbers) size_t st = 12345678; /* unsigned size_t test value */ ssize_t sst = -12345678; /* signed size_t test value */ - BOOST_CHECK(strprintf("%s %"PRIszd" %s", B, sst, E) == B" -12345678 "E); - BOOST_CHECK(strprintf("%s %"PRIszu" %s", B, st, E) == B" 12345678 "E); - BOOST_CHECK(strprintf("%s %"PRIszx" %s", B, st, E) == B" bc614e "E); + BOOST_CHECK(strprintf("%s %d %s", B, sst, E) == B" -12345678 "E); + BOOST_CHECK(strprintf("%s %u %s", B, st, E) == B" 12345678 "E); + BOOST_CHECK(strprintf("%s %x %s", B, st, E) == B" bc614e "E); ptrdiff_t pt = 87654321; /* positive ptrdiff_t test value */ ptrdiff_t spt = -87654321; /* negative ptrdiff_t test value */ - BOOST_CHECK(strprintf("%s %"PRIpdd" %s", B, spt, E) == B" -87654321 "E); - BOOST_CHECK(strprintf("%s %"PRIpdu" %s", B, pt, E) == B" 87654321 "E); - BOOST_CHECK(strprintf("%s %"PRIpdx" %s", B, pt, E) == B" 5397fb1 "E); + BOOST_CHECK(strprintf("%s %d %s", B, spt, E) == B" -87654321 "E); + BOOST_CHECK(strprintf("%s %u %s", B, pt, E) == B" 87654321 "E); + BOOST_CHECK(strprintf("%s %x %s", B, pt, E) == B" 5397fb1 "E); } #undef B #undef E diff --git a/src/util.h b/src/util.h index fbd841f7a8..55d9308ab6 100644 --- a/src/util.h +++ b/src/util.h @@ -44,18 +44,6 @@ static const int64_t CENT = 1000000; #define UEND(a) ((unsigned char*)&((&(a))[1])) #define ARRAYLEN(array) (sizeof(array)/sizeof((array)[0])) -/* Format characters for (s)size_t, ptrdiff_t. - * - * Define these as empty as the tinyformat-based formatting system is - * type-safe, no special format characters are needed to specify sizes. - */ -#define PRIszx "x" -#define PRIszu "u" -#define PRIszd "d" -#define PRIpdx "x" -#define PRIpdu "u" -#define PRIpdd "d" - // This is needed because the foreach macro can't get over the comma in pair #define PAIRTYPE(t1, t2) std::pair diff --git a/src/wallet.cpp b/src/wallet.cpp index 7cf2361096..22df7a9ad8 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1638,7 +1638,7 @@ bool CWallet::TopUpKeyPool(unsigned int kpSize) if (!walletdb.WritePool(nEnd, CKeyPool(GenerateNewKey()))) throw runtime_error("TopUpKeyPool() : writing generated key failed"); setKeyPool.insert(nEnd); - LogPrintf("keypool added key %d, size=%"PRIszu"\n", nEnd, setKeyPool.size()); + LogPrintf("keypool added key %d, size=%u\n", nEnd, setKeyPool.size()); } } return true; diff --git a/src/walletdb.cpp b/src/walletdb.cpp index 359a1cef61..80e9dded5f 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -894,7 +894,7 @@ bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys) LogPrintf("Salvage(aggressive) found no records in %s.\n", newFilename); return false; } - LogPrintf("Salvage(aggressive) found %"PRIszu" records\n", salvagedData.size()); + LogPrintf("Salvage(aggressive) found %u records\n", salvagedData.size()); bool fSuccess = allOK; Db* pdbCopy = new Db(&dbenv.dbenv, 0); From bdc83e8f450456c9f547f1c4eab43571bac631c2 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sat, 16 Nov 2013 01:54:29 +0100 Subject: [PATCH 0019/1288] [Qt] ensure payment request network matches client network - replaces checks in SendCoinsDialog::handlePaymentRequest() that belong to PaymentServer (normal URIs are special cased, as only an isValid check is done on BTC addresses) - prevents the client to handle payment requests that do not match the clients network and shows an error instead (mainly a problem with drag&drop payment requests onto the client window) - includes some small comment changes also --- src/qt/paymentserver.cpp | 81 ++++++++++++++++++++++++++++---------- src/qt/sendcoinsdialog.cpp | 22 +---------- 2 files changed, 62 insertions(+), 41 deletions(-) diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index ca6ae17990..4c45585685 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -178,6 +178,9 @@ void PaymentServer::LoadRootCAs(X509_STORE* _store) // and the items in savedPaymentRequest will be handled // when uiReady() is called. // +// Warning: ipcSendCommandLine() is called early in init, +// so don't use "emit message()", but "QMessageBox::"! +// bool PaymentServer::ipcParseCommandLine(int argc, char* argv[]) { for (int i = 1; i < argc; i++) @@ -411,7 +414,15 @@ void PaymentServer::handleURIOrFile(const QString& s) { SendCoinsRecipient recipient; if (GUIUtil::parseBitcoinURI(s, &recipient)) - emit receivedPaymentRequest(recipient); + { + CBitcoinAddress address(recipient.address.toStdString()); + if (!address.IsValid()) { + emit message(tr("URI handling"), tr("Invalid payment address %1").arg(recipient.address), + CClientUIInterface::MSG_ERROR); + } + else + emit receivedPaymentRequest(recipient); + } else emit message(tr("URI handling"), tr("URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters."), @@ -425,12 +436,14 @@ void PaymentServer::handleURIOrFile(const QString& s) { PaymentRequestPlus request; SendCoinsRecipient recipient; - if (readPaymentRequest(s, request) && processPaymentRequest(request, recipient)) - emit receivedPaymentRequest(recipient); - else + if (!readPaymentRequest(s, request)) + { emit message(tr("Payment request file handling"), - tr("Payment request file can not be read or processed! This can be caused by an invalid payment request file."), + tr("Payment request file can not be read! This can be caused by an invalid payment request file."), CClientUIInterface::ICON_WARNING); + } + else if (processPaymentRequest(request, recipient)) + emit receivedPaymentRequest(recipient); return; } @@ -482,6 +495,35 @@ bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoins if (!optionsModel) return false; + if (request.IsInitialized()) { + const payments::PaymentDetails& details = request.getDetails(); + + // Payment request network matches client network? + if ((details.network() == "main" && TestNet()) || + (details.network() == "test" && !TestNet())) + { + emit message(tr("Payment request rejected"), tr("Payment request network doesn't match client network."), + CClientUIInterface::MSG_ERROR); + + return false; + } + + // Expired payment request? + if (details.has_expires() && (int64_t)details.expires() < GetTime()) + { + emit message(tr("Payment request rejected"), tr("Payment request has expired."), + CClientUIInterface::MSG_ERROR); + + return false; + } + } + else { + emit message(tr("Payment request error"), tr("Payment request is not initialized."), + CClientUIInterface::MSG_ERROR); + + return false; + } + recipient.paymentRequest = request; recipient.message = GUIUtil::HtmlEscape(request.getDetails().memo()); @@ -497,11 +539,11 @@ bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoins // Append destination address addresses.append(QString::fromStdString(CBitcoinAddress(dest).ToString())); } - else if (!recipient.authenticatedMerchant.isEmpty()){ + else if (!recipient.authenticatedMerchant.isEmpty()) { // Insecure payments to custom bitcoin addresses are not supported // (there is no good way to tell the user where they are paying in a way // they'd have a chance of understanding). - emit message(tr("Payment request error"), + emit message(tr("Payment request rejected"), tr("Unverified payment requests to custom payment scripts are unsupported."), CClientUIInterface::MSG_ERROR); return false; @@ -510,11 +552,10 @@ bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoins // Extract and check amounts CTxOut txOut(sendingTo.second, sendingTo.first); if (txOut.IsDust(CTransaction::nMinRelayTxFee)) { - QString msg = tr("Requested payment amount of %1 is too small (considered dust).") - .arg(BitcoinUnits::formatWithUnit(optionsModel->getDisplayUnit(), sendingTo.second)); + emit message(tr("Payment request error"), tr("Requested payment amount of %1 is too small (considered dust).") + .arg(BitcoinUnits::formatWithUnit(optionsModel->getDisplayUnit(), sendingTo.second)), + CClientUIInterface::MSG_ERROR); - qDebug() << "PaymentServer::processPaymentRequest : " << msg; - emit message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR); return false; } @@ -581,8 +622,8 @@ void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipien refund_to->set_script(&s[0], s.size()); } else { - // This should never happen, because sending coins should have just unlocked the wallet - // and refilled the keypool + // This should never happen, because sending coins should have + // just unlocked the wallet and refilled the keypool. qDebug() << "PaymentServer::fetchPaymentACK : Error getting refund key, refund_to not set"; } } @@ -594,7 +635,7 @@ void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipien netManager->post(netRequest, serData); } else { - // This should never happen, either: + // This should never happen, either. qDebug() << "PaymentServer::fetchPaymentACK : Error serializing payment message"; } } @@ -620,17 +661,15 @@ void PaymentServer::netRequestFinished(QNetworkReply* reply) { PaymentRequestPlus request; SendCoinsRecipient recipient; - if (request.parse(data) && processPaymentRequest(request, recipient)) + if (!request.parse(data)) { - emit receivedPaymentRequest(recipient); - } - else - { - qDebug() << "PaymentServer::netRequestFinished : Error processing payment request"; + qDebug() << "PaymentServer::netRequestFinished : Error parsing payment request"; emit message(tr("Payment request error"), - tr("Payment request can not be parsed or processed!"), + tr("Payment request can not be parsed!"), CClientUIInterface::MSG_ERROR); } + else if (processPaymentRequest(request, recipient)) + emit receivedPaymentRequest(recipient); return; } diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 33621e54b0..23b8ef83e2 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -377,26 +377,8 @@ void SendCoinsDialog::pasteEntry(const SendCoinsRecipient &rv) bool SendCoinsDialog::handlePaymentRequest(const SendCoinsRecipient &rv) { - QString strSendCoins = tr("Send Coins"); - if (rv.paymentRequest.IsInitialized()) { - // Expired payment request? - const payments::PaymentDetails& details = rv.paymentRequest.getDetails(); - if (details.has_expires() && (int64_t)details.expires() < GetTime()) - { - emit message(strSendCoins, tr("Payment request expired"), - CClientUIInterface::MSG_WARNING); - return false; - } - } - else { - CBitcoinAddress address(rv.address.toStdString()); - if (!address.IsValid()) { - emit message(strSendCoins, tr("Invalid payment address %1").arg(rv.address), - CClientUIInterface::MSG_WARNING); - return false; - } - } - + // Just paste the entry, all pre-checks + // are done in paymentserver.cpp. pasteEntry(rv); return true; } From 6380180821917c22ecfd89128ee60aae6f4cac33 Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Mon, 10 Mar 2014 17:36:35 -0400 Subject: [PATCH 0020/1288] Add rejection of non-null CHECKMULTISIG dummy values This is a source of transaction mutability as the dummy value was previously not checked and could be modified to something other than the usual OP_0 value. --- src/script.cpp | 16 +++++++++++++++- src/script.h | 4 +++- src/test/data/tx_invalid.json | 29 ++++++++++++++++++++++++++++- src/test/data/tx_valid.json | 18 ++++++++++++++++-- src/test/transaction_tests.cpp | 1 + 5 files changed, 63 insertions(+), 5 deletions(-) diff --git a/src/script.cpp b/src/script.cpp index dc0cd28bf8..a5cdc9712d 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -934,8 +934,22 @@ bool EvalScript(vector >& stack, const CScript& script, co fSuccess = false; } - while (i-- > 0) + // Clean up stack of actual arguments + while (i-- > 1) popstack(stack); + + // A bug causes CHECKMULTISIG to consume one extra argument + // whose contents were not checked in any way. + // + // Unfortunately this is a potential source of mutability, + // so optionally verify it is exactly equal to zero prior + // to removing it from the stack. + if (stack.size() < 1) + return false; + if ((flags & SCRIPT_VERIFY_NULLDUMMY) && stacktop(-1).size()) + return error("CHECKMULTISIG dummy argument not null"); + popstack(stack); + stack.push_back(fSuccess ? vchTrue : vchFalse); if (opcode == OP_CHECKMULTISIGVERIFY) diff --git a/src/script.h b/src/script.h index 0f26fb556d..01779f550c 100644 --- a/src/script.h +++ b/src/script.h @@ -42,6 +42,7 @@ enum SCRIPT_VERIFY_STRICTENC = (1U << 1), // enforce strict conformance to DER and SEC2 for signatures and pubkeys SCRIPT_VERIFY_EVEN_S = (1U << 2), // enforce even S values in signatures (depends on STRICTENC) SCRIPT_VERIFY_NOCACHE = (1U << 3), // do not store results in signature cache (but do query it) + SCRIPT_VERIFY_NULLDUMMY = (1U << 4), // verify dummy stack item consumed by CHECKMULTISIG is of zero-length }; // Mandatory script verification flags that all new blocks must comply with for @@ -54,7 +55,8 @@ static const unsigned int MANDATORY_SCRIPT_VERIFY_FLAGS = SCRIPT_VERIFY_P2SH; // with. However scripts violating these flags may still be present in valid // blocks and we must accept those blocks. static const unsigned int STANDARD_SCRIPT_VERIFY_FLAGS = MANDATORY_SCRIPT_VERIFY_FLAGS | - SCRIPT_VERIFY_STRICTENC; + SCRIPT_VERIFY_STRICTENC | + SCRIPT_VERIFY_NULLDUMMY; enum txnouttype { diff --git a/src/test/data/tx_invalid.json b/src/test/data/tx_invalid.json index b9472ce00a..638a705f9f 100644 --- a/src/test/data/tx_invalid.json +++ b/src/test/data/tx_invalid.json @@ -67,11 +67,38 @@ ["0000000000000000000000000000000000000000000000000000000000000200", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"]], "01000000020001000000000000000000000000000000000000000000000000000000000000000000004948304502203a0f5f0e1f2bdbcd04db3061d18f3af70e07f4f467cbc1b8116f267025f5360b022100c792b6e215afc5afc721a351ec413e714305cb749aae3d7fee76621313418df10101000000000200000000000000000000000000000000000000000000000000000000000000000000484730440220201dc2d030e380e8f9cfb41b442d930fa5a685bb2c8db5906671f865507d0670022018d9e7a8d4c8d86a73c2a724ee38ef983ec249827e0e464841735955c707ece98101000000010100000000000000015100000000", "P2SH"], -["Incorrect signature order"], +["CHECKMULTISIG with incorrect signature order"], ["Note the input is just required to make the tester happy"], [[["b3da01dd4aae683c7aee4d5d8b52a540a508e1115f77cd7fa9a291243f501223", 0, "HASH160 0x14 0xb1ce99298d5f07364b57b1e5c9cc00be0b04a954 EQUAL"]], "01000000012312503f2491a2a97fcd775f11e108a540a5528b5d4dee7a3c68ae4add01dab300000000fdfe000048304502207aacee820e08b0b174e248abd8d7a34ed63b5da3abedb99934df9fddd65c05c4022100dfe87896ab5ee3df476c2655f9fbe5bd089dccbef3e4ea05b5d121169fe7f5f401483045022100f6649b0eddfdfd4ad55426663385090d51ee86c3481bdc6b0c18ea6c0ece2c0b0220561c315b07cffa6f7dd9df96dbae9200c2dee09bf93cc35ca05e6cdf613340aa014c695221031d11db38972b712a9fe1fc023577c7ae3ddb4a3004187d41c45121eecfdbb5b7210207ec36911b6ad2382860d32989c7b8728e9489d7bbc94a6b5509ef0029be128821024ea9fac06f666a4adc3fc1357b7bec1fd0bdece2b9d08579226a8ebde53058e453aeffffffff0180380100000000001976a914c9b99cddf847d10685a4fabaa0baf505f7c3dfab88ac00000000", "P2SH"], + +["The following is a tweaked form of 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63"], +["It is an OP_CHECKMULTISIG with the dummy value missing"], +[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004847304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH"], + + +["CHECKMULTISIG SCRIPT_VERIFY_NULLDUMMY tests:"], + +["The following is a tweaked form of 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63"], +["It is an OP_CHECKMULTISIG with the dummy value set to something other than an empty string"], +[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004a010047304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH,NULLDUMMY"], + +["As above, but using a OP_1"], +[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000495147304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH,NULLDUMMY"], + +["As above, but using a OP_1NEGATE"], +[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000494f47304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH,NULLDUMMY"], + +["As above, but with the dummy byte missing"], +[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004847304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH,NULLDUMMY"], + + ["Empty stack when we try to run CHECKSIG"], [[["ad503f72c18df5801ee64d76090afe4c607fb2b822e9b7b63c5826c50e22fc3b", 0, "0x21 0x027c3a97665bf283a102a587a62a30a0c102d4d3b141015e2cae6f64e2543113e5 CHECKSIG NOT"]], "01000000013bfc220ec526583cb6b7e922b8b27f604cfe0a09764de61e80f58dc1723f50ad0000000000ffffffff0101000000000000002321027c3a97665bf283a102a587a62a30a0c102d4d3b141015e2cae6f64e2543113e5ac00000000", "P2SH"], diff --git a/src/test/data/tx_valid.json b/src/test/data/tx_valid.json index ddcb12ff14..1f51d3ce55 100644 --- a/src/test/data/tx_valid.json +++ b/src/test/data/tx_valid.json @@ -13,9 +13,23 @@ "0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000490047304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH"], ["The following is a tweaked form of 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63"], -["It has an arbitrary extra byte stuffed into the signature at pos length - 2"], +["It is an OP_CHECKMULTISIG with an arbitrary extra byte stuffed into the signature at pos length - 2"], +["The dummy byte is fine however, so the NULLDUMMY flag should be happy"], [[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], -"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004A0048304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2bab01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH"], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004A0048304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2bab01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH,NULLDUMMY"], + +["The following is a tweaked form of 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63"], +["It is an OP_CHECKMULTISIG with the dummy value set to something other than an empty string"], +[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004a01ff47304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH"], + +["As above, but using a OP_1"], +[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000495147304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH"], + +["As above, but using a OP_1NEGATE"], +[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000494f47304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH"], ["The following is c99c49da4c38af669dea436d3e73780dfdb6c1ecf9958baa52960e8baee30e73"], ["It is of interest because it contains a 0-sequence as well as a signature of SIGHASH type 0 (which is not a real type)"], diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 9edc07ab16..40961cbae0 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -39,6 +39,7 @@ unsigned int ParseFlags(string strFlags){ mapFlagNames["P2SH"] = SCRIPT_VERIFY_P2SH; mapFlagNames["STRICTENC"] = SCRIPT_VERIFY_STRICTENC; mapFlagNames["EVEN_S"] = SCRIPT_VERIFY_EVEN_S; + mapFlagNames["NULLDUMMY"] = SCRIPT_VERIFY_NULLDUMMY; } BOOST_FOREACH(string word, words) From f80cffa213cce7d7f82aef7cf3a2f7308fbeb009 Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Mon, 10 Mar 2014 22:36:46 -0400 Subject: [PATCH 0021/1288] Do not trigger a DoS ban if SCRIPT_VERIFY_NULLDUMMY fails --- src/main.cpp | 24 ++++++++++++++++++------ src/script.h | 6 ++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index cee9d027f5..e8fb26de88 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1588,14 +1588,26 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, CCoinsViewCach pvChecks->push_back(CScriptCheck()); check.swap(pvChecks->back()); } else if (!check()) { - if (flags & SCRIPT_VERIFY_STRICTENC) { - // For now, check whether the failure was caused by non-canonical - // encodings or not; if so, don't trigger DoS protection. - CScriptCheck check(coins, tx, i, flags & (~SCRIPT_VERIFY_STRICTENC), 0); + if (flags & STANDARD_NOT_MANDATORY_VERIFY_FLAGS) { + // Check whether the failure was caused by a + // non-mandatory script verification check, such as + // non-standard DER encodings or non-null dummy + // arguments; if so, don't trigger DoS protection to + // avoid splitting the network between upgraded and + // non-upgraded nodes. + CScriptCheck check(coins, tx, i, + flags & ~STANDARD_NOT_MANDATORY_VERIFY_FLAGS, 0); if (check()) - return state.Invalid(false, REJECT_NONSTANDARD, "non-canonical"); + return state.Invalid(false, REJECT_NONSTANDARD, "non-mandatory-script-verify-flag"); } - return state.DoS(100,false, REJECT_NONSTANDARD, "non-canonical"); + // Failures of other flags indicate a transaction that is + // invalid in new blocks, e.g. a invalid P2SH. We DoS ban + // such nodes as they are not following the protocol. That + // said during an upgrade careful thought should be taken + // as to the correct behavior - we may want to continue + // peering with non-upgraded nodes even after a soft-fork + // super-majority vote has passed. + return state.DoS(100,false, REJECT_INVALID, "mandatory-script-verify-flag-failed"); } } } diff --git a/src/script.h b/src/script.h index 01779f550c..bbcdad159c 100644 --- a/src/script.h +++ b/src/script.h @@ -49,6 +49,9 @@ enum // them to be valid. (but old blocks may not comply with) Currently just P2SH, // but in the future other flags may be added, such as a soft-fork to enforce // strict DER encoding. +// +// Failing one of these tests may trigger a DoS ban - see CheckInputs() for +// details. static const unsigned int MANDATORY_SCRIPT_VERIFY_FLAGS = SCRIPT_VERIFY_P2SH; // Standard script verification flags that standard transactions will comply @@ -58,6 +61,9 @@ static const unsigned int STANDARD_SCRIPT_VERIFY_FLAGS = MANDATORY_SCRIPT_VERIFY SCRIPT_VERIFY_STRICTENC | SCRIPT_VERIFY_NULLDUMMY; +// For convenience, standard but not mandatory verify flags. +static const unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS = STANDARD_SCRIPT_VERIFY_FLAGS & ~MANDATORY_SCRIPT_VERIFY_FLAGS; + enum txnouttype { TX_NONSTANDARD, From 4d79098ad548874ca6e4c09d873fc2f481e6edb4 Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Mon, 10 Mar 2014 16:38:44 -0400 Subject: [PATCH 0022/1288] Increase IsStandard() scriptSig length Removes the limits on number of pubkeys for P2SH CHECKMULTISIG outputs. Previously with the 500 byte scriptSig limit there were odd restrictions where even a 1-of-12 P2SH could be spent in a standard transaction(1), yet multisig scriptPubKey's requiring more signatures quickly ran out of scriptSig space. From a "stuff-data-in-the-blockchain" point of view not much has changed as with the prior commit now only allowing the dummy value to be null the newly allowed scriptSig space can only be used for signatures. In any case, just using more outputs is trivial and doesn't cost much. 1) See 779b519480d8c5346de6e635119c7ee772e97ec872240c45e558f582a37b4b73 Mined by BTC Guild. --- src/main.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e8fb26de88..8ed811c1a9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -515,10 +515,14 @@ bool IsStandardTx(const CTransaction& tx, string& reason) BOOST_FOREACH(const CTxIn& txin, tx.vin) { - // Biggest 'standard' txin is a 3-signature 3-of-3 CHECKMULTISIG - // pay-to-script-hash, which is 3 ~80-byte signatures, 3 - // ~65-byte public keys, plus a few script ops. - if (txin.scriptSig.size() > 500) { + // Biggest 'standard' txin is a 15-of-15 P2SH multisig with compressed + // keys. (remember the 520 byte limit on redeemScript size) That works + // out to a (15*(33+1))+3=513 byte redeemScript, 513+1+15*(73+1)=1624 + // bytes of scriptSig, which we round off to 1650 bytes for some minor + // future-proofing. That's also enough to spend a 20-of-20 + // CHECKMULTISIG scriptPubKey, though such a scriptPubKey is not + // considered standard) + if (txin.scriptSig.size() > 1650) { reason = "scriptsig-size"; return false; } From 787ee0c91394b0ae16ca2500dbacf9349e65b6bc Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Mon, 10 Mar 2014 22:43:15 -0400 Subject: [PATCH 0023/1288] Check redeemScript size does not exceed 520 byte limit redeemScripts >520bytes can't be spent due to the MAX_SCRIPT_ELEMENT_SIZE limit; previously the addmultisigaddress and createmultisig RPC calls would let you violate that limit unknowingly. Also made the wallet code itself check the redeemScript prior to adding it to the wallet, which in the (rare) instance that a user has added an invalid oversized redeemScript to their wallet causes an error on startup. The affected key isn't added to the wallet; other keys are unaffected. --- src/keystore.cpp | 3 +++ src/rpcmisc.cpp | 9 +++++++-- src/rpcwallet.cpp | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/keystore.cpp b/src/keystore.cpp index 46402ea25b..594e0c61da 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -33,6 +33,9 @@ bool CBasicKeyStore::AddKeyPubKey(const CKey& key, const CPubKey &pubkey) bool CBasicKeyStore::AddCScript(const CScript& redeemScript) { + if (redeemScript.size() > MAX_SCRIPT_ELEMENT_SIZE) + return error("CBasicKeyStore::AddCScript() : redeemScripts > %i bytes are invalid", MAX_SCRIPT_ELEMENT_SIZE); + LOCK(cs_KeyStore); mapScripts[redeemScript.GetID()] = redeemScript; return true; diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index ae154f2ae4..a2694d458a 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -176,7 +176,7 @@ Value validateaddress(const Array& params, bool fHelp) // // Used by addmultisigaddress / createmultisig: // -CScript _createmultisig(const Array& params) +CScript _createmultisig_redeemScript(const Array& params) { int nRequired = params[0].get_int(); const Array& keys = params[1].get_array(); @@ -228,6 +228,11 @@ CScript _createmultisig(const Array& params) } CScript result; result.SetMultisig(nRequired, pubkeys); + + if (result.size() > MAX_SCRIPT_ELEMENT_SIZE) + throw runtime_error( + strprintf("redeemScript exceeds size limit: %d > %d", result.size(), MAX_SCRIPT_ELEMENT_SIZE)); + return result; } @@ -263,7 +268,7 @@ Value createmultisig(const Array& params, bool fHelp) } // Construct using pay-to-script-hash: - CScript inner = _createmultisig(params); + CScript inner = _createmultisig_redeemScript(params); CScriptID innerID = inner.GetID(); CBitcoinAddress address(innerID); diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index a5a7df0867..e21881dbe9 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -871,7 +871,7 @@ Value sendmany(const Array& params, bool fHelp) } // Defined in rpcmisc.cpp -extern CScript _createmultisig(const Array& params); +extern CScript _createmultisig_redeemScript(const Array& params); Value addmultisigaddress(const Array& params, bool fHelp) { @@ -908,7 +908,7 @@ Value addmultisigaddress(const Array& params, bool fHelp) strAccount = AccountFromValue(params[2]); // Construct using pay-to-script-hash: - CScript inner = _createmultisig(params); + CScript inner = _createmultisig_redeemScript(params); CScriptID innerID = inner.GetID(); pwalletMain->AddCScript(inner); From e443ed2462b706650f51f08c8760dbf5047aa77f Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 9 May 2014 16:33:37 +0200 Subject: [PATCH 0024/1288] Fix transaction tests Conflict between low-s (6fd7ef2) and test updates in d3a33fc. --- src/test/transaction_tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 40961cbae0..feba5ee80e 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -38,7 +38,7 @@ unsigned int ParseFlags(string strFlags){ mapFlagNames["NONE"] = SCRIPT_VERIFY_NONE; mapFlagNames["P2SH"] = SCRIPT_VERIFY_P2SH; mapFlagNames["STRICTENC"] = SCRIPT_VERIFY_STRICTENC; - mapFlagNames["EVEN_S"] = SCRIPT_VERIFY_EVEN_S; + mapFlagNames["LOW_S"] = SCRIPT_VERIFY_LOW_S; mapFlagNames["NULLDUMMY"] = SCRIPT_VERIFY_NULLDUMMY; } From eb2cbd754d0ed02ab1c3f0889b6ee1776abd5082 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 19 Apr 2014 23:02:47 +0200 Subject: [PATCH 0025/1288] Deduplicate shared code between uint160 and uint256 --- src/uint256.h | 306 +++++++++++--------------------------------------- 1 file changed, 65 insertions(+), 241 deletions(-) diff --git a/src/uint256.h b/src/uint256.h index ba903bc8fc..a3f7835875 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers +// Copyright (c) 2009-2014 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -19,17 +19,56 @@ inline signed char HexDigit(char c) return p_util_hexdigit[(unsigned char)c]; } -/** Base class without constructors for uint256 and uint160. - * This makes the compiler let you use it in a union. - */ +/** Template base class for unsigned big integers. */ template class base_uint { -protected: +private: enum { WIDTH=BITS/32 }; uint32_t pn[WIDTH]; public: + base_uint() + { + for (int i = 0; i < WIDTH; i++) + pn[i] = 0; + } + + base_uint(const base_uint& b) + { + for (int i = 0; i < WIDTH; i++) + pn[i] = b.pn[i]; + } + + base_uint& operator=(const base_uint& b) + { + for (int i = 0; i < WIDTH; i++) + pn[i] = b.pn[i]; + return *this; + } + + base_uint(uint64_t b) + { + pn[0] = (unsigned int)b; + pn[1] = (unsigned int)(b >> 32); + for (int i = 2; i < WIDTH; i++) + pn[i] = 0; + } + + explicit base_uint(const std::string& str) + { + SetHex(str); + } + + explicit base_uint(const std::vector& vch) + { + if (vch.size() == sizeof(pn)) { + memcpy(pn, &vch[0], sizeof(pn)); + } else { + *this = 0; + } + } + bool operator!() const { for (int i = 0; i < WIDTH; i++) @@ -292,7 +331,13 @@ public: return (!(a == b)); } - + friend inline const base_uint operator+(const base_uint& a, const base_uint& b) { return base_uint(a) += b; } + friend inline const base_uint operator-(const base_uint& a, const base_uint& b) { return base_uint(a) -= b; } + friend inline const base_uint operator|(const base_uint& a, const base_uint& b) { return base_uint(a) |= b; } + friend inline const base_uint operator&(const base_uint& a, const base_uint& b) { return base_uint(a) &= b; } + friend inline const base_uint operator^(const base_uint& a, const base_uint& b) { return base_uint(a) ^= b; } + friend inline const base_uint operator>>(const base_uint& a, int shift) { return base_uint(a) >>= shift; } + friend inline const base_uint operator<<(const base_uint& a, int shift) { return base_uint(a) <<= shift; } std::string GetHex() const { @@ -373,263 +418,42 @@ public: return pn[0] | (uint64_t)pn[1] << 32; } -// unsigned int GetSerializeSize(int nType=0, int nVersion=PROTOCOL_VERSION) const unsigned int GetSerializeSize(int nType, int nVersion) const { return sizeof(pn); } template -// void Serialize(Stream& s, int nType=0, int nVersion=PROTOCOL_VERSION) const void Serialize(Stream& s, int nType, int nVersion) const { s.write((char*)pn, sizeof(pn)); } template -// void Unserialize(Stream& s, int nType=0, int nVersion=PROTOCOL_VERSION) void Unserialize(Stream& s, int nType, int nVersion) { s.read((char*)pn, sizeof(pn)); } - - - friend class uint160; - friend class uint256; }; -typedef base_uint<160> base_uint160; -typedef base_uint<256> base_uint256; - - - -// -// uint160 and uint256 could be implemented as templates, but to keep -// compile errors and debugging cleaner, they're copy and pasted. -// - - - -////////////////////////////////////////////////////////////////////////////// -// -// uint160 -// - -/** 160-bit unsigned integer */ -class uint160 : public base_uint160 -{ +/** 160-bit unsigned big integer. */ +class uint160 : public base_uint<160> { public: - typedef base_uint160 basetype; - - uint160() - { - for (int i = 0; i < WIDTH; i++) - pn[i] = 0; - } - - uint160(const basetype& b) - { - for (int i = 0; i < WIDTH; i++) - pn[i] = b.pn[i]; - } - - uint160& operator=(const basetype& b) - { - for (int i = 0; i < WIDTH; i++) - pn[i] = b.pn[i]; - return *this; - } - - uint160(uint64_t b) - { - pn[0] = (unsigned int)b; - pn[1] = (unsigned int)(b >> 32); - for (int i = 2; i < WIDTH; i++) - pn[i] = 0; - } - - uint160& operator=(uint64_t b) - { - pn[0] = (unsigned int)b; - pn[1] = (unsigned int)(b >> 32); - for (int i = 2; i < WIDTH; i++) - pn[i] = 0; - return *this; - } - - explicit uint160(const std::string& str) - { - SetHex(str); - } - - explicit uint160(const std::vector& vch) - { - if (vch.size() == sizeof(pn)) - memcpy(pn, &vch[0], sizeof(pn)); - else - *this = 0; - } + uint160() {} + uint160(const base_uint<160>& b) : base_uint<160>(b) {} + uint160(uint64_t b) : base_uint<160>(b) {} + explicit uint160(const std::string& str) : base_uint<160>(str) {} + explicit uint160(const std::vector& vch) : base_uint<160>(vch) {} }; -inline bool operator==(const uint160& a, uint64_t b) { return (base_uint160)a == b; } -inline bool operator!=(const uint160& a, uint64_t b) { return (base_uint160)a != b; } -inline const uint160 operator<<(const base_uint160& a, unsigned int shift) { return uint160(a) <<= shift; } -inline const uint160 operator>>(const base_uint160& a, unsigned int shift) { return uint160(a) >>= shift; } -inline const uint160 operator<<(const uint160& a, unsigned int shift) { return uint160(a) <<= shift; } -inline const uint160 operator>>(const uint160& a, unsigned int shift) { return uint160(a) >>= shift; } - -inline const uint160 operator^(const base_uint160& a, const base_uint160& b) { return uint160(a) ^= b; } -inline const uint160 operator&(const base_uint160& a, const base_uint160& b) { return uint160(a) &= b; } -inline const uint160 operator|(const base_uint160& a, const base_uint160& b) { return uint160(a) |= b; } -inline const uint160 operator+(const base_uint160& a, const base_uint160& b) { return uint160(a) += b; } -inline const uint160 operator-(const base_uint160& a, const base_uint160& b) { return uint160(a) -= b; } - -inline bool operator<(const base_uint160& a, const uint160& b) { return (base_uint160)a < (base_uint160)b; } -inline bool operator<=(const base_uint160& a, const uint160& b) { return (base_uint160)a <= (base_uint160)b; } -inline bool operator>(const base_uint160& a, const uint160& b) { return (base_uint160)a > (base_uint160)b; } -inline bool operator>=(const base_uint160& a, const uint160& b) { return (base_uint160)a >= (base_uint160)b; } -inline bool operator==(const base_uint160& a, const uint160& b) { return (base_uint160)a == (base_uint160)b; } -inline bool operator!=(const base_uint160& a, const uint160& b) { return (base_uint160)a != (base_uint160)b; } -inline const uint160 operator^(const base_uint160& a, const uint160& b) { return (base_uint160)a ^ (base_uint160)b; } -inline const uint160 operator&(const base_uint160& a, const uint160& b) { return (base_uint160)a & (base_uint160)b; } -inline const uint160 operator|(const base_uint160& a, const uint160& b) { return (base_uint160)a | (base_uint160)b; } -inline const uint160 operator+(const base_uint160& a, const uint160& b) { return (base_uint160)a + (base_uint160)b; } -inline const uint160 operator-(const base_uint160& a, const uint160& b) { return (base_uint160)a - (base_uint160)b; } - -inline bool operator<(const uint160& a, const base_uint160& b) { return (base_uint160)a < (base_uint160)b; } -inline bool operator<=(const uint160& a, const base_uint160& b) { return (base_uint160)a <= (base_uint160)b; } -inline bool operator>(const uint160& a, const base_uint160& b) { return (base_uint160)a > (base_uint160)b; } -inline bool operator>=(const uint160& a, const base_uint160& b) { return (base_uint160)a >= (base_uint160)b; } -inline bool operator==(const uint160& a, const base_uint160& b) { return (base_uint160)a == (base_uint160)b; } -inline bool operator!=(const uint160& a, const base_uint160& b) { return (base_uint160)a != (base_uint160)b; } -inline const uint160 operator^(const uint160& a, const base_uint160& b) { return (base_uint160)a ^ (base_uint160)b; } -inline const uint160 operator&(const uint160& a, const base_uint160& b) { return (base_uint160)a & (base_uint160)b; } -inline const uint160 operator|(const uint160& a, const base_uint160& b) { return (base_uint160)a | (base_uint160)b; } -inline const uint160 operator+(const uint160& a, const base_uint160& b) { return (base_uint160)a + (base_uint160)b; } -inline const uint160 operator-(const uint160& a, const base_uint160& b) { return (base_uint160)a - (base_uint160)b; } - -inline bool operator<(const uint160& a, const uint160& b) { return (base_uint160)a < (base_uint160)b; } -inline bool operator<=(const uint160& a, const uint160& b) { return (base_uint160)a <= (base_uint160)b; } -inline bool operator>(const uint160& a, const uint160& b) { return (base_uint160)a > (base_uint160)b; } -inline bool operator>=(const uint160& a, const uint160& b) { return (base_uint160)a >= (base_uint160)b; } -inline bool operator==(const uint160& a, const uint160& b) { return (base_uint160)a == (base_uint160)b; } -inline bool operator!=(const uint160& a, const uint160& b) { return (base_uint160)a != (base_uint160)b; } -inline const uint160 operator^(const uint160& a, const uint160& b) { return (base_uint160)a ^ (base_uint160)b; } -inline const uint160 operator&(const uint160& a, const uint160& b) { return (base_uint160)a & (base_uint160)b; } -inline const uint160 operator|(const uint160& a, const uint160& b) { return (base_uint160)a | (base_uint160)b; } -inline const uint160 operator+(const uint160& a, const uint160& b) { return (base_uint160)a + (base_uint160)b; } -inline const uint160 operator-(const uint160& a, const uint160& b) { return (base_uint160)a - (base_uint160)b; } - - - -////////////////////////////////////////////////////////////////////////////// -// -// uint256 -// - -/** 256-bit unsigned integer */ -class uint256 : public base_uint256 -{ +/** 256-bit unsigned big integer. */ +class uint256 : public base_uint<256> { public: - typedef base_uint256 basetype; - - uint256() - { - for (int i = 0; i < WIDTH; i++) - pn[i] = 0; - } - - uint256(const basetype& b) - { - for (int i = 0; i < WIDTH; i++) - pn[i] = b.pn[i]; - } - - uint256& operator=(const basetype& b) - { - for (int i = 0; i < WIDTH; i++) - pn[i] = b.pn[i]; - return *this; - } - - uint256(uint64_t b) - { - pn[0] = (unsigned int)b; - pn[1] = (unsigned int)(b >> 32); - for (int i = 2; i < WIDTH; i++) - pn[i] = 0; - } - - uint256& operator=(uint64_t b) - { - pn[0] = (unsigned int)b; - pn[1] = (unsigned int)(b >> 32); - for (int i = 2; i < WIDTH; i++) - pn[i] = 0; - return *this; - } - - explicit uint256(const std::string& str) - { - SetHex(str); - } - - explicit uint256(const std::vector& vch) - { - if (vch.size() == sizeof(pn)) - memcpy(pn, &vch[0], sizeof(pn)); - else - *this = 0; - } + uint256() {} + uint256(const base_uint<256>& b) : base_uint<256>(b) {} + uint256(uint64_t b) : base_uint<256>(b) {} + explicit uint256(const std::string& str) : base_uint<256>(str) {} + explicit uint256(const std::vector& vch) : base_uint<256>(vch) {} }; -inline bool operator==(const uint256& a, uint64_t b) { return (base_uint256)a == b; } -inline bool operator!=(const uint256& a, uint64_t b) { return (base_uint256)a != b; } -inline const uint256 operator<<(const base_uint256& a, unsigned int shift) { return uint256(a) <<= shift; } -inline const uint256 operator>>(const base_uint256& a, unsigned int shift) { return uint256(a) >>= shift; } -inline const uint256 operator<<(const uint256& a, unsigned int shift) { return uint256(a) <<= shift; } -inline const uint256 operator>>(const uint256& a, unsigned int shift) { return uint256(a) >>= shift; } - -inline const uint256 operator^(const base_uint256& a, const base_uint256& b) { return uint256(a) ^= b; } -inline const uint256 operator&(const base_uint256& a, const base_uint256& b) { return uint256(a) &= b; } -inline const uint256 operator|(const base_uint256& a, const base_uint256& b) { return uint256(a) |= b; } -inline const uint256 operator+(const base_uint256& a, const base_uint256& b) { return uint256(a) += b; } -inline const uint256 operator-(const base_uint256& a, const base_uint256& b) { return uint256(a) -= b; } - -inline bool operator<(const base_uint256& a, const uint256& b) { return (base_uint256)a < (base_uint256)b; } -inline bool operator<=(const base_uint256& a, const uint256& b) { return (base_uint256)a <= (base_uint256)b; } -inline bool operator>(const base_uint256& a, const uint256& b) { return (base_uint256)a > (base_uint256)b; } -inline bool operator>=(const base_uint256& a, const uint256& b) { return (base_uint256)a >= (base_uint256)b; } -inline bool operator==(const base_uint256& a, const uint256& b) { return (base_uint256)a == (base_uint256)b; } -inline bool operator!=(const base_uint256& a, const uint256& b) { return (base_uint256)a != (base_uint256)b; } -inline const uint256 operator^(const base_uint256& a, const uint256& b) { return (base_uint256)a ^ (base_uint256)b; } -inline const uint256 operator&(const base_uint256& a, const uint256& b) { return (base_uint256)a & (base_uint256)b; } -inline const uint256 operator|(const base_uint256& a, const uint256& b) { return (base_uint256)a | (base_uint256)b; } -inline const uint256 operator+(const base_uint256& a, const uint256& b) { return (base_uint256)a + (base_uint256)b; } -inline const uint256 operator-(const base_uint256& a, const uint256& b) { return (base_uint256)a - (base_uint256)b; } - -inline bool operator<(const uint256& a, const base_uint256& b) { return (base_uint256)a < (base_uint256)b; } -inline bool operator<=(const uint256& a, const base_uint256& b) { return (base_uint256)a <= (base_uint256)b; } -inline bool operator>(const uint256& a, const base_uint256& b) { return (base_uint256)a > (base_uint256)b; } -inline bool operator>=(const uint256& a, const base_uint256& b) { return (base_uint256)a >= (base_uint256)b; } -inline bool operator==(const uint256& a, const base_uint256& b) { return (base_uint256)a == (base_uint256)b; } -inline bool operator!=(const uint256& a, const base_uint256& b) { return (base_uint256)a != (base_uint256)b; } -inline const uint256 operator^(const uint256& a, const base_uint256& b) { return (base_uint256)a ^ (base_uint256)b; } -inline const uint256 operator&(const uint256& a, const base_uint256& b) { return (base_uint256)a & (base_uint256)b; } -inline const uint256 operator|(const uint256& a, const base_uint256& b) { return (base_uint256)a | (base_uint256)b; } -inline const uint256 operator+(const uint256& a, const base_uint256& b) { return (base_uint256)a + (base_uint256)b; } -inline const uint256 operator-(const uint256& a, const base_uint256& b) { return (base_uint256)a - (base_uint256)b; } - -inline bool operator<(const uint256& a, const uint256& b) { return (base_uint256)a < (base_uint256)b; } -inline bool operator<=(const uint256& a, const uint256& b) { return (base_uint256)a <= (base_uint256)b; } -inline bool operator>(const uint256& a, const uint256& b) { return (base_uint256)a > (base_uint256)b; } -inline bool operator>=(const uint256& a, const uint256& b) { return (base_uint256)a >= (base_uint256)b; } -inline bool operator==(const uint256& a, const uint256& b) { return (base_uint256)a == (base_uint256)b; } -inline bool operator!=(const uint256& a, const uint256& b) { return (base_uint256)a != (base_uint256)b; } -inline const uint256 operator^(const uint256& a, const uint256& b) { return (base_uint256)a ^ (base_uint256)b; } -inline const uint256 operator&(const uint256& a, const uint256& b) { return (base_uint256)a & (base_uint256)b; } -inline const uint256 operator|(const uint256& a, const uint256& b) { return (base_uint256)a | (base_uint256)b; } -inline const uint256 operator+(const uint256& a, const uint256& b) { return (base_uint256)a + (base_uint256)b; } -inline const uint256 operator-(const uint256& a, const uint256& b) { return (base_uint256)a - (base_uint256)b; } - #endif From 4d480c8a3fe3c58eeb083ea544c6f9e991606692 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 19 Apr 2014 23:25:44 +0200 Subject: [PATCH 0026/1288] Exception instead of assigning 0 in case of wrong vector length --- src/test/uint256_tests.cpp | 10 +++++----- src/uint256.h | 15 ++++++++++----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/test/uint256_tests.cpp b/src/test/uint256_tests.cpp index 815babf107..8e4b63c8bc 100644 --- a/src/test/uint256_tests.cpp +++ b/src/test/uint256_tests.cpp @@ -160,11 +160,11 @@ BOOST_AUTO_TEST_CASE( basics ) // constructors, equality, inequality tmpS = ~R2S; BOOST_CHECK(tmpS == ~R2S); tmpS = ~MaxS; BOOST_CHECK(tmpS == ~MaxS); - // Wrong length must give 0 - BOOST_CHECK(uint256(std::vector(OneArray,OneArray+31)) == 0); - BOOST_CHECK(uint256(std::vector(OneArray,OneArray+20)) == 0); - BOOST_CHECK(uint160(std::vector(OneArray,OneArray+32)) == 0); - BOOST_CHECK(uint160(std::vector(OneArray,OneArray+19)) == 0); + // Wrong length must throw exception. + BOOST_CHECK_THROW(uint256(std::vector(OneArray,OneArray+31)), uint_error); + BOOST_CHECK_THROW(uint256(std::vector(OneArray,OneArray+20)), uint_error); + BOOST_CHECK_THROW(uint160(std::vector(OneArray,OneArray+32)), uint_error); + BOOST_CHECK_THROW(uint160(std::vector(OneArray,OneArray+19)), uint_error); } void shiftArrayRight(unsigned char* to, const unsigned char* from, unsigned int arrayLength, unsigned int bitsToShift) diff --git a/src/uint256.h b/src/uint256.h index a3f7835875..b6365bb36b 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -6,6 +6,8 @@ #ifndef BITCOIN_UINT256_H #define BITCOIN_UINT256_H +#include +#include #include #include #include @@ -19,6 +21,11 @@ inline signed char HexDigit(char c) return p_util_hexdigit[(unsigned char)c]; } +class uint_error : public std::runtime_error { +public: + explicit uint_error(const std::string& str) : std::runtime_error(str) {} +}; + /** Template base class for unsigned big integers. */ template class base_uint @@ -62,11 +69,9 @@ public: explicit base_uint(const std::vector& vch) { - if (vch.size() == sizeof(pn)) { - memcpy(pn, &vch[0], sizeof(pn)); - } else { - *this = 0; - } + if (vch.size() != sizeof(pn)) + throw uint_error("Converting vector of wrong size to base_uint"); + memcpy(pn, &vch[0], sizeof(pn)); } bool operator!() const From a7031507e647da0723bf289dadba10ef1a50f278 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 20 Apr 2014 01:03:19 +0200 Subject: [PATCH 0027/1288] Add multiplication and division to uint160/uint256 --- src/test/uint256_tests.cpp | 71 ++++++++++++++++++++++++++++++++++++++ src/uint256.h | 70 +++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+) diff --git a/src/test/uint256_tests.cpp b/src/test/uint256_tests.cpp index 8e4b63c8bc..226d737def 100644 --- a/src/test/uint256_tests.cpp +++ b/src/test/uint256_tests.cpp @@ -482,6 +482,77 @@ BOOST_AUTO_TEST_CASE( plusMinus ) } +BOOST_AUTO_TEST_CASE( multiply ) +{ + BOOST_CHECK((R1L * R1L).ToString() == "62a38c0486f01e45879d7910a7761bf30d5237e9873f9bff3642a732c4d84f10"); + BOOST_CHECK((R1L * R2L).ToString() == "de37805e9986996cfba76ff6ba51c008df851987d9dd323f0e5de07760529c40"); + BOOST_CHECK((R1L * ZeroL) == ZeroL); + BOOST_CHECK((R1L * OneL) == R1L); + BOOST_CHECK((R1L * MaxL) == -R1L); + BOOST_CHECK((R2L * R1L) == (R1L * R2L)); + BOOST_CHECK((R2L * R2L).ToString() == "ac8c010096767d3cae5005dec28bb2b45a1d85ab7996ccd3e102a650f74ff100"); + BOOST_CHECK((R2L * ZeroL) == ZeroL); + BOOST_CHECK((R2L * OneL) == R2L); + BOOST_CHECK((R2L * MaxL) == -R2L); + + BOOST_CHECK((R1S * R1S).ToString() == "a7761bf30d5237e9873f9bff3642a732c4d84f10"); + BOOST_CHECK((R1S * R2S).ToString() == "ba51c008df851987d9dd323f0e5de07760529c40"); + BOOST_CHECK((R1S * ZeroS) == ZeroS); + BOOST_CHECK((R1S * OneS) == R1S); + BOOST_CHECK((R1S * MaxS) == -R1S); + BOOST_CHECK((R2S * R1S) == (R1S * R2S)); + BOOST_CHECK((R2S * R2S).ToString() == "c28bb2b45a1d85ab7996ccd3e102a650f74ff100"); + BOOST_CHECK((R2S * ZeroS) == ZeroS); + BOOST_CHECK((R2S * OneS) == R2S); + BOOST_CHECK((R2S * MaxS) == -R2S); + + BOOST_CHECK(MaxL * MaxL == OneL); + BOOST_CHECK(MaxS * MaxS == OneS); + + BOOST_CHECK((R1L * 0) == 0); + BOOST_CHECK((R1L * 1) == R1L); + BOOST_CHECK((R1L * 3).ToString() == "7759b1c0ed14047f961ad09b20ff83687876a0181a367b813634046f91def7d4"); + BOOST_CHECK((R2L * 0x87654321UL).ToString() == "23f7816e30c4ae2017257b7a0fa64d60402f5234d46e746b61c960d09a26d070"); + BOOST_CHECK((R1S * 0) == 0); + BOOST_CHECK((R1S * 1) == R1S); + BOOST_CHECK((R1S * 7).ToString() == "f7a987f3c3bf758d927f202d7e795faeff084244"); + BOOST_CHECK((R2S * 0xFFFFFFFFUL).ToString() == "1c6f6c930353e17f7d6127213bb18d2883e2cd90"); +} + +BOOST_AUTO_TEST_CASE( divide ) +{ + uint256 D1L("AD7133AC1977FA2B7"); + uint256 D2L("ECD751716"); + BOOST_CHECK((R1L / D1L).ToString() == "00000000000000000b8ac01106981635d9ed112290f8895545a7654dde28fb3a"); + BOOST_CHECK((R1L / D2L).ToString() == "000000000873ce8efec5b67150bad3aa8c5fcb70e947586153bf2cec7c37c57a"); + BOOST_CHECK(R1L / OneL == R1L); + BOOST_CHECK(R1L / MaxL == ZeroL); + BOOST_CHECK(MaxL / R1L == 2); + BOOST_CHECK_THROW(R1L / ZeroL, uint_error); + BOOST_CHECK((R2L / D1L).ToString() == "000000000000000013e1665895a1cc981de6d93670105a6b3ec3b73141b3a3c5"); + BOOST_CHECK((R2L / D2L).ToString() == "000000000e8f0abe753bb0afe2e9437ee85d280be60882cf0bd1aaf7fa3cc2c4"); + BOOST_CHECK(R2L / OneL == R2L); + BOOST_CHECK(R2L / MaxL == ZeroL); + BOOST_CHECK(MaxL / R2L == 1); + BOOST_CHECK_THROW(R2L / ZeroL, uint_error); + + uint160 D1S("D3C5EDCDEA54EB92679F0A4B4"); + uint160 D2S("13037"); + BOOST_CHECK((R1S / D1S).ToString() == "0000000000000000000000000db9af3beade6c02"); + BOOST_CHECK((R1S / D2S).ToString() == "000098dfb6cc40ca592bf74366794f298ada205c"); + BOOST_CHECK(R1S / OneS == R1S); + BOOST_CHECK(R1S / MaxS == ZeroS); + BOOST_CHECK(MaxS / R1S == 1); + BOOST_CHECK_THROW(R1S / ZeroS, uint_error); + BOOST_CHECK((R2S / D1S).ToString() == "0000000000000000000000000c5608e781182047"); + BOOST_CHECK((R2S / D2S).ToString() == "00008966751b7187c3c67c1fda5cea7db2c1c069"); + BOOST_CHECK(R2S / OneS == R2S); + BOOST_CHECK(R2S / MaxS == ZeroS); + BOOST_CHECK(MaxS / R2S == 1); + BOOST_CHECK_THROW(R2S / ZeroS, uint_error); +} + + bool almostEqual(double d1, double d2) { return fabs(d1-d2) <= 4*fabs(d1)*std::numeric_limits::epsilon(); diff --git a/src/uint256.h b/src/uint256.h index b6365bb36b..7b17694eb2 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -222,6 +222,57 @@ public: return *this; } + base_uint& operator*=(uint32_t b32) + { + uint64_t carry = 0; + for (int i = 0; i < WIDTH; i++) + { + uint64_t n = carry + (uint64_t)b32 * pn[i]; + pn[i] = n & 0xffffffff; + carry = n >> 32; + } + return *this; + } + + base_uint& operator*=(const base_uint& b) + { + base_uint a = *this; + *this = 0; + for (int j = 0; j < WIDTH; j++) { + uint64_t carry = 0; + for (int i = 0; i + j < WIDTH; i++) { + uint64_t n = carry + pn[i + j] + (uint64_t)a.pn[j] * b.pn[i]; + pn[i + j] = n & 0xffffffff; + carry = n >> 32; + } + } + return *this; + } + + base_uint& operator/=(const base_uint& b) + { + base_uint div = b; // make a copy, so we can shift. + base_uint num = *this; // make a copy, so we can subtract. + *this = 0; // the quotient. + int num_bits = num.bits(); + int div_bits = div.bits(); + if (div_bits == 0) + throw uint_error("Division by zero"); + if (div_bits > num_bits) // the result is certainly 0. + return *this; + int shift = num_bits - div_bits; + div <<= shift; // shift so that div and nun align. + while (shift >= 0) { + if (num >= div) { + num -= div; + pn[shift / 32] |= (1 << (shift & 31)); // set a bit of the result. + } + div >>= 1; // shift back. + shift--; + } + // num now contains the remainder of the division. + return *this; + } base_uint& operator++() { @@ -338,11 +389,14 @@ public: friend inline const base_uint operator+(const base_uint& a, const base_uint& b) { return base_uint(a) += b; } friend inline const base_uint operator-(const base_uint& a, const base_uint& b) { return base_uint(a) -= b; } + friend inline const base_uint operator*(const base_uint& a, const base_uint& b) { return base_uint(a) *= b; } + friend inline const base_uint operator/(const base_uint& a, const base_uint& b) { return base_uint(a) /= b; } friend inline const base_uint operator|(const base_uint& a, const base_uint& b) { return base_uint(a) |= b; } friend inline const base_uint operator&(const base_uint& a, const base_uint& b) { return base_uint(a) &= b; } friend inline const base_uint operator^(const base_uint& a, const base_uint& b) { return base_uint(a) ^= b; } friend inline const base_uint operator>>(const base_uint& a, int shift) { return base_uint(a) >>= shift; } friend inline const base_uint operator<<(const base_uint& a, int shift) { return base_uint(a) <<= shift; } + friend inline const base_uint operator*(const base_uint& a, uint32_t b) { return base_uint(a) *= b; } std::string GetHex() const { @@ -417,6 +471,22 @@ public: return sizeof(pn); } + // Returns the position of the highest bit set plus one, or zero if the + // value is zero. + unsigned int bits() const + { + for (int pos = WIDTH-1; pos >= 0; pos--) { + if (pn[pos]) { + for (int bits = 31; bits > 0; bits--) { + if (pn[pos] & 1<= 2); From df9eb5e14fa8072bc8a82b59e712c2ba36f13f4c Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 20 Apr 2014 03:19:20 +0200 Subject: [PATCH 0028/1288] Move {Get,Set}Compact from bignum to uint256 --- src/bignum.h | 65 ------------------- src/chainparams.cpp | 4 +- src/chainparams.h | 4 +- src/main.cpp | 43 +++++++------ src/main.h | 17 +++-- src/miner.cpp | 6 +- src/rpcmining.cpp | 4 +- src/test/DoS_tests.cpp | 4 +- src/test/bignum_tests.cpp | 88 ------------------------- src/test/uint256_tests.cpp | 129 +++++++++++++++++++++++++++++++++++++ src/txdb.cpp | 6 -- src/txdb.h | 2 - src/uint256.h | 70 ++++++++++++++++++++ 13 files changed, 243 insertions(+), 199 deletions(-) diff --git a/src/bignum.h b/src/bignum.h index 0259338b31..6b77462d83 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -269,71 +269,6 @@ public: return vch; } - // The "compact" format is a representation of a whole - // number N using an unsigned 32bit number similar to a - // floating point format. - // The most significant 8 bits are the unsigned exponent of base 256. - // This exponent can be thought of as "number of bytes of N". - // The lower 23 bits are the mantissa. - // Bit number 24 (0x800000) represents the sign of N. - // N = (-1^sign) * mantissa * 256^(exponent-3) - // - // Satoshi's original implementation used BN_bn2mpi() and BN_mpi2bn(). - // MPI uses the most significant bit of the first byte as sign. - // Thus 0x1234560000 is compact (0x05123456) - // and 0xc0de000000 is compact (0x0600c0de) - // (0x05c0de00) would be -0x40de000000 - // - // Bitcoin only uses this "compact" format for encoding difficulty - // targets, which are unsigned 256bit quantities. Thus, all the - // complexities of the sign bit and using base 256 are probably an - // implementation accident. - // - // This implementation directly uses shifts instead of going - // through an intermediate MPI representation. - CBigNum& SetCompact(unsigned int nCompact) - { - unsigned int nSize = nCompact >> 24; - bool fNegative =(nCompact & 0x00800000) != 0; - unsigned int nWord = nCompact & 0x007fffff; - if (nSize <= 3) - { - nWord >>= 8*(3-nSize); - BN_set_word(this, nWord); - } - else - { - BN_set_word(this, nWord); - BN_lshift(this, this, 8*(nSize-3)); - } - BN_set_negative(this, fNegative); - return *this; - } - - unsigned int GetCompact() const - { - unsigned int nSize = BN_num_bytes(this); - unsigned int nCompact = 0; - if (nSize <= 3) - nCompact = BN_get_word(this) << 8*(3-nSize); - else - { - CBigNum bn; - BN_rshift(&bn, this, 8*(nSize-3)); - nCompact = BN_get_word(&bn); - } - // The 0x00800000 bit denotes the sign. - // Thus, if it is already set, divide the mantissa by 256 and increase the exponent. - if (nCompact & 0x00800000) - { - nCompact >>= 8; - nSize++; - } - nCompact |= nSize << 24; - nCompact |= (BN_is_negative(this) ? 0x00800000 : 0); - return nCompact; - } - void SetHex(const std::string& str) { // skip 0x diff --git a/src/chainparams.cpp b/src/chainparams.cpp index eb56800b92..f5cf846a01 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -110,7 +110,7 @@ public: vAlertPubKey = ParseHex("04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284"); nDefaultPort = 8333; nRPCPort = 8332; - bnProofOfWorkLimit = CBigNum(~uint256(0) >> 32); + bnProofOfWorkLimit = ~uint256(0) >> 32; nSubsidyHalvingInterval = 210000; // Build the genesis block. Note that the output of the genesis coinbase cannot @@ -233,7 +233,7 @@ public: pchMessageStart[2] = 0xb5; pchMessageStart[3] = 0xda; nSubsidyHalvingInterval = 150; - bnProofOfWorkLimit = CBigNum(~uint256(0) >> 1); + bnProofOfWorkLimit = ~uint256(0) >> 1; genesis.nTime = 1296688602; genesis.nBits = 0x207fffff; genesis.nNonce = 2; diff --git a/src/chainparams.h b/src/chainparams.h index 542afeaf92..f3f24efd99 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -56,7 +56,7 @@ public: const MessageStartChars& MessageStart() const { return pchMessageStart; } const vector& AlertKey() const { return vAlertPubKey; } int GetDefaultPort() const { return nDefaultPort; } - const CBigNum& ProofOfWorkLimit() const { return bnProofOfWorkLimit; } + const uint256& ProofOfWorkLimit() const { return bnProofOfWorkLimit; } int SubsidyHalvingInterval() const { return nSubsidyHalvingInterval; } virtual const CBlock& GenesisBlock() const = 0; virtual bool RequireRPCPassword() const { return true; } @@ -75,7 +75,7 @@ protected: vector vAlertPubKey; int nDefaultPort; int nRPCPort; - CBigNum bnProofOfWorkLimit; + uint256 bnProofOfWorkLimit; int nSubsidyHalvingInterval; string strDataDir; vector vSeeds; diff --git a/src/main.cpp b/src/main.cpp index a0f4f40cb1..6a7bb9206c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1209,13 +1209,13 @@ static const int64_t nInterval = nTargetTimespan / nTargetSpacing; // unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime) { - const CBigNum &bnLimit = Params().ProofOfWorkLimit(); + const uint256 &bnLimit = Params().ProofOfWorkLimit(); // Testnet has min-difficulty blocks // after nTargetSpacing*2 time between blocks: if (TestNet() && nTime > nTargetSpacing*2) return bnLimit.GetCompact(); - CBigNum bnResult; + uint256 bnResult; bnResult.SetCompact(nBase); while (nTime > 0 && bnResult < bnLimit) { @@ -1274,8 +1274,10 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead nActualTimespan = nTargetTimespan*4; // Retarget - CBigNum bnNew; + uint256 bnNew; + uint256 bnOld; bnNew.SetCompact(pindexLast->nBits); + bnOld = bnNew; bnNew *= nActualTimespan; bnNew /= nTargetTimespan; @@ -1285,23 +1287,25 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead /// debug print LogPrintf("GetNextWorkRequired RETARGET\n"); LogPrintf("nTargetTimespan = %d nActualTimespan = %d\n", nTargetTimespan, nActualTimespan); - LogPrintf("Before: %08x %s\n", pindexLast->nBits, CBigNum().SetCompact(pindexLast->nBits).getuint256().ToString()); - LogPrintf("After: %08x %s\n", bnNew.GetCompact(), bnNew.getuint256().ToString()); + LogPrintf("Before: %08x %s\n", pindexLast->nBits, bnOld.ToString()); + LogPrintf("After: %08x %s\n", bnNew.GetCompact(), bnNew.ToString()); return bnNew.GetCompact(); } bool CheckProofOfWork(uint256 hash, unsigned int nBits) { - CBigNum bnTarget; - bnTarget.SetCompact(nBits); + bool fNegative; + bool fOverflow; + uint256 bnTarget; + bnTarget.SetCompact(nBits, &fNegative, &fOverflow); // Check range - if (bnTarget <= 0 || bnTarget > Params().ProofOfWorkLimit()) + if (fNegative || bnTarget == 0 || fOverflow || bnTarget > Params().ProofOfWorkLimit()) return error("CheckProofOfWork() : nBits below minimum work"); // Check proof of work matches claimed amount - if (hash > bnTarget.getuint256()) + if (hash > bnTarget) return error("CheckProofOfWork() : hash doesn't match nBits"); return true; @@ -1346,7 +1350,7 @@ void CheckForkWarningConditions() if (pindexBestForkTip && chainActive.Height() - pindexBestForkTip->nHeight >= 72) pindexBestForkTip = NULL; - if (pindexBestForkTip || (pindexBestInvalid && pindexBestInvalid->nChainWork > chainActive.Tip()->nChainWork + (chainActive.Tip()->GetBlockWork() * 6).getuint256())) + if (pindexBestForkTip || (pindexBestInvalid && pindexBestInvalid->nChainWork > chainActive.Tip()->nChainWork + (chainActive.Tip()->GetBlockWork() * 6))) { if (!fLargeWorkForkFound) { @@ -1402,7 +1406,7 @@ void CheckForkWarningConditionsOnNewFork(CBlockIndex* pindexNewForkTip) // We define it this way because it allows us to only store the highest fork tip (+ base) which meets // the 7-block condition and from this always have the most-likely-to-cause-warning fork if (pfork && (!pindexBestForkTip || (pindexBestForkTip && pindexNewForkTip->nHeight > pindexBestForkTip->nHeight)) && - pindexNewForkTip->nChainWork - pfork->nChainWork > (pfork->GetBlockWork() * 7).getuint256() && + pindexNewForkTip->nChainWork - pfork->nChainWork > (pfork->GetBlockWork() * 7) && chainActive.Height() - pindexNewForkTip->nHeight < 72) { pindexBestForkTip = pindexNewForkTip; @@ -1436,10 +1440,6 @@ void static InvalidChainFound(CBlockIndex* pindexNew) if (!pindexBestInvalid || pindexNew->nChainWork > pindexBestInvalid->nChainWork) { pindexBestInvalid = pindexNew; - // The current code doesn't actually read the BestInvalidWork entry in - // the block database anymore, as it is derived from the flags in block - // index entry. We only write it for backward compatibility. - pblocktree->WriteBestInvalidWork(CBigNum(pindexBestInvalid->nChainWork)); uiInterface.NotifyBlocksChanged(); } LogPrintf("InvalidChainFound: invalid block=%s height=%d log2_work=%.8g date=%s\n", @@ -2182,7 +2182,7 @@ CBlockIndex* AddToBlockIndex(CBlockHeader& block) pindexNew->pprev = (*miPrev).second; pindexNew->nHeight = pindexNew->pprev->nHeight + 1; } - pindexNew->nChainWork = (pindexNew->pprev ? pindexNew->pprev->nChainWork : 0) + pindexNew->GetBlockWork().getuint256(); + pindexNew->nChainWork = (pindexNew->pprev ? pindexNew->pprev->nChainWork : 0) + pindexNew->GetBlockWork(); pindexNew->RaiseValidity(BLOCK_VALID_TREE); return pindexNew; @@ -2359,11 +2359,12 @@ bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool f return state.DoS(100, error("CheckBlockHeader() : block with timestamp before last checkpoint"), REJECT_CHECKPOINT, "time-too-old"); } - CBigNum bnNewBlock; - bnNewBlock.SetCompact(block.nBits); - CBigNum bnRequired; + bool fOverflow = false; + uint256 bnNewBlock; + bnNewBlock.SetCompact(block.nBits, NULL, &fOverflow); + uint256 bnRequired; bnRequired.SetCompact(ComputeMinWork(pcheckpoint->nBits, deltaTime)); - if (bnNewBlock > bnRequired) + if (fOverflow || bnNewBlock > bnRequired) { return state.DoS(100, error("CheckBlockHeader() : block with too little proof-of-work"), REJECT_INVALID, "bad-diffbits"); @@ -2934,7 +2935,7 @@ bool static LoadBlockIndexDB() BOOST_FOREACH(const PAIRTYPE(int, CBlockIndex*)& item, vSortedByHeight) { CBlockIndex* pindex = item.second; - pindex->nChainWork = (pindex->pprev ? pindex->pprev->nChainWork : 0) + pindex->GetBlockWork().getuint256(); + pindex->nChainWork = (pindex->pprev ? pindex->pprev->nChainWork : 0) + pindex->GetBlockWork(); pindex->nChainTx = (pindex->pprev ? pindex->pprev->nChainTx : 0) + pindex->nTx; if (pindex->IsValid(BLOCK_VALID_TRANSACTIONS)) setBlockIndexValid.insert(pindex); diff --git a/src/main.h b/src/main.h index c69e0d2a3c..796a3031c9 100644 --- a/src/main.h +++ b/src/main.h @@ -10,7 +10,6 @@ #include "bitcoin-config.h" #endif -#include "bignum.h" #include "chainparams.h" #include "coins.h" #include "core.h" @@ -816,13 +815,19 @@ public: return (int64_t)nTime; } - CBigNum GetBlockWork() const + uint256 GetBlockWork() const { - CBigNum bnTarget; - bnTarget.SetCompact(nBits); - if (bnTarget <= 0) + uint256 bnTarget; + bool fNegative; + bool fOverflow; + bnTarget.SetCompact(nBits, &fNegative, &fOverflow); + if (fNegative || fOverflow || bnTarget == 0) return 0; - return (CBigNum(1)<<256) / (bnTarget+1); + // We need to compute 2**256 / (bnTarget+1), but we can't represent 2**256 + // as it's too large for a uint256. However, as 2**256 is at least as large + // as bnTarget+1, it is equal to ((2**256 - bnTarget - 1) / (bnTarget+1)) + 1, + // or ~bnTarget / (nTarget+1) + 1. + return (~bnTarget / (bnTarget + 1)) + 1; } bool CheckIndex() const diff --git a/src/miner.cpp b/src/miner.cpp index 01fc56601b..50be4fad40 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -466,7 +466,7 @@ CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey) bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey) { uint256 hash = pblock->GetHash(); - uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256(); + uint256 hashTarget = uint256().SetCompact(pblock->nBits); if (hash > hashTarget) return false; @@ -552,7 +552,7 @@ void static BitcoinMiner(CWallet *pwallet) // Search // int64_t nStart = GetTime(); - uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256(); + uint256 hashTarget = uint256().SetCompact(pblock->nBits); uint256 hashbuf[2]; uint256& hash = *alignup<16>(hashbuf); while (true) @@ -636,7 +636,7 @@ void static BitcoinMiner(CWallet *pwallet) { // Changing pblock->nTime can change work required on testnet: nBlockBits = ByteReverse(pblock->nBits); - hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256(); + hashTarget.SetCompact(pblock->nBits); } } } } diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 070cf1cb2a..cb903b585a 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -363,7 +363,7 @@ Value getwork(const Array& params, bool fHelp) char phash1[64]; FormatHashBuffers(pblock, pmidstate, pdata, phash1); - uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256(); + uint256 hashTarget = uint256().SetCompact(pblock->nBits); Object result; result.push_back(Pair("midstate", HexStr(BEGIN(pmidstate), END(pmidstate)))); // deprecated @@ -559,7 +559,7 @@ Value getblocktemplate(const Array& params, bool fHelp) Object aux; aux.push_back(Pair("flags", HexStr(COINBASE_FLAGS.begin(), COINBASE_FLAGS.end()))); - uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256(); + uint256 hashTarget = uint256().SetCompact(pblock->nBits); static Array aMutable; if (aMutable.empty()) diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index d86cc7a290..897fb87e46 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -106,9 +106,9 @@ static bool CheckNBits(unsigned int nbits1, int64_t time1, unsigned int nbits2, return CheckNBits(nbits2, time2, nbits1, time1); int64_t deltaTime = time2-time1; - CBigNum required; + uint256 required; required.SetCompact(ComputeMinWork(nbits1, deltaTime)); - CBigNum have; + uint256 have; have.SetCompact(nbits2); return (have <= required); } diff --git a/src/test/bignum_tests.cpp b/src/test/bignum_tests.cpp index d5ee8c9778..01967c7684 100644 --- a/src/test/bignum_tests.cpp +++ b/src/test/bignum_tests.cpp @@ -125,94 +125,6 @@ BOOST_AUTO_TEST_CASE(bignum_setint64) } -BOOST_AUTO_TEST_CASE(bignum_SetCompact) -{ - CBigNum num; - num.SetCompact(0); - BOOST_CHECK_EQUAL(num.GetHex(), "0"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0U); - - num.SetCompact(0x00123456); - BOOST_CHECK_EQUAL(num.GetHex(), "0"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0U); - - num.SetCompact(0x01003456); - BOOST_CHECK_EQUAL(num.GetHex(), "0"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0U); - - num.SetCompact(0x02000056); - BOOST_CHECK_EQUAL(num.GetHex(), "0"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0U); - - num.SetCompact(0x03000000); - BOOST_CHECK_EQUAL(num.GetHex(), "0"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0U); - - num.SetCompact(0x04000000); - BOOST_CHECK_EQUAL(num.GetHex(), "0"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0U); - - num.SetCompact(0x00923456); - BOOST_CHECK_EQUAL(num.GetHex(), "0"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0U); - - num.SetCompact(0x01803456); - BOOST_CHECK_EQUAL(num.GetHex(), "0"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0U); - - num.SetCompact(0x02800056); - BOOST_CHECK_EQUAL(num.GetHex(), "0"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0U); - - num.SetCompact(0x03800000); - BOOST_CHECK_EQUAL(num.GetHex(), "0"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0U); - - num.SetCompact(0x04800000); - BOOST_CHECK_EQUAL(num.GetHex(), "0"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0U); - - num.SetCompact(0x01123456); - BOOST_CHECK_EQUAL(num.GetHex(), "12"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0x01120000U); - - // Make sure that we don't generate compacts with the 0x00800000 bit set - num = 0x80; - BOOST_CHECK_EQUAL(num.GetCompact(), 0x02008000U); - - num.SetCompact(0x01fedcba); - BOOST_CHECK_EQUAL(num.GetHex(), "-7e"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0x01fe0000U); - - num.SetCompact(0x02123456); - BOOST_CHECK_EQUAL(num.GetHex(), "1234"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0x02123400U); - - num.SetCompact(0x03123456); - BOOST_CHECK_EQUAL(num.GetHex(), "123456"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0x03123456U); - - num.SetCompact(0x04123456); - BOOST_CHECK_EQUAL(num.GetHex(), "12345600"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0x04123456U); - - num.SetCompact(0x04923456); - BOOST_CHECK_EQUAL(num.GetHex(), "-12345600"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0x04923456U); - - num.SetCompact(0x05009234); - BOOST_CHECK_EQUAL(num.GetHex(), "92340000"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0x05009234U); - - num.SetCompact(0x20123456); - BOOST_CHECK_EQUAL(num.GetHex(), "1234560000000000000000000000000000000000000000000000000000000000"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0x20123456U); - - num.SetCompact(0xff123456); - BOOST_CHECK_EQUAL(num.GetHex(), "123456000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"); - BOOST_CHECK_EQUAL(num.GetCompact(), 0xff123456U); -} - BOOST_AUTO_TEST_CASE(bignum_SetHex) { std::string hexStr = "deecf97fd890808b9cc0f1b6a3e7a60b400f52710e6ad075b1340755bfa58cc9"; diff --git a/src/test/uint256_tests.cpp b/src/test/uint256_tests.cpp index 226d737def..4b1a2ae58f 100644 --- a/src/test/uint256_tests.cpp +++ b/src/test/uint256_tests.cpp @@ -675,6 +675,135 @@ BOOST_AUTO_TEST_CASE( methods ) // GetHex SetHex begin() end() size() GetLow64 G } } +BOOST_AUTO_TEST_CASE(bignum_SetCompact) +{ + uint256 num; + bool fNegative; + bool fOverflow; + num.SetCompact(0, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000"); + BOOST_CHECK_EQUAL(num.GetCompact(), 0U); + BOOST_CHECK_EQUAL(fNegative, false); + BOOST_CHECK_EQUAL(fOverflow, false); + + num.SetCompact(0x00123456, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000"); + BOOST_CHECK_EQUAL(num.GetCompact(), 0U); + BOOST_CHECK_EQUAL(fNegative, false); + BOOST_CHECK_EQUAL(fOverflow, false); + + num.SetCompact(0x01003456, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000"); + BOOST_CHECK_EQUAL(num.GetCompact(), 0U); + BOOST_CHECK_EQUAL(fNegative, false); + BOOST_CHECK_EQUAL(fOverflow, false); + + num.SetCompact(0x02000056, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000"); + BOOST_CHECK_EQUAL(num.GetCompact(), 0U); + BOOST_CHECK_EQUAL(fNegative, false); + BOOST_CHECK_EQUAL(fOverflow, false); + + num.SetCompact(0x03000000, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000"); + BOOST_CHECK_EQUAL(num.GetCompact(), 0U); + BOOST_CHECK_EQUAL(fNegative, false); + BOOST_CHECK_EQUAL(fOverflow, false); + + num.SetCompact(0x04000000, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000"); + BOOST_CHECK_EQUAL(num.GetCompact(), 0U); + BOOST_CHECK_EQUAL(fNegative, false); + BOOST_CHECK_EQUAL(fOverflow, false); + + num.SetCompact(0x00923456, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000"); + BOOST_CHECK_EQUAL(num.GetCompact(), 0U); + BOOST_CHECK_EQUAL(fNegative, false); + BOOST_CHECK_EQUAL(fOverflow, false); + + num.SetCompact(0x01803456, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000"); + BOOST_CHECK_EQUAL(num.GetCompact(), 0U); + BOOST_CHECK_EQUAL(fNegative, false); + BOOST_CHECK_EQUAL(fOverflow, false); + + num.SetCompact(0x02800056, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000"); + BOOST_CHECK_EQUAL(num.GetCompact(), 0U); + BOOST_CHECK_EQUAL(fNegative, false); + BOOST_CHECK_EQUAL(fOverflow, false); + + num.SetCompact(0x03800000, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000"); + BOOST_CHECK_EQUAL(num.GetCompact(), 0U); + BOOST_CHECK_EQUAL(fNegative, false); + BOOST_CHECK_EQUAL(fOverflow, false); + + num.SetCompact(0x04800000, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000"); + BOOST_CHECK_EQUAL(num.GetCompact(), 0U); + BOOST_CHECK_EQUAL(fNegative, false); + BOOST_CHECK_EQUAL(fOverflow, false); + + num.SetCompact(0x01123456, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000012"); + BOOST_CHECK_EQUAL(num.GetCompact(), 0x01120000U); + BOOST_CHECK_EQUAL(fNegative, false); + BOOST_CHECK_EQUAL(fOverflow, false); + + // Make sure that we don't generate compacts with the 0x00800000 bit set + num = 0x80; + BOOST_CHECK_EQUAL(num.GetCompact(), 0x02008000U); + + num.SetCompact(0x01fedcba, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "000000000000000000000000000000000000000000000000000000000000007e"); + BOOST_CHECK_EQUAL(num.GetCompact(true), 0x01fe0000U); + BOOST_CHECK_EQUAL(fNegative, true); + BOOST_CHECK_EQUAL(fOverflow, false); + + num.SetCompact(0x02123456, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000001234"); + BOOST_CHECK_EQUAL(num.GetCompact(), 0x02123400U); + BOOST_CHECK_EQUAL(fNegative, false); + BOOST_CHECK_EQUAL(fOverflow, false); + + num.SetCompact(0x03123456, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000123456"); + BOOST_CHECK_EQUAL(num.GetCompact(), 0x03123456U); + BOOST_CHECK_EQUAL(fNegative, false); + BOOST_CHECK_EQUAL(fOverflow, false); + + num.SetCompact(0x04123456, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000012345600"); + BOOST_CHECK_EQUAL(num.GetCompact(), 0x04123456U); + BOOST_CHECK_EQUAL(fNegative, false); + BOOST_CHECK_EQUAL(fOverflow, false); + + num.SetCompact(0x04923456, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000012345600"); + BOOST_CHECK_EQUAL(num.GetCompact(true), 0x04923456U); + BOOST_CHECK_EQUAL(fNegative, true); + BOOST_CHECK_EQUAL(fOverflow, false); + + num.SetCompact(0x05009234, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000092340000"); + BOOST_CHECK_EQUAL(num.GetCompact(), 0x05009234U); + BOOST_CHECK_EQUAL(fNegative, false); + BOOST_CHECK_EQUAL(fOverflow, false); + + num.SetCompact(0x20123456, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(num.GetHex(), "1234560000000000000000000000000000000000000000000000000000000000"); + BOOST_CHECK_EQUAL(num.GetCompact(), 0x20123456U); + BOOST_CHECK_EQUAL(fNegative, false); + BOOST_CHECK_EQUAL(fOverflow, false); + + num.SetCompact(0xff123456, &fNegative, &fOverflow); + BOOST_CHECK_EQUAL(fNegative, false); + BOOST_CHECK_EQUAL(fOverflow, true); +} + + BOOST_AUTO_TEST_CASE( getmaxcoverage ) // some more tests just to get 100% coverage { // ~R1L give a base_uint<256> diff --git a/src/txdb.cpp b/src/txdb.cpp index cb92922a35..4eab8525a5 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -73,12 +73,6 @@ bool CBlockTreeDB::WriteBlockIndex(const CDiskBlockIndex& blockindex) return Write(make_pair('b', blockindex.GetBlockHash()), blockindex); } -bool CBlockTreeDB::WriteBestInvalidWork(const CBigNum& bnBestInvalidWork) -{ - // Obsolete; only written for backward compatibility. - return Write('I', bnBestInvalidWork); -} - bool CBlockTreeDB::WriteBlockFileInfo(int nFile, const CBlockFileInfo &info) { return Write(make_pair('f', nFile), info); } diff --git a/src/txdb.h b/src/txdb.h index 5eb5731db3..7257b0dd21 100644 --- a/src/txdb.h +++ b/src/txdb.h @@ -14,7 +14,6 @@ #include #include -class CBigNum; class CCoins; class uint256; @@ -52,7 +51,6 @@ private: void operator=(const CBlockTreeDB&); public: bool WriteBlockIndex(const CDiskBlockIndex& blockindex); - bool WriteBestInvalidWork(const CBigNum& bnBestInvalidWork); bool ReadBlockFileInfo(int nFile, CBlockFileInfo &fileinfo); bool WriteBlockFileInfo(int nFile, const CBlockFileInfo &fileinfo); bool ReadLastBlockFile(int &nFile); diff --git a/src/uint256.h b/src/uint256.h index 7b17694eb2..10c6657c76 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -529,6 +529,76 @@ public: uint256(uint64_t b) : base_uint<256>(b) {} explicit uint256(const std::string& str) : base_uint<256>(str) {} explicit uint256(const std::vector& vch) : base_uint<256>(vch) {} + + // The "compact" format is a representation of a whole + // number N using an unsigned 32bit number similar to a + // floating point format. + // The most significant 8 bits are the unsigned exponent of base 256. + // This exponent can be thought of as "number of bytes of N". + // The lower 23 bits are the mantissa. + // Bit number 24 (0x800000) represents the sign of N. + // N = (-1^sign) * mantissa * 256^(exponent-3) + // + // Satoshi's original implementation used BN_bn2mpi() and BN_mpi2bn(). + // MPI uses the most significant bit of the first byte as sign. + // Thus 0x1234560000 is compact (0x05123456) + // and 0xc0de000000 is compact (0x0600c0de) + // (0x05c0de00) would be -0x40de000000 + // + // Bitcoin only uses this "compact" format for encoding difficulty + // targets, which are unsigned 256bit quantities. Thus, all the + // complexities of the sign bit and using base 256 are probably an + // implementation accident. + // + // This implementation directly uses shifts instead of going + // through an intermediate MPI representation. + uint256& SetCompact(uint32_t nCompact, bool *pfNegative = NULL, bool *pfOverflow = NULL) + { + int nSize = nCompact >> 24; + uint32_t nWord = nCompact & 0x007fffff; + if (nSize <= 3) + { + nWord >>= 8*(3-nSize); + *this = nWord; + } + else + { + *this = nWord; + *this <<= 8*(nSize-3); + } + if (pfNegative) + *pfNegative = nWord != 0 && (nCompact & 0x00800000) != 0; + if (pfOverflow) + *pfOverflow = nWord != 0 && ((nSize > 34) || + (nWord > 0xff && nSize > 33) || + (nWord > 0xffff && nSize > 32)); + return *this; + } + + uint32_t GetCompact(bool fNegative = false) const + { + int nSize = (bits() + 7) / 8; + uint32_t nCompact = 0; + if (nSize <= 3) + nCompact = GetLow64() << 8*(3-nSize); + else + { + uint256 bn = *this >> 8*(nSize-3); + nCompact = bn.GetLow64(); + } + // The 0x00800000 bit denotes the sign. + // Thus, if it is already set, divide the mantissa by 256 and increase the exponent. + if (nCompact & 0x00800000) + { + nCompact >>= 8; + nSize++; + } + assert((nCompact & ~0x007fffff) == 0); + assert(nSize < 256); + nCompact |= nSize << 24; + nCompact |= (fNegative && (nCompact & 0x007fffff) ? 0x00800000 : 0); + return nCompact; + } }; #endif From 397668ea63e148a92f68e9fae578595585616770 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 21 Apr 2014 08:28:43 +0200 Subject: [PATCH 0029/1288] Deduplicate uint* comparison operator logic --- src/uint256.h | 93 ++++++++++++--------------------------------------- 1 file changed, 22 insertions(+), 71 deletions(-) diff --git a/src/uint256.h b/src/uint256.h index 10c6657c76..1acedd14bf 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -308,85 +308,28 @@ public: return ret; } + int CompareTo(const base_uint& b) const { + for (int i = base_uint::WIDTH-1; i >= 0; i--) { + if (pn[i] < b.pn[i]) + return -1; + if (pn[i] > b.pn[i]) + return 1; + } + return 0; + } - friend inline bool operator<(const base_uint& a, const base_uint& b) - { - for (int i = base_uint::WIDTH-1; i >= 0; i--) - { - if (a.pn[i] < b.pn[i]) - return true; - else if (a.pn[i] > b.pn[i]) + bool EqualTo(uint64_t b) const { + for (int i = base_uint::WIDTH-1; i >= 2; i--) { + if (pn[i]) return false; } - return false; - } - - friend inline bool operator<=(const base_uint& a, const base_uint& b) - { - for (int i = base_uint::WIDTH-1; i >= 0; i--) - { - if (a.pn[i] < b.pn[i]) - return true; - else if (a.pn[i] > b.pn[i]) - return false; - } - return true; - } - - friend inline bool operator>(const base_uint& a, const base_uint& b) - { - for (int i = base_uint::WIDTH-1; i >= 0; i--) - { - if (a.pn[i] > b.pn[i]) - return true; - else if (a.pn[i] < b.pn[i]) - return false; - } - return false; - } - - friend inline bool operator>=(const base_uint& a, const base_uint& b) - { - for (int i = base_uint::WIDTH-1; i >= 0; i--) - { - if (a.pn[i] > b.pn[i]) - return true; - else if (a.pn[i] < b.pn[i]) - return false; - } - return true; - } - - friend inline bool operator==(const base_uint& a, const base_uint& b) - { - for (int i = 0; i < base_uint::WIDTH; i++) - if (a.pn[i] != b.pn[i]) - return false; - return true; - } - - friend inline bool operator==(const base_uint& a, uint64_t b) - { - if (a.pn[0] != (unsigned int)b) + if (pn[1] != (b >> 32)) return false; - if (a.pn[1] != (unsigned int)(b >> 32)) + if (pn[0] != (b & 0xfffffffful)) return false; - for (int i = 2; i < base_uint::WIDTH; i++) - if (a.pn[i] != 0) - return false; return true; } - friend inline bool operator!=(const base_uint& a, const base_uint& b) - { - return (!(a == b)); - } - - friend inline bool operator!=(const base_uint& a, uint64_t b) - { - return (!(a == b)); - } - friend inline const base_uint operator+(const base_uint& a, const base_uint& b) { return base_uint(a) += b; } friend inline const base_uint operator-(const base_uint& a, const base_uint& b) { return base_uint(a) -= b; } friend inline const base_uint operator*(const base_uint& a, const base_uint& b) { return base_uint(a) *= b; } @@ -397,6 +340,14 @@ public: friend inline const base_uint operator>>(const base_uint& a, int shift) { return base_uint(a) >>= shift; } friend inline const base_uint operator<<(const base_uint& a, int shift) { return base_uint(a) <<= shift; } friend inline const base_uint operator*(const base_uint& a, uint32_t b) { return base_uint(a) *= b; } + friend inline bool operator==(const base_uint& a, const base_uint& b) { return a.CompareTo(b) == 0; } + friend inline bool operator!=(const base_uint& a, const base_uint& b) { return a.CompareTo(b) != 0; } + friend inline bool operator>(const base_uint& a, const base_uint& b) { return a.CompareTo(b) > 0; } + friend inline bool operator<(const base_uint& a, const base_uint& b) { return a.CompareTo(b) < 0; } + friend inline bool operator>=(const base_uint& a, const base_uint& b) { return a.CompareTo(b) >= 0; } + friend inline bool operator<=(const base_uint& a, const base_uint& b) { return a.CompareTo(b) <= 0; } + friend inline bool operator==(const base_uint& a, uint64_t b) { return a.EqualTo(b); } + friend inline bool operator!=(const base_uint& a, uint64_t b) { return !a.EqualTo(b); } std::string GetHex() const { From 0d4ea1cf8a349cf59795ac68645afe70e98c6b3a Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sat, 3 May 2014 10:20:58 +0200 Subject: [PATCH 0030/1288] util: add parseint32 function with strict error reporting None of the current integer parsing functions in util check whether the result is valid and fits in the range of the type. This is required for less sloppy error reporting. --- src/test/util_tests.cpp | 22 ++++++++++++++++++++++ src/util.cpp | 14 ++++++++++++++ src/util.h | 7 +++++++ 3 files changed, 43 insertions(+) diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index b8f107f644..7e7c05a59d 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -342,4 +342,26 @@ BOOST_AUTO_TEST_CASE(gettime) BOOST_CHECK((GetTime() & ~0xFFFFFFFFLL) == 0); } +BOOST_AUTO_TEST_CASE(test_ParseInt32) +{ + int32_t n; + // Valid values + BOOST_CHECK(ParseInt32("1234", NULL)); + BOOST_CHECK(ParseInt32("0", &n) && n == 0); + BOOST_CHECK(ParseInt32("1234", &n) && n == 1234); + BOOST_CHECK(ParseInt32("01234", &n) && n == 1234); // no octal + BOOST_CHECK(ParseInt32("2147483647", &n) && n == 2147483647); + BOOST_CHECK(ParseInt32("-2147483648", &n) && n == -2147483648); + BOOST_CHECK(ParseInt32("-1234", &n) && n == -1234); + // Invalid values + BOOST_CHECK(!ParseInt32("1a", &n)); + BOOST_CHECK(!ParseInt32("aap", &n)); + BOOST_CHECK(!ParseInt32("0x1", &n)); // no hex + // Overflow and underflow + BOOST_CHECK(!ParseInt32("-2147483649", NULL)); + BOOST_CHECK(!ParseInt32("2147483648", NULL)); + BOOST_CHECK(!ParseInt32("-32482348723847471234", NULL)); + BOOST_CHECK(!ParseInt32("32482348723847471234", NULL)); +} + BOOST_AUTO_TEST_SUITE_END() diff --git a/src/util.cpp b/src/util.cpp index a919b4b854..36ac23b1d5 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1427,3 +1427,17 @@ void RenameThread(const char* name) #endif } +bool ParseInt32(const std::string& str, int32_t *out) +{ + char *endp = NULL; + errno = 0; // strtol will not set errno if valid + long int n = strtol(str.c_str(), &endp, 10); + if(out) *out = (int)n; + // Note that strtol returns a *long int*, so even if strtol doesn't report a over/underflow + // we still have to check that the returned value is within the range of an *int32_t*. On 64-bit + // platforms the size of these types may be different. + return endp && *endp == 0 && !errno && + n >= std::numeric_limits::min() && + n <= std::numeric_limits::max(); +} + diff --git a/src/util.h b/src/util.h index fbd841f7a8..fa1e664c92 100644 --- a/src/util.h +++ b/src/util.h @@ -256,6 +256,13 @@ inline int atoi(const std::string& str) return atoi(str.c_str()); } +/** + * Convert string to signed 32-bit integer with strict parse error feedback. + * @returns true if the entire string could be parsed as valid integer, + * false if not the entire string could be parsed or when overflow or underflow occured. + */ +bool ParseInt32(const std::string& str, int32_t *out); + inline int roundint(double d) { return (int)(d > 0 ? d + 0.5 : d - 0.5); From d8642752992799b0695cf97ada03c56d0526830c Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sat, 3 May 2014 10:25:58 +0200 Subject: [PATCH 0031/1288] Use new function parseint32 in SplitHostPort Use the new function parseint32 in SplitHostPort instead of calling strtol directly. --- src/netbase.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/netbase.cpp b/src/netbase.cpp index ec275f738c..4f7e3f6b78 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -47,12 +47,10 @@ void SplitHostPort(std::string in, int &portOut, std::string &hostOut) { bool fBracketed = fHaveColon && (in[0]=='[' && in[colon-1]==']'); // if there is a colon, and in[0]=='[', colon is not 0, so in[colon-1] is safe bool fMultiColon = fHaveColon && (in.find_last_of(':',colon-1) != in.npos); if (fHaveColon && (colon==0 || fBracketed || !fMultiColon)) { - char *endp = NULL; - int n = strtol(in.c_str() + colon + 1, &endp, 10); - if (endp && *endp == 0 && n >= 0) { + int32_t n; + if (ParseInt32(in.substr(colon + 1), &n) && n > 0 && n < 0x10000) { in = in.substr(0, colon); - if (n > 0 && n < 0x10000) - portOut = n; + portOut = n; } } if (in.size()>0 && in[0] == '[' && in[in.size()-1] == ']') From e16be73753d870c5ce77094d3a402bbe8e3bf542 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 28 Apr 2014 11:08:57 +0200 Subject: [PATCH 0032/1288] net: Add CSubNet class for subnet matching --- src/netbase.cpp | 123 ++++++++++++++++++++++++++++++++++++- src/netbase.h | 30 +++++++++ src/test/netbase_tests.cpp | 37 +++++++++++ 3 files changed, 187 insertions(+), 3 deletions(-) diff --git a/src/netbase.cpp b/src/netbase.cpp index 4f7e3f6b78..82a681281d 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -546,6 +546,22 @@ void CNetAddr::SetIP(const CNetAddr& ipIn) memcpy(ip, ipIn.ip, sizeof(ip)); } +void CNetAddr::SetRaw(Network network, const uint8_t *ip_in) +{ + switch(network) + { + case NET_IPV4: + memcpy(ip, pchIPv4, 12); + memcpy(ip+12, ip_in, 4); + break; + case NET_IPV6: + memcpy(ip, ip_in, 16); + break; + default: + assert(!"invalid network"); + } +} + static const unsigned char pchOnionCat[] = {0xFD,0x87,0xD8,0x7E,0xEB,0x43}; bool CNetAddr::SetSpecial(const std::string &strName) @@ -569,13 +585,12 @@ CNetAddr::CNetAddr() CNetAddr::CNetAddr(const struct in_addr& ipv4Addr) { - memcpy(ip, pchIPv4, 12); - memcpy(ip+12, &ipv4Addr, 4); + SetRaw(NET_IPV4, (const uint8_t*)&ipv4Addr); } CNetAddr::CNetAddr(const struct in6_addr& ipv6Addr) { - memcpy(ip, &ipv6Addr, 16); + SetRaw(NET_IPV6, (const uint8_t*)&ipv6Addr); } CNetAddr::CNetAddr(const char *pszIp, bool fAllowLookup) @@ -1120,3 +1135,105 @@ void CService::SetPort(unsigned short portIn) { port = portIn; } + +CSubNet::CSubNet(): + valid(false) +{ + memset(netmask, 0, sizeof(netmask)); +} + +CSubNet::CSubNet(const std::string &strSubnet, bool fAllowLookup) +{ + size_t slash = strSubnet.find_last_of('/'); + std::vector vIP; + + valid = true; + // Default to /32 (IPv4) or /128 (IPv6), i.e. match single address + memset(netmask, 255, sizeof(netmask)); + + std::string strAddress = strSubnet.substr(0, slash); + if (LookupHost(strAddress.c_str(), vIP, 1, fAllowLookup)) + { + network = vIP[0]; + if (slash != strSubnet.npos) + { + std::string strNetmask = strSubnet.substr(slash + 1); + int32_t n; + // IPv4 addresses start at offset 12, and first 12 bytes must match, so just offset n + int noffset = network.IsIPv4() ? (12 * 8) : 0; + if (ParseInt32(strNetmask, &n)) // If valid number, assume /24 symtex + { + if(n >= 0 && n <= (128 - noffset)) // Only valid if in range of bits of address + { + n += noffset; + // Clear bits [n..127] + for (; n < 128; ++n) + netmask[n>>3] &= ~(1<<(n&7)); + } + else + { + valid = false; + } + } + else // If not a valid number, try full netmask syntax + { + if (LookupHost(strNetmask.c_str(), vIP, 1, false)) // Never allow lookup for netmask + { + // Remember: GetByte returns bytes in reversed order + // Copy only the *last* four bytes in case of IPv4, the rest of the mask should stay 1's as + // we don't want pchIPv4 to be part of the mask. + int asize = network.IsIPv4() ? 4 : 16; + for(int x=0; x Date: Mon, 28 Apr 2014 13:48:26 +0200 Subject: [PATCH 0033/1288] rpc: Use netmasks instead of wildcards for IP address matching `-rpcallowip` currently has a wacky wildcard-based format. After this commit it will accept the more standard format, for example: - Ranges with netmask 127.0.0.0/255.255.255.0, ::/0 - Ranges with cidr 12.3.4.5/24, 12:34:56:78:9a:bc:de:00/112 - Loose IPs ::1, 127.0.0.1 Trying to use the old *?-based format will result in an error message at launch. --- src/rpcserver.cpp | 59 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index f78cb420f4..5740cca13a 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -38,6 +38,7 @@ static map > deadlineTimers; static ssl::context* rpc_ssl_context = NULL; static boost::thread_group* rpc_worker_group = NULL; static boost::asio::io_service::work *rpc_dummy_work = NULL; +static std::vector rpc_allow_subnets; //!< List of subnets to allow RPC connections from void RPCTypeCheck(const Array& params, const list& typesExpected, @@ -358,25 +359,34 @@ void ErrorReply(std::ostream& stream, const Object& objError, const Value& id) stream << HTTPReply(nStatus, strReply, false) << std::flush; } -bool ClientAllowed(const boost::asio::ip::address& address) +// Convert boost::asio address to CNetAddr +static CNetAddr BoostAsioToCNetAddr(boost::asio::ip::address address) { + CNetAddr netaddr; // Make sure that IPv4-compatible and IPv4-mapped IPv6 addresses are treated as IPv4 addresses if (address.is_v6() && (address.to_v6().is_v4_compatible() || address.to_v6().is_v4_mapped())) - return ClientAllowed(address.to_v6().to_v4()); + address = address.to_v6().to_v4(); - if (address == asio::ip::address_v4::loopback() - || address == asio::ip::address_v6::loopback() - || (address.is_v4() - // Check whether IPv4 addresses match 127.0.0.0/8 (loopback subnet) - && (address.to_v4().to_ulong() & 0xff000000) == 0x7f000000)) - return true; + if(address.is_v4()) + { + boost::asio::ip::address_v4::bytes_type bytes = address.to_v4().to_bytes(); + netaddr.SetRaw(NET_IPV4, &bytes[0]); + } + else + { + boost::asio::ip::address_v6::bytes_type bytes = address.to_v6().to_bytes(); + netaddr.SetRaw(NET_IPV6, &bytes[0]); + } + return netaddr; +} - const string strAddress = address.to_string(); - const vector& vAllow = mapMultiArgs["-rpcallowip"]; - BOOST_FOREACH(string strAllow, vAllow) - if (WildcardMatch(strAddress, strAllow)) +bool ClientAllowed(const boost::asio::ip::address& address) +{ + CNetAddr netaddr = BoostAsioToCNetAddr(address); + BOOST_FOREACH(const CSubNet &subnet, rpc_allow_subnets) + if (subnet.Match(netaddr)) return true; return false; } @@ -502,6 +512,31 @@ static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor& vAllow = mapMultiArgs["-rpcallowip"]; + BOOST_FOREACH(string strAllow, vAllow) + { + CSubNet subnet(strAllow); + if(!subnet.IsValid()) + { + uiInterface.ThreadSafeMessageBox( + strprintf("Invalid -rpcallowip subnet specification: %s", strAllow), + "", CClientUIInterface::MSG_ERROR); + StartShutdown(); + return; + } + rpc_allow_subnets.push_back(subnet); + } + } + std::string strAllowed; + BOOST_FOREACH(const CSubNet &subnet, rpc_allow_subnets) + strAllowed += subnet.ToString() + " "; + LogPrint("rpc", "Allowing RPC connections from: %s\n", strAllowed); + strRPCUserColonPass = mapArgs["-rpcuser"] + ":" + mapArgs["-rpcpassword"]; if (((mapArgs["-rpcpassword"] == "") || (mapArgs["-rpcuser"] == mapArgs["-rpcpassword"])) && Params().RequireRPCPassword()) From fdbd7075cab8d54f90c038e68afba868a9ff9f63 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 28 Apr 2014 13:48:57 +0200 Subject: [PATCH 0034/1288] Remove unused function WildcardMatch No longer necessary after implementing netmask-based matching. Also remove a longer-unused function `skipspaces`. --- src/test/util_tests.cpp | 11 ----------- src/util.cpp | 37 ------------------------------------- src/util.h | 9 --------- 3 files changed, 57 deletions(-) diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 7e7c05a59d..f4ca8c0539 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -165,17 +165,6 @@ BOOST_AUTO_TEST_CASE(util_GetArg) BOOST_CHECK_EQUAL(GetBoolArg("booltest4", false), true); } -BOOST_AUTO_TEST_CASE(util_WildcardMatch) -{ - BOOST_CHECK(WildcardMatch("127.0.0.1", "*")); - BOOST_CHECK(WildcardMatch("127.0.0.1", "127.*")); - BOOST_CHECK(WildcardMatch("abcdef", "a?cde?")); - BOOST_CHECK(!WildcardMatch("abcdef", "a?cde??")); - BOOST_CHECK(WildcardMatch("abcdef", "a*f")); - BOOST_CHECK(!WildcardMatch("abcdef", "a*x")); - BOOST_CHECK(WildcardMatch("", "*")); -} - BOOST_AUTO_TEST_CASE(util_FormatMoney) { BOOST_CHECK_EQUAL(FormatMoney(0, false), "0.00"); diff --git a/src/util.cpp b/src/util.cpp index 36ac23b1d5..00e29446d5 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -889,43 +889,6 @@ string DecodeBase32(const string& str) return string((const char*)&vchRet[0], vchRet.size()); } - -bool WildcardMatch(const char* psz, const char* mask) -{ - while (true) - { - switch (*mask) - { - case '\0': - return (*psz == '\0'); - case '*': - return WildcardMatch(psz, mask+1) || (*psz && WildcardMatch(psz+1, mask)); - case '?': - if (*psz == '\0') - return false; - break; - default: - if (*psz != *mask) - return false; - break; - } - psz++; - mask++; - } -} - -bool WildcardMatch(const string& str, const string& mask) -{ - return WildcardMatch(str.c_str(), mask.c_str()); -} - - - - - - - - static std::string FormatException(std::exception* pex, const char* pszThread) { #ifdef WIN32 diff --git a/src/util.h b/src/util.h index fa1e664c92..011a40e540 100644 --- a/src/util.h +++ b/src/util.h @@ -182,8 +182,6 @@ std::string DecodeBase32(const std::string& str); std::string EncodeBase32(const unsigned char* pch, size_t len); std::string EncodeBase32(const std::string& str); void ParseParameters(int argc, const char*const argv[]); -bool WildcardMatch(const char* psz, const char* mask); -bool WildcardMatch(const std::string& str, const std::string& mask); void FileCommit(FILE *fileout); bool TruncateFile(FILE *file, unsigned int length); int RaiseFileDescriptorLimit(int nMinFD); @@ -348,13 +346,6 @@ inline std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime) return pszTime; } -template -void skipspaces(T& it) -{ - while (isspace(*it)) - ++it; -} - inline bool IsSwitchChar(char c) { #ifdef WIN32 From 21bf3d257b88c45e2bb0b47e36e73d7462760c2c Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 28 Apr 2014 15:23:29 +0200 Subject: [PATCH 0035/1288] Add tests for BoostAsioToCNetAddr --- src/rpcserver.cpp | 3 +-- src/rpcserver.h | 4 ++++ src/test/rpc_tests.cpp | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 5740cca13a..ac40ea7cf1 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -359,8 +359,7 @@ void ErrorReply(std::ostream& stream, const Object& objError, const Value& id) stream << HTTPReply(nStatus, strReply, false) << std::flush; } -// Convert boost::asio address to CNetAddr -static CNetAddr BoostAsioToCNetAddr(boost::asio::ip::address address) +CNetAddr BoostAsioToCNetAddr(boost::asio::ip::address address) { CNetAddr netaddr; // Make sure that IPv4-compatible and IPv4-mapped IPv6 addresses are treated as IPv4 addresses diff --git a/src/rpcserver.h b/src/rpcserver.h index 1092c691be..e8cd2cd0fc 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -19,6 +19,7 @@ #include "json/json_spirit_writer_template.h" class CBlockIndex; +class CNetAddr; /* Start RPC threads */ void StartRPCThreads(); @@ -50,6 +51,9 @@ void RPCTypeCheck(const json_spirit::Object& o, */ void RPCRunLater(const std::string& name, boost::function func, int64_t nSeconds); +//! Convert boost::asio address to CNetAddr +extern CNetAddr BoostAsioToCNetAddr(boost::asio::ip::address address); + typedef json_spirit::Value(*rpcfn_type)(const json_spirit::Array& params, bool fHelp); class CRPCCommand diff --git a/src/test/rpc_tests.cpp b/src/test/rpc_tests.cpp index 5bc38ce2de..107c0f06e7 100644 --- a/src/test/rpc_tests.cpp +++ b/src/test/rpc_tests.cpp @@ -6,6 +6,7 @@ #include "rpcclient.h" #include "base58.h" +#include "netbase.h" #include #include @@ -138,4 +139,19 @@ BOOST_AUTO_TEST_CASE(rpc_parse_monetary_values) BOOST_CHECK(AmountFromValue(ValueFromString("20999999.99999999")) == 2099999999999999LL); } +BOOST_AUTO_TEST_CASE(rpc_boostasiotocnetaddr) +{ + // Check IPv4 addresses + BOOST_CHECK_EQUAL(BoostAsioToCNetAddr(boost::asio::ip::address::from_string("1.2.3.4")).ToString(), "1.2.3.4"); + BOOST_CHECK_EQUAL(BoostAsioToCNetAddr(boost::asio::ip::address::from_string("127.0.0.1")).ToString(), "127.0.0.1"); + // Check IPv6 addresses + BOOST_CHECK_EQUAL(BoostAsioToCNetAddr(boost::asio::ip::address::from_string("::1")).ToString(), "::1"); + BOOST_CHECK_EQUAL(BoostAsioToCNetAddr(boost::asio::ip::address::from_string("123:4567:89ab:cdef:123:4567:89ab:cdef")).ToString(), + "123:4567:89ab:cdef:123:4567:89ab:cdef"); + // v4 compatible must be interpreted as IPv4 + BOOST_CHECK_EQUAL(BoostAsioToCNetAddr(boost::asio::ip::address::from_string("::0:127.0.0.1")).ToString(), "127.0.0.1"); + // v4 mapped must be interpreted as IPv4 + BOOST_CHECK_EQUAL(BoostAsioToCNetAddr(boost::asio::ip::address::from_string("::ffff:127.0.0.1")).ToString(), "127.0.0.1"); +} + BOOST_AUTO_TEST_SUITE_END() From ccc84e0963dab2ee6276ccc9766c2c19b0ebb3e3 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 9 May 2014 17:38:44 +0200 Subject: [PATCH 0036/1288] Reduce bignum.h now it is only needed for scriptnum_tests --- src/bignum.h | 355 +------------------------------------- src/chainparams.h | 1 - src/protocol.h | 1 + src/test/DoS_tests.cpp | 1 - src/test/Makefile.am | 1 - src/test/bignum_tests.cpp | 136 --------------- 6 files changed, 3 insertions(+), 492 deletions(-) delete mode 100644 src/test/bignum_tests.cpp diff --git a/src/bignum.h b/src/bignum.h index 6b77462d83..b57800f372 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -6,17 +6,14 @@ #ifndef BITCOIN_BIGNUM_H #define BITCOIN_BIGNUM_H -#include "serialize.h" -#include "uint256.h" -#include "version.h" - +#include +#include #include #include #include #include -/** Errors thrown by the bignum class */ class bignum_error : public std::runtime_error { public: @@ -24,34 +21,6 @@ public: }; -/** RAII encapsulated BN_CTX (OpenSSL bignum context) */ -class CAutoBN_CTX -{ -protected: - BN_CTX* pctx; - BN_CTX* operator=(BN_CTX* pnew) { return pctx = pnew; } - -public: - CAutoBN_CTX() - { - pctx = BN_CTX_new(); - if (pctx == NULL) - throw bignum_error("CAutoBN_CTX : BN_CTX_new() returned NULL"); - } - - ~CAutoBN_CTX() - { - if (pctx != NULL) - BN_CTX_free(pctx); - } - - operator BN_CTX*() { return pctx; } - BN_CTX& operator*() { return *pctx; } - BN_CTX** operator&() { return &pctx; } - bool operator!() { return (pctx == NULL); } -}; - - /** C++ wrapper for BIGNUM (OpenSSL bignum) */ class CBigNum : public BIGNUM { @@ -83,18 +52,7 @@ public: BN_clear_free(this); } - //CBigNum(char n) is not portable. Use 'signed char' or 'unsigned char'. - CBigNum(signed char n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } - CBigNum(short n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } - CBigNum(int n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } - CBigNum(long n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } CBigNum(long long n) { BN_init(this); setint64(n); } - CBigNum(unsigned char n) { BN_init(this); setulong(n); } - CBigNum(unsigned short n) { BN_init(this); setulong(n); } - CBigNum(unsigned int n) { BN_init(this); setulong(n); } - CBigNum(unsigned long n) { BN_init(this); setulong(n); } - CBigNum(unsigned long long n) { BN_init(this); setuint64(n); } - explicit CBigNum(uint256 n) { BN_init(this); setuint256(n); } explicit CBigNum(const std::vector& vch) { @@ -102,22 +60,6 @@ public: setvch(vch); } - void setulong(unsigned long n) - { - if (!BN_set_word(this, n)) - throw bignum_error("CBigNum conversion from unsigned long : BN_set_word failed"); - } - - unsigned long getulong() const - { - return BN_get_word(this); - } - - unsigned int getuint() const - { - return BN_get_word(this); - } - int getint() const { unsigned long n = BN_get_word(this); @@ -172,76 +114,6 @@ public: BN_mpi2bn(pch, p - pch, this); } - void setuint64(uint64_t n) - { - unsigned char pch[sizeof(n) + 6]; - unsigned char* p = pch + 4; - bool fLeadingZeroes = true; - for (int i = 0; i < 8; i++) - { - unsigned char c = (n >> 56) & 0xff; - n <<= 8; - if (fLeadingZeroes) - { - if (c == 0) - continue; - if (c & 0x80) - *p++ = 0; - fLeadingZeroes = false; - } - *p++ = c; - } - unsigned int nSize = p - (pch + 4); - pch[0] = (nSize >> 24) & 0xff; - pch[1] = (nSize >> 16) & 0xff; - pch[2] = (nSize >> 8) & 0xff; - pch[3] = (nSize) & 0xff; - BN_mpi2bn(pch, p - pch, this); - } - - void setuint256(uint256 n) - { - unsigned char pch[sizeof(n) + 6]; - unsigned char* p = pch + 4; - bool fLeadingZeroes = true; - unsigned char* pbegin = (unsigned char*)&n; - unsigned char* psrc = pbegin + sizeof(n); - while (psrc != pbegin) - { - unsigned char c = *(--psrc); - if (fLeadingZeroes) - { - if (c == 0) - continue; - if (c & 0x80) - *p++ = 0; - fLeadingZeroes = false; - } - *p++ = c; - } - unsigned int nSize = p - (pch + 4); - pch[0] = (nSize >> 24) & 0xff; - pch[1] = (nSize >> 16) & 0xff; - pch[2] = (nSize >> 8) & 0xff; - pch[3] = (nSize >> 0) & 0xff; - BN_mpi2bn(pch, p - pch, this); - } - - uint256 getuint256() const - { - unsigned int nSize = BN_bn2mpi(this, NULL); - if (nSize < 4) - return 0; - std::vector vch(nSize); - BN_bn2mpi(this, &vch[0]); - if (vch.size() > 4) - vch[4] &= 0x7f; - uint256 n = 0; - for (unsigned int i = 0, j = vch.size()-1; i < sizeof(n) && j >= 4; i++, j--) - ((unsigned char*)&n)[i] = vch[j]; - return n; - } - void setvch(const std::vector& vch) { std::vector vch2(vch.size() + 4); @@ -269,188 +141,7 @@ public: return vch; } - void SetHex(const std::string& str) - { - // skip 0x - const char* psz = str.c_str(); - while (isspace(*psz)) - psz++; - bool fNegative = false; - if (*psz == '-') - { - fNegative = true; - psz++; - } - if (psz[0] == '0' && tolower(psz[1]) == 'x') - psz += 2; - while (isspace(*psz)) - psz++; - - // hex string to bignum - *this = 0; - int n; - while ((n = HexDigit(*psz)) != -1) - { - *this <<= 4; - *this += n; - ++psz; - } - if (fNegative) - *this = 0 - *this; - } - - std::string ToString(int nBase=10) const - { - CAutoBN_CTX pctx; - CBigNum bnBase = nBase; - CBigNum bn0 = 0; - std::string str; - CBigNum bn = *this; - BN_set_negative(&bn, false); - CBigNum dv; - CBigNum rem; - if (BN_cmp(&bn, &bn0) == 0) - return "0"; - while (BN_cmp(&bn, &bn0) > 0) - { - if (!BN_div(&dv, &rem, &bn, &bnBase, pctx)) - throw bignum_error("CBigNum::ToString() : BN_div failed"); - bn = dv; - unsigned int c = rem.getulong(); - str += "0123456789abcdef"[c]; - } - if (BN_is_negative(this)) - str += "-"; - reverse(str.begin(), str.end()); - return str; - } - - std::string GetHex() const - { - return ToString(16); - } - - unsigned int GetSerializeSize(int nType=0, int nVersion=PROTOCOL_VERSION) const - { - return ::GetSerializeSize(getvch(), nType, nVersion); - } - - template - void Serialize(Stream& s, int nType=0, int nVersion=PROTOCOL_VERSION) const - { - ::Serialize(s, getvch(), nType, nVersion); - } - - template - void Unserialize(Stream& s, int nType=0, int nVersion=PROTOCOL_VERSION) - { - std::vector vch; - ::Unserialize(s, vch, nType, nVersion); - setvch(vch); - } - - - bool operator!() const - { - return BN_is_zero(this); - } - - CBigNum& operator+=(const CBigNum& b) - { - if (!BN_add(this, this, &b)) - throw bignum_error("CBigNum::operator+= : BN_add failed"); - return *this; - } - - CBigNum& operator-=(const CBigNum& b) - { - *this = *this - b; - return *this; - } - - CBigNum& operator*=(const CBigNum& b) - { - CAutoBN_CTX pctx; - if (!BN_mul(this, this, &b, pctx)) - throw bignum_error("CBigNum::operator*= : BN_mul failed"); - return *this; - } - - CBigNum& operator/=(const CBigNum& b) - { - *this = *this / b; - return *this; - } - - CBigNum& operator%=(const CBigNum& b) - { - *this = *this % b; - return *this; - } - - CBigNum& operator<<=(unsigned int shift) - { - if (!BN_lshift(this, this, shift)) - throw bignum_error("CBigNum:operator<<= : BN_lshift failed"); - return *this; - } - - CBigNum& operator>>=(unsigned int shift) - { - // Note: BN_rshift segfaults on 64-bit if 2^shift is greater than the number - // if built on ubuntu 9.04 or 9.10, probably depends on version of OpenSSL - CBigNum a = 1; - a <<= shift; - if (BN_cmp(&a, this) > 0) - { - *this = 0; - return *this; - } - - if (!BN_rshift(this, this, shift)) - throw bignum_error("CBigNum:operator>>= : BN_rshift failed"); - return *this; - } - - - CBigNum& operator++() - { - // prefix operator - if (!BN_add(this, this, BN_value_one())) - throw bignum_error("CBigNum::operator++ : BN_add failed"); - return *this; - } - - const CBigNum operator++(int) - { - // postfix operator - const CBigNum ret = *this; - ++(*this); - return ret; - } - - CBigNum& operator--() - { - // prefix operator - CBigNum r; - if (!BN_sub(&r, this, BN_value_one())) - throw bignum_error("CBigNum::operator-- : BN_sub failed"); - *this = r; - return *this; - } - - const CBigNum operator--(int) - { - // postfix operator - const CBigNum ret = *this; - --(*this); - return ret; - } - - friend inline const CBigNum operator-(const CBigNum& a, const CBigNum& b); - friend inline const CBigNum operator/(const CBigNum& a, const CBigNum& b); - friend inline const CBigNum operator%(const CBigNum& a, const CBigNum& b); }; @@ -478,48 +169,6 @@ inline const CBigNum operator-(const CBigNum& a) return r; } -inline const CBigNum operator*(const CBigNum& a, const CBigNum& b) -{ - CAutoBN_CTX pctx; - CBigNum r; - if (!BN_mul(&r, &a, &b, pctx)) - throw bignum_error("CBigNum::operator* : BN_mul failed"); - return r; -} - -inline const CBigNum operator/(const CBigNum& a, const CBigNum& b) -{ - CAutoBN_CTX pctx; - CBigNum r; - if (!BN_div(&r, NULL, &a, &b, pctx)) - throw bignum_error("CBigNum::operator/ : BN_div failed"); - return r; -} - -inline const CBigNum operator%(const CBigNum& a, const CBigNum& b) -{ - CAutoBN_CTX pctx; - CBigNum r; - if (!BN_mod(&r, &a, &b, pctx)) - throw bignum_error("CBigNum::operator% : BN_div failed"); - return r; -} - -inline const CBigNum operator<<(const CBigNum& a, unsigned int shift) -{ - CBigNum r; - if (!BN_lshift(&r, &a, shift)) - throw bignum_error("CBigNum:operator<< : BN_lshift failed"); - return r; -} - -inline const CBigNum operator>>(const CBigNum& a, unsigned int shift) -{ - CBigNum r = a; - r >>= shift; - return r; -} - inline bool operator==(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) == 0); } inline bool operator!=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) != 0); } inline bool operator<=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) <= 0); } diff --git a/src/chainparams.h b/src/chainparams.h index f3f24efd99..5600b904cc 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -6,7 +6,6 @@ #ifndef BITCOIN_CHAIN_PARAMS_H #define BITCOIN_CHAIN_PARAMS_H -#include "bignum.h" #include "uint256.h" #include diff --git a/src/protocol.h b/src/protocol.h index 86e08ddcfa..e6f105fe5c 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -14,6 +14,7 @@ #include "netbase.h" #include "serialize.h" #include "uint256.h" +#include "version.h" #include #include diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index 897fb87e46..fb06fb3435 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -8,7 +8,6 @@ -#include "bignum.h" #include "keystore.h" #include "main.h" #include "net.h" diff --git a/src/test/Makefile.am b/src/test/Makefile.am index e12f4904f1..fbc79cf996 100644 --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -37,7 +37,6 @@ test_bitcoin_SOURCES = \ base32_tests.cpp \ base58_tests.cpp \ base64_tests.cpp \ - bignum_tests.cpp \ bloom_tests.cpp \ canonical_tests.cpp \ checkblock_tests.cpp \ diff --git a/src/test/bignum_tests.cpp b/src/test/bignum_tests.cpp deleted file mode 100644 index 01967c7684..0000000000 --- a/src/test/bignum_tests.cpp +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) 2012-2014 The Bitcoin Core developers -// Distributed under the MIT/X11 software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "bignum.h" - -#include -#include - -#include - -BOOST_AUTO_TEST_SUITE(bignum_tests) - -// Unfortunately there's no standard way of preventing a function from being -// inlined, so we define a macro for it. -// -// You should use it like this: -// NOINLINE void function() {...} -#if defined(__GNUC__) -// This also works and will be defined for any compiler implementing GCC -// extensions, such as Clang and ICC. -#define NOINLINE __attribute__((noinline)) -#elif defined(_MSC_VER) -#define NOINLINE __declspec(noinline) -#else -// We give out a warning because it impacts the correctness of one bignum test. -#warning You should define NOINLINE for your compiler. -#define NOINLINE -#endif - -// For the following test case, it is useful to use additional tools. -// -// The simplest one to use is the compiler flag -ftrapv, which detects integer -// overflows and similar errors. However, due to optimizations and compilers -// taking advantage of undefined behavior sometimes it may not actually detect -// anything. -// -// You can also use compiler-based stack protection to possibly detect possible -// stack buffer overruns. -// -// For more accurate diagnostics, you can use an undefined arithmetic operation -// detector such as the clang's undefined behaviour checker. -// See also: http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation -// -// It might also be useful to use Google's AddressSanitizer to detect -// stack buffer overruns, which valgrind can't currently detect. - -// Let's force this code not to be inlined, in order to actually -// test a generic version of the function. This increases the chance -// that -ftrapv will detect overflows. -NOINLINE void mysetint64(CBigNum& num, int64_t n) -{ - num.setint64(n); -} - -// For each number, we do 2 tests: one with inline code, then we reset the -// value to 0, then the second one with a non-inlined function. -BOOST_AUTO_TEST_CASE(bignum_setint64) -{ - int64_t n; - - { - n = 0; - CBigNum num(n); - BOOST_CHECK(num.ToString() == "0"); - num.setulong(0); - BOOST_CHECK(num.ToString() == "0"); - mysetint64(num, n); - BOOST_CHECK(num.ToString() == "0"); - } - { - n = 1; - CBigNum num(n); - BOOST_CHECK(num.ToString() == "1"); - num.setulong(0); - BOOST_CHECK(num.ToString() == "0"); - mysetint64(num, n); - BOOST_CHECK(num.ToString() == "1"); - } - { - n = -1; - CBigNum num(n); - BOOST_CHECK(num.ToString() == "-1"); - num.setulong(0); - BOOST_CHECK(num.ToString() == "0"); - mysetint64(num, n); - BOOST_CHECK(num.ToString() == "-1"); - } - { - n = 5; - CBigNum num(n); - BOOST_CHECK(num.ToString() == "5"); - num.setulong(0); - BOOST_CHECK(num.ToString() == "0"); - mysetint64(num, n); - BOOST_CHECK(num.ToString() == "5"); - } - { - n = -5; - CBigNum num(n); - BOOST_CHECK(num.ToString() == "-5"); - num.setulong(0); - BOOST_CHECK(num.ToString() == "0"); - mysetint64(num, n); - BOOST_CHECK(num.ToString() == "-5"); - } - { - n = std::numeric_limits::min(); - CBigNum num(n); - BOOST_CHECK(num.ToString() == "-9223372036854775808"); - num.setulong(0); - BOOST_CHECK(num.ToString() == "0"); - mysetint64(num, n); - BOOST_CHECK(num.ToString() == "-9223372036854775808"); - } - { - n = std::numeric_limits::max(); - CBigNum num(n); - BOOST_CHECK(num.ToString() == "9223372036854775807"); - num.setulong(0); - BOOST_CHECK(num.ToString() == "0"); - mysetint64(num, n); - BOOST_CHECK(num.ToString() == "9223372036854775807"); - } -} - - -BOOST_AUTO_TEST_CASE(bignum_SetHex) -{ - std::string hexStr = "deecf97fd890808b9cc0f1b6a3e7a60b400f52710e6ad075b1340755bfa58cc9"; - CBigNum num; - num.SetHex(hexStr); - BOOST_CHECK_EQUAL(num.GetHex(), hexStr); -} - -BOOST_AUTO_TEST_SUITE_END() From 7cd0af7cc222d0694ce72e71458aef460698ee2c Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 9 May 2014 17:56:16 +0200 Subject: [PATCH 0037/1288] Move bignum.h to test/ --- src/Makefile.am | 2 +- src/test/Makefile.am | 1 + src/{ => test}/bignum.h | 0 3 files changed, 2 insertions(+), 1 deletion(-) rename src/{ => test}/bignum.h (100%) diff --git a/src/Makefile.am b/src/Makefile.am index 215d0319f9..a49ad58716 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -28,7 +28,7 @@ BITCOIN_CORE_H = \ addrman.h \ alert.h \ allocators.h \ - base58.h bignum.h \ + base58.h \ bloom.h \ chainparams.h \ checkpoints.h \ diff --git a/src/test/Makefile.am b/src/test/Makefile.am index fbc79cf996..cde3a31e2f 100644 --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -32,6 +32,7 @@ endif test_bitcoin_LDADD += $(BDB_LIBS) test_bitcoin_SOURCES = \ + bignum.h \ alert_tests.cpp \ allocator_tests.cpp \ base32_tests.cpp \ diff --git a/src/bignum.h b/src/test/bignum.h similarity index 100% rename from src/bignum.h rename to src/test/bignum.h From 938b68984668445035b2505e1b7ec07649dd2bbc Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 9 May 2014 18:23:34 +0200 Subject: [PATCH 0038/1288] Squashed 'src/leveldb/' changes from 9094c7f..7924331 42dcc7e Merge upstream LevelDB 1.17. e353fbc Release LevelDB 1.17 269fc6c Release LevelDB 1.16 REVERT: 9094c7f Temporarily revert to writing .sst files instead of .ldb git-subtree-dir: src/leveldb git-subtree-split: 79243314e40ac31d79c68e5658a1d6a64800d50b --- Makefile | 11 ++++++----- db/filename.cc | 9 ++------- db/log_reader.cc | 23 +++++++++++++++-------- db/log_test.cc | 40 +++++++++++++++++++++++++++++++++++----- db/repair.cc | 1 - db/version_set.cc | 14 -------------- include/leveldb/c.h | 1 - include/leveldb/db.h | 2 +- include/leveldb/slice.h | 2 +- 9 files changed, 60 insertions(+), 43 deletions(-) diff --git a/Makefile b/Makefile index 344ff2972a..f8903b69e4 100644 --- a/Makefile +++ b/Makefile @@ -72,7 +72,7 @@ SHARED = $(SHARED1) else # Update db.h if you change these. SHARED_MAJOR = 1 -SHARED_MINOR = 15 +SHARED_MINOR = 17 SHARED1 = libleveldb.$(PLATFORM_SHARED_EXT) SHARED2 = $(SHARED1).$(SHARED_MAJOR) SHARED3 = $(SHARED1).$(SHARED_MAJOR).$(SHARED_MINOR) @@ -190,19 +190,20 @@ PLATFORMSROOT=/Applications/Xcode.app/Contents/Developer/Platforms SIMULATORROOT=$(PLATFORMSROOT)/iPhoneSimulator.platform/Developer DEVICEROOT=$(PLATFORMSROOT)/iPhoneOS.platform/Developer IOSVERSION=$(shell defaults read $(PLATFORMSROOT)/iPhoneOS.platform/version CFBundleShortVersionString) +IOSARCH=-arch armv6 -arch armv7 -arch armv7s -arch arm64 .cc.o: mkdir -p ios-x86/$(dir $@) - $(CXX) $(CXXFLAGS) -isysroot $(SIMULATORROOT)/SDKs/iPhoneSimulator$(IOSVERSION).sdk -arch i686 -c $< -o ios-x86/$@ + $(CXX) $(CXXFLAGS) -isysroot $(SIMULATORROOT)/SDKs/iPhoneSimulator$(IOSVERSION).sdk -arch i686 -arch x86_64 -c $< -o ios-x86/$@ mkdir -p ios-arm/$(dir $@) - xcrun -sdk iphoneos $(CXX) $(CXXFLAGS) -isysroot $(DEVICEROOT)/SDKs/iPhoneOS$(IOSVERSION).sdk -arch armv6 -arch armv7 -c $< -o ios-arm/$@ + xcrun -sdk iphoneos $(CXX) $(CXXFLAGS) -isysroot $(DEVICEROOT)/SDKs/iPhoneOS$(IOSVERSION).sdk $(IOSARCH) -c $< -o ios-arm/$@ lipo ios-x86/$@ ios-arm/$@ -create -output $@ .c.o: mkdir -p ios-x86/$(dir $@) - $(CC) $(CFLAGS) -isysroot $(SIMULATORROOT)/SDKs/iPhoneSimulator$(IOSVERSION).sdk -arch i686 -c $< -o ios-x86/$@ + $(CC) $(CFLAGS) -isysroot $(SIMULATORROOT)/SDKs/iPhoneSimulator$(IOSVERSION).sdk -arch i686 -arch x86_64 -c $< -o ios-x86/$@ mkdir -p ios-arm/$(dir $@) - xcrun -sdk iphoneos $(CC) $(CFLAGS) -isysroot $(DEVICEROOT)/SDKs/iPhoneOS$(IOSVERSION).sdk -arch armv6 -arch armv7 -c $< -o ios-arm/$@ + xcrun -sdk iphoneos $(CC) $(CFLAGS) -isysroot $(DEVICEROOT)/SDKs/iPhoneOS$(IOSVERSION).sdk $(IOSARCH) -c $< -o ios-arm/$@ lipo ios-x86/$@ ios-arm/$@ -create -output $@ else diff --git a/db/filename.cc b/db/filename.cc index 27d750697b..da32946d99 100644 --- a/db/filename.cc +++ b/db/filename.cc @@ -29,19 +29,14 @@ std::string LogFileName(const std::string& name, uint64_t number) { return MakeFileName(name, number, "log"); } -// TableFileName returns the filenames we usually write to, while -// SSTTableFileName returns the alternative filenames we also try to read from -// for backward compatibility. For now, swap them around. -// TODO: when compatibility is no longer necessary, swap them back -// (TableFileName to use "ldb" and SSTTableFileName to use "sst"). std::string TableFileName(const std::string& name, uint64_t number) { assert(number > 0); - return MakeFileName(name, number, "sst"); + return MakeFileName(name, number, "ldb"); } std::string SSTTableFileName(const std::string& name, uint64_t number) { assert(number > 0); - return MakeFileName(name, number, "ldb"); + return MakeFileName(name, number, "sst"); } std::string DescriptorFileName(const std::string& dbname, uint64_t number) { diff --git a/db/log_reader.cc b/db/log_reader.cc index b35f115aad..4919216d04 100644 --- a/db/log_reader.cc +++ b/db/log_reader.cc @@ -133,7 +133,9 @@ bool Reader::ReadRecord(Slice* record, std::string* scratch) { case kEof: if (in_fragmented_record) { - ReportCorruption(scratch->size(), "partial record without end(3)"); + // This can be caused by the writer dying immediately after + // writing a physical record but before completing the next; don't + // treat it as a corruption, just ignore the entire logical record. scratch->clear(); } return false; @@ -193,13 +195,12 @@ unsigned int Reader::ReadPhysicalRecord(Slice* result) { eof_ = true; } continue; - } else if (buffer_.size() == 0) { - // End of file - return kEof; } else { - size_t drop_size = buffer_.size(); + // Note that if buffer_ is non-empty, we have a truncated header at the + // end of the file, which can be caused by the writer crashing in the + // middle of writing the header. Instead of considering this an error, + // just report EOF. buffer_.clear(); - ReportCorruption(drop_size, "truncated record at end of file"); return kEof; } } @@ -213,8 +214,14 @@ unsigned int Reader::ReadPhysicalRecord(Slice* result) { if (kHeaderSize + length > buffer_.size()) { size_t drop_size = buffer_.size(); buffer_.clear(); - ReportCorruption(drop_size, "bad record length"); - return kBadRecord; + if (!eof_) { + ReportCorruption(drop_size, "bad record length"); + return kBadRecord; + } + // If the end of the file has been reached without reading |length| bytes + // of payload, assume the writer died in the middle of writing the record. + // Don't report a corruption. + return kEof; } if (type == kZeroType && length == 0) { diff --git a/db/log_test.cc b/db/log_test.cc index 4c5cf87573..91d3caafc3 100644 --- a/db/log_test.cc +++ b/db/log_test.cc @@ -351,20 +351,32 @@ TEST(LogTest, BadRecordType) { ASSERT_EQ("OK", MatchError("unknown record type")); } -TEST(LogTest, TruncatedTrailingRecord) { +TEST(LogTest, TruncatedTrailingRecordIsIgnored) { Write("foo"); ShrinkSize(4); // Drop all payload as well as a header byte ASSERT_EQ("EOF", Read()); - ASSERT_EQ(kHeaderSize - 1, DroppedBytes()); - ASSERT_EQ("OK", MatchError("truncated record at end of file")); + // Truncated last record is ignored, not treated as an error. + ASSERT_EQ(0, DroppedBytes()); + ASSERT_EQ("", ReportMessage()); } TEST(LogTest, BadLength) { + const int kPayloadSize = kBlockSize - kHeaderSize; + Write(BigString("bar", kPayloadSize)); + Write("foo"); + // Least significant size byte is stored in header[4]. + IncrementByte(4, 1); + ASSERT_EQ("foo", Read()); + ASSERT_EQ(kBlockSize, DroppedBytes()); + ASSERT_EQ("OK", MatchError("bad record length")); +} + +TEST(LogTest, BadLengthAtEndIsIgnored) { Write("foo"); ShrinkSize(1); ASSERT_EQ("EOF", Read()); - ASSERT_EQ(kHeaderSize + 2, DroppedBytes()); - ASSERT_EQ("OK", MatchError("bad record length")); + ASSERT_EQ(0, DroppedBytes()); + ASSERT_EQ("", ReportMessage()); } TEST(LogTest, ChecksumMismatch) { @@ -415,6 +427,24 @@ TEST(LogTest, UnexpectedFirstType) { ASSERT_EQ("OK", MatchError("partial record without end")); } +TEST(LogTest, MissingLastIsIgnored) { + Write(BigString("bar", kBlockSize)); + // Remove the LAST block, including header. + ShrinkSize(14); + ASSERT_EQ("EOF", Read()); + ASSERT_EQ("", ReportMessage()); + ASSERT_EQ(0, DroppedBytes()); +} + +TEST(LogTest, PartialLastIsIgnored) { + Write(BigString("bar", kBlockSize)); + // Cause a bad record length in the LAST block. + ShrinkSize(1); + ASSERT_EQ("EOF", Read()); + ASSERT_EQ("", ReportMessage()); + ASSERT_EQ(0, DroppedBytes()); +} + TEST(LogTest, ErrorJoinsRecords) { // Consider two fragmented records: // first(R1) last(R1) first(R2) last(R2) diff --git a/db/repair.cc b/db/repair.cc index 96c9b37af1..7727fafc58 100644 --- a/db/repair.cc +++ b/db/repair.cc @@ -242,7 +242,6 @@ class Repairer { } void ExtractMetaData() { - std::vector kept; for (size_t i = 0; i < table_numbers_.size(); i++) { ScanTable(table_numbers_[i]); } diff --git a/db/version_set.cc b/db/version_set.cc index 517edd3b18..aa83df55e4 100644 --- a/db/version_set.cc +++ b/db/version_set.cc @@ -54,20 +54,6 @@ static int64_t TotalFileSize(const std::vector& files) { return sum; } -namespace { -std::string IntSetToString(const std::set& s) { - std::string result = "{"; - for (std::set::const_iterator it = s.begin(); - it != s.end(); - ++it) { - result += (result.size() > 1) ? "," : ""; - result += NumberToString(*it); - } - result += "}"; - return result; -} -} // namespace - Version::~Version() { assert(refs_ == 0); diff --git a/include/leveldb/c.h b/include/leveldb/c.h index 1fa58866c3..1048fe3b86 100644 --- a/include/leveldb/c.h +++ b/include/leveldb/c.h @@ -9,7 +9,6 @@ Does not support: . getters for the option types . custom comparators that implement key shortening - . capturing post-write-snapshot . custom iter, db, env, cache implementations using just the C bindings Some conventions: diff --git a/include/leveldb/db.h b/include/leveldb/db.h index 5ffb29d526..40851b2aa8 100644 --- a/include/leveldb/db.h +++ b/include/leveldb/db.h @@ -14,7 +14,7 @@ namespace leveldb { // Update Makefile if you change these static const int kMajorVersion = 1; -static const int kMinorVersion = 15; +static const int kMinorVersion = 17; struct Options; struct ReadOptions; diff --git a/include/leveldb/slice.h b/include/leveldb/slice.h index 74ea8fa49a..bc367986f7 100644 --- a/include/leveldb/slice.h +++ b/include/leveldb/slice.h @@ -94,7 +94,7 @@ inline bool operator!=(const Slice& x, const Slice& y) { } inline int Slice::compare(const Slice& b) const { - const int min_len = (size_ < b.size_) ? size_ : b.size_; + const size_t min_len = (size_ < b.size_) ? size_ : b.size_; int r = memcmp(data_, b.data_, min_len); if (r == 0) { if (size_ < b.size_) r = -1; From 90fd87376d4ccb1ce9eec703b756dd292bee8288 Mon Sep 17 00:00:00 2001 From: Matthew Bogosian Date: Fri, 9 May 2014 12:39:24 -0700 Subject: [PATCH 0039/1288] fixes #4163 --- src/rpcwallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index e21881dbe9..2479a1f87e 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1747,7 +1747,7 @@ Value lockunspent(const Array& params, bool fHelp) throw runtime_error( "lockunspent unlock [{\"txid\":\"txid\",\"vout\":n},...]\n" "\nUpdates list of temporarily unspendable outputs.\n" - "Temporarily lock (lock=true) or unlock (lock=false) specified transaction outputs.\n" + "Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs.\n" "A locked transaction output will not be chosen by automatic coin selection, when spending bitcoins.\n" "Locks are stored in memory only. Nodes start with zero locked outputs, and the locked output list\n" "is always cleared (by virtue of process exit) when a node stops or fails.\n" From b641c9cd217f7789726bb25ab87cd35e2e5fcaad Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sat, 10 May 2014 00:39:49 +0200 Subject: [PATCH 0040/1288] Fix addnode "onetry": Connect with OpenNetworkConnection --- src/net.cpp | 3 --- src/net.h | 1 + src/rpcnet.cpp | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 6bde1e7999..9f7096f133 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -41,9 +41,6 @@ using namespace boost; static const int MAX_OUTBOUND_CONNECTIONS = 8; -bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false); - - // // Global state variables // diff --git a/src/net.h b/src/net.h index 729b1bcd57..3a8cf1ac8f 100644 --- a/src/net.h +++ b/src/net.h @@ -49,6 +49,7 @@ void AddressCurrentlyConnected(const CService& addr); CNode* FindNode(const CNetAddr& ip); CNode* FindNode(const CService& ip); CNode* ConnectNode(CAddress addrConnect, const char *strDest = NULL); +bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false); void MapPort(bool fUseUPnP); unsigned short GetListenPort(); bool BindListenPort(const CService &bindAddr, std::string& strError=REF(std::string())); diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 573d6cd3f6..0a2bfbac60 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -166,7 +166,7 @@ Value addnode(const Array& params, bool fHelp) if (strCommand == "onetry") { CAddress addr; - ConnectNode(addr, strNode.c_str()); + OpenNetworkConnection(addr, NULL, strNode.c_str()); return Value::null; } From f6b7c644c998799c10704be4a5b42d9cacc8a746 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 9 May 2014 23:42:20 +0200 Subject: [PATCH 0041/1288] Move base58.h implementation code to base58.cpp --- src/base58.cpp | 183 +++++++++++++++++++++++++++ src/base58.h | 257 +++++--------------------------------- src/test/base58_tests.cpp | 4 +- 3 files changed, 218 insertions(+), 226 deletions(-) diff --git a/src/base58.cpp b/src/base58.cpp index 0b08ee3d06..5975703887 100644 --- a/src/base58.cpp +++ b/src/base58.cpp @@ -2,11 +2,18 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include "base58.h" + +#include "hash.h" +#include "uint256.h" + #include #include #include #include #include +#include +#include /* All alphanumeric characters except for "0", "I", "O", and "l" */ static const char* pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; @@ -89,3 +96,179 @@ std::string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend) str += pszBase58[*(it++)]; return str; } + +std::string EncodeBase58(const std::vector& vch) { + return EncodeBase58(&vch[0], &vch[0] + vch.size()); +} + +bool DecodeBase58(const std::string& str, std::vector& vchRet) { + return DecodeBase58(str.c_str(), vchRet); +} + +std::string EncodeBase58Check(const std::vector& vchIn) { + // add 4-byte hash check to the end + std::vector vch(vchIn); + uint256 hash = Hash(vch.begin(), vch.end()); + vch.insert(vch.end(), (unsigned char*)&hash, (unsigned char*)&hash + 4); + return EncodeBase58(vch); +} + +bool DecodeBase58Check(const char* psz, std::vector& vchRet) { + if (!DecodeBase58(psz, vchRet)) + return false; + if (vchRet.size() < 4) + { + vchRet.clear(); + return false; + } + // re-calculate the checksum, insure it matches the included 4-byte checksum + uint256 hash = Hash(vchRet.begin(), vchRet.end()-4); + if (memcmp(&hash, &vchRet.end()[-4], 4) != 0) + { + vchRet.clear(); + return false; + } + vchRet.resize(vchRet.size()-4); + return true; +} + +bool DecodeBase58Check(const std::string& str, std::vector& vchRet) { + return DecodeBase58Check(str.c_str(), vchRet); +} + +CBase58Data::CBase58Data() { + vchVersion.clear(); + vchData.clear(); +} + +void CBase58Data::SetData(const std::vector &vchVersionIn, const void* pdata, size_t nSize) { + vchVersion = vchVersionIn; + vchData.resize(nSize); + if (!vchData.empty()) + memcpy(&vchData[0], pdata, nSize); +} + +void CBase58Data::SetData(const std::vector &vchVersionIn, const unsigned char *pbegin, const unsigned char *pend) { + SetData(vchVersionIn, (void*)pbegin, pend - pbegin); +} + +bool CBase58Data::SetString(const char* psz, unsigned int nVersionBytes) { + std::vector vchTemp; + DecodeBase58Check(psz, vchTemp); + if (vchTemp.size() < nVersionBytes) { + vchData.clear(); + vchVersion.clear(); + return false; + } + vchVersion.assign(vchTemp.begin(), vchTemp.begin() + nVersionBytes); + vchData.resize(vchTemp.size() - nVersionBytes); + if (!vchData.empty()) + memcpy(&vchData[0], &vchTemp[nVersionBytes], vchData.size()); + OPENSSL_cleanse(&vchTemp[0], vchData.size()); + return true; +} + +bool CBase58Data::SetString(const std::string& str) { + return SetString(str.c_str()); +} + +std::string CBase58Data::ToString() const { + std::vector vch = vchVersion; + vch.insert(vch.end(), vchData.begin(), vchData.end()); + return EncodeBase58Check(vch); +} + +int CBase58Data::CompareTo(const CBase58Data& b58) const { + if (vchVersion < b58.vchVersion) return -1; + if (vchVersion > b58.vchVersion) return 1; + if (vchData < b58.vchData) return -1; + if (vchData > b58.vchData) return 1; + return 0; +} + +namespace { + class CBitcoinAddressVisitor : public boost::static_visitor { + private: + CBitcoinAddress *addr; + public: + CBitcoinAddressVisitor(CBitcoinAddress *addrIn) : addr(addrIn) { } + + bool operator()(const CKeyID &id) const { return addr->Set(id); } + bool operator()(const CScriptID &id) const { return addr->Set(id); } + bool operator()(const CNoDestination &no) const { return false; } + }; +}; + +bool CBitcoinAddress::Set(const CKeyID &id) { + SetData(Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS), &id, 20); + return true; +} + +bool CBitcoinAddress::Set(const CScriptID &id) { + SetData(Params().Base58Prefix(CChainParams::SCRIPT_ADDRESS), &id, 20); + return true; +} + +bool CBitcoinAddress::Set(const CTxDestination &dest) { + return boost::apply_visitor(CBitcoinAddressVisitor(this), dest); +} + +bool CBitcoinAddress::IsValid() const { + bool fCorrectSize = vchData.size() == 20; + bool fKnownVersion = vchVersion == Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS) || + vchVersion == Params().Base58Prefix(CChainParams::SCRIPT_ADDRESS); + return fCorrectSize && fKnownVersion; +} + +CTxDestination CBitcoinAddress::Get() const { + if (!IsValid()) + return CNoDestination(); + uint160 id; + memcpy(&id, &vchData[0], 20); + if (vchVersion == Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS)) + return CKeyID(id); + else if (vchVersion == Params().Base58Prefix(CChainParams::SCRIPT_ADDRESS)) + return CScriptID(id); + else + return CNoDestination(); +} + +bool CBitcoinAddress::GetKeyID(CKeyID &keyID) const { + if (!IsValid() || vchVersion != Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS)) + return false; + uint160 id; + memcpy(&id, &vchData[0], 20); + keyID = CKeyID(id); + return true; +} + +bool CBitcoinAddress::IsScript() const { + return IsValid() && vchVersion == Params().Base58Prefix(CChainParams::SCRIPT_ADDRESS); +} + +void CBitcoinSecret::SetKey(const CKey& vchSecret) { + assert(vchSecret.IsValid()); + SetData(Params().Base58Prefix(CChainParams::SECRET_KEY), vchSecret.begin(), vchSecret.size()); + if (vchSecret.IsCompressed()) + vchData.push_back(1); +} + +CKey CBitcoinSecret::GetKey() { + CKey ret; + ret.Set(&vchData[0], &vchData[32], vchData.size() > 32 && vchData[32] == 1); + return ret; +} + +bool CBitcoinSecret::IsValid() const { + bool fExpectedFormat = vchData.size() == 32 || (vchData.size() == 33 && vchData[32] == 1); + bool fCorrectVersion = vchVersion == Params().Base58Prefix(CChainParams::SECRET_KEY); + return fExpectedFormat && fCorrectVersion; +} + +bool CBitcoinSecret::SetString(const char* pszSecret) { + return CBase58Data::SetString(pszSecret) && IsValid(); +} + +bool CBitcoinSecret::SetString(const std::string& strSecret) { + return SetString(strSecret.c_str()); +} diff --git a/src/base58.h b/src/base58.h index 4fb436c5ed..70681f589a 100644 --- a/src/base58.h +++ b/src/base58.h @@ -15,17 +15,12 @@ #define BITCOIN_BASE58_H #include "chainparams.h" -#include "hash.h" #include "key.h" #include "script.h" -#include "uint256.h" #include #include -#include -#include - /** * Encode a byte sequence as a base58-encoded string. * pbegin and pend cannot be NULL, unless both are. @@ -35,10 +30,7 @@ std::string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend) /** * Encode a byte vector as a base58-encoded string */ -inline std::string EncodeBase58(const std::vector& vch) -{ - return EncodeBase58(&vch[0], &vch[0] + vch.size()); -} +std::string EncodeBase58(const std::vector& vch); /** * Decode a base58-encoded string (psz) into a byte vector (vchRet). @@ -51,55 +43,24 @@ bool DecodeBase58(const char* psz, std::vector& vchRet); * Decode a base58-encoded string (str) into a byte vector (vchRet). * return true if decoding is successful. */ -inline bool DecodeBase58(const std::string& str, std::vector& vchRet) -{ - return DecodeBase58(str.c_str(), vchRet); -} +bool DecodeBase58(const std::string& str, std::vector& vchRet); /** * Encode a byte vector into a base58-encoded string, including checksum */ -inline std::string EncodeBase58Check(const std::vector& vchIn) -{ - // add 4-byte hash check to the end - std::vector vch(vchIn); - uint256 hash = Hash(vch.begin(), vch.end()); - vch.insert(vch.end(), (unsigned char*)&hash, (unsigned char*)&hash + 4); - return EncodeBase58(vch); -} +std::string EncodeBase58Check(const std::vector& vchIn); /** * Decode a base58-encoded string (psz) that includes a checksum into a byte * vector (vchRet), return true if decoding is successful */ -inline bool DecodeBase58Check(const char* psz, std::vector& vchRet) -{ - if (!DecodeBase58(psz, vchRet)) - return false; - if (vchRet.size() < 4) - { - vchRet.clear(); - return false; - } - // re-calculate the checksum, insure it matches the included 4-byte checksum - uint256 hash = Hash(vchRet.begin(), vchRet.end()-4); - if (memcmp(&hash, &vchRet.end()[-4], 4) != 0) - { - vchRet.clear(); - return false; - } - vchRet.resize(vchRet.size()-4); - return true; -} +inline bool DecodeBase58Check(const char* psz, std::vector& vchRet); /** * Decode a base58-encoded string (str) that includes a checksum into a byte * vector (vchRet), return true if decoding is successful */ -inline bool DecodeBase58Check(const std::string& str, std::vector& vchRet) -{ - return DecodeBase58Check(str.c_str(), vchRet); -} +inline bool DecodeBase58Check(const std::string& str, std::vector& vchRet); /** * Base class for all base58-encoded data @@ -114,64 +75,15 @@ protected: typedef std::vector > vector_uchar; vector_uchar vchData; - CBase58Data() - { - vchVersion.clear(); - vchData.clear(); - } - - void SetData(const std::vector &vchVersionIn, const void* pdata, size_t nSize) - { - vchVersion = vchVersionIn; - vchData.resize(nSize); - if (!vchData.empty()) - memcpy(&vchData[0], pdata, nSize); - } - - void SetData(const std::vector &vchVersionIn, const unsigned char *pbegin, const unsigned char *pend) - { - SetData(vchVersionIn, (void*)pbegin, pend - pbegin); - } + CBase58Data(); + void SetData(const std::vector &vchVersionIn, const void* pdata, size_t nSize); + void SetData(const std::vector &vchVersionIn, const unsigned char *pbegin, const unsigned char *pend); public: - bool SetString(const char* psz, unsigned int nVersionBytes = 1) - { - std::vector vchTemp; - DecodeBase58Check(psz, vchTemp); - if (vchTemp.size() < nVersionBytes) - { - vchData.clear(); - vchVersion.clear(); - return false; - } - vchVersion.assign(vchTemp.begin(), vchTemp.begin() + nVersionBytes); - vchData.resize(vchTemp.size() - nVersionBytes); - if (!vchData.empty()) - memcpy(&vchData[0], &vchTemp[nVersionBytes], vchData.size()); - OPENSSL_cleanse(&vchTemp[0], vchData.size()); - return true; - } - - bool SetString(const std::string& str) - { - return SetString(str.c_str()); - } - - std::string ToString() const - { - std::vector vch = vchVersion; - vch.insert(vch.end(), vchData.begin(), vchData.end()); - return EncodeBase58Check(vch); - } - - int CompareTo(const CBase58Data& b58) const - { - if (vchVersion < b58.vchVersion) return -1; - if (vchVersion > b58.vchVersion) return 1; - if (vchData < b58.vchData) return -1; - if (vchData > b58.vchData) return 1; - return 0; - } + bool SetString(const char* psz, unsigned int nVersionBytes = 1); + bool SetString(const std::string& str); + std::string ToString() const; + int CompareTo(const CBase58Data& b58) const; bool operator==(const CBase58Data& b58) const { return CompareTo(b58) == 0; } bool operator<=(const CBase58Data& b58) const { return CompareTo(b58) <= 0; } @@ -186,140 +98,37 @@ public: * Script-hash-addresses have version 5 (or 196 testnet). * The data vector contains RIPEMD160(SHA256(cscript)), where cscript is the serialized redemption script. */ -class CBitcoinAddress; -class CBitcoinAddressVisitor : public boost::static_visitor -{ -private: - CBitcoinAddress *addr; +class CBitcoinAddress : public CBase58Data { public: - CBitcoinAddressVisitor(CBitcoinAddress *addrIn) : addr(addrIn) { } - bool operator()(const CKeyID &id) const; - bool operator()(const CScriptID &id) const; - bool operator()(const CNoDestination &no) const; + bool Set(const CKeyID &id); + bool Set(const CScriptID &id); + bool Set(const CTxDestination &dest); + bool IsValid() const; + + CBitcoinAddress() {} + CBitcoinAddress(const CTxDestination &dest) { Set(dest); } + CBitcoinAddress(const std::string& strAddress) { SetString(strAddress); } + CBitcoinAddress(const char* pszAddress) { SetString(pszAddress); } + + CTxDestination Get() const; + bool GetKeyID(CKeyID &keyID) const; + bool IsScript() const; }; -class CBitcoinAddress : public CBase58Data -{ -public: - bool Set(const CKeyID &id) { - SetData(Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS), &id, 20); - return true; - } - - bool Set(const CScriptID &id) { - SetData(Params().Base58Prefix(CChainParams::SCRIPT_ADDRESS), &id, 20); - return true; - } - - bool Set(const CTxDestination &dest) - { - return boost::apply_visitor(CBitcoinAddressVisitor(this), dest); - } - - bool IsValid() const - { - bool fCorrectSize = vchData.size() == 20; - bool fKnownVersion = vchVersion == Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS) || - vchVersion == Params().Base58Prefix(CChainParams::SCRIPT_ADDRESS); - return fCorrectSize && fKnownVersion; - } - - CBitcoinAddress() - { - } - - CBitcoinAddress(const CTxDestination &dest) - { - Set(dest); - } - - CBitcoinAddress(const std::string& strAddress) - { - SetString(strAddress); - } - - CBitcoinAddress(const char* pszAddress) - { - SetString(pszAddress); - } - - CTxDestination Get() const { - if (!IsValid()) - return CNoDestination(); - uint160 id; - memcpy(&id, &vchData[0], 20); - if (vchVersion == Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS)) - return CKeyID(id); - else if (vchVersion == Params().Base58Prefix(CChainParams::SCRIPT_ADDRESS)) - return CScriptID(id); - else - return CNoDestination(); - } - - bool GetKeyID(CKeyID &keyID) const { - if (!IsValid() || vchVersion != Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS)) - return false; - uint160 id; - memcpy(&id, &vchData[0], 20); - keyID = CKeyID(id); - return true; - } - - bool IsScript() const { - return IsValid() && vchVersion == Params().Base58Prefix(CChainParams::SCRIPT_ADDRESS); - } -}; - -bool inline CBitcoinAddressVisitor::operator()(const CKeyID &id) const { return addr->Set(id); } -bool inline CBitcoinAddressVisitor::operator()(const CScriptID &id) const { return addr->Set(id); } -bool inline CBitcoinAddressVisitor::operator()(const CNoDestination &id) const { return false; } - /** * A base58-encoded secret key */ class CBitcoinSecret : public CBase58Data { public: - void SetKey(const CKey& vchSecret) - { - assert(vchSecret.IsValid()); - SetData(Params().Base58Prefix(CChainParams::SECRET_KEY), vchSecret.begin(), vchSecret.size()); - if (vchSecret.IsCompressed()) - vchData.push_back(1); - } + void SetKey(const CKey& vchSecret); + CKey GetKey(); + bool IsValid() const; + bool SetString(const char* pszSecret); + bool SetString(const std::string& strSecret); - CKey GetKey() - { - CKey ret; - ret.Set(&vchData[0], &vchData[32], vchData.size() > 32 && vchData[32] == 1); - return ret; - } - - bool IsValid() const - { - bool fExpectedFormat = vchData.size() == 32 || (vchData.size() == 33 && vchData[32] == 1); - bool fCorrectVersion = vchVersion == Params().Base58Prefix(CChainParams::SECRET_KEY); - return fExpectedFormat && fCorrectVersion; - } - - bool SetString(const char* pszSecret) - { - return CBase58Data::SetString(pszSecret) && IsValid(); - } - - bool SetString(const std::string& strSecret) - { - return SetString(strSecret.c_str()); - } - - CBitcoinSecret(const CKey& vchSecret) - { - SetKey(vchSecret); - } - - CBitcoinSecret() - { - } + CBitcoinSecret(const CKey& vchSecret) { SetKey(vchSecret); } + CBitcoinSecret() {} }; template class CBitcoinExtKeyBase : public CBase58Data diff --git a/src/test/base58_tests.cpp b/src/test/base58_tests.cpp index 5689e69995..b81a19cfd8 100644 --- a/src/test/base58_tests.cpp +++ b/src/test/base58_tests.cpp @@ -233,7 +233,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_gen) continue; } CBitcoinAddress addrOut; - BOOST_CHECK_MESSAGE(boost::apply_visitor(CBitcoinAddressVisitor(&addrOut), dest), "encode dest: " + strTest); + BOOST_CHECK_MESSAGE(addrOut.Set(dest), "encode dest: " + strTest); BOOST_CHECK_MESSAGE(addrOut.ToString() == exp_base58string, "mismatch: " + strTest); } } @@ -241,7 +241,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_gen) // Visiting a CNoDestination must fail CBitcoinAddress dummyAddr; CTxDestination nodest = CNoDestination(); - BOOST_CHECK(!boost::apply_visitor(CBitcoinAddressVisitor(&dummyAddr), nodest)); + BOOST_CHECK(!dummyAddr.Set(nodest)); SelectParams(CChainParams::MAIN); } From 7a0e84dd63ac98a92fd7aafd2d432f1da71eb8da Mon Sep 17 00:00:00 2001 From: Ashley Holman Date: Sun, 11 May 2014 00:30:18 -0500 Subject: [PATCH 0042/1288] ProcessGetData(): abort if a block file is missing from disk --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 379ca3ef74..f90f038016 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3373,7 +3373,7 @@ void static ProcessGetData(CNode* pfrom) { // Send block from disk CBlock block; - ReadBlockFromDisk(block, (*mi).second); + assert(ReadBlockFromDisk(block, (*mi).second)); if (inv.type == MSG_BLOCK) pfrom->PushMessage("block", block); else // MSG_FILTERED_BLOCK) From 283e405c063acfca304acbff505badcbbcb814c9 Mon Sep 17 00:00:00 2001 From: shshshsh Date: Sun, 11 May 2014 13:29:16 +0000 Subject: [PATCH 0043/1288] Switch stdout to line buffering Use line buffering (instead of block buffering) so that messages arrive immediately in systemd-journald, tail -f debug.log, and the like. --- src/init.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/init.cpp b/src/init.cpp index 77c32d0b49..2c3bb02758 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -25,6 +25,7 @@ #endif #include +#include #ifndef WIN32 #include @@ -530,6 +531,7 @@ bool AppInit2(boost::thread_group& threadGroup) fServer = GetBoolArg("-server", false); fPrintToConsole = GetBoolArg("-printtoconsole", false); fLogTimestamps = GetBoolArg("-logtimestamps", true); + setvbuf(stdout, NULL, _IOLBF, 0); #ifdef ENABLE_WALLET bool fDisableWallet = GetBoolArg("-disablewallet", false); #endif From 0a0cd345520382bd726fef50c62864715b03f164 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 7 May 2014 09:09:13 +0200 Subject: [PATCH 0044/1288] rpc: pass errors from async_accept According to the [boost::asio documentation](http://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio/reference/basic_socket_acceptor/async_accept/overload2.html), the function signature of the handler must be: void handler( const boost::system::error_code& error // Result of operation. ); We were binding *all* the arguments, instead of all but the error, resulting in nullary function that never got the error. Fix this by adding an input argument substitution. --- src/rpcserver.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index ac40ea7cf1..44f329dd15 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -466,7 +466,7 @@ static void RPCListen(boost::shared_ptr< basic_socket_acceptor Date: Wed, 7 May 2014 09:24:44 +0200 Subject: [PATCH 0045/1288] rpc: Make sure conn object is always cleaned up Make sure conn object always gets cleaned up by using a `boost::shared_ptr`. This makes valgrind happy - before this commit, one connection object always leaked at shutdown, as well as can avoid other leaks, when for example an exception happens. Also add an explicit Close() to the !ClientAllowed path to make it similar to the normal path (I'm not sure whether it is needed, but it can't hurt). --- src/rpcserver.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 44f329dd15..442bf5c9cb 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -444,7 +444,7 @@ template static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor > acceptor, ssl::context& context, bool fUseSSL, - AcceptedConnection* conn, + boost::shared_ptr< AcceptedConnection > conn, const boost::system::error_code& error); /** @@ -456,7 +456,7 @@ static void RPCListen(boost::shared_ptr< basic_socket_acceptor* conn = new AcceptedConnectionImpl(acceptor->get_io_service(), context, fUseSSL); + boost::shared_ptr< AcceptedConnectionImpl > conn(new AcceptedConnectionImpl(acceptor->get_io_service(), context, fUseSSL)); acceptor->async_accept( conn->sslStream.lowest_layer(), @@ -477,23 +477,20 @@ template static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor > acceptor, ssl::context& context, const bool fUseSSL, - AcceptedConnection* conn, + boost::shared_ptr< AcceptedConnection > conn, const boost::system::error_code& error) { // Immediately start accepting new connections, except when we're cancelled or our socket is closed. if (error != asio::error::operation_aborted && acceptor->is_open()) RPCListen(acceptor, context, fUseSSL); - AcceptedConnectionImpl* tcp_conn = dynamic_cast< AcceptedConnectionImpl* >(conn); + AcceptedConnectionImpl* tcp_conn = dynamic_cast< AcceptedConnectionImpl* >(conn.get()); - // TODO: Actually handle errors if (error) { - delete conn; // TODO: Actually handle errors LogPrintf("%s: Error: %s\n", __func__, error.message()); } - // Restrict callers by IP. It is important to // do this before starting client thread, to filter out // certain DoS and misbehaving clients. @@ -502,12 +499,11 @@ static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptorstream() << HTTPReply(HTTP_FORBIDDEN, "", false) << std::flush; - delete conn; + conn->close(); } else { - ServiceConnection(conn); + ServiceConnection(conn.get()); conn->close(); - delete conn; } } From 381b25dfde013efae4e0360f82cd34e27662e743 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 7 May 2014 11:47:16 +0200 Subject: [PATCH 0046/1288] doc: remove mention of `-rpctimeout` from man page That option hasn't existed for a long time. --- contrib/debian/manpages/bitcoin.conf.5 | 3 --- 1 file changed, 3 deletions(-) diff --git a/contrib/debian/manpages/bitcoin.conf.5 b/contrib/debian/manpages/bitcoin.conf.5 index eef213149d..7438b4b66a 100644 --- a/contrib/debian/manpages/bitcoin.conf.5 +++ b/contrib/debian/manpages/bitcoin.conf.5 @@ -37,9 +37,6 @@ You must set *rpcuser* to secure the JSON-RPC api. \fBrpcpassword=\fR\fI'password'\fR You must set *rpcpassword* to secure the JSON-RPC api. .TP -\fBrpctimeout=\fR\fI'30'\fR -How many seconds *bitcoin* will wait for a complete RPC HTTP request, after the HTTP connection is established. -.TP \fBrpcallowip=\fR\fI'192.168.1.*'\fR By default, only RPC connections from localhost are allowed. Specify as many *rpcallowip=* settings as you like to allow connections from other hosts (and you may use * as a wildcard character). .TP From cef44941e798c33f7334bf90a2dd531f9bada8c3 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 9 May 2014 10:01:50 +0200 Subject: [PATCH 0047/1288] rpc: keep track of acceptors, and cancel them in StopRPCThreads Fixes #4156. The problem is that the boost::asio::io_service destructor waits for the acceptors to finish (on windows, and boost 1.55). Fix this by keeping track of the acceptors and cancelling them before stopping the event loops. --- src/rpcserver.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 442bf5c9cb..d4a229b092 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -39,6 +39,7 @@ static ssl::context* rpc_ssl_context = NULL; static boost::thread_group* rpc_worker_group = NULL; static boost::asio::io_service::work *rpc_dummy_work = NULL; static std::vector rpc_allow_subnets; //!< List of subnets to allow RPC connections from +static std::vector< boost::shared_ptr > rpc_acceptors; void RPCTypeCheck(const Array& params, const list& typesExpected, @@ -593,12 +594,13 @@ void StartRPCThreads() asio::ip::address bindAddress = loopback ? asio::ip::address_v6::loopback() : asio::ip::address_v6::any(); ip::tcp::endpoint endpoint(bindAddress, GetArg("-rpcport", Params().RPCPort())); boost::system::error_code v6_only_error; - boost::shared_ptr acceptor(new ip::tcp::acceptor(*rpc_io_service)); bool fListening = false; std::string strerr; try { + boost::shared_ptr acceptor(new ip::tcp::acceptor(*rpc_io_service)); + rpc_acceptors.push_back(acceptor); acceptor->open(endpoint.protocol()); acceptor->set_option(boost::asio::ip::tcp::acceptor::reuse_address(true)); @@ -616,7 +618,6 @@ void StartRPCThreads() { strerr = strprintf(_("An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s"), endpoint.port(), e.what()); } - try { // If dual IPv6/IPv4 failed (or we're opening loopback interfaces only), open IPv4 separately if (!fListening || loopback || v6_only_error) @@ -624,7 +625,8 @@ void StartRPCThreads() bindAddress = loopback ? asio::ip::address_v4::loopback() : asio::ip::address_v4::any(); endpoint.address(bindAddress); - acceptor.reset(new ip::tcp::acceptor(*rpc_io_service)); + boost::shared_ptr acceptor(new ip::tcp::acceptor(*rpc_io_service)); + rpc_acceptors.push_back(acceptor); acceptor->open(endpoint.protocol()); acceptor->set_option(boost::asio::ip::tcp::acceptor::reuse_address(true)); acceptor->bind(endpoint); @@ -668,7 +670,16 @@ void StopRPCThreads() { if (rpc_io_service == NULL) return; + // First, cancel all timers and acceptors + // This is not done automatically by ->stop(), and in some cases the destructor of + // asio::io_service can hang if this is skipped. + BOOST_FOREACH(const boost::shared_ptr &acceptor, rpc_acceptors) + acceptor->cancel(); + rpc_acceptors.clear(); + BOOST_FOREACH(const PAIRTYPE(std::string, boost::shared_ptr) &timer, deadlineTimers) + timer.second->cancel(); deadlineTimers.clear(); + rpc_io_service->stop(); if (rpc_worker_group != NULL) rpc_worker_group->join_all(); From 9ec030622f6c12c75f98b6dcd0c18bd9ef1fc223 Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Thu, 13 Mar 2014 02:45:33 -0400 Subject: [PATCH 0048/1288] Add CODESEPARATOR/FindAndDelete() tests --- src/test/data/tx_valid.json | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/test/data/tx_valid.json b/src/test/data/tx_valid.json index 1f51d3ce55..40275cd194 100644 --- a/src/test/data/tx_valid.json +++ b/src/test/data/tx_valid.json @@ -132,5 +132,51 @@ [[["ba4cd7ae2ad4d4d13ebfc8ab1d93a63e4a6563f25089a18bf0fc68f282aa88c1", 0, "2 0x21 0x037c615d761e71d38903609bf4f46847266edc2fb37532047d747ba47eaae5ffe1 0x21 0x02edc823cd634f2c4033d94f5755207cb6b60c4b1f1f056ad7471c47de5f2e4d50 2 CHECKMULTISIG NOT"]], "0100000001c188aa82f268fcf08ba18950f263654a3ea6931dabc8bf3ed1d4d42aaed74cba000000004b0000483045022100940378576e069aca261a6b26fb38344e4497ca6751bb10905c76bb689f4222b002204833806b014c26fd801727b792b1260003c55710f87c5adbd7a9cb57446dbc9801ffffffff0101000000000000002321037c615d761e71d38903609bf4f46847266edc2fb37532047d747ba47eaae5ffe1ac00000000", "P2SH"], + +["OP_CODESEPARATOR tests"], + +["Test that SignatureHash() removes OP_CODESEPARATOR with FindAndDelete()"], +[[["bc7fd132fcf817918334822ee6d9bd95c889099c96e07ca2c1eb2cc70db63224", 0, "CODESEPARATOR 0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIG"]], +"01000000012432b60dc72cebc1a27ce0969c0989c895bdd9e62e8234839117f8fc32d17fbc000000004a493046022100a576b52051962c25e642c0fd3d77ee6c92487048e5d90818bcf5b51abaccd7900221008204f8fb121be4ec3b24483b1f92d89b1b0548513a134e345c5442e86e8617a501ffffffff010000000000000000016a00000000", "P2SH"], +[[["83e194f90b6ef21fa2e3a365b63794fb5daa844bdc9b25de30899fcfe7b01047", 0, "CODESEPARATOR CODESEPARATOR 0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIG"]], +"01000000014710b0e7cf9f8930de259bdc4b84aa5dfb9437b665a3e3a21ff26e0bf994e183000000004a493046022100a166121a61b4eeb19d8f922b978ff6ab58ead8a5a5552bf9be73dc9c156873ea02210092ad9bc43ee647da4f6652c320800debcf08ec20a094a0aaf085f63ecb37a17201ffffffff010000000000000000016a00000000", "P2SH"], + +["Hashed data starts at the CODESEPARATOR"], +[[["326882a7f22b5191f1a0cc9962ca4b878cd969cf3b3a70887aece4d801a0ba5e", 0, "0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CODESEPARATOR CHECKSIG"]], +"01000000015ebaa001d8e4ec7a88703a3bcf69d98c874bca6299cca0f191512bf2a7826832000000004948304502203bf754d1c6732fbf87c5dcd81258aefd30f2060d7bd8ac4a5696f7927091dad1022100f5bcb726c4cf5ed0ed34cc13dadeedf628ae1045b7cb34421bc60b89f4cecae701ffffffff010000000000000000016a00000000", "P2SH"], + +["But only if execution has reached it"], +[[["a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944", 0, "0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIGVERIFY CODESEPARATOR 0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIGVERIFY CODESEPARATOR 1"]], +"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a900000000924830450221009c0a27f886a1d8cb87f6f595fbc3163d28f7a81ec3c4b252ee7f3ac77fd13ffa02203caa8dfa09713c8c4d7ef575c75ed97812072405d932bd11e6a1593a98b679370148304502201e3861ef39a526406bad1e20ecad06be7375ad40ddb582c9be42d26c3a0d7b240221009d0a3985e96522e59635d19cc4448547477396ce0ef17a58e7d74c3ef464292301ffffffff010000000000000000016a00000000", "P2SH"], + +["CHECKSIG is legal in scriptSigs"], +[[["ccf7f4053a02e653c36ac75c891b7496d0dc5ce5214f6c913d9cf8f1329ebee0", 0, "DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG"]], +"0100000001e0be9e32f1f89c3d916c4f21e55cdcd096741b895cc76ac353e6023a05f4f7cc00000000d86149304602210086e5f736a2c3622ebb62bd9d93d8e5d76508b98be922b97160edc3dcca6d8c47022100b23c312ac232a4473f19d2aeb95ab7bdf2b65518911a0d72d50e38b5dd31dc820121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ac4730440220508fa761865c8abd81244a168392876ee1d94e8ed83897066b5e2df2400dad24022043f5ee7538e87e9c6aef7ef55133d3e51da7cc522830a9c4d736977a76ef755c0121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000", "P2SH"], + +["Same semantics for OP_CODESEPARATOR"], +[[["10c9f0effe83e97f80f067de2b11c6a00c3088a4bce42c5ae761519af9306f3c", 1, "DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG"]], +"01000000013c6f30f99a5161e75a2ce4bca488300ca0c6112bde67f0807fe983feeff0c91001000000e608646561646265656675ab61493046022100ce18d384221a731c993939015e3d1bcebafb16e8c0b5b5d14097ec8177ae6f28022100bcab227af90bab33c3fe0a9abfee03ba976ee25dc6ce542526e9b2e56e14b7f10121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ac493046022100c3b93edcc0fd6250eb32f2dd8a0bba1754b0f6c3be8ed4100ed582f3db73eba2022100bf75b5bd2eff4d6bf2bda2e34a40fcc07d4aa3cf862ceaa77b47b81eff829f9a01ab21038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000", "P2SH"], + +["Signatures are removed from the script they are in by FindAndDelete() in the CHECKSIG code; even multiple instances of one signature can be removed."], +[[["6056ebd549003b10cbbd915cea0d82209fe40b8617104be917a26fa92cbe3d6f", 0, "DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG"]], +"01000000016f3dbe2ca96fa217e94b1017860be49f20820dea5c91bdcb103b0049d5eb566000000000fd1d0147304402203989ac8f9ad36b5d0919d97fa0a7f70c5272abee3b14477dc646288a8b976df5022027d19da84a066af9053ad3d1d7459d171b7e3a80bc6c4ef7a330677a6be548140147304402203989ac8f9ad36b5d0919d97fa0a7f70c5272abee3b14477dc646288a8b976df5022027d19da84a066af9053ad3d1d7459d171b7e3a80bc6c4ef7a330677a6be548140121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ac47304402203757e937ba807e4a5da8534c17f9d121176056406a6465054bdd260457515c1a02200f02eccf1bec0f3a0d65df37889143c2e88ab7acec61a7b6f5aa264139141a2b0121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000", "P2SH"], + +["That also includes ahead of the opcode being executed."], +[[["5a6b0021a6042a686b6b94abc36b387bef9109847774e8b1e51eb8cc55c53921", 1, "DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG"]], +"01000000012139c555ccb81ee5b1e87477840991ef7b386bc3ab946b6b682a04a621006b5a01000000fdb40148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a5800390148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a5800390121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f2204148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a5800390175ac4830450220646b72c35beeec51f4d5bc1cbae01863825750d7f490864af354e6ea4f625e9c022100f04b98432df3a9641719dbced53393022e7249fb59db993af1118539830aab870148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a580039017521038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000", "P2SH"], + +["Finally CHECKMULTISIG removes all signatures prior to hashing the script containing those signatures. In conjunction with the SIGHASH_SINGLE bug this lets us test whether or not FindAndDelete() is actually present in scriptPubKey/redeemScript evaluation by including a signature of the digest 0x01 We can compute in advance for our pubkey, embed it it in the scriptPubKey, and then also using a normal SIGHASH_ALL signature. If FindAndDelete() wasn't run, the 'bugged' signature would still be in the hashed script, and the normal signature would fail."], + +["Here's an example on mainnet within a P2SH redeemScript. Remarkably it's a standard transaction in <0.9"], +[[["b5b598de91787439afd5938116654e0b16b7a0d0f82742ba37564219c5afcbf9", 0, "DUP HASH160 0x14 0xf6f365c40f0739b61de827a44751e5e99032ed8f EQUALVERIFY CHECKSIG"], + ["ab9805c6d57d7070d9a42c5176e47bb705023e6b67249fb6760880548298e742", 0, "HASH160 0x14 0xd8dacdadb7462ae15cd906f1878706d0da8660e6 EQUAL"]], +"0100000002f9cbafc519425637ba4227f8d0a0b7160b4e65168193d5af39747891de98b5b5000000006b4830450221008dd619c563e527c47d9bd53534a770b102e40faa87f61433580e04e271ef2f960220029886434e18122b53d5decd25f1f4acb2480659fea20aabd856987ba3c3907e0121022b78b756e2258af13779c1a1f37ea6800259716ca4b7f0b87610e0bf3ab52a01ffffffff42e7988254800876b69f24676b3e0205b77be476512ca4d970707dd5c60598ab00000000fd260100483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a53034930460221008431bdfa72bc67f9d41fe72e94c88fb8f359ffa30b33c72c121c5a877d922e1002210089ef5fc22dd8bfc6bf9ffdb01a9862d27687d424d1fefbab9e9c7176844a187a014c9052483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303210378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71210378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c7153aeffffffff01a08601000000000017a914d8dacdadb7462ae15cd906f1878706d0da8660e68700000000", "P2SH"], + +["Same idea, but with bare CHECKMULTISIG"], +[[["ceafe58e0f6e7d67c0409fbbf673c84c166e3c5d3c24af58f7175b18df3bb3db", 0, "DUP HASH160 0x14 0xf6f365c40f0739b61de827a44751e5e99032ed8f EQUALVERIFY CHECKSIG"], + ["ceafe58e0f6e7d67c0409fbbf673c84c166e3c5d3c24af58f7175b18df3bb3db", 1, "2 0x48 0x3045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 3 CHECKMULTISIG"]], +"0100000002dbb33bdf185b17f758af243c5d3c6e164cc873f6bb9f40c0677d6e0f8ee5afce000000006b4830450221009627444320dc5ef8d7f68f35010b4c050a6ed0d96b67a84db99fda9c9de58b1e02203e4b4aaa019e012e65d69b487fdf8719df72f488fa91506a80c49a33929f1fd50121022b78b756e2258af13779c1a1f37ea6800259716ca4b7f0b87610e0bf3ab52a01ffffffffdbb33bdf185b17f758af243c5d3c6e164cc873f6bb9f40c0677d6e0f8ee5afce010000009300483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303ffffffff01a0860100000000001976a9149bc0bbdd3024da4d0c38ed1aecf5c68dd1d3fa1288ac00000000", "P2SH"], + + ["Make diffs cleaner by leaving a comment here without comma at the end"] ] From cd01a5e18507c09eb6bbf159418e29c28fd3cadb Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 12 May 2014 12:24:22 +0200 Subject: [PATCH 0049/1288] Enable paranoid corruption checks in LevelDB >= 1.16 --- src/leveldbwrapper.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/leveldbwrapper.cpp b/src/leveldbwrapper.cpp index 5b4a9c147b..9e849696a8 100644 --- a/src/leveldbwrapper.cpp +++ b/src/leveldbwrapper.cpp @@ -32,6 +32,11 @@ static leveldb::Options GetOptions(size_t nCacheSize) { options.filter_policy = leveldb::NewBloomFilterPolicy(10); options.compression = leveldb::kNoCompression; options.max_open_files = 64; + if (leveldb::kMajorVersion > 1 || (leveldb::kMajorVersion == 1 && leveldb::kMinorVersion >= 16)) { + // LevelDB versions before 1.16 consider short writes to be corruption. Only trigger error + // on corruption in later versions. + options.paranoid_checks = true; + } return options; } From 8c93bf4c2857cdc01f0e5efca2becef08d2c5f1e Mon Sep 17 00:00:00 2001 From: Ashley Holman Date: Sun, 11 May 2014 07:05:04 -0500 Subject: [PATCH 0050/1288] LoadBlockIndexDB(): Require block db reindex if any blk*.dat files are missing. --- src/main.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index f90f038016..4b0e3af649 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2941,6 +2941,24 @@ bool static LoadBlockIndexDB() if (pblocktree->ReadBlockFileInfo(nLastBlockFile, infoLastBlockFile)) LogPrintf("LoadBlockIndexDB(): last block file info: %s\n", infoLastBlockFile.ToString()); + // Check presence of blk files + LogPrintf("Checking all blk files are present...\n"); + set setBlkDataFiles; + BOOST_FOREACH(const PAIRTYPE(uint256, CBlockIndex*)& item, mapBlockIndex) + { + CBlockIndex* pindex = item.second; + if (pindex->nStatus & BLOCK_HAVE_DATA) { + setBlkDataFiles.insert(pindex->nFile); + } + } + for (std::set::iterator it = setBlkDataFiles.begin(); it != setBlkDataFiles.end(); it++) + { + CDiskBlockPos pos(*it, 0); + if (!CAutoFile(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION)) { + return false; + } + } + // Check whether we need to continue reindexing bool fReindexing = false; pblocktree->ReadReindexing(fReindexing); From f25e3adf7d158283ef4bc1dd61df940c383dfebe Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Tue, 13 May 2014 01:39:42 -0300 Subject: [PATCH 0051/1288] Fix build in OS X 10.9 --- src/test/bignum.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/bignum.h b/src/test/bignum.h index b57800f372..a75f5250fa 100644 --- a/src/test/bignum.h +++ b/src/test/bignum.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include From 795b921dd22ec133a105404fe1b79c08a021768f Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 13 May 2014 07:06:37 +0200 Subject: [PATCH 0052/1288] qt: periodic language update Pull updated translations from Transifex. Add mn (Mongolian) language. Do not update English translation for now as we want to keep compatibility with 0.9. --- src/qt/Makefile.am | 1 + src/qt/bitcoin.qrc | 1 + src/qt/locale/bitcoin_ach.ts | 12 +- src/qt/locale/bitcoin_af_ZA.ts | 12 +- src/qt/locale/bitcoin_ar.ts | 12 +- src/qt/locale/bitcoin_be_BY.ts | 12 +- src/qt/locale/bitcoin_bg.ts | 12 +- src/qt/locale/bitcoin_bs.ts | 12 +- src/qt/locale/bitcoin_ca.ts | 12 +- src/qt/locale/bitcoin_ca@valencia.ts | 12 +- src/qt/locale/bitcoin_ca_ES.ts | 12 +- src/qt/locale/bitcoin_cmn.ts | 12 +- src/qt/locale/bitcoin_cs.ts | 130 +- src/qt/locale/bitcoin_cy.ts | 12 +- src/qt/locale/bitcoin_da.ts | 20 +- src/qt/locale/bitcoin_de.ts | 12 +- src/qt/locale/bitcoin_el_GR.ts | 12 +- src/qt/locale/bitcoin_eo.ts | 12 +- src/qt/locale/bitcoin_es.ts | 16 +- src/qt/locale/bitcoin_es_CL.ts | 12 +- src/qt/locale/bitcoin_es_DO.ts | 12 +- src/qt/locale/bitcoin_es_MX.ts | 12 +- src/qt/locale/bitcoin_es_UY.ts | 12 +- src/qt/locale/bitcoin_et.ts | 12 +- src/qt/locale/bitcoin_eu_ES.ts | 12 +- src/qt/locale/bitcoin_fa.ts | 12 +- src/qt/locale/bitcoin_fa_IR.ts | 12 +- src/qt/locale/bitcoin_fi.ts | 14 +- src/qt/locale/bitcoin_fr.ts | 14 +- src/qt/locale/bitcoin_fr_CA.ts | 12 +- src/qt/locale/bitcoin_gl.ts | 12 +- src/qt/locale/bitcoin_gu_IN.ts | 12 +- src/qt/locale/bitcoin_he.ts | 12 +- src/qt/locale/bitcoin_hi_IN.ts | 12 +- src/qt/locale/bitcoin_hr.ts | 22 +- src/qt/locale/bitcoin_hu.ts | 12 +- src/qt/locale/bitcoin_id_ID.ts | 12 +- src/qt/locale/bitcoin_it.ts | 15 +- src/qt/locale/bitcoin_ja.ts | 190 +- src/qt/locale/bitcoin_ka.ts | 12 +- src/qt/locale/bitcoin_kk_KZ.ts | 12 +- src/qt/locale/bitcoin_ko_KR.ts | 12 +- src/qt/locale/bitcoin_ky.ts | 12 +- src/qt/locale/bitcoin_la.ts | 12 +- src/qt/locale/bitcoin_lt.ts | 12 +- src/qt/locale/bitcoin_lv_LV.ts | 12 +- src/qt/locale/bitcoin_mn.ts | 3375 ++++++++++++++++++++++++++ src/qt/locale/bitcoin_ms_MY.ts | 12 +- src/qt/locale/bitcoin_nb.ts | 14 +- src/qt/locale/bitcoin_nl.ts | 16 +- src/qt/locale/bitcoin_pam.ts | 12 +- src/qt/locale/bitcoin_pl.ts | 38 +- src/qt/locale/bitcoin_pt_BR.ts | 12 +- src/qt/locale/bitcoin_pt_PT.ts | 12 +- src/qt/locale/bitcoin_ro_RO.ts | 12 +- src/qt/locale/bitcoin_ru.ts | 14 +- src/qt/locale/bitcoin_sah.ts | 12 +- src/qt/locale/bitcoin_sk.ts | 344 +-- src/qt/locale/bitcoin_sl_SI.ts | 12 +- src/qt/locale/bitcoin_sq.ts | 12 +- src/qt/locale/bitcoin_sr.ts | 12 +- src/qt/locale/bitcoin_sv.ts | 14 +- src/qt/locale/bitcoin_th_TH.ts | 12 +- src/qt/locale/bitcoin_tr.ts | 12 +- src/qt/locale/bitcoin_uk.ts | 12 +- src/qt/locale/bitcoin_ur_PK.ts | 12 +- src/qt/locale/bitcoin_uz@Cyrl.ts | 12 +- src/qt/locale/bitcoin_vi.ts | 12 +- src/qt/locale/bitcoin_vi_VN.ts | 12 +- src/qt/locale/bitcoin_zh_CN.ts | 12 +- src/qt/locale/bitcoin_zh_HK.ts | 12 +- src/qt/locale/bitcoin_zh_TW.ts | 12 +- 72 files changed, 4414 insertions(+), 484 deletions(-) create mode 100644 src/qt/locale/bitcoin_mn.ts diff --git a/src/qt/Makefile.am b/src/qt/Makefile.am index 8ec1ae2583..648971bd8f 100644 --- a/src/qt/Makefile.am +++ b/src/qt/Makefile.am @@ -57,6 +57,7 @@ QT_TS = \ locale/bitcoin_la.ts \ locale/bitcoin_lt.ts \ locale/bitcoin_lv_LV.ts \ + locale/bitcoin_mn.ts \ locale/bitcoin_ms_MY.ts \ locale/bitcoin_nb.ts \ locale/bitcoin_nl.ts \ diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index 75078581ce..e1c739b022 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -130,6 +130,7 @@ locale/bitcoin_la.qm locale/bitcoin_lt.qm locale/bitcoin_lv_LV.qm + locale/bitcoin_mn.qm locale/bitcoin_ms_MY.qm locale/bitcoin_nb.qm locale/bitcoin_nl.qm diff --git a/src/qt/locale/bitcoin_ach.ts b/src/qt/locale/bitcoin_ach.ts index cfe916093b..de5619bfc0 100644 --- a/src/qt/locale/bitcoin_ach.ts +++ b/src/qt/locale/bitcoin_ach.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_af_ZA.ts b/src/qt/locale/bitcoin_af_ZA.ts index a1f1abde69..80e4de010f 100644 --- a/src/qt/locale/bitcoin_af_ZA.ts +++ b/src/qt/locale/bitcoin_af_ZA.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_ar.ts b/src/qt/locale/bitcoin_ar.ts index daf09183c4..32b0d4b0fc 100644 --- a/src/qt/locale/bitcoin_ar.ts +++ b/src/qt/locale/bitcoin_ar.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1041,6 +1041,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1343,7 +1351,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_be_BY.ts b/src/qt/locale/bitcoin_be_BY.ts index f7beb808d1..c384aa6d2d 100644 --- a/src/qt/locale/bitcoin_be_BY.ts +++ b/src/qt/locale/bitcoin_be_BY.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1042,6 +1042,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1344,7 +1352,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_bg.ts b/src/qt/locale/bitcoin_bg.ts index 6b94dc8978..367e223784 100644 --- a/src/qt/locale/bitcoin_bg.ts +++ b/src/qt/locale/bitcoin_bg.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1043,6 +1043,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1345,7 +1353,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_bs.ts b/src/qt/locale/bitcoin_bs.ts index 01c37b0278..2ec28af777 100644 --- a/src/qt/locale/bitcoin_bs.ts +++ b/src/qt/locale/bitcoin_bs.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_ca.ts b/src/qt/locale/bitcoin_ca.ts index 592cb337d5..c225967cac 100644 --- a/src/qt/locale/bitcoin_ca.ts +++ b/src/qt/locale/bitcoin_ca.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_ca@valencia.ts b/src/qt/locale/bitcoin_ca@valencia.ts index 053cc82ebb..b36d6b7d67 100644 --- a/src/qt/locale/bitcoin_ca@valencia.ts +++ b/src/qt/locale/bitcoin_ca@valencia.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_ca_ES.ts b/src/qt/locale/bitcoin_ca_ES.ts index f01e48a435..5bf7fbfba7 100644 --- a/src/qt/locale/bitcoin_ca_ES.ts +++ b/src/qt/locale/bitcoin_ca_ES.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_cmn.ts b/src/qt/locale/bitcoin_cmn.ts index 402ce7cb10..696cbedd0a 100644 --- a/src/qt/locale/bitcoin_cmn.ts +++ b/src/qt/locale/bitcoin_cmn.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_cs.ts b/src/qt/locale/bitcoin_cs.ts index f77e7f34db..ba4d2def35 100644 --- a/src/qt/locale/bitcoin_cs.ts +++ b/src/qt/locale/bitcoin_cs.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -333,7 +333,7 @@ Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití v Open Open &URI... - + Načíst &URI... Importing blocks from disk... @@ -433,7 +433,7 @@ Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití v Open Request payments (generates QR codes and bitcoin: URIs) - + Požaduj platby (generuje QR kódy a bitcoin: URI) &About Bitcoin Core @@ -441,15 +441,15 @@ Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití v Open Show the list of used sending addresses and labels - + Ukaž seznam použitých odesílacích adres a jejich označení Show the list of used receiving addresses and labels - + Ukaž seznam použitých přijímacích adres a jejich označení Open a bitcoin: URI or payment request - + Načti bitcoin: URI nebo platební požadavek &Command-line options @@ -457,7 +457,7 @@ Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití v Open Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - Seznam argumentů Bitcoinu pro příkazovou řádku získáš v nápovědě Bitcoinu Core. + Seznam argumentů Bitcoinu pro příkazovou řádku získáš v nápovědě Bitcoinu Core Bitcoin client @@ -497,7 +497,7 @@ Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití v Open %n year(s) - + rok%n roky%n roků %1 behind @@ -579,7 +579,7 @@ Adresa: %4 Quantity: - + Počet: Bytes: @@ -599,11 +599,11 @@ Adresa: %4 Low Output: - + Malý výstup: After Fee: - + Čistá částka: Change: @@ -611,15 +611,15 @@ Adresa: %4 (un)select all - + (od)označit všechny Tree mode - + Zobrazit jako strom List mode - + Vypsat jako seznam Amount @@ -663,15 +663,15 @@ Adresa: %4 Lock unspent - + Zamkni neutracené Unlock unspent - + Odemkni k utracení Copy quantity - + Kopíruj počet Copy fee @@ -679,7 +679,7 @@ Adresa: %4 Copy after fee - + Kopíruj čistou částku Copy bytes @@ -691,7 +691,7 @@ Adresa: %4 Copy low output - + Kopíruj malý výstup Copy change @@ -699,47 +699,47 @@ Adresa: %4 highest - + nejvyšší higher - + vyšší high - + vysoká medium-high - + vyšší střední medium - + střední low-medium - + nižší střední low - + nízká lower - + nižší lowest - + nejnižší (%1 locked) - + (%1 zamčeno) none - + žádná Dust @@ -747,11 +747,11 @@ Adresa: %4 yes - + ano no - + ne This label turns red, if the transaction size is greater than 1000 bytes. @@ -759,11 +759,11 @@ Adresa: %4 This means a fee of at least %1 per kB is required. - + To znamená, že je vyžadován poplatek alespoň %1 za kB. Can vary +/- 1 byte per input. - + Může se lišit o +/– 1 bajt na každý vstup. Transactions with higher priority are more likely to get included into a block. @@ -1047,6 +1047,14 @@ Adresa: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) IP adresa proxy (např. IPv4: 127.0.0.1/IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1181,7 +1189,7 @@ Adresa: %4 none - + žádná Confirm options reset @@ -1189,7 +1197,7 @@ Adresa: %4 Client restart required to activate changes. - + K aktivaci změn je potřeba restartovat klienta. Client will be shutdown, do you want to proceed? @@ -1291,7 +1299,7 @@ Adresa: %4 Payment request fetch URL is invalid: %1 - + Zdrojová URL platebního požadavku není platná: %1 Payment request file handling @@ -1303,7 +1311,7 @@ Adresa: %4 Unverified payment requests to custom payment scripts are unsupported. - + Neověřené platební požadavky k uživatelským platebním skriptům nejsou podporované. Refund from %1 @@ -1349,7 +1357,7 @@ Adresa: %4 Chyba: Neplatná kombinace -regtest a -testnet. - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... Bitcoin Core ještě bezpečně neskončil... @@ -1614,15 +1622,15 @@ Adresa: %4 Copy &URI - + Kopíruj &URI Copy &Address - + Kopíruj &adresu &Save Image... - &Ulož Obrázek... + &Ulož obrázek... Request payment to %1 @@ -1630,7 +1638,7 @@ Adresa: %4 Payment information - + Informace o platbě URI @@ -1712,11 +1720,11 @@ Adresa: %4 Insufficient funds! - + Nedostatek prostředků! Quantity: - + Počet: Bytes: @@ -1736,11 +1744,11 @@ Adresa: %4 Low Output: - + Malý výstup: After Fee: - + Čistá částka: Change: @@ -1792,7 +1800,7 @@ Adresa: %4 Copy quantity - + Kopíruj počet Copy amount @@ -1804,7 +1812,7 @@ Adresa: %4 Copy after fee - + Kopíruj čistou částku Copy bytes @@ -1816,7 +1824,7 @@ Adresa: %4 Copy low output - + Kopíruj malý výstup Copy change @@ -1824,7 +1832,7 @@ Adresa: %4 Total Amount %1 (= %2) - + Celková částka %1 (= %2) or @@ -1876,11 +1884,11 @@ Adresa: %4 added as transaction fee - + přidán jako transakční poplatek Payment request expired - + Platební požadavek vypršel Invalid payment address %1 @@ -1911,7 +1919,7 @@ Adresa: %4 Choose previously used address - + Vyber již použitou adresu This is a normal payment. @@ -1955,7 +1963,7 @@ Adresa: %4 Pay To: - + Komu: Memo: @@ -1993,7 +2001,7 @@ Adresa: %4 Choose previously used address - + Vyber již použitou adresu Alt+A @@ -2823,7 +2831,7 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Connect through SOCKS proxy - + Připojit se přes SOCKS proxy Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) @@ -2831,7 +2839,7 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Connection options: - + Možnosti připojení: Corrupted block database detected @@ -2839,7 +2847,7 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Debugging/Testing options: - + Možnosti ladění/testování: Disable safemode, override a real safe mode event (default: 0) @@ -2851,7 +2859,7 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Do not load the wallet and disable wallet RPC calls - + Nenačítat peněženku a vypnout její RPC volání Do you want to rebuild the block database now? @@ -3035,7 +3043,7 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Wallet options: - + Možnosti peněženky: Warning: Deprecated argument -debugnet ignored, use -debug=net diff --git a/src/qt/locale/bitcoin_cy.ts b/src/qt/locale/bitcoin_cy.ts index b7624f07f2..d2f41739cb 100644 --- a/src/qt/locale/bitcoin_cy.ts +++ b/src/qt/locale/bitcoin_cy.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_da.ts b/src/qt/locale/bitcoin_da.ts index 3d89d2e5c5..442a86b7c0 100644 --- a/src/qt/locale/bitcoin_da.ts +++ b/src/qt/locale/bitcoin_da.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -96,11 +96,11 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Sending addresses - + Afsendelsesadresser Receiving addresses - + Modtagelsesadresser These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. @@ -325,11 +325,11 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open &Sending addresses... - + &Afsendelsesadresser... &Receiving addresses... - + &Modtagelsesadresser... Open &URI... @@ -1047,6 +1047,14 @@ Adresse: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1349,7 +1357,7 @@ Adresse: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_de.ts b/src/qt/locale/bitcoin_de.ts index 7f7e505e1d..888b48c251 100644 --- a/src/qt/locale/bitcoin_de.ts +++ b/src/qt/locale/bitcoin_de.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1046,6 +1046,14 @@ Adresse: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) IP-Adresse des Proxies (z.B. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + Externe URLs (z.B. ein Block-Explorer), die im Kontextmenü des Transaktionsverlaufs eingefügt werden. In der URL wird %s durch den Transaktionshash ersetzt. Bei Angabe mehrerer URLs müssen diese durch "|" voneinander getrennt werden. + + + Third party transaction URLs + Externe Transaktions-URLs + Active command-line options that override above options: Aktive Kommandozeilenoptionen, die obige Konfiguration überschreiben: @@ -1348,7 +1356,7 @@ Adresse: %4 Fehler: Ungültige Kombination von -regtest und -testnet. - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... Bitcoin Core wurde noch nicht sicher beendet... diff --git a/src/qt/locale/bitcoin_el_GR.ts b/src/qt/locale/bitcoin_el_GR.ts index d13b974b8c..687947e3b9 100644 --- a/src/qt/locale/bitcoin_el_GR.ts +++ b/src/qt/locale/bitcoin_el_GR.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1048,6 +1048,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1350,7 +1358,7 @@ Address: %4 Σφάλμα: Άκυρος συνδυασμός των -regtest και -testnet - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_eo.ts b/src/qt/locale/bitcoin_eo.ts index 7f5dc3de2f..8c2869abac 100644 --- a/src/qt/locale/bitcoin_eo.ts +++ b/src/qt/locale/bitcoin_eo.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1047,6 +1047,14 @@ Adreso: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1349,7 +1357,7 @@ Adreso: %4 Eraro: nevalida kunigo de -regtest kaj -testnet - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_es.ts b/src/qt/locale/bitcoin_es.ts index 0bd60be101..8ca8360ef6 100644 --- a/src/qt/locale/bitcoin_es.ts +++ b/src/qt/locale/bitcoin_es.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1050,6 +1050,14 @@ Dirección: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Dirección IP del proxy (p. ej. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: Opciones activas de consola de comandos que tienen preferencia sobre las opciones antes mencionadas: @@ -1352,8 +1360,8 @@ Dirección: %4 Error: Combinación no válida de -regtest y -testnet. - Bitcoin Core did't yet exit safely... - + Bitcoin Core didn't yet exit safely... + Bitcoin core no se ha cerrado de forma segura todavía... Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) @@ -2971,7 +2979,7 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Importing... - + Importando... Incorrect or no genesis block found. Wrong datadir for network? diff --git a/src/qt/locale/bitcoin_es_CL.ts b/src/qt/locale/bitcoin_es_CL.ts index b63743e5d6..758a190f75 100644 --- a/src/qt/locale/bitcoin_es_CL.ts +++ b/src/qt/locale/bitcoin_es_CL.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1050,6 +1050,14 @@ Dirección: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1352,7 +1360,7 @@ Dirección: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_es_DO.ts b/src/qt/locale/bitcoin_es_DO.ts index 6fca831017..6944c3157f 100644 --- a/src/qt/locale/bitcoin_es_DO.ts +++ b/src/qt/locale/bitcoin_es_DO.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1050,6 +1050,14 @@ Dirección: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Dirección IP del proxy (ej. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1352,7 +1360,7 @@ Dirección: %4 Error: Combinación no válida de -regtest y -testnet. - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_es_MX.ts b/src/qt/locale/bitcoin_es_MX.ts index 6920f2300b..9a39551d6b 100644 --- a/src/qt/locale/bitcoin_es_MX.ts +++ b/src/qt/locale/bitcoin_es_MX.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: Activar las opciones de linea de comando que sobre escriben las siguientes opciones: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_es_UY.ts b/src/qt/locale/bitcoin_es_UY.ts index d94ad1c938..03ecce46c0 100644 --- a/src/qt/locale/bitcoin_es_UY.ts +++ b/src/qt/locale/bitcoin_es_UY.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_et.ts b/src/qt/locale/bitcoin_et.ts index 8affc8a5d2..e6c27bf21c 100644 --- a/src/qt/locale/bitcoin_et.ts +++ b/src/qt/locale/bitcoin_et.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1046,6 +1046,14 @@ Aadress: %4⏎ IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1348,7 +1356,7 @@ Aadress: %4⏎ - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_eu_ES.ts b/src/qt/locale/bitcoin_eu_ES.ts index afa4d6c540..1fce25d6da 100644 --- a/src/qt/locale/bitcoin_eu_ES.ts +++ b/src/qt/locale/bitcoin_eu_ES.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_fa.ts b/src/qt/locale/bitcoin_fa.ts index 805c7bb856..0dfbafb811 100644 --- a/src/qt/locale/bitcoin_fa.ts +++ b/src/qt/locale/bitcoin_fa.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1042,6 +1042,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1344,7 +1352,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_fa_IR.ts b/src/qt/locale/bitcoin_fa_IR.ts index 18a0dca224..3b82ffa5e5 100644 --- a/src/qt/locale/bitcoin_fa_IR.ts +++ b/src/qt/locale/bitcoin_fa_IR.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1041,6 +1041,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1343,7 +1351,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_fi.ts b/src/qt/locale/bitcoin_fi.ts index 942dad5411..ece70f6075 100644 --- a/src/qt/locale/bitcoin_fi.ts +++ b/src/qt/locale/bitcoin_fi.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1047,6 +1047,14 @@ Osoite: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) IP osoite proxille (esim. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + Ulkopuoliset URL-osoitteet (esim. block explorer,) jotka esiintyvät siirrot-välilehdellä valikossa. %s URL-osoitteessa korvataan siirtotunnuksella. Useampi URL-osoite on eroteltu pystyviivalla |. + + + Third party transaction URLs + + Active command-line options that override above options: Aktiiviset komentorivivalinnat jotka ohittavat ylläolevat valinnat: @@ -1349,8 +1357,8 @@ Osoite: %4 Virhe: Virheellinen yhdistelmä -regtest ja -testnet. - Bitcoin Core did't yet exit safely... - Bitcoin Core ei vielä sulkeutunut turvallisesti... + Bitcoin Core didn't yet exit safely... + Bitcoin Core ei ole vielä sulkeutunut turvallisesti... Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) diff --git a/src/qt/locale/bitcoin_fr.ts b/src/qt/locale/bitcoin_fr.ts index e0d5bbdbcd..05089f0416 100644 --- a/src/qt/locale/bitcoin_fr.ts +++ b/src/qt/locale/bitcoin_fr.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1047,6 +1047,14 @@ Adresse : %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Adresse IP du mandataire (par ex. IPv4 : 127.0.0.1 / IPv6 : ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + URL de tiers (par ex. un explorateur de blocs) apparaissant dans l'onglet des transactions comme éléments du menu contextuel. %s dans l'URL est remplacé par le hachage de la transaction. Les URL multiples sont séparées par une barre verticale |. + + + Third party transaction URLs + URL de transaction d'un tiers + Active command-line options that override above options: Options actives de ligne de commande qui annulent les options ci-dessus : @@ -1349,8 +1357,8 @@ Adresse : %4 Erreur : combinaison invalide de -regtest et de -testnet. - Bitcoin Core did't yet exit safely... - Bitcoin Core ne s’est pas arrêté correctement... + Bitcoin Core didn't yet exit safely... + Bitcoin Core ne s'est pas encore arrêté en toute sécurité... Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) diff --git a/src/qt/locale/bitcoin_fr_CA.ts b/src/qt/locale/bitcoin_fr_CA.ts index 0df3eb3edd..ff22c2fd1c 100644 --- a/src/qt/locale/bitcoin_fr_CA.ts +++ b/src/qt/locale/bitcoin_fr_CA.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1043,6 +1043,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1345,7 +1353,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_gl.ts b/src/qt/locale/bitcoin_gl.ts index a1ee3545bf..ecf1fa2222 100644 --- a/src/qt/locale/bitcoin_gl.ts +++ b/src/qt/locale/bitcoin_gl.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1047,6 +1047,14 @@ Dirección: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1349,7 +1357,7 @@ Dirección: %4 Erro: combinación inválida de -regtest e -testnet. - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_gu_IN.ts b/src/qt/locale/bitcoin_gu_IN.ts index 66b341545e..ed4a9265e4 100644 --- a/src/qt/locale/bitcoin_gu_IN.ts +++ b/src/qt/locale/bitcoin_gu_IN.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_he.ts b/src/qt/locale/bitcoin_he.ts index 73378535a7..ae13df4524 100644 --- a/src/qt/locale/bitcoin_he.ts +++ b/src/qt/locale/bitcoin_he.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1046,6 +1046,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1348,7 +1356,7 @@ Address: %4 שגיאה: שילוב בלתי חוקי של regtest- ו testnet-. - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_hi_IN.ts b/src/qt/locale/bitcoin_hi_IN.ts index d27e26b871..3ccac8899e 100644 --- a/src/qt/locale/bitcoin_hi_IN.ts +++ b/src/qt/locale/bitcoin_hi_IN.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1042,6 +1042,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1344,7 +1352,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_hr.ts b/src/qt/locale/bitcoin_hr.ts index b5f1595515..bd2b773d2f 100644 --- a/src/qt/locale/bitcoin_hr.ts +++ b/src/qt/locale/bitcoin_hr.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1042,6 +1042,14 @@ Adresa:%4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1196,7 +1204,7 @@ Adresa:%4 The supplied proxy address is invalid. - + Priložena proxy adresa je nevažeća. @@ -1207,7 +1215,7 @@ Adresa:%4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - + Prikazani podatci mogu biti zastarjeli. Vaš novčanik se automatski sinkronizira s Bitcoin mrežom kada je veza uspostavljena, ali taj proces još nije završen. Wallet @@ -1344,7 +1352,7 @@ Adresa:%4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... @@ -1483,7 +1491,7 @@ Adresa:%4 Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - + Kako bi navigirali kroz povijest koristite strelice gore i dolje. <b>Ctrl-L</b> kako bi očistili ekran. Type <b>help</b> for an overview of available commands. @@ -2466,7 +2474,7 @@ Adresa:%4 Show transaction details - + Prikaži detalje transakcije Export Transaction History @@ -2622,7 +2630,7 @@ Adresa:%4 Specify your own public address - + Odaberi vlastitu javnu adresu Threshold for disconnecting misbehaving peers (default: 100) diff --git a/src/qt/locale/bitcoin_hu.ts b/src/qt/locale/bitcoin_hu.ts index de57490847..3d8d45a61d 100644 --- a/src/qt/locale/bitcoin_hu.ts +++ b/src/qt/locale/bitcoin_hu.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1047,6 +1047,14 @@ Cím: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1349,7 +1357,7 @@ Cím: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_id_ID.ts b/src/qt/locale/bitcoin_id_ID.ts index bd92878fed..c4dee5f92d 100644 --- a/src/qt/locale/bitcoin_id_ID.ts +++ b/src/qt/locale/bitcoin_id_ID.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1047,6 +1047,14 @@ Alamat: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Alamat IP proxy (cth. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: pilihan perintah-baris aktif menimpa atas pilihan-pilihan: @@ -1349,7 +1357,7 @@ Alamat: %4 Gagal: Gabungan -regtest dan -testnet salah - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_it.ts b/src/qt/locale/bitcoin_it.ts index b9ef5e4d0b..cb9fed1ab9 100644 --- a/src/qt/locale/bitcoin_it.ts +++ b/src/qt/locale/bitcoin_it.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1048,6 +1048,15 @@ Indirizzo: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Indirizzo IP del proxy (es: IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + URL di terze parti (es: un block explorer) che appaiono nella tabella delle transazioni come voci nel menu contestuale. %s nell'URL è sostituito dall'hash della transazione. +Più URL vengono separati da una barra verticale |. + + + Third party transaction URLs + URL di transazione di terze parti + Active command-line options that override above options: Opzioni command-line attive che sostituiscono i settaggi sopra elencati: @@ -1350,8 +1359,8 @@ Indirizzo: %4 Errore: combinazione di -regtest e -testnet non valida. - Bitcoin Core did't yet exit safely... - Bitcoin Core non è ancora stato chiuso in modo sicuro ... + Bitcoin Core didn't yet exit safely... + Bitcoin Core non si è ancora chiuso con sicurezza... Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) diff --git a/src/qt/locale/bitcoin_ja.ts b/src/qt/locale/bitcoin_ja.ts index c7e4fe6091..5edfc0746a 100644 --- a/src/qt/locale/bitcoin_ja.ts +++ b/src/qt/locale/bitcoin_ja.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -7,7 +7,7 @@ <b>Bitcoin Core</b> version - + <b>ビットコインコア</b> バージョン @@ -29,7 +29,7 @@ MIT/X11 ソフトウェア ライセンスの下で配布されています。 The Bitcoin Core developers - + ビットコインコアの開発者 (%1-bit) @@ -128,7 +128,7 @@ MIT/X11 ソフトウェア ライセンスの下で配布されています。 Exporting Failed - + エクスポート失敗 There was an error trying to save the address list to %1. @@ -273,7 +273,7 @@ MIT/X11 ソフトウェア ライセンスの下で配布されています。 Node - + ノード Show general overview of wallet @@ -325,15 +325,15 @@ MIT/X11 ソフトウェア ライセンスの下で配布されています。 &Sending addresses... - + 送金先アドレス一覧 (&S)... &Receiving addresses... - + 受け取り用アドレス一覧 (&R)... Open &URI... - + URI を開く (&U)... Importing blocks from disk... @@ -437,7 +437,7 @@ MIT/X11 ソフトウェア ライセンスの下で配布されています。 &About Bitcoin Core - + ビットコインコアについて (&A) Show the list of used sending addresses and labels @@ -453,7 +453,7 @@ MIT/X11 ソフトウェア ライセンスの下で配布されています。 &Command-line options - + コマンドラインオプション (&C) Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options @@ -493,11 +493,11 @@ MIT/X11 ソフトウェア ライセンスの下で配布されています。 %1 and %2 - + %1 と %2 %n year(s) - + %n 年 %1 behind @@ -579,11 +579,11 @@ Address: %4 Quantity: - + 数量: Bytes: - + バイト: Amount: @@ -591,11 +591,11 @@ Address: %4 Priority: - + 優先度: Fee: - + 手数料: Low Output: @@ -603,7 +603,7 @@ Address: %4 After Fee: - + 手数料差引後: Change: @@ -615,11 +615,11 @@ Address: %4 Tree mode - + ツリーモード List mode - + リストモード Amount @@ -635,7 +635,7 @@ Address: %4 Confirmations - + 検証数 Confirmed @@ -643,7 +643,7 @@ Address: %4 Priority - + 優先度 Copy address @@ -671,23 +671,23 @@ Address: %4 Copy quantity - + 数量をコピーする Copy fee - + 手数料をコピーする Copy after fee - + 手数料差引後の値をコピーする Copy bytes - + バイト数をコピーする Copy priority - + 優先度をコピーする Copy low output @@ -771,7 +771,7 @@ Address: %4 This label turns red, if the priority is smaller than "medium". - + 優先度が「中」未満の場合には、このラベルは赤くなります。 This label turns red, if any recipient receives an amount smaller than %1. @@ -978,11 +978,11 @@ Address: %4 OpenURIDialog Open URI - + URI を開く Open payment request from URI or file - + URI またはファイルから支払いリクエストを開く URI: @@ -990,11 +990,11 @@ Address: %4 Select payment request file - + 支払いリクエストファイルを選択してください Select payment request file to open - + 開きたい支払いリクエストファイルを選択してください @@ -1025,11 +1025,11 @@ Address: %4 Size of &database cache - + データベースキャッシュのサイズ (&D) MB - + MB Number of script &verification threads @@ -1045,6 +1045,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + プロキシのIPアドレス (例えば IPv4: 127.0.0.1 / IPv6: ::1) + + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs @@ -1069,15 +1077,15 @@ Address: %4 W&allet - + ウォレット (&A) Expert - + エクスポート Enable coin &control features - + コインコントロール機能を有効化する (&C) 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. @@ -1350,7 +1358,7 @@ Address: %4 エラー: -regtestと-testnetは一緒にするのは無効です。 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... @@ -1461,11 +1469,11 @@ Address: %4 In: - + 入力: Out: - + 出力: Build date @@ -1497,31 +1505,31 @@ Address: %4 %1 B - + %1 B %1 KB - + %1 KB %1 MB - + %1 MB %1 GB - + %1 GB %1 m - + %1 m %1 h - + %1 h %1 h %2 m - + %1 h %2 m @@ -1536,7 +1544,7 @@ Address: %4 &Message: - + メッセージ (&M): Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. @@ -1600,7 +1608,7 @@ Address: %4 Copy message - + メッセージをコピーする Copy amount @@ -1615,11 +1623,11 @@ Address: %4 Copy &URI - + URI をコピーする (&U) Copy &Address - + アドレスをコピーする (&A) &Save Image... @@ -1627,7 +1635,7 @@ Address: %4 Request payment to %1 - + %1 への支払いリクエストを行う Payment information @@ -1635,7 +1643,7 @@ Address: %4 URI - + URI Address @@ -1701,27 +1709,27 @@ Address: %4 Coin Control Features - + コインコントロール機能 Inputs... - + 入力... automatically selected - + 自動選択 Insufficient funds! - + 残高不足です! Quantity: - + 数量: Bytes: - + バイト: Amount: @@ -1729,11 +1737,11 @@ Address: %4 Priority: - + 優先度: Fee: - + 手数料: Low Output: @@ -1741,7 +1749,7 @@ Address: %4 After Fee: - + 手数料差引後: Change: @@ -1793,7 +1801,7 @@ Address: %4 Copy quantity - + 数量をコピーする Copy amount @@ -1801,19 +1809,19 @@ Address: %4 Copy fee - + 手数料をコピーする Copy after fee - + 手数料差引後の値をコピーする Copy bytes - + バイト数をコピーする Copy priority - + 優先度をコピーする Copy low output @@ -1956,7 +1964,7 @@ Address: %4 Pay To: - + 支払先: Memo: @@ -2125,7 +2133,7 @@ Address: %4 The Bitcoin Core developers - + ビットコインコアの開発者 [testnet] @@ -2136,7 +2144,7 @@ Address: %4 TrafficGraphWidget KB/s - + KB/s @@ -2333,11 +2341,11 @@ Address: %4 Offline - + オフライン Unconfirmed - + 未検証 Confirming (%1 of %2 recommended confirmations) @@ -2476,19 +2484,19 @@ Address: %4 Export Transaction History - + トランザクション履歴をエクスポートする Exporting Failed - + エクスポートに失敗しました There was an error trying to save the transaction history to %1. - + トランザクション履歴を %1 へ保存する際にエラーが発生しました。 Exporting Successful - + エクスポートに成功しました The transaction history was successfully saved to %1. @@ -2652,7 +2660,7 @@ Address: %4 Bitcoin Core RPC client version - + ビットコインコアRPCクライアントのバージョン Run in the background as a daemon and accept commands @@ -2791,11 +2799,11 @@ rpcpassword=%s (default: 1) - + (デフォルト: 1) (default: wallet.dat) - + (デフォルト: wallet.dat) <category> can be: @@ -2823,7 +2831,7 @@ rpcpassword=%s Connect through SOCKS proxy - + SOCKS プロキシ経由で接続する Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) @@ -2840,7 +2848,7 @@ rpcpassword=%s Debugging/Testing options: - + デバッグ/テスト用オプション: Disable safemode, override a real safe mode event (default: 0) @@ -2932,11 +2940,11 @@ rpcpassword=%s Fee per kB to add to transactions you send - + 送信するトランザクションの1kBあたりの手数料 Fees smaller than this are considered zero fee (for relaying) (default: - + この値未満の (中継) 手数料はゼロであるとみなす (デフォルト: Find peers using DNS lookup (default: 1 unless -connect) @@ -2944,7 +2952,7 @@ rpcpassword=%s Force safe mode (default: 0) - + セーフモードを矯正する (デフォルト: 0) Generate coins (default: 0) @@ -2956,7 +2964,7 @@ rpcpassword=%s If <category> is not supplied, output all debugging information. - + <category> が与えられなかった場合には、すべてのデバッグ情報が出力されます。 Importing... @@ -2980,7 +2988,7 @@ rpcpassword=%s RPC client options: - + RPC クライアントのオプション: Rebuild block chain index from current blk000??.dat files @@ -3028,7 +3036,7 @@ rpcpassword=%s Wait for RPC server to start - + RPC サーバが開始するのを待つ Wallet %s resides outside data directory %s @@ -3040,7 +3048,7 @@ rpcpassword=%s Warning: Deprecated argument -debugnet ignored, use -debug=net - + 警告: 非推奨の引数 -debugnet は無視されました。-debug=net を使用してください You need to rebuild the database using -reindex to change -txindex @@ -3080,11 +3088,11 @@ rpcpassword=%s Limit size of signature cache to <n> entries (default: 50000) - + 署名キャッシュのサイズを <n> エントリーに制限する (デフォルト: 50000) Log transaction priority and fee per kB when mining blocks (default: 0) - + ブロックの採掘時にトランザクションの優先度と1kBあたりの手数料をログに残す (デフォルト: 0) Maintain a full transaction index (default: 0) @@ -3116,11 +3124,11 @@ rpcpassword=%s RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - + RPC SSL オプション: (SSLのセットアップ手順はビットコインWikiを参照してください) RPC server options: - + RPCサーバのオプション: Randomly drop 1 of every <n> network messages diff --git a/src/qt/locale/bitcoin_ka.ts b/src/qt/locale/bitcoin_ka.ts index fd14152b04..fda2e97037 100644 --- a/src/qt/locale/bitcoin_ka.ts +++ b/src/qt/locale/bitcoin_ka.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1047,6 +1047,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) პროქსის IP-მისამართი (მაგ.: IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: საკომანდო სტრიქონის აქტიური ოპციები, რომლებიც გადაფარავენ ზემოთნაჩვენებს: @@ -1349,7 +1357,7 @@ Address: %4 შეცდომა: -regtest-ისა და -testnet-ის დაუშვებელი კომბინაცია. - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_kk_KZ.ts b/src/qt/locale/bitcoin_kk_KZ.ts index e35055ebd1..b913ba9858 100644 --- a/src/qt/locale/bitcoin_kk_KZ.ts +++ b/src/qt/locale/bitcoin_kk_KZ.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_ko_KR.ts b/src/qt/locale/bitcoin_ko_KR.ts index c1584600cf..f5d2dddbe4 100644 --- a/src/qt/locale/bitcoin_ko_KR.ts +++ b/src/qt/locale/bitcoin_ko_KR.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1047,6 +1047,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) 프록시 아이피 주소(예. IPv4:127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1349,7 +1357,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_ky.ts b/src/qt/locale/bitcoin_ky.ts index 375e72d359..d0db034e86 100644 --- a/src/qt/locale/bitcoin_ky.ts +++ b/src/qt/locale/bitcoin_ky.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_la.ts b/src/qt/locale/bitcoin_la.ts index 89f4be8202..425519514a 100644 --- a/src/qt/locale/bitcoin_la.ts +++ b/src/qt/locale/bitcoin_la.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1046,6 +1046,14 @@ Inscriptio: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1348,7 +1356,7 @@ Inscriptio: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_lt.ts b/src/qt/locale/bitcoin_lt.ts index 103cd5f53d..a9898adb2b 100644 --- a/src/qt/locale/bitcoin_lt.ts +++ b/src/qt/locale/bitcoin_lt.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1045,6 +1045,14 @@ Adresas: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1347,7 +1355,7 @@ Adresas: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_lv_LV.ts b/src/qt/locale/bitcoin_lv_LV.ts index 0db0b77a47..c17f65e125 100644 --- a/src/qt/locale/bitcoin_lv_LV.ts +++ b/src/qt/locale/bitcoin_lv_LV.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1042,6 +1042,14 @@ Adrese: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1344,7 +1352,7 @@ Adrese: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_mn.ts b/src/qt/locale/bitcoin_mn.ts new file mode 100644 index 0000000000..e765931b2c --- /dev/null +++ b/src/qt/locale/bitcoin_mn.ts @@ -0,0 +1,3375 @@ + + + AboutDialog + + About Bitcoin Core + + + + <b>Bitcoin Core</b> version + + + + +This is experimental software. + +Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. + +This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. + + + + Copyright + + + + The Bitcoin Core developers + + + + (%1-bit) + + + + + AddressBookPage + + Double-click to edit address or label + Хаяг эсвэл шошгыг ѳѳрчлѳхийн тулд хоёр удаа дар + + + Create a new address + Шинэ хаяг нээх + + + &New + + + + Copy the currently selected address to the system clipboard + Одоогоор сонгогдсон байгаа хаягуудыг сануулах + + + &Copy + + + + C&lose + + + + &Copy Address + Хаягийг &Хуулбарлах + + + Delete the currently selected address from the list + + + + Export the data in the current tab to a file + + + + &Export + + + + &Delete + &Устгах + + + Choose the address to send coins to + + + + Choose the address to receive coins with + + + + C&hoose + + + + Sending addresses + + + + Receiving addresses + + + + These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. + + + + These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. + + + + Copy &Label + &Шошгыг хуулбарлах + + + &Edit + &Ѳѳрчлѳх + + + Export Address List + + + + Comma separated file (*.csv) + Таслалаар тусгаарлагдсан хүснэгтэн файл (.csv) + + + Exporting Failed + + + + There was an error trying to save the address list to %1. + + + + + AddressTableModel + + Label + Шошго + + + Address + Хаяг + + + (no label) + (шошго алга) + + + + AskPassphraseDialog + + Passphrase Dialog + + + + Enter passphrase + Нууц үгийг оруул + + + New passphrase + Шинэ нууц үг + + + Repeat new passphrase + Шинэ нууц үгийг давтана уу + + + Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. + Түрүйвчийн шинэ нууц үгийг оруул. <br/><b>Дор хаяж 10 дурын үсэг/тоо бүхий</b> эсвэл <b>дор хаяж 8 дурын үгнээс бүрдсэн</b> нууц үгийг ашиглана уу. + + + Encrypt wallet + Түрүйвчийг цоожлох + + + This operation needs your wallet passphrase to unlock the wallet. + Энэ үйлдэлийг гүйцэтгэхийн тулд та нууц үгээрээ түрүйвчийн цоожийг тайлах хэрэгтэй + + + Unlock wallet + Түрүйвчийн цоожийг тайлах + + + This operation needs your wallet passphrase to decrypt the wallet. + Энэ үйлдэлийг гүйцэтгэхийн тулд та эхлээд түрүйвчийн нууц үгийг оруулж цоожийг тайлах шаардлагтай. + + + Decrypt wallet + Түрүйвчийн цоожийг устгах + + + Change passphrase + Нууц үгийг солих + + + Enter the old and new passphrase to the wallet. + Түрүйвчийн хуучин болоод шинэ нууц үгсийг оруулна уу + + + Confirm wallet encryption + Түрүйвчийн цоожийг баталгаажуулах + + + Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! + + + + Are you sure you wish to encrypt your wallet? + + + + 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. + + + + Warning: The Caps Lock key is on! + + + + Wallet encrypted + Түрүйвч цоожлогдлоо + + + Bitcoin 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. + Цоожлолтын процесыг дуусгахын тулд Биткойн одоо хаагдана. Ѳѳрийн түрүйвчийг цоожлох нь таны биткойнуудыг компьютерийн вирус хулгайлахаас бүрэн сэргийлж чадахгүй гэдгийг санаарай. + + + Wallet encryption failed + Түрүйвчийн цоожлол амжилттай болсонгүй + + + Wallet encryption failed due to an internal error. Your wallet was not encrypted. + Түрүйвчийн цоожлол дотоод алдаанаас үүдэн амжилттай болсонгүй. Түрүйвч цоожлогдоогүй байна. + + + The supplied passphrases do not match. + Таны оруулсан нууц үг таарсангүй + + + Wallet unlock failed + Түрүйвчийн цоож тайлагдсангүй + + + The passphrase entered for the wallet decryption was incorrect. + Таны оруулсан түрүйвчийн цоожийг тайлах нууц үг буруу байна + + + Wallet decryption failed + Түрүйвчийн цоож амжилттай устгагдсангүй + + + Wallet passphrase was successfully changed. + Түрүйвчийн нууц үг амжилттай ѳѳр + + + + BitcoinGUI + + Sign &message... + &Зурвас хавсаргах... + + + Synchronizing with network... + Сүлжээтэй тааруулж байна... + + + &Overview + + + + Node + Нод + + + Show general overview of wallet + + + + &Transactions + Гүйлгээнүүд + + + Browse transaction history + Гүйлгээнүүдийн түүхийг харах + + + E&xit + Гарах + + + Quit application + Програмаас Гарах + + + Show information about Bitcoin + Биткойны мэдээллийг харуулах + + + About &Qt + &Клиентийн тухай + + + Show information about Qt + Клиентийн тухай мэдээллийг харуул + + + &Options... + &Сонголтууд... + + + &Encrypt Wallet... + &Түрүйвчийг цоожлох... + + + &Backup Wallet... + &Түрүйвчийг Жоорлох... + + + &Change Passphrase... + &Нууц Үгийг Солих... + + + &Sending addresses... + + + + &Receiving addresses... + + + + Open &URI... + + + + Importing blocks from disk... + + + + Reindexing blocks on disk... + + + + Send coins to a Bitcoin address + + + + Modify configuration options for Bitcoin + + + + Backup wallet to another location + + + + Change the passphrase used for wallet encryption + Түрүйвчийг цоожлох нууц үгийг солих + + + &Debug window + + + + Open debugging and diagnostic console + Оношилгоо ба засварын консолыг онгойлго + + + &Verify message... + + + + Bitcoin + Биткойн + + + Wallet + Түрүйвч + + + &Send + + + + &Receive + + + + &Show / Hide + &Харуул / Нуу + + + Show or hide the main Window + + + + Encrypt the private keys that belong to your wallet + + + + Sign messages with your Bitcoin addresses to prove you own them + + + + Verify messages to ensure they were signed with specified Bitcoin addresses + + + + &File + &Файл + + + &Settings + &Тохиргоо + + + &Help + &Тусламж + + + Tabs toolbar + + + + [testnet] + + + + Bitcoin Core + + + + Request payments (generates QR codes and bitcoin: URIs) + + + + &About Bitcoin Core + + + + Show the list of used sending addresses and labels + + + + Show the list of used receiving addresses and labels + + + + Open a bitcoin: URI or payment request + + + + &Command-line options + + + + Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options + + + + Bitcoin client + Биткойн клиент + + + %n active connection(s) to Bitcoin network + Биткойны сүлжээрүү %n идэвхитэй холболт байна Биткойны сүлжээрүү %n идэвхитэй холболтууд байна + + + No block source available... + + + + Processed %1 of %2 (estimated) blocks of transaction history. + + + + Processed %1 blocks of transaction history. + + + + %n hour(s) + %n цаг%n цаг + + + %n day(s) + %n ѳдѳр%n ѳдрүүд + + + %n week(s) + + + + %1 and %2 + + + + %n year(s) + + + + %1 behind + + + + Last received block was generated %1 ago. + + + + Transactions after this will not yet be visible. + + + + Error + Алдаа + + + Warning + + + + Information + + + + Up to date + Шинэчлэгдсэн + + + Catching up... + + + + Sent transaction + Гадагшаа гүйлгээ + + + Incoming transaction + Дотогшоо гүйлгээ + + + Date: %1 +Amount: %2 +Type: %3 +Address: %4 + + Огноо: %1 + +Хэмжээ: %2 + +Тѳрѳл: %3 + +Хаяг: %4 + + + + Wallet is <b>encrypted</b> and currently <b>unlocked</b> + Түрүйвч <b>цоожтой</b> ба одоогоор цоож <b>онгорхой</b> байна + + + Wallet is <b>encrypted</b> and currently <b>locked</b> + Түрүйвч <b>цоожтой</b> ба одоогоор цоож <b>хаалттай</b> байна + + + A fatal error occurred. Bitcoin can no longer continue safely and will quit. + + + + + ClientModel + + Network Alert + + + + + CoinControlDialog + + Coin Control Address Selection + + + + Quantity: + + + + Bytes: + + + + Amount: + Хэмжээ: + + + Priority: + + + + Fee: + Тѳлбѳр: + + + Low Output: + + + + After Fee: + + + + Change: + + + + (un)select all + + + + Tree mode + + + + List mode + + + + Amount + Хэмжээ + + + Address + Хаяг + + + Date + Огноо + + + Confirmations + + + + Confirmed + Баталгаажлаа + + + Priority + + + + Copy address + Хаягийг санах + + + Copy label + Шошгыг санах + + + Copy amount + Хэмжээг санах + + + Copy transaction ID + + + + Lock unspent + + + + Unlock unspent + + + + Copy quantity + + + + Copy fee + + + + Copy after fee + + + + Copy bytes + + + + Copy priority + + + + Copy low output + + + + Copy change + Ѳѳрчлѳлтийг санах + + + highest + + + + higher + + + + high + + + + medium-high + + + + medium + + + + low-medium + + + + low + + + + lower + + + + lowest + + + + (%1 locked) + + + + none + + + + Dust + + + + yes + + + + no + + + + This label turns red, if the transaction size is greater than 1000 bytes. + + + + This means a fee of at least %1 per kB is required. + + + + Can vary +/- 1 byte per input. + + + + Transactions with higher priority are more likely to get included into a block. + + + + This label turns red, if the priority is smaller than "medium". + + + + This label turns red, if any recipient receives an amount smaller than %1. + + + + This means a fee of at least %1 is required. + + + + Amounts below 0.546 times the minimum relay fee are shown as dust. + + + + This label turns red, if the change is smaller than %1. + + + + (no label) + (шошгогүй) + + + change from %1 (%2) + + + + (change) + (ѳѳрчлѳх) + + + + EditAddressDialog + + Edit Address + Хаягийг ѳѳрчлѳх + + + &Label + &Шошго + + + The label associated with this address list entry + + + + The address associated with this address list entry. This can only be modified for sending addresses. + + + + &Address + &Хаяг + + + New receiving address + Шинэ хүлээн авах хаяг + + + New sending address + Шинэ явуулах хаяг + + + Edit receiving address + Хүлээн авах хаягийг ѳѳрчлѳх + + + Edit sending address + Явуулах хаягийг ѳѳрчлѳх + + + The entered address "%1" is already in the address book. + Таны оруулсан хаяг "%1" нь хаягийн бүртгэлд ѳмнѳ нь орсон байна + + + The entered address "%1" is not a valid Bitcoin address. + + + + Could not unlock wallet. + Түрүйвчийн цоожийг тайлж чадсангүй + + + New key generation failed. + Шинэ түлхүүр амжилттай гарсангүй + + + + FreespaceChecker + + A new data directory will be created. + + + + name + + + + Directory already exists. Add %1 if you intend to create a new directory here. + + + + Path already exists, and is not a directory. + + + + Cannot create data directory here. + + + + + HelpMessageDialog + + Bitcoin Core - Command-line options + + + + Bitcoin Core + + + + version + хувилбар + + + Usage: + Хэрэглээ: + + + command-line options + + + + UI options + + + + Set language, for example "de_DE" (default: system locale) + + + + Start minimized + + + + Set SSL root certificates for payment request (default: -system-) + + + + Show splash screen on startup (default: 1) + + + + Choose data directory on startup (default: 0) + + + + + Intro + + Welcome + + + + Welcome to Bitcoin Core. + + + + As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. + + + + Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. + + + + Use the default data directory + + + + Use a custom data directory: + + + + Bitcoin + Биткойн + + + Error: Specified data directory "%1" can not be created. + + + + Error + Алдаа + + + GB of free space available + + + + (of %1GB needed) + + + + + OpenURIDialog + + Open URI + + + + Open payment request from URI or file + + + + URI: + + + + Select payment request file + + + + Select payment request file to open + + + + + OptionsDialog + + Options + Сонголтууд + + + &Main + + + + Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. + + + + Pay transaction &fee + + + + Automatically start Bitcoin after logging in to the system. + + + + &Start Bitcoin on system login + + + + Size of &database cache + + + + MB + МБ + + + Number of script &verification threads + + + + Connect to the Bitcoin network through a SOCKS proxy. + Биткойны сүлжээрүү SOCKS проксигоор холбогдох. + + + &Connect through SOCKS proxy (default proxy): + + + + IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + проксигийн IP хаяг (жишээ нь: IPv4: 127.0.0.1 / IPv6: ::1) + + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + + + Active command-line options that override above options: + + + + Reset all client options to default. + + + + &Reset Options + + + + &Network + + + + (0 = auto, <0 = leave that many cores free) + + + + W&allet + + + + Expert + + + + Enable coin &control features + + + + 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. + + + + &Spend unconfirmed change + + + + Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. + + + + Map port using &UPnP + + + + Proxy &IP: + + + + &Port: + + + + Port of the proxy (e.g. 9050) + + + + SOCKS &Version: + + + + SOCKS version of the proxy (e.g. 5) + + + + &Window + + + + Show only a tray icon after minimizing the window. + + + + &Minimize to the tray instead of the taskbar + + + + Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. + + + + M&inimize on close + + + + &Display + + + + User Interface &language: + + + + The user interface language can be set here. This setting will take effect after restarting Bitcoin. + + + + &Unit to show amounts in: + + + + Choose the default subdivision unit to show in the interface and when sending coins. + + + + Whether to show Bitcoin addresses in the transaction list or not. + + + + &Display addresses in transaction list + + + + Whether to show coin control features or not. + + + + &OK + + + + &Cancel + + + + default + + + + none + + + + Confirm options reset + + + + Client restart required to activate changes. + Ѳѳрчлѳлтүүдийг идэвхижүүлхийн тулд клиентийг ахин эхлүүлэх шаардлагтай + + + Client will be shutdown, do you want to proceed? + Клиент унтрах гэж байна, яг унтраах уу? + + + This change would require a client restart. + Энэ ѳѳрчлѳлтийг оруулахын тулд кли1нт програмыг ахин эхлүүлэх шаардлагтай + + + The supplied proxy address is invalid. + + + + + OverviewPage + + Form + + + + The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. + + + + Wallet + Түрүйвч + + + Available: + Хэрэглэж болох хэмжээ: + + + Your current spendable balance + + + + Pending: + + + + Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance + + + + Immature: + + + + Mined balance that has not yet matured + + + + Total: + + + + Your current total balance + + + + <b>Recent transactions</b> + <b>Сүүлд хийгдсэн гүйлгээнүүд</b> + + + out of sync + + + + + PaymentServer + + URI handling + + + + URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + + + + Requested payment amount of %1 is too small (considered dust). + + + + Payment request error + + + + Cannot start bitcoin: click-to-pay handler + + + + Net manager warning + + + + Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. + + + + Payment request fetch URL is invalid: %1 + + + + Payment request file handling + + + + Payment request file can not be read or processed! This can be caused by an invalid payment request file. + + + + Unverified payment requests to custom payment scripts are unsupported. + + + + Refund from %1 + + + + Error communicating with %1: %2 + + + + Payment request can not be parsed or processed! + + + + Bad response from server %1 + + + + Payment acknowledged + + + + Network request error + + + + + QObject + + Bitcoin + Биткойн + + + Error: Specified data directory "%1" does not exist. + + + + Error: Cannot parse configuration file: %1. Only use key=value syntax. + + + + Error: Invalid combination of -regtest and -testnet. + + + + Bitcoin Core didn't yet exit safely... + + + + Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + + + + + QRImageWidget + + &Save Image... + + + + &Copy Image + + + + Save QR Code + + + + PNG Image (*.png) + PNG форматын зураг (*.png) + + + + RPCConsole + + Client name + Клиентийн нэр + + + N/A + Алга Байна + + + Client version + Клиентийн хувилбар + + + &Information + &Мэдээллэл + + + Debug window + + + + General + Ерѳнхий + + + Using OpenSSL version + + + + Startup time + + + + Network + Сүлжээ + + + Name + Нэр + + + Number of connections + Холболтын тоо + + + Block chain + Блокийн цуваа + + + Current number of blocks + Одоогийн блокийн тоо + + + Estimated total blocks + Нийт блокийн барагцаа + + + Last block time + Сүүлийн блокийн хугацаа + + + &Open + &Нээх + + + &Console + &Консол + + + &Network Traffic + + + + &Clear + + + + Totals + + + + In: + + + + Out: + + + + Build date + + + + Debug log file + + + + Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. + + + + Clear console + Консолыг цэвэрлэх + + + Welcome to the Bitcoin RPC console. + + + + Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. + + + + Type <b>help</b> for an overview of available commands. + + + + %1 B + + + + %1 KB + + + + %1 MB + + + + %1 GB + + + + %1 m + + + + %1 h + + + + %1 h %2 m + + + + + ReceiveCoinsDialog + + &Amount: + + + + &Label: + &Шошго: + + + &Message: + + + + Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. + + + + R&euse an existing receiving address (not recommended) + + + + An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. + + + + An optional label to associate with the new receiving address. + + + + Use this form to request payments. All fields are <b>optional</b>. + + + + An optional amount to request. Leave this empty or zero to not request a specific amount. + + + + Clear all fields of the form. + + + + Clear + + + + Requested payments history + + + + &Request payment + + + + Show the selected request (does the same as double clicking an entry) + + + + Show + Харуул + + + Remove the selected entries from the list + Сонгогдсон ѳгѳгдлүүдийг устгах + + + Remove + Устгах + + + Copy label + Шошгыг санах + + + Copy message + Зурвасыг санах + + + Copy amount + Хэмжээг санах + + + + ReceiveRequestDialog + + QR Code + + + + Copy &URI + + + + Copy &Address + + + + &Save Image... + + + + Request payment to %1 + + + + Payment information + + + + URI + + + + Address + Хаяг + + + Amount + Хэмжээ + + + Label + Шошго + + + Message + Зурвас + + + Resulting URI too long, try to reduce the text for label / message. + + + + Error encoding URI into QR Code. + + + + + RecentRequestsTableModel + + Date + Огноо + + + Label + Шошго + + + Message + Зурвас + + + Amount + Хэмжээ + + + (no label) + (шошго алга) + + + (no message) + (зурвас алга) + + + (no amount) + + + + + SendCoinsDialog + + Send Coins + Зоос явуулах + + + Coin Control Features + + + + Inputs... + + + + automatically selected + автоматаар сонгогдсон + + + Insufficient funds! + Таны дансны үлдэгдэл хүрэлцэхгүй байна! + + + Quantity: + + + + Bytes: + + + + Amount: + Хэмжээ: + + + Priority: + + + + Fee: + Тѳлбѳр: + + + Low Output: + + + + After Fee: + + + + Change: + + + + If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. + + + + Custom change address + + + + Send to multiple recipients at once + Нэгэн зэрэг олон хүлээн авагчруу явуулах + + + Add &Recipient + &Хүлээн авагчийг Нэмэх + + + Clear all fields of the form. + + + + Clear &All + &Бүгдийг Цэвэрлэ + + + Balance: + Баланс: + + + Confirm the send action + Явуулах үйлдлийг баталгаажуулна уу + + + S&end + Яв&уул + + + Confirm send coins + Зоос явуулахыг баталгаажуулна уу + + + %1 to %2 + + + + Copy quantity + + + + Copy amount + Хэмжээг санах + + + Copy fee + + + + Copy after fee + + + + Copy bytes + + + + Copy priority + + + + Copy low output + + + + Copy change + Ѳѳрчлѳлтийг санах + + + Total Amount %1 (= %2) + Нийт дүн %1 (= %2) + + + or + эсвэл + + + The recipient address is not valid, please recheck. + + + + The amount to pay must be larger than 0. + Тѳлѳх хэмжээ 0.-оос их байх ёстой + + + The amount exceeds your balance. + Энэ хэмжээ таны балансаас хэтэрсэн байна. + + + The total exceeds your balance when the %1 transaction fee is included. + Гүйлгээний тѳлбѳр %1-ийг тооцхоор нийт дүн нь таны балансаас хэтрээд байна. + + + Duplicate address found, can only send to each address once per send operation. + + + + Transaction creation failed! + + + + The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. + + + + Warning: Invalid Bitcoin address + Анхаар:Буруу Биткойны хаяг байна + + + (no label) + (шошгогүй) + + + Warning: Unknown change address + + + + Are you sure you want to send? + + + + added as transaction fee + + + + Payment request expired + + + + Invalid payment address %1 + + + + + SendCoinsEntry + + A&mount: + Дүн: + + + Pay &To: + Тѳлѳх &хаяг: + + + The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + + + + Enter a label for this address to add it to your address book + Энэ хаягийг ѳѳрийн бүртгэлдээ авахын тулд шошго оруул + + + &Label: + &Шошго: + + + Choose previously used address + + + + This is a normal payment. + + + + Alt+A + Alt+A + + + Paste address from clipboard + Копидсон хаягийг буулгах + + + Alt+P + Alt+P + + + Remove this entry + + + + Message: + Зурвас: + + + This is a verified payment request. + + + + Enter a label for this address to add it to the list of used addresses + + + + A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. + + + + This is an unverified payment request. + + + + Pay To: + + + + Memo: + + + + + ShutdownWindow + + Bitcoin Core is shutting down... + Биткойны цѳм хаагдаж байна... + + + Do not shut down the computer until this window disappears. + Энэ цонхыг хаагдтал компьютерээ бүү унтраагаарай + + + + SignVerifyMessageDialog + + Signatures - Sign / Verify a Message + + + + &Sign Message + + + + You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. + + + + The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + + + + Choose previously used address + + + + Alt+A + Alt+A + + + Paste address from clipboard + Копидсон хаягийг буулгах + + + Alt+P + Alt+P + + + Enter the message you want to sign here + + + + Signature + + + + Copy the current signature to the system clipboard + + + + Sign the message to prove you own this Bitcoin address + + + + Sign &Message + + + + Reset all sign message fields + + + + Clear &All + &Бүгдийг Цэвэрлэ + + + &Verify Message + + + + Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. + + + + The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + + + + Verify the message to ensure it was signed with the specified Bitcoin address + + + + Verify &Message + + + + Reset all verify message fields + + + + Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + + + + Click "Sign Message" to generate signature + + + + The entered address is invalid. + + + + Please check the address and try again. + + + + The entered address does not refer to a key. + + + + Wallet unlock was cancelled. + + + + Private key for the entered address is not available. + + + + Message signing failed. + + + + Message signed. + + + + The signature could not be decoded. + + + + Please check the signature and try again. + + + + The signature did not match the message digest. + + + + Message verification failed. + + + + Message verified. + + + + + SplashScreen + + Bitcoin Core + + + + The Bitcoin Core developers + + + + [testnet] + + + + + TrafficGraphWidget + + KB/s + + + + + TransactionDesc + + Open until %1 + %1 хүртэл нээлттэй + + + conflicted + зѳрчилдлѳѳ + + + %1/offline + + + + %1/unconfirmed + %1/баталгаажаагүй + + + %1 confirmations + %1 баталгаажилтууд + + + Status + + + + , broadcast through %n node(s) + + + + Date + Огноо + + + Source + + + + Generated + + + + From + + + + To + + + + own address + + + + label + + + + Credit + + + + matures in %n more block(s) + + + + not accepted + + + + Debit + + + + Transaction fee + + + + Net amount + + + + Message + Зурвас + + + Comment + + + + Transaction ID + + + + Merchant + + + + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + + + + Debug information + + + + Transaction + + + + Inputs + + + + Amount + Хэмжээ + + + true + + + + false + + + + , has not been successfully broadcast yet + , хараахан амжилттай цацагдаагүй байна + + + Open for %n more block(s) + + + + unknown + үл мэдэгдэх + + + + TransactionDescDialog + + Transaction details + Гүйлгээний мэдээллэл + + + This pane shows a detailed description of the transaction + Гүйлгээний дэлгэрэнгүйг энэ бичил цонх харуулж байна + + + + TransactionTableModel + + Date + Огноо + + + Type + Тѳрѳл + + + Address + Хаяг + + + Amount + Хэмжээ + + + Immature (%1 confirmations, will be available after %2) + + + + Open for %n more block(s) + + + + Open until %1 + %1 хүртэл нээлттэй + + + Confirmed (%1 confirmations) + Баталгаажлаа (%1 баталгаажилт) + + + This block was not received by any other nodes and will probably not be accepted! + Энэ блокийг аль ч нод хүлээн авсангүй ба ер нь зѳвшѳѳрѳгдѳхгүй байж мэднэ! + + + Generated but not accepted + Үүсгэгдсэн гэхдээ хүлээн авагдаагүй + + + Offline + + + + Unconfirmed + Баталгаажаагүй + + + Confirming (%1 of %2 recommended confirmations) + + + + Conflicted + Зѳрчилдлѳѳ + + + Received with + Хүлээн авсан хаяг + + + Received from + Хүлээн авагдсан хаяг + + + Sent to + Явуулсан хаяг + + + Payment to yourself + Ѳѳрлүүгээ хийсэн тѳлбѳр + + + Mined + Олборлогдсон + + + (n/a) + (алга байна) + + + Transaction status. Hover over this field to show number of confirmations. + Гүйлгээний байдал. Энд хулганыг авчирч баталгаажуулалтын тоог харна уу. + + + Date and time that the transaction was received. + Гүйлгээг хүлээн авсан огноо ба цаг. + + + Type of transaction. + Гүйлгээний тѳрѳл + + + Destination address of transaction. + Гүйлгээг хүлээн авах хаяг + + + Amount removed from or added to balance. + Балансаас авагдсан болон нэмэгдсэн хэмжээ. + + + + TransactionView + + All + Бүгд + + + Today + Ѳнѳѳдѳр + + + This week + Энэ долоо хоног + + + This month + Энэ сар + + + Last month + Ѳнгѳрсѳн сар + + + This year + Энэ жил + + + Range... + + + + Received with + Хүлээн авсан хаяг + + + Sent to + Явуулсан хаяг + + + To yourself + Ѳѳрлүүгээ + + + Mined + Олборлогдсон + + + Other + Бусад + + + Enter address or label to search + Хайлт хийхийн тулд хаяг эсвэл шошгыг оруул + + + Min amount + Хамгийн бага хэмжээ + + + Copy address + Хаягийг санах + + + Copy label + Шошгыг санах + + + Copy amount + Хэмжээг санах + + + Copy transaction ID + + + + Edit label + Шошгыг ѳѳрчлѳх + + + Show transaction details + Гүйлгээний дэлгэрэнгүйг харуул + + + Export Transaction History + + + + Exporting Failed + + + + There was an error trying to save the transaction history to %1. + + + + Exporting Successful + + + + The transaction history was successfully saved to %1. + Гүйлгээнүй түүхийг %1-д амжилттай хадгаллаа. + + + Comma separated file (*.csv) + Таслалаар тусгаарлагдсан хүснэгтэн файл (.csv) + + + Confirmed + Баталгаажлаа + + + Date + Огноо + + + Type + Тѳрѳл + + + Label + Шошго + + + Address + Хаяг + + + Amount + Хэмжээ + + + ID + Тодорхойлолт + + + Range: + + + + to + -рүү/руу + + + + WalletFrame + + No wallet has been loaded. + Ямар ч түрүйвч ачааллагдсангүй. + + + + WalletModel + + Send Coins + Зоос явуулах + + + + WalletView + + &Export + + + + Export the data in the current tab to a file + + + + Backup Wallet + + + + Wallet Data (*.dat) + + + + Backup Failed + + + + There was an error trying to save the wallet data to %1. + + + + The wallet data was successfully saved to %1. + + + + Backup Successful + + + + + bitcoin-core + + Usage: + Хэрэглээ: + + + List commands + Үйлдлүүдийг жагсаах + + + Get help for a command + Үйлдэлд туслалцаа авах + + + Options: + Сонголтууд: + + + Specify configuration file (default: bitcoin.conf) + + + + Specify pid file (default: bitcoind.pid) + + + + Specify data directory + + + + Listen for connections on <port> (default: 8333 or testnet: 18333) + <port> дээрх холболтуудыг чагна (ѳгѳгдмѳл: 8333 эсвэл testnet: 18333) + + + Maintain at most <n> connections to peers (default: 125) + + + + Connect to a node to retrieve peer addresses, and disconnect + + + + Specify your own public address + + + + Threshold for disconnecting misbehaving peers (default: 100) + + + + Number of seconds to keep misbehaving peers from reconnecting (default: 86400) + + + + An error occurred while setting up the RPC port %u for listening on IPv4: %s + + + + Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) + + + + Accept command line and JSON-RPC commands + + + + Bitcoin Core RPC client version + + + + Run in the background as a daemon and accept commands + + + + Use the test network + + + + Accept connections from outside (default: 1 if no -proxy or -connect) + + + + %s, you must set a rpcpassword in the configuration file: +%s +It is recommended you use the following random password: +rpcuser=bitcoinrpc +rpcpassword=%s +(you do not need to remember this password) +The username and password MUST NOT be the same. +If the file does not exist, create it with owner-readable-only file permissions. +It is also recommended to set alertnotify so you are notified of problems; +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com + + + + + Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) + + + + An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s + + + + Bind to given address and always listen on it. Use [host]:port notation for IPv6 + + + + Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) + + + + Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. + + + + Enter regression test mode, which uses a special chain in which blocks can be solved instantly. + + + + Error: Listening for incoming connections failed (listen returned error %d) + + + + Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. + + + + Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! + + + + Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) + + + + Fees smaller than this are considered zero fee (for transaction creation) (default: + + + + Flush database activity from memory pool to disk log every <n> megabytes (default: 100) + + + + How thorough the block verification of -checkblocks is (0-4, default: 3) + + + + In this mode -genproclimit controls how many blocks are generated immediately. + + + + Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) + + + + Set the processor limit for when generation is on (-1 = unlimited, default: -1) + + + + This is a pre-release test build - use at your own risk - do not use for mining or merchant applications + + + + Unable to bind to %s on this computer. Bitcoin Core is probably already running. + + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) + + + + Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. + + + + Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. + + + + Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. + + + + Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. + + + + Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. + + + + Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. + + + + (default: 1) + + + + (default: wallet.dat) + + + + <category> can be: + + + + Attempt to recover private keys from a corrupt wallet.dat + + + + Bitcoin Core Daemon + + + + Block creation options: + + + + Clear list of wallet transactions (diagnostic tool; implies -rescan) + + + + Connect only to the specified node(s) + + + + Connect through SOCKS proxy + SOCKS проксигоор холбогдох + + + Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) + + + + Connection options: + + + + Corrupted block database detected + + + + Debugging/Testing options: + + + + Disable safemode, override a real safe mode event (default: 0) + + + + Discover own IP address (default: 1 when listening and no -externalip) + + + + Do not load the wallet and disable wallet RPC calls + + + + Do you want to rebuild the block database now? + + + + Error initializing block database + + + + Error initializing wallet database environment %s! + + + + Error loading block database + + + + Error opening block database + + + + Error: Disk space is low! + + + + Error: Wallet locked, unable to create transaction! + + + + Error: system error: + + + + Failed to listen on any port. Use -listen=0 if you want this. + + + + Failed to read block info + + + + Failed to read block + + + + Failed to sync block index + + + + Failed to write block index + + + + Failed to write block info + + + + Failed to write block + + + + Failed to write file info + + + + Failed to write to coin database + + + + Failed to write transaction index + + + + Failed to write undo data + + + + Fee per kB to add to transactions you send + + + + Fees smaller than this are considered zero fee (for relaying) (default: + + + + Find peers using DNS lookup (default: 1 unless -connect) + + + + Force safe mode (default: 0) + + + + Generate coins (default: 0) + + + + How many blocks to check at startup (default: 288, 0 = all) + + + + If <category> is not supplied, output all debugging information. + + + + Importing... + + + + Incorrect or no genesis block found. Wrong datadir for network? + + + + Invalid -onion address: '%s' + + + + Not enough file descriptors available. + + + + Prepend debug output with timestamp (default: 1) + + + + RPC client options: + + + + Rebuild block chain index from current blk000??.dat files + + + + Select SOCKS version for -proxy (4 or 5, default: 5) + + + + Set database cache size in megabytes (%d to %d, default: %d) + + + + Set maximum block size in bytes (default: %d) + + + + Set the number of threads to service RPC calls (default: 4) + + + + Specify wallet file (within data directory) + + + + Spend unconfirmed change when sending transactions (default: 1) + + + + This is intended for regression testing tools and app development. + + + + Usage (deprecated, use bitcoin-cli): + + + + Verifying blocks... + + + + Verifying wallet... + + + + Wait for RPC server to start + RPC серверийг эхэлтэл хүлээ + + + Wallet %s resides outside data directory %s + + + + Wallet options: + Түрүйвчийн сонголтууд: + + + Warning: Deprecated argument -debugnet ignored, use -debug=net + + + + You need to rebuild the database using -reindex to change -txindex + + + + Imports blocks from external blk000??.dat file + + + + Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. + + + + Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) + + + + Output debugging information (default: 0, supplying <category> is optional) + + + + Set maximum size of high-priority/low-fee transactions in bytes (default: %d) + + + + Information + + + + Invalid amount for -minrelaytxfee=<amount>: '%s' + + + + Invalid amount for -mintxfee=<amount>: '%s' + + + + Limit size of signature cache to <n> entries (default: 50000) + + + + Log transaction priority and fee per kB when mining blocks (default: 0) + + + + Maintain a full transaction index (default: 0) + + + + Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) + + + + Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) + + + + Only accept block chain matching built-in checkpoints (default: 1) + + + + Only connect to nodes in network <net> (IPv4, IPv6 or Tor) + + + + Print block on startup, if found in block index + + + + Print block tree on startup (default: 0) + + + + RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) + + + + RPC server options: + + + + Randomly drop 1 of every <n> network messages + + + + Randomly fuzz 1 of every <n> network messages + + + + Run a thread to flush wallet periodically (default: 1) + + + + SSL options: (see the Bitcoin Wiki for SSL setup instructions) + + + + Send command to Bitcoin Core + + + + Send trace/debug info to console instead of debug.log file + + + + Set minimum block size in bytes (default: 0) + + + + Sets the DB_PRIVATE flag in the wallet db environment (default: 1) + + + + Show all debugging options (usage: --help -help-debug) + + + + Show benchmark information (default: 0) + + + + Shrink debug.log file on client startup (default: 1 when no -debug) + + + + Signing transaction failed + + + + Specify connection timeout in milliseconds (default: 5000) + + + + Start Bitcoin Core Daemon + + + + System error: + + + + Transaction amount too small + + + + Transaction amounts must be positive + + + + Transaction too large + + + + Use UPnP to map the listening port (default: 0) + + + + Use UPnP to map the listening port (default: 1 when listening) + + + + Username for JSON-RPC connections + + + + Warning + + + + Warning: This version is obsolete, upgrade required! + + + + Zapping all transactions from wallet... + + + + on startup + + + + version + хувилбар + + + wallet.dat corrupt, salvage failed + + + + Password for JSON-RPC connections + + + + Allow JSON-RPC connections from specified IP address + + + + Send commands to node running on <ip> (default: 127.0.0.1) + + + + Execute command when the best block changes (%s in cmd is replaced by block hash) + + + + Upgrade wallet to latest format + Түрүйвчийг хамгийн сүүлийн үеийн форматруу шинэчлэх + + + Set key pool size to <n> (default: 100) + + + + Rescan the block chain for missing wallet transactions + + + + Use OpenSSL (https) for JSON-RPC connections + + + + Server certificate file (default: server.cert) + + + + Server private key (default: server.pem) + + + + This help message + + + + Unable to bind to %s on this computer (bind returned error %d, %s) + + + + Allow DNS lookups for -addnode, -seednode and -connect + + + + Loading addresses... + Хаягуудыг ачааллаж байна... + + + Error loading wallet.dat: Wallet corrupted + wallet.dat-ыг ачааллахад алдаа гарлаа: Түрүйвч эвдэрсэн байна + + + Error loading wallet.dat: Wallet requires newer version of Bitcoin + wallet.dat-ыг ачааллахад алдаа гарлаа: Түрүйвч Биткойны шинэ хувилбарыг шаардаж байна + + + Wallet needed to be rewritten: restart Bitcoin to complete + + + + Error loading wallet.dat + wallet.dat-ыг ачааллахад алдаа гарлаа + + + Invalid -proxy address: '%s' + Эдгээр прокси хаягнууд буруу байна: '%s' + + + Unknown network specified in -onlynet: '%s' + + + + Unknown -socks proxy version requested: %i + + + + Cannot resolve -bind address: '%s' + + + + Cannot resolve -externalip address: '%s' + + + + Invalid amount for -paytxfee=<amount>: '%s' + + + + Invalid amount + Буруу хэмжээ + + + Insufficient funds + Таны дансны үлдэгдэл хүрэлцэхгүй байна + + + Loading block index... + Блокийн индексүүдийг ачааллаж байна... + + + Add a node to connect to and attempt to keep the connection open + Холболт хийхийн тулд мѳн холболтой онгорхой хадгалхын тулд шинэ нод нэм + + + Loading wallet... + Түрүйвчийг ачааллаж байна... + + + Cannot downgrade wallet + + + + Cannot write default address + + + + Rescanning... + Ахин уншиж байна... + + + Done loading + Ачааллаж дууслаа + + + To use the %s option + %s сонголтыг ашиглахын тулд + + + Error + Алдаа + + + You must set rpcpassword=<password> in the configuration file: +%s +If the file does not exist, create it with owner-readable-only file permissions. + + + + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_ms_MY.ts b/src/qt/locale/bitcoin_ms_MY.ts index 9835a2e19f..0f92a6d49f 100644 --- a/src/qt/locale/bitcoin_ms_MY.ts +++ b/src/qt/locale/bitcoin_ms_MY.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_nb.ts b/src/qt/locale/bitcoin_nb.ts index 078bad7edc..09ef29d871 100644 --- a/src/qt/locale/bitcoin_nb.ts +++ b/src/qt/locale/bitcoin_nb.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1047,6 +1047,14 @@ Adresse: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) IP-adressen til proxyen (f.eks. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: Aktive kommandolinjevalg som overstyrer valgene ovenfor: @@ -1349,8 +1357,8 @@ Adresse: %4 Feil: Ugyldig kombinasjon av -regtest og -testnet. - Bitcoin Core did't yet exit safely... - Bitcoin Core har annå ikke avsluttet på en sikker måte... + Bitcoin Core didn't yet exit safely... + Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) diff --git a/src/qt/locale/bitcoin_nl.ts b/src/qt/locale/bitcoin_nl.ts index 0da46059b5..8cbbbdad7f 100644 --- a/src/qt/locale/bitcoin_nl.ts +++ b/src/qt/locale/bitcoin_nl.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1047,6 +1047,14 @@ Adres: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) IP-adres van de proxy (bijv. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + Derde partijen URL's (bijvoorbeeld block explorer) dat in de transacties tab verschijnen als contextmenu elementen. %s in de URL is vervangen door transactie hash. Verscheidene URL's zijn gescheiden door een verticale streep |. + + + Third party transaction URLs + Transactie-URLs van derde partijen + Active command-line options that override above options: Actieve commandoregelopties die bovenstaande opties overschrijven: @@ -1349,8 +1357,8 @@ Adres: %4 Fout: Ongeldige combinatie van -regtest en -testnet - Bitcoin Core did't yet exit safely... - + Bitcoin Core didn't yet exit safely... + Bitcoin Core is nog niet veilig uitgeschakeld... Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) @@ -2959,7 +2967,7 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Importing... - + Importeren... Incorrect or no genesis block found. Wrong datadir for network? diff --git a/src/qt/locale/bitcoin_pam.ts b/src/qt/locale/bitcoin_pam.ts index 4a5e0363a8..22f1b7ccc3 100644 --- a/src/qt/locale/bitcoin_pam.ts +++ b/src/qt/locale/bitcoin_pam.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1045,6 +1045,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1347,7 +1355,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_pl.ts b/src/qt/locale/bitcoin_pl.ts index 06845bfc3b..cbc08dd25d 100644 --- a/src/qt/locale/bitcoin_pl.ts +++ b/src/qt/locale/bitcoin_pl.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1047,6 +1047,14 @@ Adres: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Adres IP serwera proxy (np. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1287,7 +1295,7 @@ Adres: %4 Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - + Twoje aktywne proxy nie obsługuje SOCKS5, co jest wymagane dla żądania płatności przez proxy. Payment request fetch URL is invalid: %1 @@ -1349,8 +1357,8 @@ Adres: %4 Błąd: Niepoprawna kombinacja -regtest i -testnet. - Bitcoin Core did't yet exit safely... - + Bitcoin Core didn't yet exit safely... + Bitcoin Core jeszcze się nie wyłączył bezpiecznie… Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) @@ -1555,7 +1563,7 @@ Adres: %4 Use this form to request payments. All fields are <b>optional</b>. - + Użyj tego formularza do zażądania płatności. Wszystkie pola są <b>opcjonalne</b>. An optional amount to request. Leave this empty or zero to not request a specific amount. @@ -2790,11 +2798,11 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo (default: 1) - + (domyślnie: 1) (default: wallet.dat) - + (domyślnie: wallet.dat) <category> can be: @@ -2934,7 +2942,7 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Fees smaller than this are considered zero fee (for relaying) (default: - + Opłaty mniejsze niż to są uznawane za nieistniejące (przy przekazywaniu) (domyślnie: Find peers using DNS lookup (default: 1 unless -connect) @@ -2958,7 +2966,7 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Importing... - + Importowanie… Incorrect or no genesis block found. Wrong datadir for network? @@ -3082,7 +3090,7 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Log transaction priority and fee per kB when mining blocks (default: 0) - + Loguj priorytety transakcji i opłaty na kB podczas kopania bloków (domyślnie: 0) Maintain a full transaction index (default: 0) @@ -3106,7 +3114,7 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Print block on startup, if found in block index - + Wyświetlaj blok podczas uruchamiania, jeżeli znaleziono indeks bloków Print block tree on startup (default: 0) @@ -3122,7 +3130,7 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Randomly drop 1 of every <n> network messages - + Losowo ignoruje 1 z każdych <n> wiadomości sieciowych. Randomly fuzz 1 of every <n> network messages @@ -3130,7 +3138,7 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Run a thread to flush wallet periodically (default: 1) - + Uruchom wątek do okresowego zapisywania portfela (domyślnie: 1) SSL options: (see the Bitcoin Wiki for SSL setup instructions) @@ -3138,7 +3146,7 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Send command to Bitcoin Core - + Wyślij komendę do Bitcoin Core Send trace/debug info to console instead of debug.log file @@ -3218,7 +3226,7 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo on startup - + podczas uruchamiania version diff --git a/src/qt/locale/bitcoin_pt_BR.ts b/src/qt/locale/bitcoin_pt_BR.ts index 94a87596ca..ee1c2a7381 100644 --- a/src/qt/locale/bitcoin_pt_BR.ts +++ b/src/qt/locale/bitcoin_pt_BR.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1046,6 +1046,14 @@ Endereço: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Endereço de IP do proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: Ativa as opções de linha de comando que sobrescreve as opções acima: @@ -1348,7 +1356,7 @@ Endereço: %4 Erro: Combinação inválida de-regtest e testnet. - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_pt_PT.ts b/src/qt/locale/bitcoin_pt_PT.ts index d6dbbbf42a..7a9595a6dd 100644 --- a/src/qt/locale/bitcoin_pt_PT.ts +++ b/src/qt/locale/bitcoin_pt_PT.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1046,6 +1046,14 @@ Endereço: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Endereço IP do proxy (p.ex. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: Opções de linha de comandos ativas que se sobrepõem ás opções anteriores: @@ -1348,7 +1356,7 @@ Endereço: %4 Erro: Combinação inválida de -regtest e -testnet. - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_ro_RO.ts b/src/qt/locale/bitcoin_ro_RO.ts index 0a310db989..1d9d4cc936 100644 --- a/src/qt/locale/bitcoin_ro_RO.ts +++ b/src/qt/locale/bitcoin_ro_RO.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1047,6 +1047,14 @@ Adresa: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1349,7 +1357,7 @@ Adresa: %4 Eroare: combinație nevalidă de -regtest și -testnet. - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_ru.ts b/src/qt/locale/bitcoin_ru.ts index d9840a9c5e..570c3a61e7 100644 --- a/src/qt/locale/bitcoin_ru.ts +++ b/src/qt/locale/bitcoin_ru.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1047,6 +1047,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) IP-адрес прокси (например IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + Сторонние URL (например, block explorer), которые отображаются на вкладке транзакций как пункты контекстного меню. %s в URL заменяется хэшем транзакции. URL отделяются друг от друга вертикальной чертой |. + + + Third party transaction URLs + Сторонние URL транзакций. + Active command-line options that override above options: Активные опции командной строки, которые перекрывают вышеуказанные опции: @@ -1349,8 +1357,8 @@ Address: %4 Ошибка: неверная комбинация -regtest и -testnet. - Bitcoin Core did't yet exit safely... - Bitcoin Core еще не готов к безопасному завершению... + Bitcoin Core didn't yet exit safely... + Bitcoin Core ещё не завершился безопасно... Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) diff --git a/src/qt/locale/bitcoin_sah.ts b/src/qt/locale/bitcoin_sah.ts index 5cdf9a93d7..3bc3e65c62 100644 --- a/src/qt/locale/bitcoin_sah.ts +++ b/src/qt/locale/bitcoin_sah.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_sk.ts b/src/qt/locale/bitcoin_sk.ts index b12462dbb2..d96e9d9366 100644 --- a/src/qt/locale/bitcoin_sk.ts +++ b/src/qt/locale/bitcoin_sk.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -63,7 +63,7 @@ This product includes software developed by the OpenSSL Project for use in the O Delete the currently selected address from the list - + Vymaž vybranú adresu zo zoznamu Export the data in the current tab to a file @@ -79,11 +79,11 @@ This product includes software developed by the OpenSSL Project for use in the O Choose the address to send coins to - + Zvoľte adresu kam poslať coins Choose the address to receive coins with - + Zvoľte adresu na ktorú prijať coins C&hoose @@ -99,11 +99,11 @@ This product includes software developed by the OpenSSL Project for use in the O These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - + Toto sú Vaše Bitcoin adresy pre posielanie platieb. Vždy skontrolujte množstvo a prijímaciu adresu pred poslaním coins. These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - + Toto sú vaše Bitcoin adresy pre prijímanie platieb. Odporúča sa použiť novú prijímaciu adresu pre každú transakciu. Copy &Label @@ -127,7 +127,7 @@ This product includes software developed by the OpenSSL Project for use in the O There was an error trying to save the address list to %1. - + Nastala chyba pri pokuse uložiť zoznam adries do %1. @@ -392,15 +392,15 @@ This product includes software developed by the OpenSSL Project for use in the O Encrypt the private keys that belong to your wallet - + Zašifruj súkromné kľúče ktoré patria do vašej peňaženky Sign messages with your Bitcoin addresses to prove you own them - + Podpísať správu s vašou adresou Bitcoin aby ste preukázali že ju vlastníte Verify messages to ensure they were signed with specified Bitcoin addresses - + Overiť či správa bola podpísaná uvedenou Bitcoin adresou &File @@ -428,7 +428,7 @@ This product includes software developed by the OpenSSL Project for use in the O Request payments (generates QR codes and bitcoin: URIs) - + Vyžiadať platbu (vygeneruje QR kód a bitcoin: URI) &About Bitcoin Core @@ -436,11 +436,11 @@ This product includes software developed by the OpenSSL Project for use in the O Show the list of used sending addresses and labels - + Zobraziť zoznam použitých adries odosielateľa a ich popisy Show the list of used receiving addresses and labels - + Zobraziť zoznam použitých prijímacích adries a ich popisov Open a bitcoin: URI or payment request @@ -448,7 +448,7 @@ This product includes software developed by the OpenSSL Project for use in the O &Command-line options - Voľby príkazového riadku + Možnosti príkazového riadku Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options @@ -488,15 +488,15 @@ This product includes software developed by the OpenSSL Project for use in the O %1 and %2 - + %1 a %2 %n year(s) - + %%d)%n rokov %1 behind - %1 za + %1 pozadu Last received block was generated %1 ago. @@ -555,7 +555,7 @@ Adresa: %4 A fatal error occurred. Bitcoin can no longer continue safely and will quit. - + Vyskytla sa neblahá chyba. Bitcoin nemôže daľej bezpečne pokračovať a vypne sa. @@ -569,7 +569,7 @@ Adresa: %4 CoinControlDialog Coin Control Address Selection - + Coin Control výber adresy Quantity: @@ -593,11 +593,11 @@ Adresa: %4 Low Output: - + Malá hodnota na výstupe: After Fee: - + Po poplatku: Change: @@ -605,7 +605,7 @@ Adresa: %4 (un)select all - + (ne)vybrať všetko Tree mode @@ -657,11 +657,11 @@ Adresa: %4 Lock unspent - + Uzamknúť neminuté Unlock unspent - + Odomknúť neminuté Copy quantity @@ -729,7 +729,7 @@ Adresa: %4 (%1 locked) - + (%1 zamknutých) none @@ -777,7 +777,7 @@ Adresa: %4 Amounts below 0.546 times the minimum relay fee are shown as dust. - + Sumy pod 0.546 násobkom minimálneho poplatku pre prenos sú považované za prach. This label turns red, if the change is smaller than %1. @@ -808,11 +808,11 @@ Adresa: %4 The label associated with this address list entry - + Popis tejto položký v zozname adries je prázdny The address associated with this address list entry. This can only be modified for sending addresses. - + Adresa spojená s týmto záznamom v adresári. Možno upravovať len pre odosielajúce adresy. &Address @@ -863,7 +863,7 @@ Adresa: %4 Directory already exists. Add %1 if you intend to create a new directory here. - + Priečinok už existuje. Pridajte "%1" ak chcete vytvoriť nový priečinok tu. Path already exists, and is not a directory. @@ -878,7 +878,7 @@ Adresa: %4 HelpMessageDialog Bitcoin Core - Command-line options - + Jadro Bitcoin - možnosti príkazového riadku Bitcoin Core @@ -937,7 +937,7 @@ Adresa: %4 Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - + Jadro Bitcoin stiahne zo siete a uloží kópiu Bitcoin blockchain. Aspoň %1GB dát bude uložených v tomto priečinku a časom porastie. Peňaženka bude tiež uložená v tomto priečinku. Use the default data directory @@ -953,7 +953,7 @@ Adresa: %4 Error: Specified data directory "%1" can not be created. - + Chyba: Predpísaný priečinok pre dáta "%1" nemôže byt vytvorený. Error @@ -976,7 +976,7 @@ Adresa: %4 Open payment request from URI or file - + Otvoriť požiadavku na zaplatenie z URI alebo súboru URI: @@ -984,11 +984,11 @@ Adresa: %4 Select payment request file - + Vyberte súbor s výzvou k platbe Select payment request file to open - + Vyberte ktorý súbor s výzvou k platbe otvoriť @@ -1003,7 +1003,7 @@ Adresa: %4 Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - + Voliteľný transakčný poplatok za kB ktorý pomôže rýchlemu spracovaniu transakcie. Väčšina transakcií má 1 kB. Poplatok 0.01 je odporúčaný. Pay transaction &fee @@ -1019,7 +1019,7 @@ Adresa: %4 Size of &database cache - + Veľkosť vyrovnávacej pamäti databázy MB @@ -1031,15 +1031,23 @@ Adresa: %4 Connect to the Bitcoin network through a SOCKS proxy. - + Pripojiť k Bitcoin sieti cez SOCKS proxy. &Connect through SOCKS proxy (default proxy): - + Pripojiť sa cez SOCKS proxy (predvolené proxy) IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - + IP adresy proxy (napr. IPv4: 127.0.0.1 / IPv6: ::1) + + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + URL tretích strán (napr. prehliadač blockchain) ktoré sa zobrazujú v záložke transakcií ako položky kontextového menu. %s v URL je nahradené hash-om transakcie. Viaceré URL sú oddelené zvislou čiarou |. + + + Third party transaction URLs + URL transakcií s tretími stranami Active command-line options that override above options: @@ -1063,15 +1071,15 @@ Adresa: %4 W&allet - + Peňaženka Expert - + Expert Enable coin &control features - + Povoliť možnosti coin control 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. @@ -1139,7 +1147,7 @@ Adresa: %4 The user interface language can be set here. This setting will take effect after restarting Bitcoin. - + Tu sa dá nastaviť jazyk užívateľského rozhrania. Toto nastavenie bude účinné po reštartovaní Bitcoin. &Unit to show amounts in: @@ -1147,11 +1155,11 @@ Adresa: %4 Choose the default subdivision unit to show in the interface and when sending coins. - + Zvoľte ako deliť bitcoin pri zobrazovaní pri platbách a užívateľskom rozhraní. Whether to show Bitcoin addresses in the transaction list or not. - + Či ukazovať Bitcoin adresy v zozname transakcií alebo nie. &Display addresses in transaction list @@ -1159,7 +1167,7 @@ Adresa: %4 Whether to show coin control features or not. - + Či zobrazovať možnosti "Coin control" alebo nie. &OK @@ -1179,19 +1187,19 @@ Adresa: %4 Confirm options reset - + Potvrdiť obnovenie možností Client restart required to activate changes. - + Reštart klienta potrebný pre aktivovanie zmien. Client will be shutdown, do you want to proceed? - + Klient bude vypnutý, chcete pokračovať? This change would require a client restart. - + Táto zmena by vyžadovala reštart klienta. The supplied proxy address is invalid. @@ -1206,7 +1214,7 @@ Adresa: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - + Zobrazené informácie môžu byť neaktuápne. Vaša peňaženka sa automaticky synchronizuje so sieťou Bitcoin po nadviazaní spojenia ale tento proces ešte nieje ukončený. Wallet @@ -1214,19 +1222,19 @@ Adresa: %4 Available: - + Disponibilné: Your current spendable balance - + Váš aktuálny disponibilný zostatok Pending: - + Čakajúce potvrdenie Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - + Suma transakcií ktoré ešte neboli potvrdené a ešte sa nepočítajú do disponibilného zostatku Immature: @@ -1234,7 +1242,7 @@ Adresa: %4 Mined balance that has not yet matured - + Vytvorený zostatok ktorý ešte nedosiahol zrelosť Total: @@ -1261,15 +1269,15 @@ Adresa: %4 URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - + URI sa nedá rozložiť! To môže byť spôsobené neplatou Bitcoin adresou alebo zle upravenými vlastnosťami URI. Requested payment amount of %1 is too small (considered dust). - + Požadovaná platba sumy %1 je príliš malá (považovaná za prach). Payment request error - + Chyba pri vyžiadaní platby Cannot start bitcoin: click-to-pay handler @@ -1277,7 +1285,7 @@ Adresa: %4 Net manager warning - + Varovanie správcu siete Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. @@ -1297,15 +1305,15 @@ Adresa: %4 Unverified payment requests to custom payment scripts are unsupported. - + Program nepodporuje neoverené platobné výzvy na vlastná skripty. Refund from %1 - + Vrátenie z %1 Error communicating with %1: %2 - + Chyba komunikácie s %1: %2 Payment request can not be parsed or processed! @@ -1317,11 +1325,11 @@ Adresa: %4 Payment acknowledged - + Platba potvrdená Network request error - + Chyba požiadavky siete @@ -1332,7 +1340,7 @@ Adresa: %4 Error: Specified data directory "%1" does not exist. - + Chyba: Uvedený priečinok s dátami "%1" neexistuje. Error: Cannot parse configuration file: %1. Only use key=value syntax. @@ -1340,11 +1348,11 @@ Adresa: %4 Error: Invalid combination of -regtest and -testnet. - + Chyba: Nesprávna kombinácia -regtest a -testnet. - Bitcoin Core did't yet exit safely... - + Bitcoin Core didn't yet exit safely... + Jadro Bitcoin sa ešte úspešne nevyplo ... Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) @@ -1478,15 +1486,15 @@ Adresa: %4 Welcome to the Bitcoin RPC console. - + Vitajte v Bitcoin RPC konzole. Baník, pyčo! Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - + Použi šipky hore a dolu pre navigáciu históriou a <b>Ctrl-L</b> pre vyčistenie obrazovky. Type <b>help</b> for an overview of available commands. - + Napíš <b>help</b> pre prehľad dostupných príkazov. %1 B @@ -1545,11 +1553,11 @@ Adresa: %4 An optional label to associate with the new receiving address. - + Voliteľný popis ktorý sa pridá k tejto novej prijímajúcej adrese. Use this form to request payments. All fields are <b>optional</b>. - + Použite tento formulár pre vyžiadanie platby. Všetky polia sú <b>voliteľné</b>. An optional amount to request. Leave this empty or zero to not request a specific amount. @@ -1573,7 +1581,7 @@ Adresa: %4 Show the selected request (does the same as double clicking an entry) - + Zobraz zvolenú požiadavku (urobí to isté ako dvoj-klik na záznam) Show @@ -1581,7 +1589,7 @@ Adresa: %4 Remove the selected entries from the list - + Odstrániť zvolené záznamy zo zoznamu Remove @@ -1694,7 +1702,7 @@ Adresa: %4 Coin Control Features - + Možnosti "Coin Control" Inputs... @@ -1730,11 +1738,11 @@ Adresa: %4 Low Output: - + Malá hodnota na výstupe: After Fee: - + Po poplatku: Change: @@ -1854,7 +1862,7 @@ Adresa: %4 Warning: Invalid Bitcoin address - + Varovanie: Nesprávna Bitcoin adresa (no label) @@ -1862,7 +1870,7 @@ Adresa: %4 Warning: Unknown change address - + Varovanie: Neznáma adresa pre výdavok Are you sure you want to send? @@ -1874,7 +1882,7 @@ Adresa: %4 Payment request expired - + Vypršala platnosť požiadavky na platbu Invalid payment address %1 @@ -1933,7 +1941,7 @@ Adresa: %4 This is a verified payment request. - + Toto je overená výzva k platbe. Enter a label for this address to add it to the list of used addresses @@ -1945,7 +1953,7 @@ Adresa: %4 This is an unverified payment request. - + Toto je neoverená výzva k platbe. Pay To: @@ -1953,7 +1961,7 @@ Adresa: %4 Memo: - + Poznámka: @@ -1964,14 +1972,14 @@ Adresa: %4 Do not shut down the computer until this window disappears. - + Nevypínajte počítač kým toto okno nezmizne. SignVerifyMessageDialog Signatures - Sign / Verify a Message - + Podpisy - Podpísať / Overiť správu &Sign Message @@ -2011,7 +2019,7 @@ Adresa: %4 Copy the current signature to the system clipboard - + Kopírovať práve zvolenú adresu do systémového klipbordu Sign the message to prove you own this Bitcoin address @@ -2023,7 +2031,7 @@ Adresa: %4 Reset all sign message fields - + Vynulovať všetky polia podpisu správy Clear &All @@ -2035,7 +2043,7 @@ Adresa: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - + Vložte podpisovaciu adresu, správu (uistite sa, že kopírujete ukončenia riadkov, medzery, odrážky, atď. presne) a podpis pod to na overenie adresy. Buďte opatrní a nečítajte ako podpísané viac než je v samotnej podpísanej správe a môžete sa tak vyhnúť podvodu mitm útokom. The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) @@ -2043,7 +2051,7 @@ Adresa: %4 Verify the message to ensure it was signed with the specified Bitcoin address - + Overím správy sa uistiť že bola podpísaná označenou Bitcoin adresou Verify &Message @@ -2051,7 +2059,7 @@ Adresa: %4 Reset all verify message fields - + Obnoviť všetky polia v overiť správu Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) @@ -2071,7 +2079,7 @@ Adresa: %4 The entered address does not refer to a key. - + Vložená adresa nezodpovedá žiadnemu kľúcu. Wallet unlock was cancelled. @@ -2079,7 +2087,7 @@ Adresa: %4 Private key for the entered address is not available. - + Súkromný kľúč pre vložená adresu nieje k dispozícii. Message signing failed. @@ -2099,7 +2107,7 @@ Adresa: %4 The signature did not match the message digest. - + Podpis sa nezhoduje so zhrnutím správy Message verification failed. @@ -2140,7 +2148,7 @@ Adresa: %4 conflicted - + sporné %1/offline @@ -2160,7 +2168,7 @@ Adresa: %4 , broadcast through %n node(s) - + ,,, vysielať cez %n nód Date @@ -2196,7 +2204,7 @@ Adresa: %4 matures in %n more block(s) - + Dospeje o %n blokovDospeje o %n blokovdospeje o %n blokov not accepted @@ -2302,7 +2310,7 @@ Adresa: %4 Immature (%1 confirmations, will be available after %2) - + Nezrelé (%1 potvrdení, bude k dispozícii po %2) Open for %n more block(s) @@ -2326,19 +2334,19 @@ Adresa: %4 Offline - + Offline Unconfirmed - + Nepotvrdené Confirming (%1 of %2 recommended confirmations) - + Potvrdzuje sa ( %1 z %2 odporúčaných potvrdení) Conflicted - + V rozpore Received with @@ -2485,7 +2493,7 @@ Adresa: %4 The transaction history was successfully saved to %1. - + História transakciá bola úspešne uložená do %1. Comma separated file (*.csv) @@ -2566,11 +2574,11 @@ Adresa: %4 There was an error trying to save the wallet data to %1. - + Vyskytla sa chyba pri pokuse o uloženie dát peňaženky do %1. The wallet data was successfully saved to %1. - + Dáta peňaženky boli úspešne uložené do %1. Backup Successful @@ -2617,7 +2625,7 @@ Adresa: %4 Connect to a node to retrieve peer addresses, and disconnect - + Pripojiť sa k nóde, získať adresy ďaľších počítačov v sieti a odpojit sa. Specify your own public address @@ -2633,7 +2641,7 @@ Adresa: %4 An error occurred while setting up the RPC port %u for listening on IPv4: %s - + Vyskytla sa chyba pri nastavovaní RPC portu %u pre počúvanie na IPv4: %s Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) @@ -2645,7 +2653,7 @@ Adresa: %4 Bitcoin Core RPC client version - + Verzia RPC klienta Jadra Bitcoin Run in the background as a daemon and accept commands @@ -2657,7 +2665,7 @@ Adresa: %4 Accept connections from outside (default: 1 if no -proxy or -connect) - + Prijať spojenia zvonku (predvolené: 1 ak žiadne -proxy alebo -connect) %s, you must set a rpcpassword in the configuration file: @@ -2679,11 +2687,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - + Vyskytla sa chyba pri nastavovaní RPC portu %u pre počúvanie na IPv6, vraciam sa späť ku IPv4: %s Bind to given address and always listen on it. Use [host]:port notation for IPv6 - + Spojiť s danou adresou a vždy na nej počúvať. Použite zápis [host]:port pre IPv6 Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) @@ -2691,7 +2699,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - + Vstúpiť do regresného testovacieho módu, ktorý používa špeciálnu reťaz v ktorej môžu byť bloky v okamihu vyriešené. Pre účely regresného testovania a vývoja aplikácie. Enter regression test mode, which uses a special chain in which blocks can be solved instantly. @@ -2711,7 +2719,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - + Vykonaj príkaz keď sa zmení transakcia peňaženky (%s v príkaze je nahradená TxID) Fees smaller than this are considered zero fee (for transaction creation) (default: @@ -2767,7 +2775,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - + Varovanie: chyba pri čítaní wallet.dad! Všetky kľúče sú čitateľné ale transakčné dáta alebo záznamy v adresári môžu byť nesprávne. Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. @@ -2775,11 +2783,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. (default: 1) - + (predvolené: 1) (default: wallet.dat) - + (predvolené: wallet.dat) <category> can be: @@ -2787,7 +2795,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Attempt to recover private keys from a corrupt wallet.dat - + Pokus zachrániť súkromné kľúče z poškodeného wallet.dat Bitcoin Core Daemon @@ -2807,7 +2815,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Connect through SOCKS proxy - + Pripojiť cez SOCKS proxy Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) @@ -2815,7 +2823,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Connection options: - + Možnosti pripojenia: Corrupted block database detected @@ -2823,7 +2831,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Debugging/Testing options: - + Možnosti ladenia/testovania: Disable safemode, override a real safe mode event (default: 0) @@ -2831,7 +2839,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Discover own IP address (default: 1 when listening and no -externalip) - + Zisti vlastnú IP adresu (predvolené: 1 pri počúvaní/listening a žiadnej -externalip) Do not load the wallet and disable wallet RPC calls @@ -2847,7 +2855,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error initializing wallet database environment %s! - + Chyba spustenia databázového prostredia peňaženky %s! Error loading block database @@ -2871,7 +2879,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to listen on any port. Use -listen=0 if you want this. - + Chyba počúvania na ktoromkoľvek porte. Použi -listen=0 ak toto chcete. Failed to read block info @@ -2883,11 +2891,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to sync block index - + Zlyhalo synchronizovanie zoznamu blokov Failed to write block index - + Zlyhalo zapisovanie do zoznamu blokov Failed to write block info @@ -2907,11 +2915,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write transaction index - + Zlyhal zápis zoznamu transakcií Failed to write undo data - + Zlyhalo zapisovanie Fee per kB to add to transactions you send @@ -2923,7 +2931,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Find peers using DNS lookup (default: 1 unless -connect) - + Nájsť počítače v bitcoin sieti použitím DNS vyhľadávania (predvolené: 1 okrem -connect) Force safe mode (default: 0) @@ -2931,11 +2939,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Generate coins (default: 0) - + Vytvárať mince (predvolené: 0) How many blocks to check at startup (default: 288, 0 = all) - + Koľko blokov skontrolovať pri spustení (predvolené: 288, 0 = všetky) If <category> is not supplied, output all debugging information. @@ -2943,19 +2951,19 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Importing... - + Prebieha import ... Incorrect or no genesis block found. Wrong datadir for network? - + Nesprávny alebo žiadny genesis blok nájdený. Nesprávny dátový priečinok alebo sieť? Invalid -onion address: '%s' - + Neplatná -onion adresa: '%s' Not enough file descriptors available. - + Nedostatok kľúčových slov súboru. Prepend debug output with timestamp (default: 1) @@ -2963,15 +2971,15 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. RPC client options: - + Možnosti klienta RPC baník pyčo: Rebuild block chain index from current blk000??.dat files - + Znovu vytvoriť zoznam blokov zo súčasných blk000??.dat súborov Select SOCKS version for -proxy (4 or 5, default: 5) - + Zvoľte SOCKS verziu -proxy (4 alebo 5, predvolené 5) Set database cache size in megabytes (%d to %d, default: %d) @@ -2979,15 +2987,15 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Set maximum block size in bytes (default: %d) - + Nastaviť najväčšiu veľkosť bloku v bytoch (predvolené: %d) Set the number of threads to service RPC calls (default: 4) - + Nastaviť množstvo vlákien na obsluhu RPC volaní (predvolené: 4) Specify wallet file (within data directory) - + Označ súbor peňaženky (v priečinku s dátami) Spend unconfirmed change when sending transactions (default: 1) @@ -2999,7 +3007,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Usage (deprecated, use bitcoin-cli): - + Použitie (neodporúča sa, použite bitcoin-cli): Verifying blocks... @@ -3011,11 +3019,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Wait for RPC server to start - + Čakanie na štart RPC servra Wallet %s resides outside data directory %s - + Peňaženka %s sa nachádza mimo dátového priečinka %s Wallet options: @@ -3027,7 +3035,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. You need to rebuild the database using -reindex to change -txindex - + Potrebujete prebudovať databázu použitím -reindex zmeniť -txindex Imports blocks from external blk000??.dat file @@ -3035,7 +3043,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - + Neviem uzamknúť data adresár %s. Jadro Bitcoin je pravdepodobne už spustené. Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) @@ -3055,11 +3063,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Invalid amount for -minrelaytxfee=<amount>: '%s' - + Neplatná suma pre -minrelaytxfee=<amount>: '%s' Invalid amount for -mintxfee=<amount>: '%s' - + Neplatná suma pre -mintxfee=<amount>: '%s' Limit size of signature cache to <n> entries (default: 50000) @@ -3075,7 +3083,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - + Maximálna veľkosť prijímacieho zásobníka pre jedno spojenie, <n>*1000 bytov (predvolené: 5000) Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) @@ -3087,7 +3095,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - + Pripájať sa len k nódam v sieti <net> (IPv4, IPv6 alebo Tor) Print block on startup, if found in block index @@ -3103,11 +3111,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. RPC server options: - + Možnosti servra RPC: Randomly drop 1 of every <n> network messages - + Náhodne zahadzuj 1 z každých <n> sieťových správ Randomly fuzz 1 of every <n> network messages @@ -3115,7 +3123,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Run a thread to flush wallet periodically (default: 1) - + Mať spustené vlákno pravidelného čístenia peňaženky (predvolené: 1) SSL options: (see the Bitcoin Wiki for SSL setup instructions) @@ -3123,7 +3131,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Send command to Bitcoin Core - + Poslať príkaz Jadru Bitcoin Send trace/debug info to console instead of debug.log file @@ -3131,23 +3139,23 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Set minimum block size in bytes (default: 0) - + Nastaviť minimálnu veľkosť bloku v bytoch (predvolené: 0) Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - + Nastaví DB_PRIVATE možnosť v db prostredí peňaženky (prednastavené: 1) Show all debugging options (usage: --help -help-debug) - + Zobraziť všetky možnosti ladenia (použitie: --help --help-debug) Show benchmark information (default: 0) - + Zobraziť porovnávacie informácie (prednastavené: 0) Shrink debug.log file on client startup (default: 1 when no -debug) - + Zmenšiť debug.log pri spustení klienta (predvolené: 1 ak bez -debug) Signing transaction failed @@ -3159,7 +3167,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Start Bitcoin Core Daemon - + Štart služby Jadro Bitcoin System error: @@ -3171,7 +3179,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Transaction amounts must be positive - + Hodnoty transakcie musia byť väčšie ako nula (pozitívne) Transaction too large @@ -3203,7 +3211,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. on startup - + pri štarte version @@ -3259,7 +3267,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Unable to bind to %s on this computer (bind returned error %d, %s) - + Nepodarilo sa spojiť s %s na tomto počítači (bind vrátil chybu %d, %s) Allow DNS lookups for -addnode, -seednode and -connect @@ -3291,19 +3299,19 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Unknown network specified in -onlynet: '%s' - + Neznáma sieť upresnená v -onlynet: '%s' Unknown -socks proxy version requested: %i - + Neznáma verzia -socks proxy požadovaná: %i Cannot resolve -bind address: '%s' - + Nemožno rozriešiť -bind adress: '%s' Cannot resolve -externalip address: '%s' - + Nemožno rozriešiť -externalip address: '%s' Invalid amount for -paytxfee=<amount>: '%s' diff --git a/src/qt/locale/bitcoin_sl_SI.ts b/src/qt/locale/bitcoin_sl_SI.ts index b966842d85..1a46c6ae6c 100644 --- a/src/qt/locale/bitcoin_sl_SI.ts +++ b/src/qt/locale/bitcoin_sl_SI.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1042,6 +1042,14 @@ Naslov: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1344,7 +1352,7 @@ Naslov: %4 Napaka: Neveljavna kombinacija -regtest and -testnet - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_sq.ts b/src/qt/locale/bitcoin_sq.ts index 5d9e7b7168..65e37ff903 100644 --- a/src/qt/locale/bitcoin_sq.ts +++ b/src/qt/locale/bitcoin_sq.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_sr.ts b/src/qt/locale/bitcoin_sr.ts index 6549c53542..901eb59394 100644 --- a/src/qt/locale/bitcoin_sr.ts +++ b/src/qt/locale/bitcoin_sr.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_sv.ts b/src/qt/locale/bitcoin_sv.ts index 27a8c4d0e3..e98048e925 100644 --- a/src/qt/locale/bitcoin_sv.ts +++ b/src/qt/locale/bitcoin_sv.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1048,6 +1048,14 @@ Adress: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Proxyns IP-adress (t.ex. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + Tredjeparts URL:er (t.ex. en block utforskare) som finns i transaktionstabben som ett menyval i sammanhanget. %s i URL:en ersätts med tansaktionshashen. Flera URL:er är separerade med vertikala streck |. + + + Third party transaction URLs + Tredjeparts transaktions-URL:er + Active command-line options that override above options: Aktiva kommandoradsalternativ som överrider alternativen ovan: @@ -1350,8 +1358,8 @@ Adress: %4 Fel: Felaktig kombination av -regtest och -testnet. - Bitcoin Core did't yet exit safely... - Bitcoin Core avslutades säkert... + Bitcoin Core didn't yet exit safely... + Bitcoin Core avslutades inte ännu säkert... Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) diff --git a/src/qt/locale/bitcoin_th_TH.ts b/src/qt/locale/bitcoin_th_TH.ts index a26a128d93..96c49b12d0 100644 --- a/src/qt/locale/bitcoin_th_TH.ts +++ b/src/qt/locale/bitcoin_th_TH.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_tr.ts b/src/qt/locale/bitcoin_tr.ts index 07d6e68f17..15ec92f982 100644 --- a/src/qt/locale/bitcoin_tr.ts +++ b/src/qt/locale/bitcoin_tr.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1047,6 +1047,14 @@ Adres: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Vekil sunucusunun IP adresi (mesela IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + Muameleler sekmesinde bağlam menüsü unsurları olarak görünen üçüncü taraf bağlantıları (mesela bir blok tarayıcısı). URL'deki %s, muamele hash değeri ile değiştirilecektir. Birden çok bağlantılar düşey çubuklar | ile ayrılacaktır. + + + Third party transaction URLs + Üçüncü taraf muamele URL'leri + Active command-line options that override above options: Yukarıdaki seçeneklerin yerine geçen faal komut satırı seçenekleri: @@ -1349,7 +1357,7 @@ Adres: %4 Hata: -regtest ve -testnet'in geçersiz kombinasyonu. - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... Bitcoin Çekirdeği henüz güvenli bir şekilde çıkış yapmamıştır... diff --git a/src/qt/locale/bitcoin_uk.ts b/src/qt/locale/bitcoin_uk.ts index d78775319f..1e739395a2 100644 --- a/src/qt/locale/bitcoin_uk.ts +++ b/src/qt/locale/bitcoin_uk.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1047,6 +1047,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1349,7 +1357,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_ur_PK.ts b/src/qt/locale/bitcoin_ur_PK.ts index 45b46e2689..d9634f63e3 100644 --- a/src/qt/locale/bitcoin_ur_PK.ts +++ b/src/qt/locale/bitcoin_ur_PK.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_uz@Cyrl.ts b/src/qt/locale/bitcoin_uz@Cyrl.ts index e4ce310e20..6ba4f6fa1b 100644 --- a/src/qt/locale/bitcoin_uz@Cyrl.ts +++ b/src/qt/locale/bitcoin_uz@Cyrl.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_vi.ts b/src/qt/locale/bitcoin_vi.ts index 88e37b5ea2..0f9fc4f0f1 100644 --- a/src/qt/locale/bitcoin_vi.ts +++ b/src/qt/locale/bitcoin_vi.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_vi_VN.ts b/src/qt/locale/bitcoin_vi_VN.ts index 743e7119d1..2102729523 100644 --- a/src/qt/locale/bitcoin_vi_VN.ts +++ b/src/qt/locale/bitcoin_vi_VN.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_zh_CN.ts b/src/qt/locale/bitcoin_zh_CN.ts index a8859892d6..ea98c4e4b1 100644 --- a/src/qt/locale/bitcoin_zh_CN.ts +++ b/src/qt/locale/bitcoin_zh_CN.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1048,6 +1048,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) 代理的 IP 地址 (例如 IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: 有效的命令行参数覆盖上述选项: @@ -1350,7 +1358,7 @@ Address: %4 错误:无效的 -regtest 与 -testnet 结合体。 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_zh_HK.ts b/src/qt/locale/bitcoin_zh_HK.ts index cf729a3f92..835d0134d6 100644 --- a/src/qt/locale/bitcoin_zh_HK.ts +++ b/src/qt/locale/bitcoin_zh_HK.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1038,6 +1038,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + + + + Third party transaction URLs + + Active command-line options that override above options: @@ -1340,7 +1348,7 @@ Address: %4 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... diff --git a/src/qt/locale/bitcoin_zh_TW.ts b/src/qt/locale/bitcoin_zh_TW.ts index 4f7561ab9e..fccdf48abd 100644 --- a/src/qt/locale/bitcoin_zh_TW.ts +++ b/src/qt/locale/bitcoin_zh_TW.ts @@ -1,4 +1,4 @@ - + AboutDialog @@ -1049,6 +1049,14 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) 代理伺服器的網際網路位址(像是 IPv4 的 127.0.0.1 或 IPv6 的 ::1) + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + 在交易頁籤的情境選單出現的第三方(比如說區塊探索網站)網址連結。網址中的 %s 會被取代為交易的雜湊值。可以用直線符號 | 來分隔多個連結。 + + + Third party transaction URLs + 交易的第三方網址連結 + Active command-line options that override above options: 從命令列取代掉以上設定的選項有: @@ -1351,7 +1359,7 @@ Address: %4 錯誤: -regtest 和 -testnet 的使用組合無效。 - Bitcoin Core did't yet exit safely... + Bitcoin Core didn't yet exit safely... 位元幣核心還沒有安全地結束... From deb3572ab160221124dfa3e9c5c4e493529f59e4 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 17 Feb 2014 17:35:40 +0100 Subject: [PATCH 0053/1288] Add -rpcbind option to allow binding RPC port on a specific interface Add -rpcbind command option to specify binding RPC service on one or multiple specific interfaces. Functionality if -rpcbind is not specified remains the same as before: - If no -rpcallowip specified, bind on localhost - If no -rpcbind specified, bind on any interface Implements part of #3111. --- src/init.cpp | 3 +- src/rpcserver.cpp | 95 ++++++++++++++++++++++++++++++----------------- 2 files changed, 62 insertions(+), 36 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 7007707855..7664988762 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -304,10 +304,11 @@ std::string HelpMessage(HelpMessageMode hmm) strUsage += "\n" + _("RPC server options:") + "\n"; strUsage += " -server " + _("Accept command line and JSON-RPC commands") + "\n"; + strUsage += " -rpcbind= " + _("Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces)") + "\n"; strUsage += " -rpcuser= " + _("Username for JSON-RPC connections") + "\n"; strUsage += " -rpcpassword= " + _("Password for JSON-RPC connections") + "\n"; strUsage += " -rpcport= " + _("Listen for JSON-RPC connections on (default: 8332 or testnet: 18332)") + "\n"; - strUsage += " -rpcallowip= " + _("Allow JSON-RPC connections from specified IP address") + "\n"; + strUsage += " -rpcallowip= " + _("Allow JSON-RPC connections from specified IP address. This option can be specified multiple times") + "\n"; strUsage += " -rpcthreads= " + _("Set the number of threads to service RPC calls (default: 4)") + "\n"; strUsage += "\n" + _("RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions)") + "\n"; diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index d4a229b092..2534a9dcf4 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -508,6 +508,14 @@ static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptorimpl(), strCiphers.c_str()); } - // Try a dual IPv6/IPv4 socket, falling back to separate IPv4 and IPv6 sockets - const bool loopback = !mapArgs.count("-rpcallowip"); - asio::ip::address bindAddress = loopback ? asio::ip::address_v6::loopback() : asio::ip::address_v6::any(); - ip::tcp::endpoint endpoint(bindAddress, GetArg("-rpcport", Params().RPCPort())); - boost::system::error_code v6_only_error; + std::vector vEndpoints; + bool bBindAny = false; + int defaultPort = GetArg("-rpcport", Params().RPCPort()); + if (!mapArgs.count("-rpcallowip")) // Default to loopback if not allowing external IPs + { + vEndpoints.push_back(ip::tcp::endpoint(asio::ip::address_v6::loopback(), defaultPort)); + vEndpoints.push_back(ip::tcp::endpoint(asio::ip::address_v4::loopback(), defaultPort)); + if (mapArgs.count("-rpcbind")) + { + LogPrintf("WARNING: option -rpcbind was ignored because -rpcallowip was not specified, refusing to allow everyone to connect\n"); + } + } else if (mapArgs.count("-rpcbind")) // Specific bind address + { + BOOST_FOREACH(const std::string &addr, mapMultiArgs["-rpcbind"]) + { + try { + vEndpoints.push_back(ParseEndpoint(addr, defaultPort)); + } + catch(boost::system::system_error &e) + { + uiInterface.ThreadSafeMessageBox( + strprintf(_("Could not parse -rpcbind value %s as network address"), addr), + "", CClientUIInterface::MSG_ERROR); + StartShutdown(); + return; + } + } + } else { // No specific bind address specified, bind to any + vEndpoints.push_back(ip::tcp::endpoint(asio::ip::address_v6::any(), defaultPort)); + vEndpoints.push_back(ip::tcp::endpoint(asio::ip::address_v4::any(), defaultPort)); + // Prefer making the socket dual IPv6/IPv4 instead of binding + // to both addresses seperately. + bBindAny = true; + } bool fListening = false; std::string strerr; - try + BOOST_FOREACH(const ip::tcp::endpoint &endpoint, vEndpoints) { + asio::ip::address bindAddress = endpoint.address(); + LogPrintf("Binding RPC on address %s port %i (IPv4+IPv6 bind any: %i)\n", bindAddress.to_string(), endpoint.port(), bBindAny); + boost::system::error_code v6_only_error; boost::shared_ptr acceptor(new ip::tcp::acceptor(*rpc_io_service)); rpc_acceptors.push_back(acceptor); - acceptor->open(endpoint.protocol()); - acceptor->set_option(boost::asio::ip::tcp::acceptor::reuse_address(true)); - // Try making the socket dual IPv6/IPv4 (if listening on the "any" address) - acceptor->set_option(boost::asio::ip::v6_only(loopback), v6_only_error); - - acceptor->bind(endpoint); - acceptor->listen(socket_base::max_connections); - - RPCListen(acceptor, *rpc_ssl_context, fUseSSL); - - fListening = true; - } - catch(boost::system::system_error &e) - { - strerr = strprintf(_("An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s"), endpoint.port(), e.what()); - } - try { - // If dual IPv6/IPv4 failed (or we're opening loopback interfaces only), open IPv4 separately - if (!fListening || loopback || v6_only_error) - { - bindAddress = loopback ? asio::ip::address_v4::loopback() : asio::ip::address_v4::any(); - endpoint.address(bindAddress); - - boost::shared_ptr acceptor(new ip::tcp::acceptor(*rpc_io_service)); - rpc_acceptors.push_back(acceptor); + try { acceptor->open(endpoint.protocol()); acceptor->set_option(boost::asio::ip::tcp::acceptor::reuse_address(true)); + + // Try making the socket dual IPv6/IPv4 when listening on the IPv6 "any" address + acceptor->set_option(boost::asio::ip::v6_only( + !bBindAny || bindAddress != asio::ip::address_v6::any()), v6_only_error); + acceptor->bind(endpoint); acceptor->listen(socket_base::max_connections); RPCListen(acceptor, *rpc_ssl_context, fUseSSL); fListening = true; + // If dual IPv6/IPv4 bind succesful, skip binding to IPv4 separately + if(bBindAny && bindAddress == asio::ip::address_v6::any() && !v6_only_error) + break; + } + catch(boost::system::system_error &e) + { + LogPrintf("ERROR: Binding RPC on address %s port %i failed: %s\n", bindAddress.to_string(), endpoint.port(), e.what()); + strerr = strprintf(_("An error occurred while setting up the RPC address %s port %u for listening: %s"), bindAddress.to_string(), endpoint.port(), e.what()); } - } - catch(boost::system::system_error &e) - { - strerr = strprintf(_("An error occurred while setting up the RPC port %u for listening on IPv4: %s"), endpoint.port(), e.what()); } if (!fListening) { From f923c077547ceb8492e11001d571ba27145242ef Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 7 Apr 2014 16:22:59 +0200 Subject: [PATCH 0054/1288] Support IPv6 lookup in bitcoin-cli even when IPv6 only bound on localhost First query in the current way (intelligently determining which network has a non-localhost interface). If this does not succeed, try plain lookup. Needed for testing. Fixes #1827 by always allowing IPv6 to be used. --- src/rpcprotocol.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/rpcprotocol.h b/src/rpcprotocol.h index 8b3df19621..11bdd171d9 100644 --- a/src/rpcprotocol.h +++ b/src/rpcprotocol.h @@ -103,11 +103,27 @@ public: } bool connect(const std::string& server, const std::string& port) { - boost::asio::ip::tcp::resolver resolver(stream.get_io_service()); - boost::asio::ip::tcp::resolver::query query(server.c_str(), port.c_str()); - boost::asio::ip::tcp::resolver::iterator endpoint_iterator = resolver.resolve(query); - boost::asio::ip::tcp::resolver::iterator end; + using namespace boost::asio::ip; + tcp::resolver resolver(stream.get_io_service()); + tcp::resolver::iterator endpoint_iterator; +#if BOOST_VERSION >= 104300 + try { +#endif + // The default query (flags address_configured) tries IPv6 if + // non-localhost IPv6 configured, and IPv4 if non-localhost IPv4 + // configured. + tcp::resolver::query query(server.c_str(), port.c_str()); + endpoint_iterator = resolver.resolve(query); +#if BOOST_VERSION >= 104300 + } catch(boost::system::system_error &e) + { + // If we at first don't succeed, try blanket lookup (IPv4+IPv6 independent of configured interfaces) + tcp::resolver::query query(server.c_str(), port.c_str(), resolver_query_base::flags()); + endpoint_iterator = resolver.resolve(query); + } +#endif boost::system::error_code error = boost::asio::error::host_not_found; + tcp::resolver::iterator end; while (error && endpoint_iterator != end) { stream.lowest_layer().close(); From b5ad5e783d6f636d5ca5703919d05fd0119a34fc Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 7 Apr 2014 17:29:36 +0200 Subject: [PATCH 0055/1288] Add Python test for -rpcbind and -rpcallowip Add a new test, `rpcbind_test.py`, that extensively tests the new `-rpcbind` functionality. --- qa/rpc-tests/netutil.py | 134 ++++++++++++++++++++++++++++++ qa/rpc-tests/rpcbind_test.py | 152 +++++++++++++++++++++++++++++++++++ qa/rpc-tests/util.py | 32 +++++++- 3 files changed, 314 insertions(+), 4 deletions(-) create mode 100644 qa/rpc-tests/netutil.py create mode 100755 qa/rpc-tests/rpcbind_test.py diff --git a/qa/rpc-tests/netutil.py b/qa/rpc-tests/netutil.py new file mode 100644 index 0000000000..9bea2e355e --- /dev/null +++ b/qa/rpc-tests/netutil.py @@ -0,0 +1,134 @@ +# Linux network utilities +import sys +import socket +import fcntl +import struct +import array +import os +import binascii + +# Roughly based on http://voorloopnul.com/blog/a-python-netstat-in-less-than-100-lines-of-code/ by Ricardo Pascal +STATE_ESTABLISHED = '01' +STATE_SYN_SENT = '02' +STATE_SYN_RECV = '03' +STATE_FIN_WAIT1 = '04' +STATE_FIN_WAIT2 = '05' +STATE_TIME_WAIT = '06' +STATE_CLOSE = '07' +STATE_CLOSE_WAIT = '08' +STATE_LAST_ACK = '09' +STATE_LISTEN = '0A' +STATE_CLOSING = '0B' + +def get_socket_inodes(pid): + ''' + Get list of socket inodes for process pid. + ''' + base = '/proc/%i/fd' % pid + inodes = [] + for item in os.listdir(base): + target = os.readlink(os.path.join(base, item)) + if target.startswith('socket:'): + inodes.append(int(target[8:-1])) + return inodes + +def _remove_empty(array): + return [x for x in array if x !=''] + +def _convert_ip_port(array): + host,port = array.split(':') + # convert host from mangled-per-four-bytes form as used by kernel + host = binascii.unhexlify(host) + host_out = '' + for x in range(0, len(host)/4): + (val,) = struct.unpack('=I', host[x*4:(x+1)*4]) + host_out += '%08x' % val + + return host_out,int(port,16) + +def netstat(typ='tcp'): + ''' + Function to return a list with status of tcp connections at linux systems + To get pid of all network process running on system, you must run this script + as superuser + ''' + with open('/proc/net/'+typ,'r') as f: + content = f.readlines() + content.pop(0) + result = [] + for line in content: + line_array = _remove_empty(line.split(' ')) # Split lines and remove empty spaces. + tcp_id = line_array[0] + l_addr = _convert_ip_port(line_array[1]) + r_addr = _convert_ip_port(line_array[2]) + state = line_array[3] + inode = int(line_array[9]) # Need the inode to match with process pid. + nline = [tcp_id, l_addr, r_addr, state, inode] + result.append(nline) + return result + +def get_bind_addrs(pid): + ''' + Get bind addresses as (host,port) tuples for process pid. + ''' + inodes = get_socket_inodes(pid) + bind_addrs = [] + for conn in netstat('tcp') + netstat('tcp6'): + if conn[3] == STATE_LISTEN and conn[4] in inodes: + bind_addrs.append(conn[1]) + return bind_addrs + +# from: http://code.activestate.com/recipes/439093/ +def all_interfaces(): + ''' + Return all interfaces that are up + ''' + is_64bits = sys.maxsize > 2**32 + struct_size = 40 if is_64bits else 32 + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + max_possible = 8 # initial value + while True: + bytes = max_possible * struct_size + names = array.array('B', '\0' * bytes) + outbytes = struct.unpack('iL', fcntl.ioctl( + s.fileno(), + 0x8912, # SIOCGIFCONF + struct.pack('iL', bytes, names.buffer_info()[0]) + ))[0] + if outbytes == bytes: + max_possible *= 2 + else: + break + namestr = names.tostring() + return [(namestr[i:i+16].split('\0', 1)[0], + socket.inet_ntoa(namestr[i+20:i+24])) + for i in range(0, outbytes, struct_size)] + +def addr_to_hex(addr): + ''' + Convert string IPv4 or IPv6 address to binary address as returned by + get_bind_addrs. + Very naive implementation that certainly doesn't work for all IPv6 variants. + ''' + if '.' in addr: # IPv4 + addr = [int(x) for x in addr.split('.')] + elif ':' in addr: # IPv6 + sub = [[], []] # prefix, suffix + x = 0 + addr = addr.split(':') + for i,comp in enumerate(addr): + if comp == '': + if i == 0 or i == (len(addr)-1): # skip empty component at beginning or end + continue + x += 1 # :: skips to suffix + assert(x < 2) + else: # two bytes per component + val = int(comp, 16) + sub[x].append(val >> 8) + sub[x].append(val & 0xff) + nullbytes = 16 - len(sub[0]) - len(sub[1]) + assert((x == 0 and nullbytes == 0) or (x == 1 and nullbytes > 0)) + addr = sub[0] + ([0] * nullbytes) + sub[1] + else: + raise ValueError('Could not parse address %s' % addr) + return binascii.hexlify(bytearray(addr)) diff --git a/qa/rpc-tests/rpcbind_test.py b/qa/rpc-tests/rpcbind_test.py new file mode 100755 index 0000000000..a31f8d98ef --- /dev/null +++ b/qa/rpc-tests/rpcbind_test.py @@ -0,0 +1,152 @@ +#!/usr/bin/env python +# Copyright (c) 2014 The Bitcoin Core developers +# Distributed under the MIT/X11 software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +# Test for -rpcbind, as well as -rpcallowip and -rpcconnect + +# Add python-bitcoinrpc to module search path: +import os +import sys +sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc")) + +import json +import shutil +import subprocess +import tempfile +import traceback + +from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException +from util import * +from netutil import * + +def run_bind_test(tmpdir, allow_ips, connect_to, addresses, expected): + ''' + Start a node with requested rpcallowip and rpcbind parameters, + then try to connect, and check if the set of bound addresses + matches the expected set. + ''' + expected = [(addr_to_hex(addr), port) for (addr, port) in expected] + base_args = ['-disablewallet', '-nolisten'] + if allow_ips: + base_args += ['-rpcallowip=' + x for x in allow_ips] + binds = ['-rpcbind='+addr for addr in addresses] + nodes = start_nodes(1, tmpdir, [base_args + binds], connect_to) + try: + pid = bitcoind_processes[0].pid + assert_equal(set(get_bind_addrs(pid)), set(expected)) + finally: + stop_nodes(nodes) + wait_bitcoinds() + +def run_allowip_test(tmpdir, allow_ips, rpchost): + ''' + Start a node with rpcwallow IP, and request getinfo + at a non-localhost IP. + ''' + base_args = ['-disablewallet', '-nolisten'] + ['-rpcallowip='+x for x in allow_ips] + nodes = start_nodes(1, tmpdir, [base_args]) + try: + # connect to node through non-loopback interface + url = "http://rt:rt@%s:%d" % (rpchost, START_RPC_PORT,) + node = AuthServiceProxy(url) + node.getinfo() + finally: + node = None # make sure connection will be garbage collected and closed + stop_nodes(nodes) + wait_bitcoinds() + + +def run_test(tmpdir): + assert(sys.platform == 'linux2') # due to OS-specific network stats queries, this test works only on Linux + # find the first non-loopback interface for testing + non_loopback_ip = None + for name,ip in all_interfaces(): + if ip != '127.0.0.1': + non_loopback_ip = ip + break + if non_loopback_ip is None: + assert(not 'This test requires at least one non-loopback IPv4 interface') + print("Using interface %s for testing" % non_loopback_ip) + + # check default without rpcallowip (IPv4 and IPv6 localhost) + run_bind_test(tmpdir, None, '127.0.0.1', [], + [('127.0.0.1', 11100), ('::1', 11100)]) + # check default with rpcallowip (IPv6 any) + run_bind_test(tmpdir, ['127.0.0.1'], '127.0.0.1', [], + [('::0', 11100)]) + # check only IPv4 localhost (explicit) + run_bind_test(tmpdir, ['127.0.0.1'], '127.0.0.1', ['127.0.0.1'], + [('127.0.0.1', START_RPC_PORT)]) + # check only IPv4 localhost (explicit) with alternative port + run_bind_test(tmpdir, ['127.0.0.1'], '127.0.0.1:32171', ['127.0.0.1:32171'], + [('127.0.0.1', 32171)]) + # check only IPv4 localhost (explicit) with multiple alternative ports on same host + run_bind_test(tmpdir, ['127.0.0.1'], '127.0.0.1:32171', ['127.0.0.1:32171', '127.0.0.1:32172'], + [('127.0.0.1', 32171), ('127.0.0.1', 32172)]) + # check only IPv6 localhost (explicit) + run_bind_test(tmpdir, ['[::1]'], '[::1]', ['[::1]'], + [('::1', 11100)]) + # check both IPv4 and IPv6 localhost (explicit) + run_bind_test(tmpdir, ['127.0.0.1'], '127.0.0.1', ['127.0.0.1', '[::1]'], + [('127.0.0.1', START_RPC_PORT), ('::1', START_RPC_PORT)]) + # check only non-loopback interface + run_bind_test(tmpdir, [non_loopback_ip], non_loopback_ip, [non_loopback_ip], + [(non_loopback_ip, START_RPC_PORT)]) + + # Check that with invalid rpcallowip, we are denied + run_allowip_test(tmpdir, [non_loopback_ip], non_loopback_ip) + try: + run_allowip_test(tmpdir, ['1.1.1.1'], non_loopback_ip) + assert(not 'Connection not denied by rpcallowip as expected') + except ValueError: + pass + +def main(): + import optparse + + parser = optparse.OptionParser(usage="%prog [options]") + parser.add_option("--nocleanup", dest="nocleanup", default=False, action="store_true", + help="Leave bitcoinds and test.* datadir on exit or error") + parser.add_option("--srcdir", dest="srcdir", default="../../src", + help="Source directory containing bitcoind/bitcoin-cli (default: %default%)") + parser.add_option("--tmpdir", dest="tmpdir", default=tempfile.mkdtemp(prefix="test"), + help="Root directory for datadirs") + (options, args) = parser.parse_args() + + os.environ['PATH'] = options.srcdir+":"+os.environ['PATH'] + + check_json_precision() + + success = False + nodes = [] + try: + print("Initializing test directory "+options.tmpdir) + if not os.path.isdir(options.tmpdir): + os.makedirs(options.tmpdir) + initialize_chain(options.tmpdir) + + run_test(options.tmpdir) + + success = True + + except AssertionError as e: + print("Assertion failed: "+e.message) + except Exception as e: + print("Unexpected exception caught during testing: "+str(e)) + traceback.print_tb(sys.exc_info()[2]) + + if not options.nocleanup: + print("Cleaning up") + wait_bitcoinds() + shutil.rmtree(options.tmpdir) + + if success: + print("Tests successful") + sys.exit(0) + else: + print("Failed") + sys.exit(1) + +if __name__ == '__main__': + main() diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index 1d0896a3fb..40f4a1458f 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -15,6 +15,7 @@ import json import shutil import subprocess import time +import re from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from util import * @@ -112,20 +113,43 @@ def initialize_chain(test_dir): to_dir = os.path.join(test_dir, "node"+str(i)) shutil.copytree(from_dir, to_dir) -def start_nodes(num_nodes, dir): +def _rpchost_to_args(rpchost): + '''Convert optional IP:port spec to rpcconnect/rpcport args''' + if rpchost is None: + return [] + + match = re.match('(\[[0-9a-fA-f:]+\]|[^:]+)(?::([0-9]+))?$', rpchost) + if not match: + raise ValueError('Invalid RPC host spec ' + rpchost) + + rpcconnect = match.group(1) + rpcport = match.group(2) + + if rpcconnect.startswith('['): # remove IPv6 [...] wrapping + rpcconnect = rpcconnect[1:-1] + + rv = ['-rpcconnect=' + rpcconnect] + if rpcport: + rv += ['-rpcport=' + rpcport] + return rv + +def start_nodes(num_nodes, dir, extra_args=None, rpchost=None): # Start bitcoinds, and wait for RPC interface to be up and running: devnull = open("/dev/null", "w+") for i in range(num_nodes): datadir = os.path.join(dir, "node"+str(i)) args = [ "bitcoind", "-datadir="+datadir ] + if extra_args is not None: + args += extra_args[i] bitcoind_processes.append(subprocess.Popen(args)) - subprocess.check_call([ "bitcoin-cli", "-datadir="+datadir, - "-rpcwait", "getblockcount"], stdout=devnull) + subprocess.check_call([ "bitcoin-cli", "-datadir="+datadir] + + _rpchost_to_args(rpchost) + + ["-rpcwait", "getblockcount"], stdout=devnull) devnull.close() # Create&return JSON-RPC connections rpc_connections = [] for i in range(num_nodes): - url = "http://rt:rt@127.0.0.1:%d"%(START_RPC_PORT+i,) + url = "http://rt:rt@%s:%d" % (rpchost or '127.0.0.1', START_RPC_PORT+i,) rpc_connections.append(AuthServiceProxy(url)) return rpc_connections From 4b61a6a47895309ffb059f986a31c4931b8fe0b4 Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Mon, 5 May 2014 20:08:13 +0200 Subject: [PATCH 0056/1288] switch from boost int types to --- src/json/json_spirit_reader_template.h | 12 +++--- src/json/json_spirit_value.h | 31 ++++++++------- src/rpcblockchain.cpp | 14 +++---- src/rpcclient.cpp | 52 +++++++++++++------------- src/rpcmining.cpp | 6 +-- src/rpcmisc.cpp | 6 +-- src/rpcnet.cpp | 16 ++++---- src/rpcrawtransaction.cpp | 12 +++--- src/rpcwallet.cpp | 12 +++--- 9 files changed, 80 insertions(+), 81 deletions(-) diff --git a/src/json/json_spirit_reader_template.h b/src/json/json_spirit_reader_template.h index 4dec00e6c9..46f5892f62 100644 --- a/src/json/json_spirit_reader_template.h +++ b/src/json/json_spirit_reader_template.h @@ -33,8 +33,8 @@ namespace json_spirit { - const spirit_namespace::int_parser < boost::int64_t > int64_p = spirit_namespace::int_parser < boost::int64_t >(); - const spirit_namespace::uint_parser< boost::uint64_t > uint64_p = spirit_namespace::uint_parser< boost::uint64_t >(); + const spirit_namespace::int_parser < int64_t > int64_p = spirit_namespace::int_parser < int64_t >(); + const spirit_namespace::uint_parser< uint64_t > uint64_p = spirit_namespace::uint_parser< uint64_t >(); template< class Iter_type > bool is_eq( Iter_type first, Iter_type last, const char* c_str ) @@ -270,12 +270,12 @@ namespace json_spirit add_to_current( Value_type() ); } - void new_int( boost::int64_t i ) + void new_int( int64_t i ) { add_to_current( i ); } - void new_uint64( boost::uint64_t ui ) + void new_uint64( uint64_t ui ) { add_to_current( ui ); } @@ -425,8 +425,8 @@ namespace json_spirit typedef boost::function< void( Char_type ) > Char_action; typedef boost::function< void( Iter_type, Iter_type ) > Str_action; typedef boost::function< void( double ) > Real_action; - typedef boost::function< void( boost::int64_t ) > Int_action; - typedef boost::function< void( boost::uint64_t ) > Uint64_action; + typedef boost::function< void( int64_t ) > Int_action; + typedef boost::function< void( uint64_t ) > Uint64_action; Char_action begin_obj ( boost::bind( &Semantic_actions_t::begin_obj, &self.actions_, _1 ) ); Char_action end_obj ( boost::bind( &Semantic_actions_t::end_obj, &self.actions_, _1 ) ); diff --git a/src/json/json_spirit_value.h b/src/json/json_spirit_value.h index 7e83a2a7e3..88c0e1f736 100644 --- a/src/json/json_spirit_value.h +++ b/src/json/json_spirit_value.h @@ -17,7 +17,6 @@ #include #include #include -#include #include #include @@ -45,8 +44,8 @@ namespace json_spirit Value_impl( const Array& value ); Value_impl( bool value ); Value_impl( int value ); - Value_impl( boost::int64_t value ); - Value_impl( boost::uint64_t value ); + Value_impl( int64_t value ); + Value_impl( uint64_t value ); Value_impl( double value ); Value_impl( const Value_impl& other ); @@ -65,8 +64,8 @@ namespace json_spirit const Array& get_array() const; bool get_bool() const; int get_int() const; - boost::int64_t get_int64() const; - boost::uint64_t get_uint64() const; + int64_t get_int64() const; + uint64_t get_uint64() const; double get_real() const; Object& get_obj(); @@ -83,7 +82,7 @@ namespace json_spirit typedef boost::variant< String_type, boost::recursive_wrapper< Object >, boost::recursive_wrapper< Array >, - bool, boost::int64_t, double > Variant; + bool, int64_t, double > Variant; Value_type type_; Variant v_; @@ -258,13 +257,13 @@ namespace json_spirit template< class Config > Value_impl< Config >::Value_impl( int value ) : type_( int_type ) - , v_( static_cast< boost::int64_t >( value ) ) + , v_( static_cast< int64_t >( value ) ) , is_uint64_( false ) { } template< class Config > - Value_impl< Config >::Value_impl( boost::int64_t value ) + Value_impl< Config >::Value_impl( int64_t value ) : type_( int_type ) , v_( value ) , is_uint64_( false ) @@ -272,9 +271,9 @@ namespace json_spirit } template< class Config > - Value_impl< Config >::Value_impl( boost::uint64_t value ) + Value_impl< Config >::Value_impl( uint64_t value ) : type_( int_type ) - , v_( static_cast< boost::int64_t >( value ) ) + , v_( static_cast< int64_t >( value ) ) , is_uint64_( true ) { } @@ -390,19 +389,19 @@ namespace json_spirit } template< class Config > - boost::int64_t Value_impl< Config >::get_int64() const + int64_t Value_impl< Config >::get_int64() const { check_type( int_type ); - return boost::get< boost::int64_t >( v_ ); + return boost::get< int64_t >( v_ ); } template< class Config > - boost::uint64_t Value_impl< Config >::get_uint64() const + uint64_t Value_impl< Config >::get_uint64() const { check_type( int_type ); - return static_cast< boost::uint64_t >( get_int64() ); + return static_cast< uint64_t >( get_int64() ); } template< class Config > @@ -481,13 +480,13 @@ namespace json_spirit } template< class Value > - boost::int64_t get_value( const Value& value, Type_to_type< boost::int64_t > ) + int64_t get_value( const Value& value, Type_to_type< int64_t > ) { return value.get_int64(); } template< class Value > - boost::uint64_t get_value( const Value& value, Type_to_type< boost::uint64_t > ) + uint64_t get_value( const Value& value, Type_to_type< uint64_t > ) { return value.get_uint64(); } diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 1ed8a8e866..0a0fff41d7 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -64,8 +64,8 @@ Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex) BOOST_FOREACH(const CTransaction&tx, block.vtx) txs.push_back(tx.GetHash().GetHex()); result.push_back(Pair("tx", txs)); - result.push_back(Pair("time", (boost::int64_t)block.GetBlockTime())); - result.push_back(Pair("nonce", (boost::uint64_t)block.nNonce)); + result.push_back(Pair("time", (int64_t)block.GetBlockTime())); + result.push_back(Pair("nonce", (uint64_t)block.nNonce)); result.push_back(Pair("bits", HexBits(block.nBits))); result.push_back(Pair("difficulty", GetDifficulty(blockindex))); result.push_back(Pair("chainwork", blockindex->nChainWork.GetHex())); @@ -175,7 +175,7 @@ Value getrawmempool(const Array& params, bool fHelp) Object info; info.push_back(Pair("size", (int)e.GetTxSize())); info.push_back(Pair("fee", ValueFromAmount(e.GetFee()))); - info.push_back(Pair("time", (boost::int64_t)e.GetTime())); + info.push_back(Pair("time", (int64_t)e.GetTime())); info.push_back(Pair("height", (int)e.GetHeight())); info.push_back(Pair("startingpriority", e.GetPriority(e.GetHeight()))); info.push_back(Pair("currentpriority", e.GetPriority(chainActive.Height()))); @@ -315,11 +315,11 @@ Value gettxoutsetinfo(const Array& params, bool fHelp) CCoinsStats stats; if (pcoinsTip->GetStats(stats)) { - ret.push_back(Pair("height", (boost::int64_t)stats.nHeight)); + ret.push_back(Pair("height", (int64_t)stats.nHeight)); ret.push_back(Pair("bestblock", stats.hashBlock.GetHex())); - ret.push_back(Pair("transactions", (boost::int64_t)stats.nTransactions)); - ret.push_back(Pair("txouts", (boost::int64_t)stats.nTransactionOutputs)); - ret.push_back(Pair("bytes_serialized", (boost::int64_t)stats.nSerializedSize)); + ret.push_back(Pair("transactions", (int64_t)stats.nTransactions)); + ret.push_back(Pair("txouts", (int64_t)stats.nTransactionOutputs)); + ret.push_back(Pair("bytes_serialized", (int64_t)stats.nSerializedSize)); ret.push_back(Pair("hash_serialized", stats.hashSerialized.GetHex())); ret.push_back(Pair("total_amount", ValueFromAmount(stats.nTotalAmount))); } diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index 8620a87297..4f3c39ce9b 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -128,53 +128,53 @@ Array RPCConvertValues(const std::string &strMethod, const std::vector 0) ConvertTo(params[0]); if (strMethod == "getaddednodeinfo" && n > 0) ConvertTo(params[0]); if (strMethod == "setgenerate" && n > 0) ConvertTo(params[0]); - if (strMethod == "setgenerate" && n > 1) ConvertTo(params[1]); - if (strMethod == "getnetworkhashps" && n > 0) ConvertTo(params[0]); - if (strMethod == "getnetworkhashps" && n > 1) ConvertTo(params[1]); + if (strMethod == "setgenerate" && n > 1) ConvertTo(params[1]); + if (strMethod == "getnetworkhashps" && n > 0) ConvertTo(params[0]); + if (strMethod == "getnetworkhashps" && n > 1) ConvertTo(params[1]); if (strMethod == "sendtoaddress" && n > 1) ConvertTo(params[1]); if (strMethod == "settxfee" && n > 0) ConvertTo(params[0]); - if (strMethod == "getreceivedbyaddress" && n > 1) ConvertTo(params[1]); - if (strMethod == "getreceivedbyaccount" && n > 1) ConvertTo(params[1]); - if (strMethod == "listreceivedbyaddress" && n > 0) ConvertTo(params[0]); + if (strMethod == "getreceivedbyaddress" && n > 1) ConvertTo(params[1]); + if (strMethod == "getreceivedbyaccount" && n > 1) ConvertTo(params[1]); + if (strMethod == "listreceivedbyaddress" && n > 0) ConvertTo(params[0]); if (strMethod == "listreceivedbyaddress" && n > 1) ConvertTo(params[1]); - if (strMethod == "listreceivedbyaccount" && n > 0) ConvertTo(params[0]); + if (strMethod == "listreceivedbyaccount" && n > 0) ConvertTo(params[0]); if (strMethod == "listreceivedbyaccount" && n > 1) ConvertTo(params[1]); - if (strMethod == "getbalance" && n > 1) ConvertTo(params[1]); - if (strMethod == "getblockhash" && n > 0) ConvertTo(params[0]); + if (strMethod == "getbalance" && n > 1) ConvertTo(params[1]); + if (strMethod == "getblockhash" && n > 0) ConvertTo(params[0]); if (strMethod == "move" && n > 2) ConvertTo(params[2]); - if (strMethod == "move" && n > 3) ConvertTo(params[3]); + if (strMethod == "move" && n > 3) ConvertTo(params[3]); if (strMethod == "sendfrom" && n > 2) ConvertTo(params[2]); - if (strMethod == "sendfrom" && n > 3) ConvertTo(params[3]); - if (strMethod == "listtransactions" && n > 1) ConvertTo(params[1]); - if (strMethod == "listtransactions" && n > 2) ConvertTo(params[2]); - if (strMethod == "listaccounts" && n > 0) ConvertTo(params[0]); - if (strMethod == "walletpassphrase" && n > 1) ConvertTo(params[1]); + if (strMethod == "sendfrom" && n > 3) ConvertTo(params[3]); + if (strMethod == "listtransactions" && n > 1) ConvertTo(params[1]); + if (strMethod == "listtransactions" && n > 2) ConvertTo(params[2]); + if (strMethod == "listaccounts" && n > 0) ConvertTo(params[0]); + if (strMethod == "walletpassphrase" && n > 1) ConvertTo(params[1]); if (strMethod == "getblocktemplate" && n > 0) ConvertTo(params[0]); - if (strMethod == "listsinceblock" && n > 1) ConvertTo(params[1]); + if (strMethod == "listsinceblock" && n > 1) ConvertTo(params[1]); if (strMethod == "sendmany" && n > 1) ConvertTo(params[1]); - if (strMethod == "sendmany" && n > 2) ConvertTo(params[2]); - if (strMethod == "addmultisigaddress" && n > 0) ConvertTo(params[0]); + if (strMethod == "sendmany" && n > 2) ConvertTo(params[2]); + if (strMethod == "addmultisigaddress" && n > 0) ConvertTo(params[0]); if (strMethod == "addmultisigaddress" && n > 1) ConvertTo(params[1]); - if (strMethod == "createmultisig" && n > 0) ConvertTo(params[0]); + if (strMethod == "createmultisig" && n > 0) ConvertTo(params[0]); if (strMethod == "createmultisig" && n > 1) ConvertTo(params[1]); - if (strMethod == "listunspent" && n > 0) ConvertTo(params[0]); - if (strMethod == "listunspent" && n > 1) ConvertTo(params[1]); + if (strMethod == "listunspent" && n > 0) ConvertTo(params[0]); + if (strMethod == "listunspent" && n > 1) ConvertTo(params[1]); if (strMethod == "listunspent" && n > 2) ConvertTo(params[2]); if (strMethod == "getblock" && n > 1) ConvertTo(params[1]); - if (strMethod == "getrawtransaction" && n > 1) ConvertTo(params[1]); + if (strMethod == "getrawtransaction" && n > 1) ConvertTo(params[1]); if (strMethod == "createrawtransaction" && n > 0) ConvertTo(params[0]); if (strMethod == "createrawtransaction" && n > 1) ConvertTo(params[1]); if (strMethod == "signrawtransaction" && n > 1) ConvertTo(params[1], true); if (strMethod == "signrawtransaction" && n > 2) ConvertTo(params[2], true); if (strMethod == "sendrawtransaction" && n > 1) ConvertTo(params[1], true); - if (strMethod == "gettxout" && n > 1) ConvertTo(params[1]); + if (strMethod == "gettxout" && n > 1) ConvertTo(params[1]); if (strMethod == "gettxout" && n > 2) ConvertTo(params[2]); if (strMethod == "lockunspent" && n > 0) ConvertTo(params[0]); if (strMethod == "lockunspent" && n > 1) ConvertTo(params[1]); if (strMethod == "importprivkey" && n > 2) ConvertTo(params[2]); - if (strMethod == "verifychain" && n > 0) ConvertTo(params[0]); - if (strMethod == "verifychain" && n > 1) ConvertTo(params[1]); - if (strMethod == "keypoolrefill" && n > 0) ConvertTo(params[0]); + if (strMethod == "verifychain" && n > 0) ConvertTo(params[0]); + if (strMethod == "verifychain" && n > 1) ConvertTo(params[1]); + if (strMethod == "keypoolrefill" && n > 0) ConvertTo(params[0]); if (strMethod == "getrawmempool" && n > 0) ConvertTo(params[0]); return params; diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index cb903b585a..23876c603d 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -88,7 +88,7 @@ Value GetNetworkHashPS(int lookup, int height) { uint256 workDiff = pb->nChainWork - pb0->nChainWork; int64_t timeDiff = maxTime - minTime; - return (boost::int64_t)(workDiff.getdouble() / timeDiff); + return (int64_t)(workDiff.getdouble() / timeDiff); } Value getnetworkhashps(const Array& params, bool fHelp) @@ -226,8 +226,8 @@ Value gethashespersec(const Array& params, bool fHelp) ); if (GetTimeMillis() - nHPSTimerStart > 8000) - return (boost::int64_t)0; - return (boost::int64_t)dHashesPerSec; + return (int64_t)0; + return (int64_t)dHashesPerSec; } #endif diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 2564a3f1a6..0dd98fd765 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -69,18 +69,18 @@ Value getinfo(const Array& params, bool fHelp) } #endif obj.push_back(Pair("blocks", (int)chainActive.Height())); - obj.push_back(Pair("timeoffset", (boost::int64_t)GetTimeOffset())); + obj.push_back(Pair("timeoffset", (int64_t)GetTimeOffset())); obj.push_back(Pair("connections", (int)vNodes.size())); obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string()))); obj.push_back(Pair("difficulty", (double)GetDifficulty())); obj.push_back(Pair("testnet", TestNet())); #ifdef ENABLE_WALLET if (pwalletMain) { - obj.push_back(Pair("keypoololdest", (boost::int64_t)pwalletMain->GetOldestKeyPoolTime())); + obj.push_back(Pair("keypoololdest", (int64_t)pwalletMain->GetOldestKeyPoolTime())); obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize())); } if (pwalletMain && pwalletMain->IsCrypted()) - obj.push_back(Pair("unlocked_until", (boost::int64_t)nWalletUnlockTime)); + obj.push_back(Pair("unlocked_until", (int64_t)nWalletUnlockTime)); obj.push_back(Pair("paytxfee", ValueFromAmount(nTransactionFee))); #endif obj.push_back(Pair("relayfee", ValueFromAmount(CTransaction::nMinRelayTxFee))); diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 573d6cd3f6..1dc70840ca 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -116,11 +116,11 @@ Value getpeerinfo(const Array& params, bool fHelp) if (!(stats.addrLocal.empty())) obj.push_back(Pair("addrlocal", stats.addrLocal)); obj.push_back(Pair("services", strprintf("%08x", stats.nServices))); - obj.push_back(Pair("lastsend", (boost::int64_t)stats.nLastSend)); - obj.push_back(Pair("lastrecv", (boost::int64_t)stats.nLastRecv)); - obj.push_back(Pair("bytessent", (boost::int64_t)stats.nSendBytes)); - obj.push_back(Pair("bytesrecv", (boost::int64_t)stats.nRecvBytes)); - obj.push_back(Pair("conntime", (boost::int64_t)stats.nTimeConnected)); + obj.push_back(Pair("lastsend", (int64_t)stats.nLastSend)); + obj.push_back(Pair("lastrecv", (int64_t)stats.nLastRecv)); + obj.push_back(Pair("bytessent", (int64_t)stats.nSendBytes)); + obj.push_back(Pair("bytesrecv", (int64_t)stats.nRecvBytes)); + obj.push_back(Pair("conntime", (int64_t)stats.nTimeConnected)); obj.push_back(Pair("pingtime", stats.dPingTime)); if (stats.dPingWait > 0.0) obj.push_back(Pair("pingwait", stats.dPingWait)); @@ -328,9 +328,9 @@ Value getnettotals(const Array& params, bool fHelp) ); Object obj; - obj.push_back(Pair("totalbytesrecv", static_cast< boost::uint64_t>(CNode::GetTotalBytesRecv()))); - obj.push_back(Pair("totalbytessent", static_cast(CNode::GetTotalBytesSent()))); - obj.push_back(Pair("timemillis", static_cast(GetTimeMillis()))); + obj.push_back(Pair("totalbytesrecv", static_cast< uint64_t>(CNode::GetTotalBytesRecv()))); + obj.push_back(Pair("totalbytessent", static_cast(CNode::GetTotalBytesSent()))); + obj.push_back(Pair("timemillis", static_cast(GetTimeMillis()))); return obj; } diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 50734a5c11..dee7daeb2a 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -55,7 +55,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry) { entry.push_back(Pair("txid", tx.GetHash().GetHex())); entry.push_back(Pair("version", tx.nVersion)); - entry.push_back(Pair("locktime", (boost::int64_t)tx.nLockTime)); + entry.push_back(Pair("locktime", (int64_t)tx.nLockTime)); Array vin; BOOST_FOREACH(const CTxIn& txin, tx.vin) { @@ -65,13 +65,13 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry) else { in.push_back(Pair("txid", txin.prevout.hash.GetHex())); - in.push_back(Pair("vout", (boost::int64_t)txin.prevout.n)); + in.push_back(Pair("vout", (int64_t)txin.prevout.n)); Object o; o.push_back(Pair("asm", txin.scriptSig.ToString())); o.push_back(Pair("hex", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()))); in.push_back(Pair("scriptSig", o)); } - in.push_back(Pair("sequence", (boost::int64_t)txin.nSequence)); + in.push_back(Pair("sequence", (int64_t)txin.nSequence)); vin.push_back(in); } entry.push_back(Pair("vin", vin)); @@ -81,7 +81,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry) const CTxOut& txout = tx.vout[i]; Object out; out.push_back(Pair("value", ValueFromAmount(txout.nValue))); - out.push_back(Pair("n", (boost::int64_t)i)); + out.push_back(Pair("n", (int64_t)i)); Object o; ScriptPubKeyToJSON(txout.scriptPubKey, o, true); out.push_back(Pair("scriptPubKey", o)); @@ -99,8 +99,8 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry) if (chainActive.Contains(pindex)) { entry.push_back(Pair("confirmations", 1 + chainActive.Height() - pindex->nHeight)); - entry.push_back(Pair("time", (boost::int64_t)pindex->nTime)); - entry.push_back(Pair("blocktime", (boost::int64_t)pindex->nTime)); + entry.push_back(Pair("time", (int64_t)pindex->nTime)); + entry.push_back(Pair("blocktime", (int64_t)pindex->nTime)); } else entry.push_back(Pair("confirmations", 0)); diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 2479a1f87e..c61035ab35 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -49,7 +49,7 @@ void WalletTxToJSON(const CWalletTx& wtx, Object& entry) { entry.push_back(Pair("blockhash", wtx.hashBlock.GetHex())); entry.push_back(Pair("blockindex", wtx.nIndex)); - entry.push_back(Pair("blocktime", (boost::int64_t)(mapBlockIndex[wtx.hashBlock]->nTime))); + entry.push_back(Pair("blocktime", (int64_t)(mapBlockIndex[wtx.hashBlock]->nTime))); } uint256 hash = wtx.GetHash(); entry.push_back(Pair("txid", hash.GetHex())); @@ -57,8 +57,8 @@ void WalletTxToJSON(const CWalletTx& wtx, Object& entry) BOOST_FOREACH(const uint256& conflict, wtx.GetConflicts()) conflicts.push_back(conflict.GetHex()); entry.push_back(Pair("walletconflicts", conflicts)); - entry.push_back(Pair("time", (boost::int64_t)wtx.GetTxTime())); - entry.push_back(Pair("timereceived", (boost::int64_t)wtx.nTimeReceived)); + entry.push_back(Pair("time", (int64_t)wtx.GetTxTime())); + entry.push_back(Pair("timereceived", (int64_t)wtx.nTimeReceived)); BOOST_FOREACH(const PAIRTYPE(string,string)& item, wtx.mapValue) entry.push_back(Pair(item.first, item.second)); } @@ -1167,7 +1167,7 @@ void AcentryToJSON(const CAccountingEntry& acentry, const string& strAccount, Ar Object entry; entry.push_back(Pair("account", acentry.strAccount)); entry.push_back(Pair("category", "move")); - entry.push_back(Pair("time", (boost::int64_t)acentry.nTime)); + entry.push_back(Pair("time", (int64_t)acentry.nTime)); entry.push_back(Pair("amount", ValueFromAmount(acentry.nCreditDebit))); entry.push_back(Pair("otheraccount", acentry.strOtherAccount)); entry.push_back(Pair("comment", acentry.strComment)); @@ -1912,9 +1912,9 @@ Value getwalletinfo(const Array& params, bool fHelp) obj.push_back(Pair("walletversion", pwalletMain->GetVersion())); obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance()))); obj.push_back(Pair("txcount", (int)pwalletMain->mapWallet.size())); - obj.push_back(Pair("keypoololdest", (boost::int64_t)pwalletMain->GetOldestKeyPoolTime())); + obj.push_back(Pair("keypoololdest", (int64_t)pwalletMain->GetOldestKeyPoolTime())); obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize())); if (pwalletMain->IsCrypted()) - obj.push_back(Pair("unlocked_until", (boost::int64_t)nWalletUnlockTime)); + obj.push_back(Pair("unlocked_until", (int64_t)nWalletUnlockTime)); return obj; } From 3e74ac22d5298f3259115848db5ac96e00d74e4a Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Mon, 5 May 2014 21:15:33 +0200 Subject: [PATCH 0057/1288] json_spirit: #include --- src/json/json_spirit_value.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/json/json_spirit_value.h b/src/json/json_spirit_value.h index 88c0e1f736..13cc89210c 100644 --- a/src/json/json_spirit_value.h +++ b/src/json/json_spirit_value.h @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include From d56e30ca898469cf5988b0fc9847ec79b43be49c Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Tue, 6 May 2014 14:58:43 +0200 Subject: [PATCH 0058/1288] removed a few unnecessary casts --- src/rpcblockchain.cpp | 4 ++-- src/rpcmisc.cpp | 6 +++--- src/rpcnet.cpp | 18 +++++++++--------- src/rpcwallet.cpp | 8 ++++---- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 0a0fff41d7..a303b5d3ef 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -64,7 +64,7 @@ Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex) BOOST_FOREACH(const CTransaction&tx, block.vtx) txs.push_back(tx.GetHash().GetHex()); result.push_back(Pair("tx", txs)); - result.push_back(Pair("time", (int64_t)block.GetBlockTime())); + result.push_back(Pair("time", block.GetBlockTime())); result.push_back(Pair("nonce", (uint64_t)block.nNonce)); result.push_back(Pair("bits", HexBits(block.nBits))); result.push_back(Pair("difficulty", GetDifficulty(blockindex))); @@ -175,7 +175,7 @@ Value getrawmempool(const Array& params, bool fHelp) Object info; info.push_back(Pair("size", (int)e.GetTxSize())); info.push_back(Pair("fee", ValueFromAmount(e.GetFee()))); - info.push_back(Pair("time", (int64_t)e.GetTime())); + info.push_back(Pair("time", e.GetTime())); info.push_back(Pair("height", (int)e.GetHeight())); info.push_back(Pair("startingpriority", e.GetPriority(e.GetHeight()))); info.push_back(Pair("currentpriority", e.GetPriority(chainActive.Height()))); diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 0dd98fd765..27d6d61a36 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -69,18 +69,18 @@ Value getinfo(const Array& params, bool fHelp) } #endif obj.push_back(Pair("blocks", (int)chainActive.Height())); - obj.push_back(Pair("timeoffset", (int64_t)GetTimeOffset())); + obj.push_back(Pair("timeoffset", GetTimeOffset())); obj.push_back(Pair("connections", (int)vNodes.size())); obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string()))); obj.push_back(Pair("difficulty", (double)GetDifficulty())); obj.push_back(Pair("testnet", TestNet())); #ifdef ENABLE_WALLET if (pwalletMain) { - obj.push_back(Pair("keypoololdest", (int64_t)pwalletMain->GetOldestKeyPoolTime())); + obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime())); obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize())); } if (pwalletMain && pwalletMain->IsCrypted()) - obj.push_back(Pair("unlocked_until", (int64_t)nWalletUnlockTime)); + obj.push_back(Pair("unlocked_until", nWalletUnlockTime)); obj.push_back(Pair("paytxfee", ValueFromAmount(nTransactionFee))); #endif obj.push_back(Pair("relayfee", ValueFromAmount(CTransaction::nMinRelayTxFee))); diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 1dc70840ca..024f6a09de 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -116,11 +116,11 @@ Value getpeerinfo(const Array& params, bool fHelp) if (!(stats.addrLocal.empty())) obj.push_back(Pair("addrlocal", stats.addrLocal)); obj.push_back(Pair("services", strprintf("%08x", stats.nServices))); - obj.push_back(Pair("lastsend", (int64_t)stats.nLastSend)); - obj.push_back(Pair("lastrecv", (int64_t)stats.nLastRecv)); - obj.push_back(Pair("bytessent", (int64_t)stats.nSendBytes)); - obj.push_back(Pair("bytesrecv", (int64_t)stats.nRecvBytes)); - obj.push_back(Pair("conntime", (int64_t)stats.nTimeConnected)); + obj.push_back(Pair("lastsend", stats.nLastSend)); + obj.push_back(Pair("lastrecv", stats.nLastRecv)); + obj.push_back(Pair("bytessent", stats.nSendBytes)); + obj.push_back(Pair("bytesrecv", stats.nRecvBytes)); + obj.push_back(Pair("conntime", stats.nTimeConnected)); obj.push_back(Pair("pingtime", stats.dPingTime)); if (stats.dPingWait > 0.0) obj.push_back(Pair("pingwait", stats.dPingWait)); @@ -328,9 +328,9 @@ Value getnettotals(const Array& params, bool fHelp) ); Object obj; - obj.push_back(Pair("totalbytesrecv", static_cast< uint64_t>(CNode::GetTotalBytesRecv()))); - obj.push_back(Pair("totalbytessent", static_cast(CNode::GetTotalBytesSent()))); - obj.push_back(Pair("timemillis", static_cast(GetTimeMillis()))); + obj.push_back(Pair("totalbytesrecv", CNode::GetTotalBytesRecv())); + obj.push_back(Pair("totalbytessent", CNode::GetTotalBytesSent())); + obj.push_back(Pair("timemillis", GetTimeMillis())); return obj; } @@ -365,7 +365,7 @@ Value getnetworkinfo(const Array& params, bool fHelp) Object obj; obj.push_back(Pair("version", (int)CLIENT_VERSION)); obj.push_back(Pair("protocolversion",(int)PROTOCOL_VERSION)); - obj.push_back(Pair("timeoffset", (boost::int64_t)GetTimeOffset())); + obj.push_back(Pair("timeoffset", GetTimeOffset())); obj.push_back(Pair("connections", (int)vNodes.size())); obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string()))); obj.push_back(Pair("relayfee", ValueFromAmount(CTransaction::nMinRelayTxFee))); diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index c61035ab35..a8f267d7fc 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -57,7 +57,7 @@ void WalletTxToJSON(const CWalletTx& wtx, Object& entry) BOOST_FOREACH(const uint256& conflict, wtx.GetConflicts()) conflicts.push_back(conflict.GetHex()); entry.push_back(Pair("walletconflicts", conflicts)); - entry.push_back(Pair("time", (int64_t)wtx.GetTxTime())); + entry.push_back(Pair("time", wtx.GetTxTime())); entry.push_back(Pair("timereceived", (int64_t)wtx.nTimeReceived)); BOOST_FOREACH(const PAIRTYPE(string,string)& item, wtx.mapValue) entry.push_back(Pair(item.first, item.second)); @@ -1167,7 +1167,7 @@ void AcentryToJSON(const CAccountingEntry& acentry, const string& strAccount, Ar Object entry; entry.push_back(Pair("account", acentry.strAccount)); entry.push_back(Pair("category", "move")); - entry.push_back(Pair("time", (int64_t)acentry.nTime)); + entry.push_back(Pair("time", acentry.nTime)); entry.push_back(Pair("amount", ValueFromAmount(acentry.nCreditDebit))); entry.push_back(Pair("otheraccount", acentry.strOtherAccount)); entry.push_back(Pair("comment", acentry.strComment)); @@ -1912,9 +1912,9 @@ Value getwalletinfo(const Array& params, bool fHelp) obj.push_back(Pair("walletversion", pwalletMain->GetVersion())); obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance()))); obj.push_back(Pair("txcount", (int)pwalletMain->mapWallet.size())); - obj.push_back(Pair("keypoololdest", (int64_t)pwalletMain->GetOldestKeyPoolTime())); + obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime())); obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize())); if (pwalletMain->IsCrypted()) - obj.push_back(Pair("unlocked_until", (int64_t)nWalletUnlockTime)); + obj.push_back(Pair("unlocked_until", nWalletUnlockTime)); return obj; } From be54b87f22f10bf84bc25d9e29bf1eed596dc764 Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Tue, 13 May 2014 11:11:02 +0200 Subject: [PATCH 0059/1288] remove ParseString(...) which is never used --- src/util.cpp | 20 -------------------- src/util.h | 1 - 2 files changed, 21 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 00e29446d5..205af738d5 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -303,26 +303,6 @@ int LogPrintStr(const std::string &str) return ret; } -void ParseString(const string& str, char c, vector& v) -{ - if (str.empty()) - return; - string::size_type i1 = 0; - string::size_type i2; - while (true) - { - i2 = str.find(c, i1); - if (i2 == str.npos) - { - v.push_back(str.substr(i1)); - return; - } - v.push_back(str.substr(i1, i2-i1)); - i1 = i2+1; - } -} - - string FormatMoney(int64_t n, bool fPlus) { // Note: not using straight sprintf here because we do NOT want diff --git a/src/util.h b/src/util.h index 27a08716dd..52ca6e579b 100644 --- a/src/util.h +++ b/src/util.h @@ -153,7 +153,6 @@ static inline bool error(const char* format) void LogException(std::exception* pex, const char* pszThread); void PrintExceptionContinue(std::exception* pex, const char* pszThread); -void ParseString(const std::string& str, char c, std::vector& v); std::string FormatMoney(int64_t n, bool fPlus=false); bool ParseMoney(const std::string& str, int64_t& nRet); bool ParseMoney(const char* pszIn, int64_t& nRet); From 5248ff40997c64cc0fde7aaa67cf94dd38b14899 Mon Sep 17 00:00:00 2001 From: Stuart Cardall Date: Tue, 13 May 2014 10:15:00 +0000 Subject: [PATCH 0060/1288] SetupEnvironment() - clean commit --- src/bitcoin-cli.cpp | 2 ++ src/bitcoind.cpp | 2 ++ src/qt/bitcoin.cpp | 2 ++ src/util.cpp | 16 ++++++++++++++++ src/util.h | 1 + 5 files changed, 23 insertions(+) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index ca6950a162..ce9e7a4027 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -58,6 +58,8 @@ static bool AppInitRPC(int argc, char* argv[]) int main(int argc, char* argv[]) { + SetupEnvironment(); + try { if(!AppInitRPC(argc, argv)) diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 17aa0c9d4b..78c8b2ba0e 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -172,6 +172,8 @@ bool AppInit(int argc, char* argv[]) int main(int argc, char* argv[]) { + SetupEnvironment(); + bool fRet = false; // Connect bitcoind signal handlers diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 31716ab825..45d7a52889 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -459,6 +459,8 @@ WId BitcoinApplication::getMainWinId() const #ifndef BITCOIN_QT_TEST int main(int argc, char *argv[]) { + SetupEnvironment(); + /// 1. Parse command-line options. These take precedence over anything else. // Command-line options take precedence: ParseParameters(argc, argv); diff --git a/src/util.cpp b/src/util.cpp index 00e29446d5..2e8500eeae 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1404,3 +1404,19 @@ bool ParseInt32(const std::string& str, int32_t *out) n <= std::numeric_limits::max(); } +void SetupEnvironment() +{ + #ifndef WIN32 + try + { + #if BOOST_FILESYSTEM_VERSION == 3 + boost::filesystem::path::codecvt(); // Raises runtime error if current locale is invalid + #else // boost filesystem v2 + std::locale(); // Raises runtime error if current locale is invalid + #endif + } catch(std::runtime_error &e) + { + setenv("LC_ALL", "C", 1); // Force C locale + } + #endif +} diff --git a/src/util.h b/src/util.h index 27a08716dd..b252295e76 100644 --- a/src/util.h +++ b/src/util.h @@ -106,6 +106,7 @@ extern volatile bool fReopenDebugLog; void RandAddSeed(); void RandAddSeedPerfmon(); +void SetupEnvironment(); /* Return true if log accepts specified category */ bool LogAcceptCategory(const char* category); From 122549f6dee5f4d4daf7091d6302c38ba13ffb01 Mon Sep 17 00:00:00 2001 From: David Hill Date: Tue, 13 May 2014 16:38:36 -0400 Subject: [PATCH 0061/1288] Fix incorrect checkpoint data for testnet3 --- src/checkpoints.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index 9ab8b68443..926949e06a 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -66,8 +66,8 @@ namespace Checkpoints ; static const CCheckpointData dataTestnet = { &mapCheckpointsTestnet, - 1338180505, - 16341, + 1337966069, + 1488, 300 }; From c6e36b0492dc870c49dafbfb7aa76e28202f8ef0 Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Thu, 15 May 2014 03:27:35 -0300 Subject: [PATCH 0062/1288] Fix NameError in macdeploy script --- contrib/macdeploy/macdeployqtplus | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index 5c310df1fc..599713fbbb 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -580,7 +580,7 @@ try: except RuntimeError as e: if verbose >= 1: sys.stderr.write("Error: %s\n" % str(e)) - sys.exit(ret) + sys.exit(1) # ------------------------------------------------ @@ -593,7 +593,7 @@ if config.plugins: except RuntimeError as e: if verbose >= 1: sys.stderr.write("Error: %s\n" % str(e)) - sys.exit(ret) + sys.exit(1) # ------------------------------------------------ From 7007402956579ace12d45cdcfae908802d3d6b6d Mon Sep 17 00:00:00 2001 From: Roy Badami Date: Fri, 9 May 2014 23:50:09 +0100 Subject: [PATCH 0063/1288] Implement SI-style (thin space) thoudands separator --- src/qt/bitcoinamountfield.cpp | 49 +++++++++++++++++++++++++++-- src/qt/bitcoinunits.cpp | 39 +++++++++++++++++++---- src/qt/bitcoinunits.h | 53 ++++++++++++++++++++++++++++++-- src/qt/overviewpage.cpp | 10 +++--- src/qt/sendcoinsdialog.cpp | 8 ++--- src/qt/transactiondesc.cpp | 24 +++++++-------- src/qt/transactiontablemodel.cpp | 10 +++--- src/qt/transactiontablemodel.h | 4 ++- src/qt/transactionview.cpp | 21 +++++++++++++ src/qt/transactionview.h | 3 ++ 10 files changed, 184 insertions(+), 37 deletions(-) diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp index 25ad0c66af..e047c278b7 100644 --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -14,6 +14,51 @@ #include #include // for qPow() +// QDoubleSpinBox that shows SI-style thin space thousands separators +class AmountSpinBox: public QDoubleSpinBox +{ +public: + explicit AmountSpinBox(QWidget *parent): + QDoubleSpinBox(parent) + { + } + QString textFromValue(double value) const + { + QStringList parts = QDoubleSpinBox::textFromValue(value).split("."); + QString quotient_str = parts[0]; + QString remainder_str; + if(parts.size() > 1) + remainder_str = parts[1]; + + // Code duplication between here and BitcoinUnits::format + // TODO: Figure out how to share this code + QChar thin_sp(THIN_SP_CP); + int q_size = quotient_str.size(); + if (q_size > 4) + for (int i = 3; i < q_size; i += 3) + quotient_str.insert(q_size - i, thin_sp); + + int r_size = remainder_str.size(); + if (r_size > 4) + for (int i = 3, adj = 0; i < r_size; i += 3, adj++) + remainder_str.insert(i + adj, thin_sp); + + if(remainder_str.isEmpty()) + return quotient_str; + else + return quotient_str + QString(".") + remainder_str; + } + QValidator::State validate (QString &text, int &pos) const + { + QString s(BitcoinUnits::removeSpaces(text)); + return QDoubleSpinBox::validate(s, pos); + } + double valueFromText(const QString& text) const + { + return QDoubleSpinBox::valueFromText(BitcoinUnits::removeSpaces(text)); + } +}; + BitcoinAmountField::BitcoinAmountField(QWidget *parent) : QWidget(parent), amount(0), @@ -21,7 +66,7 @@ BitcoinAmountField::BitcoinAmountField(QWidget *parent) : { nSingleStep = 100000; // satoshis - amount = new QDoubleSpinBox(this); + amount = new AmountSpinBox(this); amount->setLocale(QLocale::c()); amount->installEventFilter(this); amount->setMaximumWidth(170); @@ -52,7 +97,7 @@ void BitcoinAmountField::setText(const QString &text) if (text.isEmpty()) amount->clear(); else - amount->setValue(text.toDouble()); + amount->setValue(BitcoinUnits::removeSpaces(text).toDouble()); } void BitcoinAmountField::clear() diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp index 2fed443cf2..1b5eaa2dc5 100644 --- a/src/qt/bitcoinunits.cpp +++ b/src/qt/bitcoinunits.cpp @@ -50,8 +50,8 @@ QString BitcoinUnits::description(int unit) switch(unit) { case BTC: return QString("Bitcoins"); - case mBTC: return QString("Milli-Bitcoins (1 / 1,000)"); - case uBTC: return QString("Micro-Bitcoins (1 / 1,000,000)"); + case mBTC: return QString("Milli-Bitcoins (1 / 1" THIN_SP_UTF8 "000)"); + case uBTC: return QString("Micro-Bitcoins (1 / 1" THIN_SP_UTF8 "000" THIN_SP_UTF8 "000)"); default: return QString("???"); } } @@ -100,7 +100,7 @@ int BitcoinUnits::decimals(int unit) } } -QString BitcoinUnits::format(int unit, qint64 n, bool fPlus) +QString BitcoinUnits::format(int unit, qint64 n, bool fPlus, SeparatorStyle separators, bool fAlign) { // Note: not using straight sprintf here because we do NOT want // localized number formatting. @@ -119,6 +119,23 @@ QString BitcoinUnits::format(int unit, qint64 n, bool fPlus) for (int i = remainder_str.size()-1; i>=2 && (remainder_str.at(i) == '0'); --i) ++nTrim; remainder_str.chop(nTrim); + if (fAlign) + remainder_str.append(QString(QChar(FIGURE_SP_CP)).repeated(nTrim)); + + // Use SI-stule separators as these are locale indendent and can't be + // confused with the decimal marker. Rule is to use a thin space every + // three digits on *both* sides of the decimal point - but only if there + // are five or more digits + QChar thin_sp(THIN_SP_CP); + int q_size = quotient_str.size(); + if (separators == separatorAlways || (separators == separatorStandard && q_size > 4)) + for (int i = 3; i < q_size; i += 3) + quotient_str.insert(q_size - i, thin_sp); + + int r_size = remainder_str.size(); + if (separators == separatorAlways || (separators == separatorStandard && r_size > 4)) + for (int i = 3, adj = 0; i < r_size ; i += 3, adj++) + remainder_str.insert(i + adj, thin_sp); if (n < 0) quotient_str.insert(0, '-'); @@ -127,17 +144,27 @@ QString BitcoinUnits::format(int unit, qint64 n, bool fPlus) return quotient_str + QString(".") + remainder_str; } -QString BitcoinUnits::formatWithUnit(int unit, qint64 amount, bool plussign) +QString BitcoinUnits::formatWithUnit(int unit, qint64 amount, bool plussign, SeparatorStyle separators, bool fAlign) { - return format(unit, amount, plussign) + QString(" ") + name(unit); + return format(unit, amount, plussign, separators, fAlign) + QString(" ") + name(unit); } +QString BitcoinUnits::formatHtmlWithUnit(int unit, qint64 amount, bool plussign, SeparatorStyle separators) +{ + QString str(formatWithUnit(unit, amount, plussign, separators)); + str.replace(QChar(THIN_SP_CP), QString(THIN_SP_HTML)); + return QString("%1").arg(str); +} + + bool BitcoinUnits::parse(int unit, const QString &value, qint64 *val_out) { if(!valid(unit) || value.isEmpty()) return false; // Refuse to parse invalid unit or empty string int num_decimals = decimals(unit); - QStringList parts = value.split("."); + + // Ignore spaces and thin spaces when parsing + QStringList parts = removeSpaces(value).split("."); if(parts.size() > 2) { diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h index 46517fc07b..a3017b9a8b 100644 --- a/src/qt/bitcoinunits.h +++ b/src/qt/bitcoinunits.h @@ -8,6 +8,37 @@ #include #include +// U+2009 THIN SPACE = UTF-8 E2 80 89 +#define REAL_THIN_SP_CP 0x2009 +#define REAL_THIN_SP_UTF8 "\xE2\x80\x89" +#define REAL_THIN_SP_HTML " " + +// U+200A HAIR SPACE = UTF-8 E2 80 8A +#define HAIR_SP_CP 0x200A +#define HAIR_SP_UTF8 "\xE2\x80\x8A" +#define HAIR_SP_HTML " " + +// U+2006 SIX-PER-EM SPACE = UTF-8 E2 80 86 +#define SIXPEREM_SP_CP 0x2006 +#define SIXPEREM_SP_UTF8 "\xE2\x80\x86" +#define SIXPEREM_SP_HTML " " + +// U+2007 FIGURE SPACE = UTF-8 E2 80 87 +#define FIGURE_SP_CP 0x2007 +#define FIGURE_SP_UTF8 "\xE2\x80\x87" +#define FIGURE_SP_HTML " " + +// QMessageBox seems to have a bug whereby it doesn't display thin/hair spaces +// correctly. Workaround is to display a space in a small font. If you +// change this, please test that it doesn't cause the parent span to start +// wrapping. +#define HTML_HACK_SP " " + +// Define THIN_SP_* variables to be our preferred type of thin space +#define THIN_SP_CP REAL_THIN_SP_CP +#define THIN_SP_UTF8 REAL_THIN_SP_UTF8 +#define THIN_SP_HTML HTML_HACK_SP + /** Bitcoin unit definitions. Encapsulates parsing and formatting and serves as list model for drop-down selection boxes. */ @@ -28,6 +59,13 @@ public: uBTC }; + enum SeparatorStyle + { + separatorNever, + separatorStandard, + separatorAlways + }; + //! @name Static API //! Unit conversion and formatting ///@{ @@ -49,9 +87,10 @@ public: //! Number of decimals left static int decimals(int unit); //! Format as string - static QString format(int unit, qint64 amount, bool plussign=false); + static QString format(int unit, qint64 amount, bool plussign=false, SeparatorStyle separators=separatorStandard, bool fAlign=false); //! Format as string (with unit) - static QString formatWithUnit(int unit, qint64 amount, bool plussign=false); + static QString formatWithUnit(int unit, qint64 amount, bool plussign=false, SeparatorStyle separators=separatorStandard, bool fAlign=false); + static QString formatHtmlWithUnit(int unit, qint64 amount, bool plussign=false, SeparatorStyle separators=separatorStandard); //! Parse string to coin amount static bool parse(int unit, const QString &value, qint64 *val_out); ///@} @@ -67,6 +106,16 @@ public: QVariant data(const QModelIndex &index, int role) const; ///@} + static QString removeSpaces(QString text) + { + text.remove(' '); + text.remove(QChar(THIN_SP_CP)); +#if (THIN_SP_CP != REAL_THIN_SP_CP) + text.remove(QChar(REAL_THIN_SP_CP)); +#endif + return text; + } + private: QList unitlist; }; diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 1a9d1de571..311563d946 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -72,7 +72,7 @@ public: foreground = option.palette.color(QPalette::Text); } painter->setPen(foreground); - QString amountText = BitcoinUnits::formatWithUnit(unit, amount, true); + QString amountText = BitcoinUnits::formatWithUnit(unit, amount, true, BitcoinUnits::separatorAlways, true); if(!confirmed) { amountText = QString("[") + amountText + QString("]"); @@ -141,10 +141,10 @@ void OverviewPage::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 currentBalance = balance; currentUnconfirmedBalance = unconfirmedBalance; currentImmatureBalance = immatureBalance; - ui->labelBalance->setText(BitcoinUnits::formatWithUnit(unit, balance)); - ui->labelUnconfirmed->setText(BitcoinUnits::formatWithUnit(unit, unconfirmedBalance)); - ui->labelImmature->setText(BitcoinUnits::formatWithUnit(unit, immatureBalance)); - ui->labelTotal->setText(BitcoinUnits::formatWithUnit(unit, balance + unconfirmedBalance + immatureBalance)); + ui->labelBalance->setText(BitcoinUnits::formatWithUnit(unit, balance, false, BitcoinUnits::separatorAlways, true)); + ui->labelUnconfirmed->setText(BitcoinUnits::formatWithUnit(unit, unconfirmedBalance, false, BitcoinUnits::separatorAlways, true)); + ui->labelImmature->setText(BitcoinUnits::formatWithUnit(unit, immatureBalance, false, BitcoinUnits::separatorAlways, true)); + ui->labelTotal->setText(BitcoinUnits::formatWithUnit(unit, balance + unconfirmedBalance + immatureBalance, false, BitcoinUnits::separatorAlways, true)); // only show immature (newly mined) balance if it's non-zero, so as not to complicate things // for the non-mining users diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 33621e54b0..f432c4add6 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -142,7 +142,7 @@ void SendCoinsDialog::on_sendButton_clicked() foreach(const SendCoinsRecipient &rcp, recipients) { // generate bold amount string - QString amount = "" + BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), rcp.amount); + QString amount = "" + BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), rcp.amount); amount.append(""); // generate monospace address string QString address = "" + rcp.address; @@ -210,7 +210,7 @@ void SendCoinsDialog::on_sendButton_clicked() { // append fee string if a fee is required questionString.append("
"); - questionString.append(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee)); + questionString.append(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee)); questionString.append(" "); questionString.append(tr("added as transaction fee")); } @@ -222,10 +222,10 @@ void SendCoinsDialog::on_sendButton_clicked() foreach(BitcoinUnits::Unit u, BitcoinUnits::availableUnits()) { if(u != model->getOptionsModel()->getDisplayUnit()) - alternativeUnits.append(BitcoinUnits::formatWithUnit(u, totalAmount)); + alternativeUnits.append(BitcoinUnits::formatHtmlWithUnit(u, totalAmount)); } questionString.append(tr("Total Amount %1 (= %2)") - .arg(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), totalAmount)) + .arg(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), totalAmount)) .arg(alternativeUnits.join(" " + tr("or") + " "))); QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm send coins"), diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 45fb3d40c2..0bb93035cc 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -138,7 +138,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, int vout, int u nUnmatured += wallet->GetCredit(txout); strHTML += "" + tr("Credit") + ": "; if (wtx.IsInMainChain()) - strHTML += BitcoinUnits::formatWithUnit(unit, nUnmatured)+ " (" + tr("matures in %n more block(s)", "", wtx.GetBlocksToMaturity()) + ")"; + strHTML += BitcoinUnits::formatHtmlWithUnit(unit, nUnmatured)+ " (" + tr("matures in %n more block(s)", "", wtx.GetBlocksToMaturity()) + ")"; else strHTML += "(" + tr("not accepted") + ")"; strHTML += "
"; @@ -148,7 +148,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, int vout, int u // // Credit // - strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(unit, nNet) + "
"; + strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatHtmlWithUnit(unit, nNet) + "
"; } else { @@ -184,7 +184,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, int vout, int u } } - strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(unit, -txout.nValue) + "
"; + strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatHtmlWithUnit(unit, -txout.nValue) + "
"; } if (fAllToMe) @@ -192,13 +192,13 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, int vout, int u // Payment to self int64_t nChange = wtx.GetChange(); int64_t nValue = nCredit - nChange; - strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(unit, -nValue) + "
"; - strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(unit, nValue) + "
"; + strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatHtmlWithUnit(unit, -nValue) + "
"; + strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatHtmlWithUnit(unit, nValue) + "
"; } int64_t nTxFee = nDebit - wtx.GetValueOut(); if (nTxFee > 0) - strHTML += "" + tr("Transaction fee") + ": " + BitcoinUnits::formatWithUnit(unit, -nTxFee) + "
"; + strHTML += "" + tr("Transaction fee") + ": " + BitcoinUnits::formatHtmlWithUnit(unit, -nTxFee) + "
"; } else { @@ -207,14 +207,14 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, int vout, int u // BOOST_FOREACH(const CTxIn& txin, wtx.vin) if (wallet->IsMine(txin)) - strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(unit, -wallet->GetDebit(txin)) + "
"; + strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatHtmlWithUnit(unit, -wallet->GetDebit(txin)) + "
"; BOOST_FOREACH(const CTxOut& txout, wtx.vout) if (wallet->IsMine(txout)) - strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(unit, wallet->GetCredit(txout)) + "
"; + strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatHtmlWithUnit(unit, wallet->GetCredit(txout)) + "
"; } } - strHTML += "" + tr("Net amount") + ": " + BitcoinUnits::formatWithUnit(unit, nNet, true) + "
"; + strHTML += "" + tr("Net amount") + ": " + BitcoinUnits::formatHtmlWithUnit(unit, nNet, true) + "
"; // // Message @@ -260,10 +260,10 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, int vout, int u strHTML += "

" + tr("Debug information") + "

"; BOOST_FOREACH(const CTxIn& txin, wtx.vin) if(wallet->IsMine(txin)) - strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(unit, -wallet->GetDebit(txin)) + "
"; + strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatHtmlWithUnit(unit, -wallet->GetDebit(txin)) + "
"; BOOST_FOREACH(const CTxOut& txout, wtx.vout) if(wallet->IsMine(txout)) - strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(unit, wallet->GetCredit(txout)) + "
"; + strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatHtmlWithUnit(unit, wallet->GetCredit(txout)) + "
"; strHTML += "
" + tr("Transaction") + ":
"; strHTML += GUIUtil::HtmlEscape(wtx.ToString(), true); @@ -289,7 +289,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, int vout, int u strHTML += GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + " "; strHTML += QString::fromStdString(CBitcoinAddress(address).ToString()); } - strHTML = strHTML + " " + tr("Amount") + "=" + BitcoinUnits::formatWithUnit(unit, vout.nValue); + strHTML = strHTML + " " + tr("Amount") + "=" + BitcoinUnits::formatHtmlWithUnit(unit, vout.nValue); strHTML = strHTML + " IsMine=" + (wallet->IsMine(vout) ? tr("true") : tr("false")) + ""; } } diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 8cf2b0a1b1..c0f7edd871 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -5,7 +5,6 @@ #include "transactiontablemodel.h" #include "addresstablemodel.h" -#include "bitcoinunits.h" #include "guiconstants.h" #include "guiutil.h" #include "optionsmodel.h" @@ -425,9 +424,9 @@ QVariant TransactionTableModel::addressColor(const TransactionRecord *wtx) const return QVariant(); } -QString TransactionTableModel::formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed) const +QString TransactionTableModel::formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed, BitcoinUnits::SeparatorStyle separators, bool fAlign) const { - QString str = BitcoinUnits::format(walletModel->getOptionsModel()->getDisplayUnit(), wtx->credit + wtx->debit); + QString str = BitcoinUnits::format(walletModel->getOptionsModel()->getDisplayUnit(), wtx->credit + wtx->debit, false, separators, fAlign); if(showUnconfirmed) { if(!wtx->status.countsForBalance) @@ -512,7 +511,7 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const case ToAddress: return formatTxToAddress(rec, false); case Amount: - return formatTxAmount(rec); + return formatTxAmount(rec, true, BitcoinUnits::separatorAlways, true); } break; case Qt::EditRole: @@ -569,7 +568,8 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const case ConfirmedRole: return rec->status.countsForBalance; case FormattedAmountRole: - return formatTxAmount(rec, false); + // Used for copy/export, so don't include separators + return formatTxAmount(rec, false, BitcoinUnits::separatorNever); case StatusRole: return rec->status.status; } diff --git a/src/qt/transactiontablemodel.h b/src/qt/transactiontablemodel.h index 333e6bc6ed..9ee375d787 100644 --- a/src/qt/transactiontablemodel.h +++ b/src/qt/transactiontablemodel.h @@ -8,6 +8,8 @@ #include #include +#include "bitcoinunits.h" + class TransactionRecord; class TransactionTablePriv; class WalletModel; @@ -78,7 +80,7 @@ private: QString formatTxDate(const TransactionRecord *wtx) const; QString formatTxType(const TransactionRecord *wtx) const; QString formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const; - QString formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed=true) const; + QString formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed=true, BitcoinUnits::SeparatorStyle separators=BitcoinUnits::separatorStandard, bool fAlign=false) const; QString formatTooltip(const TransactionRecord *rec) const; QVariant txStatusDecoration(const TransactionRecord *wtx) const; QVariant txAddressDecoration(const TransactionRecord *wtx) const; diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index d4d29416ca..98914fc2d0 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -123,6 +123,8 @@ TransactionView::TransactionView(QWidget *parent) : view->setTabKeyNavigation(false); view->setContextMenuPolicy(Qt::CustomContextMenu); + view->installEventFilter(this); + transactionView = view; // Actions @@ -480,3 +482,22 @@ void TransactionView::resizeEvent(QResizeEvent* event) QWidget::resizeEvent(event); columnResizingFixer->stretchColumnWidth(TransactionTableModel::ToAddress); } + +// Need to override default Ctrl+C action for amount as default behaviour is just to copy DisplayRole text +bool TransactionView::eventFilter(QObject *obj, QEvent *event) +{ + if (event->type() == QEvent::KeyPress) + { + QKeyEvent *ke = static_cast(event); + if (ke->key() == Qt::Key_C && ke->modifiers().testFlag(Qt::ControlModifier)) + { + QModelIndex i = this->transactionView->currentIndex(); + if (i.isValid() && i.column() == TransactionTableModel::Amount) + { + GUIUtil::setClipboard(i.data(TransactionTableModel::FormattedAmountRole).toString()); + return true; + } + } + } + return QWidget::eventFilter(obj, event); +} diff --git a/src/qt/transactionview.h b/src/qt/transactionview.h index 7a89fa11ca..618efbc565 100644 --- a/src/qt/transactionview.h +++ b/src/qt/transactionview.h @@ -8,6 +8,7 @@ #include "guiutil.h" #include +#include class TransactionFilterProxy; class WalletModel; @@ -78,6 +79,8 @@ private: virtual void resizeEvent(QResizeEvent* event); + bool eventFilter(QObject *obj, QEvent *event); + private slots: void contextualMenu(const QPoint &); void dateRangeChanged(); From 0b78ba8ad69d55817f2b62c631a71b5ac32549f1 Mon Sep 17 00:00:00 2001 From: Huang Le <4tarhl@gmail.com> Date: Tue, 20 May 2014 01:22:33 +0800 Subject: [PATCH 0064/1288] Remove fDaemon flag checking on return from main(), which is useless and looks really strange. --- src/bitcoind.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 78c8b2ba0e..9b535c2e6b 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -174,15 +174,8 @@ int main(int argc, char* argv[]) { SetupEnvironment(); - bool fRet = false; - // Connect bitcoind signal handlers noui_connect(); - fRet = AppInit(argc, argv); - - if (fRet && fDaemon) - return 0; - - return (fRet ? 0 : 1); + return (AppInit(argc, argv) ? 0 : 1); } From 0a59723ff6218d545438e8e0f3083fc1d1b98bd4 Mon Sep 17 00:00:00 2001 From: R E Broadley Date: Tue, 20 May 2014 12:15:56 +0800 Subject: [PATCH 0065/1288] Remove extraneous c_str --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index f7c53052e1..7bb3bdb70c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4445,7 +4445,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) uint256 hash = state.vBlocksToDownload.front(); vGetData.push_back(CInv(MSG_BLOCK, hash)); MarkBlockAsInFlight(pto->GetId(), hash); - LogPrint("net", "Requesting block %s from %s\n", hash.ToString().c_str(), state.name.c_str()); + LogPrint("net", "Requesting block %s from %s\n", hash.ToString(), state.name); if (vGetData.size() >= 1000) { pto->PushMessage("getdata", vGetData); From 0e31e5631c279353564f6407b8950b1224cf5b9f Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Tue, 13 May 2014 20:48:34 +0200 Subject: [PATCH 0066/1288] remove CWallet::AddReserveKey which is never used --- src/wallet.cpp | 15 --------------- src/wallet.h | 1 - 2 files changed, 16 deletions(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index fa7aecddb6..89604f96ac 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1671,21 +1671,6 @@ void CWallet::ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool) } } -int64_t CWallet::AddReserveKey(const CKeyPool& keypool) -{ - { - LOCK2(cs_main, cs_wallet); - CWalletDB walletdb(strWalletFile); - - int64_t nIndex = 1 + *(--setKeyPool.end()); - if (!walletdb.WritePool(nIndex, keypool)) - throw runtime_error("AddReserveKey() : writing added key failed"); - setKeyPool.insert(nIndex); - return nIndex; - } - return -1; -} - void CWallet::KeepKey(int64_t nIndex) { // Remove from key pool diff --git a/src/wallet.h b/src/wallet.h index b2c06d3f61..5e9af191cc 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -263,7 +263,6 @@ public: bool NewKeyPool(); bool TopUpKeyPool(unsigned int kpSize = 0); - int64_t AddReserveKey(const CKeyPool& keypool); void ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool); void KeepKey(int64_t nIndex); void ReturnKey(int64_t nIndex); From f4057cb749f4c0d04bf936805ff8aa5678b9c6f2 Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Tue, 13 May 2014 20:58:25 +0200 Subject: [PATCH 0067/1288] remove CTransaction::IsNewerThan which is never used --- src/core.cpp | 29 ----------------------------- src/core.h | 1 - 2 files changed, 30 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index 7651ce9957..aadcb44b98 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -77,35 +77,6 @@ uint256 CTransaction::GetHash() const return SerializeHash(*this); } -bool CTransaction::IsNewerThan(const CTransaction& old) const -{ - if (vin.size() != old.vin.size()) - return false; - for (unsigned int i = 0; i < vin.size(); i++) - if (vin[i].prevout != old.vin[i].prevout) - return false; - - bool fNewer = false; - unsigned int nLowest = std::numeric_limits::max(); - for (unsigned int i = 0; i < vin.size(); i++) - { - if (vin[i].nSequence != old.vin[i].nSequence) - { - if (vin[i].nSequence <= nLowest) - { - fNewer = false; - nLowest = vin[i].nSequence; - } - if (old.vin[i].nSequence < nLowest) - { - fNewer = true; - nLowest = old.vin[i].nSequence; - } - } - } - return fNewer; -} - int64_t CTransaction::GetValueOut() const { int64_t nValueOut = 0; diff --git a/src/core.h b/src/core.h index 5eb953610d..ba7f691119 100644 --- a/src/core.h +++ b/src/core.h @@ -219,7 +219,6 @@ public: } uint256 GetHash() const; - bool IsNewerThan(const CTransaction& old) const; // Return sum of txouts. int64_t GetValueOut() const; From 595f691d0acd871ecaba323d888a3632805c1828 Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Tue, 13 May 2014 21:00:16 +0200 Subject: [PATCH 0068/1288] remove LogException( ) which is never used --- src/util.cpp | 6 ------ src/util.h | 2 -- 2 files changed, 8 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index aa3adf89ec..d99e6a7bfb 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -885,12 +885,6 @@ static std::string FormatException(std::exception* pex, const char* pszThread) "UNKNOWN EXCEPTION \n%s in %s \n", pszModule, pszThread); } -void LogException(std::exception* pex, const char* pszThread) -{ - std::string message = FormatException(pex, pszThread); - LogPrintf("\n%s", message); -} - void PrintExceptionContinue(std::exception* pex, const char* pszThread) { std::string message = FormatException(pex, pszThread); diff --git a/src/util.h b/src/util.h index 97185073e0..dc0c3a8cae 100644 --- a/src/util.h +++ b/src/util.h @@ -151,8 +151,6 @@ static inline bool error(const char* format) return false; } - -void LogException(std::exception* pex, const char* pszThread); void PrintExceptionContinue(std::exception* pex, const char* pszThread); std::string FormatMoney(int64_t n, bool fPlus=false); bool ParseMoney(const std::string& str, int64_t& nRet); From 5bd4adca716738a4de35aed2ccad874d3301fefc Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Tue, 13 May 2014 21:02:17 +0200 Subject: [PATCH 0069/1288] remove LookupHostNumeric( ) which is never used --- src/netbase.cpp | 5 ----- src/netbase.h | 1 - 2 files changed, 6 deletions(-) diff --git a/src/netbase.cpp b/src/netbase.cpp index 82a681281d..c72d777e3d 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -123,11 +123,6 @@ bool LookupHost(const char *pszName, std::vector& vIP, unsigned int nM return LookupIntern(strHost.c_str(), vIP, nMaxSolutions, fAllowLookup); } -bool LookupHostNumeric(const char *pszName, std::vector& vIP, unsigned int nMaxSolutions) -{ - return LookupHost(pszName, vIP, nMaxSolutions, false); -} - bool Lookup(const char *pszName, std::vector& vAddr, int portDefault, bool fAllowLookup, unsigned int nMaxSolutions) { if (pszName[0] == 0) diff --git a/src/netbase.h b/src/netbase.h index 118f866d6c..35547b2660 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -173,7 +173,6 @@ bool IsProxy(const CNetAddr &addr); bool SetNameProxy(CService addrProxy, int nSocksVersion = 5); bool HaveNameProxy(); bool LookupHost(const char *pszName, std::vector& vIP, unsigned int nMaxSolutions = 0, bool fAllowLookup = true); -bool LookupHostNumeric(const char *pszName, std::vector& vIP, unsigned int nMaxSolutions = 0); bool Lookup(const char *pszName, CService& addr, int portDefault = 0, bool fAllowLookup = true); bool Lookup(const char *pszName, std::vector& vAddr, int portDefault = 0, bool fAllowLookup = true, unsigned int nMaxSolutions = 0); bool LookupNumeric(const char *pszName, CService& addr, int portDefault = 0); From 28b6c1def57360ca5a05745faafaec53910f5e88 Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Tue, 13 May 2014 21:37:47 +0200 Subject: [PATCH 0070/1288] remove GetMedianTime( ) which is never used --- src/main.cpp | 13 ------------- src/main.h | 2 -- 2 files changed, 15 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c54fa65233..126b4ada51 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2575,19 +2575,6 @@ bool CBlockIndex::IsSuperMajority(int minVersion, const CBlockIndex* pstart, uns return (nFound >= nRequired); } -int64_t CBlockIndex::GetMedianTime() const -{ - AssertLockHeld(cs_main); - const CBlockIndex* pindex = this; - for (int i = 0; i < nMedianTimeSpan/2; i++) - { - if (!chainActive.Next(pindex)) - return GetBlockTime(); - pindex = chainActive.Next(pindex); - } - return pindex->GetMedianTimePast(); -} - void PushGetBlocks(CNode* pnode, CBlockIndex* pindexBegin, uint256 hashEnd) { AssertLockHeld(cs_main); diff --git a/src/main.h b/src/main.h index f47c9ee825..25f70e7ad4 100644 --- a/src/main.h +++ b/src/main.h @@ -849,8 +849,6 @@ public: return pbegin[(pend - pbegin)/2]; } - int64_t GetMedianTime() const; - /** * Returns true if there are nRequired or more blocks of minVersion or above * in the last nToCheck blocks, starting at pstart and going backwards. From f40dbeedde3a6a73c13b0241258cf23248db1de1 Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Tue, 13 May 2014 21:41:51 +0200 Subject: [PATCH 0071/1288] remove CPubKey::VerifyCompact( ) which is never used --- src/key.cpp | 15 --------------- src/key.h | 4 ---- 2 files changed, 19 deletions(-) diff --git a/src/key.cpp b/src/key.cpp index 2199996cf3..aa24f0a622 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -485,21 +485,6 @@ bool CPubKey::RecoverCompact(const uint256 &hash, const std::vector& vchSig) const { - if (!IsValid()) - return false; - if (vchSig.size() != 65) - return false; - CECKey key; - if (!key.Recover(hash, &vchSig[1], (vchSig[0] - 27) & ~4)) - return false; - CPubKey pubkeyRec; - key.GetPubKey(pubkeyRec, IsCompressed()); - if (*this != pubkeyRec) - return false; - return true; -} - bool CPubKey::IsFullyValid() const { if (!IsValid()) return false; diff --git a/src/key.h b/src/key.h index 37a06810b4..983775fd23 100644 --- a/src/key.h +++ b/src/key.h @@ -156,10 +156,6 @@ public: // If this public key is not fully valid, the return value will be false. bool Verify(const uint256 &hash, const std::vector& vchSig) const; - // Verify a compact signature (~65 bytes). - // See CKey::SignCompact. - bool VerifyCompact(const uint256 &hash, const std::vector& vchSig) const; - // Recover a public key from a compact signature. bool RecoverCompact(const uint256 &hash, const std::vector& vchSig); From d16f6f87e1c15bd686e0e74ddb671da95a916c6d Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Thu, 15 May 2014 03:22:42 -0300 Subject: [PATCH 0072/1288] Remove unused imports in macdeploy script --- contrib/macdeploy/README.md | 4 ---- contrib/macdeploy/macdeployqtplus | 11 ----------- 2 files changed, 15 deletions(-) diff --git a/contrib/macdeploy/README.md b/contrib/macdeploy/README.md index 5f0611f20c..0aa57b4777 100644 --- a/contrib/macdeploy/README.md +++ b/contrib/macdeploy/README.md @@ -1,9 +1,5 @@ ### MacDeploy ### -You will need the appscript package for the fancy disk image creation to work: - - sudo easy_install appscript - For Snow Leopard (which uses [Python 2.6](http://www.python.org/download/releases/2.6/)), you will need the param_parser package: sudo easy_install argparse diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index 5c310df1fc..4bfaadffd7 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -19,7 +19,6 @@ import subprocess, sys, re, os, shutil, stat, os.path from string import Template -from time import sleep from argparse import ArgumentParser # This is ported from the original macdeployqt with modifications @@ -488,16 +487,6 @@ if len(config.fancy) == 1: sys.stderr.write("Error: Could not import plistlib which is required for fancy disk images.\n") sys.exit(1) - if verbose >= 3: - print "Fancy: Importing appscript..." - try: - import appscript - except ImportError: - if verbose >= 1: - sys.stderr.write("Error: Could not import appscript which is required for fancy disk images.\n") - sys.stderr.write("Please install it e.g. with \"sudo easy_install appscript\".\n") - sys.exit(1) - p = config.fancy[0] if verbose >= 3: print "Fancy: Loading \"%s\"..." % p From d4e1c61212c3f28f80c7184aca81f5d118fad460 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 5 May 2014 21:06:14 +0200 Subject: [PATCH 0073/1288] add DEFAULT_UPNP constant in net - as this is a shared Core/GUI setting, this makes it easier to keep them in sync (also no new includes are needed) --- src/net.cpp | 4 +--- src/net.h | 6 ++++++ src/qt/optionsmodel.cpp | 6 +----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 6bde1e7999..7cabfef099 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1736,10 +1736,8 @@ void StartNode(boost::thread_group& threadGroup) else threadGroup.create_thread(boost::bind(&TraceThread, "dnsseed", &ThreadDNSAddressSeed)); -#ifdef USE_UPNP // Map ports with UPnP - MapPort(GetBoolArg("-upnp", USE_UPNP)); -#endif + MapPort(GetBoolArg("-upnp", DEFAULT_UPNP)); // Send and receive from sockets, accept connections threadGroup.create_thread(boost::bind(&TraceThread, "net", &ThreadSocketHandler)); diff --git a/src/net.h b/src/net.h index 729b1bcd57..21b8dd242f 100644 --- a/src/net.h +++ b/src/net.h @@ -38,6 +38,12 @@ namespace boost { /** The maximum number of entries in an 'inv' protocol message */ static const unsigned int MAX_INV_SZ = 50000; +/** -upnp default */ +#ifdef USE_UPNP +static const bool DEFAULT_UPNP = USE_UPNP; +#else +static const bool DEFAULT_UPNP = false; +#endif inline unsigned int ReceiveFloodSize() { return 1000*GetArg("-maxreceivebuffer", 5*1000); } inline unsigned int SendBufferSize() { return 1000*GetArg("-maxsendbuffer", 1*1000); } diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index e87a1d97e7..051098315d 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -106,11 +106,7 @@ void OptionsModel::Init() // Network if (!settings.contains("fUseUPnP")) -#ifdef USE_UPNP - settings.setValue("fUseUPnP", true); -#else - settings.setValue("fUseUPnP", false); -#endif + settings.setValue("fUseUPnP", DEFAULT_UPNP); if (!SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool())) addOverriddenOption("-upnp"); From 305ccaa27551efa33fcaf637e76310654738f428 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 20 May 2014 21:45:12 +0200 Subject: [PATCH 0074/1288] Add missing LOCK(cs_main) --- src/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index c54fa65233..a1fe6c07bc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3488,7 +3488,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) return true; } - State(pfrom->GetId())->nLastBlockProcess = GetTimeMicros(); + { + LOCK(cs_main); + State(pfrom->GetId())->nLastBlockProcess = GetTimeMicros(); + } From f701da8f707726e4097e17234cdd7b55255c1077 Mon Sep 17 00:00:00 2001 From: Kosta Zertsekel Date: Mon, 19 May 2014 13:42:57 +0300 Subject: [PATCH 0075/1288] Doc: Always use absolute paths --- doc/build-unix.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/build-unix.md b/doc/build-unix.md index ab5fbad521..1d75c206e5 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -2,6 +2,16 @@ UNIX BUILD NOTES ==================== Some notes on how to build Bitcoin in Unix. +Note +--------------------- +Always use absolute paths to configure and compile bitcoin and the dependencies, +for example, when specifying the the path of the dependency: + + ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX + +Here BDB_PREFIX must absolute path - it is defined using $(pwd) which ensures +the usage of the absolute path. + To Build --------------------- From 1a97b22b9c8ca6f1c3c7e3285e1b98893691d421 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 13 May 2014 19:23:22 -0400 Subject: [PATCH 0076/1288] gitian: Add OSX build descriptors Github-Pull: #4185 Rebased-By: Wladimir J. van der Laan Rebased-From: bb5da27, 2288206, 7fe8fe6, f76db78, ebcf375, fa1ed7c, 397e9b8 --- .../gitian-descriptors/gitian-osx-bitcoin.yml | 65 ++++++ .../gitian-descriptors/gitian-osx-depends.yml | 160 +++++++++++++++ .../gitian-descriptors/gitian-osx-native.yml | 179 ++++++++++++++++ contrib/gitian-descriptors/gitian-osx-qt.yml | 192 ++++++++++++++++++ doc/README_osx.txt | 71 +++++++ doc/release-process.md | 49 +++-- 6 files changed, 699 insertions(+), 17 deletions(-) create mode 100644 contrib/gitian-descriptors/gitian-osx-bitcoin.yml create mode 100644 contrib/gitian-descriptors/gitian-osx-depends.yml create mode 100644 contrib/gitian-descriptors/gitian-osx-native.yml create mode 100644 contrib/gitian-descriptors/gitian-osx-qt.yml create mode 100644 doc/README_osx.txt diff --git a/contrib/gitian-descriptors/gitian-osx-bitcoin.yml b/contrib/gitian-descriptors/gitian-osx-bitcoin.yml new file mode 100644 index 0000000000..aea4b93a1f --- /dev/null +++ b/contrib/gitian-descriptors/gitian-osx-bitcoin.yml @@ -0,0 +1,65 @@ +--- +name: "bitcoin" +suites: +- "precise" +architectures: +- "i386" +packages: +- "git-core" +- "automake" +- "faketime" +- "bsdmainutils" +- "pkg-config" +- "p7zip-full" + +reference_datetime: "2013-06-01 00:00:00" +remotes: +- "url": "https://github.com/bitcoin/bitcoin.git" + "dir": "bitcoin" +files: +- "osx-native-depends-r2.tar.gz" +- "osx-depends-r2.tar.gz" +- "osx-depends-qt-5.2.1-r2.tar.gz" +- "MacOSX10.6.pkg" + +script: | + + echo "a2ccf2299de4e0bb88bd17a3355f02b747575b97492c7c2f5b789a64ccc4cbd6 MacOSX10.6.pkg" | sha256sum -c + + HOST=x86_64-apple-darwin11 + PREFIX=`pwd`/osx-cross-depends/prefix + SDK=`pwd`/osx-cross-depends/SDKs/MacOSX10.6.sdk + NATIVEPREFIX=`pwd`/osx-cross-depends/native-prefix + export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" + + export SOURCES_PATH=`pwd` + + mkdir osx-cross-depends + + cd osx-cross-depends + mkdir -p SDKs + 7z -bd -so -y e ${SOURCES_PATH}/MacOSX10.6.pkg Payload | gzip -d -c | cpio -i + cd .. + + tar -C osx-cross-depends -xf osx-native-depends-r2.tar.gz + tar -C osx-cross-depends -xf osx-depends-r2.tar.gz + tar -C osx-cross-depends -xf osx-depends-qt-5.2.1-r2.tar.gz + export PATH=`pwd`/osx-cross-depends/native-prefix/bin:$PATH + + cd bitcoin + + export ZERO_AR_DATE=1 + export QT_RCC_TEST=1 + ./autogen.sh + ./configure --host=${HOST} --with-boost=${PREFIX} CC=clang CXX=clang++ OBJC=clang OBJCXX=clang++ CFLAGS="-target ${HOST} -mmacosx-version-min=10.6 --sysroot ${SDK} -msse2 -Qunused-arguments" CXXFLAGS="-target ${HOST} -mmacosx-version-min=10.6 --sysroot ${SDK} -msse2 -Qunused-arguments" LDFLAGS="-B${NATIVEPREFIX}/bin -L${PREFIX}/lib -L${SDK}/usr/lib/i686-apple-darwin10/4.2.1" CPPFLAGS="-I${NATIVEPREFIX}/lib/clang/3.2/include -I${PREFIX}/include" SSL_LIBS="-lz -lssl -lcrypto" --disable-tests -with-gui=qt5 PKG_CONFIG_LIBDIR="${PREFIX}/lib/pkgconfig" --disable-dependency-tracking --disable-maintainer-mode + make dist + mkdir -p distsrc + cd distsrc + tar --strip-components=1 -xf ../bitcoin-*.tar* + ./configure --host=${HOST} --with-boost=${PREFIX} CC=clang CXX=clang++ OBJC=clang OBJCXX=clang++ CFLAGS="-target ${HOST} -mmacosx-version-min=10.6 --sysroot ${SDK} -msse2 -Qunused-arguments" CXXFLAGS="-target ${HOST} -mmacosx-version-min=10.6 --sysroot ${SDK} -msse2 -Qunused-arguments" LDFLAGS="-B${NATIVEPREFIX}/bin -L${PREFIX}/lib -L${SDK}/usr/lib/i686-apple-darwin10/4.2.1" CPPFLAGS="-I${NATIVEPREFIX}/lib/clang/3.2/include -I${PREFIX}/include" SSL_LIBS="-lz -lssl -lcrypto" --disable-tests -with-gui=qt5 PKG_CONFIG_LIBDIR="${PREFIX}/lib/pkgconfig" --disable-dependency-tracking --disable-maintainer-mode + make $MAKEOPTS + export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 + export FAKETIME=$REFERENCE_DATETIME + export TZ=UTC + make deploy + dmg dmg Bitcoin-Qt.dmg $OUTDIR/Bitcoin-Qt.dmg diff --git a/contrib/gitian-descriptors/gitian-osx-depends.yml b/contrib/gitian-descriptors/gitian-osx-depends.yml new file mode 100644 index 0000000000..8e91a30ded --- /dev/null +++ b/contrib/gitian-descriptors/gitian-osx-depends.yml @@ -0,0 +1,160 @@ +--- +name: "osx-depends" +suites: +- "precise" +architectures: +- "i386" +packages: +- "git-core" +- "automake" +- "p7zip-full" + +reference_datetime: "2013-06-01 00:00:00" +remotes: [] +files: +- "boost_1_55_0.tar.bz2" +- "db-4.8.30.NC.tar.gz" +- "miniupnpc-1.9.tar.gz" +- "openssl-1.0.1g.tar.gz" +- "protobuf-2.5.0.tar.bz2" +- "qrencode-3.4.3.tar.bz2" +- "MacOSX10.6.pkg" +- "osx-native-depends-r2.tar.gz" + +script: | + + echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | sha256sum -c + echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c + echo "2923e453e880bb949e3d4da9f83dd3cb6f08946d35de0b864d0339cf70934464 miniupnpc-1.9.tar.gz" | sha256sum -c + echo "53cb818c3b90e507a8348f4f5eaedb05d8bfe5358aabb508b7263cc670c3e028 openssl-1.0.1g.tar.gz" | sha256sum -c + echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c + echo "dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b50597a98 qrencode-3.4.3.tar.bz2" | sha256sum -c + echo "a2ccf2299de4e0bb88bd17a3355f02b747575b97492c7c2f5b789a64ccc4cbd6 MacOSX10.6.pkg" | sha256sum -c + + REVISION=r2 + export SOURCES_PATH=`pwd` + export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" + export PATH=$HOME:$PATH + export SOURCES_PATH=`pwd` + export ZERO_AR_DATE=1 + + mkdir -p osx-cross-depends/build + cd osx-cross-depends + + PREFIX=`pwd`/prefix + NATIVEPREFIX=`pwd`/native-prefix + BUILD_BASE=`pwd`/build + SDK=`pwd`/SDKs/MacOSX10.6.sdk + HOST=x86_64-apple-darwin11 + MIN_VERSION=10.6 + + INT_CFLAGS="-target ${HOST} -mmacosx-version-min=${MIN_VERSION} --sysroot ${SDK} -msse2 -Qunused-arguments" + INT_CXXFLAGS="${INT_CFLAGS}" + INT_LDFLAGS="-L${PREFIX}/lib -L${SDK}/usr/lib/i686-apple-darwin10/4.2.1" + INT_LDFLAGS_CLANG="-B${NATIVEPREFIX}/bin" + INT_CPPFLAGS="-I${PREFIX}/include" + INT_CC=clang + INT_CXX=clang++ + INT_OBJC=clang + INT_OBJCXX=clang++ + INT_AR=${HOST}-ar + INT_RANLIB=${HOST}-ranlib + INT_LIBTOOL=${HOST}-libtool + INT_INSTALL_NAME_TOOL=${HOST}-install_name_tool + + export PATH=${NATIVEPREFIX}/bin:${PATH} + + mkdir -p ${NATIVEPREFIX}/bin + mkdir -p ${NATIVEPREFIX}/lib + mkdir -p ${PREFIX}/bin + mkdir -p ${PREFIX}/lib + mkdir -p ${BUILD_BASE} + + mkdir -p ${SDK} + 7z -bd -so -y e ${SOURCES_PATH}/MacOSX10.6.pkg Payload | gzip -d -c | cpio -i + + tar xf /home/ubuntu/build/osx-native-depends-r2.tar.gz + + # bdb + SOURCE_FILE=${SOURCES_PATH}/db-4.8.30.NC.tar.gz + BUILD_DIR=${BUILD_BASE}/db-4.8.30.NC + + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + sed -i 's/__atomic_compare_exchange/__atomic_compare_exchange_db/g' ${BUILD_DIR}/dbinc/atomic.h + pushd ${BUILD_DIR} + cd build_unix; + ../dist/configure --host=${HOST} --prefix="${PREFIX}" --disable-shared --enable-cxx CC="${INT_CC}" CXX="${INT_CXX}" AR="${INT_AR}" RANLIB="${INT_RANLIB}" OBJC="${INT_OBJC}" OBJCXX="${INT_OBJCXX}" CFLAGS="${INT_CFLAGS}" CXXFLAGS="${INT_CXXFLAGS}" LDFLAGS="${INT_CLANG_LDFLAGS} ${INT_LDFLAGS}" CPPFLAGS="${INT_CPPFLAGS}" + make $MAKEOPTS libdb.a libdb_cxx.a + make install_lib install_include + popd + + # openssl + SOURCE_FILE=${SOURCES_PATH}/openssl-1.0.1g.tar.gz + BUILD_DIR=${BUILD_BASE}/openssl-1.0.1g + + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + pushd ${BUILD_DIR} + sed -ie "s|cc:|${INT_CC}:|" ${BUILD_DIR}/Configure + sed -ie "s|\(-arch [_a-zA-Z0-9]*\)|\1 --sysroot ${SDK} -target ${HOST} -msse2|" ${BUILD_DIR}/Configure + AR="${INT_AR}" RANLIB="${INT_RANLIB}" ./Configure --prefix=${PREFIX} --openssldir=${PREFIX}/etc/openssl zlib shared no-krb5 darwin64-x86_64-cc ${INT_LDFLAGS} ${INT_CLANG_LDFLAGS} ${INT_CPPFLAGS} + sed -i "s|engines apps test|engines|" ${BUILD_DIR}/Makefile + sed -i "/define DATE/d" ${BUILD_DIR}/crypto/Makefile + make -j1 build_libs libcrypto.pc libssl.pc openssl.pc + make -j1 install_sw + popd + + #libminiupnpc + SOURCE_FILE=${SOURCES_PATH}/miniupnpc-1.9.tar.gz + BUILD_DIR=${BUILD_BASE}/miniupnpc-1.9 + + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + pushd ${BUILD_DIR} + CFLAGS="${INT_CFLAGS} ${INT_CPPFLAGS}" make $MAKEOPTS OS=Darwin CC="${INT_CC}" AR="${INT_AR}" libminiupnpc.a + install -d ${PREFIX}/include/miniupnpc + install *.h ${PREFIX}/include/miniupnpc + install libminiupnpc.a ${PREFIX}/lib + popd + + # qrencode + SOURCE_FILE=${SOURCES_PATH}/qrencode-3.4.3.tar.bz2 + BUILD_DIR=${BUILD_BASE}/qrencode-3.4.3 + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + pushd ${BUILD_DIR} + + # m4 folder is not included in the stable release, which can confuse aclocal + # if its timestamp ends up being earlier than configure.ac when extracted + touch aclocal.m4 + ./configure --host=${HOST} --prefix="${PREFIX}" --disable-shared CC="${INT_CC}" CXX="${INT_CXX}" AR="${INT_AR}" RANLIB="${INT_RANLIB}" OBJC="${INT_OBJC}" OBJCXX="${INT_OBJCXX}" CFLAGS="${INT_CFLAGS}" CXXFLAGS="${INT_CXXFLAGS}" LDFLAGS="${INT_CLANG_LDFLAGS} ${INT_LDFLAGS}" CPPFLAGS="${INT_CPPFLAGS}" --disable-shared -without-tools --disable-sdltest --disable-dependency-tracking + make $MAKEOPTS + make install + popd + + # libprotobuf + SOURCE_FILE=${SOURCES_PATH}/protobuf-2.5.0.tar.bz2 + BUILD_DIR=${BUILD_BASE}/protobuf-2.5.0 + + tar -C ${BUILD_BASE} -xjf ${SOURCE_FILE} + pushd ${BUILD_DIR} + ./configure --host=${HOST} --prefix="${PREFIX}" --disable-shared --enable-cxx CC="${INT_CC}" CXX="${INT_CXX}" AR="${INT_AR}" RANLIB="${INT_RANLIB}" OBJC="${INT_OBJC}" OBJCXX="${INT_OBJCXX}" CFLAGS="${INT_CFLAGS}" CXXFLAGS="${INT_CXXFLAGS}" LDFLAGS="${INT_CLANG_LDFLAGS} ${INT_LDFLAGS}" CPPFLAGS="${INT_CPPFLAGS}" --enable-shared=no --disable-dependency-tracking --with-protoc=${NATIVEPREFIX}/bin/protoc + cd src + make $MAKEOPTS libprotobuf.la + make install-libLTLIBRARIES install-nobase_includeHEADERS + cd .. + make install-pkgconfigDATA + popd + + # boost + SOURCE_FILE=${SOURCES_PATH}/boost_1_55_0.tar.bz2 + BUILD_DIR=${BUILD_BASE}/boost_1_55_0 + + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + pushd ${BUILD_DIR} + ./bootstrap.sh --with-libraries=chrono,filesystem,program_options,system,thread,test + echo "using darwin : : ${INT_CXX} : \"${INT_CFLAGS} ${INT_CPPFLAGS}\" \"${INT_LDFLAGS} ${INT_CLANG_LDFLAGS}\" \"${INT_LIBTOOL}\" \"${INT_STRIP}\" : ;" > "user-config.jam" + ./b2 -d2 --layout=tagged --build-type=complete --prefix="${PREFIX}" --toolset=darwin-4.2.1 --user-config=user-config.jam variant=release threading=multi link=static install + popd + + export GZIP="-9n" + find prefix | sort | tar --no-recursion -czf osx-depends-${REVISION}.tar.gz -T - + + mv osx-depends-${REVISION}.tar.gz $OUTDIR diff --git a/contrib/gitian-descriptors/gitian-osx-native.yml b/contrib/gitian-descriptors/gitian-osx-native.yml new file mode 100644 index 0000000000..6040e5ac5b --- /dev/null +++ b/contrib/gitian-descriptors/gitian-osx-native.yml @@ -0,0 +1,179 @@ +--- +name: "osx-native" +suites: +- "precise" +architectures: +- "i386" +packages: +- "git-core" +- "automake" +- "faketime" +- "libssl-dev" +- "libbz2-dev" +- "libz-dev" +- "cmake" +- "libcap-dev" +- "p7zip-full" +- "uuid-dev" + +reference_datetime: "2013-06-01 00:00:00" +remotes: [] +files: +- "10cc648683617cca8bcbeae507888099b41b530c.tar.gz" +- "cctools-809.tar.gz" +- "dyld-195.5.tar.gz" +- "ld64-127.2.tar.gz" +- "protobuf-2.5.0.tar.bz2" +- "MacOSX10.6.pkg" +- "cdrkit-1.1.11.tar.gz" +- "libdmg-hfsplus-v0.1.tar.gz" +- "clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz" +- "cdrkit-deterministic.patch" + + +script: | + + echo "18406961fd4a1ec5c7ea35c91d6a80a2f8bb797a2bd243a610bd75e13eff9aca 10cc648683617cca8bcbeae507888099b41b530c.tar.gz" | sha256sum -c + echo "03ba62749b843b131c7304a044a98c6ffacd65b1399b921d69add0375f79d8ad cctools-809.tar.gz" | sha256sum -c + echo "2cf0484c87cf79b606b351a7055a247dae84093ae92c747a74e0cde2c8c8f83c dyld-195.5.tar.gz" | sha256sum -c + echo "97b75547b2bd761306ab3e15ae297f01e7ab9760b922bc657f4ef72e4e052142 ld64-127.2.tar.gz" | sha256sum -c + echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c + echo "a2ccf2299de4e0bb88bd17a3355f02b747575b97492c7c2f5b789a64ccc4cbd6 MacOSX10.6.pkg" | sha256sum -c + echo "d1c030756ecc182defee9fe885638c1785d35a2c2a297b4604c0e0dcc78e47da cdrkit-1.1.11.tar.gz" | sha256sum -c + echo "6569a02eb31c2827080d7d59001869ea14484c281efab0ae7f2b86af5c3120b3 libdmg-hfsplus-v0.1.tar.gz" | sha256sum -c + echo "b9d57a88f9514fa1f327a1a703756d0c1c960f4c58494a5bd80313245d13ffff clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz" | sha256sum -c + echo "cc12bdbd7a09f71cb2a6a3e6ec3e0abe885ca7111c2b47857f5095e5980caf4f cdrkit-deterministic.patch" | sha256sum -c + + + REVISION=r2 + export REFERENCE_DATETIME + export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" + export FAKETIME=$REFERENCE_DATETIME + export TZ=UTC + + REAL_AR=`which ar` + REAL_RANLIB=`which ranlib` + REAL_DATE=`which date` + + echo '#!/bin/bash' > $HOME/ar + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> $HOME/ar + echo "$REAL_AR \"\$@\"" >> $HOME/ar + + echo '#!/bin/bash' > $HOME/ranlib + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> $HOME/ranlib + echo "$REAL_RANLIB \"\$@\"" >> $HOME/ranlib + + echo '#!/bin/bash' > $HOME/date + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> $HOME/date + echo "$REAL_DATE \"\$@\"" >> $HOME/date + + chmod +x $HOME/ar $HOME/ranlib $HOME/date + + + export PATH=$HOME:$PATH + export SOURCES_PATH=`pwd` + + mkdir -p osx-cross-depends/build + cd osx-cross-depends + + NATIVEPREFIX=`pwd`/native-prefix + BUILD_BASE=`pwd`/build + SDK=`pwd`/SDKs/MacOSX10.6.sdk + HOST=x86_64-apple-darwin11 + MIN_VERSION=10.6 + + CFLAGS="" + CXXFLAGS="${CFLAGS}" + LDFLAGS="-L${NATIVEPREFIX}/lib" + + export PATH=${NATIVEPREFIX}/bin:${PATH} + + mkdir -p ${NATIVEPREFIX}/bin + mkdir -p ${NATIVEPREFIX}/lib + + mkdir -p ${SDK} + 7z -bd -so -y e ${SOURCES_PATH}/MacOSX10.6.pkg Payload | gzip -d -c | cpio -i + + # Clang + SOURCE_FILE=${SOURCES_PATH}/clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz + BUILD_DIR=${BUILD_BASE}/clang+llvm-3.2-x86-linux-ubuntu-12.04 + + mkdir -p ${NATIVEPREFIX}/lib/clang/3.2/include + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + cp ${BUILD_DIR}/bin/clang ${NATIVEPREFIX}/bin/ + cp ${BUILD_DIR}/bin/clang++ ${NATIVEPREFIX}/bin/ + cp ${BUILD_DIR}/lib/libLTO.so ${NATIVEPREFIX}/lib/ + cp ${BUILD_DIR}/lib/clang/3.2/include/* ${NATIVEPREFIX}/lib/clang/3.2/include + + # cctools + SOURCE_FILE=${SOURCES_PATH}/10cc648683617cca8bcbeae507888099b41b530c.tar.gz + BUILD_DIR=${BUILD_BASE}/toolchain4-10cc648683617cca8bcbeae507888099b41b530c + + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + mkdir -p ${BUILD_DIR}/sdks + pushd ${BUILD_DIR}/sdks; + ln -sf ${SDK} MacOSX10.6.sdk + ln -sf ${SOURCES_PATH}/cctools-809.tar.gz ${BUILD_DIR}/cctools2odcctools/cctools-809.tar.gz + ln -sf ${SOURCES_PATH}/ld64-127.2.tar.gz ${BUILD_DIR}/cctools2odcctools/ld64-127.2.tar.gz + ln -sf ${SOURCES_PATH}/dyld-195.5.tar.gz ${BUILD_DIR}/cctools2odcctools/dyld-195.5.tar.gz + + tar -C ${BUILD_DIR} -xf ${SOURCES_PATH}/clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz + # Hack in the use of our llvm headers rather than grabbing the old llvm-gcc. + sed -i "s|GCC_DIR|LLVM_CLANG_DIR|g" ${BUILD_DIR}/cctools2odcctools/extract.sh + sed -i "s|llvmgcc42-2336.1|clang+llvm-3.2-x86-linux-ubuntu-12.04|g" ${BUILD_DIR}/cctools2odcctools/extract.sh + sed -i "s|\${LLVM_CLANG_DIR}/llvmCore/include/llvm-c|\${LLVM_CLANG_DIR}/include/llvm-c \${LLVM_CLANG_DIR}/include/llvm |" ${BUILD_DIR}/cctools2odcctools/extract.sh + + sed -i "s|fAC_INIT|AC_INIT|" ${BUILD_DIR}/cctools2odcctools/files/configure.ac + sed -i 's/\# Dynamically linked LTO/\t ;\&\n\t linux*)\n# Dynamically linked LTO/' ${BUILD_DIR}/cctools2odcctools/files/configure.ac + + cd ${BUILD_DIR}/cctools2odcctools + ./extract.sh --osxver 10.6 + cd odcctools-809 + ./configure --prefix=${NATIVEPREFIX} --target=${HOST} CFLAGS="${CFLAGS} -I${NATIVEPREFIX}/include -D__DARWIN_UNIX03 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS" LDFLAGS="${LDFLAGS} -Wl,-rpath=\\\$\$ORIGIN/../lib" --with-sysroot=${SDK} + + # The 'PC' define in sparc/reg.h conflicts but doesn't get used anyway. Just rename it. + sed -i "s|define\tPC|define\tPC_|" ${BUILD_DIR}/cctools2odcctools/odcctools-809/include/architecture/sparc/reg.h + make $MAKEOPTS + make install + popd + + # protoc + SOURCE_FILE=${SOURCES_PATH}/protobuf-2.5.0.tar.bz2 + BUILD_DIR=${BUILD_BASE}/protobuf-2.5.0 + + tar -C ${BUILD_BASE} -xjf ${SOURCE_FILE} + pushd ${BUILD_DIR}; + ./configure --enable-shared=no --disable-dependency-tracking --prefix=${NATIVEPREFIX} + make $MAKEOPTS + cp ${BUILD_DIR}/src/protoc ${NATIVEPREFIX}/bin/ + popd + + # cdrkit + SOURCE_FILE=${SOURCES_PATH}/cdrkit-1.1.11.tar.gz + BUILD_DIR=${BUILD_BASE}/cdrkit-1.1.11 + + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + pushd ${BUILD_DIR} + patch -p1 < ${SOURCES_PATH}/cdrkit-deterministic.patch + cmake -DCMAKE_INSTALL_PREFIX=${NATIVEPREFIX} + make $MAKEOPTS genisoimage + make -C genisoimage install + popd + + # libdmg-hfsplus + SOURCE_FILE=${SOURCES_PATH}/libdmg-hfsplus-v0.1.tar.gz + BUILD_DIR=${BUILD_BASE}/libdmg-hfsplus-libdmg-hfsplus-v0.1 + + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + mkdir -p ${BUILD_DIR}/build + pushd ${BUILD_DIR}/build + cmake -DCMAKE_INSTALL_PREFIX:PATH=${NATIVEPREFIX}/bin .. + make $MAKEOPTS + make install + popd + + rm -rf native-prefix/docs + + export GZIP="-9n" + find native-prefix | sort | tar --no-recursion -czf osx-native-depends-$REVISION.tar.gz -T - + mv osx-native-depends-$REVISION.tar.gz $OUTDIR diff --git a/contrib/gitian-descriptors/gitian-osx-qt.yml b/contrib/gitian-descriptors/gitian-osx-qt.yml new file mode 100644 index 0000000000..d0be016e68 --- /dev/null +++ b/contrib/gitian-descriptors/gitian-osx-qt.yml @@ -0,0 +1,192 @@ +--- +name: "osx-qt" +suites: +- "precise" +architectures: +- "i386" +packages: +- "git-core" +- "automake" +- "p7zip-full" + +reference_datetime: "2013-06-01 00:00:00" +remotes: [] +files: +- "qt-everywhere-opensource-src-5.2.1.tar.gz" +- "osx-native-depends-r2.tar.gz" +- "osx-depends-r2.tar.gz" +- "MacOSX10.6.pkg" + +script: | + + echo "84e924181d4ad6db00239d87250cc89868484a14841f77fb85ab1f1dbdcd7da1 qt-everywhere-opensource-src-5.2.1.tar.gz" | sha256sum -c + echo "a2ccf2299de4e0bb88bd17a3355f02b747575b97492c7c2f5b789a64ccc4cbd6 MacOSX10.6.pkg" | sha256sum -c + + REVISION=r2 + export SOURCES_PATH=`pwd` + export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" + export ZERO_AR_DATE=1 + + export TZ=UTC + + REAL_DATE=`which date` + echo '#!/bin/bash' > $HOME/date + echo "$REAL_DATE -d \"${REFERENCE_DATETIME}\" \"\$@\"" >> $HOME/date + + chmod +x $HOME/date + export PATH=$HOME:$PATH + + mkdir -p osx-cross-depends/build + cd osx-cross-depends + + PREFIX=`pwd`/prefix + NATIVEPREFIX=`pwd`/native-prefix + BUILD_BASE=`pwd`/build + SDK=`pwd`/SDKs/MacOSX10.6.sdk + HOST=x86_64-apple-darwin11 + MIN_VERSION=10.6 + + INT_CFLAGS="-target ${HOST} -mmacosx-version-min=${MIN_VERSION} --sysroot ${SDK} -msse2 -Qunused-arguments" + INT_CXXFLAGS="${INT_CFLAGS}" + INT_LDFLAGS="-L${PREFIX}/lib -L${SDK}/usr/lib/i686-apple-darwin10/4.2.1" + INT_LDFLAGS_CLANG="-B${NATIVEPREFIX}/bin" + INT_CPPFLAGS="-I${PREFIX}/include" + INT_CC=clang + INT_CXX=clang++ + INT_OBJC=clang + INT_OBJCXX=clang++ + INT_AR=${HOST}-ar + INT_RANLIB=${HOST}-ranlib + INT_LIBTOOL=${HOST}-libtool + INT_INSTALL_NAME_TOOL=${HOST}-install_name_tool + + export PATH=${NATIVEPREFIX}/bin:${PATH} + + mkdir -p ${NATIVEPREFIX}/bin + mkdir -p ${NATIVEPREFIX}/lib + mkdir -p ${PREFIX}/bin + mkdir -p ${PREFIX}/lib + mkdir -p ${BUILD_BASE} + + mkdir -p ${SDK} + 7z -bd -so -y e ${SOURCES_PATH}/MacOSX10.6.pkg Payload | gzip -d -c | cpio -i + + tar xf /home/ubuntu/build/osx-native-depends-r2.tar.gz + + + mkdir -p SDKs + 7z -bd -so -y e ${SOURCES_PATH}/MacOSX10.6.pkg Payload | gzip -d -c | cpio -i + + tar xf /home/ubuntu/build/osx-native-depends-r2.tar.gz + export PATH=`pwd`/native-prefix/bin:$PATH + tar xf /home/ubuntu/build/osx-depends-r2.tar.gz + + SOURCE_FILE=${SOURCES_PATH}/qt-everywhere-opensource-src-5.2.1.tar.gz + BUILD_DIR=${BUILD_BASE}/qt-everywhere-opensource-src-5.2.1 + + + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + + # Install our mkspec. All files are pulled from the macx-clang spec, except for + # our custom qmake.conf + SPECFILE=${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux/qmake.conf + + mkdir -p ${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux + cp -f ${BUILD_DIR}/qtbase/mkspecs/macx-clang/Info.plist.lib ${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux/ + cp -f ${BUILD_DIR}/qtbase/mkspecs/macx-clang/Info.plist.app ${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux/ + cp -f ${BUILD_DIR}/qtbase/mkspecs/macx-clang/qplatformdefs.h ${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux/ + + cat > ${SPECFILE} < Date: Wed, 21 May 2014 12:27:37 +0200 Subject: [PATCH 0077/1288] qt: Periodic language update --- src/qt/locale/bitcoin_af_ZA.ts | 2 +- src/qt/locale/bitcoin_ar.ts | 443 +++++++++++++++++---------------- src/qt/locale/bitcoin_cs.ts | 18 +- src/qt/locale/bitcoin_da.ts | 88 +++---- src/qt/locale/bitcoin_es.ts | 9 +- src/qt/locale/bitcoin_fi.ts | 2 +- src/qt/locale/bitcoin_ja.ts | 8 +- src/qt/locale/bitcoin_ko_KR.ts | 68 ++--- src/qt/locale/bitcoin_lt.ts | 6 +- src/qt/locale/bitcoin_lv_LV.ts | 289 ++++++++++----------- src/qt/locale/bitcoin_nb.ts | 6 +- src/qt/locale/bitcoin_pl.ts | 8 +- src/qt/locale/bitcoin_sk.ts | 207 ++++++++------- 13 files changed, 588 insertions(+), 566 deletions(-) diff --git a/src/qt/locale/bitcoin_af_ZA.ts b/src/qt/locale/bitcoin_af_ZA.ts index 80e4de010f..6e8395e589 100644 --- a/src/qt/locale/bitcoin_af_ZA.ts +++ b/src/qt/locale/bitcoin_af_ZA.ts @@ -1898,7 +1898,7 @@ Address: %4 The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Die adres waarheen die betaling gestuur moet word (b.v. 1H7wyVL5HCNoVFyyBJSDojwyxcCChU7TPA) + Die adres waarheen die betaling gestuur moet word (b.v. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) Enter a label for this address to add it to your address book diff --git a/src/qt/locale/bitcoin_ar.ts b/src/qt/locale/bitcoin_ar.ts index 32b0d4b0fc..5877cc35d9 100644 --- a/src/qt/locale/bitcoin_ar.ts +++ b/src/qt/locale/bitcoin_ar.ts @@ -20,7 +20,7 @@ This product includes software developed by the OpenSSL Project for use in the O Copyright - + الحقوق محفوظة The Bitcoin Core developers @@ -35,7 +35,7 @@ This product includes software developed by the OpenSSL Project for use in the O AddressBookPage Double-click to edit address or label - أنقر على الماوس مرتين لتعديل العنوان + أنقر بالماوس مرتين لتعديل العنوان او الوصف Create a new address @@ -43,7 +43,7 @@ This product includes software developed by the OpenSSL Project for use in the O &New - + &جديد Copy the currently selected address to the system clipboard @@ -51,11 +51,11 @@ This product includes software developed by the OpenSSL Project for use in the O &Copy - + &نسخ C&lose - + &اغلاق &Copy Address @@ -63,7 +63,7 @@ This product includes software developed by the OpenSSL Project for use in the O Delete the currently selected address from the list - + حذف العنوان المحدد من القائمة Export the data in the current tab to a file @@ -71,7 +71,7 @@ This product includes software developed by the OpenSSL Project for use in the O &Export - + &تصدير &Delete @@ -79,23 +79,23 @@ This product includes software developed by the OpenSSL Project for use in the O Choose the address to send coins to - + اختر العنوان الذي سترسل له العملات Choose the address to receive coins with - + اختر العنوان الذي تستقبل عليه العملات C&hoose - + &اختر Sending addresses - + ارسال العناوين Receiving addresses - + استقبال العناوين These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. @@ -107,7 +107,7 @@ This product includes software developed by the OpenSSL Project for use in the O Copy &Label - + نسخ &الوصف &Edit @@ -115,7 +115,7 @@ This product includes software developed by the OpenSSL Project for use in the O Export Address List - + تصدير قائمة العناوين Comma separated file (*.csv) @@ -123,7 +123,7 @@ This product includes software developed by the OpenSSL Project for use in the O Exporting Failed - + فشل التصدير There was an error trying to save the address list to %1. @@ -157,15 +157,15 @@ This product includes software developed by the OpenSSL Project for use in the O New passphrase - عبارة مرور جديدة + كلمة مرور جديدة Repeat new passphrase - ادخل الجملة السرية مرة أخرى + ادخل كلمة المرور الجديدة مرة أخرى Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - أدخل عبارة مرور جديدة إلى المحفظة. الرجاء استخدام عبارة مرور تتكون من10 حروف عشوائية على الاقل, أو أكثر من 7 كلمات + أدخل كلمة مرور جديدة للمحفظة. <br/>الرجاء استخدام كلمة مرور تتكون <b>من 10 حروف عشوائية على الاقل</b>, أو <b>أكثر من 7 كلمات</b>. Encrypt wallet @@ -173,7 +173,7 @@ This product includes software developed by the OpenSSL Project for use in the O This operation needs your wallet passphrase to unlock the wallet. - هذه العملية تحتاج عبارة المرور محفظتك لفتحها + هذه العملية تحتاج كلمة مرور محفظتك لفتحها Unlock wallet @@ -181,7 +181,7 @@ This product includes software developed by the OpenSSL Project for use in the O This operation needs your wallet passphrase to decrypt the wallet. - هذه العملية تحتاج عبارة المرور محفظتك فك تشفيرها + هذه العملية تحتاج كلمة مرور محفظتك لفك تشفيرها Decrypt wallet @@ -189,15 +189,15 @@ This product includes software developed by the OpenSSL Project for use in the O Change passphrase - تغيير عبارة المرور + تغيير كلمة المرور Enter the old and new passphrase to the wallet. - أدخل عبارة المرور القديمة والجديدة إلى المحفظة. + أدخل كلمة المرور القديمة والجديدة للمحفظة. Confirm wallet encryption - تأكيد التشفير المحفظة + تأكيد تشفير المحفظة Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! @@ -213,7 +213,7 @@ This product includes software developed by the OpenSSL Project for use in the O Warning: The Caps Lock key is on! - + تحذير: مفتاح الحروف الكبيرة مفعل Wallet encrypted @@ -229,12 +229,11 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet encryption failed due to an internal error. Your wallet was not encrypted. - شل تشفير المحفظة بسبب خطأ داخلي. لم يتم تشفير محفظتك. + فشل تشفير المحفظة بسبب خطأ داخلي. لم يتم تشفير محفظتك. The supplied passphrases do not match. - عبارتي المرور ليستا متطابقتان - + كلمتي المرور ليستا متطابقتان Wallet unlock failed @@ -242,8 +241,7 @@ This product includes software developed by the OpenSSL Project for use in the O The passphrase entered for the wallet decryption was incorrect. - عبارة المرور التي تم إدخالها لفك شفرة المحفظة غير صحيحة. - + كلمة المرور التي تم إدخالها لفك تشفير المحفظة غير صحيحة. Wallet decryption failed @@ -262,11 +260,11 @@ This product includes software developed by the OpenSSL Project for use in the O Synchronizing with network... - مزامنة مع شبكة ... + مزامنة مع الشبكة ... &Overview - نظرة عامة + &نظرة عامة Node @@ -278,11 +276,11 @@ This product includes software developed by the OpenSSL Project for use in the O &Transactions - المعاملات + &المعاملات Browse transaction history - تصفح التاريخ المعاملات + تصفح سجل المعاملات E&xit @@ -294,7 +292,7 @@ This product includes software developed by the OpenSSL Project for use in the O Show information about Bitcoin - إظهار المزيد معلومات حول Bitcoin + إظهار معلومات حول بت كوين About &Qt @@ -306,19 +304,19 @@ This product includes software developed by the OpenSSL Project for use in the O &Options... - خيارات ... + &خيارات ... &Encrypt Wallet... - + &تشفير المحفظة &Backup Wallet... - + &نسخ احتياط للمحفظة &Change Passphrase... - + &تغيير كلمة المرور &Sending addresses... @@ -330,7 +328,7 @@ This product includes software developed by the OpenSSL Project for use in the O Open &URI... - + افتح &URI... Importing blocks from disk... @@ -354,11 +352,11 @@ This product includes software developed by the OpenSSL Project for use in the O Change the passphrase used for wallet encryption - تغيير عبارة المرور المستخدمة لتشفير المحفظة + تغيير كلمة المرور المستخدمة لتشفير المحفظة &Debug window - + &نافذة المعالجة Open debugging and diagnostic console @@ -366,7 +364,7 @@ This product includes software developed by the OpenSSL Project for use in the O &Verify message... - + &التحقق من الرسالة... Bitcoin @@ -378,19 +376,19 @@ This product includes software developed by the OpenSSL Project for use in the O &Send - + %ارسل &Receive - + &استقبل &Show / Hide - + &عرض / اخفاء Show or hide the main Window - + عرض او اخفاء النافذة الرئيسية Encrypt the private keys that belong to your wallet @@ -406,15 +404,15 @@ This product includes software developed by the OpenSSL Project for use in the O &File - ملف + &ملف &Settings - الاعدادات + &الاعدادات &Help - مساعدة + &مساعدة Tabs toolbar @@ -458,7 +456,7 @@ This product includes software developed by the OpenSSL Project for use in the O Bitcoin client - عميل بتكوين + عميل بت كوين %n active connection(s) to Bitcoin network @@ -478,15 +476,15 @@ This product includes software developed by the OpenSSL Project for use in the O %n hour(s) - + %n ساعة%n ساعة%n ساعة%n ساعات%n ساعات%n ساعات %n day(s) - + %n يوم%n يوم%n يوم%n أيام%n أيام%n ايام %n week(s) - + %n اسبوع%n اسبوع%n اسبوع%n اسابيع%n اسابيع%n اسابيع %1 and %2 @@ -514,15 +512,15 @@ This product includes software developed by the OpenSSL Project for use in the O Warning - + تحذير Information - + معلومات Up to date - محين + محدث Catching up... @@ -534,7 +532,7 @@ This product includes software developed by the OpenSSL Project for use in the O Incoming transaction - المعاملات واردة + المعاملات الواردة Date: %1 @@ -542,15 +540,19 @@ Amount: %2 Type: %3 Address: %4 - + التاريخ : 1% +القيمة: 2% +النوع: 3% +العنوان: 4% + Wallet is <b>encrypted</b> and currently <b>unlocked</b> - المحفظة مشفرة و مفتوحة حاليا + المحفظة <b>مشفرة</b> و <b>مفتوحة</b> حاليا Wallet is <b>encrypted</b> and currently <b>locked</b> - المحفظة مشفرة و مقفلة حاليا + المحفظة <b>مشفرة</b> و <b>مقفلة</b> حاليا A fatal error occurred. Bitcoin can no longer continue safely and will quit. @@ -561,7 +563,7 @@ Address: %4 ClientModel Network Alert - + تنبيه من الشبكة @@ -572,7 +574,7 @@ Address: %4 Quantity: - + الكمية: Bytes: @@ -580,7 +582,7 @@ Address: %4 Amount: - + القيمة Priority: @@ -588,7 +590,7 @@ Address: %4 Fee: - + رسوم : Low Output: @@ -628,7 +630,7 @@ Address: %4 Confirmations - + تأكيد Confirmed @@ -636,11 +638,11 @@ Address: %4 Priority - + أفضلية Copy address - انسخ عنوان + انسخ العنوان Copy label @@ -648,11 +650,11 @@ Address: %4 Copy amount - نسخ الكمية + نسخ القيمة Copy transaction ID - + نسخ رقم المعاملة Lock unspent @@ -664,15 +666,15 @@ Address: %4 Copy quantity - + نسخ الكمية Copy fee - + نسخ الرسوم Copy after fee - + نسخ بعد الرسوم Copy bytes @@ -680,7 +682,7 @@ Address: %4 Copy priority - + نسخ الافضلية Copy low output @@ -688,19 +690,19 @@ Address: %4 Copy change - + نسخ التغييرات highest - + الاعلى higher - + اعلى high - + عالي medium-high @@ -716,7 +718,7 @@ Address: %4 low - + منخفض lower @@ -732,7 +734,7 @@ Address: %4 none - + لا شيء Dust @@ -803,7 +805,7 @@ Address: %4 &Label - + &وصف The label associated with this address list entry @@ -815,11 +817,11 @@ Address: %4 &Address - العنوان + &العنوان New receiving address - عنوان تلقي جديد + عنوان أستلام جديد New sending address @@ -827,8 +829,7 @@ Address: %4 Edit receiving address - تعديل عنوان التلقي - + تعديل عنوان الأستلام Edit sending address @@ -855,11 +856,11 @@ Address: %4 FreespaceChecker A new data directory will be created. - + سيتم انشاء دليل بيانات جديد name - + الاسم Directory already exists. Add %1 if you intend to create a new directory here. @@ -871,7 +872,7 @@ Address: %4 Cannot create data directory here. - + لا يمكن انشاء دليل بيانات هنا . @@ -925,7 +926,7 @@ Address: %4 Intro Welcome - + أهلا Welcome to Bitcoin Core. @@ -941,11 +942,11 @@ Address: %4 Use the default data directory - + استخدام دليل البانات الافتراضي Use a custom data directory: - + استخدام دليل بيانات مخصص: Bitcoin @@ -961,11 +962,11 @@ Address: %4 GB of free space available - + قيقا بايت مساحة متاحة (of %1GB needed) - + ( بحاجة الى 1%قيقا بايت ) @@ -984,11 +985,11 @@ Address: %4 Select payment request file - + حدد ملف طلب الدفع Select payment request file to open - + حدد ملف طلب الدفع لفتحه @@ -999,7 +1000,7 @@ Address: %4 &Main - الرئيسي + &الرئيسي Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. @@ -1007,7 +1008,7 @@ Address: %4 Pay transaction &fee - + ادفع &رسوم المعاملة Automatically start Bitcoin after logging in to the system. @@ -1023,7 +1024,7 @@ Address: %4 MB - + م ب Number of script &verification threads @@ -1047,7 +1048,7 @@ Address: %4 Third party transaction URLs - + عنوان النطاق للطرف الثالث Active command-line options that override above options: @@ -1059,11 +1060,11 @@ Address: %4 &Reset Options - + &استعادة الخيارات &Network - + &الشبكة (0 = auto, <0 = leave that many cores free) @@ -1071,11 +1072,11 @@ Address: %4 W&allet - + &محفظة Expert - + تصدير Enable coin &control features @@ -1099,15 +1100,15 @@ Address: %4 Proxy &IP: - + بروكسي &اي بي: &Port: - + &المنفذ: Port of the proxy (e.g. 9050) - + منفذ البروكسي (مثلا 9050) SOCKS &Version: @@ -1139,11 +1140,11 @@ Address: %4 &Display - + &عرض User Interface &language: - + واجهة المستخدم &اللغة: The user interface language can be set here. This setting will take effect after restarting Bitcoin. @@ -1183,11 +1184,11 @@ Address: %4 none - + لا شيء Confirm options reset - + تأكيد استعادة الخيارات Client restart required to activate changes. @@ -1230,7 +1231,7 @@ Address: %4 Pending: - + معلق: Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance @@ -1246,11 +1247,11 @@ Address: %4 Total: - + المجموع: Your current total balance - + رصيدك الكلي الحالي <b>Recent transactions</b> @@ -1321,7 +1322,7 @@ Address: %4 Bad response from server %1 - + استجابة سيئة من الملقم٪ 1 Payment acknowledged @@ -1363,15 +1364,15 @@ Address: %4 QRImageWidget &Save Image... - + &حفظ الصورة &Copy Image - + &نسخ الصورة Save QR Code - + حفظ رمز الاستجابة السريعة QR PNG Image (*.png) @@ -1402,7 +1403,7 @@ Address: %4 General - + عام Using OpenSSL version @@ -1410,7 +1411,7 @@ Address: %4 Startup time - + وقت البدء Network @@ -1450,23 +1451,23 @@ Address: %4 &Network Traffic - + &حركة مرور الشبكة &Clear - + &مسح Totals - + المجاميع In: - + داخل: Out: - + خارج: Build date @@ -1490,7 +1491,7 @@ Address: %4 Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - + استخدم اسهم الاعلى و الاسفل للتنقل بين السجلات و <b>Ctrl-L</b> لمسح الشاشة Type <b>help</b> for an overview of available commands. @@ -1498,46 +1499,46 @@ Address: %4 %1 B - + 1% بايت %1 KB - + 1% كيلو بايت %1 MB - + 1% ميقا بايت %1 GB - + 1% قيقا بايت %1 m - + 1% دقيقة %1 h - + 1% ساعة %1 h %2 m - + 1% ساعة 2% دقيقة ReceiveCoinsDialog &Amount: - + &القيمة &Label: - + &الوصف: &Message: - + &رسالة: Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. @@ -1565,15 +1566,15 @@ Address: %4 Clear all fields of the form. - + مسح كل حقول النموذج المطلوبة Clear - + مسح Requested payments history - + سجل طلبات الدفع &Request payment @@ -1585,7 +1586,7 @@ Address: %4 Show - + عرض Remove the selected entries from the list @@ -1593,7 +1594,7 @@ Address: %4 Remove - + ازل Copy label @@ -1605,26 +1606,26 @@ Address: %4 Copy amount - نسخ الكمية + نسخ القيمة ReceiveRequestDialog QR Code - + رمز كيو ار Copy &URI - + نسخ &URI Copy &Address - + نسخ &العنوان &Save Image... - + &حفظ الصورة Request payment to %1 @@ -1636,7 +1637,7 @@ Address: %4 URI - + URI Address @@ -1652,7 +1653,7 @@ Address: %4 Message - + رسالة Resulting URI too long, try to reduce the text for label / message. @@ -1675,7 +1676,7 @@ Address: %4 Message - + رسالة Amount @@ -1687,7 +1688,7 @@ Address: %4 (no message) - + ( لا رسائل ) (no amount) @@ -1710,7 +1711,7 @@ Address: %4 automatically selected - + اختيار تلقائيا Insufficient funds! @@ -1718,7 +1719,7 @@ Address: %4 Quantity: - + الكمية : Bytes: @@ -1726,15 +1727,15 @@ Address: %4 Amount: - + القيمة : Priority: - + افضلية : Fee: - + رسوم : Low Output: @@ -1742,11 +1743,11 @@ Address: %4 After Fee: - + بعد الرسوم : Change: - + تعديل : If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. @@ -1762,7 +1763,7 @@ Address: %4 Add &Recipient - + أضافة &مستلم Clear all fields of the form. @@ -1782,7 +1783,7 @@ Address: %4 S&end - + &ارسال Confirm send coins @@ -1790,23 +1791,23 @@ Address: %4 %1 to %2 - + 1% الى 2% Copy quantity - + نسخ الكمية Copy amount - نسخ الكمية + نسخ القيمة Copy fee - + نسخ الرسوم Copy after fee - + نسخ بعد الرسوم Copy bytes @@ -1814,7 +1815,7 @@ Address: %4 Copy priority - + نسخ الافضلية Copy low output @@ -1822,15 +1823,15 @@ Address: %4 Copy change - + نسخ التعديل Total Amount %1 (= %2) - + مجموع المبلغ %1 (= %2) or - + أو The recipient address is not valid, please recheck. @@ -1842,11 +1843,11 @@ Address: %4 The amount exceeds your balance. - + القيمة تتجاوز رصيدك The total exceeds your balance when the %1 transaction fee is included. - + المجموع يتجاوز رصيدك عندما يتم اضافة 1% رسوم العملية Duplicate address found, can only send to each address once per send operation. @@ -1897,7 +1898,7 @@ Address: %4 Pay &To: - ادفع الى + ادفع &الى : The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) @@ -1909,7 +1910,7 @@ Address: %4 &Label: - + &وصف : Choose previously used address @@ -1925,7 +1926,7 @@ Address: %4 Paste address from clipboard - انسخ العنوان من لوحة المفاتيح + الصق العنوان من لوحة المفاتيح Alt+P @@ -1972,7 +1973,7 @@ Address: %4 Do not shut down the computer until this window disappears. - + لا توقف عمل الكمبيوتر حتى تختفي هذه النافذة @@ -1983,7 +1984,7 @@ Address: %4 &Sign Message - + &توقيع الرسالة You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. @@ -2011,11 +2012,11 @@ Address: %4 Enter the message you want to sign here - + ادخل الرسالة التي تريد توقيعها هنا Signature - + التوقيع Copy the current signature to the system clipboard @@ -2023,11 +2024,11 @@ Address: %4 Sign the message to prove you own this Bitcoin address - + وقع الرسالة لتثبت انك تمتلك عنوان البت كوين هذا Sign &Message - + توقيع $الرسالة Reset all sign message fields @@ -2039,7 +2040,7 @@ Address: %4 &Verify Message - + &تحقق رسالة Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. @@ -2055,7 +2056,7 @@ Address: %4 Verify &Message - + تحقق &الرسالة Reset all verify message fields @@ -2067,7 +2068,7 @@ Address: %4 Click "Sign Message" to generate signature - + اضغط "توقيع الرسالة" لتوليد التوقيع The entered address is invalid. @@ -2083,7 +2084,7 @@ Address: %4 Wallet unlock was cancelled. - + تم الغاء عملية فتح المحفظة Private key for the entered address is not available. @@ -2103,7 +2104,7 @@ Address: %4 Please check the signature and try again. - + فضلا تاكد من التوقيع وحاول مرة اخرى The signature did not match the message digest. @@ -2148,7 +2149,7 @@ Address: %4 conflicted - + يتعارض %1/offline @@ -2196,7 +2197,7 @@ Address: %4 label - + علامة Credit @@ -2216,7 +2217,7 @@ Address: %4 Transaction fee - رسوم التحويل + رسوم المعاملة Net amount @@ -2224,7 +2225,7 @@ Address: %4 Message - + رسالة Comment @@ -2236,7 +2237,7 @@ Address: %4 Merchant - + تاجر Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. @@ -2268,7 +2269,7 @@ Address: %4 , has not been successfully broadcast yet - لم يتم حتى الآن البث بنجاح + , لم يتم حتى الآن البث بنجاح Open for %n more block(s) @@ -2421,7 +2422,7 @@ Address: %4 Range... - v + المدى... Received with @@ -2449,7 +2450,7 @@ Address: %4 Min amount - + الحد الأدنى Copy address @@ -2465,7 +2466,7 @@ Address: %4 Copy transaction ID - + نسخ رقم العملية Edit label @@ -2473,7 +2474,7 @@ Address: %4 Show transaction details - + عرض تفاصيل المعاملة Export Transaction History @@ -2481,7 +2482,7 @@ Address: %4 Exporting Failed - + فشل التصدير There was an error trying to save the transaction history to %1. @@ -2489,7 +2490,7 @@ Address: %4 Exporting Successful - نجح الاستخراج + نجح التصدير The transaction history was successfully saved to %1. @@ -2529,7 +2530,7 @@ Address: %4 Range: - + المدى: to @@ -2554,7 +2555,7 @@ Address: %4 WalletView &Export - + &تصدير Export the data in the current tab to a file @@ -2562,7 +2563,7 @@ Address: %4 Backup Wallet - + نسخ احتياط للمحفظة Wallet Data (*.dat) @@ -2570,7 +2571,7 @@ Address: %4 Backup Failed - + فشل النسخ الاحتياطي There was an error trying to save the wallet data to %1. @@ -2582,7 +2583,7 @@ Address: %4 Backup Successful - + نجاح النسخ الاحتياطي @@ -2613,7 +2614,7 @@ Address: %4 Specify data directory - حدد موقع مجلد المعلومات او data directory + حدد مجلد المعلومات Listen for connections on <port> (default: 8333 or testnet: 18333) @@ -2867,15 +2868,15 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error: Disk space is low! - + تحذير: مساحة القرص منخفضة Error: Wallet locked, unable to create transaction! - + تحذير: المحفظة مغلقة , لا تستطيع تنفيذ المعاملة Error: system error: - + خطأ: خطأ في النظام: Failed to listen on any port. Use -listen=0 if you want this. @@ -2959,7 +2960,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Invalid -onion address: '%s' - + عنوان اونيون غير صحيح : '%s' Not enough file descriptors available. @@ -3015,7 +3016,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Verifying wallet... - + التحقق من المحفظة ... Wait for RPC server to start @@ -3027,7 +3028,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Wallet options: - + خيارات المحفظة : Warning: Deprecated argument -debugnet ignored, use -debug=net @@ -3059,7 +3060,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Information - + معلومات Invalid amount for -minrelaytxfee=<amount>: '%s' @@ -3159,7 +3160,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Signing transaction failed - + فشل توقيع المعاملة Specify connection timeout in milliseconds (default: 5000) @@ -3171,19 +3172,19 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. System error: - + خطأ في النظام : Transaction amount too small - + قيمة العملية صغيره جدا Transaction amounts must be positive - + يجب ان يكون قيمة العملية بالموجب Transaction too large - + المعاملة طويلة جدا Use UPnP to map the listening port (default: 0) @@ -3199,11 +3200,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning - + تحذير Warning: This version is obsolete, upgrade required! - + تحذير : هذا الاصدار قديم , يتطلب التحديث Zapping all transactions from wallet... @@ -3239,7 +3240,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Upgrade wallet to latest format - + تحديث المحفظة للنسخة الاخيرة Set key pool size to <n> (default: 100) @@ -3259,7 +3260,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Server private key (default: server.pem) - + المفتاح الخاص بالسيرفر (default: server.pem) This help message @@ -3295,7 +3296,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Invalid -proxy address: '%s' - + عنوان البروكسي غير صحيح : '%s' Unknown network specified in -onlynet: '%s' @@ -3319,11 +3320,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Invalid amount - + قيمة غير صحيحة Insufficient funds - + اموال غير كافية Loading block index... @@ -3343,7 +3344,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Cannot write default address - + لايمكن كتابة العنوان الافتراضي Rescanning... @@ -3355,7 +3356,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. To use the %s option - + لاستخدام %s الخيار Error diff --git a/src/qt/locale/bitcoin_cs.ts b/src/qt/locale/bitcoin_cs.ts index ba4d2def35..6cc783b59e 100644 --- a/src/qt/locale/bitcoin_cs.ts +++ b/src/qt/locale/bitcoin_cs.ts @@ -1571,7 +1571,7 @@ Adresa: %4 Clear all fields of the form. - + Smaže všechny pole formuláře. Clear @@ -1599,7 +1599,7 @@ Adresa: %4 Remove - + Odstranit Copy label @@ -1712,11 +1712,11 @@ Adresa: %4 Inputs... - + Vstupy... automatically selected - + automaticky vybrané Insufficient funds! @@ -1772,7 +1772,7 @@ Adresa: %4 Clear all fields of the form. - + Smaže všechny pole formuláře. Clear &All @@ -1880,7 +1880,7 @@ Adresa: %4 Are you sure you want to send? - + Opravdu chcete odeslat %1? added as transaction fee @@ -1947,7 +1947,7 @@ Adresa: %4 This is a verified payment request. - + Toto je ověřený požadavek k platbě. Enter a label for this address to add it to the list of used addresses @@ -1959,7 +1959,7 @@ Adresa: %4 This is an unverified payment request. - + Toto je neověřený požadavek k platbě. Pay To: @@ -3127,7 +3127,7 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. RPC server options: - + Možnosti RPC serveru: Randomly drop 1 of every <n> network messages diff --git a/src/qt/locale/bitcoin_da.ts b/src/qt/locale/bitcoin_da.ts index 442a86b7c0..5795701497 100644 --- a/src/qt/locale/bitcoin_da.ts +++ b/src/qt/locale/bitcoin_da.ts @@ -52,7 +52,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Copy the currently selected address to the system clipboard - Kopier den valgte adresse til systemets udklipsholder + Kopiér den valgte adresse til systemets udklipsholder &Copy @@ -64,7 +64,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open &Copy Address - Kopier adresse + Kopiér adresse Delete the currently selected address from the list @@ -112,11 +112,11 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Copy &Label - Kopier mærkat + Kopiér mærkat &Edit - Rediger + Redigér Export Address List @@ -174,7 +174,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Encrypt wallet - Krypter tegnebog + Kryptér tegnebog This operation needs your wallet passphrase to unlock the wallet. @@ -190,7 +190,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Decrypt wallet - Dekrypter tegnebog + Dekryptér tegnebog Change passphrase @@ -261,11 +261,11 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open BitcoinGUI Sign &message... - Underskriv besked... + Underskriv besked … Synchronizing with network... - Synkroniserer med netværk... + Synkroniserer med netværk … &Overview @@ -309,19 +309,19 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open &Options... - Indstillinger... + Indstillinger … &Encrypt Wallet... - Krypter tegnebog... + Kryptér tegnebog … &Backup Wallet... - Sikkerhedskopier tegnebog... + Sikkerhedskopiér tegnebog … &Change Passphrase... - Skift adgangskode... + Skift adgangskode … &Sending addresses... @@ -349,7 +349,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Modify configuration options for Bitcoin - Rediger konfigurationsindstillinger af Bitcoin + Redigér konfigurationsindstillinger for Bitcoin Backup wallet to another location @@ -369,7 +369,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open &Verify message... - Verificér besked... + Verificér besked … Bitcoin @@ -413,7 +413,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open &Settings - Indstillinger + Opsætning &Help @@ -465,7 +465,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open %n active connection(s) to Bitcoin network - %n aktiv(e) forbindelse(r) til Bitcoin-netværket%n aktiv(e) forbindelse(r) til Bitcoin-netværket + %n aktiv forbindelse til Bitcoin-netværket%n aktive forbindelser til Bitcoin-netværket No block source available... @@ -529,7 +529,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Catching up... - Indhenter... + Indhenter … Sent transaction @@ -806,7 +806,7 @@ Adresse: %4 EditAddressDialog Edit Address - Rediger adresse + Redigér adresse &Label @@ -834,11 +834,11 @@ Adresse: %4 Edit receiving address - Rediger modtagelsesadresse + Redigér modtagelsesadresse Edit sending address - Rediger afsendelsesadresse + Redigér afsendelsesadresse The entered address "%1" is already in the address book. @@ -1017,11 +1017,11 @@ Adresse: %4 Automatically start Bitcoin after logging in to the system. - Start Bitcoin automatisk, når der logges ind på systemet + Start Bitcoin automatisk, når der logges ind på systemet. &Start Bitcoin on system login - Start Bitcoin, når systemet startes + Start Bitcoin ved systemlogin Size of &database cache @@ -1097,11 +1097,11 @@ Adresse: %4 Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - Åbn Bitcoin-klientens port på routeren automatisk. Dette virker kun, når din router understøtter UPnP og UPnP er aktiveret. + Åbn automatisk Bitcoin-klientens port på routeren. Dette virker kun, når din router understøtter UPnP, og UPnP er aktiveret. Map port using &UPnP - Konfigurer port vha. UPnP + Konfigurér port vha. UPnP Proxy &IP: @@ -1113,7 +1113,7 @@ Adresse: %4 Port of the proxy (e.g. 9050) - Porten på proxyen (f.eks. 9050) + Port for proxyen (fx 9050) SOCKS &Version: @@ -1121,7 +1121,7 @@ Adresse: %4 SOCKS version of the proxy (e.g. 5) - SOCKS-version af proxyen (f.eks. 5) + SOCKS-version for proxyen (fx 5) &Window @@ -1416,7 +1416,7 @@ Adresse: %4 Startup time - Opstartstid + Opstartstidspunkt Network @@ -1492,11 +1492,11 @@ Adresse: %4 Welcome to the Bitcoin RPC console. - Velkommen til Bitcoin RPC-konsollen + Velkommen til Bitcoin RPC-konsollen. Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - Brug op og ned-piletasterne til at navigere historikken og <b>Ctrl-L</b> til at rydde skærmen. + Brug op- og ned-piletasterne til at navigere i historikken og <b>Ctrl-L</b> til at rydde skærmen. Type <b>help</b> for an overview of available commands. @@ -1852,11 +1852,11 @@ Adresse: %4 The total exceeds your balance when the %1 transaction fee is included. - Totalen overstiger din saldo, når %1 transaktionsgebyr er inkluderet. + Totalen overstiger din saldo, når transaktionsgebyret på %1 er inkluderet. Duplicate address found, can only send to each address once per send operation. - Duplikeret adresse fundet. Du kan kun sende til hver adresse en gang pr. afsendelse. + Duplikeret adresse fundet. Du kan kun sende til hver adresse én gang pr. afsendelse. Transaction creation failed! @@ -2396,7 +2396,7 @@ Adresse: %4 Amount removed from or added to balance. - Beløb fjernet eller tilføjet balance. + Beløb trukket fra eller tilføjet balance. @@ -2427,7 +2427,7 @@ Adresse: %4 Range... - Interval... + Interval … Received with @@ -2459,15 +2459,15 @@ Adresse: %4 Copy address - Kopier adresse + Kopiér adresse Copy label - Kopier mærkat + Kopiér mærkat Copy amount - Kopier beløb + Kopiér beløb Copy transaction ID @@ -2475,7 +2475,7 @@ Adresse: %4 Edit label - Rediger mærkat + Redigér mærkat Show transaction details @@ -2631,7 +2631,7 @@ Adresse: %4 Connect to a node to retrieve peer addresses, and disconnect - Forbind til en knude for at modtage adresse, og afbryd + Forbind til en knude for at modtage adresser på andre knuder, og afbryd derefter Specify your own public address @@ -2655,7 +2655,7 @@ Adresse: %4 Accept command line and JSON-RPC commands - Accepter kommandolinje- og JSON-RPC-kommandoer + Acceptér kommandolinje- og JSON-RPC-kommandoer Bitcoin Core RPC client version @@ -2663,7 +2663,7 @@ Adresse: %4 Run in the background as a daemon and accept commands - Kør i baggrunden som en service, og accepter kommandoer + Kør i baggrunden som en service, og acceptér kommandoer Use the test network @@ -3291,7 +3291,7 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Loading addresses... - Indlæser adresser... + Indlæser adresser … Error loading wallet.dat: Wallet corrupted @@ -3343,7 +3343,7 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Loading block index... - Indlæser blokindeks... + Indlæser blokindeks … Add a node to connect to and attempt to keep the connection open @@ -3351,7 +3351,7 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Loading wallet... - Indlæser tegnebog... + Indlæser tegnebog … Cannot downgrade wallet @@ -3363,7 +3363,7 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Rescanning... - Genindlæser... + Genindlæser … Done loading diff --git a/src/qt/locale/bitcoin_es.ts b/src/qt/locale/bitcoin_es.ts index 8ca8360ef6..1ed40a77c2 100644 --- a/src/qt/locale/bitcoin_es.ts +++ b/src/qt/locale/bitcoin_es.ts @@ -320,7 +320,7 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard. &Backup Wallet... - %Guardar copia del monedero... + &Guardar copia del monedero... &Change Passphrase... @@ -1052,11 +1052,11 @@ Dirección: %4 Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - + URLs de terceros (por ejemplo, un explorador de bloques) que aparecen en la pestaña de transacciones como items del menú contextual. El %s en la URL es reemplazado por el hash de la transacción. Se pueden separar múltiples URLs por una barra vertical |. Third party transaction URLs - + URLs de transacciones de terceros Active command-line options that override above options: @@ -1977,8 +1977,7 @@ Dirección: %4 ShutdownWindow Bitcoin Core is shutting down... - Bitcoin Core se está cerrando... - + Bitcoin Core se está cerrando... Do not shut down the computer until this window disappears. diff --git a/src/qt/locale/bitcoin_fi.ts b/src/qt/locale/bitcoin_fi.ts index ece70f6075..dc72359590 100644 --- a/src/qt/locale/bitcoin_fi.ts +++ b/src/qt/locale/bitcoin_fi.ts @@ -1053,7 +1053,7 @@ Osoite: %4 Third party transaction URLs - + Kolmannen osapuolen rahansiirto URL:t Active command-line options that override above options: diff --git a/src/qt/locale/bitcoin_ja.ts b/src/qt/locale/bitcoin_ja.ts index 5edfc0746a..d3a6cece87 100644 --- a/src/qt/locale/bitcoin_ja.ts +++ b/src/qt/locale/bitcoin_ja.ts @@ -611,7 +611,7 @@ Address: %4 (un)select all - + すべて選択/選択解除 Tree mode @@ -739,7 +739,7 @@ Address: %4 none - + なし Dust @@ -1189,7 +1189,7 @@ Address: %4 none - + なし Confirm options reset @@ -1425,7 +1425,7 @@ Address: %4 Name - + 名前 Number of connections diff --git a/src/qt/locale/bitcoin_ko_KR.ts b/src/qt/locale/bitcoin_ko_KR.ts index f5d2dddbe4..fb013f4c1d 100644 --- a/src/qt/locale/bitcoin_ko_KR.ts +++ b/src/qt/locale/bitcoin_ko_KR.ts @@ -48,7 +48,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http &New - + 새 항목(N) Copy the currently selected address to the system clipboard @@ -60,7 +60,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http C&lose - + 닫기 (L) &Copy Address @@ -76,7 +76,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http &Export - + &내보내기 &Delete @@ -92,7 +92,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http C&hoose - + 선택하기 (H) Sending addresses @@ -108,7 +108,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - + 비트코인을 받을 수 있는 계좌 주소입니다. 매 거래마다 새로운 주소 사용을 권장합니다. Copy &Label @@ -401,11 +401,11 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http Sign messages with your Bitcoin addresses to prove you own them - + 지갑 주소가 자신 소유의 것인지 증명하기 위해 비트코인 주소에 서명할 수 있습니다. Verify messages to ensure they were signed with specified Bitcoin addresses - + 비트코인 주소의 전자 서명 확인을 위해 첨부된 메시지가 있을 경우 이를 검증할 수 있습니다. &File @@ -441,11 +441,11 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http Show the list of used sending addresses and labels - + 한번 이상 사용된 보내는 주소와 주소 제목의 목록을 보여줍니다. Show the list of used receiving addresses and labels - + 한번 이상 사용된 받는 주소와 주소 제목의 목록을 보여줍니다. Open a bitcoin: URI or payment request @@ -814,7 +814,7 @@ Address: %4 The label associated with this address list entry - + 현재 선택된 주소 필드의 제목입니다. The address associated with this address list entry. This can only be modified for sending addresses. @@ -869,7 +869,7 @@ Address: %4 Directory already exists. Add %1 if you intend to create a new directory here. - + 폴더가 이미 존재합니다. 새로운 폴더 생성을 원한다면 %1 명령어를 추가하세요. Path already exists, and is not a directory. @@ -1275,7 +1275,7 @@ Address: %4 URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - + URI의 파싱에 문제가 발생했습니다. 잘못된 비트코인 주소나 URI 파라미터 구성에 오류가 존재할 수 있습니다. Requested payment amount of %1 is too small (considered dust). @@ -1358,7 +1358,7 @@ Address: %4 Bitcoin Core didn't yet exit safely... - + 비트코인 코어가 아직 안전하게 종료되지 않았습니다. Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) @@ -1563,7 +1563,7 @@ Address: %4 Use this form to request payments. All fields are <b>optional</b>. - + 지급을 요청하기 위해 아래 형식을 사용하세요. 입력값은 <b>선택 사항</b> 입니다. An optional amount to request. Leave this empty or zero to not request a specific amount. @@ -1907,7 +1907,7 @@ Address: %4 The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - + 비트코인을 송금할 지갑 주소 입력하기 (예 : 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) Enter a label for this address to add it to your address book @@ -2049,7 +2049,7 @@ Address: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - + 메시지를 검증하기 위해 아래 칸에 각각 지갑 주소와 메시지, 전자서명을 입력하세요. (메시지 원본의 띄어쓰기, 들여쓰기, 행 나눔 등이 정확하게 입력되어야 하므로 원본을 복사해서 입력하세요) 이 기능은 메시지 검증이 주 목적이며, 네트워크 침입자에 의해 변조되지 않도록 전자서명 해독에 불필요한 시간을 소모하지 마세요. The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) @@ -2174,7 +2174,7 @@ Address: %4 , broadcast through %n node(s) - + %n 노드를 거쳐 전파합니다. Date @@ -2278,7 +2278,7 @@ Address: %4 Open for %n more block(s) - + %n 개의 추가 블럭을 읽습니다. unknown @@ -2320,7 +2320,7 @@ Address: %4 Open for %n more block(s) - + %n 개의 추가 블럭을 읽습니다. Open until %1 @@ -2560,7 +2560,7 @@ Address: %4 WalletView &Export - + &내보내기 Export the data in the current tab to a file @@ -2721,7 +2721,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - + 오류 : 해당 거래는 송금액, 다중 거래, 최근 수령한 금액의 사용 등의 이유로 최소 %s 이상의 송금 수수료가 필요합니다. Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) @@ -2753,7 +2753,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - + 이 빌드 버전은 정식 출시 전 테스트의 목적이며, 예기치 않은 위험과 오류가 발생할 수 있습니다. 채굴과 상점용 소프트웨어로 사용하는 것을 권하지 않습니다. Unable to bind to %s on this computer. Bitcoin Core is probably already running. @@ -2773,7 +2773,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - + 경고 : 모든 네트워크가 동의해야 하나, 일부 채굴자들에게 문제가 있는 것으로 보입니다. Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. @@ -2781,11 +2781,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - + 경고 : wallet.dat 파일을 읽는 중 에러가 발생했습니다. 주소 키는 모두 정확하게 로딩되었으나 거래 데이터와 주소록 필드에서 누락이나 오류가 존재할 수 있습니다. Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - + 경고 : wallet.dat가 손상되어 데이터가 복구되었습니다. 원래의 wallet.dat 파일은 %s 후에 wallet.{timestamp}.bak 이름으로 저장됩니다. 잔액과 거래 내역이 정확하지 않다면 백업 파일로 부터 복원해야 합니다. (default: 1) @@ -2957,7 +2957,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Importing... - + 들여오기 중... Incorrect or no genesis block found. Wrong datadir for network? @@ -2969,7 +2969,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Not enough file descriptors available. - + 사용 가능한 파일 디스크립터-File Descriptor-가 부족합니다. Prepend debug output with timestamp (default: 1) @@ -2981,7 +2981,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Rebuild block chain index from current blk000??.dat files - + 현재의 blk000??.dat 파일들로부터 블록체인 색인을 재구성합니다. Select SOCKS version for -proxy (4 or 5, default: 5) @@ -2997,7 +2997,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Set the number of threads to service RPC calls (default: 4) - + 원격 프로시져 호출 서비스를 위한 쓰레드 개수를 설정합니다 (기본값 : 4) Specify wallet file (within data directory) @@ -3041,11 +3041,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. You need to rebuild the database using -reindex to change -txindex - + -txindex를 바꾸기 위해서는 -reindex를 사용해서 데이터베이스를 재구성해야 합니다. Imports blocks from external blk000??.dat file - 외부 blk000??.dat 파일에서 블록 가져오기 + 외부 blk000??.dat 파일에서 블록을 가져옵니다. Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. @@ -3069,11 +3069,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Invalid amount for -minrelaytxfee=<amount>: '%s' - + 노드로 전달하기 위한 최저 거래 수수료가 부족합니다. - minrelaytxfee=<amount>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - + 최저 거래 수수료가 부족합니다. -mintxfee=<amount>: '%s' Limit size of signature cache to <n> entries (default: 50000) @@ -3173,7 +3173,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Start Bitcoin Core Daemon - + 비트코인 코어의 데몬 프로그램을 실행합니다. System error: diff --git a/src/qt/locale/bitcoin_lt.ts b/src/qt/locale/bitcoin_lt.ts index a9898adb2b..c74fd8ab3b 100644 --- a/src/qt/locale/bitcoin_lt.ts +++ b/src/qt/locale/bitcoin_lt.ts @@ -1490,7 +1490,7 @@ Adresas: %4 Welcome to the Bitcoin RPC console. - + Sveiki atvykę į Bitcoin RPC konsolę. Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. @@ -2633,7 +2633,7 @@ Adresas: %4 Specify your own public address - + Nurodykite savo nuosavą viešą adresą Threshold for disconnecting misbehaving peers (default: 100) @@ -3347,7 +3347,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Cannot write default address - + Negalima parašyti įprasto adreso Rescanning... diff --git a/src/qt/locale/bitcoin_lv_LV.ts b/src/qt/locale/bitcoin_lv_LV.ts index c17f65e125..299e4d55e0 100644 --- a/src/qt/locale/bitcoin_lv_LV.ts +++ b/src/qt/locale/bitcoin_lv_LV.ts @@ -16,7 +16,12 @@ This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - + +Šī ir eksperimentālā programmatūra. + +Izplatīta saskaņā ar MIT/X11 programmatūras licenci, skatīt pievienoto datni COPYING vai http://www.opensource.org/licenses/mit-license.php. + +Šis produkts ietver programmatūru, ko izstrādājis OpenSSL Project izmantošanai OpenSSL Toolkit (http://www.openssl.org/) un šifrēšanas programmatūru no Eric Young (eay@cryptsoft.com) un UPnP programmatūru no Thomas Bernard. Copyright @@ -28,7 +33,7 @@ This product includes software developed by the OpenSSL Project for use in the O (%1-bit) - + (%1-biti) @@ -63,7 +68,7 @@ This product includes software developed by the OpenSSL Project for use in the O Delete the currently selected address from the list - + Izdzēst iezīmētās adreses no saraksta Export the data in the current tab to a file @@ -79,11 +84,11 @@ This product includes software developed by the OpenSSL Project for use in the O Choose the address to send coins to - + Izvēlies adresi uz kuru sūtīt bitcoins Choose the address to receive coins with - + Izvēlies adresi ar kuru saņemt bitcoins C&hoose @@ -201,11 +206,11 @@ This product includes software developed by the OpenSSL Project for use in the O Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - + Brīdinājums: Ja tu nošifrē savu maciņu un pazaudē paroli, tu <b>PAZAUDĒSI VISAS SAVAS BITCOINS</b>! Are you sure you wish to encrypt your wallet? - + Vai tu tiešām vēlies šifrēt savu maciņu? 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. @@ -249,7 +254,7 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet passphrase was successfully changed. - + Maciņa parole tika veiksmīgi nomainīta. @@ -268,7 +273,7 @@ This product includes software developed by the OpenSSL Project for use in the O Node - + Node Show general overview of wallet @@ -304,31 +309,31 @@ This product includes software developed by the OpenSSL Project for use in the O &Options... - &Iespējas + &Iespējas... &Encrypt Wallet... - Š&ifrēt maciņu... + Šifrēt &maciņu... &Backup Wallet... - &Izveidot maciņa rezerves kopiju + &Maciņa Rezerves Kopija... &Change Passphrase... - &Mainīt paroli + Mainīt &Paroli... &Sending addresses... - &Adrešu sūtīšana... + &Sūtīšanas adreses... &Receiving addresses... - Adrešu &saņemšana... + Saņemšanas &adreses... Open &URI... - Atvērt &URI + Atvērt &URI... Importing blocks from disk... @@ -356,7 +361,7 @@ This product includes software developed by the OpenSSL Project for use in the O &Debug window - &Debug logs + &Atkļūdošanas logs Open debugging and diagnostic console @@ -388,7 +393,7 @@ This product includes software developed by the OpenSSL Project for use in the O Show or hide the main Window - + Parādīt vai paslēpt galveno Logu Encrypt the private keys that belong to your wallet @@ -428,7 +433,7 @@ This product includes software developed by the OpenSSL Project for use in the O Request payments (generates QR codes and bitcoin: URIs) - + Pieprasīt maksājumus (izveido QR kodu un bitcoin: URIs) &About Bitcoin Core @@ -496,7 +501,7 @@ This product includes software developed by the OpenSSL Project for use in the O %1 behind - + %1 aizmugurē Last received block was generated %1 ago. @@ -556,7 +561,7 @@ Adrese: %4 A fatal error occurred. Bitcoin can no longer continue safely and will quit. - + Radās fatāla kļūda. Bitcoin Core nevar vairs droši turpināt un tiks izslēgta. @@ -594,7 +599,7 @@ Adrese: %4 Low Output: - + Zema Izeja: After Fee: @@ -606,7 +611,7 @@ Adrese: %4 (un)select all - + iezīmēt visus Tree mode @@ -658,11 +663,11 @@ Adrese: %4 Lock unspent - + Aizslēgt neiztērēto Unlock unspent - + Atslēgt neiztērēto Copy quantity @@ -686,7 +691,7 @@ Adrese: %4 Copy low output - + Kopēt zemo izeju Copy change @@ -730,7 +735,7 @@ Adrese: %4 (%1 locked) - + (%1 aizslēgts) none @@ -738,7 +743,7 @@ Adrese: %4 Dust - + Putekļi yes @@ -856,7 +861,7 @@ Adrese: %4 FreespaceChecker A new data directory will be created. - + Tiks izveidota jauna datu mape. name @@ -868,11 +873,11 @@ Adrese: %4 Path already exists, and is not a directory. - + Šāds ceļš jau pastāv un tā nav mape. Cannot create data directory here. - + Šeit nevar izveidot datu mapi. @@ -942,11 +947,11 @@ Adrese: %4 Use the default data directory - + Izmantot noklusēto datu mapi Use a custom data directory: - + Izmantot pielāgotu datu mapi: Bitcoin @@ -1020,7 +1025,7 @@ Adrese: %4 Size of &database cache - + &Datubāzes kešatmiņas izmērs MB @@ -1028,19 +1033,19 @@ Adrese: %4 Number of script &verification threads - + Skriptu &pārbaudes pavedienu skaits Connect to the Bitcoin network through a SOCKS proxy. - + Savienoties ar Bitcoin tīklu caur SOCKS starpniekserveri. &Connect through SOCKS proxy (default proxy): - + &Savienoties caur SOCKS starpniekserveri (noklusējuma starpniekserveris) IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - + Starpniekservera IP adrese (piem. IPv4: 127.0.0.1 / IPv6: ::1) Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. @@ -1048,19 +1053,19 @@ Adrese: %4 Third party transaction URLs - + Trešo personu transakciju URLs Active command-line options that override above options: - + Aktīvās komandrindas opcijas, kuras pārspēko šos iestatījumus: Reset all client options to default. - + Atiestatīt visus klienta iestatījumus uz noklusējumu. &Reset Options - + &Atiestatīt Iestatījumus. &Network @@ -1100,7 +1105,7 @@ Adrese: %4 Proxy &IP: - Proxy &IP: + Starpniekservera &IP: &Port: @@ -1108,7 +1113,7 @@ Adrese: %4 Port of the proxy (e.g. 9050) - Proxy ports (piem. 9050) + Starpniekservera ports (piem. 9050) SOCKS &Version: @@ -1116,7 +1121,7 @@ Adrese: %4 SOCKS version of the proxy (e.g. 5) - proxy SOCKS versija (piem. 5) + Starpniekservera SOCKS versija (piem. 5) &Window @@ -1172,7 +1177,7 @@ Adrese: %4 &OK - &OK + &Labi &Cancel @@ -1184,11 +1189,11 @@ Adrese: %4 none - neviens + neviena Confirm options reset - + Apstiprināt iestatījumu atiestatīšanu Client restart required to activate changes. @@ -1196,7 +1201,7 @@ Adrese: %4 Client will be shutdown, do you want to proceed? - + Klients tiks izslēgts, vai vēlaties turpināt? This change would require a client restart. @@ -1204,7 +1209,7 @@ Adrese: %4 The supplied proxy address is invalid. - Norādītā proxy adrese nav derīga. + Norādītā starpniekservera adrese nav derīga. @@ -1231,11 +1236,11 @@ Adrese: %4 Pending: - + Neizšķirts: Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - + Kopējā apstiprināmo transakciju vērtība, vēl nav ieskaitīta tērējamajā bilancē Immature: @@ -1247,7 +1252,7 @@ Adrese: %4 Total: - Kopā: + Kopsumma: Your current total balance @@ -1266,7 +1271,7 @@ Adrese: %4 PaymentServer URI handling - + URI apstrāde URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. @@ -1278,11 +1283,11 @@ Adrese: %4 Payment request error - + Maksājumu pieprasījuma kļūda Cannot start bitcoin: click-to-pay handler - + Nevar palaist Bitcoin: nospied-lai-maksātu apstrādātāju Net manager warning @@ -1310,7 +1315,7 @@ Adrese: %4 Refund from %1 - + Atmaksa no %1 Error communicating with %1: %2 @@ -1326,11 +1331,11 @@ Adrese: %4 Payment acknowledged - + Maksājums atzīts Network request error - + Tīkla pieprasījuma kļūda @@ -1353,7 +1358,7 @@ Adrese: %4 Bitcoin Core didn't yet exit safely... - + Bitcoin Core vel neizgāja droši... Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) @@ -1399,11 +1404,11 @@ Adrese: %4 Debug window - + Atkļūdošanas logs General - + Vispārējs Using OpenSSL version @@ -1463,11 +1468,11 @@ Adrese: %4 In: - + Ie.: Out: - + Iz.: Build date @@ -1475,7 +1480,7 @@ Adrese: %4 Debug log file - + Atkļūdošanas žurnāla datne Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. @@ -1546,7 +1551,7 @@ Adrese: %4 R&euse an existing receiving address (not recommended) - + &Atkārtoti izmantot esošo saņemšanas adresi (nav ieteicams) An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. @@ -1582,7 +1587,7 @@ Adrese: %4 Show the selected request (does the same as double clicking an entry) - + Parādīt atlasītos pieprasījumus (tas pats, kas dubultklikšķis uz ieraksta) Show @@ -1590,7 +1595,7 @@ Adrese: %4 Remove the selected entries from the list - + Noņemt atlasītos ierakstus no saraksta. Remove @@ -1625,7 +1630,7 @@ Adrese: %4 &Save Image... - &Saglabāt Attēlu + &Saglabāt Attēlu... Request payment to %1 @@ -1707,15 +1712,15 @@ Adrese: %4 Inputs... - + Ieejas... automatically selected - + automātiski atlasīts Insufficient funds! - + Nepietiekami līdzekļi! Quantity: @@ -1739,7 +1744,7 @@ Adrese: %4 Low Output: - + Zema Izeja: After Fee: @@ -1819,7 +1824,7 @@ Adrese: %4 Copy low output - + Kopēt zemās izejas Copy change @@ -1835,7 +1840,7 @@ Adrese: %4 The recipient address is not valid, please recheck. - + Saņēmēja adrese ir nepareiza, lūdzu pārbaudi. The amount to pay must be larger than 0. @@ -1863,7 +1868,7 @@ Adrese: %4 Warning: Invalid Bitcoin address - + Brīdinājums: Nederīga Bitcoin adrese (no label) @@ -1871,7 +1876,7 @@ Adrese: %4 Warning: Unknown change address - + Brīdinājums: Nezināma atlikuma adrese Are you sure you want to send? @@ -1887,7 +1892,7 @@ Adrese: %4 Invalid payment address %1 - + Nederīga maksājuma adrese %1 @@ -1914,7 +1919,7 @@ Adrese: %4 Choose previously used address - + Izvēlies iepriekš izmantoto adresi This is a normal payment. @@ -1962,7 +1967,7 @@ Adrese: %4 Memo: - + Memo: @@ -1973,7 +1978,7 @@ Adrese: %4 Do not shut down the computer until this window disappears. - + Neizslēdziet datoru kamēr šis logs nepazūd. @@ -1992,11 +1997,11 @@ Adrese: %4 The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - + Adrese ar kuru parakstīt ziņojumu (piem. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) Choose previously used address - + Izvēlies iepriekš izmantoto adresi Alt+A @@ -2012,7 +2017,7 @@ Adrese: %4 Enter the message you want to sign here - + Šeit ievadi ziņojumu kuru vēlies parakstīt Signature @@ -2020,11 +2025,11 @@ Adrese: %4 Copy the current signature to the system clipboard - + Kopēt parakstu uz sistēmas starpliktuvi Sign the message to prove you own this Bitcoin address - + Parakstīt ziņojumu lai pierādītu, ka esi šīs Bitcoin adreses īpašnieks. Sign &Message @@ -2032,7 +2037,7 @@ Adrese: %4 Reset all sign message fields - + Atiestatīt visus laukus Clear &All @@ -2048,7 +2053,7 @@ Adrese: %4 The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - + Adrese ar kādu ziņojums tika parakstīts (piem. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) Verify the message to ensure it was signed with the specified Bitcoin address @@ -2060,7 +2065,7 @@ Adrese: %4 Reset all verify message fields - + Atiestatīt visus laukus Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) @@ -2072,23 +2077,23 @@ Adrese: %4 The entered address is invalid. - + Ievadītā adrese ir nederīga. Please check the address and try again. - + Lūdzu pārbaudi adresi un mēģini vēlreiz. The entered address does not refer to a key. - + Ievadītā adrese neattiecas uz atslēgu. Wallet unlock was cancelled. - + Maciņa atslēgšana tika atcelta. Private key for the entered address is not available. - + Privātā atslēga priekš ievadītās adreses nav pieejama. Message signing failed. @@ -2104,11 +2109,11 @@ Adrese: %4 Please check the signature and try again. - + Lūdzu pārbaudi parakstu un mēģini vēlreiz. The signature did not match the message digest. - + Paraksts neatbilda ziņojuma apkopojumam. Message verification failed. @@ -2149,7 +2154,7 @@ Adrese: %4 conflicted - + pretrunā %1/offline @@ -2181,7 +2186,7 @@ Adrese: %4 Generated - + Ģenerēts From @@ -2193,15 +2198,15 @@ Adrese: %4 own address - + paša adrese label - + etiķete Credit - + Kredīts matures in %n more block(s) @@ -2209,11 +2214,11 @@ Adrese: %4 not accepted - + nav pieņemts Debit - + Debets Transaction fee @@ -2237,7 +2242,7 @@ Adrese: %4 Merchant - + Tirgotājs Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. @@ -2245,7 +2250,7 @@ Adrese: %4 Debug information - + Atkļūdošanas informācija Transaction @@ -2253,7 +2258,7 @@ Adrese: %4 Inputs - + Ieejas Amount @@ -2273,7 +2278,7 @@ Adrese: %4 Open for %n more block(s) - + Atvērts vel %n blokusAtvērts vel %n blokuAtvērts vel %n blokus unknown @@ -2315,7 +2320,7 @@ Adrese: %4 Open for %n more block(s) - + Atvērts vel %n blokusAtvērts vel %n blokuAtvērts vel %n blokus Open until %1 @@ -2347,7 +2352,7 @@ Adrese: %4 Conflicted - + Pretrunā Received with @@ -2494,7 +2499,7 @@ Adrese: %4 The transaction history was successfully saved to %1. - + Transakciju vēsture tika veiksmīgi saglabāta uz %1. Comma separated file (*.csv) @@ -2555,7 +2560,7 @@ Adrese: %4 WalletView &Export - &Eksportēt... + &Eksportēt Export the data in the current tab to a file @@ -2654,7 +2659,7 @@ Adrese: %4 Bitcoin Core RPC client version - + Bitcoin Core RPC klienta versija Run in the background as a daemon and accept commands @@ -2764,7 +2769,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - + Brīdinājums: Lūdzu pārbaudi vai tava datora datums un laiks ir pareizs! Ja pulkstenis ir nepareizs, Bitcoin Core nestrādās pareizi. Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. @@ -2784,11 +2789,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. (default: 1) - + (noklusējums: 1) (default: wallet.dat) - + (noklusējums: wallet.dat) <category> can be: @@ -2796,7 +2801,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Attempt to recover private keys from a corrupt wallet.dat - + Mēģināt atgūt privātās atslēgas no bojāta wallet.dat Bitcoin Core Daemon @@ -2812,11 +2817,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Connect only to the specified node(s) - + Savienoties tikai ar norādītajām nodēm. Connect through SOCKS proxy - + Savienoties caur SOCKS starpniekserveri Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) @@ -2824,7 +2829,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Connection options: - + Savienojuma iestatījumi: Corrupted block database detected @@ -2832,7 +2837,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Debugging/Testing options: - + Atkļūdošanas/Testēšanas iestatījumi: Disable safemode, override a real safe mode event (default: 0) @@ -2860,7 +2865,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading block database - + Kļūda ielādējot bloku datubāzi Error opening block database @@ -2868,15 +2873,15 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error: Disk space is low! - + Kļūda: Zema diska vieta! Error: Wallet locked, unable to create transaction! - + Kļūda: Maciņš ir aizslēgts, nevar izveidot transakciju! Error: system error: - + Kļūda: sistēmas kļūda: Failed to listen on any port. Use -listen=0 if you want this. @@ -2932,11 +2937,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Find peers using DNS lookup (default: 1 unless -connect) - + Atrast pīrus izmantojot DNS uzmeklēšanu (noklusējums: 1 ja nav -connect) Force safe mode (default: 0) - + Piespiest drošo režīmu (noklusējums: 0) Generate coins (default: 0) @@ -2952,7 +2957,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Importing... - + Importē... Incorrect or no genesis block found. Wrong datadir for network? @@ -3000,7 +3005,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Spend unconfirmed change when sending transactions (default: 1) - + Tērēt neapstiprinātu atlikumu kad sūta transakcijas (noklusējums: 1) This is intended for regression testing tools and app development. @@ -3020,7 +3025,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Wait for RPC server to start - + Uzgaidi līdz RPC serveris palaižas Wallet %s resides outside data directory %s @@ -3040,7 +3045,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Imports blocks from external blk000??.dat file - + Importēt blokus no ārējās blk000??.dat datnes Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. @@ -3112,7 +3117,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. RPC server options: - + RPC servera iestatījumi: Randomly drop 1 of every <n> network messages @@ -3132,7 +3137,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Send command to Bitcoin Core - + Sūtīt komandu uz Bitcoin Core Send trace/debug info to console instead of debug.log file @@ -3152,7 +3157,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Show benchmark information (default: 0) - + Rādīt etalonuzdevuma informāciju (noklusējums: 0) Shrink debug.log file on client startup (default: 1 when no -debug) @@ -3160,7 +3165,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Signing transaction failed - + Transakcijas parakstīšana neizdevās Specify connection timeout in milliseconds (default: 5000) @@ -3168,19 +3173,19 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Start Bitcoin Core Daemon - + Sākt Bitcoin Core Procesu System error: - + Sistēmas kļūda: Transaction amount too small - + Transakcijas summa ir pārāk maza Transaction amounts must be positive - + Transakcijas summai ir jābūt pozitīvai Transaction too large @@ -3204,7 +3209,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: This version is obsolete, upgrade required! - + Brīdinājums: Šī versija ir novecojusi, nepieciešams atjauninājums! Zapping all transactions from wallet... @@ -3212,7 +3217,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. on startup - + startēšanas laikā version @@ -3220,7 +3225,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. wallet.dat corrupt, salvage failed - + wallet.dat ir bojāts, glābšana neizdevās Password for JSON-RPC connections @@ -3304,7 +3309,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Unknown -socks proxy version requested: %i - Pieprasīta nezināma -socks proxy versija: %i + Pieprasīta nezināma -socks starpniekservera versija: %i Cannot resolve -bind address: '%s' diff --git a/src/qt/locale/bitcoin_nb.ts b/src/qt/locale/bitcoin_nb.ts index 09ef29d871..1267ad65b9 100644 --- a/src/qt/locale/bitcoin_nb.ts +++ b/src/qt/locale/bitcoin_nb.ts @@ -1049,11 +1049,11 @@ Adresse: %4 Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - + Tredjepart URLer (f. eks. en blokkutforsker) som dukker opp i transaksjonsfanen som kontekst meny elementer. %s i URLen er erstattet med transaksjonen sin hash. Flere URLer er separert av en vertikal linje |. Third party transaction URLs - + Tredjepart transaksjon URLer Active command-line options that override above options: @@ -1358,7 +1358,7 @@ Adresse: %4 Bitcoin Core didn't yet exit safely... - + Bitcoin Core har ennå ikke avsluttet på en sikker måte... Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) diff --git a/src/qt/locale/bitcoin_pl.ts b/src/qt/locale/bitcoin_pl.ts index cbc08dd25d..6bc177076b 100644 --- a/src/qt/locale/bitcoin_pl.ts +++ b/src/qt/locale/bitcoin_pl.ts @@ -739,7 +739,7 @@ Adres: %4 none - + żaden Dust @@ -1189,7 +1189,7 @@ Adres: %4 none - + żaden Confirm options reset @@ -2340,7 +2340,7 @@ Adres: %4 Offline - + Offline Unconfirmed @@ -3182,7 +3182,7 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Start Bitcoin Core Daemon - + Uruchom serwer Bitcoin Core System error: diff --git a/src/qt/locale/bitcoin_sk.ts b/src/qt/locale/bitcoin_sk.ts index d96e9d9366..bce535fad7 100644 --- a/src/qt/locale/bitcoin_sk.ts +++ b/src/qt/locale/bitcoin_sk.ts @@ -16,7 +16,12 @@ This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - + +Toto je experimentálny softvér. + +Distribuovaný pod MIT/X11 softvérovou licenciou, viď sprevádzajúci súbor COPYING alebo http://www.opensource.org/licenses/mit-license.php. + +Tento výrobok obsahuje sofvér, ktorý vyvynul OpenSSL Project pre použitie v OpenSSL Toolkit (http://www.openssl.org/) a kryptografický softvér napísaný Ericom Youngom (eay@cryptsoft.com) a UPnP softvér napísaný Thomasom Bernardom. Copyright @@ -28,7 +33,7 @@ This product includes software developed by the OpenSSL Project for use in the O (%1-bit) - + (%1-bit) @@ -209,7 +214,7 @@ This product includes software developed by the OpenSSL Project for use in the O 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. - + DÔLEŽITÉ: Všetky doterajšie záložné kópie peňaženky ktoré ste zhotovili by mali byť nahradené novým zašifrovaným súborom s peňaženkou. Z bezpečnostných dôvodov sa predchádzajúce kópie nezašifrovanej peňaženky stanú neužitočné keď začnete používať novú zašifrovanú peňaženku. Warning: The Caps Lock key is on! @@ -320,11 +325,11 @@ This product includes software developed by the OpenSSL Project for use in the O &Sending addresses... - + Posielajúca adresa ... &Receiving addresses... - + Prijímajúca adresa... Open &URI... @@ -444,7 +449,7 @@ This product includes software developed by the OpenSSL Project for use in the O Open a bitcoin: URI or payment request - + Otvoriť bitcoin URI alebo výzvu k platbe &Command-line options @@ -452,7 +457,7 @@ This product includes software developed by the OpenSSL Project for use in the O Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - + Zobraziť pomocnú správu od Bitcoin Jadra pre získanie zoznamu dostupných možností príkazového riadku Bitcoin client @@ -673,7 +678,7 @@ Adresa: %4 Copy after fee - + Kopírovať za poplatok Copy bytes @@ -685,7 +690,7 @@ Adresa: %4 Copy low output - + Kopírovať malý výstup. Copy change @@ -749,31 +754,31 @@ Adresa: %4 This label turns red, if the transaction size is greater than 1000 bytes. - + Tento popis zčervená ak veľkosť transakcie presiahne 1000 bytov. This means a fee of at least %1 per kB is required. - + To znamená že požadovaný poplatok je aspoň %1 za kB. Can vary +/- 1 byte per input. - + Môže sa pohybovať +/- 1 bajt pre vstup. Transactions with higher priority are more likely to get included into a block. - + Transakcie s vysokou prioritou sa pravdepodobnejsie dostanú do bloku. This label turns red, if the priority is smaller than "medium". - + Tento popis zčervenie ak je priorita nižčia ako "medium". This label turns red, if any recipient receives an amount smaller than %1. - + Tento popis zčervenie ak ktorýkoľvek príjemca dostane sumu menšiu ako %1. This means a fee of at least %1 is required. - + To znamená že je požadovaný poplatok aspoň %1. Amounts below 0.546 times the minimum relay fee are shown as dust. @@ -781,7 +786,7 @@ Adresa: %4 This label turns red, if the change is smaller than %1. - + Tento popis zžervenie ak výdavok je menší než %1. (no label) @@ -910,7 +915,7 @@ Adresa: %4 Set SSL root certificates for payment request (default: -system-) - + Nastaviť koreňový certifikát pre výzvy na platbu (prednastavené: -system-) Show splash screen on startup (default: 1) @@ -918,7 +923,7 @@ Adresa: %4 Choose data directory on startup (default: 0) - + Zvoľte dátový priečinok pri štarte (prednastavené: 0) @@ -933,7 +938,7 @@ Adresa: %4 As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - + Keďže spúštate program prvý krát, môžte si vybrať kde bude Bitcoin Jadro ukladať svoje dáta. Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. @@ -1027,7 +1032,7 @@ Adresa: %4 Number of script &verification threads - + Počet skript overujucich vlákien Connect to the Bitcoin network through a SOCKS proxy. @@ -1051,7 +1056,7 @@ Adresa: %4 Active command-line options that override above options: - + Aktévne možnosti príkazového riadku ktoré prepíšu možnosti vyššie: Reset all client options to default. @@ -1067,7 +1072,7 @@ Adresa: %4 (0 = auto, <0 = leave that many cores free) - + (0 = auto, <0 = nechať toľko jadier voľných) W&allet @@ -1083,11 +1088,11 @@ Adresa: %4 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. - + Ak vypnete míňanie nepotvrdeného výdavku tak výdavok z transakcie bude možné použiť až keď daná transakcia bude mať aspoň jedno potvrdenie. Toto má vplyv aj na výpočet vášho zostatku. &Spend unconfirmed change - + Minúť nepotvrdený výdavok Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. @@ -1281,7 +1286,7 @@ Adresa: %4 Cannot start bitcoin: click-to-pay handler - + Nedá sa spustiť obslužný program bitcoin: click-to-pay zaplatiť kliknutím Net manager warning @@ -1289,19 +1294,19 @@ Adresa: %4 Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - + Vaše aktívne proxy nepodporuje SOCKS5, ktoré je potrebné pre vyzvu na zaplatenie cez proxy. Payment request fetch URL is invalid: %1 - + URL pre stiahnutie výzvy na zaplatenie je neplatné: %1 Payment request file handling - + Obsluha súboru s požiadavkou na platbu Payment request file can not be read or processed! This can be caused by an invalid payment request file. - + Súbor s výzvou na zaplatenie sa nedá čítať alebo spracovať! To môže byť spôsobené aj neplatným súborom s výzvou. Unverified payment requests to custom payment scripts are unsupported. @@ -1317,7 +1322,7 @@ Adresa: %4 Payment request can not be parsed or processed! - + Požiadavka na platbu nemôže byť analyzovaná alebo spracovaná! Bad response from server %1 @@ -1344,7 +1349,7 @@ Adresa: %4 Error: Cannot parse configuration file: %1. Only use key=value syntax. - + Chyba: Nedá sa rozlúštit súbor s nastaveniami: %1. Používajte výlučne kľúč=hodnota syntax. Error: Invalid combination of -regtest and -testnet. @@ -1478,7 +1483,7 @@ Adresa: %4 Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - + Otvoriť Bitcoin log súbor pre ladenie z aktuálneho dátového adresára. Toto môže trvať niekoľko sekúnd pre veľké súbory. Clear console @@ -1541,15 +1546,15 @@ Adresa: %4 Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - + Znovu použiť jednu z už použitých adries pre prijímanie. Znovu používanie adries je sporná otázka bezpečnosti aj súkromia. Používajte to len v prípade ak znovu generujete výzvu na zaplatenie ktorú ste už vyrobili v minulosti. R&euse an existing receiving address (not recommended) - + Znovu použiť jestvujúcu prijímaciu adresu (neodporúča sa) An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - + Pridať voliteľnú správu k výzve na zaplatenie, ktorá sa zobrazí keď bude výzva otvorená. Poznámka: Správa nebude poslaná s platbou cez sieť Bitcoin. An optional label to associate with the new receiving address. @@ -1561,7 +1566,7 @@ Adresa: %4 An optional amount to request. Leave this empty or zero to not request a specific amount. - + Voliteľná požadovaná suma. Nechajte prázdne alebo nulu ak nepožadujete určitú sumu. Clear all fields of the form. @@ -1750,7 +1755,7 @@ Adresa: %4 If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - + Ak aktivované ale adresa pre výdavok je prázdna alebo neplatná, výdavok bude poslaný na novovytvorenú adresu. Custom change address @@ -1806,7 +1811,7 @@ Adresa: %4 Copy after fee - + Kopírovať za poplatok Copy bytes @@ -1818,7 +1823,7 @@ Adresa: %4 Copy low output - + Kopírovať nízky výstup Copy change @@ -1858,7 +1863,7 @@ Adresa: %4 The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - + Transakcia bola zamietnutá! Toto sa môže stať ak niektoré coins vo vašej peňaženke už boli minuté, ako keď použijete kópiu wallet.dat a coins boli minuté z kópie ale neoznačené ako minuté tu. Warning: Invalid Bitcoin address @@ -1945,11 +1950,11 @@ Adresa: %4 Enter a label for this address to add it to the list of used addresses - + Vložte popis pre túto adresu aby sa uložila do zoznamu použitých adries A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - + Správa ktorá bola pripojená k bitcoin: URI a ktorá bude uložená s transakcou pre Vaše potreby. Poznámka: Táto správa nebude poslaná cez sieť Bitcoin. This is an unverified payment request. @@ -2240,7 +2245,7 @@ Adresa: %4 Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - + Vytvorené coins musia dospieť %1 blokov kým môžu byť minuté. Keď vytvoríte tento blok, bude rozoslaný do siete aby bol akceptovaný do reťaze blokov. Ak sa nedostane reťaze, jeho stav sa zmení na "zamietnutý" a nebude sa dať minúť. Toto sa môže občas stať ak iná nóda vytvorí blok približne v tom istom čase. Debug information @@ -2272,7 +2277,7 @@ Adresa: %4 Open for %n more block(s) - + Otvoriť pre %n viac blokOtvoriť pre %n viac blokov Otvoriť pre %n viac blokov unknown @@ -2314,7 +2319,7 @@ Adresa: %4 Open for %n more block(s) - + Otvorené pre ešte %1 blokOtvorené pre %n viac blokov Otvorené pre %n blokov Open until %1 @@ -2485,7 +2490,7 @@ Adresa: %4 There was an error trying to save the transaction history to %1. - + Vyskytla sa chyba pri pokuse o uloženie histórie transakcií do %1. Exporting Successful @@ -2679,11 +2684,21 @@ If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - + %s, musíte nastaviť rpcpassword heslo v súbore nastavení: +%s +Odporúča sa používať nasledujúce náhodné heslo: +rpcuser=bitcoinrpc +rpcpassword=%s +(nemusíte si pamätať toto heslo) +Užívateľské meno a heslo NESMÚ byť rovnaké. +Ak súbor neexistuje, vytvorte ho s prístupovým právom owner-readable-only čitateľné len pre majiteľa. +Tiež sa odporúča nastaviť alertnotify aby ste boli upozorňovaní na problémy; +napríklad: alertnotify=echo %%s | mail -s "Bitcoin Výstraha" admin@foo.com + Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - + Prijateľlné šifry (prednastavené: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s @@ -2695,7 +2710,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - + Priebežne obmedzuj transakcie bez poplatku na <n>*1000 bajtov za minútu (prednastavené: 15) Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. @@ -2703,19 +2718,19 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - + Vojsť do režimu regresného testovania, ktorý používa špeciálnu reťaz v ktorej môžu byť bloky v okamihu vyriešené. Error: Listening for incoming connections failed (listen returned error %d) - + Chyba: Zlyhalo počúvanie prichádzajúcich spojení (listen vrátil chybu %d) Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - + Transakcia bola zamietnutá! Toto sa môže stať ak niektoré coins vo vašej peňaženke už boli minuté, ako keď použijete kópiu wallet.dat a coins boli minuté z kópie ale neoznačené ako minuté tu. Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - + Chyba: Táto transakcia vyžaduje transakčný poplatok aspoň %s kvôli svojej sume, komplexite alebo použitiu nedávno prijatých prostriedkov. Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) @@ -2723,39 +2738,39 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Fees smaller than this are considered zero fee (for transaction creation) (default: - + Poplatky menšie než toto sa považujú za nulové (pre vytvorenie transakcie) (prednastavené: Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - + Odložiť aktivitu databázy spoločnej pamäti do logu na disku každých <n> megabajtov (prednastavené: 100) How thorough the block verification of -checkblocks is (0-4, default: 3) - + Ako dôkladne sú overované bloky -checkblocks (0-4, prednastavené: 3) In this mode -genproclimit controls how many blocks are generated immediately. - + V tomto režime -getproclimit kontroluje koľko blokov sa vytvorí okamžite. Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - + Nastaviť počeť vlákien overujúcich skripty (%u až %d, 0 = auto, <0 = nechať toľkoto jadier voľných, prednastavené: %d) Set the processor limit for when generation is on (-1 = unlimited, default: -1) - + Nastaviť obmedzenie pre procesor keď je zapnuté generovanie (-1 = bez obmedzenia, prednastavené: -1) This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - + Toto je pred-testovacia verzia - použitie je na vlastné riziko - nepoužívajte na tvorbu bitcoin ani obchodovanie. Unable to bind to %s on this computer. Bitcoin Core is probably already running. - + Nepodarilo sa pripojiť na %s na tomto počítači. Bitcoin Jadro je už pravdepodobne spustené. Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - + Použite rozdielne SOCKS5 proxy pre dosiahnutie peer-ov cez Tor skryté služby (prednastavené: -proxy) Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. @@ -2763,15 +2778,17 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - + Varovanie: Skontroluj či je na počítači nastavený správny čas a dátum. Ak sú hodiny nastavené nesprávne, Bitcoin nebude správne pracovať. Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - + Varovanie: Javí sa že sieť sieť úplne nesúhlasí! Niektorí mineri zjavne majú ťažkosti. + +The network does not appear to fully agree! Some miners appear to be experiencing issues. Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - + Varovanie: Zjavne sa úplne nezhodujeme s našimi peer-mi! Možno potrebujete prejsť na novšiu verziu alebo ostatné nódy potrebujú vyššiu verziu. Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. @@ -2779,7 +2796,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - + Varovanie: wallet.dat je poškodený, údaje úspešne získané! Pôvodný wallet.dat uložený ako wallet.{timestamp}.bak v %s; ak váš zostatok alebo transakcie niesu správne, mali by ste súbor obnoviť zo zálohy. (default: 1) @@ -2799,7 +2816,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Bitcoin Core Daemon - + Démon Jadro Bitcoin Block creation options: @@ -2807,7 +2824,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Clear list of wallet transactions (diagnostic tool; implies -rescan) - + Vyčistiť zoznam transakcií peňaženky (diagnostický nástroj; zahŕňa -rescan) Connect only to the specified node(s) @@ -2819,7 +2836,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - + Pripojiť ku JSON-RPC na <port> (prednastavené: 8332 alebo testnet: 18332) Connection options: @@ -2835,7 +2852,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Disable safemode, override a real safe mode event (default: 0) - + Vypnúť bezpečný režim, vypnúť udalosť skutočný bezpečný režim (prednastavené: 0) Discover own IP address (default: 1 when listening and no -externalip) @@ -2843,7 +2860,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Do not load the wallet and disable wallet RPC calls - + Nenahrat peňaženku a zablokovať volania RPC. Do you want to rebuild the block database now? @@ -2907,11 +2924,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write file info - + Zlyhalo zapisovanie informácié o súbore Failed to write to coin database - + Zlyhalo zapisovanie do databázy coins Failed to write transaction index @@ -2927,7 +2944,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Fees smaller than this are considered zero fee (for relaying) (default: - + Poplatky menšie než toto sa považujú za nulové (pre preposielanie) (prednastavené: Find peers using DNS lookup (default: 1 unless -connect) @@ -2935,7 +2952,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Force safe mode (default: 0) - + Vnútiť bezpečný režim (prenastavené: 0) Generate coins (default: 0) @@ -2947,7 +2964,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. If <category> is not supplied, output all debugging information. - + Ak nie je uvedená <category>, na výstupe zobrazuj všetky informácie pre ladenie. Importing... @@ -2967,7 +2984,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Prepend debug output with timestamp (default: 1) - + Na začiatok logu pre ladenie vlož dátum a čas (prednastavené: 1) RPC client options: @@ -2983,7 +3000,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Set database cache size in megabytes (%d to %d, default: %d) - + Nastaviť veľkosť pomocnej pamäti databázy v megabajtoch (%d na %d, prednatavené: %d) Set maximum block size in bytes (default: %d) @@ -2999,11 +3016,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Spend unconfirmed change when sending transactions (default: 1) - + Míňať nepotvrdený výdavok pri odosielaní (prednastavené: 1) This is intended for regression testing tools and app development. - + Toto je mienené nástrojom pre regresné testovania a vývoj programu. Usage (deprecated, use bitcoin-cli): @@ -3031,7 +3048,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: Deprecated argument -debugnet ignored, use -debug=net - + Varovanie: Zastaralý parameter -debugnet bol ignorovaný, použite -debug=net You need to rebuild the database using -reindex to change -txindex @@ -3047,15 +3064,15 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - + Vykonať príkaz keď po prijatí patričné varovanie alebo vidíme veľmi dlhé rozdvojenie siete (%s v cmd je nahradené správou) Output debugging information (default: 0, supplying <category> is optional) - + Výstup informácií pre ladenie (prednastavené: 0, uvádzanie <category> je voliteľné) Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - + Nastaviť najväčšiu veľkosť vysoká-dôležitosť/nízke-poplatky transakcií v bajtoch (prednastavené: %d) Information @@ -3071,15 +3088,15 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Limit size of signature cache to <n> entries (default: 50000) - + Obmedziť veľkosť pomocnej pamäti pre podpisy na <n> vstupov (prednastavené: 50000) Log transaction priority and fee per kB when mining blocks (default: 0) - + Zaznamenávať dôležitosť transakcií a poplatky za kB ak hľadáme bloky (prednastavené: 0) Maintain a full transaction index (default: 0) - + Udržiavaj úplný zoznam transakcií (prednastavené: 0) Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) @@ -3087,11 +3104,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - + Maximálna veľkosť vysielacieho zásobníka pre jedno spojenie, <n>*1000 bytov (predvolené: 1000) Only accept block chain matching built-in checkpoints (default: 1) - + Akceptuj iba kontrolné body zhodné s blockchain (prednastavené: 1) Only connect to nodes in network <net> (IPv4, IPv6 or Tor) @@ -3099,15 +3116,15 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Print block on startup, if found in block index - + Vytlač blok pri spustení, ak nájdený v zozname blokov Print block tree on startup (default: 0) - + Vytlačiť strom blokov pri spustení (prednastavené: 0) RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - + Možnosti RPC SSL: (Pozri v Bitcoin Wiki pokyny pre SSL nastavenie) RPC server options: @@ -3119,7 +3136,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Randomly fuzz 1 of every <n> network messages - + Náhodne premiešaj 1 z každých <n> sieťových správ Run a thread to flush wallet periodically (default: 1) @@ -3207,7 +3224,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Zapping all transactions from wallet... - + Zmazať všetky transakcie z peňaženky... on startup From 79d06dc6e07103b31b530f71b7187ea82c34266b Mon Sep 17 00:00:00 2001 From: R E Broadley Date: Wed, 21 May 2014 18:50:46 +0800 Subject: [PATCH 0078/1288] Remove redundant c_str --- src/addrman.h | 4 ++-- src/init.cpp | 2 +- src/leveldbwrapper.h | 4 ++-- src/main.h | 12 ++++++------ src/net.h | 2 +- src/script.h | 2 +- src/wallet.h | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/addrman.h b/src/addrman.h index e2b0cb1093..5328a93b45 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -420,7 +420,7 @@ public: Check(); } if (fRet) - LogPrint("addrman", "Added %s from %s: %i tried, %i new\n", addr.ToStringIPPort().c_str(), source.ToString().c_str(), nTried, nNew); + LogPrint("addrman", "Added %s from %s: %i tried, %i new\n", addr.ToStringIPPort().c_str(), source.ToString(), nTried, nNew); return fRet; } @@ -436,7 +436,7 @@ public: Check(); } if (nAdd) - LogPrint("addrman", "Added %i addresses from %s: %i tried, %i new\n", nAdd, source.ToString().c_str(), nTried, nNew); + LogPrint("addrman", "Added %i addresses from %s: %i tried, %i new\n", nAdd, source.ToString(), nTried, nNew); return nAdd > 0; } diff --git a/src/init.cpp b/src/init.cpp index 7664988762..bc4924b48d 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -914,7 +914,7 @@ bool AppInit2(boost::thread_group& threadGroup) for (map::iterator mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi) { uint256 hash = (*mi).first; - if (strncmp(hash.ToString().c_str(), strMatch.c_str(), strMatch.size()) == 0) + if (boost::algorithm::starts_with(hash.ToString(), strMatch)) { CBlockIndex* pindex = (*mi).second; CBlock block; diff --git a/src/leveldbwrapper.h b/src/leveldbwrapper.h index 53e9e439bd..043a56bf38 100644 --- a/src/leveldbwrapper.h +++ b/src/leveldbwrapper.h @@ -93,7 +93,7 @@ public: if (!status.ok()) { if (status.IsNotFound()) return false; - LogPrintf("LevelDB read failure: %s\n", status.ToString().c_str()); + LogPrintf("LevelDB read failure: %s\n", status.ToString()); HandleError(status); } try { @@ -122,7 +122,7 @@ public: if (!status.ok()) { if (status.IsNotFound()) return false; - LogPrintf("LevelDB read failure: %s\n", status.ToString().c_str()); + LogPrintf("LevelDB read failure: %s\n", status.ToString()); HandleError(status); } return true; diff --git a/src/main.h b/src/main.h index f47c9ee825..1dc48c0af8 100644 --- a/src/main.h +++ b/src/main.h @@ -862,13 +862,13 @@ public: { return strprintf("CBlockIndex(pprev=%p, nHeight=%d, merkle=%s, hashBlock=%s)", pprev, nHeight, - hashMerkleRoot.ToString().c_str(), - GetBlockHash().ToString().c_str()); + hashMerkleRoot.ToString(), + GetBlockHash().ToString()); } void print() const { - LogPrintf("%s\n", ToString().c_str()); + LogPrintf("%s\n", ToString()); } // Check whether this block index entry is valid up to the passed validity level. @@ -953,14 +953,14 @@ public: std::string str = "CDiskBlockIndex("; str += CBlockIndex::ToString(); str += strprintf("\n hashBlock=%s, hashPrev=%s)", - GetBlockHash().ToString().c_str(), - hashPrev.ToString().c_str()); + GetBlockHash().ToString(), + hashPrev.ToString()); return str; } void print() const { - LogPrintf("%s\n", ToString().c_str()); + LogPrintf("%s\n", ToString()); } }; diff --git a/src/net.h b/src/net.h index 729b1bcd57..58a8fa739b 100644 --- a/src/net.h +++ b/src/net.h @@ -430,7 +430,7 @@ public: nRequestTime = it->second; else nRequestTime = 0; - LogPrint("net", "askfor %s %d (%s)\n", inv.ToString().c_str(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str()); + LogPrint("net", "askfor %s %d (%s)\n", inv.ToString(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str()); // Make sure not to reuse time indexes to keep things in the same order int64_t nNow = GetTimeMicros() - 1000000; diff --git a/src/script.h b/src/script.h index 0d8a8544bd..aed2b7a6ad 100644 --- a/src/script.h +++ b/src/script.h @@ -722,7 +722,7 @@ public: void print() const { - LogPrintf("%s\n", ToString().c_str()); + LogPrintf("%s\n", ToString()); } CScriptID GetID() const diff --git a/src/wallet.h b/src/wallet.h index b2c06d3f61..81dfbba9cb 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -720,12 +720,12 @@ public: std::string ToString() const { - return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString().c_str(), i, nDepth, FormatMoney(tx->vout[i].nValue).c_str()); + return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString(), i, nDepth, FormatMoney(tx->vout[i].nValue).c_str()); } void print() const { - LogPrintf("%s\n", ToString().c_str()); + LogPrintf("%s\n", ToString()); } }; From a48355dc44e8b86c2fc9f8b7973ac9e81a295be7 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 22 May 2014 13:05:04 +0200 Subject: [PATCH 0079/1288] Remove forward declaration for non-existent class CCoinsDB Found by stephenreed on #bitcoin.dev. --- src/main.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.h b/src/main.h index f47c9ee825..6f39b6e89d 100644 --- a/src/main.h +++ b/src/main.h @@ -102,7 +102,6 @@ extern unsigned int nCoinCacheSize; static const uint64_t nMinDiskSpace = 52428800; -class CCoinsDB; class CBlockTreeDB; struct CDiskBlockPos; class CTxUndo; From d90491a766e7ab5e9cc0a6207fe8ad88a803dfb1 Mon Sep 17 00:00:00 2001 From: LongShao007 <007longshao@gmail.com> Date: Thu, 22 May 2014 21:41:59 +0800 Subject: [PATCH 0080/1288] Update test_main.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit i think should delete (#include "bitcoin-config.h")。 --- src/qt/test/test_main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp index a2adb00327..220da28cfe 100644 --- a/src/qt/test/test_main.cpp +++ b/src/qt/test/test_main.cpp @@ -1,4 +1,3 @@ -#include "bitcoin-config.h" #if defined(HAVE_CONFIG_H) #include "bitcoin-config.h" #endif From a60838d09aed4d976e9343e8329d61afff204435 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 8 May 2014 14:15:19 +0200 Subject: [PATCH 0081/1288] Replace non-threadsafe strerror Log the name of the error as well as the error code if a network problem happens. This makes network troubleshooting more convenient. Use thread-safe strerror_r and the WIN32 equivalent FormatMessage. --- configure.ac | 2 ++ src/net.cpp | 24 ++++++++++++------------ src/netbase.cpp | 41 +++++++++++++++++++++++++++++++++++++---- src/netbase.h | 2 ++ 4 files changed, 53 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index 6a8afe6e44..3a8d33a5a0 100644 --- a/configure.ac +++ b/configure.ac @@ -303,6 +303,8 @@ INCLUDES="$INCLUDES $PTHREAD_CFLAGS" # they also need to be passed down to any subprojects. Pull the results out of # the cache and add them to CPPFLAGS. AC_SYS_LARGEFILE +# detect POSIX or GNU variant of strerror_r +AC_FUNC_STRERROR_R if test x$ac_cv_sys_file_offset_bits != x && test x$ac_cv_sys_file_offset_bits != xno && diff --git a/src/net.cpp b/src/net.cpp index 6bde1e7999..4cbd26a563 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -178,7 +178,7 @@ bool RecvLine(SOCKET hSocket, string& strLine) { // socket error int nErr = WSAGetLastError(); - LogPrint("net", "recv failed: %d\n", nErr); + LogPrint("net", "recv failed: %s\n", NetworkErrorString(nErr)); return false; } } @@ -489,10 +489,10 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest) #ifdef WIN32 u_long nOne = 1; if (ioctlsocket(hSocket, FIONBIO, &nOne) == SOCKET_ERROR) - LogPrintf("ConnectSocket() : ioctlsocket non-blocking setting failed, error %d\n", WSAGetLastError()); + LogPrintf("ConnectSocket() : ioctlsocket non-blocking setting failed, error %s\n", NetworkErrorString(WSAGetLastError())); #else if (fcntl(hSocket, F_SETFL, O_NONBLOCK) == SOCKET_ERROR) - LogPrintf("ConnectSocket() : fcntl non-blocking setting failed, error %d\n", errno); + LogPrintf("ConnectSocket() : fcntl non-blocking setting failed, error %s\n", NetworkErrorString(errno)); #endif // Add node @@ -736,7 +736,7 @@ void SocketSendData(CNode *pnode) int nErr = WSAGetLastError(); if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS) { - LogPrintf("socket send error %d\n", nErr); + LogPrintf("socket send error %s\n", NetworkErrorString(nErr)); pnode->CloseSocketDisconnect(); } } @@ -896,7 +896,7 @@ void ThreadSocketHandler() if (have_fds) { int nErr = WSAGetLastError(); - LogPrintf("socket select error %d\n", nErr); + LogPrintf("socket select error %s\n", NetworkErrorString(nErr)); for (unsigned int i = 0; i <= hSocketMax; i++) FD_SET(i, &fdsetRecv); } @@ -933,7 +933,7 @@ void ThreadSocketHandler() { int nErr = WSAGetLastError(); if (nErr != WSAEWOULDBLOCK) - LogPrintf("socket error accept failed: %d\n", nErr); + LogPrintf("socket error accept failed: %s\n", NetworkErrorString(nErr)); } else if (nInbound >= nMaxConnections - MAX_OUTBOUND_CONNECTIONS) { @@ -1007,7 +1007,7 @@ void ThreadSocketHandler() if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS) { if (!pnode->fDisconnect) - LogPrintf("socket recv error %d\n", nErr); + LogPrintf("socket recv error %s\n", NetworkErrorString(nErr)); pnode->CloseSocketDisconnect(); } } @@ -1585,7 +1585,7 @@ bool BindListenPort(const CService &addrBind, string& strError) SOCKET hListenSocket = socket(((struct sockaddr*)&sockaddr)->sa_family, SOCK_STREAM, IPPROTO_TCP); if (hListenSocket == INVALID_SOCKET) { - strError = strprintf("Error: Couldn't open socket for incoming connections (socket returned error %d)", WSAGetLastError()); + strError = strprintf("Error: Couldn't open socket for incoming connections (socket returned error %s)", NetworkErrorString(WSAGetLastError())); LogPrintf("%s\n", strError); return false; } @@ -1609,7 +1609,7 @@ bool BindListenPort(const CService &addrBind, string& strError) if (fcntl(hListenSocket, F_SETFL, O_NONBLOCK) == SOCKET_ERROR) #endif { - strError = strprintf("Error: Couldn't set properties on socket for incoming connections (error %d)", WSAGetLastError()); + strError = strprintf("Error: Couldn't set properties on socket for incoming connections (error %s)", NetworkErrorString(WSAGetLastError())); LogPrintf("%s\n", strError); return false; } @@ -1638,7 +1638,7 @@ bool BindListenPort(const CService &addrBind, string& strError) if (nErr == WSAEADDRINUSE) strError = strprintf(_("Unable to bind to %s on this computer. Bitcoin Core is probably already running."), addrBind.ToString()); else - strError = strprintf(_("Unable to bind to %s on this computer (bind returned error %d, %s)"), addrBind.ToString(), nErr, strerror(nErr)); + strError = strprintf(_("Unable to bind to %s on this computer (bind returned error %s)"), addrBind.ToString(), NetworkErrorString(nErr)); LogPrintf("%s\n", strError); return false; } @@ -1647,7 +1647,7 @@ bool BindListenPort(const CService &addrBind, string& strError) // Listen for incoming connections if (listen(hListenSocket, SOMAXCONN) == SOCKET_ERROR) { - strError = strprintf(_("Error: Listening for incoming connections failed (listen returned error %d)"), WSAGetLastError()); + strError = strprintf(_("Error: Listening for incoming connections failed (listen returned error %s)"), NetworkErrorString(WSAGetLastError())); LogPrintf("%s\n", strError); return false; } @@ -1785,7 +1785,7 @@ public: BOOST_FOREACH(SOCKET hListenSocket, vhListenSocket) if (hListenSocket != INVALID_SOCKET) if (closesocket(hListenSocket) == SOCKET_ERROR) - LogPrintf("closesocket(hListenSocket) failed with error %d\n", WSAGetLastError()); + LogPrintf("closesocket(hListenSocket) failed with error %s\n", NetworkErrorString(WSAGetLastError())); // clean up some globals (to help leak detection) BOOST_FOREACH(CNode *pnode, vNodes) diff --git a/src/netbase.cpp b/src/netbase.cpp index 82a681281d..e24a0a195c 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -361,7 +361,7 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe } if (nRet == SOCKET_ERROR) { - LogPrintf("select() for %s failed: %i\n", addrConnect.ToString(), WSAGetLastError()); + LogPrintf("select() for %s failed: %s\n", addrConnect.ToString(), NetworkErrorString(WSAGetLastError())); closesocket(hSocket); return false; } @@ -372,13 +372,13 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe if (getsockopt(hSocket, SOL_SOCKET, SO_ERROR, &nRet, &nRetSize) == SOCKET_ERROR) #endif { - LogPrintf("getsockopt() for %s failed: %i\n", addrConnect.ToString(), WSAGetLastError()); + LogPrintf("getsockopt() for %s failed: %s\n", addrConnect.ToString(), NetworkErrorString(WSAGetLastError())); closesocket(hSocket); return false; } if (nRet != 0) { - LogPrintf("connect() to %s failed after select(): %s\n", addrConnect.ToString(), strerror(nRet)); + LogPrintf("connect() to %s failed after select(): %s\n", addrConnect.ToString(), NetworkErrorString(nRet)); closesocket(hSocket); return false; } @@ -389,7 +389,7 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe else #endif { - LogPrintf("connect() to %s failed: %i\n", addrConnect.ToString(), WSAGetLastError()); + LogPrintf("connect() to %s failed: %s\n", addrConnect.ToString(), NetworkErrorString(WSAGetLastError())); closesocket(hSocket); return false; } @@ -1237,3 +1237,36 @@ bool operator!=(const CSubNet& a, const CSubNet& b) { return !(a==b); } + +#ifdef WIN32 +std::string NetworkErrorString(int err) +{ + char buf[256]; + buf[0] = 0; + if(FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK, + NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + buf, sizeof(buf), NULL)) + { + return strprintf("%s (%d)", buf, err); + } + else + { + return strprintf("Unknown error (%d)", err); + } +} +#else +std::string NetworkErrorString(int err) +{ + char buf[256]; + const char *s = buf; + buf[0] = 0; + /* Too bad there are two incompatible implementations of the + * thread-safe strerror. */ +#ifdef STRERROR_R_CHAR_P /* GNU variant can return a pointer outside the passed buffer */ + s = strerror_r(err, buf, sizeof(buf)); +#else /* POSIX variant always returns message in buffer */ + (void) strerror_r(err, buf, sizeof(buf)); +#endif + return strprintf("%s (%d)", s, err); +} +#endif diff --git a/src/netbase.h b/src/netbase.h index 118f866d6c..5fd8be4aca 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -179,5 +179,7 @@ bool Lookup(const char *pszName, std::vector& vAddr, int portDefault = bool LookupNumeric(const char *pszName, CService& addr, int portDefault = 0); bool ConnectSocket(const CService &addr, SOCKET& hSocketRet, int nTimeout = nConnectTimeout); bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest, int portDefault = 0, int nTimeout = nConnectTimeout); +/** Return readable error string for a network error code */ +std::string NetworkErrorString(int err); #endif From 4665b1ab6f45bd35e3ffe2434395c81e5acbb91b Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 23 May 2014 09:49:01 +0200 Subject: [PATCH 0082/1288] doc: Clarify wording about testing in README.md Weaken and clarify the wording a bit, it currently implies that we get more pull requests than we can ever handle which discourages contribution. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3e9ec25980..ddeaf988ee 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,8 @@ Testing ------- Testing and code review is the bottleneck for development; we get more pull -requests than we can review and test. Please be patient and help out, and -remember this is a security-critical project where any mistake might cost people +requests than we can review and test on short notice. Please be patient and help out by testing +other people's pull requests, and remember this is a security-critical project where any mistake might cost people lots of money. ### Automated Testing From 3e8ac6af9a993e262d1160fb2e6e1e1f1d5d19f2 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 8 May 2014 18:01:10 +0200 Subject: [PATCH 0083/1288] Replace non-threadsafe gmtime and setlocale Make DateTimeStrFormat use boost::posix_time. Also re-enable the util_DateTimeStrFormat tests, as they are no longer platform specific. --- src/rpcprotocol.cpp | 10 +--------- src/test/util_tests.cpp | 4 +--- src/util.cpp | 12 ++++++++++++ src/util.h | 9 +-------- 4 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp index 5cbaa535ab..2718f81783 100644 --- a/src/rpcprotocol.cpp +++ b/src/rpcprotocol.cpp @@ -51,15 +51,7 @@ string HTTPPost(const string& strMsg, const map& mapRequestHeader static string rfc1123Time() { - char buffer[64]; - time_t now; - time(&now); - struct tm* now_gmt = gmtime(&now); - string locale(setlocale(LC_TIME, NULL)); - setlocale(LC_TIME, "C"); // we want POSIX (aka "C") weekday/month strings - strftime(buffer, sizeof(buffer), "%a, %d %b %Y %H:%M:%S +0000", now_gmt); - setlocale(LC_TIME, locale.c_str()); - return string(buffer); + return DateTimeStrFormat("%a, %d %b %Y %H:%M:%S +0000", GetTime()); } string HTTPReply(int nStatus, const string& strMsg, bool keepalive) diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 3811569c0a..0e53a57593 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -108,13 +108,11 @@ BOOST_AUTO_TEST_CASE(util_HexStr) BOOST_AUTO_TEST_CASE(util_DateTimeStrFormat) { -/*These are platform-dependant and thus removed to avoid useless test failures BOOST_CHECK_EQUAL(DateTimeStrFormat("%Y-%m-%d %H:%M:%S", 0), "1970-01-01 00:00:00"); BOOST_CHECK_EQUAL(DateTimeStrFormat("%Y-%m-%d %H:%M:%S", 0x7FFFFFFF), "2038-01-19 03:14:07"); - // Formats used within Bitcoin BOOST_CHECK_EQUAL(DateTimeStrFormat("%Y-%m-%d %H:%M:%S", 1317425777), "2011-09-30 23:36:17"); BOOST_CHECK_EQUAL(DateTimeStrFormat("%Y-%m-%d %H:%M", 1317425777), "2011-09-30 23:36"); -*/ + BOOST_CHECK_EQUAL(DateTimeStrFormat("%a, %d %b %Y %H:%M:%S +0000", 1317425777), "Fri, 30 Sep 2011 23:36:17 +0000"); } BOOST_AUTO_TEST_CASE(util_ParseParameters) diff --git a/src/util.cpp b/src/util.cpp index aa3adf89ec..f7ceb3e95c 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -14,6 +14,8 @@ #include +#include + #ifndef WIN32 // for posix_fallocate #ifdef __linux_ @@ -1400,3 +1402,13 @@ void SetupEnvironment() } #endif } + +std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime) +{ + // std::locale takes ownership of the pointer + std::locale loc(std::locale::classic(), new boost::posix_time::time_facet(pszFormat)); + std::stringstream ss; + ss.imbue(loc); + ss << boost::posix_time::from_time_t(nTime); + return ss.str(); +} diff --git a/src/util.h b/src/util.h index 97185073e0..9e899b5084 100644 --- a/src/util.h +++ b/src/util.h @@ -325,14 +325,7 @@ inline int64_t GetTimeMicros() boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_microseconds(); } -inline std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime) -{ - time_t n = nTime; - struct tm* ptmTime = gmtime(&n); - char pszTime[200]; - strftime(pszTime, sizeof(pszTime), pszFormat, ptmTime); - return pszTime; -} +std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime); inline bool IsSwitchChar(char c) { From c47f5379bd25195d1e08638294f9ffbb5b1df0a8 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Fri, 23 May 2014 10:30:38 -0400 Subject: [PATCH 0084/1288] Add Tips and Tricks section to README --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/README.md b/README.md index 3e9ec25980..98edf87ee0 100644 --- a/README.md +++ b/README.md @@ -81,3 +81,38 @@ Periodically the translations are pulled from Transifex and merged into the git **Important**: We do not accept translation changes as github pull request because the next pull from Transifex would automatically overwrite them again. + +Development tips and tricks +--------------------------- + +**compiling for debugging** + +Run configure with the --enable-debug option, then make. Or run configure with +CXXFLAGS="-g -ggdb -O0" or whatever debug flags you need. + +**debug.log** + +If the code is behaving strangely, take a look in the debug.log file in the data directory; +error and debugging message are written there. + +The -debug=... command-line option controls debugging; running with just -debug will turn +on all categories (and give you a very large debug.log file). + +The Qt code routes qDebug() output to debug.log under category "qt": run with -debug=qt +to see it. + +**testnet and regtest modes** + +Run with the -testnet option to run with "play bitcoins" on the test network, if you +are testing multi-machine code that needs to operate across the internet. + +If you are testing something that can run on one machine, run with the -regtest option. +In regression test mode blocks can be created on-demand; see qa/rpc-tests/ for tests +that run in -regest mode. + +**DEBUG_LOCKORDER** + +Bitcoin Core is a multithreaded application, and deadlocks or other multithreading bugs +can be very difficult to track down. Compiling with -DDEBUG_LOCKORDER (configure +CXXFLAGS="-DDEBUG_LOCKORDER -g") inserts run-time checks to keep track of what locks +are held, and adds warning to the debug.log file if inconsistencies are detected. From a8a0db6f210c879396417d4eace8b188ca9a199a Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 23 May 2014 17:54:57 +0200 Subject: [PATCH 0085/1288] qt: Periodic language update Last-minute language update before release 0.9.2. --- src/qt/locale/bitcoin_da.ts | 166 ++++++++++++++++----------------- src/qt/locale/bitcoin_id_ID.ts | 72 +++++++------- src/qt/locale/bitcoin_ko_KR.ts | 74 +++++++-------- src/qt/locale/bitcoin_ro_RO.ts | 6 +- 4 files changed, 159 insertions(+), 159 deletions(-) diff --git a/src/qt/locale/bitcoin_da.ts b/src/qt/locale/bitcoin_da.ts index 5795701497..b13b38a878 100644 --- a/src/qt/locale/bitcoin_da.ts +++ b/src/qt/locale/bitcoin_da.ts @@ -25,7 +25,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Copyright - Copyright + Ophavsret The Bitcoin Core developers @@ -76,7 +76,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open &Export - Eksporter + Eksportér &Delete @@ -214,7 +214,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open 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. - VIGTIGT: Enhver tidligere sikkerhedskopi, som du har lavet af tegnebogsfilen, bør blive erstattet af den nyligt genererede, krypterede tegnebogsfil. Af sikkerhedsmæssige årsager vil tidligere sikkerhedskopier af den ikke-krypterede tegnebogsfil blive ubrugelig i det øjeblik, du starter med at anvende den nye, krypterede tegnebog. + VIGTIGT: Enhver tidligere sikkerhedskopi, som du har lavet af tegnebogsfilen, bør blive erstattet af den nyligt genererede, krypterede tegnebogsfil. Af sikkerhedsmæssige årsager vil tidligere sikkerhedskopier af den ikke-krypterede tegnebogsfil blive ubrugelige i det øjeblik, du starter med at anvende den nye, krypterede tegnebog. Warning: The Caps Lock key is on! @@ -337,11 +337,11 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Importing blocks from disk... - Importerer blokke fra disken... + Importerer blokke fra disken … Reindexing blocks on disk... - Genindekserer blokke på disken... + Genindekserer blokke på disken … Send coins to a Bitcoin address @@ -397,7 +397,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Encrypt the private keys that belong to your wallet - Krypter de private nøgler, der hører til din tegnebog + Kryptér de private nøgler, der hører til din tegnebog Sign messages with your Bitcoin addresses to prove you own them @@ -405,7 +405,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Verify messages to ensure they were signed with specified Bitcoin addresses - Verificér beskeder for at sikre, at de er underskrevet med de(n) angivne Bitcoin-adresse(r) + Verificér beskeder for at sikre, at de er underskrevet med de angivne Bitcoin-adresser &File @@ -469,7 +469,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open No block source available... - Ingen blokkilde tilgængelig... + Ingen blokkilde tilgængelig … Processed %1 of %2 (estimated) blocks of transaction history. @@ -861,7 +861,7 @@ Adresse: %4 FreespaceChecker A new data directory will be created. - + En ny datamappe vil blive oprettet. name @@ -869,15 +869,15 @@ Adresse: %4 Directory already exists. Add %1 if you intend to create a new directory here. - + Mappe eksisterer allerede. Tilføj %1, hvis du vil oprette en ny mappe her. Path already exists, and is not a directory. - + Sti eksisterer allerede og er ikke en mappe. Cannot create data directory here. - + Kan ikke oprette en mappe her. @@ -947,11 +947,11 @@ Adresse: %4 Use the default data directory - + Brug standardmappen for data Use a custom data directory: - + Brug tilpasset mappe for data: Bitcoin @@ -967,11 +967,11 @@ Adresse: %4 GB of free space available - + GB fri plads tilgængelig (of %1GB needed) - + (ud af %1 GB behøvet) @@ -1133,15 +1133,15 @@ Adresse: %4 &Minimize to the tray instead of the taskbar - Minimer til statusfeltet i stedet for proceslinjen + Minimér til statusfeltet i stedet for proceslinjen Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - Minimer i stedet for at afslutte programmet, når vinduet lukkes. Når denne indstilling er valgt, vil programmet kun blive lukket, når du har valgt Afslut i menuen. + Minimér i stedet for at afslutte programmet, når vinduet lukkes. Når denne indstilling er valgt, vil programmet kun blive lukket, når du har valgt Afslut i menuen. M&inimize on close - Minimer ved lukning + Minimér ved lukning &Display @@ -1149,11 +1149,11 @@ Adresse: %4 User Interface &language: - Brugergrænsefladesprog: + Sprog for brugergrænseflade: The user interface language can be set here. This setting will take effect after restarting Bitcoin. - Brugergrænsefladesproget kan angives her. Denne indstilling træder først i kraft, når Bitcoin genstartes. + Sproget for brugergrænsefladen kan angives her. Denne indstilling træder først i kraft, når Bitcoin genstartes. &Unit to show amounts in: @@ -1161,7 +1161,7 @@ Adresse: %4 Choose the default subdivision unit to show in the interface and when sending coins. - Vælg den standard underopdelingsenhed, som skal vises i brugergrænsefladen og ved afsendelse af bitcoins. + Vælg standard for underopdeling af enhed, som skal vises i brugergrænsefladen og ved afsendelse af bitcoins. Whether to show Bitcoin addresses in the transaction list or not. @@ -1181,7 +1181,7 @@ Adresse: %4 &Cancel - Annuller + Annullér default @@ -1209,7 +1209,7 @@ Adresse: %4 The supplied proxy address is invalid. - Ugyldig proxy-adresse + Den angivne proxy-adresse er ugyldig. @@ -1240,7 +1240,7 @@ Adresse: %4 Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - Total transaktioner, som ikke er blevet bekræftet endnu, og som ikke endnu er en del af den nuværende saldo + Total saldo for transaktioner, som ikke er blevet bekræftet endnu, og som ikke endnu er en del af den tilgængelige saldo Immature: @@ -1283,7 +1283,7 @@ Adresse: %4 Payment request error - Fejl i betalingsforespørgelse + Fejl i betalingsforespørgsel Cannot start bitcoin: click-to-pay handler @@ -1335,7 +1335,7 @@ Adresse: %4 Network request error - + Fejl i netværksforespørgsel @@ -1346,7 +1346,7 @@ Adresse: %4 Error: Specified data directory "%1" does not exist. - + Fejl: Angivet datamappe "%1" eksisterer ikke. Error: Cannot parse configuration file: %1. Only use key=value syntax. @@ -1354,7 +1354,7 @@ Adresse: %4 Error: Invalid combination of -regtest and -testnet. - + Fejl: Ugyldig kombination af -regtest og -testnet. Bitcoin Core didn't yet exit safely... @@ -1362,7 +1362,7 @@ Adresse: %4 Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Indtast en Bitcoin-adresse (f.eks. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + Indtast en Bitcoin-adresse (fx 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) @@ -1484,7 +1484,7 @@ Adresse: %4 Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - Åbn Bitcoin-fejlsøgningslogfilen fra det nuværende datakatalog. Dette kan tage nogle få sekunder for en store logfiler. + Åbn Bitcoin-fejlsøgningslogfilen fra den nuværende datamappe. Dette kan tage nogle få sekunder for store logfiler. Clear console @@ -1880,7 +1880,7 @@ Adresse: %4 Are you sure you want to send? - Er du sikker på at du vil sende? + Er du sikker på, at du vil sende? added as transaction fee @@ -1888,7 +1888,7 @@ Adresse: %4 Payment request expired - Betalingsforespørgsel udløb + Betalingsforespørgsel udløbet Invalid payment address %1 @@ -1907,7 +1907,7 @@ Adresse: %4 The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Bitcoin-adressen som betalingen skal sendes til (f.eks. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + Bitcoin-adressen som betalingen skal sendes til (fx 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) Enter a label for this address to add it to your address book @@ -1997,7 +1997,7 @@ Adresse: %4 The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Bitcoin-adressen som beskeden skal underskrives med (f.eks. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + Bitcoin-adressen som beskeden skal underskrives med (fx 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) Choose previously used address @@ -2017,7 +2017,7 @@ Adresse: %4 Enter the message you want to sign here - Indtast beskeden, du ønsker at underskrive + Indtast her beskeden, du ønsker at underskrive Signature @@ -2025,7 +2025,7 @@ Adresse: %4 Copy the current signature to the system clipboard - Kopier den nuværende underskrift til systemets udklipsholder + Kopiér den nuværende underskrift til systemets udklipsholder Sign the message to prove you own this Bitcoin address @@ -2049,11 +2049,11 @@ Adresse: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - Indtast den underskrevne adresse, beskeden (inkluder linjeskift, mellemrum mv. nøjagtigt, som de fremgår) og underskriften for at verificére beskeden. Vær forsigtig med ikke at lægge mere i underskriften end besked selv, så du undgår at blive narret af et man-in-the-middle-angreb. + Indtast herunder den underskrivende adresse, beskeden (inkludér linjeskift, mellemrum mv. nøjagtigt, som de fremgår) og underskriften for at verificere beskeden. Vær forsigtig med ikke at lægge mere i underskriften end besked selv, så du undgår at blive narret af et man-in-the-middle-angreb. The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Bitcoin-adressen som beskeden er underskrevet med (f.eks. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + Bitcoin-adressen som beskeden er underskrevet med (fx 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) Verify the message to ensure it was signed with the specified Bitcoin address @@ -2069,7 +2069,7 @@ Adresse: %4 Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Indtast en Bitcoin-adresse (f.eks. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + Indtast en Bitcoin-adresse (fx 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) Click "Sign Message" to generate signature @@ -2081,7 +2081,7 @@ Adresse: %4 Please check the address and try again. - Tjek venligst adressen, og forsøg igen. + Tjek venligst adressen og forsøg igen. The entered address does not refer to a key. @@ -2117,11 +2117,11 @@ Adresse: %4 Message verification failed. - Verificéring af besked mislykkedes. + Verificering af besked mislykkedes. Message verified. - Besked verificéret. + Besked verificeret. @@ -2136,7 +2136,7 @@ Adresse: %4 [testnet] - [testnet] + [testnetværk] @@ -2174,7 +2174,7 @@ Adresse: %4 , broadcast through %n node(s) - , transmitteret igennem %n knude(r), transmitteret igennem %n knude(r) + , transmitteret igennem %n knude, transmitteret igennem %n knuder Date @@ -2210,7 +2210,7 @@ Adresse: %4 matures in %n more block(s) - modner efter yderligere %n blok(ke)modner efter yderligere %n blok(ke) + modner efter yderligere %n blokmodner efter yderligere %n blokke not accepted @@ -2238,7 +2238,7 @@ Adresse: %4 Transaction ID - Transaktionens ID + Transaktions-ID Merchant @@ -2471,7 +2471,7 @@ Adresse: %4 Copy transaction ID - Kopier transaktionens ID + Kopiér transaktions-ID Edit label @@ -2560,7 +2560,7 @@ Adresse: %4 WalletView &Export - Eksporter + Eksportér Export the data in the current tab to a file @@ -2568,7 +2568,7 @@ Adresse: %4 Backup Wallet - Sikkerhedskopier tegnebog + Sikkerhedskopiér tegnebog Wallet Data (*.dat) @@ -2576,7 +2576,7 @@ Adresse: %4 Backup Failed - Foretagelse af sikkerhedskopi fejlede + Sikkerhedskopiering mislykkedes There was an error trying to save the wallet data to %1. @@ -2588,7 +2588,7 @@ Adresse: %4 Backup Successful - Sikkerhedskopieret problemfri + Sikkerhedskopiering problemfri @@ -2619,7 +2619,7 @@ Adresse: %4 Specify data directory - Angiv datakatalog + Angiv datamappe Listen for connections on <port> (default: 8333 or testnet: 18333) @@ -2671,7 +2671,7 @@ Adresse: %4 Accept connections from outside (default: 1 if no -proxy or -connect) - Accepter forbindelser udefra (standard: 1 hvis hverken -proxy eller -connect) + Acceptér forbindelser udefra (standard: 1 hvis hverken -proxy eller -connect) %s, you must set a rpcpassword in the configuration file: @@ -2694,7 +2694,7 @@ rpcpassword=%s Brugernavnet og adgangskode MÅ IKKE være det samme. Hvis filen ikke eksisterer, opret den og giv ingen andre end ejeren læserettighed. Det anbefales også at angive alertnotify, så du påmindes om problemer; -f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com @@ -2731,7 +2731,7 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - Fejl: Denne transaktion kræver et transaktionsgebyr på minimum %s pga. dens størrelse, kompleksitet eller anvendelse af nyligt modtagne bitcoins! + Fejl: Denne transaktion kræver et transaktionsgebyr på minimum %s pga. dens beløb, kompleksitet eller anvendelse af nyligt modtagne bitcoins! Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) @@ -2783,11 +2783,11 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - + Advarsel: Netværket ser ikke ud til at være fuldt ud enige! Enkelte minere ser ud til at opleve problemer. Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - + Advarsel: Vi ser ikke ud til at være fuldt ud enige med andre noder! Du kan være nødt til at opgradere, eller andre noder kan være nødt til at opgradere. Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. @@ -2795,7 +2795,7 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - Advarsel: wallet.dat ødelagt, data reddet! Oprindelig wallet.net gemt som wallet.{timestamp}.bak i %s; hvis din saldo eller dine transaktioner er forkert, bør du genskabe fra en sikkerhedskopi. + Advarsel: wallet.dat ødelagt, data reddet! Oprindelig wallet.dat gemt som wallet.{timestamp}.bak i %s; hvis din saldo eller dine transaktioner er forkert, bør du genskabe fra en sikkerhedskopi. (default: 1) @@ -2947,7 +2947,7 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Find peers using DNS lookup (default: 1 unless -connect) - Find ligeværdige ved DNS-opslag (standard: 1 hvis ikke -connect) + Find andre knuder ved DNS-opslag (standard: 1 hvis ikke -connect) Force safe mode (default: 0) @@ -2955,11 +2955,11 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Generate coins (default: 0) - Generer bitcoins (standard: 0) + Generér bitcoins (standard: 0) How many blocks to check at startup (default: 288, 0 = all) - Antal blokke som tjekkes ved opstart (0=alle, standard: 288) + Antal blokke som tjekkes ved opstart (standard: 288, 0=alle) If <category> is not supplied, output all debugging information. @@ -2971,7 +2971,7 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Incorrect or no genesis block found. Wrong datadir for network? - + Ukorrekt eller ingen tilblivelsesblok fundet. Forkert datamappe for netværk? Invalid -onion address: '%s' @@ -3011,7 +3011,7 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Specify wallet file (within data directory) - + Angiv tegnebogsfil (inden for datamappe) Spend unconfirmed change when sending transactions (default: 1) @@ -3027,11 +3027,11 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Verifying blocks... - Verificerer blokke... + Verificerer blokke … Verifying wallet... - Verificerer tegnebog... + Verificerer tegnebog … Wait for RPC server to start @@ -3039,7 +3039,7 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Wallet %s resides outside data directory %s - + Tegnebog %1 findes uden for datamappe %s Wallet options: @@ -3051,7 +3051,7 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com You need to rebuild the database using -reindex to change -txindex - + Du er nødt til at genopbygge databasen ved hjælp af -reindex for at ændre -txindex Imports blocks from external blk000??.dat file @@ -3063,7 +3063,7 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - + Udfør kommando, når en relevant alarm modtages eller vi ser en virkelig lang udsplitning (%s i cmd erstattes af besked) Output debugging information (default: 0, supplying <category> is optional) @@ -3079,11 +3079,11 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Invalid amount for -minrelaytxfee=<amount>: '%s' - Ugyldigt beløb til -minrelaytxfee=<beløb>:'%s' + Ugyldigt beløb til -minrelaytxfee=<beløb>: "%s" Invalid amount for -mintxfee=<amount>: '%s' - Ugyldigt beløb til -mintxfee=<beløb>:'%s' + Ugyldigt beløb til -mintxfee=<beløb>: "%s" Limit size of signature cache to <n> entries (default: 50000) @@ -3099,15 +3099,15 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Maksimum for modtagelsesbuffer pr. forbindelse, <n>*1000 bytes (standard: 5000) + Maksimum for modtagelsesbuffer pr. forbindelse, <n>*1000 byte (standard: 5000) Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Maksimum for afsendelsesbuffer pr. forbindelse, <n>*1000 bytes (standard: 1000) + Maksimum for afsendelsesbuffer pr. forbindelse, <n>*1000 byte (standard: 1000) Only accept block chain matching built-in checkpoints (default: 1) - Accepter kun blokkæde, som matcher indbyggede kontrolposter (standard: 1) + Acceptér kun blokkæde, som matcher indbyggede kontrolposter (standard: 1) Only connect to nodes in network <net> (IPv4, IPv6 or Tor) @@ -3155,7 +3155,7 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set minimum block size in bytes (default: 0) - Angiv minimumsblokstørrelse i bytes (standard: 0) + Angiv minimumsblokstørrelse i byte (standard: 0) Sets the DB_PRIVATE flag in the wallet db environment (default: 1) @@ -3203,11 +3203,11 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Use UPnP to map the listening port (default: 0) - Forsøg at bruge UPnP til at konfigurere den lyttende port (standard: 0) + Brug UPnP til at konfigurere den lyttende port (standard: 0) Use UPnP to map the listening port (default: 1 when listening) - Forsøg at bruge UPnP til at konfigurere den lyttende port (standard: 1 når lytter) + Brug UPnP til at konfigurere den lyttende port (standard: 1 under lytning) Username for JSON-RPC connections @@ -3311,11 +3311,11 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Invalid -proxy address: '%s' - Ugyldig -proxy adresse: '%s' + Ugyldig -proxy adresse: "%s" Unknown network specified in -onlynet: '%s' - Ukendt netværk anført i -onlynet: '%s' + Ukendt netværk anført i -onlynet: "%s" Unknown -socks proxy version requested: %i @@ -3323,15 +3323,15 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Cannot resolve -bind address: '%s' - Kan ikke finde -bind adressen: '%s' + Kan ikke finde -bind adressen: "%s" Cannot resolve -externalip address: '%s' - Kan ikke finde -externalip adressen: '%s' + Kan ikke finde -externalip adressen: "%s" Invalid amount for -paytxfee=<amount>: '%s' - Ugyldigt beløb for -paytxfee=<amount>: '%s' + Ugyldigt beløb for -paytxfee=<beløb>: "%s" Invalid amount @@ -3381,7 +3381,7 @@ f.eks.: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com You must set rpcpassword=<password> in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions. - Du skal angive rpcpassword=<password> i konfigurationsfilen: + Du skal angive rpcpassword=<adgangskode> i konfigurationsfilen: %s Hvis filen ikke eksisterer, opret den og giv ingen andre end ejeren læserettighed. diff --git a/src/qt/locale/bitcoin_id_ID.ts b/src/qt/locale/bitcoin_id_ID.ts index c4dee5f92d..2b9685f6a0 100644 --- a/src/qt/locale/bitcoin_id_ID.ts +++ b/src/qt/locale/bitcoin_id_ID.ts @@ -433,7 +433,7 @@ Produk ini termasuk software yang dibangun oleh Proyek OpenSSL untuk Toolkit Ope Request payments (generates QR codes and bitcoin: URIs) - + Permintaan pembayaran (membangkitkan kode QR dan bitcoin: URIs) &About Bitcoin Core @@ -473,7 +473,7 @@ Produk ini termasuk software yang dibangun oleh Proyek OpenSSL untuk Toolkit Ope Processed %1 of %2 (estimated) blocks of transaction history. - + Proses % 1 dar i% 2 (perkiraan) blok catatan transaksi Processed %1 blocks of transaction history. @@ -509,7 +509,7 @@ Produk ini termasuk software yang dibangun oleh Proyek OpenSSL untuk Toolkit Ope Transactions after this will not yet be visible. - + Transaksi setelah ini tidak akan ditampilkan Error @@ -561,7 +561,7 @@ Alamat: %4 A fatal error occurred. Bitcoin can no longer continue safely and will quit. - + Terjadi kesalahan fatal. Bitcoin tidak bisa lagi meneruskan dengan aman dan akan berhenti. @@ -611,15 +611,15 @@ Alamat: %4 (un)select all - + (Tidak)memilih semua Tree mode - + mode pohon List mode - + Mode daftar Amount @@ -663,11 +663,11 @@ Alamat: %4 Lock unspent - + Kunci terpakai. Unlock unspent - + Membuka kunci terpakai Copy quantity @@ -1350,7 +1350,7 @@ Alamat: %4 Error: Cannot parse configuration file: %1. Only use key=value syntax. - + Kesalahan: Tidak dapat memproses pengaturan berkas: %1. Hanya menggunakan kunci= nilai sintak. Error: Invalid combination of -regtest and -testnet. @@ -1408,7 +1408,7 @@ Alamat: %4 General - + Umum Using OpenSSL version @@ -1460,7 +1460,7 @@ Alamat: %4 &Clear - + &Kosongkan Totals @@ -1504,31 +1504,31 @@ Alamat: %4 %1 B - + %1 B %1 KB - + %1 KB %1 MB - + %1 MB %1 GB - + %1 GB %1 m - + %1 menit %1 h - + %1 Jam %1 h %2 m - + %1 Jam %2 menit @@ -1551,7 +1551,7 @@ Alamat: %4 R&euse an existing receiving address (not recommended) - + Gunakan lagi alamat penerima yang ada (tidak disarankan) An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. @@ -1716,7 +1716,7 @@ Alamat: %4 automatically selected - + Pemilihan otomatis Insufficient funds! @@ -1947,7 +1947,7 @@ Alamat: %4 This is a verified payment request. - + Permintaan pembayaran terverifikasi. Enter a label for this address to add it to the list of used addresses @@ -1959,7 +1959,7 @@ Alamat: %4 This is an unverified payment request. - + Permintaan pembayaran tidak terverifikasi. Pay To: @@ -2005,7 +2005,7 @@ Alamat: %4 Alt+A - Alt+J + Alt+A Paste address from clipboard @@ -2726,7 +2726,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - + Jalankan perintah ketika perubahan transaksi dompet (%s di cmd digantikan oleh TxID) Fees smaller than this are considered zero fee (for transaction creation) (default: @@ -2790,11 +2790,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. (default: 1) - + (pengaturan awal: 1) (default: wallet.dat) - + (pengaturan awal: wallet.dat) <category> can be: @@ -2830,7 +2830,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Connection options: - + Pilih koneksi: Corrupted block database detected @@ -2858,11 +2858,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error initializing block database - + Kesalahan menginisialisasi database blok Error initializing wallet database environment %s! - + Kesalahan menginisialisasi dompet pada database%s! Error loading block database @@ -2958,7 +2958,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Importing... - + mengimpor... Incorrect or no genesis block found. Wrong datadir for network? @@ -2970,7 +2970,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Not enough file descriptors available. - + Deskripsi berkas tidak tersedia dengan cukup. Prepend debug output with timestamp (default: 1) @@ -2978,7 +2978,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. RPC client options: - + Pilihan RPC klien: Rebuild block chain index from current blk000??.dat files @@ -2998,7 +2998,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Set the number of threads to service RPC calls (default: 4) - + Mengatur jumlah urutan untuk layanan panggilan RPC (pengaturan awal: 4) Specify wallet file (within data directory) @@ -3174,11 +3174,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Start Bitcoin Core Daemon - + Memulai Bitcoin Core Daemon System error: - + Kesalahan sistem: Transaction amount too small diff --git a/src/qt/locale/bitcoin_ko_KR.ts b/src/qt/locale/bitcoin_ko_KR.ts index fb013f4c1d..8e2b681ba9 100644 --- a/src/qt/locale/bitcoin_ko_KR.ts +++ b/src/qt/locale/bitcoin_ko_KR.ts @@ -33,7 +33,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http (%1-bit) - + (%1-비트) @@ -611,7 +611,7 @@ Address: %4 (un)select all - + 모두 선택(하지 않음) Tree mode @@ -663,11 +663,11 @@ Address: %4 Lock unspent - + 비트코인이 사용되지 않은 주소를 잠금 처리합니다. Unlock unspent - + 비트코인이 사용되지 않은 주소를 잠금 해제합니다. Copy quantity @@ -767,7 +767,7 @@ Address: %4 Transactions with higher priority are more likely to get included into a block. - + 우선 순위가 높은 거래의 경우 블럭에 포함될 가능성이 더 많습니다. This label turns red, if the priority is smaller than "medium". @@ -779,11 +779,11 @@ Address: %4 This means a fee of at least %1 is required. - + 최소 %1의 거래 수수료가 필요하다는 뜻입니다. Amounts below 0.546 times the minimum relay fee are shown as dust. - + 노드 릴레이를 위한 최저 수수료의 0.546배보다 낮은 거래는 먼지 거래로 표현됩니다. This label turns red, if the change is smaller than %1. @@ -916,7 +916,7 @@ Address: %4 Set SSL root certificates for payment request (default: -system-) - + 지불 요청을 위해 SSL 최상위 인증을 설정합니다. (기본값: -system-) Show splash screen on startup (default: 1) @@ -939,11 +939,11 @@ Address: %4 As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - + 프로그램이 처음으로 실행되고 있습니다. 비트코인 코어가 어디에 데이터를 저장할지 선택할 수 있습니다. Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - + 비트코인 코어가 블럭체인의 복사본을 다운로드 저장합니다. 적어도 %1GB의 데이터가 이 폴더에 저장되며 시간이 경과할수록 점차 증가합니다. 그리고 지갑 또한 이 폴더에 저장됩니다. Use the default data directory @@ -959,7 +959,7 @@ Address: %4 Error: Specified data directory "%1" can not be created. - + 오류 : 별도 정의한 폴더명 "%1" 생성에 실패했습니다. Error @@ -1033,7 +1033,7 @@ Address: %4 Number of script &verification threads - + 스크립트 인증 쓰레드의 개수 Connect to the Bitcoin network through a SOCKS proxy. @@ -1081,11 +1081,11 @@ Address: %4 Expert - + 전문가 Enable coin &control features - + 코인 상세 제어기능을 활성화합니다 - &C 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. @@ -1173,7 +1173,7 @@ Address: %4 Whether to show coin control features or not. - + 코인 상세 제어기능에 대한 표시 여부를 선택할 수 있습니다. &OK @@ -1197,7 +1197,7 @@ Address: %4 Client restart required to activate changes. - + 변경 사항을 적용하기 위해서는 프로그램이 종료 후 재시작되어야 합니다. Client will be shutdown, do you want to proceed? @@ -1205,7 +1205,7 @@ Address: %4 This change would require a client restart. - + 이 변경 사항 적용을 위해 프로그램 재시작이 필요합니다. The supplied proxy address is invalid. @@ -1279,7 +1279,7 @@ Address: %4 Requested payment amount of %1 is too small (considered dust). - + 요청한 금액 %1의 양이 너무 적습니다. (스팸성 거래로 간주) Payment request error @@ -1295,7 +1295,7 @@ Address: %4 Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - + 현재의 프록시가 SOCKS5를 지원하지 않아 지불 요청을 수행할 수 없습니다. Payment request fetch URL is invalid: %1 @@ -1547,11 +1547,11 @@ Address: %4 Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - + 이전에 사용된 수취용 주소를 사용할려고 합니다. 주소의 재사용은 보안과 개인정보 보호 측면에서 문제를 초래할 수 있습니다. 이전 지불 요청을 재생성하는 경우가 아니라면 주소 재사용을 권하지 않습니다. R&euse an existing receiving address (not recommended) - + 현재의 수취용 주소를 재사용합니다만 권장하지는 않습니다. (R&) An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. @@ -1567,7 +1567,7 @@ Address: %4 An optional amount to request. Leave this empty or zero to not request a specific amount. - + 요청할 금액 입력칸으로 선택 사항입니다. 빈 칸으로 두거나 특정 금액이 필요하지 않는 경우 0을 입력하세요. Clear all fields of the form. @@ -1951,7 +1951,7 @@ Address: %4 Enter a label for this address to add it to the list of used addresses - + 사용된 주소 목록에 새 주소를 추가하기 위해 제목을 입력합니다. A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. @@ -1963,7 +1963,7 @@ Address: %4 Pay To: - + 송금할 대상 : Memo: @@ -2246,7 +2246,7 @@ Address: %4 Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - + 신규 채굴된 코인이 사용되기 위해서는 %1 개의 블럭이 경과되어야 합니다. 블럭을 생성할 때 블럭체인에 추가되도록 네트워크에 전파되는 과정을 거치는데, 블럭체인에 포함되지 못하고 실패한다면 해당 블럭의 상태는 '미승인'으로 표현되고 비트코인 또한 사용될 수 없습니다. 이 현상은 다른 노드가 비슷한 시간대에 동시에 블럭을 생성할 때 종종 발생할 수 있습니다. Debug information @@ -2316,7 +2316,7 @@ Address: %4 Immature (%1 confirmations, will be available after %2) - + 충분히 숙성되지 않은 상태 (%1 승인, %2 후에 사용 가능합니다) Open for %n more block(s) @@ -2348,7 +2348,7 @@ Address: %4 Confirming (%1 of %2 recommended confirmations) - + 승인 중 (권장되는 승인 회수 %2 대비 현재 승인 수 %1) Conflicted @@ -2580,7 +2580,7 @@ Address: %4 There was an error trying to save the wallet data to %1. - + 지갑 데이터를 %1 폴더에 저장하는 동안 오류가 발생했습니다. The wallet data was successfully saved to %1. @@ -2659,7 +2659,7 @@ Address: %4 Bitcoin Core RPC client version - + 비트코인 코어 RPC 클라이언트 버전 Run in the background as a daemon and accept commands @@ -2729,7 +2729,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Fees smaller than this are considered zero fee (for transaction creation) (default: - + 해당 금액보다 적은 수수료는 수수료 면제로 간주됩니다. (거래 생성의 목적)(기본값: Flush database activity from memory pool to disk log every <n> megabytes (default: 100) @@ -2789,11 +2789,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. (default: 1) - + (기본값: 1) (default: wallet.dat) - + (기본값: wallet.dat) <category> can be: @@ -2829,7 +2829,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Connection options: - + 연결 설정 : Corrupted block database detected @@ -2837,7 +2837,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Debugging/Testing options: - + 디버그 및 테스트 설정 Disable safemode, override a real safe mode event (default: 0) @@ -2929,11 +2929,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Fee per kB to add to transactions you send - + 송금 거래시 추가되는 KB 당 수수료입니다. Fees smaller than this are considered zero fee (for relaying) (default: - + 해당 금액보다 적은 수수료는 수수료 면제로 간주됩니다. (릴레이 목적)(기본값: Find peers using DNS lookup (default: 1 unless -connect) @@ -2941,7 +2941,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Force safe mode (default: 0) - + 안전 모드로 강제 진입하는 기능입니다.(기본값: 0) Generate coins (default: 0) diff --git a/src/qt/locale/bitcoin_ro_RO.ts b/src/qt/locale/bitcoin_ro_RO.ts index 1d9d4cc936..d09c40f62e 100644 --- a/src/qt/locale/bitcoin_ro_RO.ts +++ b/src/qt/locale/bitcoin_ro_RO.ts @@ -795,7 +795,7 @@ Adresa: %4 change from %1 (%2) - + restul de la %1 (%2) (change) @@ -1587,7 +1587,7 @@ Adresa: %4 Show the selected request (does the same as double clicking an entry) - + Arata cererea selectata (acelas lucru ca si dublu-click pe o inregistrare) Show @@ -3008,7 +3008,7 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo Set the number of threads to service RPC calls (default: 4) - + Stabileste numarul de thread-uri care servesc apeluri RPC (implicit: 4) Specify wallet file (within data directory) From cdb36eff9f060330a1727dec82299f255459aa2d Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Fri, 23 May 2014 13:58:12 -0300 Subject: [PATCH 0086/1288] Fix warning when compiling in OS X --- src/qt/notificator.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qt/notificator.cpp b/src/qt/notificator.cpp index 38a029dbe5..3d588cd317 100644 --- a/src/qt/notificator.cpp +++ b/src/qt/notificator.cpp @@ -28,8 +28,10 @@ #endif +#ifdef USE_DBUS // https://wiki.ubuntu.com/NotificationDevelopmentGuidelines recommends at least 128 const int FREEDESKTOP_NOTIFICATION_ICON_SIZE = 128; +#endif Notificator::Notificator(const QString &programName, QSystemTrayIcon *trayicon, QWidget *parent) : QObject(parent), From e832f5e39b3237368b8774cea2c21ac8529c5cbf Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 23 May 2014 20:35:49 +0200 Subject: [PATCH 0087/1288] doc: Add historical release notes for 0.9.1 --- doc/release-notes/release-notes-0.9.1.md | 53 ++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 doc/release-notes/release-notes-0.9.1.md diff --git a/doc/release-notes/release-notes-0.9.1.md b/doc/release-notes/release-notes-0.9.1.md new file mode 100644 index 0000000000..0552053d27 --- /dev/null +++ b/doc/release-notes/release-notes-0.9.1.md @@ -0,0 +1,53 @@ +Bitcoin Core version 0.9.1 is now available from: + + https://bitcoin.org/bin/0.9.1/ + +This is a security update. It is recommended to upgrade to this release +as soon as possible. + +It is especially important to upgrade if you currently have version +0.9.0 installed and are using the graphical interface OR you are using +bitcoind from any pre-0.9.1 version, and have enabled SSL for RPC and +have configured allowip to allow rpc connections from potentially +hostile hosts. + +Please report bugs using the issue tracker at github: + + https://github.com/bitcoin/bitcoin/issues + +How to Upgrade +-------------- + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes for older versions), then run the +installer (on Windows) or just copy over /Applications/Bitcoin-Qt (on Mac) or +bitcoind/bitcoin-qt (on Linux). + +If you are upgrading from version 0.7.2 or earlier, the first time you run +0.9.1 your blockchain files will be re-indexed, which will take anywhere from +30 minutes to several hours, depending on the speed of your machine. + +0.9.1 Release notes +======================= + +No code changes were made between 0.9.0 and 0.9.1. Only the dependencies were changed. + +- Upgrade OpenSSL to 1.0.1g. This release fixes the following vulnerabilities which can + affect the Bitcoin Core software: + + - CVE-2014-0160 ("heartbleed") + A missing bounds check in the handling of the TLS heartbeat extension can + be used to reveal up to 64k of memory to a connected client or server. + + - CVE-2014-0076 + The Montgomery ladder implementation in OpenSSL does not ensure that + certain swap operations have a constant-time behavior, which makes it + easier for local users to obtain ECDSA nonces via a FLUSH+RELOAD cache + side-channel attack. + +- Add statically built executables to Linux build + +Credits +-------- + +Credits go to the OpenSSL team for fixing the vulnerabilities quickly. From e9df7f87574b32d70aec2dad5f8d84a68c618dee Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Sat, 24 May 2014 11:12:47 -0400 Subject: [PATCH 0088/1288] Qt: Fix monospace font in osx 10.9 The "Monospace" hint was added in Qt 4.8, and it works as intended as opposed to "TypeWriter" which fails to load a font. --- src/qt/guiutil.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 7b264d27c7..49c0867450 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -76,7 +76,11 @@ QString dateTimeStr(qint64 nTime) QFont bitcoinAddressFont() { QFont font("Monospace"); +#if QT_VERSION >= 0x040800 + font.setStyleHint(QFont::Monospace); +#else font.setStyleHint(QFont::TypeWriter); +#endif return font; } From 2869b1349b2cce3ac8fa8a39e0df65e4201c438a Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Sat, 24 May 2014 11:11:42 -0400 Subject: [PATCH 0089/1288] release: Bump the OSX SDK to 10.7 for gitian builds This fixes the display on Retina Macbooks. It also moves us away from depending on the ancient XCode3 sdk. --- .../gitian-descriptors/gitian-osx-bitcoin.yml | 25 ++++++++----------- .../gitian-descriptors/gitian-osx-depends.yml | 15 ++++++----- .../gitian-descriptors/gitian-osx-native.yml | 15 ++++++----- contrib/gitian-descriptors/gitian-osx-qt.yml | 24 +++++++----------- doc/README_osx.txt | 14 +++++++---- doc/release-process.md | 8 +++--- 6 files changed, 45 insertions(+), 56 deletions(-) diff --git a/contrib/gitian-descriptors/gitian-osx-bitcoin.yml b/contrib/gitian-descriptors/gitian-osx-bitcoin.yml index aea4b93a1f..e29047d610 100644 --- a/contrib/gitian-descriptors/gitian-osx-bitcoin.yml +++ b/contrib/gitian-descriptors/gitian-osx-bitcoin.yml @@ -17,33 +17,28 @@ remotes: - "url": "https://github.com/bitcoin/bitcoin.git" "dir": "bitcoin" files: -- "osx-native-depends-r2.tar.gz" -- "osx-depends-r2.tar.gz" -- "osx-depends-qt-5.2.1-r2.tar.gz" -- "MacOSX10.6.pkg" +- "osx-native-depends-r3.tar.gz" +- "osx-depends-r3.tar.gz" +- "osx-depends-qt-5.2.1-r3.tar.gz" +- "MacOSX10.7.sdk.tar.gz" script: | - echo "a2ccf2299de4e0bb88bd17a3355f02b747575b97492c7c2f5b789a64ccc4cbd6 MacOSX10.6.pkg" | sha256sum -c - HOST=x86_64-apple-darwin11 PREFIX=`pwd`/osx-cross-depends/prefix - SDK=`pwd`/osx-cross-depends/SDKs/MacOSX10.6.sdk + SDK=`pwd`/osx-cross-depends/SDKs/MacOSX10.7.sdk NATIVEPREFIX=`pwd`/osx-cross-depends/native-prefix export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" export SOURCES_PATH=`pwd` - mkdir osx-cross-depends + mkdir -p osx-cross-depends/SDKs - cd osx-cross-depends - mkdir -p SDKs - 7z -bd -so -y e ${SOURCES_PATH}/MacOSX10.6.pkg Payload | gzip -d -c | cpio -i - cd .. + tar -C osx-cross-depends/SDKs -xf ${SOURCES_PATH}/MacOSX10.7.sdk.tar.gz - tar -C osx-cross-depends -xf osx-native-depends-r2.tar.gz - tar -C osx-cross-depends -xf osx-depends-r2.tar.gz - tar -C osx-cross-depends -xf osx-depends-qt-5.2.1-r2.tar.gz + tar -C osx-cross-depends -xf osx-native-depends-r3.tar.gz + tar -C osx-cross-depends -xf osx-depends-r3.tar.gz + tar -C osx-cross-depends -xf osx-depends-qt-5.2.1-r3.tar.gz export PATH=`pwd`/osx-cross-depends/native-prefix/bin:$PATH cd bitcoin diff --git a/contrib/gitian-descriptors/gitian-osx-depends.yml b/contrib/gitian-descriptors/gitian-osx-depends.yml index 8e91a30ded..adc86e5cb4 100644 --- a/contrib/gitian-descriptors/gitian-osx-depends.yml +++ b/contrib/gitian-descriptors/gitian-osx-depends.yml @@ -18,8 +18,8 @@ files: - "openssl-1.0.1g.tar.gz" - "protobuf-2.5.0.tar.bz2" - "qrencode-3.4.3.tar.bz2" -- "MacOSX10.6.pkg" -- "osx-native-depends-r2.tar.gz" +- "MacOSX10.7.sdk.tar.gz" +- "osx-native-depends-r3.tar.gz" script: | @@ -29,9 +29,8 @@ script: | echo "53cb818c3b90e507a8348f4f5eaedb05d8bfe5358aabb508b7263cc670c3e028 openssl-1.0.1g.tar.gz" | sha256sum -c echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c echo "dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b50597a98 qrencode-3.4.3.tar.bz2" | sha256sum -c - echo "a2ccf2299de4e0bb88bd17a3355f02b747575b97492c7c2f5b789a64ccc4cbd6 MacOSX10.6.pkg" | sha256sum -c - REVISION=r2 + REVISION=r3 export SOURCES_PATH=`pwd` export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" export PATH=$HOME:$PATH @@ -44,7 +43,7 @@ script: | PREFIX=`pwd`/prefix NATIVEPREFIX=`pwd`/native-prefix BUILD_BASE=`pwd`/build - SDK=`pwd`/SDKs/MacOSX10.6.sdk + SDK=`pwd`/SDKs/MacOSX10.7.sdk HOST=x86_64-apple-darwin11 MIN_VERSION=10.6 @@ -70,10 +69,10 @@ script: | mkdir -p ${PREFIX}/lib mkdir -p ${BUILD_BASE} - mkdir -p ${SDK} - 7z -bd -so -y e ${SOURCES_PATH}/MacOSX10.6.pkg Payload | gzip -d -c | cpio -i + mkdir -p SDKs + tar -C SDKs -xf ${SOURCES_PATH}/MacOSX10.7.sdk.tar.gz - tar xf /home/ubuntu/build/osx-native-depends-r2.tar.gz + tar xf /home/ubuntu/build/osx-native-depends-r3.tar.gz # bdb SOURCE_FILE=${SOURCES_PATH}/db-4.8.30.NC.tar.gz diff --git a/contrib/gitian-descriptors/gitian-osx-native.yml b/contrib/gitian-descriptors/gitian-osx-native.yml index 6040e5ac5b..a753ad704f 100644 --- a/contrib/gitian-descriptors/gitian-osx-native.yml +++ b/contrib/gitian-descriptors/gitian-osx-native.yml @@ -24,7 +24,7 @@ files: - "dyld-195.5.tar.gz" - "ld64-127.2.tar.gz" - "protobuf-2.5.0.tar.bz2" -- "MacOSX10.6.pkg" +- "MacOSX10.7.sdk.tar.gz" - "cdrkit-1.1.11.tar.gz" - "libdmg-hfsplus-v0.1.tar.gz" - "clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz" @@ -38,14 +38,13 @@ script: | echo "2cf0484c87cf79b606b351a7055a247dae84093ae92c747a74e0cde2c8c8f83c dyld-195.5.tar.gz" | sha256sum -c echo "97b75547b2bd761306ab3e15ae297f01e7ab9760b922bc657f4ef72e4e052142 ld64-127.2.tar.gz" | sha256sum -c echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c - echo "a2ccf2299de4e0bb88bd17a3355f02b747575b97492c7c2f5b789a64ccc4cbd6 MacOSX10.6.pkg" | sha256sum -c echo "d1c030756ecc182defee9fe885638c1785d35a2c2a297b4604c0e0dcc78e47da cdrkit-1.1.11.tar.gz" | sha256sum -c echo "6569a02eb31c2827080d7d59001869ea14484c281efab0ae7f2b86af5c3120b3 libdmg-hfsplus-v0.1.tar.gz" | sha256sum -c echo "b9d57a88f9514fa1f327a1a703756d0c1c960f4c58494a5bd80313245d13ffff clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz" | sha256sum -c echo "cc12bdbd7a09f71cb2a6a3e6ec3e0abe885ca7111c2b47857f5095e5980caf4f cdrkit-deterministic.patch" | sha256sum -c - REVISION=r2 + REVISION=r3 export REFERENCE_DATETIME export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" export FAKETIME=$REFERENCE_DATETIME @@ -78,7 +77,7 @@ script: | NATIVEPREFIX=`pwd`/native-prefix BUILD_BASE=`pwd`/build - SDK=`pwd`/SDKs/MacOSX10.6.sdk + SDK=`pwd`/SDKs/MacOSX10.7.sdk HOST=x86_64-apple-darwin11 MIN_VERSION=10.6 @@ -91,8 +90,8 @@ script: | mkdir -p ${NATIVEPREFIX}/bin mkdir -p ${NATIVEPREFIX}/lib - mkdir -p ${SDK} - 7z -bd -so -y e ${SOURCES_PATH}/MacOSX10.6.pkg Payload | gzip -d -c | cpio -i + mkdir -p SDKs + tar -C SDKs -xf ${SOURCES_PATH}/MacOSX10.7.sdk.tar.gz # Clang SOURCE_FILE=${SOURCES_PATH}/clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz @@ -112,7 +111,7 @@ script: | tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} mkdir -p ${BUILD_DIR}/sdks pushd ${BUILD_DIR}/sdks; - ln -sf ${SDK} MacOSX10.6.sdk + ln -sf ${SDK} MacOSX10.7.sdk ln -sf ${SOURCES_PATH}/cctools-809.tar.gz ${BUILD_DIR}/cctools2odcctools/cctools-809.tar.gz ln -sf ${SOURCES_PATH}/ld64-127.2.tar.gz ${BUILD_DIR}/cctools2odcctools/ld64-127.2.tar.gz ln -sf ${SOURCES_PATH}/dyld-195.5.tar.gz ${BUILD_DIR}/cctools2odcctools/dyld-195.5.tar.gz @@ -127,7 +126,7 @@ script: | sed -i 's/\# Dynamically linked LTO/\t ;\&\n\t linux*)\n# Dynamically linked LTO/' ${BUILD_DIR}/cctools2odcctools/files/configure.ac cd ${BUILD_DIR}/cctools2odcctools - ./extract.sh --osxver 10.6 + ./extract.sh --osxver 10.7 cd odcctools-809 ./configure --prefix=${NATIVEPREFIX} --target=${HOST} CFLAGS="${CFLAGS} -I${NATIVEPREFIX}/include -D__DARWIN_UNIX03 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS" LDFLAGS="${LDFLAGS} -Wl,-rpath=\\\$\$ORIGIN/../lib" --with-sysroot=${SDK} diff --git a/contrib/gitian-descriptors/gitian-osx-qt.yml b/contrib/gitian-descriptors/gitian-osx-qt.yml index d0be016e68..b57908dbd9 100644 --- a/contrib/gitian-descriptors/gitian-osx-qt.yml +++ b/contrib/gitian-descriptors/gitian-osx-qt.yml @@ -13,16 +13,15 @@ reference_datetime: "2013-06-01 00:00:00" remotes: [] files: - "qt-everywhere-opensource-src-5.2.1.tar.gz" -- "osx-native-depends-r2.tar.gz" -- "osx-depends-r2.tar.gz" -- "MacOSX10.6.pkg" +- "osx-native-depends-r3.tar.gz" +- "osx-depends-r3.tar.gz" +- "MacOSX10.7.sdk.tar.gz" script: | echo "84e924181d4ad6db00239d87250cc89868484a14841f77fb85ab1f1dbdcd7da1 qt-everywhere-opensource-src-5.2.1.tar.gz" | sha256sum -c - echo "a2ccf2299de4e0bb88bd17a3355f02b747575b97492c7c2f5b789a64ccc4cbd6 MacOSX10.6.pkg" | sha256sum -c - REVISION=r2 + REVISION=r3 export SOURCES_PATH=`pwd` export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" export ZERO_AR_DATE=1 @@ -42,7 +41,7 @@ script: | PREFIX=`pwd`/prefix NATIVEPREFIX=`pwd`/native-prefix BUILD_BASE=`pwd`/build - SDK=`pwd`/SDKs/MacOSX10.6.sdk + SDK=`pwd`/SDKs/MacOSX10.7.sdk HOST=x86_64-apple-darwin11 MIN_VERSION=10.6 @@ -68,18 +67,13 @@ script: | mkdir -p ${PREFIX}/lib mkdir -p ${BUILD_BASE} - mkdir -p ${SDK} - 7z -bd -so -y e ${SOURCES_PATH}/MacOSX10.6.pkg Payload | gzip -d -c | cpio -i - - tar xf /home/ubuntu/build/osx-native-depends-r2.tar.gz - - mkdir -p SDKs - 7z -bd -so -y e ${SOURCES_PATH}/MacOSX10.6.pkg Payload | gzip -d -c | cpio -i + tar -C SDKs -xf ${SOURCES_PATH}/MacOSX10.7.sdk.tar.gz + + tar xf /home/ubuntu/build/osx-native-depends-r3.tar.gz - tar xf /home/ubuntu/build/osx-native-depends-r2.tar.gz export PATH=`pwd`/native-prefix/bin:$PATH - tar xf /home/ubuntu/build/osx-depends-r2.tar.gz + tar xf /home/ubuntu/build/osx-depends-r3.tar.gz SOURCE_FILE=${SOURCES_PATH}/qt-everywhere-opensource-src-5.2.1.tar.gz BUILD_DIR=${BUILD_BASE}/qt-everywhere-opensource-src-5.2.1 diff --git a/doc/README_osx.txt b/doc/README_osx.txt index 6eae4f5cf1..2be56c1592 100644 --- a/doc/README_osx.txt +++ b/doc/README_osx.txt @@ -37,11 +37,15 @@ originally done in toolchain4. To complicate things further, all builds must target an Apple SDK. These SDKs are free to download, but not redistributable. -To obtain it, register for a developer account, then download xcode_3.2.6_and_ios_sdk_4.3.dmg: -https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_3.2.6_and_ios_sdk_4.3__final/xcode_3.2.6_and_ios_sdk_4.3.dmg -This file is several gigabytes in size, but only a single .pkg file inside is -needed (MacOSX10.6.pkg). From Linux, 7-zip can be used to extract this file. -The DMG can then be discarded. +To obtain it, register for a developer account, then download xcode4630916281a.dmg: +https://developer.apple.com/downloads/download.action?path=Developer_Tools/xcode_4.6.3/xcode4630916281a.dmg +This file is several gigabytes in size, but only a single directory inside is +needed: Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk + +Unfortunately, the usual linux tools (7zip, hpmount, loopback mount) are incapable of opening this file. +To create a tarball suitable for gitian input, mount the dmg in OSX, then create it with: + $ tar -C /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ -czf MacOSX10.7.sdk.tar.gz MacOSX10.7.sdk + The gitian descriptors build 2 sets of files: Linux tools, then Apple binaries which are created using these tools. The build process has been designed to diff --git a/doc/release-process.md b/doc/release-process.md index be00cb8092..6d08c48496 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -36,12 +36,10 @@ Release Process mkdir -p inputs; cd inputs/ Register and download the Apple SDK (see OSX Readme for details) - visit https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_3.2.6_and_ios_sdk_4.3__final/xcode_3.2.6_and_ios_sdk_4.3.dmg + visit https://developer.apple.com/downloads/download.action?path=Developer_Tools/xcode_4.6.3/xcode4630916281a.dmg - Extract MacOSX10.6.pkg using 7zip - 7z e -y xcode_3.2.6_and_ios_sdk_4.3.dmg 5.hfs - 7z -y e 5.hfs "Xcode and iOS SDK/Packages/MacOSX10.6.pkg" - rm 5.hfs + Using a Mac, create a tarball for the 10.7 SDK + tar -C /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ -czf MacOSX10.7.sdk.tar.gz MacOSX10.7.sdk Fetch and build inputs: (first time, or when dependency versions change) From b90711cabffa8bf83ddee98cfc179c0aef5732ef Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Wed, 28 May 2014 01:38:40 +0200 Subject: [PATCH 0090/1288] [Qt] Fix Transaction details shows wrong To: --- src/qt/transactiondesc.cpp | 33 +++++++++++++------------------- src/qt/transactiondesc.h | 3 ++- src/qt/transactiontablemodel.cpp | 2 +- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 45fb3d40c2..0cfcb048c8 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -42,7 +42,7 @@ QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx) } } -QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, int vout, int unit) +QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionRecord *rec, int unit) { QString strHTML; @@ -86,26 +86,19 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, int vout, int u if (nNet > 0) { // Credit - BOOST_FOREACH(const CTxOut& txout, wtx.vout) + if (CBitcoinAddress(rec->address).IsValid()) { - if (wallet->IsMine(txout)) + CTxDestination address = CBitcoinAddress(rec->address).Get(); + if (wallet->mapAddressBook.count(address)) { - CTxDestination address; - if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*wallet, address)) - { - if (wallet->mapAddressBook.count(address)) - { - strHTML += "" + tr("From") + ": " + tr("unknown") + "
"; - strHTML += "" + tr("To") + ": "; - strHTML += GUIUtil::HtmlEscape(CBitcoinAddress(address).ToString()); - if (!wallet->mapAddressBook[address].name.empty()) - strHTML += " (" + tr("own address") + ", " + tr("label") + ": " + GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + ")"; - else - strHTML += " (" + tr("own address") + ")"; - strHTML += "
"; - } - } - break; + strHTML += "" + tr("From") + ": " + tr("unknown") + "
"; + strHTML += "" + tr("To") + ": "; + strHTML += GUIUtil::HtmlEscape(rec->address); + if (!wallet->mapAddressBook[address].name.empty()) + strHTML += " (" + tr("own address") + ", " + tr("label") + ": " + GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + ")"; + else + strHTML += " (" + tr("own address") + ")"; + strHTML += "
"; } } } @@ -224,7 +217,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, int vout, int u if (wtx.mapValue.count("comment") && !wtx.mapValue["comment"].empty()) strHTML += "
" + tr("Comment") + ":
" + GUIUtil::HtmlEscape(wtx.mapValue["comment"], true) + "
"; - strHTML += "" + tr("Transaction ID") + ": " + TransactionRecord::formatSubTxId(wtx.GetHash(), vout) + "
"; + strHTML += "" + tr("Transaction ID") + ": " + TransactionRecord::formatSubTxId(wtx.GetHash(), rec->idx) + "
"; // Message from normal bitcoin:URI (bitcoin:123...?message=example) foreach (const PAIRTYPE(string, string)& r, wtx.vOrderForm) diff --git a/src/qt/transactiondesc.h b/src/qt/transactiondesc.h index 92d093b3eb..f5a1328a71 100644 --- a/src/qt/transactiondesc.h +++ b/src/qt/transactiondesc.h @@ -8,6 +8,7 @@ #include #include +class TransactionRecord; class CWallet; class CWalletTx; @@ -18,7 +19,7 @@ class TransactionDesc: public QObject Q_OBJECT public: - static QString toHTML(CWallet *wallet, CWalletTx &wtx, int vout, int unit); + static QString toHTML(CWallet *wallet, CWalletTx &wtx, TransactionRecord *rec, int unit); private: TransactionDesc() {} diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 8cf2b0a1b1..b9fcd0d6b0 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -222,7 +222,7 @@ public: std::map::iterator mi = wallet->mapWallet.find(rec->hash); if(mi != wallet->mapWallet.end()) { - return TransactionDesc::toHTML(wallet, mi->second, rec->idx, unit); + return TransactionDesc::toHTML(wallet, mi->second, rec, unit); } } return QString(""); From d2b82dd7d8cdc87555d1983e47fe10a7b92f2d87 Mon Sep 17 00:00:00 2001 From: Mathy Vanvoorden Date: Fri, 9 May 2014 12:52:08 +0200 Subject: [PATCH 0091/1288] Spelling fix in comment Rebased-By: Wladimir J. van der Laan Rebased-From: 3704a6a --- src/qt/bitcoingui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index e6190aec13..68ae8b4668 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -188,7 +188,7 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); - // prevents an oben debug window from becoming stuck/unusable on client shutdown + // prevents an open debug window from becoming stuck/unusable on client shutdown connect(quitAction, SIGNAL(triggered()), rpcConsole, SLOT(hide())); // Install event filter to be able to catch status tip events (QEvent::StatusTip) From 066d9a53c79db63b019e38be7995440f9fcfe7ff Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Thu, 29 May 2014 05:21:58 +0200 Subject: [PATCH 0092/1288] [Qt] Fix Start bitcoin on system login --- src/qt/guiutil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 49c0867450..183fcac4a0 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -574,7 +574,7 @@ bool SetStartOnSystemStartup(bool fAutoStart) return true; } -#elif defined(LINUX) +#elif defined(Q_OS_LINUX) // Follow the Desktop Application Autostart Spec: // http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html From 53a088154ce4e1fc483afa120a9063811dd0e7ea Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 29 May 2014 12:33:17 +0200 Subject: [PATCH 0093/1288] rename fNoListen to fListen and move to net - better code readability and it belongs to net - this is a prerequisite for a pull to add -listen to the GUI --- src/init.cpp | 4 ++-- src/main.cpp | 4 ++-- src/net.cpp | 3 ++- src/net.h | 1 + src/util.cpp | 1 - src/util.h | 1 - 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index bc4924b48d..06ad84af25 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -732,12 +732,12 @@ bool AppInit2(boost::thread_group& threadGroup) } // see Step 2: parameter interactions for more information about these - fNoListen = !GetBoolArg("-listen", true); + fListen = GetBoolArg("-listen", true); fDiscover = GetBoolArg("-discover", true); fNameLookup = GetBoolArg("-dns", true); bool fBound = false; - if (!fNoListen) { + if (fListen) { if (mapArgs.count("-bind")) { BOOST_FOREACH(std::string strBind, mapMultiArgs["-bind"]) { CService addrBind; diff --git a/src/main.cpp b/src/main.cpp index 18c00d90ac..5f61a13782 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3550,7 +3550,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) if (!pfrom->fInbound) { // Advertise our address - if (!fNoListen && !IsInitialBlockDownload()) + if (fListen && !IsInitialBlockDownload()) { CAddress addr = GetLocalAddress(&pfrom->addr); if (addr.IsRoutable()) @@ -4318,7 +4318,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) pnode->setAddrKnown.clear(); // Rebroadcast our address - if (!fNoListen) + if (fListen) { CAddress addr = GetLocalAddress(&pnode->addr); if (addr.IsRoutable()) diff --git a/src/net.cpp b/src/net.cpp index c2dde97040..ef6674011b 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -45,6 +45,7 @@ static const int MAX_OUTBOUND_CONNECTIONS = 8; // Global state variables // bool fDiscover = true; +bool fListen = true; uint64_t nLocalServices = NODE_NETWORK; CCriticalSection cs_mapLocalHost; map mapLocalHost; @@ -96,7 +97,7 @@ unsigned short GetListenPort() // find 'best' local address for a particular peer bool GetLocal(CService& addr, const CNetAddr *paddrPeer) { - if (fNoListen) + if (!fListen) return false; int nBestScore = -1; diff --git a/src/net.h b/src/net.h index ac90ef25ef..55502ed893 100644 --- a/src/net.h +++ b/src/net.h @@ -105,6 +105,7 @@ CAddress GetLocalAddress(const CNetAddr *paddrPeer = NULL); extern bool fDiscover; +extern bool fListen; extern uint64_t nLocalServices; extern uint64_t nLocalHostNonce; extern CAddrMan addrman; diff --git a/src/util.cpp b/src/util.cpp index 336ef31725..d106b03230 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -94,7 +94,6 @@ bool fPrintToDebugLog = true; bool fDaemon = false; bool fServer = false; string strMiscWarning; -bool fNoListen = false; bool fLogTimestamps = false; volatile bool fReopenDebugLog = false; CClientUIInterface uiInterface; diff --git a/src/util.h b/src/util.h index ffcb20d822..b09f9bb15e 100644 --- a/src/util.h +++ b/src/util.h @@ -100,7 +100,6 @@ extern bool fPrintToConsole; extern bool fPrintToDebugLog; extern bool fServer; extern std::string strMiscWarning; -extern bool fNoListen; extern bool fLogTimestamps; extern volatile bool fReopenDebugLog; From 58bfa79f0e277c34b20279c2fef56ec9c1ca2479 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 29 May 2014 12:13:02 -0400 Subject: [PATCH 0094/1288] gitian: Add cfields to gitian download scripts --- contrib/gitian-downloader/cfields-key.php | 52 +++++++++++++++++++ .../gitian-downloader/linux-download-config | 3 ++ .../gitian-downloader/win32-download-config | 3 ++ 3 files changed, 58 insertions(+) create mode 100644 contrib/gitian-downloader/cfields-key.php diff --git a/contrib/gitian-downloader/cfields-key.php b/contrib/gitian-downloader/cfields-key.php new file mode 100644 index 0000000000..6b0bd240ba --- /dev/null +++ b/contrib/gitian-downloader/cfields-key.php @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.12 (GNU/Linux) + +mQINBFOHTh4BEADdKsRvmNhX+B+bcPsgMkp8ztwJA5g/rmrOlHQpKOOf4P2tAr6w +FmXCChWF9Iq3pDFQ0t0iq5rgisFPyrGVT/VToMmH+/PSLTyIdAlgkRYDMAPsMAFV +MaADH4yiAgJ3cdXtysjaNQV5O25ypqq6/obUjZJD5Enn6b/UgHe2+7LTmTNsskOx +5s/WPPht79EY1kM4JQfmDx68CsmqeSAlT6yeO3RQcLn/l46cfXiwzMO4h1hsZS1r +pgciRp0EHK9uAjF2rjqt8v4SDxwyTnwfpBBulzvH9mBf+HRXWzoTMR4sC/oOZext +hKAH/ex47BxN3HU3ftNhCK2c1xcU1UOGSjbf0RdbwuSCxxa7mktEDumvOxAk9EBB ++PDPv7jO1FBK3rsJdscYQIL0AiRyO49VfNLARa34OqUi8pOAxKBQ9plO02W1gp7a +DVBPI05TZ46Y8dTR2Bc1raAgOyxnXM7jfiQG2gSULiKAJAI4HwOiodaiiHAxDaIo +a3mtsmfN25TZUQuA0I0BvHbJvLRlVnyZm3XVOcwReKJpZJV4qRhd3XNrERZdz6ZK +cAZnyC/X+Uzo4HfnVSsJk1GpIa4seYyrVCFfHMiAA6SkgAUFbV26KCOv4rNR2GlV +l2fVhu1RKOEUJ8nRcEqf93SehRVYdI67LepIPgmIwi0KG4HhoTbIHDAKWQARAQAB +tCtDb3J5IEZpZWxkcyA8Y2ZpZWxkc0BiaXRjb2luZm91bmRhdGlvbi5vcmc+iQI4 +BBMBAgAiBQJTh04eAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRAcJJH/ +6w73cBTiEADIGZSueBFmaOTJCgasKGguHns/n8P94EQBZr07rrgN99Rzp85WvDUN +Qa72wj3GNcAffN7aZlIWv4g+fjyr9AzHekjI/7iwwSYIfjfTR/xRUW7czRfKAOrK +iwpEzgv440i7PBvkS/AhNdUNkm+cJvaQUej/F2/O52qDLEpHuzvjAUUWlSeF9/oO +AjM9dfC24L5k5cVwQvH9noxk3EyuE7BuiGE5a+kKiORrtxiHeUG6GYQxuqrPucLU +fI67ETyXa0YSpYm5/O65BKMTMpmkMvv1JC2kqqsYTrO5p158CrKzq2xvpuG4ABsb +9KwICUGW31Ndr6TXwQJFa1b7VK4G1g6M1DFkVTOLJnEyOwgYxsXrV5QFpzpAOAji +6KcxNGeow1avAFYbqjjLgu9UNuq6b8du13hjkQxVs2NAP1Kd/u2ADwxQHMhZGVEC +9LIcLVSP9ShY6fR8m6fwSlJfpiV81uLNVD8KIyvp+pYTQ/FnxoPhPIwalYquBZKi +0u38igW75IzZ0fYvJgTumE/8ofSVkutVtrQb21eJclVrJGMNweTlJcJhAWdKkjDC +e6mSj8GItKV1ef+eusXSzs/wPyTaqgkELvvAOZdwUq3kobQErE5HOuPEOvcwuY96 +DcxLexirCGW5wCUq7Db0c0dUjQwzzb5OTW2jdnPVR0qxi29TnOJ2aLkCDQRTh04e +ARAAuJKpI6NTCQrjEqe9AYywN8676+fPS5bqXkyb/iub6MXeQdwpH0K42lXAaYMq +ow/0aLlvGWCHuJJGozoOWpTzQ+VPbhpdARoLCop5fYTpy8Q17ubLeeODDtr6jtDN +lmg+9PBIErIVUnUS2wNZuJRVsfwlLaU3T2v8kQnQ6AEbl/QwyWW9nB8rAWBu6Hvs +VdtcBmtHSr9xAGBGfW6rSVhTitikR4lWJPdNJxI3pLaswpLIUIQ1rssKO4glljcp +C6nhMvRkDLvDFvDP9QnmwY/A4ch5S6ANPrhOjQuu9njjQ+/ImrJTjAXqHwg5KdTc +NKxufgvi9elOQ422o0No3yKdRoRA4kdcUmqA9gNZDyX0ZTd17aNqc42Zt3aYLJ11 +bLZZp0qnfhkmhbsBZZtaLNkuF+RGPWysxY7KPMm+nHn6f3Wpr18E+T02wi02r4nS +HOQI+gppDqy3Vq3ZZNoUZynctiLZVHkqi+WYXqfD2tEn8UJKpht7jrZlNgkHFgT7 +T0/U4+JmaQ/HltE+IexAIH0GP0Jt6hmRoZimdoy8Q8NY5t/fn9CQNJm5InrHvooN +aFmZMvzGTGiTqBqnA/7k9FCUEG98LK11MsIssY8YE/F6HD69R3ISyRvhUbpFvhD8 +c6zOkEKngTWvyRevrDrDz2yoZ1+T1X350+92rbEc/8WyutcAEQEAAYkCHwQYAQIA +CQUCU4dOHgIbDAAKCRAcJJH/6w73cAakEACv4EUEjtFjqnGB0Lru5FKs1obWcf37 +c4a5yYvOw58dkEZ9hsq34qWGLT128n6R24KEG+3O4CbplAD5Kt2eAPracbPHMAn8 +TGmC+KjiGlBR5xCY9dD0fn5EbRWOa+Fdcj1DpneaqMl9vLnBbqGp7pa/MwSOc+FB +0Ms2rcGJJMNHgITfP22eCf6pvf/xq7kKbUJ3Kjqdc2hWlRMjC/OOeITdrgycfDk/ +AOzLNqk5q7bYOxna6rWDLGSkCATyQKaBTVK7wRd1VrIhI4vfFqy+BWYXyXJ0pxjS +eaCDwbWHX/KW+0qLsmHxFMAyHJPjs8LEwK/DRbmWhe1HzPcBKmpyjqlkuxPjAdSl +hP4+IBvVNLf2Kh3uFHehk9A6oCYZGe3lLfQnOxIantXF7IROTmiZZsb+08w6cIXE ++r6kWG6vP2aCVtzYNfY+2p5xfg3yMxcxENJki1WSCOq6WVf9IWFzSJu+0+eazD3L +3QpZoSX5VvT6x05C0Ay1ert0Q5MyF84Eh8mDqL4PhpWtQhZMp8SG4jqFVgrhM4sl +vWGYXGns4tbnNPiiksjBD8TTvG3+mt48sNJIpHThjdWJSZjllYG7jV8oi7HrX8M2 +LOwWWLYxHkqi9wpmrWHSmniex6ABozcqrb+EgSMnHuSd7glmOJxHToJIudJbKG5D +MrD0ofsytfy1LQ== +=DE4h +-----END PGP PUBLIC KEY BLOCK----- diff --git a/contrib/gitian-downloader/linux-download-config b/contrib/gitian-downloader/linux-download-config index b5e0561aa3..f5e6382b84 100644 --- a/contrib/gitian-downloader/linux-download-config +++ b/contrib/gitian-downloader/linux-download-config @@ -37,3 +37,6 @@ signers: E944AE667CF960B1004BC32FCA662BE18B877A60: name: "Andreas Schildbach" key: aschildbach + C060A6635913D98A3587D7DB1C2491FFEB0EF770: + name: "Cory Fields" + key: "cfields" diff --git a/contrib/gitian-downloader/win32-download-config b/contrib/gitian-downloader/win32-download-config index 5d56db863e..06c164180d 100644 --- a/contrib/gitian-downloader/win32-download-config +++ b/contrib/gitian-downloader/win32-download-config @@ -37,3 +37,6 @@ signers: E944AE667CF960B1004BC32FCA662BE18B877A60: name: "Andreas Schildbach" key: aschildbach + C060A6635913D98A3587D7DB1C2491FFEB0EF770: + name: "Cory Fields" + key: "cfields" From b5ef85c7a22f6aa67d2241936f083c6c81702fb1 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 29 May 2014 18:17:34 +0200 Subject: [PATCH 0095/1288] No references to centralized databases in help text. --- src/rpcwallet.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index a8f267d7fc..e3b35dbb04 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -318,7 +318,7 @@ Value sendtoaddress(const Array& params, bool fHelp) " to which you're sending the transaction. This is not part of the \n" " transaction, just kept in your wallet.\n" "\nResult:\n" - "\"transactionid\" (string) The transaction id. (view at https://blockchain.info/tx/[transactionid])\n" + "\"transactionid\" (string) The transaction id.\n" "\nExamples:\n" + HelpExampleCli("sendtoaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1") + HelpExampleCli("sendtoaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1 \"donation\" \"seans outpost\"") @@ -747,7 +747,7 @@ Value sendfrom(const Array& params, bool fHelp) " to which you're sending the transaction. This is not part of the transaction, \n" " it is just kept in your wallet.\n" "\nResult:\n" - "\"transactionid\" (string) The transaction id. (view at https://blockchain.info/tx/[transactionid])\n" + "\"transactionid\" (string) The transaction id.\n" "\nExamples:\n" "\nSend 0.01 btc from the default account to the address, must have at least 1 confirmation\n" + HelpExampleCli("sendfrom", "\"\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01") + @@ -807,7 +807,7 @@ Value sendmany(const Array& params, bool fHelp) "4. \"comment\" (string, optional) A comment\n" "\nResult:\n" "\"transactionid\" (string) The transaction id for the send. Only 1 transaction is created regardless of \n" - " the number of addresses. See https://blockchain.info/tx/[transactionid]\n" + " the number of addresses.\n" "\nExamples:\n" "\nSend two amounts to two different addresses:\n" + HelpExampleCli("sendmany", "\"tabby\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\"") + @@ -1209,8 +1209,7 @@ Value listtransactions(const Array& params, bool fHelp) " category of transactions.\n" " \"blockindex\": n, (numeric) The block index containing the transaction. Available for 'send' and 'receive'\n" " category of transactions.\n" - " \"txid\": \"transactionid\", (string) The transaction id (see https://blockchain.info/tx/[transactionid]. Available \n" - " for 'send' and 'receive' category of transactions.\n" + " \"txid\": \"transactionid\", (string) The transaction id. Available for 'send' and 'receive' category of transactions.\n" " \"time\": xxx, (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\n" " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT). Available \n" " for 'send' and 'receive' category of transactions.\n" @@ -1375,7 +1374,7 @@ Value listsinceblock(const Array& params, bool fHelp) " \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction. Available for 'send' and 'receive' category of transactions.\n" " \"blockindex\": n, (numeric) The block index containing the transaction. Available for 'send' and 'receive' category of transactions.\n" " \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n" - " \"txid\": \"transactionid\", (string) The transaction id (see https://blockchain.info/tx/[transactionid]. Available for 'send' and 'receive' category of transactions.\n" + " \"txid\": \"transactionid\", (string) The transaction id. Available for 'send' and 'receive' category of transactions.\n" " \"time\": xxx, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT).\n" " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (Jan 1 1970 GMT). Available for 'send' and 'receive' category of transactions.\n" " \"comment\": \"...\", (string) If a comment is associated with the transaction.\n" @@ -1447,7 +1446,7 @@ Value gettransaction(const Array& params, bool fHelp) " \"blockhash\" : \"hash\", (string) The block hash\n" " \"blockindex\" : xx, (numeric) The block index\n" " \"blocktime\" : ttt, (numeric) The time in seconds since epoch (1 Jan 1970 GMT)\n" - " \"txid\" : \"transactionid\", (string) The transaction id, see also https://blockchain.info/tx/[transactionid]\n" + " \"txid\" : \"transactionid\", (string) The transaction id.\n" " \"time\" : ttt, (numeric) The transaction time in seconds since epoch (1 Jan 1970 GMT)\n" " \"timereceived\" : ttt, (numeric) The time received in seconds since epoch (1 Jan 1970 GMT)\n" " \"details\" : [\n" From 21790821da80f885049095c72086968e0d5e5a08 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Thu, 29 May 2014 12:51:14 -0400 Subject: [PATCH 0096/1288] Fix name of Cory's pgp key --- contrib/gitian-downloader/{cfields-key.php => cfields-key.pgp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename contrib/gitian-downloader/{cfields-key.php => cfields-key.pgp} (100%) diff --git a/contrib/gitian-downloader/cfields-key.php b/contrib/gitian-downloader/cfields-key.pgp similarity index 100% rename from contrib/gitian-downloader/cfields-key.php rename to contrib/gitian-downloader/cfields-key.pgp From c21c74bec43a693283fecbdfb62fee4523317a81 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 29 May 2014 15:30:46 -0400 Subject: [PATCH 0097/1288] osx: Fix missing dock menu with qt5 Qt5 Removed the qt_mac_set_dock_menu function and left no replacement. It was later re-added and deprecated for backwards-compatibility. Qt5.2 adds the non-deprecated QMenu::setAsDockMenu(). Use that when possible. --- src/qt/macdockiconhandler.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qt/macdockiconhandler.mm b/src/qt/macdockiconhandler.mm index 64291c9188..74fb64ace3 100644 --- a/src/qt/macdockiconhandler.mm +++ b/src/qt/macdockiconhandler.mm @@ -62,6 +62,8 @@ MacDockIconHandler::MacDockIconHandler() : QObject() this->setMainWindow(NULL); #if QT_VERSION < 0x050000 qt_mac_set_dock_menu(this->m_dockMenu); +#elif QT_VERSION >= 0x050200 + this->m_dockMenu->setAsDockMenu(); #endif [pool release]; } From 5823449e2d7f76fa1f24fed881a8a5041b34b6bf Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 30 May 2014 12:01:20 +0200 Subject: [PATCH 0098/1288] Limit number of known addresses per peer --- src/mruset.h | 1 + src/net.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mruset.h b/src/mruset.h index c36a0c8f37..c1c08b0288 100644 --- a/src/mruset.h +++ b/src/mruset.h @@ -32,6 +32,7 @@ public: bool empty() const { return set.empty(); } iterator find(const key_type& k) const { return set.find(k); } size_type count(const key_type& k) const { return set.count(k); } + void clear() { set.clear(); queue.clear(); } bool inline friend operator==(const mruset& a, const mruset& b) { return a.set == b.set; } bool inline friend operator==(const mruset& a, const std::set& b) { return a.set == b; } bool inline friend operator<(const mruset& a, const mruset& b) { return a.set < b.set; } diff --git a/src/net.h b/src/net.h index ac90ef25ef..d3346873bc 100644 --- a/src/net.h +++ b/src/net.h @@ -262,7 +262,7 @@ public: // flood relay std::vector vAddrToSend; - std::set setAddrKnown; + mruset setAddrKnown; bool fGetAddr; std::set setKnown; @@ -278,7 +278,7 @@ public: int64_t nPingUsecTime; bool fPingQueued; - CNode(SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn = "", bool fInboundIn=false) : ssSend(SER_NETWORK, INIT_PROTO_VERSION) + CNode(SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn = "", bool fInboundIn=false) : ssSend(SER_NETWORK, INIT_PROTO_VERSION), setAddrKnown(5000) { nServices = 0; hSocket = hSocketIn; From 09a54a65c0d05fe93c4a31603eca8a9a76ff6526 Mon Sep 17 00:00:00 2001 From: Huang Le <4tarhl@gmail.com> Date: Fri, 30 May 2014 23:44:44 +0800 Subject: [PATCH 0099/1288] Use pnode->nLastRecv as sync score directly NodeSyncScore() should find the node which we recv data most recently, so put a negative sign to pnode->nLastRecv is indeed wrong. Also change the return value type to int64_t. Signed-off-by: Huang Le <4tarhl@gmail.com> --- src/net.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index c2dde97040..b0e6699ed2 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1455,13 +1455,13 @@ bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOu // for now, use a very simple selection metric: the node from which we received // most recently -double static NodeSyncScore(const CNode *pnode) { - return -pnode->nLastRecv; +static int64_t NodeSyncScore(const CNode *pnode) { + return pnode->nLastRecv; } void static StartSync(const vector &vNodes) { CNode *pnodeNewSync = NULL; - double dBestScore = 0; + int64_t nBestScore = 0; int nBestHeight = g_signals.GetHeight().get_value_or(0); @@ -1473,10 +1473,10 @@ void static StartSync(const vector &vNodes) { (pnode->nStartingHeight > (nBestHeight - 144)) && (pnode->nVersion < NOBLKS_VERSION_START || pnode->nVersion >= NOBLKS_VERSION_END)) { // if ok, compare node's score with the best so far - double dScore = NodeSyncScore(pnode); - if (pnodeNewSync == NULL || dScore > dBestScore) { + int64_t nScore = NodeSyncScore(pnode); + if (pnodeNewSync == NULL || nScore > nBestScore) { pnodeNewSync = pnode; - dBestScore = dScore; + nBestScore = nScore; } } } From aab2c0fd7e7f629b20192ab9f05b281e5783cacc Mon Sep 17 00:00:00 2001 From: Huang Le <4tarhl@gmail.com> Date: Sat, 31 May 2014 01:23:53 +0800 Subject: [PATCH 0100/1288] Remove template matching params from GetOpName() Since they are not real opcodes, being reported as OP_UNKNOWN is less confusing for human-readable decoding. Signed-off-by: Huang Le <4tarhl@gmail.com> --- src/script.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/script.cpp b/src/script.cpp index ac6d4b316f..381e84d0b7 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -208,14 +208,13 @@ const char* GetOpName(opcodetype opcode) case OP_NOP9 : return "OP_NOP9"; case OP_NOP10 : return "OP_NOP10"; - - - // template matching params - case OP_PUBKEYHASH : return "OP_PUBKEYHASH"; - case OP_PUBKEY : return "OP_PUBKEY"; - case OP_SMALLDATA : return "OP_SMALLDATA"; - case OP_INVALIDOPCODE : return "OP_INVALIDOPCODE"; + + // Note: + // The template matching params OP_SMALLDATA/etc are defined in opcodetype enum + // as kind of implementation hack, they are *NOT* real opcodes. If found in real + // Script, just let the default: case deal with them. + default: return "OP_UNKNOWN"; } From cb7a3edc3d60311752e8f76c0302ffd0a1fd0eb9 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sat, 31 May 2014 12:04:34 +0200 Subject: [PATCH 0101/1288] remove dup of extern int nConnectTimeout; in netbase --- src/netbase.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/netbase.h b/src/netbase.h index f5a64cb51f..23cfb1f158 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -17,6 +17,7 @@ #include extern int nConnectTimeout; +extern bool fNameLookup; #ifdef WIN32 // In MSVC, this is defined as a macro, undefine it to prevent a compile and link error @@ -33,9 +34,6 @@ enum Network NET_MAX, }; -extern int nConnectTimeout; -extern bool fNameLookup; - /** IP address (IPv6, or IPv4 using mapped IPv6 range (::FFFF:0:0/96)) */ class CNetAddr { From 223a6f7800c67696c01cf142e263a6593fa56e55 Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Sun, 1 Jun 2014 15:25:21 +0200 Subject: [PATCH 0102/1288] Fix stray uppercase A in tx_valid.json. --- src/test/data/tx_valid.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/data/tx_valid.json b/src/test/data/tx_valid.json index 1f51d3ce55..0757496c89 100644 --- a/src/test/data/tx_valid.json +++ b/src/test/data/tx_valid.json @@ -16,7 +16,7 @@ ["It is an OP_CHECKMULTISIG with an arbitrary extra byte stuffed into the signature at pos length - 2"], ["The dummy byte is fine however, so the NULLDUMMY flag should be happy"], [[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]], -"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004A0048304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2bab01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH,NULLDUMMY"], +"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004a0048304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2bab01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "P2SH,NULLDUMMY"], ["The following is a tweaked form of 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63"], ["It is an OP_CHECKMULTISIG with the dummy value set to something other than an empty string"], From 11ef78f1150f6b10a97f4f4e9b508308ac7581d9 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sun, 1 Jun 2014 16:25:02 +0200 Subject: [PATCH 0103/1288] Periodic language update Pull updated translations from Transifex before 0.9.2 --- src/qt/locale/bitcoin_da.ts | 566 ++++++++++++++++----------------- src/qt/locale/bitcoin_ko_KR.ts | 74 ++--- src/qt/locale/bitcoin_nb.ts | 6 +- src/qt/locale/bitcoin_zh_CN.ts | 82 ++--- 4 files changed, 365 insertions(+), 363 deletions(-) diff --git a/src/qt/locale/bitcoin_da.ts b/src/qt/locale/bitcoin_da.ts index b13b38a878..a0514035fd 100644 --- a/src/qt/locale/bitcoin_da.ts +++ b/src/qt/locale/bitcoin_da.ts @@ -3,11 +3,11 @@ AboutDialog About Bitcoin Core - + Om Bitcoin Core <b>Bitcoin Core</b> version - + <b>Bitcoin Core</b> version @@ -29,11 +29,11 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open The Bitcoin Core developers - + Udviklerne af Bitcoin Core (%1-bit) - + (%1-bit)
@@ -48,7 +48,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open &New - &Ny + Ny Copy the currently selected address to the system clipboard @@ -56,11 +56,11 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open &Copy - &Kopiér + Kopiér C&lose - + Luk &Copy Address @@ -84,15 +84,15 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Choose the address to send coins to - + Vælg adresse at sende bitcoins til Choose the address to receive coins with - + Vælg adresse at modtage bitcoins med C&hoose - + Vælg Sending addresses @@ -108,7 +108,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - + Dette er dine Bitcoin-adresser til at modtage betalinger med. Det anbefales are bruge en ny modtagelsesadresse for hver transaktion. Copy &Label @@ -120,7 +120,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Export Address List - + Eksportér adresseliste Comma separated file (*.csv) @@ -128,11 +128,11 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Exporting Failed - + Eksport mislykkedes There was an error trying to save the address list to %1. - + En fejl opstod under gemning af adresseliste til %1. @@ -273,7 +273,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Node - + Knude Show general overview of wallet @@ -325,15 +325,15 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open &Sending addresses... - &Afsendelsesadresser... + Afsendelsesadresser … &Receiving addresses... - &Modtagelsesadresser... + Modtagelsesadresser … Open &URI... - + Åbn URI … Importing blocks from disk... @@ -433,31 +433,31 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Request payments (generates QR codes and bitcoin: URIs) - + Forespørg betalinger (genererer QR-koder og "bitcoin:"-URI'er) &About Bitcoin Core - + Om Bitcoin Core Show the list of used sending addresses and labels - + Vis listen over brugte afsendelsesadresser og -mærkater Show the list of used receiving addresses and labels - + Vis listen over brugte modtagelsesadresser og -mærkater Open a bitcoin: URI or payment request - + Åbn en "bitcoin:"-URI eller betalingsforespørgsel &Command-line options - + Tilvalg for kommandolinje Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - + Vis Bitcoin Core hjælpebesked for at få en liste over mulige tilvalg for Bitcoin kommandolinje Bitcoin client @@ -493,11 +493,11 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open %1 and %2 - + %1 og %2 %n year(s) - + %n år%n år %1 behind @@ -575,15 +575,15 @@ Adresse: %4 CoinControlDialog Coin Control Address Selection - + Adressevalg for coin-styring Quantity: - + Mængde: Bytes: - + Byte: Amount: @@ -591,35 +591,35 @@ Adresse: %4 Priority: - + Prioritet: Fee: - + Gebyr: Low Output: - + Lavt output: After Fee: - + Efter gebyr: Change: - + Byttepenge: (un)select all - + (af)vælg alle Tree mode - + Trætilstand List mode - + Listetilstand Amount @@ -635,7 +635,7 @@ Adresse: %4 Confirmations - + Bekræftelser Confirmed @@ -643,151 +643,151 @@ Adresse: %4 Priority - + Prioritet Copy address - Kopier adresse + Kopiér adresse Copy label - Kopier mærkat + Kopiér mærkat Copy amount - Kopier beløb + Kopiér beløb Copy transaction ID - Kopier transaktionens ID + Kopiér transaktions-ID Lock unspent - + Fastlås ubrugte Unlock unspent - + Lås ubrugte op Copy quantity - + Kopiér mængde Copy fee - + Kopiér gebyr Copy after fee - + Kopiér efter-gebyr Copy bytes - + Kopiér byte Copy priority - + Kopiér prioritet Copy low output - + Kopiér lavt output Copy change - + Kopiér byttepenge highest - + højest higher - + højere high - + højt medium-high - + mellemhøj medium - + medium low-medium - + mellemlav low - + lav lower - + lavere lowest - + lavest (%1 locked) - + (%1 fastlåst) none - + ingen Dust - + Støv yes - + ja no - + nej This label turns red, if the transaction size is greater than 1000 bytes. - + Dette mærkat bliver rødt, hvis transaktionsstørrelsen er større end 1000 byte. This means a fee of at least %1 per kB is required. - + Dette betyder, at et gebyr på mindst %1 pr. kB er nødvendigt. Can vary +/- 1 byte per input. - + Kan variere ±1 byte pr. input. Transactions with higher priority are more likely to get included into a block. - + Transaktioner med højere prioritet har højere sansynlighed for at blive inkluderet i en blok. This label turns red, if the priority is smaller than "medium". - + Dette mærkat bliver rødt, hvis prioriteten er mindre end "medium". This label turns red, if any recipient receives an amount smaller than %1. - + Dette mærkat bliver rødt, hvis mindst én modtager et beløb mindre end %1. This means a fee of at least %1 is required. - + Dette betyder, at et gebyr på mindst %1 er nødvendigt. Amounts below 0.546 times the minimum relay fee are shown as dust. - + Beløb under 0,546 gange det minimale videreførselsgebyr vises som støv. This label turns red, if the change is smaller than %1. - + Dette mærkat bliver rødt, hvis byttepengene er mindre end %1. (no label) @@ -795,11 +795,11 @@ Adresse: %4 change from %1 (%2) - + byttepenge fra %1 (%2) (change) - + (byttepange) @@ -814,11 +814,11 @@ Adresse: %4 The label associated with this address list entry - + Mærkatet, der er associeret med denne indgang i adresselisten The address associated with this address list entry. This can only be modified for sending addresses. - + Adressen, der er associeret med denne indgang i adresselisten. Denne kan kune ændres for afsendelsesadresser. &Address @@ -884,7 +884,7 @@ Adresse: %4 HelpMessageDialog Bitcoin Core - Command-line options - + Bitcoin Core – tilvalg for kommandolinje Bitcoin Core @@ -908,7 +908,7 @@ Adresse: %4 Set language, for example "de_DE" (default: system locale) - Angiv sprog, f.eks "de_DE" (standard: systemlokalitet) + Angiv sprog, fx "da_DK" (standard: systemlokalitet) Start minimized @@ -916,15 +916,15 @@ Adresse: %4 Set SSL root certificates for payment request (default: -system-) - + Sæt SSL-rodcertifikater for betalingsforespørgsel (standard: -system-) Show splash screen on startup (default: 1) - Vis opstartsbillede ved start (standard: 1) + Vis opstartsbillede ved opstart (standard: 1) Choose data directory on startup (default: 0) - + Vælg datamappe ved opstart (standard: 0) @@ -935,15 +935,15 @@ Adresse: %4 Welcome to Bitcoin Core. - + Velkommen til Bitcoin Core. As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - + Siden dette er første gang, programmet startes, kan du vælge, hvor Bitcoin Core skal gemme sin data. Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - + Bitcoin Core vil downloade og gemme et kopi af Bitcoin-blokkæden. Mindst %1 GB data vil blive gemt i denne mappe, og den vil vokse over tid. Tegnebogen vil også blive gemt i denne mappe. Use the default data directory @@ -959,7 +959,7 @@ Adresse: %4 Error: Specified data directory "%1" can not be created. - + Fejl: Angivet datamappe "%1" kan ikke oprettes. Error @@ -978,23 +978,23 @@ Adresse: %4 OpenURIDialog Open URI - + Åbn URI Open payment request from URI or file - + Åbn betalingsforespørgsel fra URI eller fil URI: - + URI: Select payment request file - + Vælg fil for betalingsforespørgsel Select payment request file to open - + Vælg fil for betalingsforespørgsel til åbning @@ -1025,39 +1025,39 @@ Adresse: %4 Size of &database cache - + Størrelsen på databasens cache MB - + MB Number of script &verification threads - + Antallet af scriptverificeringstråde Connect to the Bitcoin network through a SOCKS proxy. - + Forbind til Bitcoin-netværket gennem en SOCKS-proxy. &Connect through SOCKS proxy (default proxy): - + Forbind gennem SOCKS-proxy (standard-proxy): IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - + IP-adresse for proxyen (fx IPv4: 127.0.0.1 / IPv6: ::1) Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - + Tredjeparts-URL'er (fx et blokhåndteringsværktøj), der vises i transaktionsfanen som genvejsmenupunkter. %s i URL'en erstattes med transaktionens hash. Flere URL'er separeres med en lodret streg |. Third party transaction URLs - + Tredjeparts-transaktions-URL'er Active command-line options that override above options: - + Aktuelle tilvalg for kommandolinjen, der tilsidesætter ovenstående tilvalg: Reset all client options to default. @@ -1073,27 +1073,27 @@ Adresse: %4 (0 = auto, <0 = leave that many cores free) - + (0 = auto, <0 = efterlad så mange kerner fri) W&allet - + Tegnebog Expert - + Ekspert Enable coin &control features - + Slå egenskaber for coin-styring til 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. - + Hvis du slår brug af ubekræftede byttepenge fra, kan byttepengene fra en transaktion ikke bruges, før pågældende transaktion har mindst én bekræftelse. Dette påvirker også måden hvorpå din saldo beregnes. &Spend unconfirmed change - + Brug ubekræftede byttepenge Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. @@ -1173,7 +1173,7 @@ Adresse: %4 Whether to show coin control features or not. - + Hvorvidt egenskaber for coin-styring skal vises eller ej. &OK @@ -1189,7 +1189,7 @@ Adresse: %4 none - + ingeningen Confirm options reset @@ -1197,15 +1197,15 @@ Adresse: %4 Client restart required to activate changes. - + Genstart af klienten er nødvendig for at aktivere ændringer. Client will be shutdown, do you want to proceed? - + Klienten vil blive lukket ned; vil du fortsætte? This change would require a client restart. - + Denne ændring vil kræve en genstart af klienten. The supplied proxy address is invalid. @@ -1228,7 +1228,7 @@ Adresse: %4 Available: - + Tilgængelig: Your current spendable balance @@ -1236,7 +1236,7 @@ Adresse: %4 Pending: - + Uafgjort: Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance @@ -1279,7 +1279,7 @@ Adresse: %4 Requested payment amount of %1 is too small (considered dust). - + Forespurgt betalingsbeløb på %1 er for lille (regnes som støv). Payment request error @@ -1291,27 +1291,27 @@ Adresse: %4 Net manager warning - + Net-håndterings-advarsel Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - + Din aktuelle proxy understøtter ikke SOCKS5, hvilket kræves for betalingsforespørgsler via proxy. Payment request fetch URL is invalid: %1 - + Betalingsforespørgslens hentnings-URL er ugyldig: %1 Payment request file handling - + Filhåndtering for betalingsanmodninger Payment request file can not be read or processed! This can be caused by an invalid payment request file. - + Betalingsanmodningsfil kan ikke indlæses eller bearbejdes! Dette kan skyldes en ugyldig betalingsanmodningsfil. Unverified payment requests to custom payment scripts are unsupported. - + Ikke-verificerede betalingsforespørgsler for tilpassede betalings-scripts understøttes ikke. Refund from %1 @@ -1319,19 +1319,19 @@ Adresse: %4 Error communicating with %1: %2 - + Fejl under kommunikation med %1: %2 Payment request can not be parsed or processed! - + Betalingsanmodning kan ikke fortolkes eller bearbejdes! Bad response from server %1 - + Fejlagtigt svar fra server %1 Payment acknowledged - + Betaling anerkendt Network request error @@ -1350,7 +1350,7 @@ Adresse: %4 Error: Cannot parse configuration file: %1. Only use key=value syntax. - + Fejl: Kan ikke fortolke konfigurationsfil: %1. Brug kun syntaksen nøgle=værdi. Error: Invalid combination of -regtest and -testnet. @@ -1358,7 +1358,7 @@ Adresse: %4 Bitcoin Core didn't yet exit safely... - + Bitcoin Core blev ikke afsluttet på sikker vis … Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) @@ -1369,11 +1369,11 @@ Adresse: %4 QRImageWidget &Save Image... - &Gem foto... + Gem billede … &Copy Image - &Kopiér foto + Kopiér foto Save QR Code @@ -1381,7 +1381,7 @@ Adresse: %4 PNG Image (*.png) - + PNG-billede (*.png) @@ -1404,11 +1404,11 @@ Adresse: %4 Debug window - + Fejlsøgningsvindue General - + Generelt Using OpenSSL version @@ -1456,23 +1456,23 @@ Adresse: %4 &Network Traffic - + Netværkstrafik &Clear - + Ryd Totals - + Totaler In: - + Indkommende: Out: - Ud: + Udgående: Build date @@ -1535,7 +1535,7 @@ Adresse: %4 ReceiveCoinsDialog &Amount: - &Mængde: + Beløb: &Label: @@ -1543,35 +1543,35 @@ Adresse: %4 &Message: - &Besked: + Besked: Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - + Genbrug en af de tidligere brugte modtagelsesadresser. Genbrug af adresser har indflydelse på sikkerhed og privatliv. Brug ikke dette med mindre du genskaber en betalingsforespørgsel fra tidligere. R&euse an existing receiving address (not recommended) - + Genbrug en eksisterende modtagelsesadresse (anbefales ikke) An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - + En valgfri besked, der føjes til betalingsanmodningen, og som vil vises, når anmodningen åbnes. Bemærk: Beskeden vil ikke sendes med betalingen over Bitcoin-netværket. An optional label to associate with the new receiving address. - + Et valgfrit mærkat, der associeres med den nye modtagelsesadresse. Use this form to request payments. All fields are <b>optional</b>. - + Brug denne formular for at anmode om betalinger. Alle felter er <b>valgfri</b>. An optional amount to request. Leave this empty or zero to not request a specific amount. - + Et valgfrit beløb til anmodning. Lad dette felt være tomt eller indeholde nul for at anmode om et ikke-specifikt beløb. Clear all fields of the form. - Ryd alle fælter af formen. + Ryd alle felter af formen. Clear @@ -1579,35 +1579,35 @@ Adresse: %4 Requested payments history - + Historik over betalingsanmodninger &Request payment - &Anmod betaling + Anmod om betaling Show the selected request (does the same as double clicking an entry) - + Vis den valgte forespørgsel (gør det samme som dobbeltklik på en indgang) Show - + Vis Remove the selected entries from the list - + Fjern de valgte indgange fra listen Remove - + Fjern Copy label - Kopier mærkat + Kopiér mærkat Copy message - + Kopiér besked Copy amount @@ -1618,23 +1618,23 @@ Adresse: %4 ReceiveRequestDialog QR Code - QR Kode + QR-kode Copy &URI - Kopiér &URL + Kopiér URI Copy &Address - Kopiér &Adresse + Kopiér adresse &Save Image... - &Gem foto... + Gem billede … Request payment to %1 - + Anmod om betaling til %1 Payment information @@ -1666,7 +1666,7 @@ Adresse: %4 Error encoding URI into QR Code. - Fejl ved kodning fra URI til QR-kode + Fejl ved kodning fra URI til QR-kode. @@ -1693,11 +1693,11 @@ Adresse: %4 (no message) - + (ingen besked) (no amount) - + (intet beløb) @@ -1708,27 +1708,27 @@ Adresse: %4 Coin Control Features - + Egenskaber for coin-styring Inputs... - + Inputs … automatically selected - + valgt automatisk Insufficient funds! - + Utilstrækkelige midler! Quantity: - + Mængde: Bytes: - + Byte: Amount: @@ -1736,31 +1736,31 @@ Adresse: %4 Priority: - + Prioritet: Fee: - + Gebyr: Low Output: - + Lavt output: After Fee: - + Efter gebyr: Change: - + Byttepenge: If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - + Hvis dette aktiveres, men byttepengeadressen er tom eller ugyldig, vil byttepenge blive sendt til en nygenereret adresse. Custom change address - + Tilpasset byttepengeadresse Send to multiple recipients at once @@ -1772,7 +1772,7 @@ Adresse: %4 Clear all fields of the form. - Ryd alle fælter af formen. + Ryd alle felter af formen. Clear &All @@ -1796,11 +1796,11 @@ Adresse: %4 %1 to %2 - + %1 til %2 Copy quantity - + Kopiér mængde Copy amount @@ -1808,35 +1808,35 @@ Adresse: %4 Copy fee - + Kopiér gebyr Copy after fee - + Kopiér efter-gebyr Copy bytes - + Kopiér byte Copy priority - + Kopiér prioritet Copy low output - + Kopiér lavt output Copy change - + Kopiér byttepenge Total Amount %1 (= %2) - + Totalbeløb %1 (= %2) or - + eller The recipient address is not valid, please recheck. @@ -1860,15 +1860,15 @@ Adresse: %4 Transaction creation failed! - + Oprettelse af transaktion mislykkedes! The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - + Transaktionen blev afvist! Dette kan ske, hvis nogle af dine bitcoins i din tegnebog allerede er brugt, som hvis du brugte en kopi af wallet.dat og dine bitcoins er blevet brugt i kopien, men ikke er markeret som brugt her. Warning: Invalid Bitcoin address - + Advarsel: Ugyldig Bitcoin-adresse (no label) @@ -1876,7 +1876,7 @@ Adresse: %4 Warning: Unknown change address - + Advarsel: Ukendt byttepengeadresse Are you sure you want to send? @@ -1892,7 +1892,7 @@ Adresse: %4 Invalid payment address %1 - + Ugyldig betalingsadresse %1 @@ -1919,11 +1919,11 @@ Adresse: %4 Choose previously used address - + Vælg tidligere brugt adresse This is a normal payment. - + Dette er en normal betaling. Alt+A @@ -1939,7 +1939,7 @@ Adresse: %4 Remove this entry - + Fjern denne indgang Message: @@ -1947,38 +1947,38 @@ Adresse: %4 This is a verified payment request. - + Dette er en verificeret betalingsforespørgsel. Enter a label for this address to add it to the list of used addresses - + Indtast et mærkat for denne adresse for at føje den til listen over brugte adresser A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - + En besked, som blev føjet til "bitcon:"-URI'en, som vil gemmes med transaktionen til din reference. Bemærk: Denne besked vil ikke blive sendt over Bitcoin-netværket. This is an unverified payment request. - + Dette er en ikke-verificeret betalingsforespørgsel. Pay To: - + Betal til: Memo: - + Memo: ShutdownWindow Bitcoin Core is shutting down... - + Bitcoin Core lukker ned … Do not shut down the computer until this window disappears. - + Luk ikke computeren ned, før dette vindue forsvinder. @@ -2001,7 +2001,7 @@ Adresse: %4 Choose previously used address - + Vælg tidligere brugt adresse Alt+A @@ -2132,7 +2132,7 @@ Adresse: %4 The Bitcoin Core developers - + Udviklerne af Bitcoin Core [testnet] @@ -2154,7 +2154,7 @@ Adresse: %4 conflicted - + konflikt %1/offline @@ -2242,11 +2242,11 @@ Adresse: %4 Merchant - + Forretningsdrivende Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - + Udvundne bitcoins skal modne %1 blokke, før de kan bruges. Da du genererede denne blok, blev den udsendt til netværket for at blive føjet til blokkæden. Hvis det ikke lykkes at få den i kæden, vil dens tilstand ændres til "ikke accepteret", og den vil ikke kunne bruges. Dette kan ske nu og da, hvis en anden knude udvinder en blok inden for nogle få sekunder fra din. Debug information @@ -2316,7 +2316,7 @@ Adresse: %4 Immature (%1 confirmations, will be available after %2) - + Umoden (%1 bekræftelser; vil være tilgængelig efter %2) Open for %n more block(s) @@ -2340,19 +2340,19 @@ Adresse: %4 Offline - + Offline Unconfirmed - + Ubekræftet Confirming (%1 of %2 recommended confirmations) - + Bekræfter (%1 af %2 anbefalede bekræftelser) Conflicted - + Konflikt Received with @@ -2483,23 +2483,23 @@ Adresse: %4 Export Transaction History - + Historik for eksport af transaktioner Exporting Failed - + Eksport mislykkedes There was an error trying to save the transaction history to %1. - + En fejl opstod under gemning af transaktionshistorik til %1. Exporting Successful - + Eksport problemfri The transaction history was successfully saved to %1. - + Transaktionshistorikken blev gemt til %1 med succes. Comma separated file (*.csv) @@ -2546,7 +2546,7 @@ Adresse: %4 WalletFrame No wallet has been loaded. - + Ingen tegnebog er indlæst. @@ -2580,11 +2580,11 @@ Adresse: %4 There was an error trying to save the wallet data to %1. - + Der skete en fejl under gemning af tegnebogsdata til %1. The wallet data was successfully saved to %1. - + Tegnebogsdata blev gemt til %1 med succes. Backup Successful @@ -2659,7 +2659,7 @@ Adresse: %4 Bitcoin Core RPC client version - + Bitcoin Core RPC-klient-version Run in the background as a daemon and accept commands @@ -2699,7 +2699,7 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - + Accepterede krypteringer (standard: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s @@ -2711,19 +2711,19 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - + Rate-begræns kontinuerligt frie transaktioner til <n>*1000 byte i minuttet (standard:15) Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - + Start regressionstesttilstand, som bruger en speciel kæde, hvor blokke kan løses med det samme. Dette er tiltænkt til testværktøjer for regression of programudvikling. Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - + Start regressionstesttilstand, som bruger en speciel kæde, hvor blokke kan løses med det samme. Error: Listening for incoming connections failed (listen returned error %d) - + Fejl: Lytning efter indkommende forbindelser mislykkedes (lytning returnerede fejl %d) Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. @@ -2739,27 +2739,27 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Fees smaller than this are considered zero fee (for transaction creation) (default: - + Gebyrer mindre end dette opfattes som nul-gebyr (for oprettelse af transaktioner) (standard: Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - + Flyt databaseaktivitet fra hukommelsespulje til disklog hver <n> megabytes (standard: 100) How thorough the block verification of -checkblocks is (0-4, default: 3) - + Hvor gennemarbejdet blokverificeringen for -checkblocks er (0-4; standard: 3) In this mode -genproclimit controls how many blocks are generated immediately. - + I denne tilstand styrer -genproclimit hvor mange blokke, der genereres med det samme. Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - + Sæt antallet af scriptverificeringstråde (%u til %d, 0 = auto, <0 = efterlad det antal kernet fri, standard: %d) Set the processor limit for when generation is on (-1 = unlimited, default: -1) - + Sæt processorbegrænsning for når generering er slået til (-1 = ubegrænset, standard: -1) This is a pre-release test build - use at your own risk - do not use for mining or merchant applications @@ -2767,11 +2767,11 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Unable to bind to %s on this computer. Bitcoin Core is probably already running. - + Ikke i stand til at tildele til %s på denne computer. Bitcoin Core kører sansynligvis allerede. Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - + Brug separat SOCS5-proxy for at nå andre knuder via Tor skjulte tjenester (standard: -proxy) Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. @@ -2799,15 +2799,15 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com (default: 1) - + (standard: 1) (default: wallet.dat) - + (standard: wallet.dat) <category> can be: - + <kategori> kan være: Attempt to recover private keys from a corrupt wallet.dat @@ -2815,7 +2815,7 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Bitcoin Core Daemon - + Bitcoin Core-tjeneste Block creation options: @@ -2823,7 +2823,7 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Clear list of wallet transactions (diagnostic tool; implies -rescan) - + Ryd liste over transaktioner i tegnebog (diagnoseværktøj; medfører -rescan) Connect only to the specified node(s) @@ -2831,15 +2831,15 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Connect through SOCKS proxy - + Forbind gennem SOCKS-proxy Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - + Forbind til JSON-RPC på <port> (standard: 8332 eller testnetværk: 18332) Connection options: - + Tilvalg for forbindelser: Corrupted block database detected @@ -2847,11 +2847,11 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Debugging/Testing options: - + Tilvalg for fejlfinding/test: Disable safemode, override a real safe mode event (default: 0) - + Slå sikker tilstand fra, tilsidesæt hændelser fra sikker tilstand (standard: 0) Discover own IP address (default: 1 when listening and no -externalip) @@ -2859,7 +2859,7 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Do not load the wallet and disable wallet RPC calls - + Indlæs ikke tegnebogen og slå tegnebogs-RPC-kald fra Do you want to rebuild the block database now? @@ -2939,11 +2939,11 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Fee per kB to add to transactions you send - + Føj gebyr pr. kB til transaktioner, du sender Fees smaller than this are considered zero fee (for relaying) (default: - + Gebyrer mindre end dette opfattes som nul-gebyr (for videreførsler) (standard: Find peers using DNS lookup (default: 1 unless -connect) @@ -2951,7 +2951,7 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Force safe mode (default: 0) - + Gennemtving sikker tilstand (standard: 0) Generate coins (default: 0) @@ -2963,11 +2963,11 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com If <category> is not supplied, output all debugging information. - + Hvis <kategori> ikke angives, udskriv al fejlsøgningsinformation. Importing... - + Importerer … Incorrect or no genesis block found. Wrong datadir for network? @@ -2975,7 +2975,7 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Invalid -onion address: '%s' - + Ugyldig -onion adresse: "%s" Not enough file descriptors available. @@ -2983,11 +2983,11 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Prepend debug output with timestamp (default: 1) - + Føj tidsstempel foran fejlsøgningsoutput (standard: 1) RPC client options: - + Tilvalg for RPC-klient: Rebuild block chain index from current blk000??.dat files @@ -2995,15 +2995,15 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Select SOCKS version for -proxy (4 or 5, default: 5) - + Vælg SOCKS-version for -proxy (4 eller 5, standard: 5) Set database cache size in megabytes (%d to %d, default: %d) - + Sæt cache-størrelse for database i megabytes (%d til %d; standard: %d) Set maximum block size in bytes (default: %d) - + Sæt maksimum blokstørrelse i byte (standard: %d) Set the number of threads to service RPC calls (default: 4) @@ -3015,15 +3015,15 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Spend unconfirmed change when sending transactions (default: 1) - + Brug ubekræftede byttepenge under afsendelse af transaktioner (standard: 1) This is intended for regression testing tools and app development. - + This is intended for regression testing tools and app development. Usage (deprecated, use bitcoin-cli): - + Brug (forældet, brug bitcoin-cli): Verifying blocks... @@ -3035,7 +3035,7 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Wait for RPC server to start - + Vent på opstart af RPC-server Wallet %s resides outside data directory %s @@ -3043,11 +3043,11 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Wallet options: - + Tilvalg for tegnebog: Warning: Deprecated argument -debugnet ignored, use -debug=net - + Advarsel: Forældet argument -debugnet ignoreret; brug -debug=net You need to rebuild the database using -reindex to change -txindex @@ -3059,7 +3059,7 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - + Kan ikke opnå en lås på datamappe %s. Bitcoin Core kører sansynligvis allerede. Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) @@ -3067,11 +3067,11 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Output debugging information (default: 0, supplying <category> is optional) - + Udskriv fejlsøgningsinformation (standard: 0, angivelse af <kategori> er valgfri) Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - + Sæt maksimumstørrelse for højprioritet/lavgebyr-transaktioner i byte (standard: %d) Information @@ -3087,11 +3087,11 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Limit size of signature cache to <n> entries (default: 50000) - + Begræns størrelsen på signaturcache til <n> indgange (standard: 50000) Log transaction priority and fee per kB when mining blocks (default: 0) - + Prioritet for transaktionslog og gebyr pr. kB under udvinding af blokke (standard: 0) Maintain a full transaction index (default: 0) @@ -3115,31 +3115,31 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Print block on startup, if found in block index - + Udskriv blok under opstart, hvis den findes i blokindeks Print block tree on startup (default: 0) - + Udskriv bloktræ under startop (standard: 0) RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - + Tilvalg for RPC SSL: (se Bitcoin Wiki for instruktioner i SSL-opstart) RPC server options: - + Tilvalg for RPC-server: Randomly drop 1 of every <n> network messages - + Drop tilfældigt 1 ud af hver <n> netværksbeskeder Randomly fuzz 1 of every <n> network messages - + Slør tilfældigt 1 ud af hver <n> netværksbeskeder Run a thread to flush wallet periodically (default: 1) - + Kør en tråd for at rydde tegnebog periodisk (standard: 1) SSL options: (see the Bitcoin Wiki for SSL setup instructions) @@ -3147,7 +3147,7 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Send command to Bitcoin Core - + Send kommando til Bitcoin Core Send trace/debug info to console instead of debug.log file @@ -3159,15 +3159,15 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - + Sætter DB_PRIVATE-flaget i tegnebogens db-miljø (standard: 1) Show all debugging options (usage: --help -help-debug) - + Vis alle tilvalg for fejlsøgning (brug: --help -help-debug) Show benchmark information (default: 0) - + Vis information om ydelsesmåling (standard: 0) Shrink debug.log file on client startup (default: 1 when no -debug) @@ -3183,7 +3183,7 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Start Bitcoin Core Daemon - + Start Bitcoin Core-tjeneste System error: @@ -3223,11 +3223,11 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Zapping all transactions from wallet... - + Zapper alle transaktioner fra tegnebog … on startup - + under opstart version diff --git a/src/qt/locale/bitcoin_ko_KR.ts b/src/qt/locale/bitcoin_ko_KR.ts index 8e2b681ba9..ce30a8603d 100644 --- a/src/qt/locale/bitcoin_ko_KR.ts +++ b/src/qt/locale/bitcoin_ko_KR.ts @@ -40,7 +40,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http AddressBookPage Double-click to edit address or label - 주소 또는 표를 편집하기 위해 더블클릭 하시오 + 지갑 주소나 제목을 수정하려면 더블클릭하세요. Create a new address @@ -755,7 +755,7 @@ Address: %4 This label turns red, if the transaction size is greater than 1000 bytes. - + 만약 거래 양이 1000bytes 보다 크면 제목이 빨간색으로 변합니다 This means a fee of at least %1 per kB is required. @@ -771,11 +771,11 @@ Address: %4 This label turns red, if the priority is smaller than "medium". - + 우선권이 중간보다 작으면 제목이 빨간색으로 변합니다. This label turns red, if any recipient receives an amount smaller than %1. - + 만약 수령인이 받은 액수가 잔고의 1%보다 작으면 이 제목이 빨간색으로 변합니다. This means a fee of at least %1 is required. @@ -787,7 +787,7 @@ Address: %4 This label turns red, if the change is smaller than %1. - + 만약 잔돈이 1%보다 작다면 제목이 빨간색으로 변합니다 (no label) @@ -1053,7 +1053,7 @@ Address: %4 Third party transaction URLs - + 제 3자 거래 URLs Active command-line options that override above options: @@ -1093,7 +1093,7 @@ Address: %4 &Spend unconfirmed change - + &확인되지 않은 돈을 쓰다 Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. @@ -1303,7 +1303,7 @@ Address: %4 Payment request file handling - + 지불이 파일 처리를 요청합니다 Payment request file can not be read or processed! This can be caused by an invalid payment request file. @@ -1354,7 +1354,7 @@ Address: %4 Error: Invalid combination of -regtest and -testnet. - + 오류: 잘못된 -regtest 와 -testnet의 조합입니다. Bitcoin Core didn't yet exit safely... @@ -1460,7 +1460,7 @@ Address: %4 &Clear - + &지우기 Totals @@ -1712,7 +1712,7 @@ Address: %4 Inputs... - + 입력... automatically selected @@ -1864,7 +1864,7 @@ Address: %4 The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - + 거래가 거부되었습니다. 몇몇 코인들이 지갑에서 이미 사용된 경우, 예를 들어 코인을 이미 사용한 wallet.dat를 복사해서 사용한 경우 지금 지갑에 기록이 안되있어 이런 일이 생길 수 있습니다. Warning: Invalid Bitcoin address @@ -2651,7 +2651,7 @@ Address: %4 Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - + 포트 <port>을 통해 JSON-RPC 연결 (기본값: 8332 또는 testnet: 18332) Accept command line and JSON-RPC commands @@ -2693,7 +2693,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - + IPv6 연결을 위해 RPC port %u 설정 중 오류가 발생했습니다. IPv4: %s 환경으로 돌아갑니다. Bind to given address and always listen on it. Use [host]:port notation for IPv6 @@ -2717,7 +2717,9 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - + 에러: 거래가 거부되었습니다! 이런 일이 생길 수 있습니다 만약 몇개의 코인들을 지갑에서 이미 사용했다면요, 예를 들어 만약 당신이 wallet.dat를 복사해서 사용했거나 코인들을 사용 후에 복사했다면 여기선 표시가 안되서 사용할 수 없습니다 + +-번역은 했으나 약간 이상한점이 있어서 수정해야함- Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! @@ -2725,7 +2727,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - + 지갑 거래가 바뀌면 명령을 실행합니다.(%s 안의 명령어가 TxID로 바뀝니다) Fees smaller than this are considered zero fee (for transaction creation) (default: @@ -2841,7 +2843,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Disable safemode, override a real safe mode event (default: 0) - + 안전 모드를 비활성화하고 안전 모드의 이벤트가 발생하더라도 무시합니다. (기본값: 0, 비활성화) Discover own IP address (default: 1 when listening and no -externalip) @@ -2861,7 +2863,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error initializing wallet database environment %s! - + 지갑 데이터베이스 환경 초기화하는데 오류 Error loading block database @@ -2961,7 +2963,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Incorrect or no genesis block found. Wrong datadir for network? - + 올바르지 않거나 생성된 블록을 찾을 수 없습니다. 잘못된 네트워크 자료 디렉토리? Invalid -onion address: '%s' @@ -3053,7 +3055,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - + 이 사항과 관련있는 경고가 발생하거나 아주 긴 포크가 발생했을 때 명령어를 실행해 주세요. (cmd 명령어 목록에서 %s는 메시지로 대체됩니다) Output debugging information (default: 0, supplying <category> is optional) @@ -3061,7 +3063,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - + 최대 크기를 최우선으로 설정 / 바이트당 최소 수수료로 거래(기본값: %d) Information @@ -3077,11 +3079,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Limit size of signature cache to <n> entries (default: 50000) - + <n>번 째 순서에서 전자서명 캐쉬의 용량을 제한합니다. (기본값: 50000) Log transaction priority and fee per kB when mining blocks (default: 0) - + 블럭을 채굴할 때 kB당 거래 우선 순위와 수수료를 로그에 남깁니다. (기본값: 0, 비활성화) Maintain a full transaction index (default: 0) @@ -3089,11 +3091,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - + 최대 연결마다 1000bytes 버퍼를 받는다. (기본값: 5000) Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - + 최대 연결 마다 1000bytes 버퍼를 보낸다.(기본값: 1000) Only accept block chain matching built-in checkpoints (default: 1) @@ -3101,27 +3103,27 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - + 노드가 있는 네트워크에만 접속 합니다(IPv4, IPv6 또는 Tor) Print block on startup, if found in block index - + 블럭 색인을 발견하면 구동 시 블럭을 출력합니다. Print block tree on startup (default: 0) - + 구동 시 블럭 트리를 출력합니다. (기본값: 0, 비활성화) RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - + RPC SSL 옵션: (비트코인 위키의 SSL 설정 설명서 참고) RPC server options: - + RPC 서버 설정 Randomly drop 1 of every <n> network messages - + 모든 네트워크 메시지 마다 무작위로 1이 떨어진다 Randomly fuzz 1 of every <n> network messages @@ -3137,7 +3139,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Send command to Bitcoin Core - + 비트코인 코어로 명령 보내기 Send trace/debug info to console instead of debug.log file @@ -3149,15 +3151,15 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - + 전자지갑 데이터베이스 환경에 DB_PRIVATE 플래그를 설정합니다. (기본값: 1, 활성화) Show all debugging options (usage: --help -help-debug) - + 모든 디버그 설정 보기(설정: --help -help-debug) Show benchmark information (default: 0) - + 벤치마크 정보 보기(기본값: 0) Shrink debug.log file on client startup (default: 1 when no -debug) @@ -3217,7 +3219,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. on startup - + 구동 중 version diff --git a/src/qt/locale/bitcoin_nb.ts b/src/qt/locale/bitcoin_nb.ts index 1267ad65b9..9e38c69c60 100644 --- a/src/qt/locale/bitcoin_nb.ts +++ b/src/qt/locale/bitcoin_nb.ts @@ -599,7 +599,7 @@ Adresse: %4 Low Output: - Lav Utdata: + Svake Utdata: After Fee: @@ -1744,7 +1744,7 @@ Adresse: %4 Low Output: - Svak Utdata: + Svake Utdata: After Fee: @@ -2730,7 +2730,7 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - Feil: Denne transaksjonen trenger en gebyr på minst %s på grunn av beløpet, kompleksiteten eller bruk av allerede mottatte penger! + Feil: Denne transaksjonen trenger et gebyr på minst %s på grunn av beløpet, kompleksiteten eller bruk av allerede mottatte penger! Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) diff --git a/src/qt/locale/bitcoin_zh_CN.ts b/src/qt/locale/bitcoin_zh_CN.ts index ea98c4e4b1..b87d27fe12 100644 --- a/src/qt/locale/bitcoin_zh_CN.ts +++ b/src/qt/locale/bitcoin_zh_CN.ts @@ -917,7 +917,7 @@ Address: %4 Set SSL root certificates for payment request (default: -system-) - + 设置SSL根证书的付款请求(默认:-系统-) Show splash screen on startup (default: 1) @@ -1050,11 +1050,11 @@ Address: %4 Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - + 出现在交易的选项卡的上下文菜单项的第三方网址 (例如:区块链接查询) 。 %s的URL被替换为交易哈希。多个的URL需要竖线 | 分隔。 Third party transaction URLs - + 第三方交易网址 Active command-line options that override above options: @@ -1074,7 +1074,7 @@ Address: %4 (0 = auto, <0 = leave that many cores free) - + (0 = 自动, <0 = 离开很多免费的核心) W&allet @@ -1086,7 +1086,7 @@ Address: %4 Enable coin &control features - + 启动货币 &控制功能 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. @@ -1094,7 +1094,7 @@ Address: %4 &Spend unconfirmed change - + &选择未经确认的花费 Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. @@ -1351,7 +1351,7 @@ Address: %4 Error: Cannot parse configuration file: %1. Only use key=value syntax. - + 错误: 无法解析配置文件: %1. 只有钥匙=重要的私匙. Error: Invalid combination of -regtest and -testnet. @@ -1359,7 +1359,7 @@ Address: %4 Bitcoin Core didn't yet exit safely... - + 比特币核心钱包没有安全退出.... Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) @@ -2667,7 +2667,7 @@ Address: %4 Bitcoin Core RPC client version - + 比特币核心钱包RPC客户端版本 Run in the background as a daemon and accept commands @@ -2722,7 +2722,7 @@ rpcpassword=%s Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - + 自由交易不断的速率限制为<n>*1000 字节每分钟(默认值:15) Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. @@ -2734,7 +2734,7 @@ rpcpassword=%s Error: Listening for incoming connections failed (listen returned error %d) - + 错误: 监听接收连接失败 (监听错误 %d) Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. @@ -2750,27 +2750,27 @@ rpcpassword=%s Fees smaller than this are considered zero fee (for transaction creation) (default: - + 比这手续费更小的被认为零手续费 (交易产生) (默认: Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - + 从缓冲池清理磁盘数据库活动日志每<n>兆字节 (默认值: 100) How thorough the block verification of -checkblocks is (0-4, default: 3) - + 如何有效的验证checkblocks区块(0-4, 默认值: 3) In this mode -genproclimit controls how many blocks are generated immediately. - + 在-genproclimit这种模式下控制产出多少区块 Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - + 设置脚本验证的程序 (%u 到 %d, 0 = 自动, <0 = 保留自由的核心, 默认值: %d) Set the processor limit for when generation is on (-1 = unlimited, default: -1) - + 设置处理器生成的限制 (-1 = 无限, 默认值: -1) This is a pre-release test build - use at your own risk - do not use for mining or merchant applications @@ -2778,7 +2778,7 @@ rpcpassword=%s Unable to bind to %s on this computer. Bitcoin Core is probably already running. - + 无法 %s的绑定到电脑上,比特币核心钱包可能已经在运行。 Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) @@ -2810,11 +2810,11 @@ rpcpassword=%s (default: 1) - + (默认值: 1) (default: wallet.dat) - + (默认: wallet.dat) <category> can be: @@ -2850,7 +2850,7 @@ rpcpassword=%s Connection options: - + 连接选项: Corrupted block database detected @@ -2858,11 +2858,11 @@ rpcpassword=%s Debugging/Testing options: - + 调试/测试选项: Disable safemode, override a real safe mode event (default: 0) - + 禁止使用安全模式,重新写入一个真正的安全模式日志(默认值: 0) Discover own IP address (default: 1 when listening and no -externalip) @@ -2954,7 +2954,7 @@ rpcpassword=%s Fees smaller than this are considered zero fee (for relaying) (default: - + 比这手续费更小的被认为零手续费 (中继) (默认值: Find peers using DNS lookup (default: 1 unless -connect) @@ -2962,7 +2962,7 @@ rpcpassword=%s Force safe mode (default: 0) - + 强制安全模式(默认值: 0) Generate coins (default: 0) @@ -3010,7 +3010,7 @@ rpcpassword=%s Set database cache size in megabytes (%d to %d, default: %d) - + 设置以MB为单位的数据库缓存大小(%d 到 %d, 默认值: %d) Set maximum block size in bytes (default: %d) @@ -3070,7 +3070,7 @@ rpcpassword=%s Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - + 无法获取数据目录的 %s. 比特币核心钱包可能已经在运行. Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) @@ -3098,11 +3098,11 @@ rpcpassword=%s Limit size of signature cache to <n> entries (default: 50000) - + 签名缓冲大小限制每<n> 条目 (默认值: 50000) Log transaction priority and fee per kB when mining blocks (default: 0) - + 开采区块时,日志优先级和手续费每KB (默认值: 0) Maintain a full transaction index (default: 0) @@ -3126,15 +3126,15 @@ rpcpassword=%s Print block on startup, if found in block index - + 如果在搜索区块中找到,请启动打印区块 Print block tree on startup (default: 0) - 启动时打印块树 (默认: 0) + 启动时打印区块树 (默认值: 0) RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - + RPC SSL选项:(见有关比特币设置用于SSL说明的维基百科) RPC server options: @@ -3142,15 +3142,15 @@ rpcpassword=%s Randomly drop 1 of every <n> network messages - + 随机每1个丢失测试<n>网络信息 Randomly fuzz 1 of every <n> network messages - + 随机每1个模拟测试<n>网络信息 Run a thread to flush wallet periodically (default: 1) - + 运行一个程序,定时清理钱包 (默认值:1) SSL options: (see the Bitcoin Wiki for SSL setup instructions) @@ -3158,7 +3158,7 @@ rpcpassword=%s Send command to Bitcoin Core - + 发送指令到比特币核心钱包 Send trace/debug info to console instead of debug.log file @@ -3170,15 +3170,15 @@ rpcpassword=%s Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - + 设置DB_PRIVATE钱包标志DB环境 (默认值: 1) Show all debugging options (usage: --help -help-debug) - + 显示所有调试选项 (用法: --帮助 -帮助调试) Show benchmark information (default: 0) - + 显示标准信息 (默认值: 0) Shrink debug.log file on client startup (default: 1 when no -debug) @@ -3194,7 +3194,7 @@ rpcpassword=%s Start Bitcoin Core Daemon - + 开启比特币核心钱包守护进程 System error: @@ -3238,7 +3238,7 @@ rpcpassword=%s on startup - + 启动中 version From 516053c349f8abde09597962f4dd3958a2825177 Mon Sep 17 00:00:00 2001 From: Tawanda Kembo Date: Thu, 22 May 2014 13:19:51 +0200 Subject: [PATCH 0104/1288] Make links on 'About Bitcoin Core' into clickable (squashed 5 comits into one) Made the following links clickable: http://www.opensource.org/licenses/mit-license.php http://www.openssl.org/ eay@cryptsoft.com (Squashed commits into one commit as suggested by @laanwj) Replaced label with text browser on About Bitcoin Core Screen So that the links on the About screen can be clickable Replaced html property with text property I have now removed unnecessary html so this should make life easier for translators and you @Diapolo :). What do you think? The size of the window needs to change The size of the window needs to change when you make links clickable. Thanks for pointing that out @laanwj Using the https://www.openssl.org over the http link Using the https://www.openssl.org over the http link as suggested by @Diapolo --- src/qt/forms/aboutdialog.ui | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qt/forms/aboutdialog.ui b/src/qt/forms/aboutdialog.ui index 3ab4675bf3..fec63f737a 100644 --- a/src/qt/forms/aboutdialog.ui +++ b/src/qt/forms/aboutdialog.ui @@ -110,9 +110,12 @@ This is experimental software. -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. +Distributed under the MIT/X11 software license, see the accompanying file COPYING or <a href="http://www.opensource.org/licenses/mit-license.php">http://www.opensource.org/licenses/mit-license.php</a>. -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. +This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (<a href="https://www.openssl.org/">https://www.openssl.org/</a>) and cryptographic software written by Eric Young (<a href="mailto:eay@cryptsoft.com">eay@cryptsoft.com</a>) and UPnP software written by Thomas Bernard.
+ + + Qt::RichText true From 386e732a5f6a6f5bc2cdfd0136027475b16af7c7 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 2 Jun 2014 09:14:23 +0200 Subject: [PATCH 0105/1288] gitian: make linux qt intermediate deterministic A qt installation date snuck into the host utils (lrelease etc) This doesn't affect the end product, so no dependency version bump. It also doesn't explain why gavin's and mine build is different --- contrib/gitian-descriptors/qt-linux.yml | 1 + doc/release-process.md | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/gitian-descriptors/qt-linux.yml b/contrib/gitian-descriptors/qt-linux.yml index 1462df3289..b163b4bb8c 100644 --- a/contrib/gitian-descriptors/qt-linux.yml +++ b/contrib/gitian-descriptors/qt-linux.yml @@ -40,6 +40,7 @@ script: | tar xzf qt-everywhere-opensource-src-4.6.4.tar.gz cd qt-everywhere-opensource-src-4.6.4 QTBUILDDIR=$(pwd) + sed 's/TODAY=`date +%Y-%m-%d`/TODAY=2011-01-30/' -i configure # Need to build 4.6-versioned host utilities as well (lrelease/qrc/lupdate/...) ./configure -prefix $INSTALLPREFIX -confirm-license -release -opensource -no-qt3support -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-declarative -no-script -no-scripttools -no-javascript-jit -no-webkit -no-svg -no-xmlpatterns -no-sql-sqlite -no-nis -no-cups -no-iconv -no-dbus -no-gif -no-libtiff -no-opengl -nomake examples -nomake demos -nomake docs diff --git a/doc/release-process.md b/doc/release-process.md index 6d08c48496..10c03de162 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -93,8 +93,8 @@ Release Process 571789867d172500fa96d63d0ba8c5b1e1a3d6f44f720eddf2f93665affc88b3 bitcoin-deps-linux64-gitian-r5.zip f29b7d9577417333fb56e023c2977f5726a7c297f320b175a4108cf7cd4c2d29 boost-linux32-1.55.0-gitian-r1.zip 88232451c4104f7eb16e469ac6474fd1231bd485687253f7b2bdf46c0781d535 boost-linux64-1.55.0-gitian-r1.zip - 74ec2d301cf1a9d03b194153f545102ba45dad02b390485212fe6717de486361 qt-linux32-4.6.4-gitian-r1.tar.gz - 01d0477e299467f09280f15424781154e2b1ea4072c5edb16e044c234954fd9a qt-linux64-4.6.4-gitian-r1.tar.gz + 57e57dbdadc818cd270e7e00500a5e1085b3bcbdef69a885f0fb7573a8d987e1 qt-linux32-4.6.4-gitian-r1.tar.gz + 60eb4b9c5779580b7d66529efa5b2836ba1a70edde2a0f3f696d647906a826be qt-linux64-4.6.4-gitian-r1.tar.gz 60dc2d3b61e9c7d5dbe2f90d5955772ad748a47918ff2d8b74e8db9b1b91c909 boost-win32-1.55.0-gitian-r6.zip f65fcaf346bc7b73bc8db3a8614f4f6bee2f61fcbe495e9881133a7c2612a167 boost-win64-1.55.0-gitian-r6.zip 97e62002d338885336bb24e7cbb9471491294bd8857af7a83d18c0961f864ec0 bitcoin-deps-win32-gitian-r11.zip From 1411a51feffe327956350417079104f573caeb5d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 2 Jun 2014 11:01:02 +0200 Subject: [PATCH 0106/1288] doc: Update hash in release process for new windows deps intermediate This was forgotten in 25d4911. --- doc/release-process.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/release-process.md b/doc/release-process.md index 10c03de162..60b93b7680 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -97,8 +97,8 @@ Release Process 60eb4b9c5779580b7d66529efa5b2836ba1a70edde2a0f3f696d647906a826be qt-linux64-4.6.4-gitian-r1.tar.gz 60dc2d3b61e9c7d5dbe2f90d5955772ad748a47918ff2d8b74e8db9b1b91c909 boost-win32-1.55.0-gitian-r6.zip f65fcaf346bc7b73bc8db3a8614f4f6bee2f61fcbe495e9881133a7c2612a167 boost-win64-1.55.0-gitian-r6.zip - 97e62002d338885336bb24e7cbb9471491294bd8857af7a83d18c0961f864ec0 bitcoin-deps-win32-gitian-r11.zip - ee3ea2d5aac1a67ea6bfbea2c04068a7c0940616ce48ee4f37c264bb9d4438ef bitcoin-deps-win64-gitian-r11.zip + acd59690a49dfbad6b436379843fe4ad1857ad91c603d52506690bc55f2a01a4 bitcoin-deps-win32-gitian-r12.zip + a3e5a62fcdad81f758e41848035e6a27be390981a14d590f2cf2509f87417a42 bitcoin-deps-win64-gitian-r12.zip 963e3e5e85879010a91143c90a711a5d1d5aba992e38672cdf7b54e42c56b2f1 qt-win32-5.2.0-gitian-r3.zip 751c579830d173ef3e6f194e83d18b92ebef6df03289db13ab77a52b6bc86ef0 qt-win64-5.2.0-gitian-r3.zip e2e403e1a08869c7eed4d4293bce13d51ec6a63592918b90ae215a0eceb44cb4 protobuf-win32-2.5.0-gitian-r4.zip From 91855f279d27c3772b70c6e491684ed74684685e Mon Sep 17 00:00:00 2001 From: tm314159 Date: Mon, 2 Jun 2014 11:32:33 -0700 Subject: [PATCH 0107/1288] Properly initialize CWallet::nTimeFirstKey --- src/wallet.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wallet.h b/src/wallet.h index 96074151ad..d9d071c2b9 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -151,6 +151,7 @@ public: nOrderPosNext = 0; nNextResend = 0; nLastResend = 0; + nTimeFirstKey = 0; } CWallet(std::string strWalletFileIn) { From 65f78a111ff52c2212cc0a423662e7a41d1206dd Mon Sep 17 00:00:00 2001 From: Ashley Holman Date: Fri, 23 May 2014 12:09:59 -0500 Subject: [PATCH 0108/1288] Qt: Add GUI view of peer information. #4133 --- src/qt/Makefile.am | 3 + src/qt/clientmodel.cpp | 9 +- src/qt/clientmodel.h | 3 + src/qt/forms/rpcconsole.ui | 275 +++++++++++++++++++++++++++++++++++++ src/qt/guiutil.cpp | 48 +++++++ src/qt/guiutil.h | 6 + src/qt/peertablemodel.cpp | 238 ++++++++++++++++++++++++++++++++ src/qt/peertablemodel.h | 79 +++++++++++ src/qt/rpcconsole.cpp | 192 ++++++++++++++++++++++++-- src/qt/rpcconsole.h | 29 ++++ 10 files changed, 870 insertions(+), 12 deletions(-) create mode 100644 src/qt/peertablemodel.cpp create mode 100644 src/qt/peertablemodel.h diff --git a/src/qt/Makefile.am b/src/qt/Makefile.am index 648971bd8f..1d85113d78 100644 --- a/src/qt/Makefile.am +++ b/src/qt/Makefile.am @@ -126,6 +126,7 @@ QT_MOC_CPP = \ moc_optionsdialog.cpp \ moc_optionsmodel.cpp \ moc_overviewpage.cpp \ + moc_peertablemodel.cpp \ moc_paymentserver.cpp \ moc_qvalidatedlineedit.cpp \ moc_qvaluecombobox.cpp \ @@ -191,6 +192,7 @@ BITCOIN_QT_H = \ overviewpage.h \ paymentrequestplus.h \ paymentserver.h \ + peertablemodel.h \ qvalidatedlineedit.h \ qvaluecombobox.h \ receivecoinsdialog.h \ @@ -294,6 +296,7 @@ BITCOIN_QT_CPP += \ overviewpage.cpp \ paymentrequestplus.cpp \ paymentserver.cpp \ + peertablemodel.cpp \ receivecoinsdialog.cpp \ receiverequestdialog.cpp \ recentrequeststablemodel.cpp \ diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index d1f68ebd22..ce773e0f82 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -5,6 +5,7 @@ #include "clientmodel.h" #include "guiconstants.h" +#include "peertablemodel.h" #include "alert.h" #include "chainparams.h" @@ -22,11 +23,12 @@ static const int64_t nClientStartupTime = GetTime(); ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) : - QObject(parent), optionsModel(optionsModel), + QObject(parent), optionsModel(optionsModel), peerTableModel(0), cachedNumBlocks(0), cachedReindexing(0), cachedImporting(0), numBlocksAtStartup(-1), pollTimer(0) { + peerTableModel = new PeerTableModel(this); pollTimer = new QTimer(this); connect(pollTimer, SIGNAL(timeout()), this, SLOT(updateTimer())); pollTimer->start(MODEL_UPDATE_DELAY); @@ -173,6 +175,11 @@ OptionsModel *ClientModel::getOptionsModel() return optionsModel; } +PeerTableModel *ClientModel::getPeerTableModel() +{ + return peerTableModel; +} + QString ClientModel::formatFullVersion() const { return QString::fromStdString(FormatFullVersion()); diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h index cab853d92d..c18d30178b 100644 --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -9,6 +9,7 @@ class AddressTableModel; class OptionsModel; +class PeerTableModel; class TransactionTableModel; class CWallet; @@ -42,6 +43,7 @@ public: ~ClientModel(); OptionsModel *getOptionsModel(); + PeerTableModel *getPeerTableModel(); //! Return number of connections, default is in- and outbound (total) int getNumConnections(unsigned int flags = CONNECTIONS_ALL) const; @@ -71,6 +73,7 @@ public: private: OptionsModel *optionsModel; + PeerTableModel *peerTableModel; int cachedNumBlocks; bool cachedReindexing; diff --git a/src/qt/forms/rpcconsole.ui b/src/qt/forms/rpcconsole.ui index fcb6bb60bb..bf737d9b99 100644 --- a/src/qt/forms/rpcconsole.ui +++ b/src/qt/forms/rpcconsole.ui @@ -652,6 +652,281 @@ + + + &Peers + + + + + + + 0 + 0 + + + + Select a peer to view detailed information. + + + 3 + + + + + + + + 0 + 0 + + + + Qt::ScrollBarAlwaysOff + + + QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed + + + true + + + + + + + + 0 + 0 + + + + + 3 + + + + + Version: + + + + + + + N/A + + + + + + + Last Receive: + + + + + + + User Agent: + + + + + + + N/A + + + + + + + + 160 + 0 + + + + N/A + + + + + + + Ping Time: + + + + + + + + 0 + 0 + + + + N/A + + + + + + + Connection Time: + + + + + + + N/A + + + + + + + N/A + + + + + + + Starting Height: + + + + + + + N/A + + + + + + + Bytes Sent: + + + + + + + Bytes Received: + + + + + + + N/A + + + + + + + Ban Score: + + + + + + + N/A + + + + + + + Direction: + + + + + + + N/A + + + + + + + Sync Node: + + + + + + + N/A + + + + + + + Last Send: + + + + + + + Services: + + + + + + + IP Address/port: + + + + + + + N/A + + + + + + + N/A + + + + + + + N/A + + + + + + + + 0 + 0 + + + + + + + + + diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 7b264d27c7..851c0130ed 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -11,6 +11,7 @@ #include "core.h" #include "init.h" +#include "protocol.h" #include "util.h" #ifdef WIN32 @@ -750,4 +751,51 @@ QString boostPathToQString(const boost::filesystem::path &path) } #endif +QString formatDurationStr(int secs) +{ + QStringList strList; + int days = secs / 86400; + int hours = (secs % 86400) / 3600; + int mins = (secs % 3600) / 60; + int seconds = secs % 60; + + if (days) + strList.append(QString(QObject::tr("%1 d")).arg(days)); + if (hours) + strList.append(QString(QObject::tr("%1 h")).arg(hours)); + if (mins) + strList.append(QString(QObject::tr("%1 m")).arg(mins)); + if (seconds || (!days && !hours && !mins)) + strList.append(QString(QObject::tr("%1 s")).arg(seconds)); + + return strList.join(" "); +} + +QString formatServicesStr(uint64_t mask) +{ + QStringList strList; + + // Just scan the last 8 bits for now. + for (int i=0; i < 8; i++) { + uint64_t check = 1 << i; + if (mask & check) + { + switch (check) + { + case NODE_NETWORK: + strList.append(QObject::tr("NETWORK")); + break; + default: + strList.append(QString("%1[%2]").arg(QObject::tr("UNKNOWN")).arg(check)); + } + } + } + + if (strList.size()) + return strList.join(" & "); + else + return QObject::tr("None"); + +} + } // namespace GUIUtil diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 4f9416d1af..ea6b7de872 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -173,6 +173,12 @@ namespace GUIUtil /* Convert OS specific boost path to QString through UTF-8 */ QString boostPathToQString(const boost::filesystem::path &path); + /* Convert seconds into a QString with days, hours, mins, secs */ + QString formatDurationStr(int secs); + + /* Format CNodeStats.nServices bitmask into a user-readable string */ + QString formatServicesStr(uint64_t mask); + } // namespace GUIUtil #endif // GUIUTIL_H diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp new file mode 100644 index 0000000000..fba9d84e77 --- /dev/null +++ b/src/qt/peertablemodel.cpp @@ -0,0 +1,238 @@ +// Copyright (c) 2011-2013 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "peertablemodel.h" + +#include "clientmodel.h" + +#include "net.h" +#include "sync.h" + +#include +#include +#include + +bool NodeLessThan::operator()(const CNodeCombinedStats &left, const CNodeCombinedStats &right) const +{ + const CNodeStats *pLeft = &(left.nodestats); + const CNodeStats *pRight = &(right.nodestats); + + if (order == Qt::DescendingOrder) + std::swap(pLeft, pRight); + + switch(column) + { + case PeerTableModel::Address: + return pLeft->addrName.compare(pRight->addrName) < 0; + case PeerTableModel::Subversion: + return pLeft->cleanSubVer.compare(pRight->cleanSubVer) < 0; + case PeerTableModel::Height: + return pLeft->nStartingHeight < pRight->nStartingHeight; + } + + return false; +} + +// private implementation +class PeerTablePriv +{ +public: + /** Local cache of peer information */ + QList cachedNodeStats; + /** Column to sort nodes by */ + int sortColumn; + /** Order (ascending or descending) to sort nodes by */ + Qt::SortOrder sortOrder; + /** Index of rows by node ID */ + std::map mapNodeRows; + + /** Pull a full list of peers from vNodes into our cache */ + void refreshPeers() { + TRY_LOCK(cs_vNodes, lockNodes); + { + if (!lockNodes) + { + // skip the refresh if we can't immediately get the lock + return; + } + cachedNodeStats.clear(); +#if QT_VERSION >= 0x040700 + cachedNodeStats.reserve(vNodes.size()); +#endif + BOOST_FOREACH(CNode* pnode, vNodes) + { + CNodeCombinedStats stats; + stats.statestats.nMisbehavior = -1; + pnode->copyStats(stats.nodestats); + cachedNodeStats.append(stats); + } + } + + // if we can, retrieve the CNodeStateStats for each node. + TRY_LOCK(cs_main, lockMain); + { + if (lockMain) + { + BOOST_FOREACH(CNodeCombinedStats &stats, cachedNodeStats) + { + GetNodeStateStats(stats.nodestats.nodeid, stats.statestats); + } + } + } + + + if (sortColumn >= 0) + // sort cacheNodeStats (use stable sort to prevent rows jumping around unneceesarily) + qStableSort(cachedNodeStats.begin(), cachedNodeStats.end(), NodeLessThan(sortColumn, sortOrder)); + + // build index map + mapNodeRows.clear(); + int row = 0; + BOOST_FOREACH(CNodeCombinedStats &stats, cachedNodeStats) + { + mapNodeRows.insert(std::pair(stats.nodestats.nodeid, row++)); + } + } + + int size() + { + return cachedNodeStats.size(); + } + + CNodeCombinedStats *index(int idx) + { + if(idx >= 0 && idx < cachedNodeStats.size()) { + return &cachedNodeStats[idx]; + } + else + { + return 0; + } + } + +}; + +PeerTableModel::PeerTableModel(ClientModel *parent) : + QAbstractTableModel(parent),clientModel(parent),timer(0) +{ + columns << tr("Address") << tr("User Agent") << tr("Start Height"); + priv = new PeerTablePriv(); + // default to unsorted + priv->sortColumn = -1; + + // set up timer for auto refresh + timer = new QTimer(); + connect(timer, SIGNAL(timeout()), SLOT(refresh())); + + // load initial data + refresh(); +} + +void PeerTableModel::startAutoRefresh(int msecs) +{ + timer->setInterval(1000); + timer->start(); +} + +void PeerTableModel::stopAutoRefresh() +{ + timer->stop(); +} + +int PeerTableModel::rowCount(const QModelIndex &parent) const +{ + Q_UNUSED(parent); + return priv->size(); +} + +int PeerTableModel::columnCount(const QModelIndex &parent) const +{ + Q_UNUSED(parent); + return 3; +} + +QVariant PeerTableModel::data(const QModelIndex &index, int role) const +{ + if(!index.isValid()) + return QVariant(); + + CNodeCombinedStats *rec = static_cast(index.internalPointer()); + + if(role == Qt::DisplayRole) + { + switch(index.column()) + { + case Address: + return QVariant(rec->nodestats.addrName.c_str()); + case Subversion: + return QVariant(rec->nodestats.cleanSubVer.c_str()); + case Height: + return rec->nodestats.nStartingHeight; + } + } + return QVariant(); +} + +QVariant PeerTableModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if(orientation == Qt::Horizontal) + { + if(role == Qt::DisplayRole && section < columns.size()) + { + return columns[section]; + } + } + return QVariant(); +} + +Qt::ItemFlags PeerTableModel::flags(const QModelIndex &index) const +{ + if(!index.isValid()) + return 0; + + Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled; + return retval; +} + +QModelIndex PeerTableModel::index(int row, int column, const QModelIndex &parent) const +{ + Q_UNUSED(parent); + CNodeCombinedStats *data = priv->index(row); + + if (data) + { + return createIndex(row, column, data); + } + else + { + return QModelIndex(); + } +} + +const CNodeCombinedStats *PeerTableModel::getNodeStats(int idx) { + return priv->index(idx); +} + +void PeerTableModel::refresh() +{ + emit layoutAboutToBeChanged(); + priv->refreshPeers(); + emit layoutChanged(); +} + +int PeerTableModel::getRowByNodeId(NodeId nodeid) +{ + std::map::iterator it = priv->mapNodeRows.find(nodeid); + if (it == priv->mapNodeRows.end()) + return -1; + + return it->second; +} + +void PeerTableModel::sort(int column, Qt::SortOrder order) +{ + priv->sortColumn = column; + priv->sortOrder = order; + refresh(); +} diff --git a/src/qt/peertablemodel.h b/src/qt/peertablemodel.h new file mode 100644 index 0000000000..d947e21240 --- /dev/null +++ b/src/qt/peertablemodel.h @@ -0,0 +1,79 @@ +// Copyright (c) 2011-2013 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef PEERTABLEMODEL_H +#define PEERTABLEMODEL_H + +#include "main.h" +#include "net.h" + +#include +#include + +class PeerTablePriv; +class ClientModel; + +class QTimer; + +struct CNodeCombinedStats { + CNodeStats nodestats; + CNodeStateStats statestats; +}; + +class NodeLessThan +{ +public: + NodeLessThan(int nColumn, Qt::SortOrder fOrder): + column(nColumn), order(fOrder) {} + bool operator()(const CNodeCombinedStats &left, const CNodeCombinedStats &right) const; + +private: + int column; + Qt::SortOrder order; +}; + +/** + Qt model providing information about connected peers, similar to the + "getpeerinfo" RPC call. Used by the rpc console UI. + */ +class PeerTableModel : public QAbstractTableModel +{ + Q_OBJECT + +public: + explicit PeerTableModel(ClientModel *parent = 0); + const CNodeCombinedStats *getNodeStats(int idx); + int getRowByNodeId(NodeId nodeid); + void startAutoRefresh(int msecs); + void stopAutoRefresh(); + + enum ColumnIndex { + Address = 0, + Subversion = 1, + Height = 2 + }; + + /** @name Methods overridden from QAbstractTableModel + @{*/ + int rowCount(const QModelIndex &parent) const; + int columnCount(const QModelIndex &parent) const; + QVariant data(const QModelIndex &index, int role) const; + QVariant headerData(int section, Qt::Orientation orientation, int role) const; + QModelIndex index(int row, int column, const QModelIndex &parent) const; + Qt::ItemFlags flags(const QModelIndex &index) const; + void sort(int column, Qt::SortOrder order); + /*@}*/ + +public slots: + void refresh(); + +private: + ClientModel *clientModel; + QStringList columns; + PeerTablePriv *priv; + QTimer *timer; + +}; + +#endif // PEERTABLEMODEL_H diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 0a46a722e4..ed048cf3cc 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -7,6 +7,10 @@ #include "clientmodel.h" #include "guiutil.h" +#include "peertablemodel.h" + +#include "main.h" +#include "util.h" #include "rpcserver.h" #include "rpcclient.h" @@ -195,6 +199,10 @@ RPCConsole::RPCConsole(QWidget *parent) : clientModel(0), historyPtr(0) { + detailNodeStats = CNodeCombinedStats(); + detailNodeStats.nodestats.nodeid = -1; + detailNodeStats.statestats.nMisbehavior = -1; + ui->setupUi(this); GUIUtil::restoreWindowGeometry("nRPCConsoleWindow", this->size(), this); @@ -214,6 +222,7 @@ RPCConsole::RPCConsole(QWidget *parent) : startExecutor(); setTrafficGraphRange(INITIAL_TRAFFIC_GRAPH_MINS); + ui->detailWidget->hide(); clear(); } @@ -277,6 +286,23 @@ void RPCConsole::setClientModel(ClientModel *model) updateTrafficStats(model->getTotalBytesRecv(), model->getTotalBytesSent()); connect(model, SIGNAL(bytesChanged(quint64,quint64)), this, SLOT(updateTrafficStats(quint64, quint64))); + // set up peer table + ui->peerWidget->setModel(model->getPeerTableModel()); + ui->peerWidget->verticalHeader()->hide(); + ui->peerWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); + ui->peerWidget->setSelectionBehavior(QAbstractItemView::SelectRows); + ui->peerWidget->setSelectionMode(QAbstractItemView::SingleSelection); + ui->peerWidget->setColumnWidth(PeerTableModel::Address, ADDRESS_COLUMN_WIDTH); + columnResizingFixer = new GUIUtil::TableViewLastColumnResizingFixer(ui->peerWidget, MINIMUM_COLUMN_WIDTH, MINIMUM_COLUMN_WIDTH); + + // connect the peerWidget's selection model to our peerSelected() handler + QItemSelectionModel *peerSelectModel = ui->peerWidget->selectionModel(); + connect(peerSelectModel, + SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), + this, + SLOT(peerSelected(const QItemSelection &, const QItemSelection &))); + connect(model->getPeerTableModel(), SIGNAL(layoutChanged()), this, SLOT(peerLayoutChanged())); + // Provide initial values ui->clientVersion->setText(model->formatFullVersion()); ui->clientName->setText(model->clientName()); @@ -474,17 +500,7 @@ QString RPCConsole::FormatBytes(quint64 bytes) void RPCConsole::setTrafficGraphRange(int mins) { ui->trafficGraph->setGraphRangeMins(mins); - if(mins < 60) { - ui->lblGraphRange->setText(QString(tr("%1 m")).arg(mins)); - } else { - int hours = mins / 60; - int minsLeft = mins % 60; - if(minsLeft == 0) { - ui->lblGraphRange->setText(QString(tr("%1 h")).arg(hours)); - } else { - ui->lblGraphRange->setText(QString(tr("%1 h %2 m")).arg(hours).arg(minsLeft)); - } - } + ui->lblGraphRange->setText(GUIUtil::formatDurationStr(mins * 60)); } void RPCConsole::updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut) @@ -492,3 +508,157 @@ void RPCConsole::updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut) ui->lblBytesIn->setText(FormatBytes(totalBytesIn)); ui->lblBytesOut->setText(FormatBytes(totalBytesOut)); } + +void RPCConsole::peerSelected(const QItemSelection &selected, const QItemSelection &deselected) +{ + if (selected.indexes().isEmpty()) + return; + + // mark the cached banscore as unknown + detailNodeStats.statestats.nMisbehavior = -1; + + const CNodeCombinedStats *stats = clientModel->getPeerTableModel()->getNodeStats(selected.indexes().first().row()); + + if (stats) + { + detailNodeStats.nodestats.nodeid = stats->nodestats.nodeid; + updateNodeDetail(stats); + ui->detailWidget->show(); + ui->detailWidget->setDisabled(false); + } +} + +void RPCConsole::peerLayoutChanged() +{ + const CNodeCombinedStats *stats = NULL; + bool fUnselect = false, fReselect = false, fDisconnected = false; + + if (detailNodeStats.nodestats.nodeid == -1) + // no node selected yet + return; + + // find the currently selected row + int selectedRow; + QModelIndexList selectedModelIndex = ui->peerWidget->selectionModel()->selectedIndexes(); + if (selectedModelIndex.isEmpty()) + selectedRow = -1; + else + selectedRow = selectedModelIndex.first().row(); + + // check if our detail node has a row in the table (it may not necessarily + // be at selectedRow since its position can change after a layout change) + int detailNodeRow = clientModel->getPeerTableModel()->getRowByNodeId(detailNodeStats.nodestats.nodeid); + + if (detailNodeRow < 0) + { + // detail node dissapeared from table (node disconnected) + fUnselect = true; + fDisconnected = true; + detailNodeStats.nodestats.nodeid = 0; + } + else + { + if (detailNodeRow != selectedRow) + { + // detail node moved position + fUnselect = true; + fReselect = true; + } + + // get fresh stats on the detail node. + stats = clientModel->getPeerTableModel()->getNodeStats(detailNodeRow); + } + + if (fUnselect && selectedRow >= 0) + { + ui->peerWidget->selectionModel()->select(QItemSelection(selectedModelIndex.first(), selectedModelIndex.last()), + QItemSelectionModel::Deselect); + } + + if (fReselect) + { + ui->peerWidget->selectRow(detailNodeRow); + } + + if (stats) + updateNodeDetail(stats); + + if (fDisconnected) + { + ui->peerHeading->setText(QString(tr("Peer Disconnected"))); + ui->detailWidget->setDisabled(true); + QDateTime dt = QDateTime::fromTime_t(detailNodeStats.nodestats.nLastSend); + if (detailNodeStats.nodestats.nLastSend) + ui->peerLastSend->setText(dt.toString("yyyy-MM-dd hh:mm:ss")); + dt.setTime_t(detailNodeStats.nodestats.nLastRecv); + if (detailNodeStats.nodestats.nLastRecv) + ui->peerLastRecv->setText(dt.toString("yyyy-MM-dd hh:mm:ss")); + dt.setTime_t(detailNodeStats.nodestats.nTimeConnected); + ui->peerConnTime->setText(dt.toString("yyyy-MM-dd hh:mm:ss")); + } +} + +void RPCConsole::updateNodeDetail(const CNodeCombinedStats *combinedStats) +{ + CNodeStats stats = combinedStats->nodestats; + + // keep a copy of timestamps, used to display dates upon disconnect + detailNodeStats.nodestats.nLastSend = stats.nLastSend; + detailNodeStats.nodestats.nLastRecv = stats.nLastRecv; + detailNodeStats.nodestats.nTimeConnected = stats.nTimeConnected; + + // update the detail ui with latest node information + ui->peerHeading->setText(QString("%1").arg(tr("Node Detail"))); + ui->peerAddr->setText(QString(stats.addrName.c_str())); + ui->peerServices->setText(GUIUtil::formatServicesStr(stats.nServices)); + ui->peerLastSend->setText(stats.nLastSend ? GUIUtil::formatDurationStr(GetTime() - stats.nLastSend) : tr("never")); + ui->peerLastRecv->setText(stats.nLastRecv ? GUIUtil::formatDurationStr(GetTime() - stats.nLastRecv) : tr("never")); + ui->peerBytesSent->setText(FormatBytes(stats.nSendBytes)); + ui->peerBytesRecv->setText(FormatBytes(stats.nRecvBytes)); + ui->peerConnTime->setText(GUIUtil::formatDurationStr(GetTime() - stats.nTimeConnected)); + ui->peerPingTime->setText(stats.dPingTime == 0 ? tr("N/A") : QString(tr("%1 secs")).arg(QString::number(stats.dPingTime, 'f', 3))); + ui->peerVersion->setText(QString("%1").arg(stats.nVersion)); + ui->peerSubversion->setText(QString(stats.cleanSubVer.c_str())); + ui->peerDirection->setText(stats.fInbound ? tr("Inbound") : tr("Outbound")); + ui->peerHeight->setText(QString("%1").arg(stats.nStartingHeight)); + ui->peerSyncNode->setText(stats.fSyncNode ? tr("Yes") : tr("No")); + + // if we can, display the peer's ban score + CNodeStateStats statestats = combinedStats->statestats; + if (statestats.nMisbehavior >= 0) + { + // we have a new nMisbehavor value - update the cache + detailNodeStats.statestats.nMisbehavior = statestats.nMisbehavior; + } + + // pull the ban score from cache. -1 means it hasn't been retrieved yet (lock busy). + if (detailNodeStats.statestats.nMisbehavior >= 0) + ui->peerBanScore->setText(QString("%1").arg(detailNodeStats.statestats.nMisbehavior)); + else + ui->peerBanScore->setText(tr("Fetching...")); +} + +void RPCConsole::resizeEvent(QResizeEvent *event) +{ + QWidget::resizeEvent(event); + columnResizingFixer->stretchColumnWidth(PeerTableModel::Address); +} + +void RPCConsole::showEvent(QShowEvent *event) +{ + QWidget::showEvent(event); + + // peerWidget needs a resize in case the dialog has non-default geometry + columnResizingFixer->stretchColumnWidth(PeerTableModel::Address); + + // start the PeerTableModel refresh timer + clientModel->getPeerTableModel()->startAutoRefresh(1000); +} + +void RPCConsole::hideEvent(QHideEvent *event) +{ + QWidget::hideEvent(event); + + // stop PeerTableModel auto refresh + clientModel->getPeerTableModel()->stopAutoRefresh(); +} diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 091a6d294f..c17d5397ec 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -5,10 +5,18 @@ #ifndef RPCCONSOLE_H #define RPCCONSOLE_H +#include "guiutil.h" +#include "net.h" + +#include "peertablemodel.h" + #include class ClientModel; +class QItemSelection; +class CNodeCombinedStats; + namespace Ui { class RPCConsole; } @@ -35,6 +43,19 @@ public: protected: virtual bool eventFilter(QObject* obj, QEvent *event); +private: + /** show detailed information on ui about selected node */ + void updateNodeDetail(const CNodeCombinedStats *combinedStats); + + enum ColumnWidths + { + ADDRESS_COLUMN_WIDTH = 250, + MINIMUM_COLUMN_WIDTH = 120 + }; + + /** track the node that we are currently viewing detail on in the peers tab */ + CNodeCombinedStats detailNodeStats; + private slots: void on_lineEdit_returnPressed(); void on_tabWidget_currentChanged(int index); @@ -44,6 +65,9 @@ private slots: void on_sldGraphRange_valueChanged(int value); /** update traffic statistics */ void updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut); + void resizeEvent(QResizeEvent *event); + void showEvent(QShowEvent *event); + void hideEvent(QHideEvent *event); public slots: void clear(); @@ -57,6 +81,10 @@ public slots: void browseHistory(int offset); /** Scroll console view to end */ void scrollToEnd(); + /** Handle selection of peer in peers list */ + void peerSelected(const QItemSelection &selected, const QItemSelection &deselected); + /** Handle updated peer information */ + void peerLayoutChanged(); signals: // For RPC command executor @@ -70,6 +98,7 @@ private: Ui::RPCConsole *ui; ClientModel *clientModel; QStringList history; + GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer; int historyPtr; void startExecutor(); From bbe1925ce3e627fd405d83e3c947e1f430a1d720 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 3 Jun 2014 14:42:20 +0200 Subject: [PATCH 0109/1288] [Qt] style police and small addition in rpcconsole - fix spaces, indentation and coding style glitches --- src/qt/clientmodel.cpp | 4 +++- src/qt/guiutil.cpp | 3 +-- src/qt/guiutil.h | 1 - src/qt/peertablemodel.cpp | 2 -- src/qt/peertablemodel.h | 7 ++++--- src/qt/receiverequestdialog.cpp | 2 +- src/qt/receiverequestdialog.h | 4 +++- src/qt/rpcconsole.cpp | 15 ++++++++------- src/qt/rpcconsole.h | 10 ++++++---- src/qt/transactiondesc.h | 1 + 10 files changed, 27 insertions(+), 22 deletions(-) diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index ce773e0f82..1c008428a3 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -23,7 +23,9 @@ static const int64_t nClientStartupTime = GetTime(); ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) : - QObject(parent), optionsModel(optionsModel), peerTableModel(0), + QObject(parent), + optionsModel(optionsModel), + peerTableModel(0), cachedNumBlocks(0), cachedReindexing(0), cachedImporting(0), numBlocksAtStartup(-1), pollTimer(0) diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 62db0487fc..1922d228c5 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -780,7 +780,7 @@ QString formatServicesStr(uint64_t mask) QStringList strList; // Just scan the last 8 bits for now. - for (int i=0; i < 8; i++) { + for (int i = 0; i < 8; i++) { uint64_t check = 1 << i; if (mask & check) { @@ -799,7 +799,6 @@ QString formatServicesStr(uint64_t mask) return strList.join(" & "); else return QObject::tr("None"); - } } // namespace GUIUtil diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index ea6b7de872..45c78b4e14 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -178,7 +178,6 @@ namespace GUIUtil /* Format CNodeStats.nServices bitmask into a user-readable string */ QString formatServicesStr(uint64_t mask); - } // namespace GUIUtil #endif // GUIUTIL_H diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp index fba9d84e77..db5ce639b1 100644 --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -81,7 +81,6 @@ public: } } - if (sortColumn >= 0) // sort cacheNodeStats (use stable sort to prevent rows jumping around unneceesarily) qStableSort(cachedNodeStats.begin(), cachedNodeStats.end(), NodeLessThan(sortColumn, sortOrder)); @@ -110,7 +109,6 @@ public: return 0; } } - }; PeerTableModel::PeerTableModel(ClientModel *parent) : diff --git a/src/qt/peertablemodel.h b/src/qt/peertablemodel.h index d947e21240..385bf0e0c1 100644 --- a/src/qt/peertablemodel.h +++ b/src/qt/peertablemodel.h @@ -11,10 +11,12 @@ #include #include -class PeerTablePriv; class ClientModel; +class PeerTablePriv; +QT_BEGIN_NAMESPACE class QTimer; +QT_END_NAMESPACE struct CNodeCombinedStats { CNodeStats nodestats; @@ -24,7 +26,7 @@ struct CNodeCombinedStats { class NodeLessThan { public: - NodeLessThan(int nColumn, Qt::SortOrder fOrder): + NodeLessThan(int nColumn, Qt::SortOrder fOrder) : column(nColumn), order(fOrder) {} bool operator()(const CNodeCombinedStats &left, const CNodeCombinedStats &right) const; @@ -73,7 +75,6 @@ private: QStringList columns; PeerTablePriv *priv; QTimer *timer; - }; #endif // PEERTABLEMODEL_H diff --git a/src/qt/receiverequestdialog.cpp b/src/qt/receiverequestdialog.cpp index 062638f2bc..d8dad15c0d 100644 --- a/src/qt/receiverequestdialog.cpp +++ b/src/qt/receiverequestdialog.cpp @@ -13,10 +13,10 @@ #include #include +#include #include #include #include -#include #if QT_VERSION < 0x050000 #include #endif diff --git a/src/qt/receiverequestdialog.h b/src/qt/receiverequestdialog.h index 5614ac635a..9b78e495c3 100644 --- a/src/qt/receiverequestdialog.h +++ b/src/qt/receiverequestdialog.h @@ -11,10 +11,12 @@ #include #include +class OptionsModel; + namespace Ui { class ReceiveRequestDialog; } -class OptionsModel; + QT_BEGIN_NAMESPACE class QMenu; QT_END_NAMESPACE diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index ed048cf3cc..3b7d37ff39 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -10,10 +10,9 @@ #include "peertablemodel.h" #include "main.h" -#include "util.h" - #include "rpcserver.h" #include "rpcclient.h" +#include "util.h" #include "json/json_spirit_value.h" #include @@ -297,10 +296,8 @@ void RPCConsole::setClientModel(ClientModel *model) // connect the peerWidget's selection model to our peerSelected() handler QItemSelectionModel *peerSelectModel = ui->peerWidget->selectionModel(); - connect(peerSelectModel, - SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), - this, - SLOT(peerSelected(const QItemSelection &, const QItemSelection &))); + connect(peerSelectModel, SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), + this, SLOT(peerSelected(const QItemSelection &, const QItemSelection &))); connect(model->getPeerTableModel(), SIGNAL(layoutChanged()), this, SLOT(peerLayoutChanged())); // Provide initial values @@ -511,6 +508,8 @@ void RPCConsole::updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut) void RPCConsole::peerSelected(const QItemSelection &selected, const QItemSelection &deselected) { + Q_UNUSED(deselected); + if (selected.indexes().isEmpty()) return; @@ -638,6 +637,8 @@ void RPCConsole::updateNodeDetail(const CNodeCombinedStats *combinedStats) ui->peerBanScore->setText(tr("Fetching...")); } +// We override the virtual resizeEvent of the QWidget to adjust tables column +// sizes as the tables width is proportional to the dialogs width. void RPCConsole::resizeEvent(QResizeEvent *event) { QWidget::resizeEvent(event); @@ -651,7 +652,7 @@ void RPCConsole::showEvent(QShowEvent *event) // peerWidget needs a resize in case the dialog has non-default geometry columnResizingFixer->stretchColumnWidth(PeerTableModel::Address); - // start the PeerTableModel refresh timer + // start PeerTableModel auto refresh clientModel->getPeerTableModel()->startAutoRefresh(1000); } diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index c17d5397ec..3fee34d00e 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -6,17 +6,19 @@ #define RPCCONSOLE_H #include "guiutil.h" -#include "net.h" - #include "peertablemodel.h" +#include "net.h" + #include class ClientModel; - -class QItemSelection; class CNodeCombinedStats; +QT_BEGIN_NAMESPACE +class QItemSelection; +QT_END_NAMESPACE + namespace Ui { class RPCConsole; } diff --git a/src/qt/transactiondesc.h b/src/qt/transactiondesc.h index f5a1328a71..4bd4293210 100644 --- a/src/qt/transactiondesc.h +++ b/src/qt/transactiondesc.h @@ -9,6 +9,7 @@ #include class TransactionRecord; + class CWallet; class CWalletTx; From 06a91d9698762fe56fca3bd33484bddc9f020405 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Fri, 23 May 2014 18:04:09 +0200 Subject: [PATCH 0110/1288] VerifyDB progress --- src/init.cpp | 2 +- src/main.cpp | 14 +++++++++++++- src/main.h | 11 +++++++++-- src/qt/bitcoingui.cpp | 27 +++++++++++++++++++++++++++ src/qt/bitcoingui.h | 5 +++++ src/qt/clientmodel.cpp | 10 ++++++++++ src/qt/clientmodel.h | 3 +++ src/qt/splashscreen.cpp | 2 ++ src/rpcblockchain.cpp | 2 +- src/ui_interface.h | 3 +++ 10 files changed, 74 insertions(+), 5 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index bc4924b48d..840a07d610 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -858,7 +858,7 @@ bool AppInit2(boost::thread_group& threadGroup) } uiInterface.InitMessage(_("Verifying blocks...")); - if (!VerifyDB(GetArg("-checklevel", 3), + if (!CVerifyDB().VerifyDB(GetArg("-checklevel", 3), GetArg("-checkblocks", 288))) { strLoadError = _("Corrupted block database detected"); break; diff --git a/src/main.cpp b/src/main.cpp index 18c00d90ac..30fa9c6d70 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2968,7 +2968,17 @@ bool static LoadBlockIndexDB() return true; } -bool VerifyDB(int nCheckLevel, int nCheckDepth) +CVerifyDB::CVerifyDB() +{ + uiInterface.ShowProgress(_("Verifying blocks..."), 0); +} + +CVerifyDB::~CVerifyDB() +{ + uiInterface.ShowProgress("", 100); +} + +bool CVerifyDB::VerifyDB(int nCheckLevel, int nCheckDepth) { LOCK(cs_main); if (chainActive.Tip() == NULL || chainActive.Tip()->pprev == NULL) @@ -2989,6 +2999,7 @@ bool VerifyDB(int nCheckLevel, int nCheckDepth) for (CBlockIndex* pindex = chainActive.Tip(); pindex && pindex->pprev; pindex = pindex->pprev) { boost::this_thread::interruption_point(); + uiInterface.ShowProgress(_("Verifying blocks..."), std::max(1, std::min(99, (int)(((double)(chainActive.Height() - pindex->nHeight)) / (double)nCheckDepth * (nCheckLevel >= 4 ? 50 : 100))))); if (pindex->nHeight < chainActive.Height()-nCheckDepth) break; CBlock block; @@ -3028,6 +3039,7 @@ bool VerifyDB(int nCheckLevel, int nCheckDepth) CBlockIndex *pindex = pindexState; while (pindex != chainActive.Tip()) { boost::this_thread::interruption_point(); + uiInterface.ShowProgress(_("Verifying blocks..."), std::max(1, std::min(99, 100 - (int)(((double)(chainActive.Height() - pindex->nHeight)) / (double)nCheckDepth * 50)))); pindex = chainActive.Next(pindex); CBlock block; if (!ReadBlockFromDisk(block, pindex)) diff --git a/src/main.h b/src/main.h index 8a05eb60d2..42cf4a0861 100644 --- a/src/main.h +++ b/src/main.h @@ -144,8 +144,6 @@ bool InitBlockIndex(); bool LoadBlockIndex(); /** Unload database information */ void UnloadBlockIndex(); -/** Verify consistency of the block and coin databases */ -bool VerifyDB(int nCheckLevel, int nCheckDepth); /** Print the loaded block tree */ void PrintBlockTree(); /** Process protocol messages received from a given node */ @@ -1024,6 +1022,15 @@ public: std::string GetRejectReason() const { return strRejectReason; } }; +/** RAII wrapper for VerifyDB: Verify consistency of the block and coin databases */ +class CVerifyDB { +public: + + CVerifyDB(); + ~CVerifyDB(); + bool VerifyDB(int nCheckLevel, int nCheckDepth); +}; + /** An in-memory indexed chain of blocks. */ class CChain { private: diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 68ae8b4668..3469f990ac 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -409,6 +410,9 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel) // Receive and report messages from client model connect(clientModel, SIGNAL(message(QString,QString,unsigned int)), this, SLOT(message(QString,QString,unsigned int))); + // Show progress dialog + connect(clientModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int))); + rpcConsole->setClientModel(clientModel); #ifdef ENABLE_WALLET if(walletFrame) @@ -949,6 +953,29 @@ void BitcoinGUI::detectShutdown() } } +void BitcoinGUI::showProgress(const QString &title, int nProgress) +{ + if (nProgress == 0) + { + progressDialog = new QProgressDialog(title, "", 0, 100); + progressDialog->setWindowModality(Qt::ApplicationModal); + progressDialog->setMinimumDuration(0); + progressDialog->setCancelButton(0); + progressDialog->setAutoClose(false); + progressDialog->setValue(0); + } + else if (nProgress == 100) + { + if (progressDialog) + { + progressDialog->close(); + progressDialog->deleteLater(); + } + } + else if (progressDialog) + progressDialog->setValue(nProgress); +} + static bool ThreadSafeMessageBox(BitcoinGUI *gui, const std::string& message, const std::string& caption, unsigned int style) { bool modal = (style & CClientUIInterface::MODAL); diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index b4675b95ac..275fa35f39 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -26,6 +26,7 @@ QT_BEGIN_NAMESPACE class QAction; class QLabel; class QProgressBar; +class QProgressDialog; QT_END_NAMESPACE /** @@ -73,6 +74,7 @@ private: QLabel *labelBlocksIcon; QLabel *progressBarLabel; QProgressBar *progressBar; + QProgressDialog *progressDialog; QMenuBar *appMenuBar; QAction *overviewAction; @@ -191,6 +193,9 @@ private slots: /** called by a timer to check if fRequestShutdown has been set **/ void detectShutdown(); + + /** Show progress dialog e.g. for verifychain */ + void showProgress(const QString &title, int nProgress); }; #endif // BITCOINGUI_H diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index ce773e0f82..656c8bd113 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -206,6 +206,14 @@ QString ClientModel::formatClientStartupTime() const } // Handlers for core signals +static void ShowProgress(ClientModel *clientmodel, const std::string &title, int nProgress) +{ + // emits signal "showProgress" + QMetaObject::invokeMethod(clientmodel, "showProgress", Qt::QueuedConnection, + Q_ARG(QString, QString::fromStdString(title)), + Q_ARG(int, nProgress)); +} + static void NotifyBlocksChanged(ClientModel *clientmodel) { // This notification is too frequent. Don't trigger a signal. @@ -230,6 +238,7 @@ static void NotifyAlertChanged(ClientModel *clientmodel, const uint256 &hash, Ch void ClientModel::subscribeToCoreSignals() { // Connect signals to client + uiInterface.ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2)); uiInterface.NotifyBlocksChanged.connect(boost::bind(NotifyBlocksChanged, this)); uiInterface.NotifyNumConnectionsChanged.connect(boost::bind(NotifyNumConnectionsChanged, this, _1)); uiInterface.NotifyAlertChanged.connect(boost::bind(NotifyAlertChanged, this, _1, _2)); @@ -238,6 +247,7 @@ void ClientModel::subscribeToCoreSignals() void ClientModel::unsubscribeFromCoreSignals() { // Disconnect signals from client + uiInterface.ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2)); uiInterface.NotifyBlocksChanged.disconnect(boost::bind(NotifyBlocksChanged, this)); uiInterface.NotifyNumConnectionsChanged.disconnect(boost::bind(NotifyNumConnectionsChanged, this, _1)); uiInterface.NotifyAlertChanged.disconnect(boost::bind(NotifyAlertChanged, this, _1, _2)); diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h index c18d30178b..9c9a35b654 100644 --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -95,6 +95,9 @@ signals: //! Fired when a message should be reported to the user void message(const QString &title, const QString &message, unsigned int style); + // Show progress dialog e.g. for verifychain + void showProgress(const QString &title, int nProgress); + public slots: void updateTimer(); void updateNumConnections(int numConnections); diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 7c79b0efd0..1162e2d87f 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -129,6 +129,7 @@ void SplashScreen::subscribeToCoreSignals() { // Connect signals to client uiInterface.InitMessage.connect(boost::bind(InitMessage, this, _1)); + uiInterface.ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2)); #ifdef ENABLE_WALLET uiInterface.LoadWallet.connect(boost::bind(ConnectWallet, this, _1)); #endif @@ -138,6 +139,7 @@ void SplashScreen::unsubscribeFromCoreSignals() { // Disconnect signals from client uiInterface.InitMessage.disconnect(boost::bind(InitMessage, this, _1)); + uiInterface.ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2)); #ifdef ENABLE_WALLET if(pwalletMain) pwalletMain->ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2)); diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index a303b5d3ef..ff5057b526 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -427,7 +427,7 @@ Value verifychain(const Array& params, bool fHelp) if (params.size() > 1) nCheckDepth = params[1].get_int(); - return VerifyDB(nCheckLevel, nCheckDepth); + return CVerifyDB().VerifyDB(nCheckLevel, nCheckDepth); } Value getblockchaininfo(const Array& params, bool fHelp) diff --git a/src/ui_interface.h b/src/ui_interface.h index 7b655ac951..e1a3e04e12 100644 --- a/src/ui_interface.h +++ b/src/ui_interface.h @@ -94,6 +94,9 @@ public: /** A wallet has been loaded. */ boost::signals2::signal LoadWallet; + + /** Show progress e.g. for verifychain */ + boost::signals2::signal ShowProgress; }; extern CClientUIInterface uiInterface; From a98b8707dc5606a5c119a123b1b66d5e7ab5a815 Mon Sep 17 00:00:00 2001 From: Giuseppe Mazzotta Date: Tue, 3 Jun 2014 11:40:24 +0200 Subject: [PATCH 0111/1288] Some documentation fixes + link to my Docker/LXC guide I added a link to my guide about using docker containers + LXC (I am planning to maintain this at work for future bitcoin versions), then I mentioned other virtualization options (KVM, LXC). This commit includes a fix issue for documentation issue #4269 that consists in telling users to checkout correct bitcoin version before using the gitian descriptors (otherwise all hell can break loose). Also, I replaced URL for Debian 7.4 ISO with a correct one and added link to official Debian ISO sources. --- doc/gitian-building.md | 45 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/doc/gitian-building.md b/doc/gitian-building.md index 544bbc12c1..378a45eda5 100644 --- a/doc/gitian-building.md +++ b/doc/gitian-building.md @@ -34,19 +34,22 @@ Table of Contents - [Signing externally](#signing-externally) - [Uploading signatures](#uploading-signatures) +Preparing the Gitian builder host +--------------------------------- + +The first step is to prepare the host environment that will be used to perform the Gitian builds. +In this guide it is explained how to set up the environment, and how to get the builds started. + +Debian Linux was chosen as the host distribution because it has a lightweight install (in contrast to Ubuntu) and is readily available. +Any kind of virtualization can be used, for example: +- [VirtualBox](https://www.virtualbox.org/), covered by this guide +- [KVM](http://www.linux-kvm.org/page/Main_Page) +- [LXC](https://linuxcontainers.org/), see also [Gitian host docker container](https://github.com/gdm85/tenku/tree/master/docker/gitian-bitcoin-host/README.md). + +You can also install on actual hardware instead of using virtualization. + Create a new VirtualBox VM --------------------------- - -The first step is to create a new Virtual Machine, which will be explained in -this section. This VM will be used to do the Gitian builds. In this guide it -will be explained how to set up the environment, and how to get the builds -started. - -Debian Linux was chosen as the host distribution because it has a lightweight install (in -contrast to Ubuntu) and is readily available. We here show the steps for -VirtualBox [1], but any kind of virtualization can be used. You can also install -on actual hardware instead of using a VM, in this case you can skip this section. - In the VirtualBox GUI click "Create" and choose the following parameters in the wizard: ![](gitian-building/create_vm_page1.png) @@ -74,11 +77,11 @@ In the VirtualBox GUI click "Create" and choose the following parameters in the - Disk size: at least 40GB; as low as 20GB *may* be possible, but better to err on the safe side - Push the `Create` button -Get the [Debian 7.4 net installer](http://cdimage.debian.org/debian-cd/7.4.0/amd64/iso-cd/debian-7.4.0-amd64-netinst.iso). +Get the [Debian 7.4 net installer](http://ftp.at.debian.org/debian-jigdo/current/amd64/iso-cd/debian-7.4.0-amd64-netinst.iso) (a more recent minor version should also work, see also [Debian Network installation](https://www.debian.org/CD/netinst/)). This DVD image can be validated using a SHA256 hashing tool, for example on Unixy OSes by entering the following in a terminal: - echo "b712a141bc60269db217d3b3e456179bd6b181645f90e4aac9c42ed63de492e9 /home/orion/Downloads/debian-7.4.0-amd64-netinst.iso" | sha256sum -c + echo "b712a141bc60269db217d3b3e456179bd6b181645f90e4aac9c42ed63de492e9 debian-7.4.0-amd64-netinst.iso" | sha256sum -c # (must return OK) After creating the VM, we need to configure it. @@ -106,8 +109,6 @@ Then start the VM. On the first launch you will be asked for a CD or DVD image. ![](gitian-building/select_startup_disk.png) -[1] https://www.virtualbox.org/ - Installing Debian ------------------ @@ -279,11 +280,14 @@ cd .. **Note**: When sudo asks for a password, enter the password for the user *debian* not for *root*. -Clone the git repositories for bitcoin and gitian, +Clone the git repositories for bitcoin and gitian and then checkout the bitcoin version that you are willing to build. ```bash git clone https://github.com/devrandom/gitian-builder.git git clone https://github.com/bitcoin/bitcoin +cd bitcoin +git checkout v${VERSION} +cd .. ``` Setting up gitian images @@ -402,9 +406,6 @@ gitian build. Uploading signatures --------------------- -After building and signing you can push your signatures (both the `.assert` and -`.assert.sig` files) to the -[bitcoin/gitian.sigs](https://github.com/bitcoin/gitian.sigs/) repository, or -if not possible create a pull request. You can also mail the files to me -(laanwj@gmail.com) and I'll commit them. - +After building and signing you can push your signatures (both the `.assert` and `.assert.sig` files) to the +[bitcoin/gitian.sigs](https://github.com/bitcoin/gitian.sigs/) repository, or if not possible create a pull +request. You can also mail the files to me (laanwj@gmail.com) and I'll commit them. From d04fd3e2afaf9cdab21aa8f3abb5a5a2c48118cc Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 3 Jun 2014 12:55:33 -0400 Subject: [PATCH 0112/1288] CWallet: fix nTimeFirstKey init, by making constructor init common code Don't repeat yourself etc. --- src/wallet.h | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/wallet.h b/src/wallet.h index d9d071c2b9..8e2917188a 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -142,6 +142,17 @@ public: unsigned int nMasterKeyMaxID; CWallet() + { + SetNull(); + } + CWallet(std::string strWalletFileIn) + { + SetNull(); + + strWalletFile = strWalletFileIn; + fFileBacked = true; + } + void SetNull() { nWalletVersion = FEATURE_BASE; nWalletMaxVersion = FEATURE_BASE; @@ -153,18 +164,6 @@ public: nLastResend = 0; nTimeFirstKey = 0; } - CWallet(std::string strWalletFileIn) - { - nWalletVersion = FEATURE_BASE; - nWalletMaxVersion = FEATURE_BASE; - strWalletFile = strWalletFileIn; - fFileBacked = true; - nMasterKeyMaxID = 0; - pwalletdbEncryption = NULL; - nOrderPosNext = 0; - nNextResend = 0; - nLastResend = 0; - } std::map mapWallet; From 4a09e1df51267c6d2dec219c6f96a24b716cc251 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Mon, 2 Jun 2014 16:21:03 -0700 Subject: [PATCH 0113/1288] key.cpp: fail with a friendlier message on missing ssl EC support Previously if bitcoind is linked with an OpenSSL which is compiled without EC support, this is seen as an assertion failure "pKey != NULL" at key.cpp:134, which occurs after several seconds. It is an esoteric piece of knowledge to interpret this as "oops, I linked with the wrong OpenSSL", and because of the delay it may not even be noticed. The new output is : OpenSSL appears to lack support for elliptic curve cryptography. For more information, visit https://en.bitcoin.it/wiki/OpenSSL_and_EC_Libraries : Initialization sanity check failed. Bitcoin Core is shutting down. which occurs immediately after attempted startup. This also blocks in an InitSanityCheck() function which currently only checks for EC support but should eventually do more. See #4081. --- src/init.cpp | 21 +++++++++++++++++++++ src/key.cpp | 12 ++++++++++++ src/key.h | 3 +++ 3 files changed, 36 insertions(+) diff --git a/src/init.cpp b/src/init.cpp index bc4924b48d..b66231ff2c 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -11,6 +11,7 @@ #include "addrman.h" #include "checkpoints.h" +#include "key.h" #include "main.h" #include "miner.h" #include "net.h" @@ -385,6 +386,23 @@ void ThreadImport(std::vector vImportFiles) } } +/** Sanity checks + * Ensure that Bitcoin is running in a usable environment with all + * necessary library support. + */ +bool InitSanityCheck(void) +{ + if(!ECC_InitSanityCheck()) { + InitError("OpenSSL appears to lack support for elliptic curve cryptography. For more " + "information, visit https://en.bitcoin.it/wiki/OpenSSL_and_EC_Libraries"); + return false; + } + + // TODO: remaining sanity checks, see #4081 + + return true; +} + /** Initialize bitcoin. * @pre Parameters should be parsed and config file should be read. */ @@ -586,6 +604,9 @@ bool AppInit2(boost::thread_group& threadGroup) strWalletFile = GetArg("-wallet", "wallet.dat"); #endif // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log + // Sanity check + if (!InitSanityCheck()) + return InitError(_("Initialization sanity check failed. Bitcoin Core is shutting down.")); std::string strDataDir = GetDataDir().string(); #ifdef ENABLE_WALLET diff --git a/src/key.cpp b/src/key.cpp index aa24f0a622..4747beffb4 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -631,3 +631,15 @@ bool CExtPubKey::Derive(CExtPubKey &out, unsigned int nChild) const { out.nChild = nChild; return pubkey.Derive(out.pubkey, out.vchChainCode, nChild, vchChainCode); } + +bool ECC_InitSanityCheck() { + EC_KEY *pkey = EC_KEY_new_by_curve_name(NID_secp256k1); + if(pkey == NULL) + return false; + EC_KEY_free(pkey); + + // TODO Is there more EC functionality that could be missing? + return true; +} + + diff --git a/src/key.h b/src/key.h index 983775fd23..11dc65de8c 100644 --- a/src/key.h +++ b/src/key.h @@ -306,4 +306,7 @@ struct CExtKey { void SetMaster(const unsigned char *seed, unsigned int nSeedLen); }; +/** Check that required EC support is available at runtime */ +bool ECC_InitSanityCheck(void); + #endif From 71aaff393f06378150612fc618b6c3f84c1d2066 Mon Sep 17 00:00:00 2001 From: Kosta Zertsekel Date: Wed, 4 Jun 2014 07:36:45 +0300 Subject: [PATCH 0114/1288] Remove double-dash parameters from mapArgs Should be merged after pull request #4281 ("Add `-version` option to get just the version #4281"), because is changed "--help" to "-help". Checked that grep of 'mapArgs.count("--' returned only three places that are fixed by pull request #4281. --- src/util.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 205af738d5..752ebb7bf1 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -459,6 +459,7 @@ void ParseParameters(int argc, const char* const argv[]) { mapArgs.clear(); mapMultiArgs.clear(); + for (int i = 1; i < argc; i++) { std::string str(argv[i]); @@ -474,9 +475,15 @@ void ParseParameters(int argc, const char* const argv[]) if (boost::algorithm::starts_with(str, "/")) str = "-" + str.substr(1); #endif + if (str[0] != '-') break; + // Interpret --foo as -foo. + // If both --foo and -foo are set, the last takes effect. + if (str.length() > 1 && str[1] == '-') + str = str.substr(1); + mapArgs[str] = strValue; mapMultiArgs[str].push_back(strValue); } @@ -484,19 +491,8 @@ void ParseParameters(int argc, const char* const argv[]) // New 0.6 features: BOOST_FOREACH(const PAIRTYPE(string,string)& entry, mapArgs) { - string name = entry.first; - - // interpret --foo as -foo (as long as both are not set) - if (name.find("--") == 0) - { - std::string singleDash(name.begin()+1, name.end()); - if (mapArgs.count(singleDash) == 0) - mapArgs[singleDash] = entry.second; - name = singleDash; - } - // interpret -nofoo as -foo=0 (and -nofoo=0 as -foo=1) as long as -foo not set - InterpretNegativeSetting(name, mapArgs); + InterpretNegativeSetting(entry.first, mapArgs); } } From 1712adbe0b084b6907b82db350a51ab44f8c3117 Mon Sep 17 00:00:00 2001 From: jtimon Date: Fri, 7 Mar 2014 17:59:30 -0800 Subject: [PATCH 0115/1288] Add MiningRequiresPeers chain parameter --- src/chainparams.cpp | 1 + src/chainparams.h | 2 ++ src/miner.cpp | 5 +++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index f5cf846a01..ff104e7c84 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -246,6 +246,7 @@ public: } virtual bool RequireRPCPassword() const { return false; } + virtual bool MiningRequiresPeers() const { return false; } virtual Network NetworkID() const { return CChainParams::REGTEST; } }; static CRegTestParams regTestParams; diff --git a/src/chainparams.h b/src/chainparams.h index 5600b904cc..a73279fe67 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -59,6 +59,8 @@ public: int SubsidyHalvingInterval() const { return nSubsidyHalvingInterval; } virtual const CBlock& GenesisBlock() const = 0; virtual bool RequireRPCPassword() const { return true; } + /* Make miner wait to have peers to avoid wasting work */ + virtual bool MiningRequiresPeers() const { return true; } const string& DataDir() const { return strDataDir; } virtual Network NetworkID() const = 0; const vector& DNSSeeds() const { return vSeeds; } diff --git a/src/miner.cpp b/src/miner.cpp index 94fc8e3888..3d46a0d83e 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -512,7 +512,7 @@ void static BitcoinMiner(CWallet *pwallet) unsigned int nExtraNonce = 0; try { while (true) { - if (Params().NetworkID() != CChainParams::REGTEST) { + if (Params().MiningRequiresPeers()) { // Busy-wait for the network to come online so we don't waste time mining // on an obsolete chain. In regtest mode we expect to fly solo. while (vNodes.empty()) @@ -620,7 +620,8 @@ void static BitcoinMiner(CWallet *pwallet) // Check for stop or if block needs to be rebuilt boost::this_thread::interruption_point(); - if (vNodes.empty() && Params().NetworkID() != CChainParams::REGTEST) + // Regtest mode doesn't require peers + if (vNodes.empty() && Params().MiningRequiresPeers()) break; if (nBlockNonce >= 0xffff0000) break; From bfa9a1a638d69ec3edc2473eef5f2eee43af5a9d Mon Sep 17 00:00:00 2001 From: jtimon Date: Sun, 9 Mar 2014 13:36:55 -0700 Subject: [PATCH 0116/1288] Add MineBlocksOnDemand chain parameter --- src/chainparams.cpp | 1 + src/chainparams.h | 3 +++ src/miner.cpp | 5 ++--- src/rpcmining.cpp | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index ff104e7c84..d7205fa5cb 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -247,6 +247,7 @@ public: virtual bool RequireRPCPassword() const { return false; } virtual bool MiningRequiresPeers() const { return false; } + virtual bool MineBlocksOnDemand() const { return true; } virtual Network NetworkID() const { return CChainParams::REGTEST; } }; static CRegTestParams regTestParams; diff --git a/src/chainparams.h b/src/chainparams.h index a73279fe67..d76b1a2280 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -62,6 +62,9 @@ public: /* Make miner wait to have peers to avoid wasting work */ virtual bool MiningRequiresPeers() const { return true; } const string& DataDir() const { return strDataDir; } + /* Make miner stop after a block is found. In RPC, don't return + * until nGenProcLimit blocks are generated */ + virtual bool MineBlocksOnDemand() const { return false; } virtual Network NetworkID() const = 0; const vector& DNSSeeds() const { return vSeeds; } const std::vector &Base58Prefix(Base58Type type) const { return base58Prefixes[type]; } diff --git a/src/miner.cpp b/src/miner.cpp index 3d46a0d83e..e980fdc42d 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -580,9 +580,8 @@ void static BitcoinMiner(CWallet *pwallet) CheckWork(pblock, *pwallet, reservekey); SetThreadPriority(THREAD_PRIORITY_LOWEST); - // In regression test mode, stop mining after a block is found. This - // allows developers to controllably generate a block on demand. - if (Params().NetworkID() == CChainParams::REGTEST) + // In regression test mode, stop mining after a block is found. + if (Params().MineBlocksOnDemand()) throw boost::thread_interrupted(); break; diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 23876c603d..70adae1467 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -174,7 +174,7 @@ Value setgenerate(const Array& params, bool fHelp) } // -regtest mode: don't return until nGenProcLimit blocks are generated - if (fGenerate && Params().NetworkID() == CChainParams::REGTEST) + if (fGenerate && Params().MineBlocksOnDemand()) { int nHeightStart = 0; int nHeightEnd = 0; From 2595b9ac23735649f4601c27924821641611696e Mon Sep 17 00:00:00 2001 From: jtimon Date: Fri, 7 Mar 2014 22:47:56 -0800 Subject: [PATCH 0117/1288] Add DefaultMinerThreads chain parameter --- src/chainparams.cpp | 2 ++ src/chainparams.h | 3 +++ src/miner.cpp | 5 +++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index d7205fa5cb..64723978bb 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -112,6 +112,7 @@ public: nRPCPort = 8332; bnProofOfWorkLimit = ~uint256(0) >> 32; nSubsidyHalvingInterval = 210000; + nMinerThreads = 0; // Build the genesis block. Note that the output of the genesis coinbase cannot // be spent as it did not originally exist in the database. @@ -233,6 +234,7 @@ public: pchMessageStart[2] = 0xb5; pchMessageStart[3] = 0xda; nSubsidyHalvingInterval = 150; + nMinerThreads = 1; bnProofOfWorkLimit = ~uint256(0) >> 1; genesis.nTime = 1296688602; genesis.nBits = 0x207fffff; diff --git a/src/chainparams.h b/src/chainparams.h index d76b1a2280..f331d956fe 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -57,6 +57,8 @@ public: int GetDefaultPort() const { return nDefaultPort; } const uint256& ProofOfWorkLimit() const { return bnProofOfWorkLimit; } int SubsidyHalvingInterval() const { return nSubsidyHalvingInterval; } + /* Used if GenerateBitcoins is called with a negative number of threads */ + int DefaultMinerThreads() const { return nMinerThreads; } virtual const CBlock& GenesisBlock() const = 0; virtual bool RequireRPCPassword() const { return true; } /* Make miner wait to have peers to avoid wasting work */ @@ -82,6 +84,7 @@ protected: uint256 bnProofOfWorkLimit; int nSubsidyHalvingInterval; string strDataDir; + int nMinerThreads; vector vSeeds; std::vector base58Prefixes[MAX_BASE58_TYPES]; }; diff --git a/src/miner.cpp b/src/miner.cpp index e980fdc42d..44c2faaa4c 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -652,8 +652,9 @@ void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads) static boost::thread_group* minerThreads = NULL; if (nThreads < 0) { - if (Params().NetworkID() == CChainParams::REGTEST) - nThreads = 1; + // In regtest threads defaults to 1 + if (Params().DefaultMinerThreads()) + nThreads = Params().DefaultMinerThreads(); else nThreads = boost::thread::hardware_concurrency(); } From cb9bd83bba86e73e3720110ce47600b6f895573c Mon Sep 17 00:00:00 2001 From: jtimon Date: Sun, 9 Mar 2014 18:35:41 -0700 Subject: [PATCH 0118/1288] Add DefaultCheckMemPool chain parameter --- src/chainparams.cpp | 1 + src/chainparams.h | 2 ++ src/init.cpp | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 64723978bb..75a14c6013 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -250,6 +250,7 @@ public: virtual bool RequireRPCPassword() const { return false; } virtual bool MiningRequiresPeers() const { return false; } virtual bool MineBlocksOnDemand() const { return true; } + virtual bool DefaultCheckMemPool() const { return true; } virtual Network NetworkID() const { return CChainParams::REGTEST; } }; static CRegTestParams regTestParams; diff --git a/src/chainparams.h b/src/chainparams.h index f331d956fe..bc982ee040 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -63,6 +63,8 @@ public: virtual bool RequireRPCPassword() const { return true; } /* Make miner wait to have peers to avoid wasting work */ virtual bool MiningRequiresPeers() const { return true; } + /* Default value for -checkmempool argument */ + virtual bool DefaultCheckMemPool() const { return false; } const string& DataDir() const { return strDataDir; } /* Make miner stop after a block is found. In RPC, don't return * until nGenProcLimit blocks are generated */ diff --git a/src/init.cpp b/src/init.cpp index 840a07d610..a225c3f964 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -517,7 +517,8 @@ bool AppInit2(boost::thread_group& threadGroup) InitWarning(_("Warning: Deprecated argument -debugnet ignored, use -debug=net")); fBenchmark = GetBoolArg("-benchmark", false); - mempool.setSanityCheck(GetBoolArg("-checkmempool", RegTest())); + // Checkmempool defaults to true in regtest mode + mempool.setSanityCheck(GetBoolArg("-checkmempool", Params().DefaultCheckMemPool())); Checkpoints::fEnabled = GetBoolArg("-checkpoints", true); // -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency From 8d26721498eb608b1ee5fd4d10083739a77b5905 Mon Sep 17 00:00:00 2001 From: jtimon Date: Fri, 7 Mar 2014 23:06:22 -0800 Subject: [PATCH 0119/1288] Get rid of RegTest() --- src/chainparams.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/chainparams.h b/src/chainparams.h index bc982ee040..f0c90bf50f 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -111,8 +111,4 @@ inline bool TestNet() { return Params().NetworkID() == CChainParams::TESTNET; } -inline bool RegTest() { - return Params().NetworkID() == CChainParams::REGTEST; -} - #endif From d754f34e8d470d5d89e2bc31ff1ab60ae5889266 Mon Sep 17 00:00:00 2001 From: jtimon Date: Sat, 22 Mar 2014 19:52:26 +0100 Subject: [PATCH 0120/1288] Move majority constants to chainparams --- src/chainparams.cpp | 9 +++++++++ src/chainparams.h | 8 ++++++++ src/main.cpp | 34 ++++++++++++++-------------------- src/main.h | 5 +++-- 4 files changed, 34 insertions(+), 22 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 75a14c6013..86d80629eb 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -112,6 +112,9 @@ public: nRPCPort = 8332; bnProofOfWorkLimit = ~uint256(0) >> 32; nSubsidyHalvingInterval = 210000; + nEnforceBlockUpgradeMajority = 750; + nRejectBlockOutdatedMajority = 950; + nToCheckBlockUpgradeMajority = 1000; nMinerThreads = 0; // Build the genesis block. Note that the output of the genesis coinbase cannot @@ -199,6 +202,9 @@ public: vAlertPubKey = ParseHex("04302390343f91cc401d56d68b123028bf52e5fca1939df127f63c6467cdf9c8e2c14b61104cf817d0b780da337893ecc4aaff1309e536162dabbdb45200ca2b0a"); nDefaultPort = 18333; nRPCPort = 18332; + nEnforceBlockUpgradeMajority = 51; + nRejectBlockOutdatedMajority = 75; + nToCheckBlockUpgradeMajority = 100; strDataDir = "testnet3"; // Modify the testnet genesis block so the timestamp is valid for a later start. @@ -234,6 +240,9 @@ public: pchMessageStart[2] = 0xb5; pchMessageStart[3] = 0xda; nSubsidyHalvingInterval = 150; + nEnforceBlockUpgradeMajority = 750; + nRejectBlockOutdatedMajority = 950; + nToCheckBlockUpgradeMajority = 1000; nMinerThreads = 1; bnProofOfWorkLimit = ~uint256(0) >> 1; genesis.nTime = 1296688602; diff --git a/src/chainparams.h b/src/chainparams.h index f0c90bf50f..f400907d73 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -57,6 +57,11 @@ public: int GetDefaultPort() const { return nDefaultPort; } const uint256& ProofOfWorkLimit() const { return bnProofOfWorkLimit; } int SubsidyHalvingInterval() const { return nSubsidyHalvingInterval; } + /* Used to check majorities for block version upgrade */ + int EnforceBlockUpgradeMajority() const { return nEnforceBlockUpgradeMajority; } + int RejectBlockOutdatedMajority() const { return nRejectBlockOutdatedMajority; } + int ToCheckBlockUpgradeMajority() const { return nToCheckBlockUpgradeMajority; } + /* Used if GenerateBitcoins is called with a negative number of threads */ int DefaultMinerThreads() const { return nMinerThreads; } virtual const CBlock& GenesisBlock() const = 0; @@ -85,6 +90,9 @@ protected: int nRPCPort; uint256 bnProofOfWorkLimit; int nSubsidyHalvingInterval; + int nEnforceBlockUpgradeMajority; + int nRejectBlockOutdatedMajority; + int nToCheckBlockUpgradeMajority; string strDataDir; int nMinerThreads; vector vSeeds; diff --git a/src/main.cpp b/src/main.cpp index 30fa9c6d70..e6519864d8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2469,14 +2469,11 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex return state.DoS(100, error("AcceptBlock() : forked chain older than last checkpoint (height %d)", nHeight)); // Reject block.nVersion=1 blocks when 95% (75% on testnet) of the network has upgraded: - if (block.nVersion < 2) + if (block.nVersion < 2 && + CBlockIndex::IsSuperMajority(2, pindexPrev, Params().RejectBlockOutdatedMajority())) { - if ((!TestNet() && CBlockIndex::IsSuperMajority(2, pindexPrev, 950, 1000)) || - (TestNet() && CBlockIndex::IsSuperMajority(2, pindexPrev, 75, 100))) - { - return state.Invalid(error("AcceptBlock() : rejected nVersion=1 block"), - REJECT_OBSOLETE, "bad-version"); - } + return state.Invalid(error("AcceptBlock() : rejected nVersion=1 block"), + REJECT_OBSOLETE, "bad-version"); } } @@ -2517,19 +2514,15 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex, } // Enforce block.nVersion=2 rule that the coinbase starts with serialized block height - if (block.nVersion >= 2) + // if 750 of the last 1,000 blocks are version 2 or greater (51/100 if testnet): + if (block.nVersion >= 2 && + CBlockIndex::IsSuperMajority(2, pindex->pprev, Params().EnforceBlockUpgradeMajority())) { - // if 750 of the last 1,000 blocks are version 2 or greater (51/100 if testnet): - if ((!TestNet() && CBlockIndex::IsSuperMajority(2, pindex->pprev, 750, 1000)) || - (TestNet() && CBlockIndex::IsSuperMajority(2, pindex->pprev, 51, 100))) - { - CScript expect = CScript() << nHeight; - if (block.vtx[0].vin[0].scriptSig.size() < expect.size() || - !std::equal(expect.begin(), expect.end(), block.vtx[0].vin[0].scriptSig.begin())) { - pindex->nStatus |= BLOCK_FAILED_VALID; - return state.DoS(100, error("AcceptBlock() : block height mismatch in coinbase"), - REJECT_INVALID, "bad-cb-height"); - } + CScript expect = CScript() << nHeight; + if (block.vtx[0].vin[0].scriptSig.size() < expect.size() || + !std::equal(expect.begin(), expect.end(), block.vtx[0].vin[0].scriptSig.begin())) { + pindex->nStatus |= BLOCK_FAILED_VALID; + return state.DoS(100, error("AcceptBlock() : block height mismatch in coinbase"), REJECT_INVALID, "bad-cb-height"); } } @@ -2563,8 +2556,9 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex, return true; } -bool CBlockIndex::IsSuperMajority(int minVersion, const CBlockIndex* pstart, unsigned int nRequired, unsigned int nToCheck) +bool CBlockIndex::IsSuperMajority(int minVersion, const CBlockIndex* pstart, unsigned int nRequired) { + unsigned int nToCheck = Params().ToCheckBlockUpgradeMajority(); unsigned int nFound = 0; for (unsigned int i = 0; i < nToCheck && nFound < nRequired && pstart != NULL; i++) { diff --git a/src/main.h b/src/main.h index 42cf4a0861..58515b44b9 100644 --- a/src/main.h +++ b/src/main.h @@ -848,10 +848,11 @@ public: /** * Returns true if there are nRequired or more blocks of minVersion or above - * in the last nToCheck blocks, starting at pstart and going backwards. + * in the last Params().ToCheckBlockUpgradeMajority() blocks, starting at pstart + * and going backwards. */ static bool IsSuperMajority(int minVersion, const CBlockIndex* pstart, - unsigned int nRequired, unsigned int nToCheck); + unsigned int nRequired); std::string ToString() const { From 21913a9ac9525547ebe18619748abb18a2ca8cdf Mon Sep 17 00:00:00 2001 From: jtimon Date: Sat, 22 Mar 2014 20:09:12 +0100 Subject: [PATCH 0121/1288] Add AllowMinDifficultyBlocks chain parameter --- src/chainparams.cpp | 2 ++ src/chainparams.h | 2 ++ src/main.cpp | 6 +++--- src/miner.cpp | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 86d80629eb..c43de2e72d 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -224,6 +224,8 @@ public: base58Prefixes[EXT_PUBLIC_KEY] = list_of(0x04)(0x35)(0x87)(0xCF); base58Prefixes[EXT_SECRET_KEY] = list_of(0x04)(0x35)(0x83)(0x94); } + + virtual bool AllowMinDifficultyBlocks() const { return true; } virtual Network NetworkID() const { return CChainParams::TESTNET; } }; static CTestNetParams testNetParams; diff --git a/src/chainparams.h b/src/chainparams.h index f400907d73..e1ce86550c 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -70,6 +70,8 @@ public: virtual bool MiningRequiresPeers() const { return true; } /* Default value for -checkmempool argument */ virtual bool DefaultCheckMemPool() const { return false; } + /* Allow mining of a min-difficulty block */ + virtual bool AllowMinDifficultyBlocks() const { return false; } const string& DataDir() const { return strDataDir; } /* Make miner stop after a block is found. In RPC, don't return * until nGenProcLimit blocks are generated */ diff --git a/src/main.cpp b/src/main.cpp index e6519864d8..7d0a57657b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1210,7 +1210,7 @@ unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime) const uint256 &bnLimit = Params().ProofOfWorkLimit(); // Testnet has min-difficulty blocks // after nTargetSpacing*2 time between blocks: - if (TestNet() && nTime > nTargetSpacing*2) + if (Params().AllowMinDifficultyBlocks() && nTime > nTargetSpacing*2) return bnLimit.GetCompact(); uint256 bnResult; @@ -1238,7 +1238,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead // Only change once per interval if ((pindexLast->nHeight+1) % nInterval != 0) { - if (TestNet()) + if (Params().AllowMinDifficultyBlocks()) { // Special difficulty rule for testnet: // If the new block's timestamp is more than 2* 10 minutes @@ -1468,7 +1468,7 @@ void UpdateTime(CBlockHeader& block, const CBlockIndex* pindexPrev) block.nTime = max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime()); // Updating time can change work required on testnet: - if (TestNet()) + if (Params().AllowMinDifficultyBlocks()) block.nBits = GetNextWorkRequired(pindexPrev, &block); } diff --git a/src/miner.cpp b/src/miner.cpp index 44c2faaa4c..708b9248f3 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -632,7 +632,7 @@ void static BitcoinMiner(CWallet *pwallet) // Update nTime every few seconds UpdateTime(*pblock, pindexPrev); nBlockTime = ByteReverse(pblock->nTime); - if (TestNet()) + if (Params().AllowMinDifficultyBlocks()) { // Changing pblock->nTime can change work required on testnet: nBlockBits = ByteReverse(pblock->nBits); From cfeb8235fda44aa71fb99ce583c2c2049105ad5a Mon Sep 17 00:00:00 2001 From: jtimon Date: Sat, 22 Mar 2014 20:19:48 +0100 Subject: [PATCH 0122/1288] Add RequireStandard chain parameter --- src/chainparams.cpp | 2 ++ src/chainparams.h | 2 ++ src/main.cpp | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index c43de2e72d..f10599690f 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -226,6 +226,7 @@ public: } virtual bool AllowMinDifficultyBlocks() const { return true; } + virtual bool RequireStandard() const { return false; } virtual Network NetworkID() const { return CChainParams::TESTNET; } }; static CTestNetParams testNetParams; @@ -262,6 +263,7 @@ public: virtual bool MiningRequiresPeers() const { return false; } virtual bool MineBlocksOnDemand() const { return true; } virtual bool DefaultCheckMemPool() const { return true; } + virtual bool RequireStandard() const { return false; } virtual Network NetworkID() const { return CChainParams::REGTEST; } }; static CRegTestParams regTestParams; diff --git a/src/chainparams.h b/src/chainparams.h index e1ce86550c..881eb2294d 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -72,6 +72,8 @@ public: virtual bool DefaultCheckMemPool() const { return false; } /* Allow mining of a min-difficulty block */ virtual bool AllowMinDifficultyBlocks() const { return false; } + /* Make standard checks */ + virtual bool RequireStandard() const { return true; } const string& DataDir() const { return strDataDir; } /* Make miner stop after a block is found. In RPC, don't return * until nGenProcLimit blocks are generated */ diff --git a/src/main.cpp b/src/main.cpp index 7d0a57657b..2f24beecc6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -833,7 +833,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa // Rather not work on nonstandard transactions (unless -testnet/-regtest) string reason; - if (Params().NetworkID() == CChainParams::MAIN && !IsStandardTx(tx, reason)) + if (Params().RequireStandard() && !IsStandardTx(tx, reason)) return state.DoS(0, error("AcceptToMemoryPool : nonstandard transaction: %s", reason), REJECT_NONSTANDARD, reason); @@ -894,7 +894,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa } // Check for non-standard pay-to-script-hash in inputs - if (Params().NetworkID() == CChainParams::MAIN && !AreInputsStandard(tx, view)) + if (Params().RequireStandard() && !AreInputsStandard(tx, view)) return error("AcceptToMemoryPool: : nonstandard transaction input"); // Note: if you modify this code to accept non-standard transactions, then From 6fc0fa63d9eb6bdfcdfd2fd9792d23059c763534 Mon Sep 17 00:00:00 2001 From: jtimon Date: Sat, 22 Mar 2014 20:20:43 +0100 Subject: [PATCH 0123/1288] Add RPCisTestNet chain parameter --- src/chainparams.cpp | 1 + src/chainparams.h | 2 ++ src/rpcmining.cpp | 2 +- src/rpcmisc.cpp | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index f10599690f..109ee02b0a 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -227,6 +227,7 @@ public: virtual bool AllowMinDifficultyBlocks() const { return true; } virtual bool RequireStandard() const { return false; } + virtual bool RPCisTestNet() const { return true; } virtual Network NetworkID() const { return CChainParams::TESTNET; } }; static CTestNetParams testNetParams; diff --git a/src/chainparams.h b/src/chainparams.h index 881eb2294d..3849d33aca 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -74,6 +74,8 @@ public: virtual bool AllowMinDifficultyBlocks() const { return false; } /* Make standard checks */ virtual bool RequireStandard() const { return true; } + /* Make standard checks */ + virtual bool RPCisTestNet() const { return false; } const string& DataDir() const { return strDataDir; } /* Make miner stop after a block is found. In RPC, don't return * until nGenProcLimit blocks are generated */ diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 70adae1467..edf91023dc 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -265,7 +265,7 @@ Value getmininginfo(const Array& params, bool fHelp) obj.push_back(Pair("genproclimit", (int)GetArg("-genproclimit", -1))); obj.push_back(Pair("networkhashps", getnetworkhashps(params, false))); obj.push_back(Pair("pooledtx", (uint64_t)mempool.size())); - obj.push_back(Pair("testnet", TestNet())); + obj.push_back(Pair("testnet", Params().RPCisTestNet())); #ifdef ENABLE_WALLET obj.push_back(Pair("generate", getgenerate(params, false))); obj.push_back(Pair("hashespersec", gethashespersec(params, false))); diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 27d6d61a36..a1793e2e43 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -73,7 +73,7 @@ Value getinfo(const Array& params, bool fHelp) obj.push_back(Pair("connections", (int)vNodes.size())); obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string()))); obj.push_back(Pair("difficulty", (double)GetDifficulty())); - obj.push_back(Pair("testnet", TestNet())); + obj.push_back(Pair("testnet", Params().RPCisTestNet())); #ifdef ENABLE_WALLET if (pwalletMain) { obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime())); From a3d946ebdc2eebef9ccdc2c883f8abfebcf0f653 Mon Sep 17 00:00:00 2001 From: jtimon Date: Sat, 22 Mar 2014 20:22:14 +0100 Subject: [PATCH 0124/1288] Get rid of TestNet() --- src/bitcoin-cli.cpp | 2 +- src/bitcoind.cpp | 2 +- src/chainparams.h | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index ce9e7a4027..29efdfa821 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -33,7 +33,7 @@ static bool AppInitRPC(int argc, char* argv[]) fprintf(stderr,"Error reading configuration file: %s\n", e.what()); return false; } - // Check for -testnet or -regtest parameter (TestNet() calls are only valid after this clause) + // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause) if (!SelectParamsFromCommandLine()) { fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n"); return false; diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 9b535c2e6b..704332c39b 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -77,7 +77,7 @@ bool AppInit(int argc, char* argv[]) fprintf(stderr,"Error reading configuration file: %s\n", e.what()); return false; } - // Check for -testnet or -regtest parameter (TestNet() calls are only valid after this clause) + // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause) if (!SelectParamsFromCommandLine()) { fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n"); return false; diff --git a/src/chainparams.h b/src/chainparams.h index 3849d33aca..653ca20f01 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -120,9 +120,4 @@ void SelectParams(CChainParams::Network network); */ bool SelectParamsFromCommandLine(); -inline bool TestNet() { - // Note: it's deliberate that this returns "false" for regression test mode. - return Params().NetworkID() == CChainParams::TESTNET; -} - #endif From c8c52de3a05b617bc399e2dd45901e74237b7fc1 Mon Sep 17 00:00:00 2001 From: jtimon Date: Wed, 4 Jun 2014 12:51:29 +0200 Subject: [PATCH 0125/1288] Replace virtual methods with static attributes, chainparams.h depends on protocol.h instead of the other way around --- src/alert.cpp | 1 + src/chainparams.cpp | 51 +++++++++++++++++++++++---------------------- src/chainparams.h | 38 ++++++++++++++++++++------------- src/protocol.cpp | 1 + src/protocol.h | 3 ++- 5 files changed, 53 insertions(+), 41 deletions(-) diff --git a/src/alert.cpp b/src/alert.cpp index 99164d63e5..638f0d7a1c 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -5,6 +5,7 @@ #include "alert.h" +#include "chainparams.h" #include "key.h" #include "net.h" #include "ui_interface.h" diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 109ee02b0a..3f4d7f7064 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -6,8 +6,6 @@ #include "chainparams.h" #include "assert.h" -#include "core.h" -#include "protocol.h" #include "util.h" #include @@ -100,6 +98,7 @@ unsigned int pnSeed[] = class CMainParams : public CChainParams { public: CMainParams() { + networkID = CChainParams::MAIN; // The message start string is designed to be unlikely to occur in normal data. // The characters are rarely used upper ASCII, not valid as UTF-8, and produce // a large 4-byte int at any alignment. @@ -171,27 +170,25 @@ public: addr.nTime = GetTime() - GetRand(nOneWeek) - nOneWeek; vFixedSeeds.push_back(addr); } - } - virtual const CBlock& GenesisBlock() const { return genesis; } - virtual Network NetworkID() const { return CChainParams::MAIN; } - - virtual const vector& FixedSeeds() const { - return vFixedSeeds; + fRequireRPCPassword = true; + fMiningRequiresPeers = true; + fDefaultCheckMemPool = false; + fAllowMinDifficultyBlocks = false; + fRequireStandard = true; + fRPCisTestNet = false; + fMineBlocksOnDemand = false; } -protected: - CBlock genesis; - vector vFixedSeeds; }; static CMainParams mainParams; - // // Testnet (v3) // class CTestNetParams : public CMainParams { public: CTestNetParams() { + networkID = CChainParams::TESTNET; // The message start string is designed to be unlikely to occur in normal data. // The characters are rarely used upper ASCII, not valid as UTF-8, and produce // a large 4-byte int at any alignment. @@ -223,22 +220,25 @@ public: base58Prefixes[SECRET_KEY] = list_of(239); base58Prefixes[EXT_PUBLIC_KEY] = list_of(0x04)(0x35)(0x87)(0xCF); base58Prefixes[EXT_SECRET_KEY] = list_of(0x04)(0x35)(0x83)(0x94); - } - virtual bool AllowMinDifficultyBlocks() const { return true; } - virtual bool RequireStandard() const { return false; } - virtual bool RPCisTestNet() const { return true; } - virtual Network NetworkID() const { return CChainParams::TESTNET; } + fRequireRPCPassword = true; + fMiningRequiresPeers = true; + fDefaultCheckMemPool = false; + fAllowMinDifficultyBlocks = true; + fRequireStandard = false; + fRPCisTestNet = true; + fMineBlocksOnDemand = false; + } }; static CTestNetParams testNetParams; - // // Regression test // class CRegTestParams : public CTestNetParams { public: CRegTestParams() { + networkID = CChainParams::REGTEST; pchMessageStart[0] = 0xfa; pchMessageStart[1] = 0xbf; pchMessageStart[2] = 0xb5; @@ -258,14 +258,15 @@ public: assert(hashGenesisBlock == uint256("0x0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206")); vSeeds.clear(); // Regtest mode doesn't have any DNS seeds. - } - virtual bool RequireRPCPassword() const { return false; } - virtual bool MiningRequiresPeers() const { return false; } - virtual bool MineBlocksOnDemand() const { return true; } - virtual bool DefaultCheckMemPool() const { return true; } - virtual bool RequireStandard() const { return false; } - virtual Network NetworkID() const { return CChainParams::REGTEST; } + fRequireRPCPassword = false; + fMiningRequiresPeers = false; + fDefaultCheckMemPool = true; + fAllowMinDifficultyBlocks = true; + fRequireStandard = false; + fRPCisTestNet = true; + fMineBlocksOnDemand = true; + } }; static CRegTestParams regTestParams; diff --git a/src/chainparams.h b/src/chainparams.h index 653ca20f01..988e3ac3a4 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -7,17 +7,15 @@ #define BITCOIN_CHAIN_PARAMS_H #include "uint256.h" +#include "core.h" +#include "protocol.h" #include using namespace std; -#define MESSAGE_START_SIZE 4 typedef unsigned char MessageStartChars[MESSAGE_START_SIZE]; -class CAddress; -class CBlock; - struct CDNSSeedData { string name, host; CDNSSeedData(const string &strName, const string &strHost) : name(strName), host(strHost) {} @@ -64,26 +62,26 @@ public: /* Used if GenerateBitcoins is called with a negative number of threads */ int DefaultMinerThreads() const { return nMinerThreads; } - virtual const CBlock& GenesisBlock() const = 0; - virtual bool RequireRPCPassword() const { return true; } + const CBlock& GenesisBlock() const { return genesis; }; + bool RequireRPCPassword() const { return fRequireRPCPassword; } /* Make miner wait to have peers to avoid wasting work */ - virtual bool MiningRequiresPeers() const { return true; } + bool MiningRequiresPeers() const { return fMiningRequiresPeers; } /* Default value for -checkmempool argument */ - virtual bool DefaultCheckMemPool() const { return false; } + bool DefaultCheckMemPool() const { return fDefaultCheckMemPool; } /* Allow mining of a min-difficulty block */ - virtual bool AllowMinDifficultyBlocks() const { return false; } + bool AllowMinDifficultyBlocks() const { return fAllowMinDifficultyBlocks; } /* Make standard checks */ - virtual bool RequireStandard() const { return true; } + bool RequireStandard() const { return fRequireStandard; } /* Make standard checks */ - virtual bool RPCisTestNet() const { return false; } + bool RPCisTestNet() const { return fRPCisTestNet; } const string& DataDir() const { return strDataDir; } /* Make miner stop after a block is found. In RPC, don't return * until nGenProcLimit blocks are generated */ - virtual bool MineBlocksOnDemand() const { return false; } - virtual Network NetworkID() const = 0; + bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; } + Network NetworkID() const { return networkID; } const vector& DNSSeeds() const { return vSeeds; } - const std::vector &Base58Prefix(Base58Type type) const { return base58Prefixes[type]; } - virtual const vector& FixedSeeds() const = 0; + const std::vector& Base58Prefix(Base58Type type) const { return base58Prefixes[type]; } + const vector& FixedSeeds() const { return vFixedSeeds; } int RPCPort() const { return nRPCPort; } protected: CChainParams() {} @@ -103,6 +101,16 @@ protected: int nMinerThreads; vector vSeeds; std::vector base58Prefixes[MAX_BASE58_TYPES]; + Network networkID; + CBlock genesis; + vector vFixedSeeds; + bool fRequireRPCPassword; + bool fMiningRequiresPeers; + bool fDefaultCheckMemPool; + bool fAllowMinDifficultyBlocks; + bool fRequireStandard; + bool fRPCisTestNet; + bool fMineBlocksOnDemand; }; /** diff --git a/src/protocol.cpp b/src/protocol.cpp index c77a92f020..87b2f23873 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -5,6 +5,7 @@ #include "protocol.h" +#include "chainparams.h" #include "util.h" #ifndef WIN32 diff --git a/src/protocol.h b/src/protocol.h index e6f105fe5c..6de5d05a72 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -10,7 +10,6 @@ #ifndef __INCLUDED_PROTOCOL_H__ #define __INCLUDED_PROTOCOL_H__ -#include "chainparams.h" #include "netbase.h" #include "serialize.h" #include "uint256.h" @@ -19,6 +18,8 @@ #include #include +#define MESSAGE_START_SIZE 4 + /** Message header. * (4) message start. * (12) command. From 2871889e834b664bcaa3fdb3ecb6c5cdc751afb1 Mon Sep 17 00:00:00 2001 From: jtimon Date: Wed, 4 Jun 2014 12:52:15 +0200 Subject: [PATCH 0126/1288] net.h was using std namespace through chainparams.h included in protocol.h --- src/net.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net.h b/src/net.h index d3346873bc..d50cd92dba 100644 --- a/src/net.h +++ b/src/net.h @@ -129,7 +129,7 @@ struct LocalServiceInfo { }; extern CCriticalSection cs_mapLocalHost; -extern map mapLocalHost; +extern std::map mapLocalHost; class CNodeStats { From 7b45d943b29a443f1ac808c9ee4eeed6df0db9cc Mon Sep 17 00:00:00 2001 From: shshshsh Date: Fri, 30 May 2014 12:35:23 +0000 Subject: [PATCH 0127/1288] Make max number of orphan blocks kept in memory a startup parameter (fixes #4253) --- src/init.cpp | 1 + src/main.cpp | 2 +- src/main.h | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index bc4924b48d..995f2700cf 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -206,6 +206,7 @@ std::string HelpMessage(HelpMessageMode hmm) strUsage += " -dbcache= " + strprintf(_("Set database cache size in megabytes (%d to %d, default: %d)"), nMinDbCache, nMaxDbCache, nDefaultDbCache) + "\n"; strUsage += " -keypool= " + _("Set key pool size to (default: 100)") + "\n"; strUsage += " -loadblock= " + _("Imports blocks from external blk000??.dat file") + " " + _("on startup") + "\n"; + strUsage += " -maxorphanblocks= " + strprintf(_("Keep at most unconnectable blocks in memory (default: %u)"), DEFAULT_MAX_ORPHAN_BLOCKS) + "\n"; strUsage += " -par= " + strprintf(_("Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)"), -(int)boost::thread::hardware_concurrency(), MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS) + "\n"; strUsage += " -pid= " + _("Specify pid file (default: bitcoind.pid)") + "\n"; strUsage += " -reindex " + _("Rebuild block chain index from current blk000??.dat files") + " " + _("on startup") + "\n"; diff --git a/src/main.cpp b/src/main.cpp index 18c00d90ac..5cb6e706bb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1160,7 +1160,7 @@ uint256 static GetOrphanRoot(const uint256& hash) // Remove a random orphan block (which does not have any dependent orphans). void static PruneOrphanBlocks() { - if (mapOrphanBlocksByPrev.size() <= MAX_ORPHAN_BLOCKS) + if (mapOrphanBlocksByPrev.size() <= (size_t)std::max((int64_t)0, GetArg("-maxorphanblocks", DEFAULT_MAX_ORPHAN_BLOCKS))) return; // Pick a random orphan block. diff --git a/src/main.h b/src/main.h index 8a05eb60d2..26f66630ae 100644 --- a/src/main.h +++ b/src/main.h @@ -45,8 +45,8 @@ static const unsigned int MAX_STANDARD_TX_SIZE = 100000; static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50; /** The maximum number of orphan transactions kept in memory */ static const unsigned int MAX_ORPHAN_TRANSACTIONS = MAX_BLOCK_SIZE/100; -/** The maximum number of orphan blocks kept in memory */ -static const unsigned int MAX_ORPHAN_BLOCKS = 750; +/** Default for -maxorphanblocks, maximum number of orphan blocks kept in memory */ +static const unsigned int DEFAULT_MAX_ORPHAN_BLOCKS = 750; /** The maximum size of a blk?????.dat file (since 0.8) */ static const unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // 128 MiB /** The pre-allocation chunk size for blk?????.dat files (since 0.8) */ From f0a83fc256023f68cc046bd096de69f16ce9d394 Mon Sep 17 00:00:00 2001 From: jtimon Date: Wed, 4 Jun 2014 15:25:58 +0200 Subject: [PATCH 0128/1288] Use Params().NetworkID() instead of TestNet() from the payment protocol --- src/qt/paymentserver.cpp | 14 ++++++++++++-- src/qt/paymentserver.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 4c45585685..20551591c3 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -490,6 +490,17 @@ bool PaymentServer::readPaymentRequest(const QString& filename, PaymentRequestPl return request.parse(data); } +std::string PaymentServer::mapNetworkIdToName(CChainParams::Network networkId) +{ + if (networkId == CChainParams::MAIN) + return "main"; + if (networkId == CChainParams::TESTNET) + return "test"; + if (networkId == CChainParams::REGTEST) + return "regtest"; + return ""; +} + bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoinsRecipient& recipient) { if (!optionsModel) @@ -499,8 +510,7 @@ bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoins const payments::PaymentDetails& details = request.getDetails(); // Payment request network matches client network? - if ((details.network() == "main" && TestNet()) || - (details.network() == "test" && !TestNet())) + if (details.network() != mapNetworkIdToName(Params().NetworkID())) { emit message(tr("Payment request rejected"), tr("Payment request network doesn't match client network."), CClientUIInterface::MSG_ERROR); diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h index d84d09c57d..d6949a47ce 100644 --- a/src/qt/paymentserver.h +++ b/src/qt/paymentserver.h @@ -118,6 +118,7 @@ protected: private: static bool readPaymentRequest(const QString& filename, PaymentRequestPlus& request); + std::string mapNetworkIdToName(CChainParams::Network networkId); bool processPaymentRequest(PaymentRequestPlus& request, SendCoinsRecipient& recipient); void fetchRequest(const QUrl& url); From 4a48a0671d2e02ba2a86af98282a452f23546b9e Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 4 Jun 2014 12:27:44 +0200 Subject: [PATCH 0129/1288] Remove side effect in assertion in ProcessGetData A side-effect was introduced into an assertion in 7a0e84d. This commit fixes that. --- src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 30fa9c6d70..e71d2d0cbc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3390,7 +3390,8 @@ void static ProcessGetData(CNode* pfrom) { // Send block from disk CBlock block; - assert(ReadBlockFromDisk(block, (*mi).second)); + if (!ReadBlockFromDisk(block, (*mi).second)) + assert(!"cannot load block from disk"); if (inv.type == MSG_BLOCK) pfrom->PushMessage("block", block); else // MSG_FILTERED_BLOCK) From 5bd02cf715dcb44cfc797c0d1fb94b80350b6489 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 4 Jun 2014 21:19:22 +0200 Subject: [PATCH 0130/1288] log used config file to debug.log on startup --- src/init.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/init.cpp b/src/init.cpp index 6a21dee634..96f7f7b3c8 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -614,6 +614,7 @@ bool AppInit2(boost::thread_group& threadGroup) LogPrintf("Startup time: %s\n", DateTimeStrFormat("%Y-%m-%d %H:%M:%S", GetTime())); LogPrintf("Default data directory %s\n", GetDefaultDataDir().string()); LogPrintf("Using data directory %s\n", strDataDir); + LogPrintf("Using config file %s\n", GetConfigFile().string()); LogPrintf("Using at most %i connections (%i file descriptors available)\n", nMaxConnections, nFD); std::ostringstream strErrors; From fe6bff2eaec35c3dc292af883a6e82397e440c22 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 4 Jun 2014 22:00:59 +0200 Subject: [PATCH 0131/1288] [Qt] add BerkeleyDB version info to RPCConsole - to match info function between debug.log and RPCConsole --- src/qt/forms/rpcconsole.ui | 64 +++++++++++++++++++++++++++----------- src/qt/rpcconsole.cpp | 10 +++++- 2 files changed, 54 insertions(+), 20 deletions(-) diff --git a/src/qt/forms/rpcconsole.ui b/src/qt/forms/rpcconsole.ui index bf737d9b99..1e574e8527 100644 --- a/src/qt/forms/rpcconsole.ui +++ b/src/qt/forms/rpcconsole.ui @@ -113,14 +113,17 @@ - + - Build date + Using BerkeleyDB version + + + 10 - + IBeamCursor @@ -136,14 +139,14 @@ - + - Startup time + Build date - + IBeamCursor @@ -159,6 +162,29 @@ + + + Startup time + + + + + + + IBeamCursor + + + N/A + + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + @@ -171,14 +197,14 @@ - + Name - + IBeamCursor @@ -194,14 +220,14 @@ - + Number of connections - + IBeamCursor @@ -217,7 +243,7 @@ - + @@ -230,14 +256,14 @@ - + Current number of blocks - + IBeamCursor @@ -253,14 +279,14 @@ - + Last block time - + IBeamCursor @@ -276,7 +302,7 @@ - + Qt::Vertical @@ -289,7 +315,7 @@ - + @@ -302,7 +328,7 @@ - + Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. @@ -315,7 +341,7 @@ - + Qt::Vertical diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 3b7d37ff39..6a8bce25d4 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -15,7 +15,9 @@ #include "util.h" #include "json/json_spirit_value.h" +#include #include + #include #include #include @@ -216,8 +218,14 @@ RPCConsole::RPCConsole(QWidget *parent) : connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clear())); connect(ui->btnClearTrafficGraph, SIGNAL(clicked()), ui->trafficGraph, SLOT(clear())); - // set OpenSSL version label + // set library version labels ui->openSSLVersion->setText(SSLeay_version(SSLEAY_VERSION)); +#ifdef ENABLE_WALLET + ui->berkeleyDBVersion->setText(DbEnv::version(0, 0, 0)); +#else + ui->label_berkeleyDBVersion->hide(); + ui->berkeleyDBVersion->hide(); +#endif startExecutor(); setTrafficGraphRange(INITIAL_TRAFFIC_GRAPH_MINS); From a92aded70ec2346c3f07ff1cf8eb97101a76912f Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 5 Jun 2014 07:00:16 +0200 Subject: [PATCH 0132/1288] Fix GUI build with `--disable-wallet` fe6bff2 and 65f78a1 broke it. Minor build changes. --- src/qt/Makefile.am | 2 +- src/qt/rpcconsole.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qt/Makefile.am b/src/qt/Makefile.am index 1d85113d78..d527f790ef 100644 --- a/src/qt/Makefile.am +++ b/src/qt/Makefile.am @@ -276,6 +276,7 @@ BITCOIN_QT_CPP = \ notificator.cpp \ optionsdialog.cpp \ optionsmodel.cpp \ + peertablemodel.cpp \ qvalidatedlineedit.cpp \ qvaluecombobox.cpp \ rpcconsole.cpp \ @@ -296,7 +297,6 @@ BITCOIN_QT_CPP += \ overviewpage.cpp \ paymentrequestplus.cpp \ paymentserver.cpp \ - peertablemodel.cpp \ receivecoinsdialog.cpp \ receiverequestdialog.cpp \ recentrequeststablemodel.cpp \ diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 6a8bce25d4..0d3e11f4ac 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -15,7 +15,9 @@ #include "util.h" #include "json/json_spirit_value.h" +#ifdef ENABLE_WALLET #include +#endif #include #include From 7d4dda7630a67ae1aacfc799ed743e69562a41df Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 5 Jun 2014 14:52:07 +0200 Subject: [PATCH 0133/1288] Remove global strWalletFile As it says on the tin. There is no need to have this variable be global, it's only used in AppInit2. --- src/init.cpp | 3 +-- src/init.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 96f7f7b3c8..d924bd293b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -40,7 +40,6 @@ using namespace std; using namespace boost; #ifdef ENABLE_WALLET -std::string strWalletFile; CWallet* pwalletMain; #endif @@ -584,7 +583,7 @@ bool AppInit2(boost::thread_group& threadGroup) } bSpendZeroConfChange = GetArg("-spendzeroconfchange", true); - strWalletFile = GetArg("-wallet", "wallet.dat"); + std::string strWalletFile = GetArg("-wallet", "wallet.dat"); #endif // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log diff --git a/src/init.h b/src/init.h index 2f56923055..4a967bea37 100644 --- a/src/init.h +++ b/src/init.h @@ -14,7 +14,6 @@ namespace boost { class thread_group; }; -extern std::string strWalletFile; extern CWallet* pwalletMain; void StartShutdown(); From 6e7c4d17d8abb4b1c8b91504699ce6970e01a1fb Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 5 Jun 2014 15:44:35 +0200 Subject: [PATCH 0134/1288] gitian: upgrade OpenSSL to 1.0.1h Upgrade for https://www.openssl.org/news/secadv_20140605.txt Just in case - there is no vulnerability that affects ecdsa signing or verification. The MITM attack vulnerability (CVE-2014-0224) may have some effect on our usage of SSL/TLS. As long as payment requests are signed (which is the common case), usage of the payment protocol should also not be affected. The TLS usage in RPC may be at risk for MITM attacks. If you have `-rpcssl` enabled, be sure to update OpenSSL as soon as possible. --- contrib/gitian-descriptors/deps-linux.yml | 10 +++++----- contrib/gitian-descriptors/deps-win.yml | 10 +++++----- contrib/gitian-descriptors/gitian-linux.yml | 6 +++--- contrib/gitian-descriptors/gitian-osx-bitcoin.yml | 8 ++++---- contrib/gitian-descriptors/gitian-osx-depends.yml | 10 +++++----- contrib/gitian-descriptors/gitian-osx-qt.yml | 6 +++--- contrib/gitian-descriptors/gitian-win.yml | 6 +++--- contrib/gitian-descriptors/qt-win.yml | 6 +++--- doc/release-process.md | 10 +++++----- 9 files changed, 36 insertions(+), 36 deletions(-) diff --git a/contrib/gitian-descriptors/deps-linux.yml b/contrib/gitian-descriptors/deps-linux.yml index af10461b83..8221222133 100644 --- a/contrib/gitian-descriptors/deps-linux.yml +++ b/contrib/gitian-descriptors/deps-linux.yml @@ -16,7 +16,7 @@ packages: reference_datetime: "2013-06-01 00:00:00" remotes: [] files: -- "openssl-1.0.1g.tar.gz" +- "openssl-1.0.1h.tar.gz" - "miniupnpc-1.9.tar.gz" - "qrencode-3.4.3.tar.bz2" - "protobuf-2.5.0.tar.bz2" @@ -30,15 +30,15 @@ script: | export TZ=UTC export LIBRARY_PATH="$STAGING/lib" # Integrity Check - echo "53cb818c3b90e507a8348f4f5eaedb05d8bfe5358aabb508b7263cc670c3e028 openssl-1.0.1g.tar.gz" | sha256sum -c + echo "9d1c8a9836aa63e2c6adb684186cbd4371c9e9dcc01d6e3bb447abf2d4d3d093 openssl-1.0.1h.tar.gz" | sha256sum -c echo "2923e453e880bb949e3d4da9f83dd3cb6f08946d35de0b864d0339cf70934464 miniupnpc-1.9.tar.gz" | sha256sum -c echo "dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b50597a98 qrencode-3.4.3.tar.bz2" | sha256sum -c echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c # - tar xzf openssl-1.0.1g.tar.gz - cd openssl-1.0.1g + tar xzf openssl-1.0.1h.tar.gz + cd openssl-1.0.1h # need -fPIC to avoid relocation error in 64 bit builds ./config no-shared no-zlib no-dso no-krb5 --openssldir=$STAGING -fPIC # need to build OpenSSL with faketime because a timestamp is embedded into cversion.o @@ -95,4 +95,4 @@ script: | done # cd $STAGING - find include lib bin host | sort | zip -X@ $OUTDIR/bitcoin-deps-linux${GBUILD_BITS}-gitian-r5.zip + find include lib bin host | sort | zip -X@ $OUTDIR/bitcoin-deps-linux${GBUILD_BITS}-gitian-r6.zip diff --git a/contrib/gitian-descriptors/deps-win.yml b/contrib/gitian-descriptors/deps-win.yml index 17ac413d80..fabc2949eb 100644 --- a/contrib/gitian-descriptors/deps-win.yml +++ b/contrib/gitian-descriptors/deps-win.yml @@ -14,7 +14,7 @@ packages: reference_datetime: "2011-01-30 00:00:00" remotes: [] files: -- "openssl-1.0.1g.tar.gz" +- "openssl-1.0.1h.tar.gz" - "db-4.8.30.NC.tar.gz" - "miniupnpc-1.9.tar.gz" - "zlib-1.2.8.tar.gz" @@ -28,7 +28,7 @@ script: | INDIR=$HOME/build TEMPDIR=$HOME/tmp # Input Integrity Check - echo "53cb818c3b90e507a8348f4f5eaedb05d8bfe5358aabb508b7263cc670c3e028 openssl-1.0.1g.tar.gz" | sha256sum -c + echo "9d1c8a9836aa63e2c6adb684186cbd4371c9e9dcc01d6e3bb447abf2d4d3d093 openssl-1.0.1h.tar.gz" | sha256sum -c echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c echo "2923e453e880bb949e3d4da9f83dd3cb6f08946d35de0b864d0339cf70934464 miniupnpc-1.9.tar.gz" | sha256sum -c echo "36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d zlib-1.2.8.tar.gz" | sha256sum -c @@ -48,8 +48,8 @@ script: | mkdir -p $INSTALLPREFIX $BUILDDIR cd $BUILDDIR # - tar xzf $INDIR/openssl-1.0.1g.tar.gz - cd openssl-1.0.1g + tar xzf $INDIR/openssl-1.0.1h.tar.gz + cd openssl-1.0.1h if [ "$BITS" == "32" ]; then OPENSSL_TGT=mingw else @@ -124,5 +124,5 @@ script: | done # cd $INSTALLPREFIX - find include lib | sort | zip -X@ $OUTDIR/bitcoin-deps-win$BITS-gitian-r12.zip + find include lib | sort | zip -X@ $OUTDIR/bitcoin-deps-win$BITS-gitian-r13.zip done # for BITS in diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index bb59e1cecb..65a6c3c1e9 100644 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -25,8 +25,8 @@ remotes: - "url": "https://github.com/bitcoin/bitcoin.git" "dir": "bitcoin" files: -- "bitcoin-deps-linux32-gitian-r5.zip" -- "bitcoin-deps-linux64-gitian-r5.zip" +- "bitcoin-deps-linux32-gitian-r6.zip" +- "bitcoin-deps-linux64-gitian-r6.zip" - "boost-linux32-1.55.0-gitian-r1.zip" - "boost-linux64-1.55.0-gitian-r1.zip" - "qt-linux32-4.6.4-gitian-r1.tar.gz" @@ -43,7 +43,7 @@ script: | # mkdir -p $STAGING cd $STAGING - unzip ../build/bitcoin-deps-linux${GBUILD_BITS}-gitian-r5.zip + unzip ../build/bitcoin-deps-linux${GBUILD_BITS}-gitian-r6.zip unzip ../build/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip tar -zxf ../build/qt-linux${GBUILD_BITS}-4.6.4-gitian-r1.tar.gz cd ../build diff --git a/contrib/gitian-descriptors/gitian-osx-bitcoin.yml b/contrib/gitian-descriptors/gitian-osx-bitcoin.yml index e29047d610..44b5de9be3 100644 --- a/contrib/gitian-descriptors/gitian-osx-bitcoin.yml +++ b/contrib/gitian-descriptors/gitian-osx-bitcoin.yml @@ -18,8 +18,8 @@ remotes: "dir": "bitcoin" files: - "osx-native-depends-r3.tar.gz" -- "osx-depends-r3.tar.gz" -- "osx-depends-qt-5.2.1-r3.tar.gz" +- "osx-depends-r4.tar.gz" +- "osx-depends-qt-5.2.1-r4.tar.gz" - "MacOSX10.7.sdk.tar.gz" script: | @@ -37,8 +37,8 @@ script: | tar -C osx-cross-depends/SDKs -xf ${SOURCES_PATH}/MacOSX10.7.sdk.tar.gz tar -C osx-cross-depends -xf osx-native-depends-r3.tar.gz - tar -C osx-cross-depends -xf osx-depends-r3.tar.gz - tar -C osx-cross-depends -xf osx-depends-qt-5.2.1-r3.tar.gz + tar -C osx-cross-depends -xf osx-depends-r4.tar.gz + tar -C osx-cross-depends -xf osx-depends-qt-5.2.1-r4.tar.gz export PATH=`pwd`/osx-cross-depends/native-prefix/bin:$PATH cd bitcoin diff --git a/contrib/gitian-descriptors/gitian-osx-depends.yml b/contrib/gitian-descriptors/gitian-osx-depends.yml index adc86e5cb4..07a021cf0c 100644 --- a/contrib/gitian-descriptors/gitian-osx-depends.yml +++ b/contrib/gitian-descriptors/gitian-osx-depends.yml @@ -15,7 +15,7 @@ files: - "boost_1_55_0.tar.bz2" - "db-4.8.30.NC.tar.gz" - "miniupnpc-1.9.tar.gz" -- "openssl-1.0.1g.tar.gz" +- "openssl-1.0.1h.tar.gz" - "protobuf-2.5.0.tar.bz2" - "qrencode-3.4.3.tar.bz2" - "MacOSX10.7.sdk.tar.gz" @@ -26,11 +26,11 @@ script: | echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | sha256sum -c echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c echo "2923e453e880bb949e3d4da9f83dd3cb6f08946d35de0b864d0339cf70934464 miniupnpc-1.9.tar.gz" | sha256sum -c - echo "53cb818c3b90e507a8348f4f5eaedb05d8bfe5358aabb508b7263cc670c3e028 openssl-1.0.1g.tar.gz" | sha256sum -c + echo "9d1c8a9836aa63e2c6adb684186cbd4371c9e9dcc01d6e3bb447abf2d4d3d093 openssl-1.0.1h.tar.gz" | sha256sum -c echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c echo "dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b50597a98 qrencode-3.4.3.tar.bz2" | sha256sum -c - REVISION=r3 + REVISION=r4 export SOURCES_PATH=`pwd` export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" export PATH=$HOME:$PATH @@ -88,8 +88,8 @@ script: | popd # openssl - SOURCE_FILE=${SOURCES_PATH}/openssl-1.0.1g.tar.gz - BUILD_DIR=${BUILD_BASE}/openssl-1.0.1g + SOURCE_FILE=${SOURCES_PATH}/openssl-1.0.1h.tar.gz + BUILD_DIR=${BUILD_BASE}/openssl-1.0.1h tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} pushd ${BUILD_DIR} diff --git a/contrib/gitian-descriptors/gitian-osx-qt.yml b/contrib/gitian-descriptors/gitian-osx-qt.yml index b57908dbd9..5e0ad9222a 100644 --- a/contrib/gitian-descriptors/gitian-osx-qt.yml +++ b/contrib/gitian-descriptors/gitian-osx-qt.yml @@ -14,14 +14,14 @@ remotes: [] files: - "qt-everywhere-opensource-src-5.2.1.tar.gz" - "osx-native-depends-r3.tar.gz" -- "osx-depends-r3.tar.gz" +- "osx-depends-r4.tar.gz" - "MacOSX10.7.sdk.tar.gz" script: | echo "84e924181d4ad6db00239d87250cc89868484a14841f77fb85ab1f1dbdcd7da1 qt-everywhere-opensource-src-5.2.1.tar.gz" | sha256sum -c - REVISION=r3 + REVISION=r4 export SOURCES_PATH=`pwd` export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" export ZERO_AR_DATE=1 @@ -73,7 +73,7 @@ script: | tar xf /home/ubuntu/build/osx-native-depends-r3.tar.gz export PATH=`pwd`/native-prefix/bin:$PATH - tar xf /home/ubuntu/build/osx-depends-r3.tar.gz + tar xf /home/ubuntu/build/osx-depends-r4.tar.gz SOURCE_FILE=${SOURCES_PATH}/qt-everywhere-opensource-src-5.2.1.tar.gz BUILD_DIR=${BUILD_BASE}/qt-everywhere-opensource-src-5.2.1 diff --git a/contrib/gitian-descriptors/gitian-win.yml b/contrib/gitian-descriptors/gitian-win.yml index 2191fb36c7..245f15ccab 100644 --- a/contrib/gitian-descriptors/gitian-win.yml +++ b/contrib/gitian-descriptors/gitian-win.yml @@ -26,8 +26,8 @@ files: - "qt-win64-5.2.0-gitian-r3.zip" - "boost-win32-1.55.0-gitian-r6.zip" - "boost-win64-1.55.0-gitian-r6.zip" -- "bitcoin-deps-win32-gitian-r12.zip" -- "bitcoin-deps-win64-gitian-r12.zip" +- "bitcoin-deps-win32-gitian-r13.zip" +- "bitcoin-deps-win64-gitian-r13.zip" - "protobuf-win32-2.5.0-gitian-r4.zip" - "protobuf-win64-2.5.0-gitian-r4.zip" script: | @@ -61,7 +61,7 @@ script: | cd $STAGING unzip $INDIR/qt-win${BITS}-5.2.0-gitian-r3.zip unzip $INDIR/boost-win${BITS}-1.55.0-gitian-r6.zip - unzip $INDIR/bitcoin-deps-win${BITS}-gitian-r12.zip + unzip $INDIR/bitcoin-deps-win${BITS}-gitian-r13.zip unzip $INDIR/protobuf-win${BITS}-2.5.0-gitian-r4.zip if [ "$NEEDDIST" == "1" ]; then # Make source code archive which is architecture independent so it only needs to be done once diff --git a/contrib/gitian-descriptors/qt-win.yml b/contrib/gitian-descriptors/qt-win.yml index 8f24492b53..7000c70051 100644 --- a/contrib/gitian-descriptors/qt-win.yml +++ b/contrib/gitian-descriptors/qt-win.yml @@ -15,8 +15,8 @@ reference_datetime: "2011-01-30 00:00:00" remotes: [] files: - "qt-everywhere-opensource-src-5.2.0.tar.gz" -- "bitcoin-deps-win32-gitian-r12.zip" -- "bitcoin-deps-win64-gitian-r12.zip" +- "bitcoin-deps-win32-gitian-r13.zip" +- "bitcoin-deps-win64-gitian-r13.zip" script: | # Defines export TZ=UTC @@ -48,7 +48,7 @@ script: | # # Need mingw-compiled openssl from bitcoin-deps: cd $DEPSDIR - unzip $INDIR/bitcoin-deps-win${BITS}-gitian-r12.zip + unzip $INDIR/bitcoin-deps-win${BITS}-gitian-r13.zip # cd $BUILDDIR # diff --git a/doc/release-process.md b/doc/release-process.md index 60b93b7680..5b96e53753 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -44,7 +44,7 @@ Release Process Fetch and build inputs: (first time, or when dependency versions change) wget 'http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.9.tar.gz' -O miniupnpc-1.9.tar.gz - wget 'https://www.openssl.org/source/openssl-1.0.1g.tar.gz' + wget 'https://www.openssl.org/source/openssl-1.0.1h.tar.gz' wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz' wget 'http://zlib.net/zlib-1.2.8.tar.gz' wget 'ftp://ftp.simplesystems.org/pub/png/src/history/libpng16/libpng-1.6.8.tar.gz' @@ -89,16 +89,16 @@ Release Process The expected SHA256 hashes of the intermediate inputs are: - 35c3dfd8b9362f59e81b51881b295232e3bc9e286f1add193b59d486d9ac4a5c bitcoin-deps-linux32-gitian-r5.zip - 571789867d172500fa96d63d0ba8c5b1e1a3d6f44f720eddf2f93665affc88b3 bitcoin-deps-linux64-gitian-r5.zip + 46710f673467e367738d8806e45b4cb5931aaeea61f4b6b55a68eea56d5006c5 bitcoin-deps-linux32-gitian-r6.zip + f03be39fb26670243d3a659e64d18e19d03dec5c11e9912011107768390b5268 bitcoin-deps-linux64-gitian-r6.zip f29b7d9577417333fb56e023c2977f5726a7c297f320b175a4108cf7cd4c2d29 boost-linux32-1.55.0-gitian-r1.zip 88232451c4104f7eb16e469ac6474fd1231bd485687253f7b2bdf46c0781d535 boost-linux64-1.55.0-gitian-r1.zip 57e57dbdadc818cd270e7e00500a5e1085b3bcbdef69a885f0fb7573a8d987e1 qt-linux32-4.6.4-gitian-r1.tar.gz 60eb4b9c5779580b7d66529efa5b2836ba1a70edde2a0f3f696d647906a826be qt-linux64-4.6.4-gitian-r1.tar.gz 60dc2d3b61e9c7d5dbe2f90d5955772ad748a47918ff2d8b74e8db9b1b91c909 boost-win32-1.55.0-gitian-r6.zip f65fcaf346bc7b73bc8db3a8614f4f6bee2f61fcbe495e9881133a7c2612a167 boost-win64-1.55.0-gitian-r6.zip - acd59690a49dfbad6b436379843fe4ad1857ad91c603d52506690bc55f2a01a4 bitcoin-deps-win32-gitian-r12.zip - a3e5a62fcdad81f758e41848035e6a27be390981a14d590f2cf2509f87417a42 bitcoin-deps-win64-gitian-r12.zip + 70de248cd0dd7e7476194129e818402e974ca9c5751cbf591644dc9f332d3b59 bitcoin-deps-win32-gitian-r13.zip + 9eace4c76f639f4f3580a478eee4f50246e1bbb5ccdcf37a158261a5a3fa3e65 bitcoin-deps-win64-gitian-r13.zip 963e3e5e85879010a91143c90a711a5d1d5aba992e38672cdf7b54e42c56b2f1 qt-win32-5.2.0-gitian-r3.zip 751c579830d173ef3e6f194e83d18b92ebef6df03289db13ab77a52b6bc86ef0 qt-win64-5.2.0-gitian-r3.zip e2e403e1a08869c7eed4d4293bce13d51ec6a63592918b90ae215a0eceb44cb4 protobuf-win32-2.5.0-gitian-r4.zip From 65e8ba4dbed519a3be6d497063c3441550c4b3d6 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 28 May 2014 13:38:41 -0400 Subject: [PATCH 0135/1288] build: Switch to non-recursive make Build logic moves from individual Makefile.am's to include files, which the main src/Makefile.am includes. This avoids having to manage a gigantic single Makefile. TODO: Move the rules from the old Makefile.include to where they actually belong and nuke the old file. --- configure.ac | 5 +- src/Makefile.am | 21 +- src/Makefile.include | 17 +- src/Makefile.qt.include | 387 ++++++++++++++++++++++++++++++++++++ src/Makefile.qttest.include | 52 +++++ src/Makefile.test.include | 87 ++++++++ 6 files changed, 550 insertions(+), 19 deletions(-) create mode 100644 src/Makefile.qt.include create mode 100644 src/Makefile.qttest.include create mode 100644 src/Makefile.test.include diff --git a/configure.ac b/configure.ac index 3a8d33a5a0..d8521ad3ad 100644 --- a/configure.ac +++ b/configure.ac @@ -666,6 +666,9 @@ AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin]) AM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin]) AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows]) AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet == xyes]) +AM_CONDITIONAL([ENABLE_TESTS],[test x$use_tests == xyes]) +AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt == xyes]) +AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$use_tests$bitcoin_enable_qt_test = xyesyes]) AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes]) AM_CONDITIONAL([USE_LCOV],[test x$use_lcov == xyes]) AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno]) @@ -695,7 +698,7 @@ AC_SUBST(LEVELDB_TARGET_FLAGS) AC_SUBST(BUILD_TEST) AC_SUBST(BUILD_QT) AC_SUBST(BUILD_TEST_QT) -AC_CONFIG_FILES([Makefile src/Makefile src/test/Makefile src/qt/Makefile src/qt/test/Makefile share/setup.nsi share/qt/Info.plist]) +AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist]) AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh]) AC_CONFIG_FILES([qa/pull-tester/build-tests.sh],[chmod +x qa/pull-tester/build-tests.sh]) AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index a49ad58716..e7d121b4d6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -11,6 +11,7 @@ noinst_LIBRARIES += libbitcoin_wallet.a endif bin_PROGRAMS = +TESTS = if BUILD_BITCOIND bin_PROGRAMS += bitcoind @@ -20,8 +21,6 @@ if BUILD_BITCOIN_CLI bin_PROGRAMS += bitcoin-cli endif -SUBDIRS = . $(BUILD_QT) $(BUILD_TEST) -DIST_SUBDIRS = . qt test .PHONY: FORCE # bitcoin core # BITCOIN_CORE_H = \ @@ -188,16 +187,24 @@ leveldb/%.a: CC="$(CC)" PLATFORM=$(TARGET_OS) AR="$(AR)" $(LEVELDB_TARGET_FLAGS) \ OPT="$(CXXFLAGS) $(CPPFLAGS)" -qt/bitcoinstrings.cpp: $(libbitcoin_server_a_SOURCES) $(libbitcoin_common_a_SOURCES) $(libbitcoin_cli_a_SOURCES) - @test -n $(XGETTEXT) || echo "xgettext is required for updating translations" - @cd $(top_srcdir); XGETTEXT=$(XGETTEXT) share/qt/extract_strings_qt.py - CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno DISTCLEANFILES = obj/build.h -EXTRA_DIST = leveldb Makefile.include +EXTRA_DIST = leveldb clean-local: -$(MAKE) -C leveldb clean rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno + +if ENABLE_TESTS +include Makefile.test.include +endif + +if ENABLE_QT +include Makefile.qt.include +endif + +if ENABLE_QT_TESTS +include Makefile.qttest.include +endif diff --git a/src/Makefile.include b/src/Makefile.include index 2fc6cd7775..d3d3d6385a 100644 --- a/src/Makefile.include +++ b/src/Makefile.include @@ -12,23 +12,18 @@ AM_CPPFLAGS = $(INCLUDES) \ AM_CPPFLAGS += $(LEVELDB_CPPFLAGS) AM_LDFLAGS = $(PTHREAD_CFLAGS) -LIBBITCOIN_SERVER=$(top_builddir)/src/libbitcoin_server.a -LIBBITCOIN_WALLET=$(top_builddir)/src/libbitcoin_wallet.a -LIBBITCOIN_COMMON=$(top_builddir)/src/libbitcoin_common.a -LIBBITCOIN_CLI=$(top_builddir)/src/libbitcoin_cli.a -LIBBITCOINQT=$(top_builddir)/src/qt/libbitcoinqt.a - -$(LIBBITCOIN): - $(MAKE) -C $(top_builddir)/src $(@F) +LIBBITCOIN_SERVER=libbitcoin_server.a +LIBBITCOIN_WALLET=libbitcoin_wallet.a +LIBBITCOIN_COMMON=libbitcoin_common.a +LIBBITCOIN_CLI=libbitcoin_cli.a +LIBBITCOINQT=qt/libbitcoinqt.a if EMBEDDED_LEVELDB $(LIBLEVELDB) $(LIBMEMENV): $(MAKE) -C $(top_builddir)/src leveldb/$(@F) +$(LIBLEVELDB): $(LIBMEMENV) endif -$(LIBBITCOINQT): - $(MAKE) -C $(top_builddir)/src/qt $(@F) - .mm.o: $(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS) -c -o $@ $< diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include new file mode 100644 index 0000000000..dcb3f37f50 --- /dev/null +++ b/src/Makefile.qt.include @@ -0,0 +1,387 @@ +AM_CPPFLAGS += -I$(top_srcdir)/src \ + -I$(top_builddir)/src/qt \ + -I$(top_builddir)/src/qt/forms \ + $(PROTOBUF_CFLAGS) \ + $(QR_CFLAGS) +bin_PROGRAMS += qt/bitcoin-qt +noinst_LIBRARIES += qt/libbitcoinqt.a + +# bitcoin qt core # +QT_TS = \ + qt/locale/bitcoin_ach.ts \ + qt/locale/bitcoin_af_ZA.ts \ + qt/locale/bitcoin_ar.ts \ + qt/locale/bitcoin_be_BY.ts \ + qt/locale/bitcoin_bg.ts \ + qt/locale/bitcoin_bs.ts \ + qt/locale/bitcoin_ca_ES.ts \ + qt/locale/bitcoin_ca.ts \ + qt/locale/bitcoin_ca@valencia.ts \ + qt/locale/bitcoin_cmn.ts \ + qt/locale/bitcoin_cs.ts \ + qt/locale/bitcoin_cy.ts \ + qt/locale/bitcoin_da.ts \ + qt/locale/bitcoin_de.ts \ + qt/locale/bitcoin_el_GR.ts \ + qt/locale/bitcoin_en.ts \ + qt/locale/bitcoin_eo.ts \ + qt/locale/bitcoin_es_CL.ts \ + qt/locale/bitcoin_es_DO.ts \ + qt/locale/bitcoin_es_MX.ts \ + qt/locale/bitcoin_es.ts \ + qt/locale/bitcoin_es_UY.ts \ + qt/locale/bitcoin_et.ts \ + qt/locale/bitcoin_eu_ES.ts \ + qt/locale/bitcoin_fa_IR.ts \ + qt/locale/bitcoin_fa.ts \ + qt/locale/bitcoin_fi.ts \ + qt/locale/bitcoin_fr_CA.ts \ + qt/locale/bitcoin_fr.ts \ + qt/locale/bitcoin_gl.ts \ + qt/locale/bitcoin_gu_IN.ts \ + qt/locale/bitcoin_he.ts \ + qt/locale/bitcoin_hi_IN.ts \ + qt/locale/bitcoin_hr.ts \ + qt/locale/bitcoin_hu.ts \ + qt/locale/bitcoin_id_ID.ts \ + qt/locale/bitcoin_it.ts \ + qt/locale/bitcoin_ja.ts \ + qt/locale/bitcoin_ka.ts \ + qt/locale/bitcoin_kk_KZ.ts \ + qt/locale/bitcoin_ko_KR.ts \ + qt/locale/bitcoin_ky.ts \ + qt/locale/bitcoin_la.ts \ + qt/locale/bitcoin_lt.ts \ + qt/locale/bitcoin_lv_LV.ts \ + qt/locale/bitcoin_mn.ts \ + qt/locale/bitcoin_ms_MY.ts \ + qt/locale/bitcoin_nb.ts \ + qt/locale/bitcoin_nl.ts \ + qt/locale/bitcoin_pam.ts \ + qt/locale/bitcoin_pl.ts \ + qt/locale/bitcoin_pt_BR.ts \ + qt/locale/bitcoin_pt_PT.ts \ + qt/locale/bitcoin_ro_RO.ts \ + qt/locale/bitcoin_ru.ts \ + qt/locale/bitcoin_sah.ts \ + qt/locale/bitcoin_sk.ts \ + qt/locale/bitcoin_sl_SI.ts \ + qt/locale/bitcoin_sq.ts \ + qt/locale/bitcoin_sr.ts \ + qt/locale/bitcoin_sv.ts \ + qt/locale/bitcoin_th_TH.ts \ + qt/locale/bitcoin_tr.ts \ + qt/locale/bitcoin_uk.ts \ + qt/locale/bitcoin_ur_PK.ts \ + qt/locale/bitcoin_uz@Cyrl.ts \ + qt/locale/bitcoin_vi.ts \ + qt/locale/bitcoin_vi_VN.ts \ + qt/locale/bitcoin_zh_CN.ts \ + qt/locale/bitcoin_zh_HK.ts \ + qt/locale/bitcoin_zh_TW.ts + +QT_FORMS_UI = \ + qt/forms/aboutdialog.ui \ + qt/forms/addressbookpage.ui \ + qt/forms/askpassphrasedialog.ui \ + qt/forms/coincontroldialog.ui \ + qt/forms/editaddressdialog.ui \ + qt/forms/helpmessagedialog.ui \ + qt/forms/intro.ui \ + qt/forms/openuridialog.ui \ + qt/forms/optionsdialog.ui \ + qt/forms/overviewpage.ui \ + qt/forms/receivecoinsdialog.ui \ + qt/forms/receiverequestdialog.ui \ + qt/forms/rpcconsole.ui \ + qt/forms/sendcoinsdialog.ui \ + qt/forms/sendcoinsentry.ui \ + qt/forms/signverifymessagedialog.ui \ + qt/forms/transactiondescdialog.ui + +QT_MOC_CPP = \ + qt/moc_addressbookpage.cpp \ + qt/moc_addresstablemodel.cpp \ + qt/moc_askpassphrasedialog.cpp \ + qt/moc_bitcoinaddressvalidator.cpp \ + qt/moc_bitcoinamountfield.cpp \ + qt/moc_bitcoingui.cpp \ + qt/moc_bitcoinunits.cpp \ + qt/moc_clientmodel.cpp \ + qt/moc_coincontroldialog.cpp \ + qt/moc_coincontroltreewidget.cpp \ + qt/moc_csvmodelwriter.cpp \ + qt/moc_editaddressdialog.cpp \ + qt/moc_guiutil.cpp \ + qt/moc_intro.cpp \ + qt/moc_macdockiconhandler.cpp \ + qt/moc_macnotificationhandler.cpp \ + qt/moc_monitoreddatamapper.cpp \ + qt/moc_notificator.cpp \ + qt/moc_openuridialog.cpp \ + qt/moc_optionsdialog.cpp \ + qt/moc_optionsmodel.cpp \ + qt/moc_overviewpage.cpp \ + qt/moc_peertablemodel.cpp \ + qt/moc_paymentserver.cpp \ + qt/moc_qvalidatedlineedit.cpp \ + qt/moc_qvaluecombobox.cpp \ + qt/moc_receivecoinsdialog.cpp \ + qt/moc_receiverequestdialog.cpp \ + qt/moc_recentrequeststablemodel.cpp \ + qt/moc_rpcconsole.cpp \ + qt/moc_sendcoinsdialog.cpp \ + qt/moc_sendcoinsentry.cpp \ + qt/moc_signverifymessagedialog.cpp \ + qt/moc_splashscreen.cpp \ + qt/moc_trafficgraphwidget.cpp \ + qt/moc_transactiondesc.cpp \ + qt/moc_transactiondescdialog.cpp \ + qt/moc_transactionfilterproxy.cpp \ + qt/moc_transactiontablemodel.cpp \ + qt/moc_transactionview.cpp \ + qt/moc_utilitydialog.cpp \ + qt/moc_walletframe.cpp \ + qt/moc_walletmodel.cpp \ + qt/moc_walletview.cpp + +BITCOIN_MM = \ + qt/macdockiconhandler.mm \ + qt/macnotificationhandler.mm + +QT_MOC = \ + qt/bitcoin.moc \ + qt/intro.moc \ + qt/overviewpage.moc \ + qt/rpcconsole.moc + +QT_QRC_CPP = qt/qrc_bitcoin.cpp +QT_QRC = qt/bitcoin.qrc + +PROTOBUF_CC = qt/paymentrequest.pb.cc +PROTOBUF_H = qt/paymentrequest.pb.h +PROTOBUF_PROTO = qt/paymentrequest.proto + +BITCOIN_QT_H = \ + qt/addressbookpage.h \ + qt/addresstablemodel.h \ + qt/askpassphrasedialog.h \ + qt/bitcoinaddressvalidator.h \ + qt/bitcoinamountfield.h \ + qt/bitcoingui.h \ + qt/bitcoinunits.h \ + qt/clientmodel.h \ + qt/coincontroldialog.h \ + qt/coincontroltreewidget.h \ + qt/csvmodelwriter.h \ + qt/editaddressdialog.h \ + qt/guiconstants.h \ + qt/guiutil.h \ + qt/intro.h \ + qt/macdockiconhandler.h \ + qt/macnotificationhandler.h \ + qt/monitoreddatamapper.h \ + qt/notificator.h \ + qt/openuridialog.h \ + qt/optionsdialog.h \ + qt/optionsmodel.h \ + qt/overviewpage.h \ + qt/paymentrequestplus.h \ + qt/paymentserver.h \ + qt/peertablemodel.h \ + qt/qvalidatedlineedit.h \ + qt/qvaluecombobox.h \ + qt/receivecoinsdialog.h \ + qt/receiverequestdialog.h \ + qt/recentrequeststablemodel.h \ + qt/rpcconsole.h \ + qt/sendcoinsdialog.h \ + qt/sendcoinsentry.h \ + qt/signverifymessagedialog.h \ + qt/splashscreen.h \ + qt/trafficgraphwidget.h \ + qt/transactiondesc.h \ + qt/transactiondescdialog.h \ + qt/transactionfilterproxy.h \ + qt/transactionrecord.h \ + qt/transactiontablemodel.h \ + qt/transactionview.h \ + qt/utilitydialog.h \ + qt/walletframe.h \ + qt/walletmodel.h \ + qt/walletmodeltransaction.h \ + qt/walletview.h \ + qt/winshutdownmonitor.h + +RES_ICONS = \ + qt/res/icons/add.png \ + qt/res/icons/address-book.png \ + qt/res/icons/bitcoin.ico \ + qt/res/icons/bitcoin.png \ + qt/res/icons/bitcoin_testnet.ico \ + qt/res/icons/bitcoin_testnet.png \ + qt/res/icons/clock1.png \ + qt/res/icons/clock2.png \ + qt/res/icons/clock3.png \ + qt/res/icons/clock4.png \ + qt/res/icons/clock5.png \ + qt/res/icons/configure.png \ + qt/res/icons/connect0_16.png \ + qt/res/icons/connect1_16.png \ + qt/res/icons/connect2_16.png \ + qt/res/icons/connect3_16.png \ + qt/res/icons/connect4_16.png \ + qt/res/icons/debugwindow.png \ + qt/res/icons/edit.png \ + qt/res/icons/editcopy.png \ + qt/res/icons/editpaste.png \ + qt/res/icons/export.png \ + qt/res/icons/filesave.png \ + qt/res/icons/history.png \ + qt/res/icons/key.png \ + qt/res/icons/lock_closed.png \ + qt/res/icons/lock_open.png \ + qt/res/icons/overview.png \ + qt/res/icons/qrcode.png \ + qt/res/icons/quit.png \ + qt/res/icons/receive.png \ + qt/res/icons/remove.png \ + qt/res/icons/send.png \ + qt/res/icons/synced.png \ + qt/res/icons/toolbar.png \ + qt/res/icons/toolbar_testnet.png \ + qt/res/icons/transaction0.png \ + qt/res/icons/transaction2.png \ + qt/res/icons/transaction_conflicted.png \ + qt/res/icons/tx_inout.png \ + qt/res/icons/tx_input.png \ + qt/res/icons/tx_output.png \ + qt/res/icons/tx_mined.png + +BITCOIN_QT_CPP = \ + qt/bitcoinaddressvalidator.cpp \ + qt/bitcoinamountfield.cpp \ + qt/bitcoingui.cpp \ + qt/bitcoinunits.cpp \ + qt/clientmodel.cpp \ + qt/csvmodelwriter.cpp \ + qt/guiutil.cpp \ + qt/intro.cpp \ + qt/monitoreddatamapper.cpp \ + qt/notificator.cpp \ + qt/optionsdialog.cpp \ + qt/optionsmodel.cpp \ + qt/peertablemodel.cpp \ + qt/qvalidatedlineedit.cpp \ + qt/qvaluecombobox.cpp \ + qt/rpcconsole.cpp \ + qt/splashscreen.cpp \ + qt/trafficgraphwidget.cpp \ + qt/utilitydialog.cpp \ + qt/winshutdownmonitor.cpp + +if ENABLE_WALLET +BITCOIN_QT_CPP += \ + qt/addressbookpage.cpp \ + qt/addresstablemodel.cpp \ + qt/askpassphrasedialog.cpp \ + qt/coincontroldialog.cpp \ + qt/coincontroltreewidget.cpp \ + qt/editaddressdialog.cpp \ + qt/openuridialog.cpp \ + qt/overviewpage.cpp \ + qt/paymentrequestplus.cpp \ + qt/paymentserver.cpp \ + qt/receivecoinsdialog.cpp \ + qt/receiverequestdialog.cpp \ + qt/recentrequeststablemodel.cpp \ + qt/sendcoinsdialog.cpp \ + qt/sendcoinsentry.cpp \ + qt/signverifymessagedialog.cpp \ + qt/transactiondesc.cpp \ + qt/transactiondescdialog.cpp \ + qt/transactionfilterproxy.cpp \ + qt/transactionrecord.cpp \ + qt/transactiontablemodel.cpp \ + qt/transactionview.cpp \ + qt/walletframe.cpp \ + qt/walletmodel.cpp \ + qt/walletmodeltransaction.cpp \ + qt/walletview.cpp +endif + +RES_IMAGES = \ + qt/res/images/about.png \ + qt/res/images/splash.png \ + qt/res/images/splash_testnet.png + +RES_MOVIES = $(wildcard qt/res/movies/spinner-*.png) + +BITCOIN_RC = qt/res/bitcoin-qt-res.rc + +qt_libbitcoinqt_a_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ + -I$(top_srcdir)/src/qt/forms $(QT_DBUS_INCLUDES) +qt_libbitcoinqt_a_SOURCES = $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(QT_FORMS_UI) \ + $(QT_QRC) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) + +nodist_qt_libbitcoinqt_a_SOURCES = $(QT_MOC_CPP) $(QT_MOC) $(PROTOBUF_CC) \ + $(PROTOBUF_H) $(QT_QRC_CPP) + +# forms/foo.h -> forms/ui_foo.h +QT_FORMS_H=$(join $(dir $(QT_FORMS_UI)),$(addprefix ui_, $(notdir $(QT_FORMS_UI:.ui=.h)))) + +# Most files will depend on the forms and moc files as includes. Generate them +# before anything else. +$(QT_MOC): $(QT_FORMS_H) +$(qt_libbitcoinqt_a_OBJECTS) $(qt_bitcoin_qt_OBJECTS) : | $(QT_MOC) + +#Generating these with a half-written protobuf header leads to wacky results. +#This makes sure it's done. +$(QT_MOC): $(PROTOBUF_H) +$(QT_MOC_CPP): $(PROTOBUF_H) + +# bitcoin-qt binary # +qt_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ + -I$(top_srcdir)/src/qt/forms +qt_bitcoin_qt_SOURCES = qt/bitcoin.cpp +if TARGET_DARWIN + qt_bitcoin_qt_SOURCES += $(BITCOIN_MM) +endif +if TARGET_WINDOWS + qt_bitcoin_qt_SOURCES += $(BITCOIN_RC) +endif +qt_bitcoin_qt_LDADD = qt/libbitcoinqt.a $(LIBBITCOIN_SERVER) +if ENABLE_WALLET +qt_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) +endif +qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \ + $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) +qt_bitcoin_qt_LDFLAGS = $(QT_LDFLAGS) + +#locale/foo.ts -> locale/foo.qm +QT_QM=$(QT_TS:.ts=.qm) + +.SECONDARY: $(QT_QM) + +qt/bitcoinstrings.cpp: $(libbitcoin_server_a_SOURCES) $(libbitcoin_common_a_SOURCES) $(libbitcoin_cli_a_SOURCES) + @test -n $(XGETTEXT) || echo "xgettext is required for updating translations" + @cd $(top_srcdir); XGETTEXT=$(XGETTEXT) share/qt/extract_strings_qt.py + +translate: qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM) + @test -n $(LUPDATE) || echo "lupdate is required for updating translations" + @QT_SELECT=$(QT_SELECT) $(LUPDATE) $^ -locations relative -no-obsolete -ts qt/locale/bitcoin_en.ts + +$(QT_QRC_CPP): $(QT_QRC) $(QT_QM) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(PROTOBUF_H) + @cd $(abs_srcdir); test -f $(RCC) && QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin -o $(abs_builddir)/$@ $< || \ + echo error: could not build $@ + $(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,} + $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} + +CLEAN_QT = $(nodist_qt_libbitcoinqt_a_SOURCES) $(QT_QM) $(QT_FORMS_H) qt/*.gcda qt/*.gcno + +CLEANFILES += $(CLEAN_QT) + +bitcoin_qt_clean: FORCE + rm -f $(CLEAN_QT) $(qt_libbitcoinqt_a_OBJECTS) $(qt_bitcoin_qt_OBJECTS) qt/bitcoin-qt$(EXEEXT) $(LIBBITCOINQT) + +bitcoin_qt : qt/bitcoin-qt$(EXEEXT) diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include new file mode 100644 index 0000000000..0d08a636e9 --- /dev/null +++ b/src/Makefile.qttest.include @@ -0,0 +1,52 @@ +AM_CPPFLAGS += -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/qt \ + -I$(top_builddir)/src/qt \ + $(PROTOBUF_CFLAGS) \ + $(QR_CFLAGS) +bin_PROGRAMS += qt/test/test_bitcoin-qt +TESTS += qt/test/test_bitcoin-qt + +TEST_QT_MOC_CPP = qt/test/moc_uritests.cpp + +if ENABLE_WALLET +TEST_QT_MOC_CPP += qt/test/moc_paymentservertests.cpp +endif + +TEST_QT_H = \ + qt/test/uritests.h \ + qt/test/paymentrequestdata.h \ + qt/test/paymentservertests.h + +qt_test_test_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) $(QT_TEST_INCLUDES) + +qt_test_test_bitcoin_qt_SOURCES = \ + qt/test/test_main.cpp \ + qt/test/uritests.cpp \ + $(TEST_QT_H) +if ENABLE_WALLET +qt_test_test_bitcoin_qt_SOURCES += \ + qt/test/paymentservertests.cpp +endif + +nodist_qt_test_test_bitcoin_qt_SOURCES = $(TEST_QT_MOC_CPP) + +qt_test_test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER) +if ENABLE_WALLET +qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) +endif +qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) \ + $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ + $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) +qt_test_test_bitcoin_qt_LDFLAGS = $(QT_LDFLAGS) + +CLEAN_BITCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno + +CLEANFILES += $(CLEAN_BITCOIN_QT_TEST) + +test_bitcoin_qt : qt/test/test_bitcoin-qt$(EXEEXT) + +test_bitcoin_qt_check : qt/test/test_bitcoin-qt$(EXEEXT) FORCE + $(MAKE) check-TESTS TESTS=$^ + +test_bitcoin_qt_clean: FORCE + rm -f $(CLEAN_BITCOIN_QT_TEST) $(qt_test_test_bitcoin_qt_OBJECTS) diff --git a/src/Makefile.test.include b/src/Makefile.test.include new file mode 100644 index 0000000000..4a70b0f9e9 --- /dev/null +++ b/src/Makefile.test.include @@ -0,0 +1,87 @@ +AM_CPPFLAGS += -I$(top_builddir)/src/test/ + +TESTS += test/test_bitcoin +bin_PROGRAMS += test/test_bitcoin +TEST_SRCDIR = test +TEST_BINARY=test/test_bitcoin$(EXEEXT) + +JSON_TEST_FILES = \ + test/data/script_valid.json \ + test/data/base58_keys_valid.json \ + test/data/sig_canonical.json \ + test/data/sig_noncanonical.json \ + test/data/base58_encode_decode.json \ + test/data/base58_keys_invalid.json \ + test/data/script_invalid.json \ + test/data/tx_invalid.json \ + test/data/tx_valid.json \ + test/data/sighash.json + +RAW_TEST_FILES = test/data/alertTests.raw + +GENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h) + +BITCOIN_TESTS =\ + test/bignum.h \ + test/alert_tests.cpp \ + test/allocator_tests.cpp \ + test/base32_tests.cpp \ + test/base58_tests.cpp \ + test/base64_tests.cpp \ + test/bloom_tests.cpp \ + test/canonical_tests.cpp \ + test/checkblock_tests.cpp \ + test/Checkpoints_tests.cpp \ + test/compress_tests.cpp \ + test/DoS_tests.cpp \ + test/getarg_tests.cpp \ + test/key_tests.cpp \ + test/main_tests.cpp \ + test/miner_tests.cpp \ + test/mruset_tests.cpp \ + test/multisig_tests.cpp \ + test/netbase_tests.cpp \ + test/pmt_tests.cpp \ + test/rpc_tests.cpp \ + test/script_P2SH_tests.cpp \ + test/script_tests.cpp \ + test/serialize_tests.cpp \ + test/sigopcount_tests.cpp \ + test/test_bitcoin.cpp \ + test/transaction_tests.cpp \ + test/uint256_tests.cpp \ + test/util_tests.cpp \ + test/scriptnum_tests.cpp \ + test/sighash_tests.cpp + +if ENABLE_WALLET +BITCOIN_TESTS += \ + test/accounting_tests.cpp \ + test/wallet_tests.cpp \ + test/rpc_wallet_tests.cpp +endif + +test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES) +test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(TESTDEFS) +test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \ + $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) +if ENABLE_WALLET +test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) +endif +test_test_bitcoin_LDADD += $(BDB_LIBS) + +nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES) + +$(BITCOIN_TESTS): $(GENERATED_TEST_FILES) + +CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES) + +CLEANFILES += $(CLEAN_BITCOIN_TEST) + +bitcoin_test: $(TEST_BINARY) + +bitcoin_test_check: $(TEST_BINARY) FORCE + $(MAKE) check-TESTS TESTS=$^ + +bitcoin_test_clean : FORCE + rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY) From be4e9aeb148420317109d173d7fb3bc56b37f434 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 28 May 2014 13:40:35 -0400 Subject: [PATCH 0136/1288] build: delete old Makefile.am's --- src/qt/Makefile.am | 382 ---------------------------------------- src/qt/test/Makefile.am | 46 ----- src/test/Makefile.am | 77 -------- 3 files changed, 505 deletions(-) delete mode 100644 src/qt/Makefile.am delete mode 100644 src/qt/test/Makefile.am delete mode 100644 src/test/Makefile.am diff --git a/src/qt/Makefile.am b/src/qt/Makefile.am deleted file mode 100644 index d527f790ef..0000000000 --- a/src/qt/Makefile.am +++ /dev/null @@ -1,382 +0,0 @@ -include $(top_srcdir)/src/Makefile.include - -AM_CPPFLAGS += -I$(top_srcdir)/src \ - -I$(top_builddir)/src/qt \ - -I$(top_builddir)/src/qt/forms \ - $(PROTOBUF_CFLAGS) \ - $(QR_CFLAGS) -bin_PROGRAMS = bitcoin-qt -noinst_LIBRARIES = libbitcoinqt.a -SUBDIRS = . $(BUILD_TEST_QT) -DIST_SUBDIRS = . test - -# bitcoin qt core # -QT_TS = \ - locale/bitcoin_ach.ts \ - locale/bitcoin_af_ZA.ts \ - locale/bitcoin_ar.ts \ - locale/bitcoin_be_BY.ts \ - locale/bitcoin_bg.ts \ - locale/bitcoin_bs.ts \ - locale/bitcoin_ca_ES.ts \ - locale/bitcoin_ca.ts \ - locale/bitcoin_ca@valencia.ts \ - locale/bitcoin_cmn.ts \ - locale/bitcoin_cs.ts \ - locale/bitcoin_cy.ts \ - locale/bitcoin_da.ts \ - locale/bitcoin_de.ts \ - locale/bitcoin_el_GR.ts \ - locale/bitcoin_en.ts \ - locale/bitcoin_eo.ts \ - locale/bitcoin_es_CL.ts \ - locale/bitcoin_es_DO.ts \ - locale/bitcoin_es_MX.ts \ - locale/bitcoin_es.ts \ - locale/bitcoin_es_UY.ts \ - locale/bitcoin_et.ts \ - locale/bitcoin_eu_ES.ts \ - locale/bitcoin_fa_IR.ts \ - locale/bitcoin_fa.ts \ - locale/bitcoin_fi.ts \ - locale/bitcoin_fr_CA.ts \ - locale/bitcoin_fr.ts \ - locale/bitcoin_gl.ts \ - locale/bitcoin_gu_IN.ts \ - locale/bitcoin_he.ts \ - locale/bitcoin_hi_IN.ts \ - locale/bitcoin_hr.ts \ - locale/bitcoin_hu.ts \ - locale/bitcoin_id_ID.ts \ - locale/bitcoin_it.ts \ - locale/bitcoin_ja.ts \ - locale/bitcoin_ka.ts \ - locale/bitcoin_kk_KZ.ts \ - locale/bitcoin_ko_KR.ts \ - locale/bitcoin_ky.ts \ - locale/bitcoin_la.ts \ - locale/bitcoin_lt.ts \ - locale/bitcoin_lv_LV.ts \ - locale/bitcoin_mn.ts \ - locale/bitcoin_ms_MY.ts \ - locale/bitcoin_nb.ts \ - locale/bitcoin_nl.ts \ - locale/bitcoin_pam.ts \ - locale/bitcoin_pl.ts \ - locale/bitcoin_pt_BR.ts \ - locale/bitcoin_pt_PT.ts \ - locale/bitcoin_ro_RO.ts \ - locale/bitcoin_ru.ts \ - locale/bitcoin_sah.ts \ - locale/bitcoin_sk.ts \ - locale/bitcoin_sl_SI.ts \ - locale/bitcoin_sq.ts \ - locale/bitcoin_sr.ts \ - locale/bitcoin_sv.ts \ - locale/bitcoin_th_TH.ts \ - locale/bitcoin_tr.ts \ - locale/bitcoin_uk.ts \ - locale/bitcoin_ur_PK.ts \ - locale/bitcoin_uz@Cyrl.ts \ - locale/bitcoin_vi.ts \ - locale/bitcoin_vi_VN.ts \ - locale/bitcoin_zh_CN.ts \ - locale/bitcoin_zh_HK.ts \ - locale/bitcoin_zh_TW.ts - -QT_FORMS_UI = \ - forms/aboutdialog.ui \ - forms/addressbookpage.ui \ - forms/askpassphrasedialog.ui \ - forms/coincontroldialog.ui \ - forms/editaddressdialog.ui \ - forms/helpmessagedialog.ui \ - forms/intro.ui \ - forms/openuridialog.ui \ - forms/optionsdialog.ui \ - forms/overviewpage.ui \ - forms/receivecoinsdialog.ui \ - forms/receiverequestdialog.ui \ - forms/rpcconsole.ui \ - forms/sendcoinsdialog.ui \ - forms/sendcoinsentry.ui \ - forms/signverifymessagedialog.ui \ - forms/transactiondescdialog.ui - -QT_MOC_CPP = \ - moc_addressbookpage.cpp \ - moc_addresstablemodel.cpp \ - moc_askpassphrasedialog.cpp \ - moc_bitcoinaddressvalidator.cpp \ - moc_bitcoinamountfield.cpp \ - moc_bitcoingui.cpp \ - moc_bitcoinunits.cpp \ - moc_clientmodel.cpp \ - moc_coincontroldialog.cpp \ - moc_coincontroltreewidget.cpp \ - moc_csvmodelwriter.cpp \ - moc_editaddressdialog.cpp \ - moc_guiutil.cpp \ - moc_intro.cpp \ - moc_macdockiconhandler.cpp \ - moc_macnotificationhandler.cpp \ - moc_monitoreddatamapper.cpp \ - moc_notificator.cpp \ - moc_openuridialog.cpp \ - moc_optionsdialog.cpp \ - moc_optionsmodel.cpp \ - moc_overviewpage.cpp \ - moc_peertablemodel.cpp \ - moc_paymentserver.cpp \ - moc_qvalidatedlineedit.cpp \ - moc_qvaluecombobox.cpp \ - moc_receivecoinsdialog.cpp \ - moc_receiverequestdialog.cpp \ - moc_recentrequeststablemodel.cpp \ - moc_rpcconsole.cpp \ - moc_sendcoinsdialog.cpp \ - moc_sendcoinsentry.cpp \ - moc_signverifymessagedialog.cpp \ - moc_splashscreen.cpp \ - moc_trafficgraphwidget.cpp \ - moc_transactiondesc.cpp \ - moc_transactiondescdialog.cpp \ - moc_transactionfilterproxy.cpp \ - moc_transactiontablemodel.cpp \ - moc_transactionview.cpp \ - moc_utilitydialog.cpp \ - moc_walletframe.cpp \ - moc_walletmodel.cpp \ - moc_walletview.cpp - -BITCOIN_MM = \ - macdockiconhandler.mm \ - macnotificationhandler.mm - -QT_MOC = \ - bitcoin.moc \ - intro.moc \ - overviewpage.moc \ - rpcconsole.moc - -QT_QRC_CPP = qrc_bitcoin.cpp -QT_QRC = bitcoin.qrc - -PROTOBUF_CC = paymentrequest.pb.cc -PROTOBUF_H = paymentrequest.pb.h -PROTOBUF_PROTO = paymentrequest.proto - -BITCOIN_QT_H = \ - addressbookpage.h \ - addresstablemodel.h \ - askpassphrasedialog.h \ - bitcoinaddressvalidator.h \ - bitcoinamountfield.h \ - bitcoingui.h \ - bitcoinunits.h \ - clientmodel.h \ - coincontroldialog.h \ - coincontroltreewidget.h \ - csvmodelwriter.h \ - editaddressdialog.h \ - guiconstants.h \ - guiutil.h \ - intro.h \ - macdockiconhandler.h \ - macnotificationhandler.h \ - monitoreddatamapper.h \ - notificator.h \ - openuridialog.h \ - optionsdialog.h \ - optionsmodel.h \ - overviewpage.h \ - paymentrequestplus.h \ - paymentserver.h \ - peertablemodel.h \ - qvalidatedlineedit.h \ - qvaluecombobox.h \ - receivecoinsdialog.h \ - receiverequestdialog.h \ - recentrequeststablemodel.h \ - rpcconsole.h \ - sendcoinsdialog.h \ - sendcoinsentry.h \ - signverifymessagedialog.h \ - splashscreen.h \ - trafficgraphwidget.h \ - transactiondesc.h \ - transactiondescdialog.h \ - transactionfilterproxy.h \ - transactionrecord.h \ - transactiontablemodel.h \ - transactionview.h \ - utilitydialog.h \ - walletframe.h \ - walletmodel.h \ - walletmodeltransaction.h \ - walletview.h \ - winshutdownmonitor.h - -RES_ICONS = \ - res/icons/add.png \ - res/icons/address-book.png \ - res/icons/bitcoin.ico \ - res/icons/bitcoin.png \ - res/icons/bitcoin_testnet.ico \ - res/icons/bitcoin_testnet.png \ - res/icons/clock1.png \ - res/icons/clock2.png \ - res/icons/clock3.png \ - res/icons/clock4.png \ - res/icons/clock5.png \ - res/icons/configure.png \ - res/icons/connect0_16.png \ - res/icons/connect1_16.png \ - res/icons/connect2_16.png \ - res/icons/connect3_16.png \ - res/icons/connect4_16.png \ - res/icons/debugwindow.png \ - res/icons/edit.png \ - res/icons/editcopy.png \ - res/icons/editpaste.png \ - res/icons/export.png \ - res/icons/filesave.png \ - res/icons/history.png \ - res/icons/key.png \ - res/icons/lock_closed.png \ - res/icons/lock_open.png \ - res/icons/overview.png \ - res/icons/qrcode.png \ - res/icons/quit.png \ - res/icons/receive.png \ - res/icons/remove.png \ - res/icons/send.png \ - res/icons/synced.png \ - res/icons/toolbar.png \ - res/icons/toolbar_testnet.png \ - res/icons/transaction0.png \ - res/icons/transaction2.png \ - res/icons/transaction_conflicted.png \ - res/icons/tx_inout.png \ - res/icons/tx_input.png \ - res/icons/tx_output.png \ - res/icons/tx_mined.png - -BITCOIN_QT_CPP = \ - bitcoin.cpp \ - bitcoinaddressvalidator.cpp \ - bitcoinamountfield.cpp \ - bitcoingui.cpp \ - bitcoinunits.cpp \ - clientmodel.cpp \ - csvmodelwriter.cpp \ - guiutil.cpp \ - intro.cpp \ - monitoreddatamapper.cpp \ - notificator.cpp \ - optionsdialog.cpp \ - optionsmodel.cpp \ - peertablemodel.cpp \ - qvalidatedlineedit.cpp \ - qvaluecombobox.cpp \ - rpcconsole.cpp \ - splashscreen.cpp \ - trafficgraphwidget.cpp \ - utilitydialog.cpp \ - winshutdownmonitor.cpp - -if ENABLE_WALLET -BITCOIN_QT_CPP += \ - addressbookpage.cpp \ - addresstablemodel.cpp \ - askpassphrasedialog.cpp \ - coincontroldialog.cpp \ - coincontroltreewidget.cpp \ - editaddressdialog.cpp \ - openuridialog.cpp \ - overviewpage.cpp \ - paymentrequestplus.cpp \ - paymentserver.cpp \ - receivecoinsdialog.cpp \ - receiverequestdialog.cpp \ - recentrequeststablemodel.cpp \ - sendcoinsdialog.cpp \ - sendcoinsentry.cpp \ - signverifymessagedialog.cpp \ - transactiondesc.cpp \ - transactiondescdialog.cpp \ - transactionfilterproxy.cpp \ - transactionrecord.cpp \ - transactiontablemodel.cpp \ - transactionview.cpp \ - walletframe.cpp \ - walletmodel.cpp \ - walletmodeltransaction.cpp \ - walletview.cpp -endif - -RES_IMAGES = \ - res/images/about.png \ - res/images/splash.png \ - res/images/splash_testnet.png - -RES_MOVIES = $(wildcard res/movies/spinner-*.png) - -BITCOIN_RC = res/bitcoin-qt-res.rc - -libbitcoinqt_a_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ - -I$(top_srcdir)/src/qt/forms $(QT_DBUS_INCLUDES) -libbitcoinqt_a_SOURCES = $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(QT_FORMS_UI) \ - $(QT_QRC) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) - -nodist_libbitcoinqt_a_SOURCES = $(QT_MOC_CPP) $(QT_MOC) $(PROTOBUF_CC) \ - $(PROTOBUF_H) $(QT_QRC_CPP) - -BUILT_SOURCES = $(nodist_libbitcoinqt_a_SOURCES) - -#Generating these with a half-written protobuf header leads to wacky results. -#This makes sure it's done. -$(QT_MOC): $(PROTOBUF_H) -$(QT_MOC_CPP): $(PROTOBUF_H) - -# bitcoin-qt binary # -bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ - -I$(top_srcdir)/src/qt/forms -bitcoin_qt_SOURCES = bitcoin.cpp -if TARGET_DARWIN - bitcoin_qt_SOURCES += $(BITCOIN_MM) -endif -if TARGET_WINDOWS - bitcoin_qt_SOURCES += $(BITCOIN_RC) -endif -bitcoin_qt_LDADD = libbitcoinqt.a $(LIBBITCOIN_SERVER) -if ENABLE_WALLET -bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) -endif -bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \ - $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) -bitcoin_qt_LDFLAGS = $(QT_LDFLAGS) - -# forms/foo.h -> forms/ui_foo.h -QT_FORMS_H=$(join $(dir $(QT_FORMS_UI)),$(addprefix ui_, $(notdir $(QT_FORMS_UI:.ui=.h)))) - -#locale/foo.ts -> locale/foo.qm -QT_QM=$(QT_TS:.ts=.qm) - -.PHONY: FORCE -.SECONDARY: $(QT_QM) - -bitcoinstrings.cpp: FORCE - $(MAKE) -C $(top_srcdir)/src qt/bitcoinstrings.cpp - -translate: bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM) - @test -n $(LUPDATE) || echo "lupdate is required for updating translations" - @QT_SELECT=$(QT_SELECT) $(LUPDATE) $^ -locations relative -no-obsolete -ts locale/bitcoin_en.ts - -$(QT_QRC_CPP): $(QT_QRC) $(QT_QM) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(PROTOBUF_H) - @cd $(abs_srcdir); test -f $(RCC) && QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin -o $(abs_builddir)/$@ $< || \ - echo error: could not build $@ - $(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,} - $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} - -CLEANFILES = $(BUILT_SOURCES) $(QT_QM) $(QT_FORMS_H) *.gcda *.gcno diff --git a/src/qt/test/Makefile.am b/src/qt/test/Makefile.am deleted file mode 100644 index 2461b5ff4d..0000000000 --- a/src/qt/test/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ -include $(top_srcdir)/src/Makefile.include - -AM_CPPFLAGS += -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/qt \ - -I$(top_builddir)/src/qt \ - $(PROTOBUF_CFLAGS) \ - $(QR_CFLAGS) -bin_PROGRAMS = test_bitcoin-qt -TESTS = test_bitcoin-qt - -TEST_QT_MOC_CPP = moc_uritests.cpp - -if ENABLE_WALLET -TEST_QT_MOC_CPP += moc_paymentservertests.cpp -endif - -TEST_QT_H = \ - uritests.h \ - paymentrequestdata.h \ - paymentservertests.h - -BUILT_SOURCES = $(TEST_QT_MOC_CPP) - -test_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) $(QT_TEST_INCLUDES) - -test_bitcoin_qt_SOURCES = \ - test_main.cpp \ - uritests.cpp \ - $(TEST_QT_H) -if ENABLE_WALLET -test_bitcoin_qt_SOURCES += \ - paymentservertests.cpp -endif - -nodist_test_bitcoin_qt_SOURCES = $(TEST_QT_MOC_CPP) - -test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER) -if ENABLE_WALLET -test_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) -endif -test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) \ - $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ - $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) -test_bitcoin_qt_LDFLAGS = $(QT_LDFLAGS) - -CLEANFILES = $(BUILT_SOURCES) *.gcda *.gcno diff --git a/src/test/Makefile.am b/src/test/Makefile.am deleted file mode 100644 index cde3a31e2f..0000000000 --- a/src/test/Makefile.am +++ /dev/null @@ -1,77 +0,0 @@ -include $(top_srcdir)/src/Makefile.include - -AM_CPPFLAGS += -I$(top_srcdir)/src - -bin_PROGRAMS = test_bitcoin - -TESTS = test_bitcoin - -JSON_TEST_FILES = \ - data/script_valid.json \ - data/base58_keys_valid.json \ - data/sig_canonical.json \ - data/sig_noncanonical.json \ - data/base58_encode_decode.json \ - data/base58_keys_invalid.json \ - data/script_invalid.json \ - data/tx_invalid.json \ - data/tx_valid.json \ - data/sighash.json - -RAW_TEST_FILES = data/alertTests.raw - -BUILT_SOURCES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h) - -# test_bitcoin binary # -test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(TESTDEFS) -test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \ - $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) -if ENABLE_WALLET -test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) -endif -test_bitcoin_LDADD += $(BDB_LIBS) - -test_bitcoin_SOURCES = \ - bignum.h \ - alert_tests.cpp \ - allocator_tests.cpp \ - base32_tests.cpp \ - base58_tests.cpp \ - base64_tests.cpp \ - bloom_tests.cpp \ - canonical_tests.cpp \ - checkblock_tests.cpp \ - Checkpoints_tests.cpp \ - compress_tests.cpp \ - DoS_tests.cpp \ - getarg_tests.cpp \ - key_tests.cpp \ - main_tests.cpp \ - miner_tests.cpp \ - mruset_tests.cpp \ - multisig_tests.cpp \ - netbase_tests.cpp \ - pmt_tests.cpp \ - rpc_tests.cpp \ - script_P2SH_tests.cpp \ - script_tests.cpp \ - serialize_tests.cpp \ - sigopcount_tests.cpp \ - test_bitcoin.cpp \ - transaction_tests.cpp \ - uint256_tests.cpp \ - util_tests.cpp \ - scriptnum_tests.cpp \ - sighash_tests.cpp \ - $(JSON_TEST_FILES) $(RAW_TEST_FILES) - -if ENABLE_WALLET -test_bitcoin_SOURCES += \ - accounting_tests.cpp \ - wallet_tests.cpp \ - rpc_wallet_tests.cpp -endif - -nodist_test_bitcoin_SOURCES = $(BUILT_SOURCES) - -CLEANFILES = *.gcda *.gcno $(BUILT_SOURCES) From 8b09ef7b6370800a1a9fd6f067abf1aaab5d6cfa Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 28 May 2014 13:41:35 -0400 Subject: [PATCH 0137/1288] build: add stub makefiles for easier subdir builds --- src/qt/Makefile | 9 +++++++++ src/qt/test/Makefile | 6 ++++++ src/test/Makefile | 6 ++++++ 3 files changed, 21 insertions(+) create mode 100644 src/qt/Makefile create mode 100644 src/qt/test/Makefile create mode 100644 src/test/Makefile diff --git a/src/qt/Makefile b/src/qt/Makefile new file mode 100644 index 0000000000..b9dcf0c599 --- /dev/null +++ b/src/qt/Makefile @@ -0,0 +1,9 @@ +.PHONY: FORCE +all: FORCE + $(MAKE) -C .. bitcoin_qt test_bitcoin_qt +clean: FORCE + $(MAKE) -C .. bitcoin_qt_clean test_bitcoin_qt_clean +check: FORCE + $(MAKE) -C .. test_bitcoin_qt_check +bitcoin-qt bitcoin-qt.exe: FORCE + $(MAKE) -C .. bitcoin_qt diff --git a/src/qt/test/Makefile b/src/qt/test/Makefile new file mode 100644 index 0000000000..a02f86b62a --- /dev/null +++ b/src/qt/test/Makefile @@ -0,0 +1,6 @@ +all: + $(MAKE) -C ../../ test_bitcoin_qt +clean: + $(MAKE) -C ../../ test_bitcoin_qt_clean +check: + $(MAKE) -C ../../ test_bitcoin_qt_check diff --git a/src/test/Makefile b/src/test/Makefile new file mode 100644 index 0000000000..87bf73fec9 --- /dev/null +++ b/src/test/Makefile @@ -0,0 +1,6 @@ +all: + $(MAKE) -C .. bitcoin_test +clean: + $(MAKE) -C .. bitcoin_test_clean +check: + $(MAKE) -C .. bitcoin_test_check From 6b9f0d5554b75fcc24cbce10e16872df3e103226 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 4 Jun 2014 17:13:03 -0400 Subject: [PATCH 0138/1288] build: nuke Makefile.include from orbit Rules and targets no longer need to be shared between subdirectories, so this is no longer needed. --- src/Makefile.am | 48 ++++++++++++++++++++----- src/Makefile.include | 74 --------------------------------------- src/Makefile.qt.include | 21 +++++++++++ src/Makefile.test.include | 16 +++++++++ 4 files changed, 76 insertions(+), 83 deletions(-) delete mode 100644 src/Makefile.include diff --git a/src/Makefile.am b/src/Makefile.am index e7d121b4d6..b3e713b9ad 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,27 @@ -include Makefile.include +AM_CPPFLAGS = $(INCLUDES) \ + -I$(top_builddir)/src/obj \ + $(BDB_CPPFLAGS) \ + $(BOOST_CPPFLAGS) $(BOOST_INCLUDES) +AM_CPPFLAGS += $(LEVELDB_CPPFLAGS) +AM_LDFLAGS = $(PTHREAD_CFLAGS) AM_CPPFLAGS += -I$(builddir) +if EMBEDDED_LEVELDB +LEVELDB_CPPFLAGS += -I$(top_srcdir)/src/leveldb/include +LEVELDB_CPPFLAGS += -I$(top_srcdir)/src/leveldb/helpers/memenv +LIBLEVELDB += $(top_builddir)/src/leveldb/libleveldb.a +LIBMEMENV += $(top_builddir)/src/leveldb/libmemenv.a + +# NOTE: This dependency is not strictly necessary, but without it make may try to build both in parallel, which breaks the LevelDB build system in a race +$(LIBLEVELDB): $(LIBMEMENV) + +$(LIBLEVELDB) $(LIBMEMENV): + @echo "Building LevelDB ..." && $(MAKE) -C $(@D) $(@F) CXX="$(CXX)" \ + CC="$(CC)" PLATFORM=$(TARGET_OS) AR="$(AR)" $(LEVELDB_TARGET_FLAGS) \ + OPT="$(CXXFLAGS) $(CPPFLAGS)" +endif + noinst_LIBRARIES = \ libbitcoin_server.a \ libbitcoin_common.a \ @@ -179,14 +199,6 @@ if TARGET_WINDOWS bitcoin_cli_SOURCES += bitcoin-cli-res.rc endif -# NOTE: This dependency is not strictly necessary, but without it make may try to build both in parallel, which breaks the LevelDB build system in a race -leveldb/libleveldb.a: leveldb/libmemenv.a - -leveldb/%.a: - @echo "Building LevelDB ..." && $(MAKE) -C $(@D) $(@F) CXX="$(CXX)" \ - CC="$(CC)" PLATFORM=$(TARGET_OS) AR="$(AR)" $(LEVELDB_TARGET_FLAGS) \ - OPT="$(CXXFLAGS) $(CPPFLAGS)" - CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno DISTCLEANFILES = obj/build.h @@ -197,6 +209,24 @@ clean-local: -$(MAKE) -C leveldb clean rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno +.rc.o: + @test -f $(WINDRES) && $(WINDRES) -i $< -o $@ || \ + echo error: could not build $@ + +.mm.o: + $(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS) -c -o $@ $< + +%.pb.cc %.pb.h: %.proto + test -f $(PROTOC) && $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $( $(abs_builddir)/$@.n && mv $(abs_builddir)/$@{.n,} - $(SED) -e '/^\*\*.*by:/d' $(abs_builddir)/$@ > $(abs_builddir)/$@.n && mv $(abs_builddir)/$@{.n,} - -%.moc: %.cpp - QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $< - $(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,} - $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} - -moc_%.cpp: %.h - QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $< - $(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,} - $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} - -%.qm: %.ts - @test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D) - @test -f $(LRELEASE) && QT_SELECT=$(QT_SELECT) $(LRELEASE) $(abs_srcdir)/$< -qm $(abs_builddir)/$@ || \ - echo error: could not build $(abs_builddir)/$@ - -%.pb.cc %.pb.h: %.proto - test -f $(PROTOC) && $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $( $@ - @echo "static unsigned const char $(*F)[] = {" >> $@ - @$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@ - @echo "};};" >> $@ - @echo "Generated $@" - -%.raw.h: %.raw - @$(MKDIR_P) $(@D) - @echo "namespace alert_tests{" > $@ - @echo "static unsigned const char $(*F)[] = {" >> $@ - @$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@ - @echo "};};" >> $@ - @echo "Generated $@" diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index dcb3f37f50..0cef2d2e6f 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -385,3 +385,24 @@ bitcoin_qt_clean: FORCE rm -f $(CLEAN_QT) $(qt_libbitcoinqt_a_OBJECTS) $(qt_bitcoin_qt_OBJECTS) qt/bitcoin-qt$(EXEEXT) $(LIBBITCOINQT) bitcoin_qt : qt/bitcoin-qt$(EXEEXT) + +ui_%.h: %.ui + @test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D) + @test -f $(UIC) && QT_SELECT=$(QT_SELECT) $(UIC) -o $(abs_builddir)/$@ $(abs_srcdir)/$< || echo error: could not build $(abs_builddir)/$@ + $(SED) -e '/^\*\*.*Created:/d' $(abs_builddir)/$@ > $(abs_builddir)/$@.n && mv $(abs_builddir)/$@{.n,} + $(SED) -e '/^\*\*.*by:/d' $(abs_builddir)/$@ > $(abs_builddir)/$@.n && mv $(abs_builddir)/$@{.n,} + +%.moc: %.cpp + QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $< + $(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,} + $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} + +moc_%.cpp: %.h + QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $< + $(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,} + $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} + +%.qm: %.ts + @test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D) + @test -f $(LRELEASE) && QT_SELECT=$(QT_SELECT) $(LRELEASE) $(abs_srcdir)/$< -qm $(abs_builddir)/$@ || \ + echo error: could not build $(abs_builddir)/$@ diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 4a70b0f9e9..14288ee218 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -85,3 +85,19 @@ bitcoin_test_check: $(TEST_BINARY) FORCE bitcoin_test_clean : FORCE rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY) + +%.json.h: %.json + @$(MKDIR_P) $(@D) + @echo "namespace json_tests{" > $@ + @echo "static unsigned const char $(*F)[] = {" >> $@ + @$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@ + @echo "};};" >> $@ + @echo "Generated $@" + +%.raw.h: %.raw + @$(MKDIR_P) $(@D) + @echo "namespace alert_tests{" > $@ + @echo "static unsigned const char $(*F)[] = {" >> $@ + @$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@ + @echo "};};" >> $@ + @echo "Generated $@" From 70c71c50ce552c0358679653c04d7cc72a40222c Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 5 Jun 2014 14:17:50 -0400 Subject: [PATCH 0139/1288] build: Tidy up file generation output - Some file generation was still noisy, silence it. - AM_V_GEN is used rather than @ so that 'make V=1' works as intended - Cut down on file copies and moves when using sed, use pipes instead - Avoid the use of top_ and abs_ dirs where possible --- src/Makefile.am | 10 +++++----- src/Makefile.qt.include | 34 +++++++++++++++------------------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index b3e713b9ad..ce12ddcdbd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -210,16 +210,16 @@ clean-local: rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno .rc.o: - @test -f $(WINDRES) && $(WINDRES) -i $< -o $@ || \ - echo error: could not build $@ + @test -f $(WINDRES) + $(AM_V_GEN) $(WINDRES) -i $< -o $@ .mm.o: - $(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS) -c -o $@ $< %.pb.cc %.pb.h: %.proto - test -f $(PROTOC) && $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $( $@.n && mv $@{.n,} - $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} + @test -f $(RCC) + $(AM_V_GEN) cd $(srcdir); QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin $< | \ + $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $(abs_builddir)/$@ CLEAN_QT = $(nodist_qt_libbitcoinqt_a_SOURCES) $(QT_QM) $(QT_FORMS_H) qt/*.gcda qt/*.gcno @@ -387,22 +386,19 @@ bitcoin_qt_clean: FORCE bitcoin_qt : qt/bitcoin-qt$(EXEEXT) ui_%.h: %.ui - @test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D) - @test -f $(UIC) && QT_SELECT=$(QT_SELECT) $(UIC) -o $(abs_builddir)/$@ $(abs_srcdir)/$< || echo error: could not build $(abs_builddir)/$@ - $(SED) -e '/^\*\*.*Created:/d' $(abs_builddir)/$@ > $(abs_builddir)/$@.n && mv $(abs_builddir)/$@{.n,} - $(SED) -e '/^\*\*.*by:/d' $(abs_builddir)/$@ > $(abs_builddir)/$@.n && mv $(abs_builddir)/$@{.n,} + @test -f $(UIC) + @$(MKDIR_P) $(@D) + $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(UIC) -o $@ $< || (echo "Error creating $@"; false) %.moc: %.cpp - QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $< - $(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,} - $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} + $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) $< | \ + $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@ moc_%.cpp: %.h - QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $< - $(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,} - $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} + $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) $< | \ + $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@ %.qm: %.ts - @test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D) - @test -f $(LRELEASE) && QT_SELECT=$(QT_SELECT) $(LRELEASE) $(abs_srcdir)/$< -qm $(abs_builddir)/$@ || \ - echo error: could not build $(abs_builddir)/$@ + @test -f $(LRELEASE) + @$(MKDIR_P) $(@D) + $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LRELEASE) -silent $< -qm $@ From 56c157d5e087e3976ae05cad2dc08a1fcd9a2400 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 5 Jun 2014 14:22:54 -0400 Subject: [PATCH 0140/1288] build: avoid the use of top_ and abs_ dir paths Using them has the side effect of confusing the dependency-tracking logic. --- src/Makefile.am | 14 +++++++------- src/Makefile.qt.include | 10 +++++----- src/Makefile.qttest.include | 6 +++--- src/Makefile.test.include | 2 +- src/m4/bitcoin_qt.m4 | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index ce12ddcdbd..cb1c88883b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = $(INCLUDES) \ - -I$(top_builddir)/src/obj \ + -I$(builddir)/obj \ $(BDB_CPPFLAGS) \ $(BOOST_CPPFLAGS) $(BOOST_INCLUDES) AM_CPPFLAGS += $(LEVELDB_CPPFLAGS) @@ -8,10 +8,10 @@ AM_LDFLAGS = $(PTHREAD_CFLAGS) AM_CPPFLAGS += -I$(builddir) if EMBEDDED_LEVELDB -LEVELDB_CPPFLAGS += -I$(top_srcdir)/src/leveldb/include -LEVELDB_CPPFLAGS += -I$(top_srcdir)/src/leveldb/helpers/memenv -LIBLEVELDB += $(top_builddir)/src/leveldb/libleveldb.a -LIBMEMENV += $(top_builddir)/src/leveldb/libmemenv.a +LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include +LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/helpers/memenv +LIBLEVELDB += $(builddir)/leveldb/libleveldb.a +LIBMEMENV += $(builddir)/leveldb/libmemenv.a # NOTE: This dependency is not strictly necessary, but without it make may try to build both in parallel, which breaks the LevelDB build system in a race $(LIBLEVELDB): $(LIBMEMENV) @@ -101,7 +101,7 @@ JSON_H = \ json/json_spirit_writer_template.h obj/build.h: FORCE - @$(MKDIR_P) $(abs_top_builddir)/src/obj + @$(MKDIR_P) $(builddir)/obj @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \ $(abs_top_srcdir) version.o: obj/build.h @@ -164,7 +164,7 @@ libbitcoin_cli_a_SOURCES = \ rpcclient.cpp \ $(BITCOIN_CORE_H) -nodist_libbitcoin_common_a_SOURCES = $(top_srcdir)/src/obj/build.h +nodist_libbitcoin_common_a_SOURCES = $(srcdir)/obj/build.h # # bitcoind binary # diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index a25699e392..f434118abb 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -1,6 +1,6 @@ -AM_CPPFLAGS += -I$(top_srcdir)/src \ - -I$(top_builddir)/src/qt \ - -I$(top_builddir)/src/qt/forms \ +AM_CPPFLAGS += -I$(srcdir) \ + -I$(builddir)/qt \ + -I$(builddir)/qt/forms \ $(PROTOBUF_CFLAGS) \ $(QR_CFLAGS) bin_PROGRAMS += qt/bitcoin-qt @@ -320,7 +320,7 @@ RES_MOVIES = $(wildcard qt/res/movies/spinner-*.png) BITCOIN_RC = qt/res/bitcoin-qt-res.rc qt_libbitcoinqt_a_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ - -I$(top_srcdir)/src/qt/forms $(QT_DBUS_INCLUDES) + -I$(srcdir)/qt/forms $(QT_DBUS_INCLUDES) qt_libbitcoinqt_a_SOURCES = $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(QT_FORMS_UI) \ $(QT_QRC) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) @@ -342,7 +342,7 @@ $(QT_MOC_CPP): $(PROTOBUF_H) # bitcoin-qt binary # qt_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ - -I$(top_srcdir)/src/qt/forms + -I$(srcdir)/qt/forms qt_bitcoin_qt_SOURCES = qt/bitcoin.cpp if TARGET_DARWIN qt_bitcoin_qt_SOURCES += $(BITCOIN_MM) diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 0d08a636e9..09e61cf57c 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -1,6 +1,6 @@ -AM_CPPFLAGS += -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/qt \ - -I$(top_builddir)/src/qt \ +AM_CPPFLAGS += -I$(srcdir) \ + -I$(srcdir)/qt \ + -I$(builddir)/qt \ $(PROTOBUF_CFLAGS) \ $(QR_CFLAGS) bin_PROGRAMS += qt/test/test_bitcoin-qt diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 14288ee218..1e4bd4ca8c 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -1,4 +1,4 @@ -AM_CPPFLAGS += -I$(top_builddir)/src/test/ +AM_CPPFLAGS += -I$(builddir)/test/ TESTS += test/test_bitcoin bin_PROGRAMS += test/test_bitcoin diff --git a/src/m4/bitcoin_qt.m4 b/src/m4/bitcoin_qt.m4 index e71ecd7172..244b03a5c2 100644 --- a/src/m4/bitcoin_qt.m4 +++ b/src/m4/bitcoin_qt.m4 @@ -100,7 +100,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ BITCOIN_QT_PATH_PROGS([LRELEASE], [lrelease-qt${bitcoin_qt_got_major_vers} lrelease${bitcoin_qt_got_major_vers} lrelease], $qt_bin_path) BITCOIN_QT_PATH_PROGS([LUPDATE], [lupdate-qt${bitcoin_qt_got_major_vers} lupdate${bitcoin_qt_got_major_vers} lupdate],$qt_bin_path, yes) - MOC_DEFS='-DHAVE_CONFIG_H -I$(top_srcdir)/src' + MOC_DEFS='-DHAVE_CONFIG_H -I$(srcdir)' case $host in *darwin*) BITCOIN_QT_CHECK([ From f4d81129f0858685c33e79f74084f2931b8c21b4 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 5 Jun 2014 15:24:48 -0400 Subject: [PATCH 0141/1288] build: quit abusing AM_CPPFLAGS Now that the build is non-recursive, adding to AM_CPPFLAGS means adding to _all_ cppflags. Logical groups of includes have been added instead, and are used individually by various targets. --- src/Makefile.am | 16 +++++++++------- src/Makefile.qt.include | 18 +++++++++--------- src/Makefile.qttest.include | 8 ++------ src/Makefile.test.include | 4 +--- 4 files changed, 21 insertions(+), 25 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index cb1c88883b..58a50adec6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,11 +1,6 @@ -AM_CPPFLAGS = $(INCLUDES) \ - -I$(builddir)/obj \ - $(BDB_CPPFLAGS) \ - $(BOOST_CPPFLAGS) $(BOOST_INCLUDES) -AM_CPPFLAGS += $(LEVELDB_CPPFLAGS) +AM_CPPFLAGS = $(INCLUDES) AM_LDFLAGS = $(PTHREAD_CFLAGS) -AM_CPPFLAGS += -I$(builddir) if EMBEDDED_LEVELDB LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include @@ -22,11 +17,14 @@ $(LIBLEVELDB) $(LIBMEMENV): OPT="$(CXXFLAGS) $(CPPFLAGS)" endif +BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) + noinst_LIBRARIES = \ libbitcoin_server.a \ libbitcoin_common.a \ libbitcoin_cli.a if ENABLE_WALLET +BITCOIN_INCLUDES += $(BDB_CPPFLAGS) noinst_LIBRARIES += libbitcoin_wallet.a endif @@ -106,6 +104,7 @@ obj/build.h: FORCE $(abs_top_srcdir) version.o: obj/build.h +libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_server_a_SOURCES = \ addrman.cpp \ alert.cpp \ @@ -130,6 +129,7 @@ libbitcoin_server_a_SOURCES = \ $(JSON_H) \ $(BITCOIN_CORE_H) +libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_wallet_a_SOURCES = \ db.cpp \ crypter.cpp \ @@ -139,6 +139,7 @@ libbitcoin_wallet_a_SOURCES = \ walletdb.cpp \ $(BITCOIN_CORE_H) +libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_common_a_SOURCES = \ base58.cpp \ allocators.cpp \ @@ -184,8 +185,8 @@ if TARGET_WINDOWS bitcoind_SOURCES += bitcoind-res.rc endif -AM_CPPFLAGS += $(BDB_CPPFLAGS) bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) +bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES) # bitcoin-cli binary # bitcoin_cli_LDADD = \ @@ -193,6 +194,7 @@ bitcoin_cli_LDADD = \ libbitcoin_common.a \ $(BOOST_LIBS) bitcoin_cli_SOURCES = bitcoin-cli.cpp +bitcoin_cli_CPPFLAGS = $(BITCOIN_INCLUDES) # if TARGET_WINDOWS diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index f434118abb..749b976c44 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -1,8 +1,3 @@ -AM_CPPFLAGS += -I$(srcdir) \ - -I$(builddir)/qt \ - -I$(builddir)/qt/forms \ - $(PROTOBUF_CFLAGS) \ - $(QR_CFLAGS) bin_PROGRAMS += qt/bitcoin-qt noinst_LIBRARIES += qt/libbitcoinqt.a @@ -319,8 +314,12 @@ RES_MOVIES = $(wildcard qt/res/movies/spinner-*.png) BITCOIN_RC = qt/res/bitcoin-qt-res.rc -qt_libbitcoinqt_a_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ - -I$(srcdir)/qt/forms $(QT_DBUS_INCLUDES) +BITCOIN_QT_INCLUDES = -I$(builddir)/qt -I$(srcdir)/qt -I$(srcdir)/qt/forms \ + -I$(builddir)/qt/forms + +qt_libbitcoinqt_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \ + $(QT_INCLUDES) $(QT_DBUS_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS) + qt_libbitcoinqt_a_SOURCES = $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(QT_FORMS_UI) \ $(QT_QRC) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) @@ -341,8 +340,9 @@ $(QT_MOC): $(PROTOBUF_H) $(QT_MOC_CPP): $(PROTOBUF_H) # bitcoin-qt binary # -qt_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ - -I$(srcdir)/qt/forms +qt_bitcoin_qt_CPPFLAGS = $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \ + $(QT_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS) + qt_bitcoin_qt_SOURCES = qt/bitcoin.cpp if TARGET_DARWIN qt_bitcoin_qt_SOURCES += $(BITCOIN_MM) diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 09e61cf57c..e0b49d0240 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -1,8 +1,3 @@ -AM_CPPFLAGS += -I$(srcdir) \ - -I$(srcdir)/qt \ - -I$(builddir)/qt \ - $(PROTOBUF_CFLAGS) \ - $(QR_CFLAGS) bin_PROGRAMS += qt/test/test_bitcoin-qt TESTS += qt/test/test_bitcoin-qt @@ -17,7 +12,8 @@ TEST_QT_H = \ qt/test/paymentrequestdata.h \ qt/test/paymentservertests.h -qt_test_test_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) $(QT_TEST_INCLUDES) +qt_test_test_bitcoin_qt_CPPFLAGS = $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \ + $(QT_INCLUDES) $(QT_TEST_INCLUDES) qt_test_test_bitcoin_qt_SOURCES = \ qt/test/test_main.cpp \ diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 1e4bd4ca8c..988830260c 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -1,5 +1,3 @@ -AM_CPPFLAGS += -I$(builddir)/test/ - TESTS += test/test_bitcoin bin_PROGRAMS += test/test_bitcoin TEST_SRCDIR = test @@ -62,7 +60,7 @@ BITCOIN_TESTS += \ endif test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES) -test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(TESTDEFS) +test_test_bitcoin_CPPFLAGS = $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \ $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) if ENABLE_WALLET From efe6888407186b8a468f357fa7084c0a8c3de503 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 5 Jun 2014 15:51:05 -0400 Subject: [PATCH 0142/1288] build: fix version dependency --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 58a50adec6..3016be47b9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -102,7 +102,7 @@ obj/build.h: FORCE @$(MKDIR_P) $(builddir)/obj @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \ $(abs_top_srcdir) -version.o: obj/build.h +libbitcoin_common_a-version.$(OBJEXT): obj/build.h libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_server_a_SOURCES = \ From b917555b04b501efe22990eedadc59ae8baa2519 Mon Sep 17 00:00:00 2001 From: Ashley Holman Date: Fri, 6 Jun 2014 02:24:59 -0500 Subject: [PATCH 0143/1288] qt: PeerTableModel: Fix potential deadlock. #4296 --- src/qt/peertablemodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp index fba9d84e77..859d82f40c 100644 --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -49,8 +49,8 @@ public: /** Pull a full list of peers from vNodes into our cache */ void refreshPeers() { - TRY_LOCK(cs_vNodes, lockNodes); { + TRY_LOCK(cs_vNodes, lockNodes); if (!lockNodes) { // skip the refresh if we can't immediately get the lock @@ -70,8 +70,8 @@ public: } // if we can, retrieve the CNodeStateStats for each node. - TRY_LOCK(cs_main, lockMain); { + TRY_LOCK(cs_main, lockMain); if (lockMain) { BOOST_FOREACH(CNodeCombinedStats &stats, cachedNodeStats) From c6cb21d17ab8097b6a425d37e48c955fbb0e9f0c Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Thu, 10 Apr 2014 14:14:18 -0400 Subject: [PATCH 0144/1288] Type-safe CFeeRate class Use CFeeRate instead of an int64_t for quantities that are fee-per-size. Helps prevent unit-conversion mismatches between the wallet, relaying, and mining code. --- src/core.cpp | 19 ++++++++++++++++ src/core.h | 37 +++++++++++++++++++++++++------ src/init.cpp | 14 ++++++------ src/main.cpp | 30 +++++++++----------------- src/miner.cpp | 42 +++++++++++++++++++----------------- src/qt/coincontroldialog.cpp | 29 ++++++------------------- src/qt/guiutil.cpp | 2 +- src/qt/optionsdialog.cpp | 4 ++-- src/qt/optionsmodel.cpp | 21 ++++++++++-------- src/qt/paymentserver.cpp | 2 +- src/qt/walletmodel.cpp | 6 ------ src/rpcmisc.cpp | 4 ++-- src/rpcnet.cpp | 2 +- src/rpcwallet.cpp | 2 +- src/wallet.cpp | 22 ++++++------------- src/wallet.h | 2 +- 16 files changed, 123 insertions(+), 115 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index aadcb44b98..6039986e6c 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -72,6 +72,25 @@ void CTxOut::print() const LogPrintf("%s\n", ToString()); } +CFeeRate::CFeeRate(int64_t nFeePaid, size_t nSize) +{ + if (nSize > 0) + nSatoshisPerK = nFeePaid*1000/nSize; + else + nSatoshisPerK = 0; +} + +int64_t CFeeRate::GetFee(size_t nSize) +{ + return nSatoshisPerK*nSize / 1000; +} + +std::string CFeeRate::ToString() const +{ + std::string result = FormatMoney(nSatoshisPerK) + " BTC/kB"; + return result; +} + uint256 CTransaction::GetHash() const { return SerializeHash(*this); diff --git a/src/core.h b/src/core.h index ba7f691119..9fccffc4b2 100644 --- a/src/core.h +++ b/src/core.h @@ -112,6 +112,28 @@ public: +/** Type-safe wrapper class to for fee rates + * (how much to pay based on transaction size) + */ +class CFeeRate +{ +private: + int64_t nSatoshisPerK; // unit is satoshis-per-1,000-bytes +public: + explicit CFeeRate(int64_t _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) { } + CFeeRate(int64_t nFeePaid, size_t nSize); + CFeeRate(const CFeeRate& other) { nSatoshisPerK = other.nSatoshisPerK; } + + int64_t GetFee(size_t size); // unit returned is satoshis + int64_t GetFeePerK() { return GetFee(1000); } // satoshis-per-1000-bytes + + friend bool operator<(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK < b.nSatoshisPerK; } + friend bool operator>(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK > b.nSatoshisPerK; } + friend bool operator==(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK == b.nSatoshisPerK; } + + std::string ToString() const; +}; + /** An output of a transaction. It contains the public key that the next input * must be able to sign with to claim it. @@ -148,17 +170,18 @@ public: uint256 GetHash() const; - bool IsDust(int64_t nMinRelayTxFee) const + bool IsDust(CFeeRate minRelayTxFee) const { - // "Dust" is defined in terms of CTransaction::nMinRelayTxFee, + // "Dust" is defined in terms of CTransaction::minRelayTxFee, // which has units satoshis-per-kilobyte. // If you'd pay more than 1/3 in fees // to spend something, then we consider it dust. // A typical txout is 34 bytes big, and will - // need a CTxIn of at least 148 bytes to spend, + // need a CTxIn of at least 148 bytes to spend: // so dust is a txout less than 546 satoshis - // with default nMinRelayTxFee. - return ((nValue*1000)/(3*((int)GetSerializeSize(SER_DISK,0)+148)) < nMinRelayTxFee); + // with default minRelayTxFee. + size_t nSize = GetSerializeSize(SER_DISK,0)+148u; + return (nValue < 3*minRelayTxFee.GetFee(nSize)); } friend bool operator==(const CTxOut& a, const CTxOut& b) @@ -183,8 +206,8 @@ public: class CTransaction { public: - static int64_t nMinTxFee; - static int64_t nMinRelayTxFee; + static CFeeRate minTxFee; + static CFeeRate minRelayTxFee; static const int CURRENT_VERSION=1; int nVersion; std::vector vin; diff --git a/src/init.cpp b/src/init.cpp index d924bd293b..1aad679b3b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -281,8 +281,8 @@ std::string HelpMessage(HelpMessageMode hmm) strUsage += " -limitfreerelay= " + _("Continuously rate-limit free transactions to *1000 bytes per minute (default:15)") + "\n"; strUsage += " -maxsigcachesize= " + _("Limit size of signature cache to entries (default: 50000)") + "\n"; } - strUsage += " -mintxfee= " + _("Fees smaller than this are considered zero fee (for transaction creation) (default:") + " " + FormatMoney(CTransaction::nMinTxFee) + ")" + "\n"; - strUsage += " -minrelaytxfee= " + _("Fees smaller than this are considered zero fee (for relaying) (default:") + " " + FormatMoney(CTransaction::nMinRelayTxFee) + ")" + "\n"; + strUsage += " -mintxfee= " + _("Fees smaller than this are considered zero fee (for transaction creation) (default:") + " " + FormatMoney(CTransaction::minTxFee.GetFeePerK()) + ")" + "\n"; + strUsage += " -minrelaytxfee= " + _("Fees smaller than this are considered zero fee (for relaying) (default:") + " " + FormatMoney(CTransaction::minRelayTxFee.GetFeePerK()) + ")" + "\n"; strUsage += " -printtoconsole " + _("Send trace/debug info to console instead of debug.log file") + "\n"; if (GetBoolArg("-help-debug", false)) { @@ -560,7 +560,7 @@ bool AppInit2(boost::thread_group& threadGroup) { int64_t n = 0; if (ParseMoney(mapArgs["-mintxfee"], n) && n > 0) - CTransaction::nMinTxFee = n; + CTransaction::minTxFee = CFeeRate(n); else return InitError(strprintf(_("Invalid amount for -mintxfee=: '%s'"), mapArgs["-mintxfee"])); } @@ -568,7 +568,7 @@ bool AppInit2(boost::thread_group& threadGroup) { int64_t n = 0; if (ParseMoney(mapArgs["-minrelaytxfee"], n) && n > 0) - CTransaction::nMinRelayTxFee = n; + CTransaction::minRelayTxFee = CFeeRate(n); else return InitError(strprintf(_("Invalid amount for -minrelaytxfee=: '%s'"), mapArgs["-minrelaytxfee"])); } @@ -576,10 +576,12 @@ bool AppInit2(boost::thread_group& threadGroup) #ifdef ENABLE_WALLET if (mapArgs.count("-paytxfee")) { - if (!ParseMoney(mapArgs["-paytxfee"], nTransactionFee)) + int64_t nFeePerK = 0; + if (!ParseMoney(mapArgs["-paytxfee"], nFeePerK)) return InitError(strprintf(_("Invalid amount for -paytxfee=: '%s'"), mapArgs["-paytxfee"])); - if (nTransactionFee > nHighTransactionFeeWarning) + if (nFeePerK > nHighTransactionFeeWarning) InitWarning(_("Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.")); + payTxFee = CFeeRate(nFeePerK, 1000); } bSpendZeroConfChange = GetArg("-spendzeroconfchange", true); diff --git a/src/main.cpp b/src/main.cpp index 8e63e4213f..9d6c01d64e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -50,9 +50,9 @@ bool fTxIndex = false; unsigned int nCoinCacheSize = 5000; /** Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) */ -int64_t CTransaction::nMinTxFee = 10000; // Override with -mintxfee +CFeeRate CTransaction::minTxFee = CFeeRate(10000); // Override with -mintxfee /** Fees smaller than this (in satoshi) are considered zero fee (for relaying and mining) */ -int64_t CTransaction::nMinRelayTxFee = 1000; +CFeeRate CTransaction::minRelayTxFee = CFeeRate(1000); struct COrphanBlock { uint256 hashBlock; @@ -543,7 +543,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) } if (whichType == TX_NULL_DATA) nDataOut++; - else if (txout.IsDust(CTransaction::nMinRelayTxFee)) { + else if (txout.IsDust(CTransaction::minRelayTxFee)) { reason = "dust"; return false; } @@ -783,10 +783,10 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state) int64_t GetMinFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree, enum GetMinFee_mode mode) { - // Base fee is either nMinTxFee or nMinRelayTxFee - int64_t nBaseFee = (mode == GMF_RELAY) ? tx.nMinRelayTxFee : tx.nMinTxFee; + // Base fee is either minTxFee or minRelayTxFee + CFeeRate baseFeeRate = (mode == GMF_RELAY) ? tx.minRelayTxFee : tx.minTxFee; - int64_t nMinFee = (1 + (int64_t)nBytes / 1000) * nBaseFee; + int64_t nMinFee = baseFeeRate.GetFee(nBytes); if (fAllowFree) { @@ -800,16 +800,6 @@ int64_t GetMinFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree, nMinFee = 0; } - // This code can be removed after enough miners have upgraded to version 0.9. - // Until then, be safe when sending and require a fee if any output - // is less than CENT: - if (nMinFee < nBaseFee && mode == GMF_SEND) - { - BOOST_FOREACH(const CTxOut& txout, tx.vout) - if (txout.nValue < CENT) - nMinFee = nBaseFee; - } - if (!MoneyRange(nMinFee)) nMinFee = MAX_MONEY; return nMinFee; @@ -916,10 +906,10 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa hash.ToString(), nFees, txMinFee), REJECT_INSUFFICIENTFEE, "insufficient fee"); - // Continuously rate-limit free transactions + // Continuously rate-limit free (really, very-low-fee)transactions // This mitigates 'penny-flooding' -- sending thousands of free transactions just to // be annoying or make others' transactions take longer to confirm. - if (fLimitFree && nFees < CTransaction::nMinRelayTxFee) + if (fLimitFree && nFees < CTransaction::minRelayTxFee.GetFee(nSize)) { static CCriticalSection csFreeLimiter; static double dFreeCount; @@ -940,10 +930,10 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa dFreeCount += nSize; } - if (fRejectInsaneFee && nFees > CTransaction::nMinRelayTxFee * 10000) + if (fRejectInsaneFee && nFees > CTransaction::minRelayTxFee.GetFee(nSize) * 10000) return error("AcceptToMemoryPool: : insane fees %s, %d > %d", hash.ToString(), - nFees, CTransaction::nMinRelayTxFee * 10000); + nFees, CTransaction::minRelayTxFee.GetFee(nSize) * 10000); // Check against previous transactions // This is done last to help prevent CPU exhaustion denial-of-service attacks. diff --git a/src/miner.cpp b/src/miner.cpp index 94fc8e3888..4e131c088b 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -52,25 +52,30 @@ void SHA256Transform(void* pstate, void* pinput, const void* pinit) ((uint32_t*)pstate)[i] = ctx.h[i]; } -// Some explaining would be appreciated +// +// Unconfirmed transactions in the memory pool often depend on other +// transactions in the memory pool. When we select transactions from the +// pool, we select by highest priority or fee rate, so we might consider +// transactions that depend on transactions that aren't yet in the block. +// The COrphan class keeps track of these 'temporary orphans' while +// CreateBlock is figuring out which transactions to include. +// class COrphan { public: const CTransaction* ptx; set setDependsOn; double dPriority; - double dFeePerKb; + CFeeRate feeRate; - COrphan(const CTransaction* ptxIn) + COrphan(const CTransaction* ptxIn) : ptx(ptxIn), feeRate(0), dPriority(0) { - ptx = ptxIn; - dPriority = dFeePerKb = 0; } void print() const { - LogPrintf("COrphan(hash=%s, dPriority=%.1f, dFeePerKb=%.1f)\n", - ptx->GetHash().ToString(), dPriority, dFeePerKb); + LogPrintf("COrphan(hash=%s, dPriority=%.1f, fee=%s)\n", + ptx->GetHash().ToString(), dPriority, feeRate.ToString()); BOOST_FOREACH(uint256 hash, setDependsOn) LogPrintf(" setDependsOn %s\n", hash.ToString()); } @@ -80,8 +85,8 @@ public: uint64_t nLastBlockTx = 0; uint64_t nLastBlockSize = 0; -// We want to sort transactions by priority and fee, so: -typedef boost::tuple TxPriority; +// We want to sort transactions by priority and fee rate, so: +typedef boost::tuple TxPriority; class TxPriorityCompare { bool byFee; @@ -210,18 +215,15 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION); dPriority = tx.ComputePriority(dPriority, nTxSize); - // This is a more accurate fee-per-kilobyte than is used by the client code, because the - // client code rounds up the size to the nearest 1K. That's good, because it gives an - // incentive to create smaller transactions. - double dFeePerKb = double(nTotalIn-tx.GetValueOut()) / (double(nTxSize)/1000.0); + CFeeRate feeRate(nTotalIn-tx.GetValueOut(), nTxSize); if (porphan) { porphan->dPriority = dPriority; - porphan->dFeePerKb = dFeePerKb; + porphan->feeRate = feeRate; } else - vecPriority.push_back(TxPriority(dPriority, dFeePerKb, &mi->second.GetTx())); + vecPriority.push_back(TxPriority(dPriority, feeRate, &mi->second.GetTx())); } // Collect transactions into block @@ -237,7 +239,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) { // Take highest priority transaction off the priority queue: double dPriority = vecPriority.front().get<0>(); - double dFeePerKb = vecPriority.front().get<1>(); + CFeeRate feeRate = vecPriority.front().get<1>(); const CTransaction& tx = *(vecPriority.front().get<2>()); std::pop_heap(vecPriority.begin(), vecPriority.end(), comparer); @@ -254,7 +256,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) continue; // Skip free transactions if we're past the minimum block size: - if (fSortedByFee && (dFeePerKb < CTransaction::nMinRelayTxFee) && (nBlockSize + nTxSize >= nBlockMinSize)) + if (fSortedByFee && (feeRate < CTransaction::minRelayTxFee) && (nBlockSize + nTxSize >= nBlockMinSize)) continue; // Prioritize by fee once past the priority size or we run out of high-priority @@ -298,8 +300,8 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) if (fPrintPriority) { - LogPrintf("priority %.1f feeperkb %.1f txid %s\n", - dPriority, dFeePerKb, tx.GetHash().ToString()); + LogPrintf("priority %.1f fee %s txid %s\n", + dPriority, feeRate.ToString(), tx.GetHash().ToString()); } // Add transactions that depend on this one to the priority queue @@ -312,7 +314,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) porphan->setDependsOn.erase(hash); if (porphan->setDependsOn.empty()) { - vecPriority.push_back(TxPriority(porphan->dPriority, porphan->dFeePerKb, porphan->ptx)); + vecPriority.push_back(TxPriority(porphan->dPriority, porphan->feeRate, porphan->ptx)); std::push_heap(vecPriority.begin(), vecPriority.end(), comparer); } } diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index dc9d2afe27..e27f1bff97 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -453,7 +453,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) CTxOut txout(amount, (CScript)vector(24, 0)); txDummy.vout.push_back(txout); - if (txout.IsDust(CTransaction::nMinRelayTxFee)) + if (txout.IsDust(CTransaction::minRelayTxFee)) fDust = true; } } @@ -525,7 +525,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) sPriorityLabel = CoinControlDialog::getPriorityLabel(dPriority); // Fee - int64_t nFee = nTransactionFee * (1 + (int64_t)nBytes / 1000); + int64_t nFee = payTxFee.GetFee(nBytes); // Min Fee int64_t nMinFee = GetMinFee(txDummy, nBytes, AllowFree(dPriority), GMF_SEND); @@ -536,26 +536,11 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) { nChange = nAmount - nPayFee - nPayAmount; - // if sub-cent change is required, the fee must be raised to at least CTransaction::nMinTxFee - if (nPayFee < CTransaction::nMinTxFee && nChange > 0 && nChange < CENT) - { - if (nChange < CTransaction::nMinTxFee) // change < 0.0001 => simply move all change to fees - { - nPayFee += nChange; - nChange = 0; - } - else - { - nChange = nChange + nPayFee - CTransaction::nMinTxFee; - nPayFee = CTransaction::nMinTxFee; - } - } - // Never create dust outputs; if we would, just add the dust to the fee. if (nChange > 0 && nChange < CENT) { CTxOut txout(nChange, (CScript)vector(24, 0)); - if (txout.IsDust(CTransaction::nMinRelayTxFee)) + if (txout.IsDust(CTransaction::minRelayTxFee)) { nPayFee += nChange; nChange = 0; @@ -610,19 +595,19 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) // tool tips QString toolTip1 = tr("This label turns red, if the transaction size is greater than 1000 bytes.") + "

"; - toolTip1 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::nMinTxFee)) + "

"; + toolTip1 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK())) + "

"; toolTip1 += tr("Can vary +/- 1 byte per input."); QString toolTip2 = tr("Transactions with higher priority are more likely to get included into a block.") + "

"; toolTip2 += tr("This label turns red, if the priority is smaller than \"medium\".") + "

"; - toolTip2 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::nMinTxFee)); + toolTip2 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK())); QString toolTip3 = tr("This label turns red, if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CENT)) + "

"; - toolTip3 += tr("This means a fee of at least %1 is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::nMinTxFee)) + "

"; + toolTip3 += tr("This means a fee of at least %1 is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK())) + "

"; toolTip3 += tr("Amounts below 0.546 times the minimum relay fee are shown as dust."); QString toolTip4 = tr("This label turns red, if the change is smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CENT)) + "

"; - toolTip4 += tr("This means a fee of at least %1 is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::nMinTxFee)); + toolTip4 += tr("This means a fee of at least %1 is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK())); l5->setToolTip(toolTip1); l6->setToolTip(toolTip2); diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 1922d228c5..4fe98251d9 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -210,7 +210,7 @@ bool isDust(const QString& address, qint64 amount) CTxDestination dest = CBitcoinAddress(address.toStdString()).Get(); CScript script; script.SetDestination(dest); CTxOut txOut(amount, script); - return txOut.IsDust(CTransaction::nMinRelayTxFee); + return txOut.IsDust(CTransaction::minRelayTxFee); } QString HtmlEscape(const QString& str, bool fMultiLine) diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 96464d2cc0..1cbf5f8810 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -14,7 +14,7 @@ #include "monitoreddatamapper.h" #include "optionsmodel.h" -#include "main.h" // for CTransaction::nMinTxFee and MAX_SCRIPTCHECK_THREADS +#include "main.h" // for CTransaction::minTxFee and MAX_SCRIPTCHECK_THREADS #include "netbase.h" #include "txdb.h" // for -dbcache defaults @@ -101,7 +101,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) : #endif ui->unit->setModel(new BitcoinUnits(this)); - ui->transactionFee->setSingleStep(CTransaction::nMinTxFee); + ui->transactionFee->setSingleStep(CTransaction::minTxFee.GetFeePerK()); /* Widget-to-option mapper */ mapper = new MonitoredDataMapper(this); diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 051098315d..f3a5f37bb3 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -94,7 +94,7 @@ void OptionsModel::Init() #ifdef ENABLE_WALLET if (!settings.contains("nTransactionFee")) settings.setValue("nTransactionFee", (qint64)DEFAULT_TRANSACTION_FEE); - nTransactionFee = settings.value("nTransactionFee").toLongLong(); // if -paytxfee is set, this will be overridden later in init.cpp + payTxFee = CFeeRate(settings.value("nTransactionFee").toLongLong()); // if -paytxfee is set, this will be overridden later in init.cpp if (mapArgs.count("-paytxfee")) addOverriddenOption("-paytxfee"); @@ -187,15 +187,16 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const return settings.value("nSocksVersion", 5); #ifdef ENABLE_WALLET - case Fee: - // Attention: Init() is called before nTransactionFee is set in AppInit2()! + case Fee: { + // Attention: Init() is called before payTxFee is set in AppInit2()! // To ensure we can change the fee on-the-fly update our QSetting when // opening OptionsDialog, which queries Fee via the mapper. - if (nTransactionFee != settings.value("nTransactionFee").toLongLong()) - settings.setValue("nTransactionFee", (qint64)nTransactionFee); - // Todo: Consider to revert back to use just nTransactionFee here, if we don't want + if (!(payTxFee == CFeeRate(settings.value("nTransactionFee").toLongLong(), 1000))) + settings.setValue("nTransactionFee", (qint64)payTxFee.GetFeePerK()); + // Todo: Consider to revert back to use just payTxFee here, if we don't want // -paytxfee to update our QSettings! return settings.value("nTransactionFee"); + } case SpendZeroConfChange: return settings.value("bSpendZeroConfChange"); #endif @@ -284,12 +285,14 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in } break; #ifdef ENABLE_WALLET - case Fee: // core option - can be changed on-the-fly + case Fee: { // core option - can be changed on-the-fly // Todo: Add is valid check and warn via message, if not - nTransactionFee = value.toLongLong(); - settings.setValue("nTransactionFee", (qint64)nTransactionFee); + qint64 nTransactionFee = value.toLongLong(); + payTxFee = CFeeRate(nTransactionFee, 1000); + settings.setValue("nTransactionFee", nTransactionFee); emit transactionFeeChanged(nTransactionFee); break; + } case SpendZeroConfChange: if (settings.value("bSpendZeroConfChange") != value) { settings.setValue("bSpendZeroConfChange", value); diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 4c45585685..6165731d22 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -551,7 +551,7 @@ bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoins // Extract and check amounts CTxOut txOut(sendingTo.second, sendingTo.first); - if (txOut.IsDust(CTransaction::nMinRelayTxFee)) { + if (txOut.IsDust(CTransaction::minRelayTxFee)) { emit message(tr("Payment request error"), tr("Requested payment amount of %1 is too small (considered dust).") .arg(BitcoinUnits::formatWithUnit(optionsModel->getDisplayUnit(), sendingTo.second)), CClientUIInterface::MSG_ERROR); diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 37d82ec063..87ff3db584 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -231,12 +231,6 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact return AmountExceedsBalance; } - if((total + nTransactionFee) > nBalance) - { - transaction.setTransactionFee(nTransactionFee); - return SendCoinsReturn(AmountWithFeeExceedsBalance); - } - { LOCK2(cs_main, wallet->cs_wallet); diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 27d6d61a36..9802445fcb 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -81,9 +81,9 @@ Value getinfo(const Array& params, bool fHelp) } if (pwalletMain && pwalletMain->IsCrypted()) obj.push_back(Pair("unlocked_until", nWalletUnlockTime)); - obj.push_back(Pair("paytxfee", ValueFromAmount(nTransactionFee))); + obj.push_back(Pair("paytxfee", ValueFromAmount(payTxFee.GetFeePerK()))); #endif - obj.push_back(Pair("relayfee", ValueFromAmount(CTransaction::nMinRelayTxFee))); + obj.push_back(Pair("relayfee", ValueFromAmount(CTransaction::minRelayTxFee.GetFeePerK()))); obj.push_back(Pair("errors", GetWarnings("statusbar"))); return obj; } diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 63eed09b64..0eca55a472 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -368,7 +368,7 @@ Value getnetworkinfo(const Array& params, bool fHelp) obj.push_back(Pair("timeoffset", GetTimeOffset())); obj.push_back(Pair("connections", (int)vNodes.size())); obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string()))); - obj.push_back(Pair("relayfee", ValueFromAmount(CTransaction::nMinRelayTxFee))); + obj.push_back(Pair("relayfee", ValueFromAmount(CTransaction::minRelayTxFee.GetFeePerK()))); Array localAddresses; { LOCK(cs_mapLocalHost); diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index e3b35dbb04..f376ab6b63 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1883,7 +1883,7 @@ Value settxfee(const Array& params, bool fHelp) if (params[0].get_real() != 0.0) nAmount = AmountFromValue(params[0]); // rejects 0.0 amounts - nTransactionFee = nAmount; + payTxFee = CFeeRate(nAmount, 1000); return true; } diff --git a/src/wallet.cpp b/src/wallet.cpp index 89604f96ac..ef0b442e1a 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -16,7 +16,7 @@ using namespace std; // Settings -int64_t nTransactionFee = DEFAULT_TRANSACTION_FEE; +CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE); bool bSpendZeroConfChange = true; ////////////////////////////////////////////////////////////////////////////// @@ -1233,7 +1233,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, { LOCK2(cs_main, cs_wallet); { - nFeeRet = nTransactionFee; + nFeeRet = payTxFee.GetFeePerK(); while (true) { wtxNew.vin.clear(); @@ -1246,7 +1246,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, BOOST_FOREACH (const PAIRTYPE(CScript, int64_t)& s, vecSend) { CTxOut txout(s.second, s.first); - if (txout.IsDust(CTransaction::nMinRelayTxFee)) + if (txout.IsDust(CTransaction::minRelayTxFee)) { strFailReason = _("Transaction amount too small"); return false; @@ -1272,16 +1272,6 @@ bool CWallet::CreateTransaction(const vector >& vecSend, } int64_t nChange = nValueIn - nValue - nFeeRet; - // The following if statement should be removed once enough miners - // have upgraded to the 0.9 GetMinFee() rules. Until then, this avoids - // creating free transactions that have change outputs less than - // CENT bitcoins. - if (nFeeRet < CTransaction::nMinTxFee && nChange > 0 && nChange < CENT) - { - int64_t nMoveToFee = min(nChange, CTransaction::nMinTxFee - nFeeRet); - nChange -= nMoveToFee; - nFeeRet += nMoveToFee; - } if (nChange > 0) { @@ -1317,7 +1307,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, // Never create dust outputs; if we would, just // add the dust to the fee. - if (newTxOut.IsDust(CTransaction::nMinRelayTxFee)) + if (newTxOut.IsDust(CTransaction::minRelayTxFee)) { nFeeRet += nChange; reservekey.ReturnKey(); @@ -1355,7 +1345,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, dPriority = wtxNew.ComputePriority(dPriority, nBytes); // Check that enough fee is included - int64_t nPayFee = nTransactionFee * (1 + (int64_t)nBytes / 1000); + int64_t nPayFee = payTxFee.GetFee(nBytes); bool fAllowFree = AllowFree(dPriority); int64_t nMinFee = GetMinFee(wtxNew, nBytes, fAllowFree, GMF_SEND); if (nFeeRet < max(nPayFee, nMinFee)) @@ -1464,7 +1454,7 @@ string CWallet::SendMoneyToDestination(const CTxDestination& address, int64_t nV // Check amount if (nValue <= 0) return _("Invalid amount"); - if (nValue + nTransactionFee > GetBalance()) + if (nValue > GetBalance()) return _("Insufficient funds"); // Parse Bitcoin address diff --git a/src/wallet.h b/src/wallet.h index 8e2917188a..274c31157c 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -24,7 +24,7 @@ #include // Settings -extern int64_t nTransactionFee; +extern CFeeRate payTxFee; extern bool bSpendZeroConfChange; // -paytxfee default From 0193fb82a6fe443e5434f2c2af3b252409c19b25 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Fri, 14 Mar 2014 12:19:52 -0400 Subject: [PATCH 0145/1288] Allow multiple regression tests to run at once Choose ports at startup based on PID, so multiple regression tests can run on the same system at the same time. --- qa/rpc-tests/util.py | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index 40f4a1458f..eab526daf3 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -20,8 +20,10 @@ import re from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from util import * -START_P2P_PORT=11000 -START_RPC_PORT=11100 +def p2p_port(n): + return 11000 + n + os.getpid()%999 +def rpc_port(n): + return 12000 + n + os.getpid()%999 def check_json_precision(): """Make sure json library being used does not lose precision converting BTC values""" @@ -58,6 +60,17 @@ def sync_mempools(rpc_connections): bitcoind_processes = [] +def initialize_datadir(dir, n): + datadir = os.path.join(dir, "node"+str(n)) + if not os.path.isdir(datadir): + os.makedirs(datadir) + with open(os.path.join(datadir, "bitcoin.conf"), 'w') as f: + f.write("regtest=1\n"); + f.write("rpcuser=rt\n"); + f.write("rpcpassword=rt\n"); + f.write("port="+str(p2p_port(n))+"\n"); + f.write("rpcport="+str(rpc_port(n))+"\n"); + def initialize_chain(test_dir): """ Create (or copy from cache) a 200-block-long chain and @@ -69,17 +82,10 @@ def initialize_chain(test_dir): devnull = open("/dev/null", "w+") # Create cache directories, run bitcoinds: for i in range(4): - datadir = os.path.join("cache", "node"+str(i)) - os.makedirs(datadir) - with open(os.path.join(datadir, "bitcoin.conf"), 'w') as f: - f.write("regtest=1\n"); - f.write("rpcuser=rt\n"); - f.write("rpcpassword=rt\n"); - f.write("port="+str(START_P2P_PORT+i)+"\n"); - f.write("rpcport="+str(START_RPC_PORT+i)+"\n"); + initialize_datadir("cache", i) args = [ "bitcoind", "-keypool=1", "-datadir="+datadir ] if i > 0: - args.append("-connect=127.0.0.1:"+str(START_P2P_PORT)) + args.append("-connect=127.0.0.1:"+str(p2p_port(0))) bitcoind_processes.append(subprocess.Popen(args)) subprocess.check_call([ "bitcoin-cli", "-datadir="+datadir, "-rpcwait", "getblockcount"], stdout=devnull) @@ -87,7 +93,7 @@ def initialize_chain(test_dir): rpcs = [] for i in range(4): try: - url = "http://rt:rt@127.0.0.1:%d"%(START_RPC_PORT+i,) + url = "http://rt:rt@127.0.0.1:%d"%(rpc_port(i),) rpcs.append(AuthServiceProxy(url)) except: sys.stderr.write("Error connecting to "+url+"\n") @@ -112,6 +118,7 @@ def initialize_chain(test_dir): from_dir = os.path.join("cache", "node"+str(i)) to_dir = os.path.join(test_dir, "node"+str(i)) shutil.copytree(from_dir, to_dir) + initialize_datadir(test_dir, i) # Overwrite port/rpcport in bitcoin.conf def _rpchost_to_args(rpchost): '''Convert optional IP:port spec to rpcconnect/rpcport args''' @@ -138,7 +145,7 @@ def start_nodes(num_nodes, dir, extra_args=None, rpchost=None): devnull = open("/dev/null", "w+") for i in range(num_nodes): datadir = os.path.join(dir, "node"+str(i)) - args = [ "bitcoind", "-datadir="+datadir ] + args = [ "bitcoind", "-datadir="+datadir, "-keypool=1" ] if extra_args is not None: args += extra_args[i] bitcoind_processes.append(subprocess.Popen(args)) @@ -149,7 +156,7 @@ def start_nodes(num_nodes, dir, extra_args=None, rpchost=None): # Create&return JSON-RPC connections rpc_connections = [] for i in range(num_nodes): - url = "http://rt:rt@%s:%d" % (rpchost or '127.0.0.1', START_RPC_PORT+i,) + url = "http://rt:rt@%s:%d" % (rpchost or '127.0.0.1', rpc_port(i)) rpc_connections.append(AuthServiceProxy(url)) return rpc_connections @@ -168,7 +175,7 @@ def wait_bitcoinds(): del bitcoind_processes[:] def connect_nodes(from_connection, node_num): - ip_port = "127.0.0.1:"+str(START_P2P_PORT+node_num) + ip_port = "127.0.0.1:"+str(p2p_port(node_num)) from_connection.addnode(ip_port, "onetry") def assert_equal(thing1, thing2): From 171ca7745e77c9f78f26556457fe64e5b2004a75 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Mon, 17 Mar 2014 08:19:54 -0400 Subject: [PATCH 0146/1288] estimatefee / estimatepriority RPC methods New RPC methods: return an estimate of the fee (or priority) a transaction needs to be likely to confirm in a given number of blocks. Mike Hearn created the first version of this method for estimating fees. It works as follows: For transactions that took 1 to N (I picked N=25) blocks to confirm, keep N buckets with at most 100 entries in each recording the fees-per-kilobyte paid by those transactions. (separate buckets are kept for transactions that confirmed because they are high-priority) The buckets are filled as blocks are found, and are saved/restored in a new fee_estiamtes.dat file in the data directory. A few variations on Mike's initial scheme: To estimate the fee needed for a transaction to confirm in X buckets, all of the samples in all of the buckets are used and a median of all of the data is used to make the estimate. For example, imagine 25 buckets each containing the full 100 entries. Those 2,500 samples are sorted, and the estimate of the fee needed to confirm in the very next block is the 50'th-highest-fee-entry in that sorted list; the estimate of the fee needed to confirm in the next two blocks is the 150'th-highest-fee-entry, etc. That algorithm has the nice property that estimates of how much fee you need to pay to get confirmed in block N will always be greater than or equal to the estimate for block N+1. It would clearly be wrong to say "pay 11 uBTC and you'll get confirmed in 3 blocks, but pay 12 uBTC and it will take LONGER". A single block will not contribute more than 10 entries to any one bucket, so a single miner and a large block cannot overwhelm the estimates. --- doc/release-notes.md | 19 ++ qa/rpc-tests/smartfees.py | 142 +++++++++++++++ qa/rpc-tests/util.py | 143 +++++++++++++-- src/core.h | 3 + src/init.cpp | 14 ++ src/main.cpp | 10 +- src/main.h | 7 - src/rpcclient.cpp | 2 + src/rpcmining.cpp | 61 +++++++ src/rpcserver.cpp | 2 + src/rpcserver.h | 2 + src/txmempool.cpp | 370 ++++++++++++++++++++++++++++++++++++++ src/txmempool.h | 23 +++ 13 files changed, 767 insertions(+), 31 deletions(-) create mode 100755 qa/rpc-tests/smartfees.py diff --git a/doc/release-notes.md b/doc/release-notes.md index f16eec32a2..9272d427cd 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -1,2 +1,21 @@ (note: this is a temporary file, to be added-to by anybody, and moved to release-notes at release time) + +New RPC methods +=============== + +Fee/Priority estimation +----------------------- + +estimatefee nblocks : Returns approximate fee-per-1,000-bytes needed for +a transaction to be confirmed within nblocks. Returns -1 if not enough +transactions have been observed to compute a good estimate. + +estimatepriority nblocks : Returns approximate priority needed for +a zero-fee transaction to confirm within nblocks. Returns -1 if not +enough free transactions have been observed to compute a good +estimate. + +Statistics used to estimate fees and priorities are saved in the +data directory in the 'fee_estimates.dat' file just before +program shutdown, and are read in at startup. diff --git a/qa/rpc-tests/smartfees.py b/qa/rpc-tests/smartfees.py new file mode 100755 index 0000000000..e8abbfba19 --- /dev/null +++ b/qa/rpc-tests/smartfees.py @@ -0,0 +1,142 @@ +#!/usr/bin/env python + +# +# Test fee estimation code +# + +# Add python-bitcoinrpc to module search path: +import os +import sys +sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc")) + +import json +import random +import shutil +import subprocess +import tempfile +import traceback + +from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException +from util import * + + +def run_test(nodes, test_dir): + nodes.append(start_node(0, test_dir, + ["-debug=mempool", "-debug=estimatefee"])) + # Node1 mines small-but-not-tiny blocks, and allows free transactions. + # NOTE: the CreateNewBlock code starts counting block size at 1,000 bytes, + # so blockmaxsize of 2,000 is really just 1,000 bytes (room enough for + # 6 or 7 transactions) + nodes.append(start_node(1, test_dir, + ["-blockprioritysize=1500", "-blockmaxsize=2000", + "-debug=mempool", "-debug=estimatefee"])) + connect_nodes(nodes[1], 0) + + # Node2 is a stingy miner, that + # produces very small blocks (room for only 3 or so transactions) + node2args = [ "-blockprioritysize=0", "-blockmaxsize=1500", + "-debug=mempool", "-debug=estimatefee"] + nodes.append(start_node(2, test_dir, node2args)) + connect_nodes(nodes[2], 0) + + sync_blocks(nodes) + + # Prime the memory pool with pairs of transactions + # (high-priority, random fee and zero-priority, random fee) + min_fee = Decimal("0.001") + fees_per_kb = []; + for i in range(12): + (txid, txhex, fee) = random_zeropri_transaction(nodes, Decimal("1.1"), + min_fee, min_fee, 20) + tx_kbytes = (len(txhex)/2)/1000.0 + fees_per_kb.append(float(fee)/tx_kbytes) + + # Mine blocks with node2 until the memory pool clears: + count_start = nodes[2].getblockcount() + while len(nodes[2].getrawmempool()) > 0: + nodes[2].setgenerate(True, 1) + sync_blocks(nodes) + + all_estimates = [ nodes[0].estimatefee(i) for i in range(1,20) ] + print("Fee estimates, super-stingy miner: "+str([str(e) for e in all_estimates])) + + # Estimates should be within the bounds of what transactions fees actually were: + delta = 1.0e-6 # account for rounding error + for e in filter(lambda x: x >= 0, all_estimates): + if float(e)+delta < min(fees_per_kb) or float(e)-delta > max(fees_per_kb): + raise AssertionError("Estimated fee (%f) out of range (%f,%f)"%(float(e), min_fee_kb, max_fee_kb)) + + # Generate transactions while mining 30 more blocks, this time with node1: + for i in range(30): + for j in range(random.randrange(6-4,6+4)): + (txid, txhex, fee) = random_transaction(nodes, Decimal("1.1"), + Decimal("0.0"), min_fee, 20) + tx_kbytes = (len(txhex)/2)/1000.0 + fees_per_kb.append(float(fee)/tx_kbytes) + nodes[1].setgenerate(True, 1) + sync_blocks(nodes) + + all_estimates = [ nodes[0].estimatefee(i) for i in range(1,20) ] + print("Fee estimates, more generous miner: "+str([ str(e) for e in all_estimates])) + for e in filter(lambda x: x >= 0, all_estimates): + if float(e)+delta < min(fees_per_kb) or float(e)-delta > max(fees_per_kb): + raise AssertionError("Estimated fee (%f) out of range (%f,%f)"%(float(e), min_fee_kb, max_fee_kb)) + + # Finish by mining a normal-sized block: + while len(nodes[0].getrawmempool()) > 0: + nodes[0].setgenerate(True, 1) + sync_blocks(nodes) + + final_estimates = [ nodes[0].estimatefee(i) for i in range(1,20) ] + print("Final fee estimates: "+str([ str(e) for e in final_estimates])) + +def main(): + import optparse + + parser = optparse.OptionParser(usage="%prog [options]") + parser.add_option("--nocleanup", dest="nocleanup", default=False, action="store_true", + help="Leave bitcoinds and test.* datadir on exit or error") + parser.add_option("--srcdir", dest="srcdir", default="../../src", + help="Source directory containing bitcoind/bitcoin-cli (default: %default%)") + parser.add_option("--tmpdir", dest="tmpdir", default=tempfile.mkdtemp(prefix="test"), + help="Root directory for datadirs") + (options, args) = parser.parse_args() + + os.environ['PATH'] = options.srcdir+":"+os.environ['PATH'] + + check_json_precision() + + success = False + nodes = [] + try: + print("Initializing test directory "+options.tmpdir) + print(" node0 running at: 127.0.0.1:%d"%(p2p_port(0))) + if not os.path.isdir(options.tmpdir): + os.makedirs(options.tmpdir) + initialize_chain(options.tmpdir) + + run_test(nodes, options.tmpdir) + + success = True + + except AssertionError as e: + print("Assertion failed: "+e.message) + except Exception as e: + print("Unexpected exception caught during testing: "+str(e)) + traceback.print_tb(sys.exc_info()[2]) + + if not options.nocleanup: + print("Cleaning up") + stop_nodes(nodes) + wait_bitcoinds() + shutil.rmtree(options.tmpdir) + + if success: + print("Tests successful") + sys.exit(0) + else: + print("Failed") + sys.exit(1) + +if __name__ == '__main__': + main() diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index eab526daf3..eded098c7c 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -12,6 +12,7 @@ sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python from decimal import Decimal import json +import random import shutil import subprocess import time @@ -70,6 +71,7 @@ def initialize_datadir(dir, n): f.write("rpcpassword=rt\n"); f.write("port="+str(p2p_port(n))+"\n"); f.write("rpcport="+str(rpc_port(n))+"\n"); + return datadir def initialize_chain(test_dir): """ @@ -82,7 +84,7 @@ def initialize_chain(test_dir): devnull = open("/dev/null", "w+") # Create cache directories, run bitcoinds: for i in range(4): - initialize_datadir("cache", i) + datadir=initialize_datadir("cache", i) args = [ "bitcoind", "-keypool=1", "-datadir="+datadir ] if i > 0: args.append("-connect=127.0.0.1:"+str(p2p_port(0))) @@ -140,25 +142,28 @@ def _rpchost_to_args(rpchost): rv += ['-rpcport=' + rpcport] return rv -def start_nodes(num_nodes, dir, extra_args=None, rpchost=None): - # Start bitcoinds, and wait for RPC interface to be up and running: +def start_node(i, dir, extra_args=None, rpchost=None): + """ + Start a bitcoind and return RPC connection to it + """ + datadir = os.path.join(dir, "node"+str(i)) + args = [ "bitcoind", "-datadir="+datadir, "-keypool=1" ] + if extra_args is not None: args.extend(extra_args) + bitcoind_processes.append(subprocess.Popen(args)) devnull = open("/dev/null", "w+") - for i in range(num_nodes): - datadir = os.path.join(dir, "node"+str(i)) - args = [ "bitcoind", "-datadir="+datadir, "-keypool=1" ] - if extra_args is not None: - args += extra_args[i] - bitcoind_processes.append(subprocess.Popen(args)) - subprocess.check_call([ "bitcoin-cli", "-datadir="+datadir] + - _rpchost_to_args(rpchost) + - ["-rpcwait", "getblockcount"], stdout=devnull) + subprocess.check_call([ "bitcoin-cli", "-datadir="+datadir] + + _rpchost_to_args(rpchost) + + ["-rpcwait", "getblockcount"], stdout=devnull) devnull.close() - # Create&return JSON-RPC connections - rpc_connections = [] - for i in range(num_nodes): - url = "http://rt:rt@%s:%d" % (rpchost or '127.0.0.1', rpc_port(i)) - rpc_connections.append(AuthServiceProxy(url)) - return rpc_connections + url = "http://rt:rt@%s:%d" % (rpchost or '127.0.0.1', rpc_port(i)) + return AuthServiceProxy(url) + +def start_nodes(num_nodes, dir, extra_args=None, rpchost=None): + """ + Start multiple bitcoinds, return RPC connections to them + """ + if extra_args is None: extra_args = [ None for i in range(num_nodes) ] + return [ start_node(i, dir, extra_args[i], rpchost) for i in range(num_nodes) ] def debug_log(dir, n_node): return os.path.join(dir, "node"+str(n_node), "regtest", "debug.log") @@ -178,6 +183,108 @@ def connect_nodes(from_connection, node_num): ip_port = "127.0.0.1:"+str(p2p_port(node_num)) from_connection.addnode(ip_port, "onetry") +def find_output(node, txid, amount): + """ + Return index to output of txid with value amount + Raises exception if there is none. + """ + txdata = node.getrawtransaction(txid, 1) + for i in range(len(txdata["vout"])): + if txdata["vout"][i]["value"] == amount: + return i + raise RuntimeError("find_output txid %s : %s not found"%(txid,str(amount))) + +def gather_inputs(from_node, amount_needed): + """ + Return a random set of unspent txouts that are enough to pay amount_needed + """ + utxo = from_node.listunspent(1) + random.shuffle(utxo) + inputs = [] + total_in = Decimal("0.00000000") + while total_in < amount_needed and len(utxo) > 0: + t = utxo.pop() + total_in += t["amount"] + inputs.append({ "txid" : t["txid"], "vout" : t["vout"], "address" : t["address"] } ) + if total_in < amount_needed: + raise RuntimeError("Insufficient funds: need %d, have %d"%(amount+fee*2, total_in)) + return (total_in, inputs) + +def make_change(from_node, amount_in, amount_out, fee): + """ + Create change output(s), return them + """ + outputs = {} + amount = amount_out+fee + change = amount_in - amount + if change > amount*2: + # Create an extra change output to break up big inputs + outputs[from_node.getnewaddress()] = float(change/2) + change = change/2 + if change > 0: + outputs[from_node.getnewaddress()] = float(change) + return outputs + +def send_zeropri_transaction(from_node, to_node, amount, fee): + """ + Create&broadcast a zero-priority transaction. + Returns (txid, hex-encoded-txdata) + Ensures transaction is zero-priority by first creating a send-to-self, + then using it's output + """ + + # Create a send-to-self with confirmed inputs: + self_address = from_node.getnewaddress() + (total_in, inputs) = gather_inputs(from_node, amount+fee*2) + outputs = make_change(from_node, total_in, amount+fee, fee) + outputs[self_address] = float(amount+fee) + + self_rawtx = from_node.createrawtransaction(inputs, outputs) + self_signresult = from_node.signrawtransaction(self_rawtx) + self_txid = from_node.sendrawtransaction(self_signresult["hex"], True) + + vout = find_output(from_node, self_txid, amount+fee) + # Now immediately spend the output to create a 1-input, 1-output + # zero-priority transaction: + inputs = [ { "txid" : self_txid, "vout" : vout } ] + outputs = { to_node.getnewaddress() : float(amount) } + + rawtx = from_node.createrawtransaction(inputs, outputs) + signresult = from_node.signrawtransaction(rawtx) + txid = from_node.sendrawtransaction(signresult["hex"], True) + + return (txid, signresult["hex"]) + +def random_zeropri_transaction(nodes, amount, min_fee, fee_increment, fee_variants): + """ + Create a random zero-priority transaction. + Returns (txid, hex-encoded-transaction-data, fee) + """ + from_node = random.choice(nodes) + to_node = random.choice(nodes) + fee = min_fee + fee_increment*random.randint(0,fee_variants) + (txid, txhex) = send_zeropri_transaction(from_node, to_node, amount, fee) + return (txid, txhex, fee) + +def random_transaction(nodes, amount, min_fee, fee_increment, fee_variants): + """ + Create a random transaction. + Returns (txid, hex-encoded-transaction-data, fee) + """ + from_node = random.choice(nodes) + to_node = random.choice(nodes) + fee = min_fee + fee_increment*random.randint(0,fee_variants) + + (total_in, inputs) = gather_inputs(from_node, amount+fee) + outputs = make_change(from_node, total_in, amount, fee) + outputs[to_node.getnewaddress()] = float(amount) + + rawtx = from_node.createrawtransaction(inputs, outputs) + signresult = from_node.signrawtransaction(rawtx) + txid = from_node.sendrawtransaction(signresult["hex"], True) + + return (txid, signresult["hex"], fee) + def assert_equal(thing1, thing2): if thing1 != thing2: raise AssertionError("%s != %s"%(str(thing1),str(thing2))) diff --git a/src/core.h b/src/core.h index 9fccffc4b2..0e59129349 100644 --- a/src/core.h +++ b/src/core.h @@ -120,6 +120,7 @@ class CFeeRate private: int64_t nSatoshisPerK; // unit is satoshis-per-1,000-bytes public: + CFeeRate() : nSatoshisPerK(0) { } explicit CFeeRate(int64_t _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) { } CFeeRate(int64_t nFeePaid, size_t nSize); CFeeRate(const CFeeRate& other) { nSatoshisPerK = other.nSatoshisPerK; } @@ -132,6 +133,8 @@ public: friend bool operator==(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK == b.nSatoshisPerK; } std::string ToString() const; + + IMPLEMENT_SERIALIZE( READWRITE(nSatoshisPerK); ) }; diff --git a/src/init.cpp b/src/init.cpp index 1aad679b3b..aca5e0c9aa 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -59,6 +59,7 @@ enum BindFlags { BF_REPORT_ERROR = (1U << 1) }; +static const char* FEE_ESTIMATES_FILENAME="fee_estimates.dat"; ////////////////////////////////////////////////////////////////////////////// // @@ -121,6 +122,14 @@ void Shutdown() #endif StopNode(); UnregisterNodeSignals(GetNodeSignals()); + + boost::filesystem::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME; + CAutoFile est_fileout = CAutoFile(fopen(est_path.string().c_str(), "wb"), SER_DISK, CLIENT_VERSION); + if (est_fileout) + mempool.WriteFeeEstimates(est_fileout); + else + LogPrintf("failed to write fee estimates"); + { LOCK(cs_main); #ifdef ENABLE_WALLET @@ -933,6 +942,11 @@ bool AppInit2(boost::thread_group& threadGroup) return false; } + boost::filesystem::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME; + CAutoFile est_filein = CAutoFile(fopen(est_path.string().c_str(), "rb"), SER_DISK, CLIENT_VERSION); + if (est_filein) + mempool.ReadFeeEstimates(est_filein); + // ********************************************************* Step 8: load wallet #ifdef ENABLE_WALLET if (fDisableWallet) { diff --git a/src/main.cpp b/src/main.cpp index 9d6c01d64e..429473d8f8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -851,6 +851,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa CCoinsView dummy; CCoinsViewCache view(dummy); + int64_t nValueIn = 0; { LOCK(pool.cs); CCoinsViewMemPool viewMemPool(*pcoinsTip, pool); @@ -879,6 +880,8 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa // Bring the best block into scope view.GetBestBlock(); + nValueIn = view.GetValueIn(tx); + // we have all inputs cached now, so switch back to dummy, so we don't need to keep lock on mempool view.SetBackend(dummy); } @@ -891,7 +894,6 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa // you should add code here to check that the transaction does a // reasonable number of ECDSA signature verifications. - int64_t nValueIn = view.GetValueIn(tx); int64_t nValueOut = tx.GetValueOut(); int64_t nFees = nValueIn-nValueOut; double dPriority = view.GetPriority(tx, chainActive.Height()); @@ -2017,11 +2019,7 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew) { return false; // Remove conflicting transactions from the mempool. list txConflicted; - BOOST_FOREACH(const CTransaction &tx, block.vtx) { - list unused; - mempool.remove(tx, unused); - mempool.removeConflicts(tx, txConflicted); - } + mempool.removeForBlock(block.vtx, pindexNew->nHeight, txConflicted); mempool.check(pcoinsTip); // Update chainActive & related variables. UpdateTip(pindexNew); diff --git a/src/main.h b/src/main.h index 3fccd32a29..23c8660376 100644 --- a/src/main.h +++ b/src/main.h @@ -292,13 +292,6 @@ unsigned int GetLegacySigOpCount(const CTransaction& tx); unsigned int GetP2SHSigOpCount(const CTransaction& tx, CCoinsViewCache& mapInputs); -inline bool AllowFree(double dPriority) -{ - // Large (in bytes) low-priority (new, small-coin) transactions - // need a fee. - return dPriority > COIN * 144 / 250; -} - // Check whether all inputs of this transaction are valid (no double spends, scripts & sigs, amounts) // This does not modify the UTXO set. If pvChecks is not NULL, script checks are pushed onto it // instead of being performed inline. diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index 4f3c39ce9b..b89a95ad11 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -176,6 +176,8 @@ Array RPCConvertValues(const std::string &strMethod, const std::vector 1) ConvertTo(params[1]); if (strMethod == "keypoolrefill" && n > 0) ConvertTo(params[0]); if (strMethod == "getrawmempool" && n > 0) ConvertTo(params[0]); + if (strMethod == "estimatefee" && n > 0) ConvertTo(params[0]); + if (strMethod == "estimatepriority" && n > 0) ConvertTo(params[0]); return params; } diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 23876c603d..dd148c6af1 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -15,6 +15,7 @@ #endif #include +#include #include "json/json_spirit_utils.h" #include "json/json_spirit_value.h" @@ -626,3 +627,63 @@ Value submitblock(const Array& params, bool fHelp) return Value::null; } + +Value estimatefee(const Array& params, bool fHelp) +{ + if (fHelp || params.size() != 1) + throw runtime_error( + "estimatefee nblocks\n" + "\nEstimates the approximate fee per kilobyte\n" + "needed for a transaction to get confirmed\n" + "within nblocks blocks.\n" + "\nArguments:\n" + "1. nblocks (numeric)\n" + "\nResult:\n" + "n : (numeric) estimated fee-per-kilobyte\n" + "\n" + "-1.0 is returned if not enough transactions and\n" + "blocks have been observed to make an estimate.\n" + "\nExample:\n" + + HelpExampleCli("estimatefee", "6") + ); + + RPCTypeCheck(params, boost::assign::list_of(int_type)); + + int nBlocks = params[0].get_int(); + if (nBlocks < 1) + nBlocks = 1; + + CFeeRate feeRate = mempool.estimateFee(nBlocks); + if (feeRate == CFeeRate(0)) + return -1.0; + + return ValueFromAmount(feeRate.GetFeePerK()); +} + +Value estimatepriority(const Array& params, bool fHelp) +{ + if (fHelp || params.size() != 1) + throw runtime_error( + "estimatepriority nblocks\n" + "\nEstimates the approximate priority\n" + "a zero-fee transaction needs to get confirmed\n" + "within nblocks blocks.\n" + "\nArguments:\n" + "1. nblocks (numeric)\n" + "\nResult:\n" + "n : (numeric) estimated priority\n" + "\n" + "-1.0 is returned if not enough transactions and\n" + "blocks have been observed to make an estimate.\n" + "\nExample:\n" + + HelpExampleCli("estimatepriority", "6") + ); + + RPCTypeCheck(params, boost::assign::list_of(int_type)); + + int nBlocks = params[0].get_int(); + if (nBlocks < 1) + nBlocks = 1; + + return mempool.estimatePriority(nBlocks); +} diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 2534a9dcf4..72a7fe83ef 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -268,6 +268,8 @@ static const CRPCCommand vRPCCommands[] = { "createmultisig", &createmultisig, true, true , false }, { "validateaddress", &validateaddress, true, false, false }, /* uses wallet if enabled */ { "verifymessage", &verifymessage, false, false, false }, + { "estimatefee", &estimatefee, true, true, false }, + { "estimatepriority", &estimatepriority, true, true, false }, #ifdef ENABLE_WALLET /* Wallet */ diff --git a/src/rpcserver.h b/src/rpcserver.h index e8cd2cd0fc..73e8b9426c 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -133,6 +133,8 @@ extern json_spirit::Value getmininginfo(const json_spirit::Array& params, bool f extern json_spirit::Value getwork(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getblocktemplate(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value submitblock(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value estimatefee(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value estimatepriority(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getnewaddress(const json_spirit::Array& params, bool fHelp); // in rpcwallet.cpp extern json_spirit::Value getaccountaddress(const json_spirit::Array& params, bool fHelp); diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 64c9eac73d..4bf01d4848 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -6,6 +6,8 @@ #include "core.h" #include "txmempool.h" +#include + using namespace std; CTxMemPoolEntry::CTxMemPoolEntry() @@ -35,12 +37,311 @@ CTxMemPoolEntry::GetPriority(unsigned int currentHeight) const return dResult; } +// +// Keep track of fee/priority for transactions confirmed within N blocks +// +class CBlockAverage +{ +private: + boost::circular_buffer feeSamples; + boost::circular_buffer prioritySamples; + + template std::vector buf2vec(boost::circular_buffer buf) const + { + std::vector vec(buf.begin(), buf.end()); + return vec; + } + +public: + CBlockAverage() : feeSamples(100), prioritySamples(100) { } + + void RecordFee(const CFeeRate& feeRate) { + feeSamples.push_back(feeRate); + } + + void RecordPriority(double priority) { + prioritySamples.push_back(priority); + } + + size_t FeeSamples() const { return feeSamples.size(); } + size_t GetFeeSamples(std::vector& insertInto) const + { + BOOST_FOREACH(const CFeeRate& f, feeSamples) + insertInto.push_back(f); + return feeSamples.size(); + } + size_t PrioritySamples() const { return prioritySamples.size(); } + size_t GetPrioritySamples(std::vector& insertInto) const + { + BOOST_FOREACH(double d, prioritySamples) + insertInto.push_back(d); + return prioritySamples.size(); + } + + // Used as belt-and-suspenders check when reading to detect + // file corruption + bool AreSane(const std::vector& vecFee) + { + BOOST_FOREACH(CFeeRate fee, vecFee) + { + if (fee < CFeeRate(0)) + return false; + if (fee.GetFee(1000) > CTransaction::minRelayTxFee.GetFee(1000) * 10000) + return false; + } + return true; + } + bool AreSane(const std::vector vecPriority) + { + BOOST_FOREACH(double priority, vecPriority) + { + if (priority < 0) + return false; + } + return true; + } + + void Write(CAutoFile& fileout) const + { + std::vector vecFee = buf2vec(feeSamples); + fileout << vecFee; + std::vector vecPriority = buf2vec(prioritySamples); + fileout << vecPriority; + } + + void Read(CAutoFile& filein) { + std::vector vecFee; + filein >> vecFee; + if (AreSane(vecFee)) + feeSamples.insert(feeSamples.end(), vecFee.begin(), vecFee.end()); + else + throw runtime_error("Corrupt fee value in estimates file."); + std::vector vecPriority; + filein >> vecPriority; + if (AreSane(vecPriority)) + prioritySamples.insert(prioritySamples.end(), vecPriority.begin(), vecPriority.end()); + else + throw runtime_error("Corrupt priority value in estimates file."); + if (feeSamples.size() + prioritySamples.size() > 0) + LogPrint("estimatefee", "Read %d fee samples and %d priority samples\n", + feeSamples.size(), prioritySamples.size()); + } +}; + +class CMinerPolicyEstimator +{ +private: + // Records observed averages transactions that confirmed within one block, two blocks, + // three blocks etc. + std::vector history; + std::vector sortedFeeSamples; + std::vector sortedPrioritySamples; + + int nBestSeenHeight; + + // nBlocksAgo is 0 based, i.e. transactions that confirmed in the highest seen block are + // nBlocksAgo == 0, transactions in the block before that are nBlocksAgo == 1 etc. + void seenTxConfirm(CFeeRate feeRate, double dPriority, int nBlocksAgo) + { + // Last entry records "everything else". + int nBlocksTruncated = min(nBlocksAgo, (int) history.size() - 1); + assert(nBlocksTruncated >= 0); + + // We need to guess why the transaction was included in a block-- either + // because it is high-priority or because it has sufficient fees. + bool sufficientFee = (feeRate > CTransaction::minRelayTxFee); + bool sufficientPriority = AllowFree(dPriority); + const char* assignedTo = "unassigned"; + if (sufficientFee && !sufficientPriority) + { + history[nBlocksTruncated].RecordFee(feeRate); + assignedTo = "fee"; + } + else if (sufficientPriority && !sufficientFee) + { + history[nBlocksTruncated].RecordPriority(dPriority); + assignedTo = "priority"; + } + else + { + // Neither or both fee and priority sufficient to get confirmed: + // don't know why they got confirmed. + } + LogPrint("estimatefee", "Seen TX confirm: %s : %s fee/%g priority, took %d blocks\n", + assignedTo, feeRate.ToString(), dPriority, nBlocksAgo); + } + +public: + CMinerPolicyEstimator(int nEntries) : nBestSeenHeight(0) + { + history.resize(nEntries); + } + + void seenBlock(const std::vector& entries, int nBlockHeight) + { + if (nBlockHeight <= nBestSeenHeight) + { + // Ignore side chains and re-orgs; assuming they are random + // they don't affect the estimate. + // And if an attacker can re-org the chain at will, then + // you've got much bigger problems than "attacker can influence + // transaction fees." + return; + } + nBestSeenHeight = nBlockHeight; + + // Fill up the history buckets based on how long transactions took + // to confirm. + std::vector > entriesByConfirmations; + entriesByConfirmations.resize(history.size()); + BOOST_FOREACH(const CTxMemPoolEntry& entry, entries) + { + // How many blocks did it take for miners to include this transaction? + int delta = nBlockHeight - entry.GetHeight(); + if (delta <= 0) + { + // Re-org made us lose height, this should only happen if we happen + // to re-org on a difficulty transition point: very rare! + continue; + } + if ((delta-1) >= (int)history.size()) + delta = history.size(); // Last bucket is catch-all + entriesByConfirmations[delta-1].push_back(&entry); + } + for (size_t i = 0; i < entriesByConfirmations.size(); i++) + { + std::vector &e = entriesByConfirmations.at(i); + // Insert at most 10 random entries per bucket, otherwise a single block + // can dominate an estimate: + if (e.size() > 10) { + std::random_shuffle(e.begin(), e.end()); + e.resize(10); + } + BOOST_FOREACH(const CTxMemPoolEntry* entry, e) + { + // Fees are stored and reported as BTC-per-kb: + CFeeRate feeRate(entry->GetFee(), entry->GetTxSize()); + double dPriority = entry->GetPriority(entry->GetHeight()); // Want priority when it went IN + seenTxConfirm(feeRate, dPriority, i); + } + } + for (size_t i = 0; i < history.size(); i++) { + if (history[i].FeeSamples() + history[i].PrioritySamples() > 0) + LogPrint("estimatefee", "estimates: for confirming within %d blocks based on %d/%d samples, fee=%s, prio=%g\n", + i, + history[i].FeeSamples(), history[i].PrioritySamples(), + estimateFee(i+1).ToString(), estimatePriority(i+1)); + } + sortedFeeSamples.clear(); + sortedPrioritySamples.clear(); + } + + // Can return CFeeRate(0) if we don't have any data for that many blocks back. nBlocksToConfirm is 1 based. + CFeeRate estimateFee(int nBlocksToConfirm) + { + nBlocksToConfirm--; + + if (nBlocksToConfirm < 0 || nBlocksToConfirm >= (int)history.size()) + return CFeeRate(0); + + if (sortedFeeSamples.size() == 0) + { + for (size_t i = 0; i < history.size(); i++) + history.at(i).GetFeeSamples(sortedFeeSamples); + std::sort(sortedFeeSamples.begin(), sortedFeeSamples.end(), + std::greater()); + } + if (sortedFeeSamples.size() == 0) + return CFeeRate(0); + + int nBucketSize = history.at(nBlocksToConfirm).FeeSamples(); + + // Estimates should not increase as number of confirmations goes up, + // but the estimates are noisy because confirmations happen discretely + // in blocks. To smooth out the estimates, use all samples in the history + // and use the nth highest where n is (number of samples in previous bucket + + // half the samples in nBlocksToConfirm bucket): + size_t nPrevSize = 0; + for (int i = 0; i < nBlocksToConfirm; i++) + nPrevSize += history.at(i).FeeSamples(); + size_t index = min(nPrevSize + nBucketSize/2, sortedFeeSamples.size()-1); + return sortedFeeSamples[index]; + } + double estimatePriority(int nBlocksToConfirm) + { + nBlocksToConfirm--; + + if (nBlocksToConfirm < 0 || nBlocksToConfirm >= (int)history.size()) + return -1; + + if (sortedPrioritySamples.size() == 0) + { + for (size_t i = 0; i < history.size(); i++) + history.at(i).GetPrioritySamples(sortedPrioritySamples); + std::sort(sortedPrioritySamples.begin(), sortedPrioritySamples.end(), + std::greater()); + } + if (sortedPrioritySamples.size() == 0) + return -1.0; + + int nBucketSize = history.at(nBlocksToConfirm).PrioritySamples(); + + // Estimates should not increase as number of confirmations needed goes up, + // but the estimates are noisy because confirmations happen discretely + // in blocks. To smooth out the estimates, use all samples in the history + // and use the nth highest where n is (number of samples in previous buckets + + // half the samples in nBlocksToConfirm bucket). + size_t nPrevSize = 0; + for (int i = 0; i < nBlocksToConfirm; i++) + nPrevSize += history.at(i).PrioritySamples(); + size_t index = min(nPrevSize + nBucketSize/2, sortedFeeSamples.size()-1); + return sortedPrioritySamples[index]; + } + + void Write(CAutoFile& fileout) const + { + fileout << nBestSeenHeight; + fileout << history.size(); + BOOST_FOREACH(const CBlockAverage& entry, history) + { + entry.Write(fileout); + } + } + + void Read(CAutoFile& filein) + { + filein >> nBestSeenHeight; + size_t numEntries; + filein >> numEntries; + history.clear(); + for (size_t i = 0; i < numEntries; i++) + { + CBlockAverage entry; + entry.Read(filein); + history.push_back(entry); + } + } +}; + + CTxMemPool::CTxMemPool() { // Sanity checks off by default for performance, because otherwise // accepting transactions becomes O(N^2) where N is the number // of transactions in the pool fSanityCheck = false; + + // 25 blocks is a compromise between using a lot of disk/memory and + // trying to give accurate estimates to people who might be willing + // to wait a day or two to save a fraction of a penny in fees. + // Confirmation times for very-low-fee transactions that take more + // than an hour or three to confirm are highly variable. + minerPolicyEstimator = new CMinerPolicyEstimator(25); +} + +CTxMemPool::~CTxMemPool() +{ + delete minerPolicyEstimator; } void CTxMemPool::pruneSpent(const uint256 &hashTx, CCoins &coins) @@ -128,6 +429,28 @@ void CTxMemPool::removeConflicts(const CTransaction &tx, std::list } } +// Called when a block is connected. Removes from mempool and updates the miner fee estimator. +void CTxMemPool::removeForBlock(const std::vector& vtx, unsigned int nBlockHeight, + std::list& conflicts) +{ + LOCK(cs); + std::vector entries; + BOOST_FOREACH(const CTransaction& tx, vtx) + { + uint256 hash = tx.GetHash(); + if (mapTx.count(hash)) + entries.push_back(mapTx[hash]); + } + minerPolicyEstimator->seenBlock(entries, nBlockHeight); + BOOST_FOREACH(const CTransaction& tx, vtx) + { + std::list dummy; + remove(tx, dummy, false); + removeConflicts(tx, conflicts); + } +} + + void CTxMemPool::clear() { LOCK(cs); @@ -195,6 +518,53 @@ bool CTxMemPool::lookup(uint256 hash, CTransaction& result) const return true; } +CFeeRate CTxMemPool::estimateFee(int nBlocks) const +{ + LOCK(cs); + return minerPolicyEstimator->estimateFee(nBlocks); +} +double CTxMemPool::estimatePriority(int nBlocks) const +{ + LOCK(cs); + return minerPolicyEstimator->estimatePriority(nBlocks); +} + +bool +CTxMemPool::WriteFeeEstimates(CAutoFile& fileout) const +{ + try { + LOCK(cs); + fileout << 99900; // version required to read: 0.9.99 or later + fileout << CLIENT_VERSION; // version that wrote the file + minerPolicyEstimator->Write(fileout); + } + catch (std::exception &e) { + LogPrintf("CTxMemPool::WriteFeeEstimates() : unable to write policy estimator data (non-fatal)"); + return false; + } + return true; +} + +bool +CTxMemPool::ReadFeeEstimates(CAutoFile& filein) +{ + try { + int nVersionRequired, nVersionThatWrote; + filein >> nVersionRequired >> nVersionThatWrote; + if (nVersionRequired > CLIENT_VERSION) + return error("CTxMemPool::ReadFeeEstimates() : up-version (%d) fee estimate file", nVersionRequired); + + LOCK(cs); + minerPolicyEstimator->Read(filein); + } + catch (std::exception &e) { + LogPrintf("CTxMemPool::ReadFeeEstimates() : unable to read policy estimator data (non-fatal)"); + return false; + } + return true; +} + + CCoinsViewMemPool::CCoinsViewMemPool(CCoinsView &baseIn, CTxMemPool &mempoolIn) : CCoinsViewBacked(baseIn), mempool(mempoolIn) { } bool CCoinsViewMemPool::GetCoins(const uint256 &txid, CCoins &coins) { diff --git a/src/txmempool.h b/src/txmempool.h index 4509e95778..b2915aa842 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -11,6 +11,13 @@ #include "core.h" #include "sync.h" +inline bool AllowFree(double dPriority) +{ + // Large (in bytes) low-priority (new, small-coin) transactions + // need a fee. + return dPriority > COIN * 144 / 250; +} + /** Fake height value used in CCoins to signify they are only in the memory pool (since 0.8) */ static const unsigned int MEMPOOL_HEIGHT = 0x7FFFFFFF; @@ -41,6 +48,8 @@ public: unsigned int GetHeight() const { return nHeight; } }; +class CMinerPolicyEstimator; + /* * CTxMemPool stores valid-according-to-the-current-best-chain * transactions that may be included in the next block. @@ -56,6 +65,7 @@ class CTxMemPool private: bool fSanityCheck; // Normally false, true if -checkmempool or -regtest unsigned int nTransactionsUpdated; + CMinerPolicyEstimator* minerPolicyEstimator; public: mutable CCriticalSection cs; @@ -63,6 +73,7 @@ public: std::map mapNextTx; CTxMemPool(); + ~CTxMemPool(); /* * If sanity-checking is turned on, check makes sure the pool is @@ -76,6 +87,8 @@ public: bool addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry); void remove(const CTransaction &tx, std::list& removed, bool fRecursive = false); void removeConflicts(const CTransaction &tx, std::list& removed); + void removeForBlock(const std::vector& vtx, unsigned int nBlockHeight, + std::list& conflicts); void clear(); void queryHashes(std::vector& vtxid); void pruneSpent(const uint256& hash, CCoins &coins); @@ -95,6 +108,16 @@ public: } bool lookup(uint256 hash, CTransaction& result) const; + + // Estimate fee rate needed to get into the next + // nBlocks + CFeeRate estimateFee(int nBlocks) const; + // Estimate priority needed to get into the next + // nBlocks + double estimatePriority(int nBlocks) const; + // Write/Read estimates to disk + bool WriteFeeEstimates(CAutoFile& fileout) const; + bool ReadFeeEstimates(CAutoFile& filein); }; /** CCoinsView that brings transactions from a memorypool into view. From db41541bc2e679a5c98ab380837c985e0252ab43 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 6 Jun 2014 19:28:34 +0200 Subject: [PATCH 0147/1288] qt: Periodic translation update --- src/qt/locale/bitcoin_el_GR.ts | 147 +++++++++++++++++---------------- src/qt/locale/bitcoin_sl_SI.ts | 38 +++++---- src/qt/locale/bitcoin_th_TH.ts | 96 ++++++++++----------- 3 files changed, 142 insertions(+), 139 deletions(-) diff --git a/src/qt/locale/bitcoin_el_GR.ts b/src/qt/locale/bitcoin_el_GR.ts index 687947e3b9..e957a0088e 100644 --- a/src/qt/locale/bitcoin_el_GR.ts +++ b/src/qt/locale/bitcoin_el_GR.ts @@ -3,11 +3,11 @@ AboutDialog About Bitcoin Core - + Σχετικά με το Bitcoin Core <b>Bitcoin Core</b> version - + <b>Bitcoin Core</b> έκδοση @@ -29,11 +29,11 @@ This product includes software developed by the OpenSSL Project for use in the O The Bitcoin Core developers - + Οι προγραμματιστές του Bitcoin Core (%1-bit) - + (%1-bit) @@ -128,11 +128,11 @@ This product includes software developed by the OpenSSL Project for use in the O Exporting Failed - + Η εξαγωγή απέτυχε There was an error trying to save the address list to %1. - + Παρουσιάστηκε σφάλμα κατά την αποθήκευση της λίστας πορτοφολιών στο %1. @@ -438,7 +438,7 @@ This product includes software developed by the OpenSSL Project for use in the O &About Bitcoin Core - + &Σχετικά με το Bitcoin Core Show the list of used sending addresses and labels @@ -494,11 +494,11 @@ This product includes software developed by the OpenSSL Project for use in the O %1 and %2 - + %1 και %2 %n year(s) - + %n έτος%n έτη %1 behind @@ -608,11 +608,11 @@ Address: %4 Change: - + Ρέστα: (un)select all - + (από)επιλογή όλων Tree mode @@ -672,7 +672,7 @@ Address: %4 Copy quantity - + Αντιγραφή ποσότητας Copy fee @@ -684,11 +684,11 @@ Address: %4 Copy bytes - + Αντιγραφή των byte Copy priority - + Αντιγραφή προτεραιότητας Copy low output @@ -696,51 +696,51 @@ Address: %4 Copy change - + Αντιγραφή των ρέστων highest - + ύψιστη higher - + υψηλότερη high - + ψηλή medium-high - + μεσαία-ψηλή medium - + μεσαία low-medium - + μεσαία-χαμηλή low - + χαμηλή lower - + χαμηλότερη lowest - + χαμηλότατη (%1 locked) - + (%1 κλειδωμένο) none - + κανένα Dust @@ -796,11 +796,12 @@ Address: %4 change from %1 (%2) - + ρέστα από %1 (%2) (change) - + (ρέστα) + @@ -815,7 +816,7 @@ Address: %4 The label associated with this address list entry - + Η ετικέτα που συνδέεται με αυτήν την καταχώρηση στο βιβλίο διευθύνσεων The address associated with this address list entry. This can only be modified for sending addresses. @@ -936,11 +937,11 @@ Address: %4 Welcome to Bitcoin Core. - + Καλώς ήρθατε στο Bitcoin Core. As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - + Καθώς αυτή είναι η πρώτη φορά που εκκινείται το πρόγραμμα, μπορείτε να διαλέξετε πού θα αποθηκεύει το Bitcoin Core τα δεδομένα του. Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. @@ -1030,7 +1031,7 @@ Address: %4 MB - + MB Number of script &verification threads @@ -1082,7 +1083,7 @@ Address: %4 Expert - + Έμπειρος Enable coin &control features @@ -1190,7 +1191,7 @@ Address: %4 none - + κανένα Confirm options reset @@ -1198,7 +1199,7 @@ Address: %4 Client restart required to activate changes. - + Χρειάζεται επανεκκίνηση του προγράμματος για να ενεργοποιηθούν οι αλλαγές. Client will be shutdown, do you want to proceed? @@ -1229,7 +1230,7 @@ Address: %4 Available: - + Διαθέσιμο: Your current spendable balance @@ -1370,11 +1371,11 @@ Address: %4 QRImageWidget &Save Image... - + &Αποθήκευση εικόνας... &Copy Image - + &Αντιγραφή εικόνας Save QR Code @@ -1409,7 +1410,7 @@ Address: %4 General - + Γενικά Using OpenSSL version @@ -1425,7 +1426,7 @@ Address: %4 Name - + Όνομα Number of connections @@ -1457,11 +1458,11 @@ Address: %4 &Network Traffic - + &Κίνηση δικτύου &Clear - + &Εκκαθάριση Totals @@ -1536,7 +1537,7 @@ Address: %4 ReceiveCoinsDialog &Amount: - + &Ποσό: &Label: @@ -1544,7 +1545,7 @@ Address: %4 &Message: - + &Μήνυμα: Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. @@ -1584,7 +1585,7 @@ Address: %4 &Request payment - + &Αίτηση πληρωμής Show the selected request (does the same as double clicking an entry) @@ -1608,7 +1609,7 @@ Address: %4 Copy message - + Αντιγραφή μηνύματος Copy amount @@ -1631,7 +1632,7 @@ Address: %4 &Save Image... - + &Αποθήκευση εικόνας... Request payment to %1 @@ -1698,7 +1699,7 @@ Address: %4 (no amount) - + (κανένα ποσό) @@ -1717,7 +1718,7 @@ Address: %4 automatically selected - + επιλεγμένο αυτόματα Insufficient funds! @@ -1753,7 +1754,7 @@ Address: %4 Change: - + Ρέστα: If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. @@ -1801,7 +1802,7 @@ Address: %4 Copy quantity - + Αντιγραφή ποσότητας Copy amount @@ -1817,11 +1818,11 @@ Address: %4 Copy bytes - + Αντιγραφή των byte Copy priority - + Αντιγραφή προτεραιότητας Copy low output @@ -1829,15 +1830,15 @@ Address: %4 Copy change - + Αντιγραφή των ρέστων Total Amount %1 (= %2) - + Ολικό Ποσό %1 (= %2) or - + ή The recipient address is not valid, please recheck. @@ -1940,7 +1941,7 @@ Address: %4 Remove this entry - + Αφαίρεση αυτής της καταχώρησης Message: @@ -1975,11 +1976,11 @@ Address: %4 ShutdownWindow Bitcoin Core is shutting down... - + Το Bitcoin Core τερματίζεται... Do not shut down the computer until this window disappears. - + Μην απενεργοποιήσετε τον υπολογιστή μέχρι να κλείσει αυτό το παράθυρο. @@ -2133,7 +2134,7 @@ Address: %4 The Bitcoin Core developers - + Οι προγραμματιστές του Bitcoin Core [testnet] @@ -2341,11 +2342,11 @@ Address: %4 Offline - + Offline Unconfirmed - + Ανεπιβεβαίωτες Confirming (%1 of %2 recommended confirmations) @@ -2484,19 +2485,19 @@ Address: %4 Export Transaction History - + Εξαγωγή Ιστορικού Συναλλαγών Exporting Failed - + Η Εξαγωγή Απέτυχε There was an error trying to save the transaction history to %1. - + Yπήρξε σφάλμα κατά την προσπάθεια αποθήκευσης του ιστορικού συναλλαγών στο %1. Exporting Successful - + Επιτυχής εξαγωγή The transaction history was successfully saved to %1. @@ -2547,7 +2548,7 @@ Address: %4 WalletFrame No wallet has been loaded. - + Δεν έχει φορτωθεί πορτοφόλι @@ -2585,7 +2586,7 @@ Address: %4 The wallet data was successfully saved to %1. - + Τα δεδομένα πορτοφολιού αποθηκεύτηκαν με επιτυχία στο %1. Backup Successful @@ -2801,11 +2802,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. (default: 1) - + (προεπιλογή: 1) (default: wallet.dat) - + (προεπιλογή: wallet.dat) <category> can be: @@ -2841,7 +2842,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Connection options: - + Επιλογές σύνδεσης: Corrupted block database detected @@ -3045,7 +3046,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Wallet options: - + Επιλογές πορτοφολιού: Warning: Deprecated argument -debugnet ignored, use -debug=net @@ -3229,7 +3230,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. on startup - + κατά την εκκίνηση version diff --git a/src/qt/locale/bitcoin_sl_SI.ts b/src/qt/locale/bitcoin_sl_SI.ts index 1a46c6ae6c..2ad31e911b 100644 --- a/src/qt/locale/bitcoin_sl_SI.ts +++ b/src/qt/locale/bitcoin_sl_SI.ts @@ -344,7 +344,7 @@ This product includes software developed by the OpenSSL Project for use in the O Modify configuration options for Bitcoin - + Spremeni konfiguracijo nastavitev za Bitcoin Backup wallet to another location @@ -1144,7 +1144,7 @@ Naslov: %4 User Interface &language: - + Vmesnik uporabnika &jezik: The user interface language can be set here. This setting will take effect after restarting Bitcoin. @@ -1487,11 +1487,11 @@ Naslov: %4 Welcome to the Bitcoin RPC console. - + Dobrodošli na Bitcoin RPC konzoli. Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - + Uporabi puščice za gor in dol za navigacijo po zgodovini in <b>Ctrl-L</b> za izbris izpisa na ekranu. Type <b>help</b> for an overview of available commands. @@ -1847,7 +1847,7 @@ Naslov: %4 The total exceeds your balance when the %1 transaction fee is included. - + Celotni znesek presega vaše stanje, ko je zaračunana 1% provizija. Duplicate address found, can only send to each address once per send operation. @@ -2626,7 +2626,7 @@ Naslov: %4 Connect to a node to retrieve peer addresses, and disconnect - + Povežite se z vozliščem za pridobitev naslovov uporabnikov in nato prekinite povezavo. Specify your own public address @@ -2638,7 +2638,7 @@ Naslov: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - + Število sekund za težavo pri vzpostavitvi povezave med uporabniki (privzeto: 86400) An error occurred while setting up the RPC port %u for listening on IPv4: %s @@ -3268,11 +3268,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Unable to bind to %s on this computer (bind returned error %d, %s) - + Nemogoče je povezati s/z %s na tem računalniku (povezava je vrnila napaka %d, %s) Allow DNS lookups for -addnode, -seednode and -connect - + Omogoči DNS poizvedbe za -addnode, -seednode in -connect. Loading addresses... @@ -3296,27 +3296,27 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Invalid -proxy address: '%s' - + Neveljaven -proxy naslov: '%s' Unknown network specified in -onlynet: '%s' - + Neznano omrežje določeno v -onlynet: '%s'. Unknown -socks proxy version requested: %i - + Neznano -socks zahtevan zastopnik različice: %i Cannot resolve -bind address: '%s' - + Nemogoče rešiti -bind naslova: '%s' Cannot resolve -externalip address: '%s' - + Nemogoče rešiti -externalip naslova: '%s' Invalid amount for -paytxfee=<amount>: '%s' - + Neveljavna količina za -paytxfee=<amount>: '%s' Invalid amount @@ -3344,7 +3344,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Cannot write default address - + Ni mogoče zapisati privzetega naslova Rescanning... @@ -3356,7 +3356,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. To use the %s option - + Za uporabo %s opcije Error @@ -3366,7 +3366,9 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. You must set rpcpassword=<password> in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions. - + Potrebno je nastaviti rpcpassword=<password> v nastavitveni datoteki: +%s +Če datoteka ne obstaja jo ustvarite z dovoljenjem, da jo lahko bere samo uporabnik. \ No newline at end of file diff --git a/src/qt/locale/bitcoin_th_TH.ts b/src/qt/locale/bitcoin_th_TH.ts index 96c49b12d0..54e15a75e0 100644 --- a/src/qt/locale/bitcoin_th_TH.ts +++ b/src/qt/locale/bitcoin_th_TH.ts @@ -35,7 +35,7 @@ This product includes software developed by the OpenSSL Project for use in the O AddressBookPage Double-click to edit address or label - ดับเบิลคลิก เพื่อแก้ไขที่อยู่ หรือชื่อ + ดับเบิ้ลคลิก เพื่อแก้ไขที่อยู่ หรือชื่อ Create a new address @@ -75,7 +75,7 @@ This product includes software developed by the OpenSSL Project for use in the O &Delete - ลบ + &ลบ Choose the address to send coins to @@ -119,7 +119,7 @@ This product includes software developed by the OpenSSL Project for use in the O Comma separated file (*.csv) - + คั่นไฟล์ด้วยเครื่องหมายจุลภาค (*.csv) Exporting Failed @@ -165,7 +165,7 @@ This product includes software developed by the OpenSSL Project for use in the O Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - + ใส่รหัสผ่านใหม่ให้กับกระเป๋าเงิน. <br/> กรุณาใช้รหัสผ่านของ <b> 10 หรือแบบสุ่มมากกว่าตัวอักษร </ b> หรือ <b> แปดหรือมากกว่าคำ </ b> Encrypt wallet @@ -173,7 +173,7 @@ This product includes software developed by the OpenSSL Project for use in the O This operation needs your wallet passphrase to unlock the wallet. - + การดำเนินการนี้ต้องมีรหัสผ่านกระเป๋าเงินของคุณเพื่อปลดล็อคกระเป๋าเงิน Unlock wallet @@ -181,7 +181,7 @@ This product includes software developed by the OpenSSL Project for use in the O This operation needs your wallet passphrase to decrypt the wallet. - + การดำเนินการนี้ต้องมีรหัสผ่านกระเป๋าเงินของคุณในการถอดรหัสกระเป๋าเงิน Decrypt wallet @@ -229,7 +229,7 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet encryption failed due to an internal error. Your wallet was not encrypted. - + กระเป๋าเงินเข้ารหัสล้มเหลวเนื่องจากข้อผิดพลาดภายใน กระเป๋าเงินของคุณไม่ได้เข้ารหัส The supplied passphrases do not match. @@ -237,15 +237,15 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet unlock failed - + ปลดล็อคกระเป๋าเงินล้มเหลว The passphrase entered for the wallet decryption was incorrect. - + ป้อนรหัสผ่านสำหรับการถอดรหัสกระเป๋าเงินไม่ถูกต้อง Wallet decryption failed - + ถอดรหัสกระเป๋าเงินล้มเหลว Wallet passphrase was successfully changed. @@ -260,11 +260,11 @@ This product includes software developed by the OpenSSL Project for use in the O Synchronizing with network... - + กำลังทำข้อมูลให้ตรงกันกับเครือข่าย ... &Overview - + &ภาพรวม Node @@ -272,15 +272,15 @@ This product includes software developed by the OpenSSL Project for use in the O Show general overview of wallet - + แสดงภาพรวมทั่วไปของกระเป๋าเงิน &Transactions - + &การทำรายการ Browse transaction history - + เรียกดูประวัติการทำธุรกรรม E&xit @@ -288,11 +288,11 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application - + ออกจากโปรแกรม Show information about Bitcoin - + แสดงข้อมูลเกี่ยวกับ Bitcoin About &Qt @@ -304,7 +304,7 @@ This product includes software developed by the OpenSSL Project for use in the O &Options... - + &ตัวเลือก... &Encrypt Wallet... @@ -352,7 +352,7 @@ This product includes software developed by the OpenSSL Project for use in the O Change the passphrase used for wallet encryption - + เปลี่ยนรหัสผ่านที่ใช้สำหรับการเข้ารหัสกระเป๋าเงิน &Debug window @@ -404,23 +404,23 @@ This product includes software developed by the OpenSSL Project for use in the O &File - + &ไฟล์ &Settings - + &การตั้งค่า &Help - + &ช่วยเหลือ Tabs toolbar - + แถบเครื่องมือ [testnet] - + [testnet] Bitcoin Core @@ -460,7 +460,7 @@ This product includes software developed by the OpenSSL Project for use in the O %n active connection(s) to Bitcoin network - + %n ที่ใช้งานการเชื่อมต่อกับเครือข่าย Bitcoin No block source available... @@ -520,19 +520,19 @@ This product includes software developed by the OpenSSL Project for use in the O Up to date - + ทันสมัย Catching up... - + จับได้... Sent transaction - + รายการที่ส่ง Incoming transaction - + การทำรายการขาเข้า Date: %1 @@ -544,11 +544,11 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>unlocked</b> - + ระเป๋าเงินถูก <b>เข้ารหัส</b> และในขณะนี้ <b>ปลดล็อคแล้ว</b> Wallet is <b>encrypted</b> and currently <b>locked</b> - + กระเป๋าเงินถูก <b>เข้ารหัส</b> และในปัจจุบัน <b>ล็อค </b> A fatal error occurred. Bitcoin can no longer continue safely and will quit. @@ -797,11 +797,11 @@ Address: %4 EditAddressDialog Edit Address - + แก้ไขที่อยู่ &Label - + &ชื่อ The label associated with this address list entry @@ -813,27 +813,27 @@ Address: %4 &Address - + &ที่อยู่ New receiving address - + ที่อยู่ผู้รับใหม่ New sending address - + ที่อยู่ผู้ส่งใหม่ Edit receiving address - + แก้ไขที่อยู่ผู้รับ Edit sending address - + แก้ไขที่อยู่ผู้ส่ง The entered address "%1" is already in the address book. - + ป้อนที่อยู่ "%1" ที่มีอยู่แล้วในสมุดที่อยู่ The entered address "%1" is not a valid Bitcoin address. @@ -841,11 +841,11 @@ Address: %4 Could not unlock wallet. - + ไม่สามารถปลดล็อคกระเป๋าเงิน New key generation failed. - + สร้างกุญแจใหม่ล้มเหลว @@ -992,7 +992,7 @@ Address: %4 OptionsDialog Options - + ตัวเลือก &Main @@ -1207,7 +1207,7 @@ Address: %4 OverviewPage Form - + รูป The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. @@ -1251,7 +1251,7 @@ Address: %4 <b>Recent transactions</b> - + <b>รายการทำธุรกรรมล่าสุด</b> out of sync @@ -1695,7 +1695,7 @@ Address: %4 SendCoinsDialog Send Coins - + ส่งเหรียญ Coin Control Features @@ -2127,7 +2127,7 @@ Address: %4 [testnet] - + [testnet] @@ -2494,7 +2494,7 @@ Address: %4 Comma separated file (*.csv) - + คั่นไฟล์ด้วยเครื่องหมายจุลภาค (*.csv) Confirmed @@ -2544,7 +2544,7 @@ Address: %4 WalletModel Send Coins - + ส่งเหรียญ From dff0e3b9152e66ae569c4f45608677eee11e5351 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sat, 7 Jun 2014 01:22:08 +0200 Subject: [PATCH 0148/1288] [Qt] Improve rpc console history behavior --- src/qt/rpcconsole.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 0d3e11f4ac..199050cc57 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -415,8 +415,8 @@ void RPCConsole::on_lineEdit_returnPressed() { message(CMD_REQUEST, cmd); emit cmdRequest(cmd); - // Truncate history from current position - history.erase(history.begin() + historyPtr, history.end()); + // Remove command, if already in history + history.removeOne(cmd); // Append command to history history.append(cmd); // Enforce maximum history size From 02bec4b268fa32153f26a5f4c089d4f92d887186 Mon Sep 17 00:00:00 2001 From: Drak Date: Sat, 7 Jun 2014 12:57:58 +0100 Subject: [PATCH 0149/1288] Fix compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following compiler warning ``` miner.cpp: In constructor ‘COrphan::COrphan(const CTransaction*)’: miner.cpp:69:14: warning: ‘COrphan::feeRate’ will be initialized after [-Wreorder] CFeeRate feeRate; ^ miner.cpp:68:12: warning: ‘double COrphan::dPriority’ [-Wreorder] double dPriority; ^ miner.cpp:71:5: warning: when initialized here [-Wreorder] COrphan(const CTransaction* ptxIn) : ptx(ptxIn), feeRate(0), dPriority(0) ``` --- src/miner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/miner.cpp b/src/miner.cpp index 4e131c088b..ddd277a9bb 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -65,8 +65,8 @@ class COrphan public: const CTransaction* ptx; set setDependsOn; - double dPriority; CFeeRate feeRate; + double dPriority; COrphan(const CTransaction* ptxIn) : ptx(ptxIn), feeRate(0), dPriority(0) { From 95a93836d8ab3e5f2412503dfafdf54db4f8c1ee Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 8 Jun 2014 01:05:53 +0200 Subject: [PATCH 0150/1288] [Qt] Remove CENT-fee-rule from coin control completely --- src/qt/coincontroldialog.cpp | 24 ++++++------------------ src/qt/forms/coincontroldialog.ui | 2 +- src/qt/forms/sendcoinsdialog.ui | 2 +- src/qt/sendcoinsdialog.cpp | 4 ++-- 4 files changed, 10 insertions(+), 22 deletions(-) diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index e27f1bff97..42d6da7d37 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -71,7 +71,7 @@ CoinControlDialog::CoinControlDialog(QWidget *parent) : QAction *clipboardAfterFeeAction = new QAction(tr("Copy after fee"), this); QAction *clipboardBytesAction = new QAction(tr("Copy bytes"), this); QAction *clipboardPriorityAction = new QAction(tr("Copy priority"), this); - QAction *clipboardLowOutputAction = new QAction(tr("Copy low output"), this); + QAction *clipboardLowOutputAction = new QAction(tr("Copy dust"), this); QAction *clipboardChangeAction = new QAction(tr("Copy change"), this); connect(clipboardQuantityAction, SIGNAL(triggered()), this, SLOT(clipboardQuantity())); @@ -309,7 +309,7 @@ void CoinControlDialog::clipboardPriority() GUIUtil::setClipboard(ui->labelCoinControlPriority->text()); } -// copy label "Low output" to clipboard +// copy label "Dust" to clipboard void CoinControlDialog::clipboardLowOutput() { GUIUtil::setClipboard(ui->labelCoinControlLowOutput->text()); @@ -439,7 +439,6 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) // nPayAmount qint64 nPayAmount = 0; - bool fLowOutput = false; bool fDust = false; CTransaction txDummy; foreach(const qint64 &amount, CoinControlDialog::payAmounts) @@ -448,9 +447,6 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) if (amount > 0) { - if (amount < CENT) - fLowOutput = true; - CTxOut txout(amount, (CScript)vector(24, 0)); txDummy.vout.push_back(txout); if (txout.IsDust(CTransaction::minRelayTxFee)) @@ -571,7 +567,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) QLabel *l7 = dialog->findChild("labelCoinControlLowOutput"); QLabel *l8 = dialog->findChild("labelCoinControlChange"); - // enable/disable "low output" and "change" + // enable/disable "dust" and "change" dialog->findChild("labelCoinControlLowOutputText")->setEnabled(nPayAmount > 0); dialog->findChild("labelCoinControlLowOutput") ->setEnabled(nPayAmount > 0); dialog->findChild("labelCoinControlChangeText") ->setEnabled(nPayAmount > 0); @@ -584,14 +580,13 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) l4->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nAfterFee)); // After Fee l5->setText(((nBytes > 0) ? "~" : "") + QString::number(nBytes)); // Bytes l6->setText(sPriorityLabel); // Priority - l7->setText((fLowOutput ? (fDust ? tr("Dust") : tr("yes")) : tr("no"))); // Low Output / Dust + l7->setText(fDust ? tr("yes") : tr("no")); // Dust l8->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nChange)); // Change // turn labels "red" l5->setStyleSheet((nBytes >= 1000) ? "color:red;" : ""); // Bytes >= 1000 l6->setStyleSheet((dPriority > 0 && !AllowFree(dPriority)) ? "color:red;" : ""); // Priority < "medium" - l7->setStyleSheet((fLowOutput) ? "color:red;" : ""); // Low Output = "yes" - l8->setStyleSheet((nChange > 0 && nChange < CENT) ? "color:red;" : ""); // Change < 0.01BTC + l7->setStyleSheet((fDust) ? "color:red;" : ""); // Dust = "yes" // tool tips QString toolTip1 = tr("This label turns red, if the transaction size is greater than 1000 bytes.") + "

"; @@ -602,21 +597,14 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) toolTip2 += tr("This label turns red, if the priority is smaller than \"medium\".") + "

"; toolTip2 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK())); - QString toolTip3 = tr("This label turns red, if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CENT)) + "

"; - toolTip3 += tr("This means a fee of at least %1 is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK())) + "

"; - toolTip3 += tr("Amounts below 0.546 times the minimum relay fee are shown as dust."); - - QString toolTip4 = tr("This label turns red, if the change is smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CENT)) + "

"; - toolTip4 += tr("This means a fee of at least %1 is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK())); + QString toolTip3 = tr("This label turns red, if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minRelayTxFee.GetFee(546))); l5->setToolTip(toolTip1); l6->setToolTip(toolTip2); l7->setToolTip(toolTip3); - l8->setToolTip(toolTip4); dialog->findChild("labelCoinControlBytesText") ->setToolTip(l5->toolTip()); dialog->findChild("labelCoinControlPriorityText") ->setToolTip(l6->toolTip()); dialog->findChild("labelCoinControlLowOutputText")->setToolTip(l7->toolTip()); - dialog->findChild("labelCoinControlChangeText") ->setToolTip(l8->toolTip()); // Insufficient funds QLabel *label = dialog->findChild("labelCoinControlInsuffFunds"); diff --git a/src/qt/forms/coincontroldialog.ui b/src/qt/forms/coincontroldialog.ui index cd1c0ffa18..67ea3a9d8c 100644 --- a/src/qt/forms/coincontroldialog.ui +++ b/src/qt/forms/coincontroldialog.ui @@ -225,7 +225,7 @@
- Low Output: + Dust: diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui index 4cb1670c79..a631b04670 100644 --- a/src/qt/forms/sendcoinsdialog.ui +++ b/src/qt/forms/sendcoinsdialog.ui @@ -417,7 +417,7 @@ - Low Output: + Dust: diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 23b8ef83e2..b7d74d7039 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -53,7 +53,7 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) : QAction *clipboardAfterFeeAction = new QAction(tr("Copy after fee"), this); QAction *clipboardBytesAction = new QAction(tr("Copy bytes"), this); QAction *clipboardPriorityAction = new QAction(tr("Copy priority"), this); - QAction *clipboardLowOutputAction = new QAction(tr("Copy low output"), this); + QAction *clipboardLowOutputAction = new QAction(tr("Copy dust"), this); QAction *clipboardChangeAction = new QAction(tr("Copy change"), this); connect(clipboardQuantityAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardQuantity())); connect(clipboardAmountAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardAmount())); @@ -478,7 +478,7 @@ void SendCoinsDialog::coinControlClipboardPriority() GUIUtil::setClipboard(ui->labelCoinControlPriority->text()); } -// Coin Control: copy label "Low output" to clipboard +// Coin Control: copy label "Dust" to clipboard void SendCoinsDialog::coinControlClipboardLowOutput() { GUIUtil::setClipboard(ui->labelCoinControlLowOutput->text()); From 16be392975c5c74425821688a8051433cd34b126 Mon Sep 17 00:00:00 2001 From: sandakersmann Date: Sun, 8 Jun 2014 17:37:53 +0200 Subject: [PATCH 0151/1288] Update translation_process.md Qt changed to Bitcoin Core --- doc/translation_process.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/translation_process.md b/doc/translation_process.md index 2f0845a877..61a0a0ffed 100644 --- a/doc/translation_process.md +++ b/doc/translation_process.md @@ -1,7 +1,7 @@ Translations ============ -The Qt GUI can be easily translated into other languages. Here's how we +The Bitcoin Core GUI can be easily translated into other languages. Here's how we handle those translations. Files and Folders From 7a9e0b6460037b72376af293dc87acafe4fca831 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 9 Jun 2014 01:27:56 +0200 Subject: [PATCH 0152/1288] Move checkpoint based heuristic checks to AcceptBlockHeader --- src/main.cpp | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 429473d8f8..cf8c436ded 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2329,28 +2329,6 @@ bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool f return state.Invalid(error("CheckBlockHeader() : block timestamp too far in the future"), REJECT_INVALID, "time-too-new"); - CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(mapBlockIndex); - if (pcheckpoint && block.hashPrevBlock != (chainActive.Tip() ? chainActive.Tip()->GetBlockHash() : uint256(0))) - { - // Extra checks to prevent "fill up memory by spamming with bogus blocks" - int64_t deltaTime = block.GetBlockTime() - pcheckpoint->nTime; - if (deltaTime < 0) - { - return state.DoS(100, error("CheckBlockHeader() : block with timestamp before last checkpoint"), - REJECT_CHECKPOINT, "time-too-old"); - } - bool fOverflow = false; - uint256 bnNewBlock; - bnNewBlock.SetCompact(block.nBits, NULL, &fOverflow); - uint256 bnRequired; - bnRequired.SetCompact(ComputeMinWork(pcheckpoint->nBits, deltaTime)); - if (fOverflow || bnNewBlock > bnRequired) - { - return state.DoS(100, error("CheckBlockHeader() : block with too little proof-of-work"), - REJECT_INVALID, "bad-diffbits"); - } - } - return true; } @@ -2426,6 +2404,28 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex return state.Invalid(error("AcceptBlock() : block is marked invalid"), 0, "duplicate"); } + CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(mapBlockIndex); + if (pcheckpoint && block.hashPrevBlock != (chainActive.Tip() ? chainActive.Tip()->GetBlockHash() : uint256(0))) + { + // Extra checks to prevent "fill up memory by spamming with bogus blocks" + int64_t deltaTime = block.GetBlockTime() - pcheckpoint->nTime; + if (deltaTime < 0) + { + return state.DoS(100, error("CheckBlockHeader() : block with timestamp before last checkpoint"), + REJECT_CHECKPOINT, "time-too-old"); + } + bool fOverflow = false; + uint256 bnNewBlock; + bnNewBlock.SetCompact(block.nBits, NULL, &fOverflow); + uint256 bnRequired; + bnRequired.SetCompact(ComputeMinWork(pcheckpoint->nBits, deltaTime)); + if (fOverflow || bnNewBlock > bnRequired) + { + return state.DoS(100, error("CheckBlockHeader() : block with too little proof-of-work"), + REJECT_INVALID, "bad-diffbits"); + } + } + // Get prev block index CBlockIndex* pindexPrev = NULL; int nHeight = 0; From 77339e5aec4da99f727b80829f9697357b4cec45 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 6 May 2014 00:54:10 +0200 Subject: [PATCH 0153/1288] Get rid of the static chainMostWork (optimization) --- src/main.cpp | 56 +++++++++++++++++++++++++--------------------------- src/main.h | 6 +++--- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 429473d8f8..806f1c20db 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -40,7 +40,6 @@ CTxMemPool mempool; map mapBlockIndex; CChain chainActive; -CChain chainMostWork; int64_t nTimeBestReceived = 0; int nScriptCheckThreads = 0; bool fImporting = false; @@ -398,6 +397,12 @@ CBlockIndex *CChain::FindFork(const CBlockLocator &locator) const { return Genesis(); } +CBlockIndex *CChain::FindFork(CBlockIndex *pindex) const { + while (pindex && !Contains(pindex)) + pindex = pindex->pprev; + return pindex; +} + CCoinsViewCache *pcoinsTip = NULL; CBlockTreeDB *pblocktree = NULL; @@ -2035,23 +2040,17 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew) { return true; } -// Make chainMostWork correspond to the chain with the most work in it, that isn't +// Return the tip of the chain with the most work in it, that isn't // known to be invalid (it's however far from certain to be valid). -void static FindMostWorkChain() { - CBlockIndex *pindexNew = NULL; - - // In case the current best is invalid, do not consider it. - while (chainMostWork.Tip() && (chainMostWork.Tip()->nStatus & BLOCK_FAILED_MASK)) { - setBlockIndexValid.erase(chainMostWork.Tip()); - chainMostWork.SetTip(chainMostWork.Tip()->pprev); - } - +static CBlockIndex* FindMostWorkChain() { do { + CBlockIndex *pindexNew = NULL; + // Find the best candidate header. { std::set::reverse_iterator it = setBlockIndexValid.rbegin(); if (it == setBlockIndexValid.rend()) - return; + return NULL; pindexNew = *it; } @@ -2075,18 +2074,9 @@ void static FindMostWorkChain() { } pindexTest = pindexTest->pprev; } - if (fInvalidAncestor) - continue; - - break; + if (!fInvalidAncestor) + return pindexNew; } while(true); - - // Check whether it's actually an improvement. - if (chainMostWork.Tip() && !CBlockIndexWorkComparator()(chainMostWork.Tip(), pindexNew)) - return; - - // We have a new best. - chainMostWork.SetTip(pindexNew); } // Try to activate to the most-work chain (thereby connecting it). @@ -2095,26 +2085,34 @@ bool ActivateBestChain(CValidationState &state) { CBlockIndex *pindexOldTip = chainActive.Tip(); bool fComplete = false; while (!fComplete) { - FindMostWorkChain(); + CBlockIndex *pindexMostWork = FindMostWorkChain(); + CBlockIndex *pindexFork = chainActive.FindFork(pindexMostWork); fComplete = true; // Check whether we have something to do. - if (chainMostWork.Tip() == NULL) break; + if (pindexMostWork == NULL) break; // Disconnect active blocks which are no longer in the best chain. - while (chainActive.Tip() && !chainMostWork.Contains(chainActive.Tip())) { + while (chainActive.Tip() && chainActive.Tip() != pindexFork) { if (!DisconnectTip(state)) return false; } + // Build list of new blocks to connect. + std::vector vpindexToConnect; + vpindexToConnect.reserve(pindexMostWork->nHeight - (pindexFork ? pindexFork->nHeight : -1)); + while (pindexMostWork && pindexMostWork != pindexFork) { + vpindexToConnect.push_back(pindexMostWork); + pindexMostWork = pindexMostWork->pprev; + } + // Connect new blocks. - while (!chainActive.Contains(chainMostWork.Tip())) { - CBlockIndex *pindexConnect = chainMostWork[chainActive.Height() + 1]; + BOOST_REVERSE_FOREACH(CBlockIndex *pindexConnect, vpindexToConnect) { if (!ConnectTip(state, pindexConnect)) { if (state.IsInvalid()) { // The block violates a consensus rule. if (!state.CorruptionPossible()) - InvalidChainFound(chainMostWork.Tip()); + InvalidChainFound(vpindexToConnect.back()); fComplete = false; state = CValidationState(); break; diff --git a/src/main.h b/src/main.h index 23c8660376..98155989a3 100644 --- a/src/main.h +++ b/src/main.h @@ -1079,14 +1079,14 @@ public: /** Find the last common block between this chain and a locator. */ CBlockIndex *FindFork(const CBlockLocator &locator) const; + + /** Find the last common block between this chain and a block index entry. */ + CBlockIndex *FindFork(CBlockIndex *pindex) const; }; /** The currently-connected chain of blocks. */ extern CChain chainActive; -/** The currently best known chain of headers (some of which may be invalid). */ -extern CChain chainMostWork; - /** Global variable that points to the active CCoinsView (protected by cs_main) */ extern CCoinsViewCache *pcoinsTip; From 4e0eed88acdd41826868c151373068bfad18b84d Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 6 May 2014 01:23:13 +0200 Subject: [PATCH 0154/1288] Allow ActivateBestChain to release its lock on cs_main --- src/main.cpp | 92 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 55 insertions(+), 37 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 806f1c20db..860487dece 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2079,47 +2079,43 @@ static CBlockIndex* FindMostWorkChain() { } while(true); } -// Try to activate to the most-work chain (thereby connecting it). -bool ActivateBestChain(CValidationState &state) { - LOCK(cs_main); +// Try to make some progress towards making pindexMostWork the active block. +static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMostWork) { + AssertLockHeld(cs_main); CBlockIndex *pindexOldTip = chainActive.Tip(); - bool fComplete = false; - while (!fComplete) { - CBlockIndex *pindexMostWork = FindMostWorkChain(); - CBlockIndex *pindexFork = chainActive.FindFork(pindexMostWork); - fComplete = true; + CBlockIndex *pindexFork = chainActive.FindFork(pindexMostWork); - // Check whether we have something to do. - if (pindexMostWork == NULL) break; + // Disconnect active blocks which are no longer in the best chain. + while (chainActive.Tip() && chainActive.Tip() != pindexFork) { + if (!DisconnectTip(state)) + return false; + } - // Disconnect active blocks which are no longer in the best chain. - while (chainActive.Tip() && chainActive.Tip() != pindexFork) { - if (!DisconnectTip(state)) + // Build list of new blocks to connect. + std::vector vpindexToConnect; + vpindexToConnect.reserve(pindexMostWork->nHeight - (pindexFork ? pindexFork->nHeight : -1)); + while (pindexMostWork && pindexMostWork != pindexFork) { + vpindexToConnect.push_back(pindexMostWork); + pindexMostWork = pindexMostWork->pprev; + } + + // Connect new blocks. + BOOST_REVERSE_FOREACH(CBlockIndex *pindexConnect, vpindexToConnect) { + if (!ConnectTip(state, pindexConnect)) { + if (state.IsInvalid()) { + // The block violates a consensus rule. + if (!state.CorruptionPossible()) + InvalidChainFound(vpindexToConnect.back()); + state = CValidationState(); + break; + } else { + // A system error occurred (disk space, database error, ...). return false; - } - - // Build list of new blocks to connect. - std::vector vpindexToConnect; - vpindexToConnect.reserve(pindexMostWork->nHeight - (pindexFork ? pindexFork->nHeight : -1)); - while (pindexMostWork && pindexMostWork != pindexFork) { - vpindexToConnect.push_back(pindexMostWork); - pindexMostWork = pindexMostWork->pprev; - } - - // Connect new blocks. - BOOST_REVERSE_FOREACH(CBlockIndex *pindexConnect, vpindexToConnect) { - if (!ConnectTip(state, pindexConnect)) { - if (state.IsInvalid()) { - // The block violates a consensus rule. - if (!state.CorruptionPossible()) - InvalidChainFound(vpindexToConnect.back()); - fComplete = false; - state = CValidationState(); - break; - } else { - // A system error occurred (disk space, database error, ...). - return false; - } + } + } else { + if (!pindexOldTip || chainActive.Tip()->nChainWork > pindexOldTip->nChainWork) { + // We're in a better position than we were. Return temporarily to release the lock. + break; } } } @@ -2136,6 +2132,28 @@ bool ActivateBestChain(CValidationState &state) { return true; } +bool ActivateBestChain(CValidationState &state) { + do { + boost::this_thread::interruption_point(); + + LOCK(cs_main); + + // Check whether we're done (this could be avoided after the first run, + // but that's not worth optimizing. + CBlockIndex *pindexMostWork = FindMostWorkChain(); + if (pindexMostWork == NULL || pindexMostWork == chainActive.Tip()) + return true; + + if (!ActivateBestChainStep(state, pindexMostWork)) + return false; + + // Check whether we're done now. + if (pindexMostWork == chainActive.Tip()) + return true; + } while(true); + + return true; +} CBlockIndex* AddToBlockIndex(CBlockHeader& block) { From 202e01941c087e0b06a7c18ce344a53ce94e1350 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 7 May 2014 16:45:33 +0200 Subject: [PATCH 0155/1288] Move all post-chaintip-change notifications to ActivateBestChain --- src/main.cpp | 100 +++++++++++++++++++++++++-------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 860487dece..0d79246a11 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1895,6 +1895,11 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C for (unsigned int i = 0; i < block.vtx.size(); i++) g_signals.SyncTransaction(block.GetTxHash(i), block.vtx[i], &block); + // Watch for changes to the previous coinbase transaction. + static uint256 hashPrevBestCoinBase; + g_signals.UpdatedTransaction(hashPrevBestCoinBase); + hashPrevBestCoinBase = block.GetTxHash(0); + return true; } @@ -2082,6 +2087,7 @@ static CBlockIndex* FindMostWorkChain() { // Try to make some progress towards making pindexMostWork the active block. static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMostWork) { AssertLockHeld(cs_main); + bool fInvalidFound = false; CBlockIndex *pindexOldTip = chainActive.Tip(); CBlockIndex *pindexFork = chainActive.FindFork(pindexMostWork); @@ -2107,6 +2113,7 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo if (!state.CorruptionPossible()) InvalidChainFound(vpindexToConnect.back()); state = CValidationState(); + fInvalidFound = true; break; } else { // A system error occurred (disk space, database error, ...). @@ -2120,37 +2127,59 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo } } - if (chainActive.Tip() != pindexOldTip) { - std::string strCmd = GetArg("-blocknotify", ""); - if (!IsInitialBlockDownload() && !strCmd.empty()) - { - boost::replace_all(strCmd, "%s", chainActive.Tip()->GetBlockHash().GetHex()); - boost::thread t(runCommand, strCmd); // thread runs free - } - } + // Callbacks/notifications for a new best chain. + if (fInvalidFound) + CheckForkWarningConditionsOnNewFork(vpindexToConnect.back()); + else + CheckForkWarningConditions(); + + if (!pblocktree->Flush()) + return state.Abort(_("Failed to sync block index")); return true; } bool ActivateBestChain(CValidationState &state) { + CBlockIndex *pindexNewTip = NULL; + CBlockIndex *pindexMostWork = NULL; do { boost::this_thread::interruption_point(); - LOCK(cs_main); + bool fInitialDownload; + { + LOCK(cs_main); + pindexMostWork = FindMostWorkChain(); - // Check whether we're done (this could be avoided after the first run, - // but that's not worth optimizing. - CBlockIndex *pindexMostWork = FindMostWorkChain(); - if (pindexMostWork == NULL || pindexMostWork == chainActive.Tip()) - return true; + // Whether we have anything to do at all. + if (pindexMostWork == NULL || pindexMostWork == chainActive.Tip()) + return true; - if (!ActivateBestChainStep(state, pindexMostWork)) - return false; + if (!ActivateBestChainStep(state, pindexMostWork)) + return false; - // Check whether we're done now. - if (pindexMostWork == chainActive.Tip()) - return true; - } while(true); + pindexNewTip = chainActive.Tip(); + fInitialDownload = IsInitialBlockDownload(); + } + // When we reach this point, we switched to a new tip (stored in pindexNewTip). + + // Notifications/callbacks that can run without cs_main + if (!fInitialDownload) { + uint256 hashNewTip = pindexNewTip->GetBlockHash(); + // Relay inventory, but don't relay old inventory during initial block download. + int nBlockEstimate = Checkpoints::GetTotalBlocksEstimate(); + LOCK(cs_vNodes); + BOOST_FOREACH(CNode* pnode, vNodes) + if (chainActive.Height() > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : nBlockEstimate)) + pnode->PushInventory(CInv(MSG_BLOCK, hashNewTip)); + + std::string strCmd = GetArg("-blocknotify", ""); + if (!strCmd.empty()) { + boost::replace_all(strCmd, "%s", hashNewTip.GetHex()); + boost::thread t(runCommand, strCmd); // thread runs free + } + } + uiInterface.NotifyBlocksChanged(); + } while(pindexMostWork != chainActive.Tip()); return true; } @@ -2215,26 +2244,7 @@ bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBl return state.Abort(_("Failed to write block index")); // New best? - if (!ActivateBestChain(state)) - return false; - - LOCK(cs_main); - if (pindexNew == chainActive.Tip()) - { - // Clear fork warning if its no longer applicable - CheckForkWarningConditions(); - // Notify UI to display prev block's coinbase if it was ours - static uint256 hashPrevBestCoinBase; - g_signals.UpdatedTransaction(hashPrevBestCoinBase); - hashPrevBestCoinBase = block.GetTxHash(0); - } else - CheckForkWarningConditionsOnNewFork(pindexNew); - - if (!pblocktree->Flush()) - return state.Abort(_("Failed to sync block index")); - - uiInterface.NotifyBlocksChanged(); - return true; + return ActivateBestChain(state); } @@ -2554,16 +2564,6 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex, return state.Abort(_("System error: ") + e.what()); } - // Relay inventory, but don't relay old inventory during initial block download - int nBlockEstimate = Checkpoints::GetTotalBlocksEstimate(); - if (chainActive.Tip()->GetBlockHash() == hash) - { - LOCK(cs_vNodes); - BOOST_FOREACH(CNode* pnode, vNodes) - if (chainActive.Height() > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : nBlockEstimate)) - pnode->PushInventory(CInv(MSG_BLOCK, hash)); - } - return true; } From 18e72167ddfeaea95253b62994c6d64b55b35005 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 7 May 2014 17:10:35 +0200 Subject: [PATCH 0156/1288] Push cs_mains down in ProcessBlock --- src/main.cpp | 28 +++++++++++++++++----------- src/miner.cpp | 28 ++++++++++++++-------------- src/rpcserver.cpp | 2 +- 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 0d79246a11..16d1cba6ef 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2243,8 +2243,7 @@ bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBl if (!pblocktree->WriteBlockIndex(CDiskBlockIndex(pindexNew))) return state.Abort(_("Failed to write block index")); - // New best? - return ActivateBestChain(state); + return true; } @@ -2520,7 +2519,6 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex, } int nHeight = pindex->nHeight; - uint256 hash = pindex->GetBlockHash(); // Check that all transactions are finalized BOOST_FOREACH(const CTransaction& tx, block.vtx) @@ -2593,10 +2591,11 @@ void PushGetBlocks(CNode* pnode, CBlockIndex* pindexBegin, uint256 hashEnd) bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBlockPos *dbp) { - AssertLockHeld(cs_main); - // Check for duplicate uint256 hash = pblock->GetHash(); + + { + LOCK(cs_main); if (mapBlockIndex.count(hash)) return state.Invalid(error("ProcessBlock() : already have block %d %s", mapBlockIndex[hash]->nHeight, hash.ToString()), 0, "duplicate"); if (mapOrphanBlocks.count(hash)) @@ -2665,7 +2664,11 @@ bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBl mapOrphanBlocksByPrev.erase(hashPrev); } - LogPrintf("ProcessBlock: ACCEPTED\n"); + } + + if (!ActivateBestChain(state)) + return error("ProcessBlock() : ActivateBestChain failed"); + return true; } @@ -3101,6 +3104,8 @@ bool InitBlockIndex() { CBlockIndex *pindex = AddToBlockIndex(block); if (!ReceivedBlockTransactions(block, state, pindex, blockPos)) return error("LoadBlockIndex() : genesis block not accepted"); + if (!ActivateBestChain(state)) + return error("LoadBlockIndex() : genesis block cannot be activated"); } catch(std::runtime_error &e) { return error("LoadBlockIndex() : failed to initialize block database: %s", e.what()); } @@ -3230,7 +3235,6 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp) // process block if (nBlockPos >= nStartByte) { - LOCK(cs_main); if (dbp) dbp->nPos = nBlockPos; CValidationState state; @@ -3919,10 +3923,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) CInv inv(MSG_BLOCK, block.GetHash()); pfrom->AddInventoryKnown(inv); - LOCK(cs_main); - // Remember who we got this block from. - mapBlockSource[inv.hash] = pfrom->GetId(); - MarkBlockAsReceived(inv.hash, pfrom->GetId()); + { + LOCK(cs_main); + // Remember who we got this block from. + mapBlockSource[inv.hash] = pfrom->GetId(); + MarkBlockAsReceived(inv.hash, pfrom->GetId()); + } CValidationState state; ProcessBlock(state, pfrom, &block); diff --git a/src/miner.cpp b/src/miner.cpp index ddd277a9bb..baaa22c8f3 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -484,22 +484,22 @@ bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey) LOCK(cs_main); if (pblock->hashPrevBlock != chainActive.Tip()->GetBlockHash()) return error("BitcoinMiner : generated block is stale"); - - // Remove key from key pool - reservekey.KeepKey(); - - // Track how many getdata requests this block gets - { - LOCK(wallet.cs_wallet); - wallet.mapRequestCount[pblock->GetHash()] = 0; - } - - // Process this block the same as if we had received it from another node - CValidationState state; - if (!ProcessBlock(state, NULL, pblock)) - return error("BitcoinMiner : ProcessBlock, block not accepted"); } + // Remove key from key pool + reservekey.KeepKey(); + + // Track how many getdata requests this block gets + { + LOCK(wallet.cs_wallet); + wallet.mapRequestCount[pblock->GetHash()] = 0; + } + + // Process this block the same as if we had received it from another node + CValidationState state; + if (!ProcessBlock(state, NULL, pblock)) + return error("BitcoinMiner : ProcessBlock, block not accepted"); + return true; } diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 72a7fe83ef..d4ceb7f995 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -254,7 +254,7 @@ static const CRPCCommand vRPCCommands[] = { "getblocktemplate", &getblocktemplate, true, false, false }, { "getmininginfo", &getmininginfo, true, false, false }, { "getnetworkhashps", &getnetworkhashps, true, false, false }, - { "submitblock", &submitblock, false, false, false }, + { "submitblock", &submitblock, false, true, false }, /* Raw transactions */ { "createrawtransaction", &createrawtransaction, false, false, false }, From f1920e86063d0ed008c6028d8223b0e21889bf75 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 15 Oct 2013 00:34:20 +0200 Subject: [PATCH 0157/1288] Ping automatically every 2 minutes (unconditionally) ... instead of after 30 minutes of no sending, for latency measurement and keep-alive. Also, disconnect if no reply arrives within 20 minutes, instead of 90 of inactivity (for peers supporting the 'pong' message). --- src/main.cpp | 13 ++++++------- src/net.cpp | 18 +++++++++++------- src/net.h | 13 ++++++++++--- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 5d1ff94f5d..dd33f443bf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4296,8 +4296,8 @@ bool SendMessages(CNode* pto, bool fSendTrickle) // RPC ping request by user pingSend = true; } - if (pto->nLastSend && GetTime() - pto->nLastSend > 30 * 60 && pto->vSendMsg.empty()) { - // Ping automatically sent as a keepalive + if (pto->nPingNonceSent == 0 && pto->nPingUsecStart + PING_INTERVAL * 1000000 < GetTimeMicros()) { + // Ping automatically sent as a latency probe & keepalive. pingSend = true; } if (pingSend) { @@ -4305,15 +4305,14 @@ bool SendMessages(CNode* pto, bool fSendTrickle) while (nonce == 0) { RAND_bytes((unsigned char*)&nonce, sizeof(nonce)); } - pto->nPingNonceSent = nonce; pto->fPingQueued = false; + pto->nPingUsecStart = GetTimeMicros(); if (pto->nVersion > BIP0031_VERSION) { - // Take timestamp as close as possible before transmitting ping - pto->nPingUsecStart = GetTimeMicros(); + pto->nPingNonceSent = nonce; pto->PushMessage("ping", nonce); } else { - // Peer is too old to support ping command with nonce, pong will never arrive, disable timing - pto->nPingUsecStart = 0; + // Peer is too old to support ping command with nonce, pong will never arrive. + pto->nPingNonceSent = 0; pto->PushMessage("ping"); } } diff --git a/src/net.cpp b/src/net.cpp index 479f77c469..fe6e9337ae 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1028,23 +1028,27 @@ void ThreadSocketHandler() // // Inactivity checking // - if (pnode->vSendMsg.empty()) - pnode->nLastSendEmpty = GetTime(); - if (GetTime() - pnode->nTimeConnected > 60) + int64_t nTime = GetTime(); + if (nTime - pnode->nTimeConnected > 60) { if (pnode->nLastRecv == 0 || pnode->nLastSend == 0) { LogPrint("net", "socket no message in first 60 seconds, %d %d\n", pnode->nLastRecv != 0, pnode->nLastSend != 0); pnode->fDisconnect = true; } - else if (GetTime() - pnode->nLastSend > 90*60 && GetTime() - pnode->nLastSendEmpty > 90*60) + else if (nTime - pnode->nLastSend > TIMEOUT_INTERVAL) { - LogPrintf("socket not sending\n"); + LogPrintf("socket sending timeout: %is\n", nTime - pnode->nLastSend); pnode->fDisconnect = true; } - else if (GetTime() - pnode->nLastRecv > 90*60) + else if (nTime - pnode->nLastRecv > (pnode->nVersion > BIP0031_VERSION ? TIMEOUT_INTERVAL : 90*60)) { - LogPrintf("socket inactivity timeout\n"); + LogPrintf("socket receive timeout: %is\n", nTime - pnode->nLastRecv); + pnode->fDisconnect = true; + } + else if (pnode->nPingNonceSent && pnode->nPingUsecStart + TIMEOUT_INTERVAL * 1000000 < GetTimeMicros()) + { + LogPrintf("ping timeout: %fs\n", 0.000001 * (GetTimeMicros() - pnode->nPingUsecStart)); pnode->fDisconnect = true; } } diff --git a/src/net.h b/src/net.h index 9fcdbf802b..7a77e55a14 100644 --- a/src/net.h +++ b/src/net.h @@ -28,6 +28,7 @@ #include #include + class CAddrMan; class CBlockIndex; class CNode; @@ -36,6 +37,10 @@ namespace boost { class thread_group; } +/** Time between pings automatically sent out for latency probing and keepalive (in seconds). */ +static const int PING_INTERVAL = 2 * 60; +/** Time after which to disconnect, after waiting for a ping response (or inactivity). */ +static const int TIMEOUT_INTERVAL = 20 * 60; /** The maximum number of entries in an 'inv' protocol message */ static const unsigned int MAX_INV_SZ = 50000; /** -upnp default */ @@ -217,7 +222,6 @@ public: int64_t nLastSend; int64_t nLastRecv; - int64_t nLastSendEmpty; int64_t nTimeConnected; CAddress addr; std::string addrName; @@ -273,10 +277,14 @@ public: CCriticalSection cs_inventory; std::multimap mapAskFor; - // Ping time measurement + // Ping time measurement: + // The pong reply we're expecting, or 0 if no pong expected. uint64_t nPingNonceSent; + // Time (in usec) the last ping was sent, or 0 if no ping was ever sent. int64_t nPingUsecStart; + // Last measured round-trip time. int64_t nPingUsecTime; + // Whether a ping is requested. bool fPingQueued; CNode(SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn = "", bool fInboundIn=false) : ssSend(SER_NETWORK, INIT_PROTO_VERSION), setAddrKnown(5000) @@ -288,7 +296,6 @@ public: nLastRecv = 0; nSendBytes = 0; nRecvBytes = 0; - nLastSendEmpty = GetTime(); nTimeConnected = GetTime(); addr = addrIn; addrName = addrNameIn == "" ? addr.ToStringIPPort() : addrNameIn; From 6dd5edb7de7f5f9aeac71b676c71186405a15376 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 10 Jun 2014 15:01:23 +0200 Subject: [PATCH 0158/1288] Remove unused Print/PrintHex functions You can just use HexStr(script) or script.ToString() for debugging, no need for these extra functions. --- src/script.cpp | 4 ---- src/script.h | 11 ----------- src/util.h | 11 ----------- 3 files changed, 26 deletions(-) diff --git a/src/script.cpp b/src/script.cpp index 381e84d0b7..11cdfef950 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -838,10 +838,6 @@ bool EvalScript(vector >& stack, const CScript& script, co valtype& vchSig = stacktop(-2); valtype& vchPubKey = stacktop(-1); - ////// debug print - //PrintHex(vchSig.begin(), vchSig.end(), "sig: %s\n"); - //PrintHex(vchPubKey.begin(), vchPubKey.end(), "pubkey: %s\n"); - // Subset of script starting at the most recent codeseparator CScript scriptCode(pbegincodehash, pend); diff --git a/src/script.h b/src/script.h index aed2b7a6ad..a282e7dc04 100644 --- a/src/script.h +++ b/src/script.h @@ -691,12 +691,6 @@ public: void SetDestination(const CTxDestination& address); void SetMultisig(int nRequired, const std::vector& keys); - - void PrintHex() const - { - LogPrintf("CScript(%s)\n", HexStr(begin(), end(), true).c_str()); - } - std::string ToString() const { std::string str; @@ -720,11 +714,6 @@ public: return str; } - void print() const - { - LogPrintf("%s\n", ToString()); - } - CScriptID GetID() const { return CScriptID(Hash160(*this)); diff --git a/src/util.h b/src/util.h index b09f9bb15e..e070365790 100644 --- a/src/util.h +++ b/src/util.h @@ -286,17 +286,6 @@ inline std::string HexStr(const T& vch, bool fSpaces=false) return HexStr(vch.begin(), vch.end(), fSpaces); } -template -void PrintHex(const T pbegin, const T pend, const char* pszFormat="%s", bool fSpaces=true) -{ - LogPrintf(pszFormat, HexStr(pbegin, pend, fSpaces).c_str()); -} - -inline void PrintHex(const std::vector& vch, const char* pszFormat="%s", bool fSpaces=true) -{ - LogPrintf(pszFormat, HexStr(vch, fSpaces).c_str()); -} - inline int64_t GetPerformanceCounter() { int64_t nCounter = 0; From ac14bcc1f12d2407516bcdfef57b2740df48381b Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sat, 10 May 2014 14:54:20 +0200 Subject: [PATCH 0159/1288] small formatting, indentation and comment fixes - contains zero code changes --- src/main.cpp | 9 +++------ src/main.h | 1 - src/miner.cpp | 1 - src/miner.h | 3 ++- src/rpcblockchain.cpp | 6 +++--- src/rpcmining.cpp | 2 ++ src/util.cpp | 22 ++++++++++++---------- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 5d1ff94f5d..f53d20fbb4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1985,7 +1985,7 @@ bool static DisconnectTip(CValidationState &state) { BOOST_FOREACH(const CTransaction &tx, block.vtx) { // ignore validation errors in resurrected transactions list removed; - CValidationState stateDummy; + CValidationState stateDummy; if (!tx.IsCoinBase()) if (!AcceptToMemoryPool(mempool, stateDummy, tx, false, NULL)) mempool.remove(tx, removed, true); @@ -2213,7 +2213,6 @@ CBlockIndex* AddToBlockIndex(CBlockHeader& block) return pindexNew; } - // Mark a block as having its data received and checked (up to BLOCK_VALID_TRANSACTIONS). bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBlockIndex *pindexNew, const CDiskBlockPos& pos) { @@ -2246,7 +2245,6 @@ bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBl return true; } - bool FindBlockPos(CValidationState &state, CDiskBlockPos &pos, unsigned int nAddSize, unsigned int nHeight, uint64_t nTime, bool fKnown = false) { bool fUpdatedLast = false; @@ -2341,7 +2339,6 @@ bool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos, unsigne return true; } - bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool fCheckPOW) { // Check proof of work matches claimed amount @@ -4455,8 +4452,8 @@ bool SendMessages(CNode* pto, bool fSendTrickle) // in flight for over two minutes, since we first had a chance to // process an incoming block. int64_t nNow = GetTimeMicros(); - if (!pto->fDisconnect && state.nBlocksInFlight && - state.nLastBlockReceive < state.nLastBlockProcess - BLOCK_DOWNLOAD_TIMEOUT*1000000 && + if (!pto->fDisconnect && state.nBlocksInFlight && + state.nLastBlockReceive < state.nLastBlockProcess - BLOCK_DOWNLOAD_TIMEOUT*1000000 && state.vBlocksInFlight.front().nTime < state.nLastBlockProcess - 2*BLOCK_DOWNLOAD_TIMEOUT*1000000) { LogPrintf("Peer %s is stalling block download, disconnecting\n", state.name.c_str()); pto->fDisconnect = true; diff --git a/src/main.h b/src/main.h index 4ef3800084..e0cbbd25c3 100644 --- a/src/main.h +++ b/src/main.h @@ -1019,7 +1019,6 @@ public: /** RAII wrapper for VerifyDB: Verify consistency of the block and coin databases */ class CVerifyDB { public: - CVerifyDB(); ~CVerifyDB(); bool VerifyDB(int nCheckLevel, int nCheckDepth); diff --git a/src/miner.cpp b/src/miner.cpp index 68abc4a6ef..a0a728fb81 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -677,4 +677,3 @@ void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads) } #endif - diff --git a/src/miner.h b/src/miner.h index 26151f6cd5..dcd61d8fd9 100644 --- a/src/miner.h +++ b/src/miner.h @@ -10,11 +10,12 @@ class CBlock; class CBlockIndex; -struct CBlockTemplate; class CReserveKey; class CScript; class CWallet; +struct CBlockTemplate; + /** Run the miner threads */ void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads); /** Generate a new block, without valid proof-of-work */ diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index ff5057b526..5e0173dcf2 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -3,10 +3,10 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "rpcserver.h" -#include "main.h" -#include "sync.h" #include "checkpoints.h" +#include "main.h" +#include "rpcserver.h" +#include "sync.h" #include diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 837f5336c4..3caf7d89fe 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -13,9 +13,11 @@ #include "db.h" #include "wallet.h" #endif + #include #include + #include "json/json_spirit_utils.h" #include "json/json_spirit_value.h" diff --git a/src/util.cpp b/src/util.cpp index d106b03230..cccf2df484 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -962,13 +962,15 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific) void ClearDatadirCache() { std::fill(&pathCached[0], &pathCached[CChainParams::MAX_NETWORK_TYPES+1], - boost::filesystem::path()); + boost::filesystem::path()); } boost::filesystem::path GetConfigFile() { boost::filesystem::path pathConfigFile(GetArg("-conf", "bitcoin.conf")); - if (!pathConfigFile.is_complete()) pathConfigFile = GetDataDir(false) / pathConfigFile; + if (!pathConfigFile.is_complete()) + pathConfigFile = GetDataDir(false) / pathConfigFile; + return pathConfigFile; } @@ -1028,9 +1030,9 @@ bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest) #endif /* WIN32 */ } - -// Ignores exceptions thrown by boost's create_directory if the requested directory exists. -// Specifically handles case where path p exists, but it wasn't possible for the user to write to the parent directory. +// Ignores exceptions thrown by Boost's create_directory if the requested directory exists. +// Specifically handles case where path p exists, but it wasn't possible for the user to +// write to the parent directory. bool TryCreateDirectory(const boost::filesystem::path& p) { try @@ -1381,19 +1383,19 @@ bool ParseInt32(const std::string& str, int32_t *out) void SetupEnvironment() { - #ifndef WIN32 +#ifndef WIN32 try { - #if BOOST_FILESYSTEM_VERSION == 3 +#if BOOST_FILESYSTEM_VERSION == 3 boost::filesystem::path::codecvt(); // Raises runtime error if current locale is invalid - #else // boost filesystem v2 +#else // boost filesystem v2 std::locale(); // Raises runtime error if current locale is invalid - #endif +#endif } catch(std::runtime_error &e) { setenv("LC_ALL", "C", 1); // Force C locale } - #endif +#endif } std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime) From 1c24187b51c1b8ebbc0295a57d5509effc845984 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 10 Jun 2014 18:34:35 +0200 Subject: [PATCH 0160/1288] remove unused UPnP code from main.h --- src/main.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main.h b/src/main.h index 4ef3800084..d907bdbaff 100644 --- a/src/main.h +++ b/src/main.h @@ -66,12 +66,6 @@ static const int MAX_BLOCKS_IN_TRANSIT_PER_PEER = 128; /** Timeout in seconds before considering a block download peer unresponsive. */ static const unsigned int BLOCK_DOWNLOAD_TIMEOUT = 60; -#ifdef USE_UPNP -static const int fHaveUPnP = true; -#else -static const int fHaveUPnP = false; -#endif - /** "reject" message codes **/ static const unsigned char REJECT_MALFORMED = 0x01; static const unsigned char REJECT_INVALID = 0x10; From 699fe635c6f829e06739e096b0997976e2030ddf Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 10 Jun 2014 19:33:12 +0200 Subject: [PATCH 0161/1288] remove wrong ; in chainparams.h and order includes --- src/chainparams.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chainparams.h b/src/chainparams.h index 988e3ac3a4..8370cc5690 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -6,9 +6,9 @@ #ifndef BITCOIN_CHAIN_PARAMS_H #define BITCOIN_CHAIN_PARAMS_H -#include "uint256.h" #include "core.h" #include "protocol.h" +#include "uint256.h" #include @@ -62,7 +62,7 @@ public: /* Used if GenerateBitcoins is called with a negative number of threads */ int DefaultMinerThreads() const { return nMinerThreads; } - const CBlock& GenesisBlock() const { return genesis; }; + const CBlock& GenesisBlock() const { return genesis; } bool RequireRPCPassword() const { return fRequireRPCPassword; } /* Make miner wait to have peers to avoid wasting work */ bool MiningRequiresPeers() const { return fMiningRequiresPeers; } From 38e324af8693eb0c3d4bf22df9cbb73667f195ce Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 10 Jun 2014 15:43:02 -0400 Subject: [PATCH 0162/1288] build: qt: split locale resources. Fixes non-deterministic distcheck The rcc tool is quirky and only honors files in the same directory as the qrc. When doing an out-of-tree build (as 'make distcheck' does), the generated translation files end up in a different path, so rcc can't find them. Split them up so that rcc is run twice: once for static source files and once for generated files. --- src/Makefile.qt.include | 18 +++++++--- src/qt/bitcoin.cpp | 1 + src/qt/bitcoin.qrc | 73 ------------------------------------- src/qt/bitcoin_locale.qrc | 75 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 78 deletions(-) create mode 100644 src/qt/bitcoin_locale.qrc diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 749b976c44..72c7486258 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -152,6 +152,8 @@ QT_MOC = \ QT_QRC_CPP = qt/qrc_bitcoin.cpp QT_QRC = qt/bitcoin.qrc +QT_QRC_LOCALE_CPP = qt/qrc_bitcoin_locale.cpp +QT_QRC_LOCALE = qt/bitcoin_locale.qrc PROTOBUF_CC = qt/paymentrequest.pb.cc PROTOBUF_H = qt/paymentrequest.pb.h @@ -321,10 +323,10 @@ qt_libbitcoinqt_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \ $(QT_INCLUDES) $(QT_DBUS_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS) qt_libbitcoinqt_a_SOURCES = $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(QT_FORMS_UI) \ - $(QT_QRC) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) + $(QT_QRC) $(QT_QRC_LOCALE) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) nodist_qt_libbitcoinqt_a_SOURCES = $(QT_MOC_CPP) $(QT_MOC) $(PROTOBUF_CC) \ - $(PROTOBUF_H) $(QT_QRC_CPP) + $(PROTOBUF_H) $(QT_QRC_CPP) $(QT_QRC_LOCALE_CPP) # forms/foo.h -> forms/ui_foo.h QT_FORMS_H=$(join $(dir $(QT_FORMS_UI)),$(addprefix ui_, $(notdir $(QT_FORMS_UI:.ui=.h)))) @@ -371,10 +373,16 @@ translate: qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP) @test -n $(LUPDATE) || echo "lupdate is required for updating translations" $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LUPDATE) $^ -locations relative -no-obsolete -ts qt/locale/bitcoin_en.ts -$(QT_QRC_CPP): $(QT_QRC) $(QT_QM) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(PROTOBUF_H) +$(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM) @test -f $(RCC) - $(AM_V_GEN) cd $(srcdir); QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin $< | \ - $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $(abs_builddir)/$@ + @test -f $(@D)/$( $@ + +$(QT_QRC_CPP): $(QT_QRC) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(PROTOBUF_H) + @test -f $(RCC) + $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin $< | \ + $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@ CLEAN_QT = $(nodist_qt_libbitcoinqt_a_SOURCES) $(QT_QM) $(QT_FORMS_H) qt/*.gcda qt/*.gcno diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 45d7a52889..2be8191eb5 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -475,6 +475,7 @@ int main(int argc, char *argv[]) #endif Q_INIT_RESOURCE(bitcoin); + Q_INIT_RESOURCE(bitcoin_locale); BitcoinApplication app(argc, argv); #if QT_VERSION > 0x050100 // Generate high-dpi pixmaps diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index e1c739b022..f38200c7f7 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -84,77 +84,4 @@ res/movies/spinner-033.png res/movies/spinner-034.png - - locale/bitcoin_ach.qm - locale/bitcoin_af_ZA.qm - locale/bitcoin_ar.qm - locale/bitcoin_be_BY.qm - locale/bitcoin_bg.qm - locale/bitcoin_bs.qm - locale/bitcoin_ca_ES.qm - locale/bitcoin_ca.qm - locale/bitcoin_ca@valencia.qm - locale/bitcoin_cmn.qm - locale/bitcoin_cs.qm - locale/bitcoin_cy.qm - locale/bitcoin_da.qm - locale/bitcoin_de.qm - locale/bitcoin_el_GR.qm - locale/bitcoin_en.qm - locale/bitcoin_eo.qm - locale/bitcoin_es_CL.qm - locale/bitcoin_es_DO.qm - locale/bitcoin_es_MX.qm - locale/bitcoin_es.qm - locale/bitcoin_es_UY.qm - locale/bitcoin_et.qm - locale/bitcoin_eu_ES.qm - locale/bitcoin_fa_IR.qm - locale/bitcoin_fa.qm - locale/bitcoin_fi.qm - locale/bitcoin_fr_CA.qm - locale/bitcoin_fr.qm - locale/bitcoin_gl.qm - locale/bitcoin_gu_IN.qm - locale/bitcoin_he.qm - locale/bitcoin_hi_IN.qm - locale/bitcoin_hr.qm - locale/bitcoin_hu.qm - locale/bitcoin_id_ID.qm - locale/bitcoin_it.qm - locale/bitcoin_ja.qm - locale/bitcoin_ka.qm - locale/bitcoin_kk_KZ.qm - locale/bitcoin_ko_KR.qm - locale/bitcoin_ky.qm - locale/bitcoin_la.qm - locale/bitcoin_lt.qm - locale/bitcoin_lv_LV.qm - locale/bitcoin_mn.qm - locale/bitcoin_ms_MY.qm - locale/bitcoin_nb.qm - locale/bitcoin_nl.qm - locale/bitcoin_pam.qm - locale/bitcoin_pl.qm - locale/bitcoin_pt_BR.qm - locale/bitcoin_pt_PT.qm - locale/bitcoin_ro_RO.qm - locale/bitcoin_ru.qm - locale/bitcoin_sah.qm - locale/bitcoin_sk.qm - locale/bitcoin_sl_SI.qm - locale/bitcoin_sq.qm - locale/bitcoin_sr.qm - locale/bitcoin_sv.qm - locale/bitcoin_th_TH.qm - locale/bitcoin_tr.qm - locale/bitcoin_uk.qm - locale/bitcoin_ur_PK.qm - locale/bitcoin_uz@Cyrl.qm - locale/bitcoin_vi.qm - locale/bitcoin_vi_VN.qm - locale/bitcoin_zh_CN.qm - locale/bitcoin_zh_HK.qm - locale/bitcoin_zh_TW.qm - diff --git a/src/qt/bitcoin_locale.qrc b/src/qt/bitcoin_locale.qrc new file mode 100644 index 0000000000..b70a107397 --- /dev/null +++ b/src/qt/bitcoin_locale.qrc @@ -0,0 +1,75 @@ + + + locale/bitcoin_ach.qm + locale/bitcoin_af_ZA.qm + locale/bitcoin_ar.qm + locale/bitcoin_be_BY.qm + locale/bitcoin_bg.qm + locale/bitcoin_bs.qm + locale/bitcoin_ca_ES.qm + locale/bitcoin_ca.qm + locale/bitcoin_ca@valencia.qm + locale/bitcoin_cmn.qm + locale/bitcoin_cs.qm + locale/bitcoin_cy.qm + locale/bitcoin_da.qm + locale/bitcoin_de.qm + locale/bitcoin_el_GR.qm + locale/bitcoin_en.qm + locale/bitcoin_eo.qm + locale/bitcoin_es_CL.qm + locale/bitcoin_es_DO.qm + locale/bitcoin_es_MX.qm + locale/bitcoin_es.qm + locale/bitcoin_es_UY.qm + locale/bitcoin_et.qm + locale/bitcoin_eu_ES.qm + locale/bitcoin_fa_IR.qm + locale/bitcoin_fa.qm + locale/bitcoin_fi.qm + locale/bitcoin_fr_CA.qm + locale/bitcoin_fr.qm + locale/bitcoin_gl.qm + locale/bitcoin_gu_IN.qm + locale/bitcoin_he.qm + locale/bitcoin_hi_IN.qm + locale/bitcoin_hr.qm + locale/bitcoin_hu.qm + locale/bitcoin_id_ID.qm + locale/bitcoin_it.qm + locale/bitcoin_ja.qm + locale/bitcoin_ka.qm + locale/bitcoin_kk_KZ.qm + locale/bitcoin_ko_KR.qm + locale/bitcoin_ky.qm + locale/bitcoin_la.qm + locale/bitcoin_lt.qm + locale/bitcoin_lv_LV.qm + locale/bitcoin_mn.qm + locale/bitcoin_ms_MY.qm + locale/bitcoin_nb.qm + locale/bitcoin_nl.qm + locale/bitcoin_pam.qm + locale/bitcoin_pl.qm + locale/bitcoin_pt_BR.qm + locale/bitcoin_pt_PT.qm + locale/bitcoin_ro_RO.qm + locale/bitcoin_ru.qm + locale/bitcoin_sah.qm + locale/bitcoin_sk.qm + locale/bitcoin_sl_SI.qm + locale/bitcoin_sq.qm + locale/bitcoin_sr.qm + locale/bitcoin_sv.qm + locale/bitcoin_th_TH.qm + locale/bitcoin_tr.qm + locale/bitcoin_uk.qm + locale/bitcoin_ur_PK.qm + locale/bitcoin_uz@Cyrl.qm + locale/bitcoin_vi.qm + locale/bitcoin_vi_VN.qm + locale/bitcoin_zh_CN.qm + locale/bitcoin_zh_HK.qm + locale/bitcoin_zh_TW.qm + + From 77a055d04979dc2b3ec4064e99c69259a4216f12 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 10 Jun 2014 22:26:50 -0400 Subject: [PATCH 0163/1288] build: Add a top-level forwarding target for src/* objects Fixes #3955. It's hackish, but seems to always function as expected. Examples: make src/bitcoind make src/qt/bitcoin-qt make src/libbitcoin.a --- Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 04f8368dd7..719af42ac7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ ACLOCAL_AMFLAGS = -I src/m4 SUBDIRS = src -.PHONY: deploy +.PHONY: deploy FORCE GZIP_ENV="-9n" @@ -53,8 +53,8 @@ $(BITCOIN_WIN_INSTALLER): $(BITCOIND_BIN) $(BITCOIN_QT_BIN) $(BITCOIN_CLI_BIN) @test -f $(MAKENSIS) && $(MAKENSIS) $(top_builddir)/share/setup.nsi || \ echo error: could not build $@ -$(BITCOIND_BIN) $(BITCOIN_QT_BIN) $(BITCOIN_CLI_BIN): - make -C $(dir $@) $(notdir $@) +$(if $(findstring src/,$(MAKECMDGOALS)),$(MAKECMDGOALS), none): FORCE + $(MAKE) -C src $(patsubst src/%,%,$@) $(OSX_APP)/Contents/PkgInfo: $(MKDIR_P) $(@D) From 68ba85fd750e94861440ef15047d571d6b518217 Mon Sep 17 00:00:00 2001 From: Giuseppe Mazzotta Date: Tue, 10 Jun 2014 11:43:27 +0200 Subject: [PATCH 0164/1288] Updated Debian example bitcoin.conf with config from wiki + removed some cruft and updated comments --- contrib/debian/examples/bitcoin.conf | 95 ++++++++++++++++++---------- 1 file changed, 63 insertions(+), 32 deletions(-) diff --git a/contrib/debian/examples/bitcoin.conf b/contrib/debian/examples/bitcoin.conf index 10ec36ae7e..0aa8674af9 100644 --- a/contrib/debian/examples/bitcoin.conf +++ b/contrib/debian/examples/bitcoin.conf @@ -1,79 +1,110 @@ -# bitcoin.conf configuration file. Lines beginning with # are comments. - - +## +## bitcoin.conf configuration file. Lines beginning with # are comments. +## + # Network-related settings: # Run on the test network instead of the real bitcoin network. -#testnet=1 +#testnet=0 + +# Run a regression test network +#regtest=0 # Connect via a socks4 proxy #proxy=127.0.0.1:9050 +############################################################## +## Quick Primer on addnode vs connect ## +## Let's say for instance you use addnode=4.2.2.4 ## +## addnode will connect you to and tell you about the ## +## nodes connected to 4.2.2.4. In addition it will tell ## +## the other nodes connected to it that you exist so ## +## they can connect to you. ## +## connect will not do the above when you 'connect' to it. ## +## It will *only* connect you to 4.2.2.4 and no one else.## +## ## +## So if you're behind a firewall, or have other problems ## +## finding nodes, add some using 'addnode'. ## +## ## +## If you want to stay private, use 'connect' to only ## +## connect to "trusted" nodes. ## +## ## +## If you run multiple nodes on a LAN, there's no need for ## +## all of them to open lots of connections. Instead ## +## 'connect' them all to one node that is port forwarded ## +## and has lots of connections. ## +## Thanks goes to [Noodle] on Freenode. ## +############################################################## + # Use as many addnode= settings as you like to connect to specific peers #addnode=69.164.218.197 #addnode=10.0.0.2:8333 -# ... or use as many connect= settings as you like to connect ONLY -# to specific peers: +# Alternatively use as many connect= settings as you like to connect ONLY to specific peers #connect=69.164.218.197 #connect=10.0.0.1:8333 +# Listening mode, enabled by default except when 'connect' is being used +#listen=1 + # Maximum number of inbound+outbound connections. #maxconnections= - +# # JSON-RPC options (for controlling a running Bitcoin/bitcoind process) +# -# server=1 tells Bitcoin to accept JSON-RPC commands. -#server=1 +# server=1 tells Bitcoin-QT and bitcoind to accept JSON-RPC commands +#server=0 # You must set rpcuser and rpcpassword to secure the JSON-RPC api #rpcuser=Ulysseys -#rpcpassword=YourSuperGreatPasswordNumber_385593 +#rpcpassword=YourSuperGreatPasswordNumber_DO_NOT_USE_THIS_OR_YOU_WILL_GET_ROBBED_385593 -# By default, only RPC connections from localhost are allowed. Specify -# as many rpcallowip= settings as you like to allow connections from -# other hosts (and you may use * as a wildcard character): -#rpcallowip=10.1.1.34 -#rpcallowip=192.168.1.* +# How many seconds bitcoin will wait for a complete RPC HTTP request. +# after the HTTP connection is established. +#rpctimeout=30 + +# By default, only RPC connections from localhost are allowed. +# Specify as many rpcallowip= settings as you like to allow connections from other hosts, +# either as a single IPv4/IPv6 or with a subnet specification. + +# NOTE: opening up the RPC port to hosts outside your local trusted network is NOT RECOMMENDED, +# because the rpcpassword is transmitted over the network unencrypted. + +# server=1 tells Bitcoin-QT to accept JSON-RPC commands. +# it is also read by bitcoind to determine if RPC should be enabled +#rpcallowip=10.1.1.34/255.255.255.0 +#rpcallowip=1.2.3.4/24 +#rpcallowip=2001:db8:85a3:0:0:8a2e:370:7334/96 # Listen for RPC connections on this TCP port: -rpcport=8332 +#rpcport=8332 # You can use Bitcoin or bitcoind to send commands to Bitcoin/bitcoind # running on another host using this option: -rpcconnect=127.0.0.1 +#rpcconnect=127.0.0.1 # Use Secure Sockets Layer (also known as TLS or HTTPS) to communicate # with Bitcoin -server or bitcoind #rpcssl=1 # OpenSSL settings used when rpcssl=1 -rpcsslciphers=TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH -rpcsslcertificatechainfile=server.cert -rpcsslprivatekeyfile=server.pem +#rpcsslciphers=TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH +#rpcsslcertificatechainfile=server.cert +#rpcsslprivatekeyfile=server.pem # Miscellaneous options -# Set gen=1 to attempt to generate bitcoins -gen=0 - -# Use SSE instructions to try to generate bitcoins faster. -#4way=1 - # Pre-generate this many public/private key pairs, so wallet backups will be valid for # both prior transactions and several dozen future transactions. -keypool=100 +#keypool=100 # Pay an optional transaction fee every time you send bitcoins. Transactions with fees # are more likely than free transactions to be included in generated blocks, so may # be validated sooner. -paytxfee=0.00 - -# Allow direct connections for the 'pay via IP address' feature. -#allowreceivebyip=1 - +#paytxfee=0.00 # User interface options From 56b07d2dcdec336173b866210c535439b03416a1 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 29 May 2014 13:02:22 +0200 Subject: [PATCH 0165/1288] [Qt] allow setting listen via GUI - add DEFAULT_LISTEN in net.h and use in the code (shared setting between core and GUI) Important: This makes it obvious, that we need to re-think the settings/options handling, as GUI settings are processed before any parameter-interaction (which is mostly important for network stuff) in AppInit2()! --- src/init.cpp | 2 +- src/net.h | 2 ++ src/qt/forms/optionsdialog.ui | 10 ++++++++++ src/qt/optionsdialog.cpp | 2 ++ src/qt/optionsmodel.cpp | 13 +++++++++++++ src/qt/optionsmodel.h | 1 + 6 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index 1d86cf087d..528c3df064 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -766,7 +766,7 @@ bool AppInit2(boost::thread_group& threadGroup) } // see Step 2: parameter interactions for more information about these - fListen = GetBoolArg("-listen", true); + fListen = GetBoolArg("-listen", DEFAULT_LISTEN); fDiscover = GetBoolArg("-discover", true); fNameLookup = GetBoolArg("-dns", true); diff --git a/src/net.h b/src/net.h index 9fcdbf802b..11744aa7c4 100644 --- a/src/net.h +++ b/src/net.h @@ -38,6 +38,8 @@ namespace boost { /** The maximum number of entries in an 'inv' protocol message */ static const unsigned int MAX_INV_SZ = 50000; +/** -listen default */ +static const bool DEFAULT_LISTEN = true; /** -upnp default */ #ifdef USE_UPNP static const bool DEFAULT_UPNP = USE_UPNP; diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 0103842e02..0c5b8895aa 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -242,6 +242,16 @@ + + + + Accept connections from outside + + + Allow incoming connections + + + diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 1cbf5f8810..abfd4123e0 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -151,6 +151,7 @@ void OptionsDialog::setModel(OptionsModel *model) /* Wallet */ connect(ui->spendZeroConfChange, SIGNAL(clicked(bool)), this, SLOT(showRestartWarning())); /* Network */ + connect(ui->allowIncoming, SIGNAL(clicked(bool)), this, SLOT(showRestartWarning())); connect(ui->connectSocks, SIGNAL(clicked(bool)), this, SLOT(showRestartWarning())); /* Display */ connect(ui->lang, SIGNAL(valueChanged()), this, SLOT(showRestartWarning())); @@ -171,6 +172,7 @@ void OptionsDialog::setMapper() /* Network */ mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP); + mapper->addMapping(ui->allowIncoming, OptionsModel::Listen); mapper->addMapping(ui->connectSocks, OptionsModel::ProxyUse); mapper->addMapping(ui->proxyIp, OptionsModel::ProxyIP); diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index f3a5f37bb3..4dafd9d2af 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -110,6 +110,11 @@ void OptionsModel::Init() if (!SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool())) addOverriddenOption("-upnp"); + if (!settings.contains("fListen")) + settings.setValue("fListen", DEFAULT_LISTEN); + if (!SoftSetBoolArg("-listen", settings.value("fListen").toBool())) + addOverriddenOption("-listen"); + if (!settings.contains("fUseProxy")) settings.setValue("fUseProxy", false); if (!settings.contains("addrProxy")) @@ -214,6 +219,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const return settings.value("nDatabaseCache"); case ThreadsScriptVerif: return settings.value("nThreadsScriptVerif"); + case Listen: + return settings.value("fListen"); default: return QVariant(); } @@ -339,6 +346,12 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in setRestartRequired(true); } break; + case Listen: + if (settings.value("fListen") != value) { + settings.setValue("fListen", value); + setRestartRequired(true); + } + break; default: break; } diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index f05e3e92de..2596682d07 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -42,6 +42,7 @@ public: ThreadsScriptVerif, // int DatabaseCache, // int SpendZeroConfChange, // bool + Listen, // bool OptionIDRowCount, }; From 4aaa01783d4e3592db456fb2db05207c3c278244 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 11 Jun 2014 12:16:26 +0200 Subject: [PATCH 0166/1288] rework help messages for fee-related options - mention the units and show the default for -paytxfee --- src/init.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 1d86cf087d..b85078832f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -253,7 +253,7 @@ std::string HelpMessage(HelpMessageMode hmm) #ifdef ENABLE_WALLET strUsage += "\n" + _("Wallet options:") + "\n"; strUsage += " -disablewallet " + _("Do not load the wallet and disable wallet RPC calls") + "\n"; - strUsage += " -paytxfee= " + _("Fee per kB to add to transactions you send") + "\n"; + strUsage += " -paytxfee= " + strprintf(_("Fee (in BTC/kB) to add to transactions you send (default: %s)"), FormatMoney(payTxFee.GetFeePerK())) + "\n"; strUsage += " -rescan " + _("Rescan the block chain for missing wallet transactions") + " " + _("on startup") + "\n"; strUsage += " -salvagewallet " + _("Attempt to recover private keys from a corrupt wallet.dat") + " " + _("on startup") + "\n"; strUsage += " -spendzeroconfchange " + _("Spend unconfirmed change when sending transactions (default: 1)") + "\n"; @@ -291,8 +291,8 @@ std::string HelpMessage(HelpMessageMode hmm) strUsage += " -limitfreerelay= " + _("Continuously rate-limit free transactions to *1000 bytes per minute (default:15)") + "\n"; strUsage += " -maxsigcachesize= " + _("Limit size of signature cache to entries (default: 50000)") + "\n"; } - strUsage += " -mintxfee= " + _("Fees smaller than this are considered zero fee (for transaction creation) (default:") + " " + FormatMoney(CTransaction::minTxFee.GetFeePerK()) + ")" + "\n"; - strUsage += " -minrelaytxfee= " + _("Fees smaller than this are considered zero fee (for relaying) (default:") + " " + FormatMoney(CTransaction::minRelayTxFee.GetFeePerK()) + ")" + "\n"; + strUsage += " -mintxfee= " + strprintf(_("Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s)"), FormatMoney(CTransaction::minTxFee.GetFeePerK())) + "\n"; + strUsage += " -minrelaytxfee= " + strprintf(_("Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s)"), FormatMoney(CTransaction::minRelayTxFee.GetFeePerK())) + "\n"; strUsage += " -printtoconsole " + _("Send trace/debug info to console instead of debug.log file") + "\n"; if (GetBoolArg("-help-debug", false)) { From 5bd6c31bd63261f16d3d1b40512a8bb51b28abcf Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sat, 24 May 2014 11:14:52 +0200 Subject: [PATCH 0167/1288] small cleanup of net - remove an unneded else in ConnectNode() - make 0 a double and change to 0.0 in ConnectNode() - rename strDest to pszDest in OpenNetworkConnection() - remove an unneded call to our REF() macro in BindListenPort() - small style cleanups and removal of unneeded new-lines --- src/net.cpp | 26 +++++++++++--------------- src/net.h | 4 ++-- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 479f77c469..07a2848e9c 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -469,11 +469,10 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest) } } - /// debug print LogPrint("net", "trying connection %s lastseen=%.1fhrs\n", pszDest ? pszDest : addrConnect.ToString(), - pszDest ? 0 : (double)(GetAdjustedTime() - addrConnect.nTime)/3600.0); + pszDest ? 0.0 : (double)(GetAdjustedTime() - addrConnect.nTime)/3600.0); // Connect SOCKET hSocket; @@ -505,10 +504,8 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest) pnode->nTimeConnected = GetTime(); return pnode; } - else - { - return NULL; - } + + return NULL; } void CNode::CloseSocketDisconnect() @@ -535,7 +532,6 @@ void CNode::Cleanup() { } - void CNode::PushVersion() { int nBestHeight = g_signals.GetHeight().get_value_or(0); @@ -1425,21 +1421,22 @@ void ThreadOpenAddedConnections() } // if successful, this moves the passed grant to the constructed node -bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound, const char *strDest, bool fOneShot) +bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound, const char *pszDest, bool fOneShot) { // // Initiate outbound network connection // boost::this_thread::interruption_point(); - if (!strDest) + if (!pszDest) { if (IsLocal(addrConnect) || FindNode((CNetAddr)addrConnect) || CNode::IsBanned(addrConnect) || FindNode(addrConnect.ToStringIPPort().c_str())) return false; - if (strDest && FindNode(strDest)) + } + if (pszDest && FindNode(pszDest)) return false; - CNode* pnode = ConnectNode(addrConnect, strDest); + CNode* pnode = ConnectNode(addrConnect, pszDest); boost::this_thread::interruption_point(); if (!pnode) @@ -1575,7 +1572,7 @@ bool BindListenPort(const CService &addrBind, string& strError) socklen_t len = sizeof(sockaddr); if (!addrBind.GetSockAddr((struct sockaddr*)&sockaddr, &len)) { - strError = strprintf("Error: bind address family for %s not supported", addrBind.ToString()); + strError = strprintf("Error: Bind address family for %s not supported", addrBind.ToString()); LogPrintf("%s\n", strError); return false; } @@ -1769,9 +1766,8 @@ bool StopNode() class CNetCleanup { public: - CNetCleanup() - { - } + CNetCleanup() {} + ~CNetCleanup() { // Close sockets diff --git a/src/net.h b/src/net.h index 9fcdbf802b..df7555d476 100644 --- a/src/net.h +++ b/src/net.h @@ -54,11 +54,11 @@ bool GetMyExternalIP(CNetAddr& ipRet); void AddressCurrentlyConnected(const CService& addr); CNode* FindNode(const CNetAddr& ip); CNode* FindNode(const CService& ip); -CNode* ConnectNode(CAddress addrConnect, const char *strDest = NULL); +CNode* ConnectNode(CAddress addrConnect, const char *pszDest = NULL); bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false); void MapPort(bool fUseUPnP); unsigned short GetListenPort(); -bool BindListenPort(const CService &bindAddr, std::string& strError=REF(std::string())); +bool BindListenPort(const CService &bindAddr, std::string& strError); void StartNode(boost::thread_group& threadGroup); bool StopNode(); void SocketSendData(CNode *pnode); From 634bd61b76c9d03d7ce7dfab4e4a48f4b70f282a Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 11 Jun 2014 12:39:09 +0200 Subject: [PATCH 0168/1288] convert an if into an else if in OpenNetworkConnection() --- src/net.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 07a2848e9c..ac0da26de9 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1432,8 +1432,7 @@ bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOu FindNode((CNetAddr)addrConnect) || CNode::IsBanned(addrConnect) || FindNode(addrConnect.ToStringIPPort().c_str())) return false; - } - if (pszDest && FindNode(pszDest)) + } else if (FindNode(pszDest)) return false; CNode* pnode = ConnectNode(addrConnect, pszDest); From 96b733e99694e74dcd38b16112655f7e1ea2d43b Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 3 Jun 2014 16:12:19 +0200 Subject: [PATCH 0169/1288] Add `-version` option to get just the version Adds a `-version` or `--version` option to print just the version of the program for bitcoind, bitcoin-cli and bitcoin-qt. Also make it that `-help` can be used to display the help (as well as existing `--help`). Up to now, `-help` was the only option that didn't work with either one or two dashes. --- src/bitcoin-cli.cpp | 18 ++++++++++-------- src/bitcoind.cpp | 25 ++++++++++++++----------- src/qt/bitcoin.cpp | 4 ++-- src/qt/bitcoingui.cpp | 2 +- src/qt/utilitydialog.cpp | 19 ++++++++++--------- src/qt/utilitydialog.h | 5 +---- 6 files changed, 38 insertions(+), 35 deletions(-) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 29efdfa821..0bb71329f5 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -39,16 +39,18 @@ static bool AppInitRPC(int argc, char* argv[]) return false; } - if (argc<2 || mapArgs.count("-?") || mapArgs.count("--help")) + if (argc<2 || mapArgs.count("-?") || mapArgs.count("-help") || mapArgs.count("-version")) { - // First part of help message is specific to RPC client - std::string strUsage = _("Bitcoin Core RPC client version") + " " + FormatFullVersion() + "\n\n" + - _("Usage:") + "\n" + - " bitcoin-cli [options] [params] " + _("Send command to Bitcoin Core") + "\n" + - " bitcoin-cli [options] help " + _("List commands") + "\n" + - " bitcoin-cli [options] help " + _("Get help for a command") + "\n"; + std::string strUsage = _("Bitcoin Core RPC client version") + " " + FormatFullVersion() + "\n"; + if (!mapArgs.count("-version")) + { + strUsage += "\n" + _("Usage:") + "\n" + + " bitcoin-cli [options] [params] " + _("Send command to Bitcoin Core") + "\n" + + " bitcoin-cli [options] help " + _("List commands") + "\n" + + " bitcoin-cli [options] help " + _("Get help for a command") + "\n"; - strUsage += "\n" + HelpMessageCli(true); + strUsage += "\n" + HelpMessageCli(true); + } fprintf(stdout, "%s", strUsage.c_str()); return false; diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 704332c39b..99dc9d726d 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -83,19 +83,22 @@ bool AppInit(int argc, char* argv[]) return false; } - if (mapArgs.count("-?") || mapArgs.count("--help")) + if (mapArgs.count("-?") || mapArgs.count("-help") || mapArgs.count("-version")) { - // First part of help message is specific to bitcoind / RPC client - std::string strUsage = _("Bitcoin Core Daemon") + " " + _("version") + " " + FormatFullVersion() + "\n\n" + - _("Usage:") + "\n" + - " bitcoind [options] " + _("Start Bitcoin Core Daemon") + "\n" + - _("Usage (deprecated, use bitcoin-cli):") + "\n" + - " bitcoind [options] [params] " + _("Send command to Bitcoin Core") + "\n" + - " bitcoind [options] help " + _("List commands") + "\n" + - " bitcoind [options] help " + _("Get help for a command") + "\n"; + std::string strUsage = _("Bitcoin Core Daemon") + " " + _("version") + " " + FormatFullVersion() + "\n"; - strUsage += "\n" + HelpMessage(HMM_BITCOIND); - strUsage += "\n" + HelpMessageCli(false); + if (!mapArgs.count("-version")) + { + strUsage += "\n" + _("Usage:") + "\n" + + " bitcoind [options] " + _("Start Bitcoin Core Daemon") + "\n" + + _("Usage (deprecated, use bitcoin-cli):") + "\n" + + " bitcoind [options] [params] " + _("Send command to Bitcoin Core") + "\n" + + " bitcoind [options] help " + _("List commands") + "\n" + + " bitcoind [options] help " + _("Get help for a command") + "\n"; + + strUsage += "\n" + HelpMessage(HMM_BITCOIND); + strUsage += "\n" + HelpMessageCli(false); + } fprintf(stdout, "%s", strUsage.c_str()); return false; diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 2be8191eb5..387f6ede4b 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -503,9 +503,9 @@ int main(int argc, char *argv[]) // Show help message immediately after parsing command-line options (for "-lang") and setting locale, // but before showing splash screen. - if (mapArgs.count("-?") || mapArgs.count("--help")) + if (mapArgs.count("-?") || mapArgs.count("-help") || mapArgs.count("-version")) { - HelpMessageDialog help(NULL); + HelpMessageDialog help(NULL, mapArgs.count("-version")); help.showOrPrint(); return 1; } diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 3469f990ac..847a3ab8f1 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -556,7 +556,7 @@ void BitcoinGUI::aboutClicked() void BitcoinGUI::showHelpMessageClicked() { - HelpMessageDialog *help = new HelpMessageDialog(this); + HelpMessageDialog *help = new HelpMessageDialog(this, false); help->setAttribute(Qt::WA_DeleteOnClose); help->show(); } diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index 01b710e876..435c6a4368 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -57,21 +57,20 @@ void AboutDialog::on_buttonBox_accepted() } /** "Help message" dialog box */ -HelpMessageDialog::HelpMessageDialog(QWidget *parent) : +HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool versionOnly) : QDialog(parent), ui(new Ui::HelpMessageDialog) { ui->setupUi(this); GUIUtil::restoreWindowGeometry("nHelpMessageDialogWindow", this->size(), this); - header = tr("Bitcoin Core") + " " + tr("version") + " " + - QString::fromStdString(FormatFullVersion()) + "\n\n" + - tr("Usage:") + "\n" + + QString version = tr("Bitcoin Core") + " " + tr("version") + " " + QString::fromStdString(FormatFullVersion()); + QString header = tr("Usage:") + "\n" + " bitcoin-qt [" + tr("command-line options") + "] " + "\n"; - coreOptions = QString::fromStdString(HelpMessage(HMM_BITCOIN_QT)); + QString coreOptions = QString::fromStdString(HelpMessage(HMM_BITCOIN_QT)); - uiOptions = tr("UI options") + ":\n" + + QString uiOptions = tr("UI options") + ":\n" + " -choosedatadir " + tr("Choose data directory on startup (default: 0)") + "\n" + " -lang= " + tr("Set language, for example \"de_DE\" (default: system locale)") + "\n" + " -min " + tr("Start minimized") + "\n" + @@ -81,7 +80,10 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent) : ui->helpMessageLabel->setFont(GUIUtil::bitcoinAddressFont()); // Set help message text - ui->helpMessageLabel->setText(header + "\n" + coreOptions + "\n" + uiOptions); + if(versionOnly) + ui->helpMessageLabel->setText(version); + else + ui->helpMessageLabel->setText(version + "\n" + header + "\n" + coreOptions + "\n" + uiOptions); } HelpMessageDialog::~HelpMessageDialog() @@ -93,8 +95,7 @@ HelpMessageDialog::~HelpMessageDialog() void HelpMessageDialog::printToConsole() { // On other operating systems, the expected action is to print the message to the console. - QString strUsage = header + "\n" + coreOptions + "\n" + uiOptions + "\n"; - fprintf(stdout, "%s", strUsage.toStdString().c_str()); + fprintf(stdout, "%s\n", qPrintable(ui->helpMessageLabel->text())); } void HelpMessageDialog::showOrPrint() diff --git a/src/qt/utilitydialog.h b/src/qt/utilitydialog.h index 874daf6a7f..cc23420169 100644 --- a/src/qt/utilitydialog.h +++ b/src/qt/utilitydialog.h @@ -40,7 +40,7 @@ class HelpMessageDialog : public QDialog Q_OBJECT public: - explicit HelpMessageDialog(QWidget *parent); + explicit HelpMessageDialog(QWidget *parent, bool versionOnly); ~HelpMessageDialog(); void printToConsole(); @@ -48,9 +48,6 @@ public: private: Ui::HelpMessageDialog *ui; - QString header; - QString coreOptions; - QString uiOptions; private slots: void on_okButton_accepted(); From 97789d374c40f4f7fc8feb19c1235ca09ad2e06e Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 10 Jun 2014 16:02:29 +0200 Subject: [PATCH 0170/1288] util: Add function FormatParagraph to format paragraph to fixed-width This is to be used for the `-version` and `-help` messages. --- src/test/util_tests.cpp | 11 +++++++++++ src/util.cpp | 35 +++++++++++++++++++++++++++++++++++ src/util.h | 5 +++++ 3 files changed, 51 insertions(+) diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 0e53a57593..0b071361d8 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -351,4 +351,15 @@ BOOST_AUTO_TEST_CASE(test_ParseInt32) BOOST_CHECK(!ParseInt32("32482348723847471234", NULL)); } +BOOST_AUTO_TEST_CASE(test_FormatParagraph) +{ + BOOST_CHECK_EQUAL(FormatParagraph("", 79, 0), ""); + BOOST_CHECK_EQUAL(FormatParagraph("test", 79, 0), "test"); + BOOST_CHECK_EQUAL(FormatParagraph(" test", 79, 0), "test"); + BOOST_CHECK_EQUAL(FormatParagraph("test test", 79, 0), "test test"); + BOOST_CHECK_EQUAL(FormatParagraph("test test", 4, 0), "test\ntest"); + BOOST_CHECK_EQUAL(FormatParagraph("testerde test ", 4, 0), "testerde\ntest"); + BOOST_CHECK_EQUAL(FormatParagraph("test test", 4, 4), "test\n test"); +} + BOOST_AUTO_TEST_SUITE_END() diff --git a/src/util.cpp b/src/util.cpp index cccf2df484..3e3dabb678 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1407,3 +1407,38 @@ std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime) ss << boost::posix_time::from_time_t(nTime); return ss.str(); } + +std::string FormatParagraph(const std::string in, size_t width, size_t indent) +{ + std::stringstream out; + size_t col = 0; + size_t ptr = 0; + while(ptr < in.size()) + { + // Find beginning of next word + ptr = in.find_first_not_of(' ', ptr); + if (ptr == std::string::npos) + break; + // Find end of next word + size_t endword = in.find_first_of(' ', ptr); + if (endword == std::string::npos) + endword = in.size(); + // Add newline and indentation if this wraps over the allowed width + if (col > 0) + { + if ((col + endword - ptr) > width) + { + out << '\n'; + for(size_t i=0; i Date: Wed, 11 Jun 2014 14:56:08 +0200 Subject: [PATCH 0171/1288] remove unused code from getblockchaininfo() --- src/rpcblockchain.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 5e0173dcf2..2a21fb462a 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -450,9 +450,6 @@ Value getblockchaininfo(const Array& params, bool fHelp) + HelpExampleRpc("getblockchaininfo", "") ); - proxyType proxy; - GetProxy(NET_IPV4, proxy); - Object obj; std::string chain = Params().DataDir(); if(chain.empty()) From c30329adfaa6d3e1e7150b05b69c4691248300b1 Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Thu, 12 Jun 2014 00:36:53 +0200 Subject: [PATCH 0172/1288] Add testnet DNS seed of Alex Kotenko. --- src/chainparams.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 3f4d7f7064..1749dd6ff9 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -212,6 +212,7 @@ public: vFixedSeeds.clear(); vSeeds.clear(); + vSeeds.push_back(CDNSSeedData("alexykot.me", "testnet-seed.alexykot.me")); vSeeds.push_back(CDNSSeedData("bitcoin.petertodd.org", "testnet-seed.bitcoin.petertodd.org")); vSeeds.push_back(CDNSSeedData("bluematt.me", "testnet-seed.bluematt.me")); From 88df548dde280efac8eb33520f8192885455bc03 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 11 Jun 2014 23:20:37 -0400 Subject: [PATCH 0173/1288] base58: add paranoid return value checks --- src/base58.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/base58.cpp b/src/base58.cpp index 5975703887..1bd64684e5 100644 --- a/src/base58.cpp +++ b/src/base58.cpp @@ -114,9 +114,8 @@ std::string EncodeBase58Check(const std::vector& vchIn) { } bool DecodeBase58Check(const char* psz, std::vector& vchRet) { - if (!DecodeBase58(psz, vchRet)) - return false; - if (vchRet.size() < 4) + if (!DecodeBase58(psz, vchRet) || + (vchRet.size() < 4)) { vchRet.clear(); return false; @@ -154,8 +153,8 @@ void CBase58Data::SetData(const std::vector &vchVersionIn, const bool CBase58Data::SetString(const char* psz, unsigned int nVersionBytes) { std::vector vchTemp; - DecodeBase58Check(psz, vchTemp); - if (vchTemp.size() < nVersionBytes) { + bool rc58 = DecodeBase58Check(psz, vchTemp); + if ((!rc58) || (vchTemp.size() < nVersionBytes)) { vchData.clear(); vchVersion.clear(); return false; From f5ae6c98260fdd3c0ca203ce67c6467d9cdaea95 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 11 Jun 2014 12:23:49 +0200 Subject: [PATCH 0174/1288] add NetworkIDString() to chainparams - returns the BIP70 network string - use that new function in the core and GUI code and remove unused code and functions --- src/chainparams.cpp | 3 +++ src/chainparams.h | 3 +++ src/qt/clientmodel.cpp | 8 -------- src/qt/clientmodel.h | 2 -- src/qt/paymentserver.cpp | 13 +------------ src/qt/paymentserver.h | 1 - src/qt/rpcconsole.cpp | 2 +- src/rpcblockchain.cpp | 15 ++++++--------- 8 files changed, 14 insertions(+), 33 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 1749dd6ff9..47136eeeea 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -99,6 +99,7 @@ class CMainParams : public CChainParams { public: CMainParams() { networkID = CChainParams::MAIN; + strNetworkID = "main"; // The message start string is designed to be unlikely to occur in normal data. // The characters are rarely used upper ASCII, not valid as UTF-8, and produce // a large 4-byte int at any alignment. @@ -189,6 +190,7 @@ class CTestNetParams : public CMainParams { public: CTestNetParams() { networkID = CChainParams::TESTNET; + strNetworkID = "test"; // The message start string is designed to be unlikely to occur in normal data. // The characters are rarely used upper ASCII, not valid as UTF-8, and produce // a large 4-byte int at any alignment. @@ -240,6 +242,7 @@ class CRegTestParams : public CTestNetParams { public: CRegTestParams() { networkID = CChainParams::REGTEST; + strNetworkID = "regtest"; pchMessageStart[0] = 0xfa; pchMessageStart[1] = 0xbf; pchMessageStart[2] = 0xb5; diff --git a/src/chainparams.h b/src/chainparams.h index 8370cc5690..6e09a2cba3 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -79,6 +79,8 @@ public: * until nGenProcLimit blocks are generated */ bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; } Network NetworkID() const { return networkID; } + /* Return the BIP70 network string (main, test or regtest) */ + std::string NetworkIDString() const { return strNetworkID; } const vector& DNSSeeds() const { return vSeeds; } const std::vector& Base58Prefix(Base58Type type) const { return base58Prefixes[type]; } const vector& FixedSeeds() const { return vFixedSeeds; } @@ -102,6 +104,7 @@ protected: vector vSeeds; std::vector base58Prefixes[MAX_BASE58_TYPES]; Network networkID; + std::string strNetworkID; CBlock genesis; vector vFixedSeeds; bool fRequireRPCPassword; diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 403b03378f..9c9565be67 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -142,14 +142,6 @@ void ClientModel::updateAlert(const QString &hash, int status) emit alertsChanged(getStatusBarWarnings()); } -QString ClientModel::getNetworkName() const -{ - QString netname(QString::fromStdString(Params().DataDir())); - if(netname.isEmpty()) - netname = "main"; - return netname; -} - bool ClientModel::inInitialBlockDownload() const { return IsInitialBlockDownload(); diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h index 9c9a35b654..c7bd60bd41 100644 --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -56,8 +56,6 @@ public: double getVerificationProgress() const; QDateTime getLastBlockDate() const; - //! Return network (main, testnet3, regtest) - QString getNetworkName() const; //! Return true if core is doing initial block download bool inInitialBlockDownload() const; //! Return true if core is importing blocks diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 9241f9dc3c..eb6ab879aa 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -490,17 +490,6 @@ bool PaymentServer::readPaymentRequest(const QString& filename, PaymentRequestPl return request.parse(data); } -std::string PaymentServer::mapNetworkIdToName(CChainParams::Network networkId) -{ - if (networkId == CChainParams::MAIN) - return "main"; - if (networkId == CChainParams::TESTNET) - return "test"; - if (networkId == CChainParams::REGTEST) - return "regtest"; - return ""; -} - bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoinsRecipient& recipient) { if (!optionsModel) @@ -510,7 +499,7 @@ bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoins const payments::PaymentDetails& details = request.getDetails(); // Payment request network matches client network? - if (details.network() != mapNetworkIdToName(Params().NetworkID())) + if (details.network() != Params().NetworkIDString()) { emit message(tr("Payment request rejected"), tr("Payment request network doesn't match client network."), CClientUIInterface::MSG_ERROR); diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h index d6949a47ce..d84d09c57d 100644 --- a/src/qt/paymentserver.h +++ b/src/qt/paymentserver.h @@ -118,7 +118,6 @@ protected: private: static bool readPaymentRequest(const QString& filename, PaymentRequestPlus& request); - std::string mapNetworkIdToName(CChainParams::Network networkId); bool processPaymentRequest(PaymentRequestPlus& request, SendCoinsRecipient& recipient); void fetchRequest(const QUrl& url); diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 199050cc57..f7491f4a42 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -316,7 +316,7 @@ void RPCConsole::setClientModel(ClientModel *model) ui->buildDate->setText(model->formatBuildDate()); ui->startupTime->setText(model->formatClientStartupTime()); - ui->networkName->setText(model->getNetworkName()); + ui->networkName->setText(QString::fromStdString(Params().NetworkIDString())); } } diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 2a21fb462a..0fabc86872 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -451,14 +451,11 @@ Value getblockchaininfo(const Array& params, bool fHelp) ); Object obj; - std::string chain = Params().DataDir(); - if(chain.empty()) - chain = "main"; - obj.push_back(Pair("chain", chain)); - obj.push_back(Pair("blocks", (int)chainActive.Height())); - obj.push_back(Pair("bestblockhash", chainActive.Tip()->GetBlockHash().GetHex())); - obj.push_back(Pair("difficulty", (double)GetDifficulty())); - obj.push_back(Pair("verificationprogress", Checkpoints::GuessVerificationProgress(chainActive.Tip()))); - obj.push_back(Pair("chainwork", chainActive.Tip()->nChainWork.GetHex())); + obj.push_back(Pair("chain", Params().NetworkIDString())); + obj.push_back(Pair("blocks", (int)chainActive.Height())); + obj.push_back(Pair("bestblockhash", chainActive.Tip()->GetBlockHash().GetHex())); + obj.push_back(Pair("difficulty", (double)GetDifficulty())); + obj.push_back(Pair("verificationprogress", Checkpoints::GuessVerificationProgress(chainActive.Tip()))); + obj.push_back(Pair("chainwork", chainActive.Tip()->nChainWork.GetHex())); return obj; } From e5ee8f016ebb1db1bac3c4d0dd895249a4a17a1d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 12 Jun 2014 13:52:15 +0200 Subject: [PATCH 0175/1288] Remove -beta suffix It conflicts with our normal naming of releases/builds. Fixes #4221. --- src/version.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.cpp b/src/version.cpp index 51e34aa9c9..d86caa3ac2 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -12,7 +12,7 @@ const std::string CLIENT_NAME("Satoshi"); // Client version number -#define CLIENT_VERSION_SUFFIX "-beta" +#define CLIENT_VERSION_SUFFIX "" // The following part of the code determines the CLIENT_BUILD variable. From 18116b06c177acb97ad1051a0d5da92251adf2dc Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 10 Jun 2014 09:42:42 +0200 Subject: [PATCH 0176/1288] Ignore too-long redeemScripts while loading wallet This avoids that long redeemScripts that were grandfathered in prevent the wallet from loading. Fixes #4313. --- src/wallet.cpp | 16 ++++++++++++++++ src/wallet.h | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index ef0b442e1a..400c966a95 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -128,6 +128,22 @@ bool CWallet::AddCScript(const CScript& redeemScript) return CWalletDB(strWalletFile).WriteCScript(Hash160(redeemScript), redeemScript); } +bool CWallet::LoadCScript(const CScript& redeemScript) +{ + /* A sanity check was added in pull #3843 to avoid adding redeemScripts + * that never can be redeemed. However, old wallets may still contain + * these. Do not add them to the wallet and warn. */ + if (redeemScript.size() > MAX_SCRIPT_ELEMENT_SIZE) + { + std::string strAddr = CBitcoinAddress(redeemScript.GetID()).ToString(); + LogPrintf("%s: Warning: This wallet contains a redeemScript of size %i which exceeds maximum size %i thus can never be redeemed. Do not use address %s.\n", + __func__, redeemScript.size(), MAX_SCRIPT_ELEMENT_SIZE, strAddr); + return true; + } + + return CCryptoKeyStore::AddCScript(redeemScript); +} + bool CWallet::Unlock(const SecureString& strWalletPassphrase) { CCrypter crypter; diff --git a/src/wallet.h b/src/wallet.h index 274c31157c..7df656fc25 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -211,7 +211,7 @@ public: // Adds an encrypted key to the store, without saving it to disk (used by LoadWallet) bool LoadCryptedKey(const CPubKey &vchPubKey, const std::vector &vchCryptedSecret); bool AddCScript(const CScript& redeemScript); - bool LoadCScript(const CScript& redeemScript) { return CCryptoKeyStore::AddCScript(redeemScript); } + bool LoadCScript(const CScript& redeemScript); /// Adds a destination data tuple to the store, and saves it to disk bool AddDestData(const CTxDestination &dest, const std::string &key, const std::string &value); From 45615af26fe374fa996c116984a05f0a632a0e79 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 10 Jun 2014 16:02:46 +0200 Subject: [PATCH 0177/1288] Add 'about' information to `-version` output Adds a copyright and attribution message to the `-version` output (the same as shown in the About dialog in the GUI). Move the message to a function LicenseInfo in init.cpp. --- src/bitcoind.cpp | 6 +++- src/init.cpp | 13 ++++++- src/init.h | 3 ++ src/qt/forms/aboutdialog.ui | 70 +++---------------------------------- src/qt/utilitydialog.cpp | 20 +++++++---- 5 files changed, 38 insertions(+), 74 deletions(-) diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 99dc9d726d..b7d8ee7f90 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -87,7 +87,11 @@ bool AppInit(int argc, char* argv[]) { std::string strUsage = _("Bitcoin Core Daemon") + " " + _("version") + " " + FormatFullVersion() + "\n"; - if (!mapArgs.count("-version")) + if (mapArgs.count("-version")) + { + strUsage += LicenseInfo(); + } + else { strUsage += "\n" + _("Usage:") + "\n" + " bitcoind [options] " + _("Start Bitcoin Core Daemon") + "\n" + diff --git a/src/init.cpp b/src/init.cpp index 528c3df064..39453da9c8 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -195,7 +195,6 @@ bool static Bind(const CService &addr, unsigned int flags) { return true; } -// Core-specific options shared between UI, daemon and RPC client std::string HelpMessage(HelpMessageMode hmm) { string strUsage = _("Options:") + "\n"; @@ -330,6 +329,18 @@ std::string HelpMessage(HelpMessageMode hmm) return strUsage; } +std::string LicenseInfo() +{ + return FormatParagraph(strprintf(_("Copyright (C) 2009-%i The Bitcoin Core Developers"), COPYRIGHT_YEAR)) + "\n" + + "\n" + + FormatParagraph(_("This is experimental software.")) + "\n" + + "\n" + + FormatParagraph(_("Distributed under the MIT/X11 software license, see the accompanying file COPYING or .")) + "\n" + + "\n" + + FormatParagraph(_("This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.")) + + "\n"; +} + struct CImportingNow { CImportingNow() { diff --git a/src/init.h b/src/init.h index 4a967bea37..52daa47616 100644 --- a/src/init.h +++ b/src/init.h @@ -28,6 +28,9 @@ enum HelpMessageMode HMM_BITCOIN_QT }; +/** Help for options shared between UI and daemon (for -help) */ std::string HelpMessage(HelpMessageMode mode); +/** Returns licensing information (for -version) */ +std::string LicenseInfo(); #endif diff --git a/src/qt/forms/aboutdialog.ui b/src/qt/forms/aboutdialog.ui index fec63f737a..51dabf2c30 100644 --- a/src/qt/forms/aboutdialog.ui +++ b/src/qt/forms/aboutdialog.ui @@ -43,76 +43,14 @@ - - - - - IBeamCursor - - - <b>Bitcoin Core</b> version - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - IBeamCursor - - - 0.3.666-beta - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - + IBeamCursor - Copyright &copy; 2009-YYYY The Bitcoin Core developers - - - Qt::RichText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - IBeamCursor - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or <a href="http://www.opensource.org/licenses/mit-license.php">http://www.opensource.org/licenses/mit-license.php</a>. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (<a href="https://www.openssl.org/">https://www.openssl.org/</a>) and cryptographic software written by Eric Young (<a href="mailto:eay@cryptsoft.com">eay@cryptsoft.com</a>) and UPnP software written by Thomas Bernard. + +(placeholder for version message) + Qt::RichText diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index 435c6a4368..a34ebd3a37 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -16,6 +16,7 @@ #include "util.h" #include +#include #include /** "About" dialog box */ @@ -24,16 +25,13 @@ AboutDialog::AboutDialog(QWidget *parent) : ui(new Ui::AboutDialog) { ui->setupUi(this); - - // Set current copyright year - ui->copyrightLabel->setText(tr("Copyright") + QString(" © 2009-%1 ").arg(COPYRIGHT_YEAR) + tr("The Bitcoin Core developers")); } void AboutDialog::setModel(ClientModel *model) { if(model) { - QString version = model->formatFullVersion(); + QString version = tr("Bitcoin Core") + " " + tr("version") + " " + model->formatFullVersion(); /* On x86 add a bit specifier to the version so that users can distinguish between * 32 and 64 bit builds. On other architectures, 32/64 bit may be more ambigious. */ @@ -42,7 +40,17 @@ void AboutDialog::setModel(ClientModel *model) #elif defined(__i386__ ) version += " " + tr("(%1-bit)").arg(32); #endif - ui->versionLabel->setText(version); + + /// HTML-format the license message from the core + QString licenseInfo = QString::fromStdString(LicenseInfo()); + // Make URLs clickable + QRegExp uri("<(.*)>", Qt::CaseSensitive, QRegExp::RegExp2); + uri.setMinimal(true); // use non-greedy matching + licenseInfo = licenseInfo.replace(uri, "\\1"); + // Replace newlines with HTML breaks + licenseInfo = licenseInfo.replace("\n\n", "

"); + + ui->versionLabel->setText(version + "

" + licenseInfo); } } @@ -81,7 +89,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool versionOnly) : // Set help message text if(versionOnly) - ui->helpMessageLabel->setText(version); + ui->helpMessageLabel->setText(version + "\n" + QString::fromStdString(LicenseInfo())); else ui->helpMessageLabel->setText(version + "\n" + header + "\n" + coreOptions + "\n" + uiOptions); } From 5c97aae6da813ce4873651b31f75b26ea6f1352f Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 11 Jun 2014 21:44:47 +0200 Subject: [PATCH 0178/1288] qt: Unify AboutDialog and HelpMessageDialog They share so much code and functionality that they may as well be one class. --- src/Makefile.qt.include | 1 - src/qt/bitcoingui.cpp | 3 +- src/qt/forms/aboutdialog.ui | 130 ------------------------------ src/qt/forms/helpmessagedialog.ui | 7 +- src/qt/utilitydialog.cpp | 117 +++++++++++---------------- src/qt/utilitydialog.h | 22 +---- 6 files changed, 53 insertions(+), 227 deletions(-) delete mode 100644 src/qt/forms/aboutdialog.ui diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 72c7486258..647434e1ef 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -76,7 +76,6 @@ QT_TS = \ qt/locale/bitcoin_zh_TW.ts QT_FORMS_UI = \ - qt/forms/aboutdialog.ui \ qt/forms/addressbookpage.ui \ qt/forms/askpassphrasedialog.ui \ qt/forms/coincontroldialog.ui \ diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 847a3ab8f1..30f5ec8939 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -549,8 +549,7 @@ void BitcoinGUI::aboutClicked() if(!clientModel) return; - AboutDialog dlg(this); - dlg.setModel(clientModel); + HelpMessageDialog dlg(this, true); dlg.exec(); } diff --git a/src/qt/forms/aboutdialog.ui b/src/qt/forms/aboutdialog.ui deleted file mode 100644 index 51dabf2c30..0000000000 --- a/src/qt/forms/aboutdialog.ui +++ /dev/null @@ -1,130 +0,0 @@ - - - AboutDialog - - - - 0 - 0 - 593 - 319 - - - - About Bitcoin Core - - - - - - - 0 - 0 - - - - :/images/about - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - IBeamCursor - - - -(placeholder for version message) - - - - Qt::RichText - - - true - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Ok - - - - - - - - - - - - - buttonBox - accepted() - AboutDialog - accept() - - - 20 - 20 - - - 20 - 20 - - - - - buttonBox - rejected() - AboutDialog - reject() - - - 20 - 20 - - - 20 - 20 - - - - - diff --git a/src/qt/forms/helpmessagedialog.ui b/src/qt/forms/helpmessagedialog.ui index f68fea7e64..d8ab27c238 100644 --- a/src/qt/forms/helpmessagedialog.ui +++ b/src/qt/forms/helpmessagedialog.ui @@ -16,7 +16,7 @@
- Bitcoin Core - Command-line options + Bitcoin Core - Command-line options @@ -54,11 +54,6 @@ - - - Terminal - - IBeamCursor diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index a34ebd3a37..eb647d0170 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -4,7 +4,6 @@ #include "utilitydialog.h" -#include "ui_aboutdialog.h" #include "ui_helpmessagedialog.h" #include "bitcoingui.h" @@ -19,53 +18,8 @@ #include #include -/** "About" dialog box */ -AboutDialog::AboutDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::AboutDialog) -{ - ui->setupUi(this); -} - -void AboutDialog::setModel(ClientModel *model) -{ - if(model) - { - QString version = tr("Bitcoin Core") + " " + tr("version") + " " + model->formatFullVersion(); - /* On x86 add a bit specifier to the version so that users can distinguish between - * 32 and 64 bit builds. On other architectures, 32/64 bit may be more ambigious. - */ -#if defined(__x86_64__) - version += " " + tr("(%1-bit)").arg(64); -#elif defined(__i386__ ) - version += " " + tr("(%1-bit)").arg(32); -#endif - - /// HTML-format the license message from the core - QString licenseInfo = QString::fromStdString(LicenseInfo()); - // Make URLs clickable - QRegExp uri("<(.*)>", Qt::CaseSensitive, QRegExp::RegExp2); - uri.setMinimal(true); // use non-greedy matching - licenseInfo = licenseInfo.replace(uri, "\\1"); - // Replace newlines with HTML breaks - licenseInfo = licenseInfo.replace("\n\n", "

"); - - ui->versionLabel->setText(version + "

" + licenseInfo); - } -} - -AboutDialog::~AboutDialog() -{ - delete ui; -} - -void AboutDialog::on_buttonBox_accepted() -{ - close(); -} - -/** "Help message" dialog box */ -HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool versionOnly) : +/** "Help message" or "About" dialog box */ +HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) : QDialog(parent), ui(new Ui::HelpMessageDialog) { @@ -73,25 +27,52 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool versionOnly) : GUIUtil::restoreWindowGeometry("nHelpMessageDialogWindow", this->size(), this); QString version = tr("Bitcoin Core") + " " + tr("version") + " " + QString::fromStdString(FormatFullVersion()); - QString header = tr("Usage:") + "\n" + - " bitcoin-qt [" + tr("command-line options") + "] " + "\n"; + /* On x86 add a bit specifier to the version so that users can distinguish between + * 32 and 64 bit builds. On other architectures, 32/64 bit may be more ambigious. + */ +#if defined(__x86_64__) + version += " " + tr("(%1-bit)").arg(64); +#elif defined(__i386__ ) + version += " " + tr("(%1-bit)").arg(32); +#endif - QString coreOptions = QString::fromStdString(HelpMessage(HMM_BITCOIN_QT)); + if (about) + { + setWindowTitle(tr("About Bitcoin Core")); - QString uiOptions = tr("UI options") + ":\n" + - " -choosedatadir " + tr("Choose data directory on startup (default: 0)") + "\n" + - " -lang= " + tr("Set language, for example \"de_DE\" (default: system locale)") + "\n" + - " -min " + tr("Start minimized") + "\n" + - " -rootcertificates= " + tr("Set SSL root certificates for payment request (default: -system-)") + "\n" + - " -splash " + tr("Show splash screen on startup (default: 1)"); + /// HTML-format the license message from the core + QString licenseInfo = QString::fromStdString(LicenseInfo()); + QString licenseInfoHTML = licenseInfo; + // Make URLs clickable + QRegExp uri("<(.*)>", Qt::CaseSensitive, QRegExp::RegExp2); + uri.setMinimal(true); // use non-greedy matching + licenseInfoHTML.replace(uri, "\\1"); + // Replace newlines with HTML breaks + licenseInfoHTML.replace("\n\n", "

"); - ui->helpMessageLabel->setFont(GUIUtil::bitcoinAddressFont()); + ui->helpMessageLabel->setTextFormat(Qt::RichText); + ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); + text = version + "\n" + licenseInfo; + ui->helpMessageLabel->setText(version + "

" + licenseInfoHTML); + ui->helpMessageLabel->setWordWrap(true); + } else { + setWindowTitle(tr("Command-line options")); + QString header = tr("Usage:") + "\n" + + " bitcoin-qt [" + tr("command-line options") + "] " + "\n"; - // Set help message text - if(versionOnly) - ui->helpMessageLabel->setText(version + "\n" + QString::fromStdString(LicenseInfo())); - else - ui->helpMessageLabel->setText(version + "\n" + header + "\n" + coreOptions + "\n" + uiOptions); + QString coreOptions = QString::fromStdString(HelpMessage(HMM_BITCOIN_QT)); + + QString uiOptions = tr("UI options") + ":\n" + + " -choosedatadir " + tr("Choose data directory on startup (default: 0)") + "\n" + + " -lang= " + tr("Set language, for example \"de_DE\" (default: system locale)") + "\n" + + " -min " + tr("Start minimized") + "\n" + + " -rootcertificates= " + tr("Set SSL root certificates for payment request (default: -system-)") + "\n" + + " -splash " + tr("Show splash screen on startup (default: 1)"); + + ui->helpMessageLabel->setFont(GUIUtil::bitcoinAddressFont()); + text = version + "\n" + header + "\n" + coreOptions + "\n" + uiOptions; + ui->helpMessageLabel->setText(text); + } } HelpMessageDialog::~HelpMessageDialog() @@ -103,17 +84,17 @@ HelpMessageDialog::~HelpMessageDialog() void HelpMessageDialog::printToConsole() { // On other operating systems, the expected action is to print the message to the console. - fprintf(stdout, "%s\n", qPrintable(ui->helpMessageLabel->text())); + fprintf(stdout, "%s\n", qPrintable(text)); } void HelpMessageDialog::showOrPrint() { #if defined(WIN32) - // On Windows, show a message box, as there is no stderr/stdout in windowed applications - exec(); + // On Windows, show a message box, as there is no stderr/stdout in windowed applications + exec(); #else - // On other operating systems, print help text to console - printToConsole(); + // On other operating systems, print help text to console + printToConsole(); #endif } diff --git a/src/qt/utilitydialog.h b/src/qt/utilitydialog.h index cc23420169..154bb70b8b 100644 --- a/src/qt/utilitydialog.h +++ b/src/qt/utilitydialog.h @@ -12,35 +12,16 @@ class BitcoinGUI; class ClientModel; namespace Ui { - class AboutDialog; class HelpMessageDialog; } -/** "About" dialog box */ -class AboutDialog : public QDialog -{ - Q_OBJECT - -public: - explicit AboutDialog(QWidget *parent); - ~AboutDialog(); - - void setModel(ClientModel *model); - -private: - Ui::AboutDialog *ui; - -private slots: - void on_buttonBox_accepted(); -}; - /** "Help message" dialog box */ class HelpMessageDialog : public QDialog { Q_OBJECT public: - explicit HelpMessageDialog(QWidget *parent, bool versionOnly); + explicit HelpMessageDialog(QWidget *parent, bool about); ~HelpMessageDialog(); void printToConsole(); @@ -48,6 +29,7 @@ public: private: Ui::HelpMessageDialog *ui; + QString text; private slots: void on_okButton_accepted(); From 33cc907dfbfb5925a6315dd8e6ccc5f66a9b3198 Mon Sep 17 00:00:00 2001 From: kevin Date: Sun, 15 Jun 2014 15:35:53 +0800 Subject: [PATCH 0179/1288] Add DNS seed of open-nodes.org --- src/chainparams.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 1749dd6ff9..18d6a63603 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -148,6 +148,7 @@ public: vSeeds.push_back(CDNSSeedData("dashjr.org", "dnsseed.bitcoin.dashjr.org")); vSeeds.push_back(CDNSSeedData("bitcoinstats.com", "seed.bitcoinstats.com")); vSeeds.push_back(CDNSSeedData("bitnodes.io", "seed.bitnodes.io")); + vSeeds.push_back(CDNSSeedData("open-nodes.org", "seeds.bitcoin.open-nodes.org")); vSeeds.push_back(CDNSSeedData("xf2.org", "bitseed.xf2.org")); base58Prefixes[PUBKEY_ADDRESS] = list_of(0); From 0cafb630254c6459ea02f6fc47e1c37bb81a1238 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Thu, 12 Jun 2014 22:26:46 -0400 Subject: [PATCH 0180/1288] bitcoin-cli, rpcclient: prefer EXIT_FAILURE cstdlib constant A more complex construction via abs() yields the same end result. Rebased-From: 34ff109 Rebased-By: Wladimir J. van der Laan --- src/bitcoin-cli.cpp | 8 ++++---- src/rpcclient.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 0bb71329f5..0c7d6fe5ac 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -65,17 +65,17 @@ int main(int argc, char* argv[]) try { if(!AppInitRPC(argc, argv)) - return abs(RPC_MISC_ERROR); + return EXIT_FAILURE; } catch (std::exception& e) { PrintExceptionContinue(&e, "AppInitRPC()"); - return abs(RPC_MISC_ERROR); + return EXIT_FAILURE; } catch (...) { PrintExceptionContinue(NULL, "AppInitRPC()"); - return abs(RPC_MISC_ERROR); + return EXIT_FAILURE; } - int ret = abs(RPC_MISC_ERROR); + int ret = EXIT_FAILURE; try { ret = CommandLineRPC(argc, argv); diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index b89a95ad11..1a5b3f7412 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -234,7 +234,7 @@ int CommandLineRPC(int argc, char *argv[]) } catch (std::exception& e) { strPrint = string("error: ") + e.what(); - nRet = abs(RPC_MISC_ERROR); + nRet = EXIT_FAILURE; } catch (...) { PrintExceptionContinue(NULL, "CommandLineRPC()"); From b750cf1fb9b6529ab1761b22947677ca78a2c626 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 26 May 2014 11:38:44 +0200 Subject: [PATCH 0181/1288] Remove cli functionality from bitcoind As it says on the tin. It was deprecated in version 0.9, and at some point it should be removed. Removes the dependency of bitcoind on libbitcoin-cli.a. Move some functions that used to be shared but are now only used in bitcoin-cli.cpp to that file. After this change, an error is printed (and exit code 1 is returned) when the user tries to send RPC commands using bitcoind. --- src/Makefile.am | 1 - src/bitcoin-cli.cpp | 158 ++++++++++++++++++++++++++++++++++++++- src/bitcoind.cpp | 12 +-- src/rpcclient.cpp | 175 -------------------------------------------- src/rpcclient.h | 10 --- 5 files changed, 160 insertions(+), 196 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 3016be47b9..0a76829197 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -171,7 +171,6 @@ nodist_libbitcoin_common_a_SOURCES = $(srcdir)/obj/build.h # bitcoind binary # bitcoind_LDADD = \ libbitcoin_server.a \ - libbitcoin_cli.a \ libbitcoin_common.a \ $(LIBLEVELDB) \ $(LIBMEMENV) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 0c7d6fe5ac..c7327fd7c9 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -12,6 +12,32 @@ #include +using namespace boost; +using namespace boost::asio; +using namespace json_spirit; + +std::string HelpMessageCli() +{ + string strUsage; + strUsage += _("Options:") + "\n"; + strUsage += " -? " + _("This help message") + "\n"; + strUsage += " -conf= " + _("Specify configuration file (default: bitcoin.conf)") + "\n"; + strUsage += " -datadir= " + _("Specify data directory") + "\n"; + strUsage += " -testnet " + _("Use the test network") + "\n"; + strUsage += " -regtest " + _("Enter regression test mode, which uses a special chain in which blocks can be " + "solved instantly. This is intended for regression testing tools and app development.") + "\n"; + strUsage += " -rpcconnect= " + _("Send commands to node running on (default: 127.0.0.1)") + "\n"; + strUsage += " -rpcport= " + _("Connect to JSON-RPC on (default: 8332 or testnet: 18332)") + "\n"; + strUsage += " -rpcwait " + _("Wait for RPC server to start") + "\n"; + strUsage += " -rpcuser= " + _("Username for JSON-RPC connections") + "\n"; + strUsage += " -rpcpassword= " + _("Password for JSON-RPC connections") + "\n"; + + strUsage += "\n" + _("SSL options: (see the Bitcoin Wiki for SSL setup instructions)") + "\n"; + strUsage += " -rpcssl " + _("Use OpenSSL (https) for JSON-RPC connections") + "\n"; + + return strUsage; +} + ////////////////////////////////////////////////////////////////////////////// // // Start @@ -49,7 +75,7 @@ static bool AppInitRPC(int argc, char* argv[]) " bitcoin-cli [options] help " + _("List commands") + "\n" + " bitcoin-cli [options] help " + _("Get help for a command") + "\n"; - strUsage += "\n" + HelpMessageCli(true); + strUsage += "\n" + HelpMessageCli(); } fprintf(stdout, "%s", strUsage.c_str()); @@ -58,6 +84,136 @@ static bool AppInitRPC(int argc, char* argv[]) return true; } +Object CallRPC(const string& strMethod, const Array& params) +{ + if (mapArgs["-rpcuser"] == "" && mapArgs["-rpcpassword"] == "") + throw runtime_error(strprintf( + _("You must set rpcpassword= in the configuration file:\n%s\n" + "If the file does not exist, create it with owner-readable-only file permissions."), + GetConfigFile().string().c_str())); + + // Connect to localhost + bool fUseSSL = GetBoolArg("-rpcssl", false); + asio::io_service io_service; + ssl::context context(io_service, ssl::context::sslv23); + context.set_options(ssl::context::no_sslv2); + asio::ssl::stream sslStream(io_service, context); + SSLIOStreamDevice d(sslStream, fUseSSL); + iostreams::stream< SSLIOStreamDevice > stream(d); + + bool fWait = GetBoolArg("-rpcwait", false); // -rpcwait means try until server has started + do { + bool fConnected = d.connect(GetArg("-rpcconnect", "127.0.0.1"), GetArg("-rpcport", itostr(Params().RPCPort()))); + if (fConnected) break; + if (fWait) + MilliSleep(1000); + else + throw runtime_error("couldn't connect to server"); + } while (fWait); + + // HTTP basic authentication + string strUserPass64 = EncodeBase64(mapArgs["-rpcuser"] + ":" + mapArgs["-rpcpassword"]); + map mapRequestHeaders; + mapRequestHeaders["Authorization"] = string("Basic ") + strUserPass64; + + // Send request + string strRequest = JSONRPCRequest(strMethod, params, 1); + string strPost = HTTPPost(strRequest, mapRequestHeaders); + stream << strPost << std::flush; + + // Receive HTTP reply status + int nProto = 0; + int nStatus = ReadHTTPStatus(stream, nProto); + + // Receive HTTP reply message headers and body + map mapHeaders; + string strReply; + ReadHTTPMessage(stream, mapHeaders, strReply, nProto); + + if (nStatus == HTTP_UNAUTHORIZED) + throw runtime_error("incorrect rpcuser or rpcpassword (authorization failed)"); + else if (nStatus >= 400 && nStatus != HTTP_BAD_REQUEST && nStatus != HTTP_NOT_FOUND && nStatus != HTTP_INTERNAL_SERVER_ERROR) + throw runtime_error(strprintf("server returned HTTP error %d", nStatus)); + else if (strReply.empty()) + throw runtime_error("no response from server"); + + // Parse reply + Value valReply; + if (!read_string(strReply, valReply)) + throw runtime_error("couldn't parse reply from server"); + const Object& reply = valReply.get_obj(); + if (reply.empty()) + throw runtime_error("expected reply to have result, error and id properties"); + + return reply; +} + +int CommandLineRPC(int argc, char *argv[]) +{ + string strPrint; + int nRet = 0; + try + { + // Skip switches + while (argc > 1 && IsSwitchChar(argv[1][0])) + { + argc--; + argv++; + } + + // Method + if (argc < 2) + throw runtime_error("too few parameters"); + string strMethod = argv[1]; + + // Parameters default to strings + std::vector strParams(&argv[2], &argv[argc]); + Array params = RPCConvertValues(strMethod, strParams); + + // Execute + Object reply = CallRPC(strMethod, params); + + // Parse reply + const Value& result = find_value(reply, "result"); + const Value& error = find_value(reply, "error"); + + if (error.type() != null_type) + { + // Error + strPrint = "error: " + write_string(error, false); + int code = find_value(error.get_obj(), "code").get_int(); + nRet = abs(code); + } + else + { + // Result + if (result.type() == null_type) + strPrint = ""; + else if (result.type() == str_type) + strPrint = result.get_str(); + else + strPrint = write_string(result, true); + } + } + catch (boost::thread_interrupted) { + throw; + } + catch (std::exception& e) { + strPrint = string("error: ") + e.what(); + nRet = EXIT_FAILURE; + } + catch (...) { + PrintExceptionContinue(NULL, "CommandLineRPC()"); + throw; + } + + if (strPrint != "") + { + fprintf((nRet == 0 ? stdout : stderr), "%s\n", strPrint.c_str()); + } + return nRet; +} + int main(int argc, char* argv[]) { SetupEnvironment(); diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index b7d8ee7f90..880955481b 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -4,7 +4,6 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "rpcserver.h" -#include "rpcclient.h" #include "init.h" #include "main.h" #include "noui.h" @@ -94,14 +93,9 @@ bool AppInit(int argc, char* argv[]) else { strUsage += "\n" + _("Usage:") + "\n" + - " bitcoind [options] " + _("Start Bitcoin Core Daemon") + "\n" + - _("Usage (deprecated, use bitcoin-cli):") + "\n" + - " bitcoind [options] [params] " + _("Send command to Bitcoin Core") + "\n" + - " bitcoind [options] help " + _("List commands") + "\n" + - " bitcoind [options] help " + _("Get help for a command") + "\n"; + " bitcoind [options] " + _("Start Bitcoin Core Daemon") + "\n"; strUsage += "\n" + HelpMessage(HMM_BITCOIND); - strUsage += "\n" + HelpMessageCli(false); } fprintf(stdout, "%s", strUsage.c_str()); @@ -116,8 +110,8 @@ bool AppInit(int argc, char* argv[]) if (fCommandLine) { - int ret = CommandLineRPC(argc, argv); - exit(ret); + fprintf(stderr, "Error: There is no RPC client functionality in bitcoind anymore. Use the bitcoin-cli utility instead.\n"); + exit(1); } #ifndef WIN32 fDaemon = GetBoolArg("-daemon", false); diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index 1a5b3f7412..3a06e33016 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -12,86 +12,9 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "json/json_spirit_writer_template.h" - using namespace std; -using namespace boost; -using namespace boost::asio; using namespace json_spirit; -Object CallRPC(const string& strMethod, const Array& params) -{ - if (mapArgs["-rpcuser"] == "" && mapArgs["-rpcpassword"] == "") - throw runtime_error(strprintf( - _("You must set rpcpassword= in the configuration file:\n%s\n" - "If the file does not exist, create it with owner-readable-only file permissions."), - GetConfigFile().string().c_str())); - - // Connect to localhost - bool fUseSSL = GetBoolArg("-rpcssl", false); - asio::io_service io_service; - ssl::context context(io_service, ssl::context::sslv23); - context.set_options(ssl::context::no_sslv2); - asio::ssl::stream sslStream(io_service, context); - SSLIOStreamDevice d(sslStream, fUseSSL); - iostreams::stream< SSLIOStreamDevice > stream(d); - - bool fWait = GetBoolArg("-rpcwait", false); // -rpcwait means try until server has started - do { - bool fConnected = d.connect(GetArg("-rpcconnect", "127.0.0.1"), GetArg("-rpcport", itostr(Params().RPCPort()))); - if (fConnected) break; - if (fWait) - MilliSleep(1000); - else - throw runtime_error("couldn't connect to server"); - } while (fWait); - - // HTTP basic authentication - string strUserPass64 = EncodeBase64(mapArgs["-rpcuser"] + ":" + mapArgs["-rpcpassword"]); - map mapRequestHeaders; - mapRequestHeaders["Authorization"] = string("Basic ") + strUserPass64; - - // Send request - string strRequest = JSONRPCRequest(strMethod, params, 1); - string strPost = HTTPPost(strRequest, mapRequestHeaders); - stream << strPost << std::flush; - - // Receive HTTP reply status - int nProto = 0; - int nStatus = ReadHTTPStatus(stream, nProto); - - // Receive HTTP reply message headers and body - map mapHeaders; - string strReply; - ReadHTTPMessage(stream, mapHeaders, strReply, nProto); - - if (nStatus == HTTP_UNAUTHORIZED) - throw runtime_error("incorrect rpcuser or rpcpassword (authorization failed)"); - else if (nStatus >= 400 && nStatus != HTTP_BAD_REQUEST && nStatus != HTTP_NOT_FOUND && nStatus != HTTP_INTERNAL_SERVER_ERROR) - throw runtime_error(strprintf("server returned HTTP error %d", nStatus)); - else if (strReply.empty()) - throw runtime_error("no response from server"); - - // Parse reply - Value valReply; - if (!read_string(strReply, valReply)) - throw runtime_error("couldn't parse reply from server"); - const Object& reply = valReply.get_obj(); - if (reply.empty()) - throw runtime_error("expected reply to have result, error and id properties"); - - return reply; -} - template void ConvertTo(Value& value, bool fAllowNull=false) { @@ -182,101 +105,3 @@ Array RPCConvertValues(const std::string &strMethod, const std::vector 1 && IsSwitchChar(argv[1][0])) - { - argc--; - argv++; - } - - // Method - if (argc < 2) - throw runtime_error("too few parameters"); - string strMethod = argv[1]; - - // Parameters default to strings - std::vector strParams(&argv[2], &argv[argc]); - Array params = RPCConvertValues(strMethod, strParams); - - // Execute - Object reply = CallRPC(strMethod, params); - - // Parse reply - const Value& result = find_value(reply, "result"); - const Value& error = find_value(reply, "error"); - - if (error.type() != null_type) - { - // Error - strPrint = "error: " + write_string(error, false); - int code = find_value(error.get_obj(), "code").get_int(); - nRet = abs(code); - } - else - { - // Result - if (result.type() == null_type) - strPrint = ""; - else if (result.type() == str_type) - strPrint = result.get_str(); - else - strPrint = write_string(result, true); - } - } - catch (boost::thread_interrupted) { - throw; - } - catch (std::exception& e) { - strPrint = string("error: ") + e.what(); - nRet = EXIT_FAILURE; - } - catch (...) { - PrintExceptionContinue(NULL, "CommandLineRPC()"); - throw; - } - - if (strPrint != "") - { - fprintf((nRet == 0 ? stdout : stderr), "%s\n", strPrint.c_str()); - } - return nRet; -} - -std::string HelpMessageCli(bool mainProgram) -{ - string strUsage; - if(mainProgram) - { - strUsage += _("Options:") + "\n"; - strUsage += " -? " + _("This help message") + "\n"; - strUsage += " -conf= " + _("Specify configuration file (default: bitcoin.conf)") + "\n"; - strUsage += " -datadir= " + _("Specify data directory") + "\n"; - strUsage += " -testnet " + _("Use the test network") + "\n"; - strUsage += " -regtest " + _("Enter regression test mode, which uses a special chain in which blocks can be " - "solved instantly. This is intended for regression testing tools and app development.") + "\n"; - } else { - strUsage += _("RPC client options:") + "\n"; - } - - strUsage += " -rpcconnect= " + _("Send commands to node running on (default: 127.0.0.1)") + "\n"; - strUsage += " -rpcport= " + _("Connect to JSON-RPC on (default: 8332 or testnet: 18332)") + "\n"; - strUsage += " -rpcwait " + _("Wait for RPC server to start") + "\n"; - - if(mainProgram) - { - strUsage += " -rpcuser= " + _("Username for JSON-RPC connections") + "\n"; - strUsage += " -rpcpassword= " + _("Password for JSON-RPC connections") + "\n"; - - strUsage += "\n" + _("SSL options: (see the Bitcoin Wiki for SSL setup instructions)") + "\n"; - strUsage += " -rpcssl " + _("Use OpenSSL (https) for JSON-RPC connections") + "\n"; - } - - return strUsage; -} - diff --git a/src/rpcclient.h b/src/rpcclient.h index e101d22ec5..840890e34b 100644 --- a/src/rpcclient.h +++ b/src/rpcclient.h @@ -10,16 +10,6 @@ #include "json/json_spirit_utils.h" #include "json/json_spirit_writer_template.h" -int CommandLineRPC(int argc, char *argv[]); - json_spirit::Array RPCConvertValues(const std::string &strMethod, const std::vector &strParams); -/** Show help message for bitcoin-cli. - * The mainProgram argument is used to determine whether to show this message as main program - * (and include some common options) or as sub-header of another help message. - * - * @note the argument can be removed once bitcoin-cli functionality is removed from bitcoind - */ -std::string HelpMessageCli(bool mainProgram); - #endif From 676301879755588cb32ed6cd95a84f4da1d4f83f Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 12 Jun 2014 14:29:18 +0200 Subject: [PATCH 0182/1288] [Qt] rename In:/Out: to Received/Sent in traffic tab - collides with In:/Out: used for displaying number of connections when translating --- src/qt/forms/rpcconsole.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/forms/rpcconsole.ui b/src/qt/forms/rpcconsole.ui index 1e574e8527..7158b65c2d 100644 --- a/src/qt/forms/rpcconsole.ui +++ b/src/qt/forms/rpcconsole.ui @@ -559,7 +559,7 @@ - In: + Received @@ -639,7 +639,7 @@ - Out: + Sent From 1569353b8aa535f086833acb6223650972c89790 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 7 May 2014 18:10:48 +0000 Subject: [PATCH 0183/1288] Add `-stopafterblockimport` option Stop after importing blocks. This can be useful for development and trouble shooting. --- src/init.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/init.cpp b/src/init.cpp index 39453da9c8..0a0b479fa2 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -273,6 +273,7 @@ std::string HelpMessage(HelpMessageMode hmm) strUsage += " -dropmessagestest= " + _("Randomly drop 1 of every network messages") + "\n"; strUsage += " -fuzzmessagestest= " + _("Randomly fuzz 1 of every network messages") + "\n"; strUsage += " -flushwallet " + _("Run a thread to flush wallet periodically (default: 1)") + "\n"; + strUsage += " -stopafterblockimport " + _("Stop running after importing blocks from disk (default: 0)") + "\n"; } strUsage += " -debug= " + _("Output debugging information (default: 0, supplying is optional)") + "\n"; strUsage += " " + _("If is not supplied, output all debugging information.") + "\n"; @@ -404,6 +405,11 @@ void ThreadImport(std::vector vImportFiles) LogPrintf("Warning: Could not open blocks file %s\n", path.string()); } } + + if (GetBoolArg("-stopafterblockimport", false)) { + LogPrintf("Stopping after block import\n"); + StartShutdown(); + } } /** Sanity checks From 09eb201b1b3ed808e5167245149f5635d4eaf6f9 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 16 Jun 2014 16:30:38 +0200 Subject: [PATCH 0184/1288] Remove `using namespace std` from header file It's considered bad form to import things into the global namespace in a header. Put it in the cpp files where it is needed instead. --- src/bitcoin-cli.cpp | 1 + src/chainparams.cpp | 1 + src/chainparams.h | 22 ++++++++++------------ src/miner.cpp | 2 ++ src/qt/paymentrequestplus.cpp | 1 + src/qt/paymentrequestplus.h | 2 +- src/qt/paymentserver.cpp | 1 + src/qt/transactiondesc.cpp | 2 ++ src/qt/walletmodel.cpp | 2 ++ 9 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index c7327fd7c9..40b45415c4 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -12,6 +12,7 @@ #include +using namespace std; using namespace boost; using namespace boost::asio; using namespace json_spirit; diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 47136eeeea..6b2cfa1d1f 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -10,6 +10,7 @@ #include +using namespace std; using namespace boost::assign; // diff --git a/src/chainparams.h b/src/chainparams.h index 6e09a2cba3..28a51cbb0c 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -12,13 +12,11 @@ #include -using namespace std; - typedef unsigned char MessageStartChars[MESSAGE_START_SIZE]; struct CDNSSeedData { - string name, host; - CDNSSeedData(const string &strName, const string &strHost) : name(strName), host(strHost) {} + std::string name, host; + CDNSSeedData(const std::string &strName, const std::string &strHost) : name(strName), host(strHost) {} }; /** @@ -51,7 +49,7 @@ public: const uint256& HashGenesisBlock() const { return hashGenesisBlock; } const MessageStartChars& MessageStart() const { return pchMessageStart; } - const vector& AlertKey() const { return vAlertPubKey; } + const std::vector& AlertKey() const { return vAlertPubKey; } int GetDefaultPort() const { return nDefaultPort; } const uint256& ProofOfWorkLimit() const { return bnProofOfWorkLimit; } int SubsidyHalvingInterval() const { return nSubsidyHalvingInterval; } @@ -74,16 +72,16 @@ public: bool RequireStandard() const { return fRequireStandard; } /* Make standard checks */ bool RPCisTestNet() const { return fRPCisTestNet; } - const string& DataDir() const { return strDataDir; } + const std::string& DataDir() const { return strDataDir; } /* Make miner stop after a block is found. In RPC, don't return * until nGenProcLimit blocks are generated */ bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; } Network NetworkID() const { return networkID; } /* Return the BIP70 network string (main, test or regtest) */ std::string NetworkIDString() const { return strNetworkID; } - const vector& DNSSeeds() const { return vSeeds; } + const std::vector& DNSSeeds() const { return vSeeds; } const std::vector& Base58Prefix(Base58Type type) const { return base58Prefixes[type]; } - const vector& FixedSeeds() const { return vFixedSeeds; } + const std::vector& FixedSeeds() const { return vFixedSeeds; } int RPCPort() const { return nRPCPort; } protected: CChainParams() {} @@ -91,7 +89,7 @@ protected: uint256 hashGenesisBlock; MessageStartChars pchMessageStart; // Raw pub key bytes for the broadcast alert signing key. - vector vAlertPubKey; + std::vector vAlertPubKey; int nDefaultPort; int nRPCPort; uint256 bnProofOfWorkLimit; @@ -99,14 +97,14 @@ protected: int nEnforceBlockUpgradeMajority; int nRejectBlockOutdatedMajority; int nToCheckBlockUpgradeMajority; - string strDataDir; + std::string strDataDir; int nMinerThreads; - vector vSeeds; + std::vector vSeeds; std::vector base58Prefixes[MAX_BASE58_TYPES]; Network networkID; std::string strNetworkID; CBlock genesis; - vector vFixedSeeds; + std::vector vFixedSeeds; bool fRequireRPCPassword; bool fMiningRequiresPeers; bool fDefaultCheckMemPool; diff --git a/src/miner.cpp b/src/miner.cpp index a0a728fb81..87779efbbd 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -11,6 +11,8 @@ #ifdef ENABLE_WALLET #include "wallet.h" #endif + +using namespace std; ////////////////////////////////////////////////////////////////////////////// // // BitcoinMiner diff --git a/src/qt/paymentrequestplus.cpp b/src/qt/paymentrequestplus.cpp index e369734a98..464f995eb6 100644 --- a/src/qt/paymentrequestplus.cpp +++ b/src/qt/paymentrequestplus.cpp @@ -17,6 +17,7 @@ #include #include +using namespace std; class SSLVerifyError : public std::runtime_error { diff --git a/src/qt/paymentrequestplus.h b/src/qt/paymentrequestplus.h index 8c126b1fad..3c4861a4d4 100644 --- a/src/qt/paymentrequestplus.h +++ b/src/qt/paymentrequestplus.h @@ -24,7 +24,7 @@ public: PaymentRequestPlus() { } bool parse(const QByteArray& data); - bool SerializeToString(string* output) const; + bool SerializeToString(std::string* output) const; bool IsInitialized() const; QString getPKIType() const; diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index eb6ab879aa..49923a1afc 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -44,6 +44,7 @@ #include #endif +using namespace std; using namespace boost; const int BITCOIN_IPC_CONNECT_TIMEOUT = 1000; // milliseconds diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 0cfcb048c8..61da3373fd 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -18,6 +18,8 @@ #include #include +using namespace std; + QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx) { AssertLockHeld(cs_main); diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 87ff3db584..2f633a26c8 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -24,6 +24,8 @@ #include #include +using namespace std; + WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *parent) : QObject(parent), wallet(wallet), optionsModel(optionsModel), addressTableModel(0), transactionTableModel(0), From 77cbd4623e171ee9c48ada8a421295ed2c8e6c7c Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Fri, 14 Feb 2014 18:27:15 +0100 Subject: [PATCH 0185/1288] Let -zapwallettxes recover transaction meta data --- qa/rpc-tests/util.sh | 8 ++ qa/rpc-tests/zapwallettxes.sh | 161 ++++++++++++++++++++++++++++++++++ src/init.cpp | 34 ++++++- src/wallet.cpp | 4 +- src/wallet.h | 2 +- src/walletdb.cpp | 10 ++- src/walletdb.h | 4 +- 7 files changed, 212 insertions(+), 11 deletions(-) create mode 100755 qa/rpc-tests/zapwallettxes.sh diff --git a/qa/rpc-tests/util.sh b/qa/rpc-tests/util.sh index 1e7bd6a7ee..b726ef627f 100644 --- a/qa/rpc-tests/util.sh +++ b/qa/rpc-tests/util.sh @@ -38,6 +38,10 @@ function AssertEqual { if (( $( echo "$1 == $2" | bc ) == 0 )) then echoerr "AssertEqual: $1 != $2" + declare -f CleanUp > /dev/null 2>&1 + if [[ $? -eq 0 ]] ; then + CleanUp + fi exit 1 fi } @@ -49,6 +53,10 @@ function CheckBalance { if (( $( echo "$B == $EXPECT" | bc ) == 0 )) then echoerr "bad balance: $B (expected $2)" + declare -f CleanUp > /dev/null 2>&1 + if [[ $? -eq 0 ]] ; then + CleanUp + fi exit 1 fi } diff --git a/qa/rpc-tests/zapwallettxes.sh b/qa/rpc-tests/zapwallettxes.sh new file mode 100755 index 0000000000..bc52a7dacd --- /dev/null +++ b/qa/rpc-tests/zapwallettxes.sh @@ -0,0 +1,161 @@ +#!/usr/bin/env bash + +# Test -zapwallettxes= + +if [ $# -lt 1 ]; then + echo "Usage: $0 path_to_binaries" + echo "e.g. $0 ../../src" + exit 1 +fi + +set -f + +BITCOIND=${1}/bitcoind +CLI=${1}/bitcoin-cli + +DIR="${BASH_SOURCE%/*}" +SENDANDWAIT="${DIR}/send.sh" +if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi +. "$DIR/util.sh" + +D=$(mktemp -d test.XXXXX) + +D1=${D}/node1 +CreateDataDir "$D1" port=11000 rpcport=11001 +B1ARGS="-datadir=$D1" +$BITCOIND $B1ARGS & +B1PID=$! + +D2=${D}/node2 +CreateDataDir "$D2" port=11010 rpcport=11011 +B2ARGS="-datadir=$D2" +$BITCOIND $B2ARGS & +B2PID=$! + +function CleanUp { +$CLI $B2ARGS stop > /dev/null 2>&1 +wait $B2PID +$CLI $B1ARGS stop > /dev/null 2>&1 +wait $B1PID + +rm -rf $D +} + +# 110 blocks, 10 mature == 500 XBT +$CLI $B1ARGS setgenerate true 110 +$CLI $B2ARGS setgenerate true 110 + +CheckBalance "$B1ARGS" 500 +CheckBalance "$B2ARGS" 500 + +# Send 10 XBT +TXID1_DEFAULT=$($CLI $B1ARGS sendtoaddress "mrhz5ZgSF3C1BSdyCKt3gEdhKoRL5BNfJV" 10) +TXID2_DEFAULT=$($CLI $B2ARGS sendtoaddress "mrhz5ZgSF3C1BSdyCKt3gEdhKoRL5BNfJV" 10) + +CheckBalance $B1ARGS 490 +CheckBalance $B2ARGS 490 + +# Move 10 XBT to testaccount +TMP=$($CLI $B1ARGS move "" "testaccount" 10) +TMP=$($CLI $B2ARGS move "" "testaccount" 10) + +CheckBalance $B1ARGS 10 "testaccount" +CheckBalance $B2ARGS 10 "testaccount" + +# Send 1 XBT from testaccount +TXID1_TESTACCOUNT=$($CLI $B1ARGS sendfrom "testaccount" "mrhz5ZgSF3C1BSdyCKt3gEdhKoRL5BNfJV" 1) +TXID2_TESTACCOUNT=$($CLI $B2ARGS sendfrom "testaccount" "mrhz5ZgSF3C1BSdyCKt3gEdhKoRL5BNfJV" 1) + +CheckBalance $B1ARGS 9 "testaccount" +CheckBalance $B2ARGS 9 "testaccount" + +CheckBalance $B1ARGS 489 +CheckBalance $B2ARGS 489 + +# Confirm transactions +$CLI $B1ARGS setgenerate true 1 +$CLI $B2ARGS setgenerate true 1 + +# Create unconfirmed transaction +TXID1_UNCONFIRMED=$($CLI $B1ARGS sendtoaddress "mrhz5ZgSF3C1BSdyCKt3gEdhKoRL5BNfJV" 1) +TXID2_UNCONFIRMED=$($CLI $B2ARGS sendtoaddress "mrhz5ZgSF3C1BSdyCKt3gEdhKoRL5BNfJV" 1) + +# check balance (we created another 50 and spent 1 in the meantime) +CheckBalance $B1ARGS 538 +CheckBalance $B2ARGS 538 + +# Safety check, if unconfirmed transactions are there +$CLI $B1ARGS gettransaction $TXID1_UNCONFIRMED > /dev/null 2>&1 +if [[ $? -ne 0 ]] ; then + echoerr "gettransaction1_1: $TXID1_UNCONFIRMED failed" + CleanUp + exit 1 +fi +$CLI $B2ARGS gettransaction $TXID2_UNCONFIRMED > /dev/null 2>&1 +if [[ $? -ne 0 ]] ; then + echoerr "gettransaction2_1: $TXID2_UNCONFIRMED failed" + CleanUp + exit 1 +fi + +# stop nodes +$CLI $B2ARGS stop > /dev/null 2>&1 +wait $B2PID +$CLI $B1ARGS stop > /dev/null 2>&1 +wait $B1PID + +# restart nodes with -zapwallettxes +$BITCOIND -zapwallettxes=1 $B1ARGS & +B1PID=$! +$BITCOIND -zapwallettxes=2 $B2ARGS & +B2PID=$! + +# check if confirmed transactions are there +$CLI $B1ARGS gettransaction $TXID1_DEFAULT > /dev/null 2>&1 +if [[ $? -ne 0 ]] ; then + echoerr "check confirmed transaction 1: $TXID1_DEFAULT failed" + CleanUp + exit 1 +fi +$CLI $B2ARGS gettransaction $TXID2_DEFAULT > /dev/null 2>&1 +if [[ $? -ne 0 ]] ; then + echoerr "check confirmed transaction 2: $TXID2_DEFAULT failed" + CleanUp + exit 1 +fi +$CLI $B1ARGS gettransaction $TXID1_TESTACCOUNT > /dev/null 2>&1 +if [[ $? -ne 0 ]] ; then + echoerr "check confirmed transaction 3: $TXID1_TESTACCOUNT failed" + CleanUp + exit 1 +fi +$CLI $B2ARGS gettransaction $TXID2_TESTACCOUNT > /dev/null 2>&1 +if [[ $? -ne 0 ]] ; then + echoerr "check confirmed transaction 4: $TXID2_TESTACCOUNT failed" + CleanUp + exit 1 +fi + +# check if unconfirmed transaction is gone +$CLI $B1ARGS gettransaction $TXID1_UNCONFIRMED > /dev/null 2>&1 +if [[ $? -eq 0 ]] ; then + echoerr "check unconfirmed transaction 1: $TXID1_UNCONFIRMED failed" + CleanUp + exit 1 +fi +$CLI $B2ARGS gettransaction $TXID2_UNCONFIRMED > /dev/null 2>&1 +if [[ $? -eq 0 ]] ; then + echoerr "check unconfirmed transaction 2: $TXID2_UNCONFIRMED failed" + CleanUp + exit 1 +fi + +# check zapwallet mode 1, testaccount balance must be 9 (keeping transaction metadata) +CheckBalance $B1ARGS 9 "testaccount" + +# check zapwallet mode 2, testaccount balance must be 10 (dropping transaction metadata) +CheckBalance $B2ARGS 10 "testaccount" + +echo "Tests successful, cleaning up" +CleanUp +exit 0 diff --git a/src/init.cpp b/src/init.cpp index 39453da9c8..b9af16a156 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -259,7 +259,8 @@ std::string HelpMessage(HelpMessageMode hmm) strUsage += " -upgradewallet " + _("Upgrade wallet to latest format") + " " + _("on startup") + "\n"; strUsage += " -wallet= " + _("Specify wallet file (within data directory)") + " " + _("(default: wallet.dat)") + "\n"; strUsage += " -walletnotify= " + _("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)") + "\n"; - strUsage += " -zapwallettxes " + _("Clear list of wallet transactions (diagnostic tool; implies -rescan)") + "\n"; + strUsage += " -zapwallettxes= " + _("Delete all wallet transactions and only recover those part of the blockchain through -rescan on startup") + "\n"; + strUsage += " " + _("(default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)") + "\n"; #endif strUsage += "\n" + _("Debugging/Testing options:") + "\n"; @@ -529,7 +530,7 @@ bool AppInit2(boost::thread_group& threadGroup) // -zapwallettx implies a rescan if (GetBoolArg("-zapwallettxes", false)) { if (SoftSetBoolArg("-rescan", true)) - LogPrintf("AppInit2 : parameter interaction: -zapwallettxes=1 -> setting -rescan=1\n"); + LogPrintf("AppInit2 : parameter interaction: -zapwallettxes= -> setting -rescan=1\n"); } // Make sure enough file descriptors are available @@ -986,11 +987,15 @@ bool AppInit2(boost::thread_group& threadGroup) pwalletMain = NULL; LogPrintf("Wallet disabled!\n"); } else { + + // needed to restore wallet transaction meta data after -zapwallettxes + std::vector vWtx; + if (GetBoolArg("-zapwallettxes", false)) { uiInterface.InitMessage(_("Zapping all transactions from wallet...")); pwalletMain = new CWallet(strWalletFile); - DBErrors nZapWalletRet = pwalletMain->ZapWalletTx(); + DBErrors nZapWalletRet = pwalletMain->ZapWalletTx(vWtx); if (nZapWalletRet != DB_LOAD_OK) { uiInterface.InitMessage(_("Error loading wallet.dat: Wallet corrupted")); return false; @@ -1085,6 +1090,29 @@ bool AppInit2(boost::thread_group& threadGroup) LogPrintf(" rescan %15dms\n", GetTimeMillis() - nStart); pwalletMain->SetBestChain(chainActive.GetLocator()); nWalletDBUpdated++; + + // Restore wallet transaction metadata after -zapwallettxes=1 + if (GetBoolArg("-zapwallettxes", false) && GetArg("-zapwallettxes", "1") != "2") + { + BOOST_FOREACH(const CWalletTx& wtxOld, vWtx) + { + uint256 hash = wtxOld.GetHash(); + std::map::iterator mi = pwalletMain->mapWallet.find(hash); + if (mi != pwalletMain->mapWallet.end()) + { + const CWalletTx* copyFrom = &wtxOld; + CWalletTx* copyTo = &mi->second; + copyTo->mapValue = copyFrom->mapValue; + copyTo->vOrderForm = copyFrom->vOrderForm; + copyTo->nTimeReceived = copyFrom->nTimeReceived; + copyTo->nTimeSmart = copyFrom->nTimeSmart; + copyTo->fFromMe = copyFrom->fFromMe; + copyTo->strFromAccount = copyFrom->strFromAccount; + copyTo->nOrderPos = copyFrom->nOrderPos; + copyTo->WriteToDisk(); + } + } + } } } // (!fDisableWallet) #else // ENABLE_WALLET diff --git a/src/wallet.cpp b/src/wallet.cpp index 400c966a95..36e40b1fc8 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1511,11 +1511,11 @@ DBErrors CWallet::LoadWallet(bool& fFirstRunRet) } -DBErrors CWallet::ZapWalletTx() +DBErrors CWallet::ZapWalletTx(std::vector& vWtx) { if (!fFileBacked) return DB_LOAD_OK; - DBErrors nZapWalletTxRet = CWalletDB(strWalletFile,"cr+").ZapWalletTx(this); + DBErrors nZapWalletTxRet = CWalletDB(strWalletFile,"cr+").ZapWalletTx(this, vWtx); if (nZapWalletTxRet == DB_NEED_REWRITE) { if (CDB::Rewrite(strWalletFile, "\x04pool")) diff --git a/src/wallet.h b/src/wallet.h index 7df656fc25..b168116f49 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -341,7 +341,7 @@ public: void SetBestChain(const CBlockLocator& loc); DBErrors LoadWallet(bool& fFirstRunRet); - DBErrors ZapWalletTx(); + DBErrors ZapWalletTx(std::vector& vWtx); bool SetAddressBook(const CTxDestination& address, const std::string& strName, const std::string& purpose); diff --git a/src/walletdb.cpp b/src/walletdb.cpp index 80e9dded5f..3ce2ef019c 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -680,7 +680,7 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet) return result; } -DBErrors CWalletDB::FindWalletTx(CWallet* pwallet, vector& vTxHash) +DBErrors CWalletDB::FindWalletTx(CWallet* pwallet, vector& vTxHash, vector& vWtx) { pwallet->vchDefaultKey = CPubKey(); CWalletScanState wss; @@ -725,7 +725,11 @@ DBErrors CWalletDB::FindWalletTx(CWallet* pwallet, vector& vTxHash) uint256 hash; ssKey >> hash; + CWalletTx wtx; + ssValue >> wtx; + vTxHash.push_back(hash); + vWtx.push_back(wtx); } } pcursor->close(); @@ -743,11 +747,11 @@ DBErrors CWalletDB::FindWalletTx(CWallet* pwallet, vector& vTxHash) return result; } -DBErrors CWalletDB::ZapWalletTx(CWallet* pwallet) +DBErrors CWalletDB::ZapWalletTx(CWallet* pwallet, vector& vWtx) { // build list of wallet TXs vector vTxHash; - DBErrors err = FindWalletTx(pwallet, vTxHash); + DBErrors err = FindWalletTx(pwallet, vTxHash, vWtx); if (err != DB_LOAD_OK) return err; diff --git a/src/walletdb.h b/src/walletdb.h index 3bfb436050..8eb716acbb 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -122,8 +122,8 @@ public: DBErrors ReorderTransactions(CWallet*); DBErrors LoadWallet(CWallet* pwallet); - DBErrors FindWalletTx(CWallet* pwallet, std::vector& vTxHash); - DBErrors ZapWalletTx(CWallet* pwallet); + DBErrors FindWalletTx(CWallet* pwallet, std::vector& vTxHash, std::vector& vWtx); + DBErrors ZapWalletTx(CWallet* pwallet, std::vector& vWtx); static bool Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys); static bool Recover(CDBEnv& dbenv, std::string filename); }; From b3c912d93a2d1cf98f894c28adaf94204174c6d7 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Wed, 11 Jun 2014 13:58:16 +0200 Subject: [PATCH 0186/1288] [Qt] Change Coin control labels and tooltips because of non-rounding fees --- src/qt/coincontroldialog.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index 42d6da7d37..f6e757f457 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -521,7 +521,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) sPriorityLabel = CoinControlDialog::getPriorityLabel(dPriority); // Fee - int64_t nFee = payTxFee.GetFee(nBytes); + int64_t nFee = payTxFee.GetFee(max((unsigned int)1000, nBytes)); // Min Fee int64_t nMinFee = GetMinFee(txDummy, nBytes, AllowFree(dPriority), GMF_SEND); @@ -582,6 +582,13 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) l6->setText(sPriorityLabel); // Priority l7->setText(fDust ? tr("yes") : tr("no")); // Dust l8->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nChange)); // Change + if (nPayFee > 0) + { + l3->setText("~" + l3->text()); + l4->setText("~" + l4->text()); + if (nChange > 0) + l8->setText("~" + l8->text()); + } // turn labels "red" l5->setStyleSheet((nBytes >= 1000) ? "color:red;" : ""); // Bytes >= 1000 @@ -599,12 +606,22 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) QString toolTip3 = tr("This label turns red, if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minRelayTxFee.GetFee(546))); + // how many satoshis the estimated fee can vary per byte we guess wrong + double dFeeVary = (double)std::max(CTransaction::minTxFee.GetFeePerK(), payTxFee.GetFeePerK()) / 1000; + QString toolTip4 = tr("Can vary +/- %1 satoshi(s) per input.").arg(dFeeVary); + + l3->setToolTip(toolTip4); + l4->setToolTip(toolTip4); l5->setToolTip(toolTip1); l6->setToolTip(toolTip2); l7->setToolTip(toolTip3); + l8->setToolTip(toolTip4); + dialog->findChild("labelCoinControlFeeText") ->setToolTip(l3->toolTip()); + dialog->findChild("labelCoinControlAfterFeeText") ->setToolTip(l4->toolTip()); dialog->findChild("labelCoinControlBytesText") ->setToolTip(l5->toolTip()); dialog->findChild("labelCoinControlPriorityText") ->setToolTip(l6->toolTip()); dialog->findChild("labelCoinControlLowOutputText")->setToolTip(l7->toolTip()); + dialog->findChild("labelCoinControlChangeText") ->setToolTip(l8->toolTip()); // Insufficient funds QLabel *label = dialog->findChild("labelCoinControlInsuffFunds"); From 11404af34c5e3d5aa334e1cfd8edee82fb9dc9a4 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 13 Jun 2014 19:18:13 -0400 Subject: [PATCH 0187/1288] sanity: autoconf check for sys/select.h --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d8521ad3ad..81a32f9fb7 100644 --- a/configure.ac +++ b/configure.ac @@ -368,7 +368,7 @@ if test x$TARGET_OS = xdarwin; then AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"]) fi -AC_CHECK_HEADERS([stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h]) +AC_CHECK_HEADERS([stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h]) dnl Check for MSG_NOSIGNAL AC_MSG_CHECKING(for MSG_NOSIGNAL) From 679240d0e92f71b38cefd23e3d99e8ebf63c2508 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 13 Jun 2014 19:19:35 -0400 Subject: [PATCH 0188/1288] sanity: add libc/stdlib sanity checks These are meant to test our back-compat stubs, but they are enabled for all builds for the sake of consistency. --- src/Makefile.am | 5 ++- src/compat/glibc_sanity.cpp | 61 +++++++++++++++++++++++++++++++++++ src/compat/glibcxx_sanity.cpp | 61 +++++++++++++++++++++++++++++++++++ src/compat/sanity.h | 7 ++++ 4 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 src/compat/glibc_sanity.cpp create mode 100644 src/compat/glibcxx_sanity.cpp create mode 100644 src/compat/sanity.h diff --git a/src/Makefile.am b/src/Makefile.am index 0a76829197..e1542203f8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -85,7 +85,8 @@ BITCOIN_CORE_H = \ util.h \ version.h \ walletdb.h \ - wallet.h + wallet.h \ + compat/sanity.h JSON_H = \ json/json_spirit.h \ @@ -154,6 +155,8 @@ libbitcoin_common_a_SOURCES = \ sync.cpp \ util.cpp \ version.cpp \ + compat/glibc_sanity.cpp \ + compat/glibcxx_sanity.cpp \ $(BITCOIN_CORE_H) if GLIBC_BACK_COMPAT diff --git a/src/compat/glibc_sanity.cpp b/src/compat/glibc_sanity.cpp new file mode 100644 index 0000000000..1f64df9e33 --- /dev/null +++ b/src/compat/glibc_sanity.cpp @@ -0,0 +1,61 @@ +#include "bitcoin-config.h" + +#include +#if defined(HAVE_SYS_SELECT_H) +#include +#endif + +extern "C" void* memcpy(void* a, const void* b, size_t c); +void* memcpy_int(void* a, const void* b, size_t c) +{ + return memcpy(a,b,c); +} + +namespace { +// trigger: Use the memcpy_int wrapper which calls our internal memcpy. +// A direct call to memcpy may be optimized away by the compiler. +// test: Fill an array with a sequence of integers. memcpy to a new empty array. +// Verify that the arrays are equal. Use an odd size to decrease the odds of +// the call being optimized away. +template +bool sanity_test_memcpy() +{ + unsigned int memcpy_test[T]; + unsigned int memcpy_verify[T] = {}; + for (unsigned int i = 0; i != T; ++i) + memcpy_test[i] = i; + + memcpy_int(memcpy_verify,memcpy_test,sizeof(memcpy_test)); + + for (unsigned int i = 0; i != T; ++i) + { + if(memcpy_verify[i] != i) + return false; + } + return true; +} + +#if defined(HAVE_SYS_SELECT_H) +// trigger: Call FD_SET to trigger __fdelt_chk. FORTIFY_SOURCE must be defined +// as >0 and optimizations must be set to at least -O2. +// test: Add a file descriptor to an empty fd_set. Verify that it has been +// correctly added. +bool sanity_test_fdelt() +{ + fd_set fds; + FD_ZERO(&fds); + FD_SET(0, &fds); + return FD_ISSET(0,&fds); +} +#endif + +} // anon namespace + +bool glibc_sanity_test() +{ +#if defined(HAVE_SYS_SELECT_H) + if (!sanity_test_fdelt()) + return false; +#endif + return sanity_test_memcpy<1025>(); +} diff --git a/src/compat/glibcxx_sanity.cpp b/src/compat/glibcxx_sanity.cpp new file mode 100644 index 0000000000..2ff70948fd --- /dev/null +++ b/src/compat/glibcxx_sanity.cpp @@ -0,0 +1,61 @@ +#include +#include +#include + +namespace{ + +// trigger: use ctype::widen to trigger ctype::_M_widen_init(). +// test: convert a char from narrow to wide and back. Verify that the result +// matches the original. +bool sanity_test_widen(char testchar) +{ + const std::ctype& test(std::use_facet< std::ctype >(std::locale())); + return test.narrow(test.widen(testchar),'b') == testchar; +} + +// trigger: use list::push_back and list::pop_back to trigger _M_hook and +// _M_unhook. +// test: Push a sequence of integers into a list. Pop them off and verify that +// they match the original sequence. +bool sanity_test_list(unsigned int size) +{ + std::list test; + for (unsigned int i = 0; i != size; ++i) + test.push_back(i+1); + + if (test.size() != size) + return false; + + while (!test.empty()) + { + if(test.back() != test.size()) + return false; + test.pop_back(); + } + return true; +} + +} // anon namespace + +// trigger: string::at(x) on an empty string to trigger __throw_out_of_range_fmt. +// test: force std::string to throw an out_of_range exception. Verify that +// it's caught correctly. +bool sanity_test_range_fmt() +{ + std::string test; + try + { + test.at(1); + } + catch (const std::out_of_range&) + { + return true; + } + catch (...){} + return false; +} + +bool glibcxx_sanity_test() +{ + return sanity_test_widen('a') && sanity_test_list(100) && sanity_test_range_fmt(); +} diff --git a/src/compat/sanity.h b/src/compat/sanity.h new file mode 100644 index 0000000000..a221f69dfc --- /dev/null +++ b/src/compat/sanity.h @@ -0,0 +1,7 @@ +#ifndef BITCON_COMPAT_SANITY_H +#define BITCON_COMPAT_SANITY_H + +bool glibc_sanity_test(); +bool glibcxx_sanity_test(); + +#endif From 92a6220711b3f98c3daad8a8dcdf13f09ce484fd Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 13 Jun 2014 19:23:01 -0400 Subject: [PATCH 0189/1288] sanity: hook up sanity checks --- src/init.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 39453da9c8..f3df3cb375 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -31,6 +31,7 @@ #ifndef WIN32 #include #endif +#include "compat/sanity.h" #include #include @@ -417,8 +418,8 @@ bool InitSanityCheck(void) "information, visit https://en.bitcoin.it/wiki/OpenSSL_and_EC_Libraries"); return false; } - - // TODO: remaining sanity checks, see #4081 + if (!glibc_sanity_test() || !glibcxx_sanity_test()) + return false; return true; } From 7ad720d89020837ba1831055d8ee4eb955075f89 Mon Sep 17 00:00:00 2001 From: dllud Date: Tue, 17 Jun 2014 04:22:47 +0100 Subject: [PATCH 0190/1288] Added encryptwallet call to bitrpc.py This was the only call requiring password input which was still missing. Much useful to avoid leaving a plain text passphrase in the shell log. --- contrib/bitrpc/bitrpc.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/contrib/bitrpc/bitrpc.py b/contrib/bitrpc/bitrpc.py index a84d7e34dd..02577b1b6a 100644 --- a/contrib/bitrpc/bitrpc.py +++ b/contrib/bitrpc/bitrpc.py @@ -22,6 +22,18 @@ if cmd == "backupwallet": print access.backupwallet(path) except: print "\n---An error occurred---\n" + +elif cmd == "encryptwallet": + try: + pwd = getpass.getpass(prompt="Enter passphrase: ") + pwd2 = getpass.getpass(prompt="Repeat passphrase: ") + if pwd == pwd2: + access.encryptwallet(pwd) + print "\n---Wallet encrypted. Server stopping, restart to run with encrypted wallet---\n" + else: + print "\n---Passphrases do not match---\n" + except: + print "\n---An error occurred---\n" elif cmd == "getaccount": try: From 1020f599f33d47812a5ed73366fd266a25fef32d Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 17 Jun 2014 09:13:52 +0200 Subject: [PATCH 0191/1288] add comment to HelpMessage() to ensure alphabetical ordering - also rename hmm to mode, to be consistent between .h and .cpp --- src/init.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 39453da9c8..dd5e4cf3b0 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -195,8 +195,9 @@ bool static Bind(const CService &addr, unsigned int flags) { return true; } -std::string HelpMessage(HelpMessageMode hmm) +std::string HelpMessage(HelpMessageMode mode) { + // When adding new options to the categories, please keep and ensure alphabetical ordering. string strUsage = _("Options:") + "\n"; strUsage += " -? " + _("This help message") + "\n"; strUsage += " -alertnotify= " + _("Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)") + "\n"; @@ -204,7 +205,7 @@ std::string HelpMessage(HelpMessageMode hmm) strUsage += " -checkblocks= " + _("How many blocks to check at startup (default: 288, 0 = all)") + "\n"; strUsage += " -checklevel= " + _("How thorough the block verification of -checkblocks is (0-4, default: 3)") + "\n"; strUsage += " -conf= " + _("Specify configuration file (default: bitcoin.conf)") + "\n"; - if (hmm == HMM_BITCOIND) + if (mode == HMM_BITCOIND) { #if !defined(WIN32) strUsage += " -daemon " + _("Run in the background as a daemon and accept commands") + "\n"; @@ -278,7 +279,7 @@ std::string HelpMessage(HelpMessageMode hmm) strUsage += " " + _("If is not supplied, output all debugging information.") + "\n"; strUsage += " " + _(" can be:"); strUsage += " addrman, alert, coindb, db, lock, rand, rpc, selectcoins, mempool, net"; // Don't translate these and qt below - if (hmm == HMM_BITCOIN_QT) + if (mode == HMM_BITCOIN_QT) strUsage += ", qt"; strUsage += ".\n"; strUsage += " -gen " + _("Generate coins (default: 0)") + "\n"; From b82b7ec3dcbeda9e9f5de9bac05cc63c492e662e Mon Sep 17 00:00:00 2001 From: jtimon Date: Thu, 12 Jun 2014 13:48:31 +0200 Subject: [PATCH 0192/1288] Get rid of Params().RPCisTestNet() --- src/chainparams.cpp | 3 --- src/chainparams.h | 3 --- src/rpcmining.cpp | 2 +- src/rpcmisc.cpp | 2 +- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 6b2cfa1d1f..31eac62d48 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -178,7 +178,6 @@ public: fDefaultCheckMemPool = false; fAllowMinDifficultyBlocks = false; fRequireStandard = true; - fRPCisTestNet = false; fMineBlocksOnDemand = false; } }; @@ -230,7 +229,6 @@ public: fDefaultCheckMemPool = false; fAllowMinDifficultyBlocks = true; fRequireStandard = false; - fRPCisTestNet = true; fMineBlocksOnDemand = false; } }; @@ -269,7 +267,6 @@ public: fDefaultCheckMemPool = true; fAllowMinDifficultyBlocks = true; fRequireStandard = false; - fRPCisTestNet = true; fMineBlocksOnDemand = true; } }; diff --git a/src/chainparams.h b/src/chainparams.h index 28a51cbb0c..c0a6ebda6b 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -70,8 +70,6 @@ public: bool AllowMinDifficultyBlocks() const { return fAllowMinDifficultyBlocks; } /* Make standard checks */ bool RequireStandard() const { return fRequireStandard; } - /* Make standard checks */ - bool RPCisTestNet() const { return fRPCisTestNet; } const std::string& DataDir() const { return strDataDir; } /* Make miner stop after a block is found. In RPC, don't return * until nGenProcLimit blocks are generated */ @@ -110,7 +108,6 @@ protected: bool fDefaultCheckMemPool; bool fAllowMinDifficultyBlocks; bool fRequireStandard; - bool fRPCisTestNet; bool fMineBlocksOnDemand; }; diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 3caf7d89fe..e18e44c5ef 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -268,7 +268,7 @@ Value getmininginfo(const Array& params, bool fHelp) obj.push_back(Pair("genproclimit", (int)GetArg("-genproclimit", -1))); obj.push_back(Pair("networkhashps", getnetworkhashps(params, false))); obj.push_back(Pair("pooledtx", (uint64_t)mempool.size())); - obj.push_back(Pair("testnet", Params().RPCisTestNet())); + obj.push_back(Pair("testnet", Params().NetworkID() == CChainParams::TESTNET)); #ifdef ENABLE_WALLET obj.push_back(Pair("generate", getgenerate(params, false))); obj.push_back(Pair("hashespersec", gethashespersec(params, false))); diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 77e0e09ec3..5181aa23d8 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -73,7 +73,7 @@ Value getinfo(const Array& params, bool fHelp) obj.push_back(Pair("connections", (int)vNodes.size())); obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string()))); obj.push_back(Pair("difficulty", (double)GetDifficulty())); - obj.push_back(Pair("testnet", Params().RPCisTestNet())); + obj.push_back(Pair("testnet", Params().NetworkID() == CChainParams::TESTNET)); #ifdef ENABLE_WALLET if (pwalletMain) { obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime())); From f6984e814134d2383e1353ce8aa951649f5fcbd2 Mon Sep 17 00:00:00 2001 From: jtimon Date: Thu, 12 Jun 2014 14:52:12 +0200 Subject: [PATCH 0193/1288] Add "chain" to getmininginfo, improve help in getblockchaininfo --- src/rpcblockchain.cpp | 2 +- src/rpcmining.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 0fabc86872..580c6bd5ba 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -438,7 +438,7 @@ Value getblockchaininfo(const Array& params, bool fHelp) "Returns an object containing various state info regarding block chain processing.\n" "\nResult:\n" "{\n" - " \"chain\": \"xxxx\", (string) current chain (main, testnet3, regtest)\n" + " \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n" " \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n" " \"bestblockhash\": \"...\", (string) the hash of the currently best block\n" " \"difficulty\": xxxxxx, (numeric) the current difficulty\n" diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index e18e44c5ef..57a51c0fde 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -253,6 +253,7 @@ Value getmininginfo(const Array& params, bool fHelp) " \"hashespersec\": n (numeric) The hashes per second of the generation, or 0 if no generation.\n" " \"pooledtx\": n (numeric) The size of the mem pool\n" " \"testnet\": true|false (boolean) If using testnet or not\n" + " \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n" "}\n" "\nExamples:\n" + HelpExampleCli("getmininginfo", "") @@ -269,6 +270,7 @@ Value getmininginfo(const Array& params, bool fHelp) obj.push_back(Pair("networkhashps", getnetworkhashps(params, false))); obj.push_back(Pair("pooledtx", (uint64_t)mempool.size())); obj.push_back(Pair("testnet", Params().NetworkID() == CChainParams::TESTNET)); + obj.push_back(Pair("chain", Params().NetworkIDString())); #ifdef ENABLE_WALLET obj.push_back(Pair("generate", getgenerate(params, false))); obj.push_back(Pair("hashespersec", gethashespersec(params, false))); From 33e5b4291036bbdad075f4a549491af72d8a0618 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 17 Jun 2014 09:09:12 +0200 Subject: [PATCH 0194/1288] rpc: Ignore and log errors during cancel Cancelling the RPC acceptors can sometimes result in an error about a bad file descriptor. As this is the shutdown sequence we need to continue nevertheless, ignore these errors, log a warning and proceed. Fixes #4352. --- src/rpcserver.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index d4ceb7f995..2f7f5cc2ad 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -700,11 +700,20 @@ void StopRPCThreads() // First, cancel all timers and acceptors // This is not done automatically by ->stop(), and in some cases the destructor of // asio::io_service can hang if this is skipped. + boost::system::error_code ec; BOOST_FOREACH(const boost::shared_ptr &acceptor, rpc_acceptors) - acceptor->cancel(); + { + acceptor->cancel(ec); + if (ec) + LogPrintf("%s: Warning: %s when cancelling acceptor", __func__, ec.message()); + } rpc_acceptors.clear(); BOOST_FOREACH(const PAIRTYPE(std::string, boost::shared_ptr) &timer, deadlineTimers) - timer.second->cancel(); + { + timer.second->cancel(ec); + if (ec) + LogPrintf("%s: Warning: %s when cancelling timer", __func__, ec.message()); + } deadlineTimers.clear(); rpc_io_service->stop(); From 6afa49329de860c080cdfd9b1c65afe313a43860 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 19 Jun 2014 08:19:07 +0200 Subject: [PATCH 0195/1288] rpc: Add acceptors only when listening succeeded --- src/rpcserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 2f7f5cc2ad..56b5f2de0b 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -642,7 +642,6 @@ void StartRPCThreads() LogPrintf("Binding RPC on address %s port %i (IPv4+IPv6 bind any: %i)\n", bindAddress.to_string(), endpoint.port(), bBindAny); boost::system::error_code v6_only_error; boost::shared_ptr acceptor(new ip::tcp::acceptor(*rpc_io_service)); - rpc_acceptors.push_back(acceptor); try { acceptor->open(endpoint.protocol()); @@ -658,6 +657,7 @@ void StartRPCThreads() RPCListen(acceptor, *rpc_ssl_context, fUseSSL); fListening = true; + rpc_acceptors.push_back(acceptor); // If dual IPv6/IPv4 bind succesful, skip binding to IPv4 separately if(bBindAny && bindAddress == asio::ip::address_v6::any() && !v6_only_error) break; From ea3acaf383ade60d39643b786db5b6942b8b7991 Mon Sep 17 00:00:00 2001 From: Pavel Vasin Date: Fri, 20 Jun 2014 16:32:57 +0400 Subject: [PATCH 0196/1288] AvailableCoins: acquire cs_main mutex It's required when called from WalletModel --- src/wallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index 400c966a95..3176cf893a 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1028,7 +1028,7 @@ void CWallet::AvailableCoins(vector& vCoins, bool fOnlyConfirmed, const vCoins.clear(); { - LOCK(cs_wallet); + LOCK2(cs_main, cs_wallet); for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const uint256& wtxid = it->first; From fc0c07eb64f4bc22377c35d13c71de9e2ede8861 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sat, 21 Jun 2014 14:26:21 +0200 Subject: [PATCH 0197/1288] small cleanup in src/compat .h and .cpp - add license header - fix include guards - fix indentation --- src/compat/glibc_compat.cpp | 17 +++++++++--- src/compat/glibc_sanity.cpp | 8 +++++- src/compat/glibcxx_compat.cpp | 50 ++++++++++++++++++++--------------- src/compat/glibcxx_sanity.cpp | 6 ++++- src/compat/sanity.h | 6 ++++- 5 files changed, 58 insertions(+), 29 deletions(-) diff --git a/src/compat/glibc_compat.cpp b/src/compat/glibc_compat.cpp index 5b73e6051a..bb870c01f8 100644 --- a/src/compat/glibc_compat.cpp +++ b/src/compat/glibc_compat.cpp @@ -1,19 +1,28 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#if defined(HAVE_CONFIG_H) #include "bitcoin-config.h" +#endif + #include +#if defined(HAVE_SYS_SELECT_H) #include +#endif // Prior to GLIBC_2.14, memcpy was aliased to memmove. extern "C" void* memmove(void* a, const void* b, size_t c); extern "C" void* memcpy(void* a, const void* b, size_t c) { - return memmove(a, b, c); + return memmove(a, b, c); } extern "C" void __chk_fail (void) __attribute__((__noreturn__)); extern "C" FDELT_TYPE __fdelt_warn(FDELT_TYPE a) { - if (a >= FD_SETSIZE) - __chk_fail (); - return a / __NFDBITS; + if (a >= FD_SETSIZE) + __chk_fail (); + return a / __NFDBITS; } extern "C" FDELT_TYPE __fdelt_chk(FDELT_TYPE) __attribute__((weak, alias("__fdelt_warn"))); diff --git a/src/compat/glibc_sanity.cpp b/src/compat/glibc_sanity.cpp index 1f64df9e33..6e5bae8a48 100644 --- a/src/compat/glibc_sanity.cpp +++ b/src/compat/glibc_sanity.cpp @@ -1,4 +1,10 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#if defined(HAVE_CONFIG_H) #include "bitcoin-config.h" +#endif #include #if defined(HAVE_SYS_SELECT_H) @@ -8,7 +14,7 @@ extern "C" void* memcpy(void* a, const void* b, size_t c); void* memcpy_int(void* a, const void* b, size_t c) { - return memcpy(a,b,c); + return memcpy(a,b,c); } namespace { diff --git a/src/compat/glibcxx_compat.cpp b/src/compat/glibcxx_compat.cpp index e91376f818..417166aeda 100644 --- a/src/compat/glibcxx_compat.cpp +++ b/src/compat/glibcxx_compat.cpp @@ -1,49 +1,55 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include #include #include #include #ifndef _GLIBCXX_USE_NOEXCEPT - #define _GLIBCXX_USE_NOEXCEPT throw() +#define _GLIBCXX_USE_NOEXCEPT throw() #endif namespace std { const char* bad_exception::what() const throw() { - return "std::bad_exception"; + return "std::bad_exception"; } const char* bad_cast::what() const throw() { - return "std::bad_cast"; + return "std::bad_cast"; } const char* bad_alloc::what() const throw() { - return "std::bad_alloc"; + return "std::bad_alloc"; } namespace __detail { struct _List_node_base { - void _M_hook(std::__detail::_List_node_base* const __position) throw () __attribute__((used)) - { - _M_next = __position; - _M_prev = __position->_M_prev; - __position->_M_prev->_M_next = this; - __position->_M_prev = this; - } - void _M_unhook() __attribute__((used)) - { - _List_node_base* const __next_node = _M_next; - _List_node_base* const __prev_node = _M_prev; - __prev_node->_M_next = __next_node; - __next_node->_M_prev = __prev_node; - } - _List_node_base* _M_next; - _List_node_base* _M_prev; + void _M_hook(std::__detail::_List_node_base* const __position) throw () __attribute__((used)) + { + _M_next = __position; + _M_prev = __position->_M_prev; + __position->_M_prev->_M_next = this; + __position->_M_prev = this; + } + + void _M_unhook() __attribute__((used)) + { + _List_node_base* const __next_node = _M_next; + _List_node_base* const __prev_node = _M_prev; + __prev_node->_M_next = __next_node; + __next_node->_M_prev = __prev_node; + } + + _List_node_base* _M_next; + _List_node_base* _M_prev; }; } // namespace detail @@ -61,8 +67,8 @@ out_of_range::~out_of_range() _GLIBCXX_USE_NOEXCEPT { } // Used with permission. // See: https://github.com/madlib/madlib/commit/c3db418c0d34d6813608f2137fef1012ce03043d -void -ctype::_M_widen_init() const { +void ctype::_M_widen_init() const +{ char __tmp[sizeof(_M_widen)]; for (unsigned __i = 0; __i < sizeof(_M_widen); ++__i) __tmp[__i] = __i; diff --git a/src/compat/glibcxx_sanity.cpp b/src/compat/glibcxx_sanity.cpp index 2ff70948fd..cd8da4fd67 100644 --- a/src/compat/glibcxx_sanity.cpp +++ b/src/compat/glibcxx_sanity.cpp @@ -1,5 +1,9 @@ -#include +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include +#include #include namespace{ diff --git a/src/compat/sanity.h b/src/compat/sanity.h index a221f69dfc..e7df44307a 100644 --- a/src/compat/sanity.h +++ b/src/compat/sanity.h @@ -1,7 +1,11 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #ifndef BITCON_COMPAT_SANITY_H #define BITCON_COMPAT_SANITY_H bool glibc_sanity_test(); bool glibcxx_sanity_test(); -#endif +#endif // BITCON_COMPAT_SANITY_H From 806fd19ecba0d58bf238a7b6f78e080da03eb9c7 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 21 Jun 2014 17:00:38 +0200 Subject: [PATCH 0198/1288] Allocate receive buffers in on the fly --- src/net.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/net.cpp b/src/net.cpp index 757a06aaed..707f58f8a6 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -678,7 +678,6 @@ int CNetMessage::readHeader(const char *pch, unsigned int nBytes) // switch state to reading message data in_data = true; - vRecv.resize(hdr.nMessageSize); return nCopy; } @@ -688,6 +687,11 @@ int CNetMessage::readData(const char *pch, unsigned int nBytes) unsigned int nRemaining = hdr.nMessageSize - nDataPos; unsigned int nCopy = std::min(nRemaining, nBytes); + if (vRecv.size() < nDataPos + nCopy) { + // Allocate up to 256 KiB ahead, but never more than the total message size. + vRecv.resize(std::min(hdr.nMessageSize, nDataPos + nCopy + 256 * 1024)); + } + memcpy(&vRecv[nDataPos], pch, nCopy); nDataPos += nCopy; From 99ddc6cb706e825e54da244a10d4d6389fc5eaae Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Fri, 6 Jun 2014 03:15:55 -0400 Subject: [PATCH 0199/1288] Add nLocalServices info to RPC getinfo Also show full 64 bits of services. Previously service bits >32 that were advertised just didn't show up at all. --- src/rpcnet.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 0eca55a472..6fc86eedfb 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -80,7 +80,7 @@ Value getpeerinfo(const Array& params, bool fHelp) " {\n" " \"addr\":\"host:port\", (string) The ip address and port of the peer\n" " \"addrlocal\":\"ip:port\", (string) local address\n" - " \"services\":\"00000001\", (string) The services\n" + " \"services\":\"xxxxxxxxxxxxxxxx\", (string) The services offered\n" " \"lastsend\": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last send\n" " \"lastrecv\": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last receive\n" " \"bytessent\": n, (numeric) The total bytes sent\n" @@ -115,7 +115,7 @@ Value getpeerinfo(const Array& params, bool fHelp) obj.push_back(Pair("addr", stats.addrName)); if (!(stats.addrLocal.empty())) obj.push_back(Pair("addrlocal", stats.addrLocal)); - obj.push_back(Pair("services", strprintf("%08x", stats.nServices))); + obj.push_back(Pair("services", strprintf("%016x", stats.nServices))); obj.push_back(Pair("lastsend", stats.nLastSend)); obj.push_back(Pair("lastrecv", stats.nLastRecv)); obj.push_back(Pair("bytessent", stats.nSendBytes)); @@ -344,6 +344,7 @@ Value getnetworkinfo(const Array& params, bool fHelp) "{\n" " \"version\": xxxxx, (numeric) the server version\n" " \"protocolversion\": xxxxx, (numeric) the protocol version\n" + " \"localservices\": \"xxxxxxxxxxxxxxxx\", (string) the services we offer to the network\n" " \"timeoffset\": xxxxx, (numeric) the time offset\n" " \"connections\": xxxxx, (numeric) the number of connections\n" " \"proxy\": \"host:port\", (string, optional) the proxy used by the server\n" @@ -365,6 +366,7 @@ Value getnetworkinfo(const Array& params, bool fHelp) Object obj; obj.push_back(Pair("version", (int)CLIENT_VERSION)); obj.push_back(Pair("protocolversion",(int)PROTOCOL_VERSION)); + obj.push_back(Pair("localservices", strprintf("%016x", nLocalServices))); obj.push_back(Pair("timeoffset", GetTimeOffset())); obj.push_back(Pair("connections", (int)vNodes.size())); obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string()))); From 38405ac1411ce73f6945f296980d559e2949027f Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Sat, 21 Jun 2014 09:05:24 -0400 Subject: [PATCH 0200/1288] Add comment regarding experimental-use service bits As per mailing list discussion. --- src/protocol.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/protocol.h b/src/protocol.h index 6de5d05a72..1f23274299 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -64,6 +64,14 @@ class CMessageHeader enum { NODE_NETWORK = (1 << 0), + + // Bits 24-31 are reserved for temporary experiments. Just pick a bit that + // isn't getting used, or one not being used much, and notify the + // bitcoin-development mailing list. Remember that service bits are just + // unauthenticated advertisements, so your code must be robust against + // collisions and other cases where nodes may be advertising a service they + // do not actually support. Other service bits should be allocated via the + // BIP process. }; /** A CService with information about it as peer */ From 977cdadea8a77eed04f1f0fd341ba9dedc3fa783 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 20 Apr 2014 17:36:25 +0200 Subject: [PATCH 0201/1288] Add a built-in SHA256/SHA512 implementation. This also moves the HMAC-SHA512 implementation to sha2.cpp. --- src/Makefile.am | 2 + src/Makefile.test.include | 2 + src/hash.cpp | 41 -- src/hash.h | 10 - src/key.cpp | 19 +- src/sha2.cpp | 428 ++++++++++++++++++++ src/sha2.h | 54 +++ src/test/{hmac_tests.cpp => sha2_tests.cpp} | 56 ++- 8 files changed, 536 insertions(+), 76 deletions(-) create mode 100644 src/sha2.cpp create mode 100644 src/sha2.h rename src/test/{hmac_tests.cpp => sha2_tests.cpp} (53%) diff --git a/src/Makefile.am b/src/Makefile.am index e1542203f8..4e94d47066 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -75,6 +75,7 @@ BITCOIN_CORE_H = \ rpcserver.h \ script.h \ serialize.h \ + sha2.h \ sync.h \ threadsafety.h \ tinyformat.h \ @@ -152,6 +153,7 @@ libbitcoin_common_a_SOURCES = \ protocol.cpp \ rpcprotocol.cpp \ script.cpp \ + sha2.cpp \ sync.cpp \ util.cpp \ version.cpp \ diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 988830260c..93723309af 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -33,6 +33,7 @@ BITCOIN_TESTS =\ test/compress_tests.cpp \ test/DoS_tests.cpp \ test/getarg_tests.cpp \ + test/hash_tests.cpp \ test/key_tests.cpp \ test/main_tests.cpp \ test/miner_tests.cpp \ @@ -44,6 +45,7 @@ BITCOIN_TESTS =\ test/script_P2SH_tests.cpp \ test/script_tests.cpp \ test/serialize_tests.cpp \ + test/sha2_tests.cpp \ test/sigopcount_tests.cpp \ test/test_bitcoin.cpp \ test/transaction_tests.cpp \ diff --git a/src/hash.cpp b/src/hash.cpp index 7b054bd154..bddd8abf38 100644 --- a/src/hash.cpp +++ b/src/hash.cpp @@ -56,44 +56,3 @@ unsigned int MurmurHash3(unsigned int nHashSeed, const std::vectorctxOuter); - SHA512_Update(&pctx->ctxOuter, key, 128); - - for (int n=0; n<128; n++) - key[n] ^= 0x5c ^ 0x36; - SHA512_Init(&pctx->ctxInner); - return SHA512_Update(&pctx->ctxInner, key, 128); -} - -int HMAC_SHA512_Update(HMAC_SHA512_CTX *pctx, const void *pdata, size_t len) -{ - return SHA512_Update(&pctx->ctxInner, pdata, len); -} - -int HMAC_SHA512_Final(unsigned char *pmd, HMAC_SHA512_CTX *pctx) -{ - unsigned char buf[64]; - SHA512_Final(buf, &pctx->ctxInner); - SHA512_Update(&pctx->ctxOuter, buf, 64); - return SHA512_Final(pmd, &pctx->ctxOuter); -} diff --git a/src/hash.h b/src/hash.h index 7dbf1b6448..718b627a78 100644 --- a/src/hash.h +++ b/src/hash.h @@ -126,14 +126,4 @@ inline uint160 Hash160(const std::vector& vch) unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector& vDataToHash); -typedef struct -{ - SHA512_CTX ctxInner; - SHA512_CTX ctxOuter; -} HMAC_SHA512_CTX; - -int HMAC_SHA512_Init(HMAC_SHA512_CTX *pctx, const void *pkey, size_t len); -int HMAC_SHA512_Update(HMAC_SHA512_CTX *pctx, const void *pdata, size_t len); -int HMAC_SHA512_Final(unsigned char *pmd, HMAC_SHA512_CTX *pctx); - #endif diff --git a/src/key.cpp b/src/key.cpp index 4747beffb4..0685948922 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -4,6 +4,8 @@ #include "key.h" +#include "sha2.h" + #include #include #include @@ -510,12 +512,10 @@ void static BIP32Hash(const unsigned char chainCode[32], unsigned int nChild, un num[1] = (nChild >> 16) & 0xFF; num[2] = (nChild >> 8) & 0xFF; num[3] = (nChild >> 0) & 0xFF; - HMAC_SHA512_CTX ctx; - HMAC_SHA512_Init(&ctx, chainCode, 32); - HMAC_SHA512_Update(&ctx, &header, 1); - HMAC_SHA512_Update(&ctx, data, 32); - HMAC_SHA512_Update(&ctx, num, 4); - HMAC_SHA512_Final(output, &ctx); + CHMAC_SHA512(chainCode, 32).Write(&header, 1) + .Write(data, 32) + .Write(num, 4) + .Finalize(output); } bool CKey::Derive(CKey& keyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const { @@ -562,13 +562,10 @@ bool CExtKey::Derive(CExtKey &out, unsigned int nChild) const { } void CExtKey::SetMaster(const unsigned char *seed, unsigned int nSeedLen) { - static const char hashkey[] = {'B','i','t','c','o','i','n',' ','s','e','e','d'}; - HMAC_SHA512_CTX ctx; - HMAC_SHA512_Init(&ctx, hashkey, sizeof(hashkey)); - HMAC_SHA512_Update(&ctx, seed, nSeedLen); + static const unsigned char hashkey[] = {'B','i','t','c','o','i','n',' ','s','e','e','d'}; unsigned char out[64]; LockObject(out); - HMAC_SHA512_Final(out, &ctx); + CHMAC_SHA512(hashkey, sizeof(hashkey)).Write(seed, nSeedLen).Finalize(out); key.Set(&out[0], &out[32], true); memcpy(vchChainCode, &out[32], 32); UnlockObject(out); diff --git a/src/sha2.cpp b/src/sha2.cpp new file mode 100644 index 0000000000..c9beaf220b --- /dev/null +++ b/src/sha2.cpp @@ -0,0 +1,428 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "sha2.h" + +#include + +// Internal implementation code. +namespace { + +/** Read 4 bytes, and interpret them as a 32-bit unsigned big-endian integer. */ +uint32_t inline ReadBE32(const unsigned char *data) { + return ((uint32_t)data[0] << 24 | (uint32_t)data[1] << 16 | (uint32_t)data[2] << 8 | (uint32_t)data[3]); +} + +/** Write a 32-bit unsigned big-endian integer. */ +void inline WriteBE32(unsigned char *data, uint32_t x) { + data[0] = x >> 24; + data[1] = x >> 16; + data[2] = x >> 8; + data[3] = x; +} + +/** Read 8 bytes, and interpret them as a 64-bit unsigned big-endian integer. */ +uint64_t inline ReadBE64(const unsigned char *data) { + return ((uint64_t)data[0] << 56 | (uint64_t)data[1] << 48 | (uint64_t)data[2] << 40 | (uint64_t)data[3] << 32 | + (uint64_t)data[4] << 24 | (uint64_t)data[5] << 16 | (uint64_t)data[6] << 8 | (uint64_t)data[7]); +} + +/** Write a 64-bit unsigned big-endian integer. */ +void inline WriteBE64(unsigned char *data, uint64_t x) { + data[0] = x >> 56; + data[1] = x >> 48; + data[2] = x >> 40; + data[3] = x >> 32; + data[4] = x >> 24; + data[5] = x >> 16; + data[6] = x >> 8; + data[7] = x; +} + +/// Internal SHA-256 implementation. +namespace sha256 { + +uint32_t inline Ch(uint32_t x, uint32_t y, uint32_t z) { return z ^ (x & (y ^ z)); } +uint32_t inline Maj(uint32_t x, uint32_t y, uint32_t z) { return (x & y) | (z & (x | y)); } +uint32_t inline Sigma0(uint32_t x) { return (x >> 2 | x << 30) ^ (x >> 13 | x << 19) ^ (x >> 22 | x << 10); } +uint32_t inline Sigma1(uint32_t x) { return (x >> 6 | x << 26) ^ (x >> 11 | x << 21) ^ (x >> 25 | x << 7); } +uint32_t inline sigma0(uint32_t x) { return (x >> 7 | x << 25) ^ (x >> 18 | x << 14) ^ (x >> 3); } +uint32_t inline sigma1(uint32_t x) { return (x >> 17 | x << 15) ^ (x >> 19 | x << 13) ^ (x >> 10); } + +/** One round of SHA-256. */ +void inline Round(uint32_t a, uint32_t b, uint32_t c, uint32_t &d, + uint32_t e, uint32_t f, uint32_t g, uint32_t &h, + uint32_t k, uint32_t w) { + uint32_t t1 = h + Sigma1(e) + Ch(e, f, g) + k + w; + uint32_t t2 = Sigma0(a) + Maj(a, b, c); + d += t1; + h = t1 + t2; +} + +/** Initialize SHA-256 state. */ +void inline Initialize(uint32_t *s) { + s[0] = 0x6a09e667ul; + s[1] = 0xbb67ae85ul; + s[2] = 0x3c6ef372ul; + s[3] = 0xa54ff53aul; + s[4] = 0x510e527ful; + s[5] = 0x9b05688cul; + s[6] = 0x1f83d9abul; + s[7] = 0x5be0cd19ul; +} + +/** Perform one SHA-256 transformation, processing a 64-byte chunk. */ +void Transform(uint32_t *s, const unsigned char *chunk) { + uint32_t a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5], g = s[6], h = s[7]; + uint32_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15; + + Round(a, b, c, d, e, f, g, h, 0x428a2f98, w0 = ReadBE32(chunk + 0)); + Round(h, a, b, c, d, e, f, g, 0x71374491, w1 = ReadBE32(chunk + 4)); + Round(g, h, a, b, c, d, e, f, 0xb5c0fbcf, w2 = ReadBE32(chunk + 8)); + Round(f, g, h, a, b, c, d, e, 0xe9b5dba5, w3 = ReadBE32(chunk + 12)); + Round(e, f, g, h, a, b, c, d, 0x3956c25b, w4 = ReadBE32(chunk + 16)); + Round(d, e, f, g, h, a, b, c, 0x59f111f1, w5 = ReadBE32(chunk + 20)); + Round(c, d, e, f, g, h, a, b, 0x923f82a4, w6 = ReadBE32(chunk + 24)); + Round(b, c, d, e, f, g, h, a, 0xab1c5ed5, w7 = ReadBE32(chunk + 28)); + Round(a, b, c, d, e, f, g, h, 0xd807aa98, w8 = ReadBE32(chunk + 32)); + Round(h, a, b, c, d, e, f, g, 0x12835b01, w9 = ReadBE32(chunk + 36)); + Round(g, h, a, b, c, d, e, f, 0x243185be, w10 = ReadBE32(chunk + 40)); + Round(f, g, h, a, b, c, d, e, 0x550c7dc3, w11 = ReadBE32(chunk + 44)); + Round(e, f, g, h, a, b, c, d, 0x72be5d74, w12 = ReadBE32(chunk + 48)); + Round(d, e, f, g, h, a, b, c, 0x80deb1fe, w13 = ReadBE32(chunk + 52)); + Round(c, d, e, f, g, h, a, b, 0x9bdc06a7, w14 = ReadBE32(chunk + 56)); + Round(b, c, d, e, f, g, h, a, 0xc19bf174, w15 = ReadBE32(chunk + 60)); + + Round(a, b, c, d, e, f, g, h, 0xe49b69c1, w0 += sigma1(w14) + w9 + sigma0( w1)); + Round(h, a, b, c, d, e, f, g, 0xefbe4786, w1 += sigma1(w15) + w10 + sigma0( w2)); + Round(g, h, a, b, c, d, e, f, 0x0fc19dc6, w2 += sigma1( w0) + w11 + sigma0( w3)); + Round(f, g, h, a, b, c, d, e, 0x240ca1cc, w3 += sigma1( w1) + w12 + sigma0( w4)); + Round(e, f, g, h, a, b, c, d, 0x2de92c6f, w4 += sigma1( w2) + w13 + sigma0( w5)); + Round(d, e, f, g, h, a, b, c, 0x4a7484aa, w5 += sigma1( w3) + w14 + sigma0( w6)); + Round(c, d, e, f, g, h, a, b, 0x5cb0a9dc, w6 += sigma1( w4) + w15 + sigma0( w7)); + Round(b, c, d, e, f, g, h, a, 0x76f988da, w7 += sigma1( w5) + w0 + sigma0( w8)); + Round(a, b, c, d, e, f, g, h, 0x983e5152, w8 += sigma1( w6) + w1 + sigma0( w9)); + Round(h, a, b, c, d, e, f, g, 0xa831c66d, w9 += sigma1( w7) + w2 + sigma0(w10)); + Round(g, h, a, b, c, d, e, f, 0xb00327c8, w10 += sigma1( w8) + w3 + sigma0(w11)); + Round(f, g, h, a, b, c, d, e, 0xbf597fc7, w11 += sigma1( w9) + w4 + sigma0(w12)); + Round(e, f, g, h, a, b, c, d, 0xc6e00bf3, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, g, h, a, b, c, 0xd5a79147, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, f, g, h, a, b, 0x06ca6351, w14 += sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, e, f, g, h, a, 0x14292967, w15 += sigma1(w13) + w8 + sigma0( w0)); + + Round(a, b, c, d, e, f, g, h, 0x27b70a85, w0 += sigma1(w14) + w9 + sigma0( w1)); + Round(h, a, b, c, d, e, f, g, 0x2e1b2138, w1 += sigma1(w15) + w10 + sigma0( w2)); + Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc, w2 += sigma1( w0) + w11 + sigma0( w3)); + Round(f, g, h, a, b, c, d, e, 0x53380d13, w3 += sigma1( w1) + w12 + sigma0( w4)); + Round(e, f, g, h, a, b, c, d, 0x650a7354, w4 += sigma1( w2) + w13 + sigma0( w5)); + Round(d, e, f, g, h, a, b, c, 0x766a0abb, w5 += sigma1( w3) + w14 + sigma0( w6)); + Round(c, d, e, f, g, h, a, b, 0x81c2c92e, w6 += sigma1( w4) + w15 + sigma0( w7)); + Round(b, c, d, e, f, g, h, a, 0x92722c85, w7 += sigma1( w5) + w0 + sigma0( w8)); + Round(a, b, c, d, e, f, g, h, 0xa2bfe8a1, w8 += sigma1( w6) + w1 + sigma0( w9)); + Round(h, a, b, c, d, e, f, g, 0xa81a664b, w9 += sigma1( w7) + w2 + sigma0(w10)); + Round(g, h, a, b, c, d, e, f, 0xc24b8b70, w10 += sigma1( w8) + w3 + sigma0(w11)); + Round(f, g, h, a, b, c, d, e, 0xc76c51a3, w11 += sigma1( w9) + w4 + sigma0(w12)); + Round(e, f, g, h, a, b, c, d, 0xd192e819, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, g, h, a, b, c, 0xd6990624, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, f, g, h, a, b, 0xf40e3585, w14 += sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, e, f, g, h, a, 0x106aa070, w15 += sigma1(w13) + w8 + sigma0( w0)); + + Round(a, b, c, d, e, f, g, h, 0x19a4c116, w0 += sigma1(w14) + w9 + sigma0( w1)); + Round(h, a, b, c, d, e, f, g, 0x1e376c08, w1 += sigma1(w15) + w10 + sigma0( w2)); + Round(g, h, a, b, c, d, e, f, 0x2748774c, w2 += sigma1( w0) + w11 + sigma0( w3)); + Round(f, g, h, a, b, c, d, e, 0x34b0bcb5, w3 += sigma1( w1) + w12 + sigma0( w4)); + Round(e, f, g, h, a, b, c, d, 0x391c0cb3, w4 += sigma1( w2) + w13 + sigma0( w5)); + Round(d, e, f, g, h, a, b, c, 0x4ed8aa4a, w5 += sigma1( w3) + w14 + sigma0( w6)); + Round(c, d, e, f, g, h, a, b, 0x5b9cca4f, w6 += sigma1( w4) + w15 + sigma0( w7)); + Round(b, c, d, e, f, g, h, a, 0x682e6ff3, w7 += sigma1( w5) + w0 + sigma0( w8)); + Round(a, b, c, d, e, f, g, h, 0x748f82ee, w8 += sigma1( w6) + w1 + sigma0( w9)); + Round(h, a, b, c, d, e, f, g, 0x78a5636f, w9 += sigma1( w7) + w2 + sigma0(w10)); + Round(g, h, a, b, c, d, e, f, 0x84c87814, w10 += sigma1( w8) + w3 + sigma0(w11)); + Round(f, g, h, a, b, c, d, e, 0x8cc70208, w11 += sigma1( w9) + w4 + sigma0(w12)); + Round(e, f, g, h, a, b, c, d, 0x90befffa, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, g, h, a, b, c, 0xa4506ceb, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, f, g, h, a, b, 0xbef9a3f7, w14 + sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, e, f, g, h, a, 0xc67178f2, w15 + sigma1(w13) + w8 + sigma0( w0)); + + s[0] += a; + s[1] += b; + s[2] += c; + s[3] += d; + s[4] += e; + s[5] += f; + s[6] += g; + s[7] += h; +} + +} // namespace sha256 + +/// Internal SHA-512 implementation. +namespace sha512 { + +uint64_t inline Ch(uint64_t x, uint64_t y, uint64_t z) { return z ^ (x & (y ^ z)); } +uint64_t inline Maj(uint64_t x, uint64_t y, uint64_t z) { return (x & y) | (z & (x | y)); } +uint64_t inline Sigma0(uint64_t x) { return (x >> 28 | x << 36) ^ (x >> 34 | x << 30) ^ (x >> 39 | x << 25); } +uint64_t inline Sigma1(uint64_t x) { return (x >> 14 | x << 50) ^ (x >> 18 | x << 46) ^ (x >> 41 | x << 23); } +uint64_t inline sigma0(uint64_t x) { return (x >> 1 | x << 63) ^ (x >> 8 | x << 56) ^ (x >> 7); } +uint64_t inline sigma1(uint64_t x) { return (x >> 19 | x << 45) ^ (x >> 61 | x << 3) ^ (x >> 6); } + +/** One round of SHA-512. */ +void inline Round(uint64_t a, uint64_t b, uint64_t c, uint64_t &d, + uint64_t e, uint64_t f, uint64_t g, uint64_t &h, + uint64_t k, uint64_t w) { + uint64_t t1 = h + Sigma1(e) + Ch(e, f, g) + k + w; + uint64_t t2 = Sigma0(a) + Maj(a, b, c); + d += t1; + h = t1 + t2; +} + +/** Initialize SHA-256 state. */ +void inline Initialize(uint64_t *s) { + s[0] = 0x6a09e667f3bcc908ull; + s[1] = 0xbb67ae8584caa73bull; + s[2] = 0x3c6ef372fe94f82bull; + s[3] = 0xa54ff53a5f1d36f1ull; + s[4] = 0x510e527fade682d1ull; + s[5] = 0x9b05688c2b3e6c1full; + s[6] = 0x1f83d9abfb41bd6bull; + s[7] = 0x5be0cd19137e2179ull; +} + +/** Perform one SHA-512 transformation, processing a 128-byte chunk. */ +void Transform(uint64_t *s, const unsigned char *chunk) { + uint64_t a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5], g = s[6], h = s[7]; + uint64_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15; + + Round(a, b, c, d, e, f, g, h, 0x428a2f98d728ae22ull, w0 = ReadBE64(chunk + 0)); + Round(h, a, b, c, d, e, f, g, 0x7137449123ef65cdull, w1 = ReadBE64(chunk + 8)); + Round(g, h, a, b, c, d, e, f, 0xb5c0fbcfec4d3b2full, w2 = ReadBE64(chunk + 16)); + Round(f, g, h, a, b, c, d, e, 0xe9b5dba58189dbbcull, w3 = ReadBE64(chunk + 24)); + Round(e, f, g, h, a, b, c, d, 0x3956c25bf348b538ull, w4 = ReadBE64(chunk + 32)); + Round(d, e, f, g, h, a, b, c, 0x59f111f1b605d019ull, w5 = ReadBE64(chunk + 40)); + Round(c, d, e, f, g, h, a, b, 0x923f82a4af194f9bull, w6 = ReadBE64(chunk + 48)); + Round(b, c, d, e, f, g, h, a, 0xab1c5ed5da6d8118ull, w7 = ReadBE64(chunk + 56)); + Round(a, b, c, d, e, f, g, h, 0xd807aa98a3030242ull, w8 = ReadBE64(chunk + 64)); + Round(h, a, b, c, d, e, f, g, 0x12835b0145706fbeull, w9 = ReadBE64(chunk + 72)); + Round(g, h, a, b, c, d, e, f, 0x243185be4ee4b28cull, w10 = ReadBE64(chunk + 80)); + Round(f, g, h, a, b, c, d, e, 0x550c7dc3d5ffb4e2ull, w11 = ReadBE64(chunk + 88)); + Round(e, f, g, h, a, b, c, d, 0x72be5d74f27b896full, w12 = ReadBE64(chunk + 96)); + Round(d, e, f, g, h, a, b, c, 0x80deb1fe3b1696b1ull, w13 = ReadBE64(chunk + 104)); + Round(c, d, e, f, g, h, a, b, 0x9bdc06a725c71235ull, w14 = ReadBE64(chunk + 112)); + Round(b, c, d, e, f, g, h, a, 0xc19bf174cf692694ull, w15 = ReadBE64(chunk + 120)); + + Round(a, b, c, d, e, f, g, h, 0xe49b69c19ef14ad2ull, w0 += sigma1(w14) + w9 + sigma0( w1)); + Round(h, a, b, c, d, e, f, g, 0xefbe4786384f25e3ull, w1 += sigma1(w15) + w10 + sigma0( w2)); + Round(g, h, a, b, c, d, e, f, 0x0fc19dc68b8cd5b5ull, w2 += sigma1( w0) + w11 + sigma0( w3)); + Round(f, g, h, a, b, c, d, e, 0x240ca1cc77ac9c65ull, w3 += sigma1( w1) + w12 + sigma0( w4)); + Round(e, f, g, h, a, b, c, d, 0x2de92c6f592b0275ull, w4 += sigma1( w2) + w13 + sigma0( w5)); + Round(d, e, f, g, h, a, b, c, 0x4a7484aa6ea6e483ull, w5 += sigma1( w3) + w14 + sigma0( w6)); + Round(c, d, e, f, g, h, a, b, 0x5cb0a9dcbd41fbd4ull, w6 += sigma1( w4) + w15 + sigma0( w7)); + Round(b, c, d, e, f, g, h, a, 0x76f988da831153b5ull, w7 += sigma1( w5) + w0 + sigma0( w8)); + Round(a, b, c, d, e, f, g, h, 0x983e5152ee66dfabull, w8 += sigma1( w6) + w1 + sigma0( w9)); + Round(h, a, b, c, d, e, f, g, 0xa831c66d2db43210ull, w9 += sigma1( w7) + w2 + sigma0(w10)); + Round(g, h, a, b, c, d, e, f, 0xb00327c898fb213full, w10 += sigma1( w8) + w3 + sigma0(w11)); + Round(f, g, h, a, b, c, d, e, 0xbf597fc7beef0ee4ull, w11 += sigma1( w9) + w4 + sigma0(w12)); + Round(e, f, g, h, a, b, c, d, 0xc6e00bf33da88fc2ull, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, g, h, a, b, c, 0xd5a79147930aa725ull, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, f, g, h, a, b, 0x06ca6351e003826full, w14 += sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, e, f, g, h, a, 0x142929670a0e6e70ull, w15 += sigma1(w13) + w8 + sigma0( w0)); + + Round(a, b, c, d, e, f, g, h, 0x27b70a8546d22ffcull, w0 += sigma1(w14) + w9 + sigma0( w1)); + Round(h, a, b, c, d, e, f, g, 0x2e1b21385c26c926ull, w1 += sigma1(w15) + w10 + sigma0( w2)); + Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc5ac42aedull, w2 += sigma1( w0) + w11 + sigma0( w3)); + Round(f, g, h, a, b, c, d, e, 0x53380d139d95b3dfull, w3 += sigma1( w1) + w12 + sigma0( w4)); + Round(e, f, g, h, a, b, c, d, 0x650a73548baf63deull, w4 += sigma1( w2) + w13 + sigma0( w5)); + Round(d, e, f, g, h, a, b, c, 0x766a0abb3c77b2a8ull, w5 += sigma1( w3) + w14 + sigma0( w6)); + Round(c, d, e, f, g, h, a, b, 0x81c2c92e47edaee6ull, w6 += sigma1( w4) + w15 + sigma0( w7)); + Round(b, c, d, e, f, g, h, a, 0x92722c851482353bull, w7 += sigma1( w5) + w0 + sigma0( w8)); + Round(a, b, c, d, e, f, g, h, 0xa2bfe8a14cf10364ull, w8 += sigma1( w6) + w1 + sigma0( w9)); + Round(h, a, b, c, d, e, f, g, 0xa81a664bbc423001ull, w9 += sigma1( w7) + w2 + sigma0(w10)); + Round(g, h, a, b, c, d, e, f, 0xc24b8b70d0f89791ull, w10 += sigma1( w8) + w3 + sigma0(w11)); + Round(f, g, h, a, b, c, d, e, 0xc76c51a30654be30ull, w11 += sigma1( w9) + w4 + sigma0(w12)); + Round(e, f, g, h, a, b, c, d, 0xd192e819d6ef5218ull, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, g, h, a, b, c, 0xd69906245565a910ull, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, f, g, h, a, b, 0xf40e35855771202aull, w14 += sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, e, f, g, h, a, 0x106aa07032bbd1b8ull, w15 += sigma1(w13) + w8 + sigma0( w0)); + + Round(a, b, c, d, e, f, g, h, 0x19a4c116b8d2d0c8ull, w0 += sigma1(w14) + w9 + sigma0( w1)); + Round(h, a, b, c, d, e, f, g, 0x1e376c085141ab53ull, w1 += sigma1(w15) + w10 + sigma0( w2)); + Round(g, h, a, b, c, d, e, f, 0x2748774cdf8eeb99ull, w2 += sigma1( w0) + w11 + sigma0( w3)); + Round(f, g, h, a, b, c, d, e, 0x34b0bcb5e19b48a8ull, w3 += sigma1( w1) + w12 + sigma0( w4)); + Round(e, f, g, h, a, b, c, d, 0x391c0cb3c5c95a63ull, w4 += sigma1( w2) + w13 + sigma0( w5)); + Round(d, e, f, g, h, a, b, c, 0x4ed8aa4ae3418acbull, w5 += sigma1( w3) + w14 + sigma0( w6)); + Round(c, d, e, f, g, h, a, b, 0x5b9cca4f7763e373ull, w6 += sigma1( w4) + w15 + sigma0( w7)); + Round(b, c, d, e, f, g, h, a, 0x682e6ff3d6b2b8a3ull, w7 += sigma1( w5) + w0 + sigma0( w8)); + Round(a, b, c, d, e, f, g, h, 0x748f82ee5defb2fcull, w8 += sigma1( w6) + w1 + sigma0( w9)); + Round(h, a, b, c, d, e, f, g, 0x78a5636f43172f60ull, w9 += sigma1( w7) + w2 + sigma0(w10)); + Round(g, h, a, b, c, d, e, f, 0x84c87814a1f0ab72ull, w10 += sigma1( w8) + w3 + sigma0(w11)); + Round(f, g, h, a, b, c, d, e, 0x8cc702081a6439ecull, w11 += sigma1( w9) + w4 + sigma0(w12)); + Round(e, f, g, h, a, b, c, d, 0x90befffa23631e28ull, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, g, h, a, b, c, 0xa4506cebde82bde9ull, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, f, g, h, a, b, 0xbef9a3f7b2c67915ull, w14 += sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, e, f, g, h, a, 0xc67178f2e372532bull, w15 += sigma1(w13) + w8 + sigma0( w0)); + + Round(a, b, c, d, e, f, g, h, 0xca273eceea26619cull, w0 += sigma1(w14) + w9 + sigma0( w1)); + Round(h, a, b, c, d, e, f, g, 0xd186b8c721c0c207ull, w1 += sigma1(w15) + w10 + sigma0( w2)); + Round(g, h, a, b, c, d, e, f, 0xeada7dd6cde0eb1eull, w2 += sigma1( w0) + w11 + sigma0( w3)); + Round(f, g, h, a, b, c, d, e, 0xf57d4f7fee6ed178ull, w3 += sigma1( w1) + w12 + sigma0( w4)); + Round(e, f, g, h, a, b, c, d, 0x06f067aa72176fbaull, w4 += sigma1( w2) + w13 + sigma0( w5)); + Round(d, e, f, g, h, a, b, c, 0x0a637dc5a2c898a6ull, w5 += sigma1( w3) + w14 + sigma0( w6)); + Round(c, d, e, f, g, h, a, b, 0x113f9804bef90daeull, w6 += sigma1( w4) + w15 + sigma0( w7)); + Round(b, c, d, e, f, g, h, a, 0x1b710b35131c471bull, w7 += sigma1( w5) + w0 + sigma0( w8)); + Round(a, b, c, d, e, f, g, h, 0x28db77f523047d84ull, w8 += sigma1( w6) + w1 + sigma0( w9)); + Round(h, a, b, c, d, e, f, g, 0x32caab7b40c72493ull, w9 += sigma1( w7) + w2 + sigma0(w10)); + Round(g, h, a, b, c, d, e, f, 0x3c9ebe0a15c9bebcull, w10 += sigma1( w8) + w3 + sigma0(w11)); + Round(f, g, h, a, b, c, d, e, 0x431d67c49c100d4cull, w11 += sigma1( w9) + w4 + sigma0(w12)); + Round(e, f, g, h, a, b, c, d, 0x4cc5d4becb3e42b6ull, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, g, h, a, b, c, 0x597f299cfc657e2aull, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, f, g, h, a, b, 0x5fcb6fab3ad6faecull, w14 += sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, e, f, g, h, a, 0x6c44198c4a475817ull, w15 += sigma1(w13) + w8 + sigma0( w0)); + + s[0] += a; + s[1] += b; + s[2] += c; + s[3] += d; + s[4] += e; + s[5] += f; + s[6] += g; + s[7] += h; +} + +} // namespace sha512 + +} // namespace + + +////// SHA-256 + +CSHA256::CSHA256() : bytes(0) { + sha256::Initialize(s); +} + +CSHA256& CSHA256::Write(const unsigned char *data, size_t len) { + const unsigned char *end = data + len; + size_t bufsize = bytes % 64; + if (bufsize && bufsize + len >= 64) { + // Fill the buffer, and process it. + memcpy(buf + bufsize, data, 64 - bufsize); + bytes += 64 - bufsize; + data += 64 - bufsize; + sha256::Transform(s, buf); + bufsize = 0; + } + while (end >= data + 64) { + // Process full chunks directly from the source. + sha256::Transform(s, data); + bytes += 64; + data += 64; + } + if (end > data) { + // Fill the buffer with what remains. + memcpy(buf + bufsize, data, end - data); + bytes += end - data; + } + return *this; +} + +void CSHA256::Finalize(unsigned char *hash) { + static const unsigned char pad[64] = {0x80}; + unsigned char sizedesc[8]; + WriteBE64(sizedesc, bytes << 3); + Write(pad, 1 + ((119 - (bytes % 64)) % 64)); + Write(sizedesc, 8); + WriteBE32(hash, s[0]); + WriteBE32(hash+4, s[1]); + WriteBE32(hash+8, s[2]); + WriteBE32(hash+12, s[3]); + WriteBE32(hash+16, s[4]); + WriteBE32(hash+20, s[5]); + WriteBE32(hash+24, s[6]); + WriteBE32(hash+28, s[7]); +} + +CSHA256& CSHA256::Reset() { + bytes = 0; + sha256::Initialize(s); + return *this; +} + +////// SHA-512 + +CSHA512::CSHA512() : bytes(0) { + sha512::Initialize(s); +} + +CSHA512& CSHA512::Write(const unsigned char *data, size_t len) { + const unsigned char *end = data + len; + size_t bufsize = bytes % 128; + if (bufsize && bufsize + len >= 128) { + // Fill the buffer, and process it. + memcpy(buf + bufsize, data, 128 - bufsize); + bytes += 128 - bufsize; + data += 128 - bufsize; + sha512::Transform(s, buf); + bufsize = 0; + } + while (end >= data + 128) { + // Process full chunks directly from the source. + sha512::Transform(s, data); + data += 128; + bytes += 128; + } + if (end > data) { + // Fill the buffer with what remains. + memcpy(buf + bufsize, data, end - data); + bytes += end - data; + } + return *this; +} + +void CSHA512::Finalize(unsigned char *hash) { + static const unsigned char pad[128] = {0x80}; + unsigned char sizedesc[16] = {0x00}; + WriteBE64(sizedesc+8, bytes << 3); + Write(pad, 1 + ((239 - (bytes % 128)) % 128)); + Write(sizedesc, 16); + WriteBE64(hash, s[0]); + WriteBE64(hash+8, s[1]); + WriteBE64(hash+16, s[2]); + WriteBE64(hash+24, s[3]); + WriteBE64(hash+32, s[4]); + WriteBE64(hash+40, s[5]); + WriteBE64(hash+48, s[6]); + WriteBE64(hash+56, s[7]); +} + +CSHA512& CSHA512::Reset() { + bytes = 0; + sha512::Initialize(s); + return *this; +} + +////// HMAC-SHA-512 + +CHMAC_SHA512::CHMAC_SHA512(const unsigned char *key, size_t keylen) { + unsigned char rkey[128]; + if (keylen <= 128) { + memcpy(rkey, key, keylen); + memset(rkey + keylen, 0, 128 - keylen); + } else { + CSHA512().Write(key, keylen).Finalize(rkey); + memset(rkey + 64, 0, 64); + } + + for (int n=0; n<128; n++) + rkey[n] ^= 0x5c; + outer.Write(rkey, 128); + + for (int n=0; n<128; n++) + rkey[n] ^= 0x5c ^ 0x36; + inner.Write(rkey, 128); +} + +void CHMAC_SHA512::Finalize(unsigned char *hash) { + unsigned char temp[64]; + inner.Finalize(temp); + outer.Write(temp, 64).Finalize(hash); +} diff --git a/src/sha2.h b/src/sha2.h new file mode 100644 index 0000000000..001bfc647c --- /dev/null +++ b/src/sha2.h @@ -0,0 +1,54 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_SHA2_H +#define BITCOIN_SHA2_H + +#include +#include + +/** A hasher class for SHA-256. */ +class CSHA256 { +private: + uint32_t s[8]; + unsigned char buf[64]; + size_t bytes; + +public: + CSHA256(); + CSHA256& Write(const unsigned char *data, size_t len); + void Finalize(unsigned char *hash); + CSHA256& Reset(); +}; + +/** A hasher class for SHA-512. */ +class CSHA512 { +private: + uint64_t s[8]; + unsigned char buf[128]; + size_t bytes; + +public: + CSHA512(); + CSHA512& Write(const unsigned char *data, size_t len); + void Finalize(unsigned char *hash); + CSHA512& Reset(); +}; + +/** A hasher class for HMAC-SHA-512. */ +class CHMAC_SHA512 { +private: + CSHA512 outer; + CSHA512 inner; + +public: + CHMAC_SHA512(const unsigned char *key, size_t keylen); + CHMAC_SHA512& Write(const unsigned char *data, size_t len) { + inner.Write(data, len); + return *this; + } + void Finalize(unsigned char *hash); +}; + +#endif diff --git a/src/test/hmac_tests.cpp b/src/test/sha2_tests.cpp similarity index 53% rename from src/test/hmac_tests.cpp rename to src/test/sha2_tests.cpp index 780ce480ce..516b942ad3 100644 --- a/src/test/hmac_tests.cpp +++ b/src/test/sha2_tests.cpp @@ -1,15 +1,49 @@ -// Copyright (c) 2013 The Bitcoin Core developers +// Copyright (c) 2014 The Bitcoin Core developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "hash.h" +#include "sha2.h" #include "util.h" +#include + #include -using namespace std; +BOOST_AUTO_TEST_SUITE(sha2_tests) -BOOST_AUTO_TEST_SUITE(hmac_tests) +void SHA256TestVector(const std::string &in, const std::string &out) { + std::vector hash; + hash.resize(32); + CSHA256().Write((unsigned char*)&in[0], in.size()).Finalize(&hash[0]); + BOOST_CHECK_EQUAL(HexStr(hash), out); +} + +void SHA512TestVector(const std::string &in, const std::string &out) { + std::vector hash; + hash.resize(64); + CSHA512().Write((unsigned char*)&in[0], in.size()).Finalize(&hash[0]); + BOOST_CHECK_EQUAL(HexStr(hash), out); +} + +BOOST_AUTO_TEST_CASE(sha256_testvectors) { + SHA256TestVector("", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"); + SHA256TestVector("abc", "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"); + SHA256TestVector("message digest", "f7846f55cf23e14eebeab5b4e1550cad5b509e3348fbc4efa3a1413d393cb650"); + SHA256TestVector("secure hash algorithm", "f30ceb2bb2829e79e4ca9753d35a8ecc00262d164cc077080295381cbd643f0d"); + SHA256TestVector("SHA256 is considered to be safe", "6819d915c73f4d1e77e4e1b52d1fa0f9cf9beaead3939f15874bd988e2a23630"); + SHA256TestVector("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", "248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1"); + SHA256TestVector("For this sample, this 63-byte string will be used as input data", "f08a78cbbaee082b052ae0708f32fa1e50c5c421aa772ba5dbb406a2ea6be342"); + SHA256TestVector("This is exactly 64 bytes long, not counting the terminating byte", "ab64eff7e88e2e46165e29f2bce41826bd4c7b3552f6b382a9e7d3af47c245f8"); + SHA256TestVector("As Bitcoin relies on 80 byte header hashes, we want to have an example for that.", "7406e8de7d6e4fffc573daef05aefb8806e7790f55eab5576f31349743cca743"); +} + +BOOST_AUTO_TEST_CASE(sha512_testvectors) { + SHA512TestVector("abc", "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f"); + SHA512TestVector("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", "204a8fc6dda82f0a0ced7beb8e08a41657c16ef468b228a8279be331a703c33596fd15c13b1b07f9aa1d3bea57789ca031ad85c7a71dd70354ec631238ca3445"); + SHA512TestVector("abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu", "8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909"); + SHA512TestVector(std::string(1000000, 'a'), "e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973ebde0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b"); + SHA512TestVector("", "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"); +} typedef struct { const char *pszKey; @@ -111,18 +145,12 @@ BOOST_AUTO_TEST_CASE(hmacsha512_testvectors) { for (unsigned int n=0; n vchKey = ParseHex(vtest[n].pszKey); - vector vchData = ParseHex(vtest[n].pszData); - vector vchMAC = ParseHex(vtest[n].pszMAC); + std::vector vchKey = ParseHex(vtest[n].pszKey); + std::vector vchData = ParseHex(vtest[n].pszData); + std::vector vchMAC = ParseHex(vtest[n].pszMAC); unsigned char vchTemp[64]; - - HMAC_SHA512_CTX ctx; - HMAC_SHA512_Init(&ctx, &vchKey[0], vchKey.size()); - HMAC_SHA512_Update(&ctx, &vchData[0], vchData.size()); - HMAC_SHA512_Final(&vchTemp[0], &ctx); - + CHMAC_SHA512(&vchKey[0], vchKey.size()).Write(&vchData[0], vchData.size()).Finalize(&vchTemp[0]); BOOST_CHECK(memcmp(&vchTemp[0], &vchMAC[0], 64) == 0); - } } From 7b4737c87805b464cd47d01a9d814df5e41b8255 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 26 Apr 2014 19:26:34 +0200 Subject: [PATCH 0202/1288] Switch script.cpp and hash.cpp to use sha2.cpp instead of OpenSSL. --- src/hash.h | 174 +++++++++++++++++++++++++++++-------------------- src/miner.cpp | 3 + src/script.cpp | 15 ++--- 3 files changed, 111 insertions(+), 81 deletions(-) diff --git a/src/hash.h b/src/hash.h index 718b627a78..9e7a67550f 100644 --- a/src/hash.h +++ b/src/hash.h @@ -6,6 +6,7 @@ #ifndef BITCOIN_HASH_H #define BITCOIN_HASH_H +#include "sha2.h" #include "serialize.h" #include "uint256.h" #include "version.h" @@ -13,48 +14,127 @@ #include #include -#include +/** A hasher class for Bitcoin's 256-bit hash (double SHA-256). */ +class CHash256 { +private: + CSHA256 sha; +public: + void Finalize(unsigned char *hash) { + unsigned char buf[32]; + sha.Finalize(buf); + sha.Reset().Write(buf, 32).Finalize(hash); + } + + CHash256& Write(const unsigned char *data, size_t len) { + sha.Write(data, len); + return *this; + } + + CHash256& Reset() { + sha.Reset(); + return *this; + } +}; + +/** A hasher class for Bitcoin's 160-bit hash (SHA-256 + RIPEMD-160). */ +class CHash160 { +private: + CSHA256 sha; +public: + void Finalize(unsigned char *hash) { + unsigned char buf[32]; + sha.Finalize(buf); + RIPEMD160(buf, 32, hash); + } + + CHash160& Write(const unsigned char *data, size_t len) { + sha.Write(data, len); + return *this; + } + + CHash160& Reset() { + sha.Reset(); + return *this; + } +}; + +/** Compute the 256-bit hash of an object. */ template inline uint256 Hash(const T1 pbegin, const T1 pend) { - static unsigned char pblank[1]; - uint256 hash1; - SHA256((pbegin == pend ? pblank : (unsigned char*)&pbegin[0]), (pend - pbegin) * sizeof(pbegin[0]), (unsigned char*)&hash1); - uint256 hash2; - SHA256((unsigned char*)&hash1, sizeof(hash1), (unsigned char*)&hash2); - return hash2; + static const unsigned char pblank[1] = {}; + uint256 result; + CHash256().Write(pbegin == pend ? pblank : (const unsigned char*)&pbegin[0], (pend - pbegin) * sizeof(pbegin[0])) + .Finalize((unsigned char*)&result); + return result; } +/** Compute the 256-bit hash of the concatenation of two objects. */ +template +inline uint256 Hash(const T1 p1begin, const T1 p1end, + const T2 p2begin, const T2 p2end) { + static const unsigned char pblank[1] = {}; + uint256 result; + CHash256().Write(p1begin == p1end ? pblank : (const unsigned char*)&p1begin[0], (p1end - p1begin) * sizeof(p1begin[0])) + .Write(p2begin == p2end ? pblank : (const unsigned char*)&p2begin[0], (p2end - p2begin) * sizeof(p2begin[0])) + .Finalize((unsigned char*)&result); + return result; +} + +/** Compute the 256-bit hash of the concatenation of three objects. */ +template +inline uint256 Hash(const T1 p1begin, const T1 p1end, + const T2 p2begin, const T2 p2end, + const T3 p3begin, const T3 p3end) { + static const unsigned char pblank[1] = {}; + uint256 result; + CHash256().Write(p1begin == p1end ? pblank : (const unsigned char*)&p1begin[0], (p1end - p1begin) * sizeof(p1begin[0])) + .Write(p2begin == p2end ? pblank : (const unsigned char*)&p2begin[0], (p2end - p2begin) * sizeof(p2begin[0])) + .Write(p3begin == p3end ? pblank : (const unsigned char*)&p3begin[0], (p3end - p3begin) * sizeof(p3begin[0])) + .Finalize((unsigned char*)&result); + return result; +} + +/** Compute the 160-bit hash an object. */ +template +inline uint160 Hash160(const T1 pbegin, const T1 pend) +{ + static unsigned char pblank[1] = {}; + uint160 result; + CHash160().Write(pbegin == pend ? pblank : (const unsigned char*)&pbegin[0], (pend - pbegin) * sizeof(pbegin[0])) + .Finalize((unsigned char*)&result); + return result; +} + +/** Compute the 160-bit hash of a vector. */ +inline uint160 Hash160(const std::vector& vch) +{ + return Hash160(vch.begin(), vch.end()); +} + +/** A writer stream (for serialization) that computes a 256-bit hash. */ class CHashWriter { private: - SHA256_CTX ctx; + CHash256 ctx; public: int nType; int nVersion; - void Init() { - SHA256_Init(&ctx); - } - - CHashWriter(int nTypeIn, int nVersionIn) : nType(nTypeIn), nVersion(nVersionIn) { - Init(); - } + CHashWriter(int nTypeIn, int nVersionIn) : nType(nTypeIn), nVersion(nVersionIn) {} CHashWriter& write(const char *pch, size_t size) { - SHA256_Update(&ctx, pch, size); + ctx.Write((const unsigned char*)pch, size); return (*this); } // invalidates the object uint256 GetHash() { - uint256 hash1; - SHA256_Final((unsigned char*)&hash1, &ctx); - uint256 hash2; - SHA256((unsigned char*)&hash1, sizeof(hash1), (unsigned char*)&hash2); - return hash2; + uint256 result; + ctx.Finalize((unsigned char*)&result); + return result; } template @@ -65,41 +145,7 @@ public: } }; - -template -inline uint256 Hash(const T1 p1begin, const T1 p1end, - const T2 p2begin, const T2 p2end) -{ - static unsigned char pblank[1]; - uint256 hash1; - SHA256_CTX ctx; - SHA256_Init(&ctx); - SHA256_Update(&ctx, (p1begin == p1end ? pblank : (unsigned char*)&p1begin[0]), (p1end - p1begin) * sizeof(p1begin[0])); - SHA256_Update(&ctx, (p2begin == p2end ? pblank : (unsigned char*)&p2begin[0]), (p2end - p2begin) * sizeof(p2begin[0])); - SHA256_Final((unsigned char*)&hash1, &ctx); - uint256 hash2; - SHA256((unsigned char*)&hash1, sizeof(hash1), (unsigned char*)&hash2); - return hash2; -} - -template -inline uint256 Hash(const T1 p1begin, const T1 p1end, - const T2 p2begin, const T2 p2end, - const T3 p3begin, const T3 p3end) -{ - static unsigned char pblank[1]; - uint256 hash1; - SHA256_CTX ctx; - SHA256_Init(&ctx); - SHA256_Update(&ctx, (p1begin == p1end ? pblank : (unsigned char*)&p1begin[0]), (p1end - p1begin) * sizeof(p1begin[0])); - SHA256_Update(&ctx, (p2begin == p2end ? pblank : (unsigned char*)&p2begin[0]), (p2end - p2begin) * sizeof(p2begin[0])); - SHA256_Update(&ctx, (p3begin == p3end ? pblank : (unsigned char*)&p3begin[0]), (p3end - p3begin) * sizeof(p3begin[0])); - SHA256_Final((unsigned char*)&hash1, &ctx); - uint256 hash2; - SHA256((unsigned char*)&hash1, sizeof(hash1), (unsigned char*)&hash2); - return hash2; -} - +/** Compute the 256-bit hash of an object's serialization. */ template uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION) { @@ -108,22 +154,6 @@ uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=PROTOCOL return ss.GetHash(); } -template -inline uint160 Hash160(const T1 pbegin, const T1 pend) -{ - static unsigned char pblank[1]; - uint256 hash1; - SHA256((pbegin == pend ? pblank : (unsigned char*)&pbegin[0]), (pend - pbegin) * sizeof(pbegin[0]), (unsigned char*)&hash1); - uint160 hash2; - RIPEMD160((unsigned char*)&hash1, sizeof(hash1), (unsigned char*)&hash2); - return hash2; -} - -inline uint160 Hash160(const std::vector& vch) -{ - return Hash160(vch.begin(), vch.end()); -} - unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector& vDataToHash); #endif diff --git a/src/miner.cpp b/src/miner.cpp index 87779efbbd..c48c9f0521 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -12,7 +12,10 @@ #include "wallet.h" #endif +#include + using namespace std; + ////////////////////////////////////////////////////////////////////////////// // // BitcoinMiner diff --git a/src/script.cpp b/src/script.cpp index 11cdfef950..f20c0bcca3 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -9,10 +9,13 @@ #include "hash.h" #include "key.h" #include "keystore.h" +#include "sha2.h" #include "sync.h" #include "uint256.h" #include "util.h" +#include + #include #include #include @@ -805,17 +808,11 @@ bool EvalScript(vector >& stack, const CScript& script, co else if (opcode == OP_SHA1) SHA1(&vch[0], vch.size(), &vchHash[0]); else if (opcode == OP_SHA256) - SHA256(&vch[0], vch.size(), &vchHash[0]); + CSHA256().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); else if (opcode == OP_HASH160) - { - uint160 hash160 = Hash160(vch); - memcpy(&vchHash[0], &hash160, sizeof(hash160)); - } + CHash160().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); else if (opcode == OP_HASH256) - { - uint256 hash = Hash(vch.begin(), vch.end()); - memcpy(&vchHash[0], &hash, sizeof(hash)); - } + CHash256().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); popstack(stack); stack.push_back(vchHash); } From cf0c47b2698a3e23654d9fd24f6b2ef9689bde3d Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 28 Apr 2014 12:52:32 +0200 Subject: [PATCH 0203/1288] Remove getwork() RPC call --- src/init.cpp | 3 - src/rpcmining.cpp | 159 ---------------------------------------------- src/rpcserver.cpp | 3 +- src/rpcserver.h | 1 - 4 files changed, 1 insertion(+), 165 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 6eab273526..12d2d1bb44 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -116,7 +116,6 @@ void Shutdown() RenameThread("bitcoin-shutoff"); mempool.AddTransactionsUpdated(1); StopRPCThreads(); - ShutdownRPCMining(); #ifdef ENABLE_WALLET if (pwalletMain) bitdb.Flush(false); @@ -1148,8 +1147,6 @@ bool AppInit2(boost::thread_group& threadGroup) #endif StartNode(threadGroup); - // InitRPCMining is needed here so getwork/getblocktemplate in the GUI debug console works properly. - InitRPCMining(); if (fServer) StartRPCThreads(); diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 57a51c0fde..a1410f0e41 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -24,36 +24,6 @@ using namespace json_spirit; using namespace std; -#ifdef ENABLE_WALLET -// Key used by getwork miners. -// Allocated in InitRPCMining, free'd in ShutdownRPCMining -static CReserveKey* pMiningKey = NULL; - -void InitRPCMining() -{ - if (!pwalletMain) - return; - - // getwork/getblocktemplate mining rewards paid here: - pMiningKey = new CReserveKey(pwalletMain); -} - -void ShutdownRPCMining() -{ - if (!pMiningKey) - return; - - delete pMiningKey; pMiningKey = NULL; -} -#else -void InitRPCMining() -{ -} -void ShutdownRPCMining() -{ -} -#endif - // Return average network hashes per second based on the last 'lookup' blocks, // or from the last difficulty change if 'lookup' is nonpositive. // If 'height' is nonnegative, compute the estimate at the time when a given block was found. @@ -131,9 +101,6 @@ Value getgenerate(const Array& params, bool fHelp) + HelpExampleRpc("getgenerate", "") ); - if (!pMiningKey) - return false; - return GetBoolArg("-gen", false); } @@ -279,132 +246,6 @@ Value getmininginfo(const Array& params, bool fHelp) } -#ifdef ENABLE_WALLET -Value getwork(const Array& params, bool fHelp) -{ - if (fHelp || params.size() > 1) - throw runtime_error( - "getwork ( \"data\" )\n" - "\nIf 'data' is not specified, it returns the formatted hash data to work on.\n" - "If 'data' is specified, tries to solve the block and returns true if it was successful.\n" - "\nArguments:\n" - "1. \"data\" (string, optional) The hex encoded data to solve\n" - "\nResult (when 'data' is not specified):\n" - "{\n" - " \"midstate\" : \"xxxx\", (string) The precomputed hash state after hashing the first half of the data (DEPRECATED)\n" // deprecated - " \"data\" : \"xxxxx\", (string) The block data\n" - " \"hash1\" : \"xxxxx\", (string) The formatted hash buffer for second hash (DEPRECATED)\n" // deprecated - " \"target\" : \"xxxx\" (string) The little endian hash target\n" - "}\n" - "\nResult (when 'data' is specified):\n" - "true|false (boolean) If solving the block specified in the 'data' was successfull\n" - "\nExamples:\n" - + HelpExampleCli("getwork", "") - + HelpExampleRpc("getwork", "") - ); - - if (vNodes.empty()) - throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Bitcoin is not connected!"); - - if (IsInitialBlockDownload()) - throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Bitcoin is downloading blocks..."); - - typedef map > mapNewBlock_t; - static mapNewBlock_t mapNewBlock; // FIXME: thread safety - static vector vNewBlockTemplate; - - if (params.size() == 0) - { - // Update block - static unsigned int nTransactionsUpdatedLast; - static CBlockIndex* pindexPrev; - static int64_t nStart; - static CBlockTemplate* pblocktemplate; - if (pindexPrev != chainActive.Tip() || - (mempool.GetTransactionsUpdated() != nTransactionsUpdatedLast && GetTime() - nStart > 60)) - { - if (pindexPrev != chainActive.Tip()) - { - // Deallocate old blocks since they're obsolete now - mapNewBlock.clear(); - BOOST_FOREACH(CBlockTemplate* pblocktemplate, vNewBlockTemplate) - delete pblocktemplate; - vNewBlockTemplate.clear(); - } - - // Clear pindexPrev so future getworks make a new block, despite any failures from here on - pindexPrev = NULL; - - // Store the pindexBest used before CreateNewBlock, to avoid races - nTransactionsUpdatedLast = mempool.GetTransactionsUpdated(); - CBlockIndex* pindexPrevNew = chainActive.Tip(); - nStart = GetTime(); - - // Create new block - pblocktemplate = CreateNewBlockWithKey(*pMiningKey); - if (!pblocktemplate) - throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory"); - vNewBlockTemplate.push_back(pblocktemplate); - - // Need to update only after we know CreateNewBlock succeeded - pindexPrev = pindexPrevNew; - } - CBlock* pblock = &pblocktemplate->block; // pointer for convenience - - // Update nTime - UpdateTime(*pblock, pindexPrev); - pblock->nNonce = 0; - - // Update nExtraNonce - static unsigned int nExtraNonce = 0; - IncrementExtraNonce(pblock, pindexPrev, nExtraNonce); - - // Save - mapNewBlock[pblock->hashMerkleRoot] = make_pair(pblock, pblock->vtx[0].vin[0].scriptSig); - - // Pre-build hash buffers - char pmidstate[32]; - char pdata[128]; - char phash1[64]; - FormatHashBuffers(pblock, pmidstate, pdata, phash1); - - uint256 hashTarget = uint256().SetCompact(pblock->nBits); - - Object result; - result.push_back(Pair("midstate", HexStr(BEGIN(pmidstate), END(pmidstate)))); // deprecated - result.push_back(Pair("data", HexStr(BEGIN(pdata), END(pdata)))); - result.push_back(Pair("hash1", HexStr(BEGIN(phash1), END(phash1)))); // deprecated - result.push_back(Pair("target", HexStr(BEGIN(hashTarget), END(hashTarget)))); - return result; - } - else - { - // Parse parameters - vector vchData = ParseHex(params[0].get_str()); - if (vchData.size() != 128) - throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter"); - CBlock* pdata = (CBlock*)&vchData[0]; - - // Byte reverse - for (int i = 0; i < 128/4; i++) - ((unsigned int*)pdata)[i] = ByteReverse(((unsigned int*)pdata)[i]); - - // Get saved block - if (!mapNewBlock.count(pdata->hashMerkleRoot)) - return false; - CBlock* pblock = mapNewBlock[pdata->hashMerkleRoot].first; - - pblock->nTime = pdata->nTime; - pblock->nNonce = pdata->nNonce; - pblock->vtx[0].vin[0].scriptSig = mapNewBlock[pdata->hashMerkleRoot].second; - pblock->hashMerkleRoot = pblock->BuildMerkleTree(); - - assert(pwalletMain != NULL); - return CheckWork(pblock, *pwalletMain, *pMiningKey); - } -} -#endif - Value getblocktemplate(const Array& params, bool fHelp) { if (fHelp || params.size() > 1) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 56b5f2de0b..93da81e429 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -315,7 +315,6 @@ static const CRPCCommand vRPCCommands[] = /* Wallet-enabled mining */ { "getgenerate", &getgenerate, true, false, false }, { "gethashespersec", &gethashespersec, true, false, false }, - { "getwork", &getwork, true, false, true }, { "setgenerate", &setgenerate, true, true, false }, #endif // ENABLE_WALLET }; @@ -772,7 +771,7 @@ void JSONRequest::parse(const Value& valRequest) if (valMethod.type() != str_type) throw JSONRPCError(RPC_INVALID_REQUEST, "Method must be a string"); strMethod = valMethod.get_str(); - if (strMethod != "getwork" && strMethod != "getblocktemplate") + if (strMethod != "getblocktemplate") LogPrint("rpc", "ThreadRPCServer method=%s\n", strMethod); // Parse params diff --git a/src/rpcserver.h b/src/rpcserver.h index 73e8b9426c..5271542385 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -130,7 +130,6 @@ extern json_spirit::Value setgenerate(const json_spirit::Array& params, bool fHe extern json_spirit::Value getnetworkhashps(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value gethashespersec(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getmininginfo(const json_spirit::Array& params, bool fHelp); -extern json_spirit::Value getwork(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getblocktemplate(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value submitblock(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value estimatefee(const json_spirit::Array& params, bool fHelp); From 85aab2a08824a83a535e6dfee4c150b25ebaf9de Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 27 Apr 2014 23:34:02 +0200 Subject: [PATCH 0204/1288] Switch miner.cpp to use sha2 instead of OpenSSL. --- src/miner.cpp | 162 +++++++-------------------------------- src/miner.h | 4 - src/test/miner_tests.cpp | 28 ------- 3 files changed, 29 insertions(+), 165 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index c48c9f0521..7efca7cfff 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -6,14 +6,13 @@ #include "miner.h" #include "core.h" +#include "hash.h" #include "main.h" #include "net.h" #ifdef ENABLE_WALLET #include "wallet.h" #endif -#include - using namespace std; ////////////////////////////////////////////////////////////////////////////// @@ -21,42 +20,6 @@ using namespace std; // BitcoinMiner // -int static FormatHashBlocks(void* pbuffer, unsigned int len) -{ - unsigned char* pdata = (unsigned char*)pbuffer; - unsigned int blocks = 1 + ((len + 8) / 64); - unsigned char* pend = pdata + 64 * blocks; - memset(pdata + len, 0, 64 * blocks - len); - pdata[len] = 0x80; - unsigned int bits = len * 8; - pend[-1] = (bits >> 0) & 0xff; - pend[-2] = (bits >> 8) & 0xff; - pend[-3] = (bits >> 16) & 0xff; - pend[-4] = (bits >> 24) & 0xff; - return blocks; -} - -static const unsigned int pSHA256InitState[8] = -{0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19}; - -void SHA256Transform(void* pstate, void* pinput, const void* pinit) -{ - SHA256_CTX ctx; - unsigned char data[64]; - - SHA256_Init(&ctx); - - for (int i = 0; i < 16; i++) - ((uint32_t*)data)[i] = ByteReverse(((uint32_t*)pinput)[i]); - - for (int i = 0; i < 8; i++) - ctx.h[i] = ((uint32_t*)pinit)[i]; - - SHA256_Update(&ctx, data, sizeof(data)); - for (int i = 0; i < 8; i++) - ((uint32_t*)pstate)[i] = ctx.h[i]; -} - // // Unconfirmed transactions in the memory pool often depend on other // transactions in the memory pool. When we select transactions from the @@ -372,51 +335,6 @@ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& } -void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1) -{ - // - // Pre-build hash buffers - // - struct - { - struct unnamed2 - { - int nVersion; - uint256 hashPrevBlock; - uint256 hashMerkleRoot; - unsigned int nTime; - unsigned int nBits; - unsigned int nNonce; - } - block; - unsigned char pchPadding0[64]; - uint256 hash1; - unsigned char pchPadding1[64]; - } - tmp; - memset(&tmp, 0, sizeof(tmp)); - - tmp.block.nVersion = pblock->nVersion; - tmp.block.hashPrevBlock = pblock->hashPrevBlock; - tmp.block.hashMerkleRoot = pblock->hashMerkleRoot; - tmp.block.nTime = pblock->nTime; - tmp.block.nBits = pblock->nBits; - tmp.block.nNonce = pblock->nNonce; - - FormatHashBlocks(&tmp.block, sizeof(tmp.block)); - FormatHashBlocks(&tmp.hash1, sizeof(tmp.hash1)); - - // Byte swap all the input buffer - for (unsigned int i = 0; i < sizeof(tmp)/4; i++) - ((unsigned int*)&tmp)[i] = ByteReverse(((unsigned int*)&tmp)[i]); - - // Precalc the first half of the first hash, which stays constant - SHA256Transform(pmidstate, &tmp.block, pSHA256InitState); - - memcpy(pdata, &tmp.block, 128); - memcpy(phash1, &tmp.hash1, 64); -} - #ifdef ENABLE_WALLET ////////////////////////////////////////////////////////////////////////////// // @@ -427,34 +345,33 @@ int64_t nHPSTimerStart = 0; // // ScanHash scans nonces looking for a hash with at least some zero bits. -// It operates on big endian data. Caller does the byte reversing. -// All input buffers are 16-byte aligned. nNonce is usually preserved -// between calls, but periodically or if nNonce is 0xffff0000 or above, -// the block is rebuilt and nNonce starts over at zero. +// The nonce is usually preserved between calls, but periodically or if the +// nonce is 0xffff0000 or above, the block is rebuilt and nNonce starts over at +// zero. // -unsigned int static ScanHash_CryptoPP(char* pmidstate, char* pdata, char* phash1, char* phash, unsigned int& nHashesDone) -{ - unsigned int& nNonce = *(unsigned int*)(pdata + 12); - for (;;) - { - // Crypto++ SHA256 - // Hash pdata using pmidstate as the starting state into - // pre-formatted buffer phash1, then hash phash1 into phash +bool static ScanHash(const CBlockHeader *pblock, uint32_t& nNonce, uint256 *phash) { + // Write the first 76 bytes of the block header to a double-SHA256 state. + CHash256 hasher; + CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); + ss << *pblock; + assert(ss.size() == 80); + hasher.Write((unsigned char*)&ss[0], 76); + + for (;;) { nNonce++; - SHA256Transform(phash1, pdata, pmidstate); - SHA256Transform(phash, phash1, pSHA256InitState); + + // Write the last 4 bytes of the block header (the nonce) to a copy of + // the double-SHA256 state, and compute the result. + CHash256(hasher).Write((unsigned char*)&nNonce, 4).Finalize((unsigned char*)phash); // Return the nonce if the hash has at least some zero bits, // caller will check if it has enough to reach the target - if (((unsigned short*)phash)[14] == 0) - return nNonce; + if (((uint16_t*)phash)[15] == 0) + return true; // If nothing found after trying for a while, return -1 if ((nNonce & 0xffff) == 0) - { - nHashesDone = 0xffff+1; - return (unsigned int) -1; - } + return false; if ((nNonce & 0xfff) == 0) boost::this_thread::interruption_point(); } @@ -541,46 +458,27 @@ void static BitcoinMiner(CWallet *pwallet) LogPrintf("Running BitcoinMiner with %u transactions in block (%u bytes)\n", pblock->vtx.size(), ::GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION)); - // - // Pre-build hash buffers - // - char pmidstatebuf[32+16]; char* pmidstate = alignup<16>(pmidstatebuf); - char pdatabuf[128+16]; char* pdata = alignup<16>(pdatabuf); - char phash1buf[64+16]; char* phash1 = alignup<16>(phash1buf); - - FormatHashBuffers(pblock, pmidstate, pdata, phash1); - - unsigned int& nBlockTime = *(unsigned int*)(pdata + 64 + 4); - unsigned int& nBlockBits = *(unsigned int*)(pdata + 64 + 8); - unsigned int& nBlockNonce = *(unsigned int*)(pdata + 64 + 12); - - // // Search // int64_t nStart = GetTime(); uint256 hashTarget = uint256().SetCompact(pblock->nBits); - uint256 hashbuf[2]; - uint256& hash = *alignup<16>(hashbuf); + uint256 hash; + uint32_t nNonce = 0; + uint32_t nOldNonce = 0; while (true) { - unsigned int nHashesDone = 0; - unsigned int nNonceFound; - - // Crypto++ SHA256 - nNonceFound = ScanHash_CryptoPP(pmidstate, pdata + 64, phash1, - (char*)&hash, nHashesDone); + bool fFound = ScanHash(pblock, nNonce, &hash); + uint32_t nHashesDone = nNonce - nOldNonce; + nOldNonce = nNonce; // Check if something found - if (nNonceFound != (unsigned int) -1) + if (fFound) { - for (unsigned int i = 0; i < sizeof(hash)/4; i++) - ((unsigned int*)&hash)[i] = ByteReverse(((unsigned int*)&hash)[i]); - if (hash <= hashTarget) { // Found a solution - pblock->nNonce = ByteReverse(nNonceFound); + pblock->nNonce = nNonce; assert(hash == pblock->GetHash()); SetThreadPriority(THREAD_PRIORITY_NORMAL); @@ -629,7 +527,7 @@ void static BitcoinMiner(CWallet *pwallet) // Regtest mode doesn't require peers if (vNodes.empty() && Params().MiningRequiresPeers()) break; - if (nBlockNonce >= 0xffff0000) + if (nNonce >= 0xffff0000) break; if (mempool.GetTransactionsUpdated() != nTransactionsUpdatedLast && GetTime() - nStart > 60) break; @@ -638,11 +536,9 @@ void static BitcoinMiner(CWallet *pwallet) // Update nTime every few seconds UpdateTime(*pblock, pindexPrev); - nBlockTime = ByteReverse(pblock->nTime); if (Params().AllowMinDifficultyBlocks()) { // Changing pblock->nTime can change work required on testnet: - nBlockBits = ByteReverse(pblock->nBits); hashTarget.SetCompact(pblock->nBits); } } diff --git a/src/miner.h b/src/miner.h index dcd61d8fd9..1fa499dc5b 100644 --- a/src/miner.h +++ b/src/miner.h @@ -23,12 +23,8 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn); CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey); /** Modify the extranonce in a block */ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce); -/** Do mining precalculation */ -void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1); /** Check mined block */ bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey); -/** Base sha256 mining transform */ -void SHA256Transform(void* pstate, void* pinput, const void* pinit); extern double dHashesPerSec; extern int64_t nHPSTimerStart; diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index b72ba0293f..bff6de41a3 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -9,8 +9,6 @@ #include -extern void SHA256Transform(void* pstate, void* pinput, const void* pinit); - BOOST_AUTO_TEST_SUITE(miner_tests) static @@ -259,30 +257,4 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) } -BOOST_AUTO_TEST_CASE(sha256transform_equality) -{ - unsigned int pSHA256InitState[8] = {0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19}; - - - // unsigned char pstate[32]; - unsigned char pinput[64]; - - int i; - - for (i = 0; i < 32; i++) { - pinput[i] = i; - pinput[i+32] = 0; - } - - uint256 hash; - - SHA256Transform(&hash, pinput, pSHA256InitState); - - BOOST_TEST_MESSAGE(hash.GetHex()); - - uint256 hash_reference("0x2df5e1c65ef9f8cde240d23cae2ec036d31a15ec64bc68f64be242b1da6631f3"); - - BOOST_CHECK(hash == hash_reference); -} - BOOST_AUTO_TEST_SUITE_END() From 1cc344ce42d8dddd6356c89ef3ceb58418676816 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 28 Apr 2014 03:09:13 +0200 Subject: [PATCH 0205/1288] Add built-in SHA-1 implementation. --- src/Makefile.am | 2 + src/Makefile.test.include | 1 + src/script.cpp | 5 +- src/sha1.cpp | 205 ++++++++++++++++++++++++++++++++++++++ src/sha1.h | 25 +++++ src/test/sha1_tests.cpp | 27 +++++ 6 files changed, 262 insertions(+), 3 deletions(-) create mode 100644 src/sha1.cpp create mode 100644 src/sha1.h create mode 100644 src/test/sha1_tests.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 4e94d47066..67b069bde1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -76,6 +76,7 @@ BITCOIN_CORE_H = \ script.h \ serialize.h \ sha2.h \ + sha1.h \ sync.h \ threadsafety.h \ tinyformat.h \ @@ -153,6 +154,7 @@ libbitcoin_common_a_SOURCES = \ protocol.cpp \ rpcprotocol.cpp \ script.cpp \ + sha1.cpp \ sha2.cpp \ sync.cpp \ util.cpp \ diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 93723309af..7cf441bd6c 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -45,6 +45,7 @@ BITCOIN_TESTS =\ test/script_P2SH_tests.cpp \ test/script_tests.cpp \ test/serialize_tests.cpp \ + test/sha1_tests.cpp \ test/sha2_tests.cpp \ test/sigopcount_tests.cpp \ test/test_bitcoin.cpp \ diff --git a/src/script.cpp b/src/script.cpp index f20c0bcca3..facf3044d6 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -9,13 +9,12 @@ #include "hash.h" #include "key.h" #include "keystore.h" +#include "sha1.h" #include "sha2.h" #include "sync.h" #include "uint256.h" #include "util.h" -#include - #include #include #include @@ -806,7 +805,7 @@ bool EvalScript(vector >& stack, const CScript& script, co if (opcode == OP_RIPEMD160) RIPEMD160(&vch[0], vch.size(), &vchHash[0]); else if (opcode == OP_SHA1) - SHA1(&vch[0], vch.size(), &vchHash[0]); + CSHA1().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); else if (opcode == OP_SHA256) CSHA256().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); else if (opcode == OP_HASH160) diff --git a/src/sha1.cpp b/src/sha1.cpp new file mode 100644 index 0000000000..0a70077544 --- /dev/null +++ b/src/sha1.cpp @@ -0,0 +1,205 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "sha1.h" + +#include + +// Internal implementation code. +namespace { + +/** Read 4 bytes, and interpret them as a 32-bit unsigned big-endian integer. */ +uint32_t inline ReadBE32(const unsigned char *data) { + return ((uint32_t)data[0] << 24 | (uint32_t)data[1] << 16 | (uint32_t)data[2] << 8 | (uint32_t)data[3]); +} + +/** Write a 32-bit unsigned big-endian integer. */ +void inline WriteBE32(unsigned char *data, uint32_t x) { + data[0] = x >> 24; + data[1] = x >> 16; + data[2] = x >> 8; + data[3] = x; +} + +/// Internal SHA-1 implementation. +namespace sha1 { + +/** One round of SHA-1. */ +void inline Round(uint32_t a, uint32_t &b, uint32_t c, uint32_t d, uint32_t &e, + uint32_t f, uint32_t k, uint32_t w) { + e += ((a << 5) | (a >> 27)) + f + k + w; + b = (b << 30) | (b >> 2); +} + +uint32_t inline f1(uint32_t b, uint32_t c, uint32_t d) { return d ^ (b & (c ^ d)); } +uint32_t inline f2(uint32_t b, uint32_t c, uint32_t d) { return b ^ c ^ d; } +uint32_t inline f3(uint32_t b, uint32_t c, uint32_t d) { return (b & c) | (d & (b | c)); } + +uint32_t inline left(uint32_t x) { return (x << 1) | (x >> 31); } + +/** Initialize SHA-1 state. */ +void inline Initialize(uint32_t *s) { + s[0] = 0x67452301ul; + s[1] = 0xEFCDAB89ul; + s[2] = 0x98BADCFEul; + s[3] = 0x10325476ul; + s[4] = 0xC3D2E1F0ul; +} + +const uint32_t k1 = 0x5A827999ul; +const uint32_t k2 = 0x6ED9EBA1ul; +const uint32_t k3 = 0x8F1BBCDCul; +const uint32_t k4 = 0xCA62C1D6ul; + +/** Perform a SHA-1 transformation, processing a 64-byte chunk. */ +void Transform(uint32_t *s, const unsigned char *chunk) { + uint32_t a = s[0], b = s[1], c = s[2], d = s[3], e = s[4]; + uint32_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15; + + Round(a, b, c, d, e, f1(b, c, d), k1, w0 = ReadBE32(chunk + 0)); + Round(e, a, b, c, d, f1(a, b, c), k1, w1 = ReadBE32(chunk + 4)); + Round(d, e, a, b, c, f1(e, a, b), k1, w2 = ReadBE32(chunk + 8)); + Round(c, d, e, a, b, f1(d, e, a), k1, w3 = ReadBE32(chunk + 12)); + Round(b, c, d, e, a, f1(c, d, e), k1, w4 = ReadBE32(chunk + 16)); + Round(a, b, c, d, e, f1(b, c, d), k1, w5 = ReadBE32(chunk + 20)); + Round(e, a, b, c, d, f1(a, b, c), k1, w6 = ReadBE32(chunk + 24)); + Round(d, e, a, b, c, f1(e, a, b), k1, w7 = ReadBE32(chunk + 28)); + Round(c, d, e, a, b, f1(d, e, a), k1, w8 = ReadBE32(chunk + 32)); + Round(b, c, d, e, a, f1(c, d, e), k1, w9 = ReadBE32(chunk + 36)); + Round(a, b, c, d, e, f1(b, c, d), k1, w10 = ReadBE32(chunk + 40)); + Round(e, a, b, c, d, f1(a, b, c), k1, w11 = ReadBE32(chunk + 44)); + Round(d, e, a, b, c, f1(e, a, b), k1, w12 = ReadBE32(chunk + 48)); + Round(c, d, e, a, b, f1(d, e, a), k1, w13 = ReadBE32(chunk + 52)); + Round(b, c, d, e, a, f1(c, d, e), k1, w14 = ReadBE32(chunk + 56)); + Round(a, b, c, d, e, f1(b, c, d), k1, w15 = ReadBE32(chunk + 60)); + + Round(e, a, b, c, d, f1(a, b, c), k1, w0 = left(w0 ^ w13 ^ w8 ^ w2 )); + Round(d, e, a, b, c, f1(e, a, b), k1, w1 = left(w1 ^ w14 ^ w9 ^ w3 )); + Round(c, d, e, a, b, f1(d, e, a), k1, w2 = left(w2 ^ w15 ^ w10 ^ w4 )); + Round(b, c, d, e, a, f1(c, d, e), k1, w3 = left(w3 ^ w0 ^ w11 ^ w5 )); + Round(a, b, c, d, e, f2(b, c, d), k2, w4 = left(w4 ^ w1 ^ w12 ^ w6 )); + Round(e, a, b, c, d, f2(a, b, c), k2, w5 = left(w5 ^ w2 ^ w13 ^ w7 )); + Round(d, e, a, b, c, f2(e, a, b), k2, w6 = left(w6 ^ w3 ^ w14 ^ w8 )); + Round(c, d, e, a, b, f2(d, e, a), k2, w7 = left(w7 ^ w4 ^ w15 ^ w9 )); + Round(b, c, d, e, a, f2(c, d, e), k2, w8 = left(w8 ^ w5 ^ w0 ^ w10)); + Round(a, b, c, d, e, f2(b, c, d), k2, w9 = left(w9 ^ w6 ^ w1 ^ w11)); + Round(e, a, b, c, d, f2(a, b, c), k2, w10 = left(w10 ^ w7 ^ w2 ^ w12)); + Round(d, e, a, b, c, f2(e, a, b), k2, w11 = left(w11 ^ w8 ^ w3 ^ w13)); + Round(c, d, e, a, b, f2(d, e, a), k2, w12 = left(w12 ^ w9 ^ w4 ^ w14)); + Round(b, c, d, e, a, f2(c, d, e), k2, w13 = left(w13 ^ w10 ^ w5 ^ w15)); + Round(a, b, c, d, e, f2(b, c, d), k2, w14 = left(w14 ^ w11 ^ w6 ^ w0 )); + Round(e, a, b, c, d, f2(a, b, c), k2, w15 = left(w15 ^ w12 ^ w7 ^ w1 )); + + Round(d, e, a, b, c, f2(e, a, b), k2, w0 = left(w0 ^ w13 ^ w8 ^ w2 )); + Round(c, d, e, a, b, f2(d, e, a), k2, w1 = left(w1 ^ w14 ^ w9 ^ w3 )); + Round(b, c, d, e, a, f2(c, d, e), k2, w2 = left(w2 ^ w15 ^ w10 ^ w4 )); + Round(a, b, c, d, e, f2(b, c, d), k2, w3 = left(w3 ^ w0 ^ w11 ^ w5 )); + Round(e, a, b, c, d, f2(a, b, c), k2, w4 = left(w4 ^ w1 ^ w12 ^ w6 )); + Round(d, e, a, b, c, f2(e, a, b), k2, w5 = left(w5 ^ w2 ^ w13 ^ w7 )); + Round(c, d, e, a, b, f2(d, e, a), k2, w6 = left(w6 ^ w3 ^ w14 ^ w8 )); + Round(b, c, d, e, a, f2(c, d, e), k2, w7 = left(w7 ^ w4 ^ w15 ^ w9 )); + Round(a, b, c, d, e, f3(b, c, d), k3, w8 = left(w8 ^ w5 ^ w0 ^ w10)); + Round(e, a, b, c, d, f3(a, b, c), k3, w9 = left(w9 ^ w6 ^ w1 ^ w11)); + Round(d, e, a, b, c, f3(e, a, b), k3, w10 = left(w10 ^ w7 ^ w2 ^ w12)); + Round(c, d, e, a, b, f3(d, e, a), k3, w11 = left(w11 ^ w8 ^ w3 ^ w13)); + Round(b, c, d, e, a, f3(c, d, e), k3, w12 = left(w12 ^ w9 ^ w4 ^ w14)); + Round(a, b, c, d, e, f3(b, c, d), k3, w13 = left(w13 ^ w10 ^ w5 ^ w15)); + Round(e, a, b, c, d, f3(a, b, c), k3, w14 = left(w14 ^ w11 ^ w6 ^ w0 )); + Round(d, e, a, b, c, f3(e, a, b), k3, w15 = left(w15 ^ w12 ^ w7 ^ w1 )); + + Round(c, d, e, a, b, f3(d, e, a), k3, w0 = left(w0 ^ w13 ^ w8 ^ w2 )); + Round(b, c, d, e, a, f3(c, d, e), k3, w1 = left(w1 ^ w14 ^ w9 ^ w3 )); + Round(a, b, c, d, e, f3(b, c, d), k3, w2 = left(w2 ^ w15 ^ w10 ^ w4 )); + Round(e, a, b, c, d, f3(a, b, c), k3, w3 = left(w3 ^ w0 ^ w11 ^ w5 )); + Round(d, e, a, b, c, f3(e, a, b), k3, w4 = left(w4 ^ w1 ^ w12 ^ w6 )); + Round(c, d, e, a, b, f3(d, e, a), k3, w5 = left(w5 ^ w2 ^ w13 ^ w7 )); + Round(b, c, d, e, a, f3(c, d, e), k3, w6 = left(w6 ^ w3 ^ w14 ^ w8 )); + Round(a, b, c, d, e, f3(b, c, d), k3, w7 = left(w7 ^ w4 ^ w15 ^ w9 )); + Round(e, a, b, c, d, f3(a, b, c), k3, w8 = left(w8 ^ w5 ^ w0 ^ w10)); + Round(d, e, a, b, c, f3(e, a, b), k3, w9 = left(w9 ^ w6 ^ w1 ^ w11)); + Round(c, d, e, a, b, f3(d, e, a), k3, w10 = left(w10 ^ w7 ^ w2 ^ w12)); + Round(b, c, d, e, a, f3(c, d, e), k3, w11 = left(w11 ^ w8 ^ w3 ^ w13)); + Round(a, b, c, d, e, f2(b, c, d), k4, w12 = left(w12 ^ w9 ^ w4 ^ w14)); + Round(e, a, b, c, d, f2(a, b, c), k4, w13 = left(w13 ^ w10 ^ w5 ^ w15)); + Round(d, e, a, b, c, f2(e, a, b), k4, w14 = left(w14 ^ w11 ^ w6 ^ w0 )); + Round(c, d, e, a, b, f2(d, e, a), k4, w15 = left(w15 ^ w12 ^ w7 ^ w1 )); + + Round(b, c, d, e, a, f2(c, d, e), k4, w0 = left(w0 ^ w13 ^ w8 ^ w2 )); + Round(a, b, c, d, e, f2(b, c, d), k4, w1 = left(w1 ^ w14 ^ w9 ^ w3 )); + Round(e, a, b, c, d, f2(a, b, c), k4, w2 = left(w2 ^ w15 ^ w10 ^ w4 )); + Round(d, e, a, b, c, f2(e, a, b), k4, w3 = left(w3 ^ w0 ^ w11 ^ w5 )); + Round(c, d, e, a, b, f2(d, e, a), k4, w4 = left(w4 ^ w1 ^ w12 ^ w6 )); + Round(b, c, d, e, a, f2(c, d, e), k4, w5 = left(w5 ^ w2 ^ w13 ^ w7 )); + Round(a, b, c, d, e, f2(b, c, d), k4, w6 = left(w6 ^ w3 ^ w14 ^ w8 )); + Round(e, a, b, c, d, f2(a, b, c), k4, w7 = left(w7 ^ w4 ^ w15 ^ w9 )); + Round(d, e, a, b, c, f2(e, a, b), k4, w8 = left(w8 ^ w5 ^ w0 ^ w10)); + Round(c, d, e, a, b, f2(d, e, a), k4, w9 = left(w9 ^ w6 ^ w1 ^ w11)); + Round(b, c, d, e, a, f2(c, d, e), k4, w10 = left(w10 ^ w7 ^ w2 ^ w12)); + Round(a, b, c, d, e, f2(b, c, d), k4, w11 = left(w11 ^ w8 ^ w3 ^ w13)); + Round(e, a, b, c, d, f2(a, b, c), k4, w12 = left(w12 ^ w9 ^ w4 ^ w14)); + Round(d, e, a, b, c, f2(e, a, b), k4, left(w13 ^ w10 ^ w5 ^ w15)); + Round(c, d, e, a, b, f2(d, e, a), k4, left(w14 ^ w11 ^ w6 ^ w0 )); + Round(b, c, d, e, a, f2(c, d, e), k4, left(w15 ^ w12 ^ w7 ^ w1 )); + + s[0] += a; + s[1] += b; + s[2] += c; + s[3] += d; + s[4] += e; +} + +} // namespace sha1 + +} // namespace + +////// SHA1 + +CSHA1::CSHA1() : bytes(0) { + sha1::Initialize(s); +} + +CSHA1& CSHA1::Write(const unsigned char *data, size_t len) { + const unsigned char *end = data + len; + size_t bufsize = bytes % 64; + if (bufsize && bufsize + len >= 64) { + // Fill the buffer, and process it. + memcpy(buf + bufsize, data, 64 - bufsize); + bytes += 64 - bufsize; + data += 64 - bufsize; + sha1::Transform(s, buf); + bufsize = 0; + } + while (end >= data + 64) { + // Process full chunks directly from the source. + sha1::Transform(s, data); + bytes += 64; + data += 64; + } + if (end > data) { + // Fill the buffer with what remains. + memcpy(buf + bufsize, data, end - data); + bytes += end - data; + } + return *this; +} + +void CSHA1::Finalize(unsigned char *hash) { + static const unsigned char pad[64] = {0x80}; + unsigned char sizedesc[8]; + WriteBE32(sizedesc, bytes >> 29); + WriteBE32(sizedesc+4, bytes << 3); + Write(pad, 1 + ((119 - (bytes % 64)) % 64)); + Write(sizedesc, 8); + WriteBE32(hash, s[0]); + WriteBE32(hash+4, s[1]); + WriteBE32(hash+8, s[2]); + WriteBE32(hash+12, s[3]); + WriteBE32(hash+16, s[4]); +} + +CSHA1& CSHA1::Reset() { + bytes = 0; + sha1::Initialize(s); + return *this; +} diff --git a/src/sha1.h b/src/sha1.h new file mode 100644 index 0000000000..6efde78a5b --- /dev/null +++ b/src/sha1.h @@ -0,0 +1,25 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_SHA1_H +#define BITCOIN_SHA1_H + +#include +#include + +/** A hasher class for SHA1. */ +class CSHA1 { +private: + uint32_t s[5]; + unsigned char buf[64]; + size_t bytes; + +public: + CSHA1(); + CSHA1& Write(const unsigned char *data, size_t len); + void Finalize(unsigned char *hash); + CSHA1& Reset(); +}; + +#endif diff --git a/src/test/sha1_tests.cpp b/src/test/sha1_tests.cpp new file mode 100644 index 0000000000..bae17c5d4a --- /dev/null +++ b/src/test/sha1_tests.cpp @@ -0,0 +1,27 @@ +// Copyright (c) 2014 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "sha1.h" +#include "util.h" + +#include + +#include + +BOOST_AUTO_TEST_SUITE(sha1_tests) + +void SHA1TestVector(const std::string &in, const std::string &out) { + std::vector hash; + hash.resize(20); + CSHA1().Write((unsigned char*)&in[0], in.size()).Finalize(&hash[0]); + BOOST_CHECK_EQUAL(HexStr(hash), out); +} + +BOOST_AUTO_TEST_CASE(sha1_testvectors) { + SHA1TestVector("abc", "a9993e364706816aba3e25717850c26c9cd0d89d"); + SHA1TestVector("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", "84983e441c3bd26ebaae4aa1f95129e5e54670f1"); + SHA1TestVector(std::string(1000000, 'a'), "34aa973cd4c4daa4f61eeb2bdbad27316534016f"); +} + +BOOST_AUTO_TEST_SUITE_END() From 13b5dfef64bbb77d583b2acc59e2b33f89645308 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 28 Apr 2014 12:20:15 +0200 Subject: [PATCH 0206/1288] Move crypto implementations to src/crypto/ --- src/Makefile.am | 8 ++++---- src/{ => crypto}/sha1.cpp | 2 +- src/{ => crypto}/sha1.h | 0 src/{ => crypto}/sha2.cpp | 2 +- src/{ => crypto}/sha2.h | 0 src/hash.h | 2 +- src/key.cpp | 2 +- src/script.cpp | 4 ++-- src/test/sha1_tests.cpp | 2 +- src/test/sha2_tests.cpp | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) rename src/{ => crypto}/sha1.cpp (99%) rename src/{ => crypto}/sha1.h (100%) rename src/{ => crypto}/sha2.cpp (99%) rename src/{ => crypto}/sha2.h (100%) diff --git a/src/Makefile.am b/src/Makefile.am index 67b069bde1..bc65119a92 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -75,8 +75,8 @@ BITCOIN_CORE_H = \ rpcserver.h \ script.h \ serialize.h \ - sha2.h \ - sha1.h \ + crypto/sha2.h \ + crypto/sha1.h \ sync.h \ threadsafety.h \ tinyformat.h \ @@ -154,8 +154,8 @@ libbitcoin_common_a_SOURCES = \ protocol.cpp \ rpcprotocol.cpp \ script.cpp \ - sha1.cpp \ - sha2.cpp \ + crypto/sha1.cpp \ + crypto/sha2.cpp \ sync.cpp \ util.cpp \ version.cpp \ diff --git a/src/sha1.cpp b/src/crypto/sha1.cpp similarity index 99% rename from src/sha1.cpp rename to src/crypto/sha1.cpp index 0a70077544..4b2e3e19d1 100644 --- a/src/sha1.cpp +++ b/src/crypto/sha1.cpp @@ -2,7 +2,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "sha1.h" +#include "crypto/sha1.h" #include diff --git a/src/sha1.h b/src/crypto/sha1.h similarity index 100% rename from src/sha1.h rename to src/crypto/sha1.h diff --git a/src/sha2.cpp b/src/crypto/sha2.cpp similarity index 99% rename from src/sha2.cpp rename to src/crypto/sha2.cpp index c9beaf220b..0d0c32883f 100644 --- a/src/sha2.cpp +++ b/src/crypto/sha2.cpp @@ -2,7 +2,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "sha2.h" +#include "crypto/sha2.h" #include diff --git a/src/sha2.h b/src/crypto/sha2.h similarity index 100% rename from src/sha2.h rename to src/crypto/sha2.h diff --git a/src/hash.h b/src/hash.h index 9e7a67550f..318399c334 100644 --- a/src/hash.h +++ b/src/hash.h @@ -6,7 +6,7 @@ #ifndef BITCOIN_HASH_H #define BITCOIN_HASH_H -#include "sha2.h" +#include "crypto/sha2.h" #include "serialize.h" #include "uint256.h" #include "version.h" diff --git a/src/key.cpp b/src/key.cpp index 0685948922..96b1ac439c 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -4,7 +4,7 @@ #include "key.h" -#include "sha2.h" +#include "crypto/sha2.h" #include #include diff --git a/src/script.cpp b/src/script.cpp index facf3044d6..c6574a6ee8 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -9,8 +9,8 @@ #include "hash.h" #include "key.h" #include "keystore.h" -#include "sha1.h" -#include "sha2.h" +#include "crypto/sha1.h" +#include "crypto/sha2.h" #include "sync.h" #include "uint256.h" #include "util.h" diff --git a/src/test/sha1_tests.cpp b/src/test/sha1_tests.cpp index bae17c5d4a..88f2da0bbb 100644 --- a/src/test/sha1_tests.cpp +++ b/src/test/sha1_tests.cpp @@ -2,7 +2,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "sha1.h" +#include "crypto/sha1.h" #include "util.h" #include diff --git a/src/test/sha2_tests.cpp b/src/test/sha2_tests.cpp index 516b942ad3..1e48c973cf 100644 --- a/src/test/sha2_tests.cpp +++ b/src/test/sha2_tests.cpp @@ -2,7 +2,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "sha2.h" +#include "crypto/sha2.h" #include "util.h" #include From a5bc9c09177420bd1c6a1f9ece9ecfbe80c453fe Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 1 May 2014 00:43:31 +0200 Subject: [PATCH 0207/1288] Add built-in RIPEMD-160 implementation --- src/Makefile.am | 2 + src/crypto/ripemd160.cpp | 217 +++++++++++++++++++++++++++++++++++++++ src/crypto/ripemd160.h | 25 +++++ src/hash.h | 5 +- src/script.cpp | 3 +- 5 files changed, 248 insertions(+), 4 deletions(-) create mode 100644 src/crypto/ripemd160.cpp create mode 100644 src/crypto/ripemd160.h diff --git a/src/Makefile.am b/src/Makefile.am index bc65119a92..d583a79032 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -77,6 +77,7 @@ BITCOIN_CORE_H = \ serialize.h \ crypto/sha2.h \ crypto/sha1.h \ + crypto/ripemd160.h \ sync.h \ threadsafety.h \ tinyformat.h \ @@ -156,6 +157,7 @@ libbitcoin_common_a_SOURCES = \ script.cpp \ crypto/sha1.cpp \ crypto/sha2.cpp \ + crypto/ripemd160.cpp \ sync.cpp \ util.cpp \ version.cpp \ diff --git a/src/crypto/ripemd160.cpp b/src/crypto/ripemd160.cpp new file mode 100644 index 0000000000..aa6874fa85 --- /dev/null +++ b/src/crypto/ripemd160.cpp @@ -0,0 +1,217 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "crypto/ripemd160.h" + +#include + +// Internal implementation code. +namespace { + +/** Read 4 bytes, and interpret them as a 32-bit unsigned little-endian integer. */ +uint32_t inline ReadLE32(const unsigned char *data) { + return ((uint32_t)data[0] | (uint32_t)data[1] << 8 | (uint32_t)data[2] << 16 | (uint32_t)data[3] << 24); +} + +/** Write a 32-bit unsigned little-endian integer. */ +void inline WriteLE32(unsigned char *data, uint32_t x) { + data[0] = x; + data[1] = x >> 8; + data[2] = x >> 16; + data[3] = x >> 24; +} + +/// Internal RIPEMD-160 implementation. +namespace ripemd160 { + +uint32_t inline f1(uint32_t x, uint32_t y, uint32_t z) { return x ^ y ^ z; } +uint32_t inline f2(uint32_t x, uint32_t y, uint32_t z) { return (x & y) | (~x & z); } +uint32_t inline f3(uint32_t x, uint32_t y, uint32_t z) { return (x | ~y) ^ z; } +uint32_t inline f4(uint32_t x, uint32_t y, uint32_t z) { return (x & z) | (y & ~z); } +uint32_t inline f5(uint32_t x, uint32_t y, uint32_t z) { return x ^ (y | ~z); } + +/** Initialize RIPEMD-160 state. */ +void inline Initialize(uint32_t *s) { + s[0] = 0x67452301ul; + s[1] = 0xEFCDAB89ul; + s[2] = 0x98BADCFEul; + s[3] = 0x10325476ul; + s[4] = 0xC3D2E1F0ul; +} + +uint32_t inline rol(uint32_t x, int i) { return (x << i) | (x >> (32-i)); } + +void inline Round(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t f, uint32_t x, uint32_t k, int r) { + a = rol(a + f + x + k, r) + e; + c = rol(c, 10); +} + +void inline R11(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f1(b, c, d), x, 0, r); } +void inline R21(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f2(b, c, d), x, 0x5A827999ul, r); } +void inline R31(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f3(b, c, d), x, 0x6ED9EBA1ul, r); } +void inline R41(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f4(b, c, d), x, 0x8F1BBCDCul, r); } +void inline R51(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f5(b, c, d), x, 0xA953FD4Eul, r); } + +void inline R12(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f5(b, c, d), x, 0x50A28BE6ul, r); } +void inline R22(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f4(b, c, d), x, 0x5C4DD124ul, r); } +void inline R32(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f3(b, c, d), x, 0x6D703EF3ul, r); } +void inline R42(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f2(b, c, d), x, 0x7A6D76E9ul, r); } +void inline R52(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f1(b, c, d), x, 0, r); } + +/** Perform a RIPEMD-160 transformation, processing a 64-byte chunk. */ +void Transform(uint32_t *s, const unsigned char *chunk) { + uint32_t a1 = s[0], b1 = s[1], c1 = s[2], d1 = s[3], e1 = s[4]; + uint32_t a2 = a1 , b2 = b1 , c2 = c1 , d2 = d1 , e2 = e1 ; + uint32_t w0 = ReadLE32(chunk + 0), w1 = ReadLE32(chunk + 4), w2 = ReadLE32(chunk + 8), w3 = ReadLE32(chunk + 12); + uint32_t w4 = ReadLE32(chunk + 16), w5 = ReadLE32(chunk + 20), w6 = ReadLE32(chunk + 24), w7 = ReadLE32(chunk + 28); + uint32_t w8 = ReadLE32(chunk + 32), w9 = ReadLE32(chunk + 36), w10 = ReadLE32(chunk + 40), w11 = ReadLE32(chunk + 44); + uint32_t w12 = ReadLE32(chunk + 48), w13 = ReadLE32(chunk + 52), w14 = ReadLE32(chunk + 56), w15 = ReadLE32(chunk + 60); + + R11(a1, b1, c1, d1, e1, w0 , 11); R12(a2, b2, c2, d2, e2, w5 , 8); + R11(e1, a1, b1, c1, d1, w1 , 14); R12(e2, a2, b2, c2, d2, w14, 9); + R11(d1, e1, a1, b1, c1, w2 , 15); R12(d2, e2, a2, b2, c2, w7 , 9); + R11(c1, d1, e1, a1, b1, w3 , 12); R12(c2, d2, e2, a2, b2, w0 , 11); + R11(b1, c1, d1, e1, a1, w4 , 5); R12(b2, c2, d2, e2, a2, w9 , 13); + R11(a1, b1, c1, d1, e1, w5 , 8); R12(a2, b2, c2, d2, e2, w2 , 15); + R11(e1, a1, b1, c1, d1, w6 , 7); R12(e2, a2, b2, c2, d2, w11, 15); + R11(d1, e1, a1, b1, c1, w7 , 9); R12(d2, e2, a2, b2, c2, w4 , 5); + R11(c1, d1, e1, a1, b1, w8 , 11); R12(c2, d2, e2, a2, b2, w13, 7); + R11(b1, c1, d1, e1, a1, w9 , 13); R12(b2, c2, d2, e2, a2, w6 , 7); + R11(a1, b1, c1, d1, e1, w10, 14); R12(a2, b2, c2, d2, e2, w15, 8); + R11(e1, a1, b1, c1, d1, w11, 15); R12(e2, a2, b2, c2, d2, w8 , 11); + R11(d1, e1, a1, b1, c1, w12, 6); R12(d2, e2, a2, b2, c2, w1 , 14); + R11(c1, d1, e1, a1, b1, w13, 7); R12(c2, d2, e2, a2, b2, w10, 14); + R11(b1, c1, d1, e1, a1, w14, 9); R12(b2, c2, d2, e2, a2, w3 , 12); + R11(a1, b1, c1, d1, e1, w15, 8); R12(a2, b2, c2, d2, e2, w12, 6); + + R21(e1, a1, b1, c1, d1, w7 , 7); R22(e2, a2, b2, c2, d2, w6 , 9); + R21(d1, e1, a1, b1, c1, w4 , 6); R22(d2, e2, a2, b2, c2, w11, 13); + R21(c1, d1, e1, a1, b1, w13, 8); R22(c2, d2, e2, a2, b2, w3 , 15); + R21(b1, c1, d1, e1, a1, w1 , 13); R22(b2, c2, d2, e2, a2, w7 , 7); + R21(a1, b1, c1, d1, e1, w10, 11); R22(a2, b2, c2, d2, e2, w0 , 12); + R21(e1, a1, b1, c1, d1, w6 , 9); R22(e2, a2, b2, c2, d2, w13, 8); + R21(d1, e1, a1, b1, c1, w15, 7); R22(d2, e2, a2, b2, c2, w5 , 9); + R21(c1, d1, e1, a1, b1, w3 , 15); R22(c2, d2, e2, a2, b2, w10, 11); + R21(b1, c1, d1, e1, a1, w12, 7); R22(b2, c2, d2, e2, a2, w14, 7); + R21(a1, b1, c1, d1, e1, w0 , 12); R22(a2, b2, c2, d2, e2, w15, 7); + R21(e1, a1, b1, c1, d1, w9 , 15); R22(e2, a2, b2, c2, d2, w8 , 12); + R21(d1, e1, a1, b1, c1, w5 , 9); R22(d2, e2, a2, b2, c2, w12, 7); + R21(c1, d1, e1, a1, b1, w2 , 11); R22(c2, d2, e2, a2, b2, w4 , 6); + R21(b1, c1, d1, e1, a1, w14, 7); R22(b2, c2, d2, e2, a2, w9 , 15); + R21(a1, b1, c1, d1, e1, w11, 13); R22(a2, b2, c2, d2, e2, w1 , 13); + R21(e1, a1, b1, c1, d1, w8 , 12); R22(e2, a2, b2, c2, d2, w2 , 11); + + R31(d1, e1, a1, b1, c1, w3 , 11); R32(d2, e2, a2, b2, c2, w15, 9); + R31(c1, d1, e1, a1, b1, w10, 13); R32(c2, d2, e2, a2, b2, w5 , 7); + R31(b1, c1, d1, e1, a1, w14, 6); R32(b2, c2, d2, e2, a2, w1 , 15); + R31(a1, b1, c1, d1, e1, w4 , 7); R32(a2, b2, c2, d2, e2, w3 , 11); + R31(e1, a1, b1, c1, d1, w9 , 14); R32(e2, a2, b2, c2, d2, w7 , 8); + R31(d1, e1, a1, b1, c1, w15, 9); R32(d2, e2, a2, b2, c2, w14, 6); + R31(c1, d1, e1, a1, b1, w8 , 13); R32(c2, d2, e2, a2, b2, w6 , 6); + R31(b1, c1, d1, e1, a1, w1 , 15); R32(b2, c2, d2, e2, a2, w9 , 14); + R31(a1, b1, c1, d1, e1, w2 , 14); R32(a2, b2, c2, d2, e2, w11, 12); + R31(e1, a1, b1, c1, d1, w7 , 8); R32(e2, a2, b2, c2, d2, w8 , 13); + R31(d1, e1, a1, b1, c1, w0 , 13); R32(d2, e2, a2, b2, c2, w12, 5); + R31(c1, d1, e1, a1, b1, w6 , 6); R32(c2, d2, e2, a2, b2, w2 , 14); + R31(b1, c1, d1, e1, a1, w13, 5); R32(b2, c2, d2, e2, a2, w10, 13); + R31(a1, b1, c1, d1, e1, w11, 12); R32(a2, b2, c2, d2, e2, w0 , 13); + R31(e1, a1, b1, c1, d1, w5 , 7); R32(e2, a2, b2, c2, d2, w4 , 7); + R31(d1, e1, a1, b1, c1, w12, 5); R32(d2, e2, a2, b2, c2, w13, 5); + + R41(c1, d1, e1, a1, b1, w1 , 11); R42(c2, d2, e2, a2, b2, w8 , 15); + R41(b1, c1, d1, e1, a1, w9 , 12); R42(b2, c2, d2, e2, a2, w6 , 5); + R41(a1, b1, c1, d1, e1, w11, 14); R42(a2, b2, c2, d2, e2, w4 , 8); + R41(e1, a1, b1, c1, d1, w10, 15); R42(e2, a2, b2, c2, d2, w1 , 11); + R41(d1, e1, a1, b1, c1, w0 , 14); R42(d2, e2, a2, b2, c2, w3 , 14); + R41(c1, d1, e1, a1, b1, w8 , 15); R42(c2, d2, e2, a2, b2, w11, 14); + R41(b1, c1, d1, e1, a1, w12, 9); R42(b2, c2, d2, e2, a2, w15, 6); + R41(a1, b1, c1, d1, e1, w4 , 8); R42(a2, b2, c2, d2, e2, w0 , 14); + R41(e1, a1, b1, c1, d1, w13, 9); R42(e2, a2, b2, c2, d2, w5 , 6); + R41(d1, e1, a1, b1, c1, w3 , 14); R42(d2, e2, a2, b2, c2, w12, 9); + R41(c1, d1, e1, a1, b1, w7 , 5); R42(c2, d2, e2, a2, b2, w2 , 12); + R41(b1, c1, d1, e1, a1, w15, 6); R42(b2, c2, d2, e2, a2, w13, 9); + R41(a1, b1, c1, d1, e1, w14, 8); R42(a2, b2, c2, d2, e2, w9 , 12); + R41(e1, a1, b1, c1, d1, w5 , 6); R42(e2, a2, b2, c2, d2, w7 , 5); + R41(d1, e1, a1, b1, c1, w6 , 5); R42(d2, e2, a2, b2, c2, w10, 15); + R41(c1, d1, e1, a1, b1, w2 , 12); R42(c2, d2, e2, a2, b2, w14, 8); + + R51(b1, c1, d1, e1, a1, w4 , 9); R52(b2, c2, d2, e2, a2, w12, 8); + R51(a1, b1, c1, d1, e1, w0 , 15); R52(a2, b2, c2, d2, e2, w15, 5); + R51(e1, a1, b1, c1, d1, w5 , 5); R52(e2, a2, b2, c2, d2, w10, 12); + R51(d1, e1, a1, b1, c1, w9 , 11); R52(d2, e2, a2, b2, c2, w4 , 9); + R51(c1, d1, e1, a1, b1, w7 , 6); R52(c2, d2, e2, a2, b2, w1 , 12); + R51(b1, c1, d1, e1, a1, w12, 8); R52(b2, c2, d2, e2, a2, w5 , 5); + R51(a1, b1, c1, d1, e1, w2 , 13); R52(a2, b2, c2, d2, e2, w8 , 14); + R51(e1, a1, b1, c1, d1, w10, 12); R52(e2, a2, b2, c2, d2, w7 , 6); + R51(d1, e1, a1, b1, c1, w14, 5); R52(d2, e2, a2, b2, c2, w6 , 8); + R51(c1, d1, e1, a1, b1, w1 , 12); R52(c2, d2, e2, a2, b2, w2 , 13); + R51(b1, c1, d1, e1, a1, w3 , 13); R52(b2, c2, d2, e2, a2, w13, 6); + R51(a1, b1, c1, d1, e1, w8 , 14); R52(a2, b2, c2, d2, e2, w14, 5); + R51(e1, a1, b1, c1, d1, w11, 11); R52(e2, a2, b2, c2, d2, w0 , 15); + R51(d1, e1, a1, b1, c1, w6 , 8); R52(d2, e2, a2, b2, c2, w3 , 13); + R51(c1, d1, e1, a1, b1, w15, 5); R52(c2, d2, e2, a2, b2, w9 , 11); + R51(b1, c1, d1, e1, a1, w13, 6); R52(b2, c2, d2, e2, a2, w11, 11); + + uint32_t t = s[0]; + s[0] = s[1] + c1 + d2; + s[1] = s[2] + d1 + e2; + s[2] = s[3] + e1 + a2; + s[3] = s[4] + a1 + b2; + s[4] = t + b1 + c2; +} + +} // namespace ripemd160 + +} // namespace + +////// RIPEMD160 + +CRIPEMD160::CRIPEMD160() : bytes(0) { + ripemd160::Initialize(s); +} + +CRIPEMD160& CRIPEMD160::Write(const unsigned char *data, size_t len) { + const unsigned char *end = data + len; + size_t bufsize = bytes % 64; + if (bufsize && bufsize + len >= 64) { + // Fill the buffer, and process it. + memcpy(buf + bufsize, data, 64 - bufsize); + bytes += 64 - bufsize; + data += 64 - bufsize; + ripemd160::Transform(s, buf); + bufsize = 0; + } + while (end >= data + 64) { + // Process full chunks directly from the source. + ripemd160::Transform(s, data); + bytes += 64; + data += 64; + } + if (end > data) { + // Fill the buffer with what remains. + memcpy(buf + bufsize, data, end - data); + bytes += end - data; + } + return *this; +} + +void CRIPEMD160::Finalize(unsigned char *hash) { + static const unsigned char pad[64] = {0x80}; + unsigned char sizedesc[8]; + WriteLE32(sizedesc, bytes << 3); + WriteLE32(sizedesc+4, bytes >> 29); + Write(pad, 1 + ((119 - (bytes % 64)) % 64)); + Write(sizedesc, 8); + WriteLE32(hash, s[0]); + WriteLE32(hash+4, s[1]); + WriteLE32(hash+8, s[2]); + WriteLE32(hash+12, s[3]); + WriteLE32(hash+16, s[4]); +} + +CRIPEMD160& CRIPEMD160::Reset() { + bytes = 0; + ripemd160::Initialize(s); + return *this; +} diff --git a/src/crypto/ripemd160.h b/src/crypto/ripemd160.h new file mode 100644 index 0000000000..cab1d0bb46 --- /dev/null +++ b/src/crypto/ripemd160.h @@ -0,0 +1,25 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_RIPEMD160_H +#define BITCOIN_RIPEMD160_H + +#include +#include + +/** A hasher class for RIPEMD-160. */ +class CRIPEMD160 { +private: + uint32_t s[5]; + unsigned char buf[64]; + size_t bytes; + +public: + CRIPEMD160(); + CRIPEMD160& Write(const unsigned char *data, size_t len); + void Finalize(unsigned char *hash); + CRIPEMD160& Reset(); +}; + +#endif diff --git a/src/hash.h b/src/hash.h index 318399c334..39d42eefe2 100644 --- a/src/hash.h +++ b/src/hash.h @@ -7,14 +7,13 @@ #define BITCOIN_HASH_H #include "crypto/sha2.h" +#include "crypto/ripemd160.h" #include "serialize.h" #include "uint256.h" #include "version.h" #include -#include - /** A hasher class for Bitcoin's 256-bit hash (double SHA-256). */ class CHash256 { private: @@ -45,7 +44,7 @@ public: void Finalize(unsigned char *hash) { unsigned char buf[32]; sha.Finalize(buf); - RIPEMD160(buf, 32, hash); + CRIPEMD160().Write(buf, 32).Finalize(hash); } CHash160& Write(const unsigned char *data, size_t len) { diff --git a/src/script.cpp b/src/script.cpp index c6574a6ee8..b383a00a6e 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -11,6 +11,7 @@ #include "keystore.h" #include "crypto/sha1.h" #include "crypto/sha2.h" +#include "crypto/ripemd160.h" #include "sync.h" #include "uint256.h" #include "util.h" @@ -803,7 +804,7 @@ bool EvalScript(vector >& stack, const CScript& script, co valtype& vch = stacktop(-1); valtype vchHash((opcode == OP_RIPEMD160 || opcode == OP_SHA1 || opcode == OP_HASH160) ? 20 : 32); if (opcode == OP_RIPEMD160) - RIPEMD160(&vch[0], vch.size(), &vchHash[0]); + CRIPEMD160().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); else if (opcode == OP_SHA1) CSHA1().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); else if (opcode == OP_SHA256) From 7ecd9739d9439624399a4882a9f196ccf0c7ba4a Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 3 May 2014 01:04:18 +0200 Subject: [PATCH 0208/1288] Move {Read,Write}{LE,BE}{32,64} to common.h and use builtins if possible --- src/Makefile.am | 1 + src/crypto/common.h | 46 ++++++++++++++++++++++++++++++++++++++++ src/crypto/ripemd160.cpp | 17 ++------------- src/crypto/sha1.cpp | 17 ++------------- src/crypto/sha2.cpp | 32 +--------------------------- 5 files changed, 52 insertions(+), 61 deletions(-) create mode 100644 src/crypto/common.h diff --git a/src/Makefile.am b/src/Makefile.am index d583a79032..01655b7011 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -75,6 +75,7 @@ BITCOIN_CORE_H = \ rpcserver.h \ script.h \ serialize.h \ + crypto/common.h \ crypto/sha2.h \ crypto/sha1.h \ crypto/ripemd160.h \ diff --git a/src/crypto/common.h b/src/crypto/common.h new file mode 100644 index 0000000000..e1bcd3ae11 --- /dev/null +++ b/src/crypto/common.h @@ -0,0 +1,46 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_CRYPTO_COMMON_H +#define BITCOIN_CRYPTO_COMMON_H + +#include + +#ifdef WIN32 +uint32_t static inline ReadLE32(const unsigned char *ptr) { return *((uint32_t*)ptr); } +uint64_t static inline ReadLE64(const unsigned char *ptr) { return *((uint64_t*)ptr); } + +void static inline WriteLE32(unsigned char *ptr, uint32_t x) { *((uint32_t*)ptr) = x; } +void static inline WriteLE64(unsigned char *ptr, uint64_t x) { *((uint64_t*)ptr) = x; } + +uint32_t static inline ReadBE32(const unsigned char *ptr) { + return ((uint32_t)ptr[0] << 24 | (uint32_t)ptr[1] << 16 | (uint32_t)ptr[2] << 8 | (uint32_t)ptr[3]); +} + +uint64_t static inline ReadBE64(const unsigned char *ptr) { + return ((uint64_t)ptr[0] << 56 | (uint64_t)ptr[1] << 48 | (uint64_t)ptr[2] << 40 | (uint64_t)ptr[3] << 32 | + (uint64_t)ptr[4] << 24 | (uint64_t)ptr[5] << 16 | (uint64_t)ptr[6] << 8 | (uint64_t)ptr[7]); +} + +void static inline WriteBE32(unsigned char *ptr, uint32_t x) { + ptr[0] = x >> 24; ptr[1] = x >> 16; ptr[2] = x >> 8; ptr[3] = x; +} + +void static inline WriteBE64(unsigned char *ptr, uint64_t x) { + ptr[0] = x >> 56; ptr[1] = x >> 48; ptr[2] = x >> 40; ptr[3] = x >> 32; + ptr[4] = x >> 24; ptr[5] = x >> 16; ptr[6] = x >> 8; ptr[7] = x; +} +#else +# include +uint32_t static inline ReadLE32(const unsigned char *ptr) { return le32toh(*((uint32_t*)ptr)); } +uint64_t static inline ReadLE64(const unsigned char *ptr) { return le64toh(*((uint64_t*)ptr)); } +void static inline WriteLE32(unsigned char *ptr, uint32_t x) { *((uint32_t*)ptr) = htole32(x); } +void static inline WriteLE64(unsigned char *ptr, uint64_t x) { *((uint64_t*)ptr) = htole64(x); } + +uint32_t static inline ReadBE32(const unsigned char *ptr) { return be32toh(*((uint32_t*)ptr)); } +uint64_t static inline ReadBE64(const unsigned char *ptr) { return be64toh(*((uint64_t*)ptr)); } +void static inline WriteBE32(unsigned char *ptr, uint32_t x) { *((uint32_t*)ptr) = htobe32(x); } +void static inline WriteBE64(unsigned char *ptr, uint64_t x) { *((uint64_t*)ptr) = htobe64(x); } +#endif +#endif diff --git a/src/crypto/ripemd160.cpp b/src/crypto/ripemd160.cpp index aa6874fa85..c5e6e2d696 100644 --- a/src/crypto/ripemd160.cpp +++ b/src/crypto/ripemd160.cpp @@ -4,24 +4,12 @@ #include "crypto/ripemd160.h" +#include "crypto/common.h" #include // Internal implementation code. namespace { -/** Read 4 bytes, and interpret them as a 32-bit unsigned little-endian integer. */ -uint32_t inline ReadLE32(const unsigned char *data) { - return ((uint32_t)data[0] | (uint32_t)data[1] << 8 | (uint32_t)data[2] << 16 | (uint32_t)data[3] << 24); -} - -/** Write a 32-bit unsigned little-endian integer. */ -void inline WriteLE32(unsigned char *data, uint32_t x) { - data[0] = x; - data[1] = x >> 8; - data[2] = x >> 16; - data[3] = x >> 24; -} - /// Internal RIPEMD-160 implementation. namespace ripemd160 { @@ -199,8 +187,7 @@ CRIPEMD160& CRIPEMD160::Write(const unsigned char *data, size_t len) { void CRIPEMD160::Finalize(unsigned char *hash) { static const unsigned char pad[64] = {0x80}; unsigned char sizedesc[8]; - WriteLE32(sizedesc, bytes << 3); - WriteLE32(sizedesc+4, bytes >> 29); + WriteLE64(sizedesc, bytes << 3); Write(pad, 1 + ((119 - (bytes % 64)) % 64)); Write(sizedesc, 8); WriteLE32(hash, s[0]); diff --git a/src/crypto/sha1.cpp b/src/crypto/sha1.cpp index 4b2e3e19d1..e0f32b7d1d 100644 --- a/src/crypto/sha1.cpp +++ b/src/crypto/sha1.cpp @@ -4,24 +4,12 @@ #include "crypto/sha1.h" +#include "crypto/common.h" #include // Internal implementation code. namespace { -/** Read 4 bytes, and interpret them as a 32-bit unsigned big-endian integer. */ -uint32_t inline ReadBE32(const unsigned char *data) { - return ((uint32_t)data[0] << 24 | (uint32_t)data[1] << 16 | (uint32_t)data[2] << 8 | (uint32_t)data[3]); -} - -/** Write a 32-bit unsigned big-endian integer. */ -void inline WriteBE32(unsigned char *data, uint32_t x) { - data[0] = x >> 24; - data[1] = x >> 16; - data[2] = x >> 8; - data[3] = x; -} - /// Internal SHA-1 implementation. namespace sha1 { @@ -187,8 +175,7 @@ CSHA1& CSHA1::Write(const unsigned char *data, size_t len) { void CSHA1::Finalize(unsigned char *hash) { static const unsigned char pad[64] = {0x80}; unsigned char sizedesc[8]; - WriteBE32(sizedesc, bytes >> 29); - WriteBE32(sizedesc+4, bytes << 3); + WriteBE64(sizedesc, bytes << 3); Write(pad, 1 + ((119 - (bytes % 64)) % 64)); Write(sizedesc, 8); WriteBE32(hash, s[0]); diff --git a/src/crypto/sha2.cpp b/src/crypto/sha2.cpp index 0d0c32883f..77f35f38d8 100644 --- a/src/crypto/sha2.cpp +++ b/src/crypto/sha2.cpp @@ -4,42 +4,12 @@ #include "crypto/sha2.h" +#include "crypto/common.h" #include // Internal implementation code. namespace { -/** Read 4 bytes, and interpret them as a 32-bit unsigned big-endian integer. */ -uint32_t inline ReadBE32(const unsigned char *data) { - return ((uint32_t)data[0] << 24 | (uint32_t)data[1] << 16 | (uint32_t)data[2] << 8 | (uint32_t)data[3]); -} - -/** Write a 32-bit unsigned big-endian integer. */ -void inline WriteBE32(unsigned char *data, uint32_t x) { - data[0] = x >> 24; - data[1] = x >> 16; - data[2] = x >> 8; - data[3] = x; -} - -/** Read 8 bytes, and interpret them as a 64-bit unsigned big-endian integer. */ -uint64_t inline ReadBE64(const unsigned char *data) { - return ((uint64_t)data[0] << 56 | (uint64_t)data[1] << 48 | (uint64_t)data[2] << 40 | (uint64_t)data[3] << 32 | - (uint64_t)data[4] << 24 | (uint64_t)data[5] << 16 | (uint64_t)data[6] << 8 | (uint64_t)data[7]); -} - -/** Write a 64-bit unsigned big-endian integer. */ -void inline WriteBE64(unsigned char *data, uint64_t x) { - data[0] = x >> 56; - data[1] = x >> 48; - data[2] = x >> 40; - data[3] = x >> 32; - data[4] = x >> 24; - data[5] = x >> 16; - data[6] = x >> 8; - data[7] = x; -} - /// Internal SHA-256 implementation. namespace sha256 { From 3820e01eb9ad0e502e92ebc44cb4623cf4f3d4c4 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 31 May 2014 22:01:42 +0200 Subject: [PATCH 0209/1288] Extend and move all crypto tests to crypto_tests.cpp --- src/Makefile.test.include | 3 +- src/test/crypto_tests.cpp | 202 ++++++++++++++++++++++++++++++++++++++ src/test/sha1_tests.cpp | 27 ----- src/test/sha2_tests.cpp | 157 ----------------------------- 4 files changed, 203 insertions(+), 186 deletions(-) create mode 100644 src/test/crypto_tests.cpp delete mode 100644 src/test/sha1_tests.cpp delete mode 100644 src/test/sha2_tests.cpp diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 7cf441bd6c..02fb3ba5fe 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -31,6 +31,7 @@ BITCOIN_TESTS =\ test/checkblock_tests.cpp \ test/Checkpoints_tests.cpp \ test/compress_tests.cpp \ + test/crypto_tests.cpp \ test/DoS_tests.cpp \ test/getarg_tests.cpp \ test/hash_tests.cpp \ @@ -45,8 +46,6 @@ BITCOIN_TESTS =\ test/script_P2SH_tests.cpp \ test/script_tests.cpp \ test/serialize_tests.cpp \ - test/sha1_tests.cpp \ - test/sha2_tests.cpp \ test/sigopcount_tests.cpp \ test/test_bitcoin.cpp \ test/transaction_tests.cpp \ diff --git a/src/test/crypto_tests.cpp b/src/test/crypto_tests.cpp new file mode 100644 index 0000000000..d425f082c3 --- /dev/null +++ b/src/test/crypto_tests.cpp @@ -0,0 +1,202 @@ +// Copyright (c) 2014 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "crypto/ripemd160.h" +#include "crypto/sha1.h" +#include "crypto/sha2.h" +#include "util.h" + +#include + +#include + +BOOST_AUTO_TEST_SUITE(crypto_tests) + +template +void TestVector(const Hasher &h, const In &in, const Out &out) { + Out hash; + hash.resize(out.size()); + { + // Test that writing the whole input string at once works. + Hasher(h).Write((unsigned char*)&in[0], in.size()).Finalize(&hash[0]); + BOOST_CHECK(hash == out); + } + for (int i=0; i<32; i++) { + // Test that writing the string broken up in random pieces works. + Hasher hasher(h); + size_t pos = 0; + while (pos < in.size()) { + size_t len = insecure_rand() % ((in.size() - pos + 1) / 2 + 1); + hasher.Write((unsigned char*)&in[pos], len); + pos += len; + if (pos > 0 && pos + 2 * out.size() > in.size()) { + // Test that writing the rest at once to a copy of a hasher works. + Hasher(hasher).Write((unsigned char*)&in[pos], in.size() - pos).Finalize(&hash[0]); + BOOST_CHECK(hash == out); + } + } + hasher.Finalize(&hash[0]); + BOOST_CHECK(hash == out); + } +} + +void TestSHA1(const std::string &in, const std::string &hexout) { TestVector(CSHA1(), in, ParseHex(hexout));} +void TestSHA256(const std::string &in, const std::string &hexout) { TestVector(CSHA256(), in, ParseHex(hexout));} +void TestSHA512(const std::string &in, const std::string &hexout) { TestVector(CSHA512(), in, ParseHex(hexout));} +void TestRIPEMD160(const std::string &in, const std::string &hexout) { TestVector(CRIPEMD160(), in, ParseHex(hexout));} + +void TestHMACSHA512(const std::string &hexkey, const std::string &hexin, const std::string &hexout) { + std::vector key = ParseHex(hexkey); + TestVector(CHMAC_SHA512(&key[0], key.size()), ParseHex(hexin), ParseHex(hexout)); +} + +std::string LongTestString(void) { + std::string ret; + for (int i=0; i<200000; i++) { + ret += (unsigned char)(i); + ret += (unsigned char)(i >> 4); + ret += (unsigned char)(i >> 8); + ret += (unsigned char)(i >> 12); + ret += (unsigned char)(i >> 16); + } + return ret; +} + +const std::string test1 = LongTestString(); + +BOOST_AUTO_TEST_CASE(ripemd160_testvectors) { + TestRIPEMD160("", "9c1185a5c5e9fc54612808977ee8f548b2258d31"); + TestRIPEMD160("abc", "8eb208f7e05d987a9b044a8e98c6b087f15a0bfc"); + TestRIPEMD160("message digest", "5d0689ef49d2fae572b881b123a85ffa21595f36"); + TestRIPEMD160("secure hash algorithm", "20397528223b6a5f4cbc2808aba0464e645544f9"); + TestRIPEMD160("RIPEMD160 is considered to be safe", "a7d78608c7af8a8e728778e81576870734122b66"); + TestRIPEMD160("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", + "12a053384a9c0c88e405a06c27dcf49ada62eb2b"); + TestRIPEMD160("For this sample, this 63-byte string will be used as input data", + "de90dbfee14b63fb5abf27c2ad4a82aaa5f27a11"); + TestRIPEMD160("This is exactly 64 bytes long, not counting the terminating byte", + "eda31d51d3a623b81e19eb02e24ff65d27d67b37"); + TestRIPEMD160(std::string(1000000, 'a'), "52783243c1697bdbe16d37f97f68f08325dc1528"); + TestRIPEMD160(test1, "464243587bd146ea835cdf57bdae582f25ec45f1"); +} + +BOOST_AUTO_TEST_CASE(sha1_testvectors) { + TestSHA1("", "da39a3ee5e6b4b0d3255bfef95601890afd80709"); + TestSHA1("abc", "a9993e364706816aba3e25717850c26c9cd0d89d"); + TestSHA1("message digest", "c12252ceda8be8994d5fa0290a47231c1d16aae3"); + TestSHA1("secure hash algorithm", "d4d6d2f0ebe317513bbd8d967d89bac5819c2f60"); + TestSHA1("SHA1 is considered to be safe", "f2b6650569ad3a8720348dd6ea6c497dee3a842a"); + TestSHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", + "84983e441c3bd26ebaae4aa1f95129e5e54670f1"); + TestSHA1("For this sample, this 63-byte string will be used as input data", + "4f0ea5cd0585a23d028abdc1a6684e5a8094dc49"); + TestSHA1("This is exactly 64 bytes long, not counting the terminating byte", + "fb679f23e7d1ce053313e66e127ab1b444397057"); + TestSHA1(std::string(1000000, 'a'), "34aa973cd4c4daa4f61eeb2bdbad27316534016f"); + TestSHA1(test1, "b7755760681cbfd971451668f32af5774f4656b5"); +} + +BOOST_AUTO_TEST_CASE(sha256_testvectors) { + TestSHA256("", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"); + TestSHA256("abc", "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"); + TestSHA256("message digest", + "f7846f55cf23e14eebeab5b4e1550cad5b509e3348fbc4efa3a1413d393cb650"); + TestSHA256("secure hash algorithm", + "f30ceb2bb2829e79e4ca9753d35a8ecc00262d164cc077080295381cbd643f0d"); + TestSHA256("SHA256 is considered to be safe", + "6819d915c73f4d1e77e4e1b52d1fa0f9cf9beaead3939f15874bd988e2a23630"); + TestSHA256("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", + "248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1"); + TestSHA256("For this sample, this 63-byte string will be used as input data", + "f08a78cbbaee082b052ae0708f32fa1e50c5c421aa772ba5dbb406a2ea6be342"); + TestSHA256("This is exactly 64 bytes long, not counting the terminating byte", + "ab64eff7e88e2e46165e29f2bce41826bd4c7b3552f6b382a9e7d3af47c245f8"); + TestSHA256("As Bitcoin relies on 80 byte header hashes, we want to have an example for that.", + "7406e8de7d6e4fffc573daef05aefb8806e7790f55eab5576f31349743cca743"); + TestSHA256(std::string(1000000, 'a'), + "cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0"); + TestSHA256(test1, "a316d55510b49662420f49d145d42fb83f31ef8dc016aa4e32df049991a91e26"); +} + +BOOST_AUTO_TEST_CASE(sha512_testvectors) { + TestSHA512("", + "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce" + "47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"); + TestSHA512("abc", + "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a" + "2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f"); + TestSHA512("message digest", + "107dbf389d9e9f71a3a95f6c055b9251bc5268c2be16d6c13492ea45b0199f33" + "09e16455ab1e96118e8a905d5597b72038ddb372a89826046de66687bb420e7c"); + TestSHA512("secure hash algorithm", + "7746d91f3de30c68cec0dd693120a7e8b04d8073cb699bdce1a3f64127bca7a3" + "d5db502e814bb63c063a7a5043b2df87c61133395f4ad1edca7fcf4b30c3236e"); + TestSHA512("SHA512 is considered to be safe", + "099e6468d889e1c79092a89ae925a9499b5408e01b66cb5b0a3bd0dfa51a9964" + "6b4a3901caab1318189f74cd8cf2e941829012f2449df52067d3dd5b978456c2"); + TestSHA512("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", + "204a8fc6dda82f0a0ced7beb8e08a41657c16ef468b228a8279be331a703c335" + "96fd15c13b1b07f9aa1d3bea57789ca031ad85c7a71dd70354ec631238ca3445"); + TestSHA512("For this sample, this 63-byte string will be used as input data", + "b3de4afbc516d2478fe9b518d063bda6c8dd65fc38402dd81d1eb7364e72fb6e" + "6663cf6d2771c8f5a6da09601712fb3d2a36c6ffea3e28b0818b05b0a8660766"); + TestSHA512("This is exactly 64 bytes long, not counting the terminating byte", + "70aefeaa0e7ac4f8fe17532d7185a289bee3b428d950c14fa8b713ca09814a38" + "7d245870e007a80ad97c369d193e41701aa07f3221d15f0e65a1ff970cedf030"); + TestSHA512("abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmno" + "ijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu", + "8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018" + "501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909"); + TestSHA512(std::string(1000000, 'a'), + "e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973eb" + "de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b"); + TestSHA512(test1, + "40cac46c147e6131c5193dd5f34e9d8bb4951395f27b08c558c65ff4ba2de594" + "37de8c3ef5459d76a52cedc02dc499a3c9ed9dedbfb3281afd9653b8a112fafc"); +} + +BOOST_AUTO_TEST_CASE(hmac_sha512_testvectors) { + // test cases 1, 2, 3, 4, 6 and 7 of RFC 4231 + TestHMACSHA512("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", + "4869205468657265", + "87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b30545e17cde" + "daa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f1702e696c203a126854"); + TestHMACSHA512("4a656665", + "7768617420646f2079612077616e7420666f72206e6f7468696e673f", + "164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7ea250554" + "9758bf75c05a994a6d034f65f8f0e6fdcaeab1a34d4a6b4b636e070a38bce737"); + TestHMACSHA512("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" + "dddddddddddddddddddddddddddddddddddd", + "fa73b0089d56a284efb0f0756c890be9b1b5dbdd8ee81a3655f83e33b2279d39" + "bf3e848279a722c806b485a47e67c807b946a337bee8942674278859e13292fb"); + TestHMACSHA512("0102030405060708090a0b0c0d0e0f10111213141516171819", + "cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd" + "cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd", + "b0ba465637458c6990e5a8c5f61d4af7e576d97ff94b872de76f8050361ee3db" + "a91ca5c11aa25eb4d679275cc5788063a5f19741120c4f2de2adebeb10a298dd"); + TestHMACSHA512("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaa", + "54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a" + "65204b6579202d2048617368204b6579204669727374", + "80b24263c7c1a3ebb71493c1dd7be8b49b46d1f41b4aeec1121b013783f8f352" + "6b56d037e05f2598bd0fd2215d6a1e5295e64f73f63f0aec8b915a985d786598"); + TestHMACSHA512("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaa", + "5468697320697320612074657374207573696e672061206c6172676572207468" + "616e20626c6f636b2d73697a65206b657920616e642061206c61726765722074" + "68616e20626c6f636b2d73697a6520646174612e20546865206b6579206e6565" + "647320746f20626520686173686564206265666f7265206265696e6720757365" + "642062792074686520484d414320616c676f726974686d2e", + "e37b6a775dc87dbaa4dfa9f96e5e3ffddebd71f8867289865df5a32d20cdc944" + "b6022cac3c4982b10d5eeb55c3e4de15134676fb6de0446065c97440fa8c6a58"); +} + +BOOST_AUTO_TEST_SUITE_END() diff --git a/src/test/sha1_tests.cpp b/src/test/sha1_tests.cpp deleted file mode 100644 index 88f2da0bbb..0000000000 --- a/src/test/sha1_tests.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2014 The Bitcoin Core developers -// Distributed under the MIT/X11 software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "crypto/sha1.h" -#include "util.h" - -#include - -#include - -BOOST_AUTO_TEST_SUITE(sha1_tests) - -void SHA1TestVector(const std::string &in, const std::string &out) { - std::vector hash; - hash.resize(20); - CSHA1().Write((unsigned char*)&in[0], in.size()).Finalize(&hash[0]); - BOOST_CHECK_EQUAL(HexStr(hash), out); -} - -BOOST_AUTO_TEST_CASE(sha1_testvectors) { - SHA1TestVector("abc", "a9993e364706816aba3e25717850c26c9cd0d89d"); - SHA1TestVector("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", "84983e441c3bd26ebaae4aa1f95129e5e54670f1"); - SHA1TestVector(std::string(1000000, 'a'), "34aa973cd4c4daa4f61eeb2bdbad27316534016f"); -} - -BOOST_AUTO_TEST_SUITE_END() diff --git a/src/test/sha2_tests.cpp b/src/test/sha2_tests.cpp deleted file mode 100644 index 1e48c973cf..0000000000 --- a/src/test/sha2_tests.cpp +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) 2014 The Bitcoin Core developers -// Distributed under the MIT/X11 software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "crypto/sha2.h" -#include "util.h" - -#include - -#include - -BOOST_AUTO_TEST_SUITE(sha2_tests) - -void SHA256TestVector(const std::string &in, const std::string &out) { - std::vector hash; - hash.resize(32); - CSHA256().Write((unsigned char*)&in[0], in.size()).Finalize(&hash[0]); - BOOST_CHECK_EQUAL(HexStr(hash), out); -} - -void SHA512TestVector(const std::string &in, const std::string &out) { - std::vector hash; - hash.resize(64); - CSHA512().Write((unsigned char*)&in[0], in.size()).Finalize(&hash[0]); - BOOST_CHECK_EQUAL(HexStr(hash), out); -} - -BOOST_AUTO_TEST_CASE(sha256_testvectors) { - SHA256TestVector("", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"); - SHA256TestVector("abc", "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"); - SHA256TestVector("message digest", "f7846f55cf23e14eebeab5b4e1550cad5b509e3348fbc4efa3a1413d393cb650"); - SHA256TestVector("secure hash algorithm", "f30ceb2bb2829e79e4ca9753d35a8ecc00262d164cc077080295381cbd643f0d"); - SHA256TestVector("SHA256 is considered to be safe", "6819d915c73f4d1e77e4e1b52d1fa0f9cf9beaead3939f15874bd988e2a23630"); - SHA256TestVector("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", "248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1"); - SHA256TestVector("For this sample, this 63-byte string will be used as input data", "f08a78cbbaee082b052ae0708f32fa1e50c5c421aa772ba5dbb406a2ea6be342"); - SHA256TestVector("This is exactly 64 bytes long, not counting the terminating byte", "ab64eff7e88e2e46165e29f2bce41826bd4c7b3552f6b382a9e7d3af47c245f8"); - SHA256TestVector("As Bitcoin relies on 80 byte header hashes, we want to have an example for that.", "7406e8de7d6e4fffc573daef05aefb8806e7790f55eab5576f31349743cca743"); -} - -BOOST_AUTO_TEST_CASE(sha512_testvectors) { - SHA512TestVector("abc", "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f"); - SHA512TestVector("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", "204a8fc6dda82f0a0ced7beb8e08a41657c16ef468b228a8279be331a703c33596fd15c13b1b07f9aa1d3bea57789ca031ad85c7a71dd70354ec631238ca3445"); - SHA512TestVector("abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu", "8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909"); - SHA512TestVector(std::string(1000000, 'a'), "e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973ebde0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b"); - SHA512TestVector("", "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"); -} - -typedef struct { - const char *pszKey; - const char *pszData; - const char *pszMAC; -} testvec_t; - -// test cases 1, 2, 3, 4, 6 and 7 of RFC 4231 -static const testvec_t vtest[] = { - { - "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b" - "0b0b0b0b", - "4869205468657265", - "87aa7cdea5ef619d4ff0b4241a1d6cb0" - "2379f4e2ce4ec2787ad0b30545e17cde" - "daa833b7d6b8a702038b274eaea3f4e4" - "be9d914eeb61f1702e696c203a126854" - }, - { - "4a656665", - "7768617420646f2079612077616e7420" - "666f72206e6f7468696e673f", - "164b7a7bfcf819e2e395fbe73b56e0a3" - "87bd64222e831fd610270cd7ea250554" - "9758bf75c05a994a6d034f65f8f0e6fd" - "caeab1a34d4a6b4b636e070a38bce737" - }, - { - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaa", - "dddddddddddddddddddddddddddddddd" - "dddddddddddddddddddddddddddddddd" - "dddddddddddddddddddddddddddddddd" - "dddd", - "fa73b0089d56a284efb0f0756c890be9" - "b1b5dbdd8ee81a3655f83e33b2279d39" - "bf3e848279a722c806b485a47e67c807" - "b946a337bee8942674278859e13292fb" - }, - { - "0102030405060708090a0b0c0d0e0f10" - "111213141516171819", - "cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd" - "cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd" - "cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd" - "cdcd", - "b0ba465637458c6990e5a8c5f61d4af7" - "e576d97ff94b872de76f8050361ee3db" - "a91ca5c11aa25eb4d679275cc5788063" - "a5f19741120c4f2de2adebeb10a298dd" - }, - { - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaa", - "54657374205573696e67204c61726765" - "72205468616e20426c6f636b2d53697a" - "65204b6579202d2048617368204b6579" - "204669727374", - "80b24263c7c1a3ebb71493c1dd7be8b4" - "9b46d1f41b4aeec1121b013783f8f352" - "6b56d037e05f2598bd0fd2215d6a1e52" - "95e64f73f63f0aec8b915a985d786598" - }, - { - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaa", - "54686973206973206120746573742075" - "73696e672061206c6172676572207468" - "616e20626c6f636b2d73697a65206b65" - "7920616e642061206c61726765722074" - "68616e20626c6f636b2d73697a652064" - "6174612e20546865206b6579206e6565" - "647320746f2062652068617368656420" - "6265666f7265206265696e6720757365" - "642062792074686520484d414320616c" - "676f726974686d2e", - "e37b6a775dc87dbaa4dfa9f96e5e3ffd" - "debd71f8867289865df5a32d20cdc944" - "b6022cac3c4982b10d5eeb55c3e4de15" - "134676fb6de0446065c97440fa8c6a58" - } -}; - -BOOST_AUTO_TEST_CASE(hmacsha512_testvectors) -{ - for (unsigned int n=0; n vchKey = ParseHex(vtest[n].pszKey); - std::vector vchData = ParseHex(vtest[n].pszData); - std::vector vchMAC = ParseHex(vtest[n].pszMAC); - unsigned char vchTemp[64]; - CHMAC_SHA512(&vchKey[0], vchKey.size()).Write(&vchData[0], vchData.size()).Finalize(&vchTemp[0]); - BOOST_CHECK(memcmp(&vchTemp[0], &vchMAC[0], 64) == 0); - } -} - -BOOST_AUTO_TEST_SUITE_END() From 54372482a8ffa363f5dd9ff1c80141a168109ed5 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 9 Jun 2014 14:58:30 -0400 Subject: [PATCH 0210/1288] build: move bitcoin-config.h to its own directory This allows us to include its path without making other header includes valid. --- configure.ac | 2 +- src/Makefile.am | 4 +++- src/config/.empty | 0 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 src/config/.empty diff --git a/configure.ac b/configure.ac index 81a32f9fb7..0caf653cad 100644 --- a/configure.ac +++ b/configure.ac @@ -111,7 +111,7 @@ AC_ARG_WITH([protoc-bindir],[AS_HELP_STRING([--with-protoc-bindir=BIN_DIR],[spec AC_CONFIG_SRCDIR([src]) -AC_CONFIG_HEADERS([src/bitcoin-config.h]) +AC_CONFIG_HEADERS([src/config/bitcoin-config.h]) dnl Checks for programs. AC_PROG_CXX diff --git a/src/Makefile.am b/src/Makefile.am index 01655b7011..c666fb7662 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -17,7 +17,8 @@ $(LIBLEVELDB) $(LIBMEMENV): OPT="$(CXXFLAGS) $(CPPFLAGS)" endif -BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) +BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config +BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BITCOIN_CONFIG_INCLUDES) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) noinst_LIBRARIES = \ libbitcoin_server.a \ @@ -219,6 +220,7 @@ EXTRA_DIST = leveldb clean-local: -$(MAKE) -C leveldb clean rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno + -rm -f config.h .rc.o: @test -f $(WINDRES) diff --git a/src/config/.empty b/src/config/.empty new file mode 100644 index 0000000000..e69de29bb2 From f2647cc0e997198d7ac7f3fe3d843e941b57dda8 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 9 Jun 2014 15:05:28 -0400 Subject: [PATCH 0211/1288] crypto: explicitly check for byte read/write functions Don't depend on hard-coded platform lists --- configure.ac | 7 +++- src/crypto/common.h | 79 ++++++++++++++++++++++++++++++++++++--------- 2 files changed, 69 insertions(+), 17 deletions(-) diff --git a/configure.ac b/configure.ac index 0caf653cad..811ef1dd80 100644 --- a/configure.ac +++ b/configure.ac @@ -368,7 +368,12 @@ if test x$TARGET_OS = xdarwin; then AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"]) fi -AC_CHECK_HEADERS([stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h]) +AC_CHECK_HEADERS([endian.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h]) + +AC_CHECK_DECLS([le32toh, le64toh, htole32, htole64, be32toh, be64toh, htobe32, htobe64],,, + [#if HAVE_ENDIAN_H + #include + #endif]) dnl Check for MSG_NOSIGNAL AC_MSG_CHECKING(for MSG_NOSIGNAL) diff --git a/src/crypto/common.h b/src/crypto/common.h index e1bcd3ae11..8f675a16c5 100644 --- a/src/crypto/common.h +++ b/src/crypto/common.h @@ -5,42 +5,89 @@ #ifndef BITCOIN_CRYPTO_COMMON_H #define BITCOIN_CRYPTO_COMMON_H +#if defined(HAVE_CONFIG_H) +#include "bitcoin-config.h" +#endif #include +#if defined(HAVE_ENDIAN_H) +#include +#endif -#ifdef WIN32 -uint32_t static inline ReadLE32(const unsigned char *ptr) { return *((uint32_t*)ptr); } -uint64_t static inline ReadLE64(const unsigned char *ptr) { return *((uint64_t*)ptr); } +uint32_t static inline ReadLE32(const unsigned char *ptr) { +#if HAVE_DECL_LE32TOH == 1 + return le32toh(*((uint32_t*)ptr)); +#elif !defined(WORDS_BIGENDIAN) + return *((uint32_t*)ptr); +#else + return ((uint32_t)ptr[3] << 24 | (uint32_t)ptr[2] << 16 | (uint32_t)ptr[1] << 8 | (uint32_t)ptr[0]); +#endif +} -void static inline WriteLE32(unsigned char *ptr, uint32_t x) { *((uint32_t*)ptr) = x; } -void static inline WriteLE64(unsigned char *ptr, uint64_t x) { *((uint64_t*)ptr) = x; } +uint64_t static inline ReadLE64(const unsigned char *ptr) { + +#if HAVE_DECL_LE64TOH == 1 + return le64toh(*((uint64_t*)ptr)); +#elif !defined(WORDS_BIGENDIAN) + return *((uint64_t*)ptr); +#else + return ((uint64_t)ptr[7] << 56 | (uint64_t)ptr[6] << 48 | (uint64_t)ptr[5] << 40 | (uint64_t)ptr[4] << 32 | + (uint64_t)ptr[3] << 24 | (uint64_t)ptr[2] << 16 | (uint64_t)ptr[1] << 8 | (uint64_t)ptr[0]); +#endif +} + +void static inline WriteLE32(unsigned char *ptr, uint32_t x) { +#if HAVE_DECL_HTOLE32 == 1 + *((uint32_t*)ptr) = htole32(x); +#elif !defined(WORDS_BIGENDIAN) + *((uint32_t*)ptr) = x; +#else + ptr[3] = x >> 24; ptr[2] = x >> 16; ptr[1] = x >> 8; ptr[0] = x; +#endif +} + +void static inline WriteLE64(unsigned char *ptr, uint64_t x) { +#if HAVE_DECL_HTOLE64 == 1 + *((uint64_t*)ptr) = htole64(x); +#elif !defined(WORDS_BIGENDIAN) + *((uint64_t*)ptr) = x; +#else + ptr[7] = x >> 56; ptr[6] = x >> 48; ptr[5] = x >> 40; ptr[4] = x >> 32; + ptr[3] = x >> 24; ptr[2] = x >> 16; ptr[1] = x >> 8; ptr[0] = x; +#endif +} uint32_t static inline ReadBE32(const unsigned char *ptr) { +#if HAVE_DECL_BE32TOH == 1 + return be32toh(*((uint32_t*)ptr)); +#else return ((uint32_t)ptr[0] << 24 | (uint32_t)ptr[1] << 16 | (uint32_t)ptr[2] << 8 | (uint32_t)ptr[3]); +#endif } uint64_t static inline ReadBE64(const unsigned char *ptr) { +#if HAVE_DECL_BE64TOH == 1 + return be64toh(*((uint64_t*)ptr)); +#else return ((uint64_t)ptr[0] << 56 | (uint64_t)ptr[1] << 48 | (uint64_t)ptr[2] << 40 | (uint64_t)ptr[3] << 32 | (uint64_t)ptr[4] << 24 | (uint64_t)ptr[5] << 16 | (uint64_t)ptr[6] << 8 | (uint64_t)ptr[7]); +#endif } void static inline WriteBE32(unsigned char *ptr, uint32_t x) { +#if HAVE_DECL_HTOBE32 == 1 + *((uint32_t*)ptr) = htobe32(x); +#else ptr[0] = x >> 24; ptr[1] = x >> 16; ptr[2] = x >> 8; ptr[3] = x; +#endif } void static inline WriteBE64(unsigned char *ptr, uint64_t x) { +#if HAVE_DECL_HTOBE64 == 1 + *((uint64_t*)ptr) = htobe64(x); +#else ptr[0] = x >> 56; ptr[1] = x >> 48; ptr[2] = x >> 40; ptr[3] = x >> 32; ptr[4] = x >> 24; ptr[5] = x >> 16; ptr[6] = x >> 8; ptr[7] = x; +#endif } -#else -# include -uint32_t static inline ReadLE32(const unsigned char *ptr) { return le32toh(*((uint32_t*)ptr)); } -uint64_t static inline ReadLE64(const unsigned char *ptr) { return le64toh(*((uint64_t*)ptr)); } -void static inline WriteLE32(unsigned char *ptr, uint32_t x) { *((uint32_t*)ptr) = htole32(x); } -void static inline WriteLE64(unsigned char *ptr, uint64_t x) { *((uint64_t*)ptr) = htole64(x); } -uint32_t static inline ReadBE32(const unsigned char *ptr) { return be32toh(*((uint32_t*)ptr)); } -uint64_t static inline ReadBE64(const unsigned char *ptr) { return be64toh(*((uint64_t*)ptr)); } -void static inline WriteBE32(unsigned char *ptr, uint32_t x) { *((uint32_t*)ptr) = htobe32(x); } -void static inline WriteBE64(unsigned char *ptr, uint64_t x) { *((uint64_t*)ptr) = htobe64(x); } -#endif #endif From 4791b99e2dea0593775a8c75f62c8406d340191e Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 9 Jun 2014 15:17:27 -0400 Subject: [PATCH 0212/1288] crypto: create a separate lib for crypto functions This lib has no dependencies on other bitcoin functionality. Attempting to use bitcoin headers will result in a failure to compile. --- src/Makefile.am | 23 +++++++++++++++-------- src/Makefile.qt.include | 2 +- src/Makefile.qttest.include | 2 +- src/Makefile.test.include | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index c666fb7662..3948ca0780 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -23,7 +23,8 @@ BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BITCOIN_CONFIG_INCLUDES) $(BO noinst_LIBRARIES = \ libbitcoin_server.a \ libbitcoin_common.a \ - libbitcoin_cli.a + libbitcoin_cli.a \ + crypto/libbitcoin_crypto.a if ENABLE_WALLET BITCOIN_INCLUDES += $(BDB_CPPFLAGS) noinst_LIBRARIES += libbitcoin_wallet.a @@ -76,10 +77,6 @@ BITCOIN_CORE_H = \ rpcserver.h \ script.h \ serialize.h \ - crypto/common.h \ - crypto/sha2.h \ - crypto/sha1.h \ - crypto/ripemd160.h \ sync.h \ threadsafety.h \ tinyformat.h \ @@ -145,6 +142,16 @@ libbitcoin_wallet_a_SOURCES = \ walletdb.cpp \ $(BITCOIN_CORE_H) +crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES) +crypto_libbitcoin_crypto_a_SOURCES = \ + crypto/sha1.cpp \ + crypto/sha2.cpp \ + crypto/ripemd160.cpp \ + crypto/common.h \ + crypto/sha2.h \ + crypto/sha1.h \ + crypto/ripemd160.h + libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_common_a_SOURCES = \ base58.cpp \ @@ -157,9 +164,6 @@ libbitcoin_common_a_SOURCES = \ protocol.cpp \ rpcprotocol.cpp \ script.cpp \ - crypto/sha1.cpp \ - crypto/sha2.cpp \ - crypto/ripemd160.cpp \ sync.cpp \ util.cpp \ version.cpp \ @@ -183,6 +187,7 @@ nodist_libbitcoin_common_a_SOURCES = $(srcdir)/obj/build.h bitcoind_LDADD = \ libbitcoin_server.a \ libbitcoin_common.a \ + crypto/libbitcoin_crypto.a \ $(LIBLEVELDB) \ $(LIBMEMENV) if ENABLE_WALLET @@ -202,6 +207,7 @@ bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES) bitcoin_cli_LDADD = \ libbitcoin_cli.a \ libbitcoin_common.a \ + crypto/libbitcoin_crypto.a \ $(BOOST_LIBS) bitcoin_cli_SOURCES = bitcoin-cli.cpp bitcoin_cli_CPPFLAGS = $(BITCOIN_INCLUDES) @@ -238,6 +244,7 @@ LIBBITCOIN_SERVER=libbitcoin_server.a LIBBITCOIN_WALLET=libbitcoin_wallet.a LIBBITCOIN_COMMON=libbitcoin_common.a LIBBITCOIN_CLI=libbitcoin_cli.a +LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a LIBBITCOINQT=qt/libbitcoinqt.a if ENABLE_TESTS diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 647434e1ef..091138dc38 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -355,7 +355,7 @@ qt_bitcoin_qt_LDADD = qt/libbitcoinqt.a $(LIBBITCOIN_SERVER) if ENABLE_WALLET qt_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) endif -qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \ +qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_CRYPTO) $(LIBLEVELDB) $(LIBMEMENV) \ $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) qt_bitcoin_qt_LDFLAGS = $(QT_LDFLAGS) diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index e0b49d0240..0aa31a406d 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -30,7 +30,7 @@ qt_test_test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER) if ENABLE_WALLET qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) endif -qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) \ +qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_CRYPTO) $(LIBLEVELDB) \ $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) qt_test_test_bitcoin_qt_LDFLAGS = $(QT_LDFLAGS) diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 02fb3ba5fe..64f997f4b5 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -63,7 +63,7 @@ endif test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES) test_test_bitcoin_CPPFLAGS = $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) -test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \ +test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_CRYPTO) $(LIBLEVELDB) $(LIBMEMENV) \ $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) if ENABLE_WALLET test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) From a0495bb68c6eff9c732d458bacab10490d6452b4 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 12 Jun 2014 13:34:29 +0200 Subject: [PATCH 0213/1288] Add ::OUTPUT_SIZE --- src/crypto/ripemd160.cpp | 2 +- src/crypto/ripemd160.h | 4 +++- src/crypto/sha1.cpp | 2 +- src/crypto/sha1.h | 4 +++- src/crypto/sha2.cpp | 6 +++--- src/crypto/sha2.h | 12 +++++++++--- src/hash.h | 16 ++++++++++------ src/test/crypto_tests.cpp | 1 + 8 files changed, 31 insertions(+), 16 deletions(-) diff --git a/src/crypto/ripemd160.cpp b/src/crypto/ripemd160.cpp index c5e6e2d696..24bd318d43 100644 --- a/src/crypto/ripemd160.cpp +++ b/src/crypto/ripemd160.cpp @@ -184,7 +184,7 @@ CRIPEMD160& CRIPEMD160::Write(const unsigned char *data, size_t len) { return *this; } -void CRIPEMD160::Finalize(unsigned char *hash) { +void CRIPEMD160::Finalize(unsigned char hash[OUTPUT_SIZE]) { static const unsigned char pad[64] = {0x80}; unsigned char sizedesc[8]; WriteLE64(sizedesc, bytes << 3); diff --git a/src/crypto/ripemd160.h b/src/crypto/ripemd160.h index cab1d0bb46..44bd4879a5 100644 --- a/src/crypto/ripemd160.h +++ b/src/crypto/ripemd160.h @@ -16,9 +16,11 @@ private: size_t bytes; public: + static const size_t OUTPUT_SIZE = 20; + CRIPEMD160(); CRIPEMD160& Write(const unsigned char *data, size_t len); - void Finalize(unsigned char *hash); + void Finalize(unsigned char hash[OUTPUT_SIZE]); CRIPEMD160& Reset(); }; diff --git a/src/crypto/sha1.cpp b/src/crypto/sha1.cpp index e0f32b7d1d..304401a50f 100644 --- a/src/crypto/sha1.cpp +++ b/src/crypto/sha1.cpp @@ -172,7 +172,7 @@ CSHA1& CSHA1::Write(const unsigned char *data, size_t len) { return *this; } -void CSHA1::Finalize(unsigned char *hash) { +void CSHA1::Finalize(unsigned char hash[OUTPUT_SIZE]) { static const unsigned char pad[64] = {0x80}; unsigned char sizedesc[8]; WriteBE64(sizedesc, bytes << 3); diff --git a/src/crypto/sha1.h b/src/crypto/sha1.h index 6efde78a5b..b16f2c88ce 100644 --- a/src/crypto/sha1.h +++ b/src/crypto/sha1.h @@ -16,9 +16,11 @@ private: size_t bytes; public: + static const size_t OUTPUT_SIZE = 20; + CSHA1(); CSHA1& Write(const unsigned char *data, size_t len); - void Finalize(unsigned char *hash); + void Finalize(unsigned char hash[OUTPUT_SIZE]); CSHA1& Reset(); }; diff --git a/src/crypto/sha2.cpp b/src/crypto/sha2.cpp index 77f35f38d8..99a251cb12 100644 --- a/src/crypto/sha2.cpp +++ b/src/crypto/sha2.cpp @@ -295,7 +295,7 @@ CSHA256& CSHA256::Write(const unsigned char *data, size_t len) { return *this; } -void CSHA256::Finalize(unsigned char *hash) { +void CSHA256::Finalize(unsigned char hash[OUTPUT_SIZE]) { static const unsigned char pad[64] = {0x80}; unsigned char sizedesc[8]; WriteBE64(sizedesc, bytes << 3); @@ -348,7 +348,7 @@ CSHA512& CSHA512::Write(const unsigned char *data, size_t len) { return *this; } -void CSHA512::Finalize(unsigned char *hash) { +void CSHA512::Finalize(unsigned char hash[OUTPUT_SIZE]) { static const unsigned char pad[128] = {0x80}; unsigned char sizedesc[16] = {0x00}; WriteBE64(sizedesc+8, bytes << 3); @@ -391,7 +391,7 @@ CHMAC_SHA512::CHMAC_SHA512(const unsigned char *key, size_t keylen) { inner.Write(rkey, 128); } -void CHMAC_SHA512::Finalize(unsigned char *hash) { +void CHMAC_SHA512::Finalize(unsigned char hash[OUTPUT_SIZE]) { unsigned char temp[64]; inner.Finalize(temp); outer.Write(temp, 64).Finalize(hash); diff --git a/src/crypto/sha2.h b/src/crypto/sha2.h index 001bfc647c..088d5e194c 100644 --- a/src/crypto/sha2.h +++ b/src/crypto/sha2.h @@ -16,9 +16,11 @@ private: size_t bytes; public: + static const size_t OUTPUT_SIZE = 32; + CSHA256(); CSHA256& Write(const unsigned char *data, size_t len); - void Finalize(unsigned char *hash); + void Finalize(unsigned char hash[OUTPUT_SIZE]); CSHA256& Reset(); }; @@ -30,9 +32,11 @@ private: size_t bytes; public: + static const size_t OUTPUT_SIZE = 64; + CSHA512(); CSHA512& Write(const unsigned char *data, size_t len); - void Finalize(unsigned char *hash); + void Finalize(unsigned char hash[OUTPUT_SIZE]); CSHA512& Reset(); }; @@ -43,12 +47,14 @@ private: CSHA512 inner; public: + static const size_t OUTPUT_SIZE = 64; + CHMAC_SHA512(const unsigned char *key, size_t keylen); CHMAC_SHA512& Write(const unsigned char *data, size_t len) { inner.Write(data, len); return *this; } - void Finalize(unsigned char *hash); + void Finalize(unsigned char hash[OUTPUT_SIZE]); }; #endif diff --git a/src/hash.h b/src/hash.h index 39d42eefe2..f2a0ebfe1f 100644 --- a/src/hash.h +++ b/src/hash.h @@ -19,10 +19,12 @@ class CHash256 { private: CSHA256 sha; public: - void Finalize(unsigned char *hash) { - unsigned char buf[32]; + static const size_t OUTPUT_SIZE = CSHA256::OUTPUT_SIZE; + + void Finalize(unsigned char hash[OUTPUT_SIZE]) { + unsigned char buf[sha.OUTPUT_SIZE]; sha.Finalize(buf); - sha.Reset().Write(buf, 32).Finalize(hash); + sha.Reset().Write(buf, sha.OUTPUT_SIZE).Finalize(hash); } CHash256& Write(const unsigned char *data, size_t len) { @@ -41,10 +43,12 @@ class CHash160 { private: CSHA256 sha; public: - void Finalize(unsigned char *hash) { - unsigned char buf[32]; + static const size_t OUTPUT_SIZE = CRIPEMD160::OUTPUT_SIZE; + + void Finalize(unsigned char hash[OUTPUT_SIZE]) { + unsigned char buf[sha.OUTPUT_SIZE]; sha.Finalize(buf); - CRIPEMD160().Write(buf, 32).Finalize(hash); + CRIPEMD160().Write(buf, sha.OUTPUT_SIZE).Finalize(hash); } CHash160& Write(const unsigned char *data, size_t len) { diff --git a/src/test/crypto_tests.cpp b/src/test/crypto_tests.cpp index d425f082c3..7bd98fa381 100644 --- a/src/test/crypto_tests.cpp +++ b/src/test/crypto_tests.cpp @@ -16,6 +16,7 @@ BOOST_AUTO_TEST_SUITE(crypto_tests) template void TestVector(const Hasher &h, const In &in, const Out &out) { Out hash; + BOOST_CHECK(out.size() == h.OUTPUT_SIZE); hash.resize(out.size()); { // Test that writing the whole input string at once works. From 040c2d3f5748fc41f80207d771a0a8c10ec79ba9 Mon Sep 17 00:00:00 2001 From: Drak Date: Sat, 21 Jun 2014 21:57:50 +0100 Subject: [PATCH 0214/1288] Fix formatting --- doc/release-process.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/doc/release-process.md b/doc/release-process.md index 5b96e53753..9cdc43b9be 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -50,8 +50,7 @@ Release Process wget 'ftp://ftp.simplesystems.org/pub/png/src/history/libpng16/libpng-1.6.8.tar.gz' wget 'https://fukuchi.org/works/qrencode/qrencode-3.4.3.tar.bz2' wget 'https://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.bz2' - wget 'https://svn.boost.org/trac/boost/raw-attachment/ticket/7262/boost-mingw.patch' -O \ - boost-mingw-gas-cross-compile-2013-03-03.patch + wget 'https://svn.boost.org/trac/boost/raw-attachment/ticket/7262/boost-mingw.patch' -O boost-mingw-gas-cross-compile-2013-03-03.patch wget 'https://download.qt-project.org/official_releases/qt/5.2/5.2.0/single/qt-everywhere-opensource-src-5.2.0.tar.gz' wget 'https://download.qt-project.org/archive/qt/4.6/qt-everywhere-opensource-src-4.6.4.tar.gz' wget 'https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.bz2' @@ -61,10 +60,8 @@ Release Process wget 'http://www.opensource.apple.com/tarballs/ld64/ld64-127.2.tar.gz' wget 'http://cdrkit.org/releases/cdrkit-1.1.11.tar.gz' wget 'https://github.com/theuni/libdmg-hfsplus/archive/libdmg-hfsplus-v0.1.tar.gz' - wget 'http://llvm.org/releases/3.2/clang+llvm-3.2-x86-linux-ubuntu-12.04.tar.gz' -O \ - clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz - wget 'https://raw.githubusercontent.com/theuni/osx-cross-depends/master/patches/cdrtools/genisoimage.diff' -O \ - cdrkit-deterministic.patch + wget 'http://llvm.org/releases/3.2/clang+llvm-3.2-x86-linux-ubuntu-12.04.tar.gz' -O clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz + wget 'https://raw.githubusercontent.com/theuni/osx-cross-depends/master/patches/cdrtools/genisoimage.diff' -O cdrkit-deterministic.patch cd .. ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/boost-linux.yml mv build/out/boost-*.zip inputs/ From 4949004d68dc08382df2c34ae519c1b1cfd60f1a Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 7 Jun 2014 13:53:27 +0200 Subject: [PATCH 0215/1288] Add CMutableTransaction and make CTransaction immutable. In addition, introduce a cached hash inside CTransaction, to prevent recalculating it over and over again. --- src/chainparams.cpp | 2 +- src/core.cpp | 25 ++++++++- src/core.h | 93 ++++++++++++++++++++++------------ src/miner.cpp | 18 ++++--- src/qt/coincontroldialog.cpp | 2 +- src/rpcrawtransaction.cpp | 10 ++-- src/script.cpp | 6 +-- src/script.h | 5 +- src/test/DoS_tests.cpp | 12 ++--- src/test/accounting_tests.cpp | 12 ++++- src/test/miner_tests.cpp | 12 +++-- src/test/multisig_tests.cpp | 8 +-- src/test/pmt_tests.cpp | 4 +- src/test/script_P2SH_tests.cpp | 18 +++---- src/test/script_tests.cpp | 12 ++--- src/test/sighash_tests.cpp | 6 +-- src/test/transaction_tests.cpp | 14 ++--- src/test/wallet_tests.cpp | 10 ++-- src/wallet.cpp | 18 ++++--- 19 files changed, 181 insertions(+), 106 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 31eac62d48..afbae6fc57 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -127,7 +127,7 @@ public: // CTxOut(nValue=50.00000000, scriptPubKey=0x5F1DF16B2B704C8A578D0B) // vMerkleTree: 4a5e1e const char* pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"; - CTransaction txNew; + CMutableTransaction txNew; txNew.vin.resize(1); txNew.vout.resize(1); txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << vector((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp)); diff --git a/src/core.cpp b/src/core.cpp index 6039986e6c..6c5ee1c0f8 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -91,11 +91,34 @@ std::string CFeeRate::ToString() const return result; } -uint256 CTransaction::GetHash() const +CMutableTransaction::CMutableTransaction() : nVersion(CTransaction::CURRENT_VERSION), nLockTime(0) {} +CMutableTransaction::CMutableTransaction(const CTransaction& tx) : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), nLockTime(tx.nLockTime) {} + +uint256 CMutableTransaction::GetHash() const { return SerializeHash(*this); } +void CTransaction::UpdateHash() const +{ + *const_cast(&hash) = SerializeHash(*this); +} + +CTransaction::CTransaction() : hash(0), nVersion(CTransaction::CURRENT_VERSION), vin(), vout(), nLockTime(0) { } + +CTransaction::CTransaction(const CMutableTransaction &tx) : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), nLockTime(tx.nLockTime) { + UpdateHash(); +} + +CTransaction& CTransaction::operator=(const CTransaction &tx) { + *const_cast(&nVersion) = tx.nVersion; + *const_cast*>(&vin) = tx.vin; + *const_cast*>(&vout) = tx.vout; + *const_cast(&nLockTime) = tx.nLockTime; + *const_cast(&hash) = tx.hash; + return *this; +} + int64_t CTransaction::GetValueOut() const { int64_t nValueOut = 0; diff --git a/src/core.h b/src/core.h index 0e59129349..1a20145ccf 100644 --- a/src/core.h +++ b/src/core.h @@ -203,49 +203,59 @@ public: }; +struct CMutableTransaction; + /** The basic transaction that is broadcasted on the network and contained in * blocks. A transaction can contain multiple inputs and outputs. */ class CTransaction { +private: + /** Memory only. */ + const uint256 hash; + void UpdateHash() const; + public: static CFeeRate minTxFee; static CFeeRate minRelayTxFee; static const int CURRENT_VERSION=1; - int nVersion; - std::vector vin; - std::vector vout; - unsigned int nLockTime; - CTransaction() - { - SetNull(); - } + // The local variables are made const to prevent unintended modification + // without updating the cached hash value. However, CTransaction is not + // actually immutable; deserialization and assignment are implemented, + // and bypass the constness. This is safe, as they update the entire + // structure, including the hash. + const int nVersion; + const std::vector vin; + const std::vector vout; + const unsigned int nLockTime; - IMPLEMENT_SERIALIZE - ( - READWRITE(this->nVersion); + /** Construct a CTransaction that qualifies as IsNull() */ + CTransaction(); + + /** Convert a CMutableTransaction into a CTransaction. */ + CTransaction(const CMutableTransaction &tx); + + CTransaction& operator=(const CTransaction& tx); + + IMPLEMENT_SERIALIZE( + READWRITE(*const_cast(&this->nVersion)); nVersion = this->nVersion; - READWRITE(vin); - READWRITE(vout); - READWRITE(nLockTime); + READWRITE(*const_cast*>(&vin)); + READWRITE(*const_cast*>(&vout)); + READWRITE(*const_cast(&nLockTime)); + if (fRead) + UpdateHash(); ) - void SetNull() - { - nVersion = CTransaction::CURRENT_VERSION; - vin.clear(); - vout.clear(); - nLockTime = 0; + bool IsNull() const { + return vin.empty() && vout.empty(); } - bool IsNull() const - { - return (vin.empty() && vout.empty()); + const uint256& GetHash() const { + return hash; } - uint256 GetHash() const; - // Return sum of txouts. int64_t GetValueOut() const; // GetValueIn() is a method on CCoinsViewCache, because @@ -261,22 +271,43 @@ public: friend bool operator==(const CTransaction& a, const CTransaction& b) { - return (a.nVersion == b.nVersion && - a.vin == b.vin && - a.vout == b.vout && - a.nLockTime == b.nLockTime); + return a.hash == b.hash; } friend bool operator!=(const CTransaction& a, const CTransaction& b) { - return !(a == b); + return a.hash != b.hash; } - std::string ToString() const; void print() const; }; +/** A mutable version of CTransaction. */ +struct CMutableTransaction +{ + int nVersion; + std::vector vin; + std::vector vout; + unsigned int nLockTime; + + CMutableTransaction(); + CMutableTransaction(const CTransaction& tx); + + IMPLEMENT_SERIALIZE( + READWRITE(this->nVersion); + nVersion = this->nVersion; + READWRITE(vin); + READWRITE(vout); + READWRITE(nLockTime); + ) + + /** Compute the hash of this CMutableTransaction. This is computed on the + * fly, as opposed to GetHash() in CTransaction, which uses a cached result. + */ + uint256 GetHash() const; +}; + /** wrapper for CTxOut that provides a more compact serialization */ class CTxOutCompressor { diff --git a/src/miner.cpp b/src/miner.cpp index 7efca7cfff..37cdc7d840 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -86,14 +86,14 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) CBlock *pblock = &pblocktemplate->block; // pointer for convenience // Create coinbase tx - CTransaction txNew; + CMutableTransaction txNew; txNew.vin.resize(1); txNew.vin[0].prevout.SetNull(); txNew.vout.resize(1); txNew.vout[0].scriptPubKey = scriptPubKeyIn; - // Add our coinbase tx as first transaction - pblock->vtx.push_back(txNew); + // Add dummy coinbase tx as first transaction + pblock->vtx.push_back(CTransaction()); pblocktemplate->vTxFees.push_back(-1); // updated at end pblocktemplate->vTxSigOps.push_back(-1); // updated at end @@ -294,7 +294,10 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) nLastBlockSize = nBlockSize; LogPrintf("CreateNewBlock(): total size %u\n", nBlockSize); - pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees); + // Compute final coinbase transaction. + txNew.vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees); + txNew.vin[0].scriptSig = CScript() << OP_0 << OP_0; + pblock->vtx[0] = txNew; pblocktemplate->vTxFees[0] = -nFees; // Fill in header @@ -302,7 +305,6 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) UpdateTime(*pblock, pindexPrev); pblock->nBits = GetNextWorkRequired(pindexPrev, pblock); pblock->nNonce = 0; - pblock->vtx[0].vin[0].scriptSig = CScript() << OP_0 << OP_0; pblocktemplate->vTxSigOps[0] = GetLegacySigOpCount(pblock->vtx[0]); CBlockIndex indexDummy(*pblock); @@ -328,9 +330,11 @@ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& } ++nExtraNonce; unsigned int nHeight = pindexPrev->nHeight+1; // Height first in coinbase required for block.version=2 - pblock->vtx[0].vin[0].scriptSig = (CScript() << nHeight << CScriptNum(nExtraNonce)) + COINBASE_FLAGS; - assert(pblock->vtx[0].vin[0].scriptSig.size() <= 100); + CMutableTransaction txCoinbase(pblock->vtx[0]); + txCoinbase.vin[0].scriptSig = (CScript() << nHeight << CScriptNum(nExtraNonce)) + COINBASE_FLAGS; + assert(txCoinbase.vin[0].scriptSig.size() <= 100); + pblock->vtx[0] = txCoinbase; pblock->hashMerkleRoot = pblock->BuildMerkleTree(); } diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index 42d6da7d37..52bdf96731 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -440,7 +440,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) // nPayAmount qint64 nPayAmount = 0; bool fDust = false; - CTransaction txDummy; + CMutableTransaction txDummy; foreach(const qint64 &amount, CoinControlDialog::payAmounts) { nPayAmount += amount; diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index dee7daeb2a..1b5d494beb 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -349,7 +349,7 @@ Value createrawtransaction(const Array& params, bool fHelp) Array inputs = params[0].get_array(); Object sendTo = params[1].get_obj(); - CTransaction rawTx; + CMutableTransaction rawTx; BOOST_FOREACH(const Value& input, inputs) { @@ -554,11 +554,11 @@ Value signrawtransaction(const Array& params, bool fHelp) vector txData(ParseHexV(params[0], "argument 1")); CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION); - vector txVariants; + vector txVariants; while (!ssData.empty()) { try { - CTransaction tx; + CMutableTransaction tx; ssData >> tx; txVariants.push_back(tx); } @@ -572,7 +572,7 @@ Value signrawtransaction(const Array& params, bool fHelp) // mergedTx will end up with all the signatures; it // starts as a clone of the rawtx: - CTransaction mergedTx(txVariants[0]); + CMutableTransaction mergedTx(txVariants[0]); bool fComplete = true; // Fetch previous transactions (inputs): @@ -713,7 +713,7 @@ Value signrawtransaction(const Array& params, bool fHelp) SignSignature(keystore, prevPubKey, mergedTx, i, nHashType); // ... and merge in other signatures: - BOOST_FOREACH(const CTransaction& txv, txVariants) + BOOST_FOREACH(const CMutableTransaction& txv, txVariants) { txin.scriptSig = CombineSignatures(prevPubKey, mergedTx, i, txin.scriptSig, txv.vin[i].scriptSig); } diff --git a/src/script.cpp b/src/script.cpp index b383a00a6e..c83d26885a 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1636,7 +1636,7 @@ bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const C } -bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CTransaction& txTo, unsigned int nIn, int nHashType) +bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, int nHashType) { assert(nIn < txTo.vin.size()); CTxIn& txin = txTo.vin[nIn]; @@ -1671,7 +1671,7 @@ bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CTransa return VerifyScript(txin.scriptSig, fromPubKey, txTo, nIn, STANDARD_SCRIPT_VERIFY_FLAGS, 0); } -bool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CTransaction& txTo, unsigned int nIn, int nHashType) +bool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType) { assert(nIn < txTo.vin.size()); CTxIn& txin = txTo.vin[nIn]; @@ -1689,7 +1689,7 @@ static CScript PushAll(const vector& values) return result; } -static CScript CombineMultisig(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, +static CScript CombineMultisig(CScript scriptPubKey, const CMutableTransaction& txTo, unsigned int nIn, const vector& vSolutions, vector& sigs1, vector& sigs2) { diff --git a/src/script.h b/src/script.h index a282e7dc04..bd6574627a 100644 --- a/src/script.h +++ b/src/script.h @@ -20,6 +20,7 @@ class CCoins; class CKeyStore; class CTransaction; +class CMutableTransaction; static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; // bytes static const unsigned int MAX_OP_RETURN_RELAY = 40; // bytes @@ -805,8 +806,8 @@ bool IsMine(const CKeyStore& keystore, const CTxDestination &dest); void ExtractAffectedKeys(const CKeyStore &keystore, const CScript& scriptPubKey, std::vector &vKeys); bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet); bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::vector& addressRet, int& nRequiredRet); -bool SignSignature(const CKeyStore& keystore, const CScript& fromPubKey, CTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); -bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); +bool SignSignature(const CKeyStore& keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); +bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); // Given two sets of signatures for scriptPubKey, possibly with OP_0 placeholders, diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index fb06fb3435..3a45844411 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -167,7 +167,7 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans) // 50 orphan transactions: for (int i = 0; i < 50; i++) { - CTransaction tx; + CMutableTransaction tx; tx.vin.resize(1); tx.vin[0].prevout.n = 0; tx.vin[0].prevout.hash = GetRandHash(); @@ -184,7 +184,7 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans) { CTransaction txPrev = RandomOrphan(); - CTransaction tx; + CMutableTransaction tx; tx.vin.resize(1); tx.vin[0].prevout.n = 0; tx.vin[0].prevout.hash = txPrev.GetHash(); @@ -201,7 +201,7 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans) { CTransaction txPrev = RandomOrphan(); - CTransaction tx; + CMutableTransaction tx; tx.vout.resize(1); tx.vout[0].nValue = 1*CENT; tx.vout[0].scriptPubKey.SetDestination(key.GetPubKey().GetID()); @@ -242,10 +242,10 @@ BOOST_AUTO_TEST_CASE(DoS_checkSig) // 100 orphan transactions: static const int NPREV=100; - CTransaction orphans[NPREV]; + CMutableTransaction orphans[NPREV]; for (int i = 0; i < NPREV; i++) { - CTransaction& tx = orphans[i]; + CMutableTransaction& tx = orphans[i]; tx.vin.resize(1); tx.vin[0].prevout.n = 0; tx.vin[0].prevout.hash = GetRandHash(); @@ -258,7 +258,7 @@ BOOST_AUTO_TEST_CASE(DoS_checkSig) } // Create a transaction that depends on orphans: - CTransaction tx; + CMutableTransaction tx; tx.vout.resize(1); tx.vout[0].nValue = 1*CENT; tx.vout[0].scriptPubKey.SetDestination(key.GetPubKey().GetID()); diff --git a/src/test/accounting_tests.cpp b/src/test/accounting_tests.cpp index e2a75da349..4bee0f6b6e 100644 --- a/src/test/accounting_tests.cpp +++ b/src/test/accounting_tests.cpp @@ -83,13 +83,21 @@ BOOST_AUTO_TEST_CASE(acc_orderupgrade) wtx.mapValue["comment"] = "y"; - --wtx.nLockTime; // Just to change the hash :) + { + CMutableTransaction tx(wtx); + --tx.nLockTime; // Just to change the hash :) + *static_cast(&wtx) = CTransaction(tx); + } pwalletMain->AddToWallet(wtx); vpwtx.push_back(&pwalletMain->mapWallet[wtx.GetHash()]); vpwtx[1]->nTimeReceived = (unsigned int)1333333336; wtx.mapValue["comment"] = "x"; - --wtx.nLockTime; // Just to change the hash :) + { + CMutableTransaction tx(wtx); + --tx.nLockTime; // Just to change the hash :) + *static_cast(&wtx) = CTransaction(tx); + } pwalletMain->AddToWallet(wtx); vpwtx.push_back(&pwalletMain->mapWallet[wtx.GetHash()]); vpwtx[2]->nTimeReceived = (unsigned int)1333333329; diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index bff6de41a3..47977cf295 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -51,7 +51,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) { CScript scriptPubKey = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG; CBlockTemplate *pblocktemplate; - CTransaction tx,tx2; + CMutableTransaction tx,tx2; CScript script; uint256 hash; @@ -68,10 +68,12 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) CBlock *pblock = &pblocktemplate->block; // pointer for convenience pblock->nVersion = 1; pblock->nTime = chainActive.Tip()->GetMedianTimePast()+1; - pblock->vtx[0].vin[0].scriptSig = CScript(); - pblock->vtx[0].vin[0].scriptSig.push_back(blockinfo[i].extranonce); - pblock->vtx[0].vin[0].scriptSig.push_back(chainActive.Height()); - pblock->vtx[0].vout[0].scriptPubKey = CScript(); + CMutableTransaction txCoinbase(pblock->vtx[0]); + txCoinbase.vin[0].scriptSig = CScript(); + txCoinbase.vin[0].scriptSig.push_back(blockinfo[i].extranonce); + txCoinbase.vin[0].scriptSig.push_back(chainActive.Height()); + txCoinbase.vout[0].scriptPubKey = CScript(); + pblock->vtx[0] = CTransaction(txCoinbase); if (txFirst.size() < 2) txFirst.push_back(new CTransaction(pblock->vtx[0])); pblock->hashMerkleRoot = pblock->BuildMerkleTree(); diff --git a/src/test/multisig_tests.cpp b/src/test/multisig_tests.cpp index 3775abd633..452cf084a7 100644 --- a/src/test/multisig_tests.cpp +++ b/src/test/multisig_tests.cpp @@ -55,13 +55,13 @@ BOOST_AUTO_TEST_CASE(multisig_verify) CScript escrow; escrow << OP_2 << key[0].GetPubKey() << key[1].GetPubKey() << key[2].GetPubKey() << OP_3 << OP_CHECKMULTISIG; - CTransaction txFrom; // Funding transaction + CMutableTransaction txFrom; // Funding transaction txFrom.vout.resize(3); txFrom.vout[0].scriptPubKey = a_and_b; txFrom.vout[1].scriptPubKey = a_or_b; txFrom.vout[2].scriptPubKey = escrow; - CTransaction txTo[3]; // Spending transaction + CMutableTransaction txTo[3]; // Spending transaction for (int i = 0; i < 3; i++) { txTo[i].vin.resize(1); @@ -270,13 +270,13 @@ BOOST_AUTO_TEST_CASE(multisig_Sign) CScript escrow; escrow << OP_2 << key[0].GetPubKey() << key[1].GetPubKey() << key[2].GetPubKey() << OP_3 << OP_CHECKMULTISIG; - CTransaction txFrom; // Funding transaction + CMutableTransaction txFrom; // Funding transaction txFrom.vout.resize(3); txFrom.vout[0].scriptPubKey = a_and_b; txFrom.vout[1].scriptPubKey = a_or_b; txFrom.vout[2].scriptPubKey = escrow; - CTransaction txTo[3]; // Spending transaction + CMutableTransaction txTo[3]; // Spending transaction for (int i = 0; i < 3; i++) { txTo[i].vin.resize(1); diff --git a/src/test/pmt_tests.cpp b/src/test/pmt_tests.cpp index 7d7e6681df..9dce4daac6 100644 --- a/src/test/pmt_tests.cpp +++ b/src/test/pmt_tests.cpp @@ -36,9 +36,9 @@ BOOST_AUTO_TEST_CASE(pmt_test1) // build a block with some dummy transactions CBlock block; for (unsigned int j=0; j vch(ch, ch + sizeof(ch) -1); CDataStream stream(vch, SER_DISK, CLIENT_VERSION); - CTransaction tx; + CMutableTransaction tx; stream >> tx; CValidationState state; BOOST_CHECK_MESSAGE(CheckTransaction(tx, state) && state.IsValid(), "Simple deserialized transaction should be valid."); @@ -224,10 +224,10 @@ BOOST_AUTO_TEST_CASE(basic_transaction_tests) // paid to a TX_PUBKEY, the second 21 and 22 CENT outputs // paid to a TX_PUBKEYHASH. // -static std::vector +static std::vector SetupDummyInputs(CBasicKeyStore& keystoreRet, CCoinsView & coinsRet) { - std::vector dummyTransactions; + std::vector dummyTransactions; dummyTransactions.resize(2); // Add some keys to the keystore: @@ -261,9 +261,9 @@ BOOST_AUTO_TEST_CASE(test_Get) CBasicKeyStore keystore; CCoinsView coinsDummy; CCoinsViewCache coins(coinsDummy); - std::vector dummyTransactions = SetupDummyInputs(keystore, coins); + std::vector dummyTransactions = SetupDummyInputs(keystore, coins); - CTransaction t1; + CMutableTransaction t1; t1.vin.resize(3); t1.vin[0].prevout.hash = dummyTransactions[0].GetHash(); t1.vin[0].prevout.n = 1; @@ -296,9 +296,9 @@ BOOST_AUTO_TEST_CASE(test_IsStandard) CBasicKeyStore keystore; CCoinsView coinsDummy; CCoinsViewCache coins(coinsDummy); - std::vector dummyTransactions = SetupDummyInputs(keystore, coins); + std::vector dummyTransactions = SetupDummyInputs(keystore, coins); - CTransaction t; + CMutableTransaction t; t.vin.resize(1); t.vin[0].prevout.hash = dummyTransactions[0].GetHash(); t.vin[0].prevout.n = 1; diff --git a/src/test/wallet_tests.cpp b/src/test/wallet_tests.cpp index 1993358826..86a83f5163 100644 --- a/src/test/wallet_tests.cpp +++ b/src/test/wallet_tests.cpp @@ -31,16 +31,18 @@ static vector vCoins; static void add_coin(int64_t nValue, int nAge = 6*24, bool fIsFromMe = false, int nInput=0) { static int nextLockTime = 0; - CTransaction tx; + CMutableTransaction tx; tx.nLockTime = nextLockTime++; // so all transactions get different hashes tx.vout.resize(nInput+1); tx.vout[nInput].nValue = nValue; + if (fIsFromMe) { + // IsFromMe() returns (GetDebit() > 0), and GetDebit() is 0 if vin.empty(), + // so stop vin being empty, and cache a non-zero Debit to fake out IsFromMe() + tx.vin.resize(1); + } CWalletTx* wtx = new CWalletTx(&wallet, tx); if (fIsFromMe) { - // IsFromMe() returns (GetDebit() > 0), and GetDebit() is 0 if vin.empty(), - // so stop vin being empty, and cache a non-zero Debit to fake out IsFromMe() - wtx->vin.resize(1); wtx->fDebitCached = true; wtx->nDebitCached = 1; } diff --git a/src/wallet.cpp b/src/wallet.cpp index 3176cf893a..0e0a0e87d3 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1245,6 +1245,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, } wtxNew.BindWallet(this); + CMutableTransaction txNew; { LOCK2(cs_main, cs_wallet); @@ -1252,8 +1253,8 @@ bool CWallet::CreateTransaction(const vector >& vecSend, nFeeRet = payTxFee.GetFeePerK(); while (true) { - wtxNew.vin.clear(); - wtxNew.vout.clear(); + txNew.vin.clear(); + txNew.vout.clear(); wtxNew.fFromMe = true; int64_t nTotalValue = nValue + nFeeRet; @@ -1267,7 +1268,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, strFailReason = _("Transaction amount too small"); return false; } - wtxNew.vout.push_back(txout); + txNew.vout.push_back(txout); } // Choose coins to use @@ -1331,8 +1332,8 @@ bool CWallet::CreateTransaction(const vector >& vecSend, else { // Insert change txn at random position: - vector::iterator position = wtxNew.vout.begin()+GetRandInt(wtxNew.vout.size()+1); - wtxNew.vout.insert(position, newTxOut); + vector::iterator position = txNew.vout.begin()+GetRandInt(txNew.vout.size()+1); + txNew.vout.insert(position, newTxOut); } } else @@ -1340,17 +1341,20 @@ bool CWallet::CreateTransaction(const vector >& vecSend, // Fill vin BOOST_FOREACH(const PAIRTYPE(const CWalletTx*,unsigned int)& coin, setCoins) - wtxNew.vin.push_back(CTxIn(coin.first->GetHash(),coin.second)); + txNew.vin.push_back(CTxIn(coin.first->GetHash(),coin.second)); // Sign int nIn = 0; BOOST_FOREACH(const PAIRTYPE(const CWalletTx*,unsigned int)& coin, setCoins) - if (!SignSignature(*this, *coin.first, wtxNew, nIn++)) + if (!SignSignature(*this, *coin.first, txNew, nIn++)) { strFailReason = _("Signing transaction failed"); return false; } + // Embed the constructed transaction data in wtxNew. + *static_cast(&wtxNew) = CTransaction(txNew); + // Limit size unsigned int nBytes = ::GetSerializeSize(*(CTransaction*)&wtxNew, SER_NETWORK, PROTOCOL_VERSION); if (nBytes >= MAX_STANDARD_TX_SIZE) From d38da59bf68fbb37535e2579bfb7355a16baed0e Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 9 Jun 2014 10:02:00 +0200 Subject: [PATCH 0216/1288] Code simplifications after CTransaction::GetHash() caching --- src/bloom.cpp | 3 +- src/bloom.h | 2 +- src/core.h | 6 ---- src/main.cpp | 59 ++++++++++++++++++--------------------- src/main.h | 6 ++-- src/miner.cpp | 4 +-- src/net.cpp | 10 +++---- src/net.h | 4 +-- src/rpcrawtransaction.cpp | 6 ++-- src/test/bloom_tests.cpp | 26 ++++++++--------- src/wallet.cpp | 15 +++++----- src/wallet.h | 4 +-- 12 files changed, 67 insertions(+), 78 deletions(-) diff --git a/src/bloom.cpp b/src/bloom.cpp index 1bfcbd406f..26e366179c 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -99,7 +99,7 @@ bool CBloomFilter::IsWithinSizeConstraints() const return vData.size() <= MAX_BLOOM_FILTER_SIZE && nHashFuncs <= MAX_HASH_FUNCS; } -bool CBloomFilter::IsRelevantAndUpdate(const CTransaction& tx, const uint256& hash) +bool CBloomFilter::IsRelevantAndUpdate(const CTransaction& tx) { bool fFound = false; // Match if the filter contains the hash of tx @@ -108,6 +108,7 @@ bool CBloomFilter::IsRelevantAndUpdate(const CTransaction& tx, const uint256& ha return true; if (isEmpty) return false; + const uint256& hash = tx.GetHash(); if (contains(hash)) fFound = true; diff --git a/src/bloom.h b/src/bloom.h index 75e3f38c55..956bead87f 100644 --- a/src/bloom.h +++ b/src/bloom.h @@ -83,7 +83,7 @@ public: bool IsWithinSizeConstraints() const; // Also adds any outputs which match the filter to the filter (to match their spending txes) - bool IsRelevantAndUpdate(const CTransaction& tx, const uint256& hash); + bool IsRelevantAndUpdate(const CTransaction& tx); // Checks for empty and full filters to avoid wasting cpu void UpdateEmptyFull(); diff --git a/src/core.h b/src/core.h index 1a20145ccf..27fda95552 100644 --- a/src/core.h +++ b/src/core.h @@ -496,12 +496,6 @@ public: uint256 BuildMerkleTree() const; - const uint256 &GetTxHash(unsigned int nIndex) const { - assert(vMerkleTree.size() > 0); // BuildMerkleTree must have been called first - assert(nIndex < vtx.size()); - return vMerkleTree[nIndex]; - } - std::vector GetMerkleBranch(int nIndex) const; static uint256 CheckMerkleBranch(uint256 hash, const std::vector& vMerkleBranch, int nIndex); void print() const; diff --git a/src/main.cpp b/src/main.cpp index 006ec7cabc..d3f04b95fa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -130,8 +130,8 @@ namespace { namespace { struct CMainSignals { - // Notifies listeners of updated transaction data (passing hash, transaction, and optionally the block it is found in. - boost::signals2::signal SyncTransaction; + // Notifies listeners of updated transaction data (transaction, and optionally the block it is found in. + boost::signals2::signal SyncTransaction; // Notifies listeners of an erased transaction (currently disabled, requires transaction replacement). boost::signals2::signal EraseTransaction; // Notifies listeners of an updated transaction without new data (for now: a coinbase potentially becoming visible). @@ -146,7 +146,7 @@ struct CMainSignals { } void RegisterWallet(CWalletInterface* pwalletIn) { - g_signals.SyncTransaction.connect(boost::bind(&CWalletInterface::SyncTransaction, pwalletIn, _1, _2, _3)); + g_signals.SyncTransaction.connect(boost::bind(&CWalletInterface::SyncTransaction, pwalletIn, _1, _2)); g_signals.EraseTransaction.connect(boost::bind(&CWalletInterface::EraseFromWallet, pwalletIn, _1)); g_signals.UpdatedTransaction.connect(boost::bind(&CWalletInterface::UpdatedTransaction, pwalletIn, _1)); g_signals.SetBestChain.connect(boost::bind(&CWalletInterface::SetBestChain, pwalletIn, _1)); @@ -160,7 +160,7 @@ void UnregisterWallet(CWalletInterface* pwalletIn) { g_signals.SetBestChain.disconnect(boost::bind(&CWalletInterface::SetBestChain, pwalletIn, _1)); g_signals.UpdatedTransaction.disconnect(boost::bind(&CWalletInterface::UpdatedTransaction, pwalletIn, _1)); g_signals.EraseTransaction.disconnect(boost::bind(&CWalletInterface::EraseFromWallet, pwalletIn, _1)); - g_signals.SyncTransaction.disconnect(boost::bind(&CWalletInterface::SyncTransaction, pwalletIn, _1, _2, _3)); + g_signals.SyncTransaction.disconnect(boost::bind(&CWalletInterface::SyncTransaction, pwalletIn, _1, _2)); } void UnregisterAllWallets() { @@ -172,8 +172,8 @@ void UnregisterAllWallets() { g_signals.SyncTransaction.disconnect_all_slots(); } -void SyncWithWallets(const uint256 &hash, const CTransaction &tx, const CBlock *pblock) { - g_signals.SyncTransaction(hash, tx, pblock); +void SyncWithWallets(const CTransaction &tx, const CBlock *pblock) { + g_signals.SyncTransaction(tx, pblock); } ////////////////////////////////////////////////////////////////////////////// @@ -952,7 +952,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa pool.addUnchecked(hash, entry); } - g_signals.SyncTransaction(hash, tx, NULL); + g_signals.SyncTransaction(tx, NULL); return true; } @@ -1479,7 +1479,7 @@ void UpdateTime(CBlockHeader& block, const CBlockIndex* pindexPrev) -void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight, const uint256 &txhash) +void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight) { bool ret; // mark inputs spent @@ -1494,7 +1494,7 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach } // add outputs - ret = inputs.SetCoins(txhash, CCoins(tx, nHeight)); + ret = inputs.SetCoins(tx.GetHash(), CCoins(tx, nHeight)); assert(ret); } @@ -1767,8 +1767,8 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C !((pindex->nHeight==91842 && pindex->GetBlockHash() == uint256("0x00000000000a4d0a398161ffc163c503763b1f4360639393e0e4c8e300e0caec")) || (pindex->nHeight==91880 && pindex->GetBlockHash() == uint256("0x00000000000743f190a18c5577a3c2d2a1f610ae9601ac046a38084ccb7cd721"))); if (fEnforceBIP30) { - for (unsigned int i = 0; i < block.vtx.size(); i++) { - uint256 hash = block.GetTxHash(i); + BOOST_FOREACH(const CTransaction& tx, block.vtx) { + const uint256& hash = tx.GetHash(); if (view.HaveCoins(hash) && !view.GetCoins(hash).IsPruned()) return state.DoS(100, error("ConnectBlock() : tried to overwrite transaction"), REJECT_INVALID, "bad-txns-BIP30"); @@ -1829,11 +1829,11 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C } CTxUndo txundo; - UpdateCoins(tx, state, view, txundo, pindex->nHeight, block.GetTxHash(i)); + UpdateCoins(tx, state, view, txundo, pindex->nHeight); if (!tx.IsCoinBase()) blockundo.vtxundo.push_back(txundo); - vPos.push_back(std::make_pair(block.GetTxHash(i), pos)); + vPos.push_back(std::make_pair(tx.GetHash(), pos)); pos.nTxOffset += ::GetSerializeSize(tx, SER_DISK, CLIENT_VERSION); } int64_t nTime = GetTimeMicros() - nStart; @@ -1892,13 +1892,13 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C assert(ret); // Watch for transactions paying to me - for (unsigned int i = 0; i < block.vtx.size(); i++) - g_signals.SyncTransaction(block.GetTxHash(i), block.vtx[i], &block); + BOOST_FOREACH(const CTransaction& tx, block.vtx) + g_signals.SyncTransaction(tx, &block); // Watch for changes to the previous coinbase transaction. static uint256 hashPrevBestCoinBase; g_signals.UpdatedTransaction(hashPrevBestCoinBase); - hashPrevBestCoinBase = block.GetTxHash(0); + hashPrevBestCoinBase = block.vtx[0].GetHash(); return true; } @@ -1996,7 +1996,7 @@ bool static DisconnectTip(CValidationState &state) { // Let wallets know transactions went from 1-confirmed to // 0-confirmed or conflicted: BOOST_FOREACH(const CTransaction &tx, block.vtx) { - SyncWithWallets(tx.GetHash(), tx, NULL); + SyncWithWallets(tx, NULL); } return true; } @@ -2036,11 +2036,11 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew) { // Tell wallet about transactions that went from mempool // to conflicted: BOOST_FOREACH(const CTransaction &tx, txConflicted) { - SyncWithWallets(tx.GetHash(), tx, NULL); + SyncWithWallets(tx, NULL); } // ... and about transactions that got confirmed: BOOST_FOREACH(const CTransaction &tx, block.vtx) { - SyncWithWallets(tx.GetHash(), tx, &block); + SyncWithWallets(tx, &block); } return true; } @@ -2381,16 +2381,11 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo if (!CheckTransaction(tx, state)) return error("CheckBlock() : CheckTransaction failed"); - // Build the merkle tree already. We need it anyway later, and it makes the - // block cache the transaction hashes, which means they don't need to be - // recalculated many times during this block's validation. - block.BuildMerkleTree(); - // Check for duplicate txids. This is caught by ConnectInputs(), // but catching it earlier avoids a potential DoS attack: set uniqueTx; - for (unsigned int i = 0; i < block.vtx.size(); i++) { - uniqueTx.insert(block.GetTxHash(i)); + BOOST_FOREACH(const CTransaction &tx, block.vtx) { + uniqueTx.insert(tx.GetHash()); } if (uniqueTx.size() != block.vtx.size()) return state.DoS(100, error("CheckBlock() : duplicate transaction"), @@ -2406,7 +2401,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo REJECT_INVALID, "bad-blk-sigops", true); // Check merkle root - if (fCheckMerkleRoot && block.hashMerkleRoot != block.vMerkleTree.back()) + if (fCheckMerkleRoot && block.hashMerkleRoot != block.BuildMerkleTree()) return state.DoS(100, error("CheckBlock() : hashMerkleRoot mismatch"), REJECT_INVALID, "bad-txnmrklroot", true); @@ -2682,8 +2677,8 @@ CMerkleBlock::CMerkleBlock(const CBlock& block, CBloomFilter& filter) for (unsigned int i = 0; i < block.vtx.size(); i++) { - uint256 hash = block.vtx[i].GetHash(); - if (filter.IsRelevantAndUpdate(block.vtx[i], hash)) + const uint256& hash = block.vtx[i].GetHash(); + if (filter.IsRelevantAndUpdate(block.vtx[i])) { vMatch.push_back(true); vMatchedTxn.push_back(make_pair(i, hash)); @@ -3832,7 +3827,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) if (AcceptToMemoryPool(mempool, state, tx, true, &fMissingInputs)) { mempool.check(pcoinsTip); - RelayTransaction(tx, inv.hash); + RelayTransaction(tx); mapAlreadyAskedFor.erase(inv); vWorkQueue.push_back(inv.hash); vEraseQueue.push_back(inv.hash); @@ -3862,7 +3857,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) if (AcceptToMemoryPool(mempool, stateDummy, orphanTx, true, &fMissingInputs2)) { LogPrint("mempool", " accepted orphan tx %s\n", orphanHash.ToString()); - RelayTransaction(orphanTx, orphanHash); + RelayTransaction(orphanTx); mapAlreadyAskedFor.erase(CInv(MSG_TX, orphanHash)); vWorkQueue.push_back(orphanHash); vEraseQueue.push_back(orphanHash); @@ -3947,7 +3942,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) CTransaction tx; bool fInMemPool = mempool.lookup(hash, tx); if (!fInMemPool) continue; // another thread removed since queryHashes, maybe... - if ((pfrom->pfilter && pfrom->pfilter->IsRelevantAndUpdate(tx, hash)) || + if ((pfrom->pfilter && pfrom->pfilter->IsRelevantAndUpdate(tx)) || (!pfrom->pfilter)) vInv.push_back(inv); if (vInv.size() == MAX_INV_SZ) { diff --git a/src/main.h b/src/main.h index 5a0aedcde1..7071f0094f 100644 --- a/src/main.h +++ b/src/main.h @@ -113,7 +113,7 @@ void UnregisterWallet(CWalletInterface* pwalletIn); /** Unregister all wallets from core */ void UnregisterAllWallets(); /** Push an updated transaction to all registered wallets */ -void SyncWithWallets(const uint256 &hash, const CTransaction& tx, const CBlock* pblock = NULL); +void SyncWithWallets(const CTransaction& tx, const CBlock* pblock = NULL); /** Register with a network node to receive its signals */ void RegisterNodeSignals(CNodeSignals& nodeSignals); @@ -294,7 +294,7 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, CCoinsViewCach std::vector *pvChecks = NULL); // Apply the effects of this transaction on the UTXO set represented by view -void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight, const uint256 &txhash); +void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight); // Context-independent validity checks bool CheckTransaction(const CTransaction& tx, CValidationState& state); @@ -1129,7 +1129,7 @@ public: class CWalletInterface { protected: - virtual void SyncTransaction(const uint256 &hash, const CTransaction &tx, const CBlock *pblock) =0; + virtual void SyncTransaction(const CTransaction &tx, const CBlock *pblock) =0; virtual void EraseFromWallet(const uint256 &hash) =0; virtual void SetBestChain(const CBlockLocator &locator) =0; virtual void UpdatedTransaction(const uint256 &hash) =0; diff --git a/src/miner.cpp b/src/miner.cpp index 37cdc7d840..63ce125067 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -254,8 +254,8 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) continue; CTxUndo txundo; - uint256 hash = tx.GetHash(); - UpdateCoins(tx, state, view, txundo, pindexPrev->nHeight+1, hash); + const uint256& hash = tx.GetHash(); + UpdateCoins(tx, state, view, txundo, pindexPrev->nHeight+1); // Added pblock->vtx.push_back(tx); diff --git a/src/net.cpp b/src/net.cpp index 757a06aaed..fe6b07aa94 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1808,17 +1808,17 @@ instance_of_cnetcleanup; -void RelayTransaction(const CTransaction& tx, const uint256& hash) +void RelayTransaction(const CTransaction& tx) { CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss.reserve(10000); ss << tx; - RelayTransaction(tx, hash, ss); + RelayTransaction(tx, ss); } -void RelayTransaction(const CTransaction& tx, const uint256& hash, const CDataStream& ss) +void RelayTransaction(const CTransaction& tx, const CDataStream& ss) { - CInv inv(MSG_TX, hash); + CInv inv(MSG_TX, tx.GetHash()); { LOCK(cs_mapRelay); // Expire old relay messages @@ -1840,7 +1840,7 @@ void RelayTransaction(const CTransaction& tx, const uint256& hash, const CDataSt LOCK(pnode->cs_filter); if (pnode->pfilter) { - if (pnode->pfilter->IsRelevantAndUpdate(tx, hash)) + if (pnode->pfilter->IsRelevantAndUpdate(tx)) pnode->PushInventory(inv); } else pnode->PushInventory(inv); diff --git a/src/net.h b/src/net.h index 14d578a72a..eec92f340c 100644 --- a/src/net.h +++ b/src/net.h @@ -726,8 +726,8 @@ public: class CTransaction; -void RelayTransaction(const CTransaction& tx, const uint256& hash); -void RelayTransaction(const CTransaction& tx, const uint256& hash, const CDataStream& ss); +void RelayTransaction(const CTransaction& tx); +void RelayTransaction(const CTransaction& tx, const CDataStream& ss); /** Access to the (IP) address database (peers.dat) */ class CAddrDB diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 1b5d494beb..9771f8e685 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -770,7 +770,7 @@ Value sendrawtransaction(const Array& params, bool fHelp) catch (std::exception &e) { throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); } - uint256 hashTx = tx.GetHash(); + const uint256 &hashTx = tx.GetHash(); CCoinsViewCache &view = *pcoinsTip; CCoins existingCoins; @@ -780,7 +780,7 @@ Value sendrawtransaction(const Array& params, bool fHelp) // push to local node and sync with wallets CValidationState state; if (AcceptToMemoryPool(mempool, state, tx, false, NULL, !fOverrideFees)) - SyncWithWallets(hashTx, tx, NULL); + SyncWithWallets(tx, NULL); else { if(state.IsInvalid()) throw JSONRPCError(RPC_TRANSACTION_REJECTED, strprintf("%i: %s", state.GetRejectCode(), state.GetRejectReason())); @@ -790,7 +790,7 @@ Value sendrawtransaction(const Array& params, bool fHelp) } else if (fHaveChain) { throw JSONRPCError(RPC_TRANSACTION_ALREADY_IN_CHAIN, "transaction already in block chain"); } - RelayTransaction(tx, hashTx); + RelayTransaction(tx); return hashTx.GetHex(); } diff --git a/src/test/bloom_tests.cpp b/src/test/bloom_tests.cpp index abedd3093c..b56d998be2 100644 --- a/src/test/bloom_tests.cpp +++ b/src/test/bloom_tests.cpp @@ -118,33 +118,33 @@ BOOST_AUTO_TEST_CASE(bloom_match) CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_ALL); filter.insert(uint256("0xb4749f017444b051c44dfd2720e88f314ff94f3dd6d56d40ef65854fcd7fff6b")); - BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx, tx.GetHash()), "Simple Bloom filter didn't match tx hash"); + BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match tx hash"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); // byte-reversed tx hash filter.insert(ParseHex("6bff7fcd4f8565ef406dd5d63d4ff94f318fe82027fd4dc451b04474019f74b4")); - BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx, tx.GetHash()), "Simple Bloom filter didn't match manually serialized tx hash"); + BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match manually serialized tx hash"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); filter.insert(ParseHex("30450220070aca44506c5cef3a16ed519d7c3c39f8aab192c4e1c90d065f37b8a4af6141022100a8e160b856c2d43d27d8fba71e5aef6405b8643ac4cb7cb3c462aced7f14711a01")); - BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx, tx.GetHash()), "Simple Bloom filter didn't match input signature"); + BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match input signature"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); filter.insert(ParseHex("046d11fee51b0e60666d5049a9101a72741df480b96ee26488a4d3466b95c9a40ac5eeef87e10a5cd336c19a84565f80fa6c547957b7700ff4dfbdefe76036c339")); - BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx, tx.GetHash()), "Simple Bloom filter didn't match input pub key"); + BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match input pub key"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); filter.insert(ParseHex("04943fdd508053c75000106d3bc6e2754dbcff19")); - BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx, tx.GetHash()), "Simple Bloom filter didn't match output address"); - BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(spendingTx, spendingTx.GetHash()), "Simple Bloom filter didn't add output"); + BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match output address"); + BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(spendingTx), "Simple Bloom filter didn't add output"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); filter.insert(ParseHex("a266436d2965547608b9e15d9032a7b9d64fa431")); - BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx, tx.GetHash()), "Simple Bloom filter didn't match output address"); + BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match output address"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); filter.insert(COutPoint(uint256("0x90c122d70786e899529d71dbeba91ba216982fb6ba58f3bdaab65e73b7e9260b"), 0)); - BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx, tx.GetHash()), "Simple Bloom filter didn't match COutPoint"); + BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match COutPoint"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); COutPoint prevOutPoint(uint256("0x90c122d70786e899529d71dbeba91ba216982fb6ba58f3bdaab65e73b7e9260b"), 0); @@ -154,23 +154,23 @@ BOOST_AUTO_TEST_CASE(bloom_match) memcpy(&data[32], &prevOutPoint.n, sizeof(unsigned int)); filter.insert(data); } - BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx, tx.GetHash()), "Simple Bloom filter didn't match manually serialized COutPoint"); + BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match manually serialized COutPoint"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); filter.insert(uint256("00000009e784f32f62ef849763d4f45b98e07ba658647343b915ff832b110436")); - BOOST_CHECK_MESSAGE(!filter.IsRelevantAndUpdate(tx, tx.GetHash()), "Simple Bloom filter matched random tx hash"); + BOOST_CHECK_MESSAGE(!filter.IsRelevantAndUpdate(tx), "Simple Bloom filter matched random tx hash"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); filter.insert(ParseHex("0000006d2965547608b9e15d9032a7b9d64fa431")); - BOOST_CHECK_MESSAGE(!filter.IsRelevantAndUpdate(tx, tx.GetHash()), "Simple Bloom filter matched random address"); + BOOST_CHECK_MESSAGE(!filter.IsRelevantAndUpdate(tx), "Simple Bloom filter matched random address"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); filter.insert(COutPoint(uint256("0x90c122d70786e899529d71dbeba91ba216982fb6ba58f3bdaab65e73b7e9260b"), 1)); - BOOST_CHECK_MESSAGE(!filter.IsRelevantAndUpdate(tx, tx.GetHash()), "Simple Bloom filter matched COutPoint for an output we didn't care about"); + BOOST_CHECK_MESSAGE(!filter.IsRelevantAndUpdate(tx), "Simple Bloom filter matched COutPoint for an output we didn't care about"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); filter.insert(COutPoint(uint256("0x000000d70786e899529d71dbeba91ba216982fb6ba58f3bdaab65e73b7e9260b"), 0)); - BOOST_CHECK_MESSAGE(!filter.IsRelevantAndUpdate(tx, tx.GetHash()), "Simple Bloom filter matched COutPoint for an output we didn't care about"); + BOOST_CHECK_MESSAGE(!filter.IsRelevantAndUpdate(tx), "Simple Bloom filter matched COutPoint for an output we didn't care about"); } BOOST_AUTO_TEST_CASE(merkle_block_1) diff --git a/src/wallet.cpp b/src/wallet.cpp index 0e0a0e87d3..7664d6c25c 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -603,11 +603,11 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet) // Add a transaction to the wallet, or update it. // pblock is optional, but should be provided if the transaction is known to be in a block. // If fUpdate is true, existing transactions will be updated. -bool CWallet::AddToWalletIfInvolvingMe(const uint256 &hash, const CTransaction& tx, const CBlock* pblock, bool fUpdate) +bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate) { { AssertLockHeld(cs_wallet); - bool fExisted = mapWallet.count(hash); + bool fExisted = mapWallet.count(tx.GetHash()); if (fExisted && !fUpdate) return false; if (fExisted || IsMine(tx) || IsFromMe(tx)) { @@ -621,10 +621,10 @@ bool CWallet::AddToWalletIfInvolvingMe(const uint256 &hash, const CTransaction& return false; } -void CWallet::SyncTransaction(const uint256 &hash, const CTransaction& tx, const CBlock* pblock) +void CWallet::SyncTransaction(const CTransaction& tx, const CBlock* pblock) { LOCK2(cs_main, cs_wallet); - if (!AddToWalletIfInvolvingMe(hash, tx, pblock, true)) + if (!AddToWalletIfInvolvingMe(tx, pblock, true)) return; // Not one of ours // If a transaction changes 'conflicted' state, that changes the balance @@ -870,7 +870,7 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate) ReadBlockFromDisk(block, pindex); BOOST_FOREACH(CTransaction& tx, block.vtx) { - if (AddToWalletIfInvolvingMe(tx.GetHash(), tx, &block, fUpdate)) + if (AddToWalletIfInvolvingMe(tx, &block, fUpdate)) ret++; } pindex = chainActive.Next(pindex); @@ -909,9 +909,8 @@ void CWalletTx::RelayWalletTransaction() if (!IsCoinBase()) { if (GetDepthInMainChain() == 0) { - uint256 hash = GetHash(); - LogPrintf("Relaying wtx %s\n", hash.ToString()); - RelayTransaction((CTransaction)*this, hash); + LogPrintf("Relaying wtx %s\n", GetHash().ToString()); + RelayTransaction((CTransaction)*this); } } } diff --git a/src/wallet.h b/src/wallet.h index 7df656fc25..424799b14e 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -244,8 +244,8 @@ public: void MarkDirty(); bool AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet=false); - void SyncTransaction(const uint256 &hash, const CTransaction& tx, const CBlock* pblock); - bool AddToWalletIfInvolvingMe(const uint256 &hash, const CTransaction& tx, const CBlock* pblock, bool fUpdate); + void SyncTransaction(const CTransaction& tx, const CBlock* pblock); + bool AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate); void EraseFromWallet(const uint256 &hash); int ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate = false); void ReacceptWalletTransactions(); From 0655fac0b11c7fa1992f50537887728a0878a5eb Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sat, 10 May 2014 14:47:16 +0200 Subject: [PATCH 0217/1288] miner: indentation fixes, remove for (;;) - change a for (;;) into while (true), as we nowhere else use the first - init nNonceFound to 0 - fix indentation in BitcoinMiner try/catch block --- src/miner.cpp | 207 +++++++++++++++++++++++++------------------------- 1 file changed, 105 insertions(+), 102 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 7efca7cfff..3daf823fd8 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -49,7 +49,6 @@ public: } }; - uint64_t nLastBlockTx = 0; uint64_t nLastBlockSize = 0; @@ -58,8 +57,10 @@ typedef boost::tuple TxPriority; class TxPriorityCompare { bool byFee; + public: TxPriorityCompare(bool _byFee) : byFee(_byFee) { } + bool operator()(const TxPriority& a, const TxPriority& b) { if (byFee) @@ -114,6 +115,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) // Collect memory pool transactions into the block int64_t nFees = 0; + { LOCK2(cs_main, mempool.cs); CBlockIndex* pindexPrev = chainActive.Tip(); @@ -269,7 +271,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) if (fPrintPriority) { LogPrintf("priority %.1f fee %s txid %s\n", - dPriority, feeRate.ToString(), tx.GetHash().ToString()); + dPriority, feeRate.ToString(), tx.GetHash().ToString()); } // Add transactions that depend on this one to the priority queue @@ -334,7 +336,6 @@ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& pblock->hashMerkleRoot = pblock->BuildMerkleTree(); } - #ifdef ENABLE_WALLET ////////////////////////////////////////////////////////////////////////////// // @@ -349,7 +350,8 @@ int64_t nHPSTimerStart = 0; // nonce is 0xffff0000 or above, the block is rebuilt and nNonce starts over at // zero. // -bool static ScanHash(const CBlockHeader *pblock, uint32_t& nNonce, uint256 *phash) { +bool static ScanHash(const CBlockHeader *pblock, uint32_t& nNonce, uint256 *phash) +{ // Write the first 76 bytes of the block header to a double-SHA256 state. CHash256 hasher; CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); @@ -357,7 +359,7 @@ bool static ScanHash(const CBlockHeader *pblock, uint32_t& nNonce, uint256 *phas assert(ss.size() == 80); hasher.Write((unsigned char*)&ss[0], 76); - for (;;) { + while (true) { nNonce++; // Write the last 4 bytes of the block header (the nonce) to a copy of @@ -435,114 +437,115 @@ void static BitcoinMiner(CWallet *pwallet) CReserveKey reservekey(pwallet); unsigned int nExtraNonce = 0; - try { while (true) { - if (Params().MiningRequiresPeers()) { - // Busy-wait for the network to come online so we don't waste time mining - // on an obsolete chain. In regtest mode we expect to fly solo. - while (vNodes.empty()) - MilliSleep(1000); - } - - // - // Create new block - // - unsigned int nTransactionsUpdatedLast = mempool.GetTransactionsUpdated(); - CBlockIndex* pindexPrev = chainActive.Tip(); - - auto_ptr pblocktemplate(CreateNewBlockWithKey(reservekey)); - if (!pblocktemplate.get()) - return; - CBlock *pblock = &pblocktemplate->block; - IncrementExtraNonce(pblock, pindexPrev, nExtraNonce); - - LogPrintf("Running BitcoinMiner with %u transactions in block (%u bytes)\n", pblock->vtx.size(), - ::GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION)); - - // - // Search - // - int64_t nStart = GetTime(); - uint256 hashTarget = uint256().SetCompact(pblock->nBits); - uint256 hash; - uint32_t nNonce = 0; - uint32_t nOldNonce = 0; - while (true) - { - bool fFound = ScanHash(pblock, nNonce, &hash); - uint32_t nHashesDone = nNonce - nOldNonce; - nOldNonce = nNonce; - - // Check if something found - if (fFound) - { - if (hash <= hashTarget) - { - // Found a solution - pblock->nNonce = nNonce; - assert(hash == pblock->GetHash()); - - SetThreadPriority(THREAD_PRIORITY_NORMAL); - CheckWork(pblock, *pwallet, reservekey); - SetThreadPriority(THREAD_PRIORITY_LOWEST); - - // In regression test mode, stop mining after a block is found. - if (Params().MineBlocksOnDemand()) - throw boost::thread_interrupted(); - - break; - } + try { + while (true) { + if (Params().MiningRequiresPeers()) { + // Busy-wait for the network to come online so we don't waste time mining + // on an obsolete chain. In regtest mode we expect to fly solo. + while (vNodes.empty()) + MilliSleep(1000); } - // Meter hashes/sec - static int64_t nHashCounter; - if (nHPSTimerStart == 0) - { - nHPSTimerStart = GetTimeMillis(); - nHashCounter = 0; - } - else - nHashCounter += nHashesDone; - if (GetTimeMillis() - nHPSTimerStart > 4000) - { - static CCriticalSection cs; + // + // Create new block + // + unsigned int nTransactionsUpdatedLast = mempool.GetTransactionsUpdated(); + CBlockIndex* pindexPrev = chainActive.Tip(); + + auto_ptr pblocktemplate(CreateNewBlockWithKey(reservekey)); + if (!pblocktemplate.get()) + return; + CBlock *pblock = &pblocktemplate->block; + IncrementExtraNonce(pblock, pindexPrev, nExtraNonce); + + LogPrintf("Running BitcoinMiner with %u transactions in block (%u bytes)\n", pblock->vtx.size(), + ::GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION)); + + // + // Search + // + int64_t nStart = GetTime(); + uint256 hashTarget = uint256().SetCompact(pblock->nBits); + uint256 hash; + uint32_t nNonce = 0; + uint32_t nOldNonce = 0; + while (true) { + bool fFound = ScanHash(pblock, nNonce, &hash); + uint32_t nHashesDone = nNonce - nOldNonce; + nOldNonce = nNonce; + + // Check if something found + if (fFound) { - LOCK(cs); - if (GetTimeMillis() - nHPSTimerStart > 4000) + if (hash <= hashTarget) { - dHashesPerSec = 1000.0 * nHashCounter / (GetTimeMillis() - nHPSTimerStart); - nHPSTimerStart = GetTimeMillis(); - nHashCounter = 0; - static int64_t nLogTime; - if (GetTime() - nLogTime > 30 * 60) + // Found a solution + pblock->nNonce = nNonce; + assert(hash == pblock->GetHash()); + + SetThreadPriority(THREAD_PRIORITY_NORMAL); + CheckWork(pblock, *pwallet, reservekey); + SetThreadPriority(THREAD_PRIORITY_LOWEST); + + // In regression test mode, stop mining after a block is found. + if (Params().MineBlocksOnDemand()) + throw boost::thread_interrupted(); + + break; + } + } + + // Meter hashes/sec + static int64_t nHashCounter; + if (nHPSTimerStart == 0) + { + nHPSTimerStart = GetTimeMillis(); + nHashCounter = 0; + } + else + nHashCounter += nHashesDone; + if (GetTimeMillis() - nHPSTimerStart > 4000) + { + static CCriticalSection cs; + { + LOCK(cs); + if (GetTimeMillis() - nHPSTimerStart > 4000) { - nLogTime = GetTime(); - LogPrintf("hashmeter %6.0f khash/s\n", dHashesPerSec/1000.0); + dHashesPerSec = 1000.0 * nHashCounter / (GetTimeMillis() - nHPSTimerStart); + nHPSTimerStart = GetTimeMillis(); + nHashCounter = 0; + static int64_t nLogTime; + if (GetTime() - nLogTime > 30 * 60) + { + nLogTime = GetTime(); + LogPrintf("hashmeter %6.0f khash/s\n", dHashesPerSec/1000.0); + } } } } - } - // Check for stop or if block needs to be rebuilt - boost::this_thread::interruption_point(); - // Regtest mode doesn't require peers - if (vNodes.empty() && Params().MiningRequiresPeers()) - break; - if (nNonce >= 0xffff0000) - break; - if (mempool.GetTransactionsUpdated() != nTransactionsUpdatedLast && GetTime() - nStart > 60) - break; - if (pindexPrev != chainActive.Tip()) - break; + // Check for stop or if block needs to be rebuilt + boost::this_thread::interruption_point(); + // Regtest mode doesn't require peers + if (vNodes.empty() && Params().MiningRequiresPeers()) + break; + if (nNonce >= 0xffff0000) + break; + if (mempool.GetTransactionsUpdated() != nTransactionsUpdatedLast && GetTime() - nStart > 60) + break; + if (pindexPrev != chainActive.Tip()) + break; - // Update nTime every few seconds - UpdateTime(*pblock, pindexPrev); - if (Params().AllowMinDifficultyBlocks()) - { - // Changing pblock->nTime can change work required on testnet: - hashTarget.SetCompact(pblock->nBits); + // Update nTime every few seconds + UpdateTime(*pblock, pindexPrev); + if (Params().AllowMinDifficultyBlocks()) + { + // Changing pblock->nTime can change work required on testnet: + hashTarget.SetCompact(pblock->nBits); + } } } - } } + } catch (boost::thread_interrupted) { LogPrintf("BitcoinMiner terminated\n"); @@ -577,4 +580,4 @@ void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads) minerThreads->create_thread(boost::bind(&BitcoinMiner, pwallet)); } -#endif +#endif // ENABLE_WALLET From 2831a03b798e0eea724250a6ba15cb637800354d Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sun, 22 Jun 2014 14:51:38 +0200 Subject: [PATCH 0218/1288] remove unused CNode::Cleanup() --- src/net.cpp | 5 ----- src/net.h | 2 -- 2 files changed, 7 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 757a06aaed..ad0c634340 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -528,10 +528,6 @@ void CNode::CloseSocketDisconnect() pnodeSync = NULL; } -void CNode::Cleanup() -{ -} - void CNode::PushVersion() { int nBestHeight = g_signals.GetHeight().get_value_or(0); @@ -773,7 +769,6 @@ void ThreadSocketHandler() // close socket and cleanup pnode->CloseSocketDisconnect(); - pnode->Cleanup(); // hold in disconnected pool until all refs are released if (pnode->fNetworkNode || pnode->fInbound) diff --git a/src/net.h b/src/net.h index 14d578a72a..ace9dd895d 100644 --- a/src/net.h +++ b/src/net.h @@ -693,8 +693,6 @@ public: void Subscribe(unsigned int nChannel, unsigned int nHops=0); void CancelSubscribe(unsigned int nChannel); void CloseSocketDisconnect(); - void Cleanup(); - // Denial-of-service detection/prevention // The idea is to detect peers that are behaving From 3dc1464f0a87e26f3aa39c446eb4d102a8c84dc2 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sun, 22 Jun 2014 14:52:38 +0200 Subject: [PATCH 0219/1288] add missing vhListenSocket.clear(); to CNetCleanup() --- src/net.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/net.cpp b/src/net.cpp index ad0c634340..e082980b04 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1784,6 +1784,7 @@ public: delete pnode; vNodes.clear(); vNodesDisconnected.clear(); + vhListenSocket.clear(); delete semOutbound; semOutbound = NULL; delete pnodeLocalHost; From b612bde521e42632e24735623b7cd715096a61a5 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 23 Jun 2014 08:06:52 +0200 Subject: [PATCH 0220/1288] remove unneded class CNodeCombinedStats; from rpcconsole.cpp - also 2 small style fixes --- src/qt/rpcconsole.cpp | 3 ++- src/qt/rpcconsole.h | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index f7491f4a42..e1f40ddd09 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -231,6 +231,7 @@ RPCConsole::RPCConsole(QWidget *parent) : startExecutor(); setTrafficGraphRange(INITIAL_TRAFFIC_GRAPH_MINS); + ui->detailWidget->hide(); clear(); @@ -581,7 +582,7 @@ void RPCConsole::peerLayoutChanged() if (fUnselect && selectedRow >= 0) { ui->peerWidget->selectionModel()->select(QItemSelection(selectedModelIndex.first(), selectedModelIndex.last()), - QItemSelectionModel::Deselect); + QItemSelectionModel::Deselect); } if (fReselect) diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 3fee34d00e..3aeff3eace 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -13,7 +13,6 @@ #include class ClientModel; -class CNodeCombinedStats; QT_BEGIN_NAMESPACE class QItemSelection; From fa126effc2a03e22708960344e62fc21259deb23 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 5 Jun 2014 10:10:52 +0200 Subject: [PATCH 0221/1288] Avoid undefined behavior using CFlatData in CScript serialization `&vch[vch.size()]` and even `&vch[0]` on vectors can cause assertion errors with VC in debug mode. This is the problem mentioned in #4239. The deeper problem with this is that we rely on undefined behavior. - Add `begin_ptr` and `end_ptr` functions that get the beginning and end pointer of vector in a reliable way that copes with empty vectors and doesn't reference outside the vector (see https://stackoverflow.com/questions/1339470/how-to-get-the-address-of-the-stdvector-buffer-start-most-elegantly/1339767#1339767). - Add a convenience constructor to CFlatData that wraps a vector. I added `begin_ptr` and `end_ptr` as separate functions as I imagine they will be useful in more places. --- src/script.h | 8 ++++---- src/serialize.h | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/script.h b/src/script.h index bd6574627a..ea988f0e40 100644 --- a/src/script.h +++ b/src/script.h @@ -770,12 +770,12 @@ public: void Serialize(Stream &s, int nType, int nVersion) const { std::vector compr; if (Compress(compr)) { - s << CFlatData(&compr[0], &compr[compr.size()]); + s << CFlatData(compr); return; } unsigned int nSize = script.size() + nSpecialScripts; s << VARINT(nSize); - s << CFlatData(&script[0], &script[script.size()]); + s << CFlatData(script); } template @@ -784,13 +784,13 @@ public: s >> VARINT(nSize); if (nSize < nSpecialScripts) { std::vector vch(GetSpecialSize(nSize), 0x00); - s >> REF(CFlatData(&vch[0], &vch[vch.size()])); + s >> REF(CFlatData(vch)); Decompress(nSize, vch); return; } nSize -= nSpecialScripts; script.resize(nSize); - s >> REF(CFlatData(&script[0], &script[script.size()])); + s >> REF(CFlatData(script)); } }; diff --git a/src/serialize.h b/src/serialize.h index 1341746592..5ac85554c6 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -37,6 +37,34 @@ inline T& REF(const T& val) return const_cast(val); } +/** Get begin pointer of vector (non-const version). + * @note These functions avoid the undefined case of indexing into an empty + * vector, as well as that of indexing after the end of the vector. + */ +template +inline T* begin_ptr(std::vector& v) +{ + return v.empty() ? NULL : &v[0]; +} +/** Get begin pointer of vector (const version) */ +template +inline const T* begin_ptr(const std::vector& v) +{ + return v.empty() ? NULL : &v[0]; +} +/** Get end pointer of vector (non-const version) */ +template +inline T* end_ptr(std::vector& v) +{ + return v.empty() ? NULL : (&v[0] + v.size()); +} +/** Get end pointer of vector (const version) */ +template +inline const T* end_ptr(const std::vector& v) +{ + return v.empty() ? NULL : (&v[0] + v.size()); +} + ///////////////////////////////////////////////////////////////// // // Templates for serializing to anything that looks like a stream, @@ -318,6 +346,12 @@ protected: char* pend; public: CFlatData(void* pbeginIn, void* pendIn) : pbegin((char*)pbeginIn), pend((char*)pendIn) { } + template + explicit CFlatData(std::vector &v) + { + pbegin = (char*)begin_ptr(v); + pend = (char*)end_ptr(v); + } char* begin() { return pbegin; } const char* begin() const { return pbegin; } char* end() { return pend; } From fcb0a1bb9cea0e627152e544b0701c039cc3f60e Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 27 May 2014 11:44:55 +0800 Subject: [PATCH 0222/1288] change "char pch[200000]" to "new char[200000]" --- src/util.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 30590912ff..1480b2ebf8 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -168,15 +168,14 @@ void RandAddSeedPerfmon() #ifdef WIN32 // Don't need this on Linux, OpenSSL automatically uses /dev/urandom // Seed with the entire set of perfmon data - unsigned char pdata[250000]; - memset(pdata, 0, sizeof(pdata)); - unsigned long nSize = sizeof(pdata); - long ret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, pdata, &nSize); + std::vector vData(250000,0); + unsigned long nSize = vData.size(); + long ret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, begin_ptr(vData), &nSize); RegCloseKey(HKEY_PERFORMANCE_DATA); if (ret == ERROR_SUCCESS) { - RAND_add(pdata, nSize, nSize/100.0); - OPENSSL_cleanse(pdata, nSize); + RAND_add(begin_ptr(vData), nSize, nSize/100.0); + OPENSSL_cleanse(begin_ptr(vData), nSize); LogPrint("rand", "RandAddSeed() %lu bytes\n", nSize); } #endif @@ -1141,15 +1140,15 @@ void ShrinkDebugFile() if (file && boost::filesystem::file_size(pathLog) > 10 * 1000000) { // Restart the file with some of the end - char pch[200000]; - fseek(file, -sizeof(pch), SEEK_END); - int nBytes = fread(pch, 1, sizeof(pch), file); + std::vector vch(200000,0); + fseek(file, -vch.size(), SEEK_END); + int nBytes = fread(begin_ptr(vch), 1, vch.size(), file); fclose(file); file = fopen(pathLog.string().c_str(), "w"); if (file) { - fwrite(pch, 1, nBytes, file); + fwrite(begin_ptr(vch), 1, nBytes, file); fclose(file); } } From 17db9767c469629bd338942afa776cd8ad185b04 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 23 Jun 2014 12:04:17 +0200 Subject: [PATCH 0223/1288] doc: Remove unused section from release-process.md It is outdated information. If we ever resurrect gitian-downloader it can be brought back from history and updated. --- doc/release-process.md | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/doc/release-process.md b/doc/release-process.md index 9cdc43b9be..affe6ed13a 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -177,34 +177,6 @@ Commit your signature to gitian.sigs: ### After 3 or more people have gitian-built, repackage gitian-signed zips: -From a directory containing bitcoin source, gitian.sigs and gitian zips - - export VERSION=(new version, e.g. 0.8.0) - mkdir bitcoin-${VERSION}-linux-gitian - pushd bitcoin-${VERSION}-linux-gitian - unzip ../bitcoin-${VERSION}-linux-gitian.zip - mkdir gitian - cp ../bitcoin/contrib/gitian-downloader/*.pgp ./gitian/ - for signer in $(ls ../gitian.sigs/${VERSION}/); do - cp ../gitian.sigs/${VERSION}/${signer}/bitcoin-build.assert ./gitian/${signer}-build.assert - cp ../gitian.sigs/${VERSION}/${signer}/bitcoin-build.assert.sig ./gitian/${signer}-build.assert.sig - done - zip -r bitcoin-${VERSION}-linux-gitian.zip * - cp bitcoin-${VERSION}-linux-gitian.zip ../ - popd - mkdir bitcoin-${VERSION}-win-gitian - pushd bitcoin-${VERSION}-win-gitian - unzip ../bitcoin-${VERSION}-win-gitian.zip - mkdir gitian - cp ../bitcoin/contrib/gitian-downloader/*.pgp ./gitian/ - for signer in $(ls ../gitian.sigs/${VERSION}-win/); do - cp ../gitian.sigs/${VERSION}-win/${signer}/bitcoin-build.assert ./gitian/${signer}-build.assert - cp ../gitian.sigs/${VERSION}-win/${signer}/bitcoin-build.assert.sig ./gitian/${signer}-build.assert.sig - done - zip -r bitcoin-${VERSION}-win-gitian.zip * - cp bitcoin-${VERSION}-win-gitian.zip ../ - popd - - Upload gitian zips to SourceForge - Announce the release: From 6a5c124b849ac1e9e5cfb99e72ae483eeb3e8cad Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 21 May 2014 15:22:42 +0200 Subject: [PATCH 0224/1288] [Qt] don't allow translation of our example btc address --- src/qt/forms/sendcoinsentry.ui | 2 +- src/qt/forms/signverifymessagedialog.ui | 4 ++-- src/qt/guiutil.cpp | 4 +++- src/qt/signverifymessagedialog.cpp | 1 - 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/qt/forms/sendcoinsentry.ui b/src/qt/forms/sendcoinsentry.ui index e77de0d9b8..9d829970f0 100644 --- a/src/qt/forms/sendcoinsentry.ui +++ b/src/qt/forms/sendcoinsentry.ui @@ -51,7 +51,7 @@ - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address to send the payment to diff --git a/src/qt/forms/signverifymessagedialog.ui b/src/qt/forms/signverifymessagedialog.ui index aa271b4f2a..53573ec821 100644 --- a/src/qt/forms/signverifymessagedialog.ui +++ b/src/qt/forms/signverifymessagedialog.ui @@ -45,7 +45,7 @@ - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address to sign the message with @@ -255,7 +255,7 @@ - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address the message was signed with diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 4fe98251d9..81b9054252 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -91,7 +91,9 @@ void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent) widget->setFont(bitcoinAddressFont()); #if QT_VERSION >= 0x040700 - widget->setPlaceholderText(QObject::tr("Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)")); + // We don't want translators to use own addresses in translations + // and this is the only place, where this address is supplied. + widget->setPlaceholderText(QObject::tr("Enter a Bitcoin address (e.g. %1)").arg("1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L")); #endif widget->setValidator(new BitcoinAddressEntryValidator(parent)); widget->setCheckValidator(new BitcoinAddressCheckValidator(parent)); diff --git a/src/qt/signverifymessagedialog.cpp b/src/qt/signverifymessagedialog.cpp index 3e56412c7c..d4d021e21c 100644 --- a/src/qt/signverifymessagedialog.cpp +++ b/src/qt/signverifymessagedialog.cpp @@ -27,7 +27,6 @@ SignVerifyMessageDialog::SignVerifyMessageDialog(QWidget *parent) : #if QT_VERSION >= 0x040700 ui->signatureOut_SM->setPlaceholderText(tr("Click \"Sign Message\" to generate signature")); - ui->addressIn_VM->setPlaceholderText(tr("Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)")); #endif GUIUtil::setupAddressWidget(ui->addressIn_SM, this); From be873f64540d3c0b1227920eb466097ed738f452 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 23 Jun 2014 14:35:35 +0200 Subject: [PATCH 0225/1288] Issue warning if collecting RandSeed data failed --- src/util.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/util.cpp b/src/util.cpp index 1480b2ebf8..7946089571 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -176,7 +176,14 @@ void RandAddSeedPerfmon() { RAND_add(begin_ptr(vData), nSize, nSize/100.0); OPENSSL_cleanse(begin_ptr(vData), nSize); - LogPrint("rand", "RandAddSeed() %lu bytes\n", nSize); + LogPrint("rand", "%s: %lu bytes\n", __func__, nSize); + } else { + static bool warned = false; // Warn only once + if (!warned) + { + LogPrintf("%s: Warning: RegQueryValueExA(HKEY_PERFORMANCE_DATA) failed with code %i\n", __func__, ret); + warned = true; + } } #endif } From 3b1295e98878840c94db62223d1bc202d71a7366 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 23 Jun 2014 17:41:52 +0200 Subject: [PATCH 0226/1288] qa/rpc_tests: Wait for handshake to complete in connect_nodes This avoids a race condition in which the connection was made but the version handshake is not completed yet. In that case transactions won't be broadcasted to a peer yet, and the nodes will wait forever for their mempools to sync. --- qa/rpc-tests/util.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index eded098c7c..27c9f778f6 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -182,6 +182,10 @@ def wait_bitcoinds(): def connect_nodes(from_connection, node_num): ip_port = "127.0.0.1:"+str(p2p_port(node_num)) from_connection.addnode(ip_port, "onetry") + # poll until version handshake complete to avoid race conditions + # with transaction relaying + while any(peer['version'] == 0 for peer in from_connection.getpeerinfo()): + time.sleep(0.1) def find_output(node, txid, amount): """ From f3967bcc50ea95510f12a86e90dec4c8c78fff3b Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 23 Jun 2014 14:04:24 -0400 Subject: [PATCH 0227/1288] build: fix build weirdness after 54372482. bitcoin-config.h moved, but the old file is likely to still exist when reconfiguring or switching branches. This would've caused files to not rebuild correctly, and other strange problems. Make the path explicit so that the old one cannot be found. Core libs use config/bitcoin-config.h. Libs (like crypto) which don't want access to bitcoin's headers continue to use -Iconfig and #include bitcoin-config.h. --- src/Makefile.am | 2 +- src/clientversion.h | 2 +- src/compat/glibc_compat.cpp | 2 +- src/compat/glibc_sanity.cpp | 2 +- src/init.cpp | 2 +- src/main.h | 2 +- src/net.cpp | 2 +- src/netbase.h | 2 +- src/qt/addressbookpage.cpp | 2 +- src/qt/bitcoin.cpp | 2 +- src/qt/bitcoingui.h | 2 +- src/qt/notificator.h | 2 +- src/qt/optionsdialog.cpp | 2 +- src/qt/optionsmodel.cpp | 2 +- src/qt/receiverequestdialog.cpp | 2 +- src/qt/test/test_main.cpp | 2 +- src/util.h | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 3948ca0780..5ecded442c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -18,7 +18,7 @@ $(LIBLEVELDB) $(LIBMEMENV): endif BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config -BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BITCOIN_CONFIG_INCLUDES) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) +BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) noinst_LIBRARIES = \ libbitcoin_server.a \ diff --git a/src/clientversion.h b/src/clientversion.h index 29b4aa3764..a30bbff06b 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -2,7 +2,7 @@ #define CLIENTVERSION_H #if defined(HAVE_CONFIG_H) -#include "bitcoin-config.h" +#include "config/bitcoin-config.h" #else // // client versioning and copyright year diff --git a/src/compat/glibc_compat.cpp b/src/compat/glibc_compat.cpp index bb870c01f8..22f82e4259 100644 --- a/src/compat/glibc_compat.cpp +++ b/src/compat/glibc_compat.cpp @@ -3,7 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) -#include "bitcoin-config.h" +#include "config/bitcoin-config.h" #endif #include diff --git a/src/compat/glibc_sanity.cpp b/src/compat/glibc_sanity.cpp index 6e5bae8a48..d93602e0fe 100644 --- a/src/compat/glibc_sanity.cpp +++ b/src/compat/glibc_sanity.cpp @@ -3,7 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) -#include "bitcoin-config.h" +#include "config/bitcoin-config.h" #endif #include diff --git a/src/init.cpp b/src/init.cpp index 12d2d1bb44..ff7a9011a5 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -4,7 +4,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) -#include "bitcoin-config.h" +#include "config/bitcoin-config.h" #endif #include "init.h" diff --git a/src/main.h b/src/main.h index 7071f0094f..27041a0026 100644 --- a/src/main.h +++ b/src/main.h @@ -7,7 +7,7 @@ #define BITCOIN_MAIN_H #if defined(HAVE_CONFIG_H) -#include "bitcoin-config.h" +#include "config/bitcoin-config.h" #endif #include "chainparams.h" diff --git a/src/net.cpp b/src/net.cpp index 71e3e57fa7..811df43334 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -4,7 +4,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) -#include "bitcoin-config.h" +#include "config/bitcoin-config.h" #endif #include "net.h" diff --git a/src/netbase.h b/src/netbase.h index 23cfb1f158..40a3d25676 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -6,7 +6,7 @@ #define BITCOIN_NETBASE_H #if defined(HAVE_CONFIG_H) -#include "bitcoin-config.h" +#include "config/bitcoin-config.h" #endif #include "compat.h" diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp index 2dc56a5107..5df8f19729 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -3,7 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) -#include "bitcoin-config.h" +#include "config/bitcoin-config.h" #endif #include "addressbookpage.h" diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 387f6ede4b..76dddb103c 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -3,7 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) -#include "bitcoin-config.h" +#include "config/bitcoin-config.h" #endif #include "bitcoingui.h" diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 275fa35f39..e7a842df99 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -6,7 +6,7 @@ #define BITCOINGUI_H #if defined(HAVE_CONFIG_H) -#include "bitcoin-config.h" +#include "config/bitcoin-config.h" #endif #include diff --git a/src/qt/notificator.h b/src/qt/notificator.h index abab986992..3395e64350 100644 --- a/src/qt/notificator.h +++ b/src/qt/notificator.h @@ -6,7 +6,7 @@ #define NOTIFICATOR_H #if defined(HAVE_CONFIG_H) -#include "bitcoin-config.h" +#include "config/bitcoin-config.h" #endif #include diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index abfd4123e0..12d54dff64 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -3,7 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) -#include "bitcoin-config.h" +#include "config/bitcoin-config.h" #endif #include "optionsdialog.h" diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 4dafd9d2af..6d985abaf8 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -3,7 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) -#include "bitcoin-config.h" +#include "config/bitcoin-config.h" #endif #include "optionsmodel.h" diff --git a/src/qt/receiverequestdialog.cpp b/src/qt/receiverequestdialog.cpp index d8dad15c0d..cc2f00916f 100644 --- a/src/qt/receiverequestdialog.cpp +++ b/src/qt/receiverequestdialog.cpp @@ -22,7 +22,7 @@ #endif #if defined(HAVE_CONFIG_H) -#include "bitcoin-config.h" /* for USE_QRCODE */ +#include "config/bitcoin-config.h" /* for USE_QRCODE */ #endif #ifdef USE_QRCODE diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp index 220da28cfe..03a2381c06 100644 --- a/src/qt/test/test_main.cpp +++ b/src/qt/test/test_main.cpp @@ -1,5 +1,5 @@ #if defined(HAVE_CONFIG_H) -#include "bitcoin-config.h" +#include "config/bitcoin-config.h" #endif #ifdef ENABLE_WALLET diff --git a/src/util.h b/src/util.h index da1810a3d3..5eb6f03826 100644 --- a/src/util.h +++ b/src/util.h @@ -7,7 +7,7 @@ #define BITCOIN_UTIL_H #if defined(HAVE_CONFIG_H) -#include "bitcoin-config.h" +#include "config/bitcoin-config.h" #endif #include "compat.h" From 7f3b4e95695d50a4970e6eb91faa956ab276f161 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Tue, 17 Jun 2014 14:18:13 -0400 Subject: [PATCH 0228/1288] Relax IsStandard rules for pay-to-script-hash transactions Relax the AreInputsStandard() tests for P2SH transactions -- allow any Script in a P2SH transaction to be relayed/mined, as long as it has 15 or fewer signature operations. Rationale: https://gist.github.com/gavinandresen/88be40c141bc67acb247 I don't have an easy way to test this, but the code changes are straightforward and I've updated the AreInputsStandard unit tests. --- src/main.cpp | 43 +++++++------ src/main.h | 2 + src/test/script_P2SH_tests.cpp | 114 ++++++++++++++++++++------------- 3 files changed, 95 insertions(+), 64 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index d3f04b95fa..ecabd9ec2c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -582,15 +582,13 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) } // -// Check transaction inputs, and make sure any -// pay-to-script-hash transactions are evaluating IsStandard scripts +// Check transaction inputs to mitigate two +// potential denial-of-service attacks: // -// Why bother? To avoid denial-of-service attacks; an attacker -// can submit a standard HASH... OP_EQUAL transaction, -// which will get accepted into blocks. The redemption -// script can be anything; an attacker could use a very -// expensive-to-check-upon-redemption script like: -// DUP CHECKSIG DROP ... repeated 100 times... OP_1 +// 1. scriptSigs with extra data stuffed into them, +// not consumed by scriptPubKey (or P2SH script) +// 2. P2SH scripts with a crazy number of expensive +// CHECKSIG/CHECKMULTISIG operations // bool AreInputsStandard(const CTransaction& tx, CCoinsViewCache& mapInputs) { @@ -614,8 +612,9 @@ bool AreInputsStandard(const CTransaction& tx, CCoinsViewCache& mapInputs) // Transactions with extra stuff in their scriptSigs are // non-standard. Note that this EvalScript() call will // be quick, because if there are any operations - // beside "push data" in the scriptSig the - // IsStandard() call returns false + // beside "push data" in the scriptSig + // IsStandard() will have already returned false + // and this method isn't called. vector > stack; if (!EvalScript(stack, tx.vin[i].scriptSig, tx, i, false, 0)) return false; @@ -627,16 +626,20 @@ bool AreInputsStandard(const CTransaction& tx, CCoinsViewCache& mapInputs) CScript subscript(stack.back().begin(), stack.back().end()); vector > vSolutions2; txnouttype whichType2; - if (!Solver(subscript, whichType2, vSolutions2)) - return false; - if (whichType2 == TX_SCRIPTHASH) - return false; - - int tmpExpected; - tmpExpected = ScriptSigArgsExpected(whichType2, vSolutions2); - if (tmpExpected < 0) - return false; - nArgsExpected += tmpExpected; + if (Solver(subscript, whichType2, vSolutions2)) + { + int tmpExpected = ScriptSigArgsExpected(whichType2, vSolutions2); + if (tmpExpected < 0) + return false; + nArgsExpected += tmpExpected; + } + else + { + // Any other Script with less than 15 sigops OK: + unsigned int sigops = subscript.GetSigOpCount(true); + // ... extra data left on the stack after execution is OK, too: + return (sigops <= MAX_P2SH_SIGOPS); + } } if (stack.size() != (unsigned int)nArgsExpected) diff --git a/src/main.h b/src/main.h index 27041a0026..ff1f742d1e 100644 --- a/src/main.h +++ b/src/main.h @@ -43,6 +43,8 @@ static const unsigned int DEFAULT_BLOCK_PRIORITY_SIZE = 50000; static const unsigned int MAX_STANDARD_TX_SIZE = 100000; /** The maximum allowed number of signature check operations in a block (network rule) */ static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50; +/** Maxiumum number of signature check operations in an IsStandard() P2SH script */ +static const unsigned int MAX_P2SH_SIGOPS = 15; /** The maximum number of orphan transactions kept in memory */ static const unsigned int MAX_ORPHAN_TRANSACTIONS = MAX_BLOCK_SIZE/100; /** Default for -maxorphanblocks, maximum number of orphan blocks kept in memory */ diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index a75593a8b2..6ae2b9cf64 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -256,46 +256,61 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) CCoinsView coinsDummy; CCoinsViewCache coins(coinsDummy); CBasicKeyStore keystore; - CKey key[3]; + CKey key[6]; vector keys; - for (int i = 0; i < 3; i++) + for (int i = 0; i < 6; i++) { key[i].MakeNewKey(true); keystore.AddKey(key[i]); - keys.push_back(key[i].GetPubKey()); } + for (int i = 0; i < 3; i++) + keys.push_back(key[i].GetPubKey()); CMutableTransaction txFrom; - txFrom.vout.resize(6); + txFrom.vout.resize(7); // First three are standard: CScript pay1; pay1.SetDestination(key[0].GetPubKey().GetID()); keystore.AddCScript(pay1); - CScript payScriptHash1; payScriptHash1.SetDestination(pay1.GetID()); CScript pay1of3; pay1of3.SetMultisig(1, keys); - txFrom.vout[0].scriptPubKey = payScriptHash1; + txFrom.vout[0].scriptPubKey.SetDestination(pay1.GetID()); // P2SH (OP_CHECKSIG) txFrom.vout[0].nValue = 1000; - txFrom.vout[1].scriptPubKey = pay1; + txFrom.vout[1].scriptPubKey = pay1; // ordinary OP_CHECKSIG txFrom.vout[1].nValue = 2000; - txFrom.vout[2].scriptPubKey = pay1of3; + txFrom.vout[2].scriptPubKey = pay1of3; // ordinary OP_CHECKMULTISIG txFrom.vout[2].nValue = 3000; - // Last three non-standard: - CScript empty; - keystore.AddCScript(empty); - txFrom.vout[3].scriptPubKey = empty; + // vout[3] is complicated 1-of-3 AND 2-of-3 + // ... that is OK if wrapped in P2SH: + CScript oneAndTwo; + oneAndTwo << OP_1 << key[0].GetPubKey() << key[1].GetPubKey() << key[2].GetPubKey(); + oneAndTwo << OP_3 << OP_CHECKMULTISIGVERIFY; + oneAndTwo << OP_2 << key[3].GetPubKey() << key[4].GetPubKey() << key[5].GetPubKey(); + oneAndTwo << OP_3 << OP_CHECKMULTISIG; + keystore.AddCScript(oneAndTwo); + txFrom.vout[3].scriptPubKey.SetDestination(oneAndTwo.GetID()); txFrom.vout[3].nValue = 4000; - // Can't use SetPayToScriptHash, it checks for the empty Script. So: - txFrom.vout[4].scriptPubKey << OP_HASH160 << Hash160(empty) << OP_EQUAL; + + // vout[4] is max sigops: + CScript fifteenSigops; fifteenSigops << OP_1; + for (int i = 0; i < MAX_P2SH_SIGOPS; i++) + fifteenSigops << key[i%3].GetPubKey(); + fifteenSigops << OP_15 << OP_CHECKMULTISIG; + keystore.AddCScript(fifteenSigops); + txFrom.vout[4].scriptPubKey.SetDestination(fifteenSigops.GetID()); txFrom.vout[4].nValue = 5000; - CScript oneOfEleven; - oneOfEleven << OP_1; - for (int i = 0; i < 11; i++) - oneOfEleven << key[0].GetPubKey(); - oneOfEleven << OP_11 << OP_CHECKMULTISIG; - txFrom.vout[5].scriptPubKey.SetDestination(oneOfEleven.GetID()); - txFrom.vout[5].nValue = 6000; + + // vout[5/6] are non-standard because they exceed MAX_P2SH_SIGOPS + CScript sixteenSigops; sixteenSigops << OP_16 << OP_CHECKMULTISIG; + keystore.AddCScript(sixteenSigops); + txFrom.vout[5].scriptPubKey.SetDestination(fifteenSigops.GetID()); + txFrom.vout[5].nValue = 5000; + CScript twentySigops; twentySigops << OP_CHECKMULTISIG; + keystore.AddCScript(twentySigops); + txFrom.vout[6].scriptPubKey.SetDestination(twentySigops.GetID()); + txFrom.vout[6].nValue = 6000; + coins.SetCoins(txFrom.GetHash(), CCoins(txFrom, 0)); @@ -303,19 +318,24 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) txTo.vout.resize(1); txTo.vout[0].scriptPubKey.SetDestination(key[1].GetPubKey().GetID()); - txTo.vin.resize(3); - txTo.vin[0].prevout.n = 0; - txTo.vin[0].prevout.hash = txFrom.GetHash(); + txTo.vin.resize(5); + for (int i = 0; i < 5; i++) + { + txTo.vin[i].prevout.n = i; + txTo.vin[i].prevout.hash = txFrom.GetHash(); + } BOOST_CHECK(SignSignature(keystore, txFrom, txTo, 0)); - txTo.vin[1].prevout.n = 1; - txTo.vin[1].prevout.hash = txFrom.GetHash(); BOOST_CHECK(SignSignature(keystore, txFrom, txTo, 1)); - txTo.vin[2].prevout.n = 2; - txTo.vin[2].prevout.hash = txFrom.GetHash(); BOOST_CHECK(SignSignature(keystore, txFrom, txTo, 2)); + // SignSignature doesn't know how to sign these. We're + // not testing validating signatures, so just create + // dummy signatures that DO include the correct P2SH scripts: + txTo.vin[3].scriptSig << OP_11 << OP_11 << static_cast >(oneAndTwo); + txTo.vin[4].scriptSig << static_cast >(fifteenSigops); BOOST_CHECK(::AreInputsStandard(txTo, coins)); - BOOST_CHECK_EQUAL(GetP2SHSigOpCount(txTo, coins), 1U); + // 22 P2SH sigops for all inputs (1 for vin[0], 6 for vin[3], 15 for vin[4] + BOOST_CHECK_EQUAL(GetP2SHSigOpCount(txTo, coins), 22U); // Make sure adding crap to the scriptSigs makes them non-standard: for (int i = 0; i < 3; i++) @@ -326,23 +346,29 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) txTo.vin[i].scriptSig = t; } - CMutableTransaction txToNonStd; - txToNonStd.vout.resize(1); - txToNonStd.vout[0].scriptPubKey.SetDestination(key[1].GetPubKey().GetID()); - txToNonStd.vout[0].nValue = 1000; - txToNonStd.vin.resize(2); - txToNonStd.vin[0].prevout.n = 4; - txToNonStd.vin[0].prevout.hash = txFrom.GetHash(); - txToNonStd.vin[0].scriptSig << Serialize(empty); - txToNonStd.vin[1].prevout.n = 5; - txToNonStd.vin[1].prevout.hash = txFrom.GetHash(); - txToNonStd.vin[1].scriptSig << OP_0 << Serialize(oneOfEleven); + CMutableTransaction txToNonStd1; + txToNonStd1.vout.resize(1); + txToNonStd1.vout[0].scriptPubKey.SetDestination(key[1].GetPubKey().GetID()); + txToNonStd1.vout[0].nValue = 1000; + txToNonStd1.vin.resize(1); + txToNonStd1.vin[0].prevout.n = 5; + txToNonStd1.vin[0].prevout.hash = txFrom.GetHash(); + txToNonStd1.vin[0].scriptSig << static_cast >(sixteenSigops); - BOOST_CHECK(!::AreInputsStandard(txToNonStd, coins)); - BOOST_CHECK_EQUAL(GetP2SHSigOpCount(txToNonStd, coins), 11U); + BOOST_CHECK(!::AreInputsStandard(txToNonStd1, coins)); + BOOST_CHECK_EQUAL(GetP2SHSigOpCount(txToNonStd1, coins), 16U); - txToNonStd.vin[0].scriptSig.clear(); - BOOST_CHECK(!::AreInputsStandard(txToNonStd, coins)); + CMutableTransaction txToNonStd2; + txToNonStd2.vout.resize(1); + txToNonStd2.vout[0].scriptPubKey.SetDestination(key[1].GetPubKey().GetID()); + txToNonStd2.vout[0].nValue = 1000; + txToNonStd2.vin.resize(1); + txToNonStd2.vin[0].prevout.n = 6; + txToNonStd2.vin[0].prevout.hash = txFrom.GetHash(); + txToNonStd2.vin[0].scriptSig << static_cast >(twentySigops); + + BOOST_CHECK(!::AreInputsStandard(txToNonStd2, coins)); + BOOST_CHECK_EQUAL(GetP2SHSigOpCount(txToNonStd2, coins), 20U); } BOOST_AUTO_TEST_SUITE_END() From df852d2bcc6573a3fcb3e59f82f7ea4dfa11290e Mon Sep 17 00:00:00 2001 From: jtimon Date: Mon, 10 Mar 2014 08:46:53 -0700 Subject: [PATCH 0229/1288] Refactor proof of work related functions out of main --- src/Makefile.am | 2 + src/main.cpp | 113 +------------------------------------ src/main.h | 10 ---- src/miner.cpp | 1 + src/pow.cpp | 123 +++++++++++++++++++++++++++++++++++++++++ src/pow.h | 23 ++++++++ src/rpcmining.cpp | 1 + src/test/DoS_tests.cpp | 1 + src/txdb.cpp | 5 +- 9 files changed, 155 insertions(+), 124 deletions(-) create mode 100644 src/pow.cpp create mode 100644 src/pow.h diff --git a/src/Makefile.am b/src/Makefile.am index 5ecded442c..7e7fa0c3ca 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -71,6 +71,7 @@ BITCOIN_CORE_H = \ netbase.h \ net.h \ noui.h \ + pow.h \ protocol.h \ rpcclient.h \ rpcprotocol.h \ @@ -121,6 +122,7 @@ libbitcoin_server_a_SOURCES = \ miner.cpp \ net.cpp \ noui.cpp \ + pow.cpp \ rpcblockchain.cpp \ rpcmining.cpp \ rpcmisc.cpp \ diff --git a/src/main.cpp b/src/main.cpp index d3f04b95fa..ea47601081 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,6 +12,7 @@ #include "checkqueue.h" #include "init.h" #include "net.h" +#include "pow.h" #include "txdb.h" #include "txmempool.h" #include "ui_interface.h" @@ -1194,118 +1195,6 @@ int64_t GetBlockValue(int nHeight, int64_t nFees) return nSubsidy + nFees; } -static const int64_t nTargetTimespan = 14 * 24 * 60 * 60; // two weeks -static const int64_t nTargetSpacing = 10 * 60; -static const int64_t nInterval = nTargetTimespan / nTargetSpacing; - -// -// minimum amount of work that could possibly be required nTime after -// minimum work required was nBase -// -unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime) -{ - const uint256 &bnLimit = Params().ProofOfWorkLimit(); - // Testnet has min-difficulty blocks - // after nTargetSpacing*2 time between blocks: - if (Params().AllowMinDifficultyBlocks() && nTime > nTargetSpacing*2) - return bnLimit.GetCompact(); - - uint256 bnResult; - bnResult.SetCompact(nBase); - while (nTime > 0 && bnResult < bnLimit) - { - // Maximum 400% adjustment... - bnResult *= 4; - // ... in best-case exactly 4-times-normal target time - nTime -= nTargetTimespan*4; - } - if (bnResult > bnLimit) - bnResult = bnLimit; - return bnResult.GetCompact(); -} - -unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock) -{ - unsigned int nProofOfWorkLimit = Params().ProofOfWorkLimit().GetCompact(); - - // Genesis block - if (pindexLast == NULL) - return nProofOfWorkLimit; - - // Only change once per interval - if ((pindexLast->nHeight+1) % nInterval != 0) - { - if (Params().AllowMinDifficultyBlocks()) - { - // Special difficulty rule for testnet: - // If the new block's timestamp is more than 2* 10 minutes - // then allow mining of a min-difficulty block. - if (pblock->nTime > pindexLast->nTime + nTargetSpacing*2) - return nProofOfWorkLimit; - else - { - // Return the last non-special-min-difficulty-rules-block - const CBlockIndex* pindex = pindexLast; - while (pindex->pprev && pindex->nHeight % nInterval != 0 && pindex->nBits == nProofOfWorkLimit) - pindex = pindex->pprev; - return pindex->nBits; - } - } - return pindexLast->nBits; - } - - // Go back by what we want to be 14 days worth of blocks - const CBlockIndex* pindexFirst = pindexLast; - for (int i = 0; pindexFirst && i < nInterval-1; i++) - pindexFirst = pindexFirst->pprev; - assert(pindexFirst); - - // Limit adjustment step - int64_t nActualTimespan = pindexLast->GetBlockTime() - pindexFirst->GetBlockTime(); - LogPrintf(" nActualTimespan = %d before bounds\n", nActualTimespan); - if (nActualTimespan < nTargetTimespan/4) - nActualTimespan = nTargetTimespan/4; - if (nActualTimespan > nTargetTimespan*4) - nActualTimespan = nTargetTimespan*4; - - // Retarget - uint256 bnNew; - uint256 bnOld; - bnNew.SetCompact(pindexLast->nBits); - bnOld = bnNew; - bnNew *= nActualTimespan; - bnNew /= nTargetTimespan; - - if (bnNew > Params().ProofOfWorkLimit()) - bnNew = Params().ProofOfWorkLimit(); - - /// debug print - LogPrintf("GetNextWorkRequired RETARGET\n"); - LogPrintf("nTargetTimespan = %d nActualTimespan = %d\n", nTargetTimespan, nActualTimespan); - LogPrintf("Before: %08x %s\n", pindexLast->nBits, bnOld.ToString()); - LogPrintf("After: %08x %s\n", bnNew.GetCompact(), bnNew.ToString()); - - return bnNew.GetCompact(); -} - -bool CheckProofOfWork(uint256 hash, unsigned int nBits) -{ - bool fNegative; - bool fOverflow; - uint256 bnTarget; - bnTarget.SetCompact(nBits, &fNegative, &fOverflow); - - // Check range - if (fNegative || bnTarget == 0 || fOverflow || bnTarget > Params().ProofOfWorkLimit()) - return error("CheckProofOfWork() : nBits below minimum work"); - - // Check proof of work matches claimed amount - if (hash > bnTarget) - return error("CheckProofOfWork() : hash doesn't match nBits"); - - return true; -} - bool IsInitialBlockDownload() { LOCK(cs_main); diff --git a/src/main.h b/src/main.h index 27041a0026..9858bcfd69 100644 --- a/src/main.h +++ b/src/main.h @@ -146,10 +146,6 @@ bool ProcessMessages(CNode* pfrom); bool SendMessages(CNode* pto, bool fSendTrickle); /** Run an instance of the script checking thread */ void ThreadScriptCheck(); -/** Check whether a block hash satisfies the proof-of-work requirement specified by nBits */ -bool CheckProofOfWork(uint256 hash, unsigned int nBits); -/** Calculate the minimum amount of work a received block needs, without knowing its direct parent */ -unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime); /** Check whether we are doing an initial block download (synchronizing from disk or network) */ bool IsInitialBlockDownload(); /** Format a string that describes several potential problems detected by the core */ @@ -159,7 +155,6 @@ bool GetTransaction(const uint256 &hash, CTransaction &tx, uint256 &hashBlock, b /** Find the best known block, and make it the tip of the block chain */ bool ActivateBestChain(CValidationState &state); int64_t GetBlockValue(int nHeight, int64_t nFees); -unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock); void UpdateTime(CBlockHeader& block, const CBlockIndex* pindexPrev); @@ -812,11 +807,6 @@ public: return (~bnTarget / (bnTarget + 1)) + 1; } - bool CheckIndex() const - { - return CheckProofOfWork(GetBlockHash(), nBits); - } - enum { nMedianTimeSpan=11 }; int64_t GetMedianTimePast() const diff --git a/src/miner.cpp b/src/miner.cpp index 63ce125067..2a4f8cfa52 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -9,6 +9,7 @@ #include "hash.h" #include "main.h" #include "net.h" +#include "pow.h" #ifdef ENABLE_WALLET #include "wallet.h" #endif diff --git a/src/pow.cpp b/src/pow.cpp new file mode 100644 index 0000000000..274a5d6f98 --- /dev/null +++ b/src/pow.cpp @@ -0,0 +1,123 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "pow.h" + +#include "chainparams.h" +#include "core.h" +#include "main.h" +#include "uint256.h" + +static const int64_t nTargetTimespan = 14 * 24 * 60 * 60; // two weeks +static const int64_t nTargetSpacing = 10 * 60; +static const int64_t nInterval = nTargetTimespan / nTargetSpacing; + +unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock) +{ + unsigned int nProofOfWorkLimit = Params().ProofOfWorkLimit().GetCompact(); + + // Genesis block + if (pindexLast == NULL) + return nProofOfWorkLimit; + + // Only change once per interval + if ((pindexLast->nHeight+1) % nInterval != 0) + { + if (Params().AllowMinDifficultyBlocks()) + { + // Special difficulty rule for testnet: + // If the new block's timestamp is more than 2* 10 minutes + // then allow mining of a min-difficulty block. + if (pblock->nTime > pindexLast->nTime + nTargetSpacing*2) + return nProofOfWorkLimit; + else + { + // Return the last non-special-min-difficulty-rules-block + const CBlockIndex* pindex = pindexLast; + while (pindex->pprev && pindex->nHeight % nInterval != 0 && pindex->nBits == nProofOfWorkLimit) + pindex = pindex->pprev; + return pindex->nBits; + } + } + return pindexLast->nBits; + } + + // Go back by what we want to be 14 days worth of blocks + const CBlockIndex* pindexFirst = pindexLast; + for (int i = 0; pindexFirst && i < nInterval-1; i++) + pindexFirst = pindexFirst->pprev; + assert(pindexFirst); + + // Limit adjustment step + int64_t nActualTimespan = pindexLast->GetBlockTime() - pindexFirst->GetBlockTime(); + LogPrintf(" nActualTimespan = %d before bounds\n", nActualTimespan); + if (nActualTimespan < nTargetTimespan/4) + nActualTimespan = nTargetTimespan/4; + if (nActualTimespan > nTargetTimespan*4) + nActualTimespan = nTargetTimespan*4; + + // Retarget + uint256 bnNew; + uint256 bnOld; + bnNew.SetCompact(pindexLast->nBits); + bnOld = bnNew; + bnNew *= nActualTimespan; + bnNew /= nTargetTimespan; + + if (bnNew > Params().ProofOfWorkLimit()) + bnNew = Params().ProofOfWorkLimit(); + + /// debug print + LogPrintf("GetNextWorkRequired RETARGET\n"); + LogPrintf("nTargetTimespan = %d nActualTimespan = %d\n", nTargetTimespan, nActualTimespan); + LogPrintf("Before: %08x %s\n", pindexLast->nBits, bnOld.ToString()); + LogPrintf("After: %08x %s\n", bnNew.GetCompact(), bnNew.ToString()); + + return bnNew.GetCompact(); +} + +bool CheckProofOfWork(uint256 hash, unsigned int nBits) +{ + bool fNegative; + bool fOverflow; + uint256 bnTarget; + bnTarget.SetCompact(nBits, &fNegative, &fOverflow); + + // Check range + if (fNegative || bnTarget == 0 || fOverflow || bnTarget > Params().ProofOfWorkLimit()) + return error("CheckProofOfWork() : nBits below minimum work"); + + // Check proof of work matches claimed amount + if (hash > bnTarget) + return error("CheckProofOfWork() : hash doesn't match nBits"); + + return true; +} + +// +// minimum amount of work that could possibly be required nTime after +// minimum work required was nBase +// +unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime) +{ + const uint256 &bnLimit = Params().ProofOfWorkLimit(); + // Testnet has min-difficulty blocks + // after nTargetSpacing*2 time between blocks: + if (Params().AllowMinDifficultyBlocks() && nTime > nTargetSpacing*2) + return bnLimit.GetCompact(); + + uint256 bnResult; + bnResult.SetCompact(nBase); + while (nTime > 0 && bnResult < bnLimit) + { + // Maximum 400% adjustment... + bnResult *= 4; + // ... in best-case exactly 4-times-normal target time + nTime -= nTargetTimespan*4; + } + if (bnResult > bnLimit) + bnResult = bnLimit; + return bnResult.GetCompact(); +} diff --git a/src/pow.h b/src/pow.h new file mode 100644 index 0000000000..0ce5b48766 --- /dev/null +++ b/src/pow.h @@ -0,0 +1,23 @@ + +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_POW_H +#define BITCOIN_POW_H + +#include + +class CBlockIndex; +class CBlockHeader; +class uint256; + +unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock); + +/** Check whether a block hash satisfies the proof-of-work requirement specified by nBits */ +bool CheckProofOfWork(uint256 hash, unsigned int nBits); +/** Calculate the minimum amount of work a received block needs, without knowing its direct parent */ +unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime); + +#endif diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index a1410f0e41..f60070eb5b 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -9,6 +9,7 @@ #include "net.h" #include "main.h" #include "miner.h" +#include "pow.h" #ifdef ENABLE_WALLET #include "db.h" #include "wallet.h" diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index 3a45844411..d512053051 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -11,6 +11,7 @@ #include "keystore.h" #include "main.h" #include "net.h" +#include "pow.h" #include "script.h" #include "serialize.h" diff --git a/src/txdb.cpp b/src/txdb.cpp index 4eab8525a5..92137f71ff 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -6,6 +6,7 @@ #include "txdb.h" #include "core.h" +#include "pow.h" #include "uint256.h" #include @@ -212,8 +213,8 @@ bool CBlockTreeDB::LoadBlockIndexGuts() pindexNew->nStatus = diskindex.nStatus; pindexNew->nTx = diskindex.nTx; - if (!pindexNew->CheckIndex()) - return error("LoadBlockIndex() : CheckIndex failed: %s", pindexNew->ToString()); + if (!CheckProofOfWork(pindexNew->GetBlockHash(), pindexNew->nBits)) + return error("LoadBlockIndex() : CheckProofOfWork failed: %s", pindexNew->ToString()); pcursor->Next(); } else { From fd704c7b2c5ab8b24b1829f000b829d7156b8b3c Mon Sep 17 00:00:00 2001 From: jtimon Date: Sat, 22 Mar 2014 18:29:34 +0100 Subject: [PATCH 0230/1288] move pow constants to chainparams --- src/chainparams.cpp | 7 +++++++ src/chainparams.h | 5 +++++ src/pow.cpp | 30 +++++++++++++----------------- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index afbae6fc57..eb56af750e 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -117,6 +117,8 @@ public: nRejectBlockOutdatedMajority = 950; nToCheckBlockUpgradeMajority = 1000; nMinerThreads = 0; + nTargetTimespan = 14 * 24 * 60 * 60; // two weeks + nTargetSpacing = 10 * 60; // Build the genesis block. Note that the output of the genesis coinbase cannot // be spent as it did not originally exist in the database. @@ -204,6 +206,9 @@ public: nEnforceBlockUpgradeMajority = 51; nRejectBlockOutdatedMajority = 75; nToCheckBlockUpgradeMajority = 100; + nMinerThreads = 0; + nTargetTimespan = 14 * 24 * 60 * 60; // two weeks + nTargetSpacing = 10 * 60; strDataDir = "testnet3"; // Modify the testnet genesis block so the timestamp is valid for a later start. @@ -251,6 +256,8 @@ public: nRejectBlockOutdatedMajority = 950; nToCheckBlockUpgradeMajority = 1000; nMinerThreads = 1; + nTargetTimespan = 14 * 24 * 60 * 60; // two weeks + nTargetSpacing = 10 * 60; bnProofOfWorkLimit = ~uint256(0) >> 1; genesis.nTime = 1296688602; genesis.nBits = 0x207fffff; diff --git a/src/chainparams.h b/src/chainparams.h index c0a6ebda6b..e9774bbfa2 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -70,6 +70,9 @@ public: bool AllowMinDifficultyBlocks() const { return fAllowMinDifficultyBlocks; } /* Make standard checks */ bool RequireStandard() const { return fRequireStandard; } + int64_t TargetTimespan() const { return nTargetTimespan; } + int64_t TargetSpacing() const { return nTargetSpacing; } + int64_t Interval() const { return nTargetTimespan / nTargetSpacing; } const std::string& DataDir() const { return strDataDir; } /* Make miner stop after a block is found. In RPC, don't return * until nGenProcLimit blocks are generated */ @@ -95,6 +98,8 @@ protected: int nEnforceBlockUpgradeMajority; int nRejectBlockOutdatedMajority; int nToCheckBlockUpgradeMajority; + int64_t nTargetTimespan; + int64_t nTargetSpacing; std::string strDataDir; int nMinerThreads; std::vector vSeeds; diff --git a/src/pow.cpp b/src/pow.cpp index 274a5d6f98..952250decd 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -10,10 +10,6 @@ #include "main.h" #include "uint256.h" -static const int64_t nTargetTimespan = 14 * 24 * 60 * 60; // two weeks -static const int64_t nTargetSpacing = 10 * 60; -static const int64_t nInterval = nTargetTimespan / nTargetSpacing; - unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock) { unsigned int nProofOfWorkLimit = Params().ProofOfWorkLimit().GetCompact(); @@ -23,20 +19,20 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead return nProofOfWorkLimit; // Only change once per interval - if ((pindexLast->nHeight+1) % nInterval != 0) + if ((pindexLast->nHeight+1) % Params().Interval() != 0) { if (Params().AllowMinDifficultyBlocks()) { // Special difficulty rule for testnet: // If the new block's timestamp is more than 2* 10 minutes // then allow mining of a min-difficulty block. - if (pblock->nTime > pindexLast->nTime + nTargetSpacing*2) + if (pblock->nTime > pindexLast->nTime + Params().TargetSpacing()*2) return nProofOfWorkLimit; else { // Return the last non-special-min-difficulty-rules-block const CBlockIndex* pindex = pindexLast; - while (pindex->pprev && pindex->nHeight % nInterval != 0 && pindex->nBits == nProofOfWorkLimit) + while (pindex->pprev && pindex->nHeight % Params().Interval() != 0 && pindex->nBits == nProofOfWorkLimit) pindex = pindex->pprev; return pindex->nBits; } @@ -46,17 +42,17 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead // Go back by what we want to be 14 days worth of blocks const CBlockIndex* pindexFirst = pindexLast; - for (int i = 0; pindexFirst && i < nInterval-1; i++) + for (int i = 0; pindexFirst && i < Params().Interval()-1; i++) pindexFirst = pindexFirst->pprev; assert(pindexFirst); // Limit adjustment step int64_t nActualTimespan = pindexLast->GetBlockTime() - pindexFirst->GetBlockTime(); LogPrintf(" nActualTimespan = %d before bounds\n", nActualTimespan); - if (nActualTimespan < nTargetTimespan/4) - nActualTimespan = nTargetTimespan/4; - if (nActualTimespan > nTargetTimespan*4) - nActualTimespan = nTargetTimespan*4; + if (nActualTimespan < Params().TargetTimespan()/4) + nActualTimespan = Params().TargetTimespan()/4; + if (nActualTimespan > Params().TargetTimespan()*4) + nActualTimespan = Params().TargetTimespan()*4; // Retarget uint256 bnNew; @@ -64,14 +60,14 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead bnNew.SetCompact(pindexLast->nBits); bnOld = bnNew; bnNew *= nActualTimespan; - bnNew /= nTargetTimespan; + bnNew /= Params().TargetTimespan(); if (bnNew > Params().ProofOfWorkLimit()) bnNew = Params().ProofOfWorkLimit(); /// debug print LogPrintf("GetNextWorkRequired RETARGET\n"); - LogPrintf("nTargetTimespan = %d nActualTimespan = %d\n", nTargetTimespan, nActualTimespan); + LogPrintf("Params().TargetTimespan() = %d nActualTimespan = %d\n", Params().TargetTimespan(), nActualTimespan); LogPrintf("Before: %08x %s\n", pindexLast->nBits, bnOld.ToString()); LogPrintf("After: %08x %s\n", bnNew.GetCompact(), bnNew.ToString()); @@ -104,8 +100,8 @@ unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime) { const uint256 &bnLimit = Params().ProofOfWorkLimit(); // Testnet has min-difficulty blocks - // after nTargetSpacing*2 time between blocks: - if (Params().AllowMinDifficultyBlocks() && nTime > nTargetSpacing*2) + // after Params().TargetSpacing()*2 time between blocks: + if (Params().AllowMinDifficultyBlocks() && nTime > Params().TargetSpacing()*2) return bnLimit.GetCompact(); uint256 bnResult; @@ -115,7 +111,7 @@ unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime) // Maximum 400% adjustment... bnResult *= 4; // ... in best-case exactly 4-times-normal target time - nTime -= nTargetTimespan*4; + nTime -= Params().TargetTimespan()*4; } if (bnResult > bnLimit) bnResult = bnLimit; From 6dc90ed8fa34db164fac956eed600b2ba66640a0 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sun, 22 Jun 2014 20:17:15 +0200 Subject: [PATCH 0231/1288] replace 3 separate calls to WSAGetLastError() with 1 --- src/netbase.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/netbase.cpp b/src/netbase.cpp index 4aa7367f39..3c50174e75 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -337,8 +337,9 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe if (connect(hSocket, (struct sockaddr*)&sockaddr, len) == SOCKET_ERROR) { + int nErr = WSAGetLastError(); // WSAEINVAL is here because some legacy version of winsock uses it - if (WSAGetLastError() == WSAEINPROGRESS || WSAGetLastError() == WSAEWOULDBLOCK || WSAGetLastError() == WSAEINVAL) + if (nErr == WSAEINPROGRESS || nErr == WSAEWOULDBLOCK || nErr == WSAEINVAL) { struct timeval timeout; timeout.tv_sec = nTimeout / 1000; From 1c750dbd40e23be1f17cf74cd73041a1050dc98d Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 5 May 2014 20:32:56 +0200 Subject: [PATCH 0232/1288] remove -tor compatibility code (only allow -onion) - exit, if -tor option is found and give error to user --- src/init.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index ff7a9011a5..585e4ca89a 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -560,6 +560,9 @@ bool AppInit2(boost::thread_group& threadGroup) // Check for -debugnet (deprecated) if (GetBoolArg("-debugnet", false)) InitWarning(_("Warning: Deprecated argument -debugnet ignored, use -debug=net")); + // Check for -tor - as this is a privacy risk to continue, exit here + if (GetBoolArg("-tor", false)) + return InitError(_("Error: Unsupported argument -tor found, use -onion.")); fBenchmark = GetBoolArg("-benchmark", false); // Checkmempool defaults to true in regtest mode @@ -766,19 +769,15 @@ bool AppInit2(boost::thread_group& threadGroup) } // -onion can override normal proxy, -noonion disables tor entirely - // -tor here is a temporary backwards compatibility measure - if (mapArgs.count("-tor")) - printf("Notice: option -tor has been replaced with -onion and will be removed in a later version.\n"); if (!(mapArgs.count("-onion") && mapArgs["-onion"] == "0") && - !(mapArgs.count("-tor") && mapArgs["-tor"] == "0") && - (fProxy || mapArgs.count("-onion") || mapArgs.count("-tor"))) { + (fProxy || mapArgs.count("-onion"))) { CService addrOnion; - if (!mapArgs.count("-onion") && !mapArgs.count("-tor")) + if (!mapArgs.count("-onion")) addrOnion = addrProxy; else - addrOnion = mapArgs.count("-onion")?CService(mapArgs["-onion"], 9050):CService(mapArgs["-tor"], 9050); + addrOnion = CService(mapArgs["-onion"], 9050); if (!addrOnion.IsValid()) - return InitError(strprintf(_("Invalid -onion address: '%s'"), mapArgs.count("-onion")?mapArgs["-onion"]:mapArgs["-tor"])); + return InitError(strprintf(_("Invalid -onion address: '%s'"), mapArgs["-onion"])); SetProxy(NET_TOR, addrOnion, 5); SetReachable(NET_TOR); } From 5fbb4c9b58e0ed960d19436bb951b76cae398212 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 24 Jun 2014 16:36:14 +0200 Subject: [PATCH 0233/1288] [Qt] fix links in about window not opening - closes #4402 --- src/qt/forms/helpmessagedialog.ui | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qt/forms/helpmessagedialog.ui b/src/qt/forms/helpmessagedialog.ui index d8ab27c238..81dbd90b12 100644 --- a/src/qt/forms/helpmessagedialog.ui +++ b/src/qt/forms/helpmessagedialog.ui @@ -60,6 +60,9 @@ Qt::PlainText + + true + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse From e9f2460c587e1a7116e6af671bf9987d8825bfb0 Mon Sep 17 00:00:00 2001 From: Drak Date: Tue, 24 Jun 2014 18:06:52 +0100 Subject: [PATCH 0234/1288] Add dependencies for Mac OSX gitian builds --- doc/release-process.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/release-process.md b/doc/release-process.md index affe6ed13a..d12b41772e 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -52,6 +52,7 @@ Release Process wget 'https://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.bz2' wget 'https://svn.boost.org/trac/boost/raw-attachment/ticket/7262/boost-mingw.patch' -O boost-mingw-gas-cross-compile-2013-03-03.patch wget 'https://download.qt-project.org/official_releases/qt/5.2/5.2.0/single/qt-everywhere-opensource-src-5.2.0.tar.gz' + wget 'https://download.qt-project.org/official_releases/qt/5.2/5.2.1/single/qt-everywhere-opensource-src-5.2.1.tar.gz' wget 'https://download.qt-project.org/archive/qt/4.6/qt-everywhere-opensource-src-4.6.4.tar.gz' wget 'https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.bz2' wget 'https://github.com/mingwandroid/toolchain4/archive/10cc648683617cca8bcbeae507888099b41b530c.tar.gz' @@ -100,6 +101,10 @@ Release Process 751c579830d173ef3e6f194e83d18b92ebef6df03289db13ab77a52b6bc86ef0 qt-win64-5.2.0-gitian-r3.zip e2e403e1a08869c7eed4d4293bce13d51ec6a63592918b90ae215a0eceb44cb4 protobuf-win32-2.5.0-gitian-r4.zip a0999037e8b0ef9ade13efd88fee261ba401f5ca910068b7e0cd3262ba667db0 protobuf-win64-2.5.0-gitian-r4.zip + 512bc0622c883e2e0f4cbc3fedfd8c2402d06c004ce6fb32303cc2a6f405b6df osx-native-depends-r3.tar.gz + 927e4b222be6d590b4bc2fc185872a5d0ca5c322adb983764d3ed84be6bdbc81 osx-depends-r4.tar.gz + ec95abef1df2b096a970359787c01d8c45e2a4475b7ae34e12c022634fbdba8a osx-depends-qt-5.2.1-r4.tar.gz + Build bitcoind and bitcoin-qt on Linux32, Linux64, and Win32: From e3aedbae9be362d11c420a917959156adf73e2f3 Mon Sep 17 00:00:00 2001 From: Whit J Date: Tue, 24 Jun 2014 17:23:05 -0700 Subject: [PATCH 0235/1288] Consistent lettering --- src/qt/askpassphrasedialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp index 2a6d6abc35..a448d5a9a0 100644 --- a/src/qt/askpassphrasedialog.cpp +++ b/src/qt/askpassphrasedialog.cpp @@ -37,7 +37,7 @@ AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) : case Encrypt: // Ask passphrase x2 ui->passLabel1->hide(); ui->passEdit1->hide(); - ui->warningLabel->setText(tr("Enter the new passphrase to the wallet.
Please use a passphrase of 10 or more random characters, or eight or more words.")); + ui->warningLabel->setText(tr("Enter the new passphrase to the wallet.
Please use a passphrase of ten or more random characters, or eight or more words.")); setWindowTitle(tr("Encrypt wallet")); break; case Unlock: // Ask passphrase From b79f59b9952b071128d42759cc06425dffe041d0 Mon Sep 17 00:00:00 2001 From: Drak Date: Tue, 24 Jun 2014 23:52:05 +0100 Subject: [PATCH 0236/1288] Update .gitignore Removing old file ignores so they show up in `git status` --- .gitignore | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 85ddf3871f..564fe68fd9 100644 --- a/.gitignore +++ b/.gitignore @@ -13,10 +13,10 @@ autom4te.cache/ config.log config.status configure -src/bitcoin-config.h -src/bitcoin-config.h.in +src/config/bitcoin-config.h +src/config/bitcoin-config.h.in +src/config/stamp-h1 src/build-aux/ -src/stamp-h1 share/setup.nsi share/qt/Info.plist From 14f888ca804386b111b07e8988753d67f507ba30 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 19 Jun 2014 15:08:37 +0200 Subject: [PATCH 0237/1288] Move network-time related functions to timedata.cpp/h The network time-offset-mangement functions from util.cpp are moved to timedata.(cpp|h). This breaks the dependency of util on netbase. --- src/Makefile.am | 2 + src/addrman.h | 1 + src/alert.cpp | 1 + src/qt/transactiondesc.cpp | 1 + src/qt/transactionrecord.cpp | 1 + src/rpcmisc.cpp | 1 + src/rpcnet.cpp | 1 + src/rpcwallet.cpp | 1 + src/timedata.cpp | 91 ++++++++++++++++++++++++++++++++++++ src/timedata.h | 17 +++++++ src/util.cpp | 77 ------------------------------ src/util.h | 4 -- src/wallet.cpp | 1 + 13 files changed, 118 insertions(+), 81 deletions(-) create mode 100644 src/timedata.cpp create mode 100644 src/timedata.h diff --git a/src/Makefile.am b/src/Makefile.am index 7e7fa0c3ca..cd54b0496a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -80,6 +80,7 @@ BITCOIN_CORE_H = \ serialize.h \ sync.h \ threadsafety.h \ + timedata.h \ tinyformat.h \ txdb.h \ txmempool.h \ @@ -129,6 +130,7 @@ libbitcoin_server_a_SOURCES = \ rpcnet.cpp \ rpcrawtransaction.cpp \ rpcserver.cpp \ + timedata.cpp \ txdb.cpp \ txmempool.cpp \ $(JSON_H) \ diff --git a/src/addrman.h b/src/addrman.h index 5328a93b45..c4c296560e 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -8,6 +8,7 @@ #include "netbase.h" #include "protocol.h" #include "sync.h" +#include "timedata.h" #include "util.h" #include diff --git a/src/alert.cpp b/src/alert.cpp index 638f0d7a1c..258a2b52c4 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -8,6 +8,7 @@ #include "chainparams.h" #include "key.h" #include "net.h" +#include "timedata.h" #include "ui_interface.h" #include "util.h" diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 61da3373fd..e48dbcac9d 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -12,6 +12,7 @@ #include "main.h" #include "paymentserver.h" #include "transactionrecord.h" +#include "timedata.h" #include "ui_interface.h" #include "wallet.h" diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 5a3728f498..eec2b57e8c 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -5,6 +5,7 @@ #include "transactionrecord.h" #include "base58.h" +#include "timedata.h" #include "wallet.h" #include diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 5181aa23d8..2694e2bcf1 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -9,6 +9,7 @@ #include "net.h" #include "netbase.h" #include "rpcserver.h" +#include "timedata.h" #include "util.h" #ifdef ENABLE_WALLET #include "wallet.h" diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 6fc86eedfb..a54872ccc4 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -9,6 +9,7 @@ #include "netbase.h" #include "protocol.h" #include "sync.h" +#include "timedata.h" #include "util.h" #include diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index f376ab6b63..4f27cef087 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -8,6 +8,7 @@ #include "init.h" #include "net.h" #include "netbase.h" +#include "timedata.h" #include "util.h" #include "wallet.h" #include "walletdb.h" diff --git a/src/timedata.cpp b/src/timedata.cpp new file mode 100644 index 0000000000..8a095d26dc --- /dev/null +++ b/src/timedata.cpp @@ -0,0 +1,91 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "timedata.h" + +#include "netbase.h" +#include "sync.h" +#include "ui_interface.h" +#include "util.h" + +#include + +using namespace std; + +static CCriticalSection cs_nTimeOffset; +static int64_t nTimeOffset = 0; + +// +// "Never go to sea with two chronometers; take one or three." +// Our three time sources are: +// - System clock +// - Median of other nodes clocks +// - The user (asking the user to fix the system clock if the first two disagree) +// +// +int64_t GetTimeOffset() +{ + LOCK(cs_nTimeOffset); + return nTimeOffset; +} + +int64_t GetAdjustedTime() +{ + return GetTime() + GetTimeOffset(); +} + +void AddTimeData(const CNetAddr& ip, int64_t nTime) +{ + int64_t nOffsetSample = nTime - GetTime(); + + LOCK(cs_nTimeOffset); + // Ignore duplicates + static set setKnown; + if (!setKnown.insert(ip).second) + return; + + // Add data + static CMedianFilter vTimeOffsets(200,0); + vTimeOffsets.input(nOffsetSample); + LogPrintf("Added time data, samples %d, offset %+d (%+d minutes)\n", vTimeOffsets.size(), nOffsetSample, nOffsetSample/60); + if (vTimeOffsets.size() >= 5 && vTimeOffsets.size() % 2 == 1) + { + int64_t nMedian = vTimeOffsets.median(); + std::vector vSorted = vTimeOffsets.sorted(); + // Only let other nodes change our time by so much + if (abs64(nMedian) < 70 * 60) + { + nTimeOffset = nMedian; + } + else + { + nTimeOffset = 0; + + static bool fDone; + if (!fDone) + { + // If nobody has a time different than ours but within 5 minutes of ours, give a warning + bool fMatch = false; + BOOST_FOREACH(int64_t nOffset, vSorted) + if (nOffset != 0 && abs64(nOffset) < 5 * 60) + fMatch = true; + + if (!fMatch) + { + fDone = true; + string strMessage = _("Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly."); + strMiscWarning = strMessage; + LogPrintf("*** %s\n", strMessage); + uiInterface.ThreadSafeMessageBox(strMessage, "", CClientUIInterface::MSG_WARNING); + } + } + } + if (fDebug) { + BOOST_FOREACH(int64_t n, vSorted) + LogPrintf("%+d ", n); + LogPrintf("| "); + } + LogPrintf("nTimeOffset = %+d (%+d minutes)\n", nTimeOffset, nTimeOffset/60); + } +} diff --git a/src/timedata.h b/src/timedata.h new file mode 100644 index 0000000000..0e7bdc2c1f --- /dev/null +++ b/src/timedata.h @@ -0,0 +1,17 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_TIMEDATA_H +#define BITCOIN_TIMEDATA_H + +#include + +class CNetAddr; + +/* Functions to keep track of adjusted P2P time */ +int64_t GetTimeOffset(); +int64_t GetAdjustedTime(); +void AddTimeData(const CNetAddr& ip, int64_t nTime); + +#endif diff --git a/src/util.cpp b/src/util.cpp index 30590912ff..a19c015da6 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6,7 +6,6 @@ #include "util.h" #include "chainparams.h" -#include "netbase.h" #include "sync.h" #include "ui_interface.h" #include "uint256.h" @@ -1157,13 +1156,6 @@ void ShrinkDebugFile() fclose(file); } -// -// "Never go to sea with two chronometers; take one or three." -// Our three time sources are: -// - System clock -// - Median of other nodes clocks -// - The user (asking the user to fix the system clock if the first two disagree) -// static int64_t nMockTime = 0; // For unit testing int64_t GetTime() @@ -1178,75 +1170,6 @@ void SetMockTime(int64_t nMockTimeIn) nMockTime = nMockTimeIn; } -static CCriticalSection cs_nTimeOffset; -static int64_t nTimeOffset = 0; - -int64_t GetTimeOffset() -{ - LOCK(cs_nTimeOffset); - return nTimeOffset; -} - -int64_t GetAdjustedTime() -{ - return GetTime() + GetTimeOffset(); -} - -void AddTimeData(const CNetAddr& ip, int64_t nTime) -{ - int64_t nOffsetSample = nTime - GetTime(); - - LOCK(cs_nTimeOffset); - // Ignore duplicates - static set setKnown; - if (!setKnown.insert(ip).second) - return; - - // Add data - static CMedianFilter vTimeOffsets(200,0); - vTimeOffsets.input(nOffsetSample); - LogPrintf("Added time data, samples %d, offset %+d (%+d minutes)\n", vTimeOffsets.size(), nOffsetSample, nOffsetSample/60); - if (vTimeOffsets.size() >= 5 && vTimeOffsets.size() % 2 == 1) - { - int64_t nMedian = vTimeOffsets.median(); - std::vector vSorted = vTimeOffsets.sorted(); - // Only let other nodes change our time by so much - if (abs64(nMedian) < 70 * 60) - { - nTimeOffset = nMedian; - } - else - { - nTimeOffset = 0; - - static bool fDone; - if (!fDone) - { - // If nobody has a time different than ours but within 5 minutes of ours, give a warning - bool fMatch = false; - BOOST_FOREACH(int64_t nOffset, vSorted) - if (nOffset != 0 && abs64(nOffset) < 5 * 60) - fMatch = true; - - if (!fMatch) - { - fDone = true; - string strMessage = _("Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly."); - strMiscWarning = strMessage; - LogPrintf("*** %s\n", strMessage); - uiInterface.ThreadSafeMessageBox(strMessage, "", CClientUIInterface::MSG_WARNING); - } - } - } - if (fDebug) { - BOOST_FOREACH(int64_t n, vSorted) - LogPrintf("%+d ", n); - LogPrintf("| "); - } - LogPrintf("nTimeOffset = %+d (%+d minutes)\n", nTimeOffset, nTimeOffset/60); - } -} - uint32_t insecure_rand_Rz = 11; uint32_t insecure_rand_Rw = 11; void seed_insecure_rand(bool fDeterministic) diff --git a/src/util.h b/src/util.h index 5eb6f03826..6057c72e66 100644 --- a/src/util.h +++ b/src/util.h @@ -32,7 +32,6 @@ #include #include -class CNetAddr; class uint256; static const int64_t COIN = 100000000; @@ -191,11 +190,8 @@ uint64_t GetRand(uint64_t nMax); uint256 GetRandHash(); int64_t GetTime(); void SetMockTime(int64_t nMockTimeIn); -int64_t GetAdjustedTime(); -int64_t GetTimeOffset(); std::string FormatFullVersion(); std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector& comments); -void AddTimeData(const CNetAddr& ip, int64_t nTime); void runCommand(std::string strCommand); diff --git a/src/wallet.cpp b/src/wallet.cpp index e74980e9e7..f6fd6e958d 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -9,6 +9,7 @@ #include "checkpoints.h" #include "coincontrol.h" #include "net.h" +#include "timedata.h" #include #include From 84ce18ca9339901f65d77a5821eb65f771316558 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 19 Jun 2014 15:10:04 +0200 Subject: [PATCH 0238/1288] Remove unnecessary dependencies for bitcoin-cli This commit removes all the unnecessary dependencies (key, core, netbase, sync, ...) from bitcoin-cli. To do this it shards the chain parameters into BaseParams, which contains just the RPC port and data directory (as used by utils and bitcoin-cli) and Params, with the rest. --- src/Makefile.am | 58 +++++++++++++------ src/Makefile.qt.include | 4 +- src/Makefile.qttest.include | 2 +- src/Makefile.test.include | 2 +- src/bitcoin-cli.cpp | 9 ++- src/chainparams.cpp | 36 ++++-------- src/chainparams.h | 19 ++---- src/chainparamsbase.cpp | 93 ++++++++++++++++++++++++++++++ src/chainparamsbase.h | 52 +++++++++++++++++ src/checkpoints.cpp | 4 +- src/qt/bitcoin.cpp | 2 +- src/qt/paymentserver.cpp | 8 +-- src/qt/test/paymentservertests.cpp | 1 + src/rpcmining.cpp | 2 +- src/rpcmisc.cpp | 2 +- src/rpcserver.cpp | 2 +- src/test/base58_tests.cpp | 12 ++-- src/test/test_bitcoin.cpp | 1 + src/util.cpp | 12 ++-- 19 files changed, 232 insertions(+), 89 deletions(-) create mode 100644 src/chainparamsbase.cpp create mode 100644 src/chainparamsbase.h diff --git a/src/Makefile.am b/src/Makefile.am index cd54b0496a..2d2ae2a4c1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,10 +20,19 @@ endif BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) +LIBBITCOIN_SERVER=libbitcoin_server.a +LIBBITCOIN_WALLET=libbitcoin_wallet.a +LIBBITCOIN_COMMON=libbitcoin_common.a +LIBBITCOIN_CLI=libbitcoin_cli.a +LIBBITCOIN_UTIL=libbitcoin_util.a +LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a +LIBBITCOINQT=qt/libbitcoinqt.a + noinst_LIBRARIES = \ libbitcoin_server.a \ libbitcoin_common.a \ libbitcoin_cli.a \ + libbitcoin_util.a \ crypto/libbitcoin_crypto.a if ENABLE_WALLET BITCOIN_INCLUDES += $(BDB_CPPFLAGS) @@ -50,6 +59,7 @@ BITCOIN_CORE_H = \ base58.h \ bloom.h \ chainparams.h \ + chainparamsbase.h \ checkpoints.h \ checkqueue.h \ clientversion.h \ @@ -107,8 +117,9 @@ obj/build.h: FORCE @$(MKDIR_P) $(builddir)/obj @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \ $(abs_top_srcdir) -libbitcoin_common_a-version.$(OBJEXT): obj/build.h +libbitcoin_util_a-version.$(OBJEXT): obj/build.h +# server: shared between bitcoind and bitcoin-qt libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_server_a_SOURCES = \ addrman.cpp \ @@ -136,6 +147,8 @@ libbitcoin_server_a_SOURCES = \ $(JSON_H) \ $(BITCOIN_CORE_H) +# wallet: shared between bitcoind and bitcoin-qt, but only linked +# when wallet enabled libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_wallet_a_SOURCES = \ db.cpp \ @@ -146,6 +159,7 @@ libbitcoin_wallet_a_SOURCES = \ walletdb.cpp \ $(BITCOIN_CORE_H) +# crypto primitives library crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES) crypto_libbitcoin_crypto_a_SOURCES = \ crypto/sha1.cpp \ @@ -156,6 +170,7 @@ crypto_libbitcoin_crypto_a_SOURCES = \ crypto/sha1.h \ crypto/ripemd160.h +# common: shared between bitcoind, and bitcoin-qt and non-server tools libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_common_a_SOURCES = \ base58.cpp \ @@ -166,8 +181,16 @@ libbitcoin_common_a_SOURCES = \ key.cpp \ netbase.cpp \ protocol.cpp \ - rpcprotocol.cpp \ script.cpp \ + $(BITCOIN_CORE_H) + +# util: shared between all executables. +# This library *must* be included to make sure that the glibc +# backward-compatibility objects and their sanity checks are linked. +libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES) +libbitcoin_util_a_SOURCES = \ + chainparamsbase.cpp \ + rpcprotocol.cpp \ sync.cpp \ util.cpp \ version.cpp \ @@ -176,22 +199,24 @@ libbitcoin_common_a_SOURCES = \ $(BITCOIN_CORE_H) if GLIBC_BACK_COMPAT -libbitcoin_common_a_SOURCES += compat/glibc_compat.cpp -libbitcoin_common_a_SOURCES += compat/glibcxx_compat.cpp +libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp +libbitcoin_util_a_SOURCES += compat/glibcxx_compat.cpp endif +# cli: shared between bitcoin-cli and bitcoin-qt libbitcoin_cli_a_SOURCES = \ rpcclient.cpp \ $(BITCOIN_CORE_H) -nodist_libbitcoin_common_a_SOURCES = $(srcdir)/obj/build.h +nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h # # bitcoind binary # bitcoind_LDADD = \ - libbitcoin_server.a \ - libbitcoin_common.a \ - crypto/libbitcoin_crypto.a \ + $(LIBBITCOIN_SERVER) \ + $(LIBBITCOIN_COMMON) \ + $(LIBBITCOIN_UTIL) \ + $(LIBBITCOIN_CRYPTO) \ $(LIBLEVELDB) \ $(LIBMEMENV) if ENABLE_WALLET @@ -209,11 +234,13 @@ bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES) # bitcoin-cli binary # bitcoin_cli_LDADD = \ - libbitcoin_cli.a \ - libbitcoin_common.a \ - crypto/libbitcoin_crypto.a \ + $(LIBBITCOIN_CLI) \ + $(LIBBITCOIN_COMMON) \ + $(LIBBITCOIN_UTIL) \ + $(LIBBITCOIN_CRYPTO) \ $(BOOST_LIBS) -bitcoin_cli_SOURCES = bitcoin-cli.cpp +bitcoin_cli_SOURCES = \ + bitcoin-cli.cpp bitcoin_cli_CPPFLAGS = $(BITCOIN_INCLUDES) # @@ -244,13 +271,6 @@ clean-local: @test -f $(PROTOC) $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $( @@ -60,12 +60,11 @@ static bool AppInitRPC(int argc, char* argv[]) fprintf(stderr,"Error reading configuration file: %s\n", e.what()); return false; } - // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause) - if (!SelectParamsFromCommandLine()) { + // Check for -testnet or -regtest parameter (BaseParams() calls are only valid after this clause) + if (!SelectBaseParamsFromCommandLine()) { fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n"); return false; } - if (argc<2 || mapArgs.count("-?") || mapArgs.count("-help") || mapArgs.count("-version")) { std::string strUsage = _("Bitcoin Core RPC client version") + " " + FormatFullVersion() + "\n"; @@ -104,7 +103,7 @@ Object CallRPC(const string& strMethod, const Array& params) bool fWait = GetBoolArg("-rpcwait", false); // -rpcwait means try until server has started do { - bool fConnected = d.connect(GetArg("-rpcconnect", "127.0.0.1"), GetArg("-rpcport", itostr(Params().RPCPort()))); + bool fConnected = d.connect(GetArg("-rpcconnect", "127.0.0.1"), GetArg("-rpcport", itostr(BaseParams().RPCPort()))); if (fConnected) break; if (fWait) MilliSleep(1000); diff --git a/src/chainparams.cpp b/src/chainparams.cpp index eb56af750e..63067a153d 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -99,7 +99,7 @@ unsigned int pnSeed[] = class CMainParams : public CChainParams { public: CMainParams() { - networkID = CChainParams::MAIN; + networkID = CBaseChainParams::MAIN; strNetworkID = "main"; // The message start string is designed to be unlikely to occur in normal data. // The characters are rarely used upper ASCII, not valid as UTF-8, and produce @@ -110,7 +110,6 @@ public: pchMessageStart[3] = 0xd9; vAlertPubKey = ParseHex("04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284"); nDefaultPort = 8333; - nRPCPort = 8332; bnProofOfWorkLimit = ~uint256(0) >> 32; nSubsidyHalvingInterval = 210000; nEnforceBlockUpgradeMajority = 750; @@ -191,7 +190,7 @@ static CMainParams mainParams; class CTestNetParams : public CMainParams { public: CTestNetParams() { - networkID = CChainParams::TESTNET; + networkID = CBaseChainParams::TESTNET; strNetworkID = "test"; // The message start string is designed to be unlikely to occur in normal data. // The characters are rarely used upper ASCII, not valid as UTF-8, and produce @@ -202,14 +201,12 @@ public: pchMessageStart[3] = 0x07; vAlertPubKey = ParseHex("04302390343f91cc401d56d68b123028bf52e5fca1939df127f63c6467cdf9c8e2c14b61104cf817d0b780da337893ecc4aaff1309e536162dabbdb45200ca2b0a"); nDefaultPort = 18333; - nRPCPort = 18332; nEnforceBlockUpgradeMajority = 51; nRejectBlockOutdatedMajority = 75; nToCheckBlockUpgradeMajority = 100; nMinerThreads = 0; nTargetTimespan = 14 * 24 * 60 * 60; // two weeks nTargetSpacing = 10 * 60; - strDataDir = "testnet3"; // Modify the testnet genesis block so the timestamp is valid for a later start. genesis.nTime = 1296688602; @@ -245,7 +242,7 @@ static CTestNetParams testNetParams; class CRegTestParams : public CTestNetParams { public: CRegTestParams() { - networkID = CChainParams::REGTEST; + networkID = CBaseChainParams::REGTEST; strNetworkID = "regtest"; pchMessageStart[0] = 0xfa; pchMessageStart[1] = 0xbf; @@ -264,7 +261,6 @@ public: genesis.nNonce = 2; hashGenesisBlock = genesis.GetHash(); nDefaultPort = 18444; - strDataDir = "regtest"; assert(hashGenesisBlock == uint256("0x0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206")); vSeeds.clear(); // Regtest mode doesn't have any DNS seeds. @@ -279,21 +275,23 @@ public: }; static CRegTestParams regTestParams; -static CChainParams *pCurrentParams = &mainParams; +static CChainParams *pCurrentParams = 0; const CChainParams &Params() { + assert(pCurrentParams); return *pCurrentParams; } -void SelectParams(CChainParams::Network network) { +void SelectParams(CBaseChainParams::Network network) { + SelectBaseParams(network); switch (network) { - case CChainParams::MAIN: + case CBaseChainParams::MAIN: pCurrentParams = &mainParams; break; - case CChainParams::TESTNET: + case CBaseChainParams::TESTNET: pCurrentParams = &testNetParams; break; - case CChainParams::REGTEST: + case CBaseChainParams::REGTEST: pCurrentParams = ®TestParams; break; default: @@ -303,19 +301,9 @@ void SelectParams(CChainParams::Network network) { } bool SelectParamsFromCommandLine() { - bool fRegTest = GetBoolArg("-regtest", false); - bool fTestNet = GetBoolArg("-testnet", false); - - if (fTestNet && fRegTest) { + if (!SelectBaseParamsFromCommandLine()) return false; - } - if (fRegTest) { - SelectParams(CChainParams::REGTEST); - } else if (fTestNet) { - SelectParams(CChainParams::TESTNET); - } else { - SelectParams(CChainParams::MAIN); - } + SelectParams(BaseParams().NetworkID()); return true; } diff --git a/src/chainparams.h b/src/chainparams.h index e9774bbfa2..446256ba82 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -7,6 +7,7 @@ #define BITCOIN_CHAIN_PARAMS_H #include "core.h" +#include "chainparamsbase.h" #include "protocol.h" #include "uint256.h" @@ -29,14 +30,6 @@ struct CDNSSeedData { class CChainParams { public: - enum Network { - MAIN, - TESTNET, - REGTEST, - - MAX_NETWORK_TYPES - }; - enum Base58Type { PUBKEY_ADDRESS, SCRIPT_ADDRESS, @@ -73,17 +66,15 @@ public: int64_t TargetTimespan() const { return nTargetTimespan; } int64_t TargetSpacing() const { return nTargetSpacing; } int64_t Interval() const { return nTargetTimespan / nTargetSpacing; } - const std::string& DataDir() const { return strDataDir; } /* Make miner stop after a block is found. In RPC, don't return * until nGenProcLimit blocks are generated */ bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; } - Network NetworkID() const { return networkID; } + CBaseChainParams::Network NetworkID() const { return networkID; } /* Return the BIP70 network string (main, test or regtest) */ std::string NetworkIDString() const { return strNetworkID; } const std::vector& DNSSeeds() const { return vSeeds; } const std::vector& Base58Prefix(Base58Type type) const { return base58Prefixes[type]; } const std::vector& FixedSeeds() const { return vFixedSeeds; } - int RPCPort() const { return nRPCPort; } protected: CChainParams() {} @@ -92,7 +83,6 @@ protected: // Raw pub key bytes for the broadcast alert signing key. std::vector vAlertPubKey; int nDefaultPort; - int nRPCPort; uint256 bnProofOfWorkLimit; int nSubsidyHalvingInterval; int nEnforceBlockUpgradeMajority; @@ -100,11 +90,10 @@ protected: int nToCheckBlockUpgradeMajority; int64_t nTargetTimespan; int64_t nTargetSpacing; - std::string strDataDir; int nMinerThreads; std::vector vSeeds; std::vector base58Prefixes[MAX_BASE58_TYPES]; - Network networkID; + CBaseChainParams::Network networkID; std::string strNetworkID; CBlock genesis; std::vector vFixedSeeds; @@ -123,7 +112,7 @@ protected: const CChainParams &Params(); /** Sets the params returned by Params() to those for the given network. */ -void SelectParams(CChainParams::Network network); +void SelectParams(CBaseChainParams::Network network); /** * Looks for -regtest or -testnet and then calls SelectParams as appropriate. diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp new file mode 100644 index 0000000000..19a9e72cc9 --- /dev/null +++ b/src/chainparamsbase.cpp @@ -0,0 +1,93 @@ +// Copyright (c) 2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "chainparamsbase.h" + +#include "assert.h" +#include "util.h" + +#include + +using namespace boost::assign; + +// +// Main network +// + +class CBaseMainParams : public CBaseChainParams { +public: + CBaseMainParams() { + networkID = CBaseChainParams::MAIN; + nRPCPort = 8332; + } +}; +static CBaseMainParams mainParams; + +// +// Testnet (v3) +// +class CBaseTestNetParams : public CBaseMainParams { +public: + CBaseTestNetParams() { + networkID = CBaseChainParams::TESTNET; + nRPCPort = 18332; + strDataDir = "testnet3"; + } +}; +static CBaseTestNetParams testNetParams; + +// +// Regression test +// +class CBaseRegTestParams : public CBaseTestNetParams { +public: + CBaseRegTestParams() { + networkID = CBaseChainParams::REGTEST; + strDataDir = "regtest"; + } +}; +static CBaseRegTestParams regTestParams; + +static CBaseChainParams *pCurrentBaseParams = 0; + +const CBaseChainParams &BaseParams() { + assert(pCurrentBaseParams); + return *pCurrentBaseParams; +} + +void SelectBaseParams(CBaseChainParams::Network network) { + switch (network) { + case CBaseChainParams::MAIN: + pCurrentBaseParams = &mainParams; + break; + case CBaseChainParams::TESTNET: + pCurrentBaseParams = &testNetParams; + break; + case CBaseChainParams::REGTEST: + pCurrentBaseParams = ®TestParams; + break; + default: + assert(false && "Unimplemented network"); + return; + } +} + +bool SelectBaseParamsFromCommandLine() { + bool fRegTest = GetBoolArg("-regtest", false); + bool fTestNet = GetBoolArg("-testnet", false); + + if (fTestNet && fRegTest) { + return false; + } + + if (fRegTest) { + SelectBaseParams(CBaseChainParams::REGTEST); + } else if (fTestNet) { + SelectBaseParams(CBaseChainParams::TESTNET); + } else { + SelectBaseParams(CBaseChainParams::MAIN); + } + return true; +} diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h new file mode 100644 index 0000000000..4a3b268909 --- /dev/null +++ b/src/chainparamsbase.h @@ -0,0 +1,52 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_CHAIN_PARAMS_BASE_H +#define BITCOIN_CHAIN_PARAMS_BASE_H + +#include +#include + +/** + * CBaseChainParams defines the base parameters (shared between bitcoin-cli and bitcoind) + * of a given instance of the Bitcoin system. + */ +class CBaseChainParams +{ +public: + enum Network { + MAIN, + TESTNET, + REGTEST, + + MAX_NETWORK_TYPES + }; + + const std::string& DataDir() const { return strDataDir; } + int RPCPort() const { return nRPCPort; } + Network NetworkID() const { return networkID; } +protected: + CBaseChainParams() {} + + int nRPCPort; + std::string strDataDir; + Network networkID; +}; + +/** + * Return the currently selected parameters. This won't change after app startup + * outside of the unit tests. + */ +const CBaseChainParams &BaseParams(); + +/** Sets the params returned by Params() to those for the given network. */ +void SelectBaseParams(CBaseChainParams::Network network); + +/** + * Looks for -regtest or -testnet and then calls SelectParams as appropriate. + * Returns false if an invalid combination is given. + */ +bool SelectBaseParamsFromCommandLine(); + +#endif diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index 926949e06a..75ac418916 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -83,9 +83,9 @@ namespace Checkpoints }; const CCheckpointData &Checkpoints() { - if (Params().NetworkID() == CChainParams::TESTNET) + if (Params().NetworkID() == CBaseChainParams::TESTNET) return dataTestnet; - else if (Params().NetworkID() == CChainParams::MAIN) + else if (Params().NetworkID() == CBaseChainParams::MAIN) return data; else return dataRegtest; diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 76dddb103c..89305e9f35 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -546,7 +546,7 @@ int main(int argc, char *argv[]) if (!PaymentServer::ipcParseCommandLine(argc, argv)) exit(0); #endif - bool isaTestNet = Params().NetworkID() != CChainParams::MAIN; + bool isaTestNet = Params().NetworkID() != CBaseChainParams::MAIN; // Allow for separate UI settings for testnets if (isaTestNet) QApplication::setApplicationName(QAPP_APP_NAME_TESTNET); diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 49923a1afc..fbb11617fe 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -199,10 +199,10 @@ bool PaymentServer::ipcParseCommandLine(int argc, char* argv[]) { CBitcoinAddress address(r.address.toStdString()); - SelectParams(CChainParams::MAIN); + SelectParams(CBaseChainParams::MAIN); if (!address.IsValid()) { - SelectParams(CChainParams::TESTNET); + SelectParams(CBaseChainParams::TESTNET); } } } @@ -214,9 +214,9 @@ bool PaymentServer::ipcParseCommandLine(int argc, char* argv[]) if (readPaymentRequest(arg, request)) { if (request.getDetails().network() == "main") - SelectParams(CChainParams::MAIN); + SelectParams(CBaseChainParams::MAIN); else - SelectParams(CChainParams::TESTNET); + SelectParams(CBaseChainParams::TESTNET); } } else diff --git a/src/qt/test/paymentservertests.cpp b/src/qt/test/paymentservertests.cpp index 7dee7a9cda..e92a7d2b1a 100644 --- a/src/qt/test/paymentservertests.cpp +++ b/src/qt/test/paymentservertests.cpp @@ -56,6 +56,7 @@ static SendCoinsRecipient handleRequest(PaymentServer* server, std::vectorGetOldestKeyPoolTime())); diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 93da81e429..c5d09cf577 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -600,7 +600,7 @@ void StartRPCThreads() std::vector vEndpoints; bool bBindAny = false; - int defaultPort = GetArg("-rpcport", Params().RPCPort()); + int defaultPort = GetArg("-rpcport", BaseParams().RPCPort()); if (!mapArgs.count("-rpcallowip")) // Default to loopback if not allowing external IPs { vEndpoints.push_back(ip::tcp::endpoint(asio::ip::address_v6::loopback(), defaultPort)); diff --git a/src/test/base58_tests.cpp b/src/test/base58_tests.cpp index b81a19cfd8..0ac3e9a363 100644 --- a/src/test/base58_tests.cpp +++ b/src/test/base58_tests.cpp @@ -142,9 +142,9 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_parse) bool isPrivkey = find_value(metadata, "isPrivkey").get_bool(); bool isTestnet = find_value(metadata, "isTestnet").get_bool(); if (isTestnet) - SelectParams(CChainParams::TESTNET); + SelectParams(CBaseChainParams::TESTNET); else - SelectParams(CChainParams::MAIN); + SelectParams(CBaseChainParams::MAIN); if(isPrivkey) { bool isCompressed = find_value(metadata, "isCompressed").get_bool(); @@ -175,7 +175,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_parse) BOOST_CHECK_MESSAGE(!secret.IsValid(), "IsValid pubkey as privkey:" + strTest); } } - SelectParams(CChainParams::MAIN); + SelectParams(CBaseChainParams::MAIN); } // Goal: check that generated keys match test vectors @@ -198,9 +198,9 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_gen) bool isPrivkey = find_value(metadata, "isPrivkey").get_bool(); bool isTestnet = find_value(metadata, "isTestnet").get_bool(); if (isTestnet) - SelectParams(CChainParams::TESTNET); + SelectParams(CBaseChainParams::TESTNET); else - SelectParams(CChainParams::MAIN); + SelectParams(CBaseChainParams::MAIN); if(isPrivkey) { bool isCompressed = find_value(metadata, "isCompressed").get_bool(); @@ -243,7 +243,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_gen) CTxDestination nodest = CNoDestination(); BOOST_CHECK(!dummyAddr.Set(nodest)); - SelectParams(CChainParams::MAIN); + SelectParams(CBaseChainParams::MAIN); } // Goal: check that base58 parsing code is robust against a variety of corrupted data diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 2d993e24db..8cae0a4c34 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -31,6 +31,7 @@ struct TestingSetup { TestingSetup() { fPrintToDebugLog = false; // don't want to write to debug.log file + SelectParams(CBaseChainParams::MAIN); noui_connect(); #ifdef ENABLE_WALLET bitdb.MakeMock(); diff --git a/src/util.cpp b/src/util.cpp index a19c015da6..7a0e2cc800 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -5,7 +5,7 @@ #include "util.h" -#include "chainparams.h" +#include "chainparamsbase.h" #include "sync.h" #include "ui_interface.h" #include "uint256.h" @@ -918,7 +918,7 @@ boost::filesystem::path GetDefaultDataDir() #endif } -static boost::filesystem::path pathCached[CChainParams::MAX_NETWORK_TYPES+1]; +static boost::filesystem::path pathCached[CBaseChainParams::MAX_NETWORK_TYPES+1]; static CCriticalSection csPathCached; const boost::filesystem::path &GetDataDir(bool fNetSpecific) @@ -927,8 +927,8 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific) LOCK(csPathCached); - int nNet = CChainParams::MAX_NETWORK_TYPES; - if (fNetSpecific) nNet = Params().NetworkID(); + int nNet = CBaseChainParams::MAX_NETWORK_TYPES; + if (fNetSpecific) nNet = BaseParams().NetworkID(); fs::path &path = pathCached[nNet]; @@ -947,7 +947,7 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific) path = GetDefaultDataDir(); } if (fNetSpecific) - path /= Params().DataDir(); + path /= BaseParams().DataDir(); fs::create_directories(path); @@ -956,7 +956,7 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific) void ClearDatadirCache() { - std::fill(&pathCached[0], &pathCached[CChainParams::MAX_NETWORK_TYPES+1], + std::fill(&pathCached[0], &pathCached[CBaseChainParams::MAX_NETWORK_TYPES+1], boost::filesystem::path()); } From 75c82d4923174a126e1b87be6a43f274d2cc4c9b Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 25 Jun 2014 10:03:00 +0200 Subject: [PATCH 0239/1288] Move coins.cpp and keystore.cpp to libbitcoin_common Prepare for introduction of `bitcoin-tx` tool. --- src/Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 2d2ae2a4c1..3643e60201 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -126,9 +126,7 @@ libbitcoin_server_a_SOURCES = \ alert.cpp \ bloom.cpp \ checkpoints.cpp \ - coins.cpp \ init.cpp \ - keystore.cpp \ leveldbwrapper.cpp \ main.cpp \ miner.cpp \ @@ -173,12 +171,14 @@ crypto_libbitcoin_crypto_a_SOURCES = \ # common: shared between bitcoind, and bitcoin-qt and non-server tools libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_common_a_SOURCES = \ - base58.cpp \ allocators.cpp \ + base58.cpp \ chainparams.cpp \ + coins.cpp \ core.cpp \ hash.cpp \ key.cpp \ + keystore.cpp \ netbase.cpp \ protocol.cpp \ script.cpp \ From 8969828d069e4e55108618a493749535edc12ec7 Mon Sep 17 00:00:00 2001 From: gubatron Date: Sat, 7 Jun 2014 02:20:22 -0400 Subject: [PATCH 0240/1288] [Qt] New status bar Unit Display Control and related changes. - New status bar control shows the current Unit of Display. When clicked (left,or right button) it shows a context menu that allows the user to switch the current Unit of Display (BTC, mBTC, uBTC) - Recent Requests and Transaction Table headers are now updated when unit of display is changed, because their "Amount" column now displays the current unit of display. - Takes care of issue #3970 Units in transaction export csv file. - Small refactors for reusability. - Demo Video https://www.youtube.com/watch?v=wwcr0Yh68go&list=UUG3jF2hgofmLWP0tRPisQAQ - changes after Diapolo's feedback. Have not been able to build after last pool, issues with boost on MacOSX, will test on Ubuntu these changes. - removed return statement on switch - renamed onDisplayUnitsChanged(int) to updateDisplayUnit(int) - now getAmountColumnTitle(int unit) takes a simple unit parameter. moved to BitcoinUnits. --- src/qt/bitcoingui.cpp | 78 +++++++++++++++++++++++++++++ src/qt/bitcoingui.h | 37 ++++++++++++++ src/qt/bitcoinunits.cpp | 10 ++++ src/qt/bitcoinunits.h | 2 + src/qt/optionsmodel.cpp | 17 +++++-- src/qt/optionsmodel.h | 2 + src/qt/recentrequeststablemodel.cpp | 27 +++++++++- src/qt/recentrequeststablemodel.h | 6 +++ src/qt/transactiontablemodel.cpp | 11 +++- src/qt/transactiontablemodel.h | 2 + src/qt/transactionview.cpp | 2 +- 11 files changed, 187 insertions(+), 7 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 30f5ec8939..f2fb8c877e 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -28,6 +28,7 @@ #include +#include #include #include #include @@ -39,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -49,6 +51,8 @@ #include #include + + #if QT_VERSION < 0x050000 #include #include @@ -156,10 +160,13 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); + unitDisplayControl = new UnitDisplayStatusBarControl(); labelEncryptionIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); + frameBlocksLayout->addWidget(unitDisplayControl); + frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); @@ -420,6 +427,8 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel) walletFrame->setClientModel(clientModel); } #endif + + this->unitDisplayControl->setOptionsModel(clientModel->getOptionsModel()); } } @@ -1000,3 +1009,72 @@ void BitcoinGUI::unsubscribeFromCoreSignals() // Disconnect signals from client uiInterface.ThreadSafeMessageBox.disconnect(boost::bind(ThreadSafeMessageBox, this, _1, _2, _3)); } + +UnitDisplayStatusBarControl::UnitDisplayStatusBarControl():QLabel() +{ + optionsModel = 0; + createContextMenu(); + setStyleSheet("font:11pt; color: #333333"); + setToolTip(tr("Unit to show amounts in. Click to select another unit.")); +} + +/** So that it responds to left-button clicks */ +void UnitDisplayStatusBarControl::mousePressEvent(QMouseEvent *event) +{ + onDisplayUnitsClicked(event->pos()); +} + +/** Creates context menu, its actions, and wires up all the relevant signals for mouse events. */ +void UnitDisplayStatusBarControl::createContextMenu() +{ + menu = new QMenu(); + foreach(BitcoinUnits::Unit u, BitcoinUnits::availableUnits()) + { + QAction *menuAction = new QAction(QString(BitcoinUnits::name(u)), this); + menuAction->setData(QVariant(u)); + menu->addAction(menuAction); + } + connect(menu,SIGNAL(triggered(QAction*)),this,SLOT(onMenuSelection(QAction*))); + + // what happens on right click. + setContextMenuPolicy(Qt::CustomContextMenu); + connect(this,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(onDisplayUnitsClicked(const QPoint&))); +} + +/** Lets the control know about the Options Model (and its signals) */ +void UnitDisplayStatusBarControl::setOptionsModel(OptionsModel *optionsModel) +{ + if (optionsModel) + { + this->optionsModel = optionsModel; + + // be aware of a display unit change reported by the OptionsModel object. + connect(optionsModel,SIGNAL(displayUnitChanged(int)),this,SLOT(updateDisplayUnit(int))); + + // initialize the display units label with the current value in the model. + updateDisplayUnit(optionsModel->getDisplayUnit()); + } +} + +/** When Display Units are changed on OptionsModel it will refresh the display text of the control on the status bar */ +void UnitDisplayStatusBarControl::updateDisplayUnit(int newUnits) +{ + setText(BitcoinUnits::name(newUnits)); +} + +/** Shows context menu with Display Unit options by the mouse coordinates */ +void UnitDisplayStatusBarControl::onDisplayUnitsClicked(const QPoint& point) +{ + QPoint globalPos = mapToGlobal(point); + menu->exec(globalPos); +} + +/** Tells underlying optionsModel to update its current display unit. */ +void UnitDisplayStatusBarControl::onMenuSelection(QAction* action) +{ + if (action) + { + optionsModel->setDisplayUnit(action->data()); + } +} + diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index e7a842df99..705e629a69 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -9,12 +9,16 @@ #include "config/bitcoin-config.h" #endif +#include #include #include +#include +#include #include class ClientModel; class Notificator; +class OptionsModel; class RPCConsole; class SendCoinsRecipient; class WalletFrame; @@ -22,9 +26,13 @@ class WalletModel; class CWallet; +class UnitDisplayStatusBarControl; + QT_BEGIN_NAMESPACE class QAction; class QLabel; +class QMenu; +class QPoint; class QProgressBar; class QProgressDialog; QT_END_NAMESPACE @@ -69,6 +77,7 @@ private: ClientModel *clientModel; WalletFrame *walletFrame; + UnitDisplayStatusBarControl *unitDisplayControl; QLabel *labelEncryptionIcon; QLabel *labelConnectionsIcon; QLabel *labelBlocksIcon; @@ -198,4 +207,32 @@ private slots: void showProgress(const QString &title, int nProgress); }; +class UnitDisplayStatusBarControl : public QLabel +{ + Q_OBJECT + +public: + explicit UnitDisplayStatusBarControl(); + /** Lets the control know about the Options Model (and its signals) */ + void setOptionsModel(OptionsModel *optionsModel); + +protected: + /** So that it responds to left-button clicks */ + void mousePressEvent(QMouseEvent *event); + +private: + OptionsModel *optionsModel; + QMenu* menu; + /** Shows context menu with Display Unit options by the mouse coordinates */ + void onDisplayUnitsClicked(const QPoint& point); + /** Creates context menu, its actions, and wires up all the relevant signals for mouse events. */ + void createContextMenu(); + +private slots: + /** When Display Units are changed on OptionsModel it will refresh the display text of the control on the status bar */ + void updateDisplayUnit(int newUnits); + /** Tells underlying optionsModel to update its current display unit. */ + void onMenuSelection(QAction* action); +}; + #endif // BITCOINGUI_H diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp index 2fed443cf2..4ba6aba551 100644 --- a/src/qt/bitcoinunits.cpp +++ b/src/qt/bitcoinunits.cpp @@ -169,6 +169,16 @@ bool BitcoinUnits::parse(int unit, const QString &value, qint64 *val_out) return ok; } +QString BitcoinUnits::getAmountColumnTitle(int unit) +{ + QString amountTitle = QObject::tr("Amount"); + if (BitcoinUnits::valid(unit)) + { + amountTitle += " ("+BitcoinUnits::name(unit) + ")"; + } + return amountTitle; +} + int BitcoinUnits::rowCount(const QModelIndex &parent) const { Q_UNUSED(parent); diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h index 46517fc07b..451b52ee21 100644 --- a/src/qt/bitcoinunits.h +++ b/src/qt/bitcoinunits.h @@ -54,6 +54,8 @@ public: static QString formatWithUnit(int unit, qint64 amount, bool plussign=false); //! Parse string to coin amount static bool parse(int unit, const QString &value, qint64 *val_out); + //! Gets title for amount column including current display unit if optionsModel reference available */ + static QString getAmountColumnTitle(int unit); ///@} //! @name AbstractListModel implementation diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 6d985abaf8..09553a2587 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -308,9 +308,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in break; #endif case DisplayUnit: - nDisplayUnit = value.toInt(); - settings.setValue("nDisplayUnit", nDisplayUnit); - emit displayUnitChanged(nDisplayUnit); + setDisplayUnit(value); break; case DisplayAddresses: bDisplayAddresses = value.toBool(); @@ -356,11 +354,24 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in break; } } + emit dataChanged(index, index); return successful; } +/** Updates current unit in memory, settings and emits displayUnitChanged(newUnit) signal */ +void OptionsModel::setDisplayUnit(const QVariant &value) +{ + if (!value.isNull()) + { + QSettings settings; + nDisplayUnit = value.toInt(); + settings.setValue("nDisplayUnit", nDisplayUnit); + emit displayUnitChanged(nDisplayUnit); + } +} + bool OptionsModel::getProxySettings(QNetworkProxy& proxy) const { // Directly query current base proxy, because diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 2596682d07..89c2ec7453 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -52,6 +52,8 @@ public: int rowCount(const QModelIndex & parent = QModelIndex()) const; QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole); + /** Updates current unit in memory, settings and emits displayUnitChanged(newUnit) signal */ + void setDisplayUnit(const QVariant &value); /* Explicit getters */ bool getMinimizeToTray() { return fMinimizeToTray; } diff --git a/src/qt/recentrequeststablemodel.cpp b/src/qt/recentrequeststablemodel.cpp index 844d62518c..b5a998f9f5 100644 --- a/src/qt/recentrequeststablemodel.cpp +++ b/src/qt/recentrequeststablemodel.cpp @@ -21,7 +21,9 @@ RecentRequestsTableModel::RecentRequestsTableModel(CWallet *wallet, WalletModel addNewRequest(request); /* These columns must match the indices in the ColumnIndex enumeration */ - columns << tr("Date") << tr("Label") << tr("Message") << tr("Amount"); + columns << tr("Date") << tr("Label") << tr("Message") << getAmountTitle(); + + connect(walletModel->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); } RecentRequestsTableModel::~RecentRequestsTableModel() @@ -101,6 +103,24 @@ QVariant RecentRequestsTableModel::headerData(int section, Qt::Orientation orien return QVariant(); } +/** Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table headers to react. */ +void RecentRequestsTableModel::updateAmountColumnTitle() +{ + columns[Amount] = getAmountTitle(); + emit headerDataChanged(Qt::Horizontal,Amount,Amount); +} + +/** Gets title for amount column including current display unit if optionsModel reference available. */ +QString RecentRequestsTableModel::getAmountTitle() +{ + QString amountTitle = tr("Amount"); + if (this->walletModel->getOptionsModel() != NULL) + { + amountTitle += " ("+BitcoinUnits::name(this->walletModel->getOptionsModel()->getDisplayUnit()) + ")"; + } + return amountTitle; +} + QModelIndex RecentRequestsTableModel::index(int row, int column, const QModelIndex &parent) const { Q_UNUSED(parent); @@ -185,6 +205,11 @@ void RecentRequestsTableModel::sort(int column, Qt::SortOrder order) emit dataChanged(index(0, 0, QModelIndex()), index(list.size() - 1, NUMBER_OF_COLUMNS - 1, QModelIndex())); } +void RecentRequestsTableModel::updateDisplayUnit() +{ + updateAmountColumnTitle(); +} + bool RecentRequestEntryLessThan::operator()(RecentRequestEntry &left, RecentRequestEntry &right) const { RecentRequestEntry *pLeft = &left; diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h index d4cc5078aa..4f0b241259 100644 --- a/src/qt/recentrequeststablemodel.h +++ b/src/qt/recentrequeststablemodel.h @@ -91,12 +91,18 @@ public: public slots: void sort(int column, Qt::SortOrder order = Qt::AscendingOrder); + void updateDisplayUnit(); private: WalletModel *walletModel; QStringList columns; QList list; int64_t nReceiveRequestsMaxId; + + /** Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table headers to react. */ + void updateAmountColumnTitle(); + /** Gets title for amount column including current display unit if optionsModel reference available. */ + QString getAmountTitle(); }; #endif diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index b9fcd0d6b0..e34238d805 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -235,8 +235,7 @@ TransactionTableModel::TransactionTableModel(CWallet* wallet, WalletModel *paren walletModel(parent), priv(new TransactionTablePriv(wallet, this)) { - columns << QString() << tr("Date") << tr("Type") << tr("Address") << tr("Amount"); - + columns << QString() << tr("Date") << tr("Type") << tr("Address") << BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit()); priv->refreshWallet(); connect(walletModel->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); @@ -247,6 +246,13 @@ TransactionTableModel::~TransactionTableModel() delete priv; } +/** Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table headers to react. */ +void TransactionTableModel::updateAmountColumnTitle() +{ + columns[Amount] = BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit()); + emit headerDataChanged(Qt::Horizontal,Amount,Amount); +} + void TransactionTableModel::updateTransaction(const QString &hash, int status) { uint256 updated; @@ -624,5 +630,6 @@ QModelIndex TransactionTableModel::index(int row, int column, const QModelIndex void TransactionTableModel::updateDisplayUnit() { // emit dataChanged to update Amount column with the current unit + updateAmountColumnTitle(); emit dataChanged(index(0, Amount), index(priv->size()-1, Amount)); } diff --git a/src/qt/transactiontablemodel.h b/src/qt/transactiontablemodel.h index 333e6bc6ed..e8b6ed065d 100644 --- a/src/qt/transactiontablemodel.h +++ b/src/qt/transactiontablemodel.h @@ -87,6 +87,8 @@ public slots: void updateTransaction(const QString &hash, int status); void updateConfirmations(); void updateDisplayUnit(); + /** Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table headers to react. */ + void updateAmountColumnTitle(); friend class TransactionTablePriv; }; diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index d4d29416ca..d6d210a561 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -309,7 +309,7 @@ void TransactionView::exportClicked() writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole); writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole); writer.addColumn(tr("Address"), 0, TransactionTableModel::AddressRole); - writer.addColumn(tr("Amount"), 0, TransactionTableModel::FormattedAmountRole); + writer.addColumn(BitcoinUnits::getAmountColumnTitle(model->getOptionsModel()->getDisplayUnit()), 0, TransactionTableModel::FormattedAmountRole); writer.addColumn(tr("ID"), 0, TransactionTableModel::TxIDRole); if(!writer.write()) { From a90689ff9880cc76668d04beda5a5d97f2f4a76b Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Wed, 25 Jun 2014 14:21:29 -0400 Subject: [PATCH 0241/1288] Remove timing-based signature cache unit test Two changes: First removes a unit test that fails in my development environment (OSX, compiled -g3 with clang). sipa says that's not terribly surprising; the CMutableTransaction change makes signing a little more expensive but verification quicker. The unit test timed sign+verify-uncached versus verify-cached-five-times. He also says the test will be invalid when libsec256kp1 is integrated (because validation is super-optimized over signing). core.h change fixes a compiler warning (clang -Wall : CMutableTransaction defined as struct, declared as class in script.h). --- src/script.h | 2 +- src/test/DoS_tests.cpp | 87 ------------------------------------------ 2 files changed, 1 insertion(+), 88 deletions(-) diff --git a/src/script.h b/src/script.h index ea988f0e40..7ab471f6e6 100644 --- a/src/script.h +++ b/src/script.h @@ -20,7 +20,7 @@ class CCoins; class CKeyStore; class CTransaction; -class CMutableTransaction; +struct CMutableTransaction; static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; // bytes static const unsigned int MAX_OP_RETURN_RELAY = 40; // bytes diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index d512053051..5e17555e7a 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -231,91 +231,4 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans) BOOST_CHECK(mapOrphanTransactionsByPrev.empty()); } -BOOST_AUTO_TEST_CASE(DoS_checkSig) -{ - // Test signature caching code (see key.cpp Verify() methods) - - CKey key; - key.MakeNewKey(true); - CBasicKeyStore keystore; - keystore.AddKey(key); - unsigned int flags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC; - - // 100 orphan transactions: - static const int NPREV=100; - CMutableTransaction orphans[NPREV]; - for (int i = 0; i < NPREV; i++) - { - CMutableTransaction& tx = orphans[i]; - tx.vin.resize(1); - tx.vin[0].prevout.n = 0; - tx.vin[0].prevout.hash = GetRandHash(); - tx.vin[0].scriptSig << OP_1; - tx.vout.resize(1); - tx.vout[0].nValue = 1*CENT; - tx.vout[0].scriptPubKey.SetDestination(key.GetPubKey().GetID()); - - AddOrphanTx(tx); - } - - // Create a transaction that depends on orphans: - CMutableTransaction tx; - tx.vout.resize(1); - tx.vout[0].nValue = 1*CENT; - tx.vout[0].scriptPubKey.SetDestination(key.GetPubKey().GetID()); - tx.vin.resize(NPREV); - for (unsigned int j = 0; j < tx.vin.size(); j++) - { - tx.vin[j].prevout.n = 0; - tx.vin[j].prevout.hash = orphans[j].GetHash(); - } - // Creating signatures primes the cache: - boost::posix_time::ptime mst1 = boost::posix_time::microsec_clock::local_time(); - for (unsigned int j = 0; j < tx.vin.size(); j++) - BOOST_CHECK(SignSignature(keystore, orphans[j], tx, j)); - boost::posix_time::ptime mst2 = boost::posix_time::microsec_clock::local_time(); - boost::posix_time::time_duration msdiff = mst2 - mst1; - long nOneValidate = msdiff.total_milliseconds(); - if (fDebug) printf("DoS_Checksig sign: %ld\n", nOneValidate); - - // ... now validating repeatedly should be quick: - // 2.8GHz machine, -g build: Sign takes ~760ms, - // uncached Verify takes ~250ms, cached Verify takes ~50ms - // (for 100 single-signature inputs) - mst1 = boost::posix_time::microsec_clock::local_time(); - for (unsigned int i = 0; i < 5; i++) - for (unsigned int j = 0; j < tx.vin.size(); j++) - BOOST_CHECK(VerifySignature(CCoins(orphans[j], MEMPOOL_HEIGHT), tx, j, flags, SIGHASH_ALL)); - mst2 = boost::posix_time::microsec_clock::local_time(); - msdiff = mst2 - mst1; - long nManyValidate = msdiff.total_milliseconds(); - if (fDebug) printf("DoS_Checksig five: %ld\n", nManyValidate); - - BOOST_CHECK_MESSAGE(nManyValidate < nOneValidate, "Signature cache timing failed"); - - // Empty a signature, validation should fail: - CScript save = tx.vin[0].scriptSig; - tx.vin[0].scriptSig = CScript(); - BOOST_CHECK(!VerifySignature(CCoins(orphans[0], MEMPOOL_HEIGHT), tx, 0, flags, SIGHASH_ALL)); - tx.vin[0].scriptSig = save; - - // Swap signatures, validation should fail: - std::swap(tx.vin[0].scriptSig, tx.vin[1].scriptSig); - BOOST_CHECK(!VerifySignature(CCoins(orphans[0], MEMPOOL_HEIGHT), tx, 0, flags, SIGHASH_ALL)); - BOOST_CHECK(!VerifySignature(CCoins(orphans[1], MEMPOOL_HEIGHT), tx, 1, flags, SIGHASH_ALL)); - std::swap(tx.vin[0].scriptSig, tx.vin[1].scriptSig); - - // Exercise -maxsigcachesize code: - mapArgs["-maxsigcachesize"] = "10"; - // Generate a new, different signature for vin[0] to trigger cache clear: - CScript oldSig = tx.vin[0].scriptSig; - BOOST_CHECK(SignSignature(keystore, orphans[0], tx, 0)); - BOOST_CHECK(tx.vin[0].scriptSig != oldSig); - for (unsigned int j = 0; j < tx.vin.size(); j++) - BOOST_CHECK(VerifySignature(CCoins(orphans[j], MEMPOOL_HEIGHT), tx, j, flags, SIGHASH_ALL)); - mapArgs.erase("-maxsigcachesize"); - - LimitOrphanTxSize(0); -} - BOOST_AUTO_TEST_SUITE_END() From e10dcf27b4fb324a85b5650c7acd2ea5a52e822f Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 24 Jun 2014 14:17:43 +0200 Subject: [PATCH 0242/1288] ensure clean and consistent "namespace" usage - remove some missplaced ; - ensure end of a namespace is clearly visible - use same formatting when using namespace --- src/base58.cpp | 4 +++- src/checkpoints.cpp | 7 ++++--- src/checkpoints.h | 7 ++++--- src/init.h | 2 +- src/key.cpp | 3 +-- src/main.cpp | 11 +++++++---- src/net.h | 3 +-- src/script.cpp | 5 +++-- src/util.cpp | 3 ++- 9 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/base58.cpp b/src/base58.cpp index 1bd64684e5..c9e91beef1 100644 --- a/src/base58.cpp +++ b/src/base58.cpp @@ -186,6 +186,7 @@ int CBase58Data::CompareTo(const CBase58Data& b58) const { } namespace { + class CBitcoinAddressVisitor : public boost::static_visitor { private: CBitcoinAddress *addr; @@ -196,7 +197,8 @@ namespace { bool operator()(const CScriptID &id) const { return addr->Set(id); } bool operator()(const CNoDestination &no) const { return false; } }; -}; + +} // anon namespace bool CBitcoinAddress::Set(const CKeyID &id) { SetData(Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS), &id, 20); diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index 75ac418916..80479b47fb 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -12,8 +12,8 @@ #include // for 'map_list_of()' #include -namespace Checkpoints -{ +namespace Checkpoints { + typedef std::map MapCheckpoints; // How many times we expect transactions after the last checkpoint to @@ -161,4 +161,5 @@ namespace Checkpoints } return NULL; } -} + +} // namespace Checkpoints diff --git a/src/checkpoints.h b/src/checkpoints.h index 1b4aacee20..2cf8d41b9d 100644 --- a/src/checkpoints.h +++ b/src/checkpoints.h @@ -13,8 +13,8 @@ class uint256; /** Block-chain checkpoints are compiled-in sanity checks. * They are updated every release or three. */ -namespace Checkpoints -{ +namespace Checkpoints { + // Returns true if block passes checkpoint checks bool CheckBlock(int nHeight, const uint256& hash); @@ -27,6 +27,7 @@ namespace Checkpoints double GuessVerificationProgress(CBlockIndex *pindex, bool fSigchecks = true); extern bool fEnabled; -} + +} //namespace Checkpoints #endif diff --git a/src/init.h b/src/init.h index 52daa47616..626525c9ad 100644 --- a/src/init.h +++ b/src/init.h @@ -12,7 +12,7 @@ class CWallet; namespace boost { class thread_group; -}; +} // namespace boost extern CWallet* pwalletMain; diff --git a/src/key.cpp b/src/key.cpp index 96b1ac439c..784085da34 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -377,8 +377,7 @@ const unsigned char vchMaxModHalfOrder[32] = { const unsigned char vchZero[0] = {}; - -}; // end of anonymous namespace +} // anon namespace bool CKey::Check(const unsigned char *vch) { return CompareBigEndian(vch, 32, vchZero, 0) > 0 && diff --git a/src/main.cpp b/src/main.cpp index ea47601081..9832259964 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -72,6 +72,7 @@ const string strMessageMagic = "Bitcoin Signed Message:\n"; // Internal stuff namespace { + struct CBlockIndexWorkComparator { bool operator()(CBlockIndex *pa, CBlockIndex *pb) { @@ -120,7 +121,8 @@ namespace { }; map::iterator> > mapBlocksInFlight; map::iterator> > mapBlocksToDownload; -} + +} // anon namespace ////////////////////////////////////////////////////////////////////////////// // @@ -130,6 +132,7 @@ namespace { // These functions dispatch to one or all registered wallets namespace { + struct CMainSignals { // Notifies listeners of updated transaction data (transaction, and optionally the block it is found in. boost::signals2::signal SyncTransaction; @@ -144,7 +147,8 @@ struct CMainSignals { // Tells listeners to broadcast their data. boost::signals2::signal Broadcast; } g_signals; -} + +} // anon namespace void RegisterWallet(CWalletInterface* pwalletIn) { g_signals.SyncTransaction.connect(boost::bind(&CWalletInterface::SyncTransaction, pwalletIn, _1, _2)); @@ -274,7 +278,6 @@ void MarkBlockAsReceived(const uint256 &hash, NodeId nodeFrom = -1) { state->nLastBlockReceive = GetTimeMicros(); mapBlocksInFlight.erase(itInFlight); } - } // Requires cs_main. @@ -310,7 +313,7 @@ void MarkBlockAsInFlight(NodeId nodeid, const uint256 &hash) { mapBlocksInFlight[hash] = std::make_pair(nodeid, it); } -} +} // anon namespace bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats) { LOCK(cs_main); diff --git a/src/net.h b/src/net.h index 41dc618571..2ee798d468 100644 --- a/src/net.h +++ b/src/net.h @@ -28,14 +28,13 @@ #include #include - class CAddrMan; class CBlockIndex; class CNode; namespace boost { class thread_group; -} +} // namespace boost /** Time between pings automatically sent out for latency probing and keepalive (in seconds). */ static const int PING_INTERVAL = 2 * 60; diff --git a/src/script.cpp b/src/script.cpp index c83d26885a..dfba4da46e 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -974,6 +974,7 @@ bool EvalScript(vector >& stack, const CScript& script, co namespace { + /** Wrapper that serializes like CTransaction, but with the modifications * required for the signature hash done in-place */ @@ -1066,7 +1067,8 @@ public: ::Serialize(s, txTo.nLockTime, nType, nVersion); } }; -} + +} // anon namespace uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType) { @@ -1092,7 +1094,6 @@ uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsig return ss.GetHash(); } - // Valid signature cache, to avoid doing expensive ECDSA signature checking // twice for every transaction (once when accepted into memory pool, and // again when accepted into the block chain) diff --git a/src/util.cpp b/src/util.cpp index 7a0e2cc800..7efcc577cf 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -77,11 +77,12 @@ // See also: http://stackoverflow.com/questions/10020179/compilation-fail-in-boost-librairies-program-options // http://clang.debian.net/status.php?version=3.0&key=CANNOT_FIND_FUNCTION namespace boost { + namespace program_options { std::string to_internal(const std::string&); } -} +} // namespace boost using namespace std; From 9e9ca2b6710a0a0e600b9412b54d22b6b1f706b2 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 24 Jun 2014 09:03:18 +0200 Subject: [PATCH 0243/1288] small cleanup of #ifdefs in BindListenPort() - SO_NOSIGPIPE isn't available on WIN32 so merge the 2 non-WIN32 blocks - use predefined names from header for IPV6_PROTECTION_LEVEL and PROTECTION_LEVEL_UNRESTRICTED --- src/net.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 811df43334..8f47489c8b 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -36,6 +36,17 @@ #define MSG_NOSIGNAL 0 #endif +// Fix for ancient MinGW versions, that don't have defined these in ws2tcpip.h. +// Todo: Can be removed when our pull-tester is upgraded to a modern MinGW version. +#ifdef WIN32 +#ifndef PROTECTION_LEVEL_UNRESTRICTED +#define PROTECTION_LEVEL_UNRESTRICTED 10 +#endif +#ifndef IPV6_PROTECTION_LEVEL +#define IPV6_PROTECTION_LEVEL 23 +#endif +#endif + using namespace std; using namespace boost; @@ -1587,18 +1598,16 @@ bool BindListenPort(const CService &addrBind, string& strError) return false; } +#ifndef WIN32 #ifdef SO_NOSIGPIPE // Different way of disabling SIGPIPE on BSD setsockopt(hListenSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&nOne, sizeof(int)); #endif - -#ifndef WIN32 // Allow binding if the port is still in TIME_WAIT state after - // the program was closed and restarted. Not an issue on windows. + // the program was closed and restarted. Not an issue on windows! setsockopt(hListenSocket, SOL_SOCKET, SO_REUSEADDR, (void*)&nOne, sizeof(int)); #endif - #ifdef WIN32 // Set to non-blocking, incoming connections will also inherit this if (ioctlsocket(hListenSocket, FIONBIO, (u_long*)&nOne) == SOCKET_ERROR) @@ -1622,10 +1631,8 @@ bool BindListenPort(const CService &addrBind, string& strError) #endif #endif #ifdef WIN32 - int nProtLevel = 10 /* PROTECTION_LEVEL_UNRESTRICTED */; - int nParameterId = 23 /* IPV6_PROTECTION_LEVEl */; - // this call is allowed to fail - setsockopt(hListenSocket, IPPROTO_IPV6, nParameterId, (const char*)&nProtLevel, sizeof(int)); + int nProtLevel = PROTECTION_LEVEL_UNRESTRICTED; + setsockopt(hListenSocket, IPPROTO_IPV6, IPV6_PROTECTION_LEVEL, (const char*)&nProtLevel, sizeof(int)); #endif } From 5d59921237ecb5a301ac37e0b97eb9c371a43d11 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 24 Jun 2014 09:09:45 +0200 Subject: [PATCH 0244/1288] add missing BOOST_FOREACH indentation in ThreadSocketHandler() --- src/net.cpp | 81 +++++++++++++++++++++++++++-------------------------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 8f47489c8b..934c45ca4c 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -827,7 +827,6 @@ void ThreadSocketHandler() uiInterface.NotifyNumConnectionsChanged(nPrevNodeCount); } - // // Find which sockets have data to receive // @@ -849,6 +848,7 @@ void ThreadSocketHandler() hSocketMax = max(hSocketMax, hListenSocket); have_fds = true; } + { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) @@ -909,58 +909,59 @@ void ThreadSocketHandler() MilliSleep(timeout.tv_usec/1000); } - // // Accept new connections // BOOST_FOREACH(SOCKET hListenSocket, vhListenSocket) - if (hListenSocket != INVALID_SOCKET && FD_ISSET(hListenSocket, &fdsetRecv)) { - struct sockaddr_storage sockaddr; - socklen_t len = sizeof(sockaddr); - SOCKET hSocket = accept(hListenSocket, (struct sockaddr*)&sockaddr, &len); - CAddress addr; - int nInbound = 0; + if (hListenSocket != INVALID_SOCKET && FD_ISSET(hListenSocket, &fdsetRecv)) + { + struct sockaddr_storage sockaddr; + socklen_t len = sizeof(sockaddr); + SOCKET hSocket = accept(hListenSocket, (struct sockaddr*)&sockaddr, &len); + CAddress addr; + int nInbound = 0; - if (hSocket != INVALID_SOCKET) - if (!addr.SetSockAddr((const struct sockaddr*)&sockaddr)) - LogPrintf("Warning: Unknown socket family\n"); + if (hSocket != INVALID_SOCKET) + if (!addr.SetSockAddr((const struct sockaddr*)&sockaddr)) + LogPrintf("Warning: Unknown socket family\n"); - { - LOCK(cs_vNodes); - BOOST_FOREACH(CNode* pnode, vNodes) - if (pnode->fInbound) - nInbound++; - } - - if (hSocket == INVALID_SOCKET) - { - int nErr = WSAGetLastError(); - if (nErr != WSAEWOULDBLOCK) - LogPrintf("socket error accept failed: %s\n", NetworkErrorString(nErr)); - } - else if (nInbound >= nMaxConnections - MAX_OUTBOUND_CONNECTIONS) - { - closesocket(hSocket); - } - else if (CNode::IsBanned(addr)) - { - LogPrintf("connection from %s dropped (banned)\n", addr.ToString()); - closesocket(hSocket); - } - else - { - LogPrint("net", "accepted connection %s\n", addr.ToString()); - CNode* pnode = new CNode(hSocket, addr, "", true); - pnode->AddRef(); { LOCK(cs_vNodes); - vNodes.push_back(pnode); + BOOST_FOREACH(CNode* pnode, vNodes) + if (pnode->fInbound) + nInbound++; + } + + if (hSocket == INVALID_SOCKET) + { + int nErr = WSAGetLastError(); + if (nErr != WSAEWOULDBLOCK) + LogPrintf("socket error accept failed: %s\n", NetworkErrorString(nErr)); + } + else if (nInbound >= nMaxConnections - MAX_OUTBOUND_CONNECTIONS) + { + closesocket(hSocket); + } + else if (CNode::IsBanned(addr)) + { + LogPrintf("connection from %s dropped (banned)\n", addr.ToString()); + closesocket(hSocket); + } + else + { + LogPrint("net", "accepted connection %s\n", addr.ToString()); + CNode* pnode = new CNode(hSocket, addr, "", true); + pnode->AddRef(); + + { + LOCK(cs_vNodes); + vNodes.push_back(pnode); + } } } } - // // Service each socket // From cf04d83624e2ca66d094b6026e48bdf86693d7de Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 24 Jun 2014 14:41:26 +0200 Subject: [PATCH 0245/1288] add OpenSSL RAND_cleanup() on OpenSSL shutdown - to securely erase the memory used by the PNRG - also rework 2 comments in OpenSSL init --- src/util.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 7a0e2cc800..5c1ed23b73 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -121,15 +121,17 @@ public: CRYPTO_set_locking_callback(locking_callback); #ifdef WIN32 - // Seed random number generator with screen scrape and other hardware sources + // Seed OpenSSL PRNG with current contents of the screen RAND_screen(); #endif - // Seed random number generator with performance counter + // Seed OpenSSL PRNG with performance counter RandAddSeed(); } ~CInit() { + // Securely erase the memory used by the PRNG + RAND_cleanup(); // Shutdown OpenSSL library multithreading support CRYPTO_set_locking_callback(NULL); for (int i = 0; i < CRYPTO_num_locks(); i++) From 86fe1b864b109869659f140af07047163637a673 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 26 Jun 2014 11:49:51 +0200 Subject: [PATCH 0246/1288] update coding.md to reflect changes by pull - also mention alphabetical include ordering --- doc/coding.md | 73 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 26 deletions(-) diff --git a/doc/coding.md b/doc/coding.md index 69388c9ce2..2f332e92f0 100644 --- a/doc/coding.md +++ b/doc/coding.md @@ -4,44 +4,65 @@ Coding Please be consistent with the existing coding style. Block style: +```c++ + bool Function(char* psz, int n) + { + // Comment summarising what this section of code does + for (int i = 0; i < n; i++) + { + // When something fails, return early + if (!Something()) + return false; + ... + } - bool Function(char* psz, int n) - { - // Comment summarising what this section of code does - for (int i = 0; i < n; i++) - { - // When something fails, return early - if (!Something()) - return false; - ... - } - - // Success return is usually at the end - return true; - } - + // Success return is usually at the end + return true; + } +``` - ANSI/Allman block style - 4 space indenting, no tabs - No extra spaces inside parenthesis; please don't do ( this ) - No space after function names, one space after if, for and while +- Includes need to be ordered alphabetically, separate own and foreign headers with a new-line (example key.cpp): +```c++ +#include "key.h" +#include "crypto/sha2.h" +#include "util.h" + +#include +``` +- Class or struct keywords in header files need to be ordered alphabetically: +```c++ +class CAlpha; +class CBeta; +``` +- When using namespace keyword use the following form: +```c++ +namespace Foo { + +... + +} // Foo +``` Variable names begin with the type in lowercase, like nSomeVariable. Please don't put the first word of the variable name in lowercase like someVariable. Common types: - n integer number: short, unsigned short, int, unsigned int, int64, uint64, sometimes char if used as a number - d double, float - f flag - hash uint256 - p pointer or array, one p for each level of indirection - psz pointer to null terminated string - str string object - v vector or similar list objects - map map or multimap - set set or multiset - bn CBigNum + n integer number: short, unsigned short, int, unsigned int, int64, uint64, sometimes char if used as a number + d double, float + f flag + hash uint256 + p pointer or array, one p for each level of indirection + psz pointer to null terminated string + str string object + v vector or similar list objects + map map or multimap + set set or multiset + bn CBigNum Doxygen comments ----------------- From 2a72d4591f5adf25fcb4d0433b390ba6c37f57a9 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Wed, 11 Jul 2012 18:52:41 +0000 Subject: [PATCH 0247/1288] JSON-RPC method: prioritisetransaction Accepts the transaction into mined blocks at a higher (or lower) priority --- src/main.cpp | 10 ++++++++++ src/miner.cpp | 14 +++++++++++--- src/rpcclient.cpp | 2 ++ src/rpcmining.cpp | 14 ++++++++++++++ src/rpcserver.cpp | 1 + src/rpcserver.h | 1 + src/txmempool.cpp | 29 +++++++++++++++++++++++++++++ src/txmempool.h | 6 ++++++ 8 files changed, 74 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ea47601081..e06c519ee2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -789,6 +789,16 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state) int64_t GetMinFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree, enum GetMinFee_mode mode) { + { + LOCK(mempool.cs); + uint256 hash = tx.GetHash(); + double dPriorityDelta = 0; + int64_t nFeeDelta = 0; + mempool.ApplyDeltas(hash, dPriorityDelta, nFeeDelta); + if (dPriorityDelta > 0 || nFeeDelta > 0) + return 0; + } + // Base fee is either minTxFee or minRelayTxFee CFeeRate baseFeeRate = (mode == GMF_RELAY) ? tx.minRelayTxFee : tx.minTxFee; diff --git a/src/miner.cpp b/src/miner.cpp index 19b4694357..69e53756e0 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -3,6 +3,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include + #include "miner.h" #include "core.h" @@ -186,6 +188,9 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION); dPriority = tx.ComputePriority(dPriority, nTxSize); + uint256 hash = tx.GetHash(); + mempool.ApplyDeltas(hash, dPriority, nTotalIn); + CFeeRate feeRate(nTotalIn-tx.GetValueOut(), nTxSize); if (porphan) @@ -227,10 +232,14 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) continue; // Skip free transactions if we're past the minimum block size: - if (fSortedByFee && (feeRate < CTransaction::minRelayTxFee) && (nBlockSize + nTxSize >= nBlockMinSize)) + const uint256& hash = tx.GetHash(); + double dPriorityDelta = 0; + int64_t nFeeDelta = 0; + mempool.ApplyDeltas(hash, dPriorityDelta, nFeeDelta); + if (fSortedByFee && (dPriorityDelta <= 0) && (nFeeDelta <= 0) && (feeRate < CTransaction::minRelayTxFee) && (nBlockSize + nTxSize >= nBlockMinSize)) continue; - // Prioritize by fee once past the priority size or we run out of high-priority + // Prioritise by fee once past the priority size or we run out of high-priority // transactions: if (!fSortedByFee && ((nBlockSize + nTxSize >= nBlockPrioritySize) || !AllowFree(dPriority))) @@ -257,7 +266,6 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) continue; CTxUndo txundo; - const uint256& hash = tx.GetHash(); UpdateCoins(tx, state, view, txundo, pindexPrev->nHeight+1); // Added diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index 3a06e33016..30881b9b1a 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -72,6 +72,8 @@ Array RPCConvertValues(const std::string &strMethod, const std::vector 2) ConvertTo(params[2]); if (strMethod == "listaccounts" && n > 0) ConvertTo(params[0]); if (strMethod == "walletpassphrase" && n > 1) ConvertTo(params[1]); + if (strMethod == "prioritisetransaction" && n > 1) ConvertTo(params[1]); + if (strMethod == "prioritisetransaction" && n > 2) ConvertTo(params[2]); if (strMethod == "getblocktemplate" && n > 0) ConvertTo(params[0]); if (strMethod == "listsinceblock" && n > 1) ConvertTo(params[1]); if (strMethod == "sendmany" && n > 1) ConvertTo(params[1]); diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 0072557f87..98caf704ee 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -247,6 +247,20 @@ Value getmininginfo(const Array& params, bool fHelp) } +Value prioritisetransaction(const Array& params, bool fHelp) +{ + if (fHelp || params.size() != 3) + throw runtime_error( + "prioritisetransaction \n" + "Accepts the transaction into mined blocks at a higher (or lower) priority"); + + uint256 hash; + hash.SetHex(params[0].get_str()); + mempool.PrioritiseTransaction(hash, params[0].get_str(), params[1].get_real(), params[2].get_int64()); + return true; +} + + Value getblocktemplate(const Array& params, bool fHelp) { if (fHelp || params.size() > 1) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index c5d09cf577..6552de8c49 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -254,6 +254,7 @@ static const CRPCCommand vRPCCommands[] = { "getblocktemplate", &getblocktemplate, true, false, false }, { "getmininginfo", &getmininginfo, true, false, false }, { "getnetworkhashps", &getnetworkhashps, true, false, false }, + { "prioritisetransaction", &prioritisetransaction, true, false, false }, { "submitblock", &submitblock, false, true, false }, /* Raw transactions */ diff --git a/src/rpcserver.h b/src/rpcserver.h index 5271542385..1966a65b50 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -130,6 +130,7 @@ extern json_spirit::Value setgenerate(const json_spirit::Array& params, bool fHe extern json_spirit::Value getnetworkhashps(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value gethashespersec(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getmininginfo(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value prioritisetransaction(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getblocktemplate(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value submitblock(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value estimatefee(const json_spirit::Array& params, bool fHelp); diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 4bf01d4848..52f82ef040 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -447,6 +447,7 @@ void CTxMemPool::removeForBlock(const std::vector& vtx, unsigned i std::list dummy; remove(tx, dummy, false); removeConflicts(tx, conflicts); + ClearPrioritisation(tx.GetHash()); } } @@ -564,6 +565,34 @@ CTxMemPool::ReadFeeEstimates(CAutoFile& filein) return true; } +void CTxMemPool::PrioritiseTransaction(const uint256 hash, const string strHash, double dPriorityDelta, int64_t nFeeDelta) +{ + { + LOCK(cs); + std::pair &deltas = mapDeltas[hash]; + deltas.first += dPriorityDelta; + deltas.second += nFeeDelta; + } + LogPrintf("PrioritiseTransaction: %s priority += %f, fee += %d\n", strHash.c_str(), dPriorityDelta, nFeeDelta); +} + +void CTxMemPool::ApplyDeltas(const uint256 hash, double &dPriorityDelta, int64_t &nFeeDelta) +{ + LOCK(cs); + std::map >::iterator pos = mapDeltas.find(hash); + if (pos == mapDeltas.end()) + return; + const std::pair &deltas = pos->second; + dPriorityDelta += deltas.first; + nFeeDelta += deltas.second; +} + +void CTxMemPool::ClearPrioritisation(const uint256 hash) +{ + LOCK(cs); + mapDeltas.erase(hash); +} + CCoinsViewMemPool::CCoinsViewMemPool(CCoinsView &baseIn, CTxMemPool &mempoolIn) : CCoinsViewBacked(baseIn), mempool(mempoolIn) { } diff --git a/src/txmempool.h b/src/txmempool.h index b2915aa842..f7dbb126a0 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -71,6 +71,7 @@ public: mutable CCriticalSection cs; std::map mapTx; std::map mapNextTx; + std::map > mapDeltas; CTxMemPool(); ~CTxMemPool(); @@ -95,6 +96,11 @@ public: unsigned int GetTransactionsUpdated() const; void AddTransactionsUpdated(unsigned int n); + /** Affect CreateNewBlock prioritisation of transactions */ + void PrioritiseTransaction(const uint256 hash, const std::string strHash, double dPriorityDelta, int64_t nFeeDelta); + void ApplyDeltas(const uint256 hash, double &dPriorityDelta, int64_t &nFeeDelta); + void ClearPrioritisation(const uint256 hash); + unsigned long size() { LOCK(cs); From 8ae973c00cfb02161bb2c2a6c839e510cd409278 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 24 Jun 2014 15:27:37 +0200 Subject: [PATCH 0248/1288] Allocate more space if necessary in RandSeedAddPerfMon Currently we use a fixed buffer of 250000 bytes to request HKEY_PERFORMANCE_DATA. In many cases this is not enough, causing the entropy collection to be skipped. Use a loop that grows the buffer as specified in the RegQueryValueEx documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724911%28v=vs.85%29.aspx (as the size of the performance data can differ for every call, the normal solution of requesting the size then allocating that can't work) --- src/util.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 7946089571..a96963689a 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -169,8 +169,17 @@ void RandAddSeedPerfmon() // Don't need this on Linux, OpenSSL automatically uses /dev/urandom // Seed with the entire set of perfmon data std::vector vData(250000,0); - unsigned long nSize = vData.size(); - long ret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, begin_ptr(vData), &nSize); + long ret = 0; + unsigned long nSize = 0; + const size_t nMaxSize = 10000000; // Bail out at more than 10MB of performance data + while (true) + { + nSize = vData.size(); + ret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, begin_ptr(vData), &nSize); + if (ret != ERROR_MORE_DATA || vData.size() >= nMaxSize) + break; + vData.resize(std::max((vData.size()*3)/2, nMaxSize)); // Grow size of buffer exponentially + } RegCloseKey(HKEY_PERFORMANCE_DATA); if (ret == ERROR_SUCCESS) { From e44fea55ea73f46bc9460597c7001e77acb58db7 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Fri, 21 Feb 2014 04:06:12 +0000 Subject: [PATCH 0249/1288] Add an option to allow users to disable relaying/mining data carrier transactions --- src/init.cpp | 2 ++ src/script.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index a03629d07a..c7170b0f2d 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -309,6 +309,8 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -shrinkdebugfile " + _("Shrink debug.log file on client startup (default: 1 when no -debug)") + "\n"; strUsage += " -testnet " + _("Use the test network") + "\n"; + strUsage += "\n" + _("Node relay options:") + "\n"; + strUsage += " -datacarrier " + _("Relay and mine data carrier transactions (default: 1)") + "\n"; strUsage += "\n" + _("Block creation options:") + "\n"; strUsage += " -blockminsize= " + _("Set minimum block size in bytes (default: 0)") + "\n"; strUsage += " -blockmaxsize= " + strprintf(_("Set maximum block size in bytes (default: %d)"), DEFAULT_BLOCK_MAX_SIZE) + "\n"; diff --git a/src/script.cpp b/src/script.cpp index c83d26885a..bc4705abe7 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1208,7 +1208,8 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector Date: Thu, 26 Jun 2014 15:51:07 +0100 Subject: [PATCH 0250/1288] Simplify build instructions --- doc/build-unix.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/doc/build-unix.md b/doc/build-unix.md index 1d75c206e5..9d4b662d07 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -61,10 +61,8 @@ Dependency Build Instructions: Ubuntu & Debian ---------------------------------------------- Build requirements: - sudo apt-get install build-essential - sudo apt-get install libtool autotools-dev autoconf - sudo apt-get install libssl-dev - + sudo apt-get install build-essential libtool autotools-dev autoconf pkg-config libssl-dev + for Ubuntu 12.04 and later: sudo apt-get install libboost-all-dev @@ -95,8 +93,7 @@ To enable the change run for other Ubuntu & Debian: - sudo apt-get install libdb4.8-dev - sudo apt-get install libdb4.8++-dev + sudo apt-get install libdb4.8-dev libdb4.8++-dev Optional: From caf6150e9785da408f1e603ae70eae25b5202d98 Mon Sep 17 00:00:00 2001 From: Huang Le <4tarhl@gmail.com> Date: Fri, 27 Jun 2014 02:55:39 +0800 Subject: [PATCH 0251/1288] Use async name resolving to improve net thread responsiveness In the LookupIntern(), things changed are: 1. Call getaddrinfo_a() instead of getaddrinfo() if available, the former is a sync version of the latter; 2. Try using inet_pton()/inet_addr() to convert the input text to a network addr structure at first, if success the extra name resolving thread inside getaddrinfo_a() could be avoided; 3. An interruption point added in the waiting loop for return from getaddrinfo_a(), which completes the improve for thread responsiveness. A easy way to see the effect is to kick off a 'bitcoind stop' immediately after 'bitcoind -daemon', before the change it would take several, or even tens of, minutes on a bad network situation to wait for the running bitcoind to exit, now it costs only seconds. Signed-off-by: Huang Le <4tarhl@gmail.com> --- configure.ac | 2 ++ src/netbase.cpp | 60 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 811ef1dd80..3abf94f136 100644 --- a/configure.ac +++ b/configure.ac @@ -369,6 +369,8 @@ if test x$TARGET_OS = xdarwin; then fi AC_CHECK_HEADERS([endian.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h]) +AC_SEARCH_LIBS([getaddrinfo_a], [anl], [AC_DEFINE(HAVE_GETADDRINFO_A, 1, [Define this symbol if you have getaddrinfo_a])]) +AC_SEARCH_LIBS([inet_pton], [nsl resolv], [AC_DEFINE(HAVE_INET_PTON, 1, [Define this symbol if you have inet_pton])]) AC_CHECK_DECLS([le32toh, le64toh, htole32, htole64, be32toh, be64toh, htobe32, htobe64],,, [#if HAVE_ENDIAN_H diff --git a/src/netbase.cpp b/src/netbase.cpp index 3c50174e75..f47b0f3563 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -3,6 +3,18 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#ifdef HAVE_CONFIG_H +#include "bitcoin-config.h" +#endif + +#ifdef HAVE_INET_PTON +#include +#endif + +#ifdef HAVE_GETADDRINFO_A +#include +#endif + #include "netbase.h" #include "hash.h" @@ -71,9 +83,30 @@ bool static LookupIntern(const char *pszName, std::vector& vIP, unsign } } +#ifdef HAVE_GETADDRINFO_A + struct in_addr ipv4_addr; +#ifdef HAVE_INET_PTON + if (inet_pton(AF_INET, pszName, &ipv4_addr) > 0) { + vIP.push_back(CNetAddr(ipv4_addr)); + return true; + } + + struct in6_addr ipv6_addr; + if (inet_pton(AF_INET6, pszName, &ipv6_addr) > 0) { + vIP.push_back(CNetAddr(ipv6_addr)); + return true; + } +#else + ipv4_addr.s_addr = inet_addr(pszName); + if (ipv4_addr.s_addr != INADDR_NONE) { + vIP.push_back(CNetAddr(ipv4_addr)); + return true; + } +#endif +#endif + struct addrinfo aiHint; memset(&aiHint, 0, sizeof(struct addrinfo)); - aiHint.ai_socktype = SOCK_STREAM; aiHint.ai_protocol = IPPROTO_TCP; aiHint.ai_family = AF_UNSPEC; @@ -82,8 +115,33 @@ bool static LookupIntern(const char *pszName, std::vector& vIP, unsign #else aiHint.ai_flags = fAllowLookup ? AI_ADDRCONFIG : AI_NUMERICHOST; #endif + struct addrinfo *aiRes = NULL; +#ifdef HAVE_GETADDRINFO_A + struct gaicb gcb, *query = &gcb; + memset(query, 0, sizeof(struct gaicb)); + gcb.ar_name = pszName; + gcb.ar_request = &aiHint; + int nErr = getaddrinfo_a(GAI_NOWAIT, &query, 1, NULL); + if (nErr) + return false; + + do { + // Should set the timeout limit to a resonable value to avoid + // generating unnecessary checking call during the polling loop, + // while it can still response to stop request quick enough. + // 2 seconds looks fine in our situation. + struct timespec ts = { 2, 0 }; + gai_suspend(&query, 1, &ts); + boost::this_thread::interruption_point(); + + nErr = gai_error(query); + if (0 == nErr) + aiRes = query->ar_result; + } while (nErr == EAI_INPROGRESS); +#else int nErr = getaddrinfo(pszName, NULL, &aiHint, &aiRes); +#endif if (nErr) return false; From c598f2acdb281823f39c17f3dbfb079e17cb14a1 Mon Sep 17 00:00:00 2001 From: Whit J Date: Thu, 26 Jun 2014 18:31:40 -0700 Subject: [PATCH 0252/1288] Fixed captitalization in bitcoin-cli-res.rc --- src/bitcoin-cli-res.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bitcoin-cli-res.rc b/src/bitcoin-cli-res.rc index f8bfb3a881..a4a0c47ea5 100644 --- a/src/bitcoin-cli-res.rc +++ b/src/bitcoin-cli-res.rc @@ -5,7 +5,7 @@ #define VER_PRODUCTVERSION_STR STRINGIZE(CLIENT_VERSION_MAJOR) "." STRINGIZE(CLIENT_VERSION_MINOR) "." STRINGIZE(CLIENT_VERSION_REVISION) "." STRINGIZE(CLIENT_VERSION_BUILD) #define VER_FILEVERSION VER_PRODUCTVERSION #define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR -#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core developers" +#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers" VS_VERSION_INFO VERSIONINFO FILEVERSION VER_FILEVERSION From e35b37b1b8252c3d3f66001ba1efccd263307add Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Thu, 26 Jun 2014 22:12:36 -0400 Subject: [PATCH 0253/1288] RPC client: Simplify command line string-to-JSON-value conversion code By default, all command line parameters are converted into JSON string values. There is no need to manually specify the incoming type. A binary decision "parse as string or JSON?" is all that's necessary. Convert to a simple class, initialized at runtime startup, which offers a quick lookup to answer "parse as JSON?" conversion question. Future parameter conversions need only to indicate the method name and zero-based index of the parameter needing JSON parsing. --- src/rpcclient.cpp | 179 ++++++++++++++++++++++++++-------------------- 1 file changed, 102 insertions(+), 77 deletions(-) diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index 30881b9b1a..501940a730 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -3,6 +3,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include #include "rpcclient.h" #include "rpcprotocol.h" @@ -15,94 +16,118 @@ using namespace std; using namespace json_spirit; -template -void ConvertTo(Value& value, bool fAllowNull=false) +class CRPCConvertParam { - if (fAllowNull && value.type() == null_type) - return; - if (value.type() == str_type) - { - // reinterpret string as unquoted json value - Value value2; - string strJSON = value.get_str(); - if (!read_string(strJSON, value2)) - throw runtime_error(string("Error parsing JSON:")+strJSON); - ConvertTo(value2, fAllowNull); - value = value2; +public: + std::string methodName; // method whose params want conversion + int paramIdx; // 0-based idx of param to convert +}; + +static const CRPCConvertParam vRPCConvertParams[] = +{ + { "stop", 0 }, + { "getaddednodeinfo", 0 }, + { "setgenerate", 0 }, + { "setgenerate", 1 }, + { "getnetworkhashps", 0 }, + { "getnetworkhashps", 1 }, + { "sendtoaddress", 1 }, + { "settxfee", 0 }, + { "getreceivedbyaddress", 1 }, + { "getreceivedbyaccount", 1 }, + { "listreceivedbyaddress", 0 }, + { "listreceivedbyaddress", 1 }, + { "listreceivedbyaccount", 0 }, + { "listreceivedbyaccount", 1 }, + { "getbalance", 1 }, + { "getblockhash", 0 }, + { "move", 2 }, + { "move", 3 }, + { "sendfrom", 2 }, + { "sendfrom", 3 }, + { "listtransactions", 1 }, + { "listtransactions", 2 }, + { "listaccounts", 0 }, + { "walletpassphrase", 1 }, + { "getblocktemplate", 0 }, + { "listsinceblock", 1 }, + { "sendmany", 1 }, + { "sendmany", 2 }, + { "addmultisigaddress", 0 }, + { "addmultisigaddress", 1 }, + { "createmultisig", 0 }, + { "createmultisig", 1 }, + { "listunspent", 0 }, + { "listunspent", 1 }, + { "listunspent", 2 }, + { "getblock", 1 }, + { "getrawtransaction", 1 }, + { "createrawtransaction", 0 }, + { "createrawtransaction", 1 }, + { "signrawtransaction", 1 }, + { "signrawtransaction", 2 }, + { "sendrawtransaction", 1 }, + { "gettxout", 1 }, + { "gettxout", 2 }, + { "lockunspent", 0 }, + { "lockunspent", 1 }, + { "importprivkey", 2 }, + { "verifychain", 0 }, + { "verifychain", 1 }, + { "keypoolrefill", 0 }, + { "getrawmempool", 0 }, + { "estimatefee", 0 }, + { "estimatepriority", 0 }, +}; + +class CRPCConvertTable +{ +private: + std::set > members; + +public: + CRPCConvertTable(); + + bool convert(const std::string& method, int idx) { + return (members.count(std::make_pair(method, idx)) > 0); } - else - { - value = value.get_value(); +}; + +CRPCConvertTable::CRPCConvertTable() +{ + const unsigned int n_elem = + (sizeof(vRPCConvertParams) / sizeof(vRPCConvertParams[0])); + + for (unsigned int i = 0; i < n_elem; i++) { + members.insert(std::make_pair(vRPCConvertParams[i].methodName, + vRPCConvertParams[i].paramIdx)); } } +static CRPCConvertTable rpcCvtTable; + // Convert strings to command-specific RPC representation Array RPCConvertValues(const std::string &strMethod, const std::vector &strParams) { Array params; - BOOST_FOREACH(const std::string ¶m, strParams) - params.push_back(param); - int n = params.size(); + for (unsigned int idx = 0; idx < strParams.size(); idx++) { + const std::string& strVal = strParams[idx]; - // - // Special case non-string parameter types - // - if (strMethod == "stop" && n > 0) ConvertTo(params[0]); - if (strMethod == "getaddednodeinfo" && n > 0) ConvertTo(params[0]); - if (strMethod == "setgenerate" && n > 0) ConvertTo(params[0]); - if (strMethod == "setgenerate" && n > 1) ConvertTo(params[1]); - if (strMethod == "getnetworkhashps" && n > 0) ConvertTo(params[0]); - if (strMethod == "getnetworkhashps" && n > 1) ConvertTo(params[1]); - if (strMethod == "sendtoaddress" && n > 1) ConvertTo(params[1]); - if (strMethod == "settxfee" && n > 0) ConvertTo(params[0]); - if (strMethod == "getreceivedbyaddress" && n > 1) ConvertTo(params[1]); - if (strMethod == "getreceivedbyaccount" && n > 1) ConvertTo(params[1]); - if (strMethod == "listreceivedbyaddress" && n > 0) ConvertTo(params[0]); - if (strMethod == "listreceivedbyaddress" && n > 1) ConvertTo(params[1]); - if (strMethod == "listreceivedbyaccount" && n > 0) ConvertTo(params[0]); - if (strMethod == "listreceivedbyaccount" && n > 1) ConvertTo(params[1]); - if (strMethod == "getbalance" && n > 1) ConvertTo(params[1]); - if (strMethod == "getblockhash" && n > 0) ConvertTo(params[0]); - if (strMethod == "move" && n > 2) ConvertTo(params[2]); - if (strMethod == "move" && n > 3) ConvertTo(params[3]); - if (strMethod == "sendfrom" && n > 2) ConvertTo(params[2]); - if (strMethod == "sendfrom" && n > 3) ConvertTo(params[3]); - if (strMethod == "listtransactions" && n > 1) ConvertTo(params[1]); - if (strMethod == "listtransactions" && n > 2) ConvertTo(params[2]); - if (strMethod == "listaccounts" && n > 0) ConvertTo(params[0]); - if (strMethod == "walletpassphrase" && n > 1) ConvertTo(params[1]); - if (strMethod == "prioritisetransaction" && n > 1) ConvertTo(params[1]); - if (strMethod == "prioritisetransaction" && n > 2) ConvertTo(params[2]); - if (strMethod == "getblocktemplate" && n > 0) ConvertTo(params[0]); - if (strMethod == "listsinceblock" && n > 1) ConvertTo(params[1]); - if (strMethod == "sendmany" && n > 1) ConvertTo(params[1]); - if (strMethod == "sendmany" && n > 2) ConvertTo(params[2]); - if (strMethod == "addmultisigaddress" && n > 0) ConvertTo(params[0]); - if (strMethod == "addmultisigaddress" && n > 1) ConvertTo(params[1]); - if (strMethod == "createmultisig" && n > 0) ConvertTo(params[0]); - if (strMethod == "createmultisig" && n > 1) ConvertTo(params[1]); - if (strMethod == "listunspent" && n > 0) ConvertTo(params[0]); - if (strMethod == "listunspent" && n > 1) ConvertTo(params[1]); - if (strMethod == "listunspent" && n > 2) ConvertTo(params[2]); - if (strMethod == "getblock" && n > 1) ConvertTo(params[1]); - if (strMethod == "getrawtransaction" && n > 1) ConvertTo(params[1]); - if (strMethod == "createrawtransaction" && n > 0) ConvertTo(params[0]); - if (strMethod == "createrawtransaction" && n > 1) ConvertTo(params[1]); - if (strMethod == "signrawtransaction" && n > 1) ConvertTo(params[1], true); - if (strMethod == "signrawtransaction" && n > 2) ConvertTo(params[2], true); - if (strMethod == "sendrawtransaction" && n > 1) ConvertTo(params[1], true); - if (strMethod == "gettxout" && n > 1) ConvertTo(params[1]); - if (strMethod == "gettxout" && n > 2) ConvertTo(params[2]); - if (strMethod == "lockunspent" && n > 0) ConvertTo(params[0]); - if (strMethod == "lockunspent" && n > 1) ConvertTo(params[1]); - if (strMethod == "importprivkey" && n > 2) ConvertTo(params[2]); - if (strMethod == "verifychain" && n > 0) ConvertTo(params[0]); - if (strMethod == "verifychain" && n > 1) ConvertTo(params[1]); - if (strMethod == "keypoolrefill" && n > 0) ConvertTo(params[0]); - if (strMethod == "getrawmempool" && n > 0) ConvertTo(params[0]); - if (strMethod == "estimatefee" && n > 0) ConvertTo(params[0]); - if (strMethod == "estimatepriority" && n > 0) ConvertTo(params[0]); + // insert string value directly + if (!rpcCvtTable.convert(strMethod, idx)) { + params.push_back(strVal); + } + + // parse string as JSON, insert bool/number/object/etc. value + else { + Value jVal; + if (!read_string(strVal, jVal)) + throw runtime_error(string("Error parsing JSON:")+strVal); + params.push_back(jVal); + } + + } return params; } From c912e22db08d0a44ad6fd027c09bbdf79c34dbbc Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 4 Jun 2014 11:24:43 -0400 Subject: [PATCH 0254/1288] RPC cleanup: Improve HTTP server replies 1) support varying content types 2) support only sending the header 3) properly deliver error message as content, if HTTP error 4) move AcceptedConnection class to header, for wider use --- src/rpcprotocol.cpp | 17 ++++++++++++++--- src/rpcprotocol.h | 14 +++++++++++++- src/rpcserver.cpp | 10 ---------- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp index 2718f81783..bfa799f84f 100644 --- a/src/rpcprotocol.cpp +++ b/src/rpcprotocol.cpp @@ -54,7 +54,8 @@ static string rfc1123Time() return DateTimeStrFormat("%a, %d %b %Y %H:%M:%S +0000", GetTime()); } -string HTTPReply(int nStatus, const string& strMsg, bool keepalive) +string HTTPReply(int nStatus, const string& strMsg, bool keepalive, + bool headersOnly, const char *contentType) { if (nStatus == HTTP_UNAUTHORIZED) return strprintf("HTTP/1.0 401 Authorization Required\r\n" @@ -73,6 +74,7 @@ string HTTPReply(int nStatus, const string& strMsg, bool keepalive) "\r\n" "

401 Unauthorized.

\r\n" "\r\n", rfc1123Time(), FormatFullVersion()); + const char *cStatus; if (nStatus == HTTP_OK) cStatus = "OK"; else if (nStatus == HTTP_BAD_REQUEST) cStatus = "Bad Request"; @@ -80,12 +82,19 @@ string HTTPReply(int nStatus, const string& strMsg, bool keepalive) else if (nStatus == HTTP_NOT_FOUND) cStatus = "Not Found"; else if (nStatus == HTTP_INTERNAL_SERVER_ERROR) cStatus = "Internal Server Error"; else cStatus = ""; + + bool useInternalContent = false; + if (nStatus != HTTP_OK) { + contentType = "text/plain"; + useInternalContent = true; + } + return strprintf( "HTTP/1.1 %d %s\r\n" "Date: %s\r\n" "Connection: %s\r\n" "Content-Length: %u\r\n" - "Content-Type: application/json\r\n" + "Content-Type: %s\r\n" "Server: bitcoin-json-rpc/%s\r\n" "\r\n" "%s", @@ -94,8 +103,10 @@ string HTTPReply(int nStatus, const string& strMsg, bool keepalive) rfc1123Time(), keepalive ? "keep-alive" : "close", strMsg.size(), + contentType, FormatFullVersion(), - strMsg); + headersOnly ? "" : + useInternalContent ? cStatus : strMsg.c_str()); } bool ReadHTTPRequestLine(std::basic_istream& stream, int &proto, diff --git a/src/rpcprotocol.h b/src/rpcprotocol.h index 11bdd171d9..8d415efb1b 100644 --- a/src/rpcprotocol.h +++ b/src/rpcprotocol.h @@ -71,6 +71,16 @@ enum RPCErrorCode RPC_WALLET_ALREADY_UNLOCKED = -17, // Wallet is already unlocked }; +class AcceptedConnection +{ +public: + virtual ~AcceptedConnection() {} + + virtual std::iostream& stream() = 0; + virtual std::string peer_address_to_string() const = 0; + virtual void close() = 0; +}; + // // IOStream device that speaks SSL but can also speak non-SSL // @@ -141,7 +151,9 @@ private: }; std::string HTTPPost(const std::string& strMsg, const std::map& mapRequestHeaders); -std::string HTTPReply(int nStatus, const std::string& strMsg, bool keepalive); +std::string HTTPReply(int nStatus, const std::string& strMsg, bool keepalive, + bool headerOnly = false, + const char *contentType = "application/json"); bool ReadHTTPRequestLine(std::basic_istream& stream, int &proto, std::string& http_method, std::string& http_uri); int ReadHTTPStatus(std::basic_istream& stream, int &proto); diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 6552de8c49..b85b17c812 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -393,16 +393,6 @@ bool ClientAllowed(const boost::asio::ip::address& address) return false; } -class AcceptedConnection -{ -public: - virtual ~AcceptedConnection() {} - - virtual std::iostream& stream() = 0; - virtual std::string peer_address_to_string() const = 0; - virtual void close() = 0; -}; - template class AcceptedConnectionImpl : public AcceptedConnection { From 854d013012c2d457d5296227d212b053cbea5239 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 4 Jun 2014 11:38:33 -0400 Subject: [PATCH 0255/1288] RPC code movement: separate out JSON-RPC execution logic from HTTP server logic --- src/rpcserver.cpp | 129 ++++++++++++++++++++++++++-------------------- 1 file changed, 72 insertions(+), 57 deletions(-) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index b85b17c812..49bc05e5d6 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -809,6 +809,71 @@ static string JSONRPCExecBatch(const Array& vReq) return write_string(Value(ret), false) + "\n"; } +static bool HTTPReq_JSONRPC(AcceptedConnection *conn, + string& strRequest, + map& mapHeaders, + bool fRun) +{ + // Check authorization + if (mapHeaders.count("authorization") == 0) + { + conn->stream() << HTTPReply(HTTP_UNAUTHORIZED, "", false) << std::flush; + return false; + } + + if (!HTTPAuthorized(mapHeaders)) + { + LogPrintf("ThreadRPCServer incorrect password attempt from %s\n", conn->peer_address_to_string()); + /* Deter brute-forcing short passwords. + If this results in a DoS the user really + shouldn't have their RPC port exposed. */ + if (mapArgs["-rpcpassword"].size() < 20) + MilliSleep(250); + + conn->stream() << HTTPReply(HTTP_UNAUTHORIZED, "", false) << std::flush; + return false; + } + + JSONRequest jreq; + try + { + // Parse request + Value valRequest; + if (!read_string(strRequest, valRequest)) + throw JSONRPCError(RPC_PARSE_ERROR, "Parse error"); + + string strReply; + + // singleton request + if (valRequest.type() == obj_type) { + jreq.parse(valRequest); + + Value result = tableRPC.execute(jreq.strMethod, jreq.params); + + // Send reply + strReply = JSONRPCReply(result, Value::null, jreq.id); + + // array of requests + } else if (valRequest.type() == array_type) + strReply = JSONRPCExecBatch(valRequest.get_array()); + else + throw JSONRPCError(RPC_PARSE_ERROR, "Top-level object parse error"); + + conn->stream() << HTTPReply(HTTP_OK, strReply, fRun) << std::flush; + } + catch (Object& objError) + { + ErrorReply(conn->stream(), objError, jreq.id); + return false; + } + catch (std::exception& e) + { + ErrorReply(conn->stream(), JSONRPCError(RPC_PARSE_ERROR, e.what()), jreq.id); + return false; + } + return true; +} + void ServiceConnection(AcceptedConnection *conn) { bool fRun = true; @@ -825,67 +890,17 @@ void ServiceConnection(AcceptedConnection *conn) // Read HTTP message headers and body ReadHTTPMessage(conn->stream(), mapHeaders, strRequest, nProto); - if (strURI != "/") { - conn->stream() << HTTPReply(HTTP_NOT_FOUND, "", false) << std::flush; - break; - } - - // Check authorization - if (mapHeaders.count("authorization") == 0) - { - conn->stream() << HTTPReply(HTTP_UNAUTHORIZED, "", false) << std::flush; - break; - } - if (!HTTPAuthorized(mapHeaders)) - { - LogPrintf("ThreadRPCServer incorrect password attempt from %s\n", conn->peer_address_to_string()); - /* Deter brute-forcing short passwords. - If this results in a DoS the user really - shouldn't have their RPC port exposed. */ - if (mapArgs["-rpcpassword"].size() < 20) - MilliSleep(250); - - conn->stream() << HTTPReply(HTTP_UNAUTHORIZED, "", false) << std::flush; - break; - } + // HTTP Keep-Alive is false; close connection immediately if (mapHeaders["connection"] == "close") fRun = false; - JSONRequest jreq; - try - { - // Parse request - Value valRequest; - if (!read_string(strRequest, valRequest)) - throw JSONRPCError(RPC_PARSE_ERROR, "Parse error"); - - string strReply; - - // singleton request - if (valRequest.type() == obj_type) { - jreq.parse(valRequest); - - Value result = tableRPC.execute(jreq.strMethod, jreq.params); - - // Send reply - strReply = JSONRPCReply(result, Value::null, jreq.id); - - // array of requests - } else if (valRequest.type() == array_type) - strReply = JSONRPCExecBatch(valRequest.get_array()); - else - throw JSONRPCError(RPC_PARSE_ERROR, "Top-level object parse error"); - - conn->stream() << HTTPReply(HTTP_OK, strReply, fRun) << std::flush; + if (strURI == "/") { + if (!HTTPReq_JSONRPC(conn, strRequest, mapHeaders, fRun)) + break; } - catch (Object& objError) - { - ErrorReply(conn->stream(), objError, jreq.id); - break; - } - catch (std::exception& e) - { - ErrorReply(conn->stream(), JSONRPCError(RPC_PARSE_ERROR, e.what()), jreq.id); + + else { + conn->stream() << HTTPReply(HTTP_NOT_FOUND, "", false) << std::flush; break; } } From ed5769f536f663a8deb8e8b7a68681cebaa52bdd Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Fri, 27 Jun 2014 00:10:53 -0400 Subject: [PATCH 0256/1288] Move AcceptedConnection class to rpcserver.h. Also, add parens to HTTPReply() to assist readability. --- src/rpcprotocol.cpp | 4 ++-- src/rpcprotocol.h | 10 ---------- src/rpcserver.h | 10 ++++++++++ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp index bfa799f84f..2cb4a35c4b 100644 --- a/src/rpcprotocol.cpp +++ b/src/rpcprotocol.cpp @@ -105,8 +105,8 @@ string HTTPReply(int nStatus, const string& strMsg, bool keepalive, strMsg.size(), contentType, FormatFullVersion(), - headersOnly ? "" : - useInternalContent ? cStatus : strMsg.c_str()); + (headersOnly ? "" : + (useInternalContent ? cStatus : strMsg.c_str()))); } bool ReadHTTPRequestLine(std::basic_istream& stream, int &proto, diff --git a/src/rpcprotocol.h b/src/rpcprotocol.h index 8d415efb1b..f1317e9c28 100644 --- a/src/rpcprotocol.h +++ b/src/rpcprotocol.h @@ -71,16 +71,6 @@ enum RPCErrorCode RPC_WALLET_ALREADY_UNLOCKED = -17, // Wallet is already unlocked }; -class AcceptedConnection -{ -public: - virtual ~AcceptedConnection() {} - - virtual std::iostream& stream() = 0; - virtual std::string peer_address_to_string() const = 0; - virtual void close() = 0; -}; - // // IOStream device that speaks SSL but can also speak non-SSL // diff --git a/src/rpcserver.h b/src/rpcserver.h index 1966a65b50..fcd293663f 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -21,6 +21,16 @@ class CBlockIndex; class CNetAddr; +class AcceptedConnection +{ +public: + virtual ~AcceptedConnection() {} + + virtual std::iostream& stream() = 0; + virtual std::string peer_address_to_string() const = 0; + virtual void close() = 0; +}; + /* Start RPC threads */ void StartRPCThreads(); /* Alternative to StartRPCThreads for the GUI, when no server is From 49d86c7477ba1dbbbd08f452d0e7d710b22bad92 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 27 Jun 2014 10:05:46 +0200 Subject: [PATCH 0257/1288] rpc-tests: Fix rpcbind_test after 0193fb8 Port number for RPC is no longer static as multiple tests could be running at once. --- qa/rpc-tests/rpcbind_test.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/qa/rpc-tests/rpcbind_test.py b/qa/rpc-tests/rpcbind_test.py index a31f8d98ef..a823404e00 100755 --- a/qa/rpc-tests/rpcbind_test.py +++ b/qa/rpc-tests/rpcbind_test.py @@ -39,7 +39,7 @@ def run_bind_test(tmpdir, allow_ips, connect_to, addresses, expected): stop_nodes(nodes) wait_bitcoinds() -def run_allowip_test(tmpdir, allow_ips, rpchost): +def run_allowip_test(tmpdir, allow_ips, rpchost, rpcport): ''' Start a node with rpcwallow IP, and request getinfo at a non-localhost IP. @@ -48,7 +48,7 @@ def run_allowip_test(tmpdir, allow_ips, rpchost): nodes = start_nodes(1, tmpdir, [base_args]) try: # connect to node through non-loopback interface - url = "http://rt:rt@%s:%d" % (rpchost, START_RPC_PORT,) + url = "http://rt:rt@%s:%d" % (rpchost, rpcport,) node = AuthServiceProxy(url) node.getinfo() finally: @@ -69,15 +69,17 @@ def run_test(tmpdir): assert(not 'This test requires at least one non-loopback IPv4 interface') print("Using interface %s for testing" % non_loopback_ip) + defaultport = rpc_port(0) + # check default without rpcallowip (IPv4 and IPv6 localhost) run_bind_test(tmpdir, None, '127.0.0.1', [], - [('127.0.0.1', 11100), ('::1', 11100)]) + [('127.0.0.1', defaultport), ('::1', defaultport)]) # check default with rpcallowip (IPv6 any) run_bind_test(tmpdir, ['127.0.0.1'], '127.0.0.1', [], - [('::0', 11100)]) + [('::0', defaultport)]) # check only IPv4 localhost (explicit) run_bind_test(tmpdir, ['127.0.0.1'], '127.0.0.1', ['127.0.0.1'], - [('127.0.0.1', START_RPC_PORT)]) + [('127.0.0.1', defaultport)]) # check only IPv4 localhost (explicit) with alternative port run_bind_test(tmpdir, ['127.0.0.1'], '127.0.0.1:32171', ['127.0.0.1:32171'], [('127.0.0.1', 32171)]) @@ -86,18 +88,18 @@ def run_test(tmpdir): [('127.0.0.1', 32171), ('127.0.0.1', 32172)]) # check only IPv6 localhost (explicit) run_bind_test(tmpdir, ['[::1]'], '[::1]', ['[::1]'], - [('::1', 11100)]) + [('::1', defaultport)]) # check both IPv4 and IPv6 localhost (explicit) run_bind_test(tmpdir, ['127.0.0.1'], '127.0.0.1', ['127.0.0.1', '[::1]'], - [('127.0.0.1', START_RPC_PORT), ('::1', START_RPC_PORT)]) + [('127.0.0.1', defaultport), ('::1', defaultport)]) # check only non-loopback interface run_bind_test(tmpdir, [non_loopback_ip], non_loopback_ip, [non_loopback_ip], - [(non_loopback_ip, START_RPC_PORT)]) + [(non_loopback_ip, defaultport)]) # Check that with invalid rpcallowip, we are denied - run_allowip_test(tmpdir, [non_loopback_ip], non_loopback_ip) + run_allowip_test(tmpdir, [non_loopback_ip], non_loopback_ip, defaultport) try: - run_allowip_test(tmpdir, ['1.1.1.1'], non_loopback_ip) + run_allowip_test(tmpdir, ['1.1.1.1'], non_loopback_ip, defaultport) assert(not 'Connection not denied by rpcallowip as expected') except ValueError: pass From 40a158e100c517c73d9a75434e48cfe904ea00cc Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 27 Jun 2014 11:13:25 +0200 Subject: [PATCH 0258/1288] minor code format fix in rpc-related files --- src/rpcmisc.cpp | 2 +- src/rpcserver.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index a300de2680..5b470516a1 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -22,10 +22,10 @@ #include "json/json_spirit_utils.h" #include "json/json_spirit_value.h" -using namespace std; using namespace boost; using namespace boost::assign; using namespace json_spirit; +using namespace std; Value getinfo(const Array& params, bool fHelp) { diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 49bc05e5d6..54043458d5 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -25,10 +25,10 @@ #include #include "json/json_spirit_writer_template.h" -using namespace std; using namespace boost; using namespace boost::asio; using namespace json_spirit; +using namespace std; static std::string strRPCUserColonPass; @@ -897,9 +897,7 @@ void ServiceConnection(AcceptedConnection *conn) if (strURI == "/") { if (!HTTPReq_JSONRPC(conn, strRequest, mapHeaders, fRun)) break; - } - - else { + } else { conn->stream() << HTTPReply(HTTP_NOT_FOUND, "", false) << std::flush; break; } From 33c62c9c0b25998beb361e6f42e1fd0beebcf05b Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 27 Jun 2014 15:09:41 +0200 Subject: [PATCH 0259/1288] set shutdown title to main window title - this ensures we don't show Bitcoin-Qt as that is still our internal application name - fixes #4427 --- src/qt/utilitydialog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index eb647d0170..5fb0da145d 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -117,6 +117,7 @@ void ShutdownWindow::showShutdownWindow(BitcoinGUI *window) tr("Bitcoin Core is shutting down...") + "

" + tr("Do not shut down the computer until this window disappears."))); shutdownWindow->setLayout(layout); + shutdownWindow->setWindowTitle(window->windowTitle()); // Center shutdown window at where main window was const QPoint global = window->mapToGlobal(window->rect().center()); From 8fbf03995df9a2003be603be1a930bc3373d56e0 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Wed, 25 Jun 2014 16:21:29 -0700 Subject: [PATCH 0260/1288] CBloomFilter::clear() method --- src/bloom.cpp | 7 +++++++ src/bloom.h | 2 ++ src/test/bloom_tests.cpp | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/src/bloom.cpp b/src/bloom.cpp index 26e366179c..85a2ddc189 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -94,6 +94,13 @@ bool CBloomFilter::contains(const uint256& hash) const return contains(data); } +void CBloomFilter::clear() +{ + vData.assign(vData.size(),0); + isFull = false; + isEmpty = true; +} + bool CBloomFilter::IsWithinSizeConstraints() const { return vData.size() <= MAX_BLOOM_FILTER_SIZE && nHashFuncs <= MAX_HASH_FUNCS; diff --git a/src/bloom.h b/src/bloom.h index 956bead87f..d0caf9e9fa 100644 --- a/src/bloom.h +++ b/src/bloom.h @@ -78,6 +78,8 @@ public: bool contains(const COutPoint& outpoint) const; bool contains(const uint256& hash) const; + void clear(); + // True if the size is <= MAX_BLOOM_FILTER_SIZE and the number of hash functions is <= MAX_HASH_FUNCS // (catch a filter which was just deserialized which was too big) bool IsWithinSizeConstraints() const; diff --git a/src/test/bloom_tests.cpp b/src/test/bloom_tests.cpp index b56d998be2..5c6c7d8588 100644 --- a/src/test/bloom_tests.cpp +++ b/src/test/bloom_tests.cpp @@ -45,6 +45,10 @@ BOOST_AUTO_TEST_CASE(bloom_create_insert_serialize) expected[i] = (char)vch[i]; BOOST_CHECK_EQUAL_COLLECTIONS(stream.begin(), stream.end(), expected.begin(), expected.end()); + + BOOST_CHECK_MESSAGE( filter.contains(ParseHex("99108ad8ed9bb6274d3980bab5a85c048f0950c8")), "BloomFilter doesn't contain just-inserted object!"); + filter.clear(); + BOOST_CHECK_MESSAGE( !filter.contains(ParseHex("99108ad8ed9bb6274d3980bab5a85c048f0950c8")), "BloomFilter should be empty!"); } BOOST_AUTO_TEST_CASE(bloom_create_insert_serialize_with_tweak) From d640a3ceab4f4372c2a0f738c1286cfde4b41b50 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Wed, 25 Jun 2014 23:41:44 -0700 Subject: [PATCH 0261/1288] Relay double-spends, subject to anti-DOS Allows network wallets and other clients to see transactions that respend a prevout already spent in an unconfirmed transaction in this node's mempool. Knowledge of an attempted double-spend is of interest to recipients of the first spend. In some cases, it will allow these recipients to withhold goods or services upon being alerted of a double-spend that deprives them of payment. As before, respends are not added to the mempool. Anti-Denial-of-Service-Attack provisions: - Use a bloom filter to relay only one respend per mempool prevout - Rate-limit respend relays to a default of 100 thousand bytes/minute - Define tx2.IsEquivalentTo(tx1): equality when scriptSigs are not considered - Do not relay these equivalent transactions Remove an unused variable declaration in txmempool.cpp. --- src/core.cpp | 16 ++++++++ src/core.h | 3 ++ src/init.cpp | 1 + src/main.cpp | 100 +++++++++++++++++++++++++++++++++++++++------- src/main.h | 3 ++ src/txmempool.cpp | 1 - 6 files changed, 109 insertions(+), 15 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index 6c5ee1c0f8..ca28624529 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -119,6 +119,22 @@ CTransaction& CTransaction::operator=(const CTransaction &tx) { return *this; } +bool CTransaction::IsEquivalentTo(const CTransaction& tx) const +{ + if (nVersion != tx.nVersion || + nLockTime != tx.nLockTime || + vin.size() != tx.vin.size() || + vout != tx.vout) + return false; + for (unsigned int i = 0; i < vin.size(); i++) + { + if (vin[i].nSequence != tx.vin[i].nSequence || + vin[i].prevout != tx.vin[i].prevout) + return false; + } + return true; +} + int64_t CTransaction::GetValueOut() const { int64_t nValueOut = 0; diff --git a/src/core.h b/src/core.h index 27fda95552..8606831575 100644 --- a/src/core.h +++ b/src/core.h @@ -256,6 +256,9 @@ public: return hash; } + // True if only scriptSigs are different + bool IsEquivalentTo(const CTransaction& tx) const; + // Return sum of txouts. int64_t GetValueOut() const; // GetValueIn() is a method on CCoinsViewCache, because diff --git a/src/init.cpp b/src/init.cpp index c7170b0f2d..bd732753e4 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1175,6 +1175,7 @@ bool AppInit2(boost::thread_group& threadGroup) LogPrintf("mapAddressBook.size() = %u\n", pwalletMain ? pwalletMain->mapAddressBook.size() : 0); #endif + RegisterInternalSignals(); StartNode(threadGroup); if (fServer) StartRPCThreads(); diff --git a/src/main.cpp b/src/main.cpp index d86fd3a24d..48237c1b54 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,6 +7,7 @@ #include "addrman.h" #include "alert.h" +#include "bloom.h" #include "chainparams.h" #include "checkpoints.h" #include "checkqueue.h" @@ -122,6 +123,10 @@ namespace { map::iterator> > mapBlocksToDownload; } +// Forward reference functions defined here: +static const unsigned int MAX_DOUBLESPEND_BLOOM = 1000; +static void RelayDoubleSpend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter); + ////////////////////////////////////////////////////////////////////////////// // // dispatching functions @@ -143,9 +148,24 @@ struct CMainSignals { boost::signals2::signal Inventory; // Tells listeners to broadcast their data. boost::signals2::signal Broadcast; + // Notifies listeners of detection of a double-spent transaction. Arguments are outpoint that is + // double-spent, first transaction seen, double-spend transaction, and whether the second double-spend + // transaction was first seen in a block. + // Note: only notifies if the previous transaction is in the memory pool; if previous transction was in a block, + // then the double-spend simply fails when we try to lookup the inputs in the current UTXO set. + boost::signals2::signal DetectedDoubleSpend; } g_signals; } +void RegisterInternalSignals() { + static CBloomFilter doubleSpendFilter; + seed_insecure_rand(); + doubleSpendFilter = CBloomFilter(MAX_DOUBLESPEND_BLOOM, 0.01, insecure_rand(), BLOOM_UPDATE_NONE); + + g_signals.DetectedDoubleSpend.connect(boost::bind(RelayDoubleSpend, _1, _2, _3, doubleSpendFilter)); +} + + void RegisterWallet(CWalletInterface* pwalletIn) { g_signals.SyncTransaction.connect(boost::bind(&CWalletInterface::SyncTransaction, pwalletIn, _1, _2)); g_signals.EraseTransaction.connect(boost::bind(&CWalletInterface::EraseFromWallet, pwalletIn, _1)); @@ -824,6 +844,22 @@ int64_t GetMinFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree, return nMinFee; } +// Exponentially limit the rate of nSize flow to nLimit. nLimit unit is thousands-per-minute. +bool RateLimitExceeded(double& dCount, int64_t& nLastTime, int64_t nLimit, unsigned int nSize) +{ + static CCriticalSection csLimiter; + int64_t nNow = GetTime(); + + LOCK(csLimiter); + + // Use an exponentially decaying ~10-minute window: + dCount *= pow(1.0 - 1.0/600.0, (double)(nNow - nLastTime)); + nLastTime = nNow; + if (dCount >= nLimit*10*1000) + return true; + dCount += nSize; + return false; +} bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransaction &tx, bool fLimitFree, bool* pfMissingInputs, bool fRejectInsaneFee) @@ -858,9 +894,10 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa for (unsigned int i = 0; i < tx.vin.size(); i++) { COutPoint outpoint = tx.vin[i].prevout; - if (pool.mapNextTx.count(outpoint)) + // Does tx conflict with a member of the pool, and is it not equivalent to that member? + if (pool.mapNextTx.count(outpoint) && !tx.IsEquivalentTo(*pool.mapNextTx[outpoint].ptx)) { - // Disable replacement feature for now + g_signals.DetectedDoubleSpend(outpoint, tx, false); return false; } } @@ -932,23 +969,15 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa // be annoying or make others' transactions take longer to confirm. if (fLimitFree && nFees < CTransaction::minRelayTxFee.GetFee(nSize)) { - static CCriticalSection csFreeLimiter; static double dFreeCount; - static int64_t nLastTime; - int64_t nNow = GetTime(); + static int64_t nLastFreeTime; + static int64_t nFreeLimit = GetArg("-limitfreerelay", 15); - LOCK(csFreeLimiter); - - // Use an exponentially decaying ~10-minute window: - dFreeCount *= pow(1.0 - 1.0/600.0, (double)(nNow - nLastTime)); - nLastTime = nNow; - // -limitfreerelay unit is thousand-bytes-per-minute - // At default rate it would take over a month to fill 1GB - if (dFreeCount >= GetArg("-limitfreerelay", 15)*10*1000) + if (RateLimitExceeded(dFreeCount, nLastFreeTime, nFreeLimit, nSize)) return state.DoS(0, error("AcceptToMemoryPool : free transaction rejected by rate limiter"), REJECT_INSUFFICIENTFEE, "insufficient priority"); + LogPrint("mempool", "Rate limit dFreeCount: %g => %g\n", dFreeCount, dFreeCount+nSize); - dFreeCount += nSize; } if (fRejectInsaneFee && nFees > CTransaction::minRelayTxFee.GetFee(nSize) * 10000) @@ -971,6 +1000,49 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa return true; } +static void +RelayDoubleSpend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter) +{ + // Relaying double-spend attempts to our peers lets them detect when + // somebody might be trying to cheat them. However, blindly relaying + // every double-spend across the entire network gives attackers + // a denial-of-service attack: just generate a stream of double-spends + // re-spending the same (limited) set of outpoints owned by the attacker. + // So, we use a bloom filter and only relay (at most) the first double + // spend for each outpoint. False-positives ("we have already relayed") + // are OK, because if the peer doesn't hear about the double-spend + // from us they are very likely to hear about it from another peer, since + // each peer uses a different, randomized bloom filter. + + if (fInBlock || filter.contains(outPoint)) return; + + // Apply an independent rate limit to double-spend relays + static double dRespendCount; + static int64_t nLastRespendTime; + static int64_t nRespendLimit = GetArg("-limitrespendrelay", 100); + unsigned int nSize = ::GetSerializeSize(doubleSpend, SER_NETWORK, PROTOCOL_VERSION); + + if (RateLimitExceeded(dRespendCount, nLastRespendTime, nRespendLimit, nSize)) + { + LogPrint("mempool", "Double-spend relay rejected by rate limiter\n"); + return; + } + + LogPrint("mempool", "Rate limit dRespendCount: %g => %g\n", dRespendCount, dRespendCount+nSize); + + // Clear the filter on average every MAX_DOUBLE_SPEND_BLOOM + // insertions + if (insecure_rand()%MAX_DOUBLESPEND_BLOOM == 0) + filter.clear(); + + filter.insert(outPoint); + + RelayTransaction(doubleSpend); + + // Share conflict with wallet + g_signals.SyncTransaction(doubleSpend, NULL); +} + int CMerkleTx::GetDepthInMainChainINTERNAL(CBlockIndex* &pindexRet) const { diff --git a/src/main.h b/src/main.h index 0332db2163..c7f3dc4388 100644 --- a/src/main.h +++ b/src/main.h @@ -108,6 +108,9 @@ struct CNodeStateStats; struct CBlockTemplate; +/** Set up internal signal handlers **/ +void RegisterInternalSignals(); + /** Register a wallet to receive updates from core */ void RegisterWallet(CWalletInterface* pwalletIn); /** Unregister a wallet from core */ diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 52f82ef040..97a426dd35 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -415,7 +415,6 @@ void CTxMemPool::remove(const CTransaction &tx, std::list& removed void CTxMemPool::removeConflicts(const CTransaction &tx, std::list& removed) { // Remove transactions which depend on inputs of tx, recursively - list result; LOCK(cs); BOOST_FOREACH(const CTxIn &txin, tx.vin) { std::map::iterator it = mapNextTx.find(txin.prevout); From ada5a067c75f19a724cc054286ecf2254e5dbe8f Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Thu, 26 Jun 2014 18:31:05 -0700 Subject: [PATCH 0262/1288] UI to alert of respend attempt affecting wallet. Respend transactions that conflict with transactions already in the wallet are added to it. They are not displayed unless they also involve the wallet, or get into a block. If they do not involve the wallet, they continue not to affect balance. Transactions that involve the wallet, and have conflicting non-equivalent transactions, are highlighted in red. When the conflict first occurs, a modal dialog is thrown. CWallet::SyncMetaData is changed to sync only to equivalent transactions. When a conflict is added to the wallet, counter nConflictsReceived is incremented. This acts like a change in active block height for the purpose of triggering UI updates. --- src/qt/guiconstants.h | 4 ++++ src/qt/transactionfilterproxy.cpp | 4 ++-- src/qt/transactionrecord.cpp | 10 +++++++--- src/qt/transactionrecord.h | 13 ++++++++++-- src/qt/transactiontablemodel.cpp | 18 ++++++++++++----- src/qt/walletmodel.cpp | 8 ++++++++ src/ui_interface.h | 3 ++- src/wallet.cpp | 33 +++++++++++++++++++++++++------ src/wallet.h | 15 ++++++++++++-- 9 files changed, 87 insertions(+), 21 deletions(-) diff --git a/src/qt/guiconstants.h b/src/qt/guiconstants.h index 5ae4bc833d..44e361e1e5 100644 --- a/src/qt/guiconstants.h +++ b/src/qt/guiconstants.h @@ -23,6 +23,10 @@ static const int STATUSBAR_ICONSIZE = 16; #define COLOR_NEGATIVE QColor(255, 0, 0) /* Transaction list -- bare address (without label) */ #define COLOR_BAREADDRESS QColor(140, 140, 140) +/* Transaction list -- has conflicting transactions */ +#define COLOR_HASCONFLICTING Qt::white; +/* Transaction list -- has conflicting transactions - background */ +#define COLOR_HASCONFLICTING_BG QColor(192, 0, 0) /* Tooltips longer than this (in characters) are converted into rich text, so that they can be word-wrapped. diff --git a/src/qt/transactionfilterproxy.cpp b/src/qt/transactionfilterproxy.cpp index f9546fddb5..7293029787 100644 --- a/src/qt/transactionfilterproxy.cpp +++ b/src/qt/transactionfilterproxy.cpp @@ -24,7 +24,7 @@ TransactionFilterProxy::TransactionFilterProxy(QObject *parent) : typeFilter(ALL_TYPES), minAmount(0), limitRows(-1), - showInactive(true) + showInactive(false) { } @@ -39,7 +39,7 @@ bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex & qint64 amount = llabs(index.data(TransactionTableModel::AmountRole).toLongLong()); int status = index.data(TransactionTableModel::StatusRole).toInt(); - if(!showInactive && status == TransactionStatus::Conflicted) + if(!showInactive && status == TransactionStatus::Conflicted && type == TransactionRecord::Other) return false; if(!(TYPE(type) & typeFilter)) return false; diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index eec2b57e8c..21f1b7356f 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -170,6 +170,8 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx) status.depth = wtx.GetDepthInMainChain(); status.cur_num_blocks = chainActive.Height(); + status.hasConflicting = false; + if (!IsFinalTx(wtx, chainActive.Height() + 1)) { if (wtx.nLockTime < LOCKTIME_THRESHOLD) @@ -213,6 +215,7 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx) if (status.depth < 0) { status.status = TransactionStatus::Conflicted; + status.hasConflicting = !(wtx.GetConflicts(false).empty()); } else if (GetAdjustedTime() - wtx.nTimeReceived > 2 * 60 && wtx.GetRequestCount() == 0) { @@ -221,6 +224,7 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx) else if (status.depth == 0) { status.status = TransactionStatus::Unconfirmed; + status.hasConflicting = !(wtx.GetConflicts(false).empty()); } else if (status.depth < RecommendedNumConfirmations) { @@ -231,13 +235,13 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx) status.status = TransactionStatus::Confirmed; } } - } -bool TransactionRecord::statusUpdateNeeded() +bool TransactionRecord::statusUpdateNeeded(int64_t nConflictsReceived) { AssertLockHeld(cs_main); - return status.cur_num_blocks != chainActive.Height(); + return (status.cur_num_blocks != chainActive.Height() || + status.cur_num_conflicts != nConflictsReceived); } QString TransactionRecord::getTxID() const diff --git a/src/qt/transactionrecord.h b/src/qt/transactionrecord.h index af6fd403b3..4c2847144a 100644 --- a/src/qt/transactionrecord.h +++ b/src/qt/transactionrecord.h @@ -20,7 +20,8 @@ class TransactionStatus public: TransactionStatus(): countsForBalance(false), sortKey(""), - matures_in(0), status(Offline), depth(0), open_for(0), cur_num_blocks(-1) + matures_in(0), status(Offline), hasConflicting(false), depth(0), open_for(0), cur_num_blocks(-1), + cur_num_conflicts(-1) { } enum Status { @@ -51,6 +52,10 @@ public: /** @name Reported status @{*/ Status status; + + // Has conflicting transactions spending same prevout + bool hasConflicting; + qint64 depth; qint64 open_for; /**< Timestamp if status==OpenUntilDate, otherwise number of additional blocks that need to be mined before @@ -59,6 +64,10 @@ public: /** Current number of blocks (to know whether cached status is still valid) */ int cur_num_blocks; + + /** Number of conflicts received into wallet as of last status update */ + int64_t cur_num_conflicts; + }; /** UI model for a transaction. A core transaction can be represented by multiple UI transactions if it has @@ -133,7 +142,7 @@ public: /** Return whether a status update is needed. */ - bool statusUpdateNeeded(); + bool statusUpdateNeeded(int64_t nConflictsReceived); }; #endif // TRANSACTIONRECORD_H diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index b9fcd0d6b0..eb5c3abdbc 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -168,8 +168,7 @@ public: parent->endRemoveRows(); break; case CT_UPDATED: - // Miscellaneous updates -- nothing to do, status update will take care of this, and is only computed for - // visible transactions. + emit parent->dataChanged(parent->index(lowerIndex, parent->Status), parent->index(upperIndex-1, parent->Amount)); break; } } @@ -190,20 +189,21 @@ public: // stuck if the core is holding the locks for a longer time - for // example, during a wallet rescan. // - // If a status update is needed (blocks came in since last check), - // update the status of this transaction from the wallet. Otherwise, + // If a status update is needed (blocks or conflicts came in since last check), + // update the status of this transaction from the wallet. Otherwise, // simply re-use the cached status. TRY_LOCK(cs_main, lockMain); if(lockMain) { TRY_LOCK(wallet->cs_wallet, lockWallet); - if(lockWallet && rec->statusUpdateNeeded()) + if(lockWallet && rec->statusUpdateNeeded(wallet->nConflictsReceived)) { std::map::iterator mi = wallet->mapWallet.find(rec->hash); if(mi != wallet->mapWallet.end()) { rec->updateStatus(mi->second); + rec->status.cur_num_conflicts = wallet->nConflictsReceived; } } } @@ -363,6 +363,8 @@ QString TransactionTableModel::formatTxType(const TransactionRecord *wtx) const return tr("Payment to yourself"); case TransactionRecord::Generated: return tr("Mined"); + case TransactionRecord::Other: + return tr("Other"); default: return QString(); } @@ -535,7 +537,13 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const return formatTooltip(rec); case Qt::TextAlignmentRole: return column_alignments[index.column()]; + case Qt::BackgroundColorRole: + if (rec->status.hasConflicting) + return COLOR_HASCONFLICTING_BG; + break; case Qt::ForegroundRole: + if (rec->status.hasConflicting) + return COLOR_HASCONFLICTING; // Non-confirmed (but not immature) as transactions are grey if(!rec->status.countsForBalance && rec->status.status != TransactionStatus::Immature) { diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 2f633a26c8..3d6f2ab9ba 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -138,6 +138,14 @@ void WalletModel::checkBalanceChanged() void WalletModel::updateTransaction(const QString &hash, int status) { + if (status == CT_GOT_CONFLICT) + { + emit message(tr("Conflict Received"), + tr("WARNING: Transaction may never be confirmed. Its input was seen being spent by another transaction on the network. Wait for confirmation!"), + CClientUIInterface::MSG_WARNING); + return; + } + if(transactionTableModel) transactionTableModel->updateTransaction(hash, status); diff --git a/src/ui_interface.h b/src/ui_interface.h index e1a3e04e12..e9fcd91d41 100644 --- a/src/ui_interface.h +++ b/src/ui_interface.h @@ -21,7 +21,8 @@ enum ChangeType { CT_NEW, CT_UPDATED, - CT_DELETED + CT_DELETED, + CT_GOT_CONFLICT }; /** Signals for UI communication. */ diff --git a/src/wallet.cpp b/src/wallet.cpp index f6fd6e958d..79cc5ba3c9 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -256,7 +256,7 @@ bool CWallet::SetMaxVersion(int nVersion) return true; } -set CWallet::GetConflicts(const uint256& txid) const +set CWallet::GetConflicts(const uint256& txid, bool includeEquivalent) const { set result; AssertLockHeld(cs_wallet); @@ -274,7 +274,8 @@ set CWallet::GetConflicts(const uint256& txid) const continue; // No conflict if zero or one spends range = mapTxSpends.equal_range(txin.prevout); for (TxSpends::const_iterator it = range.first; it != range.second; ++it) - result.insert(it->second); + if (includeEquivalent || !wtx.IsEquivalentTo(mapWallet.at(it->second))) + result.insert(it->second); } return result; } @@ -303,6 +304,7 @@ void CWallet::SyncMetaData(pair range) const uint256& hash = it->second; CWalletTx* copyTo = &mapWallet[hash]; if (copyFrom == copyTo) continue; + if (!copyFrom->IsEquivalentTo(*copyTo)) continue; copyTo->mapValue = copyFrom->mapValue; copyTo->vOrderForm = copyFrom->vOrderForm; // fTimeReceivedIsTxTime not copied on purpose @@ -588,6 +590,20 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet) // Notify UI of new or updated transaction NotifyTransactionChanged(this, hash, fInsertedNew ? CT_NEW : CT_UPDATED); + // Notifications for existing transactions that now have conflicts with this one + if (fInsertedNew) + { + BOOST_FOREACH(const uint256& conflictHash, wtxIn.GetConflicts(false)) + { + CWalletTx& txConflict = mapWallet[conflictHash]; + NotifyTransactionChanged(this, conflictHash, CT_UPDATED); //Updates UI table + if (IsFromMe(txConflict) || IsMine(txConflict)) + { + NotifyTransactionChanged(this, conflictHash, CT_GOT_CONFLICT); //Throws dialog + } + } + } + // notify an external script when a wallet transaction comes in or is updated std::string strCmd = GetArg("-walletnotify", ""); @@ -610,7 +626,12 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl AssertLockHeld(cs_wallet); bool fExisted = mapWallet.count(tx.GetHash()); if (fExisted && !fUpdate) return false; - if (fExisted || IsMine(tx) || IsFromMe(tx)) + + bool fIsConflicting = IsConflicting(tx); + if (fIsConflicting) + nConflictsReceived++; + + if (fExisted || IsMine(tx) || IsFromMe(tx) || fIsConflicting) { CWalletTx wtx(this,tx); // Get merkle branch if transaction was found in a block @@ -896,7 +917,7 @@ void CWallet::ReacceptWalletTransactions() int nDepth = wtx.GetDepthInMainChain(); - if (!wtx.IsCoinBase() && nDepth < 0) + if (!wtx.IsCoinBase() && nDepth < 0 && (IsMine(wtx) || IsFromMe(wtx))) { // Try to add to memory pool LOCK(mempool.cs); @@ -916,13 +937,13 @@ void CWalletTx::RelayWalletTransaction() } } -set CWalletTx::GetConflicts() const +set CWalletTx::GetConflicts(bool includeEquivalent) const { set result; if (pwallet != NULL) { uint256 myHash = GetHash(); - result = pwallet->GetConflicts(myHash); + result = pwallet->GetConflicts(myHash, includeEquivalent); result.erase(myHash); } return result; diff --git a/src/wallet.h b/src/wallet.h index 8494ce9a34..1c2512d678 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -141,6 +141,9 @@ public: MasterKeyMap mapMasterKeys; unsigned int nMasterKeyMaxID; + // Increment to cause UI refresh, similar to new block + int64_t nConflictsReceived; + CWallet() { SetNull(); @@ -163,6 +166,7 @@ public: nNextResend = 0; nLastResend = 0; nTimeFirstKey = 0; + nConflictsReceived = 0; } std::map mapWallet; @@ -305,6 +309,13 @@ public: { return (GetDebit(tx) > 0); } + bool IsConflicting(const CTransaction& tx) const + { + BOOST_FOREACH(const CTxIn& txin, tx.vin) + if (mapTxSpends.count(txin.prevout)) + return true; + return false; + } int64_t GetDebit(const CTransaction& tx) const { int64_t nDebit = 0; @@ -377,7 +388,7 @@ public: int GetVersion() { LOCK(cs_wallet); return nWalletVersion; } // Get wallet transactions that conflict with given transaction (spend same outputs) - std::set GetConflicts(const uint256& txid) const; + std::set GetConflicts(const uint256& txid, bool includeEquivalent) const; /** Address book entry changed. * @note called with lock cs_wallet held. @@ -699,7 +710,7 @@ public: void RelayWalletTransaction(); - std::set GetConflicts() const; + std::set GetConflicts(bool includeEquivalent=true) const; }; From 9004798e62e987ddf50030b17fa1881b63dd5e45 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Thu, 26 Jun 2014 18:31:40 -0700 Subject: [PATCH 0263/1288] Add -respendnotify option and new RPC data -respendnotify= Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) Add respendsobserved array to gettransaction, listtransactions, and listsinceblock RPCs. This omits the malleated clones that are included in the walletconflicts array. Add RPC help for respendsobserved and walletconflicts (help was missing for the latter). --- contrib/debian/manpages/bitcoin-qt.1 | 3 +++ src/init.cpp | 1 + src/rpcwallet.cpp | 22 ++++++++++++++++++++++ src/wallet.cpp | 8 ++++++++ 4 files changed, 34 insertions(+) diff --git a/contrib/debian/manpages/bitcoin-qt.1 b/contrib/debian/manpages/bitcoin-qt.1 index cd478b1875..25a423f9c4 100644 --- a/contrib/debian/manpages/bitcoin-qt.1 +++ b/contrib/debian/manpages/bitcoin-qt.1 @@ -139,6 +139,9 @@ Execute command when the best block changes (%s in cmd is replaced by block hash \fB\-walletnotify=\fR Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) .TP +\fB\-respendnotify=\fR +Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) +.TP \fB\-alertnotify=\fR Execute command when a relevant alert is received (%s in cmd is replaced by message) .TP diff --git a/src/init.cpp b/src/init.cpp index bd732753e4..3d0c03328f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -260,6 +260,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -upgradewallet " + _("Upgrade wallet to latest format") + " " + _("on startup") + "\n"; strUsage += " -wallet= " + _("Specify wallet file (within data directory)") + " " + _("(default: wallet.dat)") + "\n"; strUsage += " -walletnotify= " + _("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)") + "\n"; + strUsage += " -respendnotify= " + _("Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID)") + "\n"; strUsage += " -zapwallettxes= " + _("Delete all wallet transactions and only recover those part of the blockchain through -rescan on startup") + "\n"; strUsage += " " + _("(default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)") + "\n"; #endif diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 4f27cef087..38e96133b4 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -58,6 +58,10 @@ void WalletTxToJSON(const CWalletTx& wtx, Object& entry) BOOST_FOREACH(const uint256& conflict, wtx.GetConflicts()) conflicts.push_back(conflict.GetHex()); entry.push_back(Pair("walletconflicts", conflicts)); + Array respends; + BOOST_FOREACH(const uint256& respend, wtx.GetConflicts(false)) + respends.push_back(respend.GetHex()); + entry.push_back(Pair("respendsobserved", respends)); entry.push_back(Pair("time", wtx.GetTxTime())); entry.push_back(Pair("timereceived", (int64_t)wtx.nTimeReceived)); BOOST_FOREACH(const PAIRTYPE(string,string)& item, wtx.mapValue) @@ -1211,6 +1215,12 @@ Value listtransactions(const Array& params, bool fHelp) " \"blockindex\": n, (numeric) The block index containing the transaction. Available for 'send' and 'receive'\n" " category of transactions.\n" " \"txid\": \"transactionid\", (string) The transaction id. Available for 'send' and 'receive' category of transactions.\n" + " \"walletconflicts\" : [\n" + " \"conflictid\", (string) Ids of transactions, including equivalent clones, that re-spend a txid input.\n" + " ],\n" + " \"respendsobserved\" : [\n" + " \"respendid\", (string) Ids of transactions, NOT equivalent clones, that re-spend a txid input. \"Double-spends.\"\n" + " ],\n" " \"time\": xxx, (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\n" " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT). Available \n" " for 'send' and 'receive' category of transactions.\n" @@ -1376,6 +1386,12 @@ Value listsinceblock(const Array& params, bool fHelp) " \"blockindex\": n, (numeric) The block index containing the transaction. Available for 'send' and 'receive' category of transactions.\n" " \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n" " \"txid\": \"transactionid\", (string) The transaction id. Available for 'send' and 'receive' category of transactions.\n" + " \"walletconflicts\" : [\n" + " \"conflictid\", (string) Ids of transactions, including equivalent clones, that re-spend a txid input.\n" + " ],\n" + " \"respendsobserved\" : [\n" + " \"respendid\", (string) Ids of transactions, NOT equivalent clones, that re-spend a txid input. \"Double-spends.\"\n" + " ],\n" " \"time\": xxx, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT).\n" " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (Jan 1 1970 GMT). Available for 'send' and 'receive' category of transactions.\n" " \"comment\": \"...\", (string) If a comment is associated with the transaction.\n" @@ -1448,6 +1464,12 @@ Value gettransaction(const Array& params, bool fHelp) " \"blockindex\" : xx, (numeric) The block index\n" " \"blocktime\" : ttt, (numeric) The time in seconds since epoch (1 Jan 1970 GMT)\n" " \"txid\" : \"transactionid\", (string) The transaction id.\n" + " \"walletconflicts\" : [\n" + " \"conflictid\", (string) Ids of transactions, including equivalent clones, that re-spend a txid input.\n" + " ],\n" + " \"respendsobserved\" : [\n" + " \"respendid\", (string) Ids of transactions, NOT equivalent clones, that re-spend a txid input. \"Double-spends.\"\n" + " ],\n" " \"time\" : ttt, (numeric) The transaction time in seconds since epoch (1 Jan 1970 GMT)\n" " \"timereceived\" : ttt, (numeric) The time received in seconds since epoch (1 Jan 1970 GMT)\n" " \"details\" : [\n" diff --git a/src/wallet.cpp b/src/wallet.cpp index 79cc5ba3c9..91910c6ea9 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -600,6 +600,14 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet) if (IsFromMe(txConflict) || IsMine(txConflict)) { NotifyTransactionChanged(this, conflictHash, CT_GOT_CONFLICT); //Throws dialog + // external respend notify + std::string strCmd = GetArg("-respendnotify", ""); + if (!strCmd.empty()) + { + boost::replace_all(strCmd, "%s", wtxIn.GetHash().GetHex()); + boost::replace_all(strCmd, "%t", conflictHash.GetHex()); + boost::thread t(runCommand, strCmd); // thread runs free + } } } } From 9fa53dd3bdc6f62b16a7c2b970449c8c35f4c41b Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Fri, 27 Jun 2014 07:49:27 -0700 Subject: [PATCH 0264/1288] Add release notes entry --- doc/release-notes.md | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/doc/release-notes.md b/doc/release-notes.md index 9272d427cd..e68e12310e 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -19,3 +19,49 @@ estimate. Statistics used to estimate fees and priorities are saved in the data directory in the 'fee_estimates.dat' file just before program shutdown, and are read in at startup. + +Double-Spend Relay and Alerts +============================= +VERY IMPORTANT: *It has never been safe, and remains unsafe, to rely* +*on unconfirmed transactions.* + +Relay +----- +When an attempt is seen on the network to spend the same unspent funds +more than once, it is no longer ignored. Instead, it is broadcast, to +serve as an alert. This broadcast is subject to protections against +denial-of-service attacks. + +Wallets and other bitcoin services should alert their users to +double-spends that affect them. Merchants and other users may have +enough time to withhold goods or services when payment becomes +uncertain, until confirmation. + +Bitcoin Core Wallet Alerts +-------------------------- +The Bitcoin Core wallet now makes respend attempts visible in several +ways. + +If you are online, and a respend affecting one of your wallet +transactions is seen, a notification is immediately issued to the +command registered with `-respendnotify=`. Additionally, if +using the GUI: + - An alert box is immediately displayed. + - The affected wallet transaction is highlighted in red until it is + confirmed (and it may never be confirmed). + +A `respendsobserved` array is added to `gettransaction`, `listtransactions`, +and `listsinceblock` RPC results. + +Warning +------- +*If you rely on an unconfirmed transaction, these change do VERY* +*LITTLE to protect you from a malicious double-spend, because:* + + - You may learn about the respend too late to avoid doing whatever + you were being paid for + - Using other relay rules, a double-spender can craft his crime to + resist broadcast + - Miners can choose which conflicting spend to confirm, and some + miners may not confirmg the first acceptable spend they see + From 7a19efe04069d9a1e251cdc94b25184f76d9d901 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Fri, 27 Jun 2014 16:47:33 -0700 Subject: [PATCH 0265/1288] Formatting, spelling, comment fixes. --- doc/release-notes.md | 2 +- src/main.cpp | 6 ++---- src/qt/transactionrecord.h | 13 ++++++++++--- src/qt/transactiontablemodel.cpp | 4 ++-- src/qt/walletmodel.cpp | 14 +++++++------- src/wallet.cpp | 2 +- 6 files changed, 23 insertions(+), 18 deletions(-) diff --git a/doc/release-notes.md b/doc/release-notes.md index e68e12310e..3a4079e437 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -63,5 +63,5 @@ Warning - Using other relay rules, a double-spender can craft his crime to resist broadcast - Miners can choose which conflicting spend to confirm, and some - miners may not confirmg the first acceptable spend they see + miners may not confirm the first acceptable spend they see diff --git a/src/main.cpp b/src/main.cpp index 48237c1b54..df810f575f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -852,7 +852,6 @@ bool RateLimitExceeded(double& dCount, int64_t& nLastTime, int64_t nLimit, unsig LOCK(csLimiter); - // Use an exponentially decaying ~10-minute window: dCount *= pow(1.0 - 1.0/600.0, (double)(nNow - nLastTime)); nLastTime = nNow; if (dCount >= nLimit*10*1000) @@ -973,7 +972,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa static int64_t nLastFreeTime; static int64_t nFreeLimit = GetArg("-limitfreerelay", 15); - if (RateLimitExceeded(dFreeCount, nLastFreeTime, nFreeLimit, nSize)) + if (RateLimitExceeded(dFreeCount, nLastFreeTime, nFreeLimit, nSize)) return state.DoS(0, error("AcceptToMemoryPool : free transaction rejected by rate limiter"), REJECT_INSUFFICIENTFEE, "insufficient priority"); @@ -1000,8 +999,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa return true; } -static void -RelayDoubleSpend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter) +static void RelayDoubleSpend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter) { // Relaying double-spend attempts to our peers lets them detect when // somebody might be trying to cheat them. However, blindly relaying diff --git a/src/qt/transactionrecord.h b/src/qt/transactionrecord.h index 4c2847144a..37679cebfa 100644 --- a/src/qt/transactionrecord.h +++ b/src/qt/transactionrecord.h @@ -19,10 +19,17 @@ class TransactionStatus { public: TransactionStatus(): - countsForBalance(false), sortKey(""), - matures_in(0), status(Offline), hasConflicting(false), depth(0), open_for(0), cur_num_blocks(-1), + countsForBalance(false), + sortKey(""), + matures_in(0), + status(Offline), + hasConflicting(false), + depth(0), + open_for(0), + cur_num_blocks(-1), cur_num_conflicts(-1) - { } + { + } enum Status { Confirmed, /**< Have 6 or more confirmations (normal tx) or fully mature (mined tx) **/ diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index eb5c3abdbc..d7f4c043cf 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -538,9 +538,9 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const case Qt::TextAlignmentRole: return column_alignments[index.column()]; case Qt::BackgroundColorRole: - if (rec->status.hasConflicting) + if (rec->status.hasConflicting) return COLOR_HASCONFLICTING_BG; - break; + break; case Qt::ForegroundRole: if (rec->status.hasConflicting) return COLOR_HASCONFLICTING; diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 3d6f2ab9ba..defc815def 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -138,13 +138,13 @@ void WalletModel::checkBalanceChanged() void WalletModel::updateTransaction(const QString &hash, int status) { - if (status == CT_GOT_CONFLICT) - { - emit message(tr("Conflict Received"), - tr("WARNING: Transaction may never be confirmed. Its input was seen being spent by another transaction on the network. Wait for confirmation!"), - CClientUIInterface::MSG_WARNING); - return; - } + if (status == CT_GOT_CONFLICT) + { + emit message(tr("Conflict Received"), + tr("WARNING: Transaction may never be confirmed. Its input was seen being spent by another transaction on the network. Wait for confirmation!"), + CClientUIInterface::MSG_WARNING); + return; + } if(transactionTableModel) transactionTableModel->updateTransaction(hash, status); diff --git a/src/wallet.cpp b/src/wallet.cpp index 91910c6ea9..daca7ac04b 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -637,7 +637,7 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl bool fIsConflicting = IsConflicting(tx); if (fIsConflicting) - nConflictsReceived++; + nConflictsReceived++; if (fExisted || IsMine(tx) || IsFromMe(tx) || fIsConflicting) { From 0dd5d3a00906d8a0f16d6eac62b63c9bb2da1391 Mon Sep 17 00:00:00 2001 From: R E Broadley Date: Tue, 1 Apr 2014 13:02:04 +0800 Subject: [PATCH 0266/1288] Show only one zero instead of many when getblocks request received with a hashStop of uint256(0) --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index d86fd3a24d..590714b1fc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3652,7 +3652,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) if (pindex) pindex = chainActive.Next(pindex); int nLimit = 500; - LogPrint("net", "getblocks %d to %s limit %d\n", (pindex ? pindex->nHeight : -1), hashStop.ToString(), nLimit); + LogPrint("net", "getblocks %d to %s limit %d\n", (pindex ? pindex->nHeight : -1), hashStop==uint256(0) ? "end" : hashStop.ToString(), nLimit); for (; pindex; pindex = chainActive.Next(pindex)) { if (pindex->GetBlockHash() == hashStop) From 6ecf3edfee13f47a920ea6ea7b42b96d0bbbd5fd Mon Sep 17 00:00:00 2001 From: R E Broadley Date: Fri, 27 Jun 2014 11:03:24 +0700 Subject: [PATCH 0267/1288] Display unknown commands received. --- src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.cpp b/src/main.cpp index d86fd3a24d..3ffdd63923 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4041,6 +4041,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) else { // Ignore unknown commands for extensibility + LogPrint("net", "Unknown command \"%s\" from peer=%d\n", SanitizeString(strCommand), pfrom->id); } From 3f1ea918a87f7d4cbb6a4e7504e284365e66902e Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Sat, 28 Jun 2014 14:38:37 +0800 Subject: [PATCH 0268/1288] doc: Add historical release notes for 0.9.2 Also includes 0.9.2.1 --- doc/release-notes/release-notes-0.9.2.1.md | 207 +++++++++++++++++++++ doc/release-notes/release-notes-0.9.2.md | 207 +++++++++++++++++++++ 2 files changed, 414 insertions(+) create mode 100644 doc/release-notes/release-notes-0.9.2.1.md create mode 100644 doc/release-notes/release-notes-0.9.2.md diff --git a/doc/release-notes/release-notes-0.9.2.1.md b/doc/release-notes/release-notes-0.9.2.1.md new file mode 100644 index 0000000000..3168ad1a5a --- /dev/null +++ b/doc/release-notes/release-notes-0.9.2.1.md @@ -0,0 +1,207 @@ +Bitcoin Core version 0.9.2.1 is now available from: + + https://bitcoin.org/bin/0.9.2.1/ + +This is a new minor version release, bringing mostly bug fixes and some minor +improvements. OpenSSL has been updated because of a security issue (CVE-2014-0224). +Upgrading to this release is recommended. + +Please report bugs using the issue tracker at github: + + https://github.com/bitcoin/bitcoin/issues + +How to Upgrade +-------------- + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes for older versions), then run the +installer (on Windows) or just copy over /Applications/Bitcoin-Qt (on Mac) or +bitcoind/bitcoin-qt (on Linux). + +If you are upgrading from version 0.7.2 or earlier, the first time you run +0.9.2.1 your blockchain files will be re-indexed, which will take anywhere from +30 minutes to several hours, depending on the speed of your machine. + +Downgrading warnings +-------------------- + +The 'chainstate' for this release is not always compatible with previous +releases, so if you run 0.9.x and then decide to switch back to a +0.8.x release you might get a blockchain validation error when starting the +old release (due to 'pruned outputs' being omitted from the index of +unspent transaction outputs). + +Running the old release with the -reindex option will rebuild the chainstate +data structures and correct the problem. + +Also, the first time you run a 0.8.x release on a 0.9 wallet it will rescan +the blockchain for missing spent coins, which will take a long time (tens +of minutes on a typical machine). + +Important changes +================== + +Gitian OSX build +----------------- + +The deterministic build system that was already used for Windows and Linux +builds is now used for OSX as well. Although the resulting executables have +been tested quite a bit, there could be possible regressions. Be sure to report +these on the Github bug tracker mentioned above. + +Compatibility of Linux build +----------------------------- + +For Linux we now build against Qt 4.6, and filter the symbols for libstdc++ and glibc. +This brings back compatibility with + +- Debian 6+ / Tails +- Ubuntu 10.04 +- CentOS 6.5 + +0.9.2 - 0.9.2.1 Release notes +======================= + +The OpenSSL dependency in the gitian builds has been upgraded to 1.0.1h because of CVE-2014-0224. + +RPC: + +- Add `getwalletinfo`, `getblockchaininfo` and `getnetworkinfo` calls (will replace hodge-podge `getinfo` at some point) +- Add a `relayfee` field to `getnetworkinfo` +- Fix RPC related shutdown hangs and leaks +- Always show syncnode in `getpeerinfo` +- `sendrawtransaction`: report the reject code and reason, and make it possible to re-send transactions that are already in the mempool +- `getmininginfo` show right genproclimit + +Command-line options: + +- Fix `-printblocktree` output +- Show error message if ReadConfigFile fails + +Block-chain handling and storage: + +- Fix for GetBlockValue() after block 13,440,000 (BIP42) +- Upgrade leveldb to 1.17 + +Protocol and network code: + +- Per-peer block download tracking and stalled download detection +- Add new DNS seed from bitnodes.io +- Prevent socket leak in ThreadSocketHandler and correct some proxy related socket leaks +- Use pnode->nLastRecv as sync score (was the wrong way around) + +Wallet: + +- Make GetAvailableCredit run GetHash() only once per transaction (performance improvement) +- Lower paytxfee warning threshold from 0.25 BTC to 0.01 BTC +- Fix importwallet nTimeFirstKey (trigger necessary rescans) +- Log BerkeleyDB version at startup +- CWallet init fix + +Build system: + +- Add OSX build descriptors to gitian +- Fix explicit --disable-qt-dbus +- Don't require db_cxx.h when compiling with wallet disabled and GUI enabled +- Improve missing boost error reporting +- Upgrade miniupnpc version to 1.9 +- gitian-linux: --enable-glibc-back-compat for binary compatibility with old distributions +- gitian: don't export any symbols from executable +- gitian: build against Qt 4.6 +- devtools: add script to check symbols from Linux gitian executables +- Remove build-time no-IPv6 setting + +GUI: + +- Fix various coin control visual issues +- Show number of in/out connections in debug console +- Show weeks as well as years behind for long timespans behind +- Enable and disable the Show and Remove buttons for requested payments history based on whether any entry is selected. +- Show also value for options overridden on command line in options dialog +- Fill in label from address book also for URIs +- Fixes feel when resizing the last column on tables (issue #2862) +- Fix ESC in disablewallet mode +- Add expert section to wallet tab in optionsdialog +- Do proper boost::path conversion (fixes unicode in datadir) +- Only override -datadir if different from the default (fixes -datadir in config file) +- Show rescan progress at start-up +- Show importwallet progress +- Get required locks upfront in polling functions (avoids hanging on locks) +- Catch Windows shutdown events while client is running +- Optionally add third party links to transaction context menu +- Check for !pixmap() before trying to export QR code (avoids crashes when no QR code could be generated) +- Fix "Start bitcoin on system login" + +Miscellaneous: + +- Replace non-threadsafe C functions (gmtime, strerror and setlocale) +- Add missing cs_main and wallet locks +- Avoid exception at startup when system locale not recognized +- Changed bitrpc.py's raw_input to getpass for passwords to conceal characters during command line input +- devtools: add a script to fetch and postprocess translations + +Credits +-------- + +Thanks to everyone who contributed to this release: + +- Addy Yeow +- Altoidnerd +- Andrea D'Amore +- Andreas Schildbach +- Bardi Harborow +- Brandon Dahler +- Bryan Bishop +- Chris Beams +- Christian von Roques +- Cory Fields +- Cozz Lovan +- daniel +- Daniel Newton +- David A. Harding +- ditto-b +- duanemoody +- Eric S. Bullington +- Fabian Raetz +- Gavin Andresen +- Gregory Maxwell +- gubatron +- Haakon Nilsen +- harry +- Hector Jusforgues +- Isidoro Ghezzi +- Jeff Garzik +- Johnathan Corgan +- jtimon +- Kamil Domanski +- langerhans +- Luke Dashjr +- Manuel Araoz +- Mark Friedenbach +- Matt Corallo +- Matthew Bogosian +- Meeh +- Michael Ford +- Michagogo +- Mikael Wikman +- Mike Hearn +- olalonde +- paveljanik +- peryaudo +- Philip Kaufmann +- philsong +- Pieter Wuille +- R E Broadley +- richierichrawr +- Rune K. Svendsen +- rxl +- shshshsh +- Simon de la Rouviere +- Stuart Cardall +- super3 +- Telepatheic +- Thomas Zander +- Torstein Husebø +- Warren Togami +- Wladimir J. van der Laan +- Yoichi Hirai diff --git a/doc/release-notes/release-notes-0.9.2.md b/doc/release-notes/release-notes-0.9.2.md new file mode 100644 index 0000000000..a2749e549f --- /dev/null +++ b/doc/release-notes/release-notes-0.9.2.md @@ -0,0 +1,207 @@ +Bitcoin Core version 0.9.2 is now available from: + + https://bitcoin.org/bin/0.9.2/ + +This is a new minor version release, bringing mostly bug fixes and some minor +improvements. OpenSSL has been updated because of a security issue (CVE-2014-0224). +Upgrading to this release is recommended. + +Please report bugs using the issue tracker at github: + + https://github.com/bitcoin/bitcoin/issues + +How to Upgrade +-------------- + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes for older versions), then run the +installer (on Windows) or just copy over /Applications/Bitcoin-Qt (on Mac) or +bitcoind/bitcoin-qt (on Linux). + +If you are upgrading from version 0.7.2 or earlier, the first time you run +0.9.2 your blockchain files will be re-indexed, which will take anywhere from +30 minutes to several hours, depending on the speed of your machine. + +Downgrading warnings +-------------------- + +The 'chainstate' for this release is not always compatible with previous +releases, so if you run 0.9.x and then decide to switch back to a +0.8.x release you might get a blockchain validation error when starting the +old release (due to 'pruned outputs' being omitted from the index of +unspent transaction outputs). + +Running the old release with the -reindex option will rebuild the chainstate +data structures and correct the problem. + +Also, the first time you run a 0.8.x release on a 0.9 wallet it will rescan +the blockchain for missing spent coins, which will take a long time (tens +of minutes on a typical machine). + +Important changes +================== + +Gitian OSX build +----------------- + +The deterministic build system that was already used for Windows and Linux +builds is now used for OSX as well. Although the resulting executables have +been tested quite a bit, there could be possible regressions. Be sure to report +these on the Github bug tracker mentioned above. + +Compatibility of Linux build +----------------------------- + +For Linux we now build against Qt 4.6, and filter the symbols for libstdc++ and glibc. +This brings back compatibility with + +- Debian 6+ / Tails +- Ubuntu 10.04 +- CentOS 6.5 + +0.9.2 Release notes +======================= + +The OpenSSL dependency in the gitian builds has been upgraded to 1.0.1h because of CVE-2014-0224. + +RPC: + +- Add `getwalletinfo`, `getblockchaininfo` and `getnetworkinfo` calls (will replace hodge-podge `getinfo` at some point) +- Add a `relayfee` field to `getnetworkinfo` +- Fix RPC related shutdown hangs and leaks +- Always show syncnode in `getpeerinfo` +- `sendrawtransaction`: report the reject code and reason, and make it possible to re-send transactions that are already in the mempool +- `getmininginfo` show right genproclimit + +Command-line options: + +- Fix `-printblocktree` output +- Show error message if ReadConfigFile fails + +Block-chain handling and storage: + +- Fix for GetBlockValue() after block 13,440,000 (BIP42) +- Upgrade leveldb to 1.17 + +Protocol and network code: + +- Per-peer block download tracking and stalled download detection +- Add new DNS seed from bitnodes.io +- Prevent socket leak in ThreadSocketHandler and correct some proxy related socket leaks +- Use pnode->nLastRecv as sync score (was the wrong way around) + +Wallet: + +- Make GetAvailableCredit run GetHash() only once per transaction (performance improvement) +- Lower paytxfee warning threshold from 0.25 BTC to 0.01 BTC +- Fix importwallet nTimeFirstKey (trigger necessary rescans) +- Log BerkeleyDB version at startup +- CWallet init fix + +Build system: + +- Add OSX build descriptors to gitian +- Fix explicit --disable-qt-dbus +- Don't require db_cxx.h when compiling with wallet disabled and GUI enabled +- Improve missing boost error reporting +- Upgrade miniupnpc version to 1.9 +- gitian-linux: --enable-glibc-back-compat for binary compatibility with old distributions +- gitian: don't export any symbols from executable +- gitian: build against Qt 4.6 +- devtools: add script to check symbols from Linux gitian executables +- Remove build-time no-IPv6 setting + +GUI: + +- Fix various coin control visual issues +- Show number of in/out connections in debug console +- Show weeks as well as years behind for long timespans behind +- Enable and disable the Show and Remove buttons for requested payments history based on whether any entry is selected. +- Show also value for options overridden on command line in options dialog +- Fill in label from address book also for URIs +- Fixes feel when resizing the last column on tables (issue #2862) +- Fix ESC in disablewallet mode +- Add expert section to wallet tab in optionsdialog +- Do proper boost::path conversion (fixes unicode in datadir) +- Only override -datadir if different from the default (fixes -datadir in config file) +- Show rescan progress at start-up +- Show importwallet progress +- Get required locks upfront in polling functions (avoids hanging on locks) +- Catch Windows shutdown events while client is running +- Optionally add third party links to transaction context menu +- Check for !pixmap() before trying to export QR code (avoids crashes when no QR code could be generated) +- Fix "Start bitcoin on system login" + +Miscellaneous: + +- Replace non-threadsafe C functions (gmtime, strerror and setlocale) +- Add missing cs_main and wallet locks +- Avoid exception at startup when system locale not recognized +- Changed bitrpc.py's raw_input to getpass for passwords to conceal characters during command line input +- devtools: add a script to fetch and postprocess translations + +Credits +-------- + +Thanks to everyone who contributed to this release: + +- Addy Yeow +- Altoidnerd +- Andrea D'Amore +- Andreas Schildbach +- Bardi Harborow +- Brandon Dahler +- Bryan Bishop +- Chris Beams +- Christian von Roques +- Cory Fields +- Cozz Lovan +- daniel +- Daniel Newton +- David A. Harding +- ditto-b +- duanemoody +- Eric S. Bullington +- Fabian Raetz +- Gavin Andresen +- Gregory Maxwell +- gubatron +- Haakon Nilsen +- harry +- Hector Jusforgues +- Isidoro Ghezzi +- Jeff Garzik +- Johnathan Corgan +- jtimon +- Kamil Domanski +- langerhans +- Luke Dashjr +- Manuel Araoz +- Mark Friedenbach +- Matt Corallo +- Matthew Bogosian +- Meeh +- Michael Ford +- Michagogo +- Mikael Wikman +- Mike Hearn +- olalonde +- paveljanik +- peryaudo +- Philip Kaufmann +- philsong +- Pieter Wuille +- R E Broadley +- richierichrawr +- Rune K. Svendsen +- rxl +- shshshsh +- Simon de la Rouviere +- Stuart Cardall +- super3 +- Telepatheic +- Thomas Zander +- Torstein Husebø +- Warren Togami +- Wladimir J. van der Laan +- Yoichi Hirai From 92ddf2c0dd59de514337381999c392f35c1cdf1b Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Sat, 28 Jun 2014 16:43:07 +0800 Subject: [PATCH 0269/1288] Update OS X build instructions Update OpenSSL version Homebrew is now the preferred dependancy manager --- doc/build-osx.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/doc/build-osx.md b/doc/build-osx.md index 0de5c792e9..1e38326d86 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -22,7 +22,7 @@ Xcode 4.3 or later, you'll need to install its command line tools. This can be done in `Xcode > Preferences > Downloads > Components` and generally must be re-done or updated every time Xcode is updated. -There's an assumption that you already have `git` installed, as well. If +There's also an assumption that you already have `git` installed. If not, it's the path of least resistance to install [Github for Mac](https://mac.github.com/) (OS X 10.7+) or [Git for OS X](https://code.google.com/p/git-osx-installer/). It is also @@ -30,11 +30,8 @@ available via Homebrew or MacPorts. You will also need to install [Homebrew](http://brew.sh) or [MacPorts](https://www.macports.org/) in order to install library -dependencies. It's largely a religious decision which to choose, but, as of -December 2012, MacPorts is a little easier because you can just install the -dependencies immediately - no other work required. If you're unsure, read -the instructions through first in order to assess what you want to do. -Homebrew is a little more popular among those newer to OS X. +dependencies. It's largely a religious decision which to choose, however, Homebrew +is now used for building release versions. The installation of the actual dependencies is covered in the Instructions sections below. @@ -44,8 +41,6 @@ Instructions: MacPorts ### Install dependencies -Installing the dependencies using MacPorts is very straightforward. - sudo port install boost db48@+no_java openssl miniupnpc autoconf pkgconfig automake Optional: install Qt4 @@ -80,7 +75,7 @@ Note: After you have installed the dependencies, you should check that the Homeb openssl version -into Terminal. You should see OpenSSL 1.0.1f 6 Jan 2014. +into Terminal. You should see OpenSSL 1.0.1h 5 Jun 2014. If not, you can ensure that the Homebrew OpenSSL is correctly linked by running @@ -103,7 +98,7 @@ PATH. ./configure make -3. It is a good idea to build and run the unit tests, too: +3. It is also a good idea to build and run the unit tests: make check @@ -131,7 +126,7 @@ For MacPorts, that means editing your macports.conf and setting ... and then uninstalling and re-installing, or simply rebuilding, all ports. As of December 2012, the `boost` port does not obey `macosx_deployment_target`. -Download `http://gavinandresen-bitcoin.s3.amazonaws.com/boost_macports_fix.zip` +Download `https://gavinandresen-bitcoin.s3.amazonaws.com/boost_macports_fix.zip` for a fix. Once dependencies are compiled, see release-process.md for how the Bitcoin-Qt.app @@ -149,13 +144,14 @@ commands: echo -e "rpcuser=bitcoinrpc\nrpcpassword=$(xxd -l 16 -p /dev/urandom)" > "/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf" chmod 600 "/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf" -When next you run it, it will start downloading the blockchain, but it won't +The next time you run it, it will start downloading the blockchain, but it won't output anything while it's doing this. This process may take several hours; you can monitor its process by looking at the debug.log file, like this: tail -f $HOME/Library/Application\ Support/Bitcoin/debug.log Other commands: +------- ./bitcoind -daemon # to start the bitcoin daemon. ./bitcoin-cli --help # for a list of command-line options. From 645d497aa0010525441ce409e8e6d327a157ab39 Mon Sep 17 00:00:00 2001 From: jtimon Date: Fri, 27 Jun 2014 13:28:08 +0200 Subject: [PATCH 0270/1288] Replace HexBits with strprintf --- src/rpcblockchain.cpp | 2 +- src/rpcmining.cpp | 2 +- src/rpcserver.cpp | 10 ---------- src/rpcserver.h | 1 - 4 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 580c6bd5ba..a67f266a13 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -66,7 +66,7 @@ Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex) result.push_back(Pair("tx", txs)); result.push_back(Pair("time", block.GetBlockTime())); result.push_back(Pair("nonce", (uint64_t)block.nNonce)); - result.push_back(Pair("bits", HexBits(block.nBits))); + result.push_back(Pair("bits", strprintf("%08x", block.nBits))); result.push_back(Pair("difficulty", GetDifficulty(blockindex))); result.push_back(Pair("chainwork", blockindex->nChainWork.GetHex())); diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 98caf704ee..db60ef3592 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -443,7 +443,7 @@ Value getblocktemplate(const Array& params, bool fHelp) result.push_back(Pair("sigoplimit", (int64_t)MAX_BLOCK_SIGOPS)); result.push_back(Pair("sizelimit", (int64_t)MAX_BLOCK_SIZE)); result.push_back(Pair("curtime", (int64_t)pblock->nTime)); - result.push_back(Pair("bits", HexBits(pblock->nBits))); + result.push_back(Pair("bits", strprintf("%08x", pblock->nBits))); result.push_back(Pair("height", (int64_t)(pindexPrev->nHeight+1))); return result; diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 54043458d5..6a87c8bf99 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -97,16 +97,6 @@ Value ValueFromAmount(int64_t amount) return (double)amount / (double)COIN; } -std::string HexBits(unsigned int nBits) -{ - union { - int32_t nBits; - char cBits[4]; - } uBits; - uBits.nBits = htonl((int32_t)nBits); - return HexStr(BEGIN(uBits.cBits), END(uBits.cBits)); -} - uint256 ParseHashV(const Value& v, string strName) { string strHex; diff --git a/src/rpcserver.h b/src/rpcserver.h index fcd293663f..01e77163c4 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -116,7 +116,6 @@ extern int64_t nWalletUnlockTime; extern int64_t AmountFromValue(const json_spirit::Value& value); extern json_spirit::Value ValueFromAmount(int64_t amount); extern double GetDifficulty(const CBlockIndex* blockindex = NULL); -extern std::string HexBits(unsigned int nBits); extern std::string HelpRequiringPassphrase(); extern std::string HelpExampleCli(std::string methodname, std::string args); extern std::string HelpExampleRpc(std::string methodname, std::string args); From d618965eb8163544d97a213b1c0e3f629c59669b Mon Sep 17 00:00:00 2001 From: Drak Date: Sat, 28 Jun 2014 12:41:19 +0100 Subject: [PATCH 0271/1288] Add note about PPA to build instructions --- doc/build-unix.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/build-unix.md b/doc/build-unix.md index 9d4b662d07..0f381d56c5 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -91,7 +91,7 @@ To enable the change run sudo apt-get update -for other Ubuntu & Debian: +for other Debian & Ubuntu (with ppa): sudo apt-get install libdb4.8-dev libdb4.8++-dev From 675bcd5892bc6f8997e999fb2c7a7e70e449063e Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Sat, 28 Jun 2014 20:57:46 +0800 Subject: [PATCH 0272/1288] Correct comment for 15-of-15 p2sh script size The original comment forgets to account for the script push which will need an OP_PUSHDATA2 + 2-bytes for the 513 script bytes. props davecgh fixes #4224 --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 590714b1fc..86f9a04a3d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -488,7 +488,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) // Treat non-final transactions as non-standard to prevent a specific type // of double-spend attack, as well as DoS attacks. (if the transaction // can't be mined, the attacker isn't expending resources broadcasting it) - // Basically we don't want to propagate transactions that can't included in + // Basically we don't want to propagate transactions that can't be included in // the next block. // // However, IsFinalTx() is confusing... Without arguments, it uses @@ -521,7 +521,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) { // Biggest 'standard' txin is a 15-of-15 P2SH multisig with compressed // keys. (remember the 520 byte limit on redeemScript size) That works - // out to a (15*(33+1))+3=513 byte redeemScript, 513+1+15*(73+1)=1624 + // out to a (15*(33+1))+3=513 byte redeemScript, 513+1+15*(73+1)+3=1627 // bytes of scriptSig, which we round off to 1650 bytes for some minor // future-proofing. That's also enough to spend a 20-of-20 // CHECKMULTISIG scriptPubKey, though such a scriptPubKey is not From de79aaa7a9ad07664461ee8735299aa68c630969 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 28 Jun 2014 17:35:22 +0200 Subject: [PATCH 0273/1288] Move non-trivial uint256.h methods to uint256.cpp --- src/Makefile.am | 1 + src/uint256.cpp | 292 ++++++++++++++++++++++++++++++++++++++++++++++++ src/uint256.h | 262 +++---------------------------------------- src/util.cpp | 5 + src/util.h | 1 + 5 files changed, 316 insertions(+), 245 deletions(-) create mode 100644 src/uint256.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 3643e60201..9c7b294d35 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -192,6 +192,7 @@ libbitcoin_util_a_SOURCES = \ chainparamsbase.cpp \ rpcprotocol.cpp \ sync.cpp \ + uint256.cpp \ util.cpp \ version.cpp \ compat/glibc_sanity.cpp \ diff --git a/src/uint256.cpp b/src/uint256.cpp new file mode 100644 index 0000000000..3392f1e9bc --- /dev/null +++ b/src/uint256.cpp @@ -0,0 +1,292 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "uint256.h" +#include "util.h" + +#include +#include + +template +base_uint::base_uint(const std::string& str) +{ + SetHex(str); +} + +template +base_uint::base_uint(const std::vector& vch) +{ + if (vch.size() != sizeof(pn)) + throw uint_error("Converting vector of wrong size to base_uint"); + memcpy(pn, &vch[0], sizeof(pn)); +} + +template +base_uint& base_uint::operator<<=(unsigned int shift) +{ + base_uint a(*this); + for (int i = 0; i < WIDTH; i++) + pn[i] = 0; + int k = shift / 32; + shift = shift % 32; + for (int i = 0; i < WIDTH; i++) { + if (i+k+1 < WIDTH && shift != 0) + pn[i+k+1] |= (a.pn[i] >> (32-shift)); + if (i+k < WIDTH) + pn[i+k] |= (a.pn[i] << shift); + } + return *this; +} + +template +base_uint& base_uint::operator>>=(unsigned int shift) +{ + base_uint a(*this); + for (int i = 0; i < WIDTH; i++) + pn[i] = 0; + int k = shift / 32; + shift = shift % 32; + for (int i = 0; i < WIDTH; i++) { + if (i-k-1 >= 0 && shift != 0) + pn[i-k-1] |= (a.pn[i] << (32-shift)); + if (i-k >= 0) + pn[i-k] |= (a.pn[i] >> shift); + } + return *this; +} + +template +base_uint& base_uint::operator*=(uint32_t b32) +{ + uint64_t carry = 0; + for (int i = 0; i < WIDTH; i++) { + uint64_t n = carry + (uint64_t)b32 * pn[i]; + pn[i] = n & 0xffffffff; + carry = n >> 32; + } + return *this; +} + +template +base_uint& base_uint::operator*=(const base_uint& b) +{ + base_uint a = *this; + *this = 0; + for (int j = 0; j < WIDTH; j++) { + uint64_t carry = 0; + for (int i = 0; i + j < WIDTH; i++) { + uint64_t n = carry + pn[i + j] + (uint64_t)a.pn[j] * b.pn[i]; + pn[i + j] = n & 0xffffffff; + carry = n >> 32; + } + } + return *this; +} + +template +base_uint& base_uint::operator/=(const base_uint& b) +{ + base_uint div = b; // make a copy, so we can shift. + base_uint num = *this; // make a copy, so we can subtract. + *this = 0; // the quotient. + int num_bits = num.bits(); + int div_bits = div.bits(); + if (div_bits == 0) + throw uint_error("Division by zero"); + if (div_bits > num_bits) // the result is certainly 0. + return *this; + int shift = num_bits - div_bits; + div <<= shift; // shift so that div and nun align. + while (shift >= 0) { + if (num >= div) { + num -= div; + pn[shift / 32] |= (1 << (shift & 31)); // set a bit of the result. + } + div >>= 1; // shift back. + shift--; + } + // num now contains the remainder of the division. + return *this; +} + +template +int base_uint::CompareTo(const base_uint& b) const { + for (int i = WIDTH-1; i >= 0; i--) { + if (pn[i] < b.pn[i]) + return -1; + if (pn[i] > b.pn[i]) + return 1; + } + return 0; +} + +template +bool base_uint::EqualTo(uint64_t b) const { + for (int i = WIDTH-1; i >= 2; i--) { + if (pn[i]) + return false; + } + if (pn[1] != (b >> 32)) + return false; + if (pn[0] != (b & 0xfffffffful)) + return false; + return true; +} + +template +double base_uint::getdouble() const +{ + double ret = 0.0; + double fact = 1.0; + for (int i = 0; i < WIDTH; i++) { + ret += fact * pn[i]; + fact *= 4294967296.0; + } + return ret; +} + +template +std::string base_uint::GetHex() const +{ + char psz[sizeof(pn)*2 + 1]; + for (unsigned int i = 0; i < sizeof(pn); i++) + sprintf(psz + i*2, "%02x", ((unsigned char*)pn)[sizeof(pn) - i - 1]); + return std::string(psz, psz + sizeof(pn)*2); +} + +template +void base_uint::SetHex(const char* psz) +{ + memset(pn,0,sizeof(pn)); + + // skip leading spaces + while (isspace(*psz)) + psz++; + + // skip 0x + if (psz[0] == '0' && tolower(psz[1]) == 'x') + psz += 2; + + // hex string to uint + const char* pbegin = psz; + while (::HexDigit(*psz) != -1) + psz++; + psz--; + unsigned char* p1 = (unsigned char*)pn; + unsigned char* pend = p1 + WIDTH * 4; + while (psz >= pbegin && p1 < pend) { + *p1 = ::HexDigit(*psz--); + if (psz >= pbegin) { + *p1 |= ((unsigned char)::HexDigit(*psz--) << 4); + p1++; + } + } +} + +template +void base_uint::SetHex(const std::string& str) +{ + SetHex(str.c_str()); +} + +template +std::string base_uint::ToString() const +{ + return (GetHex()); +} + +template +unsigned int base_uint::bits() const +{ + for (int pos = WIDTH-1; pos >= 0; pos--) { + if (pn[pos]) { + for (int bits = 31; bits > 0; bits--) { + if (pn[pos] & 1< +template base_uint<160>::base_uint(const std::string&); +template base_uint<160>::base_uint(const std::vector&); +template base_uint<160>& base_uint<160>::operator<<=(unsigned int); +template base_uint<160>& base_uint<160>::operator>>=(unsigned int); +template base_uint<160>& base_uint<160>::operator*=(uint32_t b32); +template base_uint<160>& base_uint<160>::operator*=(const base_uint<160>& b); +template base_uint<160>& base_uint<160>::operator/=(const base_uint<160>& b); +template int base_uint<160>::CompareTo(const base_uint<160>&) const; +template bool base_uint<160>::EqualTo(uint64_t) const; +template double base_uint<160>::getdouble() const; +template std::string base_uint<160>::GetHex() const; +template std::string base_uint<160>::ToString() const; +template void base_uint<160>::SetHex(const char*); +template void base_uint<160>::SetHex(const std::string&); +template unsigned int base_uint<160>::bits() const; + +// Explicit instantiations for base_uint<256> +template base_uint<256>::base_uint(const std::string&); +template base_uint<256>::base_uint(const std::vector&); +template base_uint<256>& base_uint<256>::operator<<=(unsigned int); +template base_uint<256>& base_uint<256>::operator>>=(unsigned int); +template base_uint<256>& base_uint<256>::operator*=(uint32_t b32); +template base_uint<256>& base_uint<256>::operator*=(const base_uint<256>& b); +template base_uint<256>& base_uint<256>::operator/=(const base_uint<256>& b); +template int base_uint<256>::CompareTo(const base_uint<256>&) const; +template bool base_uint<256>::EqualTo(uint64_t) const; +template double base_uint<256>::getdouble() const; +template std::string base_uint<256>::GetHex() const; +template std::string base_uint<256>::ToString() const; +template void base_uint<256>::SetHex(const char*); +template void base_uint<256>::SetHex(const std::string&); +template unsigned int base_uint<256>::bits() const; + +// This implementation directly uses shifts instead of going +// through an intermediate MPI representation. +uint256& uint256::SetCompact(uint32_t nCompact, bool *pfNegative, bool *pfOverflow) +{ + int nSize = nCompact >> 24; + uint32_t nWord = nCompact & 0x007fffff; + if (nSize <= 3) { + nWord >>= 8*(3-nSize); + *this = nWord; + } else { + *this = nWord; + *this <<= 8*(nSize-3); + } + if (pfNegative) + *pfNegative = nWord != 0 && (nCompact & 0x00800000) != 0; + if (pfOverflow) + *pfOverflow = nWord != 0 && ((nSize > 34) || + (nWord > 0xff && nSize > 33) || + (nWord > 0xffff && nSize > 32)); + return *this; +} + +uint32_t uint256::GetCompact(bool fNegative) const +{ + int nSize = (bits() + 7) / 8; + uint32_t nCompact = 0; + if (nSize <= 3) { + nCompact = GetLow64() << 8*(3-nSize); + } else { + uint256 bn = *this >> 8*(nSize-3); + nCompact = bn.GetLow64(); + } + // The 0x00800000 bit denotes the sign. + // Thus, if it is already set, divide the mantissa by 256 and increase the exponent. + if (nCompact & 0x00800000) { + nCompact >>= 8; + nSize++; + } + assert((nCompact & ~0x007fffff) == 0); + assert(nSize < 256); + nCompact |= nSize << 24; + nCompact |= (fNegative && (nCompact & 0x007fffff) ? 0x00800000 : 0); + return nCompact; +} diff --git a/src/uint256.h b/src/uint256.h index 1acedd14bf..82db7758c9 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -9,18 +9,9 @@ #include #include #include -#include #include -#include #include -extern const signed char p_util_hexdigit[256]; // defined in util.cpp - -inline signed char HexDigit(char c) -{ - return p_util_hexdigit[(unsigned char)c]; -} - class uint_error : public std::runtime_error { public: explicit uint_error(const std::string& str) : std::runtime_error(str) {} @@ -62,17 +53,8 @@ public: pn[i] = 0; } - explicit base_uint(const std::string& str) - { - SetHex(str); - } - - explicit base_uint(const std::vector& vch) - { - if (vch.size() != sizeof(pn)) - throw uint_error("Converting vector of wrong size to base_uint"); - memcpy(pn, &vch[0], sizeof(pn)); - } + explicit base_uint(const std::string& str); + explicit base_uint(const std::vector& vch); bool operator!() const { @@ -99,16 +81,7 @@ public: return ret; } - double getdouble() const - { - double ret = 0.0; - double fact = 1.0; - for (int i = 0; i < WIDTH; i++) { - ret += fact * pn[i]; - fact *= 4294967296.0; - } - return ret; - } + double getdouble() const; base_uint& operator=(uint64_t b) { @@ -154,39 +127,8 @@ public: return *this; } - base_uint& operator<<=(unsigned int shift) - { - base_uint a(*this); - for (int i = 0; i < WIDTH; i++) - pn[i] = 0; - int k = shift / 32; - shift = shift % 32; - for (int i = 0; i < WIDTH; i++) - { - if (i+k+1 < WIDTH && shift != 0) - pn[i+k+1] |= (a.pn[i] >> (32-shift)); - if (i+k < WIDTH) - pn[i+k] |= (a.pn[i] << shift); - } - return *this; - } - - base_uint& operator>>=(unsigned int shift) - { - base_uint a(*this); - for (int i = 0; i < WIDTH; i++) - pn[i] = 0; - int k = shift / 32; - shift = shift % 32; - for (int i = 0; i < WIDTH; i++) - { - if (i-k-1 >= 0 && shift != 0) - pn[i-k-1] |= (a.pn[i] << (32-shift)); - if (i-k >= 0) - pn[i-k] |= (a.pn[i] >> shift); - } - return *this; - } + base_uint& operator<<=(unsigned int shift); + base_uint& operator>>=(unsigned int shift); base_uint& operator+=(const base_uint& b) { @@ -222,57 +164,9 @@ public: return *this; } - base_uint& operator*=(uint32_t b32) - { - uint64_t carry = 0; - for (int i = 0; i < WIDTH; i++) - { - uint64_t n = carry + (uint64_t)b32 * pn[i]; - pn[i] = n & 0xffffffff; - carry = n >> 32; - } - return *this; - } - - base_uint& operator*=(const base_uint& b) - { - base_uint a = *this; - *this = 0; - for (int j = 0; j < WIDTH; j++) { - uint64_t carry = 0; - for (int i = 0; i + j < WIDTH; i++) { - uint64_t n = carry + pn[i + j] + (uint64_t)a.pn[j] * b.pn[i]; - pn[i + j] = n & 0xffffffff; - carry = n >> 32; - } - } - return *this; - } - - base_uint& operator/=(const base_uint& b) - { - base_uint div = b; // make a copy, so we can shift. - base_uint num = *this; // make a copy, so we can subtract. - *this = 0; // the quotient. - int num_bits = num.bits(); - int div_bits = div.bits(); - if (div_bits == 0) - throw uint_error("Division by zero"); - if (div_bits > num_bits) // the result is certainly 0. - return *this; - int shift = num_bits - div_bits; - div <<= shift; // shift so that div and nun align. - while (shift >= 0) { - if (num >= div) { - num -= div; - pn[shift / 32] |= (1 << (shift & 31)); // set a bit of the result. - } - div >>= 1; // shift back. - shift--; - } - // num now contains the remainder of the division. - return *this; - } + base_uint& operator*=(uint32_t b32); + base_uint& operator*=(const base_uint& b); + base_uint& operator/=(const base_uint& b); base_uint& operator++() { @@ -308,27 +202,8 @@ public: return ret; } - int CompareTo(const base_uint& b) const { - for (int i = base_uint::WIDTH-1; i >= 0; i--) { - if (pn[i] < b.pn[i]) - return -1; - if (pn[i] > b.pn[i]) - return 1; - } - return 0; - } - - bool EqualTo(uint64_t b) const { - for (int i = base_uint::WIDTH-1; i >= 2; i--) { - if (pn[i]) - return false; - } - if (pn[1] != (b >> 32)) - return false; - if (pn[0] != (b & 0xfffffffful)) - return false; - return true; - } + int CompareTo(const base_uint& b) const; + bool EqualTo(uint64_t b) const; friend inline const base_uint operator+(const base_uint& a, const base_uint& b) { return base_uint(a) += b; } friend inline const base_uint operator-(const base_uint& a, const base_uint& b) { return base_uint(a) -= b; } @@ -349,53 +224,10 @@ public: friend inline bool operator==(const base_uint& a, uint64_t b) { return a.EqualTo(b); } friend inline bool operator!=(const base_uint& a, uint64_t b) { return !a.EqualTo(b); } - std::string GetHex() const - { - char psz[sizeof(pn)*2 + 1]; - for (unsigned int i = 0; i < sizeof(pn); i++) - sprintf(psz + i*2, "%02x", ((unsigned char*)pn)[sizeof(pn) - i - 1]); - return std::string(psz, psz + sizeof(pn)*2); - } - - void SetHex(const char* psz) - { - memset(pn,0,sizeof(pn)); - - // skip leading spaces - while (isspace(*psz)) - psz++; - - // skip 0x - if (psz[0] == '0' && tolower(psz[1]) == 'x') - psz += 2; - - // hex string to uint - const char* pbegin = psz; - while (::HexDigit(*psz) != -1) - psz++; - psz--; - unsigned char* p1 = (unsigned char*)pn; - unsigned char* pend = p1 + WIDTH * 4; - while (psz >= pbegin && p1 < pend) - { - *p1 = ::HexDigit(*psz--); - if (psz >= pbegin) - { - *p1 |= ((unsigned char)::HexDigit(*psz--) << 4); - p1++; - } - } - } - - void SetHex(const std::string& str) - { - SetHex(str.c_str()); - } - - std::string ToString() const - { - return (GetHex()); - } + std::string GetHex() const; + void SetHex(const char* psz); + void SetHex(const std::string& str); + std::string ToString() const; unsigned char* begin() { @@ -424,19 +256,7 @@ public: // Returns the position of the highest bit set plus one, or zero if the // value is zero. - unsigned int bits() const - { - for (int pos = WIDTH-1; pos >= 0; pos--) { - if (pn[pos]) { - for (int bits = 31; bits > 0; bits--) { - if (pn[pos] & 1<> 24; - uint32_t nWord = nCompact & 0x007fffff; - if (nSize <= 3) - { - nWord >>= 8*(3-nSize); - *this = nWord; - } - else - { - *this = nWord; - *this <<= 8*(nSize-3); - } - if (pfNegative) - *pfNegative = nWord != 0 && (nCompact & 0x00800000) != 0; - if (pfOverflow) - *pfOverflow = nWord != 0 && ((nSize > 34) || - (nWord > 0xff && nSize > 33) || - (nWord > 0xffff && nSize > 32)); - return *this; - } - - uint32_t GetCompact(bool fNegative = false) const - { - int nSize = (bits() + 7) / 8; - uint32_t nCompact = 0; - if (nSize <= 3) - nCompact = GetLow64() << 8*(3-nSize); - else - { - uint256 bn = *this >> 8*(nSize-3); - nCompact = bn.GetLow64(); - } - // The 0x00800000 bit denotes the sign. - // Thus, if it is already set, divide the mantissa by 256 and increase the exponent. - if (nCompact & 0x00800000) - { - nCompact >>= 8; - nSize++; - } - assert((nCompact & ~0x007fffff) == 0); - assert(nSize < 256); - nCompact |= nSize << 24; - nCompact |= (fNegative && (nCompact & 0x007fffff) ? 0x00800000 : 0); - return nCompact; - } + uint256& SetCompact(uint32_t nCompact, bool *pfNegative = NULL, bool *pfOverflow = NULL); + uint32_t GetCompact(bool fNegative = false) const; }; #endif diff --git a/src/util.cpp b/src/util.cpp index 9e4b2b787e..e67c0dfd8a 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -419,6 +419,11 @@ const signed char p_util_hexdigit[256] = -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, }; +signed char HexDigit(char c) +{ + return p_util_hexdigit[(unsigned char)c]; +} + bool IsHex(const string& str) { BOOST_FOREACH(char c, str) diff --git a/src/util.h b/src/util.h index 6057c72e66..707b8f2d76 100644 --- a/src/util.h +++ b/src/util.h @@ -156,6 +156,7 @@ bool ParseMoney(const char* pszIn, int64_t& nRet); std::string SanitizeString(const std::string& str); std::vector ParseHex(const char* psz); std::vector ParseHex(const std::string& str); +signed char HexDigit(char c); bool IsHex(const std::string& str); std::vector DecodeBase64(const char* p, bool* pfInvalid = NULL); std::string DecodeBase64(const std::string& str); From 16f33f163d4e2c10320a96a22bbab71c9a0df195 Mon Sep 17 00:00:00 2001 From: kazcw Date: Sat, 28 Jun 2014 18:14:36 -0700 Subject: [PATCH 0274/1288] fix RPC error replies After pull #4288, RPC messages indicating errors have a Content-Length unrelated to their actual contents, rendering bitcoin-cli and curl unable to decode the reply. This patch sets the Content-Length field based on the actual content returned. Additionally, pull #4288 clobbered the error descriptions provided in ErrorReply, which bitcoin-cli relies upon; this patch moves #4288 http-error descriptions to an HTTPError method, allowing HTTPReply to pass content on unchanged. --- src/rpcprotocol.cpp | 42 +++++++++++++++++++++++------------------- src/rpcprotocol.h | 2 ++ src/rpcserver.cpp | 8 ++++---- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp index 2cb4a35c4b..dd8692e802 100644 --- a/src/rpcprotocol.cpp +++ b/src/rpcprotocol.cpp @@ -54,8 +54,19 @@ static string rfc1123Time() return DateTimeStrFormat("%a, %d %b %Y %H:%M:%S +0000", GetTime()); } -string HTTPReply(int nStatus, const string& strMsg, bool keepalive, - bool headersOnly, const char *contentType) +static const char *httpStatusDescription(int nStatus) +{ + switch (nStatus) { + case HTTP_OK: return "OK"; + case HTTP_BAD_REQUEST: return "Bad Request"; + case HTTP_FORBIDDEN: return "Forbidden"; + case HTTP_NOT_FOUND: return "Not Found"; + case HTTP_INTERNAL_SERVER_ERROR: return "Internal Server Error"; + default: return ""; + } +} + +string HTTPError(int nStatus, bool keepalive, bool headersOnly) { if (nStatus == HTTP_UNAUTHORIZED) return strprintf("HTTP/1.0 401 Authorization Required\r\n" @@ -75,20 +86,13 @@ string HTTPReply(int nStatus, const string& strMsg, bool keepalive, "

401 Unauthorized.

\r\n" "\r\n", rfc1123Time(), FormatFullVersion()); - const char *cStatus; - if (nStatus == HTTP_OK) cStatus = "OK"; - else if (nStatus == HTTP_BAD_REQUEST) cStatus = "Bad Request"; - else if (nStatus == HTTP_FORBIDDEN) cStatus = "Forbidden"; - else if (nStatus == HTTP_NOT_FOUND) cStatus = "Not Found"; - else if (nStatus == HTTP_INTERNAL_SERVER_ERROR) cStatus = "Internal Server Error"; - else cStatus = ""; - - bool useInternalContent = false; - if (nStatus != HTTP_OK) { - contentType = "text/plain"; - useInternalContent = true; - } + return HTTPReply(nStatus, httpStatusDescription(nStatus), keepalive, + headersOnly, "text/plain"); +} +string HTTPReply(int nStatus, const string& strMsg, bool keepalive, + bool headersOnly, const char *contentType) +{ return strprintf( "HTTP/1.1 %d %s\r\n" "Date: %s\r\n" @@ -99,14 +103,14 @@ string HTTPReply(int nStatus, const string& strMsg, bool keepalive, "\r\n" "%s", nStatus, - cStatus, + httpStatusDescription(nStatus), rfc1123Time(), keepalive ? "keep-alive" : "close", - strMsg.size(), + (headersOnly ? 0 : strMsg.size()), contentType, FormatFullVersion(), - (headersOnly ? "" : - (useInternalContent ? cStatus : strMsg.c_str()))); + (headersOnly ? "" : strMsg.c_str()) + ); } bool ReadHTTPRequestLine(std::basic_istream& stream, int &proto, diff --git a/src/rpcprotocol.h b/src/rpcprotocol.h index f1317e9c28..5627077bfb 100644 --- a/src/rpcprotocol.h +++ b/src/rpcprotocol.h @@ -141,6 +141,8 @@ private: }; std::string HTTPPost(const std::string& strMsg, const std::map& mapRequestHeaders); +std::string HTTPError(int nStatus, bool keepalive, + bool headerOnly = false); std::string HTTPReply(int nStatus, const std::string& strMsg, bool keepalive, bool headerOnly = false, const char *contentType = "application/json"); diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 6a87c8bf99..f47b3385da 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -481,7 +481,7 @@ static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptorstream() << HTTPReply(HTTP_FORBIDDEN, "", false) << std::flush; + conn->stream() << HTTPError(HTTP_FORBIDDEN, false) << std::flush; conn->close(); } else { @@ -807,7 +807,7 @@ static bool HTTPReq_JSONRPC(AcceptedConnection *conn, // Check authorization if (mapHeaders.count("authorization") == 0) { - conn->stream() << HTTPReply(HTTP_UNAUTHORIZED, "", false) << std::flush; + conn->stream() << HTTPError(HTTP_UNAUTHORIZED, false) << std::flush; return false; } @@ -820,7 +820,7 @@ static bool HTTPReq_JSONRPC(AcceptedConnection *conn, if (mapArgs["-rpcpassword"].size() < 20) MilliSleep(250); - conn->stream() << HTTPReply(HTTP_UNAUTHORIZED, "", false) << std::flush; + conn->stream() << HTTPError(HTTP_UNAUTHORIZED, false) << std::flush; return false; } @@ -888,7 +888,7 @@ void ServiceConnection(AcceptedConnection *conn) if (!HTTPReq_JSONRPC(conn, strRequest, mapHeaders, fRun)) break; } else { - conn->stream() << HTTPReply(HTTP_NOT_FOUND, "", false) << std::flush; + conn->stream() << HTTPError(HTTP_NOT_FOUND, false) << std::flush; break; } } From ffebc1be43751050c0b35d7140ba127783708d13 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Sun, 29 Jun 2014 13:20:19 +0800 Subject: [PATCH 0275/1288] Update verify.sh script to point to bitcoin.org Now that downloads are no longer hosted on Sourceforge, update the script to retrieve the binaries and signature file from bitcoin.org. --- contrib/verifysfbinaries/README.md | 2 +- contrib/verifysfbinaries/verify.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/verifysfbinaries/README.md b/contrib/verifysfbinaries/README.md index f646d1efd1..8c038865bd 100644 --- a/contrib/verifysfbinaries/README.md +++ b/contrib/verifysfbinaries/README.md @@ -1,5 +1,5 @@ ### Verify SF Binaries ### -This script attempts to download the signature file `SHA256SUMS.asc` from SourceForge. +This script attempts to download the signature file `SHA256SUMS.asc` from https://bitcoin.org. It first checks if the signature passes, and then downloads the files specified in the file, and checks if the hashes of these files match those that are specified in the signature file. diff --git a/contrib/verifysfbinaries/verify.sh b/contrib/verifysfbinaries/verify.sh index e92295661c..3eb4693883 100755 --- a/contrib/verifysfbinaries/verify.sh +++ b/contrib/verifysfbinaries/verify.sh @@ -1,6 +1,6 @@ #!/bin/bash -### This script attempts to download the signature file SHA256SUMS.asc from SourceForge +### This script attempts to download the signature file SHA256SUMS.asc from bitcoin.org ### It first checks if the signature passes, and then downloads the files specified in ### the file, and checks if the hashes of these files match those that are specified ### in the signature file. @@ -18,11 +18,11 @@ WORKINGDIR="/tmp/bitcoin" TMPFILE="hashes.tmp" #this URL is used if a version number is not specified as an argument to the script -SIGNATUREFILE="http://downloads.sourceforge.net/project/bitcoin/Bitcoin/bitcoin-0.9.0rc1/SHA256SUMS.asc" +SIGNATUREFILE="https://bitcoin.org/bin/0.9.2.1/SHA256SUMS.asc" SIGNATUREFILENAME="SHA256SUMS.asc" RCSUBDIR="test/" -BASEDIR="http://downloads.sourceforge.net/project/bitcoin/Bitcoin/" +BASEDIR="https://bitcoin.org/bin/" VERSIONPREFIX="bitcoin-" RCVERSIONSTRING="rc" @@ -62,7 +62,7 @@ WGETOUT=$(wget -N "$BASEDIR$SIGNATUREFILENAME" 2>&1) #and then see if wget completed successfully if [ $? -ne 0 ]; then echo "Error: couldn't fetch signature file. Have you specified the version number in the following format?" - echo "[bitcoin-]-[rc[0-9]] (example: bitcoin-0.7.1-rc1)" + echo "[bitcoin-]-[rc[0-9]] (example: bitcoin-0.9.2-rc1)" echo "wget output:" echo "$WGETOUT"|sed 's/^/\t/g' exit 2 From aa815647005bc8467f467c35a9e617794446cd64 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 23 Jun 2014 00:00:26 +0200 Subject: [PATCH 0276/1288] Track peers' available blocks --- src/main.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ src/main.h | 1 + src/rpcnet.cpp | 1 + 3 files changed, 48 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 336a5a9a86..dc68431282 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -207,6 +207,10 @@ struct CNodeState { std::string name; // List of asynchronously-determined block rejections to notify this peer about. std::vector rejects; + // The best known block we know this peer has announced. + CBlockIndex *pindexBestKnownBlock; + // The hash of the last unknown block this peer has announced. + uint256 hashLastUnknownBlock; list vBlocksInFlight; int nBlocksInFlight; list vBlocksToDownload; @@ -217,6 +221,8 @@ struct CNodeState { CNodeState() { nMisbehavior = 0; fShouldBan = false; + pindexBestKnownBlock = NULL; + hashLastUnknownBlock = uint256(0); nBlocksToDownload = 0; nBlocksInFlight = 0; nLastBlockReceive = 0; @@ -313,6 +319,39 @@ void MarkBlockAsInFlight(NodeId nodeid, const uint256 &hash) { mapBlocksInFlight[hash] = std::make_pair(nodeid, it); } +/** Check whether the last unknown block a peer advertized is not yet known. */ +void ProcessBlockAvailability(NodeId nodeid) { + CNodeState *state = State(nodeid); + assert(state != NULL); + + if (state->hashLastUnknownBlock != 0) { + map::iterator itOld = mapBlockIndex.find(state->hashLastUnknownBlock); + if (itOld != mapBlockIndex.end() && itOld->second->nChainWork > 0) { + if (state->pindexBestKnownBlock == NULL || itOld->second->nChainWork >= state->pindexBestKnownBlock->nChainWork) + state->pindexBestKnownBlock = itOld->second; + state->hashLastUnknownBlock = uint256(0); + } + } +} + +/** Update tracking information about which blocks a peer is assumed to have. */ +void UpdateBlockAvailability(NodeId nodeid, const uint256 &hash) { + CNodeState *state = State(nodeid); + assert(state != NULL); + + ProcessBlockAvailability(nodeid); + + map::iterator it = mapBlockIndex.find(hash); + if (it != mapBlockIndex.end() && it->second->nChainWork > 0) { + // An actually better block was announced. + if (state->pindexBestKnownBlock == NULL || it->second->nChainWork >= state->pindexBestKnownBlock->nChainWork) + state->pindexBestKnownBlock = it->second; + } else { + // An unknown block was announced; just assume that the latest one is the best one. + state->hashLastUnknownBlock = hash; + } +} + } // anon namespace bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats) { @@ -321,6 +360,7 @@ bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats) { if (state == NULL) return false; stats.nMisbehavior = state->nMisbehavior; + stats.nSyncHeight = state->pindexBestKnownBlock ? state->pindexBestKnownBlock->nHeight : -1; return true; } @@ -3613,6 +3653,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) PushGetBlocks(pfrom, chainActive.Tip(), GetOrphanRoot(inv.hash)); } + if (inv.type == MSG_BLOCK) + UpdateBlockAvailability(pfrom->GetId(), inv.hash); + // Track requests for our stuff g_signals.Inventory(inv.hash); } @@ -4359,6 +4402,9 @@ bool SendMessages(CNode* pto, bool fSendTrickle) pto->fDisconnect = true; } + // Update knowledge of peer's block availability. + ProcessBlockAvailability(pto->GetId()); + // // Message: getdata (blocks) // diff --git a/src/main.h b/src/main.h index 0332db2163..9487078b74 100644 --- a/src/main.h +++ b/src/main.h @@ -185,6 +185,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa struct CNodeStateStats { int nMisbehavior; + int nSyncHeight; }; struct CDiskBlockPos diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index a54872ccc4..2d7abb2d58 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -134,6 +134,7 @@ Value getpeerinfo(const Array& params, bool fHelp) obj.push_back(Pair("startingheight", stats.nStartingHeight)); if (fStateStats) { obj.push_back(Pair("banscore", statestats.nMisbehavior)); + obj.push_back(Pair("syncheight", statestats.nSyncHeight)); } obj.push_back(Pair("syncnode", stats.fSyncNode)); From c9a0918330f31dcb1d5e86b56af63c3f521d3cf2 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 25 Jun 2014 00:56:47 +0200 Subject: [PATCH 0277/1288] Add a skiplist to the CBlockIndex structure. This allows fast (O(log n)) access to far predecessor blocks. Use it to speed up CChain::FindFork and CChain::GetLocator. --- src/main.cpp | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++- src/main.h | 14 +++++++++++-- 2 files changed, 70 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index dc68431282..41125cb577 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -414,8 +414,11 @@ CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const { break; // Exponentially larger steps back, plus the genesis block. int nHeight = std::max(pindex->nHeight - nStep, 0); + // Jump back quickly to the same height as the chain. + if (pindex->nHeight > nHeight) + pindex = pindex->GetAncestor(nHeight); // In case pindex is not in this chain, iterate pindex->pprev to find blocks. - while (pindex->nHeight > nHeight && !Contains(pindex)) + while (!Contains(pindex)) pindex = pindex->pprev; // If pindex is in this chain, use direct height-based access. if (pindex->nHeight > nHeight) @@ -442,6 +445,8 @@ CBlockIndex *CChain::FindFork(const CBlockLocator &locator) const { } CBlockIndex *CChain::FindFork(CBlockIndex *pindex) const { + if (pindex->nHeight > Height()) + pindex = pindex->GetAncestor(Height()); while (pindex && !Contains(pindex)) pindex = pindex->pprev; return pindex; @@ -2151,6 +2156,7 @@ CBlockIndex* AddToBlockIndex(CBlockHeader& block) { pindexNew->pprev = (*miPrev).second; pindexNew->nHeight = pindexNew->pprev->nHeight + 1; + pindexNew->BuildSkip(); } pindexNew->nChainWork = (pindexNew->pprev ? pindexNew->pprev->nChainWork : 0) + pindexNew->GetBlockWork(); pindexNew->RaiseValidity(BLOCK_VALID_TREE); @@ -2508,6 +2514,55 @@ bool CBlockIndex::IsSuperMajority(int minVersion, const CBlockIndex* pstart, uns return (nFound >= nRequired); } +/** Turn the lowest '1' bit in the binary representation of a number into a '0'. */ +int static inline InvertLowestOne(int n) { return n & (n - 1); } + +/** Compute what height to jump back to with the CBlockIndex::pskip pointer. */ +int static inline GetSkipHeight(int height) { + if (height < 2) + return 0; + + // Determine which height to jump back to. Any number strictly lower than height is acceptable, + // but the following expression seems to perform well in simulations (max 110 steps to go back + // up to 2**18 blocks). + return (height & 1) ? InvertLowestOne(InvertLowestOne(height - 1)) + 1 : InvertLowestOne(height); +} + +CBlockIndex* CBlockIndex::GetAncestor(int height) +{ + if (height > nHeight || height < 0) + return NULL; + + CBlockIndex* pindexWalk = this; + int heightWalk = nHeight; + while (heightWalk > height) { + int heightSkip = GetSkipHeight(heightWalk); + int heightSkipPrev = GetSkipHeight(heightWalk - 1); + if (heightSkip == height || + (heightSkip > height && !(heightSkipPrev < heightSkip - 2 && + heightSkipPrev >= height))) { + // Only follow pskip if pprev->pskip isn't better than pskip->pprev. + pindexWalk = pindexWalk->pskip; + heightWalk = heightSkip; + } else { + pindexWalk = pindexWalk->pprev; + heightWalk--; + } + } + return pindexWalk; +} + +const CBlockIndex* CBlockIndex::GetAncestor(int height) const +{ + return const_cast(this)->GetAncestor(height); +} + +void CBlockIndex::BuildSkip() +{ + if (pprev) + pskip = pprev->GetAncestor(GetSkipHeight(nHeight)); +} + void PushGetBlocks(CNode* pnode, CBlockIndex* pindexBegin, uint256 hashEnd) { AssertLockHeld(cs_main); @@ -2858,6 +2913,8 @@ bool static LoadBlockIndexDB() setBlockIndexValid.insert(pindex); if (pindex->nStatus & BLOCK_FAILED_MASK && (!pindexBestInvalid || pindex->nChainWork > pindexBestInvalid->nChainWork)) pindexBestInvalid = pindex; + if (pindex->pprev) + pindex->BuildSkip(); } // Load block file info diff --git a/src/main.h b/src/main.h index 9487078b74..1af86b065f 100644 --- a/src/main.h +++ b/src/main.h @@ -677,6 +677,9 @@ public: // pointer to the index of the predecessor of this block CBlockIndex* pprev; + // pointer to the index of some further predecessor of this block + CBlockIndex* pskip; + // height of the entry in the chain. The genesis block has height 0 int nHeight; @@ -716,6 +719,7 @@ public: { phashBlock = NULL; pprev = NULL; + pskip = NULL; nHeight = 0; nFile = 0; nDataPos = 0; @@ -737,6 +741,7 @@ public: { phashBlock = NULL; pprev = NULL; + pskip = NULL; nHeight = 0; nFile = 0; nDataPos = 0; @@ -869,10 +874,15 @@ public: } return false; } + + // Build the skiplist pointer for this entry. + void BuildSkip(); + + // Efficiently find an ancestor of this block. + CBlockIndex* GetAncestor(int height); + const CBlockIndex* GetAncestor(int height) const; }; - - /** Used to marshal pointers into hashes for db storage. */ class CDiskBlockIndex : public CBlockIndex { From 236982c2b6de619f0744c9c17ea7208b64a4afb3 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 29 Jun 2014 15:26:58 +0200 Subject: [PATCH 0278/1288] Add skiplist unit tests --- src/Makefile.test.include | 1 + src/test/skiplist_tests.cpp | 45 +++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 src/test/skiplist_tests.cpp diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 4dab1773f4..8685452c7b 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -47,6 +47,7 @@ BITCOIN_TESTS =\ test/script_tests.cpp \ test/serialize_tests.cpp \ test/sigopcount_tests.cpp \ + test/skiplist_tests.cpp \ test/test_bitcoin.cpp \ test/transaction_tests.cpp \ test/uint256_tests.cpp \ diff --git a/src/test/skiplist_tests.cpp b/src/test/skiplist_tests.cpp new file mode 100644 index 0000000000..ea301685c9 --- /dev/null +++ b/src/test/skiplist_tests.cpp @@ -0,0 +1,45 @@ +// Copyright (c) 2014 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include +#include +#include "main.h" +#include "util.h" + + +#define SKIPLIST_LENGTH 300000 + +BOOST_AUTO_TEST_SUITE(skiplist_tests) + +BOOST_AUTO_TEST_CASE(skiplist_test) +{ + std::vector vIndex(SKIPLIST_LENGTH); + + for (int i=0; i 0) { + BOOST_CHECK(vIndex[i].pskip == &vIndex[vIndex[i].pskip->nHeight]); + BOOST_CHECK(vIndex[i].pskip->nHeight < i); + } else { + BOOST_CHECK(vIndex[i].pskip == NULL); + } + } + + for (int i=0; i < 1000; i++) { + int from = insecure_rand() % (SKIPLIST_LENGTH - 1); + int to = insecure_rand() % (from + 1); + + BOOST_CHECK(vIndex[SKIPLIST_LENGTH - 1].GetAncestor(from) == &vIndex[from]); + BOOST_CHECK(vIndex[from].GetAncestor(to) == &vIndex[to]); + BOOST_CHECK(vIndex[from].GetAncestor(0) == &vIndex[0]); + } +} + +BOOST_AUTO_TEST_SUITE_END() + From 77888d68d5b78d442a18073c663478bae35da246 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 30 Jun 2014 15:43:01 +0200 Subject: [PATCH 0279/1288] Fix the build for Qt5 Merging #3883 broke the Qt5 build, define the color in the standard way. --- src/qt/guiconstants.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/guiconstants.h b/src/qt/guiconstants.h index 44e361e1e5..696761e234 100644 --- a/src/qt/guiconstants.h +++ b/src/qt/guiconstants.h @@ -24,7 +24,7 @@ static const int STATUSBAR_ICONSIZE = 16; /* Transaction list -- bare address (without label) */ #define COLOR_BAREADDRESS QColor(140, 140, 140) /* Transaction list -- has conflicting transactions */ -#define COLOR_HASCONFLICTING Qt::white; +#define COLOR_HASCONFLICTING QColor(255, 255, 255) /* Transaction list -- has conflicting transactions - background */ #define COLOR_HASCONFLICTING_BG QColor(192, 0, 0) From 3faf1f8294065eaabe2d6d24f2fe04ee4dfd6ae2 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 30 Jun 2014 16:37:59 +0200 Subject: [PATCH 0280/1288] test: Fix warning about integer signedness in P2SH tests --- src/test/script_P2SH_tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index 6ae2b9cf64..a1dc17ba36 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -294,7 +294,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) // vout[4] is max sigops: CScript fifteenSigops; fifteenSigops << OP_1; - for (int i = 0; i < MAX_P2SH_SIGOPS; i++) + for (unsigned i = 0; i < MAX_P2SH_SIGOPS; i++) fifteenSigops << key[i%3].GetPubKey(); fifteenSigops << OP_15 << OP_CHECKMULTISIG; keystore.AddCScript(fifteenSigops); From 9a6497ed0798055d2117547e82a1569a4017d2f2 Mon Sep 17 00:00:00 2001 From: Trevin Hofmann Date: Tue, 1 Jul 2014 00:05:24 -0500 Subject: [PATCH 0281/1288] http to https, 2013 to 2014 --- COPYING | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/COPYING b/COPYING index c410baa6a0..6219bd75a6 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -Copyright (c) 2009-2013 Bitcoin Developers +Copyright (c) 2009-2014 Bitcoin Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 102aa56201..7c2fe12f3a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Bitcoin Core integration/staging tree ===================================== -http://www.bitcoin.org +https://www.bitcoin.org Copyright (c) 2009-2014 Bitcoin Core Developers @@ -15,7 +15,7 @@ out collectively by the network. Bitcoin Core is the name of open source software which enables the use of this currency. For more information, as well as an immediately useable, binary version of -the Bitcoin Core software, see http://www.bitcoin.org/en/download. +the Bitcoin Core software, see https://www.bitcoin.org/en/download. License ------- From 8d9cc7d743583f6cb72d224af458fa5f470b00e8 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 27 Jun 2014 14:51:46 +0200 Subject: [PATCH 0282/1288] fix copyright string in two of our *.rc files - also make comment about rc-files in clientversion.h generic Merges #4429. --- src/bitcoin-cli-res.rc | 1 - src/bitcoind-res.rc | 1 - src/clientversion.h | 5 ++++- src/qt/res/bitcoin-qt-res.rc | 1 - 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bitcoin-cli-res.rc b/src/bitcoin-cli-res.rc index a4a0c47ea5..b1aa1b0e16 100644 --- a/src/bitcoin-cli-res.rc +++ b/src/bitcoin-cli-res.rc @@ -5,7 +5,6 @@ #define VER_PRODUCTVERSION_STR STRINGIZE(CLIENT_VERSION_MAJOR) "." STRINGIZE(CLIENT_VERSION_MINOR) "." STRINGIZE(CLIENT_VERSION_REVISION) "." STRINGIZE(CLIENT_VERSION_BUILD) #define VER_FILEVERSION VER_PRODUCTVERSION #define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR -#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers" VS_VERSION_INFO VERSIONINFO FILEVERSION VER_FILEVERSION diff --git a/src/bitcoind-res.rc b/src/bitcoind-res.rc index dc5c56b797..2e6d754495 100644 --- a/src/bitcoind-res.rc +++ b/src/bitcoind-res.rc @@ -5,7 +5,6 @@ #define VER_PRODUCTVERSION_STR STRINGIZE(CLIENT_VERSION_MAJOR) "." STRINGIZE(CLIENT_VERSION_MINOR) "." STRINGIZE(CLIENT_VERSION_REVISION) "." STRINGIZE(CLIENT_VERSION_BUILD) #define VER_FILEVERSION VER_PRODUCTVERSION #define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR -#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core developers" VS_VERSION_INFO VERSIONINFO FILEVERSION VER_FILEVERSION diff --git a/src/clientversion.h b/src/clientversion.h index a30bbff06b..6c718a9f79 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -8,7 +8,7 @@ // client versioning and copyright year // -// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it +// These need to be macros, as version.cpp's and bitcoin*-res.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 9 #define CLIENT_VERSION_REVISION 99 @@ -28,4 +28,7 @@ #define STRINGIZE(X) DO_STRINGIZE(X) #define DO_STRINGIZE(X) #X +// Copyright string used in Windows .rc files +#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers" + #endif // CLIENTVERSION_H diff --git a/src/qt/res/bitcoin-qt-res.rc b/src/qt/res/bitcoin-qt-res.rc index ee23ae9b78..809235be5f 100644 --- a/src/qt/res/bitcoin-qt-res.rc +++ b/src/qt/res/bitcoin-qt-res.rc @@ -8,7 +8,6 @@ IDI_ICON2 ICON DISCARDABLE "icons/bitcoin_testnet.ico" #define VER_PRODUCTVERSION_STR STRINGIZE(CLIENT_VERSION_MAJOR) "." STRINGIZE(CLIENT_VERSION_MINOR) "." STRINGIZE(CLIENT_VERSION_REVISION) "." STRINGIZE(CLIENT_VERSION_BUILD) #define VER_FILEVERSION VER_PRODUCTVERSION #define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR -#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin developers" VS_VERSION_INFO VERSIONINFO FILEVERSION VER_FILEVERSION From dd638dd712861a2fc419fe9b2b064ae303b074e6 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 25 Jun 2014 13:45:29 +0200 Subject: [PATCH 0283/1288] typedef std::map to CCoinsMap This makes it possible to switch to a more efficient map type without changing all occurences manually. Merges half of #4413. --- src/coins.cpp | 16 ++++++++-------- src/coins.h | 11 ++++++----- src/txdb.cpp | 4 ++-- src/txdb.h | 2 +- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/coins.cpp b/src/coins.cpp index 86b2a6ef17..13a4ea95cd 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -55,7 +55,7 @@ bool CCoinsView::SetCoins(const uint256 &txid, const CCoins &coins) { return fal bool CCoinsView::HaveCoins(const uint256 &txid) { return false; } uint256 CCoinsView::GetBestBlock() { return uint256(0); } bool CCoinsView::SetBestBlock(const uint256 &hashBlock) { return false; } -bool CCoinsView::BatchWrite(const std::map &mapCoins, const uint256 &hashBlock) { return false; } +bool CCoinsView::BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBlock) { return false; } bool CCoinsView::GetStats(CCoinsStats &stats) { return false; } @@ -66,7 +66,7 @@ bool CCoinsViewBacked::HaveCoins(const uint256 &txid) { return base->HaveCoins(t uint256 CCoinsViewBacked::GetBestBlock() { return base->GetBestBlock(); } bool CCoinsViewBacked::SetBestBlock(const uint256 &hashBlock) { return base->SetBestBlock(hashBlock); } void CCoinsViewBacked::SetBackend(CCoinsView &viewIn) { base = &viewIn; } -bool CCoinsViewBacked::BatchWrite(const std::map &mapCoins, const uint256 &hashBlock) { return base->BatchWrite(mapCoins, hashBlock); } +bool CCoinsViewBacked::BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBlock) { return base->BatchWrite(mapCoins, hashBlock); } bool CCoinsViewBacked::GetStats(CCoinsStats &stats) { return base->GetStats(stats); } CCoinsViewCache::CCoinsViewCache(CCoinsView &baseIn, bool fDummy) : CCoinsViewBacked(baseIn), hashBlock(0) { } @@ -83,20 +83,20 @@ bool CCoinsViewCache::GetCoins(const uint256 &txid, CCoins &coins) { return false; } -std::map::iterator CCoinsViewCache::FetchCoins(const uint256 &txid) { - std::map::iterator it = cacheCoins.lower_bound(txid); +CCoinsMap::iterator CCoinsViewCache::FetchCoins(const uint256 &txid) { + CCoinsMap::iterator it = cacheCoins.lower_bound(txid); if (it != cacheCoins.end() && it->first == txid) return it; CCoins tmp; if (!base->GetCoins(txid,tmp)) return cacheCoins.end(); - std::map::iterator ret = cacheCoins.insert(it, std::make_pair(txid, CCoins())); + CCoinsMap::iterator ret = cacheCoins.insert(it, std::make_pair(txid, CCoins())); tmp.swap(ret->second); return ret; } CCoins &CCoinsViewCache::GetCoins(const uint256 &txid) { - std::map::iterator it = FetchCoins(txid); + CCoinsMap::iterator it = FetchCoins(txid); assert(it != cacheCoins.end()); return it->second; } @@ -121,8 +121,8 @@ bool CCoinsViewCache::SetBestBlock(const uint256 &hashBlockIn) { return true; } -bool CCoinsViewCache::BatchWrite(const std::map &mapCoins, const uint256 &hashBlockIn) { - for (std::map::const_iterator it = mapCoins.begin(); it != mapCoins.end(); it++) +bool CCoinsViewCache::BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBlockIn) { + for (CCoinsMap::const_iterator it = mapCoins.begin(); it != mapCoins.end(); it++) cacheCoins[it->first] = it->second; hashBlock = hashBlockIn; return true; diff --git a/src/coins.h b/src/coins.h index 0ad28524a1..c57a5ec722 100644 --- a/src/coins.h +++ b/src/coins.h @@ -239,6 +239,7 @@ public: } }; +typedef std::map CCoinsMap; struct CCoinsStats { @@ -275,7 +276,7 @@ public: virtual bool SetBestBlock(const uint256 &hashBlock); // Do a bulk modification (multiple SetCoins + one SetBestBlock) - virtual bool BatchWrite(const std::map &mapCoins, const uint256 &hashBlock); + virtual bool BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBlock); // Calculate statistics about the unspent transaction output set virtual bool GetStats(CCoinsStats &stats); @@ -299,7 +300,7 @@ public: uint256 GetBestBlock(); bool SetBestBlock(const uint256 &hashBlock); void SetBackend(CCoinsView &viewIn); - bool BatchWrite(const std::map &mapCoins, const uint256 &hashBlock); + bool BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBlock); bool GetStats(CCoinsStats &stats); }; @@ -309,7 +310,7 @@ class CCoinsViewCache : public CCoinsViewBacked { protected: uint256 hashBlock; - std::map cacheCoins; + CCoinsMap cacheCoins; public: CCoinsViewCache(CCoinsView &baseIn, bool fDummy = false); @@ -320,7 +321,7 @@ public: bool HaveCoins(const uint256 &txid); uint256 GetBestBlock(); bool SetBestBlock(const uint256 &hashBlock); - bool BatchWrite(const std::map &mapCoins, const uint256 &hashBlock); + bool BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBlock); // Return a modifiable reference to a CCoins. Check HaveCoins first. // Many methods explicitly require a CCoinsViewCache because of this method, to reduce @@ -352,7 +353,7 @@ public: const CTxOut &GetOutputFor(const CTxIn& input); private: - std::map::iterator FetchCoins(const uint256 &txid); + CCoinsMap::iterator FetchCoins(const uint256 &txid); }; #endif diff --git a/src/txdb.cpp b/src/txdb.cpp index 92137f71ff..52cd96283e 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -54,11 +54,11 @@ bool CCoinsViewDB::SetBestBlock(const uint256 &hashBlock) { return db.WriteBatch(batch); } -bool CCoinsViewDB::BatchWrite(const std::map &mapCoins, const uint256 &hashBlock) { +bool CCoinsViewDB::BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBlock) { LogPrint("coindb", "Committing %u changed transactions to coin database...\n", (unsigned int)mapCoins.size()); CLevelDBBatch batch; - for (std::map::const_iterator it = mapCoins.begin(); it != mapCoins.end(); it++) + for (CCoinsMap::const_iterator it = mapCoins.begin(); it != mapCoins.end(); it++) BatchWriteCoins(batch, it->first, it->second); if (hashBlock != uint256(0)) BatchWriteHashBestChain(batch, hashBlock); diff --git a/src/txdb.h b/src/txdb.h index 7257b0dd21..7d670c2542 100644 --- a/src/txdb.h +++ b/src/txdb.h @@ -37,7 +37,7 @@ public: bool HaveCoins(const uint256 &txid); uint256 GetBestBlock(); bool SetBestBlock(const uint256 &hashBlock); - bool BatchWrite(const std::map &mapCoins, const uint256 &hashBlock); + bool BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBlock); bool GetStats(CCoinsStats &stats); }; From d95ba75825d3b417d03cd2cce6bb944d5a679040 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 1 Jul 2014 14:57:45 +0200 Subject: [PATCH 0284/1288] qt: Log messages with type>QtDebugMsg as non-debug More important messages should end up in the log no matter if -debug=qt is set. --- src/qt/bitcoin.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 89305e9f35..569facb499 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -126,15 +126,15 @@ static void initTranslations(QTranslator &qtTranslatorBase, QTranslator &qtTrans #if QT_VERSION < 0x050000 void DebugMessageHandler(QtMsgType type, const char *msg) { - Q_UNUSED(type); - LogPrint("qt", "GUI: %s\n", msg); + const char *category = (type == QtDebugMsg) ? "qt" : NULL; + LogPrint(category, "GUI: %s\n", msg); } #else void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString &msg) { - Q_UNUSED(type); Q_UNUSED(context); - LogPrint("qt", "GUI: %s\n", qPrintable(msg)); + const char *category = (type == QtDebugMsg) ? "qt" : NULL; + LogPrint(category, "GUI: %s\n", QString::toStdString(msg)); } #endif From 33fdd99288fd257d6b5a3797a0a68aff649a3a71 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 1 Jul 2014 15:21:17 +0200 Subject: [PATCH 0285/1288] qt: Change serious messages from qDebug to qWarning By changing the logging stream for warnings from qDebug to qWarning, these will always be logged to debug.log. --- src/qt/addresstablemodel.cpp | 6 +++--- src/qt/paymentrequestplus.cpp | 22 +++++++++++----------- src/qt/paymentserver.cpp | 24 ++++++++++++------------ src/qt/transactiontablemodel.cpp | 6 +++--- src/qt/winshutdownmonitor.cpp | 6 +++--- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/qt/addresstablemodel.cpp b/src/qt/addresstablemodel.cpp index dfbd445ce3..8d5284d5e9 100644 --- a/src/qt/addresstablemodel.cpp +++ b/src/qt/addresstablemodel.cpp @@ -114,7 +114,7 @@ public: case CT_NEW: if(inModel) { - qDebug() << "AddressTablePriv::updateEntry : Warning: Got CT_NEW, but entry is already in model"; + qWarning() << "AddressTablePriv::updateEntry : Warning: Got CT_NEW, but entry is already in model"; break; } parent->beginInsertRows(QModelIndex(), lowerIndex, lowerIndex); @@ -124,7 +124,7 @@ public: case CT_UPDATED: if(!inModel) { - qDebug() << "AddressTablePriv::updateEntry : Warning: Got CT_UPDATED, but entry is not in model"; + qWarning() << "AddressTablePriv::updateEntry : Warning: Got CT_UPDATED, but entry is not in model"; break; } lower->type = newEntryType; @@ -134,7 +134,7 @@ public: case CT_DELETED: if(!inModel) { - qDebug() << "AddressTablePriv::updateEntry : Warning: Got CT_DELETED, but entry is not in model"; + qWarning() << "AddressTablePriv::updateEntry : Warning: Got CT_DELETED, but entry is not in model"; break; } parent->beginRemoveRows(QModelIndex(), lowerIndex, upperIndex-1); diff --git a/src/qt/paymentrequestplus.cpp b/src/qt/paymentrequestplus.cpp index 464f995eb6..acce42e203 100644 --- a/src/qt/paymentrequestplus.cpp +++ b/src/qt/paymentrequestplus.cpp @@ -29,18 +29,18 @@ bool PaymentRequestPlus::parse(const QByteArray& data) { bool parseOK = paymentRequest.ParseFromArray(data.data(), data.size()); if (!parseOK) { - qDebug() << "PaymentRequestPlus::parse : Error parsing payment request"; + qWarning() << "PaymentRequestPlus::parse : Error parsing payment request"; return false; } if (paymentRequest.payment_details_version() > 1) { - qDebug() << "PaymentRequestPlus::parse : Received up-version payment details, version=" << paymentRequest.payment_details_version(); + qWarning() << "PaymentRequestPlus::parse : Received up-version payment details, version=" << paymentRequest.payment_details_version(); return false; } parseOK = details.ParseFromString(paymentRequest.serialized_payment_details()); if (!parseOK) { - qDebug() << "PaymentRequestPlus::parse : Error parsing payment details"; + qWarning() << "PaymentRequestPlus::parse : Error parsing payment details"; paymentRequest.Clear(); return false; } @@ -80,17 +80,17 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c digestAlgorithm = EVP_sha1(); } else if (paymentRequest.pki_type() == "none") { - qDebug() << "PaymentRequestPlus::getMerchant : Payment request: pki_type == none"; + qWarning() << "PaymentRequestPlus::getMerchant : Payment request: pki_type == none"; return false; } else { - qDebug() << "PaymentRequestPlus::getMerchant : Payment request: unknown pki_type " << QString::fromStdString(paymentRequest.pki_type()); + qWarning() << "PaymentRequestPlus::getMerchant : Payment request: unknown pki_type " << QString::fromStdString(paymentRequest.pki_type()); return false; } payments::X509Certificates certChain; if (!certChain.ParseFromString(paymentRequest.pki_data())) { - qDebug() << "PaymentRequestPlus::getMerchant : Payment request: error parsing pki_data"; + qWarning() << "PaymentRequestPlus::getMerchant : Payment request: error parsing pki_data"; return false; } @@ -100,12 +100,12 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c QByteArray certData(certChain.certificate(i).data(), certChain.certificate(i).size()); QSslCertificate qCert(certData, QSsl::Der); if (currentTime < qCert.effectiveDate() || currentTime > qCert.expiryDate()) { - qDebug() << "PaymentRequestPlus::getMerchant : Payment request: certificate expired or not yet active: " << qCert; + qWarning() << "PaymentRequestPlus::getMerchant : Payment request: certificate expired or not yet active: " << qCert; return false; } #if QT_VERSION >= 0x050000 if (qCert.isBlacklisted()) { - qDebug() << "PaymentRequestPlus::getMerchant : Payment request: certificate blacklisted: " << qCert; + qWarning() << "PaymentRequestPlus::getMerchant : Payment request: certificate blacklisted: " << qCert; return false; } #endif @@ -115,7 +115,7 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c certs.push_back(cert); } if (certs.empty()) { - qDebug() << "PaymentRequestPlus::getMerchant : Payment request: empty certificate chain"; + qWarning() << "PaymentRequestPlus::getMerchant : Payment request: empty certificate chain"; return false; } @@ -131,7 +131,7 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c // load the signing cert into it and verify. X509_STORE_CTX *store_ctx = X509_STORE_CTX_new(); if (!store_ctx) { - qDebug() << "PaymentRequestPlus::getMerchant : Payment request: error creating X509_STORE_CTX"; + qWarning() << "PaymentRequestPlus::getMerchant : Payment request: error creating X509_STORE_CTX"; return false; } @@ -183,7 +183,7 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c catch (SSLVerifyError& err) { fResult = false; - qDebug() << "PaymentRequestPlus::getMerchant : SSL error: " << err.what(); + qWarning() << "PaymentRequestPlus::getMerchant : SSL error: " << err.what(); } if (website) diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index fbb11617fe..2049d65073 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -90,7 +90,7 @@ static QList savedPaymentRequests; static void ReportInvalidCertificate(const QSslCertificate& cert) { - qDebug() << "ReportInvalidCertificate : Payment server found an invalid certificate: " << cert.subjectInfo(QSslCertificate::CommonName); + qWarning() << "ReportInvalidCertificate : Payment server found an invalid certificate: " << cert.subjectInfo(QSslCertificate::CommonName); } // @@ -161,7 +161,7 @@ void PaymentServer::LoadRootCAs(X509_STORE* _store) continue; } } - qDebug() << "PaymentServer::LoadRootCAs : Loaded " << nRootCerts << " root certificates"; + qWarning() << "PaymentServer::LoadRootCAs : Loaded " << nRootCerts << " root certificates"; // Project for another day: // Fetch certificate revocation lists, and add them to certStore. @@ -223,7 +223,7 @@ bool PaymentServer::ipcParseCommandLine(int argc, char* argv[]) { // Printing to debug.log is about the best we can do here, the // GUI hasn't started yet so we can't pop up a message box. - qDebug() << "PaymentServer::ipcSendCommandLine : Payment request file does not exist: " << arg; + qWarning() << "PaymentServer::ipcSendCommandLine : Payment request file does not exist: " << arg; } } return true; @@ -403,7 +403,7 @@ void PaymentServer::handleURIOrFile(const QString& s) } else { - qDebug() << "PaymentServer::handleURIOrFile : Invalid URL: " << fetchUrl; + qWarning() << "PaymentServer::handleURIOrFile : Invalid URL: " << fetchUrl; emit message(tr("URI handling"), tr("Payment request fetch URL is invalid: %1").arg(fetchUrl.toString()), CClientUIInterface::ICON_WARNING); @@ -476,13 +476,13 @@ bool PaymentServer::readPaymentRequest(const QString& filename, PaymentRequestPl QFile f(filename); if (!f.open(QIODevice::ReadOnly)) { - qDebug() << "PaymentServer::readPaymentRequest : Failed to open " << filename; + qWarning() << "PaymentServer::readPaymentRequest : Failed to open " << filename; return false; } if (f.size() > MAX_PAYMENT_REQUEST_SIZE) { - qDebug() << "PaymentServer::readPaymentRequest : " << filename << " too large"; + qWarning() << "PaymentServer::readPaymentRequest : " << filename << " too large"; return false; } @@ -624,7 +624,7 @@ void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipien else { // This should never happen, because sending coins should have // just unlocked the wallet and refilled the keypool. - qDebug() << "PaymentServer::fetchPaymentACK : Error getting refund key, refund_to not set"; + qWarning() << "PaymentServer::fetchPaymentACK : Error getting refund key, refund_to not set"; } } @@ -636,7 +636,7 @@ void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipien } else { // This should never happen, either. - qDebug() << "PaymentServer::fetchPaymentACK : Error serializing payment message"; + qWarning() << "PaymentServer::fetchPaymentACK : Error serializing payment message"; } } @@ -649,7 +649,7 @@ void PaymentServer::netRequestFinished(QNetworkReply* reply) .arg(reply->request().url().toString()) .arg(reply->errorString()); - qDebug() << "PaymentServer::netRequestFinished : " << msg; + qWarning() << "PaymentServer::netRequestFinished : " << msg; emit message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR); return; } @@ -663,7 +663,7 @@ void PaymentServer::netRequestFinished(QNetworkReply* reply) SendCoinsRecipient recipient; if (!request.parse(data)) { - qDebug() << "PaymentServer::netRequestFinished : Error parsing payment request"; + qWarning() << "PaymentServer::netRequestFinished : Error parsing payment request"; emit message(tr("Payment request error"), tr("Payment request can not be parsed!"), CClientUIInterface::MSG_ERROR); @@ -681,7 +681,7 @@ void PaymentServer::netRequestFinished(QNetworkReply* reply) QString msg = tr("Bad response from server %1") .arg(reply->request().url().toString()); - qDebug() << "PaymentServer::netRequestFinished : " << msg; + qWarning() << "PaymentServer::netRequestFinished : " << msg; emit message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR); } else @@ -697,7 +697,7 @@ void PaymentServer::reportSslErrors(QNetworkReply* reply, const QList QString errString; foreach (const QSslError& err, errs) { - qDebug() << "PaymentServer::reportSslErrors : " << err; + qWarning() << "PaymentServer::reportSslErrors : " << err; errString += err.errorString() + "\n"; } emit message(tr("Network request error"), errString, CClientUIInterface::MSG_ERROR); diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index d7f4c043cf..a935752246 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -130,12 +130,12 @@ public: case CT_NEW: if(inModel) { - qDebug() << "TransactionTablePriv::updateWallet : Warning: Got CT_NEW, but transaction is already in model"; + qWarning() << "TransactionTablePriv::updateWallet : Warning: Got CT_NEW, but transaction is already in model"; break; } if(!inWallet) { - qDebug() << "TransactionTablePriv::updateWallet : Warning: Got CT_NEW, but transaction is not in wallet"; + qWarning() << "TransactionTablePriv::updateWallet : Warning: Got CT_NEW, but transaction is not in wallet"; break; } if(showTransaction) @@ -159,7 +159,7 @@ public: case CT_DELETED: if(!inModel) { - qDebug() << "TransactionTablePriv::updateWallet : Warning: Got CT_DELETED, but transaction is not in model"; + qWarning() << "TransactionTablePriv::updateWallet : Warning: Got CT_DELETED, but transaction is not in model"; break; } // Removed -- remove entire transaction from table diff --git a/src/qt/winshutdownmonitor.cpp b/src/qt/winshutdownmonitor.cpp index b7526f0ae4..f8f9bf45b3 100644 --- a/src/qt/winshutdownmonitor.cpp +++ b/src/qt/winshutdownmonitor.cpp @@ -45,13 +45,13 @@ void WinShutdownMonitor::registerShutdownBlockReason(const QString& strReason, c typedef BOOL (WINAPI *PSHUTDOWNBRCREATE)(HWND, LPCWSTR); PSHUTDOWNBRCREATE shutdownBRCreate = (PSHUTDOWNBRCREATE)GetProcAddress(GetModuleHandleA("User32.dll"), "ShutdownBlockReasonCreate"); if (shutdownBRCreate == NULL) { - qDebug() << "registerShutdownBlockReason : GetProcAddress for ShutdownBlockReasonCreate failed"; + qWarning() << "registerShutdownBlockReason : GetProcAddress for ShutdownBlockReasonCreate failed"; return; } if (shutdownBRCreate(mainWinId, strReason.toStdWString().c_str())) - qDebug() << "registerShutdownBlockReason : Successfully registered: " + strReason; + qWarning() << "registerShutdownBlockReason : Successfully registered: " + strReason; else - qDebug() << "registerShutdownBlockReason : Failed to register: " + strReason; + qWarning() << "registerShutdownBlockReason : Failed to register: " + strReason; } #endif From b150b09edcd3b6b7ca5f26ca6ebee92bbad97089 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 6 Jun 2014 10:23:34 -0400 Subject: [PATCH 0286/1288] secp256k1: add libtool as a dependency --- autogen.sh | 3 +++ configure.ac | 1 + contrib/debian/control | 1 + contrib/gitian-descriptors/gitian-osx-bitcoin.yml | 1 + doc/build-osx.md | 4 ++-- 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/autogen.sh b/autogen.sh index 5b883a6a4c..50b85bcba0 100755 --- a/autogen.sh +++ b/autogen.sh @@ -2,4 +2,7 @@ set -e srcdir="$(dirname $0)" cd "$srcdir" +if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="`which glibtoolize 2>/dev/null`"; then + export LIBTOOLIZE="${GLIBTOOLIZE}" +fi autoreconf --install --force diff --git a/configure.ac b/configure.ac index 811ef1dd80..925ac41ad4 100644 --- a/configure.ac +++ b/configure.ac @@ -9,6 +9,7 @@ define(_COPYRIGHT_YEAR, 2014) AC_INIT([Bitcoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@bitcoin.org],[bitcoin]) AC_CONFIG_AUX_DIR([src/build-aux]) AC_CONFIG_MACRO_DIR([src/m4]) +LT_INIT([disable-shared]) AC_CANONICAL_HOST AH_TOP([#ifndef BITCOIN_CONFIG_H]) AH_TOP([#define BITCOIN_CONFIG_H]) diff --git a/contrib/debian/control b/contrib/debian/control index 9e006a7070..a04e88d4e1 100644 --- a/contrib/debian/control +++ b/contrib/debian/control @@ -6,6 +6,7 @@ Uploaders: Micah Anderson Build-Depends: debhelper, devscripts, automake, + libtool, bash-completion, libboost-system-dev (>> 1.35) | libboost-system1.35-dev, libdb4.8++-dev, diff --git a/contrib/gitian-descriptors/gitian-osx-bitcoin.yml b/contrib/gitian-descriptors/gitian-osx-bitcoin.yml index 44b5de9be3..bc3d561c35 100644 --- a/contrib/gitian-descriptors/gitian-osx-bitcoin.yml +++ b/contrib/gitian-descriptors/gitian-osx-bitcoin.yml @@ -11,6 +11,7 @@ packages: - "bsdmainutils" - "pkg-config" - "p7zip-full" +- "libtool" reference_datetime: "2013-06-01 00:00:00" remotes: diff --git a/doc/build-osx.md b/doc/build-osx.md index 1e38326d86..bc42723b12 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -41,7 +41,7 @@ Instructions: MacPorts ### Install dependencies - sudo port install boost db48@+no_java openssl miniupnpc autoconf pkgconfig automake + sudo port install boost db48@+no_java openssl miniupnpc autoconf pkgconfig automake libtool Optional: install Qt4 @@ -69,7 +69,7 @@ Instructions: Homebrew #### Install dependencies using Homebrew - brew install autoconf automake berkeley-db4 boost miniupnpc openssl pkg-config protobuf qt + brew install autoconf automake libtool berkeley-db4 boost miniupnpc openssl pkg-config protobuf qt Note: After you have installed the dependencies, you should check that the Homebrew installed version of OpenSSL is the one available for compilation. You can check this by typing From 556682663547f9a9ede69fc4f924b50c531d92b3 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 6 Jun 2014 10:57:28 -0400 Subject: [PATCH 0287/1288] secp256k1: Add build-side changes for libsecp256k1 Note: This is added to our existing automake targets rather than as a libtool-style lib. The switch to libtool-style targets can come later if it proves to not add any complications. --- Makefile.am | 1 + configure.ac | 1 + src/Makefile.am | 20 +++++++++++++++++++- src/Makefile.qt.include | 3 +++ src/Makefile.qttest.include | 3 +++ src/Makefile.test.include | 5 +++++ src/secp256k1/.empty | 0 7 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/secp256k1/.empty diff --git a/Makefile.am b/Makefile.am index 719af42ac7..3a6a6b6d88 100644 --- a/Makefile.am +++ b/Makefile.am @@ -35,6 +35,7 @@ COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \ dist-hook: -$(MAKE) -C $(top_distdir)/src/leveldb clean + -$(MAKE) -C $(top_distdir)/src/secp256k1 distclean -$(GIT) archive --format=tar HEAD -- src/version.cpp | $(AMTAR) -C $(top_distdir) -xf - distcheck-hook: diff --git a/configure.ac b/configure.ac index 925ac41ad4..2a4636e360 100644 --- a/configure.ac +++ b/configure.ac @@ -680,6 +680,7 @@ AM_CONDITIONAL([USE_LCOV],[test x$use_lcov == xyes]) AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno]) AM_CONDITIONAL([USE_COMPARISON_TOOL_REORG_TESTS],[test x$use_comparison_tool_reorg_test != xno]) AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes]) +AM_CONDITIONAL([USE_LIBSECP256K1],[test x$use_libsecp256k1 = xyes]) AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version]) AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version]) diff --git a/src/Makefile.am b/src/Makefile.am index 9c7b294d35..e2a62c9699 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,10 @@ AM_CPPFLAGS = $(INCLUDES) AM_LDFLAGS = $(PTHREAD_CFLAGS) +if USE_LIBSECP256K1 +secp256k1/libsecp256k1.la: $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*) + @$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) +endif if EMBEDDED_LEVELDB LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include @@ -20,6 +24,10 @@ endif BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) +if USE_LIBSECP256K1 +BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include +endif + LIBBITCOIN_SERVER=libbitcoin_server.a LIBBITCOIN_WALLET=libbitcoin_wallet.a LIBBITCOIN_COMMON=libbitcoin_common.a @@ -220,6 +228,11 @@ bitcoind_LDADD = \ $(LIBBITCOIN_CRYPTO) \ $(LIBLEVELDB) \ $(LIBMEMENV) + +if USE_LIBSECP256K1 + bitcoind_LDADD += secp256k1/libsecp256k1.la +endif + if ENABLE_WALLET bitcoind_LDADD += libbitcoin_wallet.a endif @@ -242,6 +255,10 @@ bitcoin_cli_LDADD = \ $(BOOST_LIBS) bitcoin_cli_SOURCES = \ bitcoin-cli.cpp + +if USE_LIBSECP256K1 + bitcoin_cli_LDADD += secp256k1/libsecp256k1.la +endif bitcoin_cli_CPPFLAGS = $(BITCOIN_INCLUDES) # @@ -253,10 +270,11 @@ CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno DISTCLEANFILES = obj/build.h -EXTRA_DIST = leveldb +EXTRA_DIST = leveldb secp256k1 clean-local: -$(MAKE) -C leveldb clean + -$(MAKE) -C secp256k1 clean rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno -rm -f config.h diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 9df0779ba3..4563bb3565 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -357,6 +357,9 @@ qt_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) endif qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBLEVELDB) $(LIBMEMENV) \ $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) +if USE_LIBSECP256K1 + qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la +endif qt_bitcoin_qt_LDFLAGS = $(QT_LDFLAGS) #locale/foo.ts -> locale/foo.qm diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index a509f23755..7e10ce5a96 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -33,6 +33,9 @@ endif qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBLEVELDB) \ $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) +if USE_LIBSECP256K1 + qt_test_test_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la +endif qt_test_test_bitcoin_qt_LDFLAGS = $(QT_LDFLAGS) CLEAN_BITCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 8685452c7b..12b90adca3 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -69,6 +69,11 @@ test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_CO if ENABLE_WALLET test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) endif + +if USE_LIBSECP256K1 + test_test_bitcoin_LDADD += secp256k1/libsecp256k1.la +endif + test_test_bitcoin_LDADD += $(BDB_LIBS) nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES) diff --git a/src/secp256k1/.empty b/src/secp256k1/.empty new file mode 100644 index 0000000000..e69de29bb2 From fda3fed18aedc4bfc8ccffe89d8d2cabb12677ab Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 6 Jun 2014 01:26:27 +0200 Subject: [PATCH 0288/1288] libsecp256k1 integration --- src/key.cpp | 132 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 120 insertions(+), 12 deletions(-) diff --git a/src/key.cpp b/src/key.cpp index 784085da34..3c4fa77e72 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -5,15 +5,34 @@ #include "key.h" #include "crypto/sha2.h" +#include +#ifdef USE_SECP256K1 +#include +#else #include #include #include -#include +#endif // anonymous namespace with local implementation code (OpenSSL interaction) namespace { +#ifdef USE_SECP256K1 +#include +class CSecp256k1Init { +public: + CSecp256k1Init() { + secp256k1_start(); + } + ~CSecp256k1Init() { + secp256k1_stop(); + } +}; +static CSecp256k1Init instance_of_csecp256k1; + +#else + // Generate a private key from just the secret parameter int EC_KEY_regenerate_key(EC_KEY *eckey, BIGNUM *priv_key) { @@ -334,6 +353,8 @@ public: } }; +#endif + int CompareBigEndian(const unsigned char *c1, size_t c1len, const unsigned char *c2, size_t c2len) { while (c1len > c2len) { if (*c1) @@ -398,10 +419,15 @@ void CKey::MakeNewKey(bool fCompressedIn) { } bool CKey::SetPrivKey(const CPrivKey &privkey, bool fCompressedIn) { +#ifdef USE_SECP256K1 + if (!secp256k1_ecdsa_privkey_import((unsigned char*)begin(), &privkey[0], privkey.size())) + return false; +#else CECKey key; if (!key.SetPrivKey(privkey)) return false; key.GetSecretBytes(vch); +#endif fCompressed = fCompressedIn; fValid = true; return true; @@ -409,99 +435,167 @@ bool CKey::SetPrivKey(const CPrivKey &privkey, bool fCompressedIn) { CPrivKey CKey::GetPrivKey() const { assert(fValid); + CPrivKey privkey; +#ifdef USE_SECP256K1 + privkey.resize(279); + int privkeylen = 279; + int ret = secp256k1_ecdsa_privkey_export(begin(), (unsigned char*)&privkey[0], &privkeylen, fCompressed); + assert(ret); + privkey.resize(privkeylen); +#else CECKey key; key.SetSecretBytes(vch); - CPrivKey privkey; key.GetPrivKey(privkey, fCompressed); +#endif return privkey; } CPubKey CKey::GetPubKey() const { assert(fValid); + CPubKey pubkey; +#ifdef USE_SECP256K1 + int clen = 65; + int ret = secp256k1_ecdsa_pubkey_create((unsigned char*)pubkey.begin(), &clen, begin(), fCompressed); + assert(ret); + assert(pubkey.IsValid()); + assert((int)pubkey.size() == clen); +#else CECKey key; key.SetSecretBytes(vch); - CPubKey pubkey; key.GetPubKey(pubkey, fCompressed); +#endif return pubkey; } bool CKey::Sign(const uint256 &hash, std::vector& vchSig) const { if (!fValid) return false; +#ifdef USE_SECP256K1 + vchSig.resize(72); + int nSigLen = 72; + CKey nonce; + do { + nonce.MakeNewKey(true); + if (secp256k1_ecdsa_sign((const unsigned char*)&hash, 32, (unsigned char*)&vchSig[0], &nSigLen, begin(), nonce.begin())) + break; + } while(true); + vchSig.resize(nSigLen); + return true; +#else CECKey key; key.SetSecretBytes(vch); return key.Sign(hash, vchSig); +#endif } bool CKey::SignCompact(const uint256 &hash, std::vector& vchSig) const { if (!fValid) return false; - CECKey key; - key.SetSecretBytes(vch); vchSig.resize(65); int rec = -1; +#ifdef USE_SECP256K1 + CKey nonce; + do { + nonce.MakeNewKey(true); + if (secp256k1_ecdsa_sign_compact((const unsigned char*)&hash, 32, &vchSig[1], begin(), nonce.begin(), &rec)) + break; + } while(true); +#else + CECKey key; + key.SetSecretBytes(vch); if (!key.SignCompact(hash, &vchSig[1], rec)) return false; +#endif assert(rec != -1); vchSig[0] = 27 + rec + (fCompressed ? 4 : 0); return true; } bool CKey::Load(CPrivKey &privkey, CPubKey &vchPubKey, bool fSkipCheck=false) { +#ifdef USE_SECP256K1 + if (!secp256k1_ecdsa_privkey_import((unsigned char*)begin(), &privkey[0], privkey.size())) + return false; +#else CECKey key; if (!key.SetPrivKey(privkey, fSkipCheck)) return false; - key.GetSecretBytes(vch); +#endif fCompressed = vchPubKey.IsCompressed(); fValid = true; - + if (fSkipCheck) return true; - + if (GetPubKey() != vchPubKey) return false; - + return true; } bool CPubKey::Verify(const uint256 &hash, const std::vector& vchSig) const { if (!IsValid()) return false; +#ifdef USE_SECP256K1 + if (secp256k1_ecdsa_verify((const unsigned char*)&hash, 32, &vchSig[0], vchSig.size(), begin(), size()) != 1) + return false; +#else CECKey key; if (!key.SetPubKey(*this)) return false; if (!key.Verify(hash, vchSig)) return false; +#endif return true; } bool CPubKey::RecoverCompact(const uint256 &hash, const std::vector& vchSig) { if (vchSig.size() != 65) return false; - CECKey key; - if (!key.Recover(hash, &vchSig[1], (vchSig[0] - 27) & ~4)) + int recid = (vchSig[0] - 27) & 3; + bool fComp = (vchSig[0] - 27) & 4; +#ifdef USE_SECP256K1 + int pubkeylen = 65; + if (!secp256k1_ecdsa_recover_compact((const unsigned char*)&hash, 32, &vchSig[1], (unsigned char*)begin(), &pubkeylen, fComp, recid)) return false; - key.GetPubKey(*this, (vchSig[0] - 27) & 4); + assert((int)size() == pubkeylen); +#else + CECKey key; + if (!key.Recover(hash, &vchSig[1], recid)) + return false; + key.GetPubKey(*this, fComp); +#endif return true; } bool CPubKey::IsFullyValid() const { if (!IsValid()) return false; +#ifdef USE_SECP256K1 + if (!secp256k1_ecdsa_pubkey_verify(begin(), size())) + return false; +#else CECKey key; if (!key.SetPubKey(*this)) return false; +#endif return true; } bool CPubKey::Decompress() { if (!IsValid()) return false; +#ifdef USE_SECP256K1 + int clen = size(); + int ret = secp256k1_ecdsa_pubkey_decompress((unsigned char*)begin(), &clen); + assert(ret); + assert(clen == (int)size()); +#else CECKey key; if (!key.SetPubKey(*this)) return false; key.GetPubKey(*this, false); +#endif return true; } @@ -531,7 +625,12 @@ bool CKey::Derive(CKey& keyChild, unsigned char ccChild[32], unsigned int nChild BIP32Hash(cc, nChild, 0, begin(), out); } memcpy(ccChild, out+32, 32); +#ifdef USE_SECP256K1 + memcpy((unsigned char*)keyChild.begin(), begin(), 32); + bool ret = secp256k1_ecdsa_privkey_tweak_add((unsigned char*)keyChild.begin(), out); +#else bool ret = CECKey::TweakSecret((unsigned char*)keyChild.begin(), begin(), out); +#endif UnlockObject(out); keyChild.fCompressed = true; keyChild.fValid = ret; @@ -545,10 +644,15 @@ bool CPubKey::Derive(CPubKey& pubkeyChild, unsigned char ccChild[32], unsigned i unsigned char out[64]; BIP32Hash(cc, nChild, *begin(), begin()+1, out); memcpy(ccChild, out+32, 32); +#ifdef USE_SECP256K1 + pubkeyChild = *this; + bool ret = secp256k1_ecdsa_pubkey_tweak_add((unsigned char*)pubkeyChild.begin(), pubkeyChild.size(), out); +#else CECKey key; bool ret = key.SetPubKey(*this); ret &= key.TweakPublic(out); key.GetPubKey(pubkeyChild, true); +#endif return ret; } @@ -629,6 +733,9 @@ bool CExtPubKey::Derive(CExtPubKey &out, unsigned int nChild) const { } bool ECC_InitSanityCheck() { +#ifdef USE_SECP256K1 + return true; +#else EC_KEY *pkey = EC_KEY_new_by_curve_name(NID_secp256k1); if(pkey == NULL) return false; @@ -636,6 +743,7 @@ bool ECC_InitSanityCheck() { // TODO Is there more EC functionality that could be missing? return true; +#endif } From 462ad223d65bf9a37b4617c4c318279f257258d9 Mon Sep 17 00:00:00 2001 From: Micha Date: Tue, 1 Jul 2014 19:29:44 +0300 Subject: [PATCH 0289/1288] Clean up release-process.md after OS X gitian changes This is PR #4271, but with the changes to the descriptors, both the names of the files and the names of the intermediate build artifact archives, removed. This also closes #3775 if it goes in, because it covers the changes in that PR. --- doc/release-process.md | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/doc/release-process.md b/doc/release-process.md index d12b41772e..324b8c43ab 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -33,16 +33,21 @@ Release Process git checkout v${VERSION} popd pushd ./gitian-builder - mkdir -p inputs; cd inputs/ - Register and download the Apple SDK (see OSX Readme for details) - visit https://developer.apple.com/downloads/download.action?path=Developer_Tools/xcode_4.6.3/xcode4630916281a.dmg + ###Fetch and build inputs: (first time, or when dependency versions change) + + mkdir -p inputs; cd inputs/ + + Register and download the Apple SDK: (see OSX Readme for details) + + https://developer.apple.com/downloads/download.action?path=Developer_Tools/xcode_4.6.3/xcode4630916281a.dmg + + Using a Mac, create a tarball for the 10.7 SDK and copy it to the inputs directory: - Using a Mac, create a tarball for the 10.7 SDK tar -C /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ -czf MacOSX10.7.sdk.tar.gz MacOSX10.7.sdk - Fetch and build inputs: (first time, or when dependency versions change) - + Download remaining inputs, and build everything: + wget 'http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.9.tar.gz' -O miniupnpc-1.9.tar.gz wget 'https://www.openssl.org/source/openssl-1.0.1h.tar.gz' wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz' @@ -87,10 +92,10 @@ Release Process The expected SHA256 hashes of the intermediate inputs are: - 46710f673467e367738d8806e45b4cb5931aaeea61f4b6b55a68eea56d5006c5 bitcoin-deps-linux32-gitian-r6.zip - f03be39fb26670243d3a659e64d18e19d03dec5c11e9912011107768390b5268 bitcoin-deps-linux64-gitian-r6.zip f29b7d9577417333fb56e023c2977f5726a7c297f320b175a4108cf7cd4c2d29 boost-linux32-1.55.0-gitian-r1.zip 88232451c4104f7eb16e469ac6474fd1231bd485687253f7b2bdf46c0781d535 boost-linux64-1.55.0-gitian-r1.zip + 46710f673467e367738d8806e45b4cb5931aaeea61f4b6b55a68eea56d5006c5 bitcoin-deps-linux32-gitian-r6.zip + f03be39fb26670243d3a659e64d18e19d03dec5c11e9912011107768390b5268 bitcoin-deps-linux64-gitian-r6.zip 57e57dbdadc818cd270e7e00500a5e1085b3bcbdef69a885f0fb7573a8d987e1 qt-linux32-4.6.4-gitian-r1.tar.gz 60eb4b9c5779580b7d66529efa5b2836ba1a70edde2a0f3f696d647906a826be qt-linux64-4.6.4-gitian-r1.tar.gz 60dc2d3b61e9c7d5dbe2f90d5955772ad748a47918ff2d8b74e8db9b1b91c909 boost-win32-1.55.0-gitian-r6.zip @@ -106,10 +111,10 @@ Release Process ec95abef1df2b096a970359787c01d8c45e2a4475b7ae34e12c022634fbdba8a osx-depends-qt-5.2.1-r4.tar.gz - Build bitcoind and bitcoin-qt on Linux32, Linux64, and Win32: + Build Bitcoin Core for Linux, Windows, and OS X: ./bin/gbuild --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml - ./bin/gsign --signer $SIGNER --release ${VERSION} --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml + ./bin/gsign --signer $SIGNER --release ${VERSION}-linux --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml pushd build/out zip -r bitcoin-${VERSION}-linux-gitian.zip * mv bitcoin-${VERSION}-linux-gitian.zip ../../../ @@ -132,7 +137,7 @@ Release Process 1. linux 32-bit and 64-bit binaries + source (bitcoin-${VERSION}-linux-gitian.zip) 2. windows 32-bit and 64-bit binaries + installer + source (bitcoin-${VERSION}-win-gitian.zip) 3. OSX installer (Bitcoin-Qt.dmg) - 4. Gitian signatures (in gitian.sigs/${VERSION}[-win|-osx]/(your gitian key)/ + 4. Gitian signatures (in gitian.sigs/${VERSION}-/(your gitian key)/ repackage gitian builds for release as stand-alone zip/tar/installer exe @@ -172,8 +177,9 @@ repackage gitian builds for release as stand-alone zip/tar/installer exe Commit your signature to gitian.sigs: pushd gitian.sigs - git add ${VERSION}/${SIGNER} + git add ${VERSION}-linux/${SIGNER} git add ${VERSION}-win/${SIGNER} + git add ${VERSION}-osx/${SIGNER} git commit -a git push # Assuming you can push to the gitian.sigs tree popd From 88dd3598d22197a22565e524cecdc08107cf76ac Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Tue, 1 Jul 2014 14:26:57 -0700 Subject: [PATCH 0290/1288] Check signatures before respend relay Check that all inputs are completely valid before actually relaying a double-spend. --- src/main.cpp | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 04d9523e26..1294e5b2ed 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -127,7 +127,7 @@ namespace { // Forward reference functions defined here: static const unsigned int MAX_DOUBLESPEND_BLOOM = 1000; -static void RelayDoubleSpend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter); +static bool RelayableRespend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter); ////////////////////////////////////////////////////////////////////////////// // @@ -156,7 +156,7 @@ struct CMainSignals { // transaction was first seen in a block. // Note: only notifies if the previous transaction is in the memory pool; if previous transction was in a block, // then the double-spend simply fails when we try to lookup the inputs in the current UTXO set. - boost::signals2::signal DetectedDoubleSpend; + boost::signals2::signal DetectedDoubleSpend; } g_signals; } // anon namespace @@ -166,7 +166,7 @@ void RegisterInternalSignals() { seed_insecure_rand(); doubleSpendFilter = CBloomFilter(MAX_DOUBLESPEND_BLOOM, 0.01, insecure_rand(), BLOOM_UPDATE_NONE); - g_signals.DetectedDoubleSpend.connect(boost::bind(RelayDoubleSpend, _1, _2, _3, doubleSpendFilter)); + g_signals.DetectedDoubleSpend.connect(boost::bind(RelayableRespend, _1, _2, _3, doubleSpendFilter)); } @@ -936,6 +936,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa return false; // Check for conflicts with in-memory transactions + bool relayableRespend = false; { LOCK(pool.cs); // protect pool.mapNextTx for (unsigned int i = 0; i < tx.vin.size(); i++) @@ -944,8 +945,9 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa // Does tx conflict with a member of the pool, and is it not equivalent to that member? if (pool.mapNextTx.count(outpoint) && !tx.IsEquivalentTo(*pool.mapNextTx[outpoint].ptx)) { - g_signals.DetectedDoubleSpend(outpoint, tx, false); - return false; + relayableRespend = g_signals.DetectedDoubleSpend(outpoint, tx, false); + if (!relayableRespend) + return false; } } } @@ -1038,16 +1040,24 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa { return error("AcceptToMemoryPool: : ConnectInputs failed %s", hash.ToString()); } - // Store transaction in memory - pool.addUnchecked(hash, entry); + + if (relayableRespend) + { + RelayTransaction(tx); + } + else + { + // Store transaction in memory + pool.addUnchecked(hash, entry); + } } g_signals.SyncTransaction(tx, NULL); - return true; + return !relayableRespend; } -static void RelayDoubleSpend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter) +static bool RelayableRespend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter) { // Relaying double-spend attempts to our peers lets them detect when // somebody might be trying to cheat them. However, blindly relaying @@ -1060,7 +1070,7 @@ static void RelayDoubleSpend(const COutPoint& outPoint, const CTransaction& doub // from us they are very likely to hear about it from another peer, since // each peer uses a different, randomized bloom filter. - if (fInBlock || filter.contains(outPoint)) return; + if (fInBlock || filter.contains(outPoint)) return false; // Apply an independent rate limit to double-spend relays static double dRespendCount; @@ -1071,7 +1081,7 @@ static void RelayDoubleSpend(const COutPoint& outPoint, const CTransaction& doub if (RateLimitExceeded(dRespendCount, nLastRespendTime, nRespendLimit, nSize)) { LogPrint("mempool", "Double-spend relay rejected by rate limiter\n"); - return; + return false; } LogPrint("mempool", "Rate limit dRespendCount: %g => %g\n", dRespendCount, dRespendCount+nSize); @@ -1083,10 +1093,7 @@ static void RelayDoubleSpend(const COutPoint& outPoint, const CTransaction& doub filter.insert(outPoint); - RelayTransaction(doubleSpend); - - // Share conflict with wallet - g_signals.SyncTransaction(doubleSpend, NULL); + return true; } From 2882d594fed93dc5bde67ffa33624ab29f90ac8b Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 2 Jul 2014 08:14:50 +0200 Subject: [PATCH 0291/1288] Fix the Qt5 build after d95ba75 Sorry, my own fault this time. --- src/qt/bitcoin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 569facb499..7c4af25edf 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -134,7 +134,7 @@ void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, cons { Q_UNUSED(context); const char *category = (type == QtDebugMsg) ? "qt" : NULL; - LogPrint(category, "GUI: %s\n", QString::toStdString(msg)); + LogPrint(category, "GUI: %s\n", msg.toStdString()); } #endif From dd49e92fb0cae0dcdf0b2ea303da99c7814db473 Mon Sep 17 00:00:00 2001 From: Julian Haight Date: Wed, 2 Jul 2014 09:42:15 +0200 Subject: [PATCH 0292/1288] qt: fix 'opens in testnet mode when presented with a BIP-72 link with no fallback' Passes tests: ``` $ ./bitcoin-qt 'bitcoin:?r=http://www.example.com/' .. fixed the original problem - this launches mainnet. $ ./bitcoin-qt 'bitcoin:mngeNQbTKnmaMbx8EXCYdwUbnt9JJD52cC' .. launches testnet $ ./bitcoin-qt -testnet 'bitcoin:1NXXeQRyMFFFRfyUix2o7mk1vhvk2Nxp78' .. sanity check - launches mainnet. ``` Fixes #4355. Closes #4411. --- src/qt/paymentserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 2049d65073..6ca90f0513 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -195,7 +195,7 @@ bool PaymentServer::ipcParseCommandLine(int argc, char* argv[]) savedPaymentRequests.append(arg); SendCoinsRecipient r; - if (GUIUtil::parseBitcoinURI(arg, &r)) + if (GUIUtil::parseBitcoinURI(arg, &r) && !r.address.isEmpty()) { CBitcoinAddress address(r.address.toStdString()); From 9d5ad718cfdceb0975250ce8268eea400d6f582a Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Wed, 2 Jul 2014 16:32:02 +0800 Subject: [PATCH 0293/1288] Fix formatting in release-process.md --- doc/release-process.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/release-process.md b/doc/release-process.md index 324b8c43ab..c588381411 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -23,7 +23,7 @@ Release Process * * * -##perform gitian builds +###perform gitian builds From a directory containing the bitcoin source, gitian-builder and gitian.sigs @@ -34,7 +34,7 @@ Release Process popd pushd ./gitian-builder - ###Fetch and build inputs: (first time, or when dependency versions change) +###fetch and build inputs: (first time, or when dependency versions change) mkdir -p inputs; cd inputs/ From 3f7a61fc0966bc63dfcafd231c449d922abb884c Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Wed, 2 Jul 2014 17:16:49 +0800 Subject: [PATCH 0294/1288] Update Gitian Build guide to include OSX --- doc/gitian-building.md | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/doc/gitian-building.md b/doc/gitian-building.md index 378a45eda5..b356a5d88d 100644 --- a/doc/gitian-building.md +++ b/doc/gitian-building.md @@ -4,8 +4,8 @@ Gitian building *Setup instructions for a gitian build of Bitcoin using a Debian VM or physical system.* Gitian is the deterministic build process that is used to build the Bitcoin -Core executables [1]. It provides a way to be reasonably sure that the -executables are really built from source on github. It also makes sure that +Core executables. It provides a way to be reasonably sure that the +executables are really built from source on GitHub. It also makes sure that the same, tested dependencies are used and statically built into the executable. Multiple developers build the source code by following a specific descriptor @@ -17,9 +17,6 @@ More independent gitian builders are needed, which is why I wrote this guide. It is preferred to follow these steps yourself instead of using someone else's VM image to avoid 'contaminating' the build. -[1] For all platforms except for MacOSX, at this point. Work for deterministic -builds for Mac is under way here: https://github.com/theuni/osx-cross-depends . - Table of Contents ------------------ @@ -38,7 +35,7 @@ Preparing the Gitian builder host --------------------------------- The first step is to prepare the host environment that will be used to perform the Gitian builds. -In this guide it is explained how to set up the environment, and how to get the builds started. +This guide explains how to set up the environment, and how to start the builds. Debian Linux was chosen as the host distribution because it has a lightweight install (in contrast to Ubuntu) and is readily available. Any kind of virtualization can be used, for example: @@ -134,7 +131,7 @@ and proceed, just press `Enter`. To select a different button, press `Tab`. ![](gitian-building/debian_install_5_configure_the_network.png) -- Choose a root password and enter it twice (and remember it for later) +- Choose a root password and enter it twice (remember it for later) ![](gitian-building/debian_install_6a_set_up_root_password.png) @@ -143,7 +140,7 @@ and proceed, just press `Enter`. To select a different button, press `Tab`. ![](gitian-building/debian_install_7_set_up_user_fullname.png) ![](gitian-building/debian_install_8_set_up_username.png) -- Choose a user password and enter it twice (and remember it for later) +- Choose a user password and enter it twice (remember it for later) ![](gitian-building/debian_install_9_user_password.png) @@ -236,7 +233,7 @@ adduser debian sudo When you get a colorful screen with a question about the 'LXC directory', just go with the default (`/var/lib/lxc`). -Then set up LXC and the rest with the following is a complex jumble of settings and workarounds: +Then set up LXC and the rest with the following, which is a complex jumble of settings and workarounds: ```bash # the version of lxc-start in Debian 7.4 needs to run as root, so make sure @@ -280,7 +277,7 @@ cd .. **Note**: When sudo asks for a password, enter the password for the user *debian* not for *root*. -Clone the git repositories for bitcoin and gitian and then checkout the bitcoin version that you are willing to build. +Clone the git repositories for bitcoin and gitian and then checkout the bitcoin version that you want to build. ```bash git clone https://github.com/devrandom/gitian-builder.git @@ -319,10 +316,10 @@ you will find a list of `wget` commands that can be executed to get the dependen I needed to add `--no-check-certificate` to the OpenSSL wget line to make it work. Likely this is because the ca-certificates in Debian 7.4 is fairly old. This does not create a -security issue as the gitian descriptors check integrity of the input archives and refuse to work +security issue as the gitian descriptors check the integrity of the input archives and refuse to work if any one is corrupted. -After downloading the archives, execute the `gbuild` commends to build the dependencies. +After downloading the archives, execute the `gbuild` commands to build the dependencies. This can take a long time, but only has to be done when the dependencies change, for example to upgrade the used version. @@ -339,7 +336,7 @@ tail -f var/build.log Building Bitcoin ---------------- -To build Bitcoin (for Linux and/or Windows) just follow the steps under 'perform +To build Bitcoin (for Linux, OSX and Windows) just follow the steps under 'perform gitian builds' in [doc/release-process.md](release-process.md) in the bitcoin repository. Output from `gbuild` will look something like @@ -372,7 +369,7 @@ can be inspected in `var/install.log` and `var/build.log`. Building an alternative repository ----------------------------------- -If you want to do a test build of a pull on github it can be useful to point +If you want to do a test build of a pull on GitHub it can be useful to point the gitian builder at an alternative repository, using the same descriptors and inputs. @@ -382,13 +379,14 @@ URL=https://github.com/laanwj/bitcoin.git COMMIT=2014_03_windows_unicode_path ./bin/gbuild --commit bitcoin=${COMMIT} --url bitcoin=${URL} ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml ./bin/gbuild --commit bitcoin=${COMMIT} --url bitcoin=${URL} ../bitcoin/contrib/gitian-descriptors/gitian-win.yml +./bin/gbuild --commit bitcoin=${COMMIT} --url bitcoin=${URL} ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml ``` Signing externally ------------------- -If you want to do the PGP signing on another device that's possible too; just define `SIGNER` as mentioned -and follow the steps in the build process as normally. +If you want to do the PGP signing on another device that's also possible; just define `SIGNER` as mentioned +and follow the steps in the build process as normal. gpg: skipped "laanwj": secret key not available @@ -396,8 +394,9 @@ When you execute `gsign` you will get an error from GPG, which can be ignored. C in `gitian.sigs` to your signing machine and do ```bash - gpg --detach-sign ${VERSION}/${SIGNER}/bitcoin-build.assert + gpg --detach-sign ${VERSION}-linux/${SIGNER}/bitcoin-build.assert gpg --detach-sign ${VERSION}-win/${SIGNER}/bitcoin-build.assert + gpg --detach-sign ${VERSION}-osx/${SIGNER}/bitcoin-build.assert ``` This will create the `.sig` files that can be committed together with the `.assert` files to assert your @@ -407,5 +406,5 @@ Uploading signatures --------------------- After building and signing you can push your signatures (both the `.assert` and `.assert.sig` files) to the -[bitcoin/gitian.sigs](https://github.com/bitcoin/gitian.sigs/) repository, or if not possible create a pull +[bitcoin/gitian.sigs](https://github.com/bitcoin/gitian.sigs/) repository, or if that's not possible create a pull request. You can also mail the files to me (laanwj@gmail.com) and I'll commit them. From c8988460a2865b99ee96da6799d37ac6ccb79d4d Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 26 Jul 2013 01:06:01 +0200 Subject: [PATCH 0295/1288] Add support for watch-only addresses Changes: * Add Add/Have WatchOnly methods to CKeyStore, and implementations in CBasicKeyStore. * Add similar methods to CWallet, and support entries for it in CWalletDB. * Make IsMine in script/wallet return a new enum 'isminetype', rather than a boolean. This allows distinguishing between spendable and unspendable coins. * Add a field fSpendable to COutput (GetAvailableCoins' return type). * Mark watchonly coins in listunspent as 'watchonly': true. * Add 'watchonly' to validateaddress, suppressing script/pubkey/... in this case. Based on a patch by Eric Lombrozo. Conflicts: src/qt/walletmodel.cpp src/rpcserver.cpp src/wallet.cpp --- src/keystore.cpp | 12 +++++++++ src/keystore.h | 19 ++++++++++++++ src/qt/walletmodel.cpp | 6 ++--- src/rpcclient.cpp | 1 + src/rpcdump.cpp | 45 +++++++++++++++++++++++++++++++++ src/rpcmisc.cpp | 52 +++++++++++++++++++++++---------------- src/rpcrawtransaction.cpp | 1 + src/rpcserver.cpp | 1 + src/rpcserver.h | 1 + src/script.cpp | 52 +++++++++++++++++++++++++++++---------- src/script.h | 12 +++++++-- src/test/wallet_tests.cpp | 2 +- src/wallet.cpp | 35 ++++++++++++++++++++------ src/wallet.h | 14 ++++++++--- src/walletdb.cpp | 19 ++++++++++++++ src/walletdb.h | 3 +++ 16 files changed, 223 insertions(+), 52 deletions(-) diff --git a/src/keystore.cpp b/src/keystore.cpp index 594e0c61da..c2ea1ce5a9 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -59,3 +59,15 @@ bool CBasicKeyStore::GetCScript(const CScriptID &hash, CScript& redeemScriptOut) return false; } +bool CBasicKeyStore::AddWatchOnly(const CTxDestination &dest) +{ + LOCK(cs_KeyStore); + setWatchOnly.insert(dest); + return true; +} + +bool CBasicKeyStore::HaveWatchOnly(const CTxDestination &dest) const +{ + LOCK(cs_KeyStore); + return setWatchOnly.count(dest) > 0; +} diff --git a/src/keystore.h b/src/keystore.h index 79d8661aca..90fc3a4c7b 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -8,11 +8,21 @@ #include "key.h" #include "sync.h" +#include "script.h" // for CNoDestination #include +#include class CScript; +/** A txout script template with a specific destination. It is either: + * * CNoDestination: no destination set + * * CKeyID: TX_PUBKEYHASH destination + * * CScriptID: TX_SCRIPTHASH destination + * A CTxDestination is the internal data type encoded in a CBitcoinAddress + */ +typedef boost::variant CTxDestination; + /** A virtual base class for key stores */ class CKeyStore { @@ -36,10 +46,15 @@ public: virtual bool AddCScript(const CScript& redeemScript) =0; virtual bool HaveCScript(const CScriptID &hash) const =0; virtual bool GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const =0; + + // Support for Watch-only addresses + virtual bool AddWatchOnly(const CTxDestination &dest) =0; + virtual bool HaveWatchOnly(const CTxDestination &dest) const =0; }; typedef std::map KeyMap; typedef std::map ScriptMap; +typedef std::set WatchOnlySet; /** Basic key store, that keeps keys in an address->secret map */ class CBasicKeyStore : public CKeyStore @@ -47,6 +62,7 @@ class CBasicKeyStore : public CKeyStore protected: KeyMap mapKeys; ScriptMap mapScripts; + WatchOnlySet setWatchOnly; public: bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey); @@ -88,6 +104,9 @@ public: virtual bool AddCScript(const CScript& redeemScript); virtual bool HaveCScript(const CScriptID &hash) const; virtual bool GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const; + + virtual bool AddWatchOnly(const CTxDestination &dest); + virtual bool HaveWatchOnly(const CTxDestination &dest) const; }; typedef std::vector > CKeyingMaterial; diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index defc815def..d32e74b78a 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -543,7 +543,7 @@ void WalletModel::getOutputs(const std::vector& vOutpoints, std::vect if (!wallet->mapWallet.count(outpoint.hash)) continue; int nDepth = wallet->mapWallet[outpoint.hash].GetDepthInMainChain(); if (nDepth < 0) continue; - COutput out(&wallet->mapWallet[outpoint.hash], outpoint.n, nDepth); + COutput out(&wallet->mapWallet[outpoint.hash], outpoint.n, nDepth, true); vOutputs.push_back(out); } } @@ -570,7 +570,7 @@ void WalletModel::listCoins(std::map >& mapCoins) if (!wallet->mapWallet.count(outpoint.hash)) continue; int nDepth = wallet->mapWallet[outpoint.hash].GetDepthInMainChain(); if (nDepth < 0) continue; - COutput out(&wallet->mapWallet[outpoint.hash], outpoint.n, nDepth); + COutput out(&wallet->mapWallet[outpoint.hash], outpoint.n, nDepth, true); vCoins.push_back(out); } @@ -581,7 +581,7 @@ void WalletModel::listCoins(std::map >& mapCoins) while (wallet->IsChange(cout.tx->vout[cout.i]) && cout.tx->vin.size() > 0 && wallet->IsMine(cout.tx->vin[0])) { if (!wallet->mapWallet.count(cout.tx->vin[0].prevout.hash)) break; - cout = COutput(&wallet->mapWallet[cout.tx->vin[0].prevout.hash], cout.tx->vin[0].prevout.n, 0); + cout = COutput(&wallet->mapWallet[cout.tx->vin[0].prevout.hash], cout.tx->vin[0].prevout.n, 0, true); } CTxDestination address; diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index 501940a730..76c99e7c9f 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -72,6 +72,7 @@ static const CRPCConvertParam vRPCConvertParams[] = { "lockunspent", 0 }, { "lockunspent", 1 }, { "importprivkey", 2 }, + { "importaddress", 2 }, { "verifychain", 0 }, { "verifychain", 1 }, { "keypoolrefill", 0 }, diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index 593e0d2b6b..5b325c46ee 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -133,6 +133,51 @@ Value importprivkey(const Array& params, bool fHelp) return Value::null; } +Value importaddress(const Array& params, bool fHelp) +{ + if (fHelp || params.size() < 1 || params.size() > 3) + throw runtime_error( + "importaddress
[label] [rescan=true]\n" + "Adds an address that can be watched as if it were in your wallet but cannot be used to spend."); + + CBitcoinAddress address(params[0].get_str()); + if (!address.IsValid()) + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address"); + CTxDestination dest; + dest = address.Get(); + + string strLabel = ""; + if (params.size() > 1) + strLabel = params[1].get_str(); + + // Whether to perform rescan after import + bool fRescan = true; + if (params.size() > 2) + fRescan = params[2].get_bool(); + + { + LOCK2(cs_main, pwalletMain->cs_wallet); + + // Don't throw error in case an address is already there + if (pwalletMain->HaveWatchOnly(dest)) + return Value::null; + + pwalletMain->MarkDirty(); + pwalletMain->SetAddressBook(dest, strLabel, "receive"); + + if (!pwalletMain->AddWatchOnly(dest)) + throw JSONRPCError(RPC_WALLET_ERROR, "Error adding address to wallet"); + + if (fRescan) + { + pwalletMain->ScanForWalletTransactions(chainActive.Genesis(), true); + pwalletMain->ReacceptWalletTransactions(); + } + } + + return Value::null; +} + Value importwallet(const Array& params, bool fHelp) { if (fHelp || params.size() != 1) diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 5b470516a1..e2de2dbcdb 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -92,36 +92,45 @@ Value getinfo(const Array& params, bool fHelp) #ifdef ENABLE_WALLET class DescribeAddressVisitor : public boost::static_visitor { +private: + isminetype mine; + public: + DescribeAddressVisitor(isminetype mineIn) : mine(mineIn) {} + Object operator()(const CNoDestination &dest) const { return Object(); } Object operator()(const CKeyID &keyID) const { Object obj; CPubKey vchPubKey; - pwalletMain->GetPubKey(keyID, vchPubKey); obj.push_back(Pair("isscript", false)); - obj.push_back(Pair("pubkey", HexStr(vchPubKey))); - obj.push_back(Pair("iscompressed", vchPubKey.IsCompressed())); + if (mine == MINE_SPENDABLE) { + pwalletMain->GetPubKey(keyID, vchPubKey); + obj.push_back(Pair("pubkey", HexStr(vchPubKey))); + obj.push_back(Pair("iscompressed", vchPubKey.IsCompressed())); + } return obj; } Object operator()(const CScriptID &scriptID) const { Object obj; obj.push_back(Pair("isscript", true)); - CScript subscript; - pwalletMain->GetCScript(scriptID, subscript); - std::vector addresses; - txnouttype whichType; - int nRequired; - ExtractDestinations(subscript, whichType, addresses, nRequired); - obj.push_back(Pair("script", GetTxnOutputType(whichType))); - obj.push_back(Pair("hex", HexStr(subscript.begin(), subscript.end()))); - Array a; - BOOST_FOREACH(const CTxDestination& addr, addresses) - a.push_back(CBitcoinAddress(addr).ToString()); - obj.push_back(Pair("addresses", a)); - if (whichType == TX_MULTISIG) - obj.push_back(Pair("sigsrequired", nRequired)); + if (mine == MINE_SPENDABLE) { + CScript subscript; + pwalletMain->GetCScript(scriptID, subscript); + std::vector addresses; + txnouttype whichType; + int nRequired; + ExtractDestinations(subscript, whichType, addresses, nRequired); + obj.push_back(Pair("script", GetTxnOutputType(whichType))); + obj.push_back(Pair("hex", HexStr(subscript.begin(), subscript.end()))); + Array a; + BOOST_FOREACH(const CTxDestination& addr, addresses) + a.push_back(CBitcoinAddress(addr).ToString()); + obj.push_back(Pair("addresses", a)); + if (whichType == TX_MULTISIG) + obj.push_back(Pair("sigsrequired", nRequired)); + } return obj; } }; @@ -161,10 +170,11 @@ Value validateaddress(const Array& params, bool fHelp) string currentAddress = address.ToString(); ret.push_back(Pair("address", currentAddress)); #ifdef ENABLE_WALLET - bool fMine = pwalletMain ? IsMine(*pwalletMain, dest) : false; - ret.push_back(Pair("ismine", fMine)); - if (fMine) { - Object detail = boost::apply_visitor(DescribeAddressVisitor(), dest); + isminetype mine = pwalletMain ? IsMine(*pwalletMain, dest) : MINE_NO; + ret.push_back(Pair("ismine", mine != MINE_NO)); + if (mine != MINE_NO) { + ret.push_back(Pair("watchonly", mine == MINE_WATCH_ONLY)); + Object detail = boost::apply_visitor(DescribeAddressVisitor(mine), dest); ret.insert(ret.end(), detail.begin(), detail.end()); } if (pwalletMain && pwalletMain->mapAddressBook.count(dest)) diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 9771f8e685..da4bde3975 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -304,6 +304,7 @@ Value listunspent(const Array& params, bool fHelp) } entry.push_back(Pair("amount",ValueFromAmount(nValue))); entry.push_back(Pair("confirmations",out.nDepth)); + entry.push_back(Pair("spendable", out.fSpendable)); results.push_back(entry); } diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index f47b3385da..363403c69e 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -282,6 +282,7 @@ static const CRPCCommand vRPCCommands[] = { "getwalletinfo", &getwalletinfo, true, false, true }, { "importprivkey", &importprivkey, false, false, true }, { "importwallet", &importwallet, false, false, true }, + { "importaddress", &importaddress, false, false, true }, { "keypoolrefill", &keypoolrefill, true, false, true }, { "listaccounts", &listaccounts, false, false, true }, { "listaddressgroupings", &listaddressgroupings, false, false, true }, diff --git a/src/rpcserver.h b/src/rpcserver.h index 01e77163c4..e32eb975a1 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -131,6 +131,7 @@ extern json_spirit::Value getnettotals(const json_spirit::Array& params, bool fH extern json_spirit::Value dumpprivkey(const json_spirit::Array& params, bool fHelp); // in rpcdump.cpp extern json_spirit::Value importprivkey(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value importaddress(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value dumpwallet(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value importwallet(const json_spirit::Array& params, bool fHelp); diff --git a/src/script.cpp b/src/script.cpp index e1b6985408..0ef0126255 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1456,36 +1456,57 @@ public: bool operator()(const CScriptID &scriptID) const { return keystore->HaveCScript(scriptID); } }; -bool IsMine(const CKeyStore &keystore, const CTxDestination &dest) +isminetype IsMine(const CKeyStore &keystore, const CTxDestination &dest) { - return boost::apply_visitor(CKeyStoreIsMineVisitor(&keystore), dest); + if (boost::apply_visitor(CKeyStoreIsMineVisitor(&keystore), dest)) + return MINE_SPENDABLE; + if (keystore.HaveWatchOnly(dest)) + return MINE_WATCH_ONLY; + return MINE_NO; } -bool IsMine(const CKeyStore &keystore, const CScript& scriptPubKey) +isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey) { vector vSolutions; txnouttype whichType; - if (!Solver(scriptPubKey, whichType, vSolutions)) - return false; + if (!Solver(scriptPubKey, whichType, vSolutions)) { + if (keystore.HaveWatchOnly(scriptPubKey.GetID())) + return MINE_WATCH_ONLY; + return MINE_NO; + } CKeyID keyID; switch (whichType) { case TX_NONSTANDARD: case TX_NULL_DATA: - return false; + break; case TX_PUBKEY: keyID = CPubKey(vSolutions[0]).GetID(); - return keystore.HaveKey(keyID); + if (keystore.HaveKey(keyID)) + return MINE_SPENDABLE; + if (keystore.HaveWatchOnly(keyID)) + return MINE_WATCH_ONLY; + break; case TX_PUBKEYHASH: keyID = CKeyID(uint160(vSolutions[0])); - return keystore.HaveKey(keyID); + if (keystore.HaveKey(keyID)) + return MINE_SPENDABLE; + if (keystore.HaveWatchOnly(keyID)) + return MINE_WATCH_ONLY; + break; case TX_SCRIPTHASH: { + CScriptID scriptID = CScriptID(uint160(vSolutions[0])); CScript subscript; - if (!keystore.GetCScript(CScriptID(uint160(vSolutions[0])), subscript)) - return false; - return IsMine(keystore, subscript); + if (keystore.GetCScript(scriptID, subscript)) { + isminetype ret = IsMine(keystore, subscript); + if (ret) + return ret; + } + if (keystore.HaveWatchOnly(scriptID)) + return MINE_WATCH_ONLY; + break; } case TX_MULTISIG: { @@ -1495,10 +1516,15 @@ bool IsMine(const CKeyStore &keystore, const CScript& scriptPubKey) // them) enable spend-out-from-under-you attacks, especially // in shared-wallet situations. vector keys(vSolutions.begin()+1, vSolutions.begin()+vSolutions.size()-1); - return HaveKeys(keys, keystore) == keys.size(); + if (HaveKeys(keys, keystore) == keys.size()) + return MINE_SPENDABLE; + break; } } - return false; + + if (keystore.HaveWatchOnly(scriptPubKey.GetID())) + return MINE_WATCH_ONLY; + return MINE_NO; } bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet) diff --git a/src/script.h b/src/script.h index 7ab471f6e6..1db758094e 100644 --- a/src/script.h +++ b/src/script.h @@ -194,6 +194,14 @@ enum SCRIPT_VERIFY_NULLDUMMY = (1U << 4), // verify dummy stack item consumed by CHECKMULTISIG is of zero-length }; +/** IsMine() return codes */ +enum isminetype +{ + MINE_NO = 0, + MINE_WATCH_ONLY = 1, + MINE_SPENDABLE = 2, +}; + // Mandatory script verification flags that all new blocks must comply with for // them to be valid. (but old blocks may not comply with) Currently just P2SH, // but in the future other flags may be added, such as a soft-fork to enforce @@ -801,8 +809,8 @@ bool EvalScript(std::vector >& stack, const CScript& bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector >& vSolutionsRet); int ScriptSigArgsExpected(txnouttype t, const std::vector >& vSolutions); bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType); -bool IsMine(const CKeyStore& keystore, const CScript& scriptPubKey); -bool IsMine(const CKeyStore& keystore, const CTxDestination &dest); +isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey); +isminetype IsMine(const CKeyStore& keystore, const CTxDestination &dest); void ExtractAffectedKeys(const CKeyStore &keystore, const CScript& scriptPubKey, std::vector &vKeys); bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet); bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::vector& addressRet, int& nRequiredRet); diff --git a/src/test/wallet_tests.cpp b/src/test/wallet_tests.cpp index 86a83f5163..3887efbd0d 100644 --- a/src/test/wallet_tests.cpp +++ b/src/test/wallet_tests.cpp @@ -46,7 +46,7 @@ static void add_coin(int64_t nValue, int nAge = 6*24, bool fIsFromMe = false, in wtx->fDebitCached = true; wtx->nDebitCached = 1; } - COutput output(wtx, nInput, nAge); + COutput output(wtx, nInput, nAge, true); vCoins.push_back(output); } diff --git a/src/wallet.cpp b/src/wallet.cpp index daca7ac04b..3d679f4c56 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -145,6 +145,22 @@ bool CWallet::LoadCScript(const CScript& redeemScript) return CCryptoKeyStore::AddCScript(redeemScript); } +bool CWallet::AddWatchOnly(const CTxDestination &dest) +{ + if (!CCryptoKeyStore::AddWatchOnly(dest)) + return false; + nTimeFirstKey = 1; // No birthday information for watch-only keys. + if (!fFileBacked) + return true; + return CWalletDB(strWalletFile).WriteWatchOnly(dest); +} + +bool CWallet::LoadWatchOnly(const CTxDestination &dest) +{ + LogPrintf("Loaded %s!\n", CBitcoinAddress(dest).ToString().c_str()); + return CCryptoKeyStore::AddWatchOnly(dest); +} + bool CWallet::Unlock(const SecureString& strWalletPassphrase) { CCrypter crypter; @@ -680,7 +696,7 @@ void CWallet::EraseFromWallet(const uint256 &hash) } -bool CWallet::IsMine(const CTxIn &txin) const +isminetype CWallet::IsMine(const CTxIn &txin) const { { LOCK(cs_wallet); @@ -689,11 +705,10 @@ bool CWallet::IsMine(const CTxIn &txin) const { const CWalletTx& prev = (*mi).second; if (txin.prevout.n < prev.vout.size()) - if (IsMine(prev.vout[txin.prevout.n])) - return true; + return IsMine(prev.vout[txin.prevout.n]); } } - return false; + return MINE_NO; } int64_t CWallet::GetDebit(const CTxIn &txin) const @@ -1051,7 +1066,7 @@ int64_t CWallet::GetImmatureBalance() const return nTotal; } -// populate vCoins with vector of spendable COutputs +// populate vCoins with vector of available COutputs. void CWallet::AvailableCoins(vector& vCoins, bool fOnlyConfirmed, const CCoinControl *coinControl) const { vCoins.clear(); @@ -1077,10 +1092,11 @@ void CWallet::AvailableCoins(vector& vCoins, bool fOnlyConfirmed, const continue; for (unsigned int i = 0; i < pcoin->vout.size(); i++) { - if (!(IsSpent(wtxid, i)) && IsMine(pcoin->vout[i]) && + isminetype mine = IsMine(pcoin->vout[i]); + if (!(IsSpent(wtxid, i)) && mine != MINE_NO && !IsLockedCoin((*it).first, i) && pcoin->vout[i].nValue > 0 && (!coinControl || !coinControl->HasSelected() || coinControl->IsSelected((*it).first, i))) - vCoins.push_back(COutput(pcoin, i, nDepth)); + vCoins.push_back(COutput(pcoin, i, nDepth, mine & MINE_SPENDABLE)); } } } @@ -1147,8 +1163,11 @@ bool CWallet::SelectCoinsMinConf(int64_t nTargetValue, int nConfMine, int nConfT random_shuffle(vCoins.begin(), vCoins.end(), GetRandInt); - BOOST_FOREACH(COutput output, vCoins) + BOOST_FOREACH(const COutput &output, vCoins) { + if (!output.fSpendable) + continue; + const CWalletTx *pcoin = output.tx; if (output.nDepth < (pcoin->IsFromMe() ? nConfMine : nConfTheirs)) diff --git a/src/wallet.h b/src/wallet.h index 1c2512d678..ff6af3a6a8 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -226,6 +226,11 @@ public: /// Look up a destination data tuple in the store, return true if found false otherwise bool GetDestData(const CTxDestination &dest, const std::string &key, std::string *value) const; + // Adds a watch-only address to the store, and saves it to disk. + bool AddWatchOnly(const CTxDestination &dest); + // Adds a watch-only address to the store, without saving it to disk (used by LoadWallet) + bool LoadWatchOnly(const CTxDestination &dest); + bool Unlock(const SecureString& strWalletPassphrase); bool ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase, const SecureString& strNewWalletPassphrase); bool EncryptWallet(const SecureString& strWalletPassphrase); @@ -279,9 +284,9 @@ public: std::set GetAccountAddresses(std::string strAccount) const; - bool IsMine(const CTxIn& txin) const; + isminetype IsMine(const CTxIn& txin) const; int64_t GetDebit(const CTxIn& txin) const; - bool IsMine(const CTxOut& txout) const + isminetype IsMine(const CTxOut& txout) const { return ::IsMine(*this, txout.scriptPubKey); } @@ -722,10 +727,11 @@ public: const CWalletTx *tx; int i; int nDepth; + bool fSpendable; - COutput(const CWalletTx *txIn, int iIn, int nDepthIn) + COutput(const CWalletTx *txIn, int iIn, int nDepthIn, bool fSpendableIn) { - tx = txIn; i = iIn; nDepth = nDepthIn; + tx = txIn; i = iIn; nDepth = nDepthIn; fSpendable = fSpendableIn; } std::string ToString() const diff --git a/src/walletdb.cpp b/src/walletdb.cpp index 3ce2ef019c..9338d57097 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -112,6 +112,12 @@ bool CWalletDB::WriteCScript(const uint160& hash, const CScript& redeemScript) return Write(std::make_pair(std::string("cscript"), hash), redeemScript, false); } +bool CWalletDB::WriteWatchOnly(const CTxDestination &dest) +{ + nWalletDBUpdated++; + return Write(std::make_pair(std::string("watch"), CBitcoinAddress(dest).ToString()), '1'); +} + bool CWalletDB::WriteBestBlock(const CBlockLocator& locator) { nWalletDBUpdated++; @@ -404,6 +410,19 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, wss.fAnyUnordered = true; } } + else if (strType == "watch") + { + std::string strAddress; + ssKey >> strAddress; + char fYes; + ssValue >> fYes; + if (fYes == '1') + pwallet->LoadWatchOnly(CBitcoinAddress(strAddress).Get()); + + // Watch-only addresses have no birthday information for now, + // so set the wallet birthday to the beginning of time. + pwallet->nTimeFirstKey = 1; + } else if (strType == "key" || strType == "wkey") { CPubKey vchPubKey; diff --git a/src/walletdb.h b/src/walletdb.h index 8eb716acbb..3a6cb152a1 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -7,6 +7,7 @@ #include "db.h" #include "key.h" +#include "keystore.h" #include #include @@ -93,6 +94,8 @@ public: bool WriteCScript(const uint160& hash, const CScript& redeemScript); + bool WriteWatchOnly(const CTxDestination &dest); + bool WriteBestBlock(const CBlockLocator& locator); bool ReadBestBlock(CBlockLocator& locator); From 2935b211033610d7ef0deef9bf1b344a5bac029f Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 10 Dec 2013 15:27:53 +0100 Subject: [PATCH 0296/1288] qt: Hide unspendable outputs in coin control --- src/qt/walletmodel.cpp | 6 ++++-- src/wallet.cpp | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index d32e74b78a..098d39e8a7 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -60,7 +60,8 @@ qint64 WalletModel::getBalance(const CCoinControl *coinControl) const std::vector vCoins; wallet->AvailableCoins(vCoins, true, coinControl); BOOST_FOREACH(const COutput& out, vCoins) - nBalance += out.tx->vout[out.i].nValue; + if(out.fSpendable) + nBalance += out.tx->vout[out.i].nValue; return nBalance; } @@ -585,7 +586,8 @@ void WalletModel::listCoins(std::map >& mapCoins) } CTxDestination address; - if(!ExtractDestination(cout.tx->vout[cout.i].scriptPubKey, address)) continue; + if(!out.fSpendable || !ExtractDestination(cout.tx->vout[cout.i].scriptPubKey, address)) + continue; mapCoins[CBitcoinAddress(address).ToString().c_str()].push_back(out); } } diff --git a/src/wallet.cpp b/src/wallet.cpp index 3d679f4c56..40ace9c40b 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1259,6 +1259,8 @@ bool CWallet::SelectCoins(int64_t nTargetValue, setvout[out.i].nValue; setCoinsRet.insert(make_pair(out.tx, out.i)); } From ffd40da361639faeef405c7e4a504a340d77aa5b Mon Sep 17 00:00:00 2001 From: JaSK Date: Sat, 29 Mar 2014 05:15:28 +0100 Subject: [PATCH 0297/1288] Watchonly balances are shown separately in gui. --- src/qt/forms/overviewpage.ui | 525 +++++++++++++++++++++++------------ src/qt/overviewpage.cpp | 34 ++- src/qt/overviewpage.h | 6 +- src/qt/sendcoinsdialog.cpp | 13 +- src/qt/sendcoinsdialog.h | 3 +- src/qt/transactiondesc.cpp | 64 +++-- src/qt/transactionrecord.cpp | 17 +- src/qt/walletmodel.cpp | 27 +- src/qt/walletmodel.h | 9 +- src/rpcdump.cpp | 4 +- src/rpcmisc.cpp | 2 +- src/script.h | 2 + src/wallet.cpp | 53 +++- src/wallet.h | 71 ++++- 14 files changed, 597 insertions(+), 233 deletions(-) diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui index e662912781..8784da5f3e 100644 --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -6,7 +6,7 @@ 0 0 - 573 + 596 342 @@ -46,204 +46,369 @@ - - - - 75 - true - - - - Wallet - - + + + + + + 75 + true + + + + Wallet + + + + + + + The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. + + + QLabel { color: red; } + + + (out of sync) + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + - - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - QLabel { color: red; } - - - (out of sync) - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - + + + + + + 75 + true + + + + Watchonly: + + + Qt::AlignCenter + + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 40 + 20 + + + + + - - - - - QFormLayout::AllNonFixedFieldsGrow - - - 12 - - - 12 - - - - - Available: + + + + + QFormLayout::AllNonFixedFieldsGrow - + + 12 + + + 12 + + + + + Available: + + + + + + + + 75 + true + + + + IBeamCursor + + + Your current spendable balance + + + 0 BTC + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Pending: + + + + + + + + 75 + true + + + + IBeamCursor + + + Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance + + + 0 BTC + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Immature: + + + + + + + + 75 + true + + + + IBeamCursor + + + Mined balance that has not yet matured + + + 0 BTC + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Qt::Horizontal + + + + + + + Total: + + + + + + + + 75 + true + + + + IBeamCursor + + + Your current total balance + + + 0 BTC + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + - - - - - 75 - true - + + + + QFormLayout::AllNonFixedFieldsGrow - - IBeamCursor + + 12 - - Your current spendable balance + + 12 - - 0 BTC - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - + + + + + 75 + true + + + + IBeamCursor + + + Your current balance in watchonly addresses + + + 0 BTC + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + 75 + true + + + + IBeamCursor + + + Unconfirmed transactions to watchonly addresses + + + 0 BTC + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + 75 + true + + + + IBeamCursor + + + Mined balance in watchonly addresses that has not yet matured + + + 0 BTC + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + 0 + 0 + + + + + 140 + 0 + + + + Qt::Horizontal + + + + + + + + 75 + true + + + + IBeamCursor + + + Current total balance in watchonly addresses + + + 0 BTC + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + - - - - Pending: - - - - - - - - 75 - true - - - - IBeamCursor - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - 0 BTC - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Immature: - - - - - - - - 75 - true - - - - Mined balance that has not yet matured - - - 0 BTC - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Total: - - - - - - - - 75 - true - - - - IBeamCursor - - - Your current total balance - - - 0 BTC - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Qt::Horizontal - - - - - Qt::Horizontal + + QSizePolicy::Expanding + - 40 + 20 20 diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 1a9d1de571..1278f368cf 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -103,6 +103,9 @@ OverviewPage::OverviewPage(QWidget *parent) : currentBalance(-1), currentUnconfirmedBalance(-1), currentImmatureBalance(-1), + currentWatchOnlyBalance(-1), + currentWatchUnconfBalance(-1), + currentWatchImmatureBalance(-1), txdelegate(new TxViewDelegate()), filter(0) { @@ -135,22 +138,39 @@ OverviewPage::~OverviewPage() delete ui; } -void OverviewPage::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance) +void OverviewPage::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance, qint64 watchOnlyBalance, qint64 watchUnconfBalance, qint64 watchImmatureBalance) { int unit = walletModel->getOptionsModel()->getDisplayUnit(); currentBalance = balance; currentUnconfirmedBalance = unconfirmedBalance; currentImmatureBalance = immatureBalance; + currentWatchOnlyBalance = watchOnlyBalance; + currentWatchUnconfBalance = watchUnconfBalance; + currentWatchImmatureBalance = watchImmatureBalance; ui->labelBalance->setText(BitcoinUnits::formatWithUnit(unit, balance)); ui->labelUnconfirmed->setText(BitcoinUnits::formatWithUnit(unit, unconfirmedBalance)); ui->labelImmature->setText(BitcoinUnits::formatWithUnit(unit, immatureBalance)); ui->labelTotal->setText(BitcoinUnits::formatWithUnit(unit, balance + unconfirmedBalance + immatureBalance)); + ui->labelWatchAvailable->setText(BitcoinUnits::formatWithUnit(unit, watchOnlyBalance)); + ui->labelWatchPending->setText(BitcoinUnits::formatWithUnit(unit, watchUnconfBalance)); + ui->labelWatchImmature->setText(BitcoinUnits::formatWithUnit(unit, watchImmatureBalance)); + ui->labelWatchTotal->setText(BitcoinUnits::formatWithUnit(unit, watchOnlyBalance + watchUnconfBalance + watchImmatureBalance)); // only show immature (newly mined) balance if it's non-zero, so as not to complicate things // for the non-mining users bool showImmature = immatureBalance != 0; - ui->labelImmature->setVisible(showImmature); - ui->labelImmatureText->setVisible(showImmature); + bool showWatchOnlyImmature = watchImmatureBalance != 0; + bool showWatchOnly = (watchOnlyBalance != 0 || watchUnconfBalance != 0 || showWatchOnlyImmature); + + // for symmetry reasons also show immature label when the watchonly one is shown + ui->labelImmature->setVisible(showImmature || showWatchOnlyImmature); + ui->labelImmatureText->setVisible(showImmature || showWatchOnlyImmature); + ui->labelWatchonly->setVisible(showWatchOnly); // show Watchonly label + ui->lineWatchBalance->setVisible(showWatchOnly); // show watchonly balance separator line + ui->labelWatchAvailable->setVisible(showWatchOnly); // show watchonly available balance + ui->labelWatchImmature->setVisible(showWatchOnlyImmature); // show watchonly immature balance + ui->labelWatchPending->setVisible(showWatchOnly); // show watchonly pending balance + ui->labelWatchTotal->setVisible(showWatchOnly); // show watchonly total balance } void OverviewPage::setClientModel(ClientModel *model) @@ -182,8 +202,9 @@ void OverviewPage::setWalletModel(WalletModel *model) ui->listTransactions->setModelColumn(TransactionTableModel::ToAddress); // Keep up to date with wallet - setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance()); - connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64))); + setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance(), + model->getWatchBalance(), model->getWatchUnconfirmedBalance(), model->getWatchImmatureBalance()); + connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64, qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64, qint64, qint64, qint64))); connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); } @@ -197,7 +218,8 @@ void OverviewPage::updateDisplayUnit() if(walletModel && walletModel->getOptionsModel()) { if(currentBalance != -1) - setBalance(currentBalance, currentUnconfirmedBalance, currentImmatureBalance); + setBalance(currentBalance, currentUnconfirmedBalance, currentImmatureBalance, + currentWatchOnlyBalance, currentWatchUnconfBalance, currentWatchImmatureBalance); // Update txdelegate->unit with the current unit txdelegate->unit = walletModel->getOptionsModel()->getDisplayUnit(); diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h index 2507a3fb31..fe00106770 100644 --- a/src/qt/overviewpage.h +++ b/src/qt/overviewpage.h @@ -34,7 +34,8 @@ public: void showOutOfSyncWarning(bool fShow); public slots: - void setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance); + void setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance, + qint64 watchOnlyBalance, qint64 watchUnconfBalance, qint64 watchImmatureBalance); signals: void transactionClicked(const QModelIndex &index); @@ -46,6 +47,9 @@ private: qint64 currentBalance; qint64 currentUnconfirmedBalance; qint64 currentImmatureBalance; + qint64 currentWatchOnlyBalance; + qint64 currentWatchUnconfBalance; + qint64 currentWatchImmatureBalance; TxViewDelegate *txdelegate; TransactionFilterProxy *filter; diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index b7d74d7039..6f10ed5b0b 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -90,8 +90,9 @@ void SendCoinsDialog::setModel(WalletModel *model) } } - setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance()); - connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64))); + setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance(), + model->getWatchBalance(), model->getWatchUnconfirmedBalance(), model->getWatchImmatureBalance()); + connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64, qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64, qint64, qint64, qint64))); connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); // Coin Control @@ -383,10 +384,14 @@ bool SendCoinsDialog::handlePaymentRequest(const SendCoinsRecipient &rv) return true; } -void SendCoinsDialog::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance) +void SendCoinsDialog::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance, + qint64 watchBalance, qint64 watchUnconfirmedBalance, qint64 watchImmatureBalance) { Q_UNUSED(unconfirmedBalance); Q_UNUSED(immatureBalance); + Q_UNUSED(watchBalance); + Q_UNUSED(watchUnconfirmedBalance); + Q_UNUSED(watchImmatureBalance); if(model && model->getOptionsModel()) { @@ -396,7 +401,7 @@ void SendCoinsDialog::setBalance(qint64 balance, qint64 unconfirmedBalance, qint void SendCoinsDialog::updateDisplayUnit() { - setBalance(model->getBalance(), 0, 0); + setBalance(model->getBalance(), 0, 0, 0, 0, 0); } void SendCoinsDialog::processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg) diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h index fcae26c720..6cdf4a00c8 100644 --- a/src/qt/sendcoinsdialog.h +++ b/src/qt/sendcoinsdialog.h @@ -47,7 +47,8 @@ public slots: void accept(); SendCoinsEntry *addEntry(); void updateTabsAndLabels(); - void setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance); + void setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance, + qint64 watchOnlyBalance, qint64 watchUnconfBalance, qint64 watchImmatureBalance); private: Ui::SendCoinsDialog *ui; diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index e48dbcac9d..76dc47318d 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -89,19 +89,27 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco if (nNet > 0) { // Credit - if (CBitcoinAddress(rec->address).IsValid()) + BOOST_FOREACH(const CTxOut& txout, wtx.vout) { - CTxDestination address = CBitcoinAddress(rec->address).Get(); - if (wallet->mapAddressBook.count(address)) + if (wallet->IsMine(txout)) { - strHTML += "" + tr("From") + ": " + tr("unknown") + "
"; - strHTML += "" + tr("To") + ": "; - strHTML += GUIUtil::HtmlEscape(rec->address); - if (!wallet->mapAddressBook[address].name.empty()) - strHTML += " (" + tr("own address") + ", " + tr("label") + ": " + GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + ")"; - else - strHTML += " (" + tr("own address") + ")"; - strHTML += "
"; + if (CBitcoinAddress(rec->address).IsValid()) + { + CTxDestination address = CBitcoinAddress(rec->address).Get(); + if (wallet->mapAddressBook.count(address)) + { + strHTML += "" + tr("From") + ": " + tr("unknown") + "
"; + strHTML += "" + tr("To") + ": "; + strHTML += GUIUtil::HtmlEscape(rec->address); + std::string addressOwned = wallet->IsMine(txout) == MINE_SPENDABLE ? "own address" : "watch-only"; + if (!wallet->mapAddressBook[address].name.empty()) + strHTML += " (" + tr(addressOwned.c_str()) + ", " + tr("label") + ": " + GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + ")"; + else + strHTML += " (" + tr(addressOwned.c_str()) + ")"; + strHTML += "
"; + } + } + break; } } } @@ -148,22 +156,33 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco } else { - bool fAllFromMe = true; + isminetype fAllFromMe = MINE_SPENDABLE; BOOST_FOREACH(const CTxIn& txin, wtx.vin) - fAllFromMe = fAllFromMe && wallet->IsMine(txin); + { + isminetype mine = wallet->IsMine(txin); + if(fAllFromMe > mine) fAllFromMe = mine; + } - bool fAllToMe = true; + isminetype fAllToMe = MINE_SPENDABLE; BOOST_FOREACH(const CTxOut& txout, wtx.vout) - fAllToMe = fAllToMe && wallet->IsMine(txout); + { + isminetype mine = wallet->IsMine(txout); + if(fAllToMe > mine) fAllToMe = mine; + } if (fAllFromMe) { + if(fAllFromMe == MINE_WATCH_ONLY) + strHTML += "" + tr("From") + ": " + tr("watch-only") + "
"; + // // Debit // BOOST_FOREACH(const CTxOut& txout, wtx.vout) { - if (wallet->IsMine(txout)) + // Ignore change + isminetype toSelf = wallet->IsMine(txout); + if ((toSelf == MINE_SPENDABLE) && (fAllFromMe == MINE_SPENDABLE)) continue; if (!wtx.mapValue.count("to") || wtx.mapValue["to"].empty()) @@ -176,11 +195,17 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco if (wallet->mapAddressBook.count(address) && !wallet->mapAddressBook[address].name.empty()) strHTML += GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + " "; strHTML += GUIUtil::HtmlEscape(CBitcoinAddress(address).ToString()); + if(toSelf == MINE_SPENDABLE) + strHTML += " (own address)"; + else if(toSelf == MINE_WATCH_ONLY) + strHTML += " (watch-only)"; strHTML += "
"; } } strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(unit, -txout.nValue) + "
"; + if(toSelf) + strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(unit, txout.nValue) + "
"; } if (fAllToMe) @@ -188,8 +213,8 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco // Payment to self int64_t nChange = wtx.GetChange(); int64_t nValue = nCredit - nChange; - strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(unit, -nValue) + "
"; - strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(unit, nValue) + "
"; + strHTML += "" + tr("Total debit") + ": " + BitcoinUnits::formatWithUnit(unit, -nValue) + "
"; + strHTML += "" + tr("Total credit") + ": " + BitcoinUnits::formatWithUnit(unit, nValue) + "
"; } int64_t nTxFee = nDebit - wtx.GetValueOut(); @@ -286,7 +311,8 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco strHTML += QString::fromStdString(CBitcoinAddress(address).ToString()); } strHTML = strHTML + " " + tr("Amount") + "=" + BitcoinUnits::formatWithUnit(unit, vout.nValue); - strHTML = strHTML + " IsMine=" + (wallet->IsMine(vout) ? tr("true") : tr("false")) + ""; + strHTML = strHTML + " IsMine=" + (wallet->IsMine(vout) & MINE_SPENDABLE ? tr("true") : tr("false")) + ""; + strHTML = strHTML + " IsWatchOnly=" + (wallet->IsMine(vout) & MINE_WATCH_ONLY ? tr("true") : tr("false")) + ""; } } } diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 21f1b7356f..3d77d39893 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -45,7 +45,8 @@ QList TransactionRecord::decomposeTransaction(const CWallet * // BOOST_FOREACH(const CTxOut& txout, wtx.vout) { - if(wallet->IsMine(txout)) + isminetype mine = wallet->IsMine(txout); + if(mine) { TransactionRecord sub(hash, nTime); CTxDestination address; @@ -75,13 +76,19 @@ QList TransactionRecord::decomposeTransaction(const CWallet * } else { - bool fAllFromMe = true; + isminetype fAllFromMe = MINE_SPENDABLE; BOOST_FOREACH(const CTxIn& txin, wtx.vin) - fAllFromMe = fAllFromMe && wallet->IsMine(txin); + { + isminetype mine = wallet->IsMine(txin); + if(fAllFromMe > mine) fAllFromMe = mine; + } - bool fAllToMe = true; + isminetype fAllToMe = MINE_SPENDABLE; BOOST_FOREACH(const CTxOut& txout, wtx.vout) - fAllToMe = fAllToMe && wallet->IsMine(txout); + { + isminetype mine = wallet->IsMine(txout); + if(fAllToMe > mine) fAllToMe = mine; + } if (fAllFromMe && fAllToMe) { diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 098d39e8a7..7317c32766 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -79,6 +79,21 @@ qint64 WalletModel::getImmatureBalance() const return wallet->GetImmatureBalance(); } +qint64 WalletModel::getWatchBalance() const +{ + return wallet->GetWatchOnlyBalance(); +} + +qint64 WalletModel::getWatchUnconfirmedBalance() const +{ + return wallet->GetUnconfirmedWatchOnlyBalance(); +} + +qint64 WalletModel::getWatchImmatureBalance() const +{ + return wallet->GetImmatureWatchOnlyBalance(); +} + int WalletModel::getNumTransactions() const { int numTransactions = 0; @@ -127,13 +142,21 @@ void WalletModel::checkBalanceChanged() qint64 newBalance = getBalance(); qint64 newUnconfirmedBalance = getUnconfirmedBalance(); qint64 newImmatureBalance = getImmatureBalance(); + qint64 newWatchOnlyBalance = getWatchBalance(); + qint64 newWatchUnconfBalance = getWatchUnconfirmedBalance(); + qint64 newWatchImmatureBalance = getWatchImmatureBalance(); - if(cachedBalance != newBalance || cachedUnconfirmedBalance != newUnconfirmedBalance || cachedImmatureBalance != newImmatureBalance) + if(cachedBalance != newBalance || cachedUnconfirmedBalance != newUnconfirmedBalance || cachedImmatureBalance != newImmatureBalance || + cachedWatchOnlyBalance != newWatchOnlyBalance || cachedWatchUnconfBalance != newWatchUnconfBalance || cachedWatchImmatureBalance != newWatchImmatureBalance) { cachedBalance = newBalance; cachedUnconfirmedBalance = newUnconfirmedBalance; cachedImmatureBalance = newImmatureBalance; - emit balanceChanged(newBalance, newUnconfirmedBalance, newImmatureBalance); + cachedWatchOnlyBalance = newWatchOnlyBalance; + cachedWatchUnconfBalance = newWatchUnconfBalance; + cachedWatchImmatureBalance = newWatchImmatureBalance; + emit balanceChanged(newBalance, newUnconfirmedBalance, newImmatureBalance, + newWatchOnlyBalance, newWatchUnconfBalance, newWatchImmatureBalance); } } diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index ccf590aaed..7ad54ff8e6 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -128,6 +128,9 @@ public: qint64 getBalance(const CCoinControl *coinControl = NULL) const; qint64 getUnconfirmedBalance() const; qint64 getImmatureBalance() const; + qint64 getWatchBalance() const; + qint64 getWatchUnconfirmedBalance() const; + qint64 getWatchImmatureBalance() const; int getNumTransactions() const; EncryptionStatus getEncryptionStatus() const; @@ -206,6 +209,9 @@ private: qint64 cachedBalance; qint64 cachedUnconfirmedBalance; qint64 cachedImmatureBalance; + qint64 cachedWatchOnlyBalance; + qint64 cachedWatchUnconfBalance; + qint64 cachedWatchImmatureBalance; qint64 cachedNumTransactions; EncryptionStatus cachedEncryptionStatus; int cachedNumBlocks; @@ -218,7 +224,8 @@ private: signals: // Signal that balance in wallet changed - void balanceChanged(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance); + void balanceChanged(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance, + qint64 watchOnlyBalance, qint64 watchUnconfBalance, qint64 watchImmatureBalance); // Number of transactions in wallet changed void numTransactionsChanged(int count); diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index 5b325c46ee..98af4695d6 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -158,12 +158,14 @@ Value importaddress(const Array& params, bool fHelp) { LOCK2(cs_main, pwalletMain->cs_wallet); + // add to address book or update label + pwalletMain->SetAddressBook(dest, strLabel, "receive"); + // Don't throw error in case an address is already there if (pwalletMain->HaveWatchOnly(dest)) return Value::null; pwalletMain->MarkDirty(); - pwalletMain->SetAddressBook(dest, strLabel, "receive"); if (!pwalletMain->AddWatchOnly(dest)) throw JSONRPCError(RPC_WALLET_ERROR, "Error adding address to wallet"); diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index e2de2dbcdb..3245f7d713 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -171,7 +171,7 @@ Value validateaddress(const Array& params, bool fHelp) ret.push_back(Pair("address", currentAddress)); #ifdef ENABLE_WALLET isminetype mine = pwalletMain ? IsMine(*pwalletMain, dest) : MINE_NO; - ret.push_back(Pair("ismine", mine != MINE_NO)); + ret.push_back(Pair("ismine", mine == MINE_SPENDABLE)); if (mine != MINE_NO) { ret.push_back(Pair("watchonly", mine == MINE_WATCH_ONLY)); Object detail = boost::apply_visitor(DescribeAddressVisitor(mine), dest); diff --git a/src/script.h b/src/script.h index 1db758094e..56c7d01d4e 100644 --- a/src/script.h +++ b/src/script.h @@ -201,6 +201,8 @@ enum isminetype MINE_WATCH_ONLY = 1, MINE_SPENDABLE = 2, }; +/** used for bitflags of isminetype */ +typedef uint8_t isminefilter; // Mandatory script verification flags that all new blocks must comply with for // them to be valid. (but old blocks may not comply with) Currently just P2SH, diff --git a/src/wallet.cpp b/src/wallet.cpp index 40ace9c40b..d4e9fe9d18 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -738,7 +738,7 @@ bool CWallet::IsChange(const CTxOut& txout) const // a better way of identifying which outputs are 'the send' and which are // 'the change' will need to be implemented (maybe extend CWalletTx to remember // which output, if any, was change). - if (ExtractDestination(txout.scriptPubKey, address) && ::IsMine(*this, address)) + if (ExtractDestination(txout.scriptPubKey, address) && ::IsMine(*this, address) == MINE_SPENDABLE) { LOCK(cs_wallet); if (!mapAddressBook.count(address)) @@ -793,7 +793,7 @@ int CWalletTx::GetRequestCount() const } void CWalletTx::GetAmounts(list >& listReceived, - list >& listSent, int64_t& nFee, string& strSentAccount) const + list >& listSent, int64_t& nFee, string& strSentAccount, const isminefilter& filter) const { nFee = 0; listReceived.clear(); @@ -820,9 +820,9 @@ void CWalletTx::GetAmounts(list >& listReceived, // Don't report 'change' txouts if (pwallet->IsChange(txout)) continue; - fIsMine = pwallet->IsMine(txout); + fIsMine = (pwallet->IsMine(txout) & filter); } - else if (!(fIsMine = pwallet->IsMine(txout))) + else if (!(fIsMine = (pwallet->IsMine(txout) & filter))) continue; // In either case, we need to get the destination address @@ -1066,6 +1066,51 @@ int64_t CWallet::GetImmatureBalance() const return nTotal; } +int64_t CWallet::GetWatchOnlyBalance() const +{ + int64_t nTotal = 0; + { + LOCK(cs_wallet); + for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) + { + const CWalletTx* pcoin = &(*it).second; + if (pcoin->IsTrusted()) + nTotal += pcoin->GetAvailableWatchOnlyCredit(); + } + } + + return nTotal; +} + +int64_t CWallet::GetUnconfirmedWatchOnlyBalance() const +{ + int64_t nTotal = 0; + { + LOCK(cs_wallet); + for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) + { + const CWalletTx* pcoin = &(*it).second; + if (!IsFinalTx(*pcoin) || (!pcoin->IsTrusted() && pcoin->GetDepthInMainChain() == 0)) + nTotal += pcoin->GetAvailableWatchOnlyCredit(); + } + } + return nTotal; +} + +int64_t CWallet::GetImmatureWatchOnlyBalance() const +{ + int64_t nTotal = 0; + { + LOCK(cs_wallet); + for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) + { + const CWalletTx* pcoin = &(*it).second; + nTotal += pcoin->GetImmatureWatchOnlyCredit(); + } + } + return nTotal; +} + // populate vCoins with vector of available COutputs. void CWallet::AvailableCoins(vector& vCoins, bool fOnlyConfirmed, const CCoinControl *coinControl) const { diff --git a/src/wallet.h b/src/wallet.h index ff6af3a6a8..355aa36973 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -262,6 +262,9 @@ public: int64_t GetBalance() const; int64_t GetUnconfirmedBalance() const; int64_t GetImmatureBalance() const; + int64_t GetWatchOnlyBalance() const; + int64_t GetUnconfirmedWatchOnlyBalance() const; + int64_t GetImmatureWatchOnlyBalance() const; bool CreateTransaction(const std::vector >& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, int64_t& nFeeRet, std::string& strFailReason, const CCoinControl *coinControl = NULL); bool CreateTransaction(CScript scriptPubKey, int64_t nValue, @@ -290,11 +293,11 @@ public: { return ::IsMine(*this, txout.scriptPubKey); } - int64_t GetCredit(const CTxOut& txout) const + int64_t GetCredit(const CTxOut& txout, const isminefilter& filter = (MINE_WATCH_ONLY | MINE_SPENDABLE)) const { if (!MoneyRange(txout.nValue)) throw std::runtime_error("CWallet::GetCredit() : value out of range"); - return (IsMine(txout) ? txout.nValue : 0); + return ((IsMine(txout) & filter) ? txout.nValue : 0); } bool IsChange(const CTxOut& txout) const; int64_t GetChange(const CTxOut& txout) const @@ -332,12 +335,12 @@ public: } return nDebit; } - int64_t GetCredit(const CTransaction& tx) const + int64_t GetCredit(const CTransaction& tx, const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const { int64_t nCredit = 0; BOOST_FOREACH(const CTxOut& txout, tx.vout) { - nCredit += GetCredit(txout); + nCredit += GetCredit(txout, filter); if (!MoneyRange(nCredit)) throw std::runtime_error("CWallet::GetCredit() : value out of range"); } @@ -483,11 +486,15 @@ public: mutable bool fCreditCached; mutable bool fImmatureCreditCached; mutable bool fAvailableCreditCached; + mutable bool fImmatureWatchCreditCached; + mutable bool fAvailableWatchCreditCached; mutable bool fChangeCached; mutable int64_t nDebitCached; mutable int64_t nCreditCached; mutable int64_t nImmatureCreditCached; mutable int64_t nAvailableCreditCached; + mutable int64_t nImmatureWatchCreditCached; + mutable int64_t nAvailableWatchCreditCached; mutable int64_t nChangeCached; CWalletTx() @@ -524,11 +531,15 @@ public: fCreditCached = false; fImmatureCreditCached = false; fAvailableCreditCached = false; + fImmatureWatchCreditCached = false; + fAvailableWatchCreditCached = false; fChangeCached = false; nDebitCached = 0; nCreditCached = 0; nImmatureCreditCached = 0; nAvailableCreditCached = 0; + nAvailableWatchCreditCached = 0; + nImmatureWatchCreditCached = 0; nChangeCached = 0; nOrderPos = -1; } @@ -581,6 +592,8 @@ public: { fCreditCached = false; fAvailableCreditCached = false; + fAvailableWatchCreditCached = false; + fImmatureWatchCreditCached = false; fDebitCached = false; fChangeCached = false; } @@ -622,7 +635,7 @@ public: { if (fUseCache && fImmatureCreditCached) return nImmatureCreditCached; - nImmatureCreditCached = pwallet->GetCredit(*this); + nImmatureCreditCached = pwallet->GetCredit(*this, MINE_SPENDABLE); fImmatureCreditCached = true; return nImmatureCreditCached; } @@ -649,7 +662,7 @@ public: if (!pwallet->IsSpent(hashTx, i)) { const CTxOut &txout = vout[i]; - nCredit += pwallet->GetCredit(txout); + nCredit += pwallet->GetCredit(txout, MINE_SPENDABLE); if (!MoneyRange(nCredit)) throw std::runtime_error("CWalletTx::GetAvailableCredit() : value out of range"); } @@ -660,6 +673,48 @@ public: return nCredit; } + int64_t GetImmatureWatchOnlyCredit(const bool& fUseCache=true) const + { + if (IsCoinBase() && GetBlocksToMaturity() > 0 && IsInMainChain()) + { + if (fUseCache && fImmatureWatchCreditCached) + return nImmatureWatchCreditCached; + nImmatureWatchCreditCached = pwallet->GetCredit(*this, MINE_WATCH_ONLY); + fImmatureWatchCreditCached = true; + return nImmatureWatchCreditCached; + } + + return 0; + } + + int64_t GetAvailableWatchOnlyCredit(const bool& fUseCache=true) const + { + if (pwallet == 0) + return 0; + + // Must wait until coinbase is safely deep enough in the chain before valuing it + if (IsCoinBase() && GetBlocksToMaturity() > 0) + return 0; + + if (fUseCache && fAvailableWatchCreditCached) + return nAvailableWatchCreditCached; + + int64_t nCredit = 0; + for (unsigned int i = 0; i < vout.size(); i++) + { + if (!pwallet->IsSpent(GetHash(), i)) + { + const CTxOut &txout = vout[i]; + nCredit += pwallet->GetCredit(txout, MINE_WATCH_ONLY); + if (!MoneyRange(nCredit)) + throw std::runtime_error("CWalletTx::GetAvailableCredit() : value out of range"); + } + } + + nAvailableWatchCreditCached = nCredit; + fAvailableWatchCreditCached = true; + return nCredit; + } int64_t GetChange() const { @@ -671,7 +726,7 @@ public: } void GetAmounts(std::list >& listReceived, - std::list >& listSent, int64_t& nFee, std::string& strSentAccount) const; + std::list >& listSent, int64_t& nFee, std::string& strSentAccount, const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const; void GetAccountAmounts(const std::string& strAccount, int64_t& nReceived, int64_t& nSent, int64_t& nFee) const; @@ -702,7 +757,7 @@ public: if (parent == NULL) return false; const CTxOut& parentOut = parent->vout[txin.prevout.n]; - if (!pwallet->IsMine(parentOut)) + if (pwallet->IsMine(parentOut) != MINE_SPENDABLE) return false; } return true; From d2692f61164730322547871f2124de06ade0436b Mon Sep 17 00:00:00 2001 From: JaSK Date: Sat, 5 Apr 2014 21:36:48 +0200 Subject: [PATCH 0298/1288] Watchonly transactions are marked in transaction history --- src/qt/transactionrecord.cpp | 7 +++++++ src/qt/transactionrecord.h | 3 +++ src/qt/transactiontablemodel.cpp | 11 +++++++---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 3d77d39893..1011363f3e 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -70,16 +70,19 @@ QList TransactionRecord::decomposeTransaction(const CWallet * sub.type = TransactionRecord::Generated; } + sub.involvesWatchAddress = mine == MINE_WATCH_ONLY; parts.append(sub); } } } else { + bool involvesWatchAddress = false; isminetype fAllFromMe = MINE_SPENDABLE; BOOST_FOREACH(const CTxIn& txin, wtx.vin) { isminetype mine = wallet->IsMine(txin); + if(mine == MINE_WATCH_ONLY) involvesWatchAddress = true; if(fAllFromMe > mine) fAllFromMe = mine; } @@ -87,6 +90,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * BOOST_FOREACH(const CTxOut& txout, wtx.vout) { isminetype mine = wallet->IsMine(txout); + if(mine == MINE_WATCH_ONLY) involvesWatchAddress = true; if(fAllToMe > mine) fAllToMe = mine; } @@ -97,6 +101,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * parts.append(TransactionRecord(hash, nTime, TransactionRecord::SendToSelf, "", -(nDebit - nChange), nCredit - nChange)); + parts.last().involvesWatchAddress = involvesWatchAddress; } else if (fAllFromMe) { @@ -141,6 +146,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * } sub.debit = -nValue; + sub.involvesWatchAddress = involvesWatchAddress; parts.append(sub); } } @@ -150,6 +156,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * // Mixed debit transaction, can't break down payees // parts.append(TransactionRecord(hash, nTime, TransactionRecord::Other, "", nNet, 0)); + parts.last().involvesWatchAddress = involvesWatchAddress; } } diff --git a/src/qt/transactionrecord.h b/src/qt/transactionrecord.h index 37679cebfa..d3cfa77d97 100644 --- a/src/qt/transactionrecord.h +++ b/src/qt/transactionrecord.h @@ -137,6 +137,9 @@ public: /** Status: can change with block chain update */ TransactionStatus status; + /** Whether the transaction was sent/received with a watch-only address */ + bool involvesWatchAddress; + /** Return the unique identifier for this transaction (part) */ QString getTxID() const; diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index a935752246..c357d26a9d 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -390,19 +390,22 @@ QVariant TransactionTableModel::txAddressDecoration(const TransactionRecord *wtx QString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const { + // mark transactions involving watch-only addresses: + QString watchAddress = wtx->involvesWatchAddress ? " (w) " : ""; + switch(wtx->type) { case TransactionRecord::RecvFromOther: - return QString::fromStdString(wtx->address); + return QString::fromStdString(wtx->address) + watchAddress; case TransactionRecord::RecvWithAddress: case TransactionRecord::SendToAddress: case TransactionRecord::Generated: - return lookupAddress(wtx->address, tooltip); + return lookupAddress(wtx->address, tooltip) + watchAddress; case TransactionRecord::SendToOther: - return QString::fromStdString(wtx->address); + return QString::fromStdString(wtx->address) + watchAddress; case TransactionRecord::SendToSelf: default: - return tr("(n/a)"); + return tr("(n/a)") + watchAddress; } } From d4640d7d8c3ba373195d33ab75db9c8cb43f8806 Mon Sep 17 00:00:00 2001 From: JaSK Date: Tue, 8 Apr 2014 15:23:50 +0200 Subject: [PATCH 0299/1288] Added argument to getbalance to include watchonly addresses and fixed errors in balance calculation. --- src/rpcclient.cpp | 1 + src/rpcwallet.cpp | 23 +++++++++++++-------- src/wallet.cpp | 10 ++++----- src/wallet.h | 52 +++++++++++++++++++++++++++++++++++++---------- 4 files changed, 62 insertions(+), 24 deletions(-) diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index 76c99e7c9f..ea5ca8e0f6 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -40,6 +40,7 @@ static const CRPCConvertParam vRPCConvertParams[] = { "listreceivedbyaccount", 0 }, { "listreceivedbyaccount", 1 }, { "getbalance", 1 }, + { "getbalance", 2 }, { "getblockhash", 0 }, { "move", 2 }, { "move", 3 }, diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 38e96133b4..79b438d417 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -557,7 +557,7 @@ Value getreceivedbyaccount(const Array& params, bool fHelp) } -int64_t GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMinDepth) +int64_t GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMinDepth, const isminefilter& filter = MINE_SPENDABLE) { int64_t nBalance = 0; @@ -569,7 +569,7 @@ int64_t GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMi continue; int64_t nReceived, nSent, nFee; - wtx.GetAccountAmounts(strAccount, nReceived, nSent, nFee); + wtx.GetAccountAmounts(strAccount, nReceived, nSent, nFee, filter); if (nReceived != 0 && wtx.GetDepthInMainChain() >= nMinDepth) nBalance += nReceived; @@ -582,18 +582,18 @@ int64_t GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMi return nBalance; } -int64_t GetAccountBalance(const string& strAccount, int nMinDepth) +int64_t GetAccountBalance(const string& strAccount, int nMinDepth, const isminefilter& filter = MINE_SPENDABLE) { CWalletDB walletdb(pwalletMain->strWalletFile); - return GetAccountBalance(walletdb, strAccount, nMinDepth); + return GetAccountBalance(walletdb, strAccount, nMinDepth, filter); } Value getbalance(const Array& params, bool fHelp) { - if (fHelp || params.size() > 2) + if (fHelp || params.size() > 3) throw runtime_error( - "getbalance ( \"account\" minconf )\n" + "getbalance ( \"account\" minconf includeWatchonly )\n" "\nIf account is not specified, returns the server's total available balance.\n" "If account is specified, returns the balance in the account.\n" "Note that the account \"\" is not the same as leaving the parameter out.\n" @@ -601,6 +601,7 @@ Value getbalance(const Array& params, bool fHelp) "\nArguments:\n" "1. \"account\" (string, optional) The selected account, or \"*\" for entire wallet. It may be the default account using \"\".\n" "2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n" + "3. includeWatchonly (bool, optional, default=false) Also include balance in watchonly addresses (see 'importaddress')\n" "\nResult:\n" "amount (numeric) The total amount in btc received for this account.\n" "\nExamples:\n" @@ -620,8 +621,14 @@ Value getbalance(const Array& params, bool fHelp) return ValueFromAmount(pwalletMain->GetBalance()); int nMinDepth = 1; + isminefilter filter = MINE_SPENDABLE; if (params.size() > 1) + { nMinDepth = params[1].get_int(); + if(params.size() > 2) + if(params[2].get_bool()) + filter = filter | MINE_WATCH_ONLY; + } if (params[0].get_str() == "*") { // Calculate total balance a different way from GetBalance() @@ -638,7 +645,7 @@ Value getbalance(const Array& params, bool fHelp) string strSentAccount; list > listReceived; list > listSent; - wtx.GetAmounts(listReceived, listSent, allFee, strSentAccount); + wtx.GetAmounts(listReceived, listSent, allFee, strSentAccount, filter); if (wtx.GetDepthInMainChain() >= nMinDepth) { BOOST_FOREACH(const PAIRTYPE(CTxDestination,int64_t)& r, listReceived) @@ -653,7 +660,7 @@ Value getbalance(const Array& params, bool fHelp) string strAccount = AccountFromValue(params[0]); - int64_t nBalance = GetAccountBalance(strAccount, nMinDepth); + int64_t nBalance = GetAccountBalance(strAccount, nMinDepth, filter); return ValueFromAmount(nBalance); } diff --git a/src/wallet.cpp b/src/wallet.cpp index d4e9fe9d18..3c9aa3306f 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -711,7 +711,7 @@ isminetype CWallet::IsMine(const CTxIn &txin) const return MINE_NO; } -int64_t CWallet::GetDebit(const CTxIn &txin) const +int64_t CWallet::GetDebit(const CTxIn &txin, const isminefilter& filter) const { { LOCK(cs_wallet); @@ -720,7 +720,7 @@ int64_t CWallet::GetDebit(const CTxIn &txin) const { const CWalletTx& prev = (*mi).second; if (txin.prevout.n < prev.vout.size()) - if (IsMine(prev.vout[txin.prevout.n])) + if (IsMine(prev.vout[txin.prevout.n]) & filter) return prev.vout[txin.prevout.n].nValue; } } @@ -801,7 +801,7 @@ void CWalletTx::GetAmounts(list >& listReceived, strSentAccount = strFromAccount; // Compute fee: - int64_t nDebit = GetDebit(); + int64_t nDebit = GetDebit(filter); if (nDebit > 0) // debit>0 means we signed/sent this transaction { int64_t nValueOut = GetValueOut(); @@ -846,7 +846,7 @@ void CWalletTx::GetAmounts(list >& listReceived, } void CWalletTx::GetAccountAmounts(const string& strAccount, int64_t& nReceived, - int64_t& nSent, int64_t& nFee) const + int64_t& nSent, int64_t& nFee, const isminefilter& filter) const { nReceived = nSent = nFee = 0; @@ -854,7 +854,7 @@ void CWalletTx::GetAccountAmounts(const string& strAccount, int64_t& nReceived, string strSentAccount; list > listReceived; list > listSent; - GetAmounts(listReceived, listSent, allFee, strSentAccount); + GetAmounts(listReceived, listSent, allFee, strSentAccount, filter); if (strAccount == strSentAccount) { diff --git a/src/wallet.h b/src/wallet.h index 355aa36973..b11e6c662e 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -288,12 +288,12 @@ public: std::set GetAccountAddresses(std::string strAccount) const; isminetype IsMine(const CTxIn& txin) const; - int64_t GetDebit(const CTxIn& txin) const; + int64_t GetDebit(const CTxIn& txin, const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const; isminetype IsMine(const CTxOut& txout) const { return ::IsMine(*this, txout.scriptPubKey); } - int64_t GetCredit(const CTxOut& txout, const isminefilter& filter = (MINE_WATCH_ONLY | MINE_SPENDABLE)) const + int64_t GetCredit(const CTxOut& txout, const isminefilter& filter=(MINE_WATCH_ONLY|MINE_SPENDABLE)) const { if (!MoneyRange(txout.nValue)) throw std::runtime_error("CWallet::GetCredit() : value out of range"); @@ -324,12 +324,12 @@ public: return true; return false; } - int64_t GetDebit(const CTransaction& tx) const + int64_t GetDebit(const CTransaction& tx, const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const { int64_t nDebit = 0; BOOST_FOREACH(const CTxIn& txin, tx.vin) { - nDebit += GetDebit(txin); + nDebit += GetDebit(txin, filter); if (!MoneyRange(nDebit)) throw std::runtime_error("CWallet::GetDebit() : value out of range"); } @@ -486,6 +486,8 @@ public: mutable bool fCreditCached; mutable bool fImmatureCreditCached; mutable bool fAvailableCreditCached; + mutable bool fWatchDebitCached; + mutable bool fWatchCreditCached; mutable bool fImmatureWatchCreditCached; mutable bool fAvailableWatchCreditCached; mutable bool fChangeCached; @@ -493,6 +495,8 @@ public: mutable int64_t nCreditCached; mutable int64_t nImmatureCreditCached; mutable int64_t nAvailableCreditCached; + mutable int64_t nWatchDebitCached; + mutable int64_t nWatchCreditCached; mutable int64_t nImmatureWatchCreditCached; mutable int64_t nAvailableWatchCreditCached; mutable int64_t nChangeCached; @@ -531,6 +535,8 @@ public: fCreditCached = false; fImmatureCreditCached = false; fAvailableCreditCached = false; + fWatchDebitCached = false; + fWatchCreditCached = false; fImmatureWatchCreditCached = false; fAvailableWatchCreditCached = false; fChangeCached = false; @@ -538,6 +544,8 @@ public: nCreditCached = 0; nImmatureCreditCached = 0; nAvailableCreditCached = 0; + nWatchDebitCached = 0; + nWatchCreditCached = 0; nAvailableWatchCreditCached = 0; nImmatureWatchCreditCached = 0; nChangeCached = 0; @@ -592,6 +600,8 @@ public: { fCreditCached = false; fAvailableCreditCached = false; + fWatchDebitCached = false; + fWatchCreditCached = false; fAvailableWatchCreditCached = false; fImmatureWatchCreditCached = false; fDebitCached = false; @@ -604,15 +614,35 @@ public: MarkDirty(); } - int64_t GetDebit() const + int64_t GetDebit(const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const { if (vin.empty()) return 0; - if (fDebitCached) - return nDebitCached; - nDebitCached = pwallet->GetDebit(*this); - fDebitCached = true; - return nDebitCached; + + int64_t debit = 0; + if(filter & MINE_SPENDABLE) + { + if (fDebitCached) + debit += nDebitCached; + else + { + nDebitCached = pwallet->GetDebit(*this, MINE_SPENDABLE); + fDebitCached = true; + debit += nDebitCached; + } + } + if(filter & MINE_WATCH_ONLY) + { + if(fWatchDebitCached) + debit += nWatchDebitCached; + else + { + nWatchDebitCached = pwallet->GetDebit(*this, MINE_WATCH_ONLY); + fWatchDebitCached = true; + debit += nWatchDebitCached; + } + } + return debit; } int64_t GetCredit(bool fUseCache=true) const @@ -729,7 +759,7 @@ public: std::list >& listSent, int64_t& nFee, std::string& strSentAccount, const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const; void GetAccountAmounts(const std::string& strAccount, int64_t& nReceived, - int64_t& nSent, int64_t& nFee) const; + int64_t& nSent, int64_t& nFee, const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const; bool IsFromMe() const { From 83f3543f20348aa718620314e7deb37bd0f71b90 Mon Sep 17 00:00:00 2001 From: JaSK Date: Tue, 8 Apr 2014 16:13:15 +0200 Subject: [PATCH 0300/1288] Added argument to listaccounts to include watchonly addresses --- src/rpcclient.cpp | 1 + src/rpcwallet.cpp | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index ea5ca8e0f6..d96b47833f 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -49,6 +49,7 @@ static const CRPCConvertParam vRPCConvertParams[] = { "listtransactions", 1 }, { "listtransactions", 2 }, { "listaccounts", 0 }, + { "listaccounts", 1 }, { "walletpassphrase", 1 }, { "getblocktemplate", 0 }, { "listsinceblock", 1 }, diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 79b438d417..d52a4bc5bb 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1302,12 +1302,13 @@ Value listtransactions(const Array& params, bool fHelp) Value listaccounts(const Array& params, bool fHelp) { - if (fHelp || params.size() > 1) + if (fHelp || params.size() > 2) throw runtime_error( - "listaccounts ( minconf )\n" + "listaccounts ( minconf includeWatchonly)\n" "\nReturns Object that has account names as keys, account balances as values.\n" "\nArguments:\n" - "1. minconf (numeric, optional, default=1) Only onclude transactions with at least this many confirmations\n" + "1. minconf (numeric, optional, default=1) Only onclude transactions with at least this many confirmations\n" + "2. includeWatchonly (bool, optional, default=false) Include balances in watchonly addresses (see 'importaddress')\n" "\nResult:\n" "{ (json object where keys are account names, and values are numeric balances\n" " \"account\": x.xxx, (numeric) The property name is the account name, and the value is the total balance for the account.\n" @@ -1325,12 +1326,18 @@ Value listaccounts(const Array& params, bool fHelp) ); int nMinDepth = 1; + isminefilter includeWatchonly = MINE_SPENDABLE; if (params.size() > 0) + { nMinDepth = params[0].get_int(); + if(params.size() > 1) + if(params[1].get_bool()) + includeWatchonly = includeWatchonly | MINE_WATCH_ONLY; + } map mapAccountBalances; BOOST_FOREACH(const PAIRTYPE(CTxDestination, CAddressBookData)& entry, pwalletMain->mapAddressBook) { - if (IsMine(*pwalletMain, entry.first)) // This address belongs to me + if (IsMine(*pwalletMain, entry.first) & includeWatchonly) // This address belongs to me mapAccountBalances[entry.second.name] = 0; } @@ -1344,7 +1351,7 @@ Value listaccounts(const Array& params, bool fHelp) int nDepth = wtx.GetDepthInMainChain(); if (wtx.GetBlocksToMaturity() > 0 || nDepth < 0) continue; - wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount); + wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount, includeWatchonly); mapAccountBalances[strSentAccount] -= nFee; BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64_t)& s, listSent) mapAccountBalances[strSentAccount] -= s.second; From 952877e01c1045298fd51d1152d96c304d4cf2a4 Mon Sep 17 00:00:00 2001 From: JaSK Date: Wed, 9 Apr 2014 17:20:07 +0200 Subject: [PATCH 0301/1288] Showing 'involvesWatchonly' property for transactions returned by 'listtransactions' and 'listsinceblock'. It is only appended when the transaction involves a watchonly address. --- src/rpcwallet.cpp | 5 +++++ src/wallet.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index d52a4bc5bb..8de10c52f8 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1117,6 +1117,7 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount); bool fAllAccounts = (strAccount == string("*")); + bool involvesWatchonly = wtx.IsFromMe(MINE_WATCH_ONLY); // Sent if ((!listSent.empty() || nFee != 0) && (fAllAccounts || strAccount == strSentAccount)) @@ -1124,6 +1125,8 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64_t)& s, listSent) { Object entry; + if(involvesWatchonly || (::IsMine(*pwalletMain, s.first) & MINE_WATCH_ONLY)) + entry.push_back(Pair("involvesWatchonly", true)); entry.push_back(Pair("account", strSentAccount)); MaybePushAddress(entry, s.first); entry.push_back(Pair("category", "send")); @@ -1146,6 +1149,8 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe if (fAllAccounts || (account == strAccount)) { Object entry; + if(involvesWatchonly || (::IsMine(*pwalletMain, r.first) & MINE_WATCH_ONLY)) + entry.push_back(Pair("involvesWatchonly", true)); entry.push_back(Pair("account", account)); MaybePushAddress(entry, r.first); if (wtx.IsCoinBase()) diff --git a/src/wallet.h b/src/wallet.h index b11e6c662e..3453d23d97 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -761,9 +761,9 @@ public: void GetAccountAmounts(const std::string& strAccount, int64_t& nReceived, int64_t& nSent, int64_t& nFee, const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const; - bool IsFromMe() const + bool IsFromMe(const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const { - return (GetDebit() > 0); + return (GetDebit(filter) > 0); } bool IsTrusted() const From d7d5d23b77e204eccd4bf8a5608c1a499d5fc42f Mon Sep 17 00:00:00 2001 From: JaSK Date: Tue, 8 Apr 2014 17:51:04 +0200 Subject: [PATCH 0302/1288] Added argument to listtransactions and listsinceblock to include watchonly addresses --- src/rpcclient.cpp | 3 ++- src/rpcwallet.cpp | 62 ++++++++++++++++++++++++++++++----------------- 2 files changed, 42 insertions(+), 23 deletions(-) diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index d96b47833f..f329d517b3 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -48,11 +48,13 @@ static const CRPCConvertParam vRPCConvertParams[] = { "sendfrom", 3 }, { "listtransactions", 1 }, { "listtransactions", 2 }, + { "listtransactions", 3 }, { "listaccounts", 0 }, { "listaccounts", 1 }, { "walletpassphrase", 1 }, { "getblocktemplate", 0 }, { "listsinceblock", 1 }, + { "listsinceblock", 2 }, { "sendmany", 1 }, { "sendmany", 2 }, { "addmultisigaddress", 0 }, @@ -129,7 +131,6 @@ Array RPCConvertValues(const std::string &strMethod, const std::vector > listReceived; list > listSent; - wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount); + wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount, filter); bool fAllAccounts = (strAccount == string("*")); bool involvesWatchonly = wtx.IsFromMe(MINE_WATCH_ONLY); @@ -1194,16 +1194,16 @@ void AcentryToJSON(const CAccountingEntry& acentry, const string& strAccount, Ar Value listtransactions(const Array& params, bool fHelp) { - if (fHelp || params.size() > 3) + if (fHelp || params.size() > 4) throw runtime_error( - "listtransactions ( \"account\" count from )\n" + "listtransactions ( \"account\" count from includeWatchonly)\n" "\nReturns up to 'count' most recent transactions skipping the first 'from' transactions for account 'account'.\n" "\nArguments:\n" "1. \"account\" (string, optional) The account name. If not included, it will list all transactions for all accounts.\n" " If \"\" is set, it will list transactions for the default account.\n" "2. count (numeric, optional, default=10) The number of transactions to return\n" "3. from (numeric, optional, default=0) The number of transactions to skip\n" - + "4. includeWatchonly (bool, optional, default=false) Include transactions to watchonly addresses (see 'importaddress')\n" "\nResult:\n" "[\n" " {\n" @@ -1255,15 +1255,26 @@ Value listtransactions(const Array& params, bool fHelp) ); string strAccount = "*"; - if (params.size() > 0) - strAccount = params[0].get_str(); int nCount = 10; - if (params.size() > 1) - nCount = params[1].get_int(); int nFrom = 0; - if (params.size() > 2) - nFrom = params[2].get_int(); - + isminefilter filter = MINE_SPENDABLE; + if (params.size() > 0) + { + strAccount = params[0].get_str(); + if (params.size() > 1) + { + nCount = params[1].get_int(); + if (params.size() > 2) + { + nFrom = params[2].get_int(); + if(params.size() > 3) + { + if(params[3].get_bool()) + filter = filter | MINE_WATCH_ONLY; + } + } + } + } if (nCount < 0) throw JSONRPCError(RPC_INVALID_PARAMETER, "Negative count"); if (nFrom < 0) @@ -1279,7 +1290,7 @@ Value listtransactions(const Array& params, bool fHelp) { CWalletTx *const pwtx = (*it).second.first; if (pwtx != 0) - ListTransactions(*pwtx, strAccount, 0, true, ret); + ListTransactions(*pwtx, strAccount, 0, true, ret, filter); CAccountingEntry *const pacentry = (*it).second.second; if (pacentry != 0) AcentryToJSON(*pacentry, strAccount, ret); @@ -1386,11 +1397,12 @@ Value listsinceblock(const Array& params, bool fHelp) { if (fHelp) throw runtime_error( - "listsinceblock ( \"blockhash\" target-confirmations )\n" + "listsinceblock ( \"blockhash\" target-confirmations includeWatchonly)\n" "\nGet all transactions in blocks since block [blockhash], or all transactions if omitted\n" "\nArguments:\n" "1. \"blockhash\" (string, optional) The block hash to list transactions since\n" "2. target-confirmations: (numeric, optional) The confirmations required, must be 1 or more\n" + "3. includeWatchonly: (bool, optional, default=false) Include transactions to watchonly addresses (see 'importaddress')" "\nResult:\n" "{\n" " \"transactions\": [\n" @@ -1426,7 +1438,7 @@ Value listsinceblock(const Array& params, bool fHelp) CBlockIndex *pindex = NULL; int target_confirms = 1; - + isminefilter filter = MINE_SPENDABLE; if (params.size() > 0) { uint256 blockId = 0; @@ -1435,14 +1447,20 @@ Value listsinceblock(const Array& params, bool fHelp) std::map::iterator it = mapBlockIndex.find(blockId); if (it != mapBlockIndex.end()) pindex = it->second; - } - if (params.size() > 1) - { - target_confirms = params[1].get_int(); + if (params.size() > 1) + { + target_confirms = params[1].get_int(); - if (target_confirms < 1) - throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter"); + if (target_confirms < 1) + throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter"); + + if(params.size() > 2) + { + if(params[2].get_bool()) + filter = filter | MINE_WATCH_ONLY; + } + } } int depth = pindex ? (1 + chainActive.Height() - pindex->nHeight) : -1; @@ -1454,7 +1472,7 @@ Value listsinceblock(const Array& params, bool fHelp) CWalletTx tx = (*it).second; if (depth == -1 || tx.GetDepthInMainChain() < depth) - ListTransactions(tx, "*", 0, true, transactions); + ListTransactions(tx, "*", 0, true, transactions, filter); } CBlockIndex *pblockLast = chainActive[chainActive.Height() + 1 - target_confirms]; From a5c6c5d6df887764ac07664aae842234c19bbf8d Mon Sep 17 00:00:00 2001 From: JaSK Date: Tue, 29 Apr 2014 19:39:01 +0200 Subject: [PATCH 0303/1288] fixed tiny glitch and improved readability like laanwj suggested --- src/qt/transactiondesc.cpp | 6 +-- src/rpcmisc.cpp | 4 +- src/rpcwallet.cpp | 76 ++++++++++++++++---------------------- src/wallet.cpp | 6 +-- 4 files changed, 40 insertions(+), 52 deletions(-) diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 76dc47318d..d94f066ed9 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -101,11 +101,11 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco strHTML += "" + tr("From") + ": " + tr("unknown") + "
"; strHTML += "" + tr("To") + ": "; strHTML += GUIUtil::HtmlEscape(rec->address); - std::string addressOwned = wallet->IsMine(txout) == MINE_SPENDABLE ? "own address" : "watch-only"; + QString addressOwned = wallet->IsMine(txout) == MINE_SPENDABLE ? tr("own address") : tr("watch-only"); if (!wallet->mapAddressBook[address].name.empty()) - strHTML += " (" + tr(addressOwned.c_str()) + ", " + tr("label") + ": " + GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + ")"; + strHTML += " (" + addressOwned + ", " + tr("label") + ": " + GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + ")"; else - strHTML += " (" + tr(addressOwned.c_str()) + ")"; + strHTML += " (" + addressOwned + ")"; strHTML += "
"; } } diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 3245f7d713..f0b4619b26 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -171,9 +171,9 @@ Value validateaddress(const Array& params, bool fHelp) ret.push_back(Pair("address", currentAddress)); #ifdef ENABLE_WALLET isminetype mine = pwalletMain ? IsMine(*pwalletMain, dest) : MINE_NO; - ret.push_back(Pair("ismine", mine == MINE_SPENDABLE)); + ret.push_back(Pair("ismine", (mine & MINE_SPENDABLE) ? true : false)); if (mine != MINE_NO) { - ret.push_back(Pair("watchonly", mine == MINE_WATCH_ONLY)); + ret.push_back(Pair("iswatchonly", (mine & MINE_WATCH_ONLY) ? true: false)); Object detail = boost::apply_visitor(DescribeAddressVisitor(mine), dest); ret.insert(ret.end(), detail.begin(), detail.end()); } diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index a9db442d4c..e9a111f523 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -621,14 +621,12 @@ Value getbalance(const Array& params, bool fHelp) return ValueFromAmount(pwalletMain->GetBalance()); int nMinDepth = 1; - isminefilter filter = MINE_SPENDABLE; if (params.size() > 1) - { nMinDepth = params[1].get_int(); - if(params.size() > 2) - if(params[2].get_bool()) - filter = filter | MINE_WATCH_ONLY; - } + isminefilter filter = MINE_SPENDABLE; + if(params.size() > 2) + if(params[2].get_bool()) + filter = filter | MINE_WATCH_ONLY; if (params[0].get_str() == "*") { // Calculate total balance a different way from GetBalance() @@ -1255,26 +1253,19 @@ Value listtransactions(const Array& params, bool fHelp) ); string strAccount = "*"; - int nCount = 10; - int nFrom = 0; - isminefilter filter = MINE_SPENDABLE; if (params.size() > 0) - { strAccount = params[0].get_str(); - if (params.size() > 1) - { - nCount = params[1].get_int(); - if (params.size() > 2) - { - nFrom = params[2].get_int(); - if(params.size() > 3) - { - if(params[3].get_bool()) - filter = filter | MINE_WATCH_ONLY; - } - } - } - } + int nCount = 10; + if (params.size() > 1) + nCount = params[1].get_int(); + int nFrom = 0; + if (params.size() > 2) + nFrom = params[2].get_int(); + isminefilter filter = MINE_SPENDABLE; + if(params.size() > 3) + if(params[3].get_bool()) + filter = filter | MINE_WATCH_ONLY; + if (nCount < 0) throw JSONRPCError(RPC_INVALID_PARAMETER, "Negative count"); if (nFrom < 0) @@ -1342,14 +1333,12 @@ Value listaccounts(const Array& params, bool fHelp) ); int nMinDepth = 1; - isminefilter includeWatchonly = MINE_SPENDABLE; if (params.size() > 0) - { nMinDepth = params[0].get_int(); - if(params.size() > 1) - if(params[1].get_bool()) - includeWatchonly = includeWatchonly | MINE_WATCH_ONLY; - } + isminefilter includeWatchonly = MINE_SPENDABLE; + if(params.size() > 1) + if(params[1].get_bool()) + includeWatchonly = includeWatchonly | MINE_WATCH_ONLY; map mapAccountBalances; BOOST_FOREACH(const PAIRTYPE(CTxDestination, CAddressBookData)& entry, pwalletMain->mapAddressBook) { @@ -1439,6 +1428,7 @@ Value listsinceblock(const Array& params, bool fHelp) CBlockIndex *pindex = NULL; int target_confirms = 1; isminefilter filter = MINE_SPENDABLE; + if (params.size() > 0) { uint256 blockId = 0; @@ -1447,22 +1437,20 @@ Value listsinceblock(const Array& params, bool fHelp) std::map::iterator it = mapBlockIndex.find(blockId); if (it != mapBlockIndex.end()) pindex = it->second; - - if (params.size() > 1) - { - target_confirms = params[1].get_int(); - - if (target_confirms < 1) - throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter"); - - if(params.size() > 2) - { - if(params[2].get_bool()) - filter = filter | MINE_WATCH_ONLY; - } - } } + if (params.size() > 1) + { + target_confirms = params[1].get_int(); + + if (target_confirms < 1) + throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter"); + } + + if(params.size() > 2) + if(params[2].get_bool()) + filter = filter | MINE_WATCH_ONLY; + int depth = pindex ? (1 + chainActive.Height() - pindex->nHeight) : -1; Array transactions; diff --git a/src/wallet.cpp b/src/wallet.cpp index 3c9aa3306f..4b480321ac 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -811,7 +811,8 @@ void CWalletTx::GetAmounts(list >& listReceived, // Sent/received. BOOST_FOREACH(const CTxOut& txout, vout) { - bool fIsMine; + isminetype fIsMine = pwallet->IsMine(txout); + // Only need to handle txouts if AT LEAST one of these is true: // 1) they debit from us (sent) // 2) the output is to us (received) @@ -820,9 +821,8 @@ void CWalletTx::GetAmounts(list >& listReceived, // Don't report 'change' txouts if (pwallet->IsChange(txout)) continue; - fIsMine = (pwallet->IsMine(txout) & filter); } - else if (!(fIsMine = (pwallet->IsMine(txout) & filter))) + else if (!(fIsMine & filter)) continue; // In either case, we need to get the destination address From f87ba3df64bb5825f7e2f6a33c93cf5738682019 Mon Sep 17 00:00:00 2001 From: JaSK Date: Fri, 23 May 2014 00:58:15 +0200 Subject: [PATCH 0304/1288] added includeWatchonly argument to 'gettransaction' because it affects balance calculation --- src/rpcclient.cpp | 1 + src/rpcwallet.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index f329d517b3..b2387cb062 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -65,6 +65,7 @@ static const CRPCConvertParam vRPCConvertParams[] = { "listunspent", 1 }, { "listunspent", 2 }, { "getblock", 1 }, + { "gettransaction", 1}, { "getrawtransaction", 1 }, { "createrawtransaction", 0 }, { "createrawtransaction", 1 }, diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index e9a111f523..61bc0b22f4 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1475,12 +1475,13 @@ Value listsinceblock(const Array& params, bool fHelp) Value gettransaction(const Array& params, bool fHelp) { - if (fHelp || params.size() != 1) + if (fHelp || params.size() < 1 || params.size() > 2) throw runtime_error( "gettransaction \"txid\"\n" "\nGet detailed information about in-wallet transaction \n" "\nArguments:\n" "1. \"txid\" (string, required) The transaction id\n" + "2. \"includeWatchonly\" (bool, optional, default=false) Whether to include watchonly addresses in balance calculation and details[]\n" "\nResult:\n" "{\n" " \"amount\" : x.xxx, (numeric) The transaction amount in btc\n" @@ -1517,6 +1518,11 @@ Value gettransaction(const Array& params, bool fHelp) uint256 hash; hash.SetHex(params[0].get_str()); + isminefilter filter = MINE_SPENDABLE; + if(params.size() > 1) + if(params[1].get_bool()) + filter = filter | MINE_WATCH_ONLY; + Object entry; if (!pwalletMain->mapWallet.count(hash)) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid or non-wallet transaction id"); @@ -1534,7 +1540,7 @@ Value gettransaction(const Array& params, bool fHelp) WalletTxToJSON(wtx, entry); Array details; - ListTransactions(wtx, "*", 0, false, details); + ListTransactions(wtx, "*", 0, false, details, filter); entry.push_back(Pair("details", details)); CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); From 0fa2f8899adf8f9f0ead29ba5d708ead6c5d4eaf Mon Sep 17 00:00:00 2001 From: JaSK Date: Sat, 31 May 2014 16:57:26 +0200 Subject: [PATCH 0305/1288] added includedWatchonly argument to listreceivedbyaddress/...account --- src/rpcclient.cpp | 3 ++- src/rpcwallet.cpp | 38 +++++++++++++++++++++++++++++++------- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index b2387cb062..5edeecf933 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -37,8 +37,10 @@ static const CRPCConvertParam vRPCConvertParams[] = { "getreceivedbyaccount", 1 }, { "listreceivedbyaddress", 0 }, { "listreceivedbyaddress", 1 }, + { "listreceivedbyaddress", 2 }, { "listreceivedbyaccount", 0 }, { "listreceivedbyaccount", 1 }, + { "listreceivedbyaccount", 2 }, { "getbalance", 1 }, { "getbalance", 2 }, { "getblockhash", 0 }, @@ -65,7 +67,6 @@ static const CRPCConvertParam vRPCConvertParams[] = { "listunspent", 1 }, { "listunspent", 2 }, { "getblock", 1 }, - { "gettransaction", 1}, { "getrawtransaction", 1 }, { "createrawtransaction", 0 }, { "createrawtransaction", 1 }, diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 61bc0b22f4..1cbaadd45c 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -932,10 +932,12 @@ struct tallyitem int64_t nAmount; int nConf; vector txids; + bool fIsWatchonly; tallyitem() { nAmount = 0; nConf = std::numeric_limits::max(); + fIsWatchonly = false; } }; @@ -951,6 +953,11 @@ Value ListReceived(const Array& params, bool fByAccounts) if (params.size() > 1) fIncludeEmpty = params[1].get_bool(); + isminefilter filter = MINE_SPENDABLE; + if(params.size() > 2) + if(params[2].get_bool()) + filter = filter | MINE_WATCH_ONLY; + // Tally map mapTally; for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) @@ -967,13 +974,19 @@ Value ListReceived(const Array& params, bool fByAccounts) BOOST_FOREACH(const CTxOut& txout, wtx.vout) { CTxDestination address; - if (!ExtractDestination(txout.scriptPubKey, address) || !IsMine(*pwalletMain, address)) + if (!ExtractDestination(txout.scriptPubKey, address)) + continue; + + isminefilter mine = IsMine(*pwalletMain, address); + if(!mine & filter) continue; tallyitem& item = mapTally[address]; item.nAmount += txout.nValue; item.nConf = min(item.nConf, nDepth); item.txids.push_back(wtx.GetHash()); + if (mine & MINE_WATCH_ONLY) + item.fIsWatchonly = true; } } @@ -990,10 +1003,12 @@ Value ListReceived(const Array& params, bool fByAccounts) int64_t nAmount = 0; int nConf = std::numeric_limits::max(); + bool fIsWatchonly = false; if (it != mapTally.end()) { nAmount = (*it).second.nAmount; nConf = (*it).second.nConf; + fIsWatchonly = (*it).second.fIsWatchonly; } if (fByAccounts) @@ -1001,10 +1016,13 @@ Value ListReceived(const Array& params, bool fByAccounts) tallyitem& item = mapAccountTally[strAccount]; item.nAmount += nAmount; item.nConf = min(item.nConf, nConf); + item.fIsWatchonly = fIsWatchonly; } else { Object obj; + if(fIsWatchonly) + obj.push_back(Pair("involvesWatchonly", true)); obj.push_back(Pair("address", address.ToString())); obj.push_back(Pair("account", strAccount)); obj.push_back(Pair("amount", ValueFromAmount(nAmount))); @@ -1029,6 +1047,8 @@ Value ListReceived(const Array& params, bool fByAccounts) int64_t nAmount = (*it).second.nAmount; int nConf = (*it).second.nConf; Object obj; + if((*it).second.fIsWatchonly) + obj.push_back(Pair("involvesWatchonly", true)); obj.push_back(Pair("account", (*it).first)); obj.push_back(Pair("amount", ValueFromAmount(nAmount))); obj.push_back(Pair("confirmations", (nConf == std::numeric_limits::max() ? 0 : nConf))); @@ -1041,17 +1061,19 @@ Value ListReceived(const Array& params, bool fByAccounts) Value listreceivedbyaddress(const Array& params, bool fHelp) { - if (fHelp || params.size() > 2) + if (fHelp || params.size() > 3) throw runtime_error( - "listreceivedbyaddress ( minconf includeempty )\n" + "listreceivedbyaddress ( minconf includeempty includeWatchonly)\n" "\nList balances by receiving address.\n" "\nArguments:\n" "1. minconf (numeric, optional, default=1) The minimum number of confirmations before payments are included.\n" "2. includeempty (numeric, optional, dafault=false) Whether to include addresses that haven't received any payments.\n" + "3. includeWatchonly (bool, optional, default=false) Whether to include watchonly addresses (see 'importaddress').\n" "\nResult:\n" "[\n" " {\n" + " \"involvesWatchonly\" : \"true\", (bool) Only returned if imported addresses were involved in transaction\n" " \"address\" : \"receivingaddress\", (string) The receiving address\n" " \"account\" : \"accountname\", (string) The account of the receiving address. The default account is \"\".\n" " \"amount\" : x.xxx, (numeric) The total amount in btc received by the address\n" @@ -1063,7 +1085,7 @@ Value listreceivedbyaddress(const Array& params, bool fHelp) "\nExamples:\n" + HelpExampleCli("listreceivedbyaddress", "") + HelpExampleCli("listreceivedbyaddress", "6 true") - + HelpExampleRpc("listreceivedbyaddress", "6, true") + + HelpExampleRpc("listreceivedbyaddress", "6, true, true") ); return ListReceived(params, false); @@ -1071,17 +1093,19 @@ Value listreceivedbyaddress(const Array& params, bool fHelp) Value listreceivedbyaccount(const Array& params, bool fHelp) { - if (fHelp || params.size() > 2) + if (fHelp || params.size() > 3) throw runtime_error( - "listreceivedbyaccount ( minconf includeempty )\n" + "listreceivedbyaccount ( minconf includeempty includeWatchonly)\n" "\nList balances by account.\n" "\nArguments:\n" "1. minconf (numeric, optional, default=1) The minimum number of confirmations before payments are included.\n" "2. includeempty (boolean, optional, default=false) Whether to include accounts that haven't received any payments.\n" + "3. includeWatchonly (bool, optional, default=false) Whether to include watchonly addresses (see 'importaddress').\n" "\nResult:\n" "[\n" " {\n" + " \"involvesWatchonly\" : \"true\", (bool) Only returned if imported addresses were involved in transaction\n" " \"account\" : \"accountname\", (string) The account name of the receiving account\n" " \"amount\" : x.xxx, (numeric) The total amount received by addresses with this account\n" " \"confirmations\" : n (numeric) The number of confirmations of the most recent transaction included\n" @@ -1092,7 +1116,7 @@ Value listreceivedbyaccount(const Array& params, bool fHelp) "\nExamples:\n" + HelpExampleCli("listreceivedbyaccount", "") + HelpExampleCli("listreceivedbyaccount", "6 true") - + HelpExampleRpc("listreceivedbyaccount", "6, true") + + HelpExampleRpc("listreceivedbyaccount", "6, true, true") ); return ListReceived(params, true); From d5087d1ba08142bdf135333a0da08ef0f5fc7ef0 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 9 Jun 2014 21:11:59 +0200 Subject: [PATCH 0306/1288] Use script matching rather than destination matching for watch-only. This changes the keystore data format, wallet format and IsMine logic to detect watch-only outputs based on direct script matching rather than first trying to convert outputs to destinations (addresses). The reason is that we don't know how the software that has the spending keys works. It may support the same types of scripts as us, but that is not guaranteed. Furthermore, it removes the ambiguity between addresses used as identifiers for output scripts or identifiers for public keys. One practical implication is that adding a normal pay-to-pubkey-hash address via importaddress will not cause payments to the corresponding full public key to be detected as IsMine. If that is wanted, add those scripts directly (importaddress now also accepts any hex-encoded script). Conflicts: src/wallet.cpp --- src/keystore.cpp | 4 ++-- src/keystore.h | 10 +++++----- src/rpcdump.cpp | 23 +++++++++++++++-------- src/script.cpp | 22 +++++++--------------- src/script.h | 2 +- src/wallet.cpp | 15 ++++++++------- src/wallet.h | 4 ++-- src/walletdb.cpp | 12 ++++++------ src/walletdb.h | 2 +- 9 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/keystore.cpp b/src/keystore.cpp index c2ea1ce5a9..2a4c88d565 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -59,14 +59,14 @@ bool CBasicKeyStore::GetCScript(const CScriptID &hash, CScript& redeemScriptOut) return false; } -bool CBasicKeyStore::AddWatchOnly(const CTxDestination &dest) +bool CBasicKeyStore::AddWatchOnly(const CScript &dest) { LOCK(cs_KeyStore); setWatchOnly.insert(dest); return true; } -bool CBasicKeyStore::HaveWatchOnly(const CTxDestination &dest) const +bool CBasicKeyStore::HaveWatchOnly(const CScript &dest) const { LOCK(cs_KeyStore); return setWatchOnly.count(dest) > 0; diff --git a/src/keystore.h b/src/keystore.h index 90fc3a4c7b..72411a1387 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -48,13 +48,13 @@ public: virtual bool GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const =0; // Support for Watch-only addresses - virtual bool AddWatchOnly(const CTxDestination &dest) =0; - virtual bool HaveWatchOnly(const CTxDestination &dest) const =0; + virtual bool AddWatchOnly(const CScript &dest) =0; + virtual bool HaveWatchOnly(const CScript &dest) const =0; }; typedef std::map KeyMap; typedef std::map ScriptMap; -typedef std::set WatchOnlySet; +typedef std::set WatchOnlySet; /** Basic key store, that keeps keys in an address->secret map */ class CBasicKeyStore : public CKeyStore @@ -105,8 +105,8 @@ public: virtual bool HaveCScript(const CScriptID &hash) const; virtual bool GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const; - virtual bool AddWatchOnly(const CTxDestination &dest); - virtual bool HaveWatchOnly(const CTxDestination &dest) const; + virtual bool AddWatchOnly(const CScript &dest); + virtual bool HaveWatchOnly(const CScript &dest) const; }; typedef std::vector > CKeyingMaterial; diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index 98af4695d6..e505d84b40 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -138,13 +138,19 @@ Value importaddress(const Array& params, bool fHelp) if (fHelp || params.size() < 1 || params.size() > 3) throw runtime_error( "importaddress
[label] [rescan=true]\n" - "Adds an address that can be watched as if it were in your wallet but cannot be used to spend."); + "Adds an address or script (in hex) that can be watched as if it were in your wallet but cannot be used to spend."); + + CScript script; CBitcoinAddress address(params[0].get_str()); - if (!address.IsValid()) - throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address"); - CTxDestination dest; - dest = address.Get(); + if (address.IsValid()) { + script.SetDestination(address.Get()); + } else if (IsHex(params[0].get_str())) { + std::vector data(ParseHex(params[0].get_str())); + script = CScript(data.begin(), data.end()); + } else { + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address or script"); + } string strLabel = ""; if (params.size() > 1) @@ -159,15 +165,16 @@ Value importaddress(const Array& params, bool fHelp) LOCK2(cs_main, pwalletMain->cs_wallet); // add to address book or update label - pwalletMain->SetAddressBook(dest, strLabel, "receive"); + if (address.IsValid()) + pwalletMain->SetAddressBook(address.Get(), strLabel, "receive"); // Don't throw error in case an address is already there - if (pwalletMain->HaveWatchOnly(dest)) + if (pwalletMain->HaveWatchOnly(script)) return Value::null; pwalletMain->MarkDirty(); - if (!pwalletMain->AddWatchOnly(dest)) + if (!pwalletMain->AddWatchOnly(script)) throw JSONRPCError(RPC_WALLET_ERROR, "Error adding address to wallet"); if (fRescan) diff --git a/src/script.cpp b/src/script.cpp index 0ef0126255..89f752bd1f 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1456,13 +1456,11 @@ public: bool operator()(const CScriptID &scriptID) const { return keystore->HaveCScript(scriptID); } }; -isminetype IsMine(const CKeyStore &keystore, const CTxDestination &dest) +isminetype IsMine(const CKeyStore &keystore, const CTxDestination& dest) { - if (boost::apply_visitor(CKeyStoreIsMineVisitor(&keystore), dest)) - return MINE_SPENDABLE; - if (keystore.HaveWatchOnly(dest)) - return MINE_WATCH_ONLY; - return MINE_NO; + CScript script; + script.SetDestination(dest); + return IsMine(keystore, script); } isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey) @@ -1470,7 +1468,7 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey) vector vSolutions; txnouttype whichType; if (!Solver(scriptPubKey, whichType, vSolutions)) { - if (keystore.HaveWatchOnly(scriptPubKey.GetID())) + if (keystore.HaveWatchOnly(scriptPubKey)) return MINE_WATCH_ONLY; return MINE_NO; } @@ -1485,15 +1483,11 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey) keyID = CPubKey(vSolutions[0]).GetID(); if (keystore.HaveKey(keyID)) return MINE_SPENDABLE; - if (keystore.HaveWatchOnly(keyID)) - return MINE_WATCH_ONLY; break; case TX_PUBKEYHASH: keyID = CKeyID(uint160(vSolutions[0])); if (keystore.HaveKey(keyID)) return MINE_SPENDABLE; - if (keystore.HaveWatchOnly(keyID)) - return MINE_WATCH_ONLY; break; case TX_SCRIPTHASH: { @@ -1501,11 +1495,9 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey) CScript subscript; if (keystore.GetCScript(scriptID, subscript)) { isminetype ret = IsMine(keystore, subscript); - if (ret) + if (ret == MINE_SPENDABLE) return ret; } - if (keystore.HaveWatchOnly(scriptID)) - return MINE_WATCH_ONLY; break; } case TX_MULTISIG: @@ -1522,7 +1514,7 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey) } } - if (keystore.HaveWatchOnly(scriptPubKey.GetID())) + if (keystore.HaveWatchOnly(scriptPubKey)) return MINE_WATCH_ONLY; return MINE_NO; } diff --git a/src/script.h b/src/script.h index 56c7d01d4e..edba5757e4 100644 --- a/src/script.h +++ b/src/script.h @@ -812,7 +812,7 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector >& vSolutions); bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType); isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey); -isminetype IsMine(const CKeyStore& keystore, const CTxDestination &dest); +isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest); void ExtractAffectedKeys(const CKeyStore &keystore, const CScript& scriptPubKey, std::vector &vKeys); bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet); bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::vector& addressRet, int& nRequiredRet); diff --git a/src/wallet.cpp b/src/wallet.cpp index 4b480321ac..445d98b906 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -145,7 +145,7 @@ bool CWallet::LoadCScript(const CScript& redeemScript) return CCryptoKeyStore::AddCScript(redeemScript); } -bool CWallet::AddWatchOnly(const CTxDestination &dest) +bool CWallet::AddWatchOnly(const CScript &dest) { if (!CCryptoKeyStore::AddWatchOnly(dest)) return false; @@ -155,9 +155,8 @@ bool CWallet::AddWatchOnly(const CTxDestination &dest) return CWalletDB(strWalletFile).WriteWatchOnly(dest); } -bool CWallet::LoadWatchOnly(const CTxDestination &dest) +bool CWallet::LoadWatchOnly(const CScript &dest) { - LogPrintf("Loaded %s!\n", CBitcoinAddress(dest).ToString().c_str()); return CCryptoKeyStore::AddWatchOnly(dest); } @@ -729,17 +728,19 @@ int64_t CWallet::GetDebit(const CTxIn &txin, const isminefilter& filter) const bool CWallet::IsChange(const CTxOut& txout) const { - CTxDestination address; - // TODO: fix handling of 'change' outputs. The assumption is that any - // payment to a TX_PUBKEYHASH that is mine but isn't in the address book + // payment to a script that is ours, but is not in the address book // is change. That assumption is likely to break when we implement multisignature // wallets that return change back into a multi-signature-protected address; // a better way of identifying which outputs are 'the send' and which are // 'the change' will need to be implemented (maybe extend CWalletTx to remember // which output, if any, was change). - if (ExtractDestination(txout.scriptPubKey, address) && ::IsMine(*this, address) == MINE_SPENDABLE) + if (::IsMine(*this, txout.scriptPubKey)) { + CTxDestination address; + if (!ExtractDestination(txout.scriptPubKey, address)) + return true; + LOCK(cs_wallet); if (!mapAddressBook.count(address)) return true; diff --git a/src/wallet.h b/src/wallet.h index 3453d23d97..b44b73568b 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -227,9 +227,9 @@ public: bool GetDestData(const CTxDestination &dest, const std::string &key, std::string *value) const; // Adds a watch-only address to the store, and saves it to disk. - bool AddWatchOnly(const CTxDestination &dest); + bool AddWatchOnly(const CScript &dest); // Adds a watch-only address to the store, without saving it to disk (used by LoadWallet) - bool LoadWatchOnly(const CTxDestination &dest); + bool LoadWatchOnly(const CScript &dest); bool Unlock(const SecureString& strWalletPassphrase); bool ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase, const SecureString& strNewWalletPassphrase); diff --git a/src/walletdb.cpp b/src/walletdb.cpp index 9338d57097..a95baf83d0 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -112,10 +112,10 @@ bool CWalletDB::WriteCScript(const uint160& hash, const CScript& redeemScript) return Write(std::make_pair(std::string("cscript"), hash), redeemScript, false); } -bool CWalletDB::WriteWatchOnly(const CTxDestination &dest) +bool CWalletDB::WriteWatchOnly(const CScript &dest) { nWalletDBUpdated++; - return Write(std::make_pair(std::string("watch"), CBitcoinAddress(dest).ToString()), '1'); + return Write(std::make_pair(std::string("watchs"), dest), '1'); } bool CWalletDB::WriteBestBlock(const CBlockLocator& locator) @@ -410,14 +410,14 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, wss.fAnyUnordered = true; } } - else if (strType == "watch") + else if (strType == "watchs") { - std::string strAddress; - ssKey >> strAddress; + CScript script; + ssKey >> script; char fYes; ssValue >> fYes; if (fYes == '1') - pwallet->LoadWatchOnly(CBitcoinAddress(strAddress).Get()); + pwallet->LoadWatchOnly(script); // Watch-only addresses have no birthday information for now, // so set the wallet birthday to the beginning of time. diff --git a/src/walletdb.h b/src/walletdb.h index 3a6cb152a1..58b4571b16 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -94,7 +94,7 @@ public: bool WriteCScript(const uint160& hash, const CScript& redeemScript); - bool WriteWatchOnly(const CTxDestination &dest); + bool WriteWatchOnly(const CScript &script); bool WriteBestBlock(const CBlockLocator& locator); bool ReadBestBlock(CBlockLocator& locator); From 80dda36a07d09f99be861fa5271d0da5bd4f07dc Mon Sep 17 00:00:00 2001 From: JaSK Date: Thu, 19 Jun 2014 15:24:17 +0200 Subject: [PATCH 0307/1288] removed default argument values for ismine filter --- src/qt/transactiondesc.cpp | 14 +++++++------- src/qt/transactionrecord.cpp | 2 +- src/rpcwallet.cpp | 18 +++++++++--------- src/wallet.cpp | 4 ++-- src/wallet.h | 25 +++++++++++++------------ 5 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index d94f066ed9..95c7fa7582 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -54,8 +54,8 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco strHTML += ""; int64_t nTime = wtx.GetTxTime(); - int64_t nCredit = wtx.GetCredit(); - int64_t nDebit = wtx.GetDebit(); + int64_t nCredit = wtx.GetCredit(MINE_SPENDABLE|MINE_WATCH_ONLY); + int64_t nDebit = wtx.GetDebit(MINE_SPENDABLE|MINE_WATCH_ONLY); int64_t nNet = nCredit - nDebit; strHTML += "" + tr("Status") + ": " + FormatTxStatus(wtx); @@ -139,7 +139,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco // int64_t nUnmatured = 0; BOOST_FOREACH(const CTxOut& txout, wtx.vout) - nUnmatured += wallet->GetCredit(txout); + nUnmatured += wallet->GetCredit(txout, MINE_SPENDABLE|MINE_WATCH_ONLY); strHTML += "" + tr("Credit") + ": "; if (wtx.IsInMainChain()) strHTML += BitcoinUnits::formatWithUnit(unit, nUnmatured)+ " (" + tr("matures in %n more block(s)", "", wtx.GetBlocksToMaturity()) + ")"; @@ -228,10 +228,10 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco // BOOST_FOREACH(const CTxIn& txin, wtx.vin) if (wallet->IsMine(txin)) - strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(unit, -wallet->GetDebit(txin)) + "
"; + strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(unit, -wallet->GetDebit(txin, MINE_SPENDABLE|MINE_WATCH_ONLY)) + "
"; BOOST_FOREACH(const CTxOut& txout, wtx.vout) if (wallet->IsMine(txout)) - strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(unit, wallet->GetCredit(txout)) + "
"; + strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(unit, wallet->GetCredit(txout, MINE_SPENDABLE|MINE_WATCH_ONLY)) + "
"; } } @@ -281,10 +281,10 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco strHTML += "

" + tr("Debug information") + "

"; BOOST_FOREACH(const CTxIn& txin, wtx.vin) if(wallet->IsMine(txin)) - strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(unit, -wallet->GetDebit(txin)) + "
"; + strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(unit, -wallet->GetDebit(txin, MINE_SPENDABLE|MINE_WATCH_ONLY)) + "
"; BOOST_FOREACH(const CTxOut& txout, wtx.vout) if(wallet->IsMine(txout)) - strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(unit, wallet->GetCredit(txout)) + "
"; + strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(unit, wallet->GetCredit(txout, MINE_SPENDABLE|MINE_WATCH_ONLY)) + "
"; strHTML += "
" + tr("Transaction") + ":
"; strHTML += GUIUtil::HtmlEscape(wtx.ToString(), true); diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 1011363f3e..49916fed55 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -33,7 +33,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * QList parts; int64_t nTime = wtx.GetTxTime(); int64_t nCredit = wtx.GetCredit(true); - int64_t nDebit = wtx.GetDebit(); + int64_t nDebit = wtx.GetDebit(MINE_SPENDABLE|MINE_WATCH_ONLY); int64_t nNet = nCredit - nDebit; uint256 hash = wtx.GetHash(); std::map mapValue = wtx.mapValue; diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 1cbaadd45c..f745d25ab6 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -557,7 +557,7 @@ Value getreceivedbyaccount(const Array& params, bool fHelp) } -int64_t GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMinDepth, const isminefilter& filter = MINE_SPENDABLE) +int64_t GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMinDepth, const isminefilter& filter) { int64_t nBalance = 0; @@ -582,7 +582,7 @@ int64_t GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMi return nBalance; } -int64_t GetAccountBalance(const string& strAccount, int nMinDepth, const isminefilter& filter = MINE_SPENDABLE) +int64_t GetAccountBalance(const string& strAccount, int nMinDepth, const isminefilter& filter) { CWalletDB walletdb(pwalletMain->strWalletFile); return GetAccountBalance(walletdb, strAccount, nMinDepth, filter); @@ -786,7 +786,7 @@ Value sendfrom(const Array& params, bool fHelp) EnsureWalletIsUnlocked(); // Check funds - int64_t nBalance = GetAccountBalance(strAccount, nMinDepth); + int64_t nBalance = GetAccountBalance(strAccount, nMinDepth, MINE_SPENDABLE); if (nAmount > nBalance) throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds"); @@ -863,7 +863,7 @@ Value sendmany(const Array& params, bool fHelp) EnsureWalletIsUnlocked(); // Check funds - int64_t nBalance = GetAccountBalance(strAccount, nMinDepth); + int64_t nBalance = GetAccountBalance(strAccount, nMinDepth, MINE_SPENDABLE); if (totalAmount > nBalance) throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds"); @@ -1129,7 +1129,7 @@ static void MaybePushAddress(Object & entry, const CTxDestination &dest) entry.push_back(Pair("address", addr.ToString())); } -void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDepth, bool fLong, Array& ret, const isminefilter& filter=MINE_SPENDABLE) +void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDepth, bool fLong, Array& ret, const isminefilter& filter) { int64_t nFee; string strSentAccount; @@ -1552,13 +1552,13 @@ Value gettransaction(const Array& params, bool fHelp) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid or non-wallet transaction id"); const CWalletTx& wtx = pwalletMain->mapWallet[hash]; - int64_t nCredit = wtx.GetCredit(); - int64_t nDebit = wtx.GetDebit(); + int64_t nCredit = wtx.GetCredit(filter); + int64_t nDebit = wtx.GetDebit(filter); int64_t nNet = nCredit - nDebit; - int64_t nFee = (wtx.IsFromMe() ? wtx.GetValueOut() - nDebit : 0); + int64_t nFee = (wtx.IsFromMe(filter) ? wtx.GetValueOut() - nDebit : 0); entry.push_back(Pair("amount", ValueFromAmount(nNet - nFee))); - if (wtx.IsFromMe()) + if (wtx.IsFromMe(filter)) entry.push_back(Pair("fee", ValueFromAmount(nFee))); WalletTxToJSON(wtx, entry); diff --git a/src/wallet.cpp b/src/wallet.cpp index 445d98b906..e996fca3d2 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1216,7 +1216,7 @@ bool CWallet::SelectCoinsMinConf(int64_t nTargetValue, int nConfMine, int nConfT const CWalletTx *pcoin = output.tx; - if (output.nDepth < (pcoin->IsFromMe() ? nConfMine : nConfTheirs)) + if (output.nDepth < (pcoin->IsFromMe(MINE_SPENDABLE|MINE_WATCH_ONLY) ? nConfMine : nConfTheirs)) continue; int i = output.i; @@ -1845,7 +1845,7 @@ std::map CWallet::GetAddressBalances() continue; int nDepth = pcoin->GetDepthInMainChain(); - if (nDepth < (pcoin->IsFromMe() ? 0 : 1)) + if (nDepth < (pcoin->IsFromMe(MINE_SPENDABLE|MINE_WATCH_ONLY) ? 0 : 1)) continue; for (unsigned int i = 0; i < pcoin->vout.size(); i++) diff --git a/src/wallet.h b/src/wallet.h index b44b73568b..ac90de3c9c 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -288,12 +288,12 @@ public: std::set GetAccountAddresses(std::string strAccount) const; isminetype IsMine(const CTxIn& txin) const; - int64_t GetDebit(const CTxIn& txin, const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const; + int64_t GetDebit(const CTxIn& txin, const isminefilter& filter) const; isminetype IsMine(const CTxOut& txout) const { return ::IsMine(*this, txout.scriptPubKey); } - int64_t GetCredit(const CTxOut& txout, const isminefilter& filter=(MINE_WATCH_ONLY|MINE_SPENDABLE)) const + int64_t GetCredit(const CTxOut& txout, const isminefilter& filter) const { if (!MoneyRange(txout.nValue)) throw std::runtime_error("CWallet::GetCredit() : value out of range"); @@ -313,9 +313,9 @@ public: return true; return false; } - bool IsFromMe(const CTransaction& tx) const + bool IsFromMe(const CTransaction& tx) const // should probably be renamed to IsRelevantToMe { - return (GetDebit(tx) > 0); + return (GetDebit(tx, MINE_SPENDABLE|MINE_WATCH_ONLY) > 0); } bool IsConflicting(const CTransaction& tx) const { @@ -324,7 +324,7 @@ public: return true; return false; } - int64_t GetDebit(const CTransaction& tx, const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const + int64_t GetDebit(const CTransaction& tx, const isminefilter& filter) const { int64_t nDebit = 0; BOOST_FOREACH(const CTxIn& txin, tx.vin) @@ -335,7 +335,7 @@ public: } return nDebit; } - int64_t GetCredit(const CTransaction& tx, const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const + int64_t GetCredit(const CTransaction& tx, const isminefilter& filter) const { int64_t nCredit = 0; BOOST_FOREACH(const CTxOut& txout, tx.vout) @@ -614,7 +614,8 @@ public: MarkDirty(); } - int64_t GetDebit(const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const + // filter decides which addresses will count towards the debit + int64_t GetDebit(const isminefilter& filter) const { if (vin.empty()) return 0; @@ -654,7 +655,7 @@ public: // GetBalance can assume transactions in mapWallet won't change if (fUseCache && fCreditCached) return nCreditCached; - nCreditCached = pwallet->GetCredit(*this); + nCreditCached = pwallet->GetCredit(*this, MINE_SPENDABLE|MINE_WATCH_ONLY); fCreditCached = true; return nCreditCached; } @@ -756,12 +757,12 @@ public: } void GetAmounts(std::list >& listReceived, - std::list >& listSent, int64_t& nFee, std::string& strSentAccount, const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const; + std::list >& listSent, int64_t& nFee, std::string& strSentAccount, const isminefilter& filter) const; void GetAccountAmounts(const std::string& strAccount, int64_t& nReceived, - int64_t& nSent, int64_t& nFee, const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const; + int64_t& nSent, int64_t& nFee, const isminefilter& filter) const; - bool IsFromMe(const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const + bool IsFromMe(const isminefilter& filter) const { return (GetDebit(filter) > 0); } @@ -776,7 +777,7 @@ public: return true; if (nDepth < 0) return false; - if (!bSpendZeroConfChange || !IsFromMe()) // using wtx's cached debit + if (!bSpendZeroConfChange || !IsFromMe(MINE_SPENDABLE|MINE_WATCH_ONLY)) // using wtx's cached debit return false; // Trusted if all inputs are from us and are in the mempool: From 23b0506c91020f69092389cf8b25576dcdf4e17e Mon Sep 17 00:00:00 2001 From: JaSK Date: Thu, 19 Jun 2014 01:42:39 +0200 Subject: [PATCH 0308/1288] Fixed some stuff in TransactionDesc --- src/qt/transactiondesc.cpp | 32 +++++++++++++------------------- src/qt/transactionrecord.cpp | 6 +++--- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 95c7fa7582..faa2077ff7 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -15,6 +15,7 @@ #include "timedata.h" #include "ui_interface.h" #include "wallet.h" +#include "script.h" #include #include @@ -89,27 +90,20 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco if (nNet > 0) { // Credit - BOOST_FOREACH(const CTxOut& txout, wtx.vout) + if (CBitcoinAddress(rec->address).IsValid()) { - if (wallet->IsMine(txout)) + CTxDestination address = CBitcoinAddress(rec->address).Get(); + if (wallet->mapAddressBook.count(address)) { - if (CBitcoinAddress(rec->address).IsValid()) - { - CTxDestination address = CBitcoinAddress(rec->address).Get(); - if (wallet->mapAddressBook.count(address)) - { - strHTML += "" + tr("From") + ": " + tr("unknown") + "
"; - strHTML += "" + tr("To") + ": "; - strHTML += GUIUtil::HtmlEscape(rec->address); - QString addressOwned = wallet->IsMine(txout) == MINE_SPENDABLE ? tr("own address") : tr("watch-only"); - if (!wallet->mapAddressBook[address].name.empty()) - strHTML += " (" + addressOwned + ", " + tr("label") + ": " + GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + ")"; - else - strHTML += " (" + addressOwned + ")"; - strHTML += "
"; - } - } - break; + strHTML += "" + tr("From") + ": " + tr("unknown") + "
"; + strHTML += "" + tr("To") + ": "; + strHTML += GUIUtil::HtmlEscape(rec->address); + QString addressOwned = (::IsMine(*wallet, address) == MINE_SPENDABLE) ? tr("own address") : tr("watch-only"); + if (!wallet->mapAddressBook[address].name.empty()) + strHTML += " (" + addressOwned + ", " + tr("label") + ": " + GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + ")"; + else + strHTML += " (" + addressOwned + ")"; + strHTML += "
"; } } } diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 49916fed55..cce2fa3f81 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -52,6 +52,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * CTxDestination address; sub.idx = parts.size(); // sequence number sub.credit = txout.nValue; + sub.involvesWatchAddress = mine == MINE_WATCH_ONLY; if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*wallet, address)) { // Received by Bitcoin Address @@ -70,7 +71,6 @@ QList TransactionRecord::decomposeTransaction(const CWallet * sub.type = TransactionRecord::Generated; } - sub.involvesWatchAddress = mine == MINE_WATCH_ONLY; parts.append(sub); } } @@ -101,7 +101,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * parts.append(TransactionRecord(hash, nTime, TransactionRecord::SendToSelf, "", -(nDebit - nChange), nCredit - nChange)); - parts.last().involvesWatchAddress = involvesWatchAddress; + parts.last().involvesWatchAddress = involvesWatchAddress; // maybe pass to TransactionRecord as constructor argument } else if (fAllFromMe) { @@ -115,6 +115,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * const CTxOut& txout = wtx.vout[nOut]; TransactionRecord sub(hash, nTime); sub.idx = parts.size(); + sub.involvesWatchAddress = involvesWatchAddress; if(wallet->IsMine(txout)) { @@ -146,7 +147,6 @@ QList TransactionRecord::decomposeTransaction(const CWallet * } sub.debit = -nValue; - sub.involvesWatchAddress = involvesWatchAddress; parts.append(sub); } } From 519dd1c89afa2b7d0f2720eb70cd11de23d61006 Mon Sep 17 00:00:00 2001 From: JaSK Date: Fri, 20 Jun 2014 05:02:14 +0200 Subject: [PATCH 0309/1288] Added MINE_ALL = (spendable|watchonly) --- src/qt/transactiondesc.cpp | 14 +++++++------- src/qt/transactionrecord.cpp | 2 +- src/script.h | 1 + src/wallet.cpp | 4 ++-- src/wallet.h | 6 +++--- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index faa2077ff7..7cfa5424f7 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -55,8 +55,8 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco strHTML += ""; int64_t nTime = wtx.GetTxTime(); - int64_t nCredit = wtx.GetCredit(MINE_SPENDABLE|MINE_WATCH_ONLY); - int64_t nDebit = wtx.GetDebit(MINE_SPENDABLE|MINE_WATCH_ONLY); + int64_t nCredit = wtx.GetCredit(MINE_ALL); + int64_t nDebit = wtx.GetDebit(MINE_ALL); int64_t nNet = nCredit - nDebit; strHTML += "" + tr("Status") + ": " + FormatTxStatus(wtx); @@ -133,7 +133,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco // int64_t nUnmatured = 0; BOOST_FOREACH(const CTxOut& txout, wtx.vout) - nUnmatured += wallet->GetCredit(txout, MINE_SPENDABLE|MINE_WATCH_ONLY); + nUnmatured += wallet->GetCredit(txout, MINE_ALL); strHTML += "" + tr("Credit") + ": "; if (wtx.IsInMainChain()) strHTML += BitcoinUnits::formatWithUnit(unit, nUnmatured)+ " (" + tr("matures in %n more block(s)", "", wtx.GetBlocksToMaturity()) + ")"; @@ -222,10 +222,10 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco // BOOST_FOREACH(const CTxIn& txin, wtx.vin) if (wallet->IsMine(txin)) - strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(unit, -wallet->GetDebit(txin, MINE_SPENDABLE|MINE_WATCH_ONLY)) + "
"; + strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(unit, -wallet->GetDebit(txin, MINE_ALL)) + "
"; BOOST_FOREACH(const CTxOut& txout, wtx.vout) if (wallet->IsMine(txout)) - strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(unit, wallet->GetCredit(txout, MINE_SPENDABLE|MINE_WATCH_ONLY)) + "
"; + strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(unit, wallet->GetCredit(txout, MINE_ALL)) + "
"; } } @@ -275,10 +275,10 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco strHTML += "

" + tr("Debug information") + "

"; BOOST_FOREACH(const CTxIn& txin, wtx.vin) if(wallet->IsMine(txin)) - strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(unit, -wallet->GetDebit(txin, MINE_SPENDABLE|MINE_WATCH_ONLY)) + "
"; + strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(unit, -wallet->GetDebit(txin, MINE_ALL)) + "
"; BOOST_FOREACH(const CTxOut& txout, wtx.vout) if(wallet->IsMine(txout)) - strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(unit, wallet->GetCredit(txout, MINE_SPENDABLE|MINE_WATCH_ONLY)) + "
"; + strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(unit, wallet->GetCredit(txout, MINE_ALL)) + "
"; strHTML += "
" + tr("Transaction") + ":
"; strHTML += GUIUtil::HtmlEscape(wtx.ToString(), true); diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index cce2fa3f81..08092a5f1f 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -33,7 +33,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * QList parts; int64_t nTime = wtx.GetTxTime(); int64_t nCredit = wtx.GetCredit(true); - int64_t nDebit = wtx.GetDebit(MINE_SPENDABLE|MINE_WATCH_ONLY); + int64_t nDebit = wtx.GetDebit(MINE_ALL); int64_t nNet = nCredit - nDebit; uint256 hash = wtx.GetHash(); std::map mapValue = wtx.mapValue; diff --git a/src/script.h b/src/script.h index edba5757e4..790822625a 100644 --- a/src/script.h +++ b/src/script.h @@ -200,6 +200,7 @@ enum isminetype MINE_NO = 0, MINE_WATCH_ONLY = 1, MINE_SPENDABLE = 2, + MINE_ALL = MINE_WATCH_ONLY | MINE_SPENDABLE }; /** used for bitflags of isminetype */ typedef uint8_t isminefilter; diff --git a/src/wallet.cpp b/src/wallet.cpp index e996fca3d2..2823e7fa34 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1216,7 +1216,7 @@ bool CWallet::SelectCoinsMinConf(int64_t nTargetValue, int nConfMine, int nConfT const CWalletTx *pcoin = output.tx; - if (output.nDepth < (pcoin->IsFromMe(MINE_SPENDABLE|MINE_WATCH_ONLY) ? nConfMine : nConfTheirs)) + if (output.nDepth < (pcoin->IsFromMe(MINE_ALL) ? nConfMine : nConfTheirs)) continue; int i = output.i; @@ -1845,7 +1845,7 @@ std::map CWallet::GetAddressBalances() continue; int nDepth = pcoin->GetDepthInMainChain(); - if (nDepth < (pcoin->IsFromMe(MINE_SPENDABLE|MINE_WATCH_ONLY) ? 0 : 1)) + if (nDepth < (pcoin->IsFromMe(MINE_ALL) ? 0 : 1)) continue; for (unsigned int i = 0; i < pcoin->vout.size(); i++) diff --git a/src/wallet.h b/src/wallet.h index ac90de3c9c..639f51e3ca 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -315,7 +315,7 @@ public: } bool IsFromMe(const CTransaction& tx) const // should probably be renamed to IsRelevantToMe { - return (GetDebit(tx, MINE_SPENDABLE|MINE_WATCH_ONLY) > 0); + return (GetDebit(tx, MINE_ALL) > 0); } bool IsConflicting(const CTransaction& tx) const { @@ -655,7 +655,7 @@ public: // GetBalance can assume transactions in mapWallet won't change if (fUseCache && fCreditCached) return nCreditCached; - nCreditCached = pwallet->GetCredit(*this, MINE_SPENDABLE|MINE_WATCH_ONLY); + nCreditCached = pwallet->GetCredit(*this, MINE_ALL); fCreditCached = true; return nCreditCached; } @@ -777,7 +777,7 @@ public: return true; if (nDepth < 0) return false; - if (!bSpendZeroConfChange || !IsFromMe(MINE_SPENDABLE|MINE_WATCH_ONLY)) // using wtx's cached debit + if (!bSpendZeroConfChange || !IsFromMe(MINE_ALL)) // using wtx's cached debit return false; // Trusted if all inputs are from us and are in the mempool: From f28707a845d4098fed55a6948887d60043fcfde7 Mon Sep 17 00:00:00 2001 From: JaSK Date: Sun, 22 Jun 2014 23:29:33 +0200 Subject: [PATCH 0310/1288] fixed bug in ListReceived() --- src/rpcwallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index f745d25ab6..560be0570a 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -978,7 +978,7 @@ Value ListReceived(const Array& params, bool fByAccounts) continue; isminefilter mine = IsMine(*pwalletMain, address); - if(!mine & filter) + if(!(mine & filter)) continue; tallyitem& item = mapTally[address]; From 53a2148f0c182b83da255972acb3110a74e9957a Mon Sep 17 00:00:00 2001 From: JaSK Date: Mon, 23 Jun 2014 10:43:30 +0200 Subject: [PATCH 0311/1288] fixed bug where validateaddress doesn't display information --- src/rpcmisc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index f0b4619b26..56accc1b3a 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -115,7 +115,7 @@ public: Object operator()(const CScriptID &scriptID) const { Object obj; obj.push_back(Pair("isscript", true)); - if (mine == MINE_SPENDABLE) { + if (mine != MINE_NO) { CScript subscript; pwalletMain->GetCScript(scriptID, subscript); std::vector addresses; From a3e192a3274817517671f624d5744297905e20d2 Mon Sep 17 00:00:00 2001 From: JaSK Date: Tue, 1 Jul 2014 11:00:22 +0200 Subject: [PATCH 0312/1288] replaced MINE_ with ISMINE_ --- src/qt/transactiondesc.cpp | 32 ++++++++++++++++---------------- src/qt/transactionrecord.cpp | 12 ++++++------ src/rpcmisc.cpp | 12 ++++++------ src/rpcwallet.cpp | 36 ++++++++++++++++++------------------ src/script.cpp | 16 ++++++++-------- src/script.h | 8 ++++---- src/wallet.cpp | 10 +++++----- src/wallet.h | 24 ++++++++++++------------ 8 files changed, 75 insertions(+), 75 deletions(-) diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 7cfa5424f7..36e4d50e30 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -55,8 +55,8 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco strHTML += ""; int64_t nTime = wtx.GetTxTime(); - int64_t nCredit = wtx.GetCredit(MINE_ALL); - int64_t nDebit = wtx.GetDebit(MINE_ALL); + int64_t nCredit = wtx.GetCredit(ISMINE_ALL); + int64_t nDebit = wtx.GetDebit(ISMINE_ALL); int64_t nNet = nCredit - nDebit; strHTML += "" + tr("Status") + ": " + FormatTxStatus(wtx); @@ -98,7 +98,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco strHTML += "" + tr("From") + ": " + tr("unknown") + "
"; strHTML += "" + tr("To") + ": "; strHTML += GUIUtil::HtmlEscape(rec->address); - QString addressOwned = (::IsMine(*wallet, address) == MINE_SPENDABLE) ? tr("own address") : tr("watch-only"); + QString addressOwned = (::IsMine(*wallet, address) == ISMINE_SPENDABLE) ? tr("own address") : tr("watch-only"); if (!wallet->mapAddressBook[address].name.empty()) strHTML += " (" + addressOwned + ", " + tr("label") + ": " + GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + ")"; else @@ -133,7 +133,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco // int64_t nUnmatured = 0; BOOST_FOREACH(const CTxOut& txout, wtx.vout) - nUnmatured += wallet->GetCredit(txout, MINE_ALL); + nUnmatured += wallet->GetCredit(txout, ISMINE_ALL); strHTML += "" + tr("Credit") + ": "; if (wtx.IsInMainChain()) strHTML += BitcoinUnits::formatWithUnit(unit, nUnmatured)+ " (" + tr("matures in %n more block(s)", "", wtx.GetBlocksToMaturity()) + ")"; @@ -150,14 +150,14 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco } else { - isminetype fAllFromMe = MINE_SPENDABLE; + isminetype fAllFromMe = ISMINE_SPENDABLE; BOOST_FOREACH(const CTxIn& txin, wtx.vin) { isminetype mine = wallet->IsMine(txin); if(fAllFromMe > mine) fAllFromMe = mine; } - isminetype fAllToMe = MINE_SPENDABLE; + isminetype fAllToMe = ISMINE_SPENDABLE; BOOST_FOREACH(const CTxOut& txout, wtx.vout) { isminetype mine = wallet->IsMine(txout); @@ -166,7 +166,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco if (fAllFromMe) { - if(fAllFromMe == MINE_WATCH_ONLY) + if(fAllFromMe == ISMINE_WATCH_ONLY) strHTML += "" + tr("From") + ": " + tr("watch-only") + "
"; // @@ -176,7 +176,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco { // Ignore change isminetype toSelf = wallet->IsMine(txout); - if ((toSelf == MINE_SPENDABLE) && (fAllFromMe == MINE_SPENDABLE)) + if ((toSelf == ISMINE_SPENDABLE) && (fAllFromMe == ISMINE_SPENDABLE)) continue; if (!wtx.mapValue.count("to") || wtx.mapValue["to"].empty()) @@ -189,9 +189,9 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco if (wallet->mapAddressBook.count(address) && !wallet->mapAddressBook[address].name.empty()) strHTML += GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + " "; strHTML += GUIUtil::HtmlEscape(CBitcoinAddress(address).ToString()); - if(toSelf == MINE_SPENDABLE) + if(toSelf == ISMINE_SPENDABLE) strHTML += " (own address)"; - else if(toSelf == MINE_WATCH_ONLY) + else if(toSelf == ISMINE_WATCH_ONLY) strHTML += " (watch-only)"; strHTML += "
"; } @@ -222,10 +222,10 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco // BOOST_FOREACH(const CTxIn& txin, wtx.vin) if (wallet->IsMine(txin)) - strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(unit, -wallet->GetDebit(txin, MINE_ALL)) + "
"; + strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(unit, -wallet->GetDebit(txin, ISMINE_ALL)) + "
"; BOOST_FOREACH(const CTxOut& txout, wtx.vout) if (wallet->IsMine(txout)) - strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(unit, wallet->GetCredit(txout, MINE_ALL)) + "
"; + strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(unit, wallet->GetCredit(txout, ISMINE_ALL)) + "
"; } } @@ -275,10 +275,10 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco strHTML += "

" + tr("Debug information") + "

"; BOOST_FOREACH(const CTxIn& txin, wtx.vin) if(wallet->IsMine(txin)) - strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(unit, -wallet->GetDebit(txin, MINE_ALL)) + "
"; + strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(unit, -wallet->GetDebit(txin, ISMINE_ALL)) + "
"; BOOST_FOREACH(const CTxOut& txout, wtx.vout) if(wallet->IsMine(txout)) - strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(unit, wallet->GetCredit(txout, MINE_ALL)) + "
"; + strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(unit, wallet->GetCredit(txout, ISMINE_ALL)) + "
"; strHTML += "
" + tr("Transaction") + ":
"; strHTML += GUIUtil::HtmlEscape(wtx.ToString(), true); @@ -305,8 +305,8 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco strHTML += QString::fromStdString(CBitcoinAddress(address).ToString()); } strHTML = strHTML + " " + tr("Amount") + "=" + BitcoinUnits::formatWithUnit(unit, vout.nValue); - strHTML = strHTML + " IsMine=" + (wallet->IsMine(vout) & MINE_SPENDABLE ? tr("true") : tr("false")) + ""; - strHTML = strHTML + " IsWatchOnly=" + (wallet->IsMine(vout) & MINE_WATCH_ONLY ? tr("true") : tr("false")) + ""; + strHTML = strHTML + " IsMine=" + (wallet->IsMine(vout) & ISMINE_SPENDABLE ? tr("true") : tr("false")) + ""; + strHTML = strHTML + " IsWatchOnly=" + (wallet->IsMine(vout) & ISMINE_WATCH_ONLY ? tr("true") : tr("false")) + ""; } } } diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 08092a5f1f..7d29c212b3 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -33,7 +33,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * QList parts; int64_t nTime = wtx.GetTxTime(); int64_t nCredit = wtx.GetCredit(true); - int64_t nDebit = wtx.GetDebit(MINE_ALL); + int64_t nDebit = wtx.GetDebit(ISMINE_ALL); int64_t nNet = nCredit - nDebit; uint256 hash = wtx.GetHash(); std::map mapValue = wtx.mapValue; @@ -52,7 +52,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * CTxDestination address; sub.idx = parts.size(); // sequence number sub.credit = txout.nValue; - sub.involvesWatchAddress = mine == MINE_WATCH_ONLY; + sub.involvesWatchAddress = mine == ISMINE_WATCH_ONLY; if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*wallet, address)) { // Received by Bitcoin Address @@ -78,19 +78,19 @@ QList TransactionRecord::decomposeTransaction(const CWallet * else { bool involvesWatchAddress = false; - isminetype fAllFromMe = MINE_SPENDABLE; + isminetype fAllFromMe = ISMINE_SPENDABLE; BOOST_FOREACH(const CTxIn& txin, wtx.vin) { isminetype mine = wallet->IsMine(txin); - if(mine == MINE_WATCH_ONLY) involvesWatchAddress = true; + if(mine == ISMINE_WATCH_ONLY) involvesWatchAddress = true; if(fAllFromMe > mine) fAllFromMe = mine; } - isminetype fAllToMe = MINE_SPENDABLE; + isminetype fAllToMe = ISMINE_SPENDABLE; BOOST_FOREACH(const CTxOut& txout, wtx.vout) { isminetype mine = wallet->IsMine(txout); - if(mine == MINE_WATCH_ONLY) involvesWatchAddress = true; + if(mine == ISMINE_WATCH_ONLY) involvesWatchAddress = true; if(fAllToMe > mine) fAllToMe = mine; } diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 56accc1b3a..f51be2db2c 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -104,7 +104,7 @@ public: Object obj; CPubKey vchPubKey; obj.push_back(Pair("isscript", false)); - if (mine == MINE_SPENDABLE) { + if (mine == ISMINE_SPENDABLE) { pwalletMain->GetPubKey(keyID, vchPubKey); obj.push_back(Pair("pubkey", HexStr(vchPubKey))); obj.push_back(Pair("iscompressed", vchPubKey.IsCompressed())); @@ -115,7 +115,7 @@ public: Object operator()(const CScriptID &scriptID) const { Object obj; obj.push_back(Pair("isscript", true)); - if (mine != MINE_NO) { + if (mine != ISMINE_NO) { CScript subscript; pwalletMain->GetCScript(scriptID, subscript); std::vector addresses; @@ -170,10 +170,10 @@ Value validateaddress(const Array& params, bool fHelp) string currentAddress = address.ToString(); ret.push_back(Pair("address", currentAddress)); #ifdef ENABLE_WALLET - isminetype mine = pwalletMain ? IsMine(*pwalletMain, dest) : MINE_NO; - ret.push_back(Pair("ismine", (mine & MINE_SPENDABLE) ? true : false)); - if (mine != MINE_NO) { - ret.push_back(Pair("iswatchonly", (mine & MINE_WATCH_ONLY) ? true: false)); + isminetype mine = pwalletMain ? IsMine(*pwalletMain, dest) : ISMINE_NO; + ret.push_back(Pair("ismine", (mine & ISMINE_SPENDABLE) ? true : false)); + if (mine != ISMINE_NO) { + ret.push_back(Pair("iswatchonly", (mine & ISMINE_WATCH_ONLY) ? true: false)); Object detail = boost::apply_visitor(DescribeAddressVisitor(mine), dest); ret.insert(ret.end(), detail.begin(), detail.end()); } diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 560be0570a..190c6b86b5 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -623,10 +623,10 @@ Value getbalance(const Array& params, bool fHelp) int nMinDepth = 1; if (params.size() > 1) nMinDepth = params[1].get_int(); - isminefilter filter = MINE_SPENDABLE; + isminefilter filter = ISMINE_SPENDABLE; if(params.size() > 2) if(params[2].get_bool()) - filter = filter | MINE_WATCH_ONLY; + filter = filter | ISMINE_WATCH_ONLY; if (params[0].get_str() == "*") { // Calculate total balance a different way from GetBalance() @@ -786,7 +786,7 @@ Value sendfrom(const Array& params, bool fHelp) EnsureWalletIsUnlocked(); // Check funds - int64_t nBalance = GetAccountBalance(strAccount, nMinDepth, MINE_SPENDABLE); + int64_t nBalance = GetAccountBalance(strAccount, nMinDepth, ISMINE_SPENDABLE); if (nAmount > nBalance) throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds"); @@ -863,7 +863,7 @@ Value sendmany(const Array& params, bool fHelp) EnsureWalletIsUnlocked(); // Check funds - int64_t nBalance = GetAccountBalance(strAccount, nMinDepth, MINE_SPENDABLE); + int64_t nBalance = GetAccountBalance(strAccount, nMinDepth, ISMINE_SPENDABLE); if (totalAmount > nBalance) throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds"); @@ -953,10 +953,10 @@ Value ListReceived(const Array& params, bool fByAccounts) if (params.size() > 1) fIncludeEmpty = params[1].get_bool(); - isminefilter filter = MINE_SPENDABLE; + isminefilter filter = ISMINE_SPENDABLE; if(params.size() > 2) if(params[2].get_bool()) - filter = filter | MINE_WATCH_ONLY; + filter = filter | ISMINE_WATCH_ONLY; // Tally map mapTally; @@ -985,7 +985,7 @@ Value ListReceived(const Array& params, bool fByAccounts) item.nAmount += txout.nValue; item.nConf = min(item.nConf, nDepth); item.txids.push_back(wtx.GetHash()); - if (mine & MINE_WATCH_ONLY) + if (mine & ISMINE_WATCH_ONLY) item.fIsWatchonly = true; } } @@ -1139,7 +1139,7 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount, filter); bool fAllAccounts = (strAccount == string("*")); - bool involvesWatchonly = wtx.IsFromMe(MINE_WATCH_ONLY); + bool involvesWatchonly = wtx.IsFromMe(ISMINE_WATCH_ONLY); // Sent if ((!listSent.empty() || nFee != 0) && (fAllAccounts || strAccount == strSentAccount)) @@ -1147,7 +1147,7 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64_t)& s, listSent) { Object entry; - if(involvesWatchonly || (::IsMine(*pwalletMain, s.first) & MINE_WATCH_ONLY)) + if(involvesWatchonly || (::IsMine(*pwalletMain, s.first) & ISMINE_WATCH_ONLY)) entry.push_back(Pair("involvesWatchonly", true)); entry.push_back(Pair("account", strSentAccount)); MaybePushAddress(entry, s.first); @@ -1171,7 +1171,7 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe if (fAllAccounts || (account == strAccount)) { Object entry; - if(involvesWatchonly || (::IsMine(*pwalletMain, r.first) & MINE_WATCH_ONLY)) + if(involvesWatchonly || (::IsMine(*pwalletMain, r.first) & ISMINE_WATCH_ONLY)) entry.push_back(Pair("involvesWatchonly", true)); entry.push_back(Pair("account", account)); MaybePushAddress(entry, r.first); @@ -1285,10 +1285,10 @@ Value listtransactions(const Array& params, bool fHelp) int nFrom = 0; if (params.size() > 2) nFrom = params[2].get_int(); - isminefilter filter = MINE_SPENDABLE; + isminefilter filter = ISMINE_SPENDABLE; if(params.size() > 3) if(params[3].get_bool()) - filter = filter | MINE_WATCH_ONLY; + filter = filter | ISMINE_WATCH_ONLY; if (nCount < 0) throw JSONRPCError(RPC_INVALID_PARAMETER, "Negative count"); @@ -1359,10 +1359,10 @@ Value listaccounts(const Array& params, bool fHelp) int nMinDepth = 1; if (params.size() > 0) nMinDepth = params[0].get_int(); - isminefilter includeWatchonly = MINE_SPENDABLE; + isminefilter includeWatchonly = ISMINE_SPENDABLE; if(params.size() > 1) if(params[1].get_bool()) - includeWatchonly = includeWatchonly | MINE_WATCH_ONLY; + includeWatchonly = includeWatchonly | ISMINE_WATCH_ONLY; map mapAccountBalances; BOOST_FOREACH(const PAIRTYPE(CTxDestination, CAddressBookData)& entry, pwalletMain->mapAddressBook) { @@ -1451,7 +1451,7 @@ Value listsinceblock(const Array& params, bool fHelp) CBlockIndex *pindex = NULL; int target_confirms = 1; - isminefilter filter = MINE_SPENDABLE; + isminefilter filter = ISMINE_SPENDABLE; if (params.size() > 0) { @@ -1473,7 +1473,7 @@ Value listsinceblock(const Array& params, bool fHelp) if(params.size() > 2) if(params[2].get_bool()) - filter = filter | MINE_WATCH_ONLY; + filter = filter | ISMINE_WATCH_ONLY; int depth = pindex ? (1 + chainActive.Height() - pindex->nHeight) : -1; @@ -1542,10 +1542,10 @@ Value gettransaction(const Array& params, bool fHelp) uint256 hash; hash.SetHex(params[0].get_str()); - isminefilter filter = MINE_SPENDABLE; + isminefilter filter = ISMINE_SPENDABLE; if(params.size() > 1) if(params[1].get_bool()) - filter = filter | MINE_WATCH_ONLY; + filter = filter | ISMINE_WATCH_ONLY; Object entry; if (!pwalletMain->mapWallet.count(hash)) diff --git a/src/script.cpp b/src/script.cpp index 89f752bd1f..238a25e72d 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1469,8 +1469,8 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey) txnouttype whichType; if (!Solver(scriptPubKey, whichType, vSolutions)) { if (keystore.HaveWatchOnly(scriptPubKey)) - return MINE_WATCH_ONLY; - return MINE_NO; + return ISMINE_WATCH_ONLY; + return ISMINE_NO; } CKeyID keyID; @@ -1482,12 +1482,12 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey) case TX_PUBKEY: keyID = CPubKey(vSolutions[0]).GetID(); if (keystore.HaveKey(keyID)) - return MINE_SPENDABLE; + return ISMINE_SPENDABLE; break; case TX_PUBKEYHASH: keyID = CKeyID(uint160(vSolutions[0])); if (keystore.HaveKey(keyID)) - return MINE_SPENDABLE; + return ISMINE_SPENDABLE; break; case TX_SCRIPTHASH: { @@ -1495,7 +1495,7 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey) CScript subscript; if (keystore.GetCScript(scriptID, subscript)) { isminetype ret = IsMine(keystore, subscript); - if (ret == MINE_SPENDABLE) + if (ret == ISMINE_SPENDABLE) return ret; } break; @@ -1509,14 +1509,14 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey) // in shared-wallet situations. vector keys(vSolutions.begin()+1, vSolutions.begin()+vSolutions.size()-1); if (HaveKeys(keys, keystore) == keys.size()) - return MINE_SPENDABLE; + return ISMINE_SPENDABLE; break; } } if (keystore.HaveWatchOnly(scriptPubKey)) - return MINE_WATCH_ONLY; - return MINE_NO; + return ISMINE_WATCH_ONLY; + return ISMINE_NO; } bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet) diff --git a/src/script.h b/src/script.h index 790822625a..e36be2db9e 100644 --- a/src/script.h +++ b/src/script.h @@ -197,10 +197,10 @@ enum /** IsMine() return codes */ enum isminetype { - MINE_NO = 0, - MINE_WATCH_ONLY = 1, - MINE_SPENDABLE = 2, - MINE_ALL = MINE_WATCH_ONLY | MINE_SPENDABLE + ISMINE_NO = 0, + ISMINE_WATCH_ONLY = 1, + ISMINE_SPENDABLE = 2, + ISMINE_ALL = ISMINE_WATCH_ONLY | ISMINE_SPENDABLE }; /** used for bitflags of isminetype */ typedef uint8_t isminefilter; diff --git a/src/wallet.cpp b/src/wallet.cpp index 2823e7fa34..84b50c0f8c 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -707,7 +707,7 @@ isminetype CWallet::IsMine(const CTxIn &txin) const return IsMine(prev.vout[txin.prevout.n]); } } - return MINE_NO; + return ISMINE_NO; } int64_t CWallet::GetDebit(const CTxIn &txin, const isminefilter& filter) const @@ -1139,10 +1139,10 @@ void CWallet::AvailableCoins(vector& vCoins, bool fOnlyConfirmed, const for (unsigned int i = 0; i < pcoin->vout.size(); i++) { isminetype mine = IsMine(pcoin->vout[i]); - if (!(IsSpent(wtxid, i)) && mine != MINE_NO && + if (!(IsSpent(wtxid, i)) && mine != ISMINE_NO && !IsLockedCoin((*it).first, i) && pcoin->vout[i].nValue > 0 && (!coinControl || !coinControl->HasSelected() || coinControl->IsSelected((*it).first, i))) - vCoins.push_back(COutput(pcoin, i, nDepth, mine & MINE_SPENDABLE)); + vCoins.push_back(COutput(pcoin, i, nDepth, mine & ISMINE_SPENDABLE)); } } } @@ -1216,7 +1216,7 @@ bool CWallet::SelectCoinsMinConf(int64_t nTargetValue, int nConfMine, int nConfT const CWalletTx *pcoin = output.tx; - if (output.nDepth < (pcoin->IsFromMe(MINE_ALL) ? nConfMine : nConfTheirs)) + if (output.nDepth < (pcoin->IsFromMe(ISMINE_ALL) ? nConfMine : nConfTheirs)) continue; int i = output.i; @@ -1845,7 +1845,7 @@ std::map CWallet::GetAddressBalances() continue; int nDepth = pcoin->GetDepthInMainChain(); - if (nDepth < (pcoin->IsFromMe(MINE_ALL) ? 0 : 1)) + if (nDepth < (pcoin->IsFromMe(ISMINE_ALL) ? 0 : 1)) continue; for (unsigned int i = 0; i < pcoin->vout.size(); i++) diff --git a/src/wallet.h b/src/wallet.h index 639f51e3ca..8a51bf9821 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -315,7 +315,7 @@ public: } bool IsFromMe(const CTransaction& tx) const // should probably be renamed to IsRelevantToMe { - return (GetDebit(tx, MINE_ALL) > 0); + return (GetDebit(tx, ISMINE_ALL) > 0); } bool IsConflicting(const CTransaction& tx) const { @@ -621,24 +621,24 @@ public: return 0; int64_t debit = 0; - if(filter & MINE_SPENDABLE) + if(filter & ISMINE_SPENDABLE) { if (fDebitCached) debit += nDebitCached; else { - nDebitCached = pwallet->GetDebit(*this, MINE_SPENDABLE); + nDebitCached = pwallet->GetDebit(*this, ISMINE_SPENDABLE); fDebitCached = true; debit += nDebitCached; } } - if(filter & MINE_WATCH_ONLY) + if(filter & ISMINE_WATCH_ONLY) { if(fWatchDebitCached) debit += nWatchDebitCached; else { - nWatchDebitCached = pwallet->GetDebit(*this, MINE_WATCH_ONLY); + nWatchDebitCached = pwallet->GetDebit(*this, ISMINE_WATCH_ONLY); fWatchDebitCached = true; debit += nWatchDebitCached; } @@ -655,7 +655,7 @@ public: // GetBalance can assume transactions in mapWallet won't change if (fUseCache && fCreditCached) return nCreditCached; - nCreditCached = pwallet->GetCredit(*this, MINE_ALL); + nCreditCached = pwallet->GetCredit(*this, ISMINE_ALL); fCreditCached = true; return nCreditCached; } @@ -666,7 +666,7 @@ public: { if (fUseCache && fImmatureCreditCached) return nImmatureCreditCached; - nImmatureCreditCached = pwallet->GetCredit(*this, MINE_SPENDABLE); + nImmatureCreditCached = pwallet->GetCredit(*this, ISMINE_SPENDABLE); fImmatureCreditCached = true; return nImmatureCreditCached; } @@ -693,7 +693,7 @@ public: if (!pwallet->IsSpent(hashTx, i)) { const CTxOut &txout = vout[i]; - nCredit += pwallet->GetCredit(txout, MINE_SPENDABLE); + nCredit += pwallet->GetCredit(txout, ISMINE_SPENDABLE); if (!MoneyRange(nCredit)) throw std::runtime_error("CWalletTx::GetAvailableCredit() : value out of range"); } @@ -710,7 +710,7 @@ public: { if (fUseCache && fImmatureWatchCreditCached) return nImmatureWatchCreditCached; - nImmatureWatchCreditCached = pwallet->GetCredit(*this, MINE_WATCH_ONLY); + nImmatureWatchCreditCached = pwallet->GetCredit(*this, ISMINE_WATCH_ONLY); fImmatureWatchCreditCached = true; return nImmatureWatchCreditCached; } @@ -736,7 +736,7 @@ public: if (!pwallet->IsSpent(GetHash(), i)) { const CTxOut &txout = vout[i]; - nCredit += pwallet->GetCredit(txout, MINE_WATCH_ONLY); + nCredit += pwallet->GetCredit(txout, ISMINE_WATCH_ONLY); if (!MoneyRange(nCredit)) throw std::runtime_error("CWalletTx::GetAvailableCredit() : value out of range"); } @@ -777,7 +777,7 @@ public: return true; if (nDepth < 0) return false; - if (!bSpendZeroConfChange || !IsFromMe(MINE_ALL)) // using wtx's cached debit + if (!bSpendZeroConfChange || !IsFromMe(ISMINE_ALL)) // using wtx's cached debit return false; // Trusted if all inputs are from us and are in the mempool: @@ -788,7 +788,7 @@ public: if (parent == NULL) return false; const CTxOut& parentOut = parent->vout[txin.prevout.n]; - if (pwallet->IsMine(parentOut) != MINE_SPENDABLE) + if (pwallet->IsMine(parentOut) != ISMINE_SPENDABLE) return false; } return true; From 0da6b3fd187da3aa810aaa584d8bd197ad4fa2b9 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Wed, 2 Jul 2014 09:27:29 -0700 Subject: [PATCH 0313/1288] Remove signal DoubleSpendDetected, use function Also removes the need for forward reference to RelayableRespend. --- src/init.cpp | 2 +- src/main.cpp | 103 +++++++++++++++++++++++---------------------------- src/main.h | 4 +- 3 files changed, 50 insertions(+), 59 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index da13218a94..6c0898c036 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1176,7 +1176,7 @@ bool AppInit2(boost::thread_group& threadGroup) LogPrintf("mapAddressBook.size() = %u\n", pwalletMain ? pwalletMain->mapAddressBook.size() : 0); #endif - RegisterInternalSignals(); + InitRespendFilter(); StartNode(threadGroup); if (fServer) StartRPCThreads(); diff --git a/src/main.cpp b/src/main.cpp index 1294e5b2ed..7baf33c39f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -125,9 +125,14 @@ namespace { } // anon namespace -// Forward reference functions defined here: +// Bloom filter to limit respend relays to one static const unsigned int MAX_DOUBLESPEND_BLOOM = 1000; -static bool RelayableRespend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter); +static CBloomFilter doubleSpendFilter; +void InitRespendFilter() { + seed_insecure_rand(); + doubleSpendFilter = CBloomFilter(MAX_DOUBLESPEND_BLOOM, 0.01, insecure_rand(), BLOOM_UPDATE_NONE); +} + ////////////////////////////////////////////////////////////////////////////// // @@ -151,24 +156,10 @@ struct CMainSignals { boost::signals2::signal Inventory; // Tells listeners to broadcast their data. boost::signals2::signal Broadcast; - // Notifies listeners of detection of a double-spent transaction. Arguments are outpoint that is - // double-spent, first transaction seen, double-spend transaction, and whether the second double-spend - // transaction was first seen in a block. - // Note: only notifies if the previous transaction is in the memory pool; if previous transction was in a block, - // then the double-spend simply fails when we try to lookup the inputs in the current UTXO set. - boost::signals2::signal DetectedDoubleSpend; } g_signals; } // anon namespace -void RegisterInternalSignals() { - static CBloomFilter doubleSpendFilter; - seed_insecure_rand(); - doubleSpendFilter = CBloomFilter(MAX_DOUBLESPEND_BLOOM, 0.01, insecure_rand(), BLOOM_UPDATE_NONE); - - g_signals.DetectedDoubleSpend.connect(boost::bind(RelayableRespend, _1, _2, _3, doubleSpendFilter)); -} - void RegisterWallet(CWalletInterface* pwalletIn) { g_signals.SyncTransaction.connect(boost::bind(&CWalletInterface::SyncTransaction, pwalletIn, _1, _2)); @@ -908,6 +899,45 @@ bool RateLimitExceeded(double& dCount, int64_t& nLastTime, int64_t nLimit, unsig return false; } +static bool RelayableRespend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter) +{ + // Relaying double-spend attempts to our peers lets them detect when + // somebody might be trying to cheat them. However, blindly relaying + // every double-spend across the entire network gives attackers + // a denial-of-service attack: just generate a stream of double-spends + // re-spending the same (limited) set of outpoints owned by the attacker. + // So, we use a bloom filter and only relay (at most) the first double + // spend for each outpoint. False-positives ("we have already relayed") + // are OK, because if the peer doesn't hear about the double-spend + // from us they are very likely to hear about it from another peer, since + // each peer uses a different, randomized bloom filter. + + if (fInBlock || filter.contains(outPoint)) return false; + + // Apply an independent rate limit to double-spend relays + static double dRespendCount; + static int64_t nLastRespendTime; + static int64_t nRespendLimit = GetArg("-limitrespendrelay", 100); + unsigned int nSize = ::GetSerializeSize(doubleSpend, SER_NETWORK, PROTOCOL_VERSION); + + if (RateLimitExceeded(dRespendCount, nLastRespendTime, nRespendLimit, nSize)) + { + LogPrint("mempool", "Double-spend relay rejected by rate limiter\n"); + return false; + } + + LogPrint("mempool", "Rate limit dRespendCount: %g => %g\n", dRespendCount, dRespendCount+nSize); + + // Clear the filter on average every MAX_DOUBLE_SPEND_BLOOM + // insertions + if (insecure_rand()%MAX_DOUBLESPEND_BLOOM == 0) + filter.clear(); + + filter.insert(outPoint); + + return true; +} + bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransaction &tx, bool fLimitFree, bool* pfMissingInputs, bool fRejectInsaneFee) { @@ -945,7 +975,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa // Does tx conflict with a member of the pool, and is it not equivalent to that member? if (pool.mapNextTx.count(outpoint) && !tx.IsEquivalentTo(*pool.mapNextTx[outpoint].ptx)) { - relayableRespend = g_signals.DetectedDoubleSpend(outpoint, tx, false); + relayableRespend = RelayableRespend(outpoint, tx, false, doubleSpendFilter); if (!relayableRespend) return false; } @@ -1057,45 +1087,6 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa return !relayableRespend; } -static bool RelayableRespend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter) -{ - // Relaying double-spend attempts to our peers lets them detect when - // somebody might be trying to cheat them. However, blindly relaying - // every double-spend across the entire network gives attackers - // a denial-of-service attack: just generate a stream of double-spends - // re-spending the same (limited) set of outpoints owned by the attacker. - // So, we use a bloom filter and only relay (at most) the first double - // spend for each outpoint. False-positives ("we have already relayed") - // are OK, because if the peer doesn't hear about the double-spend - // from us they are very likely to hear about it from another peer, since - // each peer uses a different, randomized bloom filter. - - if (fInBlock || filter.contains(outPoint)) return false; - - // Apply an independent rate limit to double-spend relays - static double dRespendCount; - static int64_t nLastRespendTime; - static int64_t nRespendLimit = GetArg("-limitrespendrelay", 100); - unsigned int nSize = ::GetSerializeSize(doubleSpend, SER_NETWORK, PROTOCOL_VERSION); - - if (RateLimitExceeded(dRespendCount, nLastRespendTime, nRespendLimit, nSize)) - { - LogPrint("mempool", "Double-spend relay rejected by rate limiter\n"); - return false; - } - - LogPrint("mempool", "Rate limit dRespendCount: %g => %g\n", dRespendCount, dRespendCount+nSize); - - // Clear the filter on average every MAX_DOUBLE_SPEND_BLOOM - // insertions - if (insecure_rand()%MAX_DOUBLESPEND_BLOOM == 0) - filter.clear(); - - filter.insert(outPoint); - - return true; -} - int CMerkleTx::GetDepthInMainChainINTERNAL(CBlockIndex* &pindexRet) const { diff --git a/src/main.h b/src/main.h index 19f4469008..26450bb721 100644 --- a/src/main.h +++ b/src/main.h @@ -108,8 +108,8 @@ struct CNodeStateStats; struct CBlockTemplate; -/** Set up internal signal handlers **/ -void RegisterInternalSignals(); +/** Initialize respend bloom filter **/ +void InitRespendFilter(); /** Register a wallet to receive updates from core */ void RegisterWallet(CWalletInterface* pwalletIn); From 834e46e847188df513b8b57ab30fe9940f2b2dd0 Mon Sep 17 00:00:00 2001 From: jtimon Date: Wed, 2 Jul 2014 18:36:43 +0200 Subject: [PATCH 0314/1288] CBlockIndex()::SetNull() method to avoid code repetition --- src/main.h | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/main.h b/src/main.h index 19f4469008..cc7dea75a1 100644 --- a/src/main.h +++ b/src/main.h @@ -718,7 +718,7 @@ public: // (memory only) Sequencial id assigned to distinguish order in which blocks are received. uint32_t nSequenceId; - CBlockIndex() + void SetNull() { phashBlock = NULL; pprev = NULL; @@ -740,20 +740,14 @@ public: nNonce = 0; } + CBlockIndex() + { + SetNull(); + } + CBlockIndex(CBlockHeader& block) { - phashBlock = NULL; - pprev = NULL; - pskip = NULL; - nHeight = 0; - nFile = 0; - nDataPos = 0; - nUndoPos = 0; - nChainWork = 0; - nTx = 0; - nChainTx = 0; - nStatus = 0; - nSequenceId = 0; + SetNull(); nVersion = block.nVersion; hashMerkleRoot = block.hashMerkleRoot; From 4278b1df45d93d18dfa0a8ce8d6fd7ac9b5344a6 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 3 Jul 2014 06:26:03 +0200 Subject: [PATCH 0315/1288] Clarify error message when invalid -rpcallowip Also add to HelpMessage() what specifications are valid. --- src/init.cpp | 2 +- src/rpcserver.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index da13218a94..2dd141a735 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -323,7 +323,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -rpcuser= " + _("Username for JSON-RPC connections") + "\n"; strUsage += " -rpcpassword= " + _("Password for JSON-RPC connections") + "\n"; strUsage += " -rpcport= " + _("Listen for JSON-RPC connections on (default: 8332 or testnet: 18332)") + "\n"; - strUsage += " -rpcallowip= " + _("Allow JSON-RPC connections from specified IP address. This option can be specified multiple times") + "\n"; + strUsage += " -rpcallowip= " + _("Allow JSON-RPC connections from specified source. Valid for are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times") + "\n"; strUsage += " -rpcthreads= " + _("Set the number of threads to service RPC calls (default: 4)") + "\n"; strUsage += "\n" + _("RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions)") + "\n"; diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index f47b3385da..5c4d307497 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -512,7 +512,7 @@ void StartRPCThreads() if(!subnet.IsValid()) { uiInterface.ThreadSafeMessageBox( - strprintf("Invalid -rpcallowip subnet specification: %s", strAllow), + strprintf("Invalid -rpcallowip subnet specification: %s. Valid are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24).", strAllow), "", CClientUIInterface::MSG_ERROR); StartShutdown(); return; From b33d1f5ee512da5719b793b3867f75f1eea5cf52 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Tue, 27 May 2014 15:44:57 -0400 Subject: [PATCH 0316/1288] Use fee/priority estimates in wallet CreateTransaction The wallet now uses the mempool fee estimator with a new command-line option: -txconfirmtarget (default: 1) instead of using hard-coded fees or priorities. A new bitcoind that hasn't seen enough transactions to estimate will fall back to the old hard-coded minimum priority or transaction fee. -paytxfee option overrides -txconfirmtarget. Relaying and mining code isn't changed. For Qt, the coin control dialog now uses priority estimates to label transaction priority (instead of hard-coded constants); unspent outputs were consistently labeled with a much higher priority than is justified by the free transactions actually being accepted into blocks. I did not implement any GUI for setting -txconfirmtarget; I would suggest getting rid of the "Pay transaction fee" GUI and replace it with either "target number of confirmations" or maybe a "faster confirmation <--> lower fee" slider or select box. --- doc/release-notes.md | 20 +++++++++++++++ src/core.h | 3 ++- src/init.cpp | 7 ++++++ src/main.cpp | 13 +++------- src/main.h | 9 +------ src/qt/coincontroldialog.cpp | 48 +++++++++++++++++++++--------------- src/qt/coincontroldialog.h | 3 ++- src/wallet.cpp | 44 +++++++++++++++++++++++++++------ src/wallet.h | 5 ++++ 9 files changed, 105 insertions(+), 47 deletions(-) diff --git a/doc/release-notes.md b/doc/release-notes.md index 3a4079e437..66059800b6 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -1,6 +1,26 @@ (note: this is a temporary file, to be added-to by anybody, and moved to release-notes at release time) +Transaction fee changes +======================= + +This release automatically estimates how high a transaction fee (or how +high a priority) transactions require to be confirmed quickly. The default +settings will create transactions that confirm quickly; see the new +'txconfirmtarget' setting to control the tradeoff between fees and +confirmation times. + +Prior releases used hard-coded fees (and priorities), and would +sometimes create transactions that took a very long time to confirm. + + +New Command Line Options +======================== + +-txconfirmtarget=n : create transactions that have enough fees (or priority) +so they are likely to confirm within n blocks (default: 1). This setting +is over-ridden by the -paytxfee option. + New RPC methods =============== diff --git a/src/core.h b/src/core.h index 8606831575..d6e7ab870d 100644 --- a/src/core.h +++ b/src/core.h @@ -131,7 +131,8 @@ public: friend bool operator<(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK < b.nSatoshisPerK; } friend bool operator>(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK > b.nSatoshisPerK; } friend bool operator==(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK == b.nSatoshisPerK; } - + friend bool operator<=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK <= b.nSatoshisPerK; } + friend bool operator>=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK >= b.nSatoshisPerK; } std::string ToString() const; IMPLEMENT_SERIALIZE( READWRITE(nSatoshisPerK); ) diff --git a/src/init.cpp b/src/init.cpp index 2dd141a735..3ee0f2aa39 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -254,6 +254,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += "\n" + _("Wallet options:") + "\n"; strUsage += " -disablewallet " + _("Do not load the wallet and disable wallet RPC calls") + "\n"; strUsage += " -paytxfee= " + strprintf(_("Fee (in BTC/kB) to add to transactions you send (default: %s)"), FormatMoney(payTxFee.GetFeePerK())) + "\n"; + strUsage += " -txconfirmtarget= " + _("If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1)") + "\n"; strUsage += " -rescan " + _("Rescan the block chain for missing wallet transactions") + " " + _("on startup") + "\n"; strUsage += " -salvagewallet " + _("Attempt to recover private keys from a corrupt wallet.dat") + " " + _("on startup") + "\n"; strUsage += " -spendzeroconfchange " + _("Spend unconfirmed change when sending transactions (default: 1)") + "\n"; @@ -635,7 +636,13 @@ bool AppInit2(boost::thread_group& threadGroup) if (nFeePerK > nHighTransactionFeeWarning) InitWarning(_("Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.")); payTxFee = CFeeRate(nFeePerK, 1000); + if (payTxFee < CTransaction::minRelayTxFee) + { + return InitError(strprintf(_("Invalid amount for -paytxfee=: '%s' (must be at least %s)"), + mapArgs["-paytxfee"], CTransaction::minRelayTxFee.ToString())); + } } + nTxConfirmTarget = GetArg("-txconfirmtarget", 1); bSpendZeroConfChange = GetArg("-spendzeroconfchange", true); std::string strWalletFile = GetArg("-wallet", "wallet.dat"); diff --git a/src/main.cpp b/src/main.cpp index 04d9523e26..6be1a29c6c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -858,7 +858,7 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state) return true; } -int64_t GetMinFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree, enum GetMinFee_mode mode) +int64_t GetMinRelayFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree) { { LOCK(mempool.cs); @@ -870,10 +870,7 @@ int64_t GetMinFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree, return 0; } - // Base fee is either minTxFee or minRelayTxFee - CFeeRate baseFeeRate = (mode == GMF_RELAY) ? tx.minRelayTxFee : tx.minTxFee; - - int64_t nMinFee = baseFeeRate.GetFee(nBytes); + int64_t nMinFee = tx.minRelayTxFee.GetFee(nBytes); if (fAllowFree) { @@ -881,9 +878,7 @@ int64_t GetMinFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree, // * If we are relaying we allow transactions up to DEFAULT_BLOCK_PRIORITY_SIZE - 1000 // to be considered to fall into this category. We don't want to encourage sending // multiple transactions instead of one big transaction to avoid fees. - // * If we are creating a transaction we allow transactions up to 1,000 bytes - // to be considered safe and assume they can likely make it into this section. - if (nBytes < (mode == GMF_SEND ? 1000 : (DEFAULT_BLOCK_PRIORITY_SIZE - 1000))) + if (nBytes < (DEFAULT_BLOCK_PRIORITY_SIZE - 1000)) nMinFee = 0; } @@ -1005,7 +1000,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa unsigned int nSize = entry.GetTxSize(); // Don't accept it if it can't get into a block - int64_t txMinFee = GetMinFee(tx, nSize, true, GMF_RELAY); + int64_t txMinFee = GetMinRelayFee(tx, nSize, true); if (fLimitFree && nFees < txMinFee) return state.DoS(0, error("AcceptToMemoryPool : not enough fees %s, %d < %d", hash.ToString(), nFees, txMinFee), diff --git a/src/main.h b/src/main.h index 19f4469008..e8df17dda0 100644 --- a/src/main.h +++ b/src/main.h @@ -245,14 +245,7 @@ struct CDiskTxPos : public CDiskBlockPos }; - -enum GetMinFee_mode -{ - GMF_RELAY, - GMF_SEND, -}; - -int64_t GetMinFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree, enum GetMinFee_mode mode); +int64_t GetMinRelayFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree); // // Check transaction inputs, and make sure any diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index c6a6150392..73494f52ea 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -16,6 +16,8 @@ #include "main.h" #include "wallet.h" +#include // for 'map_list_of()' + #include #include #include @@ -400,23 +402,24 @@ void CoinControlDialog::viewItemChanged(QTreeWidgetItem* item, int column) } // return human readable label for priority number -QString CoinControlDialog::getPriorityLabel(double dPriority) +QString CoinControlDialog::getPriorityLabel(const CTxMemPool& pool, double dPriority) { - if (AllowFree(dPriority)) // at least medium + // confirmations -> textual description + typedef std::map PriorityDescription; + static PriorityDescription priorityDescriptions = boost::assign::map_list_of + (1, tr("highest"))(2, tr("higher"))(3, tr("high")) + (5, tr("medium-high"))(6, tr("medium")) + (10, tr("low-medium"))(15, tr("low")) + (20, tr("lower")); + + BOOST_FOREACH(const PriorityDescription::value_type& i, priorityDescriptions) { - if (AllowFree(dPriority / 1000000)) return tr("highest"); - else if (AllowFree(dPriority / 100000)) return tr("higher"); - else if (AllowFree(dPriority / 10000)) return tr("high"); - else if (AllowFree(dPriority / 1000)) return tr("medium-high"); - else return tr("medium"); - } - else - { - if (AllowFree(dPriority * 10)) return tr("low-medium"); - else if (AllowFree(dPriority * 100)) return tr("low"); - else if (AllowFree(dPriority * 1000)) return tr("lower"); - else return tr("lowest"); + double p = mempool.estimatePriority(i.first); + if (p > 0 && dPriority >= p) return i.second; } + // Note: if mempool hasn't accumulated enough history (estimatePriority + // returns -1) we're conservative and classify as "lowest" + return tr("lowest"); } // shows count of locked unspent outputs @@ -518,15 +521,20 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) // Priority dPriority = dPriorityInputs / (nBytes - nBytesInputs + (nQuantityUncompressed * 29)); // 29 = 180 - 151 (uncompressed public keys are over the limit. max 151 bytes of the input are ignored for priority) - sPriorityLabel = CoinControlDialog::getPriorityLabel(dPriority); + sPriorityLabel = CoinControlDialog::getPriorityLabel(mempool, dPriority); // Fee int64_t nFee = payTxFee.GetFee(max((unsigned int)1000, nBytes)); // Min Fee - int64_t nMinFee = GetMinFee(txDummy, nBytes, AllowFree(dPriority), GMF_SEND); + nPayFee = CWallet::GetMinimumFee(nBytes, nTxConfirmTarget, mempool); - nPayFee = max(nFee, nMinFee); + double dPriorityNeeded = mempool.estimatePriority(nTxConfirmTarget); + if (dPriorityNeeded <= 0) // Not enough mempool history: never send free + dPriorityNeeded = std::numeric_limits::max(); + + if (nBytes <= MAX_FREE_TRANSACTION_CREATE_SIZE && dPriority >= dPriorityNeeded) + nPayFee = 0; if (nPayAmount > 0) { @@ -591,7 +599,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) } // turn labels "red" - l5->setStyleSheet((nBytes >= 1000) ? "color:red;" : ""); // Bytes >= 1000 + l5->setStyleSheet((nBytes >= MAX_FREE_TRANSACTION_CREATE_SIZE) ? "color:red;" : "");// Bytes >= 1000 l6->setStyleSheet((dPriority > 0 && !AllowFree(dPriority)) ? "color:red;" : ""); // Priority < "medium" l7->setStyleSheet((fDust) ? "color:red;" : ""); // Dust = "yes" @@ -732,7 +740,7 @@ void CoinControlDialog::updateView() // priority double dPriority = ((double)out.tx->vout[out.i].nValue / (nInputSize + 78)) * (out.nDepth+1); // 78 = 2 * 34 + 10 - itemOutput->setText(COLUMN_PRIORITY, CoinControlDialog::getPriorityLabel(dPriority)); + itemOutput->setText(COLUMN_PRIORITY, CoinControlDialog::getPriorityLabel(mempool, dPriority)); itemOutput->setText(COLUMN_PRIORITY_INT64, strPad(QString::number((int64_t)dPriority), 20, " ")); dPrioritySum += (double)out.tx->vout[out.i].nValue * (out.nDepth+1); nInputSum += nInputSize; @@ -765,7 +773,7 @@ void CoinControlDialog::updateView() itemWalletAddress->setText(COLUMN_CHECKBOX, "(" + QString::number(nChildren) + ")"); itemWalletAddress->setText(COLUMN_AMOUNT, BitcoinUnits::format(nDisplayUnit, nSum)); itemWalletAddress->setText(COLUMN_AMOUNT_INT64, strPad(QString::number(nSum), 15, " ")); - itemWalletAddress->setText(COLUMN_PRIORITY, CoinControlDialog::getPriorityLabel(dPrioritySum)); + itemWalletAddress->setText(COLUMN_PRIORITY, CoinControlDialog::getPriorityLabel(mempool, dPrioritySum)); itemWalletAddress->setText(COLUMN_PRIORITY_INT64, strPad(QString::number((int64_t)dPrioritySum), 20, " ")); } } diff --git a/src/qt/coincontroldialog.h b/src/qt/coincontroldialog.h index 465e2a009d..4f7422642f 100644 --- a/src/qt/coincontroldialog.h +++ b/src/qt/coincontroldialog.h @@ -19,6 +19,7 @@ namespace Ui { } class WalletModel; class CCoinControl; +class CTxMemPool; class CoinControlDialog : public QDialog { @@ -32,7 +33,7 @@ public: // static because also called from sendcoinsdialog static void updateLabels(WalletModel*, QDialog*); - static QString getPriorityLabel(double); + static QString getPriorityLabel(const CTxMemPool& pool, double); static QList payAmounts; static CCoinControl *coinControl; diff --git a/src/wallet.cpp b/src/wallet.cpp index daca7ac04b..d9187e4be3 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -18,6 +18,7 @@ using namespace std; // Settings CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE); +unsigned int nTxConfirmTarget = 1; bool bSpendZeroConfChange = true; ////////////////////////////////////////////////////////////////////////////// @@ -1273,6 +1274,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, return false; } + wtxNew.fTimeReceivedIsTxTime = true; wtxNew.BindWallet(this); CMutableTransaction txNew; @@ -1393,19 +1395,31 @@ bool CWallet::CreateTransaction(const vector >& vecSend, } dPriority = wtxNew.ComputePriority(dPriority, nBytes); - // Check that enough fee is included - int64_t nPayFee = payTxFee.GetFee(nBytes); - bool fAllowFree = AllowFree(dPriority); - int64_t nMinFee = GetMinFee(wtxNew, nBytes, fAllowFree, GMF_SEND); - if (nFeeRet < max(nPayFee, nMinFee)) + int64_t nFeeNeeded = GetMinimumFee(nBytes, nTxConfirmTarget, mempool); + + if (nFeeRet >= nFeeNeeded) + break; // Done, enough fee included. + + // Too big to send for free? Include more fee and try again: + if (nBytes > MAX_FREE_TRANSACTION_CREATE_SIZE) { - nFeeRet = max(nPayFee, nMinFee); + nFeeRet = nFeeNeeded; continue; } - wtxNew.fTimeReceivedIsTxTime = true; + // Not enough fee: enough priority? + double dPriorityNeeded = mempool.estimatePriority(nTxConfirmTarget); + // Not enough mempool history to estimate: use hard-coded AllowFree. + if (dPriorityNeeded <= 0 && AllowFree(dPriority)) + break; - break; + // Small enough, and priority high enough, to send for free + if (dPriority >= dPriorityNeeded) + break; + + // Include more fee and try again. + nFeeRet = nFeeNeeded; + continue; } } } @@ -1513,6 +1527,20 @@ string CWallet::SendMoneyToDestination(const CTxDestination& address, int64_t nV return SendMoney(scriptPubKey, nValue, wtxNew); } +int64_t CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool& pool) +{ + // payTxFee is user-set "I want to pay this much" + int64_t nFeeNeeded = payTxFee.GetFee(nTxBytes); + // User didn't set: use -txconfirmtarget to estimate... + if (nFeeNeeded == 0) + nFeeNeeded = pool.estimateFee(nConfirmTarget).GetFee(nTxBytes); + // ... unless we don't have enough mempool data, in which case fall + // back to a hard-coded fee + if (nFeeNeeded == 0) + nFeeNeeded = CTransaction::minTxFee.GetFee(nTxBytes); + return nFeeNeeded; +} + diff --git a/src/wallet.h b/src/wallet.h index 1c2512d678..19a1b18523 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -25,12 +25,15 @@ // Settings extern CFeeRate payTxFee; +extern unsigned int nTxConfirmTarget; extern bool bSpendZeroConfChange; // -paytxfee default static const int64_t DEFAULT_TRANSACTION_FEE = 0; // -paytxfee will warn if called with a higher fee than this amount (in satoshis) per KB static const int nHighTransactionFeeWarning = 0.01 * COIN; +// Largest (in bytes) free transaction we're willing to create +static const unsigned int MAX_FREE_TRANSACTION_CREATE_SIZE = 1000; class CAccountingEntry; class CCoinControl; @@ -265,6 +268,8 @@ public: std::string SendMoney(CScript scriptPubKey, int64_t nValue, CWalletTx& wtxNew); std::string SendMoneyToDestination(const CTxDestination &address, int64_t nValue, CWalletTx& wtxNew); + static int64_t GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool& pool); + bool NewKeyPool(); bool TopUpKeyPool(unsigned int kpSize = 0); void ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool); From 4b7b1bb1ac54e067d889170757a8c45f0baaae3d Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Mon, 23 Jun 2014 10:58:59 -0400 Subject: [PATCH 0317/1288] Sanity checks for estimates Require at least 11 samples before giving fee/priority estimates. And have wallet-created transactions go throught the fee-sanity-check code path. --- src/main.cpp | 4 ++-- src/main.h | 2 +- src/txmempool.cpp | 9 +++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 6be1a29c6c..d1ddf1600d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1129,10 +1129,10 @@ int CMerkleTx::GetBlocksToMaturity() const } -bool CMerkleTx::AcceptToMemoryPool(bool fLimitFree) +bool CMerkleTx::AcceptToMemoryPool(bool fLimitFree, bool fRejectInsaneFee) { CValidationState state; - return ::AcceptToMemoryPool(mempool, state, *this, fLimitFree, NULL); + return ::AcceptToMemoryPool(mempool, state, *this, fLimitFree, NULL, fRejectInsaneFee); } diff --git a/src/main.h b/src/main.h index e8df17dda0..4c7b7fd8d4 100644 --- a/src/main.h +++ b/src/main.h @@ -452,7 +452,7 @@ public: int GetDepthInMainChain() const { CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet); } bool IsInMainChain() const { CBlockIndex *pindexRet; return GetDepthInMainChainINTERNAL(pindexRet) > 0; } int GetBlocksToMaturity() const; - bool AcceptToMemoryPool(bool fLimitFree=true); + bool AcceptToMemoryPool(bool fLimitFree=true, bool fRejectInsaneFee=true); }; diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 97a426dd35..0a8ad96aac 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -251,8 +251,13 @@ public: std::sort(sortedFeeSamples.begin(), sortedFeeSamples.end(), std::greater()); } - if (sortedFeeSamples.size() == 0) + if (sortedFeeSamples.size() < 11) + { + // Eleven is Gavin's Favorite Number + // ... but we also take a maximum of 10 samples per block so eleven means + // we're getting samples from at least two different blocks return CFeeRate(0); + } int nBucketSize = history.at(nBlocksToConfirm).FeeSamples(); @@ -281,7 +286,7 @@ public: std::sort(sortedPrioritySamples.begin(), sortedPrioritySamples.end(), std::greater()); } - if (sortedPrioritySamples.size() == 0) + if (sortedPrioritySamples.size() < 11) return -1.0; int nBucketSize = history.at(nBlocksToConfirm).PrioritySamples(); From 13fc83c77bb9108c00dd7709ce17719edb763273 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Thu, 3 Jul 2014 14:25:32 -0400 Subject: [PATCH 0318/1288] Move fee policy out of core --- src/core.cpp | 2 +- src/core.h | 6 ++---- src/init.cpp | 30 +++++++++++++++--------------- src/main.cpp | 18 ++++++++---------- src/main.h | 1 + src/miner.cpp | 2 +- src/qt/coincontroldialog.cpp | 14 +++++++------- src/qt/guiutil.cpp | 3 ++- src/qt/optionsdialog.cpp | 9 +++++++-- src/qt/paymentserver.cpp | 2 +- src/rpcmisc.cpp | 2 +- src/rpcnet.cpp | 2 +- src/txmempool.cpp | 26 +++++++++++++------------- src/txmempool.h | 4 +++- src/wallet.cpp | 9 ++++++--- src/wallet.h | 1 + 16 files changed, 70 insertions(+), 61 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index ca28624529..47f3b2a015 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -80,7 +80,7 @@ CFeeRate::CFeeRate(int64_t nFeePaid, size_t nSize) nSatoshisPerK = 0; } -int64_t CFeeRate::GetFee(size_t nSize) +int64_t CFeeRate::GetFee(size_t nSize) const { return nSatoshisPerK*nSize / 1000; } diff --git a/src/core.h b/src/core.h index d6e7ab870d..0387336c98 100644 --- a/src/core.h +++ b/src/core.h @@ -125,8 +125,8 @@ public: CFeeRate(int64_t nFeePaid, size_t nSize); CFeeRate(const CFeeRate& other) { nSatoshisPerK = other.nSatoshisPerK; } - int64_t GetFee(size_t size); // unit returned is satoshis - int64_t GetFeePerK() { return GetFee(1000); } // satoshis-per-1000-bytes + int64_t GetFee(size_t size) const; // unit returned is satoshis + int64_t GetFeePerK() const { return GetFee(1000); } // satoshis-per-1000-bytes friend bool operator<(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK < b.nSatoshisPerK; } friend bool operator>(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK > b.nSatoshisPerK; } @@ -217,8 +217,6 @@ private: void UpdateHash() const; public: - static CFeeRate minTxFee; - static CFeeRate minRelayTxFee; static const int CURRENT_VERSION=1; // The local variables are made const to prevent unintended modification diff --git a/src/init.cpp b/src/init.cpp index 3ee0f2aa39..5afae32327 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -253,15 +253,16 @@ std::string HelpMessage(HelpMessageMode mode) #ifdef ENABLE_WALLET strUsage += "\n" + _("Wallet options:") + "\n"; strUsage += " -disablewallet " + _("Do not load the wallet and disable wallet RPC calls") + "\n"; + strUsage += " -mintxfee= " + strprintf(_("Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s)"), FormatMoney(CWallet::minTxFee.GetFeePerK())) + "\n"; strUsage += " -paytxfee= " + strprintf(_("Fee (in BTC/kB) to add to transactions you send (default: %s)"), FormatMoney(payTxFee.GetFeePerK())) + "\n"; - strUsage += " -txconfirmtarget= " + _("If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1)") + "\n"; strUsage += " -rescan " + _("Rescan the block chain for missing wallet transactions") + " " + _("on startup") + "\n"; + strUsage += " -respendnotify= " + _("Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID)") + "\n"; strUsage += " -salvagewallet " + _("Attempt to recover private keys from a corrupt wallet.dat") + " " + _("on startup") + "\n"; strUsage += " -spendzeroconfchange " + _("Spend unconfirmed change when sending transactions (default: 1)") + "\n"; + strUsage += " -txconfirmtarget= " + _("If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1)") + "\n"; strUsage += " -upgradewallet " + _("Upgrade wallet to latest format") + " " + _("on startup") + "\n"; strUsage += " -wallet= " + _("Specify wallet file (within data directory)") + " " + _("(default: wallet.dat)") + "\n"; strUsage += " -walletnotify= " + _("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)") + "\n"; - strUsage += " -respendnotify= " + _("Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID)") + "\n"; strUsage += " -zapwallettxes= " + _("Delete all wallet transactions and only recover those part of the blockchain through -rescan on startup") + "\n"; strUsage += " " + _("(default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)") + "\n"; #endif @@ -295,8 +296,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -limitfreerelay= " + _("Continuously rate-limit free transactions to *1000 bytes per minute (default:15)") + "\n"; strUsage += " -maxsigcachesize= " + _("Limit size of signature cache to entries (default: 50000)") + "\n"; } - strUsage += " -mintxfee= " + strprintf(_("Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s)"), FormatMoney(CTransaction::minTxFee.GetFeePerK())) + "\n"; - strUsage += " -minrelaytxfee= " + strprintf(_("Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s)"), FormatMoney(CTransaction::minRelayTxFee.GetFeePerK())) + "\n"; + strUsage += " -minrelaytxfee= " + strprintf(_("Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s)"), FormatMoney(::minRelayTxFee.GetFeePerK())) + "\n"; strUsage += " -printtoconsole " + _("Send trace/debug info to console instead of debug.log file") + "\n"; if (GetBoolArg("-help-debug", false)) { @@ -610,24 +610,24 @@ bool AppInit2(boost::thread_group& threadGroup) // a transaction spammer can cheaply fill blocks using // 1-satoshi-fee transactions. It should be set above the real // cost to you of processing a transaction. - if (mapArgs.count("-mintxfee")) - { - int64_t n = 0; - if (ParseMoney(mapArgs["-mintxfee"], n) && n > 0) - CTransaction::minTxFee = CFeeRate(n); - else - return InitError(strprintf(_("Invalid amount for -mintxfee=: '%s'"), mapArgs["-mintxfee"])); - } if (mapArgs.count("-minrelaytxfee")) { int64_t n = 0; if (ParseMoney(mapArgs["-minrelaytxfee"], n) && n > 0) - CTransaction::minRelayTxFee = CFeeRate(n); + ::minRelayTxFee = CFeeRate(n); else return InitError(strprintf(_("Invalid amount for -minrelaytxfee=: '%s'"), mapArgs["-minrelaytxfee"])); } #ifdef ENABLE_WALLET + if (mapArgs.count("-mintxfee")) + { + int64_t n = 0; + if (ParseMoney(mapArgs["-mintxfee"], n) && n > 0) + CWallet::minTxFee = CFeeRate(n); + else + return InitError(strprintf(_("Invalid amount for -mintxfee=: '%s'"), mapArgs["-mintxfee"])); + } if (mapArgs.count("-paytxfee")) { int64_t nFeePerK = 0; @@ -636,10 +636,10 @@ bool AppInit2(boost::thread_group& threadGroup) if (nFeePerK > nHighTransactionFeeWarning) InitWarning(_("Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.")); payTxFee = CFeeRate(nFeePerK, 1000); - if (payTxFee < CTransaction::minRelayTxFee) + if (payTxFee < ::minRelayTxFee) { return InitError(strprintf(_("Invalid amount for -paytxfee=: '%s' (must be at least %s)"), - mapArgs["-paytxfee"], CTransaction::minRelayTxFee.ToString())); + mapArgs["-paytxfee"], ::minRelayTxFee.ToString())); } } nTxConfirmTarget = GetArg("-txconfirmtarget", 1); diff --git a/src/main.cpp b/src/main.cpp index d1ddf1600d..54b926abdb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -38,8 +38,6 @@ using namespace boost; CCriticalSection cs_main; -CTxMemPool mempool; - map mapBlockIndex; CChain chainActive; int64_t nTimeBestReceived = 0; @@ -50,10 +48,10 @@ bool fBenchmark = false; bool fTxIndex = false; unsigned int nCoinCacheSize = 5000; -/** Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) */ -CFeeRate CTransaction::minTxFee = CFeeRate(10000); // Override with -mintxfee /** Fees smaller than this (in satoshi) are considered zero fee (for relaying and mining) */ -CFeeRate CTransaction::minRelayTxFee = CFeeRate(1000); +CFeeRate minRelayTxFee = CFeeRate(1000); + +CTxMemPool mempool(::minRelayTxFee); struct COrphanBlock { uint256 hashBlock; @@ -617,7 +615,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) } if (whichType == TX_NULL_DATA) nDataOut++; - else if (txout.IsDust(CTransaction::minRelayTxFee)) { + else if (txout.IsDust(::minRelayTxFee)) { reason = "dust"; return false; } @@ -870,7 +868,7 @@ int64_t GetMinRelayFee(const CTransaction& tx, unsigned int nBytes, bool fAllowF return 0; } - int64_t nMinFee = tx.minRelayTxFee.GetFee(nBytes); + int64_t nMinFee = ::minRelayTxFee.GetFee(nBytes); if (fAllowFree) { @@ -1009,7 +1007,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa // Continuously rate-limit free (really, very-low-fee)transactions // This mitigates 'penny-flooding' -- sending thousands of free transactions just to // be annoying or make others' transactions take longer to confirm. - if (fLimitFree && nFees < CTransaction::minRelayTxFee.GetFee(nSize)) + if (fLimitFree && nFees < ::minRelayTxFee.GetFee(nSize)) { static double dFreeCount; static int64_t nLastFreeTime; @@ -1022,10 +1020,10 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa LogPrint("mempool", "Rate limit dFreeCount: %g => %g\n", dFreeCount, dFreeCount+nSize); } - if (fRejectInsaneFee && nFees > CTransaction::minRelayTxFee.GetFee(nSize) * 10000) + if (fRejectInsaneFee && nFees > ::minRelayTxFee.GetFee(nSize) * 10000) return error("AcceptToMemoryPool: : insane fees %s, %d > %d", hash.ToString(), - nFees, CTransaction::minRelayTxFee.GetFee(nSize) * 10000); + nFees, ::minRelayTxFee.GetFee(nSize) * 10000); // Check against previous transactions // This is done last to help prevent CPU exhaustion denial-of-service attacks. diff --git a/src/main.h b/src/main.h index 4c7b7fd8d4..961f2e78af 100644 --- a/src/main.h +++ b/src/main.h @@ -93,6 +93,7 @@ extern bool fBenchmark; extern int nScriptCheckThreads; extern bool fTxIndex; extern unsigned int nCoinCacheSize; +extern CFeeRate minRelayTxFee; // Minimum disk space required - used in CheckDiskSpace() static const uint64_t nMinDiskSpace = 52428800; diff --git a/src/miner.cpp b/src/miner.cpp index 69e53756e0..17918a1280 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -236,7 +236,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) double dPriorityDelta = 0; int64_t nFeeDelta = 0; mempool.ApplyDeltas(hash, dPriorityDelta, nFeeDelta); - if (fSortedByFee && (dPriorityDelta <= 0) && (nFeeDelta <= 0) && (feeRate < CTransaction::minRelayTxFee) && (nBlockSize + nTxSize >= nBlockMinSize)) + if (fSortedByFee && (dPriorityDelta <= 0) && (nFeeDelta <= 0) && (feeRate < ::minRelayTxFee) && (nBlockSize + nTxSize >= nBlockMinSize)) continue; // Prioritise by fee once past the priority size or we run out of high-priority diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index 73494f52ea..e0a524a55e 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -406,7 +406,7 @@ QString CoinControlDialog::getPriorityLabel(const CTxMemPool& pool, double dPrio { // confirmations -> textual description typedef std::map PriorityDescription; - static PriorityDescription priorityDescriptions = boost::assign::map_list_of + const static PriorityDescription priorityDescriptions = boost::assign::map_list_of (1, tr("highest"))(2, tr("higher"))(3, tr("high")) (5, tr("medium-high"))(6, tr("medium")) (10, tr("low-medium"))(15, tr("low")) @@ -452,7 +452,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) { CTxOut txout(amount, (CScript)vector(24, 0)); txDummy.vout.push_back(txout); - if (txout.IsDust(CTransaction::minRelayTxFee)) + if (txout.IsDust(::minRelayTxFee)) fDust = true; } } @@ -544,7 +544,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) if (nChange > 0 && nChange < CENT) { CTxOut txout(nChange, (CScript)vector(24, 0)); - if (txout.IsDust(CTransaction::minRelayTxFee)) + if (txout.IsDust(::minRelayTxFee)) { nPayFee += nChange; nChange = 0; @@ -605,17 +605,17 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) // tool tips QString toolTip1 = tr("This label turns red, if the transaction size is greater than 1000 bytes.") + "

"; - toolTip1 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK())) + "

"; + toolTip1 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CWallet::minTxFee.GetFeePerK())) + "

"; toolTip1 += tr("Can vary +/- 1 byte per input."); QString toolTip2 = tr("Transactions with higher priority are more likely to get included into a block.") + "

"; toolTip2 += tr("This label turns red, if the priority is smaller than \"medium\".") + "

"; - toolTip2 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK())); + toolTip2 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CWallet::minTxFee.GetFeePerK())); - QString toolTip3 = tr("This label turns red, if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minRelayTxFee.GetFee(546))); + QString toolTip3 = tr("This label turns red, if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, ::minRelayTxFee.GetFee(546))); // how many satoshis the estimated fee can vary per byte we guess wrong - double dFeeVary = (double)std::max(CTransaction::minTxFee.GetFeePerK(), payTxFee.GetFeePerK()) / 1000; + double dFeeVary = (double)std::max(CWallet::minTxFee.GetFeePerK(), payTxFee.GetFeePerK()) / 1000; QString toolTip4 = tr("Can vary +/- %1 satoshi(s) per input.").arg(dFeeVary); l3->setToolTip(toolTip4); diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 81b9054252..60a131df7e 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -11,6 +11,7 @@ #include "core.h" #include "init.h" +#include "main.h" #include "protocol.h" #include "util.h" @@ -212,7 +213,7 @@ bool isDust(const QString& address, qint64 amount) CTxDestination dest = CBitcoinAddress(address.toStdString()).Get(); CScript script; script.SetDestination(dest); CTxOut txOut(amount, script); - return txOut.IsDust(CTransaction::minRelayTxFee); + return txOut.IsDust(::minRelayTxFee); } QString HtmlEscape(const QString& str, bool fMultiLine) diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 12d54dff64..9502dba904 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -14,7 +14,10 @@ #include "monitoreddatamapper.h" #include "optionsmodel.h" -#include "main.h" // for CTransaction::minTxFee and MAX_SCRIPTCHECK_THREADS +#include "main.h" // for MAX_SCRIPTCHECK_THREADS +#ifdef ENABLE_WALLET +#include "wallet.h" // for CWallet::minTxFee +#endif #include "netbase.h" #include "txdb.h" // for -dbcache defaults @@ -101,7 +104,9 @@ OptionsDialog::OptionsDialog(QWidget *parent) : #endif ui->unit->setModel(new BitcoinUnits(this)); - ui->transactionFee->setSingleStep(CTransaction::minTxFee.GetFeePerK()); +#ifdef ENABLE_WALLET + ui->transactionFee->setSingleStep(CWallet::minTxFee.GetFeePerK()); +#endif /* Widget-to-option mapper */ mapper = new MonitoredDataMapper(this); diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 6ca90f0513..53db2c5cd9 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -551,7 +551,7 @@ bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoins // Extract and check amounts CTxOut txOut(sendingTo.second, sendingTo.first); - if (txOut.IsDust(CTransaction::minRelayTxFee)) { + if (txOut.IsDust(::minRelayTxFee)) { emit message(tr("Payment request error"), tr("Requested payment amount of %1 is too small (considered dust).") .arg(BitcoinUnits::formatWithUnit(optionsModel->getDisplayUnit(), sendingTo.second)), CClientUIInterface::MSG_ERROR); diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 5b470516a1..9ed6b52513 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -84,7 +84,7 @@ Value getinfo(const Array& params, bool fHelp) obj.push_back(Pair("unlocked_until", nWalletUnlockTime)); obj.push_back(Pair("paytxfee", ValueFromAmount(payTxFee.GetFeePerK()))); #endif - obj.push_back(Pair("relayfee", ValueFromAmount(CTransaction::minRelayTxFee.GetFeePerK()))); + obj.push_back(Pair("relayfee", ValueFromAmount(::minRelayTxFee.GetFeePerK()))); obj.push_back(Pair("errors", GetWarnings("statusbar"))); return obj; } diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 2d7abb2d58..cd3bd59f8f 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -372,7 +372,7 @@ Value getnetworkinfo(const Array& params, bool fHelp) obj.push_back(Pair("timeoffset", GetTimeOffset())); obj.push_back(Pair("connections", (int)vNodes.size())); obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string()))); - obj.push_back(Pair("relayfee", ValueFromAmount(CTransaction::minRelayTxFee.GetFeePerK()))); + obj.push_back(Pair("relayfee", ValueFromAmount(::minRelayTxFee.GetFeePerK()))); Array localAddresses; { LOCK(cs_mapLocalHost); diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 0a8ad96aac..a852de5da8 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -80,13 +80,13 @@ public: // Used as belt-and-suspenders check when reading to detect // file corruption - bool AreSane(const std::vector& vecFee) + bool AreSane(const std::vector& vecFee, const CFeeRate& minRelayFee) { BOOST_FOREACH(CFeeRate fee, vecFee) { if (fee < CFeeRate(0)) return false; - if (fee.GetFee(1000) > CTransaction::minRelayTxFee.GetFee(1000) * 10000) + if (fee.GetFeePerK() > minRelayFee.GetFeePerK() * 10000) return false; } return true; @@ -109,10 +109,10 @@ public: fileout << vecPriority; } - void Read(CAutoFile& filein) { + void Read(CAutoFile& filein, const CFeeRate& minRelayFee) { std::vector vecFee; filein >> vecFee; - if (AreSane(vecFee)) + if (AreSane(vecFee, minRelayFee)) feeSamples.insert(feeSamples.end(), vecFee.begin(), vecFee.end()); else throw runtime_error("Corrupt fee value in estimates file."); @@ -141,7 +141,7 @@ private: // nBlocksAgo is 0 based, i.e. transactions that confirmed in the highest seen block are // nBlocksAgo == 0, transactions in the block before that are nBlocksAgo == 1 etc. - void seenTxConfirm(CFeeRate feeRate, double dPriority, int nBlocksAgo) + void seenTxConfirm(const CFeeRate& feeRate, const CFeeRate& minRelayFee, double dPriority, int nBlocksAgo) { // Last entry records "everything else". int nBlocksTruncated = min(nBlocksAgo, (int) history.size() - 1); @@ -149,7 +149,7 @@ private: // We need to guess why the transaction was included in a block-- either // because it is high-priority or because it has sufficient fees. - bool sufficientFee = (feeRate > CTransaction::minRelayTxFee); + bool sufficientFee = (feeRate > minRelayFee); bool sufficientPriority = AllowFree(dPriority); const char* assignedTo = "unassigned"; if (sufficientFee && !sufficientPriority) @@ -177,7 +177,7 @@ public: history.resize(nEntries); } - void seenBlock(const std::vector& entries, int nBlockHeight) + void seenBlock(const std::vector& entries, int nBlockHeight, const CFeeRate minRelayFee) { if (nBlockHeight <= nBestSeenHeight) { @@ -222,7 +222,7 @@ public: // Fees are stored and reported as BTC-per-kb: CFeeRate feeRate(entry->GetFee(), entry->GetTxSize()); double dPriority = entry->GetPriority(entry->GetHeight()); // Want priority when it went IN - seenTxConfirm(feeRate, dPriority, i); + seenTxConfirm(feeRate, minRelayFee, dPriority, i); } } for (size_t i = 0; i < history.size(); i++) { @@ -313,7 +313,7 @@ public: } } - void Read(CAutoFile& filein) + void Read(CAutoFile& filein, const CFeeRate& minRelayFee) { filein >> nBestSeenHeight; size_t numEntries; @@ -322,14 +322,14 @@ public: for (size_t i = 0; i < numEntries; i++) { CBlockAverage entry; - entry.Read(filein); + entry.Read(filein, minRelayFee); history.push_back(entry); } } }; -CTxMemPool::CTxMemPool() +CTxMemPool::CTxMemPool(const CFeeRate& _minRelayFee) : minRelayFee(_minRelayFee) { // Sanity checks off by default for performance, because otherwise // accepting transactions becomes O(N^2) where N is the number @@ -445,7 +445,7 @@ void CTxMemPool::removeForBlock(const std::vector& vtx, unsigned i if (mapTx.count(hash)) entries.push_back(mapTx[hash]); } - minerPolicyEstimator->seenBlock(entries, nBlockHeight); + minerPolicyEstimator->seenBlock(entries, nBlockHeight, minRelayFee); BOOST_FOREACH(const CTransaction& tx, vtx) { std::list dummy; @@ -560,7 +560,7 @@ CTxMemPool::ReadFeeEstimates(CAutoFile& filein) return error("CTxMemPool::ReadFeeEstimates() : up-version (%d) fee estimate file", nVersionRequired); LOCK(cs); - minerPolicyEstimator->Read(filein); + minerPolicyEstimator->Read(filein, minRelayFee); } catch (std::exception &e) { LogPrintf("CTxMemPool::ReadFeeEstimates() : unable to read policy estimator data (non-fatal)"); diff --git a/src/txmempool.h b/src/txmempool.h index f7dbb126a0..41b2c52f39 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -67,13 +67,15 @@ private: unsigned int nTransactionsUpdated; CMinerPolicyEstimator* minerPolicyEstimator; + CFeeRate minRelayFee; // Passed to constructor to avoid dependency on main + public: mutable CCriticalSection cs; std::map mapTx; std::map mapNextTx; std::map > mapDeltas; - CTxMemPool(); + CTxMemPool(const CFeeRate& _minRelayFee); ~CTxMemPool(); /* diff --git a/src/wallet.cpp b/src/wallet.cpp index d9187e4be3..318a1388d2 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -21,6 +21,9 @@ CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE); unsigned int nTxConfirmTarget = 1; bool bSpendZeroConfChange = true; +/** Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) */ +CFeeRate CWallet::minTxFee = CFeeRate(10000); // Override with -mintxfee + ////////////////////////////////////////////////////////////////////////////// // // mapWallet @@ -1294,7 +1297,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, BOOST_FOREACH (const PAIRTYPE(CScript, int64_t)& s, vecSend) { CTxOut txout(s.second, s.first); - if (txout.IsDust(CTransaction::minRelayTxFee)) + if (txout.IsDust(::minRelayTxFee)) { strFailReason = _("Transaction amount too small"); return false; @@ -1355,7 +1358,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, // Never create dust outputs; if we would, just // add the dust to the fee. - if (newTxOut.IsDust(CTransaction::minRelayTxFee)) + if (newTxOut.IsDust(::minRelayTxFee)) { nFeeRet += nChange; reservekey.ReturnKey(); @@ -1537,7 +1540,7 @@ int64_t CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarge // ... unless we don't have enough mempool data, in which case fall // back to a hard-coded fee if (nFeeNeeded == 0) - nFeeNeeded = CTransaction::minTxFee.GetFee(nTxBytes); + nFeeNeeded = minTxFee.GetFee(nTxBytes); return nFeeNeeded; } diff --git a/src/wallet.h b/src/wallet.h index 19a1b18523..a5162bb838 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -268,6 +268,7 @@ public: std::string SendMoney(CScript scriptPubKey, int64_t nValue, CWalletTx& wtxNew); std::string SendMoneyToDestination(const CTxDestination &address, int64_t nValue, CWalletTx& wtxNew); + static CFeeRate minTxFee; static int64_t GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool& pool); bool NewKeyPool(); From 2e36866fecb7420cd73047a7aa762a6e5e225695 Mon Sep 17 00:00:00 2001 From: R E Broadley Date: Wed, 26 Feb 2014 17:55:04 -0800 Subject: [PATCH 0319/1288] Show nodeid instead of addresses (for anonymity) unless otherwise requested. --- src/init.cpp | 2 ++ src/main.cpp | 34 +++++++++++++++++----------------- src/net.cpp | 13 +++++++------ src/net.h | 9 +++++++-- src/util.cpp | 1 + src/util.h | 1 + 6 files changed, 35 insertions(+), 25 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index da13218a94..397ce6e065 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -288,6 +288,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -gen " + _("Generate coins (default: 0)") + "\n"; strUsage += " -genproclimit= " + _("Set the processor limit for when generation is on (-1 = unlimited, default: -1)") + "\n"; strUsage += " -help-debug " + _("Show all debugging options (usage: --help -help-debug)") + "\n"; + strUsage += " -logips " + _("Include IP addresses in debug output (default: 0)") + "\n"; strUsage += " -logtimestamps " + _("Prepend debug output with timestamp (default: 1)") + "\n"; if (GetBoolArg("-help-debug", false)) { @@ -585,6 +586,7 @@ bool AppInit2(boost::thread_group& threadGroup) fServer = GetBoolArg("-server", false); fPrintToConsole = GetBoolArg("-printtoconsole", false); fLogTimestamps = GetBoolArg("-logtimestamps", true); + fLogIPs = GetBoolArg("-logips", false); setvbuf(stdout, NULL, _IOLBF, 0); #ifdef ENABLE_WALLET bool fDisableWallet = GetBoolArg("-disablewallet", false); diff --git a/src/main.cpp b/src/main.cpp index 04d9523e26..a461c5c613 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3547,7 +3547,7 @@ void static ProcessGetData(CNode* pfrom) bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) { RandAddSeedPerfmon(); - LogPrint("net", "received: %s (%u bytes)\n", strCommand, vRecv.size()); + LogPrint("net", "received: %s (%u bytes) peer=%d\n", strCommand, vRecv.size(), pfrom->id); if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0) { LogPrintf("dropmessagestest DROPPING RECV MESSAGE\n"); @@ -3579,7 +3579,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) if (pfrom->nVersion < MIN_PEER_PROTO_VERSION) { // disconnect from peers older than this proto version - LogPrintf("partner %s using obsolete version %i; disconnecting\n", pfrom->addr.ToString(), pfrom->nVersion); + LogPrintf("peer=%d using obsolete version %i; disconnecting\n", pfrom->id, pfrom->nVersion); pfrom->PushMessage("reject", strCommand, REJECT_OBSOLETE, strprintf("Version must be %d or greater", MIN_PEER_PROTO_VERSION)); pfrom->fDisconnect = true; @@ -3660,7 +3660,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) pfrom->fSuccessfullyConnected = true; - LogPrintf("receive version message: %s: version %d, blocks=%d, us=%s, them=%s, peer=%s\n", pfrom->cleanSubVer, pfrom->nVersion, pfrom->nStartingHeight, addrMe.ToString(), addrFrom.ToString(), pfrom->addr.ToString()); + LogPrintf("receive version message: %s: version %d, blocks=%d, us=%s, peer=%d\n", pfrom->cleanSubVer, pfrom->nVersion, pfrom->nStartingHeight, addrMe.ToString(), pfrom->id); AddTimeData(pfrom->addr, nTime); } @@ -3767,7 +3767,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) pfrom->AddInventoryKnown(inv); bool fAlreadyHave = AlreadyHave(inv); - LogPrint("net", " got inventory: %s %s\n", inv.ToString(), fAlreadyHave ? "have" : "new"); + LogPrint("net", "got inv: %s %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom->id); if (!fAlreadyHave) { if (!fImporting && !fReindex) { @@ -3800,10 +3800,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) } if (fDebug || (vInv.size() != 1)) - LogPrint("net", "received getdata (%u invsz)\n", vInv.size()); + LogPrint("net", "received getdata (%u invsz) peer=%d\n", vInv.size(), pfrom->id); if ((fDebug && vInv.size() > 0) || (vInv.size() == 1)) - LogPrint("net", "received getdata for: %s\n", vInv[0].ToString()); + LogPrint("net", "received getdata for: %s peer=%d\n", vInv[0].ToString(), pfrom->id); pfrom->vRecvGetData.insert(pfrom->vRecvGetData.end(), vInv.begin(), vInv.end()); ProcessGetData(pfrom); @@ -3825,7 +3825,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) if (pindex) pindex = chainActive.Next(pindex); int nLimit = 500; - LogPrint("net", "getblocks %d to %s limit %d\n", (pindex ? pindex->nHeight : -1), hashStop==uint256(0) ? "end" : hashStop.ToString(), nLimit); + LogPrint("net", "getblocks %d to %s limit %d from peer=%d\n", (pindex ? pindex->nHeight : -1), hashStop==uint256(0) ? "end" : hashStop.ToString(), nLimit, pfrom->id); for (; pindex; pindex = chainActive.Next(pindex)) { if (pindex->GetBlockHash() == hashStop) @@ -3908,8 +3908,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) vEraseQueue.push_back(inv.hash); - LogPrint("mempool", "AcceptToMemoryPool: %s %s : accepted %s (poolsz %u)\n", - pfrom->addr.ToString(), pfrom->cleanSubVer, + LogPrint("mempool", "AcceptToMemoryPool: peer=%d %s : accepted %s (poolsz %u)\n", + pfrom->id, pfrom->cleanSubVer, tx.GetHash().ToString(), mempool.mapTx.size()); @@ -3962,8 +3962,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) int nDoS = 0; if (state.IsInvalid(nDoS)) { - LogPrint("mempool", "%s from %s %s was not accepted into the memory pool: %s\n", tx.GetHash().ToString(), - pfrom->addr.ToString(), pfrom->cleanSubVer, + LogPrint("mempool", "%s from peer=%d %s was not accepted into the memory pool: %s\n", tx.GetHash().ToString(), + pfrom->id, pfrom->cleanSubVer, state.GetRejectReason()); pfrom->PushMessage("reject", strCommand, state.GetRejectCode(), state.GetRejectReason(), inv.hash); @@ -3978,7 +3978,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) CBlock block; vRecv >> block; - LogPrint("net", "received block %s\n", block.GetHash().ToString()); + LogPrint("net", "received block %s peer=%d\n", block.GetHash().ToString(), pfrom->id); // block.print(); CInv inv(MSG_BLOCK, block.GetHash()); @@ -4095,8 +4095,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) } if (!(sProblem.empty())) { - LogPrint("net", "pong %s %s: %s, %x expected, %x received, %u bytes\n", - pfrom->addr.ToString(), + LogPrint("net", "pong peer=%d %s: %s, %x expected, %x received, %u bytes\n", + pfrom->id, pfrom->cleanSubVer, sProblem, pfrom->nPingNonceSent, @@ -4336,7 +4336,7 @@ bool ProcessMessages(CNode* pfrom) } if (!fRet) - LogPrintf("ProcessMessage(%s, %u bytes) FAILED\n", strCommand, nMessageSize); + LogPrintf("ProcessMessage(%s, %u bytes) FAILED peer=%d\n", strCommand, nMessageSize, pfrom->id); break; } @@ -4540,7 +4540,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) uint256 hash = state.vBlocksToDownload.front(); vGetData.push_back(CInv(MSG_BLOCK, hash)); MarkBlockAsInFlight(pto->GetId(), hash); - LogPrint("net", "Requesting block %s from %s\n", hash.ToString(), state.name); + LogPrint("net", "Requesting block %s peer=%d\n", hash.ToString(), pto->id); if (vGetData.size() >= 1000) { pto->PushMessage("getdata", vGetData); @@ -4557,7 +4557,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) if (!AlreadyHave(inv)) { if (fDebug) - LogPrint("net", "sending getdata: %s\n", inv.ToString()); + LogPrint("net", "Requesting %s peer=%d\n", inv.ToString(), pto->id); vGetData.push_back(inv); if (vGetData.size() >= 1000) { diff --git a/src/net.cpp b/src/net.cpp index 934c45ca4c..c7bdb83aad 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -491,8 +491,6 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest) { addrman.Attempt(addrConnect); - LogPrint("net", "connected %s\n", pszDest ? pszDest : addrConnect.ToString()); - // Set to non-blocking #ifdef WIN32 u_long nOne = 1; @@ -513,6 +511,7 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest) } pnode->nTimeConnected = GetTime(); + return pnode; } @@ -524,7 +523,7 @@ void CNode::CloseSocketDisconnect() fDisconnect = true; if (hSocket != INVALID_SOCKET) { - LogPrint("net", "disconnecting node %s\n", addrName); + LogPrint("net", "disconnecting peer=%d\n", id); closesocket(hSocket); hSocket = INVALID_SOCKET; } @@ -548,7 +547,10 @@ void CNode::PushVersion() CAddress addrYou = (addr.IsRoutable() && !IsProxy(addr) ? addr : CAddress(CService("0.0.0.0",0))); CAddress addrMe = GetLocalAddress(&addr); RAND_bytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce)); - LogPrint("net", "send version message: version %d, blocks=%d, us=%s, them=%s, peer=%s\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), addrYou.ToString(), addr.ToString()); + if (fLogIPs) + LogPrint("net", "send version message: version %d, blocks=%d, us=%s, them=%s, peer=%d\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), addrYou.ToString(), id); + else + LogPrint("net", "send version message: version %d, blocks=%d, us=%s, peer=%d\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), id); PushMessage("version", PROTOCOL_VERSION, nLocalServices, nTime, addrYou, addrMe, nLocalHostNonce, FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, std::vector()), nBestHeight, true); } @@ -950,7 +952,6 @@ void ThreadSocketHandler() } else { - LogPrint("net", "accepted connection %s\n", addr.ToString()); CNode* pnode = new CNode(hSocket, addr, "", true); pnode->AddRef(); @@ -1040,7 +1041,7 @@ void ThreadSocketHandler() { if (pnode->nLastRecv == 0 || pnode->nLastSend == 0) { - LogPrint("net", "socket no message in first 60 seconds, %d %d\n", pnode->nLastRecv != 0, pnode->nLastSend != 0); + LogPrint("net", "socket no message in first 60 seconds, %d %d from %d\n", pnode->nLastRecv != 0, pnode->nLastSend != 0, pnode->id); pnode->fDisconnect = true; } else if (nTime - pnode->nLastSend > TIMEOUT_INTERVAL) diff --git a/src/net.h b/src/net.h index 2ee798d468..3b169f442f 100644 --- a/src/net.h +++ b/src/net.h @@ -330,6 +330,11 @@ public: id = nLastNodeId++; } + if (fLogIPs) + LogPrint("net", "Added connection to %s peer=%d\n", addrName, id); + else + LogPrint("net", "Added connection peer=%d\n", id); + // Be shy and don't send version until we hear if (hSocket != INVALID_SOCKET && !fInbound) PushVersion(); @@ -446,7 +451,7 @@ public: nRequestTime = it->second; else nRequestTime = 0; - LogPrint("net", "askfor %s %d (%s)\n", inv.ToString(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str()); + LogPrint("net", "askfor %s %d (%s) peer=%d\n", inv.ToString(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str(), id); // Make sure not to reuse time indexes to keep things in the same order int64_t nNow = GetTimeMicros() - 1000000; @@ -514,7 +519,7 @@ public: assert(ssSend.size () >= CMessageHeader::CHECKSUM_OFFSET + sizeof(nChecksum)); memcpy((char*)&ssSend[CMessageHeader::CHECKSUM_OFFSET], &nChecksum, sizeof(nChecksum)); - LogPrint("net", "(%d bytes)\n", nSize); + LogPrint("net", "(%d bytes) peer=%d\n", nSize, id); std::deque::iterator it = vSendMsg.insert(vSendMsg.end(), CSerializeData()); ssSend.GetAndClear(*it); diff --git a/src/util.cpp b/src/util.cpp index 5a8f85ade7..081484c37d 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -95,6 +95,7 @@ bool fDaemon = false; bool fServer = false; string strMiscWarning; bool fLogTimestamps = false; +bool fLogIPs = false; volatile bool fReopenDebugLog = false; CClientUIInterface uiInterface; diff --git a/src/util.h b/src/util.h index 707b8f2d76..60db71bfd0 100644 --- a/src/util.h +++ b/src/util.h @@ -100,6 +100,7 @@ extern bool fPrintToDebugLog; extern bool fServer; extern std::string strMiscWarning; extern bool fLogTimestamps; +extern bool fLogIPs; extern volatile bool fReopenDebugLog; void RandAddSeed(); From 81efcd76e644d52e2296fd95c594ab49b7b3fca5 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 4 Jul 2014 08:15:59 +0200 Subject: [PATCH 0320/1288] Add libtool generated files to .gitignore --- .gitignore | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index 564fe68fd9..4169a2d96c 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,13 @@ src/config/stamp-h1 src/build-aux/ share/setup.nsi share/qt/Info.plist +# Libtool +libtool +src/m4/libtool.m4 +src/m4/ltoptions.m4 +src/m4/ltsugar.m4 +src/m4/ltversion.m4 +src/m4/lt~obsolete.m4 src/qt/*.moc src/qt/moc_*.cpp From 2ec5a3d212ac4b09e6c32d495f34ee3cdedc8c66 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 20 Jun 2014 15:21:30 +0200 Subject: [PATCH 0321/1288] rpc: Prevent easy memory exhaustion attack Allocate memory for POST message data only as bytes come in, instead of all at once at the beginning. Fixes #4343. --- src/rpcprotocol.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp index dd8692e802..9e18ca847e 100644 --- a/src/rpcprotocol.cpp +++ b/src/rpcprotocol.cpp @@ -25,6 +25,9 @@ using namespace boost; using namespace boost::asio; using namespace json_spirit; +// Number of bytes to allocate and read at most at once in post data +const size_t POST_READ_SIZE = 256 * 1024; + // // HTTP protocol // @@ -204,8 +207,17 @@ int ReadHTTPMessage(std::basic_istream& stream, map 0) { - vector vch(nLen); - stream.read(&vch[0], nLen); + vector vch; + size_t ptr = 0; + while (ptr < (size_t)nLen) + { + size_t bytes_to_read = std::min((size_t)nLen - ptr, POST_READ_SIZE); + vch.resize(ptr + bytes_to_read); + stream.read(&vch[ptr], bytes_to_read); + if (!stream) // Connection lost while reading + return HTTP_INTERNAL_SERVER_ERROR; + ptr += bytes_to_read; + } strMessageRet = string(vch.begin(), vch.end()); } From 3d0e92dc83a1aaa462124707388d79da7b2b59aa Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 4 Jul 2014 16:51:25 +0200 Subject: [PATCH 0322/1288] [Qt] remove dup includes in bitcoingui --- src/qt/bitcoingui.cpp | 5 ----- src/qt/bitcoingui.h | 6 +----- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index f2fb8c877e..b45d861b87 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -34,13 +34,10 @@ #include #include #include -#include #include -#include #include #include #include -#include #include #include #include @@ -51,8 +48,6 @@ #include #include - - #if QT_VERSION < 0x050000 #include #include diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 705e629a69..30dd7ae317 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -21,18 +21,14 @@ class Notificator; class OptionsModel; class RPCConsole; class SendCoinsRecipient; +class UnitDisplayStatusBarControl; class WalletFrame; class WalletModel; class CWallet; -class UnitDisplayStatusBarControl; - QT_BEGIN_NAMESPACE class QAction; -class QLabel; -class QMenu; -class QPoint; class QProgressBar; class QProgressDialog; QT_END_NAMESPACE From 674c070e5d28bdf1e4e631abc157f6ea0b0b1698 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 24 Jun 2014 14:33:38 +0200 Subject: [PATCH 0323/1288] [Qt] seed OpenSSL PNRG with Windows event data - see https://bitcointalk.org/index.php?topic=113496.msg1228193#msg1228193 for the initial suggestion for this - also ensure consistent debug.log message format --- src/qt/winshutdownmonitor.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/qt/winshutdownmonitor.cpp b/src/qt/winshutdownmonitor.cpp index f8f9bf45b3..a06f42f66e 100644 --- a/src/qt/winshutdownmonitor.cpp +++ b/src/qt/winshutdownmonitor.cpp @@ -6,11 +6,14 @@ #if defined(Q_OS_WIN) && QT_VERSION >= 0x050000 #include "init.h" +#include "util.h" #include #include +#include + // If we don't want a message to be processed by Qt, return true and set result to // the value that the window procedure should return. Otherwise return false. bool WinShutdownMonitor::nativeEventFilter(const QByteArray &eventType, void *pMessage, long *pnResult) @@ -19,6 +22,16 @@ bool WinShutdownMonitor::nativeEventFilter(const QByteArray &eventType, void *pM MSG *pMsg = static_cast(pMessage); + // Seed OpenSSL PRNG with Windows event data (e.g. mouse movements and other user interactions) + if (RAND_event(pMsg->message, pMsg->wParam, pMsg->lParam) == 0) { + // Warn only once as this is performance-critical + static bool warned = false; + if (!warned) { + LogPrint("%s: OpenSSL RAND_event() failed to seed OpenSSL PRNG with enough data.\n", __func__); + warned = true; + } + } + switch(pMsg->message) { case WM_QUERYENDSESSION: @@ -45,13 +58,13 @@ void WinShutdownMonitor::registerShutdownBlockReason(const QString& strReason, c typedef BOOL (WINAPI *PSHUTDOWNBRCREATE)(HWND, LPCWSTR); PSHUTDOWNBRCREATE shutdownBRCreate = (PSHUTDOWNBRCREATE)GetProcAddress(GetModuleHandleA("User32.dll"), "ShutdownBlockReasonCreate"); if (shutdownBRCreate == NULL) { - qWarning() << "registerShutdownBlockReason : GetProcAddress for ShutdownBlockReasonCreate failed"; + qWarning() << "registerShutdownBlockReason: GetProcAddress for ShutdownBlockReasonCreate failed"; return; } if (shutdownBRCreate(mainWinId, strReason.toStdWString().c_str())) - qWarning() << "registerShutdownBlockReason : Successfully registered: " + strReason; + qWarning() << "registerShutdownBlockReason: Successfully registered: " + strReason; else - qWarning() << "registerShutdownBlockReason : Failed to register: " + strReason; + qWarning() << "registerShutdownBlockReason: Failed to register: " + strReason; } #endif From ad87bc4de10d8ff9934635f2a30078ccf531a124 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sat, 5 Jul 2014 17:14:43 +0200 Subject: [PATCH 0324/1288] [Qt] Replace status bar unit icon with actual images --- src/Makefile.qt.include | 5 ++++- src/qt/bitcoin.qrc | 3 +++ src/qt/bitcoingui.cpp | 3 +-- src/qt/bitcoinunits.cpp | 11 +++++++++++ src/qt/bitcoinunits.h | 2 ++ src/qt/res/icons/unit_btc.png | Bin 0 -> 2107 bytes src/qt/res/icons/unit_mbtc.png | Bin 0 -> 2107 bytes src/qt/res/icons/unit_ubtc.png | Bin 0 -> 2107 bytes 8 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 src/qt/res/icons/unit_btc.png create mode 100644 src/qt/res/icons/unit_mbtc.png create mode 100644 src/qt/res/icons/unit_ubtc.png diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 4563bb3565..29279aff81 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -252,7 +252,10 @@ RES_ICONS = \ qt/res/icons/tx_inout.png \ qt/res/icons/tx_input.png \ qt/res/icons/tx_output.png \ - qt/res/icons/tx_mined.png + qt/res/icons/tx_mined.png \ + qt/res/icons/unit_btc.png \ + qt/res/icons/unit_mbtc.png \ + qt/res/icons/unit_ubtc.png BITCOIN_QT_CPP = \ qt/bitcoinaddressvalidator.cpp \ diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index f38200c7f7..357c6470d3 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -35,6 +35,9 @@ res/icons/tx_input.png res/icons/tx_output.png res/icons/tx_inout.png + res/icons/unit_btc.png + res/icons/unit_mbtc.png + res/icons/unit_ubtc.png res/icons/lock_closed.png res/icons/lock_open.png res/icons/key.png diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index f2fb8c877e..89cad2ce49 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -1014,7 +1014,6 @@ UnitDisplayStatusBarControl::UnitDisplayStatusBarControl():QLabel() { optionsModel = 0; createContextMenu(); - setStyleSheet("font:11pt; color: #333333"); setToolTip(tr("Unit to show amounts in. Click to select another unit.")); } @@ -1059,7 +1058,7 @@ void UnitDisplayStatusBarControl::setOptionsModel(OptionsModel *optionsModel) /** When Display Units are changed on OptionsModel it will refresh the display text of the control on the status bar */ void UnitDisplayStatusBarControl::updateDisplayUnit(int newUnits) { - setText(BitcoinUnits::name(newUnits)); + setPixmap(QIcon(":/icons/unit_" + BitcoinUnits::id(newUnits)).pixmap(31,STATUSBAR_ICONSIZE)); } /** Shows context menu with Display Unit options by the mouse coordinates */ diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp index 4ba6aba551..bbc9b2e5af 100644 --- a/src/qt/bitcoinunits.cpp +++ b/src/qt/bitcoinunits.cpp @@ -34,6 +34,17 @@ bool BitcoinUnits::valid(int unit) } } +QString BitcoinUnits::id(int unit) +{ + switch(unit) + { + case BTC: return QString("btc"); + case mBTC: return QString("mbtc"); + case uBTC: return QString("ubtc"); + default: return QString("???"); + } +} + QString BitcoinUnits::name(int unit) { switch(unit) diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h index 451b52ee21..da34ed8976 100644 --- a/src/qt/bitcoinunits.h +++ b/src/qt/bitcoinunits.h @@ -36,6 +36,8 @@ public: static QList availableUnits(); //! Is unit ID valid? static bool valid(int unit); + //! Identifier, e.g. for image names + static QString id(int unit); //! Short name static QString name(int unit); //! Longer description diff --git a/src/qt/res/icons/unit_btc.png b/src/qt/res/icons/unit_btc.png new file mode 100644 index 0000000000000000000000000000000000000000..ec3497435c9bd96caa594d5fa007a80efda05a04 GIT binary patch literal 2107 zcmeAS@N?(olHy`uVBq!ia0vp^@<1%W!3HGX{aEq_NUzopr0F#DPf&c&j literal 0 HcmV?d00001 diff --git a/src/qt/res/icons/unit_mbtc.png b/src/qt/res/icons/unit_mbtc.png new file mode 100644 index 0000000000000000000000000000000000000000..32bf2f2ca05a4768fc8e280a1e4620e3daf42538 GIT binary patch literal 2107 zcmeH|Jxc>Y5QaAh`O*Z_YGGk1l2)`*E+&U~hy=k8F!%=)ZN(y;wb=Rrf}MXL2r8B$ z79vU%L=Y4-HYza)@qOd%F)mR_rNvEnGCMPGW_Fiww>;vcW6`##QYvO=tWo$5&>9Zn zyHwtKfD6tHr7czEXJdDJ1)0cPW_&@Z_#p|bcE#J33KeauKiiWCoP?5PXngZ;z`ue2 zcLP;yN%MmB5lFe))cJazk_m7M-oPcufrgBYwMDQP1NS;1ywov02yOs3+6+3uI;fpw z5&j9>0Y1Q%KndIe8)%bF_3#T_6kh6>-Up7TdrJ!QfIG?pKK2;5xbZo>Hfkl$hy_9kzrEDQW{(X3-IO0KinGl()_oWO*K3*UY9D#9~ov2XL$;ofeI*s YY4CT}S8=*GuO0Y$rMz>J*zEB-luA|0dSJXSpSVgDYS6?MpFn&9 z&J(C3YxsnJ0g4T!$-7ocrolD%26vzWA{hr8%fOic&n6*OsbhKwJOX~uR?r1@LCEYz z8B5=6ejA$bcRDhCiXf1Q|9rUtH8Q3z`9R!Hk!7-nrB{%*G|td&l(F=A Date: Sat, 5 Jul 2014 22:43:12 +0700 Subject: [PATCH 0325/1288] Remove unused variable --- src/qt/coincontroldialog.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index e0a524a55e..c73cf416a8 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -523,9 +523,6 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) dPriority = dPriorityInputs / (nBytes - nBytesInputs + (nQuantityUncompressed * 29)); // 29 = 180 - 151 (uncompressed public keys are over the limit. max 151 bytes of the input are ignored for priority) sPriorityLabel = CoinControlDialog::getPriorityLabel(mempool, dPriority); - // Fee - int64_t nFee = payTxFee.GetFee(max((unsigned int)1000, nBytes)); - // Min Fee nPayFee = CWallet::GetMinimumFee(nBytes, nTxConfirmTarget, mempool); From 3c85d2ec37c3725e407649e487fbeb2a36606d74 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 6 Jul 2014 13:37:32 +0200 Subject: [PATCH 0326/1288] Fix CChain::GetLocator --- src/main.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b2773953d1..3de60ee3ec 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -423,15 +423,13 @@ CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const { break; // Exponentially larger steps back, plus the genesis block. int nHeight = std::max(pindex->nHeight - nStep, 0); - // Jump back quickly to the same height as the chain. - if (pindex->nHeight > nHeight) - pindex = pindex->GetAncestor(nHeight); - // In case pindex is not in this chain, iterate pindex->pprev to find blocks. - while (!Contains(pindex)) - pindex = pindex->pprev; - // If pindex is in this chain, use direct height-based access. - if (pindex->nHeight > nHeight) + if (Contains(pindex)) { + // Use O(1) CChain index if possible. pindex = (*this)[nHeight]; + } else { + // Otherwise, use O(log n) skiplist. + pindex = pindex->GetAncestor(nHeight); + } if (vHave.size() > 10) nStep *= 2; } From f4b00beae52f22fc6958855a85e1012387c3c33e Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 6 Jul 2014 14:40:31 +0200 Subject: [PATCH 0327/1288] Add CChain::GetLocator() unit test --- src/test/skiplist_tests.cpp | 56 +++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/test/skiplist_tests.cpp b/src/test/skiplist_tests.cpp index ea301685c9..11762c6ea0 100644 --- a/src/test/skiplist_tests.cpp +++ b/src/test/skiplist_tests.cpp @@ -41,5 +41,61 @@ BOOST_AUTO_TEST_CASE(skiplist_test) } } +BOOST_AUTO_TEST_CASE(getlocator_test) +{ + // Build a main chain 100000 blocks long. + std::vector vHashMain(100000); + std::vector vBlocksMain(100000); + for (unsigned int i=0; inHeight + 1); + } + + // Build a branch that splits off at block 49999, 50000 blocks long. + std::vector vHashSide(50000); + std::vector vBlocksSide(50000); + for (unsigned int i=0; inHeight + 1); + } + + // Build a CChain for the main branch. + CChain chain; + chain.SetTip(&vBlocksMain.back()); + + // Test 100 random starting points for locators. + for (int n=0; n<100; n++) { + int r = insecure_rand() % 150000; + CBlockIndex* tip = (r < 100000) ? &vBlocksMain[r] : &vBlocksSide[r - 100000]; + CBlockLocator locator = chain.GetLocator(tip); + + // The first result must be the block itself, the last one must be genesis. + BOOST_CHECK(locator.vHave.front() == tip->GetBlockHash()); + BOOST_CHECK(locator.vHave.back() == vBlocksMain[0].GetBlockHash()); + + // Entries 1 through 11 (inclusive) go back one step each. + for (unsigned int i = 1; i < 12 && i < locator.vHave.size() - 1; i++) { + BOOST_CHECK_EQUAL(locator.vHave[i].GetLow64(), tip->nHeight - i); + } + + // The further ones (excluding the last one) go back with exponential steps. + unsigned int dist = 2; + for (unsigned int i = 12; i < locator.vHave.size() - 1; i++) { + BOOST_CHECK_EQUAL(locator.vHave[i - 1].GetLow64() - locator.vHave[i].GetLow64(), dist); + dist *= 2; + } + } +} + BOOST_AUTO_TEST_SUITE_END() From 40f5cb878edd04b4be14f0d73ab706dc2e69124c Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 6 Jul 2014 14:47:23 +0200 Subject: [PATCH 0328/1288] Send rejects and apply DoS scoring for errors in direct block validation. 75f51f2a introduced asynchronous processing for blocks, where reject messages and DoS scoring could be applied outside of ProcessBlock, because block validation may happen later. However, some types of errors are still detected immediately (in particular, CheckBlock violations), which need acting after ProcessBlock returns. --- src/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index b2773953d1..04af88ba46 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3984,6 +3984,16 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) CValidationState state; ProcessBlock(state, pfrom, &block); + int nDoS; + if (state.IsInvalid(nDoS)) { + pfrom->PushMessage("reject", strCommand, state.GetRejectCode(), + state.GetRejectReason(), inv.hash); + if (nDoS > 0) { + LOCK(cs_main); + Misbehaving(pfrom->GetId(), nDoS); + } + } + } From 9f4da19babf6989a639be29c70c1d2470c5829a6 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 6 Jul 2014 16:06:46 +0200 Subject: [PATCH 0329/1288] Use pong receive time rather than processing time --- src/main.cpp | 6 +++--- src/net.cpp | 3 +++ src/net.h | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 04d9523e26..7eb4190134 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3544,7 +3544,7 @@ void static ProcessGetData(CNode* pfrom) } } -bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) +bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, int64_t nTimeReceived) { RandAddSeedPerfmon(); LogPrint("net", "received: %s (%u bytes)\n", strCommand, vRecv.size()); @@ -4054,7 +4054,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) else if (strCommand == "pong") { - int64_t pingUsecEnd = GetTimeMicros(); + int64_t pingUsecEnd = nTimeReceived; uint64_t nonce = 0; size_t nAvail = vRecv.in_avail(); bool bPingFinished = false; @@ -4305,7 +4305,7 @@ bool ProcessMessages(CNode* pfrom) bool fRet = false; try { - fRet = ProcessMessage(pfrom, strCommand, vRecv); + fRet = ProcessMessage(pfrom, strCommand, vRecv, msg.nTime); boost::this_thread::interruption_point(); } catch (std::ios_base::failure& e) diff --git a/src/net.cpp b/src/net.cpp index 934c45ca4c..fbf13b41cb 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -653,6 +653,9 @@ bool CNode::ReceiveMsgBytes(const char *pch, unsigned int nBytes) pch += handled; nBytes -= handled; + + if (msg.complete()) + msg.nTime = GetTimeMicros(); } return true; diff --git a/src/net.h b/src/net.h index 2ee798d468..e85fc5f9b6 100644 --- a/src/net.h +++ b/src/net.h @@ -173,11 +173,14 @@ public: CDataStream vRecv; // received message data unsigned int nDataPos; + int64_t nTime; // time (in microseconds) of message receipt. + CNetMessage(int nTypeIn, int nVersionIn) : hdrbuf(nTypeIn, nVersionIn), vRecv(nTypeIn, nVersionIn) { hdrbuf.resize(24); in_data = false; nHdrPos = 0; nDataPos = 0; + nTime = 0; } bool complete() const From 0127a9be14089b3f352ec349b2ecf4488234a4d8 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 11 Jun 2014 13:20:59 +0200 Subject: [PATCH 0330/1288] remove SOCKS4 support from core and GUI - now we support SOCKS5 only --- src/init.cpp | 19 ++---- src/netbase.cpp | 124 ++++++++-------------------------- src/netbase.h | 6 +- src/qt/forms/optionsdialog.ui | 20 ------ src/qt/optionsdialog.cpp | 8 --- src/qt/optionsmodel.cpp | 28 ++------ src/qt/paymentserver.cpp | 14 ++-- src/rpcmisc.cpp | 2 +- src/rpcnet.cpp | 2 +- 9 files changed, 49 insertions(+), 174 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index c514facbbe..a92d2aad67 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -238,9 +238,8 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -onion= " + _("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy)") + "\n"; strUsage += " -onlynet= " + _("Only connect to nodes in network (IPv4, IPv6 or Tor)") + "\n"; strUsage += " -port= " + _("Listen for connections on (default: 8333 or testnet: 18333)") + "\n"; - strUsage += " -proxy= " + _("Connect through SOCKS proxy") + "\n"; + strUsage += " -proxy= " + _("Connect through SOCKS5 proxy") + "\n"; strUsage += " -seednode= " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n"; - strUsage += " -socks= " + _("Select SOCKS version for -proxy (4 or 5, default: 5)") + "\n"; strUsage += " -timeout= " + _("Specify connection timeout in milliseconds (default: 5000)") + "\n"; #ifdef USE_UPNP #if USE_UPNP @@ -745,10 +744,6 @@ bool AppInit2(boost::thread_group& threadGroup) RegisterNodeSignals(GetNodeSignals()); - int nSocksVersion = GetArg("-socks", 5); - if (nSocksVersion != 4 && nSocksVersion != 5) - return InitError(strprintf(_("Unknown -socks proxy version requested: %i"), nSocksVersion)); - if (mapArgs.count("-onlynet")) { std::set nets; BOOST_FOREACH(std::string snet, mapMultiArgs["-onlynet"]) { @@ -772,12 +767,10 @@ bool AppInit2(boost::thread_group& threadGroup) return InitError(strprintf(_("Invalid -proxy address: '%s'"), mapArgs["-proxy"])); if (!IsLimited(NET_IPV4)) - SetProxy(NET_IPV4, addrProxy, nSocksVersion); - if (nSocksVersion > 4) { - if (!IsLimited(NET_IPV6)) - SetProxy(NET_IPV6, addrProxy, nSocksVersion); - SetNameProxy(addrProxy, nSocksVersion); - } + SetProxy(NET_IPV4, addrProxy); + if (!IsLimited(NET_IPV6)) + SetProxy(NET_IPV6, addrProxy); + SetNameProxy(addrProxy); fProxy = true; } @@ -791,7 +784,7 @@ bool AppInit2(boost::thread_group& threadGroup) addrOnion = CService(mapArgs["-onion"], 9050); if (!addrOnion.IsValid()) return InitError(strprintf(_("Invalid -onion address: '%s'"), mapArgs["-onion"])); - SetProxy(NET_TOR, addrOnion, 5); + SetProxy(NET_TOR, addrOnion); SetReachable(NET_TOR); } diff --git a/src/netbase.cpp b/src/netbase.cpp index f47b0f3563..2567c4c780 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -37,7 +37,7 @@ using namespace std; // Settings static proxyType proxyInfo[NET_MAX]; -static proxyType nameproxyInfo; +static CService nameProxy; static CCriticalSection cs_proxyInfos; int nConnectTimeout = 5000; bool fNameLookup = false; @@ -214,50 +214,6 @@ bool LookupNumeric(const char *pszName, CService& addr, int portDefault) return Lookup(pszName, addr, portDefault, false); } -bool static Socks4(const CService &addrDest, SOCKET& hSocket) -{ - LogPrintf("SOCKS4 connecting %s\n", addrDest.ToString()); - if (!addrDest.IsIPv4()) - { - closesocket(hSocket); - return error("Proxy destination is not IPv4"); - } - char pszSocks4IP[] = "\4\1\0\0\0\0\0\0user"; - struct sockaddr_in addr; - socklen_t len = sizeof(addr); - if (!addrDest.GetSockAddr((struct sockaddr*)&addr, &len) || addr.sin_family != AF_INET) - { - closesocket(hSocket); - return error("Cannot get proxy destination address"); - } - memcpy(pszSocks4IP + 2, &addr.sin_port, 2); - memcpy(pszSocks4IP + 4, &addr.sin_addr, 4); - char* pszSocks4 = pszSocks4IP; - int nSize = sizeof(pszSocks4IP); - - int ret = send(hSocket, pszSocks4, nSize, MSG_NOSIGNAL); - if (ret != nSize) - { - closesocket(hSocket); - return error("Error sending to proxy"); - } - char pchRet[8]; - if (recv(hSocket, pchRet, 8, 0) != 8) - { - closesocket(hSocket); - return error("Error reading proxy response"); - } - if (pchRet[1] != 0x5a) - { - closesocket(hSocket); - if (pchRet[1] != 0x5b) - LogPrintf("ERROR: Proxy returned error %d\n", pchRet[1]); - return false; - } - LogPrintf("SOCKS4 connected %s\n", addrDest.ToString()); - return true; -} - bool static Socks5(string strDest, int port, SOCKET& hSocket) { LogPrintf("SOCKS5 connecting %s\n", strDest); @@ -468,53 +424,49 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe return true; } -bool SetProxy(enum Network net, CService addrProxy, int nSocksVersion) { +bool SetProxy(enum Network net, CService addrProxy) { assert(net >= 0 && net < NET_MAX); - if (nSocksVersion != 0 && nSocksVersion != 4 && nSocksVersion != 5) - return false; - if (nSocksVersion != 0 && !addrProxy.IsValid()) + if (!addrProxy.IsValid()) return false; LOCK(cs_proxyInfos); - proxyInfo[net] = std::make_pair(addrProxy, nSocksVersion); + proxyInfo[net] = addrProxy; return true; } bool GetProxy(enum Network net, proxyType &proxyInfoOut) { assert(net >= 0 && net < NET_MAX); LOCK(cs_proxyInfos); - if (!proxyInfo[net].second) + if (!proxyInfo[net].IsValid()) return false; proxyInfoOut = proxyInfo[net]; return true; } -bool SetNameProxy(CService addrProxy, int nSocksVersion) { - if (nSocksVersion != 0 && nSocksVersion != 5) - return false; - if (nSocksVersion != 0 && !addrProxy.IsValid()) +bool SetNameProxy(CService addrProxy) { + if (!addrProxy.IsValid()) return false; LOCK(cs_proxyInfos); - nameproxyInfo = std::make_pair(addrProxy, nSocksVersion); + nameProxy = addrProxy; return true; } -bool GetNameProxy(proxyType &nameproxyInfoOut) { +bool GetNameProxy(CService &nameProxyOut) { LOCK(cs_proxyInfos); - if (!nameproxyInfo.second) + if(!nameProxy.IsValid()) return false; - nameproxyInfoOut = nameproxyInfo; + nameProxyOut = nameProxy; return true; } bool HaveNameProxy() { LOCK(cs_proxyInfos); - return nameproxyInfo.second != 0; + return nameProxy.IsValid(); } bool IsProxy(const CNetAddr &addr) { LOCK(cs_proxyInfos); for (int i = 0; i < NET_MAX; i++) { - if (proxyInfo[i].second && (addr == (CNetAddr)proxyInfo[i].first)) + if (addr == (CNetAddr)proxyInfo[i]) return true; } return false; @@ -523,31 +475,18 @@ bool IsProxy(const CNetAddr &addr) { bool ConnectSocket(const CService &addrDest, SOCKET& hSocketRet, int nTimeout) { proxyType proxy; - - // no proxy needed + // no proxy needed (none set for target network) if (!GetProxy(addrDest.GetNetwork(), proxy)) return ConnectSocketDirectly(addrDest, hSocketRet, nTimeout); SOCKET hSocket = INVALID_SOCKET; // first connect to proxy server - if (!ConnectSocketDirectly(proxy.first, hSocket, nTimeout)) + if (!ConnectSocketDirectly(proxy, hSocket, nTimeout)) return false; - // do socks negotiation - switch (proxy.second) { - case 4: - if (!Socks4(addrDest, hSocket)) - return false; - break; - case 5: - if (!Socks5(addrDest.ToStringIP(), addrDest.GetPort(), hSocket)) - return false; - break; - default: - closesocket(hSocket); + if (!Socks5(addrDest.ToStringIP(), addrDest.GetPort(), hSocket)) return false; - } hSocketRet = hSocket; return true; @@ -561,30 +500,25 @@ bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest SOCKET hSocket = INVALID_SOCKET; - proxyType nameproxy; - GetNameProxy(nameproxy); + CService nameProxy; + GetNameProxy(nameProxy); - CService addrResolved(CNetAddr(strDest, fNameLookup && !nameproxy.second), port); + CService addrResolved(CNetAddr(strDest, fNameLookup && !HaveNameProxy()), port); if (addrResolved.IsValid()) { addr = addrResolved; return ConnectSocket(addr, hSocketRet, nTimeout); } - addr = CService("0.0.0.0:0"); - if (!nameproxy.second) - return false; - if (!ConnectSocketDirectly(nameproxy.first, hSocket, nTimeout)) - return false; - switch(nameproxy.second) { - default: - case 4: - closesocket(hSocket); - return false; - case 5: - if (!Socks5(strDest, port, hSocket)) - return false; - break; - } + addr = CService("0.0.0.0:0"); + + if (!HaveNameProxy()) + return false; + // first connect to name proxy server + if (!ConnectSocketDirectly(nameProxy, hSocket, nTimeout)) + return false; + // do socks negotiation + if (!Socks5(strDest, (unsigned short)port, hSocket)) + return false; hSocketRet = hSocket; return true; diff --git a/src/netbase.h b/src/netbase.h index 40a3d25676..ad1e230834 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -161,14 +161,14 @@ class CService : public CNetAddr ) }; -typedef std::pair proxyType; +typedef CService proxyType; enum Network ParseNetwork(std::string net); void SplitHostPort(std::string in, int &portOut, std::string &hostOut); -bool SetProxy(enum Network net, CService addrProxy, int nSocksVersion = 5); +bool SetProxy(enum Network net, CService addrProxy); bool GetProxy(enum Network net, proxyType &proxyInfoOut); bool IsProxy(const CNetAddr &addr); -bool SetNameProxy(CService addrProxy, int nSocksVersion = 5); +bool SetNameProxy(CService addrProxy); bool HaveNameProxy(); bool LookupHost(const char *pszName, std::vector& vIP, unsigned int nMaxSolutions = 0, bool fAllowLookup = true); bool Lookup(const char *pszName, CService& addr, int portDefault = 0, bool fAllowLookup = true); diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 0c5b8895aa..1f535a4a62 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -328,26 +328,6 @@ - - - - SOCKS &Version: - - - Qt::PlainText - - - socksVersion - - - - - - - SOCKS version of the proxy (e.g. 5) - - - diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 9502dba904..597be40abd 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -52,15 +52,8 @@ OptionsDialog::OptionsDialog(QWidget *parent) : ui->proxyPort->setEnabled(false); ui->proxyPort->setValidator(new QIntValidator(1, 65535, this)); - /** SOCKS version is only selectable for default proxy and is always 5 for IPv6 and Tor */ - ui->socksVersion->setEnabled(false); - ui->socksVersion->addItem("5", 5); - ui->socksVersion->addItem("4", 4); - ui->socksVersion->setCurrentIndex(0); - connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->proxyIp, SLOT(setEnabled(bool))); connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->proxyPort, SLOT(setEnabled(bool))); - connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->socksVersion, SLOT(setEnabled(bool))); ui->proxyIp->installEventFilter(this); @@ -182,7 +175,6 @@ void OptionsDialog::setMapper() mapper->addMapping(ui->connectSocks, OptionsModel::ProxyUse); mapper->addMapping(ui->proxyIp, OptionsModel::ProxyIP); mapper->addMapping(ui->proxyPort, OptionsModel::ProxyPort); - mapper->addMapping(ui->socksVersion, OptionsModel::ProxySocksVersion); /* Window */ #ifndef Q_OS_MAC diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 09553a2587..f07e66bf04 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -122,11 +122,6 @@ void OptionsModel::Init() // Only try to set -proxy, if user has enabled fUseProxy if (settings.value("fUseProxy").toBool() && !SoftSetArg("-proxy", settings.value("addrProxy").toString().toStdString())) addOverriddenOption("-proxy"); - if (!settings.contains("nSocksVersion")) - settings.setValue("nSocksVersion", 5); - // Only try to set -socks, if user has enabled fUseProxy - if (settings.value("fUseProxy").toBool() && !SoftSetArg("-socks", settings.value("nSocksVersion").toString().toStdString())) - addOverriddenOption("-socks"); // Display if (!settings.contains("language")) @@ -188,8 +183,6 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts); return strlIpPort.at(1); } - case ProxySocksVersion: - return settings.value("nSocksVersion", 5); #ifdef ENABLE_WALLET case Fee: { @@ -284,13 +277,6 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in } } break; - case ProxySocksVersion: { - if (settings.value("nSocksVersion") != value) { - settings.setValue("nSocksVersion", value.toInt()); - setRestartRequired(true); - } - } - break; #ifdef ENABLE_WALLET case Fee: { // core option - can be changed on-the-fly // Todo: Add is valid check and warn via message, if not @@ -378,20 +364,16 @@ bool OptionsModel::getProxySettings(QNetworkProxy& proxy) const // GUI settings can be overridden with -proxy. proxyType curProxy; if (GetProxy(NET_IPV4, curProxy)) { - if (curProxy.second == 5) { - proxy.setType(QNetworkProxy::Socks5Proxy); - proxy.setHostName(QString::fromStdString(curProxy.first.ToStringIP())); - proxy.setPort(curProxy.first.GetPort()); + proxy.setType(QNetworkProxy::Socks5Proxy); + proxy.setHostName(QString::fromStdString(curProxy.ToStringIP())); + proxy.setPort(curProxy.GetPort()); - return true; - } - else - return false; + return true; } else proxy.setType(QNetworkProxy::NoProxy); - return true; + return false; } void OptionsModel::setRestartRequired(bool fRequired) diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 53db2c5cd9..5471625a67 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -341,20 +341,14 @@ void PaymentServer::initNetManager() QNetworkProxy proxy; - // Query active proxy (fails if no SOCKS5 proxy) + // Query active SOCKS5 proxy if (optionsModel->getProxySettings(proxy)) { - if (proxy.type() == QNetworkProxy::Socks5Proxy) { - netManager->setProxy(proxy); + netManager->setProxy(proxy); - qDebug() << "PaymentServer::initNetManager : Using SOCKS5 proxy" << proxy.hostName() << ":" << proxy.port(); - } - else - qDebug() << "PaymentServer::initNetManager : No active proxy server found."; + qDebug() << "PaymentServer::initNetManager : Using SOCKS5 proxy" << proxy.hostName() << ":" << proxy.port(); } else - emit message(tr("Net manager warning"), - tr("Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy."), - CClientUIInterface::MSG_WARNING); + qDebug() << "PaymentServer::initNetManager : No active proxy server found."; connect(netManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(netRequestFinished(QNetworkReply*))); diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 9ed6b52513..1e84393025 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -72,7 +72,7 @@ Value getinfo(const Array& params, bool fHelp) obj.push_back(Pair("blocks", (int)chainActive.Height())); obj.push_back(Pair("timeoffset", GetTimeOffset())); obj.push_back(Pair("connections", (int)vNodes.size())); - obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string()))); + obj.push_back(Pair("proxy", (proxy.IsValid() ? proxy.ToStringIPPort() : string()))); obj.push_back(Pair("difficulty", (double)GetDifficulty())); obj.push_back(Pair("testnet", Params().NetworkID() == CBaseChainParams::TESTNET)); #ifdef ENABLE_WALLET diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index cd3bd59f8f..cf2c293caf 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -371,7 +371,7 @@ Value getnetworkinfo(const Array& params, bool fHelp) obj.push_back(Pair("localservices", strprintf("%016x", nLocalServices))); obj.push_back(Pair("timeoffset", GetTimeOffset())); obj.push_back(Pair("connections", (int)vNodes.size())); - obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string()))); + obj.push_back(Pair("proxy", (proxy.IsValid() ? proxy.ToStringIPPort() : string()))); obj.push_back(Pair("relayfee", ValueFromAmount(::minRelayTxFee.GetFeePerK()))); Array localAddresses; { From a339a37b28176135c7fe5adbd3b50da77a45373d Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 16 Jun 2014 08:48:32 +0200 Subject: [PATCH 0331/1288] error out, when we detect -socks argument --- src/init.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/init.cpp b/src/init.cpp index a92d2aad67..db9247ef6f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -565,6 +565,9 @@ bool AppInit2(boost::thread_group& threadGroup) // Check for -debugnet (deprecated) if (GetBoolArg("-debugnet", false)) InitWarning(_("Warning: Deprecated argument -debugnet ignored, use -debug=net")); + // Check for -socks - as this is a privacy risk to continue, exit here + if (mapArgs.count("-socks")) + return InitError(_("Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.")); // Check for -tor - as this is a privacy risk to continue, exit here if (GetBoolArg("-tor", false)) return InitError(_("Error: Unsupported argument -tor found, use -onion.")); From e832ab7754732af7fd46ad7f16eef973e238c357 Mon Sep 17 00:00:00 2001 From: Daniel Kraft Date: Mon, 7 Jul 2014 09:34:43 +0200 Subject: [PATCH 0332/1288] Rename SendMoneyToDestination to SendMoney. Get rid of SendMoney and replace it by the functionality of SendMoneyToDestination. This cleans up the code, since only SendMoneyToDestination was actually used (SendMoney internally from this routine). --- src/rpcwallet.cpp | 4 ++-- src/wallet.cpp | 55 +++++++++++++++++++++-------------------------- src/wallet.h | 3 +-- 3 files changed, 28 insertions(+), 34 deletions(-) diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 38e96133b4..639b21f120 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -346,7 +346,7 @@ Value sendtoaddress(const Array& params, bool fHelp) EnsureWalletIsUnlocked(); - string strError = pwalletMain->SendMoneyToDestination(address.Get(), nAmount, wtx); + string strError = pwalletMain->SendMoney(address.Get(), nAmount, wtx); if (strError != "") throw JSONRPCError(RPC_WALLET_ERROR, strError); @@ -786,7 +786,7 @@ Value sendfrom(const Array& params, bool fHelp) throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds"); // Send - string strError = pwalletMain->SendMoneyToDestination(address.Get(), nAmount, wtx); + string strError = pwalletMain->SendMoney(address.Get(), nAmount, wtx); if (strError != "") throw JSONRPCError(RPC_WALLET_ERROR, strError); diff --git a/src/wallet.cpp b/src/wallet.cpp index 318a1388d2..ed1b178600 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1487,35 +1487,7 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey) -string CWallet::SendMoney(CScript scriptPubKey, int64_t nValue, CWalletTx& wtxNew) -{ - CReserveKey reservekey(this); - int64_t nFeeRequired; - - if (IsLocked()) - { - string strError = _("Error: Wallet locked, unable to create transaction!"); - LogPrintf("SendMoney() : %s", strError); - return strError; - } - string strError; - if (!CreateTransaction(scriptPubKey, nValue, wtxNew, reservekey, nFeeRequired, strError)) - { - if (nValue + nFeeRequired > GetBalance()) - strError = strprintf(_("Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!"), FormatMoney(nFeeRequired)); - LogPrintf("SendMoney() : %s\n", strError); - return strError; - } - - if (!CommitTransaction(wtxNew, reservekey)) - return _("Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."); - - return ""; -} - - - -string CWallet::SendMoneyToDestination(const CTxDestination& address, int64_t nValue, CWalletTx& wtxNew) +string CWallet::SendMoney(const CTxDestination &address, int64_t nValue, CWalletTx& wtxNew) { // Check amount if (nValue <= 0) @@ -1523,13 +1495,36 @@ string CWallet::SendMoneyToDestination(const CTxDestination& address, int64_t nV if (nValue > GetBalance()) return _("Insufficient funds"); + string strError; + if (IsLocked()) + { + strError = _("Error: Wallet locked, unable to create transaction!"); + LogPrintf("SendMoney() : %s", strError); + return strError; + } + // Parse Bitcoin address CScript scriptPubKey; scriptPubKey.SetDestination(address); - return SendMoney(scriptPubKey, nValue, wtxNew); + // Create and send the transaction + CReserveKey reservekey(this); + int64_t nFeeRequired; + if (!CreateTransaction(scriptPubKey, nValue, wtxNew, reservekey, nFeeRequired, strError)) + { + if (nValue + nFeeRequired > GetBalance()) + strError = strprintf(_("Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!"), FormatMoney(nFeeRequired)); + LogPrintf("SendMoney() : %s\n", strError); + return strError; + } + if (!CommitTransaction(wtxNew, reservekey)) + return _("Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."); + + return ""; } + + int64_t CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool& pool) { // payTxFee is user-set "I want to pay this much" diff --git a/src/wallet.h b/src/wallet.h index a5162bb838..62f13e4630 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -265,8 +265,7 @@ public: bool CreateTransaction(CScript scriptPubKey, int64_t nValue, CWalletTx& wtxNew, CReserveKey& reservekey, int64_t& nFeeRet, std::string& strFailReason, const CCoinControl *coinControl = NULL); bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey); - std::string SendMoney(CScript scriptPubKey, int64_t nValue, CWalletTx& wtxNew); - std::string SendMoneyToDestination(const CTxDestination &address, int64_t nValue, CWalletTx& wtxNew); + std::string SendMoney(const CTxDestination &address, int64_t nValue, CWalletTx& wtxNew); static CFeeRate minTxFee; static int64_t GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool& pool); From 509030344c66d2a2e27e50a690c43d577e5b943b Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 3 Jul 2014 07:31:50 +0200 Subject: [PATCH 0333/1288] qt: Pick translation messages only from necessary files Utility libraries (common, util) as well as extra tools shouldn't be parsed for translation messages, only the server and wallet part qualify here. --- share/qt/extract_strings_qt.py | 5 ++- src/Makefile.qt.include | 4 +- src/qt/bitcoinstrings.cpp | 74 +++++++++++++++++++--------------- 3 files changed, 46 insertions(+), 37 deletions(-) diff --git a/share/qt/extract_strings_qt.py b/share/qt/extract_strings_qt.py index e6afe3b48b..d4bd585138 100755 --- a/share/qt/extract_strings_qt.py +++ b/share/qt/extract_strings_qt.py @@ -7,8 +7,9 @@ from subprocess import Popen, PIPE import glob import operator import os +import sys -OUT_CPP="src/qt/bitcoinstrings.cpp" +OUT_CPP="qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): @@ -47,7 +48,7 @@ def parse_po(text): return messages -files = glob.glob('src/*.cpp') + glob.glob('src/*.h') +files = sys.argv[1:] # xgettext -n --keyword=_ $FILES XGETTEXT=os.getenv('XGETTEXT', 'xgettext') diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 4563bb3565..f2b6c2ccd6 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -367,9 +367,9 @@ QT_QM=$(QT_TS:.ts=.qm) .SECONDARY: $(QT_QM) -qt/bitcoinstrings.cpp: $(libbitcoin_server_a_SOURCES) $(libbitcoin_common_a_SOURCES) $(libbitcoin_cli_a_SOURCES) $(libbitcoin_util_a_SOURCES) +qt/bitcoinstrings.cpp: $(libbitcoin_server_a_SOURCES) $(libbitcoin_wallet_a_SOURCES) @test -n $(XGETTEXT) || echo "xgettext is required for updating translations" - $(AM_V_GEN) cd $(top_srcdir); XGETTEXT=$(XGETTEXT) share/qt/extract_strings_qt.py + $(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) ../share/qt/extract_strings_qt.py $^ translate: qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM) @test -n $(LUPDATE) || echo "lupdate is required for updating translations" diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index 10b44bbc3f..b717546708 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -22,31 +22,42 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "It is also recommended to set alertnotify so you are notified of problems;\n" "for example: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com\n"), QT_TRANSLATE_NOOP("bitcoin-core", "" +"(default: 1, 1 = keep tx meta data e.g. account owner and payment request " +"information, 2 = drop tx meta data)"), +QT_TRANSLATE_NOOP("bitcoin-core", "" "Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!" "3DES:@STRENGTH)"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"An error occurred while setting up the RPC port %u for listening on IPv4: %s"), +"Allow JSON-RPC connections from specified source. Valid for are a " +"single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or " +"a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"An error occurred while setting up the RPC port %u for listening on IPv6, " -"falling back to IPv4: %s"), +"An error occurred while setting up the RPC address %s port %u for listening: " +"%s"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Bind to given address and always listen on it. Use [host]:port notation for " "IPv6"), QT_TRANSLATE_NOOP("bitcoin-core", "" +"Bind to given address to listen for JSON-RPC connections. Use [host]:port " +"notation for IPv6. This option can be specified multiple times (default: " +"bind to all interfaces)"), +QT_TRANSLATE_NOOP("bitcoin-core", "" "Cannot obtain a lock on data directory %s. Bitcoin Core is probably already " "running."), QT_TRANSLATE_NOOP("bitcoin-core", "" "Continuously rate-limit free transactions to *1000 bytes per minute " "(default:15)"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Enter regression test mode, which uses a special chain in which blocks can " -"be solved instantly. This is intended for regression testing tools and app " -"development."), +"Delete all wallet transactions and only recover those part of the blockchain " +"through -rescan on startup"), +QT_TRANSLATE_NOOP("bitcoin-core", "" +"Distributed under the MIT/X11 software license, see the accompanying file " +"COPYING or ."), QT_TRANSLATE_NOOP("bitcoin-core", "" "Enter regression test mode, which uses a special chain in which blocks can " "be solved instantly."), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Error: Listening for incoming connections failed (listen returned error %d)"), +"Error: Listening for incoming connections failed (listen returned error %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Error: The transaction was rejected! This might happen if some of the coins " "in your wallet were already spent, such as if you used a copy of wallet.dat " @@ -55,6 +66,9 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Error: This transaction requires a transaction fee of at least %s because of " "its amount, complexity, or use of recently received funds!"), QT_TRANSLATE_NOOP("bitcoin-core", "" +"Execute command when a network tx respends wallet tx input (%s=respend TxID, " +"%t=wallet TxID)"), +QT_TRANSLATE_NOOP("bitcoin-core", "" "Execute command when a relevant alert is received or we see a really long " "fork (%s in cmd is replaced by message)"), QT_TRANSLATE_NOOP("bitcoin-core", "" @@ -64,8 +78,11 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Execute command when the best block changes (%s in cmd is replaced by block " "hash)"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Fees smaller than this are considered zero fee (for transaction creation) " -"(default:"), +"Fees (in BTC/Kb) smaller than this are considered zero fee for relaying " +"(default: %s)"), +QT_TRANSLATE_NOOP("bitcoin-core", "" +"Fees (in BTC/Kb) smaller than this are considered zero fee for transaction " +"creation (default: %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Flush database activity from memory pool to disk log every megabytes " "(default: 100)"), @@ -93,6 +110,10 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "This is a pre-release test build - use at your own risk - do not use for " "mining or merchant applications"), QT_TRANSLATE_NOOP("bitcoin-core", "" +"This product includes software developed by the OpenSSL Project for use in " +"the OpenSSL Toolkit and cryptographic software " +"written by Eric Young and UPnP software written by Thomas Bernard."), +QT_TRANSLATE_NOOP("bitcoin-core", "" "Unable to bind to %s on this computer. Bitcoin Core is probably already " "running."), QT_TRANSLATE_NOOP("bitcoin-core", "" @@ -117,11 +138,6 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as " "wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect " "you should restore from a backup."), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"You must set rpcpassword= in the configuration file:\n" -"%s\n" -"If the file does not exist, create it with owner-readable-only file " -"permissions."), QT_TRANSLATE_NOOP("bitcoin-core", "(default: 1)"), QT_TRANSLATE_NOOP("bitcoin-core", "(default: wallet.dat)"), QT_TRANSLATE_NOOP("bitcoin-core", " can be:"), @@ -129,22 +145,19 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Accept command line and JSON-RPC commands"), QT_TRANSLATE_NOOP("bitcoin-core", "Accept connections from outside (default: 1 if no -proxy or -connect)"), QT_TRANSLATE_NOOP("bitcoin-core", "Add a node to connect to and attempt to keep the connection open"), QT_TRANSLATE_NOOP("bitcoin-core", "Allow DNS lookups for -addnode, -seednode and -connect"), -QT_TRANSLATE_NOOP("bitcoin-core", "Allow JSON-RPC connections from specified IP address"), QT_TRANSLATE_NOOP("bitcoin-core", "Attempt to recover private keys from a corrupt wallet.dat"), -QT_TRANSLATE_NOOP("bitcoin-core", "Bitcoin Core Daemon"), -QT_TRANSLATE_NOOP("bitcoin-core", "Bitcoin Core RPC client version"), QT_TRANSLATE_NOOP("bitcoin-core", "Block creation options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot downgrade wallet"), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -bind address: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -externalip address: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot write default address"), -QT_TRANSLATE_NOOP("bitcoin-core", "Clear list of wallet transactions (diagnostic tool; implies -rescan)"), QT_TRANSLATE_NOOP("bitcoin-core", "Connect only to the specified node(s)"), QT_TRANSLATE_NOOP("bitcoin-core", "Connect through SOCKS proxy"), -QT_TRANSLATE_NOOP("bitcoin-core", "Connect to JSON-RPC on (default: 8332 or testnet: 18332)"), QT_TRANSLATE_NOOP("bitcoin-core", "Connect to a node to retrieve peer addresses, and disconnect"), QT_TRANSLATE_NOOP("bitcoin-core", "Connection options:"), +QT_TRANSLATE_NOOP("bitcoin-core", "Copyright (C) 2009-%i The Bitcoin Core Developers"), QT_TRANSLATE_NOOP("bitcoin-core", "Corrupted block database detected"), +QT_TRANSLATE_NOOP("bitcoin-core", "Could not parse -rpcbind value %s as network address"), QT_TRANSLATE_NOOP("bitcoin-core", "Debugging/Testing options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Disable safemode, override a real safe mode event (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "Discover own IP address (default: 1 when listening and no -externalip)"), @@ -160,6 +173,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet requires new QT_TRANSLATE_NOOP("bitcoin-core", "Error opening block database"), QT_TRANSLATE_NOOP("bitcoin-core", "Error"), QT_TRANSLATE_NOOP("bitcoin-core", "Error: Disk space is low!"), +QT_TRANSLATE_NOOP("bitcoin-core", "Error: Unsupported argument -tor found, use -onion."), QT_TRANSLATE_NOOP("bitcoin-core", "Error: Wallet locked, unable to create transaction!"), QT_TRANSLATE_NOOP("bitcoin-core", "Error: system error: "), QT_TRANSLATE_NOOP("bitcoin-core", "Failed to listen on any port. Use -listen=0 if you want this."), @@ -173,18 +187,17 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write file info"), QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write to coin database"), QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write transaction index"), QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write undo data"), -QT_TRANSLATE_NOOP("bitcoin-core", "Fee per kB to add to transactions you send"), -QT_TRANSLATE_NOOP("bitcoin-core", "Fees smaller than this are considered zero fee (for relaying) (default:"), +QT_TRANSLATE_NOOP("bitcoin-core", "Fee (in BTC/kB) to add to transactions you send (default: %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "Find peers using DNS lookup (default: 1 unless -connect)"), QT_TRANSLATE_NOOP("bitcoin-core", "Force safe mode (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "Generate coins (default: 0)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Get help for a command"), QT_TRANSLATE_NOOP("bitcoin-core", "How many blocks to check at startup (default: 288, 0 = all)"), QT_TRANSLATE_NOOP("bitcoin-core", "If is not supplied, output all debugging information."), QT_TRANSLATE_NOOP("bitcoin-core", "Importing..."), QT_TRANSLATE_NOOP("bitcoin-core", "Imports blocks from external blk000??.dat file"), QT_TRANSLATE_NOOP("bitcoin-core", "Incorrect or no genesis block found. Wrong datadir for network?"), QT_TRANSLATE_NOOP("bitcoin-core", "Information"), +QT_TRANSLATE_NOOP("bitcoin-core", "Initialization sanity check failed. Bitcoin Core is shutting down."), QT_TRANSLATE_NOOP("bitcoin-core", "Insufficient funds"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -onion address: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -proxy address: '%s'"), @@ -192,8 +205,8 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -minrelaytxfee=: ' QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -mintxfee=: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -paytxfee=: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount"), +QT_TRANSLATE_NOOP("bitcoin-core", "Keep at most unconnectable blocks in memory (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Limit size of signature cache to entries (default: 50000)"), -QT_TRANSLATE_NOOP("bitcoin-core", "List commands"), QT_TRANSLATE_NOOP("bitcoin-core", "Listen for connections on (default: 8333 or testnet: 18333)"), QT_TRANSLATE_NOOP("bitcoin-core", "Loading addresses..."), QT_TRANSLATE_NOOP("bitcoin-core", "Loading block index..."), @@ -203,6 +216,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Maintain a full transaction index (default: 0 QT_TRANSLATE_NOOP("bitcoin-core", "Maintain at most connections to peers (default: 125)"), QT_TRANSLATE_NOOP("bitcoin-core", "Maximum per-connection receive buffer, *1000 bytes (default: 5000)"), QT_TRANSLATE_NOOP("bitcoin-core", "Maximum per-connection send buffer, *1000 bytes (default: 1000)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Node relay options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Not enough file descriptors available."), QT_TRANSLATE_NOOP("bitcoin-core", "Only accept block chain matching built-in checkpoints (default: 1)"), QT_TRANSLATE_NOOP("bitcoin-core", "Only connect to nodes in network (IPv4, IPv6 or Tor)"), @@ -212,19 +226,16 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Prepend debug output with timestamp (default: QT_TRANSLATE_NOOP("bitcoin-core", "Print block on startup, if found in block index"), QT_TRANSLATE_NOOP("bitcoin-core", "Print block tree on startup (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions)"), -QT_TRANSLATE_NOOP("bitcoin-core", "RPC client options:"), QT_TRANSLATE_NOOP("bitcoin-core", "RPC server options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Randomly drop 1 of every network messages"), QT_TRANSLATE_NOOP("bitcoin-core", "Randomly fuzz 1 of every network messages"), QT_TRANSLATE_NOOP("bitcoin-core", "Rebuild block chain index from current blk000??.dat files"), +QT_TRANSLATE_NOOP("bitcoin-core", "Relay and mine data carrier transactions (default: 1)"), QT_TRANSLATE_NOOP("bitcoin-core", "Rescan the block chain for missing wallet transactions"), QT_TRANSLATE_NOOP("bitcoin-core", "Rescanning..."), QT_TRANSLATE_NOOP("bitcoin-core", "Run a thread to flush wallet periodically (default: 1)"), QT_TRANSLATE_NOOP("bitcoin-core", "Run in the background as a daemon and accept commands"), -QT_TRANSLATE_NOOP("bitcoin-core", "SSL options: (see the Bitcoin Wiki for SSL setup instructions)"), QT_TRANSLATE_NOOP("bitcoin-core", "Select SOCKS version for -proxy (4 or 5, default: 5)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Send command to Bitcoin Core"), -QT_TRANSLATE_NOOP("bitcoin-core", "Send commands to node running on (default: 127.0.0.1)"), QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to console instead of debug.log file"), QT_TRANSLATE_NOOP("bitcoin-core", "Server certificate file (default: server.cert)"), QT_TRANSLATE_NOOP("bitcoin-core", "Server private key (default: server.pem)"), @@ -245,21 +256,20 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Specify pid file (default: bitcoind.pid)"), QT_TRANSLATE_NOOP("bitcoin-core", "Specify wallet file (within data directory)"), QT_TRANSLATE_NOOP("bitcoin-core", "Specify your own public address"), QT_TRANSLATE_NOOP("bitcoin-core", "Spend unconfirmed change when sending transactions (default: 1)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Start Bitcoin Core Daemon"), +QT_TRANSLATE_NOOP("bitcoin-core", "Stop running after importing blocks from disk (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "System error: "), QT_TRANSLATE_NOOP("bitcoin-core", "This help message"), +QT_TRANSLATE_NOOP("bitcoin-core", "This is experimental software."), QT_TRANSLATE_NOOP("bitcoin-core", "This is intended for regression testing tools and app development."), QT_TRANSLATE_NOOP("bitcoin-core", "Threshold for disconnecting misbehaving peers (default: 100)"), QT_TRANSLATE_NOOP("bitcoin-core", "To use the %s option"), QT_TRANSLATE_NOOP("bitcoin-core", "Transaction amount too small"), QT_TRANSLATE_NOOP("bitcoin-core", "Transaction amounts must be positive"), QT_TRANSLATE_NOOP("bitcoin-core", "Transaction too large"), -QT_TRANSLATE_NOOP("bitcoin-core", "Unable to bind to %s on this computer (bind returned error %d, %s)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Unable to bind to %s on this computer (bind returned error %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "Unknown -socks proxy version requested: %i"), QT_TRANSLATE_NOOP("bitcoin-core", "Unknown network specified in -onlynet: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Upgrade wallet to latest format"), -QT_TRANSLATE_NOOP("bitcoin-core", "Usage (deprecated, use bitcoin-cli):"), -QT_TRANSLATE_NOOP("bitcoin-core", "Usage:"), QT_TRANSLATE_NOOP("bitcoin-core", "Use OpenSSL (https) for JSON-RPC connections"), QT_TRANSLATE_NOOP("bitcoin-core", "Use UPnP to map the listening port (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "Use UPnP to map the listening port (default: 1 when listening)"), @@ -267,7 +277,6 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Use the test network"), QT_TRANSLATE_NOOP("bitcoin-core", "Username for JSON-RPC connections"), QT_TRANSLATE_NOOP("bitcoin-core", "Verifying blocks..."), QT_TRANSLATE_NOOP("bitcoin-core", "Verifying wallet..."), -QT_TRANSLATE_NOOP("bitcoin-core", "Wait for RPC server to start"), QT_TRANSLATE_NOOP("bitcoin-core", "Wallet %s resides outside data directory %s"), QT_TRANSLATE_NOOP("bitcoin-core", "Wallet needed to be rewritten: restart Bitcoin to complete"), QT_TRANSLATE_NOOP("bitcoin-core", "Wallet options:"), @@ -277,6 +286,5 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Warning: This version is obsolete, upgrade re QT_TRANSLATE_NOOP("bitcoin-core", "You need to rebuild the database using -reindex to change -txindex"), QT_TRANSLATE_NOOP("bitcoin-core", "Zapping all transactions from wallet..."), QT_TRANSLATE_NOOP("bitcoin-core", "on startup"), -QT_TRANSLATE_NOOP("bitcoin-core", "version"), QT_TRANSLATE_NOOP("bitcoin-core", "wallet.dat corrupt, salvage failed"), }; From 73ac7abd08a70adf22e24d0f5f7631e7f8b7c5bb Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 3 Jul 2014 07:45:16 +0200 Subject: [PATCH 0334/1288] Move ui_interface to bitcoin_server.a There is no need for it in the utility libraries or tools. Put it in init.cpp, and in the tests separately (as they can't link init). --- src/bitcoin-cli.cpp | 3 ++- src/init.cpp | 1 + src/qt/bitcoinstrings.cpp | 5 +++++ src/test/test_bitcoin.cpp | 2 +- src/util.cpp | 2 -- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index db39df4b17..016b2f50f5 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -7,11 +7,12 @@ #include "init.h" #include "rpcclient.h" #include "rpcprotocol.h" -#include "ui_interface.h" /* for _(...) */ #include "chainparamsbase.h" #include +#define _(x) std::string(x) /* Keep the _() around in case gettext or such will be used later to translate non-UI */ + using namespace std; using namespace boost; using namespace boost::asio; diff --git a/src/init.cpp b/src/init.cpp index c514facbbe..dcb71c4206 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -62,6 +62,7 @@ enum BindFlags { }; static const char* FEE_ESTIMATES_FILENAME="fee_estimates.dat"; +CClientUIInterface uiInterface; ////////////////////////////////////////////////////////////////////////////// // diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index b717546708..e852c468a8 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -89,6 +89,9 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" QT_TRANSLATE_NOOP("bitcoin-core", "" "How thorough the block verification of -checkblocks is (0-4, default: 3)"), QT_TRANSLATE_NOOP("bitcoin-core", "" +"If paytxfee is not set, include enough fee so transactions are confirmed on " +"average within n blocks (default: 1)"), +QT_TRANSLATE_NOOP("bitcoin-core", "" "In this mode -genproclimit controls how many blocks are generated " "immediately."), QT_TRANSLATE_NOOP("bitcoin-core", "" @@ -195,6 +198,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "How many blocks to check at startup (default: QT_TRANSLATE_NOOP("bitcoin-core", "If is not supplied, output all debugging information."), QT_TRANSLATE_NOOP("bitcoin-core", "Importing..."), QT_TRANSLATE_NOOP("bitcoin-core", "Imports blocks from external blk000??.dat file"), +QT_TRANSLATE_NOOP("bitcoin-core", "Include IP addresses in debug output (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "Incorrect or no genesis block found. Wrong datadir for network?"), QT_TRANSLATE_NOOP("bitcoin-core", "Information"), QT_TRANSLATE_NOOP("bitcoin-core", "Initialization sanity check failed. Bitcoin Core is shutting down."), @@ -203,6 +207,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -onion address: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -proxy address: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -minrelaytxfee=: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -mintxfee=: '%s'"), +QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -paytxfee=: '%s' (must be at least %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -paytxfee=: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount"), QT_TRANSLATE_NOOP("bitcoin-core", "Keep at most unconnectable blocks in memory (default: %u)"), diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 8cae0a4c34..bcd2f75f55 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -18,7 +18,7 @@ #include #include - +CClientUIInterface uiInterface; CWallet* pwalletMain; extern bool fPrintToConsole; diff --git a/src/util.cpp b/src/util.cpp index 081484c37d..9adbbdec48 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -7,7 +7,6 @@ #include "chainparamsbase.h" #include "sync.h" -#include "ui_interface.h" #include "uint256.h" #include "version.h" @@ -97,7 +96,6 @@ string strMiscWarning; bool fLogTimestamps = false; bool fLogIPs = false; volatile bool fReopenDebugLog = false; -CClientUIInterface uiInterface; // Init OpenSSL library multithreading support static CCriticalSection** ppmutexOpenSSL; From 209377a7cb5a9ea5d724faf94846ee5bacd289e7 Mon Sep 17 00:00:00 2001 From: jtimon Date: Sat, 28 Jun 2014 23:36:06 +0200 Subject: [PATCH 0335/1288] Use GetBlockTime() more --- src/checkpoints.cpp | 2 +- src/main.cpp | 8 ++++---- src/pow.cpp | 2 +- src/qt/clientmodel.cpp | 2 +- src/rpcdump.cpp | 6 +++--- src/rpcmining.cpp | 2 +- src/rpcrawtransaction.cpp | 4 ++-- src/rpcwallet.cpp | 2 +- src/wallet.cpp | 10 +++++----- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index 80479b47fb..4cab11db3d 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -127,7 +127,7 @@ namespace Checkpoints { } else { double nCheapBefore = data.nTransactionsLastCheckpoint; double nExpensiveBefore = pindex->nChainTx - data.nTransactionsLastCheckpoint; - double nExpensiveAfter = (nNow - pindex->nTime)/86400.0*data.fTransactionsPerDay; + double nExpensiveAfter = (nNow - pindex->GetBlockTime())/86400.0*data.fTransactionsPerDay; fWorkBefore = nCheapBefore + nExpensiveBefore*fSigcheckVerificationFactor; fWorkAfter = nExpensiveAfter*fSigcheckVerificationFactor; } diff --git a/src/main.cpp b/src/main.cpp index e08b794184..4bc6e8e38d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1788,7 +1788,7 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C // BIP16 didn't become active until Apr 1 2012 int64_t nBIP16SwitchTime = 1333238400; - bool fStrictPayToScriptHash = (pindex->nTime >= nBIP16SwitchTime); + bool fStrictPayToScriptHash = (pindex->GetBlockTime() >= nBIP16SwitchTime); unsigned int flags = SCRIPT_VERIFY_NOCACHE | (fStrictPayToScriptHash ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE); @@ -2437,7 +2437,7 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex if (pcheckpoint && block.hashPrevBlock != (chainActive.Tip() ? chainActive.Tip()->GetBlockHash() : uint256(0))) { // Extra checks to prevent "fill up memory by spamming with bogus blocks" - int64_t deltaTime = block.GetBlockTime() - pcheckpoint->nTime; + int64_t deltaTime = block.GetBlockTime() - pcheckpoint->GetBlockTime(); if (deltaTime < 0) { return state.DoS(100, error("CheckBlockHeader() : block with timestamp before last checkpoint"), @@ -2548,7 +2548,7 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex, CDiskBlockPos blockPos; if (dbp != NULL) blockPos = *dbp; - if (!FindBlockPos(state, blockPos, nBlockSize+8, nHeight, block.nTime, dbp != NULL)) + if (!FindBlockPos(state, blockPos, nBlockSize+8, nHeight, block.GetBlockTime(), dbp != NULL)) return error("AcceptBlock() : FindBlockPos failed"); if (dbp == NULL) if (!WriteBlockToDisk(block, blockPos)) @@ -3146,7 +3146,7 @@ bool InitBlockIndex() { unsigned int nBlockSize = ::GetSerializeSize(block, SER_DISK, CLIENT_VERSION); CDiskBlockPos blockPos; CValidationState state; - if (!FindBlockPos(state, blockPos, nBlockSize+8, 0, block.nTime)) + if (!FindBlockPos(state, blockPos, nBlockSize+8, 0, block.GetBlockTime())) return error("LoadBlockIndex() : FindBlockPos failed"); if (!WriteBlockToDisk(block, blockPos)) return error("LoadBlockIndex() : writing genesis block to disk failed"); diff --git a/src/pow.cpp b/src/pow.cpp index 952250decd..c0d0a7ca20 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -26,7 +26,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead // Special difficulty rule for testnet: // If the new block's timestamp is more than 2* 10 minutes // then allow mining of a min-difficulty block. - if (pblock->nTime > pindexLast->nTime + Params().TargetSpacing()*2) + if (pblock->GetBlockTime() > pindexLast->GetBlockTime() + Params().TargetSpacing()*2) return nProofOfWorkLimit; else { diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 9c9565be67..4c21eb5594 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -85,7 +85,7 @@ QDateTime ClientModel::getLastBlockDate() const if (chainActive.Tip()) return QDateTime::fromTime_t(chainActive.Tip()->GetBlockTime()); else - return QDateTime::fromTime_t(Params().GenesisBlock().nTime); // Genesis block's time of current network + return QDateTime::fromTime_t(Params().GenesisBlock().GetBlockTime()); // Genesis block's time of current network } double ClientModel::getVerificationProgress() const diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index 593e0d2b6b..d20bfcf095 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -157,7 +157,7 @@ Value importwallet(const Array& params, bool fHelp) if (!file.is_open()) throw JSONRPCError(RPC_INVALID_PARAMETER, "Cannot open wallet dump file"); - int64_t nTimeBegin = chainActive.Tip()->nTime; + int64_t nTimeBegin = chainActive.Tip()->GetBlockTime(); bool fGood = true; @@ -215,7 +215,7 @@ Value importwallet(const Array& params, bool fHelp) pwalletMain->ShowProgress("", 100); // hide progress dialog in GUI CBlockIndex *pindex = chainActive.Tip(); - while (pindex && pindex->pprev && pindex->nTime > nTimeBegin - 7200) + while (pindex && pindex->pprev && pindex->GetBlockTime() > nTimeBegin - 7200) pindex = pindex->pprev; if (!pwalletMain->nTimeFirstKey || nTimeBegin < pwalletMain->nTimeFirstKey) @@ -301,7 +301,7 @@ Value dumpwallet(const Array& params, bool fHelp) file << strprintf("# Wallet dump created by Bitcoin %s (%s)\n", CLIENT_BUILD, CLIENT_DATE); file << strprintf("# * Created on %s\n", EncodeDumpTime(GetTime())); file << strprintf("# * Best block at time of backup was %i (%s),\n", chainActive.Height(), chainActive.Tip()->GetBlockHash().ToString()); - file << strprintf("# mined on %s\n", EncodeDumpTime(chainActive.Tip()->nTime)); + file << strprintf("# mined on %s\n", EncodeDumpTime(chainActive.Tip()->GetBlockTime())); file << "\n"; for (std::vector >::const_iterator it = vKeyBirth.begin(); it != vKeyBirth.end(); it++) { const CKeyID &keyid = it->second; diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index db60ef3592..c7621dc137 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -442,7 +442,7 @@ Value getblocktemplate(const Array& params, bool fHelp) result.push_back(Pair("noncerange", "00000000ffffffff")); result.push_back(Pair("sigoplimit", (int64_t)MAX_BLOCK_SIGOPS)); result.push_back(Pair("sizelimit", (int64_t)MAX_BLOCK_SIZE)); - result.push_back(Pair("curtime", (int64_t)pblock->nTime)); + result.push_back(Pair("curtime", pblock->GetBlockTime())); result.push_back(Pair("bits", strprintf("%08x", pblock->nBits))); result.push_back(Pair("height", (int64_t)(pindexPrev->nHeight+1))); diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 9771f8e685..45a227d1dc 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -99,8 +99,8 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry) if (chainActive.Contains(pindex)) { entry.push_back(Pair("confirmations", 1 + chainActive.Height() - pindex->nHeight)); - entry.push_back(Pair("time", (int64_t)pindex->nTime)); - entry.push_back(Pair("blocktime", (int64_t)pindex->nTime)); + entry.push_back(Pair("time", pindex->GetBlockTime())); + entry.push_back(Pair("blocktime", pindex->GetBlockTime())); } else entry.push_back(Pair("confirmations", 0)); diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 38e96133b4..6fd46fdcc5 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -50,7 +50,7 @@ void WalletTxToJSON(const CWalletTx& wtx, Object& entry) { entry.push_back(Pair("blockhash", wtx.hashBlock.GetHex())); entry.push_back(Pair("blockindex", wtx.nIndex)); - entry.push_back(Pair("blocktime", (int64_t)(mapBlockIndex[wtx.hashBlock]->nTime))); + entry.push_back(Pair("blocktime", mapBlockIndex[wtx.hashBlock]->GetBlockTime())); } uint256 hash = wtx.GetHash(); entry.push_back(Pair("txid", hash.GetHex())); diff --git a/src/wallet.cpp b/src/wallet.cpp index 318a1388d2..14235f310b 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -515,8 +515,8 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet) { if (mapBlockIndex.count(wtxIn.hashBlock)) { - unsigned int latestNow = wtx.nTimeReceived; - unsigned int latestEntry = 0; + int64_t latestNow = wtx.nTimeReceived; + int64_t latestEntry = 0; { // Tolerate times up to the last timestamp in the wallet not more than 5 minutes into the future int64_t latestTolerated = latestNow + 300; @@ -547,7 +547,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet) } } - unsigned int& blocktime = mapBlockIndex[wtxIn.hashBlock]->nTime; + int64_t blocktime = mapBlockIndex[wtxIn.hashBlock]->GetBlockTime(); wtx.nTimeSmart = std::max(latestEntry, std::min(blocktime, latestNow)); } else @@ -889,7 +889,7 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate) // no need to read and scan block, if block was created before // our wallet birthday (as adjusted for block time variability) - while (pindex && nTimeFirstKey && (pindex->nTime < (nTimeFirstKey - 7200))) + while (pindex && nTimeFirstKey && (pindex->GetBlockTime() < (nTimeFirstKey - 7200))) pindex = chainActive.Next(pindex); ShowProgress(_("Rescanning..."), 0); // show rescan progress in GUI as dialog or on splashscreen, if -rescan on startup @@ -2092,7 +2092,7 @@ void CWallet::GetKeyBirthTimes(std::map &mapKeyBirth) const { // Extract block timestamps for those keys for (std::map::const_iterator it = mapKeyFirstBlock.begin(); it != mapKeyFirstBlock.end(); it++) - mapKeyBirth[it->first] = it->second->nTime - 7200; // block times can be 2h off + mapKeyBirth[it->first] = it->second->GetBlockTime() - 7200; // block times can be 2h off } bool CWallet::AddDestData(const CTxDestination &dest, const std::string &key, const std::string &value) From 18c7ba8d999a9e6adf16b0a71f05acce66e9ae15 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Mon, 7 Jul 2014 16:32:38 +0800 Subject: [PATCH 0336/1288] Add translation mailing list to README.md Link to the new translation mailing list from README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7c2fe12f3a..081af80dcf 100644 --- a/README.md +++ b/README.md @@ -76,12 +76,14 @@ Translations Changes to translations as well as new translations can be submitted to [Bitcoin Core's Transifex page](https://www.transifex.com/projects/p/bitcoin/). -Periodically the translations are pulled from Transifex and merged into the git repository. See the +Translations are periodically pulled from Transifex and merged into the git repository. See the [translation process](doc/translation_process.md) for details on how this works. -**Important**: We do not accept translation changes as github pull request because the next +**Important**: We do not accept translation changes as GitHub pull requests because the next pull from Transifex would automatically overwrite them again. +Translators should also subscribe to the [mailing list](https://groups.google.com/forum/#!forum/bitcoin-translators). + Development tips and tricks --------------------------- From afe380ef0f1c70185fc7c50e1a75e589ff3382dd Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 7 Jul 2014 10:44:30 +0200 Subject: [PATCH 0337/1288] Fix the build for windows Problem introduced in caf6150. Thanks to @drak for noticing. Fixes #4473. --- src/netbase.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/netbase.cpp b/src/netbase.cpp index 2567c4c780..175406322a 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -7,10 +7,6 @@ #include "bitcoin-config.h" #endif -#ifdef HAVE_INET_PTON -#include -#endif - #ifdef HAVE_GETADDRINFO_A #include #endif @@ -23,6 +19,9 @@ #include "util.h" #ifndef WIN32 +#if HAVE_INET_PTON +#include +#endif #include #endif From 109849e204f91d8b04b0e57da87e45b461096b50 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Mon, 7 Jul 2014 15:34:00 +0000 Subject: [PATCH 0338/1288] Bugfix: strerror_r can return an error, and if it does, POSIX does not specify the content of the buffer --- src/netbase.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/netbase.cpp b/src/netbase.cpp index e24a0a195c..40ae89957a 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -1265,7 +1265,8 @@ std::string NetworkErrorString(int err) #ifdef STRERROR_R_CHAR_P /* GNU variant can return a pointer outside the passed buffer */ s = strerror_r(err, buf, sizeof(buf)); #else /* POSIX variant always returns message in buffer */ - (void) strerror_r(err, buf, sizeof(buf)); + if (strerror_r(err, buf, sizeof(buf))) + buf[0] = 0; #endif return strprintf("%s (%d)", s, err); } From 2227725fcb68cf70bc3b33e68d4288df6c4a219a Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Mon, 7 Jul 2014 15:42:59 +0000 Subject: [PATCH 0339/1288] test/bloom_tests: Use UL suffix for unsigned long number to ensure compatibility --- src/test/bloom_tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/bloom_tests.cpp b/src/test/bloom_tests.cpp index 5c6c7d8588..2cdafa4bdd 100644 --- a/src/test/bloom_tests.cpp +++ b/src/test/bloom_tests.cpp @@ -54,7 +54,7 @@ BOOST_AUTO_TEST_CASE(bloom_create_insert_serialize) BOOST_AUTO_TEST_CASE(bloom_create_insert_serialize_with_tweak) { // Same test as bloom_create_insert_serialize, but we add a nTweak of 100 - CBloomFilter filter(3, 0.01, 2147483649, BLOOM_UPDATE_ALL); + CBloomFilter filter(3, 0.01, 2147483649UL, BLOOM_UPDATE_ALL); filter.insert(ParseHex("99108ad8ed9bb6274d3980bab5a85c048f0950c8")); BOOST_CHECK_MESSAGE( filter.contains(ParseHex("99108ad8ed9bb6274d3980bab5a85c048f0950c8")), "BloomFilter doesn't contain just-inserted object!"); From 2e4fee2ac4824570c1340a8f8fe2aed4580de879 Mon Sep 17 00:00:00 2001 From: Roy Badami Date: Mon, 7 Jul 2014 21:00:58 +0100 Subject: [PATCH 0340/1288] Show bitcoin quantities with full precision, even in the presence of trailing zeros --- src/qt/bitcoinunits.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp index 1b5eaa2dc5..cf635e1941 100644 --- a/src/qt/bitcoinunits.cpp +++ b/src/qt/bitcoinunits.cpp @@ -114,14 +114,6 @@ QString BitcoinUnits::format(int unit, qint64 n, bool fPlus, SeparatorStyle sepa QString quotient_str = QString::number(quotient); QString remainder_str = QString::number(remainder).rightJustified(num_decimals, '0'); - // Right-trim excess zeros after the decimal point - int nTrim = 0; - for (int i = remainder_str.size()-1; i>=2 && (remainder_str.at(i) == '0'); --i) - ++nTrim; - remainder_str.chop(nTrim); - if (fAlign) - remainder_str.append(QString(QChar(FIGURE_SP_CP)).repeated(nTrim)); - // Use SI-stule separators as these are locale indendent and can't be // confused with the decimal marker. Rule is to use a thin space every // three digits on *both* sides of the decimal point - but only if there From f7d70c603f3b2a664082e0829b92844233c46cb4 Mon Sep 17 00:00:00 2001 From: Roy Badami Date: Mon, 7 Jul 2014 22:27:09 +0100 Subject: [PATCH 0341/1288] Remove unused fAlign argument from BitcoinUnits::format and friends --- src/qt/bitcoinunits.cpp | 7 ++++--- src/qt/bitcoinunits.h | 4 ++-- src/qt/overviewpage.cpp | 18 +++++++++--------- src/qt/transactiontablemodel.cpp | 6 +++--- src/qt/transactiontablemodel.h | 2 +- 5 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp index 089abd862c..64751c1783 100644 --- a/src/qt/bitcoinunits.cpp +++ b/src/qt/bitcoinunits.cpp @@ -111,7 +111,7 @@ int BitcoinUnits::decimals(int unit) } } -QString BitcoinUnits::format(int unit, qint64 n, bool fPlus, SeparatorStyle separators, bool fAlign) +QString BitcoinUnits::format(int unit, qint64 n, bool fPlus, SeparatorStyle separators) { // Note: not using straight sprintf here because we do NOT want // localized number formatting. @@ -147,9 +147,10 @@ QString BitcoinUnits::format(int unit, qint64 n, bool fPlus, SeparatorStyle sepa return quotient_str + QString(".") + remainder_str; } -QString BitcoinUnits::formatWithUnit(int unit, qint64 amount, bool plussign, SeparatorStyle separators, bool fAlign) + +QString BitcoinUnits::formatWithUnit(int unit, qint64 amount, bool plussign, SeparatorStyle separators) { - return format(unit, amount, plussign, separators, fAlign) + QString(" ") + name(unit); + return format(unit, amount, plussign, separators) + QString(" ") + name(unit); } QString BitcoinUnits::formatHtmlWithUnit(int unit, qint64 amount, bool plussign, SeparatorStyle separators) diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h index f8c679711f..7fa24c8542 100644 --- a/src/qt/bitcoinunits.h +++ b/src/qt/bitcoinunits.h @@ -89,9 +89,9 @@ public: //! Number of decimals left static int decimals(int unit); //! Format as string - static QString format(int unit, qint64 amount, bool plussign=false, SeparatorStyle separators=separatorStandard, bool fAlign=false); + static QString format(int unit, qint64 amount, bool plussign=false, SeparatorStyle separators=separatorStandard); //! Format as string (with unit) - static QString formatWithUnit(int unit, qint64 amount, bool plussign=false, SeparatorStyle separators=separatorStandard, bool fAlign=false); + static QString formatWithUnit(int unit, qint64 amount, bool plussign=false, SeparatorStyle separators=separatorStandard); static QString formatHtmlWithUnit(int unit, qint64 amount, bool plussign=false, SeparatorStyle separators=separatorStandard); //! Parse string to coin amount static bool parse(int unit, const QString &value, qint64 *val_out); diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index f51b0311bc..1c700b37ff 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -72,7 +72,7 @@ public: foreground = option.palette.color(QPalette::Text); } painter->setPen(foreground); - QString amountText = BitcoinUnits::formatWithUnit(unit, amount, true, BitcoinUnits::separatorAlways, true); + QString amountText = BitcoinUnits::formatWithUnit(unit, amount, true, BitcoinUnits::separatorAlways); if(!confirmed) { amountText = QString("[") + amountText + QString("]"); @@ -147,14 +147,14 @@ void OverviewPage::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 currentWatchOnlyBalance = watchOnlyBalance; currentWatchUnconfBalance = watchUnconfBalance; currentWatchImmatureBalance = watchImmatureBalance; - ui->labelBalance->setText(BitcoinUnits::formatWithUnit(unit, balance, false, BitcoinUnits::separatorAlways, true)); - ui->labelUnconfirmed->setText(BitcoinUnits::formatWithUnit(unit, unconfirmedBalance, false, BitcoinUnits::separatorAlways, true)); - ui->labelImmature->setText(BitcoinUnits::formatWithUnit(unit, immatureBalance, false, BitcoinUnits::separatorAlways, true)); - ui->labelTotal->setText(BitcoinUnits::formatWithUnit(unit, balance + unconfirmedBalance + immatureBalance, false, BitcoinUnits::separatorAlways, true)); - ui->labelWatchAvailable->setText(BitcoinUnits::formatWithUnit(unit, watchOnlyBalance, false, BitcoinUnits::separatorAlways, true)); - ui->labelWatchPending->setText(BitcoinUnits::formatWithUnit(unit, watchUnconfBalance, false, BitcoinUnits::separatorAlways, true)); - ui->labelWatchImmature->setText(BitcoinUnits::formatWithUnit(unit, watchImmatureBalance, false, BitcoinUnits::separatorAlways, true)); - ui->labelWatchTotal->setText(BitcoinUnits::formatWithUnit(unit, watchOnlyBalance + watchUnconfBalance + watchImmatureBalance, false, BitcoinUnits::separatorAlways, true)); + ui->labelBalance->setText(BitcoinUnits::formatWithUnit(unit, balance, false, BitcoinUnits::separatorAlways)); + ui->labelUnconfirmed->setText(BitcoinUnits::formatWithUnit(unit, unconfirmedBalance, false, BitcoinUnits::separatorAlways)); + ui->labelImmature->setText(BitcoinUnits::formatWithUnit(unit, immatureBalance, false, BitcoinUnits::separatorAlways)); + ui->labelTotal->setText(BitcoinUnits::formatWithUnit(unit, balance + unconfirmedBalance + immatureBalance, false, BitcoinUnits::separatorAlways)); + ui->labelWatchAvailable->setText(BitcoinUnits::formatWithUnit(unit, watchOnlyBalance, false, BitcoinUnits::separatorAlways)); + ui->labelWatchPending->setText(BitcoinUnits::formatWithUnit(unit, watchUnconfBalance, false, BitcoinUnits::separatorAlways)); + ui->labelWatchImmature->setText(BitcoinUnits::formatWithUnit(unit, watchImmatureBalance, false, BitcoinUnits::separatorAlways)); + ui->labelWatchTotal->setText(BitcoinUnits::formatWithUnit(unit, watchOnlyBalance + watchUnconfBalance + watchImmatureBalance, false, BitcoinUnits::separatorAlways)); // only show immature (newly mined) balance if it's non-zero, so as not to complicate things // for the non-mining users diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index fb21ddc46d..cf4c90c7ff 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -435,9 +435,9 @@ QVariant TransactionTableModel::addressColor(const TransactionRecord *wtx) const return QVariant(); } -QString TransactionTableModel::formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed, BitcoinUnits::SeparatorStyle separators, bool fAlign) const +QString TransactionTableModel::formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed, BitcoinUnits::SeparatorStyle separators) const { - QString str = BitcoinUnits::format(walletModel->getOptionsModel()->getDisplayUnit(), wtx->credit + wtx->debit, false, separators, fAlign); + QString str = BitcoinUnits::format(walletModel->getOptionsModel()->getDisplayUnit(), wtx->credit + wtx->debit, false, separators); if(showUnconfirmed) { if(!wtx->status.countsForBalance) @@ -522,7 +522,7 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const case ToAddress: return formatTxToAddress(rec, false); case Amount: - return formatTxAmount(rec, true, BitcoinUnits::separatorAlways, true); + return formatTxAmount(rec, true, BitcoinUnits::separatorAlways); } break; case Qt::EditRole: diff --git a/src/qt/transactiontablemodel.h b/src/qt/transactiontablemodel.h index 463e7bbff0..ad88d14a90 100644 --- a/src/qt/transactiontablemodel.h +++ b/src/qt/transactiontablemodel.h @@ -80,7 +80,7 @@ private: QString formatTxDate(const TransactionRecord *wtx) const; QString formatTxType(const TransactionRecord *wtx) const; QString formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const; - QString formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed=true, BitcoinUnits::SeparatorStyle separators=BitcoinUnits::separatorStandard, bool fAlign=false) const; + QString formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed=true, BitcoinUnits::SeparatorStyle separators=BitcoinUnits::separatorStandard) const; QString formatTooltip(const TransactionRecord *rec) const; QVariant txStatusDecoration(const TransactionRecord *wtx) const; QVariant txAddressDecoration(const TransactionRecord *wtx) const; From 7149499fd85d5adea23c9c3057944c3f2f69a2d2 Mon Sep 17 00:00:00 2001 From: Roy Badami Date: Mon, 7 Jul 2014 22:28:11 +0100 Subject: [PATCH 0342/1288] Add comments re BitcoinUnits::formatWithUnit/formatHtmlWithUnit --- src/qt/bitcoinunits.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp index 64751c1783..21aed235cf 100644 --- a/src/qt/bitcoinunits.cpp +++ b/src/qt/bitcoinunits.cpp @@ -148,6 +148,21 @@ QString BitcoinUnits::format(int unit, qint64 n, bool fPlus, SeparatorStyle sepa } +// TODO: Review all remaining calls to BitcoinUnits::formatWithUnit to +// TODO: determine whether the output is used in a plain text context +// TODO: or an HTML context (and replace with +// TODO: BtcoinUnits::formatHtmlWithUnit in the latter case). Hopefully +// TODO: there aren't instances where the result could be used in +// TODO: either context. + +// NOTE: Using formatWithUnit in an HTML context risks wrapping +// quantities at the thousands separator. More subtly, it also results +// in a standard space rather than a thin space, due to a bug in Qt's +// XML whitespace canonicalisation +// +// Please take care to use formatHtmlWithUnit instead, when +// appropriate. + QString BitcoinUnits::formatWithUnit(int unit, qint64 amount, bool plussign, SeparatorStyle separators) { return format(unit, amount, plussign, separators) + QString(" ") + name(unit); From d88af560111863c3e9c1ae855dcc287f04dffb02 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sat, 5 Jul 2014 07:30:06 +0200 Subject: [PATCH 0343/1288] Fee fixes --- src/core.cpp | 7 ++++++- src/init.cpp | 3 ++- src/qt/coincontroldialog.cpp | 22 +++++++++++++++------- src/wallet.cpp | 2 +- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index 47f3b2a015..b56994ecf3 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -82,7 +82,12 @@ CFeeRate::CFeeRate(int64_t nFeePaid, size_t nSize) int64_t CFeeRate::GetFee(size_t nSize) const { - return nSatoshisPerK*nSize / 1000; + int64_t nFee = nSatoshisPerK*nSize / 1000; + + if (nFee == 0 && nSatoshisPerK > 0) + nFee = nSatoshisPerK; + + return nFee; } std::string CFeeRate::ToString() const diff --git a/src/init.cpp b/src/init.cpp index 880ccaca1d..f9e568a207 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -253,7 +253,8 @@ std::string HelpMessage(HelpMessageMode mode) #ifdef ENABLE_WALLET strUsage += "\n" + _("Wallet options:") + "\n"; strUsage += " -disablewallet " + _("Do not load the wallet and disable wallet RPC calls") + "\n"; - strUsage += " -mintxfee= " + strprintf(_("Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s)"), FormatMoney(CWallet::minTxFee.GetFeePerK())) + "\n"; + if (GetBoolArg("-help-debug", false)) + strUsage += " -mintxfee= " + strprintf(_("Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s)"), FormatMoney(CWallet::minTxFee.GetFeePerK())) + "\n"; strUsage += " -paytxfee= " + strprintf(_("Fee (in BTC/kB) to add to transactions you send (default: %s)"), FormatMoney(payTxFee.GetFeePerK())) + "\n"; strUsage += " -rescan " + _("Rescan the block chain for missing wallet transactions") + " " + _("on startup") + "\n"; strUsage += " -respendnotify= " + _("Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID)") + "\n"; diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index c73cf416a8..b4ddda3eaa 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -419,6 +419,8 @@ QString CoinControlDialog::getPriorityLabel(const CTxMemPool& pool, double dPrio } // Note: if mempool hasn't accumulated enough history (estimatePriority // returns -1) we're conservative and classify as "lowest" + if (mempool.estimatePriority(nTxConfirmTarget) <= 0 && AllowFree(dPriority)) + return ">=" + tr("medium"); return tr("lowest"); } @@ -523,15 +525,21 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) dPriority = dPriorityInputs / (nBytes - nBytesInputs + (nQuantityUncompressed * 29)); // 29 = 180 - 151 (uncompressed public keys are over the limit. max 151 bytes of the input are ignored for priority) sPriorityLabel = CoinControlDialog::getPriorityLabel(mempool, dPriority); + // Voluntary Fee + nPayFee = payTxFee.GetFee(max((unsigned int)1000, nBytes)); + // Min Fee - nPayFee = CWallet::GetMinimumFee(nBytes, nTxConfirmTarget, mempool); + if (nPayFee == 0) + { + nPayFee = CWallet::GetMinimumFee(nBytes, nTxConfirmTarget, mempool); - double dPriorityNeeded = mempool.estimatePriority(nTxConfirmTarget); - if (dPriorityNeeded <= 0) // Not enough mempool history: never send free - dPriorityNeeded = std::numeric_limits::max(); + double dPriorityNeeded = mempool.estimatePriority(nTxConfirmTarget); + if (dPriorityNeeded <= 0 && !AllowFree(dPriority)) // not enough mempool history: never send free + dPriorityNeeded = std::numeric_limits::max(); - if (nBytes <= MAX_FREE_TRANSACTION_CREATE_SIZE && dPriority >= dPriorityNeeded) - nPayFee = 0; + if (nBytes <= MAX_FREE_TRANSACTION_CREATE_SIZE && dPriority >= dPriorityNeeded) + nPayFee = 0; + } if (nPayAmount > 0) { @@ -612,7 +620,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) QString toolTip3 = tr("This label turns red, if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, ::minRelayTxFee.GetFee(546))); // how many satoshis the estimated fee can vary per byte we guess wrong - double dFeeVary = (double)std::max(CWallet::minTxFee.GetFeePerK(), payTxFee.GetFeePerK()) / 1000; + double dFeeVary = (double)std::max(CWallet::minTxFee.GetFeePerK(), std::max(payTxFee.GetFeePerK(), mempool.estimateFee(nTxConfirmTarget).GetFeePerK())) / 1000; QString toolTip4 = tr("Can vary +/- %1 satoshi(s) per input.").arg(dFeeVary); l3->setToolTip(toolTip4); diff --git a/src/wallet.cpp b/src/wallet.cpp index ea99b89a5a..a54494f935 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1484,7 +1484,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, break; // Small enough, and priority high enough, to send for free - if (dPriority >= dPriorityNeeded) + if (dPriorityNeeded > 0 && dPriority >= dPriorityNeeded) break; // Include more fee and try again. From 45abeb2112f604eeebdb15f7e7f7640e8c970a39 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Tue, 8 Jul 2014 09:09:42 -0700 Subject: [PATCH 0344/1288] Update Debian packaging description for new bitcoin-cli --- contrib/debian/control | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/debian/control b/contrib/debian/control index a04e88d4e1..ac635f43e0 100644 --- a/contrib/debian/control +++ b/contrib/debian/control @@ -39,8 +39,9 @@ Description: peer-to-peer network based digital currency - daemon Full transaction history is stored locally at each client. This requires 20+ GB of space, slowly growing. . - This package provides bitcoind, a combined daemon and CLI tool to - interact with the daemon. + + This package provides the daemon, bitcoind, and the CLI tool + bitcoin-cli to interact with the daemon. Package: bitcoin-qt Architecture: any From 1b2bc71de158ae272933e74450836f43a1fe55fc Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Tue, 8 Jul 2014 14:31:13 -0400 Subject: [PATCH 0345/1288] Improved logging and Decimal support --- .../python-bitcoinrpc/bitcoinrpc/authproxy.py | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/authproxy.py b/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/authproxy.py index c2e5406c2f..bc7d655fdf 100644 --- a/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/authproxy.py +++ b/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/authproxy.py @@ -39,8 +39,9 @@ try: except ImportError: import httplib import base64 -import json import decimal +import json +import logging try: import urllib.parse as urlparse except ImportError: @@ -50,6 +51,7 @@ USER_AGENT = "AuthServiceProxy/0.1" HTTP_TIMEOUT = 30 +log = logging.getLogger("BitcoinRPC") class JSONRPCException(Exception): def __init__(self, rpc_error): @@ -57,7 +59,14 @@ class JSONRPCException(Exception): self.error = rpc_error +def EncodeDecimal(o): + if isinstance(o, decimal.Decimal): + return round(o, 8) + raise TypeError(repr(o) + " is not JSON serializable") + class AuthServiceProxy(object): + __id_count = 0 + def __init__(self, service_url, service_name=None, timeout=HTTP_TIMEOUT, connection=None): self.__service_url = service_url self.__service_name = service_name @@ -66,7 +75,6 @@ class AuthServiceProxy(object): port = 80 else: port = self.__url.port - self.__id_count = 0 (user, passwd) = (self.__url.username, self.__url.password) try: user = user.encode('utf8') @@ -99,12 +107,14 @@ class AuthServiceProxy(object): return AuthServiceProxy(self.__service_url, name, connection=self.__conn) def __call__(self, *args): - self.__id_count += 1 + AuthServiceProxy.__id_count += 1 + log.debug("-%s-> %s %s"%(AuthServiceProxy.__id_count, self.__service_name, + json.dumps(args, default=EncodeDecimal))) postdata = json.dumps({'version': '1.1', 'method': self.__service_name, 'params': args, - 'id': self.__id_count}) + 'id': AuthServiceProxy.__id_count}, default=EncodeDecimal) self.__conn.request('POST', self.__url.path, postdata, {'Host': self.__url.hostname, 'User-Agent': USER_AGENT, @@ -121,7 +131,8 @@ class AuthServiceProxy(object): return response['result'] def _batch(self, rpc_call_list): - postdata = json.dumps(list(rpc_call_list)) + postdata = json.dumps(list(rpc_call_list), default=EncodeDecimal) + log.debug("--> "+postdata) self.__conn.request('POST', self.__url.path, postdata, {'Host': self.__url.hostname, 'User-Agent': USER_AGENT, @@ -136,5 +147,10 @@ class AuthServiceProxy(object): raise JSONRPCException({ 'code': -342, 'message': 'missing HTTP response from server'}) - return json.loads(http_response.read().decode('utf8'), - parse_float=decimal.Decimal) + responsedata = http_response.read().decode('utf8') + response = json.loads(responsedata, parse_float=decimal.Decimal) + if "error" in response and response["error"] is None: + log.debug("<-%s- %s"%(response["id"], json.dumps(response["result"], default=EncodeDecimal))) + else: + log.debug("<-- "+responsedata) + return response From 9a427da116b9bf9b49e17590173b2848f4dbedf5 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 8 Jul 2014 15:52:27 -0400 Subject: [PATCH 0346/1288] build: re-add AM_LDFLAGS where it's overridden using _LDFLAGS replaces AM_LDFLAGS rather than adding to it. --- src/Makefile.qt.include | 2 +- src/Makefile.qttest.include | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index d97c2d064a..75b7b683dd 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -363,7 +363,7 @@ qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) if USE_LIBSECP256K1 qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la endif -qt_bitcoin_qt_LDFLAGS = $(QT_LDFLAGS) +qt_bitcoin_qt_LDFLAGS = $(AM_LDFLAGS) $(QT_LDFLAGS) #locale/foo.ts -> locale/foo.qm QT_QM=$(QT_TS:.ts=.qm) diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 7e10ce5a96..51ce006fc1 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -36,7 +36,7 @@ qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBIT if USE_LIBSECP256K1 qt_test_test_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la endif -qt_test_test_bitcoin_qt_LDFLAGS = $(QT_LDFLAGS) +qt_test_test_bitcoin_qt_LDFLAGS = $(AM_LDFLAGS) $(QT_LDFLAGS) CLEAN_BITCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno From 575e70c0c6c14058e4fc6c37f4e4d52399b69432 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 8 Jul 2014 15:53:53 -0400 Subject: [PATCH 0347/1288] build: fix win32 static linking after libtool merge Libtool eats the -static flag rather than passing it along to the compiler. To get the same effect, -all-static is used instead. --- configure.ac | 6 +++++- src/Makefile.am | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index dcaec0d4b0..d3500b4d93 100644 --- a/configure.ac +++ b/configure.ac @@ -193,10 +193,13 @@ case $host in AC_CHECK_LIB([iphlpapi], [main],, AC_MSG_ERROR(lib missing)) AC_CHECK_LIB([crypt32], [main],, AC_MSG_ERROR(lib missing)) - AX_CHECK_LINK_FLAG([[-static]],[LDFLAGS="$LDFLAGS -static"]) AX_CHECK_LINK_FLAG([[-static-libgcc]],[LDFLAGS="$LDFLAGS -static-libgcc"]) AX_CHECK_LINK_FLAG([[-static-libstdc++]],[LDFLAGS="$LDFLAGS -static-libstdc++"]) + # -static is interpreted by libtool, where it has a different meaning. + # In libtool-speak, it's -all-static. + AX_CHECK_LINK_FLAG([[-static]],[LDFLAGS="$LDFLAGS -static"; LIBTOOL_LDFLAGS="$LIBTOOL_LDFLAGS -all-static"]) + AC_PATH_PROG([MAKENSIS], [makensis], none) if test x$MAKENSIS = xnone; then AC_MSG_WARN("makensis not found. Cannot create installer.") @@ -698,6 +701,7 @@ AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE) AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR) +AC_SUBST(LIBTOOL_LDFLAGS) AC_SUBST(USE_UPNP) AC_SUBST(USE_QRCODE) AC_SUBST(INCLUDES) diff --git a/src/Makefile.am b/src/Makefile.am index e2a62c9699..9b0b97b7ac 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = $(INCLUDES) -AM_LDFLAGS = $(PTHREAD_CFLAGS) +AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) if USE_LIBSECP256K1 secp256k1/libsecp256k1.la: $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*) From 509f926e80b3d24a6b6c6fbf535e4d4b97156a3c Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Mon, 2 Jun 2014 22:05:35 +0100 Subject: [PATCH 0348/1288] Payment request parsing on startup now only changes network if a valid network name is specified. --- src/qt/paymentserver.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 5471625a67..7c0c95c459 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -214,9 +214,13 @@ bool PaymentServer::ipcParseCommandLine(int argc, char* argv[]) if (readPaymentRequest(arg, request)) { if (request.getDetails().network() == "main") + { SelectParams(CBaseChainParams::MAIN); - else + } + else if (request.getDetails().network() == "test") + { SelectParams(CBaseChainParams::TESTNET); + } } } else From 00d1980b8fb8b834cb729b213834dfb38cb01bbf Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 27 Jun 2014 14:41:11 +0200 Subject: [PATCH 0349/1288] init.cpp: log fee estimates filename on error - small changes to Shutdown(), buffer __func__, which is now used in all LogPrintf() calls and format for better readability - order using namespace alpabetically --- src/init.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index f9e568a207..a1d75c9674 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -38,8 +38,8 @@ #include #include -using namespace std; using namespace boost; +using namespace std; #ifdef ENABLE_WALLET CWallet* pwalletMain; @@ -109,10 +109,11 @@ static CCoinsViewDB *pcoinsdbview; void Shutdown() { - LogPrintf("Shutdown : In progress...\n"); + LogPrintf("%s: In progress...\n", __func__); static CCriticalSection cs_Shutdown; TRY_LOCK(cs_Shutdown, lockShutdown); - if (!lockShutdown) return; + if (!lockShutdown) + return; RenameThread("bitcoin-shutoff"); mempool.AddTransactionsUpdated(1); @@ -130,7 +131,7 @@ void Shutdown() if (est_fileout) mempool.WriteFeeEstimates(est_fileout); else - LogPrintf("failed to write fee estimates"); + LogPrintf("%s: Failed to write fee estimates to %s\n", __func__, est_path.string()); { LOCK(cs_main); @@ -142,9 +143,12 @@ void Shutdown() pblocktree->Flush(); if (pcoinsTip) pcoinsTip->Flush(); - delete pcoinsTip; pcoinsTip = NULL; - delete pcoinsdbview; pcoinsdbview = NULL; - delete pblocktree; pblocktree = NULL; + delete pcoinsTip; + pcoinsTip = NULL; + delete pcoinsdbview; + pcoinsdbview = NULL; + delete pblocktree; + pblocktree = NULL; } #ifdef ENABLE_WALLET if (pwalletMain) @@ -156,7 +160,7 @@ void Shutdown() if (pwalletMain) delete pwalletMain; #endif - LogPrintf("Shutdown : done\n"); + LogPrintf("%s: done\n", __func__); } // @@ -315,6 +319,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += "\n" + _("Node relay options:") + "\n"; strUsage += " -datacarrier " + _("Relay and mine data carrier transactions (default: 1)") + "\n"; + strUsage += "\n" + _("Block creation options:") + "\n"; strUsage += " -blockminsize= " + _("Set minimum block size in bytes (default: 0)") + "\n"; strUsage += " -blockmaxsize= " + strprintf(_("Set maximum block size in bytes (default: %d)"), DEFAULT_BLOCK_MAX_SIZE) + "\n"; @@ -564,9 +569,9 @@ bool AppInit2(boost::thread_group& threadGroup) if (GetBoolArg("-nodebug", false) || find(categories.begin(), categories.end(), string("0")) != categories.end()) fDebug = false; - // Check for -debugnet (deprecated) + // Check for -debugnet if (GetBoolArg("-debugnet", false)) - InitWarning(_("Warning: Deprecated argument -debugnet ignored, use -debug=net")); + InitWarning(_("Warning: Unsupported argument -debugnet ignored, use -debug=net.")); // Check for -socks - as this is a privacy risk to continue, exit here if (mapArgs.count("-socks")) return InitError(_("Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.")); @@ -994,6 +999,7 @@ bool AppInit2(boost::thread_group& threadGroup) boost::filesystem::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME; CAutoFile est_filein = CAutoFile(fopen(est_path.string().c_str(), "rb"), SER_DISK, CLIENT_VERSION); + // Allowed to fail as this file IS missing on first startup. if (est_filein) mempool.ReadFeeEstimates(est_filein); From 001a53d7427dcbcceef3c6754d9cca19df6dafa1 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 24 Jun 2014 14:27:32 +0200 Subject: [PATCH 0350/1288] add GetRandBytes() as wrapper for RAND_bytes() - add a small wrapper in util around RAND_bytes() and replace with GetRandBytes() in the code to log errors from calling RAND_bytes() - remove OpenSSL header rand.h where no longer needed --- src/addrman.h | 4 +--- src/key.cpp | 10 ++++------ src/main.cpp | 2 +- src/net.cpp | 4 ++-- src/rpcserver.cpp | 2 +- src/util.cpp | 29 ++++++++++++++++------------- src/util.h | 1 + src/wallet.cpp | 9 +++++---- 8 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/addrman.h b/src/addrman.h index c4c296560e..c012e3deef 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -16,8 +16,6 @@ #include #include -#include - /** Extended statistics about a CAddress */ class CAddrInfo : public CAddress { @@ -384,7 +382,7 @@ public: CAddrMan() : vRandom(0), vvTried(ADDRMAN_TRIED_BUCKET_COUNT, std::vector(0)), vvNew(ADDRMAN_NEW_BUCKET_COUNT, std::set()) { nKey.resize(32); - RAND_bytes(&nKey[0], 32); + GetRandBytes(&nKey[0], 32); nIdCount = 0; nTried = 0; diff --git a/src/key.cpp b/src/key.cpp index 3c4fa77e72..a253f8666a 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -1,11 +1,11 @@ -// Copyright (c) 2009-2013 The Bitcoin developers +// Copyright (c) 2009-2014 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "key.h" #include "crypto/sha2.h" -#include +#include "random.h" #ifdef USE_SECP256K1 #include @@ -194,7 +194,7 @@ public: if (d2i_ECPrivateKey(&pkey, &pbegin, privkey.size())) { if(fSkipCheck) return true; - + // d2i_ECPrivateKey returns true if parsing succeeds. // This doesn't necessarily mean the key is valid. if (EC_KEY_check_key(pkey)) @@ -412,7 +412,7 @@ bool CKey::CheckSignatureElement(const unsigned char *vch, int len, bool half) { void CKey::MakeNewKey(bool fCompressedIn) { do { - RAND_bytes(vch, sizeof(vch)); + GetRandBytes(vch, sizeof(vch)); } while (!Check(vch)); fValid = true; fCompressed = fCompressedIn; @@ -745,5 +745,3 @@ bool ECC_InitSanityCheck() { return true; #endif } - - diff --git a/src/main.cpp b/src/main.cpp index a9c080ffae..8225d73d8d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4370,7 +4370,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) if (pingSend) { uint64_t nonce = 0; while (nonce == 0) { - RAND_bytes((unsigned char*)&nonce, sizeof(nonce)); + GetRandBytes((unsigned char*)&nonce, sizeof(nonce)); } pto->fPingQueued = false; pto->nPingUsecStart = GetTimeMicros(); diff --git a/src/net.cpp b/src/net.cpp index 6a660dc9bd..0e663aea83 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -546,7 +546,7 @@ void CNode::PushVersion() int64_t nTime = (fInbound ? GetAdjustedTime() : GetTime()); CAddress addrYou = (addr.IsRoutable() && !IsProxy(addr) ? addr : CAddress(CService("0.0.0.0",0))); CAddress addrMe = GetLocalAddress(&addr); - RAND_bytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce)); + GetRandBytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce)); if (fLogIPs) LogPrint("net", "send version message: version %d, blocks=%d, us=%s, them=%s, peer=%d\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), addrYou.ToString(), id); else @@ -1931,7 +1931,7 @@ bool CAddrDB::Write(const CAddrMan& addr) { // Generate random temporary filename unsigned short randv = 0; - RAND_bytes((unsigned char *)&randv, sizeof(randv)); + GetRandBytes((unsigned char*)&randv, sizeof(randv)); std::string tmpfn = strprintf("peers.dat.%04x", randv); // serialize addresses, checksum data up to that point, then append csum diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 18fa075101..e0c96d88fa 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -531,7 +531,7 @@ void StartRPCThreads() (mapArgs["-rpcuser"] == mapArgs["-rpcpassword"])) && Params().RequireRPCPassword()) { unsigned char rand_pwd[32]; - RAND_bytes(rand_pwd, 32); + GetRandBytes(rand_pwd, 32); string strWhatAmI = "To use bitcoind"; if (mapArgs.count("-server")) strWhatAmI = strprintf(_("To use the %s option"), "\"-server\""); diff --git a/src/util.cpp b/src/util.cpp index 91ac8833d5..8f2a1bd73d 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -69,6 +69,7 @@ #include #include #include +#include #include // Work around clang compilation problem in Boost 1.46: @@ -141,12 +142,14 @@ public: } instance_of_cinit; - - - - - - +bool GetRandBytes(unsigned char *buf, int num) +{ + if (RAND_bytes(buf, num) == 0) { + LogPrint("rand", "%s : OpenSSL RAND_bytes() failed with error: %s\n", __func__, ERR_error_string(ERR_get_error(), NULL)); + return false; + } + return true; +} void RandAddSeed() { @@ -207,9 +210,9 @@ uint64_t GetRand(uint64_t nMax) // to give every possible output value an equal possibility uint64_t nRange = (std::numeric_limits::max() / nMax) * nMax; uint64_t nRand = 0; - do - RAND_bytes((unsigned char*)&nRand, sizeof(nRand)); - while (nRand >= nRange); + do { + GetRandBytes((unsigned char*)&nRand, sizeof(nRand)); + } while (nRand >= nRange); return (nRand % nMax); } @@ -221,7 +224,7 @@ int GetRandInt(int nMax) uint256 GetRandHash() { uint256 hash; - RAND_bytes((unsigned char*)&hash, sizeof(hash)); + GetRandBytes((unsigned char*)&hash, sizeof(hash)); return hash; } @@ -1196,18 +1199,18 @@ uint32_t insecure_rand_Rz = 11; uint32_t insecure_rand_Rw = 11; void seed_insecure_rand(bool fDeterministic) { - //The seed values have some unlikely fixed points which we avoid. + // The seed values have some unlikely fixed points which we avoid. if(fDeterministic) { insecure_rand_Rz = insecure_rand_Rw = 11; } else { uint32_t tmp; do { - RAND_bytes((unsigned char*)&tmp, 4); + GetRandBytes((unsigned char*)&tmp, 4); } while(tmp == 0 || tmp == 0x9068ffffU); insecure_rand_Rz = tmp; do { - RAND_bytes((unsigned char*)&tmp, 4); + GetRandBytes((unsigned char*)&tmp, 4); } while(tmp == 0 || tmp == 0x464fffffU); insecure_rand_Rw = tmp; } diff --git a/src/util.h b/src/util.h index 60db71bfd0..d0108ee77f 100644 --- a/src/util.h +++ b/src/util.h @@ -103,6 +103,7 @@ extern bool fLogTimestamps; extern bool fLogIPs; extern volatile bool fReopenDebugLog; +bool GetRandBytes(unsigned char *buf, int num); void RandAddSeed(); void RandAddSeedPerfmon(); void SetupEnvironment(); diff --git a/src/wallet.cpp b/src/wallet.cpp index a54494f935..d61f01d096 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -12,7 +12,6 @@ #include "timedata.h" #include -#include using namespace std; @@ -384,13 +383,15 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase) RandAddSeedPerfmon(); vMasterKey.resize(WALLET_CRYPTO_KEY_SIZE); - RAND_bytes(&vMasterKey[0], WALLET_CRYPTO_KEY_SIZE); + if (!GetRandBytes(&vMasterKey[0], WALLET_CRYPTO_KEY_SIZE)) + return false; CMasterKey kMasterKey; - RandAddSeedPerfmon(); + kMasterKey.vchSalt.resize(WALLET_CRYPTO_SALT_SIZE); - RAND_bytes(&kMasterKey.vchSalt[0], WALLET_CRYPTO_SALT_SIZE); + if (!GetRandBytes(&kMasterKey.vchSalt[0], WALLET_CRYPTO_SALT_SIZE)) + return false; CCrypter crypter; int64_t nStartTime = GetTimeMillis(); From 6354935c485d116e1965567561c197ab3fbc0e11 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 26 Jun 2014 14:41:53 +0200 Subject: [PATCH 0351/1288] move rand functions from util to new random.h/.cpp --- src/Makefile.am | 6 +- src/addrman.h | 1 + src/chainparams.cpp | 1 + src/net.h | 2 +- src/random.cpp | 140 +++++++++++++++++++++++++++++++++++ src/random.h | 49 ++++++++++++ src/script.cpp | 8 +- src/test/canonical_tests.cpp | 8 +- src/test/crypto_tests.cpp | 1 + src/test/mruset_tests.cpp | 1 + src/test/sighash_tests.cpp | 20 ++--- src/test/skiplist_tests.cpp | 7 +- src/test/test_bitcoin.cpp | 4 +- src/test/util_tests.cpp | 1 + src/util.cpp | 109 +-------------------------- src/util.h | 51 ------------- 16 files changed, 222 insertions(+), 187 deletions(-) create mode 100644 src/random.cpp create mode 100644 src/random.h diff --git a/src/Makefile.am b/src/Makefile.am index 9b0b97b7ac..90e0a43beb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -91,6 +91,7 @@ BITCOIN_CORE_H = \ noui.h \ pow.h \ protocol.h \ + random.h \ rpcclient.h \ rpcprotocol.h \ rpcserver.h \ @@ -197,14 +198,15 @@ libbitcoin_common_a_SOURCES = \ # backward-compatibility objects and their sanity checks are linked. libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_util_a_SOURCES = \ + compat/glibc_sanity.cpp \ + compat/glibcxx_sanity.cpp \ chainparamsbase.cpp \ + random.cpp \ rpcprotocol.cpp \ sync.cpp \ uint256.cpp \ util.cpp \ version.cpp \ - compat/glibc_sanity.cpp \ - compat/glibcxx_sanity.cpp \ $(BITCOIN_CORE_H) if GLIBC_BACK_COMPAT diff --git a/src/addrman.h b/src/addrman.h index c012e3deef..a0dc134c40 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -7,6 +7,7 @@ #include "netbase.h" #include "protocol.h" +#include "random.h" #include "sync.h" #include "timedata.h" #include "util.h" diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 63067a153d..50977dc06b 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -6,6 +6,7 @@ #include "chainparams.h" #include "assert.h" +#include "random.h" #include "util.h" #include diff --git a/src/net.h b/src/net.h index c2a0416455..21a2919f4a 100644 --- a/src/net.h +++ b/src/net.h @@ -13,6 +13,7 @@ #include "mruset.h" #include "netbase.h" #include "protocol.h" +#include "random.h" #include "sync.h" #include "uint256.h" #include "util.h" @@ -26,7 +27,6 @@ #include #include -#include class CAddrMan; class CBlockIndex; diff --git a/src/random.cpp b/src/random.cpp new file mode 100644 index 0000000000..4c7f150f75 --- /dev/null +++ b/src/random.cpp @@ -0,0 +1,140 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "random.h" + +#ifdef WIN32 +#include "compat.h" // for Windows API +#endif +#include "util.h" // for LogPrint() + +#ifndef WIN32 +#include +#endif +#include // for memset() + +#include +#include +#include + +static inline int64_t GetPerformanceCounter() +{ + int64_t nCounter = 0; +#ifdef WIN32 + QueryPerformanceCounter((LARGE_INTEGER*)&nCounter); +#else + timeval t; + gettimeofday(&t, NULL); + nCounter = (int64_t)(t.tv_sec * 1000000 + t.tv_usec); +#endif + return nCounter; +} + +void RandAddSeed() +{ + // Seed with CPU performance counter + int64_t nCounter = GetPerformanceCounter(); + RAND_add(&nCounter, sizeof(nCounter), 1.5); + memset(&nCounter, 0, sizeof(nCounter)); +} + +void RandAddSeedPerfmon() +{ + RandAddSeed(); + + // This can take up to 2 seconds, so only do it every 10 minutes + static int64_t nLastPerfmon; + if (GetTime() < nLastPerfmon + 10 * 60) + return; + nLastPerfmon = GetTime(); + +#ifdef WIN32 + // Don't need this on Linux, OpenSSL automatically uses /dev/urandom + // Seed with the entire set of perfmon data + std::vector vData(250000,0); + long ret = 0; + unsigned long nSize = 0; + const size_t nMaxSize = 10000000; // Bail out at more than 10MB of performance data + while (true) + { + nSize = vData.size(); + ret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, begin_ptr(vData), &nSize); + if (ret != ERROR_MORE_DATA || vData.size() >= nMaxSize) + break; + vData.resize(std::max((vData.size()*3)/2, nMaxSize)); // Grow size of buffer exponentially + } + RegCloseKey(HKEY_PERFORMANCE_DATA); + if (ret == ERROR_SUCCESS) + { + RAND_add(begin_ptr(vData), nSize, nSize/100.0); + OPENSSL_cleanse(begin_ptr(vData), nSize); + LogPrint("rand", "%s: %lu bytes\n", __func__, nSize); + } else { + static bool warned = false; // Warn only once + if (!warned) + { + LogPrintf("%s: Warning: RegQueryValueExA(HKEY_PERFORMANCE_DATA) failed with code %i\n", __func__, ret); + warned = true; + } + } +#endif +} + +bool GetRandBytes(unsigned char *buf, int num) +{ + if (RAND_bytes(buf, num) != 1) { + LogPrintf("%s: OpenSSL RAND_bytes() failed with error: %s\n", __func__, ERR_error_string(ERR_get_error(), NULL)); + return false; + } + return true; +} + +uint64_t GetRand(uint64_t nMax) +{ + if (nMax == 0) + return 0; + + // The range of the random source must be a multiple of the modulus + // to give every possible output value an equal possibility + uint64_t nRange = (std::numeric_limits::max() / nMax) * nMax; + uint64_t nRand = 0; + do { + GetRandBytes((unsigned char*)&nRand, sizeof(nRand)); + } while (nRand >= nRange); + return (nRand % nMax); +} + +int GetRandInt(int nMax) +{ + return GetRand(nMax); +} + +uint256 GetRandHash() +{ + uint256 hash; + GetRandBytes((unsigned char*)&hash, sizeof(hash)); + return hash; +} + +uint32_t insecure_rand_Rz = 11; +uint32_t insecure_rand_Rw = 11; +void seed_insecure_rand(bool fDeterministic) +{ + // The seed values have some unlikely fixed points which we avoid. + if(fDeterministic) + { + insecure_rand_Rz = insecure_rand_Rw = 11; + } else { + uint32_t tmp; + do { + GetRandBytes((unsigned char*)&tmp, 4); + } while(tmp == 0 || tmp == 0x9068ffffU); + insecure_rand_Rz = tmp; + do { + GetRandBytes((unsigned char*)&tmp, 4); + } while(tmp == 0 || tmp == 0x464fffffU); + insecure_rand_Rw = tmp; + } +} diff --git a/src/random.h b/src/random.h new file mode 100644 index 0000000000..a599b08478 --- /dev/null +++ b/src/random.h @@ -0,0 +1,49 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_RANDOM_H +#define BITCOIN_RANDOM_H + +#include "uint256.h" + +#include + +/** + * Seed OpenSSL PRNG with additional entropy data + */ +void RandAddSeed(); +void RandAddSeedPerfmon(); + +/** + * Functions to gather random data via the OpenSSL PRNG + */ +bool GetRandBytes(unsigned char *buf, int num); +uint64_t GetRand(uint64_t nMax); +int GetRandInt(int nMax); +uint256 GetRandHash(); + +/** + * Seed insecure_rand using the random pool. + * @param Deterministic Use a determinstic seed + */ +void seed_insecure_rand(bool fDeterministic = false); + +/** + * MWC RNG of George Marsaglia + * This is intended to be fast. It has a period of 2^59.3, though the + * least significant 16 bits only have a period of about 2^30.1. + * + * @return random value + */ +extern uint32_t insecure_rand_Rz; +extern uint32_t insecure_rand_Rw; +static inline uint32_t insecure_rand(void) +{ + insecure_rand_Rz = 36969 * (insecure_rand_Rz & 65535) + (insecure_rand_Rz >> 16); + insecure_rand_Rw = 18000 * (insecure_rand_Rw & 65535) + (insecure_rand_Rw >> 16); + return (insecure_rand_Rw << 16) + insecure_rand_Rz; +} + +#endif // BITCOIN_RANDOM_H diff --git a/src/script.cpp b/src/script.cpp index 238a25e72d..39ae001db8 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -5,13 +5,14 @@ #include "script.h" +#include "crypto/ripemd160.h" +#include "crypto/sha1.h" +#include "crypto/sha2.h" #include "core.h" #include "hash.h" #include "key.h" #include "keystore.h" -#include "crypto/sha1.h" -#include "crypto/sha2.h" -#include "crypto/ripemd160.h" +#include "random.h" #include "sync.h" #include "uint256.h" #include "util.h" @@ -1097,7 +1098,6 @@ uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsig // Valid signature cache, to avoid doing expensive ECDSA signature checking // twice for every transaction (once when accepted into memory pool, and // again when accepted into the block chain) - class CSignatureCache { private: diff --git a/src/test/canonical_tests.cpp b/src/test/canonical_tests.cpp index 23dd74296c..a9798623ea 100644 --- a/src/test/canonical_tests.cpp +++ b/src/test/canonical_tests.cpp @@ -6,12 +6,11 @@ // Unit tests for canonical signatures // - - -#include "script.h" -#include "util.h" #include "data/sig_noncanonical.json.h" #include "data/sig_canonical.json.h" +#include "random.h" +#include "script.h" +#include "util.h" #include #include @@ -21,7 +20,6 @@ using namespace std; using namespace json_spirit; - // In script_tests.cpp extern Array read_json(const std::string& jsondata); diff --git a/src/test/crypto_tests.cpp b/src/test/crypto_tests.cpp index 7bd98fa381..a17278b803 100644 --- a/src/test/crypto_tests.cpp +++ b/src/test/crypto_tests.cpp @@ -5,6 +5,7 @@ #include "crypto/ripemd160.h" #include "crypto/sha1.h" #include "crypto/sha2.h" +#include "random.h" #include "util.h" #include diff --git a/src/test/mruset_tests.cpp b/src/test/mruset_tests.cpp index 60f11c147a..547cd1090c 100644 --- a/src/test/mruset_tests.cpp +++ b/src/test/mruset_tests.cpp @@ -4,6 +4,7 @@ #include "mruset.h" +#include "random.h" #include "util.h" #include diff --git a/src/test/sighash_tests.cpp b/src/test/sighash_tests.cpp index 423ae4a789..b99797fccb 100644 --- a/src/test/sighash_tests.cpp +++ b/src/test/sighash_tests.cpp @@ -2,15 +2,16 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include +#include "data/sighash.json.h" +#include "main.h" +#include "random.h" +#include "serialize.h" +#include "util.h" +#include "version.h" + #include -#include "main.h" -#include "util.h" -#include "serialize.h" -#include "version.h" -#include "data/sighash.json.h" - +#include #include "json/json_spirit_reader_template.h" #include "json/json_spirit_utils.h" #include "json/json_spirit_writer_template.h" @@ -118,7 +119,7 @@ BOOST_AUTO_TEST_SUITE(sighash_tests) BOOST_AUTO_TEST_CASE(sighash_test) { seed_insecure_rand(false); - + #if defined(PRINT_SIGHASH_JSON) std::cout << "[\n"; std::cout << "\t[\"raw_transaction, script, input_index, hashType, signature_hash (result)\"],\n"; @@ -205,10 +206,9 @@ BOOST_AUTO_TEST_CASE(sighash_from_data) BOOST_ERROR("Bad test, couldn't deserialize data: " << strTest); continue; } - + sh = SignatureHash(scriptCode, tx, nIn, nHashType); BOOST_CHECK_MESSAGE(sh.GetHex() == sigHashHex, strTest); } } BOOST_AUTO_TEST_SUITE_END() - diff --git a/src/test/skiplist_tests.cpp b/src/test/skiplist_tests.cpp index 11762c6ea0..a123f1d197 100644 --- a/src/test/skiplist_tests.cpp +++ b/src/test/skiplist_tests.cpp @@ -2,11 +2,13 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include -#include #include "main.h" +#include "random.h" #include "util.h" +#include + +#include #define SKIPLIST_LENGTH 300000 @@ -98,4 +100,3 @@ BOOST_AUTO_TEST_CASE(getlocator_test) } BOOST_AUTO_TEST_SUITE_END() - diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index bcd2f75f55..443b5853b2 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -4,9 +4,8 @@ #define BOOST_TEST_MODULE Bitcoin Test Suite - - #include "main.h" +#include "random.h" #include "txdb.h" #include "ui_interface.h" #include "util.h" @@ -89,4 +88,3 @@ bool ShutdownRequested() { return false; } - diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 0b071361d8..068b9f29c8 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -4,6 +4,7 @@ #include "util.h" +#include "random.h" #include "sync.h" #include diff --git a/src/util.cpp b/src/util.cpp index 8f2a1bd73d..ce31619eca 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6,6 +6,7 @@ #include "util.h" #include "chainparamsbase.h" +#include "random.h" #include "sync.h" #include "uint256.h" #include "version.h" @@ -69,7 +70,6 @@ #include #include #include -#include #include // Work around clang compilation problem in Boost 1.46: @@ -142,92 +142,6 @@ public: } instance_of_cinit; -bool GetRandBytes(unsigned char *buf, int num) -{ - if (RAND_bytes(buf, num) == 0) { - LogPrint("rand", "%s : OpenSSL RAND_bytes() failed with error: %s\n", __func__, ERR_error_string(ERR_get_error(), NULL)); - return false; - } - return true; -} - -void RandAddSeed() -{ - // Seed with CPU performance counter - int64_t nCounter = GetPerformanceCounter(); - RAND_add(&nCounter, sizeof(nCounter), 1.5); - memset(&nCounter, 0, sizeof(nCounter)); -} - -void RandAddSeedPerfmon() -{ - RandAddSeed(); - - // This can take up to 2 seconds, so only do it every 10 minutes - static int64_t nLastPerfmon; - if (GetTime() < nLastPerfmon + 10 * 60) - return; - nLastPerfmon = GetTime(); - -#ifdef WIN32 - // Don't need this on Linux, OpenSSL automatically uses /dev/urandom - // Seed with the entire set of perfmon data - std::vector vData(250000,0); - long ret = 0; - unsigned long nSize = 0; - const size_t nMaxSize = 10000000; // Bail out at more than 10MB of performance data - while (true) - { - nSize = vData.size(); - ret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, begin_ptr(vData), &nSize); - if (ret != ERROR_MORE_DATA || vData.size() >= nMaxSize) - break; - vData.resize(std::max((vData.size()*3)/2, nMaxSize)); // Grow size of buffer exponentially - } - RegCloseKey(HKEY_PERFORMANCE_DATA); - if (ret == ERROR_SUCCESS) - { - RAND_add(begin_ptr(vData), nSize, nSize/100.0); - OPENSSL_cleanse(begin_ptr(vData), nSize); - LogPrint("rand", "%s: %lu bytes\n", __func__, nSize); - } else { - static bool warned = false; // Warn only once - if (!warned) - { - LogPrintf("%s: Warning: RegQueryValueExA(HKEY_PERFORMANCE_DATA) failed with code %i\n", __func__, ret); - warned = true; - } - } -#endif -} - -uint64_t GetRand(uint64_t nMax) -{ - if (nMax == 0) - return 0; - - // The range of the random source must be a multiple of the modulus - // to give every possible output value an equal possibility - uint64_t nRange = (std::numeric_limits::max() / nMax) * nMax; - uint64_t nRand = 0; - do { - GetRandBytes((unsigned char*)&nRand, sizeof(nRand)); - } while (nRand >= nRange); - return (nRand % nMax); -} - -int GetRandInt(int nMax) -{ - return GetRand(nMax); -} - -uint256 GetRandHash() -{ - uint256 hash; - GetRandBytes((unsigned char*)&hash, sizeof(hash)); - return hash; -} - // LogPrintf() has been broken a couple of times now // by well-meaning people adding mutexes in the most straightforward way. // It breaks because it may be called by global destructors during shutdown. @@ -1195,27 +1109,6 @@ void SetMockTime(int64_t nMockTimeIn) nMockTime = nMockTimeIn; } -uint32_t insecure_rand_Rz = 11; -uint32_t insecure_rand_Rw = 11; -void seed_insecure_rand(bool fDeterministic) -{ - // The seed values have some unlikely fixed points which we avoid. - if(fDeterministic) - { - insecure_rand_Rz = insecure_rand_Rw = 11; - } else { - uint32_t tmp; - do { - GetRandBytes((unsigned char*)&tmp, 4); - } while(tmp == 0 || tmp == 0x9068ffffU); - insecure_rand_Rz = tmp; - do { - GetRandBytes((unsigned char*)&tmp, 4); - } while(tmp == 0 || tmp == 0x464fffffU); - insecure_rand_Rw = tmp; - } -} - string FormatVersion(int nVersion) { if (nVersion%100 == 0) diff --git a/src/util.h b/src/util.h index d0108ee77f..db2005337b 100644 --- a/src/util.h +++ b/src/util.h @@ -90,8 +90,6 @@ inline void MilliSleep(int64_t n) #endif } - - extern std::map mapArgs; extern std::map > mapMultiArgs; extern bool fDebug; @@ -103,9 +101,6 @@ extern bool fLogTimestamps; extern bool fLogIPs; extern volatile bool fReopenDebugLog; -bool GetRandBytes(unsigned char *buf, int num); -void RandAddSeed(); -void RandAddSeedPerfmon(); void SetupEnvironment(); /* Return true if log accepts specified category */ @@ -188,23 +183,12 @@ boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate = true); #endif boost::filesystem::path GetTempPath(); void ShrinkDebugFile(); -int GetRandInt(int nMax); -uint64_t GetRand(uint64_t nMax); -uint256 GetRandHash(); int64_t GetTime(); void SetMockTime(int64_t nMockTimeIn); std::string FormatFullVersion(); std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector& comments); void runCommand(std::string strCommand); - - - - - - - - inline std::string i64tostr(int64_t n) { return strprintf("%d", n); @@ -290,19 +274,6 @@ inline std::string HexStr(const T& vch, bool fSpaces=false) */ std::string FormatParagraph(const std::string in, size_t width=79, size_t indent=0); -inline int64_t GetPerformanceCounter() -{ - int64_t nCounter = 0; -#ifdef WIN32 - QueryPerformanceCounter((LARGE_INTEGER*)&nCounter); -#else - timeval t; - gettimeofday(&t, NULL); - nCounter = (int64_t) t.tv_sec * 1000000 + t.tv_usec; -#endif - return nCounter; -} - inline int64_t GetTimeMillis() { return (boost::posix_time::ptime(boost::posix_time::microsec_clock::universal_time()) - @@ -371,28 +342,6 @@ bool SoftSetArg(const std::string& strArg, const std::string& strValue); */ bool SoftSetBoolArg(const std::string& strArg, bool fValue); -/** - * MWC RNG of George Marsaglia - * This is intended to be fast. It has a period of 2^59.3, though the - * least significant 16 bits only have a period of about 2^30.1. - * - * @return random value - */ -extern uint32_t insecure_rand_Rz; -extern uint32_t insecure_rand_Rw; -static inline uint32_t insecure_rand(void) -{ - insecure_rand_Rz = 36969 * (insecure_rand_Rz & 65535) + (insecure_rand_Rz >> 16); - insecure_rand_Rw = 18000 * (insecure_rand_Rw & 65535) + (insecure_rand_Rw >> 16); - return (insecure_rand_Rw << 16) + insecure_rand_Rz; -} - -/** - * Seed insecure_rand using the random pool. - * @param Deterministic Use a determinstic seed - */ -void seed_insecure_rand(bool fDeterministic=false); - /** * Timing-attack-resistant comparison. * Takes time proportional to length From 4eedf4ffeea6a3734f245f785a8d82d69634dccd Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 9 Jul 2014 09:43:55 +0200 Subject: [PATCH 0352/1288] make RandAddSeed() use OPENSSL_cleanse() - removes the cstring include and is also used in RandAddSeedPerfmon() --- src/random.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/random.cpp b/src/random.cpp index 4c7f150f75..0d20d205ac 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -13,7 +13,6 @@ #ifndef WIN32 #include #endif -#include // for memset() #include #include @@ -37,7 +36,7 @@ void RandAddSeed() // Seed with CPU performance counter int64_t nCounter = GetPerformanceCounter(); RAND_add(&nCounter, sizeof(nCounter), 1.5); - memset(&nCounter, 0, sizeof(nCounter)); + OPENSSL_cleanse((void*)&nCounter, sizeof(nCounter)); } void RandAddSeedPerfmon() From e8097f7df164b4bf799963e5ab2539c36079187d Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Tue, 8 Jul 2014 12:07:23 -0400 Subject: [PATCH 0353/1288] Refactor common RPC test code to BitcoinTestFramework base class Inspired by #3956, with a little more flexibility built in. I didn't touch rpcbind_test.py, because it only runs on Linux. --- qa/rpc-tests/README.md | 4 +- qa/rpc-tests/listtransactions.py | 177 +++++++------------- qa/rpc-tests/receivedby.py | 269 ++++++++++++------------------- qa/rpc-tests/skeleton.py | 83 ---------- qa/rpc-tests/smartfees.py | 177 +++++++------------- qa/rpc-tests/test_framework.py | 88 ++++++++++ 6 files changed, 316 insertions(+), 482 deletions(-) delete mode 100755 qa/rpc-tests/skeleton.py create mode 100755 qa/rpc-tests/test_framework.py diff --git a/qa/rpc-tests/README.md b/qa/rpc-tests/README.md index 616c0525f4..3e916a7688 100644 --- a/qa/rpc-tests/README.md +++ b/qa/rpc-tests/README.md @@ -6,8 +6,8 @@ Git subtree of [https://github.com/jgarzik/python-bitcoinrpc](https://github.com Changes to python-bitcoinrpc should be made upstream, and then pulled here using git subtree. -### [skeleton.py](skeleton.py) -Copy this to create new regression tests. +### [test_framework.py](test_framework.py) +Base class for new regression tests. ### [listtransactions.py](listtransactions.py) Tests for the listtransactions RPC call. diff --git a/qa/rpc-tests/listtransactions.py b/qa/rpc-tests/listtransactions.py index f16095c125..50385b4372 100755 --- a/qa/rpc-tests/listtransactions.py +++ b/qa/rpc-tests/listtransactions.py @@ -5,17 +5,7 @@ # Exercise the listtransactions API -# Add python-bitcoinrpc to module search path: -import os -import sys -sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc")) - -import json -import shutil -import subprocess -import tempfile -import traceback - +from test_framework import BitcoinTestFramework from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from util import * @@ -41,116 +31,67 @@ def check_array_result(object_array, to_match, expected): if num_matched == 0: raise AssertionError("No objects matched %s"%(str(to_match))) -def run_test(nodes): - # Simple send, 0 to 1: - txid = nodes[0].sendtoaddress(nodes[1].getnewaddress(), 0.1) - sync_mempools(nodes) - check_array_result(nodes[0].listtransactions(), - {"txid":txid}, - {"category":"send","account":"","amount":Decimal("-0.1"),"confirmations":0}) - check_array_result(nodes[1].listtransactions(), - {"txid":txid}, - {"category":"receive","account":"","amount":Decimal("0.1"),"confirmations":0}) - # mine a block, confirmations should change: - nodes[0].setgenerate(True, 1) - sync_blocks(nodes) - check_array_result(nodes[0].listtransactions(), - {"txid":txid}, - {"category":"send","account":"","amount":Decimal("-0.1"),"confirmations":1}) - check_array_result(nodes[1].listtransactions(), - {"txid":txid}, - {"category":"receive","account":"","amount":Decimal("0.1"),"confirmations":1}) +class ListTransactionsTest(BitcoinTestFramework): - # send-to-self: - txid = nodes[0].sendtoaddress(nodes[0].getnewaddress(), 0.2) - check_array_result(nodes[0].listtransactions(), - {"txid":txid, "category":"send"}, - {"amount":Decimal("-0.2")}) - check_array_result(nodes[0].listtransactions(), - {"txid":txid, "category":"receive"}, - {"amount":Decimal("0.2")}) - - # sendmany from node1: twice to self, twice to node2: - send_to = { nodes[0].getnewaddress() : 0.11, nodes[1].getnewaddress() : 0.22, - nodes[0].getaccountaddress("from1") : 0.33, nodes[1].getaccountaddress("toself") : 0.44 } - txid = nodes[1].sendmany("", send_to) - sync_mempools(nodes) - check_array_result(nodes[1].listtransactions(), - {"category":"send","amount":Decimal("-0.11")}, - {"txid":txid} ) - check_array_result(nodes[0].listtransactions(), - {"category":"receive","amount":Decimal("0.11")}, - {"txid":txid} ) - check_array_result(nodes[1].listtransactions(), - {"category":"send","amount":Decimal("-0.22")}, - {"txid":txid} ) - check_array_result(nodes[1].listtransactions(), - {"category":"receive","amount":Decimal("0.22")}, - {"txid":txid} ) - check_array_result(nodes[1].listtransactions(), - {"category":"send","amount":Decimal("-0.33")}, - {"txid":txid} ) - check_array_result(nodes[0].listtransactions(), - {"category":"receive","amount":Decimal("0.33")}, - {"txid":txid, "account" : "from1"} ) - check_array_result(nodes[1].listtransactions(), - {"category":"send","amount":Decimal("-0.44")}, - {"txid":txid, "account" : ""} ) - check_array_result(nodes[1].listtransactions(), - {"category":"receive","amount":Decimal("0.44")}, - {"txid":txid, "account" : "toself"} ) - - -def main(): - import optparse - - parser = optparse.OptionParser(usage="%prog [options]") - parser.add_option("--nocleanup", dest="nocleanup", default=False, action="store_true", - help="Leave bitcoinds and test.* datadir on exit or error") - parser.add_option("--srcdir", dest="srcdir", default="../../src", - help="Source directory containing bitcoind/bitcoin-cli (default: %default%)") - parser.add_option("--tmpdir", dest="tmpdir", default=tempfile.mkdtemp(prefix="test"), - help="Root directory for datadirs") - (options, args) = parser.parse_args() - - os.environ['PATH'] = options.srcdir+":"+os.environ['PATH'] - - check_json_precision() - - success = False - nodes = [] - try: - print("Initializing test directory "+options.tmpdir) - if not os.path.isdir(options.tmpdir): - os.makedirs(options.tmpdir) - initialize_chain(options.tmpdir) - - nodes = start_nodes(2, options.tmpdir) - connect_nodes(nodes[1], 0) + def run_test(self, nodes): + # Simple send, 0 to 1: + txid = nodes[0].sendtoaddress(nodes[1].getnewaddress(), 0.1) + sync_mempools(nodes) + check_array_result(nodes[0].listtransactions(), + {"txid":txid}, + {"category":"send","account":"","amount":Decimal("-0.1"),"confirmations":0}) + check_array_result(nodes[1].listtransactions(), + {"txid":txid}, + {"category":"receive","account":"","amount":Decimal("0.1"),"confirmations":0}) + # mine a block, confirmations should change: + nodes[0].setgenerate(True, 1) sync_blocks(nodes) + check_array_result(nodes[0].listtransactions(), + {"txid":txid}, + {"category":"send","account":"","amount":Decimal("-0.1"),"confirmations":1}) + check_array_result(nodes[1].listtransactions(), + {"txid":txid}, + {"category":"receive","account":"","amount":Decimal("0.1"),"confirmations":1}) - run_test(nodes) + # send-to-self: + txid = nodes[0].sendtoaddress(nodes[0].getnewaddress(), 0.2) + check_array_result(nodes[0].listtransactions(), + {"txid":txid, "category":"send"}, + {"amount":Decimal("-0.2")}) + check_array_result(nodes[0].listtransactions(), + {"txid":txid, "category":"receive"}, + {"amount":Decimal("0.2")}) - success = True - - except AssertionError as e: - print("Assertion failed: "+e.message) - except Exception as e: - print("Unexpected exception caught during testing: "+str(e)) - traceback.print_tb(sys.exc_info()[2]) - - if not options.nocleanup: - print("Cleaning up") - stop_nodes(nodes) - wait_bitcoinds() - shutil.rmtree(options.tmpdir) - - if success: - print("Tests successful") - sys.exit(0) - else: - print("Failed") - sys.exit(1) + # sendmany from node1: twice to self, twice to node2: + send_to = { nodes[0].getnewaddress() : 0.11, nodes[1].getnewaddress() : 0.22, + nodes[0].getaccountaddress("from1") : 0.33, nodes[1].getaccountaddress("toself") : 0.44 } + txid = nodes[1].sendmany("", send_to) + sync_mempools(nodes) + check_array_result(nodes[1].listtransactions(), + {"category":"send","amount":Decimal("-0.11")}, + {"txid":txid} ) + check_array_result(nodes[0].listtransactions(), + {"category":"receive","amount":Decimal("0.11")}, + {"txid":txid} ) + check_array_result(nodes[1].listtransactions(), + {"category":"send","amount":Decimal("-0.22")}, + {"txid":txid} ) + check_array_result(nodes[1].listtransactions(), + {"category":"receive","amount":Decimal("0.22")}, + {"txid":txid} ) + check_array_result(nodes[1].listtransactions(), + {"category":"send","amount":Decimal("-0.33")}, + {"txid":txid} ) + check_array_result(nodes[0].listtransactions(), + {"category":"receive","amount":Decimal("0.33")}, + {"txid":txid, "account" : "from1"} ) + check_array_result(nodes[1].listtransactions(), + {"category":"send","amount":Decimal("-0.44")}, + {"txid":txid, "account" : ""} ) + check_array_result(nodes[1].listtransactions(), + {"category":"receive","amount":Decimal("0.44")}, + {"txid":txid, "account" : "toself"} ) if __name__ == '__main__': - main() + ListTransactionsTest().main() + diff --git a/qa/rpc-tests/receivedby.py b/qa/rpc-tests/receivedby.py index 7f2d79b3c1..61f5e0452b 100755 --- a/qa/rpc-tests/receivedby.py +++ b/qa/rpc-tests/receivedby.py @@ -3,23 +3,13 @@ # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -# Exercise the listtransactions API - -# Add python-bitcoinrpc to module search path: - -import os -import sys -sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc")) - -import json -import shutil -import subprocess -import tempfile -import traceback +# Exercise the listreceivedbyaddress API +from test_framework import BitcoinTestFramework from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from util import * + def get_sub_array_from_array(object_array, to_match): ''' Finds and returns a sub array from an array of arrays. @@ -62,164 +52,115 @@ def check_array_result(object_array, to_match, expected, should_not_find = False if num_matched > 0 and should_not_find == True: raise AssertionError("Objects was matched %s"%(str(to_match))) -def run_test(nodes): - ''' +class ReceivedByTest(BitcoinTestFramework): + + def run_test(self, nodes): + ''' listreceivedbyaddress Test - ''' - # Send from node 0 to 1 - addr = nodes[1].getnewaddress() - txid = nodes[0].sendtoaddress(addr, 0.1) - sync_mempools(nodes) - - #Check not listed in listreceivedbyaddress because has 0 confirmations - check_array_result(nodes[1].listreceivedbyaddress(), - {"address":addr}, - { }, - True) - #Bury Tx under 10 block so it will be returned by listreceivedbyaddress - nodes[1].setgenerate(True, 10) - sync_blocks(nodes) - check_array_result(nodes[1].listreceivedbyaddress(), - {"address":addr}, - {"address":addr, "account":"", "amount":Decimal("0.1"), "confirmations":10, "txids":[txid,]}) - #With min confidence < 10 - check_array_result(nodes[1].listreceivedbyaddress(5), - {"address":addr}, - {"address":addr, "account":"", "amount":Decimal("0.1"), "confirmations":10, "txids":[txid,]}) - #With min confidence > 10, should not find Tx - check_array_result(nodes[1].listreceivedbyaddress(11),{"address":addr},{ },True) + ''' + # Send from node 0 to 1 + addr = nodes[1].getnewaddress() + txid = nodes[0].sendtoaddress(addr, 0.1) + sync_mempools(nodes) - #Empty Tx - addr = nodes[1].getnewaddress() - check_array_result(nodes[1].listreceivedbyaddress(0,True), - {"address":addr}, - {"address":addr, "account":"", "amount":0, "confirmations":0, "txids":[]}) - - ''' - getreceivedbyaddress Test - ''' - # Send from node 0 to 1 - addr = nodes[1].getnewaddress() - txid = nodes[0].sendtoaddress(addr, 0.1) - sync_mempools(nodes) - - #Check balance is 0 because of 0 confirmations - balance = nodes[1].getreceivedbyaddress(addr) - if balance != Decimal("0.0"): - raise AssertionError("Wrong balance returned by getreceivedbyaddress, %0.2f"%(balance)) - - #Check balance is 0.1 - balance = nodes[1].getreceivedbyaddress(addr,0) - if balance != Decimal("0.1"): - raise AssertionError("Wrong balance returned by getreceivedbyaddress, %0.2f"%(balance)) - - #Bury Tx under 10 block so it will be returned by the default getreceivedbyaddress - nodes[1].setgenerate(True, 10) - sync_blocks(nodes) - balance = nodes[1].getreceivedbyaddress(addr) - if balance != Decimal("0.1"): - raise AssertionError("Wrong balance returned by getreceivedbyaddress, %0.2f"%(balance)) - - ''' - listreceivedbyaccount + getreceivedbyaccount Test - ''' - #set pre-state - addrArr = nodes[1].getnewaddress() - account = nodes[1].getaccount(addrArr) - received_by_account_json = get_sub_array_from_array(nodes[1].listreceivedbyaccount(),{"account":account}) - if len(received_by_account_json) == 0: - raise AssertionError("No accounts found in node") - balance_by_account = rec_by_accountArr = nodes[1].getreceivedbyaccount(account) - - txid = nodes[0].sendtoaddress(addr, 0.1) - - # listreceivedbyaccount should return received_by_account_json because of 0 confirmations - check_array_result(nodes[1].listreceivedbyaccount(), - {"account":account}, - received_by_account_json) - - # getreceivedbyaddress should return same balance because of 0 confirmations - balance = nodes[1].getreceivedbyaccount(account) - if balance != balance_by_account: - raise AssertionError("Wrong balance returned by getreceivedbyaccount, %0.2f"%(balance)) - - nodes[1].setgenerate(True, 10) - sync_blocks(nodes) - # listreceivedbyaccount should return updated account balance - check_array_result(nodes[1].listreceivedbyaccount(), - {"account":account}, - {"account":received_by_account_json["account"], "amount":(received_by_account_json["amount"] + Decimal("0.1"))}) - - # getreceivedbyaddress should return updates balance - balance = nodes[1].getreceivedbyaccount(account) - if balance != balance_by_account + Decimal("0.1"): - raise AssertionError("Wrong balance returned by getreceivedbyaccount, %0.2f"%(balance)) - - #Create a new account named "mynewaccount" that has a 0 balance - nodes[1].getaccountaddress("mynewaccount") - received_by_account_json = get_sub_array_from_array(nodes[1].listreceivedbyaccount(0,True),{"account":"mynewaccount"}) - if len(received_by_account_json) == 0: - raise AssertionError("No accounts found in node") - - # Test includeempty of listreceivedbyaccount - if received_by_account_json["amount"] != Decimal("0.0"): - raise AssertionError("Wrong balance returned by listreceivedbyaccount, %0.2f"%(received_by_account_json["amount"])) - - # Test getreceivedbyaccount for 0 amount accounts - balance = nodes[1].getreceivedbyaccount("mynewaccount") - if balance != Decimal("0.0"): - raise AssertionError("Wrong balance returned by getreceivedbyaccount, %0.2f"%(balance)) - -def main(): - import optparse - - parser = optparse.OptionParser(usage="%prog [options]") - parser.add_option("--nocleanup", dest="nocleanup", default=False, action="store_true", - help="Leave bitcoinds and test.* datadir on exit or error") - parser.add_option("--srcdir", dest="srcdir", default="../../src", - help="Source directory containing bitcoind/bitcoin-cli (default: %default%)") - parser.add_option("--tmpdir", dest="tmpdir", default=tempfile.mkdtemp(prefix="test"), - help="Root directory for datadirs") - (options, args) = parser.parse_args() - - os.environ['PATH'] = options.srcdir+":"+os.environ['PATH'] - - check_json_precision() - - success = False - nodes = [] - try: - print("Initializing test directory "+options.tmpdir) - if not os.path.isdir(options.tmpdir): - os.makedirs(options.tmpdir) - initialize_chain(options.tmpdir) - - nodes = start_nodes(2, options.tmpdir) - connect_nodes(nodes[1], 0) + #Check not listed in listreceivedbyaddress because has 0 confirmations + check_array_result(nodes[1].listreceivedbyaddress(), + {"address":addr}, + { }, + True) + #Bury Tx under 10 block so it will be returned by listreceivedbyaddress + nodes[1].setgenerate(True, 10) sync_blocks(nodes) + check_array_result(nodes[1].listreceivedbyaddress(), + {"address":addr}, + {"address":addr, "account":"", "amount":Decimal("0.1"), "confirmations":10, "txids":[txid,]}) + #With min confidence < 10 + check_array_result(nodes[1].listreceivedbyaddress(5), + {"address":addr}, + {"address":addr, "account":"", "amount":Decimal("0.1"), "confirmations":10, "txids":[txid,]}) + #With min confidence > 10, should not find Tx + check_array_result(nodes[1].listreceivedbyaddress(11),{"address":addr},{ },True) - run_test(nodes) + #Empty Tx + addr = nodes[1].getnewaddress() + check_array_result(nodes[1].listreceivedbyaddress(0,True), + {"address":addr}, + {"address":addr, "account":"", "amount":0, "confirmations":0, "txids":[]}) - success = True + ''' + getreceivedbyaddress Test + ''' + # Send from node 0 to 1 + addr = nodes[1].getnewaddress() + txid = nodes[0].sendtoaddress(addr, 0.1) + sync_mempools(nodes) - except AssertionError as e: - print("Assertion failed: "+e.message) - except Exception as e: - print("Unexpected exception caught during testing: "+str(e)) - traceback.print_tb(sys.exc_info()[2]) + #Check balance is 0 because of 0 confirmations + balance = nodes[1].getreceivedbyaddress(addr) + if balance != Decimal("0.0"): + raise AssertionError("Wrong balance returned by getreceivedbyaddress, %0.2f"%(balance)) - if not options.nocleanup: - print("Cleaning up") - stop_nodes(nodes) - wait_bitcoinds() - shutil.rmtree(options.tmpdir) + #Check balance is 0.1 + balance = nodes[1].getreceivedbyaddress(addr,0) + if balance != Decimal("0.1"): + raise AssertionError("Wrong balance returned by getreceivedbyaddress, %0.2f"%(balance)) - if success: - print("Tests successful") - sys.exit(0) - else: - print("Failed") - sys.exit(1) + #Bury Tx under 10 block so it will be returned by the default getreceivedbyaddress + nodes[1].setgenerate(True, 10) + sync_blocks(nodes) + balance = nodes[1].getreceivedbyaddress(addr) + if balance != Decimal("0.1"): + raise AssertionError("Wrong balance returned by getreceivedbyaddress, %0.2f"%(balance)) + + ''' + listreceivedbyaccount + getreceivedbyaccount Test + ''' + #set pre-state + addrArr = nodes[1].getnewaddress() + account = nodes[1].getaccount(addrArr) + received_by_account_json = get_sub_array_from_array(nodes[1].listreceivedbyaccount(),{"account":account}) + if len(received_by_account_json) == 0: + raise AssertionError("No accounts found in node") + balance_by_account = rec_by_accountArr = nodes[1].getreceivedbyaccount(account) + + txid = nodes[0].sendtoaddress(addr, 0.1) + + # listreceivedbyaccount should return received_by_account_json because of 0 confirmations + check_array_result(nodes[1].listreceivedbyaccount(), + {"account":account}, + received_by_account_json) + + # getreceivedbyaddress should return same balance because of 0 confirmations + balance = nodes[1].getreceivedbyaccount(account) + if balance != balance_by_account: + raise AssertionError("Wrong balance returned by getreceivedbyaccount, %0.2f"%(balance)) + + nodes[1].setgenerate(True, 10) + sync_blocks(nodes) + # listreceivedbyaccount should return updated account balance + check_array_result(nodes[1].listreceivedbyaccount(), + {"account":account}, + {"account":received_by_account_json["account"], "amount":(received_by_account_json["amount"] + Decimal("0.1"))}) + + # getreceivedbyaddress should return updates balance + balance = nodes[1].getreceivedbyaccount(account) + if balance != balance_by_account + Decimal("0.1"): + raise AssertionError("Wrong balance returned by getreceivedbyaccount, %0.2f"%(balance)) + + #Create a new account named "mynewaccount" that has a 0 balance + nodes[1].getaccountaddress("mynewaccount") + received_by_account_json = get_sub_array_from_array(nodes[1].listreceivedbyaccount(0,True),{"account":"mynewaccount"}) + if len(received_by_account_json) == 0: + raise AssertionError("No accounts found in node") + + # Test includeempty of listreceivedbyaccount + if received_by_account_json["amount"] != Decimal("0.0"): + raise AssertionError("Wrong balance returned by listreceivedbyaccount, %0.2f"%(received_by_account_json["amount"])) + + # Test getreceivedbyaccount for 0 amount accounts + balance = nodes[1].getreceivedbyaccount("mynewaccount") + if balance != Decimal("0.0"): + raise AssertionError("Wrong balance returned by getreceivedbyaccount, %0.2f"%(balance)) if __name__ == '__main__': - main() + ReceivedByTest().main() diff --git a/qa/rpc-tests/skeleton.py b/qa/rpc-tests/skeleton.py deleted file mode 100755 index 126b6bfaf4..0000000000 --- a/qa/rpc-tests/skeleton.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2014 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -# Skeleton for python-based regression tests using -# JSON-RPC - - -# Add python-bitcoinrpc to module search path: -import os -import sys -sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc")) - -import json -import shutil -import subprocess -import tempfile -import traceback - -from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException -from util import * - - -def run_test(nodes): - # Replace this as appropriate - for node in nodes: - assert_equal(node.getblockcount(), 200) - assert_equal(node.getbalance(), 25*50) - -def main(): - import optparse - - parser = optparse.OptionParser(usage="%prog [options]") - parser.add_option("--nocleanup", dest="nocleanup", default=False, action="store_true", - help="Leave bitcoinds and test.* datadir on exit or error") - parser.add_option("--srcdir", dest="srcdir", default="../../src", - help="Source directory containing bitcoind/bitcoin-cli (default: %default%)") - parser.add_option("--tmpdir", dest="tmpdir", default=tempfile.mkdtemp(prefix="test"), - help="Root directory for datadirs") - (options, args) = parser.parse_args() - - os.environ['PATH'] = options.srcdir+":"+os.environ['PATH'] - - check_json_precision() - - success = False - nodes = [] - try: - print("Initializing test directory "+options.tmpdir) - if not os.path.isdir(options.tmpdir): - os.makedirs(options.tmpdir) - initialize_chain(options.tmpdir) - - nodes = start_nodes(2, options.tmpdir) - connect_nodes(nodes[1], 0) - sync_blocks(nodes) - - run_test(nodes) - - success = True - - except AssertionError as e: - print("Assertion failed: "+e.message) - except Exception as e: - print("Unexpected exception caught during testing: "+str(e)) - traceback.print_tb(sys.exc_info()[2]) - - if not options.nocleanup: - print("Cleaning up") - stop_nodes(nodes) - wait_bitcoinds() - shutil.rmtree(options.tmpdir) - - if success: - print("Tests successful") - sys.exit(0) - else: - print("Failed") - sys.exit(1) - -if __name__ == '__main__': - main() diff --git a/qa/rpc-tests/smartfees.py b/qa/rpc-tests/smartfees.py index e8abbfba19..352a1de2d0 100755 --- a/qa/rpc-tests/smartfees.py +++ b/qa/rpc-tests/smartfees.py @@ -4,139 +4,86 @@ # Test fee estimation code # -# Add python-bitcoinrpc to module search path: -import os -import sys -sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc")) - -import json -import random -import shutil -import subprocess -import tempfile -import traceback - +from test_framework import BitcoinTestFramework from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from util import * +class EstimateFeeTest(BitcoinTestFramework): -def run_test(nodes, test_dir): - nodes.append(start_node(0, test_dir, + def setup_network(self, test_dir): + nodes = [] + nodes.append(start_node(0, test_dir, ["-debug=mempool", "-debug=estimatefee"])) - # Node1 mines small-but-not-tiny blocks, and allows free transactions. - # NOTE: the CreateNewBlock code starts counting block size at 1,000 bytes, - # so blockmaxsize of 2,000 is really just 1,000 bytes (room enough for - # 6 or 7 transactions) - nodes.append(start_node(1, test_dir, - ["-blockprioritysize=1500", "-blockmaxsize=2000", - "-debug=mempool", "-debug=estimatefee"])) - connect_nodes(nodes[1], 0) + # Node1 mines small-but-not-tiny blocks, and allows free transactions. + # NOTE: the CreateNewBlock code starts counting block size at 1,000 bytes, + # so blockmaxsize of 2,000 is really just 1,000 bytes (room enough for + # 6 or 7 transactions) + nodes.append(start_node(1, test_dir, + ["-blockprioritysize=1500", "-blockmaxsize=2000", + "-debug=mempool", "-debug=estimatefee"])) + connect_nodes(nodes[1], 0) - # Node2 is a stingy miner, that - # produces very small blocks (room for only 3 or so transactions) - node2args = [ "-blockprioritysize=0", "-blockmaxsize=1500", - "-debug=mempool", "-debug=estimatefee"] - nodes.append(start_node(2, test_dir, node2args)) - connect_nodes(nodes[2], 0) + # Node2 is a stingy miner, that + # produces very small blocks (room for only 3 or so transactions) + node2args = [ "-blockprioritysize=0", "-blockmaxsize=1500", + "-debug=mempool", "-debug=estimatefee"] + nodes.append(start_node(2, test_dir, node2args)) + connect_nodes(nodes[2], 0) - sync_blocks(nodes) - - # Prime the memory pool with pairs of transactions - # (high-priority, random fee and zero-priority, random fee) - min_fee = Decimal("0.001") - fees_per_kb = []; - for i in range(12): - (txid, txhex, fee) = random_zeropri_transaction(nodes, Decimal("1.1"), - min_fee, min_fee, 20) - tx_kbytes = (len(txhex)/2)/1000.0 - fees_per_kb.append(float(fee)/tx_kbytes) - - # Mine blocks with node2 until the memory pool clears: - count_start = nodes[2].getblockcount() - while len(nodes[2].getrawmempool()) > 0: - nodes[2].setgenerate(True, 1) sync_blocks(nodes) + return nodes + - all_estimates = [ nodes[0].estimatefee(i) for i in range(1,20) ] - print("Fee estimates, super-stingy miner: "+str([str(e) for e in all_estimates])) - - # Estimates should be within the bounds of what transactions fees actually were: - delta = 1.0e-6 # account for rounding error - for e in filter(lambda x: x >= 0, all_estimates): - if float(e)+delta < min(fees_per_kb) or float(e)-delta > max(fees_per_kb): - raise AssertionError("Estimated fee (%f) out of range (%f,%f)"%(float(e), min_fee_kb, max_fee_kb)) - - # Generate transactions while mining 30 more blocks, this time with node1: - for i in range(30): - for j in range(random.randrange(6-4,6+4)): - (txid, txhex, fee) = random_transaction(nodes, Decimal("1.1"), - Decimal("0.0"), min_fee, 20) + def run_test(self, nodes): + # Prime the memory pool with pairs of transactions + # (high-priority, random fee and zero-priority, random fee) + min_fee = Decimal("0.001") + fees_per_kb = []; + for i in range(12): + (txid, txhex, fee) = random_zeropri_transaction(nodes, Decimal("1.1"), + min_fee, min_fee, 20) tx_kbytes = (len(txhex)/2)/1000.0 fees_per_kb.append(float(fee)/tx_kbytes) - nodes[1].setgenerate(True, 1) - sync_blocks(nodes) - all_estimates = [ nodes[0].estimatefee(i) for i in range(1,20) ] - print("Fee estimates, more generous miner: "+str([ str(e) for e in all_estimates])) - for e in filter(lambda x: x >= 0, all_estimates): - if float(e)+delta < min(fees_per_kb) or float(e)-delta > max(fees_per_kb): - raise AssertionError("Estimated fee (%f) out of range (%f,%f)"%(float(e), min_fee_kb, max_fee_kb)) + # Mine blocks with node2 until the memory pool clears: + count_start = nodes[2].getblockcount() + while len(nodes[2].getrawmempool()) > 0: + nodes[2].setgenerate(True, 1) + sync_blocks(nodes) - # Finish by mining a normal-sized block: - while len(nodes[0].getrawmempool()) > 0: - nodes[0].setgenerate(True, 1) - sync_blocks(nodes) + all_estimates = [ nodes[0].estimatefee(i) for i in range(1,20) ] + print("Fee estimates, super-stingy miner: "+str([str(e) for e in all_estimates])) - final_estimates = [ nodes[0].estimatefee(i) for i in range(1,20) ] - print("Final fee estimates: "+str([ str(e) for e in final_estimates])) + # Estimates should be within the bounds of what transactions fees actually were: + delta = 1.0e-6 # account for rounding error + for e in filter(lambda x: x >= 0, all_estimates): + if float(e)+delta < min(fees_per_kb) or float(e)-delta > max(fees_per_kb): + raise AssertionError("Estimated fee (%f) out of range (%f,%f)"%(float(e), min_fee_kb, max_fee_kb)) -def main(): - import optparse + # Generate transactions while mining 30 more blocks, this time with node1: + for i in range(30): + for j in range(random.randrange(6-4,6+4)): + (txid, txhex, fee) = random_transaction(nodes, Decimal("1.1"), + Decimal("0.0"), min_fee, 20) + tx_kbytes = (len(txhex)/2)/1000.0 + fees_per_kb.append(float(fee)/tx_kbytes) + nodes[1].setgenerate(True, 1) + sync_blocks(nodes) - parser = optparse.OptionParser(usage="%prog [options]") - parser.add_option("--nocleanup", dest="nocleanup", default=False, action="store_true", - help="Leave bitcoinds and test.* datadir on exit or error") - parser.add_option("--srcdir", dest="srcdir", default="../../src", - help="Source directory containing bitcoind/bitcoin-cli (default: %default%)") - parser.add_option("--tmpdir", dest="tmpdir", default=tempfile.mkdtemp(prefix="test"), - help="Root directory for datadirs") - (options, args) = parser.parse_args() + all_estimates = [ nodes[0].estimatefee(i) for i in range(1,20) ] + print("Fee estimates, more generous miner: "+str([ str(e) for e in all_estimates])) + for e in filter(lambda x: x >= 0, all_estimates): + if float(e)+delta < min(fees_per_kb) or float(e)-delta > max(fees_per_kb): + raise AssertionError("Estimated fee (%f) out of range (%f,%f)"%(float(e), min_fee_kb, max_fee_kb)) - os.environ['PATH'] = options.srcdir+":"+os.environ['PATH'] + # Finish by mining a normal-sized block: + while len(nodes[0].getrawmempool()) > 0: + nodes[0].setgenerate(True, 1) + sync_blocks(nodes) - check_json_precision() + final_estimates = [ nodes[0].estimatefee(i) for i in range(1,20) ] + print("Final fee estimates: "+str([ str(e) for e in final_estimates])) - success = False - nodes = [] - try: - print("Initializing test directory "+options.tmpdir) - print(" node0 running at: 127.0.0.1:%d"%(p2p_port(0))) - if not os.path.isdir(options.tmpdir): - os.makedirs(options.tmpdir) - initialize_chain(options.tmpdir) - - run_test(nodes, options.tmpdir) - - success = True - - except AssertionError as e: - print("Assertion failed: "+e.message) - except Exception as e: - print("Unexpected exception caught during testing: "+str(e)) - traceback.print_tb(sys.exc_info()[2]) - - if not options.nocleanup: - print("Cleaning up") - stop_nodes(nodes) - wait_bitcoinds() - shutil.rmtree(options.tmpdir) - - if success: - print("Tests successful") - sys.exit(0) - else: - print("Failed") - sys.exit(1) if __name__ == '__main__': - main() + EstimateFeeTest().main() diff --git a/qa/rpc-tests/test_framework.py b/qa/rpc-tests/test_framework.py new file mode 100755 index 0000000000..a9b3d236b5 --- /dev/null +++ b/qa/rpc-tests/test_framework.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# Copyright (c) 2014 The Bitcoin Core developers +# Distributed under the MIT/X11 software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +# Base class for RPC testing + +# Add python-bitcoinrpc to module search path: +import os +import sys +sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc")) + +import shutil +import tempfile +import traceback + +from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException +from util import * + + +class BitcoinTestFramework(object): + + # These may be over-ridden by subclasses: + def run_test(self, nodes): + assert_equal(node.getblockcount(), 200) + assert_equal(node.getbalance(), 25*50) + + def add_options(self, parser): + pass + + def setup_chain(self, tmp_directory): + print("Initializing test directory "+tmp_directory) + initialize_chain(tmp_directory) + + def setup_network(self, tmp_directory): + nodes = start_nodes(2, tmp_directory) + connect_nodes(nodes[1], 0) + sync_blocks(nodes) + return nodes + + def main(self): + import optparse + + parser = optparse.OptionParser(usage="%prog [options]") + parser.add_option("--nocleanup", dest="nocleanup", default=False, action="store_true", + help="Leave bitcoinds and test.* datadir on exit or error") + parser.add_option("--srcdir", dest="srcdir", default="../../src", + help="Source directory containing bitcoind/bitcoin-cli (default: %default%)") + parser.add_option("--tmpdir", dest="tmpdir", default=tempfile.mkdtemp(prefix="test"), + help="Root directory for datadirs") + self.add_options(parser) + (self.options, self.args) = parser.parse_args() + + os.environ['PATH'] = self.options.srcdir+":"+os.environ['PATH'] + + check_json_precision() + + success = False + nodes = [] + try: + if not os.path.isdir(self.options.tmpdir): + os.makedirs(self.options.tmpdir) + self.setup_chain(self.options.tmpdir) + + nodes = self.setup_network(self.options.tmpdir) + + self.run_test(nodes) + + success = True + + except AssertionError as e: + print("Assertion failed: "+e.message) + except Exception as e: + print("Unexpected exception caught during testing: "+str(e)) + traceback.print_tb(sys.exc_info()[2]) + + if not self.options.nocleanup: + print("Cleaning up") + stop_nodes(nodes) + wait_bitcoinds() + shutil.rmtree(self.options.tmpdir) + + if success: + print("Tests successful") + sys.exit(0) + else: + print("Failed") + sys.exit(1) From f5a92bf9bd9e5547cb8b4c0084c7e23c36b49b70 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Tue, 8 Jul 2014 21:24:40 -0400 Subject: [PATCH 0354/1288] Print better errors, and add util stop_node() function. --- qa/rpc-tests/test_framework.py | 4 ++++ qa/rpc-tests/util.py | 15 ++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/qa/rpc-tests/test_framework.py b/qa/rpc-tests/test_framework.py index a9b3d236b5..5a18556655 100755 --- a/qa/rpc-tests/test_framework.py +++ b/qa/rpc-tests/test_framework.py @@ -68,8 +68,12 @@ class BitcoinTestFramework(object): success = True + except JSONRPCException as e: + print("JSONRPC error: "+e.error['message']) + traceback.print_tb(sys.exc_info()[2]) except AssertionError as e: print("Assertion failed: "+e.message) + traceback.print_tb(sys.exc_info()[2]) except Exception as e: print("Unexpected exception caught during testing: "+str(e)) traceback.print_tb(sys.exc_info()[2]) diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index 27c9f778f6..0a7f26ffcd 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -59,7 +59,7 @@ def sync_mempools(rpc_connections): time.sleep(1) -bitcoind_processes = [] +bitcoind_processes = {} def initialize_datadir(dir, n): datadir = os.path.join(dir, "node"+str(n)) @@ -88,7 +88,7 @@ def initialize_chain(test_dir): args = [ "bitcoind", "-keypool=1", "-datadir="+datadir ] if i > 0: args.append("-connect=127.0.0.1:"+str(p2p_port(0))) - bitcoind_processes.append(subprocess.Popen(args)) + bitcoind_processes[i] = subprocess.Popen(args) subprocess.check_call([ "bitcoin-cli", "-datadir="+datadir, "-rpcwait", "getblockcount"], stdout=devnull) devnull.close() @@ -149,7 +149,7 @@ def start_node(i, dir, extra_args=None, rpchost=None): datadir = os.path.join(dir, "node"+str(i)) args = [ "bitcoind", "-datadir="+datadir, "-keypool=1" ] if extra_args is not None: args.extend(extra_args) - bitcoind_processes.append(subprocess.Popen(args)) + bitcoind_processes[i] = subprocess.Popen(args) devnull = open("/dev/null", "w+") subprocess.check_call([ "bitcoin-cli", "-datadir="+datadir] + _rpchost_to_args(rpchost) + @@ -168,6 +168,11 @@ def start_nodes(num_nodes, dir, extra_args=None, rpchost=None): def debug_log(dir, n_node): return os.path.join(dir, "node"+str(n_node), "regtest", "debug.log") +def stop_node(node, i): + node.stop() + bitcoind_processes[i].wait() + del bitcoind_processes[i] + def stop_nodes(nodes): for i in range(len(nodes)): nodes[i].stop() @@ -175,9 +180,9 @@ def stop_nodes(nodes): def wait_bitcoinds(): # Wait for all bitcoinds to cleanly exit - for bitcoind in bitcoind_processes: + for bitcoind in bitcoind_processes.values(): bitcoind.wait() - del bitcoind_processes[:] + bitcoind_processes.clear() def connect_nodes(from_connection, node_num): ip_port = "127.0.0.1:"+str(p2p_port(node_num)) From 5734d4d1e6ee89361fc2484f5d33315397796c0d Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 9 Jul 2014 17:42:50 +0200 Subject: [PATCH 0355/1288] Only remove actualy failed blocks from setBlockIndexValid --- src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index a9c080ffae..913a1702eb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2073,7 +2073,7 @@ static CBlockIndex* FindMostWorkChain() { CBlockIndex *pindexTest = pindexNew; bool fInvalidAncestor = false; while (pindexTest && !chainActive.Contains(pindexTest)) { - if (!pindexTest->IsValid(BLOCK_VALID_TRANSACTIONS) || !(pindexTest->nStatus & BLOCK_HAVE_DATA)) { + if (pindexTest->nStatus & BLOCK_FAILED_MASK) { // Candidate has an invalid ancestor, remove entire chain from the set. if (pindexBestInvalid == NULL || pindexNew->nChainWork > pindexBestInvalid->nChainWork) pindexBestInvalid = pindexNew; @@ -2083,6 +2083,7 @@ static CBlockIndex* FindMostWorkChain() { setBlockIndexValid.erase(pindexFailed); pindexFailed = pindexFailed->pprev; } + setBlockIndexValid.erase(pindexTest); fInvalidAncestor = true; break; } From dc942e6f276b9fabc21f06d11cd16871d4054f82 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 21 Jun 2014 13:34:36 +0200 Subject: [PATCH 0356/1288] Introduce whitelisted peers. This adds a -whitelist option to specify subnet ranges from which peers that connect are whitelisted. In addition, there is a -whitebind option which works like -bind, except peers connecting to it are also whitelisted (allowing a separate listen port for trusted connections). Being whitelisted has two effects (for now): * They are immune to DoS disconnection/banning. * Transactions they broadcast (which are valid) are always relayed, even if they were already in the mempool. This means that a node can function as a gateway for a local network, and that rebroadcasts from the local network will work as expected. Whitelisting replaces the magic exemption localhost had for DoS disconnection (local addresses are still never banned, though), which implied hidden service connects (from a localhost Tor node) were incorrectly immune to DoS disconnection as well. This old behaviour is removed for that reason, but can be restored using -whitelist=127.0.0.1 or -whitelist=::1 can be specified. -whitebind is safer to use in case non-trusted localhost connections are expected (like hidden services). --- qa/pull-tester/run-bitcoind-for-test.sh.in | 2 +- src/init.cpp | 32 +++++++++--- src/main.cpp | 19 +++++-- src/net.cpp | 60 ++++++++++++++++------ src/net.h | 13 ++++- src/rpcnet.cpp | 1 + 6 files changed, 99 insertions(+), 28 deletions(-) diff --git a/qa/pull-tester/run-bitcoind-for-test.sh.in b/qa/pull-tester/run-bitcoind-for-test.sh.in index 391046ab85..ecc42e12b1 100755 --- a/qa/pull-tester/run-bitcoind-for-test.sh.in +++ b/qa/pull-tester/run-bitcoind-for-test.sh.in @@ -10,7 +10,7 @@ touch "$DATADIR/regtest/debug.log" tail -q -n 1 -F "$DATADIR/regtest/debug.log" | grep -m 1 -q "Done loading" & WAITER=$! PORT=`expr $BASHPID + 10000` -"@abs_top_builddir@/src/bitcoind@EXEEXT@" -connect=0.0.0.0 -datadir="$DATADIR" -rpcuser=user -rpcpassword=pass -listen -keypool=3 -debug -debug=net -logtimestamps -port=$PORT -regtest -rpcport=`expr $PORT + 1` & +"@abs_top_builddir@/src/bitcoind@EXEEXT@" -connect=0.0.0.0 -datadir="$DATADIR" -rpcuser=user -rpcpassword=pass -listen -keypool=3 -debug -debug=net -logtimestamps -port=$PORT -whitelist=127.0.0.1 -regtest -rpcport=`expr $PORT + 1` & BITCOIND=$! #Install a watchdog. diff --git a/src/init.cpp b/src/init.cpp index a1d75c9674..492070cbd9 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -58,7 +58,8 @@ CWallet* pwalletMain; enum BindFlags { BF_NONE = 0, BF_EXPLICIT = (1U << 0), - BF_REPORT_ERROR = (1U << 1) + BF_REPORT_ERROR = (1U << 1), + BF_WHITELIST = (1U << 2), }; static const char* FEE_ESTIMATES_FILENAME="fee_estimates.dat"; @@ -192,7 +193,7 @@ bool static Bind(const CService &addr, unsigned int flags) { if (!(flags & BF_EXPLICIT) && IsLimited(addr)) return false; std::string strError; - if (!BindListenPort(addr, strError)) { + if (!BindListenPort(addr, strError, flags & BF_WHITELIST)) { if (flags & BF_REPORT_ERROR) return InitError(strError); return false; @@ -253,6 +254,8 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -upnp " + _("Use UPnP to map the listening port (default: 0)") + "\n"; #endif #endif + strUsage += " -whitebind= " + _("Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6") + "\n"; + strUsage += " -whitelist= " + _("Whitelist peers connecting from the given netmask or ip. Can be specified multiple times.") + "\n"; #ifdef ENABLE_WALLET strUsage += "\n" + _("Wallet options:") + "\n"; @@ -504,11 +507,11 @@ bool AppInit2(boost::thread_group& threadGroup) // ********************************************************* Step 2: parameter interactions - if (mapArgs.count("-bind")) { + if (mapArgs.count("-bind") || mapArgs.count("-whitebind")) { // when specifying an explicit binding address, you want to listen on it // even when -connect or -proxy is specified if (SoftSetBoolArg("-listen", true)) - LogPrintf("AppInit2 : parameter interaction: -bind set -> setting -listen=1\n"); + LogPrintf("AppInit2 : parameter interaction: -bind or -whitebind set -> setting -listen=1\n"); } if (mapArgs.count("-connect") && mapMultiArgs["-connect"].size() > 0) { @@ -552,7 +555,7 @@ bool AppInit2(boost::thread_group& threadGroup) } // Make sure enough file descriptors are available - int nBind = std::max((int)mapArgs.count("-bind"), 1); + int nBind = std::max((int)mapArgs.count("-bind") + (int)mapArgs.count("-whitebind"), 1); nMaxConnections = GetArg("-maxconnections", 125); nMaxConnections = std::max(std::min(nMaxConnections, (int)(FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS)), 0); int nFD = RaiseFileDescriptorLimit(nMaxConnections + MIN_CORE_FILEDESCRIPTORS); @@ -769,6 +772,15 @@ bool AppInit2(boost::thread_group& threadGroup) } } + if (mapArgs.count("-whitelist")) { + BOOST_FOREACH(const std::string& net, mapMultiArgs["-whitelist"]) { + CSubNet subnet(net); + if (!subnet.IsValid()) + return InitError(strprintf(_("Invalid netmask specified in -whitelist: '%s'"), net)); + CNode::AddWhitelistedRange(subnet); + } + } + CService addrProxy; bool fProxy = false; if (mapArgs.count("-proxy")) { @@ -805,13 +817,21 @@ bool AppInit2(boost::thread_group& threadGroup) bool fBound = false; if (fListen) { - if (mapArgs.count("-bind")) { + if (mapArgs.count("-bind") || mapArgs.count("-whitebind")) { BOOST_FOREACH(std::string strBind, mapMultiArgs["-bind"]) { CService addrBind; if (!Lookup(strBind.c_str(), addrBind, GetListenPort(), false)) return InitError(strprintf(_("Cannot resolve -bind address: '%s'"), strBind)); fBound |= Bind(addrBind, (BF_EXPLICIT | BF_REPORT_ERROR)); } + BOOST_FOREACH(std::string strBind, mapMultiArgs["-whitebind"]) { + CService addrBind; + if (!Lookup(strBind.c_str(), addrBind, 0, false)) + return InitError(strprintf(_("Cannot resolve -whitebind address: '%s'"), strBind)); + if (addrBind.GetPort() == 0) + return InitError(strprintf(_("Need to specify a port with -whitebind: '%s'"), strBind)); + fBound |= Bind(addrBind, (BF_EXPLICIT | BF_REPORT_ERROR | BF_WHITELIST)); + } } else { struct in_addr inaddr_any; diff --git a/src/main.cpp b/src/main.cpp index a9c080ffae..8c119507e6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -210,7 +210,7 @@ struct CBlockReject { struct CNodeState { // Accumulated misbehaviour score for this peer. int nMisbehavior; - // Whether this peer should be disconnected and banned. + // Whether this peer should be disconnected and banned (unless whitelisted). bool fShouldBan; // String name of this peer (debugging/logging purposes). std::string name; @@ -1425,7 +1425,8 @@ void Misbehaving(NodeId pnode, int howmuch) return; state->nMisbehavior += howmuch; - if (state->nMisbehavior >= GetArg("-banscore", 100)) + int banscore = GetArg("-banscore", 100); + if (state->nMisbehavior >= banscore && state->nMisbehavior - howmuch < banscore) { LogPrintf("Misbehaving: %s (%d -> %d) BAN THRESHOLD EXCEEDED\n", state->name, state->nMisbehavior-howmuch, state->nMisbehavior); state->fShouldBan = true; @@ -3947,6 +3948,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, unsigned int nEvicted = LimitOrphanTxSize(MAX_ORPHAN_TRANSACTIONS); if (nEvicted > 0) LogPrint("mempool", "mapOrphan overflow, removed %u tx\n", nEvicted); + } else if (pfrom->fWhitelisted) { + // Always relay transactions received from whitelisted peers, even + // if they are already in the mempool (allowing the node to function + // as a gateway for nodes hidden behind it). + RelayTransaction(tx); } int nDoS = 0; if (state.IsInvalid(nDoS)) @@ -4440,11 +4446,14 @@ bool SendMessages(CNode* pto, bool fSendTrickle) CNodeState &state = *State(pto->GetId()); if (state.fShouldBan) { - if (pto->addr.IsLocal()) - LogPrintf("Warning: not banning local node %s!\n", pto->addr.ToString()); + if (pto->fWhitelisted) + LogPrintf("Warning: not punishing whitelisted peer %s!\n", pto->addr.ToString()); else { pto->fDisconnect = true; - CNode::Ban(pto->addr); + if (pto->addr.IsLocal()) + LogPrintf("Warning: not banning local peer %s!\n", pto->addr.ToString()); + else + CNode::Ban(pto->addr); } state.fShouldBan = false; } diff --git a/src/net.cpp b/src/net.cpp index 6a660dc9bd..6a6d9df6af 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -50,7 +50,16 @@ using namespace std; using namespace boost; -static const int MAX_OUTBOUND_CONNECTIONS = 8; +namespace { + const int MAX_OUTBOUND_CONNECTIONS = 8; + + struct ListenSocket { + SOCKET socket; + bool whitelisted; + + ListenSocket(SOCKET socket, bool whitelisted) : socket(socket), whitelisted(whitelisted) {} + }; +} // // Global state variables @@ -65,7 +74,7 @@ static bool vfLimited[NET_MAX] = {}; static CNode* pnodeLocalHost = NULL; static CNode* pnodeSync = NULL; uint64_t nLocalHostNonce = 0; -static std::vector vhListenSocket; +static std::vector vhListenSocket; CAddrMan addrman; int nMaxConnections = 125; @@ -593,6 +602,24 @@ bool CNode::Ban(const CNetAddr &addr) { return true; } + +std::vector CNode::vWhitelistedRange; +CCriticalSection CNode::cs_vWhitelistedRange; + +bool CNode::IsWhitelistedRange(const CNetAddr &addr) { + LOCK(cs_vWhitelistedRange); + BOOST_FOREACH(const CSubNet& subnet, vWhitelistedRange) { + if (subnet.Match(addr)) + return true; + } + return false; +} + +void CNode::AddWhitelistedRange(const CSubNet &subnet) { + LOCK(cs_vWhitelistedRange); + vWhitelistedRange.push_back(subnet); +} + #undef X #define X(name) stats.name = name void CNode::copyStats(CNodeStats &stats) @@ -609,6 +636,7 @@ void CNode::copyStats(CNodeStats &stats) X(nStartingHeight); X(nSendBytes); X(nRecvBytes); + X(fWhitelisted); stats.fSyncNode = (this == pnodeSync); // It is common for nodes with good ping times to suddenly become lagged, @@ -848,9 +876,9 @@ void ThreadSocketHandler() SOCKET hSocketMax = 0; bool have_fds = false; - BOOST_FOREACH(SOCKET hListenSocket, vhListenSocket) { - FD_SET(hListenSocket, &fdsetRecv); - hSocketMax = max(hSocketMax, hListenSocket); + BOOST_FOREACH(const ListenSocket& hListenSocket, vhListenSocket) { + FD_SET(hListenSocket.socket, &fdsetRecv); + hSocketMax = max(hSocketMax, hListenSocket.socket); have_fds = true; } @@ -917,13 +945,13 @@ void ThreadSocketHandler() // // Accept new connections // - BOOST_FOREACH(SOCKET hListenSocket, vhListenSocket) + BOOST_FOREACH(const ListenSocket& hListenSocket, vhListenSocket) { - if (hListenSocket != INVALID_SOCKET && FD_ISSET(hListenSocket, &fdsetRecv)) + if (hListenSocket.socket != INVALID_SOCKET && FD_ISSET(hListenSocket.socket, &fdsetRecv)) { struct sockaddr_storage sockaddr; socklen_t len = sizeof(sockaddr); - SOCKET hSocket = accept(hListenSocket, (struct sockaddr*)&sockaddr, &len); + SOCKET hSocket = accept(hListenSocket.socket, (struct sockaddr*)&sockaddr, &len); CAddress addr; int nInbound = 0; @@ -931,6 +959,7 @@ void ThreadSocketHandler() if (!addr.SetSockAddr((const struct sockaddr*)&sockaddr)) LogPrintf("Warning: Unknown socket family\n"); + bool whitelisted = hListenSocket.whitelisted || CNode::IsWhitelistedRange(addr); { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) @@ -948,7 +977,7 @@ void ThreadSocketHandler() { closesocket(hSocket); } - else if (CNode::IsBanned(addr)) + else if (CNode::IsBanned(addr) && !whitelisted) { LogPrintf("connection from %s dropped (banned)\n", addr.ToString()); closesocket(hSocket); @@ -957,6 +986,7 @@ void ThreadSocketHandler() { CNode* pnode = new CNode(hSocket, addr, "", true); pnode->AddRef(); + pnode->fWhitelisted = whitelisted; { LOCK(cs_vNodes); @@ -1580,7 +1610,7 @@ void ThreadMessageHandler() -bool BindListenPort(const CService &addrBind, string& strError) +bool BindListenPort(const CService &addrBind, string& strError, bool fWhitelisted) { strError = ""; int nOne = 1; @@ -1661,9 +1691,9 @@ bool BindListenPort(const CService &addrBind, string& strError) return false; } - vhListenSocket.push_back(hListenSocket); + vhListenSocket.push_back(ListenSocket(hListenSocket, fWhitelisted)); - if (addrBind.IsRoutable() && fDiscover) + if (addrBind.IsRoutable() && fDiscover && !fWhitelisted) AddLocal(addrBind, LOCAL_BIND); return true; @@ -1788,9 +1818,9 @@ public: BOOST_FOREACH(CNode* pnode, vNodes) if (pnode->hSocket != INVALID_SOCKET) closesocket(pnode->hSocket); - BOOST_FOREACH(SOCKET hListenSocket, vhListenSocket) - if (hListenSocket != INVALID_SOCKET) - if (closesocket(hListenSocket) == SOCKET_ERROR) + BOOST_FOREACH(ListenSocket& hListenSocket, vhListenSocket) + if (hListenSocket.socket != INVALID_SOCKET) + if (closesocket(hListenSocket.socket) == SOCKET_ERROR) LogPrintf("closesocket(hListenSocket) failed with error %s\n", NetworkErrorString(WSAGetLastError())); // clean up some globals (to help leak detection) diff --git a/src/net.h b/src/net.h index c2a0416455..4e42a1eeb2 100644 --- a/src/net.h +++ b/src/net.h @@ -64,7 +64,7 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest = NULL); bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false); void MapPort(bool fUseUPnP); unsigned short GetListenPort(); -bool BindListenPort(const CService &bindAddr, std::string& strError); +bool BindListenPort(const CService &bindAddr, std::string& strError, bool fWhitelisted = false); void StartNode(boost::thread_group& threadGroup); bool StopNode(); void SocketSendData(CNode *pnode); @@ -154,6 +154,7 @@ public: uint64_t nSendBytes; uint64_t nRecvBytes; bool fSyncNode; + bool fWhitelisted; double dPingTime; double dPingWait; std::string addrLocal; @@ -236,6 +237,7 @@ public: // store the sanitized version in cleanSubVer. The original should be used when dealing with // the network or wire types and the cleaned string used when displayed or logged. std::string strSubVer, cleanSubVer; + bool fWhitelisted; // This peer can bypass DoS banning. bool fOneShot; bool fClient; bool fInbound; @@ -259,6 +261,11 @@ protected: static std::map setBanned; static CCriticalSection cs_setBanned; + // Whitelisted ranges. Any node connecting from these is automatically + // whitelisted (as well as those connecting to whitelisted binds). + static std::vector vWhitelistedRange; + static CCriticalSection cs_vWhitelistedRange; + // Basic fuzz-testing void Fuzz(int nChance); // modifies ssSend @@ -305,6 +312,7 @@ public: addrName = addrNameIn == "" ? addr.ToStringIPPort() : addrNameIn; nVersion = 0; strSubVer = ""; + fWhitelisted = false; fOneShot = false; fClient = false; // set by version message fInbound = fInboundIn; @@ -720,6 +728,9 @@ public: static bool Ban(const CNetAddr &ip); void copyStats(CNodeStats &stats); + static bool IsWhitelistedRange(const CNetAddr &ip); + static void AddWhitelistedRange(const CSubNet &subnet); + // Network stats static void RecordBytesRecv(uint64_t bytes); static void RecordBytesSent(uint64_t bytes); diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index cf2c293caf..680717930b 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -137,6 +137,7 @@ Value getpeerinfo(const Array& params, bool fHelp) obj.push_back(Pair("syncheight", statestats.nSyncHeight)); } obj.push_back(Pair("syncnode", stats.fSyncNode)); + obj.push_back(Pair("whitelisted", stats.fWhitelisted)); ret.push_back(obj); } From 502972f16bae79cf025bf9b63ec8276bc4a236bb Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Wed, 9 Jul 2014 20:50:30 -0300 Subject: [PATCH 0357/1288] Fix Error: No file at @loader_path/libboost_system-mt.dylib --- contrib/macdeploy/macdeployqtplus | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index ce4169a410..fdad28018f 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -211,6 +211,7 @@ def getFrameworks(binaryPath, verbose): libraries = [] for line in otoolLines: + line = line.replace("@loader_path", os.path.dirname(binaryPath)) info = FrameworkInfo.fromOtoolLibraryLine(line.strip()) if info is not None: if verbose >= 3: @@ -307,7 +308,7 @@ def deployFrameworks(frameworks, bundlePath, binaryPath, strip, verbose, deploym if deploymentInfo.qtPath is None and framework.isQtFramework(): deploymentInfo.detectQtPath(framework.frameworkDirectory) - if framework.installName.startswith("@executable_path"): + if framework.installName.startswith("@executable_path") or framework.installName.startswith(bundlePath): if verbose >= 2: print framework.frameworkName, "already deployed, skipping." continue From 954d2e7201fcea7a95c5a95be574a8c0a1f16ce1 Mon Sep 17 00:00:00 2001 From: Ruben Dario Ponticelli Date: Wed, 9 Jul 2014 21:37:27 -0300 Subject: [PATCH 0358/1288] Avoid a segfault on getblock if it can't read a block from disk. --- src/rpcblockchain.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index a67f266a13..253693e624 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -276,7 +276,9 @@ Value getblock(const Array& params, bool fHelp) CBlock block; CBlockIndex* pblockindex = mapBlockIndex[hash]; - ReadBlockFromDisk(block, pblockindex); + + if(!ReadBlockFromDisk(block, pblockindex)) + throw JSONRPCError(RPC_INTERNAL_ERROR, "Can't read block from disk"); if (!fVerbose) { From b60be6be4a87cfe10bc32aefd8327df6c23d46e0 Mon Sep 17 00:00:00 2001 From: Gregory Maxwell Date: Thu, 10 Jul 2014 10:06:43 -0700 Subject: [PATCH 0359/1288] Clean up RPCs that are disabled in safe-mode. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This removes some inconsistencies in what worked and didn't work in safemode. Now only RPCs involved in getting balances or sending funds are disabled. Previously you could mine but not submit blocks— but we may need more blocks to resolve a fork that triggered safe mode in the first place, and the non-submission was not reliable since some miners submit blocks via multiple means. There were also a number of random commands disabled that had nothing to do with the blockchain like verifymessage. Thanks to earlz for pointing out that there were some moderately cheap ways to maliciously trigger safe mode, which brought attention to the fact that safemode wasn't used in a very intelligent way. --- src/rpcserver.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 18fa075101..48b87f5139 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -232,8 +232,8 @@ static const CRPCCommand vRPCCommands[] = { "getblockchaininfo", &getblockchaininfo, true, false, false }, { "getbestblockhash", &getbestblockhash, true, false, false }, { "getblockcount", &getblockcount, true, false, false }, - { "getblock", &getblock, false, false, false }, - { "getblockhash", &getblockhash, false, false, false }, + { "getblock", &getblock, true, false, false }, + { "getblockhash", &getblockhash, true, false, false }, { "getdifficulty", &getdifficulty, true, false, false }, { "getrawmempool", &getrawmempool, true, false, false }, { "gettxout", &gettxout, true, false, false }, @@ -245,32 +245,32 @@ static const CRPCCommand vRPCCommands[] = { "getmininginfo", &getmininginfo, true, false, false }, { "getnetworkhashps", &getnetworkhashps, true, false, false }, { "prioritisetransaction", &prioritisetransaction, true, false, false }, - { "submitblock", &submitblock, false, true, false }, + { "submitblock", &submitblock, true, true, false }, /* Raw transactions */ - { "createrawtransaction", &createrawtransaction, false, false, false }, - { "decoderawtransaction", &decoderawtransaction, false, false, false }, - { "decodescript", &decodescript, false, false, false }, - { "getrawtransaction", &getrawtransaction, false, false, false }, + { "createrawtransaction", &createrawtransaction, true, false, false }, + { "decoderawtransaction", &decoderawtransaction, true, false, false }, + { "decodescript", &decodescript, true, false, false }, + { "getrawtransaction", &getrawtransaction, true, false, false }, { "sendrawtransaction", &sendrawtransaction, false, false, false }, { "signrawtransaction", &signrawtransaction, false, false, false }, /* uses wallet if enabled */ /* Utility functions */ { "createmultisig", &createmultisig, true, true , false }, { "validateaddress", &validateaddress, true, false, false }, /* uses wallet if enabled */ - { "verifymessage", &verifymessage, false, false, false }, + { "verifymessage", &verifymessage, true, false, false }, { "estimatefee", &estimatefee, true, true, false }, { "estimatepriority", &estimatepriority, true, true, false }, #ifdef ENABLE_WALLET /* Wallet */ - { "addmultisigaddress", &addmultisigaddress, false, false, true }, + { "addmultisigaddress", &addmultisigaddress, true, false, true }, { "backupwallet", &backupwallet, true, false, true }, { "dumpprivkey", &dumpprivkey, true, false, true }, { "dumpwallet", &dumpwallet, true, false, true }, - { "encryptwallet", &encryptwallet, false, false, true }, + { "encryptwallet", &encryptwallet, true, false, true }, { "getaccountaddress", &getaccountaddress, true, false, true }, - { "getaccount", &getaccount, false, false, true }, + { "getaccount", &getaccount, true, false, true }, { "getaddressesbyaccount", &getaddressesbyaccount, true, false, true }, { "getbalance", &getbalance, false, false, true }, { "getnewaddress", &getnewaddress, true, false, true }, @@ -279,10 +279,10 @@ static const CRPCCommand vRPCCommands[] = { "getreceivedbyaddress", &getreceivedbyaddress, false, false, true }, { "gettransaction", &gettransaction, false, false, true }, { "getunconfirmedbalance", &getunconfirmedbalance, false, false, true }, - { "getwalletinfo", &getwalletinfo, true, false, true }, - { "importprivkey", &importprivkey, false, false, true }, - { "importwallet", &importwallet, false, false, true }, - { "importaddress", &importaddress, false, false, true }, + { "getwalletinfo", &getwalletinfo, false, false, true }, + { "importprivkey", &importprivkey, true, false, true }, + { "importwallet", &importwallet, true, false, true }, + { "importaddress", &importaddress, true, false, true }, { "keypoolrefill", &keypoolrefill, true, false, true }, { "listaccounts", &listaccounts, false, false, true }, { "listaddressgroupings", &listaddressgroupings, false, false, true }, @@ -292,16 +292,16 @@ static const CRPCCommand vRPCCommands[] = { "listsinceblock", &listsinceblock, false, false, true }, { "listtransactions", &listtransactions, false, false, true }, { "listunspent", &listunspent, false, false, true }, - { "lockunspent", &lockunspent, false, false, true }, + { "lockunspent", &lockunspent, true, false, true }, { "move", &movecmd, false, false, true }, { "sendfrom", &sendfrom, false, false, true }, { "sendmany", &sendmany, false, false, true }, { "sendtoaddress", &sendtoaddress, false, false, true }, { "setaccount", &setaccount, true, false, true }, - { "settxfee", &settxfee, false, false, true }, - { "signmessage", &signmessage, false, false, true }, + { "settxfee", &settxfee, true, false, true }, + { "signmessage", &signmessage, true, false, true }, { "walletlock", &walletlock, true, false, true }, - { "walletpassphrasechange", &walletpassphrasechange, false, false, true }, + { "walletpassphrasechange", &walletpassphrasechange, true, false, true }, { "walletpassphrase", &walletpassphrase, true, false, true }, /* Wallet-enabled mining */ From ff6a7af154f2151c93a06b7ee86c167603c5ac55 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sun, 13 May 2012 04:43:24 +0000 Subject: [PATCH 0360/1288] getblocktemplate: longpolling support --- src/main.cpp | 5 ++++ src/main.h | 2 ++ src/rpcmining.cpp | 60 ++++++++++++++++++++++++++++++++++++++++++++++- src/rpcserver.cpp | 11 +++++++++ src/rpcserver.h | 2 ++ src/sync.h | 3 +++ 6 files changed, 82 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index a9c080ffae..9e97a91682 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -41,6 +41,8 @@ CCriticalSection cs_main; map mapBlockIndex; CChain chainActive; int64_t nTimeBestReceived = 0; +CWaitableCriticalSection csBestBlock; +CConditionVariable cvBlockChange; int nScriptCheckThreads = 0; bool fImporting = false; bool fReindex = false; @@ -1944,11 +1946,14 @@ void static UpdateTip(CBlockIndex *pindexNew) { // New best block nTimeBestReceived = GetTime(); mempool.AddTransactionsUpdated(1); + LogPrintf("UpdateTip: new best=%s height=%d log2_work=%.8g tx=%lu date=%s progress=%f\n", chainActive.Tip()->GetBlockHash().ToString(), chainActive.Height(), log(chainActive.Tip()->nChainWork.getdouble())/log(2.0), (unsigned long)chainActive.Tip()->nChainTx, DateTimeStrFormat("%Y-%m-%d %H:%M:%S", chainActive.Tip()->GetBlockTime()), Checkpoints::GuessVerificationProgress(chainActive.Tip())); + cvBlockChange.notify_all(); + // Check the version of the last 100 blocks to see if we need to upgrade: if (!fIsInitialDownload) { diff --git a/src/main.h b/src/main.h index f6bac889be..a683412571 100644 --- a/src/main.h +++ b/src/main.h @@ -87,6 +87,8 @@ extern uint64_t nLastBlockTx; extern uint64_t nLastBlockSize; extern const std::string strMessageMagic; extern int64_t nTimeBestReceived; +extern CWaitableCriticalSection csBestBlock; +extern CConditionVariable cvBlockChange; extern bool fImporting; extern bool fReindex; extern bool fBenchmark; diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index c7621dc137..6f72ea7404 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -324,6 +324,7 @@ Value getblocktemplate(const Array& params, bool fHelp) ); std::string strMode = "template"; + Value lpval = Value::null; if (params.size() > 0) { const Object& oparam = params[0].get_obj(); @@ -336,6 +337,7 @@ Value getblocktemplate(const Array& params, bool fHelp) } else throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode"); + lpval = find_value(oparam, "longpollid"); } if (strMode != "template") @@ -347,8 +349,63 @@ Value getblocktemplate(const Array& params, bool fHelp) if (IsInitialBlockDownload()) throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Bitcoin is downloading blocks..."); - // Update block static unsigned int nTransactionsUpdatedLast; + + if (lpval.type() != null_type) + { + // Wait to respond until either the best block changes, OR a minute has passed and there are more transactions + uint256 hashWatchedChain; + boost::system_time checktxtime; + unsigned int nTransactionsUpdatedLastLP; + + if (lpval.type() == str_type) + { + // Format: + std::string lpstr = lpval.get_str(); + + hashWatchedChain.SetHex(lpstr.substr(0, 64)); + nTransactionsUpdatedLastLP = atoi64(lpstr.substr(64)); + } + else + { + // NOTE: Spec does not specify behaviour for non-string longpollid, but this makes testing easier + hashWatchedChain = chainActive.Tip()->GetBlockHash(); + nTransactionsUpdatedLastLP = nTransactionsUpdatedLast; + } + + // Release the wallet and main lock while waiting +#ifdef ENABLE_WALLET + if(pwalletMain) + LEAVE_CRITICAL_SECTION(pwalletMain->cs_wallet); +#endif + LEAVE_CRITICAL_SECTION(cs_main); + { + checktxtime = boost::get_system_time() + boost::posix_time::minutes(1); + + boost::unique_lock lock(csBestBlock); + while (chainActive.Tip()->GetBlockHash() == hashWatchedChain && IsRPCRunning()) + { + if (!cvBlockChange.timed_wait(lock, checktxtime)) + { + // Timeout: Check transactions for update + if (mempool.GetTransactionsUpdated() != nTransactionsUpdatedLastLP) + break; + checktxtime += boost::posix_time::seconds(10); + } + } + } + ENTER_CRITICAL_SECTION(cs_main); +#ifdef ENABLE_WALLET + if(pwalletMain) + ENTER_CRITICAL_SECTION(pwalletMain->cs_wallet); +#endif + + if (!IsRPCRunning()) + throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Shutting down"); + // TODO: Maybe recheck connections/IBD and (if something wrong) send an expires-immediately template to stop miners? + } + + // Update block static CBlockIndex* pindexPrev; static int64_t nStart; static CBlockTemplate* pblocktemplate; @@ -436,6 +493,7 @@ Value getblocktemplate(const Array& params, bool fHelp) result.push_back(Pair("transactions", transactions)); result.push_back(Pair("coinbaseaux", aux)); result.push_back(Pair("coinbasevalue", (int64_t)pblock->vtx[0].vout[0].nValue)); + result.push_back(Pair("longpollid", chainActive.Tip()->GetBlockHash().GetHex() + i64tostr(nTransactionsUpdatedLast))); result.push_back(Pair("target", hashTarget.GetHex())); result.push_back(Pair("mintime", (int64_t)pindexPrev->GetMedianTimePast()+1)); result.push_back(Pair("mutable", aMutable)); diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 18fa075101..bb8e56c785 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -32,6 +32,7 @@ using namespace std; static std::string strRPCUserColonPass; +static bool fRPCRunning = false; // These are created by StartRPCThreads, destroyed in StopRPCThreads static asio::io_service* rpc_io_service = NULL; static map > deadlineTimers; @@ -659,6 +660,7 @@ void StartRPCThreads() rpc_worker_group = new boost::thread_group(); for (int i = 0; i < GetArg("-rpcthreads", 4); i++) rpc_worker_group->create_thread(boost::bind(&asio::io_service::run, rpc_io_service)); + fRPCRunning = true; } void StartDummyRPCThread() @@ -671,12 +673,15 @@ void StartDummyRPCThread() rpc_dummy_work = new asio::io_service::work(*rpc_io_service); rpc_worker_group = new boost::thread_group(); rpc_worker_group->create_thread(boost::bind(&asio::io_service::run, rpc_io_service)); + fRPCRunning = true; } } void StopRPCThreads() { if (rpc_io_service == NULL) return; + // Set this to false first, so that longpolling loops will exit when woken up + fRPCRunning = false; // First, cancel all timers and acceptors // This is not done automatically by ->stop(), and in some cases the destructor of @@ -698,6 +703,7 @@ void StopRPCThreads() deadlineTimers.clear(); rpc_io_service->stop(); + cvBlockChange.notify_all(); if (rpc_worker_group != NULL) rpc_worker_group->join_all(); delete rpc_dummy_work; rpc_dummy_work = NULL; @@ -706,6 +712,11 @@ void StopRPCThreads() delete rpc_io_service; rpc_io_service = NULL; } +bool IsRPCRunning() +{ + return fRPCRunning; +} + void RPCRunHandler(const boost::system::error_code& err, boost::function func) { if (!err) diff --git a/src/rpcserver.h b/src/rpcserver.h index e32eb975a1..31badadd6d 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -40,6 +40,8 @@ void StartRPCThreads(); void StartDummyRPCThread(); /* Stop RPC threads */ void StopRPCThreads(); +/* Query whether RPC is running */ +bool IsRPCRunning(); /* Type-check arguments; throws JSONRPCError if wrong type given. Does not check that diff --git a/src/sync.h b/src/sync.h index 077ed59b89..cd319e0171 100644 --- a/src/sync.h +++ b/src/sync.h @@ -84,6 +84,9 @@ typedef AnnotatedMixin CCriticalSection; /** Wrapped boost mutex: supports waiting but not recursive locking */ typedef AnnotatedMixin CWaitableCriticalSection; +/** Just a typedef for boost::condition_variable, can be wrapped later if desired */ +typedef boost::condition_variable CConditionVariable; + #ifdef DEBUG_LOCKORDER void EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry = false); void LeaveCritical(); From b45a6e8394e8c9e2886ae8b9aa0734996448ff37 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 11 Jul 2014 14:39:50 +0200 Subject: [PATCH 0361/1288] Add test for getblocktemplate longpolling --- qa/rpc-tests/getblocktemplate.py | 94 ++++++++++++++++++++++++++++++++ qa/rpc-tests/util.py | 4 +- 2 files changed, 97 insertions(+), 1 deletion(-) create mode 100755 qa/rpc-tests/getblocktemplate.py diff --git a/qa/rpc-tests/getblocktemplate.py b/qa/rpc-tests/getblocktemplate.py new file mode 100755 index 0000000000..8d97719ec3 --- /dev/null +++ b/qa/rpc-tests/getblocktemplate.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +# Copyright (c) 2014 The Bitcoin Core developers +# Distributed under the MIT/X11 software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +# Exercise the listtransactions API + +from test_framework import BitcoinTestFramework +from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException +from util import * + + +def check_array_result(object_array, to_match, expected): + """ + Pass in array of JSON objects, a dictionary with key/value pairs + to match against, and another dictionary with expected key/value + pairs. + """ + num_matched = 0 + for item in object_array: + all_match = True + for key,value in to_match.items(): + if item[key] != value: + all_match = False + if not all_match: + continue + for key,value in expected.items(): + if item[key] != value: + raise AssertionError("%s : expected %s=%s"%(str(item), str(key), str(value))) + num_matched = num_matched+1 + if num_matched == 0: + raise AssertionError("No objects matched %s"%(str(to_match))) + +import threading + +class LongpollThread(threading.Thread): + def __init__(self, node): + threading.Thread.__init__(self) + # query current longpollid + templat = node.getblocktemplate() + self.longpollid = templat['longpollid'] + # create a new connection to the node, we can't use the same + # connection from two threads + self.node = AuthServiceProxy(node.url, timeout=600) + + def run(self): + self.node.getblocktemplate({'longpollid':self.longpollid}) + +class GetBlockTemplateTest(BitcoinTestFramework): + ''' + Test longpolling with getblocktemplate. + ''' + + def run_test(self, nodes): + print "Warning: this test will take about 70 seconds in the best case. Be patient." + nodes[0].setgenerate(True, 10) + templat = nodes[0].getblocktemplate() + longpollid = templat['longpollid'] + # longpollid should not change between successive invocations if nothing else happens + templat2 = nodes[0].getblocktemplate() + assert(templat2['longpollid'] == longpollid) + + # Test 1: test that the longpolling wait if we do nothing + thr = LongpollThread(nodes[0]) + thr.start() + # check that thread still lives + thr.join(5) # wait 5 seconds or until thread exits + assert(thr.is_alive()) + + # Test 2: test that longpoll will terminate if another node generates a block + nodes[1].setgenerate(True, 1) # generate a block on another node + # check that thread will exit now that new transaction entered mempool + thr.join(5) # wait 5 seconds or until thread exits + assert(not thr.is_alive()) + + # Test 3: test that longpoll will terminate if we generate a block ourselves + thr = LongpollThread(nodes[0]) + thr.start() + nodes[0].setgenerate(True, 1) # generate a block on another node + thr.join(5) # wait 5 seconds or until thread exits + assert(not thr.is_alive()) + + # Test 4: test that introducing a new transaction into the mempool will terminate the longpoll + thr = LongpollThread(nodes[0]) + thr.start() + # generate a random transaction and submit it + (txid, txhex, fee) = random_transaction(nodes, Decimal("1.1"), Decimal("0.0"), Decimal("0.001"), 20) + # after one minute, every 10 seconds the mempool is probed, so in 80 seconds it should have returned + thr.join(60 + 20) + assert(not thr.is_alive()) + +if __name__ == '__main__': + GetBlockTemplateTest().main() + diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index 0a7f26ffcd..fc7ae85776 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -156,7 +156,9 @@ def start_node(i, dir, extra_args=None, rpchost=None): ["-rpcwait", "getblockcount"], stdout=devnull) devnull.close() url = "http://rt:rt@%s:%d" % (rpchost or '127.0.0.1', rpc_port(i)) - return AuthServiceProxy(url) + proxy = AuthServiceProxy(url) + proxy.url = url # store URL on proxy for info + return proxy def start_nodes(num_nodes, dir, extra_args=None, rpchost=None): """ From 6c37f7fd78832442a26e56bd0787974927df4fb2 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 16 Jun 2014 14:45:32 +0200 Subject: [PATCH 0362/1288] `getrawchangeaddress` should fail when keypool exhausted An user on IRC reported an issue where `getrawchangeaddress` keeps returning a single address when the keypool is exhausted. In my opinion this is strange behaviour. - Change CReserveKey to fail when running out of keys in the keypool. - Make `getrawchangeaddress` return RPC_WALLET_KEYPOOL_RAN_OUT when unable to create an address. - Add a Python RPC test for checking the keypool behaviour in combination with encrypted wallets. --- qa/rpc-tests/keypool.py | 132 ++++++++++++++++++++++++++++++++++++++++ src/miner.cpp | 3 + src/rpcwallet.cpp | 2 +- src/wallet.cpp | 6 +- 4 files changed, 137 insertions(+), 6 deletions(-) create mode 100755 qa/rpc-tests/keypool.py diff --git a/qa/rpc-tests/keypool.py b/qa/rpc-tests/keypool.py new file mode 100755 index 0000000000..86ad20de52 --- /dev/null +++ b/qa/rpc-tests/keypool.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python +# Copyright (c) 2014 The Bitcoin Core developers +# Distributed under the MIT/X11 software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +# Exercise the wallet keypool, and interaction with wallet encryption/locking + +# Add python-bitcoinrpc to module search path: +import os +import sys +sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc")) + +import json +import shutil +import subprocess +import tempfile +import traceback + +from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException +from util import * + + +def check_array_result(object_array, to_match, expected): + """ + Pass in array of JSON objects, a dictionary with key/value pairs + to match against, and another dictionary with expected key/value + pairs. + """ + num_matched = 0 + for item in object_array: + all_match = True + for key,value in to_match.items(): + if item[key] != value: + all_match = False + if not all_match: + continue + for key,value in expected.items(): + if item[key] != value: + raise AssertionError("%s : expected %s=%s"%(str(item), str(key), str(value))) + num_matched = num_matched+1 + if num_matched == 0: + raise AssertionError("No objects matched %s"%(str(to_match))) + +def run_test(nodes, tmpdir): + # Encrypt wallet and wait to terminate + nodes[0].encryptwallet('test') + bitcoind_processes[0].wait() + # Restart node 0 + nodes[0] = start_node(0, tmpdir) + # Keep creating keys + addr = nodes[0].getnewaddress() + try: + addr = nodes[0].getnewaddress() + raise AssertionError('Keypool should be exhausted after one address') + except JSONRPCException,e: + assert(e.error['code']==-12) + + # put three new keys in the keypool + nodes[0].walletpassphrase('test', 12000) + nodes[0].keypoolrefill(3) + nodes[0].walletlock() + + # drain the keys + addr = set() + addr.add(nodes[0].getrawchangeaddress()) + addr.add(nodes[0].getrawchangeaddress()) + addr.add(nodes[0].getrawchangeaddress()) + addr.add(nodes[0].getrawchangeaddress()) + # assert that four unique addresses were returned + assert(len(addr) == 4) + # the next one should fail + try: + addr = nodes[0].getrawchangeaddress() + raise AssertionError('Keypool should be exhausted after three addresses') + except JSONRPCException,e: + assert(e.error['code']==-12) + + +def main(): + import optparse + + parser = optparse.OptionParser(usage="%prog [options]") + parser.add_option("--nocleanup", dest="nocleanup", default=False, action="store_true", + help="Leave bitcoinds and test.* datadir on exit or error") + parser.add_option("--srcdir", dest="srcdir", default="../../src", + help="Source directory containing bitcoind/bitcoin-cli (default: %default%)") + parser.add_option("--tmpdir", dest="tmpdir", default=tempfile.mkdtemp(prefix="test"), + help="Root directory for datadirs") + (options, args) = parser.parse_args() + + os.environ['PATH'] = options.srcdir+":"+os.environ['PATH'] + + check_json_precision() + + success = False + nodes = [] + try: + print("Initializing test directory "+options.tmpdir) + if not os.path.isdir(options.tmpdir): + os.makedirs(options.tmpdir) + initialize_chain(options.tmpdir) + + nodes = start_nodes(1, options.tmpdir) + + run_test(nodes, options.tmpdir) + + success = True + + except AssertionError as e: + print("Assertion failed: "+e.message) + except JSONRPCException as e: + print("JSONRPC error: "+e.error['message']) + traceback.print_tb(sys.exc_info()[2]) + except Exception as e: + print("Unexpected exception caught during testing: "+str(sys.exc_info()[0])) + traceback.print_tb(sys.exc_info()[2]) + + if not options.nocleanup: + print("Cleaning up") + stop_nodes(nodes) + wait_bitcoinds() + shutil.rmtree(options.tmpdir) + + if success: + print("Tests successful") + sys.exit(0) + else: + print("Failed") + sys.exit(1) + +if __name__ == '__main__': + main() diff --git a/src/miner.cpp b/src/miner.cpp index 17918a1280..ec56c71192 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -467,7 +467,10 @@ void static BitcoinMiner(CWallet *pwallet) auto_ptr pblocktemplate(CreateNewBlockWithKey(reservekey)); if (!pblocktemplate.get()) + { + LogPrintf("Error in BitcoinMiner: Keypool ran out, please call keypoolrefill before restarting the mining thread\n"); return; + } CBlock *pblock = &pblocktemplate->block; IncrementExtraNonce(pblock, pindexPrev, nExtraNonce); diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 1e46129065..e8c62fd37b 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -201,7 +201,7 @@ Value getrawchangeaddress(const Array& params, bool fHelp) CReserveKey reservekey(pwalletMain); CPubKey vchPubKey; if (!reservekey.GetReservedKey(vchPubKey)) - throw JSONRPCError(RPC_WALLET_ERROR, "Error: Unable to obtain key for change"); + throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first"); reservekey.KeepKey(); diff --git a/src/wallet.cpp b/src/wallet.cpp index a54494f935..8fdc5f4b20 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -2010,11 +2010,7 @@ bool CReserveKey::GetReservedKey(CPubKey& pubkey) if (nIndex != -1) vchPubKey = keypool.vchPubKey; else { - if (pwallet->vchDefaultKey.IsValid()) { - LogPrintf("CReserveKey::GetReservedKey(): Warning: Using default key instead of a new key, top up your keypool!"); - vchPubKey = pwallet->vchDefaultKey; - } else - return false; + return false; } } assert(vchPubKey.IsValid()); From 714a3e6505d986d064d3a34038a724ac1cad5308 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 9 Jul 2014 18:04:18 +0200 Subject: [PATCH 0363/1288] Only keep setBlockIndexValid entries that are possible improvements --- src/main.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index a9c080ffae..f8e9f16389 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -94,7 +94,9 @@ namespace { }; CBlockIndex *pindexBestInvalid; - // may contain all CBlockIndex*'s that have validness >=BLOCK_VALID_TRANSACTIONS, and must contain those who aren't failed + + // The set of all CBlockIndex entries with BLOCK_VALID_TRANSACTIONS or better that are at least + // as good as our current tip. Entries may be failed, though. set setBlockIndexValid; CCriticalSection cs_LastBlockFile; @@ -2129,6 +2131,15 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo return false; } } else { + // Delete all entries in setBlockIndexValid that are worse than our new current block. + // Note that we can't delete the current block itself, as we may need to return to it later in case a + // reorganization to a better block fails. + std::set::iterator it = setBlockIndexValid.begin(); + while (setBlockIndexValid.value_comp()(*it, chainActive.Tip())) { + setBlockIndexValid.erase(it++); + } + // Either the current tip or a successor of it we're working towards is left in setBlockIndexValid. + assert(!setBlockIndexValid.empty()); if (!pindexOldTip || chainActive.Tip()->nChainWork > pindexOldTip->nChainWork) { // We're in a better position than we were. Return temporarily to release the lock. break; From d4d3fbd828a477e8459169a097d5f1bfb69c2781 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 10 Jul 2014 17:35:22 +0200 Subject: [PATCH 0364/1288] Do not flush the cache after every block outside of IBD --- src/coins.cpp | 7 ++++++- src/main.cpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/coins.cpp b/src/coins.cpp index 13a4ea95cd..3ab03e047f 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -107,7 +107,12 @@ bool CCoinsViewCache::SetCoins(const uint256 &txid, const CCoins &coins) { } bool CCoinsViewCache::HaveCoins(const uint256 &txid) { - return FetchCoins(txid) != cacheCoins.end(); + CCoinsMap::iterator it = FetchCoins(txid); + // We're using vtx.empty() instead of IsPruned here for performance reasons, + // as we only care about the case where an transaction was replaced entirely + // in a reorganization (which wipes vout entirely, as opposed to spending + // which just cleans individual outputs). + return (it != cacheCoins.end() && !it->second.vout.empty()); } uint256 CCoinsViewCache::GetBestBlock() { diff --git a/src/main.cpp b/src/main.cpp index a9c080ffae..80a6956d19 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1915,7 +1915,7 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C // Update the on-disk chain state. bool static WriteChainState(CValidationState &state) { static int64_t nLastWrite = 0; - if (!IsInitialBlockDownload() || pcoinsTip->GetCacheSize() > nCoinCacheSize || GetTimeMicros() > nLastWrite + 600*1000000) { + if (pcoinsTip->GetCacheSize() > nCoinCacheSize || (!IsInitialBlockDownload() && GetTimeMicros() > nLastWrite + 600*1000000)) { // Typical CCoins structures on disk are around 100 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 From 6b407e4e56dc82a8591c668401add49b6d128c87 Mon Sep 17 00:00:00 2001 From: Zak Wilcox Date: Sat, 12 Jul 2014 02:05:09 +0100 Subject: [PATCH 0365/1288] -datadir is now allowed in config files --- contrib/debian/manpages/bitcoin.conf.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/debian/manpages/bitcoin.conf.5 b/contrib/debian/manpages/bitcoin.conf.5 index 7438b4b66a..8a0078d5d5 100644 --- a/contrib/debian/manpages/bitcoin.conf.5 +++ b/contrib/debian/manpages/bitcoin.conf.5 @@ -2,7 +2,7 @@ .SH NAME bitcoin.conf \- bitcoin configuration file .SH SYNOPSIS -All command-line options (except for '\-datadir' and '\-conf') may be specified in a configuration file, and all configuration file options may also be specified on the command line. Command-line options override values set in the configuration file. +All command-line options (except for '\-conf') may be specified in a configuration file, and all configuration file options may also be specified on the command line. Command-line options override values set in the configuration file. .TP The configuration file is a list of 'setting=value' pairs, one per line, with optional comments starting with the '#' character. .TP From a7e1d503c404b59fc58ad6d4359ba8835d125bac Mon Sep 17 00:00:00 2001 From: Zak Wilcox Date: Sat, 12 Jul 2014 06:43:41 +0100 Subject: [PATCH 0366/1288] In -? output: -keypool, -gen, -genproclimit depend on ENABLE_WALLET --- src/init.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index a1d75c9674..3f068da89f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -218,7 +218,6 @@ std::string HelpMessage(HelpMessageMode mode) } strUsage += " -datadir=
" + _("Specify data directory") + "\n"; strUsage += " -dbcache= " + strprintf(_("Set database cache size in megabytes (%d to %d, default: %d)"), nMinDbCache, nMaxDbCache, nDefaultDbCache) + "\n"; - strUsage += " -keypool= " + _("Set key pool size to (default: 100)") + "\n"; strUsage += " -loadblock= " + _("Imports blocks from external blk000??.dat file") + " " + _("on startup") + "\n"; strUsage += " -maxorphanblocks= " + strprintf(_("Keep at most unconnectable blocks in memory (default: %u)"), DEFAULT_MAX_ORPHAN_BLOCKS) + "\n"; strUsage += " -par= " + strprintf(_("Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)"), -(int)boost::thread::hardware_concurrency(), MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS) + "\n"; @@ -257,6 +256,7 @@ std::string HelpMessage(HelpMessageMode mode) #ifdef ENABLE_WALLET strUsage += "\n" + _("Wallet options:") + "\n"; strUsage += " -disablewallet " + _("Do not load the wallet and disable wallet RPC calls") + "\n"; + strUsage += " -keypool= " + _("Set key pool size to (default: 100)") + "\n"; if (GetBoolArg("-help-debug", false)) strUsage += " -mintxfee= " + strprintf(_("Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s)"), FormatMoney(CWallet::minTxFee.GetFeePerK())) + "\n"; strUsage += " -paytxfee= " + strprintf(_("Fee (in BTC/kB) to add to transactions you send (default: %s)"), FormatMoney(payTxFee.GetFeePerK())) + "\n"; @@ -292,8 +292,10 @@ std::string HelpMessage(HelpMessageMode mode) if (mode == HMM_BITCOIN_QT) strUsage += ", qt"; strUsage += ".\n"; +#ifdef ENABLE_WALLET strUsage += " -gen " + _("Generate coins (default: 0)") + "\n"; strUsage += " -genproclimit= " + _("Set the processor limit for when generation is on (-1 = unlimited, default: -1)") + "\n"; +#endif strUsage += " -help-debug " + _("Show all debugging options (usage: --help -help-debug)") + "\n"; strUsage += " -logips " + _("Include IP addresses in debug output (default: 0)") + "\n"; strUsage += " -logtimestamps " + _("Prepend debug output with timestamp (default: 1)") + "\n"; From 6265ecc87f766faad4b950ea0c89e77e0e7e076a Mon Sep 17 00:00:00 2001 From: Zak Wilcox Date: Sat, 12 Jul 2014 09:21:02 +0100 Subject: [PATCH 0367/1288] Clarify that redeemScript is often optional --- src/rpcrawtransaction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 2306b1b883..1efe38e830 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -523,7 +523,7 @@ Value signrawtransaction(const Array& params, bool fHelp) " \"txid\":\"id\", (string, required) The transaction id\n" " \"vout\":n, (numeric, required) The output number\n" " \"scriptPubKey\": \"hex\", (string, required) script key\n" - " \"redeemScript\": \"hex\" (string, required) redeem script\n" + " \"redeemScript\": \"hex\" (string, required for P2SH) redeem script\n" " }\n" " ,...\n" " ]\n" From 76fd7b8c2677dc145a67e86153d629b43d2a92e5 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 13 Jul 2014 06:27:29 +0200 Subject: [PATCH 0368/1288] [Qt] Fix segfault when launched with -disablewallet --- src/qt/bitcoingui.cpp | 11 +++++++---- src/qt/rpcconsole.cpp | 39 +++++++++++++++++++++++++++++---------- src/qt/rpcconsole.h | 2 ++ 3 files changed, 38 insertions(+), 14 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 6b3aa2a2df..3ef04d96ac 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -159,10 +159,13 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : labelEncryptionIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); - frameBlocksLayout->addStretch(); - frameBlocksLayout->addWidget(unitDisplayControl); - frameBlocksLayout->addStretch(); - frameBlocksLayout->addWidget(labelEncryptionIcon); + if(enableWallet) + { + frameBlocksLayout->addStretch(); + frameBlocksLayout->addWidget(unitDisplayControl); + frameBlocksLayout->addStretch(); + frameBlocksLayout->addWidget(labelEncryptionIcon); + } frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index e1f40ddd09..9b67f8125f 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -473,6 +473,10 @@ void RPCConsole::on_tabWidget_currentChanged(int index) { ui->lineEdit->setFocus(); } + else if(ui->tabWidget->widget(index) == ui->tab_peers) + { + initPeerTable(); + } } void RPCConsole::on_openDebugLogfileButton_clicked() @@ -648,17 +652,10 @@ void RPCConsole::updateNodeDetail(const CNodeCombinedStats *combinedStats) ui->peerBanScore->setText(tr("Fetching...")); } -// We override the virtual resizeEvent of the QWidget to adjust tables column -// sizes as the tables width is proportional to the dialogs width. -void RPCConsole::resizeEvent(QResizeEvent *event) +void RPCConsole::initPeerTable() { - QWidget::resizeEvent(event); - columnResizingFixer->stretchColumnWidth(PeerTableModel::Address); -} - -void RPCConsole::showEvent(QShowEvent *event) -{ - QWidget::showEvent(event); + if (!clientModel) + return; // peerWidget needs a resize in case the dialog has non-default geometry columnResizingFixer->stretchColumnWidth(PeerTableModel::Address); @@ -667,10 +664,32 @@ void RPCConsole::showEvent(QShowEvent *event) clientModel->getPeerTableModel()->startAutoRefresh(1000); } +// We override the virtual resizeEvent of the QWidget to adjust tables column +// sizes as the tables width is proportional to the dialogs width. +void RPCConsole::resizeEvent(QResizeEvent *event) +{ + QWidget::resizeEvent(event); + + if (!clientModel) + return; + + columnResizingFixer->stretchColumnWidth(PeerTableModel::Address); +} + +void RPCConsole::showEvent(QShowEvent *event) +{ + QWidget::showEvent(event); + + initPeerTable(); +} + void RPCConsole::hideEvent(QHideEvent *event) { QWidget::hideEvent(event); + if (!clientModel) + return; + // stop PeerTableModel auto refresh clientModel->getPeerTableModel()->stopAutoRefresh(); } diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 3aeff3eace..94672b30cc 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -47,6 +47,8 @@ protected: private: /** show detailed information on ui about selected node */ void updateNodeDetail(const CNodeCombinedStats *combinedStats); + /** initialize peer table */ + void initPeerTable(); enum ColumnWidths { From e3496da7307f3f8e38a27b861d8b496e10e6215b Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 13 Jul 2014 08:14:29 +0200 Subject: [PATCH 0369/1288] [Qt] Fix No such slot UnitDisplayStatusBarControl::onDisplayUnitsClicked --- src/qt/bitcoingui.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 6b3aa2a2df..80d9fbff02 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -1012,7 +1012,7 @@ UnitDisplayStatusBarControl::UnitDisplayStatusBarControl():QLabel() setToolTip(tr("Unit to show amounts in. Click to select another unit.")); } -/** So that it responds to left-button clicks */ +/** So that it responds to button clicks */ void UnitDisplayStatusBarControl::mousePressEvent(QMouseEvent *event) { onDisplayUnitsClicked(event->pos()); @@ -1029,10 +1029,6 @@ void UnitDisplayStatusBarControl::createContextMenu() menu->addAction(menuAction); } connect(menu,SIGNAL(triggered(QAction*)),this,SLOT(onMenuSelection(QAction*))); - - // what happens on right click. - setContextMenuPolicy(Qt::CustomContextMenu); - connect(this,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(onDisplayUnitsClicked(const QPoint&))); } /** Lets the control know about the Options Model (and its signals) */ From 39cc4922fe30a93d10665d913e2e3d51fb94561a Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 13 Jul 2014 09:33:45 +0200 Subject: [PATCH 0370/1288] Fix Watchonly: cs_main lock not held --- src/wallet.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index 8fdc5f4b20..560cbc10b9 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1075,7 +1075,7 @@ int64_t CWallet::GetWatchOnlyBalance() const { int64_t nTotal = 0; { - LOCK(cs_wallet); + LOCK2(cs_main, cs_wallet); for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const CWalletTx* pcoin = &(*it).second; @@ -1091,7 +1091,7 @@ int64_t CWallet::GetUnconfirmedWatchOnlyBalance() const { int64_t nTotal = 0; { - LOCK(cs_wallet); + LOCK2(cs_main, cs_wallet); for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const CWalletTx* pcoin = &(*it).second; @@ -1106,7 +1106,7 @@ int64_t CWallet::GetImmatureWatchOnlyBalance() const { int64_t nTotal = 0; { - LOCK(cs_wallet); + LOCK2(cs_main, cs_wallet); for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const CWalletTx* pcoin = &(*it).second; From 4fad8e6d831729efa1965fa2034e7e51d3d0a1be Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Thu, 8 May 2014 00:18:57 -0400 Subject: [PATCH 0371/1288] Reject transactions with excessive numbers of sigops --- src/main.cpp | 15 ++++++++++++--- src/main.h | 2 ++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a9c080ffae..490b7f56fe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1016,9 +1016,18 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa if (Params().RequireStandard() && !AreInputsStandard(tx, view)) return error("AcceptToMemoryPool: : nonstandard transaction input"); - // Note: if you modify this code to accept non-standard transactions, then - // you should add code here to check that the transaction does a - // reasonable number of ECDSA signature verifications. + // Check that the transaction doesn't have an excessive number of + // sigops, making it impossible to mine. Since the coinbase transaction + // itself can contain sigops MAX_TX_SIGOPS is less than + // MAX_BLOCK_SIGOPS; we still consider this an invalid rather than + // merely non-standard transaction. + unsigned int nSigOps = GetLegacySigOpCount(tx); + nSigOps += GetP2SHSigOpCount(tx, view); + if (nSigOps > MAX_TX_SIGOPS) + return state.DoS(0, + error("AcceptToMemoryPool : too many sigops %s, %d > %d", + hash.ToString(), nSigOps, MAX_TX_SIGOPS), + REJECT_NONSTANDARD, "bad-txns-too-many-sigops"); int64_t nValueOut = tx.GetValueOut(); int64_t nFees = nValueIn-nValueOut; diff --git a/src/main.h b/src/main.h index f6bac889be..547e7305ea 100644 --- a/src/main.h +++ b/src/main.h @@ -45,6 +45,8 @@ static const unsigned int MAX_STANDARD_TX_SIZE = 100000; static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50; /** Maxiumum number of signature check operations in an IsStandard() P2SH script */ static const unsigned int MAX_P2SH_SIGOPS = 15; +/** The maximum number of sigops we're willing to relay/mine in a single tx */ +static const unsigned int MAX_TX_SIGOPS = MAX_BLOCK_SIGOPS/5; /** The maximum number of orphan transactions kept in memory */ static const unsigned int MAX_ORPHAN_TRANSACTIONS = MAX_BLOCK_SIZE/100; /** Default for -maxorphanblocks, maximum number of orphan blocks kept in memory */ From cdf305eeb042eb67c5e53a8b04cf475578b0f8e8 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Sun, 13 Jul 2014 10:41:12 -0700 Subject: [PATCH 0372/1288] Set -discover=0 in regtest framework The regtest framework is local, so often there is no need to discover our external IP. Setting -discover=0 in util.py works around shutdown hang caused by GetExternalIP waiting in recv(). --- qa/rpc-tests/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index 0a7f26ffcd..9d8e9d6a8c 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -85,7 +85,7 @@ def initialize_chain(test_dir): # Create cache directories, run bitcoinds: for i in range(4): datadir=initialize_datadir("cache", i) - args = [ "bitcoind", "-keypool=1", "-datadir="+datadir ] + args = [ "bitcoind", "-keypool=1", "-datadir="+datadir, "-discover=0" ] if i > 0: args.append("-connect=127.0.0.1:"+str(p2p_port(0))) bitcoind_processes[i] = subprocess.Popen(args) @@ -147,7 +147,7 @@ def start_node(i, dir, extra_args=None, rpchost=None): Start a bitcoind and return RPC connection to it """ datadir = os.path.join(dir, "node"+str(i)) - args = [ "bitcoind", "-datadir="+datadir, "-keypool=1" ] + args = [ "bitcoind", "-datadir="+datadir, "-keypool=1", "-discover=0" ] if extra_args is not None: args.extend(extra_args) bitcoind_processes[i] = subprocess.Popen(args) devnull = open("/dev/null", "w+") From 49d57125f953e3e909e5c61d42d66013df8d325e Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 14 Jul 2014 10:46:06 +0200 Subject: [PATCH 0373/1288] qt: Ignore showNormalIfMinimized in initialization or shutdown Also get rid of ui_interface flag NOSHOWGUI. It's up to the GUI to decide this. Fixes #4360. --- src/init.cpp | 4 ++-- src/qt/bitcoingui.cpp | 8 +++----- src/ui_interface.h | 2 -- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 9daad6ac89..99df237b2a 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -179,13 +179,13 @@ void HandleSIGHUP(int) bool static InitError(const std::string &str) { - uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_ERROR | CClientUIInterface::NOSHOWGUI); + uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_ERROR); return false; } bool static InitWarning(const std::string &str) { - uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING | CClientUIInterface::NOSHOWGUI); + uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING); return true; } diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 80d9fbff02..c878417dd2 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -780,11 +780,7 @@ void BitcoinGUI::message(const QString &title, const QString &message, unsigned if (!(buttons = (QMessageBox::StandardButton)(style & CClientUIInterface::BTN_MASK))) buttons = QMessageBox::Ok; - // Ensure we get users attention, but only if main window is visible - // as we don't want to pop up the main window for messages that happen before - // initialization is finished. - if(!(style & CClientUIInterface::NOSHOWGUI)) - showNormalIfMinimized(); + showNormalIfMinimized(); QMessageBox mBox((QMessageBox::Icon)nMBoxIcon, strTitle, message, buttons, this); int r = mBox.exec(); if (ret != NULL) @@ -921,6 +917,8 @@ void BitcoinGUI::setEncryptionStatus(int status) void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden) { + if(!clientModel) + return; // activateWindow() (sometimes) helps with keyboard focus on Windows if (isHidden()) { diff --git a/src/ui_interface.h b/src/ui_interface.h index e9fcd91d41..a48ba237d2 100644 --- a/src/ui_interface.h +++ b/src/ui_interface.h @@ -63,8 +63,6 @@ public: /** Force blocking, modal message box dialog (not just OS notification) */ MODAL = 0x10000000U, - /** Don't bring GUI to foreground. Use for messages during initialization */ - NOSHOWGUI = 0x20000000U, /** Predefined combinations for certain default usage cases */ MSG_INFORMATION = ICON_INFORMATION, From d512534cd71ebdb67bf0cb2a377dc7c2b06ba438 Mon Sep 17 00:00:00 2001 From: JaSK Date: Sat, 12 Jul 2014 17:15:17 +0200 Subject: [PATCH 0374/1288] Fixed error in 'getbalance' when using watchonly addresses. --- src/wallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index 8d27da9d40..a754c1cd5f 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -845,7 +845,7 @@ void CWalletTx::GetAmounts(list >& listReceived, listSent.push_back(make_pair(address, txout.nValue)); // If we are receiving the output, add it as a "received" entry - if (fIsMine) + if (fIsMine & filter) listReceived.push_back(make_pair(address, txout.nValue)); } From bdd5b587fc7fd1b4dda479c4aad15c874b22e8f3 Mon Sep 17 00:00:00 2001 From: "Rune K. Svendsen" Date: Wed, 4 Jun 2014 13:16:07 +0200 Subject: [PATCH 0375/1288] Add option to disable 077 umask (create new files with system default umask) The option is only effective for either wallet-less builds or if -disablewallet is specified as well. Rebased-By: Wladimir J. van der Laan Rebased-From: 34d5fc0 4e1a196 bd4307b d53a33b 7e09b36 Github-Pull: #4286 --- src/init.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index 99df237b2a..07960ee37b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -224,8 +224,12 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -par= " + strprintf(_("Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)"), -(int)boost::thread::hardware_concurrency(), MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS) + "\n"; strUsage += " -pid= " + _("Specify pid file (default: bitcoind.pid)") + "\n"; strUsage += " -reindex " + _("Rebuild block chain index from current blk000??.dat files") + " " + _("on startup") + "\n"; +#if !defined(WIN32) + strUsage += " -sysperms " + _("Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)") + "\n"; +#endif strUsage += " -txindex " + _("Maintain a full transaction index (default: 0)") + "\n"; + strUsage += "\n" + _("Connection options:") + "\n"; strUsage += " -addnode= " + _("Add a node to connect to and attempt to keep the connection open") + "\n"; strUsage += " -banscore= " + _("Threshold for disconnecting misbehaving peers (default: 100)") + "\n"; @@ -484,7 +488,15 @@ bool AppInit2(boost::thread_group& threadGroup) } #endif #ifndef WIN32 - umask(077); + + if (GetBoolArg("-sysperms", false)) { +#ifdef ENABLE_WALLET + if (!GetBoolArg("-disablewallet", false)) + return InitError("Error: -sysperms is not allowed in combination with enabled wallet functionality"); +#endif + } else { + umask(077); + } // Clean shutdown on SIGTERM struct sigaction sa; From bc42503f6ab304608c321986a870795e45f5a016 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 9 Jul 2014 17:25:09 +0200 Subject: [PATCH 0376/1288] Use unordered_map for CCoinsViewCache with salted hash --- src/coins.cpp | 8 ++++++-- src/coins.h | 15 ++++++++++++++- src/uint256.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++ src/uint256.h | 4 +++- 4 files changed, 66 insertions(+), 4 deletions(-) diff --git a/src/coins.cpp b/src/coins.cpp index 13a4ea95cd..e76d8c7ef2 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -4,6 +4,8 @@ #include "coins.h" +#include "random.h" + #include // calculate number of bytes for the bitmask, and its number of non-zero bytes @@ -69,6 +71,8 @@ void CCoinsViewBacked::SetBackend(CCoinsView &viewIn) { base = &viewIn; } bool CCoinsViewBacked::BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBlock) { return base->BatchWrite(mapCoins, hashBlock); } bool CCoinsViewBacked::GetStats(CCoinsStats &stats) { return base->GetStats(stats); } +CCoinsKeyHasher::CCoinsKeyHasher() : salt(GetRandHash()) {} + CCoinsViewCache::CCoinsViewCache(CCoinsView &baseIn, bool fDummy) : CCoinsViewBacked(baseIn), hashBlock(0) { } bool CCoinsViewCache::GetCoins(const uint256 &txid, CCoins &coins) { @@ -84,8 +88,8 @@ bool CCoinsViewCache::GetCoins(const uint256 &txid, CCoins &coins) { } CCoinsMap::iterator CCoinsViewCache::FetchCoins(const uint256 &txid) { - CCoinsMap::iterator it = cacheCoins.lower_bound(txid); - if (it != cacheCoins.end() && it->first == txid) + CCoinsMap::iterator it = cacheCoins.find(txid); + if (it != cacheCoins.end()) return it; CCoins tmp; if (!base->GetCoins(txid,tmp)) diff --git a/src/coins.h b/src/coins.h index c57a5ec722..9f90fe6bd0 100644 --- a/src/coins.h +++ b/src/coins.h @@ -13,6 +13,7 @@ #include #include +#include /** pruned version of CTransaction: only retains metadata and unspent transaction outputs * @@ -239,7 +240,19 @@ public: } }; -typedef std::map CCoinsMap; +class CCoinsKeyHasher +{ +private: + uint256 salt; + +public: + CCoinsKeyHasher(); + uint64_t operator()(const uint256& key) const { + return key.GetHash(salt); + } +}; + +typedef boost::unordered_map CCoinsMap; struct CCoinsStats { diff --git a/src/uint256.cpp b/src/uint256.cpp index 3392f1e9bc..08c05594fd 100644 --- a/src/uint256.cpp +++ b/src/uint256.cpp @@ -290,3 +290,46 @@ uint32_t uint256::GetCompact(bool fNegative) const nCompact |= (fNegative && (nCompact & 0x007fffff) ? 0x00800000 : 0); return nCompact; } + +static void inline HashMix(uint32_t& a, uint32_t& b, uint32_t& c) +{ + // Taken from lookup3, by Bob Jenkins. + a -= c; a ^= ((c << 4) | (c >> 28)); c += b; + b -= a; b ^= ((a << 6) | (a >> 26)); a += c; + c -= b; c ^= ((b << 8) | (b >> 24)); b += a; + a -= c; a ^= ((c << 16) | (c >> 16)); c += b; + b -= a; b ^= ((a << 19) | (a >> 13)); a += c; + c -= b; c ^= ((b << 4) | (b >> 28)); b += a; +} + +static void inline HashFinal(uint32_t& a, uint32_t& b, uint32_t& c) +{ + // Taken from lookup3, by Bob Jenkins. + c ^= b; c -= ((b << 14) | (b >> 18)); + a ^= c; a -= ((c << 11) | (c >> 21)); + b ^= a; b -= ((a << 25) | (a >> 7)); + c ^= b; c -= ((b << 16) | (b >> 16)); + a ^= c; a -= ((c << 4) | (c >> 28)); + b ^= a; b -= ((a << 14) | (a >> 18)); + c ^= b; c -= ((b << 24) | (b >> 8)); +} + +uint64_t uint256::GetHash(const uint256 &salt) const +{ + uint32_t a, b, c; + a = b = c = 0xdeadbeef + (WIDTH << 2); + + a += pn[0] ^ salt.pn[0]; + b += pn[1] ^ salt.pn[1]; + c += pn[2] ^ salt.pn[2]; + HashMix(a, b, c); + a += pn[3] ^ salt.pn[3]; + b += pn[4] ^ salt.pn[4]; + c += pn[5] ^ salt.pn[5]; + HashMix(a, b, c); + a += pn[6] ^ salt.pn[6]; + b += pn[7] ^ salt.pn[7]; + HashFinal(a, b, c); + + return ((((uint64_t)b) << 32) | c); +} diff --git a/src/uint256.h b/src/uint256.h index 82db7758c9..ad0a56f447 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -21,7 +21,7 @@ public: template class base_uint { -private: +protected: enum { WIDTH=BITS/32 }; uint32_t pn[WIDTH]; public: @@ -322,6 +322,8 @@ public: // implementation accident. uint256& SetCompact(uint32_t nCompact, bool *pfNegative = NULL, bool *pfOverflow = NULL); uint32_t GetCompact(bool fNegative = false) const; + + uint64_t GetHash(const uint256& salt) const; }; #endif From 43005cffa394afde08a80b28ac52f7821c96d841 Mon Sep 17 00:00:00 2001 From: kazcw Date: Mon, 14 Jul 2014 18:24:21 -0700 Subject: [PATCH 0377/1288] Fix semantic typo in state.CorruptionPossible check state.Invalid() is always false, check should be IsInvalid() Broken since 942b33a --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 4f6b442f3a..830bcb5489 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2517,7 +2517,7 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex, return false; if (!CheckBlock(block, state)) { - if (state.Invalid() && !state.CorruptionPossible()) { + if (state.IsInvalid() && !state.CorruptionPossible()) { pindex->nStatus |= BLOCK_FAILED_VALID; } return false; From ebdcc360b65816f7ad7cdedce6a1114d5e014b7b Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Tue, 15 Jul 2014 02:11:55 +0200 Subject: [PATCH 0378/1288] Add helptexts for -whitelist and rpc prioritisetransaction and switch to bitcoin instead of satoshis --- src/init.cpp | 1 + src/rpcclient.cpp | 2 ++ src/rpcmining.cpp | 23 +++++++++++++++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 07960ee37b..ca30abac90 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -259,6 +259,7 @@ std::string HelpMessage(HelpMessageMode mode) #endif strUsage += " -whitebind= " + _("Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6") + "\n"; strUsage += " -whitelist= " + _("Whitelist peers connecting from the given netmask or ip. Can be specified multiple times.") + "\n"; + strUsage += " " + _("Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway") + "\n"; #ifdef ENABLE_WALLET strUsage += "\n" + _("Wallet options:") + "\n"; diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index 5edeecf933..a0921453cc 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -85,6 +85,8 @@ static const CRPCConvertParam vRPCConvertParams[] = { "getrawmempool", 0 }, { "estimatefee", 0 }, { "estimatepriority", 0 }, + { "prioritisetransaction", 1 }, + { "prioritisetransaction", 2 }, }; class CRPCConvertTable diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 6f72ea7404..cbb4ab2f8b 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -252,11 +252,30 @@ Value prioritisetransaction(const Array& params, bool fHelp) if (fHelp || params.size() != 3) throw runtime_error( "prioritisetransaction \n" - "Accepts the transaction into mined blocks at a higher (or lower) priority"); + "Accepts the transaction into mined blocks at a higher (or lower) priority\n" + "\nArguments:\n" + "1. \"txid\" (string, required) The transaction id.\n" + "2. priority delta (numeric, required) The priority to add or subtract.\n" + " The transaction selection algorithm considers the tx as it would have a higher priority.\n" + " (priority of a transaction is calculated: coinage * value_in_satoshis / txsize) \n" + "3. fee delta (numeric, required) The absolute fee value to add or subtract in bitcoin.\n" + " The fee is not actually paid, only the algorithm for selecting transactions into a block\n" + " considers the transaction as it would have paid a higher (or lower) fee.\n" + "\nResult\n" + "true (boolean) Returns true\n" + "\nExamples:\n" + + HelpExampleCli("prioritisetransaction", "\"txid\" 0.0 0.00010000") + + HelpExampleRpc("prioritisetransaction", "\"txid\", 0.0, 0.00010000") + ); uint256 hash; hash.SetHex(params[0].get_str()); - mempool.PrioritiseTransaction(hash, params[0].get_str(), params[1].get_real(), params[2].get_int64()); + + int64_t nAmount = 0; + if (params[2].get_real() != 0.0) + nAmount = AmountFromValue(params[2]); + + mempool.PrioritiseTransaction(hash, params[0].get_str(), params[1].get_real(), nAmount); return true; } From 96ff9d64037bba25c080b4f26e64e7f01c6f34f1 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 15 Jul 2014 10:22:27 +0200 Subject: [PATCH 0379/1288] Can't log to debug log before chain params initialized Add a function `AreBaseParamsConfigured` and use this to check before writing to the debug log. This avoids assertions when the application happens to log too early, which happens in the GUI. Messages logged before the base parameters are configured can be shown using `-printtoconsole`. --- src/chainparamsbase.cpp | 4 ++++ src/chainparamsbase.h | 6 ++++++ src/util.cpp | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index 19a9e72cc9..720e24c4a8 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -91,3 +91,7 @@ bool SelectBaseParamsFromCommandLine() { } return true; } + +bool AreBaseParamsConfigured() { + return pCurrentBaseParams != NULL; +} diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h index 4a3b268909..4398f69548 100644 --- a/src/chainparamsbase.h +++ b/src/chainparamsbase.h @@ -49,4 +49,10 @@ void SelectBaseParams(CBaseChainParams::Network network); */ bool SelectBaseParamsFromCommandLine(); +/** + * Return true if SelectBaseParamsFromCommandLine() has been called to select + * a network. + */ +bool AreBaseParamsConfigured(); + #endif diff --git a/src/util.cpp b/src/util.cpp index ce31619eca..d3fa5182f3 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -205,7 +205,7 @@ int LogPrintStr(const std::string &str) // print to console ret = fwrite(str.data(), 1, str.size(), stdout); } - else if (fPrintToDebugLog) + else if (fPrintToDebugLog && AreBaseParamsConfigured()) { static bool fStartedNewLine = true; boost::call_once(&DebugPrintInit, debugPrintInitFlag); From c715ff52c75398a3a65975f1d1b23834bd8426ee Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 15 Jul 2014 10:23:28 +0200 Subject: [PATCH 0380/1288] ui: Replace some LogPrintfs with qDebug() These are relatively unimportant messages, so don't need to be logged without -debug=ui. --- src/qt/bitcoin.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 7c4af25edf..6b1e50922e 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -237,7 +238,7 @@ void BitcoinCore::initialize() { try { - LogPrintf("Running AppInit2 in thread\n"); + qDebug() << __func__ << ": Running AppInit2 in thread"; int rv = AppInit2(threadGroup); if(rv) { @@ -258,11 +259,11 @@ void BitcoinCore::shutdown() { try { - LogPrintf("Running Shutdown in thread\n"); + qDebug() << __func__ << ": Running Shutdown in thread"; threadGroup.interrupt_all(); threadGroup.join_all(); Shutdown(); - LogPrintf("Shutdown finished\n"); + qDebug() << __func__ << ": Shutdown finished"; emit shutdownResult(1); } catch (std::exception& e) { handleRunawayException(&e); @@ -290,10 +291,10 @@ BitcoinApplication::BitcoinApplication(int &argc, char **argv): BitcoinApplication::~BitcoinApplication() { - LogPrintf("Stopping thread\n"); + qDebug() << __func__ << ": Stopping thread"; emit stopThread(); coreThread->wait(); - LogPrintf("Stopped thread\n"); + qDebug() << __func__ << ": Stopped thread"; delete window; window = 0; @@ -355,13 +356,13 @@ void BitcoinApplication::startThread() void BitcoinApplication::requestInitialize() { - LogPrintf("Requesting initialize\n"); + qDebug() << __func__ << ": Requesting initialize"; emit requestedInitialize(); } void BitcoinApplication::requestShutdown() { - LogPrintf("Requesting shutdown\n"); + qDebug() << __func__ << ": Requesting shutdown"; window->hide(); window->setClientModel(0); pollShutdownTimer->stop(); @@ -383,7 +384,7 @@ void BitcoinApplication::requestShutdown() void BitcoinApplication::initializeResult(int retval) { - LogPrintf("Initialization result: %i\n", retval); + qDebug() << __func__ << ": Initialization result: " << retval; // Set exit result: 0 if successful, 1 if failure returnValue = retval ? 0 : 1; if(retval) @@ -438,7 +439,7 @@ void BitcoinApplication::initializeResult(int retval) void BitcoinApplication::shutdownResult(int retval) { - LogPrintf("Shutdown result: %i\n", retval); + qDebug() << __func__ << ": Shutdown result: " << retval; quit(); // Exit main loop after shutdown finished } From 1b4568cb0f00dd7a24575fe54c017e743c4e7d35 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Fri, 30 May 2014 00:54:00 +0200 Subject: [PATCH 0381/1288] Add vout to ListTransactions output --- src/rpcwallet.cpp | 57 ++++++++++++++++++++++++++--------------------- src/wallet.cpp | 32 +++++++++++++------------- src/wallet.h | 10 +++++++-- 3 files changed, 56 insertions(+), 43 deletions(-) diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index e8c62fd37b..631f72d1a1 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -641,16 +641,16 @@ Value getbalance(const Array& params, bool fHelp) int64_t allFee; string strSentAccount; - list > listReceived; - list > listSent; + list listReceived; + list listSent; wtx.GetAmounts(listReceived, listSent, allFee, strSentAccount, filter); if (wtx.GetDepthInMainChain() >= nMinDepth) { - BOOST_FOREACH(const PAIRTYPE(CTxDestination,int64_t)& r, listReceived) - nBalance += r.second; + BOOST_FOREACH(const COutputEntry& r, listReceived) + nBalance += r.amount; } - BOOST_FOREACH(const PAIRTYPE(CTxDestination,int64_t)& r, listSent) - nBalance -= r.second; + BOOST_FOREACH(const COutputEntry& s, listSent) + nBalance -= s.amount; nBalance -= allFee; } return ValueFromAmount(nBalance); @@ -1133,8 +1133,8 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe { int64_t nFee; string strSentAccount; - list > listReceived; - list > listSent; + list listReceived; + list listSent; wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount, filter); @@ -1144,15 +1144,16 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe // Sent if ((!listSent.empty() || nFee != 0) && (fAllAccounts || strAccount == strSentAccount)) { - BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64_t)& s, listSent) + BOOST_FOREACH(const COutputEntry& s, listSent) { Object entry; - if(involvesWatchonly || (::IsMine(*pwalletMain, s.first) & ISMINE_WATCH_ONLY)) + if(involvesWatchonly || (::IsMine(*pwalletMain, s.destination) & ISMINE_WATCH_ONLY)) entry.push_back(Pair("involvesWatchonly", true)); entry.push_back(Pair("account", strSentAccount)); - MaybePushAddress(entry, s.first); + MaybePushAddress(entry, s.destination); entry.push_back(Pair("category", "send")); - entry.push_back(Pair("amount", ValueFromAmount(-s.second))); + entry.push_back(Pair("amount", ValueFromAmount(-s.amount))); + entry.push_back(Pair("vout", s.vout)); entry.push_back(Pair("fee", ValueFromAmount(-nFee))); if (fLong) WalletTxToJSON(wtx, entry); @@ -1163,18 +1164,18 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe // Received if (listReceived.size() > 0 && wtx.GetDepthInMainChain() >= nMinDepth) { - BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64_t)& r, listReceived) + BOOST_FOREACH(const COutputEntry& r, listReceived) { string account; - if (pwalletMain->mapAddressBook.count(r.first)) - account = pwalletMain->mapAddressBook[r.first].name; + if (pwalletMain->mapAddressBook.count(r.destination)) + account = pwalletMain->mapAddressBook[r.destination].name; if (fAllAccounts || (account == strAccount)) { Object entry; - if(involvesWatchonly || (::IsMine(*pwalletMain, r.first) & ISMINE_WATCH_ONLY)) + if(involvesWatchonly || (::IsMine(*pwalletMain, r.destination) & ISMINE_WATCH_ONLY)) entry.push_back(Pair("involvesWatchonly", true)); entry.push_back(Pair("account", account)); - MaybePushAddress(entry, r.first); + MaybePushAddress(entry, r.destination); if (wtx.IsCoinBase()) { if (wtx.GetDepthInMainChain() < 1) @@ -1188,7 +1189,8 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe { entry.push_back(Pair("category", "receive")); } - entry.push_back(Pair("amount", ValueFromAmount(r.second))); + entry.push_back(Pair("amount", ValueFromAmount(r.amount))); + entry.push_back(Pair("vout", r.vout)); if (fLong) WalletTxToJSON(wtx, entry); ret.push_back(entry); @@ -1240,6 +1242,7 @@ Value listtransactions(const Array& params, bool fHelp) " \"amount\": x.xxx, (numeric) The amount in btc. This is negative for the 'send' category, and for the\n" " 'move' category for moves outbound. It is positive for the 'receive' category,\n" " and for the 'move' category for inbound funds.\n" + " \"vout\" : n, (numeric) the vout value\n" " \"fee\": x.xxx, (numeric) The amount of the fee in btc. This is negative and only available for the \n" " 'send' category of transactions.\n" " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Available for 'send' and \n" @@ -1375,22 +1378,22 @@ Value listaccounts(const Array& params, bool fHelp) const CWalletTx& wtx = (*it).second; int64_t nFee; string strSentAccount; - list > listReceived; - list > listSent; + list listReceived; + list listSent; int nDepth = wtx.GetDepthInMainChain(); if (wtx.GetBlocksToMaturity() > 0 || nDepth < 0) continue; wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount, includeWatchonly); mapAccountBalances[strSentAccount] -= nFee; - BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64_t)& s, listSent) - mapAccountBalances[strSentAccount] -= s.second; + BOOST_FOREACH(const COutputEntry& s, listSent) + mapAccountBalances[strSentAccount] -= s.amount; if (nDepth >= nMinDepth) { - BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64_t)& r, listReceived) - if (pwalletMain->mapAddressBook.count(r.first)) - mapAccountBalances[pwalletMain->mapAddressBook[r.first].name] += r.second; + BOOST_FOREACH(const COutputEntry& r, listReceived) + if (pwalletMain->mapAddressBook.count(r.destination)) + mapAccountBalances[pwalletMain->mapAddressBook[r.destination].name] += r.amount; else - mapAccountBalances[""] += r.second; + mapAccountBalances[""] += r.amount; } } @@ -1424,6 +1427,7 @@ Value listsinceblock(const Array& params, bool fHelp) " \"category\":\"send|receive\", (string) The transaction category. 'send' has negative amounts, 'receive' has positive amounts.\n" " \"amount\": x.xxx, (numeric) The amount in btc. This is negative for the 'send' category, and for the 'move' category for moves \n" " outbound. It is positive for the 'receive' category, and for the 'move' category for inbound funds.\n" + " \"vout\" : n, (numeric) the vout value\n" " \"fee\": x.xxx, (numeric) The amount of the fee in btc. This is negative and only available for the 'send' category of transactions.\n" " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Available for 'send' and 'receive' category of transactions.\n" " \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction. Available for 'send' and 'receive' category of transactions.\n" @@ -1528,6 +1532,7 @@ Value gettransaction(const Array& params, bool fHelp) " \"address\" : \"bitcoinaddress\", (string) The bitcoin address involved in the transaction\n" " \"category\" : \"send|receive\", (string) The category, either 'send' or 'receive'\n" " \"amount\" : x.xxx (numeric) The amount in btc\n" + " \"vout\" : n, (numeric) the vout value\n" " }\n" " ,...\n" " ],\n" diff --git a/src/wallet.cpp b/src/wallet.cpp index a754c1cd5f..89a260480e 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -798,8 +798,8 @@ int CWalletTx::GetRequestCount() const return nRequests; } -void CWalletTx::GetAmounts(list >& listReceived, - list >& listSent, int64_t& nFee, string& strSentAccount, const isminefilter& filter) const +void CWalletTx::GetAmounts(list& listReceived, + list& listSent, int64_t& nFee, string& strSentAccount, const isminefilter& filter) const { nFee = 0; listReceived.clear(); @@ -815,10 +815,10 @@ void CWalletTx::GetAmounts(list >& listReceived, } // Sent/received. - BOOST_FOREACH(const CTxOut& txout, vout) + for (int i = 0; i < vout.size(); ++i) { + const CTxOut& txout = vout[i]; isminetype fIsMine = pwallet->IsMine(txout); - // Only need to handle txouts if AT LEAST one of these is true: // 1) they debit from us (sent) // 2) the output is to us (received) @@ -840,13 +840,15 @@ void CWalletTx::GetAmounts(list >& listReceived, address = CNoDestination(); } + COutputEntry output = {address, txout.nValue, i}; + // If we are debited by the transaction, add the output as a "sent" entry if (nDebit > 0) - listSent.push_back(make_pair(address, txout.nValue)); + listSent.push_back(output); // If we are receiving the output, add it as a "received" entry if (fIsMine & filter) - listReceived.push_back(make_pair(address, txout.nValue)); + listReceived.push_back(output); } } @@ -858,29 +860,29 @@ void CWalletTx::GetAccountAmounts(const string& strAccount, int64_t& nReceived, int64_t allFee; string strSentAccount; - list > listReceived; - list > listSent; + list listReceived; + list listSent; GetAmounts(listReceived, listSent, allFee, strSentAccount, filter); if (strAccount == strSentAccount) { - BOOST_FOREACH(const PAIRTYPE(CTxDestination,int64_t)& s, listSent) - nSent += s.second; + BOOST_FOREACH(const COutputEntry& s, listSent) + nSent += s.amount; nFee = allFee; } { LOCK(pwallet->cs_wallet); - BOOST_FOREACH(const PAIRTYPE(CTxDestination,int64_t)& r, listReceived) + BOOST_FOREACH(const COutputEntry& r, listReceived) { - if (pwallet->mapAddressBook.count(r.first)) + if (pwallet->mapAddressBook.count(r.destination)) { - map::const_iterator mi = pwallet->mapAddressBook.find(r.first); + map::const_iterator mi = pwallet->mapAddressBook.find(r.destination); if (mi != pwallet->mapAddressBook.end() && (*mi).second.name == strAccount) - nReceived += r.second; + nReceived += r.amount; } else if (strAccount.empty()) { - nReceived += r.second; + nReceived += r.amount; } } } diff --git a/src/wallet.h b/src/wallet.h index ab9550a984..eaf9e96309 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -467,6 +467,12 @@ static void WriteOrderPos(const int64_t& nOrderPos, mapValue_t& mapValue) mapValue["n"] = i64tostr(nOrderPos); } +struct COutputEntry +{ + CTxDestination destination; + int64_t amount; + int vout; +}; /** A transaction with a bunch of additional info that only the owner cares about. * It includes any unrecorded transactions needed to link it back to the block chain. @@ -761,8 +767,8 @@ public: return nChangeCached; } - void GetAmounts(std::list >& listReceived, - std::list >& listSent, int64_t& nFee, std::string& strSentAccount, const isminefilter& filter) const; + void GetAmounts(std::list& listReceived, + std::list& listSent, int64_t& nFee, std::string& strSentAccount, const isminefilter& filter) const; void GetAccountAmounts(const std::string& strAccount, int64_t& nReceived, int64_t& nSent, int64_t& nFee, const isminefilter& filter) const; From c4a321f5c6f266bdf99d7f3557210994b5c75f96 Mon Sep 17 00:00:00 2001 From: Gregory Maxwell Date: Tue, 15 Jul 2014 07:13:10 -0700 Subject: [PATCH 0382/1288] Add peerid to getpeerinfo to allow correlation with the logs. This seems to have been missed in 3764. --- src/rpcnet.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 680717930b..bd3609b0c9 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -79,6 +79,7 @@ Value getpeerinfo(const Array& params, bool fHelp) "\nbResult:\n" "[\n" " {\n" + " \"id\": n, (numeric) Peer index\n" " \"addr\":\"host:port\", (string) The ip address and port of the peer\n" " \"addrlocal\":\"ip:port\", (string) local address\n" " \"services\":\"xxxxxxxxxxxxxxxx\", (string) The services offered\n" @@ -113,6 +114,7 @@ Value getpeerinfo(const Array& params, bool fHelp) Object obj; CNodeStateStats statestats; bool fStateStats = GetNodeStateStats(stats.nodeid, statestats); + obj.push_back(Pair("id", stats.nodeid)); obj.push_back(Pair("addr", stats.addrName)); if (!(stats.addrLocal.empty())) obj.push_back(Pair("addrlocal", stats.addrLocal)); From 33357b27a0f6e344e760caf87e96b577b4c25ad7 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 15 Jul 2014 16:26:16 +0200 Subject: [PATCH 0383/1288] qt: Start core thread only when needed Start the core thread only when needed for initialization or shutdown. Avoids a bit of overhead, and also avoids spamming two log messages before logging is properly initialized. --- src/qt/bitcoin.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 6b1e50922e..43466663fa 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -286,15 +286,17 @@ BitcoinApplication::BitcoinApplication(int &argc, char **argv): returnValue(0) { setQuitOnLastWindowClosed(false); - startThread(); } BitcoinApplication::~BitcoinApplication() { - qDebug() << __func__ << ": Stopping thread"; - emit stopThread(); - coreThread->wait(); - qDebug() << __func__ << ": Stopped thread"; + if(coreThread) + { + qDebug() << __func__ << ": Stopping thread"; + emit stopThread(); + coreThread->wait(); + qDebug() << __func__ << ": Stopped thread"; + } delete window; window = 0; @@ -337,6 +339,8 @@ void BitcoinApplication::createSplashScreen(bool isaTestNet) void BitcoinApplication::startThread() { + if(coreThread) + return; coreThread = new QThread(this); BitcoinCore *executor = new BitcoinCore(); executor->moveToThread(coreThread); @@ -357,12 +361,14 @@ void BitcoinApplication::startThread() void BitcoinApplication::requestInitialize() { qDebug() << __func__ << ": Requesting initialize"; + startThread(); emit requestedInitialize(); } void BitcoinApplication::requestShutdown() { qDebug() << __func__ << ": Requesting shutdown"; + startThread(); window->hide(); window->setClientModel(0); pollShutdownTimer->stop(); From 125fba1b482997f13b5eec6b24d634adda4f91e7 Mon Sep 17 00:00:00 2001 From: Trevin Hofmann Date: Tue, 15 Jul 2014 19:13:24 -0500 Subject: [PATCH 0384/1288] Add a new checkpoint at block 295,000 Block 295,000 seems to meet the criteria of a reasonable timestamp and no strange transactions. 295,000 is the current block height in the bootstrap.dat torrent provided by jgarzik. --- src/checkpoints.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index 80479b47fb..3bf0843547 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -51,11 +51,12 @@ namespace Checkpoints { (225430, uint256("0x00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932")) (250000, uint256("0x000000000000003887df1f29024b06fc2200b55f8af8f35453d7be294df2d214")) (279000, uint256("0x0000000000000001ae8c72a0b0c301f67e3afca10e819efa9041e458e9bd7e40")) + (295000, uint256("0x00000000000000004d9b4ef50f0f9d686fd69db2e03af35a100370c64632a983")) ; static const CCheckpointData data = { &mapCheckpoints, - 1389047471, // * UNIX timestamp of last checkpoint block - 30549816, // * total number of transactions between genesis and last checkpoint + 1397080064, // * UNIX timestamp of last checkpoint block + 36544669, // * total number of transactions between genesis and last checkpoint // (the tx=... number in the SetBestChain debug.log lines) 60000.0 // * estimated number of transactions per day after checkpoint }; From 604ee2aa7d110439b4e59ecaa272b85ec41ab6a0 Mon Sep 17 00:00:00 2001 From: R E Broadley Date: Thu, 3 Jul 2014 15:28:38 +0700 Subject: [PATCH 0385/1288] Remove tx from AlreadyAskedFor list once we receive it, not when we process it. --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 442feea471..0cbf3b07ff 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3894,15 +3894,16 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, bool fMissingInputs = false; CValidationState state; + + mapAlreadyAskedFor.erase(inv); + if (AcceptToMemoryPool(mempool, state, tx, true, &fMissingInputs)) { mempool.check(pcoinsTip); RelayTransaction(tx); - mapAlreadyAskedFor.erase(inv); vWorkQueue.push_back(inv.hash); vEraseQueue.push_back(inv.hash); - LogPrint("mempool", "AcceptToMemoryPool: peer=%d %s : accepted %s (poolsz %u)\n", pfrom->id, pfrom->cleanSubVer, tx.GetHash().ToString(), @@ -3928,7 +3929,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, { LogPrint("mempool", " accepted orphan tx %s\n", orphanHash.ToString()); RelayTransaction(orphanTx); - mapAlreadyAskedFor.erase(CInv(MSG_TX, orphanHash)); vWorkQueue.push_back(orphanHash); vEraseQueue.push_back(orphanHash); } From b069750d3f27c96a83700a08a2bb819902268857 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 10 Jul 2014 20:16:58 +0200 Subject: [PATCH 0386/1288] Break up CAddrMan's IMPLEMENT_SERIALIZE --- src/addrman.h | 258 ++++++++++++++++++++++++------------------------ src/serialize.h | 29 ++++++ 2 files changed, 159 insertions(+), 128 deletions(-) diff --git a/src/addrman.h b/src/addrman.h index a0dc134c40..052d364655 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -245,140 +245,142 @@ protected: void Connected_(const CService &addr, int64_t nTime); public: + // serialized format: + // * version byte (currently 0) + // * nKey + // * nNew + // * nTried + // * number of "new" buckets + // * all nNew addrinfos in vvNew + // * all nTried addrinfos in vvTried + // * for each bucket: + // * number of elements + // * for each element: index + // + // Notice that vvTried, mapAddr and vVector are never encoded explicitly; + // they are instead reconstructed from the other information. + // + // vvNew is serialized, but only used if ADDRMAN_UNKOWN_BUCKET_COUNT didn't change, + // otherwise it is reconstructed as well. + // + // This format is more complex, but significantly smaller (at most 1.5 MiB), and supports + // changes to the ADDRMAN_ parameters without breaking the on-disk structure. + // + // We don't use IMPLEMENT_SERIALIZE since the serialization and deserialization code has + // very little in common. + template + void Serialize(Stream &s, int nType, int nVersionDummy) const + { + LOCK(cs); - IMPLEMENT_SERIALIZE - (({ - // serialized format: - // * version byte (currently 0) - // * nKey - // * nNew - // * nTried - // * number of "new" buckets - // * all nNew addrinfos in vvNew - // * all nTried addrinfos in vvTried - // * for each bucket: - // * number of elements - // * for each element: index - // - // Notice that vvTried, mapAddr and vVector are never encoded explicitly; - // they are instead reconstructed from the other information. - // - // vvNew is serialized, but only used if ADDRMAN_UNKOWN_BUCKET_COUNT didn't change, - // otherwise it is reconstructed as well. - // - // This format is more complex, but significantly smaller (at most 1.5 MiB), and supports - // changes to the ADDRMAN_ parameters without breaking the on-disk structure. - { - LOCK(cs); - unsigned char nVersion = 0; - READWRITE(nVersion); - READWRITE(nKey); - READWRITE(nNew); - READWRITE(nTried); + unsigned char nVersion = 0; + s << nVersion; + s << nKey; + s << nNew; + s << nTried; - CAddrMan *am = const_cast(this); - if (fWrite) - { - int nUBuckets = ADDRMAN_NEW_BUCKET_COUNT; - READWRITE(nUBuckets); - std::map mapUnkIds; - int nIds = 0; - for (std::map::iterator it = am->mapInfo.begin(); it != am->mapInfo.end(); it++) - { - if (nIds == nNew) break; // this means nNew was wrong, oh ow - mapUnkIds[(*it).first] = nIds; - CAddrInfo &info = (*it).second; - if (info.nRefCount) - { - READWRITE(info); - nIds++; - } - } - nIds = 0; - for (std::map::iterator it = am->mapInfo.begin(); it != am->mapInfo.end(); it++) - { - if (nIds == nTried) break; // this means nTried was wrong, oh ow - CAddrInfo &info = (*it).second; - if (info.fInTried) - { - READWRITE(info); - nIds++; - } - } - for (std::vector >::iterator it = am->vvNew.begin(); it != am->vvNew.end(); it++) - { - const std::set &vNew = (*it); - int nSize = vNew.size(); - READWRITE(nSize); - for (std::set::iterator it2 = vNew.begin(); it2 != vNew.end(); it2++) - { - int nIndex = mapUnkIds[*it2]; - READWRITE(nIndex); - } - } + int nUBuckets = ADDRMAN_NEW_BUCKET_COUNT; + s << nUBuckets; + std::map mapUnkIds; + int nIds = 0; + for (std::map::const_iterator it = mapInfo.begin(); it != mapInfo.end(); it++) { + if (nIds == nNew) break; // this means nNew was wrong, oh ow + mapUnkIds[(*it).first] = nIds; + const CAddrInfo &info = (*it).second; + if (info.nRefCount) { + s << info; + nIds++; + } + } + nIds = 0; + for (std::map::const_iterator it = mapInfo.begin(); it != mapInfo.end(); it++) { + if (nIds == nTried) break; // this means nTried was wrong, oh ow + const CAddrInfo &info = (*it).second; + if (info.fInTried) { + s << info; + nIds++; + } + } + for (std::vector >::const_iterator it = vvNew.begin(); it != vvNew.end(); it++) { + const std::set &vNew = (*it); + int nSize = vNew.size(); + s << nSize; + for (std::set::const_iterator it2 = vNew.begin(); it2 != vNew.end(); it2++) { + int nIndex = mapUnkIds[*it2]; + s << nIndex; + } + } + } + + template + void Unserialize(Stream& s, int nType, int nVersionDummy) + { + LOCK(cs); + + unsigned char nVersion; + s >> nVersion; + s >> nKey; + s >> nNew; + s >> nTried; + + int nUBuckets = 0; + s >> nUBuckets; + nIdCount = 0; + mapInfo.clear(); + mapAddr.clear(); + vRandom.clear(); + vvTried = std::vector >(ADDRMAN_TRIED_BUCKET_COUNT, std::vector(0)); + vvNew = std::vector >(ADDRMAN_NEW_BUCKET_COUNT, std::set()); + for (int n = 0; n < nNew; n++) { + CAddrInfo &info = mapInfo[n]; + s >> info; + mapAddr[info] = n; + info.nRandomPos = vRandom.size(); + vRandom.push_back(n); + if (nUBuckets != ADDRMAN_NEW_BUCKET_COUNT) { + vvNew[info.GetNewBucket(nKey)].insert(n); + info.nRefCount++; + } + } + nIdCount = nNew; + int nLost = 0; + for (int n = 0; n < nTried; n++) { + CAddrInfo info; + s >> info; + std::vector &vTried = vvTried[info.GetTriedBucket(nKey)]; + if (vTried.size() < ADDRMAN_TRIED_BUCKET_SIZE) { + info.nRandomPos = vRandom.size(); + info.fInTried = true; + vRandom.push_back(nIdCount); + mapInfo[nIdCount] = info; + mapAddr[info] = nIdCount; + vTried.push_back(nIdCount); + nIdCount++; } else { - int nUBuckets = 0; - READWRITE(nUBuckets); - am->nIdCount = 0; - am->mapInfo.clear(); - am->mapAddr.clear(); - am->vRandom.clear(); - am->vvTried = std::vector >(ADDRMAN_TRIED_BUCKET_COUNT, std::vector(0)); - am->vvNew = std::vector >(ADDRMAN_NEW_BUCKET_COUNT, std::set()); - for (int n = 0; n < am->nNew; n++) - { - CAddrInfo &info = am->mapInfo[n]; - READWRITE(info); - am->mapAddr[info] = n; - info.nRandomPos = vRandom.size(); - am->vRandom.push_back(n); - if (nUBuckets != ADDRMAN_NEW_BUCKET_COUNT) - { - am->vvNew[info.GetNewBucket(am->nKey)].insert(n); - info.nRefCount++; - } - } - am->nIdCount = am->nNew; - int nLost = 0; - for (int n = 0; n < am->nTried; n++) - { - CAddrInfo info; - READWRITE(info); - std::vector &vTried = am->vvTried[info.GetTriedBucket(am->nKey)]; - if (vTried.size() < ADDRMAN_TRIED_BUCKET_SIZE) - { - info.nRandomPos = vRandom.size(); - info.fInTried = true; - am->vRandom.push_back(am->nIdCount); - am->mapInfo[am->nIdCount] = info; - am->mapAddr[info] = am->nIdCount; - vTried.push_back(am->nIdCount); - am->nIdCount++; - } else { - nLost++; - } - } - am->nTried -= nLost; - for (int b = 0; b < nUBuckets; b++) - { - std::set &vNew = am->vvNew[b]; - int nSize = 0; - READWRITE(nSize); - for (int n = 0; n < nSize; n++) - { - int nIndex = 0; - READWRITE(nIndex); - CAddrInfo &info = am->mapInfo[nIndex]; - if (nUBuckets == ADDRMAN_NEW_BUCKET_COUNT && info.nRefCount < ADDRMAN_NEW_BUCKETS_PER_ADDRESS) - { - info.nRefCount++; - vNew.insert(nIndex); - } - } + nLost++; + } + } + nTried -= nLost; + for (int b = 0; b < nUBuckets; b++) { + std::set &vNew = vvNew[b]; + int nSize = 0; + s >> nSize; + for (int n = 0; n < nSize; n++) { + int nIndex = 0; + s >> nIndex; + CAddrInfo &info = mapInfo[nIndex]; + if (nUBuckets == ADDRMAN_NEW_BUCKET_COUNT && info.nRefCount < ADDRMAN_NEW_BUCKETS_PER_ADDRESS) { + info.nRefCount++; + vNew.insert(nIndex); } } } - });) + } + + unsigned int GetSerializeSize(int nType, int nVersion) const + { + return (CSizeComputer(nType, nVersion) << *this).size(); + } CAddrMan() : vRandom(0), vvTried(ADDRMAN_TRIED_BUCKET_COUNT, std::vector(0)), vvNew(ADDRMAN_NEW_BUCKET_COUNT, std::set()) { diff --git a/src/serialize.h b/src/serialize.h index 5ac85554c6..f876efd9b5 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -830,6 +830,35 @@ struct ser_streamplaceholder typedef std::vector > CSerializeData; +class CSizeComputer +{ +protected: + size_t nSize; + +public: + int nType; + int nVersion; + + CSizeComputer(int nTypeIn, int nVersionIn) : nSize(0), nType(nTypeIn), nVersion(nVersionIn) {} + + CSizeComputer& write(const char *psz, int nSize) + { + this->nSize += nSize; + return *this; + } + + template + CSizeComputer& operator<<(const T& obj) + { + ::Serialize(*this, obj, nType, nVersion); + return (*this); + } + + size_t size() const { + return nSize; + } +}; + /** Double ended buffer combining vector and stream-like interfaces. * * >> and << read and write unformatted data using the above serialization templates. From 09c744c2a845f756adbcf8716c2365b63731f467 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 16 Jul 2014 21:46:01 +0200 Subject: [PATCH 0387/1288] Make sure CAutoFile for fees estimate goes out of scope --- src/init.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 07960ee37b..b80d718f01 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -127,12 +127,14 @@ void Shutdown() StopNode(); UnregisterNodeSignals(GetNodeSignals()); - boost::filesystem::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME; - CAutoFile est_fileout = CAutoFile(fopen(est_path.string().c_str(), "wb"), SER_DISK, CLIENT_VERSION); - if (est_fileout) - mempool.WriteFeeEstimates(est_fileout); - else - LogPrintf("%s: Failed to write fee estimates to %s\n", __func__, est_path.string()); + { + boost::filesystem::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME; + CAutoFile est_fileout(fopen(est_path.string().c_str(), "wb"), SER_DISK, CLIENT_VERSION); + if (est_fileout) + mempool.WriteFeeEstimates(est_fileout); + else + LogPrintf("%s: Failed to write fee estimates to %s\n", __func__, est_path.string()); + } { LOCK(cs_main); From 7de3f1cfd6a875bd3e7451e81ac3ab0ab69a9b6d Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 17 Jul 2014 15:09:03 +0200 Subject: [PATCH 0388/1288] fix help message for RPC getpeerinfo --- src/rpcnet.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index bd3609b0c9..88e7c4ab07 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -98,8 +98,7 @@ Value getpeerinfo(const Array& params, bool fHelp) " \"syncnode\" : true|false (booleamn) if sync node\n" " }\n" " ,...\n" - "}\n" - + "]\n" "\nExamples:\n" + HelpExampleCli("getpeerinfo", "") + HelpExampleRpc("getpeerinfo", "") From 43f510d37d680ca4347878d2fb6f8b97b54e7611 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 10 Jul 2014 12:13:03 +0200 Subject: [PATCH 0389/1288] Convert closesocket 'compat wrapper' to function in netbase Simpler alternative to #4348. The current setup with closesocket() is strange. It poses as a compatibility wrapper but adds functionality. Rename it and make it a documented utility function in netbase. Code movement only, zero effect on the functionality. --- src/compat.h | 15 -------------- src/net.cpp | 19 +++++++++--------- src/net.h | 3 +-- src/netbase.cpp | 53 ++++++++++++++++++++++++++++++------------------- src/netbase.h | 2 ++ 5 files changed, 45 insertions(+), 47 deletions(-) diff --git a/src/compat.h b/src/compat.h index 8fbafb6cce..1b3a60d11b 100644 --- a/src/compat.h +++ b/src/compat.h @@ -59,19 +59,4 @@ typedef u_int SOCKET; #define SOCKET_ERROR -1 #endif -inline int myclosesocket(SOCKET& hSocket) -{ - if (hSocket == INVALID_SOCKET) - return WSAENOTSOCK; -#ifdef WIN32 - int ret = closesocket(hSocket); -#else - int ret = close(hSocket); -#endif - hSocket = INVALID_SOCKET; - return ret; -} -#define closesocket(s) myclosesocket(s) - - #endif diff --git a/src/net.cpp b/src/net.cpp index 3b3d91d652..441bde3e90 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -332,7 +332,7 @@ bool GetMyExternalIP2(const CService& addrConnect, const char* pszGet, const cha { if (!RecvLine(hSocket, strLine)) { - closesocket(hSocket); + CloseSocket(hSocket); return false; } if (pszKeyword == NULL) @@ -343,7 +343,7 @@ bool GetMyExternalIP2(const CService& addrConnect, const char* pszGet, const cha break; } } - closesocket(hSocket); + CloseSocket(hSocket); if (strLine.find("<") != string::npos) strLine = strLine.substr(0, strLine.find("<")); strLine = strLine.substr(strspn(strLine.c_str(), " \t\n\r")); @@ -357,7 +357,7 @@ bool GetMyExternalIP2(const CService& addrConnect, const char* pszGet, const cha return true; } } - closesocket(hSocket); + CloseSocket(hSocket); return error("GetMyExternalIP() : connection closed"); } @@ -533,8 +533,7 @@ void CNode::CloseSocketDisconnect() if (hSocket != INVALID_SOCKET) { LogPrint("net", "disconnecting peer=%d\n", id); - closesocket(hSocket); - hSocket = INVALID_SOCKET; + CloseSocket(hSocket); } // in case this fails, we'll empty the recv buffer when the CNode is deleted @@ -975,12 +974,12 @@ void ThreadSocketHandler() } else if (nInbound >= nMaxConnections - MAX_OUTBOUND_CONNECTIONS) { - closesocket(hSocket); + CloseSocket(hSocket); } else if (CNode::IsBanned(addr) && !whitelisted) { LogPrintf("connection from %s dropped (banned)\n", addr.ToString()); - closesocket(hSocket); + CloseSocket(hSocket); } else { @@ -1817,11 +1816,11 @@ public: // Close sockets BOOST_FOREACH(CNode* pnode, vNodes) if (pnode->hSocket != INVALID_SOCKET) - closesocket(pnode->hSocket); + CloseSocket(pnode->hSocket); BOOST_FOREACH(ListenSocket& hListenSocket, vhListenSocket) if (hListenSocket.socket != INVALID_SOCKET) - if (closesocket(hListenSocket.socket) == SOCKET_ERROR) - LogPrintf("closesocket(hListenSocket) failed with error %s\n", NetworkErrorString(WSAGetLastError())); + if (!CloseSocket(hListenSocket.socket)) + LogPrintf("CloseSocket(hListenSocket) failed with error %s\n", NetworkErrorString(WSAGetLastError())); // clean up some globals (to help leak detection) BOOST_FOREACH(CNode *pnode, vNodes) diff --git a/src/net.h b/src/net.h index 866c9ae783..f029a8d935 100644 --- a/src/net.h +++ b/src/net.h @@ -357,8 +357,7 @@ public: { if (hSocket != INVALID_SOCKET) { - closesocket(hSocket); - hSocket = INVALID_SOCKET; + CloseSocket(hSocket); } if (pfilter) delete pfilter; diff --git a/src/netbase.cpp b/src/netbase.cpp index 067cfa024b..e9f3515456 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -218,7 +218,7 @@ bool static Socks5(string strDest, int port, SOCKET& hSocket) LogPrintf("SOCKS5 connecting %s\n", strDest); if (strDest.size() > 255) { - closesocket(hSocket); + CloseSocket(hSocket); return error("Hostname too long"); } char pszSocks5Init[] = "\5\1\0"; @@ -227,18 +227,18 @@ bool static Socks5(string strDest, int port, SOCKET& hSocket) ssize_t ret = send(hSocket, pszSocks5Init, nSize, MSG_NOSIGNAL); if (ret != nSize) { - closesocket(hSocket); + CloseSocket(hSocket); return error("Error sending to proxy"); } char pchRet1[2]; if (recv(hSocket, pchRet1, 2, 0) != 2) { - closesocket(hSocket); + CloseSocket(hSocket); return error("Error reading proxy response"); } if (pchRet1[0] != 0x05 || pchRet1[1] != 0x00) { - closesocket(hSocket); + CloseSocket(hSocket); return error("Proxy failed to initialize"); } string strSocks5("\5\1"); @@ -250,23 +250,23 @@ bool static Socks5(string strDest, int port, SOCKET& hSocket) ret = send(hSocket, strSocks5.c_str(), strSocks5.size(), MSG_NOSIGNAL); if (ret != (ssize_t)strSocks5.size()) { - closesocket(hSocket); + CloseSocket(hSocket); return error("Error sending to proxy"); } char pchRet2[4]; if (recv(hSocket, pchRet2, 4, 0) != 4) { - closesocket(hSocket); + CloseSocket(hSocket); return error("Error reading proxy response"); } if (pchRet2[0] != 0x05) { - closesocket(hSocket); + CloseSocket(hSocket); return error("Proxy failed to accept request"); } if (pchRet2[1] != 0x00) { - closesocket(hSocket); + CloseSocket(hSocket); switch (pchRet2[1]) { case 0x01: return error("Proxy error: general failure"); @@ -282,7 +282,7 @@ bool static Socks5(string strDest, int port, SOCKET& hSocket) } if (pchRet2[2] != 0x00) { - closesocket(hSocket); + CloseSocket(hSocket); return error("Error: malformed proxy response"); } char pchRet3[256]; @@ -294,23 +294,23 @@ bool static Socks5(string strDest, int port, SOCKET& hSocket) { ret = recv(hSocket, pchRet3, 1, 0) != 1; if (ret) { - closesocket(hSocket); + CloseSocket(hSocket); return error("Error reading from proxy"); } int nRecv = pchRet3[0]; ret = recv(hSocket, pchRet3, nRecv, 0) != nRecv; break; } - default: closesocket(hSocket); return error("Error: malformed proxy response"); + default: CloseSocket(hSocket); return error("Error: malformed proxy response"); } if (ret) { - closesocket(hSocket); + CloseSocket(hSocket); return error("Error reading from proxy"); } if (recv(hSocket, pchRet3, 2, 0) != 2) { - closesocket(hSocket); + CloseSocket(hSocket); return error("Error reading from proxy"); } LogPrintf("SOCKS5 connected %s\n", strDest); @@ -344,7 +344,7 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe if (fcntl(hSocket, F_SETFL, fFlags | O_NONBLOCK) == -1) #endif { - closesocket(hSocket); + CloseSocket(hSocket); return false; } @@ -365,13 +365,13 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe if (nRet == 0) { LogPrint("net", "connection to %s timeout\n", addrConnect.ToString()); - closesocket(hSocket); + CloseSocket(hSocket); return false; } if (nRet == SOCKET_ERROR) { LogPrintf("select() for %s failed: %s\n", addrConnect.ToString(), NetworkErrorString(WSAGetLastError())); - closesocket(hSocket); + CloseSocket(hSocket); return false; } socklen_t nRetSize = sizeof(nRet); @@ -382,13 +382,13 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe #endif { LogPrintf("getsockopt() for %s failed: %s\n", addrConnect.ToString(), NetworkErrorString(WSAGetLastError())); - closesocket(hSocket); + CloseSocket(hSocket); return false; } if (nRet != 0) { LogPrintf("connect() to %s failed after select(): %s\n", addrConnect.ToString(), NetworkErrorString(nRet)); - closesocket(hSocket); + CloseSocket(hSocket); return false; } } @@ -399,7 +399,7 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe #endif { LogPrintf("connect() to %s failed: %s\n", addrConnect.ToString(), NetworkErrorString(WSAGetLastError())); - closesocket(hSocket); + CloseSocket(hSocket); return false; } } @@ -415,7 +415,7 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe if (fcntl(hSocket, F_SETFL, fFlags & ~O_NONBLOCK) == SOCKET_ERROR) #endif { - closesocket(hSocket); + CloseSocket(hSocket); return false; } @@ -1258,3 +1258,16 @@ std::string NetworkErrorString(int err) return strprintf("%s (%d)", s, err); } #endif + +bool CloseSocket(SOCKET& hSocket) +{ + if (hSocket == INVALID_SOCKET) + return false; +#ifdef WIN32 + int ret = closesocket(hSocket); +#else + int ret = close(hSocket); +#endif + hSocket = INVALID_SOCKET; + return ret != SOCKET_ERROR; +} diff --git a/src/netbase.h b/src/netbase.h index ad1e230834..05221a5fde 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -178,5 +178,7 @@ bool ConnectSocket(const CService &addr, SOCKET& hSocketRet, int nTimeout = nCon bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest, int portDefault = 0, int nTimeout = nConnectTimeout); /** Return readable error string for a network error code */ std::string NetworkErrorString(int err); +/** Close socket and set hSocket to INVALID_SOCKET */ +bool CloseSocket(SOCKET& hSocket); #endif From eaedb59e0570558a528eac52f7fd89639911496e Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 9 Jul 2014 11:00:00 +0200 Subject: [PATCH 0390/1288] net: add SetSocketNonBlocking() as OS independent wrapper --- src/net.cpp | 19 +++----------- src/netbase.cpp | 70 +++++++++++++++++++++++++++++-------------------- src/netbase.h | 2 ++ 3 files changed, 47 insertions(+), 44 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 441bde3e90..e0f0f14f2b 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -501,14 +501,8 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest) addrman.Attempt(addrConnect); // Set to non-blocking -#ifdef WIN32 - u_long nOne = 1; - if (ioctlsocket(hSocket, FIONBIO, &nOne) == SOCKET_ERROR) - LogPrintf("ConnectSocket() : ioctlsocket non-blocking setting failed, error %s\n", NetworkErrorString(WSAGetLastError())); -#else - if (fcntl(hSocket, F_SETFL, O_NONBLOCK) == SOCKET_ERROR) - LogPrintf("ConnectSocket() : fcntl non-blocking setting failed, error %s\n", NetworkErrorString(errno)); -#endif + if (!SetSocketNonBlocking(hSocket, true)) + LogPrintf("ConnectNode: Setting socket to non-blocking failed, error %s\n", NetworkErrorString(WSAGetLastError())); // Add node CNode* pnode = new CNode(hSocket, addrConnect, pszDest ? pszDest : "", false); @@ -1642,14 +1636,9 @@ bool BindListenPort(const CService &addrBind, string& strError, bool fWhiteliste setsockopt(hListenSocket, SOL_SOCKET, SO_REUSEADDR, (void*)&nOne, sizeof(int)); #endif -#ifdef WIN32 // Set to non-blocking, incoming connections will also inherit this - if (ioctlsocket(hListenSocket, FIONBIO, (u_long*)&nOne) == SOCKET_ERROR) -#else - if (fcntl(hListenSocket, F_SETFL, O_NONBLOCK) == SOCKET_ERROR) -#endif - { - strError = strprintf("Error: Couldn't set properties on socket for incoming connections (error %s)", NetworkErrorString(WSAGetLastError())); + if (!SetSocketNonBlocking(hListenSocket, true)) { + strError = strprintf("BindListenPort: Setting listening socket to non-blocking failed, error %s\n", NetworkErrorString(WSAGetLastError())); LogPrintf("%s\n", strError); return false; } diff --git a/src/netbase.cpp b/src/netbase.cpp index e9f3515456..af6d11f0e2 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -7,10 +7,6 @@ #include "bitcoin-config.h" #endif -#ifdef HAVE_GETADDRINFO_A -#include -#endif - #include "netbase.h" #include "hash.h" @@ -18,6 +14,10 @@ #include "uint256.h" #include "util.h" +#ifdef HAVE_GETADDRINFO_A +#include +#endif + #ifndef WIN32 #if HAVE_INET_PTON #include @@ -331,22 +331,15 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe SOCKET hSocket = socket(((struct sockaddr*)&sockaddr)->sa_family, SOCK_STREAM, IPPROTO_TCP); if (hSocket == INVALID_SOCKET) return false; + #ifdef SO_NOSIGPIPE int set = 1; setsockopt(hSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&set, sizeof(int)); #endif -#ifdef WIN32 - u_long fNonblock = 1; - if (ioctlsocket(hSocket, FIONBIO, &fNonblock) == SOCKET_ERROR) -#else - int fFlags = fcntl(hSocket, F_GETFL, 0); - if (fcntl(hSocket, F_SETFL, fFlags | O_NONBLOCK) == -1) -#endif - { - CloseSocket(hSocket); - return false; - } + // Set to non-blocking + if (!SetSocketNonBlocking(hSocket, true)) + return error("ConnectSocketDirectly: Setting socket to non-blocking failed, error %s\n", NetworkErrorString(WSAGetLastError())); if (connect(hSocket, (struct sockaddr*)&sockaddr, len) == SOCKET_ERROR) { @@ -404,20 +397,10 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe } } - // this isn't even strictly necessary - // CNode::ConnectNode immediately turns the socket back to non-blocking - // but we'll turn it back to blocking just in case -#ifdef WIN32 - fNonblock = 0; - if (ioctlsocket(hSocket, FIONBIO, &fNonblock) == SOCKET_ERROR) -#else - fFlags = fcntl(hSocket, F_GETFL, 0); - if (fcntl(hSocket, F_SETFL, fFlags & ~O_NONBLOCK) == SOCKET_ERROR) -#endif - { - CloseSocket(hSocket); - return false; - } + // This is required when using SOCKS5 proxy! + // CNode::ConnectNode turns the socket back to non-blocking. + if (!SetSocketNonBlocking(hSocket, false)) + return error("ConnectSocketDirectly: Setting socket to blocking failed, error %s\n", NetworkErrorString(WSAGetLastError())); hSocketRet = hSocket; return true; @@ -1271,3 +1254,32 @@ bool CloseSocket(SOCKET& hSocket) hSocket = INVALID_SOCKET; return ret != SOCKET_ERROR; } + +bool SetSocketNonBlocking(SOCKET& hSocket, bool fNonBlocking) +{ + if (fNonBlocking) { +#ifdef WIN32 + u_long nOne = 1; + if (ioctlsocket(hSocket, FIONBIO, &nOne) == SOCKET_ERROR) { +#else + int fFlags = fcntl(hSocket, F_GETFL, 0); + if (fcntl(hSocket, F_SETFL, fFlags | O_NONBLOCK) == SOCKET_ERROR) { +#endif + CloseSocket(hSocket); + return false; + } + } else { +#ifdef WIN32 + u_long nZero = 0; + if (ioctlsocket(hSocket, FIONBIO, &nZero) == SOCKET_ERROR) { +#else + int fFlags = fcntl(hSocket, F_GETFL, 0); + if (fcntl(hSocket, F_SETFL, fFlags & ~O_NONBLOCK) == SOCKET_ERROR) { +#endif + CloseSocket(hSocket); + return false; + } + } + + return true; +} diff --git a/src/netbase.h b/src/netbase.h index 05221a5fde..7d83e35344 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -180,5 +180,7 @@ bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest std::string NetworkErrorString(int err); /** Close socket and set hSocket to INVALID_SOCKET */ bool CloseSocket(SOCKET& hSocket); +/** Disable or enable blocking-mode for a socket */ +bool SetSocketNonBlocking(SOCKET& hSocket, bool fNonBlocking); #endif From c994d2e769239036626fe51c59daea4085fc3d54 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 17 Jul 2014 22:33:58 +0200 Subject: [PATCH 0391/1288] prevent SOCKET leak in BindListenPort() - the call to CloseSocket() is placed after the WSAGetLastError(), because a CloseSocket() can trigger an error also, which we don't want for the logging in this two cases --- src/net.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/net.cpp b/src/net.cpp index 441bde3e90..b55cd72e86 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1678,6 +1678,7 @@ bool BindListenPort(const CService &addrBind, string& strError, bool fWhiteliste else strError = strprintf(_("Unable to bind to %s on this computer (bind returned error %s)"), addrBind.ToString(), NetworkErrorString(nErr)); LogPrintf("%s\n", strError); + CloseSocket(hListenSocket); return false; } LogPrintf("Bound to %s\n", addrBind.ToString()); @@ -1687,6 +1688,7 @@ bool BindListenPort(const CService &addrBind, string& strError, bool fWhiteliste { strError = strprintf(_("Error: Listening for incoming connections failed (listen returned error %s)"), NetworkErrorString(WSAGetLastError())); LogPrintf("%s\n", strError); + CloseSocket(hListenSocket); return false; } From acd432b5b38464ef3ecb87f80b1bbebe9d7c2022 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 13 Jul 2014 10:19:56 +0200 Subject: [PATCH 0392/1288] [Qt] Prevent balloon-spam after rescan --- src/qt/walletmodel.cpp | 13 +++++++++++-- src/qt/walletmodel.h | 4 ++++ src/qt/walletview.cpp | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 7317c32766..7df8812ccd 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -35,6 +35,8 @@ WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *p cachedEncryptionStatus(Unencrypted), cachedNumBlocks(0) { + fProcessingQueuedTransactions = false; + addressTableModel = new AddressTableModel(wallet, this); transactionTableModel = new TransactionTableModel(wallet, this); recentRequestsTableModel = new RecentRequestsTableModel(wallet, this); @@ -492,8 +494,15 @@ static void ShowProgress(WalletModel *walletmodel, const std::string &title, int if (nProgress == 100) { fQueueNotifications = false; - BOOST_FOREACH(const PAIRTYPE(uint256, ChangeType)& notification, vQueueNotifications) - NotifyTransactionChanged(walletmodel, NULL, notification.first, notification.second); + if (vQueueNotifications.size() > 10) // prevent balloon spam, show maximum 10 balloons + QMetaObject::invokeMethod(walletmodel, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, true)); + for (unsigned int i = 0; i < vQueueNotifications.size(); ++i) + { + if (vQueueNotifications.size() - i <= 10) + QMetaObject::invokeMethod(walletmodel, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, false)); + + NotifyTransactionChanged(walletmodel, NULL, vQueueNotifications[i].first, vQueueNotifications[i].second); + } std::vector >().swap(vQueueNotifications); // clear } } diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 7ad54ff8e6..2bb91d85a9 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -133,6 +133,7 @@ public: qint64 getWatchImmatureBalance() const; int getNumTransactions() const; EncryptionStatus getEncryptionStatus() const; + bool processingQueuedTransactions() { return fProcessingQueuedTransactions; } // Check address for validity bool validateAddress(const QString &address); @@ -196,6 +197,7 @@ public: private: CWallet *wallet; + bool fProcessingQueuedTransactions; // Wallet has an options model for wallet-specific options // (transaction fee, for example) @@ -256,6 +258,8 @@ public slots: void updateAddressBook(const QString &address, const QString &label, bool isMine, const QString &purpose, int status); /* Current, immature or unconfirmed balance might have changed - emit 'balanceChanged' if so */ void pollBalanceChanged(); + /* Needed to update fProcessingQueuedTransactions through a QueuedConnection */ + void setProcessingQueuedTransactions(bool value) { fProcessingQueuedTransactions = value; } }; #endif // WALLETMODEL_H diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index 1cef48344f..b40ddc0a2f 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -137,7 +137,7 @@ void WalletView::setWalletModel(WalletModel *walletModel) void WalletView::processNewTransaction(const QModelIndex& parent, int start, int /*end*/) { // Prevent balloon-spam when initial block download is in progress - if (!walletModel || !clientModel || clientModel->inInitialBlockDownload()) + if (!walletModel || walletModel->processingQueuedTransactions() || !clientModel || clientModel->inInitialBlockDownload()) return; TransactionTableModel *ttm = walletModel->getTransactionTableModel(); From 1e72d5c03335e472cf5b9207419d6125fed9aec4 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 17 Jul 2014 22:03:27 -0400 Subject: [PATCH 0393/1288] build: silence false errors during make clean --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 90e0a43beb..ff23747592 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -276,7 +276,7 @@ EXTRA_DIST = leveldb secp256k1 clean-local: -$(MAKE) -C leveldb clean - -$(MAKE) -C secp256k1 clean + -$(MAKE) -C secp256k1 clean 2>/dev/null rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno -rm -f config.h From ab123ad4d6da65800a1cf4cf45a7171d97a77254 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 3 Jun 2014 23:42:53 -0400 Subject: [PATCH 0394/1288] build: allow linux and osx to build against static qt5 This is the first part of a huge effort to rework the handling of dependencies. To start, this change allows all supported platforms to build against a static Qt. 5.2.1 and 5.3 have been successfully tested against osx64, win32, win64, linux32, and linux64. It also makes a small change to the windows config, to allow linking against qt builds with or without built-in libjpeg/libpng/libpcre/libz. The actual build processes to take advantage of these changes (for gitian and pull-tester) are coming soon. Until then, this should be a no-op. --- configure.ac | 3 ++ src/m4/bitcoin_qt.m4 | 107 ++++++++++++++++++++++++------------------- src/qt/bitcoin.cpp | 6 +++ 3 files changed, 70 insertions(+), 46 deletions(-) diff --git a/configure.ac b/configure.ac index d3500b4d93..b454ac515f 100644 --- a/configure.ac +++ b/configure.ac @@ -258,6 +258,9 @@ case $host in CPPFLAGS="$CPPFLAGS -DMAC_OSX" ;; + *linux*) + TARGET_OS=linux + ;; *) ;; esac diff --git a/src/m4/bitcoin_qt.m4 b/src/m4/bitcoin_qt.m4 index 244b03a5c2..3499a09b7b 100644 --- a/src/m4/bitcoin_qt.m4 +++ b/src/m4/bitcoin_qt.m4 @@ -94,6 +94,63 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG]) fi + dnl This is ugly and complicated. Yuck. Works as follows: + dnl We can't discern whether Qt4 builds are static or not. For Qt5, we can + dnl check a header to find out. When Qt is built statically, some plugins must + dnl be linked into the final binary as well. These plugins have changed between + dnl Qt4 and Qt5. With Qt5, languages moved into core and the WindowsIntegration + dnl plugin was added. Since we can't tell if Qt4 is static or not, it is + dnl assumed for windows builds. + dnl _BITCOIN_QT_CHECK_STATIC_PLUGINS does a quick link-check and appends the + dnl results to QT_LIBS. + BITCOIN_QT_CHECK([ + TEMP_CPPFLAGS=$CPPFLAGS + CPPFLAGS=$QT_INCLUDES + if test x$bitcoin_qt_got_major_vers == x5; then + _BITCOIN_QT_IS_STATIC + if test x$bitcoin_cv_static_qt == xyes; then + AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) + if test x$qt_plugin_path != x; then + QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible" + if test x$bitcoin_qt_got_major_vers == x5; then + QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms" + else + QT_LIBS="$QT_LIBS -L$qt_plugin_path/codecs" + fi + fi + if test x$use_pkgconfig = xyes; then + PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"]) + fi + _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(AccessibleFactory)], [-lqtaccessiblewidgets]) + if test x$TARGET_OS == xwindows; then + _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)],[-lqwindows]) + AC_DEFINE(QT_QPA_PLATFORM_WINDOWS, 1, [Define this symbol if the qt platform is windows]) + elif test x$TARGET_OS == xlinux; then + _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)],[-lqxcb -lxcb-static -lxcb]) + AC_DEFINE(QT_QPA_PLATFORM_XCB, 1, [Define this symbol if the qt platform is xcb]) + elif test x$TARGET_OS == xdarwin; then + if test x$use_pkgconfig = xyes; then + PKG_CHECK_MODULES([QTPRINT], [Qt5PrintSupport], [QT_LIBS="$QTPRINT_LIBS $QT_LIBS"]) + fi + AX_CHECK_LINK_FLAG([[-framework IOKit]],[QT_LIBS="$QT_LIBS -framework IOKit"],[AC_MSG_ERROR(could not iokit framework)]) + _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)],[-lqcocoa]) + AC_DEFINE(QT_QPA_PLATFORM_COCOA, 1, [Define this symbol if the qt platform is cocoa]) + fi + fi + else + if test x$TARGET_OS == xwindows; then + AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) + _BITCOIN_QT_CHECK_STATIC_PLUGINS([ + Q_IMPORT_PLUGIN(qcncodecs) + Q_IMPORT_PLUGIN(qjpcodecs) + Q_IMPORT_PLUGIN(qtwcodecs) + Q_IMPORT_PLUGIN(qkrcodecs) + Q_IMPORT_PLUGIN(AccessibleFactory)], + [-lqcncodecs -lqjpcodecs -lqtwcodecs -lqkrcodecs -lqtaccessiblewidgets]) + fi + fi + CPPFLAGS=$TEMP_CPPFLAGS + ]) BITCOIN_QT_PATH_PROGS([MOC], [moc-qt${bitcoin_qt_got_major_vers} moc${bitcoin_qt_got_major_vers} moc], $qt_bin_path) BITCOIN_QT_PATH_PROGS([UIC], [uic-qt${bitcoin_qt_got_major_vers} uic${bitcoin_qt_got_major_vers} uic], $qt_bin_path) BITCOIN_QT_PATH_PROGS([RCC], [rcc-qt${bitcoin_qt_got_major_vers} rcc${bitcoin_qt_got_major_vers} rcc], $qt_bin_path) @@ -303,26 +360,15 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ ]) BITCOIN_QT_CHECK([ - LIBS= - if test x$qt_lib_path != x; then - LIBS="$LIBS -L$qt_lib_path" - fi - if test x$qt_plugin_path != x; then - LIBS="$LIBS -L$qt_plugin_path/accessible" - if test x$bitcoin_qt_got_major_vers == x5; then - LIBS="$LIBS -L$qt_plugin_path/platforms" - else - LIBS="$LIBS -L$qt_plugin_path/codecs" - fi - fi - if test x$TARGET_OS == xwindows; then AC_CHECK_LIB([imm32], [main],, BITCOIN_QT_FAIL(libimm32 not found)) fi ]) - BITCOIN_QT_CHECK(AC_CHECK_LIB([z] ,[main],,BITCOIN_QT_FAIL(zlib not found))) - BITCOIN_QT_CHECK(AC_CHECK_LIB([png] ,[main],,BITCOIN_QT_FAIL(png not found))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([z] ,[main],,AC_MSG_WARN([zlib not found. Assuming qt has it built-in]))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([png] ,[main],,AC_MSG_WARN([libpng not found. Assuming qt has it built-in]))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([jpeg] ,[main],,AC_MSG_WARN([libjpeg not found. Assuming qt has it built-in]))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([pcre] ,[main],,AC_MSG_WARN([libpcre not found. Assuming qt has it built-in]))) BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Core] ,[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXCore not found))) BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Gui] ,[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXGui not found))) BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Network],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXNetwork not found))) @@ -332,37 +378,6 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ QT_LIBS="$LIBS" LIBS="$TEMP_LIBS" - dnl This is ugly and complicated. Yuck. Works as follows: - dnl We can't discern whether Qt4 builds are static or not. For Qt5, we can - dnl check a header to find out. When Qt is built statically, some plugins must - dnl be linked into the final binary as well. These plugins have changed between - dnl Qt4 and Qt5. With Qt5, languages moved into core and the WindowsIntegration - dnl plugin was added. Since we can't tell if Qt4 is static or not, it is - dnl assumed for all non-pkg-config builds. - dnl _BITCOIN_QT_CHECK_STATIC_PLUGINS does a quick link-check and appends the - dnl results to QT_LIBS. - BITCOIN_QT_CHECK([ - if test x$bitcoin_qt_got_major_vers == x5; then - _BITCOIN_QT_IS_STATIC - if test x$bitcoin_cv_static_qt == xyes; then - AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) - _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(AccessibleFactory)], [-lqtaccessiblewidgets]) - if test x$TARGET_OS == xwindows; then - _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)],[-lqwindows]) - fi - fi - else - AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) - _BITCOIN_QT_CHECK_STATIC_PLUGINS([ - Q_IMPORT_PLUGIN(qcncodecs) - Q_IMPORT_PLUGIN(qjpcodecs) - Q_IMPORT_PLUGIN(qtwcodecs) - Q_IMPORT_PLUGIN(qkrcodecs) - Q_IMPORT_PLUGIN(AccessibleFactory)], - [-lqcncodecs -lqjpcodecs -lqtwcodecs -lqkrcodecs -lqtaccessiblewidgets]) - fi - ]) - BITCOIN_QT_CHECK([ LIBS= if test x$qt_lib_path != x; then diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 43466663fa..afd591efb2 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -53,7 +53,13 @@ Q_IMPORT_PLUGIN(qkrcodecs) Q_IMPORT_PLUGIN(qtaccessiblewidgets) #else Q_IMPORT_PLUGIN(AccessibleFactory) +#if defined(QT_QPA_PLATFORM_XCB) +Q_IMPORT_PLUGIN(QXcbIntegrationPlugin); +#elif defined(QT_QPA_PLATFORM_WINDOWS) Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin); +#elif defined(QT_QPA_PLATFORM_COCOA) +Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin); +#endif #endif #endif From 2d89ea9781d25b887b7804ee0e5749fbe044f455 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 3 Jun 2014 23:43:36 -0400 Subject: [PATCH 0395/1288] build: fix whitespace in pkg-config variable Useful for PKG_CONFIG="pkg-config --static" --- configure.ac | 2 +- src/m4/bitcoin_qt.m4 | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index b454ac515f..cedc34e520 100644 --- a/configure.ac +++ b/configure.ac @@ -526,7 +526,7 @@ BITCOIN_QT_INIT if test x$use_pkgconfig = xyes; then - if test x$PKG_CONFIG == x; then + if test x"$PKG_CONFIG" == "x"; then AC_MSG_ERROR(pkg-config not found.) fi diff --git a/src/m4/bitcoin_qt.m4 b/src/m4/bitcoin_qt.m4 index 3499a09b7b..9356aac37f 100644 --- a/src/m4/bitcoin_qt.m4 +++ b/src/m4/bitcoin_qt.m4 @@ -86,9 +86,6 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ fi if test x$use_pkgconfig = xyes; then - if test x$PKG_CONFIG == x; then - AC_MSG_ERROR(pkg-config not found.) - fi BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG([$2])]) else BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG]) From ed02282bba468ec7224b7e836d3fe4543bf5ba1e Mon Sep 17 00:00:00 2001 From: Otto Allmendinger Date: Fri, 18 Jul 2014 10:29:49 +0200 Subject: [PATCH 0396/1288] additional test for OP_SIZE in script_valid.json --- src/test/data/script_valid.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index 7546a3b1fe..2827126f29 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -126,6 +126,7 @@ ["-9223372036854775807", "SIZE 8 EQUAL"], ["'abcdefghijklmnopqrstuvwxyz'", "SIZE 26 EQUAL"], +["42", "SIZE 1 EQUALVERIFY 42 EQUAL", "SIZE does not consume argument"], ["2 -2 ADD", "0 EQUAL"], ["2147483647 -2147483647 ADD", "0 EQUAL"], From 0072d98849dd12de1599af894edbeee271fceb76 Mon Sep 17 00:00:00 2001 From: Otto Allmendinger Date: Fri, 18 Jul 2014 10:53:09 +0200 Subject: [PATCH 0397/1288] script tests: BOOLAND, BOOLOR decode to integer unlike other boolean checks, arguments >5 bytes invalidate the script --- src/test/data/script_invalid.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index d623e974b8..eaac747fd2 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -272,6 +272,9 @@ ["2147483647", "1ADD 1SUB 1", "We cannot do math on 5-byte integers, even if the result is 4-bytes"], ["2147483648", "1SUB 1", "We cannot do math on 5-byte integers, even if the result is 4-bytes"], +["2147483648 1", "BOOLOR 1", "We cannot do BOOLOR on 5-byte integers (but we can still do IF etc)"], +["2147483648 1", "BOOLAND 1", "We cannot do BOOLAND on 5-byte integers"], + ["1", "1 ENDIF", "ENDIF without IF"], ["1", "IF 1", "IF without ENDIF"], ["1 IF 1", "ENDIF", "IFs don't carry over"], From 833ff161bc5e44ce59b16e0ce316818f8ae69d8a Mon Sep 17 00:00:00 2001 From: Otto Allmendinger Date: Fri, 18 Jul 2014 10:54:04 +0200 Subject: [PATCH 0398/1288] script tests: values that overflow to 0 are true --- src/test/data/script_valid.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index 2827126f29..27778fb1d4 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -10,6 +10,7 @@ [" 1 2 ", "2 EQUALVERIFY 1 EQUAL"], ["1", ""], +["0x09 0x00000000 0x00000000 0x10", "", "equals zero when cast to Int64"], ["0x01 0x0b", "11 EQUAL", "push 1 byte"], ["0x02 0x417a", "'Az' EQUAL"], From 4cac5dbf83a3069e9d25051f4c832c537a527495 Mon Sep 17 00:00:00 2001 From: Otto Allmendinger Date: Fri, 18 Jul 2014 12:55:46 +0200 Subject: [PATCH 0399/1288] script tests: value with trailing 0x00 is true --- src/test/data/script_valid.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index 27778fb1d4..af0326ad92 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -10,6 +10,7 @@ [" 1 2 ", "2 EQUALVERIFY 1 EQUAL"], ["1", ""], +["0x02 0x01 0x00", "", "all bytes are significant, not only the last one"], ["0x09 0x00000000 0x00000000 0x10", "", "equals zero when cast to Int64"], ["0x01 0x0b", "11 EQUAL", "push 1 byte"], From 5bb765507b394e1fe205355b0b9937d95f8a39e6 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 18 Jul 2014 13:24:38 +0200 Subject: [PATCH 0400/1288] Fix a signed/unsigned warning introduced in 1b4568c vout counter must be unsigned. --- src/wallet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index 89a260480e..efefb71b6d 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -815,7 +815,7 @@ void CWalletTx::GetAmounts(list& listReceived, } // Sent/received. - for (int i = 0; i < vout.size(); ++i) + for (unsigned int i = 0; i < vout.size(); ++i) { const CTxOut& txout = vout[i]; isminetype fIsMine = pwallet->IsMine(txout); @@ -840,7 +840,7 @@ void CWalletTx::GetAmounts(list& listReceived, address = CNoDestination(); } - COutputEntry output = {address, txout.nValue, i}; + COutputEntry output = {address, txout.nValue, (int)i}; // If we are debited by the transaction, add the output as a "sent" entry if (nDebit > 0) From 89101c6e78d1640dae06a2b978b752e69aa504a0 Mon Sep 17 00:00:00 2001 From: Otto Allmendinger Date: Fri, 18 Jul 2014 15:41:45 +0200 Subject: [PATCH 0401/1288] script test: test case for 5-byte bools --- src/test/data/script_valid.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index af0326ad92..082c65efed 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -66,6 +66,7 @@ ["0", "IF RETURN ENDIF 1", "RETURN only works if executed"], ["1 1", "VERIFY"], +["1 0x05 0x01 0x00 0x00 0x00 0x00", "VERIFY", "values >4 bytes can be cast to boolean"], ["10 0 11 TOALTSTACK DROP FROMALTSTACK", "ADD 21 EQUAL"], ["'gavin_was_here' TOALTSTACK 11 FROMALTSTACK", "'gavin_was_here' EQUALVERIFY 11 EQUAL"], From 3da434a2ef9ac76a0ad4a33921773a9ac8f10ab7 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 16 Jul 2014 20:04:04 -0400 Subject: [PATCH 0402/1288] Introduce option to disable relay/mining of bare multisig scripts in TX outputs First and foremost, this defaults to OFF. This option lets a node consider such transactions non-standard, meaning they will not be relayed or mined by default, but other miners are free to mine these as usual. --- src/init.cpp | 6 +++++- src/main.cpp | 7 ++++++- src/main.h | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index b80d718f01..031b9db480 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -248,6 +248,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -maxsendbuffer= " + _("Maximum per-connection send buffer, *1000 bytes (default: 1000)") + "\n"; strUsage += " -onion= " + _("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy)") + "\n"; strUsage += " -onlynet= " + _("Only connect to nodes in network (IPv4, IPv6 or Tor)") + "\n"; + strUsage += " -permitbaremultisig " + _("Relay non-P2SH multisig (default: 1)") + "\n"; strUsage += " -port= " + _("Listen for connections on (default: 8333 or testnet: 18333)") + "\n"; strUsage += " -proxy= " + _("Connect through SOCKS5 proxy") + "\n"; strUsage += " -seednode= " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n"; @@ -676,7 +677,10 @@ bool AppInit2(boost::thread_group& threadGroup) bSpendZeroConfChange = GetArg("-spendzeroconfchange", true); std::string strWalletFile = GetArg("-wallet", "wallet.dat"); -#endif +#endif // ENABLE_WALLET + + fIsBareMultisigStd = GetArg("-permitbaremultisig", true); + // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log // Sanity check if (!InitSanityCheck()) diff --git a/src/main.cpp b/src/main.cpp index 766f0970f0..dd9e76378e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -48,6 +48,7 @@ bool fImporting = false; bool fReindex = false; bool fBenchmark = false; bool fTxIndex = false; +bool fIsBareMultisigStd = true; unsigned int nCoinCacheSize = 5000; /** Fees smaller than this (in satoshi) are considered zero fee (for relaying and mining) */ @@ -604,9 +605,13 @@ bool IsStandardTx(const CTransaction& tx, string& reason) reason = "scriptpubkey"; return false; } + if (whichType == TX_NULL_DATA) nDataOut++; - else if (txout.IsDust(::minRelayTxFee)) { + else if ((whichType == TX_MULTISIG) && (!fIsBareMultisigStd)) { + reason = "bare-multisig"; + return false; + } else if (txout.IsDust(::minRelayTxFee)) { reason = "dust"; return false; } diff --git a/src/main.h b/src/main.h index a683412571..20a83db605 100644 --- a/src/main.h +++ b/src/main.h @@ -94,6 +94,7 @@ extern bool fReindex; extern bool fBenchmark; extern int nScriptCheckThreads; extern bool fTxIndex; +extern bool fIsBareMultisigStd; extern unsigned int nCoinCacheSize; extern CFeeRate minRelayTxFee; From d2d9dc063f8da87e02e588064f8ea9253e201907 Mon Sep 17 00:00:00 2001 From: Otto Allmendinger Date: Fri, 18 Jul 2014 17:55:06 +0200 Subject: [PATCH 0403/1288] script tests: add tests for CHECKMULTISIG limits --- src/test/data/script_invalid.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index eaac747fd2..e3e1ccbf3c 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -352,6 +352,9 @@ "NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY"], +["0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21", "21 CHECKMULTISIG 1", "nPubKeys > 20"], +["0 'sig' 1 0", "CHECKMULTISIG 1", "nSigs > nPubKeys"], + ["NOP 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL", "Tests for Script.IsPushOnly()"], ["NOP1 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL"], From 92b8587e1287cf52d753d3c31cf5ee7a32b34a9f Mon Sep 17 00:00:00 2001 From: elkingtowa Date: Fri, 18 Jul 2014 15:04:54 -0400 Subject: [PATCH 0404/1288] Update README.md Added two modifications to make the descriptions more clear. --- contrib/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/README.md b/contrib/README.md index 92d0a343db..63b1875d30 100644 --- a/contrib/README.md +++ b/contrib/README.md @@ -21,11 +21,11 @@ Construct a linear, no-fork, best version of the blockchain. ### [PyMiner](/contrib/pyminer) ### -This is a 'getwork' CPU mining client for Bitcoin. It is pure-python, and therefore very, very slow. The purpose is to provide a reference implementation of a miner, for study. +This is a 'getwork' CPU mining client for Bitcoin. It is pure-python, and therefore very, very slow. The purpose is to provide a reference implementation of a miner in order to study and develop other mining programs. ### [Qos](/contrib/qos) ### -A Linux bash script that will set up tc to limit the outgoing bandwidth for connections to the Bitcoin network. This means one can have an always-on bitcoind instance running, and another local bitcoind/bitcoin-qt instance which connects to this node and receives blocks from it. +A Linux bash script that will set up traffic control (tc) to limit the outgoing bandwidth for connections to the Bitcoin network. This means one can have an always-on bitcoind instance running, and another local bitcoind/bitcoin-qt instance which connects to this node and receives blocks from it. ### [Seeds](/contrib/seeds) ### Utility to generate the pnSeed[] array that is compiled into the client. From b9345f7d1c071fbbef75d79ac6a2ca8636c599e9 Mon Sep 17 00:00:00 2001 From: Whit J Date: Mon, 14 Jul 2014 11:22:35 -0700 Subject: [PATCH 0405/1288] qt: Make error message for failed export a little friendlier Closes #4528. --- src/qt/addressbookpage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp index 5df8f19729..f336d47e83 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -282,7 +282,7 @@ void AddressBookPage::on_exportButton_clicked() if(!writer.write()) { QMessageBox::critical(this, tr("Exporting Failed"), - tr("There was an error trying to save the address list to %1.").arg(filename)); + tr("There was an error trying to save the address list to %1. Please try again.").arg(filename)); } } From 027dcdc792e006ea90afe90b7373ba5a111bd9bc Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 20 Jul 2014 04:17:02 +0200 Subject: [PATCH 0406/1288] [Qt] Fix thin space in URI --- src/qt/coincontroldialog.cpp | 2 +- src/qt/guiutil.cpp | 2 +- src/qt/recentrequeststablemodel.cpp | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index b4ddda3eaa..7b30f8de09 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -225,7 +225,7 @@ void CoinControlDialog::showMenu(const QPoint &point) // context menu action: copy amount void CoinControlDialog::copyAmount() { - GUIUtil::setClipboard(contextMenuItem->text(COLUMN_AMOUNT)); + GUIUtil::setClipboard(BitcoinUnits::removeSpaces(contextMenuItem->text(COLUMN_AMOUNT))); } // context menu action: copy label diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 60a131df7e..33a50a078d 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -187,7 +187,7 @@ QString formatBitcoinURI(const SendCoinsRecipient &info) if (info.amount) { - ret += QString("?amount=%1").arg(BitcoinUnits::format(BitcoinUnits::BTC, info.amount)); + ret += QString("?amount=%1").arg(BitcoinUnits::format(BitcoinUnits::BTC, info.amount, false, BitcoinUnits::separatorNever)); paramCount++; } diff --git a/src/qt/recentrequeststablemodel.cpp b/src/qt/recentrequeststablemodel.cpp index b5a998f9f5..9e3976644e 100644 --- a/src/qt/recentrequeststablemodel.cpp +++ b/src/qt/recentrequeststablemodel.cpp @@ -79,10 +79,17 @@ QVariant RecentRequestsTableModel::data(const QModelIndex &index, int role) cons case Amount: if (rec->recipient.amount == 0 && role == Qt::DisplayRole) return tr("(no amount)"); + else if (role == Qt::EditRole) + return BitcoinUnits::format(walletModel->getOptionsModel()->getDisplayUnit(), rec->recipient.amount, false, BitcoinUnits::separatorNever); else return BitcoinUnits::format(walletModel->getOptionsModel()->getDisplayUnit(), rec->recipient.amount); } } + else if (role == Qt::TextAlignmentRole) + { + if (index.column() == Amount) + return (int)(Qt::AlignRight|Qt::AlignVCenter); + } return QVariant(); } From 0de61e7585e14cb552e985934fc5ddfeb6e8bd67 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sun, 20 Jul 2014 13:49:58 +0200 Subject: [PATCH 0407/1288] qt: Move SplashFinished to after ClientModel/WalletModel creation With a large wallet there was a noticable gap between hiding of the splash and showing the main window. --- src/qt/bitcoin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index afd591efb2..7bf531f538 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -406,8 +406,6 @@ void BitcoinApplication::initializeResult(int retval) paymentServer->setOptionsModel(optionsModel); #endif - emit splashFinished(window); - clientModel = new ClientModel(optionsModel); window->setClientModel(clientModel); @@ -424,6 +422,8 @@ void BitcoinApplication::initializeResult(int retval) } #endif + emit splashFinished(window); + // If -min option passed, start window minimized. if(GetBoolArg("-min", false)) { From 67cc8f25c267ea7cde765f566fa10bc248c15ea2 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 17 Jul 2014 14:07:53 +0200 Subject: [PATCH 0408/1288] Revert "Remove signal DoubleSpendDetected, use function" This reverts commit 0da6b3fd187da3aa810aaa584d8bd197ad4fa2b9. --- src/init.cpp | 2 +- src/main.cpp | 103 ++++++++++++++++++++++++++++----------------------- src/main.h | 4 +- 3 files changed, 59 insertions(+), 50 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 031b9db480..323192ab79 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1229,7 +1229,7 @@ bool AppInit2(boost::thread_group& threadGroup) LogPrintf("mapAddressBook.size() = %u\n", pwalletMain ? pwalletMain->mapAddressBook.size() : 0); #endif - InitRespendFilter(); + RegisterInternalSignals(); StartNode(threadGroup); if (fServer) StartRPCThreads(); diff --git a/src/main.cpp b/src/main.cpp index dd9e76378e..7ff1bdb2e7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -126,14 +126,9 @@ namespace { } // anon namespace -// Bloom filter to limit respend relays to one +// Forward reference functions defined here: static const unsigned int MAX_DOUBLESPEND_BLOOM = 1000; -static CBloomFilter doubleSpendFilter; -void InitRespendFilter() { - seed_insecure_rand(); - doubleSpendFilter = CBloomFilter(MAX_DOUBLESPEND_BLOOM, 0.01, insecure_rand(), BLOOM_UPDATE_NONE); -} - +static bool RelayableRespend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter); ////////////////////////////////////////////////////////////////////////////// // @@ -157,10 +152,24 @@ struct CMainSignals { boost::signals2::signal Inventory; // Tells listeners to broadcast their data. boost::signals2::signal Broadcast; + // Notifies listeners of detection of a double-spent transaction. Arguments are outpoint that is + // double-spent, first transaction seen, double-spend transaction, and whether the second double-spend + // transaction was first seen in a block. + // Note: only notifies if the previous transaction is in the memory pool; if previous transction was in a block, + // then the double-spend simply fails when we try to lookup the inputs in the current UTXO set. + boost::signals2::signal DetectedDoubleSpend; } g_signals; } // anon namespace +void RegisterInternalSignals() { + static CBloomFilter doubleSpendFilter; + seed_insecure_rand(); + doubleSpendFilter = CBloomFilter(MAX_DOUBLESPEND_BLOOM, 0.01, insecure_rand(), BLOOM_UPDATE_NONE); + + g_signals.DetectedDoubleSpend.connect(boost::bind(RelayableRespend, _1, _2, _3, doubleSpendFilter)); +} + void RegisterWallet(CWalletInterface* pwalletIn) { g_signals.SyncTransaction.connect(boost::bind(&CWalletInterface::SyncTransaction, pwalletIn, _1, _2)); @@ -897,45 +906,6 @@ bool RateLimitExceeded(double& dCount, int64_t& nLastTime, int64_t nLimit, unsig return false; } -static bool RelayableRespend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter) -{ - // Relaying double-spend attempts to our peers lets them detect when - // somebody might be trying to cheat them. However, blindly relaying - // every double-spend across the entire network gives attackers - // a denial-of-service attack: just generate a stream of double-spends - // re-spending the same (limited) set of outpoints owned by the attacker. - // So, we use a bloom filter and only relay (at most) the first double - // spend for each outpoint. False-positives ("we have already relayed") - // are OK, because if the peer doesn't hear about the double-spend - // from us they are very likely to hear about it from another peer, since - // each peer uses a different, randomized bloom filter. - - if (fInBlock || filter.contains(outPoint)) return false; - - // Apply an independent rate limit to double-spend relays - static double dRespendCount; - static int64_t nLastRespendTime; - static int64_t nRespendLimit = GetArg("-limitrespendrelay", 100); - unsigned int nSize = ::GetSerializeSize(doubleSpend, SER_NETWORK, PROTOCOL_VERSION); - - if (RateLimitExceeded(dRespendCount, nLastRespendTime, nRespendLimit, nSize)) - { - LogPrint("mempool", "Double-spend relay rejected by rate limiter\n"); - return false; - } - - LogPrint("mempool", "Rate limit dRespendCount: %g => %g\n", dRespendCount, dRespendCount+nSize); - - // Clear the filter on average every MAX_DOUBLE_SPEND_BLOOM - // insertions - if (insecure_rand()%MAX_DOUBLESPEND_BLOOM == 0) - filter.clear(); - - filter.insert(outPoint); - - return true; -} - bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransaction &tx, bool fLimitFree, bool* pfMissingInputs, bool fRejectInsaneFee) { @@ -973,7 +943,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa // Does tx conflict with a member of the pool, and is it not equivalent to that member? if (pool.mapNextTx.count(outpoint) && !tx.IsEquivalentTo(*pool.mapNextTx[outpoint].ptx)) { - relayableRespend = RelayableRespend(outpoint, tx, false, doubleSpendFilter); + relayableRespend = g_signals.DetectedDoubleSpend(outpoint, tx, false); if (!relayableRespend) return false; } @@ -1085,6 +1055,45 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa return !relayableRespend; } +static bool RelayableRespend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter) +{ + // Relaying double-spend attempts to our peers lets them detect when + // somebody might be trying to cheat them. However, blindly relaying + // every double-spend across the entire network gives attackers + // a denial-of-service attack: just generate a stream of double-spends + // re-spending the same (limited) set of outpoints owned by the attacker. + // So, we use a bloom filter and only relay (at most) the first double + // spend for each outpoint. False-positives ("we have already relayed") + // are OK, because if the peer doesn't hear about the double-spend + // from us they are very likely to hear about it from another peer, since + // each peer uses a different, randomized bloom filter. + + if (fInBlock || filter.contains(outPoint)) return false; + + // Apply an independent rate limit to double-spend relays + static double dRespendCount; + static int64_t nLastRespendTime; + static int64_t nRespendLimit = GetArg("-limitrespendrelay", 100); + unsigned int nSize = ::GetSerializeSize(doubleSpend, SER_NETWORK, PROTOCOL_VERSION); + + if (RateLimitExceeded(dRespendCount, nLastRespendTime, nRespendLimit, nSize)) + { + LogPrint("mempool", "Double-spend relay rejected by rate limiter\n"); + return false; + } + + LogPrint("mempool", "Rate limit dRespendCount: %g => %g\n", dRespendCount, dRespendCount+nSize); + + // Clear the filter on average every MAX_DOUBLE_SPEND_BLOOM + // insertions + if (insecure_rand()%MAX_DOUBLESPEND_BLOOM == 0) + filter.clear(); + + filter.insert(outPoint); + + return true; +} + int CMerkleTx::GetDepthInMainChainINTERNAL(CBlockIndex* &pindexRet) const { diff --git a/src/main.h b/src/main.h index 20a83db605..33afa06fa8 100644 --- a/src/main.h +++ b/src/main.h @@ -112,8 +112,8 @@ struct CNodeStateStats; struct CBlockTemplate; -/** Initialize respend bloom filter **/ -void InitRespendFilter(); +/** Set up internal signal handlers **/ +void RegisterInternalSignals(); /** Register a wallet to receive updates from core */ void RegisterWallet(CWalletInterface* pwalletIn); From cd057bfd415815dd4fa219ef213640635d4b6d37 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 17 Jul 2014 14:08:01 +0200 Subject: [PATCH 0409/1288] Revert "Check signatures before respend relay" This reverts commit 88dd3598d22197a22565e524cecdc08107cf76ac. --- src/main.cpp | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 7ff1bdb2e7..f3819b1497 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -128,7 +128,7 @@ namespace { // Forward reference functions defined here: static const unsigned int MAX_DOUBLESPEND_BLOOM = 1000; -static bool RelayableRespend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter); +static void RelayDoubleSpend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter); ////////////////////////////////////////////////////////////////////////////// // @@ -157,7 +157,7 @@ struct CMainSignals { // transaction was first seen in a block. // Note: only notifies if the previous transaction is in the memory pool; if previous transction was in a block, // then the double-spend simply fails when we try to lookup the inputs in the current UTXO set. - boost::signals2::signal DetectedDoubleSpend; + boost::signals2::signal DetectedDoubleSpend; } g_signals; } // anon namespace @@ -167,7 +167,7 @@ void RegisterInternalSignals() { seed_insecure_rand(); doubleSpendFilter = CBloomFilter(MAX_DOUBLESPEND_BLOOM, 0.01, insecure_rand(), BLOOM_UPDATE_NONE); - g_signals.DetectedDoubleSpend.connect(boost::bind(RelayableRespend, _1, _2, _3, doubleSpendFilter)); + g_signals.DetectedDoubleSpend.connect(boost::bind(RelayDoubleSpend, _1, _2, _3, doubleSpendFilter)); } @@ -934,7 +934,6 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa return false; // Check for conflicts with in-memory transactions - bool relayableRespend = false; { LOCK(pool.cs); // protect pool.mapNextTx for (unsigned int i = 0; i < tx.vin.size(); i++) @@ -943,9 +942,8 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa // Does tx conflict with a member of the pool, and is it not equivalent to that member? if (pool.mapNextTx.count(outpoint) && !tx.IsEquivalentTo(*pool.mapNextTx[outpoint].ptx)) { - relayableRespend = g_signals.DetectedDoubleSpend(outpoint, tx, false); - if (!relayableRespend) - return false; + g_signals.DetectedDoubleSpend(outpoint, tx, false); + return false; } } } @@ -1038,24 +1036,16 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa { return error("AcceptToMemoryPool: : ConnectInputs failed %s", hash.ToString()); } - - if (relayableRespend) - { - RelayTransaction(tx); - } - else - { - // Store transaction in memory - pool.addUnchecked(hash, entry); - } + // Store transaction in memory + pool.addUnchecked(hash, entry); } g_signals.SyncTransaction(tx, NULL); - return !relayableRespend; + return true; } -static bool RelayableRespend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter) +static void RelayDoubleSpend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter) { // Relaying double-spend attempts to our peers lets them detect when // somebody might be trying to cheat them. However, blindly relaying @@ -1068,7 +1058,7 @@ static bool RelayableRespend(const COutPoint& outPoint, const CTransaction& doub // from us they are very likely to hear about it from another peer, since // each peer uses a different, randomized bloom filter. - if (fInBlock || filter.contains(outPoint)) return false; + if (fInBlock || filter.contains(outPoint)) return; // Apply an independent rate limit to double-spend relays static double dRespendCount; @@ -1079,7 +1069,7 @@ static bool RelayableRespend(const COutPoint& outPoint, const CTransaction& doub if (RateLimitExceeded(dRespendCount, nLastRespendTime, nRespendLimit, nSize)) { LogPrint("mempool", "Double-spend relay rejected by rate limiter\n"); - return false; + return; } LogPrint("mempool", "Rate limit dRespendCount: %g => %g\n", dRespendCount, dRespendCount+nSize); @@ -1091,7 +1081,10 @@ static bool RelayableRespend(const COutPoint& outPoint, const CTransaction& doub filter.insert(outPoint); - return true; + RelayTransaction(doubleSpend); + + // Share conflict with wallet + g_signals.SyncTransaction(doubleSpend, NULL); } From ad26dc9c314406034cef7684d4c9f9ec31d6347e Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 17 Jul 2014 14:08:07 +0200 Subject: [PATCH 0410/1288] Revert "Formatting, spelling, comment fixes." This reverts commit 7a19efe04069d9a1e251cdc94b25184f76d9d901. --- doc/release-notes.md | 2 +- src/main.cpp | 6 ++++-- src/qt/transactionrecord.h | 13 +++---------- src/qt/transactiontablemodel.cpp | 4 ++-- src/qt/walletmodel.cpp | 14 +++++++------- src/wallet.cpp | 2 +- 6 files changed, 18 insertions(+), 23 deletions(-) diff --git a/doc/release-notes.md b/doc/release-notes.md index 66059800b6..31df2883cc 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -83,5 +83,5 @@ Warning - Using other relay rules, a double-spender can craft his crime to resist broadcast - Miners can choose which conflicting spend to confirm, and some - miners may not confirm the first acceptable spend they see + miners may not confirmg the first acceptable spend they see diff --git a/src/main.cpp b/src/main.cpp index f3819b1497..d69c2d9027 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -898,6 +898,7 @@ bool RateLimitExceeded(double& dCount, int64_t& nLastTime, int64_t nLimit, unsig LOCK(csLimiter); + // Use an exponentially decaying ~10-minute window: dCount *= pow(1.0 - 1.0/600.0, (double)(nNow - nLastTime)); nLastTime = nNow; if (dCount >= nLimit*10*1000) @@ -1018,7 +1019,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa static int64_t nLastFreeTime; static int64_t nFreeLimit = GetArg("-limitfreerelay", 15); - if (RateLimitExceeded(dFreeCount, nLastFreeTime, nFreeLimit, nSize)) + if (RateLimitExceeded(dFreeCount, nLastFreeTime, nFreeLimit, nSize)) return state.DoS(0, error("AcceptToMemoryPool : free transaction rejected by rate limiter"), REJECT_INSUFFICIENTFEE, "insufficient priority"); @@ -1045,7 +1046,8 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa return true; } -static void RelayDoubleSpend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter) +static void +RelayDoubleSpend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter) { // Relaying double-spend attempts to our peers lets them detect when // somebody might be trying to cheat them. However, blindly relaying diff --git a/src/qt/transactionrecord.h b/src/qt/transactionrecord.h index d3cfa77d97..e6ff4ca080 100644 --- a/src/qt/transactionrecord.h +++ b/src/qt/transactionrecord.h @@ -19,17 +19,10 @@ class TransactionStatus { public: TransactionStatus(): - countsForBalance(false), - sortKey(""), - matures_in(0), - status(Offline), - hasConflicting(false), - depth(0), - open_for(0), - cur_num_blocks(-1), + countsForBalance(false), sortKey(""), + matures_in(0), status(Offline), hasConflicting(false), depth(0), open_for(0), cur_num_blocks(-1), cur_num_conflicts(-1) - { - } + { } enum Status { Confirmed, /**< Have 6 or more confirmations (normal tx) or fully mature (mined tx) **/ diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index cf4c90c7ff..6156a2ecd2 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -546,9 +546,9 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const case Qt::TextAlignmentRole: return column_alignments[index.column()]; case Qt::BackgroundColorRole: - if (rec->status.hasConflicting) + if (rec->status.hasConflicting) return COLOR_HASCONFLICTING_BG; - break; + break; case Qt::ForegroundRole: if (rec->status.hasConflicting) return COLOR_HASCONFLICTING; diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 7df8812ccd..3cbf35436c 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -164,13 +164,13 @@ void WalletModel::checkBalanceChanged() void WalletModel::updateTransaction(const QString &hash, int status) { - if (status == CT_GOT_CONFLICT) - { - emit message(tr("Conflict Received"), - tr("WARNING: Transaction may never be confirmed. Its input was seen being spent by another transaction on the network. Wait for confirmation!"), - CClientUIInterface::MSG_WARNING); - return; - } + if (status == CT_GOT_CONFLICT) + { + emit message(tr("Conflict Received"), + tr("WARNING: Transaction may never be confirmed. Its input was seen being spent by another transaction on the network. Wait for confirmation!"), + CClientUIInterface::MSG_WARNING); + return; + } if(transactionTableModel) transactionTableModel->updateTransaction(hash, status); diff --git a/src/wallet.cpp b/src/wallet.cpp index efefb71b6d..f0ab70afb9 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -657,7 +657,7 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl bool fIsConflicting = IsConflicting(tx); if (fIsConflicting) - nConflictsReceived++; + nConflictsReceived++; if (fExisted || IsMine(tx) || IsFromMe(tx) || fIsConflicting) { From 680f7252f0ca3d68ef286ae074acf480e75896fe Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 17 Jul 2014 14:08:14 +0200 Subject: [PATCH 0411/1288] Revert "Add release notes entry" This reverts commit 9fa53dd3bdc6f62b16a7c2b970449c8c35f4c41b. --- doc/release-notes.md | 46 -------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/doc/release-notes.md b/doc/release-notes.md index 31df2883cc..967a39a0e7 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -39,49 +39,3 @@ estimate. Statistics used to estimate fees and priorities are saved in the data directory in the 'fee_estimates.dat' file just before program shutdown, and are read in at startup. - -Double-Spend Relay and Alerts -============================= -VERY IMPORTANT: *It has never been safe, and remains unsafe, to rely* -*on unconfirmed transactions.* - -Relay ------ -When an attempt is seen on the network to spend the same unspent funds -more than once, it is no longer ignored. Instead, it is broadcast, to -serve as an alert. This broadcast is subject to protections against -denial-of-service attacks. - -Wallets and other bitcoin services should alert their users to -double-spends that affect them. Merchants and other users may have -enough time to withhold goods or services when payment becomes -uncertain, until confirmation. - -Bitcoin Core Wallet Alerts --------------------------- -The Bitcoin Core wallet now makes respend attempts visible in several -ways. - -If you are online, and a respend affecting one of your wallet -transactions is seen, a notification is immediately issued to the -command registered with `-respendnotify=`. Additionally, if -using the GUI: - - An alert box is immediately displayed. - - The affected wallet transaction is highlighted in red until it is - confirmed (and it may never be confirmed). - -A `respendsobserved` array is added to `gettransaction`, `listtransactions`, -and `listsinceblock` RPC results. - -Warning -------- -*If you rely on an unconfirmed transaction, these change do VERY* -*LITTLE to protect you from a malicious double-spend, because:* - - - You may learn about the respend too late to avoid doing whatever - you were being paid for - - Using other relay rules, a double-spender can craft his crime to - resist broadcast - - Miners can choose which conflicting spend to confirm, and some - miners may not confirmg the first acceptable spend they see - From 39d3f2cb40a539fff1daba3d76a6c59e932d0f0a Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 17 Jul 2014 14:08:21 +0200 Subject: [PATCH 0412/1288] Revert "Add -respendnotify option and new RPC data" This reverts commit 9004798e62e987ddf50030b17fa1881b63dd5e45. --- contrib/debian/manpages/bitcoin-qt.1 | 3 --- src/rpcwallet.cpp | 22 ---------------------- src/wallet.cpp | 8 -------- 3 files changed, 33 deletions(-) diff --git a/contrib/debian/manpages/bitcoin-qt.1 b/contrib/debian/manpages/bitcoin-qt.1 index 25a423f9c4..cd478b1875 100644 --- a/contrib/debian/manpages/bitcoin-qt.1 +++ b/contrib/debian/manpages/bitcoin-qt.1 @@ -139,9 +139,6 @@ Execute command when the best block changes (%s in cmd is replaced by block hash \fB\-walletnotify=\fR Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) .TP -\fB\-respendnotify=\fR -Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) -.TP \fB\-alertnotify=\fR Execute command when a relevant alert is received (%s in cmd is replaced by message) .TP diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 631f72d1a1..5b83fe900e 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -58,10 +58,6 @@ void WalletTxToJSON(const CWalletTx& wtx, Object& entry) BOOST_FOREACH(const uint256& conflict, wtx.GetConflicts()) conflicts.push_back(conflict.GetHex()); entry.push_back(Pair("walletconflicts", conflicts)); - Array respends; - BOOST_FOREACH(const uint256& respend, wtx.GetConflicts(false)) - respends.push_back(respend.GetHex()); - entry.push_back(Pair("respendsobserved", respends)); entry.push_back(Pair("time", wtx.GetTxTime())); entry.push_back(Pair("timereceived", (int64_t)wtx.nTimeReceived)); BOOST_FOREACH(const PAIRTYPE(string,string)& item, wtx.mapValue) @@ -1252,12 +1248,6 @@ Value listtransactions(const Array& params, bool fHelp) " \"blockindex\": n, (numeric) The block index containing the transaction. Available for 'send' and 'receive'\n" " category of transactions.\n" " \"txid\": \"transactionid\", (string) The transaction id. Available for 'send' and 'receive' category of transactions.\n" - " \"walletconflicts\" : [\n" - " \"conflictid\", (string) Ids of transactions, including equivalent clones, that re-spend a txid input.\n" - " ],\n" - " \"respendsobserved\" : [\n" - " \"respendid\", (string) Ids of transactions, NOT equivalent clones, that re-spend a txid input. \"Double-spends.\"\n" - " ],\n" " \"time\": xxx, (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\n" " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT). Available \n" " for 'send' and 'receive' category of transactions.\n" @@ -1434,12 +1424,6 @@ Value listsinceblock(const Array& params, bool fHelp) " \"blockindex\": n, (numeric) The block index containing the transaction. Available for 'send' and 'receive' category of transactions.\n" " \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n" " \"txid\": \"transactionid\", (string) The transaction id. Available for 'send' and 'receive' category of transactions.\n" - " \"walletconflicts\" : [\n" - " \"conflictid\", (string) Ids of transactions, including equivalent clones, that re-spend a txid input.\n" - " ],\n" - " \"respendsobserved\" : [\n" - " \"respendid\", (string) Ids of transactions, NOT equivalent clones, that re-spend a txid input. \"Double-spends.\"\n" - " ],\n" " \"time\": xxx, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT).\n" " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (Jan 1 1970 GMT). Available for 'send' and 'receive' category of transactions.\n" " \"comment\": \"...\", (string) If a comment is associated with the transaction.\n" @@ -1518,12 +1502,6 @@ Value gettransaction(const Array& params, bool fHelp) " \"blockindex\" : xx, (numeric) The block index\n" " \"blocktime\" : ttt, (numeric) The time in seconds since epoch (1 Jan 1970 GMT)\n" " \"txid\" : \"transactionid\", (string) The transaction id.\n" - " \"walletconflicts\" : [\n" - " \"conflictid\", (string) Ids of transactions, including equivalent clones, that re-spend a txid input.\n" - " ],\n" - " \"respendsobserved\" : [\n" - " \"respendid\", (string) Ids of transactions, NOT equivalent clones, that re-spend a txid input. \"Double-spends.\"\n" - " ],\n" " \"time\" : ttt, (numeric) The transaction time in seconds since epoch (1 Jan 1970 GMT)\n" " \"timereceived\" : ttt, (numeric) The time received in seconds since epoch (1 Jan 1970 GMT)\n" " \"details\" : [\n" diff --git a/src/wallet.cpp b/src/wallet.cpp index f0ab70afb9..1fb4dba308 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -620,14 +620,6 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet) if (IsFromMe(txConflict) || IsMine(txConflict)) { NotifyTransactionChanged(this, conflictHash, CT_GOT_CONFLICT); //Throws dialog - // external respend notify - std::string strCmd = GetArg("-respendnotify", ""); - if (!strCmd.empty()) - { - boost::replace_all(strCmd, "%s", wtxIn.GetHash().GetHex()); - boost::replace_all(strCmd, "%t", conflictHash.GetHex()); - boost::thread t(runCommand, strCmd); // thread runs free - } } } } From 3015e0bca6bc2cb8beb747873fdf7b80e74d679f Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 17 Jul 2014 14:09:46 +0200 Subject: [PATCH 0413/1288] Revert "UI to alert of respend attempt affecting wallet." This reverts commit ada5a067c75f19a724cc054286ecf2254e5dbe8f. Conflicts: src/qt/guiconstants.h src/wallet.h --- src/qt/guiconstants.h | 4 ---- src/qt/transactionfilterproxy.cpp | 4 ++-- src/qt/transactionrecord.cpp | 10 +++------- src/qt/transactionrecord.h | 13 ++---------- src/qt/transactiontablemodel.cpp | 18 +++++------------ src/qt/walletmodel.cpp | 8 -------- src/ui_interface.h | 3 +-- src/wallet.cpp | 33 ++++++------------------------- src/wallet.h | 15 ++------------ 9 files changed, 21 insertions(+), 87 deletions(-) diff --git a/src/qt/guiconstants.h b/src/qt/guiconstants.h index 696761e234..5ae4bc833d 100644 --- a/src/qt/guiconstants.h +++ b/src/qt/guiconstants.h @@ -23,10 +23,6 @@ static const int STATUSBAR_ICONSIZE = 16; #define COLOR_NEGATIVE QColor(255, 0, 0) /* Transaction list -- bare address (without label) */ #define COLOR_BAREADDRESS QColor(140, 140, 140) -/* Transaction list -- has conflicting transactions */ -#define COLOR_HASCONFLICTING QColor(255, 255, 255) -/* Transaction list -- has conflicting transactions - background */ -#define COLOR_HASCONFLICTING_BG QColor(192, 0, 0) /* Tooltips longer than this (in characters) are converted into rich text, so that they can be word-wrapped. diff --git a/src/qt/transactionfilterproxy.cpp b/src/qt/transactionfilterproxy.cpp index 7293029787..f9546fddb5 100644 --- a/src/qt/transactionfilterproxy.cpp +++ b/src/qt/transactionfilterproxy.cpp @@ -24,7 +24,7 @@ TransactionFilterProxy::TransactionFilterProxy(QObject *parent) : typeFilter(ALL_TYPES), minAmount(0), limitRows(-1), - showInactive(false) + showInactive(true) { } @@ -39,7 +39,7 @@ bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex & qint64 amount = llabs(index.data(TransactionTableModel::AmountRole).toLongLong()); int status = index.data(TransactionTableModel::StatusRole).toInt(); - if(!showInactive && status == TransactionStatus::Conflicted && type == TransactionRecord::Other) + if(!showInactive && status == TransactionStatus::Conflicted) return false; if(!(TYPE(type) & typeFilter)) return false; diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 7d29c212b3..d7bd25e08b 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -184,8 +184,6 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx) status.depth = wtx.GetDepthInMainChain(); status.cur_num_blocks = chainActive.Height(); - status.hasConflicting = false; - if (!IsFinalTx(wtx, chainActive.Height() + 1)) { if (wtx.nLockTime < LOCKTIME_THRESHOLD) @@ -229,7 +227,6 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx) if (status.depth < 0) { status.status = TransactionStatus::Conflicted; - status.hasConflicting = !(wtx.GetConflicts(false).empty()); } else if (GetAdjustedTime() - wtx.nTimeReceived > 2 * 60 && wtx.GetRequestCount() == 0) { @@ -238,7 +235,6 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx) else if (status.depth == 0) { status.status = TransactionStatus::Unconfirmed; - status.hasConflicting = !(wtx.GetConflicts(false).empty()); } else if (status.depth < RecommendedNumConfirmations) { @@ -249,13 +245,13 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx) status.status = TransactionStatus::Confirmed; } } + } -bool TransactionRecord::statusUpdateNeeded(int64_t nConflictsReceived) +bool TransactionRecord::statusUpdateNeeded() { AssertLockHeld(cs_main); - return (status.cur_num_blocks != chainActive.Height() || - status.cur_num_conflicts != nConflictsReceived); + return status.cur_num_blocks != chainActive.Height(); } QString TransactionRecord::getTxID() const diff --git a/src/qt/transactionrecord.h b/src/qt/transactionrecord.h index e6ff4ca080..626b7654c6 100644 --- a/src/qt/transactionrecord.h +++ b/src/qt/transactionrecord.h @@ -20,8 +20,7 @@ class TransactionStatus public: TransactionStatus(): countsForBalance(false), sortKey(""), - matures_in(0), status(Offline), hasConflicting(false), depth(0), open_for(0), cur_num_blocks(-1), - cur_num_conflicts(-1) + matures_in(0), status(Offline), depth(0), open_for(0), cur_num_blocks(-1) { } enum Status { @@ -52,10 +51,6 @@ public: /** @name Reported status @{*/ Status status; - - // Has conflicting transactions spending same prevout - bool hasConflicting; - qint64 depth; qint64 open_for; /**< Timestamp if status==OpenUntilDate, otherwise number of additional blocks that need to be mined before @@ -64,10 +59,6 @@ public: /** Current number of blocks (to know whether cached status is still valid) */ int cur_num_blocks; - - /** Number of conflicts received into wallet as of last status update */ - int64_t cur_num_conflicts; - }; /** UI model for a transaction. A core transaction can be represented by multiple UI transactions if it has @@ -145,7 +136,7 @@ public: /** Return whether a status update is needed. */ - bool statusUpdateNeeded(int64_t nConflictsReceived); + bool statusUpdateNeeded(); }; #endif // TRANSACTIONRECORD_H diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 6156a2ecd2..4825713b69 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -167,7 +167,8 @@ public: parent->endRemoveRows(); break; case CT_UPDATED: - emit parent->dataChanged(parent->index(lowerIndex, parent->Status), parent->index(upperIndex-1, parent->Amount)); + // Miscellaneous updates -- nothing to do, status update will take care of this, and is only computed for + // visible transactions. break; } } @@ -188,21 +189,20 @@ public: // stuck if the core is holding the locks for a longer time - for // example, during a wallet rescan. // - // If a status update is needed (blocks or conflicts came in since last check), - // update the status of this transaction from the wallet. Otherwise, + // If a status update is needed (blocks came in since last check), + // update the status of this transaction from the wallet. Otherwise, // simply re-use the cached status. TRY_LOCK(cs_main, lockMain); if(lockMain) { TRY_LOCK(wallet->cs_wallet, lockWallet); - if(lockWallet && rec->statusUpdateNeeded(wallet->nConflictsReceived)) + if(lockWallet && rec->statusUpdateNeeded()) { std::map::iterator mi = wallet->mapWallet.find(rec->hash); if(mi != wallet->mapWallet.end()) { rec->updateStatus(mi->second); - rec->status.cur_num_conflicts = wallet->nConflictsReceived; } } } @@ -368,8 +368,6 @@ QString TransactionTableModel::formatTxType(const TransactionRecord *wtx) const return tr("Payment to yourself"); case TransactionRecord::Generated: return tr("Mined"); - case TransactionRecord::Other: - return tr("Other"); default: return QString(); } @@ -545,13 +543,7 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const return formatTooltip(rec); case Qt::TextAlignmentRole: return column_alignments[index.column()]; - case Qt::BackgroundColorRole: - if (rec->status.hasConflicting) - return COLOR_HASCONFLICTING_BG; - break; case Qt::ForegroundRole: - if (rec->status.hasConflicting) - return COLOR_HASCONFLICTING; // Non-confirmed (but not immature) as transactions are grey if(!rec->status.countsForBalance && rec->status.status != TransactionStatus::Immature) { diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 3cbf35436c..0ad123f39d 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -164,14 +164,6 @@ void WalletModel::checkBalanceChanged() void WalletModel::updateTransaction(const QString &hash, int status) { - if (status == CT_GOT_CONFLICT) - { - emit message(tr("Conflict Received"), - tr("WARNING: Transaction may never be confirmed. Its input was seen being spent by another transaction on the network. Wait for confirmation!"), - CClientUIInterface::MSG_WARNING); - return; - } - if(transactionTableModel) transactionTableModel->updateTransaction(hash, status); diff --git a/src/ui_interface.h b/src/ui_interface.h index a48ba237d2..b3df2b5a85 100644 --- a/src/ui_interface.h +++ b/src/ui_interface.h @@ -21,8 +21,7 @@ enum ChangeType { CT_NEW, CT_UPDATED, - CT_DELETED, - CT_GOT_CONFLICT + CT_DELETED }; /** Signals for UI communication. */ diff --git a/src/wallet.cpp b/src/wallet.cpp index 1fb4dba308..7c04743c0f 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -274,7 +274,7 @@ bool CWallet::SetMaxVersion(int nVersion) return true; } -set CWallet::GetConflicts(const uint256& txid, bool includeEquivalent) const +set CWallet::GetConflicts(const uint256& txid) const { set result; AssertLockHeld(cs_wallet); @@ -292,8 +292,7 @@ set CWallet::GetConflicts(const uint256& txid, bool includeEquivalent) continue; // No conflict if zero or one spends range = mapTxSpends.equal_range(txin.prevout); for (TxSpends::const_iterator it = range.first; it != range.second; ++it) - if (includeEquivalent || !wtx.IsEquivalentTo(mapWallet.at(it->second))) - result.insert(it->second); + result.insert(it->second); } return result; } @@ -322,7 +321,6 @@ void CWallet::SyncMetaData(pair range) const uint256& hash = it->second; CWalletTx* copyTo = &mapWallet[hash]; if (copyFrom == copyTo) continue; - if (!copyFrom->IsEquivalentTo(*copyTo)) continue; copyTo->mapValue = copyFrom->mapValue; copyTo->vOrderForm = copyFrom->vOrderForm; // fTimeReceivedIsTxTime not copied on purpose @@ -610,20 +608,6 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet) // Notify UI of new or updated transaction NotifyTransactionChanged(this, hash, fInsertedNew ? CT_NEW : CT_UPDATED); - // Notifications for existing transactions that now have conflicts with this one - if (fInsertedNew) - { - BOOST_FOREACH(const uint256& conflictHash, wtxIn.GetConflicts(false)) - { - CWalletTx& txConflict = mapWallet[conflictHash]; - NotifyTransactionChanged(this, conflictHash, CT_UPDATED); //Updates UI table - if (IsFromMe(txConflict) || IsMine(txConflict)) - { - NotifyTransactionChanged(this, conflictHash, CT_GOT_CONFLICT); //Throws dialog - } - } - } - // notify an external script when a wallet transaction comes in or is updated std::string strCmd = GetArg("-walletnotify", ""); @@ -646,12 +630,7 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl AssertLockHeld(cs_wallet); bool fExisted = mapWallet.count(tx.GetHash()); if (fExisted && !fUpdate) return false; - - bool fIsConflicting = IsConflicting(tx); - if (fIsConflicting) - nConflictsReceived++; - - if (fExisted || IsMine(tx) || IsFromMe(tx) || fIsConflicting) + if (fExisted || IsMine(tx) || IsFromMe(tx)) { CWalletTx wtx(this,tx); // Get merkle branch if transaction was found in a block @@ -940,7 +919,7 @@ void CWallet::ReacceptWalletTransactions() int nDepth = wtx.GetDepthInMainChain(); - if (!wtx.IsCoinBase() && nDepth < 0 && (IsMine(wtx) || IsFromMe(wtx))) + if (!wtx.IsCoinBase() && nDepth < 0) { // Try to add to memory pool LOCK(mempool.cs); @@ -960,13 +939,13 @@ void CWalletTx::RelayWalletTransaction() } } -set CWalletTx::GetConflicts(bool includeEquivalent) const +set CWalletTx::GetConflicts() const { set result; if (pwallet != NULL) { uint256 myHash = GetHash(); - result = pwallet->GetConflicts(myHash, includeEquivalent); + result = pwallet->GetConflicts(myHash); result.erase(myHash); } return result; diff --git a/src/wallet.h b/src/wallet.h index eaf9e96309..73fcfa24e0 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -144,9 +144,6 @@ public: MasterKeyMap mapMasterKeys; unsigned int nMasterKeyMaxID; - // Increment to cause UI refresh, similar to new block - int64_t nConflictsReceived; - CWallet() { SetNull(); @@ -169,7 +166,6 @@ public: nNextResend = 0; nLastResend = 0; nTimeFirstKey = 0; - nConflictsReceived = 0; } std::map mapWallet; @@ -322,13 +318,6 @@ public: { return (GetDebit(tx, ISMINE_ALL) > 0); } - bool IsConflicting(const CTransaction& tx) const - { - BOOST_FOREACH(const CTxIn& txin, tx.vin) - if (mapTxSpends.count(txin.prevout)) - return true; - return false; - } int64_t GetDebit(const CTransaction& tx, const isminefilter& filter) const { int64_t nDebit = 0; @@ -401,7 +390,7 @@ public: int GetVersion() { LOCK(cs_wallet); return nWalletVersion; } // Get wallet transactions that conflict with given transaction (spend same outputs) - std::set GetConflicts(const uint256& txid, bool includeEquivalent) const; + std::set GetConflicts(const uint256& txid) const; /** Address book entry changed. * @note called with lock cs_wallet held. @@ -812,7 +801,7 @@ public: void RelayWalletTransaction(); - std::set GetConflicts(bool includeEquivalent=true) const; + std::set GetConflicts() const; }; From 98e84aae7ad1e4e18d2292f1ddeeb517432b4c42 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 17 Jul 2014 14:09:55 +0200 Subject: [PATCH 0414/1288] Revert "Relay double-spends, subject to anti-DOS" This reverts commit d640a3ceab4f4372c2a0f738c1286cfde4b41b50. --- src/core.cpp | 16 -------- src/core.h | 3 -- src/init.cpp | 1 - src/main.cpp | 100 +++++++--------------------------------------- src/main.h | 3 -- src/txmempool.cpp | 1 + 6 files changed, 15 insertions(+), 109 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index b56994ecf3..149b3532a1 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -124,22 +124,6 @@ CTransaction& CTransaction::operator=(const CTransaction &tx) { return *this; } -bool CTransaction::IsEquivalentTo(const CTransaction& tx) const -{ - if (nVersion != tx.nVersion || - nLockTime != tx.nLockTime || - vin.size() != tx.vin.size() || - vout != tx.vout) - return false; - for (unsigned int i = 0; i < vin.size(); i++) - { - if (vin[i].nSequence != tx.vin[i].nSequence || - vin[i].prevout != tx.vin[i].prevout) - return false; - } - return true; -} - int64_t CTransaction::GetValueOut() const { int64_t nValueOut = 0; diff --git a/src/core.h b/src/core.h index 0387336c98..fb64e6c08e 100644 --- a/src/core.h +++ b/src/core.h @@ -255,9 +255,6 @@ public: return hash; } - // True if only scriptSigs are different - bool IsEquivalentTo(const CTransaction& tx) const; - // Return sum of txouts. int64_t GetValueOut() const; // GetValueIn() is a method on CCoinsViewCache, because diff --git a/src/init.cpp b/src/init.cpp index 323192ab79..3488a8bedf 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1229,7 +1229,6 @@ bool AppInit2(boost::thread_group& threadGroup) LogPrintf("mapAddressBook.size() = %u\n", pwalletMain ? pwalletMain->mapAddressBook.size() : 0); #endif - RegisterInternalSignals(); StartNode(threadGroup); if (fServer) StartRPCThreads(); diff --git a/src/main.cpp b/src/main.cpp index d69c2d9027..84178b16e2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,7 +7,6 @@ #include "addrman.h" #include "alert.h" -#include "bloom.h" #include "chainparams.h" #include "checkpoints.h" #include "checkqueue.h" @@ -126,10 +125,6 @@ namespace { } // anon namespace -// Forward reference functions defined here: -static const unsigned int MAX_DOUBLESPEND_BLOOM = 1000; -static void RelayDoubleSpend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter); - ////////////////////////////////////////////////////////////////////////////// // // dispatching functions @@ -152,25 +147,10 @@ struct CMainSignals { boost::signals2::signal Inventory; // Tells listeners to broadcast their data. boost::signals2::signal Broadcast; - // Notifies listeners of detection of a double-spent transaction. Arguments are outpoint that is - // double-spent, first transaction seen, double-spend transaction, and whether the second double-spend - // transaction was first seen in a block. - // Note: only notifies if the previous transaction is in the memory pool; if previous transction was in a block, - // then the double-spend simply fails when we try to lookup the inputs in the current UTXO set. - boost::signals2::signal DetectedDoubleSpend; } g_signals; } // anon namespace -void RegisterInternalSignals() { - static CBloomFilter doubleSpendFilter; - seed_insecure_rand(); - doubleSpendFilter = CBloomFilter(MAX_DOUBLESPEND_BLOOM, 0.01, insecure_rand(), BLOOM_UPDATE_NONE); - - g_signals.DetectedDoubleSpend.connect(boost::bind(RelayDoubleSpend, _1, _2, _3, doubleSpendFilter)); -} - - void RegisterWallet(CWalletInterface* pwalletIn) { g_signals.SyncTransaction.connect(boost::bind(&CWalletInterface::SyncTransaction, pwalletIn, _1, _2)); g_signals.EraseTransaction.connect(boost::bind(&CWalletInterface::EraseFromWallet, pwalletIn, _1)); @@ -890,22 +870,6 @@ int64_t GetMinRelayFee(const CTransaction& tx, unsigned int nBytes, bool fAllowF return nMinFee; } -// Exponentially limit the rate of nSize flow to nLimit. nLimit unit is thousands-per-minute. -bool RateLimitExceeded(double& dCount, int64_t& nLastTime, int64_t nLimit, unsigned int nSize) -{ - static CCriticalSection csLimiter; - int64_t nNow = GetTime(); - - LOCK(csLimiter); - - // Use an exponentially decaying ~10-minute window: - dCount *= pow(1.0 - 1.0/600.0, (double)(nNow - nLastTime)); - nLastTime = nNow; - if (dCount >= nLimit*10*1000) - return true; - dCount += nSize; - return false; -} bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransaction &tx, bool fLimitFree, bool* pfMissingInputs, bool fRejectInsaneFee) @@ -940,10 +904,9 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa for (unsigned int i = 0; i < tx.vin.size(); i++) { COutPoint outpoint = tx.vin[i].prevout; - // Does tx conflict with a member of the pool, and is it not equivalent to that member? - if (pool.mapNextTx.count(outpoint) && !tx.IsEquivalentTo(*pool.mapNextTx[outpoint].ptx)) + if (pool.mapNextTx.count(outpoint)) { - g_signals.DetectedDoubleSpend(outpoint, tx, false); + // Disable replacement feature for now return false; } } @@ -1015,15 +978,23 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa // be annoying or make others' transactions take longer to confirm. if (fLimitFree && nFees < ::minRelayTxFee.GetFee(nSize)) { + static CCriticalSection csFreeLimiter; static double dFreeCount; - static int64_t nLastFreeTime; - static int64_t nFreeLimit = GetArg("-limitfreerelay", 15); + static int64_t nLastTime; + int64_t nNow = GetTime(); - if (RateLimitExceeded(dFreeCount, nLastFreeTime, nFreeLimit, nSize)) + LOCK(csFreeLimiter); + + // Use an exponentially decaying ~10-minute window: + dFreeCount *= pow(1.0 - 1.0/600.0, (double)(nNow - nLastTime)); + nLastTime = nNow; + // -limitfreerelay unit is thousand-bytes-per-minute + // At default rate it would take over a month to fill 1GB + if (dFreeCount >= GetArg("-limitfreerelay", 15)*10*1000) return state.DoS(0, error("AcceptToMemoryPool : free transaction rejected by rate limiter"), REJECT_INSUFFICIENTFEE, "insufficient priority"); - LogPrint("mempool", "Rate limit dFreeCount: %g => %g\n", dFreeCount, dFreeCount+nSize); + dFreeCount += nSize; } if (fRejectInsaneFee && nFees > ::minRelayTxFee.GetFee(nSize) * 10000) @@ -1046,49 +1017,6 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa return true; } -static void -RelayDoubleSpend(const COutPoint& outPoint, const CTransaction& doubleSpend, bool fInBlock, CBloomFilter& filter) -{ - // Relaying double-spend attempts to our peers lets them detect when - // somebody might be trying to cheat them. However, blindly relaying - // every double-spend across the entire network gives attackers - // a denial-of-service attack: just generate a stream of double-spends - // re-spending the same (limited) set of outpoints owned by the attacker. - // So, we use a bloom filter and only relay (at most) the first double - // spend for each outpoint. False-positives ("we have already relayed") - // are OK, because if the peer doesn't hear about the double-spend - // from us they are very likely to hear about it from another peer, since - // each peer uses a different, randomized bloom filter. - - if (fInBlock || filter.contains(outPoint)) return; - - // Apply an independent rate limit to double-spend relays - static double dRespendCount; - static int64_t nLastRespendTime; - static int64_t nRespendLimit = GetArg("-limitrespendrelay", 100); - unsigned int nSize = ::GetSerializeSize(doubleSpend, SER_NETWORK, PROTOCOL_VERSION); - - if (RateLimitExceeded(dRespendCount, nLastRespendTime, nRespendLimit, nSize)) - { - LogPrint("mempool", "Double-spend relay rejected by rate limiter\n"); - return; - } - - LogPrint("mempool", "Rate limit dRespendCount: %g => %g\n", dRespendCount, dRespendCount+nSize); - - // Clear the filter on average every MAX_DOUBLE_SPEND_BLOOM - // insertions - if (insecure_rand()%MAX_DOUBLESPEND_BLOOM == 0) - filter.clear(); - - filter.insert(outPoint); - - RelayTransaction(doubleSpend); - - // Share conflict with wallet - g_signals.SyncTransaction(doubleSpend, NULL); -} - int CMerkleTx::GetDepthInMainChainINTERNAL(CBlockIndex* &pindexRet) const { diff --git a/src/main.h b/src/main.h index 33afa06fa8..5f231fa45b 100644 --- a/src/main.h +++ b/src/main.h @@ -112,9 +112,6 @@ struct CNodeStateStats; struct CBlockTemplate; -/** Set up internal signal handlers **/ -void RegisterInternalSignals(); - /** Register a wallet to receive updates from core */ void RegisterWallet(CWalletInterface* pwalletIn); /** Unregister a wallet from core */ diff --git a/src/txmempool.cpp b/src/txmempool.cpp index a852de5da8..ebb1369e31 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -420,6 +420,7 @@ void CTxMemPool::remove(const CTransaction &tx, std::list& removed void CTxMemPool::removeConflicts(const CTransaction &tx, std::list& removed) { // Remove transactions which depend on inputs of tx, recursively + list result; LOCK(cs); BOOST_FOREACH(const CTxIn &txin, tx.vin) { std::map::iterator it = mapNextTx.find(txin.prevout); From 8f3f94a470cdc7195efdbafd45ea03e6c707d9c8 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 17 Jul 2014 14:10:02 +0200 Subject: [PATCH 0415/1288] Revert "CBloomFilter::clear() method" This reverts commit 8fbf03995df9a2003be603be1a930bc3373d56e0. --- src/bloom.cpp | 7 ------- src/bloom.h | 2 -- src/test/bloom_tests.cpp | 4 ---- 3 files changed, 13 deletions(-) diff --git a/src/bloom.cpp b/src/bloom.cpp index 85a2ddc189..26e366179c 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -94,13 +94,6 @@ bool CBloomFilter::contains(const uint256& hash) const return contains(data); } -void CBloomFilter::clear() -{ - vData.assign(vData.size(),0); - isFull = false; - isEmpty = true; -} - bool CBloomFilter::IsWithinSizeConstraints() const { return vData.size() <= MAX_BLOOM_FILTER_SIZE && nHashFuncs <= MAX_HASH_FUNCS; diff --git a/src/bloom.h b/src/bloom.h index d0caf9e9fa..956bead87f 100644 --- a/src/bloom.h +++ b/src/bloom.h @@ -78,8 +78,6 @@ public: bool contains(const COutPoint& outpoint) const; bool contains(const uint256& hash) const; - void clear(); - // True if the size is <= MAX_BLOOM_FILTER_SIZE and the number of hash functions is <= MAX_HASH_FUNCS // (catch a filter which was just deserialized which was too big) bool IsWithinSizeConstraints() const; diff --git a/src/test/bloom_tests.cpp b/src/test/bloom_tests.cpp index 2cdafa4bdd..69de3b5bb1 100644 --- a/src/test/bloom_tests.cpp +++ b/src/test/bloom_tests.cpp @@ -45,10 +45,6 @@ BOOST_AUTO_TEST_CASE(bloom_create_insert_serialize) expected[i] = (char)vch[i]; BOOST_CHECK_EQUAL_COLLECTIONS(stream.begin(), stream.end(), expected.begin(), expected.end()); - - BOOST_CHECK_MESSAGE( filter.contains(ParseHex("99108ad8ed9bb6274d3980bab5a85c048f0950c8")), "BloomFilter doesn't contain just-inserted object!"); - filter.clear(); - BOOST_CHECK_MESSAGE( !filter.contains(ParseHex("99108ad8ed9bb6274d3980bab5a85c048f0950c8")), "BloomFilter should be empty!"); } BOOST_AUTO_TEST_CASE(bloom_create_insert_serialize_with_tweak) From f469f79ff8f33c8d487d48cd6af83e1c73cf0a94 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 21 Jul 2014 15:00:42 +0200 Subject: [PATCH 0416/1288] remove an unneded .c_str() in OpenNetworkConnection() --- src/net.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net.cpp b/src/net.cpp index b55cd72e86..5a48cb5562 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1478,7 +1478,7 @@ bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOu if (!pszDest) { if (IsLocal(addrConnect) || FindNode((CNetAddr)addrConnect) || CNode::IsBanned(addrConnect) || - FindNode(addrConnect.ToStringIPPort().c_str())) + FindNode(addrConnect.ToStringIPPort())) return false; } else if (FindNode(pszDest)) return false; From 9c347313f7f504d602a9d744f1ad7aee4e3d6f9a Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 21 Jul 2014 11:50:07 -0700 Subject: [PATCH 0417/1288] CBloomFilter::clear() method --- src/bloom.cpp | 7 +++++++ src/bloom.h | 2 ++ src/test/bloom_tests.cpp | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/src/bloom.cpp b/src/bloom.cpp index 26e366179c..85a2ddc189 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -94,6 +94,13 @@ bool CBloomFilter::contains(const uint256& hash) const return contains(data); } +void CBloomFilter::clear() +{ + vData.assign(vData.size(),0); + isFull = false; + isEmpty = true; +} + bool CBloomFilter::IsWithinSizeConstraints() const { return vData.size() <= MAX_BLOOM_FILTER_SIZE && nHashFuncs <= MAX_HASH_FUNCS; diff --git a/src/bloom.h b/src/bloom.h index 956bead87f..d0caf9e9fa 100644 --- a/src/bloom.h +++ b/src/bloom.h @@ -78,6 +78,8 @@ public: bool contains(const COutPoint& outpoint) const; bool contains(const uint256& hash) const; + void clear(); + // True if the size is <= MAX_BLOOM_FILTER_SIZE and the number of hash functions is <= MAX_HASH_FUNCS // (catch a filter which was just deserialized which was too big) bool IsWithinSizeConstraints() const; diff --git a/src/test/bloom_tests.cpp b/src/test/bloom_tests.cpp index 69de3b5bb1..2cdafa4bdd 100644 --- a/src/test/bloom_tests.cpp +++ b/src/test/bloom_tests.cpp @@ -45,6 +45,10 @@ BOOST_AUTO_TEST_CASE(bloom_create_insert_serialize) expected[i] = (char)vch[i]; BOOST_CHECK_EQUAL_COLLECTIONS(stream.begin(), stream.end(), expected.begin(), expected.end()); + + BOOST_CHECK_MESSAGE( filter.contains(ParseHex("99108ad8ed9bb6274d3980bab5a85c048f0950c8")), "BloomFilter doesn't contain just-inserted object!"); + filter.clear(); + BOOST_CHECK_MESSAGE( !filter.contains(ParseHex("99108ad8ed9bb6274d3980bab5a85c048f0950c8")), "BloomFilter should be empty!"); } BOOST_AUTO_TEST_CASE(bloom_create_insert_serialize_with_tweak) From afa71fb3e37c729fa18ab161e0f3c930976e26e2 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 22 Jul 2014 08:58:49 +0200 Subject: [PATCH 0418/1288] Harmonize importprivkey and importaddress documentation --- src/rpcdump.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index 4193f41b49..ff2361482b 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -72,16 +72,17 @@ Value importprivkey(const Array& params, bool fHelp) "\nAdds a private key (as returned by dumpprivkey) to your wallet.\n" "\nArguments:\n" "1. \"bitcoinprivkey\" (string, required) The private key (see dumpprivkey)\n" - "2. \"label\" (string, optional) an optional label\n" + "2. \"label\" (string, optional, default=\"\") An optional label\n" "3. rescan (boolean, optional, default=true) Rescan the wallet for transactions\n" + "\nNote: This call can take minutes to complete if rescan is true.\n" "\nExamples:\n" "\nDump a private key\n" + HelpExampleCli("dumpprivkey", "\"myaddress\"") + - "\nImport the private key\n" + "\nImport the private key with rescan\n" + HelpExampleCli("importprivkey", "\"mykey\"") + - "\nImport using a label\n" + "\nImport using a label and without rescan\n" + HelpExampleCli("importprivkey", "\"mykey\" \"testing\" false") + - "\nAs a json rpc call\n" + "\nAs a JSON-RPC call\n" + HelpExampleRpc("importprivkey", "\"mykey\", \"testing\", false") ); @@ -137,8 +138,21 @@ Value importaddress(const Array& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 3) throw runtime_error( - "importaddress
[label] [rescan=true]\n" - "Adds an address or script (in hex) that can be watched as if it were in your wallet but cannot be used to spend."); + "importaddress \"address\" ( \"label\" rescan )\n" + "\nAdds an address or script (in hex) that can be watched as if it were in your wallet but cannot be used to spend.\n" + "\nArguments:\n" + "1. \"address\" (string, required) The address\n" + "2. \"label\" (string, optional, default=\"\") An optional label\n" + "3. rescan (boolean, optional, default=true) Rescan the wallet for transactions\n" + "\nNote: This call can take minutes to complete if rescan is true.\n" + "\nExamples:\n" + "\nImport an address with rescan\n" + + HelpExampleCli("importaddress", "\"myaddress\"") + + "\nImport using a label without rescan\n" + + HelpExampleCli("importaddress", "\"myaddress\" \"testing\" false") + + "\nAs a JSON-RPC call\n" + + HelpExampleRpc("importaddress", "\"myaddress\", \"testing\", false") + ); CScript script; From 460b32d7b1a2014dd490b15a360d062847f8efe9 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 21 Jul 2014 17:34:08 -0400 Subject: [PATCH 0419/1288] build: fix broken boost chrono check on some platforms If clock_gettime is implemented outside of libc (librt in this case), configure would fail when testing boost. Since clock_gettime is not present on all OSs, boost only uses it when it can. Check for it in librt and add it to LIBS if found, but don't fail if it's not (since boost won't be expecting it in this case). Also, reverse the link order as necessary for static libs. Note that it's possible that there are other similar cases for boost, which may be handled the same way. --- configure.ac | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index cedc34e520..719b06da67 100644 --- a/configure.ac +++ b/configure.ac @@ -392,6 +392,8 @@ AC_TRY_COMPILE([#include ], [ AC_MSG_RESULT(no)] ) +AC_SEARCH_LIBS([clock_gettime],[rt]) + LEVELDB_CPPFLAGS= LIBLEVELDB= LIBMEMENV= @@ -460,11 +462,8 @@ dnl after 1.56. dnl If neither is available, abort. dnl If sleep_for is used, boost_chrono becomes a requirement. if test x$ax_cv_boost_chrono = xyes; then -dnl Allow passing extra needed dependency libraries for boost-chrono from static gitian build -BOOST_CHRONO_LIB="$BOOST_CHRONO_LIB $BOOST_CHRONO_EXTRALIBS" - TEMP_LIBS="$LIBS" -LIBS="$LIBS $BOOST_LIBS $BOOST_CHRONO_LIB" +LIBS="$BOOST_LIBS $BOOST_CHRONO_LIB $LIBS" TEMP_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" AC_TRY_LINK([ @@ -486,7 +485,7 @@ fi if test x$boost_sleep != xyes; then TEMP_LIBS="$LIBS" -LIBS="$LIBS $BOOST_LIBS" +LIBS="$BOOST_LIBS $LIBS" TEMP_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" AC_TRY_LINK([ From a7ec027311ae4b14d3ea4225a875caa5a83151bb Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 22 Jul 2014 09:01:51 -0400 Subject: [PATCH 0420/1288] gitian: remove unneeded option after last commit --- contrib/gitian-descriptors/gitian-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index 65a6c3c1e9..30b0227bdd 100644 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -59,7 +59,7 @@ script: | local: *; };' > $LINKER_SCRIPT function do_configure { - ./configure "$@" --enable-upnp-default --prefix=$STAGING --with-protoc-bindir=$STAGING/host/bin --with-qt-bindir=$STAGING/bin --with-boost=$STAGING --disable-maintainer-mode --disable-dependency-tracking PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib -Wl,--version-script=$LINKER_SCRIPT ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" BOOST_CHRONO_EXTRALIBS="-lrt" --enable-glibc-back-compat + ./configure "$@" --enable-upnp-default --prefix=$STAGING --with-protoc-bindir=$STAGING/host/bin --with-qt-bindir=$STAGING/bin --with-boost=$STAGING --disable-maintainer-mode --disable-dependency-tracking PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib -Wl,--version-script=$LINKER_SCRIPT ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" --enable-glibc-back-compat } # cd bitcoin From ad08d0b95bd8e35b74f5f36cfa3c48ae9583b28c Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 23 Jul 2014 15:28:45 +0200 Subject: [PATCH 0421/1288] Bugfix: make CCoinsViewMemPool support pruned entries in underlying cache --- src/txmempool.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/txmempool.cpp b/src/txmempool.cpp index ebb1369e31..164e2741a2 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -602,14 +602,15 @@ void CTxMemPool::ClearPrioritisation(const uint256 hash) CCoinsViewMemPool::CCoinsViewMemPool(CCoinsView &baseIn, CTxMemPool &mempoolIn) : CCoinsViewBacked(baseIn), mempool(mempoolIn) { } bool CCoinsViewMemPool::GetCoins(const uint256 &txid, CCoins &coins) { - if (base->GetCoins(txid, coins)) - return true; + // If an entry in the mempool exists, always return that one, as it's guaranteed to never + // conflict with the underlying cache, and it cannot have pruned entries (as it contains full) + // transactions. First checking the underlying cache risks returning a pruned entry instead. CTransaction tx; if (mempool.lookup(txid, tx)) { coins = CCoins(tx, MEMPOOL_HEIGHT); return true; } - return false; + return (base->GetCoins(txid, coins) && !coins.IsPruned()); } bool CCoinsViewMemPool::HaveCoins(const uint256 &txid) { From 91cce1732b73c4457e474c557aaa7f343c0dc8a2 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 18 Jul 2014 16:31:13 +0200 Subject: [PATCH 0422/1288] qt: Use fixed-point arithmetic in amount spinbox Fixes various issues and cleans up code - Fixes issue #4500: Amount widget +/- has floating point rounding artifacts - Amount box can now be emptied again, without clearing to 0 Also aligns the amount to the right, as in other places. --- src/Makefile.qt.include | 1 + src/qt/bitcoinamountfield.cpp | 266 +++++++++++++++++++++------------- src/qt/bitcoinamountfield.h | 14 +- src/qt/bitcoinunits.cpp | 7 + src/qt/bitcoinunits.h | 3 + src/qt/sendcoinsentry.cpp | 9 +- 6 files changed, 187 insertions(+), 113 deletions(-) diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 75b7b683dd..2772bc753a 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -145,6 +145,7 @@ BITCOIN_MM = \ QT_MOC = \ qt/bitcoin.moc \ + qt/bitcoinamountfield.moc \ qt/intro.moc \ qt/overviewpage.moc \ qt/rpcconsole.moc diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp index e047c278b7..6466039013 100644 --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -9,63 +9,185 @@ #include "qvaluecombobox.h" #include -#include +#include #include #include -#include // for qPow() +#include -// QDoubleSpinBox that shows SI-style thin space thousands separators -class AmountSpinBox: public QDoubleSpinBox +/** QSpinBox that uses fixed-point numbers internally and uses our own + * formatting/parsing functions. + */ +class AmountSpinBox: public QAbstractSpinBox { + Q_OBJECT public: explicit AmountSpinBox(QWidget *parent): - QDoubleSpinBox(parent) + QAbstractSpinBox(parent), + currentUnit(BitcoinUnits::BTC), + singleStep(100000) // satoshis { + setAlignment(Qt::AlignRight); + + connect(lineEdit(), SIGNAL(textEdited(QString)), this, SIGNAL(valueChanged())); } - QString textFromValue(double value) const + + QValidator::State validate(QString &text, int &pos) const { - QStringList parts = QDoubleSpinBox::textFromValue(value).split("."); - QString quotient_str = parts[0]; - QString remainder_str; - if(parts.size() > 1) - remainder_str = parts[1]; + if(text.isEmpty()) + return QValidator::Intermediate; + bool valid = false; + parse(text, &valid); + /* Make sure we return Intermediate so that fixup() is called on defocus */ + return valid ? QValidator::Intermediate : QValidator::Invalid; + } - // Code duplication between here and BitcoinUnits::format - // TODO: Figure out how to share this code - QChar thin_sp(THIN_SP_CP); - int q_size = quotient_str.size(); - if (q_size > 4) - for (int i = 3; i < q_size; i += 3) - quotient_str.insert(q_size - i, thin_sp); + void fixup(QString &input) const + { + bool valid = false; + qint64 val = parse(input, &valid); + if(valid) + { + input = BitcoinUnits::format(currentUnit, val, false, BitcoinUnits::separatorAlways); + lineEdit()->setText(input); + } + } - int r_size = remainder_str.size(); - if (r_size > 4) - for (int i = 3, adj = 0; i < r_size; i += 3, adj++) - remainder_str.insert(i + adj, thin_sp); + qint64 value(bool *valid_out=0) const + { + return parse(text(), valid_out); + } - if(remainder_str.isEmpty()) - return quotient_str; + void setValue(qint64 value) + { + lineEdit()->setText(BitcoinUnits::format(currentUnit, value, false, BitcoinUnits::separatorAlways)); + emit valueChanged(); + } + + void stepBy(int steps) + { + bool valid = false; + qint64 val = value(&valid); + val = val + steps * singleStep; + val = qMin(qMax(val, Q_INT64_C(0)), BitcoinUnits::maxMoney()); + setValue(val); + } + + StepEnabled stepEnabled() const + { + StepEnabled rv = 0; + if(text().isEmpty()) // Allow step-up with empty field + return StepUpEnabled; + bool valid = false; + qint64 val = value(&valid); + if(valid) + { + if(val > 0) + rv |= StepDownEnabled; + if(val < BitcoinUnits::maxMoney()) + rv |= StepUpEnabled; + } + return rv; + } + + void setDisplayUnit(int unit) + { + bool valid = false; + qint64 val = value(&valid); + + currentUnit = unit; + + if(valid) + setValue(val); else - return quotient_str + QString(".") + remainder_str; + clear(); } - QValidator::State validate (QString &text, int &pos) const + + void setSingleStep(qint64 step) { - QString s(BitcoinUnits::removeSpaces(text)); - return QDoubleSpinBox::validate(s, pos); + singleStep = step; } - double valueFromText(const QString& text) const + + QSize minimumSizeHint() const { - return QDoubleSpinBox::valueFromText(BitcoinUnits::removeSpaces(text)); + if(cachedMinimumSizeHint.isEmpty()) + { + ensurePolished(); + + const QFontMetrics fm(fontMetrics()); + int h = lineEdit()->minimumSizeHint().height(); + int w = fm.width(BitcoinUnits::format(BitcoinUnits::BTC, BitcoinUnits::maxMoney(), false, BitcoinUnits::separatorAlways)); + w += 2; // cursor blinking space + + QStyleOptionSpinBox opt; + initStyleOption(&opt); + QSize hint(w, h); + QSize extra(35, 6); + opt.rect.setSize(hint + extra); + extra += hint - style()->subControlRect(QStyle::CC_SpinBox, &opt, + QStyle::SC_SpinBoxEditField, this).size(); + // get closer to final result by repeating the calculation + opt.rect.setSize(hint + extra); + extra += hint - style()->subControlRect(QStyle::CC_SpinBox, &opt, + QStyle::SC_SpinBoxEditField, this).size(); + hint += extra; + + opt.rect = rect(); + + cachedMinimumSizeHint = style()->sizeFromContents(QStyle::CT_SpinBox, &opt, hint, this) + .expandedTo(QApplication::globalStrut()); + } + return cachedMinimumSizeHint; } +private: + int currentUnit; + qint64 singleStep; + mutable QSize cachedMinimumSizeHint; + + /** + * Parse a string into a number of base monetary units and + * return validity. + * @note Must return 0 if !valid. + */ + qint64 parse(const QString &text, bool *valid_out=0) const + { + qint64 val = 0; + bool valid = BitcoinUnits::parse(currentUnit, text, &val); + if(valid) + { + if(val < 0 || val > BitcoinUnits::maxMoney()) + valid = false; + } + if(valid_out) + *valid_out = valid; + return valid ? val : 0; + } + +protected: + bool event(QEvent *event) + { + if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) + { + QKeyEvent *keyEvent = static_cast(event); + if (keyEvent->key() == Qt::Key_Comma) + { + // Translate a comma into a period + QKeyEvent periodKeyEvent(event->type(), Qt::Key_Period, keyEvent->modifiers(), ".", keyEvent->isAutoRepeat(), keyEvent->count()); + return QAbstractSpinBox::event(&periodKeyEvent); + } + } + return QAbstractSpinBox::event(event); + } + +signals: + void valueChanged(); }; +#include "bitcoinamountfield.moc" + BitcoinAmountField::BitcoinAmountField(QWidget *parent) : QWidget(parent), - amount(0), - currentUnit(-1) + amount(0) { - nSingleStep = 100000; // satoshis - amount = new AmountSpinBox(this); amount->setLocale(QLocale::c()); amount->installEventFilter(this); @@ -85,21 +207,13 @@ BitcoinAmountField::BitcoinAmountField(QWidget *parent) : setFocusProxy(amount); // If one if the widgets changes, the combined content changes as well - connect(amount, SIGNAL(valueChanged(QString)), this, SIGNAL(textChanged())); + connect(amount, SIGNAL(valueChanged()), this, SIGNAL(valueChanged())); connect(unit, SIGNAL(currentIndexChanged(int)), this, SLOT(unitChanged(int))); // Set default based on configuration unitChanged(unit->currentIndex()); } -void BitcoinAmountField::setText(const QString &text) -{ - if (text.isEmpty()) - amount->clear(); - else - amount->setValue(BitcoinUnits::removeSpaces(text).toDouble()); -} - void BitcoinAmountField::clear() { amount->clear(); @@ -108,16 +222,9 @@ void BitcoinAmountField::clear() bool BitcoinAmountField::validate() { - bool valid = true; - if (amount->value() == 0.0) - valid = false; - else if (!BitcoinUnits::parse(currentUnit, text(), 0)) - valid = false; - else if (amount->value() > BitcoinUnits::maxAmount(currentUnit)) - valid = false; - + bool valid = false; + value(&valid); setValid(valid); - return valid; } @@ -129,14 +236,6 @@ void BitcoinAmountField::setValid(bool valid) amount->setStyleSheet(STYLE_INVALID); } -QString BitcoinAmountField::text() const -{ - if (amount->text().isEmpty()) - return QString(); - else - return amount->text(); -} - bool BitcoinAmountField::eventFilter(QObject *object, QEvent *event) { if (event->type() == QEvent::FocusIn) @@ -144,17 +243,6 @@ bool BitcoinAmountField::eventFilter(QObject *object, QEvent *event) // Clear invalid flag on focus setValid(true); } - else if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) - { - QKeyEvent *keyEvent = static_cast(event); - if (keyEvent->key() == Qt::Key_Comma) - { - // Translate a comma into a period - QKeyEvent periodKeyEvent(event->type(), Qt::Key_Period, keyEvent->modifiers(), ".", keyEvent->isAutoRepeat(), keyEvent->count()); - QApplication::sendEvent(object, &periodKeyEvent); - return true; - } - } return QWidget::eventFilter(object, event); } @@ -167,18 +255,12 @@ QWidget *BitcoinAmountField::setupTabChain(QWidget *prev) qint64 BitcoinAmountField::value(bool *valid_out) const { - qint64 val_out = 0; - bool valid = BitcoinUnits::parse(currentUnit, text(), &val_out); - if (valid_out) - { - *valid_out = valid; - } - return val_out; + return amount->value(valid_out); } void BitcoinAmountField::setValue(qint64 value) { - setText(BitcoinUnits::format(currentUnit, value)); + amount->setValue(value); } void BitcoinAmountField::setReadOnly(bool fReadOnly) @@ -195,28 +277,7 @@ void BitcoinAmountField::unitChanged(int idx) // Determine new unit ID int newUnit = unit->itemData(idx, BitcoinUnits::UnitRole).toInt(); - // Parse current value and convert to new unit - bool valid = false; - qint64 currentValue = value(&valid); - - currentUnit = newUnit; - - // Set max length after retrieving the value, to prevent truncation - amount->setDecimals(BitcoinUnits::decimals(currentUnit)); - amount->setMaximum(qPow(10, BitcoinUnits::amountDigits(currentUnit)) - qPow(10, -amount->decimals())); - amount->setSingleStep((double)nSingleStep / (double)BitcoinUnits::factor(currentUnit)); - - if (valid) - { - // If value was valid, re-place it in the widget with the new unit - setValue(currentValue); - } - else - { - // If current value is invalid, just clear field - setText(""); - } - setValid(true); + amount->setDisplayUnit(newUnit); } void BitcoinAmountField::setDisplayUnit(int newUnit) @@ -226,6 +287,5 @@ void BitcoinAmountField::setDisplayUnit(int newUnit) void BitcoinAmountField::setSingleStep(qint64 step) { - nSingleStep = step; - unitChanged(unit->currentIndex()); + amount->setSingleStep(step); } diff --git a/src/qt/bitcoinamountfield.h b/src/qt/bitcoinamountfield.h index 521a9ed561..c713f5d687 100644 --- a/src/qt/bitcoinamountfield.h +++ b/src/qt/bitcoinamountfield.h @@ -8,17 +8,18 @@ #include QT_BEGIN_NAMESPACE -class QDoubleSpinBox; class QValueComboBox; QT_END_NAMESPACE +class AmountSpinBox; + /** Widget for entering bitcoin amounts. */ class BitcoinAmountField: public QWidget { Q_OBJECT - Q_PROPERTY(qint64 value READ value WRITE setValue NOTIFY textChanged USER true) + Q_PROPERTY(qint64 value READ value WRITE setValue NOTIFY valueChanged USER true) public: explicit BitcoinAmountField(QWidget *parent = 0); @@ -49,20 +50,15 @@ public: QWidget *setupTabChain(QWidget *prev); signals: - void textChanged(); + void valueChanged(); protected: /** Intercept focus-in event and ',' key presses */ bool eventFilter(QObject *object, QEvent *event); private: - QDoubleSpinBox *amount; + AmountSpinBox *amount; QValueComboBox *unit; - int currentUnit; - qint64 nSingleStep; - - void setText(const QString &text); - QString text() const; private slots: void unitChanged(int idx); diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp index 21aed235cf..0435ebc5dc 100644 --- a/src/qt/bitcoinunits.cpp +++ b/src/qt/bitcoinunits.cpp @@ -4,6 +4,8 @@ #include "bitcoinunits.h" +#include "core.h" + #include BitcoinUnits::BitcoinUnits(QObject *parent): @@ -250,3 +252,8 @@ QVariant BitcoinUnits::data(const QModelIndex &index, int role) const } return QVariant(); } + +qint64 BitcoinUnits::maxMoney() +{ + return MAX_MONEY; +} diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h index 7fa24c8542..944b4ec530 100644 --- a/src/qt/bitcoinunits.h +++ b/src/qt/bitcoinunits.h @@ -120,6 +120,9 @@ public: return text; } + //! Return maximum number of base units (Satoshis) + static qint64 maxMoney(); + private: QList unitlist; }; diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp index e0f56f8cd2..3c0b8881ff 100644 --- a/src/qt/sendcoinsentry.cpp +++ b/src/qt/sendcoinsentry.cpp @@ -72,7 +72,7 @@ void SendCoinsEntry::setModel(WalletModel *model) if (model && model->getOptionsModel()) connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); - connect(ui->payAmount, SIGNAL(textChanged()), this, SIGNAL(payAmountChanged())); + connect(ui->payAmount, SIGNAL(valueChanged()), this, SIGNAL(payAmountChanged())); connect(ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked())); connect(ui->deleteButton_is, SIGNAL(clicked()), this, SLOT(deleteClicked())); connect(ui->deleteButton_s, SIGNAL(clicked()), this, SLOT(deleteClicked())); @@ -130,6 +130,13 @@ bool SendCoinsEntry::validate() retval = false; } + // Sending a zero amount is invalid + if (ui->payAmount->value(0) <= 0) + { + ui->payAmount->setValid(false); + retval = false; + } + // Reject dust outputs: if (retval && GUIUtil::isDust(ui->payTo->text(), ui->payAmount->value())) { ui->payAmount->setValid(false); From 2a05101efd41f4e86a0323f5e00dd040574bc170 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 18 Jul 2014 16:36:29 +0200 Subject: [PATCH 0423/1288] qt: Remove unused functions from BitcoinUnits Remove two functions that are now unused. --- src/qt/bitcoinunits.cpp | 22 ---------------------- src/qt/bitcoinunits.h | 4 ---- 2 files changed, 26 deletions(-) diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp index 0435ebc5dc..6f506d3f25 100644 --- a/src/qt/bitcoinunits.cpp +++ b/src/qt/bitcoinunits.cpp @@ -80,28 +80,6 @@ qint64 BitcoinUnits::factor(int unit) } } -qint64 BitcoinUnits::maxAmount(int unit) -{ - switch(unit) - { - case BTC: return Q_INT64_C(21000000); - case mBTC: return Q_INT64_C(21000000000); - case uBTC: return Q_INT64_C(21000000000000); - default: return 0; - } -} - -int BitcoinUnits::amountDigits(int unit) -{ - switch(unit) - { - case BTC: return 8; // 21,000,000 (# digits, without commas) - case mBTC: return 11; // 21,000,000,000 - case uBTC: return 14; // 21,000,000,000,000 - default: return 0; - } -} - int BitcoinUnits::decimals(int unit) { switch(unit) diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h index 944b4ec530..be9dca6012 100644 --- a/src/qt/bitcoinunits.h +++ b/src/qt/bitcoinunits.h @@ -82,10 +82,6 @@ public: static QString description(int unit); //! Number of Satoshis (1e-8) per unit static qint64 factor(int unit); - //! Max amount per unit - static qint64 maxAmount(int unit); - //! Number of amount digits (to represent max number of coins) - static int amountDigits(int unit); //! Number of decimals left static int decimals(int unit); //! Format as string From 29eaa316944477af538b75b439a49ee1a9fc2f2a Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 22 Jul 2014 09:30:04 +0200 Subject: [PATCH 0424/1288] ui: Make sure sendcoinsentry signals only connected once Move signal connections to constructor where possible. --- src/qt/sendcoinsentry.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp index 3c0b8881ff..52545c3857 100644 --- a/src/qt/sendcoinsentry.cpp +++ b/src/qt/sendcoinsentry.cpp @@ -34,6 +34,12 @@ SendCoinsEntry::SendCoinsEntry(QWidget *parent) : GUIUtil::setupAddressWidget(ui->payTo, this); // just a label for displaying bitcoin address(es) ui->payTo_is->setFont(GUIUtil::bitcoinAddressFont()); + + // Connect signals + connect(ui->payAmount, SIGNAL(valueChanged()), this, SIGNAL(payAmountChanged())); + connect(ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked())); + connect(ui->deleteButton_is, SIGNAL(clicked()), this, SLOT(deleteClicked())); + connect(ui->deleteButton_s, SIGNAL(clicked()), this, SLOT(deleteClicked())); } SendCoinsEntry::~SendCoinsEntry() @@ -72,11 +78,6 @@ void SendCoinsEntry::setModel(WalletModel *model) if (model && model->getOptionsModel()) connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); - connect(ui->payAmount, SIGNAL(valueChanged()), this, SIGNAL(payAmountChanged())); - connect(ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked())); - connect(ui->deleteButton_is, SIGNAL(clicked()), this, SLOT(deleteClicked())); - connect(ui->deleteButton_s, SIGNAL(clicked()), this, SLOT(deleteClicked())); - clear(); } From 59abcefc2eec7ede6f098dbcf7323aef6e746a4a Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 24 Jul 2014 15:55:49 +0200 Subject: [PATCH 0425/1288] doc: remove any mention of SOCKS4 SOCKS4 support was removed in 0127a9b, as well as the `-socks=` option. --- contrib/debian/examples/bitcoin.conf | 2 +- contrib/debian/manpages/bitcoin-qt.1 | 5 +---- contrib/debian/manpages/bitcoind.1 | 2 +- doc/tor.md | 5 ----- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/contrib/debian/examples/bitcoin.conf b/contrib/debian/examples/bitcoin.conf index 0aa8674af9..31cca981e0 100644 --- a/contrib/debian/examples/bitcoin.conf +++ b/contrib/debian/examples/bitcoin.conf @@ -10,7 +10,7 @@ # Run a regression test network #regtest=0 -# Connect via a socks4 proxy +# Connect via a SOCKS5 proxy #proxy=127.0.0.1:9050 ############################################################## diff --git a/contrib/debian/manpages/bitcoin-qt.1 b/contrib/debian/manpages/bitcoin-qt.1 index cd478b1875..a023582bc0 100644 --- a/contrib/debian/manpages/bitcoin-qt.1 +++ b/contrib/debian/manpages/bitcoin-qt.1 @@ -32,10 +32,7 @@ Set database cache size in megabytes (default: 25) Specify connection timeout in milliseconds (default: 5000) .TP \fB\-proxy=\fR -Connect through socks proxy -.TP -\fB\-socks=\fR -Select the version of socks proxy to use (4\-5, default: 5) +Connect through SOCKS5 proxy .TP \fB\-tor=\fR Use proxy to reach tor hidden services (default: same as \fB\-proxy\fR) diff --git a/contrib/debian/manpages/bitcoind.1 b/contrib/debian/manpages/bitcoind.1 index 0c191b6043..a1b17d6077 100644 --- a/contrib/debian/manpages/bitcoind.1 +++ b/contrib/debian/manpages/bitcoind.1 @@ -28,7 +28,7 @@ Start minimized Specify data directory .TP \fB\-proxy=\fR -Connect through socks4 proxy +Connect through SOCKS5 proxy .TP \fB\-addnode=\fR Add a node to connect to diff --git a/doc/tor.md b/doc/tor.md index b5eb91e12e..560f71fa27 100644 --- a/doc/tor.md +++ b/doc/tor.md @@ -13,11 +13,6 @@ configure Tor. The first step is running Bitcoin behind a Tor proxy. This will already make all outgoing connections be anonymized, but more is possible. - -socks=5 SOCKS5 supports connecting-to-hostname, which can be used instead - of doing a (leaking) local DNS lookup. SOCKS5 is the default, - but SOCKS4 does not support this. (SOCKS4a does, but isn't - implemented). - -proxy=ip:port Set the proxy server. If SOCKS5 is selected (default), this proxy server will be used to try to reach .onion addresses as well. From ab651b2d62778d6194ad996d29e7d447f549fc38 Mon Sep 17 00:00:00 2001 From: paveljanik Date: Wed, 23 Jul 2014 22:47:18 +0200 Subject: [PATCH 0426/1288] Fix typos in comments (missing i's). --- src/allocators.h | 2 +- src/version.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/allocators.h b/src/allocators.h index 7012ef7e2a..be0be7ab96 100644 --- a/src/allocators.h +++ b/src/allocators.h @@ -131,7 +131,7 @@ public: * Due to the unpredictable order of static initializers, we have to make sure the * LockedPageManager instance exists before any other STL-based objects that use * secure_allocator are created. So instead of having LockedPageManager also be - * static-intialized, it is created on demand. + * static-initialized, it is created on demand. */ class LockedPageManager: public LockedPageManagerBase { diff --git a/src/version.h b/src/version.h index 3d1abacb94..85c5dbf8d7 100644 --- a/src/version.h +++ b/src/version.h @@ -28,7 +28,7 @@ extern const std::string CLIENT_DATE; static const int PROTOCOL_VERSION = 70002; -// intial proto version, to be increased after version/verack negotiation +// initial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209; // disconnect from peers older than this proto version @@ -45,7 +45,7 @@ static const int NOBLKS_VERSION_END = 32400; // BIP 0031, pong message, is enabled for all versions AFTER this one static const int BIP0031_VERSION = 60000; -// "mempool" command, enhanced "getdata" behavior starts with this version: +// "mempool" command, enhanced "getdata" behavior starts with this version static const int MEMPOOL_GD_VERSION = 60002; #endif From 0430c30af118637819f70eaf3d10a77d910639e3 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 24 Jul 2014 16:29:41 +0200 Subject: [PATCH 0427/1288] Add missing FindNode prototype to net.h Also make the argument a const std::string & instead of pass-by-value. --- src/net.cpp | 2 +- src/net.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/net.cpp b/src/net.cpp index b55cd72e86..329e0278ca 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -456,7 +456,7 @@ CNode* FindNode(const CNetAddr& ip) return NULL; } -CNode* FindNode(std::string addrName) +CNode* FindNode(const std::string& addrName) { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) diff --git a/src/net.h b/src/net.h index f029a8d935..2d9325abf9 100644 --- a/src/net.h +++ b/src/net.h @@ -59,6 +59,7 @@ bool RecvLine(SOCKET hSocket, std::string& strLine); bool GetMyExternalIP(CNetAddr& ipRet); void AddressCurrentlyConnected(const CService& addr); CNode* FindNode(const CNetAddr& ip); +CNode* FindNode(const std::string& addrName); CNode* FindNode(const CService& ip); CNode* ConnectNode(CAddress addrConnect, const char *pszDest = NULL); bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false); From 93659379bdedc29a87fe351ba2950a2c976aebd9 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 24 Jul 2014 19:00:24 +0200 Subject: [PATCH 0428/1288] Add comment about never updating nTimeOffset past 199 samples Refer to issue #4521 for details. --- src/timedata.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/timedata.cpp b/src/timedata.cpp index 8a095d26dc..6c3bd9a48d 100644 --- a/src/timedata.cpp +++ b/src/timedata.cpp @@ -49,6 +49,24 @@ void AddTimeData(const CNetAddr& ip, int64_t nTime) static CMedianFilter vTimeOffsets(200,0); vTimeOffsets.input(nOffsetSample); LogPrintf("Added time data, samples %d, offset %+d (%+d minutes)\n", vTimeOffsets.size(), nOffsetSample, nOffsetSample/60); + + // There is a known issue here (see issue #4521): + // + // - The structure vTimeOffsets contains up to 200 elements, after which + // any new element added to it will not increase its size, replacing the + // oldest element. + // + // - The condition to update nTimeOffset includes checking whether the + // number of elements in vTimeOffsets is odd, which will never happen after + // there are 200 elements. + // + // But in this case the 'bug' is protective against some attacks, and may + // actually explain why we've never seen attacks which manipulate the + // clock offset. + // + // So we should hold off on fixing this and clean it up as part of + // a timing cleanup that strengthens it in a number of other ways. + // if (vTimeOffsets.size() >= 5 && vTimeOffsets.size() % 2 == 1) { int64_t nMedian = vTimeOffsets.median(); From 9192ca9e3341ed82d6324ee03c8a21504fd0163e Mon Sep 17 00:00:00 2001 From: Clinton Christian Date: Mon, 7 Jul 2014 23:22:23 -0400 Subject: [PATCH 0429/1288] pyminer: Fix memory leak, refactor to be more pythonic, maintainable, and possibly faster Pull #4483. Note that pyminer is not currently functional due to the removal of getwork in cf0c47b. --- contrib/pyminer/pyminer.py | 391 +++++++++++++++++++------------------ 1 file changed, 204 insertions(+), 187 deletions(-) diff --git a/contrib/pyminer/pyminer.py b/contrib/pyminer/pyminer.py index 0a2932d66e..706a10b39d 100755 --- a/contrib/pyminer/pyminer.py +++ b/contrib/pyminer/pyminer.py @@ -5,248 +5,265 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. # -import time -import json -import pprint -import hashlib -import struct -import re -import base64 -import httplib import sys from multiprocessing import Process +import time +import struct +import hashlib +import base64 +import re +import httplib +import json ERR_SLEEP = 15 MAX_NONCE = 1000000L settings = {} -pp = pprint.PrettyPrinter(indent=4) + class BitcoinRPC: - OBJID = 1 + object_id = 1 - def __init__(self, host, port, username, password): - authpair = "%s:%s" % (username, password) - self.authhdr = "Basic %s" % (base64.b64encode(authpair)) - self.conn = httplib.HTTPConnection(host, port, False, 30) - def rpc(self, method, params=None): - self.OBJID += 1 - obj = { 'version' : '1.1', - 'method' : method, - 'id' : self.OBJID } - if params is None: - obj['params'] = [] - else: - obj['params'] = params - self.conn.request('POST', '/', json.dumps(obj), - { 'Authorization' : self.authhdr, - 'Content-type' : 'application/json' }) + def __init__(self, host, port, username, password): + authpair = "{0}:{1}".format(username, password) + self.authhdr = "Basic {0}".format(base64.b64encode(authpair)) + self.conn = httplib.HTTPConnection(host, port, strict=False, timeout=30) - resp = self.conn.getresponse() - if resp is None: - print "JSON-RPC: no response" - return None + def rpc(self, method, params=None): + self.object_id += 1 + obj = {'version' : '1.1', + 'method' : method, + 'id' : self.object_id, + 'params' : params or []} - body = resp.read() - resp_obj = json.loads(body) - if resp_obj is None: - print "JSON-RPC: cannot JSON-decode body" - return None - if 'error' in resp_obj and resp_obj['error'] != None: - return resp_obj['error'] - if 'result' not in resp_obj: - print "JSON-RPC: no result in object" - return None + self.conn.request('POST', '/', json.dumps(obj), + { 'Authorization' : self.authhdr, + 'Content-type' : 'application/json' }) - return resp_obj['result'] - def getblockcount(self): - return self.rpc('getblockcount') - def getwork(self, data=None): - return self.rpc('getwork', data) + resp = self.conn.getresponse() + + if resp is None: + print("JSON-RPC: no response") + return None + + body = resp.read() + resp_obj = json.loads(body) + + if resp_obj is None: + print("JSON-RPC: cannot JSON-decode body") + return None + + if 'error' in resp_obj and resp_obj['error'] != None: + return resp_obj['error'] + + if 'result' not in resp_obj: + print("JSON-RPC: no result in object") + return None + + return resp_obj['result'] + + def getblockcount(self): + return self.rpc('getblockcount') + + def getwork(self, data=None): + return self.rpc('getwork', data) def uint32(x): - return x & 0xffffffffL + return x & 0xffffffffL def bytereverse(x): - return uint32(( ((x) << 24) | (((x) << 8) & 0x00ff0000) | - (((x) >> 8) & 0x0000ff00) | ((x) >> 24) )) + return uint32(( ((x) << 24) | (((x) << 8) & 0x00ff0000) | + (((x) >> 8) & 0x0000ff00) | ((x) >> 24) )) def bufreverse(in_buf): - out_words = [] - for i in range(0, len(in_buf), 4): - word = struct.unpack('@I', in_buf[i:i+4])[0] - out_words.append(struct.pack('@I', bytereverse(word))) - return ''.join(out_words) + out_words = [] + + for i in range(0, len(in_buf), 4): + word = struct.unpack('@I', in_buf[i:i+4])[0] + out_words.append(struct.pack('@I', bytereverse(word))) + + return ''.join(out_words) def wordreverse(in_buf): - out_words = [] - for i in range(0, len(in_buf), 4): - out_words.append(in_buf[i:i+4]) - out_words.reverse() - return ''.join(out_words) + out_words = [] + + for i in range(0, len(in_buf), 4): + out_words.append(in_buf[i:i+4]) + + out_words.reverse() + + return ''.join(out_words) + class Miner: - def __init__(self, id): - self.id = id - self.max_nonce = MAX_NONCE + def __init__(self, id): + self.id = id + self.max_nonce = MAX_NONCE - def work(self, datastr, targetstr): - # decode work data hex string to binary - static_data = datastr.decode('hex') - static_data = bufreverse(static_data) + def work(self, datastr, targetstr): + # decode work data hex string to binary + static_data = datastr.decode('hex') + static_data = bufreverse(static_data) - # the first 76b of 80b do not change - blk_hdr = static_data[:76] + # the first 76b of 80b do not change + blk_hdr = static_data[:76] - # decode 256-bit target value - targetbin = targetstr.decode('hex') - targetbin = targetbin[::-1] # byte-swap and dword-swap - targetbin_str = targetbin.encode('hex') - target = long(targetbin_str, 16) + # decode 256-bit target value + targetbin = targetstr.decode('hex') + targetbin = targetbin[::-1] # byte-swap and dword-swap + targetbin_str = targetbin.encode('hex') + target = long(targetbin_str, 16) - # pre-hash first 76b of block header - static_hash = hashlib.sha256() - static_hash.update(blk_hdr) + # pre-hash first 76b of block header + static_hash = hashlib.sha256() + static_hash.update(blk_hdr) - for nonce in xrange(self.max_nonce): + for nonce in xrange(self.max_nonce): - # encode 32-bit nonce value - nonce_bin = struct.pack(" Upstream RPC result:", result + def submit_work(self, rpc, original_data, nonce_bin): + nonce_bin = bufreverse(nonce_bin) + nonce = nonce_bin.encode('hex') + solution = original_data[:152] + nonce + original_data[160:256] + param_arr = [ solution ] + result = rpc.getwork(param_arr) - def iterate(self, rpc): - work = rpc.getwork() - if work is None: - time.sleep(ERR_SLEEP) - return - if 'data' not in work or 'target' not in work: - time.sleep(ERR_SLEEP) - return + print(time.asctime(), "--> Upstream RPC result:", result) - time_start = time.time() + def iterate(self, rpc): + work = rpc.getwork() - (hashes_done, nonce_bin) = self.work(work['data'], - work['target']) + if work is None: + time.sleep(ERR_SLEEP) + return - time_end = time.time() - time_diff = time_end - time_start + if 'data' not in work or 'target' not in work: + time.sleep(ERR_SLEEP) + return - self.max_nonce = long( - (hashes_done * settings['scantime']) / time_diff) - if self.max_nonce > 0xfffffffaL: - self.max_nonce = 0xfffffffaL + time_start = time.time() - if settings['hashmeter']: - print "HashMeter(%d): %d hashes, %.2f Khash/sec" % ( - self.id, hashes_done, - (hashes_done / 1000.0) / time_diff) + (hashes_done, nonce_bin) = self.work(work['data'], + work['target']) - if nonce_bin is not None: - self.submit_work(rpc, work['data'], nonce_bin) + time_end = time.time() + time_diff = time_end - time_start - def loop(self): - rpc = BitcoinRPC(settings['host'], settings['port'], - settings['rpcuser'], settings['rpcpass']) - if rpc is None: - return + self.max_nonce = long( + (hashes_done * settings['scantime']) / time_diff) + + if self.max_nonce > 0xfffffffaL: + self.max_nonce = 0xfffffffaL + + if settings['hashmeter']: + print("HashMeter({:d}): {:d} hashes, {:.2f} Khash/sec".format( + self.id, hashes_done, (hashes_done / 1000.0) / time_diff)) + + if nonce_bin is not None: + self.submit_work(rpc, work['data'], nonce_bin) + + def loop(self): + rpc = BitcoinRPC(settings['host'], settings['port'], + settings['rpcuser'], settings['rpcpass']) + + if rpc is not None: + + while True: + self.iterate(rpc) + + self.conn.close() - while True: - self.iterate(rpc) def miner_thread(id): - miner = Miner(id) - miner.loop() + miner = Miner(id) + miner.loop() if __name__ == '__main__': - if len(sys.argv) != 2: - print "Usage: pyminer.py CONFIG-FILE" - sys.exit(1) + if len(sys.argv) != 2: + print("Usage: pyminer.py CONFIG-FILE") + sys.exit(1) - f = open(sys.argv[1]) - for line in f: - # skip comment lines - m = re.search('^\s*#', line) - if m: - continue + with open(sys.argv[1]) as f: - # parse key=value lines - m = re.search('^(\w+)\s*=\s*(\S.*)$', line) - if m is None: - continue - settings[m.group(1)] = m.group(2) - f.close() + for line in f: + # skip comment lines + m = re.search('^\s*#', line) + if m: + continue - if 'host' not in settings: - settings['host'] = '127.0.0.1' - if 'port' not in settings: - settings['port'] = 8332 - if 'threads' not in settings: - settings['threads'] = 1 - if 'hashmeter' not in settings: - settings['hashmeter'] = 0 - if 'scantime' not in settings: - settings['scantime'] = 30L - if 'rpcuser' not in settings or 'rpcpass' not in settings: - print "Missing username and/or password in cfg file" - sys.exit(1) + # parse key=value lines + m = re.search('^(\w+)\s*=\s*(\S.*)$', line) + if m is None: + continue - settings['port'] = int(settings['port']) - settings['threads'] = int(settings['threads']) - settings['hashmeter'] = int(settings['hashmeter']) - settings['scantime'] = long(settings['scantime']) + settings[m.group(1)] = m.group(2) - thr_list = [] - for thr_id in range(settings['threads']): - p = Process(target=miner_thread, args=(thr_id,)) - p.start() - thr_list.append(p) - time.sleep(1) # stagger threads + settings.setdefault('host', '127.0.0.1') + settings.setdefault('port', 8332) + settings.setdefault('threads', 1) + settings.setdefault('hashmeter', 0) + settings.setdefault('scantime', 30L) - print settings['threads'], "mining threads started" + if 'rpcuser' not in settings or 'rpcpass' not in settings: + print("Missing username and/or password in cfg file") + sys.exit(1) - print time.asctime(), "Miner Starts - %s:%s" % (settings['host'], settings['port']) - try: - for thr_proc in thr_list: - thr_proc.join() - except KeyboardInterrupt: - pass - print time.asctime(), "Miner Stops - %s:%s" % (settings['host'], settings['port']) + settings['port'] = int(settings['port']) + settings['threads'] = int(settings['threads']) + settings['hashmeter'] = int(settings['hashmeter']) + settings['scantime'] = long(settings['scantime']) + thread_list = [] + + for thread_id in range(settings['threads']): + p = Process(target=miner_thread, args=(thread_id,)) + p.start() + thread_list.append(p) + time.sleep(1) # stagger threads + + print(settings['threads'], "mining threads started") + + print(time.asctime(), "Miner Starts - {0}:{1}".format(settings['host'], + settings['port'])) + try: + for thread_process in thread_list: + thread_process.join() + except KeyboardInterrupt: + pass + + print(time.asctime(), "Miner Stops - {0}:{1}".format(settings['host'], + settings['port'])) From f65352a7d06e2cf6761115e1d91a2a585fd47796 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 25 Jul 2014 17:43:41 +0200 Subject: [PATCH 0430/1288] [Qt] small Qt-only include cleanup --- src/qt/optionsdialog.cpp | 4 ++-- src/qt/transactiondesc.cpp | 2 +- src/qt/transactiontablemodel.cpp | 2 +- src/qt/transactiontablemodel.h | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 597be40abd..0117d2e633 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -15,11 +15,11 @@ #include "optionsmodel.h" #include "main.h" // for MAX_SCRIPTCHECK_THREADS +#include "netbase.h" +#include "txdb.h" // for -dbcache defaults #ifdef ENABLE_WALLET #include "wallet.h" // for CWallet::minTxFee #endif -#include "netbase.h" -#include "txdb.h" // for -dbcache defaults #include #include diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index ac1614efd0..4f6e3169f5 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -11,11 +11,11 @@ #include "db.h" #include "main.h" #include "paymentserver.h" +#include "script.h" #include "transactionrecord.h" #include "timedata.h" #include "ui_interface.h" #include "wallet.h" -#include "script.h" #include #include diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 4825713b69..7acb0e8871 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -577,7 +577,7 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const case ConfirmedRole: return rec->status.countsForBalance; case FormattedAmountRole: - // Used for copy/export, so don't include separators + // Used for copy/export, so don't include separators return formatTxAmount(rec, false, BitcoinUnits::separatorNever); case StatusRole: return rec->status.status; diff --git a/src/qt/transactiontablemodel.h b/src/qt/transactiontablemodel.h index ad88d14a90..2124d3dd1c 100644 --- a/src/qt/transactiontablemodel.h +++ b/src/qt/transactiontablemodel.h @@ -5,11 +5,11 @@ #ifndef TRANSACTIONTABLEMODEL_H #define TRANSACTIONTABLEMODEL_H +#include "bitcoinunits.h" + #include #include -#include "bitcoinunits.h" - class TransactionRecord; class TransactionTablePriv; class WalletModel; From d70bc52ee31b8c4c87ee011625e7031c2dc89c0c Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 26 Jul 2014 22:49:17 +0200 Subject: [PATCH 0431/1288] Rework block processing benchmark code * Replace -benchmark (and the related fBenchmark) with a regular debug option, -debug=bench. * Increase coverage and granularity of individual block processing steps. * Add cummulative times. --- src/init.cpp | 7 ++++--- src/main.cpp | 50 +++++++++++++++++++++++++++++++++++++------------- src/main.h | 1 - 3 files changed, 41 insertions(+), 17 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 3488a8bedf..8b6567b5c4 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -285,7 +285,6 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += "\n" + _("Debugging/Testing options:") + "\n"; if (GetBoolArg("-help-debug", false)) { - strUsage += " -benchmark " + _("Show benchmark information (default: 0)") + "\n"; strUsage += " -checkpoints " + _("Only accept block chain matching built-in checkpoints (default: 1)") + "\n"; strUsage += " -dblogsize= " + _("Flush database activity from memory pool to disk log every megabytes (default: 100)") + "\n"; strUsage += " -disablesafemode " + _("Disable safemode, override a real safe mode event (default: 0)") + "\n"; @@ -298,7 +297,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -debug= " + _("Output debugging information (default: 0, supplying is optional)") + "\n"; strUsage += " " + _("If is not supplied, output all debugging information.") + "\n"; strUsage += " " + _(" can be:"); - strUsage += " addrman, alert, coindb, db, lock, rand, rpc, selectcoins, mempool, net"; // Don't translate these and qt below + strUsage += " addrman, alert, bench, coindb, db, lock, rand, rpc, selectcoins, mempool, net"; // Don't translate these and qt below if (mode == HMM_BITCOIN_QT) strUsage += ", qt"; strUsage += ".\n"; @@ -599,7 +598,9 @@ bool AppInit2(boost::thread_group& threadGroup) if (GetBoolArg("-tor", false)) return InitError(_("Error: Unsupported argument -tor found, use -onion.")); - fBenchmark = GetBoolArg("-benchmark", false); + if (GetBoolArg("-benchmark", false)) + InitWarning(_("Warning: Unsupported argument -benchmark ignored, use -debug=bench.")); + // Checkmempool defaults to true in regtest mode mempool.setSanityCheck(GetBoolArg("-checkmempool", Params().DefaultCheckMemPool())); Checkpoints::fEnabled = GetBoolArg("-checkpoints", true); diff --git a/src/main.cpp b/src/main.cpp index 06ce15b5b3..85e0851895 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -45,7 +45,6 @@ CConditionVariable cvBlockChange; int nScriptCheckThreads = 0; bool fImporting = false; bool fReindex = false; -bool fBenchmark = false; bool fTxIndex = false; bool fIsBareMultisigStd = true; unsigned int nCoinCacheSize = 5000; @@ -1680,6 +1679,12 @@ void ThreadScriptCheck() { scriptcheckqueue.Thread(); } +static int64_t nTimeVerify = 0; +static int64_t nTimeConnect = 0; +static int64_t nTimeIndex = 0; +static int64_t nTimeCallbacks = 0; +static int64_t nTimeTotal = 0; + bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& view, bool fJustCheck) { AssertLockHeld(cs_main); @@ -1735,7 +1740,7 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C CCheckQueueControl control(fScriptChecks && nScriptCheckThreads ? &scriptcheckqueue : NULL); - int64_t nStart = GetTimeMicros(); + int64_t nTimeStart = GetTimeMicros(); int64_t nFees = 0; int nInputs = 0; unsigned int nSigOps = 0; @@ -1785,9 +1790,8 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C vPos.push_back(std::make_pair(tx.GetHash(), pos)); pos.nTxOffset += ::GetSerializeSize(tx, SER_DISK, CLIENT_VERSION); } - int64_t nTime = GetTimeMicros() - nStart; - if (fBenchmark) - LogPrintf("- Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin)\n", (unsigned)block.vtx.size(), 0.001 * nTime, 0.001 * nTime / block.vtx.size(), nInputs <= 1 ? 0 : 0.001 * nTime / (nInputs-1)); + int64_t nTime1 = GetTimeMicros(); nTimeConnect += nTime1 - nTimeStart; + LogPrint("bench", " - Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin) [%.2fs]\n", (unsigned)block.vtx.size(), 0.001 * (nTime1 - nTimeStart), 0.001 * (nTime1 - nTimeStart) / block.vtx.size(), nInputs <= 1 ? 0 : 0.001 * (nTime1 - nTimeStart) / (nInputs-1), nTimeConnect * 0.000001); if (block.vtx[0].GetValueOut() > GetBlockValue(pindex->nHeight, nFees)) return state.DoS(100, @@ -1797,9 +1801,8 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C if (!control.Wait()) return state.DoS(100, false); - int64_t nTime2 = GetTimeMicros() - nStart; - if (fBenchmark) - LogPrintf("- Verify %u txins: %.2fms (%.3fms/txin)\n", nInputs - 1, 0.001 * nTime2, nInputs <= 1 ? 0 : 0.001 * nTime2 / (nInputs-1)); + int64_t nTime2 = GetTimeMicros(); nTimeVerify += nTime2 - nTimeStart; + LogPrint("bench", " - Verify %u txins: %.2fms (%.3fms/txin) [%.2fs]\n", nInputs - 1, 0.001 * (nTime2 - nTimeStart), nInputs <= 1 ? 0 : 0.001 * (nTime2 - nTimeStart) / (nInputs-1), nTimeVerify * 0.000001); if (fJustCheck) return true; @@ -1840,6 +1843,9 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C ret = view.SetBestBlock(pindex->GetBlockHash()); assert(ret); + int64_t nTime3 = GetTimeMicros(); nTimeIndex += nTime3 - nTime2; + LogPrint("bench", " - Index writing: %.2fms [%.2fs]\n", 0.001 * (nTime3 - nTime2), nTimeIndex * 0.000001); + // Watch for transactions paying to me BOOST_FOREACH(const CTransaction& tx, block.vtx) g_signals.SyncTransaction(tx, &block); @@ -1849,6 +1855,9 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C g_signals.UpdatedTransaction(hashPrevBestCoinBase); hashPrevBestCoinBase = block.vtx[0].GetHash(); + int64_t nTime4 = GetTimeMicros(); nTimeCallbacks += nTime4 - nTime3; + LogPrint("bench", " - Callbacks: %.2fms [%.2fs]\n", 0.001 * (nTime4 - nTime3), nTimeCallbacks * 0.000001); + return true; } @@ -1928,8 +1937,7 @@ bool static DisconnectTip(CValidationState &state) { return error("DisconnectTip() : DisconnectBlock %s failed", pindexDelete->GetBlockHash().ToString()); assert(view.Flush()); } - if (fBenchmark) - LogPrintf("- Disconnect: %.2fms\n", (GetTimeMicros() - nStart) * 0.001); + LogPrint("bench", "- Disconnect block: %.2fms\n", (GetTimeMicros() - nStart) * 0.001); // Write the chain state to disk, if necessary. if (!WriteChainState(state)) return false; @@ -1953,16 +1961,25 @@ bool static DisconnectTip(CValidationState &state) { return true; } +static int64_t nTimeReadFromDisk = 0; +static int64_t nTimeConnectTotal = 0; +static int64_t nTimeFlush = 0; +static int64_t nTimeChainState = 0; +static int64_t nTimePostConnect = 0; + // Connect a new block to chainActive. bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew) { assert(pindexNew->pprev == chainActive.Tip()); mempool.check(pcoinsTip); // Read block from disk. + int64_t nTime1 = GetTimeMicros(); CBlock block; if (!ReadBlockFromDisk(block, pindexNew)) return state.Abort(_("Failed to read block")); // Apply the block atomically to the chain state. - int64_t nStart = GetTimeMicros(); + int64_t nTime2 = GetTimeMicros(); nTimeReadFromDisk += nTime2 - nTime1; + int64_t nTime3; + LogPrint("bench", " - Load block from disk: %.2fms [%.2fs]\n", (nTime2 - nTime1) * 0.001, nTimeReadFromDisk * 0.000001); { CCoinsViewCache view(*pcoinsTip, true); CInv inv(MSG_BLOCK, pindexNew->GetBlockHash()); @@ -1972,13 +1989,17 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew) { return error("ConnectTip() : ConnectBlock %s failed", pindexNew->GetBlockHash().ToString()); } mapBlockSource.erase(inv.hash); + nTime3 = GetTimeMicros(); nTimeConnectTotal += nTime3 - nTime2; + LogPrint("bench", " - Connect total: %.2fms [%.2fs]\n", (nTime3 - nTime2) * 0.001, nTimeConnectTotal * 0.000001); assert(view.Flush()); } - if (fBenchmark) - LogPrintf("- Connect: %.2fms\n", (GetTimeMicros() - nStart) * 0.001); + int64_t nTime4 = GetTimeMicros(); nTimeFlush += nTime4 - nTime3; + LogPrint("bench", " - Flush: %.2fms [%.2fs]\n", (nTime4 - nTime3) * 0.001, nTimeFlush * 0.000001); // Write the chain state to disk, if necessary. if (!WriteChainState(state)) return false; + int64_t nTime5 = GetTimeMicros(); nTimeChainState += nTime5 - nTime4; + LogPrint("bench", " - Writing chainstate: %.2fms [%.2fs]\n", (nTime5 - nTime4) * 0.001, nTimeChainState * 0.000001); // Remove conflicting transactions from the mempool. list txConflicted; mempool.removeForBlock(block.vtx, pindexNew->nHeight, txConflicted); @@ -1994,6 +2015,9 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew) { BOOST_FOREACH(const CTransaction &tx, block.vtx) { SyncWithWallets(tx, &block); } + int64_t nTime6 = GetTimeMicros(); nTimePostConnect += nTime6 - nTime5; nTimeTotal += nTime6 - nTime1; + LogPrint("bench", " - Connect postprocess: %.2fms [%.2fs]\n", (nTime6 - nTime5) * 0.001, nTimePostConnect * 0.000001); + LogPrint("bench", "- Connect block: %.2fms [%.2fs]\n", (nTime6 - nTime1) * 0.001, nTimeTotal * 0.000001); return true; } diff --git a/src/main.h b/src/main.h index 5f231fa45b..48ec86f6a8 100644 --- a/src/main.h +++ b/src/main.h @@ -91,7 +91,6 @@ extern CWaitableCriticalSection csBestBlock; extern CConditionVariable cvBlockChange; extern bool fImporting; extern bool fReindex; -extern bool fBenchmark; extern int nScriptCheckThreads; extern bool fTxIndex; extern bool fIsBareMultisigStd; From 17f15678d399275a093be496914c59b463929fe4 Mon Sep 17 00:00:00 2001 From: Alex Morcos Date: Fri, 25 Jul 2014 21:21:10 -0400 Subject: [PATCH 0432/1288] Fixed a bug with index bounds checking --- src/txmempool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 164e2741a2..0725441fba 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -299,7 +299,7 @@ public: size_t nPrevSize = 0; for (int i = 0; i < nBlocksToConfirm; i++) nPrevSize += history.at(i).PrioritySamples(); - size_t index = min(nPrevSize + nBucketSize/2, sortedFeeSamples.size()-1); + size_t index = min(nPrevSize + nBucketSize/2, sortedPrioritySamples.size()-1); return sortedPrioritySamples[index]; } From d817187bdbeacb2eb6bd23d7faa38e667770e7e6 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 28 Jul 2014 14:47:27 +0200 Subject: [PATCH 0433/1288] [Qt] remove ProxySocksVersion from OptionID - we only support SOCKS5, so remove it --- src/qt/optionsmodel.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 89c2ec7453..9699f6eea6 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -32,7 +32,6 @@ public: ProxyUse, // bool ProxyIP, // QString ProxyPort, // int - ProxySocksVersion, // int Fee, // qint64 DisplayUnit, // BitcoinUnits::Unit DisplayAddresses, // bool From 961ae93c85cee96c5dca3d44fbfb829243607f65 Mon Sep 17 00:00:00 2001 From: Alex Morcos Date: Fri, 25 Jul 2014 21:29:54 -0400 Subject: [PATCH 0434/1288] Fix minor bug which only affected log messages. --- src/txmempool.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 0725441fba..a06de7a947 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -225,6 +225,12 @@ public: seenTxConfirm(feeRate, minRelayFee, dPriority, i); } } + + //After new samples are added, we have to clear the sorted lists, + //so they'll be resorted the next time someone asks for an estimate + sortedFeeSamples.clear(); + sortedPrioritySamples.clear(); + for (size_t i = 0; i < history.size(); i++) { if (history[i].FeeSamples() + history[i].PrioritySamples() > 0) LogPrint("estimatefee", "estimates: for confirming within %d blocks based on %d/%d samples, fee=%s, prio=%g\n", @@ -232,8 +238,6 @@ public: history[i].FeeSamples(), history[i].PrioritySamples(), estimateFee(i+1).ToString(), estimatePriority(i+1)); } - sortedFeeSamples.clear(); - sortedPrioritySamples.clear(); } // Can return CFeeRate(0) if we don't have any data for that many blocks back. nBlocksToConfirm is 1 based. From f9de17ec2f3e22fe9d96557e328af836a3590660 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 28 Jul 2014 19:30:43 +0200 Subject: [PATCH 0435/1288] Add warning comment to getinfo Warn that people should not add new information, or change current information returned by getinfo. --- src/rpcmisc.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index cff795bdf4..bd992397b8 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -27,6 +27,19 @@ using namespace boost::assign; using namespace json_spirit; using namespace std; +/** + * @note Do not add or change anything in the information returned by this + * method. `getinfo` exists for backwards-compatibilty only. It combines + * information from wildly different sources in the program, which is a mess, + * and is thus planned to be deprecated eventually. + * + * Based on the source of the information, new information should be added to: + * - `getblockchaininfo`, + * - `getnetworkinfo` or + * - `getwalletinfo` + * + * Or alternatively, create a specific query method for the information. + **/ Value getinfo(const Array& params, bool fHelp) { if (fHelp || params.size() != 0) From 2887bffcfdc138f53c60091ab2906790971c9af5 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 9 Jul 2014 18:17:23 +0200 Subject: [PATCH 0436/1288] Update coding style and add .clang-format --- doc/coding.md | 76 +++++++++++++++++++---------------------------- src/.clang-format | 51 +++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 45 deletions(-) create mode 100644 src/.clang-format diff --git a/doc/coding.md b/doc/coding.md index 2f332e92f0..ceed8c18b4 100644 --- a/doc/coding.md +++ b/doc/coding.md @@ -1,29 +1,17 @@ Coding ==================== -Please be consistent with the existing coding style. - -Block style: -```c++ - bool Function(char* psz, int n) - { - // Comment summarising what this section of code does - for (int i = 0; i < n; i++) - { - // When something fails, return early - if (!Something()) - return false; - ... - } - - // Success return is usually at the end - return true; - } -``` -- ANSI/Allman block style -- 4 space indenting, no tabs -- No extra spaces inside parenthesis; please don't do ( this ) -- No space after function names, one space after if, for and while +Various coding styles have been used during the history of the codebase, +and the result is not very consistent. However, we're now trying to converge to +a single style, so please use it in new code. Old code will be converted +gradually. +- Basic rules specified in src/.clang-format. Use a recent clang-format-3.5 to format automatically. + - Braces on new lines for namespaces, classes, functions, methods. + - Braces on the same line for everything else. + - 4 space indentation (no tabs) for every block except namespaces. + - No indentation for public/protected/private or for namespaces. + - No extra spaces inside parenthesis; don't do ( this ) + - No space after function names; one space after if, for and while. - Includes need to be ordered alphabetically, separate own and foreign headers with a new-line (example key.cpp): ```c++ #include "key.h" @@ -38,31 +26,29 @@ Block style: class CAlpha; class CBeta; ``` -- When using namespace keyword use the following form: + +Block style example: ```c++ -namespace Foo { +namespace foo +{ +class Class +{ + bool Function(char* psz, int n) + { + // Comment summarising what this section of code does + for (int i = 0; i < n; i++) { + // When something fails, return early + if (!Something()) + return false; + ... + } -... - -} // Foo + // Success return is usually at the end + return true; + } +} +} ``` -Variable names begin with the type in lowercase, like nSomeVariable. -Please don't put the first word of the variable name in lowercase like -someVariable. - -Common types: - - n integer number: short, unsigned short, int, unsigned int, int64, uint64, sometimes char if used as a number - d double, float - f flag - hash uint256 - p pointer or array, one p for each level of indirection - psz pointer to null terminated string - str string object - v vector or similar list objects - map map or multimap - set set or multiset - bn CBigNum Doxygen comments ----------------- diff --git a/src/.clang-format b/src/.clang-format new file mode 100644 index 0000000000..226a15d185 --- /dev/null +++ b/src/.clang-format @@ -0,0 +1,51 @@ +AccessModifierOffset: -4 +AlignEscapedNewlinesLeft: true +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: false +AllowShortFunctionsOnASingleLine: All +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: true +BinPackParameters: false +BreakBeforeBinaryOperators: false +BreakBeforeBraces: Linux +BreakBeforeTernaryOperators: false +BreakConstructorInitializersBeforeComma: false +ColumnLimit: 0 +CommentPragmas: '^ IWYU pragma:' +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DerivePointerAlignment: false +DisableFormat: false +ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, BOOST_REVERSE_FOREACH ] +IndentCaseLabels: false +IndentFunctionDeclarationAfterType: false +IndentWidth: 4 +KeepEmptyLinesAtTheStartOfBlocks: false +Language: Cpp +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: None +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: false +PenaltyBreakBeforeFirstCallParameter: 1 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 200 +PointerAlignment: Left +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +Standard: Cpp03 +TabWidth: 8 +UseTab: Never From 29203228710de3e180914c1d66f48dd7e41270a0 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 29 Jul 2014 09:53:23 +0200 Subject: [PATCH 0437/1288] Remove hopelessly outdated build-msw.md Anyone building bitcoind/-qt on windows is welcome to contribute a new one. The current information in this document is outdated, or otherwise mostly worthless. --- doc/build-msw.md | 83 ------------------------------------------------ 1 file changed, 83 deletions(-) delete mode 100644 doc/build-msw.md diff --git a/doc/build-msw.md b/doc/build-msw.md deleted file mode 100644 index 9e4eaee3f5..0000000000 --- a/doc/build-msw.md +++ /dev/null @@ -1,83 +0,0 @@ -WINDOWS BUILD NOTES -=================== - - -Compilers Supported -------------------- -TODO: What works? -Note: releases are cross-compiled using mingw running on Linux. - - -Dependencies ------------- -Libraries you need to download separately and build: - - name default path download - -------------------------------------------------------------------------------------------------------------------- - OpenSSL \openssl-1.0.1c-mgw http://www.openssl.org/source/ - Berkeley DB \db-4.8.30.NC-mgw http://www.oracle.com/technology/software/products/berkeley-db/index.html - Boost \boost-1.50.0-mgw http://www.boost.org/users/download/ - miniupnpc \miniupnpc-1.6-mgw http://miniupnp.tuxfamily.org/files/ - -Their licenses: - - OpenSSL Old BSD license with the problematic advertising requirement - Berkeley DB New BSD license with additional requirement that linked software must be free open source - Boost MIT-like license - miniupnpc New (3-clause) BSD license - -Versions used in this release: - - OpenSSL 1.0.1c - Berkeley DB 4.8.30.NC - Boost 1.50.0 - miniupnpc 1.6 - - -OpenSSL -------- -MSYS shell: - -un-tar sources with MSYS 'tar xfz' to avoid issue with symlinks (OpenSSL ticket 2377) -change 'MAKE' env. variable from 'C:\MinGW32\bin\mingw32-make.exe' to '/c/MinGW32/bin/mingw32-make.exe' - - cd /c/openssl-1.0.1c-mgw - ./config - make - -Berkeley DB ------------ -MSYS shell: - - cd /c/db-4.8.30.NC-mgw/build_unix - sh ../dist/configure --enable-mingw --enable-cxx - make - -Boost ------ -MSYS shell: - - downloaded boost jam 3.1.18 - cd \boost-1.50.0-mgw - bjam toolset=gcc --build-type=complete stage - -MiniUPnPc ---------- -UPnP support is optional, make with `USE_UPNP=` to disable it. - -MSYS shell: - - cd /c/miniupnpc-1.6-mgw - make -f Makefile.mingw - mkdir miniupnpc - cp *.h miniupnpc/ - -Bitcoin -------- -MSYS shell: - - cd \bitcoin - sh autogen.sh - sh configure - mingw32-make - strip bitcoind.exe From 403c1bf0fbff2c7cb20afbd4413f36267029deef Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 29 Jul 2014 09:58:14 +0200 Subject: [PATCH 0438/1288] contrib: remove getwork-based pyminer As the `getwork` API doesn't exist anymore, currently this script is useless. It would be nice to have a `getblocktemplate`-based Python example of a miner, but there is no point in keeping this one around except to confuse people. --- contrib/README.md | 4 - contrib/pyminer/README.md | 8 - contrib/pyminer/example-config.cfg | 32 ---- contrib/pyminer/pyminer.py | 269 ----------------------------- 4 files changed, 313 deletions(-) delete mode 100644 contrib/pyminer/README.md delete mode 100644 contrib/pyminer/example-config.cfg delete mode 100755 contrib/pyminer/pyminer.py diff --git a/contrib/README.md b/contrib/README.md index 63b1875d30..dae975e9ef 100644 --- a/contrib/README.md +++ b/contrib/README.md @@ -19,10 +19,6 @@ Contains the script `github-merge.sh` for merging github pull requests securely ### [Linearize](/contrib/linearize) ### Construct a linear, no-fork, best version of the blockchain. -### [PyMiner](/contrib/pyminer) ### - -This is a 'getwork' CPU mining client for Bitcoin. It is pure-python, and therefore very, very slow. The purpose is to provide a reference implementation of a miner in order to study and develop other mining programs. - ### [Qos](/contrib/qos) ### A Linux bash script that will set up traffic control (tc) to limit the outgoing bandwidth for connections to the Bitcoin network. This means one can have an always-on bitcoind instance running, and another local bitcoind/bitcoin-qt instance which connects to this node and receives blocks from it. diff --git a/contrib/pyminer/README.md b/contrib/pyminer/README.md deleted file mode 100644 index 3b20f2fdea..0000000000 --- a/contrib/pyminer/README.md +++ /dev/null @@ -1,8 +0,0 @@ -### PyMiner ### - -This is a 'getwork' CPU mining client for Bitcoin. It is pure-python, and therefore very, very slow. The purpose is to provide a reference implementation of a miner, for study. - -### Other Resources ### - -- [BitcoinTalk Thread](https://bitcointalk.org/index.php?topic=3546.0) -- [Jgarzik Repo](https://github.com/jgarzik/pyminer) \ No newline at end of file diff --git a/contrib/pyminer/example-config.cfg b/contrib/pyminer/example-config.cfg deleted file mode 100644 index 103e7c1372..0000000000 --- a/contrib/pyminer/example-config.cfg +++ /dev/null @@ -1,32 +0,0 @@ - -# -# RPC login details -# -host=127.0.0.1 -port=8332 - -rpcuser=myusername -rpcpass=mypass - - -# -# mining details -# - -threads=4 - -# periodic rate for requesting new work, if solution not found -scantime=60 - - -# -# misc. -# - -# not really used right now -logdir=/tmp/pyminer - -# set to 1, to enable hashmeter output -hashmeter=0 - - diff --git a/contrib/pyminer/pyminer.py b/contrib/pyminer/pyminer.py deleted file mode 100755 index 706a10b39d..0000000000 --- a/contrib/pyminer/pyminer.py +++ /dev/null @@ -1,269 +0,0 @@ -#!/usr/bin/python -# -# Copyright (c) 2011 The Bitcoin developers -# Distributed under the MIT/X11 software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. -# - -import sys -from multiprocessing import Process -import time -import struct -import hashlib -import base64 -import re -import httplib -import json - -ERR_SLEEP = 15 -MAX_NONCE = 1000000L - -settings = {} - - -class BitcoinRPC: - object_id = 1 - - def __init__(self, host, port, username, password): - authpair = "{0}:{1}".format(username, password) - self.authhdr = "Basic {0}".format(base64.b64encode(authpair)) - self.conn = httplib.HTTPConnection(host, port, strict=False, timeout=30) - - def rpc(self, method, params=None): - self.object_id += 1 - obj = {'version' : '1.1', - 'method' : method, - 'id' : self.object_id, - 'params' : params or []} - - self.conn.request('POST', '/', json.dumps(obj), - { 'Authorization' : self.authhdr, - 'Content-type' : 'application/json' }) - - resp = self.conn.getresponse() - - if resp is None: - print("JSON-RPC: no response") - return None - - body = resp.read() - resp_obj = json.loads(body) - - if resp_obj is None: - print("JSON-RPC: cannot JSON-decode body") - return None - - if 'error' in resp_obj and resp_obj['error'] != None: - return resp_obj['error'] - - if 'result' not in resp_obj: - print("JSON-RPC: no result in object") - return None - - return resp_obj['result'] - - def getblockcount(self): - return self.rpc('getblockcount') - - def getwork(self, data=None): - return self.rpc('getwork', data) - -def uint32(x): - return x & 0xffffffffL - -def bytereverse(x): - return uint32(( ((x) << 24) | (((x) << 8) & 0x00ff0000) | - (((x) >> 8) & 0x0000ff00) | ((x) >> 24) )) - -def bufreverse(in_buf): - out_words = [] - - for i in range(0, len(in_buf), 4): - word = struct.unpack('@I', in_buf[i:i+4])[0] - out_words.append(struct.pack('@I', bytereverse(word))) - - return ''.join(out_words) - -def wordreverse(in_buf): - out_words = [] - - for i in range(0, len(in_buf), 4): - out_words.append(in_buf[i:i+4]) - - out_words.reverse() - - return ''.join(out_words) - - -class Miner: - def __init__(self, id): - self.id = id - self.max_nonce = MAX_NONCE - - def work(self, datastr, targetstr): - # decode work data hex string to binary - static_data = datastr.decode('hex') - static_data = bufreverse(static_data) - - # the first 76b of 80b do not change - blk_hdr = static_data[:76] - - # decode 256-bit target value - targetbin = targetstr.decode('hex') - targetbin = targetbin[::-1] # byte-swap and dword-swap - targetbin_str = targetbin.encode('hex') - target = long(targetbin_str, 16) - - # pre-hash first 76b of block header - static_hash = hashlib.sha256() - static_hash.update(blk_hdr) - - for nonce in xrange(self.max_nonce): - - # encode 32-bit nonce value - nonce_bin = struct.pack(" Upstream RPC result:", result) - - def iterate(self, rpc): - work = rpc.getwork() - - if work is None: - time.sleep(ERR_SLEEP) - return - - if 'data' not in work or 'target' not in work: - time.sleep(ERR_SLEEP) - return - - time_start = time.time() - - (hashes_done, nonce_bin) = self.work(work['data'], - work['target']) - - time_end = time.time() - time_diff = time_end - time_start - - self.max_nonce = long( - (hashes_done * settings['scantime']) / time_diff) - - if self.max_nonce > 0xfffffffaL: - self.max_nonce = 0xfffffffaL - - if settings['hashmeter']: - print("HashMeter({:d}): {:d} hashes, {:.2f} Khash/sec".format( - self.id, hashes_done, (hashes_done / 1000.0) / time_diff)) - - if nonce_bin is not None: - self.submit_work(rpc, work['data'], nonce_bin) - - def loop(self): - rpc = BitcoinRPC(settings['host'], settings['port'], - settings['rpcuser'], settings['rpcpass']) - - if rpc is not None: - - while True: - self.iterate(rpc) - - self.conn.close() - - -def miner_thread(id): - miner = Miner(id) - miner.loop() - -if __name__ == '__main__': - if len(sys.argv) != 2: - print("Usage: pyminer.py CONFIG-FILE") - sys.exit(1) - - with open(sys.argv[1]) as f: - - for line in f: - # skip comment lines - m = re.search('^\s*#', line) - if m: - continue - - # parse key=value lines - m = re.search('^(\w+)\s*=\s*(\S.*)$', line) - if m is None: - continue - - settings[m.group(1)] = m.group(2) - - settings.setdefault('host', '127.0.0.1') - settings.setdefault('port', 8332) - settings.setdefault('threads', 1) - settings.setdefault('hashmeter', 0) - settings.setdefault('scantime', 30L) - - if 'rpcuser' not in settings or 'rpcpass' not in settings: - print("Missing username and/or password in cfg file") - sys.exit(1) - - settings['port'] = int(settings['port']) - settings['threads'] = int(settings['threads']) - settings['hashmeter'] = int(settings['hashmeter']) - settings['scantime'] = long(settings['scantime']) - - thread_list = [] - - for thread_id in range(settings['threads']): - p = Process(target=miner_thread, args=(thread_id,)) - p.start() - thread_list.append(p) - time.sleep(1) # stagger threads - - print(settings['threads'], "mining threads started") - - print(time.asctime(), "Miner Starts - {0}:{1}".format(settings['host'], - settings['port'])) - try: - for thread_process in thread_list: - thread_process.join() - except KeyboardInterrupt: - pass - - print(time.asctime(), "Miner Stops - {0}:{1}".format(settings['host'], - settings['port'])) From 2e7009d67b862cf822a1c70e181de6af659a3096 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 29 Jul 2014 11:04:46 -0400 Subject: [PATCH 0439/1288] Avoid querying DNS seeds, if we have open connections. The goal is to increase independence and privacy. --- src/init.cpp | 3 ++- src/net.cpp | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index 127529382f..14816f5016 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -240,7 +240,8 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -connect= " + _("Connect only to the specified node(s)") + "\n"; strUsage += " -discover " + _("Discover own IP address (default: 1 when listening and no -externalip)") + "\n"; strUsage += " -dns " + _("Allow DNS lookups for -addnode, -seednode and -connect") + " " + _("(default: 1)") + "\n"; - strUsage += " -dnsseed " + _("Find peers using DNS lookup (default: 1 unless -connect)") + "\n"; + strUsage += " -dnsseed " + _("Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect)") + "\n"; + strUsage += " -forcednsseed " + _("Always query for peer addresses via DNS lookup (default: 0)") + "\n"; strUsage += " -externalip= " + _("Specify your own public address") + "\n"; strUsage += " -listen " + _("Accept connections from outside (default: 1 if no -proxy or -connect)") + "\n"; strUsage += " -maxconnections= " + _("Maintain at most connections to peers (default: 125)") + "\n"; diff --git a/src/net.cpp b/src/net.cpp index e004fbeb73..62124514c8 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1221,6 +1221,18 @@ void MapPort(bool) void ThreadDNSAddressSeed() { + // goal: only query DNS seeds if address need is acute + if ((addrman.size() > 0) && + (!GetBoolArg("-forcednsseed", false))) { + MilliSleep(11 * 1000); + + LOCK(cs_vNodes); + if (vNodes.size() >= 2) { + LogPrintf("P2P peers available. Skipped DNS seeding.\n"); + return; + } + } + const vector &vSeeds = Params().DNSSeeds(); int found = 0; From ae775b5b311982a3d932a9e34ddc94ce597dcaaf Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Mon, 23 Jun 2014 23:10:24 -0400 Subject: [PATCH 0440/1288] Consolidate CTransaction hex encode/decode into core_io.h, core_{read,write}.cpp --- src/Makefile.am | 3 +++ src/core_io.h | 14 ++++++++++++++ src/core_read.cpp | 25 +++++++++++++++++++++++++ src/core_write.cpp | 15 +++++++++++++++ src/rpcmining.cpp | 5 ++--- src/rpcrawtransaction.cpp | 39 ++++++++++++--------------------------- src/rpcwallet.cpp | 5 ++--- 7 files changed, 73 insertions(+), 33 deletions(-) create mode 100644 src/core_io.h create mode 100644 src/core_read.cpp create mode 100644 src/core_write.cpp diff --git a/src/Makefile.am b/src/Makefile.am index ff23747592..4e59146424 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -75,6 +75,7 @@ BITCOIN_CORE_H = \ coins.h \ compat.h \ core.h \ + core_io.h \ crypter.h \ db.h \ hash.h \ @@ -185,6 +186,8 @@ libbitcoin_common_a_SOURCES = \ chainparams.cpp \ coins.cpp \ core.cpp \ + core_read.cpp \ + core_write.cpp \ hash.cpp \ key.cpp \ keystore.cpp \ diff --git a/src/core_io.h b/src/core_io.h new file mode 100644 index 0000000000..257dac3627 --- /dev/null +++ b/src/core_io.h @@ -0,0 +1,14 @@ +#ifndef __BITCOIN_CORE_IO_H__ +#define __BITCOIN_CORE_IO_H__ + +#include + +class CTransaction; + +// core_read.cpp +extern bool DecodeHexTx(CTransaction& tx, const std::string& strHexTx); + +// core_write.cpp +extern std::string EncodeHexTx(const CTransaction& tx); + +#endif // __BITCOIN_CORE_IO_H__ diff --git a/src/core_read.cpp b/src/core_read.cpp new file mode 100644 index 0000000000..937dcd9c12 --- /dev/null +++ b/src/core_read.cpp @@ -0,0 +1,25 @@ + +#include +#include "core_io.h" +#include "core.h" +#include "serialize.h" + +using namespace std; + +bool DecodeHexTx(CTransaction& tx, const std::string& strHexTx) +{ + if (!IsHex(strHexTx)) + return false; + + vector txData(ParseHex(strHexTx)); + CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION); + try { + ssData >> tx; + } + catch (std::exception &e) { + return false; + } + + return true; +} + diff --git a/src/core_write.cpp b/src/core_write.cpp new file mode 100644 index 0000000000..960974df89 --- /dev/null +++ b/src/core_write.cpp @@ -0,0 +1,15 @@ + +#include "core_io.h" +#include "core.h" +#include "serialize.h" +#include "util.h" + +using namespace std; + +string EncodeHexTx(const CTransaction& tx) +{ + CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); + ssTx << tx; + return HexStr(ssTx.begin(), ssTx.end()); +} + diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index cbb4ab2f8b..edab427cbf 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -10,6 +10,7 @@ #include "main.h" #include "miner.h" #include "pow.h" +#include "core_io.h" #ifdef ENABLE_WALLET #include "db.h" #include "wallet.h" @@ -472,9 +473,7 @@ Value getblocktemplate(const Array& params, bool fHelp) Object entry; - CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); - ssTx << tx; - entry.push_back(Pair("data", HexStr(ssTx.begin(), ssTx.end()))); + entry.push_back(Pair("data", EncodeHexTx(tx))); entry.push_back(Pair("hash", txHash.GetHex())); diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 1efe38e830..a7aeb8f00b 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -5,6 +5,7 @@ #include "base58.h" #include "core.h" +#include "core_io.h" #include "init.h" #include "keystore.h" #include "main.h" @@ -182,9 +183,7 @@ Value getrawtransaction(const Array& params, bool fHelp) if (!GetTransaction(hash, tx, hashBlock, true)) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No information available about transaction"); - CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); - ssTx << tx; - string strHex = HexStr(ssTx.begin(), ssTx.end()); + string strHex = EncodeHexTx(tx); if (!fVerbose) return strHex; @@ -388,9 +387,7 @@ Value createrawtransaction(const Array& params, bool fHelp) rawTx.vout.push_back(out); } - CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); - ss << rawTx; - return HexStr(ss.begin(), ss.end()); + return EncodeHexTx(rawTx); } Value decoderawtransaction(const Array& params, bool fHelp) @@ -444,15 +441,12 @@ Value decoderawtransaction(const Array& params, bool fHelp) + HelpExampleRpc("decoderawtransaction", "\"hexstring\"") ); - vector txData(ParseHexV(params[0], "argument")); - CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION); + RPCTypeCheck(params, list_of(str_type)); + CTransaction tx; - try { - ssData >> tx; - } - catch (std::exception &e) { + + if (!DecodeHexTx(tx, params[0].get_str())) throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); - } Object result; TxToJSON(tx, 0, result); @@ -723,9 +717,7 @@ Value signrawtransaction(const Array& params, bool fHelp) } Object result; - CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); - ssTx << mergedTx; - result.push_back(Pair("hex", HexStr(ssTx.begin(), ssTx.end()))); + result.push_back(Pair("hex", EncodeHexTx(mergedTx))); result.push_back(Pair("complete", fComplete)); return result; @@ -754,25 +746,18 @@ Value sendrawtransaction(const Array& params, bool fHelp) + HelpExampleRpc("sendrawtransaction", "\"signedhex\"") ); + RPCTypeCheck(params, list_of(str_type)(bool_type)); // parse hex string from parameter - vector txData(ParseHexV(params[0], "parameter")); - CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION); CTransaction tx; + if (!DecodeHexTx(tx, params[0].get_str())) + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); + uint256 hashTx = tx.GetHash(); bool fOverrideFees = false; if (params.size() > 1) fOverrideFees = params[1].get_bool(); - // deserialize binary data stream - try { - ssData >> tx; - } - catch (std::exception &e) { - throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); - } - const uint256 &hashTx = tx.GetHash(); - CCoinsViewCache &view = *pcoinsTip; CCoins existingCoins; bool fHaveMempool = mempool.exists(hashTx); diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 5b83fe900e..667ca33ce1 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -4,6 +4,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "base58.h" +#include "core_io.h" #include "rpcserver.h" #include "init.h" #include "net.h" @@ -1550,9 +1551,7 @@ Value gettransaction(const Array& params, bool fHelp) ListTransactions(wtx, "*", 0, false, details, filter); entry.push_back(Pair("details", details)); - CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); - ssTx << static_cast(wtx); - string strHex = HexStr(ssTx.begin(), ssTx.end()); + string strHex = EncodeHexTx(static_cast(wtx)); entry.push_back(Pair("hex", strHex)); return entry; From b2aeaa79393608132104183eba117fcbf583148e Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Mon, 23 Jun 2014 23:16:33 -0400 Subject: [PATCH 0441/1288] Move ParseScript() helper, becoming accessible outside src/test/ --- src/core_io.h | 2 + src/core_read.cpp | 77 ++++++++++++++++++++++++++++++++++ src/test/script_tests.cpp | 71 +------------------------------ src/test/transaction_tests.cpp | 2 +- 4 files changed, 81 insertions(+), 71 deletions(-) diff --git a/src/core_io.h b/src/core_io.h index 257dac3627..528c472803 100644 --- a/src/core_io.h +++ b/src/core_io.h @@ -3,9 +3,11 @@ #include +class CScript; class CTransaction; // core_read.cpp +extern CScript ParseScript(std::string s); extern bool DecodeHexTx(CTransaction& tx, const std::string& strHexTx); // core_write.cpp diff --git a/src/core_read.cpp b/src/core_read.cpp index 937dcd9c12..d5d3cca480 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -3,8 +3,85 @@ #include "core_io.h" #include "core.h" #include "serialize.h" +#include "script.h" + +#include +#include +#include +#include +#include using namespace std; +using namespace boost; +using namespace boost::algorithm; + +CScript ParseScript(std::string s) +{ + CScript result; + + static map mapOpNames; + + if (mapOpNames.size() == 0) + { + for (int op = 0; op <= OP_NOP10; op++) + { + // Allow OP_RESERVED to get into mapOpNames + if (op < OP_NOP && op != OP_RESERVED) + continue; + + const char* name = GetOpName((opcodetype)op); + if (strcmp(name, "OP_UNKNOWN") == 0) + continue; + string strName(name); + mapOpNames[strName] = (opcodetype)op; + // Convenience: OP_ADD and just ADD are both recognized: + replace_first(strName, "OP_", ""); + mapOpNames[strName] = (opcodetype)op; + } + } + + vector words; + split(words, s, is_any_of(" \t\n"), token_compress_on); + + BOOST_FOREACH(string w, words) + { + if (w.size() == 0) + { + // Empty string, ignore. (boost::split given '' will return one word) + } + else if (all(w, is_digit()) || + (starts_with(w, "-") && all(string(w.begin()+1, w.end()), is_digit()))) + { + // Number + int64_t n = atoi64(w); + result << n; + } + else if (starts_with(w, "0x") && IsHex(string(w.begin()+2, w.end()))) + { + // Raw hex data, inserted NOT pushed onto stack: + std::vector raw = ParseHex(string(w.begin()+2, w.end())); + result.insert(result.end(), raw.begin(), raw.end()); + } + else if (w.size() >= 2 && starts_with(w, "'") && ends_with(w, "'")) + { + // Single-quoted string, pushed as data. NOTE: this is poor-man's + // parsing, spaces/tabs/newlines in single-quoted strings won't work. + std::vector value(w.begin()+1, w.end()-1); + result << value; + } + else if (mapOpNames.count(w)) + { + // opcode, e.g. OP_ADD or ADD: + result << mapOpNames[w]; + } + else + { + throw runtime_error("script parse error"); + } + } + + return result; +} bool DecodeHexTx(CTransaction& tx, const std::string& strHexTx) { diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index cba582e941..5e35875a8e 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -10,6 +10,7 @@ #include "key.h" #include "keystore.h" #include "main.h" +#include "core_io.h" #include #include @@ -36,76 +37,6 @@ extern uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo static const unsigned int flags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC; -CScript -ParseScript(string s) -{ - CScript result; - - static map mapOpNames; - - if (mapOpNames.size() == 0) - { - for (int op = 0; op <= OP_NOP10; op++) - { - // Allow OP_RESERVED to get into mapOpNames - if (op < OP_NOP && op != OP_RESERVED) - continue; - - const char* name = GetOpName((opcodetype)op); - if (strcmp(name, "OP_UNKNOWN") == 0) - continue; - string strName(name); - mapOpNames[strName] = (opcodetype)op; - // Convenience: OP_ADD and just ADD are both recognized: - replace_first(strName, "OP_", ""); - mapOpNames[strName] = (opcodetype)op; - } - } - - vector words; - split(words, s, is_any_of(" \t\n"), token_compress_on); - - BOOST_FOREACH(string w, words) - { - if (w.size() == 0) - { - // Empty string, ignore. (boost::split given '' will return one word) - } - else if (all(w, is_digit()) || - (starts_with(w, "-") && all(string(w.begin()+1, w.end()), is_digit()))) - { - // Number - int64_t n = atoi64(w); - result << n; - } - else if (starts_with(w, "0x") && IsHex(string(w.begin()+2, w.end()))) - { - // Raw hex data, inserted NOT pushed onto stack: - std::vector raw = ParseHex(string(w.begin()+2, w.end())); - result.insert(result.end(), raw.begin(), raw.end()); - } - else if (w.size() >= 2 && starts_with(w, "'") && ends_with(w, "'")) - { - // Single-quoted string, pushed as data. NOTE: this is poor-man's - // parsing, spaces/tabs/newlines in single-quoted strings won't work. - std::vector value(w.begin()+1, w.end()-1); - result << value; - } - else if (mapOpNames.count(w)) - { - // opcode, e.g. OP_ADD or ADD: - result << mapOpNames[w]; - } - else - { - BOOST_ERROR("Parse error: " << s); - return CScript(); - } - } - - return result; -} - Array read_json(const std::string& jsondata) { diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 238033f407..03919e7c7d 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -9,6 +9,7 @@ #include "keystore.h" #include "main.h" #include "script.h" +#include "core_io.h" #include #include @@ -24,7 +25,6 @@ using namespace boost::algorithm; // In script_tests.cpp extern Array read_json(const std::string& jsondata); -extern CScript ParseScript(string s); unsigned int ParseFlags(string strFlags){ unsigned int flags = 0; From 2a5840096fd3b6235a4ff4b8488f8d4494414765 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 23 Jun 2014 19:32:54 -0400 Subject: [PATCH 0442/1288] core_read's ParseScript(): minor cleanups - use .empty() rather than .size() == 0 - use a const_iterator rather than BOOST_FOREACH - validate iterators before creating a string from them --- src/core_read.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/core_read.cpp b/src/core_read.cpp index d5d3cca480..1ecd6db324 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -21,7 +21,7 @@ CScript ParseScript(std::string s) static map mapOpNames; - if (mapOpNames.size() == 0) + if (mapOpNames.empty()) { for (int op = 0; op <= OP_NOP10; op++) { @@ -43,36 +43,36 @@ CScript ParseScript(std::string s) vector words; split(words, s, is_any_of(" \t\n"), token_compress_on); - BOOST_FOREACH(string w, words) + for (std::vector::const_iterator w = words.begin(); w != words.end(); ++w) { - if (w.size() == 0) + if (w->empty()) { // Empty string, ignore. (boost::split given '' will return one word) } - else if (all(w, is_digit()) || - (starts_with(w, "-") && all(string(w.begin()+1, w.end()), is_digit()))) + else if (all(*w, is_digit()) || + (starts_with(*w, "-") && all(string(w->begin()+1, w->end()), is_digit()))) { // Number - int64_t n = atoi64(w); + int64_t n = atoi64(*w); result << n; } - else if (starts_with(w, "0x") && IsHex(string(w.begin()+2, w.end()))) + else if (starts_with(*w, "0x") && (w->begin()+2 != w->end()) && IsHex(string(w->begin()+2, w->end()))) { // Raw hex data, inserted NOT pushed onto stack: - std::vector raw = ParseHex(string(w.begin()+2, w.end())); + std::vector raw = ParseHex(string(w->begin()+2, w->end())); result.insert(result.end(), raw.begin(), raw.end()); } - else if (w.size() >= 2 && starts_with(w, "'") && ends_with(w, "'")) + else if (w->size() >= 2 && starts_with(*w, "'") && ends_with(*w, "'")) { // Single-quoted string, pushed as data. NOTE: this is poor-man's // parsing, spaces/tabs/newlines in single-quoted strings won't work. - std::vector value(w.begin()+1, w.end()-1); + std::vector value(w->begin()+1, w->end()-1); result << value; } - else if (mapOpNames.count(w)) + else if (mapOpNames.count(*w)) { // opcode, e.g. OP_ADD or ADD: - result << mapOpNames[w]; + result << mapOpNames[*w]; } else { From 3ce7e669e3f90b3099a969ea5ffe3fa2643f4ed8 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 25 Jun 2014 21:09:36 -0400 Subject: [PATCH 0443/1288] bitcoin-cli, rpcrawtransaction: harmonize "{" styling --- src/bitcoin-cli.cpp | 31 +++++---------- src/rpcrawtransaction.cpp | 81 +++++++++++++-------------------------- 2 files changed, 37 insertions(+), 75 deletions(-) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 016b2f50f5..3b991f9276 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -50,8 +50,7 @@ static bool AppInitRPC(int argc, char* argv[]) // Parameters // ParseParameters(argc, argv); - if (!boost::filesystem::is_directory(GetDataDir(false))) - { + if (!boost::filesystem::is_directory(GetDataDir(false))) { fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str()); return false; } @@ -66,11 +65,9 @@ static bool AppInitRPC(int argc, char* argv[]) fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n"); return false; } - if (argc<2 || mapArgs.count("-?") || mapArgs.count("-help") || mapArgs.count("-version")) - { + if (argc<2 || mapArgs.count("-?") || mapArgs.count("-help") || mapArgs.count("-version")) { std::string strUsage = _("Bitcoin Core RPC client version") + " " + FormatFullVersion() + "\n"; - if (!mapArgs.count("-version")) - { + if (!mapArgs.count("-version")) { strUsage += "\n" + _("Usage:") + "\n" + " bitcoin-cli [options] [params] " + _("Send command to Bitcoin Core") + "\n" + " bitcoin-cli [options] help " + _("List commands") + "\n" + @@ -153,11 +150,9 @@ int CommandLineRPC(int argc, char *argv[]) { string strPrint; int nRet = 0; - try - { + try { // Skip switches - while (argc > 1 && IsSwitchChar(argv[1][0])) - { + while (argc > 1 && IsSwitchChar(argv[1][0])) { argc--; argv++; } @@ -178,15 +173,12 @@ int CommandLineRPC(int argc, char *argv[]) const Value& result = find_value(reply, "result"); const Value& error = find_value(reply, "error"); - if (error.type() != null_type) - { + if (error.type() != null_type) { // Error strPrint = "error: " + write_string(error, false); int code = find_value(error.get_obj(), "code").get_int(); nRet = abs(code); - } - else - { + } else { // Result if (result.type() == null_type) strPrint = ""; @@ -208,8 +200,7 @@ int CommandLineRPC(int argc, char *argv[]) throw; } - if (strPrint != "") - { + if (strPrint != "") { fprintf((nRet == 0 ? stdout : stderr), "%s\n", strPrint.c_str()); } return nRet; @@ -219,8 +210,7 @@ int main(int argc, char* argv[]) { SetupEnvironment(); - try - { + try { if(!AppInitRPC(argc, argv)) return EXIT_FAILURE; } @@ -233,8 +223,7 @@ int main(int argc, char* argv[]) } int ret = EXIT_FAILURE; - try - { + try { ret = CommandLineRPC(argc, argv); } catch (std::exception& e) { diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index a7aeb8f00b..763615120a 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -37,8 +37,7 @@ void ScriptPubKeyToJSON(const CScript& scriptPubKey, Object& out, bool fIncludeH if (fIncludeHex) out.push_back(Pair("hex", HexStr(scriptPubKey.begin(), scriptPubKey.end()))); - if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired)) - { + if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired)) { out.push_back(Pair("type", GetTxnOutputType(type))); return; } @@ -58,13 +57,11 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry) entry.push_back(Pair("version", tx.nVersion)); entry.push_back(Pair("locktime", (int64_t)tx.nLockTime)); Array vin; - BOOST_FOREACH(const CTxIn& txin, tx.vin) - { + BOOST_FOREACH(const CTxIn& txin, tx.vin) { Object in; if (tx.IsCoinBase()) in.push_back(Pair("coinbase", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()))); - else - { + else { in.push_back(Pair("txid", txin.prevout.hash.GetHex())); in.push_back(Pair("vout", (int64_t)txin.prevout.n)); Object o; @@ -77,8 +74,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry) } entry.push_back(Pair("vin", vin)); Array vout; - for (unsigned int i = 0; i < tx.vout.size(); i++) - { + for (unsigned int i = 0; i < tx.vout.size(); i++) { const CTxOut& txout = tx.vout[i]; Object out; out.push_back(Pair("value", ValueFromAmount(txout.nValue))); @@ -90,15 +86,12 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry) } entry.push_back(Pair("vout", vout)); - if (hashBlock != 0) - { + if (hashBlock != 0) { entry.push_back(Pair("blockhash", hashBlock.GetHex())); map::iterator mi = mapBlockIndex.find(hashBlock); - if (mi != mapBlockIndex.end() && (*mi).second) - { + if (mi != mapBlockIndex.end() && (*mi).second) { CBlockIndex* pindex = (*mi).second; - if (chainActive.Contains(pindex)) - { + if (chainActive.Contains(pindex)) { entry.push_back(Pair("confirmations", 1 + chainActive.Height() - pindex->nHeight)); entry.push_back(Pair("time", pindex->GetBlockTime())); entry.push_back(Pair("blocktime", pindex->GetBlockTime())); @@ -244,11 +237,9 @@ Value listunspent(const Array& params, bool fHelp) nMaxDepth = params[1].get_int(); set setAddress; - if (params.size() > 2) - { + if (params.size() > 2) { Array inputs = params[2].get_array(); - BOOST_FOREACH(Value& input, inputs) - { + BOOST_FOREACH(Value& input, inputs) { CBitcoinAddress address(input.get_str()); if (!address.IsValid()) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid Bitcoin address: ")+input.get_str()); @@ -262,13 +253,11 @@ Value listunspent(const Array& params, bool fHelp) vector vecOutputs; assert(pwalletMain != NULL); pwalletMain->AvailableCoins(vecOutputs, false); - BOOST_FOREACH(const COutput& out, vecOutputs) - { + BOOST_FOREACH(const COutput& out, vecOutputs) { if (out.nDepth < nMinDepth || out.nDepth > nMaxDepth) continue; - if (setAddress.size()) - { + if (setAddress.size()) { CTxDestination address; if (!ExtractDestination(out.tx->vout[out.i].scriptPubKey, address)) continue; @@ -283,18 +272,15 @@ Value listunspent(const Array& params, bool fHelp) entry.push_back(Pair("txid", out.tx->GetHash().GetHex())); entry.push_back(Pair("vout", out.i)); CTxDestination address; - if (ExtractDestination(out.tx->vout[out.i].scriptPubKey, address)) - { + if (ExtractDestination(out.tx->vout[out.i].scriptPubKey, address)) { entry.push_back(Pair("address", CBitcoinAddress(address).ToString())); if (pwalletMain->mapAddressBook.count(address)) entry.push_back(Pair("account", pwalletMain->mapAddressBook[address].name)); } entry.push_back(Pair("scriptPubKey", HexStr(pk.begin(), pk.end()))); - if (pk.IsPayToScriptHash()) - { + if (pk.IsPayToScriptHash()) { CTxDestination address; - if (ExtractDestination(pk, address)) - { + if (ExtractDestination(pk, address)) { const CScriptID& hash = boost::get(address); CScript redeemScript; if (pwalletMain->GetCScript(hash, redeemScript)) @@ -351,8 +337,7 @@ Value createrawtransaction(const Array& params, bool fHelp) CMutableTransaction rawTx; - BOOST_FOREACH(const Value& input, inputs) - { + BOOST_FOREACH(const Value& input, inputs) { const Object& o = input.get_obj(); uint256 txid = ParseHashO(o, "txid"); @@ -369,8 +354,7 @@ Value createrawtransaction(const Array& params, bool fHelp) } set setAddress; - BOOST_FOREACH(const Pair& s, sendTo) - { + BOOST_FOREACH(const Pair& s, sendTo) { CBitcoinAddress address(s.name_); if (!address.IsValid()) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid Bitcoin address: ")+s.name_); @@ -550,8 +534,7 @@ Value signrawtransaction(const Array& params, bool fHelp) vector txData(ParseHexV(params[0], "argument 1")); CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION); vector txVariants; - while (!ssData.empty()) - { + while (!ssData.empty()) { try { CMutableTransaction tx; ssData >> tx; @@ -590,12 +573,10 @@ Value signrawtransaction(const Array& params, bool fHelp) bool fGivenKeys = false; CBasicKeyStore tempKeystore; - if (params.size() > 2 && params[2].type() != null_type) - { + if (params.size() > 2 && params[2].type() != null_type) { fGivenKeys = true; Array keys = params[2].get_array(); - BOOST_FOREACH(Value k, keys) - { + BOOST_FOREACH(Value k, keys) { CBitcoinSecret vchSecret; bool fGood = vchSecret.SetString(k.get_str()); if (!fGood) @@ -610,11 +591,9 @@ Value signrawtransaction(const Array& params, bool fHelp) #endif // Add previous txouts given in the RPC call: - if (params.size() > 1 && params[1].type() != null_type) - { + if (params.size() > 1 && params[1].type() != null_type) { Array prevTxs = params[1].get_array(); - BOOST_FOREACH(Value& p, prevTxs) - { + BOOST_FOREACH(Value& p, prevTxs) { if (p.type() != obj_type) throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "expected object with {\"txid'\",\"vout\",\"scriptPubKey\"}"); @@ -649,12 +628,10 @@ Value signrawtransaction(const Array& params, bool fHelp) // if redeemScript given and not using the local wallet (private keys // given), add redeemScript to the tempKeystore so it can be signed: - if (fGivenKeys && scriptPubKey.IsPayToScriptHash()) - { + if (fGivenKeys && scriptPubKey.IsPayToScriptHash()) { RPCTypeCheck(prevOut, map_list_of("txid", str_type)("vout", int_type)("scriptPubKey", str_type)("redeemScript",str_type)); Value v = find_value(prevOut, "redeemScript"); - if (!(v == Value::null)) - { + if (!(v == Value::null)) { vector rsData(ParseHexV(v, "redeemScript")); CScript redeemScript(rsData.begin(), rsData.end()); tempKeystore.AddCScript(redeemScript); @@ -670,8 +647,7 @@ Value signrawtransaction(const Array& params, bool fHelp) #endif int nHashType = SIGHASH_ALL; - if (params.size() > 3 && params[3].type() != null_type) - { + if (params.size() > 3 && params[3].type() != null_type) { static map mapSigHashValues = boost::assign::map_list_of (string("ALL"), int(SIGHASH_ALL)) @@ -691,12 +667,10 @@ Value signrawtransaction(const Array& params, bool fHelp) bool fHashSingle = ((nHashType & ~SIGHASH_ANYONECANPAY) == SIGHASH_SINGLE); // Sign what we can: - for (unsigned int i = 0; i < mergedTx.vin.size(); i++) - { + for (unsigned int i = 0; i < mergedTx.vin.size(); i++) { CTxIn& txin = mergedTx.vin[i]; CCoins coins; - if (!view.GetCoins(txin.prevout.hash, coins) || !coins.IsAvailable(txin.prevout.n)) - { + if (!view.GetCoins(txin.prevout.hash, coins) || !coins.IsAvailable(txin.prevout.n)) { fComplete = false; continue; } @@ -708,8 +682,7 @@ Value signrawtransaction(const Array& params, bool fHelp) SignSignature(keystore, prevPubKey, mergedTx, i, nHashType); // ... and merge in other signatures: - BOOST_FOREACH(const CMutableTransaction& txv, txVariants) - { + BOOST_FOREACH(const CMutableTransaction& txv, txVariants) { txin.scriptSig = CombineSignatures(prevPubKey, mergedTx, i, txin.scriptSig, txv.vin[i].scriptSig); } if (!VerifyScript(txin.scriptSig, prevPubKey, mergedTx, i, STANDARD_SCRIPT_VERIFY_FLAGS, 0)) From cbe39a38526a6c17619d02cc697b80ebfd57203b Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 29 Jul 2014 11:12:44 -0400 Subject: [PATCH 0444/1288] Add "bitcoin-tx" command line utility and supporting modules. This is a simple utility that provides command line manipulation of a hex-encoded TX. The utility takes a hex string on the command line as input, performs zero or more mutations, and outputs a hex string to standard output. This utility is also an intentional exercise of the "bitcoin library" concept. It is designed to require minimal libraries, and works entirely without need for any RPC or P2P communication. See "bitcoin-tx --help" for command and options summary. --- .gitignore | 1 + src/Makefile.am | 23 ++ src/Makefile.qt.include | 2 +- src/Makefile.qttest.include | 2 +- src/Makefile.test.include | 2 +- src/bitcoin-tx.cpp | 597 ++++++++++++++++++++++++++++++++ src/core_io.h | 7 + src/core_read.cpp | 25 ++ src/core_write.cpp | 74 ++++ src/univalue/univalue.cpp | 233 +++++++++++++ src/univalue/univalue.h | 157 +++++++++ src/univalue/univalue_read.cpp | 390 +++++++++++++++++++++ src/univalue/univalue_write.cpp | 145 ++++++++ 13 files changed, 1655 insertions(+), 3 deletions(-) create mode 100644 src/bitcoin-tx.cpp create mode 100644 src/univalue/univalue.cpp create mode 100644 src/univalue/univalue.h create mode 100644 src/univalue/univalue_read.cpp create mode 100644 src/univalue/univalue_write.cpp diff --git a/.gitignore b/.gitignore index 4169a2d96c..e21ea92552 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ src/bitcoin src/bitcoind src/bitcoin-cli +src/bitcoin-tx src/test/test_bitcoin src/qt/test/test_bitcoin-qt diff --git a/src/Makefile.am b/src/Makefile.am index 4e59146424..2d84eeba1c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -34,6 +34,7 @@ LIBBITCOIN_COMMON=libbitcoin_common.a LIBBITCOIN_CLI=libbitcoin_cli.a LIBBITCOIN_UTIL=libbitcoin_util.a LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a +LIBBITCOIN_UNIVALUE=univalue/libbitcoin_univalue.a LIBBITCOINQT=qt/libbitcoinqt.a noinst_LIBRARIES = \ @@ -41,6 +42,7 @@ noinst_LIBRARIES = \ libbitcoin_common.a \ libbitcoin_cli.a \ libbitcoin_util.a \ + univalue/libbitcoin_univalue.a \ crypto/libbitcoin_crypto.a if ENABLE_WALLET BITCOIN_INCLUDES += $(BDB_CPPFLAGS) @@ -58,6 +60,8 @@ if BUILD_BITCOIN_CLI bin_PROGRAMS += bitcoin-cli endif +bin_PROGRAMS += bitcoin-tx + .PHONY: FORCE # bitcoin core # BITCOIN_CORE_H = \ @@ -178,6 +182,13 @@ crypto_libbitcoin_crypto_a_SOURCES = \ crypto/sha1.h \ crypto/ripemd160.h +# univalue JSON library +univalue_libbitcoin_univalue_a_SOURCES = \ + univalue/univalue.cpp \ + univalue/univalue_read.cpp \ + univalue/univalue_write.cpp \ + univalue/univalue.h + # common: shared between bitcoind, and bitcoin-qt and non-server tools libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_common_a_SOURCES = \ @@ -229,6 +240,7 @@ nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h bitcoind_LDADD = \ $(LIBBITCOIN_SERVER) \ $(LIBBITCOIN_COMMON) \ + $(LIBBITCOIN_UNIVALUE) \ $(LIBBITCOIN_UTIL) \ $(LIBBITCOIN_CRYPTO) \ $(LIBLEVELDB) \ @@ -267,6 +279,17 @@ endif bitcoin_cli_CPPFLAGS = $(BITCOIN_INCLUDES) # +# bitcoin-tx binary # +bitcoin_tx_LDADD = \ + $(LIBBITCOIN_UNIVALUE) \ + $(LIBBITCOIN_COMMON) \ + $(LIBBITCOIN_UTIL) \ + $(LIBBITCOIN_CRYPTO) \ + $(BOOST_LIBS) +bitcoin_tx_SOURCES = bitcoin-tx.cpp +bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES) +# + if TARGET_WINDOWS bitcoin_cli_SOURCES += bitcoin-cli-res.rc endif diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 2772bc753a..2052264dc9 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -359,7 +359,7 @@ qt_bitcoin_qt_LDADD = qt/libbitcoinqt.a $(LIBBITCOIN_SERVER) if ENABLE_WALLET qt_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) endif -qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBLEVELDB) $(LIBMEMENV) \ +qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) if USE_LIBSECP256K1 qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 51ce006fc1..d49b2240ea 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -30,7 +30,7 @@ qt_test_test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER) if ENABLE_WALLET qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) endif -qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBLEVELDB) \ +qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) \ $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) if USE_LIBSECP256K1 diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 12b90adca3..72451fba9a 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -64,7 +64,7 @@ endif test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES) test_test_bitcoin_CPPFLAGS = $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) -test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBLEVELDB) $(LIBMEMENV) \ +test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) if ENABLE_WALLET test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp new file mode 100644 index 0000000000..299315424b --- /dev/null +++ b/src/bitcoin-tx.cpp @@ -0,0 +1,597 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "base58.h" +#include "util.h" +#include "core.h" +#include "main.h" // for MAX_BLOCK_SIZE +#include "keystore.h" +#include "ui_interface.h" // for _(...) +#include "univalue/univalue.h" +#include "core_io.h" + +#include +#include + +using namespace std; +using namespace boost::assign; + +static bool fCreateBlank; +static map registers; +CClientUIInterface uiInterface; + +static bool AppInitRawTx(int argc, char* argv[]) +{ + // + // Parameters + // + ParseParameters(argc, argv); + + // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause) + if (!SelectParamsFromCommandLine()) { + fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n"); + return false; + } + + fCreateBlank = GetBoolArg("-create", false); + + if (argc<2 || mapArgs.count("-?") || mapArgs.count("-help")) + { + // First part of help message is specific to this utility + std::string strUsage = _("Bitcoin Core bitcoin-tx utility version") + " " + FormatFullVersion() + "\n\n" + + _("Usage:") + "\n" + + " bitcoin-tx [options] [commands] " + _("Update hex-encoded bitcoin transaction") + "\n" + + " bitcoin-tx [options] -create [commands] " + _("Create hex-encoded bitcoin transaction") + "\n" + + "\n"; + + fprintf(stdout, "%s", strUsage.c_str()); + + strUsage = _("Options:") + "\n"; + strUsage += " -? " + _("This help message") + "\n"; + strUsage += " -create " + _("Create new, empty TX.") + "\n"; + strUsage += " -json " + _("Select JSON output") + "\n"; + strUsage += " -regtest " + _("Enter regression test mode, which uses a special chain in which blocks can be solved instantly.") + "\n"; + strUsage += " -testnet " + _("Use the test network") + "\n"; + strUsage += "\n"; + + fprintf(stdout, "%s", strUsage.c_str()); + + + strUsage = _("Commands:") + "\n"; + strUsage += " delin=N " + _("Delete input N from TX") + "\n"; + strUsage += " delout=N " + _("Delete output N from TX") + "\n"; + strUsage += " in=TXID:VOUT " + _("Add input to TX") + "\n"; + strUsage += " locktime=N " + _("Set TX lock time to N") + "\n"; + strUsage += " nversion=N " + _("Set TX version to N") + "\n"; + strUsage += " outaddr=VALUE:ADDRESS " + _("Add address-based output to TX") + "\n"; + strUsage += " outscript=VALUE:SCRIPT " + _("Add raw script output to TX") + "\n"; + strUsage += " sign=SIGHASH-FLAGS " + _("Add zero or more signatures to transaction") + "\n"; + strUsage += " This command requires JSON registers:\n"; + strUsage += " prevtxs=JSON object\n"; + strUsage += " privatekeys=JSON object\n"; + strUsage += " See signrawtransaction docs for format of sighash flags, JSON objects.\n"; + strUsage += "\n"; + fprintf(stdout, "%s", strUsage.c_str()); + + strUsage = _("Register Commands:") + "\n"; + strUsage += " load=NAME:FILENAME " + _("Load JSON file FILENAME into register NAME") + "\n"; + strUsage += " set=NAME:JSON-STRING " + _("Set register NAME to given JSON-STRING") + "\n"; + strUsage += "\n"; + fprintf(stdout, "%s", strUsage.c_str()); + + return false; + } + return true; +} + +static void RegisterSetJson(const string& key, const string& rawJson) +{ + UniValue val; + if (!val.read(rawJson)) { + string strErr = "Cannot parse JSON for key " + key; + throw runtime_error(strErr); + } + + registers[key] = val; +} + +static void RegisterSet(const string& strInput) +{ + // separate NAME:VALUE in string + size_t pos = strInput.find(':'); + if ((pos == string::npos) || + (pos == 0) || + (pos == (strInput.size() - 1))) + throw runtime_error("Register input requires NAME:VALUE"); + + string key = strInput.substr(0, pos); + string valStr = strInput.substr(pos + 1, string::npos); + + RegisterSetJson(key, valStr); +} + +static void RegisterLoad(const string& strInput) +{ + // separate NAME:FILENAME in string + size_t pos = strInput.find(':'); + if ((pos == string::npos) || + (pos == 0) || + (pos == (strInput.size() - 1))) + throw runtime_error("Register load requires NAME:FILENAME"); + + string key = strInput.substr(0, pos); + string filename = strInput.substr(pos + 1, string::npos); + + FILE *f = fopen(filename.c_str(), "r"); + if (!f) { + string strErr = "Cannot open file " + filename; + throw runtime_error(strErr); + } + + // load file chunks into one big buffer + string valStr; + while ((!feof(f)) && (!ferror(f))) { + char buf[4096]; + int bread = fread(buf, 1, sizeof(buf), f); + if (bread <= 0) + break; + + valStr.insert(valStr.size(), buf, bread); + } + + if (ferror(f)) { + string strErr = "Error reading file " + filename; + throw runtime_error(strErr); + } + + fclose(f); + + // evaluate as JSON buffer register + RegisterSetJson(key, valStr); +} + +static void MutateTxVersion(CMutableTransaction& tx, const string& cmdVal) +{ + int64_t newVersion = atoi64(cmdVal); + if (newVersion < 1 || newVersion > CTransaction::CURRENT_VERSION) + throw runtime_error("Invalid TX version requested"); + + tx.nVersion = (int) newVersion; +} + +static void MutateTxLocktime(CMutableTransaction& tx, const string& cmdVal) +{ + int64_t newLocktime = atoi64(cmdVal); + if (newLocktime < 0LL || newLocktime > 0xffffffffLL) + throw runtime_error("Invalid TX locktime requested"); + + tx.nLockTime = (unsigned int) newLocktime; +} + +static void MutateTxAddInput(CMutableTransaction& tx, const string& strInput) +{ + // separate TXID:VOUT in string + size_t pos = strInput.find(':'); + if ((pos == string::npos) || + (pos == 0) || + (pos == (strInput.size() - 1))) + throw runtime_error("TX input missing separator"); + + // extract and validate TXID + string strTxid = strInput.substr(0, pos); + if ((strTxid.size() != 64) || !IsHex(strTxid)) + throw runtime_error("invalid TX input txid"); + uint256 txid(strTxid); + + static const unsigned int minTxOutSz = 9; + static const unsigned int maxVout = MAX_BLOCK_SIZE / minTxOutSz; + + // extract and validate vout + string strVout = strInput.substr(pos + 1, string::npos); + int vout = atoi(strVout); + if ((vout < 0) || (vout > (int)maxVout)) + throw runtime_error("invalid TX input vout"); + + // append to transaction input list + CTxIn txin(txid, vout); + tx.vin.push_back(txin); +} + +static void MutateTxAddOutAddr(CMutableTransaction& tx, const string& strInput) +{ + // separate VALUE:ADDRESS in string + size_t pos = strInput.find(':'); + if ((pos == string::npos) || + (pos == 0) || + (pos == (strInput.size() - 1))) + throw runtime_error("TX output missing separator"); + + // extract and validate VALUE + string strValue = strInput.substr(0, pos); + int64_t value; + if (!ParseMoney(strValue, value)) + throw runtime_error("invalid TX output value"); + + // extract and validate ADDRESS + string strAddr = strInput.substr(pos + 1, string::npos); + CBitcoinAddress addr(strAddr); + if (!addr.IsValid()) + throw runtime_error("invalid TX output address"); + + // build standard output script via SetDestination() + CScript scriptPubKey; + scriptPubKey.SetDestination(addr.Get()); + + // construct TxOut, append to transaction output list + CTxOut txout(value, scriptPubKey); + tx.vout.push_back(txout); +} + +static void MutateTxAddOutScript(CMutableTransaction& tx, const string& strInput) +{ + // separate VALUE:SCRIPT in string + size_t pos = strInput.find(':'); + if ((pos == string::npos) || + (pos == 0) || + (pos == (strInput.size() - 1))) + throw runtime_error("TX output missing separator"); + + // extract and validate VALUE + string strValue = strInput.substr(0, pos); + int64_t value; + if (!ParseMoney(strValue, value)) + throw runtime_error("invalid TX output value"); + + // extract and validate script + string strScript = strInput.substr(pos + 1, string::npos); + CScript scriptPubKey = ParseScript(strScript); // throws on err + + // construct TxOut, append to transaction output list + CTxOut txout(value, scriptPubKey); + tx.vout.push_back(txout); +} + +static void MutateTxDelInput(CMutableTransaction& tx, const string& strInIdx) +{ + // parse requested deletion index + int inIdx = atoi(strInIdx); + if (inIdx < 0 || inIdx >= (int)tx.vin.size()) { + string strErr = "Invalid TX input index '" + strInIdx + "'"; + throw runtime_error(strErr.c_str()); + } + + // delete input from transaction + tx.vin.erase(tx.vin.begin() + inIdx); +} + +static void MutateTxDelOutput(CMutableTransaction& tx, const string& strOutIdx) +{ + // parse requested deletion index + int outIdx = atoi(strOutIdx); + if (outIdx < 0 || outIdx >= (int)tx.vout.size()) { + string strErr = "Invalid TX output index '" + strOutIdx + "'"; + throw runtime_error(strErr.c_str()); + } + + // delete output from transaction + tx.vout.erase(tx.vout.begin() + outIdx); +} + +static const unsigned int N_SIGHASH_OPTS = 6; +static const struct { + const char *flagStr; + int flags; +} sighashOptions[N_SIGHASH_OPTS] = { + "ALL", SIGHASH_ALL, + "NONE", SIGHASH_NONE, + "SINGLE", SIGHASH_SINGLE, + "ALL|ANYONECANPAY", SIGHASH_ALL|SIGHASH_ANYONECANPAY, + "NONE|ANYONECANPAY", SIGHASH_NONE|SIGHASH_ANYONECANPAY, + "SINGLE|ANYONECANPAY", SIGHASH_SINGLE|SIGHASH_ANYONECANPAY, +}; + +static bool findSighashFlags(int& flags, const string& flagStr) +{ + flags = 0; + + for (unsigned int i = 0; i < N_SIGHASH_OPTS; i++) { + if (flagStr == sighashOptions[i].flagStr) { + flags = sighashOptions[i].flags; + return true; + } + } + + return false; +} + +uint256 ParseHashUO(map& o, string strKey) +{ + if (!o.count(strKey)) + return 0; + return ParseHashUV(o[strKey], strKey); +} + +vector ParseHexUO(map& o, string strKey) +{ + if (!o.count(strKey)) { + vector emptyVec; + return emptyVec; + } + return ParseHexUV(o[strKey], strKey); +} + +static void MutateTxSign(CMutableTransaction& tx, const string& flagStr) +{ + int nHashType = SIGHASH_ALL; + + if (flagStr.size() > 0) + if (!findSighashFlags(nHashType, flagStr)) + throw runtime_error("unknown sighash flag/sign option"); + + vector txVariants; + txVariants.push_back(tx); + + // mergedTx will end up with all the signatures; it + // starts as a clone of the raw tx: + CMutableTransaction mergedTx(txVariants[0]); + bool fComplete = true; + CCoinsView viewDummy; + CCoinsViewCache view(viewDummy); + + if (!registers.count("privatekeys")) + throw runtime_error("privatekeys register variable must be set."); + bool fGivenKeys = false; + CBasicKeyStore tempKeystore; + UniValue keysObj = registers["privatekeys"]; + fGivenKeys = true; + + for (unsigned int kidx = 0; kidx < keysObj.count(); kidx++) { + if (!keysObj[kidx].isStr()) + throw runtime_error("privatekey not a string"); + CBitcoinSecret vchSecret; + bool fGood = vchSecret.SetString(keysObj[kidx].getValStr()); + if (!fGood) + throw runtime_error("privatekey not valid"); + + CKey key = vchSecret.GetKey(); + tempKeystore.AddKey(key); + } + + // Add previous txouts given in the RPC call: + if (!registers.count("prevtxs")) + throw runtime_error("prevtxs register variable must be set."); + UniValue prevtxsObj = registers["privatekeys"]; + { + for (unsigned int previdx = 0; previdx < prevtxsObj.count(); previdx++) { + UniValue prevOut = prevtxsObj[previdx]; + if (!prevOut.isObject()) + throw runtime_error("expected prevtxs internal object"); + + map types = map_list_of("txid", UniValue::VSTR)("vout",UniValue::VNUM)("scriptPubKey",UniValue::VSTR); + if (!prevOut.checkObject(types)) + throw runtime_error("prevtxs internal object typecheck fail"); + + uint256 txid = ParseHashUV(prevOut, "txid"); + + int nOut = atoi(prevOut["vout"].getValStr()); + if (nOut < 0) + throw runtime_error("vout must be positive"); + + vector pkData(ParseHexUV(prevOut, "scriptPubKey")); + CScript scriptPubKey(pkData.begin(), pkData.end()); + + CCoins coins; + if (view.GetCoins(txid, coins)) { + if (coins.IsAvailable(nOut) && coins.vout[nOut].scriptPubKey != scriptPubKey) { + string err("Previous output scriptPubKey mismatch:\n"); + err = err + coins.vout[nOut].scriptPubKey.ToString() + "\nvs:\n"+ + scriptPubKey.ToString(); + throw runtime_error(err); + } + // what todo if txid is known, but the actual output isn't? + } + if ((unsigned int)nOut >= coins.vout.size()) + coins.vout.resize(nOut+1); + coins.vout[nOut].scriptPubKey = scriptPubKey; + coins.vout[nOut].nValue = 0; // we don't know the actual output value + view.SetCoins(txid, coins); + + // if redeemScript given and private keys given, + // add redeemScript to the tempKeystore so it can be signed: + if (fGivenKeys && scriptPubKey.IsPayToScriptHash() && + prevOut.exists("redeemScript")) { + UniValue v = prevOut["redeemScript"]; + vector rsData(ParseHexUV(v, "redeemScript")); + CScript redeemScript(rsData.begin(), rsData.end()); + tempKeystore.AddCScript(redeemScript); + } + } + } + + const CKeyStore& keystore = tempKeystore; + + bool fHashSingle = ((nHashType & ~SIGHASH_ANYONECANPAY) == SIGHASH_SINGLE); + + // Sign what we can: + for (unsigned int i = 0; i < mergedTx.vin.size(); i++) { + CTxIn& txin = mergedTx.vin[i]; + CCoins coins; + if (!view.GetCoins(txin.prevout.hash, coins) || !coins.IsAvailable(txin.prevout.n)) { + fComplete = false; + continue; + } + const CScript& prevPubKey = coins.vout[txin.prevout.n].scriptPubKey; + + txin.scriptSig.clear(); + // Only sign SIGHASH_SINGLE if there's a corresponding output: + if (!fHashSingle || (i < mergedTx.vout.size())) + SignSignature(keystore, prevPubKey, mergedTx, i, nHashType); + + // ... and merge in other signatures: + BOOST_FOREACH(const CTransaction& txv, txVariants) { + txin.scriptSig = CombineSignatures(prevPubKey, mergedTx, i, txin.scriptSig, txv.vin[i].scriptSig); + } + if (!VerifyScript(txin.scriptSig, prevPubKey, mergedTx, i, STANDARD_SCRIPT_VERIFY_FLAGS, 0)) + fComplete = false; + } + + if (fComplete) { + // do nothing... for now + // perhaps store this for later optional JSON output + } + + tx = mergedTx; +} + +static void MutateTx(CMutableTransaction& tx, const string& command, + const string& commandVal) +{ + if (command == "nversion") + MutateTxVersion(tx, commandVal); + else if (command == "locktime") + MutateTxLocktime(tx, commandVal); + + else if (command == "delin") + MutateTxDelInput(tx, commandVal); + else if (command == "in") + MutateTxAddInput(tx, commandVal); + + else if (command == "delout") + MutateTxDelOutput(tx, commandVal); + else if (command == "outaddr") + MutateTxAddOutAddr(tx, commandVal); + else if (command == "outscript") + MutateTxAddOutScript(tx, commandVal); + + else if (command == "sign") + MutateTxSign(tx, commandVal); + + else if (command == "load") + RegisterLoad(commandVal); + + else if (command == "set") + RegisterSet(commandVal); + + else + throw runtime_error("unknown command"); +} + +static void OutputTxJSON(const CTransaction& tx) +{ + UniValue entry(UniValue::VOBJ); + TxToUniv(tx, 0, entry); + + string jsonOutput = entry.write(4); + fprintf(stdout, "%s\n", jsonOutput.c_str()); +} + +static void OutputTxHex(const CTransaction& tx) +{ + string strHex = EncodeHexTx(tx); + + fprintf(stdout, "%s\n", strHex.c_str()); +} + +static void OutputTx(const CTransaction& tx) +{ + if (GetBoolArg("-json", false)) + OutputTxJSON(tx); + else + OutputTxHex(tx); +} + +static int CommandLineRawTx(int argc, char* argv[]) +{ + string strPrint; + int nRet = 0; + try { + // Skip switches + while (argc > 1 && IsSwitchChar(argv[1][0])) { + argc--; + argv++; + } + + CTransaction txDecodeTmp; + int startArg; + + if (!fCreateBlank) { + // require at least one param + if (argc < 2) + throw runtime_error("too few parameters"); + + // param: hex-encoded bitcoin transaction + string strHexTx(argv[1]); + + if (!DecodeHexTx(txDecodeTmp, strHexTx)) + throw runtime_error("invalid transaction encoding"); + + startArg = 2; + } else + startArg = 1; + + CMutableTransaction tx(txDecodeTmp); + + for (int i = startArg; i < argc; i++) { + string arg = argv[i]; + string key, value; + size_t eqpos = arg.find('='); + if (eqpos == string::npos) + key = arg; + else { + key = arg.substr(0, eqpos); + value = arg.substr(eqpos + 1); + } + + MutateTx(tx, key, value); + } + + OutputTx(tx); + } + + catch (boost::thread_interrupted) { + throw; + } + catch (std::exception& e) { + strPrint = string("error: ") + e.what(); + nRet = EXIT_FAILURE; + } + catch (...) { + PrintExceptionContinue(NULL, "CommandLineRawTx()"); + throw; + } + + if (strPrint != "") { + fprintf((nRet == 0 ? stdout : stderr), "%s\n", strPrint.c_str()); + } + return nRet; +} + +int main(int argc, char* argv[]) +{ + SetupEnvironment(); + + try { + if(!AppInitRawTx(argc, argv)) + return EXIT_FAILURE; + } + catch (std::exception& e) { + PrintExceptionContinue(&e, "AppInitRawTx()"); + return EXIT_FAILURE; + } catch (...) { + PrintExceptionContinue(NULL, "AppInitRawTx()"); + return EXIT_FAILURE; + } + + int ret = EXIT_FAILURE; + try { + ret = CommandLineRawTx(argc, argv); + } + catch (std::exception& e) { + PrintExceptionContinue(&e, "CommandLineRawTx()"); + } catch (...) { + PrintExceptionContinue(NULL, "CommandLineRawTx()"); + } + return ret; +} + diff --git a/src/core_io.h b/src/core_io.h index 528c472803..8a7d580570 100644 --- a/src/core_io.h +++ b/src/core_io.h @@ -3,14 +3,21 @@ #include +class uint256; class CScript; class CTransaction; +class UniValue; // core_read.cpp extern CScript ParseScript(std::string s); extern bool DecodeHexTx(CTransaction& tx, const std::string& strHexTx); +extern uint256 ParseHashUV(const UniValue& v, const std::string& strName); +extern std::vector ParseHexUV(const UniValue& v, const std::string& strName); // core_write.cpp extern std::string EncodeHexTx(const CTransaction& tx); +extern void ScriptPubKeyToUniv(const CScript& scriptPubKey, + UniValue& out, bool fIncludeHex); +extern void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry); #endif // __BITCOIN_CORE_IO_H__ diff --git a/src/core_read.cpp b/src/core_read.cpp index 1ecd6db324..0f06bb6952 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -4,12 +4,14 @@ #include "core.h" #include "serialize.h" #include "script.h" +#include "util.h" #include #include #include #include #include +#include "univalue/univalue.h" using namespace std; using namespace boost; @@ -100,3 +102,26 @@ bool DecodeHexTx(CTransaction& tx, const std::string& strHexTx) return true; } +uint256 ParseHashUV(const UniValue& v, const string& strName) +{ + string strHex; + if (v.isStr()) + strHex = v.getValStr(); + if (!IsHex(strHex)) // Note: IsHex("") is false + throw runtime_error(strName+" must be hexadecimal string (not '"+strHex+"')"); + + uint256 result; + result.SetHex(strHex); + return result; +} + +vector ParseHexUV(const UniValue& v, const string& strName) +{ + string strHex; + if (v.isStr()) + strHex = v.getValStr(); + if (!IsHex(strHex)) + throw runtime_error(strName+" must be hexadecimal string (not '"+strHex+"')"); + return ParseHex(strHex); +} + diff --git a/src/core_write.cpp b/src/core_write.cpp index 960974df89..2eb220779f 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -1,8 +1,12 @@ +#include #include "core_io.h" +#include "univalue/univalue.h" +#include "script.h" #include "core.h" #include "serialize.h" #include "util.h" +#include "base58.h" using namespace std; @@ -13,3 +17,73 @@ string EncodeHexTx(const CTransaction& tx) return HexStr(ssTx.begin(), ssTx.end()); } +void ScriptPubKeyToUniv(const CScript& scriptPubKey, + UniValue& out, bool fIncludeHex) +{ + txnouttype type; + vector addresses; + int nRequired; + + out.pushKV("asm", scriptPubKey.ToString()); + if (fIncludeHex) + out.pushKV("hex", HexStr(scriptPubKey.begin(), scriptPubKey.end())); + + if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired)) { + out.pushKV("type", GetTxnOutputType(type)); + return; + } + + out.pushKV("reqSigs", nRequired); + out.pushKV("type", GetTxnOutputType(type)); + + UniValue a(UniValue::VARR); + BOOST_FOREACH(const CTxDestination& addr, addresses) + a.push_back(CBitcoinAddress(addr).ToString()); + out.pushKV("addresses", a); +} + +void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry) +{ + entry.pushKV("txid", tx.GetHash().GetHex()); + entry.pushKV("version", tx.nVersion); + entry.pushKV("locktime", (int64_t)tx.nLockTime); + + UniValue vin(UniValue::VARR); + BOOST_FOREACH(const CTxIn& txin, tx.vin) { + UniValue in(UniValue::VOBJ); + if (tx.IsCoinBase()) + in.pushKV("coinbase", HexStr(txin.scriptSig.begin(), txin.scriptSig.end())); + else { + in.pushKV("txid", txin.prevout.hash.GetHex()); + in.pushKV("vout", (int64_t)txin.prevout.n); + UniValue o(UniValue::VOBJ); + o.pushKV("asm", txin.scriptSig.ToString()); + o.pushKV("hex", HexStr(txin.scriptSig.begin(), txin.scriptSig.end())); + in.pushKV("scriptSig", o); + } + in.pushKV("sequence", (int64_t)txin.nSequence); + vin.push_back(in); + } + entry.pushKV("vin", vin); + + UniValue vout(UniValue::VARR); + for (unsigned int i = 0; i < tx.vout.size(); i++) { + const CTxOut& txout = tx.vout[i]; + + UniValue out(UniValue::VOBJ); + + UniValue outValue(UniValue::VNUM, FormatMoney(txout.nValue)); + out.pushKV("value", outValue); + out.pushKV("n", (int64_t)i); + + UniValue o(UniValue::VOBJ); + ScriptPubKeyToUniv(txout.scriptPubKey, o, true); + out.pushKV("scriptPubKey", o); + vout.push_back(out); + } + entry.pushKV("vout", vout); + + if (hashBlock != 0) + entry.pushKV("blockhash", hashBlock.GetHex()); +} + diff --git a/src/univalue/univalue.cpp b/src/univalue/univalue.cpp new file mode 100644 index 0000000000..e577aa8ee4 --- /dev/null +++ b/src/univalue/univalue.cpp @@ -0,0 +1,233 @@ +// Copyright 2014 BitPay Inc. +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include +#include +#include +#include "univalue.h" + +using namespace std; + +static const UniValue nullValue; + +void UniValue::clear() +{ + typ = VNULL; + val.clear(); + keys.clear(); + values.clear(); +} + +bool UniValue::setNull() +{ + clear(); + return true; +} + +bool UniValue::setBool(bool val_) +{ + clear(); + typ = VBOOL; + if (val_) + val = "1"; + return true; +} + +static bool validNumStr(const string& s) +{ + string tokenVal; + unsigned int consumed; + enum jtokentype tt = getJsonToken(tokenVal, consumed, s.c_str()); + return (tt == JTOK_NUMBER); +} + +bool UniValue::setNumStr(const string& val_) +{ + if (!validNumStr(val)) + return false; + + clear(); + typ = VNUM; + val = val_; + return true; +} + +bool UniValue::setInt(uint64_t val) +{ + string s; + ostringstream oss; + + oss << val; + + return setNumStr(oss.str()); +} + +bool UniValue::setInt(int64_t val) +{ + string s; + ostringstream oss; + + oss << val; + + return setNumStr(oss.str()); +} + +bool UniValue::setFloat(double val) +{ + string s; + ostringstream oss; + + oss << val; + + return setNumStr(oss.str()); +} + +bool UniValue::setStr(const string& val_) +{ + clear(); + typ = VSTR; + val = val_; + return true; +} + +bool UniValue::setArray() +{ + clear(); + typ = VARR; + return true; +} + +bool UniValue::setObject() +{ + clear(); + typ = VOBJ; + return true; +} + +bool UniValue::push_back(const UniValue& val) +{ + if (typ != VARR) + return false; + + values.push_back(val); + return true; +} + +bool UniValue::push_backV(const std::vector& vec) +{ + if (typ != VARR) + return false; + + values.insert(values.end(), vec.begin(), vec.end()); + + return true; +} + +bool UniValue::pushKV(const std::string& key, const UniValue& val) +{ + if (typ != VOBJ) + return false; + + keys.push_back(key); + values.push_back(val); + return true; +} + +bool UniValue::pushKVs(const UniValue& obj) +{ + if (typ != VOBJ || obj.typ != VOBJ) + return false; + + for (unsigned int i = 0; i < obj.keys.size(); i++) { + keys.push_back(obj.keys[i]); + values.push_back(obj.values[i]); + } + + return true; +} + +bool UniValue::getArray(std::vector& arr) +{ + if (typ != VARR) + return false; + + arr = values; + return true; +} + +bool UniValue::getObject(std::map& obj) +{ + if (typ != VOBJ) + return false; + + obj.clear(); + for (unsigned int i = 0; i < keys.size(); i++) { + obj[keys[i]] = values[i]; + } + + return true; +} + +int UniValue::findKey(const std::string& key) const +{ + for (unsigned int i = 0; i < keys.size(); i++) { + if (keys[i] == key) + return (int) i; + } + + return -1; +} + +bool UniValue::checkObject(const std::map& t) +{ + for (std::map::const_iterator it = t.begin(); + it != t.end(); it++) { + int idx = findKey(it->first); + if (idx < 0) + return false; + + if (values[idx].getType() != it->second) + return false; + } + + return true; +} + +const UniValue& UniValue::operator[](const std::string& key) const +{ + if (typ != VOBJ) + return nullValue; + + int index = findKey(key); + if (index < 0) + return nullValue; + + return values[index]; +} + +const UniValue& UniValue::operator[](unsigned int index) const +{ + if (typ != VOBJ && typ != VARR) + return nullValue; + if (index >= values.size()) + return nullValue; + + return values[index]; +} + +const char *uvTypeName(UniValue::VType t) +{ + switch (t) { + case UniValue::VNULL: return "null"; + case UniValue::VBOOL: return "bool"; + case UniValue::VOBJ: return "object"; + case UniValue::VARR: return "array"; + case UniValue::VSTR: return "string"; + case UniValue::VNUM: return "number"; + } + + // not reached + return NULL; +} + diff --git a/src/univalue/univalue.h b/src/univalue/univalue.h new file mode 100644 index 0000000000..5e94b6ba23 --- /dev/null +++ b/src/univalue/univalue.h @@ -0,0 +1,157 @@ +// Copyright 2014 BitPay Inc. +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef __UNIVALUE_H__ +#define __UNIVALUE_H__ + +#include +#include +#include +#include +#include + +class UniValue { +public: + enum VType { VNULL, VOBJ, VARR, VSTR, VNUM, VBOOL, }; + + UniValue() { typ = VNULL; } + UniValue(UniValue::VType initialType, const std::string& initialStr = "") { + typ = initialType; + val = initialStr; + } + UniValue(uint64_t val_) { + setInt(val_); + } + UniValue(int64_t val_) { + setInt(val_); + } + UniValue(int val_) { + setInt(val_); + } + UniValue(double val_) { + setFloat(val_); + } + UniValue(const std::string& val_) { + setStr(val_); + } + UniValue(const char *val_) { + std::string s(val_); + setStr(s); + } + ~UniValue() {} + + void clear(); + + bool setNull(); + bool setBool(bool val); + bool setNumStr(const std::string& val); + bool setInt(uint64_t val); + bool setInt(int64_t val); + bool setInt(int val) { return setInt((int64_t)val); } + bool setFloat(double val); + bool setStr(const std::string& val); + bool setArray(); + bool setObject(); + + enum VType getType() const { return typ; } + std::string getValStr() const { return val; } + bool empty() const { return (values.size() == 0); } + + size_t count() const { return values.size(); } + + bool getBool() const { return isTrue(); } + bool getArray(std::vector& arr); + bool getObject(std::map& obj); + bool checkObject(const std::map& memberTypes); + const UniValue& operator[](const std::string& key) const; + const UniValue& operator[](unsigned int index) const; + bool exists(const std::string& key) const { return (findKey(key) >= 0); } + + bool isNull() const { return (typ == VNULL); } + bool isTrue() const { return (typ == VBOOL) && (val == "1"); } + bool isFalse() const { return (!isTrue()); } + bool isBool() const { return (typ == VBOOL); } + bool isStr() const { return (typ == VSTR); } + bool isNum() const { return (typ == VNUM); } + bool isArray() const { return (typ == VARR); } + bool isObject() const { return (typ == VOBJ); } + + bool push_back(const UniValue& val); + bool push_back(const std::string& val_) { + UniValue tmpVal(VSTR, val_); + return push_back(tmpVal); + } + bool push_back(const char *val_) { + std::string s(val_); + return push_back(s); + } + bool push_backV(const std::vector& vec); + + bool pushKV(const std::string& key, const UniValue& val); + bool pushKV(const std::string& key, const std::string& val) { + UniValue tmpVal(VSTR, val); + return pushKV(key, tmpVal); + } + bool pushKV(const std::string& key, const char *val_) { + std::string val(val_); + return pushKV(key, val); + } + bool pushKV(const std::string& key, int64_t val) { + UniValue tmpVal(val); + return pushKV(key, tmpVal); + } + bool pushKV(const std::string& key, uint64_t val) { + UniValue tmpVal(val); + return pushKV(key, tmpVal); + } + bool pushKV(const std::string& key, int val) { + UniValue tmpVal((int64_t)val); + return pushKV(key, tmpVal); + } + bool pushKV(const std::string& key, double val) { + UniValue tmpVal(val); + return pushKV(key, tmpVal); + } + bool pushKVs(const UniValue& obj); + + std::string write(unsigned int prettyIndent = 0, + unsigned int indentLevel = 0) const; + + bool read(const char *raw); + bool read(const std::string& rawStr) { + return read(rawStr.c_str()); + } + +private: + UniValue::VType typ; + std::string val; // numbers are stored as C++ strings + std::vector keys; + std::vector values; + + int findKey(const std::string& key) const; + void writeArray(unsigned int prettyIndent, unsigned int indentLevel, std::string& s) const; + void writeObject(unsigned int prettyIndent, unsigned int indentLevel, std::string& s) const; +}; + +enum jtokentype { + JTOK_ERR = -1, + JTOK_NONE = 0, // eof + JTOK_OBJ_OPEN, + JTOK_OBJ_CLOSE, + JTOK_ARR_OPEN, + JTOK_ARR_CLOSE, + JTOK_COLON, + JTOK_COMMA, + JTOK_KW_NULL, + JTOK_KW_TRUE, + JTOK_KW_FALSE, + JTOK_NUMBER, + JTOK_STRING, +}; + +extern enum jtokentype getJsonToken(std::string& tokenVal, + unsigned int& consumed, const char *raw); +extern const char *uvTypeName(UniValue::VType t); + +#endif // __UNIVALUE_H__ diff --git a/src/univalue/univalue_read.cpp b/src/univalue/univalue_read.cpp new file mode 100644 index 0000000000..405be3e81f --- /dev/null +++ b/src/univalue/univalue_read.cpp @@ -0,0 +1,390 @@ +// Copyright 2014 BitPay Inc. +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include +#include +#include +#include "univalue.h" + +using namespace std; + +// convert hexadecimal string to unsigned integer +static const char *hatoui(const char *first, const char *last, + unsigned int& out) +{ + unsigned int result = 0; + for (; first != last; ++first) + { + int digit; + if (isdigit(*first)) + digit = *first - '0'; + + else if (*first >= 'a' && *first <= 'f') + digit = *first - 'a' + 10; + + else if (*first >= 'A' && *first <= 'F') + digit = *first - 'A' + 10; + + else + break; + + result = 16 * result + digit; + } + out = result; + + return first; +} + +enum jtokentype getJsonToken(string& tokenVal, unsigned int& consumed, + const char *raw) +{ + tokenVal.clear(); + consumed = 0; + + const char *rawStart = raw; + + while ((*raw) && (isspace(*raw))) // skip whitespace + raw++; + + switch (*raw) { + + case 0: + return JTOK_NONE; + + case '{': + raw++; + consumed = (raw - rawStart); + return JTOK_OBJ_OPEN; + case '}': + raw++; + consumed = (raw - rawStart); + return JTOK_OBJ_CLOSE; + case '[': + raw++; + consumed = (raw - rawStart); + return JTOK_ARR_OPEN; + case ']': + raw++; + consumed = (raw - rawStart); + return JTOK_ARR_CLOSE; + + case ':': + raw++; + consumed = (raw - rawStart); + return JTOK_COLON; + case ',': + raw++; + consumed = (raw - rawStart); + return JTOK_COMMA; + + case 'n': + case 't': + case 'f': + if (!strncmp(raw, "null", 4)) { + raw += 4; + consumed = (raw - rawStart); + return JTOK_KW_NULL; + } else if (!strncmp(raw, "true", 4)) { + raw += 4; + consumed = (raw - rawStart); + return JTOK_KW_TRUE; + } else if (!strncmp(raw, "false", 5)) { + raw += 5; + consumed = (raw - rawStart); + return JTOK_KW_FALSE; + } else + return JTOK_ERR; + + case '-': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': { + // part 1: int + string numStr; + + const char *first = raw; + + const char *firstDigit = first; + if (!isdigit(*firstDigit)) + firstDigit++; + if ((*firstDigit == '0') && isdigit(firstDigit[1])) + return JTOK_ERR; + + numStr += *raw; // copy first char + raw++; + + if ((*first == '-') && (!isdigit(*raw))) + return JTOK_ERR; + + while ((*raw) && isdigit(*raw)) { // copy digits + numStr += *raw; + raw++; + } + + // part 2: frac + if (*raw == '.') { + numStr += *raw; // copy . + raw++; + + if (!isdigit(*raw)) + return JTOK_ERR; + while ((*raw) && isdigit(*raw)) { // copy digits + numStr += *raw; + raw++; + } + } + + // part 3: exp + if (*raw == 'e' || *raw == 'E') { + numStr += *raw; // copy E + raw++; + + if (*raw == '-' || *raw == '+') { // copy +/- + numStr += *raw; + raw++; + } + + if (!isdigit(*raw)) + return JTOK_ERR; + while ((*raw) && isdigit(*raw)) { // copy digits + numStr += *raw; + raw++; + } + } + + tokenVal = numStr; + consumed = (raw - rawStart); + return JTOK_NUMBER; + } + + case '"': { + raw++; // skip " + + string valStr; + + while (*raw) { + if (*raw < 0x20) + return JTOK_ERR; + + else if (*raw == '\\') { + raw++; // skip backslash + + switch (*raw) { + case '"': valStr += "\""; break; + case '\\': valStr += "\\"; break; + case '/': valStr += "/"; break; + case 'b': valStr += "\b"; break; + case 'f': valStr += "\f"; break; + case 'n': valStr += "\n"; break; + case 'r': valStr += "\r"; break; + case 't': valStr += "\t"; break; + + case 'u': { + char buf[4] = {0,0,0,0}; + char *last = &buf[0]; + unsigned int codepoint; + if (hatoui(raw + 1, raw + 1 + 4, codepoint) != + raw + 1 + 4) + return JTOK_ERR; + + if (codepoint <= 0x7f) + *last = (char)codepoint; + else if (codepoint <= 0x7FF) { + *last++ = (char)(0xC0 | (codepoint >> 6)); + *last = (char)(0x80 | (codepoint & 0x3F)); + } else if (codepoint <= 0xFFFF) { + *last++ = (char)(0xE0 | (codepoint >> 12)); + *last++ = (char)(0x80 | ((codepoint >> 6) & 0x3F)); + *last = (char)(0x80 | (codepoint & 0x3F)); + } + + valStr += buf; + raw += 4; + break; + } + default: + return JTOK_ERR; + + } + + raw++; // skip esc'd char + } + + else if (*raw == '"') { + raw++; // skip " + break; // stop scanning + } + + else { + valStr += *raw; + raw++; + } + } + + tokenVal = valStr; + consumed = (raw - rawStart); + return JTOK_STRING; + } + + default: + return JTOK_ERR; + } +} + +bool UniValue::read(const char *raw) +{ + clear(); + + bool expectName = false; + bool expectColon = false; + vector stack; + + enum jtokentype tok = JTOK_NONE; + enum jtokentype last_tok = JTOK_NONE; + while (1) { + last_tok = tok; + + string tokenVal; + unsigned int consumed; + tok = getJsonToken(tokenVal, consumed, raw); + if (tok == JTOK_NONE || tok == JTOK_ERR) + break; + raw += consumed; + + switch (tok) { + + case JTOK_OBJ_OPEN: + case JTOK_ARR_OPEN: { + VType utyp = (tok == JTOK_OBJ_OPEN ? VOBJ : VARR); + if (!stack.size()) { + if (utyp == VOBJ) + setObject(); + else + setArray(); + stack.push_back(this); + } else { + UniValue tmpVal(utyp); + UniValue *top = stack.back(); + top->values.push_back(tmpVal); + + UniValue *newTop = &(top->values.back()); + stack.push_back(newTop); + } + + if (utyp == VOBJ) + expectName = true; + break; + } + + case JTOK_OBJ_CLOSE: + case JTOK_ARR_CLOSE: { + if (!stack.size() || expectColon || (last_tok == JTOK_COMMA)) + return false; + + VType utyp = (tok == JTOK_OBJ_CLOSE ? VOBJ : VARR); + UniValue *top = stack.back(); + if (utyp != top->getType()) + return false; + + stack.pop_back(); + expectName = false; + break; + } + + case JTOK_COLON: { + if (!stack.size() || expectName || !expectColon) + return false; + + UniValue *top = stack.back(); + if (top->getType() != VOBJ) + return false; + + expectColon = false; + break; + } + + case JTOK_COMMA: { + if (!stack.size() || expectName || expectColon || + (last_tok == JTOK_COMMA) || (last_tok == JTOK_ARR_OPEN)) + return false; + + UniValue *top = stack.back(); + if (top->getType() == VOBJ) + expectName = true; + break; + } + + case JTOK_KW_NULL: + case JTOK_KW_TRUE: + case JTOK_KW_FALSE: { + if (!stack.size() || expectName || expectColon) + return false; + + UniValue tmpVal; + switch (tok) { + case JTOK_KW_NULL: + // do nothing more + break; + case JTOK_KW_TRUE: + tmpVal.setBool(true); + break; + case JTOK_KW_FALSE: + tmpVal.setBool(false); + break; + default: /* impossible */ break; + } + + UniValue *top = stack.back(); + top->values.push_back(tmpVal); + + break; + } + + case JTOK_NUMBER: { + if (!stack.size() || expectName || expectColon) + return false; + + UniValue tmpVal(VNUM, tokenVal); + UniValue *top = stack.back(); + top->values.push_back(tmpVal); + + break; + } + + case JTOK_STRING: { + if (!stack.size()) + return false; + + UniValue *top = stack.back(); + + if (expectName) { + top->keys.push_back(tokenVal); + expectName = false; + expectColon = true; + } else { + UniValue tmpVal(VSTR, tokenVal); + top->values.push_back(tmpVal); + } + + break; + } + + default: + return false; + } + } + + if (stack.size() != 0) + return false; + + return true; +} + diff --git a/src/univalue/univalue_write.cpp b/src/univalue/univalue_write.cpp new file mode 100644 index 0000000000..1818f5c6f9 --- /dev/null +++ b/src/univalue/univalue_write.cpp @@ -0,0 +1,145 @@ +// Copyright 2014 BitPay Inc. +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include +#include +#include "univalue.h" + +// TODO: Using UTF8 + +using namespace std; + +static bool initEscapes; +static const char *escapes[256]; + +static void initJsonEscape() +{ + escapes['"'] = "\\\""; + escapes['\\'] = "\\\\"; + escapes['/'] = "\\/"; + escapes['\b'] = "\\b"; + escapes['\f'] = "\\f"; + escapes['\n'] = "\\n"; + escapes['\r'] = "\\r"; + escapes['\t'] = "\\t"; + + initEscapes = true; +} + +static string json_escape(const string& inS) +{ + if (!initEscapes) + initJsonEscape(); + + string outS; + outS.reserve(inS.size() * 2); + + for (unsigned int i = 0; i < inS.size(); i++) { + unsigned char ch = inS[i]; + const char *escStr = escapes[ch]; + + if (escStr) + outS += escStr; + + else if (isprint(ch)) + outS += ch; + + else { + char tmpesc[16]; + sprintf(tmpesc, "\\u%04x", ch); + outS += tmpesc; + } + } + + return outS; +} + +string UniValue::write(unsigned int prettyIndent, + unsigned int indentLevel) const +{ + string s; + s.reserve(1024); + + unsigned int modIndent = indentLevel; + if (modIndent == 0) + modIndent = 1; + + switch (typ) { + case VNULL: + s += "null"; + break; + case VOBJ: + writeObject(prettyIndent, modIndent, s); + break; + case VARR: + writeArray(prettyIndent, modIndent, s); + break; + case VSTR: + s += "\"" + json_escape(val) + "\""; + break; + case VNUM: + s += val; + break; + case VBOOL: + s += (val == "1" ? "true" : "false"); + break; + } + + return s; +} + +static string spaceStr; + +static string indentStr(unsigned int prettyIndent, unsigned int indentLevel) +{ + unsigned int spaces = prettyIndent * indentLevel; + while (spaceStr.size() < spaces) + spaceStr += " "; + + return spaceStr.substr(0, spaces); +} + +void UniValue::writeArray(unsigned int prettyIndent, unsigned int indentLevel, string& s) const +{ + s += "["; + if (prettyIndent) + s += "\n"; + + for (unsigned int i = 0; i < values.size(); i++) { + if (prettyIndent) + s += indentStr(prettyIndent, indentLevel); + s += values[i].write(prettyIndent, indentLevel + 1); + if (i != (values.size() - 1)) + s += ", "; + if (prettyIndent) + s += "\n"; + } + + if (prettyIndent) + s += indentStr(prettyIndent, indentLevel - 1); + s += "]"; +} + +void UniValue::writeObject(unsigned int prettyIndent, unsigned int indentLevel, string& s) const +{ + s += "{"; + if (prettyIndent) + s += "\n"; + + for (unsigned int i = 0; i < keys.size(); i++) { + if (prettyIndent) + s += indentStr(prettyIndent, indentLevel); + s += "\"" + json_escape(keys[i]) + "\": "; + s += values[i].write(prettyIndent, indentLevel + 1); + if (i != (values.size() - 1)) + s += ","; + if (prettyIndent) + s += "\n"; + } + + if (prettyIndent) + s += indentStr(prettyIndent, indentLevel - 1); + s += "}"; +} + From 6fd59ee897e9dc9b021440cbb738186dbf3a3e98 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 29 Jul 2014 11:24:26 -0400 Subject: [PATCH 0445/1288] script.h: set_vch() should shift a >32 bit value Source: http://www.viva64.com/en/b/0268/ --- src/script.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script.h b/src/script.h index e36be2db9e..c74ae37598 100644 --- a/src/script.h +++ b/src/script.h @@ -166,7 +166,7 @@ private: // If the input vector's most significant byte is 0x80, remove it from // the result's msb and return a negative. if (vch.back() & 0x80) - return -(result & ~(0x80 << (8 * (vch.size() - 1)))); + return -(result & ~(0x80ULL << (8 * (vch.size() - 1)))); return result; } From 6b5ee2e09263ab54c7111fc782fcb667a3eb86b3 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 29 Jul 2014 12:41:33 -0400 Subject: [PATCH 0446/1288] Update openssl.org URL to include https:// Suggested by whitj00. Fixes #4595 --- doc/README.md | 2 +- doc/README_windows.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/README.md b/doc/README.md index f5aeb34a3c..924f5a8a69 100644 --- a/doc/README.md +++ b/doc/README.md @@ -72,5 +72,5 @@ The Bitcoin repo's [root README](https://github.com/bitcoin/bitcoin/blob/master/ License --------------------- Distributed under the [MIT/X11 software license](http://www.opensource.org/licenses/mit-license.php). -This product includes software developed by the OpenSSL Project for use in the [OpenSSL Toolkit](http://www.openssl.org/). This product includes +This product includes software developed by the OpenSSL Project for use in the [OpenSSL Toolkit](https://www.openssl.org/). This product includes cryptographic software written by Eric Young ([eay@cryptsoft.com](mailto:eay@cryptsoft.com)), and UPnP software written by Thomas Bernard. diff --git a/doc/README_windows.txt b/doc/README_windows.txt index 18fd4216f9..368f2b45e1 100644 --- a/doc/README_windows.txt +++ b/doc/README_windows.txt @@ -5,7 +5,7 @@ Copyright (c) 2009-2014 Bitcoin Core Developers Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in -the OpenSSL Toolkit (http://www.openssl.org/). This product includes +the OpenSSL Toolkit (https://www.openssl.org/). This product includes cryptographic software written by Eric Young (eay@cryptsoft.com). From 0c3e1019665edb6c456f9640307231863db2835f Mon Sep 17 00:00:00 2001 From: Aitor Pazos Date: Wed, 23 Jul 2014 20:10:01 +0200 Subject: [PATCH 0447/1288] Added systemd .service file in order to help distributions integrate bitcoind. --- contrib/systemd/bitcoind.service | 17 ++++++++++++ doc/README.md | 1 + doc/systemd.md | 47 ++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 contrib/systemd/bitcoind.service create mode 100644 doc/systemd.md diff --git a/contrib/systemd/bitcoind.service b/contrib/systemd/bitcoind.service new file mode 100644 index 0000000000..edc81cc763 --- /dev/null +++ b/contrib/systemd/bitcoind.service @@ -0,0 +1,17 @@ +[Unit] +Description=Bitcoin's distributed currency daemon +After=network.target + +[Service] +User=bitcoind +Group=bitcoind + +Type=forking +PIDFile=/var/lib/bitcoind/bitcoind.pid +ExecStart=/usr/bin/bitcoind -daemon -pid=/var/lib/bitcoind/bitcoind.pid -conf=/etc/bitcoind.conf -datadir=/var/lib/bitcoind + +Restart=always +PrivateTmp=true + +[Install] +WantedBy=multi-user.target diff --git a/doc/README.md b/doc/README.md index f5aeb34a3c..9c724ec1e9 100644 --- a/doc/README.md +++ b/doc/README.md @@ -68,6 +68,7 @@ The Bitcoin repo's [root README](https://github.com/bitcoin/bitcoin/blob/master/ - [Assets Attribution](assets-attribution.md) - [Files](files.md) - [Tor Support](tor.md) +- [Systemd](systemd.md) License --------------------- diff --git a/doc/systemd.md b/doc/systemd.md new file mode 100644 index 0000000000..96202c1532 --- /dev/null +++ b/doc/systemd.md @@ -0,0 +1,47 @@ +SYSTEMD SUPPORT IN BITCOIN +========================== + +Packagers can find a .service file in this repo in order to integrate bitcoin's +daemon into systemd based distributions. + +bitcoind.service file is located in contrib/systemd/ folder. + +1. Users +--------------------------------- + +This .service file assumes bitcoind user and group exist in the system, so packager +should make sure they are created on installation. + +2. Files +--------------------------------- + +The .service file assumes several paths that might need to be adjusted according +to packager's needs. + +Daemon's config file is assumed to be located at /etc/bitcoind.conf (you can +use contrib/debian/examples/bitcoin.conf as an example). Once installed, users +must edit the file in order to update at least these two +values: rpcuser and rpcpassword . Failing to do so will make the daemon fail +to boot. However, the message written to /var/lib/bitcoind/debug.log file is +very helpful and no default values should be set: + + YYYY-MM-DD HH:MM:DD Error: To use the "-server" option, you must set a rpcpassword in the configuration file: + /etc/bitcoind.conf + It is recommended you use the following random password: + rpcuser=bitcoinrpc + rpcpassword=HdYZ5HGtAF7mx8aTw6uCATtD2maMAK4E12Ysp4YNZQcX + (you do not need to remember this password) + The username and password MUST NOT be the same. + If the file does not exist, create it with owner-readable-only file permissions. + It is also recommended to set alertnotify so you are notified of problems; + for example: alertnotify=echo %s | mail -s "Bitcoin Alert" admin@foo.com + +Daemon's data and pid files will be stored in /var/lib/bitcoind directory, so it +should be created on installation and make bitcoind user/group it's owner. + +3. Installing .service file +--------------------------------- + +Installing this .service file consists on just copying it to /usr/lib/systemd/system +directory, followed by the command "systemctl daemon-reload" in order to update +running systemd configuration. From e59441f0863d20c6f205c4854a37507267183863 Mon Sep 17 00:00:00 2001 From: Alex Morcos Date: Tue, 29 Jul 2014 00:09:57 -0400 Subject: [PATCH 0448/1288] Process fee estimate file into temporary vector first to let sanity checking complete. --- src/txmempool.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/txmempool.cpp b/src/txmempool.cpp index a06de7a947..29924fff09 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -206,7 +206,7 @@ public: } if ((delta-1) >= (int)history.size()) delta = history.size(); // Last bucket is catch-all - entriesByConfirmations[delta-1].push_back(&entry); + entriesByConfirmations.at(delta-1).push_back(&entry); } for (size_t i = 0; i < entriesByConfirmations.size(); i++) { @@ -319,16 +319,27 @@ public: void Read(CAutoFile& filein, const CFeeRate& minRelayFee) { - filein >> nBestSeenHeight; + int nFileBestSeenHeight; + filein >> nFileBestSeenHeight; size_t numEntries; filein >> numEntries; - history.clear(); + if (numEntries <= 0 || numEntries > 10000) + throw runtime_error("Corrupt estimates file. Must have between 1 and 10k entires."); + + std::vector fileHistory; + for (size_t i = 0; i < numEntries; i++) { CBlockAverage entry; entry.Read(filein, minRelayFee); - history.push_back(entry); + fileHistory.push_back(entry); } + + //Now that we've processed the entire fee estimate data file and not + //thrown any errors, we can copy it to our history + nBestSeenHeight = nFileBestSeenHeight; + history = fileHistory; + assert(history.size() > 0); } }; From f0c2915f66ade456c9d7847ea64fef09e1a12975 Mon Sep 17 00:00:00 2001 From: jtimon Date: Mon, 7 Jul 2014 07:40:40 +0200 Subject: [PATCH 0449/1288] Simplify and rename CheckWork to ProcessBlockFound --- src/miner.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index ec56c71192..9408d2c5aa 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -402,17 +402,8 @@ CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey) return CreateNewBlock(scriptPubKey); } -bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey) +bool ProcessBlockFound(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey) { - uint256 hash = pblock->GetHash(); - uint256 hashTarget = uint256().SetCompact(pblock->nBits); - - if (hash > hashTarget) - return false; - - //// debug print - LogPrintf("BitcoinMiner:\n"); - LogPrintf("proof-of-work found \n hash: %s \ntarget: %s\n", hash.GetHex(), hashTarget.GetHex()); pblock->print(); LogPrintf("generated %s\n", FormatMoney(pblock->vtx[0].vout[0].nValue)); @@ -500,7 +491,9 @@ void static BitcoinMiner(CWallet *pwallet) assert(hash == pblock->GetHash()); SetThreadPriority(THREAD_PRIORITY_NORMAL); - CheckWork(pblock, *pwallet, reservekey); + LogPrintf("BitcoinMiner:\n"); + LogPrintf("proof-of-work found \n hash: %s \ntarget: %s\n", hash.GetHex(), hashTarget.GetHex()); + ProcessBlockFound(pblock, *pwallet, reservekey); SetThreadPriority(THREAD_PRIORITY_LOWEST); // In regression test mode, stop mining after a block is found. From 60dc8e4208058814494b301c355a5996af9517a9 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 30 Jul 2014 15:27:03 +0200 Subject: [PATCH 0450/1288] Allow -onlynet=onion to be used Just an alias for onlynet=tor, but matches the new name of the proxy option -onion= better. --- src/init.cpp | 2 +- src/netbase.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index b84c233b99..a908169cd9 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -248,7 +248,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -maxreceivebuffer= " + _("Maximum per-connection receive buffer, *1000 bytes (default: 5000)") + "\n"; strUsage += " -maxsendbuffer= " + _("Maximum per-connection send buffer, *1000 bytes (default: 1000)") + "\n"; strUsage += " -onion= " + _("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy)") + "\n"; - strUsage += " -onlynet= " + _("Only connect to nodes in network (IPv4, IPv6 or Tor)") + "\n"; + strUsage += " -onlynet= " + _("Only connect to nodes in network (IPv4, IPv6 or Onion)") + "\n"; strUsage += " -permitbaremultisig " + _("Relay non-P2SH multisig (default: 1)") + "\n"; strUsage += " -port= " + _("Listen for connections on (default: 8333 or testnet: 18333)") + "\n"; strUsage += " -proxy= " + _("Connect through SOCKS5 proxy") + "\n"; diff --git a/src/netbase.cpp b/src/netbase.cpp index af6d11f0e2..f9f4755f7b 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -47,7 +47,7 @@ enum Network ParseNetwork(std::string net) { boost::to_lower(net); if (net == "ipv4") return NET_IPV4; if (net == "ipv6") return NET_IPV6; - if (net == "tor") return NET_TOR; + if (net == "tor" || net == "onion") return NET_TOR; return NET_UNROUTABLE; } From c91a9471be7a96311a7e1452a3624aa557bc185d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 30 Jul 2014 15:31:36 +0200 Subject: [PATCH 0451/1288] Add IsReachable(net) function Allows other parts of the program to query for reachable status of a network. Similar to IsLimited(net). --- src/net.cpp | 10 ++++++++-- src/net.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 62124514c8..27f71e45dc 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -307,12 +307,18 @@ bool IsLocal(const CService& addr) return mapLocalHost.count(addr) > 0; } +/** check whether a given network is one we can probably connect to */ +bool IsReachable(enum Network net) +{ + LOCK(cs_mapLocalHost); + return vfReachable[net] && !vfLimited[net]; +} + /** check whether a given address is in a network we can probably connect to */ bool IsReachable(const CNetAddr& addr) { - LOCK(cs_mapLocalHost); enum Network net = addr.GetNetwork(); - return vfReachable[net] && !vfLimited[net]; + return IsReachable(net); } bool GetMyExternalIP2(const CService& addrConnect, const char* pszGet, const char* pszKeyword, CNetAddr& ipRet) diff --git a/src/net.h b/src/net.h index 2d9325abf9..8656766e26 100644 --- a/src/net.h +++ b/src/net.h @@ -106,6 +106,7 @@ bool AddLocal(const CNetAddr& addr, int nScore = LOCAL_NONE); bool SeenLocal(const CService& addr); bool IsLocal(const CService& addr); bool GetLocal(CService &addr, const CNetAddr *paddrPeer = NULL); +bool IsReachable(enum Network net); bool IsReachable(const CNetAddr &addr); void SetReachable(enum Network net, bool fFlag = true); CAddress GetLocalAddress(const CNetAddr *paddrPeer = NULL); From 075cf49e593025030c8b3572e606960f15de424e Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 30 Jul 2014 15:32:36 +0200 Subject: [PATCH 0452/1288] Add GetNetworkName function Returns the network name for an Network enum. --- src/netbase.cpp | 10 ++++++++++ src/netbase.h | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/netbase.cpp b/src/netbase.cpp index f9f4755f7b..4e109a8bc9 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -51,6 +51,16 @@ enum Network ParseNetwork(std::string net) { return NET_UNROUTABLE; } +std::string GetNetworkName(enum Network net) { + switch(net) + { + case NET_IPV4: return "ipv4"; + case NET_IPV6: return "ipv6"; + case NET_TOR: return "onion"; + default: return ""; + } +} + void SplitHostPort(std::string in, int &portOut, std::string &hostOut) { size_t colon = in.find_last_of(':'); // if a : is found, and it either follows a [...], or no other : is in the string, treat it as port separator diff --git a/src/netbase.h b/src/netbase.h index 7d83e35344..bd8dbf9695 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -26,7 +26,7 @@ extern bool fNameLookup; enum Network { - NET_UNROUTABLE, + NET_UNROUTABLE = 0, NET_IPV4, NET_IPV6, NET_TOR, @@ -164,6 +164,7 @@ class CService : public CNetAddr typedef CService proxyType; enum Network ParseNetwork(std::string net); +std::string GetNetworkName(enum Network net); void SplitHostPort(std::string in, int &portOut, std::string &hostOut); bool SetProxy(enum Network net, CService addrProxy); bool GetProxy(enum Network net, proxyType &proxyInfoOut); From bd0aa105198d3cc12751dc4645877af70cac6258 Mon Sep 17 00:00:00 2001 From: Doug Date: Wed, 30 Jul 2014 16:04:40 -0400 Subject: [PATCH 0453/1288] Replace the temporary file hack currently used to change Bitcoin-Qt's dock icon (OS X) with a buffer-based solution. --- src/qt/macdockiconhandler.mm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/qt/macdockiconhandler.mm b/src/qt/macdockiconhandler.mm index 74fb64ace3..a2ff148d9d 100644 --- a/src/qt/macdockiconhandler.mm +++ b/src/qt/macdockiconhandler.mm @@ -6,7 +6,7 @@ #include #include -#include +#include #include #undef slots @@ -95,14 +95,14 @@ void MacDockIconHandler::setIcon(const QIcon &icon) QSize size = icon.actualSize(QSize(128, 128)); QPixmap pixmap = icon.pixmap(size); - // write temp file hack (could also be done through QIODevice [memory]) - QTemporaryFile notificationIconFile; - if (!pixmap.isNull() && notificationIconFile.open()) { - QImageWriter writer(¬ificationIconFile, "PNG"); + // Write image into a R/W buffer from raw pixmap, then save the image. + QBuffer notificationBuffer; + if (!pixmap.isNull() && notificationBuffer.open(QIODevice::ReadWrite)) { + QImageWriter writer(¬ificationBuffer, "PNG"); if (writer.write(pixmap.toImage())) { - const char *cString = notificationIconFile.fileName().toUtf8().data(); - NSString *macString = [NSString stringWithCString:cString encoding:NSUTF8StringEncoding]; - image = [[NSImage alloc] initWithContentsOfFile:macString]; + NSData* macImgData = [NSData dataWithBytes:notificationBuffer.buffer().data() + length:notificationBuffer.buffer().size()]; + image = [[NSImage alloc] initWithData:macImgData]; } } From c7614f16d6d123ef182180a96fe43449e73db0b0 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 30 Jul 2014 23:25:30 -0400 Subject: [PATCH 0454/1288] univalue: remove unused methods getArray, getObject --- src/univalue/univalue.cpp | 22 ---------------------- src/univalue/univalue.h | 2 -- 2 files changed, 24 deletions(-) diff --git a/src/univalue/univalue.cpp b/src/univalue/univalue.cpp index e577aa8ee4..afc208bffb 100644 --- a/src/univalue/univalue.cpp +++ b/src/univalue/univalue.cpp @@ -147,28 +147,6 @@ bool UniValue::pushKVs(const UniValue& obj) return true; } -bool UniValue::getArray(std::vector& arr) -{ - if (typ != VARR) - return false; - - arr = values; - return true; -} - -bool UniValue::getObject(std::map& obj) -{ - if (typ != VOBJ) - return false; - - obj.clear(); - for (unsigned int i = 0; i < keys.size(); i++) { - obj[keys[i]] = values[i]; - } - - return true; -} - int UniValue::findKey(const std::string& key) const { for (unsigned int i = 0; i < keys.size(); i++) { diff --git a/src/univalue/univalue.h b/src/univalue/univalue.h index 5e94b6ba23..0a7bf3cceb 100644 --- a/src/univalue/univalue.h +++ b/src/univalue/univalue.h @@ -61,8 +61,6 @@ public: size_t count() const { return values.size(); } bool getBool() const { return isTrue(); } - bool getArray(std::vector& arr); - bool getObject(std::map& obj); bool checkObject(const std::map& memberTypes); const UniValue& operator[](const std::string& key) const; const UniValue& operator[](unsigned int index) const; From bdba2dd000f030b1dce3d2bc6caef84929438679 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 31 Jul 2014 09:05:13 +0200 Subject: [PATCH 0455/1288] qt: Remove an obscure option no-one cares about Remove the "Display addresses" setting checkbox. It doesn't do what the tooltip says, and seems kind of pointless in any case. Fixes #4580. --- src/qt/forms/optionsdialog.ui | 10 ---------- src/qt/optionsdialog.cpp | 1 - src/qt/optionsmodel.cpp | 10 ---------- src/qt/optionsmodel.h | 3 --- src/qt/transactiontablemodel.cpp | 2 +- 5 files changed, 1 insertion(+), 25 deletions(-) diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 1f535a4a62..47ed4c8bc6 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -451,16 +451,6 @@ - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - &Display addresses in transaction list - - - diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 0117d2e633..fd1d446f9b 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -185,7 +185,6 @@ void OptionsDialog::setMapper() /* Display */ mapper->addMapping(ui->lang, OptionsModel::Language); mapper->addMapping(ui->unit, OptionsModel::DisplayUnit); - mapper->addMapping(ui->displayAddresses, OptionsModel::DisplayAddresses); mapper->addMapping(ui->thirdPartyTxUrls, OptionsModel::ThirdPartyTxUrls); } diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index f07e66bf04..99928ebe4d 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -59,10 +59,6 @@ void OptionsModel::Init() settings.setValue("nDisplayUnit", BitcoinUnits::BTC); nDisplayUnit = settings.value("nDisplayUnit").toInt(); - if (!settings.contains("bDisplayAddresses")) - settings.setValue("bDisplayAddresses", false); - bDisplayAddresses = settings.value("bDisplayAddresses", false).toBool(); - if (!settings.contains("strThirdPartyTxUrls")) settings.setValue("strThirdPartyTxUrls", ""); strThirdPartyTxUrls = settings.value("strThirdPartyTxUrls", "").toString(); @@ -200,8 +196,6 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const #endif case DisplayUnit: return nDisplayUnit; - case DisplayAddresses: - return bDisplayAddresses; case ThirdPartyTxUrls: return strThirdPartyTxUrls; case Language: @@ -296,10 +290,6 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in case DisplayUnit: setDisplayUnit(value); break; - case DisplayAddresses: - bDisplayAddresses = value.toBool(); - settings.setValue("bDisplayAddresses", bDisplayAddresses); - break; case ThirdPartyTxUrls: if (strThirdPartyTxUrls != value.toString()) { strThirdPartyTxUrls = value.toString(); diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 9699f6eea6..80adab89c8 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -34,7 +34,6 @@ public: ProxyPort, // int Fee, // qint64 DisplayUnit, // BitcoinUnits::Unit - DisplayAddresses, // bool ThirdPartyTxUrls, // QString Language, // QString CoinControlFeatures, // bool @@ -58,7 +57,6 @@ public: bool getMinimizeToTray() { return fMinimizeToTray; } bool getMinimizeOnClose() { return fMinimizeOnClose; } int getDisplayUnit() { return nDisplayUnit; } - bool getDisplayAddresses() { return bDisplayAddresses; } QString getThirdPartyTxUrls() { return strThirdPartyTxUrls; } bool getProxySettings(QNetworkProxy& proxy) const; bool getCoinControlFeatures() { return fCoinControlFeatures; } @@ -74,7 +72,6 @@ private: bool fMinimizeOnClose; QString language; int nDisplayUnit; - bool bDisplayAddresses; QString strThirdPartyTxUrls; bool fCoinControlFeatures; /* settings that were overriden by command-line */ diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 7acb0e8871..1647bc776f 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -346,7 +346,7 @@ QString TransactionTableModel::lookupAddress(const std::string &address, bool to { description += label + QString(" "); } - if(label.isEmpty() || walletModel->getOptionsModel()->getDisplayAddresses() || tooltip) + if(label.isEmpty() || tooltip) { description += QString("(") + QString::fromStdString(address) + QString(")"); } From 84c5f77deb243a73c1c3d1b9950277e6ec99ec14 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 31 Jul 2014 15:01:56 +0200 Subject: [PATCH 0456/1288] English translation update This is needed to add version 0.10.x on Transifex so that translation can start. --- src/qt/bitcoinstrings.cpp | 32 +- src/qt/locale/bitcoin_en.ts | 1270 ++++++++++++++++++++--------------- 2 files changed, 757 insertions(+), 545 deletions(-) diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index e852c468a8..9ac7f24867 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -38,6 +38,9 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Bind to given address and always listen on it. Use [host]:port notation for " "IPv6"), QT_TRANSLATE_NOOP("bitcoin-core", "" +"Bind to given address and whitelist peers connecting to it. Use [host]:port " +"notation for IPv6"), +QT_TRANSLATE_NOOP("bitcoin-core", "" "Bind to given address to listen for JSON-RPC connections. Use [host]:port " "notation for IPv6. This option can be specified multiple times (default: " "bind to all interfaces)"), @@ -48,6 +51,9 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Continuously rate-limit free transactions to *1000 bytes per minute " "(default:15)"), QT_TRANSLATE_NOOP("bitcoin-core", "" +"Create new files with system default permissions, instead of umask 077 (only " +"effective with disabled wallet functionality)"), +QT_TRANSLATE_NOOP("bitcoin-core", "" "Delete all wallet transactions and only recover those part of the blockchain " "through -rescan on startup"), QT_TRANSLATE_NOOP("bitcoin-core", "" @@ -66,6 +72,9 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Error: This transaction requires a transaction fee of at least %s because of " "its amount, complexity, or use of recently received funds!"), QT_TRANSLATE_NOOP("bitcoin-core", "" +"Error: Unsupported argument -socks found. Setting SOCKS version isn't " +"possible anymore, only SOCKS5 proxies are supported."), +QT_TRANSLATE_NOOP("bitcoin-core", "" "Execute command when a network tx respends wallet tx input (%s=respend TxID, " "%t=wallet TxID)"), QT_TRANSLATE_NOOP("bitcoin-core", "" @@ -102,6 +111,9 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" QT_TRANSLATE_NOOP("bitcoin-core", "" "Output debugging information (default: 0, supplying is optional)"), QT_TRANSLATE_NOOP("bitcoin-core", "" +"Query for peer addresses via DNS lookup, if low on addresses (default: 1 " +"unless -connect)"), +QT_TRANSLATE_NOOP("bitcoin-core", "" "Set maximum size of high-priority/low-fee transactions in bytes (default: %d)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Set the number of script verification threads (%u to %d, 0 = auto, <0 = " @@ -141,6 +153,12 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as " "wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect " "you should restore from a backup."), +QT_TRANSLATE_NOOP("bitcoin-core", "" +"Whitelist peers connecting from the given netmask or ip. Can be specified " +"multiple times."), +QT_TRANSLATE_NOOP("bitcoin-core", "" +"Whitelisted peers cannot be DoS banned and their transactions are always " +"relayed, even if they are already in the mempool, useful e.g. for a gateway"), QT_TRANSLATE_NOOP("bitcoin-core", "(default: 1)"), QT_TRANSLATE_NOOP("bitcoin-core", "(default: wallet.dat)"), QT_TRANSLATE_NOOP("bitcoin-core", " can be:"), @@ -148,14 +166,16 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Accept command line and JSON-RPC commands"), QT_TRANSLATE_NOOP("bitcoin-core", "Accept connections from outside (default: 1 if no -proxy or -connect)"), QT_TRANSLATE_NOOP("bitcoin-core", "Add a node to connect to and attempt to keep the connection open"), QT_TRANSLATE_NOOP("bitcoin-core", "Allow DNS lookups for -addnode, -seednode and -connect"), +QT_TRANSLATE_NOOP("bitcoin-core", "Always query for peer addresses via DNS lookup (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "Attempt to recover private keys from a corrupt wallet.dat"), QT_TRANSLATE_NOOP("bitcoin-core", "Block creation options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot downgrade wallet"), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -bind address: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -externalip address: '%s'"), +QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -whitebind address: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot write default address"), QT_TRANSLATE_NOOP("bitcoin-core", "Connect only to the specified node(s)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Connect through SOCKS proxy"), +QT_TRANSLATE_NOOP("bitcoin-core", "Connect through SOCKS5 proxy"), QT_TRANSLATE_NOOP("bitcoin-core", "Connect to a node to retrieve peer addresses, and disconnect"), QT_TRANSLATE_NOOP("bitcoin-core", "Connection options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Copyright (C) 2009-%i The Bitcoin Core Developers"), @@ -191,7 +211,6 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write to coin database"), QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write transaction index"), QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write undo data"), QT_TRANSLATE_NOOP("bitcoin-core", "Fee (in BTC/kB) to add to transactions you send (default: %s)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Find peers using DNS lookup (default: 1 unless -connect)"), QT_TRANSLATE_NOOP("bitcoin-core", "Force safe mode (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "Generate coins (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "How many blocks to check at startup (default: 288, 0 = all)"), @@ -210,6 +229,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -mintxfee=: '%s'") QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -paytxfee=: '%s' (must be at least %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -paytxfee=: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount"), +QT_TRANSLATE_NOOP("bitcoin-core", "Invalid netmask specified in -whitelist: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Keep at most unconnectable blocks in memory (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Limit size of signature cache to entries (default: 50000)"), QT_TRANSLATE_NOOP("bitcoin-core", "Listen for connections on (default: 8333 or testnet: 18333)"), @@ -221,6 +241,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Maintain a full transaction index (default: 0 QT_TRANSLATE_NOOP("bitcoin-core", "Maintain at most connections to peers (default: 125)"), QT_TRANSLATE_NOOP("bitcoin-core", "Maximum per-connection receive buffer, *1000 bytes (default: 5000)"), QT_TRANSLATE_NOOP("bitcoin-core", "Maximum per-connection send buffer, *1000 bytes (default: 1000)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Need to specify a port with -whitebind: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Node relay options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Not enough file descriptors available."), QT_TRANSLATE_NOOP("bitcoin-core", "Only accept block chain matching built-in checkpoints (default: 1)"), @@ -236,11 +257,11 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Randomly drop 1 of every network messages QT_TRANSLATE_NOOP("bitcoin-core", "Randomly fuzz 1 of every network messages"), QT_TRANSLATE_NOOP("bitcoin-core", "Rebuild block chain index from current blk000??.dat files"), QT_TRANSLATE_NOOP("bitcoin-core", "Relay and mine data carrier transactions (default: 1)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Relay non-P2SH multisig (default: 1)"), QT_TRANSLATE_NOOP("bitcoin-core", "Rescan the block chain for missing wallet transactions"), QT_TRANSLATE_NOOP("bitcoin-core", "Rescanning..."), QT_TRANSLATE_NOOP("bitcoin-core", "Run a thread to flush wallet periodically (default: 1)"), QT_TRANSLATE_NOOP("bitcoin-core", "Run in the background as a daemon and accept commands"), -QT_TRANSLATE_NOOP("bitcoin-core", "Select SOCKS version for -proxy (4 or 5, default: 5)"), QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to console instead of debug.log file"), QT_TRANSLATE_NOOP("bitcoin-core", "Server certificate file (default: server.cert)"), QT_TRANSLATE_NOOP("bitcoin-core", "Server private key (default: server.pem)"), @@ -251,7 +272,6 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Set minimum block size in bytes (default: 0)" QT_TRANSLATE_NOOP("bitcoin-core", "Set the number of threads to service RPC calls (default: 4)"), QT_TRANSLATE_NOOP("bitcoin-core", "Sets the DB_PRIVATE flag in the wallet db environment (default: 1)"), QT_TRANSLATE_NOOP("bitcoin-core", "Show all debugging options (usage: --help -help-debug)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Show benchmark information (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "Shrink debug.log file on client startup (default: 1 when no -debug)"), QT_TRANSLATE_NOOP("bitcoin-core", "Signing transaction failed"), QT_TRANSLATE_NOOP("bitcoin-core", "Specify configuration file (default: bitcoin.conf)"), @@ -272,7 +292,6 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Transaction amount too small"), QT_TRANSLATE_NOOP("bitcoin-core", "Transaction amounts must be positive"), QT_TRANSLATE_NOOP("bitcoin-core", "Transaction too large"), QT_TRANSLATE_NOOP("bitcoin-core", "Unable to bind to %s on this computer (bind returned error %s)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Unknown -socks proxy version requested: %i"), QT_TRANSLATE_NOOP("bitcoin-core", "Unknown network specified in -onlynet: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Upgrade wallet to latest format"), QT_TRANSLATE_NOOP("bitcoin-core", "Use OpenSSL (https) for JSON-RPC connections"), @@ -286,8 +305,9 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Wallet %s resides outside data directory %s") QT_TRANSLATE_NOOP("bitcoin-core", "Wallet needed to be rewritten: restart Bitcoin to complete"), QT_TRANSLATE_NOOP("bitcoin-core", "Wallet options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Warning"), -QT_TRANSLATE_NOOP("bitcoin-core", "Warning: Deprecated argument -debugnet ignored, use -debug=net"), QT_TRANSLATE_NOOP("bitcoin-core", "Warning: This version is obsolete, upgrade required!"), +QT_TRANSLATE_NOOP("bitcoin-core", "Warning: Unsupported argument -benchmark ignored, use -debug=bench."), +QT_TRANSLATE_NOOP("bitcoin-core", "Warning: Unsupported argument -debugnet ignored, use -debug=net."), QT_TRANSLATE_NOOP("bitcoin-core", "You need to rebuild the database using -reindex to change -txindex"), QT_TRANSLATE_NOOP("bitcoin-core", "Zapping all transactions from wallet..."), QT_TRANSLATE_NOOP("bitcoin-core", "on startup"), diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index 4b541eabe9..6739ef0021 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -1,50 +1,6 @@ - - AboutDialog - - - About Bitcoin Core - - - - - <b>Bitcoin Core</b> version - - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - Copyright - - - - The Bitcoin Core developers - - - - - - (%1-bit) - - - AddressBookPage @@ -164,7 +120,7 @@ This product includes software developed by the OpenSSL Project for use in the O - There was an error trying to save the address list to %1. + There was an error trying to save the address list to %1. Please try again. @@ -209,12 +165,7 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - - - + Encrypt wallet Encrypt wallet @@ -281,7 +232,12 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet encrypted - + + 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>. + + + + Bitcoin 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. Bitcoin 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. @@ -330,27 +286,27 @@ This product includes software developed by the OpenSSL Project for use in the O BitcoinGUI - + Sign &message... Sign &message... - + Synchronizing with network... Synchronizing with network... - + &Overview &Overview - + Node - + Show general overview of wallet Show general overview of wallet @@ -426,7 +382,7 @@ This product includes software developed by the OpenSSL Project for use in the O - + Importing blocks from disk... Importing blocks from disk... @@ -436,7 +392,7 @@ This product includes software developed by the OpenSSL Project for use in the O Reindexing blocks on disk... - + Send coins to a Bitcoin address Send coins to a Bitcoin address @@ -471,17 +427,17 @@ This product includes software developed by the OpenSSL Project for use in the O &Verify message... - + Bitcoin Bitcoin - + Wallet Wallet - + &Send &Send @@ -537,18 +493,18 @@ This product includes software developed by the OpenSSL Project for use in the O Tabs toolbar - - + + [testnet] [testnet] - + Bitcoin Core Bitcoin Core - + Request payments (generates QR codes and bitcoin: URIs) @@ -584,13 +540,13 @@ This product includes software developed by the OpenSSL Project for use in the O - + Bitcoin client Bitcoin client - + %n active connection(s) to Bitcoin network %n active connection to Bitcoin network @@ -603,17 +559,12 @@ This product includes software developed by the OpenSSL Project for use in the O No block source available... - - Processed %1 of %2 (estimated) blocks of transaction history. - Processed %1 of %2 (estimated) blocks of transaction history. - - - + Processed %1 blocks of transaction history. Processed %1 blocks of transaction history. - + %n hour(s) %n hour @@ -691,7 +642,7 @@ This product includes software developed by the OpenSSL Project for use in the O Catching up... - + Sent transaction Sent transaction @@ -723,16 +674,11 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Wallet is <b>encrypted</b> and currently <b>locked</b> - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - ClientModel - + Network Alert Network Alert @@ -771,7 +717,7 @@ Address: %4 - Low Output: + Dust: @@ -830,7 +776,7 @@ Address: %4 - + Copy address Copy address @@ -887,7 +833,7 @@ Address: %4 - Copy low output + Copy dust @@ -896,17 +842,17 @@ Address: %4 - + highest - + higher - + high @@ -916,17 +862,18 @@ Address: %4 - + + medium - + low-medium - + low @@ -936,27 +883,27 @@ Address: %4 - + lowest - + (%1 locked) - + none - - Dust + + Can vary +/- %1 satoshi(s) per input. - + yes @@ -966,7 +913,7 @@ Address: %4 - + This label turns red, if the transaction size is greater than 1000 bytes. @@ -997,23 +944,7 @@ Address: %4 - - - This means a fee of at least %1 is required. - - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - - This label turns red, if the change is smaller than %1. - - - - + (no label) (no label) @@ -1128,12 +1059,7 @@ Address: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - - - - + Bitcoin Core Bitcoin Core @@ -1143,7 +1069,23 @@ Address: %4 version + + (%1-bit) + + + + + About Bitcoin Core + + + + + Command-line options + + + + Usage: Usage: @@ -1318,6 +1260,16 @@ Address: %4 + Accept connections from outside + + + + + Allow incoming connections + + + + Connect to the Bitcoin network through a SOCKS proxy. @@ -1332,7 +1284,7 @@ Address: %4 - + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. @@ -1358,7 +1310,7 @@ Address: %4 &Reset Options - + &Network &Network @@ -1403,7 +1355,7 @@ Address: %4 Map port using &UPnP - + Proxy &IP: Proxy &IP: @@ -1417,16 +1369,6 @@ Address: %4 Port of the proxy (e.g. 9050) Port of the proxy (e.g. 9050) - - - SOCKS &Version: - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - SOCKS version of the proxy (e.g. 5) - &Window @@ -1488,12 +1430,12 @@ Address: %4 &Display addresses in transaction list - + Whether to show coin control features or not. - + &OK &OK @@ -1503,17 +1445,17 @@ Address: %4 &Cancel - + default default - + none - + Confirm options reset Confirm options reset @@ -1547,18 +1489,23 @@ Address: %4 Form - - + + The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - + Wallet Wallet - + + Watchonly: + + + + Available: @@ -1583,12 +1530,12 @@ Address: %4 Immature: - + Mined balance that has not yet matured Mined balance that has not yet matured - + Total: Total: @@ -1598,12 +1545,40 @@ Address: %4 Your current total balance - + + Your current balance in watchonly addresses + + + + + + + + 0 BTC + + + + + Unconfirmed transactions to watchonly addresses + + + + + Mined balance in watchonly addresses that has not yet matured + + + + + Current total balance in watchonly addresses + + + + <b>Recent transactions</b> <b>Recent transactions</b> - + out of sync out of sync @@ -1612,68 +1587,91 @@ Address: %4 PaymentServer - - + + + URI handling URI handling - + + Invalid payment address %1 + + + + URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - + + Payment request file can not be read! This can be caused by an invalid payment request file. + + + + + + + Payment request rejected + + + + + Payment request network doesn't match client network. + + + + + Payment request has expired. + + + + + Payment request is not initialized. + + + + Requested payment amount of %1 is too small (considered dust). - - - - + + Payment request can not be parsed! + + + + + + + + - Payment request error - + Cannot start bitcoin: click-to-pay handler - - Net manager warning - - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - + Payment request fetch URL is invalid: %1 - + Payment request file handling - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - + Unverified payment requests to custom payment scripts are unsupported. - + Refund from %1 @@ -1683,12 +1681,7 @@ Address: %4 - - Payment request can not be parsed or processed! - - - - + Bad response from server %1 @@ -1703,39 +1696,70 @@ Address: %4 + + PeerTableModel + + + Address + Address + + + + User Agent + + + + + Start Height + + + QObject - - - - Bitcoin - Bitcoin + + Amount + Amount - - Error: Specified data directory "%1" does not exist. - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. + + Enter a Bitcoin address (e.g. %1) - - Error: Invalid combination of -regtest and -testnet. + + %1 d - - Bitcoin Core didn't yet exit safely... + + %1 h - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + + %1 m + + + + + %1 s + + + + + NETWORK + + + + + UNKNOWN + + + + + None + @@ -1751,7 +1775,7 @@ Address: %4 - + Save QR Code Save QR Code @@ -1772,19 +1796,33 @@ Address: %4 + - - + + + + + + + + + + + + + + + N/A N/A - + Client version Client version @@ -1808,6 +1846,11 @@ Address: %4 Using OpenSSL version Using OpenSSL version + + + Using BerkeleyDB version + + Startup time @@ -1839,12 +1882,97 @@ Address: %4 Current number of blocks - - Estimated total blocks - Estimated total blocks + + Received + - + + Sent + + + + + &Peers + + + + + Select a peer to view detailed information. + + + + + Version: + + + + + Last Receive: + + + + + User Agent: + + + + + Ping Time: + + + + + Connection Time: + + + + + Starting Height: + + + + + Bytes Sent: + + + + + Bytes Received: + + + + + Ban Score: + + + + + Direction: + + + + + Sync Node: + + + + + Last Send: + + + + + Services: + + + + + IP Address/port: + + + + Last block time Last block time @@ -1874,24 +2002,22 @@ Address: %4 - - + In: - - + Out: - + Build date Build date - + Debug log file Debug log file @@ -1921,7 +2047,7 @@ Address: %4 Type <b>help</b> for an overview of available commands. - + %1 B @@ -1941,18 +2067,49 @@ Address: %4 - - %1 m + + Peer Disconnected - - %1 h + + Node Detail + + + + + + never + + + + + %1 secs + + + + + Inbound + + + + + Outbound - %1 h %2 m + Yes + + + + + No + + + + + Fetching... @@ -2085,7 +2242,7 @@ Address: %4 - + Request payment to %1 @@ -2148,12 +2305,12 @@ Address: %4 Message - + Amount Amount - + (no label) (no label) @@ -2172,8 +2329,7 @@ Address: %4 SendCoinsDialog - - + Send Coins Send Coins @@ -2223,12 +2379,7 @@ Address: %4 - - Low Output: - - - - + After Fee: @@ -2263,7 +2414,12 @@ Address: %4 - + + Dust: + + + + Clear &All Clear &All @@ -2283,7 +2439,7 @@ Address: %4 S&end - + Confirm send coins Confirm send coins @@ -2296,7 +2452,7 @@ Address: %4 - + Copy quantity @@ -2326,17 +2482,12 @@ Address: %4 - - Copy low output - - - - + Copy change - + Total Amount %1 (= %2) @@ -2346,7 +2497,7 @@ Address: %4 - + The recipient address is not valid, please recheck. The recipient address is not valid, please recheck. @@ -2396,7 +2547,12 @@ Address: %4 - + + Copy dust + + + + Are you sure you want to send? @@ -2405,16 +2561,6 @@ Address: %4 added as transaction fee - - - Payment request expired - - - - - Invalid payment address %1 - - SendCoinsEntry @@ -2430,18 +2576,13 @@ Address: %4 Pay &To: Pay &To: - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Enter a label for this address to add it to your address book - + &Label: &Label: @@ -2456,7 +2597,12 @@ Address: %4 - + + The Bitcoin address to send the payment to + + + + Alt+A Alt+A @@ -2518,7 +2664,7 @@ Address: %4 ShutdownWindow - + Bitcoin Core is shutting down... @@ -2547,8 +2693,8 @@ Address: %4 - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address to sign the message with + @@ -2620,8 +2766,8 @@ Address: %4 - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address the message was signed with + @@ -2639,17 +2785,12 @@ Address: %4 Reset all verify message fields - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + Click "Sign Message" to generate signature Click "Sign Message" to generate signature - + The entered address is invalid. The entered address is invalid. @@ -2744,7 +2885,7 @@ Address: %4 TransactionDesc - + Open until %1 Open until %1 @@ -2798,39 +2939,45 @@ Address: %4 - + + From From - - - + + + To To - - + own address own address - + + + watch-only + + + + label label - + - - + + Credit Credit - + matures in %n more block(s) matures in %n more block @@ -2843,15 +2990,24 @@ Address: %4 not accepted - - - + + Debit Debit - + + Total debit + + + + + Total credit + + + + Transaction fee Transaction fee @@ -2907,17 +3063,19 @@ Address: %4 Amount + true true - + + false false - + , has not been successfully broadcast yet , has not been successfully broadcast yet @@ -2930,7 +3088,7 @@ Address: %4 - + unknown unknown @@ -2951,7 +3109,7 @@ Address: %4 TransactionTableModel - + Date Date @@ -2966,12 +3124,7 @@ Address: %4 Address - - Amount - Amount - - - + Immature (%1 confirmations, will be available after %2) @@ -3049,12 +3202,12 @@ Address: %4 Mined - + (n/a) (n/a) - + Transaction status. Hover over this field to show number of confirmations. Transaction status. Hover over this field to show number of confirmations. @@ -3153,7 +3306,7 @@ Address: %4 Min amount - + Copy address Copy address @@ -3238,12 +3391,7 @@ Address: %4 Address - - Amount - Amount - - - + ID ID @@ -3258,6 +3406,14 @@ Address: %4 to + + UnitDisplayStatusBarControl + + + Unit to show amounts in. Click to select another unit. + + + WalletFrame @@ -3269,7 +3425,7 @@ Address: %4 WalletModel - + Send Coins Send Coins @@ -3320,27 +3476,12 @@ Address: %4 bitcoin-core - - Usage: - Usage: - - - - List commands - List commands - - - - Get help for a command - Get help for a command - - - + Options: Options: - + Specify configuration file (default: bitcoin.conf) Specify configuration file (default: bitcoin.conf) @@ -3355,7 +3496,7 @@ Address: %4 Specify data directory - + Listen for connections on <port> (default: 8333 or testnet: 18333) Listen for connections on <port> (default: 8333 or testnet: 18333) @@ -3365,62 +3506,52 @@ Address: %4 Maintain at most <n> connections to peers (default: 125) - + Connect to a node to retrieve peer addresses, and disconnect Connect to a node to retrieve peer addresses, and disconnect - + Specify your own public address Specify your own public address - + Threshold for disconnecting misbehaving peers (default: 100) Threshold for disconnecting misbehaving peers (default: 100) - + Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - + Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - + Accept command line and JSON-RPC commands Accept command line and JSON-RPC commands - - Bitcoin Core RPC client version - - - - + Run in the background as a daemon and accept commands Run in the background as a daemon and accept commands - + Use the test network Use the test network - + Accept connections from outside (default: 1 if no -proxy or -connect) Accept connections from outside (default: 1 if no -proxy or -connect) - + %s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: @@ -3445,42 +3576,27 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - + Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - + Bind to given address and always listen on it. Use [host]:port notation for IPv6 Bind to given address and always listen on it. Use [host]:port notation for IPv6 - + Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - + Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - Error: Listening for incoming connections failed (listen returned error %d) - - - - + Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. @@ -3490,17 +3606,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - + Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - + Flush database activity from memory pool to disk log every <n> megabytes (default: 100) @@ -3510,12 +3621,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - + In this mode -genproclimit controls how many blocks are generated immediately. - + Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) @@ -3530,7 +3641,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - + Unable to bind to %s on this computer. Bitcoin Core is probably already running. @@ -3570,7 +3681,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - + (default: 1) @@ -3591,46 +3702,26 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - Bitcoin Core Daemon - - - - Block creation options: Block creation options: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - + Connect only to the specified node(s) Connect only to the specified node(s) - - Connect through SOCKS proxy - - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - + Connection options: - + Corrupted block database detected Corrupted block database detected - + Debugging/Testing options: @@ -3680,7 +3771,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error: Disk space is low! - + Error: Wallet locked, unable to create transaction! Error: Wallet locked, unable to create transaction! @@ -3745,22 +3836,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write undo data - - Fee per kB to add to transactions you send - - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - - Find peers using DNS lookup (default: 1 unless -connect) - Find peers using DNS lookup (default: 1 unless -connect) - - - + Force safe mode (default: 0) @@ -3770,7 +3846,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Generate coins (default: 0) - + How many blocks to check at startup (default: 288, 0 = all) How many blocks to check at startup (default: 288, 0 = all) @@ -3785,17 +3861,17 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - + Incorrect or no genesis block found. Wrong datadir for network? Incorrect or no genesis block found. Wrong datadir for network? - + Invalid -onion address: '%s' - + Not enough file descriptors available. Not enough file descriptors available. @@ -3805,22 +3881,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - RPC client options: - - - - + Rebuild block chain index from current blk000??.dat files Rebuild block chain index from current blk000??.dat files - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - + Set database cache size in megabytes (%d to %d, default: %d) @@ -3835,7 +3901,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Set the number of threads to service RPC calls (default: 4) - + Specify wallet file (within data directory) Specify wallet file (within data directory) @@ -3844,18 +3910,18 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Spend unconfirmed change when sending transactions (default: 1) + + + Stop running after importing blocks from disk (default: 0) + + This is intended for regression testing tools and app development. - - Usage (deprecated, use bitcoin-cli): - - - - + Verifying blocks... Verifying blocks... @@ -3864,11 +3930,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Verifying wallet... Verifying wallet... - - - Wait for RPC server to start - - Wallet %s resides outside data directory %s @@ -3880,12 +3941,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - + You need to rebuild the database using -reindex to change -txindex You need to rebuild the database using -reindex to change -txindex @@ -3895,30 +3951,165 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Imports blocks from external blk000??.dat file - + + (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + + + + + Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times + + + + + An error occurred while setting up the RPC address %s port %u for listening: %s + + + + + Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6 + + + + + Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces) + + + + Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - + + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) + + + + + Delete all wallet transactions and only recover those part of the blockchain through -rescan on startup + + + + + Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + + + + + Error: Listening for incoming connections failed (listen returned error %s) + + + + + Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + + + + + Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) + + + + Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - + + Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) + + + + + Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) + + + + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) + + + + Output debugging information (default: 0, supplying <category> is optional) + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) + + + + Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - + + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. + + + + + Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. + + + + + Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway + + + + + Always query for peer addresses via DNS lookup (default: 0) + + + + + Cannot resolve -whitebind address: '%s' + + + + + Connect through SOCKS5 proxy + + + + + Copyright (C) 2009-%i The Bitcoin Core Developers + + + + + Could not parse -rpcbind value %s as network address + + + + + Error: Unsupported argument -tor found, use -onion. + + + + + Fee (in BTC/kB) to add to transactions you send (default: %s) + + + + + Include IP addresses in debug output (default: 0) + + + + Information Information + + + Initialization sanity check failed. Bitcoin Core is shutting down. + + Invalid amount for -minrelaytxfee=<amount>: '%s' @@ -3929,13 +4120,28 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Invalid amount for -mintxfee=<amount>: '%s' Invalid amount for -mintxfee=<amount>: '%s' + + + Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) + + + Invalid netmask specified in -whitelist: '%s' + + + + + Keep at most <n> unconnectable blocks in memory (default: %u) + + + + Limit size of signature cache to <n> entries (default: 50000) - + Log transaction priority and fee per kB when mining blocks (default: 0) @@ -3954,6 +4160,16 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) + + + Need to specify a port with -whitebind: '%s' + + + + + Node relay options: + + Only accept block chain matching built-in checkpoints (default: 1) @@ -3980,7 +4196,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - + RPC server options: @@ -3995,18 +4211,18 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - Run a thread to flush wallet periodically (default: 1) + + Relay and mine data carrier transactions (default: 1) - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL options: (see the Bitcoin Wiki for SSL setup instructions) + + Relay non-P2SH multisig (default: 1) + - - Send command to Bitcoin Core + + Run a thread to flush wallet periodically (default: 1) @@ -4029,11 +4245,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Show all debugging options (usage: --help -help-debug) - - - Show benchmark information (default: 0) - - Shrink debug.log file on client startup (default: 1 when no -debug) @@ -4050,17 +4261,17 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Specify connection timeout in milliseconds (default: 5000) - - Start Bitcoin Core Daemon - - - - + System error: System error: - + + This is experimental software. + + + + Transaction amount too small Transaction amount too small @@ -4075,7 +4286,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Transaction too large - + + Unable to bind to %s on this computer (bind returned error %s) + + + + Use UPnP to map the listening port (default: 0) Use UPnP to map the listening port (default: 0) @@ -4090,15 +4306,25 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Username for JSON-RPC connections - + Warning Warning - + Warning: This version is obsolete, upgrade required! Warning: This version is obsolete, upgrade required! + + + Warning: Unsupported argument -benchmark ignored, use -debug=bench. + + + + + Warning: Unsupported argument -debugnet ignored, use -debug=net. + + Zapping all transactions from wallet... @@ -4109,58 +4335,43 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. on startup - - - version - version - wallet.dat corrupt, salvage failed wallet.dat corrupt, salvage failed - + Password for JSON-RPC connections Password for JSON-RPC connections - - - Allow JSON-RPC connections from specified IP address - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - Send commands to node running on <ip> (default: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Execute command when the best block changes (%s in cmd is replaced by block hash) - + Upgrade wallet to latest format Upgrade wallet to latest format - + Set key pool size to <n> (default: 100) Set key pool size to <n> (default: 100) - + Rescan the block chain for missing wallet transactions Rescan the block chain for missing wallet transactions - + Use OpenSSL (https) for JSON-RPC connections Use OpenSSL (https) for JSON-RPC connections - + Server certificate file (default: server.cert) Server certificate file (default: server.cert) @@ -4170,27 +4381,22 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Server private key (default: server.pem) - + This help message This help message - - Unable to bind to %s on this computer (bind returned error %d, %s) - Unable to bind to %s on this computer (bind returned error %d, %s) - - - + Allow DNS lookups for -addnode, -seednode and -connect Allow DNS lookups for -addnode, -seednode and -connect - + Loading addresses... Loading addresses... - + Error loading wallet.dat: Wallet corrupted Error loading wallet.dat: Wallet corrupted @@ -4200,12 +4406,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet requires newer version of Bitcoin - + Wallet needed to be rewritten: restart Bitcoin to complete Wallet needed to be rewritten: restart Bitcoin to complete - + Error loading wallet.dat Error loading wallet.dat @@ -4220,12 +4426,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Unknown network specified in -onlynet: '%s' - - Unknown -socks proxy version requested: %i - Unknown -socks proxy version requested: %i - - - + Cannot resolve -bind address: '%s' Cannot resolve -bind address: '%s' @@ -4235,7 +4436,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Cannot resolve -externalip address: '%s' - + Invalid amount for -paytxfee=<amount>: '%s' Invalid amount for -paytxfee=<amount>: '%s' @@ -4245,63 +4446,54 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Invalid amount - + Insufficient funds Insufficient funds - + Loading block index... Loading block index... - + Add a node to connect to and attempt to keep the connection open Add a node to connect to and attempt to keep the connection open - + Loading wallet... Loading wallet... - + Cannot downgrade wallet Cannot downgrade wallet - + Cannot write default address Cannot write default address - + Rescanning... Rescanning... - + Done loading Done loading - + To use the %s option To use the %s option - + Error Error - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - From 8b4616bab3d6badabbcce7d73baf4c74bf2fd854 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 31 Jul 2014 15:25:17 +0200 Subject: [PATCH 0457/1288] qt: Change transifex slug to new resource for 0.10.x Make sure that translations are pulled from the 0.10.x resource https://www.transifex.com/projects/p/bitcoin/resource/qt-translation-010x/ Closes #4006. --- .tx/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tx/config b/.tx/config index 655379de79..472d27b46f 100644 --- a/.tx/config +++ b/.tx/config @@ -1,7 +1,7 @@ [main] host = https://www.transifex.com -[bitcoin.tx] +[bitcoin.qt-translation-010x] file_filter = src/qt/locale/bitcoin_.ts source_file = src/qt/locale/bitcoin_en.ts source_lang = en From bd26fee10bb2697340caf5e3f48922df0323f88e Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 31 Jul 2014 16:56:14 +0200 Subject: [PATCH 0458/1288] qt: Update some messages after suggestions by translators - *cannot* is more common, thus preferred to *can not* - Use *Watch-only* instead of *Watchonly* as one word --- src/qt/forms/overviewpage.ui | 2 +- src/qt/intro.cpp | 2 +- src/qt/locale/bitcoin_en.ts | 46 ++++++++++++++++++------------------ src/qt/paymentserver.cpp | 6 ++--- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui index 8784da5f3e..c195afee96 100644 --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -89,7 +89,7 @@ - Watchonly: + Watch-only: Qt::AlignCenter diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp index 3e99e941a6..13c260b7db 100644 --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -182,7 +182,7 @@ void Intro::pickDataDirectory() break; } catch(fs::filesystem_error &e) { QMessageBox::critical(0, tr("Bitcoin"), - tr("Error: Specified data directory \"%1\" can not be created.").arg(dataDir)); + tr("Error: Specified data directory \"%1\" cannot be created.").arg(dataDir)); /* fall through, back to choosing screen */ } } diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index 6739ef0021..96f7685112 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -1164,8 +1164,8 @@ Address: %4 - Error: Specified data directory "%1" can not be created. - Error: Specified data directory "%1" can not be created. + Error: Specified data directory "%1" cannot be created. + @@ -1501,7 +1501,7 @@ Address: %4 - Watchonly: + Watch-only: @@ -1599,17 +1599,7 @@ Address: %4 - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Payment request file can not be read! This can be caused by an invalid payment request file. - - - - + Payment request rejected @@ -1636,12 +1626,7 @@ Address: %4 - - Payment request can not be parsed! - - - - + @@ -1661,12 +1646,22 @@ Address: %4 - + + URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + + + + Payment request file handling - + + Payment request file cannot be read! This can be caused by an invalid payment request file. + + + + Unverified payment requests to custom payment scripts are unsupported. @@ -1681,7 +1676,12 @@ Address: %4 - + + Payment request cannot be parsed! + + + + Bad response from server %1 diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 7c0c95c459..76fd2733a5 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -424,7 +424,7 @@ void PaymentServer::handleURIOrFile(const QString& s) } else emit message(tr("URI handling"), - tr("URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters."), + tr("URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters."), CClientUIInterface::ICON_WARNING); return; @@ -438,7 +438,7 @@ void PaymentServer::handleURIOrFile(const QString& s) if (!readPaymentRequest(s, request)) { emit message(tr("Payment request file handling"), - tr("Payment request file can not be read! This can be caused by an invalid payment request file."), + tr("Payment request file cannot be read! This can be caused by an invalid payment request file."), CClientUIInterface::ICON_WARNING); } else if (processPaymentRequest(request, recipient)) @@ -663,7 +663,7 @@ void PaymentServer::netRequestFinished(QNetworkReply* reply) { qWarning() << "PaymentServer::netRequestFinished : Error parsing payment request"; emit message(tr("Payment request error"), - tr("Payment request can not be parsed!"), + tr("Payment request cannot be parsed!"), CClientUIInterface::MSG_ERROR); } else if (processPaymentRequest(request, recipient)) From c0e9548b6305d315735ecd6dacc3c88acd6a6c7a Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 31 Jul 2014 17:19:05 +0200 Subject: [PATCH 0459/1288] qt: more watchonly -> watch-only --- src/qt/forms/overviewpage.ui | 8 ++++---- src/qt/locale/bitcoin_en.ts | 36 ++++++++++++++++++------------------ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui index c195afee96..dcdf73af99 100644 --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -289,7 +289,7 @@ IBeamCursor - Your current balance in watchonly addresses + Your current balance in watch-only addresses 0 BTC @@ -314,7 +314,7 @@ IBeamCursor - Unconfirmed transactions to watchonly addresses + Unconfirmed transactions to watch-only addresses 0 BTC @@ -339,7 +339,7 @@ IBeamCursor - Mined balance in watchonly addresses that has not yet matured + Mined balance in watch-only addresses that has not yet matured 0 BTC @@ -383,7 +383,7 @@ IBeamCursor - Current total balance in watchonly addresses + Current total balance in watch-only addresses 0 BTC diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index 96f7685112..09f9e48419 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -1546,11 +1546,26 @@ Address: %4 - Your current balance in watchonly addresses + Your current balance in watch-only addresses - + + Unconfirmed transactions to watch-only addresses + + + + + Mined balance in watch-only addresses that has not yet matured + + + + + Current total balance in watch-only addresses + + + + @@ -1558,22 +1573,7 @@ Address: %4 - - Unconfirmed transactions to watchonly addresses - - - - - Mined balance in watchonly addresses that has not yet matured - - - - - Current total balance in watchonly addresses - - - - + <b>Recent transactions</b> <b>Recent transactions</b> From a67eef17236f71379e01bffed477674be9ee8f38 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 18 Jun 2014 16:29:51 -0400 Subject: [PATCH 0460/1288] test: redirect comparison tool output to stdout Otherwise travis thinks the build has stalled. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 3a6a6b6d88..951d7581fb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -160,7 +160,7 @@ endif if USE_COMPARISON_TOOL check-local: $(MKDIR_P) qa/tmp - @qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS) + @qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS) 2>&1 endif EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/pull-tester.sh qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) From 6548cc9f9073bf6602e17f62017af5c0e2bc3457 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 31 Jul 2014 14:04:53 -0400 Subject: [PATCH 0461/1288] test: don't let the port number exceed the legal range --- qa/pull-tester/run-bitcoind-for-test.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/pull-tester/run-bitcoind-for-test.sh.in b/qa/pull-tester/run-bitcoind-for-test.sh.in index ecc42e12b1..e186bd7a23 100755 --- a/qa/pull-tester/run-bitcoind-for-test.sh.in +++ b/qa/pull-tester/run-bitcoind-for-test.sh.in @@ -9,7 +9,7 @@ mkdir -p "$DATADIR"/regtest touch "$DATADIR/regtest/debug.log" tail -q -n 1 -F "$DATADIR/regtest/debug.log" | grep -m 1 -q "Done loading" & WAITER=$! -PORT=`expr $BASHPID + 10000` +PORT=`expr 10000 + $BASHPID % 55536` "@abs_top_builddir@/src/bitcoind@EXEEXT@" -connect=0.0.0.0 -datadir="$DATADIR" -rpcuser=user -rpcpassword=pass -listen -keypool=3 -debug -debug=net -logtimestamps -port=$PORT -whitelist=127.0.0.1 -regtest -rpcport=`expr $PORT + 1` & BITCOIND=$! From 9fcb410195935edf75bbeccaeb8a37ae4d3e5a4e Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 1 Aug 2014 07:51:24 +0200 Subject: [PATCH 0462/1288] qt: Remove '0 BTC' placeholder from translation --- src/qt/forms/overviewpage.ui | 8 ++++---- src/qt/locale/bitcoin_en.ts | 10 +--------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui index dcdf73af99..df16295f77 100644 --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -292,7 +292,7 @@ Your current balance in watch-only addresses - 0 BTC + 0 BTC Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -317,7 +317,7 @@ Unconfirmed transactions to watch-only addresses - 0 BTC + 0 BTC Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -342,7 +342,7 @@ Mined balance in watch-only addresses that has not yet matured - 0 BTC + 0 BTC Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -386,7 +386,7 @@ Current total balance in watch-only addresses - 0 BTC + 0 BTC Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index 09f9e48419..143f705327 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -1565,15 +1565,7 @@ Address: %4 - - - - - 0 BTC - - - - + <b>Recent transactions</b> <b>Recent transactions</b> From 283a3b88b6d971823741628ba25d10417a0c4121 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 1 Aug 2014 08:04:46 +0200 Subject: [PATCH 0463/1288] small ordering cleanup of init help message --- src/init.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index b84c233b99..b22a11bff7 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -231,7 +231,6 @@ std::string HelpMessage(HelpMessageMode mode) #endif strUsage += " -txindex " + _("Maintain a full transaction index (default: 0)") + "\n"; - strUsage += "\n" + _("Connection options:") + "\n"; strUsage += " -addnode= " + _("Add a node to connect to and attempt to keep the connection open") + "\n"; strUsage += " -banscore= " + _("Threshold for disconnecting misbehaving peers (default: 100)") + "\n"; @@ -241,8 +240,8 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -discover " + _("Discover own IP address (default: 1 when listening and no -externalip)") + "\n"; strUsage += " -dns " + _("Allow DNS lookups for -addnode, -seednode and -connect") + " " + _("(default: 1)") + "\n"; strUsage += " -dnsseed " + _("Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect)") + "\n"; - strUsage += " -forcednsseed " + _("Always query for peer addresses via DNS lookup (default: 0)") + "\n"; strUsage += " -externalip= " + _("Specify your own public address") + "\n"; + strUsage += " -forcednsseed " + _("Always query for peer addresses via DNS lookup (default: 0)") + "\n"; strUsage += " -listen " + _("Accept connections from outside (default: 1 if no -proxy or -connect)") + "\n"; strUsage += " -maxconnections= " + _("Maintain at most connections to peers (default: 125)") + "\n"; strUsage += " -maxreceivebuffer= " + _("Maximum per-connection receive buffer, *1000 bytes (default: 5000)") + "\n"; From 1b73d36b2c71c92044012dc736215bf95f2e908b Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 1 Aug 2014 08:32:41 +0200 Subject: [PATCH 0464/1288] fix compilation error in core_io.h - error: 'vector' in namespace 'std' does not name a type - add include in core_io.h - remove includes from core_read.cpp and core_write.cpp --- src/core_io.h | 1 + src/core_read.cpp | 1 - src/core_write.cpp | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core_io.h b/src/core_io.h index 8a7d580570..26a1293dfd 100644 --- a/src/core_io.h +++ b/src/core_io.h @@ -2,6 +2,7 @@ #define __BITCOIN_CORE_IO_H__ #include +#include class uint256; class CScript; diff --git a/src/core_read.cpp b/src/core_read.cpp index 0f06bb6952..9022ffaf2b 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -1,5 +1,4 @@ -#include #include "core_io.h" #include "core.h" #include "serialize.h" diff --git a/src/core_write.cpp b/src/core_write.cpp index 2eb220779f..d9e31ed8cd 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -1,5 +1,4 @@ -#include #include "core_io.h" #include "univalue/univalue.h" #include "script.h" From 2b600992e8de0cc9a484e3bf25fe71ac50adadb7 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 1 Aug 2014 08:39:06 +0200 Subject: [PATCH 0465/1288] add license header to core_io.h, core_read/_write.cpp --- src/core_io.h | 4 ++++ src/core_read.cpp | 3 +++ src/core_write.cpp | 3 +++ 3 files changed, 10 insertions(+) diff --git a/src/core_io.h b/src/core_io.h index 26a1293dfd..adf74cce32 100644 --- a/src/core_io.h +++ b/src/core_io.h @@ -1,3 +1,7 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #ifndef __BITCOIN_CORE_IO_H__ #define __BITCOIN_CORE_IO_H__ diff --git a/src/core_read.cpp b/src/core_read.cpp index 9022ffaf2b..593eb2d035 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "core_io.h" #include "core.h" diff --git a/src/core_write.cpp b/src/core_write.cpp index d9e31ed8cd..37dd69f7b8 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -1,3 +1,6 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "core_io.h" #include "univalue/univalue.h" From f5745fa52a66ab9ba976e06de4881e981d9aa6b4 Mon Sep 17 00:00:00 2001 From: jtimon Date: Fri, 1 Aug 2014 17:45:09 +0200 Subject: [PATCH 0466/1288] Declare SignatureHash() in script.h --- src/script.h | 1 + src/test/multisig_tests.cpp | 2 -- src/test/script_P2SH_tests.cpp | 3 --- src/test/script_tests.cpp | 3 +-- src/test/sighash_tests.cpp | 3 +-- 5 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/script.h b/src/script.h index e36be2db9e..ea944b4996 100644 --- a/src/script.h +++ b/src/script.h @@ -809,6 +809,7 @@ bool IsCanonicalPubKey(const std::vector &vchPubKey, unsigned int bool IsCanonicalSignature(const std::vector &vchSig, unsigned int flags); bool EvalScript(std::vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); +uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType); bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector >& vSolutionsRet); int ScriptSigArgsExpected(txnouttype t, const std::vector >& vSolutions); bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType); diff --git a/src/test/multisig_tests.cpp b/src/test/multisig_tests.cpp index 452cf084a7..2a0466e928 100644 --- a/src/test/multisig_tests.cpp +++ b/src/test/multisig_tests.cpp @@ -17,8 +17,6 @@ using namespace boost::assign; typedef vector valtype; -extern uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType); - BOOST_AUTO_TEST_SUITE(multisig_tests) CScript diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index a1dc17ba36..51ff1ffbc9 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -15,9 +15,6 @@ using namespace std; -// Test routines internal to script.cpp: -extern uint256 SignatureHash(CScript scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType); - // Helpers: static std::vector Serialize(const CScript& s) diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 5e35875a8e..bc9f31c077 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -10,6 +10,7 @@ #include "key.h" #include "keystore.h" #include "main.h" +#include "script.h" #include "core_io.h" #include @@ -33,8 +34,6 @@ using namespace std; using namespace json_spirit; using namespace boost::algorithm; -extern uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType); - static const unsigned int flags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC; Array diff --git a/src/test/sighash_tests.cpp b/src/test/sighash_tests.cpp index b99797fccb..bff151cdda 100644 --- a/src/test/sighash_tests.cpp +++ b/src/test/sighash_tests.cpp @@ -6,6 +6,7 @@ #include "main.h" #include "random.h" #include "serialize.h" +#include "script.h" #include "util.h" #include "version.h" @@ -19,8 +20,6 @@ using namespace json_spirit; extern Array read_json(const std::string& jsondata); -extern uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType); - // Old script.cpp SignatureHash function uint256 static SignatureHashOld(CScript scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType) { From a60120e951ae94d0553c5515229432e016fb0657 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 24 Jul 2014 13:52:57 +0200 Subject: [PATCH 0467/1288] Add built-in seeds for .onion This makes it possible for a node with `-onlynet=tor` to bootstrap itself. It also adds the base infrastructure for adding IPv6 seed nodes. Also represent IPv4 fixed seed addresses in 16-byte format. --- share/seeds/generate-seeds.py | 132 +++++++ share/seeds/nodes_main.txt | 629 +++++++++++++++++++++++++++++++++ share/seeds/nodes_test.txt | 5 + src/Makefile.am | 1 + src/chainparams.cpp | 118 ++----- src/chainparamsseeds.h | 638 ++++++++++++++++++++++++++++++++++ 6 files changed, 1432 insertions(+), 91 deletions(-) create mode 100755 share/seeds/generate-seeds.py create mode 100644 share/seeds/nodes_main.txt create mode 100644 share/seeds/nodes_test.txt create mode 100644 src/chainparamsseeds.h diff --git a/share/seeds/generate-seeds.py b/share/seeds/generate-seeds.py new file mode 100755 index 0000000000..6c1b4ed860 --- /dev/null +++ b/share/seeds/generate-seeds.py @@ -0,0 +1,132 @@ +#!/usr/bin/python +# Copyright (c) 2014 Wladmir J. van der Laan +# Distributed under the MIT/X11 software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +''' +Script to generate list of seed nodes for chainparams.cpp. + +This script expects two text files in the directory that is passed as an +argument: + + nodes_main.txt + nodes_test.txt + +These files must consist of lines in the format + + + : + [] + []: + .onion + 0xDDBBCCAA (IPv4 little-endian old pnSeeds format) + +The output will be two data structures with the peers in binary format: + + static SeedSpec6 pnSeed6_main[]={ + ... + } + static SeedSpec6 pnSeed6_test[]={ + ... + } + +These should be pasted into `src/chainparamsseeds.h`. +''' +from __future__ import print_function, division +from base64 import b32decode +from binascii import a2b_hex +import sys, os +import re + +# ipv4 in ipv6 prefix +pchIPv4 = bytearray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff]) +# tor-specific ipv6 prefix +pchOnionCat = bytearray([0xFD,0x87,0xD8,0x7E,0xEB,0x43]) + +def name_to_ipv6(addr): + if len(addr)>6 and addr.endswith('.onion'): + vchAddr = b32decode(addr[0:-6], True) + if len(vchAddr) != 16-len(pchOnionCat): + raise ValueError('Invalid onion %s' % s) + return pchOnionCat + vchAddr + elif '.' in addr: # IPv4 + return pchIPv4 + bytearray((int(x) for x in addr.split('.'))) + elif ':' in addr: # IPv6 + sub = [[], []] # prefix, suffix + x = 0 + addr = addr.split(':') + for i,comp in enumerate(addr): + if comp == '': + if i == 0 or i == (len(addr)-1): # skip empty component at beginning or end + continue + x += 1 # :: skips to suffix + assert(x < 2) + else: # two bytes per component + val = int(comp, 16) + sub[x].append(val >> 8) + sub[x].append(val & 0xff) + nullbytes = 16 - len(sub[0]) - len(sub[1]) + assert((x == 0 and nullbytes == 0) or (x == 1 and nullbytes > 0)) + return bytearray(sub[0] + ([0] * nullbytes) + sub[1]) + elif addr.startswith('0x'): # IPv4-in-little-endian + return pchIPv4 + bytearray(reversed(a2b_hex(addr[2:]))) + else: + raise ValueError('Could not parse address %s' % addr) + +def parse_spec(s, defaultport): + match = re.match('\[([0-9a-fA-F:]+)\](?::([0-9]+))?$', s) + if match: # ipv6 + host = match.group(1) + port = match.group(2) + else: + (host,_,port) = s.partition(':') + + if not port: + port = defaultport + else: + port = int(port) + + host = name_to_ipv6(host) + + return (host,port) + +def process_nodes(g, f, structname, defaultport): + g.write('static SeedSpec6 %s[] = {\n' % structname) + first = True + for line in f: + comment = line.find('#') + if comment != -1: + line = line[0:comment] + line = line.strip() + if not line: + continue + if not first: + g.write(',\n') + first = False + + (host,port) = parse_spec(line, defaultport) + hoststr = ','.join(('0x%02x' % b) for b in host) + g.write(' {{%s}, %i}' % (hoststr, port)) + g.write('\n};\n') + +def main(): + if len(sys.argv)<2: + print(('Usage: %s ' % sys.argv[0]), file=sys.stderr) + exit(1) + g = sys.stdout + indir = sys.argv[1] + g.write('#ifndef H_CHAINPARAMSSEEDS\n') + g.write('#define H_CHAINPARAMSSEEDS\n') + g.write('// List of fixed seed nodes for the bitcoin network\n') + g.write('// AUTOGENERATED by contrib/devtools/generate-seeds.py\n\n') + g.write('// Each line contains a 16-byte IPv6 address and a port.\n') + g.write('// IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly.\n') + with open(os.path.join(indir,'nodes_main.txt'),'r') as f: + process_nodes(g, f, 'pnSeed6_main', 8333) + g.write('\n') + with open(os.path.join(indir,'nodes_test.txt'),'r') as f: + process_nodes(g, f, 'pnSeed6_test', 18333) + g.write('#endif\n') + +if __name__ == '__main__': + main() + diff --git a/share/seeds/nodes_main.txt b/share/seeds/nodes_main.txt new file mode 100644 index 0000000000..f2558cf3c4 --- /dev/null +++ b/share/seeds/nodes_main.txt @@ -0,0 +1,629 @@ +# List of fixed seed nodes for main network + +# IPv4 nodes (in old chainparams.cpp 0xDDCCBBAA format) +# n.b. when importing a new list, there is no need to use this format, just use IPv4 dotted addresses directly +0x7e6a692e # 46.105.106.126 +0x7d04d1a2 # 162.209.4.125 +0x6c0c17d9 # 217.23.12.108 +0xdb330ab9 # 185.10.51.219 +0xc649c7c6 # 198.199.73.198 +0x7895484d # 77.72.149.120 +0x047109b0 # 176.9.113.4 +0xb90ca5bc # 188.165.12.185 +0xd130805f # 95.128.48.209 +0xbd074ea6 # 166.78.7.189 +0x578ff1c0 # 192.241.143.87 +0x286e09b0 # 176.9.110.40 +0xd4dcaf42 # 66.175.220.212 +0x529b6bb8 # 184.107.155.82 +0x635cc6c0 # 192.198.92.99 +0xedde892e # 46.137.222.237 +0xa976d9c7 # 199.217.118.169 +0xea91a4b8 # 184.164.145.234 +0x03fa4eb2 # 178.78.250.3 +0x6ca9008d # 141.0.169.108 +0xaf62c825 # 37.200.98.175 +0x93f3ba51 # 81.186.243.147 +0xc2c9efd5 # 213.239.201.194 +0x0ed5175e # 94.23.213.14 +0x487028bc # 188.40.112.72 +0x7297c225 # 37.194.151.114 +0x8af0c658 # 88.198.240.138 +0x2e57ba1f # 31.186.87.46 +0xd0098abc # 188.138.9.208 +0x46a8853e # 62.133.168.70 +0xcc92dc3e # 62.220.146.204 +0xeb6f1955 # 85.25.111.235 +0x8cce175e # 94.23.206.140 +0x237281ae # 174.129.114.35 +0x9d42795b # 91.121.66.157 +0x4f4f0905 # 5.9.79.79 +0xc50151d0 # 208.81.1.197 +0xb1ba90c6 # 198.144.186.177 +0xaed7175e # 94.23.215.174 +0x204de55b # 91.229.77.32 +0x4bb03245 # 69.50.176.75 +0x932b28bc # 188.40.43.147 +0x2dcce65b # 91.230.204.45 +0xe2708abc # 188.138.112.226 +0x1b08b8d5 # 213.184.8.27 +0x12a3dc5b # 91.220.163.18 +0x8a884c90 # 144.76.136.138 +0xa386a8b8 # 184.168.134.163 +0x18e417c6 # 198.23.228.24 +0x2e709ac3 # 195.154.112.46 +0xeb62e925 # 37.233.98.235 +0x6f6503ae # 174.3.101.111 +0x05d0814e # 78.129.208.5 +0x8a9ac545 # 69.197.154.138 +0x946fd65e # 94.214.111.148 +0x3f57495d # 93.73.87.63 +0x4a29c658 # 88.198.41.74 +0xad454c90 # 144.76.69.173 +0x15340905 # 5.9.52.21 +0x4c3f3b25 # 37.59.63.76 +0x01fe19b9 # 185.25.254.1 +0x5620595b # 91.89.32.86 +0x443c795b # 91.121.60.68 +0x44f24ac8 # 200.74.242.68 +0x0442464e # 78.70.66.4 +0xc8665882 # 130.88.102.200 +0xed3f3ec3 # 195.62.63.237 +0xf585bf5d # 93.191.133.245 +0x5dd141da # 218.65.209.93 +0xf93a084e # 78.8.58.249 +0x1264dd52 # 82.221.100.18 +0x0711c658 # 88.198.17.7 +0xf12e7bbe # 190.123.46.241 +0x5b02b740 # 64.183.2.91 +0x7d526dd5 # 213.109.82.125 +0x0cb04c90 # 144.76.176.12 +0x2abe1132 # 50.17.190.42 +0x61a39f58 # 88.159.163.97 +0x044a0618 # 24.6.74.4 +0xf3af7dce # 206.125.175.243 +0xb994c96d # 109.201.148.185 +0x361c5058 # 88.80.28.54 +0xca735d53 # 83.93.115.202 +0xeca743b0 # 176.67.167.236 +0xec790905 # 5.9.121.236 +0xc4d37845 # 69.120.211.196 +0xa1c4a2b2 # 178.162.196.161 +0x726fd453 # 83.212.111.114 +0x625cc6c0 # 192.198.92.98 +0x6c20132e # 46.19.32.108 +0xb7aa0c79 # 121.12.170.183 +0xc6ed983d # 61.152.237.198 +0x47e4cbc0 # 192.203.228.71 +0xa4ac75d4 # 212.117.172.164 +0xe2e59345 # 69.147.229.226 +0x4d784ad0 # 208.74.120.77 +0x18a5ec5e # 94.236.165.24 +0x481cc85b # 91.200.28.72 +0x7c6c2fd5 # 213.47.108.124 +0x5e4d6018 # 24.96.77.94 +0x5b4b6c18 # 24.108.75.91 +0xd99b4c90 # 144.76.155.217 +0xe63987dc # 220.135.57.230 +0xb817bb25 # 37.187.23.184 +0x141cfeb2 # 178.254.28.20 +0x5f005058 # 88.80.0.95 +0x0d987f47 # 71.127.152.13 +0x242a496d # 109.73.42.36 +0x3e519bc0 # 192.155.81.62 +0x02b2454b # 75.69.178.2 +0xdfaf3dc6 # 198.61.175.223 +0x888128bc # 188.40.129.136 +0x1165bb25 # 37.187.101.17 +0xabfeca5b # 91.202.254.171 +0x2ef63540 # 64.53.246.46 +0x5773c7c6 # 198.199.115.87 +0x1280dd52 # 82.221.128.18 +0x8ebcacd9 # 217.172.188.142 +0x81c439c6 # 198.57.196.129 +0x39fcfa45 # 69.250.252.57 +0x62177d41 # 65.125.23.98 +0xc975ed62 # 98.237.117.201 +0x05cff476 # 118.244.207.5 +0xdabda743 # 67.167.189.218 +0xaa1ac24e # 78.194.26.170 +0xe255a22e # 46.162.85.226 +0x88aac705 # 5.199.170.136 +0xe707c658 # 88.198.7.231 +0xa9e94b5e # 94.75.233.169 +0x2893484b # 75.72.147.40 +0x99512705 # 5.39.81.153 +0xd63970ca # 202.112.57.214 +0x45994f32 # 50.79.153.69 +0xe519a8ad # 173.168.25.229 +0x92e25f5d # 93.95.226.146 +0x8b84a9c1 # 193.169.132.139 +0x5eaa0a05 # 5.10.170.94 +0xa74de55b # 91.229.77.167 +0xb090ff62 # 98.255.144.176 +0x5eee326c # 108.50.238.94 +0xc331a679 # 121.166.49.195 +0xc1d9b72e # 46.183.217.193 +0x0c6ab982 # 130.185.106.12 +0x7362bb25 # 37.187.98.115 +0x4cfedd42 # 66.221.254.76 +0x1e09a032 # 50.160.9.30 +0xa4c34c5e # 94.76.195.164 +0x3777d9c7 # 199.217.119.55 +0x5edcf260 # 96.242.220.94 +0x3ce2b548 # 72.181.226.60 +0xd2ac0360 # 96.3.172.210 +0x2f80b992 # 146.185.128.47 +0x3e4cbb25 # 37.187.76.62 +0x3995e236 # 54.226.149.57 +0xd03977ae # 174.119.57.208 +0x953cf054 # 84.240.60.149 +0x3c654ed0 # 208.78.101.60 +0x74024c90 # 144.76.2.116 +0xa14f1155 # 85.17.79.161 +0x14ce0125 # 37.1.206.20 +0xc15ebb6a # 106.187.94.193 +0x2c08c452 # 82.196.8.44 +0xc7fd0652 # 82.6.253.199 +0x7604f8ce # 206.248.4.118 +0xffb38332 # 50.131.179.255 +0xa4c2efd5 # 213.239.194.164 +0xe9614018 # 24.64.97.233 +0xab49e557 # 87.229.73.171 +0x1648c052 # 82.192.72.22 +0x36024047 # 71.64.2.54 +0x0e8cffad # 173.255.140.14 +0x21918953 # 83.137.145.33 +0xb61f50ad # 173.80.31.182 +0x9b406b59 # 89.107.64.155 +0xaf282218 # 24.34.40.175 +0x7f1d164e # 78.22.29.127 +0x1f560da2 # 162.13.86.31 +0xe237be58 # 88.190.55.226 +0xbdeb1955 # 85.25.235.189 +0x6c0717d9 # 217.23.7.108 +0xdaf8ce62 # 98.206.248.218 +0x0f74246c # 108.36.116.15 +0xdee95243 # 67.82.233.222 +0xf23f1a56 # 86.26.63.242 +0x61bdf867 # 103.248.189.97 +0xd254c854 # 84.200.84.210 +0xc4422e4e # 78.46.66.196 +0xae0563c0 # 192.99.5.174 +0xbdb9a95f # 95.169.185.189 +0xa9eb32c6 # 198.50.235.169 +0xd9943950 # 80.57.148.217 +0x116add52 # 82.221.106.17 +0x73a54c90 # 144.76.165.115 +0xb36b525e # 94.82.107.179 +0xd734175e # 94.23.52.215 +0x333d7f76 # 118.127.61.51 +0x51431bc6 # 198.27.67.81 +0x084ae5cf # 207.229.74.8 +0xa60a236c # 108.35.10.166 +0x5c67692e # 46.105.103.92 +0x0177cf45 # 69.207.119.1 +0xa6683ac6 # 198.58.104.166 +0x7ff4ea47 # 71.234.244.127 +0x2192fab2 # 178.250.146.33 +0xa03a0f46 # 70.15.58.160 +0xfe3e39ae # 174.57.62.254 +0x2cce5fc1 # 193.95.206.44 +0xc8a6c148 # 72.193.166.200 +0x96fb7e4c # 76.126.251.150 +0x0a66c752 # 82.199.102.10 +0x6b4d2705 # 5.39.77.107 +0xeba0c118 # 24.193.160.235 +0x3ba0795b # 91.121.160.59 +0x1dccd23e # 62.210.204.29 +0x6912f3a2 # 162.243.18.105 +0x22f23c41 # 65.60.242.34 +0x65646b4a # 74.107.100.101 +0x8b9f8705 # 5.135.159.139 +0xeb9b9a95 # 149.154.155.235 +0x79fe6b4e # 78.107.254.121 +0x0536f447 # 71.244.54.5 +0x23224d61 # 97.77.34.35 +0x5d952ec6 # 198.46.149.93 +0x0cb4f736 # 54.247.180.12 +0xdc14be6d # 109.190.20.220 +0xb24609b0 # 176.9.70.178 +0xd3f79b62 # 98.155.247.211 +0x6518c836 # 54.200.24.101 +0x83a3cf42 # 66.207.163.131 +0x9b641fb0 # 176.31.100.155 +0x17fef1c0 # 192.241.254.23 +0xd508cc82 # 130.204.8.213 +0x91a4369b # 155.54.164.145 +0x39cb4a4c # 76.74.203.57 +0xbbc9536c # 108.83.201.187 +0xaf64c44a # 74.196.100.175 +0x605eca50 # 80.202.94.96 +0x0c6a6805 # 5.104.106.12 +0xd07e9d4e # 78.157.126.208 +0x78e6d3a2 # 162.211.230.120 +0x1b31eb6d # 109.235.49.27 +0xaa01feb2 # 178.254.1.170 +0x4603c236 # 54.194.3.70 +0x1ecba3b6 # 182.163.203.30 +0x0effe336 # 54.227.255.14 +0xc3fdcb36 # 54.203.253.195 +0xc290036f # 111.3.144.194 +0x4464692e # 46.105.100.68 +0x1aca7589 # 137.117.202.26 +0x59a9e52e # 46.229.169.89 +0x19aa7489 # 137.116.170.25 +0x2622c85e # 94.200.34.38 +0xa598d318 # 24.211.152.165 +0x438ec345 # 69.195.142.67 +0xc79619b9 # 185.25.150.199 +0xaf570360 # 96.3.87.175 +0x5098e289 # 137.226.152.80 +0x36add862 # 98.216.173.54 +0x83c1a2b2 # 178.162.193.131 +0x969d0905 # 5.9.157.150 +0xcf3d156c # 108.21.61.207 +0x49c1a445 # 69.164.193.73 +0xbd0b7562 # 98.117.11.189 +0x8fff1955 # 85.25.255.143 +0x1e51fe53 # 83.254.81.30 +0x28d6efd5 # 213.239.214.40 +0x2837cc62 # 98.204.55.40 +0x02f42d42 # 66.45.244.2 +0x070e3fb2 # 178.63.14.7 +0xbcb18705 # 5.135.177.188 +0x14a4e15b # 91.225.164.20 +0x82096844 # 68.104.9.130 +0xcfcb1c2e # 46.28.203.207 +0x37e27fc7 # 199.127.226.55 +0x07923748 # 72.55.146.7 +0x0c14bc2e # 46.188.20.12 +0x26100905 # 5.9.16.38 +0xcb7cd93e # 62.217.124.203 +0x3bc0d2c0 # 192.210.192.59 +0x97131b4c # 76.27.19.151 +0x6f1e5c17 # 23.92.30.111 +0xa7939f43 # 67.159.147.167 +0xb7a0bf58 # 88.191.160.183 +0xafa83a47 # 71.58.168.175 +0xcbb83f32 # 50.63.184.203 +0x5f321cb0 # 176.28.50.95 +0x52d6c3c7 # 199.195.214.82 +0xdeac5bc7 # 199.91.172.222 +0x2cf310cc # 204.16.243.44 +0x108a2bc3 # 195.43.138.16 +0x726fa14f # 79.161.111.114 +0x85bad2cc # 204.210.186.133 +0x459e4c90 # 144.76.158.69 +0x1a08b8d8 # 216.184.8.26 +0xcd7048c6 # 198.72.112.205 +0x6d5b4c90 # 144.76.91.109 +0xa66cfe7b # 123.254.108.166 +0xad730905 # 5.9.115.173 +0xdaac5bc7 # 199.91.172.218 +0x8417fd9f # 159.253.23.132 +0x41377432 # 50.116.55.65 +0x1f138632 # 50.134.19.31 +0x295a12b2 # 178.18.90.41 +0x7ac031b2 # 178.49.192.122 +0x3a87d295 # 149.210.135.58 +0xe219bc2e # 46.188.25.226 +0xf485d295 # 149.210.133.244 +0x137b6405 # 5.100.123.19 +0xcfffd9ad # 173.217.255.207 +0xafe20844 # 68.8.226.175 +0x32679a5f # 95.154.103.50 +0xa431c644 # 68.198.49.164 +0x0e5fce8c # 140.206.95.14 +0x305ef853 # 83.248.94.48 +0xad26ca32 # 50.202.38.173 +0xd9d21a54 # 84.26.210.217 +0xddd0d736 # 54.215.208.221 +0xc24ec0c7 # 199.192.78.194 +0x4aadcd5b # 91.205.173.74 +0x49109852 # 82.152.16.73 +0x9d6b3ac6 # 198.58.107.157 +0xf0aa1e8b # 139.30.170.240 +0xf1bfa343 # 67.163.191.241 +0x8a30c0ad # 173.192.48.138 +0x260f93d4 # 212.147.15.38 +0x2339e760 # 96.231.57.35 +0x8869959f # 159.149.105.136 +0xc207216c # 108.33.7.194 +0x29453448 # 72.52.69.41 +0xb651ec36 # 54.236.81.182 +0x45496259 # 89.98.73.69 +0xa23d1bcc # 204.27.61.162 +0xb39bcf43 # 67.207.155.179 +0xa1d29432 # 50.148.210.161 +0x3507c658 # 88.198.7.53 +0x4a88dd62 # 98.221.136.74 +0x27aff363 # 99.243.175.39 +0x7498ea6d # 109.234.152.116 +0x4a6785d5 # 213.133.103.74 +0x5e6d47c2 # 194.71.109.94 +0x3baba542 # 66.165.171.59 +0x045a37ae # 174.55.90.4 +0xa24dc0c7 # 199.192.77.162 +0xe981ea4d # 77.234.129.233 +0xed6ce217 # 23.226.108.237 +0x857214c6 # 198.20.114.133 +0x6b6c0464 # 100.4.108.107 +0x5a4945b8 # 184.69.73.90 +0x12f24742 # 66.71.242.18 +0xf35f42ad # 173.66.95.243 +0xfd0f5a4e # 78.90.15.253 +0xfb081556 # 86.21.8.251 +0xb24b5861 # 97.88.75.178 +0x2e114146 # 70.65.17.46 +0xb7780905 # 5.9.120.183 +0x33bb0e48 # 72.14.187.51 +0x39e26556 # 86.101.226.57 +0xa794484d # 77.72.148.167 +0x4225424d # 77.66.37.66 +0x3003795b # 91.121.3.48 +0x31c8cf44 # 68.207.200.49 +0xd65bad59 # 89.173.91.214 +0x127bc648 # 72.198.123.18 +0xf2bc4d4c # 76.77.188.242 +0x0273dc50 # 80.220.115.2 +0x4572d736 # 54.215.114.69 +0x064bf653 # 83.246.75.6 +0xcdcd126c # 108.18.205.205 +0x608281ae # 174.129.130.96 +0x4d130087 # 135.0.19.77 +0x1016f725 # 37.247.22.16 +0xba185fc0 # 192.95.24.186 +0x16c1a84f # 79.168.193.22 +0xfb697252 # 82.114.105.251 +0xa2942360 # 96.35.148.162 +0x53083b6c # 108.59.8.83 +0x0583f1c0 # 192.241.131.5 +0x2d5a2441 # 65.36.90.45 +0xc172aa43 # 67.170.114.193 +0xcd11cf36 # 54.207.17.205 +0x7b14ed62 # 98.237.20.123 +0x5c94f1c0 # 192.241.148.92 +0x7c23132e # 46.19.35.124 +0x39965a6f # 111.90.150.57 +0x7890e24e # 78.226.144.120 +0xa38ec447 # 71.196.142.163 +0xc187f1c0 # 192.241.135.193 +0xef80b647 # 71.182.128.239 +0xf20a7432 # 50.116.10.242 +0x7ad1d8d2 # 210.216.209.122 +0x869e2ec6 # 198.46.158.134 +0xccdb5c5d # 93.92.219.204 +0x9d11f636 # 54.246.17.157 +0x2161bb25 # 37.187.97.33 +0x7599f889 # 137.248.153.117 +0x2265ecad # 173.236.101.34 +0x0f4f0e55 # 85.14.79.15 +0x7d25854a # 74.133.37.125 +0xf857e360 # 96.227.87.248 +0xf83f3d6c # 108.61.63.248 +0x9cc93bb8 # 184.59.201.156 +0x02716857 # 87.104.113.2 +0x5dd8a177 # 119.161.216.93 +0x8adc6cd4 # 212.108.220.138 +0xe5613d46 # 70.61.97.229 +0x6a734f50 # 80.79.115.106 +0x2a5c3bae # 174.59.92.42 +0x4a04c3d1 # 209.195.4.74 +0xe4613d46 # 70.61.97.228 +0x8426f4bc # 188.244.38.132 +0x3e1b5fc0 # 192.95.27.62 +0x0d5a3c18 # 24.60.90.13 +0xd0f6d154 # 84.209.246.208 +0x21c7ff5e # 94.255.199.33 +0xeb3f3d6c # 108.61.63.235 +0x9da5edc0 # 192.237.165.157 +0x5d753b81 # 129.59.117.93 +0x0d8d53d4 # 212.83.141.13 +0x2613f018 # 24.240.19.38 +0x4443698d # 141.105.67.68 +0x8ca1edcd # 205.237.161.140 +0x10ed3f4e # 78.63.237.16 +0x789b403a # 58.64.155.120 +0x7b984a4b # 75.74.152.123 +0x964ebc25 # 37.188.78.150 +0x7520ee60 # 96.238.32.117 +0x4f4828bc # 188.40.72.79 +0x115c407d # 125.64.92.17 +0x32dd0667 # 103.6.221.50 +0xa741715e # 94.113.65.167 +0x1d3f3532 # 50.53.63.29 +0x817d1f56 # 86.31.125.129 +0x2f99a552 # 82.165.153.47 +0x6b2a5956 # 86.89.42.107 +0x8d4f4f05 # 5.79.79.141 +0xd23c1e17 # 23.30.60.210 +0x98993748 # 72.55.153.152 +0x2c92e536 # 54.229.146.44 +0x237ebdc3 # 195.189.126.35 +0xa762fb43 # 67.251.98.167 +0x32016b71 # 113.107.1.50 +0xd0e7cf79 # 121.207.231.208 +0x7d35bdd5 # 213.189.53.125 +0x53dac3d2 # 210.195.218.83 +0x31016b71 # 113.107.1.49 +0x7fb8f8ce # 206.248.184.127 +0x9a38c232 # 50.194.56.154 +0xefaa42ad # 173.66.170.239 +0x876b823d # 61.130.107.135 +0x18175347 # 71.83.23.24 +0xdb46597d # 125.89.70.219 +0xd2c168da # 218.104.193.210 +0xcd6fe9dc # 220.233.111.205 +0x45272e4e # 78.46.39.69 +0x8d4bca5b # 91.202.75.141 +0xa4043d47 # 71.61.4.164 +0xaab7aa47 # 71.170.183.170 +0x202881ae # 174.129.40.32 +0xa4aef160 # 96.241.174.164 +0xecd7e6bc # 188.230.215.236 +0x391359ad # 173.89.19.57 +0xd8cc9318 # 24.147.204.216 +0xbbeee52e # 46.229.238.187 +0x077067b0 # 176.103.112.7 +0xebd39d62 # 98.157.211.235 +0x0cedc547 # 71.197.237.12 +0x23d3e15e # 94.225.211.35 +0xa5a81318 # 24.19.168.165 +0x179a32c6 # 198.50.154.23 +0xe4d3483d # 61.72.211.228 +0x03680905 # 5.9.104.3 +0xe8018abc # 188.138.1.232 +0xdde9ef5b # 91.239.233.221 +0x438b8705 # 5.135.139.67 +0xb48224a0 # 160.36.130.180 +0xcbd69218 # 24.146.214.203 +0x9075795b # 91.121.117.144 +0xc6411c3e # 62.28.65.198 +0x03833f5c # 92.63.131.3 +0xf33f8b5e # 94.139.63.243 +0x495e464b # 75.70.94.73 +0x83c8e65b # 91.230.200.131 +0xac09cd25 # 37.205.9.172 +0xdaabc547 # 71.197.171.218 +0x7665a553 # 83.165.101.118 +0xc5263718 # 24.55.38.197 +0x2fd0c5cd # 205.197.208.47 +0x22224d61 # 97.77.34.34 +0x3e954048 # 72.64.149.62 +0xfaa37557 # 87.117.163.250 +0x36dbc658 # 88.198.219.54 +0xa81453d0 # 208.83.20.168 +0x5a941f5d # 93.31.148.90 +0xa598ea60 # 96.234.152.165 +0x65384ac6 # 198.74.56.101 +0x10aaa545 # 69.165.170.16 +0xaaab795b # 91.121.171.170 +0xdda7024c # 76.2.167.221 +0x0966f4c6 # 198.244.102.9 +0x68571c08 # 8.28.87.104 +0x8b40ee59 # 89.238.64.139 +0x33ac096c # 108.9.172.51 +0x844b4c4b # 75.76.75.132 +0xd392254d # 77.37.146.211 +0xba4d5a46 # 70.90.77.186 +0x63029653 # 83.150.2.99 +0xf655f636 # 54.246.85.246 +0xbe4c4bb1 # 177.75.76.190 +0x45dad036 # 54.208.218.69 +0x204bc052 # 82.192.75.32 +0x06c3a2b2 # 178.162.195.6 +0xf31fba6a # 106.186.31.243 +0xb21f09b0 # 176.9.31.178 +0x540d0751 # 81.7.13.84 +0xc7b46a57 # 87.106.180.199 +0x6a11795b # 91.121.17.106 +0x3d514045 # 69.64.81.61 +0x0318aa6d # 109.170.24.3 +0x30306ec3 # 195.110.48.48 +0x5c077432 # 50.116.7.92 +0x259ae46d # 109.228.154.37 +0x82bbd35f # 95.211.187.130 +0xae4222c0 # 192.34.66.174 +0x254415d4 # 212.21.68.37 +0xbd5f574b # 75.87.95.189 +0xd8fd175e # 94.23.253.216 +0x0a3f38c3 # 195.56.63.10 +0x2dce6bb8 # 184.107.206.45 +0xc201d058 # 88.208.1.194 +0x17fca5bc # 188.165.252.23 +0xe8453cca # 202.60.69.232 +0xd361f636 # 54.246.97.211 +0xa0d9edc0 # 192.237.217.160 +0x2f232e4e # 78.46.35.47 +0x134e116c # 108.17.78.19 +0x61ddc058 # 88.192.221.97 +0x05ba7283 # 131.114.186.5 +0xe1f7ed5b # 91.237.247.225 +0x040ec452 # 82.196.14.4 +0x4b672e4e # 78.46.103.75 +0xe4efa36d # 109.163.239.228 +0x47dca52e # 46.165.220.71 +0xe9332e4e # 78.46.51.233 +0xa3acb992 # 146.185.172.163 +0x24714c90 # 144.76.113.36 +0xa8cc8632 # 50.134.204.168 +0x26b1ce6d # 109.206.177.38 +0x264e53d4 # 212.83.78.38 +0xd3d2718c # 140.113.210.211 +0x225534ad # 173.52.85.34 +0xe289f3a2 # 162.243.137.226 +0x87341717 # 23.23.52.135 +0x9255ad4f # 79.173.85.146 +0x184bbb25 # 37.187.75.24 +0x885c7abc # 188.122.92.136 +0x3a6e9ac6 # 198.154.110.58 +0x1924185e # 94.24.36.25 +0xb73d4c90 # 144.76.61.183 +0x946d807a # 122.128.109.148 +0xa0d78e3f # 63.142.215.160 +0x5a16bb25 # 37.187.22.90 +0xcb09795b # 91.121.9.203 +0x8d0de657 # 87.230.13.141 +0x630b8b25 # 37.139.11.99 +0xe572c6cf # 207.198.114.229 +0x2b3f1118 # 24.17.63.43 +0x4242a91f # 31.169.66.66 +0x32990905 # 5.9.153.50 +0x058b0905 # 5.9.139.5 +0xe266fc60 # 96.252.102.226 +0xbe66c5b0 # 176.197.102.190 +0xcc98e46d # 109.228.152.204 +0x698c943e # 62.148.140.105 +0x44bd0cc3 # 195.12.189.68 +0x865c7abc # 188.122.92.134 +0x771764d3 # 211.100.23.119 +0x4675d655 # 85.214.117.70 +0x354e4826 # 38.72.78.53 +0xb67ac152 # 82.193.122.182 +0xaeccf285 # 133.242.204.174 +0xea625b4e # 78.91.98.234 +0xbcd6031f # 31.3.214.188 +0x5e81eb18 # 24.235.129.94 +0x74b347ce # 206.71.179.116 +0x3ca56ac1 # 193.106.165.60 +0x54ee4546 # 70.69.238.84 +0x38a8175e # 94.23.168.56 +0xa3c21155 # 85.17.194.163 +0x2f01576d # 109.87.1.47 +0x5d7ade50 # 80.222.122.93 +0xa003ae48 # 72.174.3.160 +0x2bc1d31f # 31.211.193.43 +0x13f5094c # 76.9.245.19 +0x7ab32648 # 72.38.179.122 +0x542e9fd5 # 213.159.46.84 +0x53136bc1 # 193.107.19.83 +0x7fdf51c0 # 192.81.223.127 +0x802197b2 # 178.151.33.128 +0xa2d2cc5b # 91.204.210.162 +0x6b5f4bc0 # 192.75.95.107 + +# Onion nodes +bitcoinostk4e4re.onion:8333 +5k4vwyy5stro33fb.onion:8333 +zy3kdqowmrb7xm7h.onion:8333 +e3tn727fywnioxrc.onion:8333 +kjy2eqzk4zwi5zd3.onion:8333 +pt2awtcs2ulm75ig.onion:8333 +td7tgof3imei3fm6.onion:8333 +czsbwh4pq4mh3izl.onion:8333 +xdnigz4qn5dbbw2t.onion:8333 +ymnsfdejmc74vcfb.onion:7033 +jxrvw5iqizppbgml.onion:8333 +bk5ejfe56xakvtkk.onion:8333 +szsm43ou7otwwyfv.onion:8333 +5ghqw4wj6hpgfvdg.onion:8333 +evolynhit7shzeet.onion:8333 +4crhf372poejlc44.onion:8333 +tfu4kqfhsw5slqp2.onion:8333 +i2r5tbaizb75h26f.onion:8333 +btcnet3utgzyz2bf.onion:8333 +vso3r6cmjoomhhgg.onion:8333 +pqosrh6wfaucet32.onion:8333 +zy3kdqowmrb7xm7h.onion:8333 +r4de4zf4lyniu4mx.onion:8444 diff --git a/share/seeds/nodes_test.txt b/share/seeds/nodes_test.txt new file mode 100644 index 0000000000..71782836fe --- /dev/null +++ b/share/seeds/nodes_test.txt @@ -0,0 +1,5 @@ +# List of fixed seed nodes for testnet + +# Onion nodes +thfsmmn2jbitcoin.onion +it2pj4f7657g3rhi.onion diff --git a/src/Makefile.am b/src/Makefile.am index 2d84eeba1c..727a88c3e7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -72,6 +72,7 @@ BITCOIN_CORE_H = \ bloom.h \ chainparams.h \ chainparamsbase.h \ + chainparamsseeds.h \ checkpoints.h \ checkqueue.h \ clientversion.h \ diff --git a/src/chainparams.cpp b/src/chainparams.cpp index fb1d05f833..f32d4ed235 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -14,88 +14,34 @@ using namespace std; using namespace boost::assign; +struct SeedSpec6 { + uint8_t addr[16]; + uint16_t port; +}; + +#include "chainparamsseeds.h" + // // Main network // -unsigned int pnSeed[] = +// Convert the pnSeeds6 array into usable address objects. +static void convertSeed6(std::vector &vSeedsOut, const SeedSpec6 *data, unsigned int count) { - 0x7e6a692e, 0x7d04d1a2, 0x6c0c17d9, 0xdb330ab9, 0xc649c7c6, 0x7895484d, 0x047109b0, 0xb90ca5bc, - 0xd130805f, 0xbd074ea6, 0x578ff1c0, 0x286e09b0, 0xd4dcaf42, 0x529b6bb8, 0x635cc6c0, 0xedde892e, - 0xa976d9c7, 0xea91a4b8, 0x03fa4eb2, 0x6ca9008d, 0xaf62c825, 0x93f3ba51, 0xc2c9efd5, 0x0ed5175e, - 0x487028bc, 0x7297c225, 0x8af0c658, 0x2e57ba1f, 0xd0098abc, 0x46a8853e, 0xcc92dc3e, 0xeb6f1955, - 0x8cce175e, 0x237281ae, 0x9d42795b, 0x4f4f0905, 0xc50151d0, 0xb1ba90c6, 0xaed7175e, 0x204de55b, - 0x4bb03245, 0x932b28bc, 0x2dcce65b, 0xe2708abc, 0x1b08b8d5, 0x12a3dc5b, 0x8a884c90, 0xa386a8b8, - 0x18e417c6, 0x2e709ac3, 0xeb62e925, 0x6f6503ae, 0x05d0814e, 0x8a9ac545, 0x946fd65e, 0x3f57495d, - 0x4a29c658, 0xad454c90, 0x15340905, 0x4c3f3b25, 0x01fe19b9, 0x5620595b, 0x443c795b, 0x44f24ac8, - 0x0442464e, 0xc8665882, 0xed3f3ec3, 0xf585bf5d, 0x5dd141da, 0xf93a084e, 0x1264dd52, 0x0711c658, - 0xf12e7bbe, 0x5b02b740, 0x7d526dd5, 0x0cb04c90, 0x2abe1132, 0x61a39f58, 0x044a0618, 0xf3af7dce, - 0xb994c96d, 0x361c5058, 0xca735d53, 0xeca743b0, 0xec790905, 0xc4d37845, 0xa1c4a2b2, 0x726fd453, - 0x625cc6c0, 0x6c20132e, 0xb7aa0c79, 0xc6ed983d, 0x47e4cbc0, 0xa4ac75d4, 0xe2e59345, 0x4d784ad0, - 0x18a5ec5e, 0x481cc85b, 0x7c6c2fd5, 0x5e4d6018, 0x5b4b6c18, 0xd99b4c90, 0xe63987dc, 0xb817bb25, - 0x141cfeb2, 0x5f005058, 0x0d987f47, 0x242a496d, 0x3e519bc0, 0x02b2454b, 0xdfaf3dc6, 0x888128bc, - 0x1165bb25, 0xabfeca5b, 0x2ef63540, 0x5773c7c6, 0x1280dd52, 0x8ebcacd9, 0x81c439c6, 0x39fcfa45, - 0x62177d41, 0xc975ed62, 0x05cff476, 0xdabda743, 0xaa1ac24e, 0xe255a22e, 0x88aac705, 0xe707c658, - 0xa9e94b5e, 0x2893484b, 0x99512705, 0xd63970ca, 0x45994f32, 0xe519a8ad, 0x92e25f5d, 0x8b84a9c1, - 0x5eaa0a05, 0xa74de55b, 0xb090ff62, 0x5eee326c, 0xc331a679, 0xc1d9b72e, 0x0c6ab982, 0x7362bb25, - 0x4cfedd42, 0x1e09a032, 0xa4c34c5e, 0x3777d9c7, 0x5edcf260, 0x3ce2b548, 0xd2ac0360, 0x2f80b992, - 0x3e4cbb25, 0x3995e236, 0xd03977ae, 0x953cf054, 0x3c654ed0, 0x74024c90, 0xa14f1155, 0x14ce0125, - 0xc15ebb6a, 0x2c08c452, 0xc7fd0652, 0x7604f8ce, 0xffb38332, 0xa4c2efd5, 0xe9614018, 0xab49e557, - 0x1648c052, 0x36024047, 0x0e8cffad, 0x21918953, 0xb61f50ad, 0x9b406b59, 0xaf282218, 0x7f1d164e, - 0x1f560da2, 0xe237be58, 0xbdeb1955, 0x6c0717d9, 0xdaf8ce62, 0x0f74246c, 0xdee95243, 0xf23f1a56, - 0x61bdf867, 0xd254c854, 0xc4422e4e, 0xae0563c0, 0xbdb9a95f, 0xa9eb32c6, 0xd9943950, 0x116add52, - 0x73a54c90, 0xb36b525e, 0xd734175e, 0x333d7f76, 0x51431bc6, 0x084ae5cf, 0xa60a236c, 0x5c67692e, - 0x0177cf45, 0xa6683ac6, 0x7ff4ea47, 0x2192fab2, 0xa03a0f46, 0xfe3e39ae, 0x2cce5fc1, 0xc8a6c148, - 0x96fb7e4c, 0x0a66c752, 0x6b4d2705, 0xeba0c118, 0x3ba0795b, 0x1dccd23e, 0x6912f3a2, 0x22f23c41, - 0x65646b4a, 0x8b9f8705, 0xeb9b9a95, 0x79fe6b4e, 0x0536f447, 0x23224d61, 0x5d952ec6, 0x0cb4f736, - 0xdc14be6d, 0xb24609b0, 0xd3f79b62, 0x6518c836, 0x83a3cf42, 0x9b641fb0, 0x17fef1c0, 0xd508cc82, - 0x91a4369b, 0x39cb4a4c, 0xbbc9536c, 0xaf64c44a, 0x605eca50, 0x0c6a6805, 0xd07e9d4e, 0x78e6d3a2, - 0x1b31eb6d, 0xaa01feb2, 0x4603c236, 0x1ecba3b6, 0x0effe336, 0xc3fdcb36, 0xc290036f, 0x4464692e, - 0x1aca7589, 0x59a9e52e, 0x19aa7489, 0x2622c85e, 0xa598d318, 0x438ec345, 0xc79619b9, 0xaf570360, - 0x5098e289, 0x36add862, 0x83c1a2b2, 0x969d0905, 0xcf3d156c, 0x49c1a445, 0xbd0b7562, 0x8fff1955, - 0x1e51fe53, 0x28d6efd5, 0x2837cc62, 0x02f42d42, 0x070e3fb2, 0xbcb18705, 0x14a4e15b, 0x82096844, - 0xcfcb1c2e, 0x37e27fc7, 0x07923748, 0x0c14bc2e, 0x26100905, 0xcb7cd93e, 0x3bc0d2c0, 0x97131b4c, - 0x6f1e5c17, 0xa7939f43, 0xb7a0bf58, 0xafa83a47, 0xcbb83f32, 0x5f321cb0, 0x52d6c3c7, 0xdeac5bc7, - 0x2cf310cc, 0x108a2bc3, 0x726fa14f, 0x85bad2cc, 0x459e4c90, 0x1a08b8d8, 0xcd7048c6, 0x6d5b4c90, - 0xa66cfe7b, 0xad730905, 0xdaac5bc7, 0x8417fd9f, 0x41377432, 0x1f138632, 0x295a12b2, 0x7ac031b2, - 0x3a87d295, 0xe219bc2e, 0xf485d295, 0x137b6405, 0xcfffd9ad, 0xafe20844, 0x32679a5f, 0xa431c644, - 0x0e5fce8c, 0x305ef853, 0xad26ca32, 0xd9d21a54, 0xddd0d736, 0xc24ec0c7, 0x4aadcd5b, 0x49109852, - 0x9d6b3ac6, 0xf0aa1e8b, 0xf1bfa343, 0x8a30c0ad, 0x260f93d4, 0x2339e760, 0x8869959f, 0xc207216c, - 0x29453448, 0xb651ec36, 0x45496259, 0xa23d1bcc, 0xb39bcf43, 0xa1d29432, 0x3507c658, 0x4a88dd62, - 0x27aff363, 0x7498ea6d, 0x4a6785d5, 0x5e6d47c2, 0x3baba542, 0x045a37ae, 0xa24dc0c7, 0xe981ea4d, - 0xed6ce217, 0x857214c6, 0x6b6c0464, 0x5a4945b8, 0x12f24742, 0xf35f42ad, 0xfd0f5a4e, 0xfb081556, - 0xb24b5861, 0x2e114146, 0xb7780905, 0x33bb0e48, 0x39e26556, 0xa794484d, 0x4225424d, 0x3003795b, - 0x31c8cf44, 0xd65bad59, 0x127bc648, 0xf2bc4d4c, 0x0273dc50, 0x4572d736, 0x064bf653, 0xcdcd126c, - 0x608281ae, 0x4d130087, 0x1016f725, 0xba185fc0, 0x16c1a84f, 0xfb697252, 0xa2942360, 0x53083b6c, - 0x0583f1c0, 0x2d5a2441, 0xc172aa43, 0xcd11cf36, 0x7b14ed62, 0x5c94f1c0, 0x7c23132e, 0x39965a6f, - 0x7890e24e, 0xa38ec447, 0xc187f1c0, 0xef80b647, 0xf20a7432, 0x7ad1d8d2, 0x869e2ec6, 0xccdb5c5d, - 0x9d11f636, 0x2161bb25, 0x7599f889, 0x2265ecad, 0x0f4f0e55, 0x7d25854a, 0xf857e360, 0xf83f3d6c, - 0x9cc93bb8, 0x02716857, 0x5dd8a177, 0x8adc6cd4, 0xe5613d46, 0x6a734f50, 0x2a5c3bae, 0x4a04c3d1, - 0xe4613d46, 0x8426f4bc, 0x3e1b5fc0, 0x0d5a3c18, 0xd0f6d154, 0x21c7ff5e, 0xeb3f3d6c, 0x9da5edc0, - 0x5d753b81, 0x0d8d53d4, 0x2613f018, 0x4443698d, 0x8ca1edcd, 0x10ed3f4e, 0x789b403a, 0x7b984a4b, - 0x964ebc25, 0x7520ee60, 0x4f4828bc, 0x115c407d, 0x32dd0667, 0xa741715e, 0x1d3f3532, 0x817d1f56, - 0x2f99a552, 0x6b2a5956, 0x8d4f4f05, 0xd23c1e17, 0x98993748, 0x2c92e536, 0x237ebdc3, 0xa762fb43, - 0x32016b71, 0xd0e7cf79, 0x7d35bdd5, 0x53dac3d2, 0x31016b71, 0x7fb8f8ce, 0x9a38c232, 0xefaa42ad, - 0x876b823d, 0x18175347, 0xdb46597d, 0xd2c168da, 0xcd6fe9dc, 0x45272e4e, 0x8d4bca5b, 0xa4043d47, - 0xaab7aa47, 0x202881ae, 0xa4aef160, 0xecd7e6bc, 0x391359ad, 0xd8cc9318, 0xbbeee52e, 0x077067b0, - 0xebd39d62, 0x0cedc547, 0x23d3e15e, 0xa5a81318, 0x179a32c6, 0xe4d3483d, 0x03680905, 0xe8018abc, - 0xdde9ef5b, 0x438b8705, 0xb48224a0, 0xcbd69218, 0x9075795b, 0xc6411c3e, 0x03833f5c, 0xf33f8b5e, - 0x495e464b, 0x83c8e65b, 0xac09cd25, 0xdaabc547, 0x7665a553, 0xc5263718, 0x2fd0c5cd, 0x22224d61, - 0x3e954048, 0xfaa37557, 0x36dbc658, 0xa81453d0, 0x5a941f5d, 0xa598ea60, 0x65384ac6, 0x10aaa545, - 0xaaab795b, 0xdda7024c, 0x0966f4c6, 0x68571c08, 0x8b40ee59, 0x33ac096c, 0x844b4c4b, 0xd392254d, - 0xba4d5a46, 0x63029653, 0xf655f636, 0xbe4c4bb1, 0x45dad036, 0x204bc052, 0x06c3a2b2, 0xf31fba6a, - 0xb21f09b0, 0x540d0751, 0xc7b46a57, 0x6a11795b, 0x3d514045, 0x0318aa6d, 0x30306ec3, 0x5c077432, - 0x259ae46d, 0x82bbd35f, 0xae4222c0, 0x254415d4, 0xbd5f574b, 0xd8fd175e, 0x0a3f38c3, 0x2dce6bb8, - 0xc201d058, 0x17fca5bc, 0xe8453cca, 0xd361f636, 0xa0d9edc0, 0x2f232e4e, 0x134e116c, 0x61ddc058, - 0x05ba7283, 0xe1f7ed5b, 0x040ec452, 0x4b672e4e, 0xe4efa36d, 0x47dca52e, 0xe9332e4e, 0xa3acb992, - 0x24714c90, 0xa8cc8632, 0x26b1ce6d, 0x264e53d4, 0xd3d2718c, 0x225534ad, 0xe289f3a2, 0x87341717, - 0x9255ad4f, 0x184bbb25, 0x885c7abc, 0x3a6e9ac6, 0x1924185e, 0xb73d4c90, 0x946d807a, 0xa0d78e3f, - 0x5a16bb25, 0xcb09795b, 0x8d0de657, 0x630b8b25, 0xe572c6cf, 0x2b3f1118, 0x4242a91f, 0x32990905, - 0x058b0905, 0xe266fc60, 0xbe66c5b0, 0xcc98e46d, 0x698c943e, 0x44bd0cc3, 0x865c7abc, 0x771764d3, - 0x4675d655, 0x354e4826, 0xb67ac152, 0xaeccf285, 0xea625b4e, 0xbcd6031f, 0x5e81eb18, 0x74b347ce, - 0x3ca56ac1, 0x54ee4546, 0x38a8175e, 0xa3c21155, 0x2f01576d, 0x5d7ade50, 0xa003ae48, 0x2bc1d31f, - 0x13f5094c, 0x7ab32648, 0x542e9fd5, 0x53136bc1, 0x7fdf51c0, 0x802197b2, 0xa2d2cc5b, 0x6b5f4bc0, -}; + // It'll only connect to one or two seed nodes because once it connects, + // it'll get a pile of addresses with newer timestamps. + // Seed nodes are given a random 'last seen time' of between one and two + // weeks ago. + const int64_t nOneWeek = 7*24*60*60; + for (unsigned int i = 0; i < count; i++) + { + struct in6_addr ip; + memcpy(&ip, data[i].addr, sizeof(ip)); + CAddress addr(CService(ip, data[i].port)); + addr.nTime = GetTime() - GetRand(nOneWeek) - nOneWeek; + vSeedsOut.push_back(addr); + } +} class CMainParams : public CChainParams { public: @@ -161,20 +107,7 @@ public: base58Prefixes[EXT_PUBLIC_KEY] = list_of(0x04)(0x88)(0xB2)(0x1E); base58Prefixes[EXT_SECRET_KEY] = list_of(0x04)(0x88)(0xAD)(0xE4); - // Convert the pnSeeds array into usable address objects. - for (unsigned int i = 0; i < ARRAYLEN(pnSeed); i++) - { - // It'll only connect to one or two seed nodes because once it connects, - // it'll get a pile of addresses with newer timestamps. - // Seed nodes are given a random 'last seen time' of between one and two - // weeks ago. - const int64_t nOneWeek = 7*24*60*60; - struct in_addr ip; - memcpy(&ip, &pnSeed[i], sizeof(ip)); - CAddress addr(CService(ip, GetDefaultPort())); - addr.nTime = GetTime() - GetRand(nOneWeek) - nOneWeek; - vFixedSeeds.push_back(addr); - } + convertSeed6(vFixedSeeds, pnSeed6_main, ARRAYLEN(pnSeed6_main)); fRequireRPCPassword = true; fMiningRequiresPeers = true; @@ -189,6 +122,7 @@ static CMainParams mainParams; // // Testnet (v3) // + class CTestNetParams : public CMainParams { public: CTestNetParams() { @@ -228,6 +162,8 @@ public: base58Prefixes[EXT_PUBLIC_KEY] = list_of(0x04)(0x35)(0x87)(0xCF); base58Prefixes[EXT_SECRET_KEY] = list_of(0x04)(0x35)(0x83)(0x94); + convertSeed6(vFixedSeeds, pnSeed6_test, ARRAYLEN(pnSeed6_test)); + fRequireRPCPassword = true; fMiningRequiresPeers = true; fDefaultCheckMemPool = false; diff --git a/src/chainparamsseeds.h b/src/chainparamsseeds.h new file mode 100644 index 0000000000..3f3278361e --- /dev/null +++ b/src/chainparamsseeds.h @@ -0,0 +1,638 @@ +#ifndef H_CHAINPARAMSSEEDS +#define H_CHAINPARAMSSEEDS +// List of fixed seed nodes for the bitcoin network +// AUTOGENERATED by contrib/devtools/generate-seeds.py + +// Each line contains a 16-byte IPv6 address and a port. +// IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly. +static SeedSpec6 pnSeed6_main[] = { + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x69,0x6a,0x7e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa2,0xd1,0x04,0x7d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd9,0x17,0x0c,0x6c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x0a,0x33,0xdb}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0xc7,0x49,0xc6}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4d,0x48,0x95,0x78}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0x09,0x71,0x04}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0xa5,0x0c,0xb9}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0x80,0x30,0xd1}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa6,0x4e,0x07,0xbd}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xf1,0x8f,0x57}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0x09,0x6e,0x28}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x42,0xaf,0xdc,0xd4}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb8,0x6b,0x9b,0x52}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xc6,0x5c,0x63}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x89,0xde,0xed}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0xd9,0x76,0xa9}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb8,0xa4,0x91,0xea}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0x4e,0xfa,0x03}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8d,0x00,0xa9,0x6c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0xc8,0x62,0xaf}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x51,0xba,0xf3,0x93}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0xef,0xc9,0xc2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0x17,0xd5,0x0e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0x28,0x70,0x48}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0xc2,0x97,0x72}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0xc6,0xf0,0x8a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x1f,0xba,0x57,0x2e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0x8a,0x09,0xd0}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0x85,0xa8,0x46}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0xdc,0x92,0xcc}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0x19,0x6f,0xeb}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0x17,0xce,0x8c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xae,0x81,0x72,0x23}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x79,0x42,0x9d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x09,0x4f,0x4f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd0,0x51,0x01,0xc5}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x90,0xba,0xb1}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0x17,0xd7,0xae}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xe5,0x4d,0x20}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x45,0x32,0xb0,0x4b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0x28,0x2b,0x93}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xe6,0xcc,0x2d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0x8a,0x70,0xe2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0xb8,0x08,0x1b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xdc,0xa3,0x12}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0x4c,0x88,0x8a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb8,0xa8,0x86,0xa3}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x17,0xe4,0x18}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0x9a,0x70,0x2e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0xe9,0x62,0xeb}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xae,0x03,0x65,0x6f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x81,0xd0,0x05}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x45,0xc5,0x9a,0x8a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0xd6,0x6f,0x94}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5d,0x49,0x57,0x3f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0xc6,0x29,0x4a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0x4c,0x45,0xad}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x09,0x34,0x15}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0x3b,0x3f,0x4c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x19,0xfe,0x01}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x59,0x20,0x56}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x79,0x3c,0x44}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc8,0x4a,0xf2,0x44}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x46,0x42,0x04}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x82,0x58,0x66,0xc8}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0x3e,0x3f,0xed}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5d,0xbf,0x85,0xf5}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xda,0x41,0xd1,0x5d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x08,0x3a,0xf9}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xdd,0x64,0x12}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0xc6,0x11,0x07}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbe,0x7b,0x2e,0xf1}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x40,0xb7,0x02,0x5b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0x6d,0x52,0x7d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0x4c,0xb0,0x0c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0x11,0xbe,0x2a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0x9f,0xa3,0x61}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0x06,0x4a,0x04}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xce,0x7d,0xaf,0xf3}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0xc9,0x94,0xb9}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0x50,0x1c,0x36}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0x5d,0x73,0xca}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0x43,0xa7,0xec}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x09,0x79,0xec}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x45,0x78,0xd3,0xc4}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0xa2,0xc4,0xa1}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0xd4,0x6f,0x72}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xc6,0x5c,0x62}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x13,0x20,0x6c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x79,0x0c,0xaa,0xb7}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3d,0x98,0xed,0xc6}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xcb,0xe4,0x47}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0x75,0xac,0xa4}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x45,0x93,0xe5,0xe2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd0,0x4a,0x78,0x4d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0xec,0xa5,0x18}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xc8,0x1c,0x48}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0x2f,0x6c,0x7c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0x60,0x4d,0x5e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0x6c,0x4b,0x5b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0x4c,0x9b,0xd9}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xdc,0x87,0x39,0xe6}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0xbb,0x17,0xb8}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0xfe,0x1c,0x14}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0x50,0x00,0x5f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0x7f,0x98,0x0d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0x49,0x2a,0x24}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0x9b,0x51,0x3e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4b,0x45,0xb2,0x02}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x3d,0xaf,0xdf}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0x28,0x81,0x88}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0xbb,0x65,0x11}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xca,0xfe,0xab}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x40,0x35,0xf6,0x2e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0xc7,0x73,0x57}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xdd,0x80,0x12}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd9,0xac,0xbc,0x8e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x39,0xc4,0x81}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x45,0xfa,0xfc,0x39}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x41,0x7d,0x17,0x62}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x62,0xed,0x75,0xc9}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x76,0xf4,0xcf,0x05}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x43,0xa7,0xbd,0xda}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0xc2,0x1a,0xaa}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0xa2,0x55,0xe2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0xc7,0xaa,0x88}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0xc6,0x07,0xe7}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0x4b,0xe9,0xa9}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4b,0x48,0x93,0x28}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x27,0x51,0x99}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xca,0x70,0x39,0xd6}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0x4f,0x99,0x45}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0xa8,0x19,0xe5}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5d,0x5f,0xe2,0x92}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc1,0xa9,0x84,0x8b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x0a,0xaa,0x5e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xe5,0x4d,0xa7}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x62,0xff,0x90,0xb0}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6c,0x32,0xee,0x5e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x79,0xa6,0x31,0xc3}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0xb7,0xd9,0xc1}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x82,0xb9,0x6a,0x0c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0xbb,0x62,0x73}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x42,0xdd,0xfe,0x4c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0xa0,0x09,0x1e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0x4c,0xc3,0xa4}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0xd9,0x77,0x37}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x60,0xf2,0xdc,0x5e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0xb5,0xe2,0x3c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x60,0x03,0xac,0xd2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x92,0xb9,0x80,0x2f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0xbb,0x4c,0x3e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0xe2,0x95,0x39}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xae,0x77,0x39,0xd0}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x54,0xf0,0x3c,0x95}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd0,0x4e,0x65,0x3c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0x4c,0x02,0x74}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0x11,0x4f,0xa1}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0x01,0xce,0x14}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6a,0xbb,0x5e,0xc1}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xc4,0x08,0x2c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0x06,0xfd,0xc7}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xce,0xf8,0x04,0x76}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0x83,0xb3,0xff}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0xef,0xc2,0xa4}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0x40,0x61,0xe9}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x57,0xe5,0x49,0xab}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xc0,0x48,0x16}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0x40,0x02,0x36}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0xff,0x8c,0x0e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0x89,0x91,0x21}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0x50,0x1f,0xb6}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0x6b,0x40,0x9b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0x22,0x28,0xaf}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x16,0x1d,0x7f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa2,0x0d,0x56,0x1f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0xbe,0x37,0xe2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0x19,0xeb,0xbd}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd9,0x17,0x07,0x6c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x62,0xce,0xf8,0xda}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6c,0x24,0x74,0x0f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x43,0x52,0xe9,0xde}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x56,0x1a,0x3f,0xf2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0xf8,0xbd,0x61}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x54,0xc8,0x54,0xd2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x2e,0x42,0xc4}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0x63,0x05,0xae}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xa9,0xb9,0xbd}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x32,0xeb,0xa9}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x50,0x39,0x94,0xd9}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xdd,0x6a,0x11}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0x4c,0xa5,0x73}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0x52,0x6b,0xb3}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0x17,0x34,0xd7}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x76,0x7f,0x3d,0x33}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x1b,0x43,0x51}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xcf,0xe5,0x4a,0x08}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6c,0x23,0x0a,0xa6}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x69,0x67,0x5c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x45,0xcf,0x77,0x01}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x3a,0x68,0xa6}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0xea,0xf4,0x7f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0xfa,0x92,0x21}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x46,0x0f,0x3a,0xa0}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xae,0x39,0x3e,0xfe}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc1,0x5f,0xce,0x2c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0xc1,0xa6,0xc8}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4c,0x7e,0xfb,0x96}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xc7,0x66,0x0a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x27,0x4d,0x6b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0xc1,0xa0,0xeb}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x79,0xa0,0x3b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0xd2,0xcc,0x1d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa2,0xf3,0x12,0x69}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x41,0x3c,0xf2,0x22}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4a,0x6b,0x64,0x65}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x87,0x9f,0x8b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x95,0x9a,0x9b,0xeb}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x6b,0xfe,0x79}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0xf4,0x36,0x05}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x61,0x4d,0x22,0x23}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x2e,0x95,0x5d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0xf7,0xb4,0x0c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0xbe,0x14,0xdc}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0x09,0x46,0xb2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x62,0x9b,0xf7,0xd3}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0xc8,0x18,0x65}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x42,0xcf,0xa3,0x83}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0x1f,0x64,0x9b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xf1,0xfe,0x17}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x82,0xcc,0x08,0xd5}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9b,0x36,0xa4,0x91}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4c,0x4a,0xcb,0x39}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6c,0x53,0xc9,0xbb}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4a,0xc4,0x64,0xaf}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x50,0xca,0x5e,0x60}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x68,0x6a,0x0c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x9d,0x7e,0xd0}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa2,0xd3,0xe6,0x78}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0xeb,0x31,0x1b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0xfe,0x01,0xaa}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0xc2,0x03,0x46}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb6,0xa3,0xcb,0x1e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0xe3,0xff,0x0e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0xcb,0xfd,0xc3}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6f,0x03,0x90,0xc2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x69,0x64,0x44}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x89,0x75,0xca,0x1a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0xe5,0xa9,0x59}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x89,0x74,0xaa,0x19}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0xc8,0x22,0x26}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0xd3,0x98,0xa5}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x45,0xc3,0x8e,0x43}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x19,0x96,0xc7}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x60,0x03,0x57,0xaf}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x89,0xe2,0x98,0x50}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x62,0xd8,0xad,0x36}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0xa2,0xc1,0x83}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x09,0x9d,0x96}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6c,0x15,0x3d,0xcf}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x45,0xa4,0xc1,0x49}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x62,0x75,0x0b,0xbd}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0x19,0xff,0x8f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0xfe,0x51,0x1e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0xef,0xd6,0x28}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x62,0xcc,0x37,0x28}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x42,0x2d,0xf4,0x02}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0x3f,0x0e,0x07}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x87,0xb1,0xbc}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xe1,0xa4,0x14}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x44,0x68,0x09,0x82}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x1c,0xcb,0xcf}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0x7f,0xe2,0x37}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0x37,0x92,0x07}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0xbc,0x14,0x0c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x09,0x10,0x26}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0xd9,0x7c,0xcb}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xd2,0xc0,0x3b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4c,0x1b,0x13,0x97}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x17,0x5c,0x1e,0x6f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x43,0x9f,0x93,0xa7}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0xbf,0xa0,0xb7}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0x3a,0xa8,0xaf}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0x3f,0xb8,0xcb}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0x1c,0x32,0x5f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0xc3,0xd6,0x52}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0x5b,0xac,0xde}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xcc,0x10,0xf3,0x2c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0x2b,0x8a,0x10}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4f,0xa1,0x6f,0x72}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xcc,0xd2,0xba,0x85}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0x4c,0x9e,0x45}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd8,0xb8,0x08,0x1a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x48,0x70,0xcd}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0x4c,0x5b,0x6d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x7b,0xfe,0x6c,0xa6}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x09,0x73,0xad}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0x5b,0xac,0xda}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9f,0xfd,0x17,0x84}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0x74,0x37,0x41}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0x86,0x13,0x1f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0x12,0x5a,0x29}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0x31,0xc0,0x7a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x95,0xd2,0x87,0x3a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0xbc,0x19,0xe2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x95,0xd2,0x85,0xf4}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x64,0x7b,0x13}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0xd9,0xff,0xcf}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x44,0x08,0xe2,0xaf}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0x9a,0x67,0x32}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x44,0xc6,0x31,0xa4}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8c,0xce,0x5f,0x0e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0xf8,0x5e,0x30}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0xca,0x26,0xad}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x54,0x1a,0xd2,0xd9}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0xd7,0xd0,0xdd}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0xc0,0x4e,0xc2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xcd,0xad,0x4a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0x98,0x10,0x49}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x3a,0x6b,0x9d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8b,0x1e,0xaa,0xf0}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x43,0xa3,0xbf,0xf1}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0xc0,0x30,0x8a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0x93,0x0f,0x26}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x60,0xe7,0x39,0x23}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9f,0x95,0x69,0x88}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6c,0x21,0x07,0xc2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0x34,0x45,0x29}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0xec,0x51,0xb6}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0x62,0x49,0x45}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xcc,0x1b,0x3d,0xa2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x43,0xcf,0x9b,0xb3}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0x94,0xd2,0xa1}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0xc6,0x07,0x35}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x62,0xdd,0x88,0x4a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x63,0xf3,0xaf,0x27}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0xea,0x98,0x74}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0x85,0x67,0x4a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc2,0x47,0x6d,0x5e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x42,0xa5,0xab,0x3b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xae,0x37,0x5a,0x04}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0xc0,0x4d,0xa2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4d,0xea,0x81,0xe9}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x17,0xe2,0x6c,0xed}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x14,0x72,0x85}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x64,0x04,0x6c,0x6b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb8,0x45,0x49,0x5a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x42,0x47,0xf2,0x12}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0x42,0x5f,0xf3}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x5a,0x0f,0xfd}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x56,0x15,0x08,0xfb}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x61,0x58,0x4b,0xb2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x46,0x41,0x11,0x2e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x09,0x78,0xb7}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0x0e,0xbb,0x33}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x56,0x65,0xe2,0x39}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4d,0x48,0x94,0xa7}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4d,0x42,0x25,0x42}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x79,0x03,0x30}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x44,0xcf,0xc8,0x31}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0xad,0x5b,0xd6}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0xc6,0x7b,0x12}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4c,0x4d,0xbc,0xf2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x50,0xdc,0x73,0x02}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0xd7,0x72,0x45}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0xf6,0x4b,0x06}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6c,0x12,0xcd,0xcd}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xae,0x81,0x82,0x60}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x87,0x00,0x13,0x4d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0xf7,0x16,0x10}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0x5f,0x18,0xba}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4f,0xa8,0xc1,0x16}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0x72,0x69,0xfb}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x60,0x23,0x94,0xa2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6c,0x3b,0x08,0x53}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xf1,0x83,0x05}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x41,0x24,0x5a,0x2d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x43,0xaa,0x72,0xc1}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0xcf,0x11,0xcd}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x62,0xed,0x14,0x7b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xf1,0x94,0x5c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x13,0x23,0x7c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6f,0x5a,0x96,0x39}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0xe2,0x90,0x78}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0xc4,0x8e,0xa3}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xf1,0x87,0xc1}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0xb6,0x80,0xef}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0x74,0x0a,0xf2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd2,0xd8,0xd1,0x7a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x2e,0x9e,0x86}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5d,0x5c,0xdb,0xcc}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0xf6,0x11,0x9d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0xbb,0x61,0x21}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x89,0xf8,0x99,0x75}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0xec,0x65,0x22}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0x0e,0x4f,0x0f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4a,0x85,0x25,0x7d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x60,0xe3,0x57,0xf8}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6c,0x3d,0x3f,0xf8}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb8,0x3b,0xc9,0x9c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x57,0x68,0x71,0x02}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x77,0xa1,0xd8,0x5d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0x6c,0xdc,0x8a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x46,0x3d,0x61,0xe5}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x50,0x4f,0x73,0x6a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xae,0x3b,0x5c,0x2a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd1,0xc3,0x04,0x4a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x46,0x3d,0x61,0xe4}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0xf4,0x26,0x84}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0x5f,0x1b,0x3e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0x3c,0x5a,0x0d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x54,0xd1,0xf6,0xd0}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0xff,0xc7,0x21}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6c,0x3d,0x3f,0xeb}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xed,0xa5,0x9d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x81,0x3b,0x75,0x5d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0x53,0x8d,0x0d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0xf0,0x13,0x26}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8d,0x69,0x43,0x44}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xcd,0xed,0xa1,0x8c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x3f,0xed,0x10}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3a,0x40,0x9b,0x78}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4b,0x4a,0x98,0x7b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0xbc,0x4e,0x96}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x60,0xee,0x20,0x75}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0x28,0x48,0x4f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x7d,0x40,0x5c,0x11}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0x06,0xdd,0x32}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0x71,0x41,0xa7}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0x35,0x3f,0x1d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x56,0x1f,0x7d,0x81}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xa5,0x99,0x2f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x56,0x59,0x2a,0x6b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x4f,0x4f,0x8d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x17,0x1e,0x3c,0xd2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0x37,0x99,0x98}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0xe5,0x92,0x2c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0xbd,0x7e,0x23}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x43,0xfb,0x62,0xa7}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x71,0x6b,0x01,0x32}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x79,0xcf,0xe7,0xd0}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0xbd,0x35,0x7d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd2,0xc3,0xda,0x53}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x71,0x6b,0x01,0x31}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xce,0xf8,0xb8,0x7f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0xc2,0x38,0x9a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0x42,0xaa,0xef}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3d,0x82,0x6b,0x87}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0x53,0x17,0x18}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x7d,0x59,0x46,0xdb}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xda,0x68,0xc1,0xd2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xdc,0xe9,0x6f,0xcd}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x2e,0x27,0x45}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xca,0x4b,0x8d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0x3d,0x04,0xa4}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0xaa,0xb7,0xaa}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xae,0x81,0x28,0x20}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x60,0xf1,0xae,0xa4}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0xe6,0xd7,0xec}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0x59,0x13,0x39}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0x93,0xcc,0xd8}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0xe5,0xee,0xbb}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0x67,0x70,0x07}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x62,0x9d,0xd3,0xeb}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0xc5,0xed,0x0c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0xe1,0xd3,0x23}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0x13,0xa8,0xa5}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x32,0x9a,0x17}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3d,0x48,0xd3,0xe4}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x09,0x68,0x03}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0x8a,0x01,0xe8}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xef,0xe9,0xdd}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x87,0x8b,0x43}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa0,0x24,0x82,0xb4}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0x92,0xd6,0xcb}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x79,0x75,0x90}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0x1c,0x41,0xc6}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5c,0x3f,0x83,0x03}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0x8b,0x3f,0xf3}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4b,0x46,0x5e,0x49}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xe6,0xc8,0x83}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0xcd,0x09,0xac}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0xc5,0xab,0xda}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0xa5,0x65,0x76}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0x37,0x26,0xc5}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xcd,0xc5,0xd0,0x2f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x61,0x4d,0x22,0x22}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0x40,0x95,0x3e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x57,0x75,0xa3,0xfa}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0xc6,0xdb,0x36}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd0,0x53,0x14,0xa8}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5d,0x1f,0x94,0x5a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x60,0xea,0x98,0xa5}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x4a,0x38,0x65}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x45,0xa5,0xaa,0x10}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x79,0xab,0xaa}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4c,0x02,0xa7,0xdd}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0xf4,0x66,0x09}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x08,0x1c,0x57,0x68}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0xee,0x40,0x8b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6c,0x09,0xac,0x33}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4b,0x4c,0x4b,0x84}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4d,0x25,0x92,0xd3}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x46,0x5a,0x4d,0xba}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0x96,0x02,0x63}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0xf6,0x55,0xf6}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb1,0x4b,0x4c,0xbe}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0xd0,0xda,0x45}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xc0,0x4b,0x20}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0xa2,0xc3,0x06}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6a,0xba,0x1f,0xf3}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0x09,0x1f,0xb2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x51,0x07,0x0d,0x54}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x57,0x6a,0xb4,0xc7}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x79,0x11,0x6a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x45,0x40,0x51,0x3d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0xaa,0x18,0x03}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0x6e,0x30,0x30}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0x74,0x07,0x5c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0xe4,0x9a,0x25}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xd3,0xbb,0x82}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0x22,0x42,0xae}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0x15,0x44,0x25}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4b,0x57,0x5f,0xbd}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0x17,0xfd,0xd8}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0x38,0x3f,0x0a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb8,0x6b,0xce,0x2d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0xd0,0x01,0xc2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0xa5,0xfc,0x17}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xca,0x3c,0x45,0xe8}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0xf6,0x61,0xd3}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xed,0xd9,0xa0}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x2e,0x23,0x2f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6c,0x11,0x4e,0x13}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0xc0,0xdd,0x61}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x83,0x72,0xba,0x05}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xed,0xf7,0xe1}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xc4,0x0e,0x04}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x2e,0x67,0x4b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0xa3,0xef,0xe4}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0xa5,0xdc,0x47}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x2e,0x33,0xe9}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x92,0xb9,0xac,0xa3}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0x4c,0x71,0x24}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x32,0x86,0xcc,0xa8}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0xce,0xb1,0x26}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0x53,0x4e,0x26}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8c,0x71,0xd2,0xd3}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0x34,0x55,0x22}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa2,0xf3,0x89,0xe2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x17,0x17,0x34,0x87}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4f,0xad,0x55,0x92}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0xbb,0x4b,0x18}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0x7a,0x5c,0x88}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x9a,0x6e,0x3a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0x18,0x24,0x19}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0x4c,0x3d,0xb7}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x7a,0x80,0x6d,0x94}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3f,0x8e,0xd7,0xa0}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0xbb,0x16,0x5a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x79,0x09,0xcb}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x57,0xe6,0x0d,0x8d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0x8b,0x0b,0x63}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xcf,0xc6,0x72,0xe5}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0x11,0x3f,0x2b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x1f,0xa9,0x42,0x42}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x09,0x99,0x32}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x09,0x8b,0x05}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x60,0xfc,0x66,0xe2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0xc5,0x66,0xbe}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0xe4,0x98,0xcc}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0x94,0x8c,0x69}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0x0c,0xbd,0x44}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0x7a,0x5c,0x86}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd3,0x64,0x17,0x77}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0xd6,0x75,0x46}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x26,0x48,0x4e,0x35}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xc1,0x7a,0xb6}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x85,0xf2,0xcc,0xae}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x5b,0x62,0xea}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x1f,0x03,0xd6,0xbc}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0xeb,0x81,0x5e}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xce,0x47,0xb3,0x74}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc1,0x6a,0xa5,0x3c}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x46,0x45,0xee,0x54}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0x17,0xa8,0x38}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0x11,0xc2,0xa3}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0x57,0x01,0x2f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x50,0xde,0x7a,0x5d}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0xae,0x03,0xa0}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x1f,0xd3,0xc1,0x2b}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4c,0x09,0xf5,0x13}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0x26,0xb3,0x7a}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0x9f,0x2e,0x54}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc1,0x6b,0x13,0x53}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0x51,0xdf,0x7f}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0x97,0x21,0x80}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xcc,0xd2,0xa2}, 8333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0x4b,0x5f,0x6b}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x0a,0x26,0x27,0x21,0xae,0x94,0xd5,0xc2,0x72,0x24}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xea,0xb9,0x5b,0x63,0x1d,0x94,0xe2,0xed,0xec,0xa1}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xce,0x36,0xa1,0xc1,0xd6,0x64,0x43,0xfb,0xb3,0xe7}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x26,0xe6,0xdf,0xeb,0xe5,0xc5,0x9a,0x87,0x5e,0x22}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x52,0x71,0xa2,0x43,0x2a,0xe6,0x6c,0x8e,0xe4,0x7b}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x7c,0xf4,0x0b,0x4c,0x52,0xd5,0x16,0xcf,0xf5,0x06}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x98,0xff,0x33,0x38,0xbb,0x43,0x08,0x8d,0x95,0x9e}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x16,0x64,0x1b,0x1f,0x8f,0x87,0x18,0x7d,0xa3,0x2b}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xb8,0xda,0x83,0x67,0x90,0x6f,0x46,0x10,0xdb,0x53}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xc3,0x1b,0x22,0x8c,0x89,0x60,0xbf,0xca,0x88,0xa1}, 7033}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x4d,0xe3,0x5b,0x75,0x10,0x46,0x5e,0xf0,0x99,0x8b}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x0a,0xba,0x44,0x94,0x9d,0xf5,0xc0,0xaa,0xcd,0x4a}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x96,0x64,0xce,0x6d,0xd4,0xfb,0xa7,0x6b,0x60,0xb5}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xe9,0x8f,0x0b,0x72,0xc9,0xf1,0xde,0x62,0xd4,0x66}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x25,0x5c,0xbc,0x34,0xe8,0x9f,0xe4,0x7c,0x90,0x93}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xe0,0xa2,0x72,0xef,0xfa,0x7b,0x88,0x95,0x8b,0x9c}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x99,0x69,0xc5,0x40,0xa7,0x95,0xbb,0x25,0xc1,0xfa}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x46,0xa3,0xd9,0x84,0x08,0xc8,0x7f,0xd3,0xeb,0xc5}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x0c,0xc4,0xd2,0x4f,0x74,0x99,0xb3,0x8c,0xe8,0x25}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xac,0x9d,0xb8,0xf8,0x4c,0x4b,0x9c,0xc3,0x9c,0xc6}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x7c,0x1d,0x28,0x9f,0xd6,0x28,0x28,0x22,0x4f,0x7a}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0xce,0x36,0xa1,0xc1,0xd6,0x64,0x43,0xfb,0xb3,0xe7}, 8333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x8f,0x06,0x4e,0x64,0xbc,0x5e,0x1a,0x8a,0x71,0x97}, 8444} +}; + +static SeedSpec6 pnSeed6_test[] = { + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x99,0xcb,0x26,0x31,0xba,0x48,0x51,0x31,0x39,0x0d}, 18333}, + {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x44,0xf4,0xf4,0xf0,0xbf,0xf7,0x7e,0x6d,0xc4,0xe8}, 18333} +}; +#endif From b33bd7a3be1cbcc8d255178307976b7762125b18 Mon Sep 17 00:00:00 2001 From: Daniel Kraft Date: Sun, 3 Aug 2014 18:12:19 +0200 Subject: [PATCH 0468/1288] Implement "getchaintips" RPC command to monitor blockchain forks. Port over https://github.com/chronokings/huntercoin/pull/19 from Huntercoin: This implements a new RPC command "getchaintips" that can be used to find all currently active chain heads. This is similar to the -printblocktree startup option, but it can be used without restarting just via the RPC interface on a running daemon. --- qa/rpc-tests/getchaintips.py | 24 +++++++++++++ src/main.cpp | 6 ++-- src/main.h | 2 +- src/rpcblockchain.cpp | 70 ++++++++++++++++++++++++++++++++++++ src/rpcserver.cpp | 1 + src/rpcserver.h | 1 + 6 files changed, 100 insertions(+), 4 deletions(-) create mode 100755 qa/rpc-tests/getchaintips.py diff --git a/qa/rpc-tests/getchaintips.py b/qa/rpc-tests/getchaintips.py new file mode 100755 index 0000000000..a83c499743 --- /dev/null +++ b/qa/rpc-tests/getchaintips.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python +# Copyright (c) 2014 The Bitcoin Core developers +# Distributed under the MIT/X11 software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +# Exercise the getchaintips API. + +# Since the test framework does not generate orphan blocks, we can +# unfortunately not check for them! + +from test_framework import BitcoinTestFramework +from util import assert_equal + +class GetChainTipsTest (BitcoinTestFramework): + + def run_test (self, nodes): + res = nodes[0].getchaintips () + assert_equal (len (res), 1) + res = res[0] + assert_equal (res['branchlen'], 0) + assert_equal (res['height'], 200) + +if __name__ == '__main__': + GetChainTipsTest ().main () diff --git a/src/main.cpp b/src/main.cpp index 353cde0bd7..cf9318fedf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -444,7 +444,7 @@ CBlockIndex *CChain::FindFork(const CBlockLocator &locator) const { return Genesis(); } -CBlockIndex *CChain::FindFork(CBlockIndex *pindex) const { +const CBlockIndex *CChain::FindFork(const CBlockIndex *pindex) const { if (pindex->nHeight > Height()) pindex = pindex->GetAncestor(Height()); while (pindex && !Contains(pindex)) @@ -2067,8 +2067,8 @@ static CBlockIndex* FindMostWorkChain() { static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMostWork) { AssertLockHeld(cs_main); bool fInvalidFound = false; - CBlockIndex *pindexOldTip = chainActive.Tip(); - CBlockIndex *pindexFork = chainActive.FindFork(pindexMostWork); + const CBlockIndex *pindexOldTip = chainActive.Tip(); + const CBlockIndex *pindexFork = chainActive.FindFork(pindexMostWork); // Disconnect active blocks which are no longer in the best chain. while (chainActive.Tip() && chainActive.Tip() != pindexFork) { diff --git a/src/main.h b/src/main.h index 48ec86f6a8..a27020459a 100644 --- a/src/main.h +++ b/src/main.h @@ -1068,7 +1068,7 @@ public: CBlockIndex *FindFork(const CBlockLocator &locator) const; /** Find the last common block between this chain and a block index entry. */ - CBlockIndex *FindFork(CBlockIndex *pindex) const; + const CBlockIndex *FindFork(const CBlockIndex *pindex) const; }; /** The currently-connected chain of blocks. */ diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 253693e624..1e5198b85c 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -461,3 +461,73 @@ Value getblockchaininfo(const Array& params, bool fHelp) obj.push_back(Pair("chainwork", chainActive.Tip()->nChainWork.GetHex())); return obj; } + +/* Comparison function for sorting the getchaintips heads. */ +struct CompareBlocksByHeight +{ + bool operator()(const CBlockIndex* a, const CBlockIndex* b) const + { + /* Make sure that unequal blocks with the same height do not compare + equal. Use the pointers themselves to make a distinction. */ + + if (a->nHeight != b->nHeight) + return (a->nHeight > b->nHeight); + + return a < b; + } +}; + +Value getchaintips(const Array& params, bool fHelp) +{ + if (fHelp || params.size() != 0) + throw runtime_error( + "getchaintips\n" + "Return information about all known tips in the block tree," + " including the main chain as well as orphaned branches.\n" + "\nResult:\n" + "[\n" + " {\n" + " \"height\": xxxx, (numeric) height of the chain tip\n" + " \"hash\": \"xxxx\", (string) block hash of the tip\n" + " \"branchlen\": 0 (numeric) zero for main chain\n" + " },\n" + " {\n" + " \"height\": xxxx,\n" + " \"hash\": \"xxxx\",\n" + " \"branchlen\": 1 (numeric) length of branch connecting the tip to the main chain\n" + " }\n" + "]\n" + "\nExamples:\n" + + HelpExampleCli("getchaintips", "") + + HelpExampleRpc("getchaintips", "") + ); + + /* Build up a list of chain tips. We start with the list of all + known blocks, and successively remove blocks that appear as pprev + of another block. */ + std::set setTips; + BOOST_FOREACH(const PAIRTYPE(const uint256, CBlockIndex*)& item, mapBlockIndex) + setTips.insert(item.second); + BOOST_FOREACH(const PAIRTYPE(const uint256, CBlockIndex*)& item, mapBlockIndex) + { + const CBlockIndex* pprev = item.second->pprev; + if (pprev) + setTips.erase(pprev); + } + + /* Construct the output array. */ + Array res; + BOOST_FOREACH(const CBlockIndex* block, setTips) + { + Object obj; + obj.push_back(Pair("height", block->nHeight)); + obj.push_back(Pair("hash", block->phashBlock->GetHex())); + + const int branchLen = block->nHeight - chainActive.FindFork(block)->nHeight; + obj.push_back(Pair("branchlen", branchLen)); + + res.push_back(obj); + } + + return res; +} diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 5deb6a4e08..716a7fba6a 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -235,6 +235,7 @@ static const CRPCCommand vRPCCommands[] = { "getblockcount", &getblockcount, true, false, false }, { "getblock", &getblock, true, false, false }, { "getblockhash", &getblockhash, true, false, false }, + { "getchaintips", &getchaintips, true, false, false }, { "getdifficulty", &getdifficulty, true, false, false }, { "getrawmempool", &getrawmempool, true, false, false }, { "gettxout", &gettxout, true, false, false }, diff --git a/src/rpcserver.h b/src/rpcserver.h index 31badadd6d..176852ca8f 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -205,5 +205,6 @@ extern json_spirit::Value getblock(const json_spirit::Array& params, bool fHelp) extern json_spirit::Value gettxoutsetinfo(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value gettxout(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value verifychain(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value getchaintips(const json_spirit::Array& params, bool fHelp); #endif From e1eb741e342ef25e510db6c06935afc4116abd74 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 4 Aug 2014 09:47:59 +0200 Subject: [PATCH 0469/1288] doc: Modernize steps to be followed after release Remove old references to sourceforge, add what actually should be done and provide some more details. --- doc/release-process.md | 60 ++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/doc/release-process.md b/doc/release-process.md index c588381411..c5ead4199b 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -156,24 +156,6 @@ repackage gitian builds for release as stand-alone zip/tar/installer exe ###Next steps: -* Code-sign Windows -setup.exe (in a Windows virtual machine using signtool) - Note: only Gavin has the code-signing keys currently. - -* upload builds to SourceForge - -* create SHA256SUMS for builds, and PGP-sign it - -* update bitcoin.org version - make sure all OS download links go to the right versions - -* update download sizes on bitcoin.org/_templates/download.html - -* update forum version - -* update wiki download links - -* update wiki changelog: [https://en.bitcoin.it/wiki/Changelog](https://en.bitcoin.it/wiki/Changelog) - Commit your signature to gitian.sigs: pushd gitian.sigs @@ -186,18 +168,50 @@ Commit your signature to gitian.sigs: ------------------------------------------------------------------------- -### After 3 or more people have gitian-built, repackage gitian-signed zips: +### After 3 or more people have gitian-built and their results match: -- Upload gitian zips to SourceForge +- Perform code-signing. + + - Code-sign Windows -setup.exe (in a Windows virtual machine using signtool) + + - Code-sign MacOSX .dmg + + Note: only Gavin has the code-signing keys currently. + +- Create `SHA256SUMS.asc` for builds, and PGP-sign it. This is done manually. + Include all the files to be uploaded. The file has `sha256sum` format with a + simple header at the top: + +``` +Hash: SHA256 + +0060f7d38b98113ab912d4c184000291d7f026eaf77ca5830deec15059678f54 bitcoin-x.y.z-linux.tar.gz +... +``` + +- Upload zips and installers, as well as `SHA256SUMS.asc` from last step, to the bitcoin.org server + +- Update bitcoin.org version + + - Make a pull request to add a file named `YYYY-MM-DD-vX.Y.Z.md` with the release notes + to https://github.com/bitcoin/bitcoin.org/tree/master/_releases + ([Example for 0.9.2.1](https://raw.githubusercontent.com/bitcoin/bitcoin.org/master/_releases/2014-06-19-v0.9.2.1.md)). + + - After the pull request is merged, the website will automatically show the newest version, as well + as update the OS download links. Ping Saivann in case anything goes wrong - Announce the release: - - Add the release to bitcoin.org: https://github.com/bitcoin/bitcoin.org/tree/master/_releases - - Release sticky on bitcointalk: https://bitcointalk.org/index.php?board=1.0 - Bitcoin-development mailing list - - Optionally reddit /r/Bitcoin, ... + - Update title of #bitcoin on Freenode IRC + + - Optionally reddit /r/Bitcoin, ... but this will usually sort out itself + +- Notify BlueMatt so that he can start building [https://launchpad.net/~bitcoin/+archive/ubuntu/bitcoin](the PPAs) + +- Add release notes for the new version to the directory `doc/release-notes` in git master - Celebrate From 0a0878d43a2e7db9c41b20ba1d3eb714fd6806c4 Mon Sep 17 00:00:00 2001 From: Gregory Maxwell Date: Mon, 21 Jul 2014 10:02:04 +0200 Subject: [PATCH 0470/1288] doc: Add new DNSseed policy --- doc/dnsseed-policy.md | 52 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 doc/dnsseed-policy.md diff --git a/doc/dnsseed-policy.md b/doc/dnsseed-policy.md new file mode 100644 index 0000000000..73e307f7cd --- /dev/null +++ b/doc/dnsseed-policy.md @@ -0,0 +1,52 @@ +Expectations for DNS Seed operators +==================================== + +Bitcoin Core attempts to minimize the level of trust in DNS seeds, +but DNS seeds still pose a small amount of risk for the network. +Other implementations of Bitcoin software may also use the same +seeds and may be more exposed. In light of this exposure this +document establishes some basic expectations for the expectations +for the operation of dnsseeds. + +0. A DNS seed operating organization or person is expected +to follow good host security practices and maintain control of +their serving infrastructure and not sell or transfer control of their +DNS seed. Any hosting services contracted by the operator are +equally expected to uphold these expectations. + +1. The DNS seed results must consist exclusively of fairly selected and +functioning Bitcoin nodes from the public network to the best of the +operators understanding and capability. + +2. For the avoidance of doubt, the results may be randomized but must not +single-out any group of hosts to receive different results unless due to an +urgent technical necessity and disclosed. + +3. The results may not be served with a DNS TTL of less than one minute. + +4. Any logging of DNS queries should be only that which is necessary +for the operation of the service or urgent health of the Bitcoin +network and must not be retained longer than necessary or disclosed +to any third party. + +5. Information gathered as a result of the operators node-spidering +(not from DNS queries) may be freely published or retained, but only +if this data was not made more complete by biasing node connectivity +(a violation of expectation (1)). + +6. Operators are encouraged, but not required, to publicly document the +details of their operating practices. + +7. A reachable email contact address must be published for inquiries +related to the DNS seed operation. + +If these expectations cannot be satisfied the operator should +discontinue providing services and contact the active Bitcoin +Core development team as well as posting on bitcoin-development. + +Behavior outside of these expectations may be reasonable in some +situations but should be discussed in public in advance. + +See also +---------- +- [bitcoin-seeder](https://github.com/sipa/bitcoin-seeder) is a reference implementation of a DNS seed. From 2b410c2fe1cba1c606b89f005cfa0ee4810320cf Mon Sep 17 00:00:00 2001 From: pryds Date: Fri, 1 Aug 2014 23:06:36 +0200 Subject: [PATCH 0471/1288] Typo, and a few "Bitcoin" -> "Bitcoin Core" Github-Pull: #4619 --- src/init.cpp | 6 +-- src/qt/bitcoinstrings.cpp | 10 ++--- src/qt/locale/bitcoin_en.ts | 74 ++++++++++++++++--------------------- src/timedata.cpp | 2 +- 4 files changed, 41 insertions(+), 51 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index b84c233b99..0b621f3734 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -280,7 +280,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -upgradewallet " + _("Upgrade wallet to latest format") + " " + _("on startup") + "\n"; strUsage += " -wallet= " + _("Specify wallet file (within data directory)") + " " + _("(default: wallet.dat)") + "\n"; strUsage += " -walletnotify= " + _("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)") + "\n"; - strUsage += " -zapwallettxes= " + _("Delete all wallet transactions and only recover those part of the blockchain through -rescan on startup") + "\n"; + strUsage += " -zapwallettxes= " + _("Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup") + "\n"; strUsage += " " + _("(default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)") + "\n"; #endif @@ -1087,10 +1087,10 @@ bool AppInit2(boost::thread_group& threadGroup) InitWarning(msg); } else if (nLoadWalletRet == DB_TOO_NEW) - strErrors << _("Error loading wallet.dat: Wallet requires newer version of Bitcoin") << "\n"; + strErrors << _("Error loading wallet.dat: Wallet requires newer version of Bitcoin Core") << "\n"; else if (nLoadWalletRet == DB_NEED_REWRITE) { - strErrors << _("Wallet needed to be rewritten: restart Bitcoin to complete") << "\n"; + strErrors << _("Wallet needed to be rewritten: restart Bitcoin Core to complete") << "\n"; LogPrintf("%s", strErrors.str()); return InitError(strErrors.str()); } diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index 9ac7f24867..3b4b40aae3 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -54,8 +54,8 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Create new files with system default permissions, instead of umask 077 (only " "effective with disabled wallet functionality)"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Delete all wallet transactions and only recover those part of the blockchain " -"through -rescan on startup"), +"Delete all wallet transactions and only recover those parts of the " +"blockchain through -rescan on startup"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Distributed under the MIT/X11 software license, see the accompanying file " "COPYING or ."), @@ -139,7 +139,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "pay if you send a transaction."), QT_TRANSLATE_NOOP("bitcoin-core", "" "Warning: Please check that your computer's date and time are correct! If " -"your clock is wrong Bitcoin will not work properly."), +"your clock is wrong Bitcoin Core will not work properly."), QT_TRANSLATE_NOOP("bitcoin-core", "" "Warning: The network does not appear to fully agree! Some miners appear to " "be experiencing issues."), @@ -192,7 +192,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Error initializing wallet database environmen QT_TRANSLATE_NOOP("bitcoin-core", "Error loading block database"), QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat"), QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet corrupted"), -QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet requires newer version of Bitcoin"), +QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet requires newer version of Bitcoin Core"), QT_TRANSLATE_NOOP("bitcoin-core", "Error opening block database"), QT_TRANSLATE_NOOP("bitcoin-core", "Error"), QT_TRANSLATE_NOOP("bitcoin-core", "Error: Disk space is low!"), @@ -302,7 +302,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Username for JSON-RPC connections"), QT_TRANSLATE_NOOP("bitcoin-core", "Verifying blocks..."), QT_TRANSLATE_NOOP("bitcoin-core", "Verifying wallet..."), QT_TRANSLATE_NOOP("bitcoin-core", "Wallet %s resides outside data directory %s"), -QT_TRANSLATE_NOOP("bitcoin-core", "Wallet needed to be rewritten: restart Bitcoin to complete"), +QT_TRANSLATE_NOOP("bitcoin-core", "Wallet needed to be rewritten: restart Bitcoin Core to complete"), QT_TRANSLATE_NOOP("bitcoin-core", "Wallet options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Warning"), QT_TRANSLATE_NOOP("bitcoin-core", "Warning: This version is obsolete, upgrade required!"), diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index 143f705327..2c95b5bba6 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -1284,7 +1284,7 @@ Address: %4 - + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. @@ -1310,7 +1310,7 @@ Address: %4 &Reset Options - + &Network &Network @@ -1420,22 +1420,12 @@ Address: %4 Choose the default subdivision unit to show in the interface and when sending coins. - - Whether to show Bitcoin addresses in the transaction list or not. - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - &Display addresses in transaction list - - - + Whether to show coin control features or not. - + &OK &OK @@ -1455,7 +1445,7 @@ Address: %4 - + Confirm options reset Confirm options reset @@ -3583,7 +3573,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - + + Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup + + + + Enter regression test mode, which uses a special chain in which blocks can be solved instantly. @@ -3648,12 +3643,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - + Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. @@ -3978,12 +3968,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - Delete all wallet transactions and only recover those part of the blockchain through -rescan on startup - - - - + Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. @@ -4043,7 +4028,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - + + Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + + + + Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. @@ -4078,7 +4068,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - + + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core + + + + Error: Unsupported argument -tor found, use -onion. @@ -4298,7 +4293,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Username for JSON-RPC connections - + + Wallet needed to be rewritten: restart Bitcoin Core to complete + + + + Warning Warning @@ -4393,17 +4393,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - Wallet needed to be rewritten: restart Bitcoin to complete - - - + Error loading wallet.dat Error loading wallet.dat diff --git a/src/timedata.cpp b/src/timedata.cpp index 6c3bd9a48d..4576786b96 100644 --- a/src/timedata.cpp +++ b/src/timedata.cpp @@ -92,7 +92,7 @@ void AddTimeData(const CNetAddr& ip, int64_t nTime) if (!fMatch) { fDone = true; - string strMessage = _("Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly."); + string strMessage = _("Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly."); strMiscWarning = strMessage; LogPrintf("*** %s\n", strMessage); uiInterface.ThreadSafeMessageBox(strMessage, "", CClientUIInterface::MSG_WARNING); From a5b2d9c82e985fa8df4457072b4fa30781f1d53a Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 4 Jun 2014 12:06:18 +0200 Subject: [PATCH 0472/1288] [Qt] tweak new peers tab in console window - remove starting height as table header and replace with ping time - remove columnResizingFixer - add local address (if available) in detailed node view (on top of the right view below the remote address) - remove some .c_str() by using QString::fromStdString() - rename Address to Address/Hostname - rename secs to just s for ping time - use MODEL_UPDATE_DELAY from guiconstants.h for the peer refresh time - make PeerTableModel::columnCount() return no hard-coded value - remove and cleanup dup private: section in RPCConsole header - add new defaults for column sizes - remove behaviour which keeps disconnected peers selected and also remove code which keeps track of last selected peer stats - add sync height to detail view - add some additional NULL pointer checks for clientModel in rpcconsole.cpp --- src/qt/forms/rpcconsole.ui | 536 +++++++++++++++++++++++-------------- src/qt/guiutil.cpp | 5 + src/qt/guiutil.h | 3 + src/qt/peertablemodel.cpp | 64 +++-- src/qt/peertablemodel.h | 9 +- src/qt/rpcconsole.cpp | 155 ++++------- src/qt/rpcconsole.h | 29 +- 7 files changed, 445 insertions(+), 356 deletions(-) diff --git a/src/qt/forms/rpcconsole.ui b/src/qt/forms/rpcconsole.ui index 7158b65c2d..b9b90aa846 100644 --- a/src/qt/forms/rpcconsole.ui +++ b/src/qt/forms/rpcconsole.ui @@ -428,7 +428,7 @@ - + &Network Traffic @@ -683,6 +683,19 @@ &Peers + + + + Qt::ScrollBarAlwaysOff + + + true + + + false + + + @@ -691,262 +704,377 @@ 0 + + + 300 + 32 + + + + + 10 + + + + IBeamCursor + Select a peer to view detailed information. - - 3 + + Qt::AlignHCenter|Qt::AlignTop - - - - - - - 0 - 0 - - - - Qt::ScrollBarAlwaysOff - - - QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed - - + true + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + - - - 0 - 0 - + + + 300 + 0 + - - 3 - - - + + - Version: + Direction - - + + + + IBeamCursor + N/A + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Version + + + + + + + IBeamCursor + + + N/A + + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + User Agent + + + + + + + IBeamCursor + + + N/A + + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Services + + + + + + + IBeamCursor + + + N/A + + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Sync Node + + + + + + + IBeamCursor + + + N/A + + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + - + - Last Receive: + Starting Height - - - - User Agent: - - - - - - - N/A - - - - - - - - 160 - 0 - + + + + IBeamCursor N/A - - - - - - Ping Time: + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - 0 - 0 - + + + + Sync Height + + + + + + + IBeamCursor N/A + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Ban Score + + + + + + + IBeamCursor + + + N/A + + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + - Connection Time: + Connection Time - - + + + + IBeamCursor + N/A + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Last Send + + + + + + + IBeamCursor + + + N/A + + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Last Receive + + + + + + + IBeamCursor + + + N/A + + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Bytes Sent + + + + + + + IBeamCursor + + + N/A + + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Bytes Received + + + + + + + IBeamCursor + + + N/A + + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Ping Time + + + + + + + IBeamCursor + + + N/A + + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + - - - N/A + + + Qt::Vertical - - - - - - Starting Height: + + + 20 + 40 + - - - - - - N/A - - - - - - - Bytes Sent: - - - - - - - Bytes Received: - - - - - - - N/A - - - - - - - Ban Score: - - - - - - - N/A - - - - - - - Direction: - - - - - - - N/A - - - - - - - Sync Node: - - - - - - - N/A - - - - - - - Last Send: - - - - - - - Services: - - - - - - - IP Address/port: - - - - - - - N/A - - - - - - - N/A - - - - - - - N/A - - - - - - - - 0 - 0 - - - + diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 33a50a078d..6258c4160c 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -804,4 +804,9 @@ QString formatServicesStr(uint64_t mask) return QObject::tr("None"); } +QString formatPingTime(double dPingTime) +{ + return dPingTime == 0 ? QObject::tr("N/A") : QString(QObject::tr("%1 s")).arg(QString::number(dPingTime, 'f', 3)); +} + } // namespace GUIUtil diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 45c78b4e14..dd31d051ee 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -178,6 +178,9 @@ namespace GUIUtil /* Format CNodeStats.nServices bitmask into a user-readable string */ QString formatServicesStr(uint64_t mask); + + /* Format a CNodeCombinedStats.dPingTime into a user-readable string or display N/A, if 0*/ + QString formatPingTime(double dPingTime); } // namespace GUIUtil #endif // GUIUTIL_H diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp index 981d063c49..4c650bdec9 100644 --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -5,6 +5,8 @@ #include "peertablemodel.h" #include "clientmodel.h" +#include "guiconstants.h" +#include "guiutil.h" #include "net.h" #include "sync.h" @@ -15,8 +17,8 @@ bool NodeLessThan::operator()(const CNodeCombinedStats &left, const CNodeCombinedStats &right) const { - const CNodeStats *pLeft = &(left.nodestats); - const CNodeStats *pRight = &(right.nodestats); + const CNodeStats *pLeft = &(left.nodeStats); + const CNodeStats *pRight = &(right.nodeStats); if (order == Qt::DescendingOrder) std::swap(pLeft, pRight); @@ -27,8 +29,8 @@ bool NodeLessThan::operator()(const CNodeCombinedStats &left, const CNodeCombine return pLeft->addrName.compare(pRight->addrName) < 0; case PeerTableModel::Subversion: return pLeft->cleanSubVer.compare(pRight->cleanSubVer) < 0; - case PeerTableModel::Height: - return pLeft->nStartingHeight < pRight->nStartingHeight; + case PeerTableModel::Ping: + return pLeft->dPingTime < pRight->dPingTime; } return false; @@ -48,7 +50,8 @@ public: std::map mapNodeRows; /** Pull a full list of peers from vNodes into our cache */ - void refreshPeers() { + void refreshPeers() + { { TRY_LOCK(cs_vNodes, lockNodes); if (!lockNodes) @@ -63,23 +66,17 @@ public: BOOST_FOREACH(CNode* pnode, vNodes) { CNodeCombinedStats stats; - stats.statestats.nMisbehavior = -1; - pnode->copyStats(stats.nodestats); + stats.nodeStateStats.nMisbehavior = 0; + stats.nodeStateStats.nSyncHeight = -1; + stats.fNodeStateStatsAvailable = false; + pnode->copyStats(stats.nodeStats); cachedNodeStats.append(stats); } } - // if we can, retrieve the CNodeStateStats for each node. - { - TRY_LOCK(cs_main, lockMain); - if (lockMain) - { - BOOST_FOREACH(CNodeCombinedStats &stats, cachedNodeStats) - { - GetNodeStateStats(stats.nodestats.nodeid, stats.statestats); - } - } - } + // Try to retrieve the CNodeStateStats for each node. + BOOST_FOREACH(CNodeCombinedStats &stats, cachedNodeStats) + stats.fNodeStateStatsAvailable = GetNodeStateStats(stats.nodeStats.nodeid, stats.nodeStateStats); if (sortColumn >= 0) // sort cacheNodeStats (use stable sort to prevent rows jumping around unneceesarily) @@ -89,9 +86,7 @@ public: mapNodeRows.clear(); int row = 0; BOOST_FOREACH(CNodeCombinedStats &stats, cachedNodeStats) - { - mapNodeRows.insert(std::pair(stats.nodestats.nodeid, row++)); - } + mapNodeRows.insert(std::pair(stats.nodeStats.nodeid, row++)); } int size() @@ -103,18 +98,18 @@ public: { if(idx >= 0 && idx < cachedNodeStats.size()) { return &cachedNodeStats[idx]; - } - else - { + } else { return 0; } } }; PeerTableModel::PeerTableModel(ClientModel *parent) : - QAbstractTableModel(parent),clientModel(parent),timer(0) + QAbstractTableModel(parent), + clientModel(parent), + timer(0) { - columns << tr("Address") << tr("User Agent") << tr("Start Height"); + columns << tr("Address/Hostname") << tr("User Agent") << tr("Ping Time"); priv = new PeerTablePriv(); // default to unsorted priv->sortColumn = -1; @@ -122,14 +117,14 @@ PeerTableModel::PeerTableModel(ClientModel *parent) : // set up timer for auto refresh timer = new QTimer(); connect(timer, SIGNAL(timeout()), SLOT(refresh())); + timer->setInterval(MODEL_UPDATE_DELAY); // load initial data refresh(); } -void PeerTableModel::startAutoRefresh(int msecs) +void PeerTableModel::startAutoRefresh() { - timer->setInterval(1000); timer->start(); } @@ -147,7 +142,7 @@ int PeerTableModel::rowCount(const QModelIndex &parent) const int PeerTableModel::columnCount(const QModelIndex &parent) const { Q_UNUSED(parent); - return 3; + return columns.length();; } QVariant PeerTableModel::data(const QModelIndex &index, int role) const @@ -162,11 +157,11 @@ QVariant PeerTableModel::data(const QModelIndex &index, int role) const switch(index.column()) { case Address: - return QVariant(rec->nodestats.addrName.c_str()); + return QString::fromStdString(rec->nodeStats.addrName); case Subversion: - return QVariant(rec->nodestats.cleanSubVer.c_str()); - case Height: - return rec->nodestats.nStartingHeight; + return QString::fromStdString(rec->nodeStats.cleanSubVer); + case Ping: + return GUIUtil::formatPingTime(rec->nodeStats.dPingTime); } } return QVariant(); @@ -208,7 +203,8 @@ QModelIndex PeerTableModel::index(int row, int column, const QModelIndex &parent } } -const CNodeCombinedStats *PeerTableModel::getNodeStats(int idx) { +const CNodeCombinedStats *PeerTableModel::getNodeStats(int idx) +{ return priv->index(idx); } diff --git a/src/qt/peertablemodel.h b/src/qt/peertablemodel.h index 385bf0e0c1..38f2662f89 100644 --- a/src/qt/peertablemodel.h +++ b/src/qt/peertablemodel.h @@ -19,8 +19,9 @@ class QTimer; QT_END_NAMESPACE struct CNodeCombinedStats { - CNodeStats nodestats; - CNodeStateStats statestats; + CNodeStats nodeStats; + CNodeStateStats nodeStateStats; + bool fNodeStateStatsAvailable; }; class NodeLessThan @@ -47,13 +48,13 @@ public: explicit PeerTableModel(ClientModel *parent = 0); const CNodeCombinedStats *getNodeStats(int idx); int getRowByNodeId(NodeId nodeid); - void startAutoRefresh(int msecs); + void startAutoRefresh(); void stopAutoRefresh(); enum ColumnIndex { Address = 0, Subversion = 1, - Height = 2 + Ping = 2 }; /** @name Methods overridden from QAbstractTableModel diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 9b67f8125f..11089b2497 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -10,6 +10,7 @@ #include "peertablemodel.h" #include "main.h" +#include "chainparams.h" #include "rpcserver.h" #include "rpcclient.h" #include "util.h" @@ -200,12 +201,9 @@ RPCConsole::RPCConsole(QWidget *parent) : QDialog(parent), ui(new Ui::RPCConsole), clientModel(0), - historyPtr(0) + historyPtr(0), + cachedNodeid(-1) { - detailNodeStats = CNodeCombinedStats(); - detailNodeStats.nodestats.nodeid = -1; - detailNodeStats.statestats.nMisbehavior = -1; - ui->setupUi(this); GUIUtil::restoreWindowGeometry("nRPCConsoleWindow", this->size(), this); @@ -233,6 +231,7 @@ RPCConsole::RPCConsole(QWidget *parent) : setTrafficGraphRange(INITIAL_TRAFFIC_GRAPH_MINS); ui->detailWidget->hide(); + ui->peerHeading->setText(tr("Select a peer to view detailed information.")); clear(); } @@ -303,11 +302,11 @@ void RPCConsole::setClientModel(ClientModel *model) ui->peerWidget->setSelectionBehavior(QAbstractItemView::SelectRows); ui->peerWidget->setSelectionMode(QAbstractItemView::SingleSelection); ui->peerWidget->setColumnWidth(PeerTableModel::Address, ADDRESS_COLUMN_WIDTH); - columnResizingFixer = new GUIUtil::TableViewLastColumnResizingFixer(ui->peerWidget, MINIMUM_COLUMN_WIDTH, MINIMUM_COLUMN_WIDTH); + ui->peerWidget->setColumnWidth(PeerTableModel::Subversion, SUBVERSION_COLUMN_WIDTH); + ui->peerWidget->setColumnWidth(PeerTableModel::Ping, PING_COLUMN_WIDTH); - // connect the peerWidget's selection model to our peerSelected() handler - QItemSelectionModel *peerSelectModel = ui->peerWidget->selectionModel(); - connect(peerSelectModel, SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), + // connect the peerWidget selection model to our peerSelected() handler + connect(ui->peerWidget->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), this, SLOT(peerSelected(const QItemSelection &, const QItemSelection &))); connect(model->getPeerTableModel(), SIGNAL(layoutChanged()), this, SLOT(peerLayoutChanged())); @@ -473,10 +472,6 @@ void RPCConsole::on_tabWidget_currentChanged(int index) { ui->lineEdit->setFocus(); } - else if(ui->tabWidget->widget(index) == ui->tab_peers) - { - initPeerTable(); - } } void RPCConsole::on_openDebugLogfileButton_clicked() @@ -525,30 +520,24 @@ void RPCConsole::peerSelected(const QItemSelection &selected, const QItemSelecti { Q_UNUSED(deselected); - if (selected.indexes().isEmpty()) + if (!clientModel || selected.indexes().isEmpty()) return; - // mark the cached banscore as unknown - detailNodeStats.statestats.nMisbehavior = -1; - const CNodeCombinedStats *stats = clientModel->getPeerTableModel()->getNodeStats(selected.indexes().first().row()); - if (stats) - { - detailNodeStats.nodestats.nodeid = stats->nodestats.nodeid; updateNodeDetail(stats); - ui->detailWidget->show(); - ui->detailWidget->setDisabled(false); - } } void RPCConsole::peerLayoutChanged() { - const CNodeCombinedStats *stats = NULL; - bool fUnselect = false, fReselect = false, fDisconnected = false; + if (!clientModel) + return; - if (detailNodeStats.nodestats.nodeid == -1) - // no node selected yet + const CNodeCombinedStats *stats = NULL; + bool fUnselect = false; + bool fReselect = false; + + if (cachedNodeid == -1) // no node selected yet return; // find the currently selected row @@ -561,14 +550,15 @@ void RPCConsole::peerLayoutChanged() // check if our detail node has a row in the table (it may not necessarily // be at selectedRow since its position can change after a layout change) - int detailNodeRow = clientModel->getPeerTableModel()->getRowByNodeId(detailNodeStats.nodestats.nodeid); + int detailNodeRow = clientModel->getPeerTableModel()->getRowByNodeId(cachedNodeid); if (detailNodeRow < 0) { // detail node dissapeared from table (node disconnected) fUnselect = true; - fDisconnected = true; - detailNodeStats.nodestats.nodeid = 0; + cachedNodeid = -1; + ui->detailWidget->hide(); + ui->peerHeading->setText(tr("Select a peer to view detailed information.")); } else { @@ -596,91 +586,64 @@ void RPCConsole::peerLayoutChanged() if (stats) updateNodeDetail(stats); - - if (fDisconnected) - { - ui->peerHeading->setText(QString(tr("Peer Disconnected"))); - ui->detailWidget->setDisabled(true); - QDateTime dt = QDateTime::fromTime_t(detailNodeStats.nodestats.nLastSend); - if (detailNodeStats.nodestats.nLastSend) - ui->peerLastSend->setText(dt.toString("yyyy-MM-dd hh:mm:ss")); - dt.setTime_t(detailNodeStats.nodestats.nLastRecv); - if (detailNodeStats.nodestats.nLastRecv) - ui->peerLastRecv->setText(dt.toString("yyyy-MM-dd hh:mm:ss")); - dt.setTime_t(detailNodeStats.nodestats.nTimeConnected); - ui->peerConnTime->setText(dt.toString("yyyy-MM-dd hh:mm:ss")); - } } -void RPCConsole::updateNodeDetail(const CNodeCombinedStats *combinedStats) +void RPCConsole::updateNodeDetail(const CNodeCombinedStats *stats) { - CNodeStats stats = combinedStats->nodestats; - - // keep a copy of timestamps, used to display dates upon disconnect - detailNodeStats.nodestats.nLastSend = stats.nLastSend; - detailNodeStats.nodestats.nLastRecv = stats.nLastRecv; - detailNodeStats.nodestats.nTimeConnected = stats.nTimeConnected; + // Update cached nodeid + cachedNodeid = stats->nodeStats.nodeid; // update the detail ui with latest node information - ui->peerHeading->setText(QString("%1").arg(tr("Node Detail"))); - ui->peerAddr->setText(QString(stats.addrName.c_str())); - ui->peerServices->setText(GUIUtil::formatServicesStr(stats.nServices)); - ui->peerLastSend->setText(stats.nLastSend ? GUIUtil::formatDurationStr(GetTime() - stats.nLastSend) : tr("never")); - ui->peerLastRecv->setText(stats.nLastRecv ? GUIUtil::formatDurationStr(GetTime() - stats.nLastRecv) : tr("never")); - ui->peerBytesSent->setText(FormatBytes(stats.nSendBytes)); - ui->peerBytesRecv->setText(FormatBytes(stats.nRecvBytes)); - ui->peerConnTime->setText(GUIUtil::formatDurationStr(GetTime() - stats.nTimeConnected)); - ui->peerPingTime->setText(stats.dPingTime == 0 ? tr("N/A") : QString(tr("%1 secs")).arg(QString::number(stats.dPingTime, 'f', 3))); - ui->peerVersion->setText(QString("%1").arg(stats.nVersion)); - ui->peerSubversion->setText(QString(stats.cleanSubVer.c_str())); - ui->peerDirection->setText(stats.fInbound ? tr("Inbound") : tr("Outbound")); - ui->peerHeight->setText(QString("%1").arg(stats.nStartingHeight)); - ui->peerSyncNode->setText(stats.fSyncNode ? tr("Yes") : tr("No")); + QString peerAddrDetails(QString::fromStdString(stats->nodeStats.addrName)); + if (!stats->nodeStats.addrLocal.empty()) + peerAddrDetails += "
" + tr("via %1").arg(QString::fromStdString(stats->nodeStats.addrLocal)); + ui->peerHeading->setText(peerAddrDetails); + ui->peerServices->setText(GUIUtil::formatServicesStr(stats->nodeStats.nServices)); + ui->peerLastSend->setText(stats->nodeStats.nLastSend ? GUIUtil::formatDurationStr(GetTime() - stats->nodeStats.nLastSend) : tr("never")); + ui->peerLastRecv->setText(stats->nodeStats.nLastRecv ? GUIUtil::formatDurationStr(GetTime() - stats->nodeStats.nLastRecv) : tr("never")); + ui->peerBytesSent->setText(FormatBytes(stats->nodeStats.nSendBytes)); + ui->peerBytesRecv->setText(FormatBytes(stats->nodeStats.nRecvBytes)); + ui->peerConnTime->setText(GUIUtil::formatDurationStr(GetTime() - stats->nodeStats.nTimeConnected)); + ui->peerPingTime->setText(GUIUtil::formatPingTime(stats->nodeStats.dPingTime)); + ui->peerVersion->setText(QString("%1").arg(stats->nodeStats.nVersion)); + ui->peerSubversion->setText(QString::fromStdString(stats->nodeStats.cleanSubVer)); + ui->peerDirection->setText(stats->nodeStats.fInbound ? tr("Inbound") : tr("Outbound")); + ui->peerHeight->setText(QString("%1").arg(stats->nodeStats.nStartingHeight)); + ui->peerSyncNode->setText(stats->nodeStats.fSyncNode ? tr("Yes") : tr("No")); - // if we can, display the peer's ban score - CNodeStateStats statestats = combinedStats->statestats; - if (statestats.nMisbehavior >= 0) - { - // we have a new nMisbehavor value - update the cache - detailNodeStats.statestats.nMisbehavior = statestats.nMisbehavior; + // This check fails for example if the lock was busy and + // nodeStateStats couldn't be fetched. + if (stats->fNodeStateStatsAvailable) { + // Ban score is init to 0 + ui->peerBanScore->setText(QString("%1").arg(stats->nodeStateStats.nMisbehavior)); + + // Sync height is init to -1 + if (stats->nodeStateStats.nSyncHeight > -1) + ui->peerSyncHeight->setText(QString("%1").arg(stats->nodeStateStats.nSyncHeight)); + else + ui->peerSyncHeight->setText(tr("Unknown")); + } else { + ui->peerBanScore->setText(tr("Fetching...")); + ui->peerSyncHeight->setText(tr("Fetching...")); } - // pull the ban score from cache. -1 means it hasn't been retrieved yet (lock busy). - if (detailNodeStats.statestats.nMisbehavior >= 0) - ui->peerBanScore->setText(QString("%1").arg(detailNodeStats.statestats.nMisbehavior)); - else - ui->peerBanScore->setText(tr("Fetching...")); + ui->detailWidget->show(); } -void RPCConsole::initPeerTable() -{ - if (!clientModel) - return; - - // peerWidget needs a resize in case the dialog has non-default geometry - columnResizingFixer->stretchColumnWidth(PeerTableModel::Address); - - // start PeerTableModel auto refresh - clientModel->getPeerTableModel()->startAutoRefresh(1000); -} - -// We override the virtual resizeEvent of the QWidget to adjust tables column -// sizes as the tables width is proportional to the dialogs width. void RPCConsole::resizeEvent(QResizeEvent *event) { QWidget::resizeEvent(event); - - if (!clientModel) - return; - - columnResizingFixer->stretchColumnWidth(PeerTableModel::Address); } void RPCConsole::showEvent(QShowEvent *event) { QWidget::showEvent(event); - initPeerTable(); + if (!clientModel) + return; + + // start PeerTableModel auto refresh + clientModel->getPeerTableModel()->startAutoRefresh(); } void RPCConsole::hideEvent(QHideEvent *event) diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 94672b30cc..64bb5c29b3 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -44,21 +44,6 @@ public: protected: virtual bool eventFilter(QObject* obj, QEvent *event); -private: - /** show detailed information on ui about selected node */ - void updateNodeDetail(const CNodeCombinedStats *combinedStats); - /** initialize peer table */ - void initPeerTable(); - - enum ColumnWidths - { - ADDRESS_COLUMN_WIDTH = 250, - MINIMUM_COLUMN_WIDTH = 120 - }; - - /** track the node that we are currently viewing detail on in the peers tab */ - CNodeCombinedStats detailNodeStats; - private slots: void on_lineEdit_returnPressed(); void on_tabWidget_currentChanged(int index); @@ -96,15 +81,23 @@ signals: private: static QString FormatBytes(quint64 bytes); + void startExecutor(); void setTrafficGraphRange(int mins); + /** show detailed information on ui about selected node */ + void updateNodeDetail(const CNodeCombinedStats *stats); + + enum ColumnWidths + { + ADDRESS_COLUMN_WIDTH = 200, + SUBVERSION_COLUMN_WIDTH = 100, + PING_COLUMN_WIDTH = 80 + }; Ui::RPCConsole *ui; ClientModel *clientModel; QStringList history; - GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer; int historyPtr; - - void startExecutor(); + NodeId cachedNodeid; }; #endif // RPCCONSOLE_H From 488a61643908e8e872326a79e1143d1f377d412b Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 4 Aug 2014 16:41:42 +0200 Subject: [PATCH 0473/1288] qt: Demote ReportInvalidCertificate message to qDebug Too spammy. --- src/qt/paymentserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 76fd2733a5..a9f1566d62 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -90,7 +90,7 @@ static QList savedPaymentRequests; static void ReportInvalidCertificate(const QSslCertificate& cert) { - qWarning() << "ReportInvalidCertificate : Payment server found an invalid certificate: " << cert.subjectInfo(QSslCertificate::CommonName); + qDebug() << "ReportInvalidCertificate : Payment server found an invalid certificate: " << cert.subjectInfo(QSslCertificate::CommonName); } // From 70b9d36a2c7b900a80323e33ddc06b14d28fe538 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Thu, 31 Jul 2014 11:43:50 -0400 Subject: [PATCH 0474/1288] Log "version" message IP addresses in client connect summary The only other method of logging remote addresses is via -logips=1 -debug=net which increases the logged activity by 100x or more. Github-Pull: #4608 Amended-By: Wladimir J. van der Laan --- src/main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index cf9318fedf..ba521b6b19 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3628,7 +3628,14 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, pfrom->fSuccessfullyConnected = true; - LogPrintf("receive version message: %s: version %d, blocks=%d, us=%s, peer=%d\n", pfrom->cleanSubVer, pfrom->nVersion, pfrom->nStartingHeight, addrMe.ToString(), pfrom->id); + string remoteAddr; + if (fLogIPs) + remoteAddr = ", peeraddr=" + pfrom->addr.ToString(); + + LogPrintf("receive version message: %s: version %d, blocks=%d, us=%s, peer=%d%s\n", + pfrom->cleanSubVer, pfrom->nVersion, + pfrom->nStartingHeight, addrMe.ToString(), pfrom->id, + remoteAddr); AddTimeData(pfrom->addr, nTime); } From ead6737b87ee238aa0c7f81f9186c62f15ab8d67 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 4 Aug 2014 16:25:21 +0200 Subject: [PATCH 0475/1288] [Qt] format ping times in peers tab as ms - also align ping times to the right --- src/qt/guiutil.cpp | 2 +- src/qt/peertablemodel.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 6258c4160c..ed83909608 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -806,7 +806,7 @@ QString formatServicesStr(uint64_t mask) QString formatPingTime(double dPingTime) { - return dPingTime == 0 ? QObject::tr("N/A") : QString(QObject::tr("%1 s")).arg(QString::number(dPingTime, 'f', 3)); + return dPingTime == 0 ? QObject::tr("N/A") : QString(QObject::tr("%1 ms")).arg(QString::number((int)(dPingTime * 1000), 10)); } } // namespace GUIUtil diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp index 4c650bdec9..54b46867ea 100644 --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -152,8 +152,7 @@ QVariant PeerTableModel::data(const QModelIndex &index, int role) const CNodeCombinedStats *rec = static_cast(index.internalPointer()); - if(role == Qt::DisplayRole) - { + if (role == Qt::DisplayRole) { switch(index.column()) { case Address: @@ -163,7 +162,11 @@ QVariant PeerTableModel::data(const QModelIndex &index, int role) const case Ping: return GUIUtil::formatPingTime(rec->nodeStats.dPingTime); } + } else if (role == Qt::TextAlignmentRole) { + if (index.column() == Ping) + return (int)(Qt::AlignRight | Qt::AlignVCenter); } + return QVariant(); } From a409467e1416098ccb4a70b80a1ef3a5bde7519a Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 4 Aug 2014 21:09:38 +0200 Subject: [PATCH 0476/1288] more Bitcoin -> Bitcoin Core string changes --- src/qt/bitcoin.cpp | 6 +++--- src/qt/bitcoingui.cpp | 6 +++--- src/qt/intro.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 7bf531f538..ea706d9f25 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -531,14 +531,14 @@ int main(int argc, char *argv[]) /// - Do not call GetDataDir(true) before this step finishes if (!boost::filesystem::is_directory(GetDataDir(false))) { - QMessageBox::critical(0, QObject::tr("Bitcoin"), + QMessageBox::critical(0, QObject::tr("Bitcoin Core"), QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"]))); return 1; } try { ReadConfigFile(mapArgs, mapMultiArgs); } catch(std::exception &e) { - QMessageBox::critical(0, QObject::tr("Bitcoin"), + QMessageBox::critical(0, QObject::tr("Bitcoin Core"), QObject::tr("Error: Cannot parse configuration file: %1. Only use key=value syntax.").arg(e.what())); return false; } @@ -551,7 +551,7 @@ int main(int argc, char *argv[]) // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause) if (!SelectParamsFromCommandLine()) { - QMessageBox::critical(0, QObject::tr("Bitcoin"), QObject::tr("Error: Invalid combination of -regtest and -testnet.")); + QMessageBox::critical(0, QObject::tr("Bitcoin Core"), QObject::tr("Error: Invalid combination of -regtest and -testnet.")); return 1; } #ifdef ENABLE_WALLET diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 5fc2f500b5..e3257e859c 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -272,7 +272,7 @@ void BitcoinGUI::createActions(bool fIsTestnet) aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About Bitcoin Core"), this); else aboutAction = new QAction(QIcon(":/icons/bitcoin_testnet"), tr("&About Bitcoin Core"), this); - aboutAction->setStatusTip(tr("Show information about Bitcoin")); + aboutAction->setStatusTip(tr("Show information about Bitcoin Core")); aboutAction->setMenuRole(QAction::AboutRole); #if QT_VERSION < 0x050000 aboutQtAction = new QAction(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png"), tr("About &Qt"), this); @@ -478,12 +478,12 @@ void BitcoinGUI::createTrayIcon(bool fIsTestnet) if (!fIsTestnet) { - trayIcon->setToolTip(tr("Bitcoin client")); + trayIcon->setToolTip(tr("Bitcoin Core client")); trayIcon->setIcon(QIcon(":/icons/toolbar")); } else { - trayIcon->setToolTip(tr("Bitcoin client") + " " + tr("[testnet]")); + trayIcon->setToolTip(tr("Bitcoin Core client") + " " + tr("[testnet]")); trayIcon->setIcon(QIcon(":/icons/toolbar_testnet")); } diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp index 13c260b7db..d469c9a0bd 100644 --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -181,7 +181,7 @@ void Intro::pickDataDirectory() TryCreateDirectory(GUIUtil::qstringToBoostPath(dataDir)); break; } catch(fs::filesystem_error &e) { - QMessageBox::critical(0, tr("Bitcoin"), + QMessageBox::critical(0, tr("Bitcoin Core"), tr("Error: Specified data directory \"%1\" cannot be created.").arg(dataDir)); /* fall through, back to choosing screen */ } From 9ce0774aba7004c3f633fd57ed6707e759a9c7a9 Mon Sep 17 00:00:00 2001 From: ntrgn Date: Tue, 5 Aug 2014 00:59:28 +0200 Subject: [PATCH 0477/1288] build: Fix windows configure when using --with-qt-libdir fixes #4630 Github-Pull: #4633 --- src/m4/bitcoin_qt.m4 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/m4/bitcoin_qt.m4 b/src/m4/bitcoin_qt.m4 index 9356aac37f..5017742cc2 100644 --- a/src/m4/bitcoin_qt.m4 +++ b/src/m4/bitcoin_qt.m4 @@ -357,6 +357,11 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ ]) BITCOIN_QT_CHECK([ + LIBS= + if test x$qt_lib_path != x; then + LIBS="$LIBS -L$qt_lib_path" + fi + if test x$TARGET_OS == xwindows; then AC_CHECK_LIB([imm32], [main],, BITCOIN_QT_FAIL(libimm32 not found)) fi From e17151ad2a45599e8cad90552ffcd979730b7a32 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 6 Aug 2014 13:01:49 +0200 Subject: [PATCH 0478/1288] Avoid a copy in RPC output Split up HTTPReply into HTTPReply and HTTPReplyHeader, so that the message data can be streamed directly. Also removes a c_str(), which would have prevented binary output with NUL characters in it. --- src/rpcprotocol.cpp | 23 +++++++++++++++-------- src/rpcprotocol.h | 2 ++ src/rpcserver.cpp | 2 +- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp index 9e18ca847e..48c6c68eb1 100644 --- a/src/rpcprotocol.cpp +++ b/src/rpcprotocol.cpp @@ -93,8 +93,7 @@ string HTTPError(int nStatus, bool keepalive, bool headersOnly) headersOnly, "text/plain"); } -string HTTPReply(int nStatus, const string& strMsg, bool keepalive, - bool headersOnly, const char *contentType) +string HTTPReplyHeader(int nStatus, bool keepalive, size_t contentLength, const char *contentType) { return strprintf( "HTTP/1.1 %d %s\r\n" @@ -103,17 +102,25 @@ string HTTPReply(int nStatus, const string& strMsg, bool keepalive, "Content-Length: %u\r\n" "Content-Type: %s\r\n" "Server: bitcoin-json-rpc/%s\r\n" - "\r\n" - "%s", + "\r\n", nStatus, httpStatusDescription(nStatus), rfc1123Time(), keepalive ? "keep-alive" : "close", - (headersOnly ? 0 : strMsg.size()), + contentLength, contentType, - FormatFullVersion(), - (headersOnly ? "" : strMsg.c_str()) - ); + FormatFullVersion()); +} + +string HTTPReply(int nStatus, const string& strMsg, bool keepalive, + bool headersOnly, const char *contentType) +{ + if (headersOnly) + { + return HTTPReplyHeader(nStatus, keepalive, 0, contentType); + } else { + return HTTPReplyHeader(nStatus, keepalive, strMsg.size(), contentType) + strMsg; + } } bool ReadHTTPRequestLine(std::basic_istream& stream, int &proto, diff --git a/src/rpcprotocol.h b/src/rpcprotocol.h index 5627077bfb..a088c379d3 100644 --- a/src/rpcprotocol.h +++ b/src/rpcprotocol.h @@ -143,6 +143,8 @@ private: std::string HTTPPost(const std::string& strMsg, const std::map& mapRequestHeaders); std::string HTTPError(int nStatus, bool keepalive, bool headerOnly = false); +std::string HTTPReplyHeader(int nStatus, bool keepalive, size_t contentLength, + const char *contentType = "application/json"); std::string HTTPReply(int nStatus, const std::string& strMsg, bool keepalive, bool headerOnly = false, const char *contentType = "application/json"); diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 716a7fba6a..d9a664dc54 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -862,7 +862,7 @@ static bool HTTPReq_JSONRPC(AcceptedConnection *conn, else throw JSONRPCError(RPC_PARSE_ERROR, "Top-level object parse error"); - conn->stream() << HTTPReply(HTTP_OK, strReply, fRun) << std::flush; + conn->stream() << HTTPReplyHeader(HTTP_OK, fRun, strReply.size()) << strReply << std::flush; } catch (Object& objError) { From 733177ebd3ecf3a03c2acb6b244c8b3d1b4a3981 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 6 Aug 2014 13:03:58 +0200 Subject: [PATCH 0479/1288] Remove size limit in RPC client, keep it in server The size limit makes a lot of sense for the server, as it never has to accept very large data. The client, however, can request arbitrary amounts of data with `listtransactions` on a large wallet. Fixes #4604. --- src/bitcoin-cli.cpp | 2 +- src/rpcprotocol.cpp | 4 ++-- src/rpcprotocol.h | 2 +- src/rpcserver.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 3b991f9276..0609adcab3 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -126,7 +126,7 @@ Object CallRPC(const string& strMethod, const Array& params) // Receive HTTP reply message headers and body map mapHeaders; string strReply; - ReadHTTPMessage(stream, mapHeaders, strReply, nProto); + ReadHTTPMessage(stream, mapHeaders, strReply, nProto, std::numeric_limits::max()); if (nStatus == HTTP_UNAUTHORIZED) throw runtime_error("incorrect rpcuser or rpcpassword (authorization failed)"); diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp index 48c6c68eb1..643208b3b6 100644 --- a/src/rpcprotocol.cpp +++ b/src/rpcprotocol.cpp @@ -201,14 +201,14 @@ int ReadHTTPHeaders(std::basic_istream& stream, map& mapHe int ReadHTTPMessage(std::basic_istream& stream, map& mapHeadersRet, string& strMessageRet, - int nProto) + int nProto, size_t max_size) { mapHeadersRet.clear(); strMessageRet = ""; // Read header int nLen = ReadHTTPHeaders(stream, mapHeadersRet); - if (nLen < 0 || nLen > (int)MAX_SIZE) + if (nLen < 0 || (size_t)nLen > max_size) return HTTP_INTERNAL_SERVER_ERROR; // Read message diff --git a/src/rpcprotocol.h b/src/rpcprotocol.h index a088c379d3..8f05c08482 100644 --- a/src/rpcprotocol.h +++ b/src/rpcprotocol.h @@ -153,7 +153,7 @@ bool ReadHTTPRequestLine(std::basic_istream& stream, int &proto, int ReadHTTPStatus(std::basic_istream& stream, int &proto); int ReadHTTPHeaders(std::basic_istream& stream, std::map& mapHeadersRet); int ReadHTTPMessage(std::basic_istream& stream, std::map& mapHeadersRet, - std::string& strMessageRet, int nProto); + std::string& strMessageRet, int nProto, size_t max_size); std::string JSONRPCRequest(const std::string& strMethod, const json_spirit::Array& params, const json_spirit::Value& id); json_spirit::Object JSONRPCReplyObj(const json_spirit::Value& result, const json_spirit::Value& error, const json_spirit::Value& id); std::string JSONRPCReply(const json_spirit::Value& result, const json_spirit::Value& error, const json_spirit::Value& id); diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index d9a664dc54..e7ed73310c 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -891,7 +891,7 @@ void ServiceConnection(AcceptedConnection *conn) break; // Read HTTP message headers and body - ReadHTTPMessage(conn->stream(), mapHeaders, strRequest, nProto); + ReadHTTPMessage(conn->stream(), mapHeaders, strRequest, nProto, MAX_SIZE); // HTTP Keep-Alive is false; close connection immediately if (mapHeaders["connection"] == "close") From e05d72055aee7937fc6e0cda8a25f4bde88a2a13 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 6 Aug 2014 16:11:45 +0200 Subject: [PATCH 0480/1288] qt: bitcoin_en update after 8d0d512 --- src/qt/locale/bitcoin_en.ts | 179 +++++++++++++++++++----------------- 1 file changed, 93 insertions(+), 86 deletions(-) diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index 2c95b5bba6..a527602b5a 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -331,12 +331,7 @@ Quit application - - Show information about Bitcoin - Show information about Bitcoin - - - + About &Qt About &Qt @@ -382,7 +377,13 @@ - + + + Bitcoin Core client + + + + Importing blocks from disk... Importing blocks from disk... @@ -447,7 +448,12 @@ &Receive - + + Show information about Bitcoin Core + + + + &Show / Hide &Show / Hide @@ -539,14 +545,8 @@ Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Bitcoin client - - + %n active connection(s) to Bitcoin network %n active connection to Bitcoin network @@ -1159,8 +1159,8 @@ Address: %4 - Bitcoin - Bitcoin + Bitcoin Core + Bitcoin Core @@ -1681,18 +1681,18 @@ Address: %4 PeerTableModel - - Address - Address - - - + User Agent - Start Height + Address/Hostname + + + + + Ping Time @@ -1743,6 +1743,16 @@ Address: %4 None + + + N/A + N/A + + + + %1 ms + + QRImageWidget @@ -1785,26 +1795,25 @@ Address: %4 - - - - - - - - - - - - - - - + + + + + + + + + + + + + + N/A N/A - + Client version Client version @@ -1879,82 +1888,84 @@ Address: %4 - + + + Select a peer to view detailed information. - - Version: + + Direction - - Last Receive: + + Version - - User Agent: + + User Agent - - Ping Time: + + Services - - Connection Time: + + Sync Node - - Starting Height: + + Starting Height - - Bytes Sent: + + Sync Height - - Bytes Received: + + Ban Score - - Ban Score: + + Connection Time - - Direction: + + Last Send - - Sync Node: + + Last Receive - - Last Send: + + Bytes Sent - - Services: + + Bytes Received - - IP Address/port: + + Ping Time - + Last block time Last block time @@ -1984,7 +1995,7 @@ Address: %4 - + In: @@ -2029,7 +2040,7 @@ Address: %4 Type <b>help</b> for an overview of available commands. - + %1 B @@ -2049,13 +2060,8 @@ Address: %4 - - Peer Disconnected - - - - - Node Detail + + via %1 @@ -2065,12 +2071,7 @@ Address: %4 - - %1 secs - - - - + Inbound @@ -2090,7 +2091,13 @@ Address: %4 - + + Unknown + + + + + Fetching... From a98356fee8a44d7d1cb37f22c876fff8f244365e Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 23 Jul 2014 01:00:55 -0400 Subject: [PATCH 0481/1288] build: don't let libtool insert rpath into binaries --- configure.ac | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/configure.ac b/configure.ac index 719b06da67..c0ade515ec 100644 --- a/configure.ac +++ b/configure.ac @@ -717,3 +717,14 @@ AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist]) AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh]) AC_CONFIG_FILES([qa/pull-tester/build-tests.sh],[chmod +x qa/pull-tester/build-tests.sh]) AC_OUTPUT + +dnl Taken from https://wiki.debian.org/RpathIssue +case $host in + *-*-linux-gnu) + AC_MSG_RESULT([Fixing libtool for -rpath problems.]) + sed < libtool > libtool-2 \ + 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/' + mv libtool-2 libtool + chmod 755 libtool + ;; +esac From eccd58567d91e6df6d49c4e1a65e5ef9c8869a36 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 6 Aug 2014 17:02:01 -0400 Subject: [PATCH 0482/1288] build: silence mingw fpic warning spew --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index c0ade515ec..0b2a429e02 100644 --- a/configure.ac +++ b/configure.ac @@ -345,7 +345,6 @@ fi if test x$use_hardening != xno; then AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"]) AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"]) - AX_CHECK_COMPILE_FLAG([-fPIE],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fPIE"]) AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=2],[ AX_CHECK_PREPROC_FLAG([-U_FORTIFY_SOURCE],[ @@ -360,7 +359,8 @@ if test x$use_hardening != xno; then AX_CHECK_LINK_FLAG([[-Wl,-z,now]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"]) if test x$TARGET_OS != xwindows; then - # -pie will link successfully with MinGW, but it's unsupported and leads to undeterministic binaries + # All windows code is PIC, forcing it on just adds useless compile warnings + AX_CHECK_COMPILE_FLAG([-fPIE],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fPIE"]) AX_CHECK_LINK_FLAG([[-pie]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"]) fi From f8120f7e0f7194cb53d7626f3c401e2793361317 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 23 Jul 2014 01:01:38 -0400 Subject: [PATCH 0483/1288] build: Find the proper xcb/pcre dependencies --- src/m4/bitcoin_qt.m4 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/m4/bitcoin_qt.m4 b/src/m4/bitcoin_qt.m4 index 5017742cc2..6b2b93560d 100644 --- a/src/m4/bitcoin_qt.m4 +++ b/src/m4/bitcoin_qt.m4 @@ -123,7 +123,8 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)],[-lqwindows]) AC_DEFINE(QT_QPA_PLATFORM_WINDOWS, 1, [Define this symbol if the qt platform is windows]) elif test x$TARGET_OS == xlinux; then - _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)],[-lqxcb -lxcb-static -lxcb]) + PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"]) + _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)],[-lqxcb -lxcb-static]) AC_DEFINE(QT_QPA_PLATFORM_XCB, 1, [Define this symbol if the qt platform is xcb]) elif test x$TARGET_OS == xdarwin; then if test x$use_pkgconfig = xyes; then @@ -370,7 +371,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ BITCOIN_QT_CHECK(AC_CHECK_LIB([z] ,[main],,AC_MSG_WARN([zlib not found. Assuming qt has it built-in]))) BITCOIN_QT_CHECK(AC_CHECK_LIB([png] ,[main],,AC_MSG_WARN([libpng not found. Assuming qt has it built-in]))) BITCOIN_QT_CHECK(AC_CHECK_LIB([jpeg] ,[main],,AC_MSG_WARN([libjpeg not found. Assuming qt has it built-in]))) - BITCOIN_QT_CHECK(AC_CHECK_LIB([pcre] ,[main],,AC_MSG_WARN([libpcre not found. Assuming qt has it built-in]))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([pcre16] ,[main],,AC_MSG_WARN([libpcre16 not found. Assuming qt has it built-in]))) BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Core] ,[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXCore not found))) BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Gui] ,[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXGui not found))) BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Network],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXNetwork not found))) From 71941ce580cac1f727bf19ba3226ca55e27d29fe Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 4 Aug 2014 14:37:33 -0400 Subject: [PATCH 0484/1288] build: teach macdeploy the -translations-dir argument, for use with static qt When QT is linked statically, macdeploy can't infer its paths. While plugins and frameworks don't need to be packaged, translations still do (for now). --- contrib/macdeploy/macdeployqtplus | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index eece81dd3d..23b57a76b3 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -449,6 +449,7 @@ ap.add_argument("-sign", dest="sign", action="store_true", default=False, help=" ap.add_argument("-dmg", nargs="?", const="", metavar="basename", help="create a .dmg disk image; if basename is not specified, a camel-cased version of the app name is used") ap.add_argument("-fancy", nargs=1, metavar="plist", default=[], help="make a fancy looking disk image using the given plist file with instructions; requires -dmg to work") ap.add_argument("-add-qt-tr", nargs=1, metavar="languages", default=[], help="add Qt translation files to the bundle's ressources; the language list must be separated with commas, not with whitespace") +ap.add_argument("-translations-dir", nargs=1, metavar="path", default=None, help="Path to Qt's translation files") ap.add_argument("-add-resources", nargs="+", metavar="path", default=[], help="list of additional files or folders to be copied into the bundle's resources; must be the last argument") config = ap.parse_args() @@ -467,6 +468,15 @@ if not os.path.exists(app_bundle): app_bundle_name = os.path.splitext(os.path.basename(app_bundle))[0] # ------------------------------------------------ +translations_dir = None +if config.translations_dir and config.translations_dir[0]: + if os.path.exists(config.translations_dir[0]): + translations_dir = config.translations_dir[0] + else: + if verbose >= 1: + sys.stderr.write("Error: Could not find translation dir \"%s\"\n" % (translations_dir)) + sys.exit(1) +# ------------------------------------------------ for p in config.add_resources: if verbose >= 3: @@ -590,7 +600,14 @@ if config.plugins: if len(config.add_qt_tr) == 0: add_qt_tr = [] else: - qt_tr_dir = os.path.join(deploymentInfo.qtPath, "translations") + if translations_dir is not None: + qt_tr_dir = translations_dir + else: + if deploymentInfo.qtPath is not None: + qt_tr_dir = os.path.join(deploymentInfo.qtPath, "translations") + else: + sys.stderr.write("Error: Could not find Qt translation path\n") + sys.exit(1) add_qt_tr = ["qt_%s.qm" % lng for lng in config.add_qt_tr[0].split(",")] for lng_file in add_qt_tr: p = os.path.join(qt_tr_dir, lng_file) From d597219d6d95af1336dfc3d9a69e4578660fd191 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 4 Aug 2014 14:39:13 -0400 Subject: [PATCH 0485/1288] build: add --with-qt-translationdir to configure for use with static qt --- src/m4/bitcoin_qt.m4 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/m4/bitcoin_qt.m4 b/src/m4/bitcoin_qt.m4 index 6b2b93560d..4c1d40c394 100644 --- a/src/m4/bitcoin_qt.m4 +++ b/src/m4/bitcoin_qt.m4 @@ -62,6 +62,7 @@ AC_DEFUN([BITCOIN_QT_INIT],[ AC_ARG_WITH([qt-incdir],[AS_HELP_STRING([--with-qt-incdir=INC_DIR],[specify qt include path (overridden by pkgconfig)])], [qt_include_path=$withval], []) AC_ARG_WITH([qt-libdir],[AS_HELP_STRING([--with-qt-libdir=LIB_DIR],[specify qt lib path (overridden by pkgconfig)])], [qt_lib_path=$withval], []) AC_ARG_WITH([qt-plugindir],[AS_HELP_STRING([--with-qt-plugindir=PLUGIN_DIR],[specify qt plugin path (overridden by pkgconfig)])], [qt_plugin_path=$withval], []) + AC_ARG_WITH([qt-translationdir],[AS_HELP_STRING([--with-qt-translationdir=PLUGIN_DIR],[specify qt translation path (overridden by pkgconfig)])], [qt_translation_path=$withval], []) AC_ARG_WITH([qt-bindir],[AS_HELP_STRING([--with-qt-bindir=BIN_DIR],[specify qt bin path])], [qt_bin_path=$withval], []) AC_ARG_WITH([qtdbus], @@ -69,6 +70,8 @@ AC_DEFUN([BITCOIN_QT_INIT],[ [enable DBus support (default is yes if qt is enabled and QtDBus is found)])], [use_dbus=$withval], [use_dbus=auto]) + + AC_SUBST(QT_TRANSLATION_DIR,$qt_translation_path) ]) dnl Find the appropriate version of Qt libraries and includes. From 206a7f9de6ad8fdd30ebc1a0cd812b891e005563 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 4 Aug 2014 14:40:19 -0400 Subject: [PATCH 0486/1288] build: hook up qt translations for static osx packaging --- Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 951d7581fb..63a22a2cc1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -83,11 +83,11 @@ OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lp if BUILD_DARWIN $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) - $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2 + $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2 else $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) - INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2 + INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -verbose 2 $(MKDIR_P) dist/.background $(INSTALL) contrib/macdeploy/background.png dist/.background $(INSTALL) contrib/macdeploy/DS_Store dist/.DS_Store From d3434601baa8b2b8513ae08fcac99053860165ad Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 4 Aug 2014 17:35:33 -0400 Subject: [PATCH 0487/1288] build: Fix 'make deploy' when binaries haven't been built yet --- Makefile.am | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile.am b/Makefile.am index 63a22a2cc1..123a22525c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -103,6 +103,15 @@ if TARGET_WINDOWS deploy: $(BITCOIN_WIN_INSTALLER) endif +$(BITCOIN_QT_BIN): FORCE + $(MAKE) -C src qt/$(@F) + +$(BITCOIND_BIN): FORCE + $(MAKE) -C src $(@F) + +$(BITCOIN_CLI_BIN): FORCE + $(MAKE) -C src $(@F) + if USE_LCOV baseline.info: From 6b271a3911b10a9d100341b8dc31ed92074a43c3 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 4 Aug 2014 19:11:46 -0400 Subject: [PATCH 0488/1288] build: fix race in 'make deploy' for windows The binary builds can clobber eachother, so use a single subdir dependency instead. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 123a22525c..a64666a32b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -46,7 +46,7 @@ distcheck-hook: distcleancheck: @: -$(BITCOIN_WIN_INSTALLER): $(BITCOIND_BIN) $(BITCOIN_QT_BIN) $(BITCOIN_CLI_BIN) +$(BITCOIN_WIN_INSTALLER): all-recursive $(MKDIR_P) $(top_builddir)/release STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release From 6c23b082033b627f31170166c07ab35fa6be9343 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 5 Aug 2014 13:33:26 +0200 Subject: [PATCH 0489/1288] CCoinsKeyHasher::operator() should return size_t It currently returns uint64_t, which on older boost (at least 1.46) causes test failures on 32-bit systems. This problem was introduced in bc42503. Fixes #4634. --- src/coins.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/coins.h b/src/coins.h index 9f90fe6bd0..ff60288163 100644 --- a/src/coins.h +++ b/src/coins.h @@ -247,7 +247,10 @@ private: public: CCoinsKeyHasher(); - uint64_t operator()(const uint256& key) const { + // This *must* return size_t. With Boost 1.46 on 32-bit systems the + // unordered_map will behave unpredictably if the custom hasher returns a + // uint64_t, resulting in failures when syncing the chain (#4634). + size_t operator()(const uint256& key) const { return key.GetHash(salt); } }; From b6884b8594813ab0cf539022a73e9ab45badee33 Mon Sep 17 00:00:00 2001 From: Ben Holden-Crowther Date: Thu, 7 Aug 2014 09:56:03 +0100 Subject: [PATCH 0490/1288] Added bullet point To make it easier to add new requirements if necessary --- doc/bootstrap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/bootstrap.md b/doc/bootstrap.md index 685b768f8b..7ce71abaad 100644 --- a/doc/bootstrap.md +++ b/doc/bootstrap.md @@ -4,7 +4,7 @@ Normally the Bitcoin client will download the transaction and network informatio ### Requirements -A fresh install of the Bitcoin client software. +- A fresh install of the Bitcoin client software. ### Download the blockchain via Bittorent From 292cc072f3bada256bc6af9970512eb9dec8d93a Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 6 Aug 2014 15:06:40 -0400 Subject: [PATCH 0491/1288] qt: fix unicode character display on osx when building with 10.7 sdk --- src/qt/bitcoin.cpp | 3 +++ src/qt/guiutil.cpp | 27 +++++++++++++++++++++++++++ src/qt/guiutil.h | 4 ++++ 3 files changed, 34 insertions(+) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index ea706d9f25..a43e7cb756 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -489,6 +489,9 @@ int main(int argc, char *argv[]) Q_INIT_RESOURCE(bitcoin); Q_INIT_RESOURCE(bitcoin_locale); + + GUIUtil::SubstituteFonts(); + BitcoinApplication app(argc, argv); #if QT_VERSION > 0x050100 // Generate high-dpi pixmaps diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index ed83909608..38fbc48a4d 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -63,6 +63,13 @@ static boost::filesystem::detail::utf8_codecvt_facet utf8; #endif +#if defined(Q_OS_MAC) +extern double NSAppKitVersionNumber; +#if !defined(NSAppKitVersionNumber10_9) +#define NSAppKitVersionNumber10_9 1265 +#endif +#endif + namespace GUIUtil { QString dateTimeStr(const QDateTime &date) @@ -376,6 +383,26 @@ ToolTipToRichTextFilter::ToolTipToRichTextFilter(int size_threshold, QObject *pa } +void SubstituteFonts() +{ +#if defined(Q_OS_MAC) +// Background: +// OSX's default font changed in 10.9 and QT is unable to find it with its +// usual fallback methods when building against the 10.7 sdk or lower. +// The 10.8 SDK added a function to let it find the correct fallback font. +// If this fallback is not properly loaded, some characters may fail to +// render correctly. +// +// Solution: If building with the 10.7 SDK or lower and the user's platform +// is 10.9 or higher at runtime, substitute the correct font. This needs to +// happen before the QApplication is created. +#if defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8 + if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_9) + QFont::insertSubstitution(".Lucida Grande UI", "Lucida Grande"); +#endif +#endif +} + bool ToolTipToRichTextFilter::eventFilter(QObject *obj, QEvent *evt) { if(evt->type() == QEvent::ToolTipChange) diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index dd31d051ee..83739a5f13 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -106,6 +106,10 @@ namespace GUIUtil representation if needed. This assures that Qt can word-wrap long tooltip messages. Tooltips longer than the provided size threshold (in characters) are wrapped. */ + + // Replace invalid default fonts with known good ones + void SubstituteFonts(); + class ToolTipToRichTextFilter : public QObject { Q_OBJECT From c4a77090c4b5a8346f3d312be41c1ee50830a21a Mon Sep 17 00:00:00 2001 From: ntrgn Date: Thu, 7 Aug 2014 20:02:35 +0200 Subject: [PATCH 0492/1288] Fixes ignored qt 4.8 codecs path on windows when configuring with --with-qt-libdir --- src/m4/bitcoin_qt.m4 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/m4/bitcoin_qt.m4 b/src/m4/bitcoin_qt.m4 index 4c1d40c394..fa5c990cf7 100644 --- a/src/m4/bitcoin_qt.m4 +++ b/src/m4/bitcoin_qt.m4 @@ -112,11 +112,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) if test x$qt_plugin_path != x; then QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible" - if test x$bitcoin_qt_got_major_vers == x5; then - QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms" - else - QT_LIBS="$QT_LIBS -L$qt_plugin_path/codecs" - fi + QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms" fi if test x$use_pkgconfig = xyes; then PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"]) @@ -141,6 +137,10 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ else if test x$TARGET_OS == xwindows; then AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) + if test x$qt_plugin_path != x; then + QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible" + QT_LIBS="$QT_LIBS -L$qt_plugin_path/codecs" + fi _BITCOIN_QT_CHECK_STATIC_PLUGINS([ Q_IMPORT_PLUGIN(qcncodecs) Q_IMPORT_PLUGIN(qjpcodecs) From efd6b87811351cde592ac48247190e682ad02aea Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 16 Jun 2014 15:55:39 +0200 Subject: [PATCH 0493/1288] small net cleanup - add comment for disabling sigpipe - add closing comment in compat.h - remove redundant check in net.h --- src/compat.h | 4 ++-- src/net.h | 7 +++---- src/netbase.cpp | 1 + 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/compat.h b/src/compat.h index 1b3a60d11b..52c7817130 100644 --- a/src/compat.h +++ b/src/compat.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers +// Copyright (c) 2009-2014 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -59,4 +59,4 @@ typedef u_int SOCKET; #define SOCKET_ERROR -1 #endif -#endif +#endif // _BITCOIN_COMPAT_H diff --git a/src/net.h b/src/net.h index 2d9325abf9..a8795a4760 100644 --- a/src/net.h +++ b/src/net.h @@ -356,12 +356,11 @@ public: ~CNode() { - if (hSocket != INVALID_SOCKET) - { - CloseSocket(hSocket); - } + CloseSocket(hSocket); + if (pfilter) delete pfilter; + GetNodeSignals().FinalizeNode(GetId()); } diff --git a/src/netbase.cpp b/src/netbase.cpp index af6d11f0e2..1031e7e38a 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -334,6 +334,7 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe #ifdef SO_NOSIGPIPE int set = 1; + // Different way of disabling SIGPIPE on BSD setsockopt(hSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&set, sizeof(int)); #endif From 94e1b9e05b96e4fe639e5b07b7a53ea216170962 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 4 Aug 2014 13:50:17 +0200 Subject: [PATCH 0494/1288] [Qt] re-work overviewpage UI - ensure normal and watch-only stuff looks consistent - simplify UI by removing unneeded UI layout elements - change some comments to watch-only from watchonly --- src/qt/forms/overviewpage.ui | 683 +++++++++++++++++------------------ src/qt/overviewpage.cpp | 15 +- 2 files changed, 339 insertions(+), 359 deletions(-) diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui index df16295f77..7784a862d7 100644 --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -13,8 +13,8 @@ Form - - + + false @@ -30,7 +30,7 @@ - + @@ -46,369 +46,45 @@ - - - - - - 75 - true - - - - Wallet - - - - - - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - QLabel { color: red; } - - - (out of sync) - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - + + + + 75 + true + + + + Balances + + - - - - - - 75 - true - - - - Watch-only: - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 40 - 20 - - - - - - - - - - - - - - QFormLayout::AllNonFixedFieldsGrow + + + WhatsThisCursor - - 12 + + The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - 12 + + QLabel { color: red; } - - - - Available: - - - - - - - - 75 - true - - - - IBeamCursor - - - Your current spendable balance - - - 0 BTC - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Pending: - - - - - - - - 75 - true - - - - IBeamCursor - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - 0 BTC - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Immature: - - - - - - - - 75 - true - - - - IBeamCursor - - - Mined balance that has not yet matured - - - 0 BTC - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Qt::Horizontal - - - - - - - Total: - - - - - - - - 75 - true - - - - IBeamCursor - - - Your current total balance - - - 0 BTC - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - - QFormLayout::AllNonFixedFieldsGrow + + (out of sync) - - 12 + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - 12 - - - - - - 75 - true - - - - IBeamCursor - - - Your current balance in watch-only addresses - - - 0 BTC - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - 75 - true - - - - IBeamCursor - - - Unconfirmed transactions to watch-only addresses - - - 0 BTC - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - 75 - true - - - - IBeamCursor - - - Mined balance in watch-only addresses that has not yet matured - - - 0 BTC - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - 0 - 0 - - - - - 140 - 0 - - - - Qt::Horizontal - - - - - - - - 75 - true - - - - IBeamCursor - - - Current total balance in watch-only addresses - - - 0 BTC - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - +
Qt::Horizontal - - QSizePolicy::Expanding - - 20 + 40 20 @@ -416,6 +92,300 @@ + + + + 12 + + + + + + 75 + true + + + + IBeamCursor + + + Unconfirmed transactions to watch-only addresses + + + 0.000 000 00 BTC + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + 75 + true + + + + IBeamCursor + + + Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance + + + 0.000 000 00 BTC + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + 75 + true + + + + IBeamCursor + + + Mined balance in watch-only addresses that has not yet matured + + + 0.000 000 00 BTC + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Qt::Horizontal + + + + + + + + 0 + 0 + + + + + 140 + 0 + + + + Qt::Horizontal + + + + + + + Total: + + + + + + + + 75 + true + + + + IBeamCursor + + + Mined balance that has not yet matured + + + 0.000 000 00 BTC + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Immature: + + + + + + + + 75 + true + + + + IBeamCursor + + + Your current total balance + + + 0.000 000 00 BTC + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + 75 + true + + + + IBeamCursor + + + Current total balance in watch-only addresses + + + 0.000 000 00 BTC + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Watch-only: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Available: + + + + + + + + 75 + true + + + + IBeamCursor + + + Your current spendable balance + + + 0.000 000 00 BTC + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + 75 + true + + + + IBeamCursor + + + Your current balance in watch-only addresses + + + 0.000 000 00 BTC + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Pending: + + + + + + + Spendable: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + +
@@ -449,13 +419,22 @@ + + + 75 + true + + - <b>Recent transactions</b> + Recent transactions + + WhatsThisCursor + The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 1c700b37ff..b5a3de48ca 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -162,15 +162,16 @@ void OverviewPage::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 bool showWatchOnlyImmature = watchImmatureBalance != 0; bool showWatchOnly = (watchOnlyBalance != 0 || watchUnconfBalance != 0 || showWatchOnlyImmature); - // for symmetry reasons also show immature label when the watchonly one is shown + // for symmetry reasons also show immature label when the watch-only one is shown ui->labelImmature->setVisible(showImmature || showWatchOnlyImmature); ui->labelImmatureText->setVisible(showImmature || showWatchOnlyImmature); - ui->labelWatchonly->setVisible(showWatchOnly); // show Watchonly label - ui->lineWatchBalance->setVisible(showWatchOnly); // show watchonly balance separator line - ui->labelWatchAvailable->setVisible(showWatchOnly); // show watchonly available balance - ui->labelWatchImmature->setVisible(showWatchOnlyImmature); // show watchonly immature balance - ui->labelWatchPending->setVisible(showWatchOnly); // show watchonly pending balance - ui->labelWatchTotal->setVisible(showWatchOnly); // show watchonly total balance + ui->labelSpendable->setVisible(showWatchOnly); // show spendable label (only when watch-only is active) + ui->labelWatchonly->setVisible(showWatchOnly); // show watch-only label + ui->lineWatchBalance->setVisible(showWatchOnly); // show watch-only balance separator line + ui->labelWatchAvailable->setVisible(showWatchOnly); // show watch-only available balance + ui->labelWatchImmature->setVisible(showWatchOnlyImmature); // show watch-only immature balance + ui->labelWatchPending->setVisible(showWatchOnly); // show watch-only pending balance + ui->labelWatchTotal->setVisible(showWatchOnly); // show watch-only total balance } void OverviewPage::setClientModel(ClientModel *model) From c4bae530926853e59d0d9a3bdced91330ba56dd3 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 8 Aug 2014 10:03:13 +0200 Subject: [PATCH 0495/1288] [Qt] move SubstituteFonts() above ToolTipToRichTextFilter - doesn't belong to the ToolTipToRichTextFilter class so move it up --- src/qt/guiutil.cpp | 13 +++++++------ src/qt/guiutil.h | 7 +++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 38fbc48a4d..3b9b1226e1 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -377,12 +377,6 @@ void openDebugLogfile() QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathDebug))); } -ToolTipToRichTextFilter::ToolTipToRichTextFilter(int size_threshold, QObject *parent) : - QObject(parent), size_threshold(size_threshold) -{ - -} - void SubstituteFonts() { #if defined(Q_OS_MAC) @@ -403,6 +397,13 @@ void SubstituteFonts() #endif } +ToolTipToRichTextFilter::ToolTipToRichTextFilter(int size_threshold, QObject *parent) : + QObject(parent), + size_threshold(size_threshold) +{ + +} + bool ToolTipToRichTextFilter::eventFilter(QObject *obj, QEvent *evt) { if(evt->type() == QEvent::ToolTipChange) diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 83739a5f13..0ae5154d4b 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -102,14 +102,13 @@ namespace GUIUtil // Open debug.log void openDebugLogfile(); + // Replace invalid default fonts with known good ones + void SubstituteFonts(); + /** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text representation if needed. This assures that Qt can word-wrap long tooltip messages. Tooltips longer than the provided size threshold (in characters) are wrapped. */ - - // Replace invalid default fonts with known good ones - void SubstituteFonts(); - class ToolTipToRichTextFilter : public QObject { Q_OBJECT From 8ca6a1617687ce613b0426c2627ba79e710a695f Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 7 Aug 2014 09:34:31 +0200 Subject: [PATCH 0496/1288] [Qt] ensure all class attributes are init to 0 - in BitcoinGUI and UnitDisplayStatusBarControl --- src/qt/bitcoingui.cpp | 30 +++++++++++++++++++++++++++--- src/qt/bitcoingui.h | 1 + 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index e3257e859c..429b9a9fb3 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -61,9 +61,33 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : QMainWindow(parent), clientModel(0), walletFrame(0), + unitDisplayControl(0), + labelEncryptionIcon(0), + labelConnectionsIcon(0), + labelBlocksIcon(0), + progressBarLabel(0), + progressBar(0), + progressDialog(0), + appMenuBar(0), + overviewAction(0), + historyAction(0), + quitAction(0), + sendCoinsAction(0), + usedSendingAddressesAction(0), + usedReceivingAddressesAction(0), + signMessageAction(0), + verifyMessageAction(0), + aboutAction(0), + receiveCoinsAction(0), + optionsAction(0), + toggleHideAction(0), encryptWalletAction(0), + backupWalletAction(0), changePassphraseAction(0), aboutQtAction(0), + openRPCConsoleAction(0), + openAction(0), + showHelpMessageAction(0), trayIcon(0), notificator(0), rpcConsole(0), @@ -1006,9 +1030,10 @@ void BitcoinGUI::unsubscribeFromCoreSignals() uiInterface.ThreadSafeMessageBox.disconnect(boost::bind(ThreadSafeMessageBox, this, _1, _2, _3)); } -UnitDisplayStatusBarControl::UnitDisplayStatusBarControl():QLabel() +UnitDisplayStatusBarControl::UnitDisplayStatusBarControl() : + optionsModel(0), + menu(0) { - optionsModel = 0; createContextMenu(); setToolTip(tr("Unit to show amounts in. Click to select another unit.")); } @@ -1068,4 +1093,3 @@ void UnitDisplayStatusBarControl::onMenuSelection(QAction* action) optionsModel->setDisplayUnit(action->data()); } } - diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 30dd7ae317..7e45240f05 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -219,6 +219,7 @@ protected: private: OptionsModel *optionsModel; QMenu* menu; + /** Shows context menu with Display Unit options by the mouse coordinates */ void onDisplayUnitsClicked(const QPoint& point); /** Creates context menu, its actions, and wires up all the relevant signals for mouse events. */ From 314fbd9ac7713e812e85960499474dcf453b563e Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 7 Aug 2014 09:36:02 +0200 Subject: [PATCH 0497/1288] [Qt] use BitcoinGUI::DEFAULT_WALLET constant in bitcoin.cpp --- src/qt/bitcoin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index a43e7cb756..c0dee66931 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -414,8 +414,8 @@ void BitcoinApplication::initializeResult(int retval) { walletModel = new WalletModel(pwalletMain, optionsModel); - window->addWallet("~Default", walletModel); - window->setCurrentWallet("~Default"); + window->addWallet(BitcoinGUI::DEFAULT_WALLET, walletModel); + window->setCurrentWallet(BitcoinGUI::DEFAULT_WALLET); connect(walletModel, SIGNAL(coinsSent(CWallet*,SendCoinsRecipient,QByteArray)), paymentServer, SLOT(fetchPaymentACK(CWallet*,const SendCoinsRecipient&,QByteArray))); From b197bf3270490068319d87e4b977b08f754a1307 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 7 Aug 2014 09:37:21 +0200 Subject: [PATCH 0498/1288] [Qt] disable tray interactions when client model set to 0 - this prevents the ability to fiddle around with the system tray when already shutting down (e.g. on slow shutdowns because of a proxy delay) - extends solution for #4360 --- src/qt/bitcoingui.cpp | 13 +++++++++---- src/qt/bitcoingui.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 429b9a9fb3..e3665dfe6e 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -89,6 +89,7 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : openAction(0), showHelpMessageAction(0), trayIcon(0), + trayIconMenu(0), notificator(0), rpcConsole(0), prevBlocks(0), @@ -449,8 +450,12 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel) walletFrame->setClientModel(clientModel); } #endif - - this->unitDisplayControl->setOptionsModel(clientModel->getOptionsModel()); + unitDisplayControl->setOptionsModel(clientModel->getOptionsModel()); + } else { + // Disable possibility to show main window via action + toggleHideAction->setEnabled(false); + // Disable context menu on tray icon + trayIconMenu->clear(); } } @@ -519,7 +524,6 @@ void BitcoinGUI::createTrayIcon(bool fIsTestnet) void BitcoinGUI::createTrayIconMenu() { - QMenu *trayIconMenu; #ifndef Q_OS_MAC // return if trayIcon is unset (only on non-Mac OSes) if (!trayIcon) @@ -560,7 +564,7 @@ void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason) if(reason == QSystemTrayIcon::Trigger) { // Click on system tray icon triggers show/hide of the main window - toggleHideAction->trigger(); + toggleHidden(); } } #endif @@ -946,6 +950,7 @@ void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden) { if(!clientModel) return; + // activateWindow() (sometimes) helps with keyboard focus on Windows if (isHidden()) { diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 7e45240f05..30b05cb7d9 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -103,6 +103,7 @@ private: QAction *showHelpMessageAction; QSystemTrayIcon *trayIcon; + QMenu *trayIconMenu; Notificator *notificator; RPCConsole *rpcConsole; From c7f3876d4af37cfd6e587d0ab7ddbeaedda27857 Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Sat, 2 Aug 2014 19:56:06 +0100 Subject: [PATCH 0499/1288] URLs containing a / after the address no longer cause parsing errors. --- src/qt/guiutil.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 33a50a078d..75ae114059 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -117,6 +117,10 @@ bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out) SendCoinsRecipient rv; rv.address = uri.path(); + // Trim any following forward slash which may have been added by the OS + if (rv.address.endsWith("/")) { + rv.address.truncate(rv.address.length() - 1); + } rv.amount = 0; #if QT_VERSION < 0x050000 From 1dec09b341f61836147d87656aea7f7be02aab6d Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 23 Jul 2014 01:31:30 -0400 Subject: [PATCH 0500/1288] depends: add shared dependency builder See the README's in depends for documentation --- depends/.gitignore | 5 + depends/Makefile | 114 ++ depends/README | 55 + depends/README.packages | 116 ++ depends/README.usage | 29 + depends/builders/darwin.mk | 22 + depends/builders/default.mk | 20 + depends/builders/linux.mk | 2 + depends/config.guess | 1420 +++++++++++++ depends/config.site.in | 84 + depends/config.sub | 1794 +++++++++++++++++ depends/funcs.mk | 219 ++ depends/hosts/darwin.mk | 8 + depends/hosts/default.mk | 23 + depends/hosts/linux.mk | 23 + depends/hosts/mingw32.mk | 2 + depends/packages/bdb.mk | 29 + depends/packages/boost.mk | 42 + depends/packages/dbus.mk | 23 + depends/packages/expat.mk | 21 + depends/packages/fontconfig.mk | 22 + depends/packages/freetype.mk | 22 + depends/packages/libX11.mk | 23 + depends/packages/libXau.mk | 23 + depends/packages/libXext.mk | 22 + depends/packages/libxcb.mk | 30 + depends/packages/miniupnpc.mk | 28 + depends/packages/native_ccache.mk | 25 + depends/packages/native_cctools.mk | 80 + depends/packages/native_cdrkit.mk | 26 + depends/packages/native_comparisontool.mk | 44 + depends/packages/native_libdmg-hfsplus.mk | 22 + depends/packages/native_libuuid.mk | 24 + depends/packages/native_openssl.mk | 21 + depends/packages/native_protobuf.mk | 25 + depends/packages/openssl.mk | 40 + depends/packages/packages.mk | 14 + depends/packages/protobuf.mk | 28 + depends/packages/qrencode.mk | 22 + depends/packages/qt.mk | 89 + depends/packages/xcb_proto.mk | 27 + depends/packages/xextproto.mk | 21 + depends/packages/xproto.mk | 21 + depends/packages/xtrans.mk | 22 + .../patches/boost/darwin_boost_atomic-1.patch | 35 + .../patches/boost/darwin_boost_atomic-2.patch | 55 + .../native_cdrkit/cdrkit-deterministic.patch | 86 + .../patches/qt/fix-xcb-include-order.patch | 21 + depends/patches/qt/mac-qmake.conf | 23 + 49 files changed, 4992 insertions(+) create mode 100644 depends/.gitignore create mode 100644 depends/Makefile create mode 100644 depends/README create mode 100644 depends/README.packages create mode 100644 depends/README.usage create mode 100644 depends/builders/darwin.mk create mode 100644 depends/builders/default.mk create mode 100644 depends/builders/linux.mk create mode 100755 depends/config.guess create mode 100644 depends/config.site.in create mode 100755 depends/config.sub create mode 100644 depends/funcs.mk create mode 100644 depends/hosts/darwin.mk create mode 100644 depends/hosts/default.mk create mode 100644 depends/hosts/linux.mk create mode 100644 depends/hosts/mingw32.mk create mode 100644 depends/packages/bdb.mk create mode 100644 depends/packages/boost.mk create mode 100644 depends/packages/dbus.mk create mode 100644 depends/packages/expat.mk create mode 100644 depends/packages/fontconfig.mk create mode 100644 depends/packages/freetype.mk create mode 100644 depends/packages/libX11.mk create mode 100644 depends/packages/libXau.mk create mode 100644 depends/packages/libXext.mk create mode 100644 depends/packages/libxcb.mk create mode 100644 depends/packages/miniupnpc.mk create mode 100644 depends/packages/native_ccache.mk create mode 100644 depends/packages/native_cctools.mk create mode 100644 depends/packages/native_cdrkit.mk create mode 100644 depends/packages/native_comparisontool.mk create mode 100644 depends/packages/native_libdmg-hfsplus.mk create mode 100644 depends/packages/native_libuuid.mk create mode 100644 depends/packages/native_openssl.mk create mode 100644 depends/packages/native_protobuf.mk create mode 100644 depends/packages/openssl.mk create mode 100644 depends/packages/packages.mk create mode 100644 depends/packages/protobuf.mk create mode 100644 depends/packages/qrencode.mk create mode 100644 depends/packages/qt.mk create mode 100644 depends/packages/xcb_proto.mk create mode 100644 depends/packages/xextproto.mk create mode 100644 depends/packages/xproto.mk create mode 100644 depends/packages/xtrans.mk create mode 100644 depends/patches/boost/darwin_boost_atomic-1.patch create mode 100644 depends/patches/boost/darwin_boost_atomic-2.patch create mode 100644 depends/patches/native_cdrkit/cdrkit-deterministic.patch create mode 100644 depends/patches/qt/fix-xcb-include-order.patch create mode 100644 depends/patches/qt/mac-qmake.conf diff --git a/depends/.gitignore b/depends/.gitignore new file mode 100644 index 0000000000..82c48638b0 --- /dev/null +++ b/depends/.gitignore @@ -0,0 +1,5 @@ +SDKs/ +work/ +built/ +sources/ +config.site diff --git a/depends/Makefile b/depends/Makefile new file mode 100644 index 0000000000..d431653068 --- /dev/null +++ b/depends/Makefile @@ -0,0 +1,114 @@ +.NOTPARALLEL : + +SOURCES_PATH ?= $(BASEDIR)/sources +BASE_CACHE ?= $(BASEDIR)/built +SDK_PATH ?= $(BASEDIR)/SDKs +NO_QT ?= +NO_WALLET ?= +NO_UPNP ?= + +BUILD = $(shell ./config.guess) +HOST ?= $(BUILD) +PATCHES_PATH = $(BASEDIR)/patches +BASEDIR = $(CURDIR) +HASH_LENGTH:=11 + +host:=$(BUILD) +ifneq ($(HOST),) +host:=$(HOST) +host_toolchain:=$(HOST)- +endif + +base_build_dir=$(BASEDIR)/work/build +base_staging_dir=$(BASEDIR)/work/staging +canonical_host:=$(shell ./config.sub $(HOST)) +build:=$(shell ./config.sub $(BUILD)) + +build_arch =$(firstword $(subst -, ,$(build))) +build_vendor=$(word 2,$(subst -, ,$(build))) +full_build_os:=$(subst $(build_arch)-$(build_vendor)-,,$(build)) +build_os:=$(findstring linux,$(full_build_os)) +build_os+=$(findstring darwin,$(full_build_os)) +build_os:=$(strip $(build_os)) +ifeq ($(build_os),) +build_os=$(full_build_os) +endif + +host_arch=$(firstword $(subst -, ,$(canonical_host))) +host_vendor=$(word 2,$(subst -, ,$(canonical_host))) +full_host_os:=$(subst $(host_arch)-$(host_vendor)-,,$(canonical_host)) +host_os:=$(findstring linux,$(full_host_os)) +host_os+=$(findstring darwin,$(full_host_os)) +host_os+=$(findstring mingw32,$(full_host_os)) +host_os:=$(strip $(host_os)) +ifeq ($(host_os),) +host_os=$(full_host_os) +endif + +$(host_arch)_$(host_os)_prefix=$(BASEDIR)/$(host) +$(host_arch)_$(host_os)_host=$(host) +host_prefix=$($(host_arch)_$(host_os)_prefix) +build_prefix=$(host_prefix)/native +build_host=$(build) + +AT_$(V):= +AT_:=@ +AT:=$(AT_$(V)) + +all: install + +include hosts/$(host_os).mk +include hosts/default.mk +include builders/$(build_os).mk +include builders/default.mk +include packages/packages.mk + +qt_packages_$(NO_QT) = $(qt_packages) $(qt_$(host_os)_packages) +qt_native_packages_$(NO_QT) = $(qt_native_packages) +wallet_packages_$(NO_WALLET) = $(wallet_packages) +upnp_packages_$(NO_UPNP) = $(upnp_packages) + +packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(wallet_packages_) $(upnp_packages_) +native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) $(qt_native_packages_) +all_packages = $(packages) $(native_packages) + +meta_depends = Makefile builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk + +$(host_arch)_$(host_os)_native_toolchain?=$($(host_os)_native_toolchain) + +include funcs.mk + +toolchain_path=$($($(host_arch)_$(host_os)_native_toolchain)_prefixbin) +final_build_id_long+=$(shell $(build_SHA256SUM) config.site.in) +final_build_id+=$(shell echo -n $(final_build_id_long) | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH)) +$(host_prefix)/.stamp_$(final_build_id): | $(native_packages) $(packages) + $(AT)rm -rf $(@D) + $(AT)mkdir -p $(@D) + $(AT)echo copying packages: $| + $(AT)echo to: $(@D) + $(AT)cd $(@D); $(foreach package,$|, tar xf $($(package)_cached); ) + $(AT)touch $@ + +$(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_build_id) + $(AT)@mkdir -p $(@D) + $(AT)sed -e 's|@HOST@|$(host)|' \ + -e 's|@CC@|$(toolchain_path)$(host_CC)|' \ + -e 's|@CXX@|$(toolchain_path)$(host_CXX)|' \ + -e 's|@AR@|$(toolchain_path)$(host_AR)|' \ + -e 's|@RANLIB@|$(toolchain_path)$(host_RANLIB)|' \ + -e 's|@NM@|$(toolchain_path)$(host_NM)|' \ + -e 's|@STRIP@|$(toolchain_path)$(host_STRIP)|' \ + -e 's|@build_os@|$(build_os)|' \ + -e 's|@host_os@|$(host_os)|' \ + -e 's|@CFLAGS@|$(host_CFLAGS)|' \ + -e 's|@CXXFLAGS@|$(host_CXXFLAGS)|' \ + -e 's|@LDFLAGS@|$(host_LDFLAGS)|' \ + -e 's|@no_qt@|$(NO_QT)|' \ + -e 's|@no_wallet@|$(NO_WALLET)|' \ + -e 's|@no_upnp@|$(NO_UPNP)|' \ + $< > $@ + $(AT)touch $@ + +install: $(host_prefix)/share/config.site +download: $(all_sources) +.PHONY: install cached diff --git a/depends/README b/depends/README new file mode 100644 index 0000000000..fed2f9b5ab --- /dev/null +++ b/depends/README @@ -0,0 +1,55 @@ +This is a system of building and caching dependencies necessary for building +Bitcoin. + +There are several features that make it different from most similar systems: + +- It is designed to be builder and host agnostic + +In theory, binaries for any target OS/architecture can be created, from a +builder running any OS/architecture. In practice, build-side tools must be +specified when the defaults don't fit, and packages must be ammended to work +on new hosts. For now, a build architecture of x86_64 is assumed, either on +Linux or OSX. + +- No reliance on timestamps + +File presence is used to determine what needs to be built. This makes the +results distributable and easily digestable by automated builders. + +- Each build only has its specified dependencies available at build-time. + +For each build, the sysroot is wiped and the (recursive) dependencies are +installed. This makes each build deterministic, since there will never be any +unknown files available to cause side-effects. + +- Each package is cached and only rebuilt as needed. + +Before building, a unique build-id is generated for each package. This id +consists of a hash of all files used to build the package (Makefiles, packages, +etc), and as well as a hash of the same data for each recursive dependency. If +any portion of a package's build recipe changes, it will be rebuilt as well as +any other package that depends on it. If any of the main makefiles (Makefile, +funcs.mk, etc) are changed, all packages will be rebuilt. After building, the +results are cached into a tarball that can be re-used and distributed. + +- Package build results are (relatively) deterministic. + +Each package is configured and patched so that it will yield the same +build-results with each consequent build, within a reasonable set of +constraints. Some things like timestamp insertion are unavoidable, and are +beyond the scope of this system. Additionally, the toolchain itself must be +capable of deterministic results. When revisions are properly bumped, a cached +build should represent an exact single payload. + +- Sources are fetched and verified automatically + +Each package must define its source location and checksum. The build will fail +if the fetched source does not match. Sources may be pre-seeded and/or cached +as desired. + +- Self-cleaning + +Build and staging dirs are wiped after use, and any previous version of a +cached result is removed following a successful build. Automated builders +should be able to build each revision and store the results with no further +intervention. diff --git a/depends/README.packages b/depends/README.packages new file mode 100644 index 0000000000..c35abfbdc1 --- /dev/null +++ b/depends/README.packages @@ -0,0 +1,116 @@ +Each recipe consists of 3 main parts: defining identifiers, setting build +variables, and defining build commands. + +The package "mylib" will be used here as an example + +General tips: +mylib_foo is written as $(package)_foo in order to make recipes more similar. + +Identifiers: +Each package is required to define at least these variables: + $(package)_version: + Version of the upstream library or program. If there is no version, a + placeholder such as 1.0 can be used. + $(package)_download_path: + Location of the upstream source, without the file-name. Usually http or + ftp. + $(package)_file_name: + The upstream source filename available at the download path. + $(package)_sha256_hash: + The sha256 hash of the upstream file + +These variables are optional: + $(package)_build_subdir: + cd to this dir before running configure/build/stage commands. + $(package)_download_file: + The file-name of the upstream source if it differs from how it should be + stored locally. This can be used to avoid storing file-names with strange + characters. + $(package)_dependencies: + Names of any other packages that this one depends on. + $(package)_patches: + Filenames of any patches needed to build the package + + +Build Variables: +After defining the main identifiers, build variables may be added or customized +before running the build commands. They should be added to a function called +$(package)_set_vars. For example: + +define $(package)_set_vars +... +endef + +Most variables can be prefixed with the host, architecture, or both, to make +the modifications specific to that case. For example: + + Universal: $(package)_cc=gcc + Linux only: $(package)_linux_cc=gcc + x86_64 only: $(package)_x86_64_cc = gcc + x86_64 linux only: $(package)_x86_64_linux_cc = gcc + +These variables may be set to override or append their default values. + $(package)_cc + $(package)_cxx + $(package)_objc + $(package)_objcxx + $(package)_ar + $(package)_ranlib + $(package)_libtool + $(package)_nm + $(package)_cflags + $(package)_cxxflags + $(package)_ldflags + $(package)_cppflags + $(package)_config_env + $(package)_build_env + $(package)_stage_env + +The *_env variables are used to add environment variables to the respective +commands. + +Other variables may be defined as needed. + +Build commands: + + For each build, a unique build dir and staging dir are created. For example, + work/build/mylib/1.0-1adac830f6e and work/staging/mylib/1.0-1adac830f6e. + + The following build commands are available for each recipe: + + $(package)_fetch_cmds: + Runs from: build dir + Fetch the source file. If undefined, it will be fetched and verified + against its hash. + $(package)_extract_cmds: + Runs from: build dir + Verify the source file against its hash and extract it. If undefined, the + source is assumed to be a tarball. + $(package)_preprocess_cmds: + Runs from: build dir/$(package)_build_subdir + Preprocess the source as necessary. If undefined, does nothing. + $(package)_config_cmds: + Runs from: build dir/$(package)_build_subdir + Configure the source. If undefined, does nothing. + $(package)_build_cmds: + Runs from: build dir/$(package)_build_subdir + Build the source. If undefined, does nothing. + $(package)_stage_cmds: + Runs from: build dir/$(package)_build_subdir + Stage the build results. If undefined, does nothing. + + The following variables are available for each recipe: + $(1)_staging_dir: package's destination sysroot path + $(1)_staging_prefix_dir: prefix path inside of the package's staging dir + $(1)_extract_dir: path to the package's extracted sources + $(1)_build_dir: path where configure/build/stage commands will be run + $(1)_patch_dir: path where the package's patches (if any) are found + +Notes on build commands: + +For packages built with autotools, $($(package)_autoconf) can be used in the +configure step to (usually) correctly configure automatically. Any +$($(package)_config_opts) will be appended. + +Most autotools projects can be properly staged using: + $(MAKE) DESTDIR=$($(package)_staging_dir) install diff --git a/depends/README.usage b/depends/README.usage new file mode 100644 index 0000000000..f50714f1f1 --- /dev/null +++ b/depends/README.usage @@ -0,0 +1,29 @@ +To build dependencies for the current arch+OS: + make +To build for another arch/OS: + make HOST=host-platform-triplet && make HOST=host-platform-triplet + (For example: make HOST=i686-w64-mingw32 -j4) + +A prefix will be generated that's suitable for plugging into Bitcoin's +configure. In the above example, a dir named i686-w64-mingw32 will be +created. To use it for Bitcoin: + +./configure --prefix=`pwd`/depends/i686-w64-mingw32 + +No other options are needed, the paths are automatically configured. + +Dependency Options: +The following can be set when running make: make FOO=bar + +SOURCES_PATH: downloaded sources will be placed here +BASE_CACHE: built packages will be placed here +SDK_PATH: Path where sdk's can be found (used by OSX) +NO_QT: Don't download/build/cache qt and its dependencies +NO_WALLET: Don't download/build/cache libs needed to enable the wallet +NO_UPNP: Don't download/build/cache packages needed for enabling upnp + +If some packages are not built, for example 'make NO_WALLET=1', the appropriate +options will be passed to bitcoin's configure. In this case, --disable-wallet. + +Additional targets: +download: run 'make download' to fetch sources without building them diff --git a/depends/builders/darwin.mk b/depends/builders/darwin.mk new file mode 100644 index 0000000000..6b734648f0 --- /dev/null +++ b/depends/builders/darwin.mk @@ -0,0 +1,22 @@ +build_darwin_CC: = $(shell xcrun -f clang) +build_darwin_CXX: = $(shell xcrun -f clang++) +build_darwin_AR: = $(shell xcrun -f ar) +build_darwin_RANLIB: = $(shell xcrun -f ranlib) +build_darwin_STRIP: = $(shell xcrun -f strip) +build_darwin_OTOOL: = $(shell xcrun -f otool) +build_darwin_NM: = $(shell xcrun -f nm) +build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) +build_darwin_SHA256SUM = shasum -a 256 +build_darwin_DOWNLOAD = curl -L -o + +#darwin host on darwin builder. overrides darwin host preferences. +darwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION) +darwin_CXX:=$(shell xcrun -f clang++) -mmacosx-version-min=$(OSX_MIN_VERSION) +darwin_AR:=$(shell xcrun -f ar) +darwin_RANLIB:=$(shell xcrun -f ranlib) +darwin_STRIP:=$(shell xcrun -f strip) +darwin_LIBTOOL:=$(shell xcrun -f libtool) +darwin_OTOOL:=$(shell xcrun -f otool) +darwin_NM:=$(shell xcrun -f nm) +darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) +darwin_native_toolchain= diff --git a/depends/builders/default.mk b/depends/builders/default.mk new file mode 100644 index 0000000000..f097db65d6 --- /dev/null +++ b/depends/builders/default.mk @@ -0,0 +1,20 @@ +default_build_CC = gcc +default_build_CXX = g++ +default_build_AR = ar +default_build_RANLIB = ranlib +default_build_STRIP = strip +default_build_NM = nm +default_build_OTOOL = otool +default_build_INSTALL_NAME_TOOL = install_name_tool + +define add_build_tool_func +build_$(build_os)_$1 ?= $$(default_build_$1) +build_$(build_arch)_$(build_os)_$1 ?= $$(build_$(build_os)_$1) +build_$1=$$(build_$(build_arch)_$(build_os)_$1) +endef +$(foreach var,CC CXX AR RANLIB NM STRIP SHA256SUM DOWNLOAD OTOOL INSTALL_NAME_TOOL,$(eval $(call add_build_tool_func,$(var)))) +define add_build_flags_func +build_$(build_arch)_$(build_os)_$1 += $(build_$(build_os)_$1) +build_$1=$$(build_$(build_arch)_$(build_os)_$1) +endef +$(foreach flags, CFLAGS CXXFLAGS LDFLAGS, $(eval $(call add_build_flags_func,$(flags)))) diff --git a/depends/builders/linux.mk b/depends/builders/linux.mk new file mode 100644 index 0000000000..d98ba597dc --- /dev/null +++ b/depends/builders/linux.mk @@ -0,0 +1,2 @@ +build_linux_SHA256SUM = sha256sum +build_linux_DOWNLOAD = wget -nv -O diff --git a/depends/config.guess b/depends/config.guess new file mode 100755 index 0000000000..1f5c50c0d1 --- /dev/null +++ b/depends/config.guess @@ -0,0 +1,1420 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2014 Free Software Foundation, Inc. + +timestamp='2014-03-23' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches with a ChangeLog entry to config-patches@gnu.org. + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2014 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + *:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; +esac + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/depends/config.site.in b/depends/config.site.in new file mode 100644 index 0000000000..4012f5a8d1 --- /dev/null +++ b/depends/config.site.in @@ -0,0 +1,84 @@ +cross_compiling=maybe +host_alias=@HOST@ +ac_tool_prefix=${host_alias}- + +if test -z $with_boost; then + with_boost=$prefix +fi +if test -z $with_qt_plugindir; then + with_qt_plugindir=$prefix/plugins +fi +if test -z $with_qt_translationdir; then + with_qt_translationdir=$prefix/translations +fi +if test -z $with_qt_bindir; then + with_qt_bindir=$prefix/native/bin +fi +if test -z $with_protoc_bindir; then + with_protoc_bindir=$prefix/native/bin +fi +if test -z $with_comparison_tool; then + with_comparison_tool=$prefix/native/share/BitcoindComparisonTool_jar/BitcoindComparisonTool.jar +fi + + +if test -z $enable_wallet && test -n "@no_wallet@"; then + enable_wallet=no +fi + +if test -z $with_miniupnpc && test -n "@no_upnp@"; then + with_miniupnpc=no +fi + +if test -z $with_gui && test -n "@no_qt@"; then + with_gui=no +fi + +if test @host_os@ == darwin; then + BREW=no + PORT=no +fi + +if test @host_os@ == mingw32; then + if test -z $with_qt_incdir; then + with_qt_incdir=$prefix/include + fi + if test -z $with_qt_libdir; then + with_qt_libdir=$prefix/lib + fi +fi + +export PATH=$prefix/native/bin:$PATH +export PKG_CONFIG="`which pkg-config` --static" +export PKG_CONFIG_LIBDIR=$prefix/lib/pkgconfig +export PKG_CONFIG_PATH=$prefix/share/pkgconfig +export CPPFLAGS=-I$prefix/include/ + +export CC="@CC@" +export CXX="@CXX@" +export OBJC="${CC}" +export OBJCXX="${CXX}" +export CCACHE=$prefix/native/bin/ccache + +if test -n "@AR@"; then + export AR=@AR@ + ac_cv_path_ac_pt_AR=${AR} +fi + +if test -n "@RANLIB@"; then + export RANLIB=@RANLIB@ + ac_cv_path_ac_pt_RANLIB=${RANLIB} +fi + +if test -n "@NM@"; then + export NM=@NM@ + ac_cv_path_ac_pt_NM=${NM} +fi + +if test -n "@CFLAGS@"; then + export CFLAGS="@CFLAGS@ $CFLAGS" +fi +if test -n "@CXXFLAGS@"; then + export CXXFLAGS="@CXXFLAGS@ $CXXFLAGS" +fi +export LDFLAGS="-L$prefix/lib @LDFLAGS@ $LDFLAGS" diff --git a/depends/config.sub b/depends/config.sub new file mode 100755 index 0000000000..d654d03cdc --- /dev/null +++ b/depends/config.sub @@ -0,0 +1,1794 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2014 Free Software Foundation, Inc. + +timestamp='2014-05-01' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2014 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/depends/funcs.mk b/depends/funcs.mk new file mode 100644 index 0000000000..4c47cc926e --- /dev/null +++ b/depends/funcs.mk @@ -0,0 +1,219 @@ +define int_vars +#Set defaults for vars which may be overridden per-package +$(1)_cc=$($($(1)_type)_CC) +$(1)_cxx=$($($(1)_type)_CXX) +$(1)_objc=$($($(1)_type)_OBJC) +$(1)_objcxx=$($($(1)_type)_OBJCXX) +$(1)_ar=$($($(1)_type)_AR) +$(1)_ranlib=$($($(1)_type)_RANLIB) +$(1)_libtool=$($($(1)_type)_LIBTOOL) +$(1)_nm=$($($(1)_type)_NM) +$(1)_cflags=$($($(1)_type)_CFLAGS) +$(1)_cxxflags=$($($(1)_type)_CXXFLAGS) +$(1)_ldflags=$($($(1)_type)_LDFLAGS) -L$($($(1)_type)_prefix)/lib +$(1)_cppflags:=-I$($($(1)_type)_prefix)/include +$(1)_recipe_hash:= +endef + +define int_get_all_dependencies +$(sort $(foreach dep,$(2),$(2) $(call int_get_all_dependencies,$(1),$($(dep)_dependencies)))) +endef + +define fetch_file +(test -f $(SOURCES_PATH)/$(3) || ( mkdir -p $$($(1)_extract_dir) && $(build_DOWNLOAD) "$$($(1)_extract_dir)/$(3).temp" "$(2)" && echo "$(4) $$($(1)_extract_dir)/$(3).temp" | $(build_SHA256SUM) -c && mv $$($(1)_extract_dir)/$(3).temp $(SOURCES_PATH)/$(3) )) +endef + +define int_get_build_recipe_hash +$(eval $(1)_all_file_checksums:=$(shell $(build_SHA256SUM) $(meta_depends) packages/$(1).mk $(addprefix $(PATCHES_PATH)/$(1)/,$($(1)_patches)))) +$(eval $(1)_recipe_hash:=$(shell echo -n "$($(1)_all_file_checksums)" | $(build_SHA256SUM))) +endef + +define int_get_build_id +$(eval $(1)_dependencies += $($(1)_$(host_arch)_$(host_os)_dependencies) $($(1)_$(host_os)_dependencies)) +$(eval $(1)_all_dependencies:=$(call int_get_all_dependencies,$(1),$($($(1)_type)_native_toolchain) $($(1)_dependencies))) +$(foreach dep,$($(1)_all_dependencies),$(eval $(1)_build_id_deps+=$(dep)-$($(dep)_version)-$($(dep)_recipe_hash))) +$(eval $(1)_build_id_long:=$(1)-$($(1)_version)-$($(1)_recipe_hash) $($(1)_build_id_deps)) +$(eval $(1)_build_id:=$(shell echo -n "$($(1)_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH))) +final_build_id_long+=$($(package)_build_id_long) + +#compute package-specific paths +$(1)_build_subdir?=. +$(1)_download_file?=$($(1)_file_name) +$(1)_source:=$(SOURCES_PATH)/$($(1)_file_name) +$(1)_staging_dir=$(base_staging_dir)/$(host)/$(1)/$($(1)_version)-$($(1)_build_id) +$(1)_staging_prefix_dir:=$$($(1)_staging_dir)$($($(1)_type)_prefix) +$(1)_extract_dir:=$(base_build_dir)/$(host)/$(1)/$($(1)_version)-$($(1)_build_id) +$(1)_build_dir:=$$($(1)_extract_dir)/$$($(1)_build_subdir) +$(1)_patch_dir:=$(base_build_dir)/$(host)/$(1)/$($(1)_version)-$($(1)_build_id)/.patches-$($(1)_build_id) +$(1)_prefixbin:=$($($(1)_type)_prefix)/bin/ +$(1)_cached:=$(BASE_CACHE)/$(host)/$(1)/$(1)-$($(1)_version)-$($(1)_build_id).tar.gz + +#stamps +$(1)_fetched=$$($(1)_extract_dir)/.stamp_fetched +$(1)_extracted=$$($(1)_extract_dir)/.stamp_extracted +$(1)_preprocessed=$$($(1)_extract_dir)/.stamp_preprocessed +$(1)_cleaned=$$($(1)_extract_dir)/.stamp_cleaned +$(1)_built=$$($(1)_build_dir)/.stamp_built +$(1)_configured=$$($(1)_build_dir)/.stamp_configured +$(1)_staged=$$($(1)_staging_dir)/.stamp_staged +$(1)_postprocessed=$$($(1)_staging_prefix_dir)/.stamp_postprocessed +$(1)_download_path_fixed=$(subst :,\:,$$($(1)_download_path)) + + +#default commands +$(1)_fetch_cmds ?= $(call fetch_file,$(1),$(subst \:,:,$$($(1)_download_path_fixed)/$$($(1)_download_file)),$($(1)_file_name),$($(1)_sha256_hash)) +$(1)_extract_cmds ?= echo "$$($(1)_sha256_hash) $$($(1)_source)" | $(build_SHA256SUM) -c && tar --strip-components=1 -xf $$($(1)_source) +$(1)_preprocess_cmds ?= +$(1)_build_cmds ?= +$(1)_config_cmds ?= +$(1)_stage_cmds ?= +$(1)_set_vars ?= + + +all_sources+=$$($(1)_fetched) +endef +#$(foreach dep_target,$($(1)_all_dependencies),$(eval $(1)_dependency_targets=$($(dep_target)_cached))) + + +define int_config_attach_build_config +$(eval $(call $(1)_set_vars,$(1))) +$(1)_cflags+=$($(1)_cflags_$(host_arch)) +$(1)_cflags+=$($(1)_cflags_$(host_os)) +$(1)_cflags+=$($(1)_cflags_$(host_arch)_$(host_os)) + +$(1)_cxxflags+=$($(1)_cxxflags_$(host_arch)) +$(1)_cxxflags+=$($(1)_cxxflags_$(host_os)) +$(1)_cxxflags+=$($(1)_cxxflags_$(host_arch)_$(host_os)) + +$(1)_cppflags+=$($(1)_cppflags_$(host_arch)) +$(1)_cppflags+=$($(1)_cppflags_$(host_os)) +$(1)_cppflags+=$($(1)_cppflags_$(host_arch)_$(host_os)) + +$(1)_ldflags+=$($(1)_ldflags_$(host_arch)) +$(1)_ldflags+=$($(1)_ldflags_$(host_os)) +$(1)_ldflags+=$($(1)_ldflags_$(host_arch)_$(host_os)) + +$(1)_build_opts+=$$($(1)_build_opts_$(host_arch)) +$(1)_build_opts+=$$($(1)_build_opts_$(host_os)) +$(1)_build_opts+=$$($(1)_build_opts_$(host_arch)_$(host_os)) + +$(1)_config_opts+=$$($(1)_config_opts_$(host_arch)) +$(1)_config_opts+=$$($(1)_config_opts_$(host_os)) +$(1)_config_opts+=$$($(1)_config_opts_$(host_arch)_$(host_os)) + +$(1)_config_env+=$($(1)_config_env_$(host_arch)) +$(1)_config_env+=$($(1)_config_env_$(host_os)) +$(1)_config_env+=$($(1)_config_env_$(host_arch)_$(host_os)) + +$(1)_config_env+=PKG_CONFIG_LIBDIR=$($($(1)_type)_prefix)/lib/pkgconfig +$(1)_config_env+=PKG_CONFIG_PATH=$($($(1)_type)_prefix)/share/pkgconfig +$(1)_config_env+=PATH=$(build_prefix)/bin:$(PATH) +$(1)_build_env+=PATH=$(build_prefix)/bin:$(PATH) +$(1)_stage_env+=PATH=$(build_prefix)/bin:$(PATH) +$(1)_autoconf=./configure --host=$($($(1)_type)_host) --disable-dependency-tracking --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)" + +ifneq ($($(1)_nm),) +$(1)_autoconf += NM="$$($(1)_nm)" +endif +ifneq ($($(1)_ranlib),) +$(1)_autoconf += RANLIB="$$($(1)_ranlib)" +endif +ifneq ($($(1)_ar),) +$(1)_autoconf += AR="$$($(1)_ar)" +endif +ifneq ($($(1)_cflags),) +$(1)_autoconf += CFLAGS="$$($(1)_cflags)" +endif +ifneq ($($(1)_cxxflags),) +$(1)_autoconf += CXXFLAGS="$$($(1)_cxxflags)" +endif +ifneq ($($(1)_cppflags),) +$(1)_autoconf += CPPFLAGS="$$($(1)_cppflags)" +endif +ifneq ($($(1)_ldflags),) +$(1)_autoconf += LDFLAGS="$$($(1)_ldflags)" +endif +endef + +define int_add_cmds +$($(1)_fetched): + $(AT)echo Fetching $(1)... + $(AT)mkdir -p $$(@D) $(SOURCES_PATH) + $(AT)cd $$(@D); $(call $(1)_fetch_cmds,$(1)) + $(AT)touch $$@ +$($(1)_extracted): | $($(1)_fetched) + $(AT)echo Extracting $(1)... + $(AT)mkdir -p $$(@D) + $(AT)cd $$(@D); $(call $(1)_extract_cmds,$(1)) + $(AT)touch $$@ +$($(1)_preprocessed): | $($(1)_dependencies) $($(1)_extracted) + $(AT)echo Preprocessing $(1)... + $(AT)mkdir -p $$(@D) $($(1)_patch_dir) + $(AT)$(foreach patch,$($(1)_patches),cd $(PATCHES_PATH)/$(1); cp $(patch) $($(1)_patch_dir) ;) + $(AT)cd $$(@D); $(call $(1)_preprocess_cmds, $(1)) + $(AT)touch $$@ +$($(1)_configured): | $($(1)_preprocessed) + $(AT)echo Configuring $(1)... + $(AT)rm -rf $(host_prefix); mkdir -p $(host_prefix)/lib; cd $(host_prefix); $(foreach package,$($(1)_all_dependencies), tar xf $($(package)_cached); ) + $(AT)mkdir -p $$(@D) + $(AT)+cd $$(@D); $($(1)_config_env) $(call $(1)_config_cmds, $(1)) + $(AT)touch $$@ +$($(1)_built): | $($(1)_configured) + $(AT)echo Building $(1)... + $(AT)mkdir -p $$(@D) + $(AT)+cd $$(@D); $($(1)_build_env) $(call $(1)_build_cmds, $(1)) + $(AT)touch $$@ +$($(1)_staged): | $($(1)_built) + $(AT)echo Staging $(1)... + $(AT)mkdir -p $($(1)_staging_dir)/$(host_prefix) + $(AT)cd $($(1)_build_dir); $($(1)_stage_env) $(call $(1)_stage_cmds, $(1)) + $(AT)rm -rf $($(1)_extract_dir) + $(AT)touch $$@ +$($(1)_postprocessed): | $($(1)_staged) + $(AT)echo Postprocessing $(1)... + $(AT)cd $($(1)_staging_prefix_dir); $(call $(1)_postprocess_cmds) + $(AT)touch $$@ +$($(1)_cached): | $($(1)_dependencies) $($(1)_postprocessed) + $(AT)echo Caching $(1)... + $(AT)cd $$($(1)_staging_dir)/$(host_prefix); find . | sort | tar --no-recursion -czf $$($(1)_staging_dir)/$$(@F) -T - + $(AT)mkdir -p $$(@D) + $(AT)rm -rf $$(@D) && mkdir -p $$(@D) + $(AT)mv $$($(1)_staging_dir)/$$(@F) $$(@) + $(AT)rm -rf $($(1)_staging_dir) + +.PHONY: $(1) +$(1): | $($(1)_cached) +.SECONDARY: $($(1)_postprocessed) $($(1)_staged) $($(1)_built) $($(1)_configured) $($(1)_preprocessed) $($(1)_extracted) $($(1)_fetched) + +endef + +# These functions create the build targets for each package. They must be +# broken down into small steps so that each part is done for all packages +# before moving on to the next step. Otherwise, a package's info +# (build-id for example) would only be avilable to another package if it +# happened to be computed already. + +#set the type for host/build packages. +$(foreach native_package,$(native_packages),$(eval $(native_package)_type=build)) +$(foreach package,$(packages),$(eval $(package)_type=$(host_arch)_$(host_os))) + +#set overridable defaults +$(foreach package,$(all_packages),$(eval $(call int_vars,$(package)))) + +#include package files +$(foreach package,$(all_packages),$(eval include packages/$(package).mk)) + +#compute a hash of all files that comprise this package's build recipe +$(foreach package,$(all_packages),$(eval $(call int_get_build_recipe_hash,$(package)))) + +#generate a unique id for this package, incorporating its dependencies as well +$(foreach package,$(all_packages),$(eval $(call int_get_build_id,$(package)))) + +#compute final vars after reading package vars +$(foreach package,$(all_packages),$(eval $(call int_config_attach_build_config,$(package)))) + +#create build targets +$(foreach package,$(all_packages),$(eval $(call int_add_cmds,$(package)))) + +#special exception: if a toolchain package exists, all non-native packages depend on it +$(foreach package,$(packages),$(eval $($(package)_unpacked): |$($($(host_arch)_$(host_os)_native_toolchain)_cached) )) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk new file mode 100644 index 0000000000..9e2415655e --- /dev/null +++ b/depends/hosts/darwin.mk @@ -0,0 +1,8 @@ +OSX_MIN_VERSION=10.6 +OSX_SDK_VERSION=10.7 +OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk +darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) +darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) +darwin_CFLAGS=-pipe -O2 +darwin_CXXFLAGS=$(darwin_CFLAGS) +darwin_native_toolchain=native_cctools diff --git a/depends/hosts/default.mk b/depends/hosts/default.mk new file mode 100644 index 0000000000..b9fe5d858a --- /dev/null +++ b/depends/hosts/default.mk @@ -0,0 +1,23 @@ +default_host_CC = $(host_toolchain)gcc +default_host_CXX = $(host_toolchain)g++ +default_host_AR = $(host_toolchain)ar +default_host_RANLIB = $(host_toolchain)ranlib +default_host_STRIP = $(host_toolchain)strip +default_host_LIBTOOL = $(host_toolchain)libtool +default_host_INSTALL_NAME_TOOL = $(host_toolchain)install_name_tool +default_host_OTOOL = $(host_toolchain)otool +default_host_NM = $(host_toolchain)nm + +define add_host_tool_func +$(host_os)_$1?=$$(default_host_$1) +$(host_arch)_$(host_os)_$1?=$$($(host_os)_$1) +host_$1=$$($(host_arch)_$(host_os)_$1) +endef + +define add_host_flags_func +$(host_arch)_$(host_os)_$1 += $($(host_os)_$1) +host_$1 = $$($(host_arch)_$(host_os)_$1) +endef + +$(foreach tool,CC CXX AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL,$(eval $(call add_host_tool_func,$(tool)))) +$(foreach flags,CFLAGS CXXFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags)))) diff --git a/depends/hosts/linux.mk b/depends/hosts/linux.mk new file mode 100644 index 0000000000..194d71d557 --- /dev/null +++ b/depends/hosts/linux.mk @@ -0,0 +1,23 @@ +linux_CFLAGS=-pipe -O2 +linux_CXXFLAGS=$(linux_CFLAGS) + +ifeq (86,$(findstring 86,$(build_arch))) +i686_linux_CC=gcc -m32 +i686_linux_CXX=g++ -m32 +i686_linux_AR=ar +i686_linux_RANLIB=ranlib +i686_linux_NM=nm +i686_linux_STRIP=strip + +x86_64_linux_CC=gcc -m64 +x86_64_linux_CXX=g++ -m64 +x86_64_linux_AR=ar +x86_64_linux_RANLIB=ranlib +x86_64_linux_NM=nm +x86_64_linux_STRIP=strip +else +i686_linux_CC=$(default_host_CC) -m32 +i686_linux_CXX=$(default_host_CXX) -m32 +x86_64_linux_CC=$(default_host_CC) -m64 +x86_64_linux_CXX=$(default_host_CXX) -m64 +endif diff --git a/depends/hosts/mingw32.mk b/depends/hosts/mingw32.mk new file mode 100644 index 0000000000..ffe4a55842 --- /dev/null +++ b/depends/hosts/mingw32.mk @@ -0,0 +1,2 @@ +mingw32_CFLAGS=-pipe -O2 +mingw32_CXXFLAGS=$(mingw32_CFLAGS) diff --git a/depends/packages/bdb.mk b/depends/packages/bdb.mk new file mode 100644 index 0000000000..503409c5e5 --- /dev/null +++ b/depends/packages/bdb.mk @@ -0,0 +1,29 @@ +package=bdb +$(package)_version=4.8.30 +$(package)_download_path=http://download.oracle.com/berkeley-db +$(package)_file_name=db-$($(package)_version).NC.tar.gz +$(package)_sha256_hash=12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef +$(package)_build_subdir=build_unix + +define $(package)_set_vars +$(package)_config_opts=--disable-shared --enable-cxx +$(package)_config_opts_mingw32=--enable-mingw +$(package)_config_opts_x86_64_linux=--with-pic +$(package)_config_opts_arm_linux=--with-pic +endef + +define $(package)_preprocess_cmds + sed -i.old 's/__atomic_compare_exchange/__atomic_compare_exchange_db/' dbinc/atomic.h +endef + +define $(package)_config_cmds + ../dist/$($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) libdb_cxx-4.8.a libdb-4.8.a +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install_lib install_include +endef diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk new file mode 100644 index 0000000000..a3cacbcbb6 --- /dev/null +++ b/depends/packages/boost.mk @@ -0,0 +1,42 @@ +package=boost +$(package)_version=1_55_0 +$(package)_download_path=http://sourceforge.net/projects/boost/files/boost/1.55.0 +$(package)_file_name=$(package)_$($(package)_version).tar.bz2 +$(package)_sha256_hash=fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 +$(package)_patches=darwin_boost_atomic-1.patch darwin_boost_atomic-2.patch + +define $(package)_set_vars +$(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam +$(package)_config_opts+=variant=release threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1 +$(package)_config_opts_linux=threadapi=pthread runtime-link=shared +$(package)_config_opts_darwin=--toolset=darwin-4.2.1 runtime-link=shared +$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static +$(package)_config_opts_x86_64_mingw32=address-model=64 +$(package)_config_opts_i686_mingw32=address-model=32 +$(package)_config_opts_i686_linux=address-model=32 architecture=x86 +$(package)_toolset_$(host_os)=gcc +$(package)_archiver_$(host_os)=$($(package)_ar) +$(package)_toolset_darwin=darwin +$(package)_archiver_darwin=$($(package)_libtool) +$(package)_config_libraries=chrono,filesystem,program_options,system,thread,test +$(package)_cxxflags_x86_64_linux=-fPIC +$(package)_cxxflags_arm_linux=-fPIC +endef + +define $(package)_preprocess_cmds + patch -p2 < $($(package)_patch_dir)/darwin_boost_atomic-1.patch && \ + patch -p2 < $($(package)_patch_dir)/darwin_boost_atomic-2.patch && \ + echo "using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cxxflags)\" \"$($(package)_ldflags)\" \"$(boost_archiver_$(host_os))\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam +endef + +define $(package)_config_cmds + ./bootstrap.sh --without-icu --with-libraries=$(boost_config_libraries) +endef + +define $(package)_build_cmds + ./b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) stage +endef + +define $(package)_stage_cmds + ./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install +endef diff --git a/depends/packages/dbus.mk b/depends/packages/dbus.mk new file mode 100644 index 0000000000..8ac9ab742b --- /dev/null +++ b/depends/packages/dbus.mk @@ -0,0 +1,23 @@ +package=dbus +$(package)_version=1.8.6 +$(package)_download_path=http://dbus.freedesktop.org/releases/dbus +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=eded83ca007b719f32761e60fd8b9ffd0f5796a4caf455b01b5a5ef740ebd23f +$(package)_dependencies=expat + +define $(package)_set_vars + $(package)_config_opts=--disable-tests --disable-doxygen-docs --disable-xml-docs --disable-static --without-x +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) -C dbus libdbus-1.la +endef + +define $(package)_stage_cmds + $(MAKE) -C dbus DESTDIR=$($(package)_staging_dir) install-libLTLIBRARIES install-dbusincludeHEADERS install-nodist_dbusarchincludeHEADERS && \ + $(MAKE) DESTDIR=$($(package)_staging_dir) install-pkgconfigDATA +endef diff --git a/depends/packages/expat.mk b/depends/packages/expat.mk new file mode 100644 index 0000000000..1ac4435374 --- /dev/null +++ b/depends/packages/expat.mk @@ -0,0 +1,21 @@ +package=expat +$(package)_version=2.1.0 +$(package)_download_path=http://sourceforge.net/projects/expat/files/expat/$($(package)_version) +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=823705472f816df21c8f6aa026dd162b280806838bb55b3432b0fb1fcca7eb86 + +define $(package)_set_vars +$(package)_config_opts=--disable-static +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/fontconfig.mk b/depends/packages/fontconfig.mk new file mode 100644 index 0000000000..2cf553ed96 --- /dev/null +++ b/depends/packages/fontconfig.mk @@ -0,0 +1,22 @@ +package=fontconfig +$(package)_version=2.11.1 +$(package)_download_path=http://www.freedesktop.org/software/fontconfig/release/ +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=dc62447533bca844463a3c3fd4083b57c90f18a70506e7a9f4936b5a1e516a99 +$(package)_dependencies=freetype expat + +define $(package)_set_vars + $(package)_config_opts=--disable-docs --disable-static +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/freetype.mk b/depends/packages/freetype.mk new file mode 100644 index 0000000000..b83cbd93ea --- /dev/null +++ b/depends/packages/freetype.mk @@ -0,0 +1,22 @@ +package=freetype +$(package)_version=2.5.3 +$(package)_download_path=http://downloads.sourceforge.net/$(package) +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=c0848b29d52ef3ca27ad92e08351f023c5e24ce8cea7d8fe69fc96358e65f75e + +define $(package)_set_vars + $(package)_config_opts=--without-zlib --without-png --disable-static + $(package)_config_opts_x86_64_linux=--with-pic +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/libX11.mk b/depends/packages/libX11.mk new file mode 100644 index 0000000000..144021e34b --- /dev/null +++ b/depends/packages/libX11.mk @@ -0,0 +1,23 @@ +package=libX11 +$(package)_version=1.6.2 +$(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/ +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=2aa027e837231d2eeea90f3a4afe19948a6eb4c8b2bec0241eba7dbc8106bd16 +$(package)_dependencies=libxcb xtrans xextproto xproto + +define $(package)_set_vars +$(package)_config_opts=--disable-xkb --disable-static +$(package)_config_opts_x86_64_linux=--with-pic +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/libXau.mk b/depends/packages/libXau.mk new file mode 100644 index 0000000000..8c9b21846b --- /dev/null +++ b/depends/packages/libXau.mk @@ -0,0 +1,23 @@ +package=libXau +$(package)_version=1.0.8 +$(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/ +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=fdd477320aeb5cdd67272838722d6b7d544887dfe7de46e1e7cc0c27c2bea4f2 +$(package)_dependencies=xproto + +define $(package)_set_vars + $(package)_config_opts=--disable-shared + $(package)_config_opts_x86_64_linux=--with-pic +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/libXext.mk b/depends/packages/libXext.mk new file mode 100644 index 0000000000..4db836066f --- /dev/null +++ b/depends/packages/libXext.mk @@ -0,0 +1,22 @@ +package=libXext +$(package)_version=1.3.2 +$(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/ +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=f829075bc646cdc085fa25d98d5885d83b1759ceb355933127c257e8e50432e0 +$(package)_dependencies=xproto xextproto libX11 libXau + +define $(package)_set_vars + $(package)_config_opts=--disable-static +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/libxcb.mk b/depends/packages/libxcb.mk new file mode 100644 index 0000000000..f29b577f8a --- /dev/null +++ b/depends/packages/libxcb.mk @@ -0,0 +1,30 @@ +package=libxcb +$(package)_version=1.10 +$(package)_download_path=http://xcb.freedesktop.org/dist +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=98d9ab05b636dd088603b64229dd1ab2d2cc02ab807892e107d674f9c3f2d5b5 +$(package)_dependencies=xcb_proto libXau xproto + +define $(package)_set_vars +$(package)_config_opts=--disable-static +endef + +define $(package)_preprocess_cmds + sed "s/pthread-stubs//" -i configure +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds + rm -rf share/man share/doc +endef diff --git a/depends/packages/miniupnpc.mk b/depends/packages/miniupnpc.mk new file mode 100644 index 0000000000..6dd7d93b07 --- /dev/null +++ b/depends/packages/miniupnpc.mk @@ -0,0 +1,28 @@ +package=miniupnpc +$(package)_version=1.9 +$(package)_download_path=http://miniupnp.free.fr/files +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=2923e453e880bb949e3d4da9f83dd3cb6f08946d35de0b864d0339cf70934464 + +define $(package)_set_vars +$(package)_build_opts=CC="$($(package)_cc)" +$(package)_build_opts_darwin=OS=Darwin +$(package)_build_opts_mingw32=-f Makefile.mingw +$(package)_build_env+=CFLAGS="$($(package)_cflags)" AR="$($(package)_ar)" +endef + +define $(package)_preprocess_cmds + mkdir dll && \ + sed -e 's|MINIUPNPC_VERSION_STRING \"version\"|MINIUPNPC_VERSION_STRING \"$($(package)_version)\"|' -e 's|OS/version|$(host)|' miniupnpcstrings.h.in > miniupnpcstrings.h && \ + sed -i.old "s|miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings|miniupnpcstrings.h: miniupnpcstrings.h.in|" Makefile.mingw +endef + +define $(package)_build_cmds + $(MAKE) libminiupnpc.a $($(package)_build_opts) +endef + +define $(package)_stage_cmds + mkdir -p $($(package)_staging_prefix_dir)/include/miniupnpc $($(package)_staging_prefix_dir)/lib &&\ + install *.h $($(package)_staging_prefix_dir)/include/miniupnpc &&\ + install libminiupnpc.a $($(package)_staging_prefix_dir)/lib +endef diff --git a/depends/packages/native_ccache.mk b/depends/packages/native_ccache.mk new file mode 100644 index 0000000000..3226e89a63 --- /dev/null +++ b/depends/packages/native_ccache.mk @@ -0,0 +1,25 @@ +package=native_ccache +$(package)_version=3.1.9 +$(package)_download_path=http://samba.org/ftp/ccache +$(package)_file_name=ccache-$($(package)_version).tar.bz2 +$(package)_sha256_hash=04d3e2e438ac8d4cc4b110b68cdd61bd59226c6588739a4a386869467f5ced7c + +define $(package)_set_vars +$(package)_config_opts= +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds + rm -rf lib include +endef diff --git a/depends/packages/native_cctools.mk b/depends/packages/native_cctools.mk new file mode 100644 index 0000000000..e3ba9685b4 --- /dev/null +++ b/depends/packages/native_cctools.mk @@ -0,0 +1,80 @@ +package=native_cctools +$(package)_version=809 +$(package)_download_path=http://www.opensource.apple.com/tarballs/cctools +$(package)_file_name=cctools-$($(package)_version).tar.gz +$(package)_sha256_hash=03ba62749b843b131c7304a044a98c6ffacd65b1399b921d69add0375f79d8ad +$(package)_build_subdir=cctools2odcctools/odcctools-$($(package)_version) +$(package)_dependencies=native_libuuid native_openssl +$(package)_ld64_download_file=ld64-127.2.tar.gz +$(package)_ld64_download_path=http://www.opensource.apple.com/tarballs/ld64 +$(package)_ld64_file_name=$($(package)_ld64_download_file) +$(package)_ld64_sha256_hash=97b75547b2bd761306ab3e15ae297f01e7ab9760b922bc657f4ef72e4e052142 +$(package)_dyld_download_file=dyld-195.5.tar.gz +$(package)_dyld_download_path=http://www.opensource.apple.com/tarballs/dyld +$(package)_dyld_file_name=$($(package)_dyld_download_file) +$(package)_dyld_sha256_hash=2cf0484c87cf79b606b351a7055a247dae84093ae92c747a74e0cde2c8c8f83c +$(package)_toolchain4_download_file=10cc648683617cca8bcbeae507888099b41b530c.tar.gz +$(package)_toolchain4_download_path=https://github.com/mingwandroid/toolchain4/archive +$(package)_toolchain4_file_name=toolchain4-1.tar.gz +$(package)_toolchain4_sha256_hash=18406961fd4a1ec5c7ea35c91d6a80a2f8bb797a2bd243a610bd75e13eff9aca +$(package)_clang_download_file=clang+llvm-3.2-x86-linux-ubuntu-12.04.tar.gz +$(package)_clang_download_path=http://llvm.org/releases/3.2 +$(package)_clang_file_name=clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz +$(package)_clang_sha256_hash=b9d57a88f9514fa1f327a1a703756d0c1c960f4c58494a5bd80313245d13ffff + +define $(package)_fetch_cmds +$(call fetch_file,$(package),$($(package)_download_path)/$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_ld64_download_path)/$($(package)_ld64_download_file),$($(package)_ld64_file_name),$($(package)_ld64_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_dyld_download_path)/$($(package)_dyld_download_file),$($(package)_dyld_file_name),$($(package)_dyld_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_clang_download_path)/$($(package)_clang_download_file),$($(package)_clang_file_name),$($(package)_clang_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_toolchain4_download_path)/$($(package)_toolchain4_download_file),$($(package)_toolchain4_file_name),$($(package)_toolchain4_sha256_hash)) +endef + +define $(package)_set_vars +$(package)_config_opts=--target=$(host) --with-sysroot=$(OSX_SDK) +$(package)_cflags+=-m32 +$(package)_cxxflags+=-m32 +$(package)_cppflags+=-D__DARWIN_UNIX03 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS +$(package)_ldflags+=-m32 -Wl,-rpath=\\$$$$$$$$\$$$$$$$$ORIGIN/../lib +$(package)_ldflags+=-L$$(native_cctools_extract_dir)/clang+llvm-3.2-x86-linux-ubuntu-12.04/lib +endef +define $(package)_extract_cmds + tar --strip-components=1 -xf $(SOURCES_PATH)/$($(package)_toolchain4_file_name) && \ + ln -sf $($(package)_source) cctools2odcctools/$($(package)_file_name) && \ + ln -sf $(SOURCES_PATH)/$($(package)_ld64_file_name) cctools2odcctools/$($(package)_ld64_file_name) && \ + ln -sf $(SOURCES_PATH)/$($(package)_dyld_file_name) cctools2odcctools/$($(package)_dyld_file_name) && \ + tar xf $(SOURCES_PATH)/$($(package)_clang_file_name) && \ + mkdir -p $(SDK_PATH) sdks &&\ + cd sdks; ln -sf $(OSX_SDK) MacOSX$(OSX_SDK_VERSION).sdk +endef + +define $(package)_preprocess_cmds + sed -i "s|GCC_DIR|LLVM_CLANG_DIR|g" cctools2odcctools/extract.sh && \ + sed -i "s|llvmgcc42-2336.1|clang+llvm-3.2-x86-linux-ubuntu-12.04|g" cctools2odcctools/extract.sh && \ + sed -i "s|/llvmCore/include/llvm-c|/include/llvm-c \$$$${LLVM_CLANG_DIR}/include/llvm |" cctools2odcctools/extract.sh && \ + sed -i "s|fAC_INIT|AC_INIT|" cctools2odcctools/files/configure.ac && \ + sed -i 's/\# Dynamically linked LTO/\t ;\&\n\t linux*)\n# Dynamically linked LTO/' cctools2odcctools/files/configure.ac && \ + cd cctools2odcctools; ./extract.sh --osxver $(OSX_SDK_VERSION) && \ + sed -i "s|define\tPC|define\tPC_|" odcctools-809/include/architecture/sparc/reg.h +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install && \ + cd ../../clang+llvm-3.2-x86-linux-ubuntu-12.04 && \ + mkdir -p $($(package)_staging_prefix_dir)/lib/clang/3.2/include && \ + mkdir -p $($(package)_staging_prefix_dir)/bin && \ + cp -P bin/clang bin/clang++ $($(package)_staging_prefix_dir)/bin/ &&\ + cp lib/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \ + cp lib/clang/3.2/include/* $($(package)_staging_prefix_dir)/lib/clang/3.2/include/ && \ + echo "#!/bin/sh" > $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil && \ + echo "exit 0" >> $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil && \ + chmod +x $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil +endef diff --git a/depends/packages/native_cdrkit.mk b/depends/packages/native_cdrkit.mk new file mode 100644 index 0000000000..2cc388b4b3 --- /dev/null +++ b/depends/packages/native_cdrkit.mk @@ -0,0 +1,26 @@ +package=native_cdrkit +$(package)_version=1.1.11 +$(package)_download_path=http://distro.ibiblio.org/fatdog/source/c +$(package)_file_name=cdrkit-$($(package)_version).tar.bz2 +$(package)_sha256_hash=b50d64c214a65b1a79afe3a964c691931a4233e2ba605d793eb85d0ac3652564 +$(package)_patches=cdrkit-deterministic.patch + +define $(package)_preprocess_cmds + patch -p1 < $($(package)_patch_dir)/cdrkit-deterministic.patch +endef + +define $(package)_config_cmds + cmake -DCMAKE_INSTALL_PREFIX=$(build_prefix) +endef + +define $(package)_build_cmds + $(MAKE) genisoimage +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) -C genisoimage install +endef + +define $(package)_postprocess_cmds + rm bin/isovfy bin/isoinfo bin/isodump bin/isodebug bin/devdump +endef diff --git a/depends/packages/native_comparisontool.mk b/depends/packages/native_comparisontool.mk new file mode 100644 index 0000000000..5eef73052f --- /dev/null +++ b/depends/packages/native_comparisontool.mk @@ -0,0 +1,44 @@ +package=native_comparisontool +$(package)_version=1 +$(package)_download_path=https://github.com/TheBlueMatt/test-scripts/raw/master/BitcoindComparisonTool_jar +$(package)_file_name=BitcoindComparisonTool.jar +$(package)_sha256_hash=a08b1a55523e7f57768cb66c35f47a926710e5b6c82822e1ccfbe38fcce37db2 +$(package)_guava_file_name=guava-13.0.1.jar +$(package)_guava_sha256_hash=feb4b5b2e79a63b72ec47a693b1cf35cf1cea1f60a2bb2615bf21f74c7a60bb0 +$(package)_h2_file_name=h2-1.3.167.jar +$(package)_h2_sha256_hash=fa97521a2e72174485a96276bcf6f573d5e44ca6aba2f62de87b33b5bb0d4b91 +$(package)_sc-light-jdk15on_file_name=sc-light-jdk15on-1.47.0.2.jar +$(package)_sc-light-jdk15on_sha256_hash=931f39d351429fb96c2f749e7ecb1a256a8ebbf5edca7995c9cc085b94d1841d +$(package)_slf4j-api_file_name=slf4j-api-1.6.4.jar +$(package)_slf4j-api_sha256_hash=367b909030f714ee1176ab096b681e06348f03385e98d1bce0ed801b5452357e +$(package)_slf4j-jdk14_file_name=slf4j-jdk14-1.6.4.jar +$(package)_slf4j-jdk14_sha256_hash=064bd81796710f713f9f4a2309c0e032309934c2d2b4f7d3b6958325e584e13f + +define $(package)_fetch_cmds +$(call fetch_file,$(package),$($(package)_download_path)/$($(package)_file_name),$($(package)_file_name),$($(package)_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_download_path)/$($(package)_guava_file_name),$($(package)_guava_file_name),$($(package)_guava_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_download_path)/$($(package)_h2_file_name),$($(package)_h2_file_name),$($(package)_h2_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_download_path)/$($(package)_sc-light-jdk15on_file_name),$($(package)_sc-light-jdk15on_file_name),$($(package)_sc-light-jdk15on_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_download_path)/$($(package)_slf4j-api_file_name),$($(package)_slf4j-api_file_name),$($(package)_slf4j-api_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_download_path)/$($(package)_slf4j-jdk14_file_name),$($(package)_slf4j-jdk14_file_name),$($(package)_slf4j-jdk14_sha256_hash)) +endef + +define $(package)_extract_cmds +echo none +endef + +define $(package)_configure_cmds +endef + +define $(package)_build_cmds +endef + +define $(package)_stage_cmds + mkdir -p $($(package)_staging_prefix_dir)/share/BitcoindComparisonTool_jar && \ + cp $(SOURCES_PATH)/$($(package)_file_name) $($(package)_staging_prefix_dir)/share/BitcoindComparisonTool_jar/ && \ + cp $(SOURCES_PATH)/$($(package)_guava_file_name) $($(package)_staging_prefix_dir)/share/BitcoindComparisonTool_jar/ && \ + cp $(SOURCES_PATH)/$($(package)_h2_file_name) $($(package)_staging_prefix_dir)/share/BitcoindComparisonTool_jar/ && \ + cp $(SOURCES_PATH)/$($(package)_sc-light-jdk15on_file_name) $($(package)_staging_prefix_dir)/share/BitcoindComparisonTool_jar/ && \ + cp $(SOURCES_PATH)/$($(package)_slf4j-api_file_name) $($(package)_staging_prefix_dir)/share/BitcoindComparisonTool_jar/ && \ + cp $(SOURCES_PATH)/$($(package)_slf4j-jdk14_file_name) $($(package)_staging_prefix_dir)/share/BitcoindComparisonTool_jar/ +endef diff --git a/depends/packages/native_libdmg-hfsplus.mk b/depends/packages/native_libdmg-hfsplus.mk new file mode 100644 index 0000000000..a4ffb6046c --- /dev/null +++ b/depends/packages/native_libdmg-hfsplus.mk @@ -0,0 +1,22 @@ +package=native_libdmg-hfsplus +$(package)_version=0.1 +$(package)_download_path=https://github.com/theuni/libdmg-hfsplus/archive +$(package)_file_name=libdmg-hfsplus-v$($(package)_version).tar.gz +$(package)_sha256_hash=6569a02eb31c2827080d7d59001869ea14484c281efab0ae7f2b86af5c3120b3 +$(package)_build_subdir=build + +define $(package)_preprocess_cmds + mkdir build +endef + +define $(package)_config_cmds + cmake -DCMAKE_INSTALL_PREFIX:PATH=$(build_prefix)/bin .. +endef + +define $(package)_build_cmds + $(MAKE) -C dmg +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) -C dmg install +endef diff --git a/depends/packages/native_libuuid.mk b/depends/packages/native_libuuid.mk new file mode 100644 index 0000000000..b25540f80d --- /dev/null +++ b/depends/packages/native_libuuid.mk @@ -0,0 +1,24 @@ +package:=native_libuuid +$(package)_version=1.41.14 +$(package)_download_path=http://downloads.sourceforge.net/e2fsprogs +$(package)_file_name=e2fsprogs-libs-$($(package)_version).tar.gz +$(package)_sha256_hash=dbc7a138a3218d9b80a0626b5b692d76934d6746d8cbb762751be33785d8d9f5 + +define $(package)_set_vars +$(package)_config_opts=--disable-elf-shlibs --disable-uuidd +$(package)_cflags+=-m32 +$(package)_ldflags+=-m32 +$(package)_cxxflags+=-m32 +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) -C lib/uuid +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) -C lib/uuid install +endef diff --git a/depends/packages/native_openssl.mk b/depends/packages/native_openssl.mk new file mode 100644 index 0000000000..1f25d6afcc --- /dev/null +++ b/depends/packages/native_openssl.mk @@ -0,0 +1,21 @@ +package=native_openssl +$(package)_version=1.0.1h +$(package)_download_path=https://www.openssl.org/source +$(package)_file_name=openssl-$($(package)_version).tar.gz +$(package)_sha256_hash=9d1c8a9836aa63e2c6adb684186cbd4371c9e9dcc01d6e3bb447abf2d4d3d093 +define $(package)_set_vars +$(package)_build_config_opts= --prefix=$(build_prefix) no-zlib no-shared no-krb5C linux-generic32 -m32 +endef + +define $(package)_config_cmds + ./Configure $($(package)_build_config_opts) &&\ + sed -i "s|engines apps test|engines|" Makefile +endef + +define $(package)_build_cmds + $(MAKE) -j1 +endef + +define $(package)_stage_cmds + $(MAKE) INSTALL_PREFIX=$($(package)_staging_dir) -j1 install_sw +endef diff --git a/depends/packages/native_protobuf.mk b/depends/packages/native_protobuf.mk new file mode 100644 index 0000000000..ed1a771f0d --- /dev/null +++ b/depends/packages/native_protobuf.mk @@ -0,0 +1,25 @@ +package=native_protobuf +$(package)_version=2.5.0 +$(package)_download_path=https://protobuf.googlecode.com/files +$(package)_file_name=protobuf-$($(package)_version).tar.bz2 +$(package)_sha256_hash=13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 + +define $(package)_set_vars +$(package)_config_opts=--disable-shared +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) -C src protoc +endef + +define $(package)_stage_cmds + $(MAKE) -C src DESTDIR=$($(package)_staging_dir) install-strip +endef + +define $(package)_postprocess_cmds + rm -rf lib include +endef diff --git a/depends/packages/openssl.mk b/depends/packages/openssl.mk new file mode 100644 index 0000000000..1fb8edb099 --- /dev/null +++ b/depends/packages/openssl.mk @@ -0,0 +1,40 @@ +package=openssl +$(package)_version=1.0.1h +$(package)_download_path=https://www.openssl.org/source +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=9d1c8a9836aa63e2c6adb684186cbd4371c9e9dcc01d6e3bb447abf2d4d3d093 + +define $(package)_set_vars +$(package)_config_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)" +$(package)_config_opts=--prefix=$(host_prefix) --openssldir=$(host_prefix)/etc/openssl no-zlib no-shared no-dso +$(package)_config_opts+=no-krb5 no-camellia no-capieng no-cast no-cms no-dtls1 no-gost no-gmp no-heartbeats no-idea no-jpake no-md2 +$(package)_config_opts+=no-mdc2 no-rc5 no-rdrand no-rfc3779 no-rsax no-sctp no-seed no-sha0 no-static_engine no-whirlpool no-rc2 no-rc4 no-ssl3 +$(package)_config_opts+=$($(package)_cflags) +$(package)_config_opts_x86_64_linux=-fPIC linux-x86_64 +$(package)_config_opts_arm_linux=-fPIC linux-generic32 +$(package)_config_opts_x86_64_darwin=darwin64-x86_64-cc +$(package)_config_opts_x86_64_mingw32=mingw64 +$(package)_config_opts_i686_mingw32=mingw +$(package)_config_opts_i686_linux=linux-generic32 -fPIC +endef + +define $(package)_preprocess_cmds + sed -i.old "/define DATE/d" crypto/Makefile && \ + sed -i.old "s|engines apps test|engines|" Makefile.org +endef + +define $(package)_config_cmds + ./Configure $($(package)_config_opts) +endef + +define $(package)_build_cmds + $(MAKE) -j1 build_libs libcrypto.pc libssl.pc openssl.pc +endef + +define $(package)_stage_cmds + $(MAKE) INSTALL_PREFIX=$($(package)_staging_dir) -j1 install_sw +endef + +define $(package)_postprocess_cmds + rm -rf share bin etc +endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk new file mode 100644 index 0000000000..260cadb214 --- /dev/null +++ b/depends/packages/packages.mk @@ -0,0 +1,14 @@ +packages:=boost openssl +native_packages := native_ccache native_comparisontool + +qt_native_packages = native_protobuf +qt_packages = qt qrencode protobuf +qt_linux_packages=expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans + +wallet_packages=bdb + +upnp_packages=miniupnpc + +ifneq ($(build_os),darwin) +darwin_native_packages=native_libuuid native_openssl native_cctools native_cdrkit native_libdmg-hfsplus +endif diff --git a/depends/packages/protobuf.mk b/depends/packages/protobuf.mk new file mode 100644 index 0000000000..716f837853 --- /dev/null +++ b/depends/packages/protobuf.mk @@ -0,0 +1,28 @@ +package=protobuf +$(package)_version=$(native_$(package)_version) +$(package)_download_path=$(native_$(package)_download_path) +$(package)_file_name=$(native_$(package)_file_name) +$(package)_sha256_hash=$(native_$(package)_sha256_hash) +$(package)_dependencies=native_$(package) + +define $(package)_set_vars + $(package)_config_opts=--disable-shared --with-protoc=$(build_prefix)/bin/protoc + $(package)_config_opts_x86_64_linux=--with-pic +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) -C src libprotobuf.la +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) -C src install-libLTLIBRARIES install-nobase_includeHEADERS &&\ + $(MAKE) DESTDIR=$($(package)_staging_dir) install-pkgconfigDATA +endef + +define $(package)_postprocess_cmds + rm lib/libprotoc.a +endef diff --git a/depends/packages/qrencode.mk b/depends/packages/qrencode.mk new file mode 100644 index 0000000000..69d2982cbc --- /dev/null +++ b/depends/packages/qrencode.mk @@ -0,0 +1,22 @@ +package=qrencode +$(package)_version=3.4.3 +$(package)_download_path=https://fukuchi.org/works/qrencode/ +$(package)_file_name=qrencode-$(qrencode_version).tar.bz2 +$(package)_sha256_hash=dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b50597a98 + +define $(package)_set_vars +$(package)_config_opts=--disable-shared -without-tools --disable-sdltest +$(package)_config_opts_x86_64_linux=--with-pic +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk new file mode 100644 index 0000000000..cce7d6e6ef --- /dev/null +++ b/depends/packages/qt.mk @@ -0,0 +1,89 @@ +PACKAGE=qt +$(package)_version=5.2.1 +$(package)_download_path=http://download.qt-project.org/official_releases/qt/5.2/$($(package)_version)/single +$(package)_file_name=$(package)-everywhere-opensource-src-$($(package)_version).tar.gz +$(package)_sha256_hash=84e924181d4ad6db00239d87250cc89868484a14841f77fb85ab1f1dbdcd7da1 +$(package)_dependencies=openssl +$(package)_linux_dependencies=freetype fontconfig dbus libxcb libX11 xproto libXext +$(package)_build_subdir=qtbase +$(package)_qt_libs=corelib network widgets gui plugins testlib +$(package)_patches=mac-qmake.conf fix-xcb-include-order.patch + +define $(package)_set_vars +$(package)_config_opts = -release -opensource -confirm-license +$(package)_config_opts += -no-audio-backend -no-sql-tds -no-glib -no-icu +$(package)_config_opts += -no-cups -no-iconv -no-gif -no-audio-backend -no-freetype +$(package)_config_opts += -no-sql-sqlite -no-nis -no-cups -no-iconv -no-pch +$(package)_config_opts += -no-gif -no-feature-style-plastique +$(package)_config_opts += -no-qml-debug -no-pch -no-nis -nomake examples -nomake tests +$(package)_config_opts += -no-feature-style-cde -no-feature-style-s60 -no-feature-style-motif +$(package)_config_opts += -no-feature-style-windowsmobile -no-feature-style-windowsce +$(package)_config_opts += -no-feature-style-cleanlooks +$(package)_config_opts += -no-sql-db2 -no-sql-ibase -no-sql-oci -no-sql-tds -no-sql-mysql +$(package)_config_opts += -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 +$(package)_config_opts += -skip qtsvg -skip qtwebkit -skip qtwebkit-examples -skip qtserialport +$(package)_config_opts += -skip qtdeclarative -skip qtmultimedia -skip qtimageformats -skip qtx11extras +$(package)_config_opts += -skip qtlocation -skip qtsensors -skip qtquick1 -skip qtxmlpatterns +$(package)_config_opts += -skip qtquickcontrols -skip qtactiveqt -skip qtconnectivity -skip qtmacextras +$(package)_config_opts += -skip qtwinextras -skip qtxmlpatterns -skip qtscript -skip qtdoc + +$(package)_config_opts += -prefix $(host_prefix) -bindir $(build_prefix)/bin +$(package)_config_opts += -no-c++11 -openssl-linked -v -static -silent -pkg-config +$(package)_config_opts += -qt-libpng -qt-libjpeg -qt-zlib -qt-pcre + +ifneq ($(build_os),darwin) +$(package)_config_opts_darwin = -xplatform macx-clang-linux -device-option MAC_SDK_PATH=$(OSX_SDK) -device-option CROSS_COMPILE="$(host)-" +$(package)_config_opts_darwin += -device-option MAC_MIN_VERSION=$(OSX_MIN_VERSION) -device-option MAC_TARGET=$(host) +endif + +$(package)_config_opts_linux = -qt-xkbcommon -qt-xcb -no-eglfs -no-linuxfb -system-freetype -no-sm -fontconfig -no-xinput2 -no-libudev -no-egl -no-opengl +$(package)_config_opts_arm_linux = -platform linux-g++ -xplatform $(host) +$(package)_config_opts_i686_linux = -xplatform linux-g++-32 +$(package)_config_opts_mingw32 = -no-opengl -xplatform win32-g++ -device-option CROSS_COMPILE="$(host)-" +$(package)_build_env = QT_RCC_TEST=1 +endef + +define $(package)_preprocess_cmds + sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \ + sed -i.old "s/src_plugins.depends = src_sql src_xml src_network/src_plugins.depends = src_xml src_network/" qtbase/src/src.pro && \ + sed -i.old "/XIproto.h/d" qtbase/src/plugins/platforms/xcb/qxcbxsettings.cpp && \ + mkdir -p qtbase/mkspecs/macx-clang-linux &&\ + cp -f qtbase/mkspecs/macx-clang/Info.plist.lib qtbase/mkspecs/macx-clang-linux/ &&\ + cp -f qtbase/mkspecs/macx-clang/Info.plist.app qtbase/mkspecs/macx-clang-linux/ &&\ + cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\ + cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \ + patch -p1 < $($(package)_patch_dir)/fix-xcb-include-order.patch +endef + +define $(package)_config_cmds + export PKG_CONFIG_SYSROOT_DIR=/ && \ + export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \ + export PKG_CONFIG_PATH=$(host_prefix)/share/pkgconfig && \ + export CPATH=$(host_prefix)/include && \ + ./configure $($(package)_config_opts) && \ + $(MAKE) sub-src-clean && \ + cd ../qttranslations && ../qtbase/bin/qmake qttranslations.pro -o Makefile && \ + cd translations && ../../qtbase/bin/qmake translations.pro -o Makefile && cd ../.. &&\ + cd qttools/src/linguist/lrelease/ && ../../../../qtbase/bin/qmake lrelease.pro -o Makefile +endef + +define $(package)_build_cmds + export CPATH=$(host_prefix)/include && \ + $(MAKE) -C src $(addprefix sub-,$($(package)_qt_libs)) && \ + $(MAKE) -C ../qttools/src/linguist/lrelease && \ + $(MAKE) -C ../qttranslations +endef + +define $(package)_stage_cmds + $(MAKE) -C src INSTALL_ROOT=$($(package)_staging_dir) $(addsuffix -install_subtargets,$(addprefix sub-,$($(package)_qt_libs))) && cd .. &&\ + $(MAKE) -C qttools/src/linguist/lrelease INSTALL_ROOT=$($(package)_staging_dir) install_target && \ + $(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets && \ + if `test -f qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a`; then \ + cp qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a $($(package)_staging_prefix_dir)/lib; \ + fi +endef + +define $(package)_postprocess_cmds + rm -rf mkspecs/ lib/cmake/ && \ + rm lib/libQt5Bootstrap.a lib/lib*.la lib/lib*.prl +endef diff --git a/depends/packages/xcb_proto.mk b/depends/packages/xcb_proto.mk new file mode 100644 index 0000000000..726e3048c3 --- /dev/null +++ b/depends/packages/xcb_proto.mk @@ -0,0 +1,27 @@ +package=xcb_proto +$(package)_version=1.10 +$(package)_download_path=http://xcb.freedesktop.org/dist +$(package)_file_name=xcb-proto-$($(package)_version).tar.bz2 +$(package)_sha256_hash=7ef40ddd855b750bc597d2a435da21e55e502a0fefa85b274f2c922800baaf05 + +define $(package)_set_vars + $(package)_config_opts=--disable-shared + $(package)_config_opts_x86_64_linux=--with-pic +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds + find -name "*.pyc" -delete && \ + find -name "*.pyo" -delete +endef diff --git a/depends/packages/xextproto.mk b/depends/packages/xextproto.mk new file mode 100644 index 0000000000..98a11eb497 --- /dev/null +++ b/depends/packages/xextproto.mk @@ -0,0 +1,21 @@ +package=xextproto +$(package)_version=7.3.0 +$(package)_download_path=http://xorg.freedesktop.org/releases/individual/proto +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=f3f4b23ac8db9c3a9e0d8edb591713f3d70ef9c3b175970dd8823dfc92aa5bb0 + +define $(package)_set_vars +$(package)_config_opts=--disable-shared +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/xproto.mk b/depends/packages/xproto.mk new file mode 100644 index 0000000000..50a90b2685 --- /dev/null +++ b/depends/packages/xproto.mk @@ -0,0 +1,21 @@ +package=xproto +$(package)_version=7.0.26 +$(package)_download_path=http://xorg.freedesktop.org/releases/individual/proto +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=636162c1759805a5a0114a369dffdeccb8af8c859ef6e1445f26a4e6e046514f + +define $(package)_set_vars +$(package)_config_opts=--disable-shared +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/xtrans.mk b/depends/packages/xtrans.mk new file mode 100644 index 0000000000..b973149797 --- /dev/null +++ b/depends/packages/xtrans.mk @@ -0,0 +1,22 @@ +package=xtrans +$(package)_version=1.3.4 +$(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/ +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=054d4ee3efd52508c753e9f7bc655ef185a29bd2850dd9e2fc2ccc33544f583a +$(package)_dependencies= + +define $(package)_set_vars +$(package)_config_opts_x86_64_linux=--with-pic --disable-static +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/patches/boost/darwin_boost_atomic-1.patch b/depends/patches/boost/darwin_boost_atomic-1.patch new file mode 100644 index 0000000000..97f59cb7e4 --- /dev/null +++ b/depends/patches/boost/darwin_boost_atomic-1.patch @@ -0,0 +1,35 @@ +diff --git a/include/boost/atomic/detail/cas128strong.hpp b/include/boost/atomic/detail/cas128strong.hpp +index 906c13e..dcb4d7d 100644 +--- a/include/boost/atomic/detail/cas128strong.hpp ++++ b/include/boost/atomic/detail/cas128strong.hpp +@@ -196,15 +196,17 @@ class base_atomic + + public: + BOOST_DEFAULTED_FUNCTION(base_atomic(void), {}) +- explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0) ++ explicit base_atomic(value_type const& v) BOOST_NOEXCEPT + { ++ memset(&v_, 0, sizeof(v_)); + memcpy(&v_, &v, sizeof(value_type)); + } + + void + store(value_type const& value, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT + { +- storage_type value_s = 0; ++ storage_type value_s; ++ memset(&value_s, 0, sizeof(value_s)); + memcpy(&value_s, &value, sizeof(value_type)); + platform_fence_before_store(order); + platform_store128(value_s, &v_); +@@ -247,7 +249,9 @@ class base_atomic + memory_order success_order, + memory_order failure_order) volatile BOOST_NOEXCEPT + { +- storage_type expected_s = 0, desired_s = 0; ++ storage_type expected_s, desired_s; ++ memset(&expected_s, 0, sizeof(expected_s)); ++ memset(&desired_s, 0, sizeof(desired_s)); + memcpy(&expected_s, &expected, sizeof(value_type)); + memcpy(&desired_s, &desired, sizeof(value_type)); + diff --git a/depends/patches/boost/darwin_boost_atomic-2.patch b/depends/patches/boost/darwin_boost_atomic-2.patch new file mode 100644 index 0000000000..ca50765200 --- /dev/null +++ b/depends/patches/boost/darwin_boost_atomic-2.patch @@ -0,0 +1,55 @@ +diff --git a/include/boost/atomic/detail/gcc-atomic.hpp b/include/boost/atomic/detail/gcc-atomic.hpp +index a130590..4af99a1 100644 +--- a/include/boost/atomic/detail/gcc-atomic.hpp ++++ b/include/boost/atomic/detail/gcc-atomic.hpp +@@ -958,14 +958,16 @@ class base_atomic + + public: + BOOST_DEFAULTED_FUNCTION(base_atomic(void), {}) +- explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0) ++ explicit base_atomic(value_type const& v) BOOST_NOEXCEPT + { ++ memset(&v_, 0, sizeof(v_)); + memcpy(&v_, &v, sizeof(value_type)); + } + + void store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT + { +- storage_type tmp = 0; ++ storage_type tmp; ++ memset(&tmp, 0, sizeof(tmp)); + memcpy(&tmp, &v, sizeof(value_type)); + __atomic_store_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order)); + } +@@ -980,7 +982,8 @@ class base_atomic + + value_type exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT + { +- storage_type tmp = 0; ++ storage_type tmp; ++ memset(&tmp, 0, sizeof(tmp)); + memcpy(&tmp, &v, sizeof(value_type)); + tmp = __atomic_exchange_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order)); + value_type res; +@@ -994,7 +997,9 @@ class base_atomic + memory_order success_order, + memory_order failure_order) volatile BOOST_NOEXCEPT + { +- storage_type expected_s = 0, desired_s = 0; ++ storage_type expected_s, desired_s; ++ memset(&expected_s, 0, sizeof(expected_s)); ++ memset(&desired_s, 0, sizeof(desired_s)); + memcpy(&expected_s, &expected, sizeof(value_type)); + memcpy(&desired_s, &desired, sizeof(value_type)); + const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, false, +@@ -1010,7 +1015,9 @@ class base_atomic + memory_order success_order, + memory_order failure_order) volatile BOOST_NOEXCEPT + { +- storage_type expected_s = 0, desired_s = 0; ++ storage_type expected_s, desired_s; ++ memset(&expected_s, 0, sizeof(expected_s)); ++ memset(&desired_s, 0, sizeof(desired_s)); + memcpy(&expected_s, &expected, sizeof(value_type)); + memcpy(&desired_s, &desired, sizeof(value_type)); + const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, true, diff --git a/depends/patches/native_cdrkit/cdrkit-deterministic.patch b/depends/patches/native_cdrkit/cdrkit-deterministic.patch new file mode 100644 index 0000000000..8ab0993dc4 --- /dev/null +++ b/depends/patches/native_cdrkit/cdrkit-deterministic.patch @@ -0,0 +1,86 @@ +--- cdrkit-1.1.11.old/genisoimage/tree.c 2008-10-21 19:57:47.000000000 -0400 ++++ cdrkit-1.1.11/genisoimage/tree.c 2013-12-06 00:23:18.489622668 -0500 +@@ -1139,8 +1139,9 @@ + scan_directory_tree(struct directory *this_dir, char *path, + struct directory_entry *de) + { +- DIR *current_dir; ++ int current_file; + char whole_path[PATH_MAX]; ++ struct dirent **d_list; + struct dirent *d_entry; + struct directory *parent; + int dflag; +@@ -1164,7 +1165,8 @@ + this_dir->dir_flags |= DIR_WAS_SCANNED; + + errno = 0; /* Paranoia */ +- current_dir = opendir(path); ++ //current_dir = opendir(path); ++ current_file = scandir(path, &d_list, NULL, alphasort); + d_entry = NULL; + + /* +@@ -1173,12 +1175,12 @@ + */ + old_path = path; + +- if (current_dir) { ++ if (current_file >= 0) { + errno = 0; +- d_entry = readdir(current_dir); ++ d_entry = d_list[0]; + } + +- if (!current_dir || !d_entry) { ++ if (current_file < 0 || !d_entry) { + int ret = 1; + + #ifdef USE_LIBSCHILY +@@ -1191,8 +1193,8 @@ + de->isorec.flags[0] &= ~ISO_DIRECTORY; + ret = 0; + } +- if (current_dir) +- closedir(current_dir); ++ if(d_list) ++ free(d_list); + return (ret); + } + #ifdef ABORT_DEEP_ISO_ONLY +@@ -1208,7 +1210,7 @@ + errmsgno(EX_BAD, "use Rock Ridge extensions via -R or -r,\n"); + errmsgno(EX_BAD, "or allow deep ISO9660 directory nesting via -D.\n"); + } +- closedir(current_dir); ++ free(d_list); + return (1); + } + #endif +@@ -1250,13 +1252,13 @@ + * The first time through, skip this, since we already asked + * for the first entry when we opened the directory. + */ +- if (dflag) +- d_entry = readdir(current_dir); ++ if (dflag && current_file >= 0) ++ d_entry = d_list[current_file]; + dflag++; + +- if (!d_entry) ++ if (current_file < 0) + break; +- ++ current_file--; + /* OK, got a valid entry */ + + /* If we do not want all files, then pitch the backups. */ +@@ -1348,7 +1350,7 @@ + insert_file_entry(this_dir, whole_path, d_entry->d_name); + #endif /* APPLE_HYB */ + } +- closedir(current_dir); ++ free(d_list); + + #ifdef APPLE_HYB + /* diff --git a/depends/patches/qt/fix-xcb-include-order.patch b/depends/patches/qt/fix-xcb-include-order.patch new file mode 100644 index 0000000000..bf6c6dca36 --- /dev/null +++ b/depends/patches/qt/fix-xcb-include-order.patch @@ -0,0 +1,21 @@ +--- old/qtbase/src/plugins/platforms/xcb/xcb-plugin.pro 2014-07-30 18:17:27.384458441 -0400 ++++ new/qtbase/src/plugins/platforms/xcb/xcb-plugin.pro 2014-07-30 18:18:28.620459303 -0400 +@@ -101,10 +101,6 @@ + } + } + +-DEFINES += $$QMAKE_DEFINES_XCB +-LIBS += $$QMAKE_LIBS_XCB +-QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XCB +- + CONFIG += qpa/genericunixfontdatabase + + contains(QT_CONFIG, dbus) { +@@ -141,3 +137,7 @@ + INCLUDEPATH += ../../../3rdparty/xkbcommon/xkbcommon/ + } + } ++ ++DEFINES += $$QMAKE_DEFINES_XCB ++LIBS += $$QMAKE_LIBS_XCB ++INCLUDEPATH += $$QMAKE_CFLAGS_XCB diff --git a/depends/patches/qt/mac-qmake.conf b/depends/patches/qt/mac-qmake.conf new file mode 100644 index 0000000000..f7302265bc --- /dev/null +++ b/depends/patches/qt/mac-qmake.conf @@ -0,0 +1,23 @@ +MAKEFILE_GENERATOR = UNIX +CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname absolute_library_soname +QMAKE_INCREMENTAL_STYLE = sublib +include(../common/macx.conf) +include(../common/gcc-base-mac.conf) +include(../common/clang.conf) +include(../common/clang-mac.conf) +QMAKE_MAC_SDK_PATH=$${MAC_SDK_PATH} +QMAKE_XCODE_VERSION=4.3 +QMAKE_XCODE_DEVELOPER_PATH=/Developer +QMAKE_MACOSX_DEPLOYMENT_TARGET = $${MAC_MIN_VERSION} +QMAKE_MAC_SDK=macosx +QMAKE_MAC_SDK.macosx.path = $$QMAKE_MAC_SDK_PATH +QMAKE_MAC_SDK.macosx.platform_name = macosx +QMAKE_CFLAGS += -target $${MAC_TARGET} +QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_CFLAGS +QMAKE_CXXFLAGS += $$QMAKE_CFLAGS +QMAKE_LFLAGS += -target $${MAC_TARGET} +QMAKE_AR = $${CROSS_COMPILE}ar cq +QMAKE_RANLIB=$${CROSS_COMPILE}ranlib +QMAKE_LIBTOOL=$${CROSS_COMPILE}libtool +QMAKE_INSTALL_NAME_TOOL=$${CROSS_COMPILE}install_name_tool +load(qt_config) From 8021cf8dbc0aafa15a481c6d9348771a0d0405ff Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 8 Aug 2014 15:19:49 -0400 Subject: [PATCH 0501/1288] build: fix FDELT_TYPE configure check This probably never worked properly. Confirmed working now with every compiler I throw at it. --- configure.ac | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0b2a429e02..ffd05ae4f8 100644 --- a/configure.ac +++ b/configure.ac @@ -332,7 +332,10 @@ if test x$use_glibc_compat != xno; then #__fdelt_chk's params and return type have changed from long unsigned int to long int. # See which one is present here. AC_MSG_CHECKING(__fdelt_chk type) - AC_TRY_COMPILE([#define __USE_FORTIFY_LEVEL 2 + AC_TRY_COMPILE([#ifdef _FORTIFY_SOURCE + #undef _FORTIFY_SOURCE + #endif + #define _FORTIFY_SOURCE 2 #include extern "C" long unsigned int __fdelt_warn(long unsigned int);],[], [ fdelt_type="long unsigned int"], From 565e56977235974c0dd3acfe2023beb84974297c Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 8 Aug 2014 15:21:50 -0400 Subject: [PATCH 0502/1288] libc-compat: add new symbol that's now needed --- src/compat/glibcxx_compat.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compat/glibcxx_compat.cpp b/src/compat/glibcxx_compat.cpp index 417166aeda..cbe059735b 100644 --- a/src/compat/glibcxx_compat.cpp +++ b/src/compat/glibcxx_compat.cpp @@ -64,6 +64,8 @@ template istream& istream::_M_extract(unsigned short&); out_of_range::~out_of_range() _GLIBCXX_USE_NOEXCEPT { } +length_error::~length_error() _GLIBCXX_USE_NOEXCEPT { } + // Used with permission. // See: https://github.com/madlib/madlib/commit/c3db418c0d34d6813608f2137fef1012ce03043d From 216e9a4456207f5ae9cd85926521851e11a26d92 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 7 Aug 2014 23:00:01 +0200 Subject: [PATCH 0503/1288] Add a way to limit deserialized string lengths and use it for most strings being serialized. --- src/alert.h | 6 +++--- src/main.cpp | 9 +++------ src/serialize.h | 39 +++++++++++++++++++++++++++++++++++++-- src/wallet.h | 6 +++--- 4 files changed, 46 insertions(+), 14 deletions(-) diff --git a/src/alert.h b/src/alert.h index da140be5e5..296d48891a 100644 --- a/src/alert.h +++ b/src/alert.h @@ -60,9 +60,9 @@ public: READWRITE(setSubVer); READWRITE(nPriority); - READWRITE(strComment); - READWRITE(strStatusBar); - READWRITE(strReserved); + READWRITE(LIMITED_STRING(strComment, 65536)); + READWRITE(LIMITED_STRING(strStatusBar, 256)); + READWRITE(LIMITED_STRING(strReserved, 256)); ) void SetNull(); diff --git a/src/main.cpp b/src/main.cpp index ba521b6b19..dec5bb6524 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3559,7 +3559,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, if (!vRecv.empty()) vRecv >> addrFrom >> nNonce; if (!vRecv.empty()) { - vRecv >> pfrom->strSubVer; + vRecv >> LIMITED_STRING(pfrom->strSubVer, 256); pfrom->cleanSubVer = SanitizeString(pfrom->strSubVer); } if (!vRecv.empty()) @@ -4183,7 +4183,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, if (fDebug) { string strMsg; unsigned char ccode; string strReason; - vRecv >> strMsg >> ccode >> strReason; + vRecv >> LIMITED_STRING(strMsg, CMessageHeader::COMMAND_SIZE) >> ccode >> LIMITED_STRING(strReason, 111); ostringstream ss; ss << strMsg << " code " << itostr(ccode) << ": " << strReason; @@ -4194,10 +4194,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, vRecv >> hash; ss << ": hash " << hash.ToString(); } - // Truncate to reasonable length and sanitize before printing: - string s = ss.str(); - if (s.size() > 111) s.erase(111, string::npos); - LogPrint("net", "Reject %s\n", SanitizeString(s)); + LogPrint("net", "Reject %s\n", SanitizeString(ss.str())); } } diff --git a/src/serialize.h b/src/serialize.h index f876efd9b5..2eb69b3ec0 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -334,8 +334,9 @@ I ReadVarInt(Stream& is) } } -#define FLATDATA(obj) REF(CFlatData((char*)&(obj), (char*)&(obj) + sizeof(obj))) -#define VARINT(obj) REF(WrapVarInt(REF(obj))) +#define FLATDATA(obj) REF(CFlatData((char*)&(obj), (char*)&(obj) + sizeof(obj))) +#define VARINT(obj) REF(WrapVarInt(REF(obj))) +#define LIMITED_STRING(obj,n) REF(LimitedString< n >(REF(obj))) /** Wrapper for serializing arrays and POD. */ @@ -398,6 +399,40 @@ public: } }; +template +class LimitedString +{ +protected: + std::string& string; +public: + LimitedString(std::string& string) : string(string) {} + + template + void Unserialize(Stream& s, int, int=0) + { + size_t size = ReadCompactSize(s); + if (size > Limit) { + throw std::ios_base::failure("String length limit exceeded"); + } + string.resize(size); + if (size != 0) + s.read((char*)&string[0], size); + } + + template + void Serialize(Stream& s, int, int=0) const + { + WriteCompactSize(s, string.size()); + if (!string.empty()) + s.write((char*)&string[0], string.size()); + } + + unsigned int GetSerializeSize(int, int=0) const + { + return GetSizeOfCompactSize(string.size()) + string.size(); + } +}; + template CVarInt WrapVarInt(I& n) { return CVarInt(n); } diff --git a/src/wallet.h b/src/wallet.h index 73fcfa24e0..864a635ec7 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -858,7 +858,7 @@ public: READWRITE(vchPrivKey); READWRITE(nTimeCreated); READWRITE(nTimeExpires); - READWRITE(strComment); + READWRITE(LIMITED_STRING(strComment, 65536)); ) }; @@ -933,7 +933,7 @@ public: // Note: strAccount is serialized as part of the key, not here. READWRITE(nCreditDebit); READWRITE(nTime); - READWRITE(strOtherAccount); + READWRITE(LIMITED_STRING(strOtherAccount, 65536)); if (!fRead) { @@ -949,7 +949,7 @@ public: } } - READWRITE(strComment); + READWRITE(LIMITED_STRING(strComment, 65536)); size_t nSepPos = strComment.find("\0", 0, 1); if (fRead) From eb0b56b19017ab5c16c745e6da39c53126924ed6 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 1 Aug 2014 22:57:55 +0200 Subject: [PATCH 0504/1288] Simplify serialize.h's exception handling Remove the 'state' and 'exceptmask' from serialize.h's stream implementations, as well as related methods. As exceptmask always included 'failbit', and setstate was always called with bits = failbit, all it did was immediately raise an exception. Get rid of those variables, and replace the setstate with direct exception throwing (which also removes some dead code). As a result, good() is never reached after a failure (there are only 2 calls, one of which is in tests), and can just be replaced by !eof(). fail(), clear(n) and exceptions() are just never called. Delete them. --- src/main.cpp | 2 +- src/serialize.h | 63 ++++------------------------------------ src/test/alert_tests.cpp | 2 +- 3 files changed, 8 insertions(+), 59 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 353cde0bd7..3add3491c8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3228,7 +3228,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp) } } uint64_t nRewind = blkdat.GetPos(); - while (blkdat.good() && !blkdat.eof()) { + while (!blkdat.eof()) { boost::this_thread::interruption_point(); blkdat.SetPos(nRewind); diff --git a/src/serialize.h b/src/serialize.h index f876efd9b5..748a2a0d4e 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -870,8 +870,6 @@ protected: typedef CSerializeData vector_type; vector_type vch; unsigned int nReadPos; - short state; - short exceptmask; public: int nType; int nVersion; @@ -923,8 +921,6 @@ public: nReadPos = 0; nType = nTypeIn; nVersion = nVersionIn; - state = 0; - exceptmask = std::ios::badbit | std::ios::failbit; } CDataStream& operator+=(const CDataStream& b) @@ -1047,19 +1043,7 @@ public: // // Stream subset // - void setstate(short bits, const char* psz) - { - state |= bits; - if (state & exceptmask) - throw std::ios_base::failure(psz); - } - bool eof() const { return size() == 0; } - bool fail() const { return state & (std::ios::badbit | std::ios::failbit); } - bool good() const { return !eof() && (state == 0); } - void clear(short n) { state = n; } // name conflict with vector clear() - short exceptions() { return exceptmask; } - short exceptions(short mask) { short prev = exceptmask; exceptmask = mask; setstate(0, "CDataStream"); return prev; } CDataStream* rdbuf() { return this; } int in_avail() { return size(); } @@ -1079,9 +1063,7 @@ public: { if (nReadPosNext > vch.size()) { - setstate(std::ios::failbit, "CDataStream::read() : end of data"); - memset(pch, 0, nSize); - nSize = vch.size() - nReadPos; + throw std::ios_base::failure("CDataStream::read() : end of data"); } memcpy(pch, &vch[nReadPos], nSize); nReadPos = 0; @@ -1101,7 +1083,7 @@ public: if (nReadPosNext >= vch.size()) { if (nReadPosNext > vch.size()) - setstate(std::ios::failbit, "CDataStream::ignore() : end of data"); + throw std::ios_base::failure("CDataStream::ignore() : end of data"); nReadPos = 0; vch.clear(); return (*this); @@ -1174,8 +1156,6 @@ class CAutoFile { protected: FILE* file; - short state; - short exceptmask; public: int nType; int nVersion; @@ -1185,8 +1165,6 @@ public: file = filenew; nType = nTypeIn; nVersion = nVersionIn; - state = 0; - exceptmask = std::ios::badbit | std::ios::failbit; } ~CAutoFile() @@ -1213,19 +1191,6 @@ public: // // Stream subset // - void setstate(short bits, const char* psz) - { - state |= bits; - if (state & exceptmask) - throw std::ios_base::failure(psz); - } - - bool fail() const { return state & (std::ios::badbit | std::ios::failbit); } - bool good() const { return state == 0; } - void clear(short n = 0) { state = n; } - short exceptions() { return exceptmask; } - short exceptions(short mask) { short prev = exceptmask; exceptmask = mask; setstate(0, "CAutoFile"); return prev; } - void SetType(int n) { nType = n; } int GetType() { return nType; } void SetVersion(int n) { nVersion = n; } @@ -1238,7 +1203,7 @@ public: if (!file) throw std::ios_base::failure("CAutoFile::read : file handle is NULL"); if (fread(pch, 1, nSize, file) != nSize) - setstate(std::ios::failbit, feof(file) ? "CAutoFile::read : end of file" : "CAutoFile::read : fread failed"); + throw std::ios_base::failure(feof(file) ? "CAutoFile::read : end of file" : "CAutoFile::read : fread failed"); return (*this); } @@ -1247,7 +1212,7 @@ public: if (!file) throw std::ios_base::failure("CAutoFile::write : file handle is NULL"); if (fwrite(pch, 1, nSize, file) != nSize) - setstate(std::ios::failbit, "CAutoFile::write : write failed"); + throw std::ios_base::failure("CAutoFile::write : write failed"); return (*this); } @@ -1292,16 +1257,7 @@ private: uint64_t nRewind; // how many bytes we guarantee to rewind std::vector vchBuf; // the buffer - short state; - short exceptmask; - protected: - void setstate(short bits, const char *psz) { - state |= bits; - if (state & exceptmask) - throw std::ios_base::failure(psz); - } - // read data from the source to fill the buffer bool Fill() { unsigned int pos = nSrcPos % vchBuf.size(); @@ -1313,8 +1269,7 @@ protected: return false; size_t read = fread((void*)&vchBuf[pos], 1, readNow, src); if (read == 0) { - setstate(std::ios_base::failbit, feof(src) ? "CBufferedFile::Fill : end of file" : "CBufferedFile::Fill : fread failed"); - return false; + throw std::ios_base::failure(feof(src) ? "CBufferedFile::Fill : end of file" : "CBufferedFile::Fill : fread failed"); } else { nSrcPos += read; return true; @@ -1327,12 +1282,7 @@ public: CBufferedFile(FILE *fileIn, uint64_t nBufSize, uint64_t nRewindIn, int nTypeIn, int nVersionIn) : src(fileIn), nSrcPos(0), nReadPos(0), nReadLimit((uint64_t)(-1)), nRewind(nRewindIn), vchBuf(nBufSize, 0), - state(0), exceptmask(std::ios_base::badbit | std::ios_base::failbit), nType(nTypeIn), nVersion(nVersionIn) { - } - - // check whether no error occurred - bool good() const { - return state == 0; + nType(nTypeIn), nVersion(nVersionIn) { } // check whether we're at the end of the source file @@ -1391,7 +1341,6 @@ public: nLongPos = ftell(src); nSrcPos = nLongPos; nReadPos = nLongPos; - state = 0; return true; } diff --git a/src/test/alert_tests.cpp b/src/test/alert_tests.cpp index b16f3f7f57..e3066a51ab 100644 --- a/src/test/alert_tests.cpp +++ b/src/test/alert_tests.cpp @@ -83,7 +83,7 @@ struct ReadAlerts std::vector vch(alert_tests::alertTests, alert_tests::alertTests + sizeof(alert_tests::alertTests)); CDataStream stream(vch, SER_DISK, CLIENT_VERSION); try { - while (stream.good()) + while (!stream.eof()) { CAlert alert; stream >> alert; From ab45ddb599edc46516b71b35c5afe3e8d0fc3e9b Mon Sep 17 00:00:00 2001 From: Derek701 Date: Fri, 8 Aug 2014 23:13:06 -0500 Subject: [PATCH 0505/1288] Fix typo in gettransaction help --- src/rpcwallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 667ca33ce1..215da2ea12 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1518,7 +1518,7 @@ Value gettransaction(const Array& params, bool fHelp) " \"hex\" : \"data\" (string) Raw data for transaction\n" "}\n" - "\nbExamples\n" + "\nExamples:\n" + HelpExampleCli("gettransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") + HelpExampleRpc("gettransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") ); From 9297763dadeee2fc74fcbbbf8eb227e4930877f1 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 10 Aug 2014 02:28:23 +0200 Subject: [PATCH 0506/1288] [Qt] Add TRY_LOCK back to peertablemodel --- src/qt/peertablemodel.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp index 54b46867ea..cfa05300cf 100644 --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -75,8 +75,14 @@ public: } // Try to retrieve the CNodeStateStats for each node. - BOOST_FOREACH(CNodeCombinedStats &stats, cachedNodeStats) - stats.fNodeStateStatsAvailable = GetNodeStateStats(stats.nodeStats.nodeid, stats.nodeStateStats); + { + TRY_LOCK(cs_main, lockMain); + if (lockMain) + { + BOOST_FOREACH(CNodeCombinedStats &stats, cachedNodeStats) + stats.fNodeStateStatsAvailable = GetNodeStateStats(stats.nodeStats.nodeid, stats.nodeStateStats); + } + } if (sortColumn >= 0) // sort cacheNodeStats (use stable sort to prevent rows jumping around unneceesarily) From 22b3c4bbbd4ce319b1702f069ba962fc0cff9393 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sun, 10 Aug 2014 14:28:09 +0200 Subject: [PATCH 0507/1288] remove unused class CAddrMan; from db.h --- src/db.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/db.h b/src/db.h index 66d7f31917..bba267b84f 100644 --- a/src/db.h +++ b/src/db.h @@ -17,7 +17,6 @@ #include #include -class CAddrMan; struct CBlockLocator; class CDiskBlockIndex; class COutPoint; From 1e21c17d208e310295475c0e4a46d750a5c9ba2d Mon Sep 17 00:00:00 2001 From: Gregory Maxwell Date: Sun, 6 Apr 2014 00:18:52 -0700 Subject: [PATCH 0508/1288] Make CCryptoKeyStore::Unlock check all keys. CCryptoKeyStore::Unlock has a loop to attempt decrypting each key which only executes once, likely due to a simple mistake when the code was originally written. This patch fixes the behavior by making it check all keys. It also adds a fatal assertion in the case some decrypt but some do not, since that indicates that the wallet is in some kind of really bad state. This may make unlocking noticeably slower on wallets with many keys. --- src/crypter.cpp | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/crypter.cpp b/src/crypter.cpp index 4c43e3a798..2f94e08273 100644 --- a/src/crypter.cpp +++ b/src/crypter.cpp @@ -152,6 +152,8 @@ bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn) if (!SetCrypted()) return false; + bool keyPass = false; + bool keyFail = false; CryptedKeyMap::const_iterator mi = mapCryptedKeys.begin(); for (; mi != mapCryptedKeys.end(); ++mi) { @@ -159,15 +161,31 @@ bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn) const std::vector &vchCryptedSecret = (*mi).second.second; CKeyingMaterial vchSecret; if(!DecryptSecret(vMasterKeyIn, vchCryptedSecret, vchPubKey.GetHash(), vchSecret)) - return false; + { + keyFail = true; + break; + } if (vchSecret.size() != 32) - return false; + { + keyFail = true; + break; + } CKey key; key.Set(vchSecret.begin(), vchSecret.end(), vchPubKey.IsCompressed()); - if (key.GetPubKey() == vchPubKey) + if (key.GetPubKey() != vchPubKey) + { + keyFail = true; break; - return false; + } + keyPass = true; } + if (keyPass && keyFail) + { + LogPrintf("The wallet is probably corrupted: Some keys decrypt but not all."); + assert(false); + } + if (keyFail || !keyPass) + return false; vMasterKey = vMasterKeyIn; } NotifyStatusChanged(this); From a35b55b522da8eeaed895f0ed43ba595fc083498 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 9 Aug 2014 18:49:07 -0700 Subject: [PATCH 0509/1288] Dont run full check every time we decrypt wallet. --- src/crypter.cpp | 3 +++ src/crypter.h | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/crypter.cpp b/src/crypter.cpp index 2f94e08273..122e06d97e 100644 --- a/src/crypter.cpp +++ b/src/crypter.cpp @@ -178,6 +178,8 @@ bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn) break; } keyPass = true; + if (fDecryptionThoroughlyChecked) + break; } if (keyPass && keyFail) { @@ -187,6 +189,7 @@ bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn) if (keyFail || !keyPass) return false; vMasterKey = vMasterKeyIn; + fDecryptionThoroughlyChecked = true; } NotifyStatusChanged(this); return true; diff --git a/src/crypter.h b/src/crypter.h index 4791428b48..f16fcef9c7 100644 --- a/src/crypter.h +++ b/src/crypter.h @@ -121,6 +121,9 @@ private: // if fUseCrypto is false, vMasterKey must be empty bool fUseCrypto; + // keeps track of whether Unlock has run a thourough check before + bool fDecryptionThoroughlyChecked; + protected: bool SetCrypted(); @@ -130,7 +133,7 @@ protected: bool Unlock(const CKeyingMaterial& vMasterKeyIn); public: - CCryptoKeyStore() : fUseCrypto(false) + CCryptoKeyStore() : fUseCrypto(false), fDecryptionThoroughlyChecked(false) { } From ea100c73fae8a134c6ae2f1e39f557448734e012 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 11 Aug 2014 08:43:06 +0200 Subject: [PATCH 0510/1288] Reduce maximum coinscache size during verification Due to growing coinsviewcaches, the memory usage with checklevel=3 (and standard settings for dbcache) could be up to 500MiB on a 64-bit system. This is about twice the peak during reindexing, unnecessarily extending bitcoind's memory envelope. This commit reduces the maximum total size of the caches used during verification to just nCoinCacheSize, which should be the limit. --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index ba521b6b19..55206600e2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3052,7 +3052,7 @@ bool CVerifyDB::VerifyDB(int nCheckLevel, int nCheckDepth) } } // check level 3: check for inconsistencies during memory-only disconnect of tip blocks - if (nCheckLevel >= 3 && pindex == pindexState && (coins.GetCacheSize() + pcoinsTip->GetCacheSize()) <= 2*nCoinCacheSize + 32000) { + if (nCheckLevel >= 3 && pindex == pindexState && (coins.GetCacheSize() + pcoinsTip->GetCacheSize()) <= nCoinCacheSize) { bool fClean = true; if (!DisconnectBlock(block, state, pindex, coins, &fClean)) return error("VerifyDB() : *** irrecoverable inconsistency in block data at %d, hash=%s", pindex->nHeight, pindex->GetBlockHash().ToString()); From da2ec100f3681176f60dec6dc675fc64147ade3a Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Mon, 19 May 2014 22:25:17 +0200 Subject: [PATCH 0511/1288] Add a getutxos command to the p2p protocol. It allows querying of the UTXO set given a set of outpoints. --- src/main.cpp | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/net.cpp | 2 +- src/protocol.h | 1 + src/version.h | 2 +- 4 files changed, 89 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ba521b6b19..569b012462 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,6 +20,7 @@ #include +#include #include #include #include @@ -3512,6 +3513,75 @@ void static ProcessGetData(CNode* pfrom) } } +struct CCoin { + uint32_t nTxVer; // Don't call this nVersion, that name has a special meaning inside IMPLEMENT_SERIALIZE + uint32_t nHeight; + CTxOut out; + + IMPLEMENT_SERIALIZE( + READWRITE(nTxVer); + READWRITE(nHeight); + READWRITE(out); + ) +}; + +bool ProcessGetUTXOs(const vector &vOutPoints, bool fCheckMemPool, vector *result, vector *resultCoins) +{ + // Defined by BIP 64. + // + // Allows a peer to retrieve the CTxOut structures corresponding to the given COutPoints. + // Note that this data is not authenticated by anything: this code could just invent any + // old rubbish and hand it back, with the peer being unable to tell unless they are checking + // the outpoints against some out of band data. + // + // Also the answer could change the moment after we give it. However some apps can tolerate + // this, because they're only using the result as a hint or are willing to trust the results + // based on something else. For example we may be a "trusted node" for the peer, or it may + // be checking the results given by several nodes for consistency, it may + // run the UTXOs returned against scriptSigs of transactions obtained elsewhere (after checking + // for a standard script form), and because the height in which the UTXO was defined is provided + // a client that has a map of heights to block headers (as SPV clients do, for recent blocks) + // can request the creating block via hash. + // + // IMPORTANT: Clients expect ordering to be preserved! + if (vOutPoints.size() > MAX_INV_SZ) + return error("message getutxos size() = %u", vOutPoints.size()); + + LogPrint("net", "getutxos for %d queries %s mempool\n", vOutPoints.size(), fCheckMemPool ? "with" : "without"); + + boost::dynamic_bitset hits(vOutPoints.size()); + { + LOCK2(cs_main, mempool.cs); + CCoinsViewMemPool cvMemPool(*pcoinsTip, mempool); + CCoinsViewCache view(fCheckMemPool ? cvMemPool : *pcoinsTip); + for (size_t i = 0; i < vOutPoints.size(); i++) + { + CCoins coins; + uint256 hash = vOutPoints[i].hash; + if (view.GetCoins(hash, coins)) + { + mempool.pruneSpent(hash, coins); + if (coins.IsAvailable(vOutPoints[i].n)) + { + hits[i] = true; + // Safe to index into vout here because IsAvailable checked if it's off the end of the array, or if + // n is valid but points to an already spent output (IsNull). + CCoin coin; + coin.nTxVer = coins.nVersion; + coin.nHeight = coins.nHeight; + coin.out = coins.vout.at(vOutPoints[i].n); + assert(!coin.out.IsNull()); + resultCoins->push_back(coin); + } + } + } + } + + boost::to_block_range(hits, std::back_inserter(*result)); + return true; +} + + bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, int64_t nTimeReceived) { RandAddSeedPerfmon(); @@ -3860,6 +3930,22 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } + else if (strCommand == "getutxos") + { + bool fCheckMemPool; + vector vOutPoints; + vRecv >> fCheckMemPool; + vRecv >> vOutPoints; + + vector bitmap; + vector outs; + if (ProcessGetUTXOs(vOutPoints, fCheckMemPool, &bitmap, &outs)) + pfrom->PushMessage("utxos", chainActive.Height(), chainActive.Tip()->GetBlockHash(), bitmap, outs); + else + Misbehaving(pfrom->GetId(), 20); + } + + else if (strCommand == "tx") { vector vWorkQueue; diff --git a/src/net.cpp b/src/net.cpp index 62124514c8..e78c7b7fa2 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -66,7 +66,7 @@ namespace { // bool fDiscover = true; bool fListen = true; -uint64_t nLocalServices = NODE_NETWORK; +uint64_t nLocalServices = NODE_NETWORK | NODE_GETUTXOS; CCriticalSection cs_mapLocalHost; map mapLocalHost; static bool vfReachable[NET_MAX] = {}; diff --git a/src/protocol.h b/src/protocol.h index 1f23274299..6019dab0c8 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -64,6 +64,7 @@ class CMessageHeader enum { NODE_NETWORK = (1 << 0), + NODE_GETUTXOS = (1 << 1), // Bits 24-31 are reserved for temporary experiments. Just pick a bit that // isn't getting used, or one not being used much, and notify the diff --git a/src/version.h b/src/version.h index 85c5dbf8d7..fbb731c91d 100644 --- a/src/version.h +++ b/src/version.h @@ -26,7 +26,7 @@ extern const std::string CLIENT_DATE; // network protocol versioning // -static const int PROTOCOL_VERSION = 70002; +static const int PROTOCOL_VERSION = 70003; // initial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209; From ea96475d23487df975c688e8cba8b1fe254e43fd Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 11 Aug 2014 14:37:24 +0200 Subject: [PATCH 0512/1288] build: Add mention of --disable-wallet to bdb48 error messages --- src/m4/bitcoin_find_bdb48.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m4/bitcoin_find_bdb48.m4 b/src/m4/bitcoin_find_bdb48.m4 index 72ec49b635..5223163fe5 100644 --- a/src/m4/bitcoin_find_bdb48.m4 +++ b/src/m4/bitcoin_find_bdb48.m4 @@ -44,7 +44,7 @@ AC_DEFUN([BITCOIN_FIND_BDB48],[ AC_ARG_WITH([incompatible-bdb],[AS_HELP_STRING([--with-incompatible-bdb], [allow using a bdb version other than 4.8])],[ AC_MSG_WARN([Found Berkeley DB other than 4.8; wallets opened by this build will not be portable!]) ],[ - AC_MSG_ERROR([Found Berkeley DB other than 4.8, required for portable wallets (--with-incompatible-bdb to ignore)]) + AC_MSG_ERROR([Found Berkeley DB other than 4.8, required for portable wallets (--with-incompatible-bdb to ignore or --disable-wallet to disable wallet functionality)]) ]) else BITCOIN_SUBDIR_TO_INCLUDE(BDB_CPPFLAGS,[${bdb48path}],db_cxx) @@ -60,7 +60,7 @@ AC_DEFUN([BITCOIN_FIND_BDB48],[ ]) done if test "x$BDB_LIBS" = "x"; then - AC_MSG_ERROR(libdb_cxx missing) + AC_MSG_ERROR([libdb_cxx missing, Bitcoin Core requires this library for wallet functionality (--disable-wallet to disable wallet functionality)]) fi AC_SUBST(BDB_LIBS) ]) From 6b5b7cbfb4cafaf0b616ba5cf72024b9d01a2fac Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Tue, 15 Jul 2014 21:38:52 +0200 Subject: [PATCH 0513/1288] Categorize rpc help overview Conflicts: src/rpcserver.cpp Github-Pull: #4539 Rebased-By: Wladimir J. van der Laan Rebased-From: df3d321 --- src/rpcserver.cpp | 191 +++++++++++++++++++++++++--------------------- src/rpcserver.h | 1 + 2 files changed, 107 insertions(+), 85 deletions(-) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index e7ed73310c..56064941f6 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -135,11 +135,18 @@ vector ParseHexO(const Object& o, string strKey) string CRPCTable::help(string strCommand) const { string strRet; + string category; set setDone; + vector > vCommands; + for (map::const_iterator mi = mapCommands.begin(); mi != mapCommands.end(); ++mi) + vCommands.push_back(make_pair(mi->second->category + mi->first, mi->second)); + sort(vCommands.begin(), vCommands.end()); + + BOOST_FOREACH(const PAIRTYPE(string, const CRPCCommand*)& command, vCommands) { - const CRPCCommand *pcmd = mi->second; - string strMethod = mi->first; + const CRPCCommand *pcmd = command.second; + string strMethod = pcmd->name; // We already filter duplicates, but these deprecated screw up the sort order if (strMethod.find("label") != string::npos) continue; @@ -162,8 +169,20 @@ string CRPCTable::help(string strCommand) const // Help text is returned in an exception string strHelp = string(e.what()); if (strCommand == "") + { if (strHelp.find('\n') != string::npos) strHelp = strHelp.substr(0, strHelp.find('\n')); + + if (category != pcmd->category) + { + if (!category.empty()) + strRet += "\n"; + category = pcmd->category; + string firstLetter = category.substr(0,1); + boost::to_upper(firstLetter); + strRet += "== " + firstLetter + category.substr(1) + " ==\n"; + } + } strRet += strHelp + "\n"; } } @@ -213,103 +232,105 @@ Value stop(const Array& params, bool fHelp) static const CRPCCommand vRPCCommands[] = -{ // name actor (function) okSafeMode threadSafe reqWallet - // ------------------------ ----------------------- ---------- ---------- --------- +{ // category name actor (function) okSafeMode threadSafe reqWallet + // --------------------- ------------------------ ----------------------- ---------- ---------- --------- /* Overall control/query calls */ - { "getinfo", &getinfo, true, false, false }, /* uses wallet if enabled */ - { "help", &help, true, true, false }, - { "stop", &stop, true, true, false }, + { "control", "getinfo", &getinfo, true, false, false }, /* uses wallet if enabled */ + { "control", "help", &help, true, true, false }, + { "control", "stop", &stop, true, true, false }, /* P2P networking */ - { "getnetworkinfo", &getnetworkinfo, true, false, false }, - { "addnode", &addnode, true, true, false }, - { "getaddednodeinfo", &getaddednodeinfo, true, true, false }, - { "getconnectioncount", &getconnectioncount, true, false, false }, - { "getnettotals", &getnettotals, true, true, false }, - { "getpeerinfo", &getpeerinfo, true, false, false }, - { "ping", &ping, true, false, false }, + { "network", "getnetworkinfo", &getnetworkinfo, true, false, false }, + { "network", "addnode", &addnode, true, true, false }, + { "network", "getaddednodeinfo", &getaddednodeinfo, true, true, false }, + { "network", "getconnectioncount", &getconnectioncount, true, false, false }, + { "network", "getnettotals", &getnettotals, true, true, false }, + { "network", "getpeerinfo", &getpeerinfo, true, false, false }, + { "network", "ping", &ping, true, false, false }, /* Block chain and UTXO */ - { "getblockchaininfo", &getblockchaininfo, true, false, false }, - { "getbestblockhash", &getbestblockhash, true, false, false }, - { "getblockcount", &getblockcount, true, false, false }, - { "getblock", &getblock, true, false, false }, - { "getblockhash", &getblockhash, true, false, false }, - { "getchaintips", &getchaintips, true, false, false }, - { "getdifficulty", &getdifficulty, true, false, false }, - { "getrawmempool", &getrawmempool, true, false, false }, - { "gettxout", &gettxout, true, false, false }, - { "gettxoutsetinfo", &gettxoutsetinfo, true, false, false }, - { "verifychain", &verifychain, true, false, false }, + { "blockchain", "getblockchaininfo", &getblockchaininfo, true, false, false }, + { "blockchain", "getbestblockhash", &getbestblockhash, true, false, false }, + { "blockchain", "getblockcount", &getblockcount, true, false, false }, + { "blockchain", "getblock", &getblock, true, false, false }, + { "blockchain", "getblockhash", &getblockhash, true, false, false }, + { "blockchain", "getchaintips", &getchaintips, true, false, false }, + { "blockchain", "getdifficulty", &getdifficulty, true, false, false }, + { "blockchain", "getrawmempool", &getrawmempool, true, false, false }, + { "blockchain", "gettxout", &gettxout, true, false, false }, + { "blockchain", "gettxoutsetinfo", &gettxoutsetinfo, true, false, false }, + { "blockchain", "verifychain", &verifychain, true, false, false }, /* Mining */ - { "getblocktemplate", &getblocktemplate, true, false, false }, - { "getmininginfo", &getmininginfo, true, false, false }, - { "getnetworkhashps", &getnetworkhashps, true, false, false }, - { "prioritisetransaction", &prioritisetransaction, true, false, false }, - { "submitblock", &submitblock, true, true, false }, + { "mining", "getblocktemplate", &getblocktemplate, true, false, false }, + { "mining", "getmininginfo", &getmininginfo, true, false, false }, + { "mining", "getnetworkhashps", &getnetworkhashps, true, false, false }, + { "mining", "prioritisetransaction", &prioritisetransaction, true, false, false }, + { "mining", "submitblock", &submitblock, true, true, false }, + +#ifdef ENABLE_WALLET + /* Coin generation */ + { "generating", "getgenerate", &getgenerate, true, false, false }, + { "generating", "gethashespersec", &gethashespersec, true, false, false }, + { "generating", "setgenerate", &setgenerate, true, true, false }, +#endif /* Raw transactions */ - { "createrawtransaction", &createrawtransaction, true, false, false }, - { "decoderawtransaction", &decoderawtransaction, true, false, false }, - { "decodescript", &decodescript, true, false, false }, - { "getrawtransaction", &getrawtransaction, true, false, false }, - { "sendrawtransaction", &sendrawtransaction, false, false, false }, - { "signrawtransaction", &signrawtransaction, false, false, false }, /* uses wallet if enabled */ + { "rawtransactions", "createrawtransaction", &createrawtransaction, true, false, false }, + { "rawtransactions", "decoderawtransaction", &decoderawtransaction, true, false, false }, + { "rawtransactions", "decodescript", &decodescript, true, false, false }, + { "rawtransactions", "getrawtransaction", &getrawtransaction, true, false, false }, + { "rawtransactions", "sendrawtransaction", &sendrawtransaction, false, false, false }, + { "rawtransactions", "signrawtransaction", &signrawtransaction, false, false, false }, /* uses wallet if enabled */ /* Utility functions */ - { "createmultisig", &createmultisig, true, true , false }, - { "validateaddress", &validateaddress, true, false, false }, /* uses wallet if enabled */ - { "verifymessage", &verifymessage, true, false, false }, - { "estimatefee", &estimatefee, true, true, false }, - { "estimatepriority", &estimatepriority, true, true, false }, + { "util", "createmultisig", &createmultisig, true, true , false }, + { "util", "validateaddress", &validateaddress, true, false, false }, /* uses wallet if enabled */ + { "util", "verifymessage", &verifymessage, true, false, false }, + { "util", "estimatefee", &estimatefee, true, true, false }, + { "util", "estimatepriority", &estimatepriority, true, true, false }, #ifdef ENABLE_WALLET /* Wallet */ - { "addmultisigaddress", &addmultisigaddress, true, false, true }, - { "backupwallet", &backupwallet, true, false, true }, - { "dumpprivkey", &dumpprivkey, true, false, true }, - { "dumpwallet", &dumpwallet, true, false, true }, - { "encryptwallet", &encryptwallet, true, false, true }, - { "getaccountaddress", &getaccountaddress, true, false, true }, - { "getaccount", &getaccount, true, false, true }, - { "getaddressesbyaccount", &getaddressesbyaccount, true, false, true }, - { "getbalance", &getbalance, false, false, true }, - { "getnewaddress", &getnewaddress, true, false, true }, - { "getrawchangeaddress", &getrawchangeaddress, true, false, true }, - { "getreceivedbyaccount", &getreceivedbyaccount, false, false, true }, - { "getreceivedbyaddress", &getreceivedbyaddress, false, false, true }, - { "gettransaction", &gettransaction, false, false, true }, - { "getunconfirmedbalance", &getunconfirmedbalance, false, false, true }, - { "getwalletinfo", &getwalletinfo, false, false, true }, - { "importprivkey", &importprivkey, true, false, true }, - { "importwallet", &importwallet, true, false, true }, - { "importaddress", &importaddress, true, false, true }, - { "keypoolrefill", &keypoolrefill, true, false, true }, - { "listaccounts", &listaccounts, false, false, true }, - { "listaddressgroupings", &listaddressgroupings, false, false, true }, - { "listlockunspent", &listlockunspent, false, false, true }, - { "listreceivedbyaccount", &listreceivedbyaccount, false, false, true }, - { "listreceivedbyaddress", &listreceivedbyaddress, false, false, true }, - { "listsinceblock", &listsinceblock, false, false, true }, - { "listtransactions", &listtransactions, false, false, true }, - { "listunspent", &listunspent, false, false, true }, - { "lockunspent", &lockunspent, true, false, true }, - { "move", &movecmd, false, false, true }, - { "sendfrom", &sendfrom, false, false, true }, - { "sendmany", &sendmany, false, false, true }, - { "sendtoaddress", &sendtoaddress, false, false, true }, - { "setaccount", &setaccount, true, false, true }, - { "settxfee", &settxfee, true, false, true }, - { "signmessage", &signmessage, true, false, true }, - { "walletlock", &walletlock, true, false, true }, - { "walletpassphrasechange", &walletpassphrasechange, true, false, true }, - { "walletpassphrase", &walletpassphrase, true, false, true }, - - /* Wallet-enabled mining */ - { "getgenerate", &getgenerate, true, false, false }, - { "gethashespersec", &gethashespersec, true, false, false }, - { "setgenerate", &setgenerate, true, true, false }, + { "wallet", "addmultisigaddress", &addmultisigaddress, true, false, true }, + { "wallet", "backupwallet", &backupwallet, true, false, true }, + { "wallet", "dumpprivkey", &dumpprivkey, true, false, true }, + { "wallet", "dumpwallet", &dumpwallet, true, false, true }, + { "wallet", "encryptwallet", &encryptwallet, true, false, true }, + { "wallet", "getaccountaddress", &getaccountaddress, true, false, true }, + { "wallet", "getaccount", &getaccount, true, false, true }, + { "wallet", "getaddressesbyaccount", &getaddressesbyaccount, true, false, true }, + { "wallet", "getbalance", &getbalance, false, false, true }, + { "wallet", "getnewaddress", &getnewaddress, true, false, true }, + { "wallet", "getrawchangeaddress", &getrawchangeaddress, true, false, true }, + { "wallet", "getreceivedbyaccount", &getreceivedbyaccount, false, false, true }, + { "wallet", "getreceivedbyaddress", &getreceivedbyaddress, false, false, true }, + { "wallet", "gettransaction", &gettransaction, false, false, true }, + { "wallet", "getunconfirmedbalance", &getunconfirmedbalance, false, false, true }, + { "wallet", "getwalletinfo", &getwalletinfo, false, false, true }, + { "wallet", "importprivkey", &importprivkey, true, false, true }, + { "wallet", "importwallet", &importwallet, true, false, true }, + { "wallet", "importaddress", &importaddress, true, false, true }, + { "wallet", "keypoolrefill", &keypoolrefill, true, false, true }, + { "wallet", "listaccounts", &listaccounts, false, false, true }, + { "wallet", "listaddressgroupings", &listaddressgroupings, false, false, true }, + { "wallet", "listlockunspent", &listlockunspent, false, false, true }, + { "wallet", "listreceivedbyaccount", &listreceivedbyaccount, false, false, true }, + { "wallet", "listreceivedbyaddress", &listreceivedbyaddress, false, false, true }, + { "wallet", "listsinceblock", &listsinceblock, false, false, true }, + { "wallet", "listtransactions", &listtransactions, false, false, true }, + { "wallet", "listunspent", &listunspent, false, false, true }, + { "wallet", "lockunspent", &lockunspent, true, false, true }, + { "wallet", "move", &movecmd, false, false, true }, + { "wallet", "sendfrom", &sendfrom, false, false, true }, + { "wallet", "sendmany", &sendmany, false, false, true }, + { "wallet", "sendtoaddress", &sendtoaddress, false, false, true }, + { "wallet", "setaccount", &setaccount, true, false, true }, + { "wallet", "settxfee", &settxfee, true, false, true }, + { "wallet", "signmessage", &signmessage, true, false, true }, + { "wallet", "walletlock", &walletlock, true, false, true }, + { "wallet", "walletpassphrasechange", &walletpassphrasechange, true, false, true }, + { "wallet", "walletpassphrase", &walletpassphrase, true, false, true }, #endif // ENABLE_WALLET }; diff --git a/src/rpcserver.h b/src/rpcserver.h index 176852ca8f..2248e8aeb2 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -71,6 +71,7 @@ typedef json_spirit::Value(*rpcfn_type)(const json_spirit::Array& params, bool f class CRPCCommand { public: + std::string category; std::string name; rpcfn_type actor; bool okSafeMode; From 939ed97373fdea0e8ecb173f1c22eb53b9f90bb6 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sat, 26 Jul 2014 21:05:11 +0200 Subject: [PATCH 0514/1288] Add boolean HaveWatchonly and signal NotifyWatchonlyChanged --- src/keystore.cpp | 6 ++++++ src/keystore.h | 2 ++ src/qt/overviewpage.cpp | 24 +++++++++++++++++------- src/qt/overviewpage.h | 1 + src/qt/walletmodel.cpp | 32 +++++++++++++++++++++++++++++--- src/qt/walletmodel.h | 7 +++++++ src/wallet.cpp | 1 + src/wallet.h | 3 +++ 8 files changed, 66 insertions(+), 10 deletions(-) diff --git a/src/keystore.cpp b/src/keystore.cpp index 2a4c88d565..81b7b076fa 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -71,3 +71,9 @@ bool CBasicKeyStore::HaveWatchOnly(const CScript &dest) const LOCK(cs_KeyStore); return setWatchOnly.count(dest) > 0; } + +bool CBasicKeyStore::HaveWatchOnly() const +{ + LOCK(cs_KeyStore); + return (!setWatchOnly.empty()); +} diff --git a/src/keystore.h b/src/keystore.h index 72411a1387..f10e24f36c 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -50,6 +50,7 @@ public: // Support for Watch-only addresses virtual bool AddWatchOnly(const CScript &dest) =0; virtual bool HaveWatchOnly(const CScript &dest) const =0; + virtual bool HaveWatchOnly() const =0; }; typedef std::map KeyMap; @@ -107,6 +108,7 @@ public: virtual bool AddWatchOnly(const CScript &dest); virtual bool HaveWatchOnly(const CScript &dest) const; + virtual bool HaveWatchOnly() const; }; typedef std::vector > CKeyingMaterial; diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index b5a3de48ca..8eed0856e7 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -160,18 +160,25 @@ void OverviewPage::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 // for the non-mining users bool showImmature = immatureBalance != 0; bool showWatchOnlyImmature = watchImmatureBalance != 0; - bool showWatchOnly = (watchOnlyBalance != 0 || watchUnconfBalance != 0 || showWatchOnlyImmature); // for symmetry reasons also show immature label when the watch-only one is shown ui->labelImmature->setVisible(showImmature || showWatchOnlyImmature); ui->labelImmatureText->setVisible(showImmature || showWatchOnlyImmature); - ui->labelSpendable->setVisible(showWatchOnly); // show spendable label (only when watch-only is active) - ui->labelWatchonly->setVisible(showWatchOnly); // show watch-only label - ui->lineWatchBalance->setVisible(showWatchOnly); // show watch-only balance separator line - ui->labelWatchAvailable->setVisible(showWatchOnly); // show watch-only available balance ui->labelWatchImmature->setVisible(showWatchOnlyImmature); // show watch-only immature balance - ui->labelWatchPending->setVisible(showWatchOnly); // show watch-only pending balance - ui->labelWatchTotal->setVisible(showWatchOnly); // show watch-only total balance +} + +// show/hide watch-only labels +void OverviewPage::updateWatchOnlyLabels(bool showWatchOnly) +{ + ui->labelSpendable->setVisible(showWatchOnly); // show spendable label (only when watch-only is active) + ui->labelWatchonly->setVisible(showWatchOnly); // show watch-only label + ui->lineWatchBalance->setVisible(showWatchOnly); // show watch-only balance separator line + ui->labelWatchAvailable->setVisible(showWatchOnly); // show watch-only available balance + ui->labelWatchPending->setVisible(showWatchOnly); // show watch-only pending balance + ui->labelWatchTotal->setVisible(showWatchOnly); // show watch-only total balance + + if (!showWatchOnly) + ui->labelWatchImmature->hide(); } void OverviewPage::setClientModel(ClientModel *model) @@ -208,6 +215,9 @@ void OverviewPage::setWalletModel(WalletModel *model) connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64, qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64, qint64, qint64, qint64))); connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); + + updateWatchOnlyLabels(model->haveWatchOnly()); + connect(model, SIGNAL(notifyWatchonlyChanged(bool)), this, SLOT(updateWatchOnlyLabels(bool))); } // update the display unit, to not use the default ("BTC") diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h index fe00106770..f46374efba 100644 --- a/src/qt/overviewpage.h +++ b/src/qt/overviewpage.h @@ -58,6 +58,7 @@ private slots: void updateDisplayUnit(); void handleTransactionClicked(const QModelIndex &index); void updateAlerts(const QString &warnings); + void updateWatchOnlyLabels(bool showWatchOnly); }; #endif // OVERVIEWPAGE_H diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 0ad123f39d..30c9ecc96b 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -36,6 +36,7 @@ WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *p cachedNumBlocks(0) { fProcessingQueuedTransactions = false; + fHaveWatchOnly = wallet->HaveWatchOnly(); addressTableModel = new AddressTableModel(wallet, this); transactionTableModel = new TransactionTableModel(wallet, this); @@ -81,6 +82,11 @@ qint64 WalletModel::getImmatureBalance() const return wallet->GetImmatureBalance(); } +bool WalletModel::haveWatchOnly() const +{ + return fHaveWatchOnly; +} + qint64 WalletModel::getWatchBalance() const { return wallet->GetWatchOnlyBalance(); @@ -144,9 +150,15 @@ void WalletModel::checkBalanceChanged() qint64 newBalance = getBalance(); qint64 newUnconfirmedBalance = getUnconfirmedBalance(); qint64 newImmatureBalance = getImmatureBalance(); - qint64 newWatchOnlyBalance = getWatchBalance(); - qint64 newWatchUnconfBalance = getWatchUnconfirmedBalance(); - qint64 newWatchImmatureBalance = getWatchImmatureBalance(); + qint64 newWatchOnlyBalance = 0; + qint64 newWatchUnconfBalance = 0; + qint64 newWatchImmatureBalance = 0; + if (haveWatchOnly()) + { + newWatchOnlyBalance = getWatchBalance(); + newWatchUnconfBalance = getWatchUnconfirmedBalance(); + newWatchImmatureBalance = getWatchImmatureBalance(); + } if(cachedBalance != newBalance || cachedUnconfirmedBalance != newUnconfirmedBalance || cachedImmatureBalance != newImmatureBalance || cachedWatchOnlyBalance != newWatchOnlyBalance || cachedWatchUnconfBalance != newWatchUnconfBalance || cachedWatchImmatureBalance != newWatchImmatureBalance) @@ -185,6 +197,12 @@ void WalletModel::updateAddressBook(const QString &address, const QString &label addressTableModel->updateEntry(address, label, isMine, purpose, status); } +void WalletModel::updateWatchOnlyFlag(bool fHaveWatchonly) +{ + fHaveWatchOnly = fHaveWatchonly; + emit notifyWatchonlyChanged(fHaveWatchonly); +} + bool WalletModel::validateAddress(const QString &address) { CBitcoinAddress addressParsed(address.toStdString()); @@ -499,6 +517,12 @@ static void ShowProgress(WalletModel *walletmodel, const std::string &title, int } } +static void NotifyWatchonlyChanged(WalletModel *walletmodel, bool fHaveWatchonly) +{ + QMetaObject::invokeMethod(walletmodel, "updateWatchOnlyFlag", Qt::QueuedConnection, + Q_ARG(bool, fHaveWatchonly)); +} + void WalletModel::subscribeToCoreSignals() { // Connect signals to wallet @@ -506,6 +530,7 @@ void WalletModel::subscribeToCoreSignals() wallet->NotifyAddressBookChanged.connect(boost::bind(NotifyAddressBookChanged, this, _1, _2, _3, _4, _5, _6)); wallet->NotifyTransactionChanged.connect(boost::bind(NotifyTransactionChanged, this, _1, _2, _3)); wallet->ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2)); + wallet->NotifyWatchonlyChanged.connect(boost::bind(NotifyWatchonlyChanged, this, _1)); } void WalletModel::unsubscribeFromCoreSignals() @@ -515,6 +540,7 @@ void WalletModel::unsubscribeFromCoreSignals() wallet->NotifyAddressBookChanged.disconnect(boost::bind(NotifyAddressBookChanged, this, _1, _2, _3, _4, _5, _6)); wallet->NotifyTransactionChanged.disconnect(boost::bind(NotifyTransactionChanged, this, _1, _2, _3)); wallet->ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2)); + wallet->NotifyWatchonlyChanged.disconnect(boost::bind(NotifyWatchonlyChanged, this, _1)); } // WalletModel::UnlockContext implementation diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 2bb91d85a9..1dad716061 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -128,6 +128,7 @@ public: qint64 getBalance(const CCoinControl *coinControl = NULL) const; qint64 getUnconfirmedBalance() const; qint64 getImmatureBalance() const; + bool haveWatchOnly() const; qint64 getWatchBalance() const; qint64 getWatchUnconfirmedBalance() const; qint64 getWatchImmatureBalance() const; @@ -198,6 +199,7 @@ public: private: CWallet *wallet; bool fProcessingQueuedTransactions; + bool fHaveWatchOnly; // Wallet has an options model for wallet-specific options // (transaction fee, for example) @@ -249,6 +251,9 @@ signals: // Show progress dialog e.g. for rescan void showProgress(const QString &title, int nProgress); + // Watch-only address added + void notifyWatchonlyChanged(bool fHaveWatchonly); + public slots: /* Wallet status might have changed */ void updateStatus(); @@ -256,6 +261,8 @@ public slots: void updateTransaction(const QString &hash, int status); /* New, updated or removed address book entry */ void updateAddressBook(const QString &address, const QString &label, bool isMine, const QString &purpose, int status); + /* Watchonly added */ + void updateWatchOnlyFlag(bool fHaveWatchonly); /* Current, immature or unconfirmed balance might have changed - emit 'balanceChanged' if so */ void pollBalanceChanged(); /* Needed to update fProcessingQueuedTransactions through a QueuedConnection */ diff --git a/src/wallet.cpp b/src/wallet.cpp index 7c04743c0f..a293664f6d 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -153,6 +153,7 @@ bool CWallet::AddWatchOnly(const CScript &dest) if (!CCryptoKeyStore::AddWatchOnly(dest)) return false; nTimeFirstKey = 1; // No birthday information for watch-only keys. + NotifyWatchonlyChanged(true); if (!fFileBacked) return true; return CWalletDB(strWalletFile).WriteWatchOnly(dest); diff --git a/src/wallet.h b/src/wallet.h index 73fcfa24e0..1f727aec0b 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -408,6 +408,9 @@ public: /** Show progress e.g. for rescan */ boost::signals2::signal ShowProgress; + + /** Watch-only address added */ + boost::signals2::signal NotifyWatchonlyChanged; }; /** A key allocated from the key pool. */ From 1c5f0af0fd8b5630470d471d8319a7c979aa2587 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 10 Aug 2014 02:26:04 +0200 Subject: [PATCH 0515/1288] [Qt] Add column Watch-only to transactions list --- src/Makefile.qt.include | 3 +++ src/qt/bitcoin.qrc | 3 +++ src/qt/overviewpage.cpp | 10 +++++++++- src/qt/res/icons/eye.png | Bin 0 -> 536 bytes src/qt/res/icons/eye_minus.png | Bin 0 -> 595 bytes src/qt/res/icons/eye_plus.png | Bin 0 -> 661 bytes src/qt/transactionfilterproxy.cpp | 12 +++++++++++ src/qt/transactionfilterproxy.h | 9 +++++++++ src/qt/transactiontablemodel.cpp | 32 ++++++++++++++++++++++-------- src/qt/transactiontablemodel.h | 14 +++++++++---- src/qt/transactionview.cpp | 32 ++++++++++++++++++++++++++++++ src/qt/transactionview.h | 4 ++++ 12 files changed, 106 insertions(+), 13 deletions(-) create mode 100644 src/qt/res/icons/eye.png create mode 100644 src/qt/res/icons/eye_minus.png create mode 100644 src/qt/res/icons/eye_plus.png diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 2052264dc9..eef0c317c6 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -233,6 +233,9 @@ RES_ICONS = \ qt/res/icons/editcopy.png \ qt/res/icons/editpaste.png \ qt/res/icons/export.png \ + qt/res/icons/eye.png \ + qt/res/icons/eye_minus.png \ + qt/res/icons/eye_plus.png \ qt/res/icons/filesave.png \ qt/res/icons/history.png \ qt/res/icons/key.png \ diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index 357c6470d3..9a7003938b 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -18,6 +18,9 @@ res/icons/clock3.png res/icons/clock4.png res/icons/clock5.png + res/icons/eye.png + res/icons/eye_minus.png + res/icons/eye_plus.png res/icons/configure.png res/icons/receive.png res/icons/editpaste.png diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 8eed0856e7..15501b8a8a 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -57,7 +57,15 @@ public: } painter->setPen(foreground); - painter->drawText(addressRect, Qt::AlignLeft|Qt::AlignVCenter, address); + QRect boundingRect; + painter->drawText(addressRect, Qt::AlignLeft|Qt::AlignVCenter, address, &boundingRect); + + if (index.data(TransactionTableModel::WatchonlyRole).toBool()) + { + QIcon iconWatchonly = qvariant_cast(index.data(TransactionTableModel::WatchonlyDecorationRole)); + QRect watchonlyRect(boundingRect.right() + 5, mainRect.top()+ypad+halfheight, 16, halfheight); + iconWatchonly.paint(painter, watchonlyRect); + } if(amount < 0) { diff --git a/src/qt/res/icons/eye.png b/src/qt/res/icons/eye.png new file mode 100644 index 0000000000000000000000000000000000000000..c4d182adbf4ed1140b7c715517e07802758ddeb5 GIT binary patch literal 536 zcmV+z0_XjSP)W;VR5&6(dO?x@e&|q%ht7 zGdR6~s}6iHbMN{8bI!dp0_U795)QUtENmbktcUq1YhWKJAOw8#yf2`G8h8RDTW1>x zFgSI)-DirTY~^w}zou!cjYh*oo3bp=B9X|XR4NT?wc7i1IxRwXM|Eig4>(UG5*PJ) zU9MCr+oox*2Lb`tWMVJ^A{VXE9_3IjX)LYN=}e>Q<6tnD8iv6MRaH4fv3Sj8`G70R z2}f7l-ltsBkah_!*<>>5L;J4TY-Y_>C=^iHWS5s$)_XV{WuKpK%-*M5(x6b53~pMj z*7|5P+V&tQL6Rh<&*$^^IE!1l6#;YDSCK>m$LVxBn#p9MyAos(@~e-|qt0(OBPc<1Y5Fa$3^1BU(W2><_ISlHlK afB^v9dC^iz-u#^a0000)U=I<(!Y-aX7<9>mi9o?H_F_AoLP-|H z4jl}~6vtoR_rvL6#}518BhI|{{l53}_jCy%=zqd>^#%y}Wnpw3+ygoY1OKA#C+L70 z_y~rM&N1Lg9xICSRM++GY&N@Tn&!1eqv7SGrfJh?G&(AkNcG_r_+$jk3I$2DBb8maYoJZW_OFc=IbmSqXXFbu&_ zES?BWI}p15NMI`AB+ zCf4iqZnfL(b?z9C$A1Nb!G5`1zNl8K7vb^v{T(4bJ(L`rG;P|h%(7N? zksjJjCUg*CEp!mX6%78ugHYL_SD6<<@ZcXH^f1|F6N?lSu~1OyVK)nzLJP&RAmY-) zDt2N!snUU!#|yklGG1}!`*B)`?XLgeCYLh z8Pu&(UmHGL$gOBJdZ$<{O8I<#$~4WfKp-G=yE+gk5@?KaR716-v9vtTpU19ityZh2 z>pCM8MPU?~%p)dAb4->mGn^G0=Bbu6q_v~Vd@L68;q--mzi+K8l}ce}6INEz*7wB3 zG&CAj80M*#G}vgK44zafm9b8zGv&gdf?zNRic*Hz*>je_<#K|<5&Uhii-DR?q~&ck z+n0L1J}8&VW+W0h?)7>{alN2v?;#Wt!Rz&5cMan4Gmti(!rjfKz2%qb&)Va+_vuu~ zz{DNhXf~VMxm@mhtyXJ`qR6}54xw6oBedIFAd2B1e!qX~UgLrN;)P3|Vx#;GY;a?6 z+hcIJ5imScj1eS^oJPixQ5rNC+%h}K`$6FJL?UtO`RWUG|MGx(*x-*~lRTI=-RpB# z<1>eIukveuH!v1QsMABlGMK(5&TKq;w?6|8RQr)GJc9)=@T%{z^&Jy$_0Iu-gNuNj v1N)Kxnid|R!PM==O+cYaVmRT1UjhsOT9g3B;L;7y00000NkvXXu0mjfDrh(C literal 0 HcmV?d00001 diff --git a/src/qt/transactionfilterproxy.cpp b/src/qt/transactionfilterproxy.cpp index f9546fddb5..6ab029173b 100644 --- a/src/qt/transactionfilterproxy.cpp +++ b/src/qt/transactionfilterproxy.cpp @@ -22,6 +22,7 @@ TransactionFilterProxy::TransactionFilterProxy(QObject *parent) : dateTo(MAX_DATE), addrPrefix(), typeFilter(ALL_TYPES), + watchOnlyFilter(WatchOnlyFilter_All), minAmount(0), limitRows(-1), showInactive(true) @@ -34,6 +35,7 @@ bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex & int type = index.data(TransactionTableModel::TypeRole).toInt(); QDateTime datetime = index.data(TransactionTableModel::DateRole).toDateTime(); + bool involvesWatchAddress = index.data(TransactionTableModel::WatchonlyRole).toBool(); QString address = index.data(TransactionTableModel::AddressRole).toString(); QString label = index.data(TransactionTableModel::LabelRole).toString(); qint64 amount = llabs(index.data(TransactionTableModel::AmountRole).toLongLong()); @@ -43,6 +45,10 @@ bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex & return false; if(!(TYPE(type) & typeFilter)) return false; + if (involvesWatchAddress && watchOnlyFilter == WatchOnlyFilter_No) + return false; + if (!involvesWatchAddress && watchOnlyFilter == WatchOnlyFilter_Yes) + return false; if(datetime < dateFrom || datetime > dateTo) return false; if (!address.contains(addrPrefix, Qt::CaseInsensitive) && !label.contains(addrPrefix, Qt::CaseInsensitive)) @@ -78,6 +84,12 @@ void TransactionFilterProxy::setMinAmount(qint64 minimum) invalidateFilter(); } +void TransactionFilterProxy::setWatchOnlyFilter(WatchOnlyFilter filter) +{ + this->watchOnlyFilter = filter; + invalidateFilter(); +} + void TransactionFilterProxy::setLimit(int limit) { this->limitRows = limit; diff --git a/src/qt/transactionfilterproxy.h b/src/qt/transactionfilterproxy.h index 9919bc3fd6..f408317b53 100644 --- a/src/qt/transactionfilterproxy.h +++ b/src/qt/transactionfilterproxy.h @@ -25,6 +25,13 @@ public: static quint32 TYPE(int type) { return 1<getOptionsModel()->getDisplayUnit()); + columns << QString() << QString() << tr("Date") << tr("Type") << tr("Address") << BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit()); priv->refreshWallet(); connect(walletModel->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); @@ -393,22 +394,19 @@ QVariant TransactionTableModel::txAddressDecoration(const TransactionRecord *wtx QString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const { - // mark transactions involving watch-only addresses: - QString watchAddress = wtx->involvesWatchAddress ? " (w) " : ""; - switch(wtx->type) { case TransactionRecord::RecvFromOther: - return QString::fromStdString(wtx->address) + watchAddress; + return QString::fromStdString(wtx->address); case TransactionRecord::RecvWithAddress: case TransactionRecord::SendToAddress: case TransactionRecord::Generated: - return lookupAddress(wtx->address, tooltip) + watchAddress; + return lookupAddress(wtx->address, tooltip); case TransactionRecord::SendToOther: - return QString::fromStdString(wtx->address) + watchAddress; + return QString::fromStdString(wtx->address); case TransactionRecord::SendToSelf: default: - return tr("(n/a)") + watchAddress; + return tr("(n/a)"); } } @@ -482,6 +480,14 @@ QVariant TransactionTableModel::txStatusDecoration(const TransactionRecord *wtx) return QColor(0,0,0); } +QVariant TransactionTableModel::txWatchonlyDecoration(const TransactionRecord *wtx) const +{ + if (wtx->involvesWatchAddress) + return QIcon(":/icons/eye"); + else + return QVariant(); +} + QString TransactionTableModel::formatTooltip(const TransactionRecord *rec) const { QString tooltip = formatTxStatus(rec) + QString("\n") + formatTxType(rec); @@ -506,6 +512,8 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const { case Status: return txStatusDecoration(rec); + case Watchonly: + return txWatchonlyDecoration(rec); case ToAddress: return txAddressDecoration(rec); } @@ -533,6 +541,8 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const return rec->time; case Type: return formatTxType(rec); + case Watchonly: + return (rec->involvesWatchAddress ? 1 : 0); case ToAddress: return formatTxToAddress(rec, true); case Amount: @@ -562,6 +572,10 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const return rec->type; case DateRole: return QDateTime::fromTime_t(static_cast(rec->time)); + case WatchonlyRole: + return rec->involvesWatchAddress; + case WatchonlyDecorationRole: + return txWatchonlyDecoration(rec); case LongDescriptionRole: return priv->describe(rec, walletModel->getOptionsModel()->getDisplayUnit()); case AddressRole: @@ -606,6 +620,8 @@ QVariant TransactionTableModel::headerData(int section, Qt::Orientation orientat return tr("Date and time that the transaction was received."); case Type: return tr("Type of transaction."); + case Watchonly: + return tr("Whether or not a watch-only address is involved in this transaction."); case ToAddress: return tr("Destination address of transaction."); case Amount: diff --git a/src/qt/transactiontablemodel.h b/src/qt/transactiontablemodel.h index 2124d3dd1c..413f3f9bf1 100644 --- a/src/qt/transactiontablemodel.h +++ b/src/qt/transactiontablemodel.h @@ -28,10 +28,11 @@ public: enum ColumnIndex { Status = 0, - Date = 1, - Type = 2, - ToAddress = 3, - Amount = 4 + Watchonly = 1, + Date = 2, + Type = 3, + ToAddress = 4, + Amount = 5 }; /** Roles to get specific information from a transaction row. @@ -42,6 +43,10 @@ public: TypeRole = Qt::UserRole, /** Date and time this transaction was created */ DateRole, + /** Watch-only boolean */ + WatchonlyRole, + /** Watch-only icon */ + WatchonlyDecorationRole, /** Long description (HTML format) */ LongDescriptionRole, /** Address of transaction */ @@ -83,6 +88,7 @@ private: QString formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed=true, BitcoinUnits::SeparatorStyle separators=BitcoinUnits::separatorStandard) const; QString formatTooltip(const TransactionRecord *rec) const; QVariant txStatusDecoration(const TransactionRecord *wtx) const; + QVariant txWatchonlyDecoration(const TransactionRecord *wtx) const; QVariant txAddressDecoration(const TransactionRecord *wtx) const; public slots: diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 7e8b71d8ea..2d34d58129 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -51,6 +51,13 @@ TransactionView::TransactionView(QWidget *parent) : hlayout->addSpacing(23); #endif + watchOnlyWidget = new QComboBox(this); + watchOnlyWidget->setFixedWidth(24); + watchOnlyWidget->addItem("", TransactionFilterProxy::WatchOnlyFilter_All); + watchOnlyWidget->addItem(QIcon(":/icons/eye_plus"), "", TransactionFilterProxy::WatchOnlyFilter_Yes); + watchOnlyWidget->addItem(QIcon(":/icons/eye_minus"), "", TransactionFilterProxy::WatchOnlyFilter_No); + hlayout->addWidget(watchOnlyWidget); + dateWidget = new QComboBox(this); #ifdef Q_OS_MAC dateWidget->setFixedWidth(121); @@ -150,6 +157,7 @@ TransactionView::TransactionView(QWidget *parent) : connect(dateWidget, SIGNAL(activated(int)), this, SLOT(chooseDate(int))); connect(typeWidget, SIGNAL(activated(int)), this, SLOT(chooseType(int))); + connect(watchOnlyWidget, SIGNAL(activated(int)), this, SLOT(chooseWatchonly(int))); connect(addressWidget, SIGNAL(textChanged(QString)), this, SLOT(changedPrefix(QString))); connect(amountWidget, SIGNAL(textChanged(QString)), this, SLOT(changedAmount(QString))); @@ -187,6 +195,7 @@ void TransactionView::setModel(WalletModel *model) transactionView->verticalHeader()->hide(); transactionView->setColumnWidth(TransactionTableModel::Status, STATUS_COLUMN_WIDTH); + transactionView->setColumnWidth(TransactionTableModel::Watchonly, WATCHONLY_COLUMN_WIDTH); transactionView->setColumnWidth(TransactionTableModel::Date, DATE_COLUMN_WIDTH); transactionView->setColumnWidth(TransactionTableModel::Type, TYPE_COLUMN_WIDTH); transactionView->setColumnWidth(TransactionTableModel::Amount, AMOUNT_MINIMUM_COLUMN_WIDTH); @@ -211,6 +220,12 @@ void TransactionView::setModel(WalletModel *model) } } } + + // show/hide column Watch-only + updateWatchOnlyColumn(model->haveWatchOnly()); + + // Watch-only signal + connect(model, SIGNAL(notifyWatchonlyChanged(bool)), this, SLOT(updateWatchOnlyColumn(bool))); } } @@ -270,6 +285,14 @@ void TransactionView::chooseType(int idx) typeWidget->itemData(idx).toInt()); } +void TransactionView::chooseWatchonly(int idx) +{ + if(!transactionProxyModel) + return; + transactionProxyModel->setWatchOnlyFilter( + (TransactionFilterProxy::WatchOnlyFilter)watchOnlyWidget->itemData(idx).toInt()); +} + void TransactionView::changedPrefix(const QString &prefix) { if(!transactionProxyModel) @@ -307,6 +330,8 @@ void TransactionView::exportClicked() // name, column, role writer.setModel(transactionProxyModel); writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole); + if (model && model->haveWatchOnly()) + writer.addColumn(tr("Watchonly"), TransactionTableModel::Watchonly); writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole); writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole); writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole); @@ -501,3 +526,10 @@ bool TransactionView::eventFilter(QObject *obj, QEvent *event) } return QWidget::eventFilter(obj, event); } + +// show/hide column Watch-only +void TransactionView::updateWatchOnlyColumn(bool fHaveWatchOnly) +{ + watchOnlyWidget->setVisible(fHaveWatchOnly); + transactionView->setColumnHidden(TransactionTableModel::Watchonly, !fHaveWatchOnly); +} diff --git a/src/qt/transactionview.h b/src/qt/transactionview.h index 618efbc565..b249e00411 100644 --- a/src/qt/transactionview.h +++ b/src/qt/transactionview.h @@ -50,6 +50,7 @@ public: enum ColumnWidths { STATUS_COLUMN_WIDTH = 23, + WATCHONLY_COLUMN_WIDTH = 23, DATE_COLUMN_WIDTH = 120, TYPE_COLUMN_WIDTH = 120, AMOUNT_MINIMUM_COLUMN_WIDTH = 120, @@ -63,6 +64,7 @@ private: QComboBox *dateWidget; QComboBox *typeWidget; + QComboBox *watchOnlyWidget; QLineEdit *addressWidget; QLineEdit *amountWidget; @@ -91,6 +93,7 @@ private slots: void copyAmount(); void copyTxID(); void openThirdPartyTxUrl(QString url); + void updateWatchOnlyColumn(bool fHaveWatchOnly); signals: void doubleClicked(const QModelIndex&); @@ -101,6 +104,7 @@ signals: public slots: void chooseDate(int idx); void chooseType(int idx); + void chooseWatchonly(int idx); void changedPrefix(const QString &prefix); void changedAmount(const QString &amount); void exportClicked(); From 54e658f249f8b2a2cbf7dbe2bab9749faa91c611 Mon Sep 17 00:00:00 2001 From: jtimon Date: Tue, 12 Aug 2014 00:13:45 +0200 Subject: [PATCH 0516/1288] Remove unused CKeyStoreIsMineVisitor --- src/script.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/script.cpp b/src/script.cpp index 39ae001db8..942e8810db 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1444,18 +1444,6 @@ unsigned int HaveKeys(const vector& pubkeys, const CKeyStore& keystore) return nResult; } - -class CKeyStoreIsMineVisitor : public boost::static_visitor -{ -private: - const CKeyStore *keystore; -public: - CKeyStoreIsMineVisitor(const CKeyStore *keystoreIn) : keystore(keystoreIn) { } - bool operator()(const CNoDestination &dest) const { return false; } - bool operator()(const CKeyID &keyID) const { return keystore->HaveKey(keyID); } - bool operator()(const CScriptID &scriptID) const { return keystore->HaveCScript(scriptID); } -}; - isminetype IsMine(const CKeyStore &keystore, const CTxDestination& dest) { CScript script; From a381ee5d1c1c01c66e681e245f60f2de2b79b264 Mon Sep 17 00:00:00 2001 From: jtimon Date: Mon, 11 Aug 2014 20:49:22 +0200 Subject: [PATCH 0517/1288] Remove unnecessary typedef and script.h include --- src/keystore.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/keystore.h b/src/keystore.h index 72411a1387..6a3a0dc13e 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -8,21 +8,12 @@ #include "key.h" #include "sync.h" -#include "script.h" // for CNoDestination #include #include class CScript; -/** A txout script template with a specific destination. It is either: - * * CNoDestination: no destination set - * * CKeyID: TX_PUBKEYHASH destination - * * CScriptID: TX_SCRIPTHASH destination - * A CTxDestination is the internal data type encoded in a CBitcoinAddress - */ -typedef boost::variant CTxDestination; - /** A virtual base class for key stores */ class CKeyStore { From 76c49c4138dcd30c9237fbb0842df8d2f8209319 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 12 Aug 2014 12:05:03 +0200 Subject: [PATCH 0518/1288] Fix thread name setting Because of a typo, thread names no longer appeared in the overview. This was broken in 51ed9ec. --- src/util.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index d3fa5182f3..93fefbac8a 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -17,7 +17,7 @@ #ifndef WIN32 // for posix_fallocate -#ifdef __linux_ +#ifdef __linux__ #ifdef _POSIX_C_SOURCE #undef _POSIX_C_SOURCE @@ -26,7 +26,7 @@ #define _POSIX_C_SOURCE 200112L #include -#endif +#endif // __linux__ #include #include From 4c61ba40b9fccb197aae4e6443d564a5e2a501a6 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 12 Aug 2014 13:03:56 +0200 Subject: [PATCH 0519/1288] build: check for sys/prctl.h in the proper way Use AC_CHECK_HEADERS to check for the header, and include it only if detected and the subsequent HAVE_SYS_PRCTL_H is set. --- configure.ac | 2 +- src/util.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index ffd05ae4f8..55fc091bc5 100644 --- a/configure.ac +++ b/configure.ac @@ -378,7 +378,7 @@ if test x$TARGET_OS = xdarwin; then AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"]) fi -AC_CHECK_HEADERS([endian.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h]) +AC_CHECK_HEADERS([endian.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h]) AC_SEARCH_LIBS([getaddrinfo_a], [anl], [AC_DEFINE(HAVE_GETADDRINFO_A, 1, [Define this symbol if you have getaddrinfo_a])]) AC_SEARCH_LIBS([inet_pton], [nsl resolv], [AC_DEFINE(HAVE_INET_PTON, 1, [Define this symbol if you have inet_pton])]) diff --git a/src/util.cpp b/src/util.cpp index 93fefbac8a..ae2145a3a0 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -3,6 +3,10 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#if defined(HAVE_CONFIG_H) +#include "config/bitcoin-config.h" +#endif + #include "util.h" #include "chainparamsbase.h" @@ -24,7 +28,6 @@ #endif #define _POSIX_C_SOURCE 200112L -#include #endif // __linux__ @@ -61,6 +64,10 @@ #include #endif +#ifdef HAVE_SYS_PRCTL_H +#include +#endif + #include // for to_lower() #include #include // for startswith() and endswith() From 8bfdc9acaadea086d19fabbf838ddd4c9e313a05 Mon Sep 17 00:00:00 2001 From: ntrgn Date: Mon, 11 Aug 2014 18:46:57 +0200 Subject: [PATCH 0520/1288] qt: better looking trayicon Github-Pull: #4678 Rebased-By: Wladimir J. van der Laan --- doc/assets-attribution.md | 1 - src/Makefile.qt.include | 2 -- src/qt/bitcoin.qrc | 2 -- src/qt/bitcoingui.cpp | 4 ++-- src/qt/res/icons/toolbar.png | Bin 815 -> 0 bytes src/qt/res/icons/toolbar_testnet.png | Bin 678 -> 0 bytes 6 files changed, 2 insertions(+), 7 deletions(-) delete mode 100644 src/qt/res/icons/toolbar.png delete mode 100644 src/qt/res/icons/toolbar_testnet.png diff --git a/doc/assets-attribution.md b/doc/assets-attribution.md index 61b457a282..cd864f254d 100644 --- a/doc/assets-attribution.md +++ b/doc/assets-attribution.md @@ -100,5 +100,4 @@ Jonas Schnelli src/qt/res/icons/bitcoin.icns, src/qt/res/src/bitcoin.svg, src/qt/res/src/bitcoin.ico, src/qt/res/src/bitcoin.png, src/qt/res/src/bitcoin_testnet.png, docs/bitcoin_logo_doxygen.png, - src/qt/res/icons/toolbar.png, src/qt/res/icons/toolbar_testnet.png, src/qt/res/images/splash.png, src/qt/res/images/splash_testnet.png diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 2052264dc9..7e6fa5cb88 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -245,8 +245,6 @@ RES_ICONS = \ qt/res/icons/remove.png \ qt/res/icons/send.png \ qt/res/icons/synced.png \ - qt/res/icons/toolbar.png \ - qt/res/icons/toolbar_testnet.png \ qt/res/icons/transaction0.png \ qt/res/icons/transaction2.png \ qt/res/icons/transaction_conflicted.png \ diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index 357c6470d3..6dba62035b 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -4,7 +4,6 @@ res/icons/address-book.png res/icons/quit.png res/icons/send.png - res/icons/toolbar.png res/icons/connect0_16.png res/icons/connect1_16.png res/icons/connect2_16.png @@ -24,7 +23,6 @@ res/icons/editcopy.png res/icons/add.png res/icons/bitcoin_testnet.png - res/icons/toolbar_testnet.png res/icons/edit.png res/icons/history.png res/icons/overview.png diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index e3257e859c..bfca5e8d1a 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -479,12 +479,12 @@ void BitcoinGUI::createTrayIcon(bool fIsTestnet) if (!fIsTestnet) { trayIcon->setToolTip(tr("Bitcoin Core client")); - trayIcon->setIcon(QIcon(":/icons/toolbar")); + trayIcon->setIcon(QIcon(":/icons/bitcoin")); } else { trayIcon->setToolTip(tr("Bitcoin Core client") + " " + tr("[testnet]")); - trayIcon->setIcon(QIcon(":/icons/toolbar_testnet")); + trayIcon->setIcon(QIcon(":/icons/bitcoin_testnet")); } trayIcon->show(); diff --git a/src/qt/res/icons/toolbar.png b/src/qt/res/icons/toolbar.png deleted file mode 100644 index c82d96519c508857f70bf4b8555b9dd46d197272..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 815 zcmV+~1JL}5P)d(T6uv!%s(Cf0wP(>`a)6I8H zCz|*cT4qFm5d~7F0I7zBhD4O)+-=|P5THQC4?OSye7?{3$MYi=BQ7|AO3(+G5_ADc zaoWukv0SnbvdLq7Vl!Hk$I;3GPhx;(ZhY)vOv~l{%9JJL7df%H=uQ$)9}2;)hSwGZ z_ag=1WPv(8&}Q)VT?=`zpxk>s>OQ*S;jyVjnFJgP4CU(HjF)hI(|qK_k7D|_k0*ha zQ1oR}|A(A52PL6{gHS5UP72+ZRQ-1|g0gQN(-{j-#Yc8p&6#jTz-w1R;8j3VFit0K zG7}P8H~IUG7DctAAq=xN2A=XzOxDIuA5W$aNa0*G9iCy-YWuBWZ30ijZKHr{7N74? zor;aC{D@d)gA%UjZ-OHj?us3ltBD7C(_u*`vu|dac46o&cnfz$3L7cdJ^)?`uhgPS zGZn2`t0IiSvLrM`h{-f&o!jB7-v#s>@ubD5_0b`Lq2C5lwv=|VhUQ3}?H!0N;$|$_Q6aHMkO{PsWXjb6W$#-~t6bItSG(u#i#`Fu7 z5fB_9Kso*0K(1C1TQ{!s8_iX9poW2mr|_jn_aWyfeLU-M?E1rTq%JW`VPLmy*<#Du zdBfYp`P@7MRIwP&QFbXrcm5j_WM(vKA(YZUC5gdY{oBT?=4;jyTzZ#vci~jIX#h{tURAs zh-Vk&d3enFP|3pU&`NVkk|?Wz3I?dv_?}wi1;kQVOdC>%ZwIx)p_)LYB+@{cdScKT t*m`caSbMn`$W`i{YJanMQl$H0!e3`9l*5^G{qFz(002ovPDHLkV1k1EfPer1 diff --git a/src/qt/res/icons/toolbar_testnet.png b/src/qt/res/icons/toolbar_testnet.png deleted file mode 100644 index 5995bc06672c9884960f20098441c2afb5dd022c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 678 zcmV;X0$KfuP)E>~n~v+l>!m#L zYVNzJ)wS+H%AciogZ|II<@SHxE$9EUZ`%D|c-#B`k~;xF!y^B-9o6W@s=51&W+%`l zs76LePXYM{7TorDI_rkb7myst@W#DrsD}6zi@PCfuG^`4GQL};Jb9w5Q`tIY zvk6zU(w5&11<8Tb0A1t%-#t^*1FTs@j*SWE%q>8ZK?=Z6}=171P{5ahSLDkj`owoyXN`<^wP+wr9Izf+=!56BBZ?|lZk7UWV; zIK5Ue&xzjz*8m6c3|4*gXu#zq!*~*A4m}ddx12;Yy}zouYA37 zKi>S{nJwlGOf(xo$roe*6h8$f^^G7oqH`rM;8cMzuH{tTlAOHXW M07*qoM6N<$f)V3D;{X5v From 3b72fdfb86b08d80f5f790220137083b56f624d6 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 12 Aug 2014 15:06:20 +0200 Subject: [PATCH 0521/1288] Revert "Reject transactions with excessive numbers of sigops" This reverts commit 4fad8e6d831729efa1965fa2034e7e51d3d0a1be. --- src/main.cpp | 15 +++------------ src/main.h | 2 -- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e135e93adb..55206600e2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -956,18 +956,9 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa if (Params().RequireStandard() && !AreInputsStandard(tx, view)) return error("AcceptToMemoryPool: : nonstandard transaction input"); - // Check that the transaction doesn't have an excessive number of - // sigops, making it impossible to mine. Since the coinbase transaction - // itself can contain sigops MAX_TX_SIGOPS is less than - // MAX_BLOCK_SIGOPS; we still consider this an invalid rather than - // merely non-standard transaction. - unsigned int nSigOps = GetLegacySigOpCount(tx); - nSigOps += GetP2SHSigOpCount(tx, view); - if (nSigOps > MAX_TX_SIGOPS) - return state.DoS(0, - error("AcceptToMemoryPool : too many sigops %s, %d > %d", - hash.ToString(), nSigOps, MAX_TX_SIGOPS), - REJECT_NONSTANDARD, "bad-txns-too-many-sigops"); + // Note: if you modify this code to accept non-standard transactions, then + // you should add code here to check that the transaction does a + // reasonable number of ECDSA signature verifications. int64_t nValueOut = tx.GetValueOut(); int64_t nFees = nValueIn-nValueOut; diff --git a/src/main.h b/src/main.h index 01d3f119e1..a27020459a 100644 --- a/src/main.h +++ b/src/main.h @@ -45,8 +45,6 @@ static const unsigned int MAX_STANDARD_TX_SIZE = 100000; static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50; /** Maxiumum number of signature check operations in an IsStandard() P2SH script */ static const unsigned int MAX_P2SH_SIGOPS = 15; -/** The maximum number of sigops we're willing to relay/mine in a single tx */ -static const unsigned int MAX_TX_SIGOPS = MAX_BLOCK_SIGOPS/5; /** The maximum number of orphan transactions kept in memory */ static const unsigned int MAX_ORPHAN_TRANSACTIONS = MAX_BLOCK_SIZE/100; /** Default for -maxorphanblocks, maximum number of orphan blocks kept in memory */ From c33b983903c64d88a2aef24da1827b86aadce596 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 12 Aug 2014 07:54:09 +0200 Subject: [PATCH 0522/1288] Don't poll showmyip.com, it doesn't exist anymore Fixes #4679. This leaves us with only one candidate, checkip.dyndns.org. GetMyExternalIP should be phased out as soon as possible. --- src/net.cpp | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 62124514c8..ec58f84b06 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -368,7 +368,7 @@ bool GetMyExternalIP(CNetAddr& ipRet) const char* pszKeyword; for (int nLookup = 0; nLookup <= 1; nLookup++) - for (int nHost = 1; nHost <= 2; nHost++) + for (int nHost = 1; nHost <= 1; nHost++) { // We should be phasing out our use of sites like these. If we need // replacements, we should ask for volunteers to put this simple @@ -393,25 +393,6 @@ bool GetMyExternalIP(CNetAddr& ipRet) pszKeyword = "Address:"; } - else if (nHost == 2) - { - addrConnect = CService("74.208.43.192", 80); // www.showmyip.com - - if (nLookup == 1) - { - CService addrIP("www.showmyip.com", 80, true); - if (addrIP.IsValid()) - addrConnect = addrIP; - } - - pszGet = "GET /simple/ HTTP/1.1\r\n" - "Host: www.showmyip.com\r\n" - "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\r\n" - "Connection: close\r\n" - "\r\n"; - - pszKeyword = NULL; // Returns just IP address - } if (GetMyExternalIP2(addrConnect, pszGet, pszKeyword, ipRet)) return true; From 9ee09dc64fbe712401c57b458c8254a1fdaaa5f2 Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Thu, 8 May 2014 00:18:57 -0400 Subject: [PATCH 0523/1288] Reapply: Reject transactions with excessive numbers of sigops Reverting was based on a misunderstanding, it appears. Github-Pull: #4150 --- src/main.cpp | 15 ++++++++++++--- src/main.h | 2 ++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 55206600e2..e135e93adb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -956,9 +956,18 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa if (Params().RequireStandard() && !AreInputsStandard(tx, view)) return error("AcceptToMemoryPool: : nonstandard transaction input"); - // Note: if you modify this code to accept non-standard transactions, then - // you should add code here to check that the transaction does a - // reasonable number of ECDSA signature verifications. + // Check that the transaction doesn't have an excessive number of + // sigops, making it impossible to mine. Since the coinbase transaction + // itself can contain sigops MAX_TX_SIGOPS is less than + // MAX_BLOCK_SIGOPS; we still consider this an invalid rather than + // merely non-standard transaction. + unsigned int nSigOps = GetLegacySigOpCount(tx); + nSigOps += GetP2SHSigOpCount(tx, view); + if (nSigOps > MAX_TX_SIGOPS) + return state.DoS(0, + error("AcceptToMemoryPool : too many sigops %s, %d > %d", + hash.ToString(), nSigOps, MAX_TX_SIGOPS), + REJECT_NONSTANDARD, "bad-txns-too-many-sigops"); int64_t nValueOut = tx.GetValueOut(); int64_t nFees = nValueIn-nValueOut; diff --git a/src/main.h b/src/main.h index a27020459a..01d3f119e1 100644 --- a/src/main.h +++ b/src/main.h @@ -45,6 +45,8 @@ static const unsigned int MAX_STANDARD_TX_SIZE = 100000; static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50; /** Maxiumum number of signature check operations in an IsStandard() P2SH script */ static const unsigned int MAX_P2SH_SIGOPS = 15; +/** The maximum number of sigops we're willing to relay/mine in a single tx */ +static const unsigned int MAX_TX_SIGOPS = MAX_BLOCK_SIGOPS/5; /** The maximum number of orphan transactions kept in memory */ static const unsigned int MAX_ORPHAN_TRANSACTIONS = MAX_BLOCK_SIZE/100; /** Default for -maxorphanblocks, maximum number of orphan blocks kept in memory */ From 616c24307f4f18d7dbd603b5d9688904f2d74210 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 13 Aug 2014 11:53:39 -0400 Subject: [PATCH 0524/1288] bitcoin-tx: fix build warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cleans up a bunch of: warning: missing braces around initializer for ‘const’ --- src/bitcoin-tx.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 299315424b..ffe87298f6 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -283,12 +283,12 @@ static const struct { const char *flagStr; int flags; } sighashOptions[N_SIGHASH_OPTS] = { - "ALL", SIGHASH_ALL, - "NONE", SIGHASH_NONE, - "SINGLE", SIGHASH_SINGLE, - "ALL|ANYONECANPAY", SIGHASH_ALL|SIGHASH_ANYONECANPAY, - "NONE|ANYONECANPAY", SIGHASH_NONE|SIGHASH_ANYONECANPAY, - "SINGLE|ANYONECANPAY", SIGHASH_SINGLE|SIGHASH_ANYONECANPAY, + {"ALL", SIGHASH_ALL}, + {"NONE", SIGHASH_NONE}, + {"SINGLE", SIGHASH_SINGLE}, + {"ALL|ANYONECANPAY", SIGHASH_ALL|SIGHASH_ANYONECANPAY}, + {"NONE|ANYONECANPAY", SIGHASH_NONE|SIGHASH_ANYONECANPAY}, + {"SINGLE|ANYONECANPAY", SIGHASH_SINGLE|SIGHASH_ANYONECANPAY}, }; static bool findSighashFlags(int& flags, const string& flagStr) From da2ede2aa68ba14e1228b61e41a5840669560eee Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Thu, 14 Aug 2014 16:15:09 +0200 Subject: [PATCH 0525/1288] [Wallet] Improve ReorderTransactions(..) --- src/walletdb.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/walletdb.cpp b/src/walletdb.cpp index a95baf83d0..d55ed374c5 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -278,8 +278,12 @@ CWalletDB::ReorderTransactions(CWallet* pwallet) nOrderPos = nOrderPosNext++; nOrderPosOffsets.push_back(nOrderPos); - if (pacentry) - // Have to write accounting regardless, since we don't keep it in memory + if (pwtx) + { + if (!WriteTx(pwtx->GetHash(), *pwtx)) + return DB_LOAD_FAIL; + } + else if (!WriteAccountingEntry(pacentry->nEntryNo, *pacentry)) return DB_LOAD_FAIL; } @@ -308,6 +312,7 @@ CWalletDB::ReorderTransactions(CWallet* pwallet) return DB_LOAD_FAIL; } } + WriteOrderPosNext(nOrderPosNext); return DB_LOAD_OK; } From beb36e800c393da3c5857a8f1e5959748ac0f96b Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 29 Jul 2014 10:53:38 -0400 Subject: [PATCH 0526/1288] ui_interface: remove unused NotifyBlocksChanged signal --- src/main.cpp | 5 +---- src/qt/clientmodel.cpp | 8 -------- src/ui_interface.h | 3 --- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e135e93adb..e73942d7e0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1386,10 +1386,8 @@ void Misbehaving(NodeId pnode, int howmuch) void static InvalidChainFound(CBlockIndex* pindexNew) { if (!pindexBestInvalid || pindexNew->nChainWork > pindexBestInvalid->nChainWork) - { pindexBestInvalid = pindexNew; - uiInterface.NotifyBlocksChanged(); - } + LogPrintf("InvalidChainFound: invalid block=%s height=%d log2_work=%.8g date=%s\n", pindexNew->GetBlockHash().ToString(), pindexNew->nHeight, log(pindexNew->nChainWork.getdouble())/log(2.0), DateTimeStrFormat("%Y-%m-%d %H:%M:%S", @@ -2175,7 +2173,6 @@ bool ActivateBestChain(CValidationState &state) { boost::thread t(runCommand, strCmd); // thread runs free } } - uiInterface.NotifyBlocksChanged(); } while(pindexMostWork != chainActive.Tip()); return true; diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 4c21eb5594..fea99bfd93 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -208,12 +208,6 @@ static void ShowProgress(ClientModel *clientmodel, const std::string &title, int Q_ARG(int, nProgress)); } -static void NotifyBlocksChanged(ClientModel *clientmodel) -{ - // This notification is too frequent. Don't trigger a signal. - // Don't remove it, though, as it might be useful later. -} - static void NotifyNumConnectionsChanged(ClientModel *clientmodel, int newNumConnections) { // Too noisy: qDebug() << "NotifyNumConnectionsChanged : " + QString::number(newNumConnections); @@ -233,7 +227,6 @@ void ClientModel::subscribeToCoreSignals() { // Connect signals to client uiInterface.ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2)); - uiInterface.NotifyBlocksChanged.connect(boost::bind(NotifyBlocksChanged, this)); uiInterface.NotifyNumConnectionsChanged.connect(boost::bind(NotifyNumConnectionsChanged, this, _1)); uiInterface.NotifyAlertChanged.connect(boost::bind(NotifyAlertChanged, this, _1, _2)); } @@ -242,7 +235,6 @@ void ClientModel::unsubscribeFromCoreSignals() { // Disconnect signals from client uiInterface.ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2)); - uiInterface.NotifyBlocksChanged.disconnect(boost::bind(NotifyBlocksChanged, this)); uiInterface.NotifyNumConnectionsChanged.disconnect(boost::bind(NotifyNumConnectionsChanged, this, _1)); uiInterface.NotifyAlertChanged.disconnect(boost::bind(NotifyAlertChanged, this, _1, _2)); } diff --git a/src/ui_interface.h b/src/ui_interface.h index b3df2b5a85..a073a32828 100644 --- a/src/ui_interface.h +++ b/src/ui_interface.h @@ -78,9 +78,6 @@ public: /** Translate a message to the native language of the user. */ boost::signals2::signal Translate; - /** Block chain changed. */ - boost::signals2::signal NotifyBlocksChanged; - /** Number of network connections changed. */ boost::signals2::signal NotifyNumConnectionsChanged; From c7b6117debf4ebabc464a55b840bdd7bdeb94fa3 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Thu, 14 Aug 2014 12:32:34 -0400 Subject: [PATCH 0527/1288] Create new signal for notification of new blocks. Use w/ -blocknotify --- src/init.cpp | 11 +++++++++++ src/main.cpp | 8 +++----- src/ui_interface.h | 3 +++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 8ae228bbbe..494342c693 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -367,6 +367,14 @@ std::string LicenseInfo() "\n"; } +static void BlockNotifyCallback(const uint256& hashNewTip) +{ + std::string strCmd = GetArg("-blocknotify", ""); + + boost::replace_all(strCmd, "%s", hashNewTip.GetHex()); + boost::thread t(runCommand, strCmd); // thread runs free +} + struct CImportingNow { CImportingNow() { @@ -1184,6 +1192,9 @@ bool AppInit2(boost::thread_group& threadGroup) #endif // !ENABLE_WALLET // ********************************************************* Step 9: import blocks + if (mapArgs.count("-blocknotify")) + uiInterface.NotifyBlockTip.connect(BlockNotifyCallback); + // scan for better chains in the block chain database, that are not yet connected in the active best chain CValidationState state; if (!ActivateBestChain(state)) diff --git a/src/main.cpp b/src/main.cpp index e73942d7e0..841cc1952f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2162,16 +2162,14 @@ bool ActivateBestChain(CValidationState &state) { uint256 hashNewTip = pindexNewTip->GetBlockHash(); // Relay inventory, but don't relay old inventory during initial block download. int nBlockEstimate = Checkpoints::GetTotalBlocksEstimate(); + { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) if (chainActive.Height() > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : nBlockEstimate)) pnode->PushInventory(CInv(MSG_BLOCK, hashNewTip)); - - std::string strCmd = GetArg("-blocknotify", ""); - if (!strCmd.empty()) { - boost::replace_all(strCmd, "%s", hashNewTip.GetHex()); - boost::thread t(runCommand, strCmd); // thread runs free } + + uiInterface.NotifyBlockTip(hashNewTip); } } while(pindexMostWork != chainActive.Tip()); diff --git a/src/ui_interface.h b/src/ui_interface.h index a073a32828..bbc8a203c9 100644 --- a/src/ui_interface.h +++ b/src/ui_interface.h @@ -92,6 +92,9 @@ public: /** Show progress e.g. for verifychain */ boost::signals2::signal ShowProgress; + + /** New block has been accepted */ + boost::signals2::signal NotifyBlockTip; }; extern CClientUIInterface uiInterface; From 6f2c26a457d279138d23d0f321edf55cd6b1f72f Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 6 Aug 2014 23:58:19 -0400 Subject: [PATCH 0528/1288] Closely track mempool byte total. Add "getmempoolinfo" RPC. Goal: Gain live insight into the mempool. Groundwork for future work that caps mempool size. --- src/rpcblockchain.cpp | 24 ++++++++++++++++++++++++ src/rpcserver.cpp | 1 + src/rpcserver.h | 1 + src/txmempool.cpp | 9 +++++++++ src/txmempool.h | 6 ++++++ 5 files changed, 41 insertions(+) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 1e5198b85c..e511fe4222 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -531,3 +531,27 @@ Value getchaintips(const Array& params, bool fHelp) return res; } + +Value getmempoolinfo(const Array& params, bool fHelp) +{ + if (fHelp || params.size() != 0) + throw runtime_error( + "getmempoolinfo\n" + "\nReturns details on the active state of the TX memory pool.\n" + "\nResult:\n" + "{\n" + " \"size\": xxxxx (numeric) Current tx count\n" + " \"bytes\": xxxxx (numeric) Sum of all tx sizes\n" + "}\n" + "\nExamples:\n" + + HelpExampleCli("getmempoolinfo", "") + + HelpExampleRpc("getmempoolinfo", "") + ); + + Object ret; + ret.push_back(Pair("size", (int64_t) mempool.size())); + ret.push_back(Pair("bytes", (int64_t) mempool.GetTotalTxSize())); + + return ret; +} + diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 56064941f6..3b51c91e7c 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -256,6 +256,7 @@ static const CRPCCommand vRPCCommands[] = { "blockchain", "getblockhash", &getblockhash, true, false, false }, { "blockchain", "getchaintips", &getchaintips, true, false, false }, { "blockchain", "getdifficulty", &getdifficulty, true, false, false }, + { "blockchain", "getmempoolinfo", &getmempoolinfo, true, true, false }, { "blockchain", "getrawmempool", &getrawmempool, true, false, false }, { "blockchain", "gettxout", &gettxout, true, false, false }, { "blockchain", "gettxoutsetinfo", &gettxoutsetinfo, true, false, false }, diff --git a/src/rpcserver.h b/src/rpcserver.h index 2248e8aeb2..b850d15d4e 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -200,6 +200,7 @@ extern json_spirit::Value getblockcount(const json_spirit::Array& params, bool f extern json_spirit::Value getbestblockhash(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getdifficulty(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value settxfee(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value getmempoolinfo(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getrawmempool(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getblockhash(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getblock(const json_spirit::Array& params, bool fHelp); diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 29924fff09..80cae68244 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -402,6 +402,7 @@ bool CTxMemPool::addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry) for (unsigned int i = 0; i < tx.vin.size(); i++) mapNextTx[tx.vin[i].prevout] = CInPoint(&tx, i); nTransactionsUpdated++; + totalTxSize += entry.GetTxSize(); } return true; } @@ -426,6 +427,8 @@ void CTxMemPool::remove(const CTransaction &tx, std::list& removed removed.push_front(tx); BOOST_FOREACH(const CTxIn& txin, tx.vin) mapNextTx.erase(txin.prevout); + + totalTxSize -= mapTx[hash].GetTxSize(); mapTx.erase(hash); nTransactionsUpdated++; } @@ -477,6 +480,7 @@ void CTxMemPool::clear() LOCK(cs); mapTx.clear(); mapNextTx.clear(); + totalTxSize = 0; ++nTransactionsUpdated; } @@ -487,9 +491,12 @@ void CTxMemPool::check(CCoinsViewCache *pcoins) const LogPrint("mempool", "Checking mempool with %u transactions and %u inputs\n", (unsigned int)mapTx.size(), (unsigned int)mapNextTx.size()); + uint64_t checkTotal = 0; + LOCK(cs); for (std::map::const_iterator it = mapTx.begin(); it != mapTx.end(); it++) { unsigned int i = 0; + checkTotal += it->second.GetTxSize(); const CTransaction& tx = it->second.GetTx(); BOOST_FOREACH(const CTxIn &txin, tx.vin) { // Check that every mempool transaction's inputs refer to available coins, or other mempool tx's. @@ -518,6 +525,8 @@ void CTxMemPool::check(CCoinsViewCache *pcoins) const assert(tx.vin.size() > it->second.n); assert(it->first == it->second.ptx->vin[it->second.n].prevout); } + + assert(totalTxSize == checkTotal); } void CTxMemPool::queryHashes(vector& vtxid) diff --git a/src/txmempool.h b/src/txmempool.h index 41b2c52f39..2577397bce 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -68,6 +68,7 @@ private: CMinerPolicyEstimator* minerPolicyEstimator; CFeeRate minRelayFee; // Passed to constructor to avoid dependency on main + uint64_t totalTxSize; // sum of all mempool tx' byte sizes public: mutable CCriticalSection cs; @@ -108,6 +109,11 @@ public: LOCK(cs); return mapTx.size(); } + uint64_t GetTotalTxSize() + { + LOCK(cs); + return totalTxSize; + } bool exists(uint256 hash) { From 6b099402b40dcf9fc716be29c85e7e1865b28e92 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 7 Aug 2014 11:16:07 -0400 Subject: [PATCH 0529/1288] build: fix automake warnings about the use of INCLUDES While we're at it, reduce the use of LIBS as well. This makes dependencies explicit. Fixes building with (the not-yet-merged) libsecp256k1 as well. Github-Pull: #4689 Rebased-By: Wladimir J. van der laan Rebased-From: 909b347 c0e5dda --- configure.ac | 11 ++++------- src/Makefile.am | 21 +++++++++++++++------ src/Makefile.qt.include | 2 +- src/Makefile.qttest.include | 2 +- src/Makefile.test.include | 2 +- 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index 55fc091bc5..d6d56fae34 100644 --- a/configure.ac +++ b/configure.ac @@ -304,7 +304,6 @@ AC_C_BIGENDIAN([AC_MSG_ERROR("Big Endian not supported")]) dnl Check for pthread compile/link requirements AX_PTHREAD -INCLUDES="$INCLUDES $PTHREAD_CFLAGS" # The following macro will add the necessary defines to bitcoin-config.h, but # they also need to be passed down to any subprojects. Pull the results out of @@ -456,7 +455,6 @@ if test x$use_tests = xyes; then fi BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB" -BOOST_INCLUDES="$BOOST_CPPFLAGS" dnl Boost >= 1.50 uses sleep_for rather than the now-deprecated sleep, however dnl it was broken from 1.50 to 1.52 when backed by nanosleep. Use sleep_for if @@ -536,8 +534,8 @@ if test x$use_pkgconfig = xyes; then m4_ifdef( [PKG_CHECK_MODULES], [ - PKG_CHECK_MODULES([SSL], [libssl], [INCLUDES="$INCLUDES $SSL_CFLAGS"; LIBS="$LIBS $SSL_LIBS"], [AC_MSG_ERROR(openssl not found.)]) - PKG_CHECK_MODULES([CRYPTO], [libcrypto], [INCLUDES="$INCLUDES $CRYPTO_CFLAGS"; LIBS="$LIBS $CRYPTO_LIBS"], [AC_MSG_ERROR(libcrypto not found.)]) + PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl not found.)]) + PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto not found.)]) BITCOIN_QT_CHECK([PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [BITCOIN_QT_FAIL(libprotobuf not found)])]) if test x$use_qr != xno; then BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])]) @@ -546,10 +544,10 @@ if test x$use_pkgconfig = xyes; then ) else AC_CHECK_HEADER([openssl/crypto.h],,AC_MSG_ERROR(libcrypto headers missing)) - AC_CHECK_LIB([crypto], [main],, AC_MSG_ERROR(libcrypto missing)) + AC_CHECK_LIB([crypto], [main],CRYPTO_LIBS=-lcrypto, AC_MSG_ERROR(libcrypto missing)) AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),) - AC_CHECK_LIB([ssl], [main],, AC_MSG_ERROR(libssl missing)) + AC_CHECK_LIB([ssl], [main],SSL_LIBS=-lssl, AC_MSG_ERROR(libssl missing)) BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],,BITCOIN_QT_FAIL(libprotobuf not found))) if test x$use_qr != xno; then @@ -709,7 +707,6 @@ AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR) AC_SUBST(LIBTOOL_LDFLAGS) AC_SUBST(USE_UPNP) AC_SUBST(USE_QRCODE) -AC_SUBST(INCLUDES) AC_SUBST(BOOST_LIBS) AC_SUBST(TESTDEFS) AC_SUBST(LEVELDB_TARGET_FLAGS) diff --git a/src/Makefile.am b/src/Makefile.am index 727a88c3e7..bec019b49e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,3 @@ -AM_CPPFLAGS = $(INCLUDES) AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) if USE_LIBSECP256K1 @@ -22,7 +21,7 @@ $(LIBLEVELDB) $(LIBMEMENV): endif BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config -BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) +BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS) if USE_LIBSECP256K1 BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include @@ -261,7 +260,7 @@ if TARGET_WINDOWS bitcoind_SOURCES += bitcoind-res.rc endif -bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) +bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES) # bitcoin-cli binary # @@ -270,7 +269,10 @@ bitcoin_cli_LDADD = \ $(LIBBITCOIN_COMMON) \ $(LIBBITCOIN_UTIL) \ $(LIBBITCOIN_CRYPTO) \ - $(BOOST_LIBS) + $(BOOST_LIBS) \ + $(SSL_LIBS) \ + $(CRYPTO_LIBS) + bitcoin_cli_SOURCES = \ bitcoin-cli.cpp @@ -285,8 +287,15 @@ bitcoin_tx_LDADD = \ $(LIBBITCOIN_UNIVALUE) \ $(LIBBITCOIN_COMMON) \ $(LIBBITCOIN_UTIL) \ - $(LIBBITCOIN_CRYPTO) \ - $(BOOST_LIBS) + $(LIBBITCOIN_CRYPTO) + +if USE_LIBSECP256K1 + bitcoin_tx_LDADD += secp256k1/libsecp256k1.la +endif + + bitcoin_tx_LDADD += $(BOOST_LIBS) \ + $(SSL_LIBS) \ + $(CRYPTO_LIBS) bitcoin_tx_SOURCES = bitcoin-tx.cpp bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES) # diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 7e6fa5cb88..9a333d5c76 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -358,7 +358,7 @@ if ENABLE_WALLET qt_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) endif qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ - $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) + $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) if USE_LIBSECP256K1 qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la endif diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index d49b2240ea..ee8edb994e 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -32,7 +32,7 @@ qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) endif qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) \ $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ - $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) + $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) if USE_LIBSECP256K1 qt_test_test_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la endif diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 72451fba9a..b5fee08223 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -74,7 +74,7 @@ if USE_LIBSECP256K1 test_test_bitcoin_LDADD += secp256k1/libsecp256k1.la endif -test_test_bitcoin_LDADD += $(BDB_LIBS) +test_test_bitcoin_LDADD += $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES) From 54c7df81f3e5f81cb91646acaf82074a3a6be3b2 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 15 Aug 2014 12:19:11 -0400 Subject: [PATCH 0530/1288] build: Fix boost build on some platforms When the libpath doesn't line up with the value from config.sub, we don't find the correct path to boost's libs. This adds a hack to try another path before giving up. Should close #3219. --- src/m4/ax_boost_base.m4 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/m4/ax_boost_base.m4 b/src/m4/ax_boost_base.m4 index e025a7e1ca..3f24d5ddc6 100644 --- a/src/m4/ax_boost_base.m4 +++ b/src/m4/ax_boost_base.m4 @@ -112,6 +112,12 @@ if test "x$want_boost" = "xyes"; then ;; esac + dnl some arches may advertise a cpu type that doesn't line up with their + dnl prefix's cpu type. For example, uname may report armv7l while libs are + dnl installed to /usr/lib/arm-linux-gnueabihf. Try getting the compiler's + dnl value for an extra chance of finding the correct path. + libsubdirs="lib/`$CXX -dumpmachine 2>/dev/null` $libsubdirs" + dnl first we check the system location for boost libraries dnl this location ist chosen if boost libraries are installed with the --layout=system option dnl or if you install boost with RPM From 4975ae1722cd8af63eda2f02ef64a98091b6fb58 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 7 Aug 2014 18:59:06 -0400 Subject: [PATCH 0531/1288] build: add option for reducing exports Enabled automatically if boost >= 1.49. See: https://svn.boost.org/trac/boost/ticket/2309 Also, check for a default visibility attribute, so that we can mark future api functions correctly. --- configure.ac | 77 +++++++++++++++++++++++++++++++++++++ src/Makefile.am | 3 ++ src/Makefile.qt.include | 2 +- src/Makefile.qttest.include | 2 +- src/Makefile.test.include | 1 + 5 files changed, 83 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d6d56fae34..bf45d7cd1c 100644 --- a/configure.ac +++ b/configure.ac @@ -90,6 +90,12 @@ AC_ARG_ENABLE([hardening], [use_hardening=$enableval], [use_hardening=yes]) +AC_ARG_ENABLE([reduce-exports], + [AS_HELP_STRING([--enable-reduce-exports], + [attempt to reduce exported symbols in the resulting executables (default is yes)])], + [use_reduce_exports=$enableval], + [use_reduce_exports=auto]) + AC_ARG_ENABLE([ccache], [AS_HELP_STRING([--enable-ccache], [use ccache for building (default is yes if ccache is found)])], @@ -396,6 +402,40 @@ AC_TRY_COMPILE([#include ], AC_SEARCH_LIBS([clock_gettime],[rt]) +AC_MSG_CHECKING([for visibility attribute]) +AC_LINK_IFELSE([AC_LANG_SOURCE([ + int foo_def( void ) __attribute__((visibility("default"))); + int main(){} + ])], + [ + AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE,1,[Define if the visibility attribute is supported.]) + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_RESULT(no) + if test x$use_reduce_exports = xyes; then + AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduced-exports.]) + fi + AC_MSG_WARN([Cannot find a working visibility attribute. Disabling reduced exports.]) + use_reduce_exports=no + ] +) + +if test x$use_reduce_exports != xno; then + AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"], + [ + if test x$use_reduce_exports = xyes; then + AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduced-exports.]) + fi + AC_MSG_WARN([Cannot set default symbol visibility. Disabling reduced exports.]) + use_reduce_exports=no + ]) + if test x$use_reduce_exports != xno; then + AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]], [RELDFLAGS="-Wl,--exclude-libs,ALL"]) + CXXFLAGS="$CXXFLAGS $RE_CXXFLAGS" + fi +fi + LEVELDB_CPPFLAGS= LIBLEVELDB= LIBMEMENV= @@ -420,6 +460,35 @@ fi dnl Check for boost libs AX_BOOST_BASE + +if test x$use_reduce_exports != xno; then + AC_MSG_CHECKING([for working boost reduced exports]) + TEMP_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS" + AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ + @%:@include + ]], [[ + #if BOOST_VERSION >= 104900 + // Everything is okay + #else + # error Boost version is too old + #endif + ]])],[ + AC_MSG_RESULT(yes) + ],[: + if test x$use_reduce_exports = xauto; then + use_reduce_exports=no + else + if test x$use_reduce_exports = xyes; then + AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduced-exports.]) + fi + fi + AC_MSG_RESULT(no) + AC_MSG_WARN([boost versions < 1.49 are known to have symbol visibility issues. Disabling reduced exports.]) + ]) + CPPFLAGS="$TEMP_CPPFLAGS" +fi + AX_BOOST_SYSTEM AX_BOOST_FILESYSTEM AX_BOOST_PROGRAM_OPTIONS @@ -672,6 +741,13 @@ else AC_MSG_RESULT([no]) fi +AC_MSG_CHECKING([whether to reduce exports]) +if test x$use_reduce_exports != xno; then + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + if test "x$use_tests$build_bitcoind$use_qt" = "xnonono"; then AC_MSG_ERROR([No targets! Please specify at least one of: --enable-cli --enable-daemon --enable-gui or --enable-tests]) fi @@ -704,6 +780,7 @@ AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE) AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR) +AC_SUBST(RELDFLAGS) AC_SUBST(LIBTOOL_LDFLAGS) AC_SUBST(USE_UPNP) AC_SUBST(USE_QRCODE) diff --git a/src/Makefile.am b/src/Makefile.am index bec019b49e..85d4ab6dec 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -262,6 +262,7 @@ endif bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES) +bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) # bitcoin-cli binary # bitcoin_cli_LDADD = \ @@ -299,10 +300,12 @@ endif bitcoin_tx_SOURCES = bitcoin-tx.cpp bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES) # +bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) if TARGET_WINDOWS bitcoin_cli_SOURCES += bitcoin-cli-res.rc endif +bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 9a333d5c76..28d7053fc4 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -362,7 +362,7 @@ qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) if USE_LIBSECP256K1 qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la endif -qt_bitcoin_qt_LDFLAGS = $(AM_LDFLAGS) $(QT_LDFLAGS) +qt_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) #locale/foo.ts -> locale/foo.qm QT_QM=$(QT_TS:.ts=.qm) diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index ee8edb994e..2cba5b7e1e 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -36,7 +36,7 @@ qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBIT if USE_LIBSECP256K1 qt_test_test_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la endif -qt_test_test_bitcoin_qt_LDFLAGS = $(AM_LDFLAGS) $(QT_LDFLAGS) +qt_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) CLEAN_BITCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno diff --git a/src/Makefile.test.include b/src/Makefile.test.include index b5fee08223..b54c9be664 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -75,6 +75,7 @@ if USE_LIBSECP256K1 endif test_test_bitcoin_LDADD += $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) +test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES) From a65668ddc0b4a6e0114abb6856d90c8ec0bf8784 Mon Sep 17 00:00:00 2001 From: randy-waterhouse Date: Sat, 16 Aug 2014 10:56:28 +1200 Subject: [PATCH 0532/1288] build : fix CPPFLAGS for libbitcoin_cli --- src/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Makefile.am b/src/Makefile.am index bec019b49e..eda20ad296 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -229,6 +229,7 @@ libbitcoin_util_a_SOURCES += compat/glibcxx_compat.cpp endif # cli: shared between bitcoin-cli and bitcoin-qt +libbitcoin_cli_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_cli_a_SOURCES = \ rpcclient.cpp \ $(BITCOIN_CORE_H) From 1910910ddeeb319f0c863ba2fd37364c81338b8f Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 15 Aug 2014 22:44:10 -0400 Subject: [PATCH 0533/1288] depends: fix shasum on osx < 10.9 Shasum verification from stdin doesn't work there, so we write to a file instead. Formatted a bit too. --- depends/funcs.mk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/depends/funcs.mk b/depends/funcs.mk index 4c47cc926e..b5d8b0ee2e 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -20,7 +20,11 @@ $(sort $(foreach dep,$(2),$(2) $(call int_get_all_dependencies,$(1),$($(dep)_dep endef define fetch_file -(test -f $(SOURCES_PATH)/$(3) || ( mkdir -p $$($(1)_extract_dir) && $(build_DOWNLOAD) "$$($(1)_extract_dir)/$(3).temp" "$(2)" && echo "$(4) $$($(1)_extract_dir)/$(3).temp" | $(build_SHA256SUM) -c && mv $$($(1)_extract_dir)/$(3).temp $(SOURCES_PATH)/$(3) )) +(test -f $(SOURCES_PATH)/$(3) || \ + ( mkdir -p $$($(1)_extract_dir) && $(build_DOWNLOAD) "$$($(1)_extract_dir)/$(3).temp" "$(2)" && \ + echo "$(4) $$($(1)_extract_dir)/$(3).temp" > $$($(1)_extract_dir)/.$(3).hash && \ + $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$(3).hash && \ + mv $$($(1)_extract_dir)/$(3).temp $(SOURCES_PATH)/$(3) )) endef define int_get_build_recipe_hash @@ -62,7 +66,7 @@ $(1)_download_path_fixed=$(subst :,\:,$$($(1)_download_path)) #default commands $(1)_fetch_cmds ?= $(call fetch_file,$(1),$(subst \:,:,$$($(1)_download_path_fixed)/$$($(1)_download_file)),$($(1)_file_name),$($(1)_sha256_hash)) -$(1)_extract_cmds ?= echo "$$($(1)_sha256_hash) $$($(1)_source)" | $(build_SHA256SUM) -c && tar --strip-components=1 -xf $$($(1)_source) +$(1)_extract_cmds ?= mkdir -p $$($(1)_extract_dir) && echo "$$($(1)_sha256_hash) $$($(1)_source)" > $$($(1)_extract_dir)/.$$($(1)_file_name).hash && $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$$($(1)_file_name).hash && tar --strip-components=1 -xf $$($(1)_source) $(1)_preprocess_cmds ?= $(1)_build_cmds ?= $(1)_config_cmds ?= From e42363d8005ff899c5da0e99eebc19bb16f330e5 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 15 Aug 2014 22:44:36 -0400 Subject: [PATCH 0534/1288] build: add funcs.mk to the list of meta-depends If anything in funcs.mk changes, everything must rebuild --- depends/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/Makefile b/depends/Makefile index d431653068..bd5f0bf536 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -72,7 +72,7 @@ packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_pack native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) $(qt_native_packages_) all_packages = $(packages) $(native_packages) -meta_depends = Makefile builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk +meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk $(host_arch)_$(host_os)_native_toolchain?=$($(host_os)_native_toolchain) From 9322f1a4d9ab301f2f6b8a404fb6012d8b50ef74 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 15 Aug 2014 23:15:49 -0400 Subject: [PATCH 0535/1288] tests: fix test-runner for osx. Closes ##4708 Use the more portable $$ rather than $BASHPID --- qa/pull-tester/run-bitcoind-for-test.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/pull-tester/run-bitcoind-for-test.sh.in b/qa/pull-tester/run-bitcoind-for-test.sh.in index e186bd7a23..67318e5a4c 100755 --- a/qa/pull-tester/run-bitcoind-for-test.sh.in +++ b/qa/pull-tester/run-bitcoind-for-test.sh.in @@ -9,7 +9,7 @@ mkdir -p "$DATADIR"/regtest touch "$DATADIR/regtest/debug.log" tail -q -n 1 -F "$DATADIR/regtest/debug.log" | grep -m 1 -q "Done loading" & WAITER=$! -PORT=`expr 10000 + $BASHPID % 55536` +PORT=`expr 10000 + $$ % 55536` "@abs_top_builddir@/src/bitcoind@EXEEXT@" -connect=0.0.0.0 -datadir="$DATADIR" -rpcuser=user -rpcpassword=pass -listen -keypool=3 -debug -debug=net -logtimestamps -port=$PORT -whitelist=127.0.0.1 -regtest -rpcport=`expr $PORT + 1` & BITCOIND=$! From 5cbda4f10f16923910de2bd080152fc7bbc48738 Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Thu, 7 Aug 2014 22:58:50 +0100 Subject: [PATCH 0536/1288] Changed LevelDB cursors to use scoped pointers to ensure destruction when going out of scope. This corrects a bug where an exception thrown reading from the database causes the cursor to be left open, which causes an assertion error to occur when the database is deleted (around line 938 of init.cpp). --- src/txdb.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/txdb.cpp b/src/txdb.cpp index 52cd96283e..d3d05c58d7 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -103,7 +103,7 @@ bool CBlockTreeDB::ReadLastBlockFile(int &nFile) { } bool CCoinsViewDB::GetStats(CCoinsStats &stats) { - leveldb::Iterator *pcursor = db.NewIterator(); + boost::scoped_ptr pcursor(db.NewIterator()); pcursor->SeekToFirst(); CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION); @@ -146,7 +146,6 @@ bool CCoinsViewDB::GetStats(CCoinsStats &stats) { return error("%s : Deserialize or I/O error - %s", __func__, e.what()); } } - delete pcursor; stats.nHeight = mapBlockIndex.find(GetBestBlock())->second->nHeight; stats.hashSerialized = ss.GetHash(); stats.nTotalAmount = nTotalAmount; @@ -178,7 +177,7 @@ bool CBlockTreeDB::ReadFlag(const std::string &name, bool &fValue) { bool CBlockTreeDB::LoadBlockIndexGuts() { - leveldb::Iterator *pcursor = NewIterator(); + boost::scoped_ptr pcursor(NewIterator()); CDataStream ssKeySet(SER_DISK, CLIENT_VERSION); ssKeySet << make_pair('b', uint256(0)); @@ -224,7 +223,6 @@ bool CBlockTreeDB::LoadBlockIndexGuts() return error("%s : Deserialize or I/O error - %s", __func__, e.what()); } } - delete pcursor; return true; } From 27116e87ccc48421640458310cd6cab222fc27dd Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sun, 17 Aug 2014 10:06:20 +0200 Subject: [PATCH 0537/1288] devtools: Exclude default exports from symbol-checker script See discussion in #4663. --- contrib/devtools/symbol-check.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/devtools/symbol-check.py b/contrib/devtools/symbol-check.py index 8dd6d8f037..f3999f1c0b 100755 --- a/contrib/devtools/symbol-check.py +++ b/contrib/devtools/symbol-check.py @@ -41,6 +41,10 @@ MAX_VERSIONS = { 'GLIBCXX': (3,4,13), 'GLIBC': (2,11) } +# Ignore symbols that are exported as part of every executable +IGNORE_EXPORTS = { +'_edata', '_end', '_init', '__bss_start', '_fini' +} READELF_CMD = '/usr/bin/readelf' CPPFILT_CMD = '/usr/bin/c++filt' @@ -105,6 +109,8 @@ if __name__ == '__main__': retval = 1 # Check exported symbols for sym,version in read_symbols(filename, False): + if sym in IGNORE_EXPORTS: + continue print('%s: export of symbol %s not allowed' % (filename, cppfilt(sym))) retval = 1 From c101c7690706c962944570fe5efe9975bf740a53 Mon Sep 17 00:00:00 2001 From: randy-waterhouse Date: Sat, 16 Aug 2014 16:48:24 +1200 Subject: [PATCH 0538/1288] build: Add --with-utils (bitcoin-cli and bitcoin-tx, default=yes). Help string consistency tweaks. Target sanity check fix. --- configure.ac | 22 +++++++++++----------- src/Makefile.am | 6 ++---- src/m4/bitcoin_qt.m4 | 4 ++-- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/configure.ac b/configure.ac index bf45d7cd1c..fc1f7c51ca 100644 --- a/configure.ac +++ b/configure.ac @@ -579,15 +579,15 @@ if test x$boost_sleep != xyes; then AC_MSG_ERROR(No working boost sleep implementation found. If on ubuntu 13.10 with libboost1.54-all-dev remove libboost.1.54-all-dev and use libboost1.53-all-dev) fi -AC_ARG_WITH([cli], - [AS_HELP_STRING([--with-cli], - [with CLI (default is yes)])], - [build_bitcoin_cli=$withval], - [build_bitcoin_cli=yes]) +AC_ARG_WITH([utils], + [AS_HELP_STRING([--with-utils], + [build bitcoin-cli bitcoin-tx (default=yes)])], + [build_bitcoin_utils=$withval], + [build_bitcoin_utils=yes]) AC_ARG_WITH([daemon], [AS_HELP_STRING([--with-daemon], - [with daemon (default is yes)])], + [build bitcoind daemon (default=yes)])], [build_bitcoind=$withval], [build_bitcoind=yes]) @@ -631,9 +631,9 @@ AC_MSG_CHECKING([whether to build bitcoind]) AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes]) AC_MSG_RESULT($build_bitcoind) -AC_MSG_CHECKING([whether to build bitcoin-cli]) -AM_CONDITIONAL([BUILD_BITCOIN_CLI], [test x$build_bitcoin_cli = xyes]) -AC_MSG_RESULT($build_bitcoin_cli) +AC_MSG_CHECKING([whether to build utils (bitcoin-cli bitcoin-tx)]) +AM_CONDITIONAL([BUILD_BITCOIN_UTILS], [test x$build_bitcoin_utils = xyes]) +AC_MSG_RESULT($build_bitcoin_utils) dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt4]) @@ -748,8 +748,8 @@ else AC_MSG_RESULT([no]) fi -if test "x$use_tests$build_bitcoind$use_qt" = "xnonono"; then - AC_MSG_ERROR([No targets! Please specify at least one of: --enable-cli --enable-daemon --enable-gui or --enable-tests]) +if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests = xnononono; then + AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-daemon --with-gui or --enable-tests]) fi AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin]) diff --git a/src/Makefile.am b/src/Makefile.am index 2c00f8b572..1bb59bce7b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -55,12 +55,10 @@ if BUILD_BITCOIND bin_PROGRAMS += bitcoind endif -if BUILD_BITCOIN_CLI - bin_PROGRAMS += bitcoin-cli +if BUILD_BITCOIN_UTILS + bin_PROGRAMS += bitcoin-cli bitcoin-tx endif -bin_PROGRAMS += bitcoin-tx - .PHONY: FORCE # bitcoin core # BITCOIN_CORE_H = \ diff --git a/src/m4/bitcoin_qt.m4 b/src/m4/bitcoin_qt.m4 index 4c1d40c394..27000ecbac 100644 --- a/src/m4/bitcoin_qt.m4 +++ b/src/m4/bitcoin_qt.m4 @@ -48,8 +48,8 @@ dnl CAUTION: Do not use this inside of a conditional. AC_DEFUN([BITCOIN_QT_INIT],[ dnl enable qt support AC_ARG_WITH([gui], - [AS_HELP_STRING([--with-gui], - [with GUI (no|qt4|qt5|auto. default is auto, qt4 tried first.)])], + [AS_HELP_STRING([--with-gui@<:@=no|qt4|qt5|auto@:>@], + [build bitcoin-qt GUI (default=auto, qt4 tried first)])], [ bitcoin_qt_want_version=$withval if test x$bitcoin_qt_want_version = xyes; then From 0d27dad8452704fa849832a0d28bf3e1b564d7b7 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 17 Aug 2014 17:38:26 +0200 Subject: [PATCH 0539/1288] Clean-up SyncWithWallets/SyncTransaction --- src/main.cpp | 6 +----- src/rpcrawtransaction.cpp | 4 +--- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e135e93adb..d8f96ed2c3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1022,7 +1022,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa pool.addUnchecked(hash, entry); } - g_signals.SyncTransaction(tx, NULL); + SyncWithWallets(tx, NULL); return true; } @@ -1857,10 +1857,6 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C int64_t nTime3 = GetTimeMicros(); nTimeIndex += nTime3 - nTime2; LogPrint("bench", " - Index writing: %.2fms [%.2fs]\n", 0.001 * (nTime3 - nTime2), nTimeIndex * 0.000001); - // Watch for transactions paying to me - BOOST_FOREACH(const CTransaction& tx, block.vtx) - g_signals.SyncTransaction(tx, &block); - // Watch for changes to the previous coinbase transaction. static uint256 hashPrevBestCoinBase; g_signals.UpdatedTransaction(hashPrevBestCoinBase); diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 763615120a..7cd704193d 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -738,9 +738,7 @@ Value sendrawtransaction(const Array& params, bool fHelp) if (!fHaveMempool && !fHaveChain) { // push to local node and sync with wallets CValidationState state; - if (AcceptToMemoryPool(mempool, state, tx, false, NULL, !fOverrideFees)) - SyncWithWallets(tx, NULL); - else { + if (!AcceptToMemoryPool(mempool, state, tx, false, NULL, !fOverrideFees)) { if(state.IsInvalid()) throw JSONRPCError(RPC_TRANSACTION_REJECTED, strprintf("%i: %s", state.GetRejectCode(), state.GetRejectReason())); else From cb5fa86f42c721cb41e043e0b4e5effc8a0d4af5 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 17 Aug 2014 23:46:22 +0200 Subject: [PATCH 0540/1288] [Qt] Revert overviewpage from QFormLayout to QVBoxLayout --- src/qt/forms/overviewpage.ui | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui index 7784a862d7..53d416ef38 100644 --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -13,8 +13,8 @@ Form - - + + false @@ -30,7 +30,7 @@ - + From 88fe88cf3640caede5222380383d0816a42a73b7 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 18 Aug 2014 10:25:26 +0200 Subject: [PATCH 0541/1288] gui: remove redundant numTransactions tracking This number was still tracked even though it's shown nowhere in the UI anymore. It was originally removed because it didn't match the actual number of records in the view (which contains outputs, not transactions) thus was confusing people. --- src/qt/walletmodel.cpp | 20 -------------------- src/qt/walletmodel.h | 5 ----- 2 files changed, 25 deletions(-) diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 0ad123f39d..c5f8fb6a9c 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -31,7 +31,6 @@ WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *p transactionTableModel(0), recentRequestsTableModel(0), cachedBalance(0), cachedUnconfirmedBalance(0), cachedImmatureBalance(0), - cachedNumTransactions(0), cachedEncryptionStatus(Unencrypted), cachedNumBlocks(0) { @@ -96,18 +95,6 @@ qint64 WalletModel::getWatchImmatureBalance() const return wallet->GetImmatureWatchOnlyBalance(); } -int WalletModel::getNumTransactions() const -{ - int numTransactions = 0; - { - LOCK(wallet->cs_wallet); - // the size of mapWallet contains the number of unique transaction IDs - // (e.g. payments to yourself generate 2 transactions, but both share the same transaction ID) - numTransactions = wallet->mapWallet.size(); - } - return numTransactions; -} - void WalletModel::updateStatus() { EncryptionStatus newEncryptionStatus = getEncryptionStatus(); @@ -169,13 +156,6 @@ void WalletModel::updateTransaction(const QString &hash, int status) // Balance and number of transactions might have changed checkBalanceChanged(); - - int newNumTransactions = getNumTransactions(); - if(cachedNumTransactions != newNumTransactions) - { - cachedNumTransactions = newNumTransactions; - emit numTransactionsChanged(newNumTransactions); - } } void WalletModel::updateAddressBook(const QString &address, const QString &label, diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 2bb91d85a9..2a74a6aa79 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -131,7 +131,6 @@ public: qint64 getWatchBalance() const; qint64 getWatchUnconfirmedBalance() const; qint64 getWatchImmatureBalance() const; - int getNumTransactions() const; EncryptionStatus getEncryptionStatus() const; bool processingQueuedTransactions() { return fProcessingQueuedTransactions; } @@ -214,7 +213,6 @@ private: qint64 cachedWatchOnlyBalance; qint64 cachedWatchUnconfBalance; qint64 cachedWatchImmatureBalance; - qint64 cachedNumTransactions; EncryptionStatus cachedEncryptionStatus; int cachedNumBlocks; @@ -229,9 +227,6 @@ signals: void balanceChanged(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance, qint64 watchOnlyBalance, qint64 watchUnconfBalance, qint64 watchImmatureBalance); - // Number of transactions in wallet changed - void numTransactionsChanged(int count); - // Encryption status of wallet changed void encryptionStatusChanged(int status); From bd45b1abd31ff75461407c7fe904b9e924dc576a Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 18 Aug 2014 12:57:08 +0200 Subject: [PATCH 0542/1288] doc: Remove outdated information about boost versions Bitcoin core should work with any remotely recent boost version if a proper build environment is present. Remove a confusing comment from the build documentation. --- doc/build-unix.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/doc/build-unix.md b/doc/build-unix.md index 0f381d56c5..56054456a3 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -76,10 +76,6 @@ for Ubuntu 12.04 and later: Ubuntu 12.04 and later have packages for libdb5.1-dev and libdb5.1++-dev, but using these will break binary wallet compatibility, and is not recommended. -for Ubuntu 13.10: - libboost1.54 will not work, - remove libboost1.54-all-dev and install libboost1.53-all-dev instead. - for Debian 7 (Wheezy) and later: The oldstable repository contains db4.8 packages. Add the following line to /etc/apt/sources.list, From aa8279513b5d206c172d3da3d5e3034c61d47b39 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 30 Jul 2014 15:35:14 +0200 Subject: [PATCH 0543/1288] Add detailed network info to getnetworkinfo RPC This commit adds per-network information to the getnetworkinfo RPC call: - Is the network limited? - Is the network reachable - Which proxy is used for this network, if any Inspired by #2575. --- src/init.cpp | 2 +- src/rpcnet.cpp | 33 ++++++++++++++++++++++++++++----- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index a908169cd9..b20b940b86 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -248,7 +248,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -maxreceivebuffer= " + _("Maximum per-connection receive buffer, *1000 bytes (default: 5000)") + "\n"; strUsage += " -maxsendbuffer= " + _("Maximum per-connection send buffer, *1000 bytes (default: 1000)") + "\n"; strUsage += " -onion= " + _("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy)") + "\n"; - strUsage += " -onlynet= " + _("Only connect to nodes in network (IPv4, IPv6 or Onion)") + "\n"; + strUsage += " -onlynet= " + _("Only connect to nodes in network (ipv4, ipv6 or onion)") + "\n"; strUsage += " -permitbaremultisig " + _("Relay non-P2SH multisig (default: 1)") + "\n"; strUsage += " -port= " + _("Listen for connections on (default: 8333 or testnet: 18333)") + "\n"; strUsage += " -proxy= " + _("Connect through SOCKS5 proxy") + "\n"; diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 88e7c4ab07..2baa481c4e 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -338,6 +338,26 @@ Value getnettotals(const Array& params, bool fHelp) return obj; } +static Array GetNetworksInfo() +{ + Array networks; + for(int n=0; n(n); + if(network == NET_UNROUTABLE) + continue; + proxyType proxy; + Object obj; + GetProxy(network, proxy); + obj.push_back(Pair("name", GetNetworkName(network))); + obj.push_back(Pair("limited", IsLimited(network))); + obj.push_back(Pair("reachable", IsReachable(network))); + obj.push_back(Pair("proxy", proxy.IsValid() ? proxy.ToStringIPPort() : string())); + networks.push_back(obj); + } + return networks; +} + Value getnetworkinfo(const Array& params, bool fHelp) { if (fHelp || params.size() != 0) @@ -351,7 +371,13 @@ Value getnetworkinfo(const Array& params, bool fHelp) " \"localservices\": \"xxxxxxxxxxxxxxxx\", (string) the services we offer to the network\n" " \"timeoffset\": xxxxx, (numeric) the time offset\n" " \"connections\": xxxxx, (numeric) the number of connections\n" - " \"proxy\": \"host:port\", (string, optional) the proxy used by the server\n" + " \"networks\": [ (array) information per network\n" + " \"name\": \"xxx\", (string) network (ipv4, ipv6 or onion)\n" + " \"limited\": xxx, (boolean) is the network limited using -onlynet?\n" + " \"reachable\": xxx, (boolean) is the network reachable?\n" + " \"proxy\": \"host:port\" (string) the proxy that is used for this network, or empty if none\n" + " },\n" + " ],\n" " \"relayfee\": x.xxxx, (numeric) minimum relay fee for non-free transactions in btc/kb\n" " \"localaddresses\": [, (array) list of local addresses\n" " \"address\": \"xxxx\", (string) network address\n" @@ -364,16 +390,13 @@ Value getnetworkinfo(const Array& params, bool fHelp) + HelpExampleRpc("getnetworkinfo", "") ); - proxyType proxy; - GetProxy(NET_IPV4, proxy); - Object obj; obj.push_back(Pair("version", (int)CLIENT_VERSION)); obj.push_back(Pair("protocolversion",(int)PROTOCOL_VERSION)); obj.push_back(Pair("localservices", strprintf("%016x", nLocalServices))); obj.push_back(Pair("timeoffset", GetTimeOffset())); obj.push_back(Pair("connections", (int)vNodes.size())); - obj.push_back(Pair("proxy", (proxy.IsValid() ? proxy.ToStringIPPort() : string()))); + obj.push_back(Pair("networks", GetNetworksInfo())); obj.push_back(Pair("relayfee", ValueFromAmount(::minRelayTxFee.GetFeePerK()))); Array localAddresses; { From e4731dd85cc0c75046a6e3681506aed3d522f6ce Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 18 Aug 2014 16:18:39 +0200 Subject: [PATCH 0544/1288] qt: Use quint64 for formatServicesStr `uint64_t` was causing a build error on some systems, as that type is not known after including just the Qt headers. --- src/qt/guiutil.cpp | 2 +- src/qt/guiutil.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 389a08d9e8..304177ee11 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -810,7 +810,7 @@ QString formatDurationStr(int secs) return strList.join(" "); } -QString formatServicesStr(uint64_t mask) +QString formatServicesStr(quint64 mask) { QStringList strList; diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 0ae5154d4b..67e11e59a0 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -180,7 +180,7 @@ namespace GUIUtil QString formatDurationStr(int secs); /* Format CNodeStats.nServices bitmask into a user-readable string */ - QString formatServicesStr(uint64_t mask); + QString formatServicesStr(quint64 mask); /* Format a CNodeCombinedStats.dPingTime into a user-readable string or display N/A, if 0*/ QString formatPingTime(double dPingTime); From 3cceba7abb22133fcaea8d4f7aaed345f0e48009 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Mon, 18 Aug 2014 10:36:21 -0400 Subject: [PATCH 0545/1288] Univalue: Do not build JSON escape list at runtime No need to waste startup time building something that can be done at compile time. This also resolves a clang++ warning originally reported in #4714, univalue/univalue_write.cpp:33:12: warning: array subscript is of type 'char escapes['"'] = "\\""; ^~~~ etc. --- .gitignore | 2 + src/Makefile.am | 1 + src/univalue/gen.cpp | 78 ++++++++++ src/univalue/univalue_escapes.h | 262 ++++++++++++++++++++++++++++++++ src/univalue/univalue_write.cpp | 21 +-- 5 files changed, 344 insertions(+), 20 deletions(-) create mode 100644 src/univalue/gen.cpp create mode 100644 src/univalue/univalue_escapes.h diff --git a/.gitignore b/.gitignore index e21ea92552..25c0dff660 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,8 @@ src/m4/ltsugar.m4 src/m4/ltversion.m4 src/m4/lt~obsolete.m4 +src/univalue/gen + src/qt/*.moc src/qt/moc_*.cpp src/qt/forms/ui_*.h diff --git a/src/Makefile.am b/src/Makefile.am index eda20ad296..1442c3d668 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -187,6 +187,7 @@ univalue_libbitcoin_univalue_a_SOURCES = \ univalue/univalue.cpp \ univalue/univalue_read.cpp \ univalue/univalue_write.cpp \ + univalue/univalue_escapes.h \ univalue/univalue.h # common: shared between bitcoind, and bitcoin-qt and non-server tools diff --git a/src/univalue/gen.cpp b/src/univalue/gen.cpp new file mode 100644 index 0000000000..881948f46e --- /dev/null +++ b/src/univalue/gen.cpp @@ -0,0 +1,78 @@ +// Copyright 2014 BitPay Inc. +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +// +// To re-create univalue_escapes.h: +// $ g++ -o gen gen.cpp +// $ ./gen > univalue_escapes.h +// + +#include +#include +#include +#include "univalue.h" + +using namespace std; + +static bool initEscapes; +static const char *escapes[256]; + +static void initJsonEscape() +{ + escapes[(int)'"'] = "\\\""; + escapes[(int)'\\'] = "\\\\"; + escapes[(int)'/'] = "\\/"; + escapes[(int)'\b'] = "\\b"; + escapes[(int)'\f'] = "\\f"; + escapes[(int)'\n'] = "\\n"; + escapes[(int)'\r'] = "\\r"; + escapes[(int)'\t'] = "\\t"; + + initEscapes = true; +} + +static void outputEscape() +{ + printf( "// Automatically generated file. Do not modify.\n" + "#ifndef __UNIVALUE_ESCAPES_H__\n" + "#define __UNIVALUE_ESCAPES_H__\n" + "static const char *escapes[256] = {\n"); + + for (unsigned int i = 0; i < 256; i++) { + if (!escapes[i]) { + printf("\tNULL,\n"); + } else { + printf("\t\""); + + unsigned int si; + for (si = 0; si < strlen(escapes[i]); si++) { + char ch = escapes[i][si]; + switch (ch) { + case '"': + printf("\\\""); + break; + case '\\': + printf("\\\\"); + break; + default: + printf("%c", escapes[i][si]); + break; + } + } + + printf("\",\n"); + } + } + + printf( "};\n" + "#endif // __UNIVALUE_ESCAPES_H__\n"); +} + +int main (int argc, char *argv[]) +{ + initJsonEscape(); + outputEscape(); + return 0; +} + diff --git a/src/univalue/univalue_escapes.h b/src/univalue/univalue_escapes.h new file mode 100644 index 0000000000..1d3a70a968 --- /dev/null +++ b/src/univalue/univalue_escapes.h @@ -0,0 +1,262 @@ +// Automatically generated file. Do not modify. +#ifndef __UNIVALUE_ESCAPES_H__ +#define __UNIVALUE_ESCAPES_H__ +static const char *escapes[256] = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + "\\b", + "\\t", + "\\n", + NULL, + "\\f", + "\\r", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + "\\\"", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + "\\/", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + "\\\\", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, +}; +#endif // __UNIVALUE_ESCAPES_H__ diff --git a/src/univalue/univalue_write.cpp b/src/univalue/univalue_write.cpp index 1818f5c6f9..70762a1ef1 100644 --- a/src/univalue/univalue_write.cpp +++ b/src/univalue/univalue_write.cpp @@ -5,33 +5,14 @@ #include #include #include "univalue.h" +#include "univalue_escapes.h" // TODO: Using UTF8 using namespace std; -static bool initEscapes; -static const char *escapes[256]; - -static void initJsonEscape() -{ - escapes['"'] = "\\\""; - escapes['\\'] = "\\\\"; - escapes['/'] = "\\/"; - escapes['\b'] = "\\b"; - escapes['\f'] = "\\f"; - escapes['\n'] = "\\n"; - escapes['\r'] = "\\r"; - escapes['\t'] = "\\t"; - - initEscapes = true; -} - static string json_escape(const string& inS) { - if (!initEscapes) - initJsonEscape(); - string outS; outS.reserve(inS.size() * 2); From fad23a210bc61c784af0be4fc32cda6b75a4619b Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 18 Aug 2014 14:01:06 +0200 Subject: [PATCH 0546/1288] Revert "build: add option for reducing exports" Revert #4663 for now. It still breaks the pulltester. This reverts commit 4975ae1722cd8af63eda2f02ef64a98091b6fb58. Conflicts: configure.ac --- configure.ac | 77 ------------------------------------- src/Makefile.am | 3 -- src/Makefile.qt.include | 2 +- src/Makefile.qttest.include | 2 +- src/Makefile.test.include | 1 - 5 files changed, 2 insertions(+), 83 deletions(-) diff --git a/configure.ac b/configure.ac index fc1f7c51ca..7db6ebac0e 100644 --- a/configure.ac +++ b/configure.ac @@ -90,12 +90,6 @@ AC_ARG_ENABLE([hardening], [use_hardening=$enableval], [use_hardening=yes]) -AC_ARG_ENABLE([reduce-exports], - [AS_HELP_STRING([--enable-reduce-exports], - [attempt to reduce exported symbols in the resulting executables (default is yes)])], - [use_reduce_exports=$enableval], - [use_reduce_exports=auto]) - AC_ARG_ENABLE([ccache], [AS_HELP_STRING([--enable-ccache], [use ccache for building (default is yes if ccache is found)])], @@ -402,40 +396,6 @@ AC_TRY_COMPILE([#include ], AC_SEARCH_LIBS([clock_gettime],[rt]) -AC_MSG_CHECKING([for visibility attribute]) -AC_LINK_IFELSE([AC_LANG_SOURCE([ - int foo_def( void ) __attribute__((visibility("default"))); - int main(){} - ])], - [ - AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE,1,[Define if the visibility attribute is supported.]) - AC_MSG_RESULT(yes) - ], - [ - AC_MSG_RESULT(no) - if test x$use_reduce_exports = xyes; then - AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduced-exports.]) - fi - AC_MSG_WARN([Cannot find a working visibility attribute. Disabling reduced exports.]) - use_reduce_exports=no - ] -) - -if test x$use_reduce_exports != xno; then - AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"], - [ - if test x$use_reduce_exports = xyes; then - AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduced-exports.]) - fi - AC_MSG_WARN([Cannot set default symbol visibility. Disabling reduced exports.]) - use_reduce_exports=no - ]) - if test x$use_reduce_exports != xno; then - AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]], [RELDFLAGS="-Wl,--exclude-libs,ALL"]) - CXXFLAGS="$CXXFLAGS $RE_CXXFLAGS" - fi -fi - LEVELDB_CPPFLAGS= LIBLEVELDB= LIBMEMENV= @@ -460,35 +420,6 @@ fi dnl Check for boost libs AX_BOOST_BASE - -if test x$use_reduce_exports != xno; then - AC_MSG_CHECKING([for working boost reduced exports]) - TEMP_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS" - AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ - @%:@include - ]], [[ - #if BOOST_VERSION >= 104900 - // Everything is okay - #else - # error Boost version is too old - #endif - ]])],[ - AC_MSG_RESULT(yes) - ],[: - if test x$use_reduce_exports = xauto; then - use_reduce_exports=no - else - if test x$use_reduce_exports = xyes; then - AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduced-exports.]) - fi - fi - AC_MSG_RESULT(no) - AC_MSG_WARN([boost versions < 1.49 are known to have symbol visibility issues. Disabling reduced exports.]) - ]) - CPPFLAGS="$TEMP_CPPFLAGS" -fi - AX_BOOST_SYSTEM AX_BOOST_FILESYSTEM AX_BOOST_PROGRAM_OPTIONS @@ -741,13 +672,6 @@ else AC_MSG_RESULT([no]) fi -AC_MSG_CHECKING([whether to reduce exports]) -if test x$use_reduce_exports != xno; then - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi - if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests = xnononono; then AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-daemon --with-gui or --enable-tests]) fi @@ -780,7 +704,6 @@ AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE) AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR) -AC_SUBST(RELDFLAGS) AC_SUBST(LIBTOOL_LDFLAGS) AC_SUBST(USE_UPNP) AC_SUBST(USE_QRCODE) diff --git a/src/Makefile.am b/src/Makefile.am index 1bb59bce7b..6292b5d613 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -261,7 +261,6 @@ endif bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES) -bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) # bitcoin-cli binary # bitcoin_cli_LDADD = \ @@ -299,12 +298,10 @@ endif bitcoin_tx_SOURCES = bitcoin-tx.cpp bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES) # -bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) if TARGET_WINDOWS bitcoin_cli_SOURCES += bitcoin-cli-res.rc endif -bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 28d7053fc4..9a333d5c76 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -362,7 +362,7 @@ qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) if USE_LIBSECP256K1 qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la endif -qt_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) +qt_bitcoin_qt_LDFLAGS = $(AM_LDFLAGS) $(QT_LDFLAGS) #locale/foo.ts -> locale/foo.qm QT_QM=$(QT_TS:.ts=.qm) diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 2cba5b7e1e..ee8edb994e 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -36,7 +36,7 @@ qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBIT if USE_LIBSECP256K1 qt_test_test_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la endif -qt_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) +qt_test_test_bitcoin_qt_LDFLAGS = $(AM_LDFLAGS) $(QT_LDFLAGS) CLEAN_BITCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno diff --git a/src/Makefile.test.include b/src/Makefile.test.include index b54c9be664..b5fee08223 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -75,7 +75,6 @@ if USE_LIBSECP256K1 endif test_test_bitcoin_LDADD += $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) -test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES) From 8695a39350cd9fd403c1bb1ca725535b591f82f9 Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Fri, 15 Aug 2014 22:56:45 +0200 Subject: [PATCH 0547/1288] replace int with size_t in stream methods Thus the read(...) and write(...) methods of all stream classes now have identical parameter lists. This will bring these classes one step closer to a common interface. --- src/serialize.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/serialize.h b/src/serialize.h index 2eb69b3ec0..3e5eff469d 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -68,7 +68,7 @@ inline const T* end_ptr(const std::vector& v) ///////////////////////////////////////////////////////////////// // // Templates for serializing to anything that looks like a stream, -// i.e. anything that supports .read(char*, int) and .write(char*, int) +// i.e. anything that supports .read(char*, size_t) and .write(char*, size_t) // enum @@ -876,7 +876,7 @@ public: CSizeComputer(int nTypeIn, int nVersionIn) : nSize(0), nType(nTypeIn), nVersion(nVersionIn) {} - CSizeComputer& write(const char *psz, int nSize) + CSizeComputer& write(const char *psz, size_t nSize) { this->nSize += nSize; return *this; @@ -1105,10 +1105,9 @@ public: void ReadVersion() { *this >> nVersion; } void WriteVersion() { *this << nVersion; } - CDataStream& read(char* pch, int nSize) + CDataStream& read(char* pch, size_t nSize) { // Read from the beginning of the buffer - assert(nSize >= 0); unsigned int nReadPosNext = nReadPos + nSize; if (nReadPosNext >= vch.size()) { @@ -1145,10 +1144,9 @@ public: return (*this); } - CDataStream& write(const char* pch, int nSize) + CDataStream& write(const char* pch, size_t nSize) { // Write to the end of the buffer - assert(nSize >= 0); vch.insert(vch.end(), pch, pch + nSize); return (*this); } From e432a5f08d75480753cf3cf81d656f0e1dd4da79 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 18 Aug 2014 15:55:54 -0400 Subject: [PATCH 0548/1288] build: add option for reducing exports (v2) This was committed previously as 4975ae172 and reverted, because the flags were applied even if the checks didn't pass. This is the same commit, fixed up to actually disable the functionality when necessary. Enabled automatically if boost >= 1.49. See: https://svn.boost.org/trac/boost/ticket/2309 Also, check for a default visibility attribute, so that we can mark future api functions correctly. --- configure.ac | 78 +++++++++++++++++++++++++++++++++++++ src/Makefile.am | 3 ++ src/Makefile.qt.include | 2 +- src/Makefile.qttest.include | 2 +- src/Makefile.test.include | 1 + 5 files changed, 84 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 7db6ebac0e..601ccf0a79 100644 --- a/configure.ac +++ b/configure.ac @@ -90,6 +90,12 @@ AC_ARG_ENABLE([hardening], [use_hardening=$enableval], [use_hardening=yes]) +AC_ARG_ENABLE([reduce-exports], + [AS_HELP_STRING([--enable-reduce-exports], + [attempt to reduce exported symbols in the resulting executables (default is yes)])], + [use_reduce_exports=$enableval], + [use_reduce_exports=auto]) + AC_ARG_ENABLE([ccache], [AS_HELP_STRING([--enable-ccache], [use ccache for building (default is yes if ccache is found)])], @@ -396,6 +402,36 @@ AC_TRY_COMPILE([#include ], AC_SEARCH_LIBS([clock_gettime],[rt]) +AC_MSG_CHECKING([for visibility attribute]) +AC_LINK_IFELSE([AC_LANG_SOURCE([ + int foo_def( void ) __attribute__((visibility("default"))); + int main(){} + ])], + [ + AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE,1,[Define if the visibility attribute is supported.]) + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_RESULT(no) + if test x$use_reduce_exports = xyes; then + AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduced-exports.]) + fi + AC_MSG_WARN([Cannot find a working visibility attribute. Disabling reduced exports.]) + use_reduce_exports=no + ] +) + +if test x$use_reduce_exports != xno; then + AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"], + [ + if test x$use_reduce_exports = xyes; then + AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduced-exports.]) + fi + AC_MSG_WARN([Cannot set default symbol visibility. Disabling reduced exports.]) + use_reduce_exports=no + ]) +fi + LEVELDB_CPPFLAGS= LIBLEVELDB= LIBMEMENV= @@ -426,6 +462,40 @@ AX_BOOST_PROGRAM_OPTIONS AX_BOOST_THREAD AX_BOOST_CHRONO + +if test x$use_reduce_exports != xno; then + AC_MSG_CHECKING([for working boost reduced exports]) + TEMP_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS" + AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ + @%:@include + ]], [[ + #if BOOST_VERSION >= 104900 + // Everything is okay + #else + # error Boost version is too old + #endif + ]])],[ + AC_MSG_RESULT(yes) + ],[: + if test x$use_reduce_exports = xauto; then + use_reduce_exports=no + else + if test x$use_reduce_exports = xyes; then + AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduced-exports.]) + fi + fi + AC_MSG_RESULT(no) + AC_MSG_WARN([boost versions < 1.49 are known to have symbol visibility issues. Disabling reduced exports.]) + ]) + CPPFLAGS="$TEMP_CPPFLAGS" +fi + +if test x$use_reduce_exports != xno; then + CXXFLAGS="$CXXFLAGS $RE_CXXFLAGS" + AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]], [RELDFLAGS="-Wl,--exclude-libs,ALL"]) +fi + if test x$use_tests = xyes; then if test x$HEXDUMP = x; then @@ -672,6 +742,13 @@ else AC_MSG_RESULT([no]) fi +AC_MSG_CHECKING([whether to reduce exports]) +if test x$use_reduce_exports != xno; then + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests = xnononono; then AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-daemon --with-gui or --enable-tests]) fi @@ -704,6 +781,7 @@ AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE) AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR) +AC_SUBST(RELDFLAGS) AC_SUBST(LIBTOOL_LDFLAGS) AC_SUBST(USE_UPNP) AC_SUBST(USE_QRCODE) diff --git a/src/Makefile.am b/src/Makefile.am index 6292b5d613..1bb59bce7b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -261,6 +261,7 @@ endif bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES) +bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) # bitcoin-cli binary # bitcoin_cli_LDADD = \ @@ -298,10 +299,12 @@ endif bitcoin_tx_SOURCES = bitcoin-tx.cpp bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES) # +bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) if TARGET_WINDOWS bitcoin_cli_SOURCES += bitcoin-cli-res.rc endif +bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 9a333d5c76..28d7053fc4 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -362,7 +362,7 @@ qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) if USE_LIBSECP256K1 qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la endif -qt_bitcoin_qt_LDFLAGS = $(AM_LDFLAGS) $(QT_LDFLAGS) +qt_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) #locale/foo.ts -> locale/foo.qm QT_QM=$(QT_TS:.ts=.qm) diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index ee8edb994e..2cba5b7e1e 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -36,7 +36,7 @@ qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBIT if USE_LIBSECP256K1 qt_test_test_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la endif -qt_test_test_bitcoin_qt_LDFLAGS = $(AM_LDFLAGS) $(QT_LDFLAGS) +qt_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) CLEAN_BITCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno diff --git a/src/Makefile.test.include b/src/Makefile.test.include index b5fee08223..b54c9be664 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -75,6 +75,7 @@ if USE_LIBSECP256K1 endif test_test_bitcoin_LDADD += $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) +test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES) From 3a56de7fc318a45a7096cd318e2f2d7f8124ce24 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Mon, 18 Aug 2014 16:50:39 -0400 Subject: [PATCH 0549/1288] addrman: Do not propagate obviously poor addresses onto the network --- src/addrman.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/addrman.cpp b/src/addrman.cpp index 3628af2eab..704766dbf8 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -492,17 +492,23 @@ int CAddrMan::Check_() void CAddrMan::GetAddr_(std::vector &vAddr) { - int nNodes = ADDRMAN_GETADDR_MAX_PCT*vRandom.size()/100; + unsigned int nNodes = ADDRMAN_GETADDR_MAX_PCT * vRandom.size() / 100; if (nNodes > ADDRMAN_GETADDR_MAX) nNodes = ADDRMAN_GETADDR_MAX; - // perform a random shuffle over the first nNodes elements of vRandom (selecting from all) - for (int n = 0; n= nNodes) + break; + int nRndPos = GetRandInt(vRandom.size() - n) + n; SwapRandom(n, nRndPos); assert(mapInfo.count(vRandom[n]) == 1); - vAddr.push_back(mapInfo[vRandom[n]]); + + const CAddrInfo& ai = mapInfo[vRandom[n]]; + if (!ai.IsTerrible()) + vAddr.push_back(ai); } } From 01094bd01f5d999b7da698c0e655cf723afa8ebb Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 19 Aug 2014 14:40:11 +0200 Subject: [PATCH 0550/1288] Don't reveal whether password is <20 or >20 characters in RPC As discussed on IRC. It seems bad to base a decision to delay based on the password length, as it leaks a small amount of information. --- src/rpcserver.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 3b51c91e7c..524627e2de 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -849,11 +849,10 @@ static bool HTTPReq_JSONRPC(AcceptedConnection *conn, if (!HTTPAuthorized(mapHeaders)) { LogPrintf("ThreadRPCServer incorrect password attempt from %s\n", conn->peer_address_to_string()); - /* Deter brute-forcing short passwords. + /* Deter brute-forcing If this results in a DoS the user really shouldn't have their RPC port exposed. */ - if (mapArgs["-rpcpassword"].size() < 20) - MilliSleep(250); + MilliSleep(250); conn->stream() << HTTPError(HTTP_UNAUTHORIZED, false) << std::flush; return false; From d789386371699fee14bb5e444507a6067293ff67 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 19 Aug 2014 10:28:58 -0400 Subject: [PATCH 0551/1288] Add "it works" test for bitcoin-tx --- .gitignore | 1 + src/Makefile.test.include | 9 ++++++- src/test/bctest.py | 35 ++++++++++++++++++++++++++++ src/test/bitcoin-util-test.py | 12 ++++++++++ src/test/data/bitcoin-util-test.json | 5 ++++ src/test/data/blanktx.hex | 1 + 6 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 src/test/bctest.py create mode 100755 src/test/bitcoin-util-test.py create mode 100644 src/test/data/bitcoin-util-test.json create mode 100644 src/test/data/blanktx.hex diff --git a/.gitignore b/.gitignore index 25c0dff660..24af4cb72e 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,7 @@ src/qt/test/moc*.cpp *.bak *.rej *.orig +*.pyc *.o *.o-* *.patch diff --git a/src/Makefile.test.include b/src/Makefile.test.include index b54c9be664..7e25430e3e 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -1,8 +1,15 @@ -TESTS += test/test_bitcoin +TESTS += test/test_bitcoin test/bitcoin-util-test.py bin_PROGRAMS += test/test_bitcoin TEST_SRCDIR = test TEST_BINARY=test/test_bitcoin$(EXEEXT) + +EXTRA_DIST += \ + test/bctest.py \ + test/bitcoin-util-test.py \ + test/data/bitcoin-util-test.json \ + test/data/blanktx.hex + JSON_TEST_FILES = \ test/data/script_valid.json \ test/data/base58_keys_valid.json \ diff --git a/src/test/bctest.py b/src/test/bctest.py new file mode 100644 index 0000000000..3b17acb75e --- /dev/null +++ b/src/test/bctest.py @@ -0,0 +1,35 @@ +# Copyright 2014 BitPay, Inc. +# Distributed under the MIT/X11 software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +import subprocess +import os +import json +import sys + +def bctest(testDir, testObj): + execargs = testObj['exec'] + outputFn = testObj['output_cmp'] + outputData = open(testDir + "/" + outputFn).read() + + proc = subprocess.Popen(execargs, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + try: + outs = proc.communicate() + except OSError: + print("OSError, Failed to execute " + execargs[0]) + sys.exit(1) + + if outs[0] != outputData: + print("Output data mismatch for " + outputFn) + sys.exit(1) + +def bctester(testDir, input_basename): + input_filename = testDir + "/" + input_basename + raw_data = open(input_filename).read() + input_data = json.loads(raw_data) + + for testObj in input_data: + bctest(testDir, testObj) + + sys.exit(0) + diff --git a/src/test/bitcoin-util-test.py b/src/test/bitcoin-util-test.py new file mode 100755 index 0000000000..40690c2fed --- /dev/null +++ b/src/test/bitcoin-util-test.py @@ -0,0 +1,12 @@ +#!/usr/bin/python +# Copyright 2014 BitPay, Inc. +# Distributed under the MIT/X11 software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +import os +import bctest + +if __name__ == '__main__': + bctest.bctester(os.environ["srcdir"] + "/test/data", + "bitcoin-util-test.json") + diff --git a/src/test/data/bitcoin-util-test.json b/src/test/data/bitcoin-util-test.json new file mode 100644 index 0000000000..af29fd75a5 --- /dev/null +++ b/src/test/data/bitcoin-util-test.json @@ -0,0 +1,5 @@ +[ + { "exec": ["./bitcoin-tx", "-create"], + "output_cmp": "blanktx.hex" + } +] diff --git a/src/test/data/blanktx.hex b/src/test/data/blanktx.hex new file mode 100644 index 0000000000..36b6f00fb6 --- /dev/null +++ b/src/test/data/blanktx.hex @@ -0,0 +1 @@ +01000000000000000000 From fb14452c6cadb8d977c405dddb0a94115250d7c4 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Mon, 18 Aug 2014 23:14:29 -0400 Subject: [PATCH 0552/1288] bitcoin-tx: Accept input via stdin. Add input handling to tests. --- src/bitcoin-tx.cpp | 28 ++++++++++++++++++++++++++-- src/test/bctest.py | 12 ++++++++++-- src/test/data/bitcoin-util-test.json | 4 ++++ 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index ffe87298f6..6cd2768d70 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -13,6 +13,7 @@ #include #include +#include using namespace std; using namespace boost::assign; @@ -501,13 +502,34 @@ static void OutputTx(const CTransaction& tx) OutputTxHex(tx); } +static string readStdin() +{ + char buf[4096]; + string ret; + + while (!feof(stdin)) { + size_t bread = fread(buf, 1, sizeof(buf), stdin); + ret.append(buf, bread); + if (bread < sizeof(buf)) + break; + } + + if (ferror(stdin)) + throw runtime_error("error reading stdin"); + + boost::algorithm::trim_right(ret); + + return ret; +} + static int CommandLineRawTx(int argc, char* argv[]) { string strPrint; int nRet = 0; try { - // Skip switches - while (argc > 1 && IsSwitchChar(argv[1][0])) { + // Skip switches; Permit common stdin convention "-" + while (argc > 1 && IsSwitchChar(argv[1][0]) && + (argv[1][1] != 0)) { argc--; argv++; } @@ -522,6 +544,8 @@ static int CommandLineRawTx(int argc, char* argv[]) // param: hex-encoded bitcoin transaction string strHexTx(argv[1]); + if (strHexTx == "-") // "-" implies standard input + strHexTx = readStdin(); if (!DecodeHexTx(txDecodeTmp, strHexTx)) throw runtime_error("invalid transaction encoding"); diff --git a/src/test/bctest.py b/src/test/bctest.py index 3b17acb75e..b126479083 100644 --- a/src/test/bctest.py +++ b/src/test/bctest.py @@ -9,12 +9,20 @@ import sys def bctest(testDir, testObj): execargs = testObj['exec'] + + stdinCfg = None + inputData = None + if "input" in testObj: + filename = testDir + "/" + testObj['input'] + inputData = open(filename).read() + stdinCfg = subprocess.PIPE + outputFn = testObj['output_cmp'] outputData = open(testDir + "/" + outputFn).read() - proc = subprocess.Popen(execargs, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + proc = subprocess.Popen(execargs, stdin=stdinCfg, stdout=subprocess.PIPE, stderr=subprocess.PIPE) try: - outs = proc.communicate() + outs = proc.communicate(input=inputData) except OSError: print("OSError, Failed to execute " + execargs[0]) sys.exit(1) diff --git a/src/test/data/bitcoin-util-test.json b/src/test/data/bitcoin-util-test.json index af29fd75a5..16bcb44898 100644 --- a/src/test/data/bitcoin-util-test.json +++ b/src/test/data/bitcoin-util-test.json @@ -1,5 +1,9 @@ [ { "exec": ["./bitcoin-tx", "-create"], "output_cmp": "blanktx.hex" + }, + { "exec": ["./bitcoin-tx", "-"], + "input": "blanktx.hex", + "output_cmp": "blanktx.hex" } ] From c53b1ece1b0644bd9620773eea3757bf939a678f Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Tue, 19 Aug 2014 13:47:37 -0400 Subject: [PATCH 0553/1288] Fix github-merge with git version 2.1.0 Running git version 2.1.0 on OSX (homebrew), I get fatal: '1q': not a non-negative integer I'm guessing git command-line parsing got more strict recently? --- contrib/devtools/github-merge.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/devtools/github-merge.sh b/contrib/devtools/github-merge.sh index e42b71a54a..3217a06195 100755 --- a/contrib/devtools/github-merge.sh +++ b/contrib/devtools/github-merge.sh @@ -49,11 +49,11 @@ fi # Initialize source branches. git checkout -q "$BRANCH" if git fetch -q "$HOST":"$REPO" "+refs/pull/$PULL/*:refs/heads/pull/$PULL/*"; then - if ! git log -1q "refs/heads/pull/$PULL/head" >/dev/null 2>&1; then + if ! git log -q -1 "refs/heads/pull/$PULL/head" >/dev/null 2>&1; then echo "ERROR: Cannot find head of pull request #$PULL on $HOST:$REPO." >&2 exit 3 fi - if ! git log -1q "refs/heads/pull/$PULL/merge" >/dev/null 2>&1; then + if ! git log -q -1 "refs/heads/pull/$PULL/merge" >/dev/null 2>&1; then echo "ERROR: Cannot find merge of pull request #$PULL on $HOST:$REPO." >&2 exit 3 fi From df4d61e681df49d121c308b30dcba556aa544d7e Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 19 Aug 2014 23:15:58 -0400 Subject: [PATCH 0554/1288] Add bitcoin-tx tests Testing: delin, delout, locktime, and basic createrawtransaction-like functionality. --- src/Makefile.test.include | 7 +++++- src/test/bctest.py | 16 +++++++++++--- src/test/data/bitcoin-util-test.json | 29 +++++++++++++++++++++++++ src/test/data/tt-delin1-out.hex | 1 + src/test/data/tt-delout1-out.hex | 1 + src/test/data/tt-locktime317000-out.hex | 1 + src/test/data/tx394b54bb.hex | 1 + src/test/data/txcreate1.hex | 1 + 8 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 src/test/data/tt-delin1-out.hex create mode 100644 src/test/data/tt-delout1-out.hex create mode 100644 src/test/data/tt-locktime317000-out.hex create mode 100644 src/test/data/tx394b54bb.hex create mode 100644 src/test/data/txcreate1.hex diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 7e25430e3e..0ddc66fa00 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -8,7 +8,12 @@ EXTRA_DIST += \ test/bctest.py \ test/bitcoin-util-test.py \ test/data/bitcoin-util-test.json \ - test/data/blanktx.hex + test/data/blanktx.hex \ + test/data/tt-delin1-out.hex \ + test/data/tt-delout1-out.hex \ + test/data/tt-locktime317000-out.hex \ + test/data/tx394b54bb.hex \ + test/data/txcreate1.hex JSON_TEST_FILES = \ test/data/script_valid.json \ diff --git a/src/test/bctest.py b/src/test/bctest.py index b126479083..1839f4fef4 100644 --- a/src/test/bctest.py +++ b/src/test/bctest.py @@ -17,8 +17,11 @@ def bctest(testDir, testObj): inputData = open(filename).read() stdinCfg = subprocess.PIPE - outputFn = testObj['output_cmp'] - outputData = open(testDir + "/" + outputFn).read() + outputFn = None + outputData = None + if "output_cmp" in testObj: + outputFn = testObj['output_cmp'] + outputData = open(testDir + "/" + outputFn).read() proc = subprocess.Popen(execargs, stdin=stdinCfg, stdout=subprocess.PIPE, stderr=subprocess.PIPE) try: @@ -27,10 +30,17 @@ def bctest(testDir, testObj): print("OSError, Failed to execute " + execargs[0]) sys.exit(1) - if outs[0] != outputData: + if outputData and (outs[0] != outputData): print("Output data mismatch for " + outputFn) sys.exit(1) + wantRC = 0 + if "return_code" in testObj: + wantRC = testObj['return_code'] + if proc.returncode != wantRC: + print("Return code mismatch for " + outputFn) + sys.exit(1) + def bctester(testDir, input_basename): input_filename = testDir + "/" + input_basename raw_data = open(input_filename).read() diff --git a/src/test/data/bitcoin-util-test.json b/src/test/data/bitcoin-util-test.json index 16bcb44898..7db87d7c11 100644 --- a/src/test/data/bitcoin-util-test.json +++ b/src/test/data/bitcoin-util-test.json @@ -5,5 +5,34 @@ { "exec": ["./bitcoin-tx", "-"], "input": "blanktx.hex", "output_cmp": "blanktx.hex" + }, + { "exec": ["./bitcoin-tx", "-", "delin=1"], + "input": "tx394b54bb.hex", + "output_cmp": "tt-delin1-out.hex" + }, + { "exec": ["./bitcoin-tx", "-", "delin=31"], + "input": "tx394b54bb.hex", + "return_code": 1 + }, + { "exec": ["./bitcoin-tx", "-", "delout=1"], + "input": "tx394b54bb.hex", + "output_cmp": "tt-delout1-out.hex" + }, + { "exec": ["./bitcoin-tx", "-", "delout=2"], + "input": "tx394b54bb.hex", + "return_code": 1 + }, + { "exec": ["./bitcoin-tx", "-", "locktime=317000"], + "input": "tx394b54bb.hex", + "output_cmp": "tt-locktime317000-out.hex" + }, + { "exec": + ["./bitcoin-tx", "-create", + "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0", + "in=bf829c6bcf84579331337659d31f89dfd138f7f7785802d5501c92333145ca7c:18", + "in=22a6f904655d53ae2ff70e701a0bbd90aa3975c0f40bfc6cc996a9049e31cdfc:1", + "outaddr=0.18:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o", + "outaddr=4:1P8yWvZW8jVihP1bzHeqfE4aoXNX8AVa46"], + "output_cmp": "txcreate1.hex" } ] diff --git a/src/test/data/tt-delin1-out.hex b/src/test/data/tt-delin1-out.hex new file mode 100644 index 0000000000..42ad840f43 --- /dev/null +++ b/src/test/data/tt-delin1-out.hex @@ -0,0 +1 @@ +0100000014fd5c23522d31761c50175453daa6edaabe47a602a592d39ce933d8271a1a87274c0100006c493046022100b4251ecd63778a3dde0155abe4cd162947620ae9ee45a874353551092325b116022100db307baf4ff3781ec520bd18f387948cedd15dc27bafe17c894b0fe6ffffcafa012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffc1b37ae964f605978022f94ce2f3f676d66a46d1aef7c2c17d6315b9697f2f75010000006a473044022079bd62ee09621a3be96b760c39e8ef78170101d46313923c6b07ae60a95c90670220238e51ea29fc70b04b65508450523caedbb11cb4dd5aa608c81487de798925ba0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffffedd005dc7790ef65c206abd1ab718e75252a40f4b1310e4102cd692eca9cacb0d10000006b48304502207722d6f9038673c86a1019b1c4de2d687ae246477cd4ca7002762be0299de385022100e594a11e3a313942595f7666dcf7078bcb14f1330f4206b95c917e7ec0e82fac012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffdf28d6e26fb7a85a1e6a229b972c1bae0edc1c11cb9ca51e4caf5e59fbea35a1000000006b483045022100a63a4788027b79b65c6f9d9e054f68cf3b4eed19efd82a2d53f70dcbe64683390220526f243671425b2bd05745fcf2729361f985cfe84ea80c7cfc817b93d8134374012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffffae2a2320a1582faa24469eff3024a6b98bfe00eb4f554d8a0b1421ba53bfd6a5010000006c493046022100b200ac6db16842f76dab9abe807ce423c992805879bc50abd46ed8275a59d9cf022100c0d518e85dd345b3c29dd4dc47b9a420d3ce817b18720e94966d2fe23413a408012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffb3cc5a12548aa1794b4d2bbf076838cfd7fbafb7716da51ee8221a4ff19c291b000000006b483045022100ededc441c3103a6f2bd6cab7639421af0f6ec5e60503bce1e603cf34f00aee1c02205cb75f3f519a13fb348783b21db3085cb5ec7552c59e394fdbc3e1feea43f967012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffff85145367313888d2cf2747274a32e20b2df074027bafd6f970003fcbcdf11d07150000006b483045022100d9eed5413d2a4b4b98625aa6e3169edc4fb4663e7862316d69224454e70cd8ca022061e506521d5ced51dd0ea36496e75904d756a4c4f9fb111568555075d5f68d9a012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff8292c11f6d35abab5bac3ebb627a4ff949e8ecd62d33ed137adf7aeb00e512b0090000006b48304502207e84b27139c4c19c828cb1e30c349bba88e4d9b59be97286960793b5ddc0a2af0221008cdc7a951e7f31c20953ed5635fbabf228e80b7047f32faaa0313e7693005177012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff883dcf9a86063db088ad064d0953258d4b0ff3425857402d2f3f839cee0f84581e0000006a4730440220426540dfed9c4ab5812e5f06df705b8bcf307dd7d20f7fa6512298b2a6314f420220064055096e3ca62f6c7352c66a5447767c53f946acdf35025ab3807ddb2fa404012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff6697dbb3ed98afe481b568459fa67e503f8a4254532465a670e54669d19c9fe6720000006a47304402200a5e673996f2fc88e21cc8613611f08a650bc0370338803591d85d0ec5663764022040b6664a0d1ec83a7f01975b8fde5232992b8ca58bf48af6725d2f92a936ab2e012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff023ffc2182517e1d3fa0896c5b0bd7b4d2ef8a1e42655abe2ced54f657125d59670000006c493046022100d93b30219c5735f673be5c3b4688366d96f545561c74cb62c6958c00f6960806022100ec8200adcb028f2184fa2a4f6faac7f8bb57cb4503bb7584ac11051fece31b3d012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff16f8c77166b0df3d7cc8b5b2ce825afbea9309ad7acd8e2461a255958f81fc06010000006b483045022100a13934e68d3f5b22b130c4cb33f4da468cffc52323a47fbfbe06b64858162246022047081e0a70ff770e64a2e2d31e5d520d9102268b57a47009a72fe73ec766901801210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff197b96f3c87a3adfaa17f63fddc2a738a690ca665439f9431dbbd655816c41fb000000006c49304602210097f1f35d5bdc1a3a60390a1b015b8e7c4f916aa3847aafd969e04975e15bbe70022100a9052eb25517d481f1fda1b129eb1b534da50ea1a51f3ee012dca3601c11b86a0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffff20d9a261ee27aa1bd92e7db2fdca935909a40b648e974cd24a10d63b68b94039dd0000006b483045022012b3138c591bf7154b6fef457f2c4a3c7162225003788ac0024a99355865ff13022100b71b125ae1ffb2e1d1571f580cd3ebc8cd049a2d7a8a41f138ba94aeb982106f012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff50f179d5d16cd872f9a63c26c448464ae9bd95cd9421c0476113b5d314571b71010000006b483045022100f834ccc8b22ee72712a3e5e6ef4acb8b2fb791b5385b70e2cd4332674d6667f4022024fbda0a997e0c253503f217501f508a4d56edce2c813ecdd9ad796dbeba907401210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff551b865d1568ac0a305e5f9c5dae6c540982334efbe789074318e0efc5b564631b0000006b48304502203b2fd1e39ae0e469d7a15768f262661b0de41470daf0fe8c4fd0c26542a0870002210081c57e331f9a2d214457d953e3542904727ee412c63028113635d7224da3dccc012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff57503e5a016189d407a721791459280875264f908ca2c5d4862c01386e7fb50b470400006b48304502206947a9c54f0664ece4430fd4ae999891dc50bb6126bc36b6a15a3189f29d25e9022100a86cfc4e2fdd9e39a20e305cfd1b76509c67b3e313e0f118229105caa0e823c9012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff3f16c1fb9d3e1a26d872933e955df85ee7f3f817711062b00b54a2144827349b250000006b483045022100c7128fe10b2d38744ae8177776054c29fc8ec13f07207723e70766ab7164847402201d2cf09009b9596de74c0183d1ab832e5edddb7a9965880bb400097e850850f8012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff4142a69d85b8498af214f0dd427b6ab29c240a0b8577e2944d37a7d8c05c6bb8140000006b48304502203b89a71628a28cc3703d170ca3be77786cff6b867e38a18b719705f8a326578f022100b2a9879e1acf621faa6466c207746a7f3eb4c8514c1482969aba3f2a957f1321012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff36e2feecc0a4bff7480015d42c12121932db389025ed0ac1d344ecee53230a3df20000006c493046022100ef794a8ef7fd6752d2a183c18866ff6e8dc0f5bd889a63e2c21cf303a6302461022100c1b09662d9e92988c3f9fcf17d1bcc79b5403647095d7212b9f8a1278a532d68012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff0260f73608000000001976a9148fd139bb39ced713f231c58a4d07bf6954d1c20188ac41420f00000000001976a9146c772e9cf96371bba3da8cb733da70a2fcf2007888ac00000000 diff --git a/src/test/data/tt-delout1-out.hex b/src/test/data/tt-delout1-out.hex new file mode 100644 index 0000000000..cc60c3fac6 --- /dev/null +++ b/src/test/data/tt-delout1-out.hex @@ -0,0 +1 @@ +0100000015fd5c23522d31761c50175453daa6edaabe47a602a592d39ce933d8271a1a87274c0100006c493046022100b4251ecd63778a3dde0155abe4cd162947620ae9ee45a874353551092325b116022100db307baf4ff3781ec520bd18f387948cedd15dc27bafe17c894b0fe6ffffcafa012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffcb4ed1baba3a1eb2171e00ddec8e5b72b346dd8c07f9c2b0d122d0d06bc92ea7000000006c493046022100a9b617843b68c284715d3e02fd120479cd0d96a6c43bf01e697fb0a460a21a3a022100ba0a12fbe8b993d4e7911fa3467615765dbe421ddf5c51b57a9c1ee19dcc00ba012103e633b4fa4ceb705c2da712390767199be8ef2448b3095dc01652e11b2b751505ffffffffc1b37ae964f605978022f94ce2f3f676d66a46d1aef7c2c17d6315b9697f2f75010000006a473044022079bd62ee09621a3be96b760c39e8ef78170101d46313923c6b07ae60a95c90670220238e51ea29fc70b04b65508450523caedbb11cb4dd5aa608c81487de798925ba0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffffedd005dc7790ef65c206abd1ab718e75252a40f4b1310e4102cd692eca9cacb0d10000006b48304502207722d6f9038673c86a1019b1c4de2d687ae246477cd4ca7002762be0299de385022100e594a11e3a313942595f7666dcf7078bcb14f1330f4206b95c917e7ec0e82fac012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffdf28d6e26fb7a85a1e6a229b972c1bae0edc1c11cb9ca51e4caf5e59fbea35a1000000006b483045022100a63a4788027b79b65c6f9d9e054f68cf3b4eed19efd82a2d53f70dcbe64683390220526f243671425b2bd05745fcf2729361f985cfe84ea80c7cfc817b93d8134374012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffffae2a2320a1582faa24469eff3024a6b98bfe00eb4f554d8a0b1421ba53bfd6a5010000006c493046022100b200ac6db16842f76dab9abe807ce423c992805879bc50abd46ed8275a59d9cf022100c0d518e85dd345b3c29dd4dc47b9a420d3ce817b18720e94966d2fe23413a408012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffb3cc5a12548aa1794b4d2bbf076838cfd7fbafb7716da51ee8221a4ff19c291b000000006b483045022100ededc441c3103a6f2bd6cab7639421af0f6ec5e60503bce1e603cf34f00aee1c02205cb75f3f519a13fb348783b21db3085cb5ec7552c59e394fdbc3e1feea43f967012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffff85145367313888d2cf2747274a32e20b2df074027bafd6f970003fcbcdf11d07150000006b483045022100d9eed5413d2a4b4b98625aa6e3169edc4fb4663e7862316d69224454e70cd8ca022061e506521d5ced51dd0ea36496e75904d756a4c4f9fb111568555075d5f68d9a012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff8292c11f6d35abab5bac3ebb627a4ff949e8ecd62d33ed137adf7aeb00e512b0090000006b48304502207e84b27139c4c19c828cb1e30c349bba88e4d9b59be97286960793b5ddc0a2af0221008cdc7a951e7f31c20953ed5635fbabf228e80b7047f32faaa0313e7693005177012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff883dcf9a86063db088ad064d0953258d4b0ff3425857402d2f3f839cee0f84581e0000006a4730440220426540dfed9c4ab5812e5f06df705b8bcf307dd7d20f7fa6512298b2a6314f420220064055096e3ca62f6c7352c66a5447767c53f946acdf35025ab3807ddb2fa404012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff6697dbb3ed98afe481b568459fa67e503f8a4254532465a670e54669d19c9fe6720000006a47304402200a5e673996f2fc88e21cc8613611f08a650bc0370338803591d85d0ec5663764022040b6664a0d1ec83a7f01975b8fde5232992b8ca58bf48af6725d2f92a936ab2e012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff023ffc2182517e1d3fa0896c5b0bd7b4d2ef8a1e42655abe2ced54f657125d59670000006c493046022100d93b30219c5735f673be5c3b4688366d96f545561c74cb62c6958c00f6960806022100ec8200adcb028f2184fa2a4f6faac7f8bb57cb4503bb7584ac11051fece31b3d012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff16f8c77166b0df3d7cc8b5b2ce825afbea9309ad7acd8e2461a255958f81fc06010000006b483045022100a13934e68d3f5b22b130c4cb33f4da468cffc52323a47fbfbe06b64858162246022047081e0a70ff770e64a2e2d31e5d520d9102268b57a47009a72fe73ec766901801210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff197b96f3c87a3adfaa17f63fddc2a738a690ca665439f9431dbbd655816c41fb000000006c49304602210097f1f35d5bdc1a3a60390a1b015b8e7c4f916aa3847aafd969e04975e15bbe70022100a9052eb25517d481f1fda1b129eb1b534da50ea1a51f3ee012dca3601c11b86a0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffff20d9a261ee27aa1bd92e7db2fdca935909a40b648e974cd24a10d63b68b94039dd0000006b483045022012b3138c591bf7154b6fef457f2c4a3c7162225003788ac0024a99355865ff13022100b71b125ae1ffb2e1d1571f580cd3ebc8cd049a2d7a8a41f138ba94aeb982106f012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff50f179d5d16cd872f9a63c26c448464ae9bd95cd9421c0476113b5d314571b71010000006b483045022100f834ccc8b22ee72712a3e5e6ef4acb8b2fb791b5385b70e2cd4332674d6667f4022024fbda0a997e0c253503f217501f508a4d56edce2c813ecdd9ad796dbeba907401210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff551b865d1568ac0a305e5f9c5dae6c540982334efbe789074318e0efc5b564631b0000006b48304502203b2fd1e39ae0e469d7a15768f262661b0de41470daf0fe8c4fd0c26542a0870002210081c57e331f9a2d214457d953e3542904727ee412c63028113635d7224da3dccc012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff57503e5a016189d407a721791459280875264f908ca2c5d4862c01386e7fb50b470400006b48304502206947a9c54f0664ece4430fd4ae999891dc50bb6126bc36b6a15a3189f29d25e9022100a86cfc4e2fdd9e39a20e305cfd1b76509c67b3e313e0f118229105caa0e823c9012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff3f16c1fb9d3e1a26d872933e955df85ee7f3f817711062b00b54a2144827349b250000006b483045022100c7128fe10b2d38744ae8177776054c29fc8ec13f07207723e70766ab7164847402201d2cf09009b9596de74c0183d1ab832e5edddb7a9965880bb400097e850850f8012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff4142a69d85b8498af214f0dd427b6ab29c240a0b8577e2944d37a7d8c05c6bb8140000006b48304502203b89a71628a28cc3703d170ca3be77786cff6b867e38a18b719705f8a326578f022100b2a9879e1acf621faa6466c207746a7f3eb4c8514c1482969aba3f2a957f1321012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff36e2feecc0a4bff7480015d42c12121932db389025ed0ac1d344ecee53230a3df20000006c493046022100ef794a8ef7fd6752d2a183c18866ff6e8dc0f5bd889a63e2c21cf303a6302461022100c1b09662d9e92988c3f9fcf17d1bcc79b5403647095d7212b9f8a1278a532d68012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff0160f73608000000001976a9148fd139bb39ced713f231c58a4d07bf6954d1c20188ac00000000 diff --git a/src/test/data/tt-locktime317000-out.hex b/src/test/data/tt-locktime317000-out.hex new file mode 100644 index 0000000000..287f420a40 --- /dev/null +++ b/src/test/data/tt-locktime317000-out.hex @@ -0,0 +1 @@ +0100000015fd5c23522d31761c50175453daa6edaabe47a602a592d39ce933d8271a1a87274c0100006c493046022100b4251ecd63778a3dde0155abe4cd162947620ae9ee45a874353551092325b116022100db307baf4ff3781ec520bd18f387948cedd15dc27bafe17c894b0fe6ffffcafa012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffcb4ed1baba3a1eb2171e00ddec8e5b72b346dd8c07f9c2b0d122d0d06bc92ea7000000006c493046022100a9b617843b68c284715d3e02fd120479cd0d96a6c43bf01e697fb0a460a21a3a022100ba0a12fbe8b993d4e7911fa3467615765dbe421ddf5c51b57a9c1ee19dcc00ba012103e633b4fa4ceb705c2da712390767199be8ef2448b3095dc01652e11b2b751505ffffffffc1b37ae964f605978022f94ce2f3f676d66a46d1aef7c2c17d6315b9697f2f75010000006a473044022079bd62ee09621a3be96b760c39e8ef78170101d46313923c6b07ae60a95c90670220238e51ea29fc70b04b65508450523caedbb11cb4dd5aa608c81487de798925ba0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffffedd005dc7790ef65c206abd1ab718e75252a40f4b1310e4102cd692eca9cacb0d10000006b48304502207722d6f9038673c86a1019b1c4de2d687ae246477cd4ca7002762be0299de385022100e594a11e3a313942595f7666dcf7078bcb14f1330f4206b95c917e7ec0e82fac012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffdf28d6e26fb7a85a1e6a229b972c1bae0edc1c11cb9ca51e4caf5e59fbea35a1000000006b483045022100a63a4788027b79b65c6f9d9e054f68cf3b4eed19efd82a2d53f70dcbe64683390220526f243671425b2bd05745fcf2729361f985cfe84ea80c7cfc817b93d8134374012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffffae2a2320a1582faa24469eff3024a6b98bfe00eb4f554d8a0b1421ba53bfd6a5010000006c493046022100b200ac6db16842f76dab9abe807ce423c992805879bc50abd46ed8275a59d9cf022100c0d518e85dd345b3c29dd4dc47b9a420d3ce817b18720e94966d2fe23413a408012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffb3cc5a12548aa1794b4d2bbf076838cfd7fbafb7716da51ee8221a4ff19c291b000000006b483045022100ededc441c3103a6f2bd6cab7639421af0f6ec5e60503bce1e603cf34f00aee1c02205cb75f3f519a13fb348783b21db3085cb5ec7552c59e394fdbc3e1feea43f967012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffff85145367313888d2cf2747274a32e20b2df074027bafd6f970003fcbcdf11d07150000006b483045022100d9eed5413d2a4b4b98625aa6e3169edc4fb4663e7862316d69224454e70cd8ca022061e506521d5ced51dd0ea36496e75904d756a4c4f9fb111568555075d5f68d9a012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff8292c11f6d35abab5bac3ebb627a4ff949e8ecd62d33ed137adf7aeb00e512b0090000006b48304502207e84b27139c4c19c828cb1e30c349bba88e4d9b59be97286960793b5ddc0a2af0221008cdc7a951e7f31c20953ed5635fbabf228e80b7047f32faaa0313e7693005177012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff883dcf9a86063db088ad064d0953258d4b0ff3425857402d2f3f839cee0f84581e0000006a4730440220426540dfed9c4ab5812e5f06df705b8bcf307dd7d20f7fa6512298b2a6314f420220064055096e3ca62f6c7352c66a5447767c53f946acdf35025ab3807ddb2fa404012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff6697dbb3ed98afe481b568459fa67e503f8a4254532465a670e54669d19c9fe6720000006a47304402200a5e673996f2fc88e21cc8613611f08a650bc0370338803591d85d0ec5663764022040b6664a0d1ec83a7f01975b8fde5232992b8ca58bf48af6725d2f92a936ab2e012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff023ffc2182517e1d3fa0896c5b0bd7b4d2ef8a1e42655abe2ced54f657125d59670000006c493046022100d93b30219c5735f673be5c3b4688366d96f545561c74cb62c6958c00f6960806022100ec8200adcb028f2184fa2a4f6faac7f8bb57cb4503bb7584ac11051fece31b3d012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff16f8c77166b0df3d7cc8b5b2ce825afbea9309ad7acd8e2461a255958f81fc06010000006b483045022100a13934e68d3f5b22b130c4cb33f4da468cffc52323a47fbfbe06b64858162246022047081e0a70ff770e64a2e2d31e5d520d9102268b57a47009a72fe73ec766901801210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff197b96f3c87a3adfaa17f63fddc2a738a690ca665439f9431dbbd655816c41fb000000006c49304602210097f1f35d5bdc1a3a60390a1b015b8e7c4f916aa3847aafd969e04975e15bbe70022100a9052eb25517d481f1fda1b129eb1b534da50ea1a51f3ee012dca3601c11b86a0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffff20d9a261ee27aa1bd92e7db2fdca935909a40b648e974cd24a10d63b68b94039dd0000006b483045022012b3138c591bf7154b6fef457f2c4a3c7162225003788ac0024a99355865ff13022100b71b125ae1ffb2e1d1571f580cd3ebc8cd049a2d7a8a41f138ba94aeb982106f012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff50f179d5d16cd872f9a63c26c448464ae9bd95cd9421c0476113b5d314571b71010000006b483045022100f834ccc8b22ee72712a3e5e6ef4acb8b2fb791b5385b70e2cd4332674d6667f4022024fbda0a997e0c253503f217501f508a4d56edce2c813ecdd9ad796dbeba907401210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff551b865d1568ac0a305e5f9c5dae6c540982334efbe789074318e0efc5b564631b0000006b48304502203b2fd1e39ae0e469d7a15768f262661b0de41470daf0fe8c4fd0c26542a0870002210081c57e331f9a2d214457d953e3542904727ee412c63028113635d7224da3dccc012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff57503e5a016189d407a721791459280875264f908ca2c5d4862c01386e7fb50b470400006b48304502206947a9c54f0664ece4430fd4ae999891dc50bb6126bc36b6a15a3189f29d25e9022100a86cfc4e2fdd9e39a20e305cfd1b76509c67b3e313e0f118229105caa0e823c9012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff3f16c1fb9d3e1a26d872933e955df85ee7f3f817711062b00b54a2144827349b250000006b483045022100c7128fe10b2d38744ae8177776054c29fc8ec13f07207723e70766ab7164847402201d2cf09009b9596de74c0183d1ab832e5edddb7a9965880bb400097e850850f8012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff4142a69d85b8498af214f0dd427b6ab29c240a0b8577e2944d37a7d8c05c6bb8140000006b48304502203b89a71628a28cc3703d170ca3be77786cff6b867e38a18b719705f8a326578f022100b2a9879e1acf621faa6466c207746a7f3eb4c8514c1482969aba3f2a957f1321012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff36e2feecc0a4bff7480015d42c12121932db389025ed0ac1d344ecee53230a3df20000006c493046022100ef794a8ef7fd6752d2a183c18866ff6e8dc0f5bd889a63e2c21cf303a6302461022100c1b09662d9e92988c3f9fcf17d1bcc79b5403647095d7212b9f8a1278a532d68012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff0260f73608000000001976a9148fd139bb39ced713f231c58a4d07bf6954d1c20188ac41420f00000000001976a9146c772e9cf96371bba3da8cb733da70a2fcf2007888ac48d60400 diff --git a/src/test/data/tx394b54bb.hex b/src/test/data/tx394b54bb.hex new file mode 100644 index 0000000000..33f26cb4d6 --- /dev/null +++ b/src/test/data/tx394b54bb.hex @@ -0,0 +1 @@ +0100000015fd5c23522d31761c50175453daa6edaabe47a602a592d39ce933d8271a1a87274c0100006c493046022100b4251ecd63778a3dde0155abe4cd162947620ae9ee45a874353551092325b116022100db307baf4ff3781ec520bd18f387948cedd15dc27bafe17c894b0fe6ffffcafa012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffcb4ed1baba3a1eb2171e00ddec8e5b72b346dd8c07f9c2b0d122d0d06bc92ea7000000006c493046022100a9b617843b68c284715d3e02fd120479cd0d96a6c43bf01e697fb0a460a21a3a022100ba0a12fbe8b993d4e7911fa3467615765dbe421ddf5c51b57a9c1ee19dcc00ba012103e633b4fa4ceb705c2da712390767199be8ef2448b3095dc01652e11b2b751505ffffffffc1b37ae964f605978022f94ce2f3f676d66a46d1aef7c2c17d6315b9697f2f75010000006a473044022079bd62ee09621a3be96b760c39e8ef78170101d46313923c6b07ae60a95c90670220238e51ea29fc70b04b65508450523caedbb11cb4dd5aa608c81487de798925ba0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffffedd005dc7790ef65c206abd1ab718e75252a40f4b1310e4102cd692eca9cacb0d10000006b48304502207722d6f9038673c86a1019b1c4de2d687ae246477cd4ca7002762be0299de385022100e594a11e3a313942595f7666dcf7078bcb14f1330f4206b95c917e7ec0e82fac012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffdf28d6e26fb7a85a1e6a229b972c1bae0edc1c11cb9ca51e4caf5e59fbea35a1000000006b483045022100a63a4788027b79b65c6f9d9e054f68cf3b4eed19efd82a2d53f70dcbe64683390220526f243671425b2bd05745fcf2729361f985cfe84ea80c7cfc817b93d8134374012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffffae2a2320a1582faa24469eff3024a6b98bfe00eb4f554d8a0b1421ba53bfd6a5010000006c493046022100b200ac6db16842f76dab9abe807ce423c992805879bc50abd46ed8275a59d9cf022100c0d518e85dd345b3c29dd4dc47b9a420d3ce817b18720e94966d2fe23413a408012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffb3cc5a12548aa1794b4d2bbf076838cfd7fbafb7716da51ee8221a4ff19c291b000000006b483045022100ededc441c3103a6f2bd6cab7639421af0f6ec5e60503bce1e603cf34f00aee1c02205cb75f3f519a13fb348783b21db3085cb5ec7552c59e394fdbc3e1feea43f967012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffff85145367313888d2cf2747274a32e20b2df074027bafd6f970003fcbcdf11d07150000006b483045022100d9eed5413d2a4b4b98625aa6e3169edc4fb4663e7862316d69224454e70cd8ca022061e506521d5ced51dd0ea36496e75904d756a4c4f9fb111568555075d5f68d9a012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff8292c11f6d35abab5bac3ebb627a4ff949e8ecd62d33ed137adf7aeb00e512b0090000006b48304502207e84b27139c4c19c828cb1e30c349bba88e4d9b59be97286960793b5ddc0a2af0221008cdc7a951e7f31c20953ed5635fbabf228e80b7047f32faaa0313e7693005177012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff883dcf9a86063db088ad064d0953258d4b0ff3425857402d2f3f839cee0f84581e0000006a4730440220426540dfed9c4ab5812e5f06df705b8bcf307dd7d20f7fa6512298b2a6314f420220064055096e3ca62f6c7352c66a5447767c53f946acdf35025ab3807ddb2fa404012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff6697dbb3ed98afe481b568459fa67e503f8a4254532465a670e54669d19c9fe6720000006a47304402200a5e673996f2fc88e21cc8613611f08a650bc0370338803591d85d0ec5663764022040b6664a0d1ec83a7f01975b8fde5232992b8ca58bf48af6725d2f92a936ab2e012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff023ffc2182517e1d3fa0896c5b0bd7b4d2ef8a1e42655abe2ced54f657125d59670000006c493046022100d93b30219c5735f673be5c3b4688366d96f545561c74cb62c6958c00f6960806022100ec8200adcb028f2184fa2a4f6faac7f8bb57cb4503bb7584ac11051fece31b3d012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff16f8c77166b0df3d7cc8b5b2ce825afbea9309ad7acd8e2461a255958f81fc06010000006b483045022100a13934e68d3f5b22b130c4cb33f4da468cffc52323a47fbfbe06b64858162246022047081e0a70ff770e64a2e2d31e5d520d9102268b57a47009a72fe73ec766901801210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff197b96f3c87a3adfaa17f63fddc2a738a690ca665439f9431dbbd655816c41fb000000006c49304602210097f1f35d5bdc1a3a60390a1b015b8e7c4f916aa3847aafd969e04975e15bbe70022100a9052eb25517d481f1fda1b129eb1b534da50ea1a51f3ee012dca3601c11b86a0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffff20d9a261ee27aa1bd92e7db2fdca935909a40b648e974cd24a10d63b68b94039dd0000006b483045022012b3138c591bf7154b6fef457f2c4a3c7162225003788ac0024a99355865ff13022100b71b125ae1ffb2e1d1571f580cd3ebc8cd049a2d7a8a41f138ba94aeb982106f012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff50f179d5d16cd872f9a63c26c448464ae9bd95cd9421c0476113b5d314571b71010000006b483045022100f834ccc8b22ee72712a3e5e6ef4acb8b2fb791b5385b70e2cd4332674d6667f4022024fbda0a997e0c253503f217501f508a4d56edce2c813ecdd9ad796dbeba907401210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff551b865d1568ac0a305e5f9c5dae6c540982334efbe789074318e0efc5b564631b0000006b48304502203b2fd1e39ae0e469d7a15768f262661b0de41470daf0fe8c4fd0c26542a0870002210081c57e331f9a2d214457d953e3542904727ee412c63028113635d7224da3dccc012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff57503e5a016189d407a721791459280875264f908ca2c5d4862c01386e7fb50b470400006b48304502206947a9c54f0664ece4430fd4ae999891dc50bb6126bc36b6a15a3189f29d25e9022100a86cfc4e2fdd9e39a20e305cfd1b76509c67b3e313e0f118229105caa0e823c9012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff3f16c1fb9d3e1a26d872933e955df85ee7f3f817711062b00b54a2144827349b250000006b483045022100c7128fe10b2d38744ae8177776054c29fc8ec13f07207723e70766ab7164847402201d2cf09009b9596de74c0183d1ab832e5edddb7a9965880bb400097e850850f8012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff4142a69d85b8498af214f0dd427b6ab29c240a0b8577e2944d37a7d8c05c6bb8140000006b48304502203b89a71628a28cc3703d170ca3be77786cff6b867e38a18b719705f8a326578f022100b2a9879e1acf621faa6466c207746a7f3eb4c8514c1482969aba3f2a957f1321012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff36e2feecc0a4bff7480015d42c12121932db389025ed0ac1d344ecee53230a3df20000006c493046022100ef794a8ef7fd6752d2a183c18866ff6e8dc0f5bd889a63e2c21cf303a6302461022100c1b09662d9e92988c3f9fcf17d1bcc79b5403647095d7212b9f8a1278a532d68012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff0260f73608000000001976a9148fd139bb39ced713f231c58a4d07bf6954d1c20188ac41420f00000000001976a9146c772e9cf96371bba3da8cb733da70a2fcf2007888ac00000000 diff --git a/src/test/data/txcreate1.hex b/src/test/data/txcreate1.hex new file mode 100644 index 0000000000..e2981a51c9 --- /dev/null +++ b/src/test/data/txcreate1.hex @@ -0,0 +1 @@ +01000000031f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000ffffffff7cca453133921c50d5025878f7f738d1df891fd359763331935784cf6b9c82bf1200000000fffffffffccd319e04a996c96cfc0bf4c07539aa90bd0b1a700ef72fae535d6504f9a6220100000000ffffffff0280a81201000000001976a9141fc11f39be1729bf973a7ab6a615ca4729d6457488ac0084d717000000001976a914f2d4db28cad6502226ee484ae24505c2885cb12d88ac00000000 From 42642c96950f50bec0866483876a6eef27318fec Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 19 Aug 2014 13:41:25 -0400 Subject: [PATCH 0555/1288] UniValue: use correct setNumStr() input val, when setting number values --- src/univalue/univalue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/univalue/univalue.cpp b/src/univalue/univalue.cpp index afc208bffb..b0171e48c4 100644 --- a/src/univalue/univalue.cpp +++ b/src/univalue/univalue.cpp @@ -44,7 +44,7 @@ static bool validNumStr(const string& s) bool UniValue::setNumStr(const string& val_) { - if (!validNumStr(val)) + if (!validNumStr(val_)) return false; clear(); From dee9324a0bdbf92a0764213f9b24424a7600f47b Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 20 Aug 2014 00:14:53 -0400 Subject: [PATCH 0556/1288] UniValue: compact (!pretty) output should not include extra whitespace --- src/univalue/univalue_write.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/univalue/univalue_write.cpp b/src/univalue/univalue_write.cpp index 70762a1ef1..042091a827 100644 --- a/src/univalue/univalue_write.cpp +++ b/src/univalue/univalue_write.cpp @@ -91,8 +91,11 @@ void UniValue::writeArray(unsigned int prettyIndent, unsigned int indentLevel, s if (prettyIndent) s += indentStr(prettyIndent, indentLevel); s += values[i].write(prettyIndent, indentLevel + 1); - if (i != (values.size() - 1)) - s += ", "; + if (i != (values.size() - 1)) { + s += ","; + if (prettyIndent) + s += " "; + } if (prettyIndent) s += "\n"; } @@ -111,7 +114,9 @@ void UniValue::writeObject(unsigned int prettyIndent, unsigned int indentLevel, for (unsigned int i = 0; i < keys.size(); i++) { if (prettyIndent) s += indentStr(prettyIndent, indentLevel); - s += "\"" + json_escape(keys[i]) + "\": "; + s += "\"" + json_escape(keys[i]) + "\":"; + if (prettyIndent) + s += " "; s += values[i].write(prettyIndent, indentLevel + 1); if (i != (values.size() - 1)) s += ","; From e85267be6306a54a0cfe0055c88b0b753f7d68cd Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 20 Aug 2014 00:28:46 -0400 Subject: [PATCH 0557/1288] UniValue: add unit tests --- src/Makefile.test.include | 1 + src/test/univalue_tests.cpp | 275 ++++++++++++++++++++++++++++++++++++ 2 files changed, 276 insertions(+) create mode 100644 src/test/univalue_tests.cpp diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 7e25430e3e..bf6534cf39 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -58,6 +58,7 @@ BITCOIN_TESTS =\ test/test_bitcoin.cpp \ test/transaction_tests.cpp \ test/uint256_tests.cpp \ + test/univalue_tests.cpp \ test/util_tests.cpp \ test/scriptnum_tests.cpp \ test/sighash_tests.cpp diff --git a/src/test/univalue_tests.cpp b/src/test/univalue_tests.cpp new file mode 100644 index 0000000000..25d1df3431 --- /dev/null +++ b/src/test/univalue_tests.cpp @@ -0,0 +1,275 @@ +// Copyright 2014 BitPay, Inc. +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include +#include +#include +#include +#include "univalue/univalue.h" + +#include + +using namespace std; + +BOOST_AUTO_TEST_SUITE(univalue_tests) + +BOOST_AUTO_TEST_CASE(univalue_constructor) +{ + UniValue v1; + BOOST_CHECK(v1.isNull()); + + UniValue v2(UniValue::VSTR); + BOOST_CHECK(v2.isStr()); + + UniValue v3(UniValue::VSTR, "foo"); + BOOST_CHECK(v3.isStr()); + BOOST_CHECK_EQUAL(v3.getValStr(), "foo"); + + UniValue numTest; + BOOST_CHECK(numTest.setNumStr("82")); + BOOST_CHECK_EQUAL(numTest.isNum(), true); + BOOST_CHECK_EQUAL(numTest.getValStr(), "82"); + + uint64_t vu64 = 82; + UniValue v4(vu64); + BOOST_CHECK_EQUAL(v4.isNum(), true); + BOOST_CHECK_EQUAL(v4.getValStr(), "82"); + + int64_t vi64 = -82; + UniValue v5(vi64); + BOOST_CHECK_EQUAL(v5.isNum(), true); + BOOST_CHECK_EQUAL(v5.getValStr(), "-82"); + + int vi = -688; + UniValue v6(vi); + BOOST_CHECK_EQUAL(v6.isNum(), true); + BOOST_CHECK_EQUAL(v6.getValStr(), "-688"); + + double vd = -7.21; + UniValue v7(vd); + BOOST_CHECK_EQUAL(v7.isNum(), true); + BOOST_CHECK_EQUAL(v7.getValStr(), "-7.21"); + + string vs("yawn"); + UniValue v8(vs); + BOOST_CHECK_EQUAL(v8.isStr(), true); + BOOST_CHECK_EQUAL(v8.getValStr(), "yawn"); + + const char *vcs = "zappa"; + UniValue v9(vcs); + BOOST_CHECK_EQUAL(v9.isStr(), true); + BOOST_CHECK_EQUAL(v9.getValStr(), "zappa"); +} + +BOOST_AUTO_TEST_CASE(univalue_set) +{ + UniValue v(UniValue::VSTR, "foo"); + v.clear(); + BOOST_CHECK_EQUAL(v.isNull(), true); + BOOST_CHECK_EQUAL(v.getValStr(), ""); + + BOOST_CHECK(v.setObject()); + BOOST_CHECK_EQUAL(v.isObject(), true); + BOOST_CHECK_EQUAL(v.count(), 0); + BOOST_CHECK_EQUAL(v.getType(), UniValue::VOBJ); + BOOST_CHECK_EQUAL(v.empty(), true); + + BOOST_CHECK(v.setArray()); + BOOST_CHECK_EQUAL(v.isArray(), true); + BOOST_CHECK_EQUAL(v.count(), 0); + + BOOST_CHECK(v.setStr("zum")); + BOOST_CHECK_EQUAL(v.isStr(), true); + BOOST_CHECK_EQUAL(v.getValStr(), "zum"); + + BOOST_CHECK(v.setFloat(-1.01)); + BOOST_CHECK_EQUAL(v.isNum(), true); + BOOST_CHECK_EQUAL(v.getValStr(), "-1.01"); + + BOOST_CHECK(v.setInt((int)1023)); + BOOST_CHECK_EQUAL(v.isNum(), true); + BOOST_CHECK_EQUAL(v.getValStr(), "1023"); + + BOOST_CHECK(v.setInt((int64_t)-1023LL)); + BOOST_CHECK_EQUAL(v.isNum(), true); + BOOST_CHECK_EQUAL(v.getValStr(), "-1023"); + + BOOST_CHECK(v.setInt((uint64_t)1023ULL)); + BOOST_CHECK_EQUAL(v.isNum(), true); + BOOST_CHECK_EQUAL(v.getValStr(), "1023"); + + BOOST_CHECK(v.setNumStr("-688")); + BOOST_CHECK_EQUAL(v.isNum(), true); + BOOST_CHECK_EQUAL(v.getValStr(), "-688"); + + BOOST_CHECK(v.setBool(false)); + BOOST_CHECK_EQUAL(v.isBool(), true); + BOOST_CHECK_EQUAL(v.isTrue(), false); + BOOST_CHECK_EQUAL(v.isFalse(), true); + BOOST_CHECK_EQUAL(v.getBool(), false); + + BOOST_CHECK(v.setBool(true)); + BOOST_CHECK_EQUAL(v.isBool(), true); + BOOST_CHECK_EQUAL(v.isTrue(), true); + BOOST_CHECK_EQUAL(v.isFalse(), false); + BOOST_CHECK_EQUAL(v.getBool(), true); + + BOOST_CHECK(!v.setNumStr("zombocom")); + + BOOST_CHECK(v.setNull()); + BOOST_CHECK_EQUAL(v.isNull(), true); +} + +BOOST_AUTO_TEST_CASE(univalue_array) +{ + UniValue arr(UniValue::VARR); + + UniValue v((int64_t)1023LL); + BOOST_CHECK(arr.push_back(v)); + + string vStr("zippy"); + BOOST_CHECK(arr.push_back(vStr)); + + const char *s = "pippy"; + BOOST_CHECK(arr.push_back(s)); + + vector vec; + v.setStr("boing"); + vec.push_back(v); + + v.setStr("going"); + vec.push_back(v); + + BOOST_CHECK(arr.push_backV(vec)); + + BOOST_CHECK_EQUAL(arr.empty(), false); + BOOST_CHECK_EQUAL(arr.count(), 5); + + BOOST_CHECK_EQUAL(arr[0].getValStr(), "1023"); + BOOST_CHECK_EQUAL(arr[1].getValStr(), "zippy"); + BOOST_CHECK_EQUAL(arr[2].getValStr(), "pippy"); + BOOST_CHECK_EQUAL(arr[3].getValStr(), "boing"); + BOOST_CHECK_EQUAL(arr[4].getValStr(), "going"); + + BOOST_CHECK_EQUAL(arr[999].getValStr(), ""); + + arr.clear(); + BOOST_CHECK_EQUAL(arr.empty(), true); + BOOST_CHECK_EQUAL(arr.count(), 0); +} + +BOOST_AUTO_TEST_CASE(univalue_object) +{ + UniValue obj(UniValue::VOBJ); + string strKey, strVal; + UniValue v; + + strKey = "age"; + v.setInt(100); + BOOST_CHECK(obj.pushKV(strKey, v)); + + strKey = "first"; + strVal = "John"; + BOOST_CHECK(obj.pushKV(strKey, strVal)); + + strKey = "last"; + const char *cVal = "Smith"; + BOOST_CHECK(obj.pushKV(strKey, cVal)); + + strKey = "distance"; + BOOST_CHECK(obj.pushKV(strKey, (int64_t) 25)); + + strKey = "time"; + BOOST_CHECK(obj.pushKV(strKey, (uint64_t) 3600)); + + strKey = "calories"; + BOOST_CHECK(obj.pushKV(strKey, (int) 12)); + + strKey = "temperature"; + BOOST_CHECK(obj.pushKV(strKey, (double) 90.012)); + + UniValue obj2(UniValue::VOBJ); + BOOST_CHECK(obj2.pushKV("cat1", 9000)); + BOOST_CHECK(obj2.pushKV("cat2", 12345)); + + BOOST_CHECK(obj.pushKVs(obj2)); + + BOOST_CHECK_EQUAL(obj.empty(), false); + BOOST_CHECK_EQUAL(obj.count(), 9); + + BOOST_CHECK_EQUAL(obj["age"].getValStr(), "100"); + BOOST_CHECK_EQUAL(obj["first"].getValStr(), "John"); + BOOST_CHECK_EQUAL(obj["last"].getValStr(), "Smith"); + BOOST_CHECK_EQUAL(obj["distance"].getValStr(), "25"); + BOOST_CHECK_EQUAL(obj["time"].getValStr(), "3600"); + BOOST_CHECK_EQUAL(obj["calories"].getValStr(), "12"); + BOOST_CHECK_EQUAL(obj["temperature"].getValStr(), "90.012"); + BOOST_CHECK_EQUAL(obj["cat1"].getValStr(), "9000"); + BOOST_CHECK_EQUAL(obj["cat2"].getValStr(), "12345"); + + BOOST_CHECK_EQUAL(obj["nyuknyuknyuk"].getValStr(), ""); + + BOOST_CHECK(obj.exists("age")); + BOOST_CHECK(obj.exists("first")); + BOOST_CHECK(obj.exists("last")); + BOOST_CHECK(obj.exists("distance")); + BOOST_CHECK(obj.exists("time")); + BOOST_CHECK(obj.exists("calories")); + BOOST_CHECK(obj.exists("temperature")); + BOOST_CHECK(obj.exists("cat1")); + BOOST_CHECK(obj.exists("cat2")); + + BOOST_CHECK(!obj.exists("nyuknyuknyuk")); + + map objTypes; + objTypes["age"] = UniValue::VNUM; + objTypes["first"] = UniValue::VSTR; + objTypes["last"] = UniValue::VSTR; + objTypes["distance"] = UniValue::VNUM; + objTypes["time"] = UniValue::VNUM; + objTypes["calories"] = UniValue::VNUM; + objTypes["temperature"] = UniValue::VNUM; + objTypes["cat1"] = UniValue::VNUM; + objTypes["cat2"] = UniValue::VNUM; + BOOST_CHECK(obj.checkObject(objTypes)); + + objTypes["cat2"] = UniValue::VSTR; + BOOST_CHECK(!obj.checkObject(objTypes)); + + obj.clear(); + BOOST_CHECK_EQUAL(obj.empty(), true); + BOOST_CHECK_EQUAL(obj.count(), 0); +} + +static const char *json1 = +"[1.1,{\"key1\":\"str\",\"key2\":800,\"key3\":{\"name\":\"martian\"}}]"; + +BOOST_AUTO_TEST_CASE(univalue_readwrite) +{ + UniValue v; + BOOST_CHECK(v.read(json1)); + + string strJson1(json1); + BOOST_CHECK(v.read(strJson1)); + + BOOST_CHECK(v.isArray()); + BOOST_CHECK_EQUAL(v.count(), 2); + + BOOST_CHECK_EQUAL(v[0].getValStr(), "1.1"); + + UniValue obj = v[1]; + BOOST_CHECK(obj.isObject()); + BOOST_CHECK_EQUAL(obj.count(), 3); + + BOOST_CHECK(obj["key1"].isStr()); + BOOST_CHECK_EQUAL(obj["key1"].getValStr(), "str"); + BOOST_CHECK(obj["key2"].isNum()); + BOOST_CHECK_EQUAL(obj["key2"].getValStr(), "800"); + BOOST_CHECK(obj["key3"].isObject()); + + BOOST_CHECK_EQUAL(strJson1, v.write()); +} + +BOOST_AUTO_TEST_SUITE_END() + From dc271fc025d219c18428a4d36dbc372c8e457908 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 20 Aug 2014 01:09:21 -0400 Subject: [PATCH 0558/1288] UniValue tests: use more BOOST_CHECK() --- src/test/univalue_tests.cpp | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/test/univalue_tests.cpp b/src/test/univalue_tests.cpp index 25d1df3431..23bc5f6b12 100644 --- a/src/test/univalue_tests.cpp +++ b/src/test/univalue_tests.cpp @@ -28,37 +28,37 @@ BOOST_AUTO_TEST_CASE(univalue_constructor) UniValue numTest; BOOST_CHECK(numTest.setNumStr("82")); - BOOST_CHECK_EQUAL(numTest.isNum(), true); + BOOST_CHECK(numTest.isNum()); BOOST_CHECK_EQUAL(numTest.getValStr(), "82"); uint64_t vu64 = 82; UniValue v4(vu64); - BOOST_CHECK_EQUAL(v4.isNum(), true); + BOOST_CHECK(v4.isNum()); BOOST_CHECK_EQUAL(v4.getValStr(), "82"); int64_t vi64 = -82; UniValue v5(vi64); - BOOST_CHECK_EQUAL(v5.isNum(), true); + BOOST_CHECK(v5.isNum()); BOOST_CHECK_EQUAL(v5.getValStr(), "-82"); int vi = -688; UniValue v6(vi); - BOOST_CHECK_EQUAL(v6.isNum(), true); + BOOST_CHECK(v6.isNum()); BOOST_CHECK_EQUAL(v6.getValStr(), "-688"); double vd = -7.21; UniValue v7(vd); - BOOST_CHECK_EQUAL(v7.isNum(), true); + BOOST_CHECK(v7.isNum()); BOOST_CHECK_EQUAL(v7.getValStr(), "-7.21"); string vs("yawn"); UniValue v8(vs); - BOOST_CHECK_EQUAL(v8.isStr(), true); + BOOST_CHECK(v8.isStr()); BOOST_CHECK_EQUAL(v8.getValStr(), "yawn"); const char *vcs = "zappa"; UniValue v9(vcs); - BOOST_CHECK_EQUAL(v9.isStr(), true); + BOOST_CHECK(v9.isStr()); BOOST_CHECK_EQUAL(v9.getValStr(), "zappa"); } @@ -66,41 +66,41 @@ BOOST_AUTO_TEST_CASE(univalue_set) { UniValue v(UniValue::VSTR, "foo"); v.clear(); - BOOST_CHECK_EQUAL(v.isNull(), true); + BOOST_CHECK(v.isNull()); BOOST_CHECK_EQUAL(v.getValStr(), ""); BOOST_CHECK(v.setObject()); - BOOST_CHECK_EQUAL(v.isObject(), true); + BOOST_CHECK(v.isObject()); BOOST_CHECK_EQUAL(v.count(), 0); BOOST_CHECK_EQUAL(v.getType(), UniValue::VOBJ); - BOOST_CHECK_EQUAL(v.empty(), true); + BOOST_CHECK(v.empty()); BOOST_CHECK(v.setArray()); - BOOST_CHECK_EQUAL(v.isArray(), true); + BOOST_CHECK(v.isArray()); BOOST_CHECK_EQUAL(v.count(), 0); BOOST_CHECK(v.setStr("zum")); - BOOST_CHECK_EQUAL(v.isStr(), true); + BOOST_CHECK(v.isStr()); BOOST_CHECK_EQUAL(v.getValStr(), "zum"); BOOST_CHECK(v.setFloat(-1.01)); - BOOST_CHECK_EQUAL(v.isNum(), true); + BOOST_CHECK(v.isNum()); BOOST_CHECK_EQUAL(v.getValStr(), "-1.01"); BOOST_CHECK(v.setInt((int)1023)); - BOOST_CHECK_EQUAL(v.isNum(), true); + BOOST_CHECK(v.isNum()); BOOST_CHECK_EQUAL(v.getValStr(), "1023"); BOOST_CHECK(v.setInt((int64_t)-1023LL)); - BOOST_CHECK_EQUAL(v.isNum(), true); + BOOST_CHECK(v.isNum()); BOOST_CHECK_EQUAL(v.getValStr(), "-1023"); BOOST_CHECK(v.setInt((uint64_t)1023ULL)); - BOOST_CHECK_EQUAL(v.isNum(), true); + BOOST_CHECK(v.isNum()); BOOST_CHECK_EQUAL(v.getValStr(), "1023"); BOOST_CHECK(v.setNumStr("-688")); - BOOST_CHECK_EQUAL(v.isNum(), true); + BOOST_CHECK(v.isNum()); BOOST_CHECK_EQUAL(v.getValStr(), "-688"); BOOST_CHECK(v.setBool(false)); @@ -118,7 +118,7 @@ BOOST_AUTO_TEST_CASE(univalue_set) BOOST_CHECK(!v.setNumStr("zombocom")); BOOST_CHECK(v.setNull()); - BOOST_CHECK_EQUAL(v.isNull(), true); + BOOST_CHECK(v.isNull()); } BOOST_AUTO_TEST_CASE(univalue_array) @@ -155,7 +155,7 @@ BOOST_AUTO_TEST_CASE(univalue_array) BOOST_CHECK_EQUAL(arr[999].getValStr(), ""); arr.clear(); - BOOST_CHECK_EQUAL(arr.empty(), true); + BOOST_CHECK(arr.empty()); BOOST_CHECK_EQUAL(arr.count(), 0); } @@ -238,7 +238,7 @@ BOOST_AUTO_TEST_CASE(univalue_object) BOOST_CHECK(!obj.checkObject(objTypes)); obj.clear(); - BOOST_CHECK_EQUAL(obj.empty(), true); + BOOST_CHECK(obj.empty()); BOOST_CHECK_EQUAL(obj.count(), 0); } From 81212588c06cbf771bf3b60b426c3c4d2625e899 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 20 Aug 2014 10:26:27 +0200 Subject: [PATCH 0559/1288] Remove print() from core functions Break dependency on util. --- src/core.cpp | 38 +++++++++----------------------------- src/core.h | 6 +----- src/init.cpp | 3 +-- src/miner.cpp | 2 +- 4 files changed, 12 insertions(+), 37 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index 149b3532a1..2a5e2a372b 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -12,11 +12,6 @@ std::string COutPoint::ToString() const return strprintf("COutPoint(%s, %u)", hash.ToString().substr(0,10), n); } -void COutPoint::print() const -{ - LogPrintf("%s\n", ToString()); -} - CTxIn::CTxIn(COutPoint prevoutIn, CScript scriptSigIn, unsigned int nSequenceIn) { prevout = prevoutIn; @@ -46,11 +41,6 @@ std::string CTxIn::ToString() const return str; } -void CTxIn::print() const -{ - LogPrintf("%s\n", ToString()); -} - CTxOut::CTxOut(int64_t nValueIn, CScript scriptPubKeyIn) { nValue = nValueIn; @@ -67,11 +57,6 @@ std::string CTxOut::ToString() const return strprintf("CTxOut(nValue=%d.%08d, scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30)); } -void CTxOut::print() const -{ - LogPrintf("%s\n", ToString()); -} - CFeeRate::CFeeRate(int64_t nFeePaid, size_t nSize) { if (nSize > 0) @@ -92,8 +77,7 @@ int64_t CFeeRate::GetFee(size_t nSize) const std::string CFeeRate::ToString() const { - std::string result = FormatMoney(nSatoshisPerK) + " BTC/kB"; - return result; + return strprintf("%d.%08d BTC/kB", nSatoshisPerK / COIN, nSatoshisPerK % COIN); } CMutableTransaction::CMutableTransaction() : nVersion(CTransaction::CURRENT_VERSION), nLockTime(0) {} @@ -171,11 +155,6 @@ std::string CTransaction::ToString() const return str; } -void CTransaction::print() const -{ - LogPrintf("%s", ToString()); -} - // Amount compression: // * If the amount is 0, output 0 // * first, divide the amount (in base units) by the largest power of 10 possible; call the exponent e (e is max 9) @@ -285,9 +264,10 @@ uint256 CBlock::CheckMerkleBranch(uint256 hash, const std::vector& vMer return hash; } -void CBlock::print() const +std::string CBlock::ToString() const { - LogPrintf("CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%u)\n", + std::stringstream s; + s << strprintf("CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%u)\n", GetHash().ToString(), nVersion, hashPrevBlock.ToString(), @@ -296,11 +276,11 @@ void CBlock::print() const vtx.size()); for (unsigned int i = 0; i < vtx.size(); i++) { - LogPrintf(" "); - vtx[i].print(); + s << " " << vtx[i].ToString() << "\n"; } - LogPrintf(" vMerkleTree: "); + s << " vMerkleTree: "; for (unsigned int i = 0; i < vMerkleTree.size(); i++) - LogPrintf("%s ", vMerkleTree[i].ToString()); - LogPrintf("\n"); + s << " " << vMerkleTree[i].ToString(); + s << "\n"; + return s.str(); } diff --git a/src/core.h b/src/core.h index fb64e6c08e..9552f70254 100644 --- a/src/core.h +++ b/src/core.h @@ -47,7 +47,6 @@ public: } std::string ToString() const; - void print() const; }; /** An inpoint - a combination of a transaction and an index n into its vin */ @@ -107,7 +106,6 @@ public: } std::string ToString() const; - void print() const; }; @@ -200,7 +198,6 @@ public: } std::string ToString() const; - void print() const; }; @@ -279,7 +276,6 @@ public: } std::string ToString() const; - void print() const; }; /** A mutable version of CTransaction. */ @@ -497,7 +493,7 @@ public: std::vector GetMerkleBranch(int nIndex) const; static uint256 CheckMerkleBranch(uint256 hash, const std::vector& vMerkleBranch, int nIndex); - void print() const; + std::string ToString() const; }; diff --git a/src/init.cpp b/src/init.cpp index 42956a8d69..708e6386aa 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1029,8 +1029,7 @@ bool AppInit2(boost::thread_group& threadGroup) CBlock block; ReadBlockFromDisk(block, pindex); block.BuildMerkleTree(); - block.print(); - LogPrintf("\n"); + LogPrintf("%s\n", block.ToString()); nFound++; } } diff --git a/src/miner.cpp b/src/miner.cpp index 9408d2c5aa..13aa6671c9 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -404,7 +404,7 @@ CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey) bool ProcessBlockFound(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey) { - pblock->print(); + LogPrintf("%s\n", pblock->ToString()); LogPrintf("generated %s\n", FormatMoney(pblock->vtx[0].vout[0].nValue)); // Found a solution From 9b6d4c5cdc1ad7b12b8b7ba05125dad9ba2d396e Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 20 Aug 2014 10:51:18 +0200 Subject: [PATCH 0560/1288] Move strprintf define to tinyformat.h This avoids a dependency on util.h if just tinyformat is needed. --- src/core.cpp | 2 +- src/tinyformat.h | 2 ++ src/util.h | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index 2a5e2a372b..71d6fea610 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -5,7 +5,7 @@ #include "core.h" -#include "util.h" +#include "tinyformat.h" std::string COutPoint::ToString() const { diff --git a/src/tinyformat.h b/src/tinyformat.h index b6113029f5..929cb66e4d 100644 --- a/src/tinyformat.h +++ b/src/tinyformat.h @@ -1007,4 +1007,6 @@ TINYFORMAT_WRAP_FORMAT_N(16, returnType, funcName, funcDeclSuffix, bodyPrefix, s } // namespace tinyformat +#define strprintf tfm::format + #endif // TINYFORMAT_H_INCLUDED diff --git a/src/util.h b/src/util.h index db2005337b..1fb42a7b7e 100644 --- a/src/util.h +++ b/src/util.h @@ -108,7 +108,6 @@ bool LogAcceptCategory(const char* category); /* Send a string to the log output */ int LogPrintStr(const std::string &str); -#define strprintf tfm::format #define LogPrintf(...) LogPrint(NULL, __VA_ARGS__) /* When we switch to C++11, this can be switched to variadic templates instead From 5d9f22b3cb533122d2289ed404ca09eb345ae157 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Wed, 20 Aug 2014 20:00:13 +0800 Subject: [PATCH 0561/1288] Remove link to now removed Windows Build Notes Removed in --- doc/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/README.md b/doc/README.md index f8bb8020d4..10c9ad1799 100644 --- a/doc/README.md +++ b/doc/README.md @@ -46,7 +46,6 @@ The following are developer notes on how to build Bitcoin on your native platfor - [OSX Build Notes](build-osx.md) - [Unix Build Notes](build-unix.md) -- [Windows Build Notes](build-msw.md) Development --------------------- From 380222411038cb4f74cbb109984c4b855b4799f6 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 20 Aug 2014 20:54:27 +0200 Subject: [PATCH 0562/1288] Remove all other print() methods All unused. --- src/alert.cpp | 5 ----- src/alert.h | 1 - src/main.cpp | 1 - src/main.h | 10 ---------- src/miner.cpp | 8 -------- src/netbase.cpp | 10 ---------- src/netbase.h | 2 -- src/protocol.cpp | 6 ------ src/protocol.h | 3 --- src/wallet.h | 5 ----- 10 files changed, 51 deletions(-) diff --git a/src/alert.cpp b/src/alert.cpp index 258a2b52c4..2cd684cc4c 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -80,11 +80,6 @@ std::string CUnsignedAlert::ToString() const strStatusBar); } -void CUnsignedAlert::print() const -{ - LogPrintf("%s", ToString()); -} - void CAlert::SetNull() { CUnsignedAlert::SetNull(); diff --git a/src/alert.h b/src/alert.h index 296d48891a..b9d850b565 100644 --- a/src/alert.h +++ b/src/alert.h @@ -68,7 +68,6 @@ public: void SetNull(); std::string ToString() const; - void print() const; }; /** An alert is a combination of a serialized CUnsignedAlert and a signature. */ diff --git a/src/main.cpp b/src/main.cpp index 09b10c8e55..d7543e3f13 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3968,7 +3968,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, vRecv >> block; LogPrint("net", "received block %s peer=%d\n", block.GetHash().ToString(), pfrom->id); - // block.print(); CInv inv(MSG_BLOCK, block.GetHash()); pfrom->AddInventoryKnown(inv); diff --git a/src/main.h b/src/main.h index 01d3f119e1..886cac1507 100644 --- a/src/main.h +++ b/src/main.h @@ -839,11 +839,6 @@ public: GetBlockHash().ToString()); } - void print() const - { - LogPrintf("%s\n", ToString()); - } - // Check whether this block index entry is valid up to the passed validity level. bool IsValid(enum BlockStatus nUpTo = BLOCK_VALID_TRANSACTIONS) const { @@ -935,11 +930,6 @@ public: hashPrev.ToString()); return str; } - - void print() const - { - LogPrintf("%s\n", ToString()); - } }; /** Capture information about block/transaction validation */ diff --git a/src/miner.cpp b/src/miner.cpp index 13aa6671c9..06acff1c33 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -42,14 +42,6 @@ public: COrphan(const CTransaction* ptxIn) : ptx(ptxIn), feeRate(0), dPriority(0) { } - - void print() const - { - LogPrintf("COrphan(hash=%s, dPriority=%.1f, fee=%s)\n", - ptx->GetHash().ToString(), dPriority, feeRate.ToString()); - BOOST_FOREACH(uint256 hash, setDependsOn) - LogPrintf(" setDependsOn %s\n", hash.ToString()); - } }; uint64_t nLastBlockTx = 0; diff --git a/src/netbase.cpp b/src/netbase.cpp index e1637cd404..e9207da330 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -874,11 +874,6 @@ uint64_t CNetAddr::GetHash() const return nRet; } -void CNetAddr::print() const -{ - LogPrintf("CNetAddr(%s)\n", ToString()); -} - // private extensions to enum Network, only returned by GetExtNetwork, // and only used in GetReachabilityFrom static const int NET_UNKNOWN = NET_MAX + 0; @@ -1107,11 +1102,6 @@ std::string CService::ToString() const return ToStringIPPort(); } -void CService::print() const -{ - LogPrintf("CService(%s)\n", ToString()); -} - void CService::SetPort(unsigned short portIn) { port = portIn; diff --git a/src/netbase.h b/src/netbase.h index bd8dbf9695..2df3c4474d 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -80,7 +80,6 @@ class CNetAddr bool GetInAddr(struct in_addr* pipv4Addr) const; std::vector GetGroup() const; int GetReachabilityFrom(const CNetAddr *paddrPartner = NULL) const; - void print() const; CNetAddr(const struct in6_addr& pipv6Addr); bool GetIn6Addr(struct in6_addr* pipv6Addr) const; @@ -145,7 +144,6 @@ class CService : public CNetAddr std::string ToString() const; std::string ToStringPort() const; std::string ToStringIPPort() const; - void print() const; CService(const struct in6_addr& ipv6Addr, unsigned short port); CService(const struct sockaddr_in6& addr); diff --git a/src/protocol.cpp b/src/protocol.cpp index 87b2f23873..341de0602a 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -144,9 +144,3 @@ std::string CInv::ToString() const { return strprintf("%s %s", GetCommand(), hash.ToString()); } - -void CInv::print() const -{ - LogPrintf("CInv(%s)\n", ToString()); -} - diff --git a/src/protocol.h b/src/protocol.h index 1f23274299..d7565584af 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -98,8 +98,6 @@ class CAddress : public CService READWRITE(*pip); ) - void print() const; - // TODO: make private (improves encapsulation) public: uint64_t nServices; @@ -130,7 +128,6 @@ class CInv bool IsKnownType() const; const char* GetCommand() const; std::string ToString() const; - void print() const; // TODO: make private (improves encapsulation) public: diff --git a/src/wallet.h b/src/wallet.h index 864a635ec7..34c699e979 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -824,11 +824,6 @@ public: { return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString(), i, nDepth, FormatMoney(tx->vout[i].nValue).c_str()); } - - void print() const - { - LogPrintf("%s\n", ToString()); - } }; From de1f05143f57e0aa0428b7c9c6a6ac515c3e0233 Mon Sep 17 00:00:00 2001 From: elichai Date: Wed, 20 Aug 2014 23:07:40 +0300 Subject: [PATCH 0563/1288] Added protobuf-compiler library to the Qt 5 Dependencies --- doc/build-unix.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/build-unix.md b/doc/build-unix.md index d08c327ff9..d5ddc90d40 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -111,7 +111,7 @@ To build with Qt 4 you need the following: For Qt 5 you need the following: - sudo apt-get install libqt5gui5 libqt5core5 libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev + sudo apt-get install libqt5gui5 libqt5core5 libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler libqrencode (optional) can be installed with: From b1ed7c29381b5eebfa38fe95e9a31b74f25c8412 Mon Sep 17 00:00:00 2001 From: Rose Toomey Date: Wed, 20 Aug 2014 18:26:29 -0400 Subject: [PATCH 0564/1288] Update build-osx.md The homebrew instructions were outdated - berkeley-db4 hasn't worked for months, based on the questions I'm seeing on Google/SO. So I added a section explaining how to install berkeley-db4 using homebrew and move on with your life. Thanks for the rest of the documentation! --- doc/build-osx.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/doc/build-osx.md b/doc/build-osx.md index bc42723b12..c19d87d38d 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -69,7 +69,7 @@ Instructions: Homebrew #### Install dependencies using Homebrew - brew install autoconf automake libtool berkeley-db4 boost miniupnpc openssl pkg-config protobuf qt + brew install autoconf automake libtool boost miniupnpc openssl pkg-config protobuf qt Note: After you have installed the dependencies, you should check that the Homebrew installed version of OpenSSL is the one available for compilation. You can check this by typing @@ -85,6 +85,29 @@ Rerunning "openssl version" should now return the correct version. If it doesn't, make sure `/usr/local/bin` comes before `/usr/bin` in your PATH. +#### Installing berkeley-db4 using Homebrew + +The homebrew package for berkeley-db4 has been broken for some time. It will install without Java though. + +Running this command takes you into brew's interactive mode, which allows you to configure, make, and install by hand: +``` +$ brew install https://raw.github.com/mxcl/homebrew/master/Library/Formula/berkeley-db4.rb -–without-java +``` + +These rest of these commands are run inside brew interactive mode: +``` +/private/tmp/berkeley-db4-UGpd0O/db-4.8.30 $ cd .. +/private/tmp/berkeley-db4-UGpd0O $ db-4.8.30/dist/configure --prefix=/usr/local/Cellar/berkeley-db4/4.8.30 --mandir=/usr/local/Cellar/berkeley-db4/4.8.30/share/man --enable-cxx +/private/tmp/berkeley-db4-UGpd0O $ make +/private/tmp/berkeley-db4-UGpd0O $ make install +/private/tmp/berkeley-db4-UGpd0O $ exit +``` + +After exiting, you'll get a warning that the install is keg-only, which means it wasn't symlinked to `/usr/local`. You don't need it to link it to build bitcoin, but if you want to, here's how: + + $ brew --force link berkeley-db4 + + ### Building `bitcoind` 1. Clone the github tree to get the source code and go into the directory. From 7f836c66bdd91db967ed6917d8cbf678c8994566 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 20 Aug 2014 22:43:36 -0400 Subject: [PATCH 0565/1288] rpc_tests: use BOOST_CHECK_EQUAL Upon failure, BOOST_CHECK_EQUAL provides additional diagnostic information, displaying that data that failed to match. --- src/test/rpc_tests.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/test/rpc_tests.cpp b/src/test/rpc_tests.cpp index 107c0f06e7..d5475a92bf 100644 --- a/src/test/rpc_tests.cpp +++ b/src/test/rpc_tests.cpp @@ -110,14 +110,14 @@ BOOST_AUTO_TEST_CASE(rpc_rawsign) BOOST_AUTO_TEST_CASE(rpc_format_monetary_values) { - BOOST_CHECK(write_string(ValueFromAmount(0LL), false) == "0.00000000"); - BOOST_CHECK(write_string(ValueFromAmount(1LL), false) == "0.00000001"); - BOOST_CHECK(write_string(ValueFromAmount(17622195LL), false) == "0.17622195"); - BOOST_CHECK(write_string(ValueFromAmount(50000000LL), false) == "0.50000000"); - BOOST_CHECK(write_string(ValueFromAmount(89898989LL), false) == "0.89898989"); - BOOST_CHECK(write_string(ValueFromAmount(100000000LL), false) == "1.00000000"); - BOOST_CHECK(write_string(ValueFromAmount(2099999999999990LL), false) == "20999999.99999990"); - BOOST_CHECK(write_string(ValueFromAmount(2099999999999999LL), false) == "20999999.99999999"); + BOOST_CHECK_EQUAL(write_string(ValueFromAmount(0LL), false), "0.00000000"); + BOOST_CHECK_EQUAL(write_string(ValueFromAmount(1LL), false), "0.00000001"); + BOOST_CHECK_EQUAL(write_string(ValueFromAmount(17622195LL), false), "0.17622195"); + BOOST_CHECK_EQUAL(write_string(ValueFromAmount(50000000LL), false), "0.50000000"); + BOOST_CHECK_EQUAL(write_string(ValueFromAmount(89898989LL), false), "0.89898989"); + BOOST_CHECK_EQUAL(write_string(ValueFromAmount(100000000LL), false), "1.00000000"); + BOOST_CHECK_EQUAL(write_string(ValueFromAmount(2099999999999990LL), false), "20999999.99999990"); + BOOST_CHECK_EQUAL(write_string(ValueFromAmount(2099999999999999LL), false), "20999999.99999999"); } static Value ValueFromString(const std::string &str) @@ -129,14 +129,14 @@ static Value ValueFromString(const std::string &str) BOOST_AUTO_TEST_CASE(rpc_parse_monetary_values) { - BOOST_CHECK(AmountFromValue(ValueFromString("0.00000001")) == 1LL); - BOOST_CHECK(AmountFromValue(ValueFromString("0.17622195")) == 17622195LL); - BOOST_CHECK(AmountFromValue(ValueFromString("0.5")) == 50000000LL); - BOOST_CHECK(AmountFromValue(ValueFromString("0.50000000")) == 50000000LL); - BOOST_CHECK(AmountFromValue(ValueFromString("0.89898989")) == 89898989LL); - BOOST_CHECK(AmountFromValue(ValueFromString("1.00000000")) == 100000000LL); - BOOST_CHECK(AmountFromValue(ValueFromString("20999999.9999999")) == 2099999999999990LL); - BOOST_CHECK(AmountFromValue(ValueFromString("20999999.99999999")) == 2099999999999999LL); + BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.00000001")), 1LL); + BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.17622195")), 17622195LL); + BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.5")), 50000000LL); + BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.50000000")), 50000000LL); + BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.89898989")), 89898989LL); + BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("1.00000000")), 100000000LL); + BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("20999999.9999999")), 2099999999999990LL); + BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("20999999.99999999")), 2099999999999999LL); } BOOST_AUTO_TEST_CASE(rpc_boostasiotocnetaddr) From 386efb7695debaf5f0f328a2e4c9abc342161665 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 20 Aug 2014 21:02:55 -0400 Subject: [PATCH 0566/1288] build: work around ccache/autotools warning-spamming bug When using clang and ccache, builds spew lots of: Clang: warning: argument unused during compilation Upstream bug: https://bugzilla.samba.org/show_bug.cgi?id=8118 This is harmless, bug annoying. If ccache is being used and the -Qunused-arguments flag is supported (clang), use it. --- configure.ac | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index 601ccf0a79..700f4ab709 100644 --- a/configure.ac +++ b/configure.ac @@ -656,6 +656,9 @@ if test "x$use_ccache" != "xno"; then fi AC_MSG_RESULT($use_ccache) fi +if test "x$use_ccache" = "xyes"; then + AX_CHECK_PREPROC_FLAG([-Qunused-arguments],[CPPFLAGS="-Qunused-arguments $CPPFLAGS"]) +fi dnl enable wallet AC_MSG_CHECKING([if wallet should be enabled]) From c897b1e732f524e525d1bd150326b7f0632c1b69 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 22 Aug 2014 15:41:38 -0400 Subject: [PATCH 0567/1288] depends: add a fallback path in case package sources go missing If a source url fails to download, try again at $FALLBACK_DOWNLOAD_PATH/file.name, where FALLBACK_DOWNLOAD_PATH can be overridden by the user. --- depends/Makefile | 1 + depends/README.usage | 1 + depends/funcs.mk | 14 ++++++++------ depends/packages/native_cctools.mk | 10 +++++----- depends/packages/native_comparisontool.mk | 12 ++++++------ 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/depends/Makefile b/depends/Makefile index bd5f0bf536..8075c66b78 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -6,6 +6,7 @@ SDK_PATH ?= $(BASEDIR)/SDKs NO_QT ?= NO_WALLET ?= NO_UPNP ?= +FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources BUILD = $(shell ./config.guess) HOST ?= $(BUILD) diff --git a/depends/README.usage b/depends/README.usage index f50714f1f1..0aacefbf94 100644 --- a/depends/README.usage +++ b/depends/README.usage @@ -18,6 +18,7 @@ The following can be set when running make: make FOO=bar SOURCES_PATH: downloaded sources will be placed here BASE_CACHE: built packages will be placed here SDK_PATH: Path where sdk's can be found (used by OSX) +FALLBACK_DOWNLOAD_PATH: If a source file can't be fetched, try here before giving up NO_QT: Don't download/build/cache qt and its dependencies NO_WALLET: Don't download/build/cache libs needed to enable the wallet NO_UPNP: Don't download/build/cache packages needed for enabling upnp diff --git a/depends/funcs.mk b/depends/funcs.mk index b5d8b0ee2e..280706efb3 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -20,11 +20,13 @@ $(sort $(foreach dep,$(2),$(2) $(call int_get_all_dependencies,$(1),$($(dep)_dep endef define fetch_file -(test -f $(SOURCES_PATH)/$(3) || \ - ( mkdir -p $$($(1)_extract_dir) && $(build_DOWNLOAD) "$$($(1)_extract_dir)/$(3).temp" "$(2)" && \ - echo "$(4) $$($(1)_extract_dir)/$(3).temp" > $$($(1)_extract_dir)/.$(3).hash && \ - $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$(3).hash && \ - mv $$($(1)_extract_dir)/$(3).temp $(SOURCES_PATH)/$(3) )) +(test -f $(SOURCES_PATH)/$(4) || \ + ( mkdir -p $$($(1)_extract_dir) && \ + ( $(build_DOWNLOAD) "$$($(1)_extract_dir)/$(3).temp" "$(2)/$(3)" || \ + $(build_DOWNLOAD) "$$($(1)_extract_dir)/$(3).temp" "$(FALLBACK_DOWNLOAD_PATH)/$(3)" ) && \ + echo "$(5) $$($(1)_extract_dir)/$(4).temp" > $$($(1)_extract_dir)/.$(4).hash && \ + $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$(4).hash && \ + mv $$($(1)_extract_dir)/$(4).temp $(SOURCES_PATH)/$(4) )) endef define int_get_build_recipe_hash @@ -65,7 +67,7 @@ $(1)_download_path_fixed=$(subst :,\:,$$($(1)_download_path)) #default commands -$(1)_fetch_cmds ?= $(call fetch_file,$(1),$(subst \:,:,$$($(1)_download_path_fixed)/$$($(1)_download_file)),$($(1)_file_name),$($(1)_sha256_hash)) +$(1)_fetch_cmds ?= $(call fetch_file,$(1),$(subst \:,:,$$($(1)_download_path_fixed)),$$($(1)_download_file),$($(1)_file_name),$($(1)_sha256_hash)) $(1)_extract_cmds ?= mkdir -p $$($(1)_extract_dir) && echo "$$($(1)_sha256_hash) $$($(1)_source)" > $$($(1)_extract_dir)/.$$($(1)_file_name).hash && $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$$($(1)_file_name).hash && tar --strip-components=1 -xf $$($(1)_source) $(1)_preprocess_cmds ?= $(1)_build_cmds ?= diff --git a/depends/packages/native_cctools.mk b/depends/packages/native_cctools.mk index e3ba9685b4..ad989cb544 100644 --- a/depends/packages/native_cctools.mk +++ b/depends/packages/native_cctools.mk @@ -23,11 +23,11 @@ $(package)_clang_file_name=clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz $(package)_clang_sha256_hash=b9d57a88f9514fa1f327a1a703756d0c1c960f4c58494a5bd80313245d13ffff define $(package)_fetch_cmds -$(call fetch_file,$(package),$($(package)_download_path)/$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \ -$(call fetch_file,$(package),$($(package)_ld64_download_path)/$($(package)_ld64_download_file),$($(package)_ld64_file_name),$($(package)_ld64_sha256_hash)) && \ -$(call fetch_file,$(package),$($(package)_dyld_download_path)/$($(package)_dyld_download_file),$($(package)_dyld_file_name),$($(package)_dyld_sha256_hash)) && \ -$(call fetch_file,$(package),$($(package)_clang_download_path)/$($(package)_clang_download_file),$($(package)_clang_file_name),$($(package)_clang_sha256_hash)) && \ -$(call fetch_file,$(package),$($(package)_toolchain4_download_path)/$($(package)_toolchain4_download_file),$($(package)_toolchain4_file_name),$($(package)_toolchain4_sha256_hash)) +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_ld64_download_path),$($(package)_ld64_download_file),$($(package)_ld64_file_name),$($(package)_ld64_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_dyld_download_path),$($(package)_dyld_download_file),$($(package)_dyld_file_name),$($(package)_dyld_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_clang_download_path),$($(package)_clang_download_file),$($(package)_clang_file_name),$($(package)_clang_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_toolchain4_download_path),$($(package)_toolchain4_download_file),$($(package)_toolchain4_file_name),$($(package)_toolchain4_sha256_hash)) endef define $(package)_set_vars diff --git a/depends/packages/native_comparisontool.mk b/depends/packages/native_comparisontool.mk index 5eef73052f..003923d7dd 100644 --- a/depends/packages/native_comparisontool.mk +++ b/depends/packages/native_comparisontool.mk @@ -15,12 +15,12 @@ $(package)_slf4j-jdk14_file_name=slf4j-jdk14-1.6.4.jar $(package)_slf4j-jdk14_sha256_hash=064bd81796710f713f9f4a2309c0e032309934c2d2b4f7d3b6958325e584e13f define $(package)_fetch_cmds -$(call fetch_file,$(package),$($(package)_download_path)/$($(package)_file_name),$($(package)_file_name),$($(package)_sha256_hash)) && \ -$(call fetch_file,$(package),$($(package)_download_path)/$($(package)_guava_file_name),$($(package)_guava_file_name),$($(package)_guava_sha256_hash)) && \ -$(call fetch_file,$(package),$($(package)_download_path)/$($(package)_h2_file_name),$($(package)_h2_file_name),$($(package)_h2_sha256_hash)) && \ -$(call fetch_file,$(package),$($(package)_download_path)/$($(package)_sc-light-jdk15on_file_name),$($(package)_sc-light-jdk15on_file_name),$($(package)_sc-light-jdk15on_sha256_hash)) && \ -$(call fetch_file,$(package),$($(package)_download_path)/$($(package)_slf4j-api_file_name),$($(package)_slf4j-api_file_name),$($(package)_slf4j-api_sha256_hash)) && \ -$(call fetch_file,$(package),$($(package)_download_path)/$($(package)_slf4j-jdk14_file_name),$($(package)_slf4j-jdk14_file_name),$($(package)_slf4j-jdk14_sha256_hash)) +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_file_name),$($(package)_file_name),$($(package)_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_guava_file_name),$($(package)_guava_file_name),$($(package)_guava_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_h2_file_name),$($(package)_h2_file_name),$($(package)_h2_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_sc-light-jdk15on_file_name),$($(package)_sc-light-jdk15on_file_name),$($(package)_sc-light-jdk15on_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_slf4j-api_file_name),$($(package)_slf4j-api_file_name),$($(package)_slf4j-api_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_slf4j-jdk14_file_name),$($(package)_slf4j-jdk14_file_name),$($(package)_slf4j-jdk14_sha256_hash)) endef define $(package)_extract_cmds From 5a61553a143b0a37d59ac739529560edc1bf4d90 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Sat, 23 Aug 2014 04:15:32 +0100 Subject: [PATCH 0568/1288] Build-osx: Force Fix. Removes the unnecessary directions that encourage people to force install openssl into /usr/local with Homebrew. Unnecessary, and potentially quite risky. @theuni okayed this removal [here](https://github.com/bitcoin/bitcoin/pull/4740#issuecomment-53076840). --- doc/build-osx.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/doc/build-osx.md b/doc/build-osx.md index c19d87d38d..4dfde0f35a 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -71,19 +71,7 @@ Instructions: Homebrew brew install autoconf automake libtool boost miniupnpc openssl pkg-config protobuf qt -Note: After you have installed the dependencies, you should check that the Homebrew installed version of OpenSSL is the one available for compilation. You can check this by typing - - openssl version - -into Terminal. You should see OpenSSL 1.0.1h 5 Jun 2014. - -If not, you can ensure that the Homebrew OpenSSL is correctly linked by running - - brew link openssl --force - -Rerunning "openssl version" should now return the correct version. If it -doesn't, make sure `/usr/local/bin` comes before `/usr/bin` in your -PATH. +Make sure `/usr/local/bin` comes before `/usr/bin` in your PATH. #### Installing berkeley-db4 using Homebrew From df920c6d49137a667dbca5dd0763cb4e7de3a3b1 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Sat, 23 Aug 2014 04:36:20 +0100 Subject: [PATCH 0569/1288] Build-osx: Force Fix. Kills the "make" line as well. --- doc/build-osx.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/build-osx.md b/doc/build-osx.md index 4dfde0f35a..ade9eb466b 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -71,8 +71,6 @@ Instructions: Homebrew brew install autoconf automake libtool boost miniupnpc openssl pkg-config protobuf qt -Make sure `/usr/local/bin` comes before `/usr/bin` in your PATH. - #### Installing berkeley-db4 using Homebrew The homebrew package for berkeley-db4 has been broken for some time. It will install without Java though. From c2c02f3fa99385f5a5be722fda6f71522c93bdaa Mon Sep 17 00:00:00 2001 From: jtimon Date: Sat, 28 Jun 2014 14:03:06 +0200 Subject: [PATCH 0570/1288] Move UpdateTime to pow --- src/main.cpp | 28 ---------------------------- src/main.h | 2 -- src/miner.cpp | 4 ++-- src/pow.cpp | 10 ++++++++++ src/pow.h | 2 ++ src/rpcmining.cpp | 2 +- 6 files changed, 15 insertions(+), 33 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index d7543e3f13..fab5af73bb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1419,25 +1419,6 @@ void static InvalidBlockFound(CBlockIndex *pindex, const CValidationState &state } } -void UpdateTime(CBlockHeader& block, const CBlockIndex* pindexPrev) -{ - block.nTime = max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime()); - - // Updating time can change work required on testnet: - if (Params().AllowMinDifficultyBlocks()) - block.nBits = GetNextWorkRequired(pindexPrev, &block); -} - - - - - - - - - - - void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight) { bool ret; @@ -3291,15 +3272,6 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp) return nLoaded > 0; } - - - - - - - - - ////////////////////////////////////////////////////////////////////////////// // // CAlert diff --git a/src/main.h b/src/main.h index 886cac1507..adb7d68bcf 100644 --- a/src/main.h +++ b/src/main.h @@ -163,8 +163,6 @@ bool GetTransaction(const uint256 &hash, CTransaction &tx, uint256 &hashBlock, b bool ActivateBestChain(CValidationState &state); int64_t GetBlockValue(int nHeight, int64_t nFees); -void UpdateTime(CBlockHeader& block, const CBlockIndex* pindexPrev); - /** Create a new block index entry for a given block hash */ CBlockIndex * InsertBlockIndex(uint256 hash); /** Verify a signature */ diff --git a/src/miner.cpp b/src/miner.cpp index 06acff1c33..97b74695a7 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -305,7 +305,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) // Fill in header pblock->hashPrevBlock = pindexPrev->GetBlockHash(); - UpdateTime(*pblock, pindexPrev); + UpdateTime(pblock, pindexPrev); pblock->nBits = GetNextWorkRequired(pindexPrev, pblock); pblock->nNonce = 0; pblocktemplate->vTxSigOps[0] = GetLegacySigOpCount(pblock->vtx[0]); @@ -538,7 +538,7 @@ void static BitcoinMiner(CWallet *pwallet) break; // Update nTime every few seconds - UpdateTime(*pblock, pindexPrev); + UpdateTime(pblock, pindexPrev); if (Params().AllowMinDifficultyBlocks()) { // Changing pblock->nTime can change work required on testnet: diff --git a/src/pow.cpp b/src/pow.cpp index c0d0a7ca20..a99c582d7d 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -8,6 +8,7 @@ #include "chainparams.h" #include "core.h" #include "main.h" +#include "timedata.h" #include "uint256.h" unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock) @@ -117,3 +118,12 @@ unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime) bnResult = bnLimit; return bnResult.GetCompact(); } + +void UpdateTime(CBlockHeader* pblock, const CBlockIndex* pindexPrev) +{ + pblock->nTime = std::max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime()); + + // Updating time can change work required on testnet: + if (Params().AllowMinDifficultyBlocks()) + pblock->nBits = GetNextWorkRequired(pindexPrev, pblock); +} diff --git a/src/pow.h b/src/pow.h index 0ce5b48766..9880621788 100644 --- a/src/pow.h +++ b/src/pow.h @@ -20,4 +20,6 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits); /** Calculate the minimum amount of work a received block needs, without knowing its direct parent */ unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime); +void UpdateTime(CBlockHeader* block, const CBlockIndex* pindexPrev); + #endif diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index edab427cbf..429d789278 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -457,7 +457,7 @@ Value getblocktemplate(const Array& params, bool fHelp) CBlock* pblock = &pblocktemplate->block; // pointer for convenience // Update nTime - UpdateTime(*pblock, pindexPrev); + UpdateTime(pblock, pindexPrev); pblock->nNonce = 0; Array transactions; From b343c1a1e34f851e70649ad1f49855a7d878f9ef Mon Sep 17 00:00:00 2001 From: jtimon Date: Sat, 5 Jul 2014 12:05:33 +0200 Subject: [PATCH 0571/1288] Move CBlockIndex::GetBlockWork() to pow::GetProofIncrement(nBits) --- src/main.h | 13 ++----------- src/pow.cpp | 15 +++++++++++++++ src/pow.h | 2 ++ 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/main.h b/src/main.h index adb7d68bcf..a15a0e16d0 100644 --- a/src/main.h +++ b/src/main.h @@ -14,6 +14,7 @@ #include "coins.h" #include "core.h" #include "net.h" +#include "pow.h" #include "script.h" #include "sync.h" #include "txmempool.h" @@ -792,17 +793,7 @@ public: uint256 GetBlockWork() const { - uint256 bnTarget; - bool fNegative; - bool fOverflow; - bnTarget.SetCompact(nBits, &fNegative, &fOverflow); - if (fNegative || fOverflow || bnTarget == 0) - return 0; - // We need to compute 2**256 / (bnTarget+1), but we can't represent 2**256 - // as it's too large for a uint256. However, as 2**256 is at least as large - // as bnTarget+1, it is equal to ((2**256 - bnTarget - 1) / (bnTarget+1)) + 1, - // or ~bnTarget / (nTarget+1) + 1. - return (~bnTarget / (bnTarget + 1)) + 1; + return GetProofIncrement(nBits); } enum { nMedianTimeSpan=11 }; diff --git a/src/pow.cpp b/src/pow.cpp index a99c582d7d..d76928bda2 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -127,3 +127,18 @@ void UpdateTime(CBlockHeader* pblock, const CBlockIndex* pindexPrev) if (Params().AllowMinDifficultyBlocks()) pblock->nBits = GetNextWorkRequired(pindexPrev, pblock); } + +uint256 GetProofIncrement(unsigned int nBits) +{ + uint256 bnTarget; + bool fNegative; + bool fOverflow; + bnTarget.SetCompact(nBits, &fNegative, &fOverflow); + if (fNegative || fOverflow || bnTarget == 0) + return 0; + // We need to compute 2**256 / (bnTarget+1), but we can't represent 2**256 + // as it's too large for a uint256. However, as 2**256 is at least as large + // as bnTarget+1, it is equal to ((2**256 - bnTarget - 1) / (bnTarget+1)) + 1, + // or ~bnTarget / (nTarget+1) + 1. + return (~bnTarget / (bnTarget + 1)) + 1; +} diff --git a/src/pow.h b/src/pow.h index 9880621788..6aea713fc4 100644 --- a/src/pow.h +++ b/src/pow.h @@ -22,4 +22,6 @@ unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime); void UpdateTime(CBlockHeader* block, const CBlockIndex* pindexPrev); +uint256 GetProofIncrement(unsigned int nBits); + #endif From 654871d43677947d124673c9e0dd2984f0d3ca61 Mon Sep 17 00:00:00 2001 From: jtimon Date: Fri, 20 Jun 2014 20:55:42 +0200 Subject: [PATCH 0572/1288] replace ComputeMinWork with CheckMinWork --- src/main.cpp | 7 +------ src/pow.cpp | 23 +++++++++++++++-------- src/pow.h | 4 ++-- src/test/DoS_tests.cpp | 6 +----- 4 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index fab5af73bb..9e07f43c44 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2410,12 +2410,7 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex return state.DoS(100, error("CheckBlockHeader() : block with timestamp before last checkpoint"), REJECT_CHECKPOINT, "time-too-old"); } - bool fOverflow = false; - uint256 bnNewBlock; - bnNewBlock.SetCompact(block.nBits, NULL, &fOverflow); - uint256 bnRequired; - bnRequired.SetCompact(ComputeMinWork(pcheckpoint->nBits, deltaTime)); - if (fOverflow || bnNewBlock > bnRequired) + if (!CheckMinWork(block.nBits, pcheckpoint->nBits, deltaTime)) { return state.DoS(100, error("CheckBlockHeader() : block with too little proof-of-work"), REJECT_INVALID, "bad-diffbits"); diff --git a/src/pow.cpp b/src/pow.cpp index d76928bda2..1d2b743b48 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -94,29 +94,36 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits) } // -// minimum amount of work that could possibly be required nTime after -// minimum work required was nBase +// true if nBits is greater than the minimum amount of work that could +// possibly be required deltaTime after minimum work required was nBase // -unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime) +bool CheckMinWork(unsigned int nBits, unsigned int nBase, int64_t deltaTime) { + bool fOverflow = false; + uint256 bnNewBlock; + bnNewBlock.SetCompact(nBits, NULL, &fOverflow); + if (fOverflow) + return false; + const uint256 &bnLimit = Params().ProofOfWorkLimit(); // Testnet has min-difficulty blocks // after Params().TargetSpacing()*2 time between blocks: - if (Params().AllowMinDifficultyBlocks() && nTime > Params().TargetSpacing()*2) - return bnLimit.GetCompact(); + if (Params().AllowMinDifficultyBlocks() && deltaTime > Params().TargetSpacing()*2) + return bnNewBlock <= bnLimit; uint256 bnResult; bnResult.SetCompact(nBase); - while (nTime > 0 && bnResult < bnLimit) + while (deltaTime > 0 && bnResult < bnLimit) { // Maximum 400% adjustment... bnResult *= 4; // ... in best-case exactly 4-times-normal target time - nTime -= Params().TargetTimespan()*4; + deltaTime -= Params().TargetTimespan()*4; } if (bnResult > bnLimit) bnResult = bnLimit; - return bnResult.GetCompact(); + + return bnNewBlock <= bnResult; } void UpdateTime(CBlockHeader* pblock, const CBlockIndex* pindexPrev) diff --git a/src/pow.h b/src/pow.h index 6aea713fc4..f350d763f4 100644 --- a/src/pow.h +++ b/src/pow.h @@ -17,8 +17,8 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead /** Check whether a block hash satisfies the proof-of-work requirement specified by nBits */ bool CheckProofOfWork(uint256 hash, unsigned int nBits); -/** Calculate the minimum amount of work a received block needs, without knowing its direct parent */ -unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime); +/** Check the work is more than the minimum a received block needs, without knowing its direct parent */ +bool CheckMinWork(unsigned int nBits, unsigned int nBase, int64_t deltaTime); void UpdateTime(CBlockHeader* block, const CBlockIndex* pindexPrev); diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index 5e17555e7a..bb15db43b1 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -106,11 +106,7 @@ static bool CheckNBits(unsigned int nbits1, int64_t time1, unsigned int nbits2, return CheckNBits(nbits2, time2, nbits1, time1); int64_t deltaTime = time2-time1; - uint256 required; - required.SetCompact(ComputeMinWork(nbits1, deltaTime)); - uint256 have; - have.SetCompact(nbits2); - return (have <= required); + return CheckMinWork(nbits2, nbits1, deltaTime); } BOOST_AUTO_TEST_CASE(DoS_checknbits) From 65f3fa8d11a9b2e139d4963514fdc1beb04dfb68 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 30 May 2014 19:14:01 -0400 Subject: [PATCH 0573/1288] build: osx: Fix incomplete framework packaging for codesigning Starting with 10.9, Framework versions must be signed individually, rather than as a single bundle version, in order to be properly codesigned. This change ensures that the proper plist files and symlinks are present prior to packaging. --- contrib/macdeploy/macdeployqtplus | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index 23b57a76b3..5ab6a222dd 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -37,7 +37,10 @@ class FrameworkInfo(object): self.sourceFilePath = "" self.destinationDirectory = "" self.sourceResourcesDirectory = "" + self.sourceVersionContentsDirectory = "" + self.sourceContentsDirectory = "" self.destinationResourcesDirectory = "" + self.destinationVersionContentsDirectory = "" def __eq__(self, other): if self.__class__ == other.__class__: @@ -141,7 +144,11 @@ class FrameworkInfo(object): info.destinationDirectory = os.path.join(cls.bundleFrameworkDirectory, info.frameworkName, info.binaryDirectory) info.sourceResourcesDirectory = os.path.join(info.frameworkPath, "Resources") + info.sourceContentsDirectory = os.path.join(info.frameworkPath, "Contents") + info.sourceVersionContentsDirectory = os.path.join(info.frameworkPath, "Versions", info.version, "Contents") info.destinationResourcesDirectory = os.path.join(cls.bundleFrameworkDirectory, info.frameworkName, "Resources") + info.destinationContentsDirectory = os.path.join(cls.bundleFrameworkDirectory, info.frameworkName, "Contents") + info.destinationVersionContentsDirectory = os.path.join(cls.bundleFrameworkDirectory, info.frameworkName, "Versions", info.version, "Contents") return info @@ -275,6 +282,13 @@ def copyFramework(framework, path, verbose): os.chmod(toPath, permissions.st_mode | stat.S_IWRITE) if not framework.isDylib(): # Copy resources for real frameworks + + linkfrom = os.path.join(path, "Contents/Frameworks/", framework.frameworkName, framework.binaryName) + linkto = os.path.join(framework.binaryPath) + if not os.path.exists(linkfrom): + os.symlink(linkto, linkfrom) + if verbose >= 2: + print "Linked:", linkfrom, "->", linkto fromResourcesDir = framework.sourceResourcesDirectory if os.path.exists(fromResourcesDir): toResourcesDir = os.path.join(path, framework.destinationResourcesDirectory) @@ -282,6 +296,21 @@ def copyFramework(framework, path, verbose): if verbose >= 3: print "Copied resources:", fromResourcesDir print " to:", toResourcesDir + fromContentsDir = framework.sourceVersionContentsDirectory + if not os.path.exists(fromContentsDir): + fromContentsDir = framework.sourceContentsDirectory + if os.path.exists(fromContentsDir): + toContentsDir = os.path.join(path, framework.destinationVersionContentsDirectory) + shutil.copytree(fromContentsDir, toContentsDir) + contentslinkfrom = os.path.join(path, framework.destinationContentsDirectory) + if not os.path.exists(contentslinkfrom): + contentslinkto = os.path.join("Versions/", framework.version, "Contents") + os.symlink(contentslinkto, contentslinkfrom) + if verbose >= 3: + print "Linked:", contentslinkfrom, "->", contentslinkto + if verbose >= 3: + print "Copied Contents:", fromContentsDir + print " to:", toContentsDir elif framework.frameworkName.startswith("libQtGui"): # Copy qt_menu.nib (applies to non-framework layout) qtMenuNibSourcePath = os.path.join(framework.frameworkDirectory, "Resources", "qt_menu.nib") qtMenuNibDestinationPath = os.path.join(path, "Contents", "Resources", "qt_menu.nib") From b0875eb3fea0934f3a6651fbc22aac12e33e15e5 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 24 Aug 2014 02:08:05 +0200 Subject: [PATCH 0574/1288] Allow BatchWrite to destroy its input, reducing copying --- src/coins.cpp | 16 +++++++++------- src/coins.h | 10 ++++++---- src/txdb.cpp | 7 +++++-- src/txdb.h | 2 +- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/coins.cpp b/src/coins.cpp index fe40911db7..6137b51c55 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -57,7 +57,7 @@ bool CCoinsView::SetCoins(const uint256 &txid, const CCoins &coins) { return fal bool CCoinsView::HaveCoins(const uint256 &txid) { return false; } uint256 CCoinsView::GetBestBlock() { return uint256(0); } bool CCoinsView::SetBestBlock(const uint256 &hashBlock) { return false; } -bool CCoinsView::BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBlock) { return false; } +bool CCoinsView::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { return false; } bool CCoinsView::GetStats(CCoinsStats &stats) { return false; } @@ -68,7 +68,7 @@ bool CCoinsViewBacked::HaveCoins(const uint256 &txid) { return base->HaveCoins(t uint256 CCoinsViewBacked::GetBestBlock() { return base->GetBestBlock(); } bool CCoinsViewBacked::SetBestBlock(const uint256 &hashBlock) { return base->SetBestBlock(hashBlock); } void CCoinsViewBacked::SetBackend(CCoinsView &viewIn) { base = &viewIn; } -bool CCoinsViewBacked::BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBlock) { return base->BatchWrite(mapCoins, hashBlock); } +bool CCoinsViewBacked::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { return base->BatchWrite(mapCoins, hashBlock); } bool CCoinsViewBacked::GetStats(CCoinsStats &stats) { return base->GetStats(stats); } CCoinsKeyHasher::CCoinsKeyHasher() : salt(GetRandHash()) {} @@ -130,17 +130,19 @@ bool CCoinsViewCache::SetBestBlock(const uint256 &hashBlockIn) { return true; } -bool CCoinsViewCache::BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBlockIn) { - for (CCoinsMap::const_iterator it = mapCoins.begin(); it != mapCoins.end(); it++) - cacheCoins[it->first] = it->second; +bool CCoinsViewCache::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlockIn) { + for (CCoinsMap::iterator it = mapCoins.begin(); it != mapCoins.end();) { + cacheCoins[it->first].swap(it->second); + CCoinsMap::iterator itOld = it++; + mapCoins.erase(itOld); + } hashBlock = hashBlockIn; return true; } bool CCoinsViewCache::Flush() { bool fOk = base->BatchWrite(cacheCoins, hashBlock); - if (fOk) - cacheCoins.clear(); + cacheCoins.clear(); return fOk; } diff --git a/src/coins.h b/src/coins.h index ff60288163..2b657299e3 100644 --- a/src/coins.h +++ b/src/coins.h @@ -291,8 +291,9 @@ public: // Modify the currently active block hash virtual bool SetBestBlock(const uint256 &hashBlock); - // Do a bulk modification (multiple SetCoins + one SetBestBlock) - virtual bool BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBlock); + // Do a bulk modification (multiple SetCoins + one SetBestBlock). + // The passed mapCoins can be modified. + virtual bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock); // Calculate statistics about the unspent transaction output set virtual bool GetStats(CCoinsStats &stats); @@ -316,7 +317,7 @@ public: uint256 GetBestBlock(); bool SetBestBlock(const uint256 &hashBlock); void SetBackend(CCoinsView &viewIn); - bool BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBlock); + bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock); bool GetStats(CCoinsStats &stats); }; @@ -337,7 +338,7 @@ public: bool HaveCoins(const uint256 &txid); uint256 GetBestBlock(); bool SetBestBlock(const uint256 &hashBlock); - bool BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBlock); + bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock); // Return a modifiable reference to a CCoins. Check HaveCoins first. // Many methods explicitly require a CCoinsViewCache because of this method, to reduce @@ -346,6 +347,7 @@ public: // Push the modifications applied to this cache to its base. // Failure to call this method before destruction will cause the changes to be forgotten. + // If false is returned, the state of this cache (and its backing view) will be undefined. bool Flush(); // Calculate the size of the cache (in number of transactions) diff --git a/src/txdb.cpp b/src/txdb.cpp index d3d05c58d7..7c0683aaf3 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -54,12 +54,15 @@ bool CCoinsViewDB::SetBestBlock(const uint256 &hashBlock) { return db.WriteBatch(batch); } -bool CCoinsViewDB::BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBlock) { +bool CCoinsViewDB::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { LogPrint("coindb", "Committing %u changed transactions to coin database...\n", (unsigned int)mapCoins.size()); CLevelDBBatch batch; - for (CCoinsMap::const_iterator it = mapCoins.begin(); it != mapCoins.end(); it++) + for (CCoinsMap::iterator it = mapCoins.begin(); it != mapCoins.end();) { BatchWriteCoins(batch, it->first, it->second); + CCoinsMap::iterator itOld = it++; + mapCoins.erase(itOld); + } if (hashBlock != uint256(0)) BatchWriteHashBestChain(batch, hashBlock); diff --git a/src/txdb.h b/src/txdb.h index 7d670c2542..099f151776 100644 --- a/src/txdb.h +++ b/src/txdb.h @@ -37,7 +37,7 @@ public: bool HaveCoins(const uint256 &txid); uint256 GetBestBlock(); bool SetBestBlock(const uint256 &hashBlock); - bool BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBlock); + bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock); bool GetStats(CCoinsStats &stats); }; From fff7455deda80bf483422dd7d7c2446e93522f2d Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 24 Aug 2014 02:08:25 +0200 Subject: [PATCH 0575/1288] Make CScript::clear() release its memory --- src/script.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/script.h b/src/script.h index 7cb863d1c9..1e2cc94efe 100644 --- a/src/script.h +++ b/src/script.h @@ -730,6 +730,12 @@ public: { return CScriptID(Hash160(*this)); } + + void clear() + { + // The default std::vector::clear() does not release memory. + std::vector().swap(*this); + } }; /** Compact serializer for scripts. From 476eb7eb53f680494952865a823e5cf9459da2b9 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sat, 23 Aug 2014 21:46:12 -0400 Subject: [PATCH 0576/1288] Update linearize scripts. Break into two steps: * Generate hash list * Build data file(s) from local bitcoind blocks/ directory. This supports building one large bootstrap.dat, or multiple smaller blocks/blkNNNNN.dat files. --- contrib/linearize/README.md | 31 ++- contrib/linearize/example-linearize.cfg | 14 +- contrib/linearize/linearize-data.py | 182 ++++++++++++++++++ .../{linearize.py => linearize-hashes.py} | 40 +--- 4 files changed, 227 insertions(+), 40 deletions(-) create mode 100755 contrib/linearize/linearize-data.py rename contrib/linearize/{linearize.py => linearize-hashes.py} (74%) mode change 100644 => 100755 diff --git a/contrib/linearize/README.md b/contrib/linearize/README.md index 70b9f034cd..8d06d53b10 100644 --- a/contrib/linearize/README.md +++ b/contrib/linearize/README.md @@ -1,2 +1,29 @@ -### Linearize ### -Construct a linear, no-fork, best version of the blockchain. \ No newline at end of file +# Linearize +Construct a linear, no-fork, best version of the blockchain. + +## Step 1: Download hash list + + $ ./linearize-hashes.py linearize.cfg > hashlist.txt + +Required configuration file settings for linearize-hashes: +* RPC: rpcuser, rpcpassword + +Optional config file setting for linearize-hashes: +* RPC: host, port +* Block chain: min_height, max_height + +## Step 2: Copy local block data + + $ ./linearize-data.py linearize.cfg + +Required configuration file settings: +* "input": bitcoind blocks/ directory containing blkNNNNN.dat +* "hashlist": text file containing list of block hashes, linearized-hashes.py +output. +* "output_file": bootstrap.dat + or +* "output": output directory for linearized blocks/blkNNNNN.dat output + +Optional config file setting for linearize-data: +* "netmagic": network magic number + diff --git a/contrib/linearize/example-linearize.cfg b/contrib/linearize/example-linearize.cfg index f5cdab5325..9c3270d653 100644 --- a/contrib/linearize/example-linearize.cfg +++ b/contrib/linearize/example-linearize.cfg @@ -1,12 +1,16 @@ -# bitcoind RPC settings +# bitcoind RPC settings (linearize-hashes) rpcuser=someuser rpcpassword=somepassword host=127.0.0.1 port=8332 -# bootstrap.dat settings -netmagic=f9beb4d9 -max_height=279000 -output=bootstrap.dat +# bootstrap.dat hashlist settings (linearize-hashes) +max_height=313000 + +# bootstrap.dat input/output settings (linearize-data) +netmagic=f9beb4d9 +input=/home/example/.bitcoin/blocks +output_file=/home/example/Downloads/bootstrap.dat +hashlist=hashlist.txt diff --git a/contrib/linearize/linearize-data.py b/contrib/linearize/linearize-data.py new file mode 100755 index 0000000000..77bae6e3c6 --- /dev/null +++ b/contrib/linearize/linearize-data.py @@ -0,0 +1,182 @@ +#!/usr/bin/python +# +# linearize-data.py: Construct a linear, no-fork version of the chain. +# +# Copyright (c) 2013 The Bitcoin developers +# Distributed under the MIT/X11 software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +# + +import json +import struct +import re +import base64 +import httplib +import sys +import hashlib + +MAX_OUT_SZ = 128 * 1024 * 1024 + +settings = {} + + +def uint32(x): + return x & 0xffffffffL + +def bytereverse(x): + return uint32(( ((x) << 24) | (((x) << 8) & 0x00ff0000) | + (((x) >> 8) & 0x0000ff00) | ((x) >> 24) )) + +def bufreverse(in_buf): + out_words = [] + for i in range(0, len(in_buf), 4): + word = struct.unpack('@I', in_buf[i:i+4])[0] + out_words.append(struct.pack('@I', bytereverse(word))) + return ''.join(out_words) + +def wordreverse(in_buf): + out_words = [] + for i in range(0, len(in_buf), 4): + out_words.append(in_buf[i:i+4]) + out_words.reverse() + return ''.join(out_words) + +def calc_hdr_hash(rawblock): + blk_hdr = rawblock[:80] + + hash1 = hashlib.sha256() + hash1.update(blk_hdr) + hash1_o = hash1.digest() + + hash2 = hashlib.sha256() + hash2.update(hash1_o) + hash2_o = hash2.digest() + + return hash2_o + +def calc_hash_str(rawblock): + hash = calc_hdr_hash(rawblock) + hash = bufreverse(hash) + hash = wordreverse(hash) + hash_str = hash.encode('hex') + return hash_str + +def get_block_hashes(settings): + blkindex = [] + f = open(settings['hashlist'], "r") + for line in f: + line = line.rstrip() + blkindex.append(line) + + print("Read " + str(len(blkindex)) + " hashes") + + return blkindex + +def mkblockset(blkindex): + blkmap = {} + for hash in blkindex: + blkmap[hash] = True + return blkmap + +def copydata(settings, blkindex, blkset): + inFn = 0 + inF = None + outFn = 0 + outsz = 0 + outF = None + blkCount = 0 + + fileOutput = True + if 'output' in settings: + fileOutput = False + + while True: + if not inF: + fname = "%s/blk%05d.dat" % (settings['input'], inFn) + print("Input file" + fname) + inF = open(fname, "rb") + + inhdr = inF.read(8) + if (not inhdr or (inhdr[0] == "\0")): + inF.close() + inF = None + inFn = inFn + 1 + continue + + inMagic = inhdr[:4] + if (inMagic != settings['netmagic']): + print("Invalid magic:" + inMagic) + return + inLenLE = inhdr[4:] + su = struct.unpack(" MAX_OUT_SZ): + outF.close() + outF = None + outFn = outFn + 1 + outsz = 0 + if not outF: + if fileOutput: + fname = settings['output_file'] + else: + fname = "%s/blk%05d.dat" % (settings['output'], outFn) + print("Output file" + fname) + outF = open(fname, "wb") + + outF.write(inhdr) + outF.write(rawblock) + outsz = outsz + inLen + 8 + + blkCount = blkCount + 1 + + if (blkCount % 1000) == 0: + print("Wrote " + str(blkCount) + " blocks") + +if __name__ == '__main__': + if len(sys.argv) != 2: + print "Usage: linearize-data.py CONFIG-FILE" + sys.exit(1) + + f = open(sys.argv[1]) + for line in f: + # skip comment lines + m = re.search('^\s*#', line) + if m: + continue + + # parse key=value lines + m = re.search('^(\w+)\s*=\s*(\S.*)$', line) + if m is None: + continue + settings[m.group(1)] = m.group(2) + f.close() + + if 'netmagic' not in settings: + settings['netmagic'] = 'f9beb4d9' + if 'input' not in settings: + settings['input'] = 'input' + if 'hashlist' not in settings: + settings['hashlist'] = 'hashlist.txt' + + settings['netmagic'] = settings['netmagic'].decode('hex') + + if 'output_file' not in settings and 'output' not in settings: + print("Missing output file / directory") + sys.exit(1) + + blkindex = get_block_hashes(settings) + blkset = mkblockset(blkindex) + + if not "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f" in blkset: + print("not found") + else: + copydata(settings, blkindex, blkset) + + diff --git a/contrib/linearize/linearize.py b/contrib/linearize/linearize-hashes.py old mode 100644 new mode 100755 similarity index 74% rename from contrib/linearize/linearize.py rename to contrib/linearize/linearize-hashes.py index 650f7d3684..791b71bc33 --- a/contrib/linearize/linearize.py +++ b/contrib/linearize/linearize-hashes.py @@ -1,7 +1,6 @@ #!/usr/bin/python # -# linearize.py: Construct a linear, no-fork, best version of the blockchain. -# +# linearize-hashes.py: List blocks in a linear, no-fork version of the chain. # # Copyright (c) 2013 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying @@ -15,9 +14,6 @@ import base64 import httplib import sys -ERR_SLEEP = 15 -MAX_NONCE = 1000000L - settings = {} class BitcoinRPC: @@ -62,34 +58,18 @@ class BitcoinRPC: def getblockhash(self, index): return self.rpc('getblockhash', [index]) -def getblock(rpc, settings, n): - hash = rpc.getblockhash(n) - hexdata = rpc.getblock(hash, False) - data = hexdata.decode('hex') - - return data - -def get_blocks(settings): +def get_block_hashes(settings): rpc = BitcoinRPC(settings['host'], settings['port'], settings['rpcuser'], settings['rpcpassword']) - outf = open(settings['output'], 'ab') - for height in xrange(settings['min_height'], settings['max_height']+1): - data = getblock(rpc, settings, height) + hash = rpc.getblockhash(height) - outhdr = settings['netmagic'] - outhdr += struct.pack(" Date: Sat, 23 Aug 2014 22:59:16 -0400 Subject: [PATCH 0577/1288] contrib/linearize: split output files based on new-timestamp-year or max-file-size --- contrib/linearize/README.md | 3 ++ contrib/linearize/example-linearize.cfg | 1 + contrib/linearize/linearize-data.py | 44 ++++++++++++++++++++----- 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/contrib/linearize/README.md b/contrib/linearize/README.md index 8d06d53b10..b5c6e7824e 100644 --- a/contrib/linearize/README.md +++ b/contrib/linearize/README.md @@ -26,4 +26,7 @@ output. Optional config file setting for linearize-data: * "netmagic": network magic number +* "max_out_sz": maximum output file size (default 1000*1000*1000) +* "split_year": Split files when a new year is first seen, in addition to +reaching a maximum file size. diff --git a/contrib/linearize/example-linearize.cfg b/contrib/linearize/example-linearize.cfg index 9c3270d653..071345f23a 100644 --- a/contrib/linearize/example-linearize.cfg +++ b/contrib/linearize/example-linearize.cfg @@ -13,4 +13,5 @@ netmagic=f9beb4d9 input=/home/example/.bitcoin/blocks output_file=/home/example/Downloads/bootstrap.dat hashlist=hashlist.txt +split_year=1 diff --git a/contrib/linearize/linearize-data.py b/contrib/linearize/linearize-data.py index 77bae6e3c6..ea94f25fae 100755 --- a/contrib/linearize/linearize-data.py +++ b/contrib/linearize/linearize-data.py @@ -14,8 +14,7 @@ import base64 import httplib import sys import hashlib - -MAX_OUT_SZ = 128 * 1024 * 1024 +import datetime settings = {} @@ -41,9 +40,7 @@ def wordreverse(in_buf): out_words.reverse() return ''.join(out_words) -def calc_hdr_hash(rawblock): - blk_hdr = rawblock[:80] - +def calc_hdr_hash(blk_hdr): hash1 = hashlib.sha256() hash1.update(blk_hdr) hash1_o = hash1.digest() @@ -54,13 +51,18 @@ def calc_hdr_hash(rawblock): return hash2_o -def calc_hash_str(rawblock): - hash = calc_hdr_hash(rawblock) +def calc_hash_str(blk_hdr): + hash = calc_hdr_hash(blk_hdr) hash = bufreverse(hash) hash = wordreverse(hash) hash_str = hash.encode('hex') return hash_str +def get_blk_year(blk_hdr): + members = struct.unpack(" MAX_OUT_SZ): + if not fileOutput and ((outsz + inLen) > maxOutSz): outF.close() outF = None outFn = outFn + 1 outsz = 0 + + if splitYear: + blkYear = get_blk_year(blk_hdr) + if blkYear > lastYear: + print("New year " + str(blkYear) + " @ " + hash_str) + lastYear = blkYear + if outF: + outF.close() + outF = None + outFn = outFn + 1 + outsz = 0 + if not outF: if fileOutput: fname = settings['output_file'] @@ -164,7 +184,13 @@ if __name__ == '__main__': settings['input'] = 'input' if 'hashlist' not in settings: settings['hashlist'] = 'hashlist.txt' + if 'split_year' not in settings: + settings['split_year'] = 0 + if 'max_out_sz' not in settings: + settings['max_out_sz'] = 1000L * 1000 * 1000 + settings['max_out_sz'] = long(settings['max_out_sz']) + settings['split_year'] = int(settings['split_year']) settings['netmagic'] = settings['netmagic'].decode('hex') if 'output_file' not in settings and 'output' not in settings: From 75400a2a413c082de2ba5fc2f1da9dc86fd1d924 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sun, 24 Aug 2014 01:18:24 -0400 Subject: [PATCH 0578/1288] contrib/linearize: Guarantee that output is generated in-order This was typically ensured implicitly by virtue of normal bitcoind operation. Adding an explicit check provides a stronger guarantee, and it is cheap to add. --- contrib/linearize/linearize-data.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/linearize/linearize-data.py b/contrib/linearize/linearize-data.py index ea94f25fae..2d57d245f6 100755 --- a/contrib/linearize/linearize-data.py +++ b/contrib/linearize/linearize-data.py @@ -125,6 +125,12 @@ def copydata(settings, blkindex, blkset): print("Skipping unknown block " + hash_str) continue + if blkindex[blkCount] != hash_str: + print("Out of order block.") + print("Expected " + blkindex[blkCount]) + print("Got " + hash_str) + sys.exit(1) + if not fileOutput and ((outsz + inLen) > maxOutSz): outF.close() outF = None From 8f5a423344b277fbb63eb4295ce5928e16c6dc9d Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sun, 24 Aug 2014 01:40:40 -0400 Subject: [PATCH 0579/1288] contrib/linearize: split block files based on year-month, not just year --- contrib/linearize/linearize-data.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/contrib/linearize/linearize-data.py b/contrib/linearize/linearize-data.py index 2d57d245f6..3a4c9759fe 100755 --- a/contrib/linearize/linearize-data.py +++ b/contrib/linearize/linearize-data.py @@ -58,10 +58,11 @@ def calc_hash_str(blk_hdr): hash_str = hash.encode('hex') return hash_str -def get_blk_year(blk_hdr): +def get_blk_dt(blk_hdr): members = struct.unpack(" lastYear: - print("New year " + str(blkYear) + " @ " + hash_str) - lastYear = blkYear + if timestampSplit: + blkDate = get_blk_dt(blk_hdr) + if blkDate > lastDate: + print("New month " + blkDate.strftime("%Y-%m") + " @ " + hash_str) + lastDate = blkDate if outF: outF.close() outF = None @@ -190,13 +191,13 @@ if __name__ == '__main__': settings['input'] = 'input' if 'hashlist' not in settings: settings['hashlist'] = 'hashlist.txt' - if 'split_year' not in settings: - settings['split_year'] = 0 + if 'split_timestamp' not in settings: + settings['split_timestamp'] = 0 if 'max_out_sz' not in settings: settings['max_out_sz'] = 1000L * 1000 * 1000 settings['max_out_sz'] = long(settings['max_out_sz']) - settings['split_year'] = int(settings['split_year']) + settings['split_timestamp'] = int(settings['split_timestamp']) settings['netmagic'] = settings['netmagic'].decode('hex') if 'output_file' not in settings and 'output' not in settings: From aa41ac216eb51d61512b4cadc95c809e094215ce Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Sun, 24 Aug 2014 21:16:51 -0400 Subject: [PATCH 0580/1288] Test IsPushOnly() with invalid push --- src/script.cpp | 2 ++ src/test/script_tests.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/script.cpp b/src/script.cpp index 942e8810db..d6d6684f44 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1874,9 +1874,11 @@ bool CScript::IsPushOnly() const const_iterator pc = begin(); while (pc < end()) { + // Note how a script with an invalid PUSHDATA returns False. opcodetype opcode; if (!GetOp(pc, opcode)) return false; + // Note that IsPushOnly() *does* consider OP_RESERVED to be a // push-type opcode, however execution of OP_RESERVED fails, so // it's not relevant to P2SH as the scriptSig would fail prior to diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index bc9f31c077..77c44501ab 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -394,4 +394,15 @@ BOOST_AUTO_TEST_CASE(script_standard_push) } } +BOOST_AUTO_TEST_CASE(script_IsPushOnly_on_invalid_scripts) +{ + // IsPushOnly returns false when given a script containing only pushes that + // are invalid due to truncation. IsPushOnly() is consensus critical + // because P2SH evaluation uses it, although this specific behavior should + // not be consensus critical as the P2SH evaluation would fail first due to + // the invalid push. Still, it doesn't hurt to test it explicitly. + static const unsigned char direct[] = { 1 }; + BOOST_CHECK(!CScript(direct, direct+sizeof(direct)).IsPushOnly()); +} + BOOST_AUTO_TEST_SUITE_END() From 9380d019a18b27c7ddb4f3956a329a516d017531 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 20 Aug 2014 13:00:00 -0400 Subject: [PATCH 0581/1288] travis: initial descriptor --- .travis.yml | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..2073e71769 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,57 @@ +# errata: +# - A travis bug causes caches to trample eachother when using the same +# compiler key (which we don't use anyway). This is worked around for now by +# using the phony compilers "true X". These can be removed when the travis +# bug is fixed. See: https://github.com/travis-ci/casher/issues/6 + +os: linux +language: cpp +env: + global: + - MAKEJOBS=-j3 + - RUN_TESTS=false + - CCACHE_SIZE=100M + - CCACHE_TEMPDIR=/tmp/.ccache-temp + - CCACHE_COMPRESS=1 + - BASE_OUTDIR=$TRAVIS_BUILD_DIR/out +cache: + apt: true + directories: + - depends/built + - $HOME/.ccache +matrix: + fast_finish: true + include: + - compiler: "true 1" + env: HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="NO_QT=1" GOAL="install" BITCOIN_CONFIG"--enable-glibc-back-compat" + - compiler: "true 2" + env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_QT=1 NO_WALLET=1 NO_UPNP=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" + - compiler: "true 3" + env: HOST=x86_64-unknown-linux-gnu RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" + - compiler: "true 4" + env: HOST=i686-pc-linux-gnu PACKAGES="g++-multilib" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" + - compiler: "true 6" + env: HOST=x86_64-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev" GOAL="deploy" + - compiler: "true 7" + env: HOST=i686-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-dev" GOAL="deploy" +install: + - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi + - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-upgrade -qq $PACKAGES; fi +before_script: + - unset CC; unset CXX + - mkdir -p depends/SDKs + - make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS || (echo "Build failure. Verbose build follows." && make -C depends V=1 HOST=$HOST $DEP_OPTS) +script: + - OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST + - BITCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$TRAVIS_BUILD_DIR/depends/$HOST --bindir=$OUTDIR/bin --libdir=$OUTDIR/lib" + - depends/$HOST/native/bin/ccache --max-size=$CCACHE_SIZE + - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then export CCACHE_READONLY=1; fi + - ./autogen.sh + - ./configure --cache-file=config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false) + - make distdir PACKAGE=bitcoin VERSION=$HOST + - cd bitcoin-$HOST + - ./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false) + - make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false ) + - if [ "$RUN_TESTS" = "true" ]; then make check; fi +after_script: + - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then (echo "Upload goes here. Something like: scp -r $BASE_OUTDIR server" || echo "upload failed"); fi From 425c7a83899f7ccf5343a24319bc19e1e77363da Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 21 Aug 2014 13:11:31 -0400 Subject: [PATCH 0582/1288] travis: add doc --- doc/travis-ci.txt | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 doc/travis-ci.txt diff --git a/doc/travis-ci.txt b/doc/travis-ci.txt new file mode 100644 index 0000000000..01f7d02a86 --- /dev/null +++ b/doc/travis-ci.txt @@ -0,0 +1,39 @@ +Support for using travis-ci has been added in order to automate pull-testing. +See https://travis-ci.org/ for more info + +This procedure is different than the pull-tester that came before it in a few +ways. + +There is nothing to administer. This is a major feature as it means +that builds have no local state. Because there is no ability to login to the +builders to install packages (tools, dependencies, etc), the entire build +procedure must instead be controlled by a declarative script (.travis.yml). +This script declares each build configuration, creates virtual machines as +necessary, builds, then discards the virtual machines. + +A build matrix is constructed to test a wide range of configurations, rather +than a single pass/fail. This helps to catch build failures and logic errors +that present on platforms other than the ones the author has tested. This +matrix is defined in the build script and can be changed at any time. + +All builders use the dependency-generator in the depends dir, rather than +using apt-get to install build dependencies. This guarantees that the tester +is using the same versions as Gitian, so the build results are nearly identical +to what would be found in a final release. However, this also means that builds +will fail if new dependencies are introduced without being added to the +dependency generator. + +In order to avoid rebuilding all dependencies for each build, the binaries are +cached and re-used when possible. Changes in the dependency-generator will +trigger cache-invalidation and rebuilds as necessary. + +These caches can be manually removed if necessary. This is one of the the very few +manual operations that is possible with Travis, and it can be done by the +Bitcoin Core committer via the Travis web interface. + +In some cases, secure strings may be needed for hiding sensitive info such as +private keys or URLs. The travis client may be used to create these strings: +http://docs.travis-ci.com/user/encryption-keys/ + +For the details of the build descriptor, see the official docs: +http://docs.travis-ci.com/user/build-configuration/ From 92bb6f2f1729192703dd49bb982c1dd4c0062fa0 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 26 Aug 2014 02:26:41 +0200 Subject: [PATCH 0583/1288] Bypass reloading blocks from disk --- src/main.cpp | 43 ++++++++++++++++++++++++++----------------- src/main.h | 2 +- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 947494ce62..a5c1103ef4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1975,15 +1975,19 @@ static int64_t nTimeFlush = 0; static int64_t nTimeChainState = 0; static int64_t nTimePostConnect = 0; -// Connect a new block to chainActive. -bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew) { +// Connect a new block to chainActive. pblock is either NULL or a pointer to a CBlock +// corresponding to pindexNew, to bypass loading it again from disk. +bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock *pblock) { assert(pindexNew->pprev == chainActive.Tip()); mempool.check(pcoinsTip); // Read block from disk. int64_t nTime1 = GetTimeMicros(); CBlock block; - if (!ReadBlockFromDisk(block, pindexNew)) - return state.Abort(_("Failed to read block")); + if (!pblock) { + if (!ReadBlockFromDisk(block, pindexNew)) + return state.Abort(_("Failed to read block")); + pblock = █ + } // Apply the block atomically to the chain state. int64_t nTime2 = GetTimeMicros(); nTimeReadFromDisk += nTime2 - nTime1; int64_t nTime3; @@ -1991,7 +1995,7 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew) { { CCoinsViewCache view(*pcoinsTip, true); CInv inv(MSG_BLOCK, pindexNew->GetBlockHash()); - if (!ConnectBlock(block, state, pindexNew, view)) { + if (!ConnectBlock(*pblock, state, pindexNew, view)) { if (state.IsInvalid()) InvalidBlockFound(pindexNew, state); return error("ConnectTip() : ConnectBlock %s failed", pindexNew->GetBlockHash().ToString()); @@ -2010,7 +2014,7 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew) { LogPrint("bench", " - Writing chainstate: %.2fms [%.2fs]\n", (nTime5 - nTime4) * 0.001, nTimeChainState * 0.000001); // Remove conflicting transactions from the mempool. list txConflicted; - mempool.removeForBlock(block.vtx, pindexNew->nHeight, txConflicted); + mempool.removeForBlock(pblock->vtx, pindexNew->nHeight, txConflicted); mempool.check(pcoinsTip); // Update chainActive & related variables. UpdateTip(pindexNew); @@ -2020,8 +2024,8 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew) { SyncWithWallets(tx, NULL); } // ... and about transactions that got confirmed: - BOOST_FOREACH(const CTransaction &tx, block.vtx) { - SyncWithWallets(tx, &block); + BOOST_FOREACH(const CTransaction &tx, pblock->vtx) { + SyncWithWallets(tx, pblock); } int64_t nTime6 = GetTimeMicros(); nTimePostConnect += nTime6 - nTime5; nTimeTotal += nTime6 - nTime1; LogPrint("bench", " - Connect postprocess: %.2fms [%.2fs]\n", (nTime6 - nTime5) * 0.001, nTimePostConnect * 0.000001); @@ -2070,7 +2074,8 @@ static CBlockIndex* FindMostWorkChain() { } // Try to make some progress towards making pindexMostWork the active block. -static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMostWork) { +// pblock is either NULL or a pointer to a CBlock corresponding to pindexMostWork. +static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMostWork, CBlock *pblock) { AssertLockHeld(cs_main); bool fInvalidFound = false; const CBlockIndex *pindexOldTip = chainActive.Tip(); @@ -2085,14 +2090,15 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo // Build list of new blocks to connect. std::vector vpindexToConnect; vpindexToConnect.reserve(pindexMostWork->nHeight - (pindexFork ? pindexFork->nHeight : -1)); - while (pindexMostWork && pindexMostWork != pindexFork) { - vpindexToConnect.push_back(pindexMostWork); - pindexMostWork = pindexMostWork->pprev; + CBlockIndex *pindexIter = pindexMostWork; + while (pindexIter && pindexIter != pindexFork) { + vpindexToConnect.push_back(pindexIter); + pindexIter = pindexIter->pprev; } // Connect new blocks. BOOST_REVERSE_FOREACH(CBlockIndex *pindexConnect, vpindexToConnect) { - if (!ConnectTip(state, pindexConnect)) { + if (!ConnectTip(state, pindexConnect, pindexConnect == pindexMostWork ? pblock : NULL)) { if (state.IsInvalid()) { // The block violates a consensus rule. if (!state.CorruptionPossible()) @@ -2133,7 +2139,10 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo return true; } -bool ActivateBestChain(CValidationState &state) { +// Make the best chain active, in multiple steps. The result is either failure +// or an activated best chain. pblock is either NULL or a pointer to a block +// that is already loaded (to avoid loading it again from disk). +bool ActivateBestChain(CValidationState &state, CBlock *pblock) { CBlockIndex *pindexNewTip = NULL; CBlockIndex *pindexMostWork = NULL; do { @@ -2148,7 +2157,7 @@ bool ActivateBestChain(CValidationState &state) { if (pindexMostWork == NULL || pindexMostWork == chainActive.Tip()) return true; - if (!ActivateBestChainStep(state, pindexMostWork)) + if (!ActivateBestChainStep(state, pindexMostWork, pblock && pblock->GetHash() == pindexMostWork->GetBlockHash() ? pblock : NULL)) return false; pindexNewTip = chainActive.Tip(); @@ -2696,7 +2705,7 @@ bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBl } - if (!ActivateBestChain(state)) + if (!ActivateBestChain(state, pblock)) return error("ProcessBlock() : ActivateBestChain failed"); return true; @@ -3136,7 +3145,7 @@ bool InitBlockIndex() { CBlockIndex *pindex = AddToBlockIndex(block); if (!ReceivedBlockTransactions(block, state, pindex, blockPos)) return error("LoadBlockIndex() : genesis block not accepted"); - if (!ActivateBestChain(state)) + if (!ActivateBestChain(state, &block)) return error("LoadBlockIndex() : genesis block cannot be activated"); } catch(std::runtime_error &e) { return error("LoadBlockIndex() : failed to initialize block database: %s", e.what()); diff --git a/src/main.h b/src/main.h index 886cac1507..444c887204 100644 --- a/src/main.h +++ b/src/main.h @@ -160,7 +160,7 @@ std::string GetWarnings(std::string strFor); /** Retrieve a transaction (from memory pool, or from disk, if possible) */ bool GetTransaction(const uint256 &hash, CTransaction &tx, uint256 &hashBlock, bool fAllowSlow = false); /** Find the best known block, and make it the tip of the block chain */ -bool ActivateBestChain(CValidationState &state); +bool ActivateBestChain(CValidationState &state, CBlock *pblock = NULL); int64_t GetBlockValue(int nHeight, int64_t nFees); void UpdateTime(CBlockHeader& block, const CBlockIndex* pindexPrev); From ffb4c210bc0b78bd8cbccdb7ccb80dde918a01b0 Mon Sep 17 00:00:00 2001 From: Daniel Kraft Date: Sat, 19 Jul 2014 15:39:50 +0200 Subject: [PATCH 0584/1288] Mark LevelDB "Read" and "Exists" functions as const. Mark the "Read" and "Exists" functions in CLevelDBWrapper as "const". They do not change anything in the DB, by definition. --- src/leveldbwrapper.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/leveldbwrapper.h b/src/leveldbwrapper.h index 043a56bf38..452df92839 100644 --- a/src/leveldbwrapper.h +++ b/src/leveldbwrapper.h @@ -82,7 +82,7 @@ public: CLevelDBWrapper(const boost::filesystem::path &path, size_t nCacheSize, bool fMemory = false, bool fWipe = false); ~CLevelDBWrapper(); - template bool Read(const K& key, V& value) throw(leveldb_error) { + template bool Read(const K& key, V& value) const throw(leveldb_error) { CDataStream ssKey(SER_DISK, CLIENT_VERSION); ssKey.reserve(ssKey.GetSerializeSize(key)); ssKey << key; @@ -111,7 +111,7 @@ public: return WriteBatch(batch, fSync); } - template bool Exists(const K& key) throw(leveldb_error) { + template bool Exists(const K& key) const throw(leveldb_error) { CDataStream ssKey(SER_DISK, CLIENT_VERSION); ssKey.reserve(ssKey.GetSerializeSize(key)); ssKey << key; From a3dc587a62f5d12aea1ff8139198bf0441535c5f Mon Sep 17 00:00:00 2001 From: Daniel Kraft Date: Sat, 19 Jul 2014 16:42:48 +0200 Subject: [PATCH 0585/1288] Make appropriate getter-routines "const" in CCoinsView. Mark the "Get"/"Have" routines in CCoinsView and subclasses as "const". --- src/coins.cpp | 44 +++++++++++++++++++++++++++----------------- src/coins.h | 41 +++++++++++++++++++++++------------------ src/txdb.cpp | 13 ++++++++----- src/txdb.h | 8 ++++---- src/txmempool.cpp | 4 ++-- src/txmempool.h | 4 ++-- 6 files changed, 66 insertions(+), 48 deletions(-) diff --git a/src/coins.cpp b/src/coins.cpp index 6137b51c55..7bfb84ef3e 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -52,30 +52,30 @@ bool CCoins::Spend(int nPos) { } -bool CCoinsView::GetCoins(const uint256 &txid, CCoins &coins) { return false; } +bool CCoinsView::GetCoins(const uint256 &txid, CCoins &coins) const { return false; } bool CCoinsView::SetCoins(const uint256 &txid, const CCoins &coins) { return false; } -bool CCoinsView::HaveCoins(const uint256 &txid) { return false; } -uint256 CCoinsView::GetBestBlock() { return uint256(0); } +bool CCoinsView::HaveCoins(const uint256 &txid) const { return false; } +uint256 CCoinsView::GetBestBlock() const { return uint256(0); } bool CCoinsView::SetBestBlock(const uint256 &hashBlock) { return false; } bool CCoinsView::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { return false; } -bool CCoinsView::GetStats(CCoinsStats &stats) { return false; } +bool CCoinsView::GetStats(CCoinsStats &stats) const { return false; } CCoinsViewBacked::CCoinsViewBacked(CCoinsView &viewIn) : base(&viewIn) { } -bool CCoinsViewBacked::GetCoins(const uint256 &txid, CCoins &coins) { return base->GetCoins(txid, coins); } +bool CCoinsViewBacked::GetCoins(const uint256 &txid, CCoins &coins) const { return base->GetCoins(txid, coins); } bool CCoinsViewBacked::SetCoins(const uint256 &txid, const CCoins &coins) { return base->SetCoins(txid, coins); } -bool CCoinsViewBacked::HaveCoins(const uint256 &txid) { return base->HaveCoins(txid); } -uint256 CCoinsViewBacked::GetBestBlock() { return base->GetBestBlock(); } +bool CCoinsViewBacked::HaveCoins(const uint256 &txid) const { return base->HaveCoins(txid); } +uint256 CCoinsViewBacked::GetBestBlock() const { return base->GetBestBlock(); } bool CCoinsViewBacked::SetBestBlock(const uint256 &hashBlock) { return base->SetBestBlock(hashBlock); } void CCoinsViewBacked::SetBackend(CCoinsView &viewIn) { base = &viewIn; } bool CCoinsViewBacked::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { return base->BatchWrite(mapCoins, hashBlock); } -bool CCoinsViewBacked::GetStats(CCoinsStats &stats) { return base->GetStats(stats); } +bool CCoinsViewBacked::GetStats(CCoinsStats &stats) const { return base->GetStats(stats); } CCoinsKeyHasher::CCoinsKeyHasher() : salt(GetRandHash()) {} CCoinsViewCache::CCoinsViewCache(CCoinsView &baseIn, bool fDummy) : CCoinsViewBacked(baseIn), hashBlock(0) { } -bool CCoinsViewCache::GetCoins(const uint256 &txid, CCoins &coins) { +bool CCoinsViewCache::GetCoins(const uint256 &txid, CCoins &coins) const { if (cacheCoins.count(txid)) { coins = cacheCoins[txid]; return true; @@ -99,19 +99,29 @@ CCoinsMap::iterator CCoinsViewCache::FetchCoins(const uint256 &txid) { return ret; } +CCoinsMap::const_iterator CCoinsViewCache::FetchCoins(const uint256 &txid) const { + /* Avoid redundant implementation with the const-cast. */ + return const_cast(this)->FetchCoins(txid); +} + CCoins &CCoinsViewCache::GetCoins(const uint256 &txid) { CCoinsMap::iterator it = FetchCoins(txid); assert(it != cacheCoins.end()); return it->second; } +const CCoins &CCoinsViewCache::GetCoins(const uint256 &txid) const { + /* Avoid redundant implementation with the const-cast. */ + return const_cast(this)->GetCoins(txid); +} + bool CCoinsViewCache::SetCoins(const uint256 &txid, const CCoins &coins) { cacheCoins[txid] = coins; return true; } -bool CCoinsViewCache::HaveCoins(const uint256 &txid) { - CCoinsMap::iterator it = FetchCoins(txid); +bool CCoinsViewCache::HaveCoins(const uint256 &txid) const { + CCoinsMap::const_iterator it = FetchCoins(txid); // We're using vtx.empty() instead of IsPruned here for performance reasons, // as we only care about the case where an transaction was replaced entirely // in a reorganization (which wipes vout entirely, as opposed to spending @@ -119,7 +129,7 @@ bool CCoinsViewCache::HaveCoins(const uint256 &txid) { return (it != cacheCoins.end() && !it->second.vout.empty()); } -uint256 CCoinsViewCache::GetBestBlock() { +uint256 CCoinsViewCache::GetBestBlock() const { if (hashBlock == uint256(0)) hashBlock = base->GetBestBlock(); return hashBlock; @@ -146,18 +156,18 @@ bool CCoinsViewCache::Flush() { return fOk; } -unsigned int CCoinsViewCache::GetCacheSize() { +unsigned int CCoinsViewCache::GetCacheSize() const { return cacheCoins.size(); } -const CTxOut &CCoinsViewCache::GetOutputFor(const CTxIn& input) +const CTxOut &CCoinsViewCache::GetOutputFor(const CTxIn& input) const { const CCoins &coins = GetCoins(input.prevout.hash); assert(coins.IsAvailable(input.prevout.n)); return coins.vout[input.prevout.n]; } -int64_t CCoinsViewCache::GetValueIn(const CTransaction& tx) +int64_t CCoinsViewCache::GetValueIn(const CTransaction& tx) const { if (tx.IsCoinBase()) return 0; @@ -169,7 +179,7 @@ int64_t CCoinsViewCache::GetValueIn(const CTransaction& tx) return nResult; } -bool CCoinsViewCache::HaveInputs(const CTransaction& tx) +bool CCoinsViewCache::HaveInputs(const CTransaction& tx) const { if (!tx.IsCoinBase()) { // first check whether information about the prevout hash is available @@ -190,7 +200,7 @@ bool CCoinsViewCache::HaveInputs(const CTransaction& tx) return true; } -double CCoinsViewCache::GetPriority(const CTransaction &tx, int nHeight) +double CCoinsViewCache::GetPriority(const CTransaction &tx, int nHeight) const { if (tx.IsCoinBase()) return 0.0; diff --git a/src/coins.h b/src/coins.h index 2b657299e3..08913531d8 100644 --- a/src/coins.h +++ b/src/coins.h @@ -276,17 +276,17 @@ class CCoinsView { public: // Retrieve the CCoins (unspent transaction outputs) for a given txid - virtual bool GetCoins(const uint256 &txid, CCoins &coins); + virtual bool GetCoins(const uint256 &txid, CCoins &coins) const; // Modify the CCoins for a given txid virtual bool SetCoins(const uint256 &txid, const CCoins &coins); // Just check whether we have data for a given txid. // This may (but cannot always) return true for fully spent transactions - virtual bool HaveCoins(const uint256 &txid); + virtual bool HaveCoins(const uint256 &txid) const; // Retrieve the block hash whose state this CCoinsView currently represents - virtual uint256 GetBestBlock(); + virtual uint256 GetBestBlock() const; // Modify the currently active block hash virtual bool SetBestBlock(const uint256 &hashBlock); @@ -296,7 +296,7 @@ public: virtual bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock); // Calculate statistics about the unspent transaction output set - virtual bool GetStats(CCoinsStats &stats); + virtual bool GetStats(CCoinsStats &stats) const; // As we use CCoinsViews polymorphically, have a virtual destructor virtual ~CCoinsView() {} @@ -311,14 +311,14 @@ protected: public: CCoinsViewBacked(CCoinsView &viewIn); - bool GetCoins(const uint256 &txid, CCoins &coins); + bool GetCoins(const uint256 &txid, CCoins &coins) const; bool SetCoins(const uint256 &txid, const CCoins &coins); - bool HaveCoins(const uint256 &txid); - uint256 GetBestBlock(); + bool HaveCoins(const uint256 &txid) const; + uint256 GetBestBlock() const; bool SetBestBlock(const uint256 &hashBlock); void SetBackend(CCoinsView &viewIn); bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock); - bool GetStats(CCoinsStats &stats); + bool GetStats(CCoinsStats &stats) const; }; @@ -326,17 +326,20 @@ public: class CCoinsViewCache : public CCoinsViewBacked { protected: - uint256 hashBlock; - CCoinsMap cacheCoins; + + /* Make mutable so that we can "fill the cache" even from Get-methods + declared as "const". */ + mutable uint256 hashBlock; + mutable CCoinsMap cacheCoins; public: CCoinsViewCache(CCoinsView &baseIn, bool fDummy = false); // Standard CCoinsView methods - bool GetCoins(const uint256 &txid, CCoins &coins); + bool GetCoins(const uint256 &txid, CCoins &coins) const; bool SetCoins(const uint256 &txid, const CCoins &coins); - bool HaveCoins(const uint256 &txid); - uint256 GetBestBlock(); + bool HaveCoins(const uint256 &txid) const; + uint256 GetBestBlock() const; bool SetBestBlock(const uint256 &hashBlock); bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock); @@ -344,6 +347,7 @@ public: // Many methods explicitly require a CCoinsViewCache because of this method, to reduce // copying. CCoins &GetCoins(const uint256 &txid); + const CCoins &GetCoins(const uint256 &txid) const; // Push the modifications applied to this cache to its base. // Failure to call this method before destruction will cause the changes to be forgotten. @@ -351,7 +355,7 @@ public: bool Flush(); // Calculate the size of the cache (in number of transactions) - unsigned int GetCacheSize(); + unsigned int GetCacheSize() const; /** Amount of bitcoins coming in to a transaction Note that lightweight clients may not know anything besides the hash of previous transactions, @@ -360,18 +364,19 @@ public: @param[in] tx transaction for which we are checking input total @return Sum of value of all inputs (scriptSigs) */ - int64_t GetValueIn(const CTransaction& tx); + int64_t GetValueIn(const CTransaction& tx) const; // Check whether all prevouts of the transaction are present in the UTXO set represented by this view - bool HaveInputs(const CTransaction& tx); + bool HaveInputs(const CTransaction& tx) const; // Return priority of tx at height nHeight - double GetPriority(const CTransaction &tx, int nHeight); + double GetPriority(const CTransaction &tx, int nHeight) const; - const CTxOut &GetOutputFor(const CTxIn& input); + const CTxOut &GetOutputFor(const CTxIn& input) const; private: CCoinsMap::iterator FetchCoins(const uint256 &txid); + CCoinsMap::const_iterator FetchCoins(const uint256 &txid) const; }; #endif diff --git a/src/txdb.cpp b/src/txdb.cpp index 7c0683aaf3..2349514def 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -27,7 +27,7 @@ void static BatchWriteHashBestChain(CLevelDBBatch &batch, const uint256 &hash) { CCoinsViewDB::CCoinsViewDB(size_t nCacheSize, bool fMemory, bool fWipe) : db(GetDataDir() / "chainstate", nCacheSize, fMemory, fWipe) { } -bool CCoinsViewDB::GetCoins(const uint256 &txid, CCoins &coins) { +bool CCoinsViewDB::GetCoins(const uint256 &txid, CCoins &coins) const { return db.Read(make_pair('c', txid), coins); } @@ -37,11 +37,11 @@ bool CCoinsViewDB::SetCoins(const uint256 &txid, const CCoins &coins) { return db.WriteBatch(batch); } -bool CCoinsViewDB::HaveCoins(const uint256 &txid) { +bool CCoinsViewDB::HaveCoins(const uint256 &txid) const { return db.Exists(make_pair('c', txid)); } -uint256 CCoinsViewDB::GetBestBlock() { +uint256 CCoinsViewDB::GetBestBlock() const { uint256 hashBestChain; if (!db.Read('B', hashBestChain)) return uint256(0); @@ -105,8 +105,11 @@ bool CBlockTreeDB::ReadLastBlockFile(int &nFile) { return Read('l', nFile); } -bool CCoinsViewDB::GetStats(CCoinsStats &stats) { - boost::scoped_ptr pcursor(db.NewIterator()); +bool CCoinsViewDB::GetStats(CCoinsStats &stats) const { + /* It seems that there are no "const iterators" for LevelDB. Since we + only need read operations on it, use a const-cast to get around + that restriction. */ + leveldb::Iterator *pcursor = const_cast(&db)->NewIterator(); pcursor->SeekToFirst(); CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION); diff --git a/src/txdb.h b/src/txdb.h index 099f151776..f0b6b9e1dd 100644 --- a/src/txdb.h +++ b/src/txdb.h @@ -32,13 +32,13 @@ protected: public: CCoinsViewDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false); - bool GetCoins(const uint256 &txid, CCoins &coins); + bool GetCoins(const uint256 &txid, CCoins &coins) const; bool SetCoins(const uint256 &txid, const CCoins &coins); - bool HaveCoins(const uint256 &txid); - uint256 GetBestBlock(); + bool HaveCoins(const uint256 &txid) const; + uint256 GetBestBlock() const; bool SetBestBlock(const uint256 &hashBlock); bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock); - bool GetStats(CCoinsStats &stats); + bool GetStats(CCoinsStats &stats) const; }; /** Access to the block database (blocks/index/) */ diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 80cae68244..3845a35b37 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -625,7 +625,7 @@ void CTxMemPool::ClearPrioritisation(const uint256 hash) CCoinsViewMemPool::CCoinsViewMemPool(CCoinsView &baseIn, CTxMemPool &mempoolIn) : CCoinsViewBacked(baseIn), mempool(mempoolIn) { } -bool CCoinsViewMemPool::GetCoins(const uint256 &txid, CCoins &coins) { +bool CCoinsViewMemPool::GetCoins(const uint256 &txid, CCoins &coins) const { // If an entry in the mempool exists, always return that one, as it's guaranteed to never // conflict with the underlying cache, and it cannot have pruned entries (as it contains full) // transactions. First checking the underlying cache risks returning a pruned entry instead. @@ -637,7 +637,7 @@ bool CCoinsViewMemPool::GetCoins(const uint256 &txid, CCoins &coins) { return (base->GetCoins(txid, coins) && !coins.IsPruned()); } -bool CCoinsViewMemPool::HaveCoins(const uint256 &txid) { +bool CCoinsViewMemPool::HaveCoins(const uint256 &txid) const { return mempool.exists(txid) || base->HaveCoins(txid); } diff --git a/src/txmempool.h b/src/txmempool.h index 2577397bce..074c355077 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -143,8 +143,8 @@ protected: public: CCoinsViewMemPool(CCoinsView &baseIn, CTxMemPool &mempoolIn); - bool GetCoins(const uint256 &txid, CCoins &coins); - bool HaveCoins(const uint256 &txid); + bool GetCoins(const uint256 &txid, CCoins &coins) const; + bool HaveCoins(const uint256 &txid) const; }; #endif /* BITCOIN_TXMEMPOOL_H */ From d0867acb0e07ac63f03dcc555387f24322e8799e Mon Sep 17 00:00:00 2001 From: Daniel Kraft Date: Sat, 19 Jul 2014 17:14:23 +0200 Subject: [PATCH 0586/1288] Use const CCoinsView's at some places. At some places where it is possible (e. g., CheckInputs), use a const version of CCoinsView instead of a non-const one. --- src/main.cpp | 6 +++--- src/main.h | 6 +++--- src/txmempool.cpp | 4 ++-- src/txmempool.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 947494ce62..1c9b3f861b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -644,7 +644,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) // 2. P2SH scripts with a crazy number of expensive // CHECKSIG/CHECKMULTISIG operations // -bool AreInputsStandard(const CTransaction& tx, CCoinsViewCache& mapInputs) +bool AreInputsStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs) { if (tx.IsCoinBase()) return true; // Coinbases don't use vin normally @@ -717,7 +717,7 @@ unsigned int GetLegacySigOpCount(const CTransaction& tx) return nSigOps; } -unsigned int GetP2SHSigOpCount(const CTransaction& tx, CCoinsViewCache& inputs) +unsigned int GetP2SHSigOpCount(const CTransaction& tx, const CCoinsViewCache& inputs) { if (tx.IsCoinBase()) return 0; @@ -1470,7 +1470,7 @@ bool VerifySignature(const CCoins& txFrom, const CTransaction& txTo, unsigned in return CScriptCheck(txFrom, txTo, nIn, flags, nHashType)(); } -bool CheckInputs(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, bool fScriptChecks, unsigned int flags, std::vector *pvChecks) +bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsViewCache &inputs, bool fScriptChecks, unsigned int flags, std::vector *pvChecks) { if (!tx.IsCoinBase()) { diff --git a/src/main.h b/src/main.h index 886cac1507..f93b78d8e5 100644 --- a/src/main.h +++ b/src/main.h @@ -265,7 +265,7 @@ int64_t GetMinRelayFee(const CTransaction& tx, unsigned int nBytes, bool fAllowF @param[in] mapInputs Map of previous transactions that have outputs we're spending @return True if all inputs (scriptSigs) use only standard transaction forms */ -bool AreInputsStandard(const CTransaction& tx, CCoinsViewCache& mapInputs); +bool AreInputsStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs); /** Count ECDSA signature operations the old-fashioned (pre-0.6) way @return number of sigops this transaction's outputs will produce when spent @@ -279,13 +279,13 @@ unsigned int GetLegacySigOpCount(const CTransaction& tx); @return maximum number of sigops required to validate this transaction's inputs @see CTransaction::FetchInputs */ -unsigned int GetP2SHSigOpCount(const CTransaction& tx, CCoinsViewCache& mapInputs); +unsigned int GetP2SHSigOpCount(const CTransaction& tx, const CCoinsViewCache& mapInputs); // Check whether all inputs of this transaction are valid (no double spends, scripts & sigs, amounts) // This does not modify the UTXO set. If pvChecks is not NULL, script checks are pushed onto it // instead of being performed inline. -bool CheckInputs(const CTransaction& tx, CValidationState &state, CCoinsViewCache &view, bool fScriptChecks = true, +bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsViewCache &view, bool fScriptChecks = true, unsigned int flags = STANDARD_SCRIPT_VERIFY_FLAGS, std::vector *pvChecks = NULL); diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 3845a35b37..f75e2212d5 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -484,7 +484,7 @@ void CTxMemPool::clear() ++nTransactionsUpdated; } -void CTxMemPool::check(CCoinsViewCache *pcoins) const +void CTxMemPool::check(const CCoinsViewCache *pcoins) const { if (!fSanityCheck) return; @@ -505,7 +505,7 @@ void CTxMemPool::check(CCoinsViewCache *pcoins) const const CTransaction& tx2 = it2->second.GetTx(); assert(tx2.vout.size() > txin.prevout.n && !tx2.vout[txin.prevout.n].IsNull()); } else { - CCoins &coins = pcoins->GetCoins(txin.prevout.hash); + const CCoins &coins = pcoins->GetCoins(txin.prevout.hash); assert(coins.IsAvailable(txin.prevout.n)); } // Check whether its inputs are marked in mapNextTx. diff --git a/src/txmempool.h b/src/txmempool.h index 074c355077..d95c4d970b 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -85,7 +85,7 @@ public: * all inputs are in the mapNextTx array). If sanity-checking is turned off, * check does nothing. */ - void check(CCoinsViewCache *pcoins) const; + void check(const CCoinsViewCache *pcoins) const; void setSanityCheck(bool _fSanityCheck) { fSanityCheck = _fSanityCheck; } bool addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry); From d1e26d4e71460ffd50c3190385c759b48ab343e9 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 20 Aug 2014 13:53:42 +0200 Subject: [PATCH 0587/1288] Move CMedianFilter to timedata.cpp Now that we no longer use the median filter to keep track of the number of blocks of peers, that's the only place it is used. --- src/Makefile.test.include | 1 + src/test/timedata_tests.cpp | 38 ++++++++++++++++++++++++ src/test/util_tests.cpp | 25 ---------------- src/timedata.h | 59 +++++++++++++++++++++++++++++++++++++ src/util.h | 56 ----------------------------------- 5 files changed, 98 insertions(+), 81 deletions(-) create mode 100644 src/test/timedata_tests.cpp diff --git a/src/Makefile.test.include b/src/Makefile.test.include index cc407f679f..b4360831bb 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -61,6 +61,7 @@ BITCOIN_TESTS =\ test/sigopcount_tests.cpp \ test/skiplist_tests.cpp \ test/test_bitcoin.cpp \ + test/timedata_tests.cpp \ test/transaction_tests.cpp \ test/uint256_tests.cpp \ test/univalue_tests.cpp \ diff --git a/src/test/timedata_tests.cpp b/src/test/timedata_tests.cpp new file mode 100644 index 0000000000..aa4fa0d500 --- /dev/null +++ b/src/test/timedata_tests.cpp @@ -0,0 +1,38 @@ +// Copyright (c) 2011-2014 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. +// +#include "timedata.h" + +#include + +using namespace std; + +BOOST_AUTO_TEST_SUITE(timedata_tests) + +BOOST_AUTO_TEST_CASE(util_MedianFilter) +{ + CMedianFilter filter(5, 15); + + BOOST_CHECK_EQUAL(filter.median(), 15); + + filter.input(20); // [15 20] + BOOST_CHECK_EQUAL(filter.median(), 17); + + filter.input(30); // [15 20 30] + BOOST_CHECK_EQUAL(filter.median(), 20); + + filter.input(3); // [3 15 20 30] + BOOST_CHECK_EQUAL(filter.median(), 17); + + filter.input(7); // [3 7 15 20 30] + BOOST_CHECK_EQUAL(filter.median(), 15); + + filter.input(18); // [3 7 18 20 30] + BOOST_CHECK_EQUAL(filter.median(), 18); + + filter.input(0); // [0 3 7 18 30] + BOOST_CHECK_EQUAL(filter.median(), 7); +} + +BOOST_AUTO_TEST_SUITE_END() diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 068b9f29c8..31fcd3e92a 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -36,31 +36,6 @@ BOOST_AUTO_TEST_CASE(util_criticalsection) } while(0); } -BOOST_AUTO_TEST_CASE(util_MedianFilter) -{ - CMedianFilter filter(5, 15); - - BOOST_CHECK_EQUAL(filter.median(), 15); - - filter.input(20); // [15 20] - BOOST_CHECK_EQUAL(filter.median(), 17); - - filter.input(30); // [15 20 30] - BOOST_CHECK_EQUAL(filter.median(), 20); - - filter.input(3); // [3 15 20 30] - BOOST_CHECK_EQUAL(filter.median(), 17); - - filter.input(7); // [3 7 15 20 30] - BOOST_CHECK_EQUAL(filter.median(), 15); - - filter.input(18); // [3 7 18 20 30] - BOOST_CHECK_EQUAL(filter.median(), 18); - - filter.input(0); // [0 3 7 18 30] - BOOST_CHECK_EQUAL(filter.median(), 7); -} - static const unsigned char ParseHex_expected[65] = { 0x04, 0x67, 0x8a, 0xfd, 0xb0, 0xfe, 0x55, 0x48, 0x27, 0x19, 0x67, 0xf1, 0xa6, 0x71, 0x30, 0xb7, 0x10, 0x5c, 0xd6, 0xa8, 0x28, 0xe0, 0x39, 0x09, 0xa6, 0x79, 0x62, 0xe0, 0xea, 0x1f, 0x61, 0xde, diff --git a/src/timedata.h b/src/timedata.h index 0e7bdc2c1f..d0c84b3183 100644 --- a/src/timedata.h +++ b/src/timedata.h @@ -6,9 +6,68 @@ #define BITCOIN_TIMEDATA_H #include +#include +#include +#include class CNetAddr; +/** Median filter over a stream of values. + * Returns the median of the last N numbers + */ +template class CMedianFilter +{ +private: + std::vector vValues; + std::vector vSorted; + unsigned int nSize; +public: + CMedianFilter(unsigned int size, T initial_value): + nSize(size) + { + vValues.reserve(size); + vValues.push_back(initial_value); + vSorted = vValues; + } + + void input(T value) + { + if(vValues.size() == nSize) + { + vValues.erase(vValues.begin()); + } + vValues.push_back(value); + + vSorted.resize(vValues.size()); + std::copy(vValues.begin(), vValues.end(), vSorted.begin()); + std::sort(vSorted.begin(), vSorted.end()); + } + + T median() const + { + int size = vSorted.size(); + assert(size>0); + if(size & 1) // Odd number of elements + { + return vSorted[size/2]; + } + else // Even number of elements + { + return (vSorted[size/2-1] + vSorted[size/2]) / 2; + } + } + + int size() const + { + return vValues.size(); + } + + std::vector sorted () const + { + return vSorted; + } +}; + /* Functions to keep track of adjusted P2P time */ int64_t GetTimeOffset(); int64_t GetAdjustedTime(); diff --git a/src/util.h b/src/util.h index 1fb42a7b7e..e813c86804 100644 --- a/src/util.h +++ b/src/util.h @@ -356,62 +356,6 @@ bool TimingResistantEqual(const T& a, const T& b) return accumulator == 0; } -/** Median filter over a stream of values. - * Returns the median of the last N numbers - */ -template class CMedianFilter -{ -private: - std::vector vValues; - std::vector vSorted; - unsigned int nSize; -public: - CMedianFilter(unsigned int size, T initial_value): - nSize(size) - { - vValues.reserve(size); - vValues.push_back(initial_value); - vSorted = vValues; - } - - void input(T value) - { - if(vValues.size() == nSize) - { - vValues.erase(vValues.begin()); - } - vValues.push_back(value); - - vSorted.resize(vValues.size()); - std::copy(vValues.begin(), vValues.end(), vSorted.begin()); - std::sort(vSorted.begin(), vSorted.end()); - } - - T median() const - { - int size = vSorted.size(); - assert(size>0); - if(size & 1) // Odd number of elements - { - return vSorted[size/2]; - } - else // Even number of elements - { - return (vSorted[size/2-1] + vSorted[size/2]) / 2; - } - } - - int size() const - { - return vValues.size(); - } - - std::vector sorted () const - { - return vSorted; - } -}; - #ifdef WIN32 inline void SetThreadPriority(int nPriority) { From 121d6ad9dbedd6a13b12d75a4c48505797d8de9d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 20 Aug 2014 16:32:14 +0200 Subject: [PATCH 0588/1288] Remove unused `alignup` function from util.h --- src/util.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/util.h b/src/util.h index e813c86804..10fc5dd58e 100644 --- a/src/util.h +++ b/src/util.h @@ -46,20 +46,6 @@ static const int64_t CENT = 1000000; // This is needed because the foreach macro can't get over the comma in pair #define PAIRTYPE(t1, t2) std::pair -// Align by increasing pointer, must have extra space at end of buffer -template -T* alignup(T* p) -{ - union - { - T* ptr; - size_t n; - } u; - u.ptr = p; - u.n = (u.n + (nBytes-1)) & ~(nBytes-1); - return u.ptr; -} - #ifdef WIN32 #define MSG_DONTWAIT 0 From f780e65ac632d2cad51d00c2b4a93248a5df91a6 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 20 Aug 2014 16:59:00 +0200 Subject: [PATCH 0589/1288] Remove unused function `ByteReverse` from util.h --- src/util.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/util.h b/src/util.h index 10fc5dd58e..785d4056e7 100644 --- a/src/util.h +++ b/src/util.h @@ -372,12 +372,6 @@ inline void SetThreadPriority(int nPriority) void RenameThread(const char* name); -inline uint32_t ByteReverse(uint32_t value) -{ - value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8); - return (value<<16) | (value>>16); -} - // Standard wrapper for do-something-forever thread functions. // "Forever" really means until the thread is interrupted. // Use it like: From 610a8c075958aa95b97f62a7ab020a543694c23d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 20 Aug 2014 17:43:56 +0200 Subject: [PATCH 0590/1288] Move SetThreadPriority implementation to util.cpp instead of the header Put the THREAD_* and PRIO_ constants in compat.h. --- src/compat.h | 11 +++++++++++ src/util.cpp | 13 +++++++++++++ src/util.h | 29 +---------------------------- 3 files changed, 25 insertions(+), 28 deletions(-) diff --git a/src/compat.h b/src/compat.h index 52c7817130..3f0a8b6158 100644 --- a/src/compat.h +++ b/src/compat.h @@ -59,4 +59,15 @@ typedef u_int SOCKET; #define SOCKET_ERROR -1 #endif +#ifndef WIN32 +// PRIO_MAX is not defined on Solaris +#ifndef PRIO_MAX +#define PRIO_MAX 20 +#endif +#define THREAD_PRIORITY_LOWEST PRIO_MAX +#define THREAD_PRIORITY_BELOW_NORMAL 2 +#define THREAD_PRIORITY_NORMAL 0 +#define THREAD_PRIORITY_ABOVE_NORMAL (-2) +#endif + #endif // _BITCOIN_COMPAT_H diff --git a/src/util.cpp b/src/util.cpp index ae2145a3a0..606f5a60f9 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1286,3 +1286,16 @@ std::string FormatParagraph(const std::string in, size_t width, size_t indent) } return out.str(); } + +void SetThreadPriority(int nPriority) +{ +#ifdef WIN32 + SetThreadPriority(GetCurrentThread(), nPriority); +#else // WIN32 +#ifdef PRIO_THREAD + setpriority(PRIO_THREAD, 0, nPriority); +#else // PRIO_THREAD + setpriority(PRIO_PROCESS, 0, nPriority); +#endif // PRIO_THREAD +#endif // WIN32 +} diff --git a/src/util.h b/src/util.h index 785d4056e7..939e59c301 100644 --- a/src/util.h +++ b/src/util.h @@ -342,34 +342,7 @@ bool TimingResistantEqual(const T& a, const T& b) return accumulator == 0; } -#ifdef WIN32 -inline void SetThreadPriority(int nPriority) -{ - SetThreadPriority(GetCurrentThread(), nPriority); -} -#else - -// PRIO_MAX is not defined on Solaris -#ifndef PRIO_MAX -#define PRIO_MAX 20 -#endif -#define THREAD_PRIORITY_LOWEST PRIO_MAX -#define THREAD_PRIORITY_BELOW_NORMAL 2 -#define THREAD_PRIORITY_NORMAL 0 -#define THREAD_PRIORITY_ABOVE_NORMAL (-2) - -inline void SetThreadPriority(int nPriority) -{ - // It's unclear if it's even possible to change thread priorities on Linux, - // but we really and truly need it for the generation threads. -#ifdef PRIO_THREAD - setpriority(PRIO_THREAD, 0, nPriority); -#else - setpriority(PRIO_PROCESS, 0, nPriority); -#endif -} -#endif - +void SetThreadPriority(int nPriority); void RenameThread(const char* name); // Standard wrapper for do-something-forever thread functions. From 651480c8e453e7df9d735f684e6a3e368c777ac0 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 21 Aug 2014 05:17:21 +0200 Subject: [PATCH 0591/1288] move functions in main and net to implementation files --- src/main.cpp | 61 ++++++++++++++++++++ src/main.h | 64 +-------------------- src/net.cpp | 154 +++++++++++++++++++++++++++++++++++++++++++++++++ src/net.h | 158 +++------------------------------------------------ 4 files changed, 226 insertions(+), 211 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 947494ce62..d9f897f447 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4655,7 +4655,68 @@ bool SendMessages(CNode* pto, bool fSendTrickle) } +bool CBlockUndo::WriteToDisk(CDiskBlockPos &pos, const uint256 &hashBlock) +{ + // Open history file to append + CAutoFile fileout = CAutoFile(OpenUndoFile(pos), SER_DISK, CLIENT_VERSION); + if (!fileout) + return error("CBlockUndo::WriteToDisk : OpenUndoFile failed"); + // Write index header + unsigned int nSize = fileout.GetSerializeSize(*this); + fileout << FLATDATA(Params().MessageStart()) << nSize; + + // Write undo data + long fileOutPos = ftell(fileout); + if (fileOutPos < 0) + return error("CBlockUndo::WriteToDisk : ftell failed"); + pos.nPos = (unsigned int)fileOutPos; + fileout << *this; + + // calculate & write checksum + CHashWriter hasher(SER_GETHASH, PROTOCOL_VERSION); + hasher << hashBlock; + hasher << *this; + fileout << hasher.GetHash(); + + // Flush stdio buffers and commit to disk before returning + fflush(fileout); + if (!IsInitialBlockDownload()) + FileCommit(fileout); + + return true; +} + +bool CBlockUndo::ReadFromDisk(const CDiskBlockPos &pos, const uint256 &hashBlock) +{ + // Open history file to read + CAutoFile filein = CAutoFile(OpenUndoFile(pos, true), SER_DISK, CLIENT_VERSION); + if (!filein) + return error("CBlockUndo::ReadFromDisk : OpenBlockFile failed"); + + // Read block + uint256 hashChecksum; + try { + filein >> *this; + filein >> hashChecksum; + } + catch (std::exception &e) { + return error("%s : Deserialize or I/O error - %s", __func__, e.what()); + } + + // Verify checksum + CHashWriter hasher(SER_GETHASH, PROTOCOL_VERSION); + hasher << hashBlock; + hasher << *this; + if (hashChecksum != hasher.GetHash()) + return error("CBlockUndo::ReadFromDisk : Checksum mismatch"); + + return true; +} + + std::string CBlockFileInfo::ToString() const { + return strprintf("CBlockFileInfo(blocks=%u, size=%u, heights=%u...%u, time=%s...%s)", nBlocks, nSize, nHeightFirst, nHeightLast, DateTimeStrFormat("%Y-%m-%d", nTimeFirst).c_str(), DateTimeStrFormat("%Y-%m-%d", nTimeLast).c_str()); + } diff --git a/src/main.h b/src/main.h index 886cac1507..0db631f6d6 100644 --- a/src/main.h +++ b/src/main.h @@ -312,64 +312,8 @@ public: READWRITE(vtxundo); ) - bool WriteToDisk(CDiskBlockPos &pos, const uint256 &hashBlock) - { - // Open history file to append - CAutoFile fileout = CAutoFile(OpenUndoFile(pos), SER_DISK, CLIENT_VERSION); - if (!fileout) - return error("CBlockUndo::WriteToDisk : OpenUndoFile failed"); - - // Write index header - unsigned int nSize = fileout.GetSerializeSize(*this); - fileout << FLATDATA(Params().MessageStart()) << nSize; - - // Write undo data - long fileOutPos = ftell(fileout); - if (fileOutPos < 0) - return error("CBlockUndo::WriteToDisk : ftell failed"); - pos.nPos = (unsigned int)fileOutPos; - fileout << *this; - - // calculate & write checksum - CHashWriter hasher(SER_GETHASH, PROTOCOL_VERSION); - hasher << hashBlock; - hasher << *this; - fileout << hasher.GetHash(); - - // Flush stdio buffers and commit to disk before returning - fflush(fileout); - if (!IsInitialBlockDownload()) - FileCommit(fileout); - - return true; - } - - bool ReadFromDisk(const CDiskBlockPos &pos, const uint256 &hashBlock) - { - // Open history file to read - CAutoFile filein = CAutoFile(OpenUndoFile(pos, true), SER_DISK, CLIENT_VERSION); - if (!filein) - return error("CBlockUndo::ReadFromDisk : OpenBlockFile failed"); - - // Read block - uint256 hashChecksum; - try { - filein >> *this; - filein >> hashChecksum; - } - catch (std::exception &e) { - return error("%s : Deserialize or I/O error - %s", __func__, e.what()); - } - - // Verify checksum - CHashWriter hasher(SER_GETHASH, PROTOCOL_VERSION); - hasher << hashBlock; - hasher << *this; - if (hashChecksum != hasher.GetHash()) - return error("CBlockUndo::ReadFromDisk : Checksum mismatch"); - - return true; - } + bool WriteToDisk(CDiskBlockPos &pos, const uint256 &hashBlock); + bool ReadFromDisk(const CDiskBlockPos &pos, const uint256 &hashBlock); }; @@ -625,9 +569,7 @@ public: SetNull(); } - std::string ToString() const { - return strprintf("CBlockFileInfo(blocks=%u, size=%u, heights=%u...%u, time=%s...%s)", nBlocks, nSize, nHeightFirst, nHeightLast, DateTimeStrFormat("%Y-%m-%d", nTimeFirst).c_str(), DateTimeStrFormat("%Y-%m-%d", nTimeLast).c_str()); - } + std::string ToString() const; // update statistics (does not update nSize) void AddBlock(unsigned int nHeightIn, uint64_t nTimeIn) { diff --git a/src/net.cpp b/src/net.cpp index cae9b70da7..440c271a5e 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2037,3 +2037,157 @@ bool CAddrDB::Read(CAddrMan& addr) return true; } + +unsigned int ReceiveFloodSize() { return 1000*GetArg("-maxreceivebuffer", 5*1000); } +unsigned int SendBufferSize() { return 1000*GetArg("-maxsendbuffer", 1*1000); } + +CNode::CNode(SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn, bool fInboundIn) : ssSend(SER_NETWORK, INIT_PROTO_VERSION), setAddrKnown(5000) +{ + nServices = 0; + hSocket = hSocketIn; + nRecvVersion = INIT_PROTO_VERSION; + nLastSend = 0; + nLastRecv = 0; + nSendBytes = 0; + nRecvBytes = 0; + nTimeConnected = GetTime(); + addr = addrIn; + addrName = addrNameIn == "" ? addr.ToStringIPPort() : addrNameIn; + nVersion = 0; + strSubVer = ""; + fWhitelisted = false; + fOneShot = false; + fClient = false; // set by version message + fInbound = fInboundIn; + fNetworkNode = false; + fSuccessfullyConnected = false; + fDisconnect = false; + nRefCount = 0; + nSendSize = 0; + nSendOffset = 0; + hashContinue = 0; + pindexLastGetBlocksBegin = 0; + hashLastGetBlocksEnd = 0; + nStartingHeight = -1; + fStartSync = false; + fGetAddr = false; + fRelayTxes = false; + setInventoryKnown.max_size(SendBufferSize() / 1000); + pfilter = new CBloomFilter(); + nPingNonceSent = 0; + nPingUsecStart = 0; + nPingUsecTime = 0; + fPingQueued = false; + + { + LOCK(cs_nLastNodeId); + id = nLastNodeId++; + } + + if (fLogIPs) + LogPrint("net", "Added connection to %s peer=%d\n", addrName, id); + else + LogPrint("net", "Added connection peer=%d\n", id); + + // Be shy and don't send version until we hear + if (hSocket != INVALID_SOCKET && !fInbound) + PushVersion(); + + GetNodeSignals().InitializeNode(GetId(), this); +} + +CNode::~CNode() +{ + CloseSocket(hSocket); + + if (pfilter) + delete pfilter; + + GetNodeSignals().FinalizeNode(GetId()); +} + +void CNode::AskFor(const CInv& inv) +{ + // We're using mapAskFor as a priority queue, + // the key is the earliest time the request can be sent + int64_t nRequestTime; + limitedmap::const_iterator it = mapAlreadyAskedFor.find(inv); + if (it != mapAlreadyAskedFor.end()) + nRequestTime = it->second; + else + nRequestTime = 0; + LogPrint("net", "askfor %s %d (%s) peer=%d\n", inv.ToString(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str(), id); + + // Make sure not to reuse time indexes to keep things in the same order + int64_t nNow = GetTimeMicros() - 1000000; + static int64_t nLastTime; + ++nLastTime; + nNow = std::max(nNow, nLastTime); + nLastTime = nNow; + + // Each retry is 2 minutes after the last + nRequestTime = std::max(nRequestTime + 2 * 60 * 1000000, nNow); + if (it != mapAlreadyAskedFor.end()) + mapAlreadyAskedFor.update(it, nRequestTime); + else + mapAlreadyAskedFor.insert(std::make_pair(inv, nRequestTime)); + mapAskFor.insert(std::make_pair(nRequestTime, inv)); +} + +void CNode::BeginMessage(const char* pszCommand) EXCLUSIVE_LOCK_FUNCTION(cs_vSend) +{ + ENTER_CRITICAL_SECTION(cs_vSend); + assert(ssSend.size() == 0); + ssSend << CMessageHeader(pszCommand, 0); + LogPrint("net", "sending: %s ", pszCommand); +} + +void CNode::AbortMessage() UNLOCK_FUNCTION(cs_vSend) +{ + ssSend.clear(); + + LEAVE_CRITICAL_SECTION(cs_vSend); + + LogPrint("net", "(aborted)\n"); +} + +void CNode::EndMessage() UNLOCK_FUNCTION(cs_vSend) +{ + // The -*messagestest options are intentionally not documented in the help message, + // since they are only used during development to debug the networking code and are + // not intended for end-users. + if (mapArgs.count("-dropmessagestest") && GetRand(GetArg("-dropmessagestest", 2)) == 0) + { + LogPrint("net", "dropmessages DROPPING SEND MESSAGE\n"); + AbortMessage(); + return; + } + if (mapArgs.count("-fuzzmessagestest")) + Fuzz(GetArg("-fuzzmessagestest", 10)); + + if (ssSend.size() == 0) + return; + + // Set the size + unsigned int nSize = ssSend.size() - CMessageHeader::HEADER_SIZE; + memcpy((char*)&ssSend[CMessageHeader::MESSAGE_SIZE_OFFSET], &nSize, sizeof(nSize)); + + // Set the checksum + uint256 hash = Hash(ssSend.begin() + CMessageHeader::HEADER_SIZE, ssSend.end()); + unsigned int nChecksum = 0; + memcpy(&nChecksum, &hash, sizeof(nChecksum)); + assert(ssSend.size () >= CMessageHeader::CHECKSUM_OFFSET + sizeof(nChecksum)); + memcpy((char*)&ssSend[CMessageHeader::CHECKSUM_OFFSET], &nChecksum, sizeof(nChecksum)); + + LogPrint("net", "(%d bytes) peer=%d\n", nSize, id); + + std::deque::iterator it = vSendMsg.insert(vSendMsg.end(), CSerializeData()); + ssSend.GetAndClear(*it); + nSendSize += (*it).size(); + + // If write queue empty, attempt "optimistic write" + if (it == vSendMsg.begin()) + SocketSendData(this); + + LEAVE_CRITICAL_SECTION(cs_vSend); +} diff --git a/src/net.h b/src/net.h index 1a7b3c00b8..2b4732c9de 100644 --- a/src/net.h +++ b/src/net.h @@ -51,8 +51,8 @@ static const bool DEFAULT_UPNP = USE_UPNP; static const bool DEFAULT_UPNP = false; #endif -inline unsigned int ReceiveFloodSize() { return 1000*GetArg("-maxreceivebuffer", 5*1000); } -inline unsigned int SendBufferSize() { return 1000*GetArg("-maxsendbuffer", 1*1000); } +unsigned int ReceiveFloodSize(); +unsigned int SendBufferSize(); void AddOneShot(std::string strDest); bool RecvLine(SOCKET hSocket, std::string& strLine); @@ -300,70 +300,8 @@ public: // Whether a ping is requested. bool fPingQueued; - CNode(SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn = "", bool fInboundIn=false) : ssSend(SER_NETWORK, INIT_PROTO_VERSION), setAddrKnown(5000) - { - nServices = 0; - hSocket = hSocketIn; - nRecvVersion = INIT_PROTO_VERSION; - nLastSend = 0; - nLastRecv = 0; - nSendBytes = 0; - nRecvBytes = 0; - nTimeConnected = GetTime(); - addr = addrIn; - addrName = addrNameIn == "" ? addr.ToStringIPPort() : addrNameIn; - nVersion = 0; - strSubVer = ""; - fWhitelisted = false; - fOneShot = false; - fClient = false; // set by version message - fInbound = fInboundIn; - fNetworkNode = false; - fSuccessfullyConnected = false; - fDisconnect = false; - nRefCount = 0; - nSendSize = 0; - nSendOffset = 0; - hashContinue = 0; - pindexLastGetBlocksBegin = 0; - hashLastGetBlocksEnd = 0; - nStartingHeight = -1; - fStartSync = false; - fGetAddr = false; - fRelayTxes = false; - setInventoryKnown.max_size(SendBufferSize() / 1000); - pfilter = new CBloomFilter(); - nPingNonceSent = 0; - nPingUsecStart = 0; - nPingUsecTime = 0; - fPingQueued = false; - - { - LOCK(cs_nLastNodeId); - id = nLastNodeId++; - } - - if (fLogIPs) - LogPrint("net", "Added connection to %s peer=%d\n", addrName, id); - else - LogPrint("net", "Added connection peer=%d\n", id); - - // Be shy and don't send version until we hear - if (hSocket != INVALID_SOCKET && !fInbound) - PushVersion(); - - GetNodeSignals().InitializeNode(GetId(), this); - } - - ~CNode() - { - CloseSocket(hSocket); - - if (pfilter) - delete pfilter; - - GetNodeSignals().FinalizeNode(GetId()); - } + CNode(SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn = "", bool fInboundIn=false); + ~CNode(); private: // Network usage totals @@ -452,96 +390,16 @@ public: } } - void AskFor(const CInv& inv) - { - // We're using mapAskFor as a priority queue, - // the key is the earliest time the request can be sent - int64_t nRequestTime; - limitedmap::const_iterator it = mapAlreadyAskedFor.find(inv); - if (it != mapAlreadyAskedFor.end()) - nRequestTime = it->second; - else - nRequestTime = 0; - LogPrint("net", "askfor %s %d (%s) peer=%d\n", inv.ToString(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str(), id); - - // Make sure not to reuse time indexes to keep things in the same order - int64_t nNow = GetTimeMicros() - 1000000; - static int64_t nLastTime; - ++nLastTime; - nNow = std::max(nNow, nLastTime); - nLastTime = nNow; - - // Each retry is 2 minutes after the last - nRequestTime = std::max(nRequestTime + 2 * 60 * 1000000, nNow); - if (it != mapAlreadyAskedFor.end()) - mapAlreadyAskedFor.update(it, nRequestTime); - else - mapAlreadyAskedFor.insert(std::make_pair(inv, nRequestTime)); - mapAskFor.insert(std::make_pair(nRequestTime, inv)); - } - - + void AskFor(const CInv& inv); // TODO: Document the postcondition of this function. Is cs_vSend locked? - void BeginMessage(const char* pszCommand) EXCLUSIVE_LOCK_FUNCTION(cs_vSend) - { - ENTER_CRITICAL_SECTION(cs_vSend); - assert(ssSend.size() == 0); - ssSend << CMessageHeader(pszCommand, 0); - LogPrint("net", "sending: %s ", pszCommand); - } + void BeginMessage(const char* pszCommand) EXCLUSIVE_LOCK_FUNCTION(cs_vSend); // TODO: Document the precondition of this function. Is cs_vSend locked? - void AbortMessage() UNLOCK_FUNCTION(cs_vSend) - { - ssSend.clear(); - - LEAVE_CRITICAL_SECTION(cs_vSend); - - LogPrint("net", "(aborted)\n"); - } + void AbortMessage() UNLOCK_FUNCTION(cs_vSend); // TODO: Document the precondition of this function. Is cs_vSend locked? - void EndMessage() UNLOCK_FUNCTION(cs_vSend) - { - // The -*messagestest options are intentionally not documented in the help message, - // since they are only used during development to debug the networking code and are - // not intended for end-users. - if (mapArgs.count("-dropmessagestest") && GetRand(GetArg("-dropmessagestest", 2)) == 0) - { - LogPrint("net", "dropmessages DROPPING SEND MESSAGE\n"); - AbortMessage(); - return; - } - if (mapArgs.count("-fuzzmessagestest")) - Fuzz(GetArg("-fuzzmessagestest", 10)); - - if (ssSend.size() == 0) - return; - - // Set the size - unsigned int nSize = ssSend.size() - CMessageHeader::HEADER_SIZE; - memcpy((char*)&ssSend[CMessageHeader::MESSAGE_SIZE_OFFSET], &nSize, sizeof(nSize)); - - // Set the checksum - uint256 hash = Hash(ssSend.begin() + CMessageHeader::HEADER_SIZE, ssSend.end()); - unsigned int nChecksum = 0; - memcpy(&nChecksum, &hash, sizeof(nChecksum)); - assert(ssSend.size () >= CMessageHeader::CHECKSUM_OFFSET + sizeof(nChecksum)); - memcpy((char*)&ssSend[CMessageHeader::CHECKSUM_OFFSET], &nChecksum, sizeof(nChecksum)); - - LogPrint("net", "(%d bytes) peer=%d\n", nSize, id); - - std::deque::iterator it = vSendMsg.insert(vSendMsg.end(), CSerializeData()); - ssSend.GetAndClear(*it); - nSendSize += (*it).size(); - - // If write queue empty, attempt "optimistic write" - if (it == vSendMsg.begin()) - SocketSendData(this); - - LEAVE_CRITICAL_SECTION(cs_vSend); - } + void EndMessage() UNLOCK_FUNCTION(cs_vSend); void PushVersion(); From af8297c010154243cb11b27184a9badb4e03ecb0 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 21 Aug 2014 05:04:43 +0200 Subject: [PATCH 0592/1288] Move functions in wallet.h to implementation file Breaks compile-time dependency of wallet.h on util. --- src/wallet.cpp | 17 +++++++++++++++++ src/wallet.h | 18 +++--------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index 7c04743c0f..ee4793b3f1 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -2168,3 +2168,20 @@ bool CWallet::GetDestData(const CTxDestination &dest, const std::string &key, st } return false; } + +CKeyPool::CKeyPool() +{ + nTime = GetTime(); +} + +CKeyPool::CKeyPool(const CPubKey& vchPubKeyIn) +{ + nTime = GetTime(); + vchPubKey = vchPubKeyIn; +} + +CWalletKey::CWalletKey(int64_t nExpires) +{ + nTimeCreated = (nExpires ? GetTime() : 0); + nTimeExpires = nExpires; +} diff --git a/src/wallet.h b/src/wallet.h index 34c699e979..7cbbb2a6ed 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -61,16 +61,8 @@ public: int64_t nTime; CPubKey vchPubKey; - CKeyPool() - { - nTime = GetTime(); - } - - CKeyPool(const CPubKey& vchPubKeyIn) - { - nTime = GetTime(); - vchPubKey = vchPubKeyIn; - } + CKeyPool(); + CKeyPool(const CPubKey& vchPubKeyIn); IMPLEMENT_SERIALIZE ( @@ -840,11 +832,7 @@ public: //// todo: add something to note what created it (user, getnewaddress, change) //// maybe should have a map property map - CWalletKey(int64_t nExpires=0) - { - nTimeCreated = (nExpires ? GetTime() : 0); - nTimeExpires = nExpires; - } + CWalletKey(int64_t nExpires=0); IMPLEMENT_SERIALIZE ( From b4aa769bcb82519024ee54fc84a37c34420d53b8 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 21 Aug 2014 15:50:59 +0200 Subject: [PATCH 0593/1288] Move `S_I*` constants and `MSG_NOSIGNAL` to compat.h --- src/compat.h | 14 ++++++++++++++ src/util.h | 14 -------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/compat.h b/src/compat.h index 3f0a8b6158..4fc28a36e0 100644 --- a/src/compat.h +++ b/src/compat.h @@ -59,6 +59,20 @@ typedef u_int SOCKET; #define SOCKET_ERROR -1 #endif +#ifdef WIN32 +#ifndef S_IRUSR +#define S_IRUSR 0400 +#define S_IWUSR 0200 +#endif +#else +#define MAX_PATH 1024 +#endif + +// As Solaris does not have the MSG_NOSIGNAL flag for send(2) syscall, it is defined as 0 +#if !defined(HAVE_MSG_NOSIGNAL) && !defined(MSG_NOSIGNAL) +#define MSG_NOSIGNAL 0 +#endif + #ifndef WIN32 // PRIO_MAX is not defined on Solaris #ifndef PRIO_MAX diff --git a/src/util.h b/src/util.h index 939e59c301..e0feca07ca 100644 --- a/src/util.h +++ b/src/util.h @@ -46,20 +46,6 @@ static const int64_t CENT = 1000000; // This is needed because the foreach macro can't get over the comma in pair #define PAIRTYPE(t1, t2) std::pair -#ifdef WIN32 -#define MSG_DONTWAIT 0 - -#ifndef S_IRUSR -#define S_IRUSR 0400 -#define S_IWUSR 0200 -#endif -#else -#define MAX_PATH 1024 -#endif -// As Solaris does not have the MSG_NOSIGNAL flag for send(2) syscall, it is defined as 0 -#if !defined(HAVE_MSG_NOSIGNAL) && !defined(MSG_NOSIGNAL) -#define MSG_NOSIGNAL 0 -#endif inline void MilliSleep(int64_t n) { From 6e5fd003e04b81115b6b164b21f048472d575535 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 21 Aug 2014 16:11:05 +0200 Subject: [PATCH 0594/1288] Move `*Version()` functions to version.h/cpp --- src/bitcoin-cli.cpp | 1 + src/qt/utilitydialog.cpp | 2 +- src/rpcprotocol.cpp | 1 + src/tinyformat.h | 1 + src/util.cpp | 25 ------------------------- src/util.h | 2 -- src/version.cpp | 28 ++++++++++++++++++++++++++++ src/version.h | 4 ++++ 8 files changed, 36 insertions(+), 28 deletions(-) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 0609adcab3..10ca26ff2b 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -8,6 +8,7 @@ #include "rpcclient.h" #include "rpcprotocol.h" #include "chainparamsbase.h" +#include "version.h" #include diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index 5fb0da145d..1a39894c9b 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -10,9 +10,9 @@ #include "clientmodel.h" #include "guiutil.h" -#include "clientversion.h" #include "init.h" #include "util.h" +#include "version.h" #include #include diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp index 643208b3b6..a4deddbed3 100644 --- a/src/rpcprotocol.cpp +++ b/src/rpcprotocol.cpp @@ -6,6 +6,7 @@ #include "rpcprotocol.h" #include "util.h" +#include "version.h" #include diff --git a/src/tinyformat.h b/src/tinyformat.h index 929cb66e4d..73d49a1fe4 100644 --- a/src/tinyformat.h +++ b/src/tinyformat.h @@ -121,6 +121,7 @@ namespace tfm = tinyformat; #include #include #include +#include #ifndef TINYFORMAT_ERROR # define TINYFORMAT_ERROR(reason) assert(0 && reason) diff --git a/src/util.cpp b/src/util.cpp index 606f5a60f9..80d27d5826 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -13,7 +13,6 @@ #include "random.h" #include "sync.h" #include "uint256.h" -#include "version.h" #include @@ -1116,30 +1115,6 @@ void SetMockTime(int64_t nMockTimeIn) nMockTime = nMockTimeIn; } -string FormatVersion(int nVersion) -{ - if (nVersion%100 == 0) - return strprintf("%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100); - else - return strprintf("%d.%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100, nVersion%100); -} - -string FormatFullVersion() -{ - return CLIENT_BUILD; -} - -// Format the subversion field according to BIP 14 spec (https://en.bitcoin.it/wiki/BIP_0014) -std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector& comments) -{ - std::ostringstream ss; - ss << "/"; - ss << name << ":" << FormatVersion(nClientVersion); - if (!comments.empty()) - ss << "(" << boost::algorithm::join(comments, "; ") << ")"; - ss << "/"; - return ss.str(); -} #ifdef WIN32 boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate) diff --git a/src/util.h b/src/util.h index e0feca07ca..cfbf30c6a4 100644 --- a/src/util.h +++ b/src/util.h @@ -156,8 +156,6 @@ boost::filesystem::path GetTempPath(); void ShrinkDebugFile(); int64_t GetTime(); void SetMockTime(int64_t nMockTimeIn); -std::string FormatFullVersion(); -std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector& comments); void runCommand(std::string strCommand); inline std::string i64tostr(int64_t n) diff --git a/src/version.cpp b/src/version.cpp index d86caa3ac2..8311041ed2 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -4,7 +4,10 @@ #include "version.h" +#include "tinyformat.h" + #include +#include // Name of client reported in the 'version' message. Report the same name // for both bitcoind and bitcoin-qt, to make it harder for attackers to @@ -69,3 +72,28 @@ const std::string CLIENT_NAME("Satoshi"); const std::string CLIENT_BUILD(BUILD_DESC CLIENT_VERSION_SUFFIX); const std::string CLIENT_DATE(BUILD_DATE); + +static std::string FormatVersion(int nVersion) +{ + if (nVersion%100 == 0) + return strprintf("%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100); + else + return strprintf("%d.%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100, nVersion%100); +} + +std::string FormatFullVersion() +{ + return CLIENT_BUILD; +} + +// Format the subversion field according to BIP 14 spec (https://en.bitcoin.it/wiki/BIP_0014) +std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector& comments) +{ + std::ostringstream ss; + ss << "/"; + ss << name << ":" << FormatVersion(nClientVersion); + if (!comments.empty()) + ss << "(" << boost::algorithm::join(comments, "; ") << ")"; + ss << "/"; + return ss.str(); +} diff --git a/src/version.h b/src/version.h index fbb731c91d..3a6c0f3719 100644 --- a/src/version.h +++ b/src/version.h @@ -7,6 +7,7 @@ #include "clientversion.h" #include +#include // // client versioning @@ -48,4 +49,7 @@ static const int BIP0031_VERSION = 60000; // "mempool" command, enhanced "getdata" behavior starts with this version static const int MEMPOOL_GD_VERSION = 60002; +std::string FormatFullVersion(); +std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector& comments); + #endif From f841aa2892ffd97d564deee103555149d9fbcd9a Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 20 Aug 2014 16:33:55 +0200 Subject: [PATCH 0595/1288] Move `COIN` and `CENT` to core.h Eventually these should end up in `money.h` after monetary amounts are typedef'ed, but at least they don't belong in `util.h`. --- src/core.h | 3 +++ src/util.h | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core.h b/src/core.h index 9552f70254..e3ceac97aa 100644 --- a/src/core.h +++ b/src/core.h @@ -14,6 +14,9 @@ class CTransaction; +static const int64_t COIN = 100000000; +static const int64_t CENT = 1000000; + /** No amount larger than this (in satoshi) is valid */ static const int64_t MAX_MONEY = 21000000 * COIN; inline bool MoneyRange(int64_t nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } diff --git a/src/util.h b/src/util.h index cfbf30c6a4..cbd311574a 100644 --- a/src/util.h +++ b/src/util.h @@ -34,9 +34,6 @@ class uint256; -static const int64_t COIN = 100000000; -static const int64_t CENT = 1000000; - #define BEGIN(a) ((char*)&(a)) #define END(a) ((char*)&((&(a))[1])) #define UBEGIN(a) ((unsigned char*)&(a)) From ad49c256c33bfe4088fd3c7ecb7d28cb81a8fc70 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 21 Aug 2014 16:11:09 +0200 Subject: [PATCH 0596/1288] Split up util.cpp/h Split up util.cpp/h into: - string utilities (hex, base32, base64): no internal dependencies, no dependency on boost (apart from foreach) - money utilities (parsesmoney, formatmoney) - time utilities (gettime*, sleep, format date): - and the rest (logging, argument parsing, config file parsing) The latter is basically the environment and OS handling, and is stripped of all utility functions, so we may want to rename it to something else than util.cpp/h for clarity (Matt suggested osinterface). Breaks dependency of sha256.cpp on all the things pulled in by util. --- src/Makefile.am | 6 + src/alert.cpp | 1 + src/bitcoin-cli.cpp | 1 + src/bitcoin-tx.cpp | 1 + src/bitcoind.cpp | 1 + src/core_write.cpp | 1 + src/crypter.cpp | 1 + src/db.cpp | 2 + src/init.cpp | 2 + src/keystore.cpp | 1 + src/main.cpp | 1 + src/miner.cpp | 6 +- src/net.cpp | 1 + src/net.h | 3 +- src/netbase.cpp | 2 + src/noui.cpp | 1 + src/pow.cpp | 1 + src/qt/bitcoin.cpp | 1 + src/qt/bitcoingui.cpp | 1 + src/qt/clientmodel.cpp | 1 + src/qt/optionsdialog.cpp | 1 + src/qt/paymentserver.cpp | 1 + src/qt/transactiondesc.cpp | 1 + src/qt/utilitydialog.cpp | 3 +- src/random.cpp | 4 +- src/rpcblockchain.cpp | 1 + src/rpcdump.cpp | 2 + src/rpcmining.cpp | 1 + src/rpcprotocol.cpp | 3 + src/rpcserver.cpp | 6 + src/script.cpp | 3 +- src/script.h | 3 +- src/test/DoS_tests.cpp | 1 + src/test/alert_tests.cpp | 1 + src/test/allocator_tests.cpp | 2 + src/test/base32_tests.cpp | 2 +- src/test/base64_tests.cpp | 2 +- src/test/checkblock_tests.cpp | 1 + src/test/crypto_tests.cpp | 2 +- src/test/hash_tests.cpp | 2 +- src/test/test_bitcoin.cpp | 1 + src/test/util_tests.cpp | 3 + src/timedata.cpp | 6 + src/txdb.cpp | 1 + src/txmempool.cpp | 1 + src/uint256.cpp | 3 +- src/util.cpp | 551 +--------------------------------- src/util.h | 176 +---------- src/utilmoneystr.cpp | 75 +++++ src/utilmoneystr.h | 19 ++ src/utilstrencodings.cpp | 496 ++++++++++++++++++++++++++++++ src/utilstrencodings.h | 97 ++++++ src/utiltime.cpp | 66 ++++ src/utiltime.h | 20 ++ src/wallet.cpp | 8 + src/wallet.h | 6 +- src/walletdb.cpp | 3 + 57 files changed, 875 insertions(+), 734 deletions(-) create mode 100644 src/utilmoneystr.cpp create mode 100644 src/utilmoneystr.h create mode 100644 src/utilstrencodings.cpp create mode 100644 src/utilstrencodings.h create mode 100644 src/utiltime.cpp create mode 100644 src/utiltime.h diff --git a/src/Makefile.am b/src/Makefile.am index 6c67dee7d5..655bfc88c3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -109,6 +109,9 @@ BITCOIN_CORE_H = \ ui_interface.h \ uint256.h \ util.h \ + utilstrencodings.h \ + utilmoneystr.h \ + utiltime.h \ version.h \ walletdb.h \ wallet.h \ @@ -219,6 +222,9 @@ libbitcoin_util_a_SOURCES = \ sync.cpp \ uint256.cpp \ util.cpp \ + utilstrencodings.cpp \ + utilmoneystr.cpp \ + utiltime.cpp \ version.cpp \ $(BITCOIN_CORE_H) diff --git a/src/alert.cpp b/src/alert.cpp index 2cd684cc4c..3271ecfbfd 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -19,6 +19,7 @@ #include #include #include +#include using namespace std; diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 10ca26ff2b..871aaf93df 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -8,6 +8,7 @@ #include "rpcclient.h" #include "rpcprotocol.h" #include "chainparamsbase.h" +#include "utilstrencodings.h" #include "version.h" #include diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 6cd2768d70..75f0fb69f2 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -4,6 +4,7 @@ #include "base58.h" #include "util.h" +#include "utilmoneystr.h" #include "core.h" #include "main.h" // for MAX_BLOCK_SIZE #include "keystore.h" diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 880955481b..5be8708979 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -12,6 +12,7 @@ #include #include +#include /* Introduction text for doxygen: */ diff --git a/src/core_write.cpp b/src/core_write.cpp index 37dd69f7b8..b395b5c090 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -8,6 +8,7 @@ #include "core.h" #include "serialize.h" #include "util.h" +#include "utilmoneystr.h" #include "base58.h" using namespace std; diff --git a/src/crypter.cpp b/src/crypter.cpp index 122e06d97e..8aa2bb0517 100644 --- a/src/crypter.cpp +++ b/src/crypter.cpp @@ -5,6 +5,7 @@ #include "crypter.h" #include "script.h" +#include "util.h" #include #include diff --git a/src/db.cpp b/src/db.cpp index eb40f3cc40..8c139843a1 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -9,6 +9,7 @@ #include "hash.h" #include "protocol.h" #include "util.h" +#include "utilstrencodings.h" #include @@ -17,6 +18,7 @@ #endif #include +#include #include #include diff --git a/src/init.cpp b/src/init.cpp index 708e6386aa..e972413c4b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -19,6 +19,7 @@ #include "txdb.h" #include "ui_interface.h" #include "util.h" +#include "utilmoneystr.h" #ifdef ENABLE_WALLET #include "db.h" #include "wallet.h" @@ -36,6 +37,7 @@ #include #include #include +#include #include using namespace boost; diff --git a/src/keystore.cpp b/src/keystore.cpp index 2a4c88d565..c6322eadce 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -8,6 +8,7 @@ #include "crypter.h" #include "key.h" #include "script.h" +#include "util.h" #include diff --git a/src/main.cpp b/src/main.cpp index d9f897f447..322f580f10 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -24,6 +24,7 @@ #include #include #include +#include using namespace std; using namespace boost; diff --git a/src/miner.cpp b/src/miner.cpp index 06acff1c33..8696edcf6e 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -3,8 +3,6 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include - #include "miner.h" #include "core.h" @@ -12,10 +10,14 @@ #include "main.h" #include "net.h" #include "pow.h" +#include "util.h" +#include "utilmoneystr.h" #ifdef ENABLE_WALLET #include "wallet.h" #endif +#include + using namespace std; ////////////////////////////////////////////////////////////////////////////// diff --git a/src/net.cpp b/src/net.cpp index 440c271a5e..e2adba8517 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -28,6 +28,7 @@ #endif #include +#include // Dump addresses to peers.dat every 15 minutes (900s) #define DUMP_ADDRESSES_INTERVAL 900 diff --git a/src/net.h b/src/net.h index 2b4732c9de..bfad32b2c1 100644 --- a/src/net.h +++ b/src/net.h @@ -16,7 +16,7 @@ #include "random.h" #include "sync.h" #include "uint256.h" -#include "util.h" +#include "utilstrencodings.h" #include #include @@ -25,6 +25,7 @@ #include #endif +#include #include #include diff --git a/src/netbase.cpp b/src/netbase.cpp index e9207da330..d5821d4465 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -13,6 +13,7 @@ #include "sync.h" #include "uint256.h" #include "util.h" +#include "utilstrencodings.h" #ifdef HAVE_GETADDRINFO_A #include @@ -27,6 +28,7 @@ #include // for to_lower() #include // for startswith() and endswith() +#include #if !defined(HAVE_MSG_NOSIGNAL) && !defined(MSG_NOSIGNAL) #define MSG_NOSIGNAL 0 diff --git a/src/noui.cpp b/src/noui.cpp index 32c861b0d9..8b00fd4057 100644 --- a/src/noui.cpp +++ b/src/noui.cpp @@ -8,6 +8,7 @@ #include "ui_interface.h" #include "util.h" +#include #include #include diff --git a/src/pow.cpp b/src/pow.cpp index c0d0a7ca20..b091cbec3d 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -9,6 +9,7 @@ #include "core.h" #include "main.h" #include "uint256.h" +#include "util.h" unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock) { diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index a43e7cb756..12277a8ad0 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -33,6 +33,7 @@ #include #include +#include #include #include #include diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index bfca5e8d1a..d0a5ff13c3 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -24,6 +24,7 @@ #endif #include "init.h" +#include "util.h" #include "ui_interface.h" #include diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 4c21eb5594..9c9ff5b3a1 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -13,6 +13,7 @@ #include "main.h" #include "net.h" #include "ui_interface.h" +#include "util.h" #include diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index fd1d446f9b..c775a7f8d6 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -21,6 +21,7 @@ #include "wallet.h" // for CWallet::minTxFee #endif +#include #include #include #include diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index a9f1566d62..f6a4b599de 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -11,6 +11,7 @@ #include "base58.h" #include "ui_interface.h" +#include "util.h" #include "wallet.h" #include diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 4f6e3169f5..8258e719a3 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -15,6 +15,7 @@ #include "transactionrecord.h" #include "timedata.h" #include "ui_interface.h" +#include "util.h" #include "wallet.h" #include diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index 1a39894c9b..7df9d1bc2d 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -11,9 +11,10 @@ #include "guiutil.h" #include "init.h" -#include "util.h" #include "version.h" +#include + #include #include #include diff --git a/src/random.cpp b/src/random.cpp index 0d20d205ac..22c942acc0 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -8,12 +8,14 @@ #ifdef WIN32 #include "compat.h" // for Windows API #endif +#include "serialize.h" // for begin_ptr(vec) #include "util.h" // for LogPrint() +#include "utilstrencodings.h" // for GetTime() #ifndef WIN32 #include #endif - +#include #include #include #include diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index e511fe4222..58cab14045 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -7,6 +7,7 @@ #include "main.h" #include "rpcserver.h" #include "sync.h" +#include "util.h" #include diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index ff2361482b..e68ddee040 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -7,6 +7,8 @@ #include "init.h" #include "main.h" #include "sync.h" +#include "utiltime.h" +#include "util.h" #include "wallet.h" #include diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index edab427cbf..6e508abcda 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -11,6 +11,7 @@ #include "miner.h" #include "pow.h" #include "core_io.h" +#include "util.h" #ifdef ENABLE_WALLET #include "db.h" #include "wallet.h" diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp index a4deddbed3..808b9bbd2a 100644 --- a/src/rpcprotocol.cpp +++ b/src/rpcprotocol.cpp @@ -6,6 +6,9 @@ #include "rpcprotocol.h" #include "util.h" +#include "tinyformat.h" +#include "utilstrencodings.h" +#include "utiltime.h" #include "version.h" #include diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 524627e2de..c9133bd3d2 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include "json/json_spirit_writer_template.h" using namespace boost; @@ -82,6 +83,11 @@ void RPCTypeCheck(const Object& o, } } +static inline int64_t roundint64(double d) +{ + return (int64_t)(d > 0 ? d + 0.5 : d - 0.5); +} + int64_t AmountFromValue(const Value& value) { double dAmount = value.get_real(); diff --git a/src/script.cpp b/src/script.cpp index 942e8810db..4c7bb10c37 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -18,8 +18,9 @@ #include "util.h" #include -#include +#include #include +#include using namespace std; using namespace boost; diff --git a/src/script.h b/src/script.h index 1e2cc94efe..462e3f2302 100644 --- a/src/script.h +++ b/src/script.h @@ -7,7 +7,8 @@ #define H_BITCOIN_SCRIPT #include "key.h" -#include "util.h" +#include "utilstrencodings.h" +#include "tinyformat.h" #include #include diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index 5e17555e7a..4ecf6e2535 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -14,6 +14,7 @@ #include "pow.h" #include "script.h" #include "serialize.h" +#include "util.h" #include diff --git a/src/test/alert_tests.cpp b/src/test/alert_tests.cpp index e3066a51ab..4af87cf8ef 100644 --- a/src/test/alert_tests.cpp +++ b/src/test/alert_tests.cpp @@ -11,6 +11,7 @@ #include "serialize.h" #include "util.h" +#include "utilstrencodings.h" #include "version.h" #include diff --git a/src/test/allocator_tests.cpp b/src/test/allocator_tests.cpp index 2752a0b215..69888da3df 100644 --- a/src/test/allocator_tests.cpp +++ b/src/test/allocator_tests.cpp @@ -4,6 +4,8 @@ #include "util.h" +#include "allocators.h" + #include BOOST_AUTO_TEST_SUITE(allocator_tests) diff --git a/src/test/base32_tests.cpp b/src/test/base32_tests.cpp index 87473585e3..68617abbdd 100644 --- a/src/test/base32_tests.cpp +++ b/src/test/base32_tests.cpp @@ -2,7 +2,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "util.h" +#include "utilstrencodings.h" #include diff --git a/src/test/base64_tests.cpp b/src/test/base64_tests.cpp index d4a23d9aa0..f2bf3326ad 100644 --- a/src/test/base64_tests.cpp +++ b/src/test/base64_tests.cpp @@ -2,7 +2,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "util.h" +#include "utilstrencodings.h" #include diff --git a/src/test/checkblock_tests.cpp b/src/test/checkblock_tests.cpp index 10352240f4..fdea12846a 100644 --- a/src/test/checkblock_tests.cpp +++ b/src/test/checkblock_tests.cpp @@ -9,6 +9,7 @@ #include "main.h" +#include "utiltime.h" #include diff --git a/src/test/crypto_tests.cpp b/src/test/crypto_tests.cpp index a17278b803..a3eec270ee 100644 --- a/src/test/crypto_tests.cpp +++ b/src/test/crypto_tests.cpp @@ -6,7 +6,7 @@ #include "crypto/sha1.h" #include "crypto/sha2.h" #include "random.h" -#include "util.h" +#include "utilstrencodings.h" #include diff --git a/src/test/hash_tests.cpp b/src/test/hash_tests.cpp index 4568c8769b..b8e290f071 100644 --- a/src/test/hash_tests.cpp +++ b/src/test/hash_tests.cpp @@ -3,7 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "hash.h" -#include "util.h" +#include "utilstrencodings.h" #include diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 443b5853b2..68fad8d038 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -16,6 +16,7 @@ #include #include +#include CClientUIInterface uiInterface; CWallet* pwalletMain; diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 31fcd3e92a..e077c9de3b 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -4,8 +4,11 @@ #include "util.h" +#include "core.h" #include "random.h" #include "sync.h" +#include "utilstrencodings.h" +#include "utilmoneystr.h" #include #include diff --git a/src/timedata.cpp b/src/timedata.cpp index 4576786b96..40cdb33f7a 100644 --- a/src/timedata.cpp +++ b/src/timedata.cpp @@ -8,6 +8,7 @@ #include "sync.h" #include "ui_interface.h" #include "util.h" +#include "utilstrencodings.h" #include @@ -35,6 +36,11 @@ int64_t GetAdjustedTime() return GetTime() + GetTimeOffset(); } +static int64_t abs64(int64_t n) +{ + return (n >= 0 ? n : -n); +} + void AddTimeData(const CNetAddr& ip, int64_t nTime) { int64_t nOffsetSample = nTime - GetTime(); diff --git a/src/txdb.cpp b/src/txdb.cpp index 7c0683aaf3..a3a9b31534 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -9,6 +9,7 @@ #include "pow.h" #include "uint256.h" +#include #include using namespace std; diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 80cae68244..b327e1c732 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -5,6 +5,7 @@ #include "core.h" #include "txmempool.h" +#include "util.h" #include diff --git a/src/uint256.cpp b/src/uint256.cpp index 08c05594fd..feda0ca5a9 100644 --- a/src/uint256.cpp +++ b/src/uint256.cpp @@ -4,7 +4,8 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "uint256.h" -#include "util.h" + +#include "utilstrencodings.h" #include #include diff --git a/src/util.cpp b/src/util.cpp index 80d27d5826..5a4e187f9e 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -11,13 +11,13 @@ #include "chainparamsbase.h" #include "random.h" +#include "serialize.h" #include "sync.h" -#include "uint256.h" +#include "utilstrencodings.h" +#include "utiltime.h" #include -#include - #ifndef WIN32 // for posix_fallocate #ifdef __linux__ @@ -75,6 +75,7 @@ #include #include #include +#include #include #include @@ -243,148 +244,6 @@ int LogPrintStr(const std::string &str) return ret; } -string FormatMoney(int64_t n, bool fPlus) -{ - // Note: not using straight sprintf here because we do NOT want - // localized number formatting. - int64_t n_abs = (n > 0 ? n : -n); - int64_t quotient = n_abs/COIN; - int64_t remainder = n_abs%COIN; - string str = strprintf("%d.%08d", quotient, remainder); - - // Right-trim excess zeros before the decimal point: - int nTrim = 0; - for (int i = str.size()-1; (str[i] == '0' && isdigit(str[i-2])); --i) - ++nTrim; - if (nTrim) - str.erase(str.size()-nTrim, nTrim); - - if (n < 0) - str.insert((unsigned int)0, 1, '-'); - else if (fPlus && n > 0) - str.insert((unsigned int)0, 1, '+'); - return str; -} - - -bool ParseMoney(const string& str, int64_t& nRet) -{ - return ParseMoney(str.c_str(), nRet); -} - -bool ParseMoney(const char* pszIn, int64_t& nRet) -{ - string strWhole; - int64_t nUnits = 0; - const char* p = pszIn; - while (isspace(*p)) - p++; - for (; *p; p++) - { - if (*p == '.') - { - p++; - int64_t nMult = CENT*10; - while (isdigit(*p) && (nMult > 0)) - { - nUnits += nMult * (*p++ - '0'); - nMult /= 10; - } - break; - } - if (isspace(*p)) - break; - if (!isdigit(*p)) - return false; - strWhole.insert(strWhole.end(), *p); - } - for (; *p; p++) - if (!isspace(*p)) - return false; - if (strWhole.size() > 10) // guard against 63 bit overflow - return false; - if (nUnits < 0 || nUnits > COIN) - return false; - int64_t nWhole = atoi64(strWhole); - int64_t nValue = nWhole*COIN + nUnits; - - nRet = nValue; - return true; -} - -// safeChars chosen to allow simple messages/URLs/email addresses, but avoid anything -// even possibly remotely dangerous like & or > -static string safeChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 .,;_/:?@"); -string SanitizeString(const string& str) -{ - string strResult; - for (std::string::size_type i = 0; i < str.size(); i++) - { - if (safeChars.find(str[i]) != std::string::npos) - strResult.push_back(str[i]); - } - return strResult; -} - -const signed char p_util_hexdigit[256] = -{ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - 0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1, - -1,0xa,0xb,0xc,0xd,0xe,0xf,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,0xa,0xb,0xc,0xd,0xe,0xf,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, }; - -signed char HexDigit(char c) -{ - return p_util_hexdigit[(unsigned char)c]; -} - -bool IsHex(const string& str) -{ - BOOST_FOREACH(char c, str) - { - if (HexDigit(c) < 0) - return false; - } - return (str.size() > 0) && (str.size()%2 == 0); -} - -vector ParseHex(const char* psz) -{ - // convert hex dump to vector - vector vch; - while (true) - { - while (isspace(*psz)) - psz++; - signed char c = HexDigit(*psz++); - if (c == (signed char)-1) - break; - unsigned char n = (c << 4); - c = HexDigit(*psz++); - if (c == (signed char)-1) - break; - n |= c; - vch.push_back(n); - } - return vch; -} - -vector ParseHex(const string& str) -{ - return ParseHex(str.c_str()); -} - static void InterpretNegativeSetting(string name, map& mapSettingsRet) { // interpret -nofoo as -foo=0 (and -nofoo=0 as -foo=1) as long as -foo not set @@ -482,334 +341,6 @@ bool SoftSetBoolArg(const std::string& strArg, bool fValue) return SoftSetArg(strArg, std::string("0")); } - -string EncodeBase64(const unsigned char* pch, size_t len) -{ - static const char *pbase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - - string strRet=""; - strRet.reserve((len+2)/3*4); - - int mode=0, left=0; - const unsigned char *pchEnd = pch+len; - - while (pch> 2]; - left = (enc & 3) << 4; - mode = 1; - break; - - case 1: // we have two bits - strRet += pbase64[left | (enc >> 4)]; - left = (enc & 15) << 2; - mode = 2; - break; - - case 2: // we have four bits - strRet += pbase64[left | (enc >> 6)]; - strRet += pbase64[enc & 63]; - mode = 0; - break; - } - } - - if (mode) - { - strRet += pbase64[left]; - strRet += '='; - if (mode == 1) - strRet += '='; - } - - return strRet; -} - -string EncodeBase64(const string& str) -{ - return EncodeBase64((const unsigned char*)str.c_str(), str.size()); -} - -vector DecodeBase64(const char* p, bool* pfInvalid) -{ - static const int decode64_table[256] = - { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, - -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - }; - - if (pfInvalid) - *pfInvalid = false; - - vector vchRet; - vchRet.reserve(strlen(p)*3/4); - - int mode = 0; - int left = 0; - - while (1) - { - int dec = decode64_table[(unsigned char)*p]; - if (dec == -1) break; - p++; - switch (mode) - { - case 0: // we have no bits and get 6 - left = dec; - mode = 1; - break; - - case 1: // we have 6 bits and keep 4 - vchRet.push_back((left<<2) | (dec>>4)); - left = dec & 15; - mode = 2; - break; - - case 2: // we have 4 bits and get 6, we keep 2 - vchRet.push_back((left<<4) | (dec>>2)); - left = dec & 3; - mode = 3; - break; - - case 3: // we have 2 bits and get 6 - vchRet.push_back((left<<6) | dec); - mode = 0; - break; - } - } - - if (pfInvalid) - switch (mode) - { - case 0: // 4n base64 characters processed: ok - break; - - case 1: // 4n+1 base64 character processed: impossible - *pfInvalid = true; - break; - - case 2: // 4n+2 base64 characters processed: require '==' - if (left || p[0] != '=' || p[1] != '=' || decode64_table[(unsigned char)p[2]] != -1) - *pfInvalid = true; - break; - - case 3: // 4n+3 base64 characters processed: require '=' - if (left || p[0] != '=' || decode64_table[(unsigned char)p[1]] != -1) - *pfInvalid = true; - break; - } - - return vchRet; -} - -string DecodeBase64(const string& str) -{ - vector vchRet = DecodeBase64(str.c_str()); - return string((const char*)&vchRet[0], vchRet.size()); -} - -string EncodeBase32(const unsigned char* pch, size_t len) -{ - static const char *pbase32 = "abcdefghijklmnopqrstuvwxyz234567"; - - string strRet=""; - strRet.reserve((len+4)/5*8); - - int mode=0, left=0; - const unsigned char *pchEnd = pch+len; - - while (pch> 3]; - left = (enc & 7) << 2; - mode = 1; - break; - - case 1: // we have three bits - strRet += pbase32[left | (enc >> 6)]; - strRet += pbase32[(enc >> 1) & 31]; - left = (enc & 1) << 4; - mode = 2; - break; - - case 2: // we have one bit - strRet += pbase32[left | (enc >> 4)]; - left = (enc & 15) << 1; - mode = 3; - break; - - case 3: // we have four bits - strRet += pbase32[left | (enc >> 7)]; - strRet += pbase32[(enc >> 2) & 31]; - left = (enc & 3) << 3; - mode = 4; - break; - - case 4: // we have two bits - strRet += pbase32[left | (enc >> 5)]; - strRet += pbase32[enc & 31]; - mode = 0; - } - } - - static const int nPadding[5] = {0, 6, 4, 3, 1}; - if (mode) - { - strRet += pbase32[left]; - for (int n=0; n DecodeBase32(const char* p, bool* pfInvalid) -{ - static const int decode32_table[256] = - { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 0, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - }; - - if (pfInvalid) - *pfInvalid = false; - - vector vchRet; - vchRet.reserve((strlen(p))*5/8); - - int mode = 0; - int left = 0; - - while (1) - { - int dec = decode32_table[(unsigned char)*p]; - if (dec == -1) break; - p++; - switch (mode) - { - case 0: // we have no bits and get 5 - left = dec; - mode = 1; - break; - - case 1: // we have 5 bits and keep 2 - vchRet.push_back((left<<3) | (dec>>2)); - left = dec & 3; - mode = 2; - break; - - case 2: // we have 2 bits and keep 7 - left = left << 5 | dec; - mode = 3; - break; - - case 3: // we have 7 bits and keep 4 - vchRet.push_back((left<<1) | (dec>>4)); - left = dec & 15; - mode = 4; - break; - - case 4: // we have 4 bits, and keep 1 - vchRet.push_back((left<<4) | (dec>>1)); - left = dec & 1; - mode = 5; - break; - - case 5: // we have 1 bit, and keep 6 - left = left << 5 | dec; - mode = 6; - break; - - case 6: // we have 6 bits, and keep 3 - vchRet.push_back((left<<2) | (dec>>3)); - left = dec & 7; - mode = 7; - break; - - case 7: // we have 3 bits, and keep 0 - vchRet.push_back((left<<5) | dec); - mode = 0; - break; - } - } - - if (pfInvalid) - switch (mode) - { - case 0: // 8n base32 characters processed: ok - break; - - case 1: // 8n+1 base32 characters processed: impossible - case 3: // +3 - case 6: // +6 - *pfInvalid = true; - break; - - case 2: // 8n+2 base32 characters processed: require '======' - if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || p[3] != '=' || p[4] != '=' || p[5] != '=' || decode32_table[(unsigned char)p[6]] != -1) - *pfInvalid = true; - break; - - case 4: // 8n+4 base32 characters processed: require '====' - if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || p[3] != '=' || decode32_table[(unsigned char)p[4]] != -1) - *pfInvalid = true; - break; - - case 5: // 8n+5 base32 characters processed: require '===' - if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || decode32_table[(unsigned char)p[3]] != -1) - *pfInvalid = true; - break; - - case 7: // 8n+7 base32 characters processed: require '=' - if (left || p[0] != '=' || decode32_table[(unsigned char)p[1]] != -1) - *pfInvalid = true; - break; - } - - return vchRet; -} - -string DecodeBase32(const string& str) -{ - vector vchRet = DecodeBase32(str.c_str()); - return string((const char*)&vchRet[0], vchRet.size()); -} - static std::string FormatException(std::exception* pex, const char* pszThread) { #ifdef WIN32 @@ -1101,21 +632,6 @@ void ShrinkDebugFile() fclose(file); } -static int64_t nMockTime = 0; // For unit testing - -int64_t GetTime() -{ - if (nMockTime) return nMockTime; - - return time(NULL); -} - -void SetMockTime(int64_t nMockTimeIn) -{ - nMockTime = nMockTimeIn; -} - - #ifdef WIN32 boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate) { @@ -1186,20 +702,6 @@ void RenameThread(const char* name) #endif } -bool ParseInt32(const std::string& str, int32_t *out) -{ - char *endp = NULL; - errno = 0; // strtol will not set errno if valid - long int n = strtol(str.c_str(), &endp, 10); - if(out) *out = (int)n; - // Note that strtol returns a *long int*, so even if strtol doesn't report a over/underflow - // we still have to check that the returned value is within the range of an *int32_t*. On 64-bit - // platforms the size of these types may be different. - return endp && *endp == 0 && !errno && - n >= std::numeric_limits::min() && - n <= std::numeric_limits::max(); -} - void SetupEnvironment() { #ifndef WIN32 @@ -1217,51 +719,6 @@ void SetupEnvironment() #endif } -std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime) -{ - // std::locale takes ownership of the pointer - std::locale loc(std::locale::classic(), new boost::posix_time::time_facet(pszFormat)); - std::stringstream ss; - ss.imbue(loc); - ss << boost::posix_time::from_time_t(nTime); - return ss.str(); -} - -std::string FormatParagraph(const std::string in, size_t width, size_t indent) -{ - std::stringstream out; - size_t col = 0; - size_t ptr = 0; - while(ptr < in.size()) - { - // Find beginning of next word - ptr = in.find_first_not_of(' ', ptr); - if (ptr == std::string::npos) - break; - // Find end of next word - size_t endword = in.find_first_of(' ', ptr); - if (endword == std::string::npos) - endword = in.size(); - // Add newline and indentation if this wraps over the allowed width - if (col > 0) - { - if ((col + endword - ptr) > width) - { - out << '\n'; - for(size_t i=0; i #include #include -#include #include #include -#include #include -#ifndef WIN32 -#include -#include -#include -#endif - #include -#include - -class uint256; - -#define BEGIN(a) ((char*)&(a)) -#define END(a) ((char*)&((&(a))[1])) -#define UBEGIN(a) ((unsigned char*)&(a)) -#define UEND(a) ((unsigned char*)&((&(a))[1])) -#define ARRAYLEN(array) (sizeof(array)/sizeof((array)[0])) - -// This is needed because the foreach macro can't get over the comma in pair -#define PAIRTYPE(t1, t2) std::pair - - -inline void MilliSleep(int64_t n) -{ -// Boost's sleep_for was uninterruptable when backed by nanosleep from 1.50 -// until fixed in 1.52. Use the deprecated sleep method for the broken case. -// See: https://svn.boost.org/trac/boost/ticket/7238 -#if defined(HAVE_WORKING_BOOST_SLEEP_FOR) - boost::this_thread::sleep_for(boost::chrono::milliseconds(n)); -#elif defined(HAVE_WORKING_BOOST_SLEEP) - boost::this_thread::sleep(boost::posix_time::milliseconds(n)); -#else -//should never get here -#error missing boost sleep implementation -#endif -} +#include extern std::map mapArgs; extern std::map > mapMultiArgs; @@ -115,22 +83,6 @@ static inline bool error(const char* format) } void PrintExceptionContinue(std::exception* pex, const char* pszThread); -std::string FormatMoney(int64_t n, bool fPlus=false); -bool ParseMoney(const std::string& str, int64_t& nRet); -bool ParseMoney(const char* pszIn, int64_t& nRet); -std::string SanitizeString(const std::string& str); -std::vector ParseHex(const char* psz); -std::vector ParseHex(const std::string& str); -signed char HexDigit(char c); -bool IsHex(const std::string& str); -std::vector DecodeBase64(const char* p, bool* pfInvalid = NULL); -std::string DecodeBase64(const std::string& str); -std::string EncodeBase64(const unsigned char* pch, size_t len); -std::string EncodeBase64(const std::string& str); -std::vector DecodeBase32(const char* p, bool* pfInvalid = NULL); -std::string DecodeBase32(const std::string& str); -std::string EncodeBase32(const unsigned char* pch, size_t len); -std::string EncodeBase32(const std::string& str); void ParseParameters(int argc, const char*const argv[]); void FileCommit(FILE *fileout); bool TruncateFile(FILE *file, unsigned int length); @@ -151,109 +103,8 @@ boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate = true); #endif boost::filesystem::path GetTempPath(); void ShrinkDebugFile(); -int64_t GetTime(); -void SetMockTime(int64_t nMockTimeIn); void runCommand(std::string strCommand); -inline std::string i64tostr(int64_t n) -{ - return strprintf("%d", n); -} - -inline std::string itostr(int n) -{ - return strprintf("%d", n); -} - -inline int64_t atoi64(const char* psz) -{ -#ifdef _MSC_VER - return _atoi64(psz); -#else - return strtoll(psz, NULL, 10); -#endif -} - -inline int64_t atoi64(const std::string& str) -{ -#ifdef _MSC_VER - return _atoi64(str.c_str()); -#else - return strtoll(str.c_str(), NULL, 10); -#endif -} - -inline int atoi(const std::string& str) -{ - return atoi(str.c_str()); -} - -/** - * Convert string to signed 32-bit integer with strict parse error feedback. - * @returns true if the entire string could be parsed as valid integer, - * false if not the entire string could be parsed or when overflow or underflow occured. - */ -bool ParseInt32(const std::string& str, int32_t *out); - -inline int roundint(double d) -{ - return (int)(d > 0 ? d + 0.5 : d - 0.5); -} - -inline int64_t roundint64(double d) -{ - return (int64_t)(d > 0 ? d + 0.5 : d - 0.5); -} - -inline int64_t abs64(int64_t n) -{ - return (n >= 0 ? n : -n); -} - -template -std::string HexStr(const T itbegin, const T itend, bool fSpaces=false) -{ - std::string rv; - static const char hexmap[16] = { '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; - rv.reserve((itend-itbegin)*3); - for(T it = itbegin; it < itend; ++it) - { - unsigned char val = (unsigned char)(*it); - if(fSpaces && it != itbegin) - rv.push_back(' '); - rv.push_back(hexmap[val>>4]); - rv.push_back(hexmap[val&15]); - } - - return rv; -} - -template -inline std::string HexStr(const T& vch, bool fSpaces=false) -{ - return HexStr(vch.begin(), vch.end(), fSpaces); -} - -/** Format a paragraph of text to a fixed width, adding spaces for - * indentation to any added line. - */ -std::string FormatParagraph(const std::string in, size_t width=79, size_t indent=0); - -inline int64_t GetTimeMillis() -{ - return (boost::posix_time::ptime(boost::posix_time::microsec_clock::universal_time()) - - boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_milliseconds(); -} - -inline int64_t GetTimeMicros() -{ - return (boost::posix_time::ptime(boost::posix_time::microsec_clock::universal_time()) - - boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_microseconds(); -} - -std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime); - inline bool IsSwitchChar(char c) { #ifdef WIN32 @@ -308,21 +159,6 @@ bool SoftSetArg(const std::string& strArg, const std::string& strValue); */ bool SoftSetBoolArg(const std::string& strArg, bool fValue); -/** - * Timing-attack-resistant comparison. - * Takes time proportional to length - * of first argument. - */ -template -bool TimingResistantEqual(const T& a, const T& b) -{ - if (b.size() == 0) return a.size() == 0; - size_t accumulator = a.size() ^ b.size(); - for (size_t i = 0; i < a.size(); i++) - accumulator |= a[i] ^ b[i%b.size()]; - return accumulator == 0; -} - void SetThreadPriority(int nPriority); void RenameThread(const char* name); diff --git a/src/utilmoneystr.cpp b/src/utilmoneystr.cpp new file mode 100644 index 0000000000..1bd48d8d4c --- /dev/null +++ b/src/utilmoneystr.cpp @@ -0,0 +1,75 @@ +#include "utilmoneystr.h" + +#include "core.h" +#include "tinyformat.h" + +using namespace std; + +string FormatMoney(int64_t n, bool fPlus) +{ + // Note: not using straight sprintf here because we do NOT want + // localized number formatting. + int64_t n_abs = (n > 0 ? n : -n); + int64_t quotient = n_abs/COIN; + int64_t remainder = n_abs%COIN; + string str = strprintf("%d.%08d", quotient, remainder); + + // Right-trim excess zeros before the decimal point: + int nTrim = 0; + for (int i = str.size()-1; (str[i] == '0' && isdigit(str[i-2])); --i) + ++nTrim; + if (nTrim) + str.erase(str.size()-nTrim, nTrim); + + if (n < 0) + str.insert((unsigned int)0, 1, '-'); + else if (fPlus && n > 0) + str.insert((unsigned int)0, 1, '+'); + return str; +} + + +bool ParseMoney(const string& str, int64_t& nRet) +{ + return ParseMoney(str.c_str(), nRet); +} + +bool ParseMoney(const char* pszIn, int64_t& nRet) +{ + string strWhole; + int64_t nUnits = 0; + const char* p = pszIn; + while (isspace(*p)) + p++; + for (; *p; p++) + { + if (*p == '.') + { + p++; + int64_t nMult = CENT*10; + while (isdigit(*p) && (nMult > 0)) + { + nUnits += nMult * (*p++ - '0'); + nMult /= 10; + } + break; + } + if (isspace(*p)) + break; + if (!isdigit(*p)) + return false; + strWhole.insert(strWhole.end(), *p); + } + for (; *p; p++) + if (!isspace(*p)) + return false; + if (strWhole.size() > 10) // guard against 63 bit overflow + return false; + if (nUnits < 0 || nUnits > COIN) + return false; + int64_t nWhole = atoi64(strWhole); + int64_t nValue = nWhole*COIN + nUnits; + + nRet = nValue; + return true; +} diff --git a/src/utilmoneystr.h b/src/utilmoneystr.h new file mode 100644 index 0000000000..f0c61aa138 --- /dev/null +++ b/src/utilmoneystr.h @@ -0,0 +1,19 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +/** + * Money parsing/formatting utilities. + */ +#ifndef BITCOIN_UTILMONEYSTR_H +#define BITCOIN_UTILMONEYSTR_H + +#include +#include + +std::string FormatMoney(int64_t n, bool fPlus=false); +bool ParseMoney(const std::string& str, int64_t& nRet); +bool ParseMoney(const char* pszIn, int64_t& nRet); + +#endif // BITCOIN_UTILMONEYSTR_H diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp new file mode 100644 index 0000000000..ef13555104 --- /dev/null +++ b/src/utilstrencodings.cpp @@ -0,0 +1,496 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "utilstrencodings.h" + +#include "tinyformat.h" + +#include +#include +#include + +using namespace std; + +// safeChars chosen to allow simple messages/URLs/email addresses, but avoid anything +// even possibly remotely dangerous like & or > +static string safeChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 .,;_/:?@"); +string SanitizeString(const string& str) +{ + string strResult; + for (std::string::size_type i = 0; i < str.size(); i++) + { + if (safeChars.find(str[i]) != std::string::npos) + strResult.push_back(str[i]); + } + return strResult; +} + +const signed char p_util_hexdigit[256] = +{ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + 0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1, + -1,0xa,0xb,0xc,0xd,0xe,0xf,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,0xa,0xb,0xc,0xd,0xe,0xf,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, }; + +signed char HexDigit(char c) +{ + return p_util_hexdigit[(unsigned char)c]; +} + +bool IsHex(const string& str) +{ + BOOST_FOREACH(char c, str) + { + if (HexDigit(c) < 0) + return false; + } + return (str.size() > 0) && (str.size()%2 == 0); +} + +vector ParseHex(const char* psz) +{ + // convert hex dump to vector + vector vch; + while (true) + { + while (isspace(*psz)) + psz++; + signed char c = HexDigit(*psz++); + if (c == (signed char)-1) + break; + unsigned char n = (c << 4); + c = HexDigit(*psz++); + if (c == (signed char)-1) + break; + n |= c; + vch.push_back(n); + } + return vch; +} + +vector ParseHex(const string& str) +{ + return ParseHex(str.c_str()); +} + +string EncodeBase64(const unsigned char* pch, size_t len) +{ + static const char *pbase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + + string strRet=""; + strRet.reserve((len+2)/3*4); + + int mode=0, left=0; + const unsigned char *pchEnd = pch+len; + + while (pch> 2]; + left = (enc & 3) << 4; + mode = 1; + break; + + case 1: // we have two bits + strRet += pbase64[left | (enc >> 4)]; + left = (enc & 15) << 2; + mode = 2; + break; + + case 2: // we have four bits + strRet += pbase64[left | (enc >> 6)]; + strRet += pbase64[enc & 63]; + mode = 0; + break; + } + } + + if (mode) + { + strRet += pbase64[left]; + strRet += '='; + if (mode == 1) + strRet += '='; + } + + return strRet; +} + +string EncodeBase64(const string& str) +{ + return EncodeBase64((const unsigned char*)str.c_str(), str.size()); +} + +vector DecodeBase64(const char* p, bool* pfInvalid) +{ + static const int decode64_table[256] = + { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, + -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + }; + + if (pfInvalid) + *pfInvalid = false; + + vector vchRet; + vchRet.reserve(strlen(p)*3/4); + + int mode = 0; + int left = 0; + + while (1) + { + int dec = decode64_table[(unsigned char)*p]; + if (dec == -1) break; + p++; + switch (mode) + { + case 0: // we have no bits and get 6 + left = dec; + mode = 1; + break; + + case 1: // we have 6 bits and keep 4 + vchRet.push_back((left<<2) | (dec>>4)); + left = dec & 15; + mode = 2; + break; + + case 2: // we have 4 bits and get 6, we keep 2 + vchRet.push_back((left<<4) | (dec>>2)); + left = dec & 3; + mode = 3; + break; + + case 3: // we have 2 bits and get 6 + vchRet.push_back((left<<6) | dec); + mode = 0; + break; + } + } + + if (pfInvalid) + switch (mode) + { + case 0: // 4n base64 characters processed: ok + break; + + case 1: // 4n+1 base64 character processed: impossible + *pfInvalid = true; + break; + + case 2: // 4n+2 base64 characters processed: require '==' + if (left || p[0] != '=' || p[1] != '=' || decode64_table[(unsigned char)p[2]] != -1) + *pfInvalid = true; + break; + + case 3: // 4n+3 base64 characters processed: require '=' + if (left || p[0] != '=' || decode64_table[(unsigned char)p[1]] != -1) + *pfInvalid = true; + break; + } + + return vchRet; +} + +string DecodeBase64(const string& str) +{ + vector vchRet = DecodeBase64(str.c_str()); + return string((const char*)&vchRet[0], vchRet.size()); +} + +string EncodeBase32(const unsigned char* pch, size_t len) +{ + static const char *pbase32 = "abcdefghijklmnopqrstuvwxyz234567"; + + string strRet=""; + strRet.reserve((len+4)/5*8); + + int mode=0, left=0; + const unsigned char *pchEnd = pch+len; + + while (pch> 3]; + left = (enc & 7) << 2; + mode = 1; + break; + + case 1: // we have three bits + strRet += pbase32[left | (enc >> 6)]; + strRet += pbase32[(enc >> 1) & 31]; + left = (enc & 1) << 4; + mode = 2; + break; + + case 2: // we have one bit + strRet += pbase32[left | (enc >> 4)]; + left = (enc & 15) << 1; + mode = 3; + break; + + case 3: // we have four bits + strRet += pbase32[left | (enc >> 7)]; + strRet += pbase32[(enc >> 2) & 31]; + left = (enc & 3) << 3; + mode = 4; + break; + + case 4: // we have two bits + strRet += pbase32[left | (enc >> 5)]; + strRet += pbase32[enc & 31]; + mode = 0; + } + } + + static const int nPadding[5] = {0, 6, 4, 3, 1}; + if (mode) + { + strRet += pbase32[left]; + for (int n=0; n DecodeBase32(const char* p, bool* pfInvalid) +{ + static const int decode32_table[256] = + { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 0, 1, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + }; + + if (pfInvalid) + *pfInvalid = false; + + vector vchRet; + vchRet.reserve((strlen(p))*5/8); + + int mode = 0; + int left = 0; + + while (1) + { + int dec = decode32_table[(unsigned char)*p]; + if (dec == -1) break; + p++; + switch (mode) + { + case 0: // we have no bits and get 5 + left = dec; + mode = 1; + break; + + case 1: // we have 5 bits and keep 2 + vchRet.push_back((left<<3) | (dec>>2)); + left = dec & 3; + mode = 2; + break; + + case 2: // we have 2 bits and keep 7 + left = left << 5 | dec; + mode = 3; + break; + + case 3: // we have 7 bits and keep 4 + vchRet.push_back((left<<1) | (dec>>4)); + left = dec & 15; + mode = 4; + break; + + case 4: // we have 4 bits, and keep 1 + vchRet.push_back((left<<4) | (dec>>1)); + left = dec & 1; + mode = 5; + break; + + case 5: // we have 1 bit, and keep 6 + left = left << 5 | dec; + mode = 6; + break; + + case 6: // we have 6 bits, and keep 3 + vchRet.push_back((left<<2) | (dec>>3)); + left = dec & 7; + mode = 7; + break; + + case 7: // we have 3 bits, and keep 0 + vchRet.push_back((left<<5) | dec); + mode = 0; + break; + } + } + + if (pfInvalid) + switch (mode) + { + case 0: // 8n base32 characters processed: ok + break; + + case 1: // 8n+1 base32 characters processed: impossible + case 3: // +3 + case 6: // +6 + *pfInvalid = true; + break; + + case 2: // 8n+2 base32 characters processed: require '======' + if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || p[3] != '=' || p[4] != '=' || p[5] != '=' || decode32_table[(unsigned char)p[6]] != -1) + *pfInvalid = true; + break; + + case 4: // 8n+4 base32 characters processed: require '====' + if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || p[3] != '=' || decode32_table[(unsigned char)p[4]] != -1) + *pfInvalid = true; + break; + + case 5: // 8n+5 base32 characters processed: require '===' + if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || decode32_table[(unsigned char)p[3]] != -1) + *pfInvalid = true; + break; + + case 7: // 8n+7 base32 characters processed: require '=' + if (left || p[0] != '=' || decode32_table[(unsigned char)p[1]] != -1) + *pfInvalid = true; + break; + } + + return vchRet; +} + +string DecodeBase32(const string& str) +{ + vector vchRet = DecodeBase32(str.c_str()); + return string((const char*)&vchRet[0], vchRet.size()); +} + +bool ParseInt32(const std::string& str, int32_t *out) +{ + char *endp = NULL; + errno = 0; // strtol will not set errno if valid + long int n = strtol(str.c_str(), &endp, 10); + if(out) *out = (int)n; + // Note that strtol returns a *long int*, so even if strtol doesn't report a over/underflow + // we still have to check that the returned value is within the range of an *int32_t*. On 64-bit + // platforms the size of these types may be different. + return endp && *endp == 0 && !errno && + n >= std::numeric_limits::min() && + n <= std::numeric_limits::max(); +} + +std::string FormatParagraph(const std::string in, size_t width, size_t indent) +{ + std::stringstream out; + size_t col = 0; + size_t ptr = 0; + while(ptr < in.size()) + { + // Find beginning of next word + ptr = in.find_first_not_of(' ', ptr); + if (ptr == std::string::npos) + break; + // Find end of next word + size_t endword = in.find_first_of(' ', ptr); + if (endword == std::string::npos) + endword = in.size(); + // Add newline and indentation if this wraps over the allowed width + if (col > 0) + { + if ((col + endword - ptr) > width) + { + out << '\n'; + for(size_t i=0; i +#include +#include + +#define BEGIN(a) ((char*)&(a)) +#define END(a) ((char*)&((&(a))[1])) +#define UBEGIN(a) ((unsigned char*)&(a)) +#define UEND(a) ((unsigned char*)&((&(a))[1])) +#define ARRAYLEN(array) (sizeof(array)/sizeof((array)[0])) + +// This is needed because the foreach macro can't get over the comma in pair +#define PAIRTYPE(t1, t2) std::pair + +std::string SanitizeString(const std::string& str); +std::vector ParseHex(const char* psz); +std::vector ParseHex(const std::string& str); +signed char HexDigit(char c); +bool IsHex(const std::string& str); +std::vector DecodeBase64(const char* p, bool* pfInvalid = NULL); +std::string DecodeBase64(const std::string& str); +std::string EncodeBase64(const unsigned char* pch, size_t len); +std::string EncodeBase64(const std::string& str); +std::vector DecodeBase32(const char* p, bool* pfInvalid = NULL); +std::string DecodeBase32(const std::string& str); +std::string EncodeBase32(const unsigned char* pch, size_t len); +std::string EncodeBase32(const std::string& str); + +std::string i64tostr(int64_t n); +std::string itostr(int n); +int64_t atoi64(const char* psz); +int64_t atoi64(const std::string& str); +int atoi(const std::string& str); + +/** + * Convert string to signed 32-bit integer with strict parse error feedback. + * @returns true if the entire string could be parsed as valid integer, + * false if not the entire string could be parsed or when overflow or underflow occured. + */ +bool ParseInt32(const std::string& str, int32_t *out); + +template +std::string HexStr(const T itbegin, const T itend, bool fSpaces=false) +{ + std::string rv; + static const char hexmap[16] = { '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; + rv.reserve((itend-itbegin)*3); + for(T it = itbegin; it < itend; ++it) + { + unsigned char val = (unsigned char)(*it); + if(fSpaces && it != itbegin) + rv.push_back(' '); + rv.push_back(hexmap[val>>4]); + rv.push_back(hexmap[val&15]); + } + + return rv; +} + +template +inline std::string HexStr(const T& vch, bool fSpaces=false) +{ + return HexStr(vch.begin(), vch.end(), fSpaces); +} + +/** Format a paragraph of text to a fixed width, adding spaces for + * indentation to any added line. + */ +std::string FormatParagraph(const std::string in, size_t width=79, size_t indent=0); + +/** + * Timing-attack-resistant comparison. + * Takes time proportional to length + * of first argument. + */ +template +bool TimingResistantEqual(const T& a, const T& b) +{ + if (b.size() == 0) return a.size() == 0; + size_t accumulator = a.size() ^ b.size(); + for (size_t i = 0; i < a.size(); i++) + accumulator |= a[i] ^ b[i%b.size()]; + return accumulator == 0; +} + +#endif // BITCOIN_UTILSTRENCODINGS_H diff --git a/src/utiltime.cpp b/src/utiltime.cpp new file mode 100644 index 0000000000..78f0342cba --- /dev/null +++ b/src/utiltime.cpp @@ -0,0 +1,66 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#if defined(HAVE_CONFIG_H) +#include "config/bitcoin-config.h" +#endif + +#include "utiltime.h" + +#include +#include + +using namespace std; + +static int64_t nMockTime = 0; // For unit testing + +int64_t GetTime() +{ + if (nMockTime) return nMockTime; + + return time(NULL); +} + +void SetMockTime(int64_t nMockTimeIn) +{ + nMockTime = nMockTimeIn; +} + +int64_t GetTimeMillis() +{ + return (boost::posix_time::ptime(boost::posix_time::microsec_clock::universal_time()) - + boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_milliseconds(); +} + +int64_t GetTimeMicros() +{ + return (boost::posix_time::ptime(boost::posix_time::microsec_clock::universal_time()) - + boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_microseconds(); +} + +void MilliSleep(int64_t n) +{ +// Boost's sleep_for was uninterruptable when backed by nanosleep from 1.50 +// until fixed in 1.52. Use the deprecated sleep method for the broken case. +// See: https://svn.boost.org/trac/boost/ticket/7238 +#if defined(HAVE_WORKING_BOOST_SLEEP_FOR) + boost::this_thread::sleep_for(boost::chrono::milliseconds(n)); +#elif defined(HAVE_WORKING_BOOST_SLEEP) + boost::this_thread::sleep(boost::posix_time::milliseconds(n)); +#else +//should never get here +#error missing boost sleep implementation +#endif +} + +std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime) +{ + // std::locale takes ownership of the pointer + std::locale loc(std::locale::classic(), new boost::posix_time::time_facet(pszFormat)); + std::stringstream ss; + ss.imbue(loc); + ss << boost::posix_time::from_time_t(nTime); + return ss.str(); +} diff --git a/src/utiltime.h b/src/utiltime.h new file mode 100644 index 0000000000..500ae4dab9 --- /dev/null +++ b/src/utiltime.h @@ -0,0 +1,20 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_UTILTIME_H +#define BITCOIN_UTILTIME_H + +#include +#include + +int64_t GetTime(); +int64_t GetTimeMillis(); +int64_t GetTimeMicros(); +void SetMockTime(int64_t nMockTimeIn); +void MilliSleep(int64_t n); + +std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime); + +#endif diff --git a/src/wallet.cpp b/src/wallet.cpp index ee4793b3f1..91f7eaa560 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -10,8 +10,11 @@ #include "coincontrol.h" #include "net.h" #include "timedata.h" +#include "util.h" +#include "utilmoneystr.h" #include +#include using namespace std; @@ -37,6 +40,11 @@ struct CompareValueOnly } }; +std::string COutput::ToString() const +{ + return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString(), i, nDepth, FormatMoney(tx->vout[i].nValue).c_str()); +} + const CWalletTx* CWallet::GetWalletTx(const uint256& hash) const { LOCK(cs_wallet); diff --git a/src/wallet.h b/src/wallet.h index 7cbbb2a6ed..bdb0264729 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -11,7 +11,6 @@ #include "keystore.h" #include "main.h" #include "ui_interface.h" -#include "util.h" #include "walletdb.h" #include @@ -812,10 +811,7 @@ public: tx = txIn; i = iIn; nDepth = nDepthIn; fSpendable = fSpendableIn; } - std::string ToString() const - { - return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString(), i, nDepth, FormatMoney(tx->vout[i].nValue).c_str()); - } + std::string ToString() const; }; diff --git a/src/walletdb.cpp b/src/walletdb.cpp index a95baf83d0..2fa6071658 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -9,10 +9,13 @@ #include "protocol.h" #include "serialize.h" #include "sync.h" +#include "utiltime.h" +#include "util.h" #include "wallet.h" #include #include +#include using namespace std; using namespace boost; From f30801afbde7598318a5b03de9812c58a6a34f33 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 26 Aug 2014 17:44:57 +0200 Subject: [PATCH 0597/1288] qt: Add null check in setClientModel(0) Don't clear tray icon menu if it was never created. Necessary precaution after #4649. --- src/qt/bitcoingui.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 68d42ce64b..790301a1eb 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -455,8 +455,11 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel) } else { // Disable possibility to show main window via action toggleHideAction->setEnabled(false); - // Disable context menu on tray icon - trayIconMenu->clear(); + if(trayIconMenu) + { + // Disable context menu on tray icon + trayIconMenu->clear(); + } } } From 80daee0fb585762d303503f32f8efa0e625f152f Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 17 Aug 2014 02:34:42 +0200 Subject: [PATCH 0598/1288] [Qt] Call checkBalanceChanged() periodically instead for every updated transaction --- src/qt/walletmodel.cpp | 18 +++++++++++------- src/qt/walletmodel.h | 1 + 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 92c22f5692..530c46cdb4 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -36,6 +36,7 @@ WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *p { fProcessingQueuedTransactions = false; fHaveWatchOnly = wallet->HaveWatchOnly(); + fForceCheckBalanceChanged = false; addressTableModel = new AddressTableModel(wallet, this); transactionTableModel = new TransactionTableModel(wallet, this); @@ -121,8 +122,10 @@ void WalletModel::pollBalanceChanged() if(!lockWallet) return; - if(chainActive.Height() != cachedNumBlocks) + if(fForceCheckBalanceChanged || chainActive.Height() != cachedNumBlocks) { + fForceCheckBalanceChanged = false; + // Balance and number of transactions might have changed cachedNumBlocks = chainActive.Height(); @@ -167,7 +170,7 @@ void WalletModel::updateTransaction(const QString &hash, int status) transactionTableModel->updateTransaction(hash, status); // Balance and number of transactions might have changed - checkBalanceChanged(); + fForceCheckBalanceChanged = true; } void WalletModel::updateAddressBook(const QString &address, const QString &label, @@ -344,6 +347,7 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction &tran } emit coinsSent(wallet, rcp, transaction_array); } + checkBalanceChanged(); // update balance immediately, otherwise there could be a short noticeable delay until pollBalanceChanged hits return SendCoinsReturn(OK); } @@ -473,11 +477,6 @@ static void NotifyTransactionChanged(WalletModel *walletmodel, CWallet *wallet, static void ShowProgress(WalletModel *walletmodel, const std::string &title, int nProgress) { - // emits signal "showProgress" - QMetaObject::invokeMethod(walletmodel, "showProgress", Qt::QueuedConnection, - Q_ARG(QString, QString::fromStdString(title)), - Q_ARG(int, nProgress)); - if (nProgress == 0) fQueueNotifications = true; @@ -495,6 +494,11 @@ static void ShowProgress(WalletModel *walletmodel, const std::string &title, int } std::vector >().swap(vQueueNotifications); // clear } + + // emits signal "showProgress" + QMetaObject::invokeMethod(walletmodel, "showProgress", Qt::QueuedConnection, + Q_ARG(QString, QString::fromStdString(title)), + Q_ARG(int, nProgress)); } static void NotifyWatchonlyChanged(WalletModel *walletmodel, bool fHaveWatchonly) diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index b3a401e4cc..b277b0e9fc 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -199,6 +199,7 @@ private: CWallet *wallet; bool fProcessingQueuedTransactions; bool fHaveWatchOnly; + bool fForceCheckBalanceChanged; // Wallet has an options model for wallet-specific options // (transaction fee, for example) From 9f7f504efca27c7d390f121410846b45c1732761 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 26 Aug 2014 15:17:18 -0400 Subject: [PATCH 0599/1288] build: add -DMINIUPNP_STATICLIB for new version libminiupnpc changed their required static define to the much more sane "MINIUPNP_STATICLIB". Sadly, they don't respect the old "STATICLIB" for back-compat. Define them both since the old one didn't seem to be conflicting anywhere. Also go ahead and split out the cppflags so that they can be applied only where they're needed. This will help us to build dll's from our libs without having their import/export declspecs poisoned. --- configure.ac | 3 ++- src/Makefile.am | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 700f4ab709..dbf7db3a46 100644 --- a/configure.ac +++ b/configure.ac @@ -690,7 +690,7 @@ else AC_MSG_RESULT($use_upnp_default) AC_DEFINE_UNQUOTED([USE_UPNP],[$upnp_setting],[UPnP support not compiled if undefined, otherwise value (0 or 1) determines default state]) if test x$TARGET_OS = xwindows; then - CPPFLAGS="$CPPFLAGS -DSTATICLIB" + MINIUPNPC_CPPFLAGS="-DSTATICLIB -DMINIUPNP_STATICLIB" fi else AC_MSG_RESULT(no) @@ -794,6 +794,7 @@ AC_SUBST(LEVELDB_TARGET_FLAGS) AC_SUBST(BUILD_TEST) AC_SUBST(BUILD_QT) AC_SUBST(BUILD_TEST_QT) +AC_SUBST(MINIUPNPC_CPPFLAGS) AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist]) AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh]) AC_CONFIG_FILES([qa/pull-tester/build-tests.sh],[chmod +x qa/pull-tester/build-tests.sh]) diff --git a/src/Makefile.am b/src/Makefile.am index 655bfc88c3..35fca6570f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -135,7 +135,7 @@ obj/build.h: FORCE libbitcoin_util_a-version.$(OBJEXT): obj/build.h # server: shared between bitcoind and bitcoin-qt -libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) +libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS) libbitcoin_server_a_SOURCES = \ addrman.cpp \ alert.cpp \ From f628127887ce0b3ac0322ba2c49f9b0865451989 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 26 Aug 2014 15:17:58 -0400 Subject: [PATCH 0600/1288] depends: bump openssl to 1.0.1i This is the forward-port of bba01750226745d6666d587cabe57c321fde0875. --- depends/packages/openssl.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/packages/openssl.mk b/depends/packages/openssl.mk index 1fb8edb099..b1dcc6f81f 100644 --- a/depends/packages/openssl.mk +++ b/depends/packages/openssl.mk @@ -1,8 +1,8 @@ package=openssl -$(package)_version=1.0.1h +$(package)_version=1.0.1i $(package)_download_path=https://www.openssl.org/source $(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=9d1c8a9836aa63e2c6adb684186cbd4371c9e9dcc01d6e3bb447abf2d4d3d093 +$(package)_sha256_hash=3c179f46ca77069a6a0bac70212a9b3b838b2f66129cb52d568837fc79d8fcc7 define $(package)_set_vars $(package)_config_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)" From b144a74a08a856997f48a3c83f0bd080cf9432f9 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 26 Aug 2014 15:17:43 -0400 Subject: [PATCH 0601/1288] depends: bump miniupnpc to 1.9.20140701. This is the forward-port of a9c6eef915ee264ccf4169d5e8769a6be1fa101a --- depends/packages/miniupnpc.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/packages/miniupnpc.mk b/depends/packages/miniupnpc.mk index 6dd7d93b07..30f2d3f315 100644 --- a/depends/packages/miniupnpc.mk +++ b/depends/packages/miniupnpc.mk @@ -1,8 +1,8 @@ package=miniupnpc -$(package)_version=1.9 +$(package)_version=1.9.20140701 $(package)_download_path=http://miniupnp.free.fr/files $(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=2923e453e880bb949e3d4da9f83dd3cb6f08946d35de0b864d0339cf70934464 +$(package)_sha256_hash=26f3985bad7768b8483b793448ae49414cdc4451d0ec83e7c1944367e15f9f07 define $(package)_set_vars $(package)_build_opts=CC="$($(package)_cc)" From 2e280311b87ac95a765edd3cac05096e48c73545 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 27 Aug 2014 09:20:33 +0200 Subject: [PATCH 0602/1288] Perform CVerifyDB on pcoinsdbview instead of pcoinsTip Bypassing the main coins cache allows more thorough checking with the same memory budget. This has no effect on performance because everything ends up in the child cache created by VerifyDB itself. It has bugged me ever since #4675, which effectively reduced the number of checked blocks to reduce peak memory usage. - Pass the coinsview to use as argument to VerifyDB - This also avoids that the first `pcoinsTip->Flush()` after VerifyDB writes a large slew of unchanged coin records back to the database. --- src/init.cpp | 2 +- src/main.cpp | 4 ++-- src/main.h | 2 +- src/rpcblockchain.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index e972413c4b..7b1318654f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -969,7 +969,7 @@ bool AppInit2(boost::thread_group& threadGroup) } uiInterface.InitMessage(_("Verifying blocks...")); - if (!CVerifyDB().VerifyDB(GetArg("-checklevel", 3), + if (!CVerifyDB().VerifyDB(pcoinsdbview, GetArg("-checklevel", 3), GetArg("-checkblocks", 288))) { strLoadError = _("Corrupted block database detected"); break; diff --git a/src/main.cpp b/src/main.cpp index 6567c77e93..de5730a388 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3018,7 +3018,7 @@ CVerifyDB::~CVerifyDB() uiInterface.ShowProgress("", 100); } -bool CVerifyDB::VerifyDB(int nCheckLevel, int nCheckDepth) +bool CVerifyDB::VerifyDB(CCoinsView *coinsview, int nCheckLevel, int nCheckDepth) { LOCK(cs_main); if (chainActive.Tip() == NULL || chainActive.Tip()->pprev == NULL) @@ -3031,7 +3031,7 @@ bool CVerifyDB::VerifyDB(int nCheckLevel, int nCheckDepth) nCheckDepth = chainActive.Height(); nCheckLevel = std::max(0, std::min(4, nCheckLevel)); LogPrintf("Verifying last %i blocks at level %i\n", nCheckDepth, nCheckLevel); - CCoinsViewCache coins(*pcoinsTip, true); + CCoinsViewCache coins(*coinsview, true); CBlockIndex* pindexState = chainActive.Tip(); CBlockIndex* pindexFailure = NULL; int nGoodTransactions = 0; diff --git a/src/main.h b/src/main.h index e5357cbfdd..fae8990d20 100644 --- a/src/main.h +++ b/src/main.h @@ -942,7 +942,7 @@ class CVerifyDB { public: CVerifyDB(); ~CVerifyDB(); - bool VerifyDB(int nCheckLevel, int nCheckDepth); + bool VerifyDB(CCoinsView *coinsview, int nCheckLevel, int nCheckDepth); }; /** An in-memory indexed chain of blocks. */ diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 58cab14045..b71d5a0804 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -430,7 +430,7 @@ Value verifychain(const Array& params, bool fHelp) if (params.size() > 1) nCheckDepth = params[1].get_int(); - return CVerifyDB().VerifyDB(nCheckLevel, nCheckDepth); + return CVerifyDB().VerifyDB(pcoinsTip, nCheckLevel, nCheckDepth); } Value getblockchaininfo(const Array& params, bool fHelp) From df7565d99c4baca212db6bf1d75b097a7ec58475 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 27 Aug 2014 03:40:30 -0400 Subject: [PATCH 0603/1288] depends: add sensible download timeout/retry values --- depends/Makefile | 2 ++ depends/builders/darwin.mk | 2 +- depends/builders/linux.mk | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/depends/Makefile b/depends/Makefile index 8075c66b78..f5fb5b865f 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -13,6 +13,8 @@ HOST ?= $(BUILD) PATCHES_PATH = $(BASEDIR)/patches BASEDIR = $(CURDIR) HASH_LENGTH:=11 +DOWNLOAD_CONNECT_TIMEOUT:=10 +DOWNLOAD_RETRIES:=3 host:=$(BUILD) ifneq ($(HOST),) diff --git a/depends/builders/darwin.mk b/depends/builders/darwin.mk index 6b734648f0..b366460e64 100644 --- a/depends/builders/darwin.mk +++ b/depends/builders/darwin.mk @@ -7,7 +7,7 @@ build_darwin_OTOOL: = $(shell xcrun -f otool) build_darwin_NM: = $(shell xcrun -f nm) build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) build_darwin_SHA256SUM = shasum -a 256 -build_darwin_DOWNLOAD = curl -L -o +build_darwin_DOWNLOAD = curl --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -L -o #darwin host on darwin builder. overrides darwin host preferences. darwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION) diff --git a/depends/builders/linux.mk b/depends/builders/linux.mk index d98ba597dc..98d0e9de34 100644 --- a/depends/builders/linux.mk +++ b/depends/builders/linux.mk @@ -1,2 +1,2 @@ build_linux_SHA256SUM = sha256sum -build_linux_DOWNLOAD = wget -nv -O +build_linux_DOWNLOAD = wget --timeout=$(DOWNLOAD_CONNECT_TIMEOUT) --tries=$(DOWNLOAD_RETRIES) -nv -O From 70352e11c0194fe4e71efea06220544749f4cd64 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 27 Aug 2014 18:04:09 +0200 Subject: [PATCH 0604/1288] Revert "Add a getutxos command to the p2p protocol. It allows querying of the UTXO set" This reverts commit da2ec100f3681176f60dec6dc675fc64147ade3a. --- src/main.cpp | 86 -------------------------------------------------- src/net.cpp | 2 +- src/protocol.h | 1 - src/version.h | 2 +- 4 files changed, 2 insertions(+), 89 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 6567c77e93..7dd1c2c068 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,7 +20,6 @@ #include -#include #include #include #include @@ -3519,75 +3518,6 @@ void static ProcessGetData(CNode* pfrom) } } -struct CCoin { - uint32_t nTxVer; // Don't call this nVersion, that name has a special meaning inside IMPLEMENT_SERIALIZE - uint32_t nHeight; - CTxOut out; - - IMPLEMENT_SERIALIZE( - READWRITE(nTxVer); - READWRITE(nHeight); - READWRITE(out); - ) -}; - -bool ProcessGetUTXOs(const vector &vOutPoints, bool fCheckMemPool, vector *result, vector *resultCoins) -{ - // Defined by BIP 64. - // - // Allows a peer to retrieve the CTxOut structures corresponding to the given COutPoints. - // Note that this data is not authenticated by anything: this code could just invent any - // old rubbish and hand it back, with the peer being unable to tell unless they are checking - // the outpoints against some out of band data. - // - // Also the answer could change the moment after we give it. However some apps can tolerate - // this, because they're only using the result as a hint or are willing to trust the results - // based on something else. For example we may be a "trusted node" for the peer, or it may - // be checking the results given by several nodes for consistency, it may - // run the UTXOs returned against scriptSigs of transactions obtained elsewhere (after checking - // for a standard script form), and because the height in which the UTXO was defined is provided - // a client that has a map of heights to block headers (as SPV clients do, for recent blocks) - // can request the creating block via hash. - // - // IMPORTANT: Clients expect ordering to be preserved! - if (vOutPoints.size() > MAX_INV_SZ) - return error("message getutxos size() = %u", vOutPoints.size()); - - LogPrint("net", "getutxos for %d queries %s mempool\n", vOutPoints.size(), fCheckMemPool ? "with" : "without"); - - boost::dynamic_bitset hits(vOutPoints.size()); - { - LOCK2(cs_main, mempool.cs); - CCoinsViewMemPool cvMemPool(*pcoinsTip, mempool); - CCoinsViewCache view(fCheckMemPool ? cvMemPool : *pcoinsTip); - for (size_t i = 0; i < vOutPoints.size(); i++) - { - CCoins coins; - uint256 hash = vOutPoints[i].hash; - if (view.GetCoins(hash, coins)) - { - mempool.pruneSpent(hash, coins); - if (coins.IsAvailable(vOutPoints[i].n)) - { - hits[i] = true; - // Safe to index into vout here because IsAvailable checked if it's off the end of the array, or if - // n is valid but points to an already spent output (IsNull). - CCoin coin; - coin.nTxVer = coins.nVersion; - coin.nHeight = coins.nHeight; - coin.out = coins.vout.at(vOutPoints[i].n); - assert(!coin.out.IsNull()); - resultCoins->push_back(coin); - } - } - } - } - - boost::to_block_range(hits, std::back_inserter(*result)); - return true; -} - - bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, int64_t nTimeReceived) { RandAddSeedPerfmon(); @@ -3936,22 +3866,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } - else if (strCommand == "getutxos") - { - bool fCheckMemPool; - vector vOutPoints; - vRecv >> fCheckMemPool; - vRecv >> vOutPoints; - - vector bitmap; - vector outs; - if (ProcessGetUTXOs(vOutPoints, fCheckMemPool, &bitmap, &outs)) - pfrom->PushMessage("utxos", chainActive.Height(), chainActive.Tip()->GetBlockHash(), bitmap, outs); - else - Misbehaving(pfrom->GetId(), 20); - } - - else if (strCommand == "tx") { vector vWorkQueue; diff --git a/src/net.cpp b/src/net.cpp index e2adba8517..3966706207 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -67,7 +67,7 @@ namespace { // bool fDiscover = true; bool fListen = true; -uint64_t nLocalServices = NODE_NETWORK | NODE_GETUTXOS; +uint64_t nLocalServices = NODE_NETWORK; CCriticalSection cs_mapLocalHost; map mapLocalHost; static bool vfReachable[NET_MAX] = {}; diff --git a/src/protocol.h b/src/protocol.h index 94d313e9c0..d7565584af 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -64,7 +64,6 @@ class CMessageHeader enum { NODE_NETWORK = (1 << 0), - NODE_GETUTXOS = (1 << 1), // Bits 24-31 are reserved for temporary experiments. Just pick a bit that // isn't getting used, or one not being used much, and notify the diff --git a/src/version.h b/src/version.h index 3a6c0f3719..b87aa8258c 100644 --- a/src/version.h +++ b/src/version.h @@ -27,7 +27,7 @@ extern const std::string CLIENT_DATE; // network protocol versioning // -static const int PROTOCOL_VERSION = 70003; +static const int PROTOCOL_VERSION = 70002; // initial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209; From d2d6f708e486caff1b53b6e75a577db794514604 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 28 Aug 2014 01:23:13 +0200 Subject: [PATCH 0605/1288] Fix build with DEBUG_LOCKORDER Fixes #4771 --- src/sync.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sync.cpp b/src/sync.cpp index e624a9ee84..066c1ca744 100644 --- a/src/sync.cpp +++ b/src/sync.cpp @@ -5,8 +5,11 @@ #include "sync.h" #include "util.h" +#include "utilstrencodings.h" #include +#include +#include #ifdef DEBUG_LOCKCONTENTION void PrintLockContention(const char* pszName, const char* pszFile, int nLine) From 87d9819d4dd7c11a07241b6ea5ca7bd622ce5cc8 Mon Sep 17 00:00:00 2001 From: jtimon Date: Wed, 27 Aug 2014 17:47:17 +0200 Subject: [PATCH 0606/1288] fix comments ExtractAddress() -> ExtractDestination() --- src/test/multisig_tests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/multisig_tests.cpp b/src/test/multisig_tests.cpp index 2a0466e928..02c6d095f2 100644 --- a/src/test/multisig_tests.cpp +++ b/src/test/multisig_tests.cpp @@ -164,9 +164,9 @@ BOOST_AUTO_TEST_CASE(multisig_Solver1) // Tests Solver() that returns lists of keys that are // required to satisfy a ScriptPubKey // - // Also tests IsMine() and ExtractAddress() + // Also tests IsMine() and ExtractDestination() // - // Note: ExtractAddress for the multisignature transactions + // Note: ExtractDestination for the multisignature transactions // always returns false for this release, even if you have // one key that would satisfy an (a|b) or 2-of-3 keys needed // to spend an escrow transaction. From 11a899445edf3e07317eb312d3c1d9c71c06f618 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 27 Aug 2014 22:39:01 -0400 Subject: [PATCH 0607/1288] qt/splashscreen: #include version.h Needed to build breakage reported by Arnavion on IRC: qt/splashscreen.cpp: In constructor 'SplashScreen::SplashScreen(const QPixmap&, Qt::WindowFlags, bool)': qt/splashscreen.cpp:33:98: error: 'FormatFullVersion' was not declared in this scope --- src/qt/splashscreen.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 1162e2d87f..5dd110b36a 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -4,6 +4,7 @@ #include "splashscreen.h" +#include "version.h" #include "clientversion.h" #include "init.h" #include "ui_interface.h" From 5a0823a09bbd01a16725ff21e433c285ffc2849a Mon Sep 17 00:00:00 2001 From: randy-waterhouse Date: Tue, 26 Aug 2014 21:10:52 +1200 Subject: [PATCH 0608/1288] Add travis build:passing/failing indicator. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 081af80dcf..43be738c62 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ Bitcoin Core integration/staging tree ===================================== +[![Build Status](https://travis-ci.org/bitcoin/bitcoin.svg?branch=master)](https://travis-ci.org/bitcoin/bitcoin) + https://www.bitcoin.org Copyright (c) 2009-2014 Bitcoin Core Developers From 8bdd2877c4f959b0c4b93f3d9d1f465fb4960f3f Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 28 Aug 2014 15:28:57 +0200 Subject: [PATCH 0609/1288] Fix a few "Uninitialized scalar field" warnings Fix a few warnings reported by Coverity. None of these is critical, but making sure that class fields are initialized can avoid heisenbugs. --- src/bloom.h | 2 +- src/db.cpp | 2 +- src/key.h | 2 +- src/main.h | 4 ++-- src/txmempool.cpp | 7 +++++-- src/wallet.h | 1 + 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/bloom.h b/src/bloom.h index d0caf9e9fa..54d16d7126 100644 --- a/src/bloom.h +++ b/src/bloom.h @@ -60,7 +60,7 @@ public: // It should generally always be a random value (and is largely only exposed for unit testing) // nFlags should be one of the BLOOM_UPDATE_* enums (not _MASK) CBloomFilter(unsigned int nElements, double nFPRate, unsigned int nTweak, unsigned char nFlagsIn); - CBloomFilter() : isFull(true) {} + CBloomFilter() : isFull(true), isEmpty(false), nHashFuncs(0), nTweak(0), nFlags(0) {} IMPLEMENT_SERIALIZE ( diff --git a/src/db.cpp b/src/db.cpp index 8c139843a1..23d2cc988d 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -227,10 +227,10 @@ CDB::CDB(const char *pszFile, const char* pszMode) : pdb(NULL), activeTxn(NULL) { int ret; + fReadOnly = (!strchr(pszMode, '+') && !strchr(pszMode, 'w')); if (pszFile == NULL) return; - fReadOnly = (!strchr(pszMode, '+') && !strchr(pszMode, 'w')); bool fCreate = strchr(pszMode, 'c'); unsigned int nFlags = DB_THREAD; if (fCreate) diff --git a/src/key.h b/src/key.h index 11dc65de8c..1de83cc738 100644 --- a/src/key.h +++ b/src/key.h @@ -189,7 +189,7 @@ private: public: // Construct an invalid private key. - CKey() : fValid(false) { + CKey() : fValid(false), fCompressed(false) { LockObject(vch); } diff --git a/src/main.h b/src/main.h index 0a1ff45460..3160b28c49 100644 --- a/src/main.h +++ b/src/main.h @@ -328,7 +328,7 @@ private: int nHashType; public: - CScriptCheck() {} + CScriptCheck(): ptxTo(0), nIn(0), nFlags(0), nHashType(0) {} CScriptCheck(const CCoins& txFromIn, const CTransaction& txToIn, unsigned int nInIn, unsigned int nFlagsIn, int nHashTypeIn) : scriptPubKey(txFromIn.vout[txToIn.vin[nInIn].prevout.n].scriptPubKey), ptxTo(&txToIn), nIn(nInIn), nFlags(nFlagsIn), nHashType(nHashTypeIn) { } @@ -876,7 +876,7 @@ private: unsigned char chRejectCode; bool corruptionPossible; public: - CValidationState() : mode(MODE_VALID), nDoS(0), corruptionPossible(false) {} + CValidationState() : mode(MODE_VALID), nDoS(0), chRejectCode(0), corruptionPossible(false) {} bool DoS(int level, bool ret = false, unsigned char chRejectCodeIn=0, std::string strRejectReasonIn="", bool corruptionIn=false) { diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 8af1f1c91b..238d5bab16 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -11,7 +11,8 @@ using namespace std; -CTxMemPoolEntry::CTxMemPoolEntry() +CTxMemPoolEntry::CTxMemPoolEntry(): + nFee(0), nTxSize(0), nTime(0), dPriority(0.0) { nHeight = MEMPOOL_HEIGHT; } @@ -345,7 +346,9 @@ public: }; -CTxMemPool::CTxMemPool(const CFeeRate& _minRelayFee) : minRelayFee(_minRelayFee) +CTxMemPool::CTxMemPool(const CFeeRate& _minRelayFee) : + nTransactionsUpdated(0), + minRelayFee(_minRelayFee) { // Sanity checks off by default for performance, because otherwise // accepting transactions becomes O(N^2) where N is the number diff --git a/src/wallet.h b/src/wallet.h index 052da24609..b3878adb1e 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -905,6 +905,7 @@ public: strOtherAccount.clear(); strComment.clear(); nOrderPos = -1; + nEntryNo = 0; } IMPLEMENT_SERIALIZE From 093303a8874dc3384c4f7f770d2ee2618e3f3885 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 28 Aug 2014 22:21:03 +0200 Subject: [PATCH 0610/1288] add missing header end comments - ensures a consistent usage in header files - also add a blank line after the copyright header where missing - also remove orphan new-lines at the end of some files --- src/addrman.h | 4 ++-- src/alert.h | 4 ++-- src/allocators.h | 2 +- src/bitcoin-tx.cpp | 1 - src/bloom.h | 2 +- src/chainparams.h | 2 +- src/chainparamsbase.h | 2 +- src/checkpoints.h | 2 +- src/checkqueue.h | 2 +- src/coins.h | 3 ++- src/core.h | 2 +- src/core_read.cpp | 1 - src/core_write.cpp | 1 - src/crypter.h | 2 +- src/hash.h | 2 +- src/init.h | 2 +- src/key.h | 2 +- src/keystore.h | 2 +- src/limitedmap.h | 2 +- src/main.h | 2 +- src/mruset.h | 2 +- src/net.h | 2 +- src/netbase.h | 2 +- src/noui.h | 2 +- src/pow.h | 3 +-- src/rpcclient.h | 4 ++-- src/rpcprotocol.h | 4 ++-- src/rpcserver.h | 4 ++-- src/script.h | 2 +- src/serialize.h | 2 +- src/sync.h | 2 +- src/threadsafety.h | 1 + src/timedata.h | 2 +- src/txmempool.h | 3 ++- src/ui_interface.h | 2 +- src/uint256.h | 2 +- src/util.h | 2 +- src/utiltime.h | 2 +- src/version.h | 3 ++- src/wallet.h | 3 ++- src/walletdb.h | 1 + 41 files changed, 47 insertions(+), 45 deletions(-) diff --git a/src/addrman.h b/src/addrman.h index 052d364655..8f6ab60662 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -3,7 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef _BITCOIN_ADDRMAN -#define _BITCOIN_ADDRMAN 1 +#define _BITCOIN_ADDRMAN #include "netbase.h" #include "protocol.h" @@ -503,4 +503,4 @@ public: } }; -#endif +#endif // _BITCOIN_ADDRMAN diff --git a/src/alert.h b/src/alert.h index b9d850b565..d8254ba2cb 100644 --- a/src/alert.h +++ b/src/alert.h @@ -4,7 +4,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef _BITCOINALERT_H_ -#define _BITCOINALERT_H_ 1 +#define _BITCOINALERT_H_ #include "serialize.h" #include "sync.h" @@ -105,4 +105,4 @@ public: static CAlert getAlertByHash(const uint256 &hash); }; -#endif +#endif // _BITCOINALERT_H_ diff --git a/src/allocators.h b/src/allocators.h index be0be7ab96..0b1c9fea68 100644 --- a/src/allocators.h +++ b/src/allocators.h @@ -252,4 +252,4 @@ struct zero_after_free_allocator : public std::allocator // This is exactly like std::string, but with a custom allocator. typedef std::basic_string, secure_allocator > SecureString; -#endif +#endif // BITCOIN_ALLOCATORS_H diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 75f0fb69f2..5f547bba83 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -619,4 +619,3 @@ int main(int argc, char* argv[]) } return ret; } - diff --git a/src/bloom.h b/src/bloom.h index d0caf9e9fa..1c9c103253 100644 --- a/src/bloom.h +++ b/src/bloom.h @@ -91,4 +91,4 @@ public: void UpdateEmptyFull(); }; -#endif /* BITCOIN_BLOOM_H */ +#endif // BITCOIN_BLOOM_H diff --git a/src/chainparams.h b/src/chainparams.h index 446256ba82..95b972bd7f 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -120,4 +120,4 @@ void SelectParams(CBaseChainParams::Network network); */ bool SelectParamsFromCommandLine(); -#endif +#endif // BITCOIN_CHAIN_PARAMS_H diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h index 4398f69548..2d3a07b44a 100644 --- a/src/chainparamsbase.h +++ b/src/chainparamsbase.h @@ -55,4 +55,4 @@ bool SelectBaseParamsFromCommandLine(); */ bool AreBaseParamsConfigured(); -#endif +#endif // BITCOIN_CHAIN_PARAMS_BASE_H diff --git a/src/checkpoints.h b/src/checkpoints.h index 2cf8d41b9d..52cdc35559 100644 --- a/src/checkpoints.h +++ b/src/checkpoints.h @@ -30,4 +30,4 @@ namespace Checkpoints { } //namespace Checkpoints -#endif +#endif // BITCOIN_CHECKPOINT_H diff --git a/src/checkqueue.h b/src/checkqueue.h index ef7b4ca422..c2c7d8ca24 100644 --- a/src/checkqueue.h +++ b/src/checkqueue.h @@ -191,4 +191,4 @@ public: } }; -#endif +#endif // CHECKQUEUE_H diff --git a/src/coins.h b/src/coins.h index 08913531d8..d338e3172e 100644 --- a/src/coins.h +++ b/src/coins.h @@ -2,6 +2,7 @@ // Copyright (c) 2009-2013 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. + #ifndef BITCOIN_COINS_H #define BITCOIN_COINS_H @@ -379,4 +380,4 @@ private: CCoinsMap::const_iterator FetchCoins(const uint256 &txid) const; }; -#endif +#endif // BITCOIN_COINS_H diff --git a/src/core.h b/src/core.h index e3ceac97aa..42286a48dd 100644 --- a/src/core.h +++ b/src/core.h @@ -533,4 +533,4 @@ struct CBlockLocator } }; -#endif +#endif // BITCOIN_CORE_H diff --git a/src/core_read.cpp b/src/core_read.cpp index 593eb2d035..57f1397f18 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -126,4 +126,3 @@ vector ParseHexUV(const UniValue& v, const string& strName) throw runtime_error(strName+" must be hexadecimal string (not '"+strHex+"')"); return ParseHex(strHex); } - diff --git a/src/core_write.cpp b/src/core_write.cpp index b395b5c090..e63b64d692 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -89,4 +89,3 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry) if (hashBlock != 0) entry.pushKV("blockhash", hashBlock.GetHex()); } - diff --git a/src/crypter.h b/src/crypter.h index f16fcef9c7..9b592dbcdc 100644 --- a/src/crypter.h +++ b/src/crypter.h @@ -192,4 +192,4 @@ public: boost::signals2::signal NotifyStatusChanged; }; -#endif +#endif // __CRYPTER_H__ diff --git a/src/hash.h b/src/hash.h index f2a0ebfe1f..98a2d1fb11 100644 --- a/src/hash.h +++ b/src/hash.h @@ -159,4 +159,4 @@ uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=PROTOCOL unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector& vDataToHash); -#endif +#endif // BITCOIN_HASH_H diff --git a/src/init.h b/src/init.h index 626525c9ad..cf1d1e7e39 100644 --- a/src/init.h +++ b/src/init.h @@ -33,4 +33,4 @@ std::string HelpMessage(HelpMessageMode mode); /** Returns licensing information (for -version) */ std::string LicenseInfo(); -#endif +#endif // BITCOIN_INIT_H diff --git a/src/key.h b/src/key.h index 11dc65de8c..552f12ad23 100644 --- a/src/key.h +++ b/src/key.h @@ -309,4 +309,4 @@ struct CExtKey { /** Check that required EC support is available at runtime */ bool ECC_InitSanityCheck(void); -#endif +#endif // BITCOIN_KEY_H diff --git a/src/keystore.h b/src/keystore.h index 7aaf197cd7..3b49e282d9 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -105,4 +105,4 @@ public: typedef std::vector > CKeyingMaterial; typedef std::map > > CryptedKeyMap; -#endif +#endif // BITCOIN_KEYSTORE_H diff --git a/src/limitedmap.h b/src/limitedmap.h index 1623a372b3..58593688af 100644 --- a/src/limitedmap.h +++ b/src/limitedmap.h @@ -98,4 +98,4 @@ public: } }; -#endif +#endif // BITCOIN_LIMITEDMAP_H diff --git a/src/main.h b/src/main.h index 0a1ff45460..4c98f78cf1 100644 --- a/src/main.h +++ b/src/main.h @@ -1056,4 +1056,4 @@ protected: friend void ::UnregisterAllWallets(); }; -#endif +#endif // BITCOIN_MAIN_H diff --git a/src/mruset.h b/src/mruset.h index c1c08b0288..b9f325d874 100644 --- a/src/mruset.h +++ b/src/mruset.h @@ -64,4 +64,4 @@ public: } }; -#endif +#endif // BITCOIN_MRUSET_H diff --git a/src/net.h b/src/net.h index bfad32b2c1..e2700c0975 100644 --- a/src/net.h +++ b/src/net.h @@ -615,4 +615,4 @@ public: bool Read(CAddrMan& addr); }; -#endif +#endif // BITCOIN_NET_H diff --git a/src/netbase.h b/src/netbase.h index 2df3c4474d..d4d266e0a8 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -182,4 +182,4 @@ bool CloseSocket(SOCKET& hSocket); /** Disable or enable blocking-mode for a socket */ bool SetSocketNonBlocking(SOCKET& hSocket, bool fNonBlocking); -#endif +#endif // BITCOIN_NETBASE_H diff --git a/src/noui.h b/src/noui.h index 755d987fdd..dbd4320fa7 100644 --- a/src/noui.h +++ b/src/noui.h @@ -7,4 +7,4 @@ extern void noui_connect(); -#endif +#endif // BITCOIN_NOUI_H diff --git a/src/pow.h b/src/pow.h index f350d763f4..2a0d9b24bb 100644 --- a/src/pow.h +++ b/src/pow.h @@ -1,4 +1,3 @@ - // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying @@ -24,4 +23,4 @@ void UpdateTime(CBlockHeader* block, const CBlockIndex* pindexPrev); uint256 GetProofIncrement(unsigned int nBits); -#endif +#endif // BITCOIN_POW_H diff --git a/src/rpcclient.h b/src/rpcclient.h index 840890e34b..1233ea3875 100644 --- a/src/rpcclient.h +++ b/src/rpcclient.h @@ -4,7 +4,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef _BITCOINRPC_CLIENT_H_ -#define _BITCOINRPC_CLIENT_H_ 1 +#define _BITCOINRPC_CLIENT_H_ #include "json/json_spirit_reader_template.h" #include "json/json_spirit_utils.h" @@ -12,4 +12,4 @@ json_spirit::Array RPCConvertValues(const std::string &strMethod, const std::vector &strParams); -#endif +#endif // _BITCOINRPC_CLIENT_H_ diff --git a/src/rpcprotocol.h b/src/rpcprotocol.h index 8f05c08482..a9adb58803 100644 --- a/src/rpcprotocol.h +++ b/src/rpcprotocol.h @@ -4,7 +4,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef _BITCOINRPC_PROTOCOL_H_ -#define _BITCOINRPC_PROTOCOL_H_ 1 +#define _BITCOINRPC_PROTOCOL_H_ #include #include @@ -159,4 +159,4 @@ json_spirit::Object JSONRPCReplyObj(const json_spirit::Value& result, const json std::string JSONRPCReply(const json_spirit::Value& result, const json_spirit::Value& error, const json_spirit::Value& id); json_spirit::Object JSONRPCError(int code, const std::string& message); -#endif +#endif // _BITCOINRPC_PROTOCOL_H_ diff --git a/src/rpcserver.h b/src/rpcserver.h index b850d15d4e..820c1bc081 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -4,7 +4,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef _BITCOINRPC_SERVER_H_ -#define _BITCOINRPC_SERVER_H_ 1 +#define _BITCOINRPC_SERVER_H_ #include "uint256.h" #include "rpcprotocol.h" @@ -209,4 +209,4 @@ extern json_spirit::Value gettxout(const json_spirit::Array& params, bool fHelp) extern json_spirit::Value verifychain(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getchaintips(const json_spirit::Array& params, bool fHelp); -#endif +#endif // _BITCOINRPC_SERVER_H_ diff --git a/src/script.h b/src/script.h index 462e3f2302..8e6aedcc63 100644 --- a/src/script.h +++ b/src/script.h @@ -833,4 +833,4 @@ bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const C // combine them intelligently and return the result. CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2); -#endif +#endif // H_BITCOIN_SCRIPT diff --git a/src/serialize.h b/src/serialize.h index 17cb724bee..d486181d78 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -1405,4 +1405,4 @@ public: } }; -#endif +#endif // BITCOIN_SERIALIZE_H diff --git a/src/sync.h b/src/sync.h index cd319e0171..4b81b4bd32 100644 --- a/src/sync.h +++ b/src/sync.h @@ -260,5 +260,5 @@ public: return fHaveGrant; } }; -#endif +#endif // BITCOIN_SYNC_H diff --git a/src/threadsafety.h b/src/threadsafety.h index 176060ac65..9ee39372e1 100644 --- a/src/threadsafety.h +++ b/src/threadsafety.h @@ -51,4 +51,5 @@ #define SHARED_LOCKS_REQUIRED(...) #define NO_THREAD_SAFETY_ANALYSIS #endif // __GNUC__ + #endif // BITCOIN_THREADSAFETY_H diff --git a/src/timedata.h b/src/timedata.h index d0c84b3183..9cc47bec13 100644 --- a/src/timedata.h +++ b/src/timedata.h @@ -73,4 +73,4 @@ int64_t GetTimeOffset(); int64_t GetAdjustedTime(); void AddTimeData(const CNetAddr& ip, int64_t nTime); -#endif +#endif // BITCOIN_TIMEDATA_H diff --git a/src/txmempool.h b/src/txmempool.h index d95c4d970b..360364d8b0 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -2,6 +2,7 @@ // Copyright (c) 2009-2013 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. + #ifndef BITCOIN_TXMEMPOOL_H #define BITCOIN_TXMEMPOOL_H @@ -147,4 +148,4 @@ public: bool HaveCoins(const uint256 &txid) const; }; -#endif /* BITCOIN_TXMEMPOOL_H */ +#endif // BITCOIN_TXMEMPOOL_H diff --git a/src/ui_interface.h b/src/ui_interface.h index b3df2b5a85..53005f9844 100644 --- a/src/ui_interface.h +++ b/src/ui_interface.h @@ -109,4 +109,4 @@ inline std::string _(const char* psz) return rv ? (*rv) : psz; } -#endif +#endif // BITCOIN_UI_INTERFACE_H diff --git a/src/uint256.h b/src/uint256.h index ad0a56f447..d1a822af0d 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -326,4 +326,4 @@ public: uint64_t GetHash(const uint256& salt) const; }; -#endif +#endif // BITCOIN_UINT256_H diff --git a/src/util.h b/src/util.h index 30f7c15c89..6e1f439ff7 100644 --- a/src/util.h +++ b/src/util.h @@ -222,4 +222,4 @@ template void TraceThread(const char* name, Callable func) } } -#endif +#endif // BITCOIN_UTIL_H diff --git a/src/utiltime.h b/src/utiltime.h index 500ae4dab9..6f82e5a836 100644 --- a/src/utiltime.h +++ b/src/utiltime.h @@ -17,4 +17,4 @@ void MilliSleep(int64_t n); std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime); -#endif +#endif // BITCOIN_UTILTIME_H diff --git a/src/version.h b/src/version.h index b87aa8258c..75cbec39b7 100644 --- a/src/version.h +++ b/src/version.h @@ -1,6 +1,7 @@ // Copyright (c) 2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. + #ifndef BITCOIN_VERSION_H #define BITCOIN_VERSION_H @@ -52,4 +53,4 @@ static const int MEMPOOL_GD_VERSION = 60002; std::string FormatFullVersion(); std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector& comments); -#endif +#endif // BITCOIN_VERSION_H diff --git a/src/wallet.h b/src/wallet.h index 052da24609..e542317be8 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -2,6 +2,7 @@ // Copyright (c) 2009-2013 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. + #ifndef BITCOIN_WALLET_H #define BITCOIN_WALLET_H @@ -955,4 +956,4 @@ private: std::vector _ssExtra; }; -#endif +#endif // BITCOIN_WALLET_H diff --git a/src/walletdb.h b/src/walletdb.h index 58b4571b16..24096e13ea 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -2,6 +2,7 @@ // Copyright (c) 2009-2013 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. + #ifndef BITCOIN_WALLETDB_H #define BITCOIN_WALLETDB_H From 4d04492bf217bb5466135f61f89eac835caac321 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 28 Aug 2014 22:26:56 +0200 Subject: [PATCH 0611/1288] add missing copyright headers --- src/clientversion.h | 4 ++++ src/utilmoneystr.cpp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/clientversion.h b/src/clientversion.h index 6c718a9f79..5634516ca4 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -1,3 +1,7 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #ifndef CLIENTVERSION_H #define CLIENTVERSION_H diff --git a/src/utilmoneystr.cpp b/src/utilmoneystr.cpp index 1bd48d8d4c..c169355f05 100644 --- a/src/utilmoneystr.cpp +++ b/src/utilmoneystr.cpp @@ -1,3 +1,8 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "utilmoneystr.h" #include "core.h" From 187115c01d594bda3a4825ca45404ca27585b7f3 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 28 Aug 2014 22:56:53 +0200 Subject: [PATCH 0612/1288] cleanup include of assert.h --- src/chainparams.cpp | 3 ++- src/chainparamsbase.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index f32d4ed235..ce99f268f3 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -5,10 +5,11 @@ #include "chainparams.h" -#include "assert.h" #include "random.h" #include "util.h" +#include + #include using namespace std; diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index 720e24c4a8..d1e19871c3 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -5,9 +5,10 @@ #include "chainparamsbase.h" -#include "assert.h" #include "util.h" +#include + #include using namespace boost::assign; From 21f15164681ae57c3f0b4fa6e6771b4f4fb00a1a Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sat, 9 Aug 2014 15:26:40 +0200 Subject: [PATCH 0613/1288] [Qt] add all used colors in txtablemodel to guiconstants - add colors used in TX status decoration --- src/qt/guiconstants.h | 6 ++++++ src/qt/transactiontablemodel.cpp | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/qt/guiconstants.h b/src/qt/guiconstants.h index 5ae4bc833d..4c8a67b663 100644 --- a/src/qt/guiconstants.h +++ b/src/qt/guiconstants.h @@ -23,6 +23,12 @@ static const int STATUSBAR_ICONSIZE = 16; #define COLOR_NEGATIVE QColor(255, 0, 0) /* Transaction list -- bare address (without label) */ #define COLOR_BAREADDRESS QColor(140, 140, 140) +/* Transaction list -- TX status decoration - open until date */ +#define COLOR_TX_STATUS_OPENUNTILDATE QColor(64, 64, 255) +/* Transaction list -- TX status decoration - offline */ +#define COLOR_TX_STATUS_OFFLINE QColor(192, 192, 192) +/* Transaction list -- TX status decoration - default color */ +#define COLOR_BLACK QColor(0, 0, 0) /* Tooltips longer than this (in characters) are converted into rich text, so that they can be word-wrapped. diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 1a1f726bf8..98812b6f80 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -450,9 +450,9 @@ QVariant TransactionTableModel::txStatusDecoration(const TransactionRecord *wtx) { case TransactionStatus::OpenUntilBlock: case TransactionStatus::OpenUntilDate: - return QColor(64,64,255); + return COLOR_TX_STATUS_OPENUNTILDATE; case TransactionStatus::Offline: - return QColor(192,192,192); + return COLOR_TX_STATUS_OFFLINE; case TransactionStatus::Unconfirmed: return QIcon(":/icons/transaction_0"); case TransactionStatus::Confirming: @@ -476,8 +476,9 @@ QVariant TransactionTableModel::txStatusDecoration(const TransactionRecord *wtx) case TransactionStatus::MaturesWarning: case TransactionStatus::NotAccepted: return QIcon(":/icons/transaction_0"); + default: + return COLOR_BLACK; } - return QColor(0,0,0); } QVariant TransactionTableModel::txWatchonlyDecoration(const TransactionRecord *wtx) const From bbad683224c77743a9fef5cc2fc64cc43fbec192 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sat, 9 Aug 2014 15:29:55 +0200 Subject: [PATCH 0614/1288] [Qt] simplify return code and return values in txtablemodel - also move an added space in a string where it belongs --- src/qt/transactiontablemodel.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 98812b6f80..5f420c0c6c 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -209,10 +209,7 @@ public: } return rec; } - else - { - return 0; - } + return 0; } QString describe(TransactionRecord *rec, int unit) @@ -225,7 +222,7 @@ public: return TransactionDesc::toHTML(wallet, mi->second, rec, unit); } } - return QString(""); + return QString(); } }; @@ -330,10 +327,7 @@ QString TransactionTableModel::formatTxDate(const TransactionRecord *wtx) const { return GUIUtil::dateTimeStr(wtx->time); } - else - { - return QString(); - } + return QString(); } /* Look up address in address book, if found return label (address) @@ -345,11 +339,11 @@ QString TransactionTableModel::lookupAddress(const std::string &address, bool to QString description; if(!label.isEmpty()) { - description += label + QString(" "); + description += label; } if(label.isEmpty() || tooltip) { - description += QString("(") + QString::fromStdString(address) + QString(")"); + description += QString(" (") + QString::fromStdString(address) + QString(")"); } return description; } @@ -389,7 +383,6 @@ QVariant TransactionTableModel::txAddressDecoration(const TransactionRecord *wtx default: return QIcon(":/icons/tx_inout"); } - return QVariant(); } QString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const @@ -641,10 +634,7 @@ QModelIndex TransactionTableModel::index(int row, int column, const QModelIndex { return createIndex(row, column, priv->index(row)); } - else - { - return QModelIndex(); - } + return QModelIndex(); } void TransactionTableModel::updateDisplayUnit() From fbe0fcae7641889b778ecb6bd7067eff5b1b2c4e Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 28 Aug 2014 23:20:46 +0200 Subject: [PATCH 0615/1288] [Qt] minor watch-only changes - use watch-only, not watchonly - add back a tooltip hint when hovering addresses and attach "(watch-only)" at the end --- src/qt/overviewpage.cpp | 2 +- src/qt/transactiontablemodel.cpp | 14 ++++++++++---- src/qt/transactionview.cpp | 2 +- src/qt/walletmodel.h | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 15501b8a8a..90762bea5d 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -172,7 +172,7 @@ void OverviewPage::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 // for symmetry reasons also show immature label when the watch-only one is shown ui->labelImmature->setVisible(showImmature || showWatchOnlyImmature); ui->labelImmatureText->setVisible(showImmature || showWatchOnlyImmature); - ui->labelWatchImmature->setVisible(showWatchOnlyImmature); // show watch-only immature balance + ui->labelWatchImmature->setVisible(showWatchOnlyImmature); // show watch-only immature balance } // show/hide watch-only labels diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 1a1f726bf8..734c7afc4e 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -394,19 +394,25 @@ QVariant TransactionTableModel::txAddressDecoration(const TransactionRecord *wtx QString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const { + QString watchAddress; + if (tooltip) { + // Mark transactions involving watch-only addresses by adding " (watch-only)" + watchAddress = wtx->involvesWatchAddress ? QString(" (") + tr("watch-only") + QString(")") : ""; + } + switch(wtx->type) { case TransactionRecord::RecvFromOther: - return QString::fromStdString(wtx->address); + return QString::fromStdString(wtx->address) + watchAddress; case TransactionRecord::RecvWithAddress: case TransactionRecord::SendToAddress: case TransactionRecord::Generated: - return lookupAddress(wtx->address, tooltip); + return lookupAddress(wtx->address, tooltip) + watchAddress; case TransactionRecord::SendToOther: - return QString::fromStdString(wtx->address); + return QString::fromStdString(wtx->address) + watchAddress; case TransactionRecord::SendToSelf: default: - return tr("(n/a)"); + return tr("(n/a)") + watchAddress; } } diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 2d34d58129..a7ba100cd2 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -331,7 +331,7 @@ void TransactionView::exportClicked() writer.setModel(transactionProxyModel); writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole); if (model && model->haveWatchOnly()) - writer.addColumn(tr("Watchonly"), TransactionTableModel::Watchonly); + writer.addColumn(tr("Watch-only"), TransactionTableModel::Watchonly); writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole); writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole); writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole); diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index b3a401e4cc..9102faf04e 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -256,7 +256,7 @@ public slots: void updateTransaction(const QString &hash, int status); /* New, updated or removed address book entry */ void updateAddressBook(const QString &address, const QString &label, bool isMine, const QString &purpose, int status); - /* Watchonly added */ + /* Watch-only added */ void updateWatchOnlyFlag(bool fHaveWatchonly); /* Current, immature or unconfirmed balance might have changed - emit 'balanceChanged' if so */ void pollBalanceChanged(); From 539abc4729ea16039d148cfa3b771929f7d37584 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 29 Aug 2014 13:02:23 +0200 Subject: [PATCH 0616/1288] build: Remove message about Ubuntu 13.10 when no boost sleep implementation found It's only confusing people into thinking that they should mess with boost versions, which should not be necessary to get bitcoind to work. If there is a bug in the build system with autodetecting boost it needs to be solved not worked around. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 700f4ab709..5a2d7e8e41 100644 --- a/configure.ac +++ b/configure.ac @@ -577,7 +577,7 @@ CPPFLAGS="$TEMP_CPPFLAGS" fi if test x$boost_sleep != xyes; then - AC_MSG_ERROR(No working boost sleep implementation found. If on ubuntu 13.10 with libboost1.54-all-dev remove libboost.1.54-all-dev and use libboost1.53-all-dev) + AC_MSG_ERROR(No working boost sleep implementation found.) fi AC_ARG_WITH([utils], From 57153d4e1ac6e2cc9fc3f2fcd6d786e9813d824f Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 28 Aug 2014 17:14:22 +0200 Subject: [PATCH 0617/1288] rpc: Compute number of confirmations of a block from block height Currently this uses a CMerkleTx, but that makes no sense as we have the CBlockIndex available. As noted by @jgarzik. --- src/rpcblockchain.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 58cab14045..8a4b25cc54 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -54,9 +54,11 @@ Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex) { Object result; result.push_back(Pair("hash", block.GetHash().GetHex())); - CMerkleTx txGen(block.vtx[0]); - txGen.SetMerkleBranch(&block); - result.push_back(Pair("confirmations", (int)txGen.GetDepthInMainChain())); + int confirmations = -1; + // Only report confirmations if the block is on the main chain + if (chainActive.Contains(blockindex)) + confirmations = chainActive.Height() - blockindex->nHeight + 1; + result.push_back(Pair("confirmations", confirmations)); result.push_back(Pair("size", (int)::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION))); result.push_back(Pair("height", blockindex->nHeight)); result.push_back(Pair("version", block.nVersion)); @@ -242,7 +244,7 @@ Value getblock(const Array& params, bool fHelp) "\nResult (for verbose = true):\n" "{\n" " \"hash\" : \"hash\", (string) the block hash (same as provided)\n" - " \"confirmations\" : n, (numeric) The number of confirmations\n" + " \"confirmations\" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain\n" " \"size\" : n, (numeric) The block size\n" " \"height\" : n, (numeric) The block height or index\n" " \"version\" : n, (numeric) The block version\n" From 0101483f46396a7f1d19a9d29a1da15639ce4233 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 28 Aug 2014 17:15:21 +0200 Subject: [PATCH 0618/1288] Move CMerkleTx to wallet.cpp/h It is only used by the wallet so it has no place in main. --- src/main.cpp | 99 -------------------------------------------------- src/main.h | 60 ------------------------------ src/wallet.cpp | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/wallet.h | 57 +++++++++++++++++++++++++++++ 4 files changed, 156 insertions(+), 159 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ddc37ea534..6f3a5aae89 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -732,53 +732,6 @@ unsigned int GetP2SHSigOpCount(const CTransaction& tx, const CCoinsViewCache& in return nSigOps; } -int CMerkleTx::SetMerkleBranch(const CBlock* pblock) -{ - AssertLockHeld(cs_main); - CBlock blockTmp; - - if (pblock == NULL) { - CCoins coins; - if (pcoinsTip->GetCoins(GetHash(), coins)) { - CBlockIndex *pindex = chainActive[coins.nHeight]; - if (pindex) { - if (!ReadBlockFromDisk(blockTmp, pindex)) - return 0; - pblock = &blockTmp; - } - } - } - - if (pblock) { - // Update the tx's hashBlock - hashBlock = pblock->GetHash(); - - // Locate the transaction - for (nIndex = 0; nIndex < (int)pblock->vtx.size(); nIndex++) - if (pblock->vtx[nIndex] == *(CTransaction*)this) - break; - if (nIndex == (int)pblock->vtx.size()) - { - vMerkleBranch.clear(); - nIndex = -1; - LogPrintf("ERROR: SetMerkleBranch() : couldn't find tx in block\n"); - return 0; - } - - // Fill in merkle branch - vMerkleBranch = pblock->GetMerkleBranch(nIndex); - } - - // Is the tx in a block that's in the main chain - map::iterator mi = mapBlockIndex.find(hashBlock); - if (mi == mapBlockIndex.end()) - return 0; - CBlockIndex* pindex = (*mi).second; - if (!pindex || !chainActive.Contains(pindex)) - return 0; - - return chainActive.Height() - pindex->nHeight + 1; -} @@ -1028,58 +981,6 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa return true; } - -int CMerkleTx::GetDepthInMainChainINTERNAL(CBlockIndex* &pindexRet) const -{ - if (hashBlock == 0 || nIndex == -1) - return 0; - AssertLockHeld(cs_main); - - // Find the block it claims to be in - map::iterator mi = mapBlockIndex.find(hashBlock); - if (mi == mapBlockIndex.end()) - return 0; - CBlockIndex* pindex = (*mi).second; - if (!pindex || !chainActive.Contains(pindex)) - return 0; - - // Make sure the merkle branch connects to this block - if (!fMerkleVerified) - { - if (CBlock::CheckMerkleBranch(GetHash(), vMerkleBranch, nIndex) != pindex->hashMerkleRoot) - return 0; - fMerkleVerified = true; - } - - pindexRet = pindex; - return chainActive.Height() - pindex->nHeight + 1; -} - -int CMerkleTx::GetDepthInMainChain(CBlockIndex* &pindexRet) const -{ - AssertLockHeld(cs_main); - int nResult = GetDepthInMainChainINTERNAL(pindexRet); - if (nResult == 0 && !mempool.exists(GetHash())) - return -1; // Not in chain, not in mempool - - return nResult; -} - -int CMerkleTx::GetBlocksToMaturity() const -{ - if (!IsCoinBase()) - return 0; - return max(0, (COINBASE_MATURITY+1) - GetDepthInMainChain()); -} - - -bool CMerkleTx::AcceptToMemoryPool(bool fLimitFree, bool fRejectInsaneFee) -{ - CValidationState state; - return ::AcceptToMemoryPool(mempool, state, *this, fLimitFree, NULL, fRejectInsaneFee); -} - - // Return transaction in tx, and if it was found inside a block, its hash is placed in hashBlock bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock, bool fAllowSlow) { diff --git a/src/main.h b/src/main.h index 3160b28c49..9fe15d3aa3 100644 --- a/src/main.h +++ b/src/main.h @@ -344,66 +344,6 @@ public: } }; -/** A transaction with a merkle branch linking it to the block chain. */ -class CMerkleTx : public CTransaction -{ -private: - int GetDepthInMainChainINTERNAL(CBlockIndex* &pindexRet) const; - -public: - uint256 hashBlock; - std::vector vMerkleBranch; - int nIndex; - - // memory only - mutable bool fMerkleVerified; - - - CMerkleTx() - { - Init(); - } - - CMerkleTx(const CTransaction& txIn) : CTransaction(txIn) - { - Init(); - } - - void Init() - { - hashBlock = 0; - nIndex = -1; - fMerkleVerified = false; - } - - - IMPLEMENT_SERIALIZE - ( - nSerSize += SerReadWrite(s, *(CTransaction*)this, nType, nVersion, ser_action); - nVersion = this->nVersion; - READWRITE(hashBlock); - READWRITE(vMerkleBranch); - READWRITE(nIndex); - ) - - - int SetMerkleBranch(const CBlock* pblock=NULL); - - // Return depth of transaction in blockchain: - // -1 : not in blockchain, and not in memory pool (conflicted transaction) - // 0 : in memory pool, waiting to be included in a block - // >=1 : this many blocks deep in the main chain - int GetDepthInMainChain(CBlockIndex* &pindexRet) const; - int GetDepthInMainChain() const { CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet); } - bool IsInMainChain() const { CBlockIndex *pindexRet; return GetDepthInMainChainINTERNAL(pindexRet) > 0; } - int GetBlocksToMaturity() const; - bool AcceptToMemoryPool(bool fLimitFree=true, bool fRejectInsaneFee=true); -}; - - - - - /** Data structure that represents a partial merkle tree. * * It respresents a subset of the txid's of a known block, in a way that diff --git a/src/wallet.cpp b/src/wallet.cpp index 786b2f6a92..18a5b3971c 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -2194,3 +2194,102 @@ CWalletKey::CWalletKey(int64_t nExpires) nTimeCreated = (nExpires ? GetTime() : 0); nTimeExpires = nExpires; } + +int CMerkleTx::SetMerkleBranch(const CBlock* pblock) +{ + AssertLockHeld(cs_main); + CBlock blockTmp; + + if (pblock == NULL) { + CCoins coins; + if (pcoinsTip->GetCoins(GetHash(), coins)) { + CBlockIndex *pindex = chainActive[coins.nHeight]; + if (pindex) { + if (!ReadBlockFromDisk(blockTmp, pindex)) + return 0; + pblock = &blockTmp; + } + } + } + + if (pblock) { + // Update the tx's hashBlock + hashBlock = pblock->GetHash(); + + // Locate the transaction + for (nIndex = 0; nIndex < (int)pblock->vtx.size(); nIndex++) + if (pblock->vtx[nIndex] == *(CTransaction*)this) + break; + if (nIndex == (int)pblock->vtx.size()) + { + vMerkleBranch.clear(); + nIndex = -1; + LogPrintf("ERROR: SetMerkleBranch() : couldn't find tx in block\n"); + return 0; + } + + // Fill in merkle branch + vMerkleBranch = pblock->GetMerkleBranch(nIndex); + } + + // Is the tx in a block that's in the main chain + map::iterator mi = mapBlockIndex.find(hashBlock); + if (mi == mapBlockIndex.end()) + return 0; + CBlockIndex* pindex = (*mi).second; + if (!pindex || !chainActive.Contains(pindex)) + return 0; + + return chainActive.Height() - pindex->nHeight + 1; +} + +int CMerkleTx::GetDepthInMainChainINTERNAL(CBlockIndex* &pindexRet) const +{ + if (hashBlock == 0 || nIndex == -1) + return 0; + AssertLockHeld(cs_main); + + // Find the block it claims to be in + map::iterator mi = mapBlockIndex.find(hashBlock); + if (mi == mapBlockIndex.end()) + return 0; + CBlockIndex* pindex = (*mi).second; + if (!pindex || !chainActive.Contains(pindex)) + return 0; + + // Make sure the merkle branch connects to this block + if (!fMerkleVerified) + { + if (CBlock::CheckMerkleBranch(GetHash(), vMerkleBranch, nIndex) != pindex->hashMerkleRoot) + return 0; + fMerkleVerified = true; + } + + pindexRet = pindex; + return chainActive.Height() - pindex->nHeight + 1; +} + +int CMerkleTx::GetDepthInMainChain(CBlockIndex* &pindexRet) const +{ + AssertLockHeld(cs_main); + int nResult = GetDepthInMainChainINTERNAL(pindexRet); + if (nResult == 0 && !mempool.exists(GetHash())) + return -1; // Not in chain, not in mempool + + return nResult; +} + +int CMerkleTx::GetBlocksToMaturity() const +{ + if (!IsCoinBase()) + return 0; + return max(0, (COINBASE_MATURITY+1) - GetDepthInMainChain()); +} + + +bool CMerkleTx::AcceptToMemoryPool(bool fLimitFree, bool fRejectInsaneFee) +{ + CValidationState state; + return ::AcceptToMemoryPool(mempool, state, *this, fLimitFree, NULL, fRejectInsaneFee); +} + diff --git a/src/wallet.h b/src/wallet.h index b3878adb1e..544b4f5bfb 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -457,6 +457,63 @@ struct COutputEntry int vout; }; +/** A transaction with a merkle branch linking it to the block chain. */ +class CMerkleTx : public CTransaction +{ +private: + int GetDepthInMainChainINTERNAL(CBlockIndex* &pindexRet) const; + +public: + uint256 hashBlock; + std::vector vMerkleBranch; + int nIndex; + + // memory only + mutable bool fMerkleVerified; + + + CMerkleTx() + { + Init(); + } + + CMerkleTx(const CTransaction& txIn) : CTransaction(txIn) + { + Init(); + } + + void Init() + { + hashBlock = 0; + nIndex = -1; + fMerkleVerified = false; + } + + + IMPLEMENT_SERIALIZE + ( + nSerSize += SerReadWrite(s, *(CTransaction*)this, nType, nVersion, ser_action); + nVersion = this->nVersion; + READWRITE(hashBlock); + READWRITE(vMerkleBranch); + READWRITE(nIndex); + ) + + + int SetMerkleBranch(const CBlock* pblock=NULL); + + // Return depth of transaction in blockchain: + // -1 : not in blockchain, and not in memory pool (conflicted transaction) + // 0 : in memory pool, waiting to be included in a block + // >=1 : this many blocks deep in the main chain + int GetDepthInMainChain(CBlockIndex* &pindexRet) const; + int GetDepthInMainChain() const { CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet); } + bool IsInMainChain() const { CBlockIndex *pindexRet; return GetDepthInMainChainINTERNAL(pindexRet) > 0; } + int GetBlocksToMaturity() const; + bool AcceptToMemoryPool(bool fLimitFree=true, bool fRejectInsaneFee=true); +}; + + /** A transaction with a bunch of additional info that only the owner cares about. * It includes any unrecorded transactions needed to link it back to the block chain. */ From e9dd83f0a90c29f9f913f019356844a989505855 Mon Sep 17 00:00:00 2001 From: jtimon Date: Fri, 29 Aug 2014 22:52:41 +0200 Subject: [PATCH 0619/1288] missing include boost/algorithm/string/replace.hpp --- src/init.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/init.cpp b/src/init.cpp index c49083c7df..50ad2785dd 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -35,6 +35,7 @@ #include "compat/sanity.h" #include +#include #include #include #include From bac5586b103bf3783805675948df255ed7dbe8e7 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 30 Aug 2014 02:35:05 +0200 Subject: [PATCH 0620/1288] Replace weird characters by normal spaces --- src/rpcdump.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index e68ddee040..c286626fd3 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -165,14 +165,14 @@ Value importaddress(const Array& params, bool fHelp) std::vector data(ParseHex(params[0].get_str())); script = CScript(data.begin(), data.end()); } else { - throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address or script"); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address or script"); } string strLabel = ""; if (params.size() > 1) strLabel = params[1].get_str(); - // Whether to perform rescan after import + // Whether to perform rescan after import bool fRescan = true; if (params.size() > 2) fRescan = params[2].get_bool(); @@ -191,7 +191,7 @@ Value importaddress(const Array& params, bool fHelp) pwalletMain->MarkDirty(); if (!pwalletMain->AddWatchOnly(script)) - throw JSONRPCError(RPC_WALLET_ERROR, "Error adding address to wallet"); + throw JSONRPCError(RPC_WALLET_ERROR, "Error adding address to wallet"); if (fRescan) { From 9f3d47677973cb894fdbb437b9b322e2062a1bf1 Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Thu, 7 Aug 2014 15:39:49 +0200 Subject: [PATCH 0621/1288] changed field types in some structures to equivalent unambiguous types Conflicts: src/core.cpp Rebased-By: Wladimir J. van der Laan Github-Pull: #4180 --- src/core.cpp | 4 ++-- src/core.h | 48 ++++++++++++++++++++++++------------------------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index 71d6fea610..e6636ae04f 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -12,14 +12,14 @@ std::string COutPoint::ToString() const return strprintf("COutPoint(%s, %u)", hash.ToString().substr(0,10), n); } -CTxIn::CTxIn(COutPoint prevoutIn, CScript scriptSigIn, unsigned int nSequenceIn) +CTxIn::CTxIn(COutPoint prevoutIn, CScript scriptSigIn, uint32_t nSequenceIn) { prevout = prevoutIn; scriptSig = scriptSigIn; nSequence = nSequenceIn; } -CTxIn::CTxIn(uint256 hashPrevTx, unsigned int nOut, CScript scriptSigIn, unsigned int nSequenceIn) +CTxIn::CTxIn(uint256 hashPrevTx, uint32_t nOut, CScript scriptSigIn, uint32_t nSequenceIn) { prevout = COutPoint(hashPrevTx, nOut); scriptSig = scriptSigIn; diff --git a/src/core.h b/src/core.h index e3ceac97aa..126e1baa98 100644 --- a/src/core.h +++ b/src/core.h @@ -26,13 +26,13 @@ class COutPoint { public: uint256 hash; - unsigned int n; + uint32_t n; COutPoint() { SetNull(); } - COutPoint(uint256 hashIn, unsigned int nIn) { hash = hashIn; n = nIn; } + COutPoint(uint256 hashIn, uint32_t nIn) { hash = hashIn; n = nIn; } IMPLEMENT_SERIALIZE( READWRITE(FLATDATA(*this)); ) - void SetNull() { hash = 0; n = (unsigned int) -1; } - bool IsNull() const { return (hash == 0 && n == (unsigned int) -1); } + void SetNull() { hash = 0; n = (uint32_t) -1; } + bool IsNull() const { return (hash == 0 && n == (uint32_t) -1); } friend bool operator<(const COutPoint& a, const COutPoint& b) { @@ -57,12 +57,12 @@ class CInPoint { public: const CTransaction* ptx; - unsigned int n; + uint32_t n; CInPoint() { SetNull(); } - CInPoint(const CTransaction* ptxIn, unsigned int nIn) { ptx = ptxIn; n = nIn; } - void SetNull() { ptx = NULL; n = (unsigned int) -1; } - bool IsNull() const { return (ptx == NULL && n == (unsigned int) -1); } + CInPoint(const CTransaction* ptxIn, uint32_t nIn) { ptx = ptxIn; n = nIn; } + void SetNull() { ptx = NULL; n = (uint32_t) -1; } + bool IsNull() const { return (ptx == NULL && n == (uint32_t) -1); } }; /** An input of a transaction. It contains the location of the previous @@ -74,15 +74,15 @@ class CTxIn public: COutPoint prevout; CScript scriptSig; - unsigned int nSequence; + uint32_t nSequence; CTxIn() { nSequence = std::numeric_limits::max(); } - explicit CTxIn(COutPoint prevoutIn, CScript scriptSigIn=CScript(), unsigned int nSequenceIn=std::numeric_limits::max()); - CTxIn(uint256 hashPrevTx, unsigned int nOut, CScript scriptSigIn=CScript(), unsigned int nSequenceIn=std::numeric_limits::max()); + explicit CTxIn(COutPoint prevoutIn, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=std::numeric_limits::max()); + CTxIn(uint256 hashPrevTx, uint32_t nOut, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=std::numeric_limits::max()); IMPLEMENT_SERIALIZE ( @@ -93,7 +93,7 @@ public: bool IsFinal() const { - return (nSequence == std::numeric_limits::max()); + return (nSequence == std::numeric_limits::max()); } friend bool operator==(const CTxIn& a, const CTxIn& b) @@ -217,17 +217,17 @@ private: void UpdateHash() const; public: - static const int CURRENT_VERSION=1; + static const int32_t CURRENT_VERSION=1; // The local variables are made const to prevent unintended modification // without updating the cached hash value. However, CTransaction is not // actually immutable; deserialization and assignment are implemented, // and bypass the constness. This is safe, as they update the entire // structure, including the hash. - const int nVersion; + const int32_t nVersion; const std::vector vin; const std::vector vout; - const unsigned int nLockTime; + const uint32_t nLockTime; /** Construct a CTransaction that qualifies as IsNull() */ CTransaction(); @@ -238,11 +238,11 @@ public: CTransaction& operator=(const CTransaction& tx); IMPLEMENT_SERIALIZE( - READWRITE(*const_cast(&this->nVersion)); + READWRITE(*const_cast(&this->nVersion)); nVersion = this->nVersion; READWRITE(*const_cast*>(&vin)); READWRITE(*const_cast*>(&vout)); - READWRITE(*const_cast(&nLockTime)); + READWRITE(*const_cast(&nLockTime)); if (fRead) UpdateHash(); ) @@ -284,10 +284,10 @@ public: /** A mutable version of CTransaction. */ struct CMutableTransaction { - int nVersion; + int32_t nVersion; std::vector vin; std::vector vout; - unsigned int nLockTime; + uint32_t nLockTime; CMutableTransaction(); CMutableTransaction(const CTransaction& tx); @@ -399,13 +399,13 @@ class CBlockHeader { public: // header - static const int CURRENT_VERSION=2; - int nVersion; + static const int32_t CURRENT_VERSION=2; + int32_t nVersion; uint256 hashPrevBlock; uint256 hashMerkleRoot; - unsigned int nTime; - unsigned int nBits; - unsigned int nNonce; + uint32_t nTime; + uint32_t nBits; + uint32_t nNonce; CBlockHeader() { From e84843c0dbb9cb853b912c09858b01c5c9302b09 Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Sat, 2 Aug 2014 19:54:57 +0100 Subject: [PATCH 0622/1288] Broken addresses on command line no longer trigger testnet. When passing a bitcoin: URI on the command line, invalid addresses do not incorrectly send the user to the test network. --- src/base58.cpp | 8 ++++++-- src/base58.h | 1 + src/chainparams.cpp | 19 ++++++++++--------- src/chainparams.h | 3 +++ src/qt/paymentserver.cpp | 8 ++++++-- 5 files changed, 26 insertions(+), 13 deletions(-) diff --git a/src/base58.cpp b/src/base58.cpp index c9e91beef1..76f0404a18 100644 --- a/src/base58.cpp +++ b/src/base58.cpp @@ -215,9 +215,13 @@ bool CBitcoinAddress::Set(const CTxDestination &dest) { } bool CBitcoinAddress::IsValid() const { + return IsValid(Params()); +} + +bool CBitcoinAddress::IsValid(const CChainParams ¶ms) const { bool fCorrectSize = vchData.size() == 20; - bool fKnownVersion = vchVersion == Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS) || - vchVersion == Params().Base58Prefix(CChainParams::SCRIPT_ADDRESS); + bool fKnownVersion = vchVersion == params.Base58Prefix(CChainParams::PUBKEY_ADDRESS) || + vchVersion == params.Base58Prefix(CChainParams::SCRIPT_ADDRESS); return fCorrectSize && fKnownVersion; } diff --git a/src/base58.h b/src/base58.h index 70681f589a..0f11f7c6d3 100644 --- a/src/base58.h +++ b/src/base58.h @@ -104,6 +104,7 @@ public: bool Set(const CScriptID &id); bool Set(const CTxDestination &dest); bool IsValid() const; + bool IsValid(const CChainParams ¶ms) const; CBitcoinAddress() {} CBitcoinAddress(const CTxDestination &dest) { Set(dest); } diff --git a/src/chainparams.cpp b/src/chainparams.cpp index f32d4ed235..84cfd11feb 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -220,24 +220,25 @@ const CChainParams &Params() { return *pCurrentParams; } -void SelectParams(CBaseChainParams::Network network) { - SelectBaseParams(network); +CChainParams &Params(CBaseChainParams::Network network) { switch (network) { case CBaseChainParams::MAIN: - pCurrentParams = &mainParams; - break; + return mainParams; case CBaseChainParams::TESTNET: - pCurrentParams = &testNetParams; - break; + return testNetParams; case CBaseChainParams::REGTEST: - pCurrentParams = ®TestParams; - break; + return regTestParams; default: assert(false && "Unimplemented network"); - return; + return mainParams; } } +void SelectParams(CBaseChainParams::Network network) { + SelectBaseParams(network); + pCurrentParams = &Params(network); +} + bool SelectParamsFromCommandLine() { if (!SelectBaseParamsFromCommandLine()) return false; diff --git a/src/chainparams.h b/src/chainparams.h index 446256ba82..34aaf1fb47 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -111,6 +111,9 @@ protected: */ const CChainParams &Params(); +/** Return parameters for the given network. */ +CChainParams &Params(CBaseChainParams::Network network); + /** Sets the params returned by Params() to those for the given network. */ void SelectParams(CBaseChainParams::Network network); diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index a9f1566d62..3360dd36eb 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -10,6 +10,7 @@ #include "optionsmodel.h" #include "base58.h" +#include "chainparams.h" #include "ui_interface.h" #include "wallet.h" @@ -199,8 +200,11 @@ bool PaymentServer::ipcParseCommandLine(int argc, char* argv[]) { CBitcoinAddress address(r.address.toStdString()); - SelectParams(CBaseChainParams::MAIN); - if (!address.IsValid()) + if (address.IsValid(Params(CBaseChainParams::MAIN))) + { + SelectParams(CBaseChainParams::MAIN); + } + else if (address.IsValid(Params(CBaseChainParams::TESTNET))) { SelectParams(CBaseChainParams::TESTNET); } From 4b0deb3b2df5882061ae6c44947eda831420cd5e Mon Sep 17 00:00:00 2001 From: Daniel Kraft Date: Fri, 29 Aug 2014 20:24:16 +0200 Subject: [PATCH 0623/1288] Clean up CMerkleTx::SetMerkleBranch. The case SetMerkleBranch(NULL) was never actually used, and thus the involved code (loading the block from disk) can be removed and the implementation simplified. --- src/wallet.cpp | 50 ++++++++++++++++++-------------------------------- src/wallet.h | 2 +- 2 files changed, 19 insertions(+), 33 deletions(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index 18a5b3971c..f7efeaec4a 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -644,7 +644,7 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl CWalletTx wtx(this,tx); // Get merkle branch if transaction was found in a block if (pblock) - wtx.SetMerkleBranch(pblock); + wtx.SetMerkleBranch(*pblock); return AddToWallet(wtx); } } @@ -2195,48 +2195,34 @@ CWalletKey::CWalletKey(int64_t nExpires) nTimeExpires = nExpires; } -int CMerkleTx::SetMerkleBranch(const CBlock* pblock) +int CMerkleTx::SetMerkleBranch(const CBlock& block) { AssertLockHeld(cs_main); CBlock blockTmp; - if (pblock == NULL) { - CCoins coins; - if (pcoinsTip->GetCoins(GetHash(), coins)) { - CBlockIndex *pindex = chainActive[coins.nHeight]; - if (pindex) { - if (!ReadBlockFromDisk(blockTmp, pindex)) - return 0; - pblock = &blockTmp; - } - } + // Update the tx's hashBlock + hashBlock = block.GetHash(); + + // Locate the transaction + for (nIndex = 0; nIndex < (int)block.vtx.size(); nIndex++) + if (block.vtx[nIndex] == *(CTransaction*)this) + break; + if (nIndex == (int)block.vtx.size()) + { + vMerkleBranch.clear(); + nIndex = -1; + LogPrintf("ERROR: SetMerkleBranch() : couldn't find tx in block\n"); + return 0; } - if (pblock) { - // Update the tx's hashBlock - hashBlock = pblock->GetHash(); - - // Locate the transaction - for (nIndex = 0; nIndex < (int)pblock->vtx.size(); nIndex++) - if (pblock->vtx[nIndex] == *(CTransaction*)this) - break; - if (nIndex == (int)pblock->vtx.size()) - { - vMerkleBranch.clear(); - nIndex = -1; - LogPrintf("ERROR: SetMerkleBranch() : couldn't find tx in block\n"); - return 0; - } - - // Fill in merkle branch - vMerkleBranch = pblock->GetMerkleBranch(nIndex); - } + // Fill in merkle branch + vMerkleBranch = block.GetMerkleBranch(nIndex); // Is the tx in a block that's in the main chain map::iterator mi = mapBlockIndex.find(hashBlock); if (mi == mapBlockIndex.end()) return 0; - CBlockIndex* pindex = (*mi).second; + const CBlockIndex* pindex = (*mi).second; if (!pindex || !chainActive.Contains(pindex)) return 0; diff --git a/src/wallet.h b/src/wallet.h index 544b4f5bfb..3becc396c1 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -500,7 +500,7 @@ public: ) - int SetMerkleBranch(const CBlock* pblock=NULL); + int SetMerkleBranch(const CBlock& block); // Return depth of transaction in blockchain: // -1 : not in blockchain, and not in memory pool (conflicted transaction) From 3d796f89962842e91e7d88e57c1d2d579f01052e Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Wed, 20 Aug 2014 08:42:31 +0200 Subject: [PATCH 0624/1288] overhaul serialization code The implementation of each class' serialization/deserialization is no longer passed within a macro. The implementation now lies within a template of form: template inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; /* CODE */ return nSerSize; } In cases when codepath should depend on whether or not we are just deserializing (old fGetSize, fWrite, fRead flags) an additional clause can be used: bool fRead = boost::is_same(); The IMPLEMENT_SERIALIZE macro will now be a freestanding clause added within class' body (similiar to Qt's Q_OBJECT) to implement GetSerializeSize, Serialize and Unserialize. These are now wrappers around the "SerializationOp" template. --- src/addrman.h | 17 +-- src/alert.h | 48 +++++---- src/bloom.h | 16 +-- src/core.h | 168 +++++++++++++++++++++--------- src/crypter.h | 19 ++-- src/main.h | 138 +++++++++++++++--------- src/netbase.h | 29 ++++-- src/protocol.h | 61 +++++++---- src/qt/recentrequeststablemodel.h | 19 ++-- src/qt/walletmodel.h | 15 ++- src/serialize.h | 68 +++++------- src/wallet.h | 123 +++++++++++++--------- src/walletdb.h | 14 ++- 13 files changed, 462 insertions(+), 273 deletions(-) diff --git a/src/addrman.h b/src/addrman.h index 052d364655..4287cbc1b3 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -46,13 +46,18 @@ private: public: - IMPLEMENT_SERIALIZE( - CAddress* pthis = (CAddress*)(this); + IMPLEMENT_SERIALIZE + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + CAddress* pthis = (CAddress*)(thisPtr); READWRITE(*pthis); - READWRITE(source); - READWRITE(nLastSuccess); - READWRITE(nAttempts); - ) + READWRITE(thisPtr->source); + READWRITE(thisPtr->nLastSuccess); + READWRITE(thisPtr->nAttempts); + return nSerSize; + } void Init() { diff --git a/src/alert.h b/src/alert.h index b9d850b565..4c8267fd06 100644 --- a/src/alert.h +++ b/src/alert.h @@ -47,23 +47,27 @@ public: std::string strReserved; IMPLEMENT_SERIALIZE - ( - READWRITE(this->nVersion); - nVersion = this->nVersion; - READWRITE(nRelayUntil); - READWRITE(nExpiration); - READWRITE(nID); - READWRITE(nCancel); - READWRITE(setCancel); - READWRITE(nMinVer); - READWRITE(nMaxVer); - READWRITE(setSubVer); - READWRITE(nPriority); - READWRITE(LIMITED_STRING(strComment, 65536)); - READWRITE(LIMITED_STRING(strStatusBar, 256)); - READWRITE(LIMITED_STRING(strReserved, 256)); - ) + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + READWRITE(thisPtr->nVersion); + nVersion = thisPtr->nVersion; + READWRITE(thisPtr->nRelayUntil); + READWRITE(thisPtr->nExpiration); + READWRITE(thisPtr->nID); + READWRITE(thisPtr->nCancel); + READWRITE(thisPtr->setCancel); + READWRITE(thisPtr->nMinVer); + READWRITE(thisPtr->nMaxVer); + READWRITE(thisPtr->setSubVer); + READWRITE(thisPtr->nPriority); + + READWRITE(LIMITED_STRING(thisPtr->strComment, 65536)); + READWRITE(LIMITED_STRING(thisPtr->strStatusBar, 256)); + READWRITE(LIMITED_STRING(thisPtr->strReserved, 256)); + return nSerSize; + } void SetNull(); @@ -83,10 +87,14 @@ public: } IMPLEMENT_SERIALIZE - ( - READWRITE(vchMsg); - READWRITE(vchSig); - ) + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + READWRITE(thisPtr->vchMsg); + READWRITE(thisPtr->vchSig); + return nSerSize; + } void SetNull(); bool IsNull() const; diff --git a/src/bloom.h b/src/bloom.h index 54d16d7126..dafea67029 100644 --- a/src/bloom.h +++ b/src/bloom.h @@ -63,12 +63,16 @@ public: CBloomFilter() : isFull(true), isEmpty(false), nHashFuncs(0), nTweak(0), nFlags(0) {} IMPLEMENT_SERIALIZE - ( - READWRITE(vData); - READWRITE(nHashFuncs); - READWRITE(nTweak); - READWRITE(nFlags); - ) + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + READWRITE(thisPtr->vData); + READWRITE(thisPtr->nHashFuncs); + READWRITE(thisPtr->nTweak); + READWRITE(thisPtr->nFlags); + return nSerSize; + } void insert(const std::vector& vKey); void insert(const COutPoint& outpoint); diff --git a/src/core.h b/src/core.h index 126e1baa98..1caf9da6c0 100644 --- a/src/core.h +++ b/src/core.h @@ -30,7 +30,16 @@ public: COutPoint() { SetNull(); } COutPoint(uint256 hashIn, uint32_t nIn) { hash = hashIn; n = nIn; } - IMPLEMENT_SERIALIZE( READWRITE(FLATDATA(*this)); ) + + IMPLEMENT_SERIALIZE + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + READWRITE(FLATDATA(*thisPtr)); + return nSerSize; + } + void SetNull() { hash = 0; n = (uint32_t) -1; } bool IsNull() const { return (hash == 0 && n == (uint32_t) -1); } @@ -85,11 +94,15 @@ public: CTxIn(uint256 hashPrevTx, uint32_t nOut, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=std::numeric_limits::max()); IMPLEMENT_SERIALIZE - ( - READWRITE(prevout); - READWRITE(scriptSig); - READWRITE(nSequence); - ) + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + READWRITE(thisPtr->prevout); + READWRITE(thisPtr->scriptSig); + READWRITE(thisPtr->nSequence); + return nSerSize; + } bool IsFinal() const { @@ -136,7 +149,14 @@ public: friend bool operator>=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK >= b.nSatoshisPerK; } std::string ToString() const; - IMPLEMENT_SERIALIZE( READWRITE(nSatoshisPerK); ) + IMPLEMENT_SERIALIZE + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + READWRITE(thisPtr->nSatoshisPerK); + return nSerSize; + } }; @@ -157,10 +177,14 @@ public: CTxOut(int64_t nValueIn, CScript scriptPubKeyIn); IMPLEMENT_SERIALIZE - ( - READWRITE(nValue); - READWRITE(scriptPubKey); - ) + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + READWRITE(thisPtr->nValue); + READWRITE(thisPtr->scriptPubKey); + return nSerSize; + } void SetNull() { @@ -237,15 +261,23 @@ public: CTransaction& operator=(const CTransaction& tx); - IMPLEMENT_SERIALIZE( - READWRITE(*const_cast(&this->nVersion)); - nVersion = this->nVersion; - READWRITE(*const_cast*>(&vin)); - READWRITE(*const_cast*>(&vout)); - READWRITE(*const_cast(&nLockTime)); + IMPLEMENT_SERIALIZE + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + bool fRead = boost::is_same(); + + READWRITE(*const_cast(&thisPtr->nVersion)); + nVersion = thisPtr->nVersion; + READWRITE(*const_cast*>(&thisPtr->vin)); + READWRITE(*const_cast*>(&thisPtr->vout)); + READWRITE(*const_cast(&thisPtr->nLockTime)); if (fRead) - UpdateHash(); - ) + thisPtr->UpdateHash(); + + return nSerSize; + } bool IsNull() const { return vin.empty() && vout.empty(); @@ -292,13 +324,20 @@ struct CMutableTransaction CMutableTransaction(); CMutableTransaction(const CTransaction& tx); - IMPLEMENT_SERIALIZE( - READWRITE(this->nVersion); - nVersion = this->nVersion; - READWRITE(vin); - READWRITE(vout); - READWRITE(nLockTime); - ) + IMPLEMENT_SERIALIZE + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + + READWRITE(thisPtr->nVersion); + nVersion = thisPtr->nVersion; + READWRITE(thisPtr->vin); + READWRITE(thisPtr->vout); + READWRITE(thisPtr->nLockTime); + + return nSerSize; + } /** Compute the hash of this CMutableTransaction. This is computed on the * fly, as opposed to GetHash() in CTransaction, which uses a cached result. @@ -318,18 +357,24 @@ public: CTxOutCompressor(CTxOut &txoutIn) : txout(txoutIn) { } - IMPLEMENT_SERIALIZE(({ + IMPLEMENT_SERIALIZE + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + bool fRead = boost::is_same(); + size_t nSerSize = 0; if (!fRead) { - uint64_t nVal = CompressAmount(txout.nValue); + uint64_t nVal = CompressAmount(thisPtr->txout.nValue); READWRITE(VARINT(nVal)); } else { uint64_t nVal = 0; READWRITE(VARINT(nVal)); - txout.nValue = DecompressAmount(nVal); + thisPtr->txout.nValue = DecompressAmount(nVal); } - CScriptCompressor cscript(REF(txout.scriptPubKey)); + CScriptCompressor cscript(REF(thisPtr->txout.scriptPubKey)); READWRITE(cscript); - });) + return nSerSize; + } }; /** Undo information for a CTxIn @@ -382,9 +427,14 @@ public: // undo information for all txins std::vector vprevout; - IMPLEMENT_SERIALIZE( - READWRITE(vprevout); - ) + IMPLEMENT_SERIALIZE + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + READWRITE(thisPtr->vprevout); + return nSerSize; + } }; @@ -413,15 +463,21 @@ public: } IMPLEMENT_SERIALIZE - ( - READWRITE(this->nVersion); - nVersion = this->nVersion; - READWRITE(hashPrevBlock); - READWRITE(hashMerkleRoot); - READWRITE(nTime); - READWRITE(nBits); - READWRITE(nNonce); - ) + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + + READWRITE(thisPtr->nVersion); + nVersion = thisPtr->nVersion; + READWRITE(thisPtr->hashPrevBlock); + READWRITE(thisPtr->hashMerkleRoot); + READWRITE(thisPtr->nTime); + READWRITE(thisPtr->nBits); + READWRITE(thisPtr->nNonce); + + return nSerSize; + } void SetNull() { @@ -468,10 +524,16 @@ public: } IMPLEMENT_SERIALIZE - ( - READWRITE(*(CBlockHeader*)this); - READWRITE(vtx); - ) + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + + READWRITE(*(CBlockHeader*)thisPtr); + READWRITE(thisPtr->vtx); + + return nSerSize; + } void SetNull() { @@ -516,11 +578,17 @@ struct CBlockLocator } IMPLEMENT_SERIALIZE - ( + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + if (!(nType & SER_GETHASH)) READWRITE(nVersion); - READWRITE(vHave); - ) + READWRITE(thisPtr->vHave); + + return nSerSize; + } void SetNull() { diff --git a/src/crypter.h b/src/crypter.h index f16fcef9c7..c3f4ed971c 100644 --- a/src/crypter.h +++ b/src/crypter.h @@ -44,13 +44,18 @@ public: std::vector vchOtherDerivationParameters; IMPLEMENT_SERIALIZE - ( - READWRITE(vchCryptedKey); - READWRITE(vchSalt); - READWRITE(nDerivationMethod); - READWRITE(nDeriveIterations); - READWRITE(vchOtherDerivationParameters); - ) + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + READWRITE(thisPtr->vchCryptedKey); + READWRITE(thisPtr->vchSalt); + READWRITE(thisPtr->nDerivationMethod); + READWRITE(thisPtr->nDeriveIterations); + READWRITE(thisPtr->vchOtherDerivationParameters); + return nSerSize; + } + CMasterKey() { // 25000 rounds is just under 0.1 seconds on a 1.86 GHz Pentium M diff --git a/src/main.h b/src/main.h index 9fe15d3aa3..88e3159e3f 100644 --- a/src/main.h +++ b/src/main.h @@ -197,10 +197,15 @@ struct CDiskBlockPos int nFile; unsigned int nPos; - IMPLEMENT_SERIALIZE( - READWRITE(VARINT(nFile)); - READWRITE(VARINT(nPos)); - ) + IMPLEMENT_SERIALIZE + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + READWRITE(VARINT(thisPtr->nFile)); + READWRITE(VARINT(thisPtr->nPos)); + return nSerSize; + } CDiskBlockPos() { SetNull(); @@ -227,10 +232,15 @@ struct CDiskTxPos : public CDiskBlockPos { unsigned int nTxOffset; // after header - IMPLEMENT_SERIALIZE( - READWRITE(*(CDiskBlockPos*)this); - READWRITE(VARINT(nTxOffset)); - ) + IMPLEMENT_SERIALIZE + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + READWRITE(*(CDiskBlockPos*)thisPtr); + READWRITE(VARINT(thisPtr->nTxOffset)); + return nSerSize; + } CDiskTxPos(const CDiskBlockPos &blockIn, unsigned int nTxOffsetIn) : CDiskBlockPos(blockIn.nFile, blockIn.nPos), nTxOffset(nTxOffsetIn) { } @@ -307,9 +317,14 @@ class CBlockUndo public: std::vector vtxundo; // for all but the coinbase - IMPLEMENT_SERIALIZE( - READWRITE(vtxundo); - ) + IMPLEMENT_SERIALIZE + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + READWRITE(thisPtr->vtxundo); + return nSerSize; + } bool WriteToDisk(CDiskBlockPos &pos, const uint256 &hashBlock); bool ReadFromDisk(const CDiskBlockPos &pos, const uint256 &hashBlock); @@ -411,24 +426,32 @@ protected: public: // serialization implementation - IMPLEMENT_SERIALIZE( - READWRITE(nTransactions); - READWRITE(vHash); + IMPLEMENT_SERIALIZE + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + bool fRead = boost::is_same(); + + READWRITE(thisPtr->nTransactions); + READWRITE(thisPtr->vHash); std::vector vBytes; if (fRead) { READWRITE(vBytes); - CPartialMerkleTree &us = *(const_cast(this)); + CPartialMerkleTree &us = *(const_cast(thisPtr)); us.vBits.resize(vBytes.size() * 8); for (unsigned int p = 0; p < us.vBits.size(); p++) us.vBits[p] = (vBytes[p / 8] & (1 << (p % 8))) != 0; us.fBad = false; } else { - vBytes.resize((vBits.size()+7)/8); - for (unsigned int p = 0; p < vBits.size(); p++) - vBytes[p / 8] |= vBits[p] << (p % 8); + vBytes.resize((thisPtr->vBits.size()+7)/8); + for (unsigned int p = 0; p < thisPtr->vBits.size(); p++) + vBytes[p / 8] |= thisPtr->vBits[p] << (p % 8); READWRITE(vBytes); } - ) + + return nSerSize; + } // Construct a partial merkle tree from a list of transaction id's, and a mask that selects a subset of them CPartialMerkleTree(const std::vector &vTxid, const std::vector &vMatch); @@ -484,15 +507,22 @@ public: uint64_t nTimeFirst; // earliest time of block in file uint64_t nTimeLast; // latest time of block in file - IMPLEMENT_SERIALIZE( - READWRITE(VARINT(nBlocks)); - READWRITE(VARINT(nSize)); - READWRITE(VARINT(nUndoSize)); - READWRITE(VARINT(nHeightFirst)); - READWRITE(VARINT(nHeightLast)); - READWRITE(VARINT(nTimeFirst)); - READWRITE(VARINT(nTimeLast)); - ) + IMPLEMENT_SERIALIZE + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + + READWRITE(VARINT(thisPtr->nBlocks)); + READWRITE(VARINT(thisPtr->nSize)); + READWRITE(VARINT(thisPtr->nUndoSize)); + READWRITE(VARINT(thisPtr->nHeightFirst)); + READWRITE(VARINT(thisPtr->nHeightLast)); + READWRITE(VARINT(thisPtr->nTimeFirst)); + READWRITE(VARINT(thisPtr->nTimeLast)); + + return nSerSize; + } void SetNull() { nBlocks = 0; @@ -756,28 +786,34 @@ public: } IMPLEMENT_SERIALIZE - ( + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + if (!(nType & SER_GETHASH)) READWRITE(VARINT(nVersion)); - READWRITE(VARINT(nHeight)); - READWRITE(VARINT(nStatus)); - READWRITE(VARINT(nTx)); - if (nStatus & (BLOCK_HAVE_DATA | BLOCK_HAVE_UNDO)) - READWRITE(VARINT(nFile)); - if (nStatus & BLOCK_HAVE_DATA) - READWRITE(VARINT(nDataPos)); - if (nStatus & BLOCK_HAVE_UNDO) - READWRITE(VARINT(nUndoPos)); + READWRITE(VARINT(thisPtr->nHeight)); + READWRITE(VARINT(thisPtr->nStatus)); + READWRITE(VARINT(thisPtr->nTx)); + if (thisPtr->nStatus & (BLOCK_HAVE_DATA | BLOCK_HAVE_UNDO)) + READWRITE(VARINT(thisPtr->nFile)); + if (thisPtr->nStatus & BLOCK_HAVE_DATA) + READWRITE(VARINT(thisPtr->nDataPos)); + if (thisPtr->nStatus & BLOCK_HAVE_UNDO) + READWRITE(VARINT(thisPtr->nUndoPos)); // block header - READWRITE(this->nVersion); - READWRITE(hashPrev); - READWRITE(hashMerkleRoot); - READWRITE(nTime); - READWRITE(nBits); - READWRITE(nNonce); - ) + READWRITE(thisPtr->nVersion); + READWRITE(thisPtr->hashPrev); + READWRITE(thisPtr->hashMerkleRoot); + READWRITE(thisPtr->nTime); + READWRITE(thisPtr->nBits); + READWRITE(thisPtr->nNonce); + + return nSerSize; + } uint256 GetBlockHash() const { @@ -976,10 +1012,14 @@ public: CMerkleBlock(const CBlock& block, CBloomFilter& filter); IMPLEMENT_SERIALIZE - ( - READWRITE(header); - READWRITE(txn); - ) + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + READWRITE(thisPtr->header); + READWRITE(thisPtr->txn); + return nSerSize; + } }; diff --git a/src/netbase.h b/src/netbase.h index 2df3c4474d..6f8c132502 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -89,9 +89,13 @@ class CNetAddr friend bool operator<(const CNetAddr& a, const CNetAddr& b); IMPLEMENT_SERIALIZE - ( - READWRITE(FLATDATA(ip)); - ) + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + READWRITE(FLATDATA(thisPtr->ip)); + return nSerSize; + } }; class CSubNet @@ -149,14 +153,19 @@ class CService : public CNetAddr CService(const struct sockaddr_in6& addr); IMPLEMENT_SERIALIZE - ( - CService* pthis = const_cast(this); - READWRITE(FLATDATA(ip)); - unsigned short portN = htons(port); - READWRITE(portN); - if (fRead) + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + bool fRead = boost::is_same(); + size_t nSerSize = 0; + CService* pthis = const_cast(thisPtr); + READWRITE(FLATDATA(thisPtr->ip)); + unsigned short portN = htons(thisPtr->port); + READWRITE(portN); + if (fRead) pthis->port = ntohs(portN); - ) + return nSerSize; + } }; typedef CService proxyType; diff --git a/src/protocol.h b/src/protocol.h index d7565584af..851fca9d9e 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -36,12 +36,16 @@ class CMessageHeader bool IsValid() const; IMPLEMENT_SERIALIZE - ( - READWRITE(FLATDATA(pchMessageStart)); - READWRITE(FLATDATA(pchCommand)); - READWRITE(nMessageSize); - READWRITE(nChecksum); - ) + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + READWRITE(FLATDATA(thisPtr->pchMessageStart)); + READWRITE(FLATDATA(thisPtr->pchCommand)); + READWRITE(thisPtr->nMessageSize); + READWRITE(thisPtr->nChecksum); + return nSerSize; + } // TODO: make private (improves encapsulation) public: @@ -84,19 +88,26 @@ class CAddress : public CService void Init(); IMPLEMENT_SERIALIZE - ( - CAddress* pthis = const_cast(this); - CService* pip = (CService*)pthis; - if (fRead) - pthis->Init(); - if (nType & SER_DISK) - READWRITE(nVersion); - if ((nType & SER_DISK) || - (nVersion >= CADDR_TIME_VERSION && !(nType & SER_GETHASH))) - READWRITE(nTime); - READWRITE(nServices); - READWRITE(*pip); - ) + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + bool fRead = boost::is_same(); + + CAddress* pthis = const_cast(thisPtr); + CService* pip = (CService*)pthis; + if (fRead) + pthis->Init(); + if (nType & SER_DISK) + READWRITE(nVersion); + if ((nType & SER_DISK) || + (nVersion >= CADDR_TIME_VERSION && !(nType & SER_GETHASH))) + READWRITE(thisPtr->nTime); + READWRITE(thisPtr->nServices); + READWRITE(*pip); + + return nSerSize; + } // TODO: make private (improves encapsulation) public: @@ -118,10 +129,14 @@ class CInv CInv(const std::string& strType, const uint256& hashIn); IMPLEMENT_SERIALIZE - ( - READWRITE(type); - READWRITE(hash); - ) + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + READWRITE(thisPtr->type); + READWRITE(thisPtr->hash); + return nSerSize; + } friend bool operator<(const CInv& a, const CInv& b); diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h index 4f0b241259..50962334f5 100644 --- a/src/qt/recentrequeststablemodel.h +++ b/src/qt/recentrequeststablemodel.h @@ -25,20 +25,27 @@ public: SendCoinsRecipient recipient; IMPLEMENT_SERIALIZE - ( - RecentRequestEntry* pthis = const_cast(this); - unsigned int nDate = date.toTime_t(); + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + bool fRead = boost::is_same(); + + RecentRequestEntry* pthis = const_cast(thisPtr); + + unsigned int nDate = thisPtr->date.toTime_t(); READWRITE(pthis->nVersion); nVersion = pthis->nVersion; - READWRITE(id); + READWRITE(thisPtr->id); READWRITE(nDate); - READWRITE(recipient); + READWRITE(thisPtr->recipient); if (fRead) pthis->date = QDateTime::fromTime_t(nDate); - ) + + return nSerSize; + } }; class RecentRequestEntryLessThan diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index b3a401e4cc..543843733c 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -60,8 +60,13 @@ public: int nVersion; IMPLEMENT_SERIALIZE - ( - SendCoinsRecipient* pthis = const_cast(this); + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + bool fRead = boost::is_same(); + + SendCoinsRecipient* pthis = const_cast(thisPtr); std::string sAddress = pthis->address.toStdString(); std::string sLabel = pthis->label.toStdString(); @@ -75,7 +80,7 @@ public: nVersion = pthis->nVersion; READWRITE(sAddress); READWRITE(sLabel); - READWRITE(amount); + READWRITE(thisPtr->amount); READWRITE(sMessage); READWRITE(sPaymentRequest); READWRITE(sAuthenticatedMerchant); @@ -89,7 +94,9 @@ public: pthis->paymentRequest.parse(QByteArray::fromRawData(sPaymentRequest.data(), sPaymentRequest.size())); pthis->authenticatedMerchant = QString::fromStdString(sAuthenticatedMerchant); } - ) + + return nSerSize; + } }; /** Interface to Bitcoin wallet from Qt view code. */ diff --git a/src/serialize.h b/src/serialize.h index 17cb724bee..7e0ecc2edf 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -22,6 +22,7 @@ #include #include +#include class CAutoFile; class CDataStream; @@ -37,6 +38,14 @@ inline T& REF(const T& val) return const_cast(val); } +// Used to acquire a const pointer "this" and generate a const +// serialization operation from a template +template +inline T MAKE_CONST(T val) +{ + return const_cast(val); +} + /** Get begin pointer of vector (non-const version). * @note These functions avoid the undefined case of indexing into an empty * vector, as well as that of indexing after the end of the vector. @@ -79,48 +88,27 @@ enum SER_GETHASH = (1 << 2), }; -#define IMPLEMENT_SERIALIZE(statements) \ - unsigned int GetSerializeSize(int nType, int nVersion) const \ - { \ - CSerActionGetSerializeSize ser_action; \ - const bool fGetSize = true; \ - const bool fWrite = false; \ - const bool fRead = false; \ - unsigned int nSerSize = 0; \ - ser_streamplaceholder s; \ - assert(fGetSize||fWrite||fRead); /* suppress warning */ \ - s.nType = nType; \ - s.nVersion = nVersion; \ - {statements} \ - return nSerSize; \ - } \ - template \ - void Serialize(Stream& s, int nType, int nVersion) const \ - { \ - CSerActionSerialize ser_action; \ - const bool fGetSize = false; \ - const bool fWrite = true; \ - const bool fRead = false; \ - unsigned int nSerSize = 0; \ - assert(fGetSize||fWrite||fRead); /* suppress warning */ \ - {statements} \ - } \ - template \ - void Unserialize(Stream& s, int nType, int nVersion) \ - { \ - CSerActionUnserialize ser_action; \ - const bool fGetSize = false; \ - const bool fWrite = false; \ - const bool fRead = true; \ - unsigned int nSerSize = 0; \ - assert(fGetSize||fWrite||fRead); /* suppress warning */ \ - {statements} \ - } - #define READWRITE(obj) (nSerSize += ::SerReadWrite(s, (obj), nType, nVersion, ser_action)) - - +/* Implement three methods for serializable objects. These are actually wrappers over + * "SerializationOp" template, which implements the body of each class' serialization + * code. Adding "IMPLEMENT_SERIALIZE" in the body of the class causes these wrappers to be + * added as members. */ +#define IMPLEMENT_SERIALIZE \ + size_t GetSerializeSize(int nType, int nVersion) const { \ + ser_streamplaceholder s; \ + s.nType = nType; \ + s.nVersion = nVersion; \ + return SerializationOp(MAKE_CONST(this), s, CSerActionGetSerializeSize(), nType, nVersion); \ + } \ + template \ + void Serialize(Stream& s, int nType, int nVersion) const { \ + SerializationOp(MAKE_CONST(this), s, CSerActionSerialize(), nType, nVersion); \ + } \ + template \ + void Unserialize(Stream& s, int nType, int nVersion) { \ + SerializationOp(this, s, CSerActionUnserialize(), nType, nVersion); \ + } diff --git a/src/wallet.h b/src/wallet.h index 544b4f5bfb..36b0bafe5a 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -64,12 +64,16 @@ public: CKeyPool(const CPubKey& vchPubKeyIn); IMPLEMENT_SERIALIZE - ( + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; if (!(nType & SER_GETHASH)) READWRITE(nVersion); - READWRITE(nTime); - READWRITE(vchPubKey); - ) + READWRITE(thisPtr->nTime); + READWRITE(thisPtr->vchPubKey); + return nSerSize; + } }; /** Address book data */ @@ -489,16 +493,20 @@ public: fMerkleVerified = false; } - IMPLEMENT_SERIALIZE - ( - nSerSize += SerReadWrite(s, *(CTransaction*)this, nType, nVersion, ser_action); - nVersion = this->nVersion; - READWRITE(hashBlock); - READWRITE(vMerkleBranch); - READWRITE(nIndex); - ) + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + + nSerSize += SerReadWrite(s, *(CTransaction*)thisPtr, nType, nVersion, ser_action); + nVersion = thisPtr->nVersion; + READWRITE(thisPtr->hashBlock); + READWRITE(thisPtr->vMerkleBranch); + READWRITE(thisPtr->nIndex); + + return nSerSize; + } int SetMerkleBranch(const CBlock* pblock=NULL); @@ -513,7 +521,6 @@ public: bool AcceptToMemoryPool(bool fLimitFree=true, bool fRejectInsaneFee=true); }; - /** A transaction with a bunch of additional info that only the owner cares about. * It includes any unrecorded transactions needed to link it back to the block chain. */ @@ -604,8 +611,13 @@ public: } IMPLEMENT_SERIALIZE - ( - CWalletTx* pthis = const_cast(this); + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + bool fRead = boost::is_same(); + + CWalletTx* pthis = const_cast(thisPtr); if (fRead) pthis->Init(NULL); char fSpent = false; @@ -616,18 +628,18 @@ public: WriteOrderPos(pthis->nOrderPos, pthis->mapValue); - if (nTimeSmart) - pthis->mapValue["timesmart"] = strprintf("%u", nTimeSmart); + if (thisPtr->nTimeSmart) + pthis->mapValue["timesmart"] = strprintf("%u", thisPtr->nTimeSmart); } - nSerSize += SerReadWrite(s, *(CMerkleTx*)this, nType, nVersion,ser_action); + nSerSize += SerReadWrite(s, *(CMerkleTx*)thisPtr, nType, nVersion,ser_action); std::vector vUnused; // Used to be vtxPrev READWRITE(vUnused); - READWRITE(mapValue); - READWRITE(vOrderForm); - READWRITE(fTimeReceivedIsTxTime); - READWRITE(nTimeReceived); - READWRITE(fFromMe); + READWRITE(thisPtr->mapValue); + READWRITE(thisPtr->vOrderForm); + READWRITE(thisPtr->fTimeReceivedIsTxTime); + READWRITE(thisPtr->nTimeReceived); + READWRITE(thisPtr->fFromMe); READWRITE(fSpent); if (fRead) @@ -636,7 +648,7 @@ public: ReadOrderPos(pthis->nOrderPos, pthis->mapValue); - pthis->nTimeSmart = mapValue.count("timesmart") ? (unsigned int)atoi64(pthis->mapValue["timesmart"]) : 0; + pthis->nTimeSmart = thisPtr->mapValue.count("timesmart") ? (unsigned int)atoi64(pthis->mapValue["timesmart"]) : 0; } pthis->mapValue.erase("fromaccount"); @@ -644,7 +656,9 @@ public: pthis->mapValue.erase("spent"); pthis->mapValue.erase("n"); pthis->mapValue.erase("timesmart"); - ) + + return nSerSize; + } // make sure balances are recalculated void MarkDirty() @@ -891,14 +905,18 @@ public: CWalletKey(int64_t nExpires=0); IMPLEMENT_SERIALIZE - ( + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; if (!(nType & SER_GETHASH)) READWRITE(nVersion); - READWRITE(vchPrivKey); - READWRITE(nTimeCreated); - READWRITE(nTimeExpires); - READWRITE(LIMITED_STRING(strComment, 65536)); - ) + READWRITE(thisPtr->vchPrivKey); + READWRITE(thisPtr->nTimeCreated); + READWRITE(thisPtr->nTimeExpires); + READWRITE(LIMITED_STRING(thisPtr->strComment, 65536)); + return nSerSize; + } }; @@ -925,11 +943,15 @@ public: } IMPLEMENT_SERIALIZE - ( + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; if (!(nType & SER_GETHASH)) READWRITE(nVersion); - READWRITE(vchPubKey); - ) + READWRITE(thisPtr->vchPubKey); + return nSerSize; + } }; @@ -966,38 +988,43 @@ public: } IMPLEMENT_SERIALIZE - ( - CAccountingEntry& me = *const_cast(this); + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + bool fRead = boost::is_same(); + + CAccountingEntry& me = *const_cast(thisPtr); if (!(nType & SER_GETHASH)) READWRITE(nVersion); // Note: strAccount is serialized as part of the key, not here. - READWRITE(nCreditDebit); - READWRITE(nTime); - READWRITE(LIMITED_STRING(strOtherAccount, 65536)); + READWRITE(thisPtr->nCreditDebit); + READWRITE(thisPtr->nTime); + READWRITE(LIMITED_STRING(thisPtr->strOtherAccount, 65536)); if (!fRead) { - WriteOrderPos(nOrderPos, me.mapValue); + WriteOrderPos(thisPtr->nOrderPos, me.mapValue); - if (!(mapValue.empty() && _ssExtra.empty())) + if (!(thisPtr->mapValue.empty() && thisPtr->_ssExtra.empty())) { CDataStream ss(nType, nVersion); ss.insert(ss.begin(), '\0'); - ss << mapValue; - ss.insert(ss.end(), _ssExtra.begin(), _ssExtra.end()); + ss << thisPtr->mapValue; + ss.insert(ss.end(), thisPtr->_ssExtra.begin(), thisPtr->_ssExtra.end()); me.strComment.append(ss.str()); } } - READWRITE(LIMITED_STRING(strComment, 65536)); + READWRITE(LIMITED_STRING(thisPtr->strComment, 65536)); - size_t nSepPos = strComment.find("\0", 0, 1); + size_t nSepPos = thisPtr->strComment.find("\0", 0, 1); if (fRead) { me.mapValue.clear(); if (std::string::npos != nSepPos) { - CDataStream ss(std::vector(strComment.begin() + nSepPos + 1, strComment.end()), nType, nVersion); + CDataStream ss(std::vector(thisPtr->strComment.begin() + nSepPos + 1, thisPtr->strComment.end()), nType, nVersion); ss >> me.mapValue; me._ssExtra = std::vector(ss.begin(), ss.end()); } @@ -1007,7 +1034,9 @@ public: me.strComment.erase(nSepPos); me.mapValue.erase("n"); - ) + + return nSerSize; + } private: std::vector _ssExtra; diff --git a/src/walletdb.h b/src/walletdb.h index 58b4571b16..e14c137ba8 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -55,11 +55,15 @@ public: } IMPLEMENT_SERIALIZE - ( - READWRITE(this->nVersion); - nVersion = this->nVersion; - READWRITE(nCreateTime); - ) + + template + inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + size_t nSerSize = 0; + READWRITE(thisPtr->nVersion); + nVersion = thisPtr->nVersion; + READWRITE(thisPtr->nCreateTime); + return nSerSize; + } void SetNull() { From 5d96b4ae0188fcad36105642c5d69249d37fdbb5 Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Wed, 20 Aug 2014 18:09:29 +0200 Subject: [PATCH 0625/1288] remove fields of ser_streamplaceholder The nType and nVersion fields of stream objects are never accessed from outside the class (or perhaps from the inside too, I haven't checked). Thus no need to have them in a placeholder, whose only purpose is to fill the "Stream" template parameter in serialization implementation. --- src/serialize.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/serialize.h b/src/serialize.h index 7e0ecc2edf..c0666d30a5 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -97,8 +97,6 @@ enum #define IMPLEMENT_SERIALIZE \ size_t GetSerializeSize(int nType, int nVersion) const { \ ser_streamplaceholder s; \ - s.nType = nType; \ - s.nVersion = nVersion; \ return SerializationOp(MAKE_CONST(this), s, CSerActionGetSerializeSize(), nType, nVersion); \ } \ template \ @@ -835,13 +833,7 @@ inline unsigned int SerReadWrite(Stream& s, T& obj, int nType, int nVersion, CSe return 0; } -struct ser_streamplaceholder -{ - int nType; - int nVersion; -}; - - +struct ser_streamplaceholder { }; From 84881f8c472cc67dc757686eb7dc3b495b13cab8 Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Wed, 20 Aug 2014 22:44:38 +0200 Subject: [PATCH 0626/1288] rework overhauled serialization methods to non-static Thanks to Pieter Wuille for most of the work on this commit. I did not fixup the overhaul commit, because a rebase conflicted with "remove fields of ser_streamplaceholder". I prefer not to risk making a mistake while resolving it. --- src/addrman.h | 14 ++-- src/alert.h | 44 +++++----- src/bloom.h | 14 ++-- src/core.h | 130 +++++++++++++++--------------- src/crypter.h | 16 ++-- src/main.h | 112 ++++++++++++------------- src/netbase.h | 20 ++--- src/protocol.h | 36 ++++----- src/qt/recentrequeststablemodel.h | 14 ++-- src/qt/walletmodel.h | 10 +-- src/serialize.h | 14 ++-- src/wallet.h | 102 +++++++++++------------ src/walletdb.h | 12 +-- 13 files changed, 269 insertions(+), 269 deletions(-) diff --git a/src/addrman.h b/src/addrman.h index 4287cbc1b3..05af436aeb 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -46,16 +46,16 @@ private: public: - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - CAddress* pthis = (CAddress*)(thisPtr); + CAddress* pthis = (CAddress*)(this); READWRITE(*pthis); - READWRITE(thisPtr->source); - READWRITE(thisPtr->nLastSuccess); - READWRITE(thisPtr->nAttempts); + READWRITE(source); + READWRITE(nLastSuccess); + READWRITE(nAttempts); return nSerSize; } diff --git a/src/alert.h b/src/alert.h index 4c8267fd06..46ec4fbde0 100644 --- a/src/alert.h +++ b/src/alert.h @@ -46,26 +46,26 @@ public: std::string strStatusBar; std::string strReserved; - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(thisPtr->nVersion); - nVersion = thisPtr->nVersion; - READWRITE(thisPtr->nRelayUntil); - READWRITE(thisPtr->nExpiration); - READWRITE(thisPtr->nID); - READWRITE(thisPtr->nCancel); - READWRITE(thisPtr->setCancel); - READWRITE(thisPtr->nMinVer); - READWRITE(thisPtr->nMaxVer); - READWRITE(thisPtr->setSubVer); - READWRITE(thisPtr->nPriority); + READWRITE(this->nVersion); + nVersion = this->nVersion; + READWRITE(nRelayUntil); + READWRITE(nExpiration); + READWRITE(nID); + READWRITE(nCancel); + READWRITE(setCancel); + READWRITE(nMinVer); + READWRITE(nMaxVer); + READWRITE(setSubVer); + READWRITE(nPriority); - READWRITE(LIMITED_STRING(thisPtr->strComment, 65536)); - READWRITE(LIMITED_STRING(thisPtr->strStatusBar, 256)); - READWRITE(LIMITED_STRING(thisPtr->strReserved, 256)); + READWRITE(LIMITED_STRING(strComment, 65536)); + READWRITE(LIMITED_STRING(strStatusBar, 256)); + READWRITE(LIMITED_STRING(strReserved, 256)); return nSerSize; } @@ -86,13 +86,13 @@ public: SetNull(); } - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(thisPtr->vchMsg); - READWRITE(thisPtr->vchSig); + READWRITE(vchMsg); + READWRITE(vchSig); return nSerSize; } diff --git a/src/bloom.h b/src/bloom.h index dafea67029..8dbf74f494 100644 --- a/src/bloom.h +++ b/src/bloom.h @@ -62,15 +62,15 @@ public: CBloomFilter(unsigned int nElements, double nFPRate, unsigned int nTweak, unsigned char nFlagsIn); CBloomFilter() : isFull(true), isEmpty(false), nHashFuncs(0), nTweak(0), nFlags(0) {} - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(thisPtr->vData); - READWRITE(thisPtr->nHashFuncs); - READWRITE(thisPtr->nTweak); - READWRITE(thisPtr->nFlags); + READWRITE(vData); + READWRITE(nHashFuncs); + READWRITE(nTweak); + READWRITE(nFlags); return nSerSize; } diff --git a/src/core.h b/src/core.h index 1caf9da6c0..e56be1a4ec 100644 --- a/src/core.h +++ b/src/core.h @@ -31,12 +31,12 @@ public: COutPoint() { SetNull(); } COutPoint(uint256 hashIn, uint32_t nIn) { hash = hashIn; n = nIn; } - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(FLATDATA(*thisPtr)); + READWRITE(FLATDATA(*this)); return nSerSize; } @@ -93,14 +93,14 @@ public: explicit CTxIn(COutPoint prevoutIn, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=std::numeric_limits::max()); CTxIn(uint256 hashPrevTx, uint32_t nOut, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=std::numeric_limits::max()); - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(thisPtr->prevout); - READWRITE(thisPtr->scriptSig); - READWRITE(thisPtr->nSequence); + READWRITE(prevout); + READWRITE(scriptSig); + READWRITE(nSequence); return nSerSize; } @@ -149,12 +149,12 @@ public: friend bool operator>=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK >= b.nSatoshisPerK; } std::string ToString() const; - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(thisPtr->nSatoshisPerK); + READWRITE(nSatoshisPerK); return nSerSize; } }; @@ -176,13 +176,13 @@ public: CTxOut(int64_t nValueIn, CScript scriptPubKeyIn); - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(thisPtr->nValue); - READWRITE(thisPtr->scriptPubKey); + READWRITE(nValue); + READWRITE(scriptPubKey); return nSerSize; } @@ -261,20 +261,20 @@ public: CTransaction& operator=(const CTransaction& tx); - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; bool fRead = boost::is_same(); - READWRITE(*const_cast(&thisPtr->nVersion)); - nVersion = thisPtr->nVersion; - READWRITE(*const_cast*>(&thisPtr->vin)); - READWRITE(*const_cast*>(&thisPtr->vout)); - READWRITE(*const_cast(&thisPtr->nLockTime)); + READWRITE(*const_cast(&this->nVersion)); + nVersion = this->nVersion; + READWRITE(*const_cast*>(&vin)); + READWRITE(*const_cast*>(&vout)); + READWRITE(*const_cast(&nLockTime)); if (fRead) - thisPtr->UpdateHash(); + UpdateHash(); return nSerSize; } @@ -324,17 +324,17 @@ struct CMutableTransaction CMutableTransaction(); CMutableTransaction(const CTransaction& tx); - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(thisPtr->nVersion); - nVersion = thisPtr->nVersion; - READWRITE(thisPtr->vin); - READWRITE(thisPtr->vout); - READWRITE(thisPtr->nLockTime); + READWRITE(this->nVersion); + nVersion = this->nVersion; + READWRITE(vin); + READWRITE(vout); + READWRITE(nLockTime); return nSerSize; } @@ -357,21 +357,21 @@ public: CTxOutCompressor(CTxOut &txoutIn) : txout(txoutIn) { } - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { bool fRead = boost::is_same(); size_t nSerSize = 0; if (!fRead) { - uint64_t nVal = CompressAmount(thisPtr->txout.nValue); + uint64_t nVal = CompressAmount(txout.nValue); READWRITE(VARINT(nVal)); } else { uint64_t nVal = 0; READWRITE(VARINT(nVal)); - thisPtr->txout.nValue = DecompressAmount(nVal); + txout.nValue = DecompressAmount(nVal); } - CScriptCompressor cscript(REF(thisPtr->txout.scriptPubKey)); + CScriptCompressor cscript(REF(txout.scriptPubKey)); READWRITE(cscript); return nSerSize; } @@ -427,12 +427,12 @@ public: // undo information for all txins std::vector vprevout; - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(thisPtr->vprevout); + READWRITE(vprevout); return nSerSize; } }; @@ -462,19 +462,19 @@ public: SetNull(); } - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(thisPtr->nVersion); - nVersion = thisPtr->nVersion; - READWRITE(thisPtr->hashPrevBlock); - READWRITE(thisPtr->hashMerkleRoot); - READWRITE(thisPtr->nTime); - READWRITE(thisPtr->nBits); - READWRITE(thisPtr->nNonce); + READWRITE(this->nVersion); + nVersion = this->nVersion; + READWRITE(hashPrevBlock); + READWRITE(hashMerkleRoot); + READWRITE(nTime); + READWRITE(nBits); + READWRITE(nNonce); return nSerSize; } @@ -523,14 +523,14 @@ public: *((CBlockHeader*)this) = header; } - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(*(CBlockHeader*)thisPtr); - READWRITE(thisPtr->vtx); + READWRITE(*(CBlockHeader*)this); + READWRITE(vtx); return nSerSize; } @@ -577,15 +577,15 @@ struct CBlockLocator vHave = vHaveIn; } - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; if (!(nType & SER_GETHASH)) READWRITE(nVersion); - READWRITE(thisPtr->vHave); + READWRITE(vHave); return nSerSize; } diff --git a/src/crypter.h b/src/crypter.h index c3f4ed971c..ce4c6315aa 100644 --- a/src/crypter.h +++ b/src/crypter.h @@ -43,16 +43,16 @@ public: // such as the various parameters to scrypt std::vector vchOtherDerivationParameters; - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(thisPtr->vchCryptedKey); - READWRITE(thisPtr->vchSalt); - READWRITE(thisPtr->nDerivationMethod); - READWRITE(thisPtr->nDeriveIterations); - READWRITE(thisPtr->vchOtherDerivationParameters); + READWRITE(vchCryptedKey); + READWRITE(vchSalt); + READWRITE(nDerivationMethod); + READWRITE(nDeriveIterations); + READWRITE(vchOtherDerivationParameters); return nSerSize; } diff --git a/src/main.h b/src/main.h index 88e3159e3f..8a5fa0e7e0 100644 --- a/src/main.h +++ b/src/main.h @@ -197,13 +197,13 @@ struct CDiskBlockPos int nFile; unsigned int nPos; - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(VARINT(thisPtr->nFile)); - READWRITE(VARINT(thisPtr->nPos)); + READWRITE(VARINT(nFile)); + READWRITE(VARINT(nPos)); return nSerSize; } @@ -232,13 +232,13 @@ struct CDiskTxPos : public CDiskBlockPos { unsigned int nTxOffset; // after header - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(*(CDiskBlockPos*)thisPtr); - READWRITE(VARINT(thisPtr->nTxOffset)); + READWRITE(*(CDiskBlockPos*)this); + READWRITE(VARINT(nTxOffset)); return nSerSize; } @@ -317,12 +317,12 @@ class CBlockUndo public: std::vector vtxundo; // for all but the coinbase - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(thisPtr->vtxundo); + READWRITE(vtxundo); return nSerSize; } @@ -426,27 +426,27 @@ protected: public: // serialization implementation - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; bool fRead = boost::is_same(); - READWRITE(thisPtr->nTransactions); - READWRITE(thisPtr->vHash); + READWRITE(nTransactions); + READWRITE(vHash); std::vector vBytes; if (fRead) { READWRITE(vBytes); - CPartialMerkleTree &us = *(const_cast(thisPtr)); + CPartialMerkleTree &us = *(const_cast(this)); us.vBits.resize(vBytes.size() * 8); for (unsigned int p = 0; p < us.vBits.size(); p++) us.vBits[p] = (vBytes[p / 8] & (1 << (p % 8))) != 0; us.fBad = false; } else { - vBytes.resize((thisPtr->vBits.size()+7)/8); - for (unsigned int p = 0; p < thisPtr->vBits.size(); p++) - vBytes[p / 8] |= thisPtr->vBits[p] << (p % 8); + vBytes.resize((vBits.size()+7)/8); + for (unsigned int p = 0; p < vBits.size(); p++) + vBytes[p / 8] |= vBits[p] << (p % 8); READWRITE(vBytes); } @@ -507,19 +507,19 @@ public: uint64_t nTimeFirst; // earliest time of block in file uint64_t nTimeLast; // latest time of block in file - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(VARINT(thisPtr->nBlocks)); - READWRITE(VARINT(thisPtr->nSize)); - READWRITE(VARINT(thisPtr->nUndoSize)); - READWRITE(VARINT(thisPtr->nHeightFirst)); - READWRITE(VARINT(thisPtr->nHeightLast)); - READWRITE(VARINT(thisPtr->nTimeFirst)); - READWRITE(VARINT(thisPtr->nTimeLast)); + READWRITE(VARINT(nBlocks)); + READWRITE(VARINT(nSize)); + READWRITE(VARINT(nUndoSize)); + READWRITE(VARINT(nHeightFirst)); + READWRITE(VARINT(nHeightLast)); + READWRITE(VARINT(nTimeFirst)); + READWRITE(VARINT(nTimeLast)); return nSerSize; } @@ -785,32 +785,32 @@ public: hashPrev = (pprev ? pprev->GetBlockHash() : 0); } - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; if (!(nType & SER_GETHASH)) READWRITE(VARINT(nVersion)); - READWRITE(VARINT(thisPtr->nHeight)); - READWRITE(VARINT(thisPtr->nStatus)); - READWRITE(VARINT(thisPtr->nTx)); - if (thisPtr->nStatus & (BLOCK_HAVE_DATA | BLOCK_HAVE_UNDO)) - READWRITE(VARINT(thisPtr->nFile)); - if (thisPtr->nStatus & BLOCK_HAVE_DATA) - READWRITE(VARINT(thisPtr->nDataPos)); - if (thisPtr->nStatus & BLOCK_HAVE_UNDO) - READWRITE(VARINT(thisPtr->nUndoPos)); + READWRITE(VARINT(nHeight)); + READWRITE(VARINT(nStatus)); + READWRITE(VARINT(nTx)); + if (nStatus & (BLOCK_HAVE_DATA | BLOCK_HAVE_UNDO)) + READWRITE(VARINT(nFile)); + if (nStatus & BLOCK_HAVE_DATA) + READWRITE(VARINT(nDataPos)); + if (nStatus & BLOCK_HAVE_UNDO) + READWRITE(VARINT(nUndoPos)); // block header - READWRITE(thisPtr->nVersion); - READWRITE(thisPtr->hashPrev); - READWRITE(thisPtr->hashMerkleRoot); - READWRITE(thisPtr->nTime); - READWRITE(thisPtr->nBits); - READWRITE(thisPtr->nNonce); + READWRITE(this->nVersion); + READWRITE(hashPrev); + READWRITE(hashMerkleRoot); + READWRITE(nTime); + READWRITE(nBits); + READWRITE(nNonce); return nSerSize; } @@ -1011,13 +1011,13 @@ public: // thus the filter will likely be modified. CMerkleBlock(const CBlock& block, CBloomFilter& filter); - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(thisPtr->header); - READWRITE(thisPtr->txn); + READWRITE(header); + READWRITE(txn); return nSerSize; } }; diff --git a/src/netbase.h b/src/netbase.h index 6f8c132502..b4ba711261 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -88,12 +88,12 @@ class CNetAddr friend bool operator!=(const CNetAddr& a, const CNetAddr& b); friend bool operator<(const CNetAddr& a, const CNetAddr& b); - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(FLATDATA(thisPtr->ip)); + READWRITE(FLATDATA(ip)); return nSerSize; } }; @@ -152,15 +152,15 @@ class CService : public CNetAddr CService(const struct in6_addr& ipv6Addr, unsigned short port); CService(const struct sockaddr_in6& addr); - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { bool fRead = boost::is_same(); size_t nSerSize = 0; - CService* pthis = const_cast(thisPtr); - READWRITE(FLATDATA(thisPtr->ip)); - unsigned short portN = htons(thisPtr->port); + CService* pthis = const_cast(this); + READWRITE(FLATDATA(ip)); + unsigned short portN = htons(port); READWRITE(portN); if (fRead) pthis->port = ntohs(portN); diff --git a/src/protocol.h b/src/protocol.h index 851fca9d9e..0f5c5559d1 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -35,15 +35,15 @@ class CMessageHeader std::string GetCommand() const; bool IsValid() const; - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(FLATDATA(thisPtr->pchMessageStart)); - READWRITE(FLATDATA(thisPtr->pchCommand)); - READWRITE(thisPtr->nMessageSize); - READWRITE(thisPtr->nChecksum); + READWRITE(FLATDATA(pchMessageStart)); + READWRITE(FLATDATA(pchCommand)); + READWRITE(nMessageSize); + READWRITE(nChecksum); return nSerSize; } @@ -87,14 +87,14 @@ class CAddress : public CService void Init(); - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; bool fRead = boost::is_same(); - CAddress* pthis = const_cast(thisPtr); + CAddress* pthis = const_cast(this); CService* pip = (CService*)pthis; if (fRead) pthis->Init(); @@ -102,8 +102,8 @@ class CAddress : public CService READWRITE(nVersion); if ((nType & SER_DISK) || (nVersion >= CADDR_TIME_VERSION && !(nType & SER_GETHASH))) - READWRITE(thisPtr->nTime); - READWRITE(thisPtr->nServices); + READWRITE(nTime); + READWRITE(nServices); READWRITE(*pip); return nSerSize; @@ -128,13 +128,13 @@ class CInv CInv(int typeIn, const uint256& hashIn); CInv(const std::string& strType, const uint256& hashIn); - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(thisPtr->type); - READWRITE(thisPtr->hash); + READWRITE(type); + READWRITE(hash); return nSerSize; } diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h index 50962334f5..581d7b2c5e 100644 --- a/src/qt/recentrequeststablemodel.h +++ b/src/qt/recentrequeststablemodel.h @@ -24,22 +24,22 @@ public: QDateTime date; SendCoinsRecipient recipient; - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; bool fRead = boost::is_same(); - RecentRequestEntry* pthis = const_cast(thisPtr); + RecentRequestEntry* pthis = const_cast(this); - unsigned int nDate = thisPtr->date.toTime_t(); + unsigned int nDate = date.toTime_t(); READWRITE(pthis->nVersion); nVersion = pthis->nVersion; - READWRITE(thisPtr->id); + READWRITE(id); READWRITE(nDate); - READWRITE(thisPtr->recipient); + READWRITE(recipient); if (fRead) pthis->date = QDateTime::fromTime_t(nDate); diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 543843733c..553b566544 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -59,14 +59,14 @@ public: static const int CURRENT_VERSION = 1; int nVersion; - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; bool fRead = boost::is_same(); - SendCoinsRecipient* pthis = const_cast(thisPtr); + SendCoinsRecipient* pthis = const_cast(this); std::string sAddress = pthis->address.toStdString(); std::string sLabel = pthis->label.toStdString(); @@ -80,7 +80,7 @@ public: nVersion = pthis->nVersion; READWRITE(sAddress); READWRITE(sLabel); - READWRITE(thisPtr->amount); + READWRITE(amount); READWRITE(sMessage); READWRITE(sPaymentRequest); READWRITE(sAuthenticatedMerchant); diff --git a/src/serialize.h b/src/serialize.h index c0666d30a5..6eefa18135 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -38,12 +38,12 @@ inline T& REF(const T& val) return const_cast(val); } -// Used to acquire a const pointer "this" and generate a const -// serialization operation from a template +// Used to acquire a non-const pointer "this" to generate bodies +// of const serialization operations from a template template -inline T MAKE_CONST(T val) +inline T* NCONST_PTR(const T* val) { - return const_cast(val); + return const_cast(val); } /** Get begin pointer of vector (non-const version). @@ -97,15 +97,15 @@ enum #define IMPLEMENT_SERIALIZE \ size_t GetSerializeSize(int nType, int nVersion) const { \ ser_streamplaceholder s; \ - return SerializationOp(MAKE_CONST(this), s, CSerActionGetSerializeSize(), nType, nVersion); \ + return NCONST_PTR(this)->SerializationOp(s, CSerActionGetSerializeSize(), nType, nVersion); \ } \ template \ void Serialize(Stream& s, int nType, int nVersion) const { \ - SerializationOp(MAKE_CONST(this), s, CSerActionSerialize(), nType, nVersion); \ + NCONST_PTR(this)->SerializationOp(s, CSerActionSerialize(), nType, nVersion); \ } \ template \ void Unserialize(Stream& s, int nType, int nVersion) { \ - SerializationOp(this, s, CSerActionUnserialize(), nType, nVersion); \ + SerializationOp(s, CSerActionUnserialize(), nType, nVersion); \ } diff --git a/src/wallet.h b/src/wallet.h index 36b0bafe5a..d30a28218f 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -63,15 +63,15 @@ public: CKeyPool(); CKeyPool(const CPubKey& vchPubKeyIn); - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; if (!(nType & SER_GETHASH)) READWRITE(nVersion); - READWRITE(thisPtr->nTime); - READWRITE(thisPtr->vchPubKey); + READWRITE(nTime); + READWRITE(vchPubKey); return nSerSize; } }; @@ -493,17 +493,17 @@ public: fMerkleVerified = false; } - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - nSerSize += SerReadWrite(s, *(CTransaction*)thisPtr, nType, nVersion, ser_action); - nVersion = thisPtr->nVersion; - READWRITE(thisPtr->hashBlock); - READWRITE(thisPtr->vMerkleBranch); - READWRITE(thisPtr->nIndex); + nSerSize += SerReadWrite(s, *(CTransaction*)this, nType, nVersion, ser_action); + nVersion = this->nVersion; + READWRITE(hashBlock); + READWRITE(vMerkleBranch); + READWRITE(nIndex); return nSerSize; } @@ -610,14 +610,14 @@ public: nOrderPos = -1; } - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; bool fRead = boost::is_same(); - CWalletTx* pthis = const_cast(thisPtr); + CWalletTx* pthis = const_cast(this); if (fRead) pthis->Init(NULL); char fSpent = false; @@ -628,18 +628,18 @@ public: WriteOrderPos(pthis->nOrderPos, pthis->mapValue); - if (thisPtr->nTimeSmart) - pthis->mapValue["timesmart"] = strprintf("%u", thisPtr->nTimeSmart); + if (nTimeSmart) + pthis->mapValue["timesmart"] = strprintf("%u", nTimeSmart); } - nSerSize += SerReadWrite(s, *(CMerkleTx*)thisPtr, nType, nVersion,ser_action); + nSerSize += SerReadWrite(s, *(CMerkleTx*)this, nType, nVersion,ser_action); std::vector vUnused; // Used to be vtxPrev READWRITE(vUnused); - READWRITE(thisPtr->mapValue); - READWRITE(thisPtr->vOrderForm); - READWRITE(thisPtr->fTimeReceivedIsTxTime); - READWRITE(thisPtr->nTimeReceived); - READWRITE(thisPtr->fFromMe); + READWRITE(mapValue); + READWRITE(vOrderForm); + READWRITE(fTimeReceivedIsTxTime); + READWRITE(nTimeReceived); + READWRITE(fFromMe); READWRITE(fSpent); if (fRead) @@ -648,7 +648,7 @@ public: ReadOrderPos(pthis->nOrderPos, pthis->mapValue); - pthis->nTimeSmart = thisPtr->mapValue.count("timesmart") ? (unsigned int)atoi64(pthis->mapValue["timesmart"]) : 0; + pthis->nTimeSmart = mapValue.count("timesmart") ? (unsigned int)atoi64(pthis->mapValue["timesmart"]) : 0; } pthis->mapValue.erase("fromaccount"); @@ -904,17 +904,17 @@ public: CWalletKey(int64_t nExpires=0); - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; if (!(nType & SER_GETHASH)) READWRITE(nVersion); - READWRITE(thisPtr->vchPrivKey); - READWRITE(thisPtr->nTimeCreated); - READWRITE(thisPtr->nTimeExpires); - READWRITE(LIMITED_STRING(thisPtr->strComment, 65536)); + READWRITE(vchPrivKey); + READWRITE(nTimeCreated); + READWRITE(nTimeExpires); + READWRITE(LIMITED_STRING(strComment, 65536)); return nSerSize; } }; @@ -942,14 +942,14 @@ public: vchPubKey = CPubKey(); } - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; if (!(nType & SER_GETHASH)) READWRITE(nVersion); - READWRITE(thisPtr->vchPubKey); + READWRITE(vchPubKey); return nSerSize; } }; @@ -987,44 +987,44 @@ public: nEntryNo = 0; } - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; bool fRead = boost::is_same(); - CAccountingEntry& me = *const_cast(thisPtr); + CAccountingEntry& me = *const_cast(this); if (!(nType & SER_GETHASH)) READWRITE(nVersion); // Note: strAccount is serialized as part of the key, not here. - READWRITE(thisPtr->nCreditDebit); - READWRITE(thisPtr->nTime); - READWRITE(LIMITED_STRING(thisPtr->strOtherAccount, 65536)); + READWRITE(nCreditDebit); + READWRITE(nTime); + READWRITE(LIMITED_STRING(strOtherAccount, 65536)); if (!fRead) { - WriteOrderPos(thisPtr->nOrderPos, me.mapValue); + WriteOrderPos(nOrderPos, me.mapValue); - if (!(thisPtr->mapValue.empty() && thisPtr->_ssExtra.empty())) + if (!(mapValue.empty() && _ssExtra.empty())) { CDataStream ss(nType, nVersion); ss.insert(ss.begin(), '\0'); - ss << thisPtr->mapValue; - ss.insert(ss.end(), thisPtr->_ssExtra.begin(), thisPtr->_ssExtra.end()); + ss << mapValue; + ss.insert(ss.end(), _ssExtra.begin(), _ssExtra.end()); me.strComment.append(ss.str()); } } - READWRITE(LIMITED_STRING(thisPtr->strComment, 65536)); + READWRITE(LIMITED_STRING(strComment, 65536)); - size_t nSepPos = thisPtr->strComment.find("\0", 0, 1); + size_t nSepPos = strComment.find("\0", 0, 1); if (fRead) { me.mapValue.clear(); if (std::string::npos != nSepPos) { - CDataStream ss(std::vector(thisPtr->strComment.begin() + nSepPos + 1, thisPtr->strComment.end()), nType, nVersion); + CDataStream ss(std::vector(strComment.begin() + nSepPos + 1, strComment.end()), nType, nVersion); ss >> me.mapValue; me._ssExtra = std::vector(ss.begin(), ss.end()); } diff --git a/src/walletdb.h b/src/walletdb.h index e14c137ba8..2dd257c2c1 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -54,14 +54,14 @@ public: nCreateTime = nCreateTime_; } - IMPLEMENT_SERIALIZE + IMPLEMENT_SERIALIZE; - template - inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { + template + inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; - READWRITE(thisPtr->nVersion); - nVersion = thisPtr->nVersion; - READWRITE(thisPtr->nCreateTime); + READWRITE(this->nVersion); + nVersion = this->nVersion; + READWRITE(nCreateTime); return nSerSize; } From 31e9a8384a77947f6777d035992f4734618ed206 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 21 Aug 2014 00:49:32 +0200 Subject: [PATCH 0627/1288] Use CSizeComputer to avoid counting sizes in SerializationOp --- src/addrman.h | 7 ++-- src/alert.h | 8 ++--- src/bloom.h | 4 +-- src/core.h | 57 +++++++------------------------ src/crypter.h | 4 +-- src/main.h | 35 +++++-------------- src/netbase.h | 13 +++---- src/protocol.h | 18 +++------- src/qt/recentrequeststablemodel.h | 9 ++--- src/qt/walletmodel.h | 7 ++-- src/serialize.h | 51 +++++++++++++-------------- src/wallet.h | 48 +++++++++----------------- src/walletdb.h | 4 +-- 13 files changed, 81 insertions(+), 184 deletions(-) diff --git a/src/addrman.h b/src/addrman.h index 05af436aeb..2b6e45664c 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -49,14 +49,11 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; - CAddress* pthis = (CAddress*)(this); - READWRITE(*pthis); + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + READWRITE(*(CAddress*)this); READWRITE(source); READWRITE(nLastSuccess); READWRITE(nAttempts); - return nSerSize; } void Init() diff --git a/src/alert.h b/src/alert.h index 46ec4fbde0..b25ac41f6b 100644 --- a/src/alert.h +++ b/src/alert.h @@ -49,8 +49,7 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(this->nVersion); nVersion = this->nVersion; READWRITE(nRelayUntil); @@ -66,7 +65,6 @@ public: READWRITE(LIMITED_STRING(strComment, 65536)); READWRITE(LIMITED_STRING(strStatusBar, 256)); READWRITE(LIMITED_STRING(strReserved, 256)); - return nSerSize; } void SetNull(); @@ -89,11 +87,9 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(vchMsg); READWRITE(vchSig); - return nSerSize; } void SetNull(); diff --git a/src/bloom.h b/src/bloom.h index 8dbf74f494..a5269d08d4 100644 --- a/src/bloom.h +++ b/src/bloom.h @@ -65,13 +65,11 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(vData); READWRITE(nHashFuncs); READWRITE(nTweak); READWRITE(nFlags); - return nSerSize; } void insert(const std::vector& vKey); diff --git a/src/core.h b/src/core.h index e56be1a4ec..486782e5b7 100644 --- a/src/core.h +++ b/src/core.h @@ -34,10 +34,8 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(FLATDATA(*this)); - return nSerSize; } void SetNull() { hash = 0; n = (uint32_t) -1; } @@ -96,12 +94,10 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(prevout); READWRITE(scriptSig); READWRITE(nSequence); - return nSerSize; } bool IsFinal() const @@ -152,10 +148,8 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(nSatoshisPerK); - return nSerSize; } }; @@ -179,11 +173,9 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(nValue); READWRITE(scriptPubKey); - return nSerSize; } void SetNull() @@ -264,9 +256,8 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; - bool fRead = boost::is_same(); + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + bool fRead = ser_action.ForRead(); READWRITE(*const_cast(&this->nVersion)); nVersion = this->nVersion; @@ -275,8 +266,6 @@ public: READWRITE(*const_cast(&nLockTime)); if (fRead) UpdateHash(); - - return nSerSize; } bool IsNull() const { @@ -327,16 +316,12 @@ struct CMutableTransaction IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; - + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(this->nVersion); nVersion = this->nVersion; READWRITE(vin); READWRITE(vout); READWRITE(nLockTime); - - return nSerSize; } /** Compute the hash of this CMutableTransaction. This is computed on the @@ -360,9 +345,8 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = boost::is_same(); - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + bool fRead = ser_action.ForRead(); if (!fRead) { uint64_t nVal = CompressAmount(txout.nValue); READWRITE(VARINT(nVal)); @@ -373,7 +357,6 @@ public: } CScriptCompressor cscript(REF(txout.scriptPubKey)); READWRITE(cscript); - return nSerSize; } }; @@ -430,10 +413,8 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(vprevout); - return nSerSize; } }; @@ -465,9 +446,7 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; - + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(this->nVersion); nVersion = this->nVersion; READWRITE(hashPrevBlock); @@ -475,8 +454,6 @@ public: READWRITE(nTime); READWRITE(nBits); READWRITE(nNonce); - - return nSerSize; } void SetNull() @@ -526,13 +503,9 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; - + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(*(CBlockHeader*)this); READWRITE(vtx); - - return nSerSize; } void SetNull() @@ -580,14 +553,10 @@ struct CBlockLocator IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; - + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { if (!(nType & SER_GETHASH)) READWRITE(nVersion); READWRITE(vHave); - - return nSerSize; } void SetNull() diff --git a/src/crypter.h b/src/crypter.h index ce4c6315aa..b00f92721c 100644 --- a/src/crypter.h +++ b/src/crypter.h @@ -46,14 +46,12 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(vchCryptedKey); READWRITE(vchSalt); READWRITE(nDerivationMethod); READWRITE(nDeriveIterations); READWRITE(vchOtherDerivationParameters); - return nSerSize; } CMasterKey() diff --git a/src/main.h b/src/main.h index 8a5fa0e7e0..cea8a649e3 100644 --- a/src/main.h +++ b/src/main.h @@ -200,11 +200,9 @@ struct CDiskBlockPos IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(VARINT(nFile)); READWRITE(VARINT(nPos)); - return nSerSize; } CDiskBlockPos() { @@ -235,11 +233,9 @@ struct CDiskTxPos : public CDiskBlockPos IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(*(CDiskBlockPos*)this); READWRITE(VARINT(nTxOffset)); - return nSerSize; } CDiskTxPos(const CDiskBlockPos &blockIn, unsigned int nTxOffsetIn) : CDiskBlockPos(blockIn.nFile, blockIn.nPos), nTxOffset(nTxOffsetIn) { @@ -320,10 +316,8 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(vtxundo); - return nSerSize; } bool WriteToDisk(CDiskBlockPos &pos, const uint256 &hashBlock); @@ -429,9 +423,8 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; - bool fRead = boost::is_same(); + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + bool fRead = ser_action.ForRead(); READWRITE(nTransactions); READWRITE(vHash); @@ -449,8 +442,6 @@ public: vBytes[p / 8] |= vBits[p] << (p % 8); READWRITE(vBytes); } - - return nSerSize; } // Construct a partial merkle tree from a list of transaction id's, and a mask that selects a subset of them @@ -510,9 +501,7 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; - + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(VARINT(nBlocks)); READWRITE(VARINT(nSize)); READWRITE(VARINT(nUndoSize)); @@ -520,8 +509,6 @@ public: READWRITE(VARINT(nHeightLast)); READWRITE(VARINT(nTimeFirst)); READWRITE(VARINT(nTimeLast)); - - return nSerSize; } void SetNull() { @@ -788,9 +775,7 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; - + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { if (!(nType & SER_GETHASH)) READWRITE(VARINT(nVersion)); @@ -811,8 +796,6 @@ public: READWRITE(nTime); READWRITE(nBits); READWRITE(nNonce); - - return nSerSize; } uint256 GetBlockHash() const @@ -1014,11 +997,9 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(header); READWRITE(txn); - return nSerSize; } }; diff --git a/src/netbase.h b/src/netbase.h index b4ba711261..1ea37519a6 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -91,10 +91,8 @@ class CNetAddr IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(FLATDATA(ip)); - return nSerSize; } }; @@ -155,16 +153,13 @@ class CService : public CNetAddr IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = boost::is_same(); - size_t nSerSize = 0; - CService* pthis = const_cast(this); + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + bool fRead = ser_action.ForRead(); READWRITE(FLATDATA(ip)); unsigned short portN = htons(port); READWRITE(portN); if (fRead) - pthis->port = ntohs(portN); - return nSerSize; + port = ntohs(portN); } }; diff --git a/src/protocol.h b/src/protocol.h index 0f5c5559d1..e4b0991774 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -38,13 +38,11 @@ class CMessageHeader IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(FLATDATA(pchMessageStart)); READWRITE(FLATDATA(pchCommand)); READWRITE(nMessageSize); READWRITE(nChecksum); - return nSerSize; } // TODO: make private (improves encapsulation) @@ -90,12 +88,10 @@ class CAddress : public CService IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; - bool fRead = boost::is_same(); + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + bool fRead = ser_action.ForRead(); CAddress* pthis = const_cast(this); - CService* pip = (CService*)pthis; if (fRead) pthis->Init(); if (nType & SER_DISK) @@ -104,9 +100,7 @@ class CAddress : public CService (nVersion >= CADDR_TIME_VERSION && !(nType & SER_GETHASH))) READWRITE(nTime); READWRITE(nServices); - READWRITE(*pip); - - return nSerSize; + READWRITE(*(CService*)this); } // TODO: make private (improves encapsulation) @@ -131,11 +125,9 @@ class CInv IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(type); READWRITE(hash); - return nSerSize; } friend bool operator<(const CInv& a, const CInv& b); diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h index 581d7b2c5e..a558aa4942 100644 --- a/src/qt/recentrequeststablemodel.h +++ b/src/qt/recentrequeststablemodel.h @@ -27,9 +27,8 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; - bool fRead = boost::is_same(); + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + bool fRead = ser_action.ForRead(); RecentRequestEntry* pthis = const_cast(this); @@ -42,9 +41,7 @@ public: READWRITE(recipient); if (fRead) - pthis->date = QDateTime::fromTime_t(nDate); - - return nSerSize; + date = QDateTime::fromTime_t(nDate); } }; diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 553b566544..2a9ac4650f 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -62,9 +62,8 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; - bool fRead = boost::is_same(); + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + bool fRead = ser_action.ForRead(); SendCoinsRecipient* pthis = const_cast(this); @@ -94,8 +93,6 @@ public: pthis->paymentRequest.parse(QByteArray::fromRawData(sPaymentRequest.data(), sPaymentRequest.size())); pthis->authenticatedMerchant = QString::fromStdString(sAuthenticatedMerchant); } - - return nSerSize; } }; diff --git a/src/serialize.h b/src/serialize.h index 6eefa18135..4e6ca57a49 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -22,7 +22,6 @@ #include #include -#include class CAutoFile; class CDataStream; @@ -88,24 +87,25 @@ enum SER_GETHASH = (1 << 2), }; -#define READWRITE(obj) (nSerSize += ::SerReadWrite(s, (obj), nType, nVersion, ser_action)) +#define READWRITE(obj) (::SerReadWrite(s, (obj), nType, nVersion, ser_action)) /* Implement three methods for serializable objects. These are actually wrappers over * "SerializationOp" template, which implements the body of each class' serialization * code. Adding "IMPLEMENT_SERIALIZE" in the body of the class causes these wrappers to be * added as members. */ -#define IMPLEMENT_SERIALIZE \ - size_t GetSerializeSize(int nType, int nVersion) const { \ - ser_streamplaceholder s; \ - return NCONST_PTR(this)->SerializationOp(s, CSerActionGetSerializeSize(), nType, nVersion); \ - } \ - template \ - void Serialize(Stream& s, int nType, int nVersion) const { \ - NCONST_PTR(this)->SerializationOp(s, CSerActionSerialize(), nType, nVersion); \ - } \ - template \ - void Unserialize(Stream& s, int nType, int nVersion) { \ - SerializationOp(s, CSerActionUnserialize(), nType, nVersion); \ +#define IMPLEMENT_SERIALIZE \ + size_t GetSerializeSize(int nType, int nVersion) const { \ + CSizeComputer s(nType, nVersion); \ + NCONST_PTR(this)->SerializationOp(s, CSerActionSerialize(), nType, nVersion);\ + return s.size(); \ + } \ + template \ + void Serialize(Stream& s, int nType, int nVersion) const { \ + NCONST_PTR(this)->SerializationOp(s, CSerActionSerialize(), nType, nVersion);\ + } \ + template \ + void Unserialize(Stream& s, int nType, int nVersion) { \ + SerializationOp(s, CSerActionUnserialize(), nType, nVersion); \ } @@ -809,32 +809,27 @@ void Unserialize(Stream& is, std::set& m, int nType, int nVersion) // // Support for IMPLEMENT_SERIALIZE and READWRITE macro // -class CSerActionGetSerializeSize { }; -class CSerActionSerialize { }; -class CSerActionUnserialize { }; - -template -inline unsigned int SerReadWrite(Stream& s, const T& obj, int nType, int nVersion, CSerActionGetSerializeSize ser_action) +struct CSerActionSerialize { - return ::GetSerializeSize(obj, nType, nVersion); -} + bool ForRead() const { return false; } +}; +struct CSerActionUnserialize +{ + bool ForRead() const { return true; } +}; template -inline unsigned int SerReadWrite(Stream& s, const T& obj, int nType, int nVersion, CSerActionSerialize ser_action) +inline void SerReadWrite(Stream& s, const T& obj, int nType, int nVersion, CSerActionSerialize ser_action) { ::Serialize(s, obj, nType, nVersion); - return 0; } template -inline unsigned int SerReadWrite(Stream& s, T& obj, int nType, int nVersion, CSerActionUnserialize ser_action) +inline void SerReadWrite(Stream& s, T& obj, int nType, int nVersion, CSerActionUnserialize ser_action) { ::Unserialize(s, obj, nType, nVersion); - return 0; } -struct ser_streamplaceholder { }; - diff --git a/src/wallet.h b/src/wallet.h index d30a28218f..aa811ee584 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -66,13 +66,11 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { if (!(nType & SER_GETHASH)) READWRITE(nVersion); READWRITE(nTime); READWRITE(vchPubKey); - return nSerSize; } }; @@ -496,16 +494,12 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; - - nSerSize += SerReadWrite(s, *(CTransaction*)this, nType, nVersion, ser_action); + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + READWRITE(*(CTransaction*)this); nVersion = this->nVersion; READWRITE(hashBlock); READWRITE(vMerkleBranch); READWRITE(nIndex); - - return nSerSize; } int SetMerkleBranch(const CBlock* pblock=NULL); @@ -613,9 +607,8 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; - bool fRead = boost::is_same(); + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + bool fRead = ser_action.ForRead(); CWalletTx* pthis = const_cast(this); if (fRead) @@ -632,7 +625,7 @@ public: pthis->mapValue["timesmart"] = strprintf("%u", nTimeSmart); } - nSerSize += SerReadWrite(s, *(CMerkleTx*)this, nType, nVersion,ser_action); + READWRITE(*(CMerkleTx*)this); std::vector vUnused; // Used to be vtxPrev READWRITE(vUnused); READWRITE(mapValue); @@ -651,13 +644,11 @@ public: pthis->nTimeSmart = mapValue.count("timesmart") ? (unsigned int)atoi64(pthis->mapValue["timesmart"]) : 0; } - pthis->mapValue.erase("fromaccount"); - pthis->mapValue.erase("version"); - pthis->mapValue.erase("spent"); - pthis->mapValue.erase("n"); - pthis->mapValue.erase("timesmart"); - - return nSerSize; + mapValue.erase("fromaccount"); + mapValue.erase("version"); + mapValue.erase("spent"); + mapValue.erase("n"); + mapValue.erase("timesmart"); } // make sure balances are recalculated @@ -907,15 +898,13 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { if (!(nType & SER_GETHASH)) READWRITE(nVersion); READWRITE(vchPrivKey); READWRITE(nTimeCreated); READWRITE(nTimeExpires); READWRITE(LIMITED_STRING(strComment, 65536)); - return nSerSize; } }; @@ -945,12 +934,10 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { if (!(nType & SER_GETHASH)) READWRITE(nVersion); READWRITE(vchPubKey); - return nSerSize; } }; @@ -990,9 +977,8 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; - bool fRead = boost::is_same(); + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + bool fRead = ser_action.ForRead(); CAccountingEntry& me = *const_cast(this); if (!(nType & SER_GETHASH)) @@ -1033,9 +1019,7 @@ public: if (std::string::npos != nSepPos) me.strComment.erase(nSepPos); - me.mapValue.erase("n"); - - return nSerSize; + mapValue.erase("n"); } private: diff --git a/src/walletdb.h b/src/walletdb.h index 2dd257c2c1..c2f427ae77 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -57,12 +57,10 @@ public: IMPLEMENT_SERIALIZE; template - inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - size_t nSerSize = 0; + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(this->nVersion); nVersion = this->nVersion; READWRITE(nCreateTime); - return nSerSize; } void SetNull() From d920f7dcf876f5bb5c525a55c56028fcf65cbdf1 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 10 Aug 2014 18:01:55 +0200 Subject: [PATCH 0628/1288] Move g_signals.SetBestChain(..) below SyncWithWallets --- src/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index da00b4b531..e206071910 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1773,11 +1773,6 @@ bool static WriteChainState(CValidationState &state) { void static UpdateTip(CBlockIndex *pindexNew) { chainActive.SetTip(pindexNew); - // Update best block in wallet (so we can detect restored wallets) - bool fIsInitialDownload = IsInitialBlockDownload(); - if ((chainActive.Height() % 20160) == 0 || (!fIsInitialDownload && (chainActive.Height() % 144) == 0)) - g_signals.SetBestChain(chainActive.GetLocator()); - // New best block nTimeBestReceived = GetTime(); mempool.AddTransactionsUpdated(1); @@ -1790,7 +1785,7 @@ void static UpdateTip(CBlockIndex *pindexNew) { cvBlockChange.notify_all(); // Check the version of the last 100 blocks to see if we need to upgrade: - if (!fIsInitialDownload) + if (!IsInitialBlockDownload()) { int nUpgraded = 0; const CBlockIndex* pindex = chainActive.Tip(); @@ -1907,6 +1902,11 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock * BOOST_FOREACH(const CTransaction &tx, pblock->vtx) { SyncWithWallets(tx, pblock); } + // Update best block in wallet (so we can detect restored wallets) + // Emit this signal after the SyncWithWallets signals as the wallet relies on that everything up to this point has been synced + if ((chainActive.Height() % 20160) == 0 || ((chainActive.Height() % 144) == 0 && !IsInitialBlockDownload())) + g_signals.SetBestChain(chainActive.GetLocator()); + int64_t nTime6 = GetTimeMicros(); nTimePostConnect += nTime6 - nTime5; nTimeTotal += nTime6 - nTime1; LogPrint("bench", " - Connect postprocess: %.2fms [%.2fs]\n", (nTime6 - nTime5) * 0.001, nTimePostConnect * 0.000001); LogPrint("bench", "- Connect block: %.2fms [%.2fs]\n", (nTime6 - nTime1) * 0.001, nTimeTotal * 0.000001); From da59f283350343a623820fa9ea48dd1ebb817064 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 28 Aug 2014 13:09:19 +0200 Subject: [PATCH 0629/1288] Add deeper XML checking to update-translation script - Catch problems such as mismatched formatting characters. Remove messages that can give problems at runtime. - Also remove unfinished/untranslated messages, they just take up space in the ts and waste parsing time. Fixes #4774. --- contrib/devtools/update-translations.py | 148 +++++++++++++++++++++--- 1 file changed, 134 insertions(+), 14 deletions(-) diff --git a/contrib/devtools/update-translations.py b/contrib/devtools/update-translations.py index 1950a42678..0be632069a 100755 --- a/contrib/devtools/update-translations.py +++ b/contrib/devtools/update-translations.py @@ -14,13 +14,14 @@ It will do the following automatically: TODO: - auto-add new translations to the build system according to the translation process -- remove 'unfinished' translation items ''' from __future__ import division, print_function import subprocess import re import sys import os +import io +import xml.etree.ElementTree as ET # Name of transifex tool TX = 'tx' @@ -40,24 +41,143 @@ def fetch_all_translations(): print('Error while fetching translations', file=sys.stderr) exit(1) -def postprocess_translations(): - print('Postprocessing...') +def find_format_specifiers(s): + '''Find all format specifiers in a string.''' + pos = 0 + specifiers = [] + while True: + percent = s.find('%', pos) + if percent < 0: + break + specifiers.append(s[percent+1]) + pos = percent+2 + return specifiers + +def split_format_specifiers(specifiers): + '''Split format specifiers between numeric (Qt) and others (strprintf)''' + numeric = [] + other = [] + for s in specifiers: + if s in {'1','2','3','4','5','6','7','8','9'}: + numeric.append(s) + else: + other.append(s) + + # numeric (Qt) can be present in any order, others (strprintf) must be in specified order + return set(numeric),other + +def sanitize_string(s): + '''Sanitize string for printing''' + return s.replace('\n',' ') + +def check_format_specifiers(source, translation, errors): + source_f = split_format_specifiers(find_format_specifiers(source)) + # assert that no source messages contain both Qt and strprintf format specifiers + # if this fails, go change the source as this is hacky and confusing! + assert(not(source_f[0] and source_f[1])) + try: + translation_f = split_format_specifiers(find_format_specifiers(translation)) + except IndexError: + errors.append("Parse error in translation '%s'" % sanitize_string(translation)) + return False + else: + if source_f != translation_f: + errors.append("Mismatch between '%s' and '%s'" % (sanitize_string(source), sanitize_string(translation))) + return False + return True + +def all_ts_files(suffix=''): for filename in os.listdir(LOCALE_DIR): # process only language files, and do not process source language - if not filename.endswith('.ts') or filename == SOURCE_LANG: + if not filename.endswith('.ts'+suffix) or filename == SOURCE_LANG+suffix: continue + if suffix: # remove provided suffix + filename = filename[0:-len(suffix)] filepath = os.path.join(LOCALE_DIR, filename) - with open(filepath, 'rb') as f: + yield(filename, filepath) + +FIX_RE = re.compile(b'[\x00-\x09\x0b\x0c\x0e-\x1f]') +def remove_invalid_characters(s): + '''Remove invalid characters from translation string''' + return FIX_RE.sub(b'', s) + +# Override cdata escape function to make our output match Qt's (optional, just for cleaner diffs for +# comparison, disable by default) +_orig_escape_cdata = None +def escape_cdata(text): + text = _orig_escape_cdata(text) + text = text.replace("'", ''') + text = text.replace('"', '"') + return text + +def postprocess_translations(reduce_diff_hacks=False): + print('Checking and postprocessing...') + + if reduce_diff_hacks: + global _orig_escape_cdata + _orig_escape_cdata = ET._escape_cdata + ET._escape_cdata = escape_cdata + + for (filename,filepath) in all_ts_files(): + os.rename(filepath, filepath+'.orig') + + have_errors = False + for (filename,filepath) in all_ts_files('.orig'): + # pre-fixups to cope with transifex output + parser = ET.XMLParser(encoding='utf-8') # need to override encoding because 'utf8' is not understood only 'utf-8' + with open(filepath + '.orig', 'rb') as f: data = f.read() - # remove non-allowed control characters - data = re.sub('[\x00-\x09\x0b\x0c\x0e-\x1f]', '', data) - data = data.split('\n') - # strip locations from non-origin translation - # location tags are used to guide translators, they are not necessary for compilation - # TODO: actually process XML instead of relying on Transifex's one-tag-per-line output format - data = [line for line in data if not '', b'/>') + with open(filepath, 'wb') as f: + f.write(out) + else: + tree.write(filepath, encoding='utf-8') + return have_errors if __name__ == '__main__': check_at_repository_root() From 6f5d33b3d2901799311d8596c394a45211ff978f Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 28 Aug 2014 13:10:32 +0200 Subject: [PATCH 0630/1288] Update translations after update script improvements --- src/qt/locale/bitcoin_ach.ts | 3340 +------------------------- src/qt/locale/bitcoin_af_ZA.ts | 2746 +-------------------- src/qt/locale/bitcoin_ar.ts | 1786 +------------- src/qt/locale/bitcoin_be_BY.ts | 2542 +------------------- src/qt/locale/bitcoin_bg.ts | 1863 +------------- src/qt/locale/bitcoin_bs.ts | 3292 +------------------------ src/qt/locale/bitcoin_ca.ts | 1929 +++++++-------- src/qt/locale/bitcoin_ca@valencia.ts | 1871 ++++++--------- src/qt/locale/bitcoin_ca_ES.ts | 1671 +++++++------ src/qt/locale/bitcoin_cmn.ts | 3340 +------------------------- src/qt/locale/bitcoin_cs.ts | 973 ++++---- src/qt/locale/bitcoin_cy.ts | 2966 +---------------------- src/qt/locale/bitcoin_da.ts | 869 ++++--- src/qt/locale/bitcoin_de.ts | 803 ++++--- src/qt/locale/bitcoin_el_GR.ts | 998 +------- src/qt/locale/bitcoin_eo.ts | 821 +------ src/qt/locale/bitcoin_es.ts | 754 +++--- src/qt/locale/bitcoin_es_CL.ts | 1966 +-------------- src/qt/locale/bitcoin_es_DO.ts | 782 +----- src/qt/locale/bitcoin_es_MX.ts | 2400 +----------------- src/qt/locale/bitcoin_es_UY.ts | 2944 +---------------------- src/qt/locale/bitcoin_et.ts | 1623 +------------ src/qt/locale/bitcoin_eu_ES.ts | 2732 +-------------------- src/qt/locale/bitcoin_fa.ts | 1499 +----------- src/qt/locale/bitcoin_fa_IR.ts | 2369 +----------------- src/qt/locale/bitcoin_fi.ts | 474 +--- src/qt/locale/bitcoin_fr.ts | 1105 +++++---- src/qt/locale/bitcoin_fr_CA.ts | 3243 +------------------------ src/qt/locale/bitcoin_gl.ts | 949 +------- src/qt/locale/bitcoin_gu_IN.ts | 3340 +------------------------- src/qt/locale/bitcoin_he.ts | 875 +------ src/qt/locale/bitcoin_hi_IN.ts | 2535 +------------------ src/qt/locale/bitcoin_hr.ts | 1974 +-------------- src/qt/locale/bitcoin_hu.ts | 1448 ++--------- src/qt/locale/bitcoin_id_ID.ts | 732 +----- src/qt/locale/bitcoin_it.ts | 634 ++--- src/qt/locale/bitcoin_ja.ts | 955 +------- src/qt/locale/bitcoin_ka.ts | 641 +---- src/qt/locale/bitcoin_kk_KZ.ts | 3218 +------------------------ src/qt/locale/bitcoin_ko_KR.ts | 753 +----- src/qt/locale/bitcoin_ky.ts | 3100 +----------------------- src/qt/locale/bitcoin_la.ts | 1540 +----------- src/qt/locale/bitcoin_lt.ts | 1834 +------------- src/qt/locale/bitcoin_lv_LV.ts | 973 +------- src/qt/locale/bitcoin_mn.ts | 2348 +----------------- src/qt/locale/bitcoin_ms_MY.ts | 3280 +------------------------ src/qt/locale/bitcoin_nb.ts | 823 ++++--- src/qt/locale/bitcoin_nl.ts | 451 +--- src/qt/locale/bitcoin_pam.ts | 1827 +------------- src/qt/locale/bitcoin_pl.ts | 673 +----- src/qt/locale/bitcoin_pt_BR.ts | 629 ++--- src/qt/locale/bitcoin_pt_PT.ts | 557 +---- src/qt/locale/bitcoin_ro_RO.ts | 707 +----- src/qt/locale/bitcoin_ru.ts | 827 ++++--- src/qt/locale/bitcoin_sah.ts | 3336 +------------------------ src/qt/locale/bitcoin_sk.ts | 489 +--- src/qt/locale/bitcoin_sl_SI.ts | 1442 ++--------- src/qt/locale/bitcoin_sq.ts | 2870 +--------------------- src/qt/locale/bitcoin_sr.ts | 2592 +------------------- src/qt/locale/bitcoin_sv.ts | 833 ++++--- src/qt/locale/bitcoin_th_TH.ts | 3038 +---------------------- src/qt/locale/bitcoin_tr.ts | 839 ++++--- src/qt/locale/bitcoin_uk.ts | 1423 ++--------- src/qt/locale/bitcoin_ur_PK.ts | 3138 +----------------------- src/qt/locale/bitcoin_uz@Cyrl.ts | 2902 ++-------------------- src/qt/locale/bitcoin_vi.ts | 3246 +------------------------ src/qt/locale/bitcoin_vi_VN.ts | 3336 +------------------------ src/qt/locale/bitcoin_zh_CN.ts | 697 +++--- src/qt/locale/bitcoin_zh_HK.ts | 3340 +------------------------- src/qt/locale/bitcoin_zh_TW.ts | 803 ++++--- 70 files changed, 11745 insertions(+), 113903 deletions(-) diff --git a/src/qt/locale/bitcoin_ach.ts b/src/qt/locale/bitcoin_ach.ts index de5619bfc0..835ddb8eaa 100644 --- a/src/qt/locale/bitcoin_ach.ts +++ b/src/qt/locale/bitcoin_ach.ts @@ -1,3368 +1,110 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage - - Double-click to edit address or label - - - - Create a new address - - - - &New - - - - Copy the currently selected address to the system clipboard - - - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - - - &Delete - - - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - - - Comma separated file (*.csv) - - - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel - - Label - - - - Address - - - - (no label) - - - + AskPassphraseDialog - - Passphrase Dialog - - - - Enter passphrase - - - - New passphrase - - - - Repeat new passphrase - - - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - - - - Encrypt wallet - - - - This operation needs your wallet passphrase to unlock the wallet. - - - - Unlock wallet - - - - This operation needs your wallet passphrase to decrypt the wallet. - - - - Decrypt wallet - - - - Change passphrase - - - - Enter the old and new passphrase to the wallet. - - - - Confirm wallet encryption - - - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - - - Wallet encrypted - - - - Bitcoin 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. - - - - Wallet encryption failed - - - - Wallet encryption failed due to an internal error. Your wallet was not encrypted. - - - - The supplied passphrases do not match. - - - - Wallet unlock failed - - - - The passphrase entered for the wallet decryption was incorrect. - - - - Wallet decryption failed - - - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - - - Synchronizing with network... - - - - &Overview - - - - Node - - - - Show general overview of wallet - - - - &Transactions - - - - Browse transaction history - - - - E&xit - - - - Quit application - - - - Show information about Bitcoin - - - - About &Qt - - - - Show information about Qt - - - - &Options... - - - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - - - Change the passphrase used for wallet encryption - - - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - - - &File - - - - &Settings - - - - &Help - - - - Tabs toolbar - - - - [testnet] - - - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - - - %n active connection(s) to Bitcoin network - - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - - - Error - - - - Warning - - - - Information - - - - Up to date - - - - Catching up... - - - - Sent transaction - - - - Incoming transaction - - - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> - - - - Wallet is <b>encrypted</b> and currently <b>locked</b> - - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - - + ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - - - Amount - - - - Address - - - - Date - - - - Confirmations - - - - Confirmed - - - - Priority - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - - - (no label) - - - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog - - Edit Address - - - - &Label - - - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - - - &Address - - - - New receiving address - - - - New sending address - - - - Edit receiving address - - - - Edit sending address - - - - The entered address "%1" is already in the address book. - - - - The entered address "%1" is not a valid Bitcoin address. - - - - Could not unlock wallet. - - - - New key generation failed. - - - + FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - - - version - - - - Usage: - - - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - - - Error - - - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog - - Options - - - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage - - Form - - - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - - - <b>Recent transactions</b> - - - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - - Bitcoin - - - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - - - &Label: - - - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - - - Copy label - - - - Copy message - - - - Copy amount - - - + ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - - - Address - - - - Amount - - - - Label - - - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel - - Date - - - - Label - - - - Message - - - - Amount - - - - (no label) - - - - (no message) - - - - (no amount) - - - + SendCoinsDialog - - Send Coins - - - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - - - Send to multiple recipients at once - - - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - - - Balance: - - - - Confirm the send action - - - - S&end - - - - Confirm send coins - - - - %1 to %2 - - - - Copy quantity - - - - Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - - - The amount to pay must be larger than 0. - - - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - - - (no label) - - - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry - - A&mount: - - - - Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Enter a label for this address to add it to your address book - - - - &Label: - - - - Choose previously used address - - - - This is a normal payment. - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - - - [testnet] - - - + TrafficGraphWidget - - KB/s - - - + TransactionDesc - - Open until %1 - - - - conflicted - - - - %1/offline - - - - %1/unconfirmed - - - - %1 confirmations - - - - Status - - - - , broadcast through %n node(s) - - - - Date - - - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - - - Amount - - - - true - - - - false - - - - , has not been successfully broadcast yet - - - - Open for %n more block(s) - - - - unknown - - - + TransactionDescDialog - - Transaction details - - - - This pane shows a detailed description of the transaction - - - + TransactionTableModel - - Date - - - - Type - - - - Address - - - - Amount - - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - - - Open until %1 - - - - Confirmed (%1 confirmations) - - - - This block was not received by any other nodes and will probably not be accepted! - - - - Generated but not accepted - - - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - - - Received with - - - - Received from - - - - Sent to - - - - Payment to yourself - - - - Mined - - - - (n/a) - - - - Transaction status. Hover over this field to show number of confirmations. - - - - Date and time that the transaction was received. - - - - Type of transaction. - - - - Destination address of transaction. - - - - Amount removed from or added to balance. - - - + TransactionView - - All - - - - Today - - - - This week - - - - This month - - - - Last month - - - - This year - - - - Range... - - - - Received with - - - - Sent to - - - - To yourself - - - - Mined - - - - Other - - - - Enter address or label to search - - - - Min amount - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - - - Comma separated file (*.csv) - - - - Confirmed - - - - Date - - - - Type - - - - Label - - - - Address - - - - Amount - - - - ID - - - - Range: - - - - to - - - + + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel - - Send Coins - - - + WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - - - Options: - - - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - - - Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - - - Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - - - Done loading - - - - To use the %s option - - - - Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - - + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_af_ZA.ts b/src/qt/locale/bitcoin_af_ZA.ts index 6e8395e589..474b6b3298 100644 --- a/src/qt/locale/bitcoin_af_ZA.ts +++ b/src/qt/locale/bitcoin_af_ZA.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -39,97 +7,17 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address - Skep 'n nuwe adres - - - &New - + Skep 'n nuwe adres Copy the currently selected address to the system clipboard - Maak 'n kopie van die huidige adres na die stelsel klipbord - - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - + Maak 'n kopie van die huidige adres na die stelsel klipbord &Delete &Verwyder - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - - - Comma separated file (*.csv) - - - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -147,10 +35,6 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase Tik Wagwoord in @@ -163,17 +47,13 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Herhaal nuwe wagwoord - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Tik die nuwe wagwoord vir die beursie in.<br/>Gebruik asseblief 'n wagwoord van <b>ten minste 10 ewekansige karakters</b>, of <b>agt (8) of meer woorde.</b> - Encrypt wallet Enkripteer beursie This operation needs your wallet passphrase to unlock the wallet. - Hierdie operasie benodig 'n wagwoord om die beursie oop te sluit. + Hierdie operasie benodig 'n wagwoord om die beursie oop te sluit. Unlock wallet @@ -181,7 +61,7 @@ This product includes software developed by the OpenSSL Project for use in the O This operation needs your wallet passphrase to decrypt the wallet. - Hierdie operasie benodig 'n wagwoord om die beursie oop te sluit. + Hierdie operasie benodig 'n wagwoord om die beursie oop te sluit. Decrypt wallet @@ -199,37 +79,17 @@ This product includes software developed by the OpenSSL Project for use in the O Confirm wallet encryption Bevestig beursie enkripsie. - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - Wallet encrypted Die beursie is nou bewaak - - Bitcoin 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. - - Wallet encryption failed Die beursie kon nie bewaak word nie Wallet encryption failed due to an internal error. Your wallet was not encrypted. - Beursie bewaaking het misluk as gevolg van 'n interne fout. Die beursie is nie bewaak nie! + Beursie bewaaking het misluk as gevolg van 'n interne fout. Die beursie is nie bewaak nie! The supplied passphrases do not match. @@ -247,17 +107,9 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet decryption failed Beursie dekripsie het misluk - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - Synchronizing with network... Sinchroniseer met die netwerk ... @@ -266,10 +118,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Overview &Oorsig - - Node - - Show general overview of wallet Wys algemene oorsig van die beursie @@ -290,14 +138,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application Sluit af - - Show information about Bitcoin - Wys inligting oor Bitcoin - - - About &Qt - - Show information about Qt Wys inligting oor Qt @@ -306,66 +146,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Options... &Opsies - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - - - Change the passphrase used for wallet encryption - - - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - Bitcoin Bitcoin @@ -374,34 +154,6 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet Beursie - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - &File &Lêer @@ -418,82 +170,6 @@ This product includes software developed by the OpenSSL Project for use in the O Tabs toolbar Blad nutsbalk - - [testnet] - - - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Bitcoin klient - - - %n active connection(s) to Bitcoin network - - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - %1 behind %1 agter @@ -502,116 +178,24 @@ This product includes software developed by the OpenSSL Project for use in the O Last received block was generated %1 ago. Ontvangs van laaste blok is %1 terug. - - Transactions after this will not yet be visible. - - Error Fout - - Warning - - Information Informasie - - Up to date - - - - Catching up... - - - - Sent transaction - - - - Incoming transaction - - - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> - - - - Wallet is <b>encrypted</b> and currently <b>locked</b> - - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - - + ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - Amount: Bedrag: - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount Bedrag @@ -624,197 +208,21 @@ Address: %4 Date Datum - - Confirmations - - - - Confirmed - - - - Priority - - Copy address Maak kopie van adres - - Copy label - - Copy amount Kopieer bedrag - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (geen etiket) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog - - Edit Address - - - - &Label - - - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - - - &Address - - New receiving address Nuwe ontvangende adres @@ -831,775 +239,78 @@ Address: %4 Edit sending address Wysig stuurende adres - - The entered address "%1" is already in the address book. - - - - The entered address "%1" is not a valid Bitcoin address. - - Could not unlock wallet. Kon nie die beursie oopsluit nie. - - New key generation failed. - - - + FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - - - version - - Usage: Gebruik: - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - - Error - + Fout - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog Options Opsies - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage Form Vorm - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - Wallet Beursie - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - <b>Recent transactions</b> <b>Onlangse transaksies</b> - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Bedrag - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Die adres waarheen die betaling gestuur moet word (b.v. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - &Information - + Informasie - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - - - &Label: - - - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - - - Copy label - - - - Copy message - - Copy amount Kopieer bedrag @@ -1607,34 +318,6 @@ Address: %4 ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address Adres @@ -1651,15 +334,7 @@ Address: %4 Message Boodskap - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel @@ -1682,503 +357,75 @@ Address: %4 (no label) (geen etiket) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins Stuur Munstukke - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - Amount: Bedrag: - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Stuur aan vele ontvangers op eens - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - Balance: Balans: - - Confirm the send action - - S&end S&tuur - - Confirm send coins - - - - %1 to %2 - - - - Copy quantity - - Copy amount Kopieer bedrag - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - - - The amount to pay must be larger than 0. - - - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (geen etiket) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry - - A&mount: - - - - Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Die adres waarheen die betaling gestuur moet word (b.v. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Enter a label for this address to add it to your address book - - - - &Label: - - - - Choose previously used address - - - - This is a normal payment. - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Remove this entry - - Message: Boodskap: - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - &Sign Message &Teken boodskap - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Enter the message you want to sign here - - Signature Handtekening - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - Sign &Message Teken &Boodskap - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Die adres waarheen die betaling gestuur moet word (b.v. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - - - [testnet] - - - + TrafficGraphWidget - - KB/s - - - + TransactionDesc - - Open until %1 - - - - conflicted - - - - %1/offline - - - - %1/unconfirmed - - - - %1 confirmations - - - - Status - - - - , broadcast through %n node(s) - - Date Datum - - Source - - - - Generated - - From Van @@ -2199,10 +446,6 @@ Address: %4 Credit Krediet - - matures in %n more block(s) - - not accepted nie aanvaar nie @@ -2223,34 +466,10 @@ Address: %4 Message Boodskap - - Comment - - Transaction ID Transaksie ID - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - Amount Bedrag @@ -2263,14 +482,6 @@ Address: %4 false onwaar - - , has not been successfully broadcast yet - - - - Open for %n more block(s) - - unknown onbekend @@ -2278,15 +489,7 @@ Address: %4 TransactionDescDialog - - Transaction details - - - - This pane shows a detailed description of the transaction - - - + TransactionTableModel @@ -2301,50 +504,6 @@ Address: %4 Address Adres - - Amount - Bedrag - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - - - Open until %1 - - - - Confirmed (%1 confirmations) - - - - This block was not received by any other nodes and will probably not be accepted! - - - - Generated but not accepted - - - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with Ontvang met @@ -2369,10 +528,6 @@ Address: %4 (n/a) (n.v.t) - - Transaction status. Hover over this field to show number of confirmations. - - Date and time that the transaction was received. Datum en tyd wat die transaksie ontvang was. @@ -2381,15 +536,7 @@ Address: %4 Type of transaction. Tipe transaksie. - - Destination address of transaction. - - - - Amount removed from or added to balance. - - - + TransactionView @@ -2440,10 +587,6 @@ Address: %4 Other Ander - - Enter address or label to search - - Min amount Min bedrag @@ -2452,54 +595,10 @@ Address: %4 Copy address Maak kopie van adres - - Copy label - - Copy amount Kopieer bedrag - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - - - Comma separated file (*.csv) - - - - Confirmed - - Date Datum @@ -2516,10 +615,6 @@ Address: %4 Address Adres - - Amount - Bedrag - ID ID @@ -2533,13 +628,12 @@ Address: %4 aan + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2549,69 +643,13 @@ Address: %4 WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - Gebruik: - - - List commands - - - - Get help for a command - - Options: Opsies: - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - Listen for connections on <port> (default: 8333 or testnet: 18333) Luister vir konneksies op <port> (standaard: 8333 of testnet: 18333) @@ -2620,700 +658,30 @@ Address: %4 Maintain at most <n> connections to peers (default: 125) Onderhou op die meeste <n> konneksies na eweknieë (standaard: 125) - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - Use the test network Gebruik die toets netwerk - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - Error: Disk space is low! Fout: Hardeskyf spasie is baie laag! - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information Informasie - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - System error: Sisteem fout: - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - This help message Hierdie help boodskap - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - Loading addresses... Laai adresse... - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - Invalid amount Ongeldige bedrag @@ -3326,43 +694,17 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Loading block index... Laai blok indeks... - - Add a node to connect to and attempt to keep the connection open - - Loading wallet... Laai beursie... - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - Done loading Klaar gelaai - - To use the %s option - - Error Fout - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_ar.ts b/src/qt/locale/bitcoin_ar.ts index 5877cc35d9..ea1bc0ea4b 100644 --- a/src/qt/locale/bitcoin_ar.ts +++ b/src/qt/locale/bitcoin_ar.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - الحقوق محفوظة - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -65,10 +33,6 @@ This product includes software developed by the OpenSSL Project for use in the O Delete the currently selected address from the list حذف العنوان المحدد من القائمة - - Export the data in the current tab to a file - - &Export &تصدير @@ -97,14 +61,6 @@ This product includes software developed by the OpenSSL Project for use in the O Receiving addresses استقبال العناوين - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - Copy &Label نسخ &الوصف @@ -117,19 +73,11 @@ This product includes software developed by the OpenSSL Project for use in the O Export Address List تصدير قائمة العناوين - - Comma separated file (*.csv) - - Exporting Failed فشل التصدير - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -147,10 +95,6 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase ادخل كلمة المرور @@ -163,10 +107,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase ادخل كلمة المرور الجديدة مرة أخرى - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - أدخل كلمة مرور جديدة للمحفظة. <br/>الرجاء استخدام كلمة مرور تتكون <b>من 10 حروف عشوائية على الاقل</b>, أو <b>أكثر من 7 كلمات</b>. - Encrypt wallet تشفير المحفظة @@ -199,18 +139,6 @@ This product includes software developed by the OpenSSL Project for use in the O Confirm wallet encryption تأكيد تشفير المحفظة - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - Warning: The Caps Lock key is on! تحذير: مفتاح الحروف الكبيرة مفعل @@ -247,11 +175,7 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet decryption failed فشل فك التشفير المحفظة - - Wallet passphrase was successfully changed. - - - + BitcoinGUI @@ -268,7 +192,7 @@ This product includes software developed by the OpenSSL Project for use in the O Node - + جهاز Show general overview of wallet @@ -290,10 +214,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application الخروج من التطبيق - - Show information about Bitcoin - إظهار معلومات حول بت كوين - About &Qt عن @@ -318,34 +238,14 @@ This product includes software developed by the OpenSSL Project for use in the O &Change Passphrase... &تغيير كلمة المرور - - &Sending addresses... - - - - &Receiving addresses... - - Open &URI... افتح &URI... - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - Send coins to a Bitcoin address ارسل عملات الى عنوان بيتكوين - - Modify configuration options for Bitcoin - - Backup wallet to another location احفظ نسخة احتياطية للمحفظة في مكان آخر @@ -358,10 +258,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Debug window &نافذة المعالجة - - Open debugging and diagnostic console - - &Verify message... &التحقق من الرسالة... @@ -374,10 +270,6 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet محفظة - - &Send - %ارسل - &Receive &استقبل @@ -390,18 +282,6 @@ This product includes software developed by the OpenSSL Project for use in the O Show or hide the main Window عرض او اخفاء النافذة الرئيسية - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - &File &ملف @@ -424,55 +304,7 @@ This product includes software developed by the OpenSSL Project for use in the O Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - عميل بت كوين - - - %n active connection(s) to Bitcoin network - - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - + جوهر البيت كوين %n hour(s) @@ -486,26 +318,6 @@ This product includes software developed by the OpenSSL Project for use in the O %n week(s) %n اسبوع%n اسبوع%n اسبوع%n اسابيع%n اسابيع%n اسابيع - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - Error خطأ @@ -534,18 +346,6 @@ This product includes software developed by the OpenSSL Project for use in the O Incoming transaction المعاملات الواردة - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - التاريخ : 1% -القيمة: 2% -النوع: 3% -العنوان: 4% - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> المحفظة <b>مشفرة</b> و <b>مفتوحة</b> حاليا @@ -554,10 +354,6 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> المحفظة <b>مشفرة</b> و <b>مقفلة</b> حاليا - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - ClientModel @@ -568,53 +364,29 @@ Address: %4 CoinControlDialog - - Coin Control Address Selection - - Quantity: الكمية: - - Bytes: - - Amount: القيمة Priority: - + افضلية : Fee: رسوم : - - Low Output: - - After Fee: - + بعد الرسوم : Change: - - - - (un)select all - - - - Tree mode - - - - List mode - + تعديل : Amount @@ -656,14 +428,6 @@ Address: %4 Copy transaction ID نسخ رقم المعاملة - - Lock unspent - - - - Unlock unspent - - Copy quantity نسخ الكمية @@ -676,18 +440,10 @@ Address: %4 Copy after fee نسخ بعد الرسوم - - Copy bytes - - Copy priority نسخ الافضلية - - Copy low output - - Copy change نسخ التغييرات @@ -704,42 +460,22 @@ Address: %4 high عالي - - medium-high - - - - medium - - - - low-medium - - low منخفض lower - + أدنى lowest - - - - (%1 locked) - + الأدنى none لا شيء - - Dust - - yes نعم @@ -748,53 +484,13 @@ Address: %4 no لا - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (لا وصف) - - change from %1 (%2) - - (change) - + (تغير) @@ -807,14 +503,6 @@ Address: %4 &Label &وصف - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &العنوان @@ -836,12 +524,8 @@ Address: %4 تعديل عنوان الارسال - The entered address "%1" is already in the address book. - هدا العنوان "%1" موجود مسبقا في دفتر العناوين - - - The entered address "%1" is not a valid Bitcoin address. - + The entered address "%1" is already in the address book. + هدا العنوان "%1" موجود مسبقا في دفتر العناوين Could not unlock wallet. @@ -862,14 +546,6 @@ Address: %4 name الاسم - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - Cannot create data directory here. لا يمكن انشاء دليل بيانات هنا . @@ -877,69 +553,33 @@ Address: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core - + جوهر البيت كوين version النسخة - Usage: - المستخدم + About Bitcoin Core + عن جوهر البيت كوين - command-line options - + Usage: + المستخدم UI options خيارات UI - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro Welcome أهلا - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - Use the default data directory استخدام دليل البانات الافتراضي @@ -949,12 +589,8 @@ Address: %4 استخدام دليل بيانات مخصص: - Bitcoin - بت كوين - - - Error: Specified data directory "%1" can not be created. - + Bitcoin Core + جوهر البيت كوين Error @@ -964,25 +600,9 @@ Address: %4 GB of free space available قيقا بايت مساحة متاحة - - (of %1GB needed) - ( بحاجة الى 1%قيقا بايت ) - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - Select payment request file حدد ملف طلب الدفع @@ -1002,62 +622,22 @@ Address: %4 &Main &الرئيسي - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - Pay transaction &fee ادفع &رسوم المعاملة - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - MB م ب - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - + Accept connections from outside + إقبل التواصل من الخارج Third party transaction URLs عنوان النطاق للطرف الثالث - - Active command-line options that override above options: - - - - Reset all client options to default. - - &Reset Options &استعادة الخيارات @@ -1066,10 +646,6 @@ Address: %4 &Network &الشبكة - - (0 = auto, <0 = leave that many cores free) - - W&allet &محفظة @@ -1078,26 +654,6 @@ Address: %4 Expert تصدير - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - Proxy &IP: بروكسي &اي بي: @@ -1110,34 +666,10 @@ Address: %4 Port of the proxy (e.g. 9050) منفذ البروكسي (مثلا 9050) - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - &Window نافذه - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - &Display &عرض @@ -1146,30 +678,6 @@ Address: %4 User Interface &language: واجهة المستخدم &اللغة: - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - عرض العناوين في قائمة الصفقة - - - Whether to show coin control features or not. - - &OK تم @@ -1190,18 +698,6 @@ Address: %4 Confirm options reset تأكيد استعادة الخيارات - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - The supplied proxy address is invalid. عنوان الوكيل توفيره غير صالح. @@ -1213,10 +709,6 @@ Address: %4 Form نمودج - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - Wallet محفظة @@ -1225,26 +717,14 @@ Address: %4 Available: متوفر - - Your current spendable balance - - Pending: معلق: - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - Immature: غير ناضجة - - Mined balance that has not yet matured - - Total: المجموع: @@ -1264,102 +744,25 @@ Address: %4 PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - استجابة سيئة من الملقم٪ 1 - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - بت كوين + Amount + المبلغ - Error: Specified data directory "%1" does not exist. - + UNKNOWN + غير معروف - Error: Cannot parse configuration file: %1. Only use key=value syntax. - + N/A + غير معروف - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - إدخال عنوانBitcoin (مثال :1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget @@ -1376,7 +779,7 @@ Address: %4 PNG Image (*.png) - + صورة PNG (*.png) @@ -1397,18 +800,10 @@ Address: %4 &Information المعلومات - - Debug window - - General عام - - Using OpenSSL version - - Startup time وقت البدء @@ -1426,29 +821,33 @@ Address: %4 عدد الاتصالات - Block chain - + Received + إستقبل - Current number of blocks - + Sent + تم الإرسال - Estimated total blocks - + Direction + جهة - Last block time - + Services + خدمات + + + Last Send + آخر استقبال + + + Last Receive + آخر إرسال &Open الفتح - - &Console - - &Network Traffic &حركة مرور الشبكة @@ -1473,57 +872,25 @@ Address: %4 Build date وقت البناء - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. استخدم اسهم الاعلى و الاسفل للتنقل بين السجلات و <b>Ctrl-L</b> لمسح الشاشة - Type <b>help</b> for an overview of available commands. - + Yes + نعم - %1 B - 1% بايت + No + لا - %1 KB - 1% كيلو بايت + Unknown + غير معرف - %1 MB - 1% ميقا بايت - - - %1 GB - 1% قيقا بايت - - - %1 m - 1% دقيقة - - - %1 h - 1% ساعة - - - %1 h %2 m - 1% ساعة 2% دقيقة + Fetching... + جاري الجلب... @@ -1540,30 +907,6 @@ Address: %4 &Message: &رسالة: - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - Clear all fields of the form. مسح كل حقول النموذج المطلوبة @@ -1576,22 +919,10 @@ Address: %4 Requested payments history سجل طلبات الدفع - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - Show عرض - - Remove the selected entries from the list - - Remove ازل @@ -1627,13 +958,9 @@ Address: %4 &Save Image... &حفظ الصورة - - Request payment to %1 - - Payment information - + معلومات الدفع URI @@ -1655,15 +982,7 @@ Address: %4 Message رسالة - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel @@ -1690,41 +1009,25 @@ Address: %4 (no message) ( لا رسائل ) - - (no amount) - - - + SendCoinsDialog Send Coins إرسال Coins - - Coin Control Features - - - - Inputs... - - automatically selected اختيار تلقائيا Insufficient funds! - + الرصيد غير كافي! Quantity: الكمية : - - Bytes: - - Amount: القيمة : @@ -1737,10 +1040,6 @@ Address: %4 Fee: رسوم : - - Low Output: - - After Fee: بعد الرسوم : @@ -1749,14 +1048,6 @@ Address: %4 Change: تعديل : - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once إرسال إلى عدة مستلمين في وقت واحد @@ -1767,7 +1058,7 @@ Address: %4 Clear all fields of the form. - + مسح كل حقول النموذج المطلوبة Clear &All @@ -1789,10 +1080,6 @@ Address: %4 Confirm send coins تأكيد الإرسال Coins - - %1 to %2 - 1% الى 2% - Copy quantity نسخ الكمية @@ -1809,18 +1096,10 @@ Address: %4 Copy after fee نسخ بعد الرسوم - - Copy bytes - - Copy priority نسخ الافضلية - - Copy low output - - Copy change نسخ التعديل @@ -1833,10 +1112,6 @@ Address: %4 or أو - - The recipient address is not valid, please recheck. - - The amount to pay must be larger than 0. المبلغ المدفوع يجب ان يكون اكبر من 0 @@ -1845,65 +1120,17 @@ Address: %4 The amount exceeds your balance. القيمة تتجاوز رصيدك - - The total exceeds your balance when the %1 transaction fee is included. - المجموع يتجاوز رصيدك عندما يتم اضافة 1% رسوم العملية - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (لا وصف) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry - - A&mount: - - Pay &To: ادفع &الى : - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - Enter a label for this address to add it to your address book إدخال تسمية لهذا العنوان لإضافته إلى دفتر العناوين الخاص بك @@ -1912,14 +1139,6 @@ Address: %4 &Label: &وصف : - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt+A @@ -1932,45 +1151,13 @@ Address: %4 Alt+P Alt+P - - Remove this entry - - Message: الرسائل - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - Do not shut down the computer until this window disappears. لا توقف عمل الكمبيوتر حتى تختفي هذه النافذة @@ -1978,26 +1165,10 @@ Address: %4 SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - &Sign Message &توقيع الرسالة - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - Alt+A Alt+A @@ -2018,10 +1189,6 @@ Address: %4 Signature التوقيع - - Copy the current signature to the system clipboard - - Sign the message to prove you own this Bitcoin address وقع الرسالة لتثبت انك تمتلك عنوان البت كوين هذا @@ -2030,10 +1197,6 @@ Address: %4 Sign &Message توقيع $الرسالة - - Reset all sign message fields - - Clear &All مسح الكل @@ -2042,33 +1205,13 @@ Address: %4 &Verify Message &تحقق رسالة - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - Verify &Message تحقق &الرسالة - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - إدخال عنوانBitcoin (مثال :1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - اضغط "توقيع الرسالة" لتوليد التوقيع + Click "Sign Message" to generate signature + اضغط "توقيع الرسالة" لتوليد التوقيع The entered address is invalid. @@ -2098,18 +1241,10 @@ Address: %4 Message signed. الرسالة موقعة. - - The signature could not be decoded. - - Please check the signature and try again. فضلا تاكد من التوقيع وحاول مرة اخرى - - The signature did not match the message digest. - - Message verification failed. فشلت عملية التأكد من الرسالة. @@ -2123,11 +1258,11 @@ Address: %4 SplashScreen Bitcoin Core - + جوهر البيت كوين The Bitcoin Core developers - + مطوري جوهر البيت كوين [testnet] @@ -2136,29 +1271,13 @@ Address: %4 TrafficGraphWidget - - KB/s - - - + TransactionDesc - - Open until %1 - مفتوح حتى 1٪ - conflicted يتعارض - - %1/offline - 1% غير متواجد - - - %1/unconfirmed - غير مؤكدة/1% - %1 confirmations تأكيد %1 @@ -2167,10 +1286,6 @@ Address: %4 Status الحالة. - - , broadcast through %n node(s) - - Date التاريخ @@ -2199,14 +1314,6 @@ Address: %4 label علامة - - Credit - - - - matures in %n more block(s) - - not accepted غير مقبولة @@ -2219,10 +1326,6 @@ Address: %4 Transaction fee رسوم المعاملة - - Net amount - - Message رسالة @@ -2239,22 +1342,10 @@ Address: %4 Merchant تاجر - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - Transaction معاملة - - Inputs - - Amount المبلغ @@ -2271,10 +1362,6 @@ Address: %4 , has not been successfully broadcast yet , لم يتم حتى الآن البث بنجاح - - Open for %n more block(s) - - unknown غير معروف @@ -2305,26 +1392,6 @@ Address: %4 Address عنوان - - Amount - المبلغ - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - - - Open until %1 - مفتوح حتى 1٪ - - - Confirmed (%1 confirmations) - تأكيد الإرسال Coins - This block was not received by any other nodes and will probably not be accepted! لم يتم تلقى هذه الكتلة (Block) من قبل أي العقد الأخرى وربما لن تكون مقبولة! @@ -2337,18 +1404,6 @@ Address: %4 Offline غير متصل - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with استقبل مع @@ -2476,30 +1531,14 @@ Address: %4 Show transaction details عرض تفاصيل المعاملة - - Export Transaction History - - Exporting Failed فشل التصدير - - There was an error trying to save the transaction history to %1. - - Exporting Successful نجح التصدير - - The transaction history was successfully saved to %1. - - - - Comma separated file (*.csv) - - Confirmed تأكيد @@ -2520,10 +1559,6 @@ Address: %4 Address عنوان - - Amount - المبلغ - ID العنوان @@ -2537,13 +1572,12 @@ Address: %4 الى + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2557,30 +1591,14 @@ Address: %4 &Export &تصدير - - Export the data in the current tab to a file - - Backup Wallet نسخ احتياط للمحفظة - - Wallet Data (*.dat) - - Backup Failed فشل النسخ الاحتياطي - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - Backup Successful نجاح النسخ الاحتياطي @@ -2588,78 +1606,14 @@ Address: %4 bitcoin-core - - Usage: - المستخدم - - - List commands - اعرض الأوامر - - - Get help for a command - مساعدة في كتابة الاوامر - Options: خيارات: - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - Specify data directory حدد مجلد المعلومات - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - Use the test network استخدم التحقق من الشبكه @@ -2668,204 +1622,6 @@ Address: %4 Accept connections from outside (default: 1 if no -proxy or -connect) قبول الاتصالات من خارج - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - Error: Disk space is low! تحذير: مساحة القرص منخفضة @@ -2883,293 +1639,25 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. فشل في الاستماع على أي منفذ. استخدام الاستماع = 0 إذا كنت تريد هذا. - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - عنوان اونيون غير صحيح : '%s' - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - + Invalid -onion address: '%s' + عنوان اونيون غير صحيح : '%s' Verifying wallet... التحقق من المحفظة ... - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - Wallet options: خيارات المحفظة : - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information معلومات - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - Signing transaction failed فشل توقيع المعاملة - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - System error: خطأ في النظام : @@ -3186,18 +1674,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Transaction too large المعاملة طويلة جدا - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - Warning تحذير @@ -3206,58 +1682,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: This version is obsolete, upgrade required! تحذير : هذا الاصدار قديم , يتطلب التحديث - - Zapping all transactions from wallet... - - - - on startup - - - - version - النسخة - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - Upgrade wallet to latest format تحديث المحفظة للنسخة الاخيرة - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - Server private key (default: server.pem) المفتاح الخاص بالسيرفر (default: server.pem) @@ -3266,14 +1694,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message رسالة المساعدة هذه - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - Loading addresses... تحميل العنوان @@ -3282,41 +1702,13 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted خطأ عند تنزيل wallet.dat: المحفظة تالفة - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - خطأ عند تنزيل wallet.dat: المحفظة تتطلب نسخة أحدث من بتكوين - - - Wallet needed to be rewritten: restart Bitcoin to complete - المحفظة تحتاج لإعادة إنشاء: أعد تشغيل بتكوين للإتمام - Error loading wallet.dat خطأ عند تنزيل wallet.dat - Invalid -proxy address: '%s' - عنوان البروكسي غير صحيح : '%s' - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - + Invalid -proxy address: '%s' + عنوان البروكسي غير صحيح : '%s' Invalid amount @@ -3326,22 +1718,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Insufficient funds اموال غير كافية - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - Loading wallet... تحميل المحفظه - - Cannot downgrade wallet - - Cannot write default address لايمكن كتابة العنوان الافتراضي @@ -3362,11 +1742,5 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error خطأ - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_be_BY.ts b/src/qt/locale/bitcoin_be_BY.ts index c384aa6d2d..8fac417b73 100644 --- a/src/qt/locale/bitcoin_be_BY.ts +++ b/src/qt/locale/bitcoin_be_BY.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -41,34 +9,10 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address Стварыць новы адрас - - &New - - Copy the currently selected address to the system clipboard Капіяваць пазначаны адрас у сістэмны буфер абмену - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - &Export Экспарт @@ -77,59 +21,11 @@ This product includes software developed by the OpenSSL Project for use in the O &Delete Выдаліць - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - Comma separated file (*.csv) Коскамі падзелены файл (*.csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -147,10 +43,6 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase Увядзіце кодавую фразу @@ -163,10 +55,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Паўтарыце новую кодавую фразу - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Увядзіце новую кодавую фразу для гаманца. <br/>Калі ласка, ўжывайце пароль <b>не меньша за 10 адвольных сімвалаў</b>, ці <b>болей васьмі слоў</b>. - Encrypt wallet Зашыфраваць гаманец. @@ -199,29 +87,13 @@ This product includes software developed by the OpenSSL Project for use in the O Confirm wallet encryption Пацвердзіце шыфраванне гаманца - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - Wallet encrypted Гаманец зашыфраваны Bitcoin 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. - Bitcoin зачыняецца дзеля завяршэння працэсса шыфравання. Памятайце, што шыфраванне гаманца цалкам абараняе вашыя сродкі ад скрадання шкоднымі праграмамі якія могуць пранікнуць у ваш камп'ютар. + Bitcoin зачыняецца дзеля завяршэння працэсса шыфравання. Памятайце, што шыфраванне гаманца цалкам абараняе вашыя сродкі ад скрадання шкоднымі праграмамі якія могуць пранікнуць у ваш камп'ютар. Wallet encryption failed @@ -247,17 +119,9 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet decryption failed Расшыфраванне гаманца няўдалае - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - Synchronizing with network... Сінхранізацыя з сецівам... @@ -266,10 +130,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Overview Агляд - - Node - - Show general overview of wallet Паказвае агульныя звесткі аб гаманцы @@ -290,10 +150,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application Выйсці з праграмы - - Show information about Bitcoin - Паказаць звесткі пра Біткойн - About &Qt Аб Qt @@ -306,46 +162,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Options... Опцыі... - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - Backup wallet to another location Зрабіце копію гаманца ў іншае месца @@ -354,26 +170,6 @@ This product includes software developed by the OpenSSL Project for use in the O Change the passphrase used for wallet encryption Змяніць пароль шыфравання гаманца - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - - - Wallet - - &Send Даслаць @@ -382,26 +178,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Receive Атрымаць - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - &File Ф&айл @@ -414,110 +190,18 @@ This product includes software developed by the OpenSSL Project for use in the O &Help Дапамога - - Tabs toolbar - - [testnet] [testnet] - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Bitcoin кліент - %n active connection(s) to Bitcoin network %n актыўнае злучэнне з Bitcoin-сецівам%n актыўных злучэнняў з Bitcoin-сецівам - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - Error Памылка - - Warning - - - - Information - - Up to date Сінхранізавана @@ -554,68 +238,12 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Гаманец <b>зашыфраваны</b> і зараз <b>заблакаваны</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount Колькасць @@ -628,18 +256,10 @@ Address: %4 Date Дата - - Confirmations - - Confirmed Пацверджана - - Priority - - Copy address Капіяваць адрас @@ -656,147 +276,11 @@ Address: %4 Copy transaction ID Капіяваць ID транзакцыі - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) непазначаны - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -807,14 +291,6 @@ Address: %4 &Label Пазнака - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address Адрас @@ -836,12 +312,8 @@ Address: %4 Рэдагаваць адрас дасылання - The entered address "%1" is already in the address book. - Уведзены адрас "%1" ужо ў кніге адрасоў - - - The entered address "%1" is not a valid Bitcoin address. - + The entered address "%1" is already in the address book. + Уведзены адрас "%1" ужо ў кніге адрасоў Could not unlock wallet. @@ -854,756 +326,71 @@ Address: %4 FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - - - version - - Usage: Ужыванне: - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - Error Памылка - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog Options Опцыі - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage Form Форма - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - <b>Recent transactions</b> <b>Нядаўнія транзаццыі</b> - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - + Amount + Колькасць - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Увядзіце Біткойн-адрас (ўзор 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - &Label: Пазнака: - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - Copy label Капіяваць пазнаку - - Copy message - - Copy amount Капіяваць колькасць @@ -1611,34 +398,6 @@ Address: %4 ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address Адрас @@ -1651,19 +410,7 @@ Address: %4 Label Пазнака - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel @@ -1674,10 +421,6 @@ Address: %4 Label Пазнака - - Message - - Amount Колькасць @@ -1686,93 +429,17 @@ Address: %4 (no label) непазначаны - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins Даслаць Манеты - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Даслаць адразу некалькім атрымальнікам - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - Balance: Баланс: @@ -1781,115 +448,23 @@ Address: %4 Confirm the send action Пацвердзіць дасыланне - - S&end - - Confirm send coins Пацвердзіць дасыланне манет - - %1 to %2 - - - - Copy quantity - - Copy amount Капіяваць колькасць - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - The amount to pay must be larger than 0. Велічыня плацяжу мае быць больш за 0. - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) непазначаны - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry @@ -1900,10 +475,6 @@ Address: %4 Pay &To: Заплаціць да: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - Enter a label for this address to add it to your address book Увядзіце пазнаку гэтаму адрасу, каб дадаць яго ў адрасную кнігу @@ -1912,14 +483,6 @@ Address: %4 &Label: Пазнака: - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt+A @@ -1932,72 +495,12 @@ Address: %4 Alt+P Alt+P - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - Alt+A Alt+A @@ -2010,125 +513,9 @@ Address: %4 Alt+P Alt+P - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Увядзіце Біткойн-адрас (ўзор 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - [testnet] [testnet] @@ -2136,25 +523,9 @@ Address: %4 TrafficGraphWidget - - KB/s - - - + TransactionDesc - - Open until %1 - - - - conflicted - - - - %1/offline - - %1/unconfirmed %1/непацверджана @@ -2163,118 +534,22 @@ Address: %4 %1 confirmations %1 пацверджанняў - - Status - - - - , broadcast through %n node(s) - - Date Дата - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - + ID Amount Колькасць - - true - - - - false - - , has not been successfully broadcast yet , пакуль не было паспяхова транслявана - - Open for %n more block(s) - - unknown невядома @@ -2305,22 +580,6 @@ Address: %4 Address Адрас - - Amount - Колькасць - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - - - Open until %1 - - Confirmed (%1 confirmations) Пацверджана (%1 пацверджанняў) @@ -2333,22 +592,6 @@ Address: %4 Generated but not accepted Згенеравана, але не прынята - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with Прынята з @@ -2472,30 +715,6 @@ Address: %4 Edit label Рэдагаваць пазнаку - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Коскамі падзелены файл (*.csv) @@ -2520,10 +739,6 @@ Address: %4 Address Адрас - - Amount - Колькасць - ID ID @@ -2537,13 +752,12 @@ Address: %4 да + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2557,49 +771,9 @@ Address: %4 &Export Экспарт - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - Ужыванне: - - - List commands - Спіс каманд - - - Get help for a command - Атрымаць дапамогу для каманды - Options: Опцыі: @@ -2624,14 +798,6 @@ Address: %4 Maintain at most <n> connections to peers (default: 125) Трымаць не больш за <n> злучэнняў на асобу (зыходна: 125) - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - Threshold for disconnecting misbehaving peers (default: 100) Парог для адлучэння злаўмысных карыстальнікаў (тыпова: 100) @@ -2640,22 +806,10 @@ Address: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Колькасць секунд для ўстрымання асобаў да перадалучэння (заходна: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - Accept command line and JSON-RPC commands Прымаць камандны радок і JSON-RPC каманды - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Запусціць у фоне як дэман і прымаць каманды @@ -2664,576 +818,18 @@ Address: %4 Use the test network Ужываць тэставае сеціва - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file Слаць trace/debug звесткі ў кансоль замест файла debug.log - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - Username for JSON-RPC connections Імя карыстальника для JSON-RPC злучэнняў - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - Password for JSON-RPC connections Пароль для JSON-RPC злучэнняў - - Allow JSON-RPC connections from specified IP address - Дазволіць JSON-RPC злучэнні з пэўнага IP адрасу - - - Send commands to node running on <ip> (default: 127.0.0.1) - Адпраўляць каманды вузлу на <ip> (зыходна: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Выканаць каманду калі лепшы блок зменіцца (%s замяняецца на хэш блока) @@ -3262,18 +858,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Server private key (default: server.pem) Прыватны ключ сервера (зыходна: server.pem) - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - Loading addresses... Загружаем адрасы... @@ -3282,42 +866,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted Памылка загрузкі wallet.dat: гаманец пашкоджаны - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Памылка загрузкі wallet.dat: гаманец патрабуе новую версію Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - Гаманец мае быць перазапісаны: патрэбны перазапуск Bitcoin для выканання - Error loading wallet.dat Памылка загрузкі wallet.dat - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - Invalid amount Памылковая колькасць @@ -3330,22 +882,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Loading block index... Загружаем індэкс блокаў... - - Add a node to connect to and attempt to keep the connection open - - Loading wallet... Загружаем гаманец... - - Cannot downgrade wallet - - - - Cannot write default address - - Rescanning... Перасканаванне... @@ -3354,19 +894,9 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Done loading Загрузка выканана - - To use the %s option - - Error Памылка - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_bg.ts b/src/qt/locale/bitcoin_bg.ts index 367e223784..11bf594a42 100644 --- a/src/qt/locale/bitcoin_bg.ts +++ b/src/qt/locale/bitcoin_bg.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Това е експериментален софтуер. - -Разпространява се под MIT/X11 софтуерен лиценз, виж COPYING или http://www.opensource.org/licenses/mit-license.php. - -Използван е софтуер, разработен от OpenSSL Project за употреба в OpenSSL Toolkit (http://www.openssl.org/), криптографски софтуер разработен от Eric Young (eay@cryptsoft.com) и UPnP софтуер разработен от Thomas Bernard. - - - Copyright - Авторски права - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -46,22 +9,10 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address Създаване на нов адрес - - &New - - Copy the currently selected address to the system clipboard Копиране на избрания адрес - - &Copy - - - - C&lose - - &Copy Address &Копирай @@ -74,26 +25,10 @@ This product includes software developed by the OpenSSL Project for use in the O Export the data in the current tab to a file Запишете данните от текущия раздел във файл - - &Export - - &Delete &Изтриване - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - Sending addresses Адреси за изпращане @@ -102,14 +37,6 @@ This product includes software developed by the OpenSSL Project for use in the O Receiving addresses Адреси за получаване - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - Copy &Label Копирай &име @@ -130,11 +57,7 @@ This product includes software developed by the OpenSSL Project for use in the O Exporting Failed Грешка при изнасянето - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -152,10 +75,6 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase Въведи парола @@ -168,10 +87,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Още веднъж - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Въведете нова парола за портфейла.<br/>Моля използвайте <b>поне 10 случайни символа</b> или <b>8 или повече думи</b>. - Encrypt wallet Криптиране на портфейла @@ -206,7 +121,7 @@ This product includes software developed by the OpenSSL Project for use in the O Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - + ВНИМАНИЕ: Ако защитите вашият портфейл и изгубите ключовата дума, вие ще <b>ИЗГУБИТЕ ВСИЧКИТЕ СИ БИТКОЙНОВЕ</b>! Are you sure you wish to encrypt your wallet? @@ -214,7 +129,7 @@ This product includes software developed by the OpenSSL Project for use in the O 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. - + ВАЖНО: Всякакви стари бекъп версии, които сте направили на вашият портфейл трябва да бъдат заменени със ново-генерирания, криптиран портфейл файл. От съображения за сигурност, предишните бекъпи на некриптираните портфейли ще станат неизползваеми веднага щом започнете да използвате новият криптиран портфейл. Warning: The Caps Lock key is on! @@ -271,10 +186,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Overview &Баланс - - Node - - Show general overview of wallet Обобщена информация за портфейла @@ -295,10 +206,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application Изход от приложението - - Show information about Bitcoin - Информация за Биткоин - About &Qt За &Qt @@ -323,50 +230,14 @@ This product includes software developed by the OpenSSL Project for use in the O &Change Passphrase... &Смяна на паролата... - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - Send coins to a Bitcoin address Изпращане към Биткоин адрес - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - Change the passphrase used for wallet encryption Променя паролата за портфейла - - &Debug window - - - - Open debugging and diagnostic console - - &Verify message... &Проверка на съобщение... @@ -381,32 +252,16 @@ This product includes software developed by the OpenSSL Project for use in the O &Send - - - - &Receive - + &Изпращане &Show / Hide - + &Покажи / Скрий Show or hide the main Window Показване и скриване на основния прозорец - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - &File &Файл @@ -427,58 +282,10 @@ This product includes software developed by the OpenSSL Project for use in the O [testnet] [testnet] - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - %n active connection(s) to Bitcoin network %n връзка към Биткоин мрежата%n връзки към Биткоин мрежата - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - %n hour(s) %n час%n часа @@ -499,18 +306,6 @@ This product includes software developed by the OpenSSL Project for use in the O %n year(s) %n година%n години - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - Error Грешка @@ -539,14 +334,6 @@ This product includes software developed by the OpenSSL Project for use in the O Incoming transaction Входяща трансакция - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> Портфейлът е <b>криптиран</b> и <b>отключен</b> @@ -555,28 +342,12 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Портфейлът е <b>криптиран</b> и <b>заключен</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - Bytes: Байтове: @@ -593,30 +364,6 @@ Address: %4 Fee: Такса: - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount Сума @@ -653,94 +400,6 @@ Address: %4 Copy amount Копирай сума - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - Прах - yes да @@ -749,55 +408,11 @@ Address: %4 no не - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (без име) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -808,14 +423,6 @@ Address: %4 &Label &Име - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Адрес @@ -837,12 +444,12 @@ Address: %4 Редактиране на изходящ адрес - The entered address "%1" is already in the address book. - Вече има адрес "%1" в списъка с адреси. + The entered address "%1" is already in the address book. + Вече има адрес "%1" в списъка с адреси. - The entered address "%1" is not a valid Bitcoin address. - "%1" не е валиден Биткоин адрес. + The entered address "%1" is not a valid Bitcoin address. + "%1" не е валиден Биткоин адрес. Could not unlock wallet. @@ -863,29 +470,13 @@ Address: %4 name име - - Directory already exists. Add %1 if you intend to create a new directory here. - - Path already exists, and is not a directory. Пътят вече съществува и не е папка. - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - version версия @@ -894,105 +485,25 @@ Address: %4 Usage: Използване: - - command-line options - - UI options UI Опции - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro Welcome Добре дошли - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - Биткоин - - - Error: Specified data directory "%1" can not be created. - - Error Грешка - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog @@ -1003,94 +514,18 @@ Address: %4 &Main &Основни - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - Pay transaction &fee &Такса за изходяща трансакция - - Automatically start Bitcoin after logging in to the system. - - &Start Bitcoin on system login &Пускане на Биткоин при вход в системата - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - &Network &Мрежа - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Автоматично отваряне на входящия Bitcoin порт. Работи само с рутери поддържащи UPnP. @@ -1101,7 +536,7 @@ Address: %4 Proxy &IP: - + Прокси & АйПи: &Port: @@ -1109,15 +544,7 @@ Address: %4 Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - + Порт на прокси сървъра (пр. 9050) &Window @@ -1159,50 +586,18 @@ Address: %4 Choose the default subdivision unit to show in the interface and when sending coins. Изберете единиците, показвани по подразбиране в интерфейса. - - Whether to show Bitcoin addresses in the transaction list or not. - Ще се показват адресите в списъка с трансакции независимо от наличието на кратко име. - - - &Display addresses in transaction list - &Адреси в списъка с трансакции - - - Whether to show coin control features or not. - - &OK - + ОК &Cancel - + Отказ default подразбиране - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - The supplied proxy address is invalid. Прокси адресът е невалиден. @@ -1214,10 +609,6 @@ Address: %4 Form Форма - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - Wallet Портфейл @@ -1226,26 +617,10 @@ Address: %4 Available: Налично: - - Your current spendable balance - - Pending: Изчакващо: - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - Total: Общо: @@ -1265,121 +640,28 @@ Address: %4 PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - Payment acknowledged Плащането е приета - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - Биткоин + Amount + Сума - Error: Specified data directory "%1" does not exist. - + N/A + N/A - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Въведете Биткоин адрес (например 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole @@ -1396,23 +678,11 @@ Address: %4 &Information - - - - Debug window - - - - General - + Данни Using OpenSSL version - - - - Startup time - + Използване на OpenSSL версия Network @@ -1426,173 +696,45 @@ Address: %4 Number of connections Брой връзки - - Block chain - - Current number of blocks Текущ брой блокове - - Estimated total blocks - Предвидени общо блокове - Last block time Време на последния блок - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - + Общо: Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - + Отворете Биткой дебъг лог файла от настоящата Data папка. Може да отнеме няколко секунди при по - големи лог файлове. Clear console Изчисти конзолата - - Welcome to the Bitcoin RPC console. - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. Използвайте стрелки надолу и нагореза разглеждане на историятаот команди и <b>Ctrl-L</b> за изчистване на конзолата. - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - &Label: &Име: - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - Clear Изчистване - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - Show Показване - - Remove the selected entries from the list - - Remove Премахване @@ -1612,34 +754,10 @@ Address: %4 ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - Payment information Данни за плащането - - URI - - Address Адрес @@ -1656,10 +774,6 @@ Address: %4 Message Съобщение - - Resulting URI too long, try to reduce the text for label / message. - - Error encoding URI into QR Code. Грешка при създаването на QR Code от URI. @@ -1687,41 +801,13 @@ Address: %4 (no label) (без име) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins Изпращане - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - Bytes: Байтове: @@ -1738,26 +824,6 @@ Address: %4 Fee: Такса: - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Изпращане към повече от един получател @@ -1766,10 +832,6 @@ Address: %4 Add &Recipient Добави &получател - - Clear all fields of the form. - - Clear &All &Изчисти @@ -1790,46 +852,10 @@ Address: %4 Confirm send coins Потвърждаване - - %1 to %2 - - - - Copy quantity - - Copy amount Копирай сума - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - or или @@ -1846,34 +872,14 @@ Address: %4 The amount exceeds your balance. Сумата надвишава текущия баланс - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - Transaction creation failed! Грешка при създаването на трансакция! - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (без име) - - Warning: Unknown change address - - Are you sure you want to send? Наистина ли искате да изпратите? @@ -1882,14 +888,6 @@ Address: %4 added as transaction fee добавено като такса за трансакция - - Payment request expired - - - - Invalid payment address %1 - - SendCoinsEntry @@ -1901,10 +899,6 @@ Address: %4 Pay &To: Плати &На: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - Enter a label for this address to add it to your address book Въведете име за този адрес, за да го добавите в списъка с адреси @@ -1913,10 +907,6 @@ Address: %4 &Label: &Име: - - Choose previously used address - - This is a normal payment. Това е нормално плащане. @@ -1941,42 +931,14 @@ Address: %4 Message: Съобщение: - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - Pay To: Плащане на: - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog @@ -1991,14 +953,6 @@ Address: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Можете да подпишете съобщение като доказателство, че притежавате определен адрес. Бъдете внимателни и не подписвайте съобщения, които биха разкрили лична информация без вашето съгласие. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Адресът, с който ще подпишете съобщението (например 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Choose previously used address - - Alt+A Alt+A @@ -2029,11 +983,7 @@ Address: %4 Sign &Message - - - - Reset all sign message fields - + Подпиши &съобщение Clear &All @@ -2043,33 +993,13 @@ Address: %4 &Verify Message &Провери - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Адресът, с който е подписано съобщението (например 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address Проверете съобщение, за да сте сигурни че е подписано с определен Биткоин адрес - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Въведете Биткоин адрес (например 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Натиснете "Подписване на съобщение" за да създадете подпис + Click "Sign Message" to generate signature + Натиснете "Подписване на съобщение" за да създадете подпис The entered address is invalid. @@ -2079,13 +1009,9 @@ Address: %4 Please check the address and try again. Моля проверете адреса и опитайте отново. - - The entered address does not refer to a key. - - Wallet unlock was cancelled. - + Отключването на портфейла беше отменено. Private key for the entered address is not available. @@ -2122,14 +1048,6 @@ Address: %4 SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - [testnet] [testnet] @@ -2137,21 +1055,13 @@ Address: %4 TrafficGraphWidget - - KB/s - - - + TransactionDesc Open until %1 Подлежи на промяна до %1 - - conflicted - - %1/offline %1/офлайн @@ -2168,10 +1078,6 @@ Address: %4 Status Статус - - , broadcast through %n node(s) - - Date Дата @@ -2204,13 +1110,9 @@ Address: %4 Credit Кредит - - matures in %n more block(s) - - not accepted - + не е приет Debit @@ -2240,22 +1142,10 @@ Address: %4 Merchant Търговец - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - Transaction Трансакция - - Inputs - - Amount Сума @@ -2272,10 +1162,6 @@ Address: %4 , has not been successfully broadcast yet , все още не е изпратено - - Open for %n more block(s) - - unknown неизвестен @@ -2306,18 +1192,6 @@ Address: %4 Address Адрес - - Amount - Сума - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - Open until %1 Подлежи на промяна до %1 @@ -2334,10 +1208,6 @@ Address: %4 Generated but not accepted Генерирана, но отхвърлена от мрежата - - Offline - - Unconfirmed Непотвърдено @@ -2465,10 +1335,6 @@ Address: %4 Copy amount Копирай сума - - Copy transaction ID - - Edit label Редактирай име @@ -2485,18 +1351,10 @@ Address: %4 Exporting Failed Грешка при изнасянето - - There was an error trying to save the transaction history to %1. - - Exporting Successful Изнасянето е успешна - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) CSV файл (*.csv) @@ -2521,10 +1379,6 @@ Address: %4 Address Адрес - - Amount - Сума - ID ИД @@ -2538,6 +1392,9 @@ Address: %4 до + + UnitDisplayStatusBarControl + WalletFrame @@ -2554,53 +1411,17 @@ Address: %4 WalletView - - &Export - - Export the data in the current tab to a file Запишете данните от текущия раздел във файл Backup Wallet - + Запазване на портфейла - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - Използване: - - - List commands - Вписване на команди - - - Get help for a command - Получете помощ за команда - Options: Опции: @@ -2609,30 +1430,10 @@ Address: %4 Specify configuration file (default: bitcoin.conf) Задаване на файл с настройки (по подразбиране bitcoin.conf) - - Specify pid file (default: bitcoind.pid) - - Specify data directory Определете директория за данните - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - Threshold for disconnecting misbehaving peers (default: 100) Праг на прекъсване на връзката при непорядъчно държащи се пиъри (по подразбиране:100) @@ -2641,147 +1442,13 @@ Address: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Брой секунди до възтановяване на връзката за зле държащите се пиъри (по подразбиране:86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - Use the test network Използвайте тестовата мрежа - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - + Внимание: -paytxfee има голяма стойност! Това е таксата за транзакциите, която ще платите ако направите транзакция. (default: 1) @@ -2791,97 +1458,21 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. (default: wallet.dat) (по подразбиране wallet.dat) - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - Connection options: Настройки на връзката: - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - Error: Disk space is low! Грешка: мястото на диска е малко! - - Error: Wallet locked, unable to create transaction! - - Error: system error: Грешка: системна грешка: Failed to listen on any port. Use -listen=0 if you want this. - + Провалено "слушане" на всеки порт. Използвайте -listen=0 ако искате това. Failed to read block info @@ -2891,14 +1482,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to read block Грешка при четене на блок - - Failed to sync block index - - - - Failed to write block index - - Failed to write block info Грешка при запис данни на блок @@ -2907,110 +1490,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write block Грешка при запис на блок - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - Importing... Внасяне... - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - Verifying blocks... Проверка на блоковете... @@ -3019,157 +1502,25 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Verifying wallet... Проверка на портфейла... - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - Wallet options: Настройки на портфейла: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information Данни - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file Изпрати локализиращата или дебъг информацията към конзолата, вместо файлът debug.log Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - + Задайте минимален размер на блок-а в байтове (подразбиране: 0) Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - + Определете таймаут за свързване в милисекунди (подразбиране: 5000) System error: @@ -3187,14 +1538,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Transaction too large Трансакцията е твърде голяма - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - Username for JSON-RPC connections Потребителско име за JSON-RPC връзките @@ -3205,48 +1548,16 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - версия - - - wallet.dat corrupt, salvage failed - + Внимание: Използвате остаряла версия, необходимо е обновление! Password for JSON-RPC connections Парола за JSON-RPC връзките - - Allow JSON-RPC connections from specified IP address - Разреши JSON-RPC връзките от отучнен IP адрес - - - Send commands to node running on <ip> (default: 127.0.0.1) - Изпрати команди до възел функциониращ на <ip> (По подразбиране: 127.0.0.1) - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - Upgrade wallet to latest format Обновяване на портфейла до най-новия формат - - Set key pool size to <n> (default: 100) - - Rescan the block chain for missing wallet transactions Повторно сканиране на блок-връзка за липсващи портфейлни трансакции @@ -3267,14 +1578,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message Това помощно съобщение - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - Loading addresses... Зареждане на адресите... @@ -3283,45 +1586,13 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted Грешка при зареждане на wallet.dat: портфейлът е повреден - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Грешка при зареждане на wallet.dat: портфейлът изисква по-нова версия на Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - - Error loading wallet.dat Грешка при зареждане на wallet.dat - Invalid -proxy address: '%s' - Невалиден -proxy address: '%s' - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - + Invalid -proxy address: '%s' + Невалиден -proxy address: '%s' Insufficient funds @@ -3331,22 +1602,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Loading block index... Зареждане на блок индекса... - - Add a node to connect to and attempt to keep the connection open - - Loading wallet... Зареждане на портфейла... - - Cannot downgrade wallet - - - - Cannot write default address - - Rescanning... Преразглеждане на последовтелността от блокове... @@ -3355,19 +1614,9 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Done loading Зареждането е завършено - - To use the %s option - - Error Грешка - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_bs.ts b/src/qt/locale/bitcoin_bs.ts index 2ec28af777..fc5e6d270e 100644 --- a/src/qt/locale/bitcoin_bs.ts +++ b/src/qt/locale/bitcoin_bs.ts @@ -1,2395 +1,130 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage - - Double-click to edit address or label - - - - Create a new address - - - - &New - - - - Copy the currently selected address to the system clipboard - - - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - - - &Delete - - - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - - - Comma separated file (*.csv) - - - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel - - Label - - - - Address - - - - (no label) - - - + AskPassphraseDialog - - Passphrase Dialog - - - - Enter passphrase - - - - New passphrase - - - - Repeat new passphrase - - - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - - - - Encrypt wallet - - - - This operation needs your wallet passphrase to unlock the wallet. - - - - Unlock wallet - - - - This operation needs your wallet passphrase to decrypt the wallet. - - - - Decrypt wallet - - - - Change passphrase - - - - Enter the old and new passphrase to the wallet. - - - - Confirm wallet encryption - - - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - - - Wallet encrypted - - - - Bitcoin 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. - - - - Wallet encryption failed - - - - Wallet encryption failed due to an internal error. Your wallet was not encrypted. - - - - The supplied passphrases do not match. - - - - Wallet unlock failed - - - - The passphrase entered for the wallet decryption was incorrect. - - - - Wallet decryption failed - - - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - - - Synchronizing with network... - - - - &Overview - - - - Node - - - - Show general overview of wallet - - - - &Transactions - - - - Browse transaction history - - - - E&xit - - - - Quit application - - - - Show information about Bitcoin - - - - About &Qt - - - - Show information about Qt - - - - &Options... - - - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - - - Change the passphrase used for wallet encryption - - - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - Bitcoin Bitcoin - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - - - &File - - - - &Settings - - - - &Help - - - - Tabs toolbar - - - - [testnet] - - Bitcoin Core Bitcoin Jezrga - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - - - %n active connection(s) to Bitcoin network - - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - - - Error - - - - Warning - - - - Information - - - - Up to date - - - - Catching up... - - - - Sent transaction - - - - Incoming transaction - - - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> - - - - Wallet is <b>encrypted</b> and currently <b>locked</b> - - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - - + ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - - - Amount - - - - Address - - - - Date - - - - Confirmations - - - - Confirmed - - - - Priority - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - - - (no label) - - - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog - - Edit Address - - - - &Label - - - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - - - &Address - - - - New receiving address - - - - New sending address - - - - Edit receiving address - - - - Edit sending address - - - - The entered address "%1" is already in the address book. - - - - The entered address "%1" is not a valid Bitcoin address. - - - - Could not unlock wallet. - - - - New key generation failed. - - - + FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - Bitcoin Core - Command-line options - + Bitcoin Core + Bitcoin Jezrga + + + Intro Bitcoin Core Bitcoin Jezrga - - version - - - - Usage: - - - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - - - Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - - - - Error - - - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog - - Options - - - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage - - Form - - - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - - - <b>Recent transactions</b> - - - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - - - &Label: - - - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - - - Copy label - - - - Copy message - - - - Copy amount - - - + ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - - - Address - - - - Amount - - - - Label - - - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel - - Date - - - - Label - - - - Message - - - - Amount - - - - (no label) - - - - (no message) - - - - (no amount) - - - + SendCoinsDialog - - Send Coins - - - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - - - Send to multiple recipients at once - - - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - - - Balance: - - - - Confirm the send action - - - - S&end - - - - Confirm send coins - - - - %1 to %2 - - - - Copy quantity - - - - Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - - - The amount to pay must be larger than 0. - - - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - - - (no label) - - - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry - - A&mount: - - - - Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Enter a label for this address to add it to your address book - - - - &Label: - - - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt+A - - Paste address from clipboard - - Alt+P Alt+P - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - Alt+A Alt+A - - Paste address from clipboard - - Alt+P Alt+P - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen Bitcoin Core Bitcoin Jezrga - - The Bitcoin Core developers - - - - [testnet] - - - + TrafficGraphWidget - - KB/s - - - + TransactionDesc - - Open until %1 - - - - conflicted - - - - %1/offline - - - - %1/unconfirmed - - - - %1 confirmations - - - - Status - - - - , broadcast through %n node(s) - - - - Date - - - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - - - Amount - - - - true - - - - false - - - - , has not been successfully broadcast yet - - - - Open for %n more block(s) - - - - unknown - - - + TransactionDescDialog - - Transaction details - - - - This pane shows a detailed description of the transaction - - - + TransactionTableModel - - Date - - - - Type - - - - Address - - - - Amount - - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - - - Open until %1 - - - - Confirmed (%1 confirmations) - - - - This block was not received by any other nodes and will probably not be accepted! - - - - Generated but not accepted - - - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - - - Received with - - - - Received from - - - - Sent to - - - - Payment to yourself - - - - Mined - - - - (n/a) - - - - Transaction status. Hover over this field to show number of confirmations. - - - - Date and time that the transaction was received. - - - - Type of transaction. - - - - Destination address of transaction. - - - - Amount removed from or added to balance. - - - + TransactionView @@ -2400,10 +135,6 @@ Address: %4 Today Danas - - This week - - This month Ovaj mjesec @@ -2416,953 +147,20 @@ Address: %4 This year Ove godine - - Range... - - - - Received with - - - - Sent to - - - - To yourself - - - - Mined - - - - Other - - - - Enter address or label to search - - - - Min amount - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - - - Comma separated file (*.csv) - - - - Confirmed - - - - Date - - - - Type - - - - Label - - - - Address - - - - Amount - - - - ID - - - - Range: - - - - to - - - + + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel - - Send Coins - - - + WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - - - Options: - - - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - - - Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - - - Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - - - Done loading - - - - To use the %s option - - - - Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - - + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_ca.ts b/src/qt/locale/bitcoin_ca.ts index c225967cac..0d45ab63b6 100644 --- a/src/qt/locale/bitcoin_ca.ts +++ b/src/qt/locale/bitcoin_ca.ts @@ -1,133 +1,101 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage Double-click to edit address or label - Doble click per editar l'adreça o l'etiqueta + Feu doble clic per editar l'adreça o l'etiqueta Create a new address - Crear una nova adrça + Crea una nova adreça &New - + &Nova Copy the currently selected address to the system clipboard - Copia la selecció actual al porta-retalls del sistema + Copia l'adreça seleccionada al porta-retalls del sistema &Copy - + &Copia C&lose - + &Tanca &Copy Address - + &Copia l'adreça Delete the currently selected address from the list - + Elimina l'adreça sel·leccionada actualment de la llista Export the data in the current tab to a file - + Exporta les dades de la pestanya actual a un fitxer &Export - + &Exporta &Delete - &Eliminar + &Elimina Choose the address to send coins to - + Trieu una adreça on voleu enviar monedes Choose the address to receive coins with - + Trieu l'adreça on voleu rebre monedes C&hoose - + T&ria Sending addresses - + S'estan enviant les adreces Receiving addresses - + S'estan rebent les adreces These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - + Aquestes són les vostres adreces de Bitcoin per enviar els pagaments. Sempre reviseu l'import i l'adreça del destinatari abans de transferir monedes. These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - + Aquestes són les vostres adreces Bitcoin per rebre pagaments. Es recomana utilitzar una adreça nova de recepció per a cada transacció. Copy &Label - + Copia l'&etiqueta &Edit - + &Edita Export Address List - + Exporta la llista d'adreces Comma separated file (*.csv) - Fitxer separat per comes (*.csv) + Fitxer de separació amb comes (*.csv) Exporting Failed - + L'exportació ha fallat - There was an error trying to save the address list to %1. - + There was an error trying to save the address list to %1. Please try again. + S'ha produït un error en desar la llista d'adreces a %1. Torneu-ho a provar. @@ -149,130 +117,130 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog Passphrase Dialog - + Diàleg de contrasenya Enter passphrase - Introduïu la frase-contrasenya + Introduïu una contrasenya New passphrase - Nova frase-contrasenya + Nova contrasenya Repeat new passphrase - Repetiu la nova frase-contrasenya - - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Introduïu la nova frase-contrasenya per a la cartera.<br/>Empreu una frase-contrasenya de <b>10 o més caràcters aleatoris<b/>, o <b>vuit o més paraules<b/>. + Repetiu la nova contrasenya Encrypt wallet - Encriptar cartera + Encripta el moneder This operation needs your wallet passphrase to unlock the wallet. - Cal que introduïu la frase-contrasenya de la cartera per a desbloquejar-la. + Aquesta operació requereix la contrasenya del moneder per a desbloquejar-lo. Unlock wallet - Desbloquejar cartera + Desbloqueja el moneder This operation needs your wallet passphrase to decrypt the wallet. - Cal que introduïu la frase-contrasenya de la cartera per a desencriptar-la. + Aquesta operació requereix la contrasenya del moneder per desencriptar-lo. Decrypt wallet - Desencriptar cartera + Desencripta el moneder Change passphrase - Canviar frase-contrasenya + Canvia la contrasenya Enter the old and new passphrase to the wallet. - Introduïu l'antiga i la nova frase-contrasenya per a la cartera. + Introduïu tant la contrasenya antiga com la nova del moneder. Confirm wallet encryption - Confirmeu l'encriptació de cartera + Confirma l'encriptació del moneder Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - + Avís: si encripteu el vostre moneder i perdeu la contrasenya, <b>PERDREU TOTS ELS VOSTRES BITCOINS</b>! Are you sure you wish to encrypt your wallet? - + Esteu segur que voleu encriptar el vostre moneder? 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. - + IMPORTANT: Tota copia de seguretat que hàgiu realitzat hauria de ser reemplaçada pel, recentment generat, fitxer encriptat del moneder. Warning: The Caps Lock key is on! - + Avís: Les lletres majúscules estan activades! Wallet encrypted - Cartera encriptada + Moneder encriptat + + + 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>. + Introduïu la contrasenya nova al moneder.<br/>Utilitzeu una contrasenya de <b>deu o més caràcters aleatoris</b>, o <b>vuit o més paraules</b>. Bitcoin 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. - + Bitcoin es tancarà ara per acabar el procés d'encriptació. Recordeu que encriptar el moneder no protegeix completament els bitcoins de ser robats per programari maliciós instal·lat a l'ordinador. Wallet encryption failed - L'encriptació de cartera ha fallat + L'encriptació del moneder ha fallat Wallet encryption failed due to an internal error. Your wallet was not encrypted. - L'encriptació de cartera ha fallat degut a un error intern. La vostra cartera no ha estat encriptada. + L'encriptació del moneder ha fallat per un error intern. El moneder no ha estat encriptat. The supplied passphrases do not match. - Les frases-contrasenya no concorden. + La contrasenya introduïda no coincideix. Wallet unlock failed - El desbloqueig de cartera ha fallat + El desbloqueig del moneder ha fallat The passphrase entered for the wallet decryption was incorrect. - La frase-contrasenya per a la desencriptació de cartera és incorrecta. + La contrasenya introduïda per a desencriptar el moneder és incorrecta. Wallet decryption failed - La desencriptació de cartera ha fallat + La desencriptació del moneder ha fallat Wallet passphrase was successfully changed. - + La contrasenya del moneder ha estat modificada correctament. BitcoinGUI Sign &message... - + Signa el &missatge... Synchronizing with network... - Sincronitzant amb la xarxa... + S'està sincronitzant amb la xarxa ... &Overview - &Visió general + &Panorama general Node - + Node Show general overview of wallet - Mostrar visió general de la cartera + Mostra el panorama general del moneder &Transactions @@ -280,27 +248,23 @@ This product includes software developed by the OpenSSL Project for use in the O Browse transaction history - Exploreu l'historial de transaccions + Cerca a l'historial de transaccions E&xit - + S&urt Quit application - Sortir de l'aplicació - - - Show information about Bitcoin - Informació sobre Bitcoin + Surt de l'aplicació About &Qt - + Quant a &Qt Show information about Qt - + Mostra informació sobre Qt &Options... @@ -308,99 +272,107 @@ This product includes software developed by the OpenSSL Project for use in the O &Encrypt Wallet... - + &Encripta el moneder... &Backup Wallet... - + &Realitza una còpia de seguretat del moneder... &Change Passphrase... - + &Canvia la contrasenya... &Sending addresses... - + Adreces d'e&nviament... &Receiving addresses... - + Adreces de &recepció Open &URI... - + Obre un &URI... + + + Bitcoin Core client + Client del Bitcoin Core Importing blocks from disk... - + S'estan important els blocs del disc... Reindexing blocks on disk... - + S'estan reindexant els blocs al disc... Send coins to a Bitcoin address - + Envia monedes a una adreça Bitcoin Modify configuration options for Bitcoin - + Modifica les opcions de configuració per bitcoin Backup wallet to another location - + Realitza una còpia de seguretat del moneder a una altra ubicació Change the passphrase used for wallet encryption - Canviar frase-contrasenya per a l'escriptació de la cartera + Canvia la contrasenya d'encriptació del moneder &Debug window - + &Finestra de depuració Open debugging and diagnostic console - + Obre la consola de diagnòstic i depuració &Verify message... - + &Verifica el missatge... Bitcoin - + Bitcoin Wallet - + Moneder &Send - + &Envia &Receive - + &Rep + + + Show information about Bitcoin Core + Mostra informació del Bitcoin Core &Show / Hide - + &Mostra / Amaga Show or hide the main Window - + Mostra o amaga la finestra principal Encrypt the private keys that belong to your wallet - + Encripta les claus privades pertanyents al moneder Sign messages with your Bitcoin addresses to prove you own them - + Signa el missatges amb la seva adreça de Bitcoin per provar que les poseeixes Verify messages to ensure they were signed with specified Bitcoin addresses - + Verifiqueu els missatges per assegurar-vos que han estat signats amb una adreça Bitcoin específica. &File @@ -416,7 +388,7 @@ This product includes software developed by the OpenSSL Project for use in the O Tabs toolbar - Barra d'eines + Barra d'eines de les pestanyes [testnet] @@ -424,107 +396,99 @@ This product includes software developed by the OpenSSL Project for use in the O Bitcoin Core - + Nucli de Bitcoin Request payments (generates QR codes and bitcoin: URIs) - + Sol·licita pagaments (genera codis QR i bitcoin: URI) &About Bitcoin Core - + &Quant al Bitcoin Core Show the list of used sending addresses and labels - + Mostra la llista d'adreces d'enviament i etiquetes utilitzades Show the list of used receiving addresses and labels - + Mostra la llista d'adreces de recepció i etiquetes utilitzades Open a bitcoin: URI or payment request - + Obre una bitcoin: sol·licitud d'URI o pagament &Command-line options - + Opcions de la &línia d'ordres Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - + Mostra el missatge d'ajuda del Bitcoin Core per obtenir una llista amb les possibles opcions de línia d'ordres de Bitcoin %n active connection(s) to Bitcoin network - + %n connexió activa a la xarxa Bitcoin%n connexions actives a la xarxa Bitcoin No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - + No hi ha cap font de bloc disponible... Processed %1 blocks of transaction history. - + Proccessats %1 blocs del històric de transaccions. %n hour(s) - + %n hora%n hores %n day(s) - + %n dia%n dies %n week(s) - + %n setmana%n setmanes %1 and %2 - + %1 i %2 %n year(s) - + %n any%n anys %1 behind - + %1 darrere Last received block was generated %1 ago. - + El darrer bloc rebut ha estat generat fa %1. Transactions after this will not yet be visible. - + Les transaccions a partir d'això no seran visibles. Error - + Error Warning - + Avís Information - + Informació Up to date - + Al dia Catching up... - Actualitzant... + S'està posant al dia ... Sent transaction @@ -540,81 +504,77 @@ Amount: %2 Type: %3 Address: %4 - + Data: %1\nImport: %2\n Tipus: %3\n Adreça: %4\n Wallet is <b>encrypted</b> and currently <b>unlocked</b> - La cartera està <b>encriptada<b/> i <b>desbloquejada<b/> + El moneder està <b>encriptat</b> i actualment <b>desbloquejat</b> Wallet is <b>encrypted</b> and currently <b>locked</b> - La cartera està <b>encriptada<b/> i <b>bloquejada<b/> - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - + El moneder està <b>encriptat</b> i actualment <b>bloquejat</b> ClientModel Network Alert - + Alerta de xarxa CoinControlDialog Coin Control Address Selection - + Selecció de l'adreça de control de monedes Quantity: - + Quantitat: Bytes: - + Bytes: Amount: - + Import: Priority: - + Prioritat: Fee: - + Quota: - Low Output: - + Dust: + Polsim: After Fee: - + Quota posterior: Change: - + Canvi: (un)select all - + (des)selecciona-ho tot Tree mode - + Mode arbre List mode - + Mode llista Amount - + Quantitat Address @@ -622,163 +582,151 @@ Address: %4 Date - + Data Confirmations - + Confirmacions Confirmed - + Confirmat Priority - + Prioritat Copy address - + Copiar adreça Copy label - + Copiar etiqueta Copy amount - + Copia l'import Copy transaction ID - + Copiar ID de transacció Lock unspent - + Bloqueja sense gastar Unlock unspent - + Desbloqueja sense gastar Copy quantity - + Copia la quantitat Copy fee - + Copia la comissió Copy after fee - + Copia la comissió posterior Copy bytes - + Copia els bytes Copy priority - + Copia la prioritat - Copy low output - + Copy dust + Copia el polsim Copy change - + Copia el canvi highest - + El més alt higher - + Més alt high - + Alt medium-high - + mig-alt medium - + mig low-medium - + baix-mig low - + baix lower - + més baix lowest - + el més baix (%1 locked) - + (%1 bloquejada) none - + cap - Dust - + Can vary +/- %1 satoshi(s) per input. + Pot variar +/- %1 satoshi(s) per entrada. yes - + no - + no This label turns red, if the transaction size is greater than 1000 bytes. - + Aquesta etiqueta es posa de color vermell si la mida de la transacció és més gran de 1000 bytes. This means a fee of at least %1 per kB is required. - + Això comporta una comissi d'almenys %1 per kB. Can vary +/- 1 byte per input. - + Pot variar +/- 1 byte per entrada. Transactions with higher priority are more likely to get included into a block. - + Les transaccions amb una major prioritat són més propenses a ser incloses en un bloc. - This label turns red, if the priority is smaller than "medium". - + This label turns red, if the priority is smaller than "medium". + Aquesta etiqueta es torna vermella si la prioritat és menor que «mitjana». This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - + Aquesta etiqueta es torna vermella si qualsevol destinatari rep un import inferior a %1. (no label) @@ -786,18 +734,18 @@ Address: %4 change from %1 (%2) - + canvia de %1 (%2) (change) - + (canvia) EditAddressDialog Edit Address - Editar adreça + Editar Adreça &Label @@ -805,11 +753,11 @@ Address: %4 The label associated with this address list entry - + L'etiqueta associada amb aquesta entrada de llista d'adreces The address associated with this address list entry. This can only be modified for sending addresses. - + L'adreça associada amb aquesta entrada de llista d'adreces. Només es pot modificar per a les adreces d'enviament. &Address @@ -817,823 +765,898 @@ Address: %4 New receiving address - + Nova adreça de recepció. New sending address - + Nova adreça d'enviament Edit receiving address - + Edita les adreces de recepció Edit sending address - + Edita les adreces d'enviament - The entered address "%1" is already in the address book. - + The entered address "%1" is already in the address book. + L'adreça introduïda «%1» ja és present a la llibreta d'adreces. - The entered address "%1" is not a valid Bitcoin address. - + The entered address "%1" is not a valid Bitcoin address. + L'adreça introduïda «%1» no és una adreça de Bitcoin vàlida. Could not unlock wallet. - + No s'ha pogut desbloquejar el moneder. New key generation failed. - + Ha fallat la generació d'una nova clau. FreespaceChecker A new data directory will be created. - + Es crearà un nou directori de dades. name - + nom Directory already exists. Add %1 if you intend to create a new directory here. - + El directori ja existeix. Afegeix %1 si vols crear un nou directori en aquesta ubicació. Path already exists, and is not a directory. - + El camí ja existeix i no és cap directori. Cannot create data directory here. - + No es pot crear el directori de dades aquí. HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core - + Nucli de Bitcoin version - + versió + + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + Quant al Bitcoin Core + + + Command-line options + Opcions de línia d'ordres Usage: - + Ús: command-line options - + Opcions de la línia d'ordres UI options - + Opcions de IU - Set language, for example "de_DE" (default: system locale) - + Set language, for example "de_DE" (default: system locale) + Defineix un idioma, per exemple "de_DE" (per defecte: preferències locals de sistema) Start minimized - + Inicia minimitzat Set SSL root certificates for payment request (default: -system-) - + Defineix certificats arrel SSL per a la sol·licitud de pagament (per defecte: -sistema-) Show splash screen on startup (default: 1) - + Mostra la finestra de benvinguda a l'inici (per defecte: 1) Choose data directory on startup (default: 0) - + Tria el directori de dades a l'inici (per defecte: 0) Intro Welcome - + Us donem la benviguda Welcome to Bitcoin Core. - + Us donem la benvinguda al Bitcoin Core. As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - + Atès que és la primera vegada que executeu el programa, podeu triar on emmagatzemarà el Bitcoin Core les dades. Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - + El Bitcoin Core descarregarà i emmagatzemarà una còpia de la cadena de blocs de Bitcoin. Com a mínim s'emmagatzemaran %1 GB de dades en aquest directori, que seguiran creixent gradualment. També s'hi emmagatzemarà el moneder. Use the default data directory - + Utilitza el directori de dades per defecte Use a custom data directory: - + Utilitza un directori de dades personalitzat: - Bitcoin - + Bitcoin Core + Nucli de Bitcoin - Error: Specified data directory "%1" can not be created. - + Error: Specified data directory "%1" cannot be created. + Error: el directori de dades «%1» especificat no pot ser creat. Error - + Error GB of free space available - + GB d'espai lliure disponible (of %1GB needed) - + (d' %1GB necessari) OpenURIDialog Open URI - + Obre un URI Open payment request from URI or file - + Obre una sol·licitud de pagament des d'un URI o un fitxer URI: - + URI: Select payment request file - + Selecciona un fitxer de sol·licitud de pagament Select payment request file to open - + Selecciona el fitxer de sol·licitud de pagament per obrir OptionsDialog Options - + Opcions &Main - + &Principal Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - + Comissió opcional de transacció per kB que ajuda a assegurar que les transaccions es processen ràpidament. La majoria de transaccions són d'1 kB. Pay transaction &fee - + Paga &comissió de transacció Automatically start Bitcoin after logging in to the system. - + Inicia automàticament el Bitcoin després de l'inici de sessió del sistema. &Start Bitcoin on system login - + &Inicia el Bitcoin a l'inici de sessió del sistema. Size of &database cache - + Mida de la memòria cau de la base de &dades MB - + MB Number of script &verification threads - + Nombre de fils de &verificació d'scripts + + + Accept connections from outside + Accepta connexions de fora + + + Allow incoming connections + Permet connexions entrants Connect to the Bitcoin network through a SOCKS proxy. - + Connecta a la xarxa Bitcoin a través d'un proxy SOCKS. &Connect through SOCKS proxy (default proxy): - + &Connecta a través d'un proxy SOCKS (proxy per defecte): IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - + Adreça IP del proxy (p. ex. IPv4: 127.0.0.1 / IPv6: ::1) Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - + URL de terceres parts (p. ex. explorador de blocs) que apareix en la pestanya de transaccions com elements del menú contextual. %s en l'URL es reemplaçat pel resum de la transacció. Diferents URL estan separades per una barra vertical |. Third party transaction URLs - + URL de transaccions de terceres parts Active command-line options that override above options: - + Opcions de línies d'ordre active que sobreescriuen les opcions de dalt: Reset all client options to default. - + Reestableix totes les opcions del client. &Reset Options - + &Reestableix les opcions &Network - + &Xarxa (0 = auto, <0 = leave that many cores free) - + (0 = auto, <0 = deixa tants nuclis lliures) W&allet - + &Moneder Expert - + Expert Enable coin &control features - + Activa les funcions de &control de les monedes 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. - + Si inhabiliteu la despesa d'un canvi sense confirmar, el canvi d'una transacció no pot ser utilitzat fins que la transacció no tingui com a mínim una confirmació. Això també afecta com es calcula el vostre balanç. &Spend unconfirmed change - + &Gasta el canvi sense confirmar Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - + Obre el port del client de Bitcoin al router de forma automàtica. Això només funciona quan el router implementa UPnP i l'opció està activada. Map port using &UPnP - + Port obert amb &UPnP Proxy &IP: - + &IP del proxy: &Port: - + &Port: Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - + Port del proxy (per exemple 9050) &Window - + &Finestra Show only a tray icon after minimizing the window. - + Mostra només la icona de la barra en minimitzar la finestra. &Minimize to the tray instead of the taskbar - + &Minimitza a la barra d'aplicacions en comptes de la barra de tasques Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - + Minimitza en comptes de sortir de la aplicació al tancar la finestra. Quan aquesta opció està activa, la aplicació només es tancarà al seleccionar Sortir al menú. M&inimize on close - + M&inimitza en tancar &Display - + &Pantalla User Interface &language: - + &Llengua de la interfície d'usuari: The user interface language can be set here. This setting will take effect after restarting Bitcoin. - + Aquí podeu definir la llengua de l'aplicació. Aquesta configuració tindrà efecte una vegada es reiniciï Bitcoin. &Unit to show amounts in: - + &Unitats per mostrar els imports en: Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - + Selecciona la unitat de subdivisió per defecte per mostrar en la interfície quan s'envien monedes. Whether to show coin control features or not. - + Si voleu mostrar les funcions de control de monedes o no. &OK - + &D'acord &Cancel - + &Cancel·la default - + Per defecte none - + cap Confirm options reset - + Confirmeu el reestabliment de les opcions Client restart required to activate changes. - + Cal reiniciar el client per activar els canvis. Client will be shutdown, do you want to proceed? - + S'aturarà el client, voleu procedir? This change would require a client restart. - + Amb aquest canvi cal un reinici del client. The supplied proxy address is invalid. - + L'adreça proxy introduïda és invalida. OverviewPage Form - + Formulari The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - + La informació mostrada pot no estar al día. El teu moneder es sincronitza automàticament amb la xarxa Bitcoin un cop s'ha establert connexió, però aquest proces no s'ha completat encara. Wallet - + Moneder Available: - + Disponible: Your current spendable balance - + El balanç que podeu gastar actualment Pending: - + Pendent: Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - + Total de transaccions que encara han de confirmar-se i que encara no compten en el balanç que es pot gastar Immature: - + Immadur: Mined balance that has not yet matured - + Balanç minat que encara no ha madurat Total: - + Total: Your current total balance - + El balanç total actual <b>Recent transactions</b> - + <b>Transaccions recents</b> out of sync - + Fora de sincronia PaymentServer URI handling - + Gestió d'URI - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - + Invalid payment address %1 + Adreça de pagament no vàlida %1 + + + Payment request rejected + La sol·licitud de pagament s'ha rebutjat + + + Payment request network doesn't match client network. + La xarxa de la sol·licitud de pagament no coincideix amb la xarxa del client. + + + Payment request has expired. + La sol·licitud de pagament ha caducat. + + + Payment request is not initialized. + La sol·licitud de pagament no està inicialitzada. Requested payment amount of %1 is too small (considered dust). - + L'import de pagament sol·licitat %1 és massa petit (es considera polsim). Payment request error - + Error en la sol·licitud de pagament Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - + No es pot iniciar bitcoin: gestor clica-per-pagar Payment request fetch URL is invalid: %1 - + L'URL de recuperació de la sol·licitud de pagament no és vàlida: %1 + + + URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + L'URI no pot ser analitzat! Això pot ser a causa d'una adreça de Bitcoin no vàlida o per paràmetres URI amb mal format. Payment request file handling - + Gestió de fitxers de les sol·licituds de pagament - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - + Payment request file cannot be read! This can be caused by an invalid payment request file. + No es pot llegir el fitxer de la sol·licitud de pagament. Això pot ser causat per un fitxer de sol·licitud de pagament no vàlid. Unverified payment requests to custom payment scripts are unsupported. - + No s'accepten sol·licituds de pagament no verificades a scripts de pagament personalitzats. Refund from %1 - + Reemborsament de %1 Error communicating with %1: %2 - + Error en comunicar amb %1: %2 - Payment request can not be parsed or processed! - + Payment request cannot be parsed! + No es pot analitzar la sol·licitud de pagament! Bad response from server %1 - + Mala resposta del servidor %1 Payment acknowledged - + Pagament reconegut Network request error - + Error en la sol·licitud de xarxa + + + + PeerTableModel + + User Agent + Agent d'usuari + + + Address/Hostname + Adreça / nom de l'ordinador + + + Ping Time + Temps de ping QObject - Bitcoin - + Amount + Quantitat - Error: Specified data directory "%1" does not exist. - + Enter a Bitcoin address (e.g. %1) + Introduïu una adreça de Bitcoin (p. ex. %1) - Error: Cannot parse configuration file: %1. Only use key=value syntax. - + %1 d + %1 d - Error: Invalid combination of -regtest and -testnet. - + %1 h + %1 h - Bitcoin Core didn't yet exit safely... - + %1 m + %1 m - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - + %1 s + %1 s + + + NETWORK + XARXA + + + UNKNOWN + DESCONEGUT + + + None + Cap + + + N/A + N/A + + + %1 ms + %1 ms QRImageWidget &Save Image... - + De&sa la imatge... &Copy Image - + &Copia la imatge Save QR Code - + Desa el codi QR PNG Image (*.png) - + Imatge PNG (*.png) RPCConsole Client name - + Nom del client N/A - + N/A Client version - + Versió del client &Information - + &Informació Debug window - + Finestra de depuració General - + General Using OpenSSL version - + Utilitzant OpenSSL versió + + + Using BerkeleyDB version + Utilitzant BerkeleyDB versió Startup time - + &Temps d'inici Network - + Xarxa Name - + Nom Number of connections - + Nombre de connexions Block chain - + Cadena de blocs Current number of blocks - + Nombre de blocs actuals - Estimated total blocks - + Received + Rebut + + + Sent + Enviat + + + &Peers + &Iguals + + + Select a peer to view detailed information. + Seleccioneu un igual per mostrar informació detallada. + + + Direction + Direcció + + + Version + Versió + + + User Agent + Agent d'usuari + + + Services + Serveis + + + Sync Node + Node de sincronització + + + Ping Time + Temps de ping Last block time - + Últim temps de bloc &Open - + &Obre &Console - + &Consola &Network Traffic - + Trà&nsit de la xarxa &Clear - + Nete&ja Totals - + Totals In: - + Dins: Out: - + Fora: Build date - + Data de compilació Debug log file - + Fitxer de registre de depuració Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - + Obre el fitxer de registre de depuració de Bitcoin del directori de dades actual. Això pot trigar uns quants segons per a fitxers de registre grans. Clear console - + Neteja la consola Welcome to the Bitcoin RPC console. - + Us donem la benvinguda a la consola RPC de Bitcoin Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - + Utilitza les fletxes d'amunt i avall per navegar per l'historial, i <b>Ctrl-L<\b> per netejar la pantalla. Type <b>help</b> for an overview of available commands. - + Escriviu <b>help<\b> per a obtenir un llistat de les ordres disponibles. %1 B - + %1 B %1 KB - + %1 KB %1 MB - + %1 MB %1 GB - + %1 GB - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog &Amount: - + Im&port: &Label: - + &Etiqueta: &Message: - + &Missatge: Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - + Reutilitza una de les adreces de recepció utilitzades anteriorment. La reutilització d'adreces pot comportar problemes de seguretat i privadesa. No ho utilitzeu llevat que torneu a generar una sol·licitud de pagament feta abans. R&euse an existing receiving address (not recommended) - + R&eutilitza una adreça de recepció anterior (no recomanat) An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - + Un missatge opcional que s'adjuntarà a la sol·licitud de pagament, que es mostrarà quan s'obri la sol·licitud. Nota: El missatge no s'enviarà amb el pagament per la xarxa Bitcoin. An optional label to associate with the new receiving address. - + Una etiqueta opcional que s'associarà amb la nova adreça receptora. Use this form to request payments. All fields are <b>optional</b>. - + Utilitzeu aquest formulari per sol·licitar pagaments. Tots els camps són <b>opcionals</b>. An optional amount to request. Leave this empty or zero to not request a specific amount. - + Un import opcional per sol·licitar. Deixeu-ho en blanc o zero per no sol·licitar cap import específic. Clear all fields of the form. - + Esborra tots els camps del formuari. Clear - + Neteja Requested payments history - + Historial de pagaments sol·licitats &Request payment - + &Sol·licitud de pagament Show the selected request (does the same as double clicking an entry) - + Mostra la sol·licitud seleccionada (fa el mateix que el doble clic a una entrada) Show - + Mostra Remove the selected entries from the list - + Esborra les entrades seleccionades de la llista Remove - + Esborra Copy label - + Copia l'etiqueta Copy message - + Copia el missatge Copy amount - + Copia l'import ReceiveRequestDialog QR Code - + Codi QR Copy &URI - + Copia l'&URI Copy &Address - + Copia l'&adreça &Save Image... - + De&sa la imatge... Request payment to %1 - + Sol·licita un pagament a %1 Payment information - + Informació de pagament URI - + URI Address @@ -1641,7 +1664,7 @@ Address: %4 Amount - + Import Label @@ -1649,22 +1672,22 @@ Address: %4 Message - + Missatge Resulting URI too long, try to reduce the text for label / message. - + URI resultant massa llarga, intenta reduir el text per a la etiqueta / missatge Error encoding URI into QR Code. - + Error en codificar l'URI en un codi QR. RecentRequestsTableModel Date - + Data Label @@ -1672,11 +1695,11 @@ Address: %4 Message - + Missatge Amount - + Import (no label) @@ -1684,182 +1707,178 @@ Address: %4 (no message) - + (sense missatge) (no amount) - + (sense import) SendCoinsDialog Send Coins - + Envia monedes Coin Control Features - + Característiques de control de les monedes Inputs... - + Entrades... automatically selected - + seleccionat automàticament Insufficient funds! - + Fons insuficients! Quantity: - + Quantitat: Bytes: - + Bytes: Amount: - + Import: Priority: - + Prioritat: Fee: - - - - Low Output: - + Comissió: After Fee: - + Quota posterior: Change: - + Canvi: If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - + Si s'activa això, però l'adreça de canvi està buida o bé no és vàlida, el canvi s'enviarà a una adreça generada de nou. Custom change address - + Personalitza l'adreça de canvi Send to multiple recipients at once - + Envia a múltiples destinataris al mateix temps Add &Recipient - + Afegeix &destinatari Clear all fields of the form. - + Netejar tots els camps del formulari. + + + Dust: + Polsim: Clear &All - + Neteja-ho &tot Balance: - + Balanç: Confirm the send action - + Confirma l'acció d'enviament S&end - + E&nvia Confirm send coins - + Confirma l'enviament de monedes %1 to %2 - + %1 a %2 Copy quantity - + Copia la quantitat Copy amount - + Copia l'import Copy fee - + Copia la comissi Copy after fee - + Copia la comissió posterior Copy bytes - + Copia els bytes Copy priority - - - - Copy low output - + Copia la prioritat Copy change - + Copia el canvi Total Amount %1 (= %2) - + Import total %1 (= %2) or - + o The recipient address is not valid, please recheck. - + L'adreça de destinatari no és vàlida, si us plau comprovi-la. The amount to pay must be larger than 0. - + L'import a pagar ha de ser major que 0. The amount exceeds your balance. - + L'import supera el vostre balanç. The total exceeds your balance when the %1 transaction fee is included. - + El total excedeix el teu balanç quan s'afegeix la comisió a la transacció %1. Duplicate address found, can only send to each address once per send operation. - + S'ha trobat una adreça duplicada, tan sols es pot enviar a cada adreça un cop per ordre de enviament. Transaction creation failed! - + Ha fallat la creació de la transacció! The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - + S'ha rebutjat la transacció! Això pot passar si alguna de les monedes del vostre moneder ja s'han gastat; per exemple, si heu fet servir una còpia de seguretat del fitxer wallet.dat i s'haguessin gastat monedes de la còpia però sense marcar-les-hi com a gastades. Warning: Invalid Bitcoin address - + Avís: adreça Bitcoin no vàlida (no label) @@ -1867,263 +1886,243 @@ Address: %4 Warning: Unknown change address - + Avís: adreça de canvi desconeguda + + + Copy dust + Copia el polsim Are you sure you want to send? - + Esteu segur que ho voleu enviar? added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - + S'ha afegit una taxa de transacció SendCoinsEntry A&mount: - + Q&uantitat: Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - + Paga &a: Enter a label for this address to add it to your address book - + Introduïu una etiqueta per a aquesta adreça per afegir-la a la llibreta d'adreces &Label: - + &Etiqueta: Choose previously used address - + Escull una adreça feta servir anteriorment This is a normal payment. - + Això és un pagament normal. Alt+A - + Alta+A Paste address from clipboard - + Enganxar adreça del porta-retalls Alt+P - + Alt+P Remove this entry - + Elimina aquesta entrada Message: - + Missatge: This is a verified payment request. - + Aquesta és una sol·licitud de pagament verificada. Enter a label for this address to add it to the list of used addresses - + Introduïu una etiqueta per a aquesta adreça per afegir-la a la llista d'adreces utilitzades A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - + Un missatge que s'ha adjuntat al bitcoin: URI que s'emmagatzemarà amb la transacció per a la vostra referència. Nota: el missatge no s'enviarà a través de la xarxa Bitcoin. This is an unverified payment request. - + Aquesta és una sol·licitud de pagament no verificada. Pay To: - + Paga a: Memo: - + Memo: ShutdownWindow Bitcoin Core is shutting down... - + S'està aturant el Bitcoin Core... Do not shut down the computer until this window disappears. - + No apagueu l'ordinador fins que no desaparegui aquesta finestra. SignVerifyMessageDialog Signatures - Sign / Verify a Message - + Signatures - Signa / verifica un missatge &Sign Message - + &Signa el missatge You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - + Podeu signar missatges amb la vostra adreça per provar que són vostres. Aneu amb compte no signar qualsevol cosa, ja que els atacs de pesca electrònica (phishing) poden provar de confondre-us perquè els signeu amb la vostra identitat. Només signeu als documents completament detallats amb què hi esteu d'acord. Choose previously used address - + Tria les adreces fetes servir amb anterioritat Alt+A - + Alt+A Paste address from clipboard - + Enganxa l'adreça del porta-retalls Alt+P - + Alt+P Enter the message you want to sign here - + Introduïu aquí el missatge que voleu signar Signature - + Signatura Copy the current signature to the system clipboard - + Copia la signatura actual al porta-retalls del sistema Sign the message to prove you own this Bitcoin address - + Signa el missatge per provar que ets propietari d'aquesta adreça Bitcoin Sign &Message - + Signa el &missatge Reset all sign message fields - + Neteja tots els camps de clau Clear &All - + Neteja-ho &tot &Verify Message - + &Verifica el missatge Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - + Introdueixi l'adreça signant, missatge (assegura't que copies salts de línia, espais, tabuladors, etc excactament tot el text) i la signatura a sota per verificar el missatge. Per evitar ser enganyat per un atac home-entre-mig, vés amb compte de no llegir més en la signatura del que hi ha al missatge signat mateix. Verify the message to ensure it was signed with the specified Bitcoin address - + Verificar el missatge per assegurar-se que ha estat signat amb una adreça Bitcoin específica Verify &Message - + Verifica el &missatge Reset all verify message fields - + Neteja tots els camps de verificació de missatge - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - + Click "Sign Message" to generate signature + Feu clic a «Signa el missatge» per a generar una signatura The entered address is invalid. - + L'adreça introduïda no és vàlida. Please check the address and try again. - + Comproveu l'adreça i torneu-ho a provar. The entered address does not refer to a key. - + L'adreça introduïda no referencia a cap clau. Wallet unlock was cancelled. - + El desbloqueig del moneder ha estat cancelat. Private key for the entered address is not available. - + La clau privada per a la adreça introduïda no està disponible. Message signing failed. - + La signatura del missatge ha fallat. Message signed. - + Missatge signat. The signature could not be decoded. - + La signatura no s'ha pogut descodificar. Please check the signature and try again. - + Comproveu la signatura i torneu-ho a provar. The signature did not match the message digest. - + La signatura no coincideix amb el resum del missatge. Message verification failed. - + Ha fallat la verificació del missatge. Message verified. - + Missatge verificat. SplashScreen Bitcoin Core - + Bitcoin Core The Bitcoin Core developers - + Els desenvolupadors del Bitcoin Core [testnet] @@ -2134,363 +2133,359 @@ Address: %4 TrafficGraphWidget KB/s - + KB/s TransactionDesc Open until %1 - + Obert fins %1 conflicted - + en conflicte %1/offline - + %1/fora de línia %1/unconfirmed - + %1/sense confirmar %1 confirmations - + %1 confirmacions Status - + Estat , broadcast through %n node(s) - + , difusió a través de %n node, difusió a través de %n nodes Date - + Data Source - + Font Generated - + Generat From - + Des de To - + A own address - + Adreça pròpia label - + etiqueta Credit - + Crèdit matures in %n more block(s) - + disponible en %n bloc mésdisponibles en %n blocs més not accepted - + no acceptat Debit - + Dèbit Transaction fee - + Comissió de transacció Net amount - + Import net Message - + Missatge Comment - + Comentar Transaction ID - + ID de transacció Merchant - + Mercader - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Les monedes generades han de madurar %1 blocs abans de poder ser gastades. Quan genereu aquest bloc, es farà saber a la xarxa per tal d'afegir-lo a la cadena de blocs. Si no pot fer-se lloc a la cadena, el seu estat canviarà a «no acceptat» i no es podrà gastar. Això pot passar ocasionalment si un altre node genera un bloc en un marge de segons respecte al vostre. Debug information - + Informació de depuració Transaction - + Transacció Inputs - + Entrades Amount - + Quantitat true - + cert false - + fals , has not been successfully broadcast yet - + , encara no ha estat emès correctement Open for %n more block(s) - + Obre per %n bloc mésObre per %n blocs més unknown - + desconegut TransactionDescDialog Transaction details - + Detall de la transacció This pane shows a detailed description of the transaction - + Aquest panell mostra una descripció detallada de la transacció TransactionTableModel Date - + Data Type - + Tipus Address Adreça - - Amount - - Immature (%1 confirmations, will be available after %2) - + Immadur (%1 confirmacions, serà disponible després de %2) Open for %n more block(s) - + Obre per %n bloc mésObre per %n blocs més Open until %1 - + Obert fins %1 Confirmed (%1 confirmations) - + Confirmat (%1 confirmacions) This block was not received by any other nodes and will probably not be accepted! - + Aquest bloc no ha estat rebut per cap altre node i probablement no serà acceptat! Generated but not accepted - + Generat però no acceptat Offline - + Fora de línia Unconfirmed - + Sense confirmar Confirming (%1 of %2 recommended confirmations) - + Confirmant (%1 de %2 confirmacions recomanades) Conflicted - + En conflicte Received with - + Rebut amb Received from - + Rebut de Sent to - + Enviat a Payment to yourself - + Pagament a un mateix Mined - + Minat (n/a) - + (n/a) Transaction status. Hover over this field to show number of confirmations. - + Estat de la transacció. Desplaceu-vos sobre aquest camp per mostrar el nombre de confirmacions. Date and time that the transaction was received. - + Data i hora en que la transacció va ser rebuda. Type of transaction. - + Tipus de transacció. Destination address of transaction. - + Adreça del destinatari de la transacció. Amount removed from or added to balance. - + Import extret o afegit del balanç. TransactionView All - + Tot Today - + Avui This week - + Aquesta setmana This month - + Aquest mes Last month - + El mes passat This year - + Enguany Range... - + Rang... Received with - + Rebut amb Sent to - + Enviat a To yourself - + A un mateix Mined - + Minat Other - + Altres Enter address or label to search - + Introduïu una adreça o una etiqueta per cercar Min amount - + Import mínim Copy address - + Copia l'adreça Copy label - + Copiar etiqueta Copy amount - + Copia l'import Copy transaction ID - + Copiar ID de transacció Edit label - + Editar etiqueta Show transaction details - + Mostra detalls de la transacció Export Transaction History - + Exporta l'historial de transacció Exporting Failed - + L'exportació ha fallat There was an error trying to save the transaction history to %1. - + S'ha produït un error en provar de desar l'historial de transacció a %1. Exporting Successful - + Exportació amb èxit The transaction history was successfully saved to %1. - + L'historial de transaccions s'ha desat correctament a %1. Comma separated file (*.csv) @@ -2498,15 +2493,15 @@ Address: %4 Confirmed - + Confirmat Date - + Data Type - + Tipus Label @@ -2516,153 +2511,132 @@ Address: %4 Address Adreça - - Amount - - ID - + ID Range: - + Rang: to - + a + + UnitDisplayStatusBarControl + WalletFrame No wallet has been loaded. - + No s'ha carregat cap moneder. WalletModel Send Coins - + Envia monedes WalletView &Export - + &Exporta Export the data in the current tab to a file - + Exporta les dades de la pestanya actual a un fitxer Backup Wallet - + Còpia de seguretat del moneder Wallet Data (*.dat) - + Dades del moneder (*.dat) Backup Failed - + Ha fallat la còpia de seguretat There was an error trying to save the wallet data to %1. - + S'ha produït un error en provar de desar les dades del moneder a %1. The wallet data was successfully saved to %1. - + S'han desat les dades del moneder correctament a %1. Backup Successful - + La còpia de seguretat s'ha realitzat correctament bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - Options: - + Opcions: Specify configuration file (default: bitcoin.conf) - + Especifica un fitxer de configuració (per defecte: bitcoin.conf) Specify pid file (default: bitcoind.pid) - + Especifica un fitxer pid (per defecte: bitcoind.pid) Specify data directory - + Especifica el directori de dades Listen for connections on <port> (default: 8333 or testnet: 18333) - + Escolta connexions a <port> (per defecte: 8333 o testnet: 18333) Maintain at most <n> connections to peers (default: 125) - + Manté com a molt <n> connexions a iguals (per defecte: 125) Connect to a node to retrieve peer addresses, and disconnect - + Connecta al node per obtenir les adreces de les connexions, i desconnecta Specify your own public address - + Especifiqueu la vostra adreça pública Threshold for disconnecting misbehaving peers (default: 100) - + Límit per a desconectar connexions errònies (per defecte: 100) Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - + Nombre de segons abans de reconectar amb connexions errònies (per defecte: 86400) Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - + Escolta connexions JSON-RPC al port <port> (per defecte: 8332 o testnet:18332) Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - + Accepta la línia d'ordres i ordres JSON-RPC Run in the background as a daemon and accept commands - + Executa en segon pla com a programa dimoni i accepta ordres Use the test network - + Utilitza la xarxa de prova Accept connections from outside (default: 1 if no -proxy or -connect) - + Accepta connexions de fora (per defecte: 1 si no -proxy o -connect) %s, you must set a rpcpassword in the configuration file: @@ -2674,695 +2648,586 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - + %s, heu de establir una contrasenya RPC al fitxer de configuració: %s +Es recomana que useu la següent contrasenya aleatòria: +rpcuser=bitcoinrpc +rpcpassword=%s +(no necesiteu recordar aquesta contrasenya) +El nom d'usuari i la contrasenya NO HAN de ser els mateixos. +Si el fitxer no existeix, crea'l amb els permisos de fitxer de només lectura per al propietari. +També es recomana establir la notificació d'alertes i així sereu notificat de les incidències; +per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com + Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - + Xifrats acceptables (per defecte: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Bind to given address and always listen on it. Use [host]:port notation for IPv6 - + Vincula a una adreça específica i sempre escolta-hi. Utilitza la notació [host]:port per IPv6 Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - + Limita contínuament les transaccions gratuïtes a <n>*1000 bytes per minut (per defecte: 15) Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - + Entra en el mode de proves de regressió, que utilitza una cadena especial en què els blocs poden resoldre's al moment. Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - + Error: La transacció ha estat rebutjada. Això pot passar si alguna de les monedes del teu moneder ja s'han gastat, com si haguesis usat una copia de l'arxiu wallet.dat i s'haguessin gastat monedes de la copia però sense marcar com gastades en aquest. Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - + Error: Aquesta transacció requereix una comissió d'almenys %s degut al seu import, complexitat o per l'ús de fons recentment rebuts! Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - + Executa una ordre quan una transacció del moneder canviï (%s en cmd es canvia per TxID) Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - + Buida l'activitat de la base de dades de la memòria disponible al registre del disc cada <n> megabytes (per defecte: 100) How thorough the block verification of -checkblocks is (0-4, default: 3) - + Com d'exhaustiva és la verificació de blocs de -checkblocks is (0-4, per defecte: 3) In this mode -genproclimit controls how many blocks are generated immediately. - + En aquest mode -genproclimit controla quants blocs es generen immediatament. Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - + Defineix el nombre de fils de verificació d'scripts (%u a %d, 0 = auto, <0 = deixa tants nuclis lliures, per defecte: %d) Set the processor limit for when generation is on (-1 = unlimited, default: -1) - + Defineix el límit de processadors quan està activada la generació (-1 = sense límit, per defecte: -1) This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - + Aquesta és una versió de pre-llançament - utilitza-la sota la teva responsabilitat - No usar per a minería o aplicacions de compra-venda Unable to bind to %s on this computer. Bitcoin Core is probably already running. - + No es pot enllaçar %s a aquest ordinador. El Bitcoin Core probablement ja estigui executant-s'hi. Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - + Utilitza un proxy SOCKS5 apart per arribar a iguals a través de serveis de Tor ocults (per defecte: -proxy) Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - + Avís: el -paytxfee és molt elevat! Aquesta és la comissió de transacció que pagareu si envieu una transacció. Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - + Avís: la xarxa no sembla que hi estigui plenament d'acord. Alguns miners sembla que estan experimentant problemes. Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - + Avís: sembla que no estem plenament d'acord amb els nostres iguals! Podria caler que actualitzar l'aplicació, o potser que ho facin altres nodes. Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - + Avís: error en llegir el fitxer wallet.dat! Totes les claus es llegeixen correctament, però hi ha dades de transaccions o entrades de la llibreta d'adreces absents o bé son incorrectes. Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - + Avís: el fitxer wallet.dat és corrupte, dades rescatades! L'arxiu wallet.dat original ha estat desat com wallet.{estampa_temporal}.bak al directori %s; si el teu balanç o transaccions son incorrectes hauries de restaurar-lo de un backup. (default: 1) - + (per defecte: 1) (default: wallet.dat) - + (per defecte: wallet.dat) <category> can be: - + <category> pot ser: Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - + Intenta recuperar les claus privades d'un fitxer wallet.dat corrupte Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - + Opcions de la creació de blocs: Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - + Connecta només al(s) node(s) especificats Connection options: - + Opcions de connexió: Corrupted block database detected - + S'ha detectat una base de dades de blocs corrupta Debugging/Testing options: - + Opcions de depuració/proves: Disable safemode, override a real safe mode event (default: 0) - + Inhabilia el mode segur (safemode), invalida un esdeveniment de mode segur real (per defecte: 0) Discover own IP address (default: 1 when listening and no -externalip) - + Descobreix la pròpia adreça IP (per defecte: 1 quan escoltant i no -externalip) Do not load the wallet and disable wallet RPC calls - + No carreguis el moneder i inhabilita les crides RPC del moneder Do you want to rebuild the block database now? - + Voleu reconstruir la base de dades de blocs ara? Error initializing block database - + Error carregant la base de dades de blocs Error initializing wallet database environment %s! - + Error inicialitzant l'entorn de la base de dades del moneder %s! Error loading block database - + Error carregant la base de dades del bloc Error opening block database - + Error en obrir la base de dades de blocs Error: Disk space is low! - + Error: Espai al disc baix! Error: Wallet locked, unable to create transaction! - + Error: El moneder està bloquejat, no és possible crear la transacció! Error: system error: - + Error: error de sistema: Failed to listen on any port. Use -listen=0 if you want this. - + Ha fallat escoltar a qualsevol port. Feu servir -listen=0 si voleu fer això. Failed to read block info - + Ha fallat la lectura de la informació del bloc Failed to read block - + Ha fallat la lectura del bloc Failed to sync block index - + Ha fallat la sincronització de l'índex de blocs Failed to write block index - + Ha fallat la escriptura de l'índex de blocs Failed to write block info - + Ha fallat la escriptura de la informació de bloc Failed to write block - + Ha fallat l'escriptura del bloc Failed to write file info - + Ha fallat l'escriptura de la informació de fitxer Failed to write to coin database - + Ha fallat l'escriptura de la basse de dades de monedes Failed to write transaction index - + Ha fallat l'escriptura de l'índex de transaccions Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - + Ha fallat el desfer de dades Force safe mode (default: 0) - + Força el mode segur (per defecte: 0) Generate coins (default: 0) - + Genera monedes (per defecte: 0) How many blocks to check at startup (default: 288, 0 = all) - + Quants blocs s'han de confirmar a l'inici (per defecte: 288, 0 = tots) If <category> is not supplied, output all debugging information. - + Si no se subministra <category>, mostra tota la informació de depuració. Importing... - + S'està important... Incorrect or no genesis block found. Wrong datadir for network? - + No s'ha trobat el bloc de gènesi o és incorrecte. El directori de dades de la xarxa és incorrecte? - Invalid -onion address: '%s' - + Invalid -onion address: '%s' + Adreça -onion no vàlida: '%s' Not enough file descriptors available. - + No hi ha suficient descriptors de fitxers disponibles. Prepend debug output with timestamp (default: 1) - - - - RPC client options: - + Posa davant de la sortida de depuració una marca horària (per defecte: 1) Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - + Reconstrueix l'índex de la cadena de blocs dels fitxers actuals blk000??.dat Set database cache size in megabytes (%d to %d, default: %d) - + Defineix la mida de la memòria cau de la base de dades en megabytes (%d a %d, per defecte: %d) Set maximum block size in bytes (default: %d) - + Defineix la mida màxim del bloc en bytes (per defecte: %d) Set the number of threads to service RPC calls (default: 4) - + Estableix el nombre de fils per atendre trucades RPC (per defecte: 4) Specify wallet file (within data directory) - + Especifica un fitxer de moneder (dins del directori de dades) Spend unconfirmed change when sending transactions (default: 1) - + Gasta el canvi sense confirmar en enviar transaccions (per defecte: 1) This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - + Això es així per a eines de proves de regressió per al desenvolupament d'aplicacions. Verifying blocks... - + S'estan verificant els blocs... Verifying wallet... - - - - Wait for RPC server to start - + S'està verificant el moneder... Wallet %s resides outside data directory %s - + El moneder %s resideix fora del directori de dades %s Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - + Opcions de moneder: You need to rebuild the database using -reindex to change -txindex - + Cal que reconstruïu la base de dades fent servir -reindex per canviar -txindex Imports blocks from external blk000??.dat file - + Importa blocs de un fitxer blk000??.dat extern Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - + No es pot obtenir un bloqueig del directori de dades %s. El Bitcoin Core probablement ja s'estigui executant. Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - + Executa l'ordre quan es rebi un avís rellevant o veiem una forquilla molt llarga (%s en cmd és reemplaçat per un missatge) Output debugging information (default: 0, supplying <category> is optional) - + Informació de la depuració de sortida (per defecte: 0, proporcionar <category> és opcional) Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - + Defineix la mida màxima de transaccions d'alta prioritat / baixa comissió en bytes (per defecte: %d) Information - + &Informació - Invalid amount for -minrelaytxfee=<amount>: '%s' - + Invalid amount for -minrelaytxfee=<amount>: '%s' + Import no vàlid per a -minrelaytxfee=<amount>: «%s» - Invalid amount for -mintxfee=<amount>: '%s' - + Invalid amount for -mintxfee=<amount>: '%s' + Import no vàlid per a -mintxfee=<amount>: «%s» Limit size of signature cache to <n> entries (default: 50000) - + Mida límit de la memòria cau de signatura per a <n> entrades (per defecte: 50000) Log transaction priority and fee per kB when mining blocks (default: 0) - + Registra la prioritat de transacció i comissió per kB en minar blocs (per defecte: 0) Maintain a full transaction index (default: 0) - + Manté l'índex sencer de transaccions (per defecte: 0) Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - + Mida màxima del buffer de recepció per a cada connexió, <n>*1000 bytes (default: 5000) Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - + Mida màxima del buffer d'enviament per a cada connexió, <n>*1000 bytes (default: 5000) Only accept block chain matching built-in checkpoints (default: 1) - + Només accepta cadenes de blocs que coincideixin amb els punts de prova (per defecte: 1) Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - + Només connecta als nodes de la xarxa <net> (IPv4, IPv6 o Tor) Print block on startup, if found in block index - + Imprimeix el block a l'inici, si es troba l'índex de blocs Print block tree on startup (default: 0) - + Imprimeix l'arbre de blocs a l'inici (per defecte: 0) RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - + Opcions RPC SSL: (veieu el wiki del Bitcoin per a instruccions de configuració de l'SSL) RPC server options: - + Opcions del servidor RPC: Randomly drop 1 of every <n> network messages - + Descarta a l'atzar 1 de cada <n> missatges de la xarxa Randomly fuzz 1 of every <n> network messages - + Introdueix incertesa en 1 de cada <n> missatges de la xarxa Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - + Executa un fil per buidar el moneder periòdicament (per defecte: 1) Send trace/debug info to console instead of debug.log file - + Envia informació de traça/depuració a la consola en comptes del fitxer debug.log Set minimum block size in bytes (default: 0) - + Defineix una mida mínima de bloc en bytes (per defecte: 0) Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - + Defineix el senyal DB_PRIVATE en l'entorn db del moneder (per defecte: 1) Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - + Mostra totes les opcions de depuració (ús: --help --help-debug) Shrink debug.log file on client startup (default: 1 when no -debug) - + Redueix el fitxer debug.log durant l'inici del client (per defecte: 1 quan no -debug) Signing transaction failed - + Ha fallat la signatura de la transacció Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - + Especifica el temps limit per a un intent de connexió en mil·lisegons (per defecte: 5000) System error: - + Error de sistema: Transaction amount too small - + Import de la transacció massa petit Transaction amounts must be positive - + Els imports de les transaccions han de ser positius Transaction too large - + La transacció és massa gran Use UPnP to map the listening port (default: 0) - + Utilitza UPnP per a mapejar els ports d'escolta (per defecte: 0) Use UPnP to map the listening port (default: 1 when listening) - + Utilitza UPnP per a mapejar els ports d'escolta (per defecte: 1 quan s'escolta) Username for JSON-RPC connections - + Nom d'usuari per a connexions JSON-RPC Warning - + Avís Warning: This version is obsolete, upgrade required! - + Avís: aquesta versió està obsoleta. És necessari actualitzar-la! Zapping all transactions from wallet... - + Se suprimeixen totes les transaccions del moneder... on startup - - - - version - + a l'inici de l'aplicació wallet.dat corrupt, salvage failed - + El fitxer wallet.data és corrupte. El rescat de les dades ha fallat Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - + Contrasenya per a connexions JSON-RPC Execute command when the best block changes (%s in cmd is replaced by block hash) - + Executa l'ordre quan el millor bloc canviï (%s en cmd es reemplaça per un resum de bloc) Upgrade wallet to latest format - + Actualitza el moneder a l'últim format Set key pool size to <n> (default: 100) - + Defineix el límit de nombre de claus a <n> (per defecte: 100) Rescan the block chain for missing wallet transactions - + Reescaneja la cadena de blocs en les transaccions de moneder perdudes Use OpenSSL (https) for JSON-RPC connections - + Utilitza OpenSSL (https) per a connexions JSON-RPC Server certificate file (default: server.cert) - + Fitxer del certificat de servidor (per defecte: server.cert) Server private key (default: server.pem) - + Clau privada del servidor (per defecte: server.pem) This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - + Aquest misatge d'ajuda Allow DNS lookups for -addnode, -seednode and -connect - + Permet consultes DNS per a -addnode, -seednode i -connect Loading addresses... - + S'estan carregant les adreces... Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - + Error en carregar wallet.dat: Moneder corrupte Error loading wallet.dat - + Error en carregar wallet.dat - Invalid -proxy address: '%s' - + Invalid -proxy address: '%s' + Adreça -proxy invalida: '%s' - Unknown network specified in -onlynet: '%s' - + Unknown network specified in -onlynet: '%s' + Xarxa desconeguda especificada a -onlynet: '%s' - Unknown -socks proxy version requested: %i - + Cannot resolve -bind address: '%s' + No es pot resoldre l'adreça -bind: '%s' - Cannot resolve -bind address: '%s' - + Cannot resolve -externalip address: '%s' + No es pot resoldre l'adreça -externalip: '%s' - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - + Invalid amount for -paytxfee=<amount>: '%s' + Import no vàlid per a -paytxfee=<amount>: «%s» Invalid amount - + Import no vàlid Insufficient funds - + Balanç insuficient Loading block index... - + S'està carregant l'índex de blocs... Add a node to connect to and attempt to keep the connection open - + Afegeix un node per a connectar-s'hi i intenta mantenir-hi la connexió oberta Loading wallet... - + S'està carregant el moneder... Cannot downgrade wallet - + No es pot reduir la versió del moneder Cannot write default address - + No es pot escriure l'adreça per defecte Rescanning... - + S'està reescanejant... Done loading - + Ha acabat la càrrega To use the %s option - + Utilitza l'opció %s Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - + Error \ No newline at end of file diff --git a/src/qt/locale/bitcoin_ca@valencia.ts b/src/qt/locale/bitcoin_ca@valencia.ts index b36d6b7d67..0d43d95d2a 100644 --- a/src/qt/locale/bitcoin_ca@valencia.ts +++ b/src/qt/locale/bitcoin_ca@valencia.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -43,35 +11,35 @@ This product includes software developed by the OpenSSL Project for use in the O &New - + &Nova Copy the currently selected address to the system clipboard - Copieu l'adreça seleccionada al porta-retalls del sistema + Copieu l'adreça seleccionada al porta-retalls del sistema &Copy - + &Copia C&lose - + &Tanca &Copy Address - + &Copia l'adreça Delete the currently selected address from the list - + Elimina l'adreça sel·leccionada actualment de la llista Export the data in the current tab to a file - + Exporta les dades de la pestanya actual a un fitxer &Export - + &Exporta &Delete @@ -79,460 +47,420 @@ This product includes software developed by the OpenSSL Project for use in the O Choose the address to send coins to - + Trieu una adreça on voleu enviar monedes Choose the address to receive coins with - + Trieu l'adreça on voleu rebre monedes C&hoose - + T&ria Sending addresses - + S'estan enviant les adreces Receiving addresses - + S'estan rebent les adreces These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - + Estes són les vostres adreces de Bitcoin per enviar els pagaments. Sempre reviseu l'import i l'adreça del destinatari abans de transferir monedes. These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - + Estes són les vostres adreces Bitcoin per rebre pagaments. Es recomana utilitzar una adreça nova de recepció per a cada transacció. Copy &Label - + Copia l'&etiqueta &Edit - + &Edita Export Address List - + Exporta la llista d'adreces Comma separated file (*.csv) - + Fitxer de separació amb comes (*.csv) Exporting Failed - + L'exportació ha fallat - - There was an error trying to save the address list to %1. - - - + AddressTableModel Label - + Etiqueta Address - + Adreça (no label) - + (sense etiqueta) AskPassphraseDialog Passphrase Dialog - + Diàleg de contrasenya Enter passphrase - + Introduïu una contrasenya New passphrase - + Nova contrasenya Repeat new passphrase - - - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - + Repetiu la nova contrasenya Encrypt wallet - + Encripta el moneder This operation needs your wallet passphrase to unlock the wallet. - + Esta operació requereix la contrasenya del moneder per a desbloquejar-lo. Unlock wallet - + Desbloqueja el moneder This operation needs your wallet passphrase to decrypt the wallet. - + Esta operació requereix la contrasenya del moneder per desencriptar-lo. Decrypt wallet - + Desencripta el moneder Change passphrase - + Canvia la contrasenya Enter the old and new passphrase to the wallet. - + Introduïu tant la contrasenya antiga com la nova del moneder. Confirm wallet encryption - + Confirma l'encriptació del moneder Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - + Avís: si encripteu el vostre moneder i perdeu la contrasenya, <b>PERDREU TOTS ELS VOSTRES BITCOINS</b>! Are you sure you wish to encrypt your wallet? - + Esteu segur que voleu encriptar el vostre moneder? 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. - + IMPORTANT: Tota copia de seguretat que hàgeu realitzat hauria de ser reemplaçada pel, recentment generat, fitxer encriptat del moneder. Warning: The Caps Lock key is on! - + Avís: Les lletres majúscules estan activades! Wallet encrypted - + Moneder encriptat Bitcoin 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. - + Bitcoin es tancarà ara per acabar el procés d'encriptació. Recordeu que encriptar el moneder no protegeix completament els bitcoins de ser robats per programari maliciós instal·lat a l'ordinador. Wallet encryption failed - + L'encriptació del moneder ha fallat Wallet encryption failed due to an internal error. Your wallet was not encrypted. - + L'encriptació del moneder ha fallat per un error intern. El moneder no ha estat encriptat. The supplied passphrases do not match. - + La contrasenya introduïda no coincideix. Wallet unlock failed - + El desbloqueig del moneder ha fallat The passphrase entered for the wallet decryption was incorrect. - + La contrasenya introduïda per a desencriptar el moneder és incorrecta. Wallet decryption failed - + La desencriptació del moneder ha fallat Wallet passphrase was successfully changed. - + La contrasenya del moneder ha estat modificada correctament. BitcoinGUI Sign &message... - + Signa el &missatge... Synchronizing with network... - + S'està sincronitzant amb la xarxa ... &Overview - + &Panorama general Node - + Node Show general overview of wallet - + Mostra el panorama general del moneder &Transactions - + &Transaccions Browse transaction history - + Cerca a l'historial de transaccions E&xit - + I&x Quit application - - - - Show information about Bitcoin - + Ix de l'aplicació About &Qt - + Quant a &Qt Show information about Qt - + Mostra informació sobre Qt &Options... - + &Opcions... &Encrypt Wallet... - + &Encripta el moneder... &Backup Wallet... - + &Realitza una còpia de seguretat del moneder... &Change Passphrase... - + &Canvia la contrasenya... &Sending addresses... - + Adreces d'e&nviament... &Receiving addresses... - + Adreces de &recepció Open &URI... - + Obri un &URI... Importing blocks from disk... - + S'estan important els blocs del disc... Reindexing blocks on disk... - + S'estan reindexant els blocs al disc... Send coins to a Bitcoin address - + Envia monedes a una adreça Bitcoin Modify configuration options for Bitcoin - + Modifica les opcions de configuració per bitcoin Backup wallet to another location - + Realitza una còpia de seguretat del moneder a una altra ubicació Change the passphrase used for wallet encryption - + Canvia la contrasenya d'encriptació del moneder &Debug window - + &Finestra de depuració Open debugging and diagnostic console - + Obri la consola de diagnòstic i depuració &Verify message... - + &Verifica el missatge... Bitcoin - + Bitcoin Wallet - + Moneder &Send - + &Envia &Receive - + &Rep &Show / Hide - + &Mostra / Amaga Show or hide the main Window - + Mostra o amaga la finestra principal Encrypt the private keys that belong to your wallet - + Encripta les claus privades pertanyents al moneder Sign messages with your Bitcoin addresses to prove you own them - + Signa el missatges amb la seua adreça de Bitcoin per provar que les poseeixes Verify messages to ensure they were signed with specified Bitcoin addresses - + Verifiqueu els missatges per assegurar-vos que han estat signats amb una adreça Bitcoin específica. &File - + &Fitxer &Settings - + &Configuració &Help - + &Ajuda Tabs toolbar - + Barra d'eines de les pestanyes [testnet] - + [testnet] Bitcoin Core - + Bitcoin Core Request payments (generates QR codes and bitcoin: URIs) - + Sol·licita pagaments (genera codis QR i bitcoin: URI) &About Bitcoin Core - + &Quant al Bitcoin Core Show the list of used sending addresses and labels - + Mostra la llista d'adreces d'enviament i etiquetes utilitzades Show the list of used receiving addresses and labels - + Mostra la llista d'adreces de recepció i etiquetes utilitzades Open a bitcoin: URI or payment request - + Obri una bitcoin: sol·licitud d'URI o pagament &Command-line options - + Opcions de la &línia d'ordes Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - - - %n active connection(s) to Bitcoin network - + Mostra el missatge d'ajuda del Bitcoin Core per obtindre una llista amb les possibles opcions de línia d'ordes de Bitcoin No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - + No hi ha cap font de bloc disponible... Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - + Proccessats %1 blocs del històric de transaccions. %1 and %2 - - - - %n year(s) - + %1 i %2 %1 behind - + %1 darrere Last received block was generated %1 ago. - + El darrer bloc rebut ha estat generat fa %1. Transactions after this will not yet be visible. - + Les transaccions a partir d'això no seran visibles. Error - + Error Warning - + Avís Information - + Informació Up to date - + Al dia Catching up... - + S'està posant al dia ... Sent transaction - + Transacció enviada Incoming transaction - + Transacció entrant Date: %1 @@ -540,2129 +468,1975 @@ Amount: %2 Type: %3 Address: %4 - + Data: %1\nImport: %2\n Tipus: %3\n Adreça: %4\n Wallet is <b>encrypted</b> and currently <b>unlocked</b> - + El moneder està <b>encriptat</b> i actualment <b>desbloquejat</b> Wallet is <b>encrypted</b> and currently <b>locked</b> - - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - + El moneder està <b>encriptat</b> i actualment <b>bloquejat</b> ClientModel Network Alert - + Alerta de xarxa CoinControlDialog Coin Control Address Selection - + Selecció de l'adreça de control de monedes Quantity: - + Quantitat: Bytes: - + Bytes: Amount: - + Import: Priority: - + Prioritat: Fee: - - - - Low Output: - + Quota: After Fee: - + Comissió posterior: Change: - + Canvi: (un)select all - + (des)selecciona-ho tot Tree mode - + Mode arbre List mode - + Mode llista Amount - + Import Address - + Adreça Date - + Data Confirmations - + Confirmacions Confirmed - + Confirmat Priority - + Prioritat Copy address - + Copiar adreça Copy label - + Copiar etiqueta Copy amount - + Copia l'import Copy transaction ID - + Copiar ID de transacció Lock unspent - + Bloqueja sense gastar Unlock unspent - + Desbloqueja sense gastar Copy quantity - + Copia la quantitat Copy fee - + Copia la comissió Copy after fee - + Copia la comissió posterior Copy bytes - + Copia els bytes Copy priority - - - - Copy low output - + Copia la prioritat Copy change - + Copia el canvi highest - + El més alt higher - + Més alt high - + Alt medium-high - + mig-alt medium - + mig low-medium - + baix-mig low - + baix lower - + més baix lowest - + el més baix (%1 locked) - + (%1 bloquejada) none - - - - Dust - + cap yes - + no - + no This label turns red, if the transaction size is greater than 1000 bytes. - + Esta etiqueta es posa de color roig si la mida de la transacció és més gran de 1000 bytes. This means a fee of at least %1 per kB is required. - + Això comporta una comissi d'almenys %1 per kB. Can vary +/- 1 byte per input. - + Pot variar +/- 1 byte per entrada. Transactions with higher priority are more likely to get included into a block. - + Les transaccions amb una major prioritat són més propenses a ser incloses en un bloc. - This label turns red, if the priority is smaller than "medium". - + This label turns red, if the priority is smaller than "medium". + Esta etiqueta es torna roja si la prioritat és menor que «mitjana». This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - + Esta etiqueta es torna roja si qualsevol destinatari rep un import inferior a %1. (no label) - + (sense etiqueta) change from %1 (%2) - + canvia de %1 (%2) (change) - + (canvia) EditAddressDialog Edit Address - + Editar Adreça &Label - + &Etiqueta The label associated with this address list entry - + L'etiqueta associada amb esta entrada de llista d'adreces The address associated with this address list entry. This can only be modified for sending addresses. - + L'adreça associada amb esta entrada de llista d'adreces. Només es pot modificar per a les adreces d'enviament. &Address - + &Adreça New receiving address - + Nova adreça de recepció. New sending address - + Nova adreça d'enviament Edit receiving address - + Edita les adreces de recepció Edit sending address - + Edita les adreces d'enviament - The entered address "%1" is already in the address book. - + The entered address "%1" is already in the address book. + L'adreça introduïda «%1» ja és present a la llibreta d'adreces. - The entered address "%1" is not a valid Bitcoin address. - + The entered address "%1" is not a valid Bitcoin address. + L'adreça introduïda «%1» no és una adreça de Bitcoin vàlida. Could not unlock wallet. - + No s'ha pogut desbloquejar el moneder. New key generation failed. - + Ha fallat la generació d'una nova clau. FreespaceChecker A new data directory will be created. - + Es crearà un nou directori de dades. name - + nom Directory already exists. Add %1 if you intend to create a new directory here. - + El directori ja existeix. Afig %1 si vols crear un nou directori en esta ubicació. Path already exists, and is not a directory. - + El camí ja existeix i no és cap directori. Cannot create data directory here. - + No es pot crear el directori de dades ací. HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core - + Bitcoin Core version - + versió + + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + Quant al Bitcoin Core Usage: - + Ús: command-line options - + Opcions de la línia d'ordes UI options - + Opcions d'IU - Set language, for example "de_DE" (default: system locale) - + Set language, for example "de_DE" (default: system locale) + Defineix un idioma, per exemple "de_DE" (per defecte: preferències locals de sistema) Start minimized - + Inicia minimitzat Set SSL root certificates for payment request (default: -system-) - + Defineix certificats arrel SSL per a la sol·licitud de pagament (per defecte: -sistema-) Show splash screen on startup (default: 1) - + Mostra la finestra de benvinguda a l'inici (per defecte: 1) Choose data directory on startup (default: 0) - + Tria el directori de dades a l'inici (per defecte: 0) Intro Welcome - + Vos donem la benviguda Welcome to Bitcoin Core. - + Vos donem la benvinguda al Bitcoin Core. As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - + Atès que és la primera vegada que executeu el programa, podeu triar on emmagatzemarà el Bitcoin Core les dades. Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - + El Bitcoin Core descarregarà i emmagatzemarà una còpia de la cadena de blocs de Bitcoin. Com a mínim s'emmagatzemaran %1 GB de dades en este directori, que seguiran creixent gradualment. També s'hi emmagatzemarà el moneder. Use the default data directory - + Utilitza el directori de dades per defecte Use a custom data directory: - + Utilitza un directori de dades personalitzat: - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - + Bitcoin Core + Bitcoin Core Error - + Error GB of free space available - + GB d'espai lliure disponible (of %1GB needed) - + (d' %1GB necessari) OpenURIDialog Open URI - + Obri un URI Open payment request from URI or file - + Obri una sol·licitud de pagament des d'un URI o un fitxer URI: - + URI: Select payment request file - + Selecciona un fitxer de sol·licitud de pagament Select payment request file to open - + Selecciona el fitxer de sol·licitud de pagament per obrir OptionsDialog Options - + Opcions &Main - + &Principal Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - + Comissió opcional de transacció per kB que ajuda a assegurar que les transaccions es processen ràpidament. La majoria de transaccions són d'1 kB. Pay transaction &fee - + Paga &comissió de transacció Automatically start Bitcoin after logging in to the system. - + Inicia automàticament el Bitcoin després de l'inici de sessió del sistema. &Start Bitcoin on system login - + &Inicia el Bitcoin a l'inici de sessió del sistema. Size of &database cache - + Mida de la memòria cau de la base de &dades MB - + MB Number of script &verification threads - + Nombre de fils de &verificació d'scripts Connect to the Bitcoin network through a SOCKS proxy. - + Connecta a la xarxa Bitcoin a través d'un proxy SOCKS. &Connect through SOCKS proxy (default proxy): - + &Connecta a través d'un proxy SOCKS (proxy per defecte): IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - + Adreça IP del proxy (p. ex. IPv4: 127.0.0.1 / IPv6: ::1) Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - + URL de terceres parts (p. ex. explorador de blocs) que apareix en la pestanya de transaccions com elements del menú contextual. %s en l'URL es reemplaçat pel resum de la transacció. Diferents URL estan separades per una barra vertical |. Third party transaction URLs - + URL de transaccions de terceres parts Active command-line options that override above options: - + Opcions de línies d'orde active que sobreescriuen les opcions de dalt: Reset all client options to default. - + Reestableix totes les opcions del client. &Reset Options - + &Reestableix les opcions &Network - + &Xarxa (0 = auto, <0 = leave that many cores free) - + (0 = auto, <0 = deixa tants nuclis lliures) W&allet - + &Moneder Expert - + Expert Enable coin &control features - + Activa les funcions de &control de les monedes 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. - + Si inhabiliteu la despesa d'un canvi sense confirmar, el canvi d'una transacció no pot ser utilitzat fins que la transacció no tinga com a mínim una confirmació. Això també afecta com es calcula el vostre balanç. &Spend unconfirmed change - + &Gasta el canvi sense confirmar Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - + Obri el port del client de Bitcoin al router de forma automàtica. Això només funciona quan el router implementa UPnP i l'opció està activada. Map port using &UPnP - + Port obert amb &UPnP Proxy &IP: - + &IP del proxy: &Port: - + &Port: Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - + Port del proxy (per exemple 9050) &Window - + &Finestra Show only a tray icon after minimizing the window. - + Mostra només la icona de la barra en minimitzar la finestra. &Minimize to the tray instead of the taskbar - + &Minimitza a la barra d'aplicacions en comptes de la barra de tasques Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - + Minimitza en comptes d'eixir de la aplicació al tancar la finestra. Quan esta opció està activa, la aplicació només es tancarà al seleccionar Eixir al menú. M&inimize on close - + M&inimitza en tancar &Display - + &Pantalla User Interface &language: - + &Llengua de la interfície d'usuari: The user interface language can be set here. This setting will take effect after restarting Bitcoin. - + Ací podeu definir la llengua de l'aplicació. Esta configuració tindrà efecte una vegada es reinicie Bitcoin. &Unit to show amounts in: - + &Unitats per mostrar els imports en: Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - + Selecciona la unitat de subdivisió per defecte per mostrar en la interfície quan s'envien monedes. Whether to show coin control features or not. - + Si voleu mostrar les funcions de control de monedes o no. &OK - + &D'acord &Cancel - + &Cancel·la default - + Per defecte none - + cap Confirm options reset - + Confirmeu el reestabliment de les opcions Client restart required to activate changes. - + Cal reiniciar el client per activar els canvis. Client will be shutdown, do you want to proceed? - + Es pararà el client, voleu procedir? This change would require a client restart. - + Amb este canvi cal un reinici del client. The supplied proxy address is invalid. - + L'adreça proxy introduïda és invalida. OverviewPage Form - + Formulari The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - + La informació mostrada pot no estar al día. El teu moneder es sincronitza automàticament amb la xarxa Bitcoin un cop s'ha establit connexió, però este proces no s'ha completat encara. Wallet - + Moneder Available: - + Disponible: Your current spendable balance - + El balanç que podeu gastar actualment Pending: - + Pendent: Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - + Total de transaccions que encara han de confirmar-se i que encara no compten en el balanç que es pot gastar Immature: - + Immadur: Mined balance that has not yet matured - + Balanç minat que encara no ha madurat Total: - + Total: Your current total balance - + El balanç total actual <b>Recent transactions</b> - + <b>Transaccions recents</b> out of sync - + Fora de sincronia PaymentServer URI handling - + Gestió d'URI - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - + Invalid payment address %1 + Adreça de pagament no vàlida %1 Requested payment amount of %1 is too small (considered dust). - + L'import de pagament sol·licitat %1 és massa petit (es considera polsim). Payment request error - + Error en la sol·licitud de pagament Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - + No es pot iniciar bitcoin: gestor clica-per-pagar Payment request fetch URL is invalid: %1 - + L'URL de recuperació de la sol·licitud de pagament no és vàlida: %1 Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - + Gestió de fitxers de les sol·licituds de pagament Unverified payment requests to custom payment scripts are unsupported. - + No s'accepten sol·licituds de pagament no verificades a scripts de pagament personalitzats. Refund from %1 - + Reemborsament de %1 Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - + Error en comunicar amb %1: %2 Bad response from server %1 - + Mala resposta del servidor %1 Payment acknowledged - + Pagament reconegut Network request error - + Error en la sol·licitud de xarxa + + PeerTableModel + QObject - Bitcoin - + Amount + Import - Error: Specified data directory "%1" does not exist. - + %1 h + %1 h - Error: Cannot parse configuration file: %1. Only use key=value syntax. - + %1 m + %1 m - Error: Invalid combination of -regtest and -testnet. - + N/A + N/D - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget &Save Image... - + &Guarda la imatge... &Copy Image - + &Copia la imatge Save QR Code - + Guarda el codi QR PNG Image (*.png) - + Imatge PNG (*.png) RPCConsole Client name - + Nom del client N/A - + N/D Client version - + Versió del client &Information - + &Informació Debug window - + Finestra de depuració General - + General Using OpenSSL version - + Utilitzant OpenSSL versió Startup time - + &Temps d'inici Network - + Xarxa Name - + Nom Number of connections - + Nombre de connexions Block chain - + Cadena de blocs Current number of blocks - - - - Estimated total blocks - + Nombre de blocs actuals Last block time - + Últim temps de bloc &Open - + &Obri &Console - + &Consola &Network Traffic - + Trà&nsit de la xarxa &Clear - + Nete&ja Totals - + Totals In: - + Dins: Out: - + Fora: Build date - + Data de compilació Debug log file - + Fitxer de registre de depuració Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - + Obri el fitxer de registre de depuració de Bitcoin del directori de dades actual. Això pot trigar uns quants segons per a fitxers de registre grans. Clear console - + Neteja la consola Welcome to the Bitcoin RPC console. - + Vos donem la benvinguda a la consola RPC de Bitcoin Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - + Utilitza les fletxes d'amunt i avall per navegar per l'historial, i <b>Ctrl-L<\b> per netejar la pantalla. Type <b>help</b> for an overview of available commands. - + Escriviu <b>help<\b> per a obtindre un llistat de les ordes disponibles. %1 B - + %1 B %1 KB - + %1 KB %1 MB - + %1 MB %1 GB - + %1 GB - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog &Amount: - + Im&port: &Label: - + &Etiqueta: &Message: - + &Missatge: Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - + Reutilitza una de les adreces de recepció utilitzades anteriorment. La reutilització d'adreces pot comportar problemes de seguretat i privadesa. No ho utilitzeu llevat que torneu a generar una sol·licitud de pagament feta abans. R&euse an existing receiving address (not recommended) - + R&eutilitza una adreça de recepció anterior (no recomanat) An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - + Un missatge opcional que s'adjuntarà a la sol·licitud de pagament, que es mostrarà quan s'òbriga la sol·licitud. Nota: El missatge no s'enviarà amb el pagament per la xarxa Bitcoin. An optional label to associate with the new receiving address. - + Una etiqueta opcional que s'associarà amb la nova adreça receptora. Use this form to request payments. All fields are <b>optional</b>. - + Utilitzeu este formulari per sol·licitar pagaments. Tots els camps són <b>opcionals</b>. An optional amount to request. Leave this empty or zero to not request a specific amount. - + Un import opcional per sol·licitar. Deixeu-ho en blanc o zero per no sol·licitar cap import específic. Clear all fields of the form. - + Neteja tots els camps del formulari. Clear - + Neteja Requested payments history - + Historial de pagaments sol·licitats &Request payment - + &Sol·licitud de pagament Show the selected request (does the same as double clicking an entry) - + Mostra la sol·licitud seleccionada (fa el mateix que el doble clic a una entrada) Show - + Mostra Remove the selected entries from the list - + Esborra les entrades seleccionades de la llista Remove - + Esborra Copy label - + Copiar etiqueta Copy message - + Copia el missatge Copy amount - + Copia l'import ReceiveRequestDialog QR Code - + Codi QR Copy &URI - + Copia l'&URI Copy &Address - + Copia l'&adreça &Save Image... - + &Guarda la imatge... Request payment to %1 - + Sol·licita un pagament a %1 Payment information - + Informació de pagament URI - + URI Address - + Adreça Amount - + Import Label - + Etiqueta Message - + Missatge Resulting URI too long, try to reduce the text for label / message. - + URI resultant massa llarga, intenta reduir el text per a la etiqueta / missatge Error encoding URI into QR Code. - + Error en codificar l'URI en un codi QR. RecentRequestsTableModel Date - + Data Label - + Etiqueta Message - + Missatge Amount - + Import (no label) - + (sense etiqueta) (no message) - + (sense missatge) (no amount) - + (sense import) SendCoinsDialog Send Coins - + Envia monedes Coin Control Features - + Característiques de control de les monedes Inputs... - + Entrades... automatically selected - + seleccionat automàticament Insufficient funds! - + Fons insuficients! Quantity: - + Quantitat: Bytes: - + Bytes: Amount: - + Import: Priority: - + Prioritat: Fee: - - - - Low Output: - + Quota: After Fee: - + Comissió posterior: Change: - + Canvi: If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - + Si s'activa això, però l'adreça de canvi està buida o bé no és vàlida, el canvi s'enviarà a una adreça generada de nou. Custom change address - + Personalitza l'adreça de canvi Send to multiple recipients at once - + Envia a múltiples destinataris al mateix temps Add &Recipient - + Afig &destinatari Clear all fields of the form. - + Neteja tots els camps del formulari. Clear &All - + Neteja-ho &tot Balance: - + Balanç: Confirm the send action - + Confirma l'acció d'enviament S&end - + E&nvia Confirm send coins - + Confirma l'enviament de monedes %1 to %2 - + %1 a %2 Copy quantity - + Copia la quantitat Copy amount - + Copia l'import Copy fee - + Copia la comissió Copy after fee - + Copia la comissió posterior Copy bytes - + Copia els bytes Copy priority - - - - Copy low output - + Copia la prioritat Copy change - + Copia el canvi Total Amount %1 (= %2) - + Import total %1 (= %2) or - + o The recipient address is not valid, please recheck. - + L'adreça de destinatari no és vàlida, per favor comprovi-la. The amount to pay must be larger than 0. - + L'import a pagar ha de ser major que 0. The amount exceeds your balance. - + L'import supera el vostre balanç. The total exceeds your balance when the %1 transaction fee is included. - + El total excedeix el teu balanç quan s'afig la comisió a la transacció %1. Duplicate address found, can only send to each address once per send operation. - + S'ha trobat una adreça duplicada, tan sols es pot enviar a cada adreça un cop per orde d'enviament. Transaction creation failed! - + Ha fallat la creació de la transacció! The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - + S'ha rebutjat la transacció! Això pot passar si alguna de les monedes del vostre moneder ja s'han gastat; per exemple, si heu fet servir una còpia de seguretat del fitxer wallet.dat i s'hagueren gastat monedes de la còpia però sense marcar-les-hi com a gastades. Warning: Invalid Bitcoin address - + Avís: adreça Bitcoin no vàlida (no label) - + (sense etiqueta) Warning: Unknown change address - + Avís: adreça de canvi desconeguda Are you sure you want to send? - + Esteu segur que ho voleu enviar? added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - + S'ha afegit una taxa de transacció SendCoinsEntry A&mount: - + Q&uantitat: Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - + Paga &a: Enter a label for this address to add it to your address book - + Introduïu una etiqueta per a esta adreça per afegir-la a la llibreta d'adreces &Label: - + &Etiqueta: Choose previously used address - + Tria les adreces fetes servir amb anterioritat This is a normal payment. - + Això és un pagament normal. Alt+A - + Alt+A Paste address from clipboard - + Apega l'adreça del porta-retalls Alt+P - + Alt+P Remove this entry - + Elimina esta entrada Message: - + Missatge: This is a verified payment request. - + Esta és una sol·licitud de pagament verificada. Enter a label for this address to add it to the list of used addresses - + Introduïu una etiqueta per a esta adreça per afegir-la a la llista d'adreces utilitzades A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - + Un missatge que s'ha adjuntat al bitcoin: URI que s'emmagatzemarà amb la transacció per a la vostra referència. Nota: el missatge no s'enviarà a través de la xarxa Bitcoin. This is an unverified payment request. - + Esta és una sol·licitud de pagament no verificada. Pay To: - + Paga a: Memo: - + Memo: ShutdownWindow Bitcoin Core is shutting down... - + S'està parant el Bitcoin Core... Do not shut down the computer until this window disappears. - + No apagueu l'ordinador fins que no desaparegui esta finestra. SignVerifyMessageDialog Signatures - Sign / Verify a Message - + Signatures - Signa / verifica un missatge &Sign Message - + &Signa el missatge You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - + Podeu signar missatges amb la vostra adreça per provar que són vostres. Aneu amb compte no signar qualsevol cosa, ja que els atacs de pesca electrònica (phishing) poden provar de confondre-vos perquè els signeu amb la vostra identitat. Només signeu als documents completament detallats amb què hi esteu d'acord. Choose previously used address - + Tria les adreces fetes servir amb anterioritat Alt+A - + Alt+A Paste address from clipboard - + Apega l'adreça del porta-retalls Alt+P - + Alt+P Enter the message you want to sign here - + Introduïu ací el missatge que voleu signar Signature - + Signatura Copy the current signature to the system clipboard - + Copia la signatura actual al porta-retalls del sistema Sign the message to prove you own this Bitcoin address - + Signa el missatge per provar que ets propietari d'esta adreça Bitcoin Sign &Message - + Signa el &missatge Reset all sign message fields - + Neteja tots els camps de clau Clear &All - + Neteja-ho &tot &Verify Message - + &Verifica el missatge Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - + Introduïsca l'adreça signant, missatge (assegura't que copies salts de línia, espais, tabuladors, etc excactament tot el text) i la signatura a sota per verificar el missatge. Per evitar ser enganyat per un atac home-entre-mig, vés amb compte de no llegir més en la signatura del que hi ha al missatge signat mateix. Verify the message to ensure it was signed with the specified Bitcoin address - + Verificar el missatge per assegurar-se que ha estat signat amb una adreça Bitcoin específica Verify &Message - + Verifica el &missatge Reset all verify message fields - + Neteja tots els camps de verificació de missatge - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - + Click "Sign Message" to generate signature + Feu clic a «Signa el missatge» per a generar una signatura The entered address is invalid. - + L'adreça introduïda no és vàlida. Please check the address and try again. - + Comproveu l'adreça i torneu-ho a provar. The entered address does not refer to a key. - + L'adreça introduïda no referencia a cap clau. Wallet unlock was cancelled. - + El desbloqueig del moneder ha estat cancelat. Private key for the entered address is not available. - + La clau privada per a la adreça introduïda no està disponible. Message signing failed. - + La signatura del missatge ha fallat. Message signed. - + Missatge signat. The signature could not be decoded. - + La signatura no s'ha pogut descodificar. Please check the signature and try again. - + Comproveu la signatura i torneu-ho a provar. The signature did not match the message digest. - + La signatura no coincideix amb el resum del missatge. Message verification failed. - + Ha fallat la verificació del missatge. Message verified. - + Missatge verificat. SplashScreen Bitcoin Core - + Bitcoin Core The Bitcoin Core developers - + Els desenvolupadors del Bitcoin Core [testnet] - + [testnet] TrafficGraphWidget KB/s - + KB/s TransactionDesc Open until %1 - + Obert fins %1 conflicted - + en conflicte %1/offline - + %1/fora de línia %1/unconfirmed - + %1/sense confirmar %1 confirmations - + %1 confirmacions Status - - - - , broadcast through %n node(s) - + Estat Date - + Data Source - + Font Generated - + Generat From - + Des de To - + A own address - + Adreça pròpia label - + etiqueta Credit - - - - matures in %n more block(s) - + Crèdit not accepted - + no acceptat Debit - + Dèbit Transaction fee - + Comissió de transacció Net amount - + Import net Message - + Missatge Comment - + Comentar Transaction ID - + ID de transacció Merchant - + Mercader - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Les monedes generades han de madurar %1 blocs abans de poder ser gastades. Quan genereu este bloc, es farà saber a la xarxa per tal d'afegir-lo a la cadena de blocs. Si no pot fer-se lloc a la cadena, el seu estat canviarà a «no acceptat» i no es podrà gastar. Això pot passar ocasionalment si un altre node genera un bloc en un marge de segons respecte al vostre. Debug information - + Informació de depuració Transaction - + Transacció Inputs - + Entrades Amount - + Import true - + cert false - + fals , has not been successfully broadcast yet - - - - Open for %n more block(s) - + , encara no ha estat emés correctement unknown - + desconegut TransactionDescDialog Transaction details - + Detall de la transacció This pane shows a detailed description of the transaction - + Este panell mostra una descripció detallada de la transacció TransactionTableModel Date - + Data Type - + Tipus Address - - - - Amount - + Adreça Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - + Immadur (%1 confirmacions, serà disponible després de %2) Open until %1 - + Obert fins %1 Confirmed (%1 confirmations) - + Confirmat (%1 confirmacions) This block was not received by any other nodes and will probably not be accepted! - + Este bloc no ha estat rebut per cap altre node i probablement no serà acceptat! Generated but not accepted - + Generat però no acceptat Offline - + Fora de línia Unconfirmed - + Sense confirmar Confirming (%1 of %2 recommended confirmations) - + Confirmant (%1 de %2 confirmacions recomanades) Conflicted - + En conflicte Received with - + Rebut amb Received from - + Rebut de Sent to - + Enviat a Payment to yourself - + Pagament a un mateix Mined - + Minat (n/a) - + (n/a) Transaction status. Hover over this field to show number of confirmations. - + Estat de la transacció. Desplaceu-vos sobre este camp per mostrar el nombre de confirmacions. Date and time that the transaction was received. - + Data i hora en que la transacció va ser rebuda. Type of transaction. - + Tipus de transacció. Destination address of transaction. - + Adreça del destinatari de la transacció. Amount removed from or added to balance. - + Import extret o afegit del balanç. TransactionView All - + Tot Today - + Hui This week - + Esta setmana This month - + Este mes Last month - + El mes passat This year - + Enguany Range... - + Rang... Received with - + Rebut amb Sent to - + Enviat a To yourself - + A un mateix Mined - + Minat Other - + Altres Enter address or label to search - + Introduïu una adreça o una etiqueta per cercar Min amount - + Import mínim Copy address - + Copiar adreça Copy label - + Copiar etiqueta Copy amount - + Copia l'import Copy transaction ID - + Copiar ID de transacció Edit label - + Editar etiqueta Show transaction details - + Mostra detalls de la transacció Export Transaction History - + Exporta l'historial de transacció Exporting Failed - + L'exportació ha fallat There was an error trying to save the transaction history to %1. - + S'ha produït un error en provar de guardar l'historial de transacció a %1. Exporting Successful - + Exportació amb èxit The transaction history was successfully saved to %1. - + L'historial de transaccions s'ha guardat correctament a %1. Comma separated file (*.csv) - + Fitxer de separació amb comes (*.csv) Confirmed - + Confirmat Date - + Data Type - + Tipus Label - + Etiqueta Address - - - - Amount - + Adreça ID - + ID Range: - + Rang: to - + a + + UnitDisplayStatusBarControl + WalletFrame No wallet has been loaded. - + No s'ha carregat cap moneder. WalletModel Send Coins - + Envia monedes WalletView &Export - + &Exporta Export the data in the current tab to a file - + Exporta les dades de la pestanya actual a un fitxer Backup Wallet - + Còpia de seguretat del moneder Wallet Data (*.dat) - + Dades del moneder (*.dat) Backup Failed - + Ha fallat la còpia de seguretat There was an error trying to save the wallet data to %1. - + S'ha produït un error en provar de guardar les dades del moneder a %1. The wallet data was successfully saved to %1. - + S'han guardat les dades del moneder correctament a %1. Backup Successful - + La còpia de seguretat s'ha realitzat correctament bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - Options: - + Opcions: Specify configuration file (default: bitcoin.conf) - + Especifica un fitxer de configuració (per defecte: bitcoin.conf) Specify pid file (default: bitcoind.pid) - + Especifica un fitxer pid (per defecte: bitcoind.pid) Specify data directory - + Especifica el directori de dades Listen for connections on <port> (default: 8333 or testnet: 18333) - + Escolta connexions a <port> (per defecte: 8333 o testnet: 18333) Maintain at most <n> connections to peers (default: 125) - + Manté com a molt <n> connexions a iguals (per defecte: 125) Connect to a node to retrieve peer addresses, and disconnect - + Connecta al node per obtindre les adreces de les connexions, i desconnecta Specify your own public address - + Especifiqueu la vostra adreça pública Threshold for disconnecting misbehaving peers (default: 100) - + Límit per a desconectar connexions errònies (per defecte: 100) Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - + Nombre de segons abans de reconectar amb connexions errònies (per defecte: 86400) Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - + Escolta connexions JSON-RPC al port <port> (per defecte: 8332 o testnet:18332) Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - + Accepta la línia d'ordes i ordes JSON-RPC Run in the background as a daemon and accept commands - + Executa en segon pla com a programa dimoni i accepta ordes Use the test network - + Utilitza la xarxa de prova Accept connections from outside (default: 1 if no -proxy or -connect) - + Accepta connexions de fora (per defecte: 1 si no -proxy o -connect) %s, you must set a rpcpassword in the configuration file: @@ -2674,695 +2448,586 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - + %s, heu d'establir una contrasenya RPC al fitxer de configuració: %s +Es recomana que useu la següent contrasenya aleatòria: +rpcuser=bitcoinrpc +rpcpassword=%s +(no necesiteu recordar esta contrasenya) +El nom d'usuari i la contrasenya NO HAN de ser els mateixos. +Si el fitxer no existeix, crea'l amb els permisos de fitxer de només lectura per al propietari. +També es recomana establir la notificació d'alertes i així sereu notificat de les incidències; +per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com + Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - + Xifrats acceptables (per defecte: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Bind to given address and always listen on it. Use [host]:port notation for IPv6 - + Vincula a una adreça específica i sempre escolta-hi. Utilitza la notació [host]:port per IPv6 Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - + Limita contínuament les transaccions gratuïtes a <n>*1000 bytes per minut (per defecte: 15) Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - + Entra en el mode de proves de regressió, que utilitza una cadena especial en què els blocs poden resoldre's al moment. Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - + Error: La transacció ha estat rebutjada. Això pot passar si alguna de les monedes del teu moneder ja s'han gastat, com si haguesis usat una copia de l'arxiu wallet.dat i s'hagueren gastat monedes de la copia però sense marcar com gastades en este. Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - + Error: Esta transacció requereix una comissió d'almenys %s degut al seu import, complexitat o per l'ús de fons recentment rebuts! Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - + Executa una orde quan una transacció del moneder canvie (%s en cmd es canvia per TxID) Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - + Buida l'activitat de la base de dades de la memòria disponible al registre del disc cada <n> megabytes (per defecte: 100) How thorough the block verification of -checkblocks is (0-4, default: 3) - + Com d'exhaustiva és la verificació de blocs de -checkblocks is (0-4, per defecte: 3) In this mode -genproclimit controls how many blocks are generated immediately. - + En este mode -genproclimit controla quants blocs es generen immediatament. Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - + Defineix el nombre de fils de verificació d'scripts (%u a %d, 0 = auto, <0 = deixa tants nuclis lliures, per defecte: %d) Set the processor limit for when generation is on (-1 = unlimited, default: -1) - + Defineix el límit de processadors quan està activada la generació (-1 = sense límit, per defecte: -1) This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - + Esta és una versió de pre-llançament - utilitza-la sota la teva responsabilitat - No usar per a minería o aplicacions de compra-venda Unable to bind to %s on this computer. Bitcoin Core is probably already running. - + No es pot enllaçar %s a este ordinador. El Bitcoin Core probablement ja estiga executant-s'hi. Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - + Utilitza un proxy SOCKS5 apart per arribar a iguals a través de serveis de Tor ocults (per defecte: -proxy) Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - + Avís: el -paytxfee és molt elevat! Esta és la comissió de transacció que pagareu si envieu una transacció. Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - + Avís: la xarxa no pareix que hi estiga plenament d'acord. Alguns miners pareix que estan experimentant problemes. Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - + Avís: pareix que no estem plenament d'acord amb els nostres iguals! Podria caldre que actualitzar l'aplicació, o potser que ho facen altres nodes. Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - + Avís: error en llegir el fitxer wallet.dat! Totes les claus es lligen correctament, però hi ha dades de transaccions o entrades de la llibreta d'adreces absents o bé son incorrectes. Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - + Avís: el fitxer wallet.dat és corrupte, dades rescatades! L'arxiu wallet.dat original ha estat guardat com wallet.{estampa_temporal}.bak al directori %s; si el teu balanç o transaccions son incorrectes hauries de restaurar-lo de un backup. (default: 1) - + (per defecte: 1) (default: wallet.dat) - + (per defecte: wallet.dat) <category> can be: - + <category> pot ser: Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - + Intenta recuperar les claus privades d'un fitxer wallet.dat corrupte Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - + Opcions de la creació de blocs: Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - + Connecta només al(s) node(s) especificats Connection options: - + Opcions de connexió: Corrupted block database detected - + S'ha detectat una base de dades de blocs corrupta Debugging/Testing options: - + Opcions de depuració/proves: Disable safemode, override a real safe mode event (default: 0) - + Inhabilia el mode segur (safemode), invalida un esdeveniment de mode segur real (per defecte: 0) Discover own IP address (default: 1 when listening and no -externalip) - + Descobreix la pròpia adreça IP (per defecte: 1 quan escoltant i no -externalip) Do not load the wallet and disable wallet RPC calls - + No carreguis el moneder i inhabilita les crides RPC del moneder Do you want to rebuild the block database now? - + Voleu reconstruir la base de dades de blocs ara? Error initializing block database - + Error carregant la base de dades de blocs Error initializing wallet database environment %s! - + Error inicialitzant l'entorn de la base de dades del moneder %s! Error loading block database - + Error carregant la base de dades del bloc Error opening block database - + Error en obrir la base de dades de blocs Error: Disk space is low! - + Error: Espai al disc baix! Error: Wallet locked, unable to create transaction! - + Error: El moneder està bloquejat, no és possible crear la transacció! Error: system error: - + Error: error de sistema: Failed to listen on any port. Use -listen=0 if you want this. - + Ha fallat escoltar a qualsevol port. Feu servir -listen=0 si voleu fer això. Failed to read block info - + Ha fallat la lectura de la informació del bloc Failed to read block - + Ha fallat la lectura del bloc Failed to sync block index - + Ha fallat la sincronització de l'índex de blocs Failed to write block index - + Ha fallat la escriptura de l'índex de blocs Failed to write block info - + Ha fallat la escriptura de la informació de bloc Failed to write block - + Ha fallat l'escriptura del bloc Failed to write file info - + Ha fallat l'escriptura de la informació de fitxer Failed to write to coin database - + Ha fallat l'escriptura de la basse de dades de monedes Failed to write transaction index - + Ha fallat l'escriptura de l'índex de transaccions Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - + Ha fallat el desfer de dades Force safe mode (default: 0) - + Força el mode segur (per defecte: 0) Generate coins (default: 0) - + Genera monedes (per defecte: 0) How many blocks to check at startup (default: 288, 0 = all) - + Quants blocs s'han de confirmar a l'inici (per defecte: 288, 0 = tots) If <category> is not supplied, output all debugging information. - + Si no se subministra <category>, mostra tota la informació de depuració. Importing... - + S'està important... Incorrect or no genesis block found. Wrong datadir for network? - + No s'ha trobat el bloc de gènesi o és incorrecte. El directori de dades de la xarxa és incorrecte? - Invalid -onion address: '%s' - + Invalid -onion address: '%s' + Adreça -onion no vàlida: '%s' Not enough file descriptors available. - + No hi ha suficient descriptors de fitxers disponibles. Prepend debug output with timestamp (default: 1) - - - - RPC client options: - + Posa davant de l'eixida de depuració una marca horària (per defecte: 1) Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - + Reconstrueix l'índex de la cadena de blocs dels fitxers actuals blk000??.dat Set database cache size in megabytes (%d to %d, default: %d) - + Defineix la mida de la memòria cau de la base de dades en megabytes (%d a %d, per defecte: %d) Set maximum block size in bytes (default: %d) - + Defineix la mida màxim del bloc en bytes (per defecte: %d) Set the number of threads to service RPC calls (default: 4) - + Estableix el nombre de fils per atendre trucades RPC (per defecte: 4) Specify wallet file (within data directory) - + Especifica un fitxer de moneder (dins del directori de dades) Spend unconfirmed change when sending transactions (default: 1) - + Gasta el canvi sense confirmar en enviar transaccions (per defecte: 1) This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - + Això s'així per a eines de proves de regressió per al desenvolupament d'aplicacions. Verifying blocks... - + S'estan verificant els blocs... Verifying wallet... - - - - Wait for RPC server to start - + S'està verificant el moneder... Wallet %s resides outside data directory %s - + El moneder %s resideix fora del directori de dades %s Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - + Opcions de moneder: You need to rebuild the database using -reindex to change -txindex - + Cal que reconstruïu la base de dades fent servir -reindex per canviar -txindex Imports blocks from external blk000??.dat file - + Importa blocs d'un fitxer blk000??.dat extern Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - + No es pot obtindre un bloqueig del directori de dades %s. El Bitcoin Core probablement ja s'estiga executant. Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - + Executa l'orde quan es reba un avís rellevant o veiem una forquilla molt llarga (%s en cmd és reemplaçat per un missatge) Output debugging information (default: 0, supplying <category> is optional) - + Informació de la depuració d'eixida (per defecte: 0, proporcionar <category> és opcional) Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - + Defineix la mida màxima de transaccions d'alta prioritat / baixa comissió en bytes (per defecte: %d) Information - + Informació - Invalid amount for -minrelaytxfee=<amount>: '%s' - + Invalid amount for -minrelaytxfee=<amount>: '%s' + Import no vàlid per a -minrelaytxfee=<amount>: «%s» - Invalid amount for -mintxfee=<amount>: '%s' - + Invalid amount for -mintxfee=<amount>: '%s' + Import no vàlid per a -mintxfee=<amount>: «%s» Limit size of signature cache to <n> entries (default: 50000) - + Mida límit de la memòria cau de signatura per a <n> entrades (per defecte: 50000) Log transaction priority and fee per kB when mining blocks (default: 0) - + Registra la prioritat de transacció i comissió per kB en minar blocs (per defecte: 0) Maintain a full transaction index (default: 0) - + Manté l'índex sencer de transaccions (per defecte: 0) Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - + Mida màxima del buffer de recepció per a cada connexió, <n>*1000 bytes (default: 5000) Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - + Mida màxima del buffer d'enviament per a cada connexió, <n>*1000 bytes (default: 5000) Only accept block chain matching built-in checkpoints (default: 1) - + Només accepta cadenes de blocs que coincidisquen amb els punts de prova (per defecte: 1) Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - + Només connecta als nodes de la xarxa <net> (IPv4, IPv6 o Tor) Print block on startup, if found in block index - + Imprimeix el block a l'inici, si es troba l'índex de blocs Print block tree on startup (default: 0) - + Imprimeix l'arbre de blocs a l'inici (per defecte: 0) RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - + Opcions RPC SSL: (veieu el wiki del Bitcoin per a instruccions de configuració de l'SSL) RPC server options: - + Opcions del servidor RPC: Randomly drop 1 of every <n> network messages - + Descarta a l'atzar 1 de cada <n> missatges de la xarxa Randomly fuzz 1 of every <n> network messages - + Introdueix incertesa en 1 de cada <n> missatges de la xarxa Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - + Executa un fil per buidar el moneder periòdicament (per defecte: 1) Send trace/debug info to console instead of debug.log file - + Envia informació de traça/depuració a la consola en comptes del fitxer debug.log Set minimum block size in bytes (default: 0) - + Defineix una mida mínima de bloc en bytes (per defecte: 0) Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - + Defineix el senyal DB_PRIVATE en l'entorn db del moneder (per defecte: 1) Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - + Mostra totes les opcions de depuració (ús: --help --help-debug) Shrink debug.log file on client startup (default: 1 when no -debug) - + Redueix el fitxer debug.log durant l'inici del client (per defecte: 1 quan no -debug) Signing transaction failed - + Ha fallat la signatura de la transacció Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - + Especifica el temps limit per a un intent de connexió en mil·lisegons (per defecte: 5000) System error: - + Error de sistema: Transaction amount too small - + Import de la transacció massa petit Transaction amounts must be positive - + Els imports de les transaccions han de ser positius Transaction too large - + La transacció és massa gran Use UPnP to map the listening port (default: 0) - + Utilitza UPnP per a mapejar els ports d'escolta (per defecte: 0) Use UPnP to map the listening port (default: 1 when listening) - + Utilitza UPnP per a mapejar els ports d'escolta (per defecte: 1 quan s'escolta) Username for JSON-RPC connections - + Nom d'usuari per a connexions JSON-RPC Warning - + Avís Warning: This version is obsolete, upgrade required! - + Avís: esta versió està obsoleta. És necessari actualitzar-la! Zapping all transactions from wallet... - + Se suprimeixen totes les transaccions del moneder... on startup - - - - version - + a l'inici de l'aplicació wallet.dat corrupt, salvage failed - + El fitxer wallet.data és corrupte. El rescat de les dades ha fallat Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - + Contrasenya per a connexions JSON-RPC Execute command when the best block changes (%s in cmd is replaced by block hash) - + Executa l'orde quan el millor bloc canvie (%s en cmd es reemplaça per un resum de bloc) Upgrade wallet to latest format - + Actualitza el moneder a l'últim format Set key pool size to <n> (default: 100) - + Defineix el límit de nombre de claus a <n> (per defecte: 100) Rescan the block chain for missing wallet transactions - + Reescaneja la cadena de blocs en les transaccions de moneder perdudes Use OpenSSL (https) for JSON-RPC connections - + Utilitza OpenSSL (https) per a connexions JSON-RPC Server certificate file (default: server.cert) - + Fitxer del certificat de servidor (per defecte: server.cert) Server private key (default: server.pem) - + Clau privada del servidor (per defecte: server.pem) This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - + Este misatge d'ajuda Allow DNS lookups for -addnode, -seednode and -connect - + Permet consultes DNS per a -addnode, -seednode i -connect Loading addresses... - + S'estan carregant les adreces... Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - + Error en carregar wallet.dat: Moneder corrupte Error loading wallet.dat - + Error en carregar wallet.dat - Invalid -proxy address: '%s' - + Invalid -proxy address: '%s' + Adreça -proxy invalida: '%s' - Unknown network specified in -onlynet: '%s' - + Unknown network specified in -onlynet: '%s' + Xarxa desconeguda especificada a -onlynet: '%s' - Unknown -socks proxy version requested: %i - + Cannot resolve -bind address: '%s' + No es pot resoldre l'adreça -bind: '%s' - Cannot resolve -bind address: '%s' - + Cannot resolve -externalip address: '%s' + No es pot resoldre l'adreça -externalip: '%s' - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - + Invalid amount for -paytxfee=<amount>: '%s' + Import no vàlid per a -paytxfee=<amount>: «%s» Invalid amount - + Import no vàlid Insufficient funds - + Balanç insuficient Loading block index... - + S'està carregant l'índex de blocs... Add a node to connect to and attempt to keep the connection open - + Afig un node per a connectar-s'hi i intenta mantindre-hi la connexió oberta Loading wallet... - + S'està carregant el moneder... Cannot downgrade wallet - + No es pot reduir la versió del moneder Cannot write default address - + No es pot escriure l'adreça per defecte Rescanning... - + S'està reescanejant... Done loading - + Ha acabat la càrrega To use the %s option - + Utilitza l'opció %s Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - + Error \ No newline at end of file diff --git a/src/qt/locale/bitcoin_ca_ES.ts b/src/qt/locale/bitcoin_ca_ES.ts index 5bf7fbfba7..f3b2b4a926 100644 --- a/src/qt/locale/bitcoin_ca_ES.ts +++ b/src/qt/locale/bitcoin_ca_ES.ts @@ -1,133 +1,101 @@ - - - AboutDialog - - About Bitcoin Core - Sobre el Nucli de Bitcoin - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - \n Aquest és software experimental.\n\n Distribuït sota llicència de software MIT/11, veure l'arxiu COPYING o http://www.opensource.org/licenses/mit-license.php.\n\nAquest producte inclou software desarrollat pel projecte OpenSSL per a l'ús de OppenSSL Toolkit (http://www.openssl.org/) i de softwqre criptogràfic escrit per l'Eric Young (eay@cryptsoft.com) i software UPnP escrit per en Thomas Bernard. - - - Copyright - Copyright - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage Double-click to edit address or label - Feu doble clic per editar l'adreça o l'etiqueta + Feu doble clic per editar l'adreça o l'etiqueta Create a new address - Crear una nova adreça + Crea una nova adreça &New - &Nou + &Nova Copy the currently selected address to the system clipboard - Copiar l'adreça seleccionada al porta-retalls del sistema + Copia l'adreça seleccionada al porta-retalls del sistema &Copy - &Copiar + &Copia C&lose - + &Tanca &Copy Address - &Copiar adreça + &Copia l'adreça Delete the currently selected address from the list - Esborrar l'adreça sel·leccionada + Elimina l'adreça sel·leccionada actualment de la llista Export the data in the current tab to a file - Exportar les dades de la pestanya actual a un arxiu + Exporta les dades de la pestanya actual a un fitxer &Export - &Exportar + &Exporta &Delete - &Esborrar + &Elimina Choose the address to send coins to - Escull una adreça a la qual enviar coins + Trieu una adreça on voleu enviar monedes Choose the address to receive coins with - Escull l'adreça a la quals vols rebre coins + Trieu l'adreça on voleu rebre monedes C&hoose - + T&ria Sending addresses - Enviant adreces + S'estan enviant les adreces Receiving addresses - Rebent adreces + S'estan rebent les adreces These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - Aquestes són la seva adreça de Bitcoin per enviar els pagaments. Sempre revisi la quantitat i l'adreça del destinatari abans transferència de monedes. + Aquestes són les vostres adreces de Bitcoin per enviar els pagaments. Sempre reviseu l'import i l'adreça del destinatari abans de transferir monedes. These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - + Aquestes són les vostres adreces Bitcoin per rebre pagaments. Es recomana utilitzar una adreça nova de recepció per a cada transacció. Copy &Label - Copiar &Etiqueta + Copia l'&etiqueta &Edit - &Editar + &Edita Export Address List - Exportar la llista d'adre + Exporta la llista d'adreces Comma separated file (*.csv) - Arxiu de separació per comes (*.csv) + Fitxer de separació amb comes (*.csv) Exporting Failed - + L'exportació ha fallat - There was an error trying to save the address list to %1. - + There was an error trying to save the address list to %1. Please try again. + S'ha produït un error en desar la llista d'adreces a %1. Torneu-ho a provar. @@ -149,11 +117,11 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog Passphrase Dialog - Dialeg de contrasenya + Diàleg de contrasenya Enter passphrase - Introdueix contrasenya + Introduïu una contrasenya New passphrase @@ -161,19 +129,15 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase - Repeteix la nova contrasenya - - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Introdueixi la nova contrasenya al moneder<br/>Si us plau useu una contrasenya de <b>10 o més caracters aleatoris</b>, o <b>vuit o més paraules</b>. + Repetiu la nova contrasenya Encrypt wallet - Xifrar la cartera + Encripta el moneder This operation needs your wallet passphrase to unlock the wallet. - Aquesta operació requereix la seva contrasenya del moneder per a desbloquejar-lo. + Aquesta operació requereix la contrasenya del moneder per a desbloquejar-lo. Unlock wallet @@ -181,7 +145,7 @@ This product includes software developed by the OpenSSL Project for use in the O This operation needs your wallet passphrase to decrypt the wallet. - Aquesta operació requereix la seva contrasenya del moneder per a desencriptar-lo. + Aquesta operació requereix la contrasenya del moneder per desencriptar-lo. Decrypt wallet @@ -189,19 +153,19 @@ This product includes software developed by the OpenSSL Project for use in the O Change passphrase - Canviar la contrasenya + Canvia la contrasenya Enter the old and new passphrase to the wallet. - Introdueixi tant l'antiga com la nova contrasenya de moneder. + Introduïu tant la contrasenya antiga com la nova del moneder. Confirm wallet encryption - Confirmar l'encriptació del moneder + Confirma l'encriptació del moneder Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - Advertència: Si encripteu el vostre moneder i perdeu la constrasenya, <b>PERDREU TOTS ELS VOSTRES BITCOINS</b>! + Avís: si encripteu el vostre moneder i perdeu la contrasenya, <b>PERDREU TOTS ELS VOSTRES BITCOINS</b>! Are you sure you wish to encrypt your wallet? @@ -209,27 +173,31 @@ This product includes software developed by the OpenSSL Project for use in the O 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. - IMPORTANT: Tota copia de seguretat que hagis realitzat hauria de ser reemplaçada pel, recentment generat, arxiu encriptat del moneder. + IMPORTANT: Tota copia de seguretat que hàgiu realitzat hauria de ser reemplaçada pel, recentment generat, fitxer encriptat del moneder. Warning: The Caps Lock key is on! - Advertència: Les lletres majúscules estàn activades! + Avís: Les lletres majúscules estan activades! Wallet encrypted Moneder encriptat + + 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>. + Introduïu la contrasenya nova al moneder.<br/>Utilitzeu una contrasenya de <b>deu o més caràcters aleatoris</b>, o <b>vuit o més paraules</b>. + Bitcoin 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. - Bitcoin es tancarà ara per acabar el procés d'encriptació. Recorda que encriptar el teu moneder no protegeix completament els teus bitcoins de ser robades per programari maliciós instal·lat al teu ordinador. + Bitcoin es tancarà ara per acabar el procés d'encriptació. Recordeu que encriptar el moneder no protegeix completament els bitcoins de ser robats per programari maliciós instal·lat a l'ordinador. Wallet encryption failed - L'encriptació del moneder ha fallat + L'encriptació del moneder ha fallat Wallet encryption failed due to an internal error. Your wallet was not encrypted. - L'encriptació del moneder ha fallat per un error intern. El seu moneder no ha estat encriptat. + L'encriptació del moneder ha fallat per un error intern. El moneder no ha estat encriptat. The supplied passphrases do not match. @@ -241,7 +209,7 @@ This product includes software developed by the OpenSSL Project for use in the O The passphrase entered for the wallet decryption was incorrect. - La contrasenya introduïda per a desencriptar el moneder és incorrecte. + La contrasenya introduïda per a desencriptar el moneder és incorrecta. Wallet decryption failed @@ -256,11 +224,11 @@ This product includes software developed by the OpenSSL Project for use in the O BitcoinGUI Sign &message... - Signar &missatge... + Signa el &missatge... Synchronizing with network... - Sincronitzant amb la xarxa ... + S'està sincronitzant amb la xarxa ... &Overview @@ -272,7 +240,7 @@ This product includes software developed by the OpenSSL Project for use in the O Show general overview of wallet - Mostra panorama general del moneder + Mostra el panorama general del moneder &Transactions @@ -280,23 +248,19 @@ This product includes software developed by the OpenSSL Project for use in the O Browse transaction history - Cerca a l'historial de transaccions + Cerca a l'historial de transaccions E&xit - S&ortir + S&urt Quit application - Sortir de l'aplicació - - - Show information about Bitcoin - Mostra informació sobre Bitcoin + Surt de l'aplicació About &Qt - Sobre &Qt + Quant a &Qt Show information about Qt @@ -308,63 +272,67 @@ This product includes software developed by the OpenSSL Project for use in the O &Encrypt Wallet... - &Xifrar moneder + &Encripta el moneder... &Backup Wallet... - &Realitzant copia de seguretat del moneder... + &Realitza una còpia de seguretat del moneder... &Change Passphrase... - &Canviar contrasenya... + &Canvia la contrasenya... &Sending addresses... - + Adreces d'e&nviament... &Receiving addresses... - + Adreces de &recepció Open &URI... - + Obre un &URI... + + + Bitcoin Core client + Client del Bitcoin Core Importing blocks from disk... - Important blocs del disc.. + S'estan important els blocs del disc... Reindexing blocks on disk... - Re-indexant blocs al disc... + S'estan reindexant els blocs al disc... Send coins to a Bitcoin address - Enviar monedes a una adreça Bitcoin + Envia monedes a una adreça Bitcoin Modify configuration options for Bitcoin - Modificar les opcions de configuració per bitcoin + Modifica les opcions de configuració per bitcoin Backup wallet to another location - Realitzar còpia de seguretat del moneder a un altre directori + Realitza una còpia de seguretat del moneder a una altra ubicació Change the passphrase used for wallet encryption - Canviar la constrasenya d'encriptació del moneder + Canvia la contrasenya d'encriptació del moneder &Debug window - &Finestra de debug + &Finestra de depuració Open debugging and diagnostic console - Obrir la consola de diagnòstic i debugging + Obre la consola de diagnòstic i depuració &Verify message... - &Verifica el missatge.. + &Verifica el missatge... Bitcoin @@ -376,23 +344,27 @@ This product includes software developed by the OpenSSL Project for use in the O &Send - &Enviar + &Envia &Receive - &Rebre + &Rep + + + Show information about Bitcoin Core + Mostra informació del Bitcoin Core &Show / Hide - &Mostrar / Amagar + &Mostra / Amaga Show or hide the main Window - Mostrar o amagar la finestra principal + Mostra o amaga la finestra principal Encrypt the private keys that belong to your wallet - Xifrar les claus privades pertanyents al seu moneder + Encripta les claus privades pertanyents al moneder Sign messages with your Bitcoin addresses to prove you own them @@ -400,11 +372,11 @@ This product includes software developed by the OpenSSL Project for use in the O Verify messages to ensure they were signed with specified Bitcoin addresses - Verificar els missatges per assegurar-te que han estat signades amb una adreça Bitcoin específica. + Verifiqueu els missatges per assegurar-vos que han estat signats amb una adreça Bitcoin específica. &File - &Arxiu + &Fitxer &Settings @@ -416,7 +388,7 @@ This product includes software developed by the OpenSSL Project for use in the O Tabs toolbar - Barra d'eines de seccions + Barra d'eines de les pestanyes [testnet] @@ -428,35 +400,31 @@ This product includes software developed by the OpenSSL Project for use in the O Request payments (generates QR codes and bitcoin: URIs) - + Sol·licita pagaments (genera codis QR i bitcoin: URI) &About Bitcoin Core - + &Quant al Bitcoin Core Show the list of used sending addresses and labels - + Mostra la llista d'adreces d'enviament i etiquetes utilitzades Show the list of used receiving addresses and labels - + Mostra la llista d'adreces de recepció i etiquetes utilitzades Open a bitcoin: URI or payment request - + Obre una bitcoin: sol·licitud d'URI o pagament &Command-line options - + Opcions de la &línia d'ordres Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Client Bitcoin + Mostra el missatge d'ajuda del Bitcoin Core per obtenir una llista amb les possibles opcions de línia d'ordres de Bitcoin %n active connection(s) to Bitcoin network @@ -464,11 +432,7 @@ This product includes software developed by the OpenSSL Project for use in the O No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - Processat el %1 de %2 (estimat) dels blocs del històric de transaccions. + No hi ha cap font de bloc disponible... Processed %1 blocks of transaction history. @@ -488,23 +452,23 @@ This product includes software developed by the OpenSSL Project for use in the O %1 and %2 - + %1 i %2 %n year(s) - + %n any%n anys %1 behind - %1 radera + %1 darrere Last received block was generated %1 ago. - Lúltim bloc rebut ha estat generat fa %1. + El darrer bloc rebut ha estat generat fa %1. Transactions after this will not yet be visible. - Les transaccions a partir d'això no seràn visibles. + Les transaccions a partir d'això no seran visibles. Error @@ -524,7 +488,7 @@ This product includes software developed by the OpenSSL Project for use in the O Catching up... - Posar-se al dia ... + S'està posant al dia ... Sent transaction @@ -540,7 +504,7 @@ Amount: %2 Type: %3 Address: %4 - Data: %1\nQuantitat %2\n Tipus: %3\n Adreça: %4\n + Data: %1\nImport: %2\n Tipus: %3\n Adreça: %4\n Wallet is <b>encrypted</b> and currently <b>unlocked</b> @@ -550,10 +514,6 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> El moneder està <b>encriptat</b> i actualment <b>bloquejat</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Ha tingut lloc un error fatal. Bitcoin no pot continuar executant-se de manera segura i es tancará. - ClientModel @@ -566,7 +526,7 @@ Address: %4 CoinControlDialog Coin Control Address Selection - + Selecció de l'adreça de control de monedes Quantity: @@ -578,7 +538,7 @@ Address: %4 Amount: - Quantitat: + Import: Priority: @@ -589,8 +549,8 @@ Address: %4 Quota: - Low Output: - + Dust: + Polsim: After Fee: @@ -602,7 +562,7 @@ Address: %4 (un)select all - + (des)selecciona-ho tot Tree mode @@ -646,7 +606,7 @@ Address: %4 Copy amount - Copiar quantitat + Copia l'import Copy transaction ID @@ -654,39 +614,39 @@ Address: %4 Lock unspent - + Bloqueja sense gastar Unlock unspent - + Desbloqueja sense gastar Copy quantity - + Copia la quantitat Copy fee - + Copia la comissió Copy after fee - + Copia la comissió posterior Copy bytes - + Copia els bytes Copy priority - + Copia la prioritat - Copy low output - + Copy dust + Copia el polsim Copy change - + Copia el canvi highest @@ -726,19 +686,19 @@ Address: %4 (%1 locked) - + (%1 bloquejada) none - + cap - Dust - Pols + Can vary +/- %1 satoshi(s) per input. + Pot variar +/- %1 satoshi(s) per entrada. yes - si + no @@ -750,35 +710,23 @@ Address: %4 This means a fee of at least %1 per kB is required. - + Això comporta una comissi d'almenys %1 per kB. Can vary +/- 1 byte per input. - + Pot variar +/- 1 byte per entrada. Transactions with higher priority are more likely to get included into a block. - + Les transaccions amb una major prioritat són més propenses a ser incloses en un bloc. - This label turns red, if the priority is smaller than "medium". - + This label turns red, if the priority is smaller than "medium". + Aquesta etiqueta es torna vermella si la prioritat és menor que «mitjana». This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - + Aquesta etiqueta es torna vermella si qualsevol destinatari rep un import inferior a %1. (no label) @@ -786,11 +734,11 @@ Address: %4 change from %1 (%2) - + canvia de %1 (%2) (change) - (canviar) + (canvia) @@ -805,15 +753,15 @@ Address: %4 The label associated with this address list entry - + L'etiqueta associada amb aquesta entrada de llista d'adreces The address associated with this address list entry. This can only be modified for sending addresses. - + L'adreça associada amb aquesta entrada de llista d'adreces. Només es pot modificar per a les adreces d'enviament. &Address - &Direcció + &Adreça New receiving address @@ -821,38 +769,38 @@ Address: %4 New sending address - Nova adreça d'enviament + Nova adreça d'enviament Edit receiving address - Editar adreces de recepció + Edita les adreces de recepció Edit sending address - Editar adreces d'enviament + Edita les adreces d'enviament - The entered address "%1" is already in the address book. - L'adreça introduïda "%1" ja és present a la llibreta d'adreces. + The entered address "%1" is already in the address book. + L'adreça introduïda «%1» ja és present a la llibreta d'adreces. - The entered address "%1" is not a valid Bitcoin address. - L'adreça introduida "%1" no és una adreça Bitcoin valida. + The entered address "%1" is not a valid Bitcoin address. + L'adreça introduïda «%1» no és una adreça de Bitcoin vàlida. Could not unlock wallet. - No s'ha pogut desbloquejar el moneder. + No s'ha pogut desbloquejar el moneder. New key generation failed. - Ha fallat la generació d'una nova clau. + Ha fallat la generació d'una nova clau. FreespaceChecker A new data directory will be created. - + Es crearà un nou directori de dades. name @@ -864,19 +812,15 @@ Address: %4 Path already exists, and is not a directory. - + El camí ja existeix i no és cap directori. Cannot create data directory here. - + No es pot crear el directori de dades aquí. HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core Nucli de Bitcoin @@ -885,72 +829,84 @@ Address: %4 version versió + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + Quant al Bitcoin Core + + + Command-line options + Opcions de línia d'ordres + Usage: Ús: command-line options - Opcions de la línia d'ordres + Opcions de la línia d'ordres UI options Opcions de IU - Set language, for example "de_DE" (default: system locale) - Definir llenguatge, per exemple "de_DE" (per defecte: Preferències locals de sistema) + Set language, for example "de_DE" (default: system locale) + Defineix un idioma, per exemple "de_DE" (per defecte: preferències locals de sistema) Start minimized - Iniciar minimitzat + Inicia minimitzat Set SSL root certificates for payment request (default: -system-) - + Defineix certificats arrel SSL per a la sol·licitud de pagament (per defecte: -sistema-) Show splash screen on startup (default: 1) - Mostrar finestra de benvinguda a l'inici (per defecte: 1) + Mostra la finestra de benvinguda a l'inici (per defecte: 1) Choose data directory on startup (default: 0) - + Tria el directori de dades a l'inici (per defecte: 0) Intro Welcome - Benvingut + Us donem la benviguda Welcome to Bitcoin Core. - Benvingut a Bitcoin Core. + Us donem la benvinguda al Bitcoin Core. As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - + Atès que és la primera vegada que executeu el programa, podeu triar on emmagatzemarà el Bitcoin Core les dades. Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - + El Bitcoin Core descarregarà i emmagatzemarà una còpia de la cadena de blocs de Bitcoin. Com a mínim s'emmagatzemaran %1 GB de dades en aquest directori, que seguiran creixent gradualment. També s'hi emmagatzemarà el moneder. Use the default data directory - + Utilitza el directori de dades per defecte Use a custom data directory: - + Utilitza un directori de dades personalitzat: - Bitcoin - Bitcoin + Bitcoin Core + Nucli de Bitcoin - Error: Specified data directory "%1" can not be created. - + Error: Specified data directory "%1" cannot be created. + Error: el directori de dades «%1» especificat no pot ser creat. Error @@ -958,22 +914,22 @@ Address: %4 GB of free space available - GB d'espai lliure disponible + GB d'espai lliure disponible (of %1GB needed) - (d' %1GB necessari) + (d' %1GB necessari) OpenURIDialog Open URI - + Obre un URI Open payment request from URI or file - + Obre una sol·licitud de pagament des d'un URI o un fitxer URI: @@ -981,11 +937,11 @@ Address: %4 Select payment request file - + Selecciona un fitxer de sol·licitud de pagament Select payment request file to open - + Selecciona el fitxer de sol·licitud de pagament per obrir @@ -1000,23 +956,23 @@ Address: %4 Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - + Comissió opcional de transacció per kB que ajuda a assegurar que les transaccions es processen ràpidament. La majoria de transaccions són d'1 kB. Pay transaction &fee - Pagar &comisió de transacció + Paga &comissió de transacció Automatically start Bitcoin after logging in to the system. - Iniciar automàticament Bitcoin després de l'inici de sessió del sistema. + Inicia automàticament el Bitcoin després de l'inici de sessió del sistema. &Start Bitcoin on system login - &Iniciar Bitcoin al inici de sessió del sistema. + &Inicia el Bitcoin a l'inici de sessió del sistema. Size of &database cache - + Mida de la memòria cau de la base de &dades MB @@ -1024,39 +980,47 @@ Address: %4 Number of script &verification threads - + Nombre de fils de &verificació d'scripts + + + Accept connections from outside + Accepta connexions de fora + + + Allow incoming connections + Permet connexions entrants Connect to the Bitcoin network through a SOCKS proxy. - + Connecta a la xarxa Bitcoin a través d'un proxy SOCKS. &Connect through SOCKS proxy (default proxy): - + &Connecta a través d'un proxy SOCKS (proxy per defecte): IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - + Adreça IP del proxy (p. ex. IPv4: 127.0.0.1 / IPv6: ::1) Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - + URL de terceres parts (p. ex. explorador de blocs) que apareix en la pestanya de transaccions com elements del menú contextual. %s en l'URL es reemplaçat pel resum de la transacció. Diferents URL estan separades per una barra vertical |. Third party transaction URLs - + URL de transaccions de terceres parts Active command-line options that override above options: - + Opcions de línies d'ordre active que sobreescriuen les opcions de dalt: Reset all client options to default. - Reestablir totes les opcions del client. + Reestableix totes les opcions del client. &Reset Options - &Reestablir Opcions + &Reestableix les opcions &Network @@ -1064,31 +1028,31 @@ Address: %4 (0 = auto, <0 = leave that many cores free) - + (0 = auto, <0 = deixa tants nuclis lliures) W&allet - + &Moneder Expert - + Expert Enable coin &control features - + Activa les funcions de &control de les monedes 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. - + Si inhabiliteu la despesa d'un canvi sense confirmar, el canvi d'una transacció no pot ser utilitzat fins que la transacció no tingui com a mínim una confirmació. Això també afecta com es calcula el vostre balanç. &Spend unconfirmed change - + &Gasta el canvi sense confirmar Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - Obrir el port del client de Bitcoin al router de forma automàtica. Això només funciona quan el teu router implementa UPnP i l'opció està activada. + Obre el port del client de Bitcoin al router de forma automàtica. Això només funciona quan el router implementa UPnP i l'opció està activada. Map port using &UPnP @@ -1106,25 +1070,17 @@ Address: %4 Port of the proxy (e.g. 9050) Port del proxy (per exemple 9050) - - SOCKS &Version: - &Versió de SOCKS: - - - SOCKS version of the proxy (e.g. 5) - Versió SOCKS del proxy (per exemple 5) - &Window &Finestra Show only a tray icon after minimizing the window. - Mostrar només l'icona de la barra al minimitzar l'aplicació. + Mostra només la icona de la barra en minimitzar la finestra. &Minimize to the tray instead of the taskbar - &Minimitzar a la barra d'aplicacions + &Minimitza a la barra d'aplicacions en comptes de la barra de tasques Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. @@ -1132,7 +1088,7 @@ Address: %4 M&inimize on close - M&inimitzar al tancar + M&inimitza en tancar &Display @@ -1140,35 +1096,27 @@ Address: %4 User Interface &language: - Llenguatge de la Interfície d'Usuari: + &Llengua de la interfície d'usuari: The user interface language can be set here. This setting will take effect after restarting Bitcoin. - Aquí pots definir el llenguatge de l'aplicatiu. Aquesta configuració tindrà efecte un cop es reiniciï Bitcoin. + Aquí podeu definir la llengua de l'aplicació. Aquesta configuració tindrà efecte una vegada es reiniciï Bitcoin. &Unit to show amounts in: - &Unitats per mostrar les quantitats en: + &Unitats per mostrar els imports en: Choose the default subdivision unit to show in the interface and when sending coins. - Sel·lecciona la unitat de subdivisió per defecte per mostrar en la interficie quan s'envien monedes. - - - Whether to show Bitcoin addresses in the transaction list or not. - Mostrar adreces Bitcoin als llistats de transaccions o no. - - - &Display addresses in transaction list - &Mostrar adreces al llistat de transaccions + Selecciona la unitat de subdivisió per defecte per mostrar en la interfície quan s'envien monedes. Whether to show coin control features or not. - + Si voleu mostrar les funcions de control de monedes o no. &OK - &OK + &D'acord &Cancel @@ -1180,27 +1128,27 @@ Address: %4 none - + cap Confirm options reset - Confirmi el reestabliment de les opcions + Confirmeu el reestabliment de les opcions Client restart required to activate changes. - + Cal reiniciar el client per activar els canvis. Client will be shutdown, do you want to proceed? - + S'aturarà el client, voleu procedir? This change would require a client restart. - + Amb aquest canvi cal un reinici del client. The supplied proxy address is invalid. - L'adreça proxy introduïda és invalida. + L'adreça proxy introduïda és invalida. @@ -1211,31 +1159,35 @@ Address: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - La informació mostrada pot no estar al día. El teu moneder es sincronitza automàticament amb la xarxa Bitcoin un cop s'ha establert connexió, però aquest proces no s'ha completat encara. + La informació mostrada pot no estar al día. El teu moneder es sincronitza automàticament amb la xarxa Bitcoin un cop s'ha establert connexió, però aquest proces no s'ha completat encara. Wallet Moneder + + Watch-only: + Només lectura: + Available: - + Disponible: Your current spendable balance - + El balanç que podeu gastar actualment Pending: - + Pendent: Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - + Total de transaccions que encara han de confirmar-se i que encara no compten en el balanç que es pot gastar Immature: - Immatur: + Immadur: Mined balance that has not yet matured @@ -1247,7 +1199,23 @@ Address: %4 Your current total balance - + El balanç total actual + + + Your current balance in watch-only addresses + El vostre balanç actual en adreces de només lectura + + + Unconfirmed transactions to watch-only addresses + Transaccions sense confirmar a adreces de només lectura + + + Mined balance in watch-only addresses that has not yet matured + Balanç minat en adreces de només lectura que encara no ha madurat + + + Current total balance in watch-only addresses + Balanç total actual en adreces de només lectura <b>Recent transactions</b> @@ -1262,15 +1230,31 @@ Address: %4 PaymentServer URI handling - Manejant URI + Gestió d'URI - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - la URI no pot ser processada! Això es pot ser causat per una adreça Bitcoin invalida o paràmetres URI malformats. + Invalid payment address %1 + Adreça de pagament no vàlida %1 + + + Payment request rejected + La sol·licitud de pagament s'ha rebutjat + + + Payment request network doesn't match client network. + La xarxa de la sol·licitud de pagament no coincideix amb la xarxa del client. + + + Payment request has expired. + La sol·licitud de pagament ha caducat. + + + Payment request is not initialized. + La sol·licitud de pagament no està inicialitzada. Requested payment amount of %1 is too small (considered dust). - + L'import de pagament sol·licitat %1 és massa petit (es considera polsim). Payment request error @@ -1278,31 +1262,27 @@ Address: %4 Cannot start bitcoin: click-to-pay handler - No es pot iniciar bitcoin: manejador clicla-per-pagar - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - + No es pot iniciar bitcoin: gestor clica-per-pagar Payment request fetch URL is invalid: %1 - + L'URL de recuperació de la sol·licitud de pagament no és vàlida: %1 + + + URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + L'URI no pot ser analitzat! Això pot ser a causa d'una adreça de Bitcoin no vàlida o per paràmetres URI amb mal format. Payment request file handling - + Gestió de fitxers de les sol·licituds de pagament - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - + Payment request file cannot be read! This can be caused by an invalid payment request file. + No es pot llegir el fitxer de la sol·licitud de pagament. Això pot ser causat per un fitxer de sol·licitud de pagament no vàlid. Unverified payment requests to custom payment scripts are unsupported. - + No s'accepten sol·licituds de pagament no verificades a scripts de pagament personalitzats. Refund from %1 @@ -1310,65 +1290,100 @@ Address: %4 Error communicating with %1: %2 - + Error en comunicar amb %1: %2 - Payment request can not be parsed or processed! - + Payment request cannot be parsed! + No es pot analitzar la sol·licitud de pagament! Bad response from server %1 - + Mala resposta del servidor %1 Payment acknowledged - Pagament notificat + Pagament reconegut Network request error Error en la sol·licitud de xarxa + + PeerTableModel + + User Agent + Agent d'usuari + + + Address/Hostname + Adreça / nom de l'ordinador + + + Ping Time + Temps de ping + + QObject - Bitcoin - Bitcoin + Amount + Quantitat - Error: Specified data directory "%1" does not exist. - Error: El directori de dades específiques "%1! no existeix. + Enter a Bitcoin address (e.g. %1) + Introduïu una adreça de Bitcoin (p. ex. %1) - Error: Cannot parse configuration file: %1. Only use key=value syntax. - + %1 d + %1 d - Error: Invalid combination of -regtest and -testnet. - + %1 h + %1 h - Bitcoin Core didn't yet exit safely... - + %1 m + %1 m - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Introdueixi una adreça de Bitcoin (per exemple 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + %1 s + %1 s + + + NETWORK + XARXA + + + UNKNOWN + DESCONEGUT + + + None + Cap + + + N/A + N/A + + + %1 ms + %1 ms QRImageWidget &Save Image... - + De&sa la imatge... &Copy Image - + &Copia la imatge Save QR Code - Desar codi QR + Desa el codi QR PNG Image (*.png) @@ -1395,7 +1410,7 @@ Address: %4 Debug window - Depura finestra + Finestra de depuració General @@ -1405,9 +1420,13 @@ Address: %4 Using OpenSSL version Utilitzant OpenSSL versió + + Using BerkeleyDB version + Utilitzant BerkeleyDB versió + Startup time - &Temps d'inici + &Temps d'inici Network @@ -1423,15 +1442,83 @@ Address: %4 Block chain - Bloquejar cadena + Cadena de blocs Current number of blocks Nombre de blocs actuals - Estimated total blocks - Total estimat de blocs + Received + Rebut + + + Sent + Enviat + + + &Peers + &Iguals + + + Select a peer to view detailed information. + Seleccioneu un igual per mostrar informació detallada. + + + Direction + Direcció + + + Version + Versió + + + User Agent + Agent d'usuari + + + Services + Serveis + + + Sync Node + Node de sincronització + + + Starting Height + Alçada inicial + + + Sync Height + Sincronitza l'alçada + + + Ban Score + Puntuació de bandeig + + + Connection Time + Temps de connexió + + + Last Send + Darrer enviament + + + Last Receive + Darrera recepció + + + Bytes Sent + Bytes enviats + + + Bytes Received + Bytes rebuts + + + Ping Time + Temps de ping Last block time @@ -1439,7 +1526,7 @@ Address: %4 &Open - &Obrir + &Obre &Console @@ -1447,11 +1534,11 @@ Address: %4 &Network Traffic - + Trà&nsit de la xarxa &Clear - + Nete&ja Totals @@ -1471,27 +1558,27 @@ Address: %4 Debug log file - Dietàri de debug + Fitxer de registre de depuració Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - Obrir el dietari de debug de Bitcoin del directori de dades actual. Aixó pot trigar uns quants segons per a dietàris grossos. + Obre el fitxer de registre de depuració de Bitcoin del directori de dades actual. Això pot trigar uns quants segons per a fitxers de registre grans. Clear console - Netejar consola + Neteja la consola Welcome to the Bitcoin RPC console. - Benvingut a la consola RPC de Bitcoin + Us donem la benvinguda a la consola RPC de Bitcoin Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - Utilitza les fletxes d'amunt i avall per navegar per l'històric, i <b>Ctrl-L<\b> per netejar la pantalla. + Utilitza les fletxes d'amunt i avall per navegar per l'historial, i <b>Ctrl-L<\b> per netejar la pantalla. Type <b>help</b> for an overview of available commands. - Escriu <b>help<\b> per a obtenir una llistat de les ordres disponibles. + Escriviu <b>help<\b> per a obtenir un llistat de les ordres disponibles. %1 B @@ -1510,23 +1597,43 @@ Address: %4 %1 GB - %1 m - %1 m + via %1 + a través de %1 - %1 h - + never + mai - %1 h %2 m - %1 h %2 m + Inbound + Entrant + + + Outbound + Sortint + + + Yes + + + + No + No + + + Unknown + Desconegut + + + Fetching... + S'està obtenint... ReceiveCoinsDialog &Amount: - &Quantitat: + Im&port: &Label: @@ -1538,27 +1645,27 @@ Address: %4 Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - + Reutilitza una de les adreces de recepció utilitzades anteriorment. La reutilització d'adreces pot comportar problemes de seguretat i privadesa. No ho utilitzeu llevat que torneu a generar una sol·licitud de pagament feta abans. R&euse an existing receiving address (not recommended) - + R&eutilitza una adreça de recepció anterior (no recomanat) An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - + Un missatge opcional que s'adjuntarà a la sol·licitud de pagament, que es mostrarà quan s'obri la sol·licitud. Nota: El missatge no s'enviarà amb el pagament per la xarxa Bitcoin. An optional label to associate with the new receiving address. - + Una etiqueta opcional que s'associarà amb la nova adreça receptora. Use this form to request payments. All fields are <b>optional</b>. - + Utilitzeu aquest formulari per sol·licitar pagaments. Tots els camps són <b>opcionals</b>. An optional amount to request. Leave this empty or zero to not request a specific amount. - + Un import opcional per sol·licitar. Deixeu-ho en blanc o zero per no sol·licitar cap import específic. Clear all fields of the form. @@ -1566,11 +1673,11 @@ Address: %4 Clear - Esborra + Neteja Requested payments history - + Historial de pagaments sol·licitats &Request payment @@ -1578,7 +1685,7 @@ Address: %4 Show the selected request (does the same as double clicking an entry) - + Mostra la sol·licitud seleccionada (fa el mateix que el doble clic a una entrada) Show @@ -1594,38 +1701,38 @@ Address: %4 Copy label - Copiar etiqueta + Copia l'etiqueta Copy message - + Copia el missatge Copy amount - Copiar quantitat + Copia l'import ReceiveRequestDialog QR Code - Codi QR + Codi QR Copy &URI - Copiar &URI + Copia l'&URI Copy &Address - Copiar &Adress + Copia l'&adreça &Save Image... - + De&sa la imatge... Request payment to %1 - + Sol·licita un pagament a %1 Payment information @@ -1641,7 +1748,7 @@ Address: %4 Amount - Quantitat + Import Label @@ -1657,7 +1764,7 @@ Address: %4 Error encoding URI into QR Code. - Error codificant la URI en un codi QR. + Error en codificar l'URI en un codi QR. @@ -1676,7 +1783,7 @@ Address: %4 Amount - Quantitat + Import (no label) @@ -1688,30 +1795,30 @@ Address: %4 (no amount) - + (sense import) SendCoinsDialog Send Coins - Enviar monedes + Envia monedes Coin Control Features - (Opcions del control del Coin) + Característiques de control de les monedes Inputs... - Entrades + Entrades... automatically selected - Seleccionat automàticament + seleccionat automàticament Insufficient funds! - Fons insuficient + Fons insuficients! Quantity: @@ -1723,7 +1830,7 @@ Address: %4 Amount: - Quantitat: + Import: Priority: @@ -1731,11 +1838,7 @@ Address: %4 Fee: - Quota: - - - Low Output: - + Comissió: After Fee: @@ -1747,27 +1850,31 @@ Address: %4 If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - + Si s'activa això, però l'adreça de canvi està buida o bé no és vàlida, el canvi s'enviarà a una adreça generada de nou. Custom change address - + Personalitza l'adreça de canvi Send to multiple recipients at once - Enviar a multiples destinataris al mateix temps + Envia a múltiples destinataris al mateix temps Add &Recipient - Affegir &Destinatari + Afegeix &destinatari Clear all fields of the form. Netejar tots els camps del formulari. + + Dust: + Polsim: + Clear &All - Esborrar &Tot + Neteja-ho &tot Balance: @@ -1775,55 +1882,51 @@ Address: %4 Confirm the send action - Confirmi l'acció d'enviament + Confirma l'acció d'enviament S&end - E&nviar + E&nvia Confirm send coins - Confirmar l'enviament de monedes + Confirma l'enviament de monedes %1 to %2 - + %1 a %2 Copy quantity - + Copia la quantitat Copy amount - Copiar quantitat + Copia l'import Copy fee - + Copia la comissi Copy after fee - + Copia la comissió posterior Copy bytes - + Copia els bytes Copy priority - - - - Copy low output - + Copia la prioritat Copy change - + Copia el canvi Total Amount %1 (= %2) - + Import total %1 (= %2) or @@ -1831,35 +1934,35 @@ Address: %4 The recipient address is not valid, please recheck. - L'adreça remetent no és vàlida, si us plau comprovi-la. + L'adreça de destinatari no és vàlida, si us plau comprovi-la. The amount to pay must be larger than 0. - La quantitat a pagar ha de ser major que 0. + L'import a pagar ha de ser major que 0. The amount exceeds your balance. - Import superi el saldo de la seva compte. + L'import supera el vostre balanç. The total exceeds your balance when the %1 transaction fee is included. - El total excedeix el teu balanç quan s'afegeix la comisió a la transacció %1. + El total excedeix el teu balanç quan s'afegeix la comisió a la transacció %1. Duplicate address found, can only send to each address once per send operation. - S'ha trobat una adreça duplicada, tan sols es pot enviar a cada adreça un cop per ordre de enviament. + S'ha trobat una adreça duplicada, tan sols es pot enviar a cada adreça un cop per ordre de enviament. Transaction creation failed! - + Ha fallat la creació de la transacció! The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - + S'ha rebutjat la transacció! Això pot passar si alguna de les monedes del vostre moneder ja s'han gastat; per exemple, si heu fet servir una còpia de seguretat del fitxer wallet.dat i s'haguessin gastat monedes de la còpia però sense marcar-les-hi com a gastades. Warning: Invalid Bitcoin address - + Avís: adreça Bitcoin no vàlida (no label) @@ -1867,23 +1970,19 @@ Address: %4 Warning: Unknown change address - + Avís: adreça de canvi desconeguda + + + Copy dust + Copia el polsim Are you sure you want to send? - Estàs segur que ho vols enviar? + Esteu segur que ho voleu enviar? added as transaction fee - S'ha afegit una taxa de transacció - - - Payment request expired - La sol·licitud de pagament ha caducat - - - Invalid payment address %1 - + S'ha afegit una taxa de transacció @@ -1894,15 +1993,11 @@ Address: %4 Pay &To: - Pagar &A: - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - La adreça a on envia el pagament (per exemple: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + Paga &a: Enter a label for this address to add it to your address book - Introdueixi una etiquera per a aquesta adreça per afegir-la a la llibreta d'adreces + Introduïu una etiqueta per a aquesta adreça per afegir-la a la llibreta d'adreces &Label: @@ -1914,7 +2009,11 @@ Address: %4 This is a normal payment. - + Això és un pagament normal. + + + The Bitcoin address to send the payment to + L'adreça Bitcoin on enviar el pagament Alt+A @@ -1930,7 +2029,7 @@ Address: %4 Remove this entry - + Elimina aquesta entrada Message: @@ -1938,19 +2037,19 @@ Address: %4 This is a verified payment request. - + Aquesta és una sol·licitud de pagament verificada. Enter a label for this address to add it to the list of used addresses - + Introduïu una etiqueta per a aquesta adreça per afegir-la a la llista d'adreces utilitzades A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - + Un missatge que s'ha adjuntat al bitcoin: URI que s'emmagatzemarà amb la transacció per a la vostra referència. Nota: el missatge no s'enviarà a través de la xarxa Bitcoin. This is an unverified payment request. - + Aquesta és una sol·licitud de pagament no verificada. Pay To: @@ -1958,49 +2057,49 @@ Address: %4 Memo: - + Memo: ShutdownWindow Bitcoin Core is shutting down... - + S'està aturant el Bitcoin Core... Do not shut down the computer until this window disappears. - + No apagueu l'ordinador fins que no desaparegui aquesta finestra. SignVerifyMessageDialog Signatures - Sign / Verify a Message - Signatures .Signar/Verificar un Missatge + Signatures - Signa / verifica un missatge &Sign Message - &Signar Missatge + &Signa el missatge You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - Pots signar missatges amb la teva adreça per provar que són teus. Sigues cautelòs al signar qualsevol cosa, ja que els atacs phising poden intentar confondre't per a que els hi signis amb la teva identitat. Tan sols signa als documents completament detallats amb els que hi estàs d'acord. + Podeu signar missatges amb la vostra adreça per provar que són vostres. Aneu amb compte no signar qualsevol cosa, ja que els atacs de pesca electrònica (phishing) poden provar de confondre-us perquè els signeu amb la vostra identitat. Només signeu als documents completament detallats amb què hi esteu d'acord. - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - La adreça amb la que signat els missatges (per exemple 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address to sign the message with + L'adreça Bitcoin amb què signar el missatge Choose previously used address - Escull adreces fetes servir amb anterioritat + Tria les adreces fetes servir amb anterioritat Alt+A - Alta+A + Alt+A Paste address from clipboard - Enganxar adreça del porta-retalls + Enganxa l'adreça del porta-retalls Alt+P @@ -2008,7 +2107,7 @@ Address: %4 Enter the message you want to sign here - Introdueix aqui el missatge que vols signar + Introduïu aquí el missatge que voleu signar Signature @@ -2016,15 +2115,15 @@ Address: %4 Copy the current signature to the system clipboard - Copiar la signatura actual al porta-retalls del sistema + Copia la signatura actual al porta-retalls del sistema Sign the message to prove you own this Bitcoin address - Signa el missatge per provar que ets propietari d'aquesta adreça Bitcoin + Signa el missatge per provar que ets propietari d'aquesta adreça Bitcoin Sign &Message - Signar &Missatge + Signa el &missatge Reset all sign message fields @@ -2032,19 +2131,19 @@ Address: %4 Clear &All - Esborrar &Tot + Neteja-ho &tot &Verify Message - &Verificar el missatge + &Verifica el missatge Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - Introdueixi l'adreça signant, missatge (assegura't que copies salts de línia, espais, tabuladors, etc excactament tot el text) i la signatura a sota per verificar el missatge. Per evitar ser enganyat per un atac home-entre-mig, vés amb compte de no llegir més en la signatura del que hi ha al missatge signat mateix. + Introdueixi l'adreça signant, missatge (assegura't que copies salts de línia, espais, tabuladors, etc excactament tot el text) i la signatura a sota per verificar el missatge. Per evitar ser enganyat per un atac home-entre-mig, vés amb compte de no llegir més en la signatura del que hi ha al missatge signat mateix. - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - La adreça amb el que el missatge va ser signat (per exemple 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address the message was signed with + L'adreça Bitcoin amb què va ser signat el missatge Verify the message to ensure it was signed with the specified Bitcoin address @@ -2052,31 +2151,27 @@ Address: %4 Verify &Message - Verificar &Missatge + Verifica el &missatge Reset all verify message fields Neteja tots els camps de verificació de missatge - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Introdueixi una adreça de Bitcoin (per exemple 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Clica "Signar Missatge" per a generar una signatura + Click "Sign Message" to generate signature + Feu clic a «Signa el missatge» per a generar una signatura The entered address is invalid. - L'adreça intoduïda és invàlida. + L'adreça introduïda no és vàlida. Please check the address and try again. - Siu us plau, comprovi l'adreça i provi de nou. + Comproveu l'adreça i torneu-ho a provar. The entered address does not refer to a key. - L'adreça introduïda no referencia a cap clau. + L'adreça introduïda no referencia a cap clau. Wallet unlock was cancelled. @@ -2088,7 +2183,7 @@ Address: %4 Message signing failed. - El signat del missatge ha fallat. + La signatura del missatge ha fallat. Message signed. @@ -2096,11 +2191,11 @@ Address: %4 The signature could not be decoded. - La signatura no s'ha pogut decodificar . + La signatura no s'ha pogut descodificar. Please check the signature and try again. - Su us plau, comprovi la signatura i provi de nou. + Comproveu la signatura i torneu-ho a provar. The signature did not match the message digest. @@ -2119,15 +2214,15 @@ Address: %4 SplashScreen Bitcoin Core - Nucli de Bitcoin + Bitcoin Core The Bitcoin Core developers - + Els desenvolupadors del Bitcoin Core [testnet] - + [testnet] @@ -2145,11 +2240,11 @@ Address: %4 conflicted - + en conflicte %1/offline - %1/offline + %1/fora de línia %1/unconfirmed @@ -2157,7 +2252,7 @@ Address: %4 %1 confirmations - %1 confrimacions + %1 confirmacions Status @@ -2191,6 +2286,10 @@ Address: %4 own address Adreça pròpia + + watch-only + només lectura + label etiqueta @@ -2211,13 +2310,21 @@ Address: %4 Debit Dèbit + + Total debit + Dèbit total + + + Total credit + Crèdit total + Transaction fee Comissió de transacció Net amount - Quantitat neta + Import net Message @@ -2236,12 +2343,12 @@ Address: %4 Mercader - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Les monedes generades han de madurar %1 blocs abans de poder ser gastades. Quan genereu aquest bloc, es farà saber a la xarxa per tal d'afegir-lo a la cadena de blocs. Si no pot fer-se lloc a la cadena, el seu estat canviarà a «no acceptat» i no es podrà gastar. Això pot passar ocasionalment si un altre node genera un bloc en un marge de segons respecte al vostre. Debug information - Informació de debug + Informació de depuració Transaction @@ -2299,15 +2406,11 @@ Address: %4 Address - Direcció - - - Amount - Quantitat + Adreça Immature (%1 confirmations, will be available after %2) - + Immadur (%1 confirmacions, serà disponible després de %2) Open for %n more block(s) @@ -2331,19 +2434,19 @@ Address: %4 Offline - + Fora de línia Unconfirmed - + Sense confirmar Confirming (%1 of %2 recommended confirmations) - + Confirmant (%1 de %2 confirmacions recomanades) Conflicted - + En conflicte Received with @@ -2371,7 +2474,7 @@ Address: %4 Transaction status. Hover over this field to show number of confirmations. - Estat de la transacció. Desplaça't per aquí sobre per mostrar el nombre de confirmacions. + Estat de la transacció. Desplaceu-vos sobre aquest camp per mostrar el nombre de confirmacions. Date and time that the transaction was received. @@ -2387,7 +2490,7 @@ Address: %4 Amount removed from or added to balance. - Quantitat extreta o afegida del balanç. + Import extret o afegit del balanç. @@ -2430,7 +2533,7 @@ Address: %4 To yourself - A tu mateix + A un mateix Mined @@ -2442,15 +2545,15 @@ Address: %4 Enter address or label to search - Introdueix una adreça o una etiqueta per cercar + Introduïu una adreça o una etiqueta per cercar Min amount - Quantitat mínima + Import mínim Copy address - Copiar adreça + Copia l'adreça Copy label @@ -2458,7 +2561,7 @@ Address: %4 Copy amount - Copiar quantitat + Copia l'import Copy transaction ID @@ -2474,27 +2577,27 @@ Address: %4 Export Transaction History - + Exporta l'historial de transacció Exporting Failed - + L'exportació ha fallat There was an error trying to save the transaction history to %1. - + S'ha produït un error en provar de desar l'historial de transacció a %1. Exporting Successful - + Exportació amb èxit The transaction history was successfully saved to %1. - + L'historial de transaccions s'ha desat correctament a %1. Comma separated file (*.csv) - Arxiu de separació per comes (*.csv) + Fitxer separat per comes (*.csv) Confirmed @@ -2514,11 +2617,7 @@ Address: %4 Address - Direcció - - - Amount - Quantitat + Adreça ID @@ -2533,33 +2632,40 @@ Address: %4 a + + UnitDisplayStatusBarControl + + Unit to show amounts in. Click to select another unit. + Unitat en què mostrar els imports. Feu clic per seleccionar una altra unitat. + + WalletFrame No wallet has been loaded. - + No s'ha carregat cap moneder. WalletModel Send Coins - Enviar monedes + Envia monedes WalletView &Export - &Exportar + &Exporta Export the data in the current tab to a file - Exportar les dades de la pestanya actual a un arxiu + Exporta les dades de la pestanya actual a un fitxer Backup Wallet - Realitzar còpia de seguretat del moneder + Còpia de seguretat del moneder Wallet Data (*.dat) @@ -2567,66 +2673,54 @@ Address: %4 Backup Failed - Còpia de seguretat faillida + Ha fallat la còpia de seguretat There was an error trying to save the wallet data to %1. - + S'ha produït un error en provar de desar les dades del moneder a %1. The wallet data was successfully saved to %1. - + S'han desat les dades del moneder correctament a %1. Backup Successful - Copia de seguretat realitzada correctament + La còpia de seguretat s'ha realitzat correctament bitcoin-core - - Usage: - Ús: - - - List commands - Llista d'ordres - - - Get help for a command - Obtenir ajuda per a un ordre. - Options: Opcions: Specify configuration file (default: bitcoin.conf) - Especificat arxiu de configuració (per defecte: bitcoin.conf) + Especifica un fitxer de configuració (per defecte: bitcoin.conf) Specify pid file (default: bitcoind.pid) - Especificar arxiu pid (per defecte: bitcoind.pid) + Especifica un fitxer pid (per defecte: bitcoind.pid) Specify data directory - Especificar directori de dades + Especifica el directori de dades Listen for connections on <port> (default: 8333 or testnet: 18333) - Escoltar connexions a <port> (per defecte: 8333 o testnet: 18333) + Escolta connexions a <port> (per defecte: 8333 o testnet: 18333) Maintain at most <n> connections to peers (default: 125) - Mantenir com a molt <n> connexions a peers (per defecte: 125) + Manté com a molt <n> connexions a iguals (per defecte: 125) Connect to a node to retrieve peer addresses, and disconnect - Connectar al node per obtenir les adreces de les connexions, i desconectar + Connecta al node per obtenir les adreces de les connexions, i desconnecta Specify your own public address - Especificar la teva adreça pública + Especifiqueu la vostra adreça pública Threshold for disconnecting misbehaving peers (default: 100) @@ -2636,33 +2730,25 @@ Address: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Nombre de segons abans de reconectar amb connexions errònies (per defecte: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Ha sorgit un error al configurar el port RPC %u escoltant a IPv4: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Escoltar connexions JSON-RPC al port <port> (per defecte: 8332 o testnet:18332) + Escolta connexions JSON-RPC al port <port> (per defecte: 8332 o testnet:18332) Accept command line and JSON-RPC commands - Acceptar línia d'ordres i ordres JSON-RPC - - - Bitcoin Core RPC client version - + Accepta la línia d'ordres i ordres JSON-RPC Run in the background as a daemon and accept commands - Executar en segon pla com a programa dimoni i acceptar ordres + Executa en segon pla com a programa dimoni i accepta ordres Use the test network - Usar la xarxa de prova + Utilitza la xarxa de prova Accept connections from outside (default: 1 if no -proxy or -connect) - Aceptar connexions d'afora (per defecte: 1 si no -proxy o -connect) + Accepta connexions de fora (per defecte: 1 si no -proxy o -connect) %s, you must set a rpcpassword in the configuration file: @@ -2674,73 +2760,70 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - %s has de establir una contrasenya RPC a l'arxiu de configuració:\n%s\nEs recomana que useu la següent constrasenya aleatòria:\nrpcuser=bitcoinrpc\nrpcpassword=%s\n(no necesiteu recordar aquesta contrsenya)\nEl nom d'usuari i contrasenya NO HAN de ser els mateixos.\nSi l'arxiu no existeix, crea'l amb els permisos d'arxiu de només lectura per al propietari.\nTambé es recomana establir la notificació d'alertes i així seràs notificat de les incidències;\nper exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com + %s, heu de establir una contrasenya RPC al fitxer de configuració: %s +Es recomana que useu la següent contrasenya aleatòria: +rpcuser=bitcoinrpc +rpcpassword=%s +(no necesiteu recordar aquesta contrasenya) +El nom d'usuari i la contrasenya NO HAN de ser els mateixos. +Si el fitxer no existeix, crea'l amb els permisos de fitxer de només lectura per al propietari. +També es recomana establir la notificació d'alertes i així sereu notificat de les incidències; +per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com + Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Ha sorgit un error al configurar el port RPC %u escoltant a IPv6, retrocedint a IPv4: %s + Xifrats acceptables (per defecte: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Bind to given address and always listen on it. Use [host]:port notation for IPv6 - Vincular a una adreça específica i sempre escoltar-hi. Utilitza la notació [host]:port per IPv6 + Vincula a una adreça específica i sempre escolta-hi. Utilitza la notació [host]:port per IPv6 Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - + Limita contínuament les transaccions gratuïtes a <n>*1000 bytes per minut (per defecte: 15) - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - + Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup + Elimina totes les transaccions del moneder i només recupera aquelles de la cadena de blocs a través de -rescan a l'inici Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - + Entra en el mode de proves de regressió, que utilitza una cadena especial en què els blocs poden resoldre's al moment. Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - Error: La transacció ha estat rebutjada. Això pot passar si alguna de les monedes del teu moneder ja s'han gastat, com si haguesis usat una copia de l'arxiu wallet.dat i s'haguessin gastat monedes de la copia però sense marcar com gastades en aquest. + Error: La transacció ha estat rebutjada. Això pot passar si alguna de les monedes del teu moneder ja s'han gastat, com si haguesis usat una copia de l'arxiu wallet.dat i s'haguessin gastat monedes de la copia però sense marcar com gastades en aquest. Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - Error: Aquesta transacció requereix una comissió d'almenys %s degut al seu import, complexitat o per l'ús de fons recentment rebuts! + Error: Aquesta transacció requereix una comissió d'almenys %s degut al seu import, complexitat o per l'ús de fons recentment rebuts! Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - Executar una ordre quan una transacció del moneder canviï (%s in cmd es canvia per TxID) - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - + Executa una ordre quan una transacció del moneder canviï (%s en cmd es canvia per TxID) Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - + Buida l'activitat de la base de dades de la memòria disponible al registre del disc cada <n> megabytes (per defecte: 100) How thorough the block verification of -checkblocks is (0-4, default: 3) - + Com d'exhaustiva és la verificació de blocs de -checkblocks is (0-4, per defecte: 3) In this mode -genproclimit controls how many blocks are generated immediately. - + En aquest mode -genproclimit controla quants blocs es generen immediatament. Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - + Defineix el nombre de fils de verificació d'scripts (%u a %d, 0 = auto, <0 = deixa tants nuclis lliures, per defecte: %d) Set the processor limit for when generation is on (-1 = unlimited, default: -1) - + Defineix el límit de processadors quan està activada la generació (-1 = sense límit, per defecte: -1) This is a pre-release test build - use at your own risk - do not use for mining or merchant applications @@ -2748,103 +2831,83 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Unable to bind to %s on this computer. Bitcoin Core is probably already running. - + No es pot enllaçar %s a aquest ordinador. El Bitcoin Core probablement ja estigui executant-s'hi. Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - + Utilitza un proxy SOCKS5 apart per arribar a iguals a través de serveis de Tor ocults (per defecte: -proxy) Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - Advertència: el -paytxfee és molt elevat! Aquesta és la comissió de transacció que pagaràs quan enviis una transacció. - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Advertència: Si us plau comprovi que la data i hora del seu computador siguin correctes! Si el seu rellotge està mal configurat, Bitcoin no funcionará de manera apropiada. + Avís: el -paytxfee és molt elevat! Aquesta és la comissió de transacció que pagareu si envieu una transacció. Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - + Avís: la xarxa no sembla que hi estigui plenament d'acord. Alguns miners sembla que estan experimentant problemes. Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - + Avís: sembla que no estem plenament d'acord amb els nostres iguals! Podria caler que actualitzar l'aplicació, o potser que ho facin altres nodes. Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - Advertència: Error llegint l'arxiu wallet.dat!! Totes les claus es llegeixen correctament, però hi ha dades de transaccions o entrades del llibre d'adreces absents o bé son incorrectes. + Avís: error en llegir el fitxer wallet.dat! Totes les claus es llegeixen correctament, però hi ha dades de transaccions o entrades de la llibreta d'adreces absents o bé son incorrectes. Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - Advertència: L'arxiu wallet.dat és corrupte, dades rescatades! L'arxiu wallet.dat original ha estat desat com wallet.{estampa_temporal}.bak al directori %s; si el teu balanç o transaccions son incorrectes hauries de restaurar-lo de un backup. + Avís: el fitxer wallet.dat és corrupte, dades rescatades! L'arxiu wallet.dat original ha estat desat com wallet.{estampa_temporal}.bak al directori %s; si el teu balanç o transaccions son incorrectes hauries de restaurar-lo de un backup. (default: 1) - + (per defecte: 1) (default: wallet.dat) - + (per defecte: wallet.dat) <category> can be: - + <category> pot ser: Attempt to recover private keys from a corrupt wallet.dat - Intentar recuperar les claus privades d'un arxiu wallet.dat corrupte - - - Bitcoin Core Daemon - + Intenta recuperar les claus privades d'un fitxer wallet.dat corrupte Block creation options: Opcions de la creació de blocs: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) - Connectar només al(s) node(s) especificats - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - + Connecta només al(s) node(s) especificats Connection options: - + Opcions de connexió: Corrupted block database detected - S'ha detectat una base de dades de blocs corrupta + S'ha detectat una base de dades de blocs corrupta Debugging/Testing options: - + Opcions de depuració/proves: Disable safemode, override a real safe mode event (default: 0) - + Inhabilia el mode segur (safemode), invalida un esdeveniment de mode segur real (per defecte: 0) Discover own IP address (default: 1 when listening and no -externalip) - Descobrir la pròpia adreça IP (per defecte: 1 quan escoltant i no -externalip) + Descobreix la pròpia adreça IP (per defecte: 1 quan escoltant i no -externalip) Do not load the wallet and disable wallet RPC calls - + No carreguis el moneder i inhabilita les crides RPC del moneder Do you want to rebuild the block database now? - Vols reconstruir la base de dades de blocs ara? + Voleu reconstruir la base de dades de blocs ara? Error initializing block database @@ -2852,7 +2915,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error initializing wallet database environment %s! - Error inicialitzant l'entorn de la base de dades del moneder %s! + Error inicialitzant l'entorn de la base de dades del moneder %s! Error loading block database @@ -2860,7 +2923,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error opening block database - Error obrint la base de dades de blocs + Error en obrir la base de dades de blocs Error: Disk space is low! @@ -2868,15 +2931,15 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error: Wallet locked, unable to create transaction! - Error: El moneder està blocat, no és possible crear la transacció! + Error: El moneder està bloquejat, no és possible crear la transacció! Error: system error: - Error: error de sistema: + Error: error de sistema: Failed to listen on any port. Use -listen=0 if you want this. - Error al escoltar a qualsevol port. Utilitza -listen=0 si vols això. + Ha fallat escoltar a qualsevol port. Feu servir -listen=0 si voleu fer això. Failed to read block info @@ -2888,11 +2951,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to sync block index - Ha fallat la sincronització de l'índex de bloc + Ha fallat la sincronització de l'índex de blocs Failed to write block index - Ha fallat la escriptura de l'índex de blocs + Ha fallat la escriptura de l'índex de blocs Failed to write block info @@ -2900,91 +2963,71 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write block - Ha fallat l'escriptura del bloc + Ha fallat l'escriptura del bloc Failed to write file info - Ha fallat l'escriptura de l'arxiu info + Ha fallat l'escriptura de la informació de fitxer Failed to write to coin database - Ha fallat l'escriptura de la basse de dades de monedes + Ha fallat l'escriptura de la basse de dades de monedes Failed to write transaction index - Ha fallat l'escriptura de l'índex de transaccions + Ha fallat l'escriptura de l'índex de transaccions Failed to write undo data Ha fallat el desfer de dades - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - Cerca punts de connexió usant rastreig de DNS (per defecte: 1 tret d'usar -connect) - Force safe mode (default: 0) - + Força el mode segur (per defecte: 0) Generate coins (default: 0) - Generar monedes (estàndard: 0) + Genera monedes (per defecte: 0) How many blocks to check at startup (default: 288, 0 = all) - Quants blocs s'han de confirmar a l'inici (per defecte: 288, 0 = tots) + Quants blocs s'han de confirmar a l'inici (per defecte: 288, 0 = tots) If <category> is not supplied, output all debugging information. - + Si no se subministra <category>, mostra tota la informació de depuració. Importing... - + S'està important... Incorrect or no genesis block found. Wrong datadir for network? - + No s'ha trobat el bloc de gènesi o és incorrecte. El directori de dades de la xarxa és incorrecte? - Invalid -onion address: '%s' - + Invalid -onion address: '%s' + Adreça -onion no vàlida: '%s' Not enough file descriptors available. - + No hi ha suficient descriptors de fitxers disponibles. Prepend debug output with timestamp (default: 1) - - - - RPC client options: - + Posa davant de la sortida de depuració una marca horària (per defecte: 1) Rebuild block chain index from current blk000??.dat files - Reconstruir l'índex de la cadena de blocs dels arxius actuals blk000??.dat - - - Select SOCKS version for -proxy (4 or 5, default: 5) - + Reconstrueix l'índex de la cadena de blocs dels fitxers actuals blk000??.dat Set database cache size in megabytes (%d to %d, default: %d) - + Defineix la mida de la memòria cau de la base de dades en megabytes (%d a %d, per defecte: %d) Set maximum block size in bytes (default: %d) - + Defineix la mida màxim del bloc en bytes (per defecte: %d) Set the number of threads to service RPC calls (default: 4) @@ -2992,91 +3035,187 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Specify wallet file (within data directory) - Especifica un arxiu de moneder (dintre del directori de les dades) + Especifica un fitxer de moneder (dins del directori de dades) Spend unconfirmed change when sending transactions (default: 1) - + Gasta el canvi sense confirmar en enviar transaccions (per defecte: 1) + + + Stop running after importing blocks from disk (default: 0) + Atura l'execució després d'importar blocs del disc (per defecte: 0) This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - + Això es així per a eines de proves de regressió per al desenvolupament d'aplicacions. Verifying blocks... - Verificant blocs... + S'estan verificant els blocs... Verifying wallet... - Verificant moneder... - - - Wait for RPC server to start - + S'està verificant el moneder... Wallet %s resides outside data directory %s - + El moneder %s resideix fora del directori de dades %s Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - + Opcions de moneder: You need to rebuild the database using -reindex to change -txindex - + Cal que reconstruïu la base de dades fent servir -reindex per canviar -txindex Imports blocks from external blk000??.dat file Importa blocs de un fitxer blk000??.dat extern + + (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + (per defecte: 1, 1 = mantingues les metadades de les tx, p. ex., el propietari del compte i la informació de sol·licitud de pagament, 2 = descarta les metadades de tx) + + + Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times + Permet les connexions JSON-RPC d'una font específica. Vàlid per a <ip> són una IP individual (p. ex., 1.2.3.4), una xarxa / màscara de xarxa (p. ex., 1.2.3.4/255.255.255.0) o una xarxa/CIDR (p. ex., 1.2.3.4/24). Es pot especificar aquesta opció moltes vegades + + + Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6 + Vincula l'adreça donada i posa a la llista blanca els iguals que s'hi connectin. Feu servir la notació [host]:port per a IPv6 + + + Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces) + Vincula a l'adreça donada per a escoltar les connexions JSON-RPC. Feu servir la notació [host]:port per a IPv6. Aquesta opció pot ser especificada moltes vegades (per defecte: vincula a totes les interfícies) + Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - + No es pot obtenir un bloqueig del directori de dades %s. El Bitcoin Core probablement ja s'estigui executant. + + + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) + Crea fitxers nous amb els permisos per defecte del sistema, en comptes de l'umask 077 (només efectiu amb la funcionalitat de moneder inhabilitada) + + + Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + Distribuït sota la llicència de programari MIT/X11. Vegeu el fitxer acompanyant COPYING o <http://www.opensource.org/licenses/mit-license.php>. + + + Error: Listening for incoming connections failed (listen returned error %s) + Error: ha fallat escoltar les connexions entrants (l'escoltament ha retornat l'error %s) + + + Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + Error: s'ha trobat un argument no permès de -socks. Ja no es pot definir més la versió de SOCKS, només s'accepten els proxies de SOCKS5.ç + + + Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) + Executa l'ordre quan una tx de xarxa gasta de nou una tx d'entrada del moneder (%s=torna a gastar TxID, %t=TxID del moneder) Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - + Executa l'ordre quan es rebi un avís rellevant o veiem una forquilla molt llarga (%s en cmd és reemplaçat per un missatge) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) + Comissions (en BTC/Kb) inferiors a això es consideren de comissió zero per a la transmissió (per defecte: %s) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) + Comissions (en BTC/Kb) inferiors a això es consideren de comissió zero per a la creació de la transacció (per defecte: %s) + + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) + Si no s'ha definit paytxfee, inclou comissió suficient per tal que les transaccions siguin confirmades dins d'una mitja de n blocs (per defecte: 1) Output debugging information (default: 0, supplying <category> is optional) - + Informació de la depuració de sortida (per defecte: 0, proporcionar <category> és opcional) + + + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) + Consulta a adreces d'iguals a través de DNS, si es troba baix en adreces (per defecte: 1 a menys que -connect) Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - + Defineix la mida màxima de transaccions d'alta prioritat / baixa comissió en bytes (per defecte: %d) + + + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. + Aquest producte inclou programari desenvolupat pel projecte OpenSSL per a ús a l'OpenSSL Toolkit <https://www.openssl.org/> i programari criptogràfic escrit per Eric Young i programari UPnP escrit per Thomas Bernard. + + + Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + Avís: comproveu que la data i hora del vostre ordinador siguin correctes! Si el vostre rellotge no és correcte, el Bitcoin Core no funcionarà correctament. + + + Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. + Posa en la llista blanca els iguals que es connectin de la màscara de xarxa o ip donada. Es pot especificar moltes vegades. + + + Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway + Els iguals en la llista blanca no poden ser bandejats per DoS i es transmetran sempre llurs transaccions, fins i tot si ja són a la mempool. Això és útil, p. ex., per a una passarel·la + + + Always query for peer addresses via DNS lookup (default: 0) + Consulta sempre adreces d'iguals a través de consultes DNS (per defecte: 0) + + + Cannot resolve -whitebind address: '%s' + No es pot resoldre l'adreça -whitebind: «%s» + + + Connect through SOCKS5 proxy + Connecta a través del proxy SOCKS5 + + + Copyright (C) 2009-%i The Bitcoin Core Developers + Copyright (C) 2009-%i Els desenvolupadors del Bitcoin Core + + + Could not parse -rpcbind value %s as network address + No s'ha pogut analitzar el valor -rpcbind %s com una adreça de xarxa + + + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core + Error en carregar wallet.dat: el moneder requereix una versió més nova del Bitcoin core + + + Error: Unsupported argument -tor found, use -onion. + Error: s'ha trobat un argument -tor no acceptat. Feu servir -onion. + + + Fee (in BTC/kB) to add to transactions you send (default: %s) + Comissió en (BTC/kB) per afegir a les transaccions que envieu (per defecte: %s) + + + Include IP addresses in debug output (default: 0) + Inclou adreces IP en la sortida de depuració (per defecte: 0) Information &Informació - Invalid amount for -minrelaytxfee=<amount>: '%s' - + Invalid amount for -minrelaytxfee=<amount>: '%s' + Import no vàlid per a -minrelaytxfee=<amount>: «%s» - Invalid amount for -mintxfee=<amount>: '%s' - + Invalid amount for -mintxfee=<amount>: '%s' + Import no vàlid per a -mintxfee=<amount>: «%s» Limit size of signature cache to <n> entries (default: 50000) - + Mida límit de la memòria cau de signatura per a <n> entrades (per defecte: 50000) Log transaction priority and fee per kB when mining blocks (default: 0) - + Registra la prioritat de transacció i comissió per kB en minar blocs (per defecte: 0) Maintain a full transaction index (default: 0) - Mantenir tot l'índex de transaccions (per defecte: 0) + Manté l'índex sencer de transaccions (per defecte: 0) Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) @@ -3084,115 +3223,103 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Mida màxima del buffer d'enviament per a cada connexió, <n>*1000 bytes (default: 5000) + Mida màxima del buffer d'enviament per a cada connexió, <n>*1000 bytes (default: 5000) Only accept block chain matching built-in checkpoints (default: 1) - Tan sols acceptar cadenes de blocs que coincideixin amb els punts de prova (per defecte: 1) + Només accepta cadenes de blocs que coincideixin amb els punts de prova (per defecte: 1) Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Només connectar als nodes de la xarxa <net> (IPv4, IPv6 o Tor) + Només connecta als nodes de la xarxa <net> (IPv4, IPv6 o Tor) Print block on startup, if found in block index - + Imprimeix el block a l'inici, si es troba l'índex de blocs Print block tree on startup (default: 0) - + Imprimeix l'arbre de blocs a l'inici (per defecte: 0) RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - + Opcions RPC SSL: (veieu el wiki del Bitcoin per a instruccions de configuració de l'SSL) RPC server options: - + Opcions del servidor RPC: Randomly drop 1 of every <n> network messages - + Descarta a l'atzar 1 de cada <n> missatges de la xarxa Randomly fuzz 1 of every <n> network messages - + Introdueix incertesa en 1 de cada <n> missatges de la xarxa Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - Opcions SSL: (veure la Wiki de Bitcoin per a instruccions de configuració SSL) - - - Send command to Bitcoin Core - + Executa un fil per buidar el moneder periòdicament (per defecte: 1) Send trace/debug info to console instead of debug.log file - Enviar informació de traça/debug a la consola en comptes del arxiu debug.log + Envia informació de traça/depuració a la consola en comptes del fitxer debug.log Set minimum block size in bytes (default: 0) - Establir una mida mínima de bloc en bytes (per defecte: 0) + Defineix una mida mínima de bloc en bytes (per defecte: 0) Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - + Defineix el senyal DB_PRIVATE en l'entorn db del moneder (per defecte: 1) Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - + Mostra totes les opcions de depuració (ús: --help --help-debug) Shrink debug.log file on client startup (default: 1 when no -debug) - Reduir l'arxiu debug.log al iniciar el client (per defecte 1 quan no -debug) + Redueix el fitxer debug.log durant l'inici del client (per defecte: 1 quan no -debug) Signing transaction failed - + Ha fallat la signatura de la transacció Specify connection timeout in milliseconds (default: 5000) - Especificar el temps limit per a un intent de connexió en milisegons (per defecte: 5000) - - - Start Bitcoin Core Daemon - + Especifica el temps limit per a un intent de connexió en mil·lisegons (per defecte: 5000) System error: - Error de sistema: + Error de sistema: Transaction amount too small - + Import de la transacció massa petit Transaction amounts must be positive - + Els imports de les transaccions han de ser positius Transaction too large - + La transacció és massa gran Use UPnP to map the listening port (default: 0) - Utilitza UPnP per a mapejar els ports d'escolta (per defecte: 0) + Utilitza UPnP per a mapejar els ports d'escolta (per defecte: 0) Use UPnP to map the listening port (default: 1 when listening) - Utilitza UPnP per a mapejar els ports d'escolta (per defecte: 1 quan s'escolta) + Utilitza UPnP per a mapejar els ports d'escolta (per defecte: 1 quan s'escolta) Username for JSON-RPC connections - Nom d'usuari per a connexions JSON-RPC + Nom d'usuari per a connexions JSON-RPC + + + Wallet needed to be rewritten: restart Bitcoin Core to complete + Cal reescriure el moneder: reiniceu el Bitcoin Core per completar-ho. Warning @@ -3200,59 +3327,55 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: This version is obsolete, upgrade required! - Advertència: Aquetsa versió està obsoleta, és necessari actualitzar! + Avís: aquesta versió està obsoleta. És necessari actualitzar-la! + + + Warning: Unsupported argument -benchmark ignored, use -debug=bench. + Avís: s'ha ignorat l'argument no acceptat de -benchmark. Feu servir -debug=bench. + + + Warning: Unsupported argument -debugnet ignored, use -debug=net. + Avís: s'ha ignorat l'argument no acceptat de -debugnet. Feu servir -debug=net. Zapping all transactions from wallet... - + Se suprimeixen totes les transaccions del moneder... on startup - - - - version - versió + a l'inici de l'aplicació wallet.dat corrupt, salvage failed - L'arxiu wallet.data és corrupte, el rescat de les dades ha fallat + El fitxer wallet.data és corrupte. El rescat de les dades ha fallat Password for JSON-RPC connections Contrasenya per a connexions JSON-RPC - - Allow JSON-RPC connections from specified IP address - Permetre connexions JSON-RPC d'adreces IP específiques - - - Send commands to node running on <ip> (default: 127.0.0.1) - Enviar ordre al node en execució a <ip> (per defecte: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) - Executar orde quan el millor bloc canviï (%s al cmd es reemplaça per un bloc de hash) + Executa l'ordre quan el millor bloc canviï (%s en cmd es reemplaça per un resum de bloc) Upgrade wallet to latest format - Actualitzar moneder a l'últim format + Actualitza el moneder a l'últim format Set key pool size to <n> (default: 100) - Establir límit de nombre de claus a <n> (per defecte: 100) + Defineix el límit de nombre de claus a <n> (per defecte: 100) Rescan the block chain for missing wallet transactions - Re-escanejar cadena de blocs en cerca de transaccions de moneder perdudes + Reescaneja la cadena de blocs en les transaccions de moneder perdudes Use OpenSSL (https) for JSON-RPC connections - Utilitzar OpenSSL (https) per a connexions JSON-RPC + Utilitza OpenSSL (https) per a connexions JSON-RPC Server certificate file (default: server.cert) - Arxiu del certificat de servidor (per defecte: server.cert) + Fitxer del certificat de servidor (per defecte: server.cert) Server private key (default: server.pem) @@ -3260,63 +3383,47 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message - Aquest misatge d'ajuda - - - Unable to bind to %s on this computer (bind returned error %d, %s) - Impossible d'unir %s a aquest ordinador (s'ha retornat l'error %d, %s) + Aquest misatge d'ajuda Allow DNS lookups for -addnode, -seednode and -connect - Permetre consultes DNS per a -addnode, -seednode i -connect + Permet consultes DNS per a -addnode, -seednode i -connect Loading addresses... - Carregant adreces... + S'estan carregant les adreces... Error loading wallet.dat: Wallet corrupted - Error carregant wallet.dat: Moneder corrupte - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Error carregant wallet.dat: El moneder requereix una versió de Bitcoin més moderna - - - Wallet needed to be rewritten: restart Bitcoin to complete - El moneder necesita ser re-escrit: re-inicia Bitcoin per a completar la tasca + Error en carregar wallet.dat: Moneder corrupte Error loading wallet.dat - Error carregant wallet.dat + Error en carregar wallet.dat - Invalid -proxy address: '%s' - Adreça -proxy invalida: '%s' + Invalid -proxy address: '%s' + Adreça -proxy invalida: '%s' - Unknown network specified in -onlynet: '%s' - Xarxa desconeguda especificada a -onlynet: '%s' + Unknown network specified in -onlynet: '%s' + Xarxa desconeguda especificada a -onlynet: '%s' - Unknown -socks proxy version requested: %i - S'ha demanat una versió desconeguda de -socks proxy: %i + Cannot resolve -bind address: '%s' + No es pot resoldre l'adreça -bind: '%s' - Cannot resolve -bind address: '%s' - No es pot resoldre l'adreça -bind: '%s' + Cannot resolve -externalip address: '%s' + No es pot resoldre l'adreça -externalip: '%s' - Cannot resolve -externalip address: '%s' - No es pot resoldre l'adreça -externalip: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Quantitat invalida per a -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Import no vàlid per a -paytxfee=<amount>: «%s» Invalid amount - Quanitat invalida + Import no vàlid Insufficient funds @@ -3324,15 +3431,15 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Loading block index... - Carregant índex de blocs... + S'està carregant l'índex de blocs... Add a node to connect to and attempt to keep the connection open - Afegir un node per a connectar's-hi i intentar mantenir la connexió oberta + Afegeix un node per a connectar-s'hi i intenta mantenir-hi la connexió oberta Loading wallet... - Carregant moneder... + S'està carregant el moneder... Cannot downgrade wallet @@ -3340,29 +3447,23 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Cannot write default address - No es pot escriure l'adreça per defecte + No es pot escriure l'adreça per defecte Rescanning... - Re-escanejant... + S'està reescanejant... Done loading - Càrrega acabada + Ha acabat la càrrega To use the %s option - Utilitza la opció %s + Utilitza l'opció %s Error Error - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Has de configurar el rpcpassword=<password> a l'arxiu de configuració:\n %s\n Si l'arxiu no existeix, crea'l amb els permís owner-readable-only. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_cmn.ts b/src/qt/locale/bitcoin_cmn.ts index 696cbedd0a..3286f12698 100644 --- a/src/qt/locale/bitcoin_cmn.ts +++ b/src/qt/locale/bitcoin_cmn.ts @@ -1,3368 +1,110 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage - - Double-click to edit address or label - - - - Create a new address - - - - &New - - - - Copy the currently selected address to the system clipboard - - - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - - - &Delete - - - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - - - Comma separated file (*.csv) - - - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel - - Label - - - - Address - - - - (no label) - - - + AskPassphraseDialog - - Passphrase Dialog - - - - Enter passphrase - - - - New passphrase - - - - Repeat new passphrase - - - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - - - - Encrypt wallet - - - - This operation needs your wallet passphrase to unlock the wallet. - - - - Unlock wallet - - - - This operation needs your wallet passphrase to decrypt the wallet. - - - - Decrypt wallet - - - - Change passphrase - - - - Enter the old and new passphrase to the wallet. - - - - Confirm wallet encryption - - - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - - - Wallet encrypted - - - - Bitcoin 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. - - - - Wallet encryption failed - - - - Wallet encryption failed due to an internal error. Your wallet was not encrypted. - - - - The supplied passphrases do not match. - - - - Wallet unlock failed - - - - The passphrase entered for the wallet decryption was incorrect. - - - - Wallet decryption failed - - - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - - - Synchronizing with network... - - - - &Overview - - - - Node - - - - Show general overview of wallet - - - - &Transactions - - - - Browse transaction history - - - - E&xit - - - - Quit application - - - - Show information about Bitcoin - - - - About &Qt - - - - Show information about Qt - - - - &Options... - - - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - - - Change the passphrase used for wallet encryption - - - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - - - &File - - - - &Settings - - - - &Help - - - - Tabs toolbar - - - - [testnet] - - - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - - - %n active connection(s) to Bitcoin network - - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - - - Error - - - - Warning - - - - Information - - - - Up to date - - - - Catching up... - - - - Sent transaction - - - - Incoming transaction - - - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> - - - - Wallet is <b>encrypted</b> and currently <b>locked</b> - - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - - + ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - - - Amount - - - - Address - - - - Date - - - - Confirmations - - - - Confirmed - - - - Priority - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - - - (no label) - - - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog - - Edit Address - - - - &Label - - - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - - - &Address - - - - New receiving address - - - - New sending address - - - - Edit receiving address - - - - Edit sending address - - - - The entered address "%1" is already in the address book. - - - - The entered address "%1" is not a valid Bitcoin address. - - - - Could not unlock wallet. - - - - New key generation failed. - - - + FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - - - version - - - - Usage: - - - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - - - Error - - - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog - - Options - - - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage - - Form - - - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - - - <b>Recent transactions</b> - - - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - - Bitcoin - - - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - - - &Label: - - - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - - - Copy label - - - - Copy message - - - - Copy amount - - - + ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - - - Address - - - - Amount - - - - Label - - - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel - - Date - - - - Label - - - - Message - - - - Amount - - - - (no label) - - - - (no message) - - - - (no amount) - - - + SendCoinsDialog - - Send Coins - - - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - - - Send to multiple recipients at once - - - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - - - Balance: - - - - Confirm the send action - - - - S&end - - - - Confirm send coins - - - - %1 to %2 - - - - Copy quantity - - - - Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - - - The amount to pay must be larger than 0. - - - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - - - (no label) - - - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry - - A&mount: - - - - Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Enter a label for this address to add it to your address book - - - - &Label: - - - - Choose previously used address - - - - This is a normal payment. - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - - - [testnet] - - - + TrafficGraphWidget - - KB/s - - - + TransactionDesc - - Open until %1 - - - - conflicted - - - - %1/offline - - - - %1/unconfirmed - - - - %1 confirmations - - - - Status - - - - , broadcast through %n node(s) - - - - Date - - - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - - - Amount - - - - true - - - - false - - - - , has not been successfully broadcast yet - - - - Open for %n more block(s) - - - - unknown - - - + TransactionDescDialog - - Transaction details - - - - This pane shows a detailed description of the transaction - - - + TransactionTableModel - - Date - - - - Type - - - - Address - - - - Amount - - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - - - Open until %1 - - - - Confirmed (%1 confirmations) - - - - This block was not received by any other nodes and will probably not be accepted! - - - - Generated but not accepted - - - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - - - Received with - - - - Received from - - - - Sent to - - - - Payment to yourself - - - - Mined - - - - (n/a) - - - - Transaction status. Hover over this field to show number of confirmations. - - - - Date and time that the transaction was received. - - - - Type of transaction. - - - - Destination address of transaction. - - - - Amount removed from or added to balance. - - - + TransactionView - - All - - - - Today - - - - This week - - - - This month - - - - Last month - - - - This year - - - - Range... - - - - Received with - - - - Sent to - - - - To yourself - - - - Mined - - - - Other - - - - Enter address or label to search - - - - Min amount - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - - - Comma separated file (*.csv) - - - - Confirmed - - - - Date - - - - Type - - - - Label - - - - Address - - - - Amount - - - - ID - - - - Range: - - - - to - - - + + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel - - Send Coins - - - + WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - - - Options: - - - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - - - Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - - - Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - - - Done loading - - - - To use the %s option - - - - Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - - + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_cs.ts b/src/qt/locale/bitcoin_cs.ts index 6cc783b59e..2aa017fdf8 100644 --- a/src/qt/locale/bitcoin_cs.ts +++ b/src/qt/locale/bitcoin_cs.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - O Bitcoin Core - - - <b>Bitcoin Core</b> version - <b>Bitcoin Core</b> verze - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Tohle je experimentální program. - -Šířen pod licencí MIT/X11, viz přiložený soubor COPYING nebo http://www.opensource.org/licenses/mit-license.php. - -Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití v OpenSSL Toolkitu (http://www.openssl.org/) a kryptografický program od Erika Younga (eay@cryptsoft.com) a program UPnP od Thomase Bernarda. - - - Copyright - Copyright - - - The Bitcoin Core developers - Vývojáři Bitcoin Core - - - (%1-bit) - (%1-bit) - - + AddressBookPage @@ -131,8 +94,8 @@ Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití v Open Exportování selhalo - There was an error trying to save the address list to %1. - Při ukládání seznamu adres do %1 se přihodila nějaká chyba. + There was an error trying to save the address list to %1. Please try again. + Při ukládání seznamu adres do %1 se přihodila nějaká chyba. Zkus to prosím znovu. @@ -168,10 +131,6 @@ Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití v Open Repeat new passphrase Totéž heslo ještě jednou - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Zadej nové heslo k peněžence.<br/>Použij <b>alespoň 10 náhodných znaků</b> nebo <b>alespoň osm slov</b>. - Encrypt wallet Zašifruj peněženku @@ -224,6 +183,10 @@ Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití v Open Wallet encrypted Peněženka je zašifrována + + 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>. + Zadej nové heslo k peněžence.<br/>Použij <b>alespoň deset náhodných znaků</b> nebo <b>alespoň osm slov</b>. + Bitcoin 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. Bitcoin se teď ukončí, aby dokončil zašifrování. Pamatuj však, že pouhé zašifrování peněženky úplně nezabraňuje krádeži tvých bitcoinů malwarem, kterým se může počítač nakazit. @@ -242,7 +205,7 @@ Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití v Open Wallet unlock failed - Odemčení peněženky selhalo + Nepodařilo se odemknout peněženku The passphrase entered for the wallet decryption was incorrect. @@ -250,7 +213,7 @@ Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití v Open Wallet decryption failed - Dešifrování peněženky selhalo + Nepodařilo se dešifrovat peněženku Wallet passphrase was successfully changed. @@ -295,10 +258,6 @@ Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití v Open Quit application Ukonči aplikaci - - Show information about Bitcoin - Zobraz informace o Bitcoinu - About &Qt O &Qt @@ -335,6 +294,10 @@ Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití v Open Open &URI... Načíst &URI... + + Bitcoin Core client + Bitcoin Core klient + Importing blocks from disk... Importuji bloky z disku... @@ -387,6 +350,10 @@ Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití v Open &Receive Při&jmi + + Show information about Bitcoin Core + Zobraz informace o Bitcoin Core + &Show / Hide &Zobraz/Skryj @@ -459,10 +426,6 @@ Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití v Open Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options Seznam argumentů Bitcoinu pro příkazovou řádku získáš v nápovědě Bitcoinu Core - - Bitcoin client - Bitcoin klient - %n active connection(s) to Bitcoin network %n aktivní spojení do Bitcoinové sítě%n aktivní spojení do Bitcoinové sítě%n aktivních spojení do Bitcoinové sítě @@ -471,34 +434,14 @@ Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití v Open No block source available... Není dostupný žádný zdroj bloků... - - Processed %1 of %2 (estimated) blocks of transaction history. - Zpracováno %1 z přibližně %2 bloků transakční historie. - Processed %1 blocks of transaction history. Zpracováno %1 bloků transakční historie. - - %n hour(s) - hodinu%n hodiny%n hodin - - - %n day(s) - den%n dny%n dnů - - - %n week(s) - týden%n týdny%n týdnů - %1 and %2 %1 a %2 - - %n year(s) - rok%n roky%n roků - %1 behind Stahuji ještě bloky transakcí za poslední %1 @@ -559,10 +502,6 @@ Adresa: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Peněženka je <b>zašifrovaná</b> a momentálně <b>zamčená</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Stala se fatální chyba. Bitcoin nemůže bezpečně pokračovat v činnosti, a proto skončí. - ClientModel @@ -575,7 +514,7 @@ Adresa: %4 CoinControlDialog Coin Control Address Selection - + Volba adres v rámci ruční správy mincí Quantity: @@ -598,8 +537,8 @@ Adresa: %4 Poplatek: - Low Output: - Malý výstup: + Dust: + Prach: After Fee: @@ -690,8 +629,8 @@ Adresa: %4 Kopíruj prioritu - Copy low output - Kopíruj malý výstup + Copy dust + Kopíruj prach Copy change @@ -742,8 +681,8 @@ Adresa: %4 žádná - Dust - + Can vary +/- %1 satoshi(s) per input. + Může se lišit o +/– %1 satoshi na každý vstup. yes @@ -755,7 +694,7 @@ Adresa: %4 This label turns red, if the transaction size is greater than 1000 bytes. - + Popisek zčervená, pokud je velikost transakce větší než 1000 bajtů. This means a fee of at least %1 per kB is required. @@ -767,27 +706,15 @@ Adresa: %4 Transactions with higher priority are more likely to get included into a block. - + Transakce s vyšší prioritou mají větší šanci na zařazení do bloku. - This label turns red, if the priority is smaller than "medium". - + This label turns red, if the priority is smaller than "medium". + Popisek zčervená, pokud je priorita menší než „střední“. This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - + Popisek zčervená, pokud má některý příjemce obdržet částku menší než %1. (no label) @@ -795,7 +722,7 @@ Adresa: %4 change from %1 (%2) - + drobné z %1 (%2) (change) @@ -841,12 +768,12 @@ Adresa: %4 Uprav odesílací adresu - The entered address "%1" is already in the address book. - Zadaná adresa "%1" už v adresáři je. + The entered address "%1" is already in the address book. + Zadaná adresa "%1" už v adresáři je. - The entered address "%1" is not a valid Bitcoin address. - Zadaná adresa "%1" není platná Bitcoinová adresa. + The entered address "%1" is not a valid Bitcoin address. + Zadaná adresa "%1" není platná Bitcoinová adresa. Could not unlock wallet. @@ -882,10 +809,6 @@ Adresa: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core Bitcoin Core @@ -894,6 +817,18 @@ Adresa: %4 version verze + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + O Bitcoin Core + + + Command-line options + Argumenty z příkazové řádky + Usage: Užití: @@ -907,8 +842,8 @@ Adresa: %4 Možnosti UI - Set language, for example "de_DE" (default: system locale) - Nastavit jazyk, například "de_DE" (výchozí: systémové nastavení) + Set language, for example "de_DE" (default: system locale) + Nastavit jazyk, například "de_DE" (výchozí: systémové nastavení) Start minimized @@ -916,7 +851,7 @@ Adresa: %4 Set SSL root certificates for payment request (default: -system-) - + Nastavit kořenové SSL certifikáty pro platební požadavky (výchozí: -system-) Show splash screen on startup (default: 1) @@ -954,11 +889,11 @@ Adresa: %4 Použij tento adresář pro data: - Bitcoin - Bitcoin + Bitcoin Core + Bitcoin Core - Error: Specified data directory "%1" can not be created. + Error: Specified data directory "%1" cannot be created. Chyba: Nejde vytvořit požadovaný adresář pro data „%1“. @@ -1035,6 +970,14 @@ Adresa: %4 Number of script &verification threads Počet vláken pro &verifikaci skriptů + + Accept connections from outside + Přijímat spojení zvenčí + + + Allow incoming connections + Přijímat příchozí spojení + Connect to the Bitcoin network through a SOCKS proxy. Připojí se do Bitcoinové sítě přes SOCKS proxy. @@ -1049,15 +992,15 @@ Adresa: %4 Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - + URL třetích stran (např. block exploreru), které se zobrazí v kontextovém menu v záložce Transakce. %s v URL se nahradí hashem transakce. Více URL odděl svislítkem |. Third party transaction URLs - + URL transakcí třetích stran Active command-line options that override above options: - + Aktivní argumenty z příkazové řádky, které přetloukly tato nastavení: Reset all client options to default. @@ -1085,15 +1028,15 @@ Adresa: %4 Enable coin &control features - + Povolit ruční správu &mincí 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. - + Pokud zakážeš utrácení ještě nepotvrzených drobných, nepůjde použít drobné z transakce, dokud nebude mít alespoň jedno potvrzení. Ovlivní to také výpočet stavu účtu. &Spend unconfirmed change - + &Utrácet i ještě nepotvrzené drobné Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. @@ -1115,14 +1058,6 @@ Adresa: %4 Port of the proxy (e.g. 9050) Port proxy (např. 9050) - - SOCKS &Version: - &Verze SOCKS: - - - SOCKS version of the proxy (e.g. 5) - Verze SOCKS proxy (např. 5) - &Window O&kno @@ -1157,23 +1092,15 @@ Adresa: %4 &Unit to show amounts in: - J&ednotka pro částky: + J&ednotka pro částky: Choose the default subdivision unit to show in the interface and when sending coins. Zvol výchozí podjednotku, která se bude zobrazovat v programu a při posílání mincí. - - Whether to show Bitcoin addresses in the transaction list or not. - Zda ukazovat bitcoinové adresy ve výpisu transakcí nebo ne. - - - &Display addresses in transaction list - Ukazo&vat adresy ve výpisu transakcí - Whether to show coin control features or not. - + Zda ukazovat možnosti pro ruční správu mincí nebo ne. &OK @@ -1189,7 +1116,7 @@ Adresa: %4 none - žádná + žádné Confirm options reset @@ -1226,6 +1153,10 @@ Adresa: %4 Wallet Peněženka + + Watch-only: + Sledované: + Available: K dispozici: @@ -1240,7 +1171,7 @@ Adresa: %4 Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - Celkem z transakcí, které ještě nejsou potvrzené a které se ještě nezapočítávají do celkového disponibilního stavu účtu + Souhrn transakcí, které ještě nejsou potvrzené a které se ještě nezapočítávají do celkového disponibilního stavu účtu Immature: @@ -1258,6 +1189,22 @@ Adresa: %4 Your current total balance Celkový stav tvého účtu + + Your current balance in watch-only addresses + Aktuální stav účtu sledovaných adres + + + Unconfirmed transactions to watch-only addresses + Nepotvrzené transakce sledovaných adres + + + Mined balance in watch-only addresses that has not yet matured + Vytěžené mince na sledovaných adresách, které ještě nejsou zralé + + + Current total balance in watch-only addresses + Aktuální stav účtu sledovaných adres + <b>Recent transactions</b> <b>Poslední transakce</b> @@ -1274,8 +1221,24 @@ Adresa: %4 Zpracování URI - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - Nepodařilo se analyzovat URI! Důvodem může být neplatná Bitcoinová adresa nebo poškozené parametry URI. + Invalid payment address %1 + Neplatná platební adresa %1 + + + Payment request rejected + Platební požadavek byl odmítnut + + + Payment request network doesn't match client network. + Síť platebního požadavku neodpovídá síti klienta. + + + Payment request has expired. + Platební požadavek vypršel. + + + Payment request is not initialized. + Platební požadavek není zahájený. Requested payment amount of %1 is too small (considered dust). @@ -1289,24 +1252,20 @@ Adresa: %4 Cannot start bitcoin: click-to-pay handler Nemůžu spustit bitcoin: obsluha click-to-pay - - Net manager warning - Upozornění správce sítě - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - Tvá aktivní proxy nepodporuje SOCKS5, které je vyžadováno pro platební požadavky skrz proxy. - Payment request fetch URL is invalid: %1 Zdrojová URL platebního požadavku není platná: %1 + + URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + Nepodařilo se analyzovat URI! Důvodem může být neplatná Bitcoinová adresa nebo poškozené parametry URI. + Payment request file handling Zpracování souboru platebního požadavku - Payment request file can not be read or processed! This can be caused by an invalid payment request file. + Payment request file cannot be read! This can be caused by an invalid payment request file. Soubor platebního požadavku nejde přečíst nebo zpracovat! Příčinou může být špatný soubor platebního požadavku. @@ -1322,8 +1281,8 @@ Adresa: %4 Chyba při komunikaci s %1: %2 - Payment request can not be parsed or processed! - Platebního požadavku nejde přečíst nebo zpracovat! + Payment request cannot be parsed! + Platební požadavek je nečitelný! Bad response from server %1 @@ -1338,31 +1297,66 @@ Adresa: %4 Chyba síťového požadavku + + PeerTableModel + + User Agent + Typ klienta + + + Address/Hostname + Adresa/Název hostitele + + + Ping Time + Odezva + + QObject - Bitcoin - Bitcoin + Amount + Částka - Error: Specified data directory "%1" does not exist. - Chyba: Zadaný adresář pro data „%1“ neexistuje. + Enter a Bitcoin address (e.g. %1) + Zadej Bitcoinovou adresu (např. %1) - Error: Cannot parse configuration file: %1. Only use key=value syntax. - Chyba: Nemohu zpracovat konfigurační soubor: %1. Používej pouze syntaxi klíč=hodnota. + %1 d + %1 d - Error: Invalid combination of -regtest and -testnet. - Chyba: Neplatná kombinace -regtest a -testnet. + %1 h + %1 h - Bitcoin Core didn't yet exit safely... - Bitcoin Core ještě bezpečně neskončil... + %1 m + %1 m - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Zadej Bitcoinovou adresu (např. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + %1 s + %1 s + + + NETWORK + SÍŤ + + + UNKNOWN + NEZNÁMÁ + + + None + Žádné + + + N/A + N/A + + + %1 ms + %1 ms @@ -1414,6 +1408,10 @@ Adresa: %4 Using OpenSSL version Používaná verze OpenSSL + + Using BerkeleyDB version + Používaná verze BerkeleyDB + Startup time Čas spuštění @@ -1439,8 +1437,76 @@ Adresa: %4 Aktuální počet bloků - Estimated total blocks - Odhad celkového počtu bloků + Received + Přijato + + + Sent + Odesláno + + + &Peers + &Protějšky + + + Select a peer to view detailed information. + Vyber protějšek a uvidíš jeho detailní informace. + + + Direction + Směr + + + Version + Verze + + + User Agent + Typ klienta + + + Services + Služby + + + Sync Node + Synchronizační uzel + + + Starting Height + Prvotní výška + + + Sync Height + Aktuální výška + + + Ban Score + Skóre pro klatbu + + + Connection Time + Doba spojení + + + Last Send + Poslední odeslání + + + Last Receive + Poslední příjem + + + Bytes Sent + Bajtů odesláno + + + Bytes Received + Bajtů přijato + + + Ping Time + Odezva Last block time @@ -1464,7 +1530,7 @@ Adresa: %4 Totals - Sumy + Součty In: @@ -1519,16 +1585,36 @@ Adresa: %4 %1 GB - %1 m - %1 m + via %1 + via %1 - %1 h - %1 h + never + nikdy - %1 h %2 m - %1 h %2 m + Inbound + Sem + + + Outbound + Ven + + + Yes + Ano + + + No + Ne + + + Unknown + Neznámá + + + Fetching... + Stahuji... @@ -1547,39 +1633,39 @@ Adresa: %4 Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - + Recyklovat již dříve použité adresy. Recyklace adres má bezpečnostní rizika a narušuje soukromí. Nezaškrtávejte to, pokud znovu nevytváříte již dříve vytvořený platební požadavek. R&euse an existing receiving address (not recommended) - + &Recyklovat již existující adresy (nedoporučeno) An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - + Volitelná zpráva, která se připojí k platebnímu požadavku a která se zobrazí, když se požadavek otevře. Poznámka: Tahle zpráva se neposílá s platbou po Bitcoinové síti. An optional label to associate with the new receiving address. - + Volitelné označení, které se má přiřadit k nové adrese. Use this form to request payments. All fields are <b>optional</b>. - + Tímto formulář můžeš požadovat platby. Všechna pole jsou <b>volitelná</b>. An optional amount to request. Leave this empty or zero to not request a specific amount. - + Volitelná částka, kterou požaduješ. Nech prázdné nebo nulové, pokud nepožaduješ konkrétní částku. Clear all fields of the form. - Smaže všechny pole formuláře. + Promaž obsah ze všech formulářových políček. Clear - + Vyčistit Requested payments history - + Historie vyžádaných plateb &Request payment @@ -1587,19 +1673,19 @@ Adresa: %4 Show the selected request (does the same as double clicking an entry) - + Zobraz zvolený požadavek (stejně tak můžeš přímo na něj dvakrát poklepat) Show - + Zobrazit Remove the selected entries from the list - + Smaž zvolené požadavky ze seznamu Remove - Odstranit + Smazat Copy label @@ -1622,7 +1708,7 @@ Adresa: %4 Copy &URI - Kopíruj &URI + &Kopíruj URI Copy &Address @@ -1634,7 +1720,7 @@ Adresa: %4 Request payment to %1 - + Platební požadavek: %1 Payment information @@ -1708,7 +1794,7 @@ Adresa: %4 Coin Control Features - + Možnosti ruční správy mincí Inputs... @@ -1742,10 +1828,6 @@ Adresa: %4 Fee: Poplatek: - - Low Output: - Malý výstup: - After Fee: Čistá částka: @@ -1756,7 +1838,7 @@ Adresa: %4 If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - + Pokud aktivováno, ale adresa pro drobné je prázdná nebo neplatná, tak se drobné pošlou na nově vygenerovanou adresu. Custom change address @@ -1772,7 +1854,11 @@ Adresa: %4 Clear all fields of the form. - Smaže všechny pole formuláře. + Promaž obsah ze všech formulářových políček. + + + Dust: + Prach: Clear &All @@ -1796,7 +1882,7 @@ Adresa: %4 %1 to %2 - + %1 pro %2 Copy quantity @@ -1822,10 +1908,6 @@ Adresa: %4 Copy priority Kopíruj prioritu - - Copy low output - Kopíruj malý výstup - Copy change Kopíruj drobné @@ -1878,22 +1960,18 @@ Adresa: %4 Warning: Unknown change address Upozornění: Neznámá adresa pro drobné + + Copy dust + Kopíruj prach + Are you sure you want to send? - Opravdu chcete odeslat %1? + Jsi si jistý, že to chceš poslat? added as transaction fee přidán jako transakční poplatek - - Payment request expired - Platební požadavek vypršel - - - Invalid payment address %1 - Neplatná platební adresa %1 - SendCoinsEntry @@ -1905,10 +1983,6 @@ Adresa: %4 Pay &To: &Komu: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adresa příjemce (např. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Zadej označení této adresy; obojí se ti pak uloží do adresáře @@ -1925,6 +1999,10 @@ Adresa: %4 This is a normal payment. Tohle je normální platba. + + The Bitcoin address to send the payment to + Bitcoinová adresa příjemce + Alt+A Alt+A @@ -1947,19 +2025,19 @@ Adresa: %4 This is a verified payment request. - Toto je ověřený požadavek k platbě. + Tohle je ověřený platební požadavek. Enter a label for this address to add it to the list of used addresses - + Zadej označení této adresy; obojí se ti pak uloží do adresáře A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - + Zpráva, která byla připojena k bitcoin: URI a která se ti pro přehled uloží k transakci. Poznámka: Tahle zpráva se neposílá s platbou po Bitcoinové síti. This is an unverified payment request. - Toto je neověřený požadavek k platbě. + Tohle je neověřený platební požadavek. Pay To: @@ -1996,8 +2074,8 @@ Adresa: %4 Podepsáním zprávy svými adresami můžeš prokázat, že je skutečně vlastníš. Buď opatrný a nepodepisuj nic vágního; například při phishingových útocích můžeš být lákán, abys něco takového podepsal. Podepisuj pouze zcela úplná a detailní prohlášení, se kterými souhlasíš. - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adresa, kterou se zpráva podepíše (např. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address to sign the message with + Bitcoinová adresa, kterou se zpráva podepíše Choose previously used address @@ -2052,8 +2130,8 @@ Adresa: %4 K ověření podpisu zprávy zadej podepisující adresu, zprávu (ověř si, že správně kopíruješ zalomení řádků, mezery, tabulátory apod.) a podpis. Dávej pozor na to, abys nezkopíroval do podpisu víc, než co je v samotné podepsané zprávě, abys nebyl napálen man-in-the-middle útokem. - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adresa, kterou je zpráva podepsána (např. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address the message was signed with + Bitcoinová adresa, kterou je zpráva podepsána Verify the message to ensure it was signed with the specified Bitcoin address @@ -2068,12 +2146,8 @@ Adresa: %4 Vymaž všechna pole formuláře pro ověření zrávy - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Zadej Bitcoinovou adresu (např. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Kliknutím na "Podepiš zprávu" vygeneruješ podpis + Click "Sign Message" to generate signature + Kliknutím na "Podepiš zprávu" vygeneruješ podpis The entered address is invalid. @@ -2097,7 +2171,7 @@ Adresa: %4 Message signing failed. - Podepisování zprávy selhalo. + Nepodařilo se podepsat zprávu. Message signed. @@ -2117,7 +2191,7 @@ Adresa: %4 Message verification failed. - Ověřování zprávy selhalo. + Nepodařilo se ověřit zprávu. Message verified. @@ -2174,7 +2248,7 @@ Adresa: %4 , broadcast through %n node(s) - , rozesláno přes 1 uzel, rozesláno přes %n uzly, rozesláno přes %n uzlů + , rozesláno přes %n uzel, rozesláno přes %n uzly, rozesláno přes %n uzlů Date @@ -2200,6 +2274,10 @@ Adresa: %4 own address vlastní adresa + + watch-only + sledovací + label označení @@ -2208,10 +2286,6 @@ Adresa: %4 Credit Příjem - - matures in %n more block(s) - dozraje po jednom blokudozraje po %n blocíchdozraje po %n blocích - not accepted neakceptováno @@ -2220,6 +2294,14 @@ Adresa: %4 Debit Výdaj + + Total debit + Celkové výdaje + + + Total credit + Celkové příjmy + Transaction fee Transakční poplatek @@ -2245,8 +2327,8 @@ Adresa: %4 Obchodník - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - Vygenerované mince musí čekat %1 bloků, než mohou být utraceny. Když jsi vygeneroval tenhle blok, tak byl rozposlán do sítě, aby byl přidán do řetězce bloků. Pokud se mu nepodaří dostat se do řetězce, změní se na "neakceptovaný" a nepůjde utratit. To se občas může stát, pokud jiný uzel vygeneruje blok zhruba ve stejném okamžiku jako ty. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Vygenerované mince musí čekat %1 bloků, než mohou být utraceny. Když jsi vygeneroval tenhle blok, tak byl rozposlán do sítě, aby byl přidán do řetězce bloků. Pokud se mu nepodaří dostat se do řetězce, změní se na "neakceptovaný" a nepůjde utratit. To se občas může stát, pokud jiný uzel vygeneruje blok zhruba ve stejném okamžiku jako ty. Debug information @@ -2278,7 +2360,7 @@ Adresa: %4 Open for %n more block(s) - Otevřeno pro 1 další blokOtevřeno pro %n další blokyOtevřeno pro %n dalších bloků + Otevřeno pro %n další blokOtevřeno pro %n další blokyOtevřeno pro %n dalších bloků unknown @@ -2310,17 +2392,13 @@ Adresa: %4 Address Adresa - - Amount - Částka - Immature (%1 confirmations, will be available after %2) Nedozráno (%1 potvrzení, bude k dispozici za %2) Open for %n more block(s) - Otevřeno pro 1 další blokOtevřeno pro %n další blokyOtevřeno pro %n dalších bloků + Otevřeno pro %n další blokOtevřeno pro %n další blokyOtevřeno pro %n dalších bloků Open until %1 @@ -2525,10 +2603,6 @@ Adresa: %4 Address Adresa - - Amount - Částka - ID ID @@ -2542,6 +2616,13 @@ Adresa: %4 + + UnitDisplayStatusBarControl + + Unit to show amounts in. Click to select another unit. + Jednotka pro částky. Klikni pro výběr nějaké jiné. + + WalletFrame @@ -2593,18 +2674,6 @@ Adresa: %4 bitcoin-core - - Usage: - Užití: - - - List commands - Výpis příkazů - - - Get help for a command - Získat nápovědu pro příkaz - Options: Možnosti: @@ -2627,7 +2696,7 @@ Adresa: %4 Maintain at most <n> connections to peers (default: 125) - Povolit nejvýše <n> připojení k uzlům (výchozí: 125) + Povolit nejvýše <n> protějšků (výchozí: 125) Connect to a node to retrieve peer addresses, and disconnect @@ -2639,15 +2708,11 @@ Adresa: %4 Threshold for disconnecting misbehaving peers (default: 100) - Práh pro odpojování zlobivých uzlů (výchozí: 100) + Práh pro odpojování zlobivých protějšků (výchozí: 100) Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Doba ve vteřinách, po kterou se nebudou moci zlobivé uzly znovu připojit (výchozí: 86400) - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Při nastavování naslouchacího RPC portu %i pro IPv4 nastala chyba: %s + Doba ve vteřinách, po kterou se nebudou moci zlobivé protějšky znovu připojit (výchozí: 86400) Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) @@ -2657,10 +2722,6 @@ Adresa: %4 Accept command line and JSON-RPC commands Akceptovat příkazy z příkazové řádky a přes JSON-RPC - - Bitcoin Core RPC client version - Verze Bitcoin Core RPC klienta - Run in the background as a daemon and accept commands Běžet na pozadí jako démon a akceptovat příkazy @@ -2683,7 +2744,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, musíš nastavit rpcpassword v konfiguračním souboru: %s @@ -2694,37 +2755,29 @@ rpcpassword=%s rpcuser a rpcpassword NESMÍ být stejné. Pokud konfigurační soubor ještě neexistuje, vytvoř ho tak, aby ho mohl číst pouze vlastník. Je také doporučeno si nastavit alertnotify, abys byl upozorněn na případné problémy; -například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Akceptovatelné šifry (výchozí: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Při nastavování naslouchacího RPC portu %u pro IPv6 nastala chyba, vracím se k IPv4: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Poslouchat na zadané adrese. Pro zápis IPv6 adresy použij notaci [adresa]:port Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - + Kontinuálně omezovat bezpoplatkové transakce na <n>*1000 bajtů za minutu (výchozí: 15) - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Přepnout do módu testování regresí, který používá speciální řetězec, ve kterém jsou mohou být bloky okamžitě vyřešeny. Je to určeno pro nástroje pro regresní testování a vyvíjení aplikací. + Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup + Smazat všechny transakce peněženky a při startu obnovit pouze relevantní části řetězce bloků pomocí -rescan Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Přepnout do módu testování regresí, který používá speciální řetězec, ve kterém mohou být bloky okamžitě vyřešeny. - - Error: Listening for incoming connections failed (listen returned error %d) - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Chyba: Transakce byla odmítnuta! Tohle může nastat, pokud nějaké mince z tvé peněženky už jednou byly utraceny, například pokud používáš kopii souboru wallet.dat a mince byly utraceny v druhé kopii, ale nebyly označeny jako utracené v této. @@ -2737,13 +2790,9 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Spustit příkaz, když se objeví transakce týkající se peněženky (%s se v příkazu nahradí za TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - + Promítnout databázovou aktivitu z paměťového prostoru do záznamu na disku každých <n> megabajtů (výchozí: 100) How thorough the block verification of -checkblocks is (0-4, default: 3) @@ -2751,15 +2800,15 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. In this mode -genproclimit controls how many blocks are generated immediately. - + V tomto módu -genproclimit určuje, kolik bloků je vygenerováno okamžitě. Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - Nastavení počtu vláken pro verifikaci skriptů (%u až %d, 0 = automaticky, <0 = nechat daný počet jader volný, výchozí: 0) + Nastavení počtu vláken pro verifikaci skriptů (%u až %d, 0 = automaticky, <0 = nechat daný počet jader volný, výchozí: %d) Set the processor limit for when generation is on (-1 = unlimited, default: -1) - + Nastavit omezení procesoru pro zapnuté generování (-1 = bez omezení, výchozí: -1) This is a pre-release test build - use at your own risk - do not use for mining or merchant applications @@ -2771,23 +2820,19 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Použít samostatnou SOCKS5 proxy ke spojení s peery přes skryté služby v Toru (výchozí: -proxy) + Použít samostatnou SOCKS5 proxy ke spojení s protějšky přes skryté služby v Toru (výchozí: -proxy) Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Upozornění: -paytxfee je nastaveno velmi vysoko! Toto je transakční poplatek, který zaplatíš za každou poslanou transakci. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Upozornění: Zkontroluj, že máš v počítači správně nastavený datum a čas! Pokud jsou nastaveny špatně, Bitcoin nebude fungovat správně. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Upozornění: Síť podle všeho není v konzistentním stavu. Někteří těžaři jsou zřejmě v potížích. Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - Upozornění: Nesouhlasím zcela se svými protiuzly! Možná potřebuji aktualizovat nebo ostatní uzly potřebují aktualizovat. + Upozornění: Nesouhlasím zcela se svými protějšky! Možná potřebuji aktualizovat nebo ostatní uzly potřebují aktualizovat. Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. @@ -2813,30 +2858,14 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Attempt to recover private keys from a corrupt wallet.dat Pokusit se zachránit soukromé klíče z poškozeného souboru wallet.dat - - Bitcoin Core Daemon - Bitcoin Core démon - Block creation options: Možnosti vytvoření bloku: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) Připojit se pouze k zadanému uzlu (příp. zadaným uzlům) - - Connect through SOCKS proxy - Připojit se přes SOCKS proxy - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - Připojit se k JSON RPC na <port> (výchozí: 8332 nebo testnet: 18332) - Connection options: Možnosti připojení: @@ -2851,7 +2880,7 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Disable safemode, override a real safe mode event (default: 0) - + Vypnout bezpečný režim (safemode), překrýt skutečnou událost bezpečného režimu (výchozí: 0) Discover own IP address (default: 1 when listening and no -externalip) @@ -2937,18 +2966,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write undo data Nepodařilo se zapsat data o vracení změn - - Fee per kB to add to transactions you send - Poplatek za kB, který se přidá ke každé odeslané transakci - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - Hledat uzly přes DNS (výchozí: 1, pokud není zadáno -connect) - Force safe mode (default: 0) Vynutit bezpečný mód (výchozí: 0) @@ -2963,7 +2980,7 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. If <category> is not supplied, output all debugging information. - + Pokud není <category> zadána, bude tisknout veškeré ladicí informace. Importing... @@ -2974,8 +2991,8 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Nemám žádný nebo jen špatný genesis blok. Není špatně nastavený datadir? - Invalid -onion address: '%s' - Neplatná -onion adresa: '%s' + Invalid -onion address: '%s' + Neplatná -onion adresa: '%s' Not enough file descriptors available. @@ -2985,18 +3002,10 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Prepend debug output with timestamp (default: 1) Připojit před ladicí výstup časové razítko (výchozí: 1) - - RPC client options: - - Rebuild block chain index from current blk000??.dat files Znovu vytvořit index řetězce bloků z aktuálních blk000??.dat souborů - - Select SOCKS version for -proxy (4 or 5, default: 5) - Zvol verzi SOCKS proxy pro -proxy (4 nebo 5, výchozí: 5) - Set database cache size in megabytes (%d to %d, default: %d) Nastavit velikost databázové vyrovnávací paměti v megabajtech (%d až %d, výchozí: %d) @@ -3015,28 +3024,24 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Spend unconfirmed change when sending transactions (default: 1) - + Utrácet i ještě nepotvrzené drobné při posílání transakcí (výchozí: 1) + + + Stop running after importing blocks from disk (default: 0) + Ukončit se po importu bloků z disku (výchozí: 0) This is intended for regression testing tools and app development. Tohle je určeno pro nástroje na regresní testování a vyvíjení aplikací. - - Usage (deprecated, use bitcoin-cli): - - Verifying blocks... - Ověřuji bloky... + Ověřuji bloky... Verifying wallet... Kontroluji peněženku... - - Wait for RPC server to start - - Wallet %s resides outside data directory %s Peněženka %s se nachází mimo datový adresář %s @@ -3045,10 +3050,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Wallet options: Možnosti peněženky: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - You need to rebuild the database using -reindex to change -txindex Je třeba přestavět databázi použitím -reindex, aby bylo možné změnit -txindex @@ -3057,41 +3058,165 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Imports blocks from external blk000??.dat file Importovat bloky z externího souboru blk000??.dat + + (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + (výchozí: 1, 1 = ukládat transakční metadata, např. majitele účtu a informace o platebním požadavku, 2 = mazat transakční metadata) + + + Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times + Povolit JSON-RPC spojení ze specifikovaného zdroje. Platnou hodnotou <ip> je jednotlivá IP adresa (např. 1.2.3.4), síť/maska (např. 1.2.3.4/255.255.255.0) nebo síť/CIDR (např. 1.2.3.4/24). Tuto volbu lze použít i vícekrát + + + An error occurred while setting up the RPC address %s port %u for listening: %s + Při nastavování naslouchací RPC adresy %s a portu %u nastala chyba: %s + + + Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6 + Obsadit zadanou adresu a protějšky, které se na ní připojí, umístit na bílou listinu. Pro zápis IPv6 adresy použij notaci [adresa]:port + + + Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces) + Čekat na zadané adrese na JSON-RPC spojení. Pro zápis IPv6 adresy použij notaci [adresa]:port. Tuto volbu lze použít i vícekrát (výchozí: poslouchat na všech rozhraních) + Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. Nedaří se mi získat zámek na datový adresář %s. Bitcoin Core pravděpodobně už jednou běží. + + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) + Vytvářet nové soubory s výchozími systémovými právy namísto umask 077 (uplatní se, pouze pokud je vypnutá funkce peněženky) + + + Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + Šířen pod licencí MIT/X11, viz přiložený soubor COPYING nebo <http://www.opensource.org/licenses/mit-license.php>. + + + Error: Listening for incoming connections failed (listen returned error %s) + Chyba: Nelze naslouchat příchozí spojení (listen vrátil chybu %s) + + + Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + Chyba: Byl použit nepodporovaný argument -socks. Nastavení verze SOCKS už není možné, podporovány jsou pouze SOCKS5 proxy. + + + Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) + Spustit příkaz, když nějaká transakce na síti znovu utrácí vstup transakce této peněženky (%s=TxID cizí transakce, %t=TxID transakce peněženky) + Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Spustit příkaz, když přijde relevantní upozornění nebo když dojde k opravdu dlouhému rozštěpení řetezce bloků (%s se v příkazu nahradí zprávou) + + Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) + Poplatky (v BTC/Kb) menší než tato hodnota jsou považovány za nulové pro účely přeposílání transakcí (výchozí: %s) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) + Poplatky (v BTC/Kb) menší než tato hodnota jsou považovány za nulové pro účely vytváření transakcí (výchozí: %s) + + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) + Pokud paytxfee není nastaveno, platit dostatečný poplatek na to, aby byly transakce potvrzeny v průměru během n bloků (výchozí: 1) + Output debugging information (default: 0, supplying <category> is optional) Tisknout ladicí informace (výchozí: 0, zadání <category> je volitelné) + + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) + Při nedostatku adres získat další protějšky z DNS (výchozí: 1, pokud není použito -connect) + Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Nastavit maximální velikost prioritních/nízkopoplatkových transakcí v bajtech (výchozí: %d) + + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. + Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití v OpenSSL Toolkitu <https://www.openssl.org/> a kryptografický program od Erika Younga a program UPnP od Thomase Bernarda. + + + Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + Upozornění: Zkontroluj, že máš v počítači správně nastavený datum a čas! Pokud jsou nastaveny špatně, Bitcoin Core nebude fungovat správně. + + + Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. + Umístit na bílou listinu protějšky připojující se z dané podsítě či ip. Lze zadat i vícekrát. + + + Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway + Na protějšky na bílé listině se nevztahuje DoS klatba a jejich transakce jsou vždy přeposílány, i když už třeba jsou v mempoolu, což je užitečné např. pro bránu + + + Always query for peer addresses via DNS lookup (default: 0) + Vždy získávat adresy dalších protějšků přes DNS (výchozí: 0) + + + Cannot resolve -whitebind address: '%s' + Nemohu přeložit -whitebind adresu: '%s' + + + Connect through SOCKS5 proxy + Připojit se přes SOCKS5 proxy + + + Copyright (C) 2009-%i The Bitcoin Core Developers + Copyright (C) 2009-%i Vývojáři Bitcoin Core + + + Could not parse -rpcbind value %s as network address + Nejde mi přečíst hodnotu -rpcbind %s jako síťovou adresu + + + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core + Chyba při načítání wallet.dat: peněženka vyžaduje novější verzi Bitcoin Core + + + Error: Unsupported argument -tor found, use -onion. + Chyba: Argument -tor již není podporovaný, použij -onion. + + + Fee (in BTC/kB) to add to transactions you send (default: %s) + Poplatek (v BTC/kB), který se přidá ke každé odeslané transakci (výchozí: %s) + + + Include IP addresses in debug output (default: 0) + Zaznamenávat do ladicích výstupů i IP adresy (výchozí: 0) + Information Informace - Invalid amount for -minrelaytxfee=<amount>: '%s' - Neplatná částka pro -minrelaytxfee=<částka>: '%s' + Initialization sanity check failed. Bitcoin Core is shutting down. + Selhala úvodní zevrubná prověrka. Bitcoin Core se ukončuje. - Invalid amount for -mintxfee=<amount>: '%s' - Neplatná částka pro -mintxfee=<částka>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Neplatná částka pro -minrelaytxfee=<částka>: '%s' + + + Invalid amount for -mintxfee=<amount>: '%s' + Neplatná částka pro -mintxfee=<částka>: '%s' + + + Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) + Neplatná částka pro -paytxfee=<částka>: '%s' (musí být alespoň %s) + + + Invalid netmask specified in -whitelist: '%s' + Ve -whitelist byla zadána neplatná podsíť: '%s' + + + Keep at most <n> unconnectable blocks in memory (default: %u) + Držet v paměti nejvýše <n> nespojitelných bloků (výchozí: %u) Limit size of signature cache to <n> entries (default: 50000) - + Omezit velikost vyrovnávací paměti pro podpisy na <n> položek (výchozí: 50000) Log transaction priority and fee per kB when mining blocks (default: 0) - + Zaznamenávat během těžení bloků prioritu transakce a poplatek za kB (výchozí: 0) Maintain a full transaction index (default: 0) @@ -3105,6 +3230,14 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) Maximální velikost odesílacího bufferu pro každé spojení, <n>*1000 bajtů (výchozí: 1000) + + Need to specify a port with -whitebind: '%s' + V rámci -whitebind je třeba specifikovat i port: '%s' + + + Node relay options: + Možnosti přeposílání: + Only accept block chain matching built-in checkpoints (default: 1) Uznávat pouze řetězec bloků, který odpovídá vnitřním kontrolním bodům (výchozí: 1) @@ -3115,15 +3248,15 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Print block on startup, if found in block index - + Vypsat při startu blok,pokud se nachází v indexu bloků Print block tree on startup (default: 0) - + Vypsat při startu strom bloků (výchozí: 0) RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - + Možnosti SSL pro RPC: (viz instrukce nastavení SSL na Bitcoin Wiki) RPC server options: @@ -3131,23 +3264,23 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Randomly drop 1 of every <n> network messages - + Náhodně zahazovat jednu z každých <n> síťových zpráv Randomly fuzz 1 of every <n> network messages - + Náhodně pozměňovat jednu z každých <n> síťových zpráv + + + Relay and mine data carrier transactions (default: 1) + Přeposílat a těžit transakce nesoucí data (výchozí: 1) + + + Relay non-P2SH multisig (default: 1) + Přeposílat ne-P2SH multisig (výchozí: 1) Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - Možnosti SSL: (viz instrukce nastavení SSL v Bitcoin Wiki) - - - Send command to Bitcoin Core - Poslat příkaz Bitcoin Core + Spustit vlákno pročišťující periodicky peněženku (výchozí: 1) Send trace/debug info to console instead of debug.log file @@ -3159,15 +3292,11 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - + Nastavit příznak DB_PRIVATE v databázovém prostředí peněženky (výchozí: 1) Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - + Zobrazit všechny možnosti ladění (užití: --help -help-debug) Shrink debug.log file on client startup (default: 1 when no -debug) @@ -3175,20 +3304,20 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Signing transaction failed - Podepisování transakce selhalo + Nepodařilo se podepsat transakci Specify connection timeout in milliseconds (default: 5000) Zadej časový limit spojení v milisekundách (výchozí: 5000) - - Start Bitcoin Core Daemon - - System error: Systémová chyba: + + This is experimental software. + Tohle je experimentální program. + Transaction amount too small Částka v transakci je příliš malá @@ -3201,6 +3330,10 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Transaction too large Transace je příliš velká + + Unable to bind to %s on this computer (bind returned error %s) + Nedaří se mi připojit na %s na tomhle počítači (operace bind vrátila chybu %s) + Use UPnP to map the listening port (default: 0) Použít UPnP k namapování naslouchacího portu (výchozí: 0) @@ -3213,6 +3346,10 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Username for JSON-RPC connections Uživatelské jméno pro JSON-RPC spojení + + Wallet needed to be rewritten: restart Bitcoin Core to complete + Soubor s peněženkou potřeboval přepsat: restartuj Bitcoin Core, aby se operace dokončila + Warning Upozornění @@ -3221,18 +3358,22 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: This version is obsolete, upgrade required! Upozornění: tahle verze je zastaralá, měl bys ji aktualizovat! + + Warning: Unsupported argument -benchmark ignored, use -debug=bench. + Upozornění: Nepodporovaný argument -benchmark se ignoruje, použij -debug=bench. + + + Warning: Unsupported argument -debugnet ignored, use -debug=net. + Upozornění: Nepodporovaný argument -debugnet se ignoruje, použij -debug=net. + Zapping all transactions from wallet... - + Vymazat všechny transakce z peněženky... on startup při startu - - version - verze - wallet.dat corrupt, salvage failed Soubor wallet.dat je poškozen, jeho záchrana se nezdařila @@ -3241,14 +3382,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Password for JSON-RPC connections Heslo pro JSON-RPC spojení - - Allow JSON-RPC connections from specified IP address - Povolit JSON-RPC spojení ze specifikované IP adresy - - - Send commands to node running on <ip> (default: 127.0.0.1) - Posílat příkazy uzlu běžícím na <ip> (výchozí: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Spustit příkaz, když se změní nejlepší blok (%s se v příkazu nahradí hashem bloku) @@ -3281,10 +3414,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message Tato nápověda - - Unable to bind to %s on this computer (bind returned error %d, %s) - Nedaří se mi připojit na %s na tomhle počítači (operace bind vrátila chybu %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Povolit DNS dotazy pro -addnode (přidání uzlu), -seednode a -connect (připojení) @@ -3297,41 +3426,29 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted Chyba při načítání wallet.dat: peněženka je poškozená - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Chyba při načítání wallet.dat: peněženka vyžaduje novější verzi Bitcoinu - - - Wallet needed to be rewritten: restart Bitcoin to complete - Soubor s peněženkou potřeboval přepsat: restartuj Bitcoin, aby se operace dokončila - Error loading wallet.dat Chyba při načítání wallet.dat - Invalid -proxy address: '%s' - Neplatná -proxy adresa: '%s' + Invalid -proxy address: '%s' + Neplatná -proxy adresa: '%s' - Unknown network specified in -onlynet: '%s' - V -onlynet byla uvedena neznámá síť: '%s' + Unknown network specified in -onlynet: '%s' + V -onlynet byla uvedena neznámá síť: '%s' - Unknown -socks proxy version requested: %i - V -socks byla požadována neznámá verze proxy: %i + Cannot resolve -bind address: '%s' + Nemohu přeložit -bind adresu: '%s' - Cannot resolve -bind address: '%s' - Nemohu přeložit -bind adresu: '%s' + Cannot resolve -externalip address: '%s' + Nemohu přeložit -externalip adresu: '%s' - Cannot resolve -externalip address: '%s' - Nemohu přeložit -externalip adresu: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Neplatná částka pro -paytxfee=<částka>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Neplatná částka pro -paytxfee=<částka>: '%s' Invalid amount @@ -3377,13 +3494,5 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error Chyba - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Musíš nastavit rpcpassword=<heslo> v konfiguračním souboru: -%s -Pokud konfigurační soubor ještě neexistuje, vytvoř ho tak, aby ho mohl číst pouze vlastník. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_cy.ts b/src/qt/locale/bitcoin_cy.ts index d2f41739cb..3380733c63 100644 --- a/src/qt/locale/bitcoin_cy.ts +++ b/src/qt/locale/bitcoin_cy.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -41,95 +9,15 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address Creu cyfeiriad newydd - - &New - - Copy the currently selected address to the system clipboard - Copio'r cyfeiriad sydd wedi'i ddewis i'r clipfwrdd system - - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - + Copio'r cyfeiriad sydd wedi'i ddewis i'r clipfwrdd system &Delete &Dileu - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - - - Comma separated file (*.csv) - - - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -147,10 +35,6 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase Teipiwch gyfrinymadrodd @@ -163,29 +47,25 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Ailadroddwch gyfrinymadrodd newydd - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Dewiswch gyfrinymadrodd newydd ar gyfer y waled. <br/> Defnyddiwch cyfrinymadrodd o <b>10 neu fwy o lythyrennau hapgyrch</b>, neu <b> wyth neu fwy o eiriau. - Encrypt wallet - Amgryptio'r waled + Amgryptio'r waled This operation needs your wallet passphrase to unlock the wallet. - Mae angen i'r gweithred hon ddefnyddio'ch cyfrinymadrodd er mwyn datgloi'r waled. + Mae angen i'r gweithred hon ddefnyddio'ch cyfrinymadrodd er mwyn datgloi'r waled. Unlock wallet - Datgloi'r waled + Datgloi'r waled This operation needs your wallet passphrase to decrypt the wallet. - Mae angen i'r gweithred hon ddefnyddio'ch cyfrinymadrodd er mwyn dadgryptio'r waled. + Mae angen i'r gweithred hon ddefnyddio'ch cyfrinymadrodd er mwyn dadgryptio'r waled. Decrypt wallet - Dadgryptio'r waled + Dadgryptio'r waled Change passphrase @@ -193,35 +73,15 @@ This product includes software developed by the OpenSSL Project for use in the O Enter the old and new passphrase to the wallet. - Teipiwch yr hen cyfrinymadrodd a chyfrinymadrodd newydd i mewn i'r waled. + Teipiwch yr hen cyfrinymadrodd a chyfrinymadrodd newydd i mewn i'r waled. Confirm wallet encryption Cadarnau amgryptiad y waled - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - Wallet encrypted - Waled wedi'i amgryptio - - - Bitcoin 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. - + Waled wedi'i amgryptio Wallet encryption failed @@ -233,43 +93,27 @@ This product includes software developed by the OpenSSL Project for use in the O The supplied passphrases do not match. - Dydy'r cyfrinymadroddion a ddarparwyd ddim yn cyd-fynd â'u gilydd. + Dydy'r cyfrinymadroddion a ddarparwyd ddim yn cyd-fynd â'u gilydd. Wallet unlock failed - Methodd ddatgloi'r waled - - - The passphrase entered for the wallet decryption was incorrect. - + Methodd ddatgloi'r waled Wallet decryption failed Methodd dadgryptiad y waled - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - Synchronizing with network... - Cysoni â'r rhwydwaith... + Cysoni â'r rhwydwaith... &Overview &Trosolwg - - Node - - Show general overview of wallet Dangos trosolwg cyffredinol y waled @@ -282,125 +126,17 @@ This product includes software developed by the OpenSSL Project for use in the O Browse transaction history Pori hanes trafodion - - E&xit - - Quit application Gadael rhaglen - - Show information about Bitcoin - Dangos gwybodaeth am Bitcoin - - - About &Qt - - - - Show information about Qt - - &Options... &Opsiynau - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - Change the passphrase used for wallet encryption - Newid y cyfrinymadrodd a ddefnyddiwyd ar gyfer amgryptio'r waled - - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - + Newid y cyfrinymadrodd a ddefnyddiwyd ar gyfer amgryptio'r waled &File @@ -422,90 +158,6 @@ This product includes software developed by the OpenSSL Project for use in the O [testnet] [testnet] - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - - - %n active connection(s) to Bitcoin network - - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - Error Gwall @@ -532,90 +184,22 @@ This product includes software developed by the OpenSSL Project for use in the O Incoming transaction - Trafodiad sy'n cyrraedd - - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - + Trafodiad sy'n cyrraedd Wallet is <b>encrypted</b> and currently <b>unlocked</b> - Mae'r waled <b>wedi'i amgryptio</b> ac <b>heb ei gloi</b> ar hyn o bryd + Mae'r waled <b>wedi'i amgryptio</b> ac <b>heb ei gloi</b> ar hyn o bryd Wallet is <b>encrypted</b> and currently <b>locked</b> - Mae'r waled <b>wedi'i amgryptio</b> ac <b>ar glo</b> ar hyn o bryd - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - + Mae'r waled <b>wedi'i amgryptio</b> ac <b>ar glo</b> ar hyn o bryd ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - - - Amount - - Address Cyfeiriad @@ -624,193 +208,21 @@ Address: %4 Date Dyddiad - - Confirmations - - - - Confirmed - - - - Priority - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (heb label) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog Edit Address - Golygu'r cyfeiriad + Golygu'r cyfeiriad &Label &Label - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Cyfeiriad @@ -825,23 +237,19 @@ Address: %4 Edit receiving address - Golygu'r cyfeiriad derbyn + Golygu'r cyfeiriad derbyn Edit sending address - Golygu'r cyfeiriad anfon + Golygu'r cyfeiriad anfon - The entered address "%1" is already in the address book. - Mae'r cyfeiriad "%1" sydd newydd gael ei geisio gennych yn y llyfr cyfeiriad yn barod. - - - The entered address "%1" is not a valid Bitcoin address. - + The entered address "%1" is already in the address book. + Mae'r cyfeiriad "%1" sydd newydd gael ei geisio gennych yn y llyfr cyfeiriad yn barod. Could not unlock wallet. - Methodd ddatgloi'r waled. + Methodd ddatgloi'r waled. New key generation failed. @@ -850,799 +258,70 @@ Address: %4 FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - - - version - - - - Usage: - - - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - Error Gwall - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog Options Opsiynau - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage Form Ffurflen - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - <b>Recent transactions</b> <b>Trafodion diweddar</b> - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - - Bitcoin - - - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - &Information - + Gwybodaeth - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - &Label: &Label: - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - - - Copy label - - - - Copy message - - - - Copy amount - - - + ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address Cyfeiriad - - Amount - - Label Label @@ -1651,15 +330,7 @@ Address: %4 Message Neges - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel @@ -1674,619 +345,107 @@ Address: %4 Message Neges - - Amount - - (no label) (heb label) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins Anfon arian - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Anfon at pobl lluosog ar yr un pryd - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - Balance: Gweddill: Confirm the send action - Cadarnhau'r gweithrediad anfon - - - S&end - - - - Confirm send coins - + Cadarnhau'r gweithrediad anfon %1 to %2 %1 i %2 - - Copy quantity - - - - Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - - - The amount to pay must be larger than 0. - - - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (heb label) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry A&mount: &Maint - - Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Enter a label for this address to add it to your address book - - &Label: &Label: - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt+A Paste address from clipboard - Gludo cyfeiriad o'r glipfwrdd + Gludo cyfeiriad o'r glipfwrdd Alt+P Alt+P - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - Alt+A Alt+A Paste address from clipboard - Gludo cyfeiriad o'r glipfwrdd + Gludo cyfeiriad o'r glipfwrdd Alt+P Alt+P - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - [testnet] - + [testnet] TrafficGraphWidget - - KB/s - - - + TransactionDesc Open until %1 Agor tan %1 - - conflicted - - - - %1/offline - - - - %1/unconfirmed - - - - %1 confirmations - - - - Status - - - - , broadcast through %n node(s) - - Date Dyddiad - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - Message Neges - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - - - Amount - - - - true - - - - false - - - - , has not been successfully broadcast yet - - - - Open for %n more block(s) - - - - unknown - - - + TransactionDescDialog - - Transaction details - - - - This pane shows a detailed description of the transaction - - - + TransactionTableModel @@ -2301,205 +460,21 @@ Address: %4 Address Cyfeiriad - - Amount - - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - Open until %1 Agor tan %1 - - Confirmed (%1 confirmations) - - - - This block was not received by any other nodes and will probably not be accepted! - - - - Generated but not accepted - - - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - - - Received with - - - - Received from - - - - Sent to - - - - Payment to yourself - - - - Mined - - - - (n/a) - - - - Transaction status. Hover over this field to show number of confirmations. - - - - Date and time that the transaction was received. - - - - Type of transaction. - - - - Destination address of transaction. - - - - Amount removed from or added to balance. - - - + TransactionView - - All - - Today Heddiw - - This week - - - - This month - - - - Last month - - This year Eleni - - Range... - - - - Received with - - - - Sent to - - - - To yourself - - - - Mined - - - - Other - - - - Enter address or label to search - - - - Min amount - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - - - Comma separated file (*.csv) - - - - Confirmed - - Date Dyddiad @@ -2516,853 +491,36 @@ Address: %4 Address Cyfeiriad - - Amount - - - - ID - - - - Range: - - - - to - - - + + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel Send Coins - + Anfon arian WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - - - Options: - - - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information Gwybodaeth - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - Warning Rhybudd - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - - - Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - - - Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - - - Done loading - - - - To use the %s option - - Error Gwall - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_da.ts b/src/qt/locale/bitcoin_da.ts index a0514035fd..f292766ec8 100644 --- a/src/qt/locale/bitcoin_da.ts +++ b/src/qt/locale/bitcoin_da.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - Om Bitcoin Core - - - <b>Bitcoin Core</b> version - <b>Bitcoin Core</b> version - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Dette program er eksperimentelt. - -Det er gjort tilgængeligt under MIT/X11-softwarelicensen. Se den medfølgende fil "COPYING" eller http://www.opensource.org/licenses/mit-license.php. - -Produktet indeholder software som er udviklet af OpenSSL Project til brug i OpenSSL Toolkit (http://www.openssl.org/), kryptografisk software skrevet af Eric Young (eay@cryptsoft.com) og UPnP-software skrevet af Thomas Bernard. - - - Copyright - Ophavsret - - - The Bitcoin Core developers - Udviklerne af Bitcoin Core - - - (%1-bit) - (%1-bit) - - + AddressBookPage @@ -131,8 +94,8 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Eksport mislykkedes - There was an error trying to save the address list to %1. - En fejl opstod under gemning af adresseliste til %1. + There was an error trying to save the address list to %1. Please try again. + Der opstod en fejl under gemning af adresselisten til %1. Prøv venligst igen. @@ -168,10 +131,6 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Repeat new passphrase Gentag ny adgangskode - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Indtast den nye adgangskode til tegnebogen.<br/>Brug venligst en adgangskode på <b>10 eller flere tilfældige tegn</b> eller <b>otte eller flere ord</b>. - Encrypt wallet Kryptér tegnebog @@ -224,6 +183,10 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Wallet encrypted Tegnebog krypteret + + 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>. + Indtast det nye kodeord til tegnebogen.<br/>Brug venligst et kodeord på <b>ti eller flere tilfældige tegn</b> eller <b>otte eller flere ord</b>. + Bitcoin 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. Bitcoin vil nu lukke for at gennemføre krypteringsprocessen. Husk på, at kryptering af din tegnebog vil ikke beskytte dine bitcoins fuldt ud mod at blive stjålet af malware på din computer. @@ -295,10 +258,6 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Quit application Afslut program - - Show information about Bitcoin - Vis informationer om Bitcoin - About &Qt Om Qt @@ -335,6 +294,10 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Open &URI... Åbn URI … + + Bitcoin Core client + Bitcoin Core-klient + Importing blocks from disk... Importerer blokke fra disken … @@ -387,6 +350,10 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open &Receive Modtag + + Show information about Bitcoin Core + Vis oplysninger om Bitcoin Core + &Show / Hide Vis / skjul @@ -433,7 +400,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Request payments (generates QR codes and bitcoin: URIs) - Forespørg betalinger (genererer QR-koder og "bitcoin:"-URI'er) + Anmod om betalinger (genererer QR-koder og "bitcoin:"-URI'er) &About Bitcoin Core @@ -449,7 +416,7 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Open a bitcoin: URI or payment request - Åbn en "bitcoin:"-URI eller betalingsforespørgsel + Åbn en "bitcoin:"-URI eller betalingsanmodning &Command-line options @@ -459,10 +426,6 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options Vis Bitcoin Core hjælpebesked for at få en liste over mulige tilvalg for Bitcoin kommandolinje - - Bitcoin client - Bitcoin-klient - %n active connection(s) to Bitcoin network %n aktiv forbindelse til Bitcoin-netværket%n aktive forbindelser til Bitcoin-netværket @@ -471,10 +434,6 @@ Produktet indeholder software som er udviklet af OpenSSL Project til brug i Open No block source available... Ingen blokkilde tilgængelig … - - Processed %1 of %2 (estimated) blocks of transaction history. - Behandlet %1 ud af %2 (estimeret) blokke af transaktionshistorikken. - Processed %1 blocks of transaction history. Behandlet %1 blokke af transaktionshistorikken. @@ -559,10 +518,6 @@ Adresse: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Tegnebog er <b>krypteret</b> og i øjeblikket <b>låst</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Der opstod en fatal fejl. Bitcoin kan ikke længere fortsætte sikkert og vil afslutte. - ClientModel @@ -598,8 +553,8 @@ Adresse: %4 Gebyr: - Low Output: - Lavt output: + Dust: + Støv: After Fee: @@ -690,8 +645,8 @@ Adresse: %4 Kopiér prioritet - Copy low output - Kopiér lavt output + Copy dust + Kopiér støv Copy change @@ -742,8 +697,8 @@ Adresse: %4 ingen - Dust - Støv + Can vary +/- %1 satoshi(s) per input. + Kan variere med +/- %1 satoshi per input. yes @@ -770,25 +725,13 @@ Adresse: %4 Transaktioner med højere prioritet har højere sansynlighed for at blive inkluderet i en blok. - This label turns red, if the priority is smaller than "medium". - Dette mærkat bliver rødt, hvis prioriteten er mindre end "medium". + This label turns red, if the priority is smaller than "medium". + Dette mærkat bliver rødt, hvis prioriteten er mindre end "medium". This label turns red, if any recipient receives an amount smaller than %1. Dette mærkat bliver rødt, hvis mindst én modtager et beløb mindre end %1. - - This means a fee of at least %1 is required. - Dette betyder, at et gebyr på mindst %1 er nødvendigt. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - Beløb under 0,546 gange det minimale videreførselsgebyr vises som støv. - - - This label turns red, if the change is smaller than %1. - Dette mærkat bliver rødt, hvis byttepengene er mindre end %1. - (no label) (ingen mærkat) @@ -841,12 +784,12 @@ Adresse: %4 Redigér afsendelsesadresse - The entered address "%1" is already in the address book. - Den indtastede adresse "%1" er allerede i adressebogen. + The entered address "%1" is already in the address book. + Den indtastede adresse "%1" er allerede i adressebogen. - The entered address "%1" is not a valid Bitcoin address. - Den indtastede adresse "%1" er ikke en gyldig Bitcoin-adresse. + The entered address "%1" is not a valid Bitcoin address. + Den indtastede adresse "%1" er ikke en gyldig Bitcoin-adresse. Could not unlock wallet. @@ -882,10 +825,6 @@ Adresse: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Bitcoin Core – tilvalg for kommandolinje - Bitcoin Core Bitcoin Core @@ -894,6 +833,18 @@ Adresse: %4 version version + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + Om Bitcoin Core + + + Command-line options + Kommandolinjetilvalg + Usage: Anvendelse: @@ -907,8 +858,8 @@ Adresse: %4 Brugergrænsefladeindstillinger - Set language, for example "de_DE" (default: system locale) - Angiv sprog, fx "da_DK" (standard: systemlokalitet) + Set language, for example "de_DE" (default: system locale) + Angiv sprog, fx "da_DK" (standard: systemlokalitet) Start minimized @@ -916,7 +867,7 @@ Adresse: %4 Set SSL root certificates for payment request (default: -system-) - Sæt SSL-rodcertifikater for betalingsforespørgsel (standard: -system-) + Sæt SSL-rodcertifikater for betalingsanmodning (standard: -system-) Show splash screen on startup (default: 1) @@ -954,12 +905,12 @@ Adresse: %4 Brug tilpasset mappe for data: - Bitcoin - Bitcoin + Bitcoin Core + Bitcoin Core - Error: Specified data directory "%1" can not be created. - Fejl: Angivet datamappe "%1" kan ikke oprettes. + Error: Specified data directory "%1" cannot be created. + Fejl: Angivet datamappe "%1" kan ikke oprettes. Error @@ -982,7 +933,7 @@ Adresse: %4 Open payment request from URI or file - Åbn betalingsforespørgsel fra URI eller fil + Åbn betalingsanmodning fra URI eller fil URI: @@ -990,11 +941,11 @@ Adresse: %4 Select payment request file - Vælg fil for betalingsforespørgsel + Vælg fil for betalingsanmodning Select payment request file to open - Vælg fil for betalingsforespørgsel til åbning + Vælg fil for betalingsanmodning til åbning @@ -1035,6 +986,14 @@ Adresse: %4 Number of script &verification threads Antallet af scriptverificeringstråde + + Accept connections from outside + Acceptér forbindelser udefra + + + Allow incoming connections + Tillad indkommende forbindelser + Connect to the Bitcoin network through a SOCKS proxy. Forbind til Bitcoin-netværket gennem en SOCKS-proxy. @@ -1049,11 +1008,11 @@ Adresse: %4 Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - Tredjeparts-URL'er (fx et blokhåndteringsværktøj), der vises i transaktionsfanen som genvejsmenupunkter. %s i URL'en erstattes med transaktionens hash. Flere URL'er separeres med en lodret streg |. + Tredjeparts-URL'er (fx et blokhåndteringsværktøj), der vises i transaktionsfanen som genvejsmenupunkter. %s i URL'en erstattes med transaktionens hash. Flere URL'er separeres med en lodret streg |. Third party transaction URLs - Tredjeparts-transaktions-URL'er + Tredjeparts-transaktions-URL'er Active command-line options that override above options: @@ -1115,14 +1074,6 @@ Adresse: %4 Port of the proxy (e.g. 9050) Port for proxyen (fx 9050) - - SOCKS &Version: - SOCKS-version - - - SOCKS version of the proxy (e.g. 5) - SOCKS-version for proxyen (fx 5) - &Window Vindue @@ -1163,14 +1114,6 @@ Adresse: %4 Choose the default subdivision unit to show in the interface and when sending coins. Vælg standard for underopdeling af enhed, som skal vises i brugergrænsefladen og ved afsendelse af bitcoins. - - Whether to show Bitcoin addresses in the transaction list or not. - Afgør hvorvidt Bitcoin-adresser skal vises i transaktionslisten eller ej. - - - &Display addresses in transaction list - Vis adresser i transaktionsliste - Whether to show coin control features or not. Hvorvidt egenskaber for coin-styring skal vises eller ej. @@ -1189,7 +1132,7 @@ Adresse: %4 none - ingeningen + ingen Confirm options reset @@ -1226,6 +1169,10 @@ Adresse: %4 Wallet Tegnebog + + Watch-only: + Kigge: + Available: Tilgængelig: @@ -1248,7 +1195,7 @@ Adresse: %4 Mined balance that has not yet matured - Udvunden saldo, som endnu ikke er modnet + Minet saldo, som endnu ikke er modnet Total: @@ -1258,6 +1205,22 @@ Adresse: %4 Your current total balance Din nuværende totale saldo + + Your current balance in watch-only addresses + Din nuværende saldo på kigge-adresser + + + Unconfirmed transactions to watch-only addresses + Ubekræftede transaktioner til kigge-adresser + + + Mined balance in watch-only addresses that has not yet matured + Minet saldo på kigge-adresser, som endnu ikke er modnet + + + Current total balance in watch-only addresses + Nuværende totalsaldo på kigge-adresser + <b>Recent transactions</b> <b>Nyeste transaktioner</b> @@ -1274,44 +1237,56 @@ Adresse: %4 URI-håndtering - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI kan ikke fortolkes! Dette kan skyldes en ugyldig Bitcoin-adresse eller misdannede URI-parametre. + Invalid payment address %1 + Ugyldig betalingsadresse %1 + + + Payment request rejected + Betalingsanmodning afvist + + + Payment request network doesn't match client network. + Netværk for betalingsanmodning stemmer ikke overens med klientens netværk. + + + Payment request has expired. + Betalingsanmodning er udløbet. + + + Payment request is not initialized. + Betalingsanmodning er ikke klargjort. Requested payment amount of %1 is too small (considered dust). - Forespurgt betalingsbeløb på %1 er for lille (regnes som støv). + Anmodet betalingsbeløb på %1 er for lille (regnes som støv). Payment request error - Fejl i betalingsforespørgsel + Fejl i betalingsanmodning Cannot start bitcoin: click-to-pay handler Kan ikke starte bitcoin: click-to-pay-håndtering - - Net manager warning - Net-håndterings-advarsel - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - Din aktuelle proxy understøtter ikke SOCKS5, hvilket kræves for betalingsforespørgsler via proxy. - Payment request fetch URL is invalid: %1 - Betalingsforespørgslens hentnings-URL er ugyldig: %1 + Hentnings-URL for betalingsanmodning er ugyldig: %1 + + + URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + URI kan ikke tolkes! Dette kan skyldes en ugyldig Bitcoin-adresse eller forkert udformede URL-parametre. Payment request file handling Filhåndtering for betalingsanmodninger - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - Betalingsanmodningsfil kan ikke indlæses eller bearbejdes! Dette kan skyldes en ugyldig betalingsanmodningsfil. + Payment request file cannot be read! This can be caused by an invalid payment request file. + Fil for betalingsanmodning kan ikke læses! Dette kan skyldes en ugyldig fil for betalingsanmodning. Unverified payment requests to custom payment scripts are unsupported. - Ikke-verificerede betalingsforespørgsler for tilpassede betalings-scripts understøttes ikke. + Ikke-verificerede betalingsanmodninger for tilpassede betalings-scripts understøttes ikke. Refund from %1 @@ -1322,8 +1297,8 @@ Adresse: %4 Fejl under kommunikation med %1: %2 - Payment request can not be parsed or processed! - Betalingsanmodning kan ikke fortolkes eller bearbejdes! + Payment request cannot be parsed! + Betalingsanmodning kan ikke tolkes! Bad response from server %1 @@ -1338,31 +1313,66 @@ Adresse: %4 Fejl i netværksforespørgsel + + PeerTableModel + + User Agent + Brugeragent + + + Address/Hostname + Adresse/værtsnavn + + + Ping Time + Ping-tid + + QObject - Bitcoin - Bitcoin + Amount + Beløb - Error: Specified data directory "%1" does not exist. - Fejl: Angivet datamappe "%1" eksisterer ikke. + Enter a Bitcoin address (e.g. %1) + Indtast en Bitcoin-adresse (fx %1) - Error: Cannot parse configuration file: %1. Only use key=value syntax. - Fejl: Kan ikke fortolke konfigurationsfil: %1. Brug kun syntaksen nøgle=værdi. + %1 d + %1 d - Error: Invalid combination of -regtest and -testnet. - Fejl: Ugyldig kombination af -regtest og -testnet. + %1 h + %1 t - Bitcoin Core didn't yet exit safely... - Bitcoin Core blev ikke afsluttet på sikker vis … + %1 m + %1 m - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Indtast en Bitcoin-adresse (fx 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + %1 s + %1 s + + + NETWORK + NETVÆRK + + + UNKNOWN + UKENDT + + + None + Ingen + + + N/A + N/A + + + %1 ms + %1 ms @@ -1414,6 +1424,10 @@ Adresse: %4 Using OpenSSL version Anvender OpenSSL-version + + Using BerkeleyDB version + Bruger BerkeleyDB version + Startup time Opstartstidspunkt @@ -1439,8 +1453,76 @@ Adresse: %4 Nuværende antal blokke - Estimated total blocks - Estimeret antal blokke + Received + Modtaget + + + Sent + Sendt + + + &Peers + Andre knuder + + + Select a peer to view detailed information. + Vælg en anden knude for at se detaljeret information. + + + Direction + Retning + + + Version + Version + + + User Agent + Brugeragent + + + Services + Tjenester + + + Sync Node + Synkroniseringsknude + + + Starting Height + Starthøjde + + + Sync Height + Synkroniseringshøjde + + + Ban Score + Bandlysningsscore + + + Connection Time + Forbindelsestid + + + Last Send + Seneste afsendelse + + + Last Receive + Seneste modtagelse + + + Bytes Sent + Byte sendt + + + Bytes Received + Byte modtaget + + + Ping Time + Ping-tid Last block time @@ -1519,16 +1601,36 @@ Adresse: %4 %1 GB - %1 m - %1 m + via %1 + via %1 - %1 h - %1 t + never + aldrig - %1 h %2 m - %1 t %2 m + Inbound + Indkommende + + + Outbound + Udgående + + + Yes + Ja + + + No + Nej + + + Unknown + Ukendt + + + Fetching... + Henter … @@ -1547,7 +1649,7 @@ Adresse: %4 Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - Genbrug en af de tidligere brugte modtagelsesadresser. Genbrug af adresser har indflydelse på sikkerhed og privatliv. Brug ikke dette med mindre du genskaber en betalingsforespørgsel fra tidligere. + Genbrug en af de tidligere brugte modtagelsesadresser. Genbrug af adresser har indflydelse på sikkerhed og privatliv. Brug ikke dette med mindre du genskaber en betalingsanmodning fra tidligere. R&euse an existing receiving address (not recommended) @@ -1555,7 +1657,7 @@ Adresse: %4 An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - En valgfri besked, der føjes til betalingsanmodningen, og som vil vises, når anmodningen åbnes. Bemærk: Beskeden vil ikke sendes med betalingen over Bitcoin-netværket. + En valgfri besked, der føjes til betalingsanmodningen, og som vil vises, når anmodningen åbnes. Bemærk: Beskeden vil ikke sendes sammen med betalingen over Bitcoin-netværket. An optional label to associate with the new receiving address. @@ -1587,7 +1689,7 @@ Adresse: %4 Show the selected request (does the same as double clicking an entry) - Vis den valgte forespørgsel (gør det samme som dobbeltklik på en indgang) + Vis den valgte anmodning (gør det samme som dobbeltklik på en indgang) Show @@ -1742,10 +1844,6 @@ Adresse: %4 Fee: Gebyr: - - Low Output: - Lavt output: - After Fee: Efter gebyr: @@ -1774,6 +1872,10 @@ Adresse: %4 Clear all fields of the form. Ryd alle felter af formen. + + Dust: + Støv: + Clear &All Ryd alle @@ -1822,10 +1924,6 @@ Adresse: %4 Copy priority Kopiér prioritet - - Copy low output - Kopiér lavt output - Copy change Kopiér byttepenge @@ -1878,6 +1976,10 @@ Adresse: %4 Warning: Unknown change address Advarsel: Ukendt byttepengeadresse + + Copy dust + Kopiér støv + Are you sure you want to send? Er du sikker på, at du vil sende? @@ -1886,14 +1988,6 @@ Adresse: %4 added as transaction fee tilføjet som transaktionsgebyr - - Payment request expired - Betalingsforespørgsel udløbet - - - Invalid payment address %1 - Ugyldig betalingsadresse %1 - SendCoinsEntry @@ -1905,10 +1999,6 @@ Adresse: %4 Pay &To: Betal til: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Bitcoin-adressen som betalingen skal sendes til (fx 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Indtast en mærkat for denne adresse for at føje den til din adressebog @@ -1925,6 +2015,10 @@ Adresse: %4 This is a normal payment. Dette er en normal betaling. + + The Bitcoin address to send the payment to + Bitcoin-adresse, som betalingen skal sendes til + Alt+A Alt+A @@ -1947,7 +2041,7 @@ Adresse: %4 This is a verified payment request. - Dette er en verificeret betalingsforespørgsel. + Dette er en verificeret betalingsanmodning. Enter a label for this address to add it to the list of used addresses @@ -1955,11 +2049,11 @@ Adresse: %4 A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - En besked, som blev føjet til "bitcon:"-URI'en, som vil gemmes med transaktionen til din reference. Bemærk: Denne besked vil ikke blive sendt over Bitcoin-netværket. + En besked, som blev føjet til "bitcon:"-URI'en, som vil gemmes med transaktionen til din reference. Bemærk: Denne besked vil ikke blive sendt over Bitcoin-netværket. This is an unverified payment request. - Dette er en ikke-verificeret betalingsforespørgsel. + Dette er en ikke-verificeret betalingsanmodning. Pay To: @@ -1996,8 +2090,8 @@ Adresse: %4 Du kan underskrive beskeder med dine Bitcoin-adresser for at bevise, at de tilhører dig. Pas på ikke at underskrive noget vagt, da phisingangreb kan narre dig til at overdrage din identitet. Underskriv kun fuldt detaljerede udsagn, du er enig i. - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Bitcoin-adressen som beskeden skal underskrives med (fx 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address to sign the message with + Bitcoin-adresse, som beskeden skal signeres med Choose previously used address @@ -2037,7 +2131,7 @@ Adresse: %4 Reset all sign message fields - Nulstil alle "underskriv besked"-felter + Nulstil alle "underskriv besked"-felter Clear &All @@ -2052,8 +2146,8 @@ Adresse: %4 Indtast herunder den underskrivende adresse, beskeden (inkludér linjeskift, mellemrum mv. nøjagtigt, som de fremgår) og underskriften for at verificere beskeden. Vær forsigtig med ikke at lægge mere i underskriften end besked selv, så du undgår at blive narret af et man-in-the-middle-angreb. - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Bitcoin-adressen som beskeden er underskrevet med (fx 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address the message was signed with + Bitcoin-adressen, som beskeden blev signeret med Verify the message to ensure it was signed with the specified Bitcoin address @@ -2065,15 +2159,11 @@ Adresse: %4 Reset all verify message fields - Nulstil alle "verificér besked"-felter + Nulstil alle "verificér besked"-felter - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Indtast en Bitcoin-adresse (fx 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Klik "Underskriv besked" for at generere underskriften + Click "Sign Message" to generate signature + Klik "Underskriv besked" for at generere underskriften The entered address is invalid. @@ -2200,6 +2290,10 @@ Adresse: %4 own address egen adresse + + watch-only + kigge + label mærkat @@ -2220,6 +2314,14 @@ Adresse: %4 Debit Debet + + Total debit + Total debet + + + Total credit + Total kredit + Transaction fee Transaktionsgebyr @@ -2245,8 +2347,8 @@ Adresse: %4 Forretningsdrivende - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - Udvundne bitcoins skal modne %1 blokke, før de kan bruges. Da du genererede denne blok, blev den udsendt til netværket for at blive føjet til blokkæden. Hvis det ikke lykkes at få den i kæden, vil dens tilstand ændres til "ikke accepteret", og den vil ikke kunne bruges. Dette kan ske nu og da, hvis en anden knude udvinder en blok inden for nogle få sekunder fra din. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Minede bitcoins skal modne %1 blokke, før de kan bruges. Da du genererede denne blok, blev den udsendt til netværket for at blive føjet til blokkæden. Hvis det ikke lykkes at få den i kæden, vil dens tilstand ændres til "ikke accepteret", og den vil ikke kunne bruges. Dette kan ske nu og da, hvis en anden knude udvinder en blok inden for nogle få sekunder fra din. Debug information @@ -2310,10 +2412,6 @@ Adresse: %4 Address Adresse - - Amount - Beløb - Immature (%1 confirmations, will be available after %2) Umoden (%1 bekræftelser; vil være tilgængelig efter %2) @@ -2372,7 +2470,7 @@ Adresse: %4 Mined - Udvundne + Minet (n/a) @@ -2443,7 +2541,7 @@ Adresse: %4 Mined - Udvundne + Minet Other @@ -2525,10 +2623,6 @@ Adresse: %4 Address Adresse - - Amount - Beløb - ID ID @@ -2542,6 +2636,13 @@ Adresse: %4 til + + UnitDisplayStatusBarControl + + Unit to show amounts in. Click to select another unit. + Enhed, som beløb vises i. Klik for at vælge en anden enhed. + + WalletFrame @@ -2593,18 +2694,6 @@ Adresse: %4 bitcoin-core - - Usage: - Anvendelse: - - - List commands - Liste over kommandoer - - - Get help for a command - Få hjælp til en kommando - Options: Indstillinger: @@ -2627,7 +2716,7 @@ Adresse: %4 Maintain at most <n> connections to peers (default: 125) - Oprethold højest <n> forbindelser til andre i netværket (standard: 125) + Oprethold højest <n> forbindelser til andre knuder i netværket (standard: 125) Connect to a node to retrieve peer addresses, and disconnect @@ -2639,15 +2728,11 @@ Adresse: %4 Threshold for disconnecting misbehaving peers (default: 100) - Grænse for afbrydelse til dårlige forbindelser (standard: 100) + Grænse for frakobling fra andre knuder, der opfører sig dårligt (standard: 100) Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Antal sekunder dårlige forbindelser skal vente før reetablering (standard: 86400) - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Der opstod en fejl ved angivelse af RPC-porten %u til at lytte på IPv4: %s + Antal sekunder, som andre knuder der opfører sig dårligt, skal vente før reetablering af forbindelse (standard: 86400) Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) @@ -2657,10 +2742,6 @@ Adresse: %4 Accept command line and JSON-RPC commands Acceptér kommandolinje- og JSON-RPC-kommandoer - - Bitcoin Core RPC client version - Bitcoin Core RPC-klient-version - Run in the background as a daemon and accept commands Kør i baggrunden som en service, og acceptér kommandoer @@ -2683,7 +2764,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, du skal angive en RPC-adgangskode i konfigurationsfilen: %s @@ -2694,17 +2775,13 @@ rpcpassword=%s Brugernavnet og adgangskode MÅ IKKE være det samme. Hvis filen ikke eksisterer, opret den og giv ingen andre end ejeren læserettighed. Det anbefales også at angive alertnotify, så du påmindes om problemer; -fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Accepterede krypteringer (standard: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Der opstod en fejl ved angivelse af RPC-porten %u til at lytte på IPv6, falder tilbage til IPv4: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Tildel til den givne adresse og lyt altid på den. Brug [vært]:port-notation for IPv6 @@ -2714,17 +2791,13 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Rate-begræns kontinuerligt frie transaktioner til <n>*1000 byte i minuttet (standard:15) - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Start regressionstesttilstand, som bruger en speciel kæde, hvor blokke kan løses med det samme. Dette er tiltænkt til testværktøjer for regression of programudvikling. + Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup + Slet alle transaktioner i tegnebogen og genskab kun disse dele af blokkæden gennem -rescan under opstart Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Start regressionstesttilstand, som bruger en speciel kæde, hvor blokke kan løses med det samme. - - Error: Listening for incoming connections failed (listen returned error %d) - Fejl: Lytning efter indkommende forbindelser mislykkedes (lytning returnerede fejl %d) - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Fejl: Transaktionen blev afvist. Dette kan ske, hvis nogle af dine bitcoins i din tegnebog allerede er brugt, som hvis du brugte en kopi af wallet.dat og dine bitcoins er blevet brugt i kopien, men ikke er markeret som brugt her. @@ -2737,10 +2810,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Udfør kommando, når en transaktion i tegnebogen ændres (%s i kommandoen erstattes med TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - Gebyrer mindre end dette opfattes som nul-gebyr (for oprettelse af transaktioner) (standard: - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) Flyt databaseaktivitet fra hukommelsespulje til disklog hver <n> megabytes (standard: 100) @@ -2771,23 +2840,19 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Brug separat SOCS5-proxy for at nå andre knuder via Tor skjulte tjenester (standard: -proxy) + Brug separat SOCS5-proxy for at nå andre knuder via tjenester skjult med Tor (standard: -proxy) Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Advarsel: -paytxfee er sat meget højt! Dette er det gebyr du vil betale, hvis du sender en transaktion. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Advarsel: Undersøg venligst, at din computers dato og klokkeslæt er korrekt indstillet! Hvis der er fejl i disse, vil Bitcoin ikke fungere korrekt. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Advarsel: Netværket ser ikke ud til at være fuldt ud enige! Enkelte minere ser ud til at opleve problemer. Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - Advarsel: Vi ser ikke ud til at være fuldt ud enige med andre noder! Du kan være nødt til at opgradere, eller andre noder kan være nødt til at opgradere. + Advarsel: Vi ser ikke ud til at være fuldt ud enige med andre knuder! Du kan være nødt til at opgradere, eller andre knuder kan være nødt til at opgradere. Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. @@ -2813,30 +2878,14 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Attempt to recover private keys from a corrupt wallet.dat Forsøg at genskabe private nøgler fra ødelagt wallet.dat - - Bitcoin Core Daemon - Bitcoin Core-tjeneste - Block creation options: Blokoprettelsestilvalg: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - Ryd liste over transaktioner i tegnebog (diagnoseværktøj; medfører -rescan) - Connect only to the specified node(s) Tilslut kun til de(n) angivne knude(r) - - Connect through SOCKS proxy - Forbind gennem SOCKS-proxy - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - Forbind til JSON-RPC på <port> (standard: 8332 eller testnetværk: 18332) - Connection options: Tilvalg for forbindelser: @@ -2937,18 +2986,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Failed to write undo data Skrivning af genskabelsesdata mislykkedes - - Fee per kB to add to transactions you send - Føj gebyr pr. kB til transaktioner, du sender - - - Fees smaller than this are considered zero fee (for relaying) (default: - Gebyrer mindre end dette opfattes som nul-gebyr (for videreførsler) (standard: - - - Find peers using DNS lookup (default: 1 unless -connect) - Find andre knuder ved DNS-opslag (standard: 1 hvis ikke -connect) - Force safe mode (default: 0) Gennemtving sikker tilstand (standard: 0) @@ -2974,8 +3011,8 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Ukorrekt eller ingen tilblivelsesblok fundet. Forkert datamappe for netværk? - Invalid -onion address: '%s' - Ugyldig -onion adresse: "%s" + Invalid -onion address: '%s' + Ugyldig -onion adresse: "%s" Not enough file descriptors available. @@ -2985,18 +3022,10 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Prepend debug output with timestamp (default: 1) Føj tidsstempel foran fejlsøgningsoutput (standard: 1) - - RPC client options: - Tilvalg for RPC-klient: - Rebuild block chain index from current blk000??.dat files Genbyg blokkædeindeks fra nuværende blk000??.dat filer - - Select SOCKS version for -proxy (4 or 5, default: 5) - Vælg SOCKS-version for -proxy (4 eller 5, standard: 5) - Set database cache size in megabytes (%d to %d, default: %d) Sæt cache-størrelse for database i megabytes (%d til %d; standard: %d) @@ -3018,12 +3047,12 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Brug ubekræftede byttepenge under afsendelse af transaktioner (standard: 1) - This is intended for regression testing tools and app development. - This is intended for regression testing tools and app development. + Stop running after importing blocks from disk (default: 0) + Stop kørsel efter import af blokke fra disk (standard: 0) - Usage (deprecated, use bitcoin-cli): - Brug (forældet, brug bitcoin-cli): + This is intended for regression testing tools and app development. + This is intended for regression testing tools and app development. Verifying blocks... @@ -3033,22 +3062,14 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Verifying wallet... Verificerer tegnebog … - - Wait for RPC server to start - Vent på opstart af RPC-server - Wallet %s resides outside data directory %s - Tegnebog %1 findes uden for datamappe %s + Tegnebog %s findes uden for datamappe %s Wallet options: Tilvalg for tegnebog: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - Advarsel: Forældet argument -debugnet ignoreret; brug -debug=net - You need to rebuild the database using -reindex to change -txindex Du er nødt til at genopbygge databasen ved hjælp af -reindex for at ændre -txindex @@ -3057,33 +3078,157 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Imports blocks from external blk000??.dat file Importerer blokke fra ekstern blk000??.dat fil + + (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + (standard: 1, 1 = behold metadata for transaktion, fx kontoindehaver og information om betalingsanmodning, 2 = drop metadata for transaktion) + + + Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times + Tillad JSON-RPC-forbindelser fra angivet kilde. Gyldig for <ip> er en enkelt IP (fx 1.2.3.4), et netværk/netmaske (fx 1.2.3.4/255.255.255.0) eller et netværk/CIDR (fx 1.2.3.4/24). Dette tilvalg kan angives flere gange + + + An error occurred while setting up the RPC address %s port %u for listening: %s + Der opstod en fejl under opsætning af RPC-adresse %s port %u for lytning: %s + + + Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6 + Tildel given adresse og sæt andre knuder, der forbinder til den, på hvidliste. Brug [vært]:port notation for IPv6 + + + Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces) + Tildel til den givne adresse for at lytte efter JSON-RPC-forbindelser. Brug [vært]:port-notation for IPv6. Denne valgmulighed kan angives flere gange (standard: tildel til alle grænseflader) + Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. Kan ikke opnå en lås på datamappe %s. Bitcoin Core kører sansynligvis allerede. + + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) + Opret nye filer med systemstandard for rettigheder i stedet for umask 077 (kun virksomt med tegnebogsfunktionalitet slået fra) + + + Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + Distribueret under MIT/X11-softwarelicensen. Se medfølgende fil COPYING eller <http://www.opensource.org/licenses/mit-license.php>. + + + Error: Listening for incoming connections failed (listen returned error %s) + Fejl: Lytning efter indkommende forbindelser mislykkedes (lytning resultarede i fejl %s) + + + Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + Fejl: Ikke understøttet argument -socks blev fundet. Det er ikke muligt at angive SOCKS-version længere, da kun SOCKS5-proxier er understøttet. + + + Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) + Udfør kommando når en netværkstransaktion genspenderer input fra tegnebogstransaktion (%s=transaktions-ID fra genspendering, %t=transaktions-ID fra tegnebog) + Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Udfør kommando, når en relevant alarm modtages eller vi ser en virkelig lang udsplitning (%s i cmd erstattes af besked) + + Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) + Gebyrer (i BTC/Kb) mindre end dette opfattes som nulgebyr for videresendelse (standard: %s) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) + Gebyrer (i BTC/Kb) mindre end dette opfattes som nulgebyr for oprettelse af transaktion (standard: %s) + + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) + Hvis paytxfee ikke er angivet, inkludér da nok gebyr til at transaktioner gennemsnitligt bekræftes inden for n blokke (standard: 1) + Output debugging information (default: 0, supplying <category> is optional) Udskriv fejlsøgningsinformation (standard: 0, angivelse af <kategori> er valgfri) + + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) + Forespørgsel + Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Sæt maksimumstørrelse for højprioritet/lavgebyr-transaktioner i byte (standard: %d) + + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. + Dette produkt indeholder software, der er udviklet af OpenSSL-projektet for brug i OpenSSL-værktøjskassen <https://www.openssl.org/>, samt kryptografisk software, der er skrevet af Eric Young, samt UPnP-software, der er skrevet af Thomas Bernard. + + + Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + Advarsel: Undersøg venligst at din computers dato og klokkeslet er korrekt indstillet! Hvis der er fejl i disse vil Bitcoin Core ikke fungere korrekt. + + + Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. + Sæt andre knuder, der forbinder fra den angivne netmaske eller ip, på hvidliste. Kan angives flere gange. + + + Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway + Andre knuder på hvidliste kan ikke DoS-bandlyses, og deres transaktioner videresendes altid, selv hvis de allerede er i mempool'en. Brugbart til fx et adgangspunkt + + + Always query for peer addresses via DNS lookup (default: 0) + Forespørg altid adresser på andre knuder via DNS-opslag (default: 0) + + + Cannot resolve -whitebind address: '%s' + Kan ikke løse -whitebind adresse: "%s" + + + Connect through SOCKS5 proxy + Forbind gennem SOCKS5-proxy + + + Copyright (C) 2009-%i The Bitcoin Core Developers + Ophavsret © 2009-%i Udviklerne af Bitcoin Core + + + Could not parse -rpcbind value %s as network address + Kunne ikke tolke -rpcbind-værdi %s som en netværksadresse + + + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core + Fejl ved indlæsning af wallet.dat: Tegnebog kræver en nyere version af Bitcoin Core + + + Error: Unsupported argument -tor found, use -onion. + Fejl: Ikke understøttet argument -tor fundet, brug -onion. + + + Fee (in BTC/kB) to add to transactions you send (default: %s) + Gebyr (i BTC/kB) som skal føjes til transaktioner, du sender (standard: %s) + + + Include IP addresses in debug output (default: 0) + Inkludér IP-adresser i fejlretningsoutput (standard: 0) + Information Information - Invalid amount for -minrelaytxfee=<amount>: '%s' - Ugyldigt beløb til -minrelaytxfee=<beløb>: "%s" + Initialization sanity check failed. Bitcoin Core is shutting down. + Sundhedstjek under klargøring mislykkedes. Bitcoin Core lukker ned. - Invalid amount for -mintxfee=<amount>: '%s' - Ugyldigt beløb til -mintxfee=<beløb>: "%s" + Invalid amount for -minrelaytxfee=<amount>: '%s' + Ugyldigt beløb til -minrelaytxfee=<beløb>: "%s" + + + Invalid amount for -mintxfee=<amount>: '%s' + Ugyldigt beløb til -mintxfee=<beløb>: "%s" + + + Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) + Ugyldigt beløb for -paytxfee=<beløb>: "%s" (skal være mindst %s) + + + Invalid netmask specified in -whitelist: '%s' + Ugyldig netmaske angivet i -whitelist: "%s" + + + Keep at most <n> unconnectable blocks in memory (default: %u) + Behold højest <n> uforbindelige blokke i hukommelsen (standard: %u) Limit size of signature cache to <n> entries (default: 50000) @@ -3105,6 +3250,14 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) Maksimum for afsendelsesbuffer pr. forbindelse, <n>*1000 byte (standard: 1000) + + Need to specify a port with -whitebind: '%s' + Nødt til at angive en port med -whitebinde: "%s" + + + Node relay options: + Videresendelsesvalgmuligheder for knude: + Only accept block chain matching built-in checkpoints (default: 1) Acceptér kun blokkæde, som matcher indbyggede kontrolposter (standard: 1) @@ -3137,18 +3290,18 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Randomly fuzz 1 of every <n> network messages Slør tilfældigt 1 ud af hver <n> netværksbeskeder + + Relay and mine data carrier transactions (default: 1) + Videresend og mine databærer-transaktioner (standard: 1) + + + Relay non-P2SH multisig (default: 1) + Videresend ikke-P2SH multisig (standard: 1) + Run a thread to flush wallet periodically (default: 1) Kør en tråd for at rydde tegnebog periodisk (standard: 1) - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL-indstillinger: (se Bitcoin Wiki for SSL-opsætningsinstruktioner) - - - Send command to Bitcoin Core - Send kommando til Bitcoin Core - Send trace/debug info to console instead of debug.log file Send sporings-/fejlsøgningsinformation til konsollen i stedet for debug.log filen @@ -3165,10 +3318,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Show all debugging options (usage: --help -help-debug) Vis alle tilvalg for fejlsøgning (brug: --help -help-debug) - - Show benchmark information (default: 0) - Vis information om ydelsesmåling (standard: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Formindsk debug.log filen ved klientopstart (standard: 1 hvis ikke -debug) @@ -3181,14 +3330,14 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Specify connection timeout in milliseconds (default: 5000) Angiv tilslutningstimeout i millisekunder (standard: 5000) - - Start Bitcoin Core Daemon - Start Bitcoin Core-tjeneste - System error: Systemfejl: + + This is experimental software. + Dette er eksperimentelt software. + Transaction amount too small Transaktionsbeløb er for lavt @@ -3201,6 +3350,10 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Transaction too large Transaktionen er for stor + + Unable to bind to %s on this computer (bind returned error %s) + Ikke i stand til at tildele til %s på denne computer (bind returnerede fejl %s) + Use UPnP to map the listening port (default: 0) Brug UPnP til at konfigurere den lyttende port (standard: 0) @@ -3213,6 +3366,10 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Username for JSON-RPC connections Brugernavn til JSON-RPC-forbindelser + + Wallet needed to be rewritten: restart Bitcoin Core to complete + Det var nødvendigt at genskrive tegnebogen: genstart Bitcoin Core for at gennemføre + Warning Advarsel @@ -3221,6 +3378,14 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Warning: This version is obsolete, upgrade required! Advarsel: Denne version er forældet, opgradering påkrævet! + + Warning: Unsupported argument -benchmark ignored, use -debug=bench. + Advarsel: Ikke understøttet argument -benchmark ignoreret, brug -debug=bench. + + + Warning: Unsupported argument -debugnet ignored, use -debug=net. + Advarsel: Ikke understøttet argument -debugnet ignoreret, brug -debug=net. + Zapping all transactions from wallet... Zapper alle transaktioner fra tegnebog … @@ -3229,10 +3394,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com on startup under opstart - - version - version - wallet.dat corrupt, salvage failed wallet.dat ødelagt, redning af data mislykkedes @@ -3241,14 +3402,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Password for JSON-RPC connections Adgangskode til JSON-RPC-forbindelser - - Allow JSON-RPC connections from specified IP address - Tillad JSON-RPC-forbindelser fra bestemt IP-adresse - - - Send commands to node running on <ip> (default: 127.0.0.1) - Send kommandoer til knude, der kører på <ip> (standard: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Udfør kommando, når den bedste blok ændres (%s i kommandoen erstattes med blokhash) @@ -3281,10 +3434,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com This help message Denne hjælpebesked - - Unable to bind to %s on this computer (bind returned error %d, %s) - Kunne ikke tildele %s på denne computer (bind returnerede fejl %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Tillad DNS-opslag for -addnode, -seednode og -connect @@ -3297,41 +3446,29 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error loading wallet.dat: Wallet corrupted Fejl ved indlæsning af wallet.dat: Tegnebog ødelagt - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Fejl ved indlæsning af wallet.dat: Tegnebog kræver en nyere version af Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - Det var nødvendigt at genskrive tegnebogen: genstart Bitcoin for at gennemføre - Error loading wallet.dat Fejl ved indlæsning af wallet.dat - Invalid -proxy address: '%s' - Ugyldig -proxy adresse: "%s" + Invalid -proxy address: '%s' + Ugyldig -proxy adresse: "%s" - Unknown network specified in -onlynet: '%s' - Ukendt netværk anført i -onlynet: "%s" + Unknown network specified in -onlynet: '%s' + Ukendt netværk anført i -onlynet: "%s" - Unknown -socks proxy version requested: %i - Ukendt -socks proxy-version: %i + Cannot resolve -bind address: '%s' + Kan ikke finde -bind adressen: "%s" - Cannot resolve -bind address: '%s' - Kan ikke finde -bind adressen: "%s" + Cannot resolve -externalip address: '%s' + Kan ikke finde -externalip adressen: "%s" - Cannot resolve -externalip address: '%s' - Kan ikke finde -externalip adressen: "%s" - - - Invalid amount for -paytxfee=<amount>: '%s' - Ugyldigt beløb for -paytxfee=<beløb>: "%s" + Invalid amount for -paytxfee=<amount>: '%s' + Ugyldigt beløb for -paytxfee=<beløb>: "%s" Invalid amount @@ -3377,13 +3514,5 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error Fejl - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Du skal angive rpcpassword=<adgangskode> i konfigurationsfilen: -%s -Hvis filen ikke eksisterer, opret den og giv ingen andre end ejeren læserettighed. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_de.ts b/src/qt/locale/bitcoin_de.ts index 888b48c251..667f0eb239 100644 --- a/src/qt/locale/bitcoin_de.ts +++ b/src/qt/locale/bitcoin_de.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - Über Bitcoin Core - - - <b>Bitcoin Core</b> version - <b>"Bitcoin Core"</b>-Version - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Dies ist experimentelle Software. - -Veröffentlicht unter der MIT/X11-Softwarelizenz, siehe beiligende Datei COPYING oder http://www.opensource.org/licenses/mit-license.php. - -Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Verwendung im OpenSSL-Toolkit (https://www.openssl.org) entwickelt wird, sowie von Eric Young (eay@cryptsoft.com) geschriebene kryptographische Software und von Thomas Bernard geschriebene UPnP-Software. - - - Copyright - Urheberrecht - - - The Bitcoin Core developers - Die "Bitcoin Core"-Entwickler - - - (%1-bit) - (%1-Bit) - - + AddressBookPage @@ -104,11 +67,11 @@ Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Verwendung im Open These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - Dies sind ihre Bitcoin-Adressen zum Tätigen von Überweisungen. Bitte prüfen Sie den Betrag und die Empfangsadresse, bevor Sie Bitcoins überweisen. + Dies sind Ihre Bitcoin-Adressen zum Tätigen von Überweisungen. Bitte prüfen Sie den Betrag und die Empfangsadresse, bevor Sie Bitcoins überweisen. These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - Dies sind ihre Bitcoin-Adressen zum Empfangen von Zahlungen. Es wird empfohlen für jede Transaktion eine neue Empfangsadresse zu verwenden. + Dies sind Ihre Bitcoin-Adressen zum Empfangen von Zahlungen. Es wird empfohlen für jede Transaktion eine neue Empfangsadresse zu verwenden. Copy &Label @@ -131,8 +94,8 @@ Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Verwendung im Open Exportieren fehlgeschlagen - There was an error trying to save the address list to %1. - Beim Speichern der Adressliste nach %1 ist ein Fehler aufgetreten. + There was an error trying to save the address list to %1. Please try again. + Beim Speichern der Adressliste nach %1 ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut. @@ -166,11 +129,7 @@ Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Verwendung im Open Repeat new passphrase - Neue Passphrase wiederholen - - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Geben Sie die neue Passphrase für die Wallet ein.<br>Bitte benutzen Sie eine Passphrase bestehend aus <b>10 oder mehr zufälligen Zeichen</b> oder <b>8 oder mehr Wörtern</b>. + Neue Passphrase bestätigen Encrypt wallet @@ -178,7 +137,7 @@ Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Verwendung im Open This operation needs your wallet passphrase to unlock the wallet. - Dieser Vorgang benötigt ihre Passphrase, um die Wallet zu entsperren. + Dieser Vorgang benötigt Ihre Passphrase, um die Wallet zu entsperren. Unlock wallet @@ -186,7 +145,7 @@ Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Verwendung im Open This operation needs your wallet passphrase to decrypt the wallet. - Dieser Vorgang benötigt ihre Passphrase, um die Wallet zu entschlüsseln. + Dieser Vorgang benötigt Ihre Passphrase, um die Wallet zu entschlüsseln. Decrypt wallet @@ -206,11 +165,11 @@ Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Verwendung im Open Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - Warnung: Wenn Sie ihre Wallet verschlüsseln und ihre Passphrase verlieren, werden Sie <b>alle ihre Bitcoins verlieren</b>! + Warnung: Wenn Sie Ihre Wallet verschlüsseln und Ihre Passphrase verlieren, werden Sie <b>alle Ihre Bitcoins verlieren</b>! Are you sure you wish to encrypt your wallet? - Sind Sie sich sicher, dass Sie ihre Wallet verschlüsseln möchten? + Sind Sie sich sicher, dass Sie Ihre Wallet verschlüsseln möchten? 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. @@ -224,9 +183,13 @@ Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Verwendung im Open Wallet encrypted Wallet verschlüsselt + + 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>. + Geben Sie die neue Passphrase für die Wallet ein.<br>Bitte benutzen Sie eine Passphrase bestehend aus <b>zehn oder mehr zufälligen Zeichen</b> oder <b>acht oder mehr Wörtern</b>. + Bitcoin 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. - Bitcoin wird jetzt beendet, um den Verschlüsselungsprozess abzuschließen. Bitte beachten Sie, dass die Wallet-Verschlüsselung nicht vollständig vor Diebstahl ihrer Bitcoins durch Schadsoftware schützt, die ihren Computer befällt. + Bitcoin wird jetzt beendet, um den Verschlüsselungsprozess abzuschließen. Bitte beachten Sie, dass die Wallet-Verschlüsselung nicht vollständig vor Diebstahl Ihrer Bitcoins durch Schadprogramme schützt, die Ihren Computer befällt. Wallet encryption failed @@ -295,10 +258,6 @@ Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Verwendung im Open Quit application Anwendung beenden - - Show information about Bitcoin - Informationen über Bitcoin anzeigen - About &Qt Über &Qt @@ -335,6 +294,10 @@ Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Verwendung im Open Open &URI... &URI öffnen... + + Bitcoin Core client + "Bitcoin Core"-Client + Importing blocks from disk... Importiere Blöcke von Datenträger... @@ -387,6 +350,10 @@ Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Verwendung im Open &Receive &Empfangen + + Show information about Bitcoin Core + Informationen über Bitcoin Core anzeigen + &Show / Hide &Anzeigen / Verstecken @@ -397,11 +364,11 @@ Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Verwendung im Open Encrypt the private keys that belong to your wallet - Verschlüsselt die zu ihrer Wallet gehörenden privaten Schlüssel + Verschlüsselt die zu Ihrer Wallet gehörenden privaten Schlüssel Sign messages with your Bitcoin addresses to prove you own them - Nachrichten signieren, um den Besitz ihrer Bitcoin-Adressen zu beweisen + Nachrichten signieren, um den Besitz Ihrer Bitcoin-Adressen zu beweisen Verify messages to ensure they were signed with specified Bitcoin addresses @@ -433,7 +400,7 @@ Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Verwendung im Open Request payments (generates QR codes and bitcoin: URIs) - Zahlungen anfordern (erzeugt QR-Codes und "bitcoin:"-URIs) + Zahlungen anfordern (erzeugt QR-Codes und "bitcoin:"-URIs) &About Bitcoin Core @@ -449,7 +416,7 @@ Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Verwendung im Open Open a bitcoin: URI or payment request - Eine "bitcoin:"-URI oder Zahlungsanforderung öffnen + Eine "bitcoin:"-URI oder Zahlungsanforderung öffnen &Command-line options @@ -457,11 +424,7 @@ Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Verwendung im Open Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - Zeige den "Bitcoin Core"-Hilfetext, um eine Liste mit möglichen Kommandozeilenoptionen zu erhalten - - - Bitcoin client - Bitcoin-Client + Zeige den "Bitcoin Core"-Hilfetext, um eine Liste mit möglichen Kommandozeilenoptionen zu erhalten %n active connection(s) to Bitcoin network @@ -471,10 +434,6 @@ Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Verwendung im Open No block source available... Keine Blockquelle verfügbar... - - Processed %1 of %2 (estimated) blocks of transaction history. - %1 von (geschätzten) %2 Blöcken des Transaktionsverlaufs verarbeitet. - Processed %1 blocks of transaction history. %1 Blöcke des Transaktionsverlaufs verarbeitet. @@ -558,10 +517,6 @@ Adresse: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Wallet ist <b>verschlüsselt</b> und aktuell <b>gesperrt</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Ein schwerer Fehler ist aufgetreten. Bitcoin kann nicht stabil weiter ausgeführt werden und wird beendet. - ClientModel @@ -574,7 +529,7 @@ Adresse: %4 CoinControlDialog Coin Control Address Selection - "Coin Control"-Adressauswahl + "Coin Control"-Adressauswahl Quantity: @@ -597,8 +552,8 @@ Adresse: %4 Gebühr: - Low Output: - Zu geringer Ausgabebetrag: + Dust: + "Dust": After Fee: @@ -689,8 +644,8 @@ Adresse: %4 Priorität kopieren - Copy low output - Zu geringen Ausgabebetrag kopieren + Copy dust + "Dust" kopieren Copy change @@ -741,8 +696,8 @@ Adresse: %4 keine - Dust - "Dust" + Can vary +/- %1 satoshi(s) per input. + Kann pro Eingabe um +/- %1 Satoshi(s) abweichen. yes @@ -769,25 +724,13 @@ Adresse: %4 Transaktionen mit höherer Priorität haben eine größere Chance in einen Block aufgenommen zu werden. - This label turns red, if the priority is smaller than "medium". - Diese Bezeichnung wird rot, wenn die Priorität niedriger als "mittel" ist. + This label turns red, if the priority is smaller than "medium". + Diese Bezeichnung wird rot, wenn die Priorität niedriger als "mittel" ist. This label turns red, if any recipient receives an amount smaller than %1. Diese Bezeichnung wird rot, wenn irgendein Empfänger einen Betrag kleiner als %1 erhält. - - This means a fee of at least %1 is required. - Das bedeutet, dass eine Gebühr von mindestens %1 erforderlich ist. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - Beträge kleiner als das 0,546-fache der niedrigsten Vermittlungsgebühr werden als "Dust" angezeigt. - - - This label turns red, if the change is smaller than %1. - Diese Bezeichnung wird rot, wenn das Wechselgeld weniger als %1 ist. - (no label) (keine Bezeichnung) @@ -840,12 +783,12 @@ Adresse: %4 Zahlungsadresse bearbeiten - The entered address "%1" is already in the address book. - Die eingegebene Adresse "%1" befindet sich bereits im Adressbuch. + The entered address "%1" is already in the address book. + Die eingegebene Adresse "%1" befindet sich bereits im Adressbuch. - The entered address "%1" is not a valid Bitcoin address. - Die eingegebene Adresse "%1" ist keine gültige Bitcoin-Adresse. + The entered address "%1" is not a valid Bitcoin address. + Die eingegebene Adresse "%1" ist keine gültige Bitcoin-Adresse. Could not unlock wallet. @@ -881,10 +824,6 @@ Adresse: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Bitcoin Core - Kommandozeilenoptionen - Bitcoin Core Bitcoin Core @@ -893,6 +832,18 @@ Adresse: %4 version Version + + (%1-bit) + (%1-Bit) + + + About Bitcoin Core + Über Bitcoin Core + + + Command-line options + Kommandozeilenoptionen + Usage: Benutzung: @@ -906,8 +857,8 @@ Adresse: %4 UI-Optionen - Set language, for example "de_DE" (default: system locale) - Sprache festlegen, z.B. "de_DE" (Standard: Systemstandard) + Set language, for example "de_DE" (default: system locale) + Sprache festlegen, z.B. "de_DE" (Standard: Systemstandard) Start minimized @@ -953,12 +904,12 @@ Adresse: %4 Ein benutzerdefiniertes Datenverzeichnis verwenden: - Bitcoin - Bitcoin + Bitcoin Core + Bitcoin Core - Error: Specified data directory "%1" can not be created. - Fehler: Angegebenes Datenverzeichnis "%1" kann nicht angelegt werden. + Error: Specified data directory "%1" cannot be created. + Fehler: Angegebenes Datenverzeichnis "%1" kann nicht angelegt werden. Error @@ -1008,7 +959,7 @@ Adresse: %4 Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Optionale Transaktionsgebühr pro kB, die sicherstellt, dass ihre Transaktionen schnell bearbeitet werden. Die meisten Transaktionen sind 1 kB groß. + Optionale Transaktionsgebühr pro kB, die sicherstellt, dass Ihre Transaktionen schnell bearbeitet werden. Die meisten Transaktionen sind 1 kB groß. Pay transaction &fee @@ -1034,6 +985,14 @@ Adresse: %4 Number of script &verification threads Anzahl an Skript-&Verifizierungs-Threads + + Accept connections from outside + Eingehende Verbindungen annehmen + + + Allow incoming connections + Erlaubt eingehende Verbindungen + Connect to the Bitcoin network through a SOCKS proxy. Über einen SOCKS-Proxy mit dem Bitcoin-Netzwerk verbinden. @@ -1048,7 +1007,7 @@ Adresse: %4 Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - Externe URLs (z.B. ein Block-Explorer), die im Kontextmenü des Transaktionsverlaufs eingefügt werden. In der URL wird %s durch den Transaktionshash ersetzt. Bei Angabe mehrerer URLs müssen diese durch "|" voneinander getrennt werden. + Externe URLs (z.B. ein Block-Explorer), die im Kontextmenü des Transaktionsverlaufs eingefügt werden. In der URL wird %s durch den Transaktionshash ersetzt. Bei Angabe mehrerer URLs müssen diese durch "|" voneinander getrennt werden. Third party transaction URLs @@ -1084,7 +1043,7 @@ Adresse: %4 Enable coin &control features - "&Coin Control"-Funktionen aktivieren + "&Coin Control"-Funktionen aktivieren 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. @@ -1096,7 +1055,7 @@ Adresse: %4 Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - Automatisch den Bitcoin-Clientport auf dem Router öffnen. Dies funktioniert nur, wenn ihr Router UPnP unterstützt und dies aktiviert ist. + Automatisch den Bitcoin-Clientport auf dem Router öffnen. Dies funktioniert nur, wenn Ihr Router UPnP unterstützt und dies aktiviert ist. Map port using &UPnP @@ -1114,14 +1073,6 @@ Adresse: %4 Port of the proxy (e.g. 9050) Port des Proxies (z.B. 9050) - - SOCKS &Version: - SOCKS-&Version: - - - SOCKS version of the proxy (e.g. 5) - SOCKS-Version des Proxies (z.B. 5) - &Window &Programmfenster @@ -1136,7 +1087,7 @@ Adresse: %4 Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - Minimiert die Anwendung anstatt sie zu beenden wenn das Fenster geschlossen wird. Wenn dies aktiviert ist, müssen Sie das Programm über "Beenden" im Menü schließen. + Minimiert die Anwendung anstatt sie zu beenden wenn das Fenster geschlossen wird. Wenn dies aktiviert ist, müssen Sie das Programm über "Beenden" im Menü schließen. M&inimize on close @@ -1162,17 +1113,9 @@ Adresse: %4 Choose the default subdivision unit to show in the interface and when sending coins. Wählen Sie die standardmäßige Untereinheit, die in der Benutzeroberfläche und beim Überweisen von Bitcoins angezeigt werden soll. - - Whether to show Bitcoin addresses in the transaction list or not. - Legt fest, ob Bitcoin-Adressen im Transaktionsverlauf angezeigt werden. - - - &Display addresses in transaction list - Adressen im Transaktionsverlauf &anzeigen - Whether to show coin control features or not. - Legt fest, ob die "Coin Control"-Funktionen angezeigt werden. + Legt fest, ob die "Coin Control"-Funktionen angezeigt werden. &OK @@ -1225,6 +1168,10 @@ Adresse: %4 Wallet Wallet + + Watch-only: + Beobachtet: + Available: Verfügbar: @@ -1257,6 +1204,22 @@ Adresse: %4 Your current total balance Aktueller Gesamtbetrag aus obigen Kategorien + + Your current balance in watch-only addresses + Ihr aktueller Kontostand beobachteter Adressen + + + Unconfirmed transactions to watch-only addresses + Unbestätigte Transaktionen von beobachteten Adressen + + + Mined balance in watch-only addresses that has not yet matured + Erarbeiteter Betrag in beobachteten Adressen der noch nicht gereift ist + + + Current total balance in watch-only addresses + Aktueller Gesamtbetrag in beobachteten Adressen aus obigen Kategorien + <b>Recent transactions</b> <b>Letzte Transaktionen</b> @@ -1273,12 +1236,28 @@ Adresse: %4 URI-Verarbeitung - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI kann nicht analysiert werden! Dies kann durch eine ungültige Bitcoin-Adresse oder fehlerhafte URI-Parameter verursacht werden. + Invalid payment address %1 + Ungültige Zahlungsadresse %1 + + + Payment request rejected + Zahlungsanforderung abgelehnt + + + Payment request network doesn't match client network. + Netzwerk der Zahlungsanforderung stimmt nicht mit dem Client-Netzwerk überein. + + + Payment request has expired. + Zahlungsanforderung ist abgelaufen. + + + Payment request is not initialized. + Zahlungsanforderung ist nicht initialisiert. Requested payment amount of %1 is too small (considered dust). - Angeforderter Zahlungsbetrag in Höhe von %1 ist zu niedrig und wurde als "Dust" eingestuft. + Angeforderter Zahlungsbetrag in Höhe von %1 ist zu niedrig und wurde als "Dust" eingestuft. Payment request error @@ -1286,27 +1265,23 @@ Adresse: %4 Cannot start bitcoin: click-to-pay handler - "bitcoin: Klicken-zum-Bezahlen"-Handler konnte nicht gestartet werden - - - Net manager warning - Netzwerkmanager-Warnung - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - Ihr aktiver Proxy unterstützt kein SOCKS5, dies wird jedoch für Zahlungsanforderungen über einen Proxy benötigt. + "bitcoin: Klicken-zum-Bezahlen"-Handler konnte nicht gestartet werden Payment request fetch URL is invalid: %1 Abruf-URL der Zahlungsanforderung ist ungültig: %1 + + URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + URI kann nicht analysiert werden! Dies kann durch eine ungültige Bitcoin-Adresse oder fehlerhafte URI-Parameter verursacht werden. + Payment request file handling Zahlungsanforderungsdatei-Verarbeitung - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - Zahlungsanforderungsdatei kann nicht gelesen oder verarbeitet werden! Dies kann durch eine ungültige Zahlungsanforderungsdatei verursacht werden. + Payment request file cannot be read! This can be caused by an invalid payment request file. + Zahlungsanforderungsdatei kann nicht gelesen werden! Dies kann durch eine ungültige Zahlungsanforderungsdatei verursacht werden. Unverified payment requests to custom payment scripts are unsupported. @@ -1321,8 +1296,8 @@ Adresse: %4 Kommunikationsfehler mit %1: %2 - Payment request can not be parsed or processed! - Zahlungsanforderung kann nicht analysiert oder verarbeitet werden! + Payment request cannot be parsed! + Zahlungsanforderung kann nicht verarbeitet werden! Bad response from server %1 @@ -1337,31 +1312,66 @@ Adresse: %4 fehlerhafte Netzwerkanfrage + + PeerTableModel + + User Agent + User-Agent + + + Address/Hostname + Adresse/Hostname + + + Ping Time + Pingzeit + + QObject - Bitcoin - Bitcoin + Amount + Betrag - Error: Specified data directory "%1" does not exist. - Fehler: Angegebenes Datenverzeichnis "%1" existiert nicht. + Enter a Bitcoin address (e.g. %1) + Bitcoin-Adresse eingeben (z.B. %1) - Error: Cannot parse configuration file: %1. Only use key=value syntax. - Fehler: Konfigurationsdatei kann nicht analysiert werden: %1. Bitte nur "Schlüssel=Wert"-Syntax verwenden. + %1 d + %1 d - Error: Invalid combination of -regtest and -testnet. - Fehler: Ungültige Kombination von -regtest und -testnet. + %1 h + %1 h - Bitcoin Core didn't yet exit safely... - Bitcoin Core wurde noch nicht sicher beendet... + %1 m + %1 m - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Bitcoin-Adresse eingeben (z.B. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + %1 s + %1 s + + + NETWORK + NETZWERK + + + UNKNOWN + UNBEKANNT + + + None + Keine + + + N/A + k.A. + + + %1 ms + %1 ms @@ -1399,7 +1409,7 @@ Adresse: %4 &Information - &Information + Hinweis Debug window @@ -1413,6 +1423,10 @@ Adresse: %4 Using OpenSSL version Verwendete OpenSSL-Version + + Using BerkeleyDB version + Verwendete BerkeleyDB-Version + Startup time Startzeit @@ -1438,8 +1452,76 @@ Adresse: %4 Aktuelle Anzahl Blöcke - Estimated total blocks - Geschätzte Gesamtzahl Blöcke + Received + Empfangen + + + Sent + Übertragen + + + &Peers + &Gegenstellen + + + Select a peer to view detailed information. + Gegenstelle auswählen, um detaillierte Informationen zu erhalten. + + + Direction + Richtung + + + Version + Version + + + User Agent + User-Agent + + + Services + Dienste + + + Sync Node + Sync-Knoten + + + Starting Height + Start-Höhe + + + Sync Height + Sync-Höhe + + + Ban Score + Sperrpunktzahl + + + Connection Time + Verbindungsdauer + + + Last Send + Letzte Übertragung + + + Last Receive + Letzter Empfang + + + Bytes Sent + Übertragene Byte + + + Bytes Received + Empfangene Byte + + + Ping Time + Pingzeit Last block time @@ -1463,7 +1545,7 @@ Adresse: %4 Totals - Summen + Gesamtbetrag: In: @@ -1518,16 +1600,36 @@ Adresse: %4 %1 GB - %1 m - %1 m + via %1 + über %1 - %1 h - %1 h + never + nie - %1 h %2 m - %1 h %2 m + Inbound + eingehend + + + Outbound + ausgehend + + + Yes + Ja + + + No + Nein + + + Unknown + Unbekannt + + + Fetching... + Aktualisiere... @@ -1707,7 +1809,7 @@ Adresse: %4 Coin Control Features - "Coin Control"-Funktionen + "Coin Control"-Funktionen Inputs... @@ -1741,10 +1843,6 @@ Adresse: %4 Fee: Gebühr: - - Low Output: - Zu geringer Ausgabebetrag: - After Fee: Abzüglich Gebühr: @@ -1773,6 +1871,10 @@ Adresse: %4 Clear all fields of the form. Alle Formularfelder zurücksetzen. + + Dust: + "Dust": + Clear &All &Zurücksetzen @@ -1821,10 +1923,6 @@ Adresse: %4 Copy priority Priorität kopieren - - Copy low output - Zu geringen Ausgabebetrag kopieren - Copy change Wechselgeld kopieren @@ -1847,11 +1945,11 @@ Adresse: %4 The amount exceeds your balance. - Der angegebene Betrag übersteigt ihren Kontostand. + Der angegebene Betrag übersteigt Ihren Kontostand. The total exceeds your balance when the %1 transaction fee is included. - Der angegebene Betrag übersteigt aufgrund der Transaktionsgebühr in Höhe von %1 ihren Kontostand. + Der angegebene Betrag übersteigt aufgrund der Transaktionsgebühr in Höhe von %1 Ihren Kontostand. Duplicate address found, can only send to each address once per send operation. @@ -1863,7 +1961,7 @@ Adresse: %4 The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - Die Transaktion wurde abgelehnt! Dies kann passieren, wenn einige Bitcoins aus ihrer Wallet bereits ausgegeben wurden. Beispielsweise weil Sie eine Kopie ihrer wallet.dat genutzt, die Bitcoins dort ausgegeben haben und dies daher in der derzeit aktiven Wallet nicht vermerkt ist. + Die Transaktion wurde abgelehnt! Dies kann passieren, wenn einige Bitcoins aus Ihrer Wallet bereits ausgegeben wurden. Beispielsweise weil Sie eine Kopie Ihrer wallet.dat genutzt, die Bitcoins dort ausgegeben haben und dies daher in der derzeit aktiven Wallet nicht vermerkt ist. Warning: Invalid Bitcoin address @@ -1877,6 +1975,10 @@ Adresse: %4 Warning: Unknown change address Warnung: Unbekannte Wechselgeld-Adresse + + Copy dust + "Dust" kopieren + Are you sure you want to send? Wollen Sie die Überweisung ausführen? @@ -1885,14 +1987,6 @@ Adresse: %4 added as transaction fee als Transaktionsgebühr hinzugefügt - - Payment request expired - Zahlungsanforderung abgelaufen - - - Invalid payment address %1 - Ungültige Zahlungsadresse %1 - SendCoinsEntry @@ -1904,10 +1998,6 @@ Adresse: %4 Pay &To: E&mpfänger: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Die Zahlungsadresse der Überweisung (z.B. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Adressbezeichnung eingeben (diese wird zusammen mit der Adresse dem Adressbuch hinzugefügt) @@ -1924,6 +2014,10 @@ Adresse: %4 This is a normal payment. Dies ist eine normale Überweisung. + + The Bitcoin address to send the payment to + Die Zahlungsadresse der Überweisung + Alt+A Alt+A @@ -1954,7 +2048,7 @@ Adresse: %4 A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - Eine an die "bitcoin:"-URI angefügte Nachricht, die zusammen mit der Transaktion gespeichert wird. Hinweis: Diese Nachricht wird nicht über das Bitcoin-Netzwerk gesendet. + Eine an die "bitcoin:"-URI angefügte Nachricht, die zusammen mit der Transaktion gespeichert wird. Hinweis: Diese Nachricht wird nicht über das Bitcoin-Netzwerk gesendet. This is an unverified payment request. @@ -1992,11 +2086,11 @@ Adresse: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - Sie können Nachrichten mit ihren Adressen signieren, um den Besitz dieser Adressen zu beweisen. Bitte nutzen Sie diese Funktion mit Vorsicht und nehmen Sie sich vor Phishingangriffen in Acht. Signieren Sie nur Nachrichten, mit denen Sie vollständig einverstanden sind. + Sie können Nachrichten mit Ihren Adressen signieren, um den Besitz dieser Adressen zu beweisen. Bitte nutzen Sie diese Funktion mit Vorsicht und nehmen Sie sich vor Phishingangriffen in Acht. Signieren Sie nur Nachrichten, mit denen Sie vollständig einverstanden sind. - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Die Adresse mit der die Nachricht signiert wird (z.B. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address to sign the message with + Die Bitcoin-Adresse mit der die Nachricht signiert wird Choose previously used address @@ -2036,7 +2130,7 @@ Adresse: %4 Reset all sign message fields - Alle "Nachricht signieren"-Felder zurücksetzen + Alle "Nachricht signieren"-Felder zurücksetzen Clear &All @@ -2051,8 +2145,8 @@ Adresse: %4 Geben Sie die signierende Adresse, Nachricht (achten Sie darauf Zeilenumbrüche, Leerzeichen, Tabulatoren usw. exakt zu kopieren) und Signatur unten ein, um die Nachricht zu verifizieren. Vorsicht, interpretieren Sie nicht mehr in die Signatur hinein, als in der signierten Nachricht selber enthalten ist, um nicht von einem Man-in-the-middle-Angriff hinters Licht geführt zu werden. - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Die Adresse mit der die Nachricht signiert wurde (z.B. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address the message was signed with + Die Bitcoin-Adresse mit der die Nachricht signiert wurde Verify the message to ensure it was signed with the specified Bitcoin address @@ -2064,15 +2158,11 @@ Adresse: %4 Reset all verify message fields - Alle "Nachricht verifizieren"-Felder zurücksetzen + Alle "Nachricht verifizieren"-Felder zurücksetzen - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Bitcoin-Adresse eingeben (z.B. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Auf "Nachricht signieren" klicken, um die Signatur zu erzeugen + Click "Sign Message" to generate signature + Auf "Nachricht signieren" klicken, um die Signatur zu erzeugen The entered address is invalid. @@ -2112,7 +2202,7 @@ Adresse: %4 The signature did not match the message digest. - Die Signatur entspricht nicht dem "Message Digest". + Die Signatur entspricht nicht dem "Message Digest". Message verification failed. @@ -2131,7 +2221,7 @@ Adresse: %4 The Bitcoin Core developers - Die "Bitcoin Core"-Entwickler + Die "Bitcoin Core"-Entwickler [testnet] @@ -2199,6 +2289,10 @@ Adresse: %4 own address eigene Adresse + + watch-only + beobachtet + label Bezeichnung @@ -2219,6 +2313,14 @@ Adresse: %4 Debit Belastung + + Total debit + Gesamtbelastung + + + Total credit + Gesamtgutschrift + Transaction fee Transaktionsgebühr @@ -2244,8 +2346,8 @@ Adresse: %4 Händler - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - Erzeugte Bitcoins müssen %1 Blöcke lang reifen, bevor sie ausgegeben werden können. Als Sie diesen Block erzeugten, wurde er an das Netzwerk übertragen, um ihn der Blockkette hinzuzufügen. Falls dies fehlschlägt wird der Status in "nicht angenommen" geändert und Sie werden keine Bitcoins gutgeschrieben bekommen. Das kann gelegentlich passieren, wenn ein anderer Knoten einen Block fast zeitgleich erzeugt. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Erzeugte Bitcoins müssen %1 Blöcke lang reifen, bevor sie ausgegeben werden können. Als Sie diesen Block erzeugten, wurde er an das Netzwerk übertragen, um ihn der Blockkette hinzuzufügen. Falls dies fehlschlägt wird der Status in "nicht angenommen" geändert und Sie werden keine Bitcoins gutgeschrieben bekommen. Das kann gelegentlich passieren, wenn ein anderer Knoten einen Block fast zeitgleich erzeugt. Debug information @@ -2309,10 +2411,6 @@ Adresse: %4 Address Adresse - - Amount - Betrag - Immature (%1 confirmations, will be available after %2) Unreif (%1 Bestätigungen, wird verfügbar sein nach %2) @@ -2391,7 +2489,7 @@ Adresse: %4 Destination address of transaction. - Zieladresse der Transaktion + Zieladresse der Transaktion. Amount removed from or added to balance. @@ -2426,7 +2524,7 @@ Adresse: %4 Range... - Zeitraum... + Zeitraum Received with @@ -2524,10 +2622,6 @@ Adresse: %4 Address Adresse - - Amount - Betrag - ID ID @@ -2541,6 +2635,13 @@ Adresse: %4 bis + + UnitDisplayStatusBarControl + + Unit to show amounts in. Click to select another unit. + Die Einheit in der Beträge angezeigt werden. Klicken, um eine andere Einheit auszuwählen. + + WalletFrame @@ -2592,18 +2693,6 @@ Adresse: %4 bitcoin-core - - Usage: - Benutzung: - - - List commands - Befehle auflisten - - - Get help for a command - Hilfe zu einem Befehl erhalten - Options: Optionen: @@ -2644,10 +2733,6 @@ Adresse: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Anzahl Sekunden, während denen sich nicht konform verhaltenden Gegenstellen die Wiederverbindung verweigert wird (Standard: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Beim Einrichten des RPC-Ports %u zum Abhören von IPv4 ist ein Fehler aufgetreten: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) <port> nach JSON-RPC-Verbindungen abhören (Standard: 8332 oder Testnetz: 18332) @@ -2656,10 +2741,6 @@ Adresse: %4 Accept command line and JSON-RPC commands Kommandozeilen- und JSON-RPC-Befehle annehmen - - Bitcoin Core RPC client version - "Bitcoin Core"-RPC-Client-Version - Run in the background as a daemon and accept commands Als Hintergrunddienst ausführen und Befehle annehmen @@ -2682,7 +2763,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, Sie müssen den Wert rpcpasswort in dieser Konfigurationsdatei angeben: %s @@ -2693,53 +2774,41 @@ rpcpassword=%s Der Benutzername und das Passwort dürfen NICHT identisch sein. Falls die Konfigurationsdatei nicht existiert, erzeugen Sie diese bitte mit Leserechten nur für den Dateibesitzer. Es wird ebenfalls empfohlen alertnotify anzugeben, um im Problemfall benachrichtig zu werden; -zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com +zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Zulässige Chiffren (Standard: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Beim Einrichten des RPC-Ports %u zum Abhören von IPv6 ist ein Fehler aufgetreten, es wird auf IPv4 zurückgegriffen: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - An die angegebene Adresse binden und immer abhören. Für IPv6 "[Host]:Port"-Schreibweise verwenden + An die angegebene Adresse binden und immer abhören. Für IPv6 "[Host]:Port"-Schreibweise verwenden Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) Anzahl der freien Transaktionen auf <n> * 1000 Byte pro Minute begrenzen (Standard: 15) - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Regressionstest-Modus aktivieren, der eine spezielle Blockkette nutzt, in der Blöcke sofort gelöst werden können. Dies ist für Regressionstest-Tools und Anwendungsentwicklung gedacht. + Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup + Alle Wallet-Transaktionen löschen und nur diese Teilbereiche der Blockkette durch -rescan beim Starten wiederherstellen Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Regressionstest-Modus aktivieren, der eine spezielle Blockkette nutzt, in der Blöcke sofort gelöst werden können. - - Error: Listening for incoming connections failed (listen returned error %d) - Fehler: Abhören nach eingehenden Verbindungen fehlgeschlagen (Fehler %d) - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - Fehler: Die Transaktion wurde abgelehnt! Dies kann passieren, wenn einige Bitcoins aus ihrer Wallet bereits ausgegeben wurden. Beispielsweise weil Sie eine Kopie ihrer wallet.dat genutzt, die Bitcoins dort ausgegeben haben und dies daher in der derzeit aktiven Wallet nicht vermerkt ist. + Fehler: Die Transaktion wurde abgelehnt! Dies kann passieren, wenn einige Bitcoins aus Ihrer Wallet bereits ausgegeben wurden. Beispielsweise weil Sie eine Kopie Ihrer wallet.dat genutzt, die Bitcoins dort ausgegeben haben und dies daher in der derzeit aktiven Wallet nicht vermerkt ist. Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - Fehler: Diese Transaktion benötigt aufgrund ihres Betrags, ihrer Komplexität oder der Nutzung erst kürzlich erhaltener Zahlungen eine Transaktionsgebühr in Höhe von mindestens %s! + Fehler: Diese Transaktion benötigt aufgrund Ihres Betrags, Ihrer Komplexität oder der Nutzung erst kürzlich erhaltener Zahlungen eine Transaktionsgebühr in Höhe von mindestens %s! Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Befehl ausführen wenn sich eine Wallet-Transaktion verändert (%s im Befehl wird durch die TxID ersetzt) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - Niedrigere Gebühren als diese werden als gebührenfrei angesehen (bei der Transaktionserstellung) (Standard: - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) Datenbankaktivitäten vom Arbeitsspeicher-Pool alle <n> Megabyte auf den Datenträger schreiben (Standard: 100) @@ -2776,17 +2845,13 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Warnung: -paytxfee ist auf einen sehr hohen Wert festgelegt! Dies ist die Gebühr die beim Senden einer Transaktion fällig wird. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Warnung: Bitte korrigieren Sie die Datums- und Uhrzeiteinstellungen ihres Computers, da Bitcoin ansonsten nicht ordnungsgemäß funktionieren wird! - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Warnung: Das Netzwerk scheint nicht vollständig übereinzustimmen! Einige Miner scheinen Probleme zu haben. Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - Warnung: Wir scheinen nicht vollständig mit unseren Gegenstellen übereinzustimmen! Sie oder die anderen Knoten müssen unter Umständen ihre Client-Software aktualisieren. + Warnung: Wir scheinen nicht vollständig mit unseren Gegenstellen übereinzustimmen! Sie oder die anderen Knoten müssen unter Umständen Ihre Client-Software aktualisieren. Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. @@ -2794,7 +2859,7 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - Warnung: wallet.dat beschädigt, Datenrettung erfolgreich! Original wallet.dat wurde als wallet.{Zeitstempel}.dat in %s gespeichert. Falls ihr Kontostand oder Transaktionen nicht korrekt sind, sollten Sie von einer Datensicherung wiederherstellen. + Warnung: wallet.dat beschädigt, Datenrettung erfolgreich! Original wallet.dat wurde als wallet.{Zeitstempel}.dat in %s gespeichert. Falls Ihr Kontostand oder Transaktionen nicht korrekt sind, sollten Sie von einer Datensicherung wiederherstellen. (default: 1) @@ -2812,30 +2877,14 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Attempt to recover private keys from a corrupt wallet.dat Versuchen, private Schlüssel aus einer beschädigten wallet.dat wiederherzustellen - - Bitcoin Core Daemon - "Bitcoin Core"-Hintergrunddienst - Block creation options: Blockerzeugungsoptionen: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - Liste der Wallet-Transaktionen zurücksetzen (Diagnosetool; beinhaltet -rescan) - Connect only to the specified node(s) Mit nur dem oder den angegebenen Knoten verbinden - - Connect through SOCKS proxy - Über einen SOCKS-Proxy verbinden - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - Mit JSON-RPC auf <port> verbinden (Standard: 8332 oder Testnetz: 18332) - Connection options: Verbindungsoptionen: @@ -2936,18 +2985,6 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Failed to write undo data Schreiben der Rücksetzdaten fehlgeschlagen - - Fee per kB to add to transactions you send - Gebühr pro kB, die gesendeten Transaktionen hinzugefügt wird - - - Fees smaller than this are considered zero fee (for relaying) (default: - Niedrigere Gebühren als diese werden als gebührenfrei angesehen (bei der Vermittlung) (Standard: - - - Find peers using DNS lookup (default: 1 unless -connect) - Gegenstellen via DNS-Abfrage finden (Standard: 1, außer bei -connect) - Force safe mode (default: 0) Sicherheitsmodus erzwingen (Standard: 0) @@ -2973,8 +3010,8 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Fehlerhafter oder kein Genesis-Block gefunden. Falsches Datenverzeichnis für das Netzwerk? - Invalid -onion address: '%s' - Ungültige "-onion"-Adresse: '%s' + Invalid -onion address: '%s' + Ungültige "-onion"-Adresse: '%s' Not enough file descriptors available. @@ -2984,18 +3021,10 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Prepend debug output with timestamp (default: 1) Debugausgaben einen Zeitstempel voranstellen (Standard: 1) - - RPC client options: - RPC-Client-Optionen: - Rebuild block chain index from current blk000??.dat files Blockkettenindex aus aktuellen Dateien blk000??.dat wiederaufbauen - - Select SOCKS version for -proxy (4 or 5, default: 5) - SOCKS-Version des Proxies wählen (4 oder 5, Standard: 5) - Set database cache size in megabytes (%d to %d, default: %d) Größe des Datenbankcaches in Megabyte festlegen (%d bis %d, Standard: %d) @@ -3017,12 +3046,12 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Unbestätigtes Wechselgeld beim Senden von Transaktionen ausgeben (Standard: 1) - This is intended for regression testing tools and app development. - Dies ist für Regressionstest-Tools und Anwendungsentwicklung gedacht. + Stop running after importing blocks from disk (default: 0) + Beenden, nachdem Blöcke vom Datenträger importiert wurden (Standard: 0) - Usage (deprecated, use bitcoin-cli): - Benutzung (veraltet, bitte bitcoin-cli verwenden): + This is intended for regression testing tools and app development. + Dies ist für Regressionstest-Tools und Anwendungsentwicklung gedacht. Verifying blocks... @@ -3032,10 +3061,6 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Verifying wallet... Verifiziere Wallet... - - Wait for RPC server to start - Warten, bis der RPC-Server gestartet ist - Wallet %s resides outside data directory %s Wallet %s liegt außerhalb des Datenverzeichnisses %s @@ -3044,10 +3069,6 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Wallet options: Wallet-Optionen: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - Warnung: Veraltetes Argument -debugnet gefunden, bitte -debug=net verwenden - You need to rebuild the database using -reindex to change -txindex Sie müssen die Datenbank mit Hilfe von -reindex neu aufbauen, um -txindex zu verändern @@ -3056,14 +3077,38 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Imports blocks from external blk000??.dat file Blöcke aus externer Datei blk000??.dat importieren + + (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + (Standard: 1, 1 = TX-Metadaten wie z.B. Accountbesitzer und Zahlungsanforderungsinformationen behalten, 2 = TX-Metadaten verwerfen) + Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. Datenverzeichnis %s kann nicht gesperrt werden, da Bitcoin Core wahrscheinlich bereits gestartet wurde. + + Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + Veröffentlicht unter der MIT/X11-Softwarelizenz, siehe beiligende Datei COPYING oder <http://www.opensource.org/licenses/mit-license.php>. + + + Error: Listening for incoming connections failed (listen returned error %s) + Fehler: Abhören nach eingehenden Verbindungen fehlgeschlagen (listen meldete Fehler %s) + + + Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + Fehler: Nicht unterstütztes Argument -socks gefunden. Das Festlegen der SOCKS-Version ist nicht mehr möglich, nur noch SOCKS5-Proxies werden unterstützt. + Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Befehl ausführen wenn ein relevanter Alarm empfangen wird oder wir einen wirklich langen Fork entdecken (%s im Befehl wird durch die Nachricht ersetzt) + + Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) + Niedrigere Gebühren (in BTC/Kb) als diese werden bei der Vermittlung als gebührenfrei angesehen (Standard: %s) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) + Niedrigere Gebühren (in BTC/Kb) als diese werden bei der Transaktionserstellung als gebührenfrei angesehen (Standard: %s) + Output debugging information (default: 0, supplying <category> is optional) Debugginginformationen ausgeben (Standard: 0, <category> anzugeben ist optional) @@ -3072,17 +3117,45 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Maximale Größe in Byte von Transaktionen hoher Priorität/mit niedrigen Gebühren festlegen (Standard: %d) + + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. + Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Verwendung im OpenSSL-Toolkit <https://www.openssl.org/> entwickelt wird, sowie von Eric Young geschriebene kryptographische Software und von Thomas Bernard geschriebene UPnP-Software. + + + Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + Warnung: Bitte korrigieren Sie die Datums- und Uhrzeiteinstellungen Ihres Computers, da Bitcoin Core ansonsten nicht ordnungsgemäß funktionieren wird! + + + Connect through SOCKS5 proxy + Über einen SOCKS5-Proxy &verbinden + + + Copyright (C) 2009-%i The Bitcoin Core Developers + Urheberrecht (C) 2009-%i Die "Bitcoin Core"-Entwickler + + + Could not parse -rpcbind value %s as network address + Der Wert %s von -rpcbind wurde nicht als Netzwerkadresse erkannt + + + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core + Fehler beim Laden von wallet.dat: Wallet benötigt neuere Version von Bitcoin Core + + + Error: Unsupported argument -tor found, use -onion. + Fehler: Nicht unterstütztes Argument -tor gefunden, bitte -onion verwenden. + Information Hinweis - Invalid amount for -minrelaytxfee=<amount>: '%s' - Ungültiger Betrag für -minrelaytxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Ungültiger Betrag für -minrelaytxfee=<amount>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - Ungültiger Betrag für -mintxfee=<amount>: '%s' + Invalid amount for -mintxfee=<amount>: '%s' + Ungültiger Betrag für -mintxfee=<amount>: '%s' Limit size of signature cache to <n> entries (default: 50000) @@ -3104,6 +3177,10 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) Maximale Größe des Sendepuffers pro Verbindung, <n> * 1000 Byte (Standard: 1000) + + Node relay options: + Knoten-Vermittlungsoptionen: + Only accept block chain matching built-in checkpoints (default: 1) Blockkette nur als gültig ansehen, wenn sie mit den integrierten Prüfpunkten übereinstimmt (Standard: 1) @@ -3140,14 +3217,6 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Run a thread to flush wallet periodically (default: 1) Einen Thread starten, der periodisch die Wallet sicher auf den Datenträger schreibt (Standard: 1) - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL-Optionen (siehe Bitcoin-Wiki für SSL-Einrichtungssanweisungen): - - - Send command to Bitcoin Core - Befehl an Bitcoin Core senden - Send trace/debug info to console instead of debug.log file Rückverfolgungs- und Debuginformationen an die Konsole senden, anstatt sie in debug.log zu schreiben @@ -3164,10 +3233,6 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Show all debugging options (usage: --help -help-debug) Zeige alle Debuggingoptionen (Benutzung: --help -help-debug) - - Show benchmark information (default: 0) - Zeige Benchmarkinformationen (Standard: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Protokolldatei debug.log beim Starten des Clients kürzen (Standard: 1, wenn kein -debug) @@ -3180,14 +3245,14 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Specify connection timeout in milliseconds (default: 5000) Verbindungzeitüberschreitung in Millisekunden festlegen (Standard: 5000) - - Start Bitcoin Core Daemon - "Bitcoin Core"-Hintergrunddienst starten - System error: Systemfehler: + + This is experimental software. + Dies ist experimentelle Software. + Transaction amount too small Transaktionsbetrag zu niedrig @@ -3212,6 +3277,10 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Username for JSON-RPC connections Benutzername für JSON-RPC-Verbindungen + + Wallet needed to be rewritten: restart Bitcoin Core to complete + Wallet musste neu geschrieben werden: starten Sie Bitcoin Core zur Fertigstellung neu + Warning Warnung @@ -3220,6 +3289,14 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Warning: This version is obsolete, upgrade required! Warnung: Diese Version is veraltet, Aktualisierung erforderlich! + + Warning: Unsupported argument -benchmark ignored, use -debug=bench. + Warnung: Nicht unterstütztes Argument -benchmark wurde ignoriert, bitte -debug=bench verwenden. + + + Warning: Unsupported argument -debugnet ignored, use -debug=net. + Warnung: Nicht unterstütztes Argument -debugnet wurde ignoriert, bitte -debug=net verwenden. + Zapping all transactions from wallet... Lösche alle Transaktionen aus Wallet... @@ -3228,10 +3305,6 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f on startup beim Starten - - version - Version - wallet.dat corrupt, salvage failed wallet.dat beschädigt, Datenrettung fehlgeschlagen @@ -3240,14 +3313,6 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Password for JSON-RPC connections Passwort für JSON-RPC-Verbindungen - - Allow JSON-RPC connections from specified IP address - JSON-RPC-Verbindungen von der angegebenen IP-Adresse erlauben - - - Send commands to node running on <ip> (default: 127.0.0.1) - Sende Befehle an Knoten <ip> (Standard: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Befehl ausführen wenn der beste Block wechselt (%s im Befehl wird durch den Hash des Blocks ersetzt) @@ -3280,10 +3345,6 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f This help message Dieser Hilfetext - - Unable to bind to %s on this computer (bind returned error %d, %s) - Kann auf diesem Computer nicht an %s binden (von bind zurückgegebener Fehler %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Erlaube DNS-Abfragen für -addnode, -seednode und -connect @@ -3296,41 +3357,29 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Error loading wallet.dat: Wallet corrupted Fehler beim Laden von wallet.dat: Wallet beschädigt - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Fehler beim Laden von wallet.dat: Wallet benötigt neuere Version von Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - Wallet musste neu geschrieben werden: starten Sie Bitcoin zur Fertigstellung neu - Error loading wallet.dat Fehler beim Laden von wallet.dat - Invalid -proxy address: '%s' - Ungültige Adresse in -proxy: '%s' + Invalid -proxy address: '%s' + Ungültige Adresse in -proxy: '%s' - Unknown network specified in -onlynet: '%s' - Unbekannter Netztyp in -onlynet angegeben: '%s' + Unknown network specified in -onlynet: '%s' + Unbekannter Netztyp in -onlynet angegeben: '%s' - Unknown -socks proxy version requested: %i - Unbekannte Proxyversion in -socks angefordert: %i + Cannot resolve -bind address: '%s' + Kann Adresse in -bind nicht auflösen: '%s' - Cannot resolve -bind address: '%s' - Kann Adresse in -bind nicht auflösen: '%s' + Cannot resolve -externalip address: '%s' + Kann Adresse in -externalip nicht auflösen: '%s' - Cannot resolve -externalip address: '%s' - Kann Adresse in -externalip nicht auflösen: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Ungültiger Betrag für -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Ungültiger Betrag für -paytxfee=<amount>: '%s' Invalid amount @@ -3376,13 +3425,5 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@f Error Fehler - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Sie müssen den Wert rpcpassword=<passwort> in der Konfigurationsdatei angeben: -%s -Falls die Konfigurationsdatei nicht existiert, erzeugen Sie diese bitte mit Leserechten nur für den Dateibesitzer. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_el_GR.ts b/src/qt/locale/bitcoin_el_GR.ts index e957a0088e..d5e9b57d99 100644 --- a/src/qt/locale/bitcoin_el_GR.ts +++ b/src/qt/locale/bitcoin_el_GR.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - Σχετικά με το Bitcoin Core - - - <b>Bitcoin Core</b> version - <b>Bitcoin Core</b> έκδοση - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - Copyright - Πνευματική ιδιοκτησία - - - The Bitcoin Core developers - Οι προγραμματιστές του Bitcoin Core - - - (%1-bit) - (%1-bit) - - + AddressBookPage @@ -88,11 +51,7 @@ This product includes software developed by the OpenSSL Project for use in the O Choose the address to receive coins with - Επιλογή διεύθυνσης απ' όπου θα ληφθούν νομίσματα - - - C&hoose - + Επιλογή διεύθυνσης απ' όπου θα ληφθούν νομίσματα Sending addresses @@ -106,10 +65,6 @@ This product includes software developed by the OpenSSL Project for use in the O These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. Αυτές είναι οι Bitcoin διευθύνσεις σας για να λαμβάνετε πληρωμές. Δίνοντας μία ξεχωριστή διεύθυνση σε κάθε αποστολέα, θα μπορείτε να ελέγχετε ποιος σας πληρώνει. - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - Copy &Label Αντιγραφή &επιγραφής @@ -130,11 +85,7 @@ This product includes software developed by the OpenSSL Project for use in the O Exporting Failed Η εξαγωγή απέτυχε - - There was an error trying to save the address list to %1. - Παρουσιάστηκε σφάλμα κατά την αποθήκευση της λίστας πορτοφολιών στο %1. - - + AddressTableModel @@ -168,10 +119,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Επανέλαβε τον νέο κωδικό πρόσβασης - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Εισάγετε τον νέο κωδικό πρόσβασης στον πορτοφόλι <br/> Παρακαλώ χρησιμοποιείστε ένα κωδικό με <b> 10 ή περισσότερους τυχαίους χαρακτήρες</b> ή <b> οχτώ ή παραπάνω λέξεις</b>. - Encrypt wallet Κρυπτογράφησε το πορτοφόλι @@ -272,10 +219,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Overview &Επισκόπηση - - Node - - Show general overview of wallet Εμφάνισε τη γενική εικόνα του πορτοφολιού @@ -296,10 +239,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application Εξοδος από την εφαρμογή - - Show information about Bitcoin - Εμφάνιση πληροφοριών σχετικά με το Bitcoin - About &Qt Σχετικά με &Qt @@ -324,18 +263,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Change Passphrase... &Άλλαξε κωδικο πρόσβασης - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - Importing blocks from disk... Εισαγωγή μπλοκ από τον σκληρο δίσκο ... @@ -406,7 +333,7 @@ This product includes software developed by the OpenSSL Project for use in the O Verify messages to ensure they were signed with specified Bitcoin addresses - Υπογράψτε ένα μήνυμα για ν' αποδείξετε πως ανήκει μια συγκεκριμένη διεύθυνση Bitcoin + Υπογράψτε ένα μήνυμα για ν' αποδείξετε πως ανήκει μια συγκεκριμένη διεύθυνση Bitcoin &File @@ -448,22 +375,6 @@ This product includes software developed by the OpenSSL Project for use in the O Show the list of used receiving addresses and labels Προβολή της λίστας των χρησιμοποιημένων διευθύνσεων και ετικετών λήψεως - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Πελάτης Bitcoin - %n active connection(s) to Bitcoin network %n ενεργή σύνδεση στο δίκτυο Bitcoin%n ενεργές συνδέσεις στο δίκτυο Βitcoin @@ -472,10 +383,6 @@ This product includes software developed by the OpenSSL Project for use in the O No block source available... Η πηγή του μπλοκ δεν ειναι διαθέσιμη... - - Processed %1 of %2 (estimated) blocks of transaction history. - Μεταποιημένα %1 απο %2 (κατ 'εκτίμηση) μπλοκ της ιστορίας της συναλλαγής. - Processed %1 blocks of transaction history. Έγινε λήψη %1 μπλοκ ιστορικού συναλλαγών @@ -560,10 +467,6 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Το πορτοφόλι είναι <b>κρυπτογραφημένο</b> και <b>κλειδωμένο</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Παρουσιάστηκε ανεπανόρθωτο σφάλμα. Το Bitcoin δεν μπορεί πλέον να συνεχίσει με ασφάλεια και θα τερματισθει. - ClientModel @@ -574,10 +477,6 @@ Address: %4 CoinControlDialog - - Coin Control Address Selection - - Quantity: Ποσότητα: @@ -594,18 +493,6 @@ Address: %4 Priority: Προτεραιότητα: - - Fee: - - - - Low Output: - - - - After Fee: - - Change: Ρέστα: @@ -614,14 +501,6 @@ Address: %4 (un)select all (από)επιλογή όλων - - Tree mode - - - - List mode - - Amount Ποσό @@ -662,26 +541,10 @@ Address: %4 Copy transaction ID Αντιγραφη του ID Συναλλαγής - - Lock unspent - - - - Unlock unspent - - Copy quantity Αντιγραφή ποσότητας - - Copy fee - - - - Copy after fee - - Copy bytes Αντιγραφή των byte @@ -690,10 +553,6 @@ Address: %4 Copy priority Αντιγραφή προτεραιότητας - - Copy low output - - Copy change Αντιγραφή των ρέστων @@ -742,10 +601,6 @@ Address: %4 none κανένα - - Dust - - yes ναι @@ -754,42 +609,6 @@ Address: %4 no όχι - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (χωρίς ετικέτα) @@ -818,10 +637,6 @@ Address: %4 The label associated with this address list entry Η ετικέτα που συνδέεται με αυτήν την καταχώρηση στο βιβλίο διευθύνσεων - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Διεύθυνση @@ -843,12 +658,12 @@ Address: %4 Επεξεργασία διεύθυνσης αποστολής - The entered address "%1" is already in the address book. - Η διεύθυνση "%1" βρίσκεται ήδη στο βιβλίο διευθύνσεων. + The entered address "%1" is already in the address book. + Η διεύθυνση "%1" βρίσκεται ήδη στο βιβλίο διευθύνσεων. - The entered address "%1" is not a valid Bitcoin address. - Η διεύθυνση "%1" δεν είναι έγκυρη Bitcoin διεύθυνση. + The entered address "%1" is not a valid Bitcoin address. + Η διεύθυνση "%1" δεν είναι έγκυρη Bitcoin διεύθυνση. Could not unlock wallet. @@ -869,14 +684,6 @@ Address: %4 name όνομα - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - Cannot create data directory here. Δεν μπορεί να δημιουργηθεί φάκελος δεδομένων εδώ. @@ -884,10 +691,6 @@ Address: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core Bitcoin Core @@ -896,6 +699,18 @@ Address: %4 version έκδοση + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + Σχετικά με το Bitcoin Core + + + Command-line options + επιλογής γραμμής εντολών + Usage: Χρήση: @@ -909,26 +724,18 @@ Address: %4 επιλογές UI - Set language, for example "de_DE" (default: system locale) - Όρισε γλώσσα, για παράδειγμα "de_DE"(προεπιλογή:τοπικές ρυθμίσεις) + Set language, for example "de_DE" (default: system locale) + Όρισε γλώσσα, για παράδειγμα "de_DE"(προεπιλογή:τοπικές ρυθμίσεις) Start minimized Έναρξη ελαχιστοποιημένο - - Set SSL root certificates for payment request (default: -system-) - - Show splash screen on startup (default: 1) Εμφάνισε την οθόνη εκκίνησης κατά την εκκίνηση(προεπιλογή:1) - - Choose data directory on startup (default: 0) - - - + Intro @@ -943,10 +750,6 @@ Address: %4 As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. Καθώς αυτή είναι η πρώτη φορά που εκκινείται το πρόγραμμα, μπορείτε να διαλέξετε πού θα αποθηκεύει το Bitcoin Core τα δεδομένα του. - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - Use the default data directory Χρήση του προεπιλεγμένου φακέλου δεδομένων @@ -956,12 +759,8 @@ Address: %4 Προσαρμογή του φακέλου δεδομένων: - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - Σφάλμα: Ο καθορισμένος φάκελος δεδομένων "%1" δεν μπορεί να δημιουργηθεί. + Bitcoin Core + Bitcoin Core Error @@ -978,27 +777,7 @@ Address: %4 OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog @@ -1025,42 +804,10 @@ Address: %4 &Start Bitcoin on system login &Έναρξη του Βιtcoin κατά την εκκίνηση του συστήματος - - Size of &database cache - - MB MB - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - Reset all client options to default. Επαναφορα όλων των επιλογων του πελάτη σε default. @@ -1073,30 +820,10 @@ Address: %4 &Network &Δίκτυο - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - Expert Έμπειρος - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Αυτόματο άνοιγμα των θυρών Bitcoin στον δρομολογητή. Λειτουργεί μόνο αν ο δρομολογητής σας υποστηρίζει τη λειτουργία UPnP. @@ -1117,14 +844,6 @@ Address: %4 Port of the proxy (e.g. 9050) Θύρα διαμεσολαβητή - - SOCKS &Version: - SOCKS &Έκδοση: - - - SOCKS version of the proxy (e.g. 5) - SOCKS εκδοση του διαμεσολαβητη (e.g. 5) - &Window &Παράθυρο @@ -1165,18 +884,6 @@ Address: %4 Choose the default subdivision unit to show in the interface and when sending coins. Διαλέξτε την προεπιλεγμένη υποδιαίρεση που θα εμφανίζεται όταν στέλνετε νομίσματα. - - Whether to show Bitcoin addresses in the transaction list or not. - Επιλέξτε αν θέλετε να εμφανίζονται οι διευθύνσεις Bitcoin στη λίστα συναλλαγών. - - - &Display addresses in transaction list - Εμφάνιση διευθύνσεων στη λίστα συναλλαγών - - - Whether to show coin control features or not. - - &OK &ΟΚ @@ -1201,14 +908,6 @@ Address: %4 Client restart required to activate changes. Χρειάζεται επανεκκίνηση του προγράμματος για να ενεργοποιηθούν οι αλλαγές. - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - The supplied proxy address is invalid. Δεν είναι έγκυρη η διεύθυνση διαμεσολαβητή @@ -1236,10 +935,6 @@ Address: %4 Your current spendable balance Το τρέχον διαθέσιμο υπόλοιπο - - Pending: - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance Το άθροισμα των συναλλαγών που δεν έχουν ακόμα επιβεβαιωθεί και δεν προσμετρώνται στο τρέχον διαθέσιμο υπόλοιπό σας @@ -1276,12 +971,8 @@ Address: %4 Χειρισμός URI - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - Το URI δεν μπορεί να αναλυθεί! Αυτό μπορεί να προκληθεί από μια μη έγκυρη διεύθυνση Bitcoin ή ακατάλληλη παραμέτρο URI. - - - Requested payment amount of %1 is too small (considered dust). - + Invalid payment address %1 + Μη έγκυρη διεύθυνση πληρωμής %1 Payment request error @@ -1291,46 +982,6 @@ Address: %4 Cannot start bitcoin: click-to-pay handler Δεν είναι δυνατή η εκκίνηση του Bitcoin: click-to-pay handler - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - Payment acknowledged Πληρωμή αναγνωρίστηκε @@ -1340,33 +991,28 @@ Address: %4 Σφάλμα αιτήματος δικτύου + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Ποσό - Error: Specified data directory "%1" does not exist. - Σφάλμα: Ο καθορισμένος φάκελος δεδομένων "%1" δεν υπάρχει. + %1 h + %1 ώ - Error: Cannot parse configuration file: %1. Only use key=value syntax. - + %1 m + %1 λ - Error: Invalid combination of -regtest and -testnet. - Σφάλμα: Άκυρος συνδυασμός των -regtest και -testnet + N/A + Μη διαθέσιμο - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Εισάγετε μια διεύθυνση Bitcoin (π.χ. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget @@ -1440,10 +1086,6 @@ Address: %4 Current number of blocks Τρέχον αριθμός μπλοκ - - Estimated total blocks - Κατ' εκτίμηση συνολικά μπλοκς - Last block time Χρόνος τελευταίου μπλοκ @@ -1520,19 +1162,7 @@ Address: %4 %1 GB %1 GB - - %1 m - %1 λ - - - %1 h - %1 ώ - - - %1 h %2 m - %1 ώ %2 λ - - + ReceiveCoinsDialog @@ -1547,30 +1177,6 @@ Address: %4 &Message: &Μήνυμα: - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - Clear all fields of the form. Καθαρισμός όλων των πεδίων της φόρμας. @@ -1579,26 +1185,14 @@ Address: %4 Clear Καθαρισμός - - Requested payments history - - &Request payment &Αίτηση πληρωμής - - Show the selected request (does the same as double clicking an entry) - - Show Εμφάνιση - - Remove the selected entries from the list - - Remove Αφαίρεση @@ -1622,30 +1216,14 @@ Address: %4 QR Code Κώδικας QR - - Copy &URI - - - - Copy &Address - - &Save Image... &Αποθήκευση εικόνας... - - Request payment to %1 - - Payment information Πληροφορίες πληρωμής - - URI - - Address Διεύθυνση @@ -1708,14 +1286,6 @@ Address: %4 Send Coins Αποστολή νομισμάτων - - Coin Control Features - - - - Inputs... - - automatically selected επιλεγμένο αυτόματα @@ -1740,30 +1310,10 @@ Address: %4 Priority: Προτεραιότητα: - - Fee: - - - - Low Output: - - - - After Fee: - - Change: Ρέστα: - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Αποστολή σε πολλούς αποδέκτες ταυτόχρονα @@ -1808,14 +1358,6 @@ Address: %4 Copy amount Αντιγραφή ποσού - - Copy fee - - - - Copy after fee - - Copy bytes Αντιγραφή των byte @@ -1824,10 +1366,6 @@ Address: %4 Copy priority Αντιγραφή προτεραιότητας - - Copy low output - - Copy change Αντιγραφή των ρέστων @@ -1864,10 +1402,6 @@ Address: %4 Transaction creation failed! Η δημιουργία της συναλλαγής απέτυχε! - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - Warning: Invalid Bitcoin address Προειδοποίηση: Μη έγκυρη διεύθυνση Bitcoin @@ -1876,10 +1410,6 @@ Address: %4 (no label) (χωρίς ετικέτα) - - Warning: Unknown change address - - Are you sure you want to send? Είστε βέβαιοι για την αποστολή; @@ -1888,14 +1418,6 @@ Address: %4 added as transaction fee προστέθηκαν ως αμοιβή συναλλαγής - - Payment request expired - Έληξε η αίτηση πληρωμής - - - Invalid payment address %1 - Μη έγκυρη διεύθυνση πληρωμής %1 - SendCoinsEntry @@ -1907,10 +1429,6 @@ Address: %4 Pay &To: Πληρωμή &σε: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Διεύθυνση αποστολής της πληρωμής (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Εισάγετε μια επιγραφή για αυτή τη διεύθυνση ώστε να καταχωρηθεί στο βιβλίο διευθύνσεων @@ -1923,10 +1441,6 @@ Address: %4 Choose previously used address Επιλογή διεύθυνσης που έχει ήδη χρησιμοποιηθεί - - This is a normal payment. - - Alt+A Alt+A @@ -1947,22 +1461,6 @@ Address: %4 Message: Μήνυμα: - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - Pay To: Πληρωμή σε: @@ -1995,11 +1493,7 @@ Address: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - Μπορείτε να υπογράφετε μηνύματα με τις διευθύνσεις σας, ώστε ν' αποδεικνύετε πως αυτές σας ανήκουν. Αποφεύγετε να υπογράφετε κάτι αόριστο καθώς ενδέχεται να εξαπατηθείτε. Υπογράφετε μόνο πλήρης δηλώσεις με τις οποίες συμφωνείτε. - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Εισάγετε μια διεύθυνση Bitcoin (π.χ. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + Μπορείτε να υπογράφετε μηνύματα με τις διευθύνσεις σας, ώστε ν' αποδεικνύετε πως αυτές σας ανήκουν. Αποφεύγετε να υπογράφετε κάτι αόριστο καθώς ενδέχεται να εξαπατηθείτε. Υπογράφετε μόνο πλήρης δηλώσεις με τις οποίες συμφωνείτε. Choose previously used address @@ -2031,7 +1525,7 @@ Address: %4 Sign the message to prove you own this Bitcoin address - Υπογράψτε ένα μήνυμα για ν' αποδείξετε πως σας ανήκει μια συγκεκριμένη διεύθυνση Bitcoin + Υπογράψτε ένα μήνυμα για ν' αποδείξετε πως σας ανήκει μια συγκεκριμένη διεύθυνση Bitcoin Sign &Message @@ -2053,13 +1547,9 @@ Address: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Πληκτρολογήστε την υπογραφή διεύθυνσης, μήνυμα (βεβαιωθείτε ότι έχετε αντιγράψει τις αλλαγές γραμμής, κενά, tabs, κ.λπ. ακριβώς) και την υπογραφή παρακάτω, για να ελέγξει το μήνυμα. Να είστε προσεκτικοί για να μην διαβάσετε περισσότερα στην υπογραφή ό, τι είναι στην υπογραφή ίδιο το μήνυμα , για να μην εξαπατηθούν από έναν άνθρωπο -in - the-middle επίθεση. - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Εισάγετε μια διεύθυνση Bitcoin (π.χ. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address - Υπογράψτε ένα μήνυμα για ν' αποδείξετε πως υπογραφθηκε απο μια συγκεκριμένη διεύθυνση Bitcoin + Υπογράψτε ένα μήνυμα για ν' αποδείξετε πως υπογραφθηκε απο μια συγκεκριμένη διεύθυνση Bitcoin Verify &Message @@ -2070,12 +1560,8 @@ Address: %4 Επαναφορά όλων επαλήθευμενων πεδίων μήνυματος - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Εισάγετε μια διεύθυνση Bitcoin (π.χ. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Κάντε κλικ στο "Υπογραφή Μηνύματος" για να λάβετε την υπογραφή + Click "Sign Message" to generate signature + Κάντε κλικ στο "Υπογραφή Μηνύματος" για να λάβετε την υπογραφή The entered address is invalid. @@ -2154,10 +1640,6 @@ Address: %4 Open until %1 Ανοιχτό μέχρι %1 - - conflicted - - %1/offline %1/χωρίς σύνδεση; @@ -2246,10 +1728,6 @@ Address: %4 Merchant Έμπορος - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - Debug information Πληροφορίες αποσφαλμάτωσης @@ -2276,7 +1754,7 @@ Address: %4 , has not been successfully broadcast yet - , δεν έχει ακόμα μεταδοθεί μ' επιτυχία + , δεν έχει ακόμα μεταδοθεί μ' επιτυχία Open for %n more block(s) @@ -2312,14 +1790,6 @@ Address: %4 Address Διεύθυνση - - Amount - Ποσό - - - Immature (%1 confirmations, will be available after %2) - - Open for %n more block(s) Ανοιχτό για %n μπλοκΑνοιχτό για %n μπλοκ @@ -2348,14 +1818,6 @@ Address: %4 Unconfirmed Ανεπιβεβαίωτες - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with Παραλαβή με @@ -2499,10 +1961,6 @@ Address: %4 Exporting Successful Επιτυχής εξαγωγή - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Αρχείο οριοθετημένο με κόμματα (*.csv) @@ -2527,10 +1985,6 @@ Address: %4 Address Διεύθυνση - - Amount - Ποσό - ID ID @@ -2544,6 +1998,9 @@ Address: %4 έως + + UnitDisplayStatusBarControl + WalletFrame @@ -2580,10 +2037,6 @@ Address: %4 Backup Failed Αποτυχία κατά τη δημιουργία αντιγράφου - - There was an error trying to save the wallet data to %1. - - The wallet data was successfully saved to %1. Τα δεδομένα πορτοφολιού αποθηκεύτηκαν με επιτυχία στο %1. @@ -2595,18 +2048,6 @@ Address: %4 bitcoin-core - - Usage: - Χρήση: - - - List commands - Λίστα εντολών - - - Get help for a command - Επεξήγηση εντολής - Options: Επιλογές: @@ -2647,10 +2088,6 @@ Address: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Δευτερόλεπτα πριν επιτραπεί ξανά η σύνδεση των προβληματικών peers (προεπιλογή: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Ένα σφάλμα συνέβη καθώς προετοιμαζόταν η πόρτα RPC %u για αναμονή IPv4: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Εισερχόμενες συνδέσεις JSON-RPC στη θύρα <port> (προεπιλογή: 8332 or testnet: 18332) @@ -2659,10 +2096,6 @@ Address: %4 Accept command line and JSON-RPC commands Αποδοχή εντολών κονσόλας και JSON-RPC - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Εκτέλεση στο παρασκήνιο κι αποδοχή εντολών @@ -2685,7 +2118,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, you must set a rpcpassword in the configuration file: %s @@ -2696,37 +2129,13 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Ένα σφάλμα συνέβη καθώς προετοιμαζόταν η υποδοχη RPC %u για αναμονη του IPv6, επεσε πισω στο IPv4:%s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Αποθηκευση σε συγκεκριμένη διεύθυνση. Χρησιμοποιήστε τα πλήκτρα [Host] : συμβολισμός θύρα για IPv6 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Σφάλμα: Η συναλλαγή απορρίφθηκε. @@ -2740,58 +2149,14 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Εκτέλεσε την εντολή όταν το καλύτερο μπλοκ αλλάξει(%s στην εντολή αντικαθίσταται από το hash του μπλοκ) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Αυτό είναι ένα προ-τεστ κυκλοφορίας - χρησιμοποιήστε το με δική σας ευθύνη - δεν χρησιμοποιείτε για εξόρυξη ή για αλλες εφαρμογές - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Προειδοποίηση: Η παράμετρος -paytxfee είναι πολύ υψηλή. Πρόκειται για την αμοιβή που θα πληρώνετε για κάθε συναλλαγή που θα στέλνετε. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Προειδοποίηση: Παρακαλώ βεβαιωθείτε πως η ημερομηνία κι ώρα του συστήματός σας είναι σωστές. Αν το ρολόι του υπολογιστή σας πάει λάθος, ενδέχεται να μη λειτουργεί σωστά το Bitcoin. - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. Προειδοποίηση : Σφάλμα wallet.dat κατα την ανάγνωση ! Όλα τα κλειδιά αναγνωρισθηκαν σωστά, αλλά τα δεδομένα των συναλλαγών ή καταχωρήσεις στο βιβλίο διευθύνσεων μπορεί να είναι ελλιπείς ή λανθασμένα. @@ -2808,38 +2173,18 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. (default: wallet.dat) (προεπιλογή: wallet.dat) - - <category> can be: - - Attempt to recover private keys from a corrupt wallet.dat Προσπάθεια για ανακτησει ιδιωτικων κλειδιων από ενα διεφθαρμένο αρχειο wallet.dat - - Bitcoin Core Daemon - - Block creation options: Αποκλεισμός επιλογων δημιουργίας: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) Σύνδεση μόνο με ορισμένους κόμβους - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - Connection options: Επιλογές σύνδεσης: @@ -2848,22 +2193,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Corrupted block database detected Εντοπισθηκε διεφθαρμενη βαση δεδομενων των μπλοκ - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - Discover own IP address (default: 1 when listening and no -externalip) Ανακαλύψτε την δικη σας IP διεύθυνση (προεπιλογή: 1 όταν ακούει και δεν - externalip) - - Do not load the wallet and disable wallet RPC calls - - Do you want to rebuild the block database now? Θελετε να δημιουργηθει τωρα η βαση δεδομενων του μπλοκ? @@ -2940,22 +2273,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write undo data Αποτυχία εγγραφής αναίρεσης δεδομένων - - Fee per kB to add to transactions you send - Προσθήκη αμοιβής ανά kB στις συναλλαγές που στέλνετε - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - Βρες ομότιμους υπολογιστές χρησιμοποιώντας αναζήτηση DNS(προεπιλογή:1) - - - Force safe mode (default: 0) - - Generate coins (default: 0) Δημιουργία νομισμάτων (προκαθορισμος: 0) @@ -2965,69 +2282,21 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Πόσα μπλοκ να ελέγχθουν κατά την εκκίνηση (προεπιλογή:288,0=όλα) - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - Άκυρη διεύθυνση -onion : '%s' + Invalid -onion address: '%s' + Άκυρη διεύθυνση -onion : '%s' Not enough file descriptors available. Δεν ειναι αρκετες περιγραφες αρχείων διαθέσιμες. - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - Rebuild block chain index from current blk000??.dat files Εισαγωγή μπλοκ από εξωτερικό αρχείο blk000?.dat - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - Set the number of threads to service RPC calls (default: 4) Ορίσμος του αριθμόυ θεματων στην υπηρεσία κλήσεων RPC (προεπιλογή: 4) - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - Verifying blocks... Επαλήθευση των μπλοκ... @@ -3036,65 +2305,25 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Verifying wallet... Επαλήθευση πορτοφολιου... - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - Wallet options: Επιλογές πορτοφολιού: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - Imports blocks from external blk000??.dat file Εισαγωγή μπλοκ από εξωτερικό αρχείο blk000?.dat - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information Πληροφορία - Invalid amount for -minrelaytxfee=<amount>: '%s' - Μη έγκυρο ποσό για την παράμετρο -paytxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Μη έγκυρο ποσό για την παράμετρο -paytxfee=<amount>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - Μη έγκυρο ποσό για την παράμετρο -paytxfee=<amount>: '%s' - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - + Invalid amount for -mintxfee=<amount>: '%s' + Μη έγκυρο ποσό για την παράμετρο -paytxfee=<amount>: '%s' Maintain a full transaction index (default: 0) @@ -3116,42 +2345,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Only connect to nodes in network <net> (IPv4, IPv6 or Tor) Συνδέση μόνο σε κόμβους του δικτύου <net> (IPv4, IPv6 ή Tor) - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - Ρυθμίσεις SSL: (ανατρέξτε στο Bitcoin Wiki για οδηγίες ρυθμίσεων SSL) - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file Αποστολή πληροφοριών εντοπισμού σφαλμάτων στην κονσόλα αντί του αρχείου debug.log @@ -3160,18 +2353,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Set minimum block size in bytes (default: 0) Ορίστε το μέγιστο μέγεθος μπλοκ σε bytes (προεπιλογή: 0) - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - Shrink debug.log file on client startup (default: 1 when no -debug) Συρρίκνωση του αρχείο debug.log κατα την εκκίνηση του πελάτη (προεπιλογή: 1 όταν δεν-debug) @@ -3184,10 +2365,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Specify connection timeout in milliseconds (default: 5000) Ορισμός λήξης χρονικού ορίου σε χιλιοστά του δευτερολέπτου(προεπιλογή:5000) - - Start Bitcoin Core Daemon - - System error: Λάθος Συστήματος: @@ -3224,18 +2401,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: This version is obsolete, upgrade required! Προειδοποίηση: Αυτή η έκδοση είναι ξεπερασμένη, απαιτείται αναβάθμιση - - Zapping all transactions from wallet... - - on startup κατά την εκκίνηση - - version - έκδοση - wallet.dat corrupt, salvage failed Το αρχειο wallet.dat ειναι διεφθαρμένο, η διάσωση απέτυχε @@ -3244,14 +2413,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Password for JSON-RPC connections Κωδικός για τις συνδέσεις JSON-RPC - - Allow JSON-RPC connections from specified IP address - Αποδοχή συνδέσεων JSON-RPC από συγκεκριμένη διεύθυνση IP - - - Send commands to node running on <ip> (default: 127.0.0.1) - Αποστολή εντολών στον κόμβο <ip> (προεπιλογή: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Εκτέλεσε την εντολή όταν το καλύτερο μπλοκ αλλάξει(%s στην εντολή αντικαθίσταται από το hash του μπλοκ) @@ -3284,10 +2445,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message Αυτό το κείμενο βοήθειας - - Unable to bind to %s on this computer (bind returned error %d, %s) - Αδύνατη η σύνδεση με τη θύρα %s αυτού του υπολογιστή (bind returned error %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Να επιτρέπονται οι έλεγχοι DNS για προσθήκη και σύνδεση κόμβων @@ -3300,41 +2457,29 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted Σφάλμα φόρτωσης wallet.dat: Κατεστραμμένο Πορτοφόλι - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Σφάλμα φόρτωσης wallet.dat: Το Πορτοφόλι απαιτεί μια νεότερη έκδοση του Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - Απαιτείται η επανεγγραφή του Πορτοφολιού, η οποία θα ολοκληρωθεί στην επανεκκίνηση του Bitcoin - Error loading wallet.dat Σφάλμα φόρτωσης αρχείου wallet.dat - Invalid -proxy address: '%s' - Δεν είναι έγκυρη η διεύθυνση διαμεσολαβητή: '%s' + Invalid -proxy address: '%s' + Δεν είναι έγκυρη η διεύθυνση διαμεσολαβητή: '%s' - Unknown network specified in -onlynet: '%s' - Άγνωστo δίκτυο ορίζεται σε onlynet: '%s' + Unknown network specified in -onlynet: '%s' + Άγνωστo δίκτυο ορίζεται σε onlynet: '%s' - Unknown -socks proxy version requested: %i - Άγνωστo δίκτυο ορίζεται: %i + Cannot resolve -bind address: '%s' + Δεν μπορώ να γράψω την προεπιλεγμένη διεύθυνση: '%s' - Cannot resolve -bind address: '%s' - Δεν μπορώ να γράψω την προεπιλεγμένη διεύθυνση: '%s' + Cannot resolve -externalip address: '%s' + Δεν μπορώ να γράψω την προεπιλεγμένη διεύθυνση: '%s' - Cannot resolve -externalip address: '%s' - Δεν μπορώ να γράψω την προεπιλεγμένη διεύθυνση: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Μη έγκυρο ποσό για την παράμετρο -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Μη έγκυρο ποσό για την παράμετρο -paytxfee=<amount>: '%s' Invalid amount @@ -3380,12 +2525,5 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error Σφάλμα - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Πρέπει να βάλεις ένα κωδικό στο αρχείο παραμέτρων: %s -Εάν το αρχείο δεν υπάρχει, δημιούργησε το με δικαιώματα μόνο για ανάγνωση από τον δημιουργό - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_eo.ts b/src/qt/locale/bitcoin_eo.ts index 8c2869abac..652ee2d9bf 100644 --- a/src/qt/locale/bitcoin_eo.ts +++ b/src/qt/locale/bitcoin_eo.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - Pri la Bitmona Kerno - - - <b>Bitcoin Core</b> version - Versio de <b>Bitmona Kerno</b> - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Tio ĉi estas eksperimenta programo. - -Eldonita laŭ la permesilo MIT/X11. Vidu la kunan dosieron COPYING aŭ http://www.opensource.org/licenses/mit-license.php. - -Tiu ĉi produkto enhavas erojn kreitajn de la "OpenSSL Project" por uzo en la "OpenSSL Toolkit" (http://www.openssl.org/) kaj ĉifrajn erojn kreitajn de Eric Young (eay@cryptsoft.com) kaj UPnP-erojn kreitajn de Thomas Bernard. - - - Copyright - Kopirajto - - - The Bitcoin Core developers - La programistoj de Bitmona Kerno - - - (%1-bit) - - - + AddressBookPage @@ -126,15 +89,7 @@ Tiu ĉi produkto enhavas erojn kreitajn de la "OpenSSL Project" por uz Comma separated file (*.csv) Perkome disigita dosiero (*.csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -168,10 +123,6 @@ Tiu ĉi produkto enhavas erojn kreitajn de la "OpenSSL Project" por uz Repeat new passphrase Ripetu la novan pasfrazon - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Enigu novan pasfrazon por la monujo.<br/>Bonvolu uzi pasfrazon kun <b>almenaŭ 10 hazardaj signoj</b>, aŭ <b>almenaŭ ok vortoj</b>. - Encrypt wallet Ĉifri la monujon @@ -295,10 +246,6 @@ Tiu ĉi produkto enhavas erojn kreitajn de la "OpenSSL Project" por uz Quit application Eliri la aplikaĵon - - Show information about Bitcoin - Vidigi informojjn pri Bitmono - About &Qt Pri &Qt @@ -455,14 +402,6 @@ Tiu ĉi produkto enhavas erojn kreitajn de la "OpenSSL Project" por uz &Command-line options &Komandliniaj agordaĵoj - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Bitmon-kliento - %n active connection(s) to Bitcoin network %n aktiva konekto al la bitmona reto%n aktivaj konektoj al la bitmona reto @@ -471,10 +410,6 @@ Tiu ĉi produkto enhavas erojn kreitajn de la "OpenSSL Project" por uz No block source available... Neniu fonto de blokoj trovebla... - - Processed %1 of %2 (estimated) blocks of transaction history. - Traktis %1 el (ĉirkaŭ) %2 blokoj de la transakcia historio. - Processed %1 blocks of transaction history. Traktis %1 blokoj de la transakcia historio. @@ -495,10 +430,6 @@ Tiu ĉi produkto enhavas erojn kreitajn de la "OpenSSL Project" por uz %1 and %2 %1 kaj %2 - - %n year(s) - - %1 behind mankas %1 @@ -559,10 +490,6 @@ Adreso: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Monujo estas <b>ĉifrita</b> kaj aktuale <b>ŝlosita</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Okazis neriparebla eraro. Bitmono ne plu povas sekure daŭri, do ĝi sekure ĉesos. - ClientModel @@ -573,10 +500,6 @@ Adreso: %4 CoinControlDialog - - Coin Control Address Selection - - Quantity: Kvanto: @@ -597,10 +520,6 @@ Adreso: %4 Fee: Krompago: - - Low Output: - Malalta Eligo: - After Fee: Post krompago: @@ -689,10 +608,6 @@ Adreso: %4 Copy priority Kopii prioritaton - - Copy low output - Kopii malaltan eligon - Copy change Kopii restmonon @@ -741,10 +656,6 @@ Adreso: %4 none neniu - - Dust - Polvo - yes jes @@ -769,26 +680,10 @@ Adreso: %4 Transactions with higher priority are more likely to get included into a block. Transakcioj kun pli alta prioritato havas pli altan ŝancon inkluziviĝi en bloko. - - This label turns red, if the priority is smaller than "medium". - - This label turns red, if any recipient receives an amount smaller than %1. Tiu ĉi etikedo ruĝiĝas se iu ajn ricevonto ricevos sumon malpli ol %1. - - This means a fee of at least %1 is required. - Tio signifas, ke krompago de almenaŭ %1 estas deviga. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - Sumoj, kiuj valoras malpli ol 0.545 oble la minimuman plusendan kromkoston vidiĝas kiel polvo. - - - This label turns red, if the change is smaller than %1. - Tiu ĉi etikedo ruĝiĝas se la restmono estas malpli ol %1. - (no label) (neniu etikedo) @@ -841,12 +736,12 @@ Adreso: %4 Redakti adreson por sendi - The entered address "%1" is already in the address book. - La adreso enigita "%1" jam ekzistas en la adresaro. + The entered address "%1" is already in the address book. + La adreso enigita "%1" jam ekzistas en la adresaro. - The entered address "%1" is not a valid Bitcoin address. - La adreso enigita "%1" ne estas valida Bitmon-adreso. + The entered address "%1" is not a valid Bitcoin address. + La adreso enigita "%1" ne estas valida Bitmon-adreso. Could not unlock wallet. @@ -882,10 +777,6 @@ Adreso: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Bitmona Kerno - Komandliniaj agordaĵoj - Bitcoin Core Kerno de Bitmono @@ -894,6 +785,14 @@ Adreso: %4 version versio + + About Bitcoin Core + Pri la Bitmona Kerno + + + Command-line options + Komandliniaj agordaĵoj + Usage: Uzado: @@ -907,17 +806,13 @@ Adreso: %4 UI-agordaĵoj - Set language, for example "de_DE" (default: system locale) - Agordi lingvon, ekzemple "de_DE" (defaŭlte: tiu de la sistemo) + Set language, for example "de_DE" (default: system locale) + Agordi lingvon, ekzemple "de_DE" (defaŭlte: tiu de la sistemo) Start minimized Lanĉiĝi plejete - - Set SSL root certificates for payment request (default: -system-) - - Show splash screen on startup (default: 1) Montri salutŝildon dum lanĉo (defaŭlte: 1) @@ -954,12 +849,8 @@ Adreso: %4 Uzi alian dosierujon por datumoj: - Bitcoin - Bitmono - - - Error: Specified data directory "%1" can not be created. - Eraro: ne eblas krei la elektitan dosierujon por datumoj "%1". + Bitcoin Core + Kerno de Bitmono Error @@ -1031,34 +922,6 @@ Adreso: %4 MB MB - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - Reset all client options to default. Reagordi ĉion al defaŭlataj valoroj. @@ -1071,30 +934,6 @@ Adreso: %4 &Network &Reto - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Aŭtomate malfermi la kursilan pordon por Bitmono. Tio funkcias nur se via kursilo havas la UPnP-funkcion, kaj se tiu ĉi estas ŝaltita. @@ -1115,14 +954,6 @@ Adreso: %4 Port of the proxy (e.g. 9050) la pordo de la prokurilo (ekz. 9050) - - SOCKS &Version: - Versio de SOCKS: - - - SOCKS version of the proxy (e.g. 5) - la versio de SOCKS ĉe la prokurilo (ekz. 5) - &Window &Fenestro @@ -1137,7 +968,7 @@ Adreso: %4 Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - Minimumigi la aplikaĵon anstataŭ eliri kaj ĉesi kiam la fenestro estas fermita. Se tiu ĉi estas agordita, la aplikaĵo ĉesas nur kiam oni elektas "Eliri" el la menuo. + Minimumigi la aplikaĵon anstataŭ eliri kaj ĉesi kiam la fenestro estas fermita. Se tiu ĉi estas agordita, la aplikaĵo ĉesas nur kiam oni elektas "Eliri" el la menuo. M&inimize on close @@ -1163,14 +994,6 @@ Adreso: %4 Choose the default subdivision unit to show in the interface and when sending coins. Elekti la defaŭltan manieron por montri bitmonajn sumojn en la interfaco, kaj kiam vi sendos bitmonon. - - Whether to show Bitcoin addresses in the transaction list or not. - Elekti ĉu videblu Bitmon-adresoj en la listo de transakcioj. - - - &Display addresses in transaction list - &Montri adresojn en la listo de transakcioj - Whether to show coin control features or not. Ĉu montri detalan adres-regilon, aŭ ne. @@ -1195,18 +1018,6 @@ Adreso: %4 Confirm options reset Konfirmi reŝargo de agordoj - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - The supplied proxy address is invalid. La prokurila adreso estas malvalida. @@ -1226,18 +1037,10 @@ Adreso: %4 Wallet Monujo - - Available: - - Your current spendable balance via aktuala elspezebla saldo - - Pending: - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance la sumo de transakcioj ankoraŭ ne konfirmitaj, kiuj ankoraŭ ne elspezeblas @@ -1274,8 +1077,8 @@ Adreso: %4 Traktado de URI-oj - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - Fiaskis la analizon de la URI! Eble la Bitmon-adreso estas nevalida, aŭ povus esti problemo kun la parametroj de la URI. + Invalid payment address %1 + Nevalida pagadreso %1 Requested payment amount of %1 is too small (considered dust). @@ -1287,31 +1090,7 @@ Adreso: %4 Cannot start bitcoin: click-to-pay handler - Ne eblas lanĉi la ilon 'klaki-por-pagi' - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - + Ne eblas lanĉi la ilon 'klaki-por-pagi' Refund from %1 @@ -1321,10 +1100,6 @@ Adreso: %4 Error communicating with %1: %2 Eraro dum komunikado kun %1: %2 - - Payment request can not be parsed or processed! - - Bad response from server %1 Malbona respondo de la servilo %1 @@ -1338,33 +1113,28 @@ Adreso: %4 Eraro dum ret-peto + + PeerTableModel + QObject - Bitcoin - Bitmono + Amount + Sumo - Error: Specified data directory "%1" does not exist. - Eraro: la elektita dosierujo por datumoj "%1" ne ekzistas. + %1 h + %1 h - Error: Cannot parse configuration file: %1. Only use key=value syntax. - + %1 m + %1 m - Error: Invalid combination of -regtest and -testnet. - Eraro: nevalida kunigo de -regtest kaj -testnet + N/A + neaplikebla - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enigi Bitmon-adreson (ekz. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget @@ -1438,10 +1208,6 @@ Adreso: %4 Current number of blocks Aktuala nombro de blokoj - - Estimated total blocks - Supozita totalo da blokoj - Last block time Horo de la lasta bloko @@ -1518,19 +1284,7 @@ Adreso: %4 %1 GB %1 GB - - %1 m - %1 m - - - %1 h - %1 h - - - %1 h %2 m - %1 h %2 m - - + ReceiveCoinsDialog @@ -1553,22 +1307,6 @@ Adreso: %4 R&euse an existing receiving address (not recommended) R&euzi ekzistantan ricevan adreson (malrekomendinda) - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - Clear all fields of the form. Malplenigi ĉiujn kampojn de la formularo. @@ -1577,26 +1315,14 @@ Adreso: %4 Clear Forigi - - Requested payments history - - &Request payment &Peti pagon - - Show the selected request (does the same as double clicking an entry) - - Show Vidigi - - Remove the selected entries from the list - - Remove Forigi @@ -1695,11 +1421,7 @@ Adreso: %4 (no message) (neniu mesaĝo) - - (no amount) - - - + SendCoinsDialog @@ -1714,10 +1436,6 @@ Adreso: %4 Inputs... Enigoj... - - automatically selected - - Insufficient funds! Nesufiĉa mono! @@ -1742,10 +1460,6 @@ Adreso: %4 Fee: Krompago: - - Low Output: - Malalta Eligo: - After Fee: Post krompago: @@ -1754,14 +1468,6 @@ Adreso: %4 Change: Restmono: - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Sendi samtempe al pluraj ricevantoj @@ -1822,10 +1528,6 @@ Adreso: %4 Copy priority Kopii prioritaton - - Copy low output - Kopii malaltan eligon - Copy change Kopii restmonon @@ -1862,10 +1564,6 @@ Adreso: %4 Transaction creation failed! Kreo de transakcio fiaskis! - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - Warning: Invalid Bitcoin address Averto: Nevalida Bitmon-adreso @@ -1874,10 +1572,6 @@ Adreso: %4 (no label) (neniu etikedo) - - Warning: Unknown change address - - Are you sure you want to send? Ĉu vi certas, ke vi volas sendi? @@ -1886,14 +1580,6 @@ Adreso: %4 added as transaction fee aldonita kiel krompago - - Payment request expired - Pagopeto nun estas eksdata - - - Invalid payment address %1 - Nevalida pagadreso %1 - SendCoinsEntry @@ -1905,10 +1591,6 @@ Adreso: %4 Pay &To: &Ricevonto: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - La adreso kie vi sendos la pagon (ekz. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Tajpu etikedon por tiu ĉi adreso kaj aldonu ĝin al via adresaro @@ -1945,22 +1627,10 @@ Adreso: %4 Message: Mesaĝo: - - This is a verified payment request. - - Enter a label for this address to add it to the list of used addresses Tajpu etikedon por tiu ĉi adreso por aldoni ĝin al la listo de uzitaj adresoj - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - Pay To: Pagi Al: @@ -1972,10 +1642,6 @@ Adreso: %4 ShutdownWindow - - Bitcoin Core is shutting down... - - Do not shut down the computer until this window disappears. Ne sistemfermu ĝis ĉi tiu fenestro malaperas. @@ -1995,10 +1661,6 @@ Adreso: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Vi povas subskribi mesaĝon per viaj adresoj, por pravigi ke vi estas la posedanto de tiuj adresoj. Atentu, ke vi ne subskriu ion neprecizan, ĉar trompisto povus ruzi kontraŭ vi kaj ŝteli vian identecon. Subskribu nur plene detaligitaj deklaroj pri kiuj vi konsentas. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - La adreso por subskribi la mesaĝon (ekz. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Choose previously used address Elektu la jam uzitan adreson @@ -2051,10 +1713,6 @@ Adreso: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Enmeti la subskriban adreson, la mesaĝon (kune kun ĉiu linisalto, spaceto, taboj, ktp. precize) kaj la subskribon ĉi sube por kontroli la mesaĝon. Atentu, ke vi ne komprenu per la subskribo pli ol la enhavo de la mesaĝo mem, por eviti homo-en-la-mezo-atakon. - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - La adreso per kio oni subskribis la mesaĝon (ekz. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address Kontroli la mesaĝon por pravigi, ke ĝi ja estas subskribita per la specifa Bitmon-adreso @@ -2068,12 +1726,8 @@ Adreso: %4 Reagordigi ĉiujn prikontrolajn kampojn - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enigi Bitmon-adreson (ekz. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Klaku "Subskribi Mesaĝon" por krei subskribon + Click "Sign Message" to generate signature + Klaku "Subskribi Mesaĝon" por krei subskribon The entered address is invalid. @@ -2152,10 +1806,6 @@ Adreso: %4 Open until %1 Malferma ĝis %1 - - conflicted - - %1/offline %1/senkonekte @@ -2245,8 +1895,8 @@ Adreso: %4 Vendisto - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - Kreitaj moneroj devas esti maturaj je %1 blokoj antaŭ ol eblas elspezi ilin. Kiam vi generis tiun ĉi blokon, ĝi estis elsendita al la reto por aldono al la blokĉeno. Se tiu aldono malsukcesas, ĝia stato ŝanĝiĝos al "neakceptita" kaj ne eblos elspezi ĝin. Tio estas malofta, sed povas okazi se alia bloko estas kreita je preskaŭ la sama momento kiel la via. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Kreitaj moneroj devas esti maturaj je %1 blokoj antaŭ ol eblas elspezi ilin. Kiam vi generis tiun ĉi blokon, ĝi estis elsendita al la reto por aldono al la blokĉeno. Se tiu aldono malsukcesas, ĝia stato ŝanĝiĝos al "neakceptita" kaj ne eblos elspezi ĝin. Tio estas malofta, sed povas okazi se alia bloko estas kreita je preskaŭ la sama momento kiel la via. Debug information @@ -2310,14 +1960,6 @@ Adreso: %4 Address Adreso - - Amount - Sumo - - - Immature (%1 confirmations, will be available after %2) - - Open for %n more block(s) Malferma dum ankoraŭ %n blokoMalferma dum ankoraŭ %n blokoj @@ -2346,14 +1988,6 @@ Adreso: %4 Unconfirmed Nekonfirmita - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with Ricevita kun @@ -2481,26 +2115,6 @@ Adreso: %4 Show transaction details Montri detalojn de transakcio - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Perkome disigita dosiero (*.csv) @@ -2525,10 +2139,6 @@ Adreso: %4 Address Adreso - - Amount - Sumo - ID ID @@ -2542,13 +2152,12 @@ Adreso: %4 al + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2578,14 +2187,6 @@ Adreso: %4 Backup Failed Malsukcesis sekurkopio - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - Backup Successful Sukcesis krei sekurkopion @@ -2593,18 +2194,6 @@ Adreso: %4 bitcoin-core - - Usage: - Uzado: - - - List commands - Listigi komandojn - - - Get help for a command - Vidigi helpon pri iu komando - Options: Agordoj: @@ -2645,10 +2234,6 @@ Adreso: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Nombro da sekundoj por rifuzi rekonekton de misagantaj samtavolanoj (defaŭlte: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Eraro okazis dum estigo de RPC-pordo %u por aŭskulti per IPv4: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Aŭskulti al <port> por JSON-RPC-konektoj (defaŭlte: 8332 aŭ testnet: 18332) @@ -2657,10 +2242,6 @@ Adreso: %4 Accept command line and JSON-RPC commands Akcepti komandojn JSON-RPC kaj el komandlinio - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Ruli fone kiel demono kaj akcepti komandojn @@ -2683,7 +2264,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, vi devas specifi rpcpassword en la konfigura dosiero: %s @@ -2692,39 +2273,19 @@ rpcuser=bitcoinrpc rpcpassword=%s (ne utilas al vi memorigi tiun ĉi pasvorton) La salutnomo kaj la pasvorto estu nepre MALSAMAJ. -Se la dosiero ne ekzistas, kreu ĝin kun permeso "nur posedanto rajtas legi". +Se la dosiero ne ekzistas, kreu ĝin kun permeso "nur posedanto rajtas legi". Estas konsilinde ankaŭ agordi alertnotify por ke vi ricevu avertojn pri eventualaj problemoj; -ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo.com +ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Akcepteblaj ĉifroj (defaŭlte: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Eraro okazis dum estigo de RPC-pordo %u por aŭskulti per IPv6; retrodefaŭltas al IPv4: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Bindi al donita adreso kaj ĉiam aŭskulti per ĝi. Uzu la formaton [gastigo]:pordo por IPv6 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Ŝalti reĝimo de regresotestado, kiu uzas specialan ĉenon en kiu oni povas tuj solvi blokojn. La celo de tio estas regresotestilo kaj la kreado de aplikaĵoj. - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Eraro: la transakcio estas rifuzita. Tio povas okazi se iom da Bitmono en via monujo jam elspeziĝis (ekz. se vi uzis kopion de wallet.dat kies Bitmono jam elspeziĝis, sed ne estis markita kiel elspezita ĉi tie). @@ -2737,50 +2298,14 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Plenumi komandon kiam monuja transakcio ŝanĝiĝas (%s en cmd anstataŭiĝas per TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Tiu ĉi estas antaŭeldona testa versio - uzu laŭ via propra risko - ne uzu por minado aŭ por aplikaĵoj por vendistoj - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Averto: -paytxfee estas agordita per tre alta valoro! Tio estas la krompago, kion vi pagos se vi sendas la transakcion. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Averto: Bonvolu kontroli, ke la horo kaj dato de via komputilo estas ĝuste agorditaj! Se via horloĝo malĝustas, Bitmono ne bone funkcios. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Averto: La reto ne tute konsentas! Kelkaj minantoj ŝajne spertas problemojn aktuale. @@ -2797,14 +2322,6 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. Averto: via wallet.dat estas difektita, sed la datumoj sukcese saviĝis! La originala wallet.dat estas nun konservita kiel wallet.{timestamp}.bak en %s; se via saldo aŭ transakcioj estas malĝustaj vi devus restaŭri per alia sekurkopio. - - (default: 1) - - - - (default: wallet.dat) - - <category> can be: <category> povas esti: @@ -2813,54 +2330,22 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo Attempt to recover private keys from a corrupt wallet.dat Provo ripari privatajn ŝlosilojn el difektita wallet.dat - - Bitcoin Core Daemon - Bitmonakerna Demono - Block creation options: Blok-kreaj agordaĵoj: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) Konekti nur al specifita(j) nodo(j) - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - Konekti al la JSON-RPC per <port> (defaŭlte: 8332 aŭ testnet: 18332) - - - Connection options: - - Corrupted block database detected Difektita blokdatumbazo trovita - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - Discover own IP address (default: 1 when listening and no -externalip) Malkovri la propran IP-adreson (defaŭlte: 1 dum aŭskultado sen -externalip) - - Do not load the wallet and disable wallet RPC calls - - Do you want to rebuild the block database now? Ĉu vi volas rekonstrui la blokdatumbazon nun? @@ -2937,22 +2422,6 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo Failed to write undo data Malsukcesis skribi malfarajn datumojn - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - Trovi samtavolanojn per DNS-elserĉo (defaŭlte: 1 krom kaze de -connect) - - - Force safe mode (default: 0) - - Generate coins (default: 0) Generi Bitmonon (defaŭlte: 0) @@ -2961,50 +2430,22 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo How many blocks to check at startup (default: 288, 0 = all) Kiom da blokoj kontrolendas dum lanĉo (defaŭlte: 288, 0=ĉiuj) - - If <category> is not supplied, output all debugging information. - - - - Importing... - - Incorrect or no genesis block found. Wrong datadir for network? Geneza bloko aŭ netrovita aŭ neĝusta. Ĉu eble la datadir de la reto malĝustas? - Invalid -onion address: '%s' - Nevalida -onion-adreso: '%s' + Invalid -onion address: '%s' + Nevalida -onion-adreso: '%s' Not enough file descriptors available. Nesufiĉa nombro de dosierpriskribiloj disponeblas. - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - Rebuild block chain index from current blk000??.dat files Rekontrui blokĉenan indekson el la aktualaj blk000??.dat dosieroj - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - Set the number of threads to service RPC calls (default: 4) Specifi la nombron de fadenoj por priatenti RPC-alvokojn (defaŭlte: 4) @@ -3013,18 +2454,6 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo Specify wallet file (within data directory) Specifi monujan dosieron (ene de dosierujo por datumoj) - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - Uzado (malaktuala, uzu anstataŭe bitcoin-cli): - Verifying blocks... Kontrolado de blokoj... @@ -3033,10 +2462,6 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo Verifying wallet... Kontrolado de monujo... - - Wait for RPC server to start - Atendu por RPC-an servilo komenci - Wallet %s resides outside data directory %s Monujo %s troviĝas ekster la dosierujo por datumoj %s @@ -3045,10 +2470,6 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo Wallet options: Monujaj opcioj: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - You need to rebuild the database using -reindex to change -txindex Vi devas rekontrui la datumbazon kun -reindex por ŝanĝi -txindex @@ -3057,41 +2478,21 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo Imports blocks from external blk000??.dat file Importas blokojn el ekstera dosiero blk000??.dat - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Plenumi komandon kiam rilata alerto riceviĝas, aŭ kiam ni vidas tre longan forkon (%s en cms anstataŭiĝas per mesaĝo) - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information Informoj - Invalid amount for -minrelaytxfee=<amount>: '%s' - Nevalida sumo por -minrelaytxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Nevalida sumo por -minrelaytxfee=<amount>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - Nevalida sumo por -mintxfee=<amount>: '%s' - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - + Invalid amount for -mintxfee=<amount>: '%s' + Nevalida sumo por -mintxfee=<amount>: '%s' Maintain a full transaction index (default: 0) @@ -3113,42 +2514,6 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo Only connect to nodes in network <net> (IPv4, IPv6 or Tor) Konekti nur la nodoj en la reto <net> (IPv4, IPv6 aŭ Tor) - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL-agordaĵoj: (vidu la vikio de Bitmono por instrukcioj pri agordado de SSL) - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file Sendi spurajn/sencimigajn informojn al la konzolo anstataŭ al dosiero debug.log @@ -3157,18 +2522,6 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo Set minimum block size in bytes (default: 0) Agordi minimuman grandon de blokoj je bajtoj (defaŭlte: 0) - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - Shrink debug.log file on client startup (default: 1 when no -debug) Malpligrandigi la sencimigan protokol-dosieron kiam kliento lanĉiĝas (defaŭlte: 1 kiam mankas -debug) @@ -3181,10 +2534,6 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo Specify connection timeout in milliseconds (default: 5000) Specifi konektan tempolimon je milisekundoj (defaŭlte: 5000) - - Start Bitcoin Core Daemon - - System error: Sistema eraro: @@ -3221,18 +2570,6 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo Warning: This version is obsolete, upgrade required! Averto: tiu ĉi versio estas eksdata. Vi bezonas ĝisdatigon! - - Zapping all transactions from wallet... - - - - on startup - - - - version - versio - wallet.dat corrupt, salvage failed wallet.dat estas difektita, riparo malsukcesis @@ -3241,14 +2578,6 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo Password for JSON-RPC connections Pasvorto por konektoj JSON-RPC - - Allow JSON-RPC connections from specified IP address - Permesi konektojn JSON-RPC de specifa IP-adreso - - - Send commands to node running on <ip> (default: 127.0.0.1) - Sendi komandon al nodo ĉe <ip> (defaŭlte: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Plenumi komandon kiam plej bona bloko ŝanĝiĝas (%s en cmd anstataŭiĝas per bloka haketaĵo) @@ -3281,10 +2610,6 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo This help message Tiu ĉi helpmesaĝo - - Unable to bind to %s on this computer (bind returned error %d, %s) - Ne eblis bindi al %s en tiu ĉi komputilo (bind resendis eraron %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Permesi DNS-elserĉojn por -addnote, -seednote kaj -connect @@ -3297,41 +2622,29 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo Error loading wallet.dat: Wallet corrupted Eraro dum ŝargado de wallet.dat: monujo difektita - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Eraro dum ŝargo de wallet.dat: monujo bezonas pli novan version de Bitmono - - - Wallet needed to be rewritten: restart Bitcoin to complete - Monujo bezonas esti reskribita: relanĉu Bitmonon por finfari tion - Error loading wallet.dat Eraro dum ŝargado de wallet.dat - Invalid -proxy address: '%s' - Nevalid adreso -proxy: '%s' + Invalid -proxy address: '%s' + Nevalid adreso -proxy: '%s' - Unknown network specified in -onlynet: '%s' - Nekonata reto specifita en -onlynet: '%s' + Unknown network specified in -onlynet: '%s' + Nekonata reto specifita en -onlynet: '%s' - Unknown -socks proxy version requested: %i - Nekonata versio de -socks petita: %i + Cannot resolve -bind address: '%s' + Ne eblas trovi la adreson -bind: '%s' - Cannot resolve -bind address: '%s' - Ne eblas trovi la adreson -bind: '%s' + Cannot resolve -externalip address: '%s' + Ne eblas trovi la adreson -externalip: '%s' - Cannot resolve -externalip address: '%s' - Ne eblas trovi la adreson -externalip: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Nevalida sumo por -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Nevalida sumo por -paytxfee=<amount>: '%s' Invalid amount @@ -3377,13 +2690,5 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo Error Eraro - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Vi devas agordi rpcpassword=<password> en la konfigura dosiero: -%s -Se la dosiero ne ekzistas, kreu ĝin kun permeso "nur posedanto rajtas legi". - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_es.ts b/src/qt/locale/bitcoin_es.ts index 1ed40a77c2..fad8c9bbe8 100644 --- a/src/qt/locale/bitcoin_es.ts +++ b/src/qt/locale/bitcoin_es.ts @@ -1,44 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - Acerca de Bitcoin Core - - - <b>Bitcoin Core</b> version - Versión de <b>Bitcoin Core<b> - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Este es un software experimental. - -Distribuido bajo la licencia MIT/X11, vea el archivo adjunto -COPYING o http://www.opensource.org/licenses/mit-license.php. - -Este producto incluye software desarrollado por OpenSSL Project para su uso en -el OpenSSL Toolkit (http://www.openssl.org/) y software criptográfico escrito por -Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard. - - - Copyright - Copyright - - - The Bitcoin Core developers - Los desarrolladores de Bitcoin Core - - - (%1-bit) - (%1-bit) - - + AddressBookPage @@ -51,7 +11,7 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard. &New - Nuevo + &Nuevo Copy the currently selected address to the system clipboard @@ -134,8 +94,8 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard.Error exportando - There was an error trying to save the address list to %1. - Ha habido un error al intentar guardar los datos del monedero en %1. + There was an error trying to save the address list to %1. Please try again. + Se ha producido un error al intentar guardar la lista de direcciones en %1. Por favor vuelva a intentarlo. @@ -171,10 +131,6 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard.Repeat new passphrase Repita la nueva contraseña - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Introduzca la nueva contraseña del monedero.<br/>Por favor elija una con <b>10 o más caracteres aleatorios</b>, u <b>ocho o más palabras</b>. - Encrypt wallet Cifrar el monedero @@ -209,7 +165,7 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard. Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - Atencion: ¡Si cifra su monedero y pierde la contraseña perderá <b>TODOS SUS BITCOINS</b>!" + Atencion: ¡Si cifra su monedero y pierde la contraseña perderá <b>TODOS SUS BITCOINS</b>!" Are you sure you wish to encrypt your wallet? @@ -227,6 +183,10 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard.Wallet encrypted Monedero cifrado + + 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>. + Introduzca la nueva contraseña para el monedero.<br/>Utilice por favor una contraseña con <b>diez o más caracteres aleatorios</b> o con <b>ocho o más palabras</b>. + Bitcoin 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. Bitcoin se cerrará para finalizar el proceso de cifrado. Recuerde que el cifrado de su monedero no puede proteger totalmente sus bitcoins de robo por malware que infecte su sistema. @@ -298,10 +258,6 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard.Quit application Salir de la aplicación - - Show information about Bitcoin - Mostrar información acerca de Bitcoin - About &Qt Acerca de &Qt @@ -338,6 +294,10 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard.Open &URI... Abrir &URI... + + Bitcoin Core client + Cliente Bitcoin Core + Importing blocks from disk... Importando bloques de disco... @@ -390,9 +350,13 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard.&Receive &Recibir + + Show information about Bitcoin Core + Mostrar información acerca de Bitcoin Core + &Show / Hide - Mo&strar/ocultar + &Mostrar / Ocultar Show or hide the main Window @@ -420,7 +384,7 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard. &Help - A&yuda + &Ayuda Tabs toolbar @@ -436,7 +400,7 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard. Request payments (generates QR codes and bitcoin: URIs) - Solicitar pagos (genera codigo QR y URL's de Bitcoin) + Solicitar pagos (generando códigos QR e identificadores URI "bitcoin:") &About Bitcoin Core @@ -452,7 +416,7 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard. Open a bitcoin: URI or payment request - Abrir un bitcoin: URI o petición de pago + Abrir un identificador URI "bitcoin:" o una petición de pago &Command-line options @@ -460,11 +424,7 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard. Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - Muestra el mensaje de ayuda Bitcoin Core para obtener una lista con las posibles opciones de la consola de comandos de Bitcoin - - - Bitcoin client - Cliente Bitcoin + Mostrar el mensaje de ayuda de Bitcoin Core con una lista de las posibles opciones de la consola de comandos de Bitcoin %n active connection(s) to Bitcoin network @@ -474,10 +434,6 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard.No block source available... Ninguna fuente de bloques disponible ... - - Processed %1 of %2 (estimated) blocks of transaction history. - Se han procesado %1 de %2 bloques (estimados) del historial de transacciones. - Processed %1 blocks of transaction history. Procesados %1 bloques del historial de transacciones. @@ -504,7 +460,7 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard. %1 behind - %1 por detrás + %1 atrás Last received block was generated %1 ago. @@ -562,10 +518,6 @@ Dirección: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> El monedero está <b>cifrado</b> y actualmente <b>bloqueado</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Ha ocurrido un error crítico. Bitcoin ya no puede continuar con seguridad y se cerrará. - ClientModel @@ -601,12 +553,12 @@ Dirección: %4 Tasa: - Low Output: - Envío pequeño: + Dust: + Polvo: After Fee: - Después de tasas: + Después de aplicar la comisión: Change: @@ -678,11 +630,11 @@ Dirección: %4 Copy fee - Copiar donación + Copiar comisión Copy after fee - Copiar después de aplicar donación + Copiar después de aplicar comisión Copy bytes @@ -693,8 +645,8 @@ Dirección: %4 Copiar prioridad - Copy low output - Copiar envío pequeño + Copy dust + Copiar polvo Copy change @@ -745,8 +697,8 @@ Dirección: %4 ninguna - Dust - Basura + Can vary +/- %1 satoshi(s) per input. + Puede variar en +/- %1 satoshi(s) por entrada. yes @@ -758,39 +710,27 @@ Dirección: %4 This label turns red, if the transaction size is greater than 1000 bytes. - Esta etiqueta se torna roja si el tamaño de la transación es mayor a 1000 bytes. + Esta etiqueta se torna roja si el tamaño de la transacción es mayor de 1000 bytes. This means a fee of at least %1 per kB is required. - Esto implica que se requiere una tarifa de al menos %1 por kB + Esto implica que se requiere una comisión de al menos %1 por kB Can vary +/- 1 byte per input. - Puede variar +/- 1 byte por entrada. + Puede variar en +/- 1 byte por entrada. Transactions with higher priority are more likely to get included into a block. - Las transacciones con alta prioridad son más propensas a ser incluidas dentro de un bloque. + Las transacciones con mayor prioridad tienen mayor probabilidad de ser incluidas en un bloque. - This label turns red, if the priority is smaller than "medium". - Esta etiqueta se muestra en rojo si la prioridad es menor que "media". + This label turns red, if the priority is smaller than "medium". + Esta etiqueta se torna roja si la prioridad es menor que "media". This label turns red, if any recipient receives an amount smaller than %1. - Esta etiqueta se torna roja si cualquier destinatario recibe una cantidad menor a %1. - - - This means a fee of at least %1 is required. - Esto significa que se necesita una tarifa de al menos %1. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - Cantidades por debajo de 0.546 veces la tasa serán mostradas como basura - - - This label turns red, if the change is smaller than %1. - Esta etiqueta se vuelve roja si el cambio es menor que %1 + Esta etiqueta se torna roja si cualquier destinatario recibe una cantidad menor de %1. (no label) @@ -798,7 +738,7 @@ Dirección: %4 change from %1 (%2) - Enviar desde %1 (%2) + Cambio desde %1 (%2) (change) @@ -844,12 +784,12 @@ Dirección: %4 Editar dirección de envío - The entered address "%1" is already in the address book. - La dirección introducida "%1" ya está presente en la libreta de direcciones. + The entered address "%1" is already in the address book. + La dirección introducida "%1" ya está presente en la libreta de direcciones. - The entered address "%1" is not a valid Bitcoin address. - La dirección introducida "%1" no es una dirección Bitcoin válida. + The entered address "%1" is not a valid Bitcoin address. + La dirección introducida "%1" no es una dirección Bitcoin válida. Could not unlock wallet. @@ -885,10 +825,6 @@ Dirección: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Bitcoin Core - Opciones de consola de comandos - Bitcoin Core Bitcoin Core @@ -897,6 +833,18 @@ Dirección: %4 version versión + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + Acerca de Bitcoin Core + + + Command-line options + Opciones de la línea de órdenes + Usage: Uso: @@ -907,11 +855,11 @@ Dirección: %4 UI options - Opciones GUI + Opciones de interfaz de usuario - Set language, for example "de_DE" (default: system locale) - Establecer el idioma, por ejemplo, "es_ES" (predeterminado: configuración regional del sistema) + Set language, for example "de_DE" (default: system locale) + Establecer el idioma, por ejemplo, "es_ES" (predeterminado: configuración regional del sistema) Start minimized @@ -954,15 +902,15 @@ Dirección: %4 Use a custom data directory: - Utilice un directorio de datos personalizado: + Utilizar un directorio de datos personalizado: - Bitcoin - Bitcoin + Bitcoin Core + Bitcoin Core - Error: Specified data directory "%1" can not be created. - Error: No puede crearse el directorio de datos especificado "%1". + Error: Specified data directory "%1" cannot be created. + Error: no ha podido crearse el directorio de datos especificado "%1". Error @@ -985,7 +933,7 @@ Dirección: %4 Open payment request from URI or file - El pago requiere una URI o archivo + Abrir solicitud de pago a partir de un identificador URI o de un archivo URI: @@ -993,11 +941,11 @@ Dirección: %4 Select payment request file - Seleccione archivo de sulicitud de pago + Seleccionar archivo de sulicitud de pago Select payment request file to open - Abrir archivo de solicitud de pago + Seleccionar el archivo de solicitud de pago para abrir @@ -1012,11 +960,11 @@ Dirección: %4 Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Tarifa de transacción opcional por kB que ayuda a asegurar que sus transacciones sean procesadas rápidamente. La mayoría de transacciones son de 1kB. + Comisión de transacción opcional por kB que ayuda a asegurar que sus transacciones sean procesadas rápidamente. La mayoría de transacciones son de 1kB. Pay transaction &fee - Comisión de &transacciones + Pagar comisión de &transacción Automatically start Bitcoin after logging in to the system. @@ -1036,7 +984,15 @@ Dirección: %4 Number of script &verification threads - Número de procesos de &verificación de scripts + Número de hilos de &verificación de scripts + + + Accept connections from outside + Aceptar conexiones desde el exterior + + + Allow incoming connections + Aceptar conexiones entrantes Connect to the Bitcoin network through a SOCKS proxy. @@ -1052,19 +1008,19 @@ Dirección: %4 Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - URLs de terceros (por ejemplo, un explorador de bloques) que aparecen en la pestaña de transacciones como items del menú contextual. El %s en la URL es reemplazado por el hash de la transacción. Se pueden separar múltiples URLs por una barra vertical |. + Identificadores URL de terceros (por ejemplo, un explorador de bloques) que aparecen en la pestaña de transacciones como elementos del menú contextual. El %s en la URL es reemplazado por el valor hash de la transacción. Se pueden separar URL múltiples por una barra vertical |. Third party transaction URLs - URLs de transacciones de terceros + Identificadores URL de transacciones de terceros Active command-line options that override above options: - Opciones activas de consola de comandos que tienen preferencia sobre las opciones antes mencionadas: + Opciones activas de consola de comandos que tienen preferencia sobre las opciones anteriores: Reset all client options to default. - Restablecer todas las opciones del cliente a las predeterminadas. + Restablecer todas las opciones predeterminadas del cliente. &Reset Options @@ -1104,7 +1060,7 @@ Dirección: %4 Map port using &UPnP - Mapear el puerto usando &UPnP + Mapear el puerto mediante &UPnP Proxy &IP: @@ -1118,14 +1074,6 @@ Dirección: %4 Port of the proxy (e.g. 9050) Puerto del servidor proxy (ej. 9050) - - SOCKS &Version: - &Versión SOCKS: - - - SOCKS version of the proxy (e.g. 5) - Versión SOCKS del proxy (ej. 5) - &Window &Ventana @@ -1166,14 +1114,6 @@ Dirección: %4 Choose the default subdivision unit to show in the interface and when sending coins. Elegir la subdivisión predeterminada para mostrar cantidades en la interfaz y cuando se envían bitcoins. - - Whether to show Bitcoin addresses in the transaction list or not. - Mostrar o no las direcciones Bitcoin en la lista de transacciones. - - - &Display addresses in transaction list - &Mostrar las direcciones en la lista de transacciones - Whether to show coin control features or not. Mostrar o no funcionalidad de Coin Control @@ -1219,7 +1159,7 @@ Dirección: %4 OverviewPage Form - Desde + Formulario The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. @@ -1229,13 +1169,17 @@ Dirección: %4 Wallet Monedero + + Watch-only: + De observación: + Available: Disponible: Your current spendable balance - Su balance actual gastable + Su saldo disponible actual Pending: @@ -1243,15 +1187,15 @@ Dirección: %4 Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - Total de transacciones que deben ser confirmadas, y que no cuentan con el balance gastable necesario + Total de transacciones pendientes de confirmar y que aún no contribuye al saldo disponible Immature: - No disponible: + No madurado: Mined balance that has not yet matured - Saldo recién minado que aún no está disponible. + Saldo recién minado que aún no ha madurado. Total: @@ -1259,11 +1203,27 @@ Dirección: %4 Your current total balance - Su balance actual total + Su saldo actual total + + + Your current balance in watch-only addresses + Su saldo actual en direcciones watch-only + + + Unconfirmed transactions to watch-only addresses + Transacciones sin confirmar en direcciones watch-only + + + Mined balance in watch-only addresses that has not yet matured + Saldo minado en direcciones watch-only que aún no ha madurado + + + Current total balance in watch-only addresses + Saldo total en las direcciones watch-only <b>Recent transactions</b> - <b>Movimientos recientes</b> + <b>Transacciones recientes</b> out of sync @@ -1277,8 +1237,24 @@ Dirección: %4 Gestión de URI - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - ¡No se puede interpretar la URI! Esto puede deberse a una dirección Bitcoin inválida o a parámetros de URI mal formados. + Invalid payment address %1 + Dirección de pago no válida %1 + + + Payment request rejected + Solicitud de pago rechazada + + + Payment request network doesn't match client network. + La red de solicitud de pago no coincide con la red cliente + + + Payment request has expired. + La solicitud de pago ha cadiucado + + + Payment request is not initialized. + La solicitud de pago no está inicializada Requested payment amount of %1 is too small (considered dust). @@ -1286,31 +1262,27 @@ Dirección: %4 Payment request error - Error en petición de pago + Error en solicitud de pago Cannot start bitcoin: click-to-pay handler - No se pudo iniciar bitcoin: manejador de pago-al-clic - - - Net manager warning - Advertencia del gestor de red - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - El proxy configurado no soporta el protocolo SOCKS5, el cual es requerido para pagos vía proxy. + No se puede iniciar el gestor de identificadores "bitcoin:" de clic-para-pagar Payment request fetch URL is invalid: %1 La URL de obtención de la solicitud de pago es inválida: %1 + + URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + ¡No se puede leer el identificador URI! Esto puede deberse a una dirección Bitcoin inválida o a parámetros de la URI mal formados + Payment request file handling Procesado del archivo de solicitud de pago - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - ¡No se ha podido leer o procesar el archivo de solicitud de pago! Esto puede deberse a un archivo inválido de solicitud de pago. + Payment request file cannot be read! This can be caused by an invalid payment request file. + ¡No puede leerse el archivo de solicitud de pago! Esto puede deberse a un archivo inválido de solicitud de pago. Unverified payment requests to custom payment scripts are unsupported. @@ -1318,15 +1290,15 @@ Dirección: %4 Refund from %1 - Devolución de %1 + Devolución desde %1 Error communicating with %1: %2 Error en la comunicación con %1: %2 - Payment request can not be parsed or processed! - ¡La solicitud de pago no puede leerse ni procesarse! + Payment request cannot be parsed! + ¡No puede leerse la solicitud de pago! Bad response from server %1 @@ -1341,31 +1313,66 @@ Dirección: %4 Error en petición de red + + PeerTableModel + + User Agent + User Agent + + + Address/Hostname + DIrección/Nombre de host + + + Ping Time + Ping + + QObject - Bitcoin - Bitcoin + Amount + Cantidad - Error: Specified data directory "%1" does not exist. - Error: El directorio de datos especificado "%1" no existe. + Enter a Bitcoin address (e.g. %1) + Introducir una dirección Bitcoin (p. ej. %1) - Error: Cannot parse configuration file: %1. Only use key=value syntax. - Error: No se ha podido leer el archivo de configuración: %1. Debe utilizarse solamente la sintaxis clave=valor. + %1 d + %1 d - Error: Invalid combination of -regtest and -testnet. - Error: Combinación no válida de -regtest y -testnet. + %1 h + %1 h - Bitcoin Core didn't yet exit safely... - Bitcoin core no se ha cerrado de forma segura todavía... + %1 m + %1 m - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Introduzca una dirección Bitcoin (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + %1 s + %1 s + + + NETWORK + RED + + + UNKNOWN + DESCONOCIDO + + + None + Ninguno + + + N/A + N/D + + + %1 ms + %1 ms @@ -1415,7 +1422,11 @@ Dirección: %4 Using OpenSSL version - Utilizando la versión OpenSSL + Utilizando la versión de OpenSSL + + + Using BerkeleyDB version + Utilizando la versión de BerkeleyDB Startup time @@ -1442,8 +1453,76 @@ Dirección: %4 Número actual de bloques - Estimated total blocks - Bloques totales estimados + Received + Recibido + + + Sent + Enviado + + + &Peers + &Pares + + + Select a peer to view detailed information. + Seleccionar un par para ver su información detallada. + + + Direction + Dirección + + + Version + Versión + + + User Agent + User Agent + + + Services + Servicios + + + Sync Node + Sincronizar Nodo + + + Starting Height + Altura de comienzo + + + Sync Height + Altura de sincronización + + + Ban Score + Puntuación de bloqueo + + + Connection Time + Duración de la conexión + + + Last Send + Ultimo envío + + + Last Receive + Ultima recepción + + + Bytes Sent + Bytes enviados + + + Bytes Received + Bytes recibidos + + + Ping Time + Ping Last block time @@ -1522,16 +1601,36 @@ Dirección: %4 %1 GB - %1 m - %1 m + via %1 + via %1 - %1 h - %1 h + never + nunca - %1 h %2 m - %1 h %2 m + Inbound + Entrante + + + Outbound + Saliente + + + Yes + + + + No + No + + + Unknown + Desconocido + + + Fetching... + Adquiriendo.... @@ -1745,10 +1844,6 @@ Dirección: %4 Fee: Tasa: - - Low Output: - Envío pequeño: - After Fee: Después de tasas: @@ -1777,6 +1872,10 @@ Dirección: %4 Clear all fields of the form. Vaciar todos los campos del formulario + + Dust: + Polvo: + Clear &All Vaciar &todo @@ -1825,10 +1924,6 @@ Dirección: %4 Copy priority Copiar prioridad - - Copy low output - Copiar envío pequeño - Copy change Copiar Cambio @@ -1881,6 +1976,10 @@ Dirección: %4 Warning: Unknown change address Alerta: Dirección de Bitcoin inválida + + Copy dust + Copiar polvo + Are you sure you want to send? ¿Está seguro que desea enviar? @@ -1889,14 +1988,6 @@ Dirección: %4 added as transaction fee añadido como comisión de transacción - - Payment request expired - Petición de pago expirada - - - Invalid payment address %1 - Dirección de pago no válida %1 - SendCoinsEntry @@ -1908,10 +1999,6 @@ Dirección: %4 Pay &To: &Pagar a: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - La dirección a la que enviar el pago (p. ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Etiquete esta dirección para añadirla a la libreta @@ -1928,6 +2015,10 @@ Dirección: %4 This is a normal payment. Esto es un pago ordinario. + + The Bitcoin address to send the payment to + Dirección Bitcoin a la que enviar el pago + Alt+A Alt+A @@ -1999,8 +2090,8 @@ Dirección: %4 Puede firmar mensajes con sus direcciones para demostrar que las posee. Tenga cuidado de no firmar cualquier cosa vaga, ya que los ataques de phishing pueden tratar de engañarle para suplantar su identidad. Firme solo declaraciones totalmente detalladas con las que usted esté de acuerdo. - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - La dirección con la que firmar el mensaje (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address to sign the message with + Dirección Bitcoin con la que firmar el mensaje Choose previously used address @@ -2055,8 +2146,8 @@ Dirección: %4 Introduzca la dirección para la firma, el mensaje (asegurándose de copiar tal cual los saltos de línea, espacios, tabulaciones, etc.) y la firma a continuación para verificar el mensaje. Tenga cuidado de no asumir más información de lo que dice el propio mensaje firmado para evitar fraudes basados en ataques de tipo man-in-the-middle. - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - La dirección con la que se firmó el mensaje (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address the message was signed with + La dirección Bitcoin con la que se firmó el mensaje Verify the message to ensure it was signed with the specified Bitcoin address @@ -2071,12 +2162,8 @@ Dirección: %4 Vaciar todos los campos de la verificación de mensaje - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Introduzca una dirección Bitcoin (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Haga clic en "Firmar mensaje" para generar la firma + Click "Sign Message" to generate signature + Haga clic en "Firmar mensaje" para generar la firma The entered address is invalid. @@ -2203,6 +2290,10 @@ Dirección: %4 own address dirección propia + + watch-only + de observación + label etiqueta @@ -2223,6 +2314,14 @@ Dirección: %4 Debit Débito + + Total debit + Débito total + + + Total credit + Crédito total + Transaction fee Comisión de transacción @@ -2248,8 +2347,8 @@ Dirección: %4 Vendedor - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - Los bitcoins generados deben madurar %1 bloques antes de que puedan gastarse. Cuando generó este bloque, se transmitió a la red para que se añadiera a la cadena de bloques. Si no consigue entrar en la cadena, su estado cambiará a "no aceptado" y ya no se podrá gastar. Esto puede ocurrir ocasionalmente si otro nodo genera un bloque a pocos segundos del suyo. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Los bitcoins generados deben madurar %1 bloques antes de que puedan gastarse. Cuando generó este bloque, se transmitió a la red para que se añadiera a la cadena de bloques. Si no consigue entrar en la cadena, su estado cambiará a "no aceptado" y ya no se podrá gastar. Esto puede ocurrir ocasionalmente si otro nodo genera un bloque a pocos segundos del suyo. Debug information @@ -2313,10 +2412,6 @@ Dirección: %4 Address Dirección - - Amount - Cantidad - Immature (%1 confirmations, will be available after %2) No vencidos (%1 confirmaciones. Estarán disponibles al cabo de %2) @@ -2528,10 +2623,6 @@ Dirección: %4 Address Dirección - - Amount - Cantidad - ID ID @@ -2545,6 +2636,13 @@ Dirección: %4 para + + UnitDisplayStatusBarControl + + Unit to show amounts in. Click to select another unit. + Unidad en la que se muestran las cantidades. Haga clic para seleccionar otra unidad. + + WalletFrame @@ -2596,20 +2694,6 @@ Dirección: %4 bitcoin-core - - Usage: - Uso: - - - List commands - Muestra comandos - - - - Get help for a command - Recibir ayuda para un comando - - Options: Opciones: @@ -2653,10 +2737,6 @@ Dirección: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Número de segundos en que se evita la reconexión de pares con mal comportamiento (predeterminado: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Ha ocurrido un error al configurar el puerto RPC %u para escucha en IPv4: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Escuchar conexiones JSON-RPC en <puerto> (predeterminado: 8332 o testnet:18332) @@ -2666,10 +2746,6 @@ Dirección: %4 Aceptar comandos consola y JSON-RPC - - Bitcoin Core RPC client version - Versión del cliente RPC de Bitcoin Core RPC - Run in the background as a daemon and accept commands Ejecutar en segundo plano como daemon y aceptar comandos @@ -2694,7 +2770,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, debe establecer un valor rpcpassword en el archivo de configuración: %s @@ -2705,17 +2781,13 @@ rpcpassword=%s El nombre de usuario y la contraseña DEBEN NO ser iguales. Si el archivo no existe, créelo con permisos de archivo de solo lectura. Se recomienda también establecer alertnotify para recibir notificaciones de problemas. -Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Cifrados aceptables (predeterminados: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Ha ocurrido un error al configurar el puerto RPC %u para escuchar mediante IPv6. Recurriendo a IPv4: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Vincular a la dirección dada y escuchar siempre en ella. Utilice la notación [host]:port para IPv6 @@ -2724,18 +2796,10 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) Limitar continuamente las transacciones gratuitas a <n>*1000 bytes por minuto (predeterminado:15) - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Iniciar modo de prueba de regresión, el cuál utiliza una cadena especial en la cual los bloques pueden ser resueltos instantáneamente. Se utiliza para herramientas de prueba de regresión y desarrollo de aplicaciones. - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Ingresar en el modo de prueba de regresión, que utiliza una cadena especial en la que los bloques se pueden resolver instantáneamente. - - Error: Listening for incoming connections failed (listen returned error %d) - Error: Ha fallado la escucha de conexiones entrantes (listen ha devuelto el error %d) - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. ¡Error: se ha rechazado la transacción! Esto puede ocurrir si ya se han gastado algunos de los bitcoins del monedero, como ocurriría si hubiera hecho una copia de wallet.dat y se hubieran gastado bitcoins a partir de la copia, con lo que no se habrían marcado aquí como gastados. @@ -2748,10 +2812,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Ejecutar comando cuando una transacción del monedero cambia (%s en cmd se remplazará por TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - Las comisiones inferiores se consideran comisión cero (a efectos de creación de transacciones) (predeterminado: - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) Volcar la actividad de la base de datos de memoria al registro en disco cada <n> megabytes (predeterminado: 100) @@ -2788,10 +2848,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Aviso: ¡-paytxfee tiene un valor muy alto! Esta es la comisión que pagará si envía una transacción. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Precaución: Por favor, ¡revise que la fecha y hora de su ordenador son correctas! Si su reloj está mal, Bitcoin no funcionará correctamente. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Atención: ¡Parece que la red no está totalmente de acuerdo! Algunos mineros están presentando inconvenientes. @@ -2824,30 +2880,14 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Attempt to recover private keys from a corrupt wallet.dat Intento de recuperar claves privadas de un wallet.dat corrupto - - Bitcoin Core Daemon - Bitcoin Core Daemon (proceso independiente) - Block creation options: Opciones de creación de bloques: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - Vaciar lista de transacciones del monedero (herramienta de diagnóstico; implica -rescan) - Connect only to the specified node(s) Conectar sólo a los nodos (o nodo) especificados - - Connect through SOCKS proxy - Conectar a través de un proxy SOCKS - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - Conectar a JSON-RPC en <puerto> (predeterminado: 8332 o testnet: 18332) - Connection options: Opciones de conexión: @@ -2948,18 +2988,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write undo data No se han podido escribir los datos de deshacer - - Fee per kB to add to transactions you send - Donación por KB añadida a las transacciones que envíe - - - Fees smaller than this are considered zero fee (for relaying) (default: - Las comisiones inferiores se consideran comisión cero (a efectos de propagación) (predeterminado: - - - Find peers using DNS lookup (default: 1 unless -connect) - Encontrar pares mediante búsqueda de DNS (predeterminado: 1 salvo con -connect) - Force safe mode (default: 0) Forzar modo seguro (predeterminado: 0) @@ -2985,8 +3013,8 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Incorrecto o bloque de génesis no encontrado. Datadir equivocada para la red? - Invalid -onion address: '%s' - Dirección -onion inválida: '%s' + Invalid -onion address: '%s' + Dirección -onion inválida: '%s' Not enough file descriptors available. @@ -2996,18 +3024,10 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Prepend debug output with timestamp (default: 1) Anteponer marca temporal a la información de depuración (predeterminado: 1) - - RPC client options: - Opciones para cliente RPC: - Rebuild block chain index from current blk000??.dat files Reconstruir el índice de la cadena de bloques a partir de los archivos blk000??.dat actuales - - Select SOCKS version for -proxy (4 or 5, default: 5) - Seleccionar versión de SOCKS para -proxy (4 o 5, predeterminado: 5) - Set database cache size in megabytes (%d to %d, default: %d) Asignar tamaño de cache en megabytes (entre %d y %d; predeterminado: %d) @@ -3032,10 +3052,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This is intended for regression testing tools and app development. Esto afecta a las herramientas de prueba de regresión y al desarrollo informático de la aplicación. - - Usage (deprecated, use bitcoin-cli): - Uso (desaconsejado, usar bitcoin-cli) - Verifying blocks... Verificando bloques... @@ -3044,10 +3060,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Verifying wallet... Verificando monedero... - - Wait for RPC server to start - Espere a que se inicie el servidor RPC - Wallet %s resides outside data directory %s El monedero %s se encuentra fuera del directorio de datos %s @@ -3056,10 +3068,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Wallet options: Opciones de monedero: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - Aviso: Argumento -debugnet anticuado, utilice -debug=net - You need to rebuild the database using -reindex to change -txindex Usted necesita reconstruir la base de datos utilizando -reindex para cambiar -txindex @@ -3084,17 +3092,33 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Establecer tamaño máximo de las transacciones de alta prioridad/baja comisión en bytes (predeterminado: %d) + + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. + Este producto incluye software desarrollado por el OpenSSL Project para su uso en OpenSSL Toolkit <https://www.openssl.org/>, software de cifrado escrito por Eric Young y software UPnP escrito por Thomas Bernard. + + + Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + Aviso: ¡Comprueba la fecha y hora de tu ordenador y verifica si es correcta! Si no es correcta Bitcoin Core no funcionará adecuadamente. + + + Connect through SOCKS5 proxy + Conectar usando SOCKS5 proxy + + + Copyright (C) 2009-%i The Bitcoin Core Developers + Copyright (C) 2009-%i The Bitcoin Core Developers + Information Información - Invalid amount for -minrelaytxfee=<amount>: '%s' - Cantidad inválida para -minrelaytxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Cantidad inválida para -minrelaytxfee=<amount>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - Cantidad inválida para -mintxfee=<amount>: '%s' + Invalid amount for -mintxfee=<amount>: '%s' + Cantidad inválida para -mintxfee=<amount>: '%s' Limit size of signature cache to <n> entries (default: 50000) @@ -3152,14 +3176,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Run a thread to flush wallet periodically (default: 1) Ejecutar un hilo (thread) para limpiar de la memoria el monedero periódicamente (predeterminado: 1) - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - Opciones SSL: (ver la Bitcoin Wiki para instrucciones de configuración SSL) - - - Send command to Bitcoin Core - Enviar orden a Bitcoin Core - Send trace/debug info to console instead of debug.log file Enviar información de trazas/depuración a la consola en lugar de al archivo debug.log @@ -3176,10 +3192,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Show all debugging options (usage: --help -help-debug) Muestra todas las opciones de depuración (uso: --help -help-debug) - - Show benchmark information (default: 0) - Mostrar información de benchmarking (predeterminado: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Reducir el archivo debug.log al iniciar el cliente (predeterminado: 1 sin -debug) @@ -3192,14 +3204,14 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Specify connection timeout in milliseconds (default: 5000) Especificar el tiempo máximo de conexión en milisegundos (predeterminado: 5000) - - Start Bitcoin Core Daemon - Iniciar Bitcoin Core Daemon - System error: Error de sistema: + + This is experimental software. + Este software es experimental. + Transaction amount too small Cantidad de la transacción demasiado pequeña @@ -3241,10 +3253,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. on startup al iniciar - - version - versión - wallet.dat corrupt, salvage failed wallet.dat corrupto. Ha fallado la recuperación. @@ -3252,16 +3260,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Password for JSON-RPC connections Contraseña para las conexiones JSON-RPC - - - - Allow JSON-RPC connections from specified IP address - Permitir conexiones JSON-RPC desde la dirección IP especificada - - - - Send commands to node running on <ip> (default: 127.0.0.1) - Enviar comando al nodo situado en <ip> (predeterminado: 127.0.0.1) @@ -3301,10 +3299,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Este mensaje de ayuda - - Unable to bind to %s on this computer (bind returned error %d, %s) - No es posible conectar con %s en este sistema (bind ha dado el error %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Permitir búsquedas DNS para -addnode, -seednode y -connect @@ -3317,41 +3311,29 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted Error al cargar wallet.dat: el monedero está dañado - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Error al cargar wallet.dat: El monedero requiere una versión más reciente de Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - El monedero ha necesitado ser reescrito. Reinicie Bitcoin para completar el proceso - Error loading wallet.dat Error al cargar wallet.dat - Invalid -proxy address: '%s' - Dirección -proxy inválida: '%s' + Invalid -proxy address: '%s' + Dirección -proxy inválida: '%s' - Unknown network specified in -onlynet: '%s' - La red especificada en -onlynet '%s' es desconocida + Unknown network specified in -onlynet: '%s' + La red especificada en -onlynet '%s' es desconocida - Unknown -socks proxy version requested: %i - Solicitada versión de proxy -socks desconocida: %i + Cannot resolve -bind address: '%s' + No se puede resolver la dirección de -bind: '%s' - Cannot resolve -bind address: '%s' - No se puede resolver la dirección de -bind: '%s' + Cannot resolve -externalip address: '%s' + No se puede resolver la dirección de -externalip: '%s' - Cannot resolve -externalip address: '%s' - No se puede resolver la dirección de -externalip: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Cantidad inválida para -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Cantidad inválida para -paytxfee=<amount>: '%s' Invalid amount @@ -3397,13 +3379,5 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error Error - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Tiene que establecer rpcpassword=<contraseña> en el fichero de configuración: ⏎ -%s ⏎ -Si el archivo no existe, créelo con permiso de lectura solamente del propietario. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_es_CL.ts b/src/qt/locale/bitcoin_es_CL.ts index 758a190f75..b22ad3fb8e 100644 --- a/src/qt/locale/bitcoin_es_CL.ts +++ b/src/qt/locale/bitcoin_es_CL.ts @@ -1,44 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Este es un software experimental. - -Distribuido bajo la licencia MIT/X11, vea el archivo adjunto -COPYING o http://www.opensource.org/licenses/mit-license.php. - -Este producto incluye software desarrollado por OpenSSL Project para su uso en -el OpenSSL Toolkit (http://www.openssl.org/), software criptográfico escrito por -Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard. - - - Copyright - Copyright - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -49,70 +9,22 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.Create a new address Crea una nueva dirección - - &New - - Copy the currently selected address to the system clipboard Copia la dirección seleccionada al portapapeles - - &Copy - - - - C&lose - - &Copy Address &Copia dirección - - Delete the currently selected address from the list - - Export the data in the current tab to a file Exportar los datos de la pestaña actual a un archivo - - &Export - - &Delete &Borrar - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - Copy &Label Copia &etiqueta @@ -121,23 +33,11 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.&Edit &Editar - - Export Address List - - Comma separated file (*.csv) Archivos separados por coma (*.csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -155,10 +55,6 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard. AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase Introduce contraseña actual @@ -171,10 +67,6 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.Repeat new passphrase Repite nueva contraseña - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Introduce la nueva contraseña para la billetera.<br/>Por favor utiliza un contraseña de<b>10 o más caracteres aleatorios</b>, u <b>ocho o más palabras</b>. - Encrypt wallet Codificar billetera @@ -274,10 +166,6 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.&Overview &Vista general - - Node - - Show general overview of wallet Muestra una vista general de la billetera @@ -298,10 +186,6 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.Quit application Salir del programa - - Show information about Bitcoin - Muestra información acerca de Bitcoin - About &Qt Acerca de @@ -326,22 +210,6 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.&Change Passphrase... &Cambiar la contraseña... - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - Reindexing blocks on disk... Cargando el index de bloques... @@ -370,10 +238,6 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.Open debugging and diagnostic console Abre consola de depuración y diagnóstico - - &Verify message... - - Bitcoin Bitcoin @@ -384,32 +248,16 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard. &Send - - - - &Receive - + &Envía &Show / Hide &Mostrar/Ocultar - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - Sign messages with your Bitcoin addresses to prove you own them Firmar un mensaje para provar que usted es dueño de esta dirección - - Verify messages to ensure they were signed with specified Bitcoin addresses - - &File &Archivo @@ -430,58 +278,10 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.[testnet] [red-de-pruebas] - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Cliente Bitcoin - %n active connection(s) to Bitcoin network %n conexión activa hacia la red Bitcoin%n conexiones activas hacia la red Bitcoin - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - %n hour(s) %n hora%n horas @@ -494,26 +294,6 @@ Eric Young (eay@cryptsoft.com) y UPnP software escrito por Thomas Bernard.%n week(s) %n semana%n semanas - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - Error Error @@ -561,10 +341,6 @@ Dirección: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> La billetera esta <b>codificada</b> y actualmente <b>bloqueda</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - ClientModel @@ -575,54 +351,10 @@ Dirección: %4 CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - Amount: Cantidad: - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount Cantidad @@ -635,18 +367,10 @@ Dirección: %4 Date Fecha - - Confirmations - - Confirmed Confirmado - - Priority - - Copy address Copia dirección @@ -659,151 +383,11 @@ Dirección: %4 Copy amount Copiar Cantidad - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (sin etiqueta) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -814,14 +398,6 @@ Dirección: %4 &Label &Etiqueta - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Dirección @@ -843,12 +419,12 @@ Dirección: %4 Editar dirección de envio - The entered address "%1" is already in the address book. - La dirección introducida "%1" ya esta guardada en la libreta de direcciones. + The entered address "%1" is already in the address book. + La dirección introducida "%1" ya esta guardada en la libreta de direcciones. - The entered address "%1" is not a valid Bitcoin address. - La dirección introducida "%1" no es una dirección Bitcoin valida. + The entered address "%1" is not a valid Bitcoin address. + La dirección introducida "%1" no es una dirección Bitcoin valida. Could not unlock wallet. @@ -861,37 +437,13 @@ Dirección: %4 FreespaceChecker - - A new data directory will be created. - - name Nombre - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - version versión @@ -900,106 +452,26 @@ Dirección: %4 Usage: Uso: - - command-line options - - UI options UI opciones - - Set language, for example "de_DE" (default: system locale) - - Start minimized Arranca minimizado - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - - Error Error - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog @@ -1010,10 +482,6 @@ Dirección: %4 &Main &Principal - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - Pay transaction &fee Comisión de &transacciónes @@ -1026,78 +494,14 @@ Dirección: %4 &Start Bitcoin on system login &Inicia Bitcoin al iniciar el sistema - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - Reset all client options to default. Reestablece todas las opciones. - - &Reset Options - - &Network &Red - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Abre automáticamente el puerto del cliente Bitcoin en el router. Esto funciona solo cuando tu router es compatible con UPnP y está habilitado. @@ -1118,18 +522,6 @@ Dirección: %4 Port of the proxy (e.g. 9050) Puerto del servidor proxy (ej. 9050) - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - Show only a tray icon after minimizing the window. Muestra solo un ícono en la bandeja después de minimizar la ventana @@ -1150,14 +542,6 @@ Dirección: %4 &Display &Mostrado - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - &Unit to show amounts in: &Unidad en la que mostrar cantitades: @@ -1166,18 +550,6 @@ Dirección: %4 Choose the default subdivision unit to show in the interface and when sending coins. Elige la subdivisión por defecto para mostrar cantidaded en la interfaz cuando se envien monedas - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - &Muestra direcciones en el listado de transaccioines - - - Whether to show coin control features or not. - - &OK &OK @@ -1190,77 +562,25 @@ Dirección: %4 default predeterminado - - none - - Confirm options reset Confirmar reestablecimiento de las opciones - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage Form Formulario - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - Wallet Cartera - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - Total: Total: - - Your current total balance - - <b>Recent transactions</b> <b>Transacciones recientes</b> @@ -1272,102 +592,25 @@ Dirección: %4 PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - Payment acknowledged Pago completado - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Cantidad - Error: Specified data directory "%1" does not exist. - + N/A + N/A - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Introduce una dirección Bitcoin (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget @@ -1378,15 +621,7 @@ Dirección: %4 &Copy Image Copiar Imagen - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole @@ -1405,18 +640,6 @@ Dirección: %4 &Information &Información - - Debug window - - - - General - - - - Using OpenSSL version - - Startup time Tiempo de inicio @@ -1437,18 +660,6 @@ Dirección: %4 Block chain Bloquea cadena - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - &Open &Abrir @@ -1457,89 +668,17 @@ Dirección: %4 &Console &Consola - - &Network Traffic - - - - &Clear - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - + Total: Clear console Limpiar Consola - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - &Label: &Etiqueta: @@ -1548,70 +687,10 @@ Dirección: %4 &Message: &mensaje - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - Copy label Copia etiqueta - - Copy message - - Copy amount Copiar Cantidad @@ -1623,10 +702,6 @@ Dirección: %4 QR Code Código QR - - Copy &URI - - Copy &Address &Copia dirección @@ -1635,18 +710,6 @@ Dirección: %4 &Save Image... Guardar imagen... - - Request payment to %1 - - - - Payment information - - - - URI - - Address Dirección @@ -1663,15 +726,7 @@ Dirección: %4 Message Mensaje - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel @@ -1694,77 +749,17 @@ Dirección: %4 (no label) (sin etiqueta) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins Enviar monedas - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - Amount: Cantidad: - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Enviar a múltiples destinatarios @@ -1773,10 +768,6 @@ Dirección: %4 Add &Recipient &Agrega destinatario - - Clear all fields of the form. - - Clear &All &Borra todos @@ -1797,50 +788,10 @@ Dirección: %4 Confirm send coins Confirmar el envio de monedas - - %1 to %2 - - - - Copy quantity - - Copy amount Copiar Cantidad - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - The recipient address is not valid, please recheck. La dirección de destinatarion no es valida, comprueba otra vez. @@ -1861,43 +812,11 @@ Dirección: %4 Duplicate address found, can only send to each address once per send operation. Tienes una dirección duplicada, solo puedes enviar a direcciónes individuales de una sola vez. - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (sin etiqueta) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry @@ -1908,10 +827,6 @@ Dirección: %4 Pay &To: &Pagar a: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - La dirección donde enviar el pago (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Introduce una etiqueta a esta dirección para añadirla a tu guia @@ -1920,14 +835,6 @@ Dirección: %4 &Label: &Etiqueta: - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt+A @@ -1940,72 +847,20 @@ Dirección: %4 Alt+P Alt+P - - Remove this entry - - Message: Mensaje: - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - &Sign Message &Firmar Mensaje - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Introduce una dirección Bitcoin (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Choose previously used address - - Alt+A Alt+A @@ -2026,10 +881,6 @@ Dirección: %4 Signature Firma - - Copy the current signature to the system clipboard - - Sign the message to prove you own this Bitcoin address Firmar un mensjage para probar que usted es dueño de esta dirección @@ -2038,10 +889,6 @@ Dirección: %4 Sign &Message Firmar Mensaje - - Reset all sign message fields - - Clear &All &Borra todos @@ -2050,54 +897,22 @@ Dirección: %4 &Verify Message &Firmar Mensaje - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Introduce una dirección Bitcoin (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Verify the message to ensure it was signed with the specified Bitcoin address - - Verify &Message &Firmar Mensaje - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Introduce una dirección Bitcoin (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Click en "Firmar Mensage" para conseguir firma - - - The entered address is invalid. - La dirección introducida "%1" no es una dirección Bitcoin valida. + Click "Sign Message" to generate signature + Click en "Firmar Mensage" para conseguir firma Please check the address and try again. Por favor, revise la dirección Bitcoin e inténtelo denuevo - - The entered address does not refer to a key. - - Wallet unlock was cancelled. Ha fallado el desbloqueo de la billetera - - Private key for the entered address is not available. - - Message signing failed. Firma fallida @@ -2106,22 +921,6 @@ Dirección: %4 Message signed. Mensaje firmado - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - Message verified. Mensaje comprobado @@ -2129,14 +928,6 @@ Dirección: %4 SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - [testnet] [red-de-pruebas] @@ -2155,10 +946,6 @@ Dirección: %4 Open until %1 Abierto hasta %1 - - conflicted - - %1/offline %1/fuera de linea @@ -2175,18 +962,10 @@ Dirección: %4 Status Estado - - , broadcast through %n node(s) - - Date Fecha - - Source - - Generated Generado @@ -2211,10 +990,6 @@ Dirección: %4 Credit Credito - - matures in %n more block(s) - - not accepted no aceptada @@ -2243,38 +1018,14 @@ Dirección: %4 Transaction ID ID de Transacción - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - Transaction Transacción - - Inputs - - Amount Cantidad - - true - - - - false - - , has not been successfully broadcast yet , no ha sido emitido satisfactoriamente todavía @@ -2313,18 +1064,6 @@ Dirección: %4 Address Dirección - - Amount - Cantidad - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - Abierto para &n bloque másAbierto para &n bloques más - Open until %1 Abierto hasta %1 @@ -2341,22 +1080,6 @@ Dirección: %4 Generated but not accepted Generado pero no acceptado - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with Recibido con @@ -2472,10 +1195,6 @@ Dirección: %4 Copy amount Copiar Cantidad - - Copy transaction ID - - Edit label Edita etiqueta @@ -2484,26 +1203,6 @@ Dirección: %4 Show transaction details Mostrar detalles de la transacción - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Archivos separados por coma (*.csv) @@ -2528,10 +1227,6 @@ Dirección: %4 Address Dirección - - Amount - Cantidad - ID ID @@ -2545,13 +1240,12 @@ Dirección: %4 para + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2561,55 +1255,25 @@ Dirección: %4 WalletView - - &Export - - Export the data in the current tab to a file Exportar los datos de la pestaña actual a un archivo Backup Wallet - + Respaldar billetera Wallet Data (*.dat) - + Datos de billetera (*.dat) Backup Failed - + Ha fallado el respaldo - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - Uso: - - - List commands - Muestra comandos - - - - Get help for a command - Recibir ayuda para un comando - - Options: Opciones: @@ -2638,26 +1302,10 @@ Dirección: %4 Maintain at most <n> connections to peers (default: 125) Mantener al menos <n> conecciones por cliente (por defecto: 125) - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - Threshold for disconnecting misbehaving peers (default: 100) Umbral de desconección de clientes con mal comportamiento (por defecto: 100) - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Escucha conexiones JSON-RPC en el puerto <port> (predeterminado: 8332 or testnet: 18332) @@ -2667,10 +1315,6 @@ Dirección: %4 Aceptar comandos consola y JSON-RPC - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Correr como demonio y acepta comandos @@ -2681,225 +1325,27 @@ Dirección: %4 Usa la red de pruebas - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Precaución: -paytxfee es muy alta. Esta es la comisión que pagarás si envias una transacción. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Precaución: Por favor revise que la fecha y hora de tu ordenador son correctas. Si tu reloj está mal configurado Bitcoin no funcionará correctamente. - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) Conecta solo al nodo especificado - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - Error loading block database Error cargando blkindex.dat - - Error opening block database - - Error: Disk space is low! Atención: Poco espacio en el disco duro - - Error: Wallet locked, unable to create transaction! - - Error: system error: Error: error de sistema: - - Failed to listen on any port. Use -listen=0 if you want this. - - Failed to read block info Falló la lectura de la información del bloque @@ -2924,234 +1370,14 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write block Falló la escritura del bloque - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - Comisión por kB para adicionarla a las transacciones enviadas - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - Imports blocks from external blk000??.dat file Importar bloques desde el archivo externo blk000??.dat - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information Información - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - Opciones SSL: (ver la Bitcoin Wiki para instrucciones de configuración SSL) - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file Enviar informacion de seguimiento a la consola en vez del archivo debug.log @@ -3160,50 +1386,14 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Set minimum block size in bytes (default: 0) Establezca el tamaño mínimo del bloque en bytes (por defecto: 0) - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - Specify connection timeout in milliseconds (default: 5000) Especifica tiempo de espera para conexion en milisegundos (predeterminado: 5000) - - Start Bitcoin Core Daemon - - System error: Error de sistema: - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - Use UPnP to map the listening port (default: 0) Intenta usar UPnP para mapear el puerto de escucha (default: 0) @@ -3225,18 +1415,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: This version is obsolete, upgrade required! Advertencia: Esta versión está obsoleta, se necesita actualizar! - - Zapping all transactions from wallet... - - - - on startup - - - - version - versión - wallet.dat corrupt, salvage failed wallet.dat corrompió, guardado fallido @@ -3246,20 +1424,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Contraseña para las conexiones JSON-RPC - - Allow JSON-RPC connections from specified IP address - Permite conexiones JSON-RPC desde la dirección IP especificada - - - - Send commands to node running on <ip> (default: 127.0.0.1) - Envia comando al nodo situado en <ip> (predeterminado: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - Upgrade wallet to latest format Actualizar billetera al formato actual @@ -3294,10 +1458,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Este mensaje de ayuda - - Unable to bind to %s on this computer (bind returned error %d, %s) - No es posible escuchar en el %s en este ordenador (bind returned error %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Permite búsqueda DNS para addnode y connect @@ -3311,41 +1471,17 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted Error cargando wallet.dat: Billetera corrupta - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Error cargando wallet.dat: Billetera necesita una vercion reciente de Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - La billetera necesita ser reescrita: reinicie Bitcoin para completar - Error loading wallet.dat Error cargando wallet.dat - Invalid -proxy address: '%s' - Dirección -proxy invalida: '%s' + Invalid -proxy address: '%s' + Dirección -proxy invalida: '%s' - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - Cantidad inválida para -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Cantidad inválida para -paytxfee=<amount>: '%s' Invalid amount @@ -3367,14 +1503,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Loading wallet... Cargando cartera... - - Cannot downgrade wallet - - - - Cannot write default address - - Rescanning... Rescaneando... @@ -3391,11 +1519,5 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error Error - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_es_DO.ts b/src/qt/locale/bitcoin_es_DO.ts index 6944c3157f..a9cfe90895 100644 --- a/src/qt/locale/bitcoin_es_DO.ts +++ b/src/qt/locale/bitcoin_es_DO.ts @@ -1,44 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - Acerca del Núcleo de Bitcoin - - - <b>Bitcoin Core</b> version - Versión del <b>Núcleo de Bitcoin<b> - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Este es un software experimental. - -Distribuido bajo la licencia MIT/X11, vea el archivo adjunto -COPYING o http://www.opensource.org/licenses/mit-license.php. - -Este producto incluye software desarrollado por OpenSSL Project para su uso en -el OpenSSL Toolkit (http://www.openssl.org/) y software criptográfico escrito por -Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard. - - - Copyright - Copyright - - - The Bitcoin Core developers - Los desarrolladores del Núcleo de Bitcoin - - - (%1-bit) - - - + AddressBookPage @@ -133,11 +93,7 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard.Exporting Failed Error exportando - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -171,10 +127,6 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard.Repeat new passphrase Repita la nueva contraseña - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Introduzca la nueva contraseña de la cartera.<br/>Por favor elija una con <b>10 o más caracteres aleatorios</b>, u <b>ocho o más palabras</b>. - Encrypt wallet Cifrar la cartera @@ -209,7 +161,7 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard. Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - Atencion: ¡Si cifra su monedero y pierde la contraseña perderá <b>TODOS SUS BITCOINS</b>!" + Atencion: ¡Si cifra su monedero y pierde la contraseña perderá <b>TODOS SUS BITCOINS</b>!" Are you sure you wish to encrypt your wallet? @@ -298,10 +250,6 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard.Quit application Salir de la aplicación - - Show information about Bitcoin - Mostrar información acerca de Bitcoin - About &Qt Acerca de &Qt @@ -436,7 +384,7 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard. Request payments (generates QR codes and bitcoin: URIs) - Solicitar pagos (genera codigo QR y URL's de Bitcoin) + Solicitar pagos (genera codigo QR y URL's de Bitcoin) &About Bitcoin Core @@ -458,50 +406,14 @@ Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard.&Command-line options &Opciones de linea de comando - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Cliente Bitcoin - - - %n active connection(s) to Bitcoin network - %n conexión activa hacia la red Bitcoin%n conexiones activas hacia la red Bitcoin - No block source available... Ninguna fuente de bloques disponible ... - - Processed %1 of %2 (estimated) blocks of transaction history. - Se han procesado %1 de %2 bloques (estimados) del historial de transacciones. - Processed %1 blocks of transaction history. Procesados %1 bloques del historial de transacciones. - - %n hour(s) - %n hora%n horas - - - %n day(s) - %n día%n días - - - %n week(s) - %n semana%n semanas - - - %1 and %2 - - - - %n year(s) - - %1 behind %1 atrás @@ -562,10 +474,6 @@ Dirección: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> El monedero está <b>cifrado</b> y actualmente <b>bloqueado</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Ha ocurrido un error crítico. Bitcoin ya no puede continuar con seguridad y se cerrará. - ClientModel @@ -600,10 +508,6 @@ Dirección: %4 Fee: Tasa: - - Low Output: - Envío pequeño: - After Fee: Después de tasas: @@ -692,13 +596,9 @@ Dirección: %4 Copy priority Copiar prioridad - - Copy low output - Copiar envío pequeño - Copy change - Copiar cambio + Copiar Cambio highest @@ -744,10 +644,6 @@ Dirección: %4 none ninguno - - Dust - Basura - yes si @@ -773,25 +669,13 @@ Dirección: %4 Las transacciones con alta prioridad son más propensas a ser incluidas dentro de un bloque. - This label turns red, if the priority is smaller than "medium". - Esta etiqueta se convierte en rojo, si la prioridad es menor que "medio". + This label turns red, if the priority is smaller than "medium". + Esta etiqueta se convierte en rojo, si la prioridad es menor que "medio". This label turns red, if any recipient receives an amount smaller than %1. Esta etiqueta se torna roja si cualquier destinatario recibe una cantidad menor a %1. - - This means a fee of at least %1 is required. - Esto significa que se necesita una tarifa de al menos %1. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - Cantidades por debajo de 0.546 veces la tasa serán mostradas como basura - - - This label turns red, if the change is smaller than %1. - Esta etiqueta se vuelve roja si la cantidad de monedas es menor a %1 - (no label) (sin etiqueta) @@ -844,12 +728,12 @@ Dirección: %4 Editar dirección de envío - The entered address "%1" is already in the address book. - La dirección introducida "%1" ya está presente en la libreta de direcciones. + The entered address "%1" is already in the address book. + La dirección introducida "%1" ya está presente en la libreta de direcciones. - The entered address "%1" is not a valid Bitcoin address. - La dirección introducida "%1" no es una dirección Bitcoin válida. + The entered address "%1" is not a valid Bitcoin address. + La dirección introducida "%1" no es una dirección Bitcoin válida. Could not unlock wallet. @@ -885,10 +769,6 @@ Dirección: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core Núcleo de Bitcoin @@ -897,6 +777,14 @@ Dirección: %4 version versión + + About Bitcoin Core + Acerca del Núcleo de Bitcoin + + + Command-line options + Opciones de la línea de órdenes + Usage: Uso: @@ -910,17 +798,13 @@ Dirección: %4 Opciones GUI - Set language, for example "de_DE" (default: system locale) - Establecer el idioma, por ejemplo, "es_ES" (predeterminado: configuración regional del sistema) + Set language, for example "de_DE" (default: system locale) + Establecer el idioma, por ejemplo, "es_ES" (predeterminado: configuración regional del sistema) Start minimized Arrancar minimizado - - Set SSL root certificates for payment request (default: -system-) - - Show splash screen on startup (default: 1) Mostrar pantalla de bienvenida en el inicio (predeterminado: 1) @@ -957,12 +841,8 @@ Dirección: %4 Utilice un directorio de datos personalizado: - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - Error: No puede crearse el directorio de datos especificado "%1". + Bitcoin Core + Núcleo de Bitcoin Error @@ -1026,42 +906,18 @@ Dirección: %4 &Start Bitcoin on system login &Iniciar Bitcoin al iniciar el sistema - - Size of &database cache - - MB MB - - Number of script &verification threads - - Connect to the Bitcoin network through a SOCKS proxy. Conéctese a la red Bitcoin través de un proxy SOCKS. - - &Connect through SOCKS proxy (default proxy): - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Dirección IP del proxy (ej. IPv4: 127.0.0.1 / IPv6: ::1) - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - Reset all client options to default. Restablecer todas las opciones del cliente a las predeterminadas. @@ -1074,30 +930,10 @@ Dirección: %4 &Network &Red - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - Expert Experto - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Abrir automáticamente el puerto del cliente Bitcoin en el router. Esta opción solo funciona si el router admite UPnP y está activado. @@ -1118,14 +954,6 @@ Dirección: %4 Port of the proxy (e.g. 9050) Puerto del servidor proxy (ej. 9050) - - SOCKS &Version: - &Versión SOCKS: - - - SOCKS version of the proxy (e.g. 5) - Versión del proxy SOCKS (ej. 5) - &Window &Ventana @@ -1166,14 +994,6 @@ Dirección: %4 Choose the default subdivision unit to show in the interface and when sending coins. Elegir la subdivisión predeterminada para mostrar cantidades en la interfaz y cuando se envían monedas. - - Whether to show Bitcoin addresses in the transaction list or not. - Mostrar o no las direcciones Bitcoin en la lista de transacciones. - - - &Display addresses in transaction list - &Mostrar las direcciones en la lista de transacciones - Whether to show coin control features or not. Mostrar o no características de control de moneda @@ -1192,7 +1012,7 @@ Dirección: %4 none - Ninguna + ninguno Confirm options reset @@ -1202,10 +1022,6 @@ Dirección: %4 Client restart required to activate changes. Reinicio del cliente para activar cambios. - - Client will be shutdown, do you want to proceed? - - This change would require a client restart. Este cambio requiere reinicio por parte del cliente. @@ -1229,18 +1045,10 @@ Dirección: %4 Wallet Monedero - - Available: - - Your current spendable balance Su balance actual gastable - - Pending: - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance Total de transacciones que deben ser confirmadas, y que no cuentan con el balance gastable necesario @@ -1277,8 +1085,8 @@ Dirección: %4 Gestión de URI - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - ¡No se puede interpretar la URI! Esto puede deberse a una dirección Bitcoin inválida o a parámetros de URI mal formados. + Invalid payment address %1 + Dirección de pago no válida %1 Requested payment amount of %1 is too small (considered dust). @@ -1292,26 +1100,6 @@ Dirección: %4 Cannot start bitcoin: click-to-pay handler No se pudo iniciar bitcoin: manejador de pago-al-clic - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - Unverified payment requests to custom payment scripts are unsupported. No están soportadas las peticiones inseguras a scripts de pago personalizados @@ -1324,10 +1112,6 @@ Dirección: %4 Error communicating with %1: %2 Error en la comunicación con %1: %2 - - Payment request can not be parsed or processed! - - Bad response from server %1 Respuesta errónea del servidor %1 @@ -1341,33 +1125,28 @@ Dirección: %4 Error en petición de red + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Cantidad - Error: Specified data directory "%1" does not exist. - Error: El directorio de datos especificado "%1" no existe. + %1 h + %1 h - Error: Cannot parse configuration file: %1. Only use key=value syntax. - + %1 m + %1 m - Error: Invalid combination of -regtest and -testnet. - Error: Combinación no válida de -regtest y -testnet. + N/A + N/D - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Introduzca una dirección Bitcoin (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget @@ -1403,7 +1182,7 @@ Dirección: %4 &Information - &Información + Información Debug window @@ -1441,10 +1220,6 @@ Dirección: %4 Current number of blocks Número actual de bloques - - Estimated total blocks - Bloques totales estimados - Last block time Hora del último bloque @@ -1521,19 +1296,7 @@ Dirección: %4 %1 GB %1 GB - - %1 m - %1 m - - - %1 h - %1 h - - - %1 h %2 m - %1 h %2 m - - + ReceiveCoinsDialog @@ -1556,34 +1319,14 @@ Dirección: %4 R&euse an existing receiving address (not recommended) R&eutilizar una dirección existente para recibir (no recomendado) - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - Clear all fields of the form. - Limpiar todos los campos del formulario. + Limpiar todos los campos del formulario Clear Limpiar - - Requested payments history - - &Request payment &Solicitar pago @@ -1608,10 +1351,6 @@ Dirección: %4 Copy label Copiar etiqueta - - Copy message - - Copy amount Copiar cantidad @@ -1698,11 +1437,7 @@ Dirección: %4 (no message) (Ningun mensaje) - - (no amount) - - - + SendCoinsDialog @@ -1745,10 +1480,6 @@ Dirección: %4 Fee: Tasa: - - Low Output: - Envío pequeño: - After Fee: Después de tasas: @@ -1807,7 +1538,7 @@ Dirección: %4 Copy amount - Copiar cuantía + Copiar cantidad Copy fee @@ -1825,10 +1556,6 @@ Dirección: %4 Copy priority Copiar prioridad - - Copy low output - Copiar envío pequeño - Copy change Copiar Cambio @@ -1889,14 +1616,6 @@ Dirección: %4 added as transaction fee añadido como comisión de transacción - - Payment request expired - Petición de pago expirada - - - Invalid payment address %1 - Dirección de pago no válida %1 - SendCoinsEntry @@ -1908,10 +1627,6 @@ Dirección: %4 Pay &To: &Pagar a: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - La dirección a la que enviar el pago (p. ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Etiquete esta dirección para añadirla a la libreta @@ -1922,7 +1637,7 @@ Dirección: %4 Choose previously used address - Escoger direcciones previamente usadas + Escoger dirección previamente usada This is a normal payment. @@ -1944,10 +1659,6 @@ Dirección: %4 Remove this entry Eliminar esta transacción - - Message: - - This is a verified payment request. Esto es una petición de pago verificado. @@ -1956,10 +1667,6 @@ Dirección: %4 Enter a label for this address to add it to the list of used addresses Introduce una etiqueta para esta dirección para añadirla a la lista de direcciones utilizadas - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - This is an unverified payment request. Esto es una petición de pago no verificado. @@ -1975,15 +1682,7 @@ Dirección: %4 ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog @@ -1998,10 +1697,6 @@ Dirección: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Puede firmar mensajes con sus direcciones para demostrar que las posee. Tenga cuidado de no firmar cualquier cosa vaga, ya que los ataques de phishing pueden tratar de engañarle para suplantar su identidad. Firme solo declaraciones totalmente detalladas con las que usted esté de acuerdo. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - La dirección con la que firmar el mensaje (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Choose previously used address Escoger dirección previamente usada @@ -2054,10 +1749,6 @@ Dirección: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Introduzca la dirección para la firma, el mensaje (asegurándose de copiar tal cual los saltos de línea, espacios, tabulaciones, etc.) y la firma a continuación para verificar el mensaje. Tenga cuidado de no asumir más información de lo que dice el propio mensaje firmado para evitar fraudes basados en ataques de tipo man-in-the-middle. - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - La dirección con la que se firmó el mensaje (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address Verificar el mensaje para comprobar que fue firmado con la dirección Bitcoin indicada @@ -2071,12 +1762,8 @@ Dirección: %4 Limpiar todos los campos de la verificación de mensaje - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Introduzca una dirección Bitcoin (ej. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Haga clic en "Firmar mensaje" para generar la firma + Click "Sign Message" to generate signature + Haga clic en "Firmar mensaje" para generar la firma The entered address is invalid. @@ -2155,10 +1842,6 @@ Dirección: %4 Open until %1 Abierto hasta %1 - - conflicted - - %1/offline %1/fuera de línea @@ -2175,10 +1858,6 @@ Dirección: %4 Status Estado - - , broadcast through %n node(s) - , transmitir a través de %n nodo, transmitir a través de %n nodos - Date Fecha @@ -2211,10 +1890,6 @@ Dirección: %4 Credit Crédito - - matures in %n more block(s) - disponible en %n bloque másdisponible en %n bloques más - not accepted no aceptada @@ -2241,15 +1916,15 @@ Dirección: %4 Transaction ID - Identificador de transacción + ID Merchant Vendedor - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - Las monedas generadas deben madurar %1 bloques antes de que puedan ser gastadas. Una vez que generas este bloque, es propagado por la red para ser añadido a la cadena de bloques. Si falla el intento de meterse en la cadena, su estado cambiará a "no aceptado" y ya no se puede gastar. Esto puede ocurrir ocasionalmente si otro nodo genera un bloque a pocos segundos del tuyo. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Las monedas generadas deben madurar %1 bloques antes de que puedan ser gastadas. Una vez que generas este bloque, es propagado por la red para ser añadido a la cadena de bloques. Si falla el intento de meterse en la cadena, su estado cambiará a "no aceptado" y ya no se puede gastar. Esto puede ocurrir ocasionalmente si otro nodo genera un bloque a pocos segundos del tuyo. Debug information @@ -2279,10 +1954,6 @@ Dirección: %4 , has not been successfully broadcast yet , todavía no se ha sido difundido satisfactoriamente - - Open for %n more block(s) - Abrir para %n bloque másAbrir para %n bloques más - unknown desconocido @@ -2313,18 +1984,6 @@ Dirección: %4 Address Dirección - - Amount - Cantidad - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - Abrir para %n bloque másAbrir para %n bloques más - Open until %1 Abierto hasta %1 @@ -2341,22 +2000,6 @@ Dirección: %4 Generated but not accepted Generado pero no aceptado - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with Recibido con @@ -2470,7 +2113,7 @@ Dirección: %4 Copy amount - Copiar cuantía + Copiar cantidad Copy transaction ID @@ -2528,10 +2171,6 @@ Dirección: %4 Address Dirección - - Amount - Cantidad - ID ID @@ -2545,6 +2184,9 @@ Dirección: %4 para + + UnitDisplayStatusBarControl + WalletFrame @@ -2596,20 +2238,6 @@ Dirección: %4 bitcoin-core - - Usage: - Uso: - - - List commands - Muestra comandos - - - - Get help for a command - Recibir ayuda para un comando - - Options: Opciones: @@ -2653,10 +2281,6 @@ Dirección: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Número de segundos en que se evita la reconexión de pares con mal comportamiento (predeterminado: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Ha ocurrido un error al configurar el puerto RPC %u para escucha en IPv4: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Escuchar conexiones JSON-RPC en <puerto> (predeterminado: 8332 o testnet:18332) @@ -2666,10 +2290,6 @@ Dirección: %4 Aceptar comandos consola y JSON-RPC - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Ejecutar en segundo plano como daemon y aceptar comandos @@ -2694,7 +2314,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, debe establecer un valor rpcpassword en el archivo de configuración: %s @@ -2705,37 +2325,17 @@ rpcpassword=%s El nombre de usuario y la contraseña DEBEN NO ser iguales. Si el archivo no existe, créelo con permisos de archivo de solo lectura. Se recomienda también establecer alertnotify para recibir notificaciones de problemas. -Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Cifradores aceptables (por defecto: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Ha ocurrido un error al configurar el puerto RPC %u para escuchar mediante IPv6. Recurriendo a IPv4: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Vincular a la dirección dada y escuchar siempre en ella. Utilice la notación [host]:port para IPv6 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Iniciar modo de prueba de regresión, el cuál utiliza una cadena especial en la cual los bloques pueden ser resueltos instantáneamente. Se utiliza para herramientas de prueba de regresión y desarrollo de aplicaciones. - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. ¡Error: se ha rechazado la transacción! Esto puede ocurrir si ya se han gastado algunas de las monedas del monedero, como ocurriría si hubiera hecho una copia de wallet.dat y se hubieran gastado monedas a partir de la copia, con lo que no se habrían marcado aquí como gastadas. @@ -2748,38 +2348,10 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Ejecutar comando cuando una transacción del monedero cambia (%s en cmd se remplazará por TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Esta es una versión de pre-prueba - utilícela bajo su propio riesgo. No la utilice para usos comerciales o de minería. - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) Usar distintos proxys SOCKS5 para comunicarse vía Tor de forma anónima (Por defecto: -proxy) @@ -2788,10 +2360,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Aviso: ¡-paytxfee tiene un valor muy alto! Esta es la comisión que pagará si envía una transacción. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Precaución: Por favor, ¡revise que la fecha y hora de su ordenador son correctas! Si su reloj está mal, Bitcoin no funcionará correctamente. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Atención: ¡Parece que la red no está totalmente de acuerdo! Algunos mineros están presentando inconvenientes. @@ -2808,14 +2376,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. Aviso: ¡Recuperados datos de wallet.dat corrupto! El wallet.dat original se ha guardado como wallet.{timestamp}.bak en %s; si hubiera errores en su saldo o transacciones, deberá restaurar una copia de seguridad. - - (default: 1) - - - - (default: wallet.dat) - - <category> can be: <category> puede ser: @@ -2824,54 +2384,22 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Attempt to recover private keys from a corrupt wallet.dat Intento de recuperar claves privadas de un wallet.dat corrupto - - Bitcoin Core Daemon - Proceso Bitcoin-QT - Block creation options: Opciones de creación de bloques: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) Conectar sólo a los nodos (o nodo) especificados - - Connect through SOCKS proxy - Conectar a través de un proxy SOCKS - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - Conectar a JSON-RPC en <puerto> (predeterminado: 8332 o testnet: 18332) - - - Connection options: - - Corrupted block database detected Corrupción de base de datos de bloques detectada. - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - Discover own IP address (default: 1 when listening and no -externalip) Descubrir dirección IP propia (predeterminado: 1 al escuchar sin -externalip) - - Do not load the wallet and disable wallet RPC calls - - Do you want to rebuild the block database now? ¿Quieres reconstruir la base de datos de bloques ahora? @@ -2948,22 +2476,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write undo data No se han podido escribir los datos de deshacer - - Fee per kB to add to transactions you send - Donación por KB añadida a las transacciones que envíe - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - Encontrar pares mediante búsqueda de DNS (predeterminado: 1 salvo con -connect) - - - Force safe mode (default: 0) - - Generate coins (default: 0) Generar monedas (por defecto: 0) @@ -2976,17 +2488,13 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. If <category> is not supplied, output all debugging information. Si no se proporciona <category>, mostrar toda la depuración - - Importing... - - Incorrect or no genesis block found. Wrong datadir for network? Incorrecto o bloque de génesis no encontrado. Datadir equivocada para la red? - Invalid -onion address: '%s' - Dirección -onion inválida: '%s' + Invalid -onion address: '%s' + Dirección -onion inválida: '%s' Not enough file descriptors available. @@ -2996,22 +2504,10 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Prepend debug output with timestamp (default: 1) Anteponer marca temporal a la información de depuración (por defecto: 1) - - RPC client options: - Opciones para cliente RPC: - Rebuild block chain index from current blk000??.dat files Reconstruir el índice de la cadena de bloques a partir de los archivos blk000??.dat actuales - - Select SOCKS version for -proxy (4 or 5, default: 5) - Seleccionar version de SOCKS para -proxy (4 o 5, por defecto: 5) - - - Set database cache size in megabytes (%d to %d, default: %d) - - Set maximum block size in bytes (default: %d) Establecer tamaño máximo de bloque en bytes (por defecto: %d) @@ -3024,18 +2520,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Specify wallet file (within data directory) Especificar archivo de monedero (dentro del directorio de datos) - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - Uso (desaconsejado, usar bitcoin-cli) - Verifying blocks... Verificando bloques... @@ -3044,22 +2528,10 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Verifying wallet... Verificando monedero... - - Wait for RPC server to start - Espere a que se inicie el servidor RPC - Wallet %s resides outside data directory %s El monedero %s se encuentra fuera del directorio de datos %s - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - Aviso: Argumento -debugnet anticuado, utilice -debug=net - You need to rebuild the database using -reindex to change -txindex Usted necesita reconstruir la base de datos utilizando -reindex para cambiar -txindex @@ -3068,10 +2540,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Imports blocks from external blk000??.dat file Importa los bloques desde un archivo blk000??.dat externo - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Ejecutar un comando cuando se reciba una alerta importante o cuando veamos un fork demasiado largo (%s en cmd se reemplazará por el mensaje) @@ -3089,20 +2557,12 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Información - Invalid amount for -minrelaytxfee=<amount>: '%s' - Inválido por el monto -minrelaytxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Inválido por el monto -minrelaytxfee=<amount>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - Inválido por el monto -mintxfee=<amount>: '%s' - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - + Invalid amount for -mintxfee=<amount>: '%s' + Inválido por el monto -mintxfee=<amount>: '%s' Maintain a full transaction index (default: 0) @@ -3124,42 +2584,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Only connect to nodes in network <net> (IPv4, IPv6 or Tor) Conectarse solo a nodos de la red <net> (IPv4, IPv6 o Tor) - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - Opciones SSL: (ver la Bitcoin Wiki para instrucciones de configuración SSL) - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file Enviar información de trazas/depuración a la consola en lugar de al archivo debug.log @@ -3168,18 +2592,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Set minimum block size in bytes (default: 0) Establecer tamaño mínimo de bloque en bytes (predeterminado: 0) - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - Shrink debug.log file on client startup (default: 1 when no -debug) Reducir el archivo debug.log al iniciar el cliente (predeterminado: 1 sin -debug) @@ -3192,10 +2604,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Specify connection timeout in milliseconds (default: 5000) Especificar el tiempo máximo de conexión en milisegundos (predeterminado: 5000) - - Start Bitcoin Core Daemon - - System error: Error de sistema: @@ -3233,18 +2641,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: This version is obsolete, upgrade required! Aviso: Esta versión es obsoleta, actualización necesaria! - - Zapping all transactions from wallet... - - - - on startup - - - - version - versión - wallet.dat corrupt, salvage failed wallet.dat corrupto. Ha fallado la recuperación. @@ -3252,16 +2648,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Password for JSON-RPC connections Contraseña para las conexiones JSON-RPC - - - - Allow JSON-RPC connections from specified IP address - Permitir conexiones JSON-RPC desde la dirección IP especificada - - - - Send commands to node running on <ip> (default: 127.0.0.1) - Enviar comando al nodo situado en <ip> (predeterminado: 127.0.0.1) @@ -3301,10 +2687,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Este mensaje de ayuda - - Unable to bind to %s on this computer (bind returned error %d, %s) - No es posible conectar con %s en este sistema (bind ha dado el error %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Permitir búsquedas DNS para -addnode, -seednode y -connect @@ -3317,41 +2699,29 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted Error al cargar wallet.dat: el monedero está dañado - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Error al cargar wallet.dat: El monedero requiere una versión más reciente de Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - El monedero ha necesitado ser reescrito. Reinicie Bitcoin para completar el proceso - Error loading wallet.dat Error al cargar wallet.dat - Invalid -proxy address: '%s' - Dirección -proxy inválida: '%s' + Invalid -proxy address: '%s' + Dirección -proxy inválida: '%s' - Unknown network specified in -onlynet: '%s' - La red especificada en -onlynet '%s' es desconocida + Unknown network specified in -onlynet: '%s' + La red especificada en -onlynet '%s' es desconocida - Unknown -socks proxy version requested: %i - Solicitada versión de proxy -socks desconocida: %i + Cannot resolve -bind address: '%s' + No se puede resolver la dirección de -bind: '%s' - Cannot resolve -bind address: '%s' - No se puede resolver la dirección de -bind: '%s' + Cannot resolve -externalip address: '%s' + No se puede resolver la dirección de -externalip: '%s' - Cannot resolve -externalip address: '%s' - No se puede resolver la dirección de -externalip: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Cantidad inválida para -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Cantidad inválida para -paytxfee=<amount>: '%s' Invalid amount @@ -3397,13 +2767,5 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error Error - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Tiene que establecer rpcpassword=<contraseña> en el fichero de configuración: ⏎ -%s ⏎ -Si el archivo no existe, créelo con permiso de lectura solamente del propietario. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_es_MX.ts b/src/qt/locale/bitcoin_es_MX.ts index 9a39551d6b..c89ac5c6ef 100644 --- a/src/qt/locale/bitcoin_es_MX.ts +++ b/src/qt/locale/bitcoin_es_MX.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - El nucleo de Bitcoin de desarrolladores - - - (%1-bit) - - - + AddressBookPage @@ -43,7 +11,7 @@ This product includes software developed by the OpenSSL Project for use in the O &New - + &Nuevo Copy the currently selected address to the system clipboard @@ -51,27 +19,27 @@ This product includes software developed by the OpenSSL Project for use in the O &Copy - + &Copiar C&lose - + Cerrar &Copy Address - + &Copiar dirección Delete the currently selected address from the list - + Eliminar la dirección actualmente seleccionada de la lista Export the data in the current tab to a file - + Exportar la información en la tabla actual a un archivo &Export - + &Exportar &Delete @@ -79,43 +47,43 @@ This product includes software developed by the OpenSSL Project for use in the O Choose the address to send coins to - + Elija una dirección a la cual enviar monedas Choose the address to receive coins with - + Elija la dirección con la cual recibir monedas C&hoose - + Elegir Sending addresses - + Enviando direcciones Receiving addresses - + Recibiendo direcciones These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - + Estas son tus direcciones de Bitcoin para enviar pagos. Siempre revise la cantidad y la dirección receptora antes de enviar monedas These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - + Estas son tus direcciones Bitcoin para recibir pagos. Es recomendado usar una nueva dirección receptora para cada transacción. Copy &Label - + Copiar &Etiqueta &Edit - + &Editar Export Address List - + Exportar Lista de direcciones Comma separated file (*.csv) @@ -125,11 +93,7 @@ This product includes software developed by the OpenSSL Project for use in the O Exporting Failed Fallo en la exportación - - There was an error trying to save the address list to %1. - Ocurrio un error al intentar guardar la lista de direccione en %1 - - + AddressTableModel @@ -147,10 +111,6 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase Ingrese la contraseña @@ -163,10 +123,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Repita la nueva contraseña - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Ingrese la nueva contraseña a la cartera<br/>Por favor use una contraseña de<b>10 o más caracteres aleatorios</b> o <b>ocho o más palabras</b>. - Encrypt wallet Cartera encriptada. @@ -201,19 +157,15 @@ This product includes software developed by the OpenSSL Project for use in the O Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - + Advertencia: Si encripta su cartera y pierde su contraseña, <b>PERDERÁ TODOS SUS BITCOINS</b>! Are you sure you wish to encrypt your wallet? - - - - 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. - + ¿Está seguro que desea encriptar su cartera? Warning: The Caps Lock key is on! - + Advertencia: ¡La tecla Bloq Mayus está activada! Wallet encrypted @@ -221,7 +173,7 @@ This product includes software developed by the OpenSSL Project for use in the O Bitcoin 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. - + Bitcoin se cerrará para finalizar el proceso de encriptación. Recuerda que encriptar tu cartera no protege completamente a tus bitcoins de ser robadas por malware infectando tu computadora. Wallet encryption failed @@ -249,14 +201,14 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet passphrase was successfully changed. - + La contraseña de la cartera ha sido exitosamente cambiada. BitcoinGUI Sign &message... - + Sign &mensaje Synchronizing with network... @@ -268,7 +220,7 @@ This product includes software developed by the OpenSSL Project for use in the O Node - + Nodo Show general overview of wallet @@ -290,17 +242,13 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application Salir de la aplicación - - Show information about Bitcoin - Mostrar información acerca de Bitcoin - About &Qt - + Acerca de &Qt Show information about Qt - + Mostrar información acerca de Qt &Options... @@ -308,47 +256,47 @@ This product includes software developed by the OpenSSL Project for use in the O &Encrypt Wallet... - + &Encriptar cartera &Backup Wallet... - + &Respaldar cartera &Change Passphrase... - + &Cambiar contraseña... &Sending addresses... - + &Enviando direcciones... &Receiving addresses... - + &Recibiendo direcciones... Open &URI... - + Abrir &URL... Importing blocks from disk... - + Importando bloques desde el disco... Reindexing blocks on disk... - + Reindexando bloques en el disco... Send coins to a Bitcoin address - + Enviar monedas a una dirección Bitcoin Modify configuration options for Bitcoin - + Modificar las opciones de configuración de Bitcoin Backup wallet to another location - + Respaldar cartera en otra ubicación Change the passphrase used for wallet encryption @@ -356,51 +304,15 @@ This product includes software developed by the OpenSSL Project for use in the O &Debug window - + &Depurar ventana Open debugging and diagnostic console - + Abrir la consola de depuración y disgnostico &Verify message... - - - - Bitcoin - - - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - + &Verificar mensaje... &File @@ -418,34 +330,10 @@ This product includes software developed by the OpenSSL Project for use in the O Tabs toolbar Pestañas - - [testnet] - - Bitcoin Core nucleo Bitcoin - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - &Command-line options opciones de la &Linea de comandos @@ -454,70 +342,10 @@ This product includes software developed by the OpenSSL Project for use in the O Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options Mostrar mensaje de ayuda del nucleo de Bitcoin para optener una lista con los posibles comandos de Bitcoin - - Bitcoin client - - %n active connection(s) to Bitcoin network %n Activar conexión a la red de Bitcoin%n Activar conexiones a la red de Bitcoin - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - - - Error - - - - Warning - - - - Information - - Up to date Actualizado al dia @@ -534,14 +362,6 @@ This product includes software developed by the OpenSSL Project for use in the O Incoming transaction Transacción entrante - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> La cartera esta <b>encriptada</b> y <b>desbloqueada</b> actualmente @@ -550,28 +370,12 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> La cartera esta <b>encriptada</b> y <b>bloqueada</b> actualmente - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - Bytes: Bytes: @@ -588,30 +392,6 @@ Address: %4 Fee: Cuota: - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount Monto @@ -624,18 +404,10 @@ Address: %4 Date Fecha - - Confirmations - - Confirmed Confirmado - - Priority - - Copy address Copiar dirección @@ -648,18 +420,6 @@ Address: %4 Copy amount copiar monto - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - Copy quantity copiar cantidad @@ -680,119 +440,15 @@ Address: %4 Copy priority copiar prioridad - - Copy low output - - Copy change copiar cambio - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (sin etiqueta) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -803,14 +459,6 @@ Address: %4 &Label &Etiqueta - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Dirección @@ -832,12 +480,8 @@ Address: %4 Editar dirección de envios - The entered address "%1" is already in the address book. - El domicilio ingresado "%1" ya existe en la libreta de direcciones - - - The entered address "%1" is not a valid Bitcoin address. - + The entered address "%1" is already in the address book. + El domicilio ingresado "%1" ya existe en la libreta de direcciones Could not unlock wallet. @@ -850,33 +494,9 @@ Address: %4 FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - Opciones de lineas de comando del nucleo de Bitcoin - Bitcoin Core nucleo Bitcoin @@ -885,6 +505,14 @@ Address: %4 version Versión + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + Acerca de Bitcoin Core + Usage: Uso: @@ -898,17 +526,13 @@ Address: %4 Opciones de interfaz - Set language, for example "de_DE" (default: system locale) - Definir idioma, por ejemplo "de_DE" (por defecto: Sistema local) + Set language, for example "de_DE" (default: system locale) + Definir idioma, por ejemplo "de_DE" (por defecto: Sistema local) Start minimized Iniciar minimizado - - Set SSL root certificates for payment request (default: -system-) - - Show splash screen on startup (default: 1) Mostrar pantalla de arraque al iniciar (por defecto: 1) @@ -921,637 +545,64 @@ Address: %4 Intro - Welcome - + Bitcoin Core + nucleo Bitcoin - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - - - Error - - - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog Options Opciones - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - Active command-line options that override above options: Activar las opciones de linea de comando que sobre escriben las siguientes opciones: - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage Form Formulario - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - <b>Recent transactions</b> <b>Transacciones recientes</b> - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - advertencia del administrador de red. - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - Tu active proxy no soporta SOCKS5, el cual es requerido para solicitud de pago via proxy. - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - + Amount + Monto - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Ingrese una direccion Bitcoin (ejem. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - &Label: &Etiqueta - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. Mensaje opcional para agregar a la solicitud de pago, el cual será mostrado cuando la solicitud este abierta. Nota: El mensaje no se manda con el pago a travéz de la red de Bitcoin. - - An optional label to associate with the new receiving address. - - Use this form to request payments. All fields are <b>optional</b>. Use este formulario para la solicitud de pagos. Todos los campos son <b>opcionales</b> @@ -1560,46 +611,10 @@ Address: %4 An optional amount to request. Leave this empty or zero to not request a specific amount. Monto opcional a solicitar. Dejarlo vacion o en cero no solicita un monto especifico. - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - Copy label Copiar capa - - Copy message - - Copy amount copiar monto @@ -1607,34 +622,6 @@ Address: %4 ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address Domicilio @@ -1647,19 +634,7 @@ Address: %4 Label Etiqueta - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel @@ -1670,10 +645,6 @@ Address: %4 Label Etiqueta - - Message - - Amount Monto @@ -1682,41 +653,13 @@ Address: %4 (no label) (sin etiqueta) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins Mandar monedas - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - Bytes: Bytes: @@ -1733,42 +676,10 @@ Address: %4 Fee: Cuota: - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Enviar a múltiples receptores a la vez - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - Balance: Saldo: @@ -1777,18 +688,10 @@ Address: %4 Confirm the send action Confirme la acción de enviar - - S&end - - Confirm send coins Confirme para mandar monedas - - %1 to %2 - - Copy quantity copiar cantidad @@ -1813,10 +716,6 @@ Address: %4 Copy priority copiar prioridad - - Copy low output - - Copy change copiar cambio @@ -1829,26 +728,10 @@ Address: %4 or o - - The recipient address is not valid, please recheck. - - The amount to pay must be larger than 0. El monto a pagar debe ser mayor a 0 - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - Transaction creation failed! ¡La creación de transacion falló! @@ -1869,23 +752,7 @@ Address: %4 Warning: Unknown change address Advertencia: Cambio de dirección desconocido - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry @@ -1896,10 +763,6 @@ Address: %4 Pay &To: Pagar &a: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - Enter a label for this address to add it to your address book Ingrese una etiqueta para esta dirección para agregarlo en su libreta de direcciones. @@ -1908,10 +771,6 @@ Address: %4 &Label: &Etiqueta - - Choose previously used address - - This is a normal payment. Este es un pago normal @@ -1940,14 +799,6 @@ Address: %4 This is a verified payment request. Esta es una verificación de solicituda de pago. - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - This is an unverified payment request. Esta es una solicitud de pago no verificada. @@ -1956,11 +807,7 @@ Address: %4 Pay To: Pago para: - - Memo: - - - + ShutdownWindow @@ -1974,26 +821,6 @@ Address: %4 SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - Alt+A Alt+A @@ -2006,115 +833,7 @@ Address: %4 Alt+P Alt+P - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Ingrese una direccion Bitcoin (ejem. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen @@ -2125,32 +844,16 @@ Address: %4 The Bitcoin Core developers El nucleo de Bitcoin de desarrolladores - - [testnet] - - - + TrafficGraphWidget - - KB/s - - - + TransactionDesc Open until %1 Abrir hasta %1 - - conflicted - - - - %1/offline - - %1/unconfirmed %1/No confirmado @@ -2159,118 +862,22 @@ Address: %4 %1 confirmations %1 confirmaciones - - Status - - - - , broadcast through %n node(s) - - Date Fecha - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - + ID Amount Monto - - true - - - - false - - , has not been successfully broadcast yet , no ha sido transmitido aun - - Open for %n more block(s) - - unknown desconocido @@ -2301,18 +908,6 @@ Address: %4 Address Domicilio - - Amount - Monto - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - Open until %1 Abrir hasta %1 @@ -2329,30 +924,10 @@ Address: %4 Generated but not accepted Generado pero no aprovado - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with Recivido con - - Received from - - Sent to Enviar a @@ -2369,10 +944,6 @@ Address: %4 (n/a) (n/a) - - Transaction status. Hover over this field to show number of confirmations. - - Date and time that the transaction was received. Fecha y hora en que la transacción fue recibida @@ -2416,10 +987,6 @@ Address: %4 This year Este año - - Range... - - Received with Recivido con @@ -2460,18 +1027,10 @@ Address: %4 Copy amount copiar monto - - Copy transaction ID - - Edit label Editar capa - - Show transaction details - - Export Transaction History Exportar el historial de transacción @@ -2488,10 +1047,6 @@ Address: %4 Exporting Successful Exportacion satisfactoria - - The transaction history was successfully saved to %1. - el historial de transaciones ha sido guardado exitosamente en 1% - Comma separated file (*.csv) Arhchivo separado por comas (*.CSV) @@ -2516,23 +1071,18 @@ Address: %4 Address Domicilio - - Amount - Monto - ID ID - - Range: - - to Para + + UnitDisplayStatusBarControl + WalletFrame @@ -2551,818 +1101,42 @@ Address: %4 WalletView &Export - + &Exportar Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - + Exportar la información en la tabla actual a un archivo There was an error trying to save the wallet data to %1. Ocurrio un error tratando de guardar la información de la cartera %1 - - The wallet data was successfully saved to %1. - La información de la cartera fué guardada exitosamente a 1% - - - Backup Successful - - - + bitcoin-core - - Usage: - Uso: - - - List commands - Lista de comandos - - - Get help for a command - - - - Options: - - - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - <category> can be: <categoria> puede ser: - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - Wallet options: Opciones de cartera: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - Versión - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - Loading addresses... Cargando direcciones... - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - Loading block index... Cargando indice de bloques... - - Add a node to connect to and attempt to keep the connection open - - Loading wallet... Cargando billetera... - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - Done loading Carga completa - - To use the %s option - - - - Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - - + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_es_UY.ts b/src/qt/locale/bitcoin_es_UY.ts index 03ecce46c0..321e5312ad 100644 --- a/src/qt/locale/bitcoin_es_UY.ts +++ b/src/qt/locale/bitcoin_es_UY.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -41,95 +9,19 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address Crear una nueva dirección - - &New - - Copy the currently selected address to the system clipboard Copia la dirección seleccionada al portapapeles del sistema - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - &Delete &Borrar - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - Comma separated file (*.csv) Archivos separados por coma (*.csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -147,10 +39,6 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase Escriba la contraseña @@ -163,10 +51,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Repetir nueva contraseña - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Introduzca la nueva contraseña para el monedero. <br/> Utilice una contraseña de <b> 10 o más caracteres al azar </ b>, o <b> ocho o más palabras </ b>. - Encrypt wallet Monedero cifrado @@ -199,30 +83,10 @@ This product includes software developed by the OpenSSL Project for use in the O Confirm wallet encryption Confirme el cifrado del monedero - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - Wallet encrypted Monedero cifrado - - Bitcoin 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. - - Wallet encryption failed Fallo en el cifrado del monedero @@ -247,17 +111,9 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet decryption failed Fallo en el descifrado del monedero - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - Synchronizing with network... Sincronizando con la red... @@ -266,10 +122,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Overview &Vista previa - - Node - - Show general overview of wallet Mostrar descripción general del monedero @@ -282,126 +134,18 @@ This product includes software developed by the OpenSSL Project for use in the O Browse transaction history Buscar en el historial de transacciones - - E&xit - - Quit application Salir de la aplicacion - - Show information about Bitcoin - Mostrar informacion sobre Bitcoin - - - About &Qt - - - - Show information about Qt - - &Options... &Opciones... - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - Change the passphrase used for wallet encryption Cambie la clave utilizada para el cifrado del monedero - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - &File &Archivo @@ -422,102 +166,10 @@ This product includes software developed by the OpenSSL Project for use in the O [testnet] [prueba_de_red] - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - %n active connection(s) to Bitcoin network %n conexión activa a la red Bitcoin %n conexiones activas a la red Bitcoin - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - - - Error - - - - Warning - - - - Information - - Up to date A la fecha @@ -534,14 +186,6 @@ This product includes software developed by the OpenSSL Project for use in the O Incoming transaction Transacción entrante - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> El Monedero esta <b>cifrado</b> y actualmente <b>desbloqueado</b> @@ -550,72 +194,12 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> El Monedero esta <b>cifrado</b> y actualmente <b>bloqueado</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - - - Amount - - Address Direccion @@ -624,175 +208,11 @@ Address: %4 Date Fecha - - Confirmations - - - - Confirmed - - - - Priority - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (Sin etiqueta) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -803,14 +223,6 @@ Address: %4 &Label &Etiqueta - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Direccion @@ -831,14 +243,6 @@ Address: %4 Edit sending address Editar dirección de envío - - The entered address "%1" is already in the address book. - La dirección introducida "% 1" ya está en la libreta de direcciones. - - - The entered address "%1" is not a valid Bitcoin address. - - Could not unlock wallet. No se puede abrir el monedero. @@ -850,816 +254,67 @@ Address: %4 FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - - - version - - - - Usage: - - - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - - - Error - - - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog Options Opciones - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage Form Formulario - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - <b>Recent transactions</b> <b>Transacciones recientes</b> - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - - Bitcoin - - - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - &Label: &Etiqueta: - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - - - Copy label - - - - Copy message - - - - Copy amount - - - + ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address Direccion - - Amount - - Label Etiqueta - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel @@ -1670,105 +325,21 @@ Address: %4 Label Etiqueta - - Message - - - - Amount - - (no label) (Sin etiqueta) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins Enviar monedas - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Enviar a varios destinatarios a la vez - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - Balance: Balance: @@ -1777,115 +348,19 @@ Address: %4 Confirm the send action Confirmar el envío - - S&end - - Confirm send coins Confirmar el envio de monedas - - %1 to %2 - - - - Copy quantity - - - - Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - The amount to pay must be larger than 0. La cantidad a pagar debe ser mayor que 0. - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (Sin etiqueta) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry @@ -1896,10 +371,6 @@ Address: %4 Pay &To: Pagar &A: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - Enter a label for this address to add it to your address book Introduzca una etiqueta para esta dirección para añadirla a su libreta de direcciones @@ -1908,14 +379,6 @@ Address: %4 &Label: &Etiqueta: - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt+A @@ -1928,72 +391,12 @@ Address: %4 Alt+P Alt+P - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - Alt+A Alt+A @@ -2006,125 +409,9 @@ Address: %4 Alt+P Alt+P - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - [testnet] [prueba_de_red] @@ -2132,145 +419,17 @@ Address: %4 TrafficGraphWidget - - KB/s - - - + TransactionDesc Open until %1 Abrir hasta %1 - - conflicted - - - - %1/offline - - - - %1/unconfirmed - - - - %1 confirmations - - - - Status - - - - , broadcast through %n node(s) - - Date Fecha - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - - - Amount - - - - true - - - - false - - - - , has not been successfully broadcast yet - - - - Open for %n more block(s) - - unknown desconocido @@ -2278,236 +437,32 @@ Address: %4 TransactionDescDialog - - Transaction details - - - - This pane shows a detailed description of the transaction - - - + TransactionTableModel Date Fecha - - Type - - Address Direccion - - Amount - - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - Open until %1 Abrir hasta %1 - - Confirmed (%1 confirmations) - - - - This block was not received by any other nodes and will probably not be accepted! - - - - Generated but not accepted - - - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - - - Received with - - - - Received from - - - - Sent to - - - - Payment to yourself - - - - Mined - - - - (n/a) - - - - Transaction status. Hover over this field to show number of confirmations. - - - - Date and time that the transaction was received. - - - - Type of transaction. - - - - Destination address of transaction. - - - - Amount removed from or added to balance. - - - + TransactionView - - All - - - - Today - - - - This week - - - - This month - - - - Last month - - - - This year - - - - Range... - - - - Received with - - - - Sent to - - - - To yourself - - - - Mined - - - - Other - - - - Enter address or label to search - - - - Min amount - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Archivos separados por coma (*.csv) - - Confirmed - - Date Fecha - - Type - - Label Etiqueta @@ -2516,30 +471,13 @@ Address: %4 Address Direccion - - Amount - - - - ID - - - - Range: - - - - to - - - + + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2549,820 +487,8 @@ Address: %4 WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - - - Options: - - - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - - - Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - - - Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - - - Done loading - - - - To use the %s option - - - - Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - - + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_et.ts b/src/qt/locale/bitcoin_et.ts index e6c27bf21c..cd3a39b6b9 100644 --- a/src/qt/locale/bitcoin_et.ts +++ b/src/qt/locale/bitcoin_et.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - ⏎ -See on eksperimentaalne tarkvara.⏎ -⏎ -Levitatud MIT/X11 tarkvara litsentsi all, vaata kaasasolevat faili COPYING või http://www.opensource.org/licenses/mit-license.php⏎ -⏎ -Toode sisaldab OpenSSL Projekti all toodetud tarkvara, mis on kasutamiseks OpenSSL Toolkitis (http://www.openssl.org/) ja Eric Young'i poolt loodud krüptograafilist tarkvara (eay@cryptsoft.com) ning Thomas Bernard'i loodud UPnP tarkvara. - - - Copyright - Autoriõigus - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -46,22 +9,10 @@ Toode sisaldab OpenSSL Projekti all toodetud tarkvara, mis on kasutamiseks OpenS Create a new address Loo uus aadress - - &New - - Copy the currently selected address to the system clipboard Kopeeri märgistatud aadress vahemällu - - &Copy - - - - C&lose - - &Copy Address &Aadressi kopeerimine @@ -72,44 +23,16 @@ Toode sisaldab OpenSSL Projekti all toodetud tarkvara, mis on kasutamiseks OpenS Export the data in the current tab to a file - - - - &Export - + Ekspordi kuvatava vahelehe sisu faili &Delete &Kustuta - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. Need on sinu Bitcoini aadressid maksete saatmiseks. Müntide saatmisel kontrolli alati summat ning saaja aadressi. - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - Copy &Label &Märgise kopeerimine @@ -118,23 +41,11 @@ Toode sisaldab OpenSSL Projekti all toodetud tarkvara, mis on kasutamiseks OpenS &Edit &Muuda - - Export Address List - - Comma separated file (*.csv) Komaeraldatud fail (*.csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -168,10 +79,6 @@ Toode sisaldab OpenSSL Projekti all toodetud tarkvara, mis on kasutamiseks OpenS Repeat new passphrase Korda salafraasi - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Sisesta rahakotile uus salafraas.<br/>Palun kasuta salafraasina <b>vähemalt 10 tähte/numbrit/sümbolit</b>, või <b>vähemalt 8 sõna</b>. - Encrypt wallet Krüpteeri rahakott @@ -271,10 +178,6 @@ Toode sisaldab OpenSSL Projekti all toodetud tarkvara, mis on kasutamiseks OpenS &Overview &Ülevaade - - Node - - Show general overview of wallet Kuva rahakoti üld-ülevaade @@ -295,10 +198,6 @@ Toode sisaldab OpenSSL Projekti all toodetud tarkvara, mis on kasutamiseks OpenS Quit application Väljumine - - Show information about Bitcoin - Kuva info Bitcoini kohta - About &Qt Teave &Qt kohta @@ -323,18 +222,6 @@ Toode sisaldab OpenSSL Projekti all toodetud tarkvara, mis on kasutamiseks OpenS &Change Passphrase... &Salafraasi muutmine - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - Importing blocks from disk... Impordi blokid kettalt... @@ -431,50 +318,10 @@ Toode sisaldab OpenSSL Projekti all toodetud tarkvara, mis on kasutamiseks OpenS Bitcoin Core Bitcoini tuumik - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Bitcoini klient - %n active connection(s) to Bitcoin network %n aktiivne ühendus Bitcoini võrku%n aktiivset ühendust Bitcoini võrku - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - Protsessitud %1 (arvutuslikult) tehingu ajaloo blokki %2-st. - Processed %1 blocks of transaction history. Protsessitud %1 tehingute ajaloo blokki. @@ -491,14 +338,6 @@ Toode sisaldab OpenSSL Projekti all toodetud tarkvara, mis on kasutamiseks OpenS %n week(s) %n nädal%n nädalat - - %1 and %2 - - - - %n year(s) - - %1 behind %1 maas @@ -558,10 +397,6 @@ Aadress: %4⏎ Wallet is <b>encrypted</b> and currently <b>locked</b> Rahakott on <b>krüpteeritud</b> ning hetkel <b>suletud</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Ilmnes kriitiline tõrge. Bitcoin suletakse turvakaalutluste tõttu. - ClientModel @@ -572,54 +407,10 @@ Aadress: %4⏎ CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - Amount: Summa: - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount Kogus @@ -632,18 +423,10 @@ Aadress: %4⏎ Date Kuupäev - - Confirmations - - Confirmed Kinnitatud - - Priority - - Copy address Aadressi kopeerimine @@ -660,147 +443,11 @@ Aadress: %4⏎ Copy transaction ID Kopeeri tehingu ID - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (silti pole) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -811,14 +458,6 @@ Aadress: %4⏎ &Label &Märgis - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Aadress @@ -840,12 +479,12 @@ Aadress: %4⏎ Väljaminevate aadresside muutmine - The entered address "%1" is already in the address book. - Selline aadress on juba olemas: "%1" + The entered address "%1" is already in the address book. + Selline aadress on juba olemas: "%1" - The entered address "%1" is not a valid Bitcoin address. - Sisestatud aadress "%1" ei ole Bitcoinis kehtiv. + The entered address "%1" is not a valid Bitcoin address. + Sisestatud aadress "%1" ei ole Bitcoinis kehtiv. Could not unlock wallet. @@ -858,33 +497,9 @@ Aadress: %4⏎ FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core Bitcoini tuumik @@ -893,6 +508,10 @@ Aadress: %4⏎ version versioon + + Command-line options + Käsurea valikud + Usage: Kasutus: @@ -906,110 +525,38 @@ Aadress: %4⏎ UI valikud - Set language, for example "de_DE" (default: system locale) - Keele valik, nt "ee_ET" (vaikeväärtus: system locale) + Set language, for example "de_DE" (default: system locale) + Keele valik, nt "ee_ET" (vaikeväärtus: system locale) Start minimized Käivitu tegumiribale - - Set SSL root certificates for payment request (default: -system-) - - Show splash screen on startup (default: 1) Käivitamisel teabeakna kuvamine (vaikeväärtus: 1) - - Choose data directory on startup (default: 0) - - - + Intro - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - + Bitcoin Core + Bitcoini tuumik Error - + Tõrge - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog Options Valikud - - &Main - %Peamine - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - Pay transaction &fee Tasu tehingu &fee @@ -1022,42 +569,6 @@ Aadress: %4⏎ &Start Bitcoin on system login &Start Bitcoin sisselogimisel - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - Reset all client options to default. Taasta kõik klientprogrammi seadete vaikeväärtused. @@ -1070,30 +581,6 @@ Aadress: %4⏎ &Network &Võrk - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Bitcoini kliendi pordi automaatne avamine ruuteris. Toimib, kui sinu ruuter aktsepteerib UPnP ühendust. @@ -1114,14 +601,6 @@ Aadress: %4⏎ Port of the proxy (e.g. 9050) Proxi port (nt 9050) - - SOCKS &Version: - Turva proxi SOCKS &Version: - - - SOCKS version of the proxy (e.g. 5) - Turva proxi SOCKS versioon (nt 5) - &Window &Aken @@ -1136,7 +615,7 @@ Aadress: %4⏎ Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - Sulgemise asemel minimeeri aken. Selle valiku tegemisel suletakse programm Menüüst "Välju" käsuga. + Sulgemise asemel minimeeri aken. Selle valiku tegemisel suletakse programm Menüüst "Välju" käsuga. M&inimize on close @@ -1162,18 +641,6 @@ Aadress: %4⏎ Choose the default subdivision unit to show in the interface and when sending coins. Vali liideses ning müntide saatmisel kuvatav vaikimisi alajaotus. - - Whether to show Bitcoin addresses in the transaction list or not. - Kuvada Bitcoini aadress tehingute loetelus või mitte. - - - &Display addresses in transaction list - Tehingute loetelu &Display aadress - - - Whether to show coin control features or not. - - &OK &OK @@ -1186,26 +653,10 @@ Aadress: %4⏎ default vaikeväärtus - - none - - Confirm options reset Kinnita valikute algseadistamine - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - The supplied proxy address is invalid. Sisestatud kehtetu proxy aadress. @@ -1225,37 +676,13 @@ Aadress: %4⏎ Wallet Rahakott - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - Immature: Ebaküps: Mined balance that has not yet matured - Mitte aegunud mine'itud jääk - - - Total: - - - - Your current total balance - + Mitte aegunud mine'itud jääk <b>Recent transactions</b> @@ -1272,117 +699,32 @@ Aadress: %4⏎ URI handling URI käsitsemine - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI ei suudeta parsida. Põhjuseks võib olla kehtetu Bitcoini aadress või vigased URI parameetrid. - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - Cannot start bitcoin: click-to-pay handler Bitcoin ei käivitu: vajuta-maksa toiming - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Kogus - Error: Specified data directory "%1" does not exist. - + N/A + N/A - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Sisesta Bitcoini aadress (nt: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - Save QR Code Salvesta QR kood - - PNG Image (*.png) - - - + RPCConsole @@ -1401,14 +743,6 @@ Aadress: %4⏎ &Information &Informatsioon - - Debug window - - - - General - - Using OpenSSL version Kasutan OpenSSL versiooni @@ -1421,10 +755,6 @@ Aadress: %4⏎ Network Võrgustik - - Name - - Number of connections Ühenduste arv @@ -1437,10 +767,6 @@ Aadress: %4⏎ Current number of blocks Plokkide hetkearv - - Estimated total blocks - Ligikaudne plokkide kogus - Last block time Viimane ploki aeg @@ -1453,26 +779,6 @@ Aadress: %4⏎ &Console &Konsool - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - Build date Valmistusaeg @@ -1501,113 +807,17 @@ Aadress: %4⏎ Type <b>help</b> for an overview of available commands. Ülevaateks võimalikest käsklustest trüki <b>help</b>. - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - &Label: &Märgis - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - Copy label Märgise kopeerimine - - Copy message - - Copy amount Kopeeri summa @@ -1615,34 +825,6 @@ Aadress: %4⏎ ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address Aadress @@ -1665,7 +847,7 @@ Aadress: %4⏎ Error encoding URI into QR Code. - Tõrge URI'st QR koodi loomisel + Tõrge URI'st QR koodi loomisel @@ -1690,77 +872,17 @@ Aadress: %4⏎ (no label) (silti pole) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins Müntide saatmine - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - Amount: Summa: - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Saatmine mitmele korraga @@ -1769,10 +891,6 @@ Aadress: %4⏎ Add &Recipient Lisa &Saaja - - Clear all fields of the form. - - Clear &All Puhasta &Kõik @@ -1793,50 +911,10 @@ Aadress: %4⏎ Confirm send coins Müntide saatmise kinnitamine - - %1 to %2 - - - - Copy quantity - - Copy amount Kopeeri summa - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - The recipient address is not valid, please recheck. Saaja aadress ei ole kehtiv, palun kontrolli. @@ -1857,43 +935,11 @@ Aadress: %4⏎ Duplicate address found, can only send to each address once per send operation. Ühe saatmisega topelt-adressaati olla ei tohi. - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (silti pole) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry @@ -1904,10 +950,6 @@ Aadress: %4⏎ Pay &To: Maksa &: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Tehingu saaja aadress (nt: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Aadressiraamatusse sisestamiseks märgista aadress @@ -1916,14 +958,6 @@ Aadress: %4⏎ &Label: &Märgis - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt+A @@ -1936,50 +970,14 @@ Aadress: %4⏎ Alt+P Alt+P - - Remove this entry - - Message: Sõnum: - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog @@ -1994,14 +992,6 @@ Aadress: %4⏎ You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Omandiõigsuse tõestamiseks saad sõnumeid allkirjastada oma aadressiga. Ettevaatust petturitega, kes üritavad saada sinu allkirja endale saada. Allkirjasta ainult korralikult täidetud avaldusi, millega nõustud. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Sõnumi signeerimise aadress (nt: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Choose previously used address - - Alt+A Alt+A @@ -2050,10 +1040,6 @@ Aadress: %4⏎ Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Kinnitamiseks sisesta allkirjastamise aadress, sõnum (kindlasti kopeeri täpselt ka reavahetused, tühikud, tabulaatorid jms) ning allolev signatuur. - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Aadress, millega sõnum allkirjastati (nt: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address Kinnita sõnum tõestamaks selle allkirjastatust määratud Bitcoini aadressiga. @@ -2067,12 +1053,8 @@ Aadress: %4⏎ Tühjenda kõik sõnumi kinnitamise väljad - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Sisesta Bitcoini aadress (nt: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Signatuuri genereerimiseks vajuta "Allkirjasta Sõnum" + Click "Sign Message" to generate signature + Signatuuri genereerimiseks vajuta "Allkirjasta Sõnum" The entered address is invalid. @@ -2129,36 +1111,20 @@ Aadress: %4⏎ Bitcoin Core Bitcoini tuumik - - The Bitcoin Core developers - - [testnet] - + [testnet] TrafficGraphWidget - - KB/s - - - + TransactionDesc Open until %1 Avatud kuni %1 - - conflicted - - - - %1/offline - %/1offline'is - %1/unconfirmed %1/kinnitamata @@ -2173,7 +1139,7 @@ Aadress: %4⏎ , broadcast through %n node(s) - , levita läbi %n node'i, levita läbi %n node'i + , levita läbi %n node'i, levita läbi %n node'i Date @@ -2239,17 +1205,9 @@ Aadress: %4⏎ Transaction ID Tehingu ID - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - Debug information - Debug'imise info + Debug'imise info Transaction @@ -2309,14 +1267,6 @@ Aadress: %4⏎ Address Aadress - - Amount - Kogus - - - Immature (%1 confirmations, will be available after %2) - - Open for %n more block(s) Avaneb %n bloki pärastAvaneb %n bloki pärast @@ -2337,22 +1287,6 @@ Aadress: %4⏎ Generated but not accepted Loodud, kuid aktsepteerimata - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with Saadud koos @@ -2371,7 +1305,7 @@ Aadress: %4⏎ Mined - Mine'itud + Mine'itud (n/a) @@ -2442,7 +1376,7 @@ Aadress: %4⏎ Mined - Mine'itud + Mine'itud Other @@ -2480,26 +1414,6 @@ Aadress: %4⏎ Show transaction details Kuva tehingu detailid - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Komaeraldatud fail (*.csv) @@ -2524,10 +1438,6 @@ Aadress: %4⏎ Address Aadress - - Amount - Kogus - ID ID @@ -2541,29 +1451,24 @@ Aadress: %4⏎ saaja + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel Send Coins - + Müntide saatmine WalletView - - &Export - - Export the data in the current tab to a file - + Ekspordi kuvatava vahelehe sisu faili Backup Wallet @@ -2577,14 +1482,6 @@ Aadress: %4⏎ Backup Failed Varundamine nurjus - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - Backup Successful Varundamine õnnestus @@ -2592,18 +1489,6 @@ Aadress: %4⏎ bitcoin-core - - Usage: - Kasutus: - - - List commands - Käskluste loetelu - - - Get help for a command - Käskluste abiinfo - Options: Valikud: @@ -2630,7 +1515,7 @@ Aadress: %4⏎ Connect to a node to retrieve peer addresses, and disconnect - Peeri aadressi saamiseks ühendu korraks node'iga + Peeri aadressi saamiseks ühendu korraks node'iga Specify your own public address @@ -2644,10 +1529,6 @@ Aadress: %4⏎ Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Mitme sekundi pärast ulakad peerid tagasi võivad tulla (vaikeväärtus: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - RPC pordi %u kuulamiseks seadistamisel ilmnes viga IPv4'l: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Kuula JSON-RPC ühendusel seda porti <port> (vaikeväärtus: 8332 või testnet: 18332) @@ -2656,10 +1537,6 @@ Aadress: %4⏎ Accept command line and JSON-RPC commands Luba käsurea ning JSON-RPC käsklusi - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Tööta taustal ning aktsepteeri käsklusi @@ -2682,7 +1559,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, sul tuleb rpcpassword määrata seadete failis: %s @@ -2693,37 +1570,13 @@ rpcpassword=%s Kasutajanimi ning parool EI TOHI kattuda. Kui faili ei leita, loo see ainult-omaniku-loetavas failiõigustes . Soovitatav on seadistada tõrgete puhul teavitus; -nt: alertnotify=echo %%s | email -s "Bitcoin Alert" admin@foo.com +nt: alertnotify=echo %%s | email -s "Bitcoin Alert" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - RPC pordi %u kuulamiseks seadistamisel ilmnes viga IPv6'l, lülitumine tagasi IPv4'le : %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Määratud aadressiga sidumine ning sellelt kuulamine. IPv6 jaoks kasuta vormingut [host]:port - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Tõrge: Tehingust keelduti! Põhjuseks võib olla juba kulutatud mündid, nt kui wallet.dat fail koopias kulutatid mündid, kuid ei märgitud neid siin vastavalt. @@ -2734,132 +1587,44 @@ nt: alertnotify=echo %%s | email -s "Bitcoin Alert" admin@foo.com Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - Käivita käsklus, kui rahakoti tehing muutub (%s cmd's muudetakse TxID'ks) - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - + Käivita käsklus, kui rahakoti tehing muutub (%s cmd's muudetakse TxID'ks) This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - See on test-versioon - kasutamine omal riisikol - ära kasuta mining'uks ega kaupmeeste programmides - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - + See on test-versioon - kasutamine omal riisikol - ära kasuta mining'uks ega kaupmeeste programmides Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Hoiatus: -paytxfee on seatud väga kõrgeks! See on sinu poolt makstav tehingu lisatasu. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Hoiatus: Palun kontrolli oma arvuti kuupäeva/kellaaega! Kui arvuti kell on vale, siis Bitcoin ei tööta korralikult - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. Hoiatus: ilmnes tõrge wallet.dat faili lugemisel! Võtmed on terved, kuid tehingu andmed või aadressiraamatu kirjed võivad olla kadunud või vigased. Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - Hoiatus: toimus wallet.dat faili andmete päästmine! Originaal wallet.dat nimetati kaustas %s ümber wallet.{ajatempel}.bak'iks, jäägi või tehingute ebakõlade puhul tuleks teha backup'ist taastamine. - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - + Hoiatus: toimus wallet.dat faili andmete päästmine! Originaal wallet.dat nimetati kaustas %s ümber wallet.{ajatempel}.bak'iks, jäägi või tehingute ebakõlade puhul tuleks teha backup'ist taastamine. Attempt to recover private keys from a corrupt wallet.dat Püüa vigasest wallet.dat failist taastada turvavõtmed - - Bitcoin Core Daemon - - Block creation options: Blokeeri loomise valikud: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) - Ühendu ainult määratud node'i(de)ga - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - + Ühendu ainult määratud node'i(de)ga Corrupted block database detected Tuvastati vigane bloki andmebaas - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - Discover own IP address (default: 1 when listening and no -externalip) Leia oma IP aadress (vaikeväärtus: 1, kui kuulatakse ning puudub -externalip) - - Do not load the wallet and disable wallet RPC calls - - Do you want to rebuild the block database now? Kas soovid bloki andmebaasi taastada? @@ -2936,94 +1701,18 @@ nt: alertnotify=echo %%s | email -s "Bitcoin Alert" admin@foo.com Failed to write undo data Tagasivõtmise andmete kirjutamine ebaõnnestus - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - Otsi DNS'i lookup'i kastavaid peere (vaikeväärtus: 1, kui mitte -connect) - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - How many blocks to check at startup (default: 288, 0 = all) Käivitamisel kontrollitavate blokkide arv (vaikeväärtus: 288, 0=kõik) - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - Rebuild block chain index from current blk000??.dat files Taasta bloki jada indeks blk000??.dat failist - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - Set the number of threads to service RPC calls (default: 4) Määra RPC kõnede haldurite arv (vaikeväärtus: 4) - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - Verifying blocks... Kontrollin blokke... @@ -3032,66 +1721,14 @@ nt: alertnotify=echo %%s | email -s "Bitcoin Alert" admin@foo.com Verifying wallet... Kontrollin rahakotti... - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - Imports blocks from external blk000??.dat file Impordi blokid välisest blk000??.dat failist - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information Informatsioon - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - Maintain a full transaction index (default: 0) Säilita kogu tehingu indeks (vaikeväärtus: 0) @@ -3110,43 +1747,7 @@ nt: alertnotify=echo %%s | email -s "Bitcoin Alert" admin@foo.com Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Ühenda ainult node'idega <net> võrgus (IPv4, IPv6 või Tor) - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL valikud: (vaata Bitcoini Wikist või SSL sätete juhendist) - - - Send command to Bitcoin Core - + Ühenda ainult node'idega <net> võrgus (IPv4, IPv6 või Tor) Send trace/debug info to console instead of debug.log file @@ -3156,50 +1757,18 @@ nt: alertnotify=echo %%s | email -s "Bitcoin Alert" admin@foo.com Set minimum block size in bytes (default: 0) Sea minimaalne bloki suurus baitides (vaikeväärtus: 0) - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - Shrink debug.log file on client startup (default: 1 when no -debug) Kahanda programmi käivitamisel debug.log faili (vaikeväärtus: 1, kui ei ole -debug) - - Signing transaction failed - - Specify connection timeout in milliseconds (default: 5000) Sea ühenduse timeout millisekundites (vaikeväärtus: 5000) - - Start Bitcoin Core Daemon - - System error: Süsteemi tõrge: - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - Use UPnP to map the listening port (default: 0) Kasuta kuulatava pordi määramiseks UPnP ühendust (vaikeväärtus: 0) @@ -3220,18 +1789,6 @@ nt: alertnotify=echo %%s | email -s "Bitcoin Alert" admin@foo.com Warning: This version is obsolete, upgrade required! Hoiatus: versioon on aegunud, uuendus on nõutav! - - Zapping all transactions from wallet... - - - - on startup - - - - version - versioon - wallet.dat corrupt, salvage failed wallet.dat fail on katki, päästmine ebaõnnestus @@ -3240,17 +1797,9 @@ nt: alertnotify=echo %%s | email -s "Bitcoin Alert" admin@foo.com Password for JSON-RPC connections JSON-RPC ühenduste salasõna - - Allow JSON-RPC connections from specified IP address - JSON-RPC ühenduste lubamine kindla IP pealt - - - Send commands to node running on <ip> (default: 127.0.0.1) - Saada käsklusi node'ile IP'ga <ip> (vaikeväärtus: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) - Käivita käsklus, kui parim plokk muutub (käskluse %s asendatakse ploki hash'iga) + Käivita käsklus, kui parim plokk muutub (käskluse %s asendatakse ploki hash'iga) Upgrade wallet to latest format @@ -3266,7 +1815,7 @@ nt: alertnotify=echo %%s | email -s "Bitcoin Alert" admin@foo.com Use OpenSSL (https) for JSON-RPC connections - Kasuta JSON-RPC ühenduste jaoks OpenSSL'i (https) + Kasuta JSON-RPC ühenduste jaoks OpenSSL'i (https) Server certificate file (default: server.cert) @@ -3280,13 +1829,9 @@ nt: alertnotify=echo %%s | email -s "Bitcoin Alert" admin@foo.com This help message Käesolev abitekst - - Unable to bind to %s on this computer (bind returned error %d, %s) - Selle arvutiga ei ole võimalik siduda %s külge (katse nurjus %d, %s tõttu) - Allow DNS lookups for -addnode, -seednode and -connect - -addnode, -seednode ja -connect tohivad kasutada DNS lookup'i + -addnode, -seednode ja -connect tohivad kasutada DNS lookup'i Loading addresses... @@ -3296,41 +1841,29 @@ nt: alertnotify=echo %%s | email -s "Bitcoin Alert" admin@foo.com Error loading wallet.dat: Wallet corrupted Viga wallet.dat käivitamisel. Vigane rahakkott - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Viga wallet.dat käivitamisel: Rahakott nõuab Bitcoini uusimat versiooni - - - Wallet needed to be rewritten: restart Bitcoin to complete - Rahakott tuli ümberkirjutada: toimingu lõpetamiseks taaskäivita Bitcoin - Error loading wallet.dat Viga wallet.dat käivitamisel - Invalid -proxy address: '%s' - Vigane -proxi aadress: '%s' + Invalid -proxy address: '%s' + Vigane -proxi aadress: '%s' - Unknown network specified in -onlynet: '%s' - Kirjeldatud tundmatu võrgustik -onlynet'is: '%s' + Unknown network specified in -onlynet: '%s' + Kirjeldatud tundmatu võrgustik -onlynet'is: '%s' - Unknown -socks proxy version requested: %i - Küsitud tundmatu -socks proxi versioon: %i + Cannot resolve -bind address: '%s' + Tundmatu -bind aadress: '%s' - Cannot resolve -bind address: '%s' - Tundmatu -bind aadress: '%s' + Cannot resolve -externalip address: '%s' + Tundmatu -externalip aadress: '%s' - Cannot resolve -externalip address: '%s' - Tundmatu -externalip aadress: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - -paytxfee=<amount> jaoks vigane kogus: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + -paytxfee=<amount> jaoks vigane kogus: '%s' Invalid amount @@ -3376,13 +1909,5 @@ nt: alertnotify=echo %%s | email -s "Bitcoin Alert" admin@foo.com Error Tõrge - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - rpcpassword=<password> peab sätete failis olema seadistatud:⏎ -%s⏎ -Kui seda faili ei ole, loo see ainult-omanikule-lugemiseks faili õigustes. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_eu_ES.ts b/src/qt/locale/bitcoin_eu_ES.ts index 1fce25d6da..f8f03c3d29 100644 --- a/src/qt/locale/bitcoin_eu_ES.ts +++ b/src/qt/locale/bitcoin_eu_ES.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -41,95 +9,19 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address Sortu helbide berria - - &New - - Copy the currently selected address to the system clipboard Kopiatu hautatutako helbidea sistemaren arbelera - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - &Delete &Ezabatu - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - Comma separated file (*.csv) Komaz bereizitako artxiboa (*.csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -147,10 +39,6 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase Sartu pasahitza @@ -163,10 +51,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Errepikatu pasahitz berria - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Sartu zorrorako pasahitz berria.<br/> Mesedez erabili <b>gutxienez ausazko 10 karaktere</b>, edo <b>gutxienez zortzi hitz</b> pasahitza osatzeko. - Encrypt wallet Enkriptatu zorroa @@ -199,30 +83,10 @@ This product includes software developed by the OpenSSL Project for use in the O Confirm wallet encryption Berretsi zorroaren enkriptazioa - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - Wallet encrypted Zorroa enkriptatuta - - Bitcoin 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. - - Wallet encryption failed Zorroaren enkriptazioak huts egin du @@ -247,17 +111,9 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet decryption failed Zorroaren desenkriptazioak huts egin du - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - Synchronizing with network... Sarearekin sinkronizatzen... @@ -266,10 +122,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Overview &Gainbegiratu - - Node - - Show general overview of wallet Ikusi zorroaren begirada orokorra @@ -290,10 +142,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application Irten aplikaziotik - - Show information about Bitcoin - Erakutsi Bitcoin-i buruzko informazioa - About &Qt &Qt-ari buruz @@ -306,102 +154,10 @@ This product includes software developed by the OpenSSL Project for use in the O &Options... &Aukerak... - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - Change the passphrase used for wallet encryption Aldatu zorroa enkriptatzeko erabilitako pasahitza - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - &File &Artxiboa @@ -422,102 +178,6 @@ This product includes software developed by the OpenSSL Project for use in the O [testnet] [testnet] - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - - - %n active connection(s) to Bitcoin network - Konexio aktibo %n Bitcoin-en sarera%n konexio aktibo Bitcoin-en sarera - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - - - Error - - - - Warning - - - - Information - - Up to date Egunean @@ -534,14 +194,6 @@ This product includes software developed by the OpenSSL Project for use in the O Incoming transaction Sarrerako transakzioa - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> Zorroa <b>enkriptatuta</b> eta <b>desblokeatuta</b> dago une honetan @@ -550,68 +202,16 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Zorroa <b>enkriptatuta</b> eta <b>blokeatuta</b> dago une honetan - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - Amount: Kopurua - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount Kopurua @@ -624,18 +224,6 @@ Address: %4 Date Data - - Confirmations - - - - Confirmed - - - - Priority - - Copy address Kopiatu helbidea @@ -644,155 +232,11 @@ Address: %4 Copy label Kopiatu etiketa - - Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (etiketarik ez) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -803,14 +247,6 @@ Address: %4 &Label &Etiketa - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Helbidea @@ -832,12 +268,8 @@ Address: %4 Editatu bidaltzeko helbidea - The entered address "%1" is already in the address book. - Sartu berri den helbidea, "%1", helbide-liburuan dago jadanik. - - - The entered address "%1" is not a valid Bitcoin address. - + The entered address "%1" is already in the address book. + Sartu berri den helbidea, "%1", helbide-liburuan dago jadanik. Could not unlock wallet. @@ -850,791 +282,66 @@ Address: %4 FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - - - version - - - - Usage: - - - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - - - Error - - - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog Options Aukerak - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage Form Inprimakia - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - <b>Recent transactions</b> <b>Azken transakzioak</b> - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - + Amount + Kopurua - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Sartu Bitocin helbide bat (adb.: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - &Label: &Etiketa: - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - Copy label Kopiatu etiketa - - Copy message - - - - Copy amount - - - + ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address Helbidea @@ -1647,19 +354,7 @@ Address: %4 Label Etiketa - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel @@ -1670,10 +365,6 @@ Address: %4 Label Etiketa - - Message - - Amount Kopurua @@ -1682,93 +373,21 @@ Address: %4 (no label) (etiketarik ez) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins Bidali txanponak - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - Amount: Kopurua - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Bidali hainbat jasotzaileri batera - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - Balance: Saldoa: @@ -1777,115 +396,19 @@ Address: %4 Confirm the send action Berretsi bidaltzeko ekintza - - S&end - - Confirm send coins Berretsi txanponak bidaltzea - - %1 to %2 - - - - Copy quantity - - - - Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - The amount to pay must be larger than 0. Ordaintzeko kopurua 0 baino handiagoa izan behar du. - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (etiketarik ez) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry @@ -1896,10 +419,6 @@ Address: %4 Pay &To: Ordaindu &honi: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - Enter a label for this address to add it to your address book Sartu etiketa bat helbide honetarako, eta gehitu zure helbide-liburuan @@ -1908,14 +427,6 @@ Address: %4 &Label: &Etiketa: - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt+A @@ -1928,72 +439,16 @@ Address: %4 Alt+P Alt+P - - Remove this entry - - Message: Mezua - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - Alt+A Alt+A @@ -2006,151 +461,23 @@ Address: %4 Alt+P Alt+P - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Sartu Bitocin helbide bat (adb.: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - [testnet] - + [testnet] TrafficGraphWidget - - KB/s - - - + TransactionDesc Open until %1 Zabalik %1 arte - - conflicted - - - - %1/offline - - %1/unconfirmed %1/konfirmatu gabe @@ -2159,118 +486,18 @@ Address: %4 %1 confirmations %1 konfirmazioak - - Status - - - - , broadcast through %n node(s) - - Date Data - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - Amount Kopurua - - true - - - - false - - , has not been successfully broadcast yet , ez da arrakastaz emititu oraindik - - Open for %n more block(s) - - unknown ezezaguna @@ -2301,18 +528,6 @@ Address: %4 Address Helbidea - - Amount - Kopurua - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - Open until %1 Zabalik %1 arte @@ -2329,33 +544,13 @@ Address: %4 Generated but not accepted Sortua, baina ez onartua - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with - Jasoa honekin: - - - Received from - + Jasota honekin: Sent to - Honi bidalia: + Hona bidalia: Payment to yourself @@ -2456,50 +651,10 @@ Address: %4 Copy label Kopiatu etiketa - - Copy amount - - - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Komaz bereizitako artxiboa (*.csv) - - Confirmed - - Date Data @@ -2516,86 +671,25 @@ Address: %4 Address Helbidea - - Amount - Kopurua - - - ID - - - - Range: - - - - to - - - + + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel Send Coins - + Bidali txanponak WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - Komandoen lista - - - Get help for a command - Laguntza komando batean - Options: Aukerak @@ -2608,740 +702,10 @@ Address: %4 Specify pid file (default: bitcoind.pid) pid fitxategia aukeratu (berezkoa: bitcoind.pid) - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - This help message Laguntza mezu hau - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - - - Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - - - Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - - Rescanning... Birbilatzen... @@ -3350,19 +714,5 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Done loading Zamaketa amaitua - - To use the %s option - - - - Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - - + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_fa.ts b/src/qt/locale/bitcoin_fa.ts index 0dfbafb811..d806fa47ef 100644 --- a/src/qt/locale/bitcoin_fa.ts +++ b/src/qt/locale/bitcoin_fa.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - ⏎ ⏎ این یک نرم‌افزار آزمایشی است⏎ ⏎ نرم افزار تحت مجوز MIT/X11 منتشر شده است. پروندهٔ COPYING یا نشانی http://www.opensource.org/licenses/mit-license.php. را ببینید⏎ ⏎ این محصول شامل نرم‌افزار توسعه داده‌شده در پروژهٔ OpenSSL است. در این نرم‌افزار از OpenSSL Toolkit (http://www.openssl.org/) و نرم‌افزار رمزنگاری نوشته شده توسط اریک یانگ (eay@cryptsoft.com) و UPnP توسط توماس برنارد استفاده شده است. - - - Copyright - حق تألیف - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -41,21 +9,17 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address ایجاد نشانی جدید - - &New - - Copy the currently selected address to the system clipboard کپی نشانی انتخاب شده به حافظهٔ سیستم &Copy - + &رونوشت C&lose - + &بستن &Copy Address @@ -77,34 +41,10 @@ This product includes software developed by the OpenSSL Project for use in the O &Delete &حذف - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. این‌ها نشانی‌های بیت‌کوین شما برای ارسال وجود هستند. همیشه قبل از ارسال سکه‌ها، نشانی دریافت‌کننده و مقدار ارسالی را بررسی کنید. - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - Copy &Label کپی و برچسب‌&گذاری @@ -115,21 +55,13 @@ This product includes software developed by the OpenSSL Project for use in the O Export Address List - + استخراج لیست آدرس Comma separated file (*.csv) پروندهٔ نوع CSV جداشونده با کاما (*.csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -163,10 +95,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase تکرار گذرواژهٔ جدید - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - گذرواژهٔ جدید کیف پول خود را وارد کنید.<br/>لطفاً از گذرواژه‌ای با <b>حداقل ۱۰ حرف تصادفی</b>، یا <b>حداقل هشت کلمه</b> انتخاب کنید. - Encrypt wallet رمزنگاری کیف پول @@ -266,10 +194,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Overview &بررسی اجمالی - - Node - - Show general overview of wallet نمایش بررسی اجمالی کیف پول @@ -290,10 +214,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application خروج از برنامه - - Show information about Bitcoin - نمایش اطلاعات در مورد بیت‌کوین - About &Qt دربارهٔ &کیوت @@ -318,18 +238,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Change Passphrase... &تغییر گذرواژه... - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - Importing blocks from disk... دریافت بلوک‌ها از دیسک... @@ -426,38 +334,6 @@ This product includes software developed by the OpenSSL Project for use in the O Bitcoin Core هسته Bitcoin - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - کلاینت بیت‌کوین - %n active connection(s) to Bitcoin network %n ارتباط فعال با شبکهٔ بیت‌کوین @@ -466,10 +342,6 @@ This product includes software developed by the OpenSSL Project for use in the O No block source available... منبعی برای دریافت بلاک در دسترس نیست... - - Processed %1 of %2 (estimated) blocks of transaction history. - %1 بلاک از مجموع %2 بلاک (تخمینی) تاریخچهٔ تراکنش‌ها پردازش شده است. - Processed %1 blocks of transaction history. %1 بلاک از تاریخچهٔ تراکنش‌ها پردازش شده است. @@ -486,14 +358,6 @@ This product includes software developed by the OpenSSL Project for use in the O %n week(s) %n هفته - - %1 and %2 - - - - %n year(s) - - %1 behind %1 عقب‌تر @@ -554,10 +418,6 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> کیف پول <b>رمزنگاری شده</b> است و هم‌اکنون <b>قفل</b> است - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - یک خطای مهلک اتفاق افتاده است. بیت‌کوین نمی‌تواند بدون مشکل به کار خود ادامه دهد و بسته خواهد شد. - ClientModel @@ -568,54 +428,10 @@ Address: %4 CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - Amount: مبلغ: - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount مبلغ @@ -628,18 +444,10 @@ Address: %4 Date تاریخ - - Confirmations - - Confirmed تأیید شده - - Priority - - Copy address کپی نشانی @@ -656,147 +464,19 @@ Address: %4 Copy transaction ID کپی شناسهٔ تراکنش - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - yes - + بله no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - + خیر (no label) (بدون برچسب) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -807,14 +487,6 @@ Address: %4 &Label &برچسب - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &نشانی @@ -836,11 +508,11 @@ Address: %4 ویرایش نشانی ارسالی - The entered address "%1" is already in the address book. + The entered address "%1" is already in the address book. نشانی وارد شده «%1» در حال حاضر در دفترچه وجود دارد. - The entered address "%1" is not a valid Bitcoin address. + The entered address "%1" is not a valid Bitcoin address. نشانی وارد شده «%1» یک نشانی معتبر بیت‌کوین نیست. @@ -877,10 +549,6 @@ Address: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core هسته Bitcoin @@ -889,6 +557,10 @@ Address: %4 version نسخه + + Command-line options + گزینه‌های خط‌فرمان + Usage: استفاده: @@ -902,17 +574,13 @@ Address: %4 گزینه‌های رابط کاربری - Set language, for example "de_DE" (default: system locale) + Set language, for example "de_DE" (default: system locale) زبان را تنظیم کنید؛ برای مثال «de_DE» (زبان پیش‌فرض محلی) Start minimized اجرای برنامه به صورت کوچک‌شده - - Set SSL root certificates for payment request (default: -system-) - - Show splash screen on startup (default: 1) نمایش پنجرهٔ خوشامدگویی در ابتدای اجرای برنامه (پیش‌فرض: 1) @@ -928,18 +596,6 @@ Address: %4 Welcome خوش‌آمدید - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - Use the default data directory استفاده از مسیر پیش‌فرض @@ -949,12 +605,8 @@ Address: %4 استفاده از یک مسیر سفارشی: - Bitcoin - بیت‌کوین - - - Error: Specified data directory "%1" can not be created. - خطا: نمی‌توان پوشه‌ای برای داده‌ها در «%1» ایجاد کرد. + Bitcoin Core + هسته Bitcoin Error @@ -971,27 +623,7 @@ Address: %4 OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog @@ -1018,42 +650,6 @@ Address: %4 &Start Bitcoin on system login &اجرای بیت‌کوین با ورود به سیستم - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - Reset all client options to default. بازنشانی تمام تنظیمات به پیش‌فرض. @@ -1066,29 +662,9 @@ Address: %4 &Network &شبکه - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - + استخراج Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. @@ -1110,14 +686,6 @@ Address: %4 Port of the proxy (e.g. 9050) درگاه پراکسی (مثال 9050) - - SOCKS &Version: - &نسخهٔ SOCKS: - - - SOCKS version of the proxy (e.g. 5) - نسخهٔ پراکسی SOCKS (مثلاً 5) - &Window &پنجره @@ -1158,18 +726,6 @@ Address: %4 Choose the default subdivision unit to show in the interface and when sending coins. انتخاب واحد پول مورد استفاده برای نمایش در پنجره‌ها و برای ارسال سکه. - - Whether to show Bitcoin addresses in the transaction list or not. - نمایش یا عدم نمایش نشانی‌های بیت‌کوین در لیست تراکنش‌ها. - - - &Display addresses in transaction list - نمایش ن&شانی‌ها در فهرست تراکنش‌ها - - - Whether to show coin control features or not. - - &OK &تأیید @@ -1182,25 +738,13 @@ Address: %4 default پیش‌فرض - - none - - Confirm options reset تأییدِ بازنشانی گزینه‌ها - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - This change would require a client restart. - + برای این تغییرات بازنشانی مشتری ضروری است The supplied proxy address is invalid. @@ -1223,16 +767,12 @@ Address: %4 Available: - + در دسترس: Your current spendable balance تراز علی‌الحساب شما - - Pending: - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance مجموع تراکنش‌هایی که هنوز تأیید نشده‌اند؛ و هنوز روی تراز علی‌الحساب اعمال نشده‌اند @@ -1268,117 +808,32 @@ Address: %4 URI handling مدیریت URI - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - نشانی اینترنتی قابل تجزیه و تحلیل نیست! دلیل این وضعیت ممکن است یک نشانی نامعتبر بیت‌کوین و یا پارامترهای ناهنجار در URI بوده باشد. - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - Cannot start bitcoin: click-to-pay handler نمی‌توان بیت‌کوین را اجرا کرد: کنترل‌کنندهٔ کلیک-و-پرداخت - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - بیت‌کوین + Amount + مبلغ - Error: Specified data directory "%1" does not exist. - خطا: پوشهٔ مشخص شده برای داده‌ها در «%1» وجود ندارد. + N/A + ناموجود - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - یک آدرس بیت‌کوین وارد کنید (مثلاً 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - Save QR Code ذخیرهٔ کد QR - - PNG Image (*.png) - - - + RPCConsole @@ -1397,14 +852,6 @@ Address: %4 &Information &اطلاعات - - Debug window - - - - General - - Using OpenSSL version نسخهٔ OpenSSL استفاده شده @@ -1433,10 +880,6 @@ Address: %4 Current number of blocks تعداد فعلی بلوک‌ها - - Estimated total blocks - تعداد تخمینی بلوک‌ها - Last block time زمان آخرین بلوک @@ -1449,25 +892,9 @@ Address: %4 &Console &کنسول - - &Network Traffic - - - - &Clear - - Totals - - - - In: - - - - Out: - + جمع کل: Build date @@ -1497,113 +924,17 @@ Address: %4 Type <b>help</b> for an overview of available commands. برای نمایش یک مرور کلی از دستورات ممکن، عبارت <b>help</b> را بنویسید. - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - &Label: &برچسب: - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - Copy label کپی برچسب - - Copy message - - Copy amount کپی مقدار @@ -1615,30 +946,6 @@ Address: %4 QR Code کد QR - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address نشانی @@ -1686,77 +993,17 @@ Address: %4 (no label) (بدون برچسب) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins ارسال سکه - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - Amount: مبلغ: - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once ارسال به چند دریافت‌کنندهٔ به‌طور همزمان @@ -1765,10 +1012,6 @@ Address: %4 Add &Recipient &دریافت‌کنندهٔ جدید - - Clear all fields of the form. - - Clear &All پاکسازی &همه @@ -1789,49 +1032,13 @@ Address: %4 Confirm send coins ارسال سکه را تأیید کنید - - %1 to %2 - - - - Copy quantity - - Copy amount کپی مقدار - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - or - + یا The recipient address is not valid, please recheck. @@ -1853,43 +1060,11 @@ Address: %4 Duplicate address found, can only send to each address once per send operation. یک نشانی تکراری پیدا شد. در هر عملیات ارسال، به هر نشانی فقط مبلغ می‌توان ارسال کرد. - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (بدون برچسب) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry @@ -1900,10 +1075,6 @@ Address: %4 Pay &To: پرداخ&ت به: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - نشانی مقصد برای پرداخت (مثلاً 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book برای این نشانی یک برچسب وارد کنید تا در دفترچهٔ آدرس ذخیره شود @@ -1912,14 +1083,6 @@ Address: %4 &Label: &برچسب: - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt+A @@ -1932,50 +1095,14 @@ Address: %4 Alt+P Alt+P - - Remove this entry - - Message: پیام: - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog @@ -1990,14 +1117,6 @@ Address: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. برای احراز اینکه پیام‌ها از جانب شما هستند، می‌توانید آن‌ها را با نشانی خودتان امضا کنید. مراقب باشید چیزی که بدان اطمینان ندارید را امضا نکنید زیرا حملات فیشینگ ممکن است بخواهند از.پیامی با امضای شما سوءاستفاده کنند. تنها مواردی را که حاوی اطلاعات دقیق و قابل قبول برای شما هستند امضا کنید. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - نشانی مورد استفاده برای امضا کردن پیام (برای مثال 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Choose previously used address - - Alt+A Alt+A @@ -2046,10 +1165,6 @@ Address: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. برای شناسایی پیام، نشانیِ امضا کننده و متن پیام را وارد کنید. (مطمئن شوید که فاصله‌ها، تب‌ها و خطوط را عیناً کپی می‌کنید.) مراقب باشید در امضا چیزی بیشتر از آنچه در پیام می‌بینید وجود نداشته باشد تا فریب دزدان اینترنتی و حملات از نوع MITM را نخورید. - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - نشانی مورد استفاده برای امضا کردن پیام (برای مثال 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address برای حصول اطمینان از اینکه پیام با نشانی بیت‌کوین مشخص شده امضا است یا خیر، پیام را شناسایی کنید @@ -2063,11 +1178,7 @@ Address: %4 بازنشانی تمام فیلدهای پیام - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - یک نشانی بیت‌کوین وارد کنید (مثلاً 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature + Click "Sign Message" to generate signature برای ایجاد یک امضای جدید روی «امضای پیام» کلیک کنید @@ -2125,10 +1236,6 @@ Address: %4 Bitcoin Core هسته Bitcoin - - The Bitcoin Core developers - - [testnet] آزمایش شبکه @@ -2136,21 +1243,13 @@ Address: %4 TrafficGraphWidget - - KB/s - - - + TransactionDesc Open until %1 باز تا %1 - - conflicted - - %1/offline %1/آفلاین @@ -2235,14 +1334,6 @@ Address: %4 Transaction ID شناسهٔ تراکنش - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - Debug information اطلاعات اشکال‌زدایی @@ -2305,14 +1396,6 @@ Address: %4 Address نشانی - - Amount - مبلغ - - - Immature (%1 confirmations, will be available after %2) - - Open for %n more block(s) باز برای %n بلوک دیگر @@ -2333,22 +1416,6 @@ Address: %4 Generated but not accepted تولید شده ولی قبول نشده - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with دریافت‌شده با @@ -2476,26 +1543,6 @@ Address: %4 Show transaction details نمایش جزئیات تراکنش - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) پروندهٔ نوع CSV جداشونده با کاما (*.csv) @@ -2520,10 +1567,6 @@ Address: %4 Address نشانی - - Amount - مبلغ - ID شناسه @@ -2537,13 +1580,12 @@ Address: %4 به + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2573,14 +1615,6 @@ Address: %4 Backup Failed خطا در پشتیبان‌گیری - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - Backup Successful پشتیبان‌گیری موفق @@ -2588,18 +1622,6 @@ Address: %4 bitcoin-core - - Usage: - استفاده: - - - List commands - نمایش لیست فرمان‌ها - - - Get help for a command - راهنمایی در مورد یک دستور - Options: گزینه‌ها: @@ -2640,10 +1662,6 @@ Address: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) مدت زمان جلوگیری از اتصال مجدد همتایان بدرفتار، به ثانیه (پیش‌فرض: ۸۴۶۰۰) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - هنگام تنظیم پورت RPC %u برای گوش دادن روی IPv4 خطایی رخ داده است: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) پورت مورد شنود برای اتصالات JSON-RPC (پیش‌فرض: 8332 برای شبکهٔ تست 18332) @@ -2652,10 +1670,6 @@ Address: %4 Accept command line and JSON-RPC commands پذیرش دستورات خط فرمان و دستورات JSON-RPC - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands اجرا در پشت زمینه به‌صورت یک سرویس و پذیرش دستورات @@ -2668,48 +1682,10 @@ Address: %4 Accept connections from outside (default: 1 if no -proxy or -connect) پذیرش اتصالات از بیرون (پیش فرض:1 بدون پراکسی یا اتصال) - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 مقید به نشانی داده شده باشید و همیشه از آن پیروی کنید. از نشانه گذاری استاندار IPv6 به صورت Host]:Port] استفاده کنید. - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. تراکنش پذیرفته نیست! این خطا ممکن است در حالتی رخ داده باشد که مقداری از سکه های شما در کیف پولتان از جایی دیگر، همانند یک کپی از کیف پول اصلی اتان، خرج شده باشد اما در کیف پول اصلی اتان به عنوان مبلغ خرج شده، نشانه گذاری نشده باشد. @@ -2722,130 +1698,30 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) هنگامی که یک تراکنش در کیف پولی رخ می دهد، دستور را اجرا کن(%s در دستورات بوسیله ی TxID جایگزین می شود) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications این یک نسخه ی آزمایشی است - با مسئولیت خودتان از آن استفاده کنید - آن را در معدن و بازرگانی بکار نگیرید. - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. هشدار: مبلغ paytxfee بسیار بالایی تنظیم شده است! این مبلغ هزینه‌ای است که شما برای تراکنش‌ها پرداخت می‌کنید. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - هشدار: لطفا زمان و تاریخ رایانه خود را تصحیح نمایید! اگر ساعت رایانه شما اشتباه باشد bitcoin ممکن است صحیح کار نکند - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - Block creation options: بستن گزینه ایجاد - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) تنها در گره (های) مشخص شده متصل شوید - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - Corrupted block database detected یک پایگاه داده ی بلوک خراب یافت شد - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - Discover own IP address (default: 1 when listening and no -externalip) آدرس آی.پی. خود را شناسایی کنید (پیش فرض:1 در زمان when listening وno -externalip) - - Do not load the wallet and disable wallet RPC calls - - Do you want to rebuild the block database now? آیا مایلید که اکنون پایگاه داده ی بلوک را بازسازی کنید؟ @@ -2854,10 +1730,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error initializing block database خطا در آماده سازی پایگاه داده ی بلوک - - Error initializing wallet database environment %s! - - Error loading block database خطا در بارگذاری پایگاه داده ها @@ -2866,14 +1738,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error opening block database خطا در بازگشایی پایگاه داده ی بلوک - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - Error: system error: خطا: خطای سامانه: @@ -2922,94 +1786,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write undo data عملیات بازگشت دادن اطلاعات با شکست مواجه شدن - - Fee per kB to add to transactions you send - نرخ هر کیلوبایت برای اضافه کردن به تراکنش‌هایی که می‌فرستید - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - قرینه ها را برای جستجوی DNS بیاب (پیش فرض: 1 مگر در زمان اتصال) - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - How many blocks to check at startup (default: 288, 0 = all) چند بلوک نیاز است که در ابتدای راه اندازی بررسی شوند(پیش فرض:288 ،0=همه) - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - Verifying blocks... در حال بازبینی بلوک ها... @@ -3018,70 +1798,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Verifying wallet... در حال بازبینی کیف پول... - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information اطلاعات - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) حداکثر بافر دریافت شده بر اساس اتصال <n>* 1000 بایت (پیش فرض:5000) @@ -3090,50 +1810,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) حداکثر بافر دریافت شده بر اساس اتصال <n>* 1000 بایت (پیش فرض:1000) - - Only accept block chain matching built-in checkpoints (default: 1) - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) تنها =به گره ها در شبکه متصا شوید <net> (IPv4, IPv6 or Tor) - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - گزینه ssl (به ویکیbitcoin برای راهنمای راه اندازی ssl مراجعه شود) - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file اطلاعات ردگیری/اشکال‌زدایی را به جای فایل لاگ اشکال‌زدایی به کنسول بفرستید @@ -3142,50 +1822,18 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Set minimum block size in bytes (default: 0) حداقل سایز بلاک بر اساس بایت تنظیم شود (پیش فرض: 0) - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - Shrink debug.log file on client startup (default: 1 when no -debug) فایل debug.log را در startup مشتری کوچک کن (پیش فرض:1 اگر اشکال زدایی روی نداد) - - Signing transaction failed - - Specify connection timeout in milliseconds (default: 5000) (میلی ثانیه )فاصله ارتباط خاص - - Start Bitcoin Core Daemon - - System error: خطای سامانه - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - Use UPnP to map the listening port (default: 0) از UPnP برای شناسایی درگاه شنیداری استفاده کنید (پیش فرض:0) @@ -3206,34 +1854,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: This version is obsolete, upgrade required! هشدار: این نسخه قدیمی است، روزآمدسازی مورد نیاز است - - Zapping all transactions from wallet... - - - - on startup - - - - version - نسخه - - - wallet.dat corrupt, salvage failed - - Password for JSON-RPC connections JSON-RPC عبارت عبور برای ارتباطات - - Allow JSON-RPC connections from specified IP address - از آدرس آی پی خاص JSON-RPC قبول ارتباطات - - - Send commands to node running on <ip> (default: 127.0.0.1) - (127.0.0.1پیش فرض: ) &lt;ip&gt; دادن فرمانها برای استفاده گره ها روی - Execute command when the best block changes (%s in cmd is replaced by block hash) زمانی که بهترین بلاک تغییر کرد، دستور را اجرا کن (%s در cmd با block hash جایگزین شده است) @@ -3266,10 +1890,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message پیام کمکی - - Unable to bind to %s on this computer (bind returned error %d, %s) - امکان اتصال به %s از این رایانه وجود ندارد ( bind returned error %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect به DNS اجازه بده تا برای addnode ، seednode و اتصال جستجو کند @@ -3282,40 +1902,28 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted خطا در بارگیری wallet.dat: کیف پول خراب شده است - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - خطا در بارگیری wallet.dat: کیف پول به ویرایش جدیدتری از Biticon نیاز دارد - - - Wallet needed to be rewritten: restart Bitcoin to complete - سلام - Error loading wallet.dat خطا در بارگیری wallet.dat - Invalid -proxy address: '%s' + Invalid -proxy address: '%s' آدرس پراکسی اشتباه %s - Unknown network specified in -onlynet: '%s' - شبکه مشخص شده غیرقابل شناسایی در onlynet: '%s' + Unknown network specified in -onlynet: '%s' + شبکه مشخص شده غیرقابل شناسایی در onlynet: '%s' - Unknown -socks proxy version requested: %i - نسخه پراکسی ساکس غیرقابل شناسایی درخواست شده است: %i - - - Cannot resolve -bind address: '%s' + Cannot resolve -bind address: '%s' آدرس قابل اتصال- شناسایی نیست %s - Cannot resolve -externalip address: '%s' + Cannot resolve -externalip address: '%s' آدرس خارجی قابل اتصال- شناسایی نیست %s - Invalid amount for -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' میزان وجه اشتباه برای paytxfee=<میزان وجه>: %s @@ -3362,12 +1970,5 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error خطا - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - %s، شما باید یک rpcpassword را در فایل پیکربندی تنظیم کنید :⏎%s⏎ اگر فایل ایجاد نشد، یک فایل فقط متنی ایجاد کنید. - - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_fa_IR.ts b/src/qt/locale/bitcoin_fa_IR.ts index 3b82ffa5e5..92e0722767 100644 --- a/src/qt/locale/bitcoin_fa_IR.ts +++ b/src/qt/locale/bitcoin_fa_IR.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -41,70 +9,22 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address گشایش حسابی جدید - - &New - - Copy the currently selected address to the system clipboard کپی کردن حساب انتخاب شده به حافظه سیستم - کلیپ بورد - - &Copy - - - - C&lose - - &Copy Address و کپی آدرس - - Delete the currently selected address from the list - - Export the data in the current tab to a file صدور داده نوار جاری به یک فایل - - &Export - - &Delete و حذف - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - Copy &Label کپی و برچسب @@ -113,23 +33,11 @@ This product includes software developed by the OpenSSL Project for use in the O &Edit و ویرایش - - Export Address List - - Comma separated file (*.csv) - سی.اس.وی. (فایل جداگانه دستوری) + Comma separated file (*.csv) فایل جداگانه دستوری - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -147,10 +55,6 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase رمز/پَس فرِیز را وارد کنید @@ -163,10 +67,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase رمز/پَس فرِیز را دوباره وارد کنید - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - رمز/پَس فرِیز جدید را در wallet وارد کنید. برای انتخاب رمز/پَس فرِیز از 10 کاراکتر تصادفی یا بیشتر و یا هشت کلمه یا بیشتر استفاده کنید. - Encrypt wallet wallet را رمزگذاری کنید @@ -199,22 +99,6 @@ This product includes software developed by the OpenSSL Project for use in the O Confirm wallet encryption رمزگذاری wallet را تایید کنید - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - Wallet encrypted تایید رمزگذاری @@ -247,11 +131,7 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet decryption failed کشف رمز wallet انجام نشد - - Wallet passphrase was successfully changed. - - - + BitcoinGUI @@ -266,10 +146,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Overview و بازبینی - - Node - - Show general overview of wallet نمای کلی از wallet را نشان بده @@ -288,11 +164,7 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application - از "درخواست نامه"/ application خارج شو - - - Show information about Bitcoin - اطلاعات در مورد Bitcoin را نشان بده + از "درخواست نامه"/ application خارج شو About &Qt @@ -318,30 +190,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Change Passphrase... تغییر رمز/پَس فرِیز - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - Modify configuration options for Bitcoin اصلاح انتخابها برای پیکربندی Bitcoin @@ -354,18 +202,6 @@ This product includes software developed by the OpenSSL Project for use in the O Change the passphrase used for wallet encryption رمز مربوط به رمزگذاریِ wallet را تغییر دهید - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - Bitcoin bitcoin @@ -376,32 +212,12 @@ This product includes software developed by the OpenSSL Project for use in the O &Send - - - - &Receive - + و ارسال &Show / Hide &نمایش/ عدم نمایش و - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - &File و فایل @@ -422,103 +238,10 @@ This product includes software developed by the OpenSSL Project for use in the O [testnet] [testnet] - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - مشتری bitcoin - - - %n active connection(s) to Bitcoin network - %n ارتباط فعال به شبکه Bitcoin -%n ارتباط فعال به شبکه Bitcoin - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - Error خطا - - Warning - - - - Information - - Up to date روزآمد @@ -552,10 +275,6 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> wallet رمزگذاری شد و در حال حاضر قفل است - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - ClientModel @@ -566,54 +285,10 @@ Address: %4 CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - Amount: میزان وجه: - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount میزان @@ -626,18 +301,10 @@ Address: %4 Date تاریخ - - Confirmations - - Confirmed تایید شده - - Priority - - Copy address آدرس را کپی کنید @@ -650,151 +317,11 @@ Address: %4 Copy amount میزان وجه کپی شود - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (برچسب ندارد) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -805,14 +332,6 @@ Address: %4 &Label و برچسب - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address حساب& @@ -835,12 +354,8 @@ Address: %4 ویرایش حساب ارسال کننده - The entered address "%1" is already in the address book. - حساب وارد شده «1%» از پیش در دفترچه حساب ها موجود است. - - - The entered address "%1" is not a valid Bitcoin address. - آدرس وارد شده "%1" یک آدرس صحیح برای bitcoin نسشت + The entered address "%1" is not a valid Bitcoin address. + آدرس وارد شده "%1" یک آدرس صحیح برای bitcoin نسشت Could not unlock wallet. @@ -853,37 +368,9 @@ Address: %4 FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - version نسخه @@ -892,283 +379,23 @@ Address: %4 Usage: میزان استفاده: - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - bitcoin - - - Error: Specified data directory "%1" can not be created. - - Error خطا - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog Options انتخاب/آپشن - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - و نمایش آدرسها در فهرست تراکنش - - - Whether to show coin control features or not. - - &OK و تایید @@ -1181,31 +408,7 @@ Address: %4 default پیش فرض - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage @@ -1220,38 +423,6 @@ Address: %4 Wallet کیف پول - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - <b>Recent transactions</b> تراکنشهای اخیر @@ -1263,163 +434,34 @@ Address: %4 PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - bitcoin + Amount + میزان - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - یک آدرس bitcoin وارد کنید (مثال 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole Client name نام کنسول RPC - - N/A - - Client version ویرایش کنسول RPC - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - Network شبکه - - Name - - Number of connections تعداد اتصال @@ -1432,177 +474,21 @@ Address: %4 Current number of blocks تعداد زنجیره های حاضر - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - Welcome to the Bitcoin RPC console. به کنسول آر.پی.سی. BITCOIN خوش آمدید - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - &Label: و برچسب - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - Copy label برچسب را کپی کنید - - Copy message - - Copy amount میزان وجه کپی شود @@ -1610,34 +496,6 @@ Address: %4 ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address حساب @@ -1685,93 +543,21 @@ Address: %4 (no label) (برچسب ندارد) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins سکه های ارسالی - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - Amount: میزان وجه: - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once ارسال همزمان به گیرنده های متعدد - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - Balance: مانده حساب: @@ -1788,54 +574,10 @@ Address: %4 Confirm send coins تایید ارسال بیت کوین ها - - %1 to %2 - - - - Copy quantity - - Copy amount میزان وجه کپی شود - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - The amount to pay must be larger than 0. میزان پرداخت باید بیشتر از 0 باشد @@ -1844,51 +586,11 @@ Address: %4 The amount exceeds your balance. مقدار مورد نظر از مانده حساب بیشتر است. - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (برچسب ندارد) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry @@ -1899,10 +601,6 @@ Address: %4 Pay &To: پرداخت و به چه کسی - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - Enter a label for this address to add it to your address book یک برچسب برای این آدرس بنویسید تا به دفترچه آدرسهای شما اضافه شود @@ -1911,14 +609,6 @@ Address: %4 &Label: و برچسب - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt و A @@ -1931,72 +621,20 @@ Address: %4 Alt+P Alt و P - - Remove this entry - - Message: پیام: - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - &Sign Message و امضای پیام - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - یک آدرس bitcoin وارد کنید (مثال 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Choose previously used address - - Alt+A Alt و A @@ -2009,125 +647,9 @@ Address: %4 Alt+P Alt و P - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - یک آدرس bitcoin وارد کنید (مثال 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - یک آدرس bitcoin وارد کنید (مثال 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - [testnet] [testnet] @@ -2135,25 +657,13 @@ Address: %4 TrafficGraphWidget - - KB/s - - - + TransactionDesc Open until %1 باز کن تا %1 - - conflicted - - - - %1/offline - - %1/unconfirmed %1 / تایید نشده @@ -2162,118 +672,30 @@ Address: %4 %1 confirmations %1 تایید - - Status - - - - , broadcast through %n node(s) - - Date تاریخ - - Source - - - - Generated - - - - From - - - - To - - - - own address - - label برچسب - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - Message پیام - - Comment - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - + شناسه کاربری Amount میزان - - true - - - - false - - , has not been successfully broadcast yet ، هنوز با موفقیت ارسال نگردیده است - - Open for %n more block(s) - - unknown ناشناس @@ -2302,19 +724,7 @@ Address: %4 Address - آدرس - - - Amount - میزان وجه - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - + حساب Open until %1 @@ -2332,25 +742,9 @@ Address: %4 Generated but not accepted تولید شده اما قبول نشده است - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with - قبول با + دریافت با Received from @@ -2463,38 +857,10 @@ Address: %4 Copy amount میزان وجه کپی شود - - Copy transaction ID - - Edit label برچسب را ویرایش کنید - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Comma separated file (*.csv) فایل جداگانه دستوری @@ -2509,7 +875,7 @@ Address: %4 Type - نوع + گونه Label @@ -2517,11 +883,7 @@ Address: %4 Address - آدرس - - - Amount - میزان + حساب ID @@ -2536,13 +898,12 @@ Address: %4 به + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2552,53 +913,26 @@ Address: %4 WalletView - - &Export - - Export the data in the current tab to a file صدور داده نوار جاری به یک فایل Backup Wallet - + گرفتن نسخه پیشتیبان از Wallet Wallet Data (*.dat) - + داده های Wallet +(*.dat) Backup Failed - + عملیات گرفتن نسخه پیشتیبان انجام نشد - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - میزان استفاده: - - - List commands - فهرست دستورها - - - Get help for a command - درخواست کمک برای یک دستور - Options: انتخابها: @@ -2623,14 +957,6 @@ Address: %4 Maintain at most <n> connections to peers (default: 125) نگهداری <N> ارتباطات برای قرینه سازی (پیش فرض:125) - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - Threshold for disconnecting misbehaving peers (default: 100) آستانه قطع برای قرینه سازی اشتباه (پیش فرض:100) @@ -2639,10 +965,6 @@ Address: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) تعداد ثانیه ها برای اتصال دوباره قرینه های اشتباه (پیش فرض:86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) ارتباطاتِ JSON-RPC را در <port> گوش کنید (پیش فرض:8332) @@ -2651,10 +973,6 @@ Address: %4 Accept command line and JSON-RPC commands command line و JSON-RPC commands را قبول کنید - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands به عنوان daemon بک گراند را اجرا کنید و دستورات را قبول نمایید @@ -2663,576 +981,22 @@ Address: %4 Use the test network از تستِ شبکه استفاده نمایید - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file ارسال اطلاعات پیگیری/خطایابی به کنسول به جای ارسال به فایل debug.log - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - Specify connection timeout in milliseconds (default: 5000) تعیین مدت زمان وقفه (time out) به هزارم ثانیه - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - Username for JSON-RPC connections شناسه کاربری برای ارتباطاتِ JSON-RPC - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - نسخه - - - wallet.dat corrupt, salvage failed - - Password for JSON-RPC connections رمز برای ارتباطاتِ JSON-RPC - - Allow JSON-RPC connections from specified IP address - ارتباطاتِ JSON-RPC را از آدرس آی.پی. مشخصی برقرار کنید. - - - Send commands to node running on <ip> (default: 127.0.0.1) - دستورات را به گره اجرا شده در<ip> ارسال کنید (پیش فرض:127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) دستور را وقتی بهترین بلاک تغییر کرد اجرا کن (%s در دستور توسط block hash جایگزین شده است) @@ -3265,14 +1029,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message این پیام راهنما - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - Loading addresses... لود شدن آدرسها.. @@ -3281,41 +1037,13 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted خطا در هنگام لود شدن wallet.dat: Wallet corrupted - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - خطا در هنگام لود شدن wallet.dat. به نسخه جدید Bitocin برای wallet نیاز است. - - - Wallet needed to be rewritten: restart Bitcoin to complete - wallet نیاز به بازنویسی دارد. Bitcoin را برای تکمیل عملیات دوباره اجرا کنید. - Error loading wallet.dat خطا در هنگام لود شدن wallet.dat - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - میزان اشتباه است for -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + میزان اشتباه است for -paytxfee=<amount>: '%s' Invalid amount @@ -3361,12 +1089,5 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error خطا - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - شما باید یک رمز rpcpassword=<password> را در فایل تنظیمات ایجاد کنید⏎ %s ⏎ اگر فایل ایجاد نشده است، آن را با یک فایل "فقط متنی" ایجاد کنید. - - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_fi.ts b/src/qt/locale/bitcoin_fi.ts index dc72359590..3541c58fcf 100644 --- a/src/qt/locale/bitcoin_fi.ts +++ b/src/qt/locale/bitcoin_fi.ts @@ -1,42 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - Tietoja Bitcoin Core - - - <b>Bitcoin Core</b> version - <b>Bitcoin Core</b> versio - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Tämä on kokeellinen ohjelmisto. - -Levitetään MIT/X11 ohjelmistolisenssin alaisuudessa. Tarkemmat tiedot löytyvät tiedostosta COPYING tai osoitteesta http://www.opensource.org/licenses/mit-license.php. - -Tämä ohjelma sisältää OpenSSL projektin OpenSSL työkalupakin (http://www.openssl.org/), Eric Youngin (eay@cryptsoft.com) kehittämän salausohjelmiston sekä Thomas Bernardin UPnP ohjelmiston. - - - - Copyright - Tekijänoikeus - - - The Bitcoin Core developers - Bitcoin Core kehittäjät - - - (%1-bit) - (%1-bit) - - + AddressBookPage @@ -132,8 +94,8 @@ Tämä ohjelma sisältää OpenSSL projektin OpenSSL työkalupakin (http://www.o Vienti epäonnistui - There was an error trying to save the address list to %1. - Osoitelistan tallennuksessa tapahtui virhe tiedostoon %1. + There was an error trying to save the address list to %1. Please try again. + Virhe tallentaessa osoitelistaa %1. Yritä uudelleen. @@ -169,10 +131,6 @@ Tämä ohjelma sisältää OpenSSL projektin OpenSSL työkalupakin (http://www.o Repeat new passphrase Kirjoita uusi tunnuslause uudelleen - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Anna lompakolle uusi tunnuslause.<br/>Käytä tunnuslausetta, jossa on ainakin <b>10 satunnaista mekkiä</b> tai <b>kahdeksan sanaa</b>. - Encrypt wallet Salaa lompakko @@ -225,6 +183,10 @@ Tämä ohjelma sisältää OpenSSL projektin OpenSSL työkalupakin (http://www.o Wallet encrypted Lompakko salattu + + 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>. + Anna salauslause lompakkoon. <br/>Ole hyvä ja käytä lausetta jossa on <b>kymmenen tai enemmän satunnaista merkkiä</b> tai <b>kahdeksan tai useampi sanaa</b>. + Bitcoin 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. Bitcoin sulkeutuu lopettaakseen salausprosessin. Muista, että salattukaan lompakko ei täysin suojaa sitä haittaohjelmien aiheuttamilta varkauksilta. @@ -296,10 +258,6 @@ Tämä ohjelma sisältää OpenSSL projektin OpenSSL työkalupakin (http://www.o Quit application Sulje ohjelma - - Show information about Bitcoin - Näytä tietoa Bitcoin-projektista - About &Qt Tietoja &Qt @@ -336,6 +294,10 @@ Tämä ohjelma sisältää OpenSSL projektin OpenSSL työkalupakin (http://www.o Open &URI... Avaa &URI... + + Bitcoin Core client + Bitcoin Core ohjelma + Importing blocks from disk... Tuodaan lohkoja levyltä @@ -388,6 +350,10 @@ Tämä ohjelma sisältää OpenSSL projektin OpenSSL työkalupakin (http://www.o &Receive &Vastaanota + + Show information about Bitcoin Core + Näytä tietoja Bitcoin Core:sta + &Show / Hide &Näytä / Piilota @@ -460,10 +426,6 @@ Tämä ohjelma sisältää OpenSSL projektin OpenSSL työkalupakin (http://www.o Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options Näytä Bitcoin Core ohjeet saadaksesi listan mahdollisista Bitcoinin komentorivivalinnoista - - Bitcoin client - Bitcoin-asiakas - %n active connection(s) to Bitcoin network %n aktiivinen yhteys Bitcoin-verkkoon%n aktiivista yhteyttä Bitcoin-verkkoon @@ -472,10 +434,6 @@ Tämä ohjelma sisältää OpenSSL projektin OpenSSL työkalupakin (http://www.o No block source available... Lohkojen lähdettä ei saatavilla... - - Processed %1 of %2 (estimated) blocks of transaction history. - Käsitelty %1 of %2 (arviolta) rahansiirtohistorian lohkoa. - Processed %1 blocks of transaction history. Käsitelty %1 lohkoa rahansiirtohistoriasta @@ -559,10 +517,6 @@ Osoite: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Lompakko on <b>salattu</b> ja tällä hetkellä <b>lukittuna</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Peruuttamaton virhe on tapahtunut. Bitcoin ei voi enää jatkaa turvallisesti ja sammutetaan. - ClientModel @@ -598,8 +552,8 @@ Osoite: %4 Palkkio: - Low Output: - Pieni Tuotos + Dust: + Tomu: After Fee: @@ -690,8 +644,8 @@ Osoite: %4 Kopioi prioriteetti - Copy low output - Kopioi pieni tuotos + Copy dust + Kopioi tomu Copy change @@ -742,8 +696,8 @@ Osoite: %4 ei mitään - Dust - Tomu + Can vary +/- %1 satoshi(s) per input. + Saattaa vaihdella +/- %1 satoshia per syöte. yes @@ -770,25 +724,13 @@ Osoite: %4 Rahansiirrot korkeammalla prioriteetilla sisällytetään varmemmin lohkoon. - This label turns red, if the priority is smaller than "medium". - Tämä nimi muuttuu punaiseksi jos prioriteetti on pienempi kuin "keskisuuri". + This label turns red, if the priority is smaller than "medium". + Tämä nimi muuttuu punaiseksi jos prioriteetti on pienempi kuin "keskisuuri". This label turns red, if any recipient receives an amount smaller than %1. Tämä nimi muuttuu punaiseksi jos vastaanottaja saa pienemmän määrän kuin %1 - - This means a fee of at least %1 is required. - Tämä tarkoittaa että vähintään %1 palkkio on pakollinen. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - Maksumäärät alle 0.546 kertaa vähimmäispalkkion näytetään tomuna. - - - This label turns red, if the change is smaller than %1. - Tämä nimi muuttuu punaiseksi jos vaihtoraha on alle %1. - (no label) (ei nimeä) @@ -841,12 +783,12 @@ Osoite: %4 Muokkaa lähtevää osoitetta - The entered address "%1" is already in the address book. - Osoite "%1" on jo osoitekirjassa. + The entered address "%1" is already in the address book. + Osoite "%1" on jo osoitekirjassa. - The entered address "%1" is not a valid Bitcoin address. - Antamasi osoite "%1" ei ole validi Bitcoin-osoite. + The entered address "%1" is not a valid Bitcoin address. + Antamasi osoite "%1" ei ole validi Bitcoin-osoite. Could not unlock wallet. @@ -882,10 +824,6 @@ Osoite: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Bitcoin Core - Kometorivivalinnat - Bitcoin Core Bitcoin-ydin @@ -894,6 +832,18 @@ Osoite: %4 version versio + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + Tietoja Bitcoin Core + + + Command-line options + Komentorivi parametrit + Usage: Käyttö: @@ -907,8 +857,8 @@ Osoite: %4 Käyttöliittymäasetukset - Set language, for example "de_DE" (default: system locale) - Set language, for example "de_DE" (default: system locale) + Set language, for example "de_DE" (default: system locale) + Set language, for example "de_DE" (default: system locale) Start minimized @@ -954,12 +904,12 @@ Osoite: %4 Määritä oma kansio: - Bitcoin - Bitcoin + Bitcoin Core + Bitcoin-ydin - Error: Specified data directory "%1" can not be created. - Virhe: Annettua data-hakemistoa "%1" ei voida luoda. + Error: Specified data directory "%1" cannot be created. + Virhe: Annettu datahakemistoa "%1" ei voida luoda. Error @@ -1035,6 +985,14 @@ Osoite: %4 Number of script &verification threads Script &varmistuksen threadien määrä + + Accept connections from outside + Hyväksy yhteysiä ulkopuolelta + + + Allow incoming connections + Hyväksy sisääntulevia yhteyksiä + Connect to the Bitcoin network through a SOCKS proxy. Yhdistä Bitcoin-verkkoon SOCKS proxyn kautta. @@ -1115,14 +1073,6 @@ Osoite: %4 Port of the proxy (e.g. 9050) Proxyn Portti (esim. 9050) - - SOCKS &Version: - SOCKS &Versio: - - - SOCKS version of the proxy (e.g. 5) - Proxyn SOCKS-versio (esim. 5) - &Window &Ikkuna @@ -1163,14 +1113,6 @@ Osoite: %4 Choose the default subdivision unit to show in the interface and when sending coins. Valitse mitä yksikköä käytetään ensisijaisesti bitcoin-määrien näyttämiseen. - - Whether to show Bitcoin addresses in the transaction list or not. - Näytetäänkö Bitcoin-osoitteet rahansiirrot listassa vai ei. - - - &Display addresses in transaction list - &Näytä osoitteet rahansiirrot listassa - Whether to show coin control features or not. Näytetäänkö kolikkokontrollin ominaisuuksia vai ei @@ -1226,6 +1168,10 @@ Osoite: %4 Wallet Lompakko + + Watch-only: + Seuranta: + Available: Käytettävissä: @@ -1258,6 +1204,10 @@ Osoite: %4 Your current total balance Tililläsi tällä hetkellä olevien Bitcoinien määrä + + Your current balance in watch-only addresses + Nykyinen tase seurantaosoitetteissa + <b>Recent transactions</b> <b>Viimeisimmät rahansiirrot</b> @@ -1274,8 +1224,8 @@ Osoite: %4 URI käsittely - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URIa ei voitu jäsentää! Tämä voi johtua kelvottomasta Bitcoin-osoitteesta tai virheellisistä URI parametreista. + Invalid payment address %1 + Virheellinen maksuosoite %1 Requested payment amount of %1 is too small (considered dust). @@ -1289,14 +1239,6 @@ Osoite: %4 Cannot start bitcoin: click-to-pay handler Ei voida käynnistää bitcoin: klikkaa-maksu käsittelijää - - Net manager warning - Verkkohallinnan varoitus - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - Aktiivinen proxy ei tue SOCKS5, joka on pakollinen maksupyynnöissä proxyn kautta. - Payment request fetch URL is invalid: %1 Maksupyynnön haku URL on virheellinen: %1 @@ -1305,10 +1247,6 @@ Osoite: %4 Payment request file handling Maksupyynnön tiedoston käsittely - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - Maksupyynnön tiedostoa ei voida lukea tai prosessoida! Tämä voi johtua virheellisestä maksupyyntötiedostosta. - Unverified payment requests to custom payment scripts are unsupported. Varmistamattomia maksupyyntöjä kustomoituun maksupalveluun ei tueta. @@ -1321,10 +1259,6 @@ Osoite: %4 Error communicating with %1: %2 Virhe kommunikoidessa %1n kanssa: %2 - - Payment request can not be parsed or processed! - Maksupyyntöä ei voida jäsentää tai prosessoida! - Bad response from server %1 Huono vastaus palvelimelta %1 @@ -1338,33 +1272,28 @@ Osoite: %4 Tietoverkon pyyntövirhe + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Määrä - Error: Specified data directory "%1" does not exist. - Virhe: Annettu data-hakemisto "%1" ei ole olemassa. + %1 h + %1 h - Error: Cannot parse configuration file: %1. Only use key=value syntax. - Virhe: Ei voida jäsentää asetustiedostoa: %1. Käytä vain avain=arvo syntaksia. + %1 m + %1 m - Error: Invalid combination of -regtest and -testnet. - Virhe: Virheellinen yhdistelmä -regtest ja -testnet. + N/A + Ei saatavilla - - Bitcoin Core didn't yet exit safely... - Bitcoin Core ei ole vielä sulkeutunut turvallisesti... - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Anna Bitcoin-osoite (esim. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget @@ -1438,10 +1367,6 @@ Osoite: %4 Current number of blocks Nykyinen Lohkojen määrä - - Estimated total blocks - Arvioitu lohkojen kokonaismäärä - Last block time Viimeisimmän lohkon aika @@ -1518,19 +1443,7 @@ Osoite: %4 %1 GB %1 GB - - %1 m - %1 m - - - %1 h - %1 h - - - %1 h %2 m - %1 h %2 m - - + ReceiveCoinsDialog @@ -1742,10 +1655,6 @@ Osoite: %4 Fee: Palkkio: - - Low Output: - Pieni Tuotos - After Fee: Palkkion jälkeen: @@ -1774,6 +1683,10 @@ Osoite: %4 Clear all fields of the form. Tyhjennä lomakkeen kaikki kentät + + Dust: + Tomu: + Clear &All &Tyhjennnä Kaikki @@ -1822,10 +1735,6 @@ Osoite: %4 Copy priority Kopioi prioriteetti - - Copy low output - Kopioi pieni tuotos - Copy change Kopioi vaihtoraha @@ -1878,6 +1787,10 @@ Osoite: %4 Warning: Unknown change address Varoitus: Tuntematon vaihtorahan osoite + + Copy dust + Kopioi tomu + Are you sure you want to send? Haluatko varmasti lähettää? @@ -1886,14 +1799,6 @@ Osoite: %4 added as transaction fee lisätty rahansiirtomaksuna - - Payment request expired - Maksupyyntö vanhentui - - - Invalid payment address %1 - Virheellinen maksuosoite %1 - SendCoinsEntry @@ -1905,10 +1810,6 @@ Osoite: %4 Pay &To: Maksun saaja: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Osoite, johon Bitcoinit lähetetään (esim. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Anna nimi tälle osoitteelle, jos haluat lisätä sen osoitekirjaan @@ -1995,10 +1896,6 @@ Osoite: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Voit allekirjoittaa viestit omalla osoitteellasi todistaaksesi että omistat ne. Ole huolellinen, että et allekirjoita mitään epämääräistä, phishing-hyökkääjät voivat huijata sinua allekirjoittamaan luovuttamalla henkilöllisyytesi. Allekirjoita selvitys täysin yksityiskohtaisesti mihin olet sitoutunut. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Osoite, jolla viesti allekirjoitetaan (esimerkiksi 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Choose previously used address Valitse aikaisemmin käytetty osoite @@ -2051,10 +1948,6 @@ Osoite: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Syötä allekirjoittava osoite, viesti ja allekirjoitus alla oleviin kenttiin varmistaaksesi allekirjoituksen aitouden. Varmista että kopioit kaikki kentät täsmälleen oikein, myös rivinvaihdot, välilyönnit, tabulaattorit, jne. - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Osoite, jolla viesti allekirjoitettiin (esimerkiksi 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address Tarkista viestin allekirjoitus varmistaaksesi, että se allekirjoitettiin tietyllä Bitcoin-osoitteella @@ -2068,12 +1961,8 @@ Osoite: %4 Tyhjennä kaikki varmista-viesti-kentät - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Anna Bitcoin-osoite (esim. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Klikkaa "Allekirjoita Viesti luodaksesi allekirjoituksen + Click "Sign Message" to generate signature + Klikkaa "Allekirjoita Viesti luodaksesi allekirjoituksen The entered address is invalid. @@ -2245,8 +2134,8 @@ Osoite: %4 Kauppias - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - Luodut kolikot täytyy kypsyttää %1 lohkoa kunnes ne voidaan käyttää. Kun loit tämän lohkon, se lähetettiin verkkoon lisänä lohkoketjuun. Jos se epäonnistuu pääsemään ketjuun sen tila tulee muuttumaan "ei hyväksytty" ja sitä ei voida käyttää. Tämä voi ajoittain tapahtua kun toisen solmun lohko luodaan samanaikaisesti omasi kanssa. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Luodut kolikot täytyy kypsyttää %1 lohkoa kunnes ne voidaan käyttää. Kun loit tämän lohkon, se lähetettiin verkkoon lisänä lohkoketjuun. Jos se epäonnistuu pääsemään ketjuun sen tila tulee muuttumaan "ei hyväksytty" ja sitä ei voida käyttää. Tämä voi ajoittain tapahtua kun toisen solmun lohko luodaan samanaikaisesti omasi kanssa. Debug information @@ -2310,10 +2199,6 @@ Osoite: %4 Address Osoite - - Amount - Määrä - Immature (%1 confirmations, will be available after %2) Epäkypsä (%1 varmistusta, saatavilla %2 jälkeen) @@ -2525,10 +2410,6 @@ Osoite: %4 Address Osoite - - Amount - Määrä - ID ID @@ -2542,6 +2423,9 @@ Osoite: %4 kenelle + + UnitDisplayStatusBarControl + WalletFrame @@ -2593,18 +2477,6 @@ Osoite: %4 bitcoin-core - - Usage: - Käyttö: - - - List commands - Lista komennoista - - - Get help for a command - Hanki apua käskyyn - Options: Asetukset: @@ -2645,10 +2517,6 @@ Osoite: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Sekuntien määrä, kuinka kauan uudelleenkytkeydytään verkkoihin (oletus: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Virhe valmisteltaessa RPC-portin %u avaamista kuunneltavaksi: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Kuuntele JSON-RPC -yhteyksiä portista <port> (oletus: 8332 or testnet: 18332) @@ -2657,10 +2525,6 @@ Osoite: %4 Accept command line and JSON-RPC commands Hyväksy merkkipohjaiset- ja JSON-RPC-käskyt - - Bitcoin Core RPC client version - Bitcoin Core RPC asiakasversio - Run in the background as a daemon and accept commands Aja taustalla daemonina ja hyväksy komennot @@ -2683,7 +2547,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, sinun tulee asettaa rpcpassword asetustietostossa: %s @@ -2694,17 +2558,13 @@ rpcpassword=%s Tämän tunnuksen ja salasanan TULEE OLLA sama. Jos tiedostoa ei ole, luo se vain omistajan-luku-oikeudella. Suositellaan asettaa alertnotify jotta saat tietoa ongelmista; -esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Hyväksytyt koodit (oletus: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Virhe ilmennyt asetettaessa RPC-porttia %u IPv6:n kuuntelemiseksi, palataan takaisin IPv4:ään %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Kytkeydy annettuun osoitteeseen ja pidä linja aina auki. Käytä [host]:portin merkintätapaa IPv6:lle. @@ -2713,18 +2573,10 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) Yhtäaikaisesti rajaa vapaat rahansiirrot <n>*1000 tavua per minuutti (oletus: 15) - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Aloita regressio testimoodi joka käyttää erikoisketjua missä lohkot voidaan ratkaista välittömästi. Tämä on tarkoitettu regressiotestien työkaluksi ja ohjelman kehittämiseen. - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Aloita regression testimoodi joka käyttää erikoisketjua jossa lohkoja voidaan ratkaista välittömästi. - - Error: Listening for incoming connections failed (listen returned error %d) - Virhe: Odottaessa sisääntulevia yhteyksiä epäonnistui (listen palautti virheen %d) - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Virhe: Rahansiirto hylättiin! Tämä saattaa tapahtua jos jotkut kolikot lompakossa on jo käytetty. Esimerkiksi jos kopioit wallet.dat tiedoston ja kolikot on käytetty mutta ei merkattu täällä. @@ -2737,10 +2589,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Suorita käsky kun lompakossa rahansiirto muuttuu (%s cmd on vaihdettu TxID kanssa) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - Tätä pienemmät palkkiot huomioidaan tyhjäksi (rahansiirron luonnissa) (oletus: - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) Aja tietokannan toimet muistivarannosta kovalevylogiin joka <n> megatavu (oletus: 100) @@ -2777,10 +2625,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Varoitus: -paytxfee on asetettu erittäin korkeaksi! Tämä on maksukulu jonka tulet maksamaan kun lähetät siirron. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Varoitus: Tarkista että tietokoneesi kellonaika ja päivämäärä ovat paikkansapitäviä! Bitcoin ei toimi oikein väärällä päivämäärällä ja/tai kellonajalla. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Varoitus: Tietoverkko ei ole sovussa! Luohijat näyttävät kokevan virhetilanteita. @@ -2813,30 +2657,14 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Attempt to recover private keys from a corrupt wallet.dat Yritetään palauttaa privaattiavaimia korruptoituneesta wallet.dat -lompakkotiedostosta - - Bitcoin Core Daemon - Bitcoin Core taustapalvelin - Block creation options: Lohkon luonnin asetukset: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - Tyhjennä lompakon rahansiirtojen lista (diagnostiikka työkalu; olettaa -rescan) - Connect only to the specified node(s) Yhidstä ainoastaan määrättyihin noodeihin - - Connect through SOCKS proxy - Yhdistä SOCKS proxin kautta - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - Yhdistä JSON-RPC portissa <port> (oletus: 8332 tai testnet: 18332) - Connection options: Yhteyden valinnat: @@ -2937,18 +2765,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write undo data Palautustiedon kirjoitus epäonnistui - - Fee per kB to add to transactions you send - palkkio per kB lisätty lähettämiisi rahansiirtoihin - - - Fees smaller than this are considered zero fee (for relaying) (default: - Tätä pienemmät palkkiot huomioidaan tyhjäksi (välittämisessä) (oletus: - - - Find peers using DNS lookup (default: 1 unless -connect) - Hae naapureita DNS hauilla (vakioasetus: 1 paitsi jos -connect) - Force safe mode (default: 0) Pakota safe moodi (oletus: 0) @@ -2974,8 +2790,8 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Virheellinen tai olematon alkulohko löydetty. Väärä data-hakemisto verkolle? - Invalid -onion address: '%s' - Virheellinen -onion osoite: '%s' + Invalid -onion address: '%s' + Virheellinen -onion osoite: '%s' Not enough file descriptors available. @@ -2985,18 +2801,10 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Prepend debug output with timestamp (default: 1) Lisää aikamerkki debug tulosteen eteen (oletus: 1) - - RPC client options: - RPC asiakas valinnat: - Rebuild block chain index from current blk000??.dat files Uudelleenrakenna lohkoketjuindeksi nykyisistä blk000??.dat tiedostoista - - Select SOCKS version for -proxy (4 or 5, default: 5) - Valitse SOCKS versio -proxy:lle (4 tai 5, oletus: 5) - Set database cache size in megabytes (%d to %d, default: %d) Aseta tietokannan välimuistin koko megatavuissa (%d - %d, oletus: %d @@ -3021,10 +2829,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This is intended for regression testing tools and app development. Tämä on tarkoitettu regression testityökaluille ja ohjelman kehittämiseen. - - Usage (deprecated, use bitcoin-cli): - Käyttö (vanhentunut, käytä bitcoin-cli): - Verifying blocks... Varmistetaan lohkoja... @@ -3033,10 +2837,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Verifying wallet... Varmistetaan lompakko... - - Wait for RPC server to start - Odota RPC palvelimen käynnistystä - Wallet %s resides outside data directory %s Lompakko %s sijaitsee data-hakemiston ulkopuolella %s @@ -3045,10 +2845,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Wallet options: Lompakon valinnat: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - Varoitus: Vanhentunut argumentti -debugnet sivutettu, käytä debug=net - You need to rebuild the database using -reindex to change -txindex Sinun tulee uudelleenrakentaa tietokanta käyttäen -reindex vaihtaen -txindex @@ -3078,12 +2874,12 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Tietoa - Invalid amount for -minrelaytxfee=<amount>: '%s' - Virheellinen määrä -minrelaytxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Virheellinen määrä -minrelaytxfee=<amount>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - Virheellinen määrä -mintxfee=<amount>: '%s' + Invalid amount for -mintxfee=<amount>: '%s' + Virheellinen määrä -mintxfee=<amount>: '%s' Limit size of signature cache to <n> entries (default: 50000) @@ -3141,14 +2937,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Run a thread to flush wallet periodically (default: 1) Aja threadi jossa tallennetaan lompakko ajoittain (oletus: 1) - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL asetukset (katso Bitcoin Wikistä tarkemmat SSL ohjeet) - - - Send command to Bitcoin Core - Lähetä komento Bitcoin Coreen - Send trace/debug info to console instead of debug.log file Lähetä jäljitys/debug-tieto konsoliin, debug.log-tiedoston sijaan @@ -3165,10 +2953,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Show all debugging options (usage: --help -help-debug) Näytä kaikki debuggaus valinnat: (käyttö: --help -help-debug) - - Show benchmark information (default: 0) - Näytä suorituskykytietoja (oletus: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Pienennä debug.log tiedosto käynnistyksen yhteydessä (vakioasetus: 1 kun ei -debug) @@ -3181,10 +2965,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Specify connection timeout in milliseconds (default: 5000) Määritä yhteyden aikakataisu millisekunneissa (vakioasetus: 5000) - - Start Bitcoin Core Daemon - Käynnistä Bitcoin Core taustapalvelin - System error: Järjestelmävirhe: @@ -3229,10 +3009,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. on startup käynnistyksessä - - version - versio - wallet.dat corrupt, salvage failed wallet.dat -lompakkotiedosto korruptoitunut, korjaaminen epäonnistui @@ -3241,14 +3017,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Password for JSON-RPC connections Salasana JSON-RPC-yhteyksille - - Allow JSON-RPC connections from specified IP address - Salli JSON-RPC yhteydet tietystä ip-osoitteesta - - - Send commands to node running on <ip> (default: 127.0.0.1) - Lähetä käskyjä solmuun osoitteessa <ip> (oletus: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Suorita käsky kun paras lohko muuttuu (%s cmd on vaihdettu block hashin kanssa) @@ -3281,10 +3049,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message Tämä ohjeviesti - - Unable to bind to %s on this computer (bind returned error %d, %s) - Kytkeytyminen %s tällä tietokonella ei onnistu (kytkeytyminen palautti virheen %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Salli DNS kyselyt -addnode, -seednode ja -connect yhteydessä @@ -3297,41 +3061,29 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted Virhe ladattaessa wallet.dat-tiedostoa: Lompakko vioittunut - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Virhe ladattaessa wallet.dat-tiedostoa: Tarvitset uudemman version Bitcoinista - - - Wallet needed to be rewritten: restart Bitcoin to complete - Lompakko tarvitsee uudelleenkirjoittaa: käynnistä Bitcoin uudelleen - Error loading wallet.dat Virhe ladattaessa wallet.dat-tiedostoa - Invalid -proxy address: '%s' - Virheellinen proxy-osoite '%s' + Invalid -proxy address: '%s' + Virheellinen proxy-osoite '%s' - Unknown network specified in -onlynet: '%s' - Tuntematon verkko -onlynet parametrina: '%s' + Unknown network specified in -onlynet: '%s' + Tuntematon verkko -onlynet parametrina: '%s' - Unknown -socks proxy version requested: %i - Tuntematon -socks proxy versio pyydetty: %i + Cannot resolve -bind address: '%s' + -bind osoitteen '%s' selvittäminen epäonnistui - Cannot resolve -bind address: '%s' - -bind osoitteen '%s' selvittäminen epäonnistui + Cannot resolve -externalip address: '%s' + -externalip osoitteen '%s' selvittäminen epäonnistui - Cannot resolve -externalip address: '%s' - -externalip osoitteen '%s' selvittäminen epäonnistui - - - Invalid amount for -paytxfee=<amount>: '%s' - -paytxfee=<amount>: '%s' on virheellinen + Invalid amount for -paytxfee=<amount>: '%s' + -paytxfee=<amount>: '%s' on virheellinen Invalid amount @@ -3377,13 +3129,5 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error Virhe - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Sinun täytyy asettaa rpcpassword=<password> asetustiedostoon: -%s -Jos tiedostoa ei ole, niin luo se ainoastaan omistajan kirjoitusoikeuksin. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_fr.ts b/src/qt/locale/bitcoin_fr.ts index 05089f0416..dfd7081593 100644 --- a/src/qt/locale/bitcoin_fr.ts +++ b/src/qt/locale/bitcoin_fr.ts @@ -1,46 +1,9 @@ - - - AboutDialog - - About Bitcoin Core - À propos de Bitcoin Core - - - <b>Bitcoin Core</b> version - Version de <b>Bitcoin Core</b> - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - Ce logiciel est expérimental. - - Distribué sous licence logicielle MIT/X11, voir le fichier COPYING joint ou http://www.opensource.org/licenses/mit-license.php. - - Ce produit comprend des logiciels développés par le projet OpenSSL afin d'être utilisés dans la boîte à outils OpenSSL (http://www.openssl.org/), un logiciel de chiffrement écrit par Eric Young (eay@cryptsoft.com), et un logiciel UPnP développé par Thomas Bernard. - - - Copyright - Tous droits réservés - - - The Bitcoin Core developers - Les développeurs Bitcoin Core - - - (%1-bit) - (%1-bit) - - + AddressBookPage Double-click to edit address or label - Double cliquer afin de modifier l'adresse ou l'étiquette + Double cliquer afin de modifier l'adresse ou l'étiquette Create a new address @@ -52,7 +15,7 @@ This product includes software developed by the OpenSSL Project for use in the O Copy the currently selected address to the system clipboard - Copier l'adresse courante sélectionnée dans le presse-papier + Copier l'adresse courante sélectionnée dans le presse-papiers &Copy @@ -64,15 +27,15 @@ This product includes software developed by the OpenSSL Project for use in the O &Copy Address - &Copier l'adresse + &Copier l'adresse Delete the currently selected address from the list - Effacer l'adresse actuellement sélectionnée de la liste + Supprimer l'adresse actuellement sélectionnée de la liste Export the data in the current tab to a file - Exporter les données de l'onglet courant vers un fichier + Exporter les données de l'onglet courant vers un fichier &Export @@ -84,11 +47,11 @@ This product includes software developed by the OpenSSL Project for use in the O Choose the address to send coins to - Choisir l'adresse à laquelle envoyer des pièces + Choisir l'adresse à laquelle envoyer des pièces Choose the address to receive coins with - Choisir l'adresse avec laquelle recevoir des pîèces + Choisir l'adresse avec laquelle recevoir des pièces C&hoose @@ -96,7 +59,7 @@ This product includes software developed by the OpenSSL Project for use in the O Sending addresses - Adresses d'envoi + Adresses d'envoi Receiving addresses @@ -104,15 +67,15 @@ This product includes software developed by the OpenSSL Project for use in the O These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - Voici vos adresses Bitcoin pour envoyer des paiements. Vérifiez toujours le montant et l'adresse du destinataire avant d'envoyer des pièces. + Voici vos adresses Bitcoin pour envoyer des paiements. Vérifiez toujours le montant et l'adresse du destinataire avant d'envoyer des pièces. These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - Voici vos adresses Bitcoin pour recevoir des paiements. Il est recommandé d'utiliser une nouvelle adresse de réception pour chaque transaction. + Voici vos adresses Bitcoin pour recevoir des paiements. Il est recommandé d'utiliser une nouvelle adresse de réception pour chaque transaction. Copy &Label - Copier l'é&tiquette + Copier l'é&tiquette &Edit @@ -120,7 +83,7 @@ This product includes software developed by the OpenSSL Project for use in the O Export Address List - Exporter la liste d'adresses + Exporter la liste d'adresses Comma separated file (*.csv) @@ -128,11 +91,11 @@ This product includes software developed by the OpenSSL Project for use in the O Exporting Failed - L'exportation a échoué + L'exportation a échoué - There was an error trying to save the address list to %1. - Une erreur est survenue lors de l'enregistrement de la liste d'adresses vers %1. + There was an error trying to save the address list to %1. Please try again. + Une erreur est survenue lors de l'enregistrement de la liste d'adresses vers %1. Veuillez ressayer plus tard. @@ -154,7 +117,7 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog Passphrase Dialog - Dialogue de phrase de passe + Fenêtre de dialogue de la phrase de passe Enter passphrase @@ -168,10 +131,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Répéter la phrase de passe - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Saisir la nouvelle phrase de passe pour le portefeuille. <br/>Veuillez utiliser une phrase de passe de <b>10 caractères aléatoires ou plus</b>, ou de <b>huit mots ou plus</b>. - Encrypt wallet Chiffrer le portefeuille @@ -206,7 +165,7 @@ This product includes software developed by the OpenSSL Project for use in the O Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - Attention : Si vous chiffrez votre portefeuille et perdez votre phrase de passe, vous <b>PERDREZ TOUS VOS BITCOINS</b> ! + Avertissement : si vous chiffrez votre portefeuille et perdez votre phrase de passe, vous <b>PERDREZ TOUS VOS BITCOINS</b> ! Are you sure you wish to encrypt your wallet? @@ -218,15 +177,19 @@ This product includes software developed by the OpenSSL Project for use in the O Warning: The Caps Lock key is on! - Attention : la touche Verr. Maj. est activée ! + Avertissement : la touche Verr. Maj. est activée ! Wallet encrypted Portefeuille chiffré + + 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>. + Saisissez une nouvelle phrase de passe pour le portefeuille.<br/>Veuillez utiliser une phrase composée de <b>dix caractères aléatoires ou plus</b>, ou bien de <b>huit mots ou plus</b>. + Bitcoin 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. - Bitcoin va à présent se fermer pour terminer le chiffrement. N'oubliez pas que le chiffrement de votre portefeuille n'est pas une protection totale contre le vol par des logiciels malveillants qui infecteraient votre ordinateur. + Bitcoin va à présent se fermer pour terminer le chiffrement. N'oubliez pas que le chiffrement de votre portefeuille n'est pas une protection totale contre le vol par des logiciels malveillants qui infecteraient votre ordinateur. Wallet encryption failed @@ -234,7 +197,7 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet encryption failed due to an internal error. Your wallet was not encrypted. - Le chiffrement du portefeuille a échoué en raison d'une erreur interne. Votre portefeuille n'a pas été chiffré. + Le chiffrement du portefeuille a échoué en raison d'une erreur interne. Votre portefeuille n'a pas été chiffré. The supplied passphrases do not match. @@ -269,7 +232,7 @@ This product includes software developed by the OpenSSL Project for use in the O &Overview - &Vue d'ensemble + &Vue d'ensemble Node @@ -285,7 +248,7 @@ This product includes software developed by the OpenSSL Project for use in the O Browse transaction history - Parcourir l'historique des transactions + Parcourir l'historique des transactions E&xit @@ -295,10 +258,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application Quitter l’application - - Show information about Bitcoin - Afficher des informations à propos de Bitcoin - About &Qt À propos de &Qt @@ -325,7 +284,7 @@ This product includes software developed by the OpenSSL Project for use in the O &Sending addresses... - Adresses d'&envoi... + Adresses d'&envoi... &Receiving addresses... @@ -335,6 +294,10 @@ This product includes software developed by the OpenSSL Project for use in the O Open &URI... Ouvrir un &URI... + + Bitcoin Core client + Client Bitcoin Core + Importing blocks from disk... Importation des blocs depuis le disque... @@ -387,6 +350,10 @@ This product includes software developed by the OpenSSL Project for use in the O &Receive &Recevoir + + Show information about Bitcoin Core + Montrer des informations à propos de Bitcoin Core + &Show / Hide &Afficher / Cacher @@ -405,7 +372,7 @@ This product includes software developed by the OpenSSL Project for use in the O Verify messages to ensure they were signed with specified Bitcoin addresses - Vérifier les messages pour vous assurer qu'ils ont été signés avec les adresses Bitcoin spécifiées + Vérifier les messages pour vous assurer qu'ils ont été signés avec les adresses Bitcoin spécifiées &File @@ -421,7 +388,7 @@ This product includes software developed by the OpenSSL Project for use in the O Tabs toolbar - Barre d'outils des onglets + Barre d'outils des onglets [testnet] @@ -441,11 +408,11 @@ This product includes software developed by the OpenSSL Project for use in the O Show the list of used sending addresses and labels - Afficher la liste d'adresses d'envoi et d'étiquettes utilisées + Afficher la liste d'adresses d'envoi et d'étiquettes utilisées Show the list of used receiving addresses and labels - Afficher la liste d'adresses de réception et d'étiquettes utilisées + Afficher la liste d'adresses de réception et d'étiquettes utilisées Open a bitcoin: URI or payment request @@ -457,11 +424,7 @@ This product includes software developed by the OpenSSL Project for use in the O Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - Afficher le message d'aide de Bitcoin Core pour obtenir une liste des options de ligne de commande Bitcoin possibles. - - - Bitcoin client - Client Bitcoin + Afficher le message d'aide de Bitcoin Core pour obtenir une liste des options de ligne de commande Bitcoin possibles. %n active connection(s) to Bitcoin network @@ -471,13 +434,9 @@ This product includes software developed by the OpenSSL Project for use in the O No block source available... Aucune source de blocs disponible... - - Processed %1 of %2 (estimated) blocks of transaction history. - À traité %1 blocs sur %2 (estimés) de l'historique des transactions. - Processed %1 blocks of transaction history. - À traité %1 blocs de l'historique des transactions. + À traité %1 blocs de l'historique des transactions. %n hour(s) @@ -559,10 +518,6 @@ Adresse : %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Le portefeuille est <b>chiffré</b> et actuellement <b>verrouillé</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Une erreur fatale est survenue. Bitcoin ne peut plus continuer de façon sûre et va s'arrêter. - ClientModel @@ -575,7 +530,7 @@ Adresse : %4 CoinControlDialog Coin Control Address Selection - Sélection de l'adresse de contrôle des pièces + Sélection de l'adresse de contrôle des pièces Quantity: @@ -598,8 +553,8 @@ Adresse : %4 Frais : - Low Output: - Sortie faible : + Dust: + Poussière : After Fee: @@ -659,15 +614,15 @@ Adresse : %4 Copy transaction ID - Copier l'ID de la transaction + Copier l'ID de la transaction Lock unspent - Verrouiller ce qui n'est pas dépensé + Verrouiller ce qui n'est pas dépensé Unlock unspent - Déverrouiller ce qui n'est pas dépensé + Déverrouiller ce qui n'est pas dépensé Copy quantity @@ -690,8 +645,8 @@ Adresse : %4 Copier la priorité - Copy low output - Copier la sortie faible + Copy dust + Copier la poussière Copy change @@ -742,8 +697,8 @@ Adresse : %4 aucun - Dust - Poussière + Can vary +/- %1 satoshi(s) per input. + Peut varier +/- %1 satoshi(s) par entrée. yes @@ -759,7 +714,7 @@ Adresse : %4 This means a fee of at least %1 per kB is required. - Signifie que des frais d'au moins 1% par ko sont requis. + Ceci signifie que des frais d'au moins %1 par ko sont exigés. Can vary +/- 1 byte per input. @@ -767,28 +722,12 @@ Adresse : %4 Transactions with higher priority are more likely to get included into a block. - Les transactions à priorité plus haute sont plus à même d'être incluses dans un bloc. + Les transactions à priorité plus haute sont plus à même d'être incluses dans un bloc. - This label turns red, if the priority is smaller than "medium". + This label turns red, if the priority is smaller than "medium". Cette étiquette devient rouge si la priorité est plus basse que « moyenne » - - This label turns red, if any recipient receives an amount smaller than %1. - Cette étiquette devient rouge si un destinataire reçoit un montant inférieur à 1%. - - - This means a fee of at least %1 is required. - Signifie que des frais d'au moins %1 sont requis. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - Les montants inférieurs à 0,546 fois les frais minimums de relais sont affichés en tant que poussière. - - - This label turns red, if the change is smaller than %1. - Cette étiquette devient rouge si la monnaie rendue est inférieure à %1. - (no label) (aucune étiquette) @@ -806,7 +745,7 @@ Adresse : %4 EditAddressDialog Edit Address - Modifier l'adresse + Modifier l'adresse &Label @@ -814,11 +753,11 @@ Adresse : %4 The label associated with this address list entry - L'étiquette associée à cette entrée de la liste d'adresses + L'étiquette associée à cette entrée de la liste d'adresses The address associated with this address list entry. This can only be modified for sending addresses. - L'adresse associée à cette entrée de la liste d'adresses. Ceci ne peut être modifié que pour les adresses d'envoi. + L'adresse associée à cette entrée de la liste d'adresses. Ceci ne peut être modifié que pour les adresses d'envoi. &Address @@ -838,15 +777,15 @@ Adresse : %4 Edit sending address - Modifier l’adresse d'envoi + Modifier l’adresse d'envoi - The entered address "%1" is already in the address book. - L’adresse fournie « %1 » est déjà présente dans le carnet d'adresses. + The entered address "%1" is already in the address book. + L’adresse fournie « %1 » est déjà présente dans le carnet d'adresses. - The entered address "%1" is not a valid Bitcoin address. - L'adresse fournie « %1 » n'est pas une adresse Bitcoin valide. + The entered address "%1" is not a valid Bitcoin address. + L'adresse fournie « %1 » n'est pas une adresse Bitcoin valide. Could not unlock wallet. @@ -873,7 +812,7 @@ Adresse : %4 Path already exists, and is not a directory. - Le chemin existe déjà et n'est pas un répertoire. + Le chemin existe déjà et n'est pas un répertoire. Cannot create data directory here. @@ -882,10 +821,6 @@ Adresse : %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Bitcoin Core - Options de ligne de commande - Bitcoin Core Bitcoin Core @@ -894,6 +829,18 @@ Adresse : %4 version version + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + À propos de Bitcoin Core + + + Command-line options + Options de ligne de commande + Usage: Utilisation : @@ -904,10 +851,10 @@ Adresse : %4 UI options - Options de l'interface utilisateur + Options de l'interface utilisateur - Set language, for example "de_DE" (default: system locale) + Set language, for example "de_DE" (default: system locale) Définir la langue, par exemple « fr_CA » (par défaut : la langue du système) @@ -920,7 +867,7 @@ Adresse : %4 Show splash screen on startup (default: 1) - Afficher l'écran d'accueil au démarrage (par défaut : 1) + Afficher l'écran d'accueil au démarrage (par défaut : 1) Choose data directory on startup (default: 0) @@ -939,7 +886,7 @@ Adresse : %4 As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - Comme c'est la première fois que le logiciel est lancé, vous pouvez choisir où Bitcoin Core stockera ses données. + Comme c'est la première fois que le logiciel est lancé, vous pouvez choisir où Bitcoin Core stockera ses données. Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. @@ -954,11 +901,11 @@ Adresse : %4 Utiliser un répertoire de données personnalisé : - Bitcoin - Bitcoin + Bitcoin Core + Bitcoin Core - Error: Specified data directory "%1" can not be created. + Error: Specified data directory "%1" cannot be created. Erreur : le répertoire de données spécifié « %1 » ne peut pas être créé. @@ -967,7 +914,7 @@ Adresse : %4 GB of free space available - Go d'espace libre disponible + Go d'espace libre disponible (of %1GB needed) @@ -982,7 +929,7 @@ Adresse : %4 Open payment request from URI or file - Ouvrir une demande de paiement à partir d'un URI ou d'un fichier + Ouvrir une demande de paiement à partir d'un URI ou d'un fichier URI: @@ -1017,11 +964,11 @@ Adresse : %4 Automatically start Bitcoin after logging in to the system. - Démarrer Bitcoin automatiquement après avoir ouvert une session sur l'ordinateur. + Démarrer Bitcoin automatiquement après avoir ouvert une session sur l'ordinateur. &Start Bitcoin on system login - &Démarrer Bitcoin lors de l'ouverture d'une session + &Démarrer Bitcoin lors de l'ouverture d'une session Size of &database cache @@ -1033,7 +980,15 @@ Adresse : %4 Number of script &verification threads - Nombre d'exétrons de &vérification de script + Nombre d'exétrons de &vérification de script + + + Accept connections from outside + Accepter les connexions provenant de l'extérieur + + + Allow incoming connections + Permettre les transactions entrantes Connect to the Bitcoin network through a SOCKS proxy. @@ -1049,11 +1004,11 @@ Adresse : %4 Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - URL de tiers (par ex. un explorateur de blocs) apparaissant dans l'onglet des transactions comme éléments du menu contextuel. %s dans l'URL est remplacé par le hachage de la transaction. Les URL multiples sont séparées par une barre verticale |. + URL de tiers (par ex. un explorateur de blocs) apparaissant dans l'onglet des transactions comme éléments du menu contextuel. %s dans l'URL est remplacé par le hachage de la transaction. Les URL multiples sont séparées par une barre verticale |. Third party transaction URLs - URL de transaction d'un tiers + URL de transaction d'un tiers Active command-line options that override above options: @@ -1089,7 +1044,7 @@ Adresse : %4 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. - Si vous désactivé la dépense de la monnaie non confirmée, la monnaie d'une transaction ne peut pas être utilisée tant que cette transaction n'a pas reçu au moins une confirmation. Ceci affecte aussi comment votre solde est calculé. + Si vous désactivé la dépense de la monnaie non confirmée, la monnaie d'une transaction ne peut pas être utilisée tant que cette transaction n'a pas reçu au moins une confirmation. Ceci affecte aussi comment votre solde est calculé. &Spend unconfirmed change @@ -1097,11 +1052,11 @@ Adresse : %4 Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - Ouvrir le port du client Bitcoin automatiquement sur le routeur. Ceci ne fonctionne que si votre routeur supporte l'UPnP et si la fonctionnalité est activée. + Ouvrir le port du client Bitcoin automatiquement sur le routeur. Ceci ne fonctionne que si votre routeur supporte l'UPnP et si la fonctionnalité est activée. Map port using &UPnP - Mapper le port avec l'&UPnP + Mapper le port avec l'&UPnP Proxy &IP: @@ -1115,14 +1070,6 @@ Adresse : %4 Port of the proxy (e.g. 9050) Port du serveur mandataire (par ex. 9050) - - SOCKS &Version: - &Version SOCKS : - - - SOCKS version of the proxy (e.g. 5) - Version SOCKS du serveur mandataire (par ex. 5) - &Window &Fenêtre @@ -1137,7 +1084,7 @@ Adresse : %4 Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - Minimiser au lieu de quitter l'application lorsque la fenêtre est fermée. Si cette option est activée, l'application ne pourra être fermée qu'en sélectionnant Quitter dans le menu. + Minimiser au lieu de quitter l'application lorsque la fenêtre est fermée. Si cette option est activée, l'application ne pourra être fermée qu'en sélectionnant Quitter dans le menu. M&inimize on close @@ -1149,27 +1096,19 @@ Adresse : %4 User Interface &language: - &Langue de l'interface utilisateur : + &Langue de l'interface utilisateur : The user interface language can be set here. This setting will take effect after restarting Bitcoin. - La langue de l'interface utilisateur peut être définie ici. Ce réglage sera pris en compte après redémarrage de Bitcoin. + La langue de l'interface utilisateur peut être définie ici. Ce réglage sera pris en compte après redémarrage de Bitcoin. &Unit to show amounts in: - &Unité d'affichage des montants : + &Unité d'affichage des montants : Choose the default subdivision unit to show in the interface and when sending coins. - Choisissez la sous-unité par défaut pour l'affichage dans l'interface et lors de l'envoi de pièces. - - - Whether to show Bitcoin addresses in the transaction list or not. - Détermine si les adresses Bitcoin seront affichées sur la liste des transactions. - - - &Display addresses in transaction list - &Afficher les adresses sur la liste des transactions + Choisissez la sous-unité par défaut pour l'affichage dans l'interface et lors de l'envoi de pièces. Whether to show coin control features or not. @@ -1205,11 +1144,11 @@ Adresse : %4 This change would require a client restart. - Ce changement nécessite un redémarrage du client. + Ce changement demanderait un redémarrage du client. The supplied proxy address is invalid. - L'adresse de serveur mandataire fournie est invalide. + L'adresse de serveur mandataire fournie est invalide. @@ -1220,12 +1159,16 @@ Adresse : %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - Les informations affichées peuvent être obsolètes. Votre portefeuille est automatiquement synchronisé avec le réseau Bitcoin lorsque la connexion s'établit, or ce processus n'est pas encore terminé. + Les informations affichées peuvent être obsolètes. Votre portefeuille est automatiquement synchronisé avec le réseau Bitcoin lorsque la connexion s'établit, or ce processus n'est pas encore terminé. Wallet Portefeuille + + Watch-only: + Juste-regarder : + Available: Disponible : @@ -1240,7 +1183,7 @@ Adresse : %4 Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - Total des transactions qui doivent encore être confirmées et qu'il n'est pas encore possible de dépenser + Total des transactions qui doivent encore être confirmées et qu'il n'est pas encore possible de dépenser Immature: @@ -1248,7 +1191,7 @@ Adresse : %4 Mined balance that has not yet matured - Le solde généré n'est pas encore mûr + Le solde généré n'est pas encore mûr Total: @@ -1258,6 +1201,22 @@ Adresse : %4 Your current total balance Votre solde total actuel + + Your current balance in watch-only addresses + Votre balance actuelle en adresses juste-regarder + + + Unconfirmed transactions to watch-only addresses + Transactions non confirmées vers des adresses juste-regarder + + + Mined balance in watch-only addresses that has not yet matured + Le solde miné dans des adresses juste-regarder, qui n'est pas encore mûr + + + Current total balance in watch-only addresses + Solde total actuel dans des adresses juste-regarder + <b>Recent transactions</b> <b>Transactions récentes</b> @@ -1274,12 +1233,28 @@ Adresse : %4 Gestion des URIs - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - L'URI ne peut être analysé ! Ceci peut être causé par une adresse Bitcoin invalide ou par des paramètres d'URI mal composé. + Invalid payment address %1 + Adresse de paiement invalide %1 + + + Payment request rejected + La demande de paiement est rejetée + + + Payment request network doesn't match client network. + Le réseau de la demande de paiement ne correspond pas au réseau du client. + + + Payment request has expired. + La demande de paiement est expirée. + + + Payment request is not initialized. + La demande de paiement n'est pas initialisée. Requested payment amount of %1 is too small (considered dust). - Le paiement demandé d'un montant de %1 est trop faible (considéré comme de la poussière). + Le paiement demandé d'un montant de %1 est trop faible (considéré comme de la poussière). Payment request error @@ -1289,25 +1264,21 @@ Adresse : %4 Cannot start bitcoin: click-to-pay handler Impossible de démarrer le gestionnaire de cliquer-pour-payer bitcoin : - - Net manager warning - Avertissement du gestionnaire de réseau - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - Votre serveur mandataire actif ne prend pas en charge SOCKS5 ce qui est exigé pour les demandes de paiements par serveur mandataire. - Payment request fetch URL is invalid: %1 - L'URL de récupération de la demande de paiement est invalide : %1 + L'URL de récupération de la demande de paiement est invalide : %1 + + + URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + L'URI ne peut pas être analysé ! Ceci peut être causé par une adresse Bitcoin invalide ou par des paramètres d'URI mal formés. Payment request file handling Gestion des fichiers de demande de paiement - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - Le fichier de demande de paiement ne peut pas être lu ou traité ! Ceci peut être causé par un fichier de demande de paiement invalide. + Payment request file cannot be read! This can be caused by an invalid payment request file. + Le fichier de demande de paiement ne peut pas être lu ! Ceci peut être causé par un fichier de demande de paiement invalide. Unverified payment requests to custom payment scripts are unsupported. @@ -1322,8 +1293,8 @@ Adresse : %4 Erreur de communication avec %1 : %2 - Payment request can not be parsed or processed! - La demande de paiement ne peut pas être analysée ou traitée ! + Payment request cannot be parsed! + La demande de paiement ne peut pas être analysée ! Bad response from server %1 @@ -1338,42 +1309,77 @@ Adresse : %4 Erreur de demande réseau + + PeerTableModel + + User Agent + Agent utilisateur + + + Address/Hostname + Adresse/nom d'hôte + + + Ping Time + Temps de ping + + QObject - Bitcoin - Bitcoin + Amount + Montant - Error: Specified data directory "%1" does not exist. - Erreur : le répertoire de données spécifié « %1 » n'existe pas. + Enter a Bitcoin address (e.g. %1) + Saisir une adresse Bitcoin (p. ex. %1) - Error: Cannot parse configuration file: %1. Only use key=value syntax. - Erreur : impossible d'analyser le fichier de configuration : %1. N’utilisez que la syntaxe clef=valeur. + %1 d + %1 d - Error: Invalid combination of -regtest and -testnet. - Erreur : combinaison invalide de -regtest et de -testnet. + %1 h + %1 h - Bitcoin Core didn't yet exit safely... - Bitcoin Core ne s'est pas encore arrêté en toute sécurité... + %1 m + %1 min - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Saisir une adresse Bitcoin (par ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + %1 s + %1 s + + + NETWORK + RÉSEAU + + + UNKNOWN + INCONNU + + + None + Aucun + + + N/A + N.D. + + + %1 ms + %1 ms QRImageWidget &Save Image... - &Sauvegarder l'image... + &Sauvegarder l'image... &Copy Image - &Copier l'image + &Copier l'image Save QR Code @@ -1412,7 +1418,11 @@ Adresse : %4 Using OpenSSL version - Version d'OpenSSL utilisée + Version d'OpenSSL utilisée + + + Using BerkeleyDB version + Version BerkeleyDB utilisée Startup time @@ -1439,8 +1449,76 @@ Adresse : %4 Nombre actuel de blocs - Estimated total blocks - Nombre total estimé de blocs + Received + Reçu + + + Sent + Envoyé + + + &Peers + &Pairs + + + Select a peer to view detailed information. + Choisir un pair pour voir l'information détaillée. + + + Direction + Direction + + + Version + Version + + + User Agent + Agent utilisateur + + + Services + Services + + + Sync Node + Nœud de synchro + + + Starting Height + Hauteur de démarrage + + + Sync Height + Hauteur de synchro + + + Ban Score + Pointage des bannissements + + + Connection Time + Temps de connexion + + + Last Send + Dernier envoi + + + Last Receive + Dernière réception + + + Bytes Sent + Octets envoyés + + + Bytes Received + Octets reçus + + + Ping Time + Temps de ping Last block time @@ -1496,7 +1574,7 @@ Adresse : %4 Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - Utiliser les touches de curseur pour naviguer dans l'historique et <b>Ctrl-L</b> pour effacer l'écran. + Utiliser les touches de curseur pour naviguer dans l'historique et <b>Ctrl-L</b> pour effacer l'écran. Type <b>help</b> for an overview of available commands. @@ -1519,16 +1597,36 @@ Adresse : %4 %1 Go - %1 m - %1 min + via %1 + par %1 - %1 h - %1 h + never + jamais - %1 h %2 m - %1 h %2 min + Inbound + Entrant + + + Outbound + Sortant + + + Yes + Oui + + + No + Non + + + Unknown + Inconnu + + + Fetching... + Récupération... @@ -1547,7 +1645,7 @@ Adresse : %4 Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - Réutilise une adresse de réception précédemment utilisée. Réutiliser une adresse pose des problèmes de sécurité et de vie privée. N'utilisez pas cette option sauf si vous générez à nouveau une demande de paiement déjà faite. + Réutilise une adresse de réception précédemment utilisée. Réutiliser une adresse pose des problèmes de sécurité et de vie privée. N'utilisez pas cette option sauf si vous générez à nouveau une demande de paiement déjà faite. R&euse an existing receiving address (not recommended) @@ -1555,7 +1653,7 @@ Adresse : %4 An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - Un message optionnel à joindre à la demande de paiement qui sera affiché à l'ouverture de celle-ci. Note : le message ne sera pas envoyé avec le paiement par le réseau Bitcoin. + Un message optionnel à joindre à la demande de paiement qui sera affiché à l'ouverture de celle-ci. Note : le message ne sera pas envoyé avec le paiement par le réseau Bitcoin. An optional label to associate with the new receiving address. @@ -1622,15 +1720,15 @@ Adresse : %4 Copy &URI - Copier l'&URI + Copier l'&URI Copy &Address - Copier l'&adresse + Copier l'&adresse &Save Image... - &Sauvegarder l'image... + &Sauvegarder l'image... Request payment to %1 @@ -1662,11 +1760,11 @@ Adresse : %4 Resulting URI too long, try to reduce the text for label / message. - L'URI résultant est trop long, essayez de réduire le texte d'étiquette / de message. + L'URI résultant est trop long, essayez de réduire le texte d'étiquette / de message. Error encoding URI into QR Code. - Erreur d'encodage de l'URI en code QR. + Erreur d'encodage de l'URI en code QR. @@ -1689,7 +1787,7 @@ Adresse : %4 (no label) - (pas d'étiquette) + (pas d'étiquette) (no message) @@ -1742,10 +1840,6 @@ Adresse : %4 Fee: Frais : - - Low Output: - Sortie faible - After Fee: Après les frais : @@ -1756,7 +1850,7 @@ Adresse : %4 If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - Si ceci est actif mais l'adresse de monnaie rendue est vide ou invalide, la monnaie sera envoyée vers une adresse nouvellement générée. + Si ceci est actif mais l'adresse de monnaie rendue est vide ou invalide, la monnaie sera envoyée vers une adresse nouvellement générée. Custom change address @@ -1774,6 +1868,10 @@ Adresse : %4 Clear all fields of the form. Effacer tous les champs du formulaire. + + Dust: + Poussière : + Clear &All &Tout nettoyer @@ -1784,7 +1882,7 @@ Adresse : %4 Confirm the send action - Confirmer l’action d'envoi + Confirmer l’action d'envoi S&end @@ -1822,10 +1920,6 @@ Adresse : %4 Copy priority Copier la priorité - - Copy low output - Copier la sortie faible - Copy change Copier la monnaie @@ -1840,7 +1934,7 @@ Adresse : %4 The recipient address is not valid, please recheck. - L'adresse du destinataire n’est pas valide, veuillez la vérifier. + L'adresse du destinataire n’est pas valide, veuillez la vérifier. The amount to pay must be larger than 0. @@ -1856,7 +1950,7 @@ Adresse : %4 Duplicate address found, can only send to each address once per send operation. - Adresse indentique trouvée, il n'est possible d'envoyer qu'une fois à chaque adresse par opération d'envoi. + Adresse indentique trouvée, il n'est possible d'envoyer qu'une fois à chaque adresse par opération d'envoi. Transaction creation failed! @@ -1868,15 +1962,19 @@ Adresse : %4 Warning: Invalid Bitcoin address - Attention : adresse Bitcoin invalide + Avertissement : adresse Bitcoin invalide (no label) - (pas d'étiquette) + (pas d'étiquette) Warning: Unknown change address - Attention : adresse de monnaie rendue inconnue + Avertissement : adresse de monnaie rendue inconnue + + + Copy dust + Copier la poussière Are you sure you want to send? @@ -1886,14 +1984,6 @@ Adresse : %4 added as transaction fee ajouté en tant que frais de transaction - - Payment request expired - La demande de paiement a expiré - - - Invalid payment address %1 - Adresse de paiement invalide %1 - SendCoinsEntry @@ -1905,10 +1995,6 @@ Adresse : %4 Pay &To: &Payer à : - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - L'adresse à laquelle le paiement sera envoyé (par ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Saisir une étiquette pour cette adresse afin de l’ajouter à votre carnet d’adresses @@ -1925,13 +2011,17 @@ Adresse : %4 This is a normal payment. Ceci est un paiement normal. + + The Bitcoin address to send the payment to + L'adresse Bitcoin à laquelle envoyer le paiement + Alt+A Alt+A Paste address from clipboard - Coller l'adresse depuis le presse-papier + Coller l'adresse depuis le presse-papiers Alt+P @@ -1951,11 +2041,11 @@ Adresse : %4 Enter a label for this address to add it to the list of used addresses - Saisir une étiquette pour cette adresse afin de l'ajouter à la liste d'adresses utilisées + Saisir une étiquette pour cette adresse afin de l'ajouter à la liste d'adresses utilisées A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - Un message qui était joint à l'URI Bitcoin et qui sera stocké avec la transaction pour référence. Note : ce message ne sera pas envoyé par le réseau Bitcoin. + Un message qui était joint à l'URI Bitcoin et qui sera stocké avec la transaction pour référence. Note : ce message ne sera pas envoyé par le réseau Bitcoin. This is an unverified payment request. @@ -1978,7 +2068,7 @@ Adresse : %4 Do not shut down the computer until this window disappears. - Ne pas fermer l'ordinateur jusqu'à la disparition de cette fenêtre. + Ne pas fermer l'ordinateur jusqu'à la disparition de cette fenêtre. @@ -1993,11 +2083,11 @@ Adresse : %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - Vous pouvez signer des messages avec vos adresses pour prouver que vous les détenez. Faites attention de ne pas signer de vague car des attaques d'hameçonnage peuvent essayer d'usurper votre identité par votre signature. Ne signez que des déclarations entièrement détaillées et avec lesquelles vous serez d'accord. + Vous pouvez signer des messages avec vos adresses pour prouver que vous les détenez. Faites attention de ne pas signer de vague car des attaques d'hameçonnage peuvent essayer d'usurper votre identité par votre signature. Ne signez que des déclarations entièrement détaillées et avec lesquelles vous serez d'accord. - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - L'adresse avec laquelle le message sera signé (par ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address to sign the message with + L'adresse Bitcoin avec laquelle signer le message Choose previously used address @@ -2009,7 +2099,7 @@ Adresse : %4 Paste address from clipboard - Coller une adresse depuis le presse-papier + Coller une adresse depuis le presse-papiers Alt+P @@ -2025,7 +2115,7 @@ Adresse : %4 Copy the current signature to the system clipboard - Copier la signature actuelle dans le presse-papier + Copier la signature actuelle dans le presse-papiers Sign the message to prove you own this Bitcoin address @@ -2049,15 +2139,15 @@ Adresse : %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - Saisir ci-dessous l'adresse de signature, le message (assurez-vous d'avoir copié exactement les retours à la ligne, les espaces, tabulations etc...) et la signature pour vérifier le message. Faire attention à ne pas déduire davantage de la signature que ce qui est contenu dans le message signé lui-même pour éviter d'être trompé par une attaque d'homme du milieu. + Saisir ci-dessous l'adresse de signature, le message (assurez-vous d'avoir copié exactement les retours à la ligne, les espaces, tabulations etc.) et la signature pour vérifier le message. Faire attention à ne pas déduire davantage de la signature que ce qui est contenu dans le message signé lui-même pour éviter d'être trompé par une attaque d'homme du milieu. - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - L'adresse avec laquelle le message a été signé (par ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address the message was signed with + L'adresse Bitcoin avec laquelle le message a été signé Verify the message to ensure it was signed with the specified Bitcoin address - Vérifier le message pour vous assurer qu'il a bien été signé par l'adresse Bitcoin spécifiée + Vérifier le message pour vous assurer qu'il a bien été signé par l'adresse Bitcoin spécifiée Verify &Message @@ -2068,24 +2158,20 @@ Adresse : %4 Réinitialiser tous les champs de vérification de message - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Saisir une adresse Bitcoin (par ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature + Click "Sign Message" to generate signature Cliquez sur « Signer le message » pour générer la signature The entered address is invalid. - L'adresse saisie est invalide. + L'adresse saisie est invalide. Please check the address and try again. - Veuillez vérifier l'adresse et réessayer. + Veuillez vérifier l'adresse et réessayer. The entered address does not refer to a key. - L'adresse saisie ne fait pas référence à une clef. + L'adresse saisie ne fait pas référence à une clef. Wallet unlock was cancelled. @@ -2093,7 +2179,7 @@ Adresse : %4 Private key for the entered address is not available. - La clef privée pour l'adresse indiquée n'est pas disponible. + La clef privée pour l'adresse indiquée n'est pas disponible. Message signing failed. @@ -2105,7 +2191,7 @@ Adresse : %4 The signature could not be decoded. - La signature n'a pu être décodée. + La signature n'a pu être décodée. Please check the signature and try again. @@ -2113,7 +2199,7 @@ Adresse : %4 The signature did not match the message digest. - La signature ne correspond pas à l'empreinte du message. + La signature ne correspond pas à l'empreinte du message. Message verification failed. @@ -2150,7 +2236,7 @@ Adresse : %4 TransactionDesc Open until %1 - Ouvert jusqu'à %1 + Ouvert jusqu'à %1 conflicted @@ -2200,6 +2286,10 @@ Adresse : %4 own address votre propre adresse + + watch-only + juste-regarder + label étiquette @@ -2220,6 +2310,14 @@ Adresse : %4 Debit Débit + + Total debit + Débit total + + + Total credit + Crédit total + Transaction fee Frais de transaction @@ -2245,7 +2343,7 @@ Adresse : %4 Marchand - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. Les pièces générées doivent mûrir pendant %1 blocs avant de pouvoir être dépensées. Lorsque vous avez généré ce bloc, il a été diffusé sur le réseau pour être ajouté à la chaîne de blocs. S’il échoue a intégrer la chaîne, son état sera modifié en « non accepté » et il ne sera pas possible de le dépenser. Ceci peut arriver occasionnellement si un autre nœud génère un bloc à quelques secondes du votre. @@ -2310,10 +2408,6 @@ Adresse : %4 Address Adresse - - Amount - Montant - Immature (%1 confirmations, will be available after %2) Immature (%1 confirmations, sera disponible après %2) @@ -2324,7 +2418,7 @@ Adresse : %4 Open until %1 - Ouvert jusqu'à %1 + Ouvert jusqu'à %1 Confirmed (%1 confirmations) @@ -2372,7 +2466,7 @@ Adresse : %4 Mined - Extrait + Miné (n/a) @@ -2443,7 +2537,7 @@ Adresse : %4 Mined - Extrait + Miné Other @@ -2471,7 +2565,7 @@ Adresse : %4 Copy transaction ID - Copier l'ID de la transaction + Copier l'ID de la transaction Edit label @@ -2483,15 +2577,15 @@ Adresse : %4 Export Transaction History - Exporter l'historique des transactions + Exporter l'historique des transactions Exporting Failed - L'exportation a échoué + L'exportation a échoué There was an error trying to save the transaction history to %1. - Une erreur est survenue lors de l'enregistrement de l'historique des transactions vers %1. + Une erreur est survenue lors de l'enregistrement de l'historique des transactions vers %1. Exporting Successful @@ -2499,7 +2593,7 @@ Adresse : %4 The transaction history was successfully saved to %1. - L'historique des transactions a été sauvegardée avec succès vers %1. + L'historique des transactions a été sauvegardée avec succès vers %1. Comma separated file (*.csv) @@ -2525,10 +2619,6 @@ Adresse : %4 Address Adresse - - Amount - Montant - ID ID @@ -2542,6 +2632,13 @@ Adresse : %4 à + + UnitDisplayStatusBarControl + + Unit to show amounts in. Click to select another unit. + Unité d'affichage des montants. Cliquer pour choisir une autre unité. + + WalletFrame @@ -2564,7 +2661,7 @@ Adresse : %4 Export the data in the current tab to a file - Exporter les données de l'onglet courant vers un fichier + Exporter les données de l'onglet courant vers un fichier Backup Wallet @@ -2580,7 +2677,7 @@ Adresse : %4 There was an error trying to save the wallet data to %1. - Une erreur est survenue lors de l'enregistrement des données de portefeuille vers %1. + Une erreur est survenue lors de l'enregistrement des données de portefeuille vers %1. The wallet data was successfully saved to %1. @@ -2593,18 +2690,6 @@ Adresse : %4 bitcoin-core - - Usage: - Utilisation : - - - List commands - Lister les commandes - - - Get help for a command - Obtenir de l’aide pour une commande - Options: Options : @@ -2645,10 +2730,6 @@ Adresse : %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Délai en secondes de refus de reconnexion aux pairs de mauvaise qualité (par défaut : 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Une erreur est survenue lors du réglage du port RPC %u pour écouter sur IPv4 : %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Écouter les connexions JSON-RPC sur le <port> (par défaut : 8332 ou tesnet : 18332) @@ -2657,10 +2738,6 @@ Adresse : %4 Accept command line and JSON-RPC commands Accepter les commandes de JSON-RPC et de la ligne de commande - - Bitcoin Core RPC client version - Version du client RPC de Bitcoin Core - Run in the background as a daemon and accept commands Fonctionner en arrière-plan en tant que démon et accepter les commandes @@ -2683,63 +2760,51 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, vous devez définir un mot de passe rpc dans le fichier de configuration : %s -Il vous est conseillé d'utiliser le mot de passe aléatoire suivant : +Il vous est conseillé d'utiliser le mot de passe aléatoire suivant : rpcuser=bitcoinrpc rpcpassword=%s -(vous n'avez pas besoin de retenir ce mot de passe) -Le nom d'utilisateur et le mot de passe NE DOIVENT PAS être identiques. -Si le fichier n'existe pas, créez-le avec les droits de lecture accordés au propriétaire. +(vous n'avez pas besoin de retenir ce mot de passe) +Le nom d'utilisateur et le mot de passe NE DOIVENT PAS être identiques. +Si le fichier n'existe pas, créez-le avec les droits de lecture accordés au propriétaire. Il est aussi conseillé de régler alertnotify pour être prévenu des problèmes ; -par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com +par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Chiffrements acceptables (par défaut : TLSv1.2+HIGH : TLSv1+HIGH : !SSLv2 : !aNULL : !eNULL : !3DES : @STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Une erreur est survenue lors du réglage du port RPC %u pour écouter sur IPv6, retour à IPv4 : %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - Se lier à l'adresse donnée et toujours l'écouter. Utilisez la notation [host]:port pour l'IPv6 + Se lier à l'adresse donnée et toujours l'écouter. Utilisez la notation [host]:port pour l'IPv6 Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) Limiter continuellement les transactions gratuites à <n>*1000 octets par minute (par défaut : 15) - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Entrer dans le mode de test de régression qui utilise une chaîne spéciale dans laquelle les blocs peuvent être résolus instantanément. Ceci est destiné aux outils de test de régression et au développement d'applications. + Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup + Supprimer toutes les transactions du portefeuille et ne récupérer que ces parties de la chaîne de bloc avec -rescan au démarrage Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Passer en mode de test de régression qui utilise une chaîne spéciale dans laquelle les blocs sont résolus instantanément. - - Error: Listening for incoming connections failed (listen returned error %d) - Erreur : l'écoute des connexions entrantes a échoué (l'écoute a retourné l'erreur %d) - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Erreur : La transaction a été rejetée ! Ceci peut arriver si certaines pièces de votre portefeuille étaient déjà dépensées, par exemple si vous avez utilisé une copie de wallet.dat et les pièces ont été dépensées avec cette copie sans être marquées comme tel ici. Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - Erreur : Cette transaction nécessite des frais de transaction d'au moins %s en raison de son montant, de sa complexité ou de l'utilisation de fonds reçus récemment ! + Erreur : cette transaction exige des frais de transaction d'au moins %s en raison de son montant, de sa complexité ou de l'utilisation de fonds reçus récemment ! Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - Exécuter la commande lorsqu'une transaction de portefeuille change (%s dans la commande est remplacée par TxID) - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - Les frais inférieurs à ce seuil sont considérés comme nuls (pour la création de transactions) (par défaut : + Exécuter la commande lorsqu'une transaction de portefeuille change (%s dans la commande est remplacée par TxID) Flush database activity from memory pool to disk log every <n> megabytes (default: 100) @@ -2755,7 +2820,7 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - Définir le nombre d'exétrons de vérification des scripts (%u à %d, 0 = auto, < 0 = laisser ce nombre de cœurs inutilisés, par défaut : %d) + Définir le nombre d'exétrons de vérification des scripts (%u à %d, 0 = auto, < 0 = laisser ce nombre de cœurs inutilisés, par défaut : %d) Set the processor limit for when generation is on (-1 = unlimited, default: -1) @@ -2763,7 +2828,7 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - Ceci est une pré-version de test - l'utiliser à vos risques et périls - ne pas l'utiliser pour miner ou pour des applications marchandes + Ceci est une pré-version de test - l'utiliser à vos risques et périls - ne pas l'utiliser pour miner ou pour des applications marchandes Unable to bind to %s on this computer. Bitcoin Core is probably already running. @@ -2775,23 +2840,19 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - Attention : -paytxfee est réglée sur un montant très élevé ! Il s'agit des frais de transaction que vous payerez si vous envoyez une transaction. - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Attention : Veuillez vérifier que la date et l'heure de votre ordinateur sont justes ! Si votre horloge n'est pas à l'heure, Bitcoin ne fonctionnera pas correctement. + Avertissement : -paytxfee est réglé sur un montant très élevé ! Il s'agit des frais de transaction que vous payerez si vous envoyez une transaction. Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - Attention : Le réseau ne semble pas totalement d'accord ! Quelques mineurs semblent éprouver des difficultés. + Avertissement : le réseau ne semble pas totalement d'accord ! Quelques mineurs semblent éprouver des difficultés. Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - Attention : Nous ne semblons pas être en accord complet avec nos pairs ! Vous pourriez avoir besoin d'effectuer une mise à niveau, ou d'autres nœuds du réseau pourraient avoir besoin d'effectuer une mise à niveau. + Avertissement : nous ne semblons pas être en accord complet avec nos pairs ! Vous pourriez avoir besoin d'effectuer une mise à niveau, ou d'autres nœuds du réseau pourraient avoir besoin d'effectuer une mise à niveau. Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - Avertissement : une erreur est survenue lors de la lecture de wallet.dat ! Toutes les clefs ont été lues correctement mais les données de transaction ou les entrées du carnet d'adresses sont peut-être incorrectes ou manquantes. + Avertissement : une erreur est survenue lors de la lecture de wallet.dat ! Toutes les clefs ont été lues correctement mais les données de transaction ou les entrées du carnet d'adresses sont peut-être incorrectes ou manquantes. Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. @@ -2811,31 +2872,15 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Attempt to recover private keys from a corrupt wallet.dat - Tenter de récupérer les clefs privées d'un wallet.dat corrompu - - - Bitcoin Core Daemon - Démon Bitcoin Core + Tenter de récupérer les clefs privées d'un wallet.dat corrompu Block creation options: Options de création de bloc : - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - Effacer la liste des transactions du portefeuille (outil de diagnostic, implique un nouveau balayage -rescan) - Connect only to the specified node(s) - Ne se connecter qu'au(x) nœud(s) spécifié(s) - - - Connect through SOCKS proxy - Connexion à travers un serveur mandataire SOCKS - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - Se connecter à JSON-RPC sur le <port> (par défaut : 8332 ou testnet : 18332) + Ne se connecter qu'au(x) nœud(s) spécifié(s) Connection options: @@ -2855,7 +2900,7 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Discover own IP address (default: 1 when listening and no -externalip) - Découvrir sa propre adresse IP (par défaut : 1 lors de l'écoute et si aucun -externalip) + Découvrir sa propre adresse IP (par défaut : 1 lors de l'écoute et si aucun -externalip) Do not load the wallet and disable wallet RPC calls @@ -2867,11 +2912,11 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Error initializing block database - Erreur lors de l'initialisation de la base de données des blocs + Erreur lors de l'initialisation de la base de données des blocs Error initializing wallet database environment %s! - Erreur lors de l'initialisation de l'environnement de la base de données du portefeuille %s ! + Erreur lors de l'initialisation de l'environnement de la base de données du portefeuille %s ! Error loading block database @@ -2879,11 +2924,11 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Error opening block database - Erreur lors de l'ouverture de la base de données des blocs + Erreur lors de l'ouverture de la base de données des blocs Error: Disk space is low! - Erreur : l'espace disque est faible ! + Erreur : l'espace disque est faible ! Error: Wallet locked, unable to create transaction! @@ -2895,7 +2940,7 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Failed to listen on any port. Use -listen=0 if you want this. - Échec de l'écoute sur un port quelconque. Utilisez -listen=0 si vous voulez ceci. + Échec de l'écoute sur un port quelconque. Utilisez -listen=0 si vous voulez ceci. Failed to read block info @@ -2907,47 +2952,35 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Failed to sync block index - La synchronisation de l'index des blocs a échoué + La synchronisation de l'index des blocs a échoué Failed to write block index - L''écriture de l'index des blocs a échoué + L''écriture de l'index des blocs a échoué Failed to write block info - L'écriture des informations du bloc a échoué + L'écriture des informations du bloc a échoué Failed to write block - L'écriture du bloc a échoué + L'écriture du bloc a échoué Failed to write file info - L'écriture des informations de fichier a échoué + L'écriture des informations de fichier a échoué Failed to write to coin database - L'écriture dans la base de données des pièces a échoué + L'écriture dans la base de données des pièces a échoué Failed to write transaction index - L'écriture de l'index des transactions a échoué + L'écriture de l'index des transactions a échoué Failed to write undo data - L'écriture des données d'annulation a échoué - - - Fee per kB to add to transactions you send - Frais par ko à ajouter aux transactions que vous envoyez - - - Fees smaller than this are considered zero fee (for relaying) (default: - Les frais inférieurs à ce seuil sont considérés comme nuls (pour le relayage) (par défaut : - - - Find peers using DNS lookup (default: 1 unless -connect) - Trouver des pairs en utilisant la recherche DNS (par défaut : 1 sauf si -connect est utilisé) + L'écriture des données d'annulation a échoué Force safe mode (default: 0) @@ -2963,7 +2996,7 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo If <category> is not supplied, output all debugging information. - Si <category> n'est pas indiqué, extraire toutes les données de débogage. + Si <category> n'est pas indiqué, extraire toutes les données de débogage. Importing... @@ -2974,7 +3007,7 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Bloc de genèse incorrect ou introuvable. Mauvais répertoire de données pour le réseau ? - Invalid -onion address: '%s' + Invalid -onion address: '%s' Adresse -onion invalide : « %s » @@ -2983,19 +3016,11 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Prepend debug output with timestamp (default: 1) - Ajouter l'horodatage au début des résultats de débogage (par défaut : 1) - - - RPC client options: - Options du client RPC : + Ajouter l'horodatage au début des résultats de débogage (par défaut : 1) Rebuild block chain index from current blk000??.dat files - Reconstruire l'index de la chaîne de blocs à partir des fichiers blk000??.dat courants - - - Select SOCKS version for -proxy (4 or 5, default: 5) - Choisir la version SOCKS pour -proxy (4 ou 5, par défaut : 5) + Reconstruire l'index de la chaîne de blocs à partir des fichiers blk000??.dat courants Set database cache size in megabytes (%d to %d, default: %d) @@ -3007,7 +3032,7 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Set the number of threads to service RPC calls (default: 4) - Définir le nombre d'exétrons pour desservir les appels RPC (par défaut : 4) + Définir le nombre d'exétrons pour desservir les appels RPC (par défaut : 4) Specify wallet file (within data directory) @@ -3015,15 +3040,15 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Spend unconfirmed change when sending transactions (default: 1) - Dépenser la monnaie non confirmée lors de l'envoi de transactions (par défaut : 1) + Dépenser la monnaie non confirmée lors de l'envoi de transactions (par défaut : 1) + + + Stop running after importing blocks from disk (default: 0) + Arrêter l'exécution après l'importation des blocs du disque (par défaut : 0) This is intended for regression testing tools and app development. - Ceci est à l'intention des outils de test de régression et du développement applicatif. - - - Usage (deprecated, use bitcoin-cli): - Utilisation (obsolète, utiliser bitcoin-cli) : + Ceci est à l'intention des outils de test de régression et du développement applicatif. Verifying blocks... @@ -3033,10 +3058,6 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Verifying wallet... Vérification du portefeuille en cours... - - Wait for RPC server to start - Attendre le démarrage du serveur RPC - Wallet %s resides outside data directory %s Le portefeuille %s réside en dehors du répertoire de données %s @@ -3045,10 +3066,6 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Wallet options: Options du portefeuille : - - Warning: Deprecated argument -debugnet ignored, use -debug=net - Attention : l'argument obsolète -debugnet a été ignoré, utiliser -debug=net - You need to rebuild the database using -reindex to change -txindex Vous devez reconstruire la base de données en utilisant -reindex afin de modifier -txindex @@ -3057,34 +3074,158 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Imports blocks from external blk000??.dat file Importe des blocs depuis un fichier blk000??.dat externe + + (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + (par défaut : 1, 1 = conserver les données de transmission c.-à-d. propriétaire du compte et information de demande de paiement, 2 = abandonner les données de transmission) + + + Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times + Permettre les connexions JSON-RPC de sources spécifiques. Valide pour <ip> qui sont une IP simple (p. ex. 1.2.3.4), un réseau/masque réseau (p. ex. 1.2.3.4/255.255.255.0) ou un réseau/CIDR (p. ex. 1.2.3.4/24). Cette option peut être être spécifiée plusieurs fois + + + An error occurred while setting up the RPC address %s port %u for listening: %s + Une erreur est survenue lors de la mise en place de l'adresse %s port %u d'écoute RPC : %s + + + Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6 + Se lier à l'adresse donnée et aux pairs s'y connectant. Utiliser la notation [host]:port pour l'IPv6 + + + Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces) + Se lier à l'adresse donnée pour écouter des connexions JSON-RPC. Utiliser la notation [host]:port pour l'IPv6. Cette option peut être spécifiée plusieurs fois (par défaut : se lier à toutes les interfaces) + Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. Impossible d’obtenir un verrou sur le répertoire de données %s. Bitcoin Core fonctionne probablement déjà. + + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) + Créer de nouveaux fichiers avec les permissions système par défaut, au lieu de umask 077 (effectif seulement avec la fonction du portefeuille désactivée) + + + Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + Distribué sous la licence logiciel MIT/X11, consultez le fichier joint COPYING ou <http://www.opensource.org/licenses/mit-license.php>. + + + Error: Listening for incoming connections failed (listen returned error %s) + Erreur : l'écoute des connexions entrantes a échoué (l'écoute a retourné l'erreur %s) + + + Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + Erreur : l'argument non pris en charge -socks a été trouvé. Il n'est plus possible de définir la version de SOCKS, seuls les serveurs mandataires SOCKS5 sont pris en charge. + + + Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) + Exécuter la commande quand une transmission réseau redépense l'entrée d'une transmission du portefeuille (%s=respend TxID, %t=wallet TxID) + Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - Exécuter une commande lorsqu'une alerte pertinente est reçue ou si nous voyons une bifurcation vraiment étendue (%s dans la commande est remplacé par le message) + Exécuter une commande lorsqu'une alerte pertinente est reçue ou si nous voyons une bifurcation vraiment étendue (%s dans la commande est remplacé par le message) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) + Les frais (en BTC/Ko) inférieurs à ce seuil sont considérés comme étant nuls pour le relayage (par défaut : %s) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) + Les frais (en BTC/Ko) inférieurs à ce seuil sont considérés comme étant nuls pour la création de transactions (par défaut : %s) + + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) + Si paytxfee n'est pas défini, inclure suffisamment de frais afin que les transactions soient confirmées avant n blocs (par défaut : 1) Output debugging information (default: 0, supplying <category> is optional) Informations du résultat de débogage (par défaut : 0, fournir <category> est optionnel) + + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) + Demander les adresses des pairs par recherche DNS si l'on manque d'adresses (par défaut : 1 sauf si -connect) + Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Définir la taille maximale en octets des transactions prioritaires/à frais modiques (par défaut : %d) + + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. + Ce produit comprend des logiciels développés par le projet OpenSSL pour être utilisés dans la boîte à outils OpenSSL <https://www.openssl.org/> et un logiciel cryptographique écrit par Eric Young, ainsi qu'un logiciel UPnP écrit par Thomas Bernard. + + + Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + Avertissement : veuillez vérifier que l'heure et la date de votre ordinateur sont correctes ! Si votre horloge n'est pas à l'heure, Bitcoin Core ne fonctionnera pas correctement. + + + Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. + Pairs de la liste blanche se connectant à partir du masque réseau ou de l'IP donné. Peut être spécifié plusieurs fois. + + + Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway + Les pairs de la liste blanche ne peuvent pas être bannis DoS et leurs transactions sont toujours relayées, même si elles sont déjà dans le mempool, utile p. ex. pour une passerelle + + + Always query for peer addresses via DNS lookup (default: 0) + Toujours demander les adresses de pairs par recherche DNS (par défaut : 0) + + + Cannot resolve -whitebind address: '%s' + Impossible de résoudre l'adresse -whitebind : « %s » + + + Connect through SOCKS5 proxy + Se connecter par un mandataire SOCKS5 + + + Copyright (C) 2009-%i The Bitcoin Core Developers + Copyright © 2009-%i Les développeurs de Bitcoin Core + + + Could not parse -rpcbind value %s as network address + Impossible d'analyser la valeur -rpcbind %s comme adresse réseau + + + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core + Erreur lors du chargement de wallet.dat : le portefeuille exige une version plus récente de Bitcoin Core + + + Error: Unsupported argument -tor found, use -onion. + Erreur : argument non pris en charge -tor trouvé, utiliser -onion. + + + Fee (in BTC/kB) to add to transactions you send (default: %s) + Les frais (en BTC/ko) à ajouter aux transactions que vous envoyez (par défaut : %s) + + + Include IP addresses in debug output (default: 0) + Inclure les adresses IP dans la sortie de débogage (par défaut : 0) + Information Informations - Invalid amount for -minrelaytxfee=<amount>: '%s' + Initialization sanity check failed. Bitcoin Core is shutting down. + L'initialisation du test de cohérence a échoué. Bitcoin est en cours de fermeture. + + + Invalid amount for -minrelaytxfee=<amount>: '%s' Montant invalide pour -minrelayfee=<montant> : « %s » - Invalid amount for -mintxfee=<amount>: '%s' + Invalid amount for -mintxfee=<amount>: '%s' Montant invalide pour -mintxfee=<montant> : « %s » + + Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) + Montant invalide pour -paytxfee=<montant> : « %s » (doit être au moins %s) + + + Invalid netmask specified in -whitelist: '%s' + Masque réseau invalide spécifié dans -whitelist : « %s » + + + Keep at most <n> unconnectable blocks in memory (default: %u) + Garder au plus <n> blocs non connectables en mémoire (par défaut : %u) + Limit size of signature cache to <n> entries (default: 50000) Limiter la taille du cache des signatures à <n> entrées (par défaut : 50000) @@ -3103,11 +3244,19 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Tampon maximal d'envoi par « -connection », <n>*1 000 octets (par défaut : 1 000) + Tampon maximal d'envoi par « -connection », <n>*1 000 octets (par défaut : 1 000) + + + Need to specify a port with -whitebind: '%s' + Un port doit être spécifié avec -whitebind : « %s » + + + Node relay options: + Options de relais du nœud : Only accept block chain matching built-in checkpoints (default: 1) - N'accepter que la chaîne de blocs correspondant aux points de vérification internes (par défaut : 1) + N'accepter que la chaîne de blocs correspondant aux points de vérification internes (par défaut : 1) Only connect to nodes in network <net> (IPv4, IPv6 or Tor) @@ -3115,11 +3264,11 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Print block on startup, if found in block index - Imprimer le bloc au démarrage s'il est trouvé dans l'index des blocs + Imprimer le bloc au démarrage s'il est trouvé dans l'index des blocs Print block tree on startup (default: 0) - Imprimer l'arborescence des blocs au démarrage (par défaut : 0) + Imprimer l'arborescence des blocs au démarrage (par défaut : 0) RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) @@ -3137,18 +3286,18 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Randomly fuzz 1 of every <n> network messages Tester aléatoirement 1 message du réseau sur <n> + + Relay and mine data carrier transactions (default: 1) + Relayer et miner les transactions du porteur de données (par défaut : 1) + + + Relay non-P2SH multisig (default: 1) + Relayer les multisig non-P2SH (par défaut : 1) + Run a thread to flush wallet periodically (default: 1) Exécuter un exétron pour purger le portefeuille périodiquement (par défaut : 1) - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - Options SSL : (voir le Wiki de Bitcoin pour les instructions de configuration du SSL) - - - Send command to Bitcoin Core - Envoyer une commande à Bitcoin Core - Send trace/debug info to console instead of debug.log file Envoyer les informations de débogage/trace à la console au lieu du fichier debug.log @@ -3159,19 +3308,15 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - Définit le drapeau DB_PRIVATE dans l'environnement de la base de données du portefeuille (par défaut : 1) + Définit le drapeau DB_PRIVATE dans l'environnement de la base de données du portefeuille (par défaut : 1) Show all debugging options (usage: --help -help-debug) Montrer toutes les options de débogage (utilisation : --help --help-debug) - - Show benchmark information (default: 0) - Afficher les infos du test de performance (par défaut : 0) - Shrink debug.log file on client startup (default: 1 when no -debug) - Réduire le fichier debug.log lors du démarrage du client (par défaut : 1 lorsque -debug n'est pas présent) + Réduire le fichier debug.log lors du démarrage du client (par défaut : 1 lorsque -debug n'est pas présent) Signing transaction failed @@ -3179,16 +3324,16 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Specify connection timeout in milliseconds (default: 5000) - Spécifier le délai d'expiration de la connexion en millisecondes (par défaut : 5 000) - - - Start Bitcoin Core Daemon - Démarrer le démon Bitcoin Core + Spécifier le délai d'expiration de la connexion en millisecondes (par défaut : 5 000) System error: Erreur système : + + This is experimental software. + Ceci est un logiciel expérimental. + Transaction amount too small Montant de la transaction trop bas @@ -3201,17 +3346,25 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Transaction too large Transaction trop volumineuse + + Unable to bind to %s on this computer (bind returned error %s) + Impossible de se lier à %s sur cet ordinateur (bind a retourné l'erreur %s) + Use UPnP to map the listening port (default: 0) - Utiliser l'UPnP pour rediriger le port d'écoute (par défaut : 0) + Utiliser l'UPnP pour rediriger le port d'écoute (par défaut : 0) Use UPnP to map the listening port (default: 1 when listening) - Utiliser l'UPnP pour rediriger le port d'écoute (par défaut : 1 lors de l'écoute) + Utiliser l'UPnP pour rediriger le port d'écoute (par défaut : 1 lors de l'écoute) Username for JSON-RPC connections - Nom d'utilisateur pour les connexions JSON-RPC + Nom d'utilisateur pour les connexions JSON-RPC + + + Wallet needed to be rewritten: restart Bitcoin Core to complete + Le portefeuille avait besoin d'être réécrit : veuillez redémarrer Bitcoin Core pour terminer Warning @@ -3221,6 +3374,14 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Warning: This version is obsolete, upgrade required! Avertissement : cette version est obsolète, une mise à niveau est nécessaire ! + + Warning: Unsupported argument -benchmark ignored, use -debug=bench. + Avertissement : l'argument -benchmark non pris en charge a été ignoré, utiliser -debug=bench. + + + Warning: Unsupported argument -debugnet ignored, use -debug=net. + Avertissement : l'argument -debugnet non pris en charge a été ignoré, utiliser -debug=net. + Zapping all transactions from wallet... Supprimer toutes les transactions du portefeuille... @@ -3229,10 +3390,6 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo on startup au démarrage - - version - version - wallet.dat corrupt, salvage failed wallet.dat corrompu, la récupération a échoué @@ -3241,14 +3398,6 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Password for JSON-RPC connections Mot de passe pour les connexions JSON-RPC - - Allow JSON-RPC connections from specified IP address - Autoriser les connexions JSON-RPC depuis l'adresse IP spécifiée - - - Send commands to node running on <ip> (default: 127.0.0.1) - Envoyer des commandes au nœud fonctionnant sur <ip> (par défaut : 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Exécuter la commande lorsque le meilleur bloc change (%s dans cmd est remplacé par le hachage du bloc) @@ -3279,11 +3428,7 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo This help message - Ce message d'aide - - - Unable to bind to %s on this computer (bind returned error %d, %s) - Impossible de se lier à %s sur cet ordinateur (bind a retourné l'erreur %d, %s) + Ce message d'aide Allow DNS lookups for -addnode, -seednode and -connect @@ -3297,40 +3442,28 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Error loading wallet.dat: Wallet corrupted Erreur lors du chargement de wallet.dat : portefeuille corrompu - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Erreur lors du chargement de wallet.dat : le portefeuille exige une version plus récente de Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - Le portefeuille devait être réécrit : redémarrer Bitcoin pour terminer l'opération. - Error loading wallet.dat Erreur lors du chargement de wallet.dat - Invalid -proxy address: '%s' + Invalid -proxy address: '%s' Adresse -proxy invalide : « %s » - Unknown network specified in -onlynet: '%s' + Unknown network specified in -onlynet: '%s' Réseau inconnu spécifié sur -onlynet : « %s » - Unknown -socks proxy version requested: %i - Version inconnue de serveur mandataire -socks demandée : %i + Cannot resolve -bind address: '%s' + Impossible de résoudre l'adresse -bind : « %s » - Cannot resolve -bind address: '%s' - Impossible de résoudre l'adresse -bind : « %s » + Cannot resolve -externalip address: '%s' + Impossible de résoudre l'adresse -externalip : « %s » - Cannot resolve -externalip address: '%s' - Impossible de résoudre l'adresse -externalip : « %s » - - - Invalid amount for -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' Montant invalide pour -paytxfee=<montant> : « %s » @@ -3359,7 +3492,7 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo Cannot write default address - Impossible d'écrire l'adresse par défaut + Impossible d'écrire l'adresse par défaut Rescanning... @@ -3371,19 +3504,11 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@fo To use the %s option - Pour utiliser l'option %s + Pour utiliser l'option %s Error Erreur - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Vous devez ajouter la ligne rpcpassword=<mot-de-passe> au fichier de configuration : -%s -Si le fichier n'existe pas, créez-le avec les droits de lecture seule accordés au propriétaire. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_fr_CA.ts b/src/qt/locale/bitcoin_fr_CA.ts index ff22c2fd1c..56be717a8d 100644 --- a/src/qt/locale/bitcoin_fr_CA.ts +++ b/src/qt/locale/bitcoin_fr_CA.ts @@ -1,140 +1,27 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Ce logiciel est en phase expérimentale. - -Distribué sous licence MIT/X11, voir le fichier COPYING ou http://www.opensource.org/licenses/mit-license.php. - -Ce produit comprend des logiciels développés par le projet OpenSSL pour être utilisés dans la boîte à outils OpenSSL (http://www.openssl.org/), un logiciel cryptographique écrit par Eric Young (eay@cryptsoft.com) et un logiciel UPnP écrit par Thomas Bernard. - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage Double-click to edit address or label - Double-cliquez afin de modifier l'adress ou l'étiquette + Double-cliquez afin de modifier l'adress ou l'étiquette Create a new address Créer une nouvelle adresse - - &New - - Copy the currently selected address to the system clipboard - Copier l'adresse surligné a votre presse-papier - - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - + Copier l'adresse surligné a votre presse-papier &Delete &Supprimer - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - Comma separated file (*.csv) Fichier séparé par une virgule (*.csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -152,10 +39,6 @@ Ce produit comprend des logiciels développés par le projet OpenSSL pour être AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase Entrer Mot de Passe @@ -168,10 +51,6 @@ Ce produit comprend des logiciels développés par le projet OpenSSL pour être Repeat new passphrase Répéter Mot de Passe - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Entrer le nouveau mot de passe pour le porte-feuille. Veuillez utiliser un mot de passe de 10 caractères au hasard ou plus, ou, 8 mots ou plus. - Encrypt wallet Encrypter Porte-Feuille @@ -188,2331 +67,126 @@ Ce produit comprend des logiciels développés par le projet OpenSSL pour être This operation needs your wallet passphrase to decrypt the wallet. Cette opération nécessite le mot de passe de votre porte-feuille pour le décrypter. - - Decrypt wallet - - - - Change passphrase - - - - Enter the old and new passphrase to the wallet. - - - - Confirm wallet encryption - - - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - - - Wallet encrypted - - - - Bitcoin 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. - - - - Wallet encryption failed - - - - Wallet encryption failed due to an internal error. Your wallet was not encrypted. - - - - The supplied passphrases do not match. - - - - Wallet unlock failed - - - - The passphrase entered for the wallet decryption was incorrect. - - - - Wallet decryption failed - - - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - - - Synchronizing with network... - - - - &Overview - - - - Node - - - - Show general overview of wallet - - - - &Transactions - - - - Browse transaction history - - - - E&xit - - - - Quit application - - - - Show information about Bitcoin - - - - About &Qt - - - - Show information about Qt - - - - &Options... - - - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - - - Change the passphrase used for wallet encryption - - - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - - - &File - - - - &Settings - - - - &Help - - - - Tabs toolbar - - - - [testnet] - - - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - - - %n active connection(s) to Bitcoin network - - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - - - Error - - - - Warning - - - - Information - - - - Up to date - - - - Catching up... - - - - Sent transaction - - - - Incoming transaction - - - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> - - - - Wallet is <b>encrypted</b> and currently <b>locked</b> - - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - - + ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - - - Amount - - Address Addresse - - Date - - - - Confirmations - - - - Confirmed - - - - Priority - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (pas de record) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog - - Edit Address - - - - &Label - - - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - - - &Address - - - - New receiving address - - - - New sending address - - - - Edit receiving address - - - - Edit sending address - - - - The entered address "%1" is already in the address book. - - - - The entered address "%1" is not a valid Bitcoin address. - - - - Could not unlock wallet. - - - - New key generation failed. - - - + FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - - - version - - - - Usage: - - - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - - - Error - - - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog - - Options - - - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage - - Form - - - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - - - <b>Recent transactions</b> - - - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - - Bitcoin - - - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - - - &Label: - - - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - - - Copy label - - - - Copy message - - - - Copy amount - - - + ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address Addresse - - Amount - - Label Record - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel - - Date - - Label Record - - Message - - - - Amount - - (no label) (pas de record) - - (no message) - - - - (no amount) - - - + SendCoinsDialog - - Send Coins - - - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - - - Send to multiple recipients at once - - - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - - - Balance: - - - - Confirm the send action - - - - S&end - - - - Confirm send coins - - - - %1 to %2 - - - - Copy quantity - - - - Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - - - The amount to pay must be larger than 0. - - - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (pas de record) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry - - A&mount: - - - - Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Enter a label for this address to add it to your address book - - - - &Label: - - - - Choose previously used address - - - - This is a normal payment. - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - - - [testnet] - - - + TrafficGraphWidget - - KB/s - - - + TransactionDesc - - Open until %1 - - - - conflicted - - - - %1/offline - - - - %1/unconfirmed - - - - %1 confirmations - - - - Status - - - - , broadcast through %n node(s) - - - - Date - - - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - - - Amount - - - - true - - - - false - - - - , has not been successfully broadcast yet - - - - Open for %n more block(s) - - - - unknown - - - + TransactionDescDialog - - Transaction details - - - - This pane shows a detailed description of the transaction - - - + TransactionTableModel - - Date - - - - Type - - Address Addresse - - Amount - - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - - - Open until %1 - - - - Confirmed (%1 confirmations) - - - - This block was not received by any other nodes and will probably not be accepted! - - - - Generated but not accepted - - - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - - - Received with - - - - Received from - - - - Sent to - - - - Payment to yourself - - - - Mined - - - - (n/a) - - - - Transaction status. Hover over this field to show number of confirmations. - - - - Date and time that the transaction was received. - - - - Type of transaction. - - - - Destination address of transaction. - - - - Amount removed from or added to balance. - - - + TransactionView - - All - - - - Today - - - - This week - - - - This month - - - - Last month - - - - This year - - - - Range... - - - - Received with - - - - Sent to - - - - To yourself - - - - Mined - - - - Other - - - - Enter address or label to search - - - - Min amount - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Fichier séparé par une virgule (*.csv) - - Confirmed - - - - Date - - - - Type - - Label Record @@ -2521,853 +195,20 @@ Address: %4 Address Addresse - - Amount - - - - ID - - - - Range: - - - - to - - - + + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel - - Send Coins - - - + WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - - - Options: - - - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - - - Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - - - Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - - - Done loading - - - - To use the %s option - - - - Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - - + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_gl.ts b/src/qt/locale/bitcoin_gl.ts index ecf1fa2222..b047bb5a4b 100644 --- a/src/qt/locale/bitcoin_gl.ts +++ b/src/qt/locale/bitcoin_gl.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - Sobre Bitcoin core - - - <b>Bitcoin Core</b> version - <b>Bitcoin core</b> versión - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Isto é software experimental. - -Distribuído baixo a licencia de software MIT/X11, véxase o arquivo que acompaña COPYING ou http://www.opensource.org/licenses/mit-license.php. - -Este produto inclúe software desenvolvido polo OpenSSL Project para o uso no OpenSSL Toolkit (http://www.openssl.org/) e software criptográfico escrito por Eric Young (eay@cryptsoft.com) e software UPnP escrito por Thomas Bernard. - - - Copyright - Copyright - - - The Bitcoin Core developers - Os desarrolladores de Bitcoin Core - - - (%1-bit) - - - + AddressBookPage @@ -130,11 +93,7 @@ Este produto inclúe software desenvolvido polo OpenSSL Project para o uso no Op Exporting Failed Exportación falida - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -168,10 +127,6 @@ Este produto inclúe software desenvolvido polo OpenSSL Project para o uso no Op Repeat new passphrase Repite novo contrasinal - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Introduce o novo contrasinal ao moedeiro.<br/>Por favor empregue un contrasinal de <b>10 ou máis caracteres aleatorios</b>, ou <b>oito ou máis palabras</b>. - Encrypt wallet Encriptar moedeiro @@ -271,10 +226,6 @@ Este produto inclúe software desenvolvido polo OpenSSL Project para o uso no Op &Overview &Vista xeral - - Node - - Show general overview of wallet Amosar vista xeral do moedeiro @@ -295,10 +246,6 @@ Este produto inclúe software desenvolvido polo OpenSSL Project para o uso no Op Quit application Saír da aplicación - - Show information about Bitcoin - Amosar información sobre Bitcoin - About &Qt Acerca de &Qt @@ -323,18 +270,6 @@ Este produto inclúe software desenvolvido polo OpenSSL Project para o uso no Op &Change Passphrase... &Cambiar contrasinal... - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - Importing blocks from disk... Importando bloques de disco... @@ -451,18 +386,6 @@ Este produto inclúe software desenvolvido polo OpenSSL Project para o uso no Op Open a bitcoin: URI or payment request Abrir un bitcoin: URI ou solicitude de pago - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Cliente Bitcoin - %n active connection(s) to Bitcoin network %n conexión activa coa rede Bitcoin%n conexións activas coa rede Bitcoin @@ -471,10 +394,6 @@ Este produto inclúe software desenvolvido polo OpenSSL Project para o uso no Op No block source available... Non hai orixe de bloques dispoñible... - - Processed %1 of %2 (estimated) blocks of transaction history. - Procesados %1 de %2 bloques (estimados) del historial de transacciones. - Processed %1 blocks of transaction history. Procesados %1 bloques do historial de transacccións. @@ -491,14 +410,6 @@ Este produto inclúe software desenvolvido polo OpenSSL Project para o uso no Op %n week(s) %n semana%n semanas - - %1 and %2 - - - - %n year(s) - - %1 behind %1 detrás @@ -559,10 +470,6 @@ Dirección: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> O moedeiro está <b>encriptado</b> e actualmente <b>bloqueado</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Ocorriu un erro fatal. Bitcoin non pode continuar en condicións de seguridade e pecharáse. - ClientModel @@ -573,10 +480,6 @@ Dirección: %4 CoinControlDialog - - Coin Control Address Selection - - Quantity: Cantidade: @@ -597,14 +500,6 @@ Dirección: %4 Fee: Pago: - - Low Output: - - - - After Fee: - - Change: Cambiar: @@ -689,10 +584,6 @@ Dirección: %4 Copy priority Copiar prioridade - - Copy low output - - Copy change Copiar cambio @@ -713,10 +604,6 @@ Dirección: %4 medium-high medio-alto - - medium - - low-medium medio-baixo @@ -737,14 +624,6 @@ Dirección: %4 (%1 locked) (%1 bloqueado) - - none - - - - Dust - Limpar - yes Si @@ -753,50 +632,14 @@ Dirección: %4 no non - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - Transactions with higher priority are more likely to get included into a block. As transacción con maior prioridade teñen máis posibilidades de ser incluidas nun bloque - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (sen etiqueta) - - change from %1 (%2) - - (change) (cambio) @@ -841,12 +684,12 @@ Dirección: %4 Modificar dirección para enviar - The entered address "%1" is already in the address book. - A dirección introducida "%1" xa está no libro de direccións. + The entered address "%1" is already in the address book. + A dirección introducida "%1" xa está no libro de direccións. - The entered address "%1" is not a valid Bitcoin address. - A dirección introducida '%1' non é unha dirección Bitcoin válida. + The entered address "%1" is not a valid Bitcoin address. + A dirección introducida '%1' non é unha dirección Bitcoin válida. Could not unlock wallet. @@ -882,10 +725,6 @@ Dirección: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core Core de Bitcoin @@ -894,6 +733,14 @@ Dirección: %4 version versión + + About Bitcoin Core + Sobre Bitcoin core + + + Command-line options + Opcións da liña de comandos + Usage: Emprego: @@ -907,17 +754,13 @@ Dirección: %4 opcións de UI - Set language, for example "de_DE" (default: system locale) - Fixar idioma, por exemplo "de_DE" (por defecto: locale del sistema) + Set language, for example "de_DE" (default: system locale) + Fixar idioma, por exemplo "de_DE" (por defecto: locale del sistema) Start minimized Comezar minimizado - - Set SSL root certificates for payment request (default: -system-) - - Show splash screen on startup (default: 1) Amosar pantalla splash no arranque (por defecto: 1) @@ -933,18 +776,6 @@ Dirección: %4 Welcome Benvido - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - Use the default data directory Empregar o directorio de datos por defecto @@ -954,12 +785,8 @@ Dirección: %4 Empregar un directorio de datos personalizado - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - Erro: O directorio de datos especificado "%1" non pode ser creado. + Bitcoin Core + Core de Bitcoin Error @@ -1023,42 +850,6 @@ Dirección: %4 &Start Bitcoin on system login &Comezar Bitcoin ao facer login no sistema - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - Reset all client options to default. Restaurar todas as opcións de cliente ás por defecto @@ -1071,30 +862,6 @@ Dirección: %4 &Network &Rede - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Abrir automáticamente o porto do cliente Bitcoin no router. Esto so funciona se o teu router soporta UPnP e está habilitado. @@ -1115,14 +882,6 @@ Dirección: %4 Port of the proxy (e.g. 9050) Porto do proxy (exemplo: 9050) - - SOCKS &Version: - &Version de SOCKS: - - - SOCKS version of the proxy (e.g. 5) - Versión SOCKS del proxy (exemplo: 5) - &Window &Xanela @@ -1163,18 +922,6 @@ Dirección: %4 Choose the default subdivision unit to show in the interface and when sending coins. Escolle a unidade de subdivisión por defecto para amosar na interface e ao enviar moedas. - - Whether to show Bitcoin addresses in the transaction list or not. - Se se amosan ou non as direccións Bitcoin na listaxe de transaccións. - - - &Display addresses in transaction list - &Visualizar direccións na listaxe de transaccións - - - Whether to show coin control features or not. - - &OK &OK @@ -1187,26 +934,10 @@ Dirección: %4 default por defecto - - none - - Confirm options reset Confirmar opcións de restaurar - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - The supplied proxy address is invalid. A dirección de proxy suministrada é inválida. @@ -1226,18 +957,10 @@ Dirección: %4 Wallet Moedeiro - - Available: - - Your current spendable balance O teu balance actualmente dispoñible - - Pending: - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance Total de transaccións que aínda teñen que ser confirmadas, e non contan todavía dentro do balance gastable @@ -1274,8 +997,8 @@ Dirección: %4 Manexo de URI - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - Non se pode parsear a URI! Esto pode ser causado por unha dirección Bitcoin inválida ou parámetros da URI malformados. + Invalid payment address %1 + Dirección de pago %1 inválida Requested payment amount of %1 is too small (considered dust). @@ -1285,34 +1008,6 @@ Dirección: %4 Payment request error Erro na petición de pago - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - Refund from %1 Devolución dende %1 @@ -1321,10 +1016,6 @@ Dirección: %4 Error communicating with %1: %2 Erro comunicando con %1: %2 - - Payment request can not be parsed or processed! - - Bad response from server %1 Responsa errónea do servidor %1 @@ -1338,33 +1029,28 @@ Dirección: %4 Erro de solicitude de rede + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Cantidade - Error: Specified data directory "%1" does not exist. - Erro: O directorio de datos especificado "%1" non existe. + %1 h + %1 h - Error: Cannot parse configuration file: %1. Only use key=value syntax. - + %1 m + %1 m - Error: Invalid combination of -regtest and -testnet. - Erro: combinación inválida de -regtest e -testnet. + N/A + N/A - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Introduce unha dirección Bitcoin (exemplo: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget @@ -1379,11 +1065,7 @@ Dirección: %4 Save QR Code Gardar Código QR - - PNG Image (*.png) - - - + RPCConsole @@ -1402,14 +1084,6 @@ Dirección: %4 &Information &Información - - Debug window - - - - General - - Using OpenSSL version Usar versión OpenSSL @@ -1422,10 +1096,6 @@ Dirección: %4 Network Rede - - Name - - Number of connections Número de conexións @@ -1438,10 +1108,6 @@ Dirección: %4 Current number of blocks Número actual de bloques - - Estimated total blocks - Bloques totais estimados - Last block time Hora do último bloque @@ -1518,19 +1184,7 @@ Dirección: %4 %1 GB %1 GB - - %1 m - %1 m - - - %1 h - %1 h - - - %1 h %2 m - %1 h %2 m - - + ReceiveCoinsDialog @@ -1553,22 +1207,6 @@ Dirección: %4 R&euse an existing receiving address (not recommended) R&eutilizar unha dirección para recibir existente (non recomendado) - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - Clear all fields of the form. Limpar todos os campos do formulario @@ -1577,38 +1215,14 @@ Dirección: %4 Clear Limpar - - Requested payments history - - &Request payment &Solicitar pago - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - Copy label Copiar etiqueta - - Copy message - - Copy amount Copiar cantidade @@ -1691,37 +1305,13 @@ Dirección: %4 (no label) (sen etiqueta) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins Moedas Enviadas - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - Quantity: Cantidade: @@ -1742,26 +1332,10 @@ Dirección: %4 Fee: Pago: - - Low Output: - - - - After Fee: - - Change: Cambiar: - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Enviar a múltiples receptores á vez @@ -1822,22 +1396,10 @@ Dirección: %4 Copy priority Copiar prioridade - - Copy low output - - Copy change Copiar cambio - - Total Amount %1 (= %2) - - - - or - - The recipient address is not valid, please recheck. A dirección de recepción non é válida, por favor compróbea. @@ -1858,14 +1420,6 @@ Dirección: %4 Duplicate address found, can only send to each address once per send operation. Atopouse dirección duplicada, so se pode enviar a cada dirección unha vez por operación. - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - Warning: Invalid Bitcoin address Atención: Enderezo Bitcoin non válido @@ -1886,14 +1440,6 @@ Dirección: %4 added as transaction fee engadido como tarifa de transacción - - Payment request expired - A petición de pago expirou - - - Invalid payment address %1 - Dirección de pago %1 inválida - SendCoinsEntry @@ -1905,10 +1451,6 @@ Dirección: %4 Pay &To: Pagar &A: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - A dirección á que enviar o pago (exemplo: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Introduce unha etiqueta para esta dirección para engadila ao teu libro de direccións @@ -1941,10 +1483,6 @@ Dirección: %4 Remove this entry Eliminar esta entrada - - Message: - - This is a verified payment request. Esta é unha solicitude de pago verificada @@ -1953,10 +1491,6 @@ Dirección: %4 Enter a label for this address to add it to the list of used addresses Introduce unha etiqueta para esta dirección para engadila á listaxe de direccións empregadas - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - This is an unverified payment request. Esta é unha solicitude de pago non verificada @@ -1972,15 +1506,7 @@ Dirección: %4 ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog @@ -1995,10 +1521,6 @@ Dirección: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Podes asinar mensaxes coas túas direccións para probar que ti as posees. Ten conta de non asinar nada vago, xa que hai ataques de phishing que tentarán que asines coa túa identidade por riba deles. Asina únicamente declaracións totalmente detalladas coas que esteas de acordo. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - A dirección coa que asinar a mensaxe (exemplo: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Choose previously used address Escoller dirección previamente empregada @@ -2051,10 +1573,6 @@ Dirección: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Introduce a dirección coa que asinar, a mensaxe (asegúrate de copiar exactamente os saltos de liña, espacios, tabulacións, etc.) e a sinatura debaixo para verificar a mensaxe. Ten coidado de non ler máis na sinatura do que hai no mensaxe asinado mesmo, a fin de evitar ser cazado nun ataque de home no medio. - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - A dirección coa que foi firmada a mensaxe (exemplo: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address Verificar a mensaxe para asegurar que foi asinada coa dirección Bitcoin especificada @@ -2068,12 +1586,8 @@ Dirección: %4 Restaurar todos os campos de verificación de mensaxe - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Introduza unha dirección Bitcoin (exemplo: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Click en "Asinar Mensaxe" para xerar sinatura + Click "Sign Message" to generate signature + Click en "Asinar Mensaxe" para xerar sinatura The entered address is invalid. @@ -2152,10 +1666,6 @@ Dirección: %4 Open until %1 Aberto ata %1 - - conflicted - - %1/offline %1/fóra de liña @@ -2172,10 +1682,6 @@ Dirección: %4 Status Estado - - , broadcast through %n node(s) - , propagado a % nodo, propagado a % nodos - Date Data @@ -2208,10 +1714,6 @@ Dirección: %4 Credit Crédito - - matures in %n more block(s) - madura nun bloque máismadura en %n bloques máis - not accepted non aceptado @@ -2245,8 +1747,8 @@ Dirección: %4 Comerciante - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - As moedas xeradas deben madurar %1 bloques antes de que poidan ser gastadas. Cando xeraste este bloque, foi propagado á rede para ser engadido á cadeas de bloques. Se falla ao tentar meterse na cadea, o seu estado cambiará a "non aceptado" e non poderá ser gastado. Esto pode ocorrir ocasionalmente se outro nodo xera un bloque en poucos segundos de diferencia co teu. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + As moedas xeradas deben madurar %1 bloques antes de que poidan ser gastadas. Cando xeraste este bloque, foi propagado á rede para ser engadido á cadeas de bloques. Se falla ao tentar meterse na cadea, o seu estado cambiará a "non aceptado" e non poderá ser gastado. Esto pode ocorrir ocasionalmente se outro nodo xera un bloque en poucos segundos de diferencia co teu. Debug information @@ -2276,10 +1778,6 @@ Dirección: %4 , has not been successfully broadcast yet , non foi propagado con éxito todavía - - Open for %n more block(s) - Abrir para %s bloque máisAbrir para %n bloques máis - unknown descoñecido @@ -2310,14 +1808,6 @@ Dirección: %4 Address Dirección - - Amount - Cantidade - - - Immature (%1 confirmations, will be available after %2) - - Open for %n more block(s) Abrir para %n bloque máisAbrir para %n bloques máis @@ -2338,22 +1828,6 @@ Dirección: %4 Generated but not accepted Xerado pero non aceptado - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with Recibido con @@ -2525,10 +1999,6 @@ Dirección: %4 Address Dirección - - Amount - Cantidade - ID ID @@ -2542,6 +2012,9 @@ Dirección: %4 a + + UnitDisplayStatusBarControl + WalletFrame @@ -2593,18 +2066,6 @@ Dirección: %4 bitcoin-core - - Usage: - Emprego: - - - List commands - Listar comandos - - - Get help for a command - Obter axuda para un comando - Options: Opcións: @@ -2645,10 +2106,6 @@ Dirección: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Número de segundos para manter sen reconectar aos pares con mal comportamento (por defecto: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Ocorreu un erro mentres se establecía o porto RPC %u para escoitar sobre IPv4: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Escoitar conexións JSON-RPC no <porto> (por defecto: 8332 ou testnet: 18332) @@ -2657,10 +2114,6 @@ Dirección: %4 Accept command line and JSON-RPC commands Aceptar liña de comandos e comandos JSON-RPC - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Executar no fondo como un demo e aceptar comandos @@ -2683,7 +2136,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, debes fixar unha rpcpassword no arquivo de configuración: %s @@ -2694,37 +2147,17 @@ rpcpassword=%s O nome do usuario e o contrasinal DEBEN NON ser o mesmo. Se o arquivo non existe, debes crealo con permisos de so lectura para o propietario. Tamén é recomendable fixar alertnotify de modo que recibas notificación dos problemas; -por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Cifradores aceptables (por defecto: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Ocorreu un erro mentres se establecía o porto RPC %u para escoitar sobre IPv6, voltando a IPv4: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Enlazar a unha dirección dada e escoitar sempre nela. Emprega a notación [host]:post para IPv6 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Entra en modo de test de regresión, que emprega unha cadea especial na que os bloques poden ser resoltos instantáneamente. Esto está pensado para ferramentes de testing de regresión e desenvolvemento de aplicacións. - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Erro: A transacción foi rexeitada! Esto podería suceder se unha das moedas do teu moedeiro xa foi gastada, como se usas unha copia de wallet.dat e hai moedas que se gastaron na copia pero non foron marcadas como gastadas aquí. @@ -2737,50 +2170,14 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Executar comando cando unha transacción do moedeiro cambia (%s no comando é substituído por TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Esta é unha build de test pre-lanzamento - emprégaa baixo o teu propio risco - non empregar para minado ou aplicacións de comerciantes - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Precaución: -paytxfee está posto moi algo! Esta é a tarifa de transacción que ti pagarás se envías unha transacción. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Precaución; Por favor revisa que a data e hora do teu ordenador son correctas! Se o teu reloxo está equivocato Bitcoin non funcionará adecuadamente. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Precaución: A rede non parece estar totalmente de acordo! Algúns mineitos parecen estar experimentando problemas. @@ -2797,14 +2194,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. Precaución: wallet.dat corrupto, datos salvagardados! O wallet.dat orixinal foi gardado como wallet.{timestamp}.bak en %s; se o teu balance ou transaccións son incorrectas deberías restauralas dende unha copia de seguridade. - - (default: 1) - - - - (default: wallet.dat) - - <category> can be: <categoría> pode ser: @@ -2813,54 +2202,22 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Attempt to recover private keys from a corrupt wallet.dat Tentar recuperar claves privadas dende un wallet.dat corrupto - - Bitcoin Core Daemon - - Block creation options: Opcións de creación de bloque: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) Conectar so ao(s) nodo(s) especificado(s) - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - Conectar a JSON-RPC no <porto> (por defecto: 8332 ou testnet: 18332) - - - Connection options: - - Corrupted block database detected Detectada base de datos de bloques corrupta. - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - Discover own IP address (default: 1 when listening and no -externalip) Descobrir dirección IP propia (por defecto: 1 se á escoita e non -externalip) - - Do not load the wallet and disable wallet RPC calls - - Do you want to rebuild the block database now? Queres reconstruír a base de datos de bloques agora? @@ -2937,22 +2294,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write undo data Fallou a escritura dos datos para desfacer - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - Atopar pares usando lookup DNS (por defecto: 1 agás -connect) - - - Force safe mode (default: 0) - - Generate coins (default: 0) Xerar moedas (por defecto: 0) @@ -2961,50 +2302,22 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. How many blocks to check at startup (default: 288, 0 = all) Cantos bloques para chequear ao arrancar (por defecto: 288, 0 = todos) - - If <category> is not supplied, output all debugging information. - - - - Importing... - - Incorrect or no genesis block found. Wrong datadir for network? Bloque genesis incorrecto o no existente. Datadir erróneo para a rede? - Invalid -onion address: '%s' - Dirección -onion inválida: '%s' + Invalid -onion address: '%s' + Dirección -onion inválida: '%s' Not enough file descriptors available. Non hai suficientes descritores de arquivo dispoñibles. - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - Rebuild block chain index from current blk000??.dat files Reconstruír índice de cadea de bloque dende os ficheiros actuais blk000??.dat - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - Set the number of threads to service RPC calls (default: 4) Fixar o número de fíos para as chamadas aos servicios RPC (por defecto: 4) @@ -3013,18 +2326,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Specify wallet file (within data directory) Especificar arquivo do moedeiro (dentro do directorio de datos) - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - Emprego (desaconsellado, usar bitcoin-cli) - Verifying blocks... Verificando bloques... @@ -3033,22 +2334,10 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Verifying wallet... Verificando moedeiro... - - Wait for RPC server to start - - Wallet %s resides outside data directory %s O moedeiro %s reside fóra do directorio de datos %s - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - You need to rebuild the database using -reindex to change -txindex Precisas reconstruír a base de datos empregando -reindex para cambiar -txindex @@ -3057,41 +2346,21 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Imports blocks from external blk000??.dat file Importa bloques dende arquivos blk000??.dat externos - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Executar comando cando se recibe unha alerta relevante ou vemos un fork realmente longo (%s no cmd é substituído pola mensaxe) - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information Información - Invalid amount for -minrelaytxfee=<amount>: '%s' - Cantidade inválida para -minrelaytxfee=<cantidade>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Cantidade inválida para -minrelaytxfee=<cantidade>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - Cantidade inválida para -mintxfee=<cantidade>: '%s' - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - + Invalid amount for -mintxfee=<amount>: '%s' + Cantidade inválida para -mintxfee=<cantidade>: '%s' Maintain a full transaction index (default: 0) @@ -3113,42 +2382,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Only connect to nodes in network <net> (IPv4, IPv6 or Tor) Conectar so a nodos na rede <net> (IPv4, IPv6 ou Tor) - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - Opcións SSL: (ver ńa Wiki Bitcoin as instrucción de configuración de SSL) - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file Enviar traza/información de depuración á consola en lugar de ao arquivo debug.log @@ -3157,18 +2390,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Set minimum block size in bytes (default: 0) Fixar tamaño mínimo de bloque en bytes (por defecto: 0) - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - Shrink debug.log file on client startup (default: 1 when no -debug) Recortar o arquivo debug.log ao arrancar o cliente (por defecto: 1 cando no-debug) @@ -3181,10 +2402,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Specify connection timeout in milliseconds (default: 5000) Especificar tempo límite da conexión en milisegundos (por defecto: 5000) - - Start Bitcoin Core Daemon - - System error: Erro do sistema: @@ -3221,18 +2438,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: This version is obsolete, upgrade required! Precaución: Esta versión é obsoleta, precísase unha actualización! - - Zapping all transactions from wallet... - - - - on startup - - - - version - versión - wallet.dat corrupt, salvage failed wallet.dat corrupto, fallou o gardado @@ -3241,14 +2446,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Password for JSON-RPC connections Contrasinal para conexións JSON-RPC - - Allow JSON-RPC connections from specified IP address - Permitir conexións JSON-RPC dende direccións IP especificadas - - - Send commands to node running on <ip> (default: 127.0.0.1) - Enviar comandos a nodo executando na <ip> (por defecto: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Executar comando cando o mellor bloque cambie (%s no comando é sustituído polo hash do bloque) @@ -3281,10 +2478,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message Esta mensaxe de axuda - - Unable to bind to %s on this computer (bind returned error %d, %s) - Imposible enlazar con %s neste ordenador (enlace devolveu erro %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Permitir lookup de DNS para -addnote, -seednote e -connect @@ -3297,41 +2490,29 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted Erro cargando wallet.dat: Moedeiro corrupto - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Erro cargando wallet.dat: O moedeiro precisa unha versión máis nova de Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - Precísase rescribir o moedeiro: reinicie Bitcoin para completar - Error loading wallet.dat Erro cargando wallet.dat - Invalid -proxy address: '%s' - Dirección -proxy inválida: '%s' + Invalid -proxy address: '%s' + Dirección -proxy inválida: '%s' - Unknown network specified in -onlynet: '%s' - Rede descoñecida especificada en -onlynet: '%s' + Unknown network specified in -onlynet: '%s' + Rede descoñecida especificada en -onlynet: '%s' - Unknown -socks proxy version requested: %i - Versión solicitada de proxy -socks descoñecida: %i + Cannot resolve -bind address: '%s' + Non se pode resolver a dirección -bind: '%s' - Cannot resolve -bind address: '%s' - Non se pode resolver a dirección -bind: '%s' + Cannot resolve -externalip address: '%s' + Non se pode resolver dirección -externalip: '%s' - Cannot resolve -externalip address: '%s' - Non se pode resolver dirección -externalip: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Cantidade inválida para -paytxfee=<cantidade>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Cantidade inválida para -paytxfee=<cantidade>: '%s' Invalid amount @@ -3377,13 +2558,5 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error Erro - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Debes fixar rpcpassword=<contrasinal> no arquivo de configuración: -%s -Se o arquivo non existe, debes crealo con permisos de so lectura para o propietario. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_gu_IN.ts b/src/qt/locale/bitcoin_gu_IN.ts index ed4a9265e4..b7b091aa39 100644 --- a/src/qt/locale/bitcoin_gu_IN.ts +++ b/src/qt/locale/bitcoin_gu_IN.ts @@ -1,3368 +1,110 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage - - Double-click to edit address or label - - - - Create a new address - - - - &New - - - - Copy the currently selected address to the system clipboard - - - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - - - &Delete - - - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - - - Comma separated file (*.csv) - - - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel - - Label - - - - Address - - - - (no label) - - - + AskPassphraseDialog - - Passphrase Dialog - - - - Enter passphrase - - - - New passphrase - - - - Repeat new passphrase - - - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - - - - Encrypt wallet - - - - This operation needs your wallet passphrase to unlock the wallet. - - - - Unlock wallet - - - - This operation needs your wallet passphrase to decrypt the wallet. - - - - Decrypt wallet - - - - Change passphrase - - - - Enter the old and new passphrase to the wallet. - - - - Confirm wallet encryption - - - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - - - Wallet encrypted - - - - Bitcoin 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. - - - - Wallet encryption failed - - - - Wallet encryption failed due to an internal error. Your wallet was not encrypted. - - - - The supplied passphrases do not match. - - - - Wallet unlock failed - - - - The passphrase entered for the wallet decryption was incorrect. - - - - Wallet decryption failed - - - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - - - Synchronizing with network... - - - - &Overview - - - - Node - - - - Show general overview of wallet - - - - &Transactions - - - - Browse transaction history - - - - E&xit - - - - Quit application - - - - Show information about Bitcoin - - - - About &Qt - - - - Show information about Qt - - - - &Options... - - - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - - - Change the passphrase used for wallet encryption - - - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - - - &File - - - - &Settings - - - - &Help - - - - Tabs toolbar - - - - [testnet] - - - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - - - %n active connection(s) to Bitcoin network - - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - - - Error - - - - Warning - - - - Information - - - - Up to date - - - - Catching up... - - - - Sent transaction - - - - Incoming transaction - - - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> - - - - Wallet is <b>encrypted</b> and currently <b>locked</b> - - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - - + ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - - - Amount - - - - Address - - - - Date - - - - Confirmations - - - - Confirmed - - - - Priority - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - - - (no label) - - - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog - - Edit Address - - - - &Label - - - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - - - &Address - - - - New receiving address - - - - New sending address - - - - Edit receiving address - - - - Edit sending address - - - - The entered address "%1" is already in the address book. - - - - The entered address "%1" is not a valid Bitcoin address. - - - - Could not unlock wallet. - - - - New key generation failed. - - - + FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - - - version - - - - Usage: - - - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - - - Error - - - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog - - Options - - - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage - - Form - - - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - - - <b>Recent transactions</b> - - - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - - Bitcoin - - - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - - - &Label: - - - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - - - Copy label - - - - Copy message - - - - Copy amount - - - + ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - - - Address - - - - Amount - - - - Label - - - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel - - Date - - - - Label - - - - Message - - - - Amount - - - - (no label) - - - - (no message) - - - - (no amount) - - - + SendCoinsDialog - - Send Coins - - - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - - - Send to multiple recipients at once - - - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - - - Balance: - - - - Confirm the send action - - - - S&end - - - - Confirm send coins - - - - %1 to %2 - - - - Copy quantity - - - - Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - - - The amount to pay must be larger than 0. - - - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - - - (no label) - - - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry - - A&mount: - - - - Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Enter a label for this address to add it to your address book - - - - &Label: - - - - Choose previously used address - - - - This is a normal payment. - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - - - [testnet] - - - + TrafficGraphWidget - - KB/s - - - + TransactionDesc - - Open until %1 - - - - conflicted - - - - %1/offline - - - - %1/unconfirmed - - - - %1 confirmations - - - - Status - - - - , broadcast through %n node(s) - - - - Date - - - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - - - Amount - - - - true - - - - false - - - - , has not been successfully broadcast yet - - - - Open for %n more block(s) - - - - unknown - - - + TransactionDescDialog - - Transaction details - - - - This pane shows a detailed description of the transaction - - - + TransactionTableModel - - Date - - - - Type - - - - Address - - - - Amount - - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - - - Open until %1 - - - - Confirmed (%1 confirmations) - - - - This block was not received by any other nodes and will probably not be accepted! - - - - Generated but not accepted - - - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - - - Received with - - - - Received from - - - - Sent to - - - - Payment to yourself - - - - Mined - - - - (n/a) - - - - Transaction status. Hover over this field to show number of confirmations. - - - - Date and time that the transaction was received. - - - - Type of transaction. - - - - Destination address of transaction. - - - - Amount removed from or added to balance. - - - + TransactionView - - All - - - - Today - - - - This week - - - - This month - - - - Last month - - - - This year - - - - Range... - - - - Received with - - - - Sent to - - - - To yourself - - - - Mined - - - - Other - - - - Enter address or label to search - - - - Min amount - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - - - Comma separated file (*.csv) - - - - Confirmed - - - - Date - - - - Type - - - - Label - - - - Address - - - - Amount - - - - ID - - - - Range: - - - - to - - - + + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel - - Send Coins - - - + WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - - - Options: - - - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - - - Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - - - Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - - - Done loading - - - - To use the %s option - - - - Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - - + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_he.ts b/src/qt/locale/bitcoin_he.ts index ae13df4524..ae96d9f570 100644 --- a/src/qt/locale/bitcoin_he.ts +++ b/src/qt/locale/bitcoin_he.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - על אודות ליבת ביטקוין - - - <b>Bitcoin Core</b> version - <b>קליינט ביטקוין</b> גירסאת - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -זוהי תוכנה ניסיונית. - -מופצת תחת רישיון התוכנה MIT/X11, ראה את הקובץ המצורף COPYING או http://www.opensource.org/licenses/mit-license.php. - -המוצר הזה כולל תוכנה שפותחה ע"י פרויקט OpenSSL לשימוש בתיבת הכלים OpenSSL (http://www.openssl.org/) ותוכנה קריפטוגרפית שנכתבה ע"י אריק יאנג (eay@cryptsoft.com) ותוכנת UPnP שנכתבה ע"י תומס ברנרד. - - - Copyright - זכויות יוצרים - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -130,11 +93,7 @@ This product includes software developed by the OpenSSL Project for use in the O Exporting Failed הייצוא נכשל - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -168,10 +127,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase חזור על הסיסמה החדשה - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - הכנס את הסיסמה החדשה לארנק. <br/>אנא השתמש בסיסמה המכילה <b>10 תוים אקראיים או יותר</b>, או <b>שמונה מילים או יותר</b>. - Encrypt wallet הצפן ארנק @@ -271,10 +226,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Overview &סקירה - - Node - - Show general overview of wallet הצג סקירה כללית של הארנק @@ -295,10 +246,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application סגור תוכנה - - Show information about Bitcoin - הצג מידע על ביטקוין - About &Qt אודות Qt @@ -323,18 +270,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Change Passphrase... שנה סיסמא - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - Importing blocks from disk... מייבא בלוקים מהדיסק... @@ -449,32 +384,12 @@ This product includes software developed by the OpenSSL Project for use in the O Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - תוכנת ביטקוין - - - %n active connection(s) to Bitcoin network - חיבור פעיל אחד לרשת הביטקוין%n חיבורים פעילים לרשת הביטקוין + פתח ביטקוין: URI או בקשת תשלום No block source available... אין קוד נתון - - Processed %1 of %2 (estimated) blocks of transaction history. - %1 מתוך %2 (משוער) בלוקים של הסטוריית פעולות עובדו. - Processed %1 blocks of transaction history. הושלם עיבוד של %1 בלוקים של היסטוריית פעולות. @@ -491,18 +406,6 @@ This product includes software developed by the OpenSSL Project for use in the O %n week(s) %n שבוע%n שבועות - - %1 and %2 - - - - %n year(s) - - - - %1 behind - 1% מאחור - Last received block was generated %1 ago. הבלוק האחרון שהתקבל נוצר לפני %1 @@ -558,10 +461,6 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> הארנק <b>מוצפן</b> וכרגע <b>נעול</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - שגיאה סופנית אירעה. ביטקוין אינו יכול להמשיך לפעול בבטחה ולכן ייסגר. - ClientModel @@ -574,7 +473,7 @@ Address: %4 CoinControlDialog Coin Control Address Selection - + בחירת כתובת שליטת מטבעות Quantity: @@ -596,10 +495,6 @@ Address: %4 Fee: תשלום: - - Low Output: - - After Fee: לאחר עמלה: @@ -662,11 +557,11 @@ Address: %4 Lock unspent - + נעל יתרה Unlock unspent - + פתח יתרה Copy quantity @@ -688,10 +583,6 @@ Address: %4 Copy priority העתק קדימות - - Copy low output - - Copy change העתק עודף @@ -732,18 +623,6 @@ Address: %4 lowest הכי נמוך - - (%1 locked) - - - - none - - - - Dust - אבק - yes כן @@ -768,26 +647,6 @@ Address: %4 Transactions with higher priority are more likely to get included into a block. העברות עם עדיפות גבוהה, יותר סיכוי שיכנסו לתוך הבלוק - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - התווית הזו הופכת לאדומה, אם אחד מהנמענים מקבל סכום אשר קטן מ 1% - - - This means a fee of at least %1 is required. - זה אומר שצריך לפחות 1% עמלה - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (ללא תוית) @@ -840,12 +699,12 @@ Address: %4 ערוך כתובת לשליחה - The entered address "%1" is already in the address book. - הכתובת שהכנסת "%1" כבר נמצאת בפנקס הכתובות. + The entered address "%1" is already in the address book. + הכתובת שהכנסת "%1" כבר נמצאת בפנקס הכתובות. - The entered address "%1" is not a valid Bitcoin address. - הכתובת שהוכנסה "%1" אינה כתובת ביטקוין תקינה. + The entered address "%1" is not a valid Bitcoin address. + הכתובת שהוכנסה "%1" אינה כתובת ביטקוין תקינה. Could not unlock wallet. @@ -881,10 +740,6 @@ Address: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core ליבת ביטקוין @@ -893,6 +748,14 @@ Address: %4 version גרסה + + About Bitcoin Core + על אודות ליבת ביטקוין + + + Command-line options + אפשרויות שורת פקודה + Usage: שימוש: @@ -906,26 +769,18 @@ Address: %4 אפשרויות ממשק - Set language, for example "de_DE" (default: system locale) - קבע שפה, למשל "he_il" (ברירת מחדל: שפת המערכת) + Set language, for example "de_DE" (default: system locale) + קבע שפה, למשל "he_il" (ברירת מחדל: שפת המערכת) Start minimized התחל ממוזער - - Set SSL root certificates for payment request (default: -system-) - - Show splash screen on startup (default: 1) הצג מסך פתיחה בעת הפעלה (ברירת מחדל: 1) - - Choose data directory on startup (default: 0) - - - + Intro @@ -953,12 +808,8 @@ Address: %4 השתמש בספריית מידע מותאמת אישית: - Bitcoin - ביטקוין - - - Error: Specified data directory "%1" can not be created. - שגיאה: אי אפשר ליצור את התיקיה "%1" + Bitcoin Core + ליבת ביטקוין Error @@ -966,11 +817,11 @@ Address: %4 GB of free space available - ג"ב של שטח אחסון פנוי + ג"ב של שטח אחסון פנוי (of %1GB needed) - (מתוך %1 ג"ב נחוצים) + (מתוך %1 ג"ב נחוצים) @@ -981,7 +832,7 @@ Address: %4 Open payment request from URI or file - + פתח בקשת תשלום מ-URI או קובץ URI: @@ -1022,42 +873,10 @@ Address: %4 &Start Bitcoin on system login התחל את ביטקוין בעת התחברות למערכת - - Size of &database cache - - MB מגה בייט - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - Reset all client options to default. אפס כל אפשרויות התוכנה לברירת המחדל. @@ -1070,33 +889,9 @@ Address: %4 &Network רשת - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - פתח את פורט ביטקוין בנתב באופן אוטומטי. עובד רק אם UPnP מאופשר ונתמך ע"י הנתב. + פתח את פורט ביטקוין בנתב באופן אוטומטי. עובד רק אם UPnP מאופשר ונתמך ע"י הנתב. Map port using &UPnP @@ -1114,14 +909,6 @@ Address: %4 Port of the proxy (e.g. 9050) הפורט של הפרוקסי (למשל 9050) - - SOCKS &Version: - גרסת SOCKS: - - - SOCKS version of the proxy (e.g. 5) - גרסת SOCKS של הפרוקסי (למשל 5) - &Window חלון @@ -1162,17 +949,9 @@ Address: %4 Choose the default subdivision unit to show in the interface and when sending coins. בחר את ברירת המחדל ליחידת החלוקה אשר תוצג בממשק ובעת שליחת מטבעות. - - Whether to show Bitcoin addresses in the transaction list or not. - האם להציג כתובות ביטקוין ברשימת הפעולות או לא. - - - &Display addresses in transaction list - הצג כתובות ברשימת הפעולות - Whether to show coin control features or not. - + הצג תכונות שליטת מטבע או לא. &OK @@ -1186,26 +965,10 @@ Address: %4 default ברירת מחדל - - none - - Confirm options reset אשר את איפוס האפשרויות - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - The supplied proxy address is invalid. כתובת הפרוקסי שסופקה אינה תקינה. @@ -1225,18 +988,10 @@ Address: %4 Wallet ארנק - - Available: - - Your current spendable balance היתרה הזמינה הנוכחית - - Pending: - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance הסכום הכולל של פעולות שטרם אושרו, ועוד אינן נספרות בחישוב היתרה הזמינה @@ -1273,8 +1028,8 @@ Address: %4 תפעול URI - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - לא ניתן לנתח URI! זה יכול להיגרם כתוצאה מכתובת ביטקוין לא תקינה או פרמטרי URI חסרי צורה תקינה. + Invalid payment address %1 + כתובת תשלום שגויה %1 Requested payment amount of %1 is too small (considered dust). @@ -1288,26 +1043,6 @@ Address: %4 Cannot start bitcoin: click-to-pay handler לא ניתן להתחיל את ביטקוין: מפעיל לחץ-לתשלום - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - Unverified payment requests to custom payment scripts are unsupported. בקשות לתשלום לסקריפטיי תשלום מותאמים אישית אינן נתמכות. @@ -1320,10 +1055,6 @@ Address: %4 Error communicating with %1: %2 שגיאה בתקשורת עם %1: %2 - - Payment request can not be parsed or processed! - - Bad response from server %1 מענה שגוי משרת %1 @@ -1337,33 +1068,24 @@ Address: %4 שגיאת בקשת שרת + + PeerTableModel + QObject - Bitcoin - ביטקוין + Amount + כמות - Error: Specified data directory "%1" does not exist. - שגיאה: הספריה "%1" לא קיימת. + %1 h + %1 שעות - Error: Cannot parse configuration file: %1. Only use key=value syntax. - + N/A + N/A - - Error: Invalid combination of -regtest and -testnet. - שגיאה: שילוב בלתי חוקי של regtest- ו testnet-. - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - הכנס כתובת ביטקוין (למשל 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget @@ -1437,10 +1159,6 @@ Address: %4 Current number of blocks מספר הבלוקים הנוכחי - - Estimated total blocks - מספר כולל משוער של בלוקים - Last block time זמן הבלוק האחרון @@ -1515,21 +1233,9 @@ Address: %4 %1 GB - %1 ג'יגה בייט + %1 ג'יגה בייט - - %1 m - 1% דקות - - - %1 h - %1 שעות - - - %1 h %2 m - %1 שעות %2 דקות - - + ReceiveCoinsDialog @@ -1552,22 +1258,6 @@ Address: %4 R&euse an existing receiving address (not recommended) ש&ימוש חוזר בכתובת קבלה קיימת(לא מומלץ) - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - Clear all fields of the form. נקה את כל השדות @@ -1576,17 +1266,13 @@ Address: %4 Clear נקה - - Requested payments history - - &Request payment &בקש תשלום Show the selected request (does the same as double clicking an entry) - + הצג בקשות נבחרות (דומה ללחיצה כפולה על רשומה) Show @@ -1594,7 +1280,7 @@ Address: %4 Remove the selected entries from the list - + הסר הרשומות הנבחרות מהרשימה Remove @@ -1604,10 +1290,6 @@ Address: %4 Copy label העתק תוית - - Copy message - - Copy amount העתק כמות @@ -1694,11 +1376,7 @@ Address: %4 (no message) (אין הודעות) - - (no amount) - - - + SendCoinsDialog @@ -1741,10 +1419,6 @@ Address: %4 Fee: תשלום: - - Low Output: - - After Fee: לאחר עמלה: @@ -1753,10 +1427,6 @@ Address: %4 Change: שינוי: - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - Custom change address כתובת לעודף מותאמת אישית @@ -1821,18 +1491,10 @@ Address: %4 Copy priority העתק קדימות - - Copy low output - - Copy change העתק עודף - - Total Amount %1 (= %2) - - or או @@ -1861,22 +1523,10 @@ Address: %4 Transaction creation failed! יצירת הפעולה נכשלה! - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (ללא תוית) - - Warning: Unknown change address - - Are you sure you want to send? האם אכן לשלוח? @@ -1885,14 +1535,6 @@ Address: %4 added as transaction fee הוסף מחיר טיפול - - Payment request expired - תוקף בקשת תשלום פג - - - Invalid payment address %1 - כתובת תשלום שגויה %1 - SendCoinsEntry @@ -1904,10 +1546,6 @@ Address: %4 Pay &To: שלם &ל: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - הכתובת שאליה ישלח התשלום (למשל 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book הכנס תוית לכתובת הזאת כדי להכניס לפנקס הכתובות @@ -1936,10 +1574,6 @@ Address: %4 Alt+P Alt+P - - Remove this entry - - Message: הודעה: @@ -1952,10 +1586,6 @@ Address: %4 Enter a label for this address to add it to the list of used addresses הקלד תווית עבור כתובת זו בכדי להוסיף אותה לרשימת הכתובות בשימוש - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - This is an unverified payment request. זוהי בקשת תשלום בלתי־מאומתת. @@ -1971,10 +1601,6 @@ Address: %4 ShutdownWindow - - Bitcoin Core is shutting down... - - Do not shut down the computer until this window disappears. אין לכבות את המחשב עד שחלון זה נעלם. @@ -1994,10 +1620,6 @@ Address: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. אתה יכול לחתום על הודעות עם הכתובות שלך כדי להוכיח שהן בבעלותך. היזהר לא לחתום על משהו מעורפל, שכן התקפות פישינג עשויות לגרום לך בעורמה למסור את זהותך. חתום רק על אמרות מפורטות לחלוטין שאתה מסכים עימן. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - הכתובת איתה לחתום על ההודעה (למשל 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Choose previously used address בחר כתובת שהייתה בשימוש @@ -2048,11 +1670,7 @@ Address: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - הכנס למטה את הכתובת החותמת, ההודעה (ודא שאתה מעתיק מעברי שורה, רווחים, טאבים וכו' באופן מדויק) והחתימה כדי לאמת את ההודעה. היזהר לא לפרש את החתימה כיותר ממה שמופיע בהודעה החתומה בעצמה, כדי להימנע מליפול קורבן למתקפת איש-באמצע. - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - הכתובת איתה ההודעה נחתמה (למשל 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + הכנס למטה את הכתובת החותמת, ההודעה (ודא שאתה מעתיק מעברי שורה, רווחים, טאבים וכו' באופן מדויק) והחתימה כדי לאמת את ההודעה. היזהר לא לפרש את החתימה כיותר ממה שמופיע בהודעה החתומה בעצמה, כדי להימנע מליפול קורבן למתקפת איש-באמצע. Verify the message to ensure it was signed with the specified Bitcoin address @@ -2067,12 +1685,8 @@ Address: %4 אפס את כל שדות אימות הודעה - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - הכנס כתובת ביטקוין (למשל 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - לחץ "חתום על ההודעה" כדי לחולל חתימה + Click "Sign Message" to generate signature + לחץ "חתום על ההודעה" כדי לחולל חתימה The entered address is invalid. @@ -2129,10 +1743,6 @@ Address: %4 Bitcoin Core ליבת ביטקוין - - The Bitcoin Core developers - - [testnet] [רשת-בדיקה] @@ -2151,10 +1761,6 @@ Address: %4 Open until %1 פתוח עד %1 - - conflicted - - %1/offline %1/מנותק @@ -2171,10 +1777,6 @@ Address: %4 Status מצב - - , broadcast through %n node(s) - , הופץ דרך צומת אחד, הופץ דרך %n צמתים - Date תאריך @@ -2207,10 +1809,6 @@ Address: %4 Credit זיכוי - - matures in %n more block(s) - מבשיל בעוד בלוק אחדמבשיל בעוד %n בלוקים - not accepted לא התקבל @@ -2244,8 +1842,8 @@ Address: %4 סוחר - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - מטבעות חדשים שנוצרו חייבים להבשיל במשך %1 בלוקים לפני שניתן לנצל אותם. כשבלוק זה נוצר הוא שודר ברשת על מנת שייכנס לשרשרת הבלוקים. במקרה והוא לא ייכנס לשרשרת, מצבו ישתנה ל"לא התקבל" ולא ניתן יהיה לנצלו. זה יכול לקרות מדי פעם אם במקרה צומת אחרת ייצרה בלוק בהבדל של שניות בודדות ממך. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + מטבעות חדשים שנוצרו חייבים להבשיל במשך %1 בלוקים לפני שניתן לנצל אותם. כשבלוק זה נוצר הוא שודר ברשת על מנת שייכנס לשרשרת הבלוקים. במקרה והוא לא ייכנס לשרשרת, מצבו ישתנה ל"לא התקבל" ולא ניתן יהיה לנצלו. זה יכול לקרות מדי פעם אם במקרה צומת אחרת ייצרה בלוק בהבדל של שניות בודדות ממך. Debug information @@ -2309,14 +1907,6 @@ Address: %4 Address כתובת - - Amount - כמות - - - Immature (%1 confirmations, will be available after %2) - - Open for %n more block(s) פתח למשך בלוק %n יותרפתח למשך %n בלוקים נוספים @@ -2337,22 +1927,6 @@ Address: %4 Generated but not accepted נוצר אך לא התקבל - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with התקבל עם @@ -2488,10 +2062,6 @@ Address: %4 Exporting Failed הייצוא נכשל - - There was an error trying to save the transaction history to %1. - - Exporting Successful הייצוא בוצע בהצלחה @@ -2524,10 +2094,6 @@ Address: %4 Address כתובת - - Amount - כמות - ID מזהה @@ -2541,6 +2107,9 @@ Address: %4 אל + + UnitDisplayStatusBarControl + WalletFrame @@ -2577,14 +2146,6 @@ Address: %4 Backup Failed גיבוי נכשל - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - Backup Successful גיבוי הושלם בהצלחה @@ -2592,18 +2153,6 @@ Address: %4 bitcoin-core - - Usage: - שימוש: - - - List commands - רשימת פקודות - - - Get help for a command - קבל עזרה עבור פקודה - Options: אפשרויות: @@ -2644,10 +2193,6 @@ Address: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) מספר שניות למנוע מעמיתים הנוהגים שלא כהלכה מלהתחבר מחדש (ברירת מחדל: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - אירעה שגיאה בעת הגדרת פורט RPC %u להאזנה ב-IPv4: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) האזן לחיבורי JSON-RPC ב- <port> (ברירת מחדל: 8332 או רשת בדיקה: 18332) @@ -2656,10 +2201,6 @@ Address: %4 Accept command line and JSON-RPC commands קבל פקודות משורת הפקודה ו- JSON-RPC - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands רוץ ברקע כדימון וקבל פקודות @@ -2682,7 +2223,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, עליך לקבוע סיסמת RPC בקובץ הקונפיגורציה: %s @@ -2693,37 +2234,17 @@ rpcpassword=%s אסור ששם המשתמש והסיסמא יהיו זהים. אם הקובץ אינו קיים, צור אותו עם הרשאות קריאה לבעלים בלבד. זה מומלץ לסמן alertnotify כדי לקבל דיווח על תקלות; -למשל: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +למשל: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) צפנים קבילים (ברירת מחדל: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - אירעה שגיאה בעת הגדרת פורט RPC %u להאזנה ב-IPv6, נסוג ל-IPv4: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 קשור עם כתובת נתונה והאזן לה תמיד. השתמש בסימון [host]:port עבוד IPv6. - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - כניסה למצב בדיקת רגרסיה, בה נעשה שימוש בשרשרת מיוחדת המאפשרת פתרון מיידי של בלוקים. מצב זה מיועד לכלי בדיקת רגרסיה ופיתוח תוכנה. - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. שגיאה: הפעולה נדחתה! זה עלול לקרות אם כמה מהמטבעות בארנק שלך כבר נוצלו, למשל אם השתמשת בעותק של wallet.dat ומטבעות נשלחו בעותק אך לא סומנו כמנוצלות כאן. @@ -2736,50 +2257,14 @@ rpcpassword=%s Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) בצע פקודה כאשר פעולת ארנק משתנה (%s ב cmd יוחלף ב TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications זוהי בניית ניסיון טרום-שחרור - השימוש בה על אחריותך - אין להשתמש לצורך כריה או יישומי מסחר - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. אזהרה: -paytxfee נקבע לערך מאד גבוה! זוהי עמלת הפעולה שתשלם אם אתה שולח פעולה. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - אזהרה: אנא בדוק שהתאריך והשעה של המחשב שלך נכונים! אם השעון שלך אינו נכון ביטקוין לא יעבוד כראוי. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. אזהרה: נראה שלא כל הרשת מסכימה! נראה שישנם כורים אשר נתקלים בבעיות. @@ -2796,46 +2281,18 @@ rpcpassword=%s Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. אזהרה: קובץ wallet.dat מושחת, המידע חולץ! קובץ wallet.dat המקורח נשמר כ - wallet.{timestamp}.bak ב - %s; אם המאזן או הפעולות שגויים עליך לשחזר גיבוי. - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - Attempt to recover private keys from a corrupt wallet.dat נסה לשחזר מפתחות פרטיים מקובץ wallet.dat מושחת. - - Bitcoin Core Daemon - - Block creation options: אפשרויות יצירת בלוק: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) התחבר רק לצמתים המצוינים - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - התחבר ל JSON-RPC ב <port> (ברירת מחדל: 8332 או ברשת בדיקה: 18332) - Connection options: הגדרות חיבור: @@ -2844,22 +2301,10 @@ rpcpassword=%s Corrupted block database detected התגלה מסד נתוני בלוקים לא תקין - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - Discover own IP address (default: 1 when listening and no -externalip) גלה את כתובת ה-IP העצמית (ברירת מחדל: 1 כשמאזינים וללא -externalip) - - Do not load the wallet and disable wallet RPC calls - - Do you want to rebuild the block database now? האם תרצה כעט לבנות מחדש את מסד נתוני הבלוקים? @@ -2936,22 +2381,6 @@ rpcpassword=%s Failed to write undo data כתיבת נתוני ביטול נכשלה - - Fee per kB to add to transactions you send - עמלה לכל kB להוסיף לפעולות שאתה שולח - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - מצא עמיתים ע"י חיפוש DNS (ברירת מחדל: 1 ללא -connect) - - - Force safe mode (default: 0) - - Generate coins (default: 0) ייצר מטבעות (ברגיל: 0) @@ -2960,50 +2389,22 @@ rpcpassword=%s How many blocks to check at startup (default: 288, 0 = all) מספר הבלוקים לבדוק בעת אתחול (ברירת מחדל: 288, 0 = כולם) - - If <category> is not supplied, output all debugging information. - - - - Importing... - - Incorrect or no genesis block found. Wrong datadir for network? בלוק בראשית הינו שגוי או לא נמצא. ספריית מידע לא נכונה עבור הרשת? - Invalid -onion address: '%s' - כתובת onion- שגויה: '%s' + Invalid -onion address: '%s' + כתובת onion- שגויה: '%s' Not enough file descriptors available. אין מספיק מידע על הקובץ - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - Rebuild block chain index from current blk000??.dat files בנה מחדש את אינדק שרשרת הבלוקים מקבצי ה-blk000??.dat הנוכחיים. - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - Set the number of threads to service RPC calls (default: 4) קבע את מספר תהליכוני לשירות קריאות RPC (ברירת מחדל: 4) @@ -3012,18 +2413,6 @@ rpcpassword=%s Specify wallet file (within data directory) ציין קובץ ארנק (בתוך ספריית המידע) - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - שימוש (מיושן, השתמש ב bitcoin-cli): - Verifying blocks... מאמת את שלמות מסד הנתונים... @@ -3032,22 +2421,10 @@ rpcpassword=%s Verifying wallet... מאמת את יושרת הארנק... - - Wait for RPC server to start - - Wallet %s resides outside data directory %s הארנק %s יושב מחוץ לספריית המידע %s - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - You need to rebuild the database using -reindex to change -txindex עליך לבנות מחדש את מסד הנתונים תוך שימוש ב- -reindex על מנת לשנות את -txindex @@ -3056,41 +2433,21 @@ rpcpassword=%s Imports blocks from external blk000??.dat file מייבא בלוקים מקובצי blk000??.dat חיצוניים - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - הרץ פקודה כאשר ההתראה הרלוונטית מתקבלת או כשאנחנו עדים לפיצול ארוך מאוד (%s בשורת הפקודה יוחלף ע"י ההודעה) - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - + הרץ פקודה כאשר ההתראה הרלוונטית מתקבלת או כשאנחנו עדים לפיצול ארוך מאוד (%s בשורת הפקודה יוחלף ע"י ההודעה) Information מידע - Invalid amount for -minrelaytxfee=<amount>: '%s' - כמות לא תקינה עבור -paytxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + כמות לא תקינה עבור -paytxfee=<amount>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - כמות לא תקינה עבור -paytxfee=<amount>: '%s' - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - + Invalid amount for -mintxfee=<amount>: '%s' + כמות לא תקינה עבור -paytxfee=<amount>: '%s' Maintain a full transaction index (default: 0) @@ -3112,42 +2469,10 @@ rpcpassword=%s Only connect to nodes in network <net> (IPv4, IPv6 or Tor) התחבר רק לצמתים ברשת <net> (IPv4, IPv6 או Tor) - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - RPC server options: הגדרות שרת RPC - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - אפשרויות SSL: (ראה את הויקי של ביטקוין עבור הוראות הגדרת SSL) - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file שלח מידע דיבאג ועקבה לקונסולה במקום לקובץ debug.log @@ -3156,18 +2481,6 @@ rpcpassword=%s Set minimum block size in bytes (default: 0) קבע את גודל הבלוק המינימלי בבתים (ברירת מחדל: 0) - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - Shrink debug.log file on client startup (default: 1 when no -debug) כווץ את קובץ debug.log בהפעלת הקליינט (ברירת מחדל: 1 ללא -debug) @@ -3180,10 +2493,6 @@ rpcpassword=%s Specify connection timeout in milliseconds (default: 5000) ציין הגבלת זמן לחיבור במילישניות (ברירת מחדל: 5000) - - Start Bitcoin Core Daemon - - System error: שגיאת מערכת: @@ -3220,18 +2529,10 @@ rpcpassword=%s Warning: This version is obsolete, upgrade required! אזהרה: הגרסה הזאת מיושנת, יש צורך בשדרוג! - - Zapping all transactions from wallet... - - on startup בפתיחה - - version - גרסה - wallet.dat corrupt, salvage failed קובץ wallet.dat מושחת, החילוץ נכשל @@ -3240,14 +2541,6 @@ rpcpassword=%s Password for JSON-RPC connections סיסמה לחיבורי JSON-RPC - - Allow JSON-RPC connections from specified IP address - אפשר חיבורי JSON-RPC מכתובת האינטרנט המצוינת - - - Send commands to node running on <ip> (default: 127.0.0.1) - שלח פקודות לצומת ב-<ip> (ברירת מחדל: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) בצע פקודה זו כשהבלוק הטוב ביותר משתנה (%s בפקודה יוחלף בגיבוב הבלוק) @@ -3280,10 +2573,6 @@ rpcpassword=%s This help message הודעת העזרה הזו - - Unable to bind to %s on this computer (bind returned error %d, %s) - לא מסוגל לקשור ל-%s במחשב זה (הקשירה החזירה שגיאה %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect אפשר בדיקת DNS עבור -addnode, -seednode ו- -connect @@ -3296,41 +2585,29 @@ rpcpassword=%s Error loading wallet.dat: Wallet corrupted שגיאה בטעינת הקובץ wallet.dat: הארנק מושחת - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - שגיאה בטעינת הקובץ wallet.dat: הארנק דורש גרסה חדשה יותר של ביטקוין - - - Wallet needed to be rewritten: restart Bitcoin to complete - יש לכתוב מחדש את הארנק: אתחל את ביטקוין לסיום - Error loading wallet.dat שגיאה בטעינת הקובץ wallet.dat - Invalid -proxy address: '%s' - כתובת -proxy לא תקינה: '%s' + Invalid -proxy address: '%s' + כתובת -proxy לא תקינה: '%s' - Unknown network specified in -onlynet: '%s' - רשת לא ידועה צוינה ב- -onlynet: '%s' + Unknown network specified in -onlynet: '%s' + רשת לא ידועה צוינה ב- -onlynet: '%s' - Unknown -socks proxy version requested: %i - התבקשה גרסת פרוקסי -socks לא ידועה: %i + Cannot resolve -bind address: '%s' + לא מסוגל לפתור כתובת -bind: '%s' - Cannot resolve -bind address: '%s' - לא מסוגל לפתור כתובת -bind: '%s' + Cannot resolve -externalip address: '%s' + לא מסוגל לפתור כתובת -externalip: '%s' - Cannot resolve -externalip address: '%s' - לא מסוגל לפתור כתובת -externalip: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - כמות לא תקינה עבור -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + כמות לא תקינה עבור -paytxfee=<amount>: '%s' Invalid amount @@ -3376,13 +2653,5 @@ rpcpassword=%s Error שגיאה - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - עליך לקבוע rpcpassword=yourpassword בקובץ ההגדרות: -%s -אם הקובץ אינו קיים, צור אותו עם הרשאות קריאה לבעלים בלבד. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_hi_IN.ts b/src/qt/locale/bitcoin_hi_IN.ts index 3ccac8899e..28778a0258 100644 --- a/src/qt/locale/bitcoin_hi_IN.ts +++ b/src/qt/locale/bitcoin_hi_IN.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - कापीराइट - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -41,70 +9,18 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address नया पता लिखिए ! - - &New - - Copy the currently selected address to the system clipboard चुनिन्दा पते को सिस्टम क्लिपबोर्ड पर कापी करे ! - - &Copy - - - - C&lose - - &Copy Address &पता कॉपी करे - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - &Delete &मिटाए !! - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - Copy &Label &लेबल कॉपी करे @@ -113,23 +29,11 @@ This product includes software developed by the OpenSSL Project for use in the O &Edit &एडिट - - Export Address List - - Comma separated file (*.csv) Comma separated file (*.csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -147,10 +51,6 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase पहचान शब्द/अक्षर डालिए ! @@ -163,10 +63,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase दोबारा नया पहचान शब्द/अक्षर डालिए ! - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - नया पहचान शब्द/अक्षर वॉलेट मे डालिए ! <br/> कृपा करके पहचान शब्द में <br> 10 से ज़्यादा अक्षॉरों का इस्तेमाल करे </b>,या <b>आठ या उससे से ज़्यादा शब्दो का इस्तेमाल करे</b> ! - Encrypt wallet एनक्रिप्ट वॉलेट ! @@ -199,30 +95,10 @@ This product includes software developed by the OpenSSL Project for use in the O Confirm wallet encryption वॉलेट एनक्रिपशन को प्रमाणित कीजिए ! - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - Wallet encrypted वॉलेट एनक्रिप्ट हो गया ! - - Bitcoin 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. - - Wallet encryption failed वॉलेट एनक्रिप्ट नही हुआ! @@ -247,17 +123,9 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet decryption failed वॉलेट का डीक्रिप्ट-ष्ण असफल ! - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - Synchronizing with network... नेटवर्क से समकालिक (मिल) रहा है ... @@ -266,10 +134,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Overview &विवरण - - Node - - Show general overview of wallet वॉलेट का सामानया विवरण दिखाए ! @@ -291,82 +155,18 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application अप्लिकेशन से बाहर निकलना ! - - Show information about Bitcoin - बीटकोइन के बारे में जानकारी ! - - - About &Qt - - - - Show information about Qt - - &Options... &विकल्प - - &Encrypt Wallet... - - &Backup Wallet... &बैकप वॉलेट - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - Change the passphrase used for wallet encryption पहचान शब्द/अक्षर जो वॉलेट एनक्रिपशन के लिए इस्तेमाल किया है उसे बदलिए! - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - Bitcoin बीटकोइन @@ -375,34 +175,6 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet वॉलेट - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - &File &फाइल @@ -423,58 +195,10 @@ This product includes software developed by the OpenSSL Project for use in the O [testnet] [टेस्टनेट] - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - %n active connection(s) to Bitcoin network %n सक्रिया संपर्क बीटकोइन नेटवर्क से%n सक्रिया संपर्क बीटकोइन नेटवर्क से - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - %n hour(s) %n घंटा%n घंटे @@ -487,26 +211,10 @@ This product includes software developed by the OpenSSL Project for use in the O %n week(s) %n हफ़्ता%n हफ्ते - - %1 and %2 - - - - %n year(s) - - %1 behind %1 पीछे - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - Error भूल @@ -523,10 +231,6 @@ This product includes software developed by the OpenSSL Project for use in the O Up to date नवीनतम - - Catching up... - - Sent transaction भेजी ट्रांजक्शन @@ -554,68 +258,16 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> वॉलेट एन्क्रिप्टेड है तथा अभी लॉक्ड है - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - Amount: राशि : - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount राशि @@ -628,18 +280,10 @@ Address: %4 Date taareek - - Confirmations - - Confirmed पक्का - - Priority - - Copy address पता कॉपी करे @@ -652,151 +296,11 @@ Address: %4 Copy amount कॉपी राशि - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (कोई लेबल नही !) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -807,14 +311,6 @@ Address: %4 &Label &लेबल - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &पता @@ -836,12 +332,8 @@ Address: %4 एडिट भेजने वाला पता - The entered address "%1" is already in the address book. - डाला गया पता "%1" एड्रेस बुक में पहले से ही मोजूद है| - - - The entered address "%1" is not a valid Bitcoin address. - + The entered address "%1" is already in the address book. + डाला गया पता "%1" एड्रेस बुक में पहले से ही मोजूद है| Could not unlock wallet. @@ -854,37 +346,9 @@ Address: %4 FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - version संस्करण @@ -893,283 +357,23 @@ Address: %4 Usage: खपत : - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - बीटकोइन - - - Error: Specified data directory "%1" can not be created. - - Error - + भूल - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog Options विकल्प - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - &OK &ओके @@ -1178,433 +382,65 @@ Address: %4 &Cancel &कैन्सल - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage Form फार्म - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - Wallet वॉलेट - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - <b>Recent transactions</b> <b>हाल का लेन-देन</b> - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - बीटकोइन - - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Bitcoin एड्रेस लिखें (उदाहरण: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - - - RPCConsole - - Client name - + Amount + राशि N/A लागू नही + + + QRImageWidget + + + RPCConsole - Client version - + N/A + लागू नही + &Information - + जानकारी - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - &Label: लेबल: - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - Copy label लेबल कॉपी करे - - Copy message - - Copy amount कॉपी राशि @@ -1612,34 +448,6 @@ Address: %4 ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address पता @@ -1652,19 +460,7 @@ Address: %4 Label लेबल - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel @@ -1675,10 +471,6 @@ Address: %4 Label लेबल - - Message - - Amount राशि @@ -1687,93 +479,21 @@ Address: %4 (no label) (कोई लेबल नही !) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins सिक्के भेजें| - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - Amount: राशि : - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once एक साथ कई प्राप्तकर्ताओं को भेजें - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - Balance: बाकी रकम : @@ -1782,115 +502,23 @@ Address: %4 Confirm the send action भेजने की पुष्टि करें - - S&end - - Confirm send coins सिक्के भेजने की पुष्टि करें - - %1 to %2 - - - - Copy quantity - - Copy amount कॉपी राशि - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - The amount to pay must be larger than 0. भेजा गया अमाउंट शुन्य से अधिक होना चाहिए| - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (कोई लेबल नही !) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry @@ -1901,10 +529,6 @@ Address: %4 Pay &To: प्राप्तकर्ता: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - Enter a label for this address to add it to your address book आपकी एड्रेस बुक में इस एड्रेस के लिए एक लेबल लिखें @@ -1913,14 +537,6 @@ Address: %4 &Label: लेबल: - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt-A @@ -1933,72 +549,12 @@ Address: %4 Alt+P Alt-P - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - Alt+A Alt-A @@ -2011,151 +567,27 @@ Address: %4 Alt+P Alt-P - - Enter the message you want to sign here - - Signature हस्ताक्षर - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Bitcoin एड्रेस लिखें (उदाहरण: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - [testnet] - + [टेस्टनेट] TrafficGraphWidget - - KB/s - - - + TransactionDesc Open until %1 खुला है जबतक %1 - - conflicted - - - - %1/offline - - %1/unconfirmed %1/अपुष्ट @@ -2164,97 +596,13 @@ Address: %4 %1 confirmations %1 पुष्टियाँ - - Status - - - - , broadcast through %n node(s) - - Date taareek - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - + ID Amount @@ -2272,10 +620,6 @@ Address: %4 , has not been successfully broadcast yet , अभी तक सफलतापूर्वक प्रसारित नहीं किया गया है - - Open for %n more block(s) - - unknown अज्ञात @@ -2306,18 +650,6 @@ Address: %4 Address पता - - Amount - राशि - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - Open until %1 खुला है जबतक %1 @@ -2334,22 +666,6 @@ Address: %4 Generated but not accepted जेनरेट किया गया किंतु स्वीकारा नही गया ! - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with स्वीकारा गया @@ -2465,38 +781,10 @@ Address: %4 Copy amount कॉपी राशि - - Copy transaction ID - - Edit label एडिट लेबल - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Comma separated file (*.csv) @@ -2521,10 +809,6 @@ Address: %4 Address पता - - Amount - राशि - ID ID @@ -2538,30 +822,21 @@ Address: %4 तक + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel Send Coins - + सिक्के भेजें| WalletView - - &Export - - - - Export the data in the current tab to a file - - Backup Wallet बैकप वॉलेट @@ -2574,14 +849,6 @@ Address: %4 Backup Failed बैकप असफल - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - Backup Successful बैकप सफल @@ -2589,18 +856,6 @@ Address: %4 bitcoin-core - - Usage: - खपत : - - - List commands - commands की लिस्ट बनाएं - - - Get help for a command - किसी command के लिए मदद लें - Options: विकल्प: @@ -2617,46 +872,6 @@ Address: %4 Specify data directory डेटा डायरेक्टरी बताएं - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands बैकग्राउंड में डेमॉन बन कर रन करे तथा कमांड्स स्वीकार करें @@ -2665,352 +880,6 @@ Address: %4 Use the test network टेस्ट नेटवर्क का इस्तेमाल करे - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - Verifying blocks... ब्लॉक्स जाँचे जा रहा है... @@ -3019,334 +888,30 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Verifying wallet... वॉलेट जाँचा जा रहा है... - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information जानकारी - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - Warning चेतावनी - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - संस्करण - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - Loading addresses... पता पुस्तक आ रही है... - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - Invalid amount राशि ग़लत है - - Insufficient funds - - Loading block index... ब्लॉक इंडेक्स आ रहा है... - - Add a node to connect to and attempt to keep the connection open - - Loading wallet... वॉलेट आ रहा है... - - Cannot downgrade wallet - - - - Cannot write default address - - Rescanning... रि-स्केनी-इंग... @@ -3355,19 +920,9 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Done loading लोड हो गया| - - To use the %s option - - Error भूल - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_hr.ts b/src/qt/locale/bitcoin_hr.ts index bd2b773d2f..bf365bb57e 100644 --- a/src/qt/locale/bitcoin_hr.ts +++ b/src/qt/locale/bitcoin_hr.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - O Bitcoin Jezrgu - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - Autorsko pravo - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -41,30 +9,14 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address Dodajte novu adresu - - &New - - Copy the currently selected address to the system clipboard Kopiraj trenutno odabranu adresu u međuspremnik - - &Copy - - - - C&lose - - &Copy Address &Kopirati adresu - - Delete the currently selected address from the list - - Export the data in the current tab to a file Izvoz podataka iz trenutnog taba u datoteku @@ -77,34 +29,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Delete &Brisanje - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - Copy &Label Kopirati &oznaku @@ -113,23 +37,11 @@ This product includes software developed by the OpenSSL Project for use in the O &Edit &Izmjeniti - - Export Address List - - Comma separated file (*.csv) Datoteka vrijednosti odvojenih zarezom (*. csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -147,10 +59,6 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase Unesite lozinku @@ -163,10 +71,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Ponovite novu lozinku - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Unesite novi lozinku za novčanik. <br/> Molimo Vas da koristite zaporku od <b>10 ili više slučajnih znakova,</b> ili <b>osam ili više riječi.</b> - Encrypt wallet Šifriranje novčanika @@ -207,10 +111,6 @@ This product includes software developed by the OpenSSL Project for use in the O Are you sure you wish to encrypt your wallet? Jeste li sigurni da želite šifrirati svoj novčanik? - - 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. - - Warning: The Caps Lock key is on! Upozorenje: Tipka Caps Lock je uključena! @@ -266,10 +166,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Overview &Pregled - - Node - - Show general overview of wallet Prikaži opći pregled novčanika @@ -290,10 +186,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application Izlazak iz programa - - Show information about Bitcoin - Prikaži informacije o Bitcoinu - About &Qt Više o &Qt @@ -318,18 +210,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Change Passphrase... &Promijena lozinke... - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - Importing blocks from disk... Importiranje blokova sa diska... @@ -354,14 +234,6 @@ This product includes software developed by the OpenSSL Project for use in the O Change the passphrase used for wallet encryption Promijenite lozinku za šifriranje novčanika - - &Debug window - - - - Open debugging and diagnostic console - - &Verify message... &Potvrdite poruku... @@ -378,30 +250,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Send &Pošalji - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - &File &Datoteka @@ -426,86 +274,14 @@ This product includes software developed by the OpenSSL Project for use in the O Bitcoin Core Bitcoin Jezgra - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Bitcoin klijent - %n active connection(s) to Bitcoin network %n aktivna veza na Bitcoin mrežu%n aktivne veze na Bitcoin mrežu%n aktivnih veza na Bitcoin mrežu - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - Processed %1 blocks of transaction history. Obrađeno %1 blokova povijesti transakcije. - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - Error Greška @@ -554,68 +330,16 @@ Adresa:%4 Wallet is <b>encrypted</b> and currently <b>locked</b> Novčanik je <b>šifriran</b> i trenutno <b>zaključan</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - Amount: Iznos: - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount Iznos @@ -628,18 +352,10 @@ Adresa:%4 Date Datum - - Confirmations - - Confirmed Potvrđeno - - Priority - - Copy address Kopirati adresu @@ -652,151 +368,11 @@ Adresa:%4 Copy amount Kopiraj iznos - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (bez oznake) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -807,14 +383,6 @@ Adresa:%4 &Label &Oznaka - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Adresa @@ -836,12 +404,12 @@ Adresa:%4 Uredi adresu za slanje - The entered address "%1" is already in the address book. - Upisana adresa "%1" je već u adresaru. + The entered address "%1" is already in the address book. + Upisana adresa "%1" je već u adresaru. - The entered address "%1" is not a valid Bitcoin address. - Upisana adresa "%1" nije valjana bitcoin adresa. + The entered address "%1" is not a valid Bitcoin address. + Upisana adresa "%1" nije valjana bitcoin adresa. Could not unlock wallet. @@ -854,33 +422,13 @@ Adresa:%4 FreespaceChecker - - A new data directory will be created. - - name ime - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core Bitcoin Jezgra @@ -890,38 +438,22 @@ Adresa:%4 verzija - Usage: - Upotreba: + About Bitcoin Core + O Bitcoin Jezrgu - command-line options - + Usage: + Upotreba: UI options UI postavke - - Set language, for example "de_DE" (default: system locale) - - Start minimized Pokreni minimiziran - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro @@ -929,41 +461,13 @@ Adresa:%4 Dobrodošli - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - + Bitcoin Core + Bitcoin Jezgra Error Pogreška - - GB of free space available - - (of %1GB needed) (od potrebnog %1GB) @@ -971,27 +475,7 @@ Adresa:%4 OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog @@ -1002,10 +486,6 @@ Adresa:%4 &Main &Glavno - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - Pay transaction &fee Plati &naknadu za transakciju @@ -1018,78 +498,10 @@ Adresa:%4 &Start Bitcoin on system login &Pokreni Bitcoin kod pokretanja sustava - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - &Network &Mreža - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Automatski otvori port Bitcoin klijenta na ruteru. To radi samo ako ruter podržava UPnP i ako je omogućen. @@ -1102,22 +514,10 @@ Adresa:%4 Proxy &IP: Proxy &IP: - - &Port: - - Port of the proxy (e.g. 9050) Port od proxy-a (npr. 9050) - - SOCKS &Version: - SOCKS &Verzija: - - - SOCKS version of the proxy (e.g. 5) - - &Window &Prozor @@ -1142,14 +542,6 @@ Adresa:%4 &Display &Prikaz - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - &Unit to show amounts in: &Jedinica za prikazivanje iznosa: @@ -1158,18 +550,6 @@ Adresa:%4 Choose the default subdivision unit to show in the interface and when sending coins. Izaberite željeni najmanji dio bitcoina koji će biti prikazan u sučelju i koji će se koristiti za plaćanje. - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - &Prikaži adrese u popisu transakcija - - - Whether to show coin control features or not. - - &OK &U redu @@ -1182,26 +562,6 @@ Adresa:%4 default standardne vrijednosti - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - The supplied proxy address is invalid. Priložena proxy adresa je nevažeća. @@ -1221,164 +581,43 @@ Adresa:%4 Wallet Novčanik - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - Total: Ukupno: - - Your current total balance - - <b>Recent transactions</b> <b>Nedavne transakcije</b> - - out of sync - - - + PaymentServer URI handling URI upravljanje - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Iznos - Error: Specified data directory "%1" does not exist. - + N/A + N/A - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Unesite Bitcoin adresu (npr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - Save QR Code Spremi QR kod - - PNG Image (*.png) - - - + RPCConsole @@ -1397,22 +636,10 @@ Adresa:%4 &Information &Informacija - - Debug window - - - - General - - Using OpenSSL version Koristim OpenSSL verziju - - Startup time - - Network Mreža @@ -1433,10 +660,6 @@ Adresa:%4 Current number of blocks Trenutni broj blokova - - Estimated total blocks - Procjenjeni ukupni broj blokova - Last block time Posljednje vrijeme bloka @@ -1449,37 +672,9 @@ Adresa:%4 &Console &Konzola - - &Network Traffic - - - - &Clear - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - + Ukupno: Clear console @@ -1493,117 +688,21 @@ Adresa:%4 Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. Kako bi navigirali kroz povijest koristite strelice gore i dolje. <b>Ctrl-L</b> kako bi očistili ekran. - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - &Label: &Oznaka: - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - Show Pokaži - - Remove the selected entries from the list - - - - Remove - - Copy label Kopirati oznaku - - Copy message - - Copy amount Kopiraj iznos @@ -1615,30 +714,6 @@ Adresa:%4 QR Code QR kôd - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address Adresa @@ -1659,11 +734,7 @@ Adresa:%4 Resulting URI too long, try to reduce the text for label / message. Rezultirajući URI je predug, probajte umanjiti tekst za naslov / poruku. - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel @@ -1686,77 +757,17 @@ Adresa:%4 (no label) (bez oznake) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins Slanje novca - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - Amount: Iznos: - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Pošalji k nekoliko primatelja odjednom @@ -1765,10 +776,6 @@ Adresa:%4 Add &Recipient &Dodaj primatelja - - Clear all fields of the form. - - Clear &All Obriši &sve @@ -1789,46 +796,10 @@ Adresa:%4 Confirm send coins Potvrdi slanje novca - - %1 to %2 - - - - Copy quantity - - Copy amount Kopiraj iznos - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - or ili @@ -1853,43 +824,11 @@ Adresa:%4 Duplicate address found, can only send to each address once per send operation. Pronašli smo adresu koja se ponavlja. U svakom plaćanju program može svaku adresu koristiti samo jedanput. - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (bez oznake) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry @@ -1900,10 +839,6 @@ Adresa:%4 Pay &To: &Primatelj plaćanja: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - Enter a label for this address to add it to your address book Unesite oznaku za ovu adresu kako bi ju dodali u vaš adresar @@ -1912,14 +847,6 @@ Adresa:%4 &Label: &Oznaka: - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt+A @@ -1932,56 +859,20 @@ Adresa:%4 Alt+P Alt+P - - Remove this entry - - Message: Poruka: - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - Pay To: Primatelj plaćanja: - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - &Sign Message &Potpišite poruku @@ -1990,14 +881,6 @@ Adresa:%4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Možete potpisati poruke sa svojom adresom kako bi dokazali da ih posjedujete. Budite oprezni da ne potpisujete ništa mutno, jer bi vas phishing napadi mogli na prevaru natjerati da prepišete svoj identitet njima. Potpisujte samo detaljno objašnjene izjave sa kojima se slažete. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Unesite Bitcoin adresu (npr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Choose previously used address - - Alt+A Alt+A @@ -2018,22 +901,6 @@ Adresa:%4 Signature Potpis - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - Clear &All Obriši &sve @@ -2042,93 +909,21 @@ Adresa:%4 &Verify Message &Potvrdite poruku - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Unesite Bitcoin adresu (npr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Unesite Bitcoin adresu (npr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - Wallet unlock was cancelled. Otključavanje novčanika je otkazano. - - Private key for the entered address is not available. - - - - Message signing failed. - - Message signed. Poruka je potpisana. - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen Bitcoin Core Bitcoin Jezgra - - The Bitcoin Core developers - - [testnet] [testnet] @@ -2136,21 +931,13 @@ Adresa:%4 TrafficGraphWidget - - KB/s - - - + TransactionDesc Open until %1 Otvoren do %1 - - conflicted - - %1/offline %1 nije dostupan @@ -2167,10 +954,6 @@ Adresa:%4 Status Status - - , broadcast through %n node(s) - - Date Datum @@ -2203,10 +986,6 @@ Adresa:%4 Credit Uplaćeno - - matures in %n more block(s) - - not accepted Nije prihvaćeno @@ -2235,18 +1014,6 @@ Adresa:%4 Transaction ID ID transakcije - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - Transaction Transakcija @@ -2259,22 +1026,10 @@ Adresa:%4 Amount Iznos - - true - - - - false - - , has not been successfully broadcast yet , još nije bio uspješno emitiran - - Open for %n more block(s) - - unknown nepoznato @@ -2305,18 +1060,6 @@ Adresa:%4 Address Adresa - - Amount - Iznos - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - Open until %1 Otvoren do %1 @@ -2333,22 +1076,6 @@ Adresa:%4 Generated but not accepted Generirano, ali nije prihvaćeno - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with Primljeno s @@ -2464,10 +1191,6 @@ Adresa:%4 Copy amount Kopiraj iznos - - Copy transaction ID - - Edit label Izmjeniti oznaku @@ -2476,26 +1199,6 @@ Adresa:%4 Show transaction details Prikaži detalje transakcije - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Datoteka podataka odvojenih zarezima (*.csv) @@ -2520,10 +1223,6 @@ Adresa:%4 Address Adresa - - Amount - Iznos - ID ID @@ -2537,13 +1236,12 @@ Adresa:%4 za + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2563,7 +1261,7 @@ Adresa:%4 Backup Wallet - + Backup novčanika Wallet Data (*.dat) @@ -2571,35 +1269,11 @@ Adresa:%4 Backup Failed - + Backup nije uspio - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - Upotreba: - - - List commands - Prikaži komande - - - Get help for a command - Potraži pomoć za komandu - Options: Postavke: @@ -2624,10 +1298,6 @@ Adresa:%4 Maintain at most <n> connections to peers (default: 125) Održavaj najviše <n> veza sa članovima (default: 125) - - Connect to a node to retrieve peer addresses, and disconnect - - Specify your own public address Odaberi vlastitu javnu adresu @@ -2640,10 +1310,6 @@ Adresa:%4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Broj sekundi koliko se članovima koji se čudno ponašaju neće dopustiti da se opet spoje (default: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Prihvaćaj JSON-RPC povezivanje na portu broj <port> (ugrađeni izbor: 8332 or testnet: 18332) @@ -2652,10 +1318,6 @@ Adresa:%4 Accept command line and JSON-RPC commands Prihvati komande iz tekst moda i JSON-RPC - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Izvršavaj u pozadini kao uslužnik i prihvaćaj komande @@ -2664,476 +1326,38 @@ Adresa:%4 Use the test network Koristi test mrežu - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Upozorenje: -paytxfee je podešen na preveliki iznos. To je iznos koji ćete platiti za obradu transakcije. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Upozorenje: Molimo provjerite jesu li datum i vrijeme na vašem računalu točni. Ako vaš sat ide krivo, Bitcoin neće raditi ispravno. - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - Block creation options: Opcije za kreiranje bloka: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) Poveži se samo sa određenim nodom - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - Error: Disk space is low! Pogreška: Nema prostora na disku! - - Error: Wallet locked, unable to create transaction! - - Error: system error: Pogreška: sistemska pogreška: - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - Naknada po kB dodana transakciji koju šaljete - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - Imports blocks from external blk000??.dat file Importiraj blokove sa vanjskog blk000??.dat fajla - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information Informacija - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - Only accept block chain matching built-in checkpoints (default: 1) Prihvati samo lance blokova koji se podudaraju sa ugrađenim checkpoint-ovima (default: 1) - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL postavke: (za detalje o podešavanju SSL opcija vidi Bitcoin Wiki) - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file Šalji trace/debug informacije na konzolu umjesto u debug.log datoteku @@ -3142,50 +1366,14 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Set minimum block size in bytes (default: 0) Podesite minimalnu veličinu bloka u bajtovima (default: 0) - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - Specify connection timeout in milliseconds (default: 5000) Odredi vremenski prozor za spajanje na mrežu u milisekundama (ugrađeni izbor: 5000) - - Start Bitcoin Core Daemon - - System error: Pogreška sistema: - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - Use UPnP to map the listening port (default: 0) Pokušaj koristiti UPnP da otvoriš port za uslugu (default: 0) @@ -3202,38 +1390,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning Upozorenje - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - verzija - - - wallet.dat corrupt, salvage failed - - Password for JSON-RPC connections Lozinka za JSON-RPC veze - - Allow JSON-RPC connections from specified IP address - Dozvoli JSON-RPC povezivanje s određene IP adrese - - - Send commands to node running on <ip> (default: 127.0.0.1) - Pošalji komande nodu na adresi <ip> (ugrađeni izbor: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Izvršite naredbu kada se najbolji blok promjeni (%s u cmd je zamjenjen sa block hash) @@ -3266,10 +1426,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message Ova poruka za pomoć - - Unable to bind to %s on this computer (bind returned error %d, %s) - Program ne može koristiti %s na ovom računalu (bind returned error %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Dozvoli DNS upite za dodavanje nodova i povezivanje @@ -3282,41 +1438,17 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted Greška kod učitavanja wallet.dat: Novčanik pokvaren - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Greška kod učitavanja wallet.dat: Novčanik zahtjeva noviju verziju Bitcoina - - - Wallet needed to be rewritten: restart Bitcoin to complete - Novčanik je trebao prepravak: ponovo pokrenite Bitcoin - Error loading wallet.dat Greška kod učitavanja wallet.dat - Invalid -proxy address: '%s' - Nevaljala -proxy adresa: '%s' + Invalid -proxy address: '%s' + Nevaljala -proxy adresa: '%s' - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - Nevaljali iznos za opciju -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Nevaljali iznos za opciju -paytxfee=<amount>: '%s' Invalid amount @@ -3354,19 +1486,9 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Done loading Učitavanje gotovo - - To use the %s option - - Error Greška - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_hu.ts b/src/qt/locale/bitcoin_hu.ts index 3d8d45a61d..b5eb262442 100644 --- a/src/qt/locale/bitcoin_hu.ts +++ b/src/qt/locale/bitcoin_hu.ts @@ -1,45 +1,9 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Ez egy kísérleti program. -MIT/X11 szoftverlicenc alatt kiadva, lásd a mellékelt fájlt COPYING vagy http://www.opensource.org/licenses/mit-license.php. - -Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (http://www.openssl.org/) és kriptográfiai szoftvertben való felhasználásra, írta Eric Young (eay@cryptsoft.com) és UPnP szoftver, írta Thomas Bernard. - - - Copyright - Copyright - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage Double-click to edit address or label - Dupla-kattintás a cím vagy a címke szerkesztéséhez + Dupla-kattintás a cím vagy címke szerkesztéséhez Create a new address @@ -47,7 +11,7 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt &New - + &Új Copy the currently selected address to the system clipboard @@ -55,11 +19,11 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt &Copy - + &Másolás C&lose - + &Bezárás &Copy Address @@ -67,7 +31,7 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt Delete the currently selected address from the list - + Kiválasztott cím törlése a listából Export the data in the current tab to a file @@ -75,7 +39,7 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt &Export - &Exportálás... + &Exportálás &Delete @@ -83,35 +47,35 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt Choose the address to send coins to - + Válaszd ki a címet, ahová küldesz Choose the address to receive coins with - + Válaszd ki a címet, amivel fogadsz C&hoose - + &Kiválaszt Sending addresses - + Küldési címek Receiving addresses - + Fogadó címek These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - + Ezekről a címekről küldhetsz bitcoint. Mindig ellenőrizd a fogadó címet és a fizetendő összeget, mielőtt elküldöd. These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - + Ezekkel a címekkel fogadhatsz bitcoint. Ajánlott minden tranzakcióhoz egy új fogadó címet használni. Copy &Label - Címke &másolása + &Címke másolása &Edit @@ -119,7 +83,7 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt Export Address List - + Címjegyzék exportálása Comma separated file (*.csv) @@ -127,11 +91,11 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt Exporting Failed - + Az exportálás sikertelen volt - There was an error trying to save the address list to %1. - + There was an error trying to save the address list to %1. Please try again. + Hiba történt a címjegyzék %1 helyre való mentésekor. Kérlek próbáld újra. @@ -153,7 +117,7 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt AskPassphraseDialog Passphrase Dialog - Kulcsszó párbeszédablak + Jelszó párbeszédablak Enter passphrase @@ -167,17 +131,13 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt Repeat new passphrase Új jelszó újra - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Írd be az új jelszót a tárcához.<br/>Használj legalább 10<br/>véletlenszerű karaktert</b> vagy <b>legalább nyolc szót</b>. - Encrypt wallet - Tárca kódolása + Tárca titkosítása This operation needs your wallet passphrase to unlock the wallet. - A tárcád megnyitásához a műveletnek szüksége van a tárcád jelszavára. + A tárca megnyitásához a műveletnek szüksége van a tárcád jelszavára. Unlock wallet @@ -185,7 +145,7 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt This operation needs your wallet passphrase to decrypt the wallet. - A tárcád dekódolásához a műveletnek szüksége van a tárcád jelszavára. + A tárca dekódolásához a műveletnek szüksége van a tárcád jelszavára. Decrypt wallet @@ -201,39 +161,43 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt Confirm wallet encryption - Biztosan kódolni akarod a tárcát? + Biztosan titkosítani akarod a tárcát? Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - Figyelem: Ha kódolod a tárcát, és elveszíted a jelszavad, akkor <b>AZ ÖSSZES BITCOINODAT IS EL FOGOD VESZÍTENI!</b> + Figyelem: ha titkosítod a tárcát és elveszted a jelszavad, akkor <b>AZ ÖSSZES BITCOINOD ELVESZIK!</b> Are you sure you wish to encrypt your wallet? - Biztosan kódolni akarod a tárcát? + Biztosan titkosítani akarod a tárcád? 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. - FONTOS: A pénztárca-fájl korábbi mentéseit ezzel az új, titkosított pénztárca-fájllal kell helyettesíteni. Biztonsági okokból a pénztárca-fájl korábbi titkosítás nélküli mentései haszontalanná válnak amint elkezdi használni az új, titkosított pénztárcát. + FONTOS: A tárca-fájl minden korábbi mentését cseréld le ezzel az új, titkosított tárca-fájllal. Biztonsági okokból a tárca-fájl korábbi, titkosítás nélküli mentései használhatatlanná válnak, amint elkezded használni az új, titkosított tárcát. Warning: The Caps Lock key is on! - + Vigyázat: a Caps Lock be van kapcsolva! Wallet encrypted - Tárca kódolva + Tárca titkosítva + + + 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>. + Add meg a tárca új jelszavát.<br/>Olyan jelszót válassz, ami <b>legalább tíz véletlenszerű karakterből</b> vagy <b>legalább 8 véletlenszerű szóból</b> áll. Bitcoin 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. - Bitcoin will close now to finish the encryption process. Ne feledd, hogy a tárca titkosítása sem nyújt teljes védelmet az adathalász programok fertőzésével szemben. + A Bitcoin Core most bezár, hogy befejezze a titkosítást. Ne feledd: a tárca titkosítása nem nyújt teljes védelmet azzal szemben, hogy adathalász programok megfertőzzék a számítógéped és ellopják a bitcoinjaid. Wallet encryption failed - Tárca kódolása sikertelen. + A tárca titkosítása sikertelen. Wallet encryption failed due to an internal error. Your wallet was not encrypted. - Tárca kódolása belső hiba miatt sikertelen. A tárcád nem lett kódolva. + Tárca titkosítása belső hiba miatt sikertelen. A tárcád nem lett titkosítva. The supplied passphrases do not match. @@ -272,7 +236,7 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt Node - + Csomópont Show general overview of wallet @@ -284,7 +248,7 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt Browse transaction history - Tranzakciótörténet megtekintése + Tranzakciós előzmények megtekintése E&xit @@ -292,11 +256,7 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt Quit application - Kilépés - - - Show information about Bitcoin - Információk a Bitcoinról + Kilépés az alkalmazásból About &Qt @@ -304,7 +264,7 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt Show information about Qt - Információk a Qt ról + Információk a Qt-ról &Options... @@ -312,7 +272,7 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt &Encrypt Wallet... - Tárca &kódolása... + Tárca &titkosítása... &Backup Wallet... @@ -324,15 +284,19 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt &Sending addresses... - + &Küldési címek... &Receiving addresses... - + &Fogadó címek... Open &URI... - + &URI azonosító megnyitása... + + + Bitcoin Core client + Bitcoin Core kliens Importing blocks from disk... @@ -340,11 +304,11 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt Reindexing blocks on disk... - A blokkok lemezen történő ujraindexelése... + Lemezen lévő blokkok újraindexelése... Send coins to a Bitcoin address - Érmék küldése megadott címre + Bitcoin küldése megadott címre Modify configuration options for Bitcoin @@ -352,11 +316,11 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt Backup wallet to another location - Biztonsági másolat készítése a Tárcáról egy másik helyre + Biztonsági másolat készítése a tárcáról egy másik helyre Change the passphrase used for wallet encryption - Tárcakódoló jelszó megváltoztatása + Tárca-titkosító jelszó megváltoztatása &Debug window @@ -386,25 +350,29 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt &Receive &Fogadás + + Show information about Bitcoin Core + Bitcoin Core információ megjelenítése + &Show / Hide &Mutat / Elrejt Show or hide the main Window - + Főablakot mutat/elrejt Encrypt the private keys that belong to your wallet - A pénztárcájához tartozó privát kulcsok titkosítása + A tárcádhoz tartozó privát kulcsok titkosítása Sign messages with your Bitcoin addresses to prove you own them - Üzenet aláírása a Bitcoin címmel, amivel bizonyítja, hogy a cím az ön tulajdona. + Üzenetek aláírása a Bitcoin-címmeiddel, amivel bizonyítod, hogy a cím a sajátod Verify messages to ensure they were signed with specified Bitcoin addresses - Annak ellenőrzése, hogy az üzenetek valóban a megjelölt Bitcoin címekkel vannak-e alaírva + Üzenetek ellenőrzése, hogy valóban a megjelölt Bitcoin-címekkel vannak-e aláírva &File @@ -432,35 +400,31 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt Request payments (generates QR codes and bitcoin: URIs) - + Fizetési kérelem (QR-kódot és "bitcoin:" URI azonosítót hoz létre) &About Bitcoin Core - + &A Bitcoin Core-ról Show the list of used sending addresses and labels - + A használt küldési címek és címkék megtekintése Show the list of used receiving addresses and labels - + A használt fogadó címek és címkék megtekintése Open a bitcoin: URI or payment request - + "bitcoin:" URI azonosító vagy fizetési kérelem megnyitása &Command-line options - + Paran&cssor kapcsolók Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Bitcoin kliens + A Bitcoin Core súgóüzenet megjelenítése a Bitcoin lehetséges parancssori kapcsolóival. %n active connection(s) to Bitcoin network @@ -470,10 +434,6 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt No block source available... Blokk forrása ismeretlen... - - Processed %1 of %2 (estimated) blocks of transaction history. - %1 blokk feldolgozva a tranzakciótörténet %2 (becsült) blokkjából - Processed %1 blocks of transaction history. A tranzakció-történet %1 blokkja feldolgozva. @@ -492,11 +452,11 @@ Ez a termék az OpenSSL Project által lett kifejlesztve az OpenSSL Toolkit (htt %1 and %2 - + %1 és %2 %n year(s) - + %n év%n év %1 behind @@ -552,16 +512,12 @@ Cím: %4 Wallet is <b>encrypted</b> and currently <b>unlocked</b> - Tárca <b>kódolva</b> és jelenleg <b>nyitva</b>. + A tárca <b>titkosítva</b> és jelenleg <b>nyitva</b>. Wallet is <b>encrypted</b> and currently <b>locked</b> Tárca <b>kódolva</b> és jelenleg <b>zárva</b>. - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - ClientModel @@ -574,15 +530,15 @@ Cím: %4 CoinControlDialog Coin Control Address Selection - + Ellenőrző cím kiválasztása Quantity: - + Mennyiség: Bytes: - + Bájtok: Amount: @@ -590,35 +546,35 @@ Cím: %4 Priority: - + Prioritás: Fee: - + Díjak: - Low Output: - + Dust: + Por-határ: After Fee: - + Utólagos díj: Change: - + Visszajáró: (un)select all - + mindent kiválaszt/elvet Tree mode - + Fa nézet List mode - + Lista nézet Amount @@ -634,7 +590,7 @@ Cím: %4 Confirmations - + Megerősítések Confirmed @@ -642,7 +598,7 @@ Cím: %4 Priority - + Prioritás Copy address @@ -662,131 +618,119 @@ Cím: %4 Lock unspent - + Megmaradt zárolása Unlock unspent - + Zárolás feloldása Copy quantity - + Mennyiség másolása Copy fee - + Díj másolása Copy after fee - + Utólagos díj másolása Copy bytes - + Byte-ok másolása Copy priority - + Prioritás másolása - Copy low output - + Copy dust + Por-határ másolása Copy change - + Visszajáró másolása highest - + legmagasabb higher - + magasabb high - + magas medium-high - + közepesen-magas medium - + közepes low-medium - + alacsony-közepes low - + alacsony lower - + alacsonyabb lowest - + legalacsonyabb (%1 locked) - + (%1 zárolva) none - + semmi - Dust - + Can vary +/- %1 satoshi(s) per input. + Bemenetenként +/- %1 satoshi-val változhat yes - + igen no - + nem This label turns red, if the transaction size is greater than 1000 bytes. - + Ez a címke piros lesz, ha tranzakció mérete nagyobb 1000 byte-nál. This means a fee of at least %1 per kB is required. - + Legalább %1 díj szüksége kB-onként. Can vary +/- 1 byte per input. - + Bemenetenként +/- 1 byte-al változhat. Transactions with higher priority are more likely to get included into a block. - + Nagyobb prioritású tranzakciók nagyobb valószínűséggel kerülnek be egy blokkba. - This label turns red, if the priority is smaller than "medium". - + This label turns red, if the priority is smaller than "medium". + Ez a címke piros lesz, ha a prioritás közepesnél alacsonyabb. This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - + Ez a címke piros lesz, ha valamelyik elfogadó kevesebbet kap mint %1. (no label) @@ -794,11 +738,11 @@ Cím: %4 change from %1 (%2) - + visszajáró %1-ből (%2) (change) - + (visszajáró) @@ -813,11 +757,11 @@ Cím: %4 The label associated with this address list entry - + Ehhez a listaelemhez rendelt címke The address associated with this address list entry. This can only be modified for sending addresses. - + Ehhez a címlistaelemhez rendelt cím. Csak a küldő címek módosíthatók. &Address @@ -840,12 +784,12 @@ Cím: %4 Küldő cím szerkesztése - The entered address "%1" is already in the address book. - A megadott "%1" cím már szerepel a címjegyzékben. + The entered address "%1" is already in the address book. + A megadott "%1" cím már szerepel a címjegyzékben. - The entered address "%1" is not a valid Bitcoin address. - A megadott "%1" cím nem egy érvényes Bitcoin-cím. + The entered address "%1" is not a valid Bitcoin address. + A megadott "%1" cím nem egy érvényes Bitcoin-cím. Could not unlock wallet. @@ -860,31 +804,23 @@ Cím: %4 FreespaceChecker A new data directory will be created. - + Új adatkönyvtár lesz létrehozva. name Név - - Directory already exists. Add %1 if you intend to create a new directory here. - - Path already exists, and is not a directory. - + Az elérési út létezik, de nem egy könyvtáré. Cannot create data directory here. - + Adatkönyvtár nem hozható itt létre. HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core Bitcoin Core @@ -893,6 +829,18 @@ Cím: %4 version verzió + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + A Bitcoin Core-ról + + + Command-line options + Parancssoros opciók + Usage: Használat: @@ -906,8 +854,8 @@ Cím: %4 UI opciók - Set language, for example "de_DE" (default: system locale) - Nyelvbeállítás, például "de_DE" (alapértelmezett: rendszer nyelve) + Set language, for example "de_DE" (default: system locale) + Nyelvbeállítás, például "de_DE" (alapértelmezett: rendszer nyelve) Start minimized @@ -916,7 +864,7 @@ Cím: %4 Set SSL root certificates for payment request (default: -system-) - + SLL gyökér-igazolások megadása fizetési kérelmekhez (alapértelmezett: -system-) Show splash screen on startup (default: 1) @@ -924,42 +872,22 @@ Cím: %4 Choose data directory on startup (default: 0) - + Adatkönyvtár kiválasztása induláskor (alapbeállítás: 0) Intro Welcome - + Üdvözlünk Welcome to Bitcoin Core. - + Üdvözlünk a Bitcoin Core-ban. - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - + Bitcoin Core + Bitcoin Core Error @@ -967,36 +895,32 @@ Cím: %4 GB of free space available - + GB hely érhető el (of %1GB needed) - + ( ebből %1GB szükséges) OpenURIDialog Open URI - + URI megnyitása Open payment request from URI or file - + Fizetési kérelem megnyitása URI azonosítóból vagy fájlból URI: - + URI: Select payment request file - + Fizetési kérelmi fájl kiválasztása - - Select payment request file to open - - - + OptionsDialog @@ -1023,41 +947,13 @@ Cím: %4 &Start Bitcoin on system login &Induljon el a számítógép bekapcsolásakor - - Size of &database cache - - MB - - - - Number of script &verification threads - + MB Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - + SOCKS proxyn keresztüli csatlakozás a Bitcoin hálózatához. Reset all client options to default. @@ -1071,30 +967,6 @@ Cím: %4 &Network &Hálózat - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. A Bitcoin-kliens portjának automatikus megnyitása a routeren. Ez csak akkor működik, ha a routered támogatja az UPnP-t és az engedélyezve is van rajta. @@ -1115,14 +987,6 @@ Cím: %4 Port of the proxy (e.g. 9050) Proxy portja (pl.: 9050) - - SOCKS &Version: - SOCKS &Verzió: - - - SOCKS version of the proxy (e.g. 5) - A proxy SOCKS verziója (pl. 5) - &Window &Ablak @@ -1163,18 +1027,6 @@ Cím: %4 Choose the default subdivision unit to show in the interface and when sending coins. Válaszd ki az interfészen és érmék küldésekor megjelenítendő alapértelmezett alegységet. - - Whether to show Bitcoin addresses in the transaction list or not. - Mutassa-e a Bitcoin címeket a tranzakciólistában. - - - &Display addresses in transaction list - &Címek megjelenítése a tranzakciólistában - - - Whether to show coin control features or not. - - &OK &OK @@ -1189,24 +1041,12 @@ Cím: %4 none - + semmi Confirm options reset Beállítások törlésének jóváhagyása. - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - The supplied proxy address is invalid. A megadott proxy cím nem érvényes. @@ -1228,7 +1068,7 @@ Cím: %4 Available: - + Elérhető: Your current spendable balance @@ -1236,7 +1076,7 @@ Cím: %4 Pending: - + Küldés: Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance @@ -1273,107 +1113,38 @@ Cím: %4 URI handling URI kezelés - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - Cannot start bitcoin: click-to-pay handler A bitcoint nem lehet elindítani: click-to-pay handler - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Összeg - Error: Specified data directory "%1" does not exist. - + NETWORK + HÁLÓZAT - Error: Cannot parse configuration file: %1. Only use key=value syntax. - + N/A + Nem elérhető - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adj meg egy Bitcoin-címet (pl.: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L ) - - + QRImageWidget &Save Image... - + &Kép mentése &Copy Image - + &Kép másolása Save QR Code @@ -1381,7 +1152,7 @@ Cím: %4 PNG Image (*.png) - + PNG kép (*.png) @@ -1404,11 +1175,7 @@ Cím: %4 Debug window - - - - General - + Debug ablak Using OpenSSL version @@ -1439,8 +1206,16 @@ Cím: %4 Aktuális blokkok száma - Estimated total blocks - Becsült összes blokk + Received + Fogadott + + + Sent + Küldött + + + &Peers + &Peerek Last block time @@ -1456,23 +1231,19 @@ Cím: %4 &Network Traffic - - - - &Clear - + &Hálózati forgalom Totals - + Összesen: In: - + Be: Out: - + Ki: Build date @@ -1482,10 +1253,6 @@ Cím: %4 Debug log file Debug naplófájl - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - Clear console Konzol törlése @@ -1504,102 +1271,50 @@ Cím: %4 %1 B - + %1 B %1 KB - + %1 KB %1 MB - + %1 MB %1 GB - + %1 GB - %1 m - + never + soha - %1 h - + Yes + Igen - %1 h %2 m - + No + Nem - + ReceiveCoinsDialog - - &Amount: - - &Label: Címke: - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - + Törlés Show - - - - Remove the selected entries from the list - + Mutat Remove - + Eltávolítás Copy label @@ -1607,7 +1322,7 @@ Cím: %4 Copy message - + Üzenet másolása Copy amount @@ -1630,19 +1345,11 @@ Cím: %4 &Save Image... - - - - Request payment to %1 - - - - Payment information - + &Kép mentése URI - + URI: Address @@ -1691,44 +1398,24 @@ Cím: %4 (no label) (nincs címke) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins Érmék küldése - - Coin Control Features - - Inputs... - - - - automatically selected - - - - Insufficient funds! - + Bemenetek... Quantity: - + Mennyiség: Bytes: - + Bájtok: Amount: @@ -1736,31 +1423,19 @@ Cím: %4 Priority: - + Prioritás: Fee: - - - - Low Output: - + Díjak: After Fee: - + Utólagos díj: Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - + Visszajáró: Send to multiple recipients at once @@ -1771,8 +1446,8 @@ Cím: %4 &Címzett hozzáadása - Clear all fields of the form. - + Dust: + Por-határ: Clear &All @@ -1794,13 +1469,9 @@ Cím: %4 Confirm send coins Küldés megerősítése - - %1 to %2 - - Copy quantity - + Mennyiség másolása Copy amount @@ -1808,35 +1479,27 @@ Cím: %4 Copy fee - + Díj másolása Copy after fee - + Utólagos díj másolása Copy bytes - + Byte-ok másolása Copy priority - - - - Copy low output - + Prioritás másolása Copy change - - - - Total Amount %1 (= %2) - + Visszajáró másolása or - + vagy The recipient address is not valid, please recheck. @@ -1858,43 +1521,15 @@ Cím: %4 Duplicate address found, can only send to each address once per send operation. Többször szerepel ugyanaz a cím. Egy küldési műveletben egy címre csak egyszer lehet küldeni. - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (nincs címke) - Warning: Unknown change address - + Copy dust + Visszajáró másolása - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry @@ -1905,10 +1540,6 @@ Cím: %4 Pay &To: Címzett: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - Enter a label for this address to add it to your address book Milyen címkével kerüljön be ez a cím a címtáradba? @@ -1918,14 +1549,6 @@ Cím: %4 &Label: Címke: - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt+A @@ -1938,55 +1561,27 @@ Cím: %4 Alt+P Alt+P - - Remove this entry - - Message: Üzenet: - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - Memo: - + Jegyzet: ShutdownWindow Bitcoin Core is shutting down... - + A Bitcoin Core leáll... - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog Signatures - Sign / Verify a Message - + Aláírások - üzenet aláírása/ellenőrzése &Sign Message @@ -1996,14 +1591,6 @@ Cím: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Aláírhat a címeivel üzeneteket, amivel bizonyíthatja, hogy a címek az önéi. Vigyázzon, hogy ne írjon alá semmi félreérthetőt, mivel a phising támadásokkal megpróbálhatják becsapni, hogy az azonosságát átírja másokra. Csak olyan részletes állításokat írjon alá, amivel egyetért. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adj meg egy Bitcoin-címet (pl.: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L ) - - - Choose previously used address - - Alt+A Alt+A @@ -2036,10 +1623,6 @@ Cím: %4 Sign &Message Üzenet &aláírása - - Reset all sign message fields - - Clear &All Mindent &töröl @@ -2052,30 +1635,6 @@ Cím: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Írja be az aláírás címét, az üzenetet (ügyelve arra, hogy az új-sor, szóköz, tab, stb. karaktereket is pontosan) és az aláírást az üzenet ellenőrzéséhez. Ügyeljen arra, ne gondoljon többet az aláírásról, mint amennyi az aláírt szövegben ténylegesen áll, hogy elkerülje a köztes-ember (man-in-the-middle) támadást. - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adj meg egy Bitcoin-címet (pl.: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L ) - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adj meg egy Bitcoin-címet (pl.: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L ) - - - Click "Sign Message" to generate signature - - The entered address is invalid. A megadott cím nem érvényes. @@ -2084,17 +1643,9 @@ Cím: %4 Please check the address and try again. Ellenőrizze a címet és próbálja meg újra. - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - Private key for the entered address is not available. - + A megadott cím privát kulcsa nem található. Message signing failed. @@ -2112,10 +1663,6 @@ Cím: %4 Please check the signature and try again. Ellenőrizd az aláírást és próbáld újra. - - The signature did not match the message digest. - - Message verification failed. Az üzenet ellenőrzése nem sikerült. @@ -2133,7 +1680,7 @@ Cím: %4 The Bitcoin Core developers - + A Bitcoin fejlesztői [testnet] @@ -2144,7 +1691,7 @@ Cím: %4 TrafficGraphWidget KB/s - + KB/s @@ -2153,14 +1700,6 @@ Cím: %4 Open until %1 Megnyitva %1-ig - - conflicted - - - - %1/offline - - %1/unconfirmed %1/megerősítetlen @@ -2173,17 +1712,13 @@ Cím: %4 Status Állapot - - , broadcast through %n node(s) - - Date Dátum Source - + Forrás Generated @@ -2241,14 +1776,6 @@ Cím: %4 Transaction ID Tranzakcióazonosító - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - Debug information Debug információ @@ -2311,14 +1838,6 @@ Cím: %4 Address Cím - - Amount - Összeg - - - Immature (%1 confirmations, will be available after %2) - - Open for %n more block(s) %n további blokkra megnyitva%n további blokkra megnyitva @@ -2341,19 +1860,7 @@ Cím: %4 Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - + Offline Received with @@ -2482,25 +1989,9 @@ Cím: %4 Show transaction details Tranzakciós részletek megjelenítése - - Export Transaction History - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - + Az exportálás sikertelen volt Comma separated file (*.csv) @@ -2526,10 +2017,6 @@ Cím: %4 Address Cím - - Amount - Összeg - ID Azonosító @@ -2543,13 +2030,12 @@ Cím: %4 meddig + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2579,14 +2065,6 @@ Cím: %4 Backup Failed Biztonsági másolat készítése sikertelen - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - Backup Successful Sikeres biztonsági mentés @@ -2594,20 +2072,6 @@ Cím: %4 bitcoin-core - - Usage: - Használat: - - - List commands - Parancsok kilistázása - - - - Get help for a command - Segítség egy parancsról - - Options: Opciók @@ -2652,10 +2116,6 @@ Cím: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Helytelenül viselkedő peerek kizárási ideje másodpercben (alapértelmezés: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) JSON-RPC csatlakozásokhoz figyelendő <port> (alapértelmezett: 8332 or testnet: 18332) @@ -2665,10 +2125,6 @@ Cím: %4 Parancssoros és JSON-RPC parancsok elfogadása - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Háttérben futtatás daemonként és parancsok elfogadása @@ -2683,184 +2139,30 @@ Cím: %4 Accept connections from outside (default: 1 if no -proxy or -connect) Kívülről érkező kapcsolatok elfogadása (alapértelmezett: 1, ha nem használt a -proxy vagy a -connect) - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Regressziós teszt mód indítása, amely egy speciális láncot használ, amelyben a blokkok azonnal feloldhatók. Ez regressziós tesztalkalmazások által és alkalmazásfejlesztéshez használható. - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Hiba: a tranzakciót elutasították. Ezt az okozhatja, ha már elköltöttél valamennyi érmét a tárcádból például ha a wallet.dat-od egy másolatát használtad, és így az elköltés csak abban lett jelölve, de itt nem. - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Parancs, amit akkor hajt végre, amikor egy tárca-tranzakció megváltozik (%s a parancsban lecserélődik a blokk TxID-re) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Figyelem: a -paytxfee nagyon magas. Ennyi tranzakciós díjat fogsz fizetni, ha elküldöd a tranzakciót. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Figyelem: Ellenőrizd, hogy helyesen van-e beállítva a gépeden a dátum és az idő. A Bitcoin nem fog megfelelően működni, ha rosszul van beállítvaaz órád. - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) Csatlakozás csak a megadott csomóponthoz - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - Corrupted block database detected Sérült blokk-adatbázis észlelve - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - Discover own IP address (default: 1 when listening and no -externalip) Saját IP-cím felfedezése (alapértelmezett: 1, amikor figyel és nem használt a -externalip) - - Do not load the wallet and disable wallet RPC calls - - Do you want to rebuild the block database now? Újra akarod építeni a blokk adatbázist most? @@ -2883,11 +2185,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - + Hiba: kevés a hely a lemezen! Error: system error: @@ -2937,22 +2235,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write undo data A stornóadatok írása nem sikerült - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - Generate coins (default: 0) Érmék generálása (alapértelmezett: 0) @@ -2961,70 +2243,22 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. How many blocks to check at startup (default: 288, 0 = all) Hány blokkot ellenőrizzen induláskor (alapértelmezett: 288, 0 = mindet) - - If <category> is not supplied, output all debugging information. - - Importing... - + Importálás Incorrect or no genesis block found. Wrong datadir for network? Helytelen vagy nemlétező genézis blokk. Helytelen hálózati adatkönyvtár? - - Invalid -onion address: '%s' - - Not enough file descriptors available. Nincs elég fájlleíró. - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - Rebuild block chain index from current blk000??.dat files Blokklánc index újraalkotása az alábbi blk000??.dat fájlokból - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - Verifying blocks... Blokkok ellenőrzése... @@ -3033,146 +2267,38 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Verifying wallet... Tárca ellenőrzése... - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - You need to rebuild the database using -reindex to change -txindex Az adatbázist újra kell építeni -reindex használatával (módosítás -tindex). - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information Információ - Invalid amount for -minrelaytxfee=<amount>: '%s' - Érvénytelen -minrelaytxfee=<amount>: '%s' összeg + Invalid amount for -minrelaytxfee=<amount>: '%s' + Érvénytelen -minrelaytxfee=<amount>: '%s' összeg - Invalid amount for -mintxfee=<amount>: '%s' - Érvénytelen -mintxfee=<amount>: '%s' összeg - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - + Invalid amount for -mintxfee=<amount>: '%s' + Érvénytelen -mintxfee=<amount>: '%s' összeg Maintain a full transaction index (default: 0) Teljes tranzakcióindex megőrzése (alapértelmezett: 0) - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - Only accept block chain matching built-in checkpoints (default: 1) Csak blokklánccal egyező beépített ellenőrző pontok elfogadása (alapértelmezés: 1) Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL-opciók: (lásd a Bitcoin Wiki SSL-beállítási instrukcióit) - - - Send command to Bitcoin Core - + Csak a <net> hálózat csomópontjaihoz kapcsolódjon (IPv4, IPv6 vagy Tor) Send trace/debug info to console instead of debug.log file trace/debug információ küldése a konzolra a debog.log fájl helyett - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - Signing transaction failed Tranzakció aláírása sikertelen @@ -3181,14 +2307,14 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Specify connection timeout in milliseconds (default: 5000) Csatlakozás időkerete milliszekundumban (alapértelmezett: 5000) - - Start Bitcoin Core Daemon - - System error: Rendszerhiba: + + This is experimental software. + Ez egy kísérleti szoftver. + Transaction amount too small Tranzakció összege túl alacsony @@ -3218,39 +2344,9 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning Figyelem - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - verzió - - - wallet.dat corrupt, salvage failed - - Password for JSON-RPC connections Jelszó JSON-RPC csatlakozásokhoz - - - - Allow JSON-RPC connections from specified IP address - JSON-RPC csatlakozások engedélyezése meghatározott IP-címről - - - - Send commands to node running on <ip> (default: 127.0.0.1) - Parancsok küldése <ip> címen működő csomóponthoz (alapértelmezett: 127.0.0.1) @@ -3291,10 +2387,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Ez a súgó-üzenet - - Unable to bind to %s on this computer (bind returned error %d, %s) - A %s nem elérhető ezen a gépen (bind returned error %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect DNS-kikeresés engedélyezése az addnode-nál és a connect-nél @@ -3307,41 +2399,29 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted Hiba a wallet.dat betöltése közben: meghibásodott tárca - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Hiba a wallet.dat betöltése közben: ehhez a tárcához újabb verziójú Bitcoin-kliens szükséges - - - Wallet needed to be rewritten: restart Bitcoin to complete - A Tárca újraírása szükséges: Indítsa újra a teljesen a Bitcoin-t - Error loading wallet.dat Hiba az wallet.dat betöltése közben - Invalid -proxy address: '%s' - Érvénytelen -proxy cím: '%s' + Invalid -proxy address: '%s' + Érvénytelen -proxy cím: '%s' - Unknown network specified in -onlynet: '%s' - Ismeretlen hálózat lett megadva -onlynet: '%s' + Unknown network specified in -onlynet: '%s' + Ismeretlen hálózat lett megadva -onlynet: '%s' - Unknown -socks proxy version requested: %i - Ismeretlen -socks proxy kérése: %i + Cannot resolve -bind address: '%s' + Csatlakozási cím (-bind address) feloldása nem sikerült: '%s' - Cannot resolve -bind address: '%s' - Csatlakozási cím (-bind address) feloldása nem sikerült: '%s' + Cannot resolve -externalip address: '%s' + Külső cím (-externalip address) feloldása nem sikerült: '%s' - Cannot resolve -externalip address: '%s' - Külső cím (-externalip address) feloldása nem sikerült: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Étvénytelen -paytxfee=<összeg> összeg: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Étvénytelen -paytxfee=<összeg> összeg: '%s' Invalid amount @@ -3387,13 +2467,5 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error Hiba - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Be kell állítani rpcpassword=<password> a konfigurációs fájlban -%s -Ha a fájl nem létezik, hozd létre 'csak a felhasználó által olvasható' fájl engedéllyel - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_id_ID.ts b/src/qt/locale/bitcoin_id_ID.ts index 2b9685f6a0..80d4141beb 100644 --- a/src/qt/locale/bitcoin_id_ID.ts +++ b/src/qt/locale/bitcoin_id_ID.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - Mengenai Bitcoin Core - - - <b>Bitcoin Core</b> version - versi <b>Bitcoin Core</b> - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Software ini adalah yang bersifat percobaan. - -Dibagikan dengan izin software MIT/X11, bacalah arsip COPYING atau http://www.opensource.org/licenses/mit-license.php. - -Produk ini termasuk software yang dibangun oleh Proyek OpenSSL untuk Toolkit OpenSSL (http://www.openssl.org/) dan software kriptografi dibangun oleh Eric Young (eay@cryptsoft.com) dan software UPnP dibangun oleh Thomas Bernard. - - - Copyright - Copyright - - - The Bitcoin Core developers - Pembangun Bitcoin Core - - - (%1-bit) - - - + AddressBookPage @@ -130,11 +93,7 @@ Produk ini termasuk software yang dibangun oleh Proyek OpenSSL untuk Toolkit Ope Exporting Failed Proses Ekspor Gagal - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -168,10 +127,6 @@ Produk ini termasuk software yang dibangun oleh Proyek OpenSSL untuk Toolkit Ope Repeat new passphrase Ulangi kata kunci baru - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Masukkan kata kunci baru ke dompet.<br/>Mohon gunakan kata kunci dengan <b>10 karakter atau lebih dengan acak</b>, atau <b>delapan kata atau lebih</b>. - Encrypt wallet Enkripsi dompet @@ -212,10 +167,6 @@ Produk ini termasuk software yang dibangun oleh Proyek OpenSSL untuk Toolkit Ope Are you sure you wish to encrypt your wallet? Apakah kamu yakin ingin mengenkripsi dompet anda? - - 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. - - Warning: The Caps Lock key is on! Perhatian: tombol Caps Lock sementara aktif! @@ -295,10 +246,6 @@ Produk ini termasuk software yang dibangun oleh Proyek OpenSSL untuk Toolkit Ope Quit application Keluar dari aplikasi - - Show information about Bitcoin - Tampilkan informasi mengenai Bitcoin - About &Qt Mengenai &Qt @@ -311,10 +258,6 @@ Produk ini termasuk software yang dibangun oleh Proyek OpenSSL untuk Toolkit Ope &Options... &Pilihan... - - &Encrypt Wallet... - %Enkripsi Dompet... - &Backup Wallet... &Cadangkan Dompet... @@ -459,10 +402,6 @@ Produk ini termasuk software yang dibangun oleh Proyek OpenSSL untuk Toolkit Ope Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options Tampilkan pesan bantuan Bitcoin Core untuk memberikan daftar pilihan perintah-baris yang memungkinkan dalam aplikasi Bitcoin - - Bitcoin client - Klien Bitcoin - %n active connection(s) to Bitcoin network %n hubungan aktif ke jaringan Bitcoin @@ -471,10 +410,6 @@ Produk ini termasuk software yang dibangun oleh Proyek OpenSSL untuk Toolkit Ope No block source available... Sumber blok tidak tersedia... - - Processed %1 of %2 (estimated) blocks of transaction history. - Proses % 1 dar i% 2 (perkiraan) blok catatan transaksi - Processed %1 blocks of transaction history. %1 blok-blok riwayat transaksi telah diproses @@ -559,10 +494,6 @@ Alamat: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Dompet saat ini <b>terenkripsi</b> dan <b>terkunci</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Terjadi kesalahan fatal. Bitcoin tidak bisa lagi meneruskan dengan aman dan akan berhenti. - ClientModel @@ -597,10 +528,6 @@ Alamat: %4 Fee: Biaya: - - Low Output: - Jumlah Yang Sedikit: - After Fee: Dengan Biaya: @@ -689,10 +616,6 @@ Alamat: %4 Copy priority Salin prioritas - - Copy low output - Salin jumlah yang sedikit - Copy change Salin uang kembali @@ -741,10 +664,6 @@ Alamat: %4 none tidak satupun - - Dust - Debu - yes ya @@ -770,25 +689,13 @@ Alamat: %4 Makin penting transaksinya, makin kemungkinan akan termasuk dalam blok. - This label turns red, if the priority is smaller than "medium". - Label ini akan berubah merah, jika prioritas lebih kecil dari "medium". + This label turns red, if the priority is smaller than "medium". + Label ini akan berubah merah, jika prioritas lebih kecil dari "medium". This label turns red, if any recipient receives an amount smaller than %1. Label ini akan berubah merah, jika setiap penerima menerima nilai lebih kecil dari %1. - - This means a fee of at least %1 is required. - Berarti perlu biaya lebih dari %1. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - Nilai yang kurang dari 0.546 kali biaya pengiriman minimal akan ditampilkan sebagai debu. - - - This label turns red, if the change is smaller than %1. - Label ini akan berubah merah, jika perubahan itu lebih kecil dari %1. - (no label) (tidak ada label) @@ -841,12 +748,12 @@ Alamat: %4 Ubah alamat mengirim - The entered address "%1" is already in the address book. - Alamat yang dimasukkan "%1" sudah ada di dalam buku alamat. + The entered address "%1" is already in the address book. + Alamat yang dimasukkan "%1" sudah ada di dalam buku alamat. - The entered address "%1" is not a valid Bitcoin address. - Alamat yang dimasukkan "%1" bukan alamat Bitcoin yang benar. + The entered address "%1" is not a valid Bitcoin address. + Alamat yang dimasukkan "%1" bukan alamat Bitcoin yang benar. Could not unlock wallet. @@ -882,10 +789,6 @@ Alamat: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Bitcoin Core - pilihan Perintah-baris - Bitcoin Core Bitcoin Core @@ -894,6 +797,10 @@ Alamat: %4 version versi + + About Bitcoin Core + Mengenai Bitcoin Core + Usage: Penggunaan: @@ -907,26 +814,18 @@ Alamat: %4 pilihan UI - Set language, for example "de_DE" (default: system locale) - Atur bahasa, sebagai contoh "id_ID" (standar: system locale) + Set language, for example "de_DE" (default: system locale) + Atur bahasa, sebagai contoh "id_ID" (standar: system locale) Start minimized Memulai terminimalisi - - Set SSL root certificates for payment request (default: -system-) - - Show splash screen on startup (default: 1) Tampilkan layar pembuka saat nyala (standar: 1) - - Choose data directory on startup (default: 0) - - - + Intro @@ -937,14 +836,6 @@ Alamat: %4 Welcome to Bitcoin Core. Selamat Datang ke Bitcoin Core - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - Use the default data directory Menggunakan direktori untuk data yang biasa. @@ -954,12 +845,8 @@ Alamat: %4 Menggunakan direktori data yang dipilih Anda: - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - Gagal: Direktori untuk data "%1" tidak bisa dibuat. + Bitcoin Core + Bitcoin Core Error @@ -1023,18 +910,10 @@ Alamat: %4 &Start Bitcoin on system login &Menyalakan Bitcoin pada login sistem - - Size of &database cache - - MB MB - - Number of script &verification threads - - Connect to the Bitcoin network through a SOCKS proxy. Menghubungkan jaringan Bitcoin lewat proxy SOCKS. @@ -1047,13 +926,9 @@ Alamat: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Alamat IP proxy (cth. IPv4: 127.0.0.1 / IPv6: ::1) - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - Third party transaction URLs - + Transaksi URLs pihak ketiga Active command-line options that override above options: @@ -1071,10 +946,6 @@ Alamat: %4 &Network &Jaringan - - (0 = auto, <0 = leave that many cores free) - - W&allet D&ompet @@ -1115,14 +986,6 @@ Alamat: %4 Port of the proxy (e.g. 9050) Port proxy (cth. 9050) - - SOCKS &Version: - Versi &SOCKS: - - - SOCKS version of the proxy (e.g. 5) - Versi proxy SOCKS (cth. 5) - &Window &Jendela @@ -1163,14 +1026,6 @@ Alamat: %4 Choose the default subdivision unit to show in the interface and when sending coins. Pilihan standar unit yang ingin ditampilkan pada layar aplikasi dan saat mengirim koin. - - Whether to show Bitcoin addresses in the transaction list or not. - Apakah menampilkan alamat-alamat Bitcoin dalam daftar transaksi atau tidak. - - - &Display addresses in transaction list - &Tampilkan alamat dalam daftar transaksi - Whether to show coin control features or not. Ingin menunjukkan cara pengaturan koin atau tidak. @@ -1197,15 +1052,15 @@ Alamat: %4 Client restart required to activate changes. - + Restart klien diperlukan untuk mengaktifkan perubahan. Client will be shutdown, do you want to proceed? - + Klien akan dimatikan, apakah anda hendak melanjutkan? This change would require a client restart. - + Perubahan ini akan memerlukan restart klien The supplied proxy address is invalid. @@ -1274,8 +1129,8 @@ Alamat: %4 Penanganan URI - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI tidak bisa dimengerti! Biasanya oleh karena alamat Bitcoin yang tidak sah atau persoalan tentang parameter-parameter URI. + Invalid payment address %1 + Alamat pembayaran salah %1 Requested payment amount of %1 is too small (considered dust). @@ -1285,34 +1140,6 @@ Alamat: %4 Payment request error Gagalan permintaan pembayaran - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - Proxy Anda tidak mendukung SOCKS5, yang diperlu untuk permintaan pembayaran melalui proxy. - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - Refund from %1 Pembayaran kembali dari %1 @@ -1321,10 +1148,6 @@ Alamat: %4 Error communicating with %1: %2 Masalah berkomunikasi dengan %1: %2 - - Payment request can not be parsed or processed! - - Bad response from server %1 Jawaban salah dari server %1 @@ -1338,33 +1161,28 @@ Alamat: %4 Gagalan permintaan dari jaringan + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Nilai - Error: Specified data directory "%1" does not exist. - Gagal: Tidak ada direktori untuk data "%1". + %1 h + %1 Jam - Error: Cannot parse configuration file: %1. Only use key=value syntax. - Kesalahan: Tidak dapat memproses pengaturan berkas: %1. Hanya menggunakan kunci= nilai sintak. + %1 m + %1 menit - Error: Invalid combination of -regtest and -testnet. - Gagal: Gabungan -regtest dan -testnet salah + N/A + T/S - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Masukkan alamat Bitcoin (cth. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget @@ -1438,10 +1256,6 @@ Alamat: %4 Current number of blocks Jumlah blok terkini - - Estimated total blocks - Perkiraan jumlah blok - Last block time Waktu blok terakhir @@ -1518,19 +1332,7 @@ Alamat: %4 %1 GB %1 GB - - %1 m - %1 menit - - - %1 h - %1 Jam - - - %1 h %2 m - %1 Jam %2 menit - - + ReceiveCoinsDialog @@ -1545,18 +1347,10 @@ Alamat: %4 &Message: &Pesan: - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - R&euse an existing receiving address (not recommended) Gunakan lagi alamat penerima yang ada (tidak disarankan) - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - An optional label to associate with the new receiving address. Label opsional untuk mengasosiasikan dengan alamat penerima baru. @@ -1742,10 +1536,6 @@ Alamat: %4 Fee: Biaya: - - Low Output: - Jumlah Yang Sedikit: - After Fee: Dengan Biaya: @@ -1774,10 +1564,6 @@ Alamat: %4 Clear all fields of the form. Hapus informasi dari form. - - Clear &All - Hapus %Semua - Balance: Saldo: @@ -1822,10 +1608,6 @@ Alamat: %4 Copy priority Salin prioritas - - Copy low output - Salin jumlah yang sedikit - Copy change Salin uang kembali @@ -1874,10 +1656,6 @@ Alamat: %4 (no label) (tidak ada label) - - Warning: Unknown change address - - Are you sure you want to send? Apakah Anda yakin ingin kirim? @@ -1886,14 +1664,6 @@ Alamat: %4 added as transaction fee ditambahkan sebagai biaya transaksi - - Payment request expired - Permintaan pembayaran telah kadaluarsa - - - Invalid payment address %1 - Alamat pembayaran salah %1 - SendCoinsEntry @@ -1905,10 +1675,6 @@ Alamat: %4 Pay &To: Kirim &Ke: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Alamat pembayaran (cth. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Masukkan label bagi alamat ini untuk menambahkannya ke buku alamat Anda @@ -1923,7 +1689,7 @@ Alamat: %4 This is a normal payment. - + Ini adalah pembayaran normal Alt+A @@ -1939,7 +1705,7 @@ Alamat: %4 Remove this entry - + Hapus masukan ini Message: @@ -1953,10 +1719,6 @@ Alamat: %4 Enter a label for this address to add it to the list of used addresses Masukkan label untuk alamat ini untuk dimasukan dalam daftar alamat yang pernah digunakan - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - This is an unverified payment request. Permintaan pembayaran tidak terverifikasi. @@ -1991,14 +1753,6 @@ Alamat: %4 &Sign Message &Tandakan Pesan - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Alamat yang akan ditandai pesan (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Choose previously used address Pilih alamat yang telah digunakan sebelumnya @@ -2039,26 +1793,10 @@ Alamat: %4 Reset all sign message fields Hapus semua bidang penanda pesan - - Clear &All - Hapus %Semua - &Verify Message &Verifikasi Pesan - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - Verify &Message Verifikasi &Pesan @@ -2068,12 +1806,8 @@ Alamat: %4 Hapus semua bidang verifikasi pesan - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Masukkan alamat Bitcoin (cth. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - + Click "Sign Message" to generate signature + Tekan "Tandatangan Pesan" untuk menghasilan tanda tangan The entered address is invalid. @@ -2244,10 +1978,6 @@ Alamat: %4 Merchant Pedagang - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - Debug information Informasi debug @@ -2310,10 +2040,6 @@ Alamat: %4 Address Alamat - - Amount - Nilai - Immature (%1 confirmations, will be available after %2) Terlalu muda (cuma %1 konfirmasi, akan siap sesudah %2) @@ -2489,10 +2215,6 @@ Alamat: %4 Exporting Failed Proses Ekspor Gagal - - There was an error trying to save the transaction history to %1. - - Exporting Successful Proses Ekspor Berhasil @@ -2525,10 +2247,6 @@ Alamat: %4 Address Alamat - - Amount - Nilai - ID ID @@ -2542,6 +2260,9 @@ Alamat: %4 ke + + UnitDisplayStatusBarControl + WalletFrame @@ -2578,10 +2299,6 @@ Alamat: %4 Backup Failed Cadangkgan Gagal - - There was an error trying to save the wallet data to %1. - - The wallet data was successfully saved to %1. Informasi dalam dompet berhasil disimpan di %1. @@ -2593,18 +2310,6 @@ Alamat: %4 bitcoin-core - - Usage: - Penggunaan: - - - List commands - Daftar perintah - - - Get help for a command - Dapatkan bantuan untuk perintah - Options: Pilihan: @@ -2645,22 +2350,10 @@ Alamat: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Jumlah kedua untuk menjaga peer buruk dari hubung-ulang (standar: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - Accept command line and JSON-RPC commands Menerima perintah baris perintah dan JSON-RPC - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Berjalan dibelakang sebagai daemin dan menerima perintah @@ -2673,89 +2366,18 @@ Alamat: %4 Accept connections from outside (default: 1 if no -proxy or -connect) Terima hubungan dari luar (standar: 1 kalau -proxy atau -connect tidak dipilih) - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Sandi yang diterima (biasanya: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Gagal: Transaksi ditolak. Ini mungkin terjadi jika beberapa dari koin dalam dompet Anda telah digunakan, seperti ketika Anda menggunakan salinan wallet.dat dan beberapa koin telah dibelanjakan dalam salinan tersebut tetapi disini tidak tertandai sebagai terpakai. - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Jalankan perintah ketika perubahan transaksi dompet (%s di cmd digantikan oleh TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. Tidak bisa mengikat dengan %s di computer ini. Kemungkinan Bitcoin Core sudah mulai. @@ -2768,10 +2390,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Peringatan: -paytxfee sangat besar! Ini adalah biaya pengiriman yang akan dibayar oleh Anda jika transaksi terkirim. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Perhatian: Mohon diperiksa pengaturan tanggal dan waktu komputer anda apakah sudah benar! Jika pengaturan waktu salah aplikasi Bitcoin tidak akan berjalan dengan tepat. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Peringatan: Jaringan tidak semua bersetuju! Beberapa penambang dapat persoalan. @@ -2784,10 +2402,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. Awas: wallet.dat tidak bisa dibaca! Berhasil periksakan kunci-kunci dalam arsipnya, tetapi ada kemungkinan informasi tentang transaksi atau isi-isi buku alamat salah atau terhilang. - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - (default: 1) (pengaturan awal: 1) @@ -2796,38 +2410,18 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. (default: wallet.dat) (pengaturan awal: wallet.dat) - - <category> can be: - - Attempt to recover private keys from a corrupt wallet.dat Coba memulihkan kunci-kunci pribadi dari wallet.dat yang rusak - - Bitcoin Core Daemon - Daemon Bitcoin Core - Block creation options: Pilihan pembuatan blok: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) Jangan menghubungkan node(-node) selain yang di daftar - - Connect through SOCKS proxy - Hubungkan melalui proxy SOCKS - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - Connection options: Pilih koneksi: @@ -2836,21 +2430,13 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Corrupted block database detected Menemukan database blok yang rusak - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - Discover own IP address (default: 1 when listening and no -externalip) Cari alamat IP Anda sendiri (biasanya: 1 saat mendengarkan dan -externalip tidak terpilih) Do not load the wallet and disable wallet RPC calls - + Jangan memuat dompet dan menonaktifkan panggilan dompet RPC Do you want to rebuild the block database now? @@ -2884,10 +2470,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error: system error: Error: system error: - - Failed to listen on any port. Use -listen=0 if you want this. - - Failed to read block info Gagal membaca informasi dari blok @@ -2918,7 +2500,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write to coin database - + Gagal menuliskan ke dalam database koin Failed to write transaction index @@ -2926,23 +2508,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write undo data - - - - Fee per kB to add to transactions you send - Biaya untuk setiap kB yang akan ditambahkan ke transaksi yang Anda kirim - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - Cari peer dengan daftar alamat DNS (biasanya: 1 jika -connect tidak terpilih) - - - Force safe mode (default: 0) - + Gagal menulis ulang data Generate coins (default: 0) @@ -2952,10 +2518,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. How many blocks to check at startup (default: 288, 0 = all) Periksakan berapa blok waktu mulai (biasanya: 288, 0 = setiapnya) - - If <category> is not supplied, output all debugging information. - - Importing... mengimpor... @@ -2965,33 +2527,13 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Tidak bisa cari blok pertama, atau blok pertama salah. Salah direktori untuk jaringan? - Invalid -onion address: '%s' - Alamat -onion salah: '%s' + Invalid -onion address: '%s' + Alamat -onion salah: '%s' Not enough file descriptors available. Deskripsi berkas tidak tersedia dengan cukup. - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - Pilihan RPC klien: - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - Pililah versi SOCKS untuk -proxy (4 atau 5, biasanya: 5) - - - Set database cache size in megabytes (%d to %d, default: %d) - - Set maximum block size in bytes (default: %d) Atur ukuran maksimal untuk blok dalam byte (biasanya: %d) @@ -3008,14 +2550,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Spend unconfirmed change when sending transactions (default: 1) Perubahan saldo untuk transaksi yang belum dikonfirmasi setelah transaksi terkirim (default: 1) - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - Verifying blocks... Blok-blok sedang diverifikasi... @@ -3024,21 +2558,13 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Verifying wallet... Dompet sedang diverifikasi... - - Wait for RPC server to start - Tunggu sampai server RPC dimulai - Wallet %s resides outside data directory %s Dompet %s ada diluar direktori data %s Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - + Opsi dompet: You need to rebuild the database using -reindex to change -txindex @@ -3052,93 +2578,29 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. Tidak bisa mengunci data directory %s. Kemungkinan Bitcoin Core sudah mulai. - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information Informasi - Invalid amount for -minrelaytxfee=<amount>: '%s' - Nilai yang salah untuk -minrelaytxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Nilai yang salah untuk -minrelaytxfee=<amount>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - Nilai yang salah untuk -mintxfee=<amount>: '%s' - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - + Invalid amount for -mintxfee=<amount>: '%s' + Nilai yang salah untuk -mintxfee=<amount>: '%s' Maintain a full transaction index (default: 0) Jaga daftar transaksi yang lengkap (biasanya: 0) - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) Dilarang menghubungkan node-node selain <net> (IPv4, IPv6 atau Tor) - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - Pilihan SSL: (petunjuk pengaturan SSL lihat dalam Bitcoin Wiki) - - - Send command to Bitcoin Core - + Opsi server RPC: Send trace/debug info to console instead of debug.log file @@ -3148,18 +2610,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Set minimum block size in bytes (default: 0) Atur ukuran minimal untuk blok dalam byte (standar: 0) - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - Shrink debug.log file on client startup (default: 1 when no -debug) Mengecilkan berkas debug.log saat klien berjalan (Standar: 1 jika tidak -debug) @@ -3172,10 +2622,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Specify connection timeout in milliseconds (default: 5000) Menetapkan waktu berakhir koneksi di milidetik (biasanya: 5000) - - Start Bitcoin Core Daemon - Memulai Bitcoin Core Daemon - System error: Kesalahan sistem: @@ -3192,14 +2638,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Transaction too large Transaksi terlalu besar - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - Username for JSON-RPC connections Nama pengguna untuk hubungan JSON-RPC @@ -3214,15 +2652,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Zapping all transactions from wallet... - Setiap transaksi dalam dompet sedang di-'Zap'... - - - on startup - - - - version - versi + Setiap transaksi dalam dompet sedang di-'Zap'... wallet.dat corrupt, salvage failed @@ -3232,14 +2662,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Password for JSON-RPC connections Kata sandi untuk hubungan JSON-RPC - - Allow JSON-RPC connections from specified IP address - Izinkan hubungan JSON-RPC dari alamat IP yang ditentukan - - - Send commands to node running on <ip> (default: 127.0.0.1) - Kirim perintah ke node berjalan pada <ip> (standar: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Menjalankan perintah ketika perubahan blok terbaik (%s dalam cmd digantikan oleh hash blok) @@ -3272,10 +2694,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message Pesan bantuan ini - - Unable to bind to %s on this computer (bind returned error %d, %s) - Tidak dapat mengikat ke %s dengan komputer ini (ikatan gagal %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Izinkan peninjauan DNS untuk -addnote, -seednode dan -connect @@ -3288,41 +2706,29 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted Gagal memuat wallet.dat: Dompet rusak - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Gagal memuat wallet.dat: Dompet memerlukan versi Bitcoin yang terbaru - - - Wallet needed to be rewritten: restart Bitcoin to complete - Dompet diperlukan untuk disimpan-ulang: nyala-ulangkan Bitcoin untuk menyelesaikan - Error loading wallet.dat Gagal memuat wallet.dat - Invalid -proxy address: '%s' - Alamat -proxy salah: '%s' + Invalid -proxy address: '%s' + Alamat -proxy salah: '%s' - Unknown network specified in -onlynet: '%s' - Jaringan tidak diketahui yang ditentukan dalam -onlynet: '%s' + Unknown network specified in -onlynet: '%s' + Jaringan tidak diketahui yang ditentukan dalam -onlynet: '%s' - Unknown -socks proxy version requested: %i - Diminta versi proxy -socks tidak diketahui: %i + Cannot resolve -bind address: '%s' + Tidak dapat menyelesaikan alamat -bind: '%s' - Cannot resolve -bind address: '%s' - Tidak dapat menyelesaikan alamat -bind: '%s' + Cannot resolve -externalip address: '%s' + Tidak dapat menyelesaikan alamat -externalip: '%s' - Cannot resolve -externalip address: '%s' - Tidak dapat menyelesaikan alamat -externalip: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Nilai salah untuk -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Nilai salah untuk -paytxfee=<amount>: '%s' Invalid amount @@ -3368,13 +2774,5 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error Gagal - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Anda harus mengatur rpcpassword=<kata sandi> dalam berkas konfigurasi: -%s -Jika berkas tidak ada, buatlah dengan permisi berkas hanya-dapat-dibaca-oleh-pemilik. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_it.ts b/src/qt/locale/bitcoin_it.ts index cb9fed1ab9..a803241d10 100644 --- a/src/qt/locale/bitcoin_it.ts +++ b/src/qt/locale/bitcoin_it.ts @@ -1,46 +1,9 @@ - - - AboutDialog - - About Bitcoin Core - Info su Bitcoin Core - - - <b>Bitcoin Core</b> version - Versione <b>Bitcoin Core</b> - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Questo è un software sperimentale. - -Distribuito sotto la licenza software MIT/X11, vedi il file COPYING incluso oppure su http://www.opensource.org/licenses/mit-license.php. - -Questo prodotto include software sviluppato dal progetto OpenSSL per l'uso del Toolkit OpenSSL (http://www.openssl.org/), software crittografico scritto da Eric Young (eay@cryptsoft.com) e software UPnP scritto da Thomas Bernard. - - - Copyright - Copyright - - - The Bitcoin Core developers - Gli sviluppatori del Bitcoin Core - - - (%1-bit) - (%1-bit) - - + AddressBookPage Double-click to edit address or label - Doppio click per modificare l'indirizzo o l'etichetta + Doppio click per modificare l'indirizzo o l'etichetta Create a new address @@ -52,7 +15,7 @@ Questo prodotto include software sviluppato dal progetto OpenSSL per l'uso Copy the currently selected address to the system clipboard - Copia l'indirizzo attualmente selezionato negli appunti + Copia l'indirizzo attualmente selezionato negli appunti &Copy @@ -64,11 +27,11 @@ Questo prodotto include software sviluppato dal progetto OpenSSL per l'uso &Copy Address - &Copia l'indirizzo + &Copia l'indirizzo Delete the currently selected address from the list - Cancella l'indirizzo attualmente selezionato dalla lista + Cancella l'indirizzo attualmente selezionato dalla lista Export the data in the current tab to a file @@ -84,11 +47,11 @@ Questo prodotto include software sviluppato dal progetto OpenSSL per l'uso Choose the address to send coins to - Scegli l'indirizzo a cui inviare bitcoin + Scegli l'indirizzo a cui inviare bitcoin Choose the address to receive coins with - Scegli l'indirizzo con cui ricevere bitcoin + Scegli l'indirizzo con cui ricevere bitcoin C&hoose @@ -96,7 +59,7 @@ Questo prodotto include software sviluppato dal progetto OpenSSL per l'uso Sending addresses - Indirizzi d'invio + Indirizzi d'invio Receiving addresses @@ -104,7 +67,7 @@ Questo prodotto include software sviluppato dal progetto OpenSSL per l'uso These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - Questo è un elenco di indirizzi bitcoin a cui puoi inviare pagamenti. Controlla sempre l'importo e l'indirizzo del beneficiario prima di inviare bitcoin. + Questo è un elenco di indirizzi bitcoin a cui puoi inviare pagamenti. Controlla sempre l'importo e l'indirizzo del beneficiario prima di inviare bitcoin. These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. @@ -112,7 +75,7 @@ Questo prodotto include software sviluppato dal progetto OpenSSL per l'uso Copy &Label - Copia &l'etichetta + Copia &l'etichetta &Edit @@ -130,11 +93,7 @@ Questo prodotto include software sviluppato dal progetto OpenSSL per l'uso Exporting Failed Esportazione Fallita. - - There was an error trying to save the address list to %1. - Si è verificato un errore tentando di salvare la lista degli indirizzi in %1. - - + AddressTableModel @@ -168,17 +127,13 @@ Questo prodotto include software sviluppato dal progetto OpenSSL per l'uso Repeat new passphrase Ripeti la nuova passphrase - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Inserisci la nuova passphrase per il portamonete.<br/>Si prega di usare una passphrase di <b>10 o più caratteri casuali</b>, o di <b>otto o più parole</b>. - Encrypt wallet Cifra il portamonete This operation needs your wallet passphrase to unlock the wallet. - Quest'operazione necessita della passphrase per sbloccare il portamonete. + Quest'operazione necessita della passphrase per sbloccare il portamonete. Unlock wallet @@ -186,7 +141,7 @@ Questo prodotto include software sviluppato dal progetto OpenSSL per l'uso This operation needs your wallet passphrase to decrypt the wallet. - Quest'operazione necessita della passphrase per decifrare il portamonete, + Quest'operazione necessita della passphrase per decifrare il portamonete, Decrypt wallet @@ -295,10 +250,6 @@ Questo prodotto include software sviluppato dal progetto OpenSSL per l'uso Quit application Chiudi applicazione - - Show information about Bitcoin - Mostra informazioni su Bitcoin - About &Qt Informazioni su &Qt @@ -325,7 +276,7 @@ Questo prodotto include software sviluppato dal progetto OpenSSL per l'uso &Sending addresses... - &Indirizzi d'invio... + &Indirizzi d'invio... &Receiving addresses... @@ -421,7 +372,7 @@ Questo prodotto include software sviluppato dal progetto OpenSSL per l'uso Tabs toolbar - Barra degli strumenti "Tabs" + Barra degli strumenti "Tabs" [testnet] @@ -459,10 +410,6 @@ Questo prodotto include software sviluppato dal progetto OpenSSL per l'uso Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options Mostra il messaggio di aiuto di Bitcoin Core per avere la lista di tutte le opzioni della riga di comando di Bitcoin. - - Bitcoin client - Bitcoin client - %n active connection(s) to Bitcoin network %n connessione attiva alla rete Bitcoin%n connessioni attive alla rete Bitcoin @@ -471,10 +418,6 @@ Questo prodotto include software sviluppato dal progetto OpenSSL per l'uso No block source available... Nessuna fonte di blocchi disponibile - - Processed %1 of %2 (estimated) blocks of transaction history. - Processati %1 di %2 blocchi totali (stimati) della cronologia transazioni. - Processed %1 blocks of transaction history. Processati %1 blocchi della cronologia transazioni. @@ -505,7 +448,7 @@ Questo prodotto include software sviluppato dal progetto OpenSSL per l'uso Last received block was generated %1 ago. - L'ultimo blocco ricevuto è stato generato %1 fa. + L'ultimo blocco ricevuto è stato generato %1 fa. Transactions after this will not yet be visible. @@ -560,10 +503,6 @@ Indirizzo: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Il portamonete è <b>cifrato</b> ed attualmente <b>bloccato</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Riscontrato un errore irreversibile. Bitcoin non può più continuare in sicurezza e sarà terminato. - ClientModel @@ -598,10 +537,6 @@ Indirizzo: %4 Fee: Commissione: - - Low Output: - Low Output: - After Fee: Dopo Commissione: @@ -648,19 +583,19 @@ Indirizzo: %4 Copy address - Copia l'indirizzo + Copia l'indirizzo Copy label - Copia l'etichetta + Copia l'etichetta Copy amount - Copia l'importo + Copia l'importo Copy transaction ID - Copia l'ID transazione + Copia l'ID transazione Lock unspent @@ -690,10 +625,6 @@ Indirizzo: %4 Copy priority Copia priorità - - Copy low output - Copia low output - Copy change Copia resto @@ -742,10 +673,6 @@ Indirizzo: %4 none nessuno - - Dust - Trascurabile - yes @@ -771,25 +698,13 @@ Indirizzo: %4 Le transazioni con priorità più alta hanno più probabilità di essere incluse in un blocco. - This label turns red, if the priority is smaller than "medium". - Questa etichetta diventa rossa se la priorità è inferiore a "media". + This label turns red, if the priority is smaller than "medium". + Questa etichetta diventa rossa se la priorità è inferiore a "media". This label turns red, if any recipient receives an amount smaller than %1. Questa etichetta diventa rossa se uno qualsiasi dei destinatari riceve un ammontare inferiore di %1. - - This means a fee of at least %1 is required. - Questo significa che è richiesta una commissione di almeno %1 - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - Importi inferiori a 0,546 volte la commissione minima di trasferimento sono mostrati come trascurabili. - - - This label turns red, if the change is smaller than %1. - Questa etichetta diventa rossa se il resto è minore di %1. - (no label) (nessuna etichetta) @@ -807,7 +722,7 @@ Indirizzo: %4 EditAddressDialog Edit Address - Modifica l'indirizzo + Modifica l'indirizzo &Label @@ -815,11 +730,11 @@ Indirizzo: %4 The label associated with this address list entry - L'etichetta associata con questa voce della lista degli indirizzi + L'etichetta associata con questa voce della lista degli indirizzi The address associated with this address list entry. This can only be modified for sending addresses. - L'indirizzo associato a questa voce della rubrica. Può essere modificato solo per gli indirizzi d'invio. + L'indirizzo associato a questa voce della rubrica. Può essere modificato solo per gli indirizzi d'invio. &Address @@ -831,7 +746,7 @@ Indirizzo: %4 New sending address - Nuovo indirizzo d'invio + Nuovo indirizzo d'invio Edit receiving address @@ -839,15 +754,15 @@ Indirizzo: %4 Edit sending address - Modifica indirizzo d'invio + Modifica indirizzo d'invio - The entered address "%1" is already in the address book. - L'indirizzo inserito "%1" è già in rubrica. + The entered address "%1" is already in the address book. + L'indirizzo inserito "%1" è già in rubrica. - The entered address "%1" is not a valid Bitcoin address. - L'indirizzo inserito "%1" non è un indirizzo bitcoin valido. + The entered address "%1" is not a valid Bitcoin address. + L'indirizzo inserito "%1" non è un indirizzo bitcoin valido. Could not unlock wallet. @@ -883,10 +798,6 @@ Indirizzo: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Bitcoin Core - Opzioni riga di comando - Bitcoin Core Bitcoin Core @@ -895,6 +806,18 @@ Indirizzo: %4 version versione + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + Info su Bitcoin Core + + + Command-line options + opzioni riga di comando + Usage: Utilizzo: @@ -908,8 +831,8 @@ Indirizzo: %4 UI opzioni - Set language, for example "de_DE" (default: system locale) - Imposta lingua, ad esempio "it_IT" (predefinita: lingua di sistema) + Set language, for example "de_DE" (default: system locale) + Imposta lingua, ad esempio "it_IT" (predefinita: lingua di sistema) Start minimized @@ -921,11 +844,11 @@ Indirizzo: %4 Show splash screen on startup (default: 1) - Mostra finestra di presentazione all'avvio (predefinito: 1) + Mostra finestra di presentazione all'avvio (predefinito: 1) Choose data directory on startup (default: 0) - Scegli una cartella dati all'avvio (predefinito: 0) + Scegli una cartella dati all'avvio (predefinito: 0) @@ -955,12 +878,8 @@ Indirizzo: %4 Usa una cartella dati personalizzata: - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - Errore: La cartella dati "%1" specificata non può essere creata. + Bitcoin Core + Bitcoin Core Error @@ -1018,11 +937,11 @@ Indirizzo: %4 Automatically start Bitcoin after logging in to the system. - Avvia automaticamente Bitcoin una volta effettuato l'accesso al sistema. + Avvia automaticamente Bitcoin una volta effettuato l'accesso al sistema. &Start Bitcoin on system login - &Avvia Bitcoin all'accesso al sistema + &Avvia Bitcoin all'accesso al sistema Size of &database cache @@ -1050,7 +969,7 @@ Indirizzo: %4 Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - URL di terze parti (es: un block explorer) che appaiono nella tabella delle transazioni come voci nel menu contestuale. %s nell'URL è sostituito dall'hash della transazione. + URL di terze parti (es: un block explorer) che appaiono nella tabella delle transazioni come voci nel menu contestuale. %s nell'URL è sostituito dall'hash della transazione. Più URL vengono separati da una barra verticale |. @@ -1091,11 +1010,11 @@ Più URL vengono separati da una barra verticale |. 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. - Disabilitando l'uso di resti non confermati, il resto di una transazione non potrà essere speso fino a quando la transazione non avrà ottenuto almeno una conferma. Questa impostazione influisce inoltre sul calcolo saldo. + Disabilitando l'uso di resti non confermati, il resto di una transazione non potrà essere speso fino a quando la transazione non avrà ottenuto almeno una conferma. Questa impostazione influisce inoltre sul calcolo saldo. &Spend unconfirmed change - %Spendere resti non confermati + &Spendere resti non confermati Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. @@ -1117,14 +1036,6 @@ Più URL vengono separati da una barra verticale |. Port of the proxy (e.g. 9050) Porta del proxy (es. 9050) - - SOCKS &Version: - SOCKS &Version: - - - SOCKS version of the proxy (e.g. 5) - Versione SOCKS del proxy (es. 5) - &Window &Finestra @@ -1139,7 +1050,7 @@ Più URL vengono separati da una barra verticale |. Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - Riduci ad icona invece di uscire dall'applicazione quando la finestra viene chiusa. Se l'opzione è attiva, l'applicazione terminerà solo dopo aver selezionato Esci dal menu File. + Riduci ad icona invece di uscire dall'applicazione quando la finestra viene chiusa. Se l'opzione è attiva, l'applicazione terminerà solo dopo aver selezionato Esci dal menu File. M&inimize on close @@ -1155,7 +1066,7 @@ Più URL vengono separati da una barra verticale |. The user interface language can be set here. This setting will take effect after restarting Bitcoin. - La lingua dell'interfaccia utente può essere impostata qui. L'impostazione avrà effetto dopo il riavvio di Bitcoin. + La lingua dell'interfaccia utente può essere impostata qui. L'impostazione avrà effetto dopo il riavvio di Bitcoin. &Unit to show amounts in: @@ -1163,15 +1074,7 @@ Più URL vengono separati da una barra verticale |. Choose the default subdivision unit to show in the interface and when sending coins. - Scegli l'unità di suddivisione predefinita da utilizzare per l'interfaccia e per l'invio di monete. - - - Whether to show Bitcoin addresses in the transaction list or not. - Specifica se gli indirizzi saranno visualizzati nella lista delle transazioni. - - - &Display addresses in transaction list - &Mostra gli indirizzi nella lista delle transazioni + Scegli l'unità di suddivisione predefinita da utilizzare per l'interfaccia e per l'invio di monete. Whether to show coin control features or not. @@ -1211,7 +1114,7 @@ Più URL vengono separati da una barra verticale |. The supplied proxy address is invalid. - L'indirizzo proxy che hai fornito è invalido. + L'indirizzo proxy che hai fornito è invalido. @@ -1276,12 +1179,12 @@ Più URL vengono separati da una barra verticale |. Gestione URI - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - Impossibile interpretare l'URI! Ciò può essere provocato da un indirizzo Bitcoin non valido o da parametri URI non corretti. + Invalid payment address %1 + Indirizzo di pagamento non valido %1 Requested payment amount of %1 is too small (considered dust). - L'importo di pagamento richiesto di %1 è troppo basso (considerato come trascurabile). + L'importo di pagamento richiesto di %1 è troppo basso (considerato come trascurabile). Payment request error @@ -1291,14 +1194,6 @@ Più URL vengono separati da una barra verticale |. Cannot start bitcoin: click-to-pay handler Impossibile avviare bitcoin: gestore click-to-pay - - Net manager warning - Avviso Net manager - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - Il proxy attualmente attivo non supporta SOCKS5, il quale è necessario per richieste di pagamento via proxy. - Payment request fetch URL is invalid: %1 URL di recupero della Richiesta di pagamento non valido: %1 @@ -1307,10 +1202,6 @@ Più URL vengono separati da una barra verticale |. Payment request file handling Gestione del file di richiesta del pagamento - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - Il file di richiesta del pagamento non può essere letto o elaborato! Il file in questione potrebbe essere danneggiato. - Unverified payment requests to custom payment scripts are unsupported. Le richieste di pagamento non verificate verso script di pagamento personalizzati non sono supportate. @@ -1323,10 +1214,6 @@ Più URL vengono separati da una barra verticale |. Error communicating with %1: %2 Errore di comunicazione con %1: %2 - - Payment request can not be parsed or processed! - La richiesta di pagamento non può essere analizzata o processata! - Bad response from server %1 Risposta errata da parte del server %1 @@ -1340,33 +1227,36 @@ Più URL vengono separati da una barra verticale |. Errore di richiesta di rete + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Importo - Error: Specified data directory "%1" does not exist. - Errore: La cartella dati "%1" specificata non esiste. + %1 d + %1 d - Error: Cannot parse configuration file: %1. Only use key=value syntax. - Errore: impossibile interpretare il file di configurazione: %1. Usare esclusivamente la sintassi chiave=valore. + %1 h + %1 h - Error: Invalid combination of -regtest and -testnet. - Errore: combinazione di -regtest e -testnet non valida. + %1 m + %1 m - Bitcoin Core didn't yet exit safely... - Bitcoin Core non si è ancora chiuso con sicurezza... + %1 s + %1 s - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Inserisci un indirizzo Bitcoin (ad esempio 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + N/A + N/D - + QRImageWidget @@ -1440,10 +1330,6 @@ Più URL vengono separati da una barra verticale |. Current number of blocks Numero attuale di blocchi - - Estimated total blocks - Numero totale stimato di blocchi - Last block time Ora del blocco più recente @@ -1521,18 +1407,18 @@ Più URL vengono separati da una barra verticale |. %1 GB - %1 m - %1 m + never + mai - %1 h - %1 h + Yes + Si - %1 h %2 m - %1 h %2 m + No + No - + ReceiveCoinsDialog @@ -1557,11 +1443,11 @@ Più URL vengono separati da una barra verticale |. An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - Un messaggio opzionale da allegare alla richiesta di pagamento, il quale sarà mostrato all'apertura della richiesta. Nota: Il messaggio non sarà inviato con il pagamento sulla rete Bitcoin. + Un messaggio opzionale da allegare alla richiesta di pagamento, il quale sarà mostrato all'apertura della richiesta. Nota: Il messaggio non sarà inviato con il pagamento sulla rete Bitcoin. An optional label to associate with the new receiving address. - Un'etichetta facoltativa da associare al nuovo indirizzo di ricezione + Un'etichetta facoltativa da associare al nuovo indirizzo di ricezione Use this form to request payments. All fields are <b>optional</b>. @@ -1605,7 +1491,7 @@ Più URL vengono separati da una barra verticale |. Copy label - Copia l'etichetta + Copia l'etichetta Copy message @@ -1613,7 +1499,7 @@ Più URL vengono separati da una barra verticale |. Copy amount - Copia l'importo + Copia l'importo @@ -1664,11 +1550,11 @@ Più URL vengono separati da una barra verticale |. Resulting URI too long, try to reduce the text for label / message. - L'URI risultante è troppo lungo, prova a ridurre il testo nell'etichetta / messaggio. + L'URI risultante è troppo lungo, prova a ridurre il testo nell'etichetta / messaggio. Error encoding URI into QR Code. - Errore nella codifica dell'URI nel codice QR + Errore nella codifica dell'URI nel codice QR @@ -1744,10 +1630,6 @@ Più URL vengono separati da una barra verticale |. Fee: Commissione: - - Low Output: - Low Output: - After Fee: Dopo Commissione: @@ -1758,7 +1640,7 @@ Più URL vengono separati da una barra verticale |. If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - Se questo è abilitato e l'indirizzo per il resto è vuoto o invalido, il resto sarà inviato ad un nuovo indirizzo bitcoin generato appositamente. + Se questo è abilitato e l'indirizzo per il resto è vuoto o invalido, il resto sarà inviato ad un nuovo indirizzo bitcoin generato appositamente. Custom change address @@ -1786,7 +1668,7 @@ Più URL vengono separati da una barra verticale |. Confirm the send action - Conferma l'azione di invio + Conferma l'azione di invio S&end @@ -1794,7 +1676,7 @@ Più URL vengono separati da una barra verticale |. Confirm send coins - Conferma l'invio di bitcoin + Conferma l'invio di bitcoin %1 to %2 @@ -1806,7 +1688,7 @@ Più URL vengono separati da una barra verticale |. Copy amount - Copia l'importo + Copia l'importo Copy fee @@ -1824,10 +1706,6 @@ Più URL vengono separati da una barra verticale |. Copy priority Copia priorità - - Copy low output - Copia low output - Copy change Copia resto @@ -1842,15 +1720,15 @@ Più URL vengono separati da una barra verticale |. The recipient address is not valid, please recheck. - L'indirizzo del beneficiario non è valido, si prega di ricontrollare. + L'indirizzo del beneficiario non è valido, si prega di ricontrollare. The amount to pay must be larger than 0. - L'importo da pagare dev'essere maggiore di 0. + L'importo da pagare dev'essere maggiore di 0. The amount exceeds your balance. - L'importo è superiore al tuo saldo attuale + L'importo è superiore al tuo saldo attuale The total exceeds your balance when the %1 transaction fee is included. @@ -1858,7 +1736,7 @@ Più URL vengono separati da una barra verticale |. Duplicate address found, can only send to each address once per send operation. - Rilevato un indirizzo duplicato, è possibile inviare bitcoin una sola volta agli indirizzi durante un'operazione di invio. + Rilevato un indirizzo duplicato, è possibile inviare bitcoin una sola volta agli indirizzi durante un'operazione di invio. Transaction creation failed! @@ -1888,14 +1766,6 @@ Più URL vengono separati da una barra verticale |. added as transaction fee aggiunto come tassa di transazione - - Payment request expired - Richiesta di pagamento scaduta - - - Invalid payment address %1 - Indirizzo di pagamento non valido %1 - SendCoinsEntry @@ -1907,13 +1777,9 @@ Più URL vengono separati da una barra verticale |. Pay &To: Paga &a: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - L'indirizzo del beneficiario a cui inviare il pagamento (ad esempio 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book - Inserisci un'etichetta per questo indirizzo, per aggiungerlo nella rubrica + Inserisci un'etichetta per questo indirizzo, per aggiungerlo nella rubrica &Label: @@ -1933,7 +1799,7 @@ Più URL vengono separati da una barra verticale |. Paste address from clipboard - Incollare l'indirizzo dagli appunti + Incollare l'indirizzo dagli appunti Alt+P @@ -1953,7 +1819,7 @@ Più URL vengono separati da una barra verticale |. Enter a label for this address to add it to the list of used addresses - Inserisci un'etichetta per questo indirizzo per aggiungerlo alla lista degli indirizzi utilizzati + Inserisci un'etichetta per questo indirizzo per aggiungerlo alla lista degli indirizzi utilizzati A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. @@ -1997,10 +1863,6 @@ Più URL vengono separati da una barra verticale |. You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Puoi firmare messaggi con i tuoi indirizzi in modo da dimostrarne il possesso. Presta attenzione a non firmare dichiarazioni vaghe, attacchi di phishing potrebbero cercare di spingerti ad apporre la tua firma su di esse. Firma solo dichiarazioni completamente dettagliate e delle quali condividi in pieno il contenuto. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - L'indirizzo con cui firmare il messaggio (ad esempio 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Choose previously used address Scegli un indirizzo usato precedentemente @@ -2011,7 +1873,7 @@ Più URL vengono separati da una barra verticale |. Paste address from clipboard - Incolla l'indirizzo dagli appunti + Incolla l'indirizzo dagli appunti Alt+P @@ -2051,15 +1913,11 @@ Più URL vengono separati da una barra verticale |. Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - Inserisci l'indirizzo del firmatario, il messaggio (assicurati di copiare esattamente anche i ritorni a capo, gli spazi, le tabulazioni, etc..) e la firma qui sotto, per verificare il messaggio. Presta attenzione a non vedere nella firma più di quanto non sia riportato nel messaggio stesso, per evitare di cadere vittima di attacchi di tipo man-in-the-middle. - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - L'indirizzo con cui è stato firmato il messaggio (ad esempio 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + Inserisci l'indirizzo del firmatario, il messaggio (assicurati di copiare esattamente anche i ritorni a capo, gli spazi, le tabulazioni, etc..) e la firma qui sotto, per verificare il messaggio. Presta attenzione a non vedere nella firma più di quanto non sia riportato nel messaggio stesso, per evitare di cadere vittima di attacchi di tipo man-in-the-middle. Verify the message to ensure it was signed with the specified Bitcoin address - Verifica il messaggio per accertare che sia stato firmato con l'indirizzo specificato + Verifica il messaggio per accertare che sia stato firmato con l'indirizzo specificato Verify &Message @@ -2070,24 +1928,20 @@ Più URL vengono separati da una barra verticale |. Reimposta tutti i campi della verifica messaggio - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Inserisci un indirizzo Bitcoin (ad esempio 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Clicca "Firma il messaggio" per ottenere la firma + Click "Sign Message" to generate signature + Clicca "Firma il messaggio" per ottenere la firma The entered address is invalid. - L'indirizzo inserito non è valido. + L'indirizzo inserito non è valido. Please check the address and try again. - Per favore controlla l'indirizzo e prova ancora + Per favore controlla l'indirizzo e prova ancora The entered address does not refer to a key. - L'indirizzo bitcoin inserito non è associato a nessuna chiave. + L'indirizzo bitcoin inserito non è associato a nessuna chiave. Wallet unlock was cancelled. @@ -2095,7 +1949,7 @@ Più URL vengono separati da una barra verticale |. Private key for the entered address is not available. - La chiave privata per l'indirizzo inserito non è disponibile. + La chiave privata per l'indirizzo inserito non è disponibile. Message signing failed. @@ -2247,8 +2101,8 @@ Più URL vengono separati da una barra verticale |. Mercante - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - È necessario attendere %1 blocchi prima che i bitcoin generati possano essere spesi. Quando è stato generato questo blocco, è stato trasmesso alla rete in modo da poter essere aggiunto alla block chain. Se l'inserimento avrà esito negativo il suo stato sarà modificato in "non accettato" e risulterà non spendibile. Questo può occasionalmente accadere se un altro nodo genera un blocco entro pochi secondi dal tuo. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + È necessario attendere %1 blocchi prima che i bitcoin generati possano essere spesi. Quando è stato generato questo blocco, è stato trasmesso alla rete in modo da poter essere aggiunto alla block chain. Se l'inserimento avrà esito negativo il suo stato sarà modificato in "non accettato" e risulterà non spendibile. Questo può occasionalmente accadere se un altro nodo genera un blocco entro pochi secondi dal tuo. Debug information @@ -2312,10 +2166,6 @@ Più URL vengono separati da una barra verticale |. Address Indirizzo - - Amount - Importo - Immature (%1 confirmations, will be available after %2) Immaturo (%1 conferme, sarà disponibile fra %2) @@ -2425,7 +2275,7 @@ Più URL vengono separati da una barra verticale |. This year - Quest'anno + Quest'anno Range... @@ -2453,7 +2303,7 @@ Più URL vengono separati da una barra verticale |. Enter address or label to search - Inserisci un indirizzo o un'etichetta da cercare + Inserisci un indirizzo o un'etichetta da cercare Min amount @@ -2461,23 +2311,23 @@ Più URL vengono separati da una barra verticale |. Copy address - Copia l'indirizzo + Copia l'indirizzo Copy label - Copia l'etichetta + Copia l'etichetta Copy amount - Copia l'importo + Copia l'importo Copy transaction ID - Copia l'ID transazione + Copia l'ID transazione Edit label - Modifica l'etichetta + Modifica l'etichetta Show transaction details @@ -2501,7 +2351,7 @@ Più URL vengono separati da una barra verticale |. The transaction history was successfully saved to %1. - Lo storico delle transazioni e' stato salvato con successo in %1. + Lo storico delle transazioni e' stato salvato con successo in %1. Comma separated file (*.csv) @@ -2527,10 +2377,6 @@ Più URL vengono separati da una barra verticale |. Address Indirizzo - - Amount - Importo - ID ID @@ -2544,6 +2390,9 @@ Più URL vengono separati da una barra verticale |. a + + UnitDisplayStatusBarControl + WalletFrame @@ -2595,18 +2444,6 @@ Più URL vengono separati da una barra verticale |. bitcoin-core - - Usage: - Utilizzo: - - - List commands - Elenca comandi - - - Get help for a command - Aiuto su un comando - Options: Opzioni: @@ -2647,10 +2484,6 @@ Più URL vengono separati da una barra verticale |. Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Numero di secondi di sospensione che i peer di cattiva qualità devono attendere prima di potersi riconnettere (predefiniti: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Errore riscontrato durante l'impostazione della porta RPC %u per l'ascolto su IPv4: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Attendi le connessioni JSON-RPC su <porta> (predefinita: 8332 or testnet: 18332) @@ -2659,10 +2492,6 @@ Più URL vengono separati da una barra verticale |. Accept command line and JSON-RPC commands Accetta comandi da riga di comando e JSON-RPC - - Bitcoin Core RPC client version - Versione client RPC di Bitcoin Core - Run in the background as a daemon and accept commands Esegui in background come demone ed accetta i comandi @@ -2673,7 +2502,7 @@ Più URL vengono separati da una barra verticale |. Accept connections from outside (default: 1 if no -proxy or -connect) - Accetta connessioni dall'esterno (predefinito: 1 se no -proxy o -connect) + Accetta connessioni dall'esterno (predefinito: 1 se no -proxy o -connect) %s, you must set a rpcpassword in the configuration file: @@ -2685,67 +2514,51 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, devi impostare una rpcpassword nel file di configurazione: %s -Si raccomanda l'uso della seguente password generata casualmente: +Si raccomanda l'uso della seguente password generata casualmente: rpcuser=bitcoinrpc rpcpassword=%s (non serve ricordare questa password) Il nome utente e la password NON DEVONO essere uguali. Se il file non esiste, crealo concedendo permessi di lettura al solo proprietario del file. Si raccomanda anche di impostare alertnotify così sarai avvisato di eventuali problemi; -ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com +ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Cifrature accettabili (predefinito: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Errore riscontrato durante l'impostazione della porta RPC %u per l'ascolto su IPv6, tornando su IPv4: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - Associa all'indirizzo indicato e resta permanentemente in ascolto su questo. Usa la notazione [host]:porta per l'IPv6 + Associa all'indirizzo indicato e resta permanentemente in ascolto su questo. Usa la notazione [host]:porta per l'IPv6 Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) Limita la quantità di transazioni gratuite ad <n>*1000 byte al minuto (predefinito: 15) - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Entra in modalità di test di regressione, la quale usa una speciale catena in cui i blocchi sono risolti istantaneamente. Questo è fatto per lo sviluppo di strumenti e applicazioni per test di regressione. - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Entra in modalità di test di regressione, la quale usa una speciale catena in cui i blocchi possono essere risolti istantaneamente. - - Error: Listening for incoming connections failed (listen returned error %d) - Errore: l'ascolto per le connessioni in ingresso non è riuscito (errore riportato %d) - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Errore: la transazione è stata rifiutata! Questo può accadere se alcuni bitcoin nel tuo portamonete sono già stati spesi, ad esempio se hai utilizzato una copia del file wallet.dat per spendere bitcoin e questi non sono stati considerati spesi dal portamonete corrente. Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - Errore: questa transazione necessita di una commissione di almeno %s a causa del suo ammontare, della sua complessità, o dell'uso di fondi recentemente ricevuti! + Errore: questa transazione necessita di una commissione di almeno %s a causa del suo ammontare, della sua complessità, o dell'uso di fondi recentemente ricevuti! Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Esegui comando quando una transazione del portamonete cambia (%s in cmd è sostituito da TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - Le commissioni inferiori a questo valore saranno considerate nulle (per la creazione della transazione) (prefedinito: - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - Scarica l'attività del database dalla memoria al log su disco ogni <n> megabytes (predefinito: 100) + Scarica l'attività del database dalla memoria al log su disco ogni <n> megabytes (predefinito: 100) How thorough the block verification of -checkblocks is (0-4, default: 3) @@ -2779,13 +2592,9 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Attenzione: -paytxfee è molto alta. Questa è la commissione che si paga quando si invia una transazione. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Attenzione: si prega di controllare che la data e l'ora del computer siano corrette. Se l'ora di sistema è errata Bitcoin non funzionerà correttamente. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - Attenzione: La rete non sembra essere d'accordo pienamente! Alcuni minatori sembrano riscontrare problemi. + Attenzione: La rete non sembra essere d'accordo pienamente! Alcuni minatori sembrano riscontrare problemi. Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. @@ -2815,30 +2624,14 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Attempt to recover private keys from a corrupt wallet.dat Tenta di recuperare le chiavi private da un wallet.dat corrotto - - Bitcoin Core Daemon - Bitcoin Core Daemon - Block creation options: Opzioni creazione blocco: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - Cancella elenco delle transazioni sul portamonete (strumento di diagnostica; implica -rescan) - Connect only to the specified node(s) Connetti solo al nodo specificato - - Connect through SOCKS proxy - Connetti attraverso SOCKS proxy - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - Connetti al JSON-RPC su <port> (predefinita: 8332 o testnet: 18332) - Connection options: Opzioni di connessione: @@ -2869,11 +2662,11 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Error initializing block database - Errore durante l'inizializzazione del database dei blocchi + Errore durante l'inizializzazione del database dei blocchi Error initializing wallet database environment %s! - Errore durante l'inizializzazione dell'ambiente %s del database del portamonete! + Errore durante l'inizializzazione dell'ambiente %s del database del portamonete! Error loading block database @@ -2897,7 +2690,7 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Failed to listen on any port. Use -listen=0 if you want this. - Nessuna porta disponibile per l'ascolto. Usa -listen=0 se vuoi procedere comunque. + Nessuna porta disponibile per l'ascolto. Usa -listen=0 se vuoi procedere comunque. Failed to read block info @@ -2909,11 +2702,11 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Failed to sync block index - Sincronizzazione dell'indice del blocco fallita + Sincronizzazione dell'indice del blocco fallita Failed to write block index - Scrittura dell'indice del blocco fallita + Scrittura dell'indice del blocco fallita Failed to write block info @@ -2933,24 +2726,12 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Failed to write transaction index - Scrittura dell'indice di transazione fallita + Scrittura dell'indice di transazione fallita Failed to write undo data Scrittura dei dati di ripristino fallita - - Fee per kB to add to transactions you send - Commissione per kB da aggiungere alle transazioni in uscita - - - Fees smaller than this are considered zero fee (for relaying) (default: - Le commissioni inferiori a questo valore saranno considerate nulle (per la trasmissione) (prefedinito: - - - Find peers using DNS lookup (default: 1 unless -connect) - Trova peer utilizzando la ricerca DNS (predefinito: 1 a meno che non si usi -connect) - Force safe mode (default: 0) Forza modalità provvisoria (predefinito: 0) @@ -2961,7 +2742,7 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo How many blocks to check at startup (default: 288, 0 = all) - Numero di blocchi da controllare all'avvio (predefinito: 288, 0 = tutti) + Numero di blocchi da controllare all'avvio (predefinito: 288, 0 = tutti) If <category> is not supplied, output all debugging information. @@ -2976,8 +2757,8 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Blocco genesis non corretto o non trovato. Cartella dati errata? - Invalid -onion address: '%s' - Indirizzo -onion non valido: '%s' + Invalid -onion address: '%s' + Indirizzo -onion non valido: '%s' Not enough file descriptors available. @@ -2985,19 +2766,11 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Prepend debug output with timestamp (default: 1) - Preponi timestamp all'output di debug (predefinito: 1) - - - RPC client options: - Opzioni client RPC: + Preponi timestamp all'output di debug (predefinito: 1) Rebuild block chain index from current blk000??.dat files - Ricreare l'indice della catena di blocchi dai file blk000??.dat correnti - - - Select SOCKS version for -proxy (4 or 5, default: 5) - Selezionare la versione SOCKS per -proxy (4 o 5, predefinito: 5) + Ricreare l'indice della catena di blocchi dai file blk000??.dat correnti Set database cache size in megabytes (%d to %d, default: %d) @@ -3013,7 +2786,7 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Specify wallet file (within data directory) - Specifica il file portamonete (all'interno della cartella dati) + Specifica il file portamonete (all'interno della cartella dati) Spend unconfirmed change when sending transactions (default: 1) @@ -3021,11 +2794,7 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo This is intended for regression testing tools and app development. - Questo è previsto per l'uso con test di regressione e per lo sviluppo di applicazioni. - - - Usage (deprecated, use bitcoin-cli): - Usage (deprecato, usare bitcoin-cli): + Questo è previsto per l'uso con test di regressione e per lo sviluppo di applicazioni. Verifying blocks... @@ -3035,10 +2804,6 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Verifying wallet... Verifica portamonete... - - Wait for RPC server to start - Attendere l'avvio dell'RPC server - Wallet %s resides outside data directory %s Il portamonete %s si trova al di fuori dalla cartella dati %s @@ -3047,10 +2812,6 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Wallet options: Opzioni portamonete: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - Attenzione: Argomento deprecato -debugnet ignorato, usare -debug=net - You need to rebuild the database using -reindex to change -txindex È necessario ricostruire il database usando -reindex per cambiare -txindex @@ -3080,12 +2841,12 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Informazioni - Invalid amount for -minrelaytxfee=<amount>: '%s' - Importo non valido per -minrelaytxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Importo non valido per -minrelaytxfee=<amount>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - Importo non valido per -mintxfee=<amount>: '%s' + Invalid amount for -mintxfee=<amount>: '%s' + Importo non valido per -mintxfee=<amount>: '%s' Limit size of signature cache to <n> entries (default: 50000) @@ -3117,11 +2878,11 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Print block on startup, if found in block index - Stampa il blocco all'avvio, se presente nell'indice dei blocchi + Stampa il blocco all'avvio, se presente nell'indice dei blocchi Print block tree on startup (default: 0) - Stampa l'albero dei blocchi all'avvio (default: 0) + Stampa l'albero dei blocchi all'avvio (default: 0) RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) @@ -3143,14 +2904,6 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Run a thread to flush wallet periodically (default: 1) Mantieni in esecuzione un thread per scaricare periodicamente il portafoglio (predefinito: 1) - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - Opzioni SSL: (vedi il wiki di Bitcoin per le istruzioni di configurazione SSL) - - - Send command to Bitcoin Core - Invia comando a Bitcoin Core - Send trace/debug info to console instead of debug.log file Invia le informazioni di trace/debug alla console invece che al file debug.log @@ -3161,19 +2914,15 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - Imposta il flag DB_PRIVATE nell'ambiente di database del portamonete (predefinito: 1) + Imposta il flag DB_PRIVATE nell'ambiente di database del portamonete (predefinito: 1) Show all debugging options (usage: --help -help-debug) Mostra tutte le opzioni di debug (utilizzo: --help -help-debug) - - Show benchmark information (default: 0) - Visualizza le informazioni relative al benchmark (predefinito: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) - Riduci il file debug.log all'avvio del client (predefinito: 1 se non impostato -debug) + Riduci il file debug.log all'avvio del client (predefinito: 1 se non impostato -debug) Signing transaction failed @@ -3183,21 +2932,21 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Specify connection timeout in milliseconds (default: 5000) Specifica il timeout di connessione in millisecondi (predefinito: 5000) - - Start Bitcoin Core Daemon - Avvia Bitcoin Core Daemon - System error: Errore di sistema: + + This is experimental software. + Questo è un software sperimentale. + Transaction amount too small Importo transazione troppo piccolo Transaction amounts must be positive - L'importo della transazione deve essere positivo + L'importo della transazione deve essere positivo Transaction too large @@ -3230,11 +2979,7 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo on startup - all'avvio - - - version - versione + all'avvio wallet.dat corrupt, salvage failed @@ -3245,22 +2990,13 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Password per connessioni JSON-RPC - - Allow JSON-RPC connections from specified IP address - Consenti connessioni JSON-RPC dall'indirizzo IP specificato - - - - Send commands to node running on <ip> (default: 127.0.0.1) - Inviare comandi al nodo in esecuzione su <ip> (predefinito: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) - Esegui il comando quando il migliore blocco cambia(%s nel cmd è sostituito dall'hash del blocco) + Esegui il comando quando il migliore blocco cambia(%s nel cmd è sostituito dall'hash del blocco) Upgrade wallet to latest format - Aggiorna il wallet all'ultimo formato + Aggiorna il wallet all'ultimo formato Set key pool size to <n> (default: 100) @@ -3289,10 +3025,6 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Questo messaggio di aiuto - - Unable to bind to %s on this computer (bind returned error %d, %s) - Impossibile associarsi alla %s su questo computer (bind returned error %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Consenti ricerche DNS per -addnode, -seednode e -connect @@ -3305,41 +3037,29 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Error loading wallet.dat: Wallet corrupted Errore caricamento wallet.dat: Portamonete corrotto - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Errore caricamento wallet.dat: il portamonete richiede una versione di Bitcoin più recente - - - Wallet needed to be rewritten: restart Bitcoin to complete - Il portamonete necessitava di essere riscritto: riavviare Bitcoin per completare - Error loading wallet.dat Errore caricamento wallet.dat - Invalid -proxy address: '%s' - Indirizzo -proxy non valido: '%s' + Invalid -proxy address: '%s' + Indirizzo -proxy non valido: '%s' - Unknown network specified in -onlynet: '%s' - Rete sconosciuta specificata in -onlynet: '%s' + Unknown network specified in -onlynet: '%s' + Rete sconosciuta specificata in -onlynet: '%s' - Unknown -socks proxy version requested: %i - Versione -socks proxy sconosciuta richiesta: %i + Cannot resolve -bind address: '%s' + Impossibile risolvere -bind address: '%s' - Cannot resolve -bind address: '%s' - Impossibile risolvere -bind address: '%s' + Cannot resolve -externalip address: '%s' + Impossibile risolvere indirizzo -externalip: '%s' - Cannot resolve -externalip address: '%s' - Impossibile risolvere indirizzo -externalip: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Importo non valido per -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Importo non valido per -paytxfee=<amount>: '%s' Invalid amount @@ -3351,7 +3071,7 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Loading block index... - Caricamento dell'indice del blocco... + Caricamento dell'indice del blocco... Add a node to connect to and attempt to keep the connection open @@ -3367,7 +3087,7 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo Cannot write default address - Non è possibile scrivere l'indirizzo predefinito + Non è possibile scrivere l'indirizzo predefinito Rescanning... @@ -3379,19 +3099,11 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo To use the %s option - Per usare l'opzione %s + Per usare l'opzione %s Error Errore - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Devi settare rpcpassword=<password> nel file di configurazione: -%s -Se il file non esiste, crealo assegnando i permessi di lettura solamente al proprietario. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_ja.ts b/src/qt/locale/bitcoin_ja.ts index d3a6cece87..f056dd401e 100644 --- a/src/qt/locale/bitcoin_ja.ts +++ b/src/qt/locale/bitcoin_ja.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - <b>ビットコインコア</b> バージョン - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -これは実験的なソフトウェアです。 - -MIT/X11 ソフトウェア ライセンスの下で配布されています。詳しくは添付の COPYING ファイルやhttp://www.opensource.org/licenses/mit-license.php を参照してください。 - -この製品は OpenSSL Toolkit (http://www.openssl.org/) に用いられる Eric Young (eay@cryptsoft.com) が開発した暗号化ソフトウェアと Thomas Bernard が開発した UPnP ソフトウェアを含んでいます。 - - - Copyright - Copyright - - - The Bitcoin Core developers - ビットコインコアの開発者 - - - (%1-bit) - - - + AddressBookPage @@ -106,10 +69,6 @@ MIT/X11 ソフトウェア ライセンスの下で配布されています。 These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. これらは支払いを送信するためのあなたの Bitcoin アドレスです。コインを送信する前に、常に額と受信アドレスを確認してください。 - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - Copy &Label ラベルをコピー (&L) @@ -130,11 +89,7 @@ MIT/X11 ソフトウェア ライセンスの下で配布されています。 Exporting Failed エクスポート失敗 - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -168,10 +123,6 @@ MIT/X11 ソフトウェア ライセンスの下で配布されています。 Repeat new passphrase 新しいパスフレーズをもう一度 - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - ウォレットの新しいパスフレーズを入力してください。<br/><b>8個以上の単語か10個以上のランダムな文字</b>を使ってください。 - Encrypt wallet ウォレットを暗号化する @@ -295,10 +246,6 @@ MIT/X11 ソフトウェア ライセンスの下で配布されています。 Quit application アプリケーションを終了 - - Show information about Bitcoin - Bitcoinに関する情報を見る - About &Qt Qt について(&Q) @@ -431,38 +378,18 @@ MIT/X11 ソフトウェア ライセンスの下で配布されています。 Bitcoin Core Bitcoin のコア - - Request payments (generates QR codes and bitcoin: URIs) - - &About Bitcoin Core ビットコインコアについて (&A) - - Show the list of used sending addresses and labels - - Show the list of used receiving addresses and labels 支払いを受け取るアドレスとラベルのリストを表示する - - Open a bitcoin: URI or payment request - - &Command-line options コマンドラインオプション (&C) - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Bitcoin クライアント - %n active connection(s) to Bitcoin network %n の Bitcoin ネットワークへのアクティブな接続 @@ -471,10 +398,6 @@ MIT/X11 ソフトウェア ライセンスの下で配布されています。 No block source available... 利用可能なブロックがありません... - - Processed %1 of %2 (estimated) blocks of transaction history. - 取引履歴の %2 (推定値) の内 %1 ブロックを処理しました。 - Processed %1 blocks of transaction history. 取引履歴の %1 ブロックを処理しました。 @@ -558,11 +481,6 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> ウォレットは<b>暗号化されて、ロックされています</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - 致命的なエラーが発生しました。Bitcoin は安全に継続することができず終了するでしょう。 - - ClientModel @@ -573,10 +491,6 @@ Address: %4 CoinControlDialog - - Coin Control Address Selection - - Quantity: 数量: @@ -597,18 +511,10 @@ Address: %4 Fee: 手数料: - - Low Output: - - After Fee: 手数料差引後: - - Change: - - (un)select all すべて選択/選択解除 @@ -661,14 +567,6 @@ Address: %4 Copy transaction ID 取引 ID をコピー - - Lock unspent - - - - Unlock unspent - - Copy quantity 数量をコピーする @@ -689,62 +587,10 @@ Address: %4 Copy priority 優先度をコピーする - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - none なし - - Dust - - yes はい @@ -754,54 +600,14 @@ Address: %4 いいえ - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". + This label turns red, if the priority is smaller than "medium". 優先度が「中」未満の場合には、このラベルは赤くなります。 - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (ラベル無し) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -812,14 +618,6 @@ Address: %4 &Label ラベル(&L) - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address アドレス帳 (&A) @@ -841,12 +639,12 @@ Address: %4 送信アドレスを編集 - The entered address "%1" is already in the address book. - 入力されたアドレス "%1" は既にアドレス帳にあります。 + The entered address "%1" is already in the address book. + 入力されたアドレス "%1" は既にアドレス帳にあります。 - The entered address "%1" is not a valid Bitcoin address. - 入力されたアドレス "%1" は無効な Bitcoin アドレスです。 + The entered address "%1" is not a valid Bitcoin address. + 入力されたアドレス "%1" は無効な Bitcoin アドレスです。 Could not unlock wallet. @@ -882,10 +680,6 @@ Address: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core Bitcoin のコア @@ -894,6 +688,10 @@ Address: %4 version バージョン + + Command-line options + コマンドライン オプション + Usage: 使用法: @@ -907,17 +705,13 @@ Address: %4 UI オプション - Set language, for example "de_DE" (default: system locale) - 言語設定 例: "de_DE" (初期値: システムの言語) + Set language, for example "de_DE" (default: system locale) + 言語設定 例: "de_DE" (初期値: システムの言語) Start minimized 最小化された状態で起動する - - Set SSL root certificates for payment request (default: -system-) - - Show splash screen on startup (default: 1) 起動時にスプラッシュ画面を表示する (初期値: 1) @@ -933,18 +727,6 @@ Address: %4 Welcome ようこそ - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - Use the default data directory 初期値のデータ ディレクトリを使用 @@ -954,12 +736,8 @@ Address: %4 任意のデータ ディレクトリを使用: - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - エラー: 指定のデータ ディレクトリ "%1" を作成できません。 + Bitcoin Core + Bitcoin のコア Error @@ -1031,34 +809,10 @@ Address: %4 MB MB - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) プロキシのIPアドレス (例えば IPv4: 127.0.0.1 / IPv6: ::1) - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - Reset all client options to default. すべてのオプションを初期値に戻します。 @@ -1071,10 +825,6 @@ Address: %4 &Network ネットワーク (&N) - - (0 = auto, <0 = leave that many cores free) - - W&allet ウォレット (&A) @@ -1087,14 +837,6 @@ Address: %4 Enable coin &control features コインコントロール機能を有効化する (&C) - - 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. - - - - &Spend unconfirmed change - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. 自動的にルーター上の Bitcoin クライアントのポートを開きます。あなたのルーターが UPnP に対応していて、それが有効になっている場合に作動します。 @@ -1115,14 +857,6 @@ Address: %4 Port of the proxy (e.g. 9050) プロキシのポート番号 (例 9050) - - SOCKS &Version: - SOCKS バージョン (&V) : - - - SOCKS version of the proxy (e.g. 5) - SOCKS プロキシのバージョン (例 5) - &Window ウインドウ (&W) @@ -1163,18 +897,6 @@ Address: %4 Choose the default subdivision unit to show in the interface and when sending coins. インターフェース上の表示とコインの送信で使用する単位を選択します。 - - Whether to show Bitcoin addresses in the transaction list or not. - 最近の取引履歴で Bitcoin アドレスを表示するかしないか。 - - - &Display addresses in transaction list - 取引履歴にアドレスを表示 (&D) - - - Whether to show coin control features or not. - - &OK &OK @@ -1195,18 +917,6 @@ Address: %4 Confirm options reset オプションのリセットの確認 - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - The supplied proxy address is invalid. プロキシアドレスが無効です。 @@ -1226,18 +936,10 @@ Address: %4 Wallet ウォレット - - Available: - - Your current spendable balance あなたの利用可能残高 - - Pending: - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance 未検証の取引で利用可能残高に反映されていない数 @@ -1274,13 +976,8 @@ Address: %4 URI の操作 - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI を解析できません! これは無効な Bitcoin アドレスあるいや不正な形式の URI パラメーターによって引き起こされる場合があります。 - - - - Requested payment amount of %1 is too small (considered dust). - + Invalid payment address %1 + 支払いのアドレス「%1」は無効です Payment request error @@ -1290,42 +987,10 @@ Address: %4 Cannot start bitcoin: click-to-pay handler Bitcoin を起動できません: click-to-pay handler - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - Error communicating with %1: %2 %1: %2とコミュニケーション・エラーです - - Payment request can not be parsed or processed! - - Bad response from server %1 サーバーの返事は無効 %1 @@ -1339,33 +1004,28 @@ Address: %4 ネットワーク・リクエストのエラーです + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + 総額 - Error: Specified data directory "%1" does not exist. - エラー: 指定のデータ ディレクトリ "%1" は存在しません。 + %1 h + %1 h - Error: Cannot parse configuration file: %1. Only use key=value syntax. - + %1 m + %1 m - Error: Invalid combination of -regtest and -testnet. - エラー: -regtestと-testnetは一緒にするのは無効です。 + N/A + N/A - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Bitcoin アドレスを入力します (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget @@ -1407,10 +1067,6 @@ Address: %4 Debug window デバッグ ウインドウ - - General - - Using OpenSSL version 使用中の OpenSSL のバージョン @@ -1439,10 +1095,6 @@ Address: %4 Current number of blocks 現在のブロック数 - - Estimated total blocks - 推定総ブロック数 - Last block time 最終ブロックの日時 @@ -1519,19 +1171,7 @@ Address: %4 %1 GB %1 GB - - %1 m - %1 m - - - %1 h - %1 h - - - %1 h %2 m - %1 h %2 m - - + ReceiveCoinsDialog @@ -1546,62 +1186,14 @@ Address: %4 &Message: メッセージ (&M): - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - Clear クリア - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - Show 表示 - - Remove the selected entries from the list - - - - Remove - - Copy label ラベルをコピーする @@ -1692,15 +1284,7 @@ Address: %4 (no label) (ラベル無し) - - (no message) - - - - (no amount) - - - + SendCoinsDialog @@ -1743,26 +1327,10 @@ Address: %4 Fee: 手数料: - - Low Output: - - After Fee: 手数料差引後: - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once 一度に複数の人に送る @@ -1771,10 +1339,6 @@ Address: %4 Add &Recipient 受取人を追加 (&R) - - Clear all fields of the form. - - Clear &All すべてクリア (&A) @@ -1795,10 +1359,6 @@ Address: %4 Confirm send coins コインを送る確認 - - %1 to %2 - - Copy quantity 数量をコピーする @@ -1823,22 +1383,6 @@ Address: %4 Copy priority 優先度をコピーする - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - The recipient address is not valid, please recheck. 受取人のアドレスが不正です。再確認してください。 @@ -1859,26 +1403,10 @@ Address: %4 Duplicate address found, can only send to each address once per send operation. 重複しているアドレスが見つかりました。1回の送信で同じアドレスに送ることは出来ません。 - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (ラベル無し) - - Warning: Unknown change address - - Are you sure you want to send? 送ってよろしいですか? @@ -1887,14 +1415,6 @@ Address: %4 added as transaction fee 取引手数料として追加された - - Payment request expired - 支払いのリクエストは期限切れです - - - Invalid payment address %1 - 支払いのアドレス「%1」は無効です - SendCoinsEntry @@ -1906,10 +1426,6 @@ Address: %4 Pay &To: 送り先(&T): - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - 支払い送信するアドレス (例 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book アドレス帳に追加するには、このアドレスのラベルを入力します @@ -1922,10 +1438,6 @@ Address: %4 Choose previously used address 前に使用したアドレスを選ぶ - - This is a normal payment. - - Alt+A Alt+A @@ -1938,30 +1450,10 @@ Address: %4 Alt+P Alt+P - - Remove this entry - - Message: メッセージ: - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - Pay To: 支払先: @@ -1973,15 +1465,7 @@ Address: %4 ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog @@ -1996,10 +1480,6 @@ Address: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. あなた自身を立証するためにあなたのアドレスでメッセージに署名することができます。フィッシング攻撃によってあなたを騙して署名を譲渡させようとするかもしれないので、不明確なものは絶対に署名しないように注意してください。あなたが同意する完全に詳細な声明にだけ署名してください。 - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - メッセージの署名に使うアドレス (例 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Choose previously used address 前に使用したアドレスを選ぶ @@ -2052,10 +1532,6 @@ Address: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. メッセージを検証するために、署名するアドレスとメッセージ(改行、スペース、タブなどを正確にコピーしてください)、そして署名を入力します。中間者攻撃によってだまされることを避けるために、署名されたメッセージそのものよりも、署名を読み取られないように注意してください。 - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - メッセージが署名されたアドレス (例 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address 指定された Bitcoin アドレスで署名されたことを保証するメッセージを検証 @@ -2069,12 +1545,8 @@ Address: %4 入力項目の内容をすべて消去します - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Bitcoin アドレスを入力します (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - 署名を作成するには"メッセージの署名"をクリック + Click "Sign Message" to generate signature + 署名を作成するには"メッセージの署名"をクリック The entered address is invalid. @@ -2153,10 +1625,6 @@ Address: %4 Open until %1 ユニット %1 を開く - - conflicted - - %1/offline %1/オフライン @@ -2245,10 +1713,6 @@ Address: %4 Merchant 商人 - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - Debug information デバッグ情報 @@ -2311,14 +1775,6 @@ Address: %4 Address Helbidea - - Amount - 総額 - - - Immature (%1 confirmations, will be available after %2) - - Open for %n more block(s) %n 以上のブロックを開く @@ -2347,14 +1803,6 @@ Address: %4 Unconfirmed 未検証 - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with 受信元 @@ -2498,10 +1946,6 @@ Address: %4 Exporting Successful エクスポートに成功しました - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) テキスト CSV (*.csv) @@ -2526,10 +1970,6 @@ Address: %4 Address Helbidea - - Amount - 総額 - ID ID @@ -2543,13 +1983,12 @@ Address: %4 から + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2579,14 +2018,6 @@ Address: %4 Backup Failed バックアップに失敗しました - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - Backup Successful バックアップ成功 @@ -2594,18 +2025,6 @@ Address: %4 bitcoin-core - - Usage: - 使用法: - - - List commands - コマンド一覧 - - - Get help for a command - コマンドのヘルプ - Options: オプション: @@ -2646,10 +2065,6 @@ Address: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) 不正なピアを再接続するまでの秒数 (初期値: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - IPv4 でリスンする RPC ポート %u の設定中にエラーが発生しました: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) <port> で JSON-RPC 接続をリスン (初期値: 8332、testnet は 18332) @@ -2658,10 +2073,6 @@ Address: %4 Accept command line and JSON-RPC commands コマンドラインと JSON-RPC コマンドを許可 - - Bitcoin Core RPC client version - ビットコインコアRPCクライアントのバージョン - Run in the background as a daemon and accept commands デーモンとしてバックグランドで実行しコマンドを許可 @@ -2684,7 +2095,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, rpcpassword を設定ファイルで設定してください: %s @@ -2695,36 +2106,12 @@ rpcpassword=%s ユーザー名とパスワードが同じであってはいけません。 もしもファイルが存在しないなら、所有者だけが読み取れる権限で作成してください。 また、問題が通知されるように alertnotify を設定することをお勧めします; -例えば: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - IPv6 でリスンする RPC ポート %u の設定中にエラーが発生したので IPv4 に切り替えます: %s +例えば: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Bind to given address and always listen on it. Use [host]:port notation for IPv6 指定のアドレスへバインドし、その上で常にリスンします。IPv6 は [ホスト名]:ポート番号 と表記します - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - ブロックを瞬時に解決することができる特別なチェーンを使用して、リグレッションテストモードに入る。これはリグレッションテストツールやアプリケーション開発を対象としています。 - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. エラー: 取引は拒否されました。wallet.dat のコピーを使い、そしてコピーしたウォレットからコインを使用したことがマークされなかったときなど、ウォレットのいくつかのコインがすでに使用されている場合に、このエラーは起こるかもしれません。 @@ -2737,50 +2124,14 @@ rpcpassword=%s Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) ウォレットの取引を変更する際にコマンドを実行 (cmd の %s は TxID に置換される) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications これはリリース前のテストビルドです - 各自の責任で利用すること - 採掘や商取引に使用しないでください - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. 警告: -paytxfee が非常に高く設定されています! これは取引を送信する場合に支払う取引手数料です。 - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - 警告: あなたのコンピュータの日時が正しいことを確認してください! 時計が間違っていると Bitcoin は正常に動作しません。 - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. 警告: ネットワークは完全に同意しないみたいです。マイナーは何かの問題を経験してるみたいなんです。 @@ -2805,42 +2156,18 @@ rpcpassword=%s (default: wallet.dat) (デフォルト: wallet.dat) - - <category> can be: - - Attempt to recover private keys from a corrupt wallet.dat 壊れた wallet.dat から秘密鍵を復旧することを試す - - Bitcoin Core Daemon - - Block creation options: ブロック作成オプション: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) 指定したノードだけに接続 - - Connect through SOCKS proxy - SOCKS プロキシ経由で接続する - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - Corrupted block database detected 破損したブロック データベースが見つかりました @@ -2850,18 +2177,10 @@ rpcpassword=%s Debugging/Testing options: デバッグ/テスト用オプション: - - Disable safemode, override a real safe mode event (default: 0) - - Discover own IP address (default: 1 when listening and no -externalip) 自分の IP アドレスを発見 (初期値: リスン中と -externalip を使用していない場合は1) - - Do not load the wallet and disable wallet RPC calls - - Do you want to rebuild the block database now? ブロック データベースを今すぐ再構築しますか? @@ -2938,18 +2257,6 @@ rpcpassword=%s Failed to write undo data 元へ戻すデータの書き込みに失敗しました - - Fee per kB to add to transactions you send - 送信するトランザクションの1kBあたりの手数料 - - - Fees smaller than this are considered zero fee (for relaying) (default: - この値未満の (中継) 手数料はゼロであるとみなす (デフォルト: - - - Find peers using DNS lookup (default: 1 unless -connect) - DNS ルックアップでピアを探す (初期値: -connect を使っていなければ1) - Force safe mode (default: 0) セーフモードを矯正する (デフォルト: 0) @@ -2966,46 +2273,18 @@ rpcpassword=%s If <category> is not supplied, output all debugging information. <category> が与えられなかった場合には、すべてのデバッグ情報が出力されます。 - - Importing... - - Incorrect or no genesis block found. Wrong datadir for network? 不正なブロックあるいは、生成されていないブロックが見つかりました。ネットワークの datadir が間違っていませんか? - - Invalid -onion address: '%s' - - Not enough file descriptors available. 使用可能なファイルディスクリプタが不足しています。 - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - RPC クライアントのオプション: - Rebuild block chain index from current blk000??.dat files 現在の blk000??.dat ファイルからブロック チェーンのインデックスを再構築 - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - Set the number of threads to service RPC calls (default: 4) RPC サービスのスレッド数を設定 (初期値: 4) @@ -3014,18 +2293,6 @@ rpcpassword=%s Specify wallet file (within data directory) ウォレットのファイルを指定 (データ・ディレクトリの中に) - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - Verifying blocks... ブロックの検証中... @@ -3034,22 +2301,10 @@ rpcpassword=%s Verifying wallet... ウォレットの検証中... - - Wait for RPC server to start - RPC サーバが開始するのを待つ - Wallet %s resides outside data directory %s 財布 %s はデータ・ディレクトリ%sの外にあります - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - 警告: 非推奨の引数 -debugnet は無視されました。-debug=net を使用してください - You need to rebuild the database using -reindex to change -txindex -txindex を変更するには -reindex を使用してデータベースを再構築する必要があります @@ -3058,33 +2313,21 @@ rpcpassword=%s Imports blocks from external blk000??.dat file 外部の blk000??.dat ファイルからブロックをインポート - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) 関連のアラートをもらってもすごく長いのフォークを見てもコマンドを実行 (コマンドの中にあるの%sはメッセージから置き換えさせる) - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information 情報 - Invalid amount for -minrelaytxfee=<amount>: '%s' - 不正な額 -minrelaytxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + 不正な額 -minrelaytxfee=<amount>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - 不正な額 -minrelaytxfee=<amount>: '%s' + Invalid amount for -mintxfee=<amount>: '%s' + 不正な額 -minrelaytxfee=<amount>: '%s' Limit size of signature cache to <n> entries (default: 50000) @@ -3114,14 +2357,6 @@ rpcpassword=%s Only connect to nodes in network <net> (IPv4, IPv6 or Tor) <net> (IPv4, IPv6, Tor) ネットワーク内のノードだけに接続する - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) RPC SSL オプション: (SSLのセットアップ手順はビットコインWikiを参照してください) @@ -3130,26 +2365,6 @@ rpcpassword=%s RPC server options: RPCサーバのオプション: - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL オプション: (SSLのセットアップ手順は Bitcoin Wiki をご覧下さい) - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file トレース/デバッグ情報を debug.log ファイルの代わりにコンソールへ送る @@ -3158,18 +2373,6 @@ rpcpassword=%s Set minimum block size in bytes (default: 0) 最小ブロックサイズをバイトで設定 (初期値: 0) - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - Shrink debug.log file on client startup (default: 1 when no -debug) クライアント起動時に debug.log ファイルを縮小 (初期値: -debug オプションを指定しない場合は1) @@ -3182,10 +2385,6 @@ rpcpassword=%s Specify connection timeout in milliseconds (default: 5000) 接続のタイムアウトをミリセコンドで指定 (初期値: 5000) - - Start Bitcoin Core Daemon - - System error: システム エラー: @@ -3222,18 +2421,6 @@ rpcpassword=%s Warning: This version is obsolete, upgrade required! 警告: このバージョンは古いのでアップグレードが必要です! - - Zapping all transactions from wallet... - - - - on startup - - - - version - バージョン - wallet.dat corrupt, salvage failed wallet.dat が壊れ、復旧に失敗しました @@ -3242,14 +2429,6 @@ rpcpassword=%s Password for JSON-RPC connections JSON-RPC 接続のパスワード - - Allow JSON-RPC connections from specified IP address - 指定した IP アドレスからの JSON-RPC 接続を許可 - - - Send commands to node running on <ip> (default: 127.0.0.1) - <ip> (初期値: 127.0.0.1) で実行中のノードにコマンドを送信 - Execute command when the best block changes (%s in cmd is replaced by block hash) 最良のブロックに変更する際にコマンドを実行 (cmd の %s はブロック ハッシュに置換される) @@ -3282,10 +2461,6 @@ rpcpassword=%s This help message このヘルプ メッセージ - - Unable to bind to %s on this computer (bind returned error %d, %s) - このコンピュータの %s にバインドすることができません (バインドが返したエラーは %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect -addnode, -seednode と -connect で DNS ルックアップを許可する @@ -3298,41 +2473,29 @@ rpcpassword=%s Error loading wallet.dat: Wallet corrupted wallet.dat 読み込みエラー: ウォレットが壊れました - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - wallet.dat 読み込みエラー: ウォレットは Bitcoin の最新バージョンを必要とします - - - Wallet needed to be rewritten: restart Bitcoin to complete - ウォレットが書き直される必要がありました: 完了するために Bitcoin を再起動します - Error loading wallet.dat wallet.dat 読み込みエラー - Invalid -proxy address: '%s' - 無効な -proxy アドレス: '%s' + Invalid -proxy address: '%s' + 無効な -proxy アドレス: '%s' - Unknown network specified in -onlynet: '%s' - -onlynet で指定された '%s' は未知のネットワークです + Unknown network specified in -onlynet: '%s' + -onlynet で指定された '%s' は未知のネットワークです - Unknown -socks proxy version requested: %i - -socks で指定された %i は未知のバージョンです + Cannot resolve -bind address: '%s' + -bind のアドレス '%s' を解決できません - Cannot resolve -bind address: '%s' - -bind のアドレス '%s' を解決できません + Cannot resolve -externalip address: '%s' + -externalip のアドレス '%s' を解決できません - Cannot resolve -externalip address: '%s' - -externalip のアドレス '%s' を解決できません - - - Invalid amount for -paytxfee=<amount>: '%s' - -paytxfee=<amount> の額 '%s' が無効です + Invalid amount for -paytxfee=<amount>: '%s' + -paytxfee=<amount> の額 '%s' が無効です Invalid amount @@ -3378,13 +2541,5 @@ rpcpassword=%s Error エラー - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - rpcpassword=<password> を設定ファイルでセットしてください: -%s -ファイルが無い場合は、オーナーだけが読み取れる権限でファイルを作成してください。 - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_ka.ts b/src/qt/locale/bitcoin_ka.ts index fda2e97037..c23367171d 100644 --- a/src/qt/locale/bitcoin_ka.ts +++ b/src/qt/locale/bitcoin_ka.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - Bitcoin Core-ს შესახებ - - - <b>Bitcoin Core</b> version - <b>Bitcoin Core</b>-ს ვერსია - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -პროგრამა ექსპერიმენტულია. - -ვრცელდება MIT/X11 ლიცენზიით, იხილე თანდართული ფაილი COPYING ან http://www.opensource.org/licenses/mit-license.php. - -პროდუქტი შეიცავს OpenSSL პროექტის ფარგლებში შემუშავებულ პროგრამულ უზრუნველყოფას OpenSSL Toolkit-ში გამოყენებისათვის (http://www.openssl.org/), კრიპტოგრაფიულ პროგრამას, ავტორი ერიქ იანგი (Eric Young, eay@cryptsoft.com) და UPnP-პროგრამას, ავტორი თომას ბერნარდი (Thomas Bernard). - - - Copyright - საავტორო უფლებები - - - The Bitcoin Core developers - Bitcoin Core-ს ავტორები - - - (%1-bit) - - - + AddressBookPage @@ -130,11 +93,7 @@ This product includes software developed by the OpenSSL Project for use in the O Exporting Failed ექსპორტი ვერ განხორციელდა - - There was an error trying to save the address list to %1. - შეცდომა მისამართების სიის %1-ში შენახვის მცდელობისას. - - + AddressTableModel @@ -168,10 +127,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase გაიმეორეთ ახალი ფრაზა-პაროლი - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - შეიყვანეთ საფულის ახალი ფრაზა-პაროლი.<br/>ფრაზა-პაროლი შეადგინეთ <b>არანაკლებ 10 შემთხვევითი სიმბოლოსაგან</b>, ან <b>რვა და მეტი სიტყვისაგან</b>. - Encrypt wallet საფულის დაშიფრვა @@ -295,10 +250,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application გასვლა - - Show information about Bitcoin - ინფორმაცია Bitcoin-ის შესახებ - About &Qt &Qt-ს შესახებ @@ -459,46 +410,18 @@ This product includes software developed by the OpenSSL Project for use in the O Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options Bitcoin Core-ს დახმარების ჩვენება Bitcoin-ის საკომანდო სტრიქონის დასაშვები ოპციების სანახავად - - Bitcoin client - Bitcoin-კლიენტი - - - %n active connection(s) to Bitcoin network - აქტიური მიერთებები ბითქოინის ქსელთან: %n - No block source available... ბლოკების წყარო მიუწვდომელია... - - Processed %1 of %2 (estimated) blocks of transaction history. - დამუშავებულია ტრანსაქციების ისტორიის %2-დან (სავარაუდოდ) %1 ბლოკი. - Processed %1 blocks of transaction history. დამუშავებულია ტრანსაქციების ისტორიის %1 ბლოკი. - - %n hour(s) - %n საათი - - - %n day(s) - %n დღე - - - %n week(s) - %n კვირა - %1 and %2 %1 და %2 - - %n year(s) - %n წელი - %1 behind %1 გავლილია @@ -559,10 +482,6 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> საფულე <b>დაშიფრულია</b> და ამჟამად <b>დაბლოკილია</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - ფატალური შეცდომა. Bitcoin ვერ უზრუნველყოფს უსაფრთხო გაგრძელებას, ამიტომ იხურება. - ClientModel @@ -597,10 +516,6 @@ Address: %4 Fee: საკომისიო: - - Low Output: - ქვედა ზღვარი: - After Fee: დამატებითი საკომისიო: @@ -623,7 +538,7 @@ Address: %4 Amount - რაოდენობა + თანხა Address @@ -689,10 +604,6 @@ Address: %4 Copy priority პრიორიტეტის კოპირება - - Copy low output - ქვედა ზღვრის კოპირება - Copy change ხურდის კოპირება @@ -741,10 +652,6 @@ Address: %4 none ცარიელი - - Dust - მტვერი - yes კი @@ -770,25 +677,13 @@ Address: %4 მეტი პრიორიტეტის ტრანსაქციებს მეტი შანსი აქვს მოხვდეს ბლოკში. - This label turns red, if the priority is smaller than "medium". - ნიშნული წითლდება, როცა პრიორიტეტი "საშუალო"-ზე დაბალია. + This label turns red, if the priority is smaller than "medium". + ნიშნული წითლდება, როცა პრიორიტეტი "საშუალო"-ზე დაბალია. This label turns red, if any recipient receives an amount smaller than %1. ნიშნული წითლდება, როცა რომელიმე რეციპიენტი მიიღებს %1-ზე ნაკლებს. - - This means a fee of at least %1 is required. - ეს ნიშნავს, რომ საკომისიო იქნება მინიმუმ %1. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - რეტრანსლაციის მინიმალური საკომისიოს 0.546-ზე ნაკლები თანხები ნაჩვენები იქნება როგორც მტვერი. - - - This label turns red, if the change is smaller than %1. - ნიშნული წითლდება, როცა ხურდა ნაკლებია %1-ზე. - (no label) (არ არის ნიშნული) @@ -841,12 +736,12 @@ Address: %4 გაგზავნის მისამართის შეცვლა - The entered address "%1" is already in the address book. - მისამართი "%1" უკვე არის მისამართების წიგნში. + The entered address "%1" is already in the address book. + მისამართი "%1" უკვე არის მისამართების წიგნში. - The entered address "%1" is not a valid Bitcoin address. - შეყვანილი მისამართი "%1" არ არის ვალიდური Bitcoin-მისამართი. + The entered address "%1" is not a valid Bitcoin address. + შეყვანილი მისამართი "%1" არ არის ვალიდური Bitcoin-მისამართი. Could not unlock wallet. @@ -882,10 +777,6 @@ Address: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Bitcoin Core - საკომანდო სტრიქონის ოპციები - Bitcoin Core Bitcoin Core @@ -894,6 +785,14 @@ Address: %4 version ვერსია + + About Bitcoin Core + Bitcoin Core-ს შესახებ + + + Command-line options + კომანდების ზოლის ოპციები + Usage: გამოყენება: @@ -907,17 +806,13 @@ Address: %4 ინტერფეისის პარამეტრები - Set language, for example "de_DE" (default: system locale) - აირჩიეთ ენა, მაგალითად "de_DE" (ნაგულისხმევია სისტემური ლოკალი) + Set language, for example "de_DE" (default: system locale) + აირჩიეთ ენა, მაგალითად "de_DE" (ნაგულისხმევია სისტემური ლოკალი) Start minimized გაშვება მინიმიზებული ეკრანით - - Set SSL root certificates for payment request (default: -system-) - - Show splash screen on startup (default: 1) მისალმების ეკრანის ჩვენება გაშვებისას (ნაგულისხმევი:1) @@ -941,10 +836,6 @@ Address: %4 As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. ეს პროგრამის პირველი გაშვებაა; შეგიძლიათ მიუთითოთ, სად შეინახოს მონაცემები Bitcoin Core-მ. - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - Bitcoin Core გადმოტვირთავს და შეინახავს Bitcoin-ის ბლოკთა ჯაჭვს. მითითებულ კატალოგში დაგროვდება სულ ცოტა 1 გბ მონაცემები, და მომავალში უფრო გაიზრდება. საფულეც ამავე კატალოგში შეინახება. - Use the default data directory ნაგულისხმევი კატალოგის გამოყენება @@ -954,12 +845,8 @@ Address: %4 მითითებული კატალოგის გამოყენება: - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - შეცდომა: მითითებული მონაცემთა კატალოგი "%1" ვერ შეიქმნა. + Bitcoin Core + Bitcoin Core Error @@ -1047,14 +934,6 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) პროქსის IP-მისამართი (მაგ.: IPv4: 127.0.0.1 / IPv6: ::1) - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - Active command-line options that override above options: საკომანდო სტრიქონის აქტიური ოპციები, რომლებიც გადაფარავენ ზემოთნაჩვენებს: @@ -1071,30 +950,14 @@ Address: %4 &Network &ქსელი - - (0 = auto, <0 = leave that many cores free) - - W&allet ს&აფულე - - Expert - - - - Enable coin &control features - - 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. დაუდასტურებელი ხურდის გამოყენების აკრძალვის შემდეგ მათი გამოყენება შეუძლებელი იქნება, სანამ ტრანსაქციას არ ექნება ერთი დასტური მაინც. ეს აისახება თქვენი ნაშთის დათვლაზეც. - - &Spend unconfirmed change - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. როუტერში Bitcoin-კლიენტის პორტის ავტომატური გახსნა. მუშაობს, თუ თქვენს როუტერს ჩართული აქვს UPnP. @@ -1115,14 +978,6 @@ Address: %4 Port of the proxy (e.g. 9050) პროქსის პორტი (მაგ.: 9050) - - SOCKS &Version: - SOCKS &ვერსია: - - - SOCKS version of the proxy (e.g. 5) - პროქსის SOCKS-ვერსია (მაგ.: 5) - &Window &ფანჯარა @@ -1137,7 +992,7 @@ Address: %4 Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - პროგრამის მინიმიზება ფანჯრის დახურვისას. ოპციის ჩართვის შემდეგ პროგრამის დახურვა შესაძლებელი იქნება მხოლოდ მენიუდან - პუნქტი "გასვლა". + პროგრამის მინიმიზება ფანჯრის დახურვისას. ოპციის ჩართვის შემდეგ პროგრამის დახურვა შესაძლებელი იქნება მხოლოდ მენიუდან - პუნქტი "გასვლა". M&inimize on close @@ -1163,14 +1018,6 @@ Address: %4 Choose the default subdivision unit to show in the interface and when sending coins. აირჩიეთ გასაგზავნი თანხის ნაგულისხმევი ერთეული. - - Whether to show Bitcoin addresses in the transaction list or not. - ტრანსაქციების სიაში იყოს თუ არა ნაჩვენები Bitcoin-მისამართები. - - - &Display addresses in transaction list - მისამართების &ჩვენება სიაში - Whether to show coin control features or not. ვაჩვენოთ თუ არა მონეტების მართვის პარამეტრები. @@ -1274,12 +1121,12 @@ Address: %4 URI-ების დამუშავება - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI-ის დამუშავება ვერ მოხერხდა. შესაძლოა არასწორია Bitcoin-მისამართი ან URI-ის პარამეტრები. + Invalid payment address %1 + გადახდის მისამართი არასწორია: %1 Requested payment amount of %1 is too small (considered dust). - მოთხოვნილი გადახდის %1 მოცულობა ძალიან მცირეა (ითვლება "მტვრად") + მოთხოვნილი გადახდის %1 მოცულობა ძალიან მცირეა (ითვლება "მტვრად") Payment request error @@ -1289,14 +1136,6 @@ Address: %4 Cannot start bitcoin: click-to-pay handler ვერ გაიშვა bitcoin: click-to-pay - - Net manager warning - გაფრთხილება ქსელის მენეჯერისაგან - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - თქვენს აქტიურ პროქსის არა აქვს SOCKS5-ის მხარდაჭერა, რაც საჭიროა გადახდების პროქსით განხორციელებისათვის. - Payment request fetch URL is invalid: %1 არასწორია გადახდის მოთხოვნის URL: %1 @@ -1305,10 +1144,6 @@ Address: %4 Payment request file handling გადახდის მოთხოვნის ფაილის დამუშავება - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - ვერ ხერხდება გადახდის მოთხოვნის ფაილის წაკითხვა ან დამუშავება! შესაძლოა დაზიანებულია გადახდის მოთხოვნის ფაილი. - Unverified payment requests to custom payment scripts are unsupported. არავერიფიცირებული გადახდის მოთხოვნები გადახდის სამომხმარებლო სკრიპტებისათვის არ არის მხარდაჭერილი. @@ -1321,10 +1156,6 @@ Address: %4 Error communicating with %1: %2 ვერ გამოდის კავშირზე %1: %2 - - Payment request can not be parsed or processed! - ვერ ხერხდება გადახდის მოთხოვნის გარჩევა ან დამუშავება! - Bad response from server %1 ცუდი პასუხი სერვერისაგან %1 @@ -1338,38 +1169,33 @@ Address: %4 ქსელური მოთხოვნის შეცდომა + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + თანხა - Error: Specified data directory "%1" does not exist. - შეცდომა: მითითებული მონაცემთა კატალოგი "%1" არ არსებობს. + %1 h + %1 სთ - Error: Cannot parse configuration file: %1. Only use key=value syntax. - + %1 m + %1 წთ - Error: Invalid combination of -regtest and -testnet. - შეცდომა: -regtest-ისა და -testnet-ის დაუშვებელი კომბინაცია. + N/A + მიუწვდ. - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - შეიყვანეთ ბიტკოინ-მისამართი (მაგ. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget &Save Image... - გამო&სახულების შენახვა + გამო&სახულების შენახვა... &Copy Image @@ -1438,10 +1264,6 @@ Address: %4 Current number of blocks ბლოკების მიმდინარე რაოდენობა - - Estimated total blocks - ბლოკების სავარაუდო რაოდენობა - Last block time ბოლო ბლოკის დრო @@ -1464,7 +1286,7 @@ Address: %4 Totals - ჯამი + სულ: In: @@ -1496,7 +1318,7 @@ Address: %4 Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - კლავიშები "ზევით" და "ქვევით" - ისტორიაში მოძრაობა, <b>Ctrl-L</b> - ეკრანის გასუფთავება. + კლავიშები "ზევით" და "ქვევით" - ისტორიაში მოძრაობა, <b>Ctrl-L</b> - ეკრანის გასუფთავება. Type <b>help</b> for an overview of available commands. @@ -1518,19 +1340,7 @@ Address: %4 %1 GB %1 GB - - %1 m - %1 წთ - - - %1 h - %1 სთ - - - %1 h %2 m - %1 სთ %2 წთ - - + ReceiveCoinsDialog @@ -1650,7 +1460,7 @@ Address: %4 Amount - რაოდენობა + თანხა Label @@ -1685,7 +1495,7 @@ Address: %4 Amount - რაოდენობა + თანხა (no label) @@ -1742,10 +1552,6 @@ Address: %4 Fee: საკომისიო: - - Low Output: - ქვედა ზღვარი: - After Fee: დამატებითი საკომისიო: @@ -1822,10 +1628,6 @@ Address: %4 Copy priority პრიორიტეტის კოპირება - - Copy low output - ქვედა ზღვრის კოპირება - Copy change ხურდის კოპირება @@ -1850,10 +1652,6 @@ Address: %4 The amount exceeds your balance. თანხა აღემატება თქვენს ბალანსს - - The total exceeds your balance when the %1 transaction fee is included. - საკომისიო 1%-ის დამატების შემდეგ თანხა აჭარბებს თქვენს ბალანსს - Duplicate address found, can only send to each address once per send operation. მისამართები დუბლირებულია, დაშვებულია ერთ ჯერზე თითო მისამართზე ერთხელ გაგზავნა. @@ -1886,14 +1684,6 @@ Address: %4 added as transaction fee დამატებულია საკომისიო - - Payment request expired - გადახდის მოთხოვნას ვადა გაუვიდა - - - Invalid payment address %1 - გადახდის მისამართი არასწორია: %1 - SendCoinsEntry @@ -1905,10 +1695,6 @@ Address: %4 Pay &To: ადრესა&ტი: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - მისამართი, რომლითაც ასრულებთ გადახდას (მაგ.: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book შეიყვანეთ ამ მისამართის ნიშნული მისამართების წიგნში დასამატებლად @@ -1995,10 +1781,6 @@ Address: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. ხელმოწერით თქვენ ადასტურებთ, რომ მესიჯი თქვენია. ფრთხილად - არ მოაწეროთ ხელი რაიმე საეჭვოს: ფიშინგური ხრიკებით შეიძლება ის თქვენს მესიჯად გაასაღონ. მოაწერეთ ხელი მხოლოდ იმას, რასაც ყველა წვრილმანში ეთანხმებით. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - მისამართი, რომლითაც ხელს აწერთ (მაგ.: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Choose previously used address აირჩიეთ ადრე გამოყენებული მისამართი @@ -2049,11 +1831,7 @@ Address: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - შეიყვანეთ ხელმოწერის მისამართი, მესიჯი (დაუკვირდით, რომ ზუსტად იყოს კოპირებული სტრიქონის გადატანები, ჰარები, ტაბულაციები და სხვ) და ხელმოწერა მესიჯის ვერიფიკაციისათვის. მიაქციეთ ყურადღება, რომ რაიმე ზედმეტი არ გაგყვეთ კოპირებისას, რათა არ გახდეთ "man-in-the-middle" შეტევის ობიექტი. - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - მისამართი, რომლითაც ხელმოწერილია მესიჯი (მაგ.: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + შეიყვანეთ ხელმოწერის მისამართი, მესიჯი (დაუკვირდით, რომ ზუსტად იყოს კოპირებული სტრიქონის გადატანები, ჰარები, ტაბულაციები და სხვ) და ხელმოწერა მესიჯის ვერიფიკაციისათვის. მიაქციეთ ყურადღება, რომ რაიმე ზედმეტი არ გაგყვეთ კოპირებისას, რათა არ გახდეთ "man-in-the-middle" შეტევის ობიექტი. Verify the message to ensure it was signed with the specified Bitcoin address @@ -2068,12 +1846,8 @@ Address: %4 ვერიფიკაციის ყველა ველის წაშლა - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - შეიყვანეთ ბიტკოინ-მისამართი (მაგ. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - ხელმოწერის გენერირებისათვის დააჭირეთ "მესიჯის ხელმოწერა"-ს + Click "Sign Message" to generate signature + ხელმოწერის გენერირებისათვის დააჭირეთ "მესიჯის ხელმოწერა"-ს The entered address is invalid. @@ -2172,10 +1946,6 @@ Address: %4 Status სტატუსი - - , broadcast through %n node(s) - , დაგზავნილია %n კვანძისათვის - Date თარიღი @@ -2208,10 +1978,6 @@ Address: %4 Credit კრედიტი - - matures in %n more block(s) - მზად იქნება %n ბლოკის შემდეგ - not accepted უარყოფილია @@ -2245,8 +2011,8 @@ Address: %4 გამყიდველი - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - გენერირებული მონეტები გასაგზავნად მომწიფდება %1 ბლოკის შემდეგ. ეს ბლოკი გენერირების შემდეგ გავრცელებულ იქნა ქსელში ბლოკთა ჯაჭვზე დასამატებლად. თუ ის ვერ ჩაჯდა ჯაჭვში, მიეცემა სტატუსი "უარყოფილია" და ამ მონეტებს ვერ გამოიყენებთ. ასეთი რამ შეიძლება მოხდეს, თუ რომელიმე კვანძმა რამდენიმე წამით დაგასწროთ ბლოკის გენერირება. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + გენერირებული მონეტები გასაგზავნად მომწიფდება %1 ბლოკის შემდეგ. ეს ბლოკი გენერირების შემდეგ გავრცელებულ იქნა ქსელში ბლოკთა ჯაჭვზე დასამატებლად. თუ ის ვერ ჩაჯდა ჯაჭვში, მიეცემა სტატუსი "უარყოფილია" და ამ მონეტებს ვერ გამოიყენებთ. ასეთი რამ შეიძლება მოხდეს, თუ რომელიმე კვანძმა რამდენიმე წამით დაგასწროთ ბლოკის გენერირება. Debug information @@ -2276,10 +2042,6 @@ Address: %4 , has not been successfully broadcast yet , დაგზავნა არ არის წარმატებით დასრულებული - - Open for %n more block(s) - ღიაა კიდევ %n ბლოკისათვის - unknown უცნობია @@ -2310,18 +2072,10 @@ Address: %4 Address მისამართი - - Amount - რაოდენობა - Immature (%1 confirmations, will be available after %2) არ არის მომწიფებული (%1 დასტური, საჭიროა სულ %2) - - Open for %n more block(s) - ღიაა კიდევ %n ბლოკისათვის - Open until %1 ღია იქნება სანამ %1 @@ -2356,7 +2110,7 @@ Address: %4 Received with - მიღებულია + შემოსულია Received from @@ -2364,7 +2118,7 @@ Address: %4 Sent to - გაგზავნილია ადრესატთან + გაგზავნილია Payment to yourself @@ -2525,10 +2279,6 @@ Address: %4 Address მისამართი - - Amount - თანხა - ID ID @@ -2542,6 +2292,9 @@ Address: %4 - + + UnitDisplayStatusBarControl + WalletFrame @@ -2593,18 +2346,6 @@ Address: %4 bitcoin-core - - Usage: - გამოყენება: - - - List commands - ბრძანებები - - - Get help for a command - ბრძანების აღწერილობა - Options: ოპციები: @@ -2645,10 +2386,6 @@ Address: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) არასწორად მოქმედი პირების ბლოკირების დრო წამებში (ნაგულისხმევი: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - შეცდომა %u RPC-პორტის მიყურადების ჩართვისას IPv4 მისამართზე: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) JSON-RPC-შეერთებების მიყურადება პორტზე <port> (ნაგულისხმევი: 8332 ან სატესტო ქსელში: 18332) @@ -2657,10 +2394,6 @@ Address: %4 Accept command line and JSON-RPC commands საკომანდო სტრიქონისა და JSON-RPC-კომამდების ნებართვა - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands რეზიდენტულად გაშვება და კომანდების მიღება @@ -2683,7 +2416,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, მიუთითეთ rpcpassword საკონფიგურაციო ფაილში: %s @@ -2694,37 +2427,21 @@ rpcpassword=%s სახელი და პაროლი ერთმანეთს არ უნდა ემთხვეოდეს. თუ ფაილი არ არსებობს, შექმენით იგი უფლებებით owner-readable-only. ასევე რეკომენდებულია დააყენოთ alertnotify რათა მიიღოთ შეტყობინებები პრობლემების შესახებ; -მაგალითად: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +მაგალითად: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) დაშვებული ალგორითმები (ნაგულისხმევი: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - შეცდომა %u RPC-პორტის მიყურადების ჩართვისას IPv6 მისამართზე, ვბრუნდებით IPv4-ზე : %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 მოცემულ მისამართზე მიჯაჭვა მუდმივად მასზე მიყურადებით. გამოიყენეთ [host]:port ფორმა IPv6-სათვის - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - შესვლა რეგრესული ტესტირების რეჟიმში; სპეციალური ჯაჭვის გამოყენებით ბლოკების პოვნა ხდება დაუყოვნებლივ. გამოიყენება რეგრესული ტესტირების ინსტრუმენტებისა და პროგრამების შემუშავებისას. - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. გადასვლა რეგრესული ტესტირების რეჟიმში, რომელიც იყენებს სპეციალურ ჯაჭვს ბლოკების დაუყოვნებლივი პოვნის შესაძლებლობით. - - Error: Listening for incoming connections failed (listen returned error %d) - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. შეცდომა: ტრანსაქცია უარყოფილია! შესაძლოა მონეტების ნაწილი თქვენი საფულიდან უკვე გამოყენებულია, რაც შეიძლება მოხდეს wallet.dat-ის ასლის გამოყენებისას, როცა მონეტები გაიგზავნა სხვა ასლიდან, აქ კი არ არის გაგზავნილად მონიშნული. @@ -2737,38 +2454,10 @@ rpcpassword=%s Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) კომანდის შესრულება საფულის ტრანსაქციის ცვლილებისას (%s კომანდაში ჩანაცვლდება TxID-ით) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications ეს არის წინასწარი სატესტო ვერსია - გამოიყენეთ საკუთარი რისკით - არ გამოიყენოთ მოპოვებისა ან კომერციული მიზნებისათვის - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) ფარული Tor-სერვისებით პირების წვდომისათვის სხვა SOCKS5 პროქსის გამოყენება (ნაგულისხმევია: -proxy) @@ -2777,10 +2466,6 @@ rpcpassword=%s Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. ყურადღება: ძალიან მაღალია -paytxfee - საკომისო, რომელსაც თქვენ გადაიხდით ამ ტრანსაქციის გაგზავნის საფასურად. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - ყურადღება: შეამოწმეთ თქვენი კომპიუტერის სისტემური თარიღი და დრო! თუ ისინი არასწორია, Bitcoin ვერ იმუშავებს კორექტულად. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. ყურადღება: ქსელში შეუთანხმებლობაა. შესაძლოა ცალკეულ მომპოვებლებს პრობლემები ექმნებათ! @@ -2797,14 +2482,6 @@ rpcpassword=%s Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. ყურადღება: wallet.dat დაზიანებულია! ორიგინალური wallet.dat შენახულია როგორც wallet.{timestamp}.bak %s-ში; თუ შეამჩნიეთ უზუსტობა ნაშთში ან ტრანსაქციებში, აღადგინეთ არქივიდან. - - (default: 1) - - - - (default: wallet.dat) - - <category> can be: <category> შეიძლება იყოს: @@ -2813,46 +2490,18 @@ rpcpassword=%s Attempt to recover private keys from a corrupt wallet.dat პირადი გასაღებების აღდგენის მცდელობა wallet.dat-იდან - - Bitcoin Core Daemon - Bitcoin Core დემონი - Block creation options: ბლოკის შექმნის ოპციები: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - საფულის ტრანსაქციების სიის წაშლა (დიაგნოსტიკის საშუალება; მოიცავს -rescan-ს) - Connect only to the specified node(s) შეერთება მხოლოდ მითითებულ კვანძ(ებ)თან - - Connect through SOCKS proxy - შეერთება SOCKS-პროქსით - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - JSON-RPC-შეერთება პორტზე <port> (ნაგულისხმევი: 8332 ან სატესტო ქსელში: 18332) - - - Connection options: - - Corrupted block database detected შენიშნულია ბლოკთა ბაზის დაზიანება - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - Discover own IP address (default: 1 when listening and no -externalip) საკუთარი IP-მისამართის განსაზღვრა (ნაგულისხმევი: 1 თუ ჩართულია მიყურადება და არ გამოიყენება -externalip) @@ -2937,22 +2586,6 @@ rpcpassword=%s Failed to write undo data ცვლილებების გაუქმების მონაცემთა ჩაწერა ვერ მოხერხდა - - Fee per kB to add to transactions you send - საკომისო კბ-ზე, რომელიც დაემატება გაგზავნილ ტრანსაქციას - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - პირების ძებნა DNS-ით (ნაგულისხმევი: 1 გარდა -connect-ისა) - - - Force safe mode (default: 0) - - Generate coins (default: 0) მონეტების გენერირება (ნაგულისხმევი: 0) @@ -2965,17 +2598,13 @@ rpcpassword=%s If <category> is not supplied, output all debugging information. თუ <category> არ არის მითითებული, ნაჩვენები იქნება სრული დახვეწის ინფორმაცია. - - Importing... - - Incorrect or no genesis block found. Wrong datadir for network? საწყისი ბლოკი არ არსებობს ან არასწორია. ქსელის მონაცემთა კატალოგი datadir ხომ არის არასწორი? - Invalid -onion address: '%s' - არასწორია მისამართი -onion: '%s' + Invalid -onion address: '%s' + არასწორია მისამართი -onion: '%s' Not enough file descriptors available. @@ -2985,22 +2614,10 @@ rpcpassword=%s Prepend debug output with timestamp (default: 1) დაემატოს დახვეწის ინფორმაციას დროის ჭდეები (ნაგულისხმევი: 1) - - RPC client options: - RPC კლიენტის ოპციები: - Rebuild block chain index from current blk000??.dat files ბლოკთა ჯაჭვის ინდექსის ხელახლა აგება blk000??.dat ფაილიდან - - Select SOCKS version for -proxy (4 or 5, default: 5) - SOCKS-ვერსიის არჩევა -proxy-სათვის (4 ან 5, ნაგულისხმევი: 5) - - - Set database cache size in megabytes (%d to %d, default: %d) - - Set maximum block size in bytes (default: %d) ბლოკის მაქსიმალური ზომის განსაზღვრა ბაიტებში (ნადულისხმევი: %d) @@ -3021,10 +2638,6 @@ rpcpassword=%s This is intended for regression testing tools and app development. გამოიყენება რეგრესული ტესტირების ინსტრუმენტებისა და პროგრამების შემუშავებისას. - - Usage (deprecated, use bitcoin-cli): - გამოყენება (მოძველებულია, გამოიყენეთ bitcoin-cli): - Verifying blocks... ბლოკების ვერიფიკაცია... @@ -3033,10 +2646,6 @@ rpcpassword=%s Verifying wallet... საფულის ვერიფიკაცია... - - Wait for RPC server to start - RPC-სერვერის დალოდება გაშვებისათვის - Wallet %s resides outside data directory %s საფულე %s მდებარეობს მონაცემთა კატალოგის %s გარეთ @@ -3045,10 +2654,6 @@ rpcpassword=%s Wallet options: სფულის ოპციები: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - ყურადღება: მოძველებული არგუმენტი -debugnet იგნორირდება. გამოიყენეთ -debug=net - You need to rebuild the database using -reindex to change -txindex საჭიროა ბაზის ხელახალი აგება, გამოიყენეთ -reindex რათა შეცვალოთ -txindex @@ -3057,10 +2662,6 @@ rpcpassword=%s Imports blocks from external blk000??.dat file ბლოკების იმპორტი გარე blk000??.dat ფაილიდან - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) ბრძანების შესრულება შესაბამისი უწყების მიღებისას ან როცა შეინიშნება საგრძნობი გახლეჩა (cmd-ში %s შეიცვლება მესიჯით) @@ -3078,20 +2679,12 @@ rpcpassword=%s ინფორმაცია - Invalid amount for -minrelaytxfee=<amount>: '%s' - დაუშვებელი მნიშვნელობა -minrelaytxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + დაუშვებელი მნიშვნელობა -minrelaytxfee=<amount>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - დაუშვებელი მნიშვნელობა -mintxfee=<amount>: '%s' - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - + Invalid amount for -mintxfee=<amount>: '%s' + დაუშვებელი მნიშვნელობა -mintxfee=<amount>: '%s' Maintain a full transaction index (default: 0) @@ -3113,42 +2706,6 @@ rpcpassword=%s Only connect to nodes in network <net> (IPv4, IPv6 or Tor) შეერთება მხოლოდ <net> ქსელის კვანძებთან (IPv4, IPv6 ან Tor) - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL ოპციები: (იხილე Bitcoin Wiki-ში SSL-ს მოწყობის ინსტრუქციები) - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file ტრასირების/დახვეწის ინფოს გაგზავნა კონსოლზე debug.log ფაილის ნაცვლად @@ -3157,18 +2714,6 @@ rpcpassword=%s Set minimum block size in bytes (default: 0) დააყენეთ ბლოკის მინიმალური ზომა ბაიტებში (ნაგულისხმევი: 0) - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - Shrink debug.log file on client startup (default: 1 when no -debug) debug.log ფაილის შეკუმშვა გაშვებისას (ნაგულისხმევია: 1 როცა არ აყენია -debug) @@ -3181,10 +2726,6 @@ rpcpassword=%s Specify connection timeout in milliseconds (default: 5000) მიუთითეთ შეერთების ტაიმაუტი მილიწამებში (ნაგულისხმევი: 5000) - - Start Bitcoin Core Daemon - - System error: სისტემური შეცდომა: @@ -3225,14 +2766,6 @@ rpcpassword=%s Zapping all transactions from wallet... ტრანსაქციების ჩახსნა საფულიდან... - - on startup - - - - version - ვერსია - wallet.dat corrupt, salvage failed wallet.dat დაზიანებულია, აღდგენა ვერ მოხერხდა @@ -3241,14 +2774,6 @@ rpcpassword=%s Password for JSON-RPC connections პაროლი JSON-RPC-შეერთებისათვის - - Allow JSON-RPC connections from specified IP address - JSON-RPC-შეერთების ნებართვა მითითებული IP მისამართიდან - - - Send commands to node running on <ip> (default: 127.0.0.1) - კომანდის გაგზავნა კვანძისათვის, რომელიც გაშვებულია მისამართზე <ip> (ნაგულისხმევი: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) კომანდის შესრულება უკეთესი ბლოკის გამოჩენისას (%s კომანდაში ჩანაცვლდება ბლოკის ჰეშით) @@ -3281,10 +2806,6 @@ rpcpassword=%s This help message ეს ტექსტი - - Unable to bind to %s on this computer (bind returned error %d, %s) - ვერ ხერხდება მიბმა %s-თან ამ კომპიუტერზე (მიღებულია შეცდომა %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect DNS-ძებნის დაშვება -addnode, -seednode და -connect-სათვის @@ -3297,41 +2818,29 @@ rpcpassword=%s Error loading wallet.dat: Wallet corrupted არ იტვირთება wallet.dat: საფულე დაზიანებულია - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - არ იტვირთება wallet.dat: საფულეს სჭირდება Bitcoin-ის ახალი ვერსია - - - Wallet needed to be rewritten: restart Bitcoin to complete - საჭიროა საფულის აღდგენა: დაარესტარტეთ Bitcoin - Error loading wallet.dat არ იტვირთება wallet.dat - Invalid -proxy address: '%s' - არასწორია მისამართი -proxy: '%s' + Invalid -proxy address: '%s' + არასწორია მისამართი -proxy: '%s' - Unknown network specified in -onlynet: '%s' - -onlynet-ში მითითებულია უცნობი ქსელი: '%s' + Unknown network specified in -onlynet: '%s' + -onlynet-ში მითითებულია უცნობი ქსელი: '%s' - Unknown -socks proxy version requested: %i - მოთხოვნილია -socks პროქსის უცნობი ვერსია: %i + Cannot resolve -bind address: '%s' + ვერ ხერხდება -bind მისამართის გარკვევა: '%s' - Cannot resolve -bind address: '%s' - ვერ ხერხდება -bind მისამართის გარკვევა: '%s' + Cannot resolve -externalip address: '%s' + ვერ ხერხდება -externalip მისამართის გარკვევა: '%s' - Cannot resolve -externalip address: '%s' - ვერ ხერხდება -externalip მისამართის გარკვევა: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - დაუშვებელი მნიშვნელობა -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + დაუშვებელი მნიშვნელობა -paytxfee=<amount>: '%s' Invalid amount @@ -3377,13 +2886,5 @@ rpcpassword=%s Error შეცდომა - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - უნდა დააყენოთ rpcpassword=<password> საკონფიგურაციო ფაილში: -%s -თუ ეს ფაილი არ არსებობს, შექმენით იგი უფლებებით owner-readable-only. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_kk_KZ.ts b/src/qt/locale/bitcoin_kk_KZ.ts index b913ba9858..e9eddd503c 100644 --- a/src/qt/locale/bitcoin_kk_KZ.ts +++ b/src/qt/locale/bitcoin_kk_KZ.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -41,95 +9,19 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address Жаңа адрес енгізу - - &New - - Copy the currently selected address to the system clipboard Таңдаған адресті тізімнен жою - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - &Delete Жою - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - Comma separated file (*.csv) Үтірмен бөлінген текст (*.csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -147,10 +39,6 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase Құпия сөзді енгізу @@ -163,10 +51,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Жаңа құпия сөзді қайта енгізу - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Әмиянға жаңа қүпия сөзді енгізіңіз.<br/><b>10 немесе одан әрі кездейсоқ белгілерді</b>, әлде <b>сегіз немесе одан әрі сөздерді</b>құпия сөзіңізде пайдалану өтінеміз. - Encrypt wallet Әмиянді шифрлау @@ -191,2323 +75,126 @@ This product includes software developed by the OpenSSL Project for use in the O Change passphrase Құпия сөзді өзгерту - - Enter the old and new passphrase to the wallet. - - - - Confirm wallet encryption - - - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - - - Wallet encrypted - - - - Bitcoin 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. - - - - Wallet encryption failed - - - - Wallet encryption failed due to an internal error. Your wallet was not encrypted. - - - - The supplied passphrases do not match. - - - - Wallet unlock failed - - - - The passphrase entered for the wallet decryption was incorrect. - - - - Wallet decryption failed - - - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - - - Synchronizing with network... - - - - &Overview - - - - Node - - - - Show general overview of wallet - - - - &Transactions - - - - Browse transaction history - - - - E&xit - - - - Quit application - - - - Show information about Bitcoin - - - - About &Qt - - - - Show information about Qt - - - - &Options... - - - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - - - Change the passphrase used for wallet encryption - - - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - - - &File - - - - &Settings - - - - &Help - - - - Tabs toolbar - - - - [testnet] - - - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - - - %n active connection(s) to Bitcoin network - - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - - - Error - - - - Warning - - - - Information - - - - Up to date - - - - Catching up... - - - - Sent transaction - - - - Incoming transaction - - - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> - - - - Wallet is <b>encrypted</b> and currently <b>locked</b> - - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - - + ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - - - Amount - - Address Адрес - - Date - - - - Confirmations - - - - Confirmed - - - - Priority - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (таңбасыз) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog - - Edit Address - - - - &Label - - - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - - - &Address - - - - New receiving address - - - - New sending address - - - - Edit receiving address - - - - Edit sending address - - - - The entered address "%1" is already in the address book. - - - - The entered address "%1" is not a valid Bitcoin address. - - - - Could not unlock wallet. - - - - New key generation failed. - - - + FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - - - version - - - - Usage: - - - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - - - Error - - - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog - - Options - - - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage - - Form - - - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - - - <b>Recent transactions</b> - - - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - - Bitcoin - - - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - - - &Label: - - - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - - - Copy label - - - - Copy message - - - - Copy amount - - - + ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address Адрес - - Amount - - Label таңба - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel - - Date - - Label таңба - - Message - - - - Amount - - (no label) (таңбасыз) - - (no message) - - - - (no amount) - - - + SendCoinsDialog - - Send Coins - - - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - - - Send to multiple recipients at once - - - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - - - Balance: - - - - Confirm the send action - - - - S&end - - - - Confirm send coins - - - - %1 to %2 - - - - Copy quantity - - - - Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - - - The amount to pay must be larger than 0. - - - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (таңбасыз) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry - - A&mount: - - - - Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Enter a label for this address to add it to your address book - - - - &Label: - - - - Choose previously used address - - - - This is a normal payment. - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - - - [testnet] - - - + TrafficGraphWidget - - KB/s - - - + TransactionDesc - - Open until %1 - - - - conflicted - - - - %1/offline - - - - %1/unconfirmed - - - - %1 confirmations - - - - Status - - - - , broadcast through %n node(s) - - - - Date - - - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - - - Amount - - - - true - - - - false - - - - , has not been successfully broadcast yet - - - - Open for %n more block(s) - - - - unknown - - - + TransactionDescDialog - - Transaction details - - - - This pane shows a detailed description of the transaction - - - + TransactionTableModel - - Date - - - - Type - - Address Адрес - - Amount - - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - - - Open until %1 - - - - Confirmed (%1 confirmations) - - - - This block was not received by any other nodes and will probably not be accepted! - - - - Generated but not accepted - - - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - - - Received with - - - - Received from - - - - Sent to - - - - Payment to yourself - - - - Mined - - - - (n/a) - - - - Transaction status. Hover over this field to show number of confirmations. - - - - Date and time that the transaction was received. - - - - Type of transaction. - - - - Destination address of transaction. - - - - Amount removed from or added to balance. - - - + TransactionView - - All - - - - Today - - - - This week - - - - This month - - - - Last month - - - - This year - - - - Range... - - - - Received with - - - - Sent to - - - - To yourself - - - - Mined - - - - Other - - - - Enter address or label to search - - - - Min amount - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Үтірмен бөлінген файл (*.csv) - - Confirmed - - - - Date - - - - Type - - Label таңба @@ -2516,853 +203,28 @@ Address: %4 Address Адрес - - Amount - - - - ID - - - - Range: - - - - to - - - + + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel - - Send Coins - - - + WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - - - Options: - - - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - Transaction amount too small Транзакция өте кішкентай - - Transaction amounts must be positive - - Transaction too large Транзакция өте үлкен - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - - - Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - - - Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - - - Done loading - - - - To use the %s option - - - - Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - - + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_ko_KR.ts b/src/qt/locale/bitcoin_ko_KR.ts index ce30a8603d..9fe31b4330 100644 --- a/src/qt/locale/bitcoin_ko_KR.ts +++ b/src/qt/locale/bitcoin_ko_KR.ts @@ -1,46 +1,9 @@ - - - AboutDialog - - About Bitcoin Core - 비트코인 코어 소개 - - - <b>Bitcoin Core</b> version - <b>비트코인 코어</b> 버젼 - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -이 프로그램은 시험용입니다. - -MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http://www.opensource.org/licenses/mit-license.php를 참조하십시오. - -이 프로그램에는 OpenSSL 툴킷(http://www.openssl.org) 사용 목적으로 개발한 OpenSSL 프로젝트를 포함하고 있으며, 암호화 프로그램은 Eric Young(eay@cryptsoft.com)이, UPnP 프로그램은 Thomas Bernard가 작성했습니다. - - - Copyright - Copyright - - - The Bitcoin Core developers - 비트코인코어 개발자들 - - - (%1-bit) - (%1-비트) - - + AddressBookPage Double-click to edit address or label - 지갑 주소나 제목을 수정하려면 더블클릭하세요. + 지갑 주소나 이름을 수정하려면 더블클릭하세요. Create a new address @@ -104,7 +67,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - 이것이 비트코인 금액을 보내는 주소이다. 항상 코인을 보내기전에 잔고와 받는 주소를 확인하시오 + 비트코인을 받는 계좌 주소입니다. 코인을 보내기 전에 잔고와 받는 주소를 항상 확인하세요. These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. @@ -130,11 +93,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http Exporting Failed 내보내기 실패 - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -168,17 +127,13 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http Repeat new passphrase 새 암호 반복 - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - 새로운 암호를 지갑에 입력. 8자보다 많은 단어를 입력하거나 10 자보다 많은 여러 종류를 암호에 사용하세요. - Encrypt wallet 지갑 암호화 This operation needs your wallet passphrase to unlock the wallet. - 이 작업은 지갑을 열기위해 사용자의 지갑의 암호가 필요합니다. + 이 작업을 실행하려면 사용자 지갑의 암호가 필요합니다. Unlock wallet @@ -186,7 +141,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http This operation needs your wallet passphrase to decrypt the wallet. - 이 작업은 지갑을 해독하기 위해 사용자의 지갑 암호가 필요합니다. + 이 작업은 지갑을 해독하기 위해 사용자 지갑의 암호가 필요합니다. Decrypt wallet @@ -206,7 +161,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - 경고: 만약 당신의 지갑을 암호화 하고 비밀번호를 잃어 버릴 경우, 당신의 모든 비트코인들을 잃어버릴 수 있습니다! + 경고: 만약 암호화된 지갑의 비밀번호를 잃어버릴 경우, 모든 비트코인들을 잃어버릴 수 있습니다! Are you sure you wish to encrypt your wallet? @@ -214,7 +169,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http 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. - + 중요: 본인 지갑파일에서 만든 예전 백업들은 새로 생성한 암화화된 지갑 파일로 교체됩니다. 보안상 이유로 이전에 암호화 하지 않은 지갑 파일 백업은 사용할 수 없게 되니 빠른 시일 내로 새로 암화화된 지갑을 사용하시기 바랍니다. Warning: The Caps Lock key is on! @@ -226,7 +181,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http Bitcoin 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. - 암호화 처리 과정을 끝내기 위해 비트코인을 닫겠습니다. 지갑 암호화는 컴퓨터로의 멀웨어 감염으로 인한 비트코인 도난을 완전히 막아주지 못함을 기억하십시오. + 암호화 처리 과정을 끝내기 위해 비트코인을 종료합니다. 지갑 암호화는 컴퓨터로의 멀웨어 감염으로 인한 비트코인 도난을 완전히 방지할 수 없음을 기억하세요. Wallet encryption failed @@ -242,7 +197,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http Wallet unlock failed - 지갑 열기를 실패하였습니다. + 지갑을 열지 못했습니다. The passphrase entered for the wallet decryption was incorrect. @@ -254,7 +209,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http Wallet passphrase was successfully changed. - 지갑 비밀번호가 성공적으로 변경되었습니다 + 지갑 비밀번호가 성공적으로 변경되었습니다. @@ -277,7 +232,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http Show general overview of wallet - 지갑의 일반적 개요를 보여 줍니다. + 지갑의 일반적 개요를 보여줍니다. &Transactions @@ -295,10 +250,6 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http Quit application 적용 중단 - - Show information about Bitcoin - 비트코인에 대한 정보를 보여줍니다. - About &Qt Qt 정보(&Q) @@ -333,7 +284,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http Open &URI... - URI&열기 + URI&열기... Importing blocks from disk... @@ -401,7 +352,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http Sign messages with your Bitcoin addresses to prove you own them - 지갑 주소가 자신 소유의 것인지 증명하기 위해 비트코인 주소에 서명할 수 있습니다. + 지갑 주소가 본인 소유인지 증명하기 위해 비트코인 주소에 서명할 수 있습니다. Verify messages to ensure they were signed with specified Bitcoin addresses @@ -429,7 +380,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http Bitcoin Core - 비트코인코어 + 비트코인 코어 Request payments (generates QR codes and bitcoin: URIs) @@ -457,48 +408,32 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - 비트코인 고객 - - - %n active connection(s) to Bitcoin network - 비트코인 네트워크와 %n 개의 활성연결 + 사용할 수 있는 비트코인 명령어 옵션 목록을 가져오기 위해 Bitcoin-Qt 도움말 메시지를 표시합니다. No block source available... - 사용 가능한 블락 소스가 없습니다... - - - Processed %1 of %2 (estimated) blocks of transaction history. - 송금 기록 %1/%2개 블록 (추산) 처리됨. + 사용 가능한 블록이 없습니다... Processed %1 blocks of transaction history. - %1 블락의 거래 기록들이 처리됨. + %1 블록의 거래 기록들이 처리됨. %n hour(s) - 시간 + %n시간 %n day(s) - + %n일 %n week(s) - + %n주 %1 and %2 %1 그리고 %2 - - %n year(s) - %n 년 - %1 behind %1 뒤에 @@ -509,7 +444,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http Transactions after this will not yet be visible. - 이것 후의 거래들은 아직 보이지 않을 것입니다. + 이 후의 거래들은 아직 보이지 않을 것입니다. Error @@ -529,7 +464,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http Catching up... - 따라잡기... + 블록 따라잡기... Sent transaction @@ -537,7 +472,7 @@ MIT/X11 프로그램 라이선스에 따라 배포합니다. COPYING 또는 http Incoming transaction - 거래 들어오는 중 + 들어오고 있는 거래 Date: %1 @@ -559,10 +494,6 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> 지갑이 암호화 되었고 현재 잠겨져 있습니다 - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - 치명적인 오류가 있습니다. 비트코인을 더이상 안전하게 진행할 수 없어 빠져나갑니다. - ClientModel @@ -575,7 +506,7 @@ Address: %4 CoinControlDialog Coin Control Address Selection - 코인컨트롤 주소 선택 + 코인 컨트롤 주소 선택 Quantity: @@ -583,32 +514,24 @@ Address: %4 Bytes: - Bytes: + 바이트: Amount: - 거래량 + 거래량: Priority: - 우선도: + 우선순위: Fee: 수수료: - - Low Output: - - After Fee: 수수료 이후: - - Change: - - (un)select all 모두 선택(하지 않음) @@ -643,7 +566,7 @@ Address: %4 Priority - 우선도 + 우선순위 Copy address @@ -651,15 +574,15 @@ Address: %4 Copy label - 라벨 복사하기 + 표 복사하기 Copy amount - 거래액 복사 + 거래량 복사 Copy transaction ID - 송금 ID 복사 + 거래 아이디 복사 Lock unspent @@ -683,55 +606,47 @@ Address: %4 Copy bytes - bytes를 복사 + bytes 복사 Copy priority 우선도 복사 - - Copy low output - - - - Copy change - - highest - 최상 + 아주 높음 higher - + 보다 높음 high - + 높음 medium-high - 중상 + 약간 높음 medium - + 보통 low-medium - 중하 + 약간 낮음 low - + 낮음 lower - + 보다 낮음 lowest - + 아주 낮음 (%1 locked) @@ -741,10 +656,6 @@ Address: %4 none 없음 - - Dust - - yes @@ -761,47 +672,23 @@ Address: %4 This means a fee of at least %1 per kB is required. 이 의미는 수수료가 최소한 %1 per 키로바이트 필요합니다 - - Can vary +/- 1 byte per input. - - Transactions with higher priority are more likely to get included into a block. 우선 순위가 높은 거래의 경우 블럭에 포함될 가능성이 더 많습니다. - This label turns red, if the priority is smaller than "medium". + This label turns red, if the priority is smaller than "medium". 우선권이 중간보다 작으면 제목이 빨간색으로 변합니다. - - This label turns red, if any recipient receives an amount smaller than %1. - 만약 수령인이 받은 액수가 잔고의 1%보다 작으면 이 제목이 빨간색으로 변합니다. - - - This means a fee of at least %1 is required. - 최소 %1의 거래 수수료가 필요하다는 뜻입니다. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - 노드 릴레이를 위한 최저 수수료의 0.546배보다 낮은 거래는 먼지 거래로 표현됩니다. - - - This label turns red, if the change is smaller than %1. - 만약 잔돈이 1%보다 작다면 제목이 빨간색으로 변합니다 - (no label) - (표 없슴) + (표 없음) change from %1 (%2) ~로부터 변경 %1 (%2) - - (change) - - - + EditAddressDialog @@ -816,10 +703,6 @@ Address: %4 The label associated with this address list entry 현재 선택된 주소 필드의 제목입니다. - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &주소 @@ -841,12 +724,12 @@ Address: %4 보내는 주소 편집 - The entered address "%1" is already in the address book. - 입력된 주소는"%1" 이미 주소록에 있습니다. + The entered address "%1" is already in the address book. + 입력된 주소는"%1" 이미 주소록에 있습니다. - The entered address "%1" is not a valid Bitcoin address. - 입력한 "%1" 주소는 올바른 비트코인 주소가 아닙니다. + The entered address "%1" is not a valid Bitcoin address. + 입력한 "%1" 주소는 올바른 비트코인 주소가 아닙니다. Could not unlock wallet. @@ -882,18 +765,26 @@ Address: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - 비트코인 코어 - 명령어-라인 옵션 - Bitcoin Core - 비트코인코어 + 비트코인 코어 version 버전 + + (%1-bit) + (%1-비트) + + + About Bitcoin Core + 비트코인 코어 소개 + + + Command-line options + 명령줄 옵션 + Usage: 사용법: @@ -907,8 +798,8 @@ Address: %4 UI 옵션 - Set language, for example "de_DE" (default: system locale) - "de_DE"와 같이 언어를 설정하십시오 (기본값: 시스템 로캘) + Set language, for example "de_DE" (default: system locale) + "de_DE"와 같이 언어를 설정하십시오 (기본값: 시스템 로캘) Start minimized @@ -954,12 +845,8 @@ Address: %4 커스텀 데이터 폴더 사용: - Bitcoin - 비트코인 - - - Error: Specified data directory "%1" can not be created. - 오류 : 별도 정의한 폴더명 "%1" 생성에 실패했습니다. + Bitcoin Core + 비트코인 코어 Error @@ -1047,17 +934,13 @@ Address: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) 프록시 아이피 주소(예. IPv4:127.0.0.1 / IPv6: ::1) - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - Third party transaction URLs 제 3자 거래 URLs Active command-line options that override above options: - + 명령어 라인 옵션을 활성화해서 옵션을 우회하시오 Reset all client options to default. @@ -1071,10 +954,6 @@ Address: %4 &Network 네트워크(&N) - - (0 = auto, <0 = leave that many cores free) - - W&allet 지갑 @@ -1087,10 +966,6 @@ Address: %4 Enable coin &control features 코인 상세 제어기능을 활성화합니다 - &C - - 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. - - &Spend unconfirmed change &확인되지 않은 돈을 쓰다 @@ -1115,14 +990,6 @@ Address: %4 Port of the proxy (e.g. 9050) 프록시의 포트번호입니다(예: 9050) - - SOCKS &Version: - SOCKS 버전(&V): - - - SOCKS version of the proxy (e.g. 5) - 프록시의 SOCKS 버전입니다(예: 5) - &Window 창(&W) @@ -1163,14 +1030,6 @@ Address: %4 Choose the default subdivision unit to show in the interface and when sending coins. 인터페이스에 표시하고 코인을 보낼때 사용할 기본 최소화 단위를 선택하십시오. - - Whether to show Bitcoin addresses in the transaction list or not. - 송금 목록에 비트코인 주소를 표시할지의 여부입니다. - - - &Display addresses in transaction list - 송금 목록에 주소 표시(&D) - Whether to show coin control features or not. 코인 상세 제어기능에 대한 표시 여부를 선택할 수 있습니다. @@ -1228,7 +1087,7 @@ Address: %4 Available: - 유용한 + 사용 가능 Your current spendable balance @@ -1236,7 +1095,7 @@ Address: %4 Pending: - 미정 + 미확정 Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance @@ -1264,7 +1123,7 @@ Address: %4 out of sync - 오래됨 + 동기화 필요 @@ -1274,8 +1133,8 @@ Address: %4 URI 조작중 - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI의 파싱에 문제가 발생했습니다. 잘못된 비트코인 주소나 URI 파라미터 구성에 오류가 존재할 수 있습니다. + Invalid payment address %1 + 잘못된 지불 주소입니다 %1 Requested payment amount of %1 is too small (considered dust). @@ -1289,29 +1148,17 @@ Address: %4 Cannot start bitcoin: click-to-pay handler 비트코인을 시작할 수 없습니다: 지급제어기를 클릭하시오 - - Net manager warning - 네트워크 관리인 경고 - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - 현재의 프록시가 SOCKS5를 지원하지 않아 지불 요청을 수행할 수 없습니다. - Payment request fetch URL is invalid: %1 - + 대금 청구서의 URL이 올바르지 않습니다: %1 Payment request file handling 지불이 파일 처리를 요청합니다 - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - Unverified payment requests to custom payment scripts are unsupported. - + 임의로 변경한 결제 스크립트 기반의 대금 청구서 양식은 검증되기 전까지는 지원되지 않습니다. Refund from %1 @@ -1321,10 +1168,6 @@ Address: %4 Error communicating with %1: %2 %1과 소통하는데 애러: %2 - - Payment request can not be parsed or processed! - - Bad response from server %1 서버로 부터 반응이 없습니다 %1 @@ -1338,33 +1181,20 @@ Address: %4 네트워크 요청 애러 + + PeerTableModel + QObject - Bitcoin - 비트코인 + Amount + 거래량 - Error: Specified data directory "%1" does not exist. - 애러: 지정한 데이터 폴더 "%1"은 존재하지 않습니다. + N/A + 없음 - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - 오류: 잘못된 -regtest 와 -testnet의 조합입니다. - - - Bitcoin Core didn't yet exit safely... - 비트코인 코어가 아직 안전하게 종료되지 않았습니다. - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - 비트코인 주소를 입력하기 (예 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget @@ -1400,7 +1230,7 @@ Address: %4 &Information - 정보& + 정보 Debug window @@ -1438,10 +1268,6 @@ Address: %4 Current number of blocks 현재 블럭 수 - - Estimated total blocks - 예상 전체 블럭 - Last block time 최종 블럭 시각 @@ -1468,11 +1294,11 @@ Address: %4 In: - + In: Out: - + Out: Build date @@ -1502,35 +1328,7 @@ Address: %4 Type <b>help</b> for an overview of available commands. 사용할 수 있는 명령을 둘러보려면 <b>help</b>를 입력하십시오. - - %1 B - % 1 바이트 - - - %1 KB - % 1 킬로바이트 - - - %1 MB - % 1 메가바이트 - - - %1 GB - % 1 기가바이트 - - - %1 m - % 1 분 - - - %1 h - % 1 시간 - - - %1 h %2 m - % 1시 %2 분 - - + ReceiveCoinsDialog @@ -1553,13 +1351,9 @@ Address: %4 R&euse an existing receiving address (not recommended) 현재의 수취용 주소를 재사용합니다만 권장하지는 않습니다. (R&) - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - An optional label to associate with the new receiving address. - + 임의의 라벨이 새로운 받기 주소와 결합 Use this form to request payments. All fields are <b>optional</b>. @@ -1585,10 +1379,6 @@ Address: %4 &Request payment 지불 요청(&R) - - Show the selected request (does the same as double clicking an entry) - - Show 보기 @@ -1689,7 +1479,7 @@ Address: %4 (no label) - (표 없슴) + (표 없음) (no message) @@ -1728,7 +1518,7 @@ Address: %4 Bytes: - Bytes: + 바이트: Amount: @@ -1736,28 +1526,16 @@ Address: %4 Priority: - 우선도: + 우선순위: Fee: 수수료: - - Low Output: - - After Fee: 수수료 이후: - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - Custom change address 주소변경 @@ -1804,7 +1582,7 @@ Address: %4 Copy amount - 거래액 복사 + 거래량 복사 Copy fee @@ -1822,14 +1600,6 @@ Address: %4 Copy priority 우선도 복사 - - Copy low output - - - - Copy change - - Total Amount %1 (= %2) 총 액수 %1(=%2) @@ -1872,7 +1642,7 @@ Address: %4 (no label) - (표 없슴) + (표 없음) Warning: Unknown change address @@ -1886,14 +1656,6 @@ Address: %4 added as transaction fee 거래 수수료로 추가됨 - - Payment request expired - 지불 요청 만료 - - - Invalid payment address %1 - 잘못된 지불 주소입니다 %1 - SendCoinsEntry @@ -1905,10 +1667,6 @@ Address: %4 Pay &To: 지급&수신: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - 비트코인을 송금할 지갑 주소 입력하기 (예 : 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book 당신의 주소록에 이 주소를 추가하기 위하여 표를 입역하세요 @@ -1953,10 +1711,6 @@ Address: %4 Enter a label for this address to add it to the list of used addresses 사용된 주소 목록에 새 주소를 추가하기 위해 제목을 입력합니다. - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - This is an unverified payment request. 지급요청 미확인입니다 @@ -1995,10 +1749,6 @@ Address: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. 여러분 자신을 증명하기 위해 주소를 첨가하고 섬여할 수 있습니다. 피싱 공격으로 말미암아 여러분의 서명을 통해 속아 넘어가게 할 수 있으므로, 서명하지 않은 어떤 모호한 요소든 주의하십시오. 동의하는 완전 무결한 조항에만 서명하십시오. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - 메시지를 서명할 주소 (예: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Choose previously used address 이전에 사용한 주소를 선택하십시오 @@ -2051,10 +1801,6 @@ Address: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. 메시지를 검증하기 위해 아래 칸에 각각 지갑 주소와 메시지, 전자서명을 입력하세요. (메시지 원본의 띄어쓰기, 들여쓰기, 행 나눔 등이 정확하게 입력되어야 하므로 원본을 복사해서 입력하세요) 이 기능은 메시지 검증이 주 목적이며, 네트워크 침입자에 의해 변조되지 않도록 전자서명 해독에 불필요한 시간을 소모하지 마세요. - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - 서명한 메시지의 주소입니다 (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address 정확한 비트코인주소가 입력됬는지 메시지를 확인하시오 @@ -2068,12 +1814,8 @@ Address: %4 모든 검증 메시지 필드 재설정 - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - 비트코인 주소를 입력하기 (예 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - 서명을 만들려면 "메시지 서명"을 누르십시오 + Click "Sign Message" to generate signature + 서명을 만들려면 "메시지 서명"을 누르십시오 The entered address is invalid. @@ -2128,7 +1870,7 @@ Address: %4 SplashScreen Bitcoin Core - 비트코인코어 + 비트코인 코어 The Bitcoin Core developers @@ -2172,10 +1914,6 @@ Address: %4 Status 상태 - - , broadcast through %n node(s) - %n 노드를 거쳐 전파합니다. - Date 날짜 @@ -2208,10 +1946,6 @@ Address: %4 Credit 예금 - - matures in %n more block(s) - - not accepted 허용되지 않는다 @@ -2238,15 +1972,15 @@ Address: %4 Transaction ID - 송금 ID + 아이디 Merchant 상인 - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - 신규 채굴된 코인이 사용되기 위해서는 %1 개의 블럭이 경과되어야 합니다. 블럭을 생성할 때 블럭체인에 추가되도록 네트워크에 전파되는 과정을 거치는데, 블럭체인에 포함되지 못하고 실패한다면 해당 블럭의 상태는 '미승인'으로 표현되고 비트코인 또한 사용될 수 없습니다. 이 현상은 다른 노드가 비슷한 시간대에 동시에 블럭을 생성할 때 종종 발생할 수 있습니다. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + 신규 채굴된 코인이 사용되기 위해서는 %1 개의 블럭이 경과되어야 합니다. 블럭을 생성할 때 블럭체인에 추가되도록 네트워크에 전파되는 과정을 거치는데, 블럭체인에 포함되지 못하고 실패한다면 해당 블럭의 상태는 '미승인'으로 표현되고 비트코인 또한 사용될 수 없습니다. 이 현상은 다른 노드가 비슷한 시간대에 동시에 블럭을 생성할 때 종종 발생할 수 있습니다. Debug information @@ -2276,10 +2010,6 @@ Address: %4 , has not been successfully broadcast yet . 아직 성공적으로 통보하지 않음 - - Open for %n more block(s) - %n 개의 추가 블럭을 읽습니다. - unknown 알수없음 @@ -2304,24 +2034,16 @@ Address: %4 Type - 형식 + 종류 Address 주소 - - Amount - 수량 - Immature (%1 confirmations, will be available after %2) 충분히 숙성되지 않은 상태 (%1 승인, %2 후에 사용 가능합니다) - - Open for %n more block(s) - %n 개의 추가 블럭을 읽습니다. - Open until %1 %1 까지 열림 @@ -2356,7 +2078,7 @@ Address: %4 Received with - 다음과 함께 받음 : + 보낸 주소 Received from @@ -2364,7 +2086,7 @@ Address: %4 Sent to - 다음에게 보냄 : + 받는 주소 Payment to yourself @@ -2372,7 +2094,7 @@ Address: %4 Mined - 채굴됨 + 채굴 (n/a) @@ -2467,11 +2189,11 @@ Address: %4 Copy amount - 거래액 복사 + 거래량 복사 Copy transaction ID - 송금 ID 복사 + 거래 아이디 복사 Edit label @@ -2525,10 +2247,6 @@ Address: %4 Address 주소 - - Amount - 거래량 - ID 아이디 @@ -2542,6 +2260,9 @@ Address: %4 상대방 + + UnitDisplayStatusBarControl + WalletFrame @@ -2593,18 +2314,6 @@ Address: %4 bitcoin-core - - Usage: - 사용법: - - - List commands - 커맨드 목록 - - - Get help for a command - 커맨드 도움말 - Options: 옵션: @@ -2645,10 +2354,6 @@ Address: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) 이상행동을 하는 네트워크 참여자들을 다시 연결시키는데 걸리는 시간 (기본값: 86400초) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - IPv4 감청을 위한 RPC 포트 %u번을 설정중 오류가 발생했습니다: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) 포트 <port>을 통해 JSON-RPC 연결 (기본값: 8332 또는 testnet: 18332) @@ -2657,10 +2362,6 @@ Address: %4 Accept command line and JSON-RPC commands 명령줄과 JSON-RPC 명령 수락 - - Bitcoin Core RPC client version - 비트코인 코어 RPC 클라이언트 버전 - Run in the background as a daemon and accept commands 데몬으로 백그라운드에서 실행하고 명령을 허용 @@ -2673,47 +2374,13 @@ Address: %4 Accept connections from outside (default: 1 if no -proxy or -connect) 외부 접속을 승인합니다 - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) 암호 허용(기본값: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - IPv6 연결을 위해 RPC port %u 설정 중 오류가 발생했습니다. IPv4: %s 환경으로 돌아갑니다. - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - + 선택된 주소로 고정하며 항상 리슨(Listen)합니다. IPv6 프로토콜인 경우 [host]:port 방식의 명령어 표기법을 사용합니다. Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. @@ -2729,38 +2396,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) 지갑 거래가 바뀌면 명령을 실행합니다.(%s 안의 명령어가 TxID로 바뀝니다) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - 해당 금액보다 적은 수수료는 수수료 면제로 간주됩니다. (거래 생성의 목적)(기본값: - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications 이 빌드 버전은 정식 출시 전 테스트의 목적이며, 예기치 않은 위험과 오류가 발생할 수 있습니다. 채굴과 상점용 소프트웨어로 사용하는 것을 권하지 않습니다. - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) Tor 서비스를 이용하여 네트워크에 참여하기 위해서 SOCKS5 프록시를 따로 사용함 (기본값: -proxy) @@ -2769,10 +2408,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. 경고: -paytxfee값이 너무 큽니다! 이 값은 송금할때 지불할 송금 수수료입니다. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - 경고: 컴퓨터의 날짜와 시간이 올바른지 확인하십시오! 시간이 잘못되면 비트코인은 제대로 동작하지 않습니다. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. 경고 : 모든 네트워크가 동의해야 하나, 일부 채굴자들에게 문제가 있는 것으로 보입니다. @@ -2797,38 +2432,18 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. (default: wallet.dat) (기본값: wallet.dat) - - <category> can be: - - Attempt to recover private keys from a corrupt wallet.dat 손상된 wallet.dat에서 개인키 복원을 시도합니다 - - Bitcoin Core Daemon - 비트코인 코어 데몬 - Block creation options: 블록 생성 옵션: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - 거래내역 삭제(진단도구; 재스캔 포함) - Connect only to the specified node(s) 지정된 노드에만 연결하기 - - Connect through SOCKS proxy - SOCKS 프록시를 통해 연결 - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - JSON-RPC에 연결 <포트>(기본값:8332 또는 테스트넷: 18332) - Connection options: 연결 설정 : @@ -2851,7 +2466,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Do not load the wallet and disable wallet RPC calls - + 지갑 불러오기를 하지마시오 또한 지갑 RPC 연결을 차단하십시오 Do you want to rebuild the block database now? @@ -2861,10 +2476,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error initializing block database 블록 데이터베이스를 초기화하는데 오류 - - Error initializing wallet database environment %s! - 지갑 데이터베이스 환경 초기화하는데 오류 - Error loading block database 블록 데이터베이스를 불러오는데 오류 @@ -2929,18 +2540,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write undo data 데이터 실행 취소를 기록하는데 실패했습니다 - - Fee per kB to add to transactions you send - 송금 거래시 추가되는 KB 당 수수료입니다. - - - Fees smaller than this are considered zero fee (for relaying) (default: - 해당 금액보다 적은 수수료는 수수료 면제로 간주됩니다. (릴레이 목적)(기본값: - - - Find peers using DNS lookup (default: 1 unless -connect) - DNS 찾기를 이용하여 사용자를 찾으시오(기본값: 1 연결 되면) - Force safe mode (default: 0) 안전 모드로 강제 진입하는 기능입니다.(기본값: 0) @@ -2953,10 +2552,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. How many blocks to check at startup (default: 288, 0 = all) 시작할때 검사할 블록 갯수입니다(기본값: 288, 0 = 모두) - - If <category> is not supplied, output all debugging information. - - Importing... 들여오기 중... @@ -2966,29 +2561,17 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. 올바르지 않거나 생성된 블록을 찾을 수 없습니다. 잘못된 네트워크 자료 디렉토리? - Invalid -onion address: '%s' - 잘못된 -onion 주소입니다: '%s' + Invalid -onion address: '%s' + 잘못된 -onion 주소입니다: '%s' Not enough file descriptors available. 사용 가능한 파일 디스크립터-File Descriptor-가 부족합니다. - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - RPC 클라이언트 옵션 - Rebuild block chain index from current blk000??.dat files 현재의 blk000??.dat 파일들로부터 블록체인 색인을 재구성합니다. - - Select SOCKS version for -proxy (4 or 5, default: 5) - -proxy를 위한 SOCKS 버전을 선택하세요 (4 또는 5, 기본: 5) - Set database cache size in megabytes (%d to %d, default: %d) 데이터베이스 케시 크기를 메가바이트로 설정(%d 부터 %d, 기본값: %d) @@ -3005,18 +2588,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Specify wallet file (within data directory) 데이터 폴더 안에 지갑 파일을 선택하세요. - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - 사용법 (오래되었습니다. bitcoin-cli를 사용하십시오): - Verifying blocks... 블록 검증중... @@ -3025,22 +2596,14 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Verifying wallet... 지갑 검증중... - - Wait for RPC server to start - RPC서버가 시작되길 기다리십시요 - Wallet %s resides outside data directory %s - + 지갑 %s는 데이터 디렉토리 %s 밖에 위치합니다. Wallet options: 지갑 옵션: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - You need to rebuild the database using -reindex to change -txindex -txindex를 바꾸기 위해서는 -reindex를 사용해서 데이터베이스를 재구성해야 합니다. @@ -3051,7 +2614,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - + 데이터 디렉토리 %s에 락을 걸 수 없었습니다. 비트코인 코어가 이미 실행 중인 것으로 보입니다. Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) @@ -3059,7 +2622,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Output debugging information (default: 0, supplying <category> is optional) - + 출력 오류 정보(기본값:0, 임의의 공급 카테고리) Set maximum size of high-priority/low-fee transactions in bytes (default: %d) @@ -3070,12 +2633,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. 정보 - Invalid amount for -minrelaytxfee=<amount>: '%s' - 노드로 전달하기 위한 최저 거래 수수료가 부족합니다. - minrelaytxfee=<amount>: '%s' - + Invalid amount for -minrelaytxfee=<amount>: '%s' + 노드로 전달하기 위한 최저 거래 수수료가 부족합니다. - minrelaytxfee=<amount>: '%s' - - Invalid amount for -mintxfee=<amount>: '%s' - 최저 거래 수수료가 부족합니다. -mintxfee=<amount>: '%s' + Invalid amount for -mintxfee=<amount>: '%s' + 최저 거래 수수료가 부족합니다. -mintxfee=<amount>: '%s' Limit size of signature cache to <n> entries (default: 50000) @@ -3125,22 +2688,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Randomly drop 1 of every <n> network messages 모든 네트워크 메시지 마다 무작위로 1이 떨어진다 - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL 옵션: (SSL 설정 절차를 보혀면 비트코인 위키를 참조하십시오) - - - Send command to Bitcoin Core - 비트코인 코어로 명령 보내기 - Send trace/debug info to console instead of debug.log file 추적오류 정보를 degug.log 자료로 보내는 대신 콘솔로 보내기 @@ -3157,10 +2704,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Show all debugging options (usage: --help -help-debug) 모든 디버그 설정 보기(설정: --help -help-debug) - - Show benchmark information (default: 0) - 벤치마크 정보 보기(기본값: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) 클라이언트 시작시 debug.log 파일 비우기(기본값: 디버그 안할때 1) @@ -3173,10 +2716,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Specify connection timeout in milliseconds (default: 5000) 밀리초 단위로 연결 제한시간을 설정하십시오(기본값: 5000) - - Start Bitcoin Core Daemon - 비트코인 코어의 데몬 프로그램을 실행합니다. - System error: 시스템 오류: @@ -3221,10 +2760,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. on startup 구동 중 - - version - 버전 - wallet.dat corrupt, salvage failed wallet.dat 파일이 손상되었고 복구가 실패하였습니다. @@ -3233,14 +2768,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Password for JSON-RPC connections JSON-RPC 연결에 사용할 암호 - - Allow JSON-RPC connections from specified IP address - 지정한 IP 주소의 JSON-RPC 연결 허용 - - - Send commands to node running on <ip> (default: 127.0.0.1) - 실행 중인 노드로 명령 전송 <ip> (기본값: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) 최고의 블럭이 변하면 명령을 실행(cmd 에 있는 %s 는 블럭 해시에 의해 대체되어 짐) @@ -3273,10 +2800,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message 도움말 메시지입니다 - - Unable to bind to %s on this computer (bind returned error %d, %s) - 이 컴퓨터의 %s에 바인딩할 수 없습니다 (바인딩 과정에 %d 오류 발생, %s) - Allow DNS lookups for -addnode, -seednode and -connect -addnode, -seednode, -connect 옵션에 대해 DNS 탐색 허용 @@ -3289,41 +2812,29 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted wallet.dat 불러오기 에러: 지갑 오류 - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - wallet.dat 불러오기 에러: 지갑은 새버전의 비트코인이 필요합니다. - - - Wallet needed to be rewritten: restart Bitcoin to complete - 지갑을 새로 써야 합니다.: 완성하기 위하여 비트코인을 다시 시작하십시오. - Error loading wallet.dat wallet.dat 불러오기 에러 - Invalid -proxy address: '%s' - 잘못된 -proxy 주소입니다: '%s' + Invalid -proxy address: '%s' + 잘못된 -proxy 주소입니다: '%s' - Unknown network specified in -onlynet: '%s' - -onlynet에 지정한 네트워크를 알 수 없습니다: '%s' + Unknown network specified in -onlynet: '%s' + -onlynet에 지정한 네트워크를 알 수 없습니다: '%s' - Unknown -socks proxy version requested: %i - 요청한 -socks 프록히 버전을 알 수 없습니다: %i + Cannot resolve -bind address: '%s' + -bind 주소를 확인할 수 없습니다: '%s' - Cannot resolve -bind address: '%s' - -bind 주소를 확인할 수 없습니다: '%s' + Cannot resolve -externalip address: '%s' + -externalip 주소를 확인할 수 없습니다: '%s' - Cannot resolve -externalip address: '%s' - -externalip 주소를 확인할 수 없습니다: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - -paytxfee=<amount>에 대한 양이 잘못되었습니다: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + -paytxfee=<amount>에 대한 양이 잘못되었습니다: '%s' Invalid amount @@ -3369,13 +2880,5 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error 오류 - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - 설정 파일에 rpcpassword=<암호>를 설정해야 합니다: -%s -파일이 없으면 소유자 읽기 전용 파일 권한으로 만들어야 합니다. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_ky.ts b/src/qt/locale/bitcoin_ky.ts index d0db034e86..ad4b5eae03 100644 --- a/src/qt/locale/bitcoin_ky.ts +++ b/src/qt/locale/bitcoin_ky.ts @@ -1,141 +1,17 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage - - Double-click to edit address or label - - Create a new address Жаң даректи жасоо - - &New - - - - Copy the currently selected address to the system clipboard - - - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - &Delete Ө&чүрүү - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - - - Comma separated file (*.csv) - - - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel - - Label - - Address Дарек @@ -147,221 +23,13 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - - - Enter passphrase - - - - New passphrase - - - - Repeat new passphrase - - - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - - - - Encrypt wallet - - - - This operation needs your wallet passphrase to unlock the wallet. - - - - Unlock wallet - - - - This operation needs your wallet passphrase to decrypt the wallet. - - - - Decrypt wallet - - - - Change passphrase - - - - Enter the old and new passphrase to the wallet. - - - - Confirm wallet encryption - - - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - - - Wallet encrypted - - - - Bitcoin 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. - - - - Wallet encryption failed - - - - Wallet encryption failed due to an internal error. Your wallet was not encrypted. - - - - The supplied passphrases do not match. - - - - Wallet unlock failed - - - - The passphrase entered for the wallet decryption was incorrect. - - - - Wallet decryption failed - - - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - - - Synchronizing with network... - - - - &Overview - - - - Node - - - - Show general overview of wallet - - &Transactions &Транзакциялар - - Browse transaction history - - - - E&xit - - - - Quit application - - - - Show information about Bitcoin - - - - About &Qt - - - - Show information about Qt - - - - &Options... - - - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - - - Change the passphrase used for wallet encryption - - - - &Debug window - - - - Open debugging and diagnostic console - - &Verify message... Билдирүүнү &текшерүү... @@ -374,138 +42,14 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet Капчык - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - &File &Файл - - &Settings - - &Help &Жардам - - Tabs toolbar - - - - [testnet] - - - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - - - %n active connection(s) to Bitcoin network - - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - Error Ката @@ -522,100 +66,12 @@ This product includes software developed by the OpenSSL Project for use in the O Up to date Жаңыланган - - Catching up... - - - - Sent transaction - - - - Incoming transaction - - - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> - - - - Wallet is <b>encrypted</b> and currently <b>locked</b> - - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - - + ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - - - Amount - - Address Дарек @@ -624,548 +80,60 @@ Address: %4 Date Дата - - Confirmations - - - - Confirmed - - - - Priority - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - none жок - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (аты жок) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog - - Edit Address - - - - &Label - - - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Дарек - - New receiving address - - - - New sending address - - - - Edit receiving address - - - - Edit sending address - - - - The entered address "%1" is already in the address book. - - - - The entered address "%1" is not a valid Bitcoin address. - - - - Could not unlock wallet. - - - - New key generation failed. - - - + FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - version версия - - Usage: - - - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - - Error Ката - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog - - Options - - - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - MB МБ - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - &Network &Тармак - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - &Port: &Порт: - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - &Window &Терезе - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - &OK &Жарайт @@ -1182,77 +150,13 @@ Address: %4 none жок - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage - - Form - - - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - Wallet Капчык - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - - - <b>Recent transactions</b> - - out of sync синхрондоштурулган эмес @@ -1260,183 +164,30 @@ Address: %4 PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - &Information - - - - Debug window - + Маалымат General Жалпы - - Using OpenSSL version - - - - Startup time - - - - Network - - Name Аты - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - &Open &Ачуу @@ -1445,1924 +196,151 @@ Address: %4 &Console &Консоль - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - Clear console Консолду тазалоо - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - - - &Label: - - - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - - - Copy label - - - - Copy message - - - - Copy amount - - - + ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address Дарек - - Amount - - - - Label - - Message Билдирүү - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel Date Дата - - Label - - Message Билдирүү - - Amount - - (no label) (аты жок) - - (no message) - - - - (no amount) - - - + SendCoinsDialog - - Send Coins - - - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - - - Send to multiple recipients at once - - - - Add &Recipient - - - - Clear all fields of the form. - - Clear &All &Бардыгын тазалоо - - Balance: - - - - Confirm the send action - - S&end &Жөнөтүү - - Confirm send coins - - - - %1 to %2 - - - - Copy quantity - - - - Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - - - The amount to pay must be larger than 0. - - - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (аты жок) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry - - A&mount: - - - - Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Enter a label for this address to add it to your address book - - - - &Label: - - - - Choose previously used address - - - - This is a normal payment. - - - - Alt+A - - Paste address from clipboard Даректи алмашуу буферинен коюу - - Alt+P - - - - Remove this entry - - Message: Билдирүү: - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - - - Alt+A - - Paste address from clipboard Даректи алмашуу буферинен коюу - - Alt+P - - - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - Clear &All &Бардыгын тазалоо - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - - - [testnet] - - - + TrafficGraphWidget - - KB/s - - - + TransactionDesc - - Open until %1 - - - - conflicted - - %1/offline %1/тармакта эмес - - %1/unconfirmed - - - - %1 confirmations - - - - Status - - - - , broadcast through %n node(s) - - Date Дата - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - Message Билдирүү - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - - - Amount - - - - true - - - - false - - - - , has not been successfully broadcast yet - - - - Open for %n more block(s) - - - - unknown - - - + TransactionDescDialog - - Transaction details - - - - This pane shows a detailed description of the transaction - - - + TransactionTableModel Date Дата - - Type - - Address Дарек - - Amount - - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - - - Open until %1 - - - - Confirmed (%1 confirmations) - - - - This block was not received by any other nodes and will probably not be accepted! - - - - Generated but not accepted - - - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - - - Received with - - - - Received from - - - - Sent to - - - - Payment to yourself - - - - Mined - - - - (n/a) - - - - Transaction status. Hover over this field to show number of confirmations. - - - - Date and time that the transaction was received. - - - - Type of transaction. - - - - Destination address of transaction. - - - - Amount removed from or added to balance. - - - + TransactionView - - All - - - - Today - - - - This week - - - - This month - - - - Last month - - - - This year - - - - Range... - - - - Received with - - - - Sent to - - - - To yourself - - - - Mined - - - - Other - - - - Enter address or label to search - - - - Min amount - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - - - Comma separated file (*.csv) - - - - Confirmed - - Date Дата - - Type - - - - Label - - Address Дарек - - Amount - - - - ID - - - - Range: - - - - to - - - + + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel - - Send Coins - - - + WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - - - Options: - - - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information Маалымат - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - Warning Эскертүү - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - версия - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - - - Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - - - Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - - - Done loading - - - - To use the %s option - - Error Ката - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_la.ts b/src/qt/locale/bitcoin_la.ts index 425519514a..450228b221 100644 --- a/src/qt/locale/bitcoin_la.ts +++ b/src/qt/locale/bitcoin_la.ts @@ -1,40 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - Hoc est experimentale programma. - -Distributum sub MIT/X11 licentia programmatum, vide comitantem plicam COPYING vel http://www.opensource.org/licenses/mit-license.php. - -Hoc productum continet programmata composita ab OpenSSL Project pro utendo in OpenSSL Toolkit (http://www.openssl.org/) et programmata cifrarum scripta ab Eric Young (eay@cryptsoft.com) et UPnP programmata scripta ab Thomas Bernard. - - - Copyright - Copyright - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -45,22 +9,10 @@ Hoc productum continet programmata composita ab OpenSSL Project pro utendo in Op Create a new address Crea novam inscriptionem - - &New - - Copy the currently selected address to the system clipboard Copia inscriptionem iam selectam in latibulum systematis - - &Copy - - - - C&lose - - &Copy Address &Copia Inscriptionem @@ -81,34 +33,10 @@ Hoc productum continet programmata composita ab OpenSSL Project pro utendo in Op &Delete &Dele - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. Hae sunt inscriptiones mittendi pensitationes. Semper inspice quantitatem et inscriptionem accipiendi antequam nummos mittis. - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - Copy &Label Copia &Titulum @@ -117,23 +45,11 @@ Hoc productum continet programmata composita ab OpenSSL Project pro utendo in Op &Edit &Muta - - Export Address List - - Comma separated file (*.csv) Comma Separata Plica (*.csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -167,10 +83,6 @@ Hoc productum continet programmata composita ab OpenSSL Project pro utendo in Op Repeat new passphrase Itera novam tesseram - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Insero novam tesseram cassidili.<br/>Sodes tessera <b>10 pluriumve fortuitarum litterarum</b> utere aut <b>octo pluriumve verborum</b>. - Encrypt wallet Cifra cassidile @@ -270,10 +182,6 @@ Hoc productum continet programmata composita ab OpenSSL Project pro utendo in Op &Overview &Summarium - - Node - - Show general overview of wallet Monstra generale summarium cassidilis @@ -294,10 +202,6 @@ Hoc productum continet programmata composita ab OpenSSL Project pro utendo in Op Quit application Exi applicatione - - Show information about Bitcoin - Monstra informationem de Bitcoin - About &Qt Informatio de &Qt @@ -322,18 +226,6 @@ Hoc productum continet programmata composita ab OpenSSL Project pro utendo in Op &Change Passphrase... &Muta tesseram... - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - Importing blocks from disk... Importans frusta ab disco... @@ -420,7 +312,7 @@ Hoc productum continet programmata composita ab OpenSSL Project pro utendo in Op Tabs toolbar - Tabella instrumentorum "Tabs" + Tabella instrumentorum "Tabs" [testnet] @@ -430,38 +322,6 @@ Hoc productum continet programmata composita ab OpenSSL Project pro utendo in Op Bitcoin Core Bitcoin Nucleus - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Bitcoin cliens - %n active connection(s) to Bitcoin network %n activa conexio ad rete Bitcoin%n activae conexiones ad rete Bitcoin @@ -470,10 +330,6 @@ Hoc productum continet programmata composita ab OpenSSL Project pro utendo in Op No block source available... Nulla fons frustorum absens... - - Processed %1 of %2 (estimated) blocks of transaction history. - Perfecta %1 de %2 (aestimato) frusta historiae transactionum. - Processed %1 blocks of transaction history. Processae %1 frusta historiae transactionum. @@ -490,14 +346,6 @@ Hoc productum continet programmata composita ab OpenSSL Project pro utendo in Op %n week(s) %n hebdomas%n hebdomades - - %1 and %2 - - - - %n year(s) - - %1 behind %1 post @@ -558,10 +406,6 @@ Inscriptio: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Cassidile <b>cifratum</b> est et iam nunc <b>seratum</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Error fatalis accidit. Bitcoin nondum pergere tute potest, et exibit. - ClientModel @@ -572,54 +416,10 @@ Inscriptio: %4 CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - Amount: Quantitas: - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount Quantitas @@ -632,18 +432,10 @@ Inscriptio: %4 Date Dies - - Confirmations - - Confirmed Confirmatum - - Priority - - Copy address Copia inscriptionem @@ -660,147 +452,11 @@ Inscriptio: %4 Copy transaction ID Copia transactionis ID - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (nullus titulus) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -811,14 +467,6 @@ Inscriptio: %4 &Label &Titulus - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Inscriptio @@ -840,12 +488,12 @@ Inscriptio: %4 Muta inscriptionem mittendi - The entered address "%1" is already in the address book. - Inserta inscriptio "%1" iam in libro inscriptionum est. + The entered address "%1" is already in the address book. + Inserta inscriptio "%1" iam in libro inscriptionum est. - The entered address "%1" is not a valid Bitcoin address. - Inscriptio inserta "%1" non valida inscriptio Bitcoin est. + The entered address "%1" is not a valid Bitcoin address. + Inscriptio inserta "%1" non valida inscriptio Bitcoin est. Could not unlock wallet. @@ -858,33 +506,9 @@ Inscriptio: %4 FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core Bitcoin Nucleus @@ -893,6 +517,10 @@ Inscriptio: %4 version versio + + Command-line options + Optiones mandati initiantis + Usage: Usus: @@ -906,96 +534,32 @@ Inscriptio: %4 UI optiones - Set language, for example "de_DE" (default: system locale) - Constitue linguam, exempli gratia "de_DE" (praedefinitum: lingua systematis) + Set language, for example "de_DE" (default: system locale) + Constitue linguam, exempli gratia "de_DE" (praedefinitum: lingua systematis) Start minimized Incipe minifactum ut icon - - Set SSL root certificates for payment request (default: -system-) - - Show splash screen on startup (default: 1) Monstra principem imaginem ad initium (praedefinitum: 1) - - Choose data directory on startup (default: 0) - - - + Intro - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - + Bitcoin Core + Bitcoin Nucleus Error - + Error - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog @@ -1022,42 +586,6 @@ Inscriptio: %4 &Start Bitcoin on system login &Pelle Bitcoin cum inire systema - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - Reset all client options to default. Reconstitue omnes optiones clientis ad praedefinita. @@ -1070,30 +598,6 @@ Inscriptio: %4 &Network &Rete - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Aperi per se portam clientis Bitcoin in itineratore. Hoc tantum effectivum est si itineratrum tuum supportat UPnP et id activum est. @@ -1114,14 +618,6 @@ Inscriptio: %4 Port of the proxy (e.g. 9050) Porta vicarii (e.g. 9050) - - SOCKS &Version: - SOCKS &Versio: - - - SOCKS version of the proxy (e.g. 5) - SOCKS versio vicarii (e.g. 5) - &Window &Fenestra @@ -1162,18 +658,6 @@ Inscriptio: %4 Choose the default subdivision unit to show in the interface and when sending coins. Selige praedefinitam unitam subdivisionis monstrare in interfacie et quando nummos mittere - - Whether to show Bitcoin addresses in the transaction list or not. - Num monstrare inscriptiones Bitcoin in enumeratione transactionum. - - - &Display addresses in transaction list - &Monstra inscriptiones in enumeratione transactionum - - - Whether to show coin control features or not. - - &OK &OK @@ -1186,26 +670,10 @@ Inscriptio: %4 default praedefinitum - - none - - Confirm options reset Confirma optionum reconstituere - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - The supplied proxy address is invalid. Inscriptio vicarii tradita non valida est. @@ -1225,22 +693,6 @@ Inscriptio: %4 Wallet Cassidile - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - Immature: Immatura: @@ -1249,14 +701,6 @@ Inscriptio: %4 Mined balance that has not yet matured Fossum pendendum quod nondum maturum est - - Total: - - - - Your current total balance - - <b>Recent transactions</b> <b>Recentes transactiones</b> @@ -1272,117 +716,32 @@ Inscriptio: %4 URI handling Tractatio URI - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI intellegi non posse! Huius causa possit inscriptionem Bitcoin non validam aut URI parametra maleformata. - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - Cannot start bitcoin: click-to-pay handler Bitcoin incipere non potest: cliccare-ad-pensandum handler - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Quantitas - Error: Specified data directory "%1" does not exist. - + N/A + N/A - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Insere inscriptionem Bitcoin (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - Save QR Code Salva codicem QR - - PNG Image (*.png) - - - + RPCConsole @@ -1401,14 +760,6 @@ Inscriptio: %4 &Information &Informatio - - Debug window - - - - General - - Using OpenSSL version Utens OpenSSL versione @@ -1421,10 +772,6 @@ Inscriptio: %4 Network Rete - - Name - - Number of connections Numerus conexionum @@ -1437,10 +784,6 @@ Inscriptio: %4 Current number of blocks Numerus frustorum iam nunc - - Estimated total blocks - Aestimatus totalis numerus frustorum - Last block time Hora postremi frusti @@ -1453,26 +796,6 @@ Inscriptio: %4 &Console &Terminale - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - Build date Dies aedificandi @@ -1501,113 +824,17 @@ Inscriptio: %4 Type <b>help</b> for an overview of available commands. Scribe <b>help</b> pro summario possibilium mandatorum. - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - &Label: &Titulus: - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - Copy label Copia titulum - - Copy message - - Copy amount Copia quantitatem @@ -1615,34 +842,6 @@ Inscriptio: %4 ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address Inscriptio @@ -1690,77 +889,17 @@ Inscriptio: %4 (no label) (nullus titulus) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins Mitte Nummos - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - Amount: Quantitas: - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Mitte pluribus accipientibus simul @@ -1769,10 +908,6 @@ Inscriptio: %4 Add &Recipient Adde &Accipientem - - Clear all fields of the form. - - Clear &All Vacuefac &Omnia @@ -1793,50 +928,10 @@ Inscriptio: %4 Confirm send coins Confirma mittendum nummorum - - %1 to %2 - - - - Copy quantity - - Copy amount Copia quantitatem - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - The recipient address is not valid, please recheck. Inscriptio accipientis non est valida, sodes reproba. @@ -1857,43 +952,11 @@ Inscriptio: %4 Duplicate address found, can only send to each address once per send operation. Geminata inscriptio inventa, tantum posse mittere ad quamque inscriptionem semel singulare operatione. - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (nullus titulus) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry @@ -1904,10 +967,6 @@ Inscriptio: %4 Pay &To: Pensa &Ad: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Inscriptio cui mittere pensitationem (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Insero titulum huic inscriptioni ut eam in tuum librum inscriptionum addas. @@ -1916,14 +975,6 @@ Inscriptio: %4 &Label: &Titulus: - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt+A @@ -1936,50 +987,14 @@ Inscriptio: %4 Alt+P Alt+P - - Remove this entry - - Message: Nuntius: - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog @@ -1994,14 +1009,6 @@ Inscriptio: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Potes nuntios signare inscriptionibus tuis ut demonstres te eas possidere. Cautus es non amibiguum signare, quia impetus phiscatorum conentur te fallere ut signes identitatem tuam ad eos. Solas signa sententias cuncte descriptas quibus convenis. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Inscriptio qua signare nuntium (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Choose previously used address - - Alt+A Alt+A @@ -2050,10 +1057,6 @@ Inscriptio: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Insere inscriptionem signantem, nuntium (cura ut copias intermissiones linearum, spatia, tabs, et cetera exacte) et signationem infra ut nuntium verifices. Cautus esto ne magis legas in signationem quam in nuntio signato ipso est, ut vites falli ab impetu homo-in-medio. - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Inscriptio qua nuntius signatus est (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address Verifica nuntium ut cures signatum esse cum specifica inscriptione Bitcoin @@ -2067,12 +1070,8 @@ Inscriptio: %4 Reconstitue omnes campos verificandi nuntii - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Insere inscriptionem Bitcoin (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Clicca "Signa Nuntium" ut signatio generetur + Click "Sign Message" to generate signature + Clicca "Signa Nuntium" ut signatio generetur The entered address is invalid. @@ -2129,10 +1128,6 @@ Inscriptio: %4 Bitcoin Core Bitcoin Nucleus - - The Bitcoin Core developers - - [testnet] [testnet] @@ -2140,21 +1135,13 @@ Inscriptio: %4 TrafficGraphWidget - - KB/s - - - + TransactionDesc Open until %1 Apertum donec %1 - - conflicted - - %1/offline %1/non conecto @@ -2239,14 +1226,6 @@ Inscriptio: %4 Transaction ID ID transactionis - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - Debug information Informatio de debug @@ -2275,10 +1254,6 @@ Inscriptio: %4 , has not been successfully broadcast yet , nondum prospere disseminatum est - - Open for %n more block(s) - Aperi pro %n pluribus frustis - unknown ignotum @@ -2309,14 +1284,6 @@ Inscriptio: %4 Address Inscriptio - - Amount - Quantitas - - - Immature (%1 confirmations, will be available after %2) - - Open for %n more block(s) Aperi pro %n plure frustoAperi pro %n pluribus frustis @@ -2337,22 +1304,6 @@ Inscriptio: %4 Generated but not accepted Generatum sed non acceptum - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with Acceptum cum @@ -2480,26 +1431,6 @@ Inscriptio: %4 Show transaction details Monstra particularia transactionis - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Comma Separata Plica (*.csv) @@ -2524,10 +1455,6 @@ Inscriptio: %4 Address Inscriptio - - Amount - Quantitas - ID ID @@ -2541,13 +1468,12 @@ Inscriptio: %4 ad + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2577,14 +1503,6 @@ Inscriptio: %4 Backup Failed Conservare abortum est. - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - Backup Successful Successum in conservando @@ -2592,18 +1510,6 @@ Inscriptio: %4 bitcoin-core - - Usage: - Usus: - - - List commands - Enumera mandata - - - Get help for a command - Accipe auxilium pro mandato - Options: Optiones: @@ -2644,10 +1550,6 @@ Inscriptio: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Numerum secundorum prohibere ne paria improba reconectant (praedefinitum: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Error erat dum initians portam RPC %u pro auscultando in IPv4: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Ausculta pro conexionibus JSON-RPC in <porta> (praedefinitum: 8332 vel testnet: 18332) @@ -2656,10 +1558,6 @@ Inscriptio: %4 Accept command line and JSON-RPC commands Accipe terminalis et JSON-RPC mandata. - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Operare infere sicut daemon et mandata accipe @@ -2682,7 +1580,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, necesse est te rpcpassword constituere in plica configurationis: %s @@ -2693,37 +1591,13 @@ rpcpassword=%s Nomen usoris et tessera eadem esse NON POSSUNT. Si plica non existit, eam crea cum permissionibus ut eius dominus tantum sinitur id legere. Quoque hortatur alertnotify constituere ut tu notificetur de problematibus; -exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" admin@foo.com +exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Error erat dum initians portam RPC %u pro auscultando in IPv6, labens retrorsum ad IPv4: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Conglutina ad inscriptionem datam et semper in eam ausculta. Utere [moderatrum]:porta notationem pro IPv6 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Error: Transactio eiecta est! Hoc possit accidere si alii nummorum in cassidili tuo iam soluti sint, ut si usus es exemplar de wallet.dat et nummi soluti sunt in exemplari sed non hic notati ut soluti. @@ -2736,58 +1610,14 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" a Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Facere mandatum quotiescumque cassidilis transactio mutet (%s in mandato sbstituitur ab TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Hoc est prae-dimittum experimentala aedes - utere eo periculo tuo proprio - nolite utere fodendo vel applicationibus mercatoriis - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Monitio: -paytxfee constitutum valde magnum! Hoc est merces transactionis solves si mittis transactionem. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Monitio: Sodes cura ut dies tempusque computatri tui recti sunt! Si horologium tuum pravum est, Bitcoin non proprie fungetur. - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. Monitio: error legendo wallet.dat! Omnes claves recte lectae, sed data transactionum vel libri inscriptionum fortasse desint vel prava sint. @@ -2796,70 +1626,26 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" a Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. Monitio: wallet.data corrupta, data salvata! Originalis wallet.dat salvata ut wallet.{timestamp}.bak in %s; si pendendum tuum vel transactiones pravae sunt, oportet ab conservato restituere. - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - Attempt to recover private keys from a corrupt wallet.dat Conare recipere claves privatas de corrupto wallet.dat - - Bitcoin Core Daemon - - Block creation options: Optiones creandi frustorum: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) Conecte sole ad nodos specificatos (vel nodum specificatum) - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - Corrupted block database detected Corruptum databasum frustorum invenitur - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - Discover own IP address (default: 1 when listening and no -externalip) Discooperi propriam inscriptionem IP (praedefinitum: 1 quando auscultans et nullum -externalip) - - Do not load the wallet and disable wallet RPC calls - - Do you want to rebuild the block database now? Visne reficere databasum frustorum iam? @@ -2936,22 +1722,6 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" a Failed to write undo data Scribere data pro cancellando mutationes abortum est - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - Inveni paria utendo DNS quaerendo (praedefinitum: 1 nisi -connect) - - - Force safe mode (default: 0) - - Generate coins (default: 0) Genera nummos (praedefinitum: 0) @@ -2960,70 +1730,18 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" a How many blocks to check at startup (default: 288, 0 = all) Quot frusta proba ad initium (praedefinitum: 288, 0 = omnia) - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - Not enough file descriptors available. Inopia descriptorum plicarum. - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - Rebuild block chain index from current blk000??.dat files Restituere indicem catenae frustorum ex activis plicis blk000??.dat - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - Set the number of threads to service RPC calls (default: 4) Constitue numerum filorum ad tractandum RPC postulationes (praedefinitum: 4) - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - Verifying blocks... Verificante frusta... @@ -3032,65 +1750,21 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" a Verifying wallet... Verificante cassidilem... - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - Imports blocks from external blk000??.dat file Importat frusta ab externa plica blk000??.dat - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information Informatio - Invalid amount for -minrelaytxfee=<amount>: '%s' - Quantitas non valida pro -minrelaytxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Quantitas non valida pro -minrelaytxfee=<amount>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - Quantitas non valida pro -mintxfee=<amount>: '%s' - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - + Invalid amount for -mintxfee=<amount>: '%s' + Quantitas non valida pro -mintxfee=<amount>: '%s' Maintain a full transaction index (default: 0) @@ -3112,42 +1786,6 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" a Only connect to nodes in network <net> (IPv4, IPv6 or Tor) Tantum conecte ad nodos in rete <net> (IPv4, IPv6 aut Tor) - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - Optiones SSL: (vide vici de Bitcoin pro instructionibus SSL configurationis) - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file Mitte informationem vestigii/debug ad terminale potius quam plicam debug.log @@ -3156,18 +1794,6 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" a Set minimum block size in bytes (default: 0) Constitue minimam magnitudinem frusti in octetis/bytes (praedefinitum: 0) - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - Shrink debug.log file on client startup (default: 1 when no -debug) Diminue plicam debug.log ad initium clientis (praedefinitum: 1 nisi -debug) @@ -3180,10 +1806,6 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" a Specify connection timeout in milliseconds (default: 5000) Specifica tempumfati conexionis in millisecundis (praedefinitum: 5000) - - Start Bitcoin Core Daemon - - System error: Systematis error: @@ -3220,18 +1842,6 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" a Warning: This version is obsolete, upgrade required! Monitio: Haec versio obsoleta est, progressio postulata! - - Zapping all transactions from wallet... - - - - on startup - - - - version - versio - wallet.dat corrupt, salvage failed wallet.dat corrupta, salvare abortum est @@ -3240,14 +1850,6 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" a Password for JSON-RPC connections Tessera pro conexionibus JSON-RPC - - Allow JSON-RPC connections from specified IP address - Permitte conexionibus JSON-RPC ex inscriptione specificata - - - Send commands to node running on <ip> (default: 127.0.0.1) - Mitte mandata nodo operanti in <ip> (praedefinitum: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Pelle mandatum quando optissimum frustum mutat (%s in mandato substituitur ab hash frusti) @@ -3280,10 +1882,6 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" a This help message Hic nuntius auxilii - - Unable to bind to %s on this computer (bind returned error %d, %s) - Non posse conglutinare ad %s in hoc computatro (conglutinare redidit errorem %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Permitte quaerenda DNS pro -addnode, -seednode, et -connect @@ -3296,41 +1894,29 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" a Error loading wallet.dat: Wallet corrupted Error legendi wallet.dat: Cassidile corruptum - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Error legendi wallet.dat: Cassidili necesse est recentior versio Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - Cassidili necesse erat rescribi: Repelle Bitcoin ut compleas - Error loading wallet.dat Error legendi wallet.dat - Invalid -proxy address: '%s' - Inscriptio -proxy non valida: '%s' + Invalid -proxy address: '%s' + Inscriptio -proxy non valida: '%s' - Unknown network specified in -onlynet: '%s' - Ignotum rete specificatum in -onlynet: '%s' + Unknown network specified in -onlynet: '%s' + Ignotum rete specificatum in -onlynet: '%s' - Unknown -socks proxy version requested: %i - Ignota -socks vicarii versio postulata: %i + Cannot resolve -bind address: '%s' + Non posse resolvere -bind inscriptonem: '%s' - Cannot resolve -bind address: '%s' - Non posse resolvere -bind inscriptonem: '%s' + Cannot resolve -externalip address: '%s' + Non posse resolvere -externalip inscriptionem: '%s' - Cannot resolve -externalip address: '%s' - Non posse resolvere -externalip inscriptionem: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Quantitas non valida pro -paytxfee=<quantitas>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Quantitas non valida pro -paytxfee=<quantitas>: '%s' Invalid amount @@ -3376,13 +1962,5 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" a Error Error - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Necesse est te rpcpassword=<tesseram> constituere in plica configurationum: -%s -Si plica non existat, crea eam cum permissionibus ut solus eius dominus eam legere sinatur. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_lt.ts b/src/qt/locale/bitcoin_lt.ts index c74fd8ab3b..6d0fb684da 100644 --- a/src/qt/locale/bitcoin_lt.ts +++ b/src/qt/locale/bitcoin_lt.ts @@ -1,40 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - Tai eksperimentinė programa. - -Platinama pagal MIT/X11 licenciją, kurią rasite faile COPYING arba http://www.opensource.org/licenses/mit-license.php. - -Šiame produkte yra OpenSSL projekto kuriamas OpenSSL Toolkit (http://www.openssl.org/), Eric Young parašyta kriptografinė programinė įranga bei Thomas Bernard sukurta UPnP programinė įranga. - - - Copyright - Copyright - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -65,14 +29,6 @@ Platinama pagal MIT/X11 licenciją, kurią rasite faile COPYING arba http://www. &Copy Address &Kopijuoti adresą - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - &Export &Eksportuoti @@ -81,34 +37,6 @@ Platinama pagal MIT/X11 licenciją, kurią rasite faile COPYING arba http://www. &Delete &Trinti - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - Copy &Label Kopijuoti ž&ymę @@ -117,23 +45,11 @@ Platinama pagal MIT/X11 licenciją, kurią rasite faile COPYING arba http://www. &Edit &Keisti - - Export Address List - - Comma separated file (*.csv) Kableliais išskirtas failas (*.csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -167,10 +83,6 @@ Platinama pagal MIT/X11 licenciją, kurią rasite faile COPYING arba http://www. Repeat new passphrase Pakartokite naują slaptafrazę - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Įveskite naują piniginės slaptafrazę.<br/>Prašome naudoti slaptafrazę iš <b> 10 ar daugiau atsitiktinių simbolių</b> arba <b>aštuonių ar daugiau žodžių</b>. - Encrypt wallet Užšifruoti piniginę @@ -211,10 +123,6 @@ Platinama pagal MIT/X11 licenciją, kurią rasite faile COPYING arba http://www. Are you sure you wish to encrypt your wallet? Ar tikrai norite šifruoti savo piniginę? - - 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. - - Warning: The Caps Lock key is on! Įspėjimas: įjungtas Caps Lock klavišas! @@ -270,10 +178,6 @@ Platinama pagal MIT/X11 licenciją, kurią rasite faile COPYING arba http://www. &Overview &Apžvalga - - Node - - Show general overview of wallet Rodyti piniginės bendrą apžvalgą @@ -294,10 +198,6 @@ Platinama pagal MIT/X11 licenciją, kurią rasite faile COPYING arba http://www. Quit application Išjungti programą - - Show information about Bitcoin - Rodyti informaciją apie Bitcoin - About &Qt Apie &Qt @@ -322,18 +222,6 @@ Platinama pagal MIT/X11 licenciją, kurią rasite faile COPYING arba http://www. &Change Passphrase... &Keisti slaptafrazę... - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - Importing blocks from disk... Blokai importuojami iš disko... @@ -394,18 +282,6 @@ Platinama pagal MIT/X11 licenciją, kurią rasite faile COPYING arba http://www. Show or hide the main Window Rodyti arba slėpti pagrindinį langą - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - &File &Failas @@ -430,54 +306,10 @@ Platinama pagal MIT/X11 licenciją, kurią rasite faile COPYING arba http://www. Bitcoin Core Bitcoin branduolys - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Bitcoin klientas - %n active connection(s) to Bitcoin network %n Bitcoin tinklo aktyvus ryšys%n Bitcoin tinklo aktyvūs ryšiai%n Bitcoin tinklo aktyvūs ryšiai - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - %n hour(s) %n valanda%n valandos%n valandų @@ -490,33 +322,13 @@ Platinama pagal MIT/X11 licenciją, kurią rasite faile COPYING arba http://www. %n week(s) %n savaitė%n savaitės%n savaičių - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - Error Klaida Warning - + Įspėjimas Information @@ -557,10 +369,6 @@ Adresas: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Piniginė <b>užšifruota</b> ir šiuo metu <b>užrakinta</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - ClientModel @@ -571,54 +379,10 @@ Adresas: %4 CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - Amount: Suma: - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount Suma @@ -631,18 +395,10 @@ Adresas: %4 Date Data - - Confirmations - - Confirmed Patvirtintas - - Priority - - Copy address Kopijuoti adresą @@ -655,151 +411,11 @@ Adresas: %4 Copy amount Kopijuoti sumą - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (nėra žymės) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -810,14 +426,6 @@ Adresas: %4 &Label Ž&ymė - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Adresas @@ -839,11 +447,11 @@ Adresas: %4 Keisti siuntimo adresą - The entered address "%1" is already in the address book. + The entered address "%1" is already in the address book. Įvestas adresas „%1“ jau yra adresų knygelėje. - The entered address "%1" is not a valid Bitcoin address. + The entered address "%1" is not a valid Bitcoin address. Įvestas adresas „%1“ nėra galiojantis Bitcoin adresas. @@ -857,33 +465,9 @@ Adresas: %4 FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core Bitcoin branduolys @@ -892,6 +476,10 @@ Adresas: %4 version versija + + Command-line options + Komandinės eilutės parametrai + Usage: Naudojimas: @@ -905,26 +493,14 @@ Adresas: %4 Naudotoji sąsajos parametrai - Set language, for example "de_DE" (default: system locale) - Nustatyti kalbą, pavyzdžiui "lt_LT" (numatyta: sistemos kalba) + Set language, for example "de_DE" (default: system locale) + Nustatyti kalbą, pavyzdžiui "lt_LT" (numatyta: sistemos kalba) Start minimized Paleisti sumažintą - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro @@ -932,69 +508,17 @@ Adresas: %4 Sveiki - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - + Bitcoin Core + Bitcoin branduolys Error Klaida - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog @@ -1005,10 +529,6 @@ Adresas: %4 &Main &Pagrindinės - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - Pay transaction &fee &Mokėti sandorio mokestį @@ -1021,78 +541,10 @@ Adresas: %4 &Start Bitcoin on system login &Paleisti Bitcoin programą su window sistemos paleidimu - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - &Network &Tinklas - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Automatiškai atidaryti Bitcoin kliento prievadą maršrutizatoriuje. Tai veikia tik tada, kai jūsų maršrutizatorius palaiko UPnP ir ji įjungta. @@ -1113,14 +565,6 @@ Adresas: %4 Port of the proxy (e.g. 9050) Tarpinio serverio preivadas (pvz, 9050) - - SOCKS &Version: - SOCKS &versija: - - - SOCKS version of the proxy (e.g. 5) - Tarpinio serverio SOCKS versija (pvz., 5) - &Window &Langas @@ -1161,18 +605,6 @@ Adresas: %4 Choose the default subdivision unit to show in the interface and when sending coins. Rodomų ir siunčiamų monetų kiekio matavimo vienetai - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - &Rodyti adresus sandorių sąraše - - - Whether to show coin control features or not. - - &OK &Gerai @@ -1185,26 +617,6 @@ Adresas: %4 default numatyta - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - The supplied proxy address is invalid. Nurodytas tarpinio serverio adresas negalioja. @@ -1216,38 +628,14 @@ Adresas: %4 Form Forma - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - Wallet Piniginė - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - Immature: Nepribrendę: - - Mined balance that has not yet matured - - Total: Viso: @@ -1271,117 +659,40 @@ Adresas: %4 URI handling URI apdorojimas - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - Network request error Tinklo užklausos klaida + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Suma - Error: Specified data directory "%1" does not exist. - + %1 h + %1 h - Error: Cannot parse configuration file: %1. Only use key=value syntax. - + %1 m + %1 m - Error: Invalid combination of -regtest and -testnet. - + N/A + nėra - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Įveskite bitkoinų adresą (pvz. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - Save QR Code Įrašyti QR kodą - - PNG Image (*.png) - - - + RPCConsole @@ -1400,14 +711,6 @@ Adresas: %4 &Information &Informacija - - Debug window - - - - General - - Using OpenSSL version Naudojama OpenSSL versija @@ -1420,10 +723,6 @@ Adresas: %4 Network Tinklas - - Name - - Number of connections Prisijungimų kiekis @@ -1436,10 +735,6 @@ Adresas: %4 Current number of blocks Dabartinis blokų skaičius - - Estimated total blocks - - Last block time Paskutinio bloko laikas @@ -1452,25 +747,9 @@ Adresas: %4 &Console &Konsolė - - &Network Traffic - - - - &Clear - - Totals - - - - In: - - - - Out: - + Viso: Build date @@ -1480,10 +759,6 @@ Adresas: %4 Debug log file Derinimo žurnalo failas - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - Clear console Išvalyti konsolę @@ -1492,14 +767,6 @@ Adresas: %4 Welcome to the Bitcoin RPC console. Sveiki atvykę į Bitcoin RPC konsolę. - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - %1 B %1 B @@ -1516,97 +783,17 @@ Adresas: %4 %1 GB %1 GB - - %1 m - %1 m - - - %1 h - %1 h - - - %1 h %2 m - %1 h %2 m - - + ReceiveCoinsDialog - - &Amount: - - &Label: Ž&ymė: - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - Copy label Kopijuoti žymę - - Copy message - - Copy amount Kopijuoti sumą @@ -1618,30 +805,10 @@ Adresas: %4 QR Code QR kodas - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - Payment information Mokėjimo informacija - - URI - - Address Adresas @@ -1658,10 +825,6 @@ Adresas: %4 Message Žinutė - - Resulting URI too long, try to reduce the text for label / message. - - Error encoding URI into QR Code. Klaida, koduojant URI į QR kodą. @@ -1689,77 +852,17 @@ Adresas: %4 (no label) (nėra žymės) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins Siųsti monetas - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - Amount: Suma: - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Siųsti keliems gavėjams vienu metu @@ -1768,10 +871,6 @@ Adresas: %4 Add &Recipient &A Pridėti gavėją - - Clear all fields of the form. - - Clear &All Išvalyti &viską @@ -1792,50 +891,10 @@ Adresas: %4 Confirm send coins Patvirtinti monetų siuntimą - - %1 to %2 - - - - Copy quantity - - Copy amount Kopijuoti sumą - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - The recipient address is not valid, please recheck. Negaliojantis gavėjo adresas. Patikrinkite. @@ -1856,43 +915,11 @@ Adresas: %4 Duplicate address found, can only send to each address once per send operation. Rastas adreso dublikatas. - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (nėra žymės) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry @@ -1903,10 +930,6 @@ Adresas: %4 Pay &To: Mokėti &gavėjui: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - Enter a label for this address to add it to your address book Įveskite žymę šiam adresui kad galėtumėte įtraukti ją į adresų knygelę @@ -1915,14 +938,6 @@ Adresas: %4 &Label: Ž&ymė: - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt+A @@ -1935,72 +950,20 @@ Adresas: %4 Alt+P Alt+P - - Remove this entry - - Message: Žinutė: - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - &Sign Message &Pasirašyti žinutę - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Įveskite bitkoinų adresą (pvz. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Choose previously used address - - Alt+A Alt+A @@ -2017,25 +980,13 @@ Adresas: %4 Enter the message you want to sign here Įveskite pranešimą, kurį norite pasirašyti čia - - Signature - - - - Copy the current signature to the system clipboard - - Sign the message to prove you own this Bitcoin address Registruotis žinute įrodymuii, kad turite šį adresą Sign &Message - - - - Reset all sign message fields - + Registruoti praneši&mą Clear &All @@ -2045,33 +996,13 @@ Adresas: %4 &Verify Message &Patikrinti žinutę - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Įveskite bitkoinų adresą (pvz. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address Patikrinkite žinutę, jog įsitikintumėte, kad ją pasirašė nurodytas Bitcoin adresas - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Įveskite bitkoinų adresą (pvz. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Spragtelėkite "Registruotis žinutę" tam, kad gauti parašą + Click "Sign Message" to generate signature + Spragtelėkite "Registruotis žinutę" tam, kad gauti parašą The entered address is invalid. @@ -2081,18 +1012,10 @@ Adresas: %4 Please check the address and try again. Prašom patikrinti adresą ir bandyti iš naujo. - - The entered address does not refer to a key. - - Wallet unlock was cancelled. Piniginės atrakinimas atšauktas. - - Private key for the entered address is not available. - - Message signing failed. Žinutės pasirašymas nepavyko. @@ -2128,10 +1051,6 @@ Adresas: %4 Bitcoin Core Bitcoin branduolys - - The Bitcoin Core developers - - [testnet] [testavimotinklas] @@ -2150,10 +1069,6 @@ Adresas: %4 Open until %1 Atidaryta iki %1 - - conflicted - - %1/offline %1/neprisijungęs @@ -2170,10 +1085,6 @@ Adresas: %4 Status Būsena - - , broadcast through %n node(s) - - Date Data @@ -2206,10 +1117,6 @@ Adresas: %4 Credit Kreditas - - matures in %n more block(s) - - not accepted nepriimta @@ -2238,14 +1145,6 @@ Adresas: %4 Transaction ID Sandorio ID - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - Debug information Derinimo informacija @@ -2254,10 +1153,6 @@ Adresas: %4 Transaction Sandoris - - Inputs - - Amount Suma @@ -2274,10 +1169,6 @@ Adresas: %4 , has not been successfully broadcast yet , transliavimas dar nebuvo sėkmingas - - Open for %n more block(s) - - unknown nežinomas @@ -2308,18 +1199,6 @@ Adresas: %4 Address Adresas - - Amount - Suma - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - Open until %1 Atidaryta iki %1 @@ -2336,22 +1215,6 @@ Adresas: %4 Generated but not accepted Išgauta bet nepriimta - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with Gauta su @@ -2467,10 +1330,6 @@ Adresas: %4 Copy amount Kopijuoti sumą - - Copy transaction ID - - Edit label Taisyti žymę @@ -2479,26 +1338,6 @@ Adresas: %4 Show transaction details Rodyti sandėrio detales - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Kableliais atskirtų duomenų failas (*.csv) @@ -2523,10 +1362,6 @@ Adresas: %4 Address Adresas - - Amount - Suma - ID ID @@ -2540,13 +1375,12 @@ Adresas: %4 skirta + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2560,29 +1394,17 @@ Adresas: %4 &Export &Eksportuoti - - Export the data in the current tab to a file - - Backup Wallet - + Backup piniginę Wallet Data (*.dat) - + Piniginės duomenys (*.dat) Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - + Nepavyko padaryti atsarginės kopijos Backup Successful @@ -2591,18 +1413,6 @@ Adresas: %4 bitcoin-core - - Usage: - Naudojimas: - - - List commands - Komandų sąrašas - - - Get help for a command - Suteikti pagalba komandai - Options: Parinktys: @@ -2627,10 +1437,6 @@ Adresas: %4 Maintain at most <n> connections to peers (default: 125) Palaikyti ne daugiau <n> jungčių kolegoms (pagal nutylėjimą: 125) - - Connect to a node to retrieve peer addresses, and disconnect - - Specify your own public address Nurodykite savo nuosavą viešą adresą @@ -2643,10 +1449,6 @@ Adresas: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Sekundžių kiekis eikiamas palaikyti ryšį dėl lygiarangių nestabilumo (pagal nutylėjimą: 86.400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Klausymas JSON-RPC sujungimui prijungčiai <port> (pagal nutylėjimą: 8332 or testnet: 18332) @@ -2655,10 +1457,6 @@ Adresas: %4 Accept command line and JSON-RPC commands Priimti komandinę eilutę ir JSON-RPC komandas - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Dirbti fone kaip šešėlyje ir priimti komandas @@ -2667,224 +1465,22 @@ Adresas: %4 Use the test network Naudoti testavimo tinklą - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Įspėjimas: -paytxfee yra nustatytas per didelis. Tai sandorio mokestis, kurį turėsite mokėti, jei siųsite sandorį. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Įspėjimas: Patikrinkite, kad kompiuterio data ir laikas yra teisingi.Jei Jūsų laikrodis neteisingai nustatytas Bitcoin, veiks netinkamai. - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) Prisijungti tik prie nurodyto mazgo - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - Error opening block database Klaida atveriant blokų duombazę - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - Error: system error: Klaida: sistemos klaida: - - Failed to listen on any port. Use -listen=0 if you want this. - - Failed to read block info Nepavyko nuskaityti bloko informacijos @@ -2893,18 +1489,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to read block Nepavyko nuskaityti bloko - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - Failed to write block Nepavyko įrašyti bloko @@ -2913,106 +1497,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write file info Nepavyko įrašyti failo informacijos - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - Įtraukti mokestį už kB siunčiamiems sandoriams - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - Generate coins (default: 0) Generuoti monetas (numatyta: 0) - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - Verifying blocks... Tikrinami blokai... @@ -3021,70 +1509,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Verifying wallet... Tikrinama piniginė... - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information Informacija - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) Maksimalus buferis priėmimo sujungimui <n>*1000 bitų (pagal nutylėjimą: 5000) @@ -3093,102 +1521,18 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) Maksimalus buferis siuntimo sujungimui <n>*1000 bitų (pagal nutylėjimą: 1000) - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL opcijos (žr.e Bitcoin Wiki for SSL setup instructions) - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file Siųsti atsekimo/derinimo info į konsolę vietoj debug.log failo - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - Specify connection timeout in milliseconds (default: 5000) Nustatyti sujungimo trukmę milisekundėmis (pagal nutylėjimą: 5000) - - Start Bitcoin Core Daemon - - System error: Sistemos klaida: - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - Use UPnP to map the listening port (default: 0) Bandymas naudoti UPnP struktūra klausymosi prievadui (default: 0) @@ -3203,44 +1547,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - versija - - - wallet.dat corrupt, salvage failed - + Įspėjimas Password for JSON-RPC connections Slaptažodis JSON-RPC sujungimams - - Allow JSON-RPC connections from specified IP address - Leisti JSON-RPC tik iš nurodytų IP adresų - - - Send commands to node running on <ip> (default: 127.0.0.1) - Siųsti komandą mazgui dirbančiam <ip> (pagal nutylėjimą: 127.0.0.1) - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - Upgrade wallet to latest format Atnaujinti piniginę į naujausią formatą @@ -3269,10 +1581,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message Pagelbos žinutė - - Unable to bind to %s on this computer (bind returned error %d, %s) - Nepavyko susieti šiame kompiuteryje prievado %s (bind returned error %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Leisti DNS paiešką sujungimui ir mazgo pridėjimui @@ -3285,41 +1593,17 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted wallet.dat pakrovimo klaida, wallet.dat sugadintas - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - wallet.dat pakrovimo klaida, wallet.dat reikalauja naujasnės Bitcoin versijos - - - Wallet needed to be rewritten: restart Bitcoin to complete - Piniginė turi būti prrašyta: įvykdymui perkraukite Bitcoin - Error loading wallet.dat wallet.dat pakrovimo klaida - Invalid -proxy address: '%s' - Neteisingas proxy adresas: '%s' + Invalid -proxy address: '%s' + Neteisingas proxy adresas: '%s' - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - Neteisinga suma -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Neteisinga suma -paytxfee=<amount>: '%s' Invalid amount @@ -3341,10 +1625,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Loading wallet... Užkraunama piniginė... - - Cannot downgrade wallet - - Cannot write default address Negalima parašyti įprasto adreso @@ -3357,19 +1637,9 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Done loading Įkėlimas baigtas - - To use the %s option - - Error Klaida - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_lv_LV.ts b/src/qt/locale/bitcoin_lv_LV.ts index 299e4d55e0..81b2688d03 100644 --- a/src/qt/locale/bitcoin_lv_LV.ts +++ b/src/qt/locale/bitcoin_lv_LV.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - Par Bitcoin Core - - - <b>Bitcoin Core</b> version - <b>Bitcoin Core</b> versija - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Šī ir eksperimentālā programmatūra. - -Izplatīta saskaņā ar MIT/X11 programmatūras licenci, skatīt pievienoto datni COPYING vai http://www.opensource.org/licenses/mit-license.php. - -Šis produkts ietver programmatūru, ko izstrādājis OpenSSL Project izmantošanai OpenSSL Toolkit (http://www.openssl.org/) un šifrēšanas programmatūru no Eric Young (eay@cryptsoft.com) un UPnP programmatūru no Thomas Bernard. - - - Copyright - Autortiesības - - - The Bitcoin Core developers - Bitcoin Core izstrādātāji - - - (%1-bit) - (%1-biti) - - + AddressBookPage @@ -72,7 +35,7 @@ Izplatīta saskaņā ar MIT/X11 programmatūras licenci, skatīt pievienoto datn Export the data in the current tab to a file - + Datus no tekošā ieliktņa eksportēt uz failu &Export @@ -102,14 +65,6 @@ Izplatīta saskaņā ar MIT/X11 programmatūras licenci, skatīt pievienoto datn Receiving addresses Saņemšanas adreses - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - Copy &Label Kopēt &Nosaukumu @@ -130,11 +85,7 @@ Izplatīta saskaņā ar MIT/X11 programmatūras licenci, skatīt pievienoto datn Exporting Failed Eksportēšana Neizdevās - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -168,10 +119,6 @@ Izplatīta saskaņā ar MIT/X11 programmatūras licenci, skatīt pievienoto datn Repeat new passphrase Jaunā parole vēlreiz - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Ierakstiet maciņa jauno paroli.<br/>Lūdzu izmantojiet <b>10 vai vairāk nejauši izvēlētas zīmes</b>, vai <b>astoņus un vairāk vārdus</b>. - Encrypt wallet Šifrēt maciņu @@ -212,10 +159,6 @@ Izplatīta saskaņā ar MIT/X11 programmatūras licenci, skatīt pievienoto datn Are you sure you wish to encrypt your wallet? Vai tu tiešām vēlies šifrēt savu maciņu? - - 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. - - Warning: The Caps Lock key is on! Brīdinājums: Caps Lock ir ieslēgts! @@ -295,10 +238,6 @@ Izplatīta saskaņā ar MIT/X11 programmatūras licenci, skatīt pievienoto datn Quit application Aizvērt programmu - - Show information about Bitcoin - Parādīt informāciju par Bitcoin - About &Qt Par &Qt @@ -439,14 +378,6 @@ Izplatīta saskaņā ar MIT/X11 programmatūras licenci, skatīt pievienoto datn &About Bitcoin Core Par &Bitcoin Core - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - Open a bitcoin: URI or payment request Atvērt bitcoin URI vai maksājuma pieprasījumu @@ -455,14 +386,6 @@ Izplatīta saskaņā ar MIT/X11 programmatūras licenci, skatīt pievienoto datn &Command-line options &Komandrindas iespējas - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Bitcoin klients - %n active connection(s) to Bitcoin network %n aktīvu savienojumu ar Bitcoin tīklu%n aktīvs savienojums ar Bitcoin tīklu%n aktīvu savienojumu as Bitcoin tīklu @@ -471,10 +394,6 @@ Izplatīta saskaņā ar MIT/X11 programmatūras licenci, skatīt pievienoto datn No block source available... Nav pieejams neviens bloku avots... - - Processed %1 of %2 (estimated) blocks of transaction history. - - Processed %1 blocks of transaction history. Apstrādāti %1 bloki no transakciju vēstures. @@ -503,10 +422,6 @@ Izplatīta saskaņā ar MIT/X11 programmatūras licenci, skatīt pievienoto datn %1 behind %1 aizmugurē - - Last received block was generated %1 ago. - - Transactions after this will not yet be visible. Transakcijas pēc šī vel nebūs redzamas @@ -559,10 +474,6 @@ Adrese: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Maciņš ir <b>šifrēts</b> un pašlaik <b>slēgts</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Radās fatāla kļūda. Bitcoin Core nevar vairs droši turpināt un tiks izslēgta. - ClientModel @@ -597,10 +508,6 @@ Adrese: %4 Fee: Maksa: - - Low Output: - Zema Izeja: - After Fee: Pēc Maksas: @@ -689,10 +596,6 @@ Adrese: %4 Copy priority Kopēt prioritāti - - Copy low output - Kopēt zemo izeju - Copy change Kopēt atlikumu @@ -741,10 +644,6 @@ Adrese: %4 none neviens - - Dust - Putekļi - yes @@ -753,42 +652,6 @@ Adrese: %4 no - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (bez nosaukuma) @@ -812,14 +675,6 @@ Adrese: %4 &Label &Nosaukums - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Adrese @@ -841,12 +696,12 @@ Adrese: %4 Mainīt nosūtīšanas adresi - The entered address "%1" is already in the address book. - Nupat ierakstītā adrese "%1" jau atrodas adrešu grāmatā. + The entered address "%1" is already in the address book. + Nupat ierakstītā adrese "%1" jau atrodas adrešu grāmatā. - The entered address "%1" is not a valid Bitcoin address. - Ierakstītā adrese "%1" nav derīga Bitcoin adrese. + The entered address "%1" is not a valid Bitcoin address. + Ierakstītā adrese "%1" nav derīga Bitcoin adrese. Could not unlock wallet. @@ -867,10 +722,6 @@ Adrese: %4 name vārds - - Directory already exists. Add %1 if you intend to create a new directory here. - - Path already exists, and is not a directory. Šāds ceļš jau pastāv un tā nav mape. @@ -882,10 +733,6 @@ Adrese: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Bitcoin Core - Komandrindas iespējas - Bitcoin Core Bitcoin Core @@ -894,6 +741,14 @@ Adrese: %4 version versija + + (%1-bit) + (%1-biti) + + + About Bitcoin Core + Par Bitcoin Core + Usage: Lietojums: @@ -907,26 +762,18 @@ Adrese: %4 Lietotāja interfeisa izvēlnes - Set language, for example "de_DE" (default: system locale) - Uzstādiet valodu, piemēram "de_DE" (pēc noklusēšanas: sistēmas lokāle) + Set language, for example "de_DE" (default: system locale) + Uzstādiet valodu, piemēram "de_DE" (pēc noklusēšanas: sistēmas lokāle) Start minimized Sākt minimizētu - - Set SSL root certificates for payment request (default: -system-) - - Show splash screen on startup (default: 1) Uzsākot, parādīt programmas informācijas logu (pēc noklusēšanas: 1) - - Choose data directory on startup (default: 0) - - - + Intro @@ -937,14 +784,6 @@ Adrese: %4 Welcome to Bitcoin Core. Sveicināts Bitcoin Core - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - Use the default data directory Izmantot noklusēto datu mapi @@ -954,12 +793,8 @@ Adrese: %4 Izmantot pielāgotu datu mapi: - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - + Bitcoin Core + Bitcoin Core Error @@ -1007,10 +842,6 @@ Adrese: %4 &Main &Galvenais - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - Pay transaction &fee &Maksāt par transakciju @@ -1047,10 +878,6 @@ Adrese: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Starpniekservera IP adrese (piem. IPv4: 127.0.0.1 / IPv6: ::1) - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - Third party transaction URLs Trešo personu transakciju URLs @@ -1071,10 +898,6 @@ Adrese: %4 &Network &Tīkls - - (0 = auto, <0 = leave that many cores free) - - W&allet &Maciņš @@ -1087,10 +910,6 @@ Adrese: %4 Enable coin &control features Ieslēgt bitcoin &kontroles funkcijas - - 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. - - &Spend unconfirmed change &Tērēt neapstiprinātu atlikumu @@ -1115,14 +934,6 @@ Adrese: %4 Port of the proxy (e.g. 9050) Starpniekservera ports (piem. 9050) - - SOCKS &Version: - SOCKS &Versija: - - - SOCKS version of the proxy (e.g. 5) - Starpniekservera SOCKS versija (piem. 5) - &Window &Logs @@ -1163,14 +974,6 @@ Adrese: %4 Choose the default subdivision unit to show in the interface and when sending coins. Izvēlēties dalījuma vienību pēc noklusēšanas, ko izmantot interfeisā un nosūtot bitkoinus. - - Whether to show Bitcoin addresses in the transaction list or not. - Rādīt vai nē Bitcoin adreses transakciju sarakstā. - - - &Display addresses in transaction list - &Attēlot adreses transakciju sarakstā - Whether to show coin control features or not. Vai rādīt Bitcoin kontroles funkcijas vai nē. @@ -1195,18 +998,10 @@ Adrese: %4 Confirm options reset Apstiprināt iestatījumu atiestatīšanu - - Client restart required to activate changes. - - Client will be shutdown, do you want to proceed? Klients tiks izslēgts, vai vēlaties turpināt? - - This change would require a client restart. - - The supplied proxy address is invalid. Norādītā starpniekservera adrese nav derīga. @@ -1246,10 +1041,6 @@ Adrese: %4 Immature: Nenobriedušu: - - Mined balance that has not yet matured - - Total: Kopsumma: @@ -1274,12 +1065,8 @@ Adrese: %4 URI apstrāde - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - + Invalid payment address %1 + Nederīga maksājuma adrese %1 Payment request error @@ -1289,46 +1076,10 @@ Adrese: %4 Cannot start bitcoin: click-to-pay handler Nevar palaist Bitcoin: nospied-lai-maksātu apstrādātāju - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - Refund from %1 Atmaksa no %1 - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - Payment acknowledged Maksājums atzīts @@ -1338,33 +1089,28 @@ Adrese: %4 Tīkla pieprasījuma kļūda + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Daudzums - Error: Specified data directory "%1" does not exist. - + %1 h + %1 st - Error: Cannot parse configuration file: %1. Only use key=value syntax. - + %1 m + %1 m - Error: Invalid combination of -regtest and -testnet. - + N/A + N/A - - Bitcoin Core didn't yet exit safely... - Bitcoin Core vel neizgāja droši... - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Ierakstiet Bitcoin adresi (piem. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget @@ -1438,10 +1184,6 @@ Adrese: %4 Current number of blocks Pašreizējais bloku skaits - - Estimated total blocks - Bloku skaita novērtējums - Last block time Pēdējā bloka laiks @@ -1482,10 +1224,6 @@ Adrese: %4 Debug log file Atkļūdošanas žurnāla datne - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - Clear console Notīrīt konsoli @@ -1518,19 +1256,7 @@ Adrese: %4 %1 GB %1 GB - - %1 m - %1 m - - - %1 h - %1 st - - - %1 h %2 m - %1 st %2 m - - + ReceiveCoinsDialog @@ -1545,30 +1271,10 @@ Adrese: %4 &Message: &Ziņojums: - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - R&euse an existing receiving address (not recommended) &Atkārtoti izmantot esošo saņemšanas adresi (nav ieteicams) - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - Clear all fields of the form. Notīrīt visus laukus formā. @@ -1742,10 +1448,6 @@ Adrese: %4 Fee: Maksa: - - Low Output: - Zema Izeja: - After Fee: Pēc Maksas: @@ -1754,10 +1456,6 @@ Adrese: %4 Change: Atlikums: - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - Custom change address Pielāgota atlikuma adrese @@ -1822,10 +1520,6 @@ Adrese: %4 Copy priority Kopēt prioritāti - - Copy low output - Kopēt zemās izejas - Copy change Kopēt atlikumu @@ -1862,10 +1556,6 @@ Adrese: %4 Transaction creation failed! Transakcijas izveidošana neizdevās! - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - Warning: Invalid Bitcoin address Brīdinājums: Nederīga Bitcoin adrese @@ -1878,22 +1568,10 @@ Adrese: %4 Warning: Unknown change address Brīdinājums: Nezināma atlikuma adrese - - Are you sure you want to send? - - added as transaction fee pievienots kā transakcijas maksa - - Payment request expired - Maksājuma pieprasījums ir novecojis - - - Invalid payment address %1 - Nederīga maksājuma adrese %1 - SendCoinsEntry @@ -1905,10 +1583,6 @@ Adrese: %4 Pay &To: &Saņēmējs: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adrese lai sūtītu maksājumu uz (piem. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Lai pievienotu adresi adrešu grāmatai, tai jādod nosaukums @@ -1949,14 +1623,6 @@ Adrese: %4 This is a verified payment request. Šis ir pārbaudīts maksājuma pieprasījums. - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - This is an unverified payment request. Šis ir nepārbaudīts maksājuma pieprasījums. @@ -1991,14 +1657,6 @@ Adrese: %4 &Sign Message Parakstīt &Ziņojumu - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adrese ar kuru parakstīt ziņojumu (piem. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Choose previously used address Izvēlies iepriekš izmantoto adresi @@ -2047,18 +1705,6 @@ Adrese: %4 &Verify Message &Pārbaudīt Ziņojumu - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adrese ar kādu ziņojums tika parakstīts (piem. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Verify the message to ensure it was signed with the specified Bitcoin address - - Verify &Message &Pārbaudīt Ziņojumu @@ -2068,12 +1714,8 @@ Adrese: %4 Atiestatīt visus laukus - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Ierakstiet Bitcoin adresi (piem. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Nospied "Parakstīt Ziņojumu" lai ģenerētu parakstu + Click "Sign Message" to generate signature + Nospied "Parakstīt Ziņojumu" lai ģenerētu parakstu The entered address is invalid. @@ -2172,10 +1814,6 @@ Adrese: %4 Status Status - - , broadcast through %n node(s) - - Date Datums @@ -2208,10 +1846,6 @@ Adrese: %4 Credit Kredīts - - matures in %n more block(s) - - not accepted nav pieņemts @@ -2244,10 +1878,6 @@ Adrese: %4 Merchant Tirgotājs - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - Debug information Atkļūdošanas informācija @@ -2310,14 +1940,6 @@ Adrese: %4 Address Adrese - - Amount - Daudzums - - - Immature (%1 confirmations, will be available after %2) - - Open for %n more block(s) Atvērts vel %n blokusAtvērts vel %n blokuAtvērts vel %n blokus @@ -2346,10 +1968,6 @@ Adrese: %4 Unconfirmed Neapstiprināts - - Confirming (%1 of %2 recommended confirmations) - - Conflicted Pretrunā @@ -2489,10 +2107,6 @@ Adrese: %4 Exporting Failed Eksportēšana Neizdevās - - There was an error trying to save the transaction history to %1. - - Exporting Successful Eksportēšana Veiksmīga @@ -2525,10 +2139,6 @@ Adrese: %4 Address Adrese - - Amount - Daudzums - ID ID @@ -2542,6 +2152,9 @@ Adrese: %4 uz + + UnitDisplayStatusBarControl + WalletFrame @@ -2564,7 +2177,7 @@ Adrese: %4 Export the data in the current tab to a file - + Datus no tekošā ieliktņa eksportēt uz failu Backup Wallet @@ -2593,18 +2206,6 @@ Adrese: %4 bitcoin-core - - Usage: - Lietojums: - - - List commands - Komandu saraksts - - - Get help for a command - Palīdzība par komandu - Options: Iespējas: @@ -2645,22 +2246,10 @@ Adrese: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Sekundes, cik ilgi atturēt pārkāpējmezglus no atkārtotas pievienošanās (pēc noklusēšanas: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - Accept command line and JSON-RPC commands Pieņemt komandrindas un JSON-RPC komandas - - Bitcoin Core RPC client version - Bitcoin Core RPC klienta versija - Run in the background as a daemon and accept commands Darbināt fonā kā servisu un pieņemt komandas @@ -2669,124 +2258,6 @@ Adrese: %4 Use the test network Izmantot testa tīklu - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Brīdinājums: Lūdzu pārbaudi vai tava datora datums un laiks ir pareizs! Ja pulkstenis ir nepareizs, Bitcoin Core nestrādās pareizi. - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - (default: 1) (noklusējums: 1) @@ -2803,74 +2274,26 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Attempt to recover private keys from a corrupt wallet.dat Mēģināt atgūt privātās atslēgas no bojāta wallet.dat - - Bitcoin Core Daemon - Bitcoin Core Process - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - + Bloka izveidošanas iestatījumi: Connect only to the specified node(s) Savienoties tikai ar norādītajām nodēm. - - Connect through SOCKS proxy - Savienoties caur SOCKS starpniekserveri - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - Connection options: Savienojuma iestatījumi: - - Corrupted block database detected - - Debugging/Testing options: Atkļūdošanas/Testēšanas iestatījumi: - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - Error loading block database Kļūda ielādējot bloku datubāzi - - Error opening block database - - Error: Disk space is low! Kļūda: Zema diska vieta! @@ -2883,74 +2306,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error: system error: Kļūda: sistēmas kļūda: - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - Pievienot maksu par kB tām transakcijām kuras tu sūti - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - Atrast pīrus izmantojot DNS uzmeklēšanu (noklusējums: 1 ja nav -connect) - Force safe mode (default: 0) Piespiest drošo režīmu (noklusējums: 0) - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - If <category> is not supplied, output all debugging information. Ja <category> nav norādīta, izvadīt visu atkļūdošanas informāciju. @@ -2959,62 +2318,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Importing... Importē... - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - RPC klienta iespējas: - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - Spend unconfirmed change when sending transactions (default: 1) Tērēt neapstiprinātu atlikumu kad sūta transakcijas (noklusējums: 1) - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - Verifying blocks... Pārbauda blokus... @@ -3023,158 +2330,30 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Verifying wallet... Pārbauda maciņu... - - Wait for RPC server to start - Uzgaidi līdz RPC serveris palaižas - - - Wallet %s resides outside data directory %s - - Wallet options: Maciņa iespējas: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - Imports blocks from external blk000??.dat file Importēt blokus no ārējās blk000??.dat datnes - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information Informācija - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - RPC server options: RPC servera iestatījumi: - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - Sūtīt komandu uz Bitcoin Core - Send trace/debug info to console instead of debug.log file Debug/trace informāciju izvadīt konsolē, nevis debug.log failā - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - Rādīt etalonuzdevuma informāciju (noklusējums: 0) - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - Signing transaction failed Transakcijas parakstīšana neizdevās - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - Sākt Bitcoin Core Procesu - System error: Sistēmas kļūda: @@ -3191,14 +2370,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Transaction too large Transakcija ir pārāk liela - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - Username for JSON-RPC connections JSON-RPC savienojumu lietotājvārds @@ -3211,18 +2382,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: This version is obsolete, upgrade required! Brīdinājums: Šī versija ir novecojusi, nepieciešams atjauninājums! - - Zapping all transactions from wallet... - - on startup startēšanas laikā - - version - versija - wallet.dat corrupt, salvage failed wallet.dat ir bojāts, glābšana neizdevās @@ -3231,14 +2394,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Password for JSON-RPC connections JSON-RPC savienojumu parole - - Allow JSON-RPC connections from specified IP address - Atļaut JSON-RPC savienojumus no norādītās IP adreses - - - Send commands to node running on <ip> (default: 127.0.0.1) - Nosūtīt komandas mezglam, kas darbojas adresē <ip> (pēc noklusēšanas: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Izpildīt komandu, kad labāk atbilstošais bloks izmainās (%s cmd aizvieto ar bloka hešu) @@ -3271,10 +2426,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message Šis palīdzības paziņojums - - Unable to bind to %s on this computer (bind returned error %d, %s) - Nevar pievienoties pie %s šajā datorā (pievienošanās atgrieza kļūdu %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Atļaut DNS uzmeklēšanu priekš -addnode, -seednode un -connect @@ -3287,41 +2438,29 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted Nevar ielādēt wallet.dat: maciņš bojāts - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Nevar ielādēt wallet.dat: maciņa atvēršanai nepieciešama jaunāka Bitcoin versija - - - Wallet needed to be rewritten: restart Bitcoin to complete - Bija nepieciešams pārstartēt maciņu: pabeigšanai pārstartējiet Bitcoin - Error loading wallet.dat Kļūda ielādējot wallet.dat - Invalid -proxy address: '%s' - Nederīga -proxy adrese: '%s' + Invalid -proxy address: '%s' + Nederīga -proxy adrese: '%s' - Unknown network specified in -onlynet: '%s' - -onlynet komandā norādīts nepazīstams tīkls: '%s' + Unknown network specified in -onlynet: '%s' + -onlynet komandā norādīts nepazīstams tīkls: '%s' - Unknown -socks proxy version requested: %i - Pieprasīta nezināma -socks starpniekservera versija: %i + Cannot resolve -bind address: '%s' + Nevar uzmeklēt -bind adresi: '%s' - Cannot resolve -bind address: '%s' - Nevar uzmeklēt -bind adresi: '%s' + Cannot resolve -externalip address: '%s' + Nevar atrisināt -externalip adresi: '%s' - Cannot resolve -externalip address: '%s' - Nevar atrisināt -externalip adresi: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Nederīgs daudzums priekš -paytxfree=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Nederīgs daudzums priekš -paytxfree=<amount>: '%s' Invalid amount @@ -3367,13 +2506,5 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error Kļūda - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Konfigurācijas failā jāuzstāda rpcpassword=<password>: -%s -Ja fails neeksistē, izveidojiet to ar atļauju lasīšanai tikai īpašniekam. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_mn.ts b/src/qt/locale/bitcoin_mn.ts index e765931b2c..4a296dfce7 100644 --- a/src/qt/locale/bitcoin_mn.ts +++ b/src/qt/locale/bitcoin_mn.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -41,70 +9,18 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address Шинэ хаяг нээх - - &New - - Copy the currently selected address to the system clipboard Одоогоор сонгогдсон байгаа хаягуудыг сануулах - - &Copy - - - - C&lose - - &Copy Address Хаягийг &Хуулбарлах - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - &Delete &Устгах - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - Copy &Label &Шошгыг хуулбарлах @@ -113,23 +29,11 @@ This product includes software developed by the OpenSSL Project for use in the O &Edit &Ѳѳрчлѳх - - Export Address List - - Comma separated file (*.csv) Таслалаар тусгаарлагдсан хүснэгтэн файл (.csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -147,10 +51,6 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase Нууц үгийг оруул @@ -163,10 +63,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Шинэ нууц үгийг давтана уу - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Түрүйвчийн шинэ нууц үгийг оруул. <br/><b>Дор хаяж 10 дурын үсэг/тоо бүхий</b> эсвэл <b>дор хаяж 8 дурын үгнээс бүрдсэн</b> нууц үгийг ашиглана уу. - Encrypt wallet Түрүйвчийг цоожлох @@ -199,22 +95,6 @@ This product includes software developed by the OpenSSL Project for use in the O Confirm wallet encryption Түрүйвчийн цоожийг баталгаажуулах - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - Wallet encrypted Түрүйвч цоожлогдлоо @@ -262,18 +142,10 @@ This product includes software developed by the OpenSSL Project for use in the O Synchronizing with network... Сүлжээтэй тааруулж байна... - - &Overview - - Node Нод - - Show general overview of wallet - - &Transactions Гүйлгээнүүд @@ -290,10 +162,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application Програмаас Гарах - - Show information about Bitcoin - Биткойны мэдээллийг харуулах - About &Qt &Клиентийн тухай @@ -318,54 +186,14 @@ This product includes software developed by the OpenSSL Project for use in the O &Change Passphrase... &Нууц Үгийг Солих... - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - Change the passphrase used for wallet encryption Түрүйвчийг цоожлох нууц үгийг солих - - &Debug window - - Open debugging and diagnostic console Оношилгоо ба засварын консолыг онгойлго - - &Verify message... - - Bitcoin Биткойн @@ -374,34 +202,10 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet Түрүйвч - - &Send - - - - &Receive - - &Show / Hide &Харуул / Нуу - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - &File &Файл @@ -414,66 +218,10 @@ This product includes software developed by the OpenSSL Project for use in the O &Help &Тусламж - - Tabs toolbar - - - - [testnet] - - - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Биткойн клиент - %n active connection(s) to Bitcoin network Биткойны сүлжээрүү %n идэвхитэй холболт байна Биткойны сүлжээрүү %n идэвхитэй холболтууд байна - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - %n hour(s) %n цаг%n цаг @@ -482,50 +230,14 @@ This product includes software developed by the OpenSSL Project for use in the O %n day(s) %n ѳдѳр%n ѳдрүүд - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - Error Алдаа - - Warning - - - - Information - - Up to date Шинэчлэгдсэн - - Catching up... - - Sent transaction Гадагшаа гүйлгээ @@ -557,68 +269,20 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Түрүйвч <b>цоожтой</b> ба одоогоор цоож <b>хаалттай</b> байна - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - Amount: Хэмжээ: - - Priority: - - Fee: Тѳлбѳр: - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount Хэмжээ @@ -631,18 +295,10 @@ Address: %4 Date Огноо - - Confirmations - - Confirmed Баталгаажлаа - - Priority - - Copy address Хаягийг санах @@ -655,146 +311,14 @@ Address: %4 Copy amount Хэмжээг санах - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - Copy change Ѳѳрчлѳлтийг санах - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (шошгогүй) - - change from %1 (%2) - - (change) (ѳѳрчлѳх) @@ -810,14 +334,6 @@ Address: %4 &Label &Шошго - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Хаяг @@ -839,12 +355,8 @@ Address: %4 Явуулах хаягийг ѳѳрчлѳх - The entered address "%1" is already in the address book. - Таны оруулсан хаяг "%1" нь хаягийн бүртгэлд ѳмнѳ нь орсон байна - - - The entered address "%1" is not a valid Bitcoin address. - + The entered address "%1" is already in the address book. + Таны оруулсан хаяг "%1" нь хаягийн бүртгэлд ѳмнѳ нь орсон байна Could not unlock wallet. @@ -857,37 +369,9 @@ Address: %4 FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - version хувилбар @@ -896,303 +380,35 @@ Address: %4 Usage: Хэрэглээ: - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - Биткойн - - - Error: Specified data directory "%1" can not be created. - - Error Алдаа - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog Options Сонголтууд - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - MB МБ - - Number of script &verification threads - - Connect to the Bitcoin network through a SOCKS proxy. Биткойны сүлжээрүү SOCKS проксигоор холбогдох. - - &Connect through SOCKS proxy (default proxy): - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) проксигийн IP хаяг (жишээ нь: IPv4: 127.0.0.1 / IPv6: ::1) - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - Client restart required to activate changes. Ѳѳрчлѳлтүүдийг идэвхижүүлхийн тулд клиентийг ахин эхлүүлэх шаардлагтай @@ -1205,21 +421,9 @@ Address: %4 This change would require a client restart. Энэ ѳѳрчлѳлтийг оруулахын тулд кли1нт програмыг ахин эхлүүлэх шаардлагтай - - The supplied proxy address is invalid. - - - + OverviewPage - - Form - - - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - Wallet Түрүйвч @@ -1228,155 +432,30 @@ Address: %4 Available: Хэрэглэж болох хэмжээ: - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - <b>Recent transactions</b> <b>Сүүлд хийгдсэн гүйлгээнүүд</b> - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - Биткойн + Amount + Хэмжээ - Error: Specified data directory "%1" does not exist. - + N/A + Алга Байна - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - PNG Image (*.png) PNG форматын зураг (*.png) @@ -1400,22 +479,10 @@ Address: %4 &Information &Мэдээллэл - - Debug window - - General Ерѳнхий - - Using OpenSSL version - - - - Startup time - - Network Сүлжээ @@ -1436,10 +503,6 @@ Address: %4 Current number of blocks Одоогийн блокийн тоо - - Estimated total blocks - Нийт блокийн барагцаа - Last block time Сүүлийн блокийн хугацаа @@ -1452,141 +515,17 @@ Address: %4 &Console &Консол - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - Clear console Консолыг цэвэрлэх - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - &Label: &Шошго: - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - Show Харуул @@ -1614,34 +553,6 @@ Address: %4 ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address Хаяг @@ -1658,15 +569,7 @@ Address: %4 Message Зурвас - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel @@ -1693,25 +596,13 @@ Address: %4 (no message) (зурвас алга) - - (no amount) - - - + SendCoinsDialog Send Coins Зоос явуулах - - Coin Control Features - - - - Inputs... - - automatically selected автоматаар сонгогдсон @@ -1720,46 +611,14 @@ Address: %4 Insufficient funds! Таны дансны үлдэгдэл хүрэлцэхгүй байна! - - Quantity: - - - - Bytes: - - Amount: Хэмжээ: - - Priority: - - Fee: Тѳлбѳр: - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Нэгэн зэрэг олон хүлээн авагчруу явуулах @@ -1768,10 +627,6 @@ Address: %4 Add &Recipient &Хүлээн авагчийг Нэмэх - - Clear all fields of the form. - - Clear &All &Бүгдийг Цэвэрлэ @@ -1792,38 +647,10 @@ Address: %4 Confirm send coins Зоос явуулахыг баталгаажуулна уу - - %1 to %2 - - - - Copy quantity - - Copy amount Хэмжээг санах - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - Copy change Ѳѳрчлѳлтийг санах @@ -1836,10 +663,6 @@ Address: %4 or эсвэл - - The recipient address is not valid, please recheck. - - The amount to pay must be larger than 0. Тѳлѳх хэмжээ 0.-оос их байх ёстой @@ -1852,18 +675,6 @@ Address: %4 The total exceeds your balance when the %1 transaction fee is included. Гүйлгээний тѳлбѳр %1-ийг тооцхоор нийт дүн нь таны балансаас хэтрээд байна. - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - Warning: Invalid Bitcoin address Анхаар:Буруу Биткойны хаяг байна @@ -1872,27 +683,7 @@ Address: %4 (no label) (шошгогүй) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry @@ -1903,10 +694,6 @@ Address: %4 Pay &To: Тѳлѳх &хаяг: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - Enter a label for this address to add it to your address book Энэ хаягийг ѳѳрийн бүртгэлдээ авахын тулд шошго оруул @@ -1915,14 +702,6 @@ Address: %4 &Label: &Шошго: - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt+A @@ -1935,39 +714,11 @@ Address: %4 Alt+P Alt+P - - Remove this entry - - Message: Зурвас: - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow @@ -1981,26 +732,6 @@ Address: %4 SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - Alt+A Alt+A @@ -2013,137 +744,17 @@ Address: %4 Alt+P Alt+P - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - Clear &All &Бүгдийг Цэвэрлэ - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - - - [testnet] - - - + TrafficGraphWidget - - KB/s - - - + TransactionDesc @@ -2154,10 +765,6 @@ Address: %4 conflicted зѳрчилдлѳѳ - - %1/offline - - %1/unconfirmed %1/баталгаажаагүй @@ -2166,118 +773,26 @@ Address: %4 %1 confirmations %1 баталгаажилтууд - - Status - - - - , broadcast through %n node(s) - - Date Огноо - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - Message Зурвас - - Comment - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - + Тодорхойлолт Amount Хэмжээ - - true - - - - false - - , has not been successfully broadcast yet , хараахан амжилттай цацагдаагүй байна - - Open for %n more block(s) - - unknown үл мэдэгдэх @@ -2308,18 +823,6 @@ Address: %4 Address Хаяг - - Amount - Хэмжээ - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - Open until %1 %1 хүртэл нээлттэй @@ -2336,18 +839,10 @@ Address: %4 Generated but not accepted Үүсгэгдсэн гэхдээ хүлээн авагдаагүй - - Offline - - Unconfirmed Баталгаажаагүй - - Confirming (%1 of %2 recommended confirmations) - - Conflicted Зѳрчилдлѳѳ @@ -2423,10 +918,6 @@ Address: %4 This year Энэ жил - - Range... - - Received with Хүлээн авсан хаяг @@ -2467,10 +958,6 @@ Address: %4 Copy amount Хэмжээг санах - - Copy transaction ID - - Edit label Шошгыг ѳѳрчлѳх @@ -2479,22 +966,6 @@ Address: %4 Show transaction details Гүйлгээний дэлгэрэнгүйг харуул - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - The transaction history was successfully saved to %1. Гүйлгээнүй түүхийг %1-д амжилттай хадгаллаа. @@ -2523,23 +994,18 @@ Address: %4 Address Хаяг - - Amount - Хэмжээ - ID Тодорхойлолт - - Range: - - to -рүү/руу + + UnitDisplayStatusBarControl + WalletFrame @@ -2556,727 +1022,25 @@ Address: %4 WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - Хэрэглээ: - - - List commands - Үйлдлүүдийг жагсаах - - - Get help for a command - Үйлдэлд туслалцаа авах - Options: Сонголтууд: - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - Listen for connections on <port> (default: 8333 or testnet: 18333) <port> дээрх холболтуудыг чагна (ѳгѳгдмѳл: 8333 эсвэл testnet: 18333) - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - SOCKS проксигоор холбогдох - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - RPC серверийг эхэлтэл хүлээ - - - Wallet %s resides outside data directory %s - - Wallet options: Түрүйвчийн сонголтууд: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - хувилбар - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - Upgrade wallet to latest format Түрүйвчийг хамгийн сүүлийн үеийн форматруу шинэчлэх - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - Loading addresses... Хаягуудыг ачааллаж байна... @@ -3285,41 +1049,13 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted wallet.dat-ыг ачааллахад алдаа гарлаа: Түрүйвч эвдэрсэн байна - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - wallet.dat-ыг ачааллахад алдаа гарлаа: Түрүйвч Биткойны шинэ хувилбарыг шаардаж байна - - - Wallet needed to be rewritten: restart Bitcoin to complete - - Error loading wallet.dat wallet.dat-ыг ачааллахад алдаа гарлаа - Invalid -proxy address: '%s' - Эдгээр прокси хаягнууд буруу байна: '%s' - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - + Invalid -proxy address: '%s' + Эдгээр прокси хаягнууд буруу байна: '%s' Invalid amount @@ -3341,14 +1077,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Loading wallet... Түрүйвчийг ачааллаж байна... - - Cannot downgrade wallet - - - - Cannot write default address - - Rescanning... Ахин уншиж байна... @@ -3365,11 +1093,5 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error Алдаа - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_ms_MY.ts b/src/qt/locale/bitcoin_ms_MY.ts index 0f92a6d49f..428819e92f 100644 --- a/src/qt/locale/bitcoin_ms_MY.ts +++ b/src/qt/locale/bitcoin_ms_MY.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -41,3328 +9,162 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address Cipta alamat baru - - &New - - Copy the currently selected address to the system clipboard Salin alamat terpilih ke dalam sistem papan klip - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - &Delete &Padam - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - Comma separated file (*.csv) Fail yang dipisahkan dengan koma - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel - - Label - - Address Alamat - - (no label) - - - + AskPassphraseDialog - - Passphrase Dialog - - - - Enter passphrase - - - - New passphrase - - - - Repeat new passphrase - - - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - - - - Encrypt wallet - - - - This operation needs your wallet passphrase to unlock the wallet. - - - - Unlock wallet - - - - This operation needs your wallet passphrase to decrypt the wallet. - - - - Decrypt wallet - - - - Change passphrase - - - - Enter the old and new passphrase to the wallet. - - - - Confirm wallet encryption - - - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - - - Wallet encrypted - - - - Bitcoin 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. - - - - Wallet encryption failed - - - - Wallet encryption failed due to an internal error. Your wallet was not encrypted. - - - - The supplied passphrases do not match. - - - - Wallet unlock failed - - - - The passphrase entered for the wallet decryption was incorrect. - - - - Wallet decryption failed - - - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - - - Synchronizing with network... - - - - &Overview - - - - Node - - - - Show general overview of wallet - - - - &Transactions - - - - Browse transaction history - - - - E&xit - - - - Quit application - - - - Show information about Bitcoin - - - - About &Qt - - - - Show information about Qt - - &Options... Pilihan - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - - - Change the passphrase used for wallet encryption - - - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - - - &File - - - - &Settings - - - - &Help - - - - Tabs toolbar - - - - [testnet] - - - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - - - %n active connection(s) to Bitcoin network - - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - - - Error - - - - Warning - - - - Information - - - - Up to date - - - - Catching up... - - - - Sent transaction - - - - Incoming transaction - - - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> - - - - Wallet is <b>encrypted</b> and currently <b>locked</b> - - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - - + ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - - - Amount - - Address Alamat - - Date - - - - Confirmations - - - - Confirmed - - - - Priority - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - - - (no label) - - - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog Edit Address Alamat - - &Label - - - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address Alamat - - New receiving address - - - - New sending address - - - - Edit receiving address - - - - Edit sending address - - - - The entered address "%1" is already in the address book. - - - - The entered address "%1" is not a valid Bitcoin address. - - - - Could not unlock wallet. - - - - New key generation failed. - - - + FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - - - version - - - - Usage: - - - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - - - Error - - - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog - - Options - - - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage - - Form - - - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - - - <b>Recent transactions</b> - - - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - - Bitcoin - - - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - - - &Label: - - - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - - - Copy label - - - - Copy message - - - - Copy amount - - - + ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address Alamat - - Amount - - - - Label - - - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel - - Date - - - - Label - - - - Message - - - - Amount - - - - (no label) - - - - (no message) - - - - (no amount) - - - + SendCoinsDialog - - Send Coins - - - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - - - Send to multiple recipients at once - - - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - Balance: Baki - - Confirm the send action - - - - S&end - - - - Confirm send coins - - - - %1 to %2 - - - - Copy quantity - - - - Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - - - The amount to pay must be larger than 0. - - - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - - - (no label) - - - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry - - A&mount: - - - - Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Enter a label for this address to add it to your address book - - - - &Label: - - - - Choose previously used address - - - - This is a normal payment. - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - - - [testnet] - - - + TrafficGraphWidget - - KB/s - - - + TransactionDesc - - Open until %1 - - - - conflicted - - - - %1/offline - - - - %1/unconfirmed - - - - %1 confirmations - - - - Status - - - - , broadcast through %n node(s) - - - - Date - - - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - - - Amount - - - - true - - - - false - - - - , has not been successfully broadcast yet - - - - Open for %n more block(s) - - - - unknown - - - + TransactionDescDialog - - Transaction details - - - - This pane shows a detailed description of the transaction - - - + TransactionTableModel - - Date - - - - Type - - Address Alamat - - Amount - - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - - - Open until %1 - - - - Confirmed (%1 confirmations) - - - - This block was not received by any other nodes and will probably not be accepted! - - - - Generated but not accepted - - - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - - - Received with - - - - Received from - - - - Sent to - - - - Payment to yourself - - - - Mined - - - - (n/a) - - - - Transaction status. Hover over this field to show number of confirmations. - - - - Date and time that the transaction was received. - - - - Type of transaction. - - - - Destination address of transaction. - - - - Amount removed from or added to balance. - - - + TransactionView - - All - - - - Today - - - - This week - - - - This month - - - - Last month - - - - This year - - - - Range... - - - - Received with - - - - Sent to - - - - To yourself - - - - Mined - - - - Other - - - - Enter address or label to search - - - - Min amount - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Fail yang dipisahkan dengan koma - - Confirmed - - - - Date - - - - Type - - - - Label - - Address Alamat - - Amount - - - - ID - - - - Range: - - - - to - - - + + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel - - Send Coins - - - + WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - - - Options: - - - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - - - Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - - - Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - - - Done loading - - - - To use the %s option - - - - Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - - + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_nb.ts b/src/qt/locale/bitcoin_nb.ts index 9e38c69c60..bb6b78849c 100644 --- a/src/qt/locale/bitcoin_nb.ts +++ b/src/qt/locale/bitcoin_nb.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - Om Bitcoin Core - - - <b>Bitcoin Core</b> version - <b>Bitcoin Core</b> versjon - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Dette er eksperimentell programvare. - -Distribuert under MIT/X11 programvarelisensen, se medfølgende fil COPYING eller http://www.opensource.org/licenses/mit-license.php. - -Dette produktet inneholder programvare utviklet av OpenSSL Project for bruk i OpenSSL Toolkit (http://www.openssl.org/), kryptografisk programvare skrevet av Eric Young (eay@cryptsoft.com) og UPnP programvare skrevet av Thomas Bernard. - - - Copyright - Copyright - - - The Bitcoin Core developers - Bitcoin Core utviklerne - - - (%1-bit) - (%1-bit) - - + AddressBookPage @@ -131,8 +94,8 @@ Dette produktet inneholder programvare utviklet av OpenSSL Project for bruk i Op Ekport Feilet - There was an error trying to save the address list to %1. - En feil oppstod ved lagring av adresselisten til %1. + There was an error trying to save the address list to %1. Please try again. + Det oppstod en feil under lagring av adresselisten til %1. Vennligst prøv på nytt. @@ -168,10 +131,6 @@ Dette produktet inneholder programvare utviklet av OpenSSL Project for bruk i Op Repeat new passphrase Gjenta ny adgangsfrase - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Skriv inn den nye adgangsfrasen for lommeboken.<br/>Vennligst bruk en adgangsfrase med <b>10 eller flere tilfeldige tegn</b>, eller <b>åtte eller flere ord</b>. - Encrypt wallet Krypter lommebok @@ -224,6 +183,10 @@ Dette produktet inneholder programvare utviklet av OpenSSL Project for bruk i Op Wallet encrypted Lommebok kryptert + + 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>. + Oppgi adgangsfrasen til lommeboken.<br/>Vennligst bruk en adgangsfrase med <b>ti eller flere tilfeldige tegn</b>, eller <b>åtte eller flere ord</b>. + Bitcoin 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. Bitcoin vil nå lukkes for å fullføre krypteringsprosessen. Husk at kryptering av lommeboken ikke fullt ut kan beskytte dine bitcoins fra å bli stjålet om skadevare infiserer datamaskinen. @@ -295,10 +258,6 @@ Dette produktet inneholder programvare utviklet av OpenSSL Project for bruk i Op Quit application Avslutt applikasjonen - - Show information about Bitcoin - Vis informasjon om Bitcoin - About &Qt Om &Qt @@ -335,6 +294,10 @@ Dette produktet inneholder programvare utviklet av OpenSSL Project for bruk i Op Open &URI... Åpne &URI... + + Bitcoin Core client + Bitcoin Core-klient + Importing blocks from disk... Importere blokker... @@ -387,6 +350,10 @@ Dette produktet inneholder programvare utviklet av OpenSSL Project for bruk i Op &Receive &Motta + + Show information about Bitcoin Core + Vis informasjon om Bitcoin Core + &Show / Hide &Vis / Skjul @@ -459,10 +426,6 @@ Dette produktet inneholder programvare utviklet av OpenSSL Project for bruk i Op Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options Vis Bitcoin Core hjelpemeldingen for å få en liste med mulige kommandolinjevalg - - Bitcoin client - Bitcoin-klienten - %n active connection(s) to Bitcoin network %n aktiv forbindelse til Bitcoin-nettverket%n aktive forbindelser til Bitcoin-nettverket @@ -471,10 +434,6 @@ Dette produktet inneholder programvare utviklet av OpenSSL Project for bruk i Op No block source available... Ingen kilde for blokker tilgjengelig... - - Processed %1 of %2 (estimated) blocks of transaction history. - Lastet %1 av %2 (estimert) blokker med transaksjonshistorikk. - Processed %1 blocks of transaction history. Lastet %1 blokker med transaksjonshistorikk. @@ -559,10 +518,6 @@ Adresse: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Lommeboken er <b>kryptert</b> og for tiden <b>låst</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - En fatal feil har inntruffet. Det er ikke trygt å fortsette og Bitcoin må derfor avslutte. - ClientModel @@ -598,8 +553,8 @@ Adresse: %4 Avgift: - Low Output: - Svake Utdata: + Dust: + Støv: After Fee: @@ -690,8 +645,8 @@ Adresse: %4 Kopier prioritet - Copy low output - Kopier svake utdata + Copy dust + Kopier støv Copy change @@ -742,8 +697,8 @@ Adresse: %4 ingen - Dust - Støv + Can vary +/- %1 satoshi(s) per input. + Kan variere +/- %1 satoshi(er) per input. yes @@ -770,25 +725,13 @@ Adresse: %4 Transaksjoner med høyere prioritet har mer sannsynlighet for å bli inkludert i en blokk. - This label turns red, if the priority is smaller than "medium". - Denne merkelappen blir rød, hvis prioriteten er mindre enn "medium". + This label turns red, if the priority is smaller than "medium". + Denne merkelappen blir rød, hvis prioriteten er mindre enn "medium". This label turns red, if any recipient receives an amount smaller than %1. Denne merkelappen blir rød, hvis en mottaker mottar en mengde på mindre enn %1. - - This means a fee of at least %1 is required. - Dette betyr at et gebyr på minst %1 er påkrevd. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - Mengder under 0.546 ganger minimum relégebyr er vist som støv. - - - This label turns red, if the change is smaller than %1. - Denne merkelappen blir rød, hvis endringen er mindre enn %1. - (no label) (ingen merkelapp) @@ -841,12 +784,12 @@ Adresse: %4 Rediger utsendingsadresse - The entered address "%1" is already in the address book. - Den oppgitte adressen "%1" er allerede i adresseboken. + The entered address "%1" is already in the address book. + Den oppgitte adressen "%1" er allerede i adresseboken. - The entered address "%1" is not a valid Bitcoin address. - Den angitte adressed "%1" er ikke en gyldig Bitcoin-adresse. + The entered address "%1" is not a valid Bitcoin address. + Den angitte adressed "%1" er ikke en gyldig Bitcoin-adresse. Could not unlock wallet. @@ -882,10 +825,6 @@ Adresse: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Bitcoin Core - Kommandolinjevalg - Bitcoin Core Bitcoin Core @@ -894,6 +833,18 @@ Adresse: %4 version versjon + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + Om Bitcoin Core + + + Command-line options + Kommandolinjevalg + Usage: Bruk: @@ -907,8 +858,8 @@ Adresse: %4 valg i brukergrensesnitt - Set language, for example "de_DE" (default: system locale) - Sett språk, for eksempel "nb_NO" (standardverdi: fra operativsystem) + Set language, for example "de_DE" (default: system locale) + Sett språk, for eksempel "nb_NO" (standardverdi: fra operativsystem) Start minimized @@ -916,7 +867,7 @@ Adresse: %4 Set SSL root certificates for payment request (default: -system-) - Sett SSL-rotsertifikat for betalingsforespørsel (standard: -system-) + Sett SSL-rotsertifikat for betalingsetterspørring (standard: -system-) Show splash screen on startup (default: 1) @@ -954,12 +905,12 @@ Adresse: %4 Bruk en egendefinert datamappe: - Bitcoin - Bitcoin + Bitcoin Core + Bitcoin Core - Error: Specified data directory "%1" can not be created. - Feil: Spesifisert datamappe "%1" kan ikke opprettes. + Error: Specified data directory "%1" cannot be created. + Feil: Den oppgitte datamappen "%1" kan ikke opprettes. Error @@ -1035,6 +986,14 @@ Adresse: %4 Number of script &verification threads Antall script &verifikasjonstråder + + Accept connections from outside + Tillat tilkoblinger fra utsiden + + + Allow incoming connections + Tillatt innkommende tilkoblinger + Connect to the Bitcoin network through a SOCKS proxy. Koble til Bitcoin-nettverket gjennom en SOCKS proxy. @@ -1115,14 +1074,6 @@ Adresse: %4 Port of the proxy (e.g. 9050) Proxyens port (f.eks. 9050) - - SOCKS &Version: - SOCKS &Versjon: - - - SOCKS version of the proxy (e.g. 5) - Proxyens SOCKS versjon (f.eks. 5) - &Window &Vindu @@ -1163,14 +1114,6 @@ Adresse: %4 Choose the default subdivision unit to show in the interface and when sending coins. Velg standard delt enhet for visning i grensesnittet og for sending av bitcoins. - - Whether to show Bitcoin addresses in the transaction list or not. - Om Bitcoin-adresser skal vises i transaksjonslisten eller ikke. - - - &Display addresses in transaction list - &Vis adresser i transaksjonslisten - Whether to show coin control features or not. Skal myntkontroll funksjoner vises eller ikke. @@ -1226,6 +1169,10 @@ Adresse: %4 Wallet Lommebok + + Watch-only: + Kun observerbar: + Available: Tilgjengelig: @@ -1258,6 +1205,22 @@ Adresse: %4 Your current total balance Din nåværende saldo + + Your current balance in watch-only addresses + Din nåværende balanse i kun observerbare adresser + + + Unconfirmed transactions to watch-only addresses + Ubekreftede transaksjoner til kun observerbare adresser + + + Mined balance in watch-only addresses that has not yet matured + Utvunnet balanse i kun observerbare adresser som ennå ikke har modnet + + + Current total balance in watch-only addresses + Nåværende totale balanse i kun observerbare adresser + <b>Recent transactions</b> <b>Siste transaksjoner</b> @@ -1274,8 +1237,24 @@ Adresse: %4 URI-håndtering - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI kunne ikke tolkes! Dette kan forårsakes av en ugyldig Bitcoin-adresse eller feil i URI-parametere. + Invalid payment address %1 + Ugyldig betalingsadresse %1 + + + Payment request rejected + Betalingsetterspørring avvist + + + Payment request network doesn't match client network. + Nettverk for betalingsetterspørring er ikke i overensstemmelse med klientnettverket. + + + Payment request has expired. + Betalingsetterspørringen har utløpt. + + + Payment request is not initialized. + Betalingsetterspørringen er ikke initialisert. Requested payment amount of %1 is too small (considered dust). @@ -1283,31 +1262,27 @@ Adresse: %4 Payment request error - Betalingsforespørsel feil + Betalingsetterspørringsfeil Cannot start bitcoin: click-to-pay handler Kan ikke starte Bitcoin: klikk-og-betal håndterer - - Net manager warning - Nettleder advarsel - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - Din aktive proxy har ikke støtte for SOCKS5, som er påkrevd for betalingsforespørsler via proxy. - Payment request fetch URL is invalid: %1 - Hentelenke for betalingsforespørsel er ugyldig: %1 + Hentelenke for betalingsetterspørring er ugyldig: %1 + + + URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + URI kan ikke fortolkes! Dette kan være forårsaket av en ugyldig Bitcoin-adresse eller feilformede URI-parametre. Payment request file handling - Filhåndtering for betalingsforespørsel + Filhåndtering for betalingsetterspørring - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - Fil for betalingsforespørsel kan ikke leses eller behandles! Dette kan skyldes en ugyldig fil for betalingsforespørsel. + Payment request file cannot be read! This can be caused by an invalid payment request file. + Betalingsetterspørringsfil kan ikke leses! Dette kan være forårsaket av en ugyldig betalingsetterspørringsfil. Unverified payment requests to custom payment scripts are unsupported. @@ -1322,8 +1297,8 @@ Adresse: %4 Feil i kommunikasjonen med %1: %2 - Payment request can not be parsed or processed! - Betalingsforespørsler kan ikke analyseres eller behandles! + Payment request cannot be parsed! + Betaingsetterspørrelse kan ikke fortolkes! Bad response from server %1 @@ -1338,31 +1313,66 @@ Adresse: %4 Nettverksforespørsel feil + + PeerTableModel + + User Agent + Brukeragent + + + Address/Hostname + Adresse/Vertsnavn + + + Ping Time + Ping-tid + + QObject - Bitcoin - Bitcoin + Amount + Beløp - Error: Specified data directory "%1" does not exist. - Feil: Spesifisert datamappe "%1" finnes ikke. + Enter a Bitcoin address (e.g. %1) + Oppgi en Bitcoin-adresse (f.eks. %1) - Error: Cannot parse configuration file: %1. Only use key=value syntax. - Feil: Kan ikke lese konfigurasjonsfil: %1. Bruk kun syntaksen nøkkel=verdi. + %1 d + %1 d - Error: Invalid combination of -regtest and -testnet. - Feil: Ugyldig kombinasjon av -regtest og -testnet. + %1 h + %1 t - Bitcoin Core didn't yet exit safely... - Bitcoin Core har ennå ikke avsluttet på en sikker måte... + %1 m + %1 m - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Skriv inn en Bitcoin-adresse (f.eks. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + %1 s + %1 s + + + NETWORK + NETTVERK + + + UNKNOWN + UKJENT + + + None + Ingen + + + N/A + - + + + %1 ms + %1 ms @@ -1414,6 +1424,10 @@ Adresse: %4 Using OpenSSL version Bruker OpenSSL versjon + + Using BerkeleyDB version + Bruker BerkeleyDB versjon + Startup time Oppstartstidspunkt @@ -1439,8 +1453,76 @@ Adresse: %4 Nåværende antall blokker - Estimated total blocks - Estimert totalt antall blokker + Received + Mottatt + + + Sent + Sendt + + + &Peers + &Noder + + + Select a peer to view detailed information. + Velg en node for å vise detaljert informasjon. + + + Direction + Retning + + + Version + Versjon + + + User Agent + Brukeragent + + + Services + Tjenester + + + Sync Node + Synk-node + + + Starting Height + Starthøyde + + + Sync Height + Synkroniseringshøyde + + + Ban Score + Ban Poengsum + + + Connection Time + Tilkoblingstid + + + Last Send + Siste Sendte + + + Last Receive + Siste Mottatte + + + Bytes Sent + Byte Sendt + + + Bytes Received + Byte Mottatt + + + Ping Time + Ping-tid Last block time @@ -1519,16 +1601,36 @@ Adresse: %4 %1 GB - %1 m - %1 m + via %1 + via %1 - %1 h - %1 t + never + aldri - %1 h %2 m - %1 t %2 m + Inbound + Innkommende + + + Outbound + Utgående + + + Yes + Ja + + + No + Nei + + + Unknown + Ukjent + + + Fetching... + Henter … @@ -1547,7 +1649,7 @@ Adresse: %4 Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - Gjenbruk en av de tidligere brukte mottaksadressene. Gjenbruk av adresser har sikkerhets- og personvernsutfordringer. Ikke bruk dette med unntak for å gjennopprette en betalingsforespørsel som ble gjort tidligere. + Gjenbruk en av de tidligere brukte mottaksadressene. Gjenbruk av adresser har sikkerhets- og personvernsutfordringer. Ikke bruk dette med unntak for å gjennopprette en betalingsetterspørring som ble gjort tidligere. R&euse an existing receiving address (not recommended) @@ -1555,7 +1657,7 @@ Adresse: %4 An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - En valgfri melding å tilknytte betalingsforespørselen, som vil bli vist når forespørselen er åpnet. Meldingen vil ikke bli sendt med betalingen over Bitcoin-nettverket. + En valgfri melding å tilknytte betalingsetterspørringen, som vil bli vist når forespørselen er åpnet. Meldingen vil ikke bli sendt med betalingen over Bitcoin-nettverket. An optional label to associate with the new receiving address. @@ -1742,10 +1844,6 @@ Adresse: %4 Fee: Gebyr: - - Low Output: - Svake Utdata: - After Fee: Etter Gebyr: @@ -1774,6 +1872,10 @@ Adresse: %4 Clear all fields of the form. Fjern alle felter fra skjemaet. + + Dust: + Støv: + Clear &All Fjern &Alt @@ -1822,10 +1924,6 @@ Adresse: %4 Copy priority Kopier prioritet - - Copy low output - Kopier svake utdata - Copy change Kopier veksel @@ -1878,6 +1976,10 @@ Adresse: %4 Warning: Unknown change address Advarsel: Ukjent adresse for veksel + + Copy dust + Kopier støv + Are you sure you want to send? Er du sikker på at du vil sende? @@ -1886,14 +1988,6 @@ Adresse: %4 added as transaction fee lagt til som transaksjonsgebyr - - Payment request expired - Betalingsforespørsel utgått - - - Invalid payment address %1 - Ugyldig betalingsadresse %1 - SendCoinsEntry @@ -1905,10 +1999,6 @@ Adresse: %4 Pay &To: Betal &Til: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adressen betalingen skal sendes til (f.eks. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Skriv inn en merkelapp for denne adressen for å legge den til i din adressebok @@ -1925,6 +2015,10 @@ Adresse: %4 This is a normal payment. Dette er en normal betaling. + + The Bitcoin address to send the payment to + Bitcoin-adressen betalingen skal sendes til + Alt+A Alt+A @@ -1996,8 +2090,8 @@ Adresse: %4 Du kan signere meldinger med dine adresser for å bevise at du eier dem. Ikke signer vage meldinger da phishing-angrep kan prøve å lure deg til å signere din identitet over til andre. Signer kun fullt detaljerte utsagn som du er enig i. - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adressen for signering av meldingen (f.eks. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address to sign the message with + Bitcoin-adressen meldingen skal signeres med Choose previously used address @@ -2049,11 +2143,11 @@ Adresse: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - Angi adresse for signering, melding (vær sikker på at du kopierer linjeskift, mellomrom, tab, etc. helt nøyaktig) og signatur under for å verifisere meldingen. Vær forsiktig med at du ikke gir signaturen mer betydning enn det som faktisk står i meldingen, for å unngå å bli lurt av såkalte "man-in-the-middle" angrep. + Angi adresse for signering, melding (vær sikker på at du kopierer linjeskift, mellomrom, tab, etc. helt nøyaktig) og signatur under for å verifisere meldingen. Vær forsiktig med at du ikke gir signaturen mer betydning enn det som faktisk står i meldingen, for å unngå å bli lurt av såkalte "man-in-the-middle" angrep. - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adressen meldingen var signert med (f.eks. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address the message was signed with + Bitcoin-adressen meldingen ble signert med Verify the message to ensure it was signed with the specified Bitcoin address @@ -2068,12 +2162,8 @@ Adresse: %4 Tilbakestill alle felter for meldingsverifikasjon - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Skriv inn en Bitcoin-adresse (f.eks. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Klikk "Signer Melding" for å generere signatur + Click "Sign Message" to generate signature + Klikk "Signer Melding" for å generere signatur The entered address is invalid. @@ -2200,6 +2290,10 @@ Adresse: %4 own address egen adresse + + watch-only + kun observerbar + label merkelapp @@ -2220,6 +2314,14 @@ Adresse: %4 Debit Debet + + Total debit + Total debet + + + Total credit + Total kredit + Transaction fee Transaksjonsgebyr @@ -2245,8 +2347,8 @@ Adresse: %4 Forhandler - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - Genererte bitcoins må modnes %1 blokker før de kan brukes. Da du genererte denne blokken ble den kringkastet på nettverket for å bli lagt til i kjeden av blokker. Hvis den ikke kommer med i kjeden vil den endre seg til "ikke akseptert" og pengene vil ikke kunne brukes. Dette vil noen ganger skje hvis en annen node genererer en blokk noen sekunder i tid fra din egen. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Genererte bitcoins må modnes %1 blokker før de kan brukes. Da du genererte denne blokken ble den kringkastet på nettverket for å bli lagt til i kjeden av blokker. Hvis den ikke kommer med i kjeden vil den endre seg til "ikke akseptert" og pengene vil ikke kunne brukes. Dette vil noen ganger skje hvis en annen node genererer en blokk noen sekunder i tid fra din egen. Debug information @@ -2310,10 +2412,6 @@ Adresse: %4 Address Adresse - - Amount - Beløp - Immature (%1 confirmations, will be available after %2) Umoden (%1 bekreftelser, vil være tilgjengelig etter %2) @@ -2525,10 +2623,6 @@ Adresse: %4 Address Adresse - - Amount - Beløp - ID ID @@ -2542,6 +2636,13 @@ Adresse: %4 til + + UnitDisplayStatusBarControl + + Unit to show amounts in. Click to select another unit. + Enhet å vise beløper i. Klikk for å velge en annen enhet. + + WalletFrame @@ -2593,18 +2694,6 @@ Adresse: %4 bitcoin-core - - Usage: - Bruk: - - - List commands - List opp kommandoer - - - Get help for a command - Vis hjelpetekst for en kommando - Options: Innstillinger: @@ -2645,10 +2734,6 @@ Adresse: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Antall sekunder noder med dårlig oppførsel hindres fra å koble til på nytt (standardverdi: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - En feil oppstod ved opprettelse av RPC-port %u for IPv4: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Lytt etter JSON-RPC tilkoblinger på <port> (standardverdi: 8332 eller testnett: 18332) @@ -2657,10 +2742,6 @@ Adresse: %4 Accept command line and JSON-RPC commands Ta imot kommandolinje- og JSON-RPC-kommandoer - - Bitcoin Core RPC client version - Bitcoin Core RPC-klientversjon - Run in the background as a daemon and accept commands Kjør i bakgrunnen som daemon og ta imot kommandoer @@ -2683,7 +2764,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, du må angi rpcpassord i konfigurasjonsfilen. %s @@ -2694,16 +2775,12 @@ rpcpassord=%s Brukernavnet og passordet MÅ IKKE være like. Om filen ikke eksisterer, opprett den nå med eier-kun-les filrettigheter. Det er også anbefalt at å sette varselsmelding slik du får melding om problemer. -For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.com +For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Akseptable krypteringsmetoder (standardverdi: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - En feil oppstod under oppsettet av RPC-port %u for IPv6, tilbakestilles til IPv4: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Bind til angitt adresse. Bruk [vertsmaskin]:port notasjon for IPv6 @@ -2713,17 +2790,13 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Ratebegrens gratistransaksjoner kontinuerlig til <n>*1000 bytes per minutt (standard: 15) - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Gå til modus for regresjonstesting, som bruker en spesiell blokkjede der blokker kan bli løst momentant. Dette er tenkt til verktøy for regresjonstesting og apputvikling. + Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup + Slett alle transaksjoner i lommeboken og gjenopprett kun de delene av blokkjeden gjennom -rescan ved oppstart Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Gå til modus for regresjonstesting, som bruker en spesiell blokkjede der blokker kan bli løst momentant. - - Error: Listening for incoming connections failed (listen returned error %d) - Feil: Lytting etter innkommende tilkoblinger feilet (lytting returnerte feil %d) - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Feil: Transaksjonen ble avvist! Dette kan skje hvis noen av myntene i lommeboken allerede er blitt brukt, som om du brukte en kopi av wallet.dat og myntene ble brukt i kopien, men ikke markert som brukt her. @@ -2736,10 +2809,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Kjør kommando når en lommeboktransaksjon endres (%s i kommando er erstattet med TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - Gebyr mindre enn dette er betraktet som intet gebyr (for laging av transaksjoner) (standardverdi: - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) Overfør aktiviteten i databasen fra minnelageret til loggen på harddisken for hver <n> megabytes (standardverdi: 100) @@ -2776,10 +2845,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Advarsel: -paytxfee er satt veldig høyt! Dette er transaksjonsgebyret du betaler når du sender transaksjoner. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Advarsel: Vennligst undersøk at din datamaskin har riktig dato og klokkeslett! Hvis klokken er stilt feil vil ikke Bitcoin fungere riktig. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Advarsel: Nettverket ser ikke ut til å være enig! Noen minere ser ut til å ha problemer. @@ -2812,30 +2877,14 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Attempt to recover private keys from a corrupt wallet.dat Forsøk å berge private nøkler fra en korrupt wallet.dat - - Bitcoin Core Daemon - Bitcoin Core Daemon - Block creation options: Valg for opprettelse av blokker: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - Tøm listen over transaksjoner i lommeboken (diagnoseverktøy; impliserer -rescan) - Connect only to the specified node(s) Koble kun til angitt(e) node(r) - - Connect through SOCKS proxy - Koble til via SOCKS proxy - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - Koble til JSON-RPC på <port> (default: 8332 eller testnet: 18332) - Connection options: Innstillinger for tilkobling: @@ -2936,18 +2985,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Failed to write undo data Feil ved skriving av angredata - - Fee per kB to add to transactions you send - Gebyr per kB for transaksjoner du sender - - - Fees smaller than this are considered zero fee (for relaying) (default: - Gebyrer mindre enn dette vil anses som gebyrfrie (for videresending) (standard: - - - Find peers using DNS lookup (default: 1 unless -connect) - Finn andre noder gjennom DNS-oppslag (standardverdi: 1 med mindre -connect er oppgitt) - Force safe mode (default: 0) Tving sikkerhetsmodus (standard: 0) @@ -2973,8 +3010,8 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Ugyldig eller ingen skaperblokk funnet. Feil datamappe for nettverk? - Invalid -onion address: '%s' - Ugyldig -onion adresse: '%s' + Invalid -onion address: '%s' + Ugyldig -onion adresse: '%s' Not enough file descriptors available. @@ -2984,18 +3021,10 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Prepend debug output with timestamp (default: 1) Sett inn tidsstempel i front av feilsøkingsdata (standardverdi: 1) - - RPC client options: - Innstillinger for RPC-klient: - Rebuild block chain index from current blk000??.dat files Gjenopprett blokkjedeindeks fra blk000??.dat filer - - Select SOCKS version for -proxy (4 or 5, default: 5) - Velg versjon av SOCKS -proxy (4 eller 5, standardverdi: 5) - Set database cache size in megabytes (%d to %d, default: %d) Sett databasen sin størrelse på hurtigbufferen i megabytes (%d til %d, standardverdi: %d) @@ -3017,12 +3046,12 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Bruk ubekreftet veksel ved sending av transaksjoner (standardverdi: 1) - This is intended for regression testing tools and app development. - Dette er tiltenkt verktøy for regresjonstesting og apputvikling. + Stop running after importing blocks from disk (default: 0) + Avslutt etter import av blokker fra disk (standard: 0) - Usage (deprecated, use bitcoin-cli): - Bruk (foreldet, bruk bitcoin-cli): + This is intended for regression testing tools and app development. + Dette er tiltenkt verktøy for regresjonstesting og apputvikling. Verifying blocks... @@ -3032,10 +3061,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Verifying wallet... Verifiserer lommebok... - - Wait for RPC server to start - Vent på start av RPC-tjeneren - Wallet %s resides outside data directory %s Lommebok %s befinner seg utenfor datamappe %s @@ -3044,10 +3069,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Wallet options: Valg for lommebok: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - Advarsel: Utløpt argument -debugnet ignorert, bruk -debug=net - You need to rebuild the database using -reindex to change -txindex Du må gjenoppbygge databasen med å bruke -reindex for å endre -txindex @@ -3056,33 +3077,157 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Imports blocks from external blk000??.dat file Importerer blokker fra ekstern fil blk000??.dat + + (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + (standardverdi: 1, 1 = behold metadata for transaksjon som f. eks. kontoeier og informasjon om betalingsanmodning, 2 = dropp metadata for transaksjon) + + + Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times + Tillat JSON-RPC-tilkoblinger fra angitt kilde. Gyldig for <ip> er en enkelt IP (f. eks. 1.2.3.4), et nettverk/nettmaske (f. eks. 1.2.3.4/255.255.255.0) eller et nettverk/CIDR (f. eks. 1.2.3.4/24). Dette alternativet kan angis flere ganger + + + An error occurred while setting up the RPC address %s port %u for listening: %s + En feil oppstod under oppsett av RPC-adressen %s port %u for lytting: %s + + + Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6 + Bind til gitt adresse og hvitlist peers som kobler seg til den. Bruk [host]:port notasjon for IPv6 + + + Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces) + Bind til gitt adresse for å lytte for JSON-RPC-tilkoblinger. Bruk [host]:port notasjon for IPv6. Dette alternativet kan angis flere ganger (standardverdi: bind til alle grensesnitt) + Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. Ute av stand til å låse datamappen %s. Bitcoin Core kjører sannsynligvis allerede. + + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) + Opprett nye filer med standardtillatelser i systemet, i stedet for umask 077 (kun virksom med lommebokfunksjonalitet slått av) + + + Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + Distribuert under MIT/X11 programvarelisensen, se medfølgende fil COPYING eller <http://www.opensource.org/licenses/mit-license.php>. + + + Error: Listening for incoming connections failed (listen returned error %s) + Feil: Lytting etter innkommende tilkoblinger feilet (lytting returnerte feil %s) + + + Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + Feil: Argumentet -socks er ikke støttet. Det er ikke lenger mulig å sette SOCKS-versjon; bare SOCKS5-proxyer er støttet. + + + Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) + Utfør kommando når et nettverkstransaksjon gjenbruker inndata fra lommeboktransaksjonen (%s=gjenbruk TxID, %t=lommebok TxID) + Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Utfør kommando når et relevant varsel er mottatt eller vi ser en veldig lang gaffel (%s i kommando er erstattet med melding) + + Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) + Gebyrer (i BTC/Kb) mindre enn dette anses som null gebyr for videresending (standardverdi: %s) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) + Gebyrer (i BTC/Kb) mindre enn dette anses som null gebyr for laging av transaksjoner (standardverdi: %s) + + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) + Hvis paytxfee ikke er angitt, inkluderer da nok gebyr til at transaksjoner gjennomsnittligt bekreftes innen n blokker (standardverdi: 1) + Output debugging information (default: 0, supplying <category> is optional) Ta ut feilsøkingsinformasjon (standardverdi: 0, bruk av <category> er valgfritt) + + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) + Søk etter nodeadresser via DNS-oppslag, hvis vi har få adresser å koble til (standard: 1 med mindre -connect) + Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Sett maksimum størrelse for transaksjoner med høy prioritet / lavt gebyr, i bytes (standardverdi: %d) + + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. + Dette produktet inneholder programvare utviklet av OpenSSL Project for bruk i OpenSSL Toolkit <https://www.openssl.org/> og kryptografisk programvare skrevet av Eric Young og UPnP-programvare skrevet av Thomas Bernard. + + + Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + Advarsel: Vennligst undersøk at din datamaskin har riktig dato og klokkeslett! Hvis klokken er stilt feil vil ikke Bitcoin Core fungere riktig. + + + Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. + Hvitelist noder som kobler til fra den oppgitte nettmasken eller IP-adressen. Kan oppgis flere ganger. + + + Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway + Hvitlistede noder kan ikke DoS-blokkeres, og deres transaksjoner videresendes alltid, selv om de allerede er i minnelageret. Nyttig f.eks. for en gateway. + + + Always query for peer addresses via DNS lookup (default: 0) + Alltid søk etter nodeadresser via DNS-oppslag (standardverdi: 0) + + + Cannot resolve -whitebind address: '%s' + Kan ikke løse -whitebind-adresse: '%s' + + + Connect through SOCKS5 proxy + Koble til via SOCKS5-proxy + + + Copyright (C) 2009-%i The Bitcoin Core Developers + Copyright (C) 2009-%i utviklerne av Bitcoin Core + + + Could not parse -rpcbind value %s as network address + Kunne ikke tolke -rpcbind-verdi %s som en nettverksadresse + + + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core + Feil ved lasting av wallet.dat: Lommeboken krever en nyere versjon av Bitcoin Core + + + Error: Unsupported argument -tor found, use -onion. + Feil: Argumentet -tor er ikke støttet, bruk -onion. + + + Fee (in BTC/kB) to add to transactions you send (default: %s) + Gebyr (i BTC/kB) for å legge til i transaksjoner du sender (standardverdi: %s) + + + Include IP addresses in debug output (default: 0) + Inkludere IP-adresser i feilsøkingslogg (standard: 0) + Information Informasjon - Invalid amount for -minrelaytxfee=<amount>: '%s' - Ugyldig mengde for -minrelaytxfee=<beløp>: '%s' + Initialization sanity check failed. Bitcoin Core is shutting down. + Sunnhetssjekk ved oppstart feilet. Bitcoin Core stenges ned. - Invalid amount for -mintxfee=<amount>: '%s' - Ugyldig mengde for -mintxfee=<beløp>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Ugyldig mengde for -minrelaytxfee=<beløp>: '%s' + + + Invalid amount for -mintxfee=<amount>: '%s' + Ugyldig mengde for -mintxfee=<beløp>: '%s' + + + Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) + Ugyldig beløp for -paytxfee=<amount>: '%s' (må være minst %s) + + + Invalid netmask specified in -whitelist: '%s' + Ugyldig nettmaske spesifisert i -whitelist: '%s' + + + Keep at most <n> unconnectable blocks in memory (default: %u) + Behold på det meste <n> blokker i minnet som ikke er mulig å koble (standardverdi: %u) Limit size of signature cache to <n> entries (default: 50000) @@ -3104,6 +3249,14 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) Maks sendebuffer per forbindelse, <n>*1000 bytes (standardverdi: 1000) + + Need to specify a port with -whitebind: '%s' + Må oppgi en port med -whitebind: '%s' + + + Node relay options: + Node alternativer for videresending: + Only accept block chain matching built-in checkpoints (default: 1) Aksepter kun en blokkjede som passer med innebygde sjekkpunkter (standardvalg: 1) @@ -3136,18 +3289,18 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Randomly fuzz 1 of every <n> network messages Slumpvis bland 1 av hver <n> nettverksmeldinger + + Relay and mine data carrier transactions (default: 1) + Videresend og ufør graving av databærende transaksjoner (standardverdi: 1) + + + Relay non-P2SH multisig (default: 1) + Videresende ikke-P2SH multisig (standard: 1) + Run a thread to flush wallet periodically (default: 1) Kjør en tråd som skriver lommeboken til disk periodisk (standard: 1) - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL valg: (se Bitcoin Wiki for instruksjoner for oppsett av SSL) - - - Send command to Bitcoin Core - Send kommando til Bitcoin Core - Send trace/debug info to console instead of debug.log file Send spor-/feilsøkingsinformasjon til konsollen istedenfor filen debug.log @@ -3164,10 +3317,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Show all debugging options (usage: --help -help-debug) Vis alle feilsøkingsvalg (bruk: --help -help-debug) - - Show benchmark information (default: 0) - Vis informasjon om ytelsesmål (standard: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Krymp filen debug.log når klienten starter (standardverdi: 1 hvis uten -debug) @@ -3180,14 +3329,14 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Specify connection timeout in milliseconds (default: 5000) Angi tidsavbrudd for forbindelse i millisekunder (standardverdi: 5000) - - Start Bitcoin Core Daemon - Start Bitcoin Core Daemon - System error: Systemfeil: + + This is experimental software. + Dette er eksperimentell programvare. + Transaction amount too small Transaksjonen er for liten @@ -3200,6 +3349,10 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Transaction too large Transaksjonen er for stor + + Unable to bind to %s on this computer (bind returned error %s) + Kan ikke binde til %s på denne datamaskinen (binding returnerte feilen %s) + Use UPnP to map the listening port (default: 0) Bruk UPnP for lytteport (standardverdi: 0) @@ -3212,6 +3365,10 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Username for JSON-RPC connections Brukernavn for JSON-RPC forbindelser + + Wallet needed to be rewritten: restart Bitcoin Core to complete + Lommeboken måtte skrives på nytt: start Bitcoin Core på nytt for å fullføre + Warning Advarsel @@ -3220,6 +3377,14 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Warning: This version is obsolete, upgrade required! Advarsel: Denne versjonen er foreldet, oppgradering kreves! + + Warning: Unsupported argument -benchmark ignored, use -debug=bench. + Advarsel: Argumentet -benchmark er ikke støttet og ble ignorert, bruk -debug=bench. + + + Warning: Unsupported argument -debugnet ignored, use -debug=net. + Advarsel: Argumentet -debugnet er ikke støttet og ble ignorert, bruk -debug=net. + Zapping all transactions from wallet... Zapper alle transaksjoner fra lommeboken... @@ -3228,10 +3393,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ on startup ved oppstart - - version - versjon - wallet.dat corrupt, salvage failed wallet.dat korrupt, bergning feilet @@ -3240,14 +3401,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Password for JSON-RPC connections Passord for JSON-RPC forbindelser - - Allow JSON-RPC connections from specified IP address - Tillat JSON-RPC tilkoblinger fra angitt IP-adresse - - - Send commands to node running on <ip> (default: 127.0.0.1) - Send kommandoer til node på <ip> (standardverdi: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Utfør kommando når beste blokk endrer seg (%s i kommandoen erstattes med blokkens hash) @@ -3280,10 +3433,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ This help message Denne hjelpemeldingen - - Unable to bind to %s on this computer (bind returned error %d, %s) - Kan ikke binde til %s på denne datamaskinen (bind returnerte feil %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Tillat oppslag i DNS for -addnode, -seednode og -connect @@ -3296,41 +3445,29 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Error loading wallet.dat: Wallet corrupted Feil ved lasting av wallet.dat: Lommeboken er skadet - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Feil ved lasting av wallet.dat: Lommeboken krever en nyere versjon av Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - Lommeboken måtte skrives om: start Bitcoin på nytt for å fullføre - Error loading wallet.dat Feil ved lasting av wallet.dat - Invalid -proxy address: '%s' - Ugyldig -proxy adresse: '%s' + Invalid -proxy address: '%s' + Ugyldig -proxy adresse: '%s' - Unknown network specified in -onlynet: '%s' - Ukjent nettverk angitt i -onlynet '%s' + Unknown network specified in -onlynet: '%s' + Ukjent nettverk angitt i -onlynet '%s' - Unknown -socks proxy version requested: %i - Ukjent -socks proxyversjon angitt: %i + Cannot resolve -bind address: '%s' + Kunne ikke slå opp -bind adresse: '%s' - Cannot resolve -bind address: '%s' - Kunne ikke slå opp -bind adresse: '%s' + Cannot resolve -externalip address: '%s' + Kunne ikke slå opp -externalip adresse: '%s' - Cannot resolve -externalip address: '%s' - Kunne ikke slå opp -externalip adresse: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Ugyldig beløp for -paytxfee=<beløp>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Ugyldig beløp for -paytxfee=<beløp>: '%s' Invalid amount @@ -3376,13 +3513,5 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@ Error Feil - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Du må sette rpcpassword=<passord> i konfigurasjonsfilen: -%s -Hvis filen ikke finnes, opprett den med leserettighet kun for eier av filen. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_nl.ts b/src/qt/locale/bitcoin_nl.ts index 8cbbbdad7f..0a9c6e2efa 100644 --- a/src/qt/locale/bitcoin_nl.ts +++ b/src/qt/locale/bitcoin_nl.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - Over Bitcoin Core - - - <b>Bitcoin Core</b> version - <b> Bitcoin Core</b> versie - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Dit is experimentele software. - -Gedistribueerd onder de MIT/X11 software licentie, zie het bijgevoegde bestand COPYING of http://www.opensource.org/licenses/mit-license.php. - -Dit product bevat software ontwikkeld door het OpenSSL Project voor gebruik in de OpenSSL Toolkit (http://www.openssl.org/) en cryptografische software gemaakt door Eric Young (eay@cryptsoft.com) en UPnP software geschreven door Thomas Bernard. - - - Copyright - Auteursrecht - - - The Bitcoin Core developers - De Bitcoin Core ontwikkelaars - - - (%1-bit) - (%1-bit) - - + AddressBookPage @@ -131,8 +94,8 @@ Dit product bevat software ontwikkeld door het OpenSSL Project voor gebruik in d Export Mislukt - There was an error trying to save the address list to %1. - Een fout is opgetreden tijdens het opslaan van deze adreslijst naar %1. + There was an error trying to save the address list to %1. Please try again. + Een fout is opgetreden tijdens het opslaan van deze adreslijst naar %1. Probeer het nogmaals. @@ -168,10 +131,6 @@ Dit product bevat software ontwikkeld door het OpenSSL Project voor gebruik in d Repeat new passphrase Herhaal nieuw wachtwoord - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Vul een nieuw wachtwoord in voor uw portemonnee. <br/> Gebruik een wachtwoord van <b>10 of meer lukrake karakters</b>, of <b>acht of meer woorden</b> . - Encrypt wallet Versleutel portemonnee @@ -295,10 +254,6 @@ Dit product bevat software ontwikkeld door het OpenSSL Project voor gebruik in d Quit application Programma afsluiten - - Show information about Bitcoin - Laat informatie zien over Bitcoin - About &Qt Over &Qt @@ -459,10 +414,6 @@ Dit product bevat software ontwikkeld door het OpenSSL Project voor gebruik in d Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options Toon het Bitcoin Core hulpbericht om een lijst te krijgen met mogelijke Bitcoin commandoregelopties - - Bitcoin client - Bitcoin client - %n active connection(s) to Bitcoin network %n actieve connectie naar Bitcoinnetwerk%n actieve connecties naar Bitcoinnetwerk @@ -471,10 +422,6 @@ Dit product bevat software ontwikkeld door het OpenSSL Project voor gebruik in d No block source available... Geen bron van blokken beschikbaar... - - Processed %1 of %2 (estimated) blocks of transaction history. - %1 van %2 (geschat) blokken van de transactiehistorie verwerkt. - Processed %1 blocks of transaction history. %1 blokken van transactiehistorie verwerkt. @@ -559,10 +506,6 @@ Adres: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Portemonnee is <b>versleuteld</b> en momenteel <b>gesloten</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Er is een fatale fout opgetreden. Bitcoin kan niet meer veilig doorgaan en zal nu afgesloten worden. - ClientModel @@ -597,10 +540,6 @@ Adres: %4 Fee: Vergoeding: - - Low Output: - Lage uitvoer: - After Fee: Na vergoeding: @@ -689,10 +628,6 @@ Adres: %4 Copy priority Kopieer prioriteit - - Copy low output - Kopieer lage uitvoer - Copy change Kopieer wisselgeld @@ -741,10 +676,6 @@ Adres: %4 none geen - - Dust - Stof - yes ja @@ -770,25 +701,13 @@ Adres: %4 Transacties met een hogere prioriteit zullen eerder in een block gezet worden. - This label turns red, if the priority is smaller than "medium". - Als dit label rood is, is de prioriteit minder dan "medium". + This label turns red, if the priority is smaller than "medium". + Als dit label rood is, is de prioriteit minder dan "medium". This label turns red, if any recipient receives an amount smaller than %1. Dit label wordt rood, als een ontvanger een bedrag van minder dan %1 gekregen heeft. - - This means a fee of at least %1 is required. - Dit betekend dat een minimale vergoeding van %1 nodig is. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - Bedragen beneden 0.546 keer het minimum relais vergoeding, worden als stof aangemerkt. - - - This label turns red, if the change is smaller than %1. - Dit label wordt rood, als de wijziging is kleiner dan %1. - (no label) (geen label) @@ -841,12 +760,12 @@ Adres: %4 Bewerk adres om naar te verzenden - The entered address "%1" is already in the address book. - Het opgegeven adres "%1" bestaat al in uw adresboek. + The entered address "%1" is already in the address book. + Het opgegeven adres "%1" bestaat al in uw adresboek. - The entered address "%1" is not a valid Bitcoin address. - Het opgegeven adres "%1" is een ongeldig Bitcoinadres + The entered address "%1" is not a valid Bitcoin address. + Het opgegeven adres "%1" is een ongeldig Bitcoinadres Could not unlock wallet. @@ -882,10 +801,6 @@ Adres: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Bitcoin Core - Commandoregel-opties - Bitcoin Core Bitcoin Kern @@ -894,6 +809,18 @@ Adres: %4 version versie + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + Over Bitcoin Core + + + Command-line options + Commandoregel-opties + Usage: Gebruik: @@ -907,8 +834,8 @@ Adres: %4 gebruikersinterfaceopties - Set language, for example "de_DE" (default: system locale) - Stel taal in, bijvoorbeeld ''de_DE" (standaard: systeeminstellingen) + Set language, for example "de_DE" (default: system locale) + Stel taal in, bijvoorbeeld ''de_DE" (standaard: systeeminstellingen) Start minimized @@ -954,12 +881,8 @@ Adres: %4 Gebruik een persoonlijke gegevensmap: - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - Fout: Opgegeven gegevensmap "%1" kan niet aangemaakt worden. + Bitcoin Core + Bitcoin Kern Error @@ -1049,7 +972,7 @@ Adres: %4 Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - Derde partijen URL's (bijvoorbeeld block explorer) dat in de transacties tab verschijnen als contextmenu elementen. %s in de URL is vervangen door transactie hash. Verscheidene URL's zijn gescheiden door een verticale streep |. + Derde partijen URL's (bijvoorbeeld block explorer) dat in de transacties tab verschijnen als contextmenu elementen. %s in de URL is vervangen door transactie hash. Verscheidene URL's zijn gescheiden door een verticale streep |. Third party transaction URLs @@ -1115,14 +1038,6 @@ Adres: %4 Port of the proxy (e.g. 9050) Poort van de proxy (bijv. 9050) - - SOCKS &Version: - SOCKS-&Versie: - - - SOCKS version of the proxy (e.g. 5) - SOCKS-versie van de proxy (bijv. 5) - &Window &Scherm @@ -1163,14 +1078,6 @@ Adres: %4 Choose the default subdivision unit to show in the interface and when sending coins. Kies de standaard onderverdelingseenheid om weer te geven in uw programma, en voor het versturen van munten - - Whether to show Bitcoin addresses in the transaction list or not. - Of Bitcoinadressen getoond worden in de transactielijst - - - &Display addresses in transaction list - Toon a&dressen in de transactielijst - Whether to show coin control features or not. Munt controle functies weergeven of niet. @@ -1274,8 +1181,8 @@ Adres: %4 URI-behandeling - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI kan niet worden geïnterpreteerd. Dit kan komen door een ongeldig Bitcoinadres of misvormde URI-parameters. + Invalid payment address %1 + Ongeldig betalingsadres %1 Requested payment amount of %1 is too small (considered dust). @@ -1289,14 +1196,6 @@ Adres: %4 Cannot start bitcoin: click-to-pay handler Kan bitcoin niet starten: click-to-pay handler - - Net manager warning - Netmanager waarschuwing - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - Uw actieve proxy ondersteunt geen SOCKS5, dewelke vereist is voor betalingsverzoeken via proxy. - Payment request fetch URL is invalid: %1 URL om betalingsverzoek te verkrijgen is ongeldig: %1 @@ -1305,10 +1204,6 @@ Adres: %4 Payment request file handling Betalingsverzoek bestandsafhandeling - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - Betalingsverzoek-bestand kan niet gelezen of verwerkt worden! Dit kan veroorzaakt worden door een ongeldig betalingsverzoek-bestand. - Unverified payment requests to custom payment scripts are unsupported. Niet-geverifieerde betalingsverzoeken naar aangepaste betaling scripts worden niet ondersteund. @@ -1321,10 +1216,6 @@ Adres: %4 Error communicating with %1: %2 Fout bij communiceren met %1: %2 - - Payment request can not be parsed or processed! - Betalingsverzoek kan niet juist worden ontleed of verwerkt! - Bad response from server %1 Ongeldige respons van server %1 @@ -1338,33 +1229,28 @@ Adres: %4 Netwerkfout bij verzoek + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Bedrag - Error: Specified data directory "%1" does not exist. - Fout: Opgegeven gegevensmap "%1" bestaat niet. + %1 h + %1 uur - Error: Cannot parse configuration file: %1. Only use key=value syntax. - Fout: Kan configuratiebestand niet parsen: %1. Gebruik enkel de key=value syntax. + %1 m + %1 m - Error: Invalid combination of -regtest and -testnet. - Fout: Ongeldige combinatie van -regtest en -testnet + N/A + N.v.t. - - Bitcoin Core didn't yet exit safely... - Bitcoin Core is nog niet veilig uitgeschakeld... - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Vul een Bitcoinadres in (bijv. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget @@ -1438,10 +1324,6 @@ Adres: %4 Current number of blocks Huidig aantal blokken - - Estimated total blocks - Geschat totaal aantal blokken - Last block time Tijd laatste blok @@ -1500,7 +1382,7 @@ Adres: %4 Type <b>help</b> for an overview of available commands. - Typ <b>help</b> voor een overzicht van de beschikbare commando's. + Typ <b>help</b> voor een overzicht van de beschikbare commando's. %1 B @@ -1518,19 +1400,7 @@ Adres: %4 %1 GB %1 Gb - - %1 m - %1 m - - - %1 h - %1 uur - - - %1 h %2 m - %1 h %2 m - - + ReceiveCoinsDialog @@ -1742,10 +1612,6 @@ Adres: %4 Fee: Vergoeding: - - Low Output: - Lage uitvoer: - After Fee: Na vergoeding: @@ -1822,10 +1688,6 @@ Adres: %4 Copy priority Kopieer prioriteit - - Copy low output - Kopieer lage uitvoer - Copy change Kopieer wijziging @@ -1886,14 +1748,6 @@ Adres: %4 added as transaction fee toegevoegd als transactiekosten - - Payment request expired - Betalingsverzoek verlopen - - - Invalid payment address %1 - Ongeldig betalingsadres %1 - SendCoinsEntry @@ -1905,10 +1759,6 @@ Adres: %4 Pay &To: Betaal &Aan: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Het adres waaraan u wilt betalen (bijv. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Vul een label in voor dit adres om het toe te voegen aan uw adresboek @@ -1995,10 +1845,6 @@ Adres: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. U kunt berichten ondertekenen met een van uw adressen om te bewijzen dat u dit adres bezit. Pas op dat u geen onduidelijke dingen ondertekent, want phishingaanvallen zouden u kunnen misleiden om zo uw identiteit te stelen. Onderteken alleen berichten waarmee u het volledig eens bent. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Het adres om het bericht mee te ondertekenen (Vb.: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L). - Choose previously used address Kies een eerder gebruikt adres @@ -2051,10 +1897,6 @@ Adres: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Voer het ondertekenende adres, bericht en handtekening hieronder in (let erop dat u nieuwe regels, spaties en tabs juist overneemt) om de handtekening te verifiëren. Let erop dat u niet meer uit het bericht interpreteert dan er daadwerkelijk staat, om te voorkomen dat u wordt misleid in een man-in-the-middle-aanval. - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Het adres waarmee bet bericht was ondertekend (Vb.: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L). - Verify the message to ensure it was signed with the specified Bitcoin address Controleer een bericht om te verifiëren dat het gespecificeerde Bitcoinadres het bericht heeft ondertekend. @@ -2068,12 +1910,8 @@ Adres: %4 Verwijder alles in de invulvelden - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Vul een Bitcoinadres in (bijv. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Klik "Onderteken Bericht" om de handtekening te genereren + Click "Sign Message" to generate signature + Klik "Onderteken Bericht" om de handtekening te genereren The entered address is invalid. @@ -2245,8 +2083,8 @@ Adres: %4 Handelaar - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - Gegenereerde munten moeten %1 blokken rijpen voordat ze kunnen worden besteed. Toen dit blok gegenereerd werd, werd het uitgezonden naar het netwerk om aan de blokketen toegevoegd te worden. Als het niet lukt om in de keten toegevoegd te worden, zal de status te veranderen naar "niet geaccepteerd" en het zal deze niet besteedbaar zijn. Dit kan soms gebeuren als een ander knooppunt een blok genereert binnen een paar seconden na die van u. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Gegenereerde munten moeten %1 blokken rijpen voordat ze kunnen worden besteed. Toen dit blok gegenereerd werd, werd het uitgezonden naar het netwerk om aan de blokketen toegevoegd te worden. Als het niet lukt om in de keten toegevoegd te worden, zal de status te veranderen naar "niet geaccepteerd" en het zal deze niet besteedbaar zijn. Dit kan soms gebeuren als een ander knooppunt een blok genereert binnen een paar seconden na die van u. Debug information @@ -2310,10 +2148,6 @@ Adres: %4 Address Adres - - Amount - Bedrag - Immature (%1 confirmations, will be available after %2) immatuur (%1 bevestigingen, zal beschikbaar zijn na %2) @@ -2525,10 +2359,6 @@ Adres: %4 Address Adres - - Amount - Bedrag - ID ID @@ -2542,6 +2372,9 @@ Adres: %4 naar + + UnitDisplayStatusBarControl + WalletFrame @@ -2593,18 +2426,6 @@ Adres: %4 bitcoin-core - - Usage: - Gebruik: - - - List commands - Lijst van commando's - - - Get help for a command - Toon hulp voor een commando - Options: Opties: @@ -2647,25 +2468,17 @@ Adres: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Aantal seconden dat zich misdragende peers niet opnieuw mogen verbinden (standaard: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Er is een fout opgetreden tijdens het instellen van de inkomende RPC-poort %u op IPv4: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Wacht op JSON-RPC-connecties op poort <port> (standaard: 8332 of testnet: 18332) Accept command line and JSON-RPC commands - Aanvaard commandoregel- en JSON-RPC-commando's - - - Bitcoin Core RPC client version - Bitcoin Core RPC-client versie + Aanvaard commandoregel- en JSON-RPC-commando's Run in the background as a daemon and accept commands - Draai in de achtergrond als daemon en aanvaard commando's + Draai in de achtergrond als daemon en aanvaard commando's Use the test network @@ -2685,7 +2498,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, u moet een RPC-wachtwoord instellen in het configuratiebestand: %s U wordt aangeraden het volgende willekeurige wachtwoord te gebruiken: @@ -2694,17 +2507,13 @@ rpcpassword=%s (u hoeft dit wachtwoord niet te onthouden) De gebruikersnaam en wachtwoord mogen niet hetzelfde zijn. Als het bestand niet bestaat, make hem dan aan met leesrechten voor enkel de eigenaar. -Het is ook aan te bevelen "alertnotify" in te stellen zodat u op de hoogte gesteld wordt van problemen; -bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +Het is ook aan te bevelen "alertnotify" in te stellen zodat u op de hoogte gesteld wordt van problemen; +bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Aanvaardbare cijfers (standaard: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Er is een fout opgetreden tijdens het instellen van de inkomende RPC-poort %u op IPv6, terugval naar IPv4: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Bind aan opgegeven adres en luister er altijd op. Gebruik [host]:port notatie voor IPv6 @@ -2713,18 +2522,10 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) Doorlopend tarief-limiet op gratis transacties toepassen tot <n>*1000 bytes per minuut (standaard: 15) - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Schakel regressietest-modus in, die een speciale blokketen gebruikt waarin blokken instantaan opgelost kunnen worden. Dit is bedoeld voor regressietestsoftware en app-ontwikkeling. - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Schakel regressietest-modus in, die een speciale blokketen gebruikt waarin blokken onmiddellijk opgelost kunnen worden. - - Error: Listening for incoming connections failed (listen returned error %d) - Fout: Luisteren naar inkomende connecties mislukt (listen geeft fout terug %d) - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Fout: De transactie was afgewezen! Dit kan gebeuren als sommige munten in uw portemonnee al eerder uitgegeven zijn, zoals wanneer u een kopie van uw wallet.dat heeft gebruikt en in de kopie deze munten zijn uitgegeven, maar in deze portemonnee die munten nog niet als zodanig zijn gemarkeerd. @@ -2737,10 +2538,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Voer opdracht uit zodra een portemonneetransactie verandert (%s in cmd wordt vervangen door TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - Toeslagen kleiner dan dit worden beschouwd als geen vergoeding (voor transactie aanmaak) (standaard: - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) Leeg database-activiteit uit de geheugenpool naar schijf log elke <n> megabytes (standaard: 100) @@ -2771,16 +2568,12 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Gebruik een aparte SOCKS5 proxy om 'Tor hidden services' te bereiken (standaard: hetzelfde als -proxy) + Gebruik een aparte SOCKS5 proxy om 'Tor hidden services' te bereiken (standaard: hetzelfde als -proxy) Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Waarschuwing: -paytxfee is zeer hoog ingesteld. Dit zijn de transactiekosten die u betaalt bij het versturen van een transactie. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Waarschuwing: Controleer dat de datum en tijd op uw computer correct zijn ingesteld. Als uw klok fout staat zal Bitcoin niet correct werken. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Waarschuwing: Het lijkt erop dat het netwerk geen consensus kan vinden! Sommige delvers lijken problemen te ondervinden. @@ -2791,7 +2584,7 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - Waarschuwing: Fout bij het lezen van wallet.dat! Alle sleutels zijn in goede orde uitgelezen, maar transactiedata of adresboeklemma's zouden kunnen ontbreken of fouten bevatten. + Waarschuwing: Fout bij het lezen van wallet.dat! Alle sleutels zijn in goede orde uitgelezen, maar transactiedata of adresboeklemma's zouden kunnen ontbreken of fouten bevatten. Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. @@ -2813,30 +2606,14 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Attempt to recover private keys from a corrupt wallet.dat Poog de geheime sleutels uit een corrupt wallet.dat bestand terug te halen - - Bitcoin Core Daemon - Bitcoin Core Daemon - Block creation options: Blokcreatie-opties: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - Leeg lijst met wallet transacties (diagnostisch instrument; impliceert -rescan) - Connect only to the specified node(s) Verbind alleen naar de gespecificeerde node(s) - - Connect through SOCKS proxy - Verbind via een SOCKS-proxy - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - Verbinden met JSON-RPC op <poort> (standaard: 8332 of testnet: 18332) - Connection options: Verbindingsopties: @@ -2937,18 +2714,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Failed to write undo data Schrijven van undo-data mislukt - - Fee per kB to add to transactions you send - Transactiekosten per kB om toe te voegen aan transacties die u verzendt - - - Fees smaller than this are considered zero fee (for relaying) (default: - Toeslagen kleiner dan dit worden beschouwd als geen vergoeding (voor relaying) (standaard: - - - Find peers using DNS lookup (default: 1 unless -connect) - Vind andere nodes d.m.v. DNS-naslag (standaard: 1 tenzij -connect) - Force safe mode (default: 0) Forceer veilige modus (default: 0) @@ -2974,8 +2739,8 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Incorrect of geen genesis-blok gevonden. Verkeerde datamap voor het netwerk? - Invalid -onion address: '%s' - Ongeldig -onion adres '%s' + Invalid -onion address: '%s' + Ongeldig -onion adres '%s' Not enough file descriptors available. @@ -2985,18 +2750,10 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Prepend debug output with timestamp (default: 1) Prepend debug output met tijdstempel (standaard: 1) - - RPC client options: - RPC client opties: - Rebuild block chain index from current blk000??.dat files Blokketen opnieuw opbouwen met behulp van huidige blk000??.dat-bestanden - - Select SOCKS version for -proxy (4 or 5, default: 5) - Selecteer de versie van de SOCKS-proxy om te gebruiken (4 of 5, standaard is 5) - Set database cache size in megabytes (%d to %d, default: %d) Zet database cache grootte in megabytes (%d tot %d, standaard: %d) @@ -3021,10 +2778,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo This is intended for regression testing tools and app development. Dit is bedoeld voor regressie test toepassingen en applicatie onwikkeling. - - Usage (deprecated, use bitcoin-cli): - Gebruik (vervangen; gebruik Bitcoin-cli); - Verifying blocks... Blokken aan het controleren... @@ -3033,10 +2786,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Verifying wallet... Portemonnee aan het controleren... - - Wait for RPC server to start - Wacht voor RPC server om te starten - Wallet %s resides outside data directory %s Portemonnee %s bevindt zich buiten de gegevensmap %s @@ -3045,10 +2794,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Wallet options: Portemonnee instellingen: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - Waarschuwing: Afgekeurd argument -debugnet genegeerd, use -debug=net - You need to rebuild the database using -reindex to change -txindex Om -txindex te kunnen veranderen dient u de database opnieuw te bouwen met gebruik van -reindex. @@ -3078,12 +2823,12 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Informatie - Invalid amount for -minrelaytxfee=<amount>: '%s' - Ongeldig bedrag voor -minrelaytxfee=<bedrag>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Ongeldig bedrag voor -minrelaytxfee=<bedrag>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - Ongeldig bedrag voor -mintxfee=<bedrag>: '%s' + Invalid amount for -mintxfee=<amount>: '%s' + Ongeldig bedrag voor -mintxfee=<bedrag>: '%s' Limit size of signature cache to <n> entries (default: 50000) @@ -3141,14 +2886,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Run a thread to flush wallet periodically (default: 1) Draai een proces om de wallet periodiek te flushen (default: 1) - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL-opties: (zie de Bitcoin wiki voor SSL-instructies) - - - Send command to Bitcoin Core - Stuur commando naar Bitcoin Core - Send trace/debug info to console instead of debug.log file Stuur trace/debug-info naar de console in plaats van het debug.log bestand @@ -3165,10 +2902,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Show all debugging options (usage: --help -help-debug) Toon alle foutopsporingsopties (gebruik: --help -help-debug) - - Show benchmark information (default: 0) - Toon benchmark-informatie (default: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Verklein debug.log-bestand bij het opstarten van de client (standaard: 1 als geen -debug) @@ -3181,10 +2914,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Specify connection timeout in milliseconds (default: 5000) Specificeer de time-outtijd in milliseconden (standaard: 5000) - - Start Bitcoin Core Daemon - Start Bitcoin Core Daemon - System error: Systeemfout: @@ -3229,10 +2958,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo on startup bij opstarten - - version - versie - wallet.dat corrupt, salvage failed wallet.dat corrupt, veiligstellen mislukt @@ -3241,14 +2966,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Password for JSON-RPC connections Wachtwoord voor JSON-RPC-verbindingen - - Allow JSON-RPC connections from specified IP address - Sta JSON-RPC verbindingen van opgegeven IP-adres toe - - - Send commands to node running on <ip> (default: 127.0.0.1) - Verstuur commando's naar proces dat op <ip> draait (standaard: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Voer commando uit zodra het beste blok verandert (%s in cmd wordt vervangen door blockhash) @@ -3281,10 +2998,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo This help message Dit helpbericht - - Unable to bind to %s on this computer (bind returned error %d, %s) - Niet in staat om aan %s te binden op deze computer (bind gaf error %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Sta DNS-naslag toe voor -addnode, -seednode en -connect @@ -3297,41 +3010,29 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Error loading wallet.dat: Wallet corrupted Fout bij laden wallet.dat: Portemonnee corrupt - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Fout bij laden wallet.dat: Portemonnee vereist een nieuwere versie van Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - Portemonnee moest herschreven worden: Herstart Bitcoin om te voltooien - Error loading wallet.dat Fout bij laden wallet.dat - Invalid -proxy address: '%s' - Ongeldig -proxy adres: '%s' + Invalid -proxy address: '%s' + Ongeldig -proxy adres: '%s' - Unknown network specified in -onlynet: '%s' - Onbekend netwerk gespecificeerd in -onlynet: '%s' + Unknown network specified in -onlynet: '%s' + Onbekend netwerk gespecificeerd in -onlynet: '%s' - Unknown -socks proxy version requested: %i - Onbekende -socks proxyversie aangegeven: %i + Cannot resolve -bind address: '%s' + Kan -bind adres niet herleiden: '%s' - Cannot resolve -bind address: '%s' - Kan -bind adres niet herleiden: '%s' + Cannot resolve -externalip address: '%s' + Kan -externlip adres niet herleiden: '%s' - Cannot resolve -externalip address: '%s' - Kan -externlip adres niet herleiden: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Ongeldig bedrag voor -paytxfee=<bedrag>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Ongeldig bedrag voor -paytxfee=<bedrag>: '%s' Invalid amount @@ -3377,13 +3078,5 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Error Fout - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - U dient rpcpassword=<wachtwoord> in te stellen in het configuratiebestand: -%s -Als het bestand niet bestaat, maak het dan aan, met een alleen-lezen permissie. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_pam.ts b/src/qt/locale/bitcoin_pam.ts index 22f1b7ccc3..d109c24423 100644 --- a/src/qt/locale/bitcoin_pam.ts +++ b/src/qt/locale/bitcoin_pam.ts @@ -1,39 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Metung ya ining experimental software. -Me-distribute ya lalam na ning lisensya na ning MIT/X11 software, lawan ye ing makayabeng file COPYING o http://www.opensource.org/licenses/mit-license.php. -Ing produktung ini atin yang makayabeng software a gewa dareng OpenSSL Project para gamit king OpenSSL Toolkit(http://www.openssl.org/) at cryptographic software a sinulat ng Eric Young (eay@cryptsoft.com) at UPnp software a sinulat ng Thomas Bernard. - - - Copyright - Karapatan ning Pamangopya - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -44,22 +9,10 @@ Ing produktung ini atin yang makayabeng software a gewa dareng OpenSSL Project p Create a new address Maglalang kang bayung address - - &New - - Copy the currently selected address to the system clipboard Kopyan me ing salukuyan at makipiling address keng system clipboard - - &Copy - - - - C&lose - - &Copy Address &Kopyan ing address @@ -68,46 +21,14 @@ Ing produktung ini atin yang makayabeng software a gewa dareng OpenSSL Project p Delete the currently selected address from the list Ilako ya ing kasalungsungan makapiling address keng listahan - - Export the data in the current tab to a file - - - - &Export - - &Delete &Ilako - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. Reni reng kekang Bitcoin address king pamagpadalang kabayaran. Lawan mulang masalese reng alaga ampo ing address na ning tumanggap bayu ka magpadalang barya. - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - Copy &Label Kopyan ing &Label @@ -116,23 +37,11 @@ Ing produktung ini atin yang makayabeng software a gewa dareng OpenSSL Project p &Edit &Alilan - - Export Address List - - Comma separated file (*.csv) Comma separated file (*.csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -166,10 +75,6 @@ Ing produktung ini atin yang makayabeng software a gewa dareng OpenSSL Project p Repeat new passphrase Pasibayuan ya ing bayung passphrase - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Palub ye ing bayung passphrase king wallet.<br/>Maliari pu sanang gumamit kayung passphrase a maki</b> 10 or dakal pang miyayaliuang characters</b>, o ualu o dakal pang salita</b> - Encrypt wallet I-encrypt ye ing wallet @@ -269,10 +174,6 @@ Ing produktung ini atin yang makayabeng software a gewa dareng OpenSSL Project p &Overview &Overview - - Node - - Show general overview of wallet Ipakit ing kabuuang lawe ning wallet @@ -293,10 +194,6 @@ Ing produktung ini atin yang makayabeng software a gewa dareng OpenSSL Project p Quit application Tuknangan ing aplikasyon - - Show information about Bitcoin - Ipakit ing impormasyun tungkul king Bitcoin - About &Qt Tungkul &Qt @@ -321,26 +218,6 @@ Ing produktung ini atin yang makayabeng software a gewa dareng OpenSSL Project p &Change Passphrase... &Alilan ing Passphrase... - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - Send coins to a Bitcoin address Magpadalang barya king Bitcoin address @@ -377,14 +254,6 @@ Ing produktung ini atin yang makayabeng software a gewa dareng OpenSSL Project p Wallet Wallet - - &Send - - - - &Receive - - &Show / Hide &Ipalto / Isalikut @@ -393,18 +262,6 @@ Ing produktung ini atin yang makayabeng software a gewa dareng OpenSSL Project p Show or hide the main Window Ipalto o isalikut ing pun a awang - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - &File &File @@ -429,78 +286,6 @@ Ing produktung ini atin yang makayabeng software a gewa dareng OpenSSL Project p Bitcoin Core Kapilubluban ning Bitcoin - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Bitcoin client - - - %n active connection(s) to Bitcoin network - %n ya ing aktibong koneksion keng Bitcoin network%n lareng aktibong koneksion keng Bitcoin network - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - Me-prosesu %1 kareng %2 (me-estima) blocks ning kasalesayan ning transaksion. - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - %n oras%n oras - - - %n day(s) - %n aldo%n aldo - - - %n week(s) - %n dominggu%n dominggu - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - Last received block was generated %1 ago. Ing tatauling block a metanggap, me-generate ya %1 ing milabas @@ -519,7 +304,7 @@ Ing produktung ini atin yang makayabeng software a gewa dareng OpenSSL Project p Information - Impormasion + &Impormasion Up to date @@ -557,10 +342,6 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Maka-<b>encrypt</b> ya ing wallet at kasalukuyan yang maka-<b>locked</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Atin kamalian a milyari. Ali ne magsilbing sumulung pa ing Bitcoin at kailangan na ng tuknang. - ClientModel @@ -571,54 +352,6 @@ Address: %4 CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount Alaga @@ -631,18 +364,10 @@ Address: %4 Date Kaaldauan - - Confirmations - - Confirmed Me-kumpirma - - Priority - - Copy address Kopyan ing address @@ -655,151 +380,11 @@ Address: %4 Copy amount Kopyan ing alaga - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (alang label) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -810,14 +395,6 @@ Address: %4 &Label &Label - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Address @@ -839,12 +416,12 @@ Address: %4 Alilan ya ing address king pamagpadala - The entered address "%1" is already in the address book. - Ing pepalub yung address "%1" ati na yu king aklat dareng address + The entered address "%1" is already in the address book. + Ing pepalub yung address "%1" ati na yu king aklat dareng address - The entered address "%1" is not a valid Bitcoin address. - Ing pepalub yung address "%1" ali ya katanggap-tanggap a Bitcoin address. + The entered address "%1" is not a valid Bitcoin address. + Ing pepalub yung address "%1" ali ya katanggap-tanggap a Bitcoin address. Could not unlock wallet. @@ -857,33 +434,9 @@ Address: %4 FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core Kapilubluban ning Bitcoin @@ -892,6 +445,10 @@ Address: %4 version bersion + + Command-line options + Pipamilian command-line + Usage: Pamanggamit: @@ -905,26 +462,18 @@ Address: %4 Pipamilian ning UI - Set language, for example "de_DE" (default: system locale) - Mamiling Amanu, alimbawa "de_DE"(default: system locale) + Set language, for example "de_DE" (default: system locale) + Mamiling Amanu, alimbawa "de_DE"(default: system locale) Start minimized Umpisan ing pamaglati - - Set SSL root certificates for payment request (default: -system-) - - Show splash screen on startup (default: 1) Ipalto ing splash screen keng umpisa (default: 1) - - Choose data directory on startup (default: 0) - - - + Intro @@ -932,69 +481,17 @@ Address: %4 Malaus ka - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - + Bitcoin Core + Kapilubluban ning Bitcoin Error Mali - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog @@ -1005,10 +502,6 @@ Address: %4 &Main &Pun - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - Pay transaction &fee Mamayad &bayad para king transaksion @@ -1021,78 +514,10 @@ Address: %4 &Start Bitcoin on system login &Umpisan ya ing Bitcoin king pamag-log-in na ning sistema. - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - &Network &Network - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Ibuklat yang antimanu ing Bitcoin client port king router. Gagana yamu ini istung ing router mu susuporta yang UPnP at magsilbi ya. @@ -1113,14 +538,6 @@ Address: %4 Port of the proxy (e.g. 9050) Port na ning proxy(e.g. 9050) - - SOCKS &Version: - &Bersion na ning SOCKS - - - SOCKS version of the proxy (e.g. 5) - Bersion a SOCKS ning proxy (e.g 5) - &Window &Awang @@ -1135,7 +552,7 @@ Address: %4 Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - Palatian namu kesa king iluwal ya ing aplikasion istung makasara ya ing awang. Istung ing pipamilian a ini atiu king "magsilbi", ing aplikasion misara yamu kaibat meng pinili ing "Tuknangan" king menu. + Palatian namu kesa king iluwal ya ing aplikasion istung makasara ya ing awang. Istung ing pipamilian a ini atiu king "magsilbi", ing aplikasion misara yamu kaibat meng pinili ing "Tuknangan" king menu. M&inimize on close @@ -1161,18 +578,6 @@ Address: %4 Choose the default subdivision unit to show in the interface and when sending coins. Pilinan ing default subdivision unit a ipalto o ipakit king interface at istung magpadala kang barya. - - Whether to show Bitcoin addresses in the transaction list or not. - Ipakit man ing Bitcoin address king listahan naning transaksion o ali. - - - &Display addresses in transaction list - &Ipakit ing address king listahan naning transaksion - - - Whether to show coin control features or not. - - &OK &OK @@ -1185,26 +590,6 @@ Address: %4 default default - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - The supplied proxy address is invalid. Ing milageng proxy address eya katanggap-tanggap. @@ -1224,18 +609,10 @@ Address: %4 Wallet Wallet - - Available: - - Your current spendable balance Ing kekang kasalungsungan balanse a malyari mung gastusan - - Pending: - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance Ing kabuuan dareng transaksion a kasalungsungan ali pa me-kumpirma, at kasalungsungan ali pa mebilang kareng kekang balanseng malyari mung gastusan @@ -1267,121 +644,24 @@ Address: %4 PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Alaga - Error: Specified data directory "%1" does not exist. - + N/A + N/A - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Magpalub kang Bitcoin address(e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole @@ -1400,14 +680,6 @@ Address: %4 &Information &Impormasion - - Debug window - - - - General - - Using OpenSSL version Gagamit bersion na ning OpenSSL @@ -1420,10 +692,6 @@ Address: %4 Network Network - - Name - - Number of connections Bilang dareng koneksion @@ -1436,10 +704,6 @@ Address: %4 Current number of blocks Kasalungsungan bilang dareng blocks - - Estimated total blocks - Estima kareng kabuuan dareng blocks - Last block time Tatauling oras na ning block @@ -1452,25 +716,9 @@ Address: %4 &Console &Console - - &Network Traffic - - - - &Clear - - Totals - - - - In: - - - - Out: - + Kabuuan: Build date @@ -1500,113 +748,17 @@ Address: %4 Type <b>help</b> for an overview of available commands. I-type ing <b>help</b> ban akit la reng ati at magsilbing commands. - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - &Label: &Label: - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - Copy label Kopyan ing label - - Copy message - - Copy amount Kopyan ing alaga @@ -1614,34 +766,6 @@ Address: %4 ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address Address @@ -1658,15 +782,7 @@ Address: %4 Message Mensayi - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel @@ -1689,77 +805,13 @@ Address: %4 (no label) (alang label) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins Magpadalang Barya - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Misanang magpadala kareng alialiuang tumanggap @@ -1768,10 +820,6 @@ Address: %4 Add &Recipient Maglage &Tumanggap - - Clear all fields of the form. - - Clear &All I-Clear &Eganagana @@ -1792,50 +840,10 @@ Address: %4 Confirm send coins Kumpirman ing pamagpadalang barya - - %1 to %2 - - - - Copy quantity - - Copy amount Kopyan ing alaga - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - The recipient address is not valid, please recheck. Ing address na ning tumanggap ali ya katanggap-tanggap, maliari pung pakilaue pasibayu. @@ -1856,43 +864,11 @@ Address: %4 Duplicate address found, can only send to each address once per send operation. Atin meakit a milupang address, maliari kamung magpadalang misan king metung a address king misan a pamagpadalang transaksion. - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (alang label) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry @@ -1903,10 +879,6 @@ Address: %4 Pay &To: Ibayad &kang: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Ing address nung nokarin ipadala ya ing kabayaran (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Magpalub kang label para king address a ini ban a-iabe me king aklat dareng address @@ -1915,14 +887,6 @@ Address: %4 &Label: &Label: - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt+A @@ -1935,50 +899,10 @@ Address: %4 Alt+P Alt+P - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog @@ -1993,21 +917,13 @@ Address: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Maliari kang mamirmang mensayi king kekang address bilang patune na keka ya ini. Mimingat mu king pamag-pirmang e malino uling mapalyari kang mabiktimang phishing attack a manloku keka na pirman me ing sarili mu para king karela. Only sign fully-detailed statements you agree to. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Ing address ban a -pirman ya ing mensayi kayabe ning (e.g.1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Choose previously used address - - Alt+A Alt+A Paste address from clipboard - Idikit ing address menibat clipboard + Idikit ing address menibat king clipboard Alt+P @@ -2045,14 +961,6 @@ Address: %4 &Verify Message &Beripikan ing Mensayi - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Ing address na ning mensayi nung nokarin me pirma ya ini (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address Beripikan ing mensayi ban asiguradu a me pirma ya ini gamit ing mepiling Bitcoin address @@ -2066,12 +974,8 @@ Address: %4 Ibalik king dati reng ngan fields na ning pamag beripikang mensayi - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Magpalub kang Bitcoin address(e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - I-click ing "Pirman ing Mensayi" ban agawa ya ing metung a pirma + Click "Sign Message" to generate signature + I-click ing "Pirman ing Mensayi" ban agawa ya ing metung a pirma The entered address is invalid. @@ -2128,10 +1032,6 @@ Address: %4 Bitcoin Core Kapilubluban ning Bitcoin - - The Bitcoin Core developers - - [testnet] [testnet] @@ -2139,21 +1039,13 @@ Address: %4 TrafficGraphWidget - - KB/s - - - + TransactionDesc Open until %1 Makabuklat anggang %1 - - conflicted - - %1/offline %1/offline @@ -2170,10 +1062,6 @@ Address: %4 Status Kabilian - - , broadcast through %n node(s) - - Date Kaaldauan @@ -2206,10 +1094,6 @@ Address: %4 Credit Credit - - matures in %n more block(s) - - not accepted ali metanggap @@ -2236,15 +1120,7 @@ Address: %4 Transaction ID - ID ning Transaksion - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - + ID Debug information @@ -2254,10 +1130,6 @@ Address: %4 Transaction Transaksion - - Inputs - - Amount Alaga @@ -2274,10 +1146,6 @@ Address: %4 , has not been successfully broadcast yet , eya matagumpeng mibalita - - Open for %n more block(s) - - unknown e miya balu @@ -2308,18 +1176,6 @@ Address: %4 Address Address - - Amount - Alaga - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - Open until %1 Makabuklat anggang %1 @@ -2336,22 +1192,6 @@ Address: %4 Generated but not accepted Me-generate ya oneng ali ya metanggap - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with Atanggap kayabe ning @@ -2467,10 +1307,6 @@ Address: %4 Copy amount Kopyan ing alaga - - Copy transaction ID - - Edit label Alilan ing label @@ -2479,26 +1315,6 @@ Address: %4 Show transaction details Ipakit ing detalye ning transaksion - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Comma separated file (*.csv) @@ -2523,10 +1339,6 @@ Address: %4 Address Address - - Amount - Alaga - ID ID @@ -2540,13 +1352,12 @@ Address: %4 para kang + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2556,53 +1367,9 @@ Address: %4 WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - Pamanggamit: - - - List commands - Listahan dareng commands - - - Get help for a command - Maniauad saup para kareng command - Options: Pipamilian: @@ -2643,22 +1410,10 @@ Address: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Atin kamalian a milyari kabang ayusan ya ing RPC port %u para keng pamakiramdam king IPv4: %s - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - Accept command line and JSON-RPC commands Tumanggap command line at JSON-RPC commands - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Gumana king gulut bilang daemon at tumanggap commands @@ -2671,184 +1426,26 @@ Address: %4 Accept connections from outside (default: 1 if no -proxy or -connect) Tumanggap koneksion menibat king kilwal (default: 1 if no -proxy or -connect) - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Kapabaluan: Sobra ya katas ing makalage king -paytxfee. Ini ing maging bayad mu para king bayad na ning transaksion istung pepadala me ing transaksion a ini. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Kapabaluan: Maliaring pakilawe ing oras at aldo a makalage king kekayung kompyuter nung istu la! Istung ing oras yu mali ya ali ya gumanang masalese ing Bitcoin. - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - Block creation options: Pipamilian king pamag-gawang block: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) Kumunekta mu king mepiling node(s) - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - Corrupted block database detected Mekapansin lang me-corrupt a block database - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - Discover own IP address (default: 1 when listening and no -externalip) I-discover ing sariling IP address (default: 1 istung makiramdam at -externalip) - - Do not load the wallet and disable wallet RPC calls - - Do you want to rebuild the block database now? Buri meng buuan pasibayu ing block database ngene? @@ -2857,14 +1454,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error initializing block database Kamalian king pamag-initialize king block na ning database - - Error initializing wallet database environment %s! - - - - Error loading block database - - Error opening block database Kamalian king pamag buklat king block database @@ -2873,10 +1462,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error: Disk space is low! Kamalian: Mababa ne ing espasyu king disk! - - Error: Wallet locked, unable to create transaction! - - Error: system error: Kamalian: kamalian na ning sistema: @@ -2925,218 +1510,14 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write undo data Me-mali king pamanyulat king undo data - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - Mantun peers gamit ing pamamantun DNS (default: 1 unless -connect) - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - How many blocks to check at startup (default: 288, 0 = all) Pilan la reng block a lawan keng umpisa (default: 288, 0 = all) - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information &Impormasion - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - Pipamilian ning SSL: (lawen ye ing Bitcoin Wiki para king SSL setup instructions) - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file Magpadalang trace/debug info okeng console kesa keng debug.log file @@ -3145,58 +1526,14 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Set minimum block size in bytes (default: 0) Ilage ing pekaditak a dagul na ning block king bytes (default: 0) - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - System error: Kamalian ning sistema: - - Transaction amount too small - - - - Transaction amounts must be positive - - Transaction too large Maragul yang masiadu ing transaksion - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - Username for JSON-RPC connections Username para king JSON-RPC koneksion @@ -3209,34 +1546,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: This version is obsolete, upgrade required! Kapabaluan: Ing bersioin a ini laus ne, kailangan nang mag-upgrade! - - Zapping all transactions from wallet... - - - - on startup - - - - version - bersion - - - wallet.dat corrupt, salvage failed - - Password for JSON-RPC connections Password para king JSON-RPC koneksion - - Allow JSON-RPC connections from specified IP address - Payagan ya i JSON-RPC koneksion para king metung a IP address - - - Send commands to node running on <ip> (default: 127.0.0.1) - Magpadalang command king node a gagana king <ip>(default: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) I-execute ing command istung mialilan ya ing best block (%s in cmd is replaced by block hash) @@ -3269,10 +1582,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message Ining saup a mensayi - - Unable to bind to %s on this computer (bind returned error %d, %s) - Ali ya magsilbing mag-bind keng %s kening kompyuter a ini (bind returned error %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Payagan ing pamaglawe DNS para king -addnode, -seednode and -connect @@ -3285,41 +1594,29 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted Me-mali ya ing pamag-load king wallet.dat: Me-corrupt ya ing wallet - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Me-mali ya ing pamag-load na ning wallet.dat: Ing wallet mangailangan yang bayung bersion na ning Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - Ing wallet mangailangan yang misulat pasibayu: Umpisan yang pasibayu ing Bitcoin ban ma-kumpleto ya - Error loading wallet.dat Me-mali ya ing pamag-load king wallet.dat - Invalid -proxy address: '%s' - Ali katanggap-tanggap a -proxy addresss: '%s' + Invalid -proxy address: '%s' + Ali katanggap-tanggap a -proxy addresss: '%s' - Unknown network specified in -onlynet: '%s' - E kilalang network ing mepili king -onlynet: '%s' + Unknown network specified in -onlynet: '%s' + E kilalang network ing mepili king -onlynet: '%s' - Unknown -socks proxy version requested: %i - E kilalang -socks proxy version requested: %i + Cannot resolve -bind address: '%s' + Eya me-resolve ing -bind address: '%s' - Cannot resolve -bind address: '%s' - Eya me-resolve ing -bind address: '%s' + Cannot resolve -externalip address: '%s' + Eya me-resolve ing -externalip address: '%s' - Cannot resolve -externalip address: '%s' - Eya me-resolve ing -externalip address: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Eya maliari ing alaga keng -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Eya maliari ing alaga keng -paytxfee=<amount>: '%s' Invalid amount @@ -3365,13 +1662,5 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error Mali - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Dapat meng ilage ing rpcpassword=<password> king configuration file: -%s -Nung ing file ala ya, gawa ka gamit ing owner-readable-only file permissions. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_pl.ts b/src/qt/locale/bitcoin_pl.ts index 6bc177076b..7cf3d042a1 100644 --- a/src/qt/locale/bitcoin_pl.ts +++ b/src/qt/locale/bitcoin_pl.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - O Bitcoin Core - - - <b>Bitcoin Core</b> version - Wersja <b>Bitcoin Core</b> - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Oprogramowanie eksperymentalne. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - Copyright - Prawo autorskie - - - The Bitcoin Core developers - Deweloperzy Bitcoin Core - - - (%1-bit) - - - + AddressBookPage @@ -131,8 +94,8 @@ This product includes software developed by the OpenSSL Project for use in the O Błąd przy próbie eksportu - There was an error trying to save the address list to %1. - + There was an error trying to save the address list to %1. Please try again. + Wystąpił błąd podczas próby zapisu listy adresów %1. Proszę spróbować ponownie @@ -168,10 +131,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Powtórz nowe hasło - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Wprowadź nowe hasło dla portfela.<br/>Proszę użyć hasła składającego się z <b>10 lub więcej losowych znaków</b> lub <b>ośmiu lub więcej słów</b>. - Encrypt wallet Zaszyfruj portfel @@ -206,7 +165,7 @@ This product includes software developed by the OpenSSL Project for use in the O Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - Uwaga: Jeśli zaszyfrujesz swój portfel i zgubisz hasło to <b>STRACISZ WSZYSTKIE SWOJE BITCOIN'Y</b>! + Uwaga: Jeśli zaszyfrujesz swój portfel i zgubisz hasło to <b>STRACISZ WSZYSTKIE SWOJE BITCOIN'Y</b>! Are you sure you wish to encrypt your wallet? @@ -273,7 +232,7 @@ This product includes software developed by the OpenSSL Project for use in the O Node - + Węzeł Show general overview of wallet @@ -295,10 +254,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application Zamknij program - - Show information about Bitcoin - Pokaż informację o Bitcoin - About &Qt O &Qt @@ -335,6 +290,10 @@ This product includes software developed by the OpenSSL Project for use in the O Open &URI... Otwórz URI... + + Bitcoin Core client + Rdzeń klienta Bitcoin + Importing blocks from disk... Importowanie bloków z dysku... @@ -387,6 +346,10 @@ This product includes software developed by the OpenSSL Project for use in the O &Receive Odbie&rz + + Show information about Bitcoin Core + Pokaż informacje o Rdzeniu Bitcoin + &Show / Hide &Pokaż / Ukryj @@ -447,21 +410,13 @@ This product includes software developed by the OpenSSL Project for use in the O Show the list of used receiving addresses and labels Pokaż listę użytych adresów odbiorczych i etykiety - - Open a bitcoin: URI or payment request - - &Command-line options - + &Opcje konsoli Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Bitcoin klient + Pokaż pomoc Rdzenia Bitcoin, aby zobaczyć listę wszystkich opcji linii poleceń %n active connection(s) to Bitcoin network @@ -471,10 +426,6 @@ This product includes software developed by the OpenSSL Project for use in the O No block source available... Brak dostępnych źródeł bloków... - - Processed %1 of %2 (estimated) blocks of transaction history. - Przetworzono (w przybliżeniu) %1 z %2 bloków historii transakcji. - Processed %1 blocks of transaction history. Pobrano %1 bloków z historią transakcji. @@ -559,10 +510,6 @@ Adres: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Portfel jest <b>zaszyfrowany</b> i obecnie <b>zablokowany</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Błąd krytyczny. Bitcoin nie może kontynuować bezpiecznie więc zostanie zamknięty. - ClientModel @@ -573,10 +520,6 @@ Adres: %4 CoinControlDialog - - Coin Control Address Selection - - Quantity: Ilość: @@ -597,10 +540,6 @@ Adres: %4 Fee: Opłata: - - Low Output: - - After Fee: Po opłacie: @@ -689,10 +628,6 @@ Adres: %4 Copy priority Skopiuj priorytet - - Copy low output - - Copy change Skopiuj resztę @@ -741,10 +676,6 @@ Adres: %4 none żaden - - Dust - - yes tak @@ -770,25 +701,13 @@ Adres: %4 Transakcje o wyższym priorytecie zostają szybciej dołączone do bloku. - This label turns red, if the priority is smaller than "medium". - Ta etykieta jest czerwona, jeżeli priorytet jest mniejszy niż "średni" + This label turns red, if the priority is smaller than "medium". + Ta etykieta jest czerwona, jeżeli priorytet jest mniejszy niż "średni" This label turns red, if any recipient receives an amount smaller than %1. Etykieta staje się czerwona kiedy którykolwiek odbiorca otrzymuje kwotę mniejszą niż %1. - - This means a fee of at least %1 is required. - Oznacza to, że wymagana jest opłata przynajmniej %1. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - Etykieta staje się czerwona kiedy reszta jest mniejsza niż %1. - (no label) (bez etykiety) @@ -841,12 +760,12 @@ Adres: %4 Zmień adres wysyłania - The entered address "%1" is already in the address book. - Wprowadzony adres "%1" już istnieje w książce adresowej. + The entered address "%1" is already in the address book. + Wprowadzony adres "%1" już istnieje w książce adresowej. - The entered address "%1" is not a valid Bitcoin address. - Wprowadzony adres "%1" nie jest poprawnym adresem Bitcoin. + The entered address "%1" is not a valid Bitcoin address. + Wprowadzony adres "%1" nie jest poprawnym adresem Bitcoin. Could not unlock wallet. @@ -882,10 +801,6 @@ Adres: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Opcje konsoli - Bitcoin Core Rdzeń BitCoin @@ -894,6 +809,18 @@ Adres: %4 version wersja + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + O Bitcoin Core + + + Command-line options + Opcje konsoli + Usage: Użycie: @@ -907,17 +834,13 @@ Adres: %4 UI opcje - Set language, for example "de_DE" (default: system locale) - Ustaw Język, na przykład "pl_PL" (domyślnie: systemowy) + Set language, for example "de_DE" (default: system locale) + Ustaw Język, na przykład "pl_PL" (domyślnie: systemowy) Start minimized Uruchom zminimalizowany - - Set SSL root certificates for payment request (default: -system-) - - Show splash screen on startup (default: 1) Pokazuj okno powitalne przy starcie (domyślnie: 1) @@ -954,12 +877,12 @@ Adres: %4 Użyj wybranego folderu dla danych - Bitcoin - Bitcoin + Bitcoin Core + Rdzeń BitCoin - Error: Specified data directory "%1" can not be created. - Błąd: Określony folder danych "%1" nie mógł zostać utworzony. + Error: Specified data directory "%1" cannot be created. + Błąd: Określony folder danych "%1" nie mógł zostać utworzony. Error @@ -990,11 +913,11 @@ Adres: %4 Select payment request file - + Otwórz żądanie zapłaty z pliku Select payment request file to open - + Wybierz plik żądania zapłaty do otwarcia @@ -1023,41 +946,33 @@ Adres: %4 &Start Bitcoin on system login Uruchamiaj Bitcoin wraz z zalogowaniem do &systemu - - Size of &database cache - - MB MB Number of script &verification threads - + Liczba wątków &weryfikacji skryptu + + + Accept connections from outside + Akceptuj połączenia z zewnątrz + + + Allow incoming connections + Zezwól na połączenia przychodzące Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - + Połącz się z siecią Bitcoin poprzez SOCKS proxy. IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Adres IP serwera proxy (np. IPv4: 127.0.0.1 / IPv6: ::1) - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - Active command-line options that override above options: - + Aktywne opcje linii komend, które nadpisują powyższe opcje: Reset all client options to default. @@ -1071,10 +986,6 @@ Adres: %4 &Network &Sieć - - (0 = auto, <0 = leave that many cores free) - - W&allet Portfel @@ -1083,18 +994,6 @@ Adres: %4 Expert Ekspert - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Automatycznie otwiera port klienta Bitcoin na routerze. Ta opcja dzieła tylko jeśli twój router wspiera UPnP i jest ono włączone. @@ -1115,14 +1014,6 @@ Adres: %4 Port of the proxy (e.g. 9050) Port proxy (np. 9050) - - SOCKS &Version: - Wersja &SOCKS - - - SOCKS version of the proxy (e.g. 5) - SOCKS wersja serwera proxy (np. 5) - &Window &Okno @@ -1163,18 +1054,6 @@ Adres: %4 Choose the default subdivision unit to show in the interface and when sending coins. Wybierz podział jednostki pokazywany w interfejsie oraz podczas wysyłania monet - - Whether to show Bitcoin addresses in the transaction list or not. - Pokazuj adresy Bitcoin na liście transakcji. - - - &Display addresses in transaction list - &Wyświetlaj adresy w liście transakcji - - - Whether to show coin control features or not. - - &OK &OK @@ -1274,8 +1153,8 @@ Adres: %4 Obsługa URI - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI nie może zostać przetworzony! Prawdopodobnie błędny adres Bitcoin bądź nieprawidłowe parametry URI. + Invalid payment address %1 + błędny adres płatności %1 Requested payment amount of %1 is too small (considered dust). @@ -1289,30 +1168,6 @@ Adres: %4 Cannot start bitcoin: click-to-pay handler Nie można rozpocząć bitcoin: kliknij-by-zapłacić opiekunowi - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - Twoje aktywne proxy nie obsługuje SOCKS5, co jest wymagane dla żądania płatności przez proxy. - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - Refund from %1 Zwrot z %1 @@ -1321,10 +1176,6 @@ Adres: %4 Error communicating with %1: %2 Błąd komunikacji z %1 : %2 - - Payment request can not be parsed or processed! - - Bad response from server %1 Błędna odpowiedź z serwera %1 @@ -1338,33 +1189,28 @@ Adres: %4 Błąd żądania sieci + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Kwota - Error: Specified data directory "%1" does not exist. - Błąd: Określony folder danych "%1" nie istnieje. + %1 h + %1 h - Error: Cannot parse configuration file: %1. Only use key=value syntax. - Błąd: Nie można przetworzyć pliku konfiguracyjnego: %1. Używaj tylko składni klucz=wartość. + %1 m + %1 m - Error: Invalid combination of -regtest and -testnet. - Błąd: Niepoprawna kombinacja -regtest i -testnet. + N/A + NIEDOSTĘPNE - - Bitcoin Core didn't yet exit safely... - Bitcoin Core jeszcze się nie wyłączył bezpiecznie… - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Wprowadź adres Bitcoin (np. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget @@ -1438,10 +1284,6 @@ Adres: %4 Current number of blocks Aktualna liczba bloków - - Estimated total blocks - Szacowana ilość bloków - Last block time Czas ostatniego bloku @@ -1518,19 +1360,7 @@ Adres: %4 %1 GB %1 GB - - %1 m - %1 m - - - %1 h - %1 h - - - %1 h %2 m - %1 h %2 m - - + ReceiveCoinsDialog @@ -1549,14 +1379,6 @@ Adres: %4 Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. Użyj jeden z poprzednio użytych adresów odbiorczych. Podczas ponownego używania adresów występują problemy z bezpieczeństwem i prywatnością. Nie korzystaj z tej opcji, chyba że odtwarzasz żądanie płatności wykonane już wcześniej. - - R&euse an existing receiving address (not recommended) - U%żyj ponownie istniejący adres odbiorczy (niepolecane) - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - An optional label to associate with the new receiving address. Opcjonalna etykieta do skojarzenia z nowym adresem odbiorczym. @@ -1565,10 +1387,6 @@ Adres: %4 Use this form to request payments. All fields are <b>optional</b>. Użyj tego formularza do zażądania płatności. Wszystkie pola są <b>opcjonalne</b>. - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - Clear all fields of the form. Wyczyść pola formularza @@ -1585,10 +1403,6 @@ Adres: %4 &Request payment &Żądaj płatności - - Show the selected request (does the same as double clicking an entry) - - Show Pokaż @@ -1706,10 +1520,6 @@ Adres: %4 Send Coins Wyślij Monety - - Coin Control Features - - Inputs... Wejścia... @@ -1742,10 +1552,6 @@ Adres: %4 Fee: Opłata: - - Low Output: - - After Fee: Po opłacie: @@ -1758,10 +1564,6 @@ Adres: %4 If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. Kiedy ta opcja jest wybrana, ale adres reszty jest pusty lub nieprawidłowy to reszta będzie wysyłana na adres nowo-wygenerowany. - - Custom change address - - Send to multiple recipients at once Wyślij do wielu odbiorców na raz @@ -1822,10 +1624,6 @@ Adres: %4 Copy priority Skopiuj priorytet - - Copy low output - - Copy change Skopiuj resztę @@ -1886,14 +1684,6 @@ Adres: %4 added as transaction fee dodano jako opłata transakcyjna - - Payment request expired - Zażądanie płatności upłynęło - - - Invalid payment address %1 - błędny adres płatności %1 - SendCoinsEntry @@ -1905,10 +1695,6 @@ Adres: %4 Pay &To: Zapłać &dla: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adres, na który wysłasz płatności (np. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Wprowadź etykietę dla tego adresu by dodać go do książki adresowej @@ -1953,10 +1739,6 @@ Adres: %4 Enter a label for this address to add it to the list of used addresses Wprowadź etykietę dla tego adresu by dodać go do listy użytych adresów - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - This is an unverified payment request. To żądanie zapłaty nie zostało zweryfikowane. @@ -1995,10 +1777,6 @@ Adres: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Możesz podpisywać wiadomości swoimi adresami aby udowodnić, że jesteś ich właścicielem. Uważaj, aby nie podpisywać niczego co wzbudza Twoje podejrzenia, ponieważ ktoś może stosować phishing próbując nakłonić Cię do ich podpisania. Akceptuj i podpisuj tylko w pełni zrozumiałe komunikaty i wiadomości. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Wprowadź adres Bitcoin (np. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Choose previously used address Wybierz wcześniej użyty adres @@ -2051,10 +1829,6 @@ Adres: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Wpisz adres podpisu, wiadomość (upewnij się, że dokładnie skopiujesz wszystkie zakończenia linii, spacje, tabulacje itp.) oraz podpis poniżej by sprawdzić wiadomość. Uważaj by nie dodać więcej do podpisu niż do samej podpisywanej wiadomości by uniknąć ataku man-in-the-middle (człowiek pośrodku) - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Wprowadź adres Bitcoin (np. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address Zweryfikuj wiadomość, aby upewnić się, że została podpisana odpowiednim adresem Bitcoin. @@ -2068,12 +1842,8 @@ Adres: %4 Resetuje wszystkie pola weryfikacji wiadomości - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Wprowadź adres Bitcoin (np. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Kliknij "Podpisz Wiadomość" żeby uzyskać podpis + Click "Sign Message" to generate signature + Kliknij "Podpisz Wiadomość" żeby uzyskać podpis The entered address is invalid. @@ -2152,10 +1922,6 @@ Adres: %4 Open until %1 Otwórz do %1 - - conflicted - - %1/offline %1/offline @@ -2245,8 +2011,8 @@ Adres: %4 Kupiec - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - Wygenerowane monety muszą dojrzeć przez %1 bloków zanim będzie można je wysłać. Gdy wygenerowałeś ten blok został on ogłoszony w sieci i dodany do łańcucha bloków. Jeżeli nie uda mu się wejść do łańcucha jego status zostanie zmieniony na "nie zaakceptowano" i nie będzie można go wydać. To czasem zdarza się gdy inny węzeł wygeneruje blok w kilka sekund od twojego. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Wygenerowane monety muszą dojrzeć przez %1 bloków zanim będzie można je wysłać. Gdy wygenerowałeś ten blok został on ogłoszony w sieci i dodany do łańcucha bloków. Jeżeli nie uda mu się wejść do łańcucha jego status zostanie zmieniony na "nie zaakceptowano" i nie będzie można go wydać. To czasem zdarza się gdy inny węzeł wygeneruje blok w kilka sekund od twojego. Debug information @@ -2310,18 +2076,6 @@ Adres: %4 Address Adres - - Amount - Kwota - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - Otwórz dla %n następnych bloków - Open until %1 Otwórz do %1 @@ -2350,10 +2104,6 @@ Adres: %4 Confirming (%1 of %2 recommended confirmations) Potwierdzanie (%1 z %2 rekomendowanych potwierdzeń) - - Conflicted - - Received with Otrzymane przez @@ -2525,10 +2275,6 @@ Adres: %4 Address Adres - - Amount - Kwota - ID ID @@ -2542,6 +2288,9 @@ Adres: %4 do + + UnitDisplayStatusBarControl + WalletFrame @@ -2593,18 +2342,6 @@ Adres: %4 bitcoin-core - - Usage: - Użycie: - - - List commands - Lista poleceń - - - Get help for a command - Uzyskaj pomoc do polecenia - Options: Opcje: @@ -2645,10 +2382,6 @@ Adres: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Czas w sekundach, przez jaki nietrzymający się zasad peerzy nie będą mogli ponownie się podłączyć (domyślnie: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Wystąpił błąd podczas ustawiania portu RPC %u w tryb nasłuchu: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Nasłuchuj połączeń JSON-RPC na <port> (domyślnie: 8332 or testnet: 18332) @@ -2657,10 +2390,6 @@ Adres: %4 Accept command line and JSON-RPC commands Akceptuj linię poleceń oraz polecenia JSON-RPC - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Uruchom w tle jako daemon i przyjmuj polecenia @@ -2683,7 +2412,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, musisz ustawić rpcpassword w pliku konfiguracyjnym:⏎ %s⏎ @@ -2694,36 +2423,16 @@ rpcpassword=%s⏎ Użytkownik i hasło nie mogą być takie same.⏎ Jeśli plik nie istnieje, utwórz go z uprawnieniami tylko-do-odczytu dla właściciela.⏎ Zalecane jest ustawienie alertnotify aby poinformować o problemach:⏎ -na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo.com⏎ +na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo.com⏎ Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Dopuszczalne szyfry (domyślnie: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Wystąpił błąd podczas ustawiania portu RPC %u w tryb nasłuchu dla IPv6, korzystam z IPv4: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Skojarz z podanym adresem. Użyj formatu [host]:port dla IPv6 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Wejście w tryb testów regresji, który wykorzystuje specjalny łańcuch, w którym bloki można rozwiązać natychmiast. To jest przeznaczone dla narzędzi testowania regresji i rozwoju aplikacji. - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Błąd: transakcja została odrzucona. Może się to zdarzyć, gdy monety z Twojego portfela zostały już wydane, na przykład gdy używałeś kopii wallet.dat i bitcoiny które tam wydałeś nie zostały jeszcze odjęte z portfela z którego teraz korzystasz. @@ -2736,50 +2445,14 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Wykonaj polecenie, kiedy transakcja portfela ulegnie zmianie (%s w poleceniu zostanie zastąpione przez TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications To jest testowa wersja - używaj na własne ryzyko - nie używaj do wykopywania oraz przy aplikacjach kupieckich - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Ostrzeżenie: -paytxfee jest bardzo duży. To jest prowizja za transakcje, którą płacisz, gdy wysyłasz monety. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Uwaga: Sprawdź czy data i czas na Twoim komputerze są prawidłowe! Jeśli nie to Bitcoin nie będzie działał prawidłowo. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Ostrzeżenie: Sieć nie wydaje się w pełni zgodna! Niektórzy górnicy wydają się doświadczać problemów. @@ -2804,38 +2477,18 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo (default: wallet.dat) (domyślnie: wallet.dat) - - <category> can be: - - Attempt to recover private keys from a corrupt wallet.dat Próbuj odzyskać klucze prywatne z uszkodzonego wallet.dat - - Bitcoin Core Daemon - - Block creation options: Opcje tworzenia bloku: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - Wyczyść listę transakcji portfela (narzędzie diagnostyczne; implikuje -rescan) - Connect only to the specified node(s) Łącz tylko do wskazanego węzła - - Connect through SOCKS proxy - Połącz przez SOCKS proxy - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - podłącz do JSON-RPC na <port> (domyślnie: 8332 lub sieć testowa: 18332) - Connection options: Opcje połączenia: @@ -2848,10 +2501,6 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Debugging/Testing options: Opcje debugowania/testowania: - - Disable safemode, override a real safe mode event (default: 0) - - Discover own IP address (default: 1 when listening and no -externalip) Odkryj własny adres IP (domyślnie: 1 kiedy w trybie nasłuchu i brak -externalip ) @@ -2936,21 +2585,9 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Failed to write undo data Nie udało się zapisać danych odtwarzających - - Fee per kB to add to transactions you send - Prowizja za kB dodawana do wysyłanej transakcji - - - Fees smaller than this are considered zero fee (for relaying) (default: - Opłaty mniejsze niż to są uznawane za nieistniejące (przy przekazywaniu) (domyślnie: - - - Find peers using DNS lookup (default: 1 unless -connect) - Wyszukaj połączenia wykorzystując zapytanie DNS (domyślnie 1 jeśli nie użyto -connect) - Force safe mode (default: 0) - + Wymuś tryb bezpieczny (domyślnie: 0) Generate coins (default: 0) @@ -2960,10 +2597,6 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo How many blocks to check at startup (default: 288, 0 = all) Ile bloków sprawdzić przy starcie (domyślnie: 288, 0 = wszystkie) - - If <category> is not supplied, output all debugging information. - - Importing... Importowanie… @@ -2973,29 +2606,17 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Nieprawidłowy lub brak bloku genezy. Błędny folder_danych dla sieci? - Invalid -onion address: '%s' - Nieprawidłowy adres -onion: '%s' + Invalid -onion address: '%s' + Nieprawidłowy adres -onion: '%s' Not enough file descriptors available. Brak wystarczającej liczby deskryptorów plików. - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - Opcje klienta RPC: - Rebuild block chain index from current blk000??.dat files Odbuduj indeks łańcucha bloków z obecnych plików blk000??.dat - - Select SOCKS version for -proxy (4 or 5, default: 5) - Wybierz wersję proxy SOCKS (4 lub 5, domyślnie 5) - Set database cache size in megabytes (%d to %d, default: %d) Ustaw wielkość pamięci podręcznej w megabajtach (%d do %d, domyślnie: %d) @@ -3016,14 +2637,6 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Spend unconfirmed change when sending transactions (default: 1) Wydawaj niepotwierdzoną resztę podczas wysyłania transakcji (domyślnie: 1) - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - Użycie (przestarzałe, użyj bitcoin-cli): - Verifying blocks... Weryfikacja bloków... @@ -3032,10 +2645,6 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Verifying wallet... Weryfikacja portfela... - - Wait for RPC server to start - - Wallet %s resides outside data directory %s Portfel %s znajduje się poza folderem danych %s @@ -3044,10 +2653,6 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Wallet options: Opcje portfela: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - You need to rebuild the database using -reindex to change -txindex Musisz przebudować bazę używając parametru -reindex aby zmienić -txindex @@ -3058,35 +2663,27 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - + Nie można uzyskać blokady na katalogu z danymi %s. Rdzeń Bitcoin najprawdopodobniej jest już uruchomiony. Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Uruchom polecenie przy otrzymaniu odpowiedniego powiadomienia lub gdy zobaczymy naprawdę długie rozgałęzienie (%s w poleceniu jest podstawiane za komunikat) - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - Ustaw maksymalny rozmiar transakcji o wysokim priorytecie/niskiej prowizji w bajtach (domyślnie: 27000) - Information Informacja - Invalid amount for -minrelaytxfee=<amount>: '%s' - Nieprawidłowa kwota dla -minrelaytxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Nieprawidłowa kwota dla -minrelaytxfee=<amount>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - Nieprawidłowa kwota dla -mintxfee=<amount>: '%s' + Invalid amount for -mintxfee=<amount>: '%s' + Nieprawidłowa kwota dla -mintxfee=<amount>: '%s' Limit size of signature cache to <n> entries (default: 50000) - + Ogranicz rozmiar pamięci podręcznej sygnatur do <n> wpisów (domyslnie: 50000) Log transaction priority and fee per kB when mining blocks (default: 0) @@ -3104,6 +2701,10 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) Maksymalny bufor wysyłu na połączenie, <n>*1000 bajtów (domyślnie: 1000) + + Node relay options: + Opcje przekaźnikowe węzła: + Only accept block chain matching built-in checkpoints (default: 1) Akceptuj tylko łańcuch bloków zgodny z wbudowanymi punktami kontrolnymi (domyślnie: 1) @@ -3118,11 +2719,11 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Print block tree on startup (default: 0) - + Wypisz drzewo bloków podczas uruchomienia (domyślnie: 0) RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - + Opcje RPC SSL: (odwiedź Bitcoin Wiki w celu uzyskania instrukcji) RPC server options: @@ -3134,20 +2735,12 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Randomly fuzz 1 of every <n> network messages - + Losowo ignoruje 1 z wszystkich <n> wiadomości sieciowych. Run a thread to flush wallet periodically (default: 1) Uruchom wątek do okresowego zapisywania portfela (domyślnie: 1) - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - Opcje SSL: (odwiedź Bitcoin Wiki w celu uzyskania instrukcji) - - - Send command to Bitcoin Core - Wyślij komendę do Bitcoin Core - Send trace/debug info to console instead of debug.log file Wyślij informację/raport do konsoli zamiast do pliku debug.log. @@ -3156,17 +2749,9 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Set minimum block size in bytes (default: 0) Ustaw minimalny rozmiar bloku w bajtach (domyślnie: 0) - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - + Pokaż wszystkie opcje odpluskwiania (użycie: --help -help-debug) Shrink debug.log file on client startup (default: 1 when no -debug) @@ -3180,14 +2765,14 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Specify connection timeout in milliseconds (default: 5000) Wskaż czas oczekiwania bezczynności połączenia w milisekundach (domyślnie: 5000) - - Start Bitcoin Core Daemon - Uruchom serwer Bitcoin Core - System error: Błąd systemu: + + This is experimental software. + To oprogramowanie eksperymentalne. + Transaction amount too small Zbyt niska kwota transakcji @@ -3212,6 +2797,10 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Username for JSON-RPC connections Nazwa użytkownika dla połączeń JSON-RPC + + Wallet needed to be rewritten: restart Bitcoin Core to complete + Portfel wymaga przepisania: zresetuj Bitcoina aby ukończyć + Warning Ostrzeżenie @@ -3220,18 +2809,10 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Warning: This version is obsolete, upgrade required! Uwaga: Ta wersja jest przestarzała, aktualizacja wymagana! - - Zapping all transactions from wallet... - - on startup podczas uruchamiania - - version - wersja - wallet.dat corrupt, salvage failed wallet.dat uszkodzony, odtworzenie się nie powiodło @@ -3240,14 +2821,6 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Password for JSON-RPC connections Hasło do połączeń JSON-RPC - - Allow JSON-RPC connections from specified IP address - Przyjmuj połączenia JSON-RPC ze wskazanego adresu IP - - - Send commands to node running on <ip> (default: 127.0.0.1) - Wysyłaj polecenia do węzła działającego na <ip> (domyślnie: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Wykonaj polecenie kiedy najlepszy blok ulegnie zmianie (%s w komendzie zastanie zastąpione przez hash bloku) @@ -3280,10 +2853,6 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo This help message Ta wiadomość pomocy - - Unable to bind to %s on this computer (bind returned error %d, %s) - Nie można przywiązać %s na tym komputerze (bind returned error %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Zezwól -addnode, -seednode i -connect na łączenie się z serwerem DNS @@ -3296,41 +2865,29 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Error loading wallet.dat: Wallet corrupted Błąd ładowania wallet.dat: Uszkodzony portfel - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Błąd ładowania wallet.dat: Portfel wymaga nowszej wersji Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - Portfel wymaga przepisania: zrestartuj Bitcoina żeby ukończyć - Error loading wallet.dat Błąd ładowania wallet.dat - Invalid -proxy address: '%s' - Nieprawidłowy adres -proxy: '%s' + Invalid -proxy address: '%s' + Nieprawidłowy adres -proxy: '%s' - Unknown network specified in -onlynet: '%s' - Nieznana sieć w -onlynet: '%s' + Unknown network specified in -onlynet: '%s' + Nieznana sieć w -onlynet: '%s' - Unknown -socks proxy version requested: %i - Nieznana wersja proxy w -socks: %i + Cannot resolve -bind address: '%s' + Nie można uzyskać adresu -bind: '%s' - Cannot resolve -bind address: '%s' - Nie można uzyskać adresu -bind: '%s' + Cannot resolve -externalip address: '%s' + Nie można uzyskać adresu -externalip: '%s' - Cannot resolve -externalip address: '%s' - Nie można uzyskać adresu -externalip: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Nieprawidłowa kwota dla -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Nieprawidłowa kwota dla -paytxfee=<amount>: '%s' Invalid amount @@ -3376,13 +2933,5 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo Error Błąd - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Musisz ustawić rpcpassword=<hasło> w pliku configuracyjnym: -%s -Jeżeli plik nie istnieje, utwórz go z uprawnieniami właściciela-tylko-do-odczytu. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_pt_BR.ts b/src/qt/locale/bitcoin_pt_BR.ts index ee1c2a7381..0cdb7d6694 100644 --- a/src/qt/locale/bitcoin_pt_BR.ts +++ b/src/qt/locale/bitcoin_pt_BR.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - Sobre o Bitcoin Core - - - <b>Bitcoin Core</b> version - versão do <b>Bitcoin Core</b> - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - ⏎ -Este é um software experimental.⏎ -⏎ -Distribuido sob a licença de software MIT/X11, veja o arquivo anexo COPYING ou http://www.opensource.org/licenses/mit-license.php.⏎ -⏎ -Este produto inclui software desenvolvido pelo Projeto OpenSSL para uso no OpenSSL Toolkit (http://www.openssl.org/), software de criptografia escrito por Eric Young (eay@cryptsoft.com) e sofware UPnP escrito por Thomas Bernard. - - - Copyright - Copyright - - - The Bitcoin Core developers - Programadores do Bitcoin Core - - - (%1-bit) - (%1-bit) - - + AddressBookPage @@ -131,8 +94,8 @@ Este produto inclui software desenvolvido pelo Projeto OpenSSL para uso no OpenS Exportação Falhou - There was an error trying to save the address list to %1. - Ocorreu um erro ao tentar salvar a lista de endereço em %1. + There was an error trying to save the address list to %1. Please try again. + Ocorreu um erro ao tentar salvar a lista de endereço em %1.. Por favor tente novamente. @@ -168,10 +131,6 @@ Este produto inclui software desenvolvido pelo Projeto OpenSSL para uso no OpenS Repeat new passphrase Repita a nova frase de segurança - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Digite a nova frase de seguraça da sua carteira. <br/> Por favor, use uma frase de <b>10 ou mais caracteres aleatórios,</b> ou <b>oito ou mais palavras.</b> - Encrypt wallet Criptografar carteira @@ -224,6 +183,10 @@ Este produto inclui software desenvolvido pelo Projeto OpenSSL para uso no OpenS Wallet encrypted Carteira criptografada + + 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>. + Digite a nova senha da carteira. <br/>Por favor utilize uma senha com <b>dez ou mais caracteres aleartórios</b>, ou <b>oito ou mais palavras</b>. + Bitcoin 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. O Bitcoin irá fechar agora para finalizar o processo de encriptação. Lembre-se de que encriptar sua carteira não protege totalmente suas bitcoins de serem roubadas por malwares que tenham infectado o seu computador. @@ -295,10 +258,6 @@ Este produto inclui software desenvolvido pelo Projeto OpenSSL para uso no OpenS Quit application Sair da aplicação - - Show information about Bitcoin - Mostrar informação sobre Bitcoin - About &Qt Sobre &Qt @@ -335,6 +294,10 @@ Este produto inclui software desenvolvido pelo Projeto OpenSSL para uso no OpenS Open &URI... Abrir &URI... + + Bitcoin Core client + Cliente Bitcoin Core + Importing blocks from disk... Importando blocos do disco... @@ -387,6 +350,10 @@ Este produto inclui software desenvolvido pelo Projeto OpenSSL para uso no OpenS &Receive &Receber + + Show information about Bitcoin Core + Mostrar informações sobre Bitcoin Core + &Show / Hide &Exibir/Ocultar @@ -459,10 +426,6 @@ Este produto inclui software desenvolvido pelo Projeto OpenSSL para uso no OpenS Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options Mostra a mensagem de ajuda do Bitcoin Core para pegar a lista com os comandos possíveis - - Bitcoin client - Cliente Bitcoin - %n active connection(s) to Bitcoin network %n conexão ativa na rede Bitcoin%n conexões ativas na rede Bitcoin @@ -471,10 +434,6 @@ Este produto inclui software desenvolvido pelo Projeto OpenSSL para uso no OpenS No block source available... Nenhum servidor disponível... - - Processed %1 of %2 (estimated) blocks of transaction history. - Processado %1 de %2 blocos (estimado) de histórico de transações. - Processed %1 blocks of transaction history. Processado %1 blocos do histórico de transações. @@ -558,10 +517,6 @@ Endereço: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Carteira está <b>criptografada</b> e atualmente <b>bloqueada</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Um erro fatal ocorreu. Bitcoin não pode continuar em segurança e irá fechar. - ClientModel @@ -597,8 +552,8 @@ Endereço: %4 Taxa: - Low Output: - Rendimento baixo: + Dust: + Poeira: After Fee: @@ -689,8 +644,8 @@ Endereço: %4 Copia prioridade - Copy low output - Copia saída de pouco valor + Copy dust + Copiar poeira Copy change @@ -741,8 +696,8 @@ Endereço: %4 nenhum - Dust - Sujeira + Can vary +/- %1 satoshi(s) per input. + Pode variar +/- %1 satoshi(s) por entrada. yes @@ -769,25 +724,13 @@ Endereço: %4 Transações de alta prioridade são mais propensas a serem incluídas em um bloco. - This label turns red, if the priority is smaller than "medium". - Esse marcador fica vermelho se a prioridade for menor que "média". + This label turns red, if the priority is smaller than "medium". + Esse marcador fica vermelho se a prioridade for menor que "média". This label turns red, if any recipient receives an amount smaller than %1. Esse marcador fica vermelho se qualquer destinatário receber uma quantia menor que %1 - - This means a fee of at least %1 is required. - Isso significa que uma taxa de pelo menos %1 é necessária. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - Quantias abaixo de 0,546 multiplicado pela taxa mínima é mostrada como sujeira. - - - This label turns red, if the change is smaller than %1. - Esse marcador fica vermelho se o troco for menor que %1. - (no label) (Sem rótulo) @@ -840,12 +783,12 @@ Endereço: %4 Editar endereço de envio - The entered address "%1" is already in the address book. - O endereço digitado "%1" já se encontra no catálogo de endereços. + The entered address "%1" is already in the address book. + O endereço digitado "%1" já se encontra no catálogo de endereços. - The entered address "%1" is not a valid Bitcoin address. - O endereço digitado "%1" não é um endereço Bitcoin válido. + The entered address "%1" is not a valid Bitcoin address. + O endereço digitado "%1" não é um endereço Bitcoin válido. Could not unlock wallet. @@ -881,10 +824,6 @@ Endereço: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Bitcoin Core - Opções de linha de comando - Bitcoin Core Núcleo Bitcoin @@ -893,6 +832,18 @@ Endereço: %4 version versão + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + Sobre o Bitcoin Core + + + Command-line options + Opções da linha de comando + Usage: Uso: @@ -906,8 +857,8 @@ Endereço: %4 opções da UI - Set language, for example "de_DE" (default: system locale) - Escolher língua, por exemplo "de_DE" (padrão: localização do sistema) + Set language, for example "de_DE" (default: system locale) + Escolher língua, por exemplo "de_DE" (padrão: localização do sistema) Start minimized @@ -953,12 +904,12 @@ Endereço: %4 Use um diretório de dados personalizado: - Bitcoin - Bitcoin + Bitcoin Core + Núcleo Bitcoin - Error: Specified data directory "%1" can not be created. - Erro: dados especificados diretório "% 1" não pode ser criado. + Error: Specified data directory "%1" cannot be created. + Erro: Diretório de dados "%1" não pode ser criado. Error @@ -970,7 +921,7 @@ Endereço: %4 (of %1GB needed) - (Mais de 1GB necessário) + (Mais de %1GB necessário) @@ -1034,6 +985,14 @@ Endereço: %4 Number of script &verification threads Número de threads do script de &verificação + + Accept connections from outside + Aceitar conexões externas + + + Allow incoming connections + Permitir conexões de entrada + Connect to the Bitcoin network through a SOCKS proxy. Conectado na rede do Bitcoin através de proxy SOCKS. @@ -1048,11 +1007,11 @@ Endereço: %4 Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - + URLs de terceiros (exemplo: explorador de blocos) que aparecem na aba de transações como itens do menu de contexto. %s na URL é substituido pela hash da transação. Múltiplas URLs são separadas pela barra vertical |. Third party transaction URLs - + URLs da transação de terceiros Active command-line options that override above options: @@ -1114,14 +1073,6 @@ Endereço: %4 Port of the proxy (e.g. 9050) Porta do serviço de proxy (ex. 9050) - - SOCKS &Version: - &Versão do SOCKS: - - - SOCKS version of the proxy (e.g. 5) - Versão do proxy SOCKS (ex. 5) - &Window &Janela @@ -1162,14 +1113,6 @@ Endereço: %4 Choose the default subdivision unit to show in the interface and when sending coins. Escolha a unidade padrão de subdivisão para interface mostrar quando enviar bitcoins. - - Whether to show Bitcoin addresses in the transaction list or not. - Mostrar ou não endereços Bitcoin na lista de transações. - - - &Display addresses in transaction list - Mostrar en&dereços na lista de transações - Whether to show coin control features or not. Mostrar ou não opções de controle da moeda. @@ -1225,6 +1168,10 @@ Endereço: %4 Wallet Carteira + + Watch-only: + Apenas visualizar: + Available: Disponível: @@ -1257,6 +1204,10 @@ Endereço: %4 Your current total balance Seu saldo total atual + + Your current balance in watch-only addresses + Sua balança atual em endereços apenas visualizados + <b>Recent transactions</b> <b>Transações recentes</b> @@ -1273,12 +1224,20 @@ Endereço: %4 Manipulação de URI - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI não pode ser decodificado! Isso pode ter sido causado por um endereço Bitcoin inválido ou por parâmetros URI malformados. + Invalid payment address %1 + Endereço de pagamento inválido %1 + + + Payment request rejected + Solicitação de pagamento rejeitada + + + Payment request has expired. + Solicitação de pagamento expirou. Requested payment amount of %1 is too small (considered dust). - Valor do pagamento solicitado de 1% é muito pequeno (Considerado poeira). + Valor do pagamento solicitado de %1 é muito pequeno (Considerado poeira). Payment request error @@ -1288,14 +1247,6 @@ Endereço: %4 Cannot start bitcoin: click-to-pay handler Não foi possível iniciar bitcoin: manipulador clique-para-pagar - - Net manager warning - Gerenciador de rede problemático - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - Seu proxy ativo não suporta SOCKS5, que é obrigatório para cobranças via proxy. - Payment request fetch URL is invalid: %1 URL de cobrança é inválida: %1 @@ -1304,29 +1255,21 @@ Endereço: %4 Payment request file handling Manipulação de arquivo de cobrança - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - Arquivo de cobrança não pôde ser lido ou processado! Isso pode ter sido causado por um arquivo de cobrança inválido. - Unverified payment requests to custom payment scripts are unsupported. Cobrança não verificada para scripts de pagamento personalizados não é suportado. Refund from %1 - Reembolso de 1% + Reembolso de %1 Error communicating with %1: %2 - Erro na comunicação com% 1:% 2 - - - Payment request can not be parsed or processed! - Cobrança não pôde ser processada! + Erro na comunicação com %1: %2 Bad response from server %1 - Resposta ruim do servidor% 1 + Resposta incorreta do servidor %1 Payment acknowledged @@ -1337,31 +1280,54 @@ Endereço: %4 Erro de solicitação de rede + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Quantidade - Error: Specified data directory "%1" does not exist. - Erro: diretório de dados especificado "% 1" não existe. + Enter a Bitcoin address (e.g. %1) + Informe um endereço Bitcoin (ex: %1) - Error: Cannot parse configuration file: %1. Only use key=value syntax. - Erro: Não foi possível interpretar arquivo de configuração: %1. Utilize apenas a sintaxe chave=valor. + %1 d + %1 d - Error: Invalid combination of -regtest and -testnet. - Erro: Combinação inválida de-regtest e testnet. + %1 h + %1 h - Bitcoin Core didn't yet exit safely... - + %1 m + %1 m - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Digite um endereço Bitcoin (exemplo: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + %1 s + %1 s + + + NETWORK + REDE + + + UNKNOWN + DESCONHECIDO + + + None + Nenhum + + + N/A + N/A + + + %1 ms + %1 ms @@ -1438,8 +1404,24 @@ Endereço: %4 Quantidade atual de blocos - Estimated total blocks - Total estimado de blocos + Received + Recebido + + + Sent + Enviado + + + &Peers + &Pares + + + Version + Versão + + + Services + Serviços Last block time @@ -1475,7 +1457,7 @@ Endereço: %4 Build date - Data do 'build' + Data do 'build' Debug log file @@ -1503,11 +1485,11 @@ Endereço: %4 %1 B - 1% B + %1 B %1 KB - 1% KB + %1 KB %1 MB @@ -1518,18 +1500,34 @@ Endereço: %4 %1 GB - %1 m - %1 m + via %1 + por %1 - %1 h - %1 h + never + nunca - %1 h %2 m - %1 h %2 m + Inbound + Entrada - + + Outbound + Saída + + + Yes + Sim + + + No + Não + + + Unknown + Desconhecido + + ReceiveCoinsDialog @@ -1741,10 +1739,6 @@ Endereço: %4 Fee: Taxa: - - Low Output: - Rendimento baixo: - After Fee: Depois da taxa: @@ -1773,6 +1767,10 @@ Endereço: %4 Clear all fields of the form. Limpar todos os campos do formulário. + + Dust: + Poeira: + Clear &All Limpar Tudo @@ -1821,10 +1819,6 @@ Endereço: %4 Copy priority Copia prioridade - - Copy low output - Copia saída de pouco valor - Copy change Copia alteração @@ -1877,6 +1871,10 @@ Endereço: %4 Warning: Unknown change address Atenção: endereço de troco desconhecido + + Copy dust + Copiar poeira + Are you sure you want to send? Tem certeza que quer enviar? @@ -1885,14 +1883,6 @@ Endereço: %4 added as transaction fee Adicionado como taxa de transação - - Payment request expired - Pedido de pagamento expirado - - - Invalid payment address %1 - Endereço de pagamento inválido %1 - SendCoinsEntry @@ -1904,10 +1894,6 @@ Endereço: %4 Pay &To: Pagar &Para: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - O endereço para onde enviar o pagamento (ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Digite um rótulo para este endereço para adicioná-lo ao catálogo de endereços @@ -1994,10 +1980,6 @@ Endereço: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Você pode assinar mensagens com seus endereços para provar que você é o dono deles. Seja cuidadoso para não assinar algo vago, pois ataques de pishing podem tentar te enganar para dar sua assinatura de identidade para eles. Apenas assine afirmações completamente detalhadas com as quais você concorda. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Endereço a ser usado para assinar a mensagem (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Choose previously used address Escolha um endereço usado anteriormente @@ -2048,11 +2030,7 @@ Endereço: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - Forneça o endereço da assinatura, a mensagem (se assegure que você copiou quebras de linha, espaços, tabs, etc. exatamente) e a assinatura abaixo para verificar a mensagem. Cuidado para não ler mais na assinatura do que está escrito na mensagem propriamente, para evitar ser vítima de uma ataque do tipo "man-in-the-middle". - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - O endereço usado para assinar a mensagem (ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + Forneça o endereço da assinatura, a mensagem (se assegure que você copiou quebras de linha, espaços, tabs, etc. exatamente) e a assinatura abaixo para verificar a mensagem. Cuidado para não ler mais na assinatura do que está escrito na mensagem propriamente, para evitar ser vítima de uma ataque do tipo "man-in-the-middle". Verify the message to ensure it was signed with the specified Bitcoin address @@ -2060,19 +2038,15 @@ Endereço: %4 Verify &Message - Verificar %Mensagem + Verificar &Mensagem Reset all verify message fields Limpar todos os campos de assinatura da mensagem - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Digite um endereço Bitcoin (exemplo: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Clique em "Assinar Mensagem" para gerar a assinatura + Click "Sign Message" to generate signature + Clique em "Assinar Mensagem" para gerar a assinatura The entered address is invalid. @@ -2112,7 +2086,7 @@ Endereço: %4 The signature did not match the message digest. - A assinatura não corresponde ao "resumo da mensagem". + A assinatura não corresponde ao "resumo da mensagem". Message verification failed. @@ -2244,8 +2218,8 @@ Endereço: %4 Mercador - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - Bitcoins recém minerados precisam aguardar %1 blocos antes de serem gastos. Quando o bloco foi gerado, ele foi disseminado pela rede para ser adicionado à cadeia de blocos: blockchain. Se ele falhar em ser inserido na cadeia, seu estado será modificado para "não aceito" e ele não poderá ser gasto. Isso pode acontecer eventualmente quando blocos são gerados quase que simultaneamente. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Bitcoins recém minerados precisam aguardar %1 blocos antes de serem gastos. Quando o bloco foi gerado, ele foi disseminado pela rede para ser adicionado à cadeia de blocos: blockchain. Se ele falhar em ser inserido na cadeia, seu estado será modificado para "não aceito" e ele não poderá ser gasto. Isso pode acontecer eventualmente quando blocos são gerados quase que simultaneamente. Debug information @@ -2309,10 +2283,6 @@ Endereço: %4 Address Endereço - - Amount - Quantidade - Immature (%1 confirmations, will be available after %2) Recém-criado (%1 confirmações, disponível somente após %2) @@ -2524,10 +2494,6 @@ Endereço: %4 Address Endereço - - Amount - Quantidade - ID ID @@ -2541,6 +2507,9 @@ Endereço: %4 para + + UnitDisplayStatusBarControl + WalletFrame @@ -2592,18 +2561,6 @@ Endereço: %4 bitcoin-core - - Usage: - Uso: - - - List commands - Lista de comandos - - - Get help for a command - Obtenha ajuda sobre um comando - Options: Opções: @@ -2644,10 +2601,6 @@ Endereço: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Número de segundos para impedir que peers mal comportados reconectem (padrão: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Um erro ocorreu ao configurar a porta RPC %u para escuta em IPv4: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Escutar conexões JSON-RPC na porta <porta> (padrão: 8332 ou testnet: 18332) @@ -2656,10 +2609,6 @@ Endereço: %4 Accept command line and JSON-RPC commands Aceitar linha de comando e comandos JSON-RPC - - Bitcoin Core RPC client version - Versão do cliente Bitcoin Core RPC - Run in the background as a daemon and accept commands Rodar em segundo plano como serviço e aceitar comandos @@ -2682,7 +2631,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, você deve especificar uma senha rpcpassword no arquivo de configuração:⏎ %s⏎ @@ -2693,17 +2642,13 @@ rpcpassword=%s⏎ O nome de usuário e a senha NÃO PODEM ser os mesmos.⏎ Se o arquivo não existir, crie um com permissão de leitura apenas para o dono.⏎ É recomendado também definir um alertnotify para que você seja notificado de problemas;⏎ -por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ +por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Codificadores aceitos (padrão: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Um erro ocorreu ao configurar a porta RPC %u para escuta em IPv6, voltando ao IPv4: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Vincular ao endereço fornecido e sempre escutar nele. Use a notação [host]:port para IPv6 @@ -2712,18 +2657,10 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) Restringe a taxa de transações gratuitas para <n>*1000 bytes por minuto (padrão:15) - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Entre em modo de teste de regressão, que utiliza uma cadeia especial em que os blocos podem ser resolvido imediatamente. Este destina-se a ferramentas de teste de regressão e de desenvolvimento de aplicativos. - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Entra no modo de teste de regressão, que usa uma cadeia especial onde os blocos podem ser resolvidos instantaneamente. - - Error: Listening for incoming connections failed (listen returned error %d) - Erro: Falha ao tentar aguardar conexões de entrada (erro retornado %d) - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Erro: A transação foi rejeitada. Isso pode acontecer se alguns dos bitcoins de sua carteira já haviam sido gastos, por exemplo se você usou uma cópia do arquivo wallet.dat e alguns bitcoins foram gastos na cópia mas não foram marcados como gastos aqui. @@ -2736,10 +2673,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Executar comando quando uma transação da carteira mudar (%s no comando será substituído por TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - Taxas menores que esta são consideradas taxa zero (para criação da transação) (padrão: - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) Descarrega a atividade do banco de dados da memória para log em disco a cada <n> megabytes (padrão: 100) @@ -2776,10 +2709,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Atenção: valor de -paytxfee escolhido é muito alto! Este é o valor da taxa de transação que você irá pagar se enviar a transação. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Atenção: Por favor, verifique que a data e hora do seu computador estão corretas! Se o seu relógio estiver errado, o Bitcoin não irá funcionar corretamente. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Atenção: A rede não parecem concordar plenamente! Alguns mineiros parecem estar enfrentando problemas. @@ -2812,30 +2741,14 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Attempt to recover private keys from a corrupt wallet.dat Tentar recuperar chaves privadas de um arquivo wallet.dat corrompido - - Bitcoin Core Daemon - Bitcoin Core Daemon - Block creation options: Opções de criação de blocos: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - Limpa a lista de transações da carteira (ferramenta de diagnóstico; implica -rescan) - Connect only to the specified node(s) Conectar apenas a nó(s) específico(s) - - Connect through SOCKS proxy - Conecta através de proxy SOCKS - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - Conectar-se ao JSON-RPC em <port> (padrão: 8332 or testnet: 18332) - Connection options: Opções de conexão: @@ -2936,18 +2849,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write undo data Falha ao escrever dados para desfazer ações - - Fee per kB to add to transactions you send - Taxa por kB para adicionar às transações que você envia - - - Fees smaller than this are considered zero fee (for relaying) (default: - Taxas menores que esta são consideradas taxa zero (para relay) (padrão: - - - Find peers using DNS lookup (default: 1 unless -connect) - Procurar pares usando consulta de DNS (padrão: 1 a menos que a opção -connect esteja presente) - Force safe mode (default: 0) Força modo seguro (padrão: 0) @@ -2973,8 +2874,8 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Bloco gênese incorreto ou não encontrado. Datadir errado para a rede? - Invalid -onion address: '%s' - Endereço -onion inválido: '%s' + Invalid -onion address: '%s' + Endereço -onion inválido: '%s' Not enough file descriptors available. @@ -2984,18 +2885,10 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Prepend debug output with timestamp (default: 1) Adiciona timestamp como prefixo no debug (padrão: 1) - - RPC client options: - Opções de cliente RPC: - Rebuild block chain index from current blk000??.dat files Reconstruir índice de blockchain a partir dos arquivos atuais blk000??.dat - - Select SOCKS version for -proxy (4 or 5, default: 5) - Seleciona versão SOCKS para -proxy (4 ou 5, padrão: 5) - Set database cache size in megabytes (%d to %d, default: %d) Define o tamanho do cache do banco de dados em megabytes (%d para %d, padrão: %d) @@ -3017,12 +2910,12 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Permite gastar troco não confirmado ao criar transações (padrão: 1) - This is intended for regression testing tools and app development. - Isso é usado para testes de regressão e ferramentas de desenvolvimento. + Stop running after importing blocks from disk (default: 0) + Parar de executar após importar blocos do disco (padrão: 0) - Usage (deprecated, use bitcoin-cli): - Exemplo de uso (obsoleto, use bitcoin-cli): + This is intended for regression testing tools and app development. + Isso é usado para testes de regressão e ferramentas de desenvolvimento. Verifying blocks... @@ -3032,22 +2925,14 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Verifying wallet... Verificando carteira... - - Wait for RPC server to start - Aguarde um servidor RPC para iniciar - Wallet %s resides outside data directory %s - Carteira de% s reside fora de dados do diretório% s + Carteira %s reside fora do diretório de dados %s Wallet options: Opções da Carteira: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - Atenção: Parâmetro obsoleto -debugnet foi ignorado, use -debug=net - You need to rebuild the database using -reindex to change -txindex Você precisa reconstruir o banco de dados utilizando-reindexar a mudar-txindex @@ -3056,13 +2941,33 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Imports blocks from external blk000??.dat file Importar blocos de um arquivo externo blk000??.dat + + An error occurred while setting up the RPC address %s port %u for listening: %s + Um erro ocorreu enquanto configurando o endereço RPC %s porta %u para escuta: %s + Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. Não foi possível obter proteção exclusiva ao diretório de dados %s. Bitcoin Core já está sendo executado provavelmente. + + Error: Listening for incoming connections failed (listen returned error %s) + Erro: Escutar por conexões de entrada falhou (escutar retornou erro %s) + + + Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) + Executa comando quando uma transação da rede gasta novamente uma transação de entrada da carteira (%s=TxID do gasto duplo, %t=TxID da Carteira) + Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - Executa o comando quando um alerta relevante é recebido ou vemos um longo garfo (% s em cmd é substituída pela mensagem) + Executa o comando quando um alerta relevante é recebido ou vemos uma longa segregação (%s em cmd é substituído pela mensagem) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) + Taxas (em BTC/Kb) menores do que este valor são consideradas inexistentes para divulgação (padrão: %s) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) + Taxas (em BTC/Kb) menores do que este valor são consideradas inexistentes para a criação da transação (padrão: %s) Output debugging information (default: 0, supplying <category> is optional) @@ -3072,17 +2977,49 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Define o tamanho máximo de alta-prioridade por taxa baixa nas transações em bytes (padrão: %d) + + Cannot resolve -whitebind address: '%s' + Impossível resolver endereço -whitebind: '%s' + + + Copyright (C) 2009-%i The Bitcoin Core Developers + Copyright (C) 2009-%i Desenvolvedores Bitcoin Core + + + Could not parse -rpcbind value %s as network address + Impossível interpretar o valor -rpcbind %s como um endereço da rede + + + Fee (in BTC/kB) to add to transactions you send (default: %s) + Taxa (em BTC/kB) a adicionar nas transações que você envia (padrão: %s) + + + Include IP addresses in debug output (default: 0) + Incluir endereços IP na saída de depuração (padrão: 0) + Information Informação - Invalid amount for -minrelaytxfee=<amount>: '%s' - Quantidade inválida para -minrelaytxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Quantidade inválida para -minrelaytxfee=<amount>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - Inválido montante for-mintxfee = <amount>: '% s' + Invalid amount for -mintxfee=<amount>: '%s' + Valor inválido para -mintxfee=<amount>: '%s' + + + Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) + Valor inválido para -paytxfee=<amount>: '%s' (precisa ser no mínimo %s) + + + Invalid netmask specified in -whitelist: '%s' + Máscara de rede especificada em -whitelist: '%s' é inválida + + + Keep at most <n> unconnectable blocks in memory (default: %u) + Manter no máximo <n> blocos pendentes em memória (padrão: %u) Limit size of signature cache to <n> entries (default: 50000) @@ -3104,6 +3041,10 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) Buffer máximo de envio por conexão, <n>*1000 bytes (padrão: 1000) + + Need to specify a port with -whitebind: '%s' + Necessário informar uma porta com -whitebind: '%s' + Only accept block chain matching built-in checkpoints (default: 1) Apenas aceitar cadeia de blocos correspondente a marcas de verificação internas (padrão: 1) @@ -3140,14 +3081,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Run a thread to flush wallet periodically (default: 1) Executa uma thread para limpar a carteira periodicamente (padrão: 1) - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - Opções SSL: (veja a Wiki do Bitcoin para instruções de configuração SSL) - - - Send command to Bitcoin Core - Enviar comando ao Bitcoin Core - Send trace/debug info to console instead of debug.log file Mandar informação de trace/debug para o console em vez de para o arquivo debug.log @@ -3164,10 +3097,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Show all debugging options (usage: --help -help-debug) Exibir todas opções de debug (uso: --help -help-debug) - - Show benchmark information (default: 0) - Exibir informação de benchmark (padrão: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Encolher arquivo debug.log ao iniciar o cliente (padrão 1 se opção -debug não estiver presente) @@ -3180,14 +3109,14 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Specify connection timeout in milliseconds (default: 5000) Especifique o tempo limite (timeout) da conexão em milissegundos (padrão: 5000) - - Start Bitcoin Core Daemon - Inicializar serviço Bitcoin Core - System error: Erro de sistema: + + This is experimental software. + Este é um software experimental. + Transaction amount too small Quantidade da transação muito pequena. @@ -3200,6 +3129,10 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Transaction too large Transação muito larga + + Unable to bind to %s on this computer (bind returned error %s) + Impossível se ligar a %s neste computador (bind retornou erro %s) + Use UPnP to map the listening port (default: 0) Usar UPnP para mapear porta de escuta (padrão: 0) @@ -3228,10 +3161,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. on startup ao iniciar - - version - versão - wallet.dat corrupt, salvage failed wallet.dat corrompido, recuperação falhou @@ -3240,14 +3169,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Password for JSON-RPC connections Senha para conexões JSON-RPC - - Allow JSON-RPC connections from specified IP address - Permitir conexões JSON-RPC de endereços IP específicos - - - Send commands to node running on <ip> (default: 127.0.0.1) - Enviar comando para nó rodando em <ip> (padrão: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Executar comando quando o melhor bloco mudar (%s no comando será substituído pelo hash do bloco) @@ -3280,10 +3201,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message Esta mensagem de ajuda - - Unable to bind to %s on this computer (bind returned error %d, %s) - Impossível vincular a %s neste computador (bind retornou erro %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Permitir consultas DNS para -addnode, -seednode e -connect @@ -3296,41 +3213,29 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted Erro ao carregar wallet.dat: Carteira corrompida - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Erro ao carregar wallet.dat: Carteira requer uma versão mais nova do Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - A Carteira precisou ser reescrita: reinicie o Bitcoin para completar - Error loading wallet.dat Erro ao carregar wallet.dat - Invalid -proxy address: '%s' - Endereço -proxy inválido: '%s' + Invalid -proxy address: '%s' + Endereço -proxy inválido: '%s' - Unknown network specified in -onlynet: '%s' - Rede desconhecida especificada em -onlynet: '%s' + Unknown network specified in -onlynet: '%s' + Rede desconhecida especificada em -onlynet: '%s' - Unknown -socks proxy version requested: %i - Versão desconhecida do proxy -socks requisitada: %i + Cannot resolve -bind address: '%s' + Impossível encontrar o endereço -bind: '%s' - Cannot resolve -bind address: '%s' - Impossível encontrar o endereço -bind: '%s' + Cannot resolve -externalip address: '%s' + Impossível encontrar endereço -externalip: '%s' - Cannot resolve -externalip address: '%s' - Impossível encontrar endereço -externalip: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Quantidade inválida para -paytxfee=<quantidade>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Quantidade inválida para -paytxfee=<quantidade>: '%s' Invalid amount @@ -3376,13 +3281,5 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error Erro - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Você precisa especificar rpcpassword=<senha> no arquivo de configurações:⏎ -%s⏎ -Se o arquivo não existir, crie um com permissão de leitura apenas pelo dono - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_pt_PT.ts b/src/qt/locale/bitcoin_pt_PT.ts index 7a9595a6dd..2d277528b1 100644 --- a/src/qt/locale/bitcoin_pt_PT.ts +++ b/src/qt/locale/bitcoin_pt_PT.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - Sobre o Bitcoin Core - - - <b>Bitcoin Core</b> version - versão do <b>Bitcoin Core</b> - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Este é um programa experimental. - -Distribuído sob uma licença de software MIT/X11, por favor verifique o ficheiro anexo license.txt ou http://www.opensource.org/licenses/mit-license.php. - -Este produto inclui software desenvolvido pelo Projecto OpenSSL para uso no OpenSSL Toolkit (http://www.openssl.org/), software criptográfico escrito por Eric Young (eay@cryptsoft.com) e software UPnP escrito por Thomas Bernard. - - - Copyright - Copyright - - - The Bitcoin Core developers - Os programadores Bitcoin Core - - - (%1-bit) - - - + AddressBookPage @@ -130,11 +93,7 @@ Este produto inclui software desenvolvido pelo Projecto OpenSSL para uso no Open Exporting Failed A Exportação Falhou - - There was an error trying to save the address list to %1. - Ocorreu um erro ao tentar guardar a lista de endereços em %1. - - + AddressTableModel @@ -168,10 +127,6 @@ Este produto inclui software desenvolvido pelo Projecto OpenSSL para uso no Open Repeat new passphrase Repita a nova frase de segurança - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Insira a nova frase de segurança da sua carteira.<br/>Por favor, use uma frase de <b>10 ou mais caracteres aleatórios,</b> ou <b>oito ou mais palavras</b>. - Encrypt wallet Encriptar carteira @@ -295,10 +250,6 @@ Este produto inclui software desenvolvido pelo Projecto OpenSSL para uso no Open Quit application Sair da aplicação - - Show information about Bitcoin - Mostrar informação sobre o Bitcoin - About &Qt Sobre &Qt @@ -459,10 +410,6 @@ Este produto inclui software desenvolvido pelo Projecto OpenSSL para uso no Open Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options Mostrar a mensagem de ajuda do Bitcoin Core para obter uma lista com possíveis opções de linha de comandos - - Bitcoin client - Cliente Bitcoin - %n active connection(s) to Bitcoin network %n ligação ativa à rede Bitcoin%n ligações ativas à rede Bitcoin @@ -471,10 +418,6 @@ Este produto inclui software desenvolvido pelo Projecto OpenSSL para uso no Open No block source available... Nenhuma fonte de blocos disponível... - - Processed %1 of %2 (estimated) blocks of transaction history. - Processados %1 de %2 blocos (estimados) do histórico de transacções. - Processed %1 blocks of transaction history. Processados %1 blocos do histórico de transações. @@ -558,10 +501,6 @@ Endereço: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> A carteira está <b>encriptada</b> e atualmente <b>bloqueada</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Ocorreu um erro fatal. O Bitcoin não pode continuar com segurança e irá fechar. - ClientModel @@ -596,10 +535,6 @@ Endereço: %4 Fee: Taxa: - - Low Output: - Saída Baixa: - After Fee: Depois da Taxa: @@ -688,10 +623,6 @@ Endereço: %4 Copy priority Copiar prioridade - - Copy low output - Copiar output baixo - Copy change Copiar alteração @@ -740,10 +671,6 @@ Endereço: %4 none nenhum - - Dust - - yes sim @@ -769,25 +696,13 @@ Endereço: %4 Transacções com uma prioridade mais alta têm uma maior probabilidade de serem incluídas num bloco. - This label turns red, if the priority is smaller than "medium". - Esta legenda fica vermelha, se a prioridade for menor que "média". + This label turns red, if the priority is smaller than "medium". + Esta legenda fica vermelha, se a prioridade for menor que "média". This label turns red, if any recipient receives an amount smaller than %1. Este rótulo fica vermelho se algum recipiente receber uma quantia menor que %1. - - This means a fee of at least %1 is required. - Isto significa que uma taxa de pelo menos %1 é necessária. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - Quantias abaixo de 0.546 vezes a taxa mínima de retransmissão são mostradas como "pó". - - - This label turns red, if the change is smaller than %1. - Esta legenda fica vermelha, se o troco for menor do que %1. - (no label) (sem rótulo) @@ -840,12 +755,12 @@ Endereço: %4 Editar endereço de saída - The entered address "%1" is already in the address book. - O endereço introduzido "%1" já se encontra no livro de endereços. + The entered address "%1" is already in the address book. + O endereço introduzido "%1" já se encontra no livro de endereços. - The entered address "%1" is not a valid Bitcoin address. - O endereço introduzido "%1" não é um endereço bitcoin válido. + The entered address "%1" is not a valid Bitcoin address. + O endereço introduzido "%1" não é um endereço bitcoin válido. Could not unlock wallet. @@ -881,10 +796,6 @@ Endereço: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Bitcoin Core - Opções de linha de comandos - Bitcoin Core Bitcoin Core @@ -893,6 +804,14 @@ Endereço: %4 version versão + + About Bitcoin Core + Sobre o Bitcoin Core + + + Command-line options + Opções de linha de comandos + Usage: Utilização: @@ -906,17 +825,13 @@ Endereço: %4 Opções de Interface - Set language, for example "de_DE" (default: system locale) - Definir linguagem, por exemplo "pt_PT" (por defeito: linguagem do sistema) + Set language, for example "de_DE" (default: system locale) + Definir linguagem, por exemplo "pt_PT" (por defeito: linguagem do sistema) Start minimized Iniciar minimizado - - Set SSL root certificates for payment request (default: -system-) - - Show splash screen on startup (default: 1) Mostrar imagem ao iniciar (por defeito: 1) @@ -942,7 +857,7 @@ Endereço: %4 Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - O Bitcoin Core vai transferir e armazenar uma cópia do "block chain" (cadeia de blocos). Pelo menos %1GB de dados serão armazenados nesta pasta, e vão crescer ao longo do tempo. A sua carteira também irá ser armazenada nesta pasta. + O Bitcoin Core vai transferir e armazenar uma cópia do "block chain" (cadeia de blocos). Pelo menos %1GB de dados serão armazenados nesta pasta, e vão crescer ao longo do tempo. A sua carteira também irá ser armazenada nesta pasta. Use the default data directory @@ -953,12 +868,8 @@ Endereço: %4 Utilizar uma pasta de dados personalizada: - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - Erro: Pasta de dados especificada "%1" não pôde ser criada. + Bitcoin Core + Bitcoin Core Error @@ -1046,14 +957,6 @@ Endereço: %4 IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Endereço IP do proxy (p.ex. IPv4: 127.0.0.1 / IPv6: ::1) - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - Active command-line options that override above options: Opções de linha de comandos ativas que se sobrepõem ás opções anteriores: @@ -1070,10 +973,6 @@ Endereço: %4 &Network &Rede - - (0 = auto, <0 = leave that many cores free) - - W&allet C&arteira @@ -1114,14 +1013,6 @@ Endereço: %4 Port of the proxy (e.g. 9050) Porta do proxy (p.ex. 9050) - - SOCKS &Version: - &Versão SOCKS: - - - SOCKS version of the proxy (e.g. 5) - Versão do proxy SOCKS (p.ex. 5) - &Window &Janela @@ -1162,14 +1053,6 @@ Endereço: %4 Choose the default subdivision unit to show in the interface and when sending coins. Escolha a subdivisão unitária a ser mostrada por defeito na aplicação e ao enviar moedas. - - Whether to show Bitcoin addresses in the transaction list or not. - Se mostrar, ou não, os endereços Bitcoin na lista de transações. - - - &Display addresses in transaction list - Mostrar en&dereços na lista de transações - Whether to show coin control features or not. Escolha para mostrar funcionalidades de Coin Control ou não. @@ -1273,12 +1156,12 @@ Endereço: %4 Manuseamento de URI - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - O URI não foi lido correctamente! Isto pode ser causado por um endereço Bitcoin inválido ou por parâmetros URI malformados. + Invalid payment address %1 + Endereço de pagamento inválido %1 Requested payment amount of %1 is too small (considered dust). - Quantia solicitada para pagamento de %1 é muito pequena (considerada "pó"). + Quantia solicitada para pagamento de %1 é muito pequena (considerada "pó"). Payment request error @@ -1288,14 +1171,6 @@ Endereço: %4 Cannot start bitcoin: click-to-pay handler Impossível iniciar o controlador de bitcoin: click-to-pay - - Net manager warning - Aviso do gestor de rede - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - O seu proxy ativo não suporta SOCKS5, que é necessário para efectuar pedidos de pagemento via proxy. - Payment request fetch URL is invalid: %1 O URL de pedido de pagamento é inválido: %1 @@ -1304,10 +1179,6 @@ Endereço: %4 Payment request file handling Controlo de pedidos de pagamento. - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - O ficheiro de pedido de pagamento não pôde ser lido ou processado! Isto pode ter sido causado por um ficheiro de pedido de pagamento inválido. - Unverified payment requests to custom payment scripts are unsupported. Pedidos de pagamento não-verificados para scripts de pagamento personalizados não são suportados. @@ -1320,10 +1191,6 @@ Endereço: %4 Error communicating with %1: %2 Erro ao comunicar com %1: %2 - - Payment request can not be parsed or processed! - O pedido de pagamento não pode ser lido ou processado! - Bad response from server %1 Má resposta do servidor %1 @@ -1337,33 +1204,28 @@ Endereço: %4 Erro de pedido de rede + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Quantia - Error: Specified data directory "%1" does not exist. - Erro: Pasta de dados especificada "%1" não existe. + %1 h + %1 h - Error: Cannot parse configuration file: %1. Only use key=value syntax. - + %1 m + %1 m - Error: Invalid combination of -regtest and -testnet. - Erro: Combinação inválida de -regtest e -testnet. + N/A + N/D - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Introduza um endereço Bitcoin (p.ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget @@ -1437,10 +1299,6 @@ Endereço: %4 Current number of blocks Número actual de blocos - - Estimated total blocks - Total estimado de blocos - Last block time Data do último bloco @@ -1517,19 +1375,7 @@ Endereço: %4 %1 GB %1 GB - - %1 m - %1 m - - - %1 h - %1 h - - - %1 h %2 m - %1 h %2 m - - + ReceiveCoinsDialog @@ -1741,10 +1587,6 @@ Endereço: %4 Fee: Taxa: - - Low Output: - Output Baixo: - After Fee: Depois da taxa: @@ -1821,10 +1663,6 @@ Endereço: %4 Copy priority Copiar prioridade - - Copy low output - Copiar output baixo - Copy change Copiar alteração @@ -1885,14 +1723,6 @@ Endereço: %4 added as transaction fee adicionados como taxa de transação - - Payment request expired - Pedido de pagamento expirou - - - Invalid payment address %1 - Endereço de pagamento inválido %1 - SendCoinsEntry @@ -1904,10 +1734,6 @@ Endereço: %4 Pay &To: &Pagar A: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - O endereço para onde enviar o pagamento (p.ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Escreva um rótulo para este endereço para o adicionar ao seu livro de endereços @@ -1994,10 +1820,6 @@ Endereço: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Pode assinar mensagens com os seus endereços para provar que são seus. Tenha atenção ao assinar mensagens ambíguas, pois ataques de phishing podem tentar enganá-lo de modo a assinar a sua identidade para os atacantes. Apenas assine declarações detalhadas com as quais concorde. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - O endereço a utilizar para assinar a mensagem (p.ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Choose previously used address Escolher endereço usado previamente @@ -2050,10 +1872,6 @@ Endereço: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Introduza o endereço de assinatura, mensagem (assegure-se que copia quebras de linha, espaços, tabulações, etc. exactamente) e assinatura abaixo para verificar a mensagem. Tenha atenção para não ler mais na assinatura do que o que estiver na mensagem assinada, para evitar ser enganado por um atacante que se encontre entre si e quem assinou a mensagem. - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - O endereço utilizado para assinar a mensagem (p.ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address Verifique a mensagem para assegurar que foi assinada com o endereço Bitcoin especificado @@ -2067,12 +1885,8 @@ Endereço: %4 Repor todos os campos de verificação de mensagem - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Introduza um endereço Bitcoin (p.ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Clique "Assinar mensagem" para gerar a assinatura + Click "Sign Message" to generate signature + Clique "Assinar mensagem" para gerar a assinatura The entered address is invalid. @@ -2244,8 +2058,8 @@ Endereço: %4 Comerciante - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - Moedas geradas deverão maturar por %1 blocos antes de poderem ser gastas. Quando gerou este bloco, ele foi transmitido para a rede para ser incluído na cadeia de blocos. Se a inclusão na cadeia de blocos falhar, o seu estado irá ser alterado para "não aceite" e as moedas não poderão ser gastas. Isto poderá acontecer ocasionalmente se outro nó da rede gerar um bloco a poucos segundos de diferença do seu. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Moedas geradas deverão maturar por %1 blocos antes de poderem ser gastas. Quando gerou este bloco, ele foi transmitido para a rede para ser incluído na cadeia de blocos. Se a inclusão na cadeia de blocos falhar, o seu estado irá ser alterado para "não aceite" e as moedas não poderão ser gastas. Isto poderá acontecer ocasionalmente se outro nó da rede gerar um bloco a poucos segundos de diferença do seu. Debug information @@ -2309,10 +2123,6 @@ Endereço: %4 Address Endereço - - Amount - Quantia - Immature (%1 confirmations, will be available after %2) Imaturo (%1 confirmações, estará disponível após %2) @@ -2524,10 +2334,6 @@ Endereço: %4 Address Endereço - - Amount - Quantia - ID ID @@ -2541,6 +2347,9 @@ Endereço: %4 até + + UnitDisplayStatusBarControl + WalletFrame @@ -2592,18 +2401,6 @@ Endereço: %4 bitcoin-core - - Usage: - Utilização: - - - List commands - Listar comandos - - - Get help for a command - Obter ajuda para um comando - Options: Opções: @@ -2644,10 +2441,6 @@ Endereço: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Número de segundos a impedir que nós com comportamento indesejado se liguem de novo (por defeito: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Ocorreu um erro ao definir a porta %u do serviço RPC a escutar em IPv4: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Escutar por ligações JSON-RPC na porta <n> (por defeito: 8332 ou rede de testes: 18332) @@ -2656,10 +2449,6 @@ Endereço: %4 Accept command line and JSON-RPC commands Aceitar comandos de linha de comandos e JSON-RPC - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Correr o processo em segundo plano e aceitar comandos @@ -2682,7 +2471,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, deverá definir uma rpcpassword no ficheiro de configuração: %s @@ -2693,36 +2482,20 @@ rpcpassword=%s O nome de utilizador e palavra-passe NÃO PODEM ser iguais. Se o ficheiro não existir, crie-o com permissões de leitura apenas para o dono. Também é recomendado definir um alertnotify para que seja alertado sobre problemas; -por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.com +por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Cifras aceitáveis (por defeito: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Ocorreu um erro ao definir a porta %u do serviço RPC a escutar em IPv6, a usar IPv4: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Associar a endereço específico e escutar sempre nele. Use a notação [anfitrião]:porta para IPv6 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Entre no modo de teste de regressão, que usa uma cadeia especial cujos blocos podem ser resolvidos instantaneamente. Isto têm como fim a realização de testes de regressão para pools e desenvolvimento de aplicações. - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Entre no modo de teste de regressão, que usa uma cadeia especial cujos blocos podem ser resolvidos instantaneamente. - - Error: Listening for incoming connections failed (listen returned error %d) - Erro: A Escuta de ligações de entrada falhou (retornou erro %d) - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Erro: A transação foi rejeitada! Isso poderá acontecer se algumas das moedas na sua carteira já tiverem sido gastas, se por exemplo tiver usado uma cópia do ficheiro wallet.dat e as moedas tiverem sido gastas na cópia mas não tiverem sido marcadas como gastas aqui. @@ -2735,30 +2508,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Executar comando quando uma das transações na carteira mudar (no comando, %s é substituído pelo ID da Transação) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Esta é uma versão de testes pré-lançamento - use à sua responsabilidade - não usar para minar ou aplicações comerciais @@ -2775,10 +2524,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Atenção: -paytxfee está definida com um valor muito alto! Esta é a taxa que irá pagar se enviar uma transação. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Atenção: Por favor verifique que a data e hora do seu computador estão correctas! Se o seu relógio não estiver certo o Bitcoin não irá funcionar correctamente. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Aviso: A rede não parece estar completamente de acordo! Parece que alguns mineiros estão com dificuldades técnicas. @@ -2795,14 +2540,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. Atenção: wallet.dat corrompido, dados recuperados! wallet.dat original salvo como wallet.{timestamp}.bak em %s; se o seu saldo ou transações estiverem incorrectos deverá recuperar uma cópia de segurança. - - (default: 1) - - - - (default: wallet.dat) - - <category> can be: <categoria> pode ser: @@ -2811,46 +2548,18 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo Attempt to recover private keys from a corrupt wallet.dat Tentar recuperar chaves privadas de um wallet.dat corrupto - - Bitcoin Core Daemon - Servidor Bitcoin Core - Block creation options: Opções de criação de bloco: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - Limpar lista de transações (ferramenta de diagnóstico; implica -rescan) - Connect only to the specified node(s) Apenas ligar ao(s) nó(s) especificado(s) - - Connect through SOCKS proxy - Ligar através de proxy SOCKS: - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - Ligar ao JSON-RPC na porta <n> (por defeito: 8332 ou rede de testes: 18332) - - - Connection options: - - Corrupted block database detected Cadeia de blocos corrompida detectada - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - Discover own IP address (default: 1 when listening and no -externalip) Descobrir endereço IP próprio (padrão: 1 ao escutar sem -externalip) @@ -2935,22 +2644,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo Failed to write undo data Falha ao escrever histórico de modificações - - Fee per kB to add to transactions you send - Taxa por KB a adicionar a transações enviadas - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - Encontrar pares usando procura DNS (por defeito: 1 excepto -connect) - - - Force safe mode (default: 0) - - Generate coins (default: 0) Gerar moedas (por defeito: 0) @@ -2963,17 +2656,13 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo If <category> is not supplied, output all debugging information. Se uma <categoria> não é fornecida, imprimir toda a informação de depuração. - - Importing... - - Incorrect or no genesis block found. Wrong datadir for network? Bloco génese incorreto ou nenhum bloco génese encontrado. Pasta de dados errada para a rede? - Invalid -onion address: '%s' - Endereço -onion inválido: '%s' + Invalid -onion address: '%s' + Endereço -onion inválido: '%s' Not enough file descriptors available. @@ -2983,21 +2672,13 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo Prepend debug output with timestamp (default: 1) Adicionar data e hora à informação de depuração (por defeito: 1) - - RPC client options: - Opções de cliente RPC: - Rebuild block chain index from current blk000??.dat files Reconstruir a cadeia de blocos a partir dos ficheiros blk000??.dat atuais - - Select SOCKS version for -proxy (4 or 5, default: 5) - Selecione a versão do proxy socks a usar (4 ou 5, por defeito: 5) - Set database cache size in megabytes (%d to %d, default: %d) - Definir o tamanho da cache de base de dados em megabytes (%d a %s, padrão: %d) + Definir o tamanho da cache de base de dados em megabytes (%d a %d, padrão: %d) Set maximum block size in bytes (default: %d) @@ -3019,10 +2700,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo This is intended for regression testing tools and app development. Isto têm como fim a realização de testes de regressão para pools e desenvolvimento de aplicações. - - Usage (deprecated, use bitcoin-cli): - Utilização (obsoleto, usar bitcoin-cli): - Verifying blocks... A verificar blocos... @@ -3031,10 +2708,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo Verifying wallet... A verificar carteira... - - Wait for RPC server to start - Esperar pelo ínicio do servidor RPC - Wallet %s resides outside data directory %s A carteira %s reside fora da pasta de dados %s @@ -3043,10 +2716,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo Wallet options: Opções da carteira: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - Atenção: Argumento obsoleto -debugnet ignorado, usar -debug=net - You need to rebuild the database using -reindex to change -txindex É necessário reconstruir as bases de dados usando -reindex para mudar o -txindex @@ -3076,20 +2745,12 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo Informação - Invalid amount for -minrelaytxfee=<amount>: '%s' - Quantia inválida para -minrelaytxfee=<quantidade>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Quantia inválida para -minrelaytxfee=<quantidade>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - Quantia inválida para -mintxfee=<quantidade>: '%s' - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - + Invalid amount for -mintxfee=<amount>: '%s' + Quantia inválida para -mintxfee=<quantidade>: '%s' Maintain a full transaction index (default: 0) @@ -3111,42 +2772,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo Only connect to nodes in network <net> (IPv4, IPv6 or Tor) Apenas ligar a nós na rede <net> (IPv4, IPv6 ou Tor) - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - Opções SSL: (ver a Bitcoin Wiki para instruções de configuração SSL) - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file Enviar informação de rastreio/depuração para a consola e não para o ficheiro debug.log @@ -3155,18 +2780,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo Set minimum block size in bytes (default: 0) Definir tamanho minímo de um bloco em bytes (por defeito: 0) - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - Shrink debug.log file on client startup (default: 1 when no -debug) Encolher ficheiro debug.log ao iniciar o cliente (por defeito: 1 sem -debug definido) @@ -3179,10 +2792,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo Specify connection timeout in milliseconds (default: 5000) Especificar tempo de espera da ligação em millisegundos (por defeito: 5000) - - Start Bitcoin Core Daemon - - System error: Erro de sistema: @@ -3223,14 +2832,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo Zapping all transactions from wallet... A limpar todas as transações da carteira... - - on startup - - - - version - versão - wallet.dat corrupt, salvage failed wallet.dat corrompido, recuperação falhou @@ -3239,14 +2840,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo Password for JSON-RPC connections Palavra-passe para ligações JSON-RPC - - Allow JSON-RPC connections from specified IP address - Permitir ligações JSON-RPC do endereço IP especificado - - - Send commands to node running on <ip> (default: 127.0.0.1) - Enviar comandos para o nó a correr em <ip> (por defeito: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Executar comando quando o melhor bloco mudar (no comando, %s é substituído pela hash do bloco) @@ -3279,10 +2872,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo This help message Esta mensagem de ajuda - - Unable to bind to %s on this computer (bind returned error %d, %s) - Incapaz de vincular à porta %s neste computador (vínculo retornou erro %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Permitir procuras DNS para -addnode, -seednode e -connect @@ -3295,41 +2884,29 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo Error loading wallet.dat: Wallet corrupted Erro ao carregar wallet.dat: Carteira danificada - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Erro ao carregar wallet.dat: A Carteira requer uma versão mais recente do Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - A Carteira precisou de ser reescrita: reinicie o Bitcoin para completar o processo - Error loading wallet.dat Erro ao carregar wallet.dat - Invalid -proxy address: '%s' - Endereço -proxy inválido: '%s' + Invalid -proxy address: '%s' + Endereço -proxy inválido: '%s' - Unknown network specified in -onlynet: '%s' - Rede desconhecida especificada em -onlynet: '%s' + Unknown network specified in -onlynet: '%s' + Rede desconhecida especificada em -onlynet: '%s' - Unknown -socks proxy version requested: %i - Versão de proxy -socks requisitada desconhecida: %i + Cannot resolve -bind address: '%s' + Não foi possível resolver o endereço -bind: '%s' - Cannot resolve -bind address: '%s' - Não foi possível resolver o endereço -bind: '%s' + Cannot resolve -externalip address: '%s' + Não foi possível resolver o endereço -externalip: '%s' - Cannot resolve -externalip address: '%s' - Não foi possível resolver o endereço -externalip: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Quantia inválida para -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Quantia inválida para -paytxfee=<amount>: '%s' Invalid amount @@ -3375,13 +2952,5 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo Error Erro - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Deverá definir rpcpassword=<password> no ficheiro de configuração: -%s -Se o ficheiro não existir, crie-o com permissões de leitura apenas para o dono. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_ro_RO.ts b/src/qt/locale/bitcoin_ro_RO.ts index d09c40f62e..c9cad3d92a 100644 --- a/src/qt/locale/bitcoin_ro_RO.ts +++ b/src/qt/locale/bitcoin_ro_RO.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - Despre Nucleul Bitcoin - - - <b>Bitcoin Core</b> version - <b>Nucleul Bitcoin </b> versiune - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Acesta este un program experimental. - -Distribuit sub licența de programe MIT/X11, vezi fișierul însoțitor COPYING sau http://www.opensource.org/licenses/mit-license.php. - -Acest produs include programe dezvoltate de către OpenSSL Project pentru a fi folosite în OpenSSL Toolkit (http://www.openssl.org/) și programe criptografice scrise de către Eric Young (eay@cryptsoft.com) și programe UPnP scrise de către Thomas Bernard. - - - Copyright - Drepturi de autor - - - The Bitcoin Core developers - Dezvoltatorii Bitcoin Core - - - (%1-bit) - - - + AddressBookPage @@ -130,11 +93,7 @@ Acest produs include programe dezvoltate de către OpenSSL Project pentru a fi f Exporting Failed Exportare esuata - - There was an error trying to save the address list to %1. - A apărut o eroare încercând să se salveze lista de adrese la %1. - - + AddressTableModel @@ -168,10 +127,6 @@ Acest produs include programe dezvoltate de către OpenSSL Project pentru a fi f Repeat new passphrase Repetă noua frază de acces - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Introdu noua parolă a portofelului electronic.<br/>Te rog folosește <b>minim 10 caractere aleatoare</b>, sau <b>minim 8 cuvinte</b>. - Encrypt wallet Criptează portofelul @@ -295,10 +250,6 @@ Acest produs include programe dezvoltate de către OpenSSL Project pentru a fi f Quit application Închide aplicația - - Show information about Bitcoin - Arată informații despre Bitcoin - About &Qt Despre &Qt @@ -323,14 +274,6 @@ Acest produs include programe dezvoltate de către OpenSSL Project pentru a fi f &Change Passphrase... S&chimbă parola... - - &Sending addresses... - - - - &Receiving addresses... - - Open &URI... Vizitaţi &URI... @@ -455,14 +398,6 @@ Acest produs include programe dezvoltate de către OpenSSL Project pentru a fi f &Command-line options Command-line setări - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Client Bitcoin - %n active connection(s) to Bitcoin network %n conexiune activă către rețeaua Bitcoin%n conexiuni active către rețeaua Bitcoin%n de conexiuni active către rețeaua Bitcoin @@ -471,10 +406,6 @@ Acest produs include programe dezvoltate de către OpenSSL Project pentru a fi f No block source available... Nici o sursă de bloc disponibil ... - - Processed %1 of %2 (estimated) blocks of transaction history. - S-a procesat %1 din %2 block-uri (estimate) din istoria tranzactiei. - Processed %1 blocks of transaction history. S-au procesat %1 blocuri din istoricul tranzacțiilor. @@ -495,10 +426,6 @@ Acest produs include programe dezvoltate de către OpenSSL Project pentru a fi f %1 and %2 %1 si %2 - - %n year(s) - - %1 behind %1 în urmă @@ -559,10 +486,6 @@ Adresa: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Portofelul este <b>criptat</b> iar în momentul de față este <b>blocat</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - A survenit o eroare fatala. Bitcoin nu mai poate continua in siguranta si se va opri. - ClientModel @@ -597,10 +520,6 @@ Adresa: %4 Fee: Taxa: - - Low Output: - Ieşire minimă: - After Fee: După taxe: @@ -689,10 +608,6 @@ Adresa: %4 Copy priority Copiaţi prioritatea - - Copy low output - Copiaţi ieşire minimă: - Copy change Copiaţi schimb @@ -733,18 +648,10 @@ Adresa: %4 lowest cel mai scazut - - (%1 locked) - (1% blocat) - none nimic - - Dust - Praf - yes da @@ -757,10 +664,6 @@ Adresa: %4 This label turns red, if the transaction size is greater than 1000 bytes. Această etichetă devine roşie, în cazul în care dimensiunea tranzacţiei este mai mare de 1000 de octeţi. - - This means a fee of at least %1 per kB is required. - Aceasta înseamnă o taxă de cel puţin 1% pe kB necesar. - Can vary +/- 1 byte per input. Poate varia +/- 1 octet pentru fiecare intrare. @@ -770,25 +673,9 @@ Adresa: %4 Tranzacţiile cu prioritate mai mare sunt mai susceptibile de fi incluse într-un bloc. - This label turns red, if the priority is smaller than "medium". + This label turns red, if the priority is smaller than "medium". Aceasta eticheta se face rosie daca prioritatea e mai mica decat media - - This label turns red, if any recipient receives an amount smaller than %1. - Această etichetă devine roşie, dacă orice beneficiar primeşte o sumă mai mică decât 1. - - - This means a fee of at least %1 is required. - Aceasta înseamnă că o taxă de cel puţin 1% este necesară. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - Sume sub 0,546 ori taxa minima sunt indicate ca ignorate. - - - This label turns red, if the change is smaller than %1. - Această etichetă devine roşie, dacă schimbul e mai mic de 1%. - (no label) (fără etichetă) @@ -841,12 +728,12 @@ Adresa: %4 Editează adresa de trimitere - The entered address "%1" is already in the address book. - Adresa introdusă "%1" se află deja în lista de adrese. + The entered address "%1" is already in the address book. + Adresa introdusă "%1" se află deja în lista de adrese. - The entered address "%1" is not a valid Bitcoin address. - Adresa introdusă "%1" nu este o adresă bitcoin validă. + The entered address "%1" is not a valid Bitcoin address. + Adresa introdusă "%1" nu este o adresă bitcoin validă. Could not unlock wallet. @@ -882,10 +769,6 @@ Adresa: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Bitcoin Core - Opţiuni Linie de comandă - Bitcoin Core Bitcoin Core @@ -894,6 +777,14 @@ Adresa: %4 version versiunea + + About Bitcoin Core + Despre Nucleul Bitcoin + + + Command-line options + Command-line setări + Usage: Uz: @@ -907,17 +798,13 @@ Adresa: %4 UI setări - Set language, for example "de_DE" (default: system locale) - Seteaza limba, de exemplu: "de_DE" (initialt: system locale) + Set language, for example "de_DE" (default: system locale) + Seteaza limba, de exemplu: "de_DE" (initialt: system locale) Start minimized Incepe miniaturizare - - Set SSL root certificates for payment request (default: -system-) - - Show splash screen on startup (default: 1) Afișează pe ecran splash la pornire (implicit: 1) @@ -941,10 +828,6 @@ Adresa: %4 As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. Dacă aceasta este prima dată când programul este lansat, puteţi alege unde Nucleul Bitcoin va stoca datele. - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - Nucleul Bitcoin Core se va descărca şi va stoca o copie a lanţului blocului Bitcoin. Cel puţin 1GB de date vor fi stocate in acest dosar şi se va dezvolta în timp. Portofelul va fi, de asemenea, stocat în acest dosar. - Use the default data directory Folosește dosarul de date implicit @@ -954,12 +837,8 @@ Adresa: %4 Folosește un dosar de date personalizat: - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - Eroare: Directorul datelor specificate "%1" nu poate fi creat. + Bitcoin Core + Bitcoin Core Error @@ -1023,42 +902,14 @@ Adresa: %4 &Start Bitcoin on system login &S Porneşte Bitcoin la pornirea sistemului - - Size of &database cache - - MB MB - - Number of script &verification threads - - Connect to the Bitcoin network through a SOCKS proxy. Conecteaza-te la reteaua Bitcoin printr-un proxy SOCKS - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - Reset all client options to default. Resetează toate setările clientului la valorile implicite. @@ -1071,30 +922,10 @@ Adresa: %4 &Network &Retea - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - Expert expert - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Deschide automat în router portul aferent clientului Bitcoin. Funcţionează doar în cazul în care routerul e compatibil UPnP şi opţiunea e activată. @@ -1115,14 +946,6 @@ Adresa: %4 Port of the proxy (e.g. 9050) Portul pe care se concetează proxy serverul (de exemplu: 9050) - - SOCKS &Version: - SOCKS &Versiune: - - - SOCKS version of the proxy (e.g. 5) - Versiunea SOCKS a proxiului (ex. 5) - &Window &Fereastra @@ -1163,14 +986,6 @@ Adresa: %4 Choose the default subdivision unit to show in the interface and when sending coins. Alege subdiviziunea folosită la afişarea interfeţei şi la trimiterea de bitcoin. - - Whether to show Bitcoin addresses in the transaction list or not. - Vezi dacă adresele Bitcoin sunt în lista de tranzacție sau nu - - - &Display addresses in transaction list - &Afişează adresele în lista de tranzacţii - Whether to show coin control features or not. Dacă să se afişeze controlul caracteristicilor monedei sau nu. @@ -1274,8 +1089,8 @@ Adresa: %4 Gestionare URI - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI nu poate fi analizat! Acest lucru poate fi cauzat de o adresa Bitcoin invalida sau parametri deformati URI. + Invalid payment address %1 + Adresă pentru plată nevalidă %1 Requested payment amount of %1 is too small (considered dust). @@ -1289,26 +1104,6 @@ Adresa: %4 Cannot start bitcoin: click-to-pay handler Nu poate porni bitcoin: regula clic-pentru-plata - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - Unverified payment requests to custom payment scripts are unsupported. Cereri de plată neverificate prin script-uri personalizate de plată nu sunt suportate. @@ -1321,10 +1116,6 @@ Adresa: %4 Error communicating with %1: %2 Eroare la comunicarea cu %1: %2 - - Payment request can not be parsed or processed! - - Bad response from server %1 Răspuns greșit de la server %1 @@ -1338,33 +1129,28 @@ Adresa: %4 Eroare în cererea de rețea + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Sumă - Error: Specified data directory "%1" does not exist. - Eroare: Directorul datelor specificate "%1" nu exista. + %1 h + %1 h - Error: Cannot parse configuration file: %1. Only use key=value syntax. - + %1 m + %1 m - Error: Invalid combination of -regtest and -testnet. - Eroare: combinație nevalidă de -regtest și -testnet. + N/A + N/A - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Introdu o adresă Bitcoin (de exemplu: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget @@ -1438,10 +1224,6 @@ Adresa: %4 Current number of blocks Numărul curent de blocuri - - Estimated total blocks - Blocurile totale estimate - Last block time Data ultimului bloc @@ -1518,19 +1300,7 @@ Adresa: %4 %1 GB %1 GB - - %1 m - %1 m - - - %1 h - %1 h - - - %1 h %2 m - %1 ora %2 minute - - + ReceiveCoinsDialog @@ -1553,22 +1323,10 @@ Adresa: %4 R&euse an existing receiving address (not recommended) &Refolosirea unei adrese de primire (nu este recomandat) - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - Use this form to request payments. All fields are <b>optional</b>. Folosește acest formular pentru a solicita plăți. Toate câmpurile sunt <b>opționale</b>. - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - Clear all fields of the form. Stergeti toate campurile formularului @@ -1593,10 +1351,6 @@ Adresa: %4 Show Arată - - Remove the selected entries from the list - - Remove Elimină @@ -1706,10 +1460,6 @@ Adresa: %4 Send Coins Trimite monede - - Coin Control Features - - Inputs... Intrări @@ -1742,10 +1492,6 @@ Adresa: %4 Fee: Taxa: - - Low Output: - Ieşire minimă: - After Fee: După taxe: @@ -1754,14 +1500,6 @@ Adresa: %4 Change: Schimbaţi: - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Trimite simultan către mai mulți destinatari @@ -1822,10 +1560,6 @@ Adresa: %4 Copy priority Copiaţi prioritatea - - Copy low output - Copiaţi ieşire minimă: - Copy change Copiaţi schimb @@ -1886,14 +1620,6 @@ Adresa: %4 added as transaction fee adăugat ca taxă de tranzacție - - Payment request expired - Cererea de plată a expirat - - - Invalid payment address %1 - Adresă pentru plată nevalidă %1 - SendCoinsEntry @@ -1905,10 +1631,6 @@ Adresa: %4 Pay &To: Plătește că&tre: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adresa către care se va face plata (de exemplu: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Introdu o etichetă pentru această adresă pentru a fi adăugată în lista ta de adrese @@ -1953,10 +1675,6 @@ Adresa: %4 Enter a label for this address to add it to the list of used addresses Introduceti eticheta pentru ca aceasta adresa sa fie introdusa in lista de adrese folosite - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - This is an unverified payment request. Aceasta este o cerere de plata neverificata @@ -1995,10 +1713,6 @@ Adresa: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Puteti semna mesaje cu adresa dumneavoastra pentru a demostra ca sunteti proprietarul lor. Aveti grija sa nu semnati nimic vag, deoarece atacurile de tip phishing va pot pacali sa le transferati identitatea. Semnati numai declaratiile detaliate cu care sunteti deacord. - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Introduceţi o adresă Bitcoin (de exemplu: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Choose previously used address Alegeti adrese folosite in prealabil @@ -2051,10 +1765,6 @@ Adresa: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Introduceti adresa de semnatura, mesajul (asigurati-va ca ati copiat spatiile, taburile etc. exact) si semnatura dedesubt pentru a verifica mesajul. Aveti grija sa nu cititi mai mult in semnatura decat mesajul in sine, pentru a evita sa fiti pacaliti de un atac de tip man-in-the-middle. - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Introduceţi o adresă Bitcoin (de exemplu: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address Verifica mesajul pentru a fi sigur ca a fost semnat cu adresa Bitcoin specifica @@ -2068,12 +1778,8 @@ Adresa: %4 Reseteaza toate spatiile mesajelor semnate. - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Introduceţi o adresă Bitcoin (de exemplu: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Click "Semneaza msajul" pentru a genera semnatura + Click "Sign Message" to generate signature + Click "Semneaza msajul" pentru a genera semnatura The entered address is invalid. @@ -2152,10 +1858,6 @@ Adresa: %4 Open until %1 Deschis până la %1 - - conflicted - - %1/offline %1/deconectat @@ -2245,7 +1947,7 @@ Adresa: %4 Comerciant - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. Monezile generate trebuie sa creasca %1 block-uri inainte sa poata fi cheltuite. Cand ati generat acest block, a fost transmis retelei pentru a fi adaugat la lantul de block-uri. Aceasta se poate intampla ocazional daca alt nod genereaza un block la numai cateva secunde de al tau. @@ -2276,10 +1978,6 @@ Adresa: %4 , has not been successfully broadcast yet , nu s-a propagat încă - - Open for %n more block(s) - Deschis pentru încă %1 blocDeschis pentru încă %1 blocuriDeschis pentru încă %1 de blocuri - unknown necunoscut @@ -2310,18 +2008,6 @@ Adresa: %4 Address Adresa - - Amount - Cantitate - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - Deschis pentru încă %1 blocDeschis pentru încă %1 blocuriDeschis pentru încă %1 de blocuri - Open until %1 Deschis până la %1 @@ -2350,10 +2036,6 @@ Adresa: %4 Confirming (%1 of %2 recommended confirmations) Confirmare (%1 dintre %2 confirmări recomandate) - - Conflicted - - Received with Recepționat cu @@ -2525,10 +2207,6 @@ Adresa: %4 Address Adresă - - Amount - Sumă - ID ID @@ -2542,6 +2220,9 @@ Adresa: %4 către + + UnitDisplayStatusBarControl + WalletFrame @@ -2593,18 +2274,6 @@ Adresa: %4 bitcoin-core - - Usage: - Uz: - - - List commands - Listă de comenzi - - - Get help for a command - Ajutor pentru o comandă - Options: Setări: @@ -2645,10 +2314,6 @@ Adresa: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Numărul de secunde pentru a preveni reconectarea partenerilor care nu funcționează corect (implicit: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - A intervenit o eroare in timp ce se seta portul RPC %u pentru ascultare pe IPv4: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Ascultă pentru conexiuni JSON-RPC pe <port> (implicit:8332 sau testnet: 18332) @@ -2657,10 +2322,6 @@ Adresa: %4 Accept command line and JSON-RPC commands Se acceptă comenzi din linia de comandă și comenzi JSON-RPC - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Rulează în fundal ca un demon și acceptă comenzi @@ -2683,7 +2344,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s trebuie sa setezi o parola rpc in fisierul de configurare %s @@ -2694,7 +2355,7 @@ parola rpc=%s Numele de utilizator si parola NU trebuie sa fie la fel. Daca fisierul nu exista, creaza-l cu fisier de citit permis doar proprietarului. Este de asemenea recomandat sa setezi alerta de notificare ca sa primesti notificari ale problemelor; -spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.com +spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.com @@ -2702,30 +2363,10 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Cifruri acceptabile (implicit: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - A intervenit o eroare in timp ce se seta portul RPC %u pentru ascultare pe IPv6, reintoarcere la IPv4: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Atasati adresei date si ascultati totdeauna pe ea. Folositi [host]:port notatia pentru IPv6 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Initiati modul de test al regresie, care foloseste un lant special in care block-urile pot fi rezolvate instantaneu. Acest lucru este facut pentru utilitare si aplicatii de dezvoltare pentru testarea regresiei. - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Eroare: Tranzactia a fost respinsa! Acest lucru se poate intampla daca anumite monezi din portofelul dumneavoastra au fost deja cheltuite, deasemenea daca ati folosit o copie a fisierului wallet.dat si monezile au fost folosite in acea copie dar nu au fost marcate ca fiind folosite acolo. @@ -2738,38 +2379,10 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Executati comanda cand o tranzactie a portofelului se schimba (%s in cmd este inlocuit de TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - Taxe mai mici decat aceasta suma sunt considerate taxe nule (pentru crearea tranzactiilor) (pentru nespecificare: - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Aceasta este o versiune de test preliminara - va asumati riscul folosind-o - nu folositi pentru minerit sau aplicatiile comerciantilor. - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) Utilizare proxy SOCKS5 separat pentru a ajunge la servicii ascunse TOR (implicit: -proxy) @@ -2778,10 +2391,6 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Atentie: setarea -paytxfee este foarte ridicata! Aceasta este taxa tranzactiei pe care o vei plati daca trimiti o tranzactie. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Atentie: Va rugam verificati daca data/timpul computerului dumneavoastra sunt corecte! Daca ceasul computerului este decalat, Bitcoin nu va functiona corect. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Atentie: Reteaua nu pare sa fie deacord in totalitate! Aparent niste mineri au probleme. @@ -2798,14 +2407,6 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. Atentie: fisierul wallet.dat este corupt, date salvate! Fisierul original wallet.dat a fost salvat ca wallet.{timestamp}.bak in %s; daca balansul sau tranzactiile sunt incorecte ar trebui sa restaurati dintr-o copie de siguranta. - - (default: 1) - - - - (default: wallet.dat) - - <category> can be: <category> poate fi: @@ -2814,57 +2415,25 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo Attempt to recover private keys from a corrupt wallet.dat Încearcă recuperarea cheilor private dintr-un wallet.dat corupt - - Bitcoin Core Daemon - Daemon-ul Bitcoin Core - Block creation options: Optiuni creare block - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) Conecteaza-te doar la nod(urile) specifice - - Connect through SOCKS proxy - Conectare prin proxy SOCKS - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - Conectat la JSON-RPC pe <portul> (implicit: 8332 sau testnet: 18332) - - - Connection options: - - Corrupted block database detected - Baza de date 'bloc' defectată a fost detectată - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - + Baza de date 'bloc' defectată a fost detectată Discover own IP address (default: 1 when listening and no -externalip) Descopera propria ta adresa IP (intial: 1) - - Do not load the wallet and disable wallet RPC calls - - Do you want to rebuild the block database now? - Doriți să reconstruiți baza de date 'bloc' acum? + Doriți să reconstruiți baza de date 'bloc' acum? Error initializing block database @@ -2938,18 +2507,6 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo Failed to write undo data Esuare in scrierea datelor anulate - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - Găsește parteneri folosind căutarea DNS (implicit: 1 doar dacă nu s-a folosit -connect) - Force safe mode (default: 0) Pornire fortata a modului safe mode (prestabilit: 0) @@ -2962,46 +2519,22 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo How many blocks to check at startup (default: 288, 0 = all) Cate block-uri se verifica la initializare (implicit: 288, 0=toate) - - If <category> is not supplied, output all debugging information. - - - - Importing... - - Incorrect or no genesis block found. Wrong datadir for network? Incorect sau nici un bloc de Geneza găsite. Directorul de retea greşit? - Invalid -onion address: '%s' - Adresa -onion invalidă: '%s' + Invalid -onion address: '%s' + Adresa -onion invalidă: '%s' Not enough file descriptors available. Nu sunt destule descriptoare disponibile. - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - Opţiuni client RPC: - Rebuild block chain index from current blk000??.dat files Reconstruirea indexului lantului de block-uri din fisierele actuale blk000???.dat - - Select SOCKS version for -proxy (4 or 5, default: 5) - Selectaţi versiunea SOCKS pentru -proxy (4 din 5; iniţial: 5) - - - Set database cache size in megabytes (%d to %d, default: %d) - - Set maximum block size in bytes (default: %d) Setaţi dimensiunea maximă a unui block în bytes (implicit: %d) @@ -3014,18 +2547,10 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo Specify wallet file (within data directory) Specifică fișierul wallet (în dosarul de date) - - Spend unconfirmed change when sending transactions (default: 1) - - This is intended for regression testing tools and app development. Este folosita pentru programe de testare a regresiei in algoritmi si dezvoltare de alte aplicatii. - - Usage (deprecated, use bitcoin-cli): - Utilizare (învechită, folositi bitcoin-cli): - Verifying blocks... Se verifică blocurile... @@ -3034,10 +2559,6 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo Verifying wallet... Se verifică portofelul... - - Wait for RPC server to start - Aşteptaţi serverul RPC să pornească - Wallet %s resides outside data directory %s Portofelul %s se află în afara dosarului de date %s @@ -3046,10 +2567,6 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo Wallet options: Optiuni de portofel - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - You need to rebuild the database using -reindex to change -txindex Trebuie să reconstruiești baza de date folosind -reindex pentru a schimba -txindex @@ -3058,41 +2575,21 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo Imports blocks from external blk000??.dat file Importă blocuri dintr-un fișier extern blk000??.dat - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Executati comanda cand o alerta relevanta este primita sau vedem o bifurcatie foarte lunga (%s in cmd este inlocuti de mesaj) - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information Informație - Invalid amount for -minrelaytxfee=<amount>: '%s' - Suma invalida pentru -minrelaytxfee=<suma>:'%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Suma invalida pentru -minrelaytxfee=<suma>:'%s' - Invalid amount for -mintxfee=<amount>: '%s' - Suma invalida pentru -mintxfee=<suma>: '%s' - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - + Invalid amount for -mintxfee=<amount>: '%s' + Suma invalida pentru -mintxfee=<suma>: '%s' Maintain a full transaction index (default: 0) @@ -3122,34 +2619,6 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo Print block tree on startup (default: 0) Publicare arbore blocuri la pornire (prestabilit: 0) - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - Optiuni SSl (vezi Bitcoin wiki pentru intructiunile de instalare) - - - Send command to Bitcoin Core - Trimitere comenzi catre Bitcoin Core - Send trace/debug info to console instead of debug.log file Trimite informațiile trace/debug la consolă în locul fișierului debug.log @@ -3158,18 +2627,6 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo Set minimum block size in bytes (default: 0) Setează mărimea minimă a blocului în baiți (implicit: 0) - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - Shrink debug.log file on client startup (default: 1 when no -debug) Micsorati fisierul debug.log la inceperea clientului (implicit: 1 cand nu -debug) @@ -3182,10 +2639,6 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo Specify connection timeout in milliseconds (default: 5000) Specifică intervalul maxim de conectare în milisecunde (implicit: 5000) - - Start Bitcoin Core Daemon - - System error: Eroare de sistem: @@ -3222,18 +2675,10 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo Warning: This version is obsolete, upgrade required! Atenție: această versiune este depășită, este necesară actualizarea! - - Zapping all transactions from wallet... - - on startup in timpul pornirii - - version - versiunea - wallet.dat corrupt, salvage failed wallet.dat corupt, recuperare eșuată @@ -3242,14 +2687,6 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo Password for JSON-RPC connections Parola pentru conexiunile JSON-RPC - - Allow JSON-RPC connections from specified IP address - Permite conexiuni JSON-RPC de la adresa IP specificată - - - Send commands to node running on <ip> (default: 127.0.0.1) - Trimite comenzi la nodul care rulează la <ip> (implicit: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Execută comanda când cel mai bun bloc se modifică (%s în cmd este înlocuit cu hash-ul blocului) @@ -3282,10 +2719,6 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo This help message Acest mesaj de ajutor - - Unable to bind to %s on this computer (bind returned error %d, %s) - Nu se poate folosi %s pe acest calculator (eroarea returnată este %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Permite căutări DNS pentru -addnode, -seednode și -connect @@ -3298,41 +2731,29 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo Error loading wallet.dat: Wallet corrupted Eroare la încărcarea wallet.dat: Portofel corupt - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Eroare la încărcarea wallet.dat: Portofelul are nevoie de o versiune Bitcoin mai nouă - - - Wallet needed to be rewritten: restart Bitcoin to complete - Portofelul trebuie rescris: repornește Bitcoin pentru finalizare - Error loading wallet.dat Eroare la încărcarea wallet.dat - Invalid -proxy address: '%s' - Adresa -proxy nevalidă: '%s' + Invalid -proxy address: '%s' + Adresa -proxy nevalidă: '%s' - Unknown network specified in -onlynet: '%s' - Rețeaua specificată în -onlynet este necunoscută: '%s' + Unknown network specified in -onlynet: '%s' + Rețeaua specificată în -onlynet este necunoscută: '%s' - Unknown -socks proxy version requested: %i - S-a cerut o versiune necunoscută de proxy -socks: %i + Cannot resolve -bind address: '%s' + Nu se poate rezolva adresa -bind: '%s' - Cannot resolve -bind address: '%s' - Nu se poate rezolva adresa -bind: '%s' + Cannot resolve -externalip address: '%s' + Nu se poate rezolva adresa -externalip: '%s' - Cannot resolve -externalip address: '%s' - Nu se poate rezolva adresa -externalip: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Suma nevalidă pentru -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Suma nevalidă pentru -paytxfee=<amount>: '%s' Invalid amount @@ -3378,13 +2799,5 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@fo Error Eroare - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Trebuie sa setezi rpcpassword=<password> în fișierul de configurare:⏎ -%s⏎ -Dacă fișierul nu există, creează-l cu permisiuni de citire doar de către proprietar. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_ru.ts b/src/qt/locale/bitcoin_ru.ts index 570c3a61e7..d6a145928c 100644 --- a/src/qt/locale/bitcoin_ru.ts +++ b/src/qt/locale/bitcoin_ru.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - О Bitcoin Core - - - <b>Bitcoin Core</b> version - версия <b>Bitcoin Core</b> - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Это экспериментальная программа. - -Распространяется на правах лицензии MIT/X11, см. файл license.txt или http://www.opensource.org/licenses/mit-license.php. - -Этот продукт включает ПО, разработанное OpenSSL Project для использования в OpenSSL Toolkit (http://www.openssl.org/) и криптографическое ПО, написанное Eric Young (eay@cryptsoft.com) и ПО для работы с UPnP, написанное Thomas Bernard. - - - Copyright - Все права защищены - - - The Bitcoin Core developers - Разработчики Bitcoin Core - - - (%1-bit) - (%1-бит) - - + AddressBookPage @@ -130,11 +93,7 @@ This product includes software developed by the OpenSSL Project for use in the O Exporting Failed Экспорт не удался - - There was an error trying to save the address list to %1. - Произошла ошибка при сохранении списка адресов в %1. - - + AddressTableModel @@ -168,10 +127,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Повторите новый пароль - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Введите новый пароль для бумажника. <br/> Пожалуйста, используйте фразы из <b>10 или более случайных символов,</b> или <b>восьми и более слов.</b> - Encrypt wallet Зашифровать бумажник @@ -224,6 +179,10 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet encrypted Бумажник зашифрован + + 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>. + Введите новый пароль бумажника.<br/>Используйте пароль, состоящий из <b>десяти или более случайных символов</b>, или <b>восьми или более слов</b>. + Bitcoin 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. Сейчас программа закроется для завершения процесса шифрования. Помните, что шифрование вашего бумажника не может полностью защитить ваши биткойны от кражи с помощью инфицирования вашего компьютера вредоносным ПО. @@ -295,10 +254,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application Закрыть приложение - - Show information about Bitcoin - Показать информацию о Bitcoin - About &Qt О &Qt @@ -335,6 +290,10 @@ This product includes software developed by the OpenSSL Project for use in the O Open &URI... Открыть &URI... + + Bitcoin Core client + Bitcoin Core клиент + Importing blocks from disk... Импортируются блоки с диска... @@ -387,6 +346,10 @@ This product includes software developed by the OpenSSL Project for use in the O &Receive &Получить + + Show information about Bitcoin Core + Показать информацию о Bitcoin Core + &Show / Hide &Показать / Скрыть @@ -459,10 +422,6 @@ This product includes software developed by the OpenSSL Project for use in the O Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options Показать помощь по Bitcoin Core и получить список доступных опций командной строки. - - Bitcoin client - Bitcoin клиент - %n active connection(s) to Bitcoin network %n активное соединение с сетью%n активных соединений с сетью%n активных соединений с сетью Bitcoin @@ -471,10 +430,6 @@ This product includes software developed by the OpenSSL Project for use in the O No block source available... Источник блоков недоступен... - - Processed %1 of %2 (estimated) blocks of transaction history. - Обработано %1 из %2 (примерно) блоков истории транзакций. - Processed %1 blocks of transaction history. Обработано %1 блоков истории транзакций. @@ -559,10 +514,6 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Бумажник <b>зашифрован</b> и в настоящее время <b>заблокирован</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Произошла неисправимая ошибка. Bitcoin не может безопасно продолжать работу и будет закрыт. - ClientModel @@ -598,8 +549,8 @@ Address: %4 Комиссия: - Low Output: - Малый выход: + Dust: + Пыль: After Fee: @@ -690,8 +641,8 @@ Address: %4 Копировать приоритет - Copy low output - Копировать малый выход + Copy dust + Копировать пыль Copy change @@ -742,8 +693,8 @@ Address: %4 ничего - Dust - Пыль + Can vary +/- %1 satoshi(s) per input. + Может отличаться на +/- %1 сатоши на вход. yes @@ -770,25 +721,13 @@ Address: %4 Транзакции с более высоким приоритетом будут вероятнее других включены в блок. - This label turns red, if the priority is smaller than "medium". - Эта пометка становится красной, если приоритет ниже, чем "средний". + This label turns red, if the priority is smaller than "medium". + Эта пометка становится красной, если приоритет ниже, чем "средний". This label turns red, if any recipient receives an amount smaller than %1. Эта пометка становится красной, если какой-либо из адресатов получает сумму менее %1. - - This means a fee of at least %1 is required. - Это значит, что требуется комиссия как минимум %1. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - Суммы ниже, чем 0.546 минимальных комиссий ретрансляции, показаны как пыль. - - - This label turns red, if the change is smaller than %1. - Эта пометка становится красной, если сдача меньше %1. - (no label) [нет метки] @@ -841,12 +780,12 @@ Address: %4 Изменение адреса для отправки - The entered address "%1" is already in the address book. + The entered address "%1" is already in the address book. Введённый адрес «%1» уже находится в адресной книге. - The entered address "%1" is not a valid Bitcoin address. - Введённый адрес "%1" не является правильным Bitcoin-адресом. + The entered address "%1" is not a valid Bitcoin address. + Введённый адрес "%1" не является правильным Bitcoin-адресом. Could not unlock wallet. @@ -882,10 +821,6 @@ Address: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Bitcoin Core - опции командной строки - Bitcoin Core Bitcoin Core @@ -894,6 +829,18 @@ Address: %4 version версия + + (%1-bit) + (%1-бит) + + + About Bitcoin Core + О Bitcoin Core + + + Command-line options + Параметры командной строки + Usage: Использование: @@ -907,8 +854,8 @@ Address: %4 Опции интерфейса - Set language, for example "de_DE" (default: system locale) - Выберите язык, например "de_DE" (по умолчанию: как в системе) + Set language, for example "de_DE" (default: system locale) + Выберите язык, например "de_DE" (по умолчанию: как в системе) Start minimized @@ -954,12 +901,12 @@ Address: %4 Использовать другой каталог данных: - Bitcoin - Bitcoin + Bitcoin Core + Bitcoin Core - Error: Specified data directory "%1" can not be created. - Ошибка: не удалось создать указанный каталог данных "%1". + Error: Specified data directory "%1" cannot be created. + Ошибка: не удалось создать указанный каталог данных "%1". Error @@ -1035,6 +982,14 @@ Address: %4 Number of script &verification threads Число потоков проверки &сценария + + Accept connections from outside + Разрешать соединения извне + + + Allow incoming connections + Разрешить входящие подключения + Connect to the Bitcoin network through a SOCKS proxy. Подключаться к сети Bitcoin через прокси SOCKS. @@ -1115,14 +1070,6 @@ Address: %4 Port of the proxy (e.g. 9050) Порт прокси-сервера (например, 9050) - - SOCKS &Version: - &Версия SOCKS: - - - SOCKS version of the proxy (e.g. 5) - Версия SOCKS-прокси (например, 5) - &Window &Окно @@ -1163,14 +1110,6 @@ Address: %4 Choose the default subdivision unit to show in the interface and when sending coins. Выберите единицу измерения монет при отображении и отправке. - - Whether to show Bitcoin addresses in the transaction list or not. - Показывать ли адреса Bitcoin в списке транзакций. - - - &Display addresses in transaction list - &Показывать адреса в списке транзакций - Whether to show coin control features or not. Показывать ли функции контроля монет или нет. @@ -1226,6 +1165,10 @@ Address: %4 Wallet Бумажник + + Watch-only: + Только наблюдение: + Available: Доступно: @@ -1258,6 +1201,22 @@ Address: %4 Your current total balance Ваш текущий общий баланс + + Your current balance in watch-only addresses + Ваш текущий баланс в адресах наблюдения + + + Unconfirmed transactions to watch-only addresses + Неподтверждённые транзакции на адреса наблюдения + + + Mined balance in watch-only addresses that has not yet matured + Баланс добытых монет на адресах наблюдения, который ещё не созрел + + + Current total balance in watch-only addresses + Текущий общий баланс на адресах наблюдения + <b>Recent transactions</b> <b>Недавние транзакции</b> @@ -1274,8 +1233,24 @@ Address: %4 Обработка URI - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - Не удалось разобрать URI! Это может быть связано с неверным адресом Bitcoin или неправильными параметрами URI. + Invalid payment address %1 + Неверный адрес платежа %1 + + + Payment request rejected + Запрос платежа отклонён + + + Payment request network doesn't match client network. + Сеть запроса платежа не совпадает с сетью клиента. + + + Payment request has expired. + Запрос платежа просрочен. + + + Payment request is not initialized. + Запрос платежа не инициализирован. Requested payment amount of %1 is too small (considered dust). @@ -1289,25 +1264,21 @@ Address: %4 Cannot start bitcoin: click-to-pay handler Не удаётся запустить bitcoin: обработчик click-to-pay - - Net manager warning - Предупреждение менеджера сети - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - Активный прокси не поддерживает SOCKS5, который необходим для запроса платежей через прокси. - Payment request fetch URL is invalid: %1 Неверный URL запроса платежа: %1 + + URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + Не удалось обработать URI! Это может быть связано с неверным адресом Bitcoin или неправильными параметрами URI. + Payment request file handling Обработка файла запроса платежа - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - Файл запроса платежа не может быть прочитан или обработан! Обычно это происходит из-за неверного файла запроса платежа. + Payment request file cannot be read! This can be caused by an invalid payment request file. + Файл запроса платежа не может быть прочитан! Обычно это происходит из-за неверного файла запроса платежа. Unverified payment requests to custom payment scripts are unsupported. @@ -1322,8 +1293,8 @@ Address: %4 Ошибка связи с %1: %2 - Payment request can not be parsed or processed! - Запрос платежа не может быть разобран или обработан! + Payment request cannot be parsed! + Запрос платежа не может быть разобран! Bad response from server %1 @@ -1338,31 +1309,66 @@ Address: %4 Ошибка сетевого запроса + + PeerTableModel + + User Agent + Юзер-агент + + + Address/Hostname + Адрес/имя хоста + + + Ping Time + Время задержки + + QObject - Bitcoin - Bitcoin + Amount + Сумма - Error: Specified data directory "%1" does not exist. - Ошибка: указанный каталог "%1" не существует. + Enter a Bitcoin address (e.g. %1) + Введите адрес Bitcoin (например, %1) - Error: Cannot parse configuration file: %1. Only use key=value syntax. - Ошибка: не удалось разобрать конфигурационный файл: %1. Используйте синтаксис вида ключ=значение. + %1 d + %1 д - Error: Invalid combination of -regtest and -testnet. - Ошибка: неверная комбинация -regtest и -testnet. + %1 h + %1 ч - Bitcoin Core didn't yet exit safely... - Bitcoin Core ещё не завершился безопасно... + %1 m + %1 мин - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Введите Bitcoin-адрес (например 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + %1 s + %1 с + + + NETWORK + СЕТЬ + + + UNKNOWN + НЕИЗВЕСТНЫЙ + + + None + Ничего + + + N/A + Н/Д + + + %1 ms + %1 мс @@ -1414,6 +1420,10 @@ Address: %4 Using OpenSSL version Используется версия OpenSSL + + Using BerkeleyDB version + Используется версия BerkeleyDB + Startup time Время запуска @@ -1439,8 +1449,76 @@ Address: %4 Текущее число блоков - Estimated total blocks - Расчётное число блоков + Received + Получено + + + Sent + посланный + + + &Peers + &Участники + + + Select a peer to view detailed information. + Выберите участника для просмотра подробностей. + + + Direction + Направление + + + Version + Версия + + + User Agent + Юзер-агент + + + Services + Сервисы + + + Sync Node + Узел синхронизации + + + Starting Height + Начальная высота + + + Sync Height + Высота синхронизации + + + Ban Score + Очков бана + + + Connection Time + Время соединения + + + Last Send + Последняя отправка + + + Last Receive + Последний раз получено + + + Bytes Sent + Байт передано + + + Bytes Received + Байт получено + + + Ping Time + Время задержки Last block time @@ -1519,16 +1597,36 @@ Address: %4 %1 ГБ - %1 m - %1 мин + via %1 + через %1 - %1 h - %1 ч + never + никогда - %1 h %2 m - %1 ч %2 мин + Inbound + Входящие + + + Outbound + Исходящие + + + Yes + Да + + + No + Нет + + + Unknown + Неизвестно + + + Fetching... + Получение... @@ -1742,10 +1840,6 @@ Address: %4 Fee: Комиссия: - - Low Output: - Малый выход: - After Fee: После комиссии: @@ -1774,6 +1868,10 @@ Address: %4 Clear all fields of the form. Очистить все поля формы + + Dust: + Пыль: + Clear &All Очистить &всё @@ -1822,10 +1920,6 @@ Address: %4 Copy priority Копировать приоритет - - Copy low output - Копировать малый выход - Copy change Копировать размен @@ -1878,6 +1972,10 @@ Address: %4 Warning: Unknown change address Внимание: неизвестный адрес для сдачи + + Copy dust + Копировать пыль + Are you sure you want to send? Вы уверены, что хотите отправить? @@ -1886,14 +1984,6 @@ Address: %4 added as transaction fee добавлено как комиссия - - Payment request expired - Запрос платежа просрочен - - - Invalid payment address %1 - Неверный адрес платежа %1 - SendCoinsEntry @@ -1905,10 +1995,6 @@ Address: %4 Pay &To: Полу&чатель: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Адрес, на который будет выслан платёж (например 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Введите метку для данного адреса (для добавления в адресную книгу) @@ -1925,6 +2011,10 @@ Address: %4 This is a normal payment. Это нормальный платёж. + + The Bitcoin address to send the payment to + Адрес Bitcoin, на который отправить платёж + Alt+A Alt+A @@ -1996,8 +2086,8 @@ Address: %4 Вы можете подписывать сообщения своими адресами, чтобы доказать владение ими. Будьте осторожны, не подписывайте что-то неопределённое, так как фишинговые атаки могут обманным путём заставить вас подписать нежелательные сообщения. Подписывайте только те сообщения, с которыми вы согласны вплоть до мелочей. - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Адрес, которым вы хотите подписать сообщение (напр. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address to sign the message with + Адрес Bitcoin, которым подписать сообщение Choose previously used address @@ -2049,11 +2139,11 @@ Address: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - Введите ниже адрес для подписи, сообщение (убедитесь, что переводы строк, пробелы, табы и т.п. в точности скопированы) и подпись, чтобы проверить сообщение. Убедитесь, что не скопировали лишнего в подпись, по сравнению с самим подписываемым сообщением, чтобы не стать жертвой атаки "man-in-the-middle". + Введите ниже адрес для подписи, сообщение (убедитесь, что переводы строк, пробелы, табы и т.п. в точности скопированы) и подпись, чтобы проверить сообщение. Убедитесь, что не скопировали лишнего в подпись, по сравнению с самим подписываемым сообщением, чтобы не стать жертвой атаки "man-in-the-middle". - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Адрес, которым было подписано сообщение (напр. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address the message was signed with + Адрес Bitcoin, которым было подписано сообщение Verify the message to ensure it was signed with the specified Bitcoin address @@ -2068,12 +2158,8 @@ Address: %4 Сбросить все поля проверки сообщения - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Введите адрес Bitcoin (напр. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Нажмите "Подписать сообщение" для создания подписи + Click "Sign Message" to generate signature + Нажмите "Подписать сообщение" для создания подписи The entered address is invalid. @@ -2200,6 +2286,10 @@ Address: %4 own address свой адрес + + watch-only + только наблюдение + label метка @@ -2220,6 +2310,14 @@ Address: %4 Debit Дебет + + Total debit + Всего дебет + + + Total credit + Всего кредит + Transaction fee Комиссия @@ -2245,8 +2343,8 @@ Address: %4 Продавец - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - Сгенерированные монеты должны подождать %1 блоков, прежде чем они могут быть потрачены. Когда Вы сгенерировали этот блок, он был отправлен в сеть для добавления в цепочку блоков. Если он не попадёт в цепь, его статус изменится на "не принят", и монеты будут недействительны. Это иногда происходит в случае, если другой узел сгенерирует блок на несколько секунд раньше вас. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Сгенерированные монеты должны подождать %1 блоков, прежде чем они могут быть потрачены. Когда Вы сгенерировали этот блок, он был отправлен в сеть для добавления в цепочку блоков. Если он не попадёт в цепь, его статус изменится на "не принят", и монеты будут недействительны. Это иногда происходит в случае, если другой узел сгенерирует блок на несколько секунд раньше вас. Debug information @@ -2310,10 +2408,6 @@ Address: %4 Address Адрес - - Amount - Сумма - Immature (%1 confirmations, will be available after %2) Незрелый (%1 подтверждений, будет доступен после %2) @@ -2346,10 +2440,6 @@ Address: %4 Unconfirmed Неподтверждено - - Confirming (%1 of %2 recommended confirmations) - Подтверждено(%1 подтверждений, рекомендуется 2% подтверждений) - Conflicted В противоречии @@ -2525,10 +2615,6 @@ Address: %4 Address Адрес - - Amount - Сумма - ID ID @@ -2542,6 +2628,13 @@ Address: %4 до + + UnitDisplayStatusBarControl + + Unit to show amounts in. Click to select another unit. + Единица измерения количества монет. Щёлкните для выбора другой единицы. + + WalletFrame @@ -2593,19 +2686,6 @@ Address: %4 bitcoin-core - - Usage: - Использование: - - - List commands - Список команд - - - - Get help for a command - Получить помощь по команде - Options: Опции: @@ -2628,11 +2708,11 @@ Address: %4 Maintain at most <n> connections to peers (default: 125) - Поддерживать не более <n> подключений к узлам (по умолчанию: 125) + Поддерживать не более <n> подключений к участникам (по умолчанию: 125) Connect to a node to retrieve peer addresses, and disconnect - Подключиться к узлу, чтобы получить список адресов других участников и отключиться + Подключиться к участнику, чтобы получить список адресов других участников и отключиться Specify your own public address @@ -2640,15 +2720,11 @@ Address: %4 Threshold for disconnecting misbehaving peers (default: 100) - Порог для отключения неправильно ведущих себя узлов (по умолчанию: 100) + Порог для отключения неправильно ведущих себя участников (по умолчанию: 100) Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Число секунд блокирования неправильно ведущих себя узлов (по умолчанию: 86400) - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Произошла ошибка при открытии RPC-порта %u для прослушивания на IPv4: %s + Число секунд блокирования неправильно ведущих себя участников (по умолчанию: 86400) Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) @@ -2658,10 +2734,6 @@ Address: %4 Accept command line and JSON-RPC commands Принимать командную строку и команды JSON-RPC - - Bitcoin Core RPC client version - Версия RPC-клиента Bitcoin Core - Run in the background as a daemon and accept commands Запускаться в фоне как демон и принимать команды @@ -2684,7 +2756,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, вы должны установить опцию rpcpassword в конфигурационном файле: %s @@ -2695,17 +2767,13 @@ rpcpassword=%s Имя и пароль ДОЛЖНЫ различаться. Если файл не существует, создайте его и установите права доступа только для владельца, только для чтения. Также рекомендуется включить alertnotify для оповещения о проблемах; -Например: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +Например: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Разрешённые алгоритмы(по умолчанию: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Произошла ошибка при открытии на прослушивание IPv6 RCP-порта %u, возвращаемся к IPv4: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Привязаться к указанному адресу и всегда прослушивать только его. Используйте [хост]:порт для IPv6 @@ -2715,17 +2783,13 @@ rpcpassword=%s Ограничить скорость передачи бесплатных транзакций до <n>*1000 байт в минуту (по умолчанию: 15) - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Войти в режим тестирования на регрессии, в котором используется специальная цепь, где блоки находятся мгновенно. Этот режим рассчитан на инструменты регрессионного тестирования и разработку приложений. + Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup + Удалить все транзакции бумажника с возможностью восстановить эти части цепи блоков с помощью -rescan при запуске Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Войти в режим тестирования на регрессии, в котором используется специальная цепь, где блоки находятся мгновенно. - - Error: Listening for incoming connections failed (listen returned error %d) - Ошибка: не удалось начать прослушивание входящих подключений (прослушивание вернуло ошибку %d) - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Ошибка: транзакция была отклонена! Это могло произойти в случае, если некоторые монеты в вашем бумажнике уже были потрачены, например, если вы используете копию wallet.dat, и монеты были использованы в копии, но не отмечены как потраченные здесь. @@ -2738,10 +2802,6 @@ rpcpassword=%s Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Выполнить команду, когда меняется транзакция в бумажнике (%s в команде заменяется на TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - Комиссии меньшие этого значения считаются нулевыми (для создания транзакции) (по умолчанию: - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) Сбрасывать активность базы данных из памяти на диск каждые <n> мегабайт (по умолчанию: 100) @@ -2778,17 +2838,13 @@ rpcpassword=%s Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Внимание: установлено очень большое значение -paytxfee. Это комиссия, которую вы заплатите при проведении транзакции. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Внимание: убедитесь, что дата и время на Вашем компьютере выставлены верно. Если Ваши часы идут неправильно, Bitcoin будет работать некорректно. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Внимание: похоже, в сети нет полного согласия! Некоторый майнеры, возможно, испытывают проблемы. Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - Внимание: мы не полностью согласны с подключенными участниками! Вам или другим узлам, возможно, следует обновиться. + Внимание: мы не полностью согласны с подключенными участниками! Вам или другим участникам, возможно, следует обновиться. Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. @@ -2814,30 +2870,14 @@ rpcpassword=%s Attempt to recover private keys from a corrupt wallet.dat Попытаться восстановить приватные ключи из повреждённого wallet.dat - - Bitcoin Core Daemon - Демон Bitcoin Core - Block creation options: Параметры создания блоков: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - Очистить список транзакций кошелька (диагностический инструмент; включает в себя -rescan) - Connect only to the specified node(s) Подключаться только к указанному узлу(ам) - - Connect through SOCKS proxy - Подключаться через SOCKS прокси - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - Подключаться к JSON-RPC на <порт> (по умолчанию: 8332 или testnet: 18332) - Connection options: Параметры подключения: @@ -2938,18 +2978,6 @@ rpcpassword=%s Failed to write undo data Не удалось записать данные для отмены - - Fee per kB to add to transactions you send - Комиссия на КБ, добавляемая к вашим переводам - - - Fees smaller than this are considered zero fee (for relaying) (default: - Комиссии меньшие этого значения считаются нулевыми (для ретрансляции) (по умолчанию: - - - Find peers using DNS lookup (default: 1 unless -connect) - Искать узлы с помощью DNS (по умолчанию: 1, если не указан -connect) - Force safe mode (default: 0) Принудительный безопасный режим (по умолчанию: 0) @@ -2975,8 +3003,8 @@ rpcpassword=%s Неверный или отсутствующий начальный блок. Неправильный каталог данных для сети? - Invalid -onion address: '%s' - Неверный -onion адрес: '%s' + Invalid -onion address: '%s' + Неверный -onion адрес: '%s' Not enough file descriptors available. @@ -2986,18 +3014,10 @@ rpcpassword=%s Prepend debug output with timestamp (default: 1) Дописывать отметки времени к отладочному выводу (по умолчанию: 1) - - RPC client options: - Параметры RPC клиента: - Rebuild block chain index from current blk000??.dat files Перестроить индекс цепи блоков из текущих файлов blk000??.dat - - Select SOCKS version for -proxy (4 or 5, default: 5) - Выбрать версию SOCKS для -proxy (4 или 5, по умолчанию: 5) - Set database cache size in megabytes (%d to %d, default: %d) Установить размер кэша БД в мегабайтах(от %d до %d, по умолчанию: %d) @@ -3019,12 +3039,12 @@ rpcpassword=%s Тратить неподтвержденную сдачу при отправке транзакций (по умолчанию: 1) - This is intended for regression testing tools and app development. - Это рассчитано на инструменты регрессионного тестирования и разработку приложений. + Stop running after importing blocks from disk (default: 0) + Остановиться после импорта блоков с диска (по умолчанию: 0) - Usage (deprecated, use bitcoin-cli): - Использование (устарело, используйте bitcoin-cli): + This is intended for regression testing tools and app development. + Это рассчитано на инструменты регрессионного тестирования и разработку приложений. Verifying blocks... @@ -3034,10 +3054,6 @@ rpcpassword=%s Verifying wallet... Проверка бумажника... - - Wait for RPC server to start - Ожидание запуска RPC сервера - Wallet %s resides outside data directory %s Бумажник %s располагается вне каталога данных %s @@ -3046,10 +3062,6 @@ rpcpassword=%s Wallet options: Опции бумажника: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - Внимание: устаревший аргумент -debugnet проигнорирован, используйте -debug=net - You need to rebuild the database using -reindex to change -txindex Вам необходимо пересобрать базы данных с помощью -reindex, чтобы изменить -txindex @@ -3058,33 +3070,157 @@ rpcpassword=%s Imports blocks from external blk000??.dat file Импортировать блоки из внешнего файла blk000??.dat + + (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + (по умолчанию: 1, 1 = сохранять метаданные транзакции, например, владельца аккаунта и информацию запроса платежа, 2 = отбросить метаданные) + + + Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times + Разрешить подключения JSON-RPC с указанного источника. Разрешённые значения для <ip> — отдельный IP (например, 1.2.3.4), сеть/маска сети (например, 1.2.3.4/255.255.255.0) или сеть/CIDR (например, 1.2.3.4/24). Эту опцию можно использовать многократно + + + An error occurred while setting up the RPC address %s port %u for listening: %s + Произошла ошибка в процессе открытия RPC адреса %s порта %u для прослушивания: %s + + + Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6 + Привязаться к указанному адресу и внести в белый список подключающихся к нему участников. Используйте [хост]:порт для IPv6 + + + Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces) + Привязаться к указанному адресу для прослушивания JSON-RPC подключений. Используйте запись [хост]:порт для IPv6. Эту опцию можно использовать многократно (по умолчанию: привязываться ко всем интерфейсам) + Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. Не удалось установить блокировку на каталог данных %s. Возможно, Bitcoin Core уже запущен. + + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) + Создавать новые файлы с системными правами по умолчанию вместо umask 077 (эффективно только при отключенном бумажнике) + + + Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + Распространяется под лицензией MIT/X11, см. приложенный файл COPYING или <http://www.opensource.org/licenses/mit-license.php>. + + + Error: Listening for incoming connections failed (listen returned error %s) + Ошибка: не удалось начать прослушивание входящих подключений (прослушивание вернуло ошибку %s) + + + Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + Ошибка: обнаружен неподдерживаемый аргумент -socks. Выбор версии SOCKS более невозможен, поддерживаются только прокси SOCKS5. + + + Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) + Выполнить команду, когда транзакция из сети повторно тратит вход транзакции в бумажнике (%s=TxID транзакции сети, %t=TxID транзакции в бумажнике) + Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Выполнить команду, когда приходит соответствующее сообщение о тревоге или наблюдается очень длинное расщепление цепи (%s в команде заменяется на сообщение) + + Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) + Комиссии (в BTC/Кб) меньшие этого значения считаются нулевыми для трансляции (по умолчанию: %s) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) + Комиссии (в BTC/Кб) меньшие этого значения считаются нулевыми для создания транзакции (по умолчанию: %s) + + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) + Если paytxfee не задан, включить достаточную комиссию для подтверждения транзакции в среднем за n блоков (по умолчанию: 1) + Output debugging information (default: 0, supplying <category> is optional) Выводить отладочную информацию (по умолчанию: 0, указание <category> необязательно) + + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) + Запрашивать адреса участников с помощью DNS, если адресов мало (по умолчанию: 1, если не указан -connect) + Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Задать максимальный размер высокоприоритетных/низкокомиссионных транзакций в байтах (по умолчанию: %d) + + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. + Этот продукт включает ПО, разработанное OpenSSL Project для использования в OpenSSL Toolkit <https://www.openssl.org/> и криптографическое ПО, написанное Eric Young и ПО для работы с UPnP, написанное Thomas Bernard. + + + Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + Внимание: убедитесь, что дата и время на Вашем компьютере выставлены верно. Если Ваши часы идут неправильно, Bitcoin Core будет работать некорректно. + + + Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. + Вносить в белый список участников, подключающихся с указанной маски сети или ip. Можно использовать многократно. + + + Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway + Участники из белого списка не могуть быть забанены за DoS, и их транзакции всегда транслируются, даже если они уже содержатся в памяти. Полезно, например, для шлюза. + + + Always query for peer addresses via DNS lookup (default: 0) + Всегда запрашивать адреса участников с помощью DNS (по умолчанию: 0) + + + Cannot resolve -whitebind address: '%s' + Не удаётся разрешить адрес в параметре -whitebind: '%s' + + + Connect through SOCKS5 proxy + Подключаться через SOCKS5 прокси + + + Copyright (C) 2009-%i The Bitcoin Core Developers + Все права защищены © 2009-%i Разработчики Bitcoin Core + + + Could not parse -rpcbind value %s as network address + Не удалось разобрать значение %s параметра -rpcbind как сетевой адрес + + + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core + Ошибка загрузки wallet.dat: бумажник требует более новую версию Bitcoin Core + + + Error: Unsupported argument -tor found, use -onion. + Ошибка: обнаружен неподдерживаемый параметр -tor, используйте -onion. + + + Fee (in BTC/kB) to add to transactions you send (default: %s) + Комиссия (в BTC/Кб) для добавления к вашим транзакциям (по умолчанию: %s) + + + Include IP addresses in debug output (default: 0) + Включать IP-адреса в отладочный вывод (по умолчанию: 0) + Information Информация - Invalid amount for -minrelaytxfee=<amount>: '%s' - Неверная сумма в параметре -minrelaytxfee=<кол-во>: '%s' + Initialization sanity check failed. Bitcoin Core is shutting down. + Не удалось проверить чистоту. Bitcoin Core выключается. - Invalid amount for -mintxfee=<amount>: '%s' - Неверная сумма в параметре -mintxfee=<кол-во>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Неверная сумма в параметре -minrelaytxfee=<кол-во>: '%s' + + + Invalid amount for -mintxfee=<amount>: '%s' + Неверная сумма в параметре -mintxfee=<кол-во>: '%s' + + + Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) + Неверное количество в параметре -paytxfee=<кол-во>: '%s' (должно быть как минимум %s) + + + Invalid netmask specified in -whitelist: '%s' + Указана неверная сетевая маска в -whitelist: '%s' + + + Keep at most <n> unconnectable blocks in memory (default: %u) + Хранить максимум <n> несоединённых блоков в памяти (по умолчанию: %u) Limit size of signature cache to <n> entries (default: 50000) @@ -3106,6 +3242,14 @@ rpcpassword=%s Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) Максимальный размер буфера отправки на соединение, <n>*1000 байт (по умолчанию: 1000) + + Need to specify a port with -whitebind: '%s' + Необходимо указать порт с помощью -whitebind: '%s' + + + Node relay options: + Параметры трансляции узла: + Only accept block chain matching built-in checkpoints (default: 1) Принимать цепь блоков, только если она соответствует встроенным контрольным точкам (по умолчанию: 1) @@ -3138,19 +3282,18 @@ rpcpassword=%s Randomly fuzz 1 of every <n> network messages Случайно разбрасывать 1 из каждых <n> сетевых сообщений + + Relay and mine data carrier transactions (default: 1) + Транслировать и генерировать транзакции носители данных (по умолчанию: 1) + + + Relay non-P2SH multisig (default: 1) + Транслировать не-P2SH мультиподпись (по умолчанию: 1) + Run a thread to flush wallet periodically (default: 1) Запустить поток для периодического сохранения бумажника (по умолчанию: 1) - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - -Параметры SSL: (см. Bitcoin Wiki для инструкций по настройке SSL) - - - Send command to Bitcoin Core - Отправить команду Bitcoin Core - Send trace/debug info to console instead of debug.log file Выводить информацию трассировки/отладки на консоль вместо файла debug.log @@ -3167,10 +3310,6 @@ rpcpassword=%s Show all debugging options (usage: --help -help-debug) Показать все отладочные параметры (использование: --help -help-debug) - - Show benchmark information (default: 0) - Показать информацию нагрузочного тестирования (по умолчанию: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Сжимать файл debug.log при запуске клиента (по умолчанию: 1, если нет -debug) @@ -3183,14 +3322,14 @@ rpcpassword=%s Specify connection timeout in milliseconds (default: 5000) Тайм-аут соединения в миллисекундах (по умолчанию: 5000) - - Start Bitcoin Core Daemon - Запустить Bitcoin Core демон - System error: Системная ошибка: + + This is experimental software. + Это экспериментальное ПО. + Transaction amount too small Сумма транзакции слишком мала @@ -3203,6 +3342,10 @@ rpcpassword=%s Transaction too large Транзакция слишком большая + + Unable to bind to %s on this computer (bind returned error %s) + Невозможно привязаться к %s на этом компьютере (bind вернул ошибку %s) + Use UPnP to map the listening port (default: 0) Использовать UPnP для проброса порта (по умолчанию: 0) @@ -3215,6 +3358,10 @@ rpcpassword=%s Username for JSON-RPC connections Имя для подключений JSON-RPC + + Wallet needed to be rewritten: restart Bitcoin Core to complete + Необходимо перезаписать бумажник, перезапустите Bitcoin Core для завершения операции. + Warning Внимание @@ -3223,6 +3370,14 @@ rpcpassword=%s Warning: This version is obsolete, upgrade required! Внимание: эта версия устарела, требуется обновление! + + Warning: Unsupported argument -benchmark ignored, use -debug=bench. + Внимание: неподдерживаемый аргумент -benchmark проигнорирован, используйте -debug=bench. + + + Warning: Unsupported argument -debugnet ignored, use -debug=net. + Внимание: неподдерживаемый аргумент -debugnet проигнорирован, используйте -debug=net. + Zapping all transactions from wallet... Стираем все транзакции из кошелька... @@ -3231,10 +3386,6 @@ rpcpassword=%s on startup при запуске - - version - версия - wallet.dat corrupt, salvage failed wallet.dat повреждён, спасение данных не удалось @@ -3243,14 +3394,6 @@ rpcpassword=%s Password for JSON-RPC connections Пароль для подключений JSON-RPC - - Allow JSON-RPC connections from specified IP address - Разрешить подключения JSON-RPC с указанного IP - - - Send commands to node running on <ip> (default: 127.0.0.1) - Посылать команды узлу, запущенному на <ip> (по умолчанию: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Выполнить команду, когда появляется новый блок (%s в команде заменяется на хэш блока) @@ -3283,10 +3426,6 @@ rpcpassword=%s This help message Эта справка - - Unable to bind to %s on this computer (bind returned error %d, %s) - Невозможно привязаться к %s на этом компьютере (bind вернул ошибку %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Разрешить поиск в DNS для -addnode, -seednode и -connect @@ -3299,41 +3438,29 @@ rpcpassword=%s Error loading wallet.dat: Wallet corrupted Ошибка загрузки wallet.dat: Бумажник поврежден - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Ошибка загрузки wallet.dat: бумажник требует более новую версию Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - Необходимо перезаписать бумажник, перезапустите Bitcoin для завершения операции. - Error loading wallet.dat Ошибка при загрузке wallet.dat - Invalid -proxy address: '%s' - Неверный адрес -proxy: '%s' + Invalid -proxy address: '%s' + Неверный адрес -proxy: '%s' - Unknown network specified in -onlynet: '%s' - В параметре -onlynet указана неизвестная сеть: '%s' + Unknown network specified in -onlynet: '%s' + В параметре -onlynet указана неизвестная сеть: '%s' - Unknown -socks proxy version requested: %i - В параметре -socks запрошена неизвестная версия: %i + Cannot resolve -bind address: '%s' + Не удаётся разрешить адрес в параметре -bind: '%s' - Cannot resolve -bind address: '%s' - Не удаётся разрешить адрес в параметре -bind: '%s' + Cannot resolve -externalip address: '%s' + Не удаётся разрешить адрес в параметре -externalip: '%s' - Cannot resolve -externalip address: '%s' - Не удаётся разрешить адрес в параметре -externalip: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Неверная сумма в параметре -paytxfee=<кол-во>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Неверная сумма в параметре -paytxfee=<кол-во>: '%s' Invalid amount @@ -3379,13 +3506,5 @@ rpcpassword=%s Error Ошибка - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Вы должны установить rpcpassword=<password> в конфигурационном файле: -%s -Если файл не существует, создайте его и установите права доступа только для владельца. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_sah.ts b/src/qt/locale/bitcoin_sah.ts index 3bc3e65c62..a951e10ab9 100644 --- a/src/qt/locale/bitcoin_sah.ts +++ b/src/qt/locale/bitcoin_sah.ts @@ -1,3368 +1,114 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage Double-click to edit address or label Аадырыскын уларытаргар иккитэ баттаа - - Create a new address - - - - &New - - - - Copy the currently selected address to the system clipboard - - - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - - - &Delete - - - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - - - Comma separated file (*.csv) - - - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel - - Label - - - - Address - - - - (no label) - - - + AskPassphraseDialog - - Passphrase Dialog - - - - Enter passphrase - - - - New passphrase - - - - Repeat new passphrase - - - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - - - - Encrypt wallet - - - - This operation needs your wallet passphrase to unlock the wallet. - - - - Unlock wallet - - - - This operation needs your wallet passphrase to decrypt the wallet. - - - - Decrypt wallet - - - - Change passphrase - - - - Enter the old and new passphrase to the wallet. - - - - Confirm wallet encryption - - - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - - - Wallet encrypted - - - - Bitcoin 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. - - - - Wallet encryption failed - - - - Wallet encryption failed due to an internal error. Your wallet was not encrypted. - - - - The supplied passphrases do not match. - - - - Wallet unlock failed - - - - The passphrase entered for the wallet decryption was incorrect. - - - - Wallet decryption failed - - - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - - - Synchronizing with network... - - - - &Overview - - - - Node - - - - Show general overview of wallet - - - - &Transactions - - - - Browse transaction history - - - - E&xit - - - - Quit application - - - - Show information about Bitcoin - - - - About &Qt - - - - Show information about Qt - - - - &Options... - - - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - - - Change the passphrase used for wallet encryption - - - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - - - &File - - - - &Settings - - - - &Help - - - - Tabs toolbar - - - - [testnet] - - - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - - - %n active connection(s) to Bitcoin network - - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - - - Error - - - - Warning - - - - Information - - - - Up to date - - - - Catching up... - - - - Sent transaction - - - - Incoming transaction - - - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> - - - - Wallet is <b>encrypted</b> and currently <b>locked</b> - - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - - + ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - - - Amount - - - - Address - - - - Date - - - - Confirmations - - - - Confirmed - - - - Priority - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - - - (no label) - - - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog - - Edit Address - - - - &Label - - - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - - - &Address - - - - New receiving address - - - - New sending address - - - - Edit receiving address - - - - Edit sending address - - - - The entered address "%1" is already in the address book. - - - - The entered address "%1" is not a valid Bitcoin address. - - - - Could not unlock wallet. - - - - New key generation failed. - - - + FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - - - version - - - - Usage: - - - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - - - Error - - - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog - - Options - - - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage - - Form - - - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - - - <b>Recent transactions</b> - - - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - - Bitcoin - - - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - - - &Label: - - - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - - - Copy label - - - - Copy message - - - - Copy amount - - - + ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - - - Address - - - - Amount - - - - Label - - - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel - - Date - - - - Label - - - - Message - - - - Amount - - - - (no label) - - - - (no message) - - - - (no amount) - - - + SendCoinsDialog - - Send Coins - - - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - - - Send to multiple recipients at once - - - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - - - Balance: - - - - Confirm the send action - - - - S&end - - - - Confirm send coins - - - - %1 to %2 - - - - Copy quantity - - - - Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - - - The amount to pay must be larger than 0. - - - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - - - (no label) - - - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry - - A&mount: - - - - Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Enter a label for this address to add it to your address book - - - - &Label: - - - - Choose previously used address - - - - This is a normal payment. - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - - - [testnet] - - - + TrafficGraphWidget - - KB/s - - - + TransactionDesc - - Open until %1 - - - - conflicted - - - - %1/offline - - - - %1/unconfirmed - - - - %1 confirmations - - - - Status - - - - , broadcast through %n node(s) - - - - Date - - - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - - - Amount - - - - true - - - - false - - - - , has not been successfully broadcast yet - - - - Open for %n more block(s) - - - - unknown - - - + TransactionDescDialog - - Transaction details - - - - This pane shows a detailed description of the transaction - - - + TransactionTableModel - - Date - - - - Type - - - - Address - - - - Amount - - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - - - Open until %1 - - - - Confirmed (%1 confirmations) - - - - This block was not received by any other nodes and will probably not be accepted! - - - - Generated but not accepted - - - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - - - Received with - - - - Received from - - - - Sent to - - - - Payment to yourself - - - - Mined - - - - (n/a) - - - - Transaction status. Hover over this field to show number of confirmations. - - - - Date and time that the transaction was received. - - - - Type of transaction. - - - - Destination address of transaction. - - - - Amount removed from or added to balance. - - - + TransactionView - - All - - - - Today - - - - This week - - - - This month - - - - Last month - - - - This year - - - - Range... - - - - Received with - - - - Sent to - - - - To yourself - - - - Mined - - - - Other - - - - Enter address or label to search - - - - Min amount - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - - - Comma separated file (*.csv) - - - - Confirmed - - - - Date - - - - Type - - - - Label - - - - Address - - - - Amount - - - - ID - - - - Range: - - - - to - - - + + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel - - Send Coins - - - + WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - - - Options: - - - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - - - Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - - - Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - - - Done loading - - - - To use the %s option - - - - Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - - + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_sk.ts b/src/qt/locale/bitcoin_sk.ts index bce535fad7..793cbfa377 100644 --- a/src/qt/locale/bitcoin_sk.ts +++ b/src/qt/locale/bitcoin_sk.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - O jadre Bitcoin - - - <b>Bitcoin Core</b> version - Verzia <b>Bitcoin jadra</b> - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Toto je experimentálny softvér. - -Distribuovaný pod MIT/X11 softvérovou licenciou, viď sprevádzajúci súbor COPYING alebo http://www.opensource.org/licenses/mit-license.php. - -Tento výrobok obsahuje sofvér, ktorý vyvynul OpenSSL Project pre použitie v OpenSSL Toolkit (http://www.openssl.org/) a kryptografický softvér napísaný Ericom Youngom (eay@cryptsoft.com) a UPnP softvér napísaný Thomasom Bernardom. - - - Copyright - Autorské práva - - - The Bitcoin Core developers - Vývojári jadra Bitcoin - - - (%1-bit) - (%1-bit) - - + AddressBookPage @@ -124,17 +87,13 @@ Tento výrobok obsahuje sofvér, ktorý vyvynul OpenSSL Project pre použitie v Comma separated file (*.csv) - Čiarkou oddelený súbor (*.csv) + Čiarkou oddelovaný súbor (*.csv) Exporting Failed Export zlyhal - - There was an error trying to save the address list to %1. - Nastala chyba pri pokuse uložiť zoznam adries do %1. - - + AddressTableModel @@ -168,10 +127,6 @@ Tento výrobok obsahuje sofvér, ktorý vyvynul OpenSSL Project pre použitie v Repeat new passphrase Zopakujte nové heslo - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Zadajte nové heslo k peňaženke.<br/>Prosím použite heslo s dĺžkou aspon <b>10 alebo viac náhodných znakov</b>, alebo <b>8 alebo viac slov</b>. - Encrypt wallet Zašifrovať peňaženku @@ -295,10 +250,6 @@ Tento výrobok obsahuje sofvér, ktorý vyvynul OpenSSL Project pre použitie v Quit application Ukončiť program - - Show information about Bitcoin - Zobraziť informácie o Bitcoin - About &Qt O &Qt @@ -459,46 +410,18 @@ Tento výrobok obsahuje sofvér, ktorý vyvynul OpenSSL Project pre použitie v Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options Zobraziť pomocnú správu od Bitcoin Jadra pre získanie zoznamu dostupných možností príkazového riadku - - Bitcoin client - Bitcoin klient - - - %n active connection(s) to Bitcoin network - %n aktívne spojenie v Bitcoin sieti%n aktívne spojenia v Bitcoin sieti%n aktívnych spojení v Bitconi sieti - No block source available... Nedostupný zdroj blokov... - - Processed %1 of %2 (estimated) blocks of transaction history. - Spracovaných %1 z %2 (odhadovaných) blokov transakčnej histórie. - Processed %1 blocks of transaction history. Spracovaných %1 blokov transakčnej histórie. - - %n hour(s) - %n hodina%n hodiny%n hodín - - - %n day(s) - %n deň%n dni%n dní - - - %n week(s) - %n týždeň%n týždne%n týždňov - %1 and %2 %1 a %2 - - %n year(s) - %%d)%n rokov - %1 behind %1 pozadu @@ -558,10 +481,6 @@ Adresa: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Peňaženka je <b>zašifrovaná</b> a momentálne <b>zamknutá</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Vyskytla sa neblahá chyba. Bitcoin nemôže daľej bezpečne pokračovať a vypne sa. - ClientModel @@ -596,10 +515,6 @@ Adresa: %4 Fee: Poplatok: - - Low Output: - Malá hodnota na výstupe: - After Fee: Po poplatku: @@ -688,10 +603,6 @@ Adresa: %4 Copy priority Kopírovať prioritu - - Copy low output - Kopírovať malý výstup. - Copy change Kopírovať zmenu @@ -740,10 +651,6 @@ Adresa: %4 none žiadne - - Dust - Prach - yes áno @@ -769,25 +676,13 @@ Adresa: %4 Transakcie s vysokou prioritou sa pravdepodobnejsie dostanú do bloku. - This label turns red, if the priority is smaller than "medium". - Tento popis zčervenie ak je priorita nižčia ako "medium". + This label turns red, if the priority is smaller than "medium". + Tento popis zčervenie ak je priorita nižčia ako "medium". This label turns red, if any recipient receives an amount smaller than %1. Tento popis zčervenie ak ktorýkoľvek príjemca dostane sumu menšiu ako %1. - - This means a fee of at least %1 is required. - To znamená že je požadovaný poplatok aspoň %1. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - Sumy pod 0.546 násobkom minimálneho poplatku pre prenos sú považované za prach. - - - This label turns red, if the change is smaller than %1. - Tento popis zžervenie ak výdavok je menší než %1. - (no label) (bez popisu) @@ -840,12 +735,12 @@ Adresa: %4 Upraviť odosielaciu adresu - The entered address "%1" is already in the address book. - Vložená adresa "%1" sa už nachádza v adresári. + The entered address "%1" is already in the address book. + Vložená adresa "%1" sa už nachádza v adresári. - The entered address "%1" is not a valid Bitcoin address. - Vložená adresa "%1" nieje platnou adresou bitcoin. + The entered address "%1" is not a valid Bitcoin address. + Vložená adresa "%1" nieje platnou adresou bitcoin. Could not unlock wallet. @@ -868,7 +763,7 @@ Adresa: %4 Directory already exists. Add %1 if you intend to create a new directory here. - Priečinok už existuje. Pridajte "%1" ak chcete vytvoriť nový priečinok tu. + Priečinok už existuje. Pridajte "%1" ak chcete vytvoriť nový priečinok tu. Path already exists, and is not a directory. @@ -881,10 +776,6 @@ Adresa: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Jadro Bitcoin - možnosti príkazového riadku - Bitcoin Core Jadro Bitcoin @@ -893,6 +784,18 @@ Adresa: %4 version verzia + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + O jadre Bitcoin + + + Command-line options + Voľby príkazového riadku + Usage: Použitie: @@ -906,8 +809,8 @@ Adresa: %4 UI možnosti - Set language, for example "de_DE" (default: system locale) - Nastaviť jazyk, napríklad "sk_SK" (predvolené: systémový) + Set language, for example "de_DE" (default: system locale) + Nastaviť jazyk, napríklad "sk_SK" (predvolené: systémový) Start minimized @@ -953,12 +856,8 @@ Adresa: %4 Použiť vlastný dátový adresár: - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - Chyba: Predpísaný priečinok pre dáta "%1" nemôže byt vytvorený. + Bitcoin Core + Jadro Bitcoin Error @@ -1114,14 +1013,6 @@ Adresa: %4 Port of the proxy (e.g. 9050) Port proxy (napr. 9050) - - SOCKS &Version: - Verzia SOCKS: - - - SOCKS version of the proxy (e.g. 5) - SOCKS verzia proxy (napr. 5) - &Window Okno @@ -1162,17 +1053,9 @@ Adresa: %4 Choose the default subdivision unit to show in the interface and when sending coins. Zvoľte ako deliť bitcoin pri zobrazovaní pri platbách a užívateľskom rozhraní. - - Whether to show Bitcoin addresses in the transaction list or not. - Či ukazovať Bitcoin adresy v zozname transakcií alebo nie. - - - &Display addresses in transaction list - &Zobraziť adresy zo zoznamu transakcií - Whether to show coin control features or not. - Či zobrazovať možnosti "Coin control" alebo nie. + Či zobrazovať možnosti "Coin control" alebo nie. &OK @@ -1273,8 +1156,8 @@ Adresa: %4 Spracovanie URI - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI sa nedá rozložiť! To môže byť spôsobené neplatou Bitcoin adresou alebo zle upravenými vlastnosťami URI. + Invalid payment address %1 + Neplatná adresa platby %1 Requested payment amount of %1 is too small (considered dust). @@ -1288,14 +1171,6 @@ Adresa: %4 Cannot start bitcoin: click-to-pay handler Nedá sa spustiť obslužný program bitcoin: click-to-pay zaplatiť kliknutím - - Net manager warning - Varovanie správcu siete - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - Vaše aktívne proxy nepodporuje SOCKS5, ktoré je potrebné pre vyzvu na zaplatenie cez proxy. - Payment request fetch URL is invalid: %1 URL pre stiahnutie výzvy na zaplatenie je neplatné: %1 @@ -1304,10 +1179,6 @@ Adresa: %4 Payment request file handling Obsluha súboru s požiadavkou na platbu - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - Súbor s výzvou na zaplatenie sa nedá čítať alebo spracovať! To môže byť spôsobené aj neplatným súborom s výzvou. - Unverified payment requests to custom payment scripts are unsupported. Program nepodporuje neoverené platobné výzvy na vlastná skripty. @@ -1320,10 +1191,6 @@ Adresa: %4 Error communicating with %1: %2 Chyba komunikácie s %1: %2 - - Payment request can not be parsed or processed! - Požiadavka na platbu nemôže byť analyzovaná alebo spracovaná! - Bad response from server %1 Zlá odpoveď zo servera %1 @@ -1337,33 +1204,28 @@ Adresa: %4 Chyba požiadavky siete + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Suma - Error: Specified data directory "%1" does not exist. - Chyba: Uvedený priečinok s dátami "%1" neexistuje. + %1 h + %1 h - Error: Cannot parse configuration file: %1. Only use key=value syntax. - Chyba: Nedá sa rozlúštit súbor s nastaveniami: %1. Používajte výlučne kľúč=hodnota syntax. + %1 m + %1 m - Error: Invalid combination of -regtest and -testnet. - Chyba: Nesprávna kombinácia -regtest a -testnet. + N/A + nie je k dispozícii - - Bitcoin Core didn't yet exit safely... - Jadro Bitcoin sa ešte úspešne nevyplo ... - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Zadajte Bitcoin adresu (napr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget @@ -1437,10 +1299,6 @@ Adresa: %4 Current number of blocks Aktuálny počet blokov - - Estimated total blocks - Očakávaných blokov celkovo - Last block time Čas posledného bloku @@ -1463,7 +1321,7 @@ Adresa: %4 Totals - Celkovo + Celkovo: In: @@ -1517,19 +1375,7 @@ Adresa: %4 %1 GB %1 GB - - %1 m - %1 m - - - %1 h - %1 h - - - %1 h %2 m - %1 h %2 m - - + ReceiveCoinsDialog @@ -1707,7 +1553,7 @@ Adresa: %4 Coin Control Features - Možnosti "Coin Control" + Možnosti "Coin Control" Inputs... @@ -1741,10 +1587,6 @@ Adresa: %4 Fee: Poplatok: - - Low Output: - Malá hodnota na výstupe: - After Fee: Po poplatku: @@ -1821,10 +1663,6 @@ Adresa: %4 Copy priority Kopírovať prioritu - - Copy low output - Kopírovať nízky výstup - Copy change Kopírovať zmenu @@ -1885,14 +1723,6 @@ Adresa: %4 added as transaction fee pridané ako transakčný poplatok - - Payment request expired - Vypršala platnosť požiadavky na platbu - - - Invalid payment address %1 - Neplatná adresa platby %1 - SendCoinsEntry @@ -1904,10 +1734,6 @@ Adresa: %4 Pay &To: Zapla&tiť: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adresa na odoslanie platby (napr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Vložte popis pre túto adresu aby sa pridala do adresára @@ -1930,7 +1756,7 @@ Adresa: %4 Paste address from clipboard - Vložiť adresu z klipbordu + Vložte adresu z klipbordu Alt+P @@ -1992,11 +1818,7 @@ Adresa: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - Môžete podpísať správy svojou adresou a dokázať, že ju vlastníte. Buďte opatrní a podpíšte len prehlásenia s ktorými plne súhlasíte, nakoľko útoky typu "phishing" Vás môžu lákať k ich podpísaniu. - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Zadajte Bitcoin adresu (napr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + Môžete podpísať správy svojou adresou a dokázať, že ju vlastníte. Buďte opatrní a podpíšte len prehlásenia s ktorými plne súhlasíte, nakoľko útoky typu "phishing" Vás môžu lákať k ich podpísaniu. Choose previously used address @@ -2050,10 +1872,6 @@ Adresa: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Vložte podpisovaciu adresu, správu (uistite sa, že kopírujete ukončenia riadkov, medzery, odrážky, atď. presne) a podpis pod to na overenie adresy. Buďte opatrní a nečítajte ako podpísané viac než je v samotnej podpísanej správe a môžete sa tak vyhnúť podvodu mitm útokom. - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Zadajte Bitcoin adresu (napr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address Overím správy sa uistiť že bola podpísaná označenou Bitcoin adresou @@ -2067,12 +1885,8 @@ Adresa: %4 Obnoviť všetky polia v overiť správu - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Zadajte Bitcoin adresu (napr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Kliknite "Podpísať Správu" na získanie podpisu + Click "Sign Message" to generate signature + Kliknite "Podpísať Správu" na získanie podpisu The entered address is invalid. @@ -2171,10 +1985,6 @@ Adresa: %4 Status Stav - - , broadcast through %n node(s) - ,,, vysielať cez %n nód - Date Dátum @@ -2207,10 +2017,6 @@ Adresa: %4 Credit Kredit - - matures in %n more block(s) - Dospeje o %n blokovDospeje o %n blokovdospeje o %n blokov - not accepted neprijaté @@ -2244,8 +2050,8 @@ Adresa: %4 Kupec - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - Vytvorené coins musia dospieť %1 blokov kým môžu byť minuté. Keď vytvoríte tento blok, bude rozoslaný do siete aby bol akceptovaný do reťaze blokov. Ak sa nedostane reťaze, jeho stav sa zmení na "zamietnutý" a nebude sa dať minúť. Toto sa môže občas stať ak iná nóda vytvorí blok približne v tom istom čase. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Vytvorené coins musia dospieť %1 blokov kým môžu byť minuté. Keď vytvoríte tento blok, bude rozoslaný do siete aby bol akceptovaný do reťaze blokov. Ak sa nedostane reťaze, jeho stav sa zmení na "zamietnutý" a nebude sa dať minúť. Toto sa môže občas stať ak iná nóda vytvorí blok približne v tom istom čase. Debug information @@ -2275,10 +2081,6 @@ Adresa: %4 , has not been successfully broadcast yet , ešte nebola úspešne odoslaná - - Open for %n more block(s) - Otvoriť pre %n viac blokOtvoriť pre %n viac blokov Otvoriť pre %n viac blokov - unknown neznámy @@ -2309,18 +2111,10 @@ Adresa: %4 Address Adresa - - Amount - Hodnota - Immature (%1 confirmations, will be available after %2) Nezrelé (%1 potvrdení, bude k dispozícii po %2) - - Open for %n more block(s) - Otvorené pre ešte %1 blokOtvorené pre %n viac blokov Otvorené pre %n blokov - Open until %1 Otvorené do %1 @@ -2524,10 +2318,6 @@ Adresa: %4 Address Adresa - - Amount - Suma - ID ID @@ -2541,6 +2331,9 @@ Adresa: %4 do + + UnitDisplayStatusBarControl + WalletFrame @@ -2592,18 +2385,6 @@ Adresa: %4 bitcoin-core - - Usage: - Použitie: - - - List commands - Zoznam príkazov - - - Get help for a command - Dostať pomoc pre príkaz - Options: Možnosti: @@ -2644,10 +2425,6 @@ Adresa: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Počet sekúnd kedy sa zabráni zle sa správajúcim peerom znovupripojenie (predvolené: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Vyskytla sa chyba pri nastavovaní RPC portu %u pre počúvanie na IPv4: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Počúvať JSON-RPC spojeniam na <port> (predvolené: 8332 or testnet: 18332) @@ -2656,10 +2433,6 @@ Adresa: %4 Accept command line and JSON-RPC commands Prijímať príkazy z príkazového riadku a JSON-RPC - - Bitcoin Core RPC client version - Verzia RPC klienta Jadra Bitcoin - Run in the background as a daemon and accept commands Bežať na pozadí ako démon a prijímať príkazy @@ -2682,7 +2455,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, musíte nastaviť rpcpassword heslo v súbore nastavení: %s @@ -2693,17 +2466,13 @@ rpcpassword=%s Užívateľské meno a heslo NESMÚ byť rovnaké. Ak súbor neexistuje, vytvorte ho s prístupovým právom owner-readable-only čitateľné len pre majiteľa. Tiež sa odporúča nastaviť alertnotify aby ste boli upozorňovaní na problémy; -napríklad: alertnotify=echo %%s | mail -s "Bitcoin Výstraha" admin@foo.com +napríklad: alertnotify=echo %%s | mail -s "Bitcoin Výstraha" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Prijateľlné šifry (prednastavené: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Vyskytla sa chyba pri nastavovaní RPC portu %u pre počúvanie na IPv6, vraciam sa späť ku IPv4: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Spojiť s danou adresou a vždy na nej počúvať. Použite zápis [host]:port pre IPv6 @@ -2712,18 +2481,10 @@ napríklad: alertnotify=echo %%s | mail -s "Bitcoin Výstraha" admin@f Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) Priebežne obmedzuj transakcie bez poplatku na <n>*1000 bajtov za minútu (prednastavené: 15) - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Vstúpiť do regresného testovacieho módu, ktorý používa špeciálnu reťaz v ktorej môžu byť bloky v okamihu vyriešené. Pre účely regresného testovania a vývoja aplikácie. - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Vojsť do režimu regresného testovania, ktorý používa špeciálnu reťaz v ktorej môžu byť bloky v okamihu vyriešené. - - Error: Listening for incoming connections failed (listen returned error %d) - Chyba: Zlyhalo počúvanie prichádzajúcich spojení (listen vrátil chybu %d) - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Transakcia bola zamietnutá! Toto sa môže stať ak niektoré coins vo vašej peňaženke už boli minuté, ako keď použijete kópiu wallet.dat a coins boli minuté z kópie ale neoznačené ako minuté tu. @@ -2736,10 +2497,6 @@ napríklad: alertnotify=echo %%s | mail -s "Bitcoin Výstraha" admin@f Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Vykonaj príkaz keď sa zmení transakcia peňaženky (%s v príkaze je nahradená TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - Poplatky menšie než toto sa považujú za nulové (pre vytvorenie transakcie) (prednastavené: - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) Odložiť aktivitu databázy spoločnej pamäti do logu na disku každých <n> megabajtov (prednastavené: 100) @@ -2776,10 +2533,6 @@ napríklad: alertnotify=echo %%s | mail -s "Bitcoin Výstraha" admin@f Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Varovanie: -paytxfee je nastavené veľmi vysoko. Toto sú transakčné poplatky ktoré zaplatíte ak odošlete transakciu. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Varovanie: Skontroluj či je na počítači nastavený správny čas a dátum. Ak sú hodiny nastavené nesprávne, Bitcoin nebude správne pracovať. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Varovanie: Javí sa že sieť sieť úplne nesúhlasí! Niektorí mineri zjavne majú ťažkosti. @@ -2814,30 +2567,14 @@ The network does not appear to fully agree! Some miners appear to be experiencin Attempt to recover private keys from a corrupt wallet.dat Pokus zachrániť súkromné kľúče z poškodeného wallet.dat - - Bitcoin Core Daemon - Démon Jadro Bitcoin - Block creation options: Voľby vytvorenia bloku: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - Vyčistiť zoznam transakcií peňaženky (diagnostický nástroj; zahŕňa -rescan) - Connect only to the specified node(s) Pripojiť sa len k určenej nóde - - Connect through SOCKS proxy - Pripojiť cez SOCKS proxy - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - Pripojiť ku JSON-RPC na <port> (prednastavené: 8332 alebo testnet: 18332) - Connection options: Možnosti pripojenia: @@ -2938,18 +2675,6 @@ The network does not appear to fully agree! Some miners appear to be experiencin Failed to write undo data Zlyhalo zapisovanie - - Fee per kB to add to transactions you send - Poplatok za kB ktorý treba pridať k odoslanej transakcii - - - Fees smaller than this are considered zero fee (for relaying) (default: - Poplatky menšie než toto sa považujú za nulové (pre preposielanie) (prednastavené: - - - Find peers using DNS lookup (default: 1 unless -connect) - Nájsť počítače v bitcoin sieti použitím DNS vyhľadávania (predvolené: 1 okrem -connect) - Force safe mode (default: 0) Vnútiť bezpečný režim (prenastavené: 0) @@ -2975,8 +2700,8 @@ The network does not appear to fully agree! Some miners appear to be experiencin Nesprávny alebo žiadny genesis blok nájdený. Nesprávny dátový priečinok alebo sieť? - Invalid -onion address: '%s' - Neplatná -onion adresa: '%s' + Invalid -onion address: '%s' + Neplatná -onion adresa: '%s' Not enough file descriptors available. @@ -2986,18 +2711,10 @@ The network does not appear to fully agree! Some miners appear to be experiencin Prepend debug output with timestamp (default: 1) Na začiatok logu pre ladenie vlož dátum a čas (prednastavené: 1) - - RPC client options: - Možnosti klienta RPC baník pyčo: - Rebuild block chain index from current blk000??.dat files Znovu vytvoriť zoznam blokov zo súčasných blk000??.dat súborov - - Select SOCKS version for -proxy (4 or 5, default: 5) - Zvoľte SOCKS verziu -proxy (4 alebo 5, predvolené 5) - Set database cache size in megabytes (%d to %d, default: %d) Nastaviť veľkosť pomocnej pamäti databázy v megabajtoch (%d na %d, prednatavené: %d) @@ -3022,10 +2739,6 @@ The network does not appear to fully agree! Some miners appear to be experiencin This is intended for regression testing tools and app development. Toto je mienené nástrojom pre regresné testovania a vývoj programu. - - Usage (deprecated, use bitcoin-cli): - Použitie (neodporúča sa, použite bitcoin-cli): - Verifying blocks... Overujem bloky... @@ -3034,10 +2747,6 @@ The network does not appear to fully agree! Some miners appear to be experiencin Verifying wallet... Overujem peňaženku... - - Wait for RPC server to start - Čakanie na štart RPC servra - Wallet %s resides outside data directory %s Peňaženka %s sa nachádza mimo dátového priečinka %s @@ -3046,10 +2755,6 @@ The network does not appear to fully agree! Some miners appear to be experiencin Wallet options: Voľby peňaženky: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - Varovanie: Zastaralý parameter -debugnet bol ignorovaný, použite -debug=net - You need to rebuild the database using -reindex to change -txindex Potrebujete prebudovať databázu použitím -reindex zmeniť -txindex @@ -3079,12 +2784,12 @@ The network does not appear to fully agree! Some miners appear to be experiencin Informácia - Invalid amount for -minrelaytxfee=<amount>: '%s' - Neplatná suma pre -minrelaytxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Neplatná suma pre -minrelaytxfee=<amount>: '%s' - Invalid amount for -mintxfee=<amount>: '%s' - Neplatná suma pre -mintxfee=<amount>: '%s' + Invalid amount for -mintxfee=<amount>: '%s' + Neplatná suma pre -mintxfee=<amount>: '%s' Limit size of signature cache to <n> entries (default: 50000) @@ -3142,14 +2847,6 @@ The network does not appear to fully agree! Some miners appear to be experiencin Run a thread to flush wallet periodically (default: 1) Mať spustené vlákno pravidelného čístenia peňaženky (predvolené: 1) - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL možnosť: (pozrite Bitcoin Wiki pre návod na nastavenie SSL) - - - Send command to Bitcoin Core - Poslať príkaz Jadru Bitcoin - Send trace/debug info to console instead of debug.log file Odoslať trace/debug informácie na konzolu namiesto debug.info žurnálu @@ -3166,10 +2863,6 @@ The network does not appear to fully agree! Some miners appear to be experiencin Show all debugging options (usage: --help -help-debug) Zobraziť všetky možnosti ladenia (použitie: --help --help-debug) - - Show benchmark information (default: 0) - Zobraziť porovnávacie informácie (prednastavené: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Zmenšiť debug.log pri spustení klienta (predvolené: 1 ak bez -debug) @@ -3182,10 +2875,6 @@ The network does not appear to fully agree! Some miners appear to be experiencin Specify connection timeout in milliseconds (default: 5000) Určiť aut spojenia v milisekundách (predvolené: 5000) - - Start Bitcoin Core Daemon - Štart služby Jadro Bitcoin - System error: Systémová chyba: @@ -3230,10 +2919,6 @@ The network does not appear to fully agree! Some miners appear to be experiencin on startup pri štarte - - version - verzia - wallet.dat corrupt, salvage failed wallet.dat je poškodený, záchrana zlyhala @@ -3242,14 +2927,6 @@ The network does not appear to fully agree! Some miners appear to be experiencin Password for JSON-RPC connections Heslo pre JSON-rPC spojenia - - Allow JSON-RPC connections from specified IP address - Povoliť JSON-RPC spojenia z určenej IP adresy. - - - Send commands to node running on <ip> (default: 127.0.0.1) - Poslať príkaz nóde bežiacej na <ip> (predvolené: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Vykonaj príkaz, ak zmeny v najlepšom bloku (%s v príkaze nahradí blok hash) @@ -3282,10 +2959,6 @@ The network does not appear to fully agree! Some miners appear to be experiencin This help message Táto pomocná správa - - Unable to bind to %s on this computer (bind returned error %d, %s) - Nepodarilo sa spojiť s %s na tomto počítači (bind vrátil chybu %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Povoliť vyhľadávanie DNS pre pridanie nódy a spojenie @@ -3298,41 +2971,29 @@ The network does not appear to fully agree! Some miners appear to be experiencin Error loading wallet.dat: Wallet corrupted Chyba načítania wallet.dat: Peňaženka je poškodená - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Chyba načítania wallet.dat: Peňaženka vyžaduje novšiu verziu Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - Bolo potrebné prepísať peňaženku: dokončite reštartovaním Bitcoin - Error loading wallet.dat Chyba načítania wallet.dat - Invalid -proxy address: '%s' - Neplatná adresa proxy: '%s' + Invalid -proxy address: '%s' + Neplatná adresa proxy: '%s' - Unknown network specified in -onlynet: '%s' - Neznáma sieť upresnená v -onlynet: '%s' + Unknown network specified in -onlynet: '%s' + Neznáma sieť upresnená v -onlynet: '%s' - Unknown -socks proxy version requested: %i - Neznáma verzia -socks proxy požadovaná: %i + Cannot resolve -bind address: '%s' + Nemožno rozriešiť -bind adress: '%s' - Cannot resolve -bind address: '%s' - Nemožno rozriešiť -bind adress: '%s' + Cannot resolve -externalip address: '%s' + Nemožno rozriešiť -externalip address: '%s' - Cannot resolve -externalip address: '%s' - Nemožno rozriešiť -externalip address: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Neplatná suma pre -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Neplatná suma pre -paytxfee=<amount>: '%s' Invalid amount @@ -3378,13 +3039,5 @@ The network does not appear to fully agree! Some miners appear to be experiencin Error Chyba - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Musíš nastaviť rpcpassword=<heslo> v konfiguračnom súbore: -%s -Ak súbor neexistuje, vytvor ho s oprávnením pre čítanie len vlastníkom (owner-readable-only) - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_sl_SI.ts b/src/qt/locale/bitcoin_sl_SI.ts index 2ad31e911b..f615d31343 100644 --- a/src/qt/locale/bitcoin_sl_SI.ts +++ b/src/qt/locale/bitcoin_sl_SI.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - O jedru Bitcoina - - - <b>Bitcoin Core</b> version - <b>Jedro Bitcoina</b> različica - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -63,11 +31,11 @@ This product includes software developed by the OpenSSL Project for use in the O Delete the currently selected address from the list - + Izbriši trenutno označeni naslov iz seznama Export the data in the current tab to a file - + Izvozi podatke v trenutni zavih v datoteko &Export @@ -91,19 +59,19 @@ This product includes software developed by the OpenSSL Project for use in the O Sending addresses - Pošiljati naslove + Naslovi za pošiljanje Receiving addresses - Prejemati naslovi + Naslovi za prejemanje These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - + To so tvoji Bitcoin naslovi za pošiljanje plačil. Vedno preveri znesek in prejemnikov naslov pred pošiljanjem kovancev. These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - To so vaši Bitcoin naslovi za prejemanje plačil. Priporočljivo je uporabljati nov prejemni naslov za vsako izmed transakcij. + To so tvoji Bitcoin naslovi za prejemanje plačil. Priporočljivo je uporabljati nov prejemni naslov za vsako izmed transakcij. Copy &Label @@ -125,11 +93,7 @@ This product includes software developed by the OpenSSL Project for use in the O Exporting Failed Neuspešen izvoz - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -163,10 +127,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Ponovite novo geslo - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Vnesite novo geslo za vstop v denarnico.<br/>Prosimo, da geslo sestavite iz <b> 10 ali več naključnih znakov</b> oz. <b>osem ali več besed</b>. - Encrypt wallet Šifriraj denarnico @@ -201,16 +161,12 @@ This product includes software developed by the OpenSSL Project for use in the O Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - + Opozorilo: V primeru izgube gesla kriptirane denarnice, boš <b>IZGUBIL VSE SVOJE BITCOINE</b>! Are you sure you wish to encrypt your wallet? Ali ste prepričani, da želite šifrirati vašo denarnico? - - 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. - - Warning: The Caps Lock key is on! Opozorilo: imate prižgan Cap Lock @@ -247,11 +203,7 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet decryption failed Dešifriranje denarnice spodletelo - - Wallet passphrase was successfully changed. - - - + BitcoinGUI @@ -268,7 +220,7 @@ This product includes software developed by the OpenSSL Project for use in the O Node - + Vozlišče Show general overview of wallet @@ -290,10 +242,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application Izhod iz aplikacije - - Show information about Bitcoin - Pokaži informacije o Bitcoinu - About &Qt O &Qt @@ -330,6 +278,10 @@ This product includes software developed by the OpenSSL Project for use in the O Open &URI... Odpri &URI... + + Bitcoin Core client + Odjemalec Bitcoin Core + Importing blocks from disk... Uvažam bloke z diska... @@ -362,10 +314,6 @@ This product includes software developed by the OpenSSL Project for use in the O Open debugging and diagnostic console Odpri razhroščevalno in diagnostično konzolo - - &Verify message... - %Preveri sporočilo ... - Bitcoin Bitcoin @@ -398,10 +346,6 @@ This product includes software developed by the OpenSSL Project for use in the O Sign messages with your Bitcoin addresses to prove you own them Za dokaz, da ste lastniki sporočil, se podpišite z Bitcoin naslovom - - Verify messages to ensure they were signed with specified Bitcoin addresses - - &File &Datoteka @@ -426,10 +370,6 @@ This product includes software developed by the OpenSSL Project for use in the O Bitcoin Core Jedro Bitcoina - - Request payments (generates QR codes and bitcoin: URIs) - - &About Bitcoin Core &O jedru Bitcoina @@ -446,34 +386,10 @@ This product includes software developed by the OpenSSL Project for use in the O Open a bitcoin: URI or payment request Odpri Bitcoin: URI ali zahteva o plačilu - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Bitcoin odjemalec - %n active connection(s) to Bitcoin network %n aktivna povezava v bitcoin omrežje%n aktivni povezavi v bitcoin omrežje%n aktivnih povezav v bitcoin omrežje%n aktivnih povezav v bitcoin omrežje - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - %n hour(s) %n ura%n uri%n ure%n ura @@ -486,10 +402,6 @@ This product includes software developed by the OpenSSL Project for use in the O %n week(s) %n teden%n tedna%n tedni%n tednov - - %1 and %2 - - %n year(s) %n leto%n leti%n leta%n let @@ -498,10 +410,6 @@ This product includes software developed by the OpenSSL Project for use in the O %1 behind %1 odzadaj - - Last received block was generated %1 ago. - - Transactions after this will not yet be visible. Transkacija za tem ne bo bila še na voljo. @@ -554,10 +462,6 @@ Naslov: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Denarnica je <b>šifrirana</b> in trenutno <b>zaklenjena</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - ClientModel @@ -568,10 +472,6 @@ Naslov: %4 CoinControlDialog - - Coin Control Address Selection - - Quantity: Količina: @@ -593,29 +493,13 @@ Naslov: %4 Provizija: - Low Output: - - - - After Fee: - + Dust: + Prah: Change: Sprememba: - - (un)select all - - - - Tree mode - - - - List mode - - Amount Količina @@ -656,14 +540,6 @@ Naslov: %4 Copy transaction ID Kopiraj ID transakcije - - Lock unspent - - - - Unlock unspent - - Copy quantity Kopiraj količino @@ -672,10 +548,6 @@ Naslov: %4 Copy fee Kopiraj provizijo - - Copy after fee - - Copy bytes Kopiraj bite @@ -684,14 +556,6 @@ Naslov: %4 Copy priority Kopiraj prednostno mesto - - Copy low output - - - - Copy change - - highest najvišja @@ -732,14 +596,6 @@ Naslov: %4 (%1 locked) (%1 zaklenjeno) - - none - - - - Dust - Prah - yes da @@ -752,51 +608,11 @@ Naslov: %4 This label turns red, if the transaction size is greater than 1000 bytes. V primeru, da je velikost transakcije večja od 1000 bitov, se ta oznaka se obarva rdeče. - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (ni oznake) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -811,10 +627,6 @@ Naslov: %4 The label associated with this address list entry Oznaka je povezana s tem vnosom seznama naslovov - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Naslov @@ -836,12 +648,8 @@ Naslov: %4 Uredi naslov za odlive - The entered address "%1" is already in the address book. - Vnešeni naslov "&1" je že v imeniku. - - - The entered address "%1" is not a valid Bitcoin address. - Vnešeni naslov "%1" ni veljaven Bitcoin naslov. + The entered address "%1" is not a valid Bitcoin address. + Vnešeni naslov "%1" ni veljaven Bitcoin naslov. Could not unlock wallet. @@ -854,33 +662,13 @@ Naslov: %4 FreespaceChecker - - A new data directory will be created. - - name ime - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core Jedro Bitcoina @@ -889,6 +677,14 @@ Naslov: %4 version različica + + About Bitcoin Core + O jedru Bitcoina + + + Command-line options + Možnosti ukazne vrstice + Usage: Uporaba: @@ -902,26 +698,14 @@ Naslov: %4 možnosti uporabniškega vmesnika - Set language, for example "de_DE" (default: system locale) - Nastavi jezik, npr. "sl_SI" (privzeto: jezikovna oznaka sistema) + Set language, for example "de_DE" (default: system locale) + Nastavi jezik, npr. "sl_SI" (privzeto: jezikovna oznaka sistema) Start minimized Zaženi pomanjšano - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro @@ -933,28 +717,8 @@ Naslov: %4 Dobrodošli v jedru Bitcoina - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" can not be created. - + Bitcoin Core + Jedro Bitcoina Error @@ -964,11 +728,7 @@ Naslov: %4 GB of free space available GB prostora na voljo - - (of %1GB needed) - - - + OpenURIDialog @@ -983,15 +743,7 @@ Naslov: %4 URI: URI: - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog @@ -1002,10 +754,6 @@ Naslov: %4 &Main &Glavno - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - Pay transaction &fee Nakazilo plačila & provizija @@ -1018,85 +766,29 @@ Naslov: %4 &Start Bitcoin on system login &Zaženi Bitcoin ob prijavi v sistem - - Size of &database cache - - MB megabite - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - &Network &Omrežje - - (0 = auto, <0 = leave that many cores free) - - W&allet &Denarnica Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - + Poznavalec Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - + Avtomatično odpri vrata Bitcoin odjemalca na usmerjevalniku. To deluje samo, če vaš usmerjevalnik podpira UPnP in je omogočen. Map port using &UPnP - + Naslavljanje vrat z uporabo &UPnP Proxy &IP: @@ -1110,33 +802,25 @@ Naslov: %4 Port of the proxy (e.g. 9050) Vrata strežnika (npr.: 9050) - - SOCKS &Version: - SOCKS &različica: - - - SOCKS version of the proxy (e.g. 5) - SOCKS različica posredniškega strežnika (npr.: 5) - &Window &Okno Show only a tray icon after minimizing the window. - + Prikaži samo pomanjšano ikono programa po pomanjšitvi okna. &Minimize to the tray instead of the taskbar - + &Minimiraj na pladenj namesto na opravilno vrstico Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - + Minimiziraj namesto izhoda iz programa, ko je okno zaprto. Ko je ta opcija omogočena se bo aplikacija zaprla z izbiro opcije Zapri iz menija. M&inimize on close - + &Minimiziraj na ukaz zapri &Display @@ -1148,27 +832,11 @@ Naslov: %4 The user interface language can be set here. This setting will take effect after restarting Bitcoin. - + Tukaj je mogoče nastaviti uporabniški vmesnik za jezike. Ta nastavitev bo prikazana šele, ko boste znova zagnali Bitcoin. &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - + & &OK @@ -1182,31 +850,7 @@ Naslov: %4 default privzeto - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage @@ -1229,22 +873,10 @@ Naslov: %4 Your current spendable balance Vaše trenutno razpoložljivo stanje - - Pending: - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance Skupno število potrjenih transakcij, ki sicer niso bile prištete k razpoložljivem stanju - - Immature: - - - - Mined balance that has not yet matured - - Total: Skupaj: @@ -1259,7 +891,7 @@ Naslov: %4 out of sync - + iz sinhronizacije @@ -1269,57 +901,17 @@ Naslov: %4 Rokovanje z URI - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - + Invalid payment address %1 + Neveljaven naslov plačila %1 Payment request error Napaka pri zahtevi plačila - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - Error communicating with %1: %2 Napaka pri povezavi z %1: %2 - - Payment request can not be parsed or processed! - - Bad response from server %1 Slab odziv strežnika %1 @@ -1334,32 +926,31 @@ Naslov: %4 - QObject + PeerTableModel - Bitcoin - Bitcoin - - - Error: Specified data directory "%1" does not exist. - Napaka: Želena nahajališče datoteke "%1" ne obstaja. - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - Napaka: Neveljavna kombinacija -regtest and -testnet - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Vnesite bitcoin naslov (npr.: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + Ping Time + Odzivni čas + + QObject + + Amount + Količina + + + %1 h + %1 ur + + + %1 m + %1 minut + + + N/A + Neznano + + QRImageWidget @@ -1397,18 +988,14 @@ Naslov: %4 &Information &Informacije - - Debug window - - - - General - - Using OpenSSL version OpenSSL različica v rabi + + Using BerkeleyDB version + BerkeleyDB različica v rabi + Startup time Čas zagona @@ -1417,10 +1004,6 @@ Naslov: %4 Network Omrežje - - Name - - Number of connections Število povezav @@ -1434,8 +1017,24 @@ Naslov: %4 Trenutno število blokov - Estimated total blocks - Ocenjeno skupno število blokov + Received + Prejeto + + + Sent + Poslano + + + Version + Različica + + + Services + Storitve + + + Ping Time + Odzivni čas Last block time @@ -1461,14 +1060,6 @@ Naslov: %4 Totals Vsote - - In: - - - - Out: - - Build date Datum izgradnje @@ -1477,10 +1068,6 @@ Naslov: %4 Debug log file Razhroščevalna dnevniška datoteka - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - Clear console Počisti konzolo @@ -1514,16 +1101,24 @@ Naslov: %4 %1 gigabitov - %1 m - %1 minut + never + nikoli - %1 h - %1 ur + Yes + Da - %1 h %2 m - %1 ur %2 minut + No + Ne + + + Unknown + Neznano + + + Fetching... + Pridobivam... @@ -1540,50 +1135,18 @@ Naslov: %4 &Message: &Sporočilo: - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - An optional label to associate with the new receiving address. Pomožna oznaka je povezana z novim sprejemnim naslovom. - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - Clear Počisti - - Requested payments history - - &Request payment &Zahtevaj plačilo - - Show the selected request (does the same as double clicking an entry) - - Show Pokaži @@ -1627,17 +1190,13 @@ Naslov: %4 &Save Image... &Shrani sliko.. - - Request payment to %1 - - Payment information Informacija o plačilu URI - + URI Address @@ -1661,7 +1220,7 @@ Naslov: %4 Error encoding URI into QR Code. - + Napaka pri kodiranju URIja v QR kodo. @@ -1701,10 +1260,6 @@ Naslov: %4 Send Coins Pošlji kovance - - Coin Control Features - - Inputs... Vnosi... @@ -1737,26 +1292,10 @@ Naslov: %4 Fee: Provizija: - - Low Output: - - - - After Fee: - - Change: Sprememba: - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Pošlji več prejemnikom hkrati @@ -1766,8 +1305,8 @@ Naslov: %4 Dodaj &prejemnika - Clear all fields of the form. - + Dust: + Prah: Clear &All @@ -1789,10 +1328,6 @@ Naslov: %4 Confirm send coins Potrdi odliv kovancev - - %1 to %2 - - Copy quantity Kopiraj količino @@ -1805,10 +1340,6 @@ Naslov: %4 Copy fee Kopiraj provizijo - - Copy after fee - - Copy bytes Kopiraj bite @@ -1817,26 +1348,10 @@ Naslov: %4 Copy priority Kopiraj prednostno mesto - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - or ali - - The recipient address is not valid, please recheck. - - The amount to pay must be larger than 0. Količina za plačilo mora biti večja od 0. @@ -1845,22 +1360,10 @@ Naslov: %4 The amount exceeds your balance. Količina presega vaše dobroimetje - - The total exceeds your balance when the %1 transaction fee is included. - Celotni znesek presega vaše stanje, ko je zaračunana 1% provizija. - Duplicate address found, can only send to each address once per send operation. Najdena kopija naslova, možnost pošiljanja na vsakega izmed naslov le enkrat ob pošiljanju. - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - Warning: Invalid Bitcoin address Opozorilo: Neveljaven Bitcoin naslov @@ -1869,10 +1372,6 @@ Naslov: %4 (no label) (ni oznake) - - Warning: Unknown change address - - Are you sure you want to send? Ali ste prepričani, da želite poslati? @@ -1881,14 +1380,6 @@ Naslov: %4 added as transaction fee dodano kot provizija transakcije - - Payment request expired - Zahteva plačila je potekla - - - Invalid payment address %1 - Neveljaven naslov plačila %1 - SendCoinsEntry @@ -1900,10 +1391,6 @@ Naslov: %4 Pay &To: Prejemnik &plačila: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - Enter a label for this address to add it to your address book Vnesite oznako za ta naslov, ki bo shranjena v imenik @@ -1916,10 +1403,6 @@ Naslov: %4 Choose previously used address Izberi zadnje uporabljen naslov - - This is a normal payment. - - Alt+A Alt+A @@ -1932,45 +1415,17 @@ Naslov: %4 Alt+P Alt+P - - Remove this entry - - Message: Sporočilo: - - This is a verified payment request. - - Enter a label for this address to add it to the list of used addresses Vnesite oznako za ta naslov, ki bo shranjena v seznam uporabljenih naslovov - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - Do not shut down the computer until this window disappears. Ne zaustavite računalnika dokler to okno ne izgine. @@ -1986,14 +1441,6 @@ Naslov: %4 &Sign Message &Podpiši sporočilo - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - Choose previously used address Izberi zadnje uporabljen naslov @@ -2010,30 +1457,14 @@ Naslov: %4 Alt+P Alt+P - - Enter the message you want to sign here - - Signature Podpis - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - Sign &Message Podpiši &sporočilo - - Reset all sign message fields - - Clear &All Počisti &vse @@ -2042,33 +1473,13 @@ Naslov: %4 &Verify Message &Preveri sporočilo - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - Verify &Message Preveri &Sporočilo - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Vnesite bitcoin naslov (npr.: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Kliknite "Podpiši sporočilo" za ustvaritev podpisa + Click "Sign Message" to generate signature + Kliknite "Podpiši sporočilo" za ustvaritev podpisa The entered address is invalid. @@ -2078,10 +1489,6 @@ Naslov: %4 Please check the address and try again. Prosimo preverite naslov in poizkusite znova. - - The entered address does not refer to a key. - - Wallet unlock was cancelled. Odklepanje denarnice je bilo prekinjeno. @@ -2106,10 +1513,6 @@ Naslov: %4 Please check the signature and try again. Prosimo preverite podpis in poizkusite znova. - - The signature did not match the message digest. - - Message verification failed. Pregledovanje sporočila spodletelo. @@ -2125,10 +1528,6 @@ Naslov: %4 Bitcoin Core Jedro Bitcoina - - The Bitcoin Core developers - - [testnet] [testnet] @@ -2136,25 +1535,13 @@ Naslov: %4 TrafficGraphWidget - - KB/s - - - + TransactionDesc Open until %1 Odpri enoto %1 - - conflicted - - - - %1/offline - - %1/unconfirmed %1/nepotrjeno @@ -2167,10 +1554,6 @@ Naslov: %4 Status Stanje - - , broadcast through %n node(s) - - Date Datum @@ -2199,14 +1582,6 @@ Naslov: %4 label oznaka - - Credit - - - - matures in %n more block(s) - - not accepted ni bilo sprejeto @@ -2239,10 +1614,6 @@ Naslov: %4 Merchant Trgovec - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - Debug information Razhroščevalna informacija @@ -2271,10 +1642,6 @@ Naslov: %4 , has not been successfully broadcast yet , še ni bila uspešno raznešena - - Open for %n more block(s) - - unknown neznano @@ -2305,18 +1672,6 @@ Naslov: %4 Address Naslov - - Amount - Količina - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - Open until %1 Odpri enoto %1 @@ -2333,22 +1688,10 @@ Naslov: %4 Generated but not accepted Generirano, toda ne sprejeto - - Offline - - Unconfirmed Nepotrjeno - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with Prejeto z @@ -2476,18 +1819,10 @@ Naslov: %4 Show transaction details Prikaži podrobnosti transakcije - - Export Transaction History - - Exporting Failed Neuspešen izvoz - - There was an error trying to save the transaction history to %1. - - Exporting Successful Uspešen izvoz @@ -2520,10 +1855,6 @@ Naslov: %4 Address Naslov - - Amount - Količina - ID ID @@ -2537,13 +1868,12 @@ Naslov: %4 za + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2559,7 +1889,7 @@ Naslov: %4 Export the data in the current tab to a file - + Izvozi podatke v trenutni zavih v datoteko Backup Wallet @@ -2588,18 +1918,6 @@ Naslov: %4 bitcoin-core - - Usage: - Uporaba: - - - List commands - Prikaži ukaze - - - Get help for a command - Prikaži pomoč za ukaz - Options: Možnosti: @@ -2640,22 +1958,10 @@ Naslov: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Število sekund za težavo pri vzpostavitvi povezave med uporabniki (privzeto: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - Accept command line and JSON-RPC commands Sprejmi ukaze iz ukazne vrstice in JSON-RPC - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Teci v ozadju in sprejemaj ukaze @@ -2664,52 +1970,6 @@ Naslov: %4 Use the test network Uporabi testno omrežje - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Napaka: Transakcija ni bila sprejeta! To se je morebiti zgodilo, ker so nekateri kovanci v vaši denarnici bili že porabljeni, na primer če ste uporabili kopijo wallet.dat in so tako kovanci bili porabljeni v kopiji, ostali pa označeni kot neporabljeni. @@ -2722,150 +1982,34 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Izvedi ukaz, ko bo transakcija denarnice se spremenila (V cmd je bil TxID zamenjan za %s) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications To je pred izdana poizkusna verzija - uporaba na lastno odgovornost - ne uporabljajte je za rudarstvo ali trgovske aplikacije - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - + Za doseg soležnikov preko Tor skritih storitev uporabi ločen SOCKS5 proxy (privzeto: -proxy) Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. Opozorilo: napaka pri branju wallet.dat! Vsi ključi so bili pravilno prebrani, podatki o transakciji ali imenik vnešenih naslovov so morda izgubljeni ali nepravilni. - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - (default: 1) - + (privzeto: 1) (default: wallet.dat) - + (privzeto: wallet.dat) <category> can be: <kategorija> je lahko: - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - Block creation options: Možnosti ustvarjanja blokov: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - Error: Disk space is low! Opozorilo: Premalo prostora na disku! @@ -2878,34 +2022,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error: system error: Napaka: sistemska napaka: - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - Failed to write file info Zapisovanje informacij o datoteki neuspešno @@ -2914,262 +2030,26 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write to coin database Neuspešno zapisovanje na bazi podatkov kovancev - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - Generate coins (default: 0) Ustvari kovance (privzeto: 0) - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - Počakajte na zagon RPC strežnika - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - + Uvažam... Information Informacije - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL možnosti: (glejte Bitcoin Wiki za navodla, kako nastaviti SSL) - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file Pošlji sledilne/razhroščevalne informacije v konzolo namesto jih shraniti v debug.log datoteko - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - Signing transaction failed Podpisovanje transakcije spodletelo - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - System error: Sistemska napaka: @@ -3186,14 +2066,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Transaction too large Transkacija je prevelika - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - Username for JSON-RPC connections Uporabniško ime za JSON-RPC povezave @@ -3206,18 +2078,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: This version is obsolete, upgrade required! Opozorilo: ta različica je zastarela, potrebna je nadgradnja! - - Zapping all transactions from wallet... - - - - on startup - - - - version - različica - wallet.dat corrupt, salvage failed wallet.dat poškodovana, neuspešna obnova @@ -3226,17 +2086,9 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Password for JSON-RPC connections Geslo za JSON-RPC povezave - - Allow JSON-RPC connections from specified IP address - Dovoli JSON-RPC povezave z določenega IP naslova - - - Send commands to node running on <ip> (default: 127.0.0.1) - Pošlji ukaze vozlišču na <ip> (privzet: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) - + Izvedi ukaz, ko je najboljši blok spremenjen (%s je v cmd zamenjan za iskalnik blokov) Upgrade wallet to latest format @@ -3266,10 +2118,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message To sporočilo pomoči - - Unable to bind to %s on this computer (bind returned error %d, %s) - Nemogoče je povezati s/z %s na tem računalniku (povezava je vrnila napaka %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Omogoči DNS poizvedbe za -addnode, -seednode in -connect. @@ -3282,41 +2130,29 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted Napaka pri nalaganju wallet.dat: denarnica pokvarjena - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Napaka pri nalaganju wallet.dat: denarnica zahteva novejšo različico Bitcoina - - - Wallet needed to be rewritten: restart Bitcoin to complete - Denarnica mora biti prepisana: ponovno zaženite Bitcoin za doknčanje - Error loading wallet.dat Napaka pri nalaganju wallet.dat - Invalid -proxy address: '%s' - Neveljaven -proxy naslov: '%s' + Invalid -proxy address: '%s' + Neveljaven -proxy naslov: '%s' - Unknown network specified in -onlynet: '%s' - Neznano omrežje določeno v -onlynet: '%s'. + Unknown network specified in -onlynet: '%s' + Neznano omrežje določeno v -onlynet: '%s'. - Unknown -socks proxy version requested: %i - Neznano -socks zahtevan zastopnik različice: %i + Cannot resolve -bind address: '%s' + Nemogoče rešiti -bind naslova: '%s' - Cannot resolve -bind address: '%s' - Nemogoče rešiti -bind naslova: '%s' + Cannot resolve -externalip address: '%s' + Nemogoče rešiti -externalip naslova: '%s' - Cannot resolve -externalip address: '%s' - Nemogoče rešiti -externalip naslova: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Neveljavna količina za -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + Neveljavna količina za -paytxfee=<amount>: '%s' Invalid amount @@ -3362,13 +2198,5 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error Napaka - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Potrebno je nastaviti rpcpassword=<password> v nastavitveni datoteki: -%s -Če datoteka ne obstaja jo ustvarite z dovoljenjem, da jo lahko bere samo uporabnik. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_sq.ts b/src/qt/locale/bitcoin_sq.ts index 65e37ff903..f779e391c0 100644 --- a/src/qt/locale/bitcoin_sq.ts +++ b/src/qt/locale/bitcoin_sq.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -41,95 +9,19 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address Krijo një adresë të re - - &New - - Copy the currently selected address to the system clipboard Kopjo adresën e zgjedhur në memorjen e sistemit - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - &Delete &Fshi - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - Comma separated file (*.csv) Skedar i ndarë me pikëpresje(*.csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -147,10 +39,6 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase Futni frazkalimin @@ -163,21 +51,17 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Përsërisni frazkalimin e ri - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Futni frazkalimin e ri në portofol.<br/>Ju lutemi përdorni një frazkalim prej<b>10 ose më shumë shkronjash të rastësishme<b/>, ose tetë apo më shumë fjalë</b>. - Encrypt wallet Enkripto portofolin This operation needs your wallet passphrase to unlock the wallet. - Ky veprim ka nevojë per frazkalimin e portofolit tuaj që të ç'kyç portofolin. + Ky veprim ka nevojë per frazkalimin e portofolit tuaj që të ç'kyç portofolin. Unlock wallet - ç'kyç portofolin. + ç'kyç portofolin. This operation needs your wallet passphrase to decrypt the wallet. @@ -199,30 +83,10 @@ This product includes software developed by the OpenSSL Project for use in the O Confirm wallet encryption Konfirmoni enkriptimin e portofolit - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - Wallet encrypted Portofoli u enkriptua - - Bitcoin 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. - - Wallet encryption failed Enkriptimi i portofolit dështoi @@ -237,7 +101,7 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet unlock failed - ç'kyçja e portofolit dështoi + ç'kyçja e portofolit dështoi The passphrase entered for the wallet decryption was incorrect. @@ -247,17 +111,9 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet decryption failed Dekriptimi i portofolit dështoi - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - Synchronizing with network... Duke u sinkronizuar me rrjetin... @@ -266,10 +122,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Overview &Përmbledhje - - Node - - Show general overview of wallet Trego një përmbledhje te përgjithshme të portofolit @@ -282,126 +134,18 @@ This product includes software developed by the OpenSSL Project for use in the O Browse transaction history Shfleto historinë e transaksioneve - - E&xit - - Quit application Mbyllni aplikacionin - - Show information about Bitcoin - Trego informacionin rreth Botkoin-it - - - About &Qt - - - - Show information about Qt - - &Options... &Opsione - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - Change the passphrase used for wallet encryption Ndrysho frazkalimin e përdorur per enkriptimin e portofolit - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - &File &Skedar @@ -422,102 +166,6 @@ This product includes software developed by the OpenSSL Project for use in the O [testnet] [testo rrjetin] - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - - - %n active connection(s) to Bitcoin network - %n lidhje aktive me rrjetin e Bitkoin%n lidhje aktive me rrjetin e Bitkoin - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - - - Error - - - - Warning - - - - Information - - Up to date I azhornuar @@ -534,84 +182,20 @@ This product includes software developed by the OpenSSL Project for use in the O Incoming transaction Transaksion në ardhje - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> - Portofoli po <b> enkriptohet</b> dhe është <b> i ç'kyçur</b> + Portofoli po <b> enkriptohet</b> dhe është <b> i ç'kyçur</b> Wallet is <b>encrypted</b> and currently <b>locked</b> Portofoli po <b> enkriptohet</b> dhe është <b> i kyçur</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount Sasia @@ -624,175 +208,11 @@ Address: %4 Date Data - - Confirmations - - - - Confirmed - - - - Priority - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (pa etiketë) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -803,14 +223,6 @@ Address: %4 &Label &Etiketë - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Adresa @@ -832,16 +244,12 @@ Address: %4 ndrysho adresën dërguese - The entered address "%1" is already in the address book. - Adresa e dhënë "%1" është e zënë në librin e adresave. - - - The entered address "%1" is not a valid Bitcoin address. - + The entered address "%1" is already in the address book. + Adresa e dhënë "%1" është e zënë në librin e adresave. Could not unlock wallet. - Nuk mund të ç'kyçet portofoli. + Nuk mund të ç'kyçet portofoli. New key generation failed. @@ -850,791 +258,62 @@ Address: %4 FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - - - version - - - - Usage: - - - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - - - Error - - - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog Options Opsionet - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage Form Formilarë - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - <b>Recent transactions</b> <b>Transaksionet e fundit</b> - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - + Amount + Sasia - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Futni një adresë Bitkoini (p.sh. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - &Label: &Etiketë: - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - - - Copy label - - - - Copy message - - - - Copy amount - - - + ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address Adresë @@ -1647,19 +326,7 @@ Address: %4 Label Etiketë - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel @@ -1670,10 +337,6 @@ Address: %4 Label Etiketë - - Message - - Amount Sasia @@ -1682,93 +345,17 @@ Address: %4 (no label) (pa etiketë) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins Dërgo Monedha - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - Send to multiple recipients at once Dërgo marrësve të ndryshëm njëkohësisht - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - Balance: Balanca: @@ -1777,115 +364,19 @@ Address: %4 Confirm the send action Konfirmo veprimin e dërgimit - - S&end - - Confirm send coins konfirmo dërgimin e monedhave - - %1 to %2 - - - - Copy quantity - - - - Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - The amount to pay must be larger than 0. Shuma e paguar duhet të jetë më e madhe se 0. - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (pa etiketë) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry @@ -1896,26 +387,14 @@ Address: %4 Pay &To: Paguaj &drejt: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - Enter a label for this address to add it to your address book - Krijoni një etiketë për këtë adresë që t'ja shtoni librit të adresave + Krijoni një etiketë për këtë adresë që t'ja shtoni librit të adresave &Label: &Etiketë: - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt+A @@ -1928,72 +407,12 @@ Address: %4 Alt+P Alt+P - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - Alt+A Alt+A @@ -2006,125 +425,9 @@ Address: %4 Alt+P Alt+P - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Futni një adresë Bitkoini (p.sh. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - [testnet] [testo rrjetin] @@ -2132,25 +435,13 @@ Address: %4 TrafficGraphWidget - - KB/s - - - + TransactionDesc Open until %1 Hapur deri më %1 - - conflicted - - - - %1/offline - - %1/unconfirmed %1/I pakonfirmuar @@ -2159,118 +450,18 @@ Address: %4 %1 confirmations %1 konfirmimet - - Status - - - - , broadcast through %n node(s) - - Date Data - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - Amount Sasia - - true - - - - false - - , has not been successfully broadcast yet , nuk është transmetuar me sukses deri tani - - Open for %n more block(s) - - unknown i/e panjohur @@ -2301,18 +492,6 @@ Address: %4 Address Adresë - - Amount - Sasia - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - Open until %1 Hapur deri më %1 @@ -2329,30 +508,10 @@ Address: %4 Generated but not accepted I krijuar por i papranuar - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with Marrë me - - Received from - - Sent to Dërguar drejt @@ -2369,57 +528,9 @@ Address: %4 (n/a) (p/a) - - Transaction status. Hover over this field to show number of confirmations. - - - - Date and time that the transaction was received. - - - - Type of transaction. - - - - Destination address of transaction. - - - - Amount removed from or added to balance. - - - + TransactionView - - All - - - - Today - - - - This week - - - - This month - - - - Last month - - - - This year - - - - Range... - - Received with Marrë me @@ -2428,78 +539,14 @@ Address: %4 Sent to Dërguar drejt - - To yourself - - Mined Minuar - - Other - - - - Enter address or label to search - - - - Min amount - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Skedar i ndarë me pikëpresje(*.csv) - - Confirmed - - Date Data @@ -2516,30 +563,13 @@ Address: %4 Address Adresë - - Amount - Sasia - - - ID - - - - Range: - - - - to - - - + + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2549,820 +579,8 @@ Address: %4 WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - - - Options: - - - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - - - Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - - - Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - - - Done loading - - - - To use the %s option - - - - Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - - + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_sr.ts b/src/qt/locale/bitcoin_sr.ts index 901eb59394..f5723efece 100644 --- a/src/qt/locale/bitcoin_sr.ts +++ b/src/qt/locale/bitcoin_sr.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -41,95 +9,19 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address Прави нову адресу - - &New - - Copy the currently selected address to the system clipboard Копира изабрану адресу на системски клипборд - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - &Delete &Избриши - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - Comma separated file (*.csv) Зарезом одвојене вредности (*.csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -147,10 +39,6 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase Унесите лозинку @@ -163,10 +51,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Поновите нову лозинку - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Унесите нову лозинку за приступ новчанику.<br/>Молимо Вас да лозинка буде <b>10 или више насумице одабраних знакова</b>, или <b>осам или више речи</b>. - Encrypt wallet Шифровање новчаника @@ -207,14 +91,6 @@ This product includes software developed by the OpenSSL Project for use in the O Are you sure you wish to encrypt your wallet? Да ли сте сигурни да желите да се новчаник шифује? - - 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. - - - - Warning: The Caps Lock key is on! - - Wallet encrypted Новчаник је шифрован @@ -254,10 +130,6 @@ This product includes software developed by the OpenSSL Project for use in the O BitcoinGUI - - Sign &message... - - Synchronizing with network... Синхронизација са мрежом у току... @@ -266,10 +138,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Overview &Општи преглед - - Node - - Show general overview of wallet Погледајте општи преглед новчаника @@ -290,10 +158,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application Напустите програм - - Show information about Bitcoin - Прегледајте информације о Bitcoin-у - About &Qt О &Qt-у @@ -318,26 +182,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Change Passphrase... Промени &лозинку... - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - Send coins to a Bitcoin address Пошаљите новац на bitcoin адресу @@ -346,61 +190,17 @@ This product includes software developed by the OpenSSL Project for use in the O Modify configuration options for Bitcoin Изаберите могућности bitcoin-а - - Backup wallet to another location - - Change the passphrase used for wallet encryption Мењање лозинке којом се шифрује новчаник - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - Wallet новчаник &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - + &Пошаљи &File @@ -422,102 +222,6 @@ This product includes software developed by the OpenSSL Project for use in the O [testnet] [testnet] - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - - - %n active connection(s) to Bitcoin network - %n активна веза са Bitcoin мрежом%n активне везе са Bitcoin мрежом%n активних веза са Bitcoin мрежом - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - - - Error - - - - Warning - - - - Information - - Up to date Ажурно @@ -550,68 +254,16 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Новчаник јс <b>шифрован</b> и тренутно <b>закључан</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - Amount: Iznos: - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount iznos @@ -624,18 +276,10 @@ Address: %4 Date datum - - Confirmations - - Confirmed Potvrdjen - - Priority - - Copy address kopiraj adresu @@ -648,151 +292,11 @@ Address: %4 Copy amount kopiraj iznos - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (без етикете) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -803,84 +307,24 @@ Address: %4 &Label &Етикета - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Адреса - New receiving address - - - - New sending address - - - - Edit receiving address - - - - Edit sending address - - - - The entered address "%1" is already in the address book. - Унешена адреса "%1" се већ налази у адресару. - - - The entered address "%1" is not a valid Bitcoin address. - + The entered address "%1" is already in the address book. + Унешена адреса "%1" се већ налази у адресару. Could not unlock wallet. Немогуће откључати новчаник. - - New key generation failed. - - - + FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - version верзија @@ -889,717 +333,72 @@ Address: %4 Usage: Korišćenje: - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - - - Error - - - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog Options Поставке - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - &Unit to show amounts in: &Јединица за приказивање износа: - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - &OK &OK - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage Form Форма - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - Wallet новчаник - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - <b>Recent transactions</b> <b>Недавне трансакције</b> - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - + Amount + iznos - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Unesite Bitcoin adresu (n.pr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - &Label: &Етикета - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - Copy label kopiraj naziv - - Copy message - - Copy amount kopiraj iznos @@ -1607,34 +406,6 @@ Address: %4 ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address Адреса @@ -1647,19 +418,7 @@ Address: %4 Label Етикета - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel @@ -1670,10 +429,6 @@ Address: %4 Label Етикета - - Message - - Amount iznos @@ -1682,97 +437,17 @@ Address: %4 (no label) (без етикете) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins Слање новца - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - Amount: Iznos: - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - - - Send to multiple recipients at once - - - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - - - Balance: - - Confirm the send action Потврди акцију слања @@ -1781,350 +456,50 @@ Address: %4 S&end &Пошаљи - - Confirm send coins - - - - %1 to %2 - - - - Copy quantity - - Copy amount kopiraj iznos - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - - - The amount to pay must be larger than 0. - - - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (без етикете) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry - - A&mount: - - - - Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Enter a label for this address to add it to your address book - - &Label: &Етикета - - Choose previously used address - - - - This is a normal payment. - - Alt+A Alt+ - - Paste address from clipboard - - Alt+P Alt+П - - Remove this entry - - Message: Poruka: - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - Alt+A - Alt+A - - - Paste address from clipboard - + Alt+ Alt+P Alt+П - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Unesite Bitcoin adresu (n.pr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - [testnet] [testnet] @@ -2132,24 +507,12 @@ Address: %4 TrafficGraphWidget - - KB/s - - - + TransactionDesc Open until %1 - Otvorite do %1 - - - conflicted - - - - %1/offline - + Otvoreno do %1 %1/unconfirmed @@ -2159,118 +522,22 @@ Address: %4 %1 confirmations %1 potvrde - - Status - - - - , broadcast through %n node(s) - - Date datum - - Source - - - - Generated - - - - From - - - - To - - - - own address - - label етикета - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - Amount iznos - - true - - - - false - - , has not been successfully broadcast yet , nije još uvek uspešno emitovan - - Open for %n more block(s) - - unknown nepoznato @@ -2301,18 +568,6 @@ Address: %4 Address Адреса - - Amount - iznos - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - Open until %1 Otvoreno do %1 @@ -2329,22 +584,6 @@ Address: %4 Generated but not accepted Generisan ali nije prihvaćen - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with Primljen sa @@ -2460,38 +699,10 @@ Address: %4 Copy amount kopiraj iznos - - Copy transaction ID - - Edit label promeni naziv - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Зарезом одвојене вредности (*.csv) @@ -2516,14 +727,6 @@ Address: %4 Address Адреса - - Amount - iznos - - - ID - - Range: Opseg: @@ -2533,13 +736,12 @@ Address: %4 do + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2549,53 +751,13 @@ Address: %4 WalletView - - &Export - - - - Export the data in the current tab to a file - - Backup Wallet - + Backup новчаника - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - Korišćenje: - - - List commands - Listaj komande - - - Get help for a command - Zatraži pomoć za komande - Options: Opcije @@ -2621,38 +783,10 @@ Address: %4 Održavaj najviše <n> konekcija po priključku (default: 125) - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - Accept command line and JSON-RPC commands Prihvati komandnu liniju i JSON-RPC komande - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Radi u pozadini kao daemon servis i prihvati komande @@ -2661,584 +795,14 @@ Address: %4 Use the test network Koristi testnu mrežu - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - Username for JSON-RPC connections Korisničko ime za JSON-RPC konekcije - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - верзија - - - wallet.dat corrupt, salvage failed - - Password for JSON-RPC connections Lozinka za JSON-RPC konekcije - - Allow JSON-RPC connections from specified IP address - Dozvoli JSON-RPC konekcije sa posebne IP adrese - - - Send commands to node running on <ip> (default: 127.0.0.1) - Pošalji komande to nodu koji radi na <ip> (default: 127.0.0.1) - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - Set key pool size to <n> (default: 100) Odredi veličinu zaštićenih ključeva na <n> (default: 100) @@ -3251,10 +815,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Use OpenSSL (https) for JSON-RPC connections Koristi OpenSSL (https) za JSON-RPC konekcije - - Server certificate file (default: server.cert) - - Server private key (default: server.pem) privatni ključ za Server (podrazumevan: server.pem) @@ -3263,14 +823,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message Ova poruka Pomoći - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - Loading addresses... učitavam adrese.... @@ -3279,70 +831,18 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted Грешка током учитавања wallet.dat: Новчаник је покварен - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Грешка током учитавања wallet.dat: Новчанику је неопходна нова верзија Bitcoin-a. - - - Wallet needed to be rewritten: restart Bitcoin to complete - - Error loading wallet.dat Грешка током учитавања wallet.dat - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - Loading block index... Učitavam blok indeksa... - - Add a node to connect to and attempt to keep the connection open - - Loading wallet... Новчаник се учитава... - - Cannot downgrade wallet - - - - Cannot write default address - - Rescanning... Ponovo skeniram... @@ -3351,19 +851,5 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Done loading Završeno učitavanje - - To use the %s option - - - - Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - - + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_sv.ts b/src/qt/locale/bitcoin_sv.ts index e98048e925..8e771c5ce7 100644 --- a/src/qt/locale/bitcoin_sv.ts +++ b/src/qt/locale/bitcoin_sv.ts @@ -1,42 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - Om Bitcoin Core - - - <b>Bitcoin Core</b> version - <b>Bitcoin Core</b>-version - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Detta är experimentell mjukvara. - - -Distribuerad under mjukvarulicensen MIT/X11, se den medföljande filen COPYING eller http://www.opensource.org/licenses/mit-license.php. - -Denna produkten innehåller mjukvara utvecklad av OpenSSL Project för användning i OpenSSL Toolkit (http://www.openssl.org/) och kryptografisk mjukvara utvecklad av Eric Young (eay@cryptsoft.com) samt UPnP-mjukvara skriven av Thomas Bernard. - - - Copyright - Copyright - - - The Bitcoin Core developers - Bitcoin Core-utvecklarna - - - (%1-bit) - (%1-bit) - - + AddressBookPage @@ -132,8 +94,9 @@ Denna produkten innehåller mjukvara utvecklad av OpenSSL Project för användni Exporteringen misslyckades - There was an error trying to save the address list to %1. - Det inträffade ett fel när adresslistan skulle sparas till %1. + There was an error trying to save the address list to %1. Please try again. + Det inträffade ett fel när adresslistan skulle sparas till %1. +Var vänlig och försök igen. @@ -169,10 +132,6 @@ Denna produkten innehåller mjukvara utvecklad av OpenSSL Project för användni Repeat new passphrase Upprepa nytt lösenord - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Ange plånbokens nya lösenord. <br/> Använd ett lösenord på <b>10 eller fler slumpmässiga tecken,</b> eller <b>åtta eller fler ord.</b> - Encrypt wallet Kryptera plånbok @@ -225,6 +184,10 @@ Denna produkten innehåller mjukvara utvecklad av OpenSSL Project för användni Wallet encrypted Plånboken är krypterad + + 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>. + Ange plånbokens nya lösenord. <br/> Använd ett lösenord på <b>tio eller fler slumpmässiga tecken,</b> eller <b>åtta eller fler ord.</b>. + Bitcoin 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. Programmet kommer nu att stänga ner för att färdigställa krypteringen. Tänk på att en krypterad plånbok inte skyddar mot stöld om din dator är infekterad med en keylogger. @@ -278,7 +241,7 @@ Denna produkten innehåller mjukvara utvecklad av OpenSSL Project för användni Show general overview of wallet - Visa översiktsvy av plånbok + Visa generell översikt av plånboken &Transactions @@ -296,10 +259,6 @@ Denna produkten innehåller mjukvara utvecklad av OpenSSL Project för användni Quit application Avsluta programmet - - Show information about Bitcoin - Visa information om Bitcoin - About &Qt Om &Qt @@ -336,6 +295,10 @@ Denna produkten innehåller mjukvara utvecklad av OpenSSL Project för användni Open &URI... Öppna &URI... + + Bitcoin Core client + Bitcoin Core klient + Importing blocks from disk... Importerar block från disk... @@ -346,7 +309,7 @@ Denna produkten innehåller mjukvara utvecklad av OpenSSL Project för användni Send coins to a Bitcoin address - Skicka mynt till en Bitcoin-adress + Skicka bitcoins till en Bitcoin-adress Modify configuration options for Bitcoin @@ -358,7 +321,7 @@ Denna produkten innehåller mjukvara utvecklad av OpenSSL Project för användni Change the passphrase used for wallet encryption - Byt lösenord för kryptering av plånbok + Byt lösenfras för kryptering av plånbok &Debug window @@ -388,6 +351,10 @@ Denna produkten innehåller mjukvara utvecklad av OpenSSL Project för användni &Receive &Ta emot + + Show information about Bitcoin Core + Visa information om Bitcoin Core + &Show / Hide &Visa / Göm @@ -402,11 +369,11 @@ Denna produkten innehåller mjukvara utvecklad av OpenSSL Project för användni Sign messages with your Bitcoin addresses to prove you own them - Signera meddelanden med din Bitcoinadress för att bevisa att du äger dem + Signera meddelanden med din Bitcoin-adress för att bevisa att du äger dem Verify messages to ensure they were signed with specified Bitcoin addresses - Verifiera meddelanden för att vara säker på att de var signerade med den specificerade Bitcoin-adressen + Verifiera meddelanden för att vara säker på att de var signerade med specificerade Bitcoin-adresser &File @@ -460,22 +427,14 @@ Denna produkten innehåller mjukvara utvecklad av OpenSSL Project för användni Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options Visa Bitcoin Core hjälpmeddelande för att få en lista med möjliga Bitcoin kommandoradsalternativ. - - Bitcoin client - Bitcoin-klient - %n active connection(s) to Bitcoin network - %n aktiv anslutning till Bitcoin-nätverket%n aktiva anslutningar till Bitcoin-nätverket + %n aktiva anslutningar till Bitcoin-nätverket.%n aktiva anslutningar till Bitcoin-nätverket. No block source available... Ingen block-källa tillgänglig... - - Processed %1 of %2 (estimated) blocks of transaction history. - Bearbetat %1 av %2 (uppskattade) block av transaktionshistorik. - Processed %1 blocks of transaction history. Bearbetat %1 block i transaktionshistoriken. @@ -560,10 +519,6 @@ Adress: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Denna plånbok är <b>krypterad</b> och för närvarande <b>låst</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Ett allvarligt fel har uppstått. Bitcoin kan inte längre köras säkert och kommer att avslutas. - ClientModel @@ -599,8 +554,8 @@ Adress: %4 Avgift: - Low Output: - Låg utmatning: + Dust: + Damm: After Fee: @@ -691,8 +646,8 @@ Adress: %4 Kopiera prioritet - Copy low output - Kopiera låg utmatning + Copy dust + Kopiera damm Copy change @@ -742,10 +697,6 @@ Adress: %4 none ingen - - Dust - Damm - yes ja @@ -771,25 +722,13 @@ Adress: %4 Transaktioner med högre prioritet har större sannolikhet att inkluderas i ett block. - This label turns red, if the priority is smaller than "medium". - Denna etikett blir röd om prioriteten är mindre än "medium". + This label turns red, if the priority is smaller than "medium". + Denna etikett blir röd om prioriteten är mindre än "medium". This label turns red, if any recipient receives an amount smaller than %1. Denna etikett blir röd om någon mottagare får en betalning som är mindre än %1. - - This means a fee of at least %1 is required. - Detta betyder att en avgift på minst %1 behövs. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - Belopp mindre än 0.546 gånger den minsta vidarebefordringsavgiften visa som damm. - - - This label turns red, if the change is smaller than %1. - Denna etikett blir röd om växeln är mindre än %1. - (no label) (Ingen etikett) @@ -842,12 +781,12 @@ Adress: %4 Redigera avsändaradress - The entered address "%1" is already in the address book. - Den angivna adressen "%1" finns redan i adressboken. + The entered address "%1" is already in the address book. + Den angivna adressen "%1" finns redan i adressboken. - The entered address "%1" is not a valid Bitcoin address. - Den angivna adressen "%1" är inte en giltig Bitcoin-adress. + The entered address "%1" is not a valid Bitcoin address. + Den angivna adressen "%1" är inte en giltig Bitcoin-adress. Could not unlock wallet. @@ -883,10 +822,6 @@ Adress: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Bitcoin Core - Kommandoradsalternativ - Bitcoin Core Bitcoin Kärna @@ -895,6 +830,18 @@ Adress: %4 version version + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + Om Bitcoin Core + + + Command-line options + Kommandoradsalternativ + Usage: Användning: @@ -908,8 +855,8 @@ Adress: %4 UI alternativ - Set language, for example "de_DE" (default: system locale) - Ändra språk, till exempel "de_DE" (förvalt: systemets språk) + Set language, for example "de_DE" (default: system locale) + Ändra språk, till exempel "de_DE" (förvalt: systemets språk) Start minimized @@ -955,12 +902,12 @@ Adress: %4 Använd en anpassad datakatalog: - Bitcoin - Bitcoin + Bitcoin Core + Bitcoin Kärna - Error: Specified data directory "%1" can not be created. - Fel: Den angivna datakatalogen "%1" kan inte skapas. + Error: Specified data directory "%1" cannot be created. + Fel: Den angivna datakatalogen "%1" kan inte skapas. Error @@ -1036,6 +983,14 @@ Adress: %4 Number of script &verification threads Antalet skript & verifikationstrådar + + Accept connections from outside + Acceptera anslutningar utifrån + + + Allow incoming connections + Acceptera inkommande anslutningar + Connect to the Bitcoin network through a SOCKS proxy. Anslut till Bitcoin-nätverket genom en SOCKS-proxy. @@ -1116,14 +1071,6 @@ Adress: %4 Port of the proxy (e.g. 9050) Proxyns port (t.ex. 9050) - - SOCKS &Version: - SOCKS &Version: - - - SOCKS version of the proxy (e.g. 5) - SOCKS version av proxyn (t.ex. 5) - &Window &Fönster @@ -1164,14 +1111,6 @@ Adress: %4 Choose the default subdivision unit to show in the interface and when sending coins. Välj en måttenhet att visa när du skickar mynt. - - Whether to show Bitcoin addresses in the transaction list or not. - Anger om Bitcoin-adresser skall visas i transaktionslistan. - - - &Display addresses in transaction list - &Visa adresser i transaktionslistan - Whether to show coin control features or not. Om myntkontrollfunktioner skall visas eller inte @@ -1227,6 +1166,10 @@ Adress: %4 Wallet Plånbok + + Watch-only: + Granska-bara: + Available: Tillgängligt: @@ -1259,6 +1202,22 @@ Adress: %4 Your current total balance Ditt nuvarande totala saldo + + Your current balance in watch-only addresses + Ditt nuvarande saldo i granska-bara adresser + + + Unconfirmed transactions to watch-only addresses + Okonfirmerade transaktioner till granska-bara adresser + + + Mined balance in watch-only addresses that has not yet matured + Den genererade balansen i granska-bara adresser som ännu inte har mognat + + + Current total balance in watch-only addresses + Nuvarande total balans i granska-bara adresser + <b>Recent transactions</b> <b>Nyligen genomförda transaktioner</b> @@ -1275,8 +1234,24 @@ Adress: %4 URI hantering - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI går inte att tolkas! Detta kan orsakas av en ogiltig Bitcoin-adress eller felaktiga URI parametrar. + Invalid payment address %1 + Felaktig betalningsadress %1 + + + Payment request rejected + Betalningsbegäran avslogs + + + Payment request network doesn't match client network. + Betalningsbegärans nätverk matchar inte klientens nätverk. + + + Payment request has expired. + Tiden för betalningsbegäran gick ut + + + Payment request is not initialized. + Betalningsbegäran är inte initierad. Requested payment amount of %1 is too small (considered dust). @@ -1290,25 +1265,21 @@ Adress: %4 Cannot start bitcoin: click-to-pay handler Kan inte starta bitcoin: klicka-och-betala handhavare - - Net manager warning - Varningar från näthanteraren - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - Din aktiva proxy stödjer inte SOCKS5, vilket är nödvändigt för att använda betalningsbegäran via proxy. - Payment request fetch URL is invalid: %1 Betalningsbegärans hämta URL är felaktig: %1 + + URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + URI går inte att tolkas! Detta kan orsakas av en ogiltig Bitcoin-adress eller felaktiga URI parametrar. + Payment request file handling Hantering av betalningsbegäransfil - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - Betalningsbegäransfilen kan inte läsas eller behandlas! Detta kan orsakas av en felaktig betalningsbegäransfil. + Payment request file cannot be read! This can be caused by an invalid payment request file. + Betalningsbegäransfilen kan inte läsas! Detta kan orsakas av en felaktig betalningsbegäransfil. Unverified payment requests to custom payment scripts are unsupported. @@ -1323,8 +1294,8 @@ Adress: %4 Kommunikationsfel med %1: %2 - Payment request can not be parsed or processed! - Betalningsbegäran kan inte läsas eller behandlas! + Payment request cannot be parsed! + Betalningsbegäran kan inte behandlas! Bad response from server %1 @@ -1339,31 +1310,66 @@ Adress: %4 Fel vid närverksbegäran + + PeerTableModel + + User Agent + Användaragent + + + Address/Hostname + Adress/Värdnamn + + + Ping Time + Pingtid + + QObject - Bitcoin - Bitcoin + Amount + Mängd - Error: Specified data directory "%1" does not exist. - Fel: Den angivna datakatalogen "%1" finns inte. + Enter a Bitcoin address (e.g. %1) + Ange en Bitcoin-adress (t.ex. %1) - Error: Cannot parse configuration file: %1. Only use key=value syntax. - Fel: Kan inte läsa konfigurationsfilen: %1. Använd bara nyckel=värde formatet. + %1 d + %1 d - Error: Invalid combination of -regtest and -testnet. - Fel: Felaktig kombination av -regtest och -testnet. + %1 h + %1 h - Bitcoin Core didn't yet exit safely... - Bitcoin Core avslutades inte ännu säkert... + %1 m + %1 m - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Ange en Bitcoin-adress (t.ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + %1 s + %1 s + + + NETWORK + NÄTVERK + + + UNKNOWN + OKÄND + + + None + Ingen + + + N/A + ej tillgänglig + + + %1 ms + %1 ms @@ -1415,6 +1421,10 @@ Adress: %4 Using OpenSSL version Använder OpenSSL version + + Using BerkeleyDB version + Använder BerkeleyDB versionen + Startup time Uppstartstid @@ -1440,8 +1450,76 @@ Adress: %4 Aktuellt antal block - Estimated total blocks - Beräknade totala block + Received + Mottagen + + + Sent + Skickad + + + &Peers + &Klienter + + + Select a peer to view detailed information. + Välj en klient för att se detaljerad information. + + + Direction + Riktning + + + Version + Version + + + User Agent + Användaragent + + + Services + Tjänster + + + Sync Node + Syncnod + + + Starting Height + Starthöjd + + + Sync Height + Synchöjd + + + Ban Score + Banpoäng + + + Connection Time + Anslutningstid + + + Last Send + Senast sänt + + + Last Receive + Senast mottagen + + + Bytes Sent + Bytes sänt + + + Bytes Received + Bytes mottaget + + + Ping Time + Pingtid Last block time @@ -1465,7 +1543,7 @@ Adress: %4 Totals - Totalt + Totalt: In: @@ -1520,24 +1598,40 @@ Adress: %4 %1 GB - %1 m - %1 m + via %1 + via %1 - %1 h - %1 h + never + aldrig - %1 h %2 m - %1 h %2 m + Inbound + Inkommande + + + Outbound + Utgående + + + Yes + Ja + + + No + Nej + + + Unknown + Okänd + + + Fetching... + Hämtar... ReceiveCoinsDialog - - &Amount: - %Belopp: - &Label: &Etikett: @@ -1743,10 +1837,6 @@ Adress: %4 Fee: Avgift: - - Low Output: - Låg utmatning: - After Fee: Efter avgift: @@ -1775,6 +1865,10 @@ Adress: %4 Clear all fields of the form. Rensa alla formulärfälten + + Dust: + Damm: + Clear &All Rensa &alla @@ -1823,10 +1917,6 @@ Adress: %4 Copy priority Kopiera prioritet - - Copy low output - Kopiera låg utmatning - Copy change Kopiera växel @@ -1879,6 +1969,10 @@ Adress: %4 Warning: Unknown change address Varning: Okänd växeladress + + Copy dust + Kopiera damm + Are you sure you want to send? Är du säker på att du vill skicka? @@ -1887,14 +1981,6 @@ Adress: %4 added as transaction fee adderad som transaktionsavgift - - Payment request expired - Tiden för betalningsbegäran gick ut - - - Invalid payment address %1 - Felaktig betalningsadress %1 - SendCoinsEntry @@ -1906,10 +1992,6 @@ Adress: %4 Pay &To: Betala &Till: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adressen som betalningen skall skickas till (t.ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Ange ett namn för den här adressen och lägg till den i din adressbok @@ -1926,6 +2008,10 @@ Adress: %4 This is a normal payment. Detta är en normal betalning. + + The Bitcoin address to send the payment to + Bitcoinadress att sända betalning till + Alt+A Alt+A @@ -1997,8 +2083,8 @@ Adress: %4 Du kan signera meddelanden med dina adresser för att bevisa att du äger dem. Var försiktig med vad du signerar eftersom phising-attacker kan försöka få dig att skriva över din identitet till någon annan. Signera bara väldetaljerade påståenden du kan gå i god för. - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adressen att signera meddelandet med (t.ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address to sign the message with + Bitcoinadress att signera meddelandet med Choose previously used address @@ -2053,8 +2139,8 @@ Adress: %4 Skriv in din adress, meddelande (se till att du kopierar radbrytningar, mellanslag, tabbar, osv. exakt) och signatur nedan för att verifiera meddelandet. Var noga med att inte läsa in mer i signaturen än vad som finns i det signerade meddelandet, för att undvika att luras av en man-in-the-middle attack. - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Adressen som meddelandet var signerat med (t.ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address the message was signed with + Bitcoinadressen som meddelandet signerades med Verify the message to ensure it was signed with the specified Bitcoin address @@ -2069,12 +2155,8 @@ Adress: %4 Rensa alla fält - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Ange en Bitcoin-adress (t.ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - Klicka "Signera Meddelande" för att få en signatur + Click "Sign Message" to generate signature + Klicka "Signera Meddelande" för att få en signatur The entered address is invalid. @@ -2201,6 +2283,10 @@ Adress: %4 own address egen adress + + watch-only + granska-bara + label etikett @@ -2211,7 +2297,7 @@ Adress: %4 matures in %n more block(s) - mognar om %n blockmognar om %n fler block + mognar om %n fler blockmognar om %n fler block not accepted @@ -2221,6 +2307,14 @@ Adress: %4 Debit Belasta + + Total debit + Total skuld + + + Total credit + Total kredit + Transaction fee Transaktionsavgift @@ -2246,8 +2340,8 @@ Adress: %4 Handlare - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - Genererade mynt måste vänta %1 block innan de kan användas. När du skapade detta block sändes det till nätverket för att läggas till i blockkedjan. Om blocket inte kommer in i kedjan kommer dess status att ändras till "accepteras inte" och kommer ej att gå att spendera. Detta kan ibland hända om en annan nod genererar ett block nästan samtidigt som dig. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Genererade mynt måste vänta %1 block innan de kan användas. När du skapade detta block sändes det till nätverket för att läggas till i blockkedjan. Om blocket inte kommer in i kedjan kommer dess status att ändras till "accepteras inte" och kommer ej att gå att spendera. Detta kan ibland hända om en annan nod genererar ett block nästan samtidigt som dig. Debug information @@ -2311,10 +2405,6 @@ Adress: %4 Address Adress - - Amount - Mängd - Immature (%1 confirmations, will be available after %2) Omogen (%1 konfirmeringar, blir tillgänglig efter %2) @@ -2504,7 +2594,7 @@ Adress: %4 Comma separated file (*.csv) - Kommaseparerad fil (*. csv) + Kommaseparerad fil (*.csv) Confirmed @@ -2526,10 +2616,6 @@ Adress: %4 Address Adress - - Amount - Mängd - ID ID @@ -2543,6 +2629,13 @@ Adress: %4 till + + UnitDisplayStatusBarControl + + Unit to show amounts in. Click to select another unit. + &Enhet att visa belopp i. Klicka för att välja annan enhet. + + WalletFrame @@ -2594,18 +2687,6 @@ Adress: %4 bitcoin-core - - Usage: - Användning: - - - List commands - Lista kommandon - - - Get help for a command - Få hjälp med ett kommando - Options: Inställningar: @@ -2646,10 +2727,6 @@ Adress: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Antal sekunder att hindra klienter som missköter sig från att ansluta (förvalt: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - Ett fel uppstod vid upprättandet av RPC port %u för att lyssna på IPv4: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) Lyssna på JSON-RPC-anslutningar på <port> (förvalt: 8332 eller testnet: 18332) @@ -2658,10 +2735,6 @@ Adress: %4 Accept command line and JSON-RPC commands Tillåt kommandon från kommandotolken och JSON-RPC-kommandon - - Bitcoin Core RPC client version - Bitcoin Core RPC-klient version - Run in the background as a daemon and accept commands Kör i bakgrunden som tjänst och acceptera kommandon @@ -2684,7 +2757,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, du behöver sätta ett rpclösensord i konfigurationsfilen: %s @@ -2695,17 +2768,13 @@ rpcpassword=%s Användarnamnet och lösenordet FÅR INTE bara detsamma. Om filen inte existerar, skapa den med enbart ägarläsbara filrättigheter. Det är också rekommenderat att sätta alertnotify så du meddelas om problem; -till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Accepterade krypteringsalgoritmer (förvalt: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - Ett fel uppstod vid upprättandet av RPC port %u för att lyssna på IPv6, faller tillbaka till IPV4: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Bind till given adress och lyssna alltid på den. Använd [värd]:port notation för IPv6 @@ -2715,17 +2784,13 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Antalsbegränsa kontinuerligt fria transaktioner till <n>*1000 bytes per minut (förvalt:15) - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Ange regressiontestläge, som använder en speciell kedja i vilka block kan lösas omedelbart. Detta är avsett för regressiontestnings verktyg och applikationsutveckling. + Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup + Ta bort alla plånbokstransaktioner och återskapa bara dom som är en del av blockkedjan genom att ange -rescan vid uppstart Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Ange regressiontestläge, som använder en speciell kedja i vilka block kan lösas omedelbart. - - Error: Listening for incoming connections failed (listen returned error %d) - Fel: Avlyssning av inkommande anslutningar misslyckades (Avlyssningen returnerade felkod %d) - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Fel: Transaktionen avslogs! Detta kan hända om några av mynten i plånboken redan spenderats, t.ex om du använt en kopia av wallet.dat och mynt spenderades i kopian men inte markerats som spenderas här. @@ -2738,10 +2803,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Exekvera kommando när en plånbokstransaktion ändras (%s i cmd är ersatt av TxID) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - Avgifter mindre än detta betraktas som nollavgift (för transaktionsskapande) (förvalt: - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) Töm databasens minnespool till disk varje <n> megabytes (förvalt: 100) @@ -2778,10 +2839,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Varning: -paytxfee är satt väldigt hög! Detta är avgiften du kommer betala för varje transaktion. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Varning: Vänligen kolla så att din dators datum och tid är korrekt! Om din klocka går fel kommer Bitcoin inte fungera korrekt. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Varning: Nätverket verkar inte vara helt överens! Några miners verkar ha problem. @@ -2814,30 +2871,14 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Attempt to recover private keys from a corrupt wallet.dat Försök att rädda de privata nycklarna från en korrupt wallet.dat - - Bitcoin Core Daemon - Bitcoin Core tjänsten - Block creation options: Block skapande inställningar: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - Töm listan över plånbokstransaktioner (diagnostikverktyg; medför -rescan) - Connect only to the specified node(s) Koppla enbart upp till den/de specificerade noden/noder - - Connect through SOCKS proxy - Anslut genom SOCKS-proxy - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - Anslut till JSON-RPC på <port> (förval: 8332 eller testnet: 18332) - Connection options: Anslutningsoptioner: @@ -2938,18 +2979,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Failed to write undo data Misslyckades att skriva ångradata - - Fee per kB to add to transactions you send - Avgift per kB att lägga till på transaktioner du skickar - - - Fees smaller than this are considered zero fee (for relaying) (default: - Avgifter mindre än detta betraktas som nollavgift (för vidarebefodran) (förvalt: - - - Find peers using DNS lookup (default: 1 unless -connect) - Sök efter klienter med DNS sökningen (förvalt: 1 om inte -connect) - Force safe mode (default: 0) Tvångskör i säkert läge (förvalt: 0) @@ -2975,8 +3004,8 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Felaktig eller inget genesisblock hittades. Fel datadir för nätverket? - Invalid -onion address: '%s' - Ogiltig -onion adress:'%s' + Invalid -onion address: '%s' + Ogiltig -onion adress:'%s' Not enough file descriptors available. @@ -2986,18 +3015,10 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Prepend debug output with timestamp (default: 1) Skriv ut tidsstämpel i avlusningsinformationen (förvalt: 1) - - RPC client options: - RPC klientoptioner: - Rebuild block chain index from current blk000??.dat files Återskapa blockkedjans index från nuvarande blk000??.dat filer - - Select SOCKS version for -proxy (4 or 5, default: 5) - Välj SOCKS-version att använda för -proxy (4 eller 5, förvalt: 5) - Set database cache size in megabytes (%d to %d, default: %d) Sätt databasens cachestorlek i megabyte (%d till %d, förvalt: %d) @@ -3019,12 +3040,12 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Spendera okonfirmerad växel när transaktioner sänds (förvalt: 1) - This is intended for regression testing tools and app development. - Detta är avsett för regressionstestningsverktyg och applikationsutveckling. + Stop running after importing blocks from disk (default: 0) + Sluta köra efter importen av block från disk är klar (förvalt: 0) - Usage (deprecated, use bitcoin-cli): - Användning (föråldrat, använd bitcoin-cli): + This is intended for regression testing tools and app development. + Detta är avsett för regressionstestningsverktyg och applikationsutveckling. Verifying blocks... @@ -3034,10 +3055,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Verifying wallet... Verifierar plånboken... - - Wait for RPC server to start - Vänta på att RPC.servern startar - Wallet %s resides outside data directory %s Plånbok %s ligger utanför datakatalogen %s @@ -3046,10 +3063,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Wallet options: Plånboksinställningar: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - Varning: Föråldrat argument -debugnet ignorerad, använd -debug=net - You need to rebuild the database using -reindex to change -txindex Du måste återskapa databasen med -reindex för att ändra -txindex @@ -3058,33 +3071,157 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Imports blocks from external blk000??.dat file Importerar block från extern blk000??.dat fil + + (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + (förvalt: 1, 1 = spara tx metadata t.ex. kontoägare och betalningsbegäransinformation, 2 = släng tx metadata) + + + Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times + Tillåt JSON-RPC anslutningar från specifik kalla. Tillåtet för <ip> är enkel IP (t.ex 1.2.3.4), en nätverk/nätmask (t.ex. 1.2.3.4/255.255.255.0) eller ett nätverk/CIDR (t.ex. 1.2.3.4/24). Denna option kan specificeras flera gånger + + + An error occurred while setting up the RPC address %s port %u for listening: %s + Ett fel uppstod vid upprättandet av RPC adress %s port %u för att lyssna: %s + + + Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6 + Bind till given adress och vitlista klienter som ansluter till den. Använd [värd]:port notation för IPv6 + + + Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces) + Bind till angiven adress för att lyssna på JSON-RPC anslutningar. Använd [värd]:port notation for IPv6. Denna option kan specificeras flera gånger (förvalt: bind till alla gränssnitt) + Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. Kan inte låsa data-mappen %s. Bitcoin Core körs förmodligen redan. + + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) + Skapa nya filer med systemets förvalda rättigheter, istället för umask 077 (bara effektivt med avaktiverad plånboks funktionalitet) + + + Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + Distribuerad under MIT/X11 mjukvarulicens, se den bifogade filen COPYING eller <http://www.opensource.org/licenses/mit-license.php>. + + + Error: Listening for incoming connections failed (listen returned error %s) + Fel: Avlyssning av inkommande anslutningar misslyckades (Avlyssningen returnerade felkod %s) + + + Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + Fel: Argumentet -socks stöds inte. Att sätta SOCKS version är inte möjligt längre. Endast SOCKS5 proxy stöds. + + + Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) + Kör kommando när en nätverks tx återspenderar plånbokens tx input (%s=återspendera TxID, %t=plånbok TxID) + Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Exekvera kommando när ett relevant meddelande är mottagen eller när vi ser en väldigt lång förgrening (%s i cmd är utbytt med ett meddelande) + + Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) + Avgifter (i BTC/Kb) mindre än detta betraktas som nollavgift för vidarebefodran (förvalt: %s) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) + Avgifter (i BTC/Kb) mindre än detta betraktas som nollavgift för transaktionsskapande (förvalt: %s) + + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) + Om paytxfee inte är satt, inkludera tillräcklig avgift så att transaktionen konfirmeras inom n blocks (förvalt: 1) + Output debugging information (default: 0, supplying <category> is optional) Skriv ut avlusningsinformation (förvalt: 0, att ange <category> är frivilligt) + + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) + Sök efter klientadresser med DNS sökningen, om det finns otillräckligt med adresser (förvalt: 1 om inte -connect) + Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Sätt den maximala storleken av hög-prioriterade/låg-avgifts transaktioner i byte (förvalt: %d) + + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. + Denna produkten innehåller mjukvara utvecklad av OpenSSL Project för användning i OpenSSL Toolkit <https://www.openssl.org/> och kryptografisk mjukvara utvecklad av Eric Young samt UPnP-mjukvara skriven av Thomas Bernard. + + + Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + Varning: Vänligen kolla så att din dators datum och tid är korrekt! Om din klocka går fel kommer Bitcoin Core inte att fungera korrekt. + + + Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. + Vitlista klienter som ansluter från angivna nätmasker eller ip adresser. Kan specificeras flera gånger. + + + Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway + Vitlistade klienter kan inte bli DoS bannade och deras transaktioner reläas alltid, även om dom redan är i mempoolen, användbart för t.ex en gateway + + + Always query for peer addresses via DNS lookup (default: 0) + Sök alltid efter klientadresser med DNS sökningen (förvalt: 0) + + + Cannot resolve -whitebind address: '%s' + Kan inte matcha -whitebind adress: '%s' + + + Connect through SOCKS5 proxy + Anslut genom SOCKS5 proxy + + + Copyright (C) 2009-%i The Bitcoin Core Developers + Copyright (C) 2009-%i Bitcoin Core Utvecklarna + + + Could not parse -rpcbind value %s as network address + Kunde inte tolka -rpcbind värdet %s som en nätverksadress + + + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core + Fel vid inläsningen av wallet.dat: Kontofilen kräver en senare version av Bitcoin Core + + + Error: Unsupported argument -tor found, use -onion. + Fel: Argumentet -tor stöds inte, använd -onion. + + + Fee (in BTC/kB) to add to transactions you send (default: %s) + Avgift (i BTC/Kb) att lägga till på transaktioner du skickar (förvalt: %s) + + + Include IP addresses in debug output (default: 0) + Inkludera IP-adresser i debugutskrift (förvalt: 0) + Information Information - Invalid amount for -minrelaytxfee=<amount>: '%s' - Ogiltigt belopp för -minrelaytxfee=<belopp>: '%s' + Initialization sanity check failed. Bitcoin Core is shutting down. + Initieringschecken fallerade. Bitcoin Core stängs av... - Invalid amount for -mintxfee=<amount>: '%s' - Ogiltigt belopp för -mintxfee=<belopp>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + Ogiltigt belopp för -minrelaytxfee=<belopp>: '%s' + + + Invalid amount for -mintxfee=<amount>: '%s' + Ogiltigt belopp för -mintxfee=<belopp>: '%s' + + + Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) + Ogiltigt belopp för -paytxfee=<belopp>:'%s' (måste vara minst %s) + + + Invalid netmask specified in -whitelist: '%s' + Ogiltig nätmask angiven i -whitelist: '%s' + + + Keep at most <n> unconnectable blocks in memory (default: %u) + Håll som mest <n> oanslutningsbara block i minnet (förvalt: %u) Limit size of signature cache to <n> entries (default: 50000) @@ -3106,6 +3243,14 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) Maximal buffert för sändning per anslutning, <n>*1000 byte (förvalt: 5000) + + Need to specify a port with -whitebind: '%s' + Port måste anges med -whitelist: '%s' + + + Node relay options: + Nodreläoptioner: + Only accept block chain matching built-in checkpoints (default: 1) Acceptera bara blockkedjans matchande inbyggda kontrollpunkter (förvalt: 1) @@ -3138,18 +3283,18 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Randomly fuzz 1 of every <n> network messages Slupmässigt brus 1 gång varje <n> nätverksmeddelande + + Relay and mine data carrier transactions (default: 1) + Reläa och bearbeta databärartransaktioner (förvalt: 1) + + + Relay non-P2SH multisig (default: 1) + Reläa icke P2SH multisig (förvalt: 1) + Run a thread to flush wallet periodically (default: 1) Kör en tråd för att tömma plånboken periodiskt (förvalt: 1) - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL-inställningar: (se Bitcoin-wikin för SSL-setup instruktioner) - - - Send command to Bitcoin Core - Sänd kommando till Bitcoin Core - Send trace/debug info to console instead of debug.log file Skicka trace-/debuginformation till terminalen istället för till debug.log @@ -3166,10 +3311,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Show all debugging options (usage: --help -help-debug) Visa alla avlusningsoptioner (använd: --help -help-debug) - - Show benchmark information (default: 0) - Visa riktmärknings information (förvalt: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Krymp debug.log filen vid klient start (förvalt: 1 vid ingen -debug) @@ -3182,14 +3323,14 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Specify connection timeout in milliseconds (default: 5000) Ange timeout för uppkoppling i millisekunder (förvalt: 5000) - - Start Bitcoin Core Daemon - Starta Bitcoin Core tjänsten - System error: Systemfel: + + This is experimental software. + Detta är experimentmjukvara. + Transaction amount too small Transaktions belopp för liten @@ -3202,6 +3343,10 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Transaction too large Transaktionen är för stor + + Unable to bind to %s on this computer (bind returned error %s) + Det går inte att binda till %s på den här datorn (bind returnerade felmeddelande %s) + Use UPnP to map the listening port (default: 0) Använd UPnP för att mappa den lyssnande porten (förvalt: 0) @@ -3214,6 +3359,10 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Username for JSON-RPC connections Användarnamn för JSON-RPC-anslutningar + + Wallet needed to be rewritten: restart Bitcoin Core to complete + Kontot behöver sparas om: Starta om Bitcoin Core för att fullfölja + Warning Varning @@ -3222,6 +3371,14 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Warning: This version is obsolete, upgrade required! Varning: denna version är föråldrad, uppgradering krävs! + + Warning: Unsupported argument -benchmark ignored, use -debug=bench. + Varning: Argument -benchmark stöds inte och ignoreras, använd -debug=bench. + + + Warning: Unsupported argument -debugnet ignored, use -debug=net. + Varning: Argument -debugnet stöds inte och ignorerad, använd -debug=net. + Zapping all transactions from wallet... Töm plånboken på alla transaktioner... @@ -3230,10 +3387,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo on startup under uppstarten - - version - version - wallet.dat corrupt, salvage failed wallet.dat korrupt, räddning misslyckades @@ -3242,14 +3395,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Password for JSON-RPC connections Lösenord för JSON-RPC-anslutningar - - Allow JSON-RPC connections from specified IP address - Tillåt JSON-RPC-anslutningar från specifika IP-adresser - - - Send commands to node running on <ip> (default: 127.0.0.1) - Skicka kommandon till klient på <ip> (förvalt: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) Exekvera kommando när det bästa blocket ändras (%s i cmd är utbytt av blockhash) @@ -3282,10 +3427,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo This help message Det här hjälp medelandet - - Unable to bind to %s on this computer (bind returned error %d, %s) - Det går inte att binda till %s på den här datorn (bind returnerade felmeddelande %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Tillåt DNS-sökningar för -addnode, -seednode och -connect @@ -3298,41 +3439,29 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Error loading wallet.dat: Wallet corrupted Fel vid inläsningen av wallet.dat: Plånboken är skadad - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Fel vid inläsningen av wallet.dat: Plånboken kräver en senare version av Bitcoin - - - Wallet needed to be rewritten: restart Bitcoin to complete - Plånboken behöver skrivas om: Starta om Bitcoin för att färdigställa - Error loading wallet.dat Fel vid inläsning av plånboksfilen wallet.dat - Invalid -proxy address: '%s' - Ogiltig -proxy adress: '%s' + Invalid -proxy address: '%s' + Ogiltig -proxy adress: '%s' - Unknown network specified in -onlynet: '%s' - Okänt nätverk som anges i -onlynet: '%s' + Unknown network specified in -onlynet: '%s' + Okänt nätverk som anges i -onlynet: '%s' - Unknown -socks proxy version requested: %i - Okänd -socks proxy version begärd: %i + Cannot resolve -bind address: '%s' + Kan inte matcha -bind adress: '%s' - Cannot resolve -bind address: '%s' - Kan inte matcha -bind adress: '%s' + Cannot resolve -externalip address: '%s' + Kan inte matcha -externalip adress: '%s' - Cannot resolve -externalip address: '%s' - Kan inte matcha -externalip adress: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - Ogiltigt belopp för -paytxfee=<belopp>:'%s' + Invalid amount for -paytxfee=<amount>: '%s' + Ogiltigt belopp för -paytxfee=<belopp>:'%s' Invalid amount @@ -3378,13 +3507,5 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo Error Fel - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Du behöver välja ett rpclösensord i konfigurationsfilen: -%s -Om filen inte existerar, skapa den med filrättigheten endast läsbar för ägaren. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_th_TH.ts b/src/qt/locale/bitcoin_th_TH.ts index 54e15a75e0..cb52be61b2 100644 --- a/src/qt/locale/bitcoin_th_TH.ts +++ b/src/qt/locale/bitcoin_th_TH.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -41,95 +9,19 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address สร้างที่อยู่ใหม่ - - &New - - Copy the currently selected address to the system clipboard คัดลอกที่อยู่ที่ถูกเลือกไปยัง คลิปบอร์ดของระบบ - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - &Delete &ลบ - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - Comma separated file (*.csv) คั่นไฟล์ด้วยเครื่องหมายจุลภาค (*.csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -147,10 +39,6 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase ใส่รหัสผ่าน @@ -163,10 +51,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase กรุณากรอกรหัสผ่านใหม่อีกครั้งหนึ่ง - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - ใส่รหัสผ่านใหม่ให้กับกระเป๋าเงิน. <br/> กรุณาใช้รหัสผ่านของ <b> 10 หรือแบบสุ่มมากกว่าตัวอักษร </ b> หรือ <b> แปดหรือมากกว่าคำ </ b> - Encrypt wallet กระเป๋าสตางค์ที่เข้ารหัส @@ -199,30 +83,10 @@ This product includes software developed by the OpenSSL Project for use in the O Confirm wallet encryption ยืนยันการเข้ารหัสกระเป๋าสตางค์ - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - Wallet encrypted กระเป๋าสตางค์ถูกเข้ารหัสเรียบร้อยแล้ว - - Bitcoin 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. - - Wallet encryption failed การเข้ารหัสกระเป๋าสตางค์ผิดพลาด @@ -247,17 +111,9 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet decryption failed ถอดรหัสกระเป๋าเงินล้มเหลว - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - Synchronizing with network... กำลังทำข้อมูลให้ตรงกันกับเครือข่าย ... @@ -266,10 +122,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Overview &ภาพรวม - - Node - - Show general overview of wallet แสดงภาพรวมทั่วไปของกระเป๋าเงิน @@ -282,126 +134,18 @@ This product includes software developed by the OpenSSL Project for use in the O Browse transaction history เรียกดูประวัติการทำธุรกรรม - - E&xit - - Quit application ออกจากโปรแกรม - - Show information about Bitcoin - แสดงข้อมูลเกี่ยวกับ Bitcoin - - - About &Qt - - - - Show information about Qt - - &Options... &ตัวเลือก... - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - Change the passphrase used for wallet encryption เปลี่ยนรหัสผ่านที่ใช้สำหรับการเข้ารหัสกระเป๋าเงิน - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - &File &ไฟล์ @@ -422,102 +166,10 @@ This product includes software developed by the OpenSSL Project for use in the O [testnet] [testnet] - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - %n active connection(s) to Bitcoin network %n ที่ใช้งานการเชื่อมต่อกับเครือข่าย Bitcoin - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - - - Error - - - - Warning - - - - Information - - Up to date ทันสมัย @@ -534,14 +186,6 @@ This product includes software developed by the OpenSSL Project for use in the O Incoming transaction การทำรายการขาเข้า - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> ระเป๋าเงินถูก <b>เข้ารหัส</b> และในขณะนี้ <b>ปลดล็อคแล้ว</b> @@ -550,249 +194,21 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> กระเป๋าเงินถูก <b>เข้ารหัส</b> และในปัจจุบัน <b>ล็อค </b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - - - Amount - - Address ที่อยู่ - - Date - - - - Confirmations - - - - Confirmed - - - - Priority - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (ไม่มีชื่อ) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -803,14 +219,6 @@ Address: %4 &Label &ชื่อ - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &ที่อยู่ @@ -832,12 +240,8 @@ Address: %4 แก้ไขที่อยู่ผู้ส่ง - The entered address "%1" is already in the address book. - ป้อนที่อยู่ "%1" ที่มีอยู่แล้วในสมุดที่อยู่ - - - The entered address "%1" is not a valid Bitcoin address. - + The entered address "%1" is already in the address book. + ป้อนที่อยู่ "%1" ที่มีอยู่แล้วในสมุดที่อยู่ Could not unlock wallet. @@ -850,1281 +254,96 @@ Address: %4 FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - - - version - - - - Usage: - - - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - - - Error - - - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog Options ตัวเลือก - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage Form รูป - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - <b>Recent transactions</b> <b>รายการทำธุรกรรมล่าสุด</b> - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - - Bitcoin - - - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - - - &Label: - - - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - - - Copy label - - - - Copy message - - - - Copy amount - - - + ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address ที่อยู่ - - Amount - - Label ชื่อ - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel - - Date - - Label ชื่อ - - Message - - - - Amount - - (no label) (ไม่มีชื่อ) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins ส่งเหรียญ - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - - - Send to multiple recipients at once - - - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - - - Balance: - - - - Confirm the send action - - - - S&end - - - - Confirm send coins - - - - %1 to %2 - - - - Copy quantity - - - - Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - - - The amount to pay must be larger than 0. - - - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (ไม่มีชื่อ) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry - - A&mount: - - - - Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Enter a label for this address to add it to your address book - - - - &Label: - - - - Choose previously used address - - - - This is a normal payment. - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - [testnet] [testnet] @@ -2132,382 +351,30 @@ Address: %4 TrafficGraphWidget - - KB/s - - - + TransactionDesc - - Open until %1 - - - - conflicted - - - - %1/offline - - - - %1/unconfirmed - - - - %1 confirmations - - - - Status - - - - , broadcast through %n node(s) - - - - Date - - - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - - - Amount - - - - true - - - - false - - - - , has not been successfully broadcast yet - - - - Open for %n more block(s) - - - - unknown - - - + TransactionDescDialog - - Transaction details - - - - This pane shows a detailed description of the transaction - - - + TransactionTableModel - - Date - - - - Type - - Address ที่อยู่ - - Amount - - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - - - Open until %1 - - - - Confirmed (%1 confirmations) - - - - This block was not received by any other nodes and will probably not be accepted! - - - - Generated but not accepted - - - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - - - Received with - - - - Received from - - - - Sent to - - - - Payment to yourself - - - - Mined - - - - (n/a) - - - - Transaction status. Hover over this field to show number of confirmations. - - - - Date and time that the transaction was received. - - - - Type of transaction. - - - - Destination address of transaction. - - - - Amount removed from or added to balance. - - - + TransactionView - - All - - Today วันนี้ - - This week - - - - This month - - - - Last month - - - - This year - - - - Range... - - - - Received with - - - - Sent to - - - - To yourself - - - - Mined - - - - Other - - - - Enter address or label to search - - - - Min amount - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) คั่นไฟล์ด้วยเครื่องหมายจุลภาค (*.csv) - - Confirmed - - - - Date - - - - Type - - Label ชื่อ @@ -2516,30 +383,13 @@ Address: %4 Address ที่อยู่ - - Amount - - - - ID - - - - Range: - - - - to - - - + + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2549,820 +399,8 @@ Address: %4 WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - - - Options: - - - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - - - Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - - - Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - - - Done loading - - - - To use the %s option - - - - Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - - + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_tr.ts b/src/qt/locale/bitcoin_tr.ts index 15ec92f982..b2a14c92fc 100644 --- a/src/qt/locale/bitcoin_tr.ts +++ b/src/qt/locale/bitcoin_tr.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - Bitcoin Çekirdeği hakkında - - - <b>Bitcoin Core</b> version - <b>Bitcoin Çekirdek</b> sürümü - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - Bu yazılım deneme safhasındadır. - - MIT/X11 yazılım lisansı kapsamında yayınlanmıştır, COPYING dosyasına ya da http://www.opensource.org/licenses/mit-license.php sayfasına bakınız. - - Bu ürün OpenSSL projesi tarafından OpenSSL araç takımı (http://www.openssl.org/) için geliştirilen yazılımlar, Eric Young (eay@cryptsoft.com) tarafından hazırlanmış şifreleme yazılımları ve Thomas Bernard tarafından programlanmış UPnP yazılımı içerir. - - - Copyright - Telif hakkı - - - The Bitcoin Core developers - Bitcoin Çekirdeği geliştiricileri - - - (%1-bit) - (%1-bit) - - + AddressBookPage @@ -131,8 +94,8 @@ This product includes software developed by the OpenSSL Project for use in the O Dışa aktarım başarısız oldu - There was an error trying to save the address list to %1. - Adres listesinin %1 konumuna kaydedilmesi sırasında bir hata meydana geldi. + There was an error trying to save the address list to %1. Please try again. + Adres listesinin %1 konumuna kaydedilmesi sırasında bir hata meydana geldi. Lütfen tekrar deneyin. @@ -168,10 +131,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Yeni parolayı tekrarlayınız - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Cüzdanınız için yeni parolayı giriniz.<br/>Lütfen <b>10 ya da daha fazla rastgele karakter</b> veya <b>sekiz ya da daha fazla kelime</b> içeren bir parola seçiniz. - Encrypt wallet Cüzdanı şifrele @@ -224,6 +183,10 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet encrypted Cüzdan şifrelendi + + 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>. + Cüzdan için yeni parolayı giriniz.<br/>Lütfen <b>on ya da daha fazla rastgele karakter</b> veya <b>sekiz ya da daha fazla kelime</b> içeren bir parola kullanınız. + Bitcoin 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. Şifreleme işlemini tamamlamak için Bitcoin şimdi kapanacaktır. Cüzdanınızı şifrelemenin, Bitcoinlerinizin bilgisayara bulaşan kötücül bir yazılım tarafından çalınmaya karşı tamamen koruyamayacağını unutmayınız. @@ -295,10 +258,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application Uygulamadan çık - - Show information about Bitcoin - Bitcoin hakkında bilgi göster - About &Qt &Qt hakkında @@ -335,6 +294,10 @@ This product includes software developed by the OpenSSL Project for use in the O Open &URI... &URI aç... + + Bitcoin Core client + Bitcoin Çekirdeği istemcisi + Importing blocks from disk... Bloklar diskten içe aktarılıyor... @@ -387,6 +350,10 @@ This product includes software developed by the OpenSSL Project for use in the O &Receive &Al + + Show information about Bitcoin Core + Bitcoin Çekirdeği hakkında bilgi göster + &Show / Hide &Göster / Sakla @@ -433,7 +400,7 @@ This product includes software developed by the OpenSSL Project for use in the O Request payments (generates QR codes and bitcoin: URIs) - Ödeme talep et (QR kodu ve bitcoin URI'si oluşturur) + Ödeme talep et (QR kodu ve bitcoin URI'si oluşturur) &About Bitcoin Core @@ -459,10 +426,6 @@ This product includes software developed by the OpenSSL Project for use in the O Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options Bitcoin komut satırı seçeneklerinin listesini elde etmek için Bitcoin Çekirdeği yardım mesajını göster - - Bitcoin client - Bitcoin istemcisi - %n active connection(s) to Bitcoin network Bitcoin şebekesine %n faal bağlantıBitcoin şebekesine %n faal bağlantı @@ -471,10 +434,6 @@ This product includes software developed by the OpenSSL Project for use in the O No block source available... Hiçbir blok kaynağı mevcut değil... - - Processed %1 of %2 (estimated) blocks of transaction history. - Muamele tarihçesinin toplam (tahmini) %2 blokundan %1 blok işlendi. - Processed %1 blocks of transaction history. Muamele tarihçesinde %1 blok işlendi. @@ -559,10 +518,6 @@ Adres: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> Cüzdan <b>şifrelenmiştir</b> ve şu anda <b>kilitlidir</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Ciddi bir hata oluştu. Bitcoin artık güvenli bir şekilde işlemeye devam edemez ve kapanacaktır. - ClientModel @@ -598,8 +553,8 @@ Adres: %4 Ücret: - Low Output: - Düşük çıktı: + Dust: + Toz: After Fee: @@ -690,8 +645,8 @@ Adres: %4 Önceliği kopyala - Copy low output - Düşük çıktıyı kopyala + Copy dust + Tozu kopyala Copy change @@ -742,8 +697,8 @@ Adres: %4 boş - Dust - Toz + Can vary +/- %1 satoshi(s) per input. + Giriş başına +/- %1 satoshi olarak değişebilir. yes @@ -770,24 +725,12 @@ Adres: %4 Yüksek öncelikli muamelelerin bir bloğa dahil olmaları daha olasıdır. - This label turns red, if the priority is smaller than "medium". - Eğer öncelik "ortadan" düşükse bu etiket kırmızı olur. + This label turns red, if the priority is smaller than "medium". + Eğer öncelik "ortadan" düşükse bu etiket kırmızı olur. This label turns red, if any recipient receives an amount smaller than %1. - Eğer herhangi bir alıcı %1'den düşük bir meblağ alırsa bu etiket kırmızı olur. - - - This means a fee of at least %1 is required. - Bu, en az %1 tutarında bir ücret gerektiği anlamına gelir. - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - Asgari yönlendirme ücretinin 0.546 oranının altındaki meblağlar toz olarak gösterilir. - - - This label turns red, if the change is smaller than %1. - Eğer para üstü %1'den düşükse bu etiket kırmızı olur. + Eğer herhangi bir alıcı %1'den düşük bir meblağ alırsa bu etiket kırmızı olur. (no label) @@ -841,12 +784,12 @@ Adres: %4 Gönderi adresini düzenle - The entered address "%1" is already in the address book. - Girilen "%1" adresi hâlihazırda adres defterinde mevcuttur. + The entered address "%1" is already in the address book. + Girilen "%1" adresi hâlihazırda adres defterinde mevcuttur. - The entered address "%1" is not a valid Bitcoin address. - Girilen "%1" adresi geçerli bir Bitcoin adresi değildir. + The entered address "%1" is not a valid Bitcoin address. + Girilen "%1" adresi geçerli bir Bitcoin adresi değildir. Could not unlock wallet. @@ -882,10 +825,6 @@ Adres: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - Bitcoin Çekirdeği - Komut satırı seçenekleri - Bitcoin Core Bitcoin Çekirdeği @@ -894,6 +833,18 @@ Adres: %4 version sürüm + + (%1-bit) + (%1-bit) + + + About Bitcoin Core + Bitcoin Çekirdeği hakkında + + + Command-line options + Komut satırı seçenekleri + Usage: Kullanım: @@ -907,8 +858,8 @@ Adres: %4 Kullanıcı arayüzü seçenekleri - Set language, for example "de_DE" (default: system locale) - Lisan belirt, mesela "de_De" (varsayılan: sistem dili) + Set language, for example "de_DE" (default: system locale) + Lisan belirt, mesela "de_De" (varsayılan: sistem dili) Start minimized @@ -954,12 +905,12 @@ Adres: %4 Özel bir veri klasörü kullan: - Bitcoin - Bitcoin + Bitcoin Core + Bitcoin Çekirdeği - Error: Specified data directory "%1" can not be created. - Hata: belirtilen "%1" veri klasörü oluşturulamaz. + Error: Specified data directory "%1" cannot be created. + Hata: belirtilen "%1" veri klasörü oluşturulamaz. Error @@ -982,7 +933,7 @@ Adres: %4 Open payment request from URI or file - Dosyadan veya URI'den ödeme talebi aç + Dosyadan veya URI'den ödeme talebi aç URI: @@ -1009,7 +960,7 @@ Adres: %4 Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Muamelelerin hızlı işlenmesini garantilemeye yardım eden, seçime dayalı kB başı muamele ücreti. Muamelelerin çoğunluğunun boyutu 1 kB'dir. + Muamelelerin hızlı işlenmesini garantilemeye yardım eden, seçime dayalı kB başı muamele ücreti. Muamelelerin çoğunluğunun boyutu 1 kB'dir. Pay transaction &fee @@ -1017,11 +968,11 @@ Adres: %4 Automatically start Bitcoin after logging in to the system. - Sistemde oturum açıldığında Bitcoin'i otomatik olarak başlat. + Sistemde oturum açıldığında Bitcoin'i otomatik olarak başlat. &Start Bitcoin on system login - Bitcoin'i sistem oturumuyla &başlat + Bitcoin'i sistem oturumuyla &başlat Size of &database cache @@ -1035,6 +986,14 @@ Adres: %4 Number of script &verification threads İş parçacıklarını &denetleme betiği sayısı + + Accept connections from outside + Dışarıdan gelen bağlantıları kabul et + + + Allow incoming connections + Gelen bağlantılara izin ver + Connect to the Bitcoin network through a SOCKS proxy. Bitcoin şebekesine bir SOCKS vekil sunucusu vasıtasıyla bağlan. @@ -1049,11 +1008,11 @@ Adres: %4 Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - Muameleler sekmesinde bağlam menüsü unsurları olarak görünen üçüncü taraf bağlantıları (mesela bir blok tarayıcısı). URL'deki %s, muamele hash değeri ile değiştirilecektir. Birden çok bağlantılar düşey çubuklar | ile ayrılacaktır. + Muameleler sekmesinde bağlam menüsü unsurları olarak görünen üçüncü taraf bağlantıları (mesela bir blok tarayıcısı). URL'deki %s, muamele hash değeri ile değiştirilecektir. Birden çok bağlantılar düşey çubuklar | ile ayrılacaktır. Third party transaction URLs - Üçüncü taraf muamele URL'leri + Üçüncü taraf muamele URL'leri Active command-line options that override above options: @@ -1115,14 +1074,6 @@ Adres: %4 Port of the proxy (e.g. 9050) Vekil sunucunun portu (mesela 9050) - - SOCKS &Version: - SOCKS &sürümü: - - - SOCKS version of the proxy (e.g. 5) - Vekil sunucunun SOCKS sürümü (mesela 5) - &Window &Pencere @@ -1163,14 +1114,6 @@ Adres: %4 Choose the default subdivision unit to show in the interface and when sending coins. Bitcoin gönderildiğinde arayüzde gösterilecek varsayılan alt birimi seçiniz. - - Whether to show Bitcoin addresses in the transaction list or not. - Muamele listesinde Bitcoin adreslerinin gösterilip gösterilmeyeceklerini belirler. - - - &Display addresses in transaction list - Muamele listesinde adresleri &göster - Whether to show coin control features or not. Para kontrol özelliklerinin gösterilip gösterilmeyeceğini ayarlar. @@ -1226,6 +1169,10 @@ Adres: %4 Wallet Cüzdan + + Watch-only: + Sadece-izlenen: + Available: Mevcut: @@ -1258,6 +1205,22 @@ Adres: %4 Your current total balance Güncel toplam bakiyeniz + + Your current balance in watch-only addresses + Sadece izlenen adreslerdeki güncel bakiyeniz + + + Unconfirmed transactions to watch-only addresses + Sadece izlenen adreslere gelen teyit edilmemiş muameleler + + + Mined balance in watch-only addresses that has not yet matured + Sadece izlenen adreslerin henüz olgunlaşmamış oluşturulan bakiyeleri + + + Current total balance in watch-only addresses + Sadece izlenen adreslerdeki güncel toplam bakiye + <b>Recent transactions</b> <b>Son muameleler</b> @@ -1274,8 +1237,24 @@ Adres: %4 URI yönetimi - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI okunamadı! Sebebi geçersiz bir Bitcoin adresi veya hatalı URI parametreleri olabilir. + Invalid payment address %1 + Geçersiz ödeme adresi %1 + + + Payment request rejected + Ödeme talebi reddedildi + + + Payment request network doesn't match client network. + Ödeme talebi şebekesi istemci şebekesine denk gelmiyor. + + + Payment request has expired. + Ödeme talebinin ömrü doldu. + + + Payment request is not initialized. + Ödeme talebi başlatılmamış. Requested payment amount of %1 is too small (considered dust). @@ -1289,24 +1268,20 @@ Adres: %4 Cannot start bitcoin: click-to-pay handler Bitcoin başlatılamadı: tıkla-ve-öde yöneticisi - - Net manager warning - Şebeke yöneticisi uyarısı - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - Faal vekil sunucunuz, vekil vasıtasıyla ödeme talepleri için gereken SOCKS5'i desteklememektedir. - Payment request fetch URL is invalid: %1 - Ödeme talebini alma URL'i geçersiz: %1 + Ödeme talebini alma URL'i geçersiz: %1 + + + URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + URI okunamadı! Sebebi geçersiz bir Bitcoin adresi veya hatalı URI parametreleri olabilir. Payment request file handling Ödeme talebi dosyası yönetimi - Payment request file can not be read or processed! This can be caused by an invalid payment request file. + Payment request file cannot be read! This can be caused by an invalid payment request file. Ödeme talebi okunamaz ya da işlenemez! Bunun sebebi geçersiz bir ödeme talebi dosyası olabilir. @@ -1322,8 +1297,8 @@ Adres: %4 %1 ile iletişimde hata: %2 - Payment request can not be parsed or processed! - Ödeme talebi ayrıştırılamaz ya da işlenemez! + Payment request cannot be parsed! + Ödeme talebi ayrıştırılamaz! Bad response from server %1 @@ -1338,31 +1313,66 @@ Adres: %4 Şebeke talebi hatası + + PeerTableModel + + User Agent + Kullanıcı Yazılımı + + + Address/Hostname + Adres/Makine ismi + + + Ping Time + Ping Zamanı + + QObject - Bitcoin - Bitcoin + Amount + Meblağ - Error: Specified data directory "%1" does not exist. - Hata: belirtilen "%1" veri klasörü yoktur. + Enter a Bitcoin address (e.g. %1) + Bir Bitcoin adresi giriniz (mesela %1) - Error: Cannot parse configuration file: %1. Only use key=value syntax. - Hata: %1 yapılandırma dosyası ayrıştırılamadı. Sadece anahtar=değer dizimini kullanınız. + %1 d + %1 g - Error: Invalid combination of -regtest and -testnet. - Hata: -regtest ve -testnet'in geçersiz kombinasyonu. + %1 h + %1 s - Bitcoin Core didn't yet exit safely... - Bitcoin Çekirdeği henüz güvenli bir şekilde çıkış yapmamıştır... + %1 m + %1 d - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Bitcoin adresi giriniz (mesela 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + %1 s + %1 s + + + NETWORK + ŞEBEKE + + + UNKNOWN + BİLİNMİYOR + + + None + Boş + + + N/A + Mevcut değil + + + %1 ms + %1 ms @@ -1414,6 +1424,10 @@ Adres: %4 Using OpenSSL version Kullanılan OpenSSL sürümü + + Using BerkeleyDB version + Kullanılan BerkeleyDB sürümü + Startup time Başlama zamanı @@ -1439,8 +1453,76 @@ Adres: %4 Güncel blok sayısı - Estimated total blocks - Tahmini toplam blok sayısı + Received + Alınan + + + Sent + Yollanan + + + &Peers + &Eşler + + + Select a peer to view detailed information. + Ayrıntılı bilgi görmek için bir eş seçin. + + + Direction + Yön + + + Version + Sürüm + + + User Agent + Kullanıcı Yazılımı + + + Services + Servisler + + + Sync Node + Eşleşme Düğümü + + + Starting Height + Başlama Yüksekliği + + + Sync Height + Eşleşme Yüksekliği + + + Ban Score + Yasaklama Skoru + + + Connection Time + Bağlantı Zamanı + + + Last Send + Son Gönderme + + + Last Receive + Son Alma + + + Bytes Sent + Yollanan Baytlar + + + Bytes Received + Alınan Baytlar + + + Ping Time + Ping Zamanı Last block time @@ -1519,16 +1601,36 @@ Adres: %4 %1 GB - %1 m - %1 d + via %1 + %1 vasıtasıyla - %1 h - %1 s + never + asla - %1 h %2 m - %1 s %2 d + Inbound + Gelen + + + Outbound + Giden + + + Yes + Evet + + + No + Hayır + + + Unknown + Bilinmiyor + + + Fetching... + Alınıyor... @@ -1622,7 +1724,7 @@ Adres: %4 Copy &URI - &URI'yi kopyala + &URI'yi kopyala Copy &Address @@ -1666,7 +1768,7 @@ Adres: %4 Error encoding URI into QR Code. - URI'nin QR koduna kodlanmasında hata oluştu. + URI'nin QR koduna kodlanmasında hata oluştu. @@ -1742,10 +1844,6 @@ Adres: %4 Fee: Ücret: - - Low Output: - Düşük çıktı: - After Fee: Ücretten sonra: @@ -1774,6 +1872,10 @@ Adres: %4 Clear all fields of the form. Formdaki tüm alanları temizle. + + Dust: + Toz: + Clear &All Tümünü &temizle @@ -1822,10 +1924,6 @@ Adres: %4 Copy priority Önceliği kopyala - - Copy low output - Düşük çıktıyı kopyala - Copy change Para üstünü kopyala @@ -1878,6 +1976,10 @@ Adres: %4 Warning: Unknown change address Uyarı: geçersiz para üstü adresi + + Copy dust + Tozu kopyala + Are you sure you want to send? Göndermek istediğinizden emin misiniz? @@ -1886,14 +1988,6 @@ Adres: %4 added as transaction fee muamele ücreti olarak eklendi - - Payment request expired - Ödeme talebinin ömrü doldu - - - Invalid payment address %1 - Geçersiz ödeme adresi %1 - SendCoinsEntry @@ -1905,10 +1999,6 @@ Adres: %4 Pay &To: &Şu adrese öde: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Ödemenin gönderileceği adres (mesela 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Adres defterinize eklemek için bu adrese ilişik bir etiket giriniz @@ -1925,6 +2015,10 @@ Adres: %4 This is a normal payment. Bu, normal bir ödemedir. + + The Bitcoin address to send the payment to + Ödemenin yollanacağı Bitcoin adresi + Alt+A Alt+A @@ -1955,7 +2049,7 @@ Adres: %4 A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - Bitcoin: URI'siyle ilişkili ve bilginiz için muameleyle saklanacak bir mesaj. Not: Bu mesaj Bitcoin şebekesi üzerinden gönderilmeyecektir. + Bitcoin: URI'siyle ilişkili ve bilginiz için muameleyle saklanacak bir mesaj. Not: Bu mesaj Bitcoin şebekesi üzerinden gönderilmeyecektir. This is an unverified payment request. @@ -1996,8 +2090,8 @@ Adres: %4 Bir adresin sizin olduğunu ispatlamak için adresinizle mesaj imzalayabilirsiniz. Oltalama saldırılarının kimliğinizi imzanızla elde etmeyi deneyebilecekleri için belirsiz hiçbir şey imzalamamaya dikkat ediniz. Sadece ayrıntılı açıklaması olan ve tümüne katıldığınız ifadeleri imzalayınız. - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Mesajın imzalanmasında kullanılacak adres (mesela 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address to sign the message with + Mesajın imzalanmasında kullanılacak Bitcoin adresi Choose previously used address @@ -2052,8 +2146,8 @@ Adres: %4 İmza için kullanılan adresi, mesajı (satır sonları, boşluklar, sekmeler vs. karakterleri tam olarak kopyaladığınızdan emin olunuz) ve imzayı aşağıda giriniz. Bir ortadaki adam saldırısı tarafından kandırılmaya mâni olmak için imzadan, imzalı mesajın içeriğini aşan bir anlam çıkarmamaya dikkat ediniz. - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Mesajı imzalamak için kullanılmış olan adres (mesela 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address the message was signed with + Mesajın imzalanmasında kullanılan Bitcoin adresi Verify the message to ensure it was signed with the specified Bitcoin address @@ -2068,12 +2162,8 @@ Adres: %4 Tüm mesaj kontrolü alanlarını sıfırla - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Bitcoin adresi giriniz (mesela 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature - İmzayı oluşturmak için "Mesaj İmzala" unsurunu tıklayın + Click "Sign Message" to generate signature + İmzayı oluşturmak için "Mesaj İmzala" unsurunu tıklayın The entered address is invalid. @@ -2200,6 +2290,10 @@ Adres: %4 own address kendi adresiniz + + watch-only + sadece-izlenen + label etiket @@ -2220,6 +2314,14 @@ Adres: %4 Debit Gelir + + Total debit + Toplam gider + + + Total credit + Toplam gelir + Transaction fee Muamele ücreti @@ -2245,8 +2347,8 @@ Adres: %4 Tüccar - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - Oluşturulan bitcoin'lerin harcanabilmelerinden önce %1 blok beklemeleri gerekmektedir. Bu blok, oluşturduğunuzda, blok zincirine eklenmesi için ağda yayınlandı. Zincire eklenmesi başarısız olursa, durumu "kabul edilmedi" olarak değiştirilecek ve harcanamayacaktır. Bu, bazen başka bir düğüm sizden birkaç saniye önce ya da sonra blok oluşturursa meydana gelebilir. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Oluşturulan bitcoin'lerin harcanabilmelerinden önce %1 blok beklemeleri gerekmektedir. Bu blok, oluşturduğunuzda, blok zincirine eklenmesi için ağda yayınlandı. Zincire eklenmesi başarısız olursa, durumu "kabul edilmedi" olarak değiştirilecek ve harcanamayacaktır. Bu, bazen başka bir düğüm sizden birkaç saniye önce ya da sonra blok oluşturursa meydana gelebilir. Debug information @@ -2310,10 +2412,6 @@ Adres: %4 Address Adres - - Amount - Meblağ - Immature (%1 confirmations, will be available after %2) Olgunlaşmamış (%1 teyit, %2 teyit ardından kullanılabilir olacaktır) @@ -2525,10 +2623,6 @@ Adres: %4 Address Adres - - Amount - Meblağ - ID Tanımlayıcı @@ -2542,6 +2636,13 @@ Adres: %4 ilâ + + UnitDisplayStatusBarControl + + Unit to show amounts in. Click to select another unit. + Meblağları göstermek için birim. Başka bir birim seçmek için tıklayınız. + + WalletFrame @@ -2593,18 +2694,6 @@ Adres: %4 bitcoin-core - - Usage: - Kullanım: - - - List commands - Komutları listele - - - Get help for a command - Bir komut için yardım al - Options: Seçenekler: @@ -2645,21 +2734,13 @@ Adres: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Aksaklık gösteren eşlerle yeni bağlantıları engelleme süresi, saniye olarak (varsayılan: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - IPv4 üzerinde dinlemek için %u numaralı RPC portunun kurulumu sırasında hata meydana geldi: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) JSON-RPC bağlantılarını <port> üzerinde dinle (varsayılan: 8332 veya tesnet: 18332) Accept command line and JSON-RPC commands - Konut satırı ve JSON-RPC komutlarını kabul et - - - Bitcoin Core RPC client version - Bitcoin Çekirdeği RPC istemci sürümü + Komut satırı ve JSON-RPC komutlarını kabul et Run in the background as a daemon and accept commands @@ -2683,7 +2764,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, şu yapılandırma dosyasında rpc parolası belirtmeniz gerekir: %s @@ -2694,17 +2775,13 @@ rpcpassword=%s Kullanıcı ismi ile parolanın FARKLI olmaları gerekir. Dosya mevcut değilse, sadece sahibi için okumayla sınırlı izin ile oluşturunuz. Sorunlar hakkında bildiri almak için alertnotify unsurunu ayarlamanız tavsiye edilir; -mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) Kabul edilebilir şifreler (varsayılan: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - IPv6 üzerinde dinlemek için %u numaralı RPC portu kurulurken bir hata meydana geldi, IPv4'e dönülüyor: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Belirtilen adrese bağlan ve daima ondan dinle. IPv6 için [makine]:port yazımını kullanınız @@ -2714,17 +2791,13 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Devamlı olarak ücretsiz muameleleri dakikada <n>*1000 bayt olarak sınırla (varsayılan: 15) - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Anında çözümlenebilen bloklar içeren ve özel zincir kullanan regresyon test kipine gir. Bu, uygulama geliştirme ve regresyon testi araçları için tasarlanmıştır. + Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup + Tüm cüzdan muamelelerini sil ve başlangıçta -rescan ile sadece blok zincirinin parçası olanları geri getir Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Blokların anında çözülebileceği özel bir zincir kullanan regresyon deneme kipine gir. - - Error: Listening for incoming connections failed (listen returned error %d) - Hata: İçeri gelen bağlantıların dinlenmesi başarısız oldu (dinleme %d hatası verdi) - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Hata: Muamele reddedildi! Cüzdanınızdaki madenî paraların bazıları zaten harcanmış olduğunda bu meydana gelebilir. Örneğin wallet.dat dosyasının bir kopyasını kullandıysanız ve kopyada para harcandığında ancak burada harcandığı işaretlenmediğinde. @@ -2735,11 +2808,7 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - Bir cüzdan muamelesi değiştiğinde komutu çalıştır (komuttaki %s TxID ile değiştirilecektir) - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - Bundan düşük ücretler sıfır değerinde sayılır (muamele oluşturulması için) (varsayılan: + Bir cüzdan muamelesi değiştiğinde komutu çalıştır (komuttaki %s muamele kimliği ile değiştirilecektir) Flush database activity from memory pool to disk log every <n> megabytes (default: 100) @@ -2747,7 +2816,7 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com How thorough the block verification of -checkblocks is (0-4, default: 3) - -checkblocks'un blok kontrolünün ne kadar kapsamlı olacağı (0 ilâ 4, varsayılan: 3) + -checkblocks'un blok kontrolünün ne kadar kapsamlı olacağı (0 ilâ 4, varsayılan: 3) In this mode -genproclimit controls how many blocks are generated immediately. @@ -2777,10 +2846,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Uyarı: -paytxfee çok yüksek bir değere ayarlanmış! Bu, muamele gönderirseniz ödeyeceğiniz muamele ücretidir. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Uyarı: Lütfen bilgisayarınızın tarih ve saatinin doğru olup olmadığını kontrol ediniz! Saatiniz doğru değilse Bitcoin gerektiği gibi çalışamaz. - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Uyarı: şebeke tamamen mutabık değil gibi görünüyor! Bazı madenciler sorun yaşıyor gibi görünüyor. @@ -2813,30 +2878,14 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Attempt to recover private keys from a corrupt wallet.dat Bozuk bir wallet.dat dosyasından özel anahtarları geri kazanmayı dene - - Bitcoin Core Daemon - Bitcoin Çekirdek servisi - Block creation options: Blok oluşturma seçenekleri: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - Cüzdanın muamele listesini temizle (tanı aracı; -rescan ima eder) - Connect only to the specified node(s) Sadece belirtilen düğüme veya düğümlere bağlan - - Connect through SOCKS proxy - SOCKS vekil sunucusuyla bağlan - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - <port> numarasında JSON-RPC'ye bağlan (varsayılan: 8332 veya testnet: 18332) - Connection options: Bağlantı seçenekleri: @@ -2937,18 +2986,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Failed to write undo data Geri alma verilerinin yazılamadı - - Fee per kB to add to transactions you send - Yolladığınız muameleler için eklenecek kB başı ücret - - - Fees smaller than this are considered zero fee (for relaying) (default: - Bundan düşük ücretler sıfır değerinde sayılacaktır (aktarım için) (varsayılan: - - - Find peers using DNS lookup (default: 1 unless -connect) - Eşleri DNS araması vasıtasıyla bul (varsayılan: 1, eğer -connect kullanılmadıysa) - Force safe mode (default: 0) Güvenli kipi zorla (varsayılan: 0) @@ -2974,8 +3011,8 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Yanlış ya da bulunamamış doğuş bloku. Şebeke için yanlış veri klasörü mü? - Invalid -onion address: '%s' - Geçersiz -onion adresi: '%s' + Invalid -onion address: '%s' + Geçersiz -onion adresi: '%s' Not enough file descriptors available. @@ -2985,18 +3022,10 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Prepend debug output with timestamp (default: 1) Hata ayıklama verilerinin önüne zaman damgası ekle (varsayılan: 1) - - RPC client options: - RPC istemci seçenekleri: - Rebuild block chain index from current blk000??.dat files Blok zinciri indeksini güncel blk000??.dat dosyalarından tekrar inşa et - - Select SOCKS version for -proxy (4 or 5, default: 5) - -proxy için SOCKS sürümünü seç (4 veya 5, varsayılan: 5) - Set database cache size in megabytes (%d to %d, default: %d) Veritabanı önbellek boyutunu megabayt olarak belirt (%d ilâ %d, varsayılan: %d) @@ -3018,12 +3047,12 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Gönderme muamelelerinde teyit edilmemiş para üstünü harca (varsayılan: 1) - This is intended for regression testing tools and app development. - Bu, regresyon deneme araçları ve uygulama geliştirmesi için tasarlanmıştır. + Stop running after importing blocks from disk (default: 0) + Diskten blokları içeri aktardıktan sonra çalışmayı durdur (varsayılan: 0) - Usage (deprecated, use bitcoin-cli): - Kullanım (önerilmemektedir, bitcoin-cli kullanın): + This is intended for regression testing tools and app development. + Bu, regresyon deneme araçları ve uygulama geliştirmesi için tasarlanmıştır. Verifying blocks... @@ -3033,10 +3062,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Verifying wallet... Cüzdan kontrol ediliyor... - - Wait for RPC server to start - RPC sunucusunun başlamasını bekle - Wallet %s resides outside data directory %s %s cüzdan %s veri klasörünün dışında bulunuyor @@ -3045,45 +3070,165 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Wallet options: Cüzdan seçenekleri: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - Uyarı: eskimiş seçenek -debugnet görmezden gelinir, -debug=net kullanınız - You need to rebuild the database using -reindex to change -txindex - -txindex'i değiştirmek için veritabanını -reindex kullanarak tekrar inşa etmeniz gerekmektedir + -txindex'i değiştirmek için veritabanını -reindex kullanarak tekrar inşa etmeniz gerekmektedir Imports blocks from external blk000??.dat file Harici blk000??.dat dosyasından blokları içe aktarır + + (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + (varsayılan: 1, 1 = tx meta verilerini tut mesela hesap sahibi ve ödeme talebi bilgileri, 2 = tx meta verilerini at) + + + Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times + Belirtilen kaynaktan JSON-RPC bağlantılarını kabul et. Bir <ip> için geçerli olanlar şunlardır: salt IP adresi (mesela 1.2.3.4), bir şebeke/ağ maskesi (örneğin 1.2.3.4/255.255.255.0) ya da bir şebeke/CIDR (mesela 1.2.3.4/24). Bu seçenek birden fazla kez belirtilebilir + + + An error occurred while setting up the RPC address %s port %u for listening: %s + Dinleme için RPC adresi %s port %u kurulurken bir hata meydana geldi: %s + + + Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6 + Belirtilen adrese bağlan ve ona bağlanan eşleri beyaz listeye al. IPv6 için [makine]:port imlasını kullanınız + + + Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces) + Belirtilen adrese bağlan ve JSON RPC bağlantıları için dinlemeye geç. IPv6 için [makine]:port imlasını kullanınız. Bu seçenek birden çok kez belirtilebilir (varsayılan: tüm arayüzlere bağlan) + Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. %s veri dizininde kilit elde edilemedi. Bitcoin Çekirdeği muhtemelen hâlihazırda çalışmaktadır. + + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) + Yeni dosyaları umask 077 yerine varsayılan izinlerle oluştur (sadece devre dışı cüzdan işlevselliği ile etkilidir) + + + Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + MIT/X11 yazılım lisansı kapsamında yayınlanmıştır, ekteki COPYING dosyasına ya da <http://www.opensource.org/licenses/mit-license.php> adresine bakınız. + + + Error: Listening for incoming connections failed (listen returned error %s) + Hata: İçeri gelen bağlantıların dinlenmesi başarısız oldu (dinleme %s hatasını verdi) + + + Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + Hata: Desteklenmeyen -socks argümanı bulundu. SOCKS sürümünün ayarlanması artık mümkün değildir, sadece SOCKS5 vekilleri desteklenmektedir. + + + Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) + Bir şebeke muamelesi cüzdan muamele girdisini tekrar harcadığında komut çalıştır (%s=tekrar harcama muamele kimliği, %t=cüzdan muamele kimliği) + Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) İlgili bir uyarı alındığında ya da gerçekten uzun bir çatallama gördüğümüzde komutu çalıştır (komuttaki %s mesaj ile değiştirilir) + + Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) + Kb başına BTC olarak bundan düşük ücretler aktarım için sıfır değerinde ücret olarak kabul edilir (varsayılan: %s) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) + Kb başına BTC olarak bundan düşük ücretler muamele oluşturulması için sıfır değerinde ücret olarak kabul edilir (varsayılan: %s) + + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) + Eğer paytxfee ayarlanmadıysa, kafi derecede ücret ekleyin ki muameleler vasati n blok içinde teyit edilsin (varsayılan: 1) + Output debugging information (default: 0, supplying <category> is optional) Hata ayıklama bilgisi dök (varsayılan:0, <kategori> sağlanması seçime dayalıdır) + + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) + Adres sayısı azaldıysa DNS sorgulamasıyla eş adresleri ara (varsayılan: 1 -connect kullanılmadıysa) + Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Yüksek öncelikli/düşük ücretli muamelelerin azami boyutunu bayt olarak ayarla (varsayılan: %d) + + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. + Bu ürün OpenSSL projesi tarafından OpenSSL araç takımı (http://www.openssl.org/) için geliştirilen yazılımlar, Eric Young (eay@cryptsoft.com) tarafından hazırlanmış şifreleme yazılımları ve Thomas Bernard tarafından programlanmış UPnP yazılımı içerir. + + + Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + Uyarı: Lütfen bilgisayarınızın saat ve tarihinin doğru olduğunu kontol ediniz! Saatinizde gecikme varsa Bitcoin Çekirdeği doğru şekilde çalışamaz. + + + Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. + Belirtilen ağ maskesi ya da IP adresinden bağlanan eşleri beyaz listeye al. Birden fazla kez belirtilebilir. + + + Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway + Beyaz listeye alınan eşler DoS yasaklamasına uğramazlar ve muameleleri zaten mempool'da olsalar da daima aktarılır, bu mesela bir geçit için kullanışlıdır + + + Always query for peer addresses via DNS lookup (default: 0) + Eş adreslerini daima DNS araması ile sorgula (varsayılan: 0) + + + Cannot resolve -whitebind address: '%s' + -whitebind adresi çözümlenemedi: '%s' + + + Connect through SOCKS5 proxy + SOCKS5 vekil sunucusu vasıtasıyla bağlan + + + Copyright (C) 2009-%i The Bitcoin Core Developers + Telif hakkı 2009-%i Bitcoin Çekirdeği Geliştiricileri + + + Could not parse -rpcbind value %s as network address + -rpcbind değeri %s şebeke adresi olarak ayrıştırılamadı + + + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core + wallet.dat dosyasının yüklenmesinde hata: Cüzdan Bitcoin Çekirdeğinin daha yeni bir sürümünü gerektirmektedir + + + Error: Unsupported argument -tor found, use -onion. + Hata: Deskteklenmeyen -tor argümanı bulundu, -onion kullanınız. + + + Fee (in BTC/kB) to add to transactions you send (default: %s) + Yolladığınız muamelelere kB başına BTC olarak eklenecek ücret (varsayılan: %s) + + + Include IP addresses in debug output (default: 0) + Hata ayıklama çıktısına IP adreslerini dahil et (varsayılan: 0) + Information Bilgi - Invalid amount for -minrelaytxfee=<amount>: '%s' - -minrelaytxfee=<amount> için geçersiz meblağ: '%s' + Initialization sanity check failed. Bitcoin Core is shutting down. + Başlatma sınaması başarısız oldu. Bitcoin Çekirdeği kapatılıyor. - Invalid amount for -mintxfee=<amount>: '%s' - -mintxfee=<amount> için geçersiz meblağ: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + -minrelaytxfee=<amount> için geçersiz meblağ: '%s' + + + Invalid amount for -mintxfee=<amount>: '%s' + -mintxfee=<amount> için geçersiz meblağ: '%s' + + + Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) + -paytxfee=<tutar>:'%s' unsurunda geçersiz tutar (asgari %s olması lazımdır) + + + Invalid netmask specified in -whitelist: '%s' + -whitelist: '%s' unsurunda geçersiz bir ağ maskesi belirtildi + + + Keep at most <n> unconnectable blocks in memory (default: %u) + Hafızada en çok <n> bağlanılamaz blok tut (varsaylan: %u) Limit size of signature cache to <n> entries (default: 50000) @@ -3105,6 +3250,14 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) Bağlantı başına azami yollama tamponu, <n>*1000 bayt (varsayılan: 1000) + + Need to specify a port with -whitebind: '%s' + -whitebind: '%s' ile bir port belirtilmesi lazımdır + + + Node relay options: + Düğüm röle seçenekleri: + Only accept block chain matching built-in checkpoints (default: 1) Sadece yerleşik kontrol noktalarıyla eşleşen blok zincirini kabul et (varsayılan: 1) @@ -3137,18 +3290,18 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Randomly fuzz 1 of every <n> network messages Her <n> şebeke mesajından rastgele birini bulanıklaştır + + Relay and mine data carrier transactions (default: 1) + Veri taşıyıcı muameleleri oluştur ve aktar (varsayılan: 1) + + + Relay non-P2SH multisig (default: 1) + P2SH olmayan çoklu imzaları aktar (varsayılan: 1) + Run a thread to flush wallet periodically (default: 1) Periyodik olarak cüdanı diske yazdırmak için bir iş parçacığı çalıştır (varsayılan: 1) - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL seçenekleri: (SSL kurulum bilgisi için Bitcoin vikisine bakınız) - - - Send command to Bitcoin Core - Bitcoin Çekirdeğine komut yolla - Send trace/debug info to console instead of debug.log file Trace/hata ayıklama verilerini debug.log dosyası yerine konsola gönder @@ -3165,10 +3318,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Show all debugging options (usage: --help -help-debug) Tüm hata ayıklama seçeneklerini göster (kullanımı: --help -help-debug) - - Show benchmark information (default: 0) - Denektaşı verilerini göster (varsayılan: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) İstemci başlatıldığında debug.log dosyasını küçült (varsayılan: -debug bulunmadığında 1) @@ -3181,14 +3330,14 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Specify connection timeout in milliseconds (default: 5000) Bağlantı zaman aşım süresini milisaniye olarak belirt (varsayılan: 5000) - - Start Bitcoin Core Daemon - Bitcoin Çekirdeği servisini başlat - System error: Sistem hatası: + + This is experimental software. + Bu, deneysel bir yazılımdır. + Transaction amount too small Muamele meblağı çok düşük @@ -3201,6 +3350,10 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Transaction too large Muamele çok büyük + + Unable to bind to %s on this computer (bind returned error %s) + Bu bilgisayarda %s unsuruna bağlanılamadı (bağlanma %s hatasını verdi) + Use UPnP to map the listening port (default: 0) Dinlenecek portu haritalamak için UPnP kullan (varsayılan: 0) @@ -3213,6 +3366,10 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Username for JSON-RPC connections JSON-RPC bağlantıları için kullanıcı ismi + + Wallet needed to be rewritten: restart Bitcoin Core to complete + Cüzdanın tekrar yazılması gerekmektedir: tamamlamak için Bitcoin Çekirdeğini yeniden başlatın + Warning Uyarı @@ -3221,6 +3378,14 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Warning: This version is obsolete, upgrade required! Uyarı: Bu sürüm çok eskidir, güncellemeniz gerekir! + + Warning: Unsupported argument -benchmark ignored, use -debug=bench. + Uyarı: Deskteklenmeyen -benchmark argümanı görmezden gelindi, -debug=bench kullanınız. + + + Warning: Unsupported argument -debugnet ignored, use -debug=net. + Uyarı: Desteklenmeyen -debugnet argümanı görmezden gelindi, debug=net kullanınız. + Zapping all transactions from wallet... Cüzdandaki tüm muameleler kaldırılıyor... @@ -3229,10 +3394,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com on startup başlangıçta - - version - sürüm - wallet.dat corrupt, salvage failed wallet.dat bozuk, geri kazanım başarısız oldu @@ -3241,14 +3402,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Password for JSON-RPC connections JSON-RPC bağlantıları için parola - - Allow JSON-RPC connections from specified IP address - Belirtilen İP adresinden JSON-RPC bağlantılarını kabul et - - - Send commands to node running on <ip> (default: 127.0.0.1) - Şu <ip> adresinde (varsayılan: 127.0.0.1) çalışan düğüme komut yolla - Execute command when the best block changes (%s in cmd is replaced by block hash) En iyi blok değiştiğinde komutu çalıştır (komut için %s parametresi blok hash değeri ile değiştirilecektir) @@ -3281,10 +3434,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com This help message Bu yardım mesajı - - Unable to bind to %s on this computer (bind returned error %d, %s) - Bu bilgisayarda %s unsuruna bağlanılamadı. (bind şu hatayı iletti: %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect -addnode, -seednode ve -connect için DNS aramalarına izin ver @@ -3297,41 +3446,29 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error loading wallet.dat: Wallet corrupted wallet.dat dosyasının yüklenmesinde hata oluştu: bozuk cüzdan - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - wallet.dat dosyasının yüklenmesinde hata oluştu: cüzdanın daha yeni bir Bitcoin sürümüne ihtiyacı var - - - Wallet needed to be rewritten: restart Bitcoin to complete - Cüzdanın tekrar yazılması gerekiyordu: işlemi tamamlamak için Bitcoin'i yeniden başlatınız - Error loading wallet.dat wallet.dat dosyasının yüklenmesinde hata oluştu - Invalid -proxy address: '%s' - Geçersiz -proxy adresi: '%s' + Invalid -proxy address: '%s' + Geçersiz -proxy adresi: '%s' - Unknown network specified in -onlynet: '%s' - -onlynet için bilinmeyen bir şebeke belirtildi: '%s' + Unknown network specified in -onlynet: '%s' + -onlynet için bilinmeyen bir şebeke belirtildi: '%s' - Unknown -socks proxy version requested: %i - Bilinmeyen bir -socks vekil sürümü talep edildi: %i + Cannot resolve -bind address: '%s' + -bind adresi çözümlenemedi: '%s' - Cannot resolve -bind address: '%s' - -bind adresi çözümlenemedi: '%s' + Cannot resolve -externalip address: '%s' + -externalip adresi çözümlenemedi: '%s' - Cannot resolve -externalip address: '%s' - -externalip adresi çözümlenemedi: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - -paytxfee=<meblağ> için geçersiz meblağ: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + -paytxfee=<meblağ> için geçersiz meblağ: '%s' Invalid amount @@ -3377,13 +3514,5 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error Hata - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - rpcpassword=<parola> şu yapılandırma dosyasında belirtilmelidir: -%s -Dosya mevcut değilse, sadece sahibi için okumayla sınırlı izin ile oluşturunuz. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_uk.ts b/src/qt/locale/bitcoin_uk.ts index 1e739395a2..ff8ac68022 100644 --- a/src/qt/locale/bitcoin_uk.ts +++ b/src/qt/locale/bitcoin_uk.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -Це програмне забезпечення є експериментальним. - -Поширюється за ліцензією MIT/X11, додаткова інформація міститься у файлі COPYING, а також за адресою http://www.opensource.org/licenses/mit-license.php. - -Цей продукт включає в себе програмне забезпечення, розроблене в рамках проекту OpenSSL (http://www.openssl.org/), криптографічне програмне забезпечення, написане Еріком Янгом (eay@cryptsoft.com), та функції для роботи з UPnP, написані Томасом Бернардом. - - - Copyright - Авторське право - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -46,22 +9,10 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address Створити нову адресу - - &New - - Copy the currently selected address to the system clipboard Копіювати виділену адресу в буфер обміну - - &Copy - - - - C&lose - - &Copy Address &Скопіювати адресу @@ -76,31 +27,15 @@ This product includes software developed by the OpenSSL Project for use in the O &Export - & Експорт + &Експорт... &Delete &Видалити - - Choose the address to send coins to - - - - Choose the address to receive coins with - - C&hoose - - - - Sending addresses - - - - Receiving addresses - + &Обрати These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. @@ -108,7 +43,7 @@ This product includes software developed by the OpenSSL Project for use in the O These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - + Це ваша нова Bitcoin адреса для отримування платежів. Рекомендовано використовувати нову адресу для кожної транзакції. Copy &Label @@ -120,19 +55,15 @@ This product includes software developed by the OpenSSL Project for use in the O Export Address List - + Експортувати список адрес Comma separated file (*.csv) - Файли відділені комами (*.csv) + Файли, розділені комою (*.csv) - Exporting Failed - - - - There was an error trying to save the address list to %1. - + There was an error trying to save the address list to %1. Please try again. + Сталася помилка підчас зберігання адрес до %1. Будь ласка спробуйте ще. @@ -168,10 +99,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase Повторіть пароль - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - Введіть новий пароль для гаманця.<br/>Будь ласка, використовуйте паролі що містять <b>як мінімум 10 випадкових символів</b>, або <b>як мінімум 8 слів</b>. - Encrypt wallet Зашифрувати гаманець @@ -214,7 +141,7 @@ This product includes software developed by the OpenSSL Project for use in the O 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. - ВАЖЛИВО: Всі попередні резервні копії, які ви зробили з вашого гаманця файл повинен бути замінений новоствореному, зашифрованому файлі гаманця. З міркувань безпеки, попередні резервні копії в незашифрованому файлі гаманець стане марним, як тільки ви починаєте використовувати нову, зашифрований гаманець. + ВАЖЛИВО: Всі попередні резервні копії, які ви зробили з вашого файла гаманця повинні бути замінені новоствореним, зашифрованим файлом гаманця. З міркувань безпеки, попередні резервні копії в незашифрованого файла гаманця стануть марним, як тільки ви починаєте використовувати новий, зашифрований гаманець. Warning: The Caps Lock key is on! @@ -226,7 +153,7 @@ This product includes software developed by the OpenSSL Project for use in the O Bitcoin 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. - Біткоін-клієнт буде закрито для завершення процесу шифрування. Пам'ятайте, що шифрування гаманця не може повністю захистити ваші біткоіни від крадіжки, у випадку якщо ваш комп'ютер буде інфіковано шкідливими програмами. + Біткоін-клієнт буде закрито для завершення процесу шифрування. Пам'ятайте, що шифрування гаманця не може повністю захистити ваші біткоіни від крадіжки, у випадку якщо ваш комп'ютер буде інфіковано шкідливими програмами. Wallet encryption failed @@ -271,10 +198,6 @@ This product includes software developed by the OpenSSL Project for use in the O &Overview &Огляд - - Node - - Show general overview of wallet Показати загальний огляд гаманця @@ -295,10 +218,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application Вийти - - Show information about Bitcoin - Показати інформацію про Bitcoin - About &Qt &Про Qt @@ -325,15 +244,15 @@ This product includes software developed by the OpenSSL Project for use in the O &Sending addresses... - + Адреси для &відправлення... &Receiving addresses... - + Адреси для &отримання... Open &URI... - + Відкрити &URI Importing blocks from disk... @@ -387,6 +306,10 @@ This product includes software developed by the OpenSSL Project for use in the O &Receive &Отримати + + Show information about Bitcoin Core + Показати інформацію про Bitcoin Core + &Show / Hide Показати / Приховати @@ -431,49 +354,17 @@ This product includes software developed by the OpenSSL Project for use in the O Bitcoin Core Bitcoin Ядро - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - Bitcoin-клієнт + Параметри командного рядка %n active connection(s) to Bitcoin network - %n активне з'єднання з мережею%n активні з'єднання з мережею%n активних з'єднань з мережею + %n активние з'єднання з мережею Bitcoin%n активниих з'єднань з мережею Bitcoin%n активних з'єднань з мережею Bitcoin No block source available... - Ні блок джерела доступні ... - - - Processed %1 of %2 (estimated) blocks of transaction history. - + Недоступно жодного джерела блоків... Processed %1 blocks of transaction history. @@ -481,35 +372,35 @@ This product includes software developed by the OpenSSL Project for use in the O %n hour(s) - + %n година%n години%n годин %n day(s) - + %n день%n дні%n днів %n week(s) - + %n тиждень%n тижня%n тижнів %1 and %2 - + %1 та %2 %n year(s) - + %n рік%n роки%n років %1 behind - + %1 позаду Last received block was generated %1 ago. - + Останній отриманий блок було згенеровано %1 тому. Transactions after this will not yet be visible. - Угоди після цього буде ще не буде видно. + Пізніші транзакції не буде видно. Error @@ -517,7 +408,7 @@ This product includes software developed by the OpenSSL Project for use in the O Warning - Увага + Попередження Information @@ -559,10 +450,6 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> <b>Зашифрований</b> гаманець <b>заблоковано</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - Сталася фатальна помилка. Bitcoin більше не може продовжувати безпечно і піде. - ClientModel @@ -573,17 +460,9 @@ Address: %4 CoinControlDialog - - Coin Control Address Selection - - Quantity: - - - - Bytes: - + Кількість: Amount: @@ -591,35 +470,19 @@ Address: %4 Priority: - + Пріорітет: Fee: - - - - Low Output: - + Комісія: After Fee: - + Після комісії Change: - - - - (un)select all - - - - Tree mode - - - - List mode - + Решта: Amount @@ -633,18 +496,10 @@ Address: %4 Date Дата - - Confirmations - - Confirmed Підтверджені - - Priority - - Copy address Скопіювати адресу @@ -661,147 +516,91 @@ Address: %4 Copy transaction ID Копіювати ID транзакції - - Lock unspent - - - - Unlock unspent - - Copy quantity - + Копіювати кількість Copy fee - + Копіювати комісію Copy after fee - + Копіювати після комісії Copy bytes - + Копіювати байти Copy priority - - - - Copy low output - + Копіювати пріорітет Copy change - + Копіювати решту highest - + найвищий higher - + вищий high - + високий medium-high - + вище за середній medium - + середній low-medium - + нижче за середній low - + низький lower - + нижчий lowest - - - - (%1 locked) - - - - none - - - - Dust - + найнижчий yes - + так no - + ні This label turns red, if the transaction size is greater than 1000 bytes. - + Ця позначка буде червоною, якщо розмір транзакції вищий за 1000 байт. - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - + This label turns red, if the priority is smaller than "medium". + Ця позначка буде червоною, якщо пріорітет транзакції нижчий за «середній»". This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - + Ця позначка буде червоною, якщо будь хто з отримувачів отримає менше ніж %1. (no label) (немає назви) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog @@ -812,14 +611,6 @@ Address: %4 &Label &Мітка - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - &Address &Адреса @@ -841,11 +632,11 @@ Address: %4 Редагувати адресу для відправлення - The entered address "%1" is already in the address book. + The entered address "%1" is already in the address book. Введена адреса «%1» вже присутня в адресній книзі. - The entered address "%1" is not a valid Bitcoin address. + The entered address "%1" is not a valid Bitcoin address. Введена адреса «%1» не є коректною адресою в мережі Bitcoin. @@ -861,7 +652,7 @@ Address: %4 FreespaceChecker A new data directory will be created. - + Буде створена новий каталог даних. name @@ -869,23 +660,19 @@ Address: %4 Directory already exists. Add %1 if you intend to create a new directory here. - + Каталог вже існує. Додайте %1, якщо ви мали намір створити там новий каталог. Path already exists, and is not a directory. - + Шлях вже існує і не є каталогом. Cannot create data directory here. - + Тут неможливо створити каталог даних. HelpMessageDialog - - Bitcoin Core - Command-line options - - Bitcoin Core Bitcoin Ядро @@ -894,6 +681,10 @@ Address: %4 version версія + + Command-line options + Параметри командного рядка + Usage: Використання: @@ -907,24 +698,20 @@ Address: %4 Параметри інтерфейсу - Set language, for example "de_DE" (default: system locale) - Встановлення мови, наприклад "de_DE" (типово: системна) + Set language, for example "de_DE" (default: system locale) + Встановлення мови, наприклад "de_DE" (типово: системна) Start minimized Запускати згорнутим - - Set SSL root certificates for payment request (default: -system-) - - Show splash screen on startup (default: 1) Показувати заставку під час запуску (типово: 1) Choose data directory on startup (default: 0) - + Обрати каталог даних під час запуску (типово: 0) @@ -935,31 +722,31 @@ Address: %4 Welcome to Bitcoin Core. - + Ласкаво просимо в Bitcoin Core. As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - + Оскільки це перший запуск програми, ви можете обрати де Bitcoin Core буде зберігати дані. Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - + Bitcoin Core завантажить та збереже копію ланцюга Bitcoin блоків. Щонайменше %1Gb даних буде збережено в цьому каталозі. Гаманець теж буде збережено в цьому каталозі. Use the default data directory - + Використовувати типовий каталог даних Use a custom data directory: - + Використовувати свій каталог даних: - Bitcoin - Bitcoin + Bitcoin Core + Bitcoin Core - Error: Specified data directory "%1" can not be created. - + Error: Specified data directory "%1" cannot be created. + Помилка: неожливо створити обраний каталог даних «%1». Error @@ -967,36 +754,24 @@ Address: %4 GB of free space available - ГБ вільного простору доступно + Gb вільного простору доступно (of %1GB needed) - + (з %1Gb, що потрібно) OpenURIDialog Open URI - - - - Open payment request from URI or file - + Відкрити URI URI: - + URI: - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog @@ -1009,7 +784,7 @@ Address: %4 Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Оплата додаткових транзакцій за Кб, що допомагає переконатися, що ваші транзакції обробляються швидко. Велика частина операцій проводиться 1 Кб. + Необов'язкова комісия за Кб допомагає переконатися, що ваші транзакції обробляються швидше. Більшість транзакцій є 1 Кб. Pay transaction &fee @@ -1023,42 +798,6 @@ Address: %4 &Start Bitcoin on system login &Запускати гаманець при вході в систему - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - Reset all client options to default. Скинути всі параметри клієнта на типові. @@ -1071,30 +810,6 @@ Address: %4 &Network &Мережа - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Автоматично відкривати порт для клієнту біткоін на роутері. Працює лише якщо ваш роутер підтримує UPnP і ця функція увімкнена. @@ -1115,14 +830,6 @@ Address: %4 Port of the proxy (e.g. 9050) Порт проксі-сервера (наприклад 9050) - - SOCKS &Version: - SOCKS версії: - - - SOCKS version of the proxy (e.g. 5) - Версія SOCKS-проксі (наприклад 5) - &Window &Вікно @@ -1163,18 +870,6 @@ Address: %4 Choose the default subdivision unit to show in the interface and when sending coins. Виберіть одиницю вимірювання монет, яка буде відображатись в гаманці та при відправленні. - - Whether to show Bitcoin addresses in the transaction list or not. - Незалежно від того, щоб показати Bitcoin адреси в списку транзакцій чи ні. - - - &Display addresses in transaction list - &Відображати адресу в списку транзакцій - - - Whether to show coin control features or not. - - &OK &Гаразд @@ -1187,26 +882,10 @@ Address: %4 default типово - - none - - Confirm options reset Підтвердження скидання параметрів - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - The supplied proxy address is invalid. Невірно вказано адресу проксі. @@ -1226,18 +905,10 @@ Address: %4 Wallet Гаманець - - Available: - - Your current spendable balance Ваш поточний баланс расходуемого - - Pending: - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance Всього угод, які ще мають бути підтверджені, і до цих пір не враховуються в расходуемого балансу @@ -1273,96 +944,39 @@ Address: %4 URI handling Обробка URI - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - Неможливо обробити URI! Це може бути викликано неправильною Bitcoin-адресою, чи невірними параметрами URI. - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - Bitcoin + Amount + Кількість - Error: Specified data directory "%1" does not exist. - + %1 d + %1 д - Error: Cannot parse configuration file: %1. Only use key=value syntax. - + %1 h + %1 г - Error: Invalid combination of -regtest and -testnet. - + %1 m + %1 х - Bitcoin Core didn't yet exit safely... - + %1 s + %1 с - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Введіть адресу Bitcoin (наприклад 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + N/A + Н/Д + + + %1 ms + %1 мс @@ -1379,11 +993,7 @@ Address: %4 Save QR Code Зберегти QR-код - - PNG Image (*.png) - - - + RPCConsole @@ -1404,11 +1014,7 @@ Address: %4 Debug window - - - - General - + Вікно зневадження Using OpenSSL version @@ -1439,8 +1045,16 @@ Address: %4 Поточне число блоків - Estimated total blocks - Розрахункове число блоків + Received + Отримано + + + Sent + Відправлено + + + Version + Версія Last block time @@ -1454,25 +1068,9 @@ Address: %4 &Console Консоль - - &Network Traffic - - - - &Clear - - Totals - - - - In: - - - - Out: - + всього: Build date @@ -1503,34 +1101,18 @@ Address: %4 Наберіть <b>help</b> для перегляду доступних команд. - %1 B - + Inbound + Вхідний - %1 KB - + Yes + Так - %1 MB - + No + Ні - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog @@ -1545,30 +1127,6 @@ Address: %4 &Message: &Повідомлення: - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - Clear all fields of the form. Очистити всі поля в формі @@ -1577,37 +1135,13 @@ Address: %4 Clear Очистити - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - Copy label Скопіювати мітку Copy message - + Скопіювати повідомлення Copy amount @@ -1622,27 +1156,19 @@ Address: %4 Copy &URI - + Скопіювати URI Copy &Address - + Скопіювати адресу &Save Image... &Зберегти зображення... - - Request payment to %1 - - - - Payment information - - URI - + URI Address @@ -1691,44 +1217,16 @@ Address: %4 (no label) (немає назви) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins Відправити - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - Quantity: - - - - Bytes: - + Кількість: Amount: @@ -1736,31 +1234,19 @@ Address: %4 Priority: - + Пріорітет: Fee: - - - - Low Output: - + Комісія: After Fee: - + Після комісії Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - + Решта: Send to multiple recipients at once @@ -1794,13 +1280,9 @@ Address: %4 Confirm send coins Підтвердіть відправлення - - %1 to %2 - - Copy quantity - + Копіювати кількість Copy amount @@ -1808,35 +1290,23 @@ Address: %4 Copy fee - + Копіювати комісію Copy after fee - + Копіювати після комісії Copy bytes - + Копіювати байти Copy priority - - - - Copy low output - + Копіювати пріорітет Copy change - - - - Total Amount %1 (= %2) - - - - or - + Копіювати решту The recipient address is not valid, please recheck. @@ -1858,43 +1328,15 @@ Address: %4 Duplicate address found, can only send to each address once per send operation. Знайдено адресу що дублюється. Відправлення на кожну адресу дозволяється лише один раз на кожну операцію переказу. - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (немає назви) - - Warning: Unknown change address - - Are you sure you want to send? Ви впевнені, що хочете відправити? - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry @@ -1905,10 +1347,6 @@ Address: %4 Pay &To: &Отримувач: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Звернення до відправити платіж на (наприклад 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book Введіть мітку для цієї адреси для додавання її в адресну книгу @@ -1921,10 +1359,6 @@ Address: %4 Choose previously used address Обрати ранiш використовувану адресу - - This is a normal payment. - - Alt+A Alt+A @@ -1937,34 +1371,10 @@ Address: %4 Alt+P Alt+P - - Remove this entry - - Message: Повідомлення: - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - Memo: Нотатка: @@ -1972,15 +1382,7 @@ Address: %4 ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog @@ -1993,11 +1395,7 @@ Address: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - Ви можете зареєструватися повідомленнями зі своїми адресами, щоб довести, що ви є їх власником. Будьте обережні, щоб не підписувати що-небудь неясне, як фішинг-атак може спробувати обдурити вас в підписанні вашу особистість до них. Тільки підписати повністю докладні свідчення, користувач зобов'язується. - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Введіть адресу Bitcoin (наприклад 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + Ви можете зареєструватися повідомленнями зі своїми адресами, щоб довести, що ви є їх власником. Будьте обережні, щоб не підписувати що-небудь неясне, як фішинг-атак може спробувати обдурити вас в підписанні вашу особистість до них. Тільки підписати повністю докладні свідчення, користувач зобов'язується. Choose previously used address @@ -2051,10 +1449,6 @@ Address: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Введіть адресу підписання, повідомлення (забезпечення копіюванні розриви рядків, прогалини, вкладки і т.д. точно) і підпис нижче, щоб перевірити повідомлення. Будьте обережні, щоб не читати далі в підпис, ніж те, що в підписаному самого повідомлення, щоб уникнути обдурять нападу чоловік-в-середній. - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Введіть адресу Bitcoin (наприклад 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address Перевірте повідомлення для впевненості, що воно підписано вказаною Bitcoin-адресою @@ -2068,11 +1462,7 @@ Address: %4 Скинути всі поля перевірки повідомлення - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Введіть адресу Bitcoin (наприклад 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature + Click "Sign Message" to generate signature Натисніть кнопку «Підписати повідомлення», для отримання підпису @@ -2130,10 +1520,6 @@ Address: %4 Bitcoin Core Bitcoin Ядро - - The Bitcoin Core developers - - [testnet] [тестова мережа] @@ -2152,10 +1538,6 @@ Address: %4 Open until %1 Відкрити до %1 - - conflicted - - %1/offline %1/поза інтернетом @@ -2172,10 +1554,6 @@ Address: %4 Status Статус - - , broadcast through %n node(s) - - Date Дата @@ -2208,10 +1586,6 @@ Address: %4 Credit Кредит - - matures in %n more block(s) - - not accepted не прийнято @@ -2240,14 +1614,6 @@ Address: %4 Transaction ID ID транзакції - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - Debug information Отладочна інформація @@ -2276,13 +1642,9 @@ Address: %4 , has not been successfully broadcast yet , ще не було успішно розіслано - - Open for %n more block(s) - - unknown - невідомий + невідомо @@ -2310,18 +1672,6 @@ Address: %4 Address Адреса - - Amount - Кількість - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - Open until %1 Відкрити до %1 @@ -2338,25 +1688,9 @@ Address: %4 Generated but not accepted Згенеровано, але не підтверджено - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - Received with - Отримано + Отримані на Received from @@ -2364,7 +1698,7 @@ Address: %4 Sent to - Відправлено + Відправлені на Payment to yourself @@ -2372,7 +1706,7 @@ Address: %4 Mined - Добуто + Добуті (n/a) @@ -2481,26 +1815,6 @@ Address: %4 Show transaction details Показати деталі транзакції - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Файли, розділені комою (*.csv) @@ -2519,16 +1833,12 @@ Address: %4 Label - Мітка + Назва Address Адреса - - Amount - Кількість - ID Ідентифікатор @@ -2542,13 +1852,12 @@ Address: %4 до + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel @@ -2578,14 +1887,6 @@ Address: %4 Backup Failed Помилка резервного копіювання - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - Backup Successful Успішне створення резервної копії @@ -2593,18 +1894,6 @@ Address: %4 bitcoin-core - - Usage: - Використання: - - - List commands - Список команд - - - Get help for a command - Отримати довідку по команді - Options: Параметри: @@ -2623,15 +1912,15 @@ Address: %4 Listen for connections on <port> (default: 8333 or testnet: 18333) - Чекати на з'єднання на <port> (типово: 8333 або тестова мережа: 18333) + Чекати на з'єднання на <port> (типово: 8333 або тестова мережа: 18333) Maintain at most <n> connections to peers (default: 125) - Підтримувати не більше <n> зв'язків з колегами (типово: 125) + Підтримувати не більше <n> зв'язків з колегами (типово: 125) Connect to a node to retrieve peer addresses, and disconnect - Підключитись до вузла, щоб отримати список адрес інших учасників та від'єднатись + Підключитись до вузла, щоб отримати список адрес інших учасників та від'єднатись Specify your own public address @@ -2639,28 +1928,20 @@ Address: %4 Threshold for disconnecting misbehaving peers (default: 100) - Поріг відключення неправильно під'єднаних пірів (типово: 100) + Поріг відключення неправильно під'єднаних пірів (типово: 100) Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Максимальній розмір вхідного буферу на одне з'єднання (типово: 86400) - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - + Максимальній розмір вхідного буферу на одне з'єднання (типово: 86400) Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Прослуховувати <port> для JSON-RPC-з'єднань (типово: 8332 або тестова мережа: 18332) + Прослуховувати <port> для JSON-RPC-з'єднань (типово: 8332 або тестова мережа: 18332) Accept command line and JSON-RPC commands Приймати команди із командного рядка та команди JSON-RPC - - Bitcoin Core RPC client version - - Run in the background as a daemon and accept commands Запустити в фоновому режимі (як демон) та приймати команди @@ -2671,114 +1952,24 @@ Address: %4 Accept connections from outside (default: 1 if no -proxy or -connect) - Приймати з'єднання ззовні (за замовчуванням: 1, якщо ні-проксі або-з'єднання) - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - + Приймати з'єднання ззовні (за замовчуванням: 1, якщо ні-проксі або-з'єднання) Bind to given address and always listen on it. Use [host]:port notation for IPv6 - Прив'язка до даного адресою і завжди слухати на ньому. Використовуйте [господаря]: позначення порту для IPv6 - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - Введіть тестовий режим регресії, яка використовує спеціальну ланцюг, в якій блоки можуть бути вирішені негайно. Це призначено для регресійного тестування інструментів і розробки додатків. - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - + Прив'язка до даного адресою і завжди слухати на ньому. Використовуйте [господаря]: позначення порту для IPv6 Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Помилка: транзакцію було відхилено. Це може статись, якщо декілька монет з вашого гаманця вже використані, наприклад, якщо ви використовуєте одну копію гаманця (wallet.dat), а монети були використані з іншої копії, але не позначені як використані в цій. - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Це тест збірки попередньою версією - використовуйте на свій страх і ризик - не використовувати для гірничодобувних або торгових додатків - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Увага: встановлено занадто велику комісію (-paytxfee). Комісія зніматиметься кожен раз коли ви проводитимете транзакції. - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - Увага: будь ласка, перевірте дату і час на своєму комп'ютері. Якщо ваш годинник йде неправильно, Bitcoin може працювати некоректно. - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. Увага: помилка читання wallet.dat! Всі ключі прочитано коректно, але дані транзакцій чи записи адресної книги можуть бути пропущені, або пошкоджені. @@ -2787,70 +1978,26 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. Увага: файл wallet.dat пошкоджено, дані врятовано! Оригінальний wallet.dat збережено як wallet.{timestamp}.bak до %s; якщо Ваш баланс чи транзакції неправильні, Ви можете відновити їх з резервної копії. - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - Attempt to recover private keys from a corrupt wallet.dat Спроба відновити закриті ключі з пошкодженого wallet.dat - - Bitcoin Core Daemon - - Block creation options: Опції створення блоку: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - Connect only to the specified node(s) Підключитись лише до вказаного вузла - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - Corrupted block database detected Виявлено пошкоджений блок бази даних - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - Discover own IP address (default: 1 when listening and no -externalip) Відкрийте власну IP-адресу (за замовчуванням: 1, коли не чує і-externalip) - - Do not load the wallet and disable wallet RPC calls - - Do you want to rebuild the block database now? Ви хочете перебудувати базу даних блоку зараз? @@ -2859,10 +2006,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error initializing block database Помилка ініціалізації бази даних блоків - - Error initializing wallet database environment %s! - - Error loading block database Помилка завантаження бази даних блоків @@ -2927,22 +2070,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to write undo data Не вдалося записати скасувати дані - - Fee per kB to add to transactions you send - Комісія за Кб - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - Знайти однолітків за допомогою DNS пошук (за замовчуванням: 1, якщо-ні підключити) - - - Force safe mode (default: 0) - - Generate coins (default: 0) Генерація монети (за замовчуванням: 0) @@ -2951,70 +2078,14 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. How many blocks to check at startup (default: 288, 0 = all) Скільки блоків перевіряти під час запуску (типово: 288, 0 = всі) - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - Not enough file descriptors available. Бракує дескрипторів файлів, доступних. - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - Set the number of threads to service RPC calls (default: 4) Встановити число потоків до дзвінків служба RPC (за замовчуванням: 4) - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - Використання (застаріле, використовуйте bitcoin-cli): - Verifying blocks... Перевірка блоків... @@ -3023,66 +2094,14 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Verifying wallet... Перевірка гаманця... - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - Imports blocks from external blk000??.dat file Імпорт блоків з зовнішнього файлу blk000??.dat - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - Information Інформація - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - Maintain a full transaction index (default: 0) Підтримувати індекс повний транзакцій (за замовчуванням: 0) @@ -3093,7 +2112,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Максимальній розмір вихідного буферу на одне з'єднання, <n>*1000 байт (типово: 1000) + Максимальній розмір вихідного буферу на одне з'єднання, <n>*1000 байт (типово: 1000) Only accept block chain matching built-in checkpoints (default: 1) @@ -3103,42 +2122,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Only connect to nodes in network <net> (IPv4, IPv6 or Tor) Підключити тільки до вузлів в мережі <net> (IPv4, IPv6 або Tor) - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - Параметри SSL: (див. Bitcoin Wiki для налаштування SSL) - - - Send command to Bitcoin Core - - Send trace/debug info to console instead of debug.log file Відсилати налагоджувальну інформацію на консоль, а не у файл debug.log @@ -3147,18 +2130,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Set minimum block size in bytes (default: 0) Встановити мінімальний розмір блоку у байтах (типово: 0) - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - Shrink debug.log file on client startup (default: 1 when no -debug) Стискати файл debug.log під час старту клієнта (типово: 1 коли відсутутній параметр -debug) @@ -3171,10 +2142,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Specify connection timeout in milliseconds (default: 5000) Вказати тайм-аут підключення у мілісекундах (типово: 5000) - - Start Bitcoin Core Daemon - - System error: Системна помилка: @@ -3201,7 +2168,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Username for JSON-RPC connections - Ім'я користувача для JSON-RPC-з'єднань + Ім'я користувача для JSON-RPC-з'єднань Warning @@ -3211,37 +2178,17 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: This version is obsolete, upgrade required! Увага: Поточна версія застаріла, необхідне оновлення! - - Zapping all transactions from wallet... - - - - on startup - - - - version - версія - wallet.dat corrupt, salvage failed wallet.dat пошкоджено, відновлення не вдалося Password for JSON-RPC connections - Пароль для JSON-RPC-з'єднань - - - Allow JSON-RPC connections from specified IP address - Дозволити JSON-RPC-з'єднання з вказаної IP-адреси - - - Send commands to node running on <ip> (default: 127.0.0.1) - Відправляти команди на вузол, запущений на <ip> (типово: 127.0.0.1) + Пароль для JSON-RPC-з'єднань Execute command when the best block changes (%s in cmd is replaced by block hash) - Виконати команду, коли з'явиться новий блок (%s в команді змінюється на хеш блоку) + Виконати команду, коли з'явиться новий блок (%s в команді змінюється на хеш блоку) Upgrade wallet to latest format @@ -3257,7 +2204,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Use OpenSSL (https) for JSON-RPC connections - Використовувати OpenSSL (https) для JSON-RPC-з'єднань + Використовувати OpenSSL (https) для JSON-RPC-з'єднань Server certificate file (default: server.cert) @@ -3271,10 +2218,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message Дана довідка - - Unable to bind to %s on this computer (bind returned error %d, %s) - Неможливо прив'язати до порту %s на цьому комп'ютері (bind returned error %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect Дозволити пошук в DNS для команд -addnode, -seednode та -connect @@ -3287,40 +2230,20 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted Помилка при завантаженні wallet.dat: Гаманець пошкоджено - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - Помилка при завантаженні wallet.dat: Гаманець потребує новішої версії Біткоін-клієнта - - - Wallet needed to be rewritten: restart Bitcoin to complete - Потрібно перезаписати гаманець: перезапустіть Біткоін-клієнт для завершення - Error loading wallet.dat Помилка при завантаженні wallet.dat - Invalid -proxy address: '%s' + Invalid -proxy address: '%s' Помилка в адресі проксі-сервера: «%s» - Unknown network specified in -onlynet: '%s' + Unknown network specified in -onlynet: '%s' Невідома мережа вказана в -onlynet: «%s» - Unknown -socks proxy version requested: %i - В параметрі -socks запитується невідома версія: %i - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' Помилка у величині комісії -paytxfee=<amount>: «%s» @@ -3367,13 +2290,5 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error Помилка - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - Ви мусите встановити rpcpassword=<password> в файлі конфігурації: -%s -Якщо файл не існує, створіть його із правами тільки для читання власником (owner-readable-only). - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_ur_PK.ts b/src/qt/locale/bitcoin_ur_PK.ts index d9634f63e3..ab9106ca03 100644 --- a/src/qt/locale/bitcoin_ur_PK.ts +++ b/src/qt/locale/bitcoin_ur_PK.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -41,95 +9,7 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address نیا ایڈریس بنائیں - - &New - - - - Copy the currently selected address to the system clipboard - - - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - - - &Delete - - - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - - - Comma separated file (*.csv) - - - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -147,10 +27,6 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - Enter passphrase پاس فریز داخل کریں @@ -163,26 +39,14 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase نیا پاس فریز دہرائیں - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - - Encrypt wallet - - - - This operation needs your wallet passphrase to unlock the wallet. - + بٹوے کی رمزنگاری Unlock wallet بٹوا ان لاک - - This operation needs your wallet passphrase to decrypt the wallet. - - Decrypt wallet خفیہ کشائی کر یںبٹوے کے @@ -191,427 +55,19 @@ This product includes software developed by the OpenSSL Project for use in the O Change passphrase پاس فریز تبدیل کریں - - Enter the old and new passphrase to the wallet. - - - - Confirm wallet encryption - - - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - - - Wallet encrypted - - - - Bitcoin 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. - - - - Wallet encryption failed - - - - Wallet encryption failed due to an internal error. Your wallet was not encrypted. - - - - The supplied passphrases do not match. - - - - Wallet unlock failed - - - - The passphrase entered for the wallet decryption was incorrect. - - - - Wallet decryption failed - - - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - - - Synchronizing with network... - - - - &Overview - - - - Node - - - - Show general overview of wallet - - - - &Transactions - - - - Browse transaction history - - - - E&xit - - - - Quit application - - - - Show information about Bitcoin - - - - About &Qt - - - - Show information about Qt - - - - &Options... - - - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - - - Change the passphrase used for wallet encryption - - - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - - - &File - - - - &Settings - - - - &Help - - - - Tabs toolbar - - - - [testnet] - - - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - - - %n active connection(s) to Bitcoin network - - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - Error نقص - - Warning - - - - Information - - - - Up to date - - - - Catching up... - - - - Sent transaction - - - - Incoming transaction - - - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> - - - - Wallet is <b>encrypted</b> and currently <b>locked</b> - - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - - + ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount رقم @@ -624,1017 +80,60 @@ Address: %4 Date تاریخ - - Confirmations - - - - Confirmed - - - - Priority - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) چٹ کے بغیر - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog - - Edit Address - - - - &Label - - - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - - - &Address - - - - New receiving address - - - - New sending address - - - - Edit receiving address - - - - Edit sending address - - - - The entered address "%1" is already in the address book. - - - - The entered address "%1" is not a valid Bitcoin address. - - - - Could not unlock wallet. - - - - New key generation failed. - - - + FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - - - version - - - - Usage: - - - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - Error نقص - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog - - Options - - - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage - - Form - - - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - - - <b>Recent transactions</b> - - - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - + Amount + رقم - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - - - &Label: - - - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - - - Copy label - - - - Copy message - - - - Copy amount - - - + ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address پتہ @@ -1647,19 +146,7 @@ Address: %4 Label چٹ - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel @@ -1670,10 +157,6 @@ Address: %4 Label چٹ - - Message - - Amount رقم @@ -1682,611 +165,47 @@ Address: %4 (no label) چٹ کے بغیر - - (no message) - - - - (no amount) - - - + SendCoinsDialog - - Send Coins - - - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - - - Send to multiple recipients at once - - - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - Balance: بیلنس: - - Confirm the send action - - - - S&end - - - - Confirm send coins - - - - %1 to %2 - - - - Copy quantity - - - - Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - - - The amount to pay must be larger than 0. - - - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) چٹ کے بغیر - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry - - A&mount: - - - - Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Enter a label for this address to add it to your address book - - - - &Label: - - - - Choose previously used address - - - - This is a normal payment. - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - - - [testnet] - - - + TrafficGraphWidget - - KB/s - - - + TransactionDesc - - Open until %1 - - - - conflicted - - - - %1/offline - - - - %1/unconfirmed - - - - %1 confirmations - - - - Status - - - - , broadcast through %n node(s) - - Date تاریخ - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - Amount رقم - - true - - - - false - - - - , has not been successfully broadcast yet - - - - Open for %n more block(s) - - - - unknown - - - + TransactionDescDialog - - Transaction details - - - - This pane shows a detailed description of the transaction - - - + TransactionTableModel @@ -2301,95 +220,15 @@ Address: %4 Address پتہ - - Amount - رقم - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - - - Open until %1 - - - - Confirmed (%1 confirmations) - - - - This block was not received by any other nodes and will probably not be accepted! - - - - Generated but not accepted - - - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - - - Received with - - - - Received from - - Sent to کو بھیجا - - Payment to yourself - - - - Mined - - (n/a) (N / A) - - Transaction status. Hover over this field to show number of confirmations. - - - - Date and time that the transaction was received. - - - - Type of transaction. - - - - Destination address of transaction. - - - - Amount removed from or added to balance. - - - + TransactionView @@ -2420,86 +259,10 @@ Address: %4 Range... دیگر - - Received with - - Sent to کو بھیجا - - To yourself - - - - Mined - - - - Other - - - - Enter address or label to search - - - - Min amount - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - - - Comma separated file (*.csv) - - - - Confirmed - - Date تاریخ @@ -2516,804 +279,25 @@ Address: %4 Address پتہ - - Amount - رقم - - - ID - - - - Range: - - - - to - - - + + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel - - Send Coins - - - + WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - - - Options: - - - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - This help message یہ مدد کا پیغام - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - - - Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - Invalid amount غلط رقم @@ -3322,47 +306,9 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Insufficient funds ناکافی فنڈز - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - - - Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - - - Done loading - - - - To use the %s option - - Error نقص - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_uz@Cyrl.ts b/src/qt/locale/bitcoin_uz@Cyrl.ts index 6ba4f6fa1b..1a4d9f8108 100644 --- a/src/qt/locale/bitcoin_uz@Cyrl.ts +++ b/src/qt/locale/bitcoin_uz@Cyrl.ts @@ -1,3368 +1,974 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage Double-click to edit address or label - + Манзил ёки ёрлиқни таҳрирлаш учун икки марта босинг Create a new address - + Янги манзил яратинг &New - + &Янги Copy the currently selected address to the system clipboard - + Жорий танланган манзилни тизим вақтинчалик хотирасига нусха кўчиринг &Copy - + &Нусха олиш C&lose - + &Ёпиш &Copy Address - + Манзилдан &нусха олиш Delete the currently selected address from the list - + Жорий танланган манзилни рўйхатдан ўчириш Export the data in the current tab to a file - + Жорий ички ойна ичидаги маълумотларни файлга экспорт қилиш &Export - + &Экспорт &Delete - + &Ўчириш Choose the address to send coins to - + Тангаларни жўнатиш учун манзилни танланг Choose the address to receive coins with - + Тангаларни қабул қилиш учун манзилни танланг C&hoose - + &Танлаш Sending addresses - + Жўнатиладиган манзиллар Receiving addresses - + Қабул қилинадиган манзиллар These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - + Улар тўловларни жўнатиш учун сизнинг Bitcoin манзилларингиз. Доимо тангаларни жўнатишдан олдин сумма ва қабул қилувчи манзилни текшириб кўринг. These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - + Улар тўловларни қабул қилиш учун сизнинг Bitcoin манзилларингиз. Ҳар бир ўтказма учун янги қабул қилувчи манзилдан фойдаланиш тавсия қилинади. Copy &Label - + Нусха олиш ва ёрлиқ &Edit - + &Таҳрирлаш Export Address List - + Манзил рўйхатини экспорт қилиш Comma separated file (*.csv) - + Вергул билан ажратилган файл (*.csv) Exporting Failed - + Экспорт қилиб бўлмади - - There was an error trying to save the address list to %1. - - - + AddressTableModel Label - + Ёрлиқ Address - + Манзил (no label) - + (Ёрлиқ мавжуд эмас) AskPassphraseDialog Passphrase Dialog - + Махфий сўз ойнаси Enter passphrase - + Махфий сузни киритинг New passphrase - + Янги махфий суз Repeat new passphrase - - - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - + Янги махфий сузни такрорланг Encrypt wallet - + Ҳамённи қодлаш This operation needs your wallet passphrase to unlock the wallet. - + Ушбу операцияни амалга ошириш учун ҳамённи қулфдан чиқариш парол сўзини талаб қилади. Unlock wallet - + Ҳамённи қулфдан чиқариш This operation needs your wallet passphrase to decrypt the wallet. - + Ушбу операцияни амалга ошириш учун ҳамённи коддан чиқариш парол сўзини талаб қилади. Decrypt wallet - + Ҳамённи коддан чиқариш Change passphrase - + Махфий сузни узгартириш Enter the old and new passphrase to the wallet. - + Ҳамёнга эски ва янги паролларингизни киритинг. Confirm wallet encryption - + Ҳамённи кодлашни тасдиқлаш Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - + Диққат: Агар сиз ҳамёнингизни кодласангиз ва махфий сўзингизни унутсангиз, сиз <b>БАРЧА BITCOIN ПУЛЛАРИНГИЗНИ ЙЎҚОТАСИЗ</b>! Are you sure you wish to encrypt your wallet? - - - - 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. - + Ҳамёнингизни кодлашни ростдан хоҳлайсизми? Warning: The Caps Lock key is on! - + Диққат: Caps Lock тугмаси ёқилган! Wallet encrypted - + Ҳамёни кодланган + + + 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>. + Ҳамёнга янги махфий сўз киритинг.<br/>Илтимос, <b>ўнта ёки тасодифий белгили</b> махфий сўздан фойдаланинг ёки <b>саккизта ёки кўпроқ сўзлар</b>дан фойдаланинг. Bitcoin 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. - + Bitcoin кодлаш жараёнини тугатиш учун ёпилади. Ёдда сақланг: ҳамёнингизни кодлаш компьютерингизни зарарлаган зарарли дастурлар томонидан bitcoin тангаларингизни ўғирланишидан тўлиқ ҳимоя қила олмайди. Wallet encryption failed - + Ҳамённи кодлаш амалга ошмади Wallet encryption failed due to an internal error. Your wallet was not encrypted. - + Ҳамённи кодлаш ташқи хато туфайли амалга ошмади. Ҳамёнингиз кодланмади. The supplied passphrases do not match. - + Киритилган пароллар мос келмади. Wallet unlock failed - + Ҳамённи қулфдан чиқариш амалга ошмади The passphrase entered for the wallet decryption was incorrect. - + Ҳамённи коддан чиқариш учун киритилган парол нотўғри. Wallet decryption failed - + Ҳамённи коддан чиқариш амалга ошмади - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - Synchronizing with network... - + Тармоқ билан синхронланмоқда... &Overview - - - - Node - + &Кўриб чиқиш Show general overview of wallet - + Ҳамённинг умумий кўринишини кўрсатиш &Transactions - + &Пул ўтказмалари Browse transaction history - + Пул ўтказмалари тарихини кўриш E&xit - + Ч&иқиш Quit application - - - - Show information about Bitcoin - - - - About &Qt - - - - Show information about Qt - + Иловадан чиқиш &Options... - - - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - + &Мосламалар... &Sending addresses... - + &Жўнатилувчи манзиллар... &Receiving addresses... - + &Қабул қилувчи манзиллар... Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - + Интернет манзилни очиш Change the passphrase used for wallet encryption - - - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - + Паролни ўзгартириш ҳамённи кодлашда фойдаланилади &File - + & файл &Settings - + & Созламалар &Help - + &Ёрдам Tabs toolbar - + Ички ойналар асбоблар панели [testnet] - - - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - + [testnet] %n active connection(s) to Bitcoin network - - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - + %n та Bitcoin тармоғига фаол уланиш мавжуд Processed %1 blocks of transaction history. - + Ўтказма тарихи блоклари %1 та амалга оширилган. %n hour(s) - + %n соат %n day(s) - + %n кун %n week(s) - + %n ҳафта %1 and %2 - + %1 ва %2 %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - - - Error - - - - Warning - - - - Information - + %n йил Up to date - - - - Catching up... - + Янгиланган Sent transaction - + Жўнатилган операция Incoming transaction - - - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - + Кирувчи операция Wallet is <b>encrypted</b> and currently <b>unlocked</b> - + Ҳамён <b>кодланган</b> ва вақтинча <b>қулфдан чиқарилган</b> Wallet is <b>encrypted</b> and currently <b>locked</b> - - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - + Ҳамён <b>кодланган</b> ва вақтинча <b>қулфланган</b> ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - + Байт: Amount - + Миқдори Address - + Манзил Date - - - - Confirmations - + Сана Confirmed - - - - Priority - + Тасдиқланди Copy address - + Манзилни нусхалаш Copy label - + Ёрликни нусхала Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - + Кийматни нусхала medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - + ўрта (no label) - + (Ёрлик мавжуд эмас) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog Edit Address - + Манзилларни таҳрирлаш &Label - - - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - + &Ёрлик &Address - + &Манзил New receiving address - + Янги кабул килувчи манзил New sending address - + Янги жунатилувчи манзил Edit receiving address - + Кабул килувчи манзилни тахрирлаш Edit sending address - + Жунатилувчи манзилни тахрирлаш - The entered address "%1" is already in the address book. - - - - The entered address "%1" is not a valid Bitcoin address. - + The entered address "%1" is already in the address book. + Киритилган "%1" манзили аллақачон манзил китобида. Could not unlock wallet. - + Ҳамён қулфдан чиқмади. New key generation failed. - + Янги калит яратиш амалга ошмади. FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - Bitcoin Core - Command-line options - + (%1-bit) + (%1-bit) - Bitcoin Core - - - - version - + About Bitcoin Core + Bitcoin Core ҳақида Usage: - + Фойдаланиш: - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - - - Error - - - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog Options - + Танламалар - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage Form - - - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - + Шакл <b>Recent transactions</b> - + <b>Жорий утказмалар</b> - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - + Amount + Миқдори - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - + Асосий Name - + Ном - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - &Label: - - - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - + &Ёрлиқ: Copy label - + Ёрликни нусхала Copy message - + Хабарни нусхала Copy amount - + Кийматни нусхала ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address - + Манзил Amount - + Миқдори Label - + Ёрлик - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel Date - + Сана Label - - - - Message - + Ёрлик Amount - + Миқдори (no label) - + (Ёрлик мавжуд эмас) - - (no message) - - - - (no amount) - - - + SendCoinsDialog Send Coins - - - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - + Тангаларни жунат Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - + Байт: Send to multiple recipients at once - - - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - + Бирданига бир нечта қабул қилувчиларга жўнатиш Balance: - + Баланс Confirm the send action - - - - S&end - + Жўнатиш амалини тасдиқлаш Confirm send coins - - - - %1 to %2 - - - - Copy quantity - + Тангалар жўнаишни тасдиқлаш Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - + Кийматни нусхала The amount to pay must be larger than 0. - - - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - + Тўлов миқдори 0. дан катта бўлиши керак. (no label) - + (Ёрлик мавжуд эмас) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry A&mount: - + &Миқдори: Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - + &Тўлов олувчи: Enter a label for this address to add it to your address book - + Манзил китобингизга қўшиш учун ушбу манзил учун ёрлиқ киритинг &Label: - - - - Choose previously used address - - - - This is a normal payment. - + &Ёрлиқ: Alt+A - + Alt+A Paste address from clipboard - + Клипбоарддан манзилни қўйиш Alt+P - + Alt+P - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - Alt+A - + Alt+A Paste address from clipboard - + Клипбоарддан манзилни қўйиш Alt+P - + Alt+P - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - The Bitcoin Core developers - + Bitcoin Core дастурчилари [testnet] - + [testnet] TrafficGraphWidget - - KB/s - - - + TransactionDesc Open until %1 - - - - conflicted - - - - %1/offline - + %1 гача очиш %1/unconfirmed - + %1/тасдиқланмади %1 confirmations - - - - Status - - - - , broadcast through %n node(s) - + %1 тасдиқлашлар Date - - - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - + Сана Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - + ID Amount - - - - true - - - - false - + Миқдори , has not been successfully broadcast yet - - - - Open for %n more block(s) - + , ҳалигача трансляция қилингани йўқ unknown - + Номаълум TransactionDescDialog Transaction details - + Операция тафсилотлари This pane shows a detailed description of the transaction - + Ушбу ойна операциянинг батафсил таърифини кўрсатади TransactionTableModel Date - + Сана Type - + Тури Address - - - - Amount - - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - + Манзил Open until %1 - + %1 гача очиш Confirmed (%1 confirmations) - + Тасдиқланди (%1 та тасдиқ) This block was not received by any other nodes and will probably not be accepted! - + Ушбу тўсиқ бирорта бошқа уланишлар томонидан қабул қилинмаган ва тасдиқланмаган! Generated but not accepted - - - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - + Яратилди, аммо қабул қилинмади Received with - - - - Received from - + Ёрдамида қабул қилиш Sent to - + Жўнатиш Payment to yourself - + Ўзингизга тўлов Mined - + Фойда (n/a) - + (қ/қ) Transaction status. Hover over this field to show number of confirmations. - + Ўтказма ҳолати. Ушбу майдон бўйлаб тасдиқлашлар сонини кўрсатиш. Date and time that the transaction was received. - + Ўтказма қабул қилинган сана ва вақт. Type of transaction. - + Пул ўтказмаси тури Destination address of transaction. - + Ўтказиладиган жараён манзили. Amount removed from or added to balance. - + Миқдор ўчирилган ёки балансга қўшилган. TransactionView All - + Барча Today - + Бугун This week - + Шу ҳафта This month - + Шу ой Last month - + Ўтган хафта This year - + Шу йил Range... - + Оралиқ... Received with - + Ёрдамида қабул қилинган Sent to - + Жўнатиш To yourself - + Ўзингизга Mined - + Фойда Other - + Бошка Enter address or label to search - + Излаш учун манзил ёки ёрлиқни киритинг Min amount - + Мин қиймат Copy address - + Манзилни нусхалаш Copy label - + Ёрликни нусхалаш Copy amount - - - - Copy transaction ID - + Кийматни нусхала Edit label - - - - Show transaction details - - - - Export Transaction History - + Ёрликни тахрирлаш Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - + Экспорт қилиб бўлмади Comma separated file (*.csv) - + Вергул билан ажратилган файл (*.csv) Confirmed - + Тасдиқланди Date - + Сана Type - + Туркум Label - + Ёрлик Address - - - - Amount - + Манзил ID - + ID Range: - + Оралиқ: to - + Кимга + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel Send Coins - + Тангаларни жунат WalletView &Export - + &Экспорт Export the data in the current tab to a file - + Жорий ички ойна ичидаги маълумотларни файлга экспорт қилиш - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - Options: - + Танламалар: Specify configuration file (default: bitcoin.conf) - + Мослаш файлини кўрсатинг (default: bitcoin.conf) Specify pid file (default: bitcoind.pid) - + pid файлини кўрсатинг (default: bitcoind.pid) Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - + Маълумотлар директориясини кўрсатинг Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - + Буйруқлар сатри ва JSON-RPC буйруқларига рози бўлинг Run in the background as a daemon and accept commands - + Демон сифатида орқа фонда ишга туширинг ва буйруқларга рози бўлинг Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - + Синов тармоғидан фойдаланинг Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - + JSON-RPC уланишлари учун фойдаланувчи номи Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - + JSON-RPC уланишлари учун парол Use OpenSSL (https) for JSON-RPC connections - + JSON-RPC уланишлари учун OpenSSL (https)дан фойдаланиш Server certificate file (default: server.cert) - + Сервер сертификат файли (default: server.cert) Server private key (default: server.pem) - + Сервер махфий калити (бирламчи: server.pem) This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - + Бу ёрдам хабари Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - + Манзиллар юкланмоқда... Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - + Тўсиқ индекси юкланмоқда... Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - + Ҳамён юкланмоқда... Rescanning... - + Қайта текшириб чиқилмоқда... Done loading - + Юклаш тайёр - - To use the %s option - - - - Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - - + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_vi.ts b/src/qt/locale/bitcoin_vi.ts index 0f9fc4f0f1..e03349b383 100644 --- a/src/qt/locale/bitcoin_vi.ts +++ b/src/qt/locale/bitcoin_vi.ts @@ -1,36 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage @@ -41,95 +9,19 @@ This product includes software developed by the OpenSSL Project for use in the O Create a new address Tạo một địa chỉ mới - - &New - - Copy the currently selected address to the system clipboard Sao chép các địa chỉ đã được chọn vào bộ nhớ tạm thời của hệ thống - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - &Delete &Xóa - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - Comma separated file (*.csv) Tập tin tách biệt bởi dấu phẩy (*.csv) - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel @@ -147,471 +39,15 @@ This product includes software developed by the OpenSSL Project for use in the O AskPassphraseDialog - - Passphrase Dialog - - - - Enter passphrase - - - - New passphrase - - - - Repeat new passphrase - - - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - - - - Encrypt wallet - - - - This operation needs your wallet passphrase to unlock the wallet. - - - - Unlock wallet - - - - This operation needs your wallet passphrase to decrypt the wallet. - - - - Decrypt wallet - - - - Change passphrase - - - - Enter the old and new passphrase to the wallet. - - - - Confirm wallet encryption - - - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - - - Wallet encrypted - - - - Bitcoin 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. - - - - Wallet encryption failed - - - - Wallet encryption failed due to an internal error. Your wallet was not encrypted. - - - - The supplied passphrases do not match. - - - - Wallet unlock failed - - - - The passphrase entered for the wallet decryption was incorrect. - - - - Wallet decryption failed - - - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - - - Synchronizing with network... - - - - &Overview - - - - Node - - - - Show general overview of wallet - - - - &Transactions - - - - Browse transaction history - - - - E&xit - - - - Quit application - - - - Show information about Bitcoin - - - - About &Qt - - - - Show information about Qt - - - - &Options... - - - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - - - Change the passphrase used for wallet encryption - - - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - - - &File - - - - &Settings - - - - &Help - - - - Tabs toolbar - - - - [testnet] - - - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - - - %n active connection(s) to Bitcoin network - - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - - - Error - - - - Warning - - - - Information - - - - Up to date - - - - Catching up... - - - - Sent transaction - - - - Incoming transaction - - - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> - - - - Wallet is <b>encrypted</b> and currently <b>locked</b> - - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - - + ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - Amount Số lượng @@ -620,1021 +56,56 @@ Address: %4 Address Địa chỉ - - Date - - - - Confirmations - - - - Confirmed - - - - Priority - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - (no label) (chưa có nhãn) - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog - - Edit Address - - - - &Label - - - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - - - &Address - - - - New receiving address - - - - New sending address - - - - Edit receiving address - - - - Edit sending address - - - - The entered address "%1" is already in the address book. - - - - The entered address "%1" is not a valid Bitcoin address. - - - - Could not unlock wallet. - - - - New key generation failed. - - - + FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - - - version - - - - Usage: - - - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - - - Error - - - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog - - Options - - - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage - - Form - - - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - - - <b>Recent transactions</b> - - - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - Bitcoin - + Amount + Số lượng - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - - - &Label: - - - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - - - Copy label - - - - Copy message - - - - Copy amount - - - + ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - Address Địa chỉ @@ -1647,33 +118,13 @@ Address: %4 Label Nhãn dữ liệu - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel - - Date - - Label Nhãn dữ liệu - - Message - - Amount Số lượng @@ -1682,832 +133,52 @@ Address: %4 (no label) (chưa có nhãn) - - (no message) - - - - (no amount) - - - + SendCoinsDialog - - Send Coins - - - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - - - Send to multiple recipients at once - - - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - - - Balance: - - - - Confirm the send action - - - - S&end - - - - Confirm send coins - - - - %1 to %2 - - - - Copy quantity - - - - Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - - - The amount to pay must be larger than 0. - - - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - (no label) (chưa có nhãn) - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry - - A&mount: - - - - Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Enter a label for this address to add it to your address book - - - - &Label: - - - - Choose previously used address - - - - This is a normal payment. - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - - - [testnet] - - - + TrafficGraphWidget - - KB/s - - - + TransactionDesc - - Open until %1 - - - - conflicted - - - - %1/offline - - - - %1/unconfirmed - - - - %1 confirmations - - - - Status - - - - , broadcast through %n node(s) - - - - Date - - - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - Amount Số lượng - - true - - - - false - - - - , has not been successfully broadcast yet - - - - Open for %n more block(s) - - - - unknown - - - + TransactionDescDialog - - Transaction details - - - - This pane shows a detailed description of the transaction - - - + TransactionTableModel - - Date - - - - Type - - Address Địa chỉ - - Amount - Số lượng - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - - - Open until %1 - - - - Confirmed (%1 confirmations) - - - - This block was not received by any other nodes and will probably not be accepted! - - - - Generated but not accepted - - - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - - - Received with - - - - Received from - - - - Sent to - - - - Payment to yourself - - - - Mined - - - - (n/a) - - - - Transaction status. Hover over this field to show number of confirmations. - - - - Date and time that the transaction was received. - - - - Type of transaction. - - - - Destination address of transaction. - - - - Amount removed from or added to balance. - - - + TransactionView - - All - - - - Today - - - - This week - - - - This month - - - - Last month - - - - This year - - - - Range... - - - - Received with - - - - Sent to - - - - To yourself - - - - Mined - - - - Other - - - - Enter address or label to search - - - - Min amount - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - Comma separated file (*.csv) Tập tin tách biệt bởi dấu phẩy (*.csv) - - Confirmed - - - - Date - - - - Type - - Label Nhãn dữ liệu @@ -2516,853 +187,20 @@ Address: %4 Address Địa chỉ - - Amount - Số lượng - - - ID - - - - Range: - - - - to - - - + + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel - - Send Coins - - - + WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - - - Options: - - - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - - - Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - - - Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - - - Done loading - - - - To use the %s option - - - - Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - - + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_vi_VN.ts b/src/qt/locale/bitcoin_vi_VN.ts index 2102729523..20ebd7b594 100644 --- a/src/qt/locale/bitcoin_vi_VN.ts +++ b/src/qt/locale/bitcoin_vi_VN.ts @@ -1,3368 +1,114 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage - - Double-click to edit address or label - - Create a new address Tạo một địa chỉ mới - - &New - - - - Copy the currently selected address to the system clipboard - - - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - - - &Delete - - - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - - - Comma separated file (*.csv) - - - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel - - Label - - - - Address - - - - (no label) - - - + AskPassphraseDialog - - Passphrase Dialog - - - - Enter passphrase - - - - New passphrase - - - - Repeat new passphrase - - - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - - - - Encrypt wallet - - - - This operation needs your wallet passphrase to unlock the wallet. - - - - Unlock wallet - - - - This operation needs your wallet passphrase to decrypt the wallet. - - - - Decrypt wallet - - - - Change passphrase - - - - Enter the old and new passphrase to the wallet. - - - - Confirm wallet encryption - - - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - - - Wallet encrypted - - - - Bitcoin 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. - - - - Wallet encryption failed - - - - Wallet encryption failed due to an internal error. Your wallet was not encrypted. - - - - The supplied passphrases do not match. - - - - Wallet unlock failed - - - - The passphrase entered for the wallet decryption was incorrect. - - - - Wallet decryption failed - - - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - - - Synchronizing with network... - - - - &Overview - - - - Node - - - - Show general overview of wallet - - - - &Transactions - - - - Browse transaction history - - - - E&xit - - - - Quit application - - - - Show information about Bitcoin - - - - About &Qt - - - - Show information about Qt - - - - &Options... - - - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - - - Change the passphrase used for wallet encryption - - - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - - - &File - - - - &Settings - - - - &Help - - - - Tabs toolbar - - - - [testnet] - - - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - - - %n active connection(s) to Bitcoin network - - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - - - Error - - - - Warning - - - - Information - - - - Up to date - - - - Catching up... - - - - Sent transaction - - - - Incoming transaction - - - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> - - - - Wallet is <b>encrypted</b> and currently <b>locked</b> - - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - - + ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - - - Amount - - - - Address - - - - Date - - - - Confirmations - - - - Confirmed - - - - Priority - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - - - (no label) - - - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog - - Edit Address - - - - &Label - - - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - - - &Address - - - - New receiving address - - - - New sending address - - - - Edit receiving address - - - - Edit sending address - - - - The entered address "%1" is already in the address book. - - - - The entered address "%1" is not a valid Bitcoin address. - - - - Could not unlock wallet. - - - - New key generation failed. - - - + FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - - - version - - - - Usage: - - - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - - - Error - - - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog - - Options - - - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage - - Form - - - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - - - <b>Recent transactions</b> - - - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - - Bitcoin - - - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - - - &Label: - - - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - - - Copy label - - - - Copy message - - - - Copy amount - - - + ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - - - Address - - - - Amount - - - - Label - - - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel - - Date - - - - Label - - - - Message - - - - Amount - - - - (no label) - - - - (no message) - - - - (no amount) - - - + SendCoinsDialog - - Send Coins - - - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - - - Send to multiple recipients at once - - - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - - - Balance: - - - - Confirm the send action - - - - S&end - - - - Confirm send coins - - - - %1 to %2 - - - - Copy quantity - - - - Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - - - The amount to pay must be larger than 0. - - - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - - - (no label) - - - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry - - A&mount: - - - - Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Enter a label for this address to add it to your address book - - - - &Label: - - - - Choose previously used address - - - - This is a normal payment. - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - - - [testnet] - - - + TrafficGraphWidget - - KB/s - - - + TransactionDesc - - Open until %1 - - - - conflicted - - - - %1/offline - - - - %1/unconfirmed - - - - %1 confirmations - - - - Status - - - - , broadcast through %n node(s) - - - - Date - - - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - - - Amount - - - - true - - - - false - - - - , has not been successfully broadcast yet - - - - Open for %n more block(s) - - - - unknown - - - + TransactionDescDialog - - Transaction details - - - - This pane shows a detailed description of the transaction - - - + TransactionTableModel - - Date - - - - Type - - - - Address - - - - Amount - - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - - - Open until %1 - - - - Confirmed (%1 confirmations) - - - - This block was not received by any other nodes and will probably not be accepted! - - - - Generated but not accepted - - - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - - - Received with - - - - Received from - - - - Sent to - - - - Payment to yourself - - - - Mined - - - - (n/a) - - - - Transaction status. Hover over this field to show number of confirmations. - - - - Date and time that the transaction was received. - - - - Type of transaction. - - - - Destination address of transaction. - - - - Amount removed from or added to balance. - - - + TransactionView - - All - - - - Today - - - - This week - - - - This month - - - - Last month - - - - This year - - - - Range... - - - - Received with - - - - Sent to - - - - To yourself - - - - Mined - - - - Other - - - - Enter address or label to search - - - - Min amount - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - - - Comma separated file (*.csv) - - - - Confirmed - - - - Date - - - - Type - - - - Label - - - - Address - - - - Amount - - - - ID - - - - Range: - - - - to - - - + + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel - - Send Coins - - - + WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - - - Options: - - - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - - - Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - - - Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - - - Done loading - - - - To use the %s option - - - - Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - - + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_zh_CN.ts b/src/qt/locale/bitcoin_zh_CN.ts index b87d27fe12..cd0caf53a1 100644 --- a/src/qt/locale/bitcoin_zh_CN.ts +++ b/src/qt/locale/bitcoin_zh_CN.ts @@ -1,41 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - 关于比特币核心 - - - <b>Bitcoin Core</b> version - <b>比特币核心</b> 版本 - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - Copyright - 版权 - - - The Bitcoin Core developers - Bitcoin Core 的开发者 - - - (%1-bit) - (%1 位) - - + AddressBookPage @@ -131,8 +94,8 @@ This product includes software developed by the OpenSSL Project for use in the O 导出失败 - There was an error trying to save the address list to %1. - 地址列表保存至 %1 时发生错误。 + There was an error trying to save the address list to %1. Please try again. + 保存地址列表出现 %1错误。请重试。 @@ -168,13 +131,9 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase 重复新密码 - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - 输入钱包的新密码。<br/>使用的密码请至少包含<b>10个以上随机字符</>,或者是<b>8个以上的单词</b>。 - Encrypt wallet - 加密钱包 + 钱包加密 This operation needs your wallet passphrase to unlock the wallet. @@ -295,10 +254,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application 退出程序 - - Show information about Bitcoin - 显示比特币的相关信息 - About &Qt 关于 &Qt @@ -335,6 +290,10 @@ This product includes software developed by the OpenSSL Project for use in the O Open &URI... 打开 &URI... + + Bitcoin Core client + 比特币核心钱包 + Importing blocks from disk... 正在从磁盘导入数据块... @@ -387,6 +346,10 @@ This product includes software developed by the OpenSSL Project for use in the O &Receive 接收(&R) + + Show information about Bitcoin Core + 显示有关比特币核心钱包信息 + &Show / Hide 显示 / 隐藏(&S) @@ -459,37 +422,29 @@ This product includes software developed by the OpenSSL Project for use in the O Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options 显示比特币核心 程序帮助信息,获取可用的命令行选项 - - Bitcoin client - 比特币客户端 - %n active connection(s) to Bitcoin network - %n条到比特币网络的活动连接 + %n 个到比特币网络的活动连接 No block source available... 沒有可用的区块来源... - - Processed %1 of %2 (estimated) blocks of transaction history. - %1 / %2 个交易历史的区块已下载 - Processed %1 blocks of transaction history. 已处理 %1 个交易历史数据块。 %n hour(s) - %n 小时前 + %n 小时 %n day(s) - %n 天前 + %n 天 %n week(s) - %n 周前 + %n 周 %1 and %2 @@ -559,10 +514,6 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> 钱包已被<b>加密</b>,当前为<b>锁定</b>状态 - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - 发生严重错误。 - ClientModel @@ -598,8 +549,8 @@ Address: %4 费用: - Low Output: - 低输出 + Dust: + 小额: After Fee: @@ -690,8 +641,8 @@ Address: %4 复制优先级 - Copy low output - 复制低输出 + Copy dust + 复制小额 Copy change @@ -741,10 +692,6 @@ Address: %4 none - - Dust - 尘埃交易 - yes @@ -770,25 +717,13 @@ Address: %4 交易的优先级越高,被矿工收入数据块的速度也越快。 - This label turns red, if the priority is smaller than "medium". - 如果优先级小于"中位数" ,标签将变成红色。 + This label turns red, if the priority is smaller than "medium". + 如果优先级小于"中位数" ,标签将变成红色。 This label turns red, if any recipient receives an amount smaller than %1. 如果收款地址收到小于%1的比特币,标签将变成红色。 - - This means a fee of at least %1 is required. - 这意味着至少需要 %1的交易费。 - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - 小于最小转发交易费的0.546倍的 转账金额将被视为 尘埃交易。 - - - This label turns red, if the change is smaller than %1. - 如果零钱小于 %1,标签将变成红色。 - (no label) (没有标签) @@ -841,11 +776,11 @@ Address: %4 编辑发送地址 - The entered address "%1" is already in the address book. + The entered address "%1" is already in the address book. 输入的地址“%1”已经存在于地址簿中。 - The entered address "%1" is not a valid Bitcoin address. + The entered address "%1" is not a valid Bitcoin address. 您输入的“%1”不是有效的比特币地址。 @@ -882,10 +817,6 @@ Address: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - 比特币核心程序 - 命令行选项 - Bitcoin Core 比特币核心 @@ -894,6 +825,18 @@ Address: %4 version 版本 + + (%1-bit) + (%1 位) + + + About Bitcoin Core + 关于比特币核心 + + + Command-line options + 命令行选项 + Usage: 使用: @@ -907,7 +850,7 @@ Address: %4 UI选项 - Set language, for example "de_DE" (default: system locale) + Set language, for example "de_DE" (default: system locale) 设置语言, 例如“zh-TW”(默认为系统语言) @@ -955,12 +898,8 @@ Address: %4 使用自定义的数据目录: - Bitcoin - 比特币 - - - Error: Specified data directory "%1" can not be created. - 错误:指定的数据目录“%1”无法创建。 + Bitcoin Core + 比特币核心 Error @@ -1036,6 +975,14 @@ Address: %4 Number of script &verification threads 脚本&验证 进程数 + + Accept connections from outside + 接收外部连接 + + + Allow incoming connections + 允许流入连接 + Connect to the Bitcoin network through a SOCKS proxy. 通过 SOCKS 代理连接到比特币网络。 @@ -1116,14 +1063,6 @@ Address: %4 Port of the proxy (e.g. 9050) 代理端口(例如 9050) - - SOCKS &Version: - Socks 版本(&V): - - - SOCKS version of the proxy (e.g. 5) - Socks 代理版本(例如 5) - &Window 窗口(&W) @@ -1164,14 +1103,6 @@ Address: %4 Choose the default subdivision unit to show in the interface and when sending coins. 选择比特币单位。 - - Whether to show Bitcoin addresses in the transaction list or not. - 是否需要在交易清单中显示比特币地址。 - - - &Display addresses in transaction list - 在交易清单中显示比特币地址(&D) - Whether to show coin control features or not. 是否需要交易源地址控制功能。 @@ -1227,6 +1158,10 @@ Address: %4 Wallet 钱包 + + Watch-only: + 查看-只有: + Available: 可使用的余额: @@ -1275,8 +1210,20 @@ Address: %4 URI 处理 - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI无法解析!原因可能是比特币地址不正确,或者URI参数错误。 + Invalid payment address %1 + 无效的付款地址 %1 + + + Payment request rejected + 支付请求被拒绝 + + + Payment request has expired. + 支付请求已超时 + + + Payment request is not initialized. + 支付请求未成形。 Requested payment amount of %1 is too small (considered dust). @@ -1290,14 +1237,6 @@ Address: %4 Cannot start bitcoin: click-to-pay handler 暂时无法启动比特币:点击支付功能 - - Net manager warning - 网络管理器警告 - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - 您的活动代理不支持 SOCKS5,而通过代理进行支付请求时这是必须的。 - Payment request fetch URL is invalid: %1 付款请求URI链接非法: %1 @@ -1306,10 +1245,6 @@ Address: %4 Payment request file handling 付款请求文件处理 - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - 付款请求文件不能读取或无法识别!这可能是个不合格的付款请求文件。 - Unverified payment requests to custom payment scripts are unsupported. 不支持到自定义付款脚本的未验证付款请求。 @@ -1322,10 +1257,6 @@ Address: %4 Error communicating with %1: %2 %1: %2 通讯出错 - - Payment request can not be parsed or processed! - 支付请求不能被解析或处理! - Bad response from server %1 来自 %1 服务器的错误响应 @@ -1339,31 +1270,66 @@ Address: %4 网络请求出错 + + PeerTableModel + + User Agent + 用户代理 + + + Address/Hostname + 地址/主机名 + + + Ping Time + Ping 时间 + + QObject - Bitcoin - 比特币 + Amount + 金额 - Error: Specified data directory "%1" does not exist. - 错误:指定的数据目录“%1”不存在。 + Enter a Bitcoin address (e.g. %1) + 请输入一个比特币地址 (例如 %1) - Error: Cannot parse configuration file: %1. Only use key=value syntax. - 错误: 无法解析配置文件: %1. 只有钥匙=重要的私匙. + %1 d + %1 天 - Error: Invalid combination of -regtest and -testnet. - 错误:无效的 -regtest 与 -testnet 结合体。 + %1 h + %1 小时 - Bitcoin Core didn't yet exit safely... - 比特币核心钱包没有安全退出.... + %1 m + %1 分钟 - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - 请输入比特币地址(例如: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + %1 s + %1 秒 + + + NETWORK + 网络 + + + UNKNOWN + 未知 + + + None + + + + N/A + 不可用 + + + %1 ms + %1 毫秒 @@ -1401,7 +1367,7 @@ Address: %4 &Information - 信息(&I) + 信息 Debug window @@ -1415,6 +1381,10 @@ Address: %4 Using OpenSSL version 使用 OpenSSL 版本 + + Using BerkeleyDB version + 使用的 BerkeleyDB 版本 + Startup time 启动时间 @@ -1440,8 +1410,72 @@ Address: %4 当前数据块数量 - Estimated total blocks - 预计数据块数量 + Received + 收到 + + + Sent + 发送 + + + &Peers + &同类 + + + Direction + 方向 + + + Version + 版本 + + + User Agent + 用户代理 + + + Services + 服务 + + + Sync Node + 同步节点 + + + Starting Height + 开始高度 + + + Sync Height + 同步高度 + + + Ban Score + 禁止得分 + + + Connection Time + 连接时间 + + + Last Send + 最后发送 + + + Last Receive + 最后接收 + + + Bytes Sent + 发送字节 + + + Bytes Received + 接收字节 + + + Ping Time + Ping 时间 Last block time @@ -1520,16 +1554,36 @@ Address: %4 %1 GB - %1 m - %1 分钟 + via %1 + 通过 %1 - %1 h - %1 小时 + never + 从未 - %1 h %2 m - %1 小时 %2 分钟 + Inbound + 传入 + + + Outbound + 传出 + + + Yes + + + + No + + + + Unknown + 未知 + + + Fetching... + 获取中... @@ -1572,7 +1626,7 @@ Address: %4 Clear all fields of the form. - 清空此表单的所有字段。 + 清除此表单的所有字段。 Clear @@ -1705,7 +1759,7 @@ Address: %4 SendCoinsDialog Send Coins - 发送货币 + 发送比特币 Coin Control Features @@ -1743,10 +1797,6 @@ Address: %4 Fee: 费用: - - Low Output: - 低输出 - After Fee: 加上交易费用后: @@ -1775,6 +1825,10 @@ Address: %4 Clear all fields of the form. 清除此表单的所有字段。 + + Dust: + 小额: + Clear &All 清除所有(&A) @@ -1823,10 +1877,6 @@ Address: %4 Copy priority 复制优先级 - - Copy low output - 复制低输出 - Copy change 复制零钱 @@ -1879,6 +1929,10 @@ Address: %4 Warning: Unknown change address 警告:未知的更改地址 + + Copy dust + 复制小额 + Are you sure you want to send? 您确定要发出吗? @@ -1887,14 +1941,6 @@ Address: %4 added as transaction fee 已添加交易费 - - Payment request expired - 支付请求已过期 - - - Invalid payment address %1 - 无效的付款地址 %1 - SendCoinsEntry @@ -1906,10 +1952,6 @@ Address: %4 Pay &To: 付给(&T): - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - 付款给这个地址 (例如 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book 为这个地址输入一个标签,以便将它添加到您的地址簿 @@ -1996,10 +2038,6 @@ Address: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. 您可以用你的地址对消息进行签名,以证明您是该地址的所有人。注意不要对模棱两可的消息签名,以免遭受钓鱼式攻击。请确保消息内容准确的表达了您的真实意愿。 - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - 用于签名消息的地址(例如: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Choose previously used address 选择以前用过的地址 @@ -2052,10 +2090,6 @@ Address: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. 在下面输入签名地址,消息(请确保换行符、空格符、制表符等等一个不漏)和签名以验证消息。请确保签名信息准确,提防中间人攻击。 - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - 用于签名消息的地址(例如: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Verify the message to ensure it was signed with the specified Bitcoin address 验证消息,确保消息是由指定的比特币地址签名过的。 @@ -2069,11 +2103,7 @@ Address: %4 清空所有验证消息栏 - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - 请输入比特币地址 (例如: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature + Click "Sign Message" to generate signature 单击“签名消息“产生签名。 @@ -2137,7 +2167,7 @@ Address: %4 [testnet] - [testnet] + [测试网络] @@ -2173,10 +2203,6 @@ Address: %4 Status 状态 - - , broadcast through %n node(s) - 通过 %n 个节点广播 - Date 日期 @@ -2209,10 +2235,6 @@ Address: %4 Credit 收入 - - matures in %n more block(s) - 将在 %n 个数据块后成熟 - not accepted 未被接受 @@ -2239,14 +2261,14 @@ Address: %4 Transaction ID - 交易ID + ID Merchant 商店 - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. 生成的比特币在可以使用前必须有 %1 个成熟的区块。当您生成了此区块后,它将被广播到网络中以加入区块链。如果它未成功进入区块链,其状态将变更为“不接受”并且不可使用。这可能偶尔会发生,如果另一个节点比你早几秒钟成功生成一个区块。 @@ -2277,10 +2299,6 @@ Address: %4 , has not been successfully broadcast yet ,未被成功广播 - - Open for %n more block(s) - Open for %n more block - unknown 未知 @@ -2305,24 +2323,16 @@ Address: %4 Type - 类型 + 类别 Address 地址 - - Amount - 数量 - Immature (%1 confirmations, will be available after %2) 未成熟 (%1 个确认,将在 %2 个后可用) - - Open for %n more block(s) - Open for %n more block - Open until %1 至 %1 个数据块时开启 @@ -2526,10 +2536,6 @@ Address: %4 Address 地址 - - Amount - 金额 - ID ID @@ -2543,6 +2549,9 @@ Address: %4 + + UnitDisplayStatusBarControl + WalletFrame @@ -2594,20 +2603,6 @@ Address: %4 bitcoin-core - - Usage: - 使用: - - - List commands - 列出命令 - - - - Get help for a command - 获得某条命令的帮助 - - Options: 选项: @@ -2652,10 +2647,6 @@ Address: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) 重新连接异常节点的秒数(缺省: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - 设置RPC监听端口%u时发生错误, IPv4:%s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) JSON-RPC连接监听端口<port> (缺省:8332 testnet:18332) @@ -2665,10 +2656,6 @@ Address: %4 接受命令行和 JSON-RPC 命令 - - Bitcoin Core RPC client version - 比特币核心钱包RPC客户端版本 - Run in the background as a daemon and accept commands 在后台运行并接受命令 @@ -2694,7 +2681,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, 您必须在配置文件设置rpcpassword: %s @@ -2705,17 +2692,13 @@ rpcpassword=%s 用户名和密码 必! 须! 不一样。 如果配置文件不存在,请自行建立一个只有所有者拥有只读权限的文件。 推荐您开启提示通知以便收到错误通知, -像这样: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +像这样: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) 可接受的密码(默认:TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - 在IPv6模式下设置RPC监听端口 %u 失败,返回到IPv4模式: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 绑定指定的IP地址开始监听。IPv6地址请使用[host]:port 格式 @@ -2724,18 +2707,10 @@ rpcpassword=%s Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) 自由交易不断的速率限制为<n>*1000 字节每分钟(默认值:15) - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - 进入回归测试模式,它采用一种特殊的可立即解决的区块链模拟情况。这是为了回归测试工具和应用的开发所设。 - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. 进入回归测试模式,它采用一种特殊的可立即解决的区块链模拟情况。 - - Error: Listening for incoming connections failed (listen returned error %d) - 错误: 监听接收连接失败 (监听错误 %d) - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. 错误:该交易被拒绝!发生这种错误的原因可能是:钱包中的比特币已经被用掉,有可能您复制了wallet.dat钱包文件,然后用复制的钱包文件支付了比特币,但是这个钱包文件中没有记录。 @@ -2748,10 +2723,6 @@ rpcpassword=%s Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) 当最佳区块变化时执行命令 (命令行中的 %s 会被替换成区块哈希值) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - 比这手续费更小的被认为零手续费 (交易产生) (默认: - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) 从缓冲池清理磁盘数据库活动日志每<n>兆字节 (默认值: 100) @@ -2788,10 +2759,6 @@ rpcpassword=%s Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. 警告:-paytxfee 交易费设置得太高了!每笔交易都将支付交易费。 - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - 警告:请检查电脑的日期时间设置是否正确!时间错误可能会导致比特币客户端运行异常。 - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. 警告:网络似乎并不完全同意!有些矿工似乎遇到了问题。 @@ -2824,30 +2791,14 @@ rpcpassword=%s Attempt to recover private keys from a corrupt wallet.dat 尝试从损坏的钱包文件wallet.dat中恢复私钥 - - Bitcoin Core Daemon - 比特币核心 守护程序 - Block creation options: 数据块创建选项: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - 清除钱包中的交易记录 (诊断用,意味着需要重新扫描 -rescan) - Connect only to the specified node(s) 仅连接到指定节点 - - Connect through SOCKS proxy - 通过Socks代理连接: - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - 连接到 JSON-RPC 于 <port>(默认: 8332,或测试网络: 18332) - Connection options: 连接选项: @@ -2948,18 +2899,6 @@ rpcpassword=%s Failed to write undo data 无法写入回滚信息 - - Fee per kB to add to transactions you send - 为付款交易支付比特币(每kb) - - - Fees smaller than this are considered zero fee (for relaying) (default: - 比这手续费更小的被认为零手续费 (中继) (默认值: - - - Find peers using DNS lookup (default: 1 unless -connect) - 通过DNS查找节点(缺省:1 除非使用 -connect 选项) - Force safe mode (default: 0) 强制安全模式(默认值: 0) @@ -2985,7 +2924,7 @@ rpcpassword=%s 不正确或没有找到起源区块。网络错误? - Invalid -onion address: '%s' + Invalid -onion address: '%s' 无效的 -onion 地址:“%s” @@ -2996,18 +2935,10 @@ rpcpassword=%s Prepend debug output with timestamp (default: 1) 调试信息输出时,前面加上时间戳 (缺省: 1) - - RPC client options: - RPC 客户端选项: - Rebuild block chain index from current blk000??.dat files 重新为当前的blk000??.dat文件建立索引 - - Select SOCKS version for -proxy (4 or 5, default: 5) - 用 -proxy 选择 SOCKS 版本(4 或 5,默认为 5) - Set database cache size in megabytes (%d to %d, default: %d) 设置以MB为单位的数据库缓存大小(%d 到 %d, 默认值: %d) @@ -3032,10 +2963,6 @@ rpcpassword=%s This is intended for regression testing tools and app development. 这是用于回归测试和应用开发目的。 - - Usage (deprecated, use bitcoin-cli): - 用法(不推荐,请使用 bitcoin-cli): - Verifying blocks... 正在验证数据库的完整性... @@ -3044,10 +2971,6 @@ rpcpassword=%s Verifying wallet... 正在检测钱包的完整性... - - Wait for RPC server to start - 等待 RPC 服务器 - Wallet %s resides outside data directory %s 钱包 %s 在外部的数据目录 %s @@ -3056,10 +2979,6 @@ rpcpassword=%s Wallet options: 钱包选项: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - 警告:已废弃的 -debugnet 参数已忽略,请用 -debug=net - You need to rebuild the database using -reindex to change -txindex 您需要将 -reindex 改为 -txindex 以重建数据库 @@ -3080,21 +2999,69 @@ rpcpassword=%s Output debugging information (default: 0, supplying <category> is optional) 输出调试信息(默认为0,提供 <category> 是可选的) + + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) + 通过DNS查询每个地址,如果短地址 (默认值: 1 除非 -连接) + Set maximum size of high-priority/low-fee transactions in bytes (default: %d) 设置 高优先级/低交易费 交易的最大字节 (缺省: %d) + + Always query for peer addresses via DNS lookup (default: 0) + 始终通过 DNS 查询对等端地址 (默认: 0) + + + Cannot resolve -whitebind address: '%s' + 无法解析 -whitebind 地址: '%s' + + + Connect through SOCKS5 proxy + 通过 SOCKS5 代理连接 + + + Copyright (C) 2009-%i The Bitcoin Core Developers + 版权所有 (C) 2009-%i Bitcoin Core 开发者 + + + Could not parse -rpcbind value %s as network address + 无法解析 -rpcbind 的值 %s 为网络地址 + + + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core + 加载wallet.dat错误:需要新版的比特币核心钱包 + + + Error: Unsupported argument -tor found, use -onion. + 错误:发现了不支持的参数 -tor,请使用 -onion。 + + + Include IP addresses in debug output (default: 0) + 在调试输出中包含IP地址 (默认: 0) + Information 信息 - Invalid amount for -minrelaytxfee=<amount>: '%s' - -minrelaytxfee=<amount>: '%s' 无效的金额 + Initialization sanity check failed. Bitcoin Core is shutting down. + 初始化完整性检查失败。Bitcoin Core 即将关闭。 - Invalid amount for -mintxfee=<amount>: '%s' - -mintxfee=<amount>: '%s' 无效的金额 + Invalid amount for -minrelaytxfee=<amount>: '%s' + -minrelaytxfee=<amount>: '%s' 无效的金额 + + + Invalid amount for -mintxfee=<amount>: '%s' + -mintxfee=<amount>: '%s' 无效的金额 + + + Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) + 无效的金额 -paytxfee=<amount>: '%s' (必须至少为 %s) + + + Invalid netmask specified in -whitelist: '%s' + -whitelist: '%s' 指定的网络掩码无效 Limit size of signature cache to <n> entries (default: 50000) @@ -3116,6 +3083,14 @@ rpcpassword=%s Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) 每个连接的最大发送缓存,<n>*1000 字节(缺省:1000) + + Need to specify a port with -whitebind: '%s' + -whitebind: '%s' 需要指定一个端口 + + + Node relay options: + 节点中继选项: + Only accept block chain matching built-in checkpoints (default: 1) 仅接受符合客户端检查点设置的数据块文件 @@ -3148,18 +3123,14 @@ rpcpassword=%s Randomly fuzz 1 of every <n> network messages 随机每1个模拟测试<n>网络信息 + + Relay non-P2SH multisig (default: 1) + 中转non-P2SH multisig (默认值: 1) + Run a thread to flush wallet periodically (default: 1) 运行一个程序,定时清理钱包 (默认值:1) - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL选项:(参见Bitcoin Wiki关于SSL设置栏目) - - - Send command to Bitcoin Core - 发送指令到比特币核心钱包 - Send trace/debug info to console instead of debug.log file 跟踪/调试信息输出到控制台,不输出到 debug.log 文件 @@ -3176,10 +3147,6 @@ rpcpassword=%s Show all debugging options (usage: --help -help-debug) 显示所有调试选项 (用法: --帮助 -帮助调试) - - Show benchmark information (default: 0) - 显示标准信息 (默认值: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) 客户端启动时压缩debug.log文件(缺省:no-debug模式时为1) @@ -3192,14 +3159,14 @@ rpcpassword=%s Specify connection timeout in milliseconds (default: 5000) 设置连接超时时间(缺省:5000毫秒) - - Start Bitcoin Core Daemon - 开启比特币核心钱包守护进程 - System error: 系统错误: + + This is experimental software. + 这是实验性的软件。 + Transaction amount too small 交易量太小 @@ -3212,6 +3179,10 @@ rpcpassword=%s Transaction too large 交易太大 + + Unable to bind to %s on this computer (bind returned error %s) + 无法在此计算机上绑定 %s (绑定返回错误 %s) + Use UPnP to map the listening port (default: 0) 使用UPnP映射监听端口 (缺省: 0) @@ -3224,6 +3195,10 @@ rpcpassword=%s Username for JSON-RPC connections JSON-RPC 连接用户名 + + Wallet needed to be rewritten: restart Bitcoin Core to complete + 钱包需要被改写:重新启动核心钱包来完成 + Warning 警告 @@ -3232,6 +3207,14 @@ rpcpassword=%s Warning: This version is obsolete, upgrade required! 警告:该软件版本已过时,请升级! + + Warning: Unsupported argument -benchmark ignored, use -debug=bench. + 警告:不支持的参数 -benchmark 已忽略,请使用 -debug=bench。 + + + Warning: Unsupported argument -debugnet ignored, use -debug=net. + 警告:不支持的参数 -debugnet 已忽略,请使用 -debug=net。 + Zapping all transactions from wallet... Zapping all transactions from wallet... @@ -3240,10 +3223,6 @@ rpcpassword=%s on startup 启动中 - - version - 版本 - wallet.dat corrupt, salvage failed 钱包文件wallet.dat损坏,抢救备份失败 @@ -3253,14 +3232,6 @@ rpcpassword=%s JSON-RPC 连接密码 - - Allow JSON-RPC connections from specified IP address - 允许从指定IP接受到的 JSON-RPC 连接 - - - Send commands to node running on <ip> (default: 127.0.0.1) - 向IP地址为 <ip> 的节点发送指令 (缺省: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) 当最佳数据块变化时执行命令 (命令行中的 %s 会被替换成数据块哈希值) @@ -3297,10 +3268,6 @@ rpcpassword=%s 本帮助信息 - - Unable to bind to %s on this computer (bind returned error %d, %s) - 无法绑定本机端口 %s (返回错误消息 %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect 使用 -addnode, -seednode 和 -connect 选项时允许查询DNS @@ -3313,41 +3280,29 @@ rpcpassword=%s Error loading wallet.dat: Wallet corrupted wallet.dat 钱包文件加载出错:钱包损坏 - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - wallet.dat 钱包文件加载错误:请升级到最新版Bitcoin客户端 - - - Wallet needed to be rewritten: restart Bitcoin to complete - 钱包文件需要被重写:请退出并重新启动Bitcoin客户端 - Error loading wallet.dat wallet.dat 钱包文件加载出错 - Invalid -proxy address: '%s' + Invalid -proxy address: '%s' 无效的代理地址:%s - Unknown network specified in -onlynet: '%s' + Unknown network specified in -onlynet: '%s' -onlynet 指定的是未知网络:%s - Unknown -socks proxy version requested: %i - 被指定的是未知socks代理版本: %i + Cannot resolve -bind address: '%s' + 无法解析 -bind 端口地址: '%s' - Cannot resolve -bind address: '%s' - 无法解析 -bind 端口地址: '%s' + Cannot resolve -externalip address: '%s' + 无法解析 -externalip 地址: '%s' - Cannot resolve -externalip address: '%s' - 无法解析 -externalip 地址: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - 非法金额 -paytxfee=<amount>: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + 非法金额 -paytxfee=<amount>: '%s' Invalid amount @@ -3393,13 +3348,5 @@ rpcpassword=%s Error 错误 - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - 您必须在配置文件中加入选项 rpcpassword : - %s -如果配置文件不存在,请新建,并将文件权限设置为仅允许文件所有者读取. - \ No newline at end of file diff --git a/src/qt/locale/bitcoin_zh_HK.ts b/src/qt/locale/bitcoin_zh_HK.ts index 835d0134d6..dfdbb7d1da 100644 --- a/src/qt/locale/bitcoin_zh_HK.ts +++ b/src/qt/locale/bitcoin_zh_HK.ts @@ -1,3368 +1,110 @@ - - - AboutDialog - - About Bitcoin Core - - - - <b>Bitcoin Core</b> version - - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - - - - Copyright - - - - The Bitcoin Core developers - - - - (%1-bit) - - - + AddressBookPage - - Double-click to edit address or label - - - - Create a new address - - - - &New - - - - Copy the currently selected address to the system clipboard - - - - &Copy - - - - C&lose - - - - &Copy Address - - - - Delete the currently selected address from the list - - - - Export the data in the current tab to a file - - - - &Export - - - - &Delete - - - - Choose the address to send coins to - - - - Choose the address to receive coins with - - - - C&hoose - - - - Sending addresses - - - - Receiving addresses - - - - These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - - - - These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - - - - Copy &Label - - - - &Edit - - - - Export Address List - - - - Comma separated file (*.csv) - - - - Exporting Failed - - - - There was an error trying to save the address list to %1. - - - + AddressTableModel - - Label - - - - Address - - - - (no label) - - - + AskPassphraseDialog - - Passphrase Dialog - - - - Enter passphrase - - - - New passphrase - - - - Repeat new passphrase - - - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - - - - Encrypt wallet - - - - This operation needs your wallet passphrase to unlock the wallet. - - - - Unlock wallet - - - - This operation needs your wallet passphrase to decrypt the wallet. - - - - Decrypt wallet - - - - Change passphrase - - - - Enter the old and new passphrase to the wallet. - - - - Confirm wallet encryption - - - - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - - - - Are you sure you wish to encrypt your wallet? - - - - 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. - - - - Warning: The Caps Lock key is on! - - - - Wallet encrypted - - - - Bitcoin 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. - - - - Wallet encryption failed - - - - Wallet encryption failed due to an internal error. Your wallet was not encrypted. - - - - The supplied passphrases do not match. - - - - Wallet unlock failed - - - - The passphrase entered for the wallet decryption was incorrect. - - - - Wallet decryption failed - - - - Wallet passphrase was successfully changed. - - - + BitcoinGUI - - Sign &message... - - - - Synchronizing with network... - - - - &Overview - - - - Node - - - - Show general overview of wallet - - - - &Transactions - - - - Browse transaction history - - - - E&xit - - - - Quit application - - - - Show information about Bitcoin - - - - About &Qt - - - - Show information about Qt - - - - &Options... - - - - &Encrypt Wallet... - - - - &Backup Wallet... - - - - &Change Passphrase... - - - - &Sending addresses... - - - - &Receiving addresses... - - - - Open &URI... - - - - Importing blocks from disk... - - - - Reindexing blocks on disk... - - - - Send coins to a Bitcoin address - - - - Modify configuration options for Bitcoin - - - - Backup wallet to another location - - - - Change the passphrase used for wallet encryption - - - - &Debug window - - - - Open debugging and diagnostic console - - - - &Verify message... - - - - Bitcoin - - - - Wallet - - - - &Send - - - - &Receive - - - - &Show / Hide - - - - Show or hide the main Window - - - - Encrypt the private keys that belong to your wallet - - - - Sign messages with your Bitcoin addresses to prove you own them - - - - Verify messages to ensure they were signed with specified Bitcoin addresses - - - - &File - - - - &Settings - - - - &Help - - - - Tabs toolbar - - - - [testnet] - - - - Bitcoin Core - - - - Request payments (generates QR codes and bitcoin: URIs) - - - - &About Bitcoin Core - - - - Show the list of used sending addresses and labels - - - - Show the list of used receiving addresses and labels - - - - Open a bitcoin: URI or payment request - - - - &Command-line options - - - - Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - - - - Bitcoin client - - - - %n active connection(s) to Bitcoin network - - - - No block source available... - - - - Processed %1 of %2 (estimated) blocks of transaction history. - - - - Processed %1 blocks of transaction history. - - - - %n hour(s) - - - - %n day(s) - - - - %n week(s) - - - - %1 and %2 - - - - %n year(s) - - - - %1 behind - - - - Last received block was generated %1 ago. - - - - Transactions after this will not yet be visible. - - - - Error - - - - Warning - - - - Information - - - - Up to date - - - - Catching up... - - - - Sent transaction - - - - Incoming transaction - - - - Date: %1 -Amount: %2 -Type: %3 -Address: %4 - - - - - Wallet is <b>encrypted</b> and currently <b>unlocked</b> - - - - Wallet is <b>encrypted</b> and currently <b>locked</b> - - - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - - - + ClientModel - - Network Alert - - - + CoinControlDialog - - Coin Control Address Selection - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - (un)select all - - - - Tree mode - - - - List mode - - - - Amount - - - - Address - - - - Date - - - - Confirmations - - - - Confirmed - - - - Priority - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Lock unspent - - - - Unlock unspent - - - - Copy quantity - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - highest - - - - higher - - - - high - - - - medium-high - - - - medium - - - - low-medium - - - - low - - - - lower - - - - lowest - - - - (%1 locked) - - - - none - - - - Dust - - - - yes - - - - no - - - - This label turns red, if the transaction size is greater than 1000 bytes. - - - - This means a fee of at least %1 per kB is required. - - - - Can vary +/- 1 byte per input. - - - - Transactions with higher priority are more likely to get included into a block. - - - - This label turns red, if the priority is smaller than "medium". - - - - This label turns red, if any recipient receives an amount smaller than %1. - - - - This means a fee of at least %1 is required. - - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - - - - This label turns red, if the change is smaller than %1. - - - - (no label) - - - - change from %1 (%2) - - - - (change) - - - + EditAddressDialog - - Edit Address - - - - &Label - - - - The label associated with this address list entry - - - - The address associated with this address list entry. This can only be modified for sending addresses. - - - - &Address - - - - New receiving address - - - - New sending address - - - - Edit receiving address - - - - Edit sending address - - - - The entered address "%1" is already in the address book. - - - - The entered address "%1" is not a valid Bitcoin address. - - - - Could not unlock wallet. - - - - New key generation failed. - - - + FreespaceChecker - - A new data directory will be created. - - - - name - - - - Directory already exists. Add %1 if you intend to create a new directory here. - - - - Path already exists, and is not a directory. - - - - Cannot create data directory here. - - - + HelpMessageDialog - - Bitcoin Core - Command-line options - - - - Bitcoin Core - - - - version - - - - Usage: - - - - command-line options - - - - UI options - - - - Set language, for example "de_DE" (default: system locale) - - - - Start minimized - - - - Set SSL root certificates for payment request (default: -system-) - - - - Show splash screen on startup (default: 1) - - - - Choose data directory on startup (default: 0) - - - + Intro - - Welcome - - - - Welcome to Bitcoin Core. - - - - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - - - - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - - - - Use the default data directory - - - - Use a custom data directory: - - - - Bitcoin - - - - Error: Specified data directory "%1" can not be created. - - - - Error - - - - GB of free space available - - - - (of %1GB needed) - - - + OpenURIDialog - - Open URI - - - - Open payment request from URI or file - - - - URI: - - - - Select payment request file - - - - Select payment request file to open - - - + OptionsDialog - - Options - - - - &Main - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - - - - Automatically start Bitcoin after logging in to the system. - - - - &Start Bitcoin on system login - - - - Size of &database cache - - - - MB - - - - Number of script &verification threads - - - - Connect to the Bitcoin network through a SOCKS proxy. - - - - &Connect through SOCKS proxy (default proxy): - - - - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) - - - - Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. - - - - Third party transaction URLs - - - - Active command-line options that override above options: - - - - Reset all client options to default. - - - - &Reset Options - - - - &Network - - - - (0 = auto, <0 = leave that many cores free) - - - - W&allet - - - - Expert - - - - Enable coin &control features - - - - 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. - - - - &Spend unconfirmed change - - - - Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - - - - Map port using &UPnP - - - - Proxy &IP: - - - - &Port: - - - - Port of the proxy (e.g. 9050) - - - - SOCKS &Version: - - - - SOCKS version of the proxy (e.g. 5) - - - - &Window - - - - Show only a tray icon after minimizing the window. - - - - &Minimize to the tray instead of the taskbar - - - - Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - - - - M&inimize on close - - - - &Display - - - - User Interface &language: - - - - The user interface language can be set here. This setting will take effect after restarting Bitcoin. - - - - &Unit to show amounts in: - - - - Choose the default subdivision unit to show in the interface and when sending coins. - - - - Whether to show Bitcoin addresses in the transaction list or not. - - - - &Display addresses in transaction list - - - - Whether to show coin control features or not. - - - - &OK - - - - &Cancel - - - - default - - - - none - - - - Confirm options reset - - - - Client restart required to activate changes. - - - - Client will be shutdown, do you want to proceed? - - - - This change would require a client restart. - - - - The supplied proxy address is invalid. - - - + OverviewPage - - Form - - - - The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - - - Wallet - - - - Available: - - - - Your current spendable balance - - - - Pending: - - - - Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - - - - Immature: - - - - Mined balance that has not yet matured - - - - Total: - - - - Your current total balance - - - - <b>Recent transactions</b> - - - - out of sync - - - + PaymentServer - - URI handling - - - - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - - - - Requested payment amount of %1 is too small (considered dust). - - - - Payment request error - - - - Cannot start bitcoin: click-to-pay handler - - - - Net manager warning - - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - - - - Payment request fetch URL is invalid: %1 - - - - Payment request file handling - - - - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - - - - Unverified payment requests to custom payment scripts are unsupported. - - - - Refund from %1 - - - - Error communicating with %1: %2 - - - - Payment request can not be parsed or processed! - - - - Bad response from server %1 - - - - Payment acknowledged - - - - Network request error - - - + + + PeerTableModel + QObject - - Bitcoin - - - - Error: Specified data directory "%1" does not exist. - - - - Error: Cannot parse configuration file: %1. Only use key=value syntax. - - - - Error: Invalid combination of -regtest and -testnet. - - - - Bitcoin Core didn't yet exit safely... - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - + QRImageWidget - - &Save Image... - - - - &Copy Image - - - - Save QR Code - - - - PNG Image (*.png) - - - + RPCConsole - - Client name - - - - N/A - - - - Client version - - - - &Information - - - - Debug window - - - - General - - - - Using OpenSSL version - - - - Startup time - - - - Network - - - - Name - - - - Number of connections - - - - Block chain - - - - Current number of blocks - - - - Estimated total blocks - - - - Last block time - - - - &Open - - - - &Console - - - - &Network Traffic - - - - &Clear - - - - Totals - - - - In: - - - - Out: - - - - Build date - - - - Debug log file - - - - Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - - - - Clear console - - - - Welcome to the Bitcoin RPC console. - - - - Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - - - - Type <b>help</b> for an overview of available commands. - - - - %1 B - - - - %1 KB - - - - %1 MB - - - - %1 GB - - - - %1 m - - - - %1 h - - - - %1 h %2 m - - - + ReceiveCoinsDialog - - &Amount: - - - - &Label: - - - - &Message: - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - - R&euse an existing receiving address (not recommended) - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - An optional label to associate with the new receiving address. - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - Clear all fields of the form. - - - - Clear - - - - Requested payments history - - - - &Request payment - - - - Show the selected request (does the same as double clicking an entry) - - - - Show - - - - Remove the selected entries from the list - - - - Remove - - - - Copy label - - - - Copy message - - - - Copy amount - - - + ReceiveRequestDialog - - QR Code - - - - Copy &URI - - - - Copy &Address - - - - &Save Image... - - - - Request payment to %1 - - - - Payment information - - - - URI - - - - Address - - - - Amount - - - - Label - - - - Message - - - - Resulting URI too long, try to reduce the text for label / message. - - - - Error encoding URI into QR Code. - - - + RecentRequestsTableModel - - Date - - - - Label - - - - Message - - - - Amount - - - - (no label) - - - - (no message) - - - - (no amount) - - - + SendCoinsDialog - - Send Coins - - - - Coin Control Features - - - - Inputs... - - - - automatically selected - - - - Insufficient funds! - - - - Quantity: - - - - Bytes: - - - - Amount: - - - - Priority: - - - - Fee: - - - - Low Output: - - - - After Fee: - - - - Change: - - - - If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - - - - Custom change address - - - - Send to multiple recipients at once - - - - Add &Recipient - - - - Clear all fields of the form. - - - - Clear &All - - - - Balance: - - - - Confirm the send action - - - - S&end - - - - Confirm send coins - - - - %1 to %2 - - - - Copy quantity - - - - Copy amount - - - - Copy fee - - - - Copy after fee - - - - Copy bytes - - - - Copy priority - - - - Copy low output - - - - Copy change - - - - Total Amount %1 (= %2) - - - - or - - - - The recipient address is not valid, please recheck. - - - - The amount to pay must be larger than 0. - - - - The amount exceeds your balance. - - - - The total exceeds your balance when the %1 transaction fee is included. - - - - Duplicate address found, can only send to each address once per send operation. - - - - Transaction creation failed! - - - - The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Warning: Invalid Bitcoin address - - - - (no label) - - - - Warning: Unknown change address - - - - Are you sure you want to send? - - - - added as transaction fee - - - - Payment request expired - - - - Invalid payment address %1 - - - + SendCoinsEntry - - A&mount: - - - - Pay &To: - - - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Enter a label for this address to add it to your address book - - - - &Label: - - - - Choose previously used address - - - - This is a normal payment. - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Remove this entry - - - - Message: - - - - This is a verified payment request. - - - - Enter a label for this address to add it to the list of used addresses - - - - A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. - - - - This is an unverified payment request. - - - - Pay To: - - - - Memo: - - - + ShutdownWindow - - Bitcoin Core is shutting down... - - - - Do not shut down the computer until this window disappears. - - - + SignVerifyMessageDialog - - Signatures - Sign / Verify a Message - - - - &Sign Message - - - - You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - - - - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Choose previously used address - - - - Alt+A - - - - Paste address from clipboard - - - - Alt+P - - - - Enter the message you want to sign here - - - - Signature - - - - Copy the current signature to the system clipboard - - - - Sign the message to prove you own this Bitcoin address - - - - Sign &Message - - - - Reset all sign message fields - - - - Clear &All - - - - &Verify Message - - - - Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - - - - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Verify the message to ensure it was signed with the specified Bitcoin address - - - - Verify &Message - - - - Reset all verify message fields - - - - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - - Click "Sign Message" to generate signature - - - - The entered address is invalid. - - - - Please check the address and try again. - - - - The entered address does not refer to a key. - - - - Wallet unlock was cancelled. - - - - Private key for the entered address is not available. - - - - Message signing failed. - - - - Message signed. - - - - The signature could not be decoded. - - - - Please check the signature and try again. - - - - The signature did not match the message digest. - - - - Message verification failed. - - - - Message verified. - - - + SplashScreen - - Bitcoin Core - - - - The Bitcoin Core developers - - - - [testnet] - - - + TrafficGraphWidget - - KB/s - - - + TransactionDesc - - Open until %1 - - - - conflicted - - - - %1/offline - - - - %1/unconfirmed - - - - %1 confirmations - - - - Status - - - - , broadcast through %n node(s) - - - - Date - - - - Source - - - - Generated - - - - From - - - - To - - - - own address - - - - label - - - - Credit - - - - matures in %n more block(s) - - - - not accepted - - - - Debit - - - - Transaction fee - - - - Net amount - - - - Message - - - - Comment - - - - Transaction ID - - - - Merchant - - - - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - - - - Debug information - - - - Transaction - - - - Inputs - - - - Amount - - - - true - - - - false - - - - , has not been successfully broadcast yet - - - - Open for %n more block(s) - - - - unknown - - - + TransactionDescDialog - - Transaction details - - - - This pane shows a detailed description of the transaction - - - + TransactionTableModel - - Date - - - - Type - - - - Address - - - - Amount - - - - Immature (%1 confirmations, will be available after %2) - - - - Open for %n more block(s) - - - - Open until %1 - - - - Confirmed (%1 confirmations) - - - - This block was not received by any other nodes and will probably not be accepted! - - - - Generated but not accepted - - - - Offline - - - - Unconfirmed - - - - Confirming (%1 of %2 recommended confirmations) - - - - Conflicted - - - - Received with - - - - Received from - - - - Sent to - - - - Payment to yourself - - - - Mined - - - - (n/a) - - - - Transaction status. Hover over this field to show number of confirmations. - - - - Date and time that the transaction was received. - - - - Type of transaction. - - - - Destination address of transaction. - - - - Amount removed from or added to balance. - - - + TransactionView - - All - - - - Today - - - - This week - - - - This month - - - - Last month - - - - This year - - - - Range... - - - - Received with - - - - Sent to - - - - To yourself - - - - Mined - - - - Other - - - - Enter address or label to search - - - - Min amount - - - - Copy address - - - - Copy label - - - - Copy amount - - - - Copy transaction ID - - - - Edit label - - - - Show transaction details - - - - Export Transaction History - - - - Exporting Failed - - - - There was an error trying to save the transaction history to %1. - - - - Exporting Successful - - - - The transaction history was successfully saved to %1. - - - - Comma separated file (*.csv) - - - - Confirmed - - - - Date - - - - Type - - - - Label - - - - Address - - - - Amount - - - - ID - - - - Range: - - - - to - - - + + + UnitDisplayStatusBarControl + WalletFrame - - No wallet has been loaded. - - - + WalletModel - - Send Coins - - - + WalletView - - &Export - - - - Export the data in the current tab to a file - - - - Backup Wallet - - - - Wallet Data (*.dat) - - - - Backup Failed - - - - There was an error trying to save the wallet data to %1. - - - - The wallet data was successfully saved to %1. - - - - Backup Successful - - - + bitcoin-core - - Usage: - - - - List commands - - - - Get help for a command - - - - Options: - - - - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - - - - Specify data directory - - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - - - - Connect to a node to retrieve peer addresses, and disconnect - - - - Specify your own public address - - - - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - - Accept command line and JSON-RPC commands - - - - Bitcoin Core RPC client version - - - - Run in the background as a daemon and accept commands - - - - Use the test network - - - - Accept connections from outside (default: 1 if no -proxy or -connect) - - - - %s, you must set a rpcpassword in the configuration file: -%s -It is recommended you use the following random password: -rpcuser=bitcoinrpc -rpcpassword=%s -(you do not need to remember this password) -The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions. -It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - - - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - - - - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - - - - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. - - - - Error: Listening for incoming connections failed (listen returned error %d) - - - - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - - - - Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - - - - Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - - - Fees smaller than this are considered zero fee (for transaction creation) (default: - - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - In this mode -genproclimit controls how many blocks are generated immediately. - - - - Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - - - - Unable to bind to %s on this computer. Bitcoin Core is probably already running. - - - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - - - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - - - - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - - - - Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - - - - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - - - - Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - - - - (default: 1) - - - - (default: wallet.dat) - - - - <category> can be: - - - - Attempt to recover private keys from a corrupt wallet.dat - - - - Bitcoin Core Daemon - - - - Block creation options: - - - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - - - - Connect only to the specified node(s) - - - - Connect through SOCKS proxy - - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - - - - Connection options: - - - - Corrupted block database detected - - - - Debugging/Testing options: - - - - Disable safemode, override a real safe mode event (default: 0) - - - - Discover own IP address (default: 1 when listening and no -externalip) - - - - Do not load the wallet and disable wallet RPC calls - - - - Do you want to rebuild the block database now? - - - - Error initializing block database - - - - Error initializing wallet database environment %s! - - - - Error loading block database - - - - Error opening block database - - - - Error: Disk space is low! - - - - Error: Wallet locked, unable to create transaction! - - - - Error: system error: - - - - Failed to listen on any port. Use -listen=0 if you want this. - - - - Failed to read block info - - - - Failed to read block - - - - Failed to sync block index - - - - Failed to write block index - - - - Failed to write block info - - - - Failed to write block - - - - Failed to write file info - - - - Failed to write to coin database - - - - Failed to write transaction index - - - - Failed to write undo data - - - - Fee per kB to add to transactions you send - - - - Fees smaller than this are considered zero fee (for relaying) (default: - - - - Find peers using DNS lookup (default: 1 unless -connect) - - - - Force safe mode (default: 0) - - - - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - - - - If <category> is not supplied, output all debugging information. - - - - Importing... - - - - Incorrect or no genesis block found. Wrong datadir for network? - - - - Invalid -onion address: '%s' - - - - Not enough file descriptors available. - - - - Prepend debug output with timestamp (default: 1) - - - - RPC client options: - - - - Rebuild block chain index from current blk000??.dat files - - - - Select SOCKS version for -proxy (4 or 5, default: 5) - - - - Set database cache size in megabytes (%d to %d, default: %d) - - - - Set maximum block size in bytes (default: %d) - - - - Set the number of threads to service RPC calls (default: 4) - - - - Specify wallet file (within data directory) - - - - Spend unconfirmed change when sending transactions (default: 1) - - - - This is intended for regression testing tools and app development. - - - - Usage (deprecated, use bitcoin-cli): - - - - Verifying blocks... - - - - Verifying wallet... - - - - Wait for RPC server to start - - - - Wallet %s resides outside data directory %s - - - - Wallet options: - - - - Warning: Deprecated argument -debugnet ignored, use -debug=net - - - - You need to rebuild the database using -reindex to change -txindex - - - - Imports blocks from external blk000??.dat file - - - - Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. - - - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - - - - Information - - - - Invalid amount for -minrelaytxfee=<amount>: '%s' - - - - Invalid amount for -mintxfee=<amount>: '%s' - - - - Limit size of signature cache to <n> entries (default: 50000) - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - - Only accept block chain matching built-in checkpoints (default: 1) - - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - - Print block on startup, if found in block index - - - - Print block tree on startup (default: 0) - - - - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - RPC server options: - - - - Randomly drop 1 of every <n> network messages - - - - Randomly fuzz 1 of every <n> network messages - - - - Run a thread to flush wallet periodically (default: 1) - - - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - - - - Send command to Bitcoin Core - - - - Send trace/debug info to console instead of debug.log file - - - - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - Show all debugging options (usage: --help -help-debug) - - - - Show benchmark information (default: 0) - - - - Shrink debug.log file on client startup (default: 1 when no -debug) - - - - Signing transaction failed - - - - Specify connection timeout in milliseconds (default: 5000) - - - - Start Bitcoin Core Daemon - - - - System error: - - - - Transaction amount too small - - - - Transaction amounts must be positive - - - - Transaction too large - - - - Use UPnP to map the listening port (default: 0) - - - - Use UPnP to map the listening port (default: 1 when listening) - - - - Username for JSON-RPC connections - - - - Warning - - - - Warning: This version is obsolete, upgrade required! - - - - Zapping all transactions from wallet... - - - - on startup - - - - version - - - - wallet.dat corrupt, salvage failed - - - - Password for JSON-RPC connections - - - - Allow JSON-RPC connections from specified IP address - - - - Send commands to node running on <ip> (default: 127.0.0.1) - - - - Execute command when the best block changes (%s in cmd is replaced by block hash) - - - - Upgrade wallet to latest format - - - - Set key pool size to <n> (default: 100) - - - - Rescan the block chain for missing wallet transactions - - - - Use OpenSSL (https) for JSON-RPC connections - - - - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - - - - This help message - - - - Unable to bind to %s on this computer (bind returned error %d, %s) - - - - Allow DNS lookups for -addnode, -seednode and -connect - - - - Loading addresses... - - - - Error loading wallet.dat: Wallet corrupted - - - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - - - - Wallet needed to be rewritten: restart Bitcoin to complete - - - - Error loading wallet.dat - - - - Invalid -proxy address: '%s' - - - - Unknown network specified in -onlynet: '%s' - - - - Unknown -socks proxy version requested: %i - - - - Cannot resolve -bind address: '%s' - - - - Cannot resolve -externalip address: '%s' - - - - Invalid amount for -paytxfee=<amount>: '%s' - - - - Invalid amount - - - - Insufficient funds - - - - Loading block index... - - - - Add a node to connect to and attempt to keep the connection open - - - - Loading wallet... - - - - Cannot downgrade wallet - - - - Cannot write default address - - - - Rescanning... - - - - Done loading - - - - To use the %s option - - - - Error - - - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - - - + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_zh_TW.ts b/src/qt/locale/bitcoin_zh_TW.ts index fccdf48abd..51c0780ab0 100644 --- a/src/qt/locale/bitcoin_zh_TW.ts +++ b/src/qt/locale/bitcoin_zh_TW.ts @@ -1,43 +1,4 @@ - - - AboutDialog - - About Bitcoin Core - 關於位元幣核心 - - - <b>Bitcoin Core</b> version - <b>位元幣核心</b> 版本 - - - -This is experimental software. - -Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. - -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard. - -位元幣,原名是 Bitcoin, 又叫做比特幣。 - -這是一套實驗性的軟體。 - -這套軟體是依據 MIT/X11 軟體授權條款散布,詳情請見附帶的 COPYING 檔案,或是以下網站: http://www.opensource.org/licenses/mit-license.php. - -此產品也包含了由 OpenSSL Project 所開發的 OpenSSL Toolkit (http://www.openssl.org/) 軟體,和由 Eric Young (eay@cryptsoft.com) 撰寫的加解密軟體,以及由 Thomas Bernard 所撰寫的 UPnP 軟體。 - - - Copyright - 版權 - - - The Bitcoin Core developers - 位元幣核心開發人員 - - - (%1-bit) - (%1 位元) - - + AddressBookPage @@ -133,8 +94,8 @@ This product includes software developed by the OpenSSL Project for use in the O 匯出失敗 - There was an error trying to save the address list to %1. - 儲存位址列表到 %1 時發生錯誤。 + There was an error trying to save the address list to %1. Please try again. + 儲存位址列表到 %1 時發生錯誤。請重試一次。 @@ -170,10 +131,6 @@ This product includes software developed by the OpenSSL Project for use in the O Repeat new passphrase 重複新密碼 - - Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>. - 請輸入錢包的新密碼。<br/>建議用<b>10 個以上的任意字元</b>,或是<b>8 個以上的單字</b>。 - Encrypt wallet 加密錢包 @@ -226,6 +183,10 @@ This product includes software developed by the OpenSSL Project for use in the O Wallet encrypted 錢包已加密 + + 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>. + 輸入錢包的新密碼。<br/>密碼請用<b>10 個以上的字元</b>,或是<b>8 個以上的字詞</b>。 + Bitcoin 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. 位元幣軟體現在要關閉,好完成加密程序。請注意,加密錢包不能完全防止入侵你的電腦的惡意程式偷取位元幣。 @@ -297,10 +258,6 @@ This product includes software developed by the OpenSSL Project for use in the O Quit application 結束應用程式 - - Show information about Bitcoin - 顯示位元幣軟體相關資訊 - About &Qt 關於 &Qt @@ -337,6 +294,10 @@ This product includes software developed by the OpenSSL Project for use in the O Open &URI... 開啓 URI... + + Bitcoin Core client + 位元幣核心客戶端軟體 + Importing blocks from disk... 正在從磁碟匯入區塊資料... @@ -389,6 +350,10 @@ This product includes software developed by the OpenSSL Project for use in the O &Receive 收款 + + Show information about Bitcoin Core + 顯示位元幣核心的相關資訊 + &Show / Hide 顯示或隱藏 @@ -461,10 +426,6 @@ This product includes software developed by the OpenSSL Project for use in the O Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options 顯示位元幣核心的說明訊息,來取得可用命令列選項的列表 - - Bitcoin client - 位元幣客戶端軟體 - %n active connection(s) to Bitcoin network %n 個運作中的位元幣網路連線 @@ -473,10 +434,6 @@ This product includes software developed by the OpenSSL Project for use in the O No block source available... 沒有可用的區塊來源... - - Processed %1 of %2 (estimated) blocks of transaction history. - 已處理了估計全部 %2 個區塊中的 %1 個的交易紀錄。 - Processed %1 blocks of transaction history. 已處理了 %1 個區塊的交易紀錄。 @@ -561,10 +518,6 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>locked</b> 錢包<b>已加密</b>並且<b>上鎖中</b> - - A fatal error occurred. Bitcoin can no longer continue safely and will quit. - 發生了致命的錯誤。位元幣軟體沒辦法再繼續安全執行,只好結束。 - ClientModel @@ -600,8 +553,8 @@ Address: %4 手續費: - Low Output: - 低輸出: + Dust: + 零散錢: After Fee: @@ -692,8 +645,8 @@ Address: %4 複製優先度 - Copy low output - 複製低輸出 + Copy dust + 複製零散金額 Copy change @@ -744,8 +697,8 @@ Address: %4 - Dust - 零散錢 + Can vary +/- %1 satoshi(s) per input. + 每組輸入可能有 +/- %1 個 satoshi 的誤差。 yes @@ -772,25 +725,13 @@ Address: %4 優先度較高的交易比較有可能被接受放進區塊中。 - This label turns red, if the priority is smaller than "medium". + This label turns red, if the priority is smaller than "medium". 當優先度低於「中等」時,文字會變紅色。 This label turns red, if any recipient receives an amount smaller than %1. 當任何一個收款金額小於 %1 時,文字會變紅色。 - - This means a fee of at least %1 is required. - 表示至少需要 %1 的交易手續費。 - - - Amounts below 0.546 times the minimum relay fee are shown as dust. - 當金額低於最低轉發手續費乘以 0.546 時,會顯示成零散錢。 - - - This label turns red, if the change is smaller than %1. - 當找零金額小於 %1 時,文字會變紅色。 - (no label) (無標記) @@ -843,11 +784,11 @@ Address: %4 編輯付款位址 - The entered address "%1" is already in the address book. + The entered address "%1" is already in the address book. 輸入的位址 %1 在位址簿中已經有了。 - The entered address "%1" is not a valid Bitcoin address. + The entered address "%1" is not a valid Bitcoin address. 輸入的位址 %1 並不是有效的位元幣位址。 @@ -884,10 +825,6 @@ Address: %4 HelpMessageDialog - - Bitcoin Core - Command-line options - 位元幣核心 - 命令列選項 - Bitcoin Core 位元幣核心 @@ -896,6 +833,18 @@ Address: %4 version 版本 + + (%1-bit) + (%1 位元) + + + About Bitcoin Core + 關於位元幣核心 + + + Command-line options + 命令列選項 + Usage: 用法: @@ -909,7 +858,7 @@ Address: %4 使用界面選項 - Set language, for example "de_DE" (default: system locale) + Set language, for example "de_DE" (default: system locale) 設定語言,比如說 de_DE (預設值: 系統語系) @@ -956,12 +905,12 @@ Address: %4 使用自定的資料目錄: - Bitcoin - 位元幣 + Bitcoin Core + 位元幣核心 - Error: Specified data directory "%1" can not be created. - 錯誤: 沒辦法造出指定的資料目錄 %1 。 + Error: Specified data directory "%1" cannot be created. + 錯誤: 無法新增指定的資料目錄: %1 Error @@ -1037,6 +986,14 @@ Address: %4 Number of script &verification threads 指令碼驗證執行緒數目 + + Accept connections from outside + 接受外來連線 + + + Allow incoming connections + 接受外來連線 + Connect to the Bitcoin network through a SOCKS proxy. 透過 SOCKS 代理伺服器來連線到位元幣網路。 @@ -1117,14 +1074,6 @@ Address: %4 Port of the proxy (e.g. 9050) 代理伺服器的通訊埠(像是 9050) - - SOCKS &Version: - SOCKS 版本: - - - SOCKS version of the proxy (e.g. 5) - 代理伺服器的 SOCKS 協定版本(像是 5) - &Window 視窗 @@ -1165,14 +1114,6 @@ Address: %4 Choose the default subdivision unit to show in the interface and when sending coins. 選擇操作界面和付款時,預設顯示金額的細分單位。 - - Whether to show Bitcoin addresses in the transaction list or not. - 是否要在交易列表中顯示位元幣位址。 - - - &Display addresses in transaction list - 在交易列表顯示位址 - Whether to show coin control features or not. 是否要顯示錢幣控制功能。 @@ -1228,6 +1169,10 @@ Address: %4 Wallet 錢包 + + Watch-only: + 只能看: + Available: 可用金額: @@ -1260,6 +1205,22 @@ Address: %4 Your current total balance 目前全部餘額 + + Your current balance in watch-only addresses + 所有只能看位址的目前餘額 + + + Unconfirmed transactions to watch-only addresses + 所有只能看位址還沒確認的交易 + + + Mined balance in watch-only addresses that has not yet matured + 所有只能看位址還沒成熟的開採金額 + + + Current total balance in watch-only addresses + 所有只能看位址的目前全部餘額 + <b>Recent transactions</b> <b>最近交易</b> @@ -1276,8 +1237,24 @@ Address: %4 URI 處理 - URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - 沒辦法解析 URI 位址!可能是因為位元幣位址無效,或是 URI 參數格式錯誤。 + Invalid payment address %1 + 無效的付款位址 %1 + + + Payment request rejected + 付款的要求被拒絕了 + + + Payment request network doesn't match client network. + 付款要求的網路類型跟客戶端不符。 + + + Payment request has expired. + 付款的要求已經過期了。 + + + Payment request is not initialized. + 付款的要求沒有完成初始化。 Requested payment amount of %1 is too small (considered dust). @@ -1291,25 +1268,21 @@ Address: %4 Cannot start bitcoin: click-to-pay handler 沒辦法啟動 bitcoin 協議的按就付處理器 - - Net manager warning - 網路管理員警告 - - - Your active proxy doesn't support SOCKS5, which is required for payment requests via proxy. - 目前使用中的代理伺服器不支援 SOCKS5 通訊協定,因此不能透過它來要求付款。 - Payment request fetch URL is invalid: %1 取得付款要求的 URL 無效: %1 + + URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + 沒辦法解析 URI 位址!可能是因為位元幣位址無效,或是 URI 參數格式錯誤。 + Payment request file handling 處理付款要求檔案 - Payment request file can not be read or processed! This can be caused by an invalid payment request file. - 沒辦法讀或處理付款要求檔案!可能是無效的檔案造成的。 + Payment request file cannot be read! This can be caused by an invalid payment request file. + 沒辦法讀取付款要求檔案!可能是無效的檔案造成的。 Unverified payment requests to custom payment scripts are unsupported. @@ -1324,8 +1297,8 @@ Address: %4 跟 %1 通訊時發生錯誤: %2 - Payment request can not be parsed or processed! - 沒辦法解析或處理付款要求! + Payment request cannot be parsed! + 沒辦法解析付款要求內容! Bad response from server %1 @@ -1340,31 +1313,66 @@ Address: %4 發出要求時發生網路錯誤 + + PeerTableModel + + User Agent + 使用者代理 + + + Address/Hostname + 位址/主機名稱 + + + Ping Time + Ping 時間 + + QObject - Bitcoin - 位元幣 + Amount + 金額 - Error: Specified data directory "%1" does not exist. - 錯誤: 沒有指定的資料目錄 %1 。 + Enter a Bitcoin address (e.g. %1) + 輸入位元幣位址 (比如說 %1) - Error: Cannot parse configuration file: %1. Only use key=value syntax. - 錯誤: 沒辦法解析設定檔: %1。請只用「名稱=設定值」這種語法。 + %1 d + %1 天 - Error: Invalid combination of -regtest and -testnet. - 錯誤: -regtest 和 -testnet 的使用組合無效。 + %1 h + %1 小時 - Bitcoin Core didn't yet exit safely... - 位元幣核心還沒有安全地結束... + %1 m + %1 分鐘 - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - 請輸入位元幣位址(像是 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + %1 s + %1 秒 + + + NETWORK + 網路 + + + UNKNOWN + 不明 + + + None + + + + N/A + 未知 + + + %1 ms + %1 毫秒 @@ -1416,6 +1424,10 @@ Address: %4 Using OpenSSL version 使用的 OpenSSL 版本 + + Using BerkeleyDB version + 使用 BerkeleyDB 版本 + Startup time 啓動時間 @@ -1441,8 +1453,76 @@ Address: %4 目前區塊數 - Estimated total blocks - 估計總區塊數 + Received + 收款 + + + Sent + 付款 + + + &Peers + 節點 + + + Select a peer to view detailed information. + 選一個節點來看詳細資訊 + + + Direction + 方向 + + + Version + 版本 + + + User Agent + 使用者代理 + + + Services + 服務 + + + Sync Node + 同步節點 + + + Starting Height + 起始高度 + + + Sync Height + 同步高度 + + + Ban Score + 惡劣分數 + + + Connection Time + 連線時間 + + + Last Send + 最近送出 + + + Last Receive + 最近收到 + + + Bytes Sent + 送出位元組 + + + Bytes Received + 收到位元組 + + + Ping Time + Ping 時間 Last block time @@ -1521,16 +1601,36 @@ Address: %4 %1 GB (十億位元組) - %1 m - %1 分鐘 + via %1 + 經由 %1 - %1 h - %1 小時 + never + 沒有過 - %1 h %2 m - %1 小時 %2 分 + Inbound + 進來 + + + Outbound + 出去 + + + Yes + + + + No + + + + Unknown + 不明 + + + Fetching... + 正在擷取中... @@ -1744,10 +1844,6 @@ Address: %4 Fee: 手續費: - - Low Output: - 低輸出: - After Fee: 計費後金額: @@ -1776,6 +1872,10 @@ Address: %4 Clear all fields of the form. 把表單中的所有欄位清空。 + + Dust: + 零散錢: + Clear &All 全部清掉 @@ -1824,10 +1924,6 @@ Address: %4 Copy priority 複製優先度 - - Copy low output - 複製低輸出 - Copy change 複製找零金額 @@ -1880,6 +1976,10 @@ Address: %4 Warning: Unknown change address 警告: 不明的找零位址 + + Copy dust + 複製零散金額 + Are you sure you want to send? 你確定要付錢出去嗎? @@ -1888,14 +1988,6 @@ Address: %4 added as transaction fee 加做交易手續費 - - Payment request expired - 付款的要求已經過期 - - - Invalid payment address %1 - 無效的付款位址 %1 - SendCoinsEntry @@ -1907,10 +1999,6 @@ Address: %4 Pay &To: 付給: - - The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - 付款的目標位址(像是 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - Enter a label for this address to add it to your address book 請輸入這個位址的標記來把它加進位址簿中 @@ -1927,6 +2015,10 @@ Address: %4 This is a normal payment. 這是一筆正常的付款。 + + The Bitcoin address to send the payment to + 接收付款的位元幣位址 + Alt+A Alt+A @@ -1998,8 +2090,8 @@ Address: %4 你可以用自己的位址簽署訊息,來證明你對位址的所有權。但是請小心,不要簽署語意含糊不清的內容,因為釣魚式詐騙可能會用騙你簽署的手法來冒充是你。只有在語句中的細節你都同意時才簽署。 - The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - 用來簽署訊息的位址(像是 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address to sign the message with + 用來簽署訊息的位元幣位址 Choose previously used address @@ -2054,8 +2146,8 @@ Address: %4 請在下面輸入簽署的位址,訊息(請確定完整複製了所包含的換行,空格,跳位符號等等),以及簽章,來驗證這個訊息。請小心,除了訊息內容以外,不要對簽章本身過度解讀,以避免被用「中間人攻擊法」詐騙。 - The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - 簽署這個訊息的位址(像是 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) + The Bitcoin address the message was signed with + 簽署這個訊息的位元幣位址 Verify the message to ensure it was signed with the specified Bitcoin address @@ -2070,11 +2162,7 @@ Address: %4 重設所有訊息驗證欄位 - Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - 請輸入位元幣位址(像是 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L) - - - Click "Sign Message" to generate signature + Click "Sign Message" to generate signature 請按一下「簽署訊息」來產生簽章 @@ -2202,6 +2290,10 @@ Address: %4 own address 自己的位址 + + watch-only + 只能看 + label 標記 @@ -2222,6 +2314,14 @@ Address: %4 Debit 出帳 + + Total debit + 出帳總額 + + + Total credit + 入帳總額 + Transaction fee 交易手續費 @@ -2247,7 +2347,7 @@ Address: %4 商家 - Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. 生產出來的錢要再等 %1 個區塊生出來後才成熟可以用。當區塊生產出來時會公布到網路上,來被加進區塊鏈。如果加失敗了,狀態就會變成「不被接受」,而且不能夠花。如果在你生產出區塊的幾秒鐘內,也有其他節點生產出來的話,就有可能會發生這種情形。 @@ -2312,10 +2412,6 @@ Address: %4 Address 位址 - - Amount - 金額 - Immature (%1 confirmations, will be available after %2) 未成熟(確認 %1 次,會在 %2 次後可用) @@ -2527,10 +2623,6 @@ Address: %4 Address 位址 - - Amount - 金額 - ID 識別碼 @@ -2544,6 +2636,13 @@ Address: %4 + + UnitDisplayStatusBarControl + + Unit to show amounts in. Click to select another unit. + 金額顯示單位。可以點選其他單位。 + + WalletFrame @@ -2595,18 +2694,6 @@ Address: %4 bitcoin-core - - Usage: - 用法: - - - List commands - 列出指令 - - - Get help for a command - 取得指令說明 - Options: 選項: @@ -2647,10 +2734,6 @@ Address: %4 Number of seconds to keep misbehaving peers from reconnecting (default: 86400) 拒絕跟異常節點連線的秒數(預設值: 86400) - - An error occurred while setting up the RPC port %u for listening on IPv4: %s - 設定在 IPv4 網路上以通訊埠 %u 聽取 RPC 連線時發生錯誤: %s - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) 在通訊埠 <port> 聽候 JSON-RPC 連線(預設值: 8332, 或若是測試網路: 18332) @@ -2660,10 +2743,6 @@ Address: %4 接受指令列和 JSON-RPC 指令 - - Bitcoin Core RPC client version - 位元幣核心 RPC 客戶端軟體版本 - Run in the background as a daemon and accept commands 用護靈模式在背後執行並接受指令 @@ -2686,7 +2765,7 @@ rpcpassword=%s The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; -for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com %s, 你必須要在以下設定檔中設定 RPC 密碼(rpcpassword): %s @@ -2698,36 +2777,28 @@ rpcpassword=%s 如果還沒有這個設定檔,請在造出來的時候,設定檔案權限成「只有主人才能讀取」。 也建議你設定警示通知,發生問題時你才會被通知到; 比如說設定成: -alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) 可接受的加密演算法 (預設值: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - 設定在 IPv6 網路上以通訊埠 %u 聽候 RPC 連線失敗,退而改用 IPv4 網路: %s - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - 和指定的位址繫結,並總是在指定位址聽候連線。IPv6 請用 [主機]:通訊埠 這種格式 + 和指定的位址繫結,並且一直在指定位址聽候連線。IPv6 請用 [主機]:通訊埠 這種格式 Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) 對沒付手續費的交易持續限制一分鐘內最多只能有 <n> 千位元組 (預設值: 15) - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development. - 進入回歸測試模式,使用可以立即解出區塊的特殊區塊鏈。目的是用來做回歸測試,以及配合應用程式的開發。 + Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup + 清掉錢包裡的所有交易,並且在下次啟動時,使用 -rescan 來從區塊鏈中復原回來。 Enter regression test mode, which uses a special chain in which blocks can be solved instantly. 進入回歸測試模式,使用可以立即解出區塊的特殊區塊鏈。 - - Error: Listening for incoming connections failed (listen returned error %d) - 錯誤: 聽候外來連線失敗(回傳錯誤 %d) - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. 錯誤: 交易被拒絕了!有時候會發生這種錯誤,是因為你錢包中的一些錢已經被花掉了。比如說你複製了錢包檔 wallet.dat, 然後用複製的錢包花掉了錢,你現在所用的原來的錢包中,卻沒有那筆錢已經花掉的紀錄。 @@ -2740,10 +2811,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comExecute command when a wallet transaction changes (%s in cmd is replaced by TxID) 當錢包有交易改變時要執行的指令(指令中的 %s 會被取代成交易識別碼) - - Fees smaller than this are considered zero fee (for transaction creation) (default: - 手續費低於這個時會被認為是沒付手續費(產生交易用)(預設值: - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) 每當累積到 <n> 百萬位元組(MB)時,才將資料庫的變動從記憶體暫存池中寫進磁碟紀錄檔 (預設值: 100) @@ -2758,7 +2825,7 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - 設定指令碼驗證的執行緒數目 (%u 到 %d,0 表示程式自動決定,小於 0 表示保留處理器核心不用的數目,預設值: 0) + 設定指令碼驗證的執行緒數目 (%u 到 %d,0 表示程式自動決定,小於 0 表示保留處理器核心不用的數目,預設值: %d) Set the processor limit for when generation is on (-1 = unlimited, default: -1) @@ -2780,10 +2847,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comWarning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. 警告: -paytxfee 設定了很高的金額!這可是你交易付款所要付的手續費。 - - Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly. - 警告: 請檢查電腦日期和時間是否正確!位元幣軟體沒辦法在時鐘不準的情況下正常運作。 - Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. 警告: 位元幣網路對於區塊鏈結的決定目前有分歧!看來有些礦工會有問題。 @@ -2816,30 +2879,14 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comAttempt to recover private keys from a corrupt wallet.dat 嘗試從壞掉的錢包檔 wallet.dat 復原密鑰 - - Bitcoin Core Daemon - 位元幣核心護靈 - Block creation options: 區塊製造選項: - - Clear list of wallet transactions (diagnostic tool; implies -rescan) - 清掉錢包裡交易的列表(診斷用的工具; 也會做 -rescan) - Connect only to the specified node(s) 只連線到指定節點(可多個) - - Connect through SOCKS proxy - 透過 SOCKS 代理伺服器來連線 - - - Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332) - 連線到埠號 <port> 上的 JSON-RPC 伺服器(預設值: 8332,或若是測試網路: 18332) - Connection options: 連線選項: @@ -2940,18 +2987,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comFailed to write undo data 把回復資料寫進去失敗了 - - Fee per kB to add to transactions you send - 交易時每一千位元組(kB)加付的交易手續費 - - - Fees smaller than this are considered zero fee (for relaying) (default: - 手續費比這個低時會被認為是沒付手續費(轉發用)(預設值: - - - Find peers using DNS lookup (default: 1 unless -connect) - 是否允許在找節點時使用域名查詢(預設值: 當沒用 -connect 時為 1) - Force safe mode (default: 0) 強制進入安全模式 (預設值: 0) @@ -2977,8 +3012,8 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com創世區塊不正確或找不到。資料目錄錯了嗎? - Invalid -onion address: '%s' - 無效的 -onion 位址: '%s' + Invalid -onion address: '%s' + 無效的 -onion 位址: '%s' Not enough file descriptors available. @@ -2988,18 +3023,10 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comPrepend debug output with timestamp (default: 1) 在除錯輸出內容前附加時間(預設值: 1) - - RPC client options: - RPC 客戶端選項: - Rebuild block chain index from current blk000??.dat files 從目前的區塊檔 blk000??.dat 重建區塊鏈的索引 - - Select SOCKS version for -proxy (4 or 5, default: 5) - 選擇 -proxy 指定代理伺服器的 SOCKS 協定版本(4 或 5, 預設值: 5) - Set database cache size in megabytes (%d to %d, default: %d) 設定資料庫快取大小是多少百萬位元組(MB,範圍: %d 到 %d,預設值: %d) @@ -3021,12 +3048,12 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com傳送交易時可以花還沒確認的零錢(預設值: 1) - This is intended for regression testing tools and app development. - 這是設計用來給回歸測試工具和應用程式開發用的。 + Stop running after importing blocks from disk (default: 0) + 從磁碟匯入區塊資料後停止執行(預設值: 0) - Usage (deprecated, use bitcoin-cli): - 用法(已過時,請改用 bitcoin-cli): + This is intended for regression testing tools and app development. + 這是設計用來給回歸測試工具和應用程式開發用的。 Verifying blocks... @@ -3036,10 +3063,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comVerifying wallet... 正在驗證錢包資料... - - Wait for RPC server to start - 等待 RPC 伺服器啟動 - Wallet %s resides outside data directory %s 錢包檔 %s 沒有在資料目錄 %s 裡面 @@ -3048,10 +3071,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comWallet options: 錢包選項: - - Warning: Deprecated argument -debugnet ignored, use -debug=net - 警告: 參數 -debugnet 因為已經淘汰掉了而被忽略,請改用 -debug=net - You need to rebuild the database using -reindex to change -txindex 改變 -txindex 參數後,必須要用 -reindex 參數來重建資料庫 @@ -3060,33 +3079,157 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comImports blocks from external blk000??.dat file 從其它來源的 blk000??.dat 檔匯入區塊 + + (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + (預設值: 1。1 表示保留交易描述資料,像是帳戶使用者和付款請求資訊;2 表示丟掉交易描述資料) + + + Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times + 允許指定的來源建立 JSON-RPC 連線。<ip> 的有效值可以是一個單獨位址(像是 1.2.3.4),一個網段/網段罩遮值(像是 1.2.3.4/255.255.255.0),或是網段/CIDR值(像是 1.2.3.4/24)。這個選項可以設定多次。 + + + An error occurred while setting up the RPC address %s port %u for listening: %s + 設定在網路上以位址 %s 和通訊埠 %u 聽候 RPC 連線時發生錯誤: %s + + + Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6 + 和指定的位址繫結,並且把連線過來的節點放進白名單。IPv6 請用 [主機]:通訊埠 這種格式 + + + Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces) + 和指定的位址繫結以聽候 JSON-RPC 連線。IPv6 請用 [主機]:通訊埠 這種格式。這個選項可以設定多次。(預設值: 跟所有網路界面上的位址繫結) + Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. 沒辦法鎖定資料目錄 %s。位元幣核心可能已經在執行了。 + + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) + 用系統預設權限來造出新的檔案,而不是用使用者權限罩遮(umask)值 077 (只有在關掉錢包功能時才有作用)。 + + + Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + 這套軟體是依據 MIT/X11 軟體授權條款散布,詳情請見附帶的 COPYING 檔案,或是以下網站: <http://www.opensource.org/licenses/mit-license.php>. + + + Error: Listening for incoming connections failed (listen returned error %s) + 錯誤: 聽候外來連線失敗(回傳錯誤 %s) + + + Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + 錯誤: 找到不再支援的 -socks 參數。現在只支援 SOCKS5 協定的代理伺服器了,因為不再能夠指定 SOCKS 協定版本。 + + + Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) + 當發現網路上有重複花用錢包裡的交易輸入時所要執行的指令(指令中的 %s 會被取代為重複花用的交易代碼,%t 會被取代為錢包中的交易代碼) + Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) 當收到相關警示,或發現相當長的分支時,所要執行的指令(指令中的 %s 會被取代成警示訊息) + + Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) + 當處理轉發的交易時,如果每千位元組(Kb)的手續費比這個值低,就視為沒付手續費 (預設值: %s) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) + 當製造交易時,如果每千位元組(Kb)的手續費比這個值低,就視為沒付手續費 (預設值: %s) + + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) + 當沒有設定 paytxfee 時,自動包含可以讓交易能在平均 n 個區塊內確認的手續費 (預設值: 1) + Output debugging information (default: 0, supplying <category> is optional) 輸出除錯資訊(預設值: 0, 可以不指定 <category>) + + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) + 是否允許在節點位址數目不足時,使用域名查詢來搜尋節點 (預設值: 當沒用 -connect 時為 1) + Set maximum size of high-priority/low-fee transactions in bytes (default: %d) 設定高優先度或低手續費的交易資料大小上限成多少位元組(預設值: %d) + + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. + 此產品也包含了由 OpenSSL Project 所開發的 OpenSSL Toolkit 軟體 <https://www.openssl.org/>, 和由 Eric Young 撰寫的加解密軟體,以及由 Thomas Bernard 所撰寫的 UPnP 軟體。 + + + Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + 警告: 請檢查電腦日期和時間是否正確!位元幣核心沒辦法在時鐘不準的情況下正常運作。 + + + Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. + 把來自指定網域或位址的節點放進白名單。這個選項可以設定多次。 + + + Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway + 在白名單中的節點不會因為偵測到阻斷服務攻擊而被停用。來自這些節點的交易也一定會被轉發,即使說交易本來就在記憶池裡了也一樣。適用於像是閘道伺服器。 + + + Always query for peer addresses via DNS lookup (default: 0) + 是否一定要用域名查詢來搜尋節點 (預設值: 0) + + + Cannot resolve -whitebind address: '%s' + 沒辦法解析 -whitebind 指定的位址: '%s' + + + Connect through SOCKS5 proxy + 透過 SOCKS5 代理伺服器連線 + + + Copyright (C) 2009-%i The Bitcoin Core Developers + 版權為位元幣核心開發人員自西元 2009 至 %i 年起所有 + + + Could not parse -rpcbind value %s as network address + 沒辦法解析 -rpcbind 參數值 %s 為網路位址 + + + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core + 載入 wallet.dat 檔案時發生錯誤: 這個錢包需要新版的位元幣核心 + + + Error: Unsupported argument -tor found, use -onion. + 錯誤: 找到不再支援的 -tor 參數,請改用 -onion 參數。 + + + Fee (in BTC/kB) to add to transactions you send (default: %s) + 交易付款時每千位元組(kB)的交易手續費 (預設值: %s) + + + Include IP addresses in debug output (default: 0) + 在除錯輸出內容中包含網際網路位址(預設值: 0) + Information 資訊 - Invalid amount for -minrelaytxfee=<amount>: '%s' - 設定最低轉發手續費 -minrelaytxfee=<金額> 的金額無效: '%s' + Initialization sanity check failed. Bitcoin Core is shutting down. + 初始化時的基本檢查失敗了。位元幣核心將會關閉。 - Invalid amount for -mintxfee=<amount>: '%s' - 設定 -mintxfee=<金額> 的金額無效: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' + 設定最低轉發手續費 -minrelaytxfee=<金額> 的金額無效: '%s' + + + Invalid amount for -mintxfee=<amount>: '%s' + 設定 -mintxfee=<金額> 的金額無效: '%s' + + + Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) + 設定 -paytxfee=<金額> 的金額無效: '%s' (至少要有 %s) + + + Invalid netmask specified in -whitelist: '%s' + 指定在 -whitelist 的網段無效: '%s' + + + Keep at most <n> unconnectable blocks in memory (default: %u) + 在記憶體中保存最多 <n> 個不和其他區塊相連結的區塊(預設值 : %u) Limit size of signature cache to <n> entries (default: 50000) @@ -3108,6 +3251,14 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comMaximum per-connection send buffer, <n>*1000 bytes (default: 1000) 每個連線的傳送緩衝區大小上限為 <n>*1000 位元組(預設值: 1000) + + Need to specify a port with -whitebind: '%s' + 指定 -whitebind 時必須包含通訊埠: '%s' + + + Node relay options: + 節點轉發選項: + Only accept block chain matching built-in checkpoints (default: 1) 只接受跟內建的檢查段點吻合的區塊鏈(預設值: 1) @@ -3140,18 +3291,18 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comRandomly fuzz 1 of every <n> network messages 隨機亂動 <n> 分之一的網路訊息裡的資料 + + Relay and mine data carrier transactions (default: 1) + 允許轉發和開採只帶資料的交易 (預設值: 1) + + + Relay non-P2SH multisig (default: 1) + 允許轉發非 P2SH 的多簽章交易 (預設值: 1) + Run a thread to flush wallet periodically (default: 1) 啟用定期將變動寫入錢包檔的執行緒 (預設值: 1) - - SSL options: (see the Bitcoin Wiki for SSL setup instructions) - SSL 選項: (SSL 設定程序請見 Bitcoin Wiki) - - - Send command to Bitcoin Core - 傳送指令給位元幣核心 - Send trace/debug info to console instead of debug.log file 在終端機顯示追蹤或除錯資訊,而不是寫到檔案 debug.log 中 @@ -3168,10 +3319,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comShow all debugging options (usage: --help -help-debug) 顯示所有的除錯選項 (用法: --help --help-debug) - - Show benchmark information (default: 0) - 顯示效能評比資訊 (預設值: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) 客戶端軟體啓動時把 debug.log 檔縮小(預設值: 當沒有 -debug 時為 1) @@ -3184,14 +3331,14 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comSpecify connection timeout in milliseconds (default: 5000) 指定連線在幾毫秒後逾時(預設值: 5000) - - Start Bitcoin Core Daemon - 啟動位元幣核心護靈 - System error: 系統錯誤: + + This is experimental software. + 這套軟體屬於實驗性質。 + Transaction amount too small 交易金額太小 @@ -3204,6 +3351,10 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comTransaction too large 交易位元量太大 + + Unable to bind to %s on this computer (bind returned error %s) + 無法和這台電腦上的 %s 繫結(回傳錯誤 %s) + Use UPnP to map the listening port (default: 0) 是否要使用「通用即插即用」協定(UPnP),來設定聽候連線的通訊埠的對應(預設值: 0) @@ -3216,6 +3367,10 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comUsername for JSON-RPC connections JSON-RPC 連線使用者名稱 + + Wallet needed to be rewritten: restart Bitcoin Core to complete + 錢包需要重寫: 請重新啓動位元幣核心來完成 + Warning 警告 @@ -3224,6 +3379,14 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comWarning: This version is obsolete, upgrade required! 警告: 這個版本已經被淘汰了,必須要升級! + + Warning: Unsupported argument -benchmark ignored, use -debug=bench. + 警告: 忽略了不再支援的 -benchmark 參數,請改用 -debug=bench. + + + Warning: Unsupported argument -debugnet ignored, use -debug=net. + 警告: 忽略了不再支援的 -debugnet 參數,請改用 -debug=net. + Zapping all transactions from wallet... 正在砍掉錢包中的所有交易... @@ -3232,10 +3395,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comon startup 當啟動時 - - version - 版本 - wallet.dat corrupt, salvage failed 錢包檔 weallet.dat 壞掉了,拯救失敗 @@ -3244,14 +3403,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comPassword for JSON-RPC connections JSON-RPC 連線密碼 - - Allow JSON-RPC connections from specified IP address - 允許指定的來源 IP 位址進行 JSON-RPC 連線 - - - Send commands to node running on <ip> (default: 127.0.0.1) - 傳送指令給在 <ip> 的節點(預設值: 127.0.0.1) - Execute command when the best block changes (%s in cmd is replaced by block hash) 當最新區塊改變時要執行的指令(指令中的 %s 會被取代成區塊雜湊值) @@ -3284,10 +3435,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comThis help message 這些說明訊息 - - Unable to bind to %s on this computer (bind returned error %d, %s) - 沒辦法和這台電腦上的 %s 繫結(回傳錯誤 %d, %s) - Allow DNS lookups for -addnode, -seednode and -connect 允許對 -addnode, -seednode, -connect 的參數使用域名查詢 @@ -3300,41 +3447,29 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comError loading wallet.dat: Wallet corrupted 載入檔案 wallet.dat 時發生錯誤: 錢包損毀了 - - Error loading wallet.dat: Wallet requires newer version of Bitcoin - 載入 wallet.dat 檔案時發生錯誤: 這個錢包需要新版的位元幣軟體 - - - Wallet needed to be rewritten: restart Bitcoin to complete - 錢包需要重寫: 請重新啓動位元幣軟體來完成 - Error loading wallet.dat 載入錢包檔 wallet.dat 時發生錯誤 - Invalid -proxy address: '%s' - 無效的 -proxy 位址: '%s' + Invalid -proxy address: '%s' + 無效的 -proxy 位址: '%s' - Unknown network specified in -onlynet: '%s' - 在 -onlynet 指定了不明的網路別: '%s' + Unknown network specified in -onlynet: '%s' + 在 -onlynet 指定了不明的網路別: '%s' - Unknown -socks proxy version requested: %i - 在 -socks 指定了不明的代理協定版本: %i + Cannot resolve -bind address: '%s' + 沒辦法解析 -bind 位址: '%s' - Cannot resolve -bind address: '%s' - 沒辦法解析 -bind 位址: '%s' + Cannot resolve -externalip address: '%s' + 沒辦法解析 -externalip 位址: '%s' - Cannot resolve -externalip address: '%s' - 沒辦法解析 -externalip 位址: '%s' - - - Invalid amount for -paytxfee=<amount>: '%s' - 設定 -paytxfee=<金額> 的金額無效: '%s' + Invalid amount for -paytxfee=<amount>: '%s' + 設定 -paytxfee=<金額> 的金額無效: '%s' Invalid amount @@ -3380,13 +3515,5 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comError 錯誤 - - You must set rpcpassword=<password> in the configuration file: -%s -If the file does not exist, create it with owner-readable-only file permissions. - 你必須在以下設定檔中設定 RPC 密碼(rpcpassword=<password>): -%s -如果還沒有這個檔案,請在造出來的時候,設定檔案權限成只有主人才能讀取。 - \ No newline at end of file From 47eb76597efb7dadb36dd98bc20bd80b2db9cd50 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 1 Sep 2014 21:36:46 +0200 Subject: [PATCH 0631/1288] Serializer simplifications after IMPLEMENT_SERIALIZE overhaul --- src/core.h | 7 ++--- src/main.h | 4 +-- src/netbase.h | 3 +-- src/protocol.h | 9 +++---- src/qt/recentrequeststablemodel.h | 10 +++---- src/qt/walletmodel.h | 32 ++++++++++------------ src/wallet.h | 44 +++++++++++++------------------ 7 files changed, 43 insertions(+), 66 deletions(-) diff --git a/src/core.h b/src/core.h index 34c00c4142..ed37f7a3f8 100644 --- a/src/core.h +++ b/src/core.h @@ -257,14 +257,12 @@ public: template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - READWRITE(*const_cast(&this->nVersion)); nVersion = this->nVersion; READWRITE(*const_cast*>(&vin)); READWRITE(*const_cast*>(&vout)); READWRITE(*const_cast(&nLockTime)); - if (fRead) + if (ser_action.ForRead()) UpdateHash(); } @@ -346,8 +344,7 @@ public: template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - if (!fRead) { + if (!ser_action.ForRead()) { uint64_t nVal = CompressAmount(txout.nValue); READWRITE(VARINT(nVal)); } else { diff --git a/src/main.h b/src/main.h index 31a1131b83..1d1a9df10f 100644 --- a/src/main.h +++ b/src/main.h @@ -424,12 +424,10 @@ public: template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - READWRITE(nTransactions); READWRITE(vHash); std::vector vBytes; - if (fRead) { + if (ser_action.ForRead()) { READWRITE(vBytes); CPartialMerkleTree &us = *(const_cast(this)); us.vBits.resize(vBytes.size() * 8); diff --git a/src/netbase.h b/src/netbase.h index 9b52c0a415..a061a91556 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -154,11 +154,10 @@ class CService : public CNetAddr template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); READWRITE(FLATDATA(ip)); unsigned short portN = htons(port); READWRITE(portN); - if (fRead) + if (ser_action.ForRead()) port = ntohs(portN); } }; diff --git a/src/protocol.h b/src/protocol.h index e4b0991774..ddf096aeac 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -89,16 +89,13 @@ class CAddress : public CService template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - - CAddress* pthis = const_cast(this); - if (fRead) - pthis->Init(); + if (ser_action.ForRead()) + Init(); if (nType & SER_DISK) READWRITE(nVersion); if ((nType & SER_DISK) || (nVersion >= CADDR_TIME_VERSION && !(nType & SER_GETHASH))) - READWRITE(nTime); + READWRITE(nTime); READWRITE(nServices); READWRITE(*(CService*)this); } diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h index a558aa4942..cdb7e47f62 100644 --- a/src/qt/recentrequeststablemodel.h +++ b/src/qt/recentrequeststablemodel.h @@ -28,19 +28,15 @@ public: template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - - RecentRequestEntry* pthis = const_cast(this); - unsigned int nDate = date.toTime_t(); - READWRITE(pthis->nVersion); - nVersion = pthis->nVersion; + READWRITE(this->nVersion); + nVersion = this->nVersion; READWRITE(id); READWRITE(nDate); READWRITE(recipient); - if (fRead) + if (ser_action.ForRead()) date = QDateTime::fromTime_t(nDate); } }; diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 2a9ac4650f..bd8a25bb94 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -63,20 +63,16 @@ public: template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - - SendCoinsRecipient* pthis = const_cast(this); - - std::string sAddress = pthis->address.toStdString(); - std::string sLabel = pthis->label.toStdString(); - std::string sMessage = pthis->message.toStdString(); + std::string sAddress = address.toStdString(); + std::string sLabel = label.toStdString(); + std::string sMessage = message.toStdString(); std::string sPaymentRequest; - if (!fRead && pthis->paymentRequest.IsInitialized()) - pthis->paymentRequest.SerializeToString(&sPaymentRequest); - std::string sAuthenticatedMerchant = pthis->authenticatedMerchant.toStdString(); + if (!ser_action.ForRead() && paymentRequest.IsInitialized()) + paymentRequest.SerializeToString(&sPaymentRequest); + std::string sAuthenticatedMerchant = authenticatedMerchant.toStdString(); - READWRITE(pthis->nVersion); - nVersion = pthis->nVersion; + READWRITE(this->nVersion); + nVersion = this->nVersion; READWRITE(sAddress); READWRITE(sLabel); READWRITE(amount); @@ -84,14 +80,14 @@ public: READWRITE(sPaymentRequest); READWRITE(sAuthenticatedMerchant); - if (fRead) + if (ser_action.ForRead()) { - pthis->address = QString::fromStdString(sAddress); - pthis->label = QString::fromStdString(sLabel); - pthis->message = QString::fromStdString(sMessage); + address = QString::fromStdString(sAddress); + label = QString::fromStdString(sLabel); + message = QString::fromStdString(sMessage); if (!sPaymentRequest.empty()) - pthis->paymentRequest.parse(QByteArray::fromRawData(sPaymentRequest.data(), sPaymentRequest.size())); - pthis->authenticatedMerchant = QString::fromStdString(sAuthenticatedMerchant); + paymentRequest.parse(QByteArray::fromRawData(sPaymentRequest.data(), sPaymentRequest.size())); + authenticatedMerchant = QString::fromStdString(sAuthenticatedMerchant); } } }; diff --git a/src/wallet.h b/src/wallet.h index cea61afed3..2fc953c516 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -609,21 +609,18 @@ public: template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - - CWalletTx* pthis = const_cast(this); - if (fRead) - pthis->Init(NULL); + if (ser_action.ForRead()) + Init(NULL); char fSpent = false; - if (!fRead) + if (!ser_action.ForRead()) { - pthis->mapValue["fromaccount"] = pthis->strFromAccount; + mapValue["fromaccount"] = strFromAccount; - WriteOrderPos(pthis->nOrderPos, pthis->mapValue); + WriteOrderPos(nOrderPos, mapValue); if (nTimeSmart) - pthis->mapValue["timesmart"] = strprintf("%u", nTimeSmart); + mapValue["timesmart"] = strprintf("%u", nTimeSmart); } READWRITE(*(CMerkleTx*)this); @@ -636,13 +633,13 @@ public: READWRITE(fFromMe); READWRITE(fSpent); - if (fRead) + if (ser_action.ForRead()) { - pthis->strFromAccount = pthis->mapValue["fromaccount"]; + strFromAccount = mapValue["fromaccount"]; - ReadOrderPos(pthis->nOrderPos, pthis->mapValue); + ReadOrderPos(nOrderPos, mapValue); - pthis->nTimeSmart = mapValue.count("timesmart") ? (unsigned int)atoi64(pthis->mapValue["timesmart"]) : 0; + nTimeSmart = mapValue.count("timesmart") ? (unsigned int)atoi64(mapValue["timesmart"]) : 0; } mapValue.erase("fromaccount"); @@ -979,9 +976,6 @@ public: template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - - CAccountingEntry& me = *const_cast(this); if (!(nType & SER_GETHASH)) READWRITE(nVersion); // Note: strAccount is serialized as part of the key, not here. @@ -989,9 +983,9 @@ public: READWRITE(nTime); READWRITE(LIMITED_STRING(strOtherAccount, 65536)); - if (!fRead) + if (!ser_action.ForRead()) { - WriteOrderPos(nOrderPos, me.mapValue); + WriteOrderPos(nOrderPos, mapValue); if (!(mapValue.empty() && _ssExtra.empty())) { @@ -999,26 +993,26 @@ public: ss.insert(ss.begin(), '\0'); ss << mapValue; ss.insert(ss.end(), _ssExtra.begin(), _ssExtra.end()); - me.strComment.append(ss.str()); + strComment.append(ss.str()); } } READWRITE(LIMITED_STRING(strComment, 65536)); size_t nSepPos = strComment.find("\0", 0, 1); - if (fRead) + if (ser_action.ForRead()) { - me.mapValue.clear(); + mapValue.clear(); if (std::string::npos != nSepPos) { CDataStream ss(std::vector(strComment.begin() + nSepPos + 1, strComment.end()), nType, nVersion); - ss >> me.mapValue; - me._ssExtra = std::vector(ss.begin(), ss.end()); + ss >> mapValue; + _ssExtra = std::vector(ss.begin(), ss.end()); } - ReadOrderPos(me.nOrderPos, me.mapValue); + ReadOrderPos(nOrderPos, mapValue); } if (std::string::npos != nSepPos) - me.strComment.erase(nSepPos); + strComment.erase(nSepPos); mapValue.erase("n"); } From c0f5d4aba5e158d32edb3fc280f63e04542e90d4 Mon Sep 17 00:00:00 2001 From: ENikS Date: Mon, 1 Sep 2014 19:51:25 -0400 Subject: [PATCH 0632/1288] Fixing Compiler Error C2466 --- src/key.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/key.cpp b/src/key.cpp index a253f8666a..a058ef05e5 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -396,7 +396,7 @@ const unsigned char vchMaxModHalfOrder[32] = { 0xDF,0xE9,0x2F,0x46,0x68,0x1B,0x20,0xA0 }; -const unsigned char vchZero[0] = {}; +const unsigned char vchZero[1] = {0}; } // anon namespace From 8d5e5102f6f80c037b6bbc2985b778fd40c80d1c Mon Sep 17 00:00:00 2001 From: jtimon Date: Sat, 23 Aug 2014 03:52:54 +0200 Subject: [PATCH 0633/1288] Remove unused function StackString() and class CCoins; --- src/script.h | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/script.h b/src/script.h index 8e6aedcc63..c1f5aa1dd5 100644 --- a/src/script.h +++ b/src/script.h @@ -18,7 +18,6 @@ #include #include -class CCoins; class CKeyStore; class CTransaction; struct CMutableTransaction; @@ -411,25 +410,6 @@ inline std::string ValueString(const std::vector& vch) return HexStr(vch); } -inline std::string StackString(const std::vector >& vStack) -{ - std::string str; - BOOST_FOREACH(const std::vector& vch, vStack) - { - if (!str.empty()) - str += " "; - str += ValueString(vch); - } - return str; -} - - - - - - - - /** Serialized script, used inside transaction inputs and outputs */ class CScript : public std::vector { From 53efb09e4ceaa0ccb4e6271387f5013fe5e1ec75 Mon Sep 17 00:00:00 2001 From: jtimon Date: Sat, 23 Aug 2014 05:09:47 +0200 Subject: [PATCH 0634/1288] Discover some missing includes --- src/bloom.cpp | 2 ++ src/core.cpp | 2 ++ src/core_write.cpp | 2 ++ src/qt/recentrequeststablemodel.cpp | 2 ++ src/script.cpp | 2 ++ src/script.h | 1 - 6 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/bloom.cpp b/src/bloom.cpp index 85a2ddc189..e34041336f 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -10,6 +10,8 @@ #include #include +#include + #define LN2SQUARED 0.4804530139182014246671025263266649717305529515945455 #define LN2 0.6931471805599453094172321214581765680755001343602552 diff --git a/src/core.cpp b/src/core.cpp index e6636ae04f..8dcda0126a 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -7,6 +7,8 @@ #include "tinyformat.h" +#include + std::string COutPoint::ToString() const { return strprintf("COutPoint(%s, %u)", hash.ToString().substr(0,10), n); diff --git a/src/core_write.cpp b/src/core_write.cpp index e63b64d692..e66e75515c 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -11,6 +11,8 @@ #include "utilmoneystr.h" #include "base58.h" +#include + using namespace std; string EncodeHexTx(const CTransaction& tx) diff --git a/src/qt/recentrequeststablemodel.cpp b/src/qt/recentrequeststablemodel.cpp index 9e3976644e..0e5802922c 100644 --- a/src/qt/recentrequeststablemodel.cpp +++ b/src/qt/recentrequeststablemodel.cpp @@ -8,6 +8,8 @@ #include "guiutil.h" #include "optionsmodel.h" +#include + RecentRequestsTableModel::RecentRequestsTableModel(CWallet *wallet, WalletModel *parent) : walletModel(parent) { diff --git a/src/script.cpp b/src/script.cpp index 28c50a1358..21883bd41a 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -22,6 +22,8 @@ #include #include +#include + using namespace std; using namespace boost; diff --git a/src/script.h b/src/script.h index c1f5aa1dd5..d17cfe3fa4 100644 --- a/src/script.h +++ b/src/script.h @@ -15,7 +15,6 @@ #include #include -#include #include class CKeyStore; From 3f6540ad8f9c7b45a0dd2b260a282d3adad2406f Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 2 Sep 2014 09:58:09 +0200 Subject: [PATCH 0635/1288] Rename IMPLEMENT_SERIALIZE to ADD_SERIALIZE_METHODS --- src/addrman.h | 4 ++-- src/alert.h | 4 ++-- src/bloom.h | 2 +- src/core.h | 22 +++++++++++----------- src/crypter.h | 2 +- src/main.h | 14 +++++++------- src/netbase.h | 4 ++-- src/protocol.h | 6 +++--- src/qt/recentrequeststablemodel.h | 2 +- src/qt/walletmodel.h | 2 +- src/serialize.h | 6 +++--- src/wallet.h | 12 ++++++------ src/walletdb.h | 2 +- 13 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/addrman.h b/src/addrman.h index 0790802b5c..90507cb458 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -46,7 +46,7 @@ private: public: - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -268,7 +268,7 @@ public: // This format is more complex, but significantly smaller (at most 1.5 MiB), and supports // changes to the ADDRMAN_ parameters without breaking the on-disk structure. // - // We don't use IMPLEMENT_SERIALIZE since the serialization and deserialization code has + // We don't use ADD_SERIALIZE_METHODS since the serialization and deserialization code has // very little in common. template void Serialize(Stream &s, int nType, int nVersionDummy) const diff --git a/src/alert.h b/src/alert.h index 4a8736d60b..5ecf94cea8 100644 --- a/src/alert.h +++ b/src/alert.h @@ -46,7 +46,7 @@ public: std::string strStatusBar; std::string strReserved; - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -84,7 +84,7 @@ public: SetNull(); } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/bloom.h b/src/bloom.h index 4a710928cc..143e3b4c79 100644 --- a/src/bloom.h +++ b/src/bloom.h @@ -62,7 +62,7 @@ public: CBloomFilter(unsigned int nElements, double nFPRate, unsigned int nTweak, unsigned char nFlagsIn); CBloomFilter() : isFull(true), isEmpty(false), nHashFuncs(0), nTweak(0), nFlags(0) {} - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/core.h b/src/core.h index ed37f7a3f8..cde8d8b3fe 100644 --- a/src/core.h +++ b/src/core.h @@ -31,7 +31,7 @@ public: COutPoint() { SetNull(); } COutPoint(uint256 hashIn, uint32_t nIn) { hash = hashIn; n = nIn; } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -91,7 +91,7 @@ public: explicit CTxIn(COutPoint prevoutIn, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=std::numeric_limits::max()); CTxIn(uint256 hashPrevTx, uint32_t nOut, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=std::numeric_limits::max()); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -145,7 +145,7 @@ public: friend bool operator>=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK >= b.nSatoshisPerK; } std::string ToString() const; - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -170,7 +170,7 @@ public: CTxOut(int64_t nValueIn, CScript scriptPubKeyIn); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -253,7 +253,7 @@ public: CTransaction& operator=(const CTransaction& tx); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -311,7 +311,7 @@ struct CMutableTransaction CMutableTransaction(); CMutableTransaction(const CTransaction& tx); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -340,7 +340,7 @@ public: CTxOutCompressor(CTxOut &txoutIn) : txout(txoutIn) { } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -407,7 +407,7 @@ public: // undo information for all txins std::vector vprevout; - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -440,7 +440,7 @@ public: SetNull(); } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -497,7 +497,7 @@ public: *((CBlockHeader*)this) = header; } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -547,7 +547,7 @@ struct CBlockLocator vHave = vHaveIn; } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/crypter.h b/src/crypter.h index 59efc76508..c7424c9b20 100644 --- a/src/crypter.h +++ b/src/crypter.h @@ -43,7 +43,7 @@ public: // such as the various parameters to scrypt std::vector vchOtherDerivationParameters; - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/main.h b/src/main.h index 1d1a9df10f..6ef16c1ed1 100644 --- a/src/main.h +++ b/src/main.h @@ -197,7 +197,7 @@ struct CDiskBlockPos int nFile; unsigned int nPos; - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -230,7 +230,7 @@ struct CDiskTxPos : public CDiskBlockPos { unsigned int nTxOffset; // after header - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -313,7 +313,7 @@ class CBlockUndo public: std::vector vtxundo; // for all but the coinbase - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -420,7 +420,7 @@ protected: public: // serialization implementation - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -496,7 +496,7 @@ public: uint64_t nTimeFirst; // earliest time of block in file uint64_t nTimeLast; // latest time of block in file - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -770,7 +770,7 @@ public: hashPrev = (pprev ? pprev->GetBlockHash() : 0); } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -992,7 +992,7 @@ public: // thus the filter will likely be modified. CMerkleBlock(const CBlock& block, CBloomFilter& filter); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/netbase.h b/src/netbase.h index a061a91556..9fc5c72eb8 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -88,7 +88,7 @@ class CNetAddr friend bool operator!=(const CNetAddr& a, const CNetAddr& b); friend bool operator<(const CNetAddr& a, const CNetAddr& b); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -150,7 +150,7 @@ class CService : public CNetAddr CService(const struct in6_addr& ipv6Addr, unsigned short port); CService(const struct sockaddr_in6& addr); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/protocol.h b/src/protocol.h index ddf096aeac..82d29e66de 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -35,7 +35,7 @@ class CMessageHeader std::string GetCommand() const; bool IsValid() const; - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -85,7 +85,7 @@ class CAddress : public CService void Init(); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -119,7 +119,7 @@ class CInv CInv(int typeIn, const uint256& hashIn); CInv(const std::string& strType, const uint256& hashIn); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h index cdb7e47f62..3df5971823 100644 --- a/src/qt/recentrequeststablemodel.h +++ b/src/qt/recentrequeststablemodel.h @@ -24,7 +24,7 @@ public: QDateTime date; SendCoinsRecipient recipient; - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index bd8a25bb94..52d02038cd 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -59,7 +59,7 @@ public: static const int CURRENT_VERSION = 1; int nVersion; - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/serialize.h b/src/serialize.h index 1440676a16..dba3460d1b 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -91,9 +91,9 @@ enum /* Implement three methods for serializable objects. These are actually wrappers over * "SerializationOp" template, which implements the body of each class' serialization - * code. Adding "IMPLEMENT_SERIALIZE" in the body of the class causes these wrappers to be + * code. Adding "ADD_SERIALIZE_METHODS" in the body of the class causes these wrappers to be * added as members. */ -#define IMPLEMENT_SERIALIZE \ +#define ADD_SERIALIZE_METHODS \ size_t GetSerializeSize(int nType, int nVersion) const { \ CSizeComputer s(nType, nVersion); \ NCONST_PTR(this)->SerializationOp(s, CSerActionSerialize(), nType, nVersion);\ @@ -807,7 +807,7 @@ void Unserialize(Stream& is, std::set& m, int nType, int nVersion) // -// Support for IMPLEMENT_SERIALIZE and READWRITE macro +// Support for ADD_SERIALIZE_METHODS and READWRITE macro // struct CSerActionSerialize { diff --git a/src/wallet.h b/src/wallet.h index 2fc953c516..f8e1ebac12 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -64,7 +64,7 @@ public: CKeyPool(); CKeyPool(const CPubKey& vchPubKeyIn); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -492,7 +492,7 @@ public: fMerkleVerified = false; } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -605,7 +605,7 @@ public: nOrderPos = -1; } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -893,7 +893,7 @@ public: CWalletKey(int64_t nExpires=0); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -929,7 +929,7 @@ public: vchPubKey = CPubKey(); } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -972,7 +972,7 @@ public: nEntryNo = 0; } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/walletdb.h b/src/walletdb.h index cf1a66216e..ce63bb0b97 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -55,7 +55,7 @@ public: nCreateTime = nCreateTime_; } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { From 910526d8487e5db04b4f280efcd05d95e6dc273f Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 2 Sep 2014 18:56:47 +0200 Subject: [PATCH 0636/1288] Use OR of respective block flags for masks --- src/main.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.h b/src/main.h index 31a1131b83..9688b53dc4 100644 --- a/src/main.h +++ b/src/main.h @@ -548,15 +548,16 @@ enum BlockStatus { BLOCK_VALID_TRANSACTIONS = 3, // only first tx is coinbase, 2 <= coinbase input script length <= 100, transactions valid, no duplicate txids, sigops, size, merkle root BLOCK_VALID_CHAIN = 4, // outputs do not overspend inputs, no double spends, coinbase output ok, immature coinbase spends, BIP30 BLOCK_VALID_SCRIPTS = 5, // scripts/signatures ok - BLOCK_VALID_MASK = 7, + BLOCK_VALID_MASK = BLOCK_VALID_HEADER | BLOCK_VALID_TREE | BLOCK_VALID_TRANSACTIONS | + BLOCK_VALID_CHAIN | BLOCK_VALID_SCRIPTS, BLOCK_HAVE_DATA = 8, // full block available in blk*.dat BLOCK_HAVE_UNDO = 16, // undo data available in rev*.dat - BLOCK_HAVE_MASK = 24, + BLOCK_HAVE_MASK = BLOCK_HAVE_DATA | BLOCK_HAVE_UNDO, BLOCK_FAILED_VALID = 32, // stage after last reached validness failed BLOCK_FAILED_CHILD = 64, // descends from failed block - BLOCK_FAILED_MASK = 96 + BLOCK_FAILED_MASK = BLOCK_FAILED_VALID | BLOCK_FAILED_CHILD, }; /** The block chain is a tree shaped structure starting with the From 9189f5fe4df1ac7ea6ca75ceada867beafda90a9 Mon Sep 17 00:00:00 2001 From: phantomcircuit Date: Fri, 29 Aug 2014 18:21:18 -0700 Subject: [PATCH 0637/1288] remove useless millisleep reduces time to service requests improving performance --- src/net.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 3966706207..0e848787e9 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1080,8 +1080,6 @@ void ThreadSocketHandler() BOOST_FOREACH(CNode* pnode, vNodesCopy) pnode->Release(); } - - MilliSleep(10); } } From 550d4fa7a77c9763d4de9e0c0c48bc2655a65017 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 9 Aug 2014 20:57:47 -0700 Subject: [PATCH 0638/1288] Remove DNS Seeds run by entities which were never well-established. --- doc/dnsseed-policy.md | 3 +++ src/chainparams.cpp | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/dnsseed-policy.md b/doc/dnsseed-policy.md index 73e307f7cd..66a1757ac5 100644 --- a/doc/dnsseed-policy.md +++ b/doc/dnsseed-policy.md @@ -3,6 +3,9 @@ Expectations for DNS Seed operators Bitcoin Core attempts to minimize the level of trust in DNS seeds, but DNS seeds still pose a small amount of risk for the network. +As such, DNS seeds must be run by entities which have some minimum +level of trust within the Bitcoin community. + Other implementations of Bitcoin software may also use the same seeds and may be more exposed. In light of this exposure this document establishes some basic expectations for the expectations diff --git a/src/chainparams.cpp b/src/chainparams.cpp index ce99f268f3..bfe50d77d5 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -99,7 +99,6 @@ public: vSeeds.push_back(CDNSSeedData("dashjr.org", "dnsseed.bitcoin.dashjr.org")); vSeeds.push_back(CDNSSeedData("bitcoinstats.com", "seed.bitcoinstats.com")); vSeeds.push_back(CDNSSeedData("bitnodes.io", "seed.bitnodes.io")); - vSeeds.push_back(CDNSSeedData("open-nodes.org", "seeds.bitcoin.open-nodes.org")); vSeeds.push_back(CDNSSeedData("xf2.org", "bitseed.xf2.org")); base58Prefixes[PUBKEY_ADDRESS] = list_of(0); From bbda40226b87ab152bc24b67a1f296857e6e465f Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 3 Sep 2014 12:20:47 +0200 Subject: [PATCH 0639/1288] net: Remove MilliSleep from StopNode I don't understand why it would be there in the first place. This looks like voodoo, not programming. --- src/net.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/net.cpp b/src/net.cpp index 3966706207..dbba5108da 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1791,7 +1791,6 @@ bool StopNode() if (semOutbound) for (int i=0; ipost(); - MilliSleep(50); DumpAddresses(); return true; From 629d75faac84bc0a00533d01dd291a4e6394a51f Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 2 Sep 2014 21:21:15 +0200 Subject: [PATCH 0640/1288] Combine CCoinsViewCache's HaveCoins and const GetCoins into AccessCoins. The efficient version of CCoinsViewCache::GetCoins only works for known-to-exist cache entries, requiring a separate HaveCoins call beforehand. This is inefficient as both perform a hashtable lookup. Replace the non-mutable GetCoins with AccessCoins, which returns a potentially-NULL pointer. This also decreases the overloading of GetCoins. Also replace some copying (inefficient) GetCoins calls with equivalent AccessCoins, decreasing the copying. --- src/bitcoin-tx.cpp | 6 +++--- src/coins.cpp | 38 ++++++++++++++++++-------------------- src/coins.h | 8 +++++--- src/main.cpp | 30 ++++++++++++++++-------------- src/miner.cpp | 7 ++++--- src/rpcrawtransaction.cpp | 12 ++++++------ src/txmempool.cpp | 4 ++-- 7 files changed, 54 insertions(+), 51 deletions(-) diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 5f547bba83..c8cd9edfa4 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -418,12 +418,12 @@ static void MutateTxSign(CMutableTransaction& tx, const string& flagStr) // Sign what we can: for (unsigned int i = 0; i < mergedTx.vin.size(); i++) { CTxIn& txin = mergedTx.vin[i]; - CCoins coins; - if (!view.GetCoins(txin.prevout.hash, coins) || !coins.IsAvailable(txin.prevout.n)) { + const CCoins* coins = view.AccessCoins(txin.prevout.hash); + if (!coins || !coins->IsAvailable(txin.prevout.n)) { fComplete = false; continue; } - const CScript& prevPubKey = coins.vout[txin.prevout.n].scriptPubKey; + const CScript& prevPubKey = coins->vout[txin.prevout.n].scriptPubKey; txin.scriptSig.clear(); // Only sign SIGHASH_SINGLE if there's a corresponding output: diff --git a/src/coins.cpp b/src/coins.cpp index 7bfb84ef3e..34485db2bd 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -110,9 +110,13 @@ CCoins &CCoinsViewCache::GetCoins(const uint256 &txid) { return it->second; } -const CCoins &CCoinsViewCache::GetCoins(const uint256 &txid) const { - /* Avoid redundant implementation with the const-cast. */ - return const_cast(this)->GetCoins(txid); +const CCoins* CCoinsViewCache::AccessCoins(const uint256 &txid) const { + CCoinsMap::const_iterator it = FetchCoins(txid); + if (it == cacheCoins.end()) { + return NULL; + } else { + return &it->second; + } } bool CCoinsViewCache::SetCoins(const uint256 &txid, const CCoins &coins) { @@ -162,9 +166,9 @@ unsigned int CCoinsViewCache::GetCacheSize() const { const CTxOut &CCoinsViewCache::GetOutputFor(const CTxIn& input) const { - const CCoins &coins = GetCoins(input.prevout.hash); - assert(coins.IsAvailable(input.prevout.n)); - return coins.vout[input.prevout.n]; + const CCoins* coins = AccessCoins(input.prevout.hash); + assert(coins && coins->IsAvailable(input.prevout.n)); + return coins->vout[input.prevout.n]; } int64_t CCoinsViewCache::GetValueIn(const CTransaction& tx) const @@ -182,19 +186,12 @@ int64_t CCoinsViewCache::GetValueIn(const CTransaction& tx) const bool CCoinsViewCache::HaveInputs(const CTransaction& tx) const { if (!tx.IsCoinBase()) { - // first check whether information about the prevout hash is available for (unsigned int i = 0; i < tx.vin.size(); i++) { const COutPoint &prevout = tx.vin[i].prevout; - if (!HaveCoins(prevout.hash)) - return false; - } - - // then check whether the actual outputs are available - for (unsigned int i = 0; i < tx.vin.size(); i++) { - const COutPoint &prevout = tx.vin[i].prevout; - const CCoins &coins = GetCoins(prevout.hash); - if (!coins.IsAvailable(prevout.n)) + const CCoins* coins = AccessCoins(prevout.hash); + if (!coins || !coins->IsAvailable(prevout.n)) { return false; + } } } return true; @@ -207,10 +204,11 @@ double CCoinsViewCache::GetPriority(const CTransaction &tx, int nHeight) const double dResult = 0.0; BOOST_FOREACH(const CTxIn& txin, tx.vin) { - const CCoins &coins = GetCoins(txin.prevout.hash); - if (!coins.IsAvailable(txin.prevout.n)) continue; - if (coins.nHeight < nHeight) { - dResult += coins.vout[txin.prevout.n].nValue * (nHeight-coins.nHeight); + const CCoins* coins = AccessCoins(txin.prevout.hash); + assert(coins); + if (!coins->IsAvailable(txin.prevout.n)) continue; + if (coins->nHeight < nHeight) { + dResult += coins->vout[txin.prevout.n].nValue * (nHeight-coins->nHeight); } } return tx.ComputePriority(dResult); diff --git a/src/coins.h b/src/coins.h index d338e3172e..c25393f1e0 100644 --- a/src/coins.h +++ b/src/coins.h @@ -344,11 +344,13 @@ public: bool SetBestBlock(const uint256 &hashBlock); bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock); + // Return a pointer to CCoins in the cache, or NULL if not found. This is + // more efficient than GetCoins. Modifications to other cache entries are + // allowed while accessing the returned pointer. + const CCoins* AccessCoins(const uint256 &txid) const; + // Return a modifiable reference to a CCoins. Check HaveCoins first. - // Many methods explicitly require a CCoinsViewCache because of this method, to reduce - // copying. CCoins &GetCoins(const uint256 &txid); - const CCoins &GetCoins(const uint256 &txid) const; // Push the modifications applied to this cache to its base. // Failure to call this method before destruction will cause the changes to be forgotten. diff --git a/src/main.cpp b/src/main.cpp index 4aebdadd3b..bea01ab7c9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1017,9 +1017,9 @@ bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock int nHeight = -1; { CCoinsViewCache &view = *pcoinsTip; - CCoins coins; - if (view.GetCoins(hash, coins)) - nHeight = coins.nHeight; + const CCoins* coins = view.AccessCoins(hash); + if (coins) + nHeight = coins->nHeight; } if (nHeight > 0) pindexSlow = chainActive[nHeight]; @@ -1371,19 +1371,20 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi for (unsigned int i = 0; i < tx.vin.size(); i++) { const COutPoint &prevout = tx.vin[i].prevout; - const CCoins &coins = inputs.GetCoins(prevout.hash); + const CCoins *coins = inputs.AccessCoins(prevout.hash); + assert(coins); // If prev is coinbase, check that it's matured - if (coins.IsCoinBase()) { - if (nSpendHeight - coins.nHeight < COINBASE_MATURITY) + if (coins->IsCoinBase()) { + if (nSpendHeight - coins->nHeight < COINBASE_MATURITY) return state.Invalid( - error("CheckInputs() : tried to spend coinbase at depth %d", nSpendHeight - coins.nHeight), + error("CheckInputs() : tried to spend coinbase at depth %d", nSpendHeight - coins->nHeight), REJECT_INVALID, "bad-txns-premature-spend-of-coinbase"); } // Check for negative or overflow input values - nValueIn += coins.vout[prevout.n].nValue; - if (!MoneyRange(coins.vout[prevout.n].nValue) || !MoneyRange(nValueIn)) + nValueIn += coins->vout[prevout.n].nValue; + if (!MoneyRange(coins->vout[prevout.n].nValue) || !MoneyRange(nValueIn)) return state.DoS(100, error("CheckInputs() : txin values out of range"), REJECT_INVALID, "bad-txns-inputvalues-outofrange"); @@ -1413,10 +1414,11 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi if (fScriptChecks) { for (unsigned int i = 0; i < tx.vin.size(); i++) { const COutPoint &prevout = tx.vin[i].prevout; - const CCoins &coins = inputs.GetCoins(prevout.hash); + const CCoins* coins = inputs.AccessCoins(prevout.hash); + assert(coins); // Verify signature - CScriptCheck check(coins, tx, i, flags, 0); + CScriptCheck check(*coins, tx, i, flags, 0); if (pvChecks) { pvChecks->push_back(CScriptCheck()); check.swap(pvChecks->back()); @@ -1428,7 +1430,7 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi // arguments; if so, don't trigger DoS protection to // avoid splitting the network between upgraded and // non-upgraded nodes. - CScriptCheck check(coins, tx, i, + CScriptCheck check(*coins, tx, i, flags & ~STANDARD_NOT_MANDATORY_VERIFY_FLAGS, 0); if (check()) return state.Invalid(false, REJECT_NONSTANDARD, "non-mandatory-script-verify-flag"); @@ -1614,8 +1616,8 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C (pindex->nHeight==91880 && pindex->GetBlockHash() == uint256("0x00000000000743f190a18c5577a3c2d2a1f610ae9601ac046a38084ccb7cd721"))); if (fEnforceBIP30) { BOOST_FOREACH(const CTransaction& tx, block.vtx) { - const uint256& hash = tx.GetHash(); - if (view.HaveCoins(hash) && !view.GetCoins(hash).IsPruned()) + const CCoins* coins = view.AccessCoins(tx.GetHash()); + if (coins && !coins->IsPruned()) return state.DoS(100, error("ConnectBlock() : tried to overwrite transaction"), REJECT_INVALID, "bad-txns-BIP30"); } diff --git a/src/miner.cpp b/src/miner.cpp index 96dc80a26d..d05ddbeb1f 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -167,12 +167,13 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) nTotalIn += mempool.mapTx[txin.prevout.hash].GetTx().vout[txin.prevout.n].nValue; continue; } - const CCoins &coins = view.GetCoins(txin.prevout.hash); + const CCoins* coins = view.AccessCoins(txin.prevout.hash); + assert(coins); - int64_t nValueIn = coins.vout[txin.prevout.n].nValue; + int64_t nValueIn = coins->vout[txin.prevout.n].nValue; nTotalIn += nValueIn; - int nConf = pindexPrev->nHeight - coins.nHeight + 1; + int nConf = pindexPrev->nHeight - coins->nHeight + 1; dPriority += (double)nValueIn * nConf; } diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 7cd704193d..dc75caeabc 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -565,7 +565,7 @@ Value signrawtransaction(const Array& params, bool fHelp) BOOST_FOREACH(const CTxIn& txin, mergedTx.vin) { const uint256& prevHash = txin.prevout.hash; CCoins coins; - view.GetCoins(prevHash, coins); // this is certainly allowed to fail + view.AccessCoins(prevHash); // this is certainly allowed to fail } view.SetBackend(viewDummy); // switch back to avoid locking mempool for too long @@ -669,12 +669,12 @@ Value signrawtransaction(const Array& params, bool fHelp) // Sign what we can: for (unsigned int i = 0; i < mergedTx.vin.size(); i++) { CTxIn& txin = mergedTx.vin[i]; - CCoins coins; - if (!view.GetCoins(txin.prevout.hash, coins) || !coins.IsAvailable(txin.prevout.n)) { + const CCoins* coins = view.AccessCoins(txin.prevout.hash); + if (coins == NULL || !coins->IsAvailable(txin.prevout.n)) { fComplete = false; continue; } - const CScript& prevPubKey = coins.vout[txin.prevout.n].scriptPubKey; + const CScript& prevPubKey = coins->vout[txin.prevout.n].scriptPubKey; txin.scriptSig.clear(); // Only sign SIGHASH_SINGLE if there's a corresponding output: @@ -732,9 +732,9 @@ Value sendrawtransaction(const Array& params, bool fHelp) fOverrideFees = params[1].get_bool(); CCoinsViewCache &view = *pcoinsTip; - CCoins existingCoins; + const CCoins* existingCoins = view.AccessCoins(hashTx); bool fHaveMempool = mempool.exists(hashTx); - bool fHaveChain = view.GetCoins(hashTx, existingCoins) && existingCoins.nHeight < 1000000000; + bool fHaveChain = existingCoins && existingCoins->nHeight < 1000000000; if (!fHaveMempool && !fHaveChain) { // push to local node and sync with wallets CValidationState state; diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 238d5bab16..f059e69ac7 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -509,8 +509,8 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const const CTransaction& tx2 = it2->second.GetTx(); assert(tx2.vout.size() > txin.prevout.n && !tx2.vout[txin.prevout.n].IsNull()); } else { - const CCoins &coins = pcoins->GetCoins(txin.prevout.hash); - assert(coins.IsAvailable(txin.prevout.n)); + const CCoins* coins = pcoins->AccessCoins(txin.prevout.hash); + assert(coins && coins->IsAvailable(txin.prevout.n)); } // Check whether its inputs are marked in mapNextTx. std::map::const_iterator it3 = mapNextTx.find(txin.prevout); From a0dbe433bdb3f22be639fbb675c371277fba6d80 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 4 Sep 2014 02:01:10 +0200 Subject: [PATCH 0641/1288] checkpoints.cpp depends on main, it can use mapBlockIndex directly --- src/checkpoints.cpp | 2 +- src/checkpoints.h | 2 +- src/main.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index 717f0b90fe..343d5251f5 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -146,7 +146,7 @@ namespace Checkpoints { return checkpoints.rbegin()->first; } - CBlockIndex* GetLastCheckpoint(const std::map& mapBlockIndex) + CBlockIndex* GetLastCheckpoint() { if (!fEnabled) return NULL; diff --git a/src/checkpoints.h b/src/checkpoints.h index 52cdc35559..6d3f2d4935 100644 --- a/src/checkpoints.h +++ b/src/checkpoints.h @@ -22,7 +22,7 @@ namespace Checkpoints { int GetTotalBlocksEstimate(); // Returns last CBlockIndex* in mapBlockIndex that is a checkpoint - CBlockIndex* GetLastCheckpoint(const std::map& mapBlockIndex); + CBlockIndex* GetLastCheckpoint(); double GuessVerificationProgress(CBlockIndex *pindex, bool fSigchecks = true); diff --git a/src/main.cpp b/src/main.cpp index 4aebdadd3b..a024461e27 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2302,7 +2302,7 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex return state.Invalid(error("AcceptBlock() : block is marked invalid"), 0, "duplicate"); } - CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(mapBlockIndex); + CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(); if (pcheckpoint && block.hashPrevBlock != (chainActive.Tip() ? chainActive.Tip()->GetBlockHash() : uint256(0))) { // Extra checks to prevent "fill up memory by spamming with bogus blocks" @@ -2345,7 +2345,7 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex REJECT_CHECKPOINT, "checkpoint mismatch"); // Don't accept any forks from the main chain prior to last checkpoint - CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(mapBlockIndex); + CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(); if (pcheckpoint && nHeight < pcheckpoint->nHeight) return state.DoS(100, error("AcceptBlock() : forked chain older than last checkpoint (height %d)", nHeight)); @@ -3286,7 +3286,7 @@ void static ProcessGetData(CNode* pfrom) // If the requested block is at a height below our last // checkpoint, only serve it if it's in the checkpointed chain int nHeight = mi->second->nHeight; - CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(mapBlockIndex); + CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(); if (pcheckpoint && nHeight < pcheckpoint->nHeight) { if (!chainActive.Contains(mi->second)) { From 145d5be896db4e8fda17039bed26100e38fae2f0 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 4 Sep 2014 02:02:44 +0200 Subject: [PATCH 0642/1288] Introduce BlockMap type for mapBlockIndex --- src/checkpoints.cpp | 2 +- src/init.cpp | 2 +- src/main.cpp | 32 ++++++++++++++++---------------- src/main.h | 3 ++- src/qt/transactionrecord.cpp | 2 +- src/rpcblockchain.cpp | 2 +- src/rpcrawtransaction.cpp | 2 +- src/rpcwallet.cpp | 2 +- src/wallet.cpp | 6 +++--- 9 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index 343d5251f5..c41deea7ce 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -156,7 +156,7 @@ namespace Checkpoints { BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, checkpoints) { const uint256& hash = i.second; - std::map::const_iterator t = mapBlockIndex.find(hash); + BlockMap::const_iterator t = mapBlockIndex.find(hash); if (t != mapBlockIndex.end()) return t->second; } diff --git a/src/init.cpp b/src/init.cpp index b8988f8b75..31f64878fb 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1031,7 +1031,7 @@ bool AppInit2(boost::thread_group& threadGroup) { string strMatch = mapArgs["-printblock"]; int nFound = 0; - for (map::iterator mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi) + for (BlockMap::iterator mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi) { uint256 hash = (*mi).first; if (boost::algorithm::starts_with(hash.ToString(), strMatch)) diff --git a/src/main.cpp b/src/main.cpp index a024461e27..2479beabdd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -38,7 +38,7 @@ using namespace boost; CCriticalSection cs_main; -map mapBlockIndex; +BlockMap mapBlockIndex; CChain chainActive; int64_t nTimeBestReceived = 0; CWaitableCriticalSection csBestBlock; @@ -328,7 +328,7 @@ void ProcessBlockAvailability(NodeId nodeid) { assert(state != NULL); if (state->hashLastUnknownBlock != 0) { - map::iterator itOld = mapBlockIndex.find(state->hashLastUnknownBlock); + BlockMap::iterator itOld = mapBlockIndex.find(state->hashLastUnknownBlock); if (itOld != mapBlockIndex.end() && itOld->second->nChainWork > 0) { if (state->pindexBestKnownBlock == NULL || itOld->second->nChainWork >= state->pindexBestKnownBlock->nChainWork) state->pindexBestKnownBlock = itOld->second; @@ -344,7 +344,7 @@ void UpdateBlockAvailability(NodeId nodeid, const uint256 &hash) { ProcessBlockAvailability(nodeid); - map::iterator it = mapBlockIndex.find(hash); + BlockMap::iterator it = mapBlockIndex.find(hash); if (it != mapBlockIndex.end() && it->second->nChainWork > 0) { // An actually better block was announced. if (state->pindexBestKnownBlock == NULL || it->second->nChainWork >= state->pindexBestKnownBlock->nChainWork) @@ -434,7 +434,7 @@ CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const { CBlockIndex *CChain::FindFork(const CBlockLocator &locator) const { // Find the first block the caller has in the main chain BOOST_FOREACH(const uint256& hash, locator.vHave) { - std::map::iterator mi = mapBlockIndex.find(hash); + BlockMap::iterator mi = mapBlockIndex.find(hash); if (mi != mapBlockIndex.end()) { CBlockIndex* pindex = (*mi).second; @@ -2068,7 +2068,7 @@ CBlockIndex* AddToBlockIndex(CBlockHeader& block) { // Check for duplicate uint256 hash = block.GetHash(); - std::map::iterator it = mapBlockIndex.find(hash); + BlockMap::iterator it = mapBlockIndex.find(hash); if (it != mapBlockIndex.end()) return it->second; @@ -2079,9 +2079,9 @@ CBlockIndex* AddToBlockIndex(CBlockHeader& block) LOCK(cs_nBlockSequenceId); pindexNew->nSequenceId = nBlockSequenceId++; } - map::iterator mi = mapBlockIndex.insert(make_pair(hash, pindexNew)).first; + BlockMap::iterator mi = mapBlockIndex.insert(make_pair(hash, pindexNew)).first; pindexNew->phashBlock = &((*mi).first); - map::iterator miPrev = mapBlockIndex.find(block.hashPrevBlock); + BlockMap::iterator miPrev = mapBlockIndex.find(block.hashPrevBlock); if (miPrev != mapBlockIndex.end()) { pindexNew->pprev = (*miPrev).second; @@ -2294,7 +2294,7 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex AssertLockHeld(cs_main); // Check for duplicate uint256 hash = block.GetHash(); - std::map::iterator miSelf = mapBlockIndex.find(hash); + BlockMap::iterator miSelf = mapBlockIndex.find(hash); CBlockIndex *pindex = NULL; if (miSelf != mapBlockIndex.end()) { pindex = miSelf->second; @@ -2323,7 +2323,7 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex CBlockIndex* pindexPrev = NULL; int nHeight = 0; if (hash != Params().HashGenesisBlock()) { - map::iterator mi = mapBlockIndex.find(block.hashPrevBlock); + BlockMap::iterator mi = mapBlockIndex.find(block.hashPrevBlock); if (mi == mapBlockIndex.end()) return state.DoS(10, error("AcceptBlock() : prev block not found"), 0, "bad-prevblk"); pindexPrev = (*mi).second; @@ -2517,7 +2517,7 @@ bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBl return error("ProcessBlock() : CheckBlock FAILED"); // If we don't already have its previous block (with full data), shunt it off to holding area until we get it - std::map::iterator it = mapBlockIndex.find(pblock->hashPrevBlock); + BlockMap::iterator it = mapBlockIndex.find(pblock->hashPrevBlock); if (pblock->hashPrevBlock != 0 && (it == mapBlockIndex.end() || !(it->second->nStatus & BLOCK_HAVE_DATA))) { LogPrintf("ProcessBlock: ORPHAN BLOCK %lu, prev=%s\n", (unsigned long)mapOrphanBlocks.size(), pblock->hashPrevBlock.ToString()); @@ -2799,7 +2799,7 @@ CBlockIndex * InsertBlockIndex(uint256 hash) return NULL; // Return existing - map::iterator mi = mapBlockIndex.find(hash); + BlockMap::iterator mi = mapBlockIndex.find(hash); if (mi != mapBlockIndex.end()) return (*mi).second; @@ -2876,7 +2876,7 @@ bool static LoadBlockIndexDB() LogPrintf("LoadBlockIndexDB(): transaction index %s\n", fTxIndex ? "enabled" : "disabled"); // Load pointer to end of best chain - std::map::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock()); + BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock()); if (it == mapBlockIndex.end()) return true; chainActive.SetTip(it->second); @@ -3034,7 +3034,7 @@ void PrintBlockTree() AssertLockHeld(cs_main); // pre-compute tree structure map > mapNext; - for (map::iterator mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi) + for (BlockMap::iterator mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi) { CBlockIndex* pindex = (*mi).second; mapNext[pindex->pprev].push_back(pindex); @@ -3280,7 +3280,7 @@ void static ProcessGetData(CNode* pfrom) if (inv.type == MSG_BLOCK || inv.type == MSG_FILTERED_BLOCK) { bool send = false; - map::iterator mi = mapBlockIndex.find(inv.hash); + BlockMap::iterator mi = mapBlockIndex.find(inv.hash); if (mi != mapBlockIndex.end()) { // If the requested block is at a height below our last @@ -3711,7 +3711,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, if (locator.IsNull()) { // If locator is null, return the hashStop block - map::iterator mi = mapBlockIndex.find(hashStop); + BlockMap::iterator mi = mapBlockIndex.find(hashStop); if (mi == mapBlockIndex.end()) return true; pindex = (*mi).second; @@ -4513,7 +4513,7 @@ public: CMainCleanup() {} ~CMainCleanup() { // block headers - std::map::iterator it1 = mapBlockIndex.begin(); + BlockMap::iterator it1 = mapBlockIndex.begin(); for (; it1 != mapBlockIndex.end(); it1++) delete (*it1).second; mapBlockIndex.clear(); diff --git a/src/main.h b/src/main.h index d38d033d2c..da2b5cac81 100644 --- a/src/main.h +++ b/src/main.h @@ -85,7 +85,8 @@ static const unsigned char REJECT_CHECKPOINT = 0x43; extern CScript COINBASE_FLAGS; extern CCriticalSection cs_main; extern CTxMemPool mempool; -extern std::map mapBlockIndex; +typedef std::map BlockMap; +extern BlockMap mapBlockIndex; extern uint64_t nLastBlockTx; extern uint64_t nLastBlockSize; extern const std::string strMessageMagic; diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index d7bd25e08b..20c1449c92 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -170,7 +170,7 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx) // Find the block the tx is in CBlockIndex* pindex = NULL; - std::map::iterator mi = mapBlockIndex.find(wtx.hashBlock); + BlockMap::iterator mi = mapBlockIndex.find(wtx.hashBlock); if (mi != mapBlockIndex.end()) pindex = (*mi).second; diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 83fe629351..4b3beae20c 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -392,7 +392,7 @@ Value gettxout(const Array& params, bool fHelp) if (n<0 || (unsigned int)n>=coins.vout.size() || coins.vout[n].IsNull()) return Value::null; - std::map::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock()); + BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock()); CBlockIndex *pindex = it->second; ret.push_back(Pair("bestblock", pindex->GetBlockHash().GetHex())); if ((unsigned int)coins.nHeight == MEMPOOL_HEIGHT) diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 7cd704193d..a73641834d 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -88,7 +88,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry) if (hashBlock != 0) { entry.push_back(Pair("blockhash", hashBlock.GetHex())); - map::iterator mi = mapBlockIndex.find(hashBlock); + BlockMap::iterator mi = mapBlockIndex.find(hashBlock); if (mi != mapBlockIndex.end() && (*mi).second) { CBlockIndex* pindex = (*mi).second; if (chainActive.Contains(pindex)) { diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 215da2ea12..100d6c2bd0 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1447,7 +1447,7 @@ Value listsinceblock(const Array& params, bool fHelp) uint256 blockId = 0; blockId.SetHex(params[0].get_str()); - std::map::iterator it = mapBlockIndex.find(blockId); + BlockMap::iterator it = mapBlockIndex.find(blockId); if (it != mapBlockIndex.end()) pindex = it->second; } diff --git a/src/wallet.cpp b/src/wallet.cpp index 18a5b3971c..d3ad4869bb 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -2113,7 +2113,7 @@ void CWallet::GetKeyBirthTimes(std::map &mapKeyBirth) const { for (std::map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); it++) { // iterate over all wallet transactions... const CWalletTx &wtx = (*it).second; - std::map::const_iterator blit = mapBlockIndex.find(wtx.hashBlock); + BlockMap::const_iterator blit = mapBlockIndex.find(wtx.hashBlock); if (blit != mapBlockIndex.end() && chainActive.Contains(blit->second)) { // ... which are already in a block int nHeight = blit->second->nHeight; @@ -2233,7 +2233,7 @@ int CMerkleTx::SetMerkleBranch(const CBlock* pblock) } // Is the tx in a block that's in the main chain - map::iterator mi = mapBlockIndex.find(hashBlock); + BlockMap::iterator mi = mapBlockIndex.find(hashBlock); if (mi == mapBlockIndex.end()) return 0; CBlockIndex* pindex = (*mi).second; @@ -2250,7 +2250,7 @@ int CMerkleTx::GetDepthInMainChainINTERNAL(CBlockIndex* &pindexRet) const AssertLockHeld(cs_main); // Find the block it claims to be in - map::iterator mi = mapBlockIndex.find(hashBlock); + BlockMap::iterator mi = mapBlockIndex.find(hashBlock); if (mi == mapBlockIndex.end()) return 0; CBlockIndex* pindex = (*mi).second; From 8a41e1edd4d31d08b7360d7e5964c1c40a7aa1b6 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 4 Sep 2014 02:03:17 +0200 Subject: [PATCH 0643/1288] Use boost::unordered_map for mapBlockIndex --- src/main.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.h b/src/main.h index da2b5cac81..8c0a743e24 100644 --- a/src/main.h +++ b/src/main.h @@ -29,6 +29,8 @@ #include #include +#include + class CBlockIndex; class CBloomFilter; class CInv; @@ -81,11 +83,15 @@ static const unsigned char REJECT_DUST = 0x41; static const unsigned char REJECT_INSUFFICIENTFEE = 0x42; static const unsigned char REJECT_CHECKPOINT = 0x43; +struct BlockHasher +{ + size_t operator()(const uint256& hash) const { return hash.GetLow64(); } +}; extern CScript COINBASE_FLAGS; extern CCriticalSection cs_main; extern CTxMemPool mempool; -typedef std::map BlockMap; +typedef boost::unordered_map BlockMap; extern BlockMap mapBlockIndex; extern uint64_t nLastBlockTx; extern uint64_t nLastBlockSize; From 1e4f87f5a13e34a457b537e9d13a212e6c5b754f Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 4 Sep 2014 02:03:39 +0200 Subject: [PATCH 0644/1288] Use memcmp for uint256 equality/inequality --- src/uint256.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/uint256.h b/src/uint256.h index d1a822af0d..6bb9a59400 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -10,6 +10,7 @@ #include #include #include +#include #include class uint_error : public std::runtime_error { @@ -215,8 +216,8 @@ public: friend inline const base_uint operator>>(const base_uint& a, int shift) { return base_uint(a) >>= shift; } friend inline const base_uint operator<<(const base_uint& a, int shift) { return base_uint(a) <<= shift; } friend inline const base_uint operator*(const base_uint& a, uint32_t b) { return base_uint(a) *= b; } - friend inline bool operator==(const base_uint& a, const base_uint& b) { return a.CompareTo(b) == 0; } - friend inline bool operator!=(const base_uint& a, const base_uint& b) { return a.CompareTo(b) != 0; } + friend inline bool operator==(const base_uint& a, const base_uint& b) { return memcmp(a.pn, b.pn, sizeof(a.pn)) == 0; } + friend inline bool operator!=(const base_uint& a, const base_uint& b) { return memcmp(a.pn, b.pn, sizeof(a.pn)) != 0; } friend inline bool operator>(const base_uint& a, const base_uint& b) { return a.CompareTo(b) > 0; } friend inline bool operator<(const base_uint& a, const base_uint& b) { return a.CompareTo(b) < 0; } friend inline bool operator>=(const base_uint& a, const base_uint& b) { return a.CompareTo(b) >= 0; } From fb51e28227fc1561ffa55cd3c5222d2b581778af Mon Sep 17 00:00:00 2001 From: himynameismartin Date: Thu, 4 Sep 2014 12:45:28 +0200 Subject: [PATCH 0645/1288] Added XML syntax highlighting --- doc/translation_process.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/translation_process.md b/doc/translation_process.md index 61a0a0ffed..9475b1dc72 100644 --- a/doc/translation_process.md +++ b/doc/translation_process.md @@ -17,10 +17,12 @@ automated. This file must be updated whenever a new translation is added. Please note that files must end with `.qm`, not `.ts`. - - locale/bitcoin_en.qm - ... - +```xml + + locale/bitcoin_en.qm + ... + +``` ### src/qt/locale/ From 399cdbc70013d54569f17b4e47e4438b8921b46b Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sun, 24 Aug 2014 11:37:14 -0400 Subject: [PATCH 0646/1288] contrib/linearize: Add feature to set file's timestamp based on block header time. --- contrib/linearize/README.md | 5 +-- contrib/linearize/linearize-data.py | 50 ++++++++++++++++++++--------- 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/contrib/linearize/README.md b/contrib/linearize/README.md index b5c6e7824e..157586e4d4 100644 --- a/contrib/linearize/README.md +++ b/contrib/linearize/README.md @@ -27,6 +27,7 @@ output. Optional config file setting for linearize-data: * "netmagic": network magic number * "max_out_sz": maximum output file size (default 1000*1000*1000) -* "split_year": Split files when a new year is first seen, in addition to +* "split_timestamp": Split files when a new month is first seen, in addition to reaching a maximum file size. - +* "file_timestamp": Set each file's last-modified time to that of the +most recent block in that file. diff --git a/contrib/linearize/linearize-data.py b/contrib/linearize/linearize-data.py index 3a4c9759fe..383bb38198 100755 --- a/contrib/linearize/linearize-data.py +++ b/contrib/linearize/linearize-data.py @@ -10,11 +10,13 @@ import json import struct import re +import os import base64 import httplib import sys import hashlib import datetime +import time settings = {} @@ -60,9 +62,10 @@ def calc_hash_str(blk_hdr): def get_blk_dt(blk_hdr): members = struct.unpack(" maxOutSz): outF.close() + if setFileTime: + os.utime(outFname, (int(time.time()), highTS)) outF = None + outFname = None outFn = outFn + 1 outsz = 0 - if timestampSplit: - blkDate = get_blk_dt(blk_hdr) - if blkDate > lastDate: - print("New month " + blkDate.strftime("%Y-%m") + " @ " + hash_str) - lastDate = blkDate - if outF: - outF.close() - outF = None - outFn = outFn + 1 - outsz = 0 + (blkDate, blkTS) = get_blk_dt(blk_hdr) + if timestampSplit and (blkDate > lastDate): + print("New month " + blkDate.strftime("%Y-%m") + " @ " + hash_str) + lastDate = blkDate + if outF: + outF.close() + if setFileTime: + os.utime(outFname, (int(time.time()), highTS)) + outF = None + outFname = None + outFn = outFn + 1 + outsz = 0 if not outF: if fileOutput: - fname = settings['output_file'] + outFname = settings['output_file'] else: - fname = "%s/blk%05d.dat" % (settings['output'], outFn) - print("Output file" + fname) - outF = open(fname, "wb") + outFname = "%s/blk%05d.dat" % (settings['output'], outFn) + print("Output file" + outFname) + outF = open(outFname, "wb") outF.write(inhdr) outF.write(rawblock) outsz = outsz + inLen + 8 blkCount = blkCount + 1 + if blkTS > highTS: + highTS = blkTS if (blkCount % 1000) == 0: print("Wrote " + str(blkCount) + " blocks") @@ -191,6 +206,8 @@ if __name__ == '__main__': settings['input'] = 'input' if 'hashlist' not in settings: settings['hashlist'] = 'hashlist.txt' + if 'file_timestamp' not in settings: + settings['file_timestamp'] = 0 if 'split_timestamp' not in settings: settings['split_timestamp'] = 0 if 'max_out_sz' not in settings: @@ -198,6 +215,7 @@ if __name__ == '__main__': settings['max_out_sz'] = long(settings['max_out_sz']) settings['split_timestamp'] = int(settings['split_timestamp']) + settings['file_timestamp'] = int(settings['file_timestamp']) settings['netmagic'] = settings['netmagic'].decode('hex') if 'output_file' not in settings and 'output' not in settings: From e4cf9f84797cea8d5c7fa36b99f502a5afe0ceb5 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 4 Sep 2014 13:12:13 -0400 Subject: [PATCH 0647/1288] depends: fix typo in source downloading. Regression from c897b1e732. Some sources are renamed after download, since the filenames don't play nice with (for example) gitian. This fixes the rename. Needed for OSX build as it renames a file. --- depends/funcs.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/funcs.mk b/depends/funcs.mk index 280706efb3..28bfb85492 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -22,8 +22,8 @@ endef define fetch_file (test -f $(SOURCES_PATH)/$(4) || \ ( mkdir -p $$($(1)_extract_dir) && \ - ( $(build_DOWNLOAD) "$$($(1)_extract_dir)/$(3).temp" "$(2)/$(3)" || \ - $(build_DOWNLOAD) "$$($(1)_extract_dir)/$(3).temp" "$(FALLBACK_DOWNLOAD_PATH)/$(3)" ) && \ + ( $(build_DOWNLOAD) "$$($(1)_extract_dir)/$(4).temp" "$(2)/$(3)" || \ + $(build_DOWNLOAD) "$$($(1)_extract_dir)/$(4).temp" "$(FALLBACK_DOWNLOAD_PATH)/$(3)" ) && \ echo "$(5) $$($(1)_extract_dir)/$(4).temp" > $$($(1)_extract_dir)/.$(4).hash && \ $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$(4).hash && \ mv $$($(1)_extract_dir)/$(4).temp $(SOURCES_PATH)/$(4) )) From 81061ffd694958383496a4d1e628d764e648ffbe Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 3 Sep 2014 14:14:01 -0400 Subject: [PATCH 0648/1288] travis: add osx build --- .travis.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2073e71769..379a0e1df7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,10 +14,12 @@ env: - CCACHE_TEMPDIR=/tmp/.ccache-temp - CCACHE_COMPRESS=1 - BASE_OUTDIR=$TRAVIS_BUILD_DIR/out + - SDK_URL=https://bitcoincore.org/depends-sources/sdks cache: apt: true directories: - depends/built + - depends/sdk-sources - $HOME/.ccache matrix: fast_finish: true @@ -30,6 +32,8 @@ matrix: env: HOST=x86_64-unknown-linux-gnu RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" - compiler: "true 4" env: HOST=i686-pc-linux-gnu PACKAGES="g++-multilib" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" + - compiler: "true 5" + env: HOST=x86_64-apple-darwin11 PACKAGES="gcc-multilib g++-multilib cmake libcap-dev libz-dev libbz2-dev" OSX_SDK=10.7 GOAL="deploy" - compiler: "true 6" env: HOST=x86_64-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev" GOAL="deploy" - compiler: "true 7" @@ -39,7 +43,9 @@ install: - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-upgrade -qq $PACKAGES; fi before_script: - unset CC; unset CXX - - mkdir -p depends/SDKs + - mkdir -p depends/SDKs depends/sdk-sources + - if [ -n "$OSX_SDK" -a ! -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then wget $SDK_URL/MacOSX${OSX_SDK}.sdk.tar.gz -O depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi + - if [ -n "$OSX_SDK" -a -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then tar -C depends/SDKs -xf depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi - make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS || (echo "Build failure. Verbose build follows." && make -C depends V=1 HOST=$HOST $DEP_OPTS) script: - OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST From a264e445ff497f2704d386cc3357c6efca352114 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 5 Sep 2014 09:49:57 +0200 Subject: [PATCH 0649/1288] remove dup include of foreach.hpp in script.cpp --- src/script.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/script.cpp b/src/script.cpp index 21883bd41a..06a0a5decf 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -19,10 +19,8 @@ #include #include -#include #include - -#include +#include using namespace std; using namespace boost; From 1ffb99b07f404404c5e84bf6576b27434b7c34ba Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 5 Sep 2014 13:11:11 +0200 Subject: [PATCH 0650/1288] [Qt] copyright, style and indentation cleanup of Qt tests --- src/qt/test/paymentrequestdata.h | 4 ++++ src/qt/test/paymentservertests.cpp | 9 ++++++--- src/qt/test/paymentservertests.h | 8 ++++++-- src/qt/test/test_main.cpp | 7 ++++++- src/qt/test/uritests.cpp | 4 ++++ src/qt/test/uritests.h | 4 ++++ 6 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/qt/test/paymentrequestdata.h b/src/qt/test/paymentrequestdata.h index 49558165f0..aeaa7d89a0 100644 --- a/src/qt/test/paymentrequestdata.h +++ b/src/qt/test/paymentrequestdata.h @@ -1,3 +1,7 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + // // Data for paymentservertests.cpp // diff --git a/src/qt/test/paymentservertests.cpp b/src/qt/test/paymentservertests.cpp index e92a7d2b1a..5d7fe96285 100644 --- a/src/qt/test/paymentservertests.cpp +++ b/src/qt/test/paymentservertests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "paymentservertests.h" #include "optionsmodel.h" @@ -21,7 +25,6 @@ X509 *parse_b64der_cert(const char* cert_data) return cert; } - // // Test payment request handling // @@ -30,7 +33,7 @@ static SendCoinsRecipient handleRequest(PaymentServer* server, std::vector #include diff --git a/src/qt/test/uritests.cpp b/src/qt/test/uritests.cpp index 5c0f4406a7..78a7b1b9b4 100644 --- a/src/qt/test/uritests.cpp +++ b/src/qt/test/uritests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "uritests.h" #include "guiutil.h" diff --git a/src/qt/test/uritests.h b/src/qt/test/uritests.h index 17d4280a90..1ea6d9f075 100644 --- a/src/qt/test/uritests.h +++ b/src/qt/test/uritests.h @@ -1,3 +1,7 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #ifndef URITESTS_H #define URITESTS_H From f79323b0ddbab5c8e6a3bc26450d2699d838e229 Mon Sep 17 00:00:00 2001 From: Teran McKinney Date: Mon, 18 Aug 2014 19:33:51 +0000 Subject: [PATCH 0651/1288] Improve readability of CAddrInfo::IsTerrible - Replaced 86400 with 24*60*60 - Remove references to specific timespans in comments Github-Pull: #4724 --- src/addrman.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/addrman.cpp b/src/addrman.cpp index 704766dbf8..68948ac7ff 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -45,13 +45,13 @@ bool CAddrInfo::IsTerrible(int64_t nNow) const if (nTime > nNow + 10*60) // came in a flying DeLorean return true; - if (nTime==0 || nNow-nTime > ADDRMAN_HORIZON_DAYS*86400) // not seen in over a month + if (nTime==0 || nNow-nTime > ADDRMAN_HORIZON_DAYS*24*60*60) // not seen in recent history return true; - if (nLastSuccess==0 && nAttempts>=ADDRMAN_RETRIES) // tried three times and never a success + if (nLastSuccess==0 && nAttempts>=ADDRMAN_RETRIES) // tried N times and never a success return true; - if (nNow-nLastSuccess > ADDRMAN_MIN_FAIL_DAYS*86400 && nAttempts>=ADDRMAN_MAX_FAILURES) // 10 successive failures in the last week + if (nNow-nLastSuccess > ADDRMAN_MIN_FAIL_DAYS*24*60*60 && nAttempts>=ADDRMAN_MAX_FAILURES) // N successive failures in the last week return true; return false; From 2605b94d73d14fbea209193e3013e62cfeea7c44 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 5 Sep 2014 13:54:16 +0200 Subject: [PATCH 0652/1288] [Qt] update form files for setting autoDefault explicitly to false - also fixes indentation in one file (auto fixed by Qt Designer) - removes several default parameters, which are not needed in the files - related to #4840 (but not intended as fix for a no-bug) --- src/qt/forms/addressbookpage.ui | 15 + src/qt/forms/coincontroldialog.ui | 3 + src/qt/forms/openuridialog.ui | 6 +- src/qt/forms/optionsdialog.ui | 6 + src/qt/forms/receivecoinsdialog.ui | 380 ++++++++++++------------ src/qt/forms/receiverequestdialog.ui | 9 + src/qt/forms/rpcconsole.ui | 3 + src/qt/forms/sendcoinsdialog.ui | 9 +- src/qt/forms/signverifymessagedialog.ui | 3 + 9 files changed, 241 insertions(+), 193 deletions(-) diff --git a/src/qt/forms/addressbookpage.ui b/src/qt/forms/addressbookpage.ui index f40c446050..52fdc6ef06 100644 --- a/src/qt/forms/addressbookpage.ui +++ b/src/qt/forms/addressbookpage.ui @@ -63,6 +63,9 @@ :/icons/add:/icons/add
+ + false + @@ -77,6 +80,9 @@ :/icons/editcopy:/icons/editcopy + + false + @@ -91,6 +97,9 @@ :/icons/remove:/icons/remove + + false + @@ -118,6 +127,9 @@ :/icons/export:/icons/export + + false + @@ -131,6 +143,9 @@ C&lose + + false + diff --git a/src/qt/forms/coincontroldialog.ui b/src/qt/forms/coincontroldialog.ui index 67ea3a9d8c..cbe58fec65 100644 --- a/src/qt/forms/coincontroldialog.ui +++ b/src/qt/forms/coincontroldialog.ui @@ -363,6 +363,9 @@ (un)select all + + false + diff --git a/src/qt/forms/openuridialog.ui b/src/qt/forms/openuridialog.ui index cd09ed0246..7fce858bd2 100644 --- a/src/qt/forms/openuridialog.ui +++ b/src/qt/forms/openuridialog.ui @@ -31,8 +31,7 @@ - - + @@ -42,6 +41,9 @@ + + false + diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 47ed4c8bc6..9d094c1a73 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -609,6 +609,12 @@ &OK + + false + + + true + diff --git a/src/qt/forms/receivecoinsdialog.ui b/src/qt/forms/receivecoinsdialog.ui index e1a0a28f81..03fcb2fb50 100644 --- a/src/qt/forms/receivecoinsdialog.ui +++ b/src/qt/forms/receivecoinsdialog.ui @@ -12,192 +12,189 @@ - - + + - 0 - 0 + 0 + 0 - - + + QFrame::StyledPanel - - + + QFrame::Sunken - - - - - - - - Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - - - R&euse an existing receiving address (not recommended) - - - - - - - - - - - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - &Message: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - reqMessage - - - - - - - An optional label to associate with the new receiving address. - - - - - - - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. - - - - - - - Use this form to request payments. All fields are <b>optional</b>. - - - - - - - An optional label to associate with the new receiving address. - - - &Label: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - reqLabel - - - - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - &Amount: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - reqAmount - - - - - - - - 80 - 0 - - - - An optional amount to request. Leave this empty or zero to not request a specific amount. - - - - - - - - - - 150 - 0 - - - - &Request payment - - - - :/icons/receiving_addresses:/icons/receiving_addresses - - - - - - - - 0 - 0 - - - - Clear all fields of the form. - - - Clear - - - - :/icons/remove:/icons/remove - - - 300 - - - false - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - + + + + + + + + Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. + + + R&euse an existing receiving address (not recommended) + + + + + + + + + + + + + + An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. + + + &Message: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + reqMessage + + + + + + + An optional label to associate with the new receiving address. + + + + + + + An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. + + + + + + + Use this form to request payments. All fields are <b>optional</b>. + + + + + + + An optional label to associate with the new receiving address. + + + &Label: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + reqLabel + + + + + + + An optional amount to request. Leave this empty or zero to not request a specific amount. + + + &Amount: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + reqAmount + + + + + + + + 80 + 0 + + + + An optional amount to request. Leave this empty or zero to not request a specific amount. + + + + + + + + + + 150 + 0 + + + + &Request payment + + + + :/icons/receiving_addresses:/icons/receiving_addresses + + + + + + + + 0 + 0 + + + + Clear all fields of the form. + + + Clear + + + + :/icons/remove:/icons/remove + + + false + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + + + @@ -257,36 +254,42 @@ + + false + Show the selected request (does the same as double clicking an entry) Show - - false - :/icons/edit:/icons/edit + + false + + + false + Remove the selected entries from the list Remove - - false - :/icons/remove:/icons/remove + + false + @@ -314,6 +317,7 @@ BitcoinAmountField QLineEdit
bitcoinamountfield.h
+ 1 diff --git a/src/qt/forms/receiverequestdialog.ui b/src/qt/forms/receiverequestdialog.ui index 85928c9be5..1e484dd9a0 100644 --- a/src/qt/forms/receiverequestdialog.ui +++ b/src/qt/forms/receiverequestdialog.ui @@ -74,6 +74,9 @@ Copy &URI + + false +
@@ -81,6 +84,9 @@ Copy &Address + + false + @@ -88,6 +94,9 @@ &Save Image... + + false + diff --git a/src/qt/forms/rpcconsole.ui b/src/qt/forms/rpcconsole.ui index b9b90aa846..7f28209c9a 100644 --- a/src/qt/forms/rpcconsole.ui +++ b/src/qt/forms/rpcconsole.ui @@ -484,6 +484,9 @@ &Clear + + false +
diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui index a631b04670..dce7f4ce4c 100644 --- a/src/qt/forms/sendcoinsdialog.ui +++ b/src/qt/forms/sendcoinsdialog.ui @@ -109,6 +109,9 @@ Inputs... + + false +
@@ -674,6 +677,9 @@ :/icons/send:/icons/send + + false + true @@ -697,9 +703,6 @@ :/icons/remove:/icons/remove - - 300 - false diff --git a/src/qt/forms/signverifymessagedialog.ui b/src/qt/forms/signverifymessagedialog.ui index 53573ec821..40b2da3228 100644 --- a/src/qt/forms/signverifymessagedialog.ui +++ b/src/qt/forms/signverifymessagedialog.ui @@ -19,6 +19,9 @@ + + 0 + &Sign Message From 41ef558aa907c50a055c44c4e6abaf813b23aeff Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 5 Sep 2014 13:10:39 +0200 Subject: [PATCH 0653/1288] univalue: make spaceStr thread-safe Simply add spaces to the existing string instead of using a temporary. Fixes #4756. --- src/univalue/univalue_write.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/univalue/univalue_write.cpp b/src/univalue/univalue_write.cpp index 042091a827..9565cfa11a 100644 --- a/src/univalue/univalue_write.cpp +++ b/src/univalue/univalue_write.cpp @@ -70,15 +70,9 @@ string UniValue::write(unsigned int prettyIndent, return s; } -static string spaceStr; - -static string indentStr(unsigned int prettyIndent, unsigned int indentLevel) +static void indentStr(unsigned int prettyIndent, unsigned int indentLevel, string& s) { - unsigned int spaces = prettyIndent * indentLevel; - while (spaceStr.size() < spaces) - spaceStr += " "; - - return spaceStr.substr(0, spaces); + s.append(prettyIndent * indentLevel, ' '); } void UniValue::writeArray(unsigned int prettyIndent, unsigned int indentLevel, string& s) const @@ -89,7 +83,7 @@ void UniValue::writeArray(unsigned int prettyIndent, unsigned int indentLevel, s for (unsigned int i = 0; i < values.size(); i++) { if (prettyIndent) - s += indentStr(prettyIndent, indentLevel); + indentStr(prettyIndent, indentLevel, s); s += values[i].write(prettyIndent, indentLevel + 1); if (i != (values.size() - 1)) { s += ","; @@ -101,7 +95,7 @@ void UniValue::writeArray(unsigned int prettyIndent, unsigned int indentLevel, s } if (prettyIndent) - s += indentStr(prettyIndent, indentLevel - 1); + indentStr(prettyIndent, indentLevel - 1, s); s += "]"; } @@ -113,7 +107,7 @@ void UniValue::writeObject(unsigned int prettyIndent, unsigned int indentLevel, for (unsigned int i = 0; i < keys.size(); i++) { if (prettyIndent) - s += indentStr(prettyIndent, indentLevel); + indentStr(prettyIndent, indentLevel, s); s += "\"" + json_escape(keys[i]) + "\":"; if (prettyIndent) s += " "; @@ -125,7 +119,7 @@ void UniValue::writeObject(unsigned int prettyIndent, unsigned int indentLevel, } if (prettyIndent) - s += indentStr(prettyIndent, indentLevel - 1); + indentStr(prettyIndent, indentLevel - 1, s); s += "}"; } From 3a7c3483b6df12e84aefb937b85afec746b06b5e Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Wed, 3 Sep 2014 15:07:43 -0400 Subject: [PATCH 0654/1288] Fix make_change to not create half-satoshis --- qa/rpc-tests/util.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index da2b6df197..87baadc5d6 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -10,7 +10,7 @@ import os import sys sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc")) -from decimal import Decimal +from decimal import Decimal, ROUND_DOWN import json import random import shutil @@ -230,10 +230,12 @@ def make_change(from_node, amount_in, amount_out, fee): change = amount_in - amount if change > amount*2: # Create an extra change output to break up big inputs - outputs[from_node.getnewaddress()] = float(change/2) - change = change/2 + change_address = from_node.getnewaddress() + # Split change in two, being careful of rounding: + outputs[change_address] = Decimal(change/2).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN) + change = amount_in - amount - outputs[change_address] if change > 0: - outputs[from_node.getnewaddress()] = float(change) + outputs[from_node.getnewaddress()] = change return outputs def send_zeropri_transaction(from_node, to_node, amount, fee): From 346193bd934bf198dbfd606d8c52c60bc7967858 Mon Sep 17 00:00:00 2001 From: R E Broadley Date: Thu, 4 Sep 2014 09:59:20 +0700 Subject: [PATCH 0655/1288] Cleanup messy error messages --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 2479beabdd..a3b31b719d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4136,7 +4136,7 @@ bool ProcessMessages(CNode* pfrom) // Scan for message start if (memcmp(msg.hdr.pchMessageStart, Params().MessageStart(), MESSAGE_START_SIZE) != 0) { - LogPrintf("\n\nPROCESSMESSAGE: INVALID MESSAGESTART\n\n"); + LogPrintf("PROCESSMESSAGE: INVALID MESSAGESTART %s peer=%d\n", msg.hdr.GetCommand(), pfrom->id); fOk = false; break; } @@ -4145,7 +4145,7 @@ bool ProcessMessages(CNode* pfrom) CMessageHeader& hdr = msg.hdr; if (!hdr.IsValid()) { - LogPrintf("\n\nPROCESSMESSAGE: ERRORS IN HEADER %s\n\n\n", hdr.GetCommand()); + LogPrintf("PROCESSMESSAGE: ERRORS IN HEADER %s peer=%d\n", hdr.GetCommand(), pfrom->id); continue; } string strCommand = hdr.GetCommand(); From 8d657a651735426388c5f7462e2dbf24225a26cb Mon Sep 17 00:00:00 2001 From: ENikS Date: Sat, 6 Sep 2014 15:59:59 -0400 Subject: [PATCH 0656/1288] Fixing compiler warning C4800: 'type' forcing value to bool 'true' or 'false' --- src/allocators.cpp | 4 ++-- src/coins.h | 4 ++-- src/crypter.cpp | 12 ++++++------ src/db.cpp | 2 +- src/init.cpp | 4 ++-- src/key.cpp | 8 ++++---- src/rpcwallet.cpp | 2 +- src/util.cpp | 2 +- src/wallet.cpp | 8 ++++---- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/allocators.cpp b/src/allocators.cpp index 15f34aa2c8..8ecd7206cd 100644 --- a/src/allocators.cpp +++ b/src/allocators.cpp @@ -46,7 +46,7 @@ static inline size_t GetSystemPageSize() bool MemoryPageLocker::Lock(const void *addr, size_t len) { #ifdef WIN32 - return VirtualLock(const_cast(addr), len); + return VirtualLock(const_cast(addr), len) != 0; #else return mlock(addr, len) == 0; #endif @@ -55,7 +55,7 @@ bool MemoryPageLocker::Lock(const void *addr, size_t len) bool MemoryPageLocker::Unlock(const void *addr, size_t len) { #ifdef WIN32 - return VirtualUnlock(const_cast(addr), len); + return VirtualUnlock(const_cast(addr), len) != 0; #else return munlock(addr, len) == 0; #endif diff --git a/src/coins.h b/src/coins.h index d338e3172e..e70b19ff8f 100644 --- a/src/coins.h +++ b/src/coins.h @@ -195,8 +195,8 @@ public: ::Unserialize(s, VARINT(nCode), nType, nVersion); fCoinBase = nCode & 1; std::vector vAvail(2, false); - vAvail[0] = nCode & 2; - vAvail[1] = nCode & 4; + vAvail[0] = (nCode & 2) != 0; + vAvail[1] = (nCode & 4) != 0; unsigned int nMaskCode = (nCode / 8) + ((nCode & 6) != 0 ? 0 : 1); // spentness bitmask while (nMaskCode > 0) { diff --git a/src/crypter.cpp b/src/crypter.cpp index 8aa2bb0517..8f5822dfc5 100644 --- a/src/crypter.cpp +++ b/src/crypter.cpp @@ -62,9 +62,9 @@ bool CCrypter::Encrypt(const CKeyingMaterial& vchPlaintext, std::vector& vchCiphertext, CKeyingM bool fOk = true; EVP_CIPHER_CTX_init(&ctx); - if (fOk) fOk = EVP_DecryptInit_ex(&ctx, EVP_aes_256_cbc(), NULL, chKey, chIV); - if (fOk) fOk = EVP_DecryptUpdate(&ctx, &vchPlaintext[0], &nPLen, &vchCiphertext[0], nLen); - if (fOk) fOk = EVP_DecryptFinal_ex(&ctx, (&vchPlaintext[0])+nPLen, &nFLen); + if (fOk) fOk = EVP_DecryptInit_ex(&ctx, EVP_aes_256_cbc(), NULL, chKey, chIV) != 0; + if (fOk) fOk = EVP_DecryptUpdate(&ctx, &vchPlaintext[0], &nPLen, &vchCiphertext[0], nLen) != 0; + if (fOk) fOk = EVP_DecryptFinal_ex(&ctx, (&vchPlaintext[0]) + nPLen, &nFLen) != 0; EVP_CIPHER_CTX_cleanup(&ctx); if (!fOk) return false; diff --git a/src/db.cpp b/src/db.cpp index 23d2cc988d..4ffbd61edd 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -231,7 +231,7 @@ CDB::CDB(const char *pszFile, const char* pszMode) : if (pszFile == NULL) return; - bool fCreate = strchr(pszMode, 'c'); + bool fCreate = strchr(pszMode, 'c') != NULL; unsigned int nFlags = DB_THREAD; if (fCreate) nFlags |= DB_CREATE; diff --git a/src/init.cpp b/src/init.cpp index b8988f8b75..1450e3481f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -198,7 +198,7 @@ bool static Bind(const CService &addr, unsigned int flags) { if (!(flags & BF_EXPLICIT) && IsLimited(addr)) return false; std::string strError; - if (!BindListenPort(addr, strError, flags & BF_WHITELIST)) { + if (!BindListenPort(addr, strError, (flags & BF_WHITELIST) != 0)) { if (flags & BF_REPORT_ERROR) return InitError(strError); return false; @@ -692,7 +692,7 @@ bool AppInit2(boost::thread_group& threadGroup) std::string strWalletFile = GetArg("-wallet", "wallet.dat"); #endif // ENABLE_WALLET - fIsBareMultisigStd = GetArg("-permitbaremultisig", true); + fIsBareMultisigStd = GetArg("-permitbaremultisig", true) != 0; // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log // Sanity check diff --git a/src/key.cpp b/src/key.cpp index a058ef05e5..8ed787654a 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -172,9 +172,9 @@ public: bool ret; BIGNUM bn; BN_init(&bn); - ret = BN_bin2bn(vch, 32, &bn); + ret = BN_bin2bn(vch, 32, &bn) != NULL; assert(ret); - ret = EC_KEY_regenerate_key(pkey, &bn); + ret = EC_KEY_regenerate_key(pkey, &bn) != 0; assert(ret); BN_clear_free(&bn); } @@ -217,7 +217,7 @@ public: bool SetPubKey(const CPubKey &pubkey) { const unsigned char* pbegin = pubkey.begin(); - return o2i_ECPublicKey(&pkey, &pbegin, pubkey.size()); + return o2i_ECPublicKey(&pkey, &pbegin, pubkey.size()) != NULL; } bool Sign(const uint256 &hash, std::vector& vchSig) { @@ -553,7 +553,7 @@ bool CPubKey::RecoverCompact(const uint256 &hash, const std::vectormapWallet[hash]; - int64_t nCredit = wtx.GetCredit(filter); + int64_t nCredit = wtx.GetCredit(filter != 0); int64_t nDebit = wtx.GetDebit(filter); int64_t nNet = nCredit - nDebit; int64_t nFee = (wtx.IsFromMe(filter) ? wtx.GetValueOut() - nDebit : 0); diff --git a/src/util.cpp b/src/util.cpp index 5a4e187f9e..1a11d038ca 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -494,7 +494,7 @@ bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest) { #ifdef WIN32 return MoveFileExA(src.string().c_str(), dest.string().c_str(), - MOVEFILE_REPLACE_EXISTING); + MOVEFILE_REPLACE_EXISTING) != 0; #else int rc = std::rename(src.string().c_str(), dest.string().c_str()); return (rc == 0); diff --git a/src/wallet.cpp b/src/wallet.cpp index 18a5b3971c..20ee0bbe84 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -637,7 +637,7 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl { { AssertLockHeld(cs_wallet); - bool fExisted = mapWallet.count(tx.GetHash()); + bool fExisted = mapWallet.count(tx.GetHash()) != 0; if (fExisted && !fUpdate) return false; if (fExisted || IsMine(tx) || IsFromMe(tx)) { @@ -1129,7 +1129,7 @@ void CWallet::AvailableCoins(vector& vCoins, bool fOnlyConfirmed, const if (!(IsSpent(wtxid, i)) && mine != ISMINE_NO && !IsLockedCoin((*it).first, i) && pcoin->vout[i].nValue > 0 && (!coinControl || !coinControl->HasSelected() || coinControl->IsSelected((*it).first, i))) - vCoins.push_back(COutput(pcoin, i, nDepth, mine & ISMINE_SPENDABLE)); + vCoins.push_back(COutput(pcoin, i, nDepth, (mine & ISMINE_SPENDABLE) != ISMINE_NO)); } } } @@ -1655,7 +1655,7 @@ bool CWallet::SetAddressBook(const CTxDestination& address, const string& strNam if (!strPurpose.empty()) /* update purpose only if requested */ mapAddressBook[address].purpose = strPurpose; } - NotifyAddressBookChanged(this, address, strName, ::IsMine(*this, address), + NotifyAddressBookChanged(this, address, strName, ::IsMine(*this, address) != ISMINE_NO, strPurpose, (fUpdated ? CT_UPDATED : CT_NEW) ); if (!fFileBacked) return false; @@ -1681,7 +1681,7 @@ bool CWallet::DelAddressBook(const CTxDestination& address) mapAddressBook.erase(address); } - NotifyAddressBookChanged(this, address, "", ::IsMine(*this, address), "", CT_DELETED); + NotifyAddressBookChanged(this, address, "", ::IsMine(*this, address) != ISMINE_NO, "", CT_DELETED); if (!fFileBacked) return false; From 45a4baf100d8e7392e9e26f81069d69e0115ea51 Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Sun, 7 Sep 2014 11:11:57 +0200 Subject: [PATCH 0657/1288] Add testnet DNS seed of Andreas Schildbach. It runs sipas crawler, but rather than using its custom nameserver implementation it serves a generated zonefile via bind9. The zone always contains 25 IPv4 and 25 IPv6 peers. FWIW, the zone is secured using DNSSEC. --- src/chainparams.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index bfe50d77d5..460fabc6e6 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -155,6 +155,7 @@ public: vSeeds.push_back(CDNSSeedData("alexykot.me", "testnet-seed.alexykot.me")); vSeeds.push_back(CDNSSeedData("bitcoin.petertodd.org", "testnet-seed.bitcoin.petertodd.org")); vSeeds.push_back(CDNSSeedData("bluematt.me", "testnet-seed.bluematt.me")); + vSeeds.push_back(CDNSSeedData("bitcoin.schildbach.de", "testnet-seed.bitcoin.schildbach.de")); base58Prefixes[PUBKEY_ADDRESS] = list_of(111); base58Prefixes[SCRIPT_ADDRESS] = list_of(196); From 8e44f2e00a14e1d12f898ae54f77e9de228d206f Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Sun, 7 Sep 2014 22:32:57 -0400 Subject: [PATCH 0658/1288] Clarify 'compressed nor uncompressed' error message --- src/script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script.cpp b/src/script.cpp index 06a0a5decf..f3d423a424 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -238,7 +238,7 @@ bool IsCanonicalPubKey(const valtype &vchPubKey, unsigned int flags) { if (vchPubKey.size() != 33) return error("Non-canonical public key: invalid length for compressed key"); } else { - return error("Non-canonical public key: compressed nor uncompressed"); + return error("Non-canonical public key: neither compressed nor uncompressed"); } return true; } From a95b1199dbcf6c90508250d9b4cfd1df78106a5b Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 8 Sep 2014 10:40:54 +0200 Subject: [PATCH 0659/1288] qt: Remove thousands separators after decimal point Revert thousands separators after decimal point, as introduced in #4167. --- src/qt/bitcoinunits.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp index 6f506d3f25..3215363fa0 100644 --- a/src/qt/bitcoinunits.cpp +++ b/src/qt/bitcoinunits.cpp @@ -115,11 +115,6 @@ QString BitcoinUnits::format(int unit, qint64 n, bool fPlus, SeparatorStyle sepa for (int i = 3; i < q_size; i += 3) quotient_str.insert(q_size - i, thin_sp); - int r_size = remainder_str.size(); - if (separators == separatorAlways || (separators == separatorStandard && r_size > 4)) - for (int i = 3, adj = 0; i < r_size ; i += 3, adj++) - remainder_str.insert(i + adj, thin_sp); - if (n < 0) quotient_str.insert(0, '-'); else if (fPlus && n > 0) From f7d0a86bf687b4ee11870937666806b289ee9a48 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 8 Sep 2014 12:20:50 +0200 Subject: [PATCH 0660/1288] netbase: Use .data() instead of .c_str() on binary string `.c_str()` is only guaranteed to return the data up to the first NUL character. --- src/netbase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netbase.cpp b/src/netbase.cpp index d5821d4465..954c11f77d 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -259,7 +259,7 @@ bool static Socks5(string strDest, int port, SOCKET& hSocket) strSocks5 += strDest; strSocks5 += static_cast((port >> 8) & 0xFF); strSocks5 += static_cast((port >> 0) & 0xFF); - ret = send(hSocket, strSocks5.c_str(), strSocks5.size(), MSG_NOSIGNAL); + ret = send(hSocket, strSocks5.data(), strSocks5.size(), MSG_NOSIGNAL); if (ret != (ssize_t)strSocks5.size()) { CloseSocket(hSocket); From c26649f9ed03fa9505e44aaf7f8cfdaa81f734cc Mon Sep 17 00:00:00 2001 From: Alex Morcos Date: Tue, 26 Aug 2014 12:59:21 -0400 Subject: [PATCH 0661/1288] Track modified size in TxMemPoolEntry so that we can correctly compute priority. --- src/core.cpp | 12 ++++++++++-- src/core.h | 3 +++ src/txmempool.cpp | 4 +++- src/txmempool.h | 1 + 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index 8dcda0126a..491e4fa68b 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -123,6 +123,14 @@ int64_t CTransaction::GetValueOut() const } double CTransaction::ComputePriority(double dPriorityInputs, unsigned int nTxSize) const +{ + nTxSize = CalculateModifiedSize(nTxSize); + if (nTxSize == 0) return 0.0; + + return dPriorityInputs / nTxSize; +} + +unsigned int CTransaction::CalculateModifiedSize(unsigned int nTxSize) const { // In order to avoid disincentivizing cleaning up the UTXO set we don't count // the constant overhead for each txin and up to 110 bytes of scriptSig (which @@ -131,14 +139,14 @@ double CTransaction::ComputePriority(double dPriorityInputs, unsigned int nTxSiz // risk encouraging people to create junk outputs to redeem later. if (nTxSize == 0) nTxSize = ::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION); + BOOST_FOREACH(const CTxIn& txin, vin) { unsigned int offset = 41U + std::min(110U, (unsigned int)txin.scriptSig.size()); if (nTxSize > offset) nTxSize -= offset; } - if (nTxSize == 0) return 0.0; - return dPriorityInputs / nTxSize; + return nTxSize; } std::string CTransaction::ToString() const diff --git a/src/core.h b/src/core.h index 34c00c4142..1233fbde61 100644 --- a/src/core.h +++ b/src/core.h @@ -284,6 +284,9 @@ public: // Compute priority, given priority of inputs and (optionally) tx size double ComputePriority(double dPriorityInputs, unsigned int nTxSize=0) const; + // Compute modified tx size for priority calculation (optionally given tx size) + unsigned int CalculateModifiedSize(unsigned int nTxSize=0) const; + bool IsCoinBase() const { return (vin.size() == 1 && vin[0].prevout.IsNull()); diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 238d5bab16..acdf51c95e 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -23,6 +23,8 @@ CTxMemPoolEntry::CTxMemPoolEntry(const CTransaction& _tx, int64_t _nFee, tx(_tx), nFee(_nFee), nTime(_nTime), dPriority(_dPriority), nHeight(_nHeight) { nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION); + + nModSize = tx.CalculateModifiedSize(nTxSize); } CTxMemPoolEntry::CTxMemPoolEntry(const CTxMemPoolEntry& other) @@ -34,7 +36,7 @@ double CTxMemPoolEntry::GetPriority(unsigned int currentHeight) const { int64_t nValueIn = tx.GetValueOut()+nFee; - double deltaPriority = ((double)(currentHeight-nHeight)*nValueIn)/nTxSize; + double deltaPriority = ((double)(currentHeight-nHeight)*nValueIn)/nModSize; double dResult = dPriority + deltaPriority; return dResult; } diff --git a/src/txmempool.h b/src/txmempool.h index 360364d8b0..b9d50ee0bc 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -31,6 +31,7 @@ private: CTransaction tx; int64_t nFee; // Cached to avoid expensive parent-transaction lookups size_t nTxSize; // ... and avoid recomputing tx size + size_t nModSize; // ... and modified size for priority int64_t nTime; // Local time when entering the mempool double dPriority; // Priority when entering the mempool unsigned int nHeight; // Chain height when entering the mempool From 89d91f6aa74da5e3fb1bbd08ce20ab3b9d593abd Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 8 Sep 2014 17:37:26 +0200 Subject: [PATCH 0662/1288] Avoid repeated lookups in mapOrphanTransactions and mapOrphanTransactionsByPrev --- src/main.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a3b31b719d..2e24eb950f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -492,16 +492,17 @@ bool AddOrphanTx(const CTransaction& tx) void static EraseOrphanTx(uint256 hash) { - if (!mapOrphanTransactions.count(hash)) + map::iterator it = mapOrphanTransactions.find(hash); + if (it == mapOrphanTransactions.end()) return; - const CTransaction& tx = mapOrphanTransactions[hash]; - BOOST_FOREACH(const CTxIn& txin, tx.vin) + BOOST_FOREACH(const CTxIn& txin, it->second.vin) { - mapOrphanTransactionsByPrev[txin.prevout.hash].erase(hash); - if (mapOrphanTransactionsByPrev[txin.prevout.hash].empty()) - mapOrphanTransactionsByPrev.erase(txin.prevout.hash); + map >::iterator itPrev = mapOrphanTransactionsByPrev.find(txin.prevout.hash); + itPrev->second.erase(hash); + if (itPrev->second.empty()) + mapOrphanTransactionsByPrev.erase(itPrev); } - mapOrphanTransactions.erase(hash); + mapOrphanTransactions.erase(it); } unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans) @@ -3769,9 +3770,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // Recursively process any orphan transactions that depended on this one for (unsigned int i = 0; i < vWorkQueue.size(); i++) { - uint256 hashPrev = vWorkQueue[i]; - for (set::iterator mi = mapOrphanTransactionsByPrev[hashPrev].begin(); - mi != mapOrphanTransactionsByPrev[hashPrev].end(); + map >::iterator itByPrev = mapOrphanTransactionsByPrev.find(vWorkQueue[i]); + if (itByPrev == mapOrphanTransactionsByPrev.end()) + continue; + for (set::iterator mi = itByPrev->second.begin(); + mi != itByPrev->second.end(); ++mi) { const uint256& orphanHash = *mi; From 86dbeea2cdd5749374c98afea3e4f5f49817f746 Mon Sep 17 00:00:00 2001 From: jtimon Date: Thu, 14 Aug 2014 13:54:05 +0200 Subject: [PATCH 0663/1288] Rename script.h/.cpp to scriptutils.h/.cpp (plus remove duplicated includes) --- src/Makefile.am | 4 ++-- src/base58.h | 2 +- src/bloom.cpp | 2 +- src/core.h | 2 +- src/core_read.cpp | 2 +- src/core_write.cpp | 2 +- src/crypter.cpp | 2 +- src/keystore.cpp | 2 +- src/main.h | 2 +- src/qt/transactiondesc.cpp | 2 +- src/{script.cpp => scriptutils.cpp} | 2 +- src/{script.h => scriptutils.h} | 4 ++-- src/test/DoS_tests.cpp | 2 +- src/test/base58_tests.cpp | 2 +- src/test/canonical_tests.cpp | 2 +- src/test/key_tests.cpp | 2 +- src/test/multisig_tests.cpp | 2 +- src/test/script_P2SH_tests.cpp | 4 +--- src/test/script_tests.cpp | 4 +--- src/test/scriptnum_tests.cpp | 2 +- src/test/sighash_tests.cpp | 2 +- src/test/sigopcount_tests.cpp | 2 +- src/test/transaction_tests.cpp | 2 +- 23 files changed, 25 insertions(+), 29 deletions(-) rename src/{script.cpp => scriptutils.cpp} (99%) rename src/{script.h => scriptutils.h} (99%) diff --git a/src/Makefile.am b/src/Makefile.am index 35fca6570f..e6fc1fdbef 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -98,7 +98,7 @@ BITCOIN_CORE_H = \ rpcclient.h \ rpcprotocol.h \ rpcserver.h \ - script.h \ + scriptutils.h \ serialize.h \ sync.h \ threadsafety.h \ @@ -206,7 +206,7 @@ libbitcoin_common_a_SOURCES = \ keystore.cpp \ netbase.cpp \ protocol.cpp \ - script.cpp \ + scriptutils.cpp \ $(BITCOIN_CORE_H) # util: shared between all executables. diff --git a/src/base58.h b/src/base58.h index 70681f589a..a4dc726767 100644 --- a/src/base58.h +++ b/src/base58.h @@ -16,7 +16,7 @@ #include "chainparams.h" #include "key.h" -#include "script.h" +#include "scriptutils.h" #include #include diff --git a/src/bloom.cpp b/src/bloom.cpp index e34041336f..07990beb15 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -5,7 +5,7 @@ #include "bloom.h" #include "core.h" -#include "script.h" +#include "scriptutils.h" #include #include diff --git a/src/core.h b/src/core.h index cde8d8b3fe..0df75670fd 100644 --- a/src/core.h +++ b/src/core.h @@ -6,7 +6,7 @@ #ifndef BITCOIN_CORE_H #define BITCOIN_CORE_H -#include "script.h" +#include "scriptutils.h" #include "serialize.h" #include "uint256.h" diff --git a/src/core_read.cpp b/src/core_read.cpp index 57f1397f18..41d8d6b492 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -5,7 +5,7 @@ #include "core_io.h" #include "core.h" #include "serialize.h" -#include "script.h" +#include "scriptutils.h" #include "util.h" #include diff --git a/src/core_write.cpp b/src/core_write.cpp index e66e75515c..e816611809 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -4,7 +4,7 @@ #include "core_io.h" #include "univalue/univalue.h" -#include "script.h" +#include "scriptutils.h" #include "core.h" #include "serialize.h" #include "util.h" diff --git a/src/crypter.cpp b/src/crypter.cpp index 8aa2bb0517..ac5c8952e6 100644 --- a/src/crypter.cpp +++ b/src/crypter.cpp @@ -4,7 +4,7 @@ #include "crypter.h" -#include "script.h" +#include "scriptutils.h" #include "util.h" #include diff --git a/src/keystore.cpp b/src/keystore.cpp index 72ae9b0a30..e273bbb1de 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -7,7 +7,7 @@ #include "crypter.h" #include "key.h" -#include "script.h" +#include "scriptutils.h" #include "util.h" #include diff --git a/src/main.h b/src/main.h index 8c0a743e24..1fc9b3ecf1 100644 --- a/src/main.h +++ b/src/main.h @@ -15,7 +15,7 @@ #include "core.h" #include "net.h" #include "pow.h" -#include "script.h" +#include "scriptutils.h" #include "sync.h" #include "txmempool.h" #include "uint256.h" diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 8258e719a3..d1feeef179 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -11,7 +11,7 @@ #include "db.h" #include "main.h" #include "paymentserver.h" -#include "script.h" +#include "scriptutils.h" #include "transactionrecord.h" #include "timedata.h" #include "ui_interface.h" diff --git a/src/script.cpp b/src/scriptutils.cpp similarity index 99% rename from src/script.cpp rename to src/scriptutils.cpp index f3d423a424..ce0d3b7537 100644 --- a/src/script.cpp +++ b/src/scriptutils.cpp @@ -3,7 +3,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "script.h" +#include "scriptutils.h" #include "crypto/ripemd160.h" #include "crypto/sha1.h" diff --git a/src/script.h b/src/scriptutils.h similarity index 99% rename from src/script.h rename to src/scriptutils.h index d17cfe3fa4..44f18483c3 100644 --- a/src/script.h +++ b/src/scriptutils.h @@ -3,8 +3,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef H_BITCOIN_SCRIPT -#define H_BITCOIN_SCRIPT +#ifndef H_BITCOIN_SCRIPTUTILS +#define H_BITCOIN_SCRIPTUTILS #include "key.h" #include "utilstrencodings.h" diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index 8fa38c3605..a113425891 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -12,7 +12,7 @@ #include "main.h" #include "net.h" #include "pow.h" -#include "script.h" +#include "scriptutils.h" #include "serialize.h" #include "util.h" diff --git a/src/test/base58_tests.cpp b/src/test/base58_tests.cpp index 0ac3e9a363..0587ddac84 100644 --- a/src/test/base58_tests.cpp +++ b/src/test/base58_tests.cpp @@ -9,7 +9,7 @@ #include "data/base58_keys_valid.json.h" #include "key.h" -#include "script.h" +#include "scriptutils.h" #include "uint256.h" #include "util.h" diff --git a/src/test/canonical_tests.cpp b/src/test/canonical_tests.cpp index a9798623ea..2d2a600740 100644 --- a/src/test/canonical_tests.cpp +++ b/src/test/canonical_tests.cpp @@ -9,7 +9,7 @@ #include "data/sig_noncanonical.json.h" #include "data/sig_canonical.json.h" #include "random.h" -#include "script.h" +#include "scriptutils.h" #include "util.h" #include diff --git a/src/test/key_tests.cpp b/src/test/key_tests.cpp index 864d90128c..c6bf0db3af 100644 --- a/src/test/key_tests.cpp +++ b/src/test/key_tests.cpp @@ -5,7 +5,7 @@ #include "key.h" #include "base58.h" -#include "script.h" +#include "scriptutils.h" #include "uint256.h" #include "util.h" diff --git a/src/test/multisig_tests.cpp b/src/test/multisig_tests.cpp index 02c6d095f2..2e45a7a022 100644 --- a/src/test/multisig_tests.cpp +++ b/src/test/multisig_tests.cpp @@ -5,7 +5,7 @@ #include "key.h" #include "keystore.h" #include "main.h" -#include "script.h" +#include "scriptutils.h" #include "uint256.h" #include diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index 51ff1ffbc9..d27fc71598 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -2,12 +2,10 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "script.h" - #include "key.h" #include "keystore.h" #include "main.h" -#include "script.h" +#include "scriptutils.h" #include diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 77c44501ab..a8ccd50598 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -2,15 +2,13 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "script.h" - #include "data/script_invalid.json.h" #include "data/script_valid.json.h" #include "key.h" #include "keystore.h" #include "main.h" -#include "script.h" +#include "scriptutils.h" #include "core_io.h" #include diff --git a/src/test/scriptnum_tests.cpp b/src/test/scriptnum_tests.cpp index cd194cc4d9..c3cd41cf84 100644 --- a/src/test/scriptnum_tests.cpp +++ b/src/test/scriptnum_tests.cpp @@ -3,7 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "bignum.h" -#include "script.h" +#include "scriptutils.h" #include #include #include diff --git a/src/test/sighash_tests.cpp b/src/test/sighash_tests.cpp index bff151cdda..53f4d443c4 100644 --- a/src/test/sighash_tests.cpp +++ b/src/test/sighash_tests.cpp @@ -6,7 +6,7 @@ #include "main.h" #include "random.h" #include "serialize.h" -#include "script.h" +#include "scriptutils.h" #include "util.h" #include "version.h" diff --git a/src/test/sigopcount_tests.cpp b/src/test/sigopcount_tests.cpp index 722f14a989..963ccf560d 100644 --- a/src/test/sigopcount_tests.cpp +++ b/src/test/sigopcount_tests.cpp @@ -3,7 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "key.h" -#include "script.h" +#include "scriptutils.h" #include "uint256.h" #include diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 03919e7c7d..2b5161b0cf 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -8,7 +8,7 @@ #include "key.h" #include "keystore.h" #include "main.h" -#include "script.h" +#include "scriptutils.h" #include "core_io.h" #include From cbd22a50c4b3d2d0f133c5f8d34c9c7aca9c7f4f Mon Sep 17 00:00:00 2001 From: jtimon Date: Wed, 20 Aug 2014 17:37:40 +0200 Subject: [PATCH 0664/1288] Move CScript class and dependencies to script/script --- src/Makefile.am | 2 + src/base58.h | 2 +- src/core_read.cpp | 2 +- src/crypter.cpp | 2 +- src/keystore.cpp | 2 +- src/qt/transactiondesc.cpp | 2 +- src/script/script.cpp | 295 +++++++++++++++ src/script/script.h | 645 +++++++++++++++++++++++++++++++++ src/scriptutils.cpp | 288 --------------- src/scriptutils.h | 637 +------------------------------- src/test/base58_tests.cpp | 2 +- src/test/key_tests.cpp | 2 +- src/test/multisig_tests.cpp | 1 + src/test/script_P2SH_tests.cpp | 1 + src/test/script_tests.cpp | 1 + src/test/scriptnum_tests.cpp | 2 +- src/test/sighash_tests.cpp | 1 + src/test/sigopcount_tests.cpp | 2 +- src/test/transaction_tests.cpp | 2 +- 19 files changed, 957 insertions(+), 934 deletions(-) create mode 100644 src/script/script.cpp create mode 100644 src/script/script.h diff --git a/src/Makefile.am b/src/Makefile.am index e6fc1fdbef..a9f1ceeeba 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -98,6 +98,7 @@ BITCOIN_CORE_H = \ rpcclient.h \ rpcprotocol.h \ rpcserver.h \ + script/script.h \ scriptutils.h \ serialize.h \ sync.h \ @@ -206,6 +207,7 @@ libbitcoin_common_a_SOURCES = \ keystore.cpp \ netbase.cpp \ protocol.cpp \ + script/script.cpp \ scriptutils.cpp \ $(BITCOIN_CORE_H) diff --git a/src/base58.h b/src/base58.h index a4dc726767..216aca3648 100644 --- a/src/base58.h +++ b/src/base58.h @@ -16,7 +16,7 @@ #include "chainparams.h" #include "key.h" -#include "scriptutils.h" +#include "script/script.h" #include #include diff --git a/src/core_read.cpp b/src/core_read.cpp index 41d8d6b492..efcecb106f 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -5,7 +5,7 @@ #include "core_io.h" #include "core.h" #include "serialize.h" -#include "scriptutils.h" +#include "script/script.h" #include "util.h" #include diff --git a/src/crypter.cpp b/src/crypter.cpp index ac5c8952e6..3df13021df 100644 --- a/src/crypter.cpp +++ b/src/crypter.cpp @@ -4,7 +4,7 @@ #include "crypter.h" -#include "scriptutils.h" +#include "script/script.h" #include "util.h" #include diff --git a/src/keystore.cpp b/src/keystore.cpp index e273bbb1de..98bc0e9e28 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -7,7 +7,7 @@ #include "crypter.h" #include "key.h" -#include "scriptutils.h" +#include "script/script.h" #include "util.h" #include diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index d1feeef179..727b8dc66d 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -11,7 +11,7 @@ #include "db.h" #include "main.h" #include "paymentserver.h" -#include "scriptutils.h" +#include "script/script.h" #include "transactionrecord.h" #include "timedata.h" #include "ui_interface.h" diff --git a/src/script/script.cpp b/src/script/script.cpp new file mode 100644 index 0000000000..60d1beac95 --- /dev/null +++ b/src/script/script.cpp @@ -0,0 +1,295 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2013 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "script.h" + +#include + +using namespace std; + +const char* GetOpName(opcodetype opcode) +{ + switch (opcode) + { + // push value + case OP_0 : return "0"; + case OP_PUSHDATA1 : return "OP_PUSHDATA1"; + case OP_PUSHDATA2 : return "OP_PUSHDATA2"; + case OP_PUSHDATA4 : return "OP_PUSHDATA4"; + case OP_1NEGATE : return "-1"; + case OP_RESERVED : return "OP_RESERVED"; + case OP_1 : return "1"; + case OP_2 : return "2"; + case OP_3 : return "3"; + case OP_4 : return "4"; + case OP_5 : return "5"; + case OP_6 : return "6"; + case OP_7 : return "7"; + case OP_8 : return "8"; + case OP_9 : return "9"; + case OP_10 : return "10"; + case OP_11 : return "11"; + case OP_12 : return "12"; + case OP_13 : return "13"; + case OP_14 : return "14"; + case OP_15 : return "15"; + case OP_16 : return "16"; + + // control + case OP_NOP : return "OP_NOP"; + case OP_VER : return "OP_VER"; + case OP_IF : return "OP_IF"; + case OP_NOTIF : return "OP_NOTIF"; + case OP_VERIF : return "OP_VERIF"; + case OP_VERNOTIF : return "OP_VERNOTIF"; + case OP_ELSE : return "OP_ELSE"; + case OP_ENDIF : return "OP_ENDIF"; + case OP_VERIFY : return "OP_VERIFY"; + case OP_RETURN : return "OP_RETURN"; + + // stack ops + case OP_TOALTSTACK : return "OP_TOALTSTACK"; + case OP_FROMALTSTACK : return "OP_FROMALTSTACK"; + case OP_2DROP : return "OP_2DROP"; + case OP_2DUP : return "OP_2DUP"; + case OP_3DUP : return "OP_3DUP"; + case OP_2OVER : return "OP_2OVER"; + case OP_2ROT : return "OP_2ROT"; + case OP_2SWAP : return "OP_2SWAP"; + case OP_IFDUP : return "OP_IFDUP"; + case OP_DEPTH : return "OP_DEPTH"; + case OP_DROP : return "OP_DROP"; + case OP_DUP : return "OP_DUP"; + case OP_NIP : return "OP_NIP"; + case OP_OVER : return "OP_OVER"; + case OP_PICK : return "OP_PICK"; + case OP_ROLL : return "OP_ROLL"; + case OP_ROT : return "OP_ROT"; + case OP_SWAP : return "OP_SWAP"; + case OP_TUCK : return "OP_TUCK"; + + // splice ops + case OP_CAT : return "OP_CAT"; + case OP_SUBSTR : return "OP_SUBSTR"; + case OP_LEFT : return "OP_LEFT"; + case OP_RIGHT : return "OP_RIGHT"; + case OP_SIZE : return "OP_SIZE"; + + // bit logic + case OP_INVERT : return "OP_INVERT"; + case OP_AND : return "OP_AND"; + case OP_OR : return "OP_OR"; + case OP_XOR : return "OP_XOR"; + case OP_EQUAL : return "OP_EQUAL"; + case OP_EQUALVERIFY : return "OP_EQUALVERIFY"; + case OP_RESERVED1 : return "OP_RESERVED1"; + case OP_RESERVED2 : return "OP_RESERVED2"; + + // numeric + case OP_1ADD : return "OP_1ADD"; + case OP_1SUB : return "OP_1SUB"; + case OP_2MUL : return "OP_2MUL"; + case OP_2DIV : return "OP_2DIV"; + case OP_NEGATE : return "OP_NEGATE"; + case OP_ABS : return "OP_ABS"; + case OP_NOT : return "OP_NOT"; + case OP_0NOTEQUAL : return "OP_0NOTEQUAL"; + case OP_ADD : return "OP_ADD"; + case OP_SUB : return "OP_SUB"; + case OP_MUL : return "OP_MUL"; + case OP_DIV : return "OP_DIV"; + case OP_MOD : return "OP_MOD"; + case OP_LSHIFT : return "OP_LSHIFT"; + case OP_RSHIFT : return "OP_RSHIFT"; + case OP_BOOLAND : return "OP_BOOLAND"; + case OP_BOOLOR : return "OP_BOOLOR"; + case OP_NUMEQUAL : return "OP_NUMEQUAL"; + case OP_NUMEQUALVERIFY : return "OP_NUMEQUALVERIFY"; + case OP_NUMNOTEQUAL : return "OP_NUMNOTEQUAL"; + case OP_LESSTHAN : return "OP_LESSTHAN"; + case OP_GREATERTHAN : return "OP_GREATERTHAN"; + case OP_LESSTHANOREQUAL : return "OP_LESSTHANOREQUAL"; + case OP_GREATERTHANOREQUAL : return "OP_GREATERTHANOREQUAL"; + case OP_MIN : return "OP_MIN"; + case OP_MAX : return "OP_MAX"; + case OP_WITHIN : return "OP_WITHIN"; + + // crypto + case OP_RIPEMD160 : return "OP_RIPEMD160"; + case OP_SHA1 : return "OP_SHA1"; + case OP_SHA256 : return "OP_SHA256"; + case OP_HASH160 : return "OP_HASH160"; + case OP_HASH256 : return "OP_HASH256"; + case OP_CODESEPARATOR : return "OP_CODESEPARATOR"; + case OP_CHECKSIG : return "OP_CHECKSIG"; + case OP_CHECKSIGVERIFY : return "OP_CHECKSIGVERIFY"; + case OP_CHECKMULTISIG : return "OP_CHECKMULTISIG"; + case OP_CHECKMULTISIGVERIFY : return "OP_CHECKMULTISIGVERIFY"; + + // expanson + case OP_NOP1 : return "OP_NOP1"; + case OP_NOP2 : return "OP_NOP2"; + case OP_NOP3 : return "OP_NOP3"; + case OP_NOP4 : return "OP_NOP4"; + case OP_NOP5 : return "OP_NOP5"; + case OP_NOP6 : return "OP_NOP6"; + case OP_NOP7 : return "OP_NOP7"; + case OP_NOP8 : return "OP_NOP8"; + case OP_NOP9 : return "OP_NOP9"; + case OP_NOP10 : return "OP_NOP10"; + + case OP_INVALIDOPCODE : return "OP_INVALIDOPCODE"; + + // Note: + // The template matching params OP_SMALLDATA/etc are defined in opcodetype enum + // as kind of implementation hack, they are *NOT* real opcodes. If found in real + // Script, just let the default: case deal with them. + + default: + return "OP_UNKNOWN"; + } +} + +unsigned int CScript::GetSigOpCount(bool fAccurate) const +{ + unsigned int n = 0; + const_iterator pc = begin(); + opcodetype lastOpcode = OP_INVALIDOPCODE; + while (pc < end()) + { + opcodetype opcode; + if (!GetOp(pc, opcode)) + break; + if (opcode == OP_CHECKSIG || opcode == OP_CHECKSIGVERIFY) + n++; + else if (opcode == OP_CHECKMULTISIG || opcode == OP_CHECKMULTISIGVERIFY) + { + if (fAccurate && lastOpcode >= OP_1 && lastOpcode <= OP_16) + n += DecodeOP_N(lastOpcode); + else + n += 20; + } + lastOpcode = opcode; + } + return n; +} + +unsigned int CScript::GetSigOpCount(const CScript& scriptSig) const +{ + if (!IsPayToScriptHash()) + return GetSigOpCount(true); + + // This is a pay-to-script-hash scriptPubKey; + // get the last item that the scriptSig + // pushes onto the stack: + const_iterator pc = scriptSig.begin(); + vector data; + while (pc < scriptSig.end()) + { + opcodetype opcode; + if (!scriptSig.GetOp(pc, opcode, data)) + return 0; + if (opcode > OP_16) + return 0; + } + + /// ... and return its opcount: + CScript subscript(data.begin(), data.end()); + return subscript.GetSigOpCount(true); +} + +bool CScript::IsPayToScriptHash() const +{ + // Extra-fast test for pay-to-script-hash CScripts: + return (this->size() == 23 && + this->at(0) == OP_HASH160 && + this->at(1) == 0x14 && + this->at(22) == OP_EQUAL); +} + +bool CScript::IsPushOnly() const +{ + const_iterator pc = begin(); + while (pc < end()) + { + opcodetype opcode; + if (!GetOp(pc, opcode)) + return false; + // Note that IsPushOnly() *does* consider OP_RESERVED to be a + // push-type opcode, however execution of OP_RESERVED fails, so + // it's not relevant to P2SH as the scriptSig would fail prior to + // the P2SH special validation code being executed. + if (opcode > OP_16) + return false; + } + return true; +} + +bool CScript::HasCanonicalPushes() const +{ + const_iterator pc = begin(); + while (pc < end()) + { + opcodetype opcode; + std::vector data; + if (!GetOp(pc, opcode, data)) + return false; + if (opcode > OP_16) + continue; + if (opcode < OP_PUSHDATA1 && opcode > OP_0 && (data.size() == 1 && data[0] <= 16)) + // Could have used an OP_n code, rather than a 1-byte push. + return false; + if (opcode == OP_PUSHDATA1 && data.size() < OP_PUSHDATA1) + // Could have used a normal n-byte push, rather than OP_PUSHDATA1. + return false; + if (opcode == OP_PUSHDATA2 && data.size() <= 0xFF) + // Could have used an OP_PUSHDATA1. + return false; + if (opcode == OP_PUSHDATA4 && data.size() <= 0xFFFF) + // Could have used an OP_PUSHDATA2. + return false; + } + return true; +} + +class CScriptVisitor : public boost::static_visitor +{ +private: + CScript *script; +public: + CScriptVisitor(CScript *scriptin) { script = scriptin; } + + bool operator()(const CNoDestination &dest) const { + script->clear(); + return false; + } + + bool operator()(const CKeyID &keyID) const { + script->clear(); + *script << OP_DUP << OP_HASH160 << keyID << OP_EQUALVERIFY << OP_CHECKSIG; + return true; + } + + bool operator()(const CScriptID &scriptID) const { + script->clear(); + *script << OP_HASH160 << scriptID << OP_EQUAL; + return true; + } +}; + +void CScript::SetDestination(const CTxDestination& dest) +{ + boost::apply_visitor(CScriptVisitor(this), dest); +} + +void CScript::SetMultisig(int nRequired, const std::vector& keys) +{ + this->clear(); + + *this << EncodeOP_N(nRequired); + BOOST_FOREACH(const CPubKey& key, keys) + *this << key; + *this << EncodeOP_N(keys.size()) << OP_CHECKMULTISIG; +} diff --git a/src/script/script.h b/src/script/script.h new file mode 100644 index 0000000000..21847c09bd --- /dev/null +++ b/src/script/script.h @@ -0,0 +1,645 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2013 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef H_BITCOIN_SCRIPT +#define H_BITCOIN_SCRIPT + +#include "key.h" +#include "tinyformat.h" +#include "utilstrencodings.h" + +#include + +#include + +static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; // bytes + +/** Script opcodes */ +enum opcodetype +{ + // push value + OP_0 = 0x00, + OP_FALSE = OP_0, + OP_PUSHDATA1 = 0x4c, + OP_PUSHDATA2 = 0x4d, + OP_PUSHDATA4 = 0x4e, + OP_1NEGATE = 0x4f, + OP_RESERVED = 0x50, + OP_1 = 0x51, + OP_TRUE=OP_1, + OP_2 = 0x52, + OP_3 = 0x53, + OP_4 = 0x54, + OP_5 = 0x55, + OP_6 = 0x56, + OP_7 = 0x57, + OP_8 = 0x58, + OP_9 = 0x59, + OP_10 = 0x5a, + OP_11 = 0x5b, + OP_12 = 0x5c, + OP_13 = 0x5d, + OP_14 = 0x5e, + OP_15 = 0x5f, + OP_16 = 0x60, + + // control + OP_NOP = 0x61, + OP_VER = 0x62, + OP_IF = 0x63, + OP_NOTIF = 0x64, + OP_VERIF = 0x65, + OP_VERNOTIF = 0x66, + OP_ELSE = 0x67, + OP_ENDIF = 0x68, + OP_VERIFY = 0x69, + OP_RETURN = 0x6a, + + // stack ops + OP_TOALTSTACK = 0x6b, + OP_FROMALTSTACK = 0x6c, + OP_2DROP = 0x6d, + OP_2DUP = 0x6e, + OP_3DUP = 0x6f, + OP_2OVER = 0x70, + OP_2ROT = 0x71, + OP_2SWAP = 0x72, + OP_IFDUP = 0x73, + OP_DEPTH = 0x74, + OP_DROP = 0x75, + OP_DUP = 0x76, + OP_NIP = 0x77, + OP_OVER = 0x78, + OP_PICK = 0x79, + OP_ROLL = 0x7a, + OP_ROT = 0x7b, + OP_SWAP = 0x7c, + OP_TUCK = 0x7d, + + // splice ops + OP_CAT = 0x7e, + OP_SUBSTR = 0x7f, + OP_LEFT = 0x80, + OP_RIGHT = 0x81, + OP_SIZE = 0x82, + + // bit logic + OP_INVERT = 0x83, + OP_AND = 0x84, + OP_OR = 0x85, + OP_XOR = 0x86, + OP_EQUAL = 0x87, + OP_EQUALVERIFY = 0x88, + OP_RESERVED1 = 0x89, + OP_RESERVED2 = 0x8a, + + // numeric + OP_1ADD = 0x8b, + OP_1SUB = 0x8c, + OP_2MUL = 0x8d, + OP_2DIV = 0x8e, + OP_NEGATE = 0x8f, + OP_ABS = 0x90, + OP_NOT = 0x91, + OP_0NOTEQUAL = 0x92, + + OP_ADD = 0x93, + OP_SUB = 0x94, + OP_MUL = 0x95, + OP_DIV = 0x96, + OP_MOD = 0x97, + OP_LSHIFT = 0x98, + OP_RSHIFT = 0x99, + + OP_BOOLAND = 0x9a, + OP_BOOLOR = 0x9b, + OP_NUMEQUAL = 0x9c, + OP_NUMEQUALVERIFY = 0x9d, + OP_NUMNOTEQUAL = 0x9e, + OP_LESSTHAN = 0x9f, + OP_GREATERTHAN = 0xa0, + OP_LESSTHANOREQUAL = 0xa1, + OP_GREATERTHANOREQUAL = 0xa2, + OP_MIN = 0xa3, + OP_MAX = 0xa4, + + OP_WITHIN = 0xa5, + + // crypto + OP_RIPEMD160 = 0xa6, + OP_SHA1 = 0xa7, + OP_SHA256 = 0xa8, + OP_HASH160 = 0xa9, + OP_HASH256 = 0xaa, + OP_CODESEPARATOR = 0xab, + OP_CHECKSIG = 0xac, + OP_CHECKSIGVERIFY = 0xad, + OP_CHECKMULTISIG = 0xae, + OP_CHECKMULTISIGVERIFY = 0xaf, + + // expansion + OP_NOP1 = 0xb0, + OP_NOP2 = 0xb1, + OP_NOP3 = 0xb2, + OP_NOP4 = 0xb3, + OP_NOP5 = 0xb4, + OP_NOP6 = 0xb5, + OP_NOP7 = 0xb6, + OP_NOP8 = 0xb7, + OP_NOP9 = 0xb8, + OP_NOP10 = 0xb9, + + + // template matching params + OP_SMALLDATA = 0xf9, + OP_SMALLINTEGER = 0xfa, + OP_PUBKEYS = 0xfb, + OP_PUBKEYHASH = 0xfd, + OP_PUBKEY = 0xfe, + + OP_INVALIDOPCODE = 0xff, +}; + +const char* GetOpName(opcodetype opcode); + +class scriptnum_error : public std::runtime_error +{ +public: + explicit scriptnum_error(const std::string& str) : std::runtime_error(str) {} +}; + +class CScriptNum +{ +// Numeric opcodes (OP_1ADD, etc) are restricted to operating on 4-byte integers. +// The semantics are subtle, though: operands must be in the range [-2^31 +1...2^31 -1], +// but results may overflow (and are valid as long as they are not used in a subsequent +// numeric operation). CScriptNum enforces those semantics by storing results as +// an int64 and allowing out-of-range values to be returned as a vector of bytes but +// throwing an exception if arithmetic is done or the result is interpreted as an integer. +public: + + explicit CScriptNum(const int64_t& n) + { + m_value = n; + } + + explicit CScriptNum(const std::vector& vch) + { + if (vch.size() > nMaxNumSize) + throw scriptnum_error("CScriptNum(const std::vector&) : overflow"); + m_value = set_vch(vch); + } + + inline bool operator==(const int64_t& rhs) const { return m_value == rhs; } + inline bool operator!=(const int64_t& rhs) const { return m_value != rhs; } + inline bool operator<=(const int64_t& rhs) const { return m_value <= rhs; } + inline bool operator< (const int64_t& rhs) const { return m_value < rhs; } + inline bool operator>=(const int64_t& rhs) const { return m_value >= rhs; } + inline bool operator> (const int64_t& rhs) const { return m_value > rhs; } + + inline bool operator==(const CScriptNum& rhs) const { return operator==(rhs.m_value); } + inline bool operator!=(const CScriptNum& rhs) const { return operator!=(rhs.m_value); } + inline bool operator<=(const CScriptNum& rhs) const { return operator<=(rhs.m_value); } + inline bool operator< (const CScriptNum& rhs) const { return operator< (rhs.m_value); } + inline bool operator>=(const CScriptNum& rhs) const { return operator>=(rhs.m_value); } + inline bool operator> (const CScriptNum& rhs) const { return operator> (rhs.m_value); } + + inline CScriptNum operator+( const int64_t& rhs) const { return CScriptNum(m_value + rhs);} + inline CScriptNum operator-( const int64_t& rhs) const { return CScriptNum(m_value - rhs);} + inline CScriptNum operator+( const CScriptNum& rhs) const { return operator+(rhs.m_value); } + inline CScriptNum operator-( const CScriptNum& rhs) const { return operator-(rhs.m_value); } + + inline CScriptNum& operator+=( const CScriptNum& rhs) { return operator+=(rhs.m_value); } + inline CScriptNum& operator-=( const CScriptNum& rhs) { return operator-=(rhs.m_value); } + + inline CScriptNum operator-() const + { + assert(m_value != std::numeric_limits::min()); + return CScriptNum(-m_value); + } + + inline CScriptNum& operator=( const int64_t& rhs) + { + m_value = rhs; + return *this; + } + + inline CScriptNum& operator+=( const int64_t& rhs) + { + assert(rhs == 0 || (rhs > 0 && m_value <= std::numeric_limits::max() - rhs) || + (rhs < 0 && m_value >= std::numeric_limits::min() - rhs)); + m_value += rhs; + return *this; + } + + inline CScriptNum& operator-=( const int64_t& rhs) + { + assert(rhs == 0 || (rhs > 0 && m_value >= std::numeric_limits::min() + rhs) || + (rhs < 0 && m_value <= std::numeric_limits::max() + rhs)); + m_value -= rhs; + return *this; + } + + int getint() const + { + if (m_value > std::numeric_limits::max()) + return std::numeric_limits::max(); + else if (m_value < std::numeric_limits::min()) + return std::numeric_limits::min(); + return m_value; + } + + std::vector getvch() const + { + return serialize(m_value); + } + + static std::vector serialize(const int64_t& value) + { + if(value == 0) + return std::vector(); + + std::vector result; + const bool neg = value < 0; + uint64_t absvalue = neg ? -value : value; + + while(absvalue) + { + result.push_back(absvalue & 0xff); + absvalue >>= 8; + } + +// - If the most significant byte is >= 0x80 and the value is positive, push a +// new zero-byte to make the significant byte < 0x80 again. + +// - If the most significant byte is >= 0x80 and the value is negative, push a +// new 0x80 byte that will be popped off when converting to an integral. + +// - If the most significant byte is < 0x80 and the value is negative, add +// 0x80 to it, since it will be subtracted and interpreted as a negative when +// converting to an integral. + + if (result.back() & 0x80) + result.push_back(neg ? 0x80 : 0); + else if (neg) + result.back() |= 0x80; + + return result; + } + + static const size_t nMaxNumSize = 4; + +private: + static int64_t set_vch(const std::vector& vch) + { + if (vch.empty()) + return 0; + + int64_t result = 0; + for (size_t i = 0; i != vch.size(); ++i) + result |= static_cast(vch[i]) << 8*i; + + // If the input vector's most significant byte is 0x80, remove it from + // the result's msb and return a negative. + if (vch.back() & 0x80) + return -(result & ~(0x80ULL << (8 * (vch.size() - 1)))); + + return result; + } + + int64_t m_value; +}; + +inline std::string ValueString(const std::vector& vch) +{ + if (vch.size() <= 4) + return strprintf("%d", CScriptNum(vch).getint()); + else + return HexStr(vch); +} + +class CNoDestination { +public: + friend bool operator==(const CNoDestination &a, const CNoDestination &b) { return true; } + friend bool operator<(const CNoDestination &a, const CNoDestination &b) { return true; } +}; + +/** A txout script template with a specific destination. It is either: + * * CNoDestination: no destination set + * * CKeyID: TX_PUBKEYHASH destination + * * CScriptID: TX_SCRIPTHASH destination + * A CTxDestination is the internal data type encoded in a CBitcoinAddress + */ +typedef boost::variant CTxDestination; + +/** Serialized script, used inside transaction inputs and outputs */ +class CScript : public std::vector +{ +protected: + CScript& push_int64(int64_t n) + { + if (n == -1 || (n >= 1 && n <= 16)) + { + push_back(n + (OP_1 - 1)); + } + else + { + *this << CScriptNum::serialize(n); + } + return *this; + } +public: + CScript() { } + CScript(const CScript& b) : std::vector(b.begin(), b.end()) { } + CScript(const_iterator pbegin, const_iterator pend) : std::vector(pbegin, pend) { } +#ifndef _MSC_VER + CScript(const unsigned char* pbegin, const unsigned char* pend) : std::vector(pbegin, pend) { } +#endif + + CScript& operator+=(const CScript& b) + { + insert(end(), b.begin(), b.end()); + return *this; + } + + friend CScript operator+(const CScript& a, const CScript& b) + { + CScript ret = a; + ret += b; + return ret; + } + + CScript(int64_t b) { operator<<(b); } + + explicit CScript(opcodetype b) { operator<<(b); } + explicit CScript(const uint256& b) { operator<<(b); } + explicit CScript(const CScriptNum& b) { operator<<(b); } + explicit CScript(const std::vector& b) { operator<<(b); } + + + CScript& operator<<(int64_t b) { return push_int64(b); } + + CScript& operator<<(opcodetype opcode) + { + if (opcode < 0 || opcode > 0xff) + throw std::runtime_error("CScript::operator<<() : invalid opcode"); + insert(end(), (unsigned char)opcode); + return *this; + } + + CScript& operator<<(const uint160& b) + { + insert(end(), sizeof(b)); + insert(end(), (unsigned char*)&b, (unsigned char*)&b + sizeof(b)); + return *this; + } + + CScript& operator<<(const uint256& b) + { + insert(end(), sizeof(b)); + insert(end(), (unsigned char*)&b, (unsigned char*)&b + sizeof(b)); + return *this; + } + + CScript& operator<<(const CPubKey& key) + { + assert(key.size() < OP_PUSHDATA1); + insert(end(), (unsigned char)key.size()); + insert(end(), key.begin(), key.end()); + return *this; + } + + CScript& operator<<(const CScriptNum& b) + { + *this << b.getvch(); + return *this; + } + + CScript& operator<<(const std::vector& b) + { + if (b.size() < OP_PUSHDATA1) + { + insert(end(), (unsigned char)b.size()); + } + else if (b.size() <= 0xff) + { + insert(end(), OP_PUSHDATA1); + insert(end(), (unsigned char)b.size()); + } + else if (b.size() <= 0xffff) + { + insert(end(), OP_PUSHDATA2); + unsigned short nSize = b.size(); + insert(end(), (unsigned char*)&nSize, (unsigned char*)&nSize + sizeof(nSize)); + } + else + { + insert(end(), OP_PUSHDATA4); + unsigned int nSize = b.size(); + insert(end(), (unsigned char*)&nSize, (unsigned char*)&nSize + sizeof(nSize)); + } + insert(end(), b.begin(), b.end()); + return *this; + } + + CScript& operator<<(const CScript& b) + { + // I'm not sure if this should push the script or concatenate scripts. + // If there's ever a use for pushing a script onto a script, delete this member fn + assert(!"Warning: Pushing a CScript onto a CScript with << is probably not intended, use + to concatenate!"); + return *this; + } + + + bool GetOp(iterator& pc, opcodetype& opcodeRet, std::vector& vchRet) + { + // Wrapper so it can be called with either iterator or const_iterator + const_iterator pc2 = pc; + bool fRet = GetOp2(pc2, opcodeRet, &vchRet); + pc = begin() + (pc2 - begin()); + return fRet; + } + + bool GetOp(iterator& pc, opcodetype& opcodeRet) + { + const_iterator pc2 = pc; + bool fRet = GetOp2(pc2, opcodeRet, NULL); + pc = begin() + (pc2 - begin()); + return fRet; + } + + bool GetOp(const_iterator& pc, opcodetype& opcodeRet, std::vector& vchRet) const + { + return GetOp2(pc, opcodeRet, &vchRet); + } + + bool GetOp(const_iterator& pc, opcodetype& opcodeRet) const + { + return GetOp2(pc, opcodeRet, NULL); + } + + bool GetOp2(const_iterator& pc, opcodetype& opcodeRet, std::vector* pvchRet) const + { + opcodeRet = OP_INVALIDOPCODE; + if (pvchRet) + pvchRet->clear(); + if (pc >= end()) + return false; + + // Read instruction + if (end() - pc < 1) + return false; + unsigned int opcode = *pc++; + + // Immediate operand + if (opcode <= OP_PUSHDATA4) + { + unsigned int nSize = 0; + if (opcode < OP_PUSHDATA1) + { + nSize = opcode; + } + else if (opcode == OP_PUSHDATA1) + { + if (end() - pc < 1) + return false; + nSize = *pc++; + } + else if (opcode == OP_PUSHDATA2) + { + if (end() - pc < 2) + return false; + nSize = 0; + memcpy(&nSize, &pc[0], 2); + pc += 2; + } + else if (opcode == OP_PUSHDATA4) + { + if (end() - pc < 4) + return false; + memcpy(&nSize, &pc[0], 4); + pc += 4; + } + if (end() - pc < 0 || (unsigned int)(end() - pc) < nSize) + return false; + if (pvchRet) + pvchRet->assign(pc, pc + nSize); + pc += nSize; + } + + opcodeRet = (opcodetype)opcode; + return true; + } + + // Encode/decode small integers: + static int DecodeOP_N(opcodetype opcode) + { + if (opcode == OP_0) + return 0; + assert(opcode >= OP_1 && opcode <= OP_16); + return (int)opcode - (int)(OP_1 - 1); + } + static opcodetype EncodeOP_N(int n) + { + assert(n >= 0 && n <= 16); + if (n == 0) + return OP_0; + return (opcodetype)(OP_1+n-1); + } + + int FindAndDelete(const CScript& b) + { + int nFound = 0; + if (b.empty()) + return nFound; + iterator pc = begin(); + opcodetype opcode; + do + { + while (end() - pc >= (long)b.size() && memcmp(&pc[0], &b[0], b.size()) == 0) + { + erase(pc, pc + b.size()); + ++nFound; + } + } + while (GetOp(pc, opcode)); + return nFound; + } + int Find(opcodetype op) const + { + int nFound = 0; + opcodetype opcode; + for (const_iterator pc = begin(); pc != end() && GetOp(pc, opcode);) + if (opcode == op) + ++nFound; + return nFound; + } + + // Pre-version-0.6, Bitcoin always counted CHECKMULTISIGs + // as 20 sigops. With pay-to-script-hash, that changed: + // CHECKMULTISIGs serialized in scriptSigs are + // counted more accurately, assuming they are of the form + // ... OP_N CHECKMULTISIG ... + unsigned int GetSigOpCount(bool fAccurate) const; + + // Accurately count sigOps, including sigOps in + // pay-to-script-hash transactions: + unsigned int GetSigOpCount(const CScript& scriptSig) const; + + bool IsPayToScriptHash() const; + + // Called by IsStandardTx and P2SH VerifyScript (which makes it consensus-critical). + bool IsPushOnly() const; + + // Called by IsStandardTx. + bool HasCanonicalPushes() const; + + // Returns whether the script is guaranteed to fail at execution, + // regardless of the initial stack. This allows outputs to be pruned + // instantly when entering the UTXO set. + bool IsUnspendable() const + { + return (size() > 0 && *begin() == OP_RETURN); + } + + void SetDestination(const CTxDestination& address); + void SetMultisig(int nRequired, const std::vector& keys); + + std::string ToString() const + { + std::string str; + opcodetype opcode; + std::vector vch; + const_iterator pc = begin(); + while (pc < end()) + { + if (!str.empty()) + str += " "; + if (!GetOp(pc, opcode, vch)) + { + str += "[error]"; + return str; + } + if (0 <= opcode && opcode <= OP_PUSHDATA4) + str += ValueString(vch); + else + str += GetOpName(opcode); + } + return str; + } + + CScriptID GetID() const + { + return CScriptID(Hash160(*this)); + } + + void clear() + { + // The default std::vector::clear() does not release memory. + std::vector().swap(*this); + } +}; + +#endif diff --git a/src/scriptutils.cpp b/src/scriptutils.cpp index ce0d3b7537..56edc2c2dd 100644 --- a/src/scriptutils.cpp +++ b/src/scriptutils.cpp @@ -81,150 +81,6 @@ const char* GetTxnOutputType(txnouttype t) return NULL; } - -const char* GetOpName(opcodetype opcode) -{ - switch (opcode) - { - // push value - case OP_0 : return "0"; - case OP_PUSHDATA1 : return "OP_PUSHDATA1"; - case OP_PUSHDATA2 : return "OP_PUSHDATA2"; - case OP_PUSHDATA4 : return "OP_PUSHDATA4"; - case OP_1NEGATE : return "-1"; - case OP_RESERVED : return "OP_RESERVED"; - case OP_1 : return "1"; - case OP_2 : return "2"; - case OP_3 : return "3"; - case OP_4 : return "4"; - case OP_5 : return "5"; - case OP_6 : return "6"; - case OP_7 : return "7"; - case OP_8 : return "8"; - case OP_9 : return "9"; - case OP_10 : return "10"; - case OP_11 : return "11"; - case OP_12 : return "12"; - case OP_13 : return "13"; - case OP_14 : return "14"; - case OP_15 : return "15"; - case OP_16 : return "16"; - - // control - case OP_NOP : return "OP_NOP"; - case OP_VER : return "OP_VER"; - case OP_IF : return "OP_IF"; - case OP_NOTIF : return "OP_NOTIF"; - case OP_VERIF : return "OP_VERIF"; - case OP_VERNOTIF : return "OP_VERNOTIF"; - case OP_ELSE : return "OP_ELSE"; - case OP_ENDIF : return "OP_ENDIF"; - case OP_VERIFY : return "OP_VERIFY"; - case OP_RETURN : return "OP_RETURN"; - - // stack ops - case OP_TOALTSTACK : return "OP_TOALTSTACK"; - case OP_FROMALTSTACK : return "OP_FROMALTSTACK"; - case OP_2DROP : return "OP_2DROP"; - case OP_2DUP : return "OP_2DUP"; - case OP_3DUP : return "OP_3DUP"; - case OP_2OVER : return "OP_2OVER"; - case OP_2ROT : return "OP_2ROT"; - case OP_2SWAP : return "OP_2SWAP"; - case OP_IFDUP : return "OP_IFDUP"; - case OP_DEPTH : return "OP_DEPTH"; - case OP_DROP : return "OP_DROP"; - case OP_DUP : return "OP_DUP"; - case OP_NIP : return "OP_NIP"; - case OP_OVER : return "OP_OVER"; - case OP_PICK : return "OP_PICK"; - case OP_ROLL : return "OP_ROLL"; - case OP_ROT : return "OP_ROT"; - case OP_SWAP : return "OP_SWAP"; - case OP_TUCK : return "OP_TUCK"; - - // splice ops - case OP_CAT : return "OP_CAT"; - case OP_SUBSTR : return "OP_SUBSTR"; - case OP_LEFT : return "OP_LEFT"; - case OP_RIGHT : return "OP_RIGHT"; - case OP_SIZE : return "OP_SIZE"; - - // bit logic - case OP_INVERT : return "OP_INVERT"; - case OP_AND : return "OP_AND"; - case OP_OR : return "OP_OR"; - case OP_XOR : return "OP_XOR"; - case OP_EQUAL : return "OP_EQUAL"; - case OP_EQUALVERIFY : return "OP_EQUALVERIFY"; - case OP_RESERVED1 : return "OP_RESERVED1"; - case OP_RESERVED2 : return "OP_RESERVED2"; - - // numeric - case OP_1ADD : return "OP_1ADD"; - case OP_1SUB : return "OP_1SUB"; - case OP_2MUL : return "OP_2MUL"; - case OP_2DIV : return "OP_2DIV"; - case OP_NEGATE : return "OP_NEGATE"; - case OP_ABS : return "OP_ABS"; - case OP_NOT : return "OP_NOT"; - case OP_0NOTEQUAL : return "OP_0NOTEQUAL"; - case OP_ADD : return "OP_ADD"; - case OP_SUB : return "OP_SUB"; - case OP_MUL : return "OP_MUL"; - case OP_DIV : return "OP_DIV"; - case OP_MOD : return "OP_MOD"; - case OP_LSHIFT : return "OP_LSHIFT"; - case OP_RSHIFT : return "OP_RSHIFT"; - case OP_BOOLAND : return "OP_BOOLAND"; - case OP_BOOLOR : return "OP_BOOLOR"; - case OP_NUMEQUAL : return "OP_NUMEQUAL"; - case OP_NUMEQUALVERIFY : return "OP_NUMEQUALVERIFY"; - case OP_NUMNOTEQUAL : return "OP_NUMNOTEQUAL"; - case OP_LESSTHAN : return "OP_LESSTHAN"; - case OP_GREATERTHAN : return "OP_GREATERTHAN"; - case OP_LESSTHANOREQUAL : return "OP_LESSTHANOREQUAL"; - case OP_GREATERTHANOREQUAL : return "OP_GREATERTHANOREQUAL"; - case OP_MIN : return "OP_MIN"; - case OP_MAX : return "OP_MAX"; - case OP_WITHIN : return "OP_WITHIN"; - - // crypto - case OP_RIPEMD160 : return "OP_RIPEMD160"; - case OP_SHA1 : return "OP_SHA1"; - case OP_SHA256 : return "OP_SHA256"; - case OP_HASH160 : return "OP_HASH160"; - case OP_HASH256 : return "OP_HASH256"; - case OP_CODESEPARATOR : return "OP_CODESEPARATOR"; - case OP_CHECKSIG : return "OP_CHECKSIG"; - case OP_CHECKSIGVERIFY : return "OP_CHECKSIGVERIFY"; - case OP_CHECKMULTISIG : return "OP_CHECKMULTISIG"; - case OP_CHECKMULTISIGVERIFY : return "OP_CHECKMULTISIGVERIFY"; - - // expanson - case OP_NOP1 : return "OP_NOP1"; - case OP_NOP2 : return "OP_NOP2"; - case OP_NOP3 : return "OP_NOP3"; - case OP_NOP4 : return "OP_NOP4"; - case OP_NOP5 : return "OP_NOP5"; - case OP_NOP6 : return "OP_NOP6"; - case OP_NOP7 : return "OP_NOP7"; - case OP_NOP8 : return "OP_NOP8"; - case OP_NOP9 : return "OP_NOP9"; - case OP_NOP10 : return "OP_NOP10"; - - case OP_INVALIDOPCODE : return "OP_INVALIDOPCODE"; - - // Note: - // The template matching params OP_SMALLDATA/etc are defined in opcodetype enum - // as kind of implementation hack, they are *NOT* real opcodes. If found in real - // Script, just let the default: case deal with them. - - default: - return "OP_UNKNOWN"; - } -} - bool IsCanonicalPubKey(const valtype &vchPubKey, unsigned int flags) { if (!(flags & SCRIPT_VERIFY_STRICTENC)) return true; @@ -1813,150 +1669,6 @@ CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsign return CombineSignatures(scriptPubKey, txTo, nIn, txType, vSolutions, stack1, stack2); } -unsigned int CScript::GetSigOpCount(bool fAccurate) const -{ - unsigned int n = 0; - const_iterator pc = begin(); - opcodetype lastOpcode = OP_INVALIDOPCODE; - while (pc < end()) - { - opcodetype opcode; - if (!GetOp(pc, opcode)) - break; - if (opcode == OP_CHECKSIG || opcode == OP_CHECKSIGVERIFY) - n++; - else if (opcode == OP_CHECKMULTISIG || opcode == OP_CHECKMULTISIGVERIFY) - { - if (fAccurate && lastOpcode >= OP_1 && lastOpcode <= OP_16) - n += DecodeOP_N(lastOpcode); - else - n += 20; - } - lastOpcode = opcode; - } - return n; -} - -unsigned int CScript::GetSigOpCount(const CScript& scriptSig) const -{ - if (!IsPayToScriptHash()) - return GetSigOpCount(true); - - // This is a pay-to-script-hash scriptPubKey; - // get the last item that the scriptSig - // pushes onto the stack: - const_iterator pc = scriptSig.begin(); - vector data; - while (pc < scriptSig.end()) - { - opcodetype opcode; - if (!scriptSig.GetOp(pc, opcode, data)) - return 0; - if (opcode > OP_16) - return 0; - } - - /// ... and return its opcount: - CScript subscript(data.begin(), data.end()); - return subscript.GetSigOpCount(true); -} - -bool CScript::IsPayToScriptHash() const -{ - // Extra-fast test for pay-to-script-hash CScripts: - return (this->size() == 23 && - this->at(0) == OP_HASH160 && - this->at(1) == 0x14 && - this->at(22) == OP_EQUAL); -} - -bool CScript::IsPushOnly() const -{ - const_iterator pc = begin(); - while (pc < end()) - { - // Note how a script with an invalid PUSHDATA returns False. - opcodetype opcode; - if (!GetOp(pc, opcode)) - return false; - - // Note that IsPushOnly() *does* consider OP_RESERVED to be a - // push-type opcode, however execution of OP_RESERVED fails, so - // it's not relevant to P2SH as the scriptSig would fail prior to - // the P2SH special validation code being executed. - if (opcode > OP_16) - return false; - } - return true; -} - -bool CScript::HasCanonicalPushes() const -{ - const_iterator pc = begin(); - while (pc < end()) - { - opcodetype opcode; - std::vector data; - if (!GetOp(pc, opcode, data)) - return false; - if (opcode > OP_16) - continue; - if (opcode < OP_PUSHDATA1 && opcode > OP_0 && (data.size() == 1 && data[0] <= 16)) - // Could have used an OP_n code, rather than a 1-byte push. - return false; - if (opcode == OP_PUSHDATA1 && data.size() < OP_PUSHDATA1) - // Could have used a normal n-byte push, rather than OP_PUSHDATA1. - return false; - if (opcode == OP_PUSHDATA2 && data.size() <= 0xFF) - // Could have used an OP_PUSHDATA1. - return false; - if (opcode == OP_PUSHDATA4 && data.size() <= 0xFFFF) - // Could have used an OP_PUSHDATA2. - return false; - } - return true; -} - -class CScriptVisitor : public boost::static_visitor -{ -private: - CScript *script; -public: - CScriptVisitor(CScript *scriptin) { script = scriptin; } - - bool operator()(const CNoDestination &dest) const { - script->clear(); - return false; - } - - bool operator()(const CKeyID &keyID) const { - script->clear(); - *script << OP_DUP << OP_HASH160 << keyID << OP_EQUALVERIFY << OP_CHECKSIG; - return true; - } - - bool operator()(const CScriptID &scriptID) const { - script->clear(); - *script << OP_HASH160 << scriptID << OP_EQUAL; - return true; - } -}; - -void CScript::SetDestination(const CTxDestination& dest) -{ - boost::apply_visitor(CScriptVisitor(this), dest); -} - -void CScript::SetMultisig(int nRequired, const std::vector& keys) -{ - this->clear(); - - *this << EncodeOP_N(nRequired); - BOOST_FOREACH(const CPubKey& key, keys) - *this << key; - *this << EncodeOP_N(keys.size()) << OP_CHECKMULTISIG; -} - bool CScriptCompressor::IsToKeyID(CKeyID &hash) const { if (script.size() == 25 && script[0] == OP_DUP && script[1] == OP_HASH160 diff --git a/src/scriptutils.h b/src/scriptutils.h index 44f18483c3..4f29f7ab29 100644 --- a/src/scriptutils.h +++ b/src/scriptutils.h @@ -7,172 +7,19 @@ #define H_BITCOIN_SCRIPTUTILS #include "key.h" -#include "utilstrencodings.h" -#include "tinyformat.h" +#include "script/script.h" #include #include #include #include -#include - class CKeyStore; class CTransaction; struct CMutableTransaction; -static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; // bytes static const unsigned int MAX_OP_RETURN_RELAY = 40; // bytes -class scriptnum_error : public std::runtime_error -{ -public: - explicit scriptnum_error(const std::string& str) : std::runtime_error(str) {} -}; - -class CScriptNum -{ -// Numeric opcodes (OP_1ADD, etc) are restricted to operating on 4-byte integers. -// The semantics are subtle, though: operands must be in the range [-2^31 +1...2^31 -1], -// but results may overflow (and are valid as long as they are not used in a subsequent -// numeric operation). CScriptNum enforces those semantics by storing results as -// an int64 and allowing out-of-range values to be returned as a vector of bytes but -// throwing an exception if arithmetic is done or the result is interpreted as an integer. -public: - - explicit CScriptNum(const int64_t& n) - { - m_value = n; - } - - explicit CScriptNum(const std::vector& vch) - { - if (vch.size() > nMaxNumSize) - throw scriptnum_error("CScriptNum(const std::vector&) : overflow"); - m_value = set_vch(vch); - } - - inline bool operator==(const int64_t& rhs) const { return m_value == rhs; } - inline bool operator!=(const int64_t& rhs) const { return m_value != rhs; } - inline bool operator<=(const int64_t& rhs) const { return m_value <= rhs; } - inline bool operator< (const int64_t& rhs) const { return m_value < rhs; } - inline bool operator>=(const int64_t& rhs) const { return m_value >= rhs; } - inline bool operator> (const int64_t& rhs) const { return m_value > rhs; } - - inline bool operator==(const CScriptNum& rhs) const { return operator==(rhs.m_value); } - inline bool operator!=(const CScriptNum& rhs) const { return operator!=(rhs.m_value); } - inline bool operator<=(const CScriptNum& rhs) const { return operator<=(rhs.m_value); } - inline bool operator< (const CScriptNum& rhs) const { return operator< (rhs.m_value); } - inline bool operator>=(const CScriptNum& rhs) const { return operator>=(rhs.m_value); } - inline bool operator> (const CScriptNum& rhs) const { return operator> (rhs.m_value); } - - inline CScriptNum operator+( const int64_t& rhs) const { return CScriptNum(m_value + rhs);} - inline CScriptNum operator-( const int64_t& rhs) const { return CScriptNum(m_value - rhs);} - inline CScriptNum operator+( const CScriptNum& rhs) const { return operator+(rhs.m_value); } - inline CScriptNum operator-( const CScriptNum& rhs) const { return operator-(rhs.m_value); } - - inline CScriptNum& operator+=( const CScriptNum& rhs) { return operator+=(rhs.m_value); } - inline CScriptNum& operator-=( const CScriptNum& rhs) { return operator-=(rhs.m_value); } - - inline CScriptNum operator-() const - { - assert(m_value != std::numeric_limits::min()); - return CScriptNum(-m_value); - } - - inline CScriptNum& operator=( const int64_t& rhs) - { - m_value = rhs; - return *this; - } - - inline CScriptNum& operator+=( const int64_t& rhs) - { - assert(rhs == 0 || (rhs > 0 && m_value <= std::numeric_limits::max() - rhs) || - (rhs < 0 && m_value >= std::numeric_limits::min() - rhs)); - m_value += rhs; - return *this; - } - - inline CScriptNum& operator-=( const int64_t& rhs) - { - assert(rhs == 0 || (rhs > 0 && m_value >= std::numeric_limits::min() + rhs) || - (rhs < 0 && m_value <= std::numeric_limits::max() + rhs)); - m_value -= rhs; - return *this; - } - - int getint() const - { - if (m_value > std::numeric_limits::max()) - return std::numeric_limits::max(); - else if (m_value < std::numeric_limits::min()) - return std::numeric_limits::min(); - return m_value; - } - - std::vector getvch() const - { - return serialize(m_value); - } - - static std::vector serialize(const int64_t& value) - { - if(value == 0) - return std::vector(); - - std::vector result; - const bool neg = value < 0; - uint64_t absvalue = neg ? -value : value; - - while(absvalue) - { - result.push_back(absvalue & 0xff); - absvalue >>= 8; - } - - -// - If the most significant byte is >= 0x80 and the value is positive, push a -// new zero-byte to make the significant byte < 0x80 again. - -// - If the most significant byte is >= 0x80 and the value is negative, push a -// new 0x80 byte that will be popped off when converting to an integral. - -// - If the most significant byte is < 0x80 and the value is negative, add -// 0x80 to it, since it will be subtracted and interpreted as a negative when -// converting to an integral. - - if (result.back() & 0x80) - result.push_back(neg ? 0x80 : 0); - else if (neg) - result.back() |= 0x80; - - return result; - } - - static const size_t nMaxNumSize = 4; - -private: - static int64_t set_vch(const std::vector& vch) - { - if (vch.empty()) - return 0; - - int64_t result = 0; - for (size_t i = 0; i != vch.size(); ++i) - result |= static_cast(vch[i]) << 8*i; - - // If the input vector's most significant byte is 0x80, remove it from - // the result's msb and return a negative. - if (vch.back() & 0x80) - return -(result & ~(0x80ULL << (8 * (vch.size() - 1)))); - - return result; - } - - int64_t m_value; -}; - /** Signature hash types/flags */ enum { @@ -234,490 +81,8 @@ enum txnouttype TX_NULL_DATA, }; -class CNoDestination { -public: - friend bool operator==(const CNoDestination &a, const CNoDestination &b) { return true; } - friend bool operator<(const CNoDestination &a, const CNoDestination &b) { return true; } -}; - -/** A txout script template with a specific destination. It is either: - * * CNoDestination: no destination set - * * CKeyID: TX_PUBKEYHASH destination - * * CScriptID: TX_SCRIPTHASH destination - * A CTxDestination is the internal data type encoded in a CBitcoinAddress - */ -typedef boost::variant CTxDestination; - const char* GetTxnOutputType(txnouttype t); -/** Script opcodes */ -enum opcodetype -{ - // push value - OP_0 = 0x00, - OP_FALSE = OP_0, - OP_PUSHDATA1 = 0x4c, - OP_PUSHDATA2 = 0x4d, - OP_PUSHDATA4 = 0x4e, - OP_1NEGATE = 0x4f, - OP_RESERVED = 0x50, - OP_1 = 0x51, - OP_TRUE=OP_1, - OP_2 = 0x52, - OP_3 = 0x53, - OP_4 = 0x54, - OP_5 = 0x55, - OP_6 = 0x56, - OP_7 = 0x57, - OP_8 = 0x58, - OP_9 = 0x59, - OP_10 = 0x5a, - OP_11 = 0x5b, - OP_12 = 0x5c, - OP_13 = 0x5d, - OP_14 = 0x5e, - OP_15 = 0x5f, - OP_16 = 0x60, - - // control - OP_NOP = 0x61, - OP_VER = 0x62, - OP_IF = 0x63, - OP_NOTIF = 0x64, - OP_VERIF = 0x65, - OP_VERNOTIF = 0x66, - OP_ELSE = 0x67, - OP_ENDIF = 0x68, - OP_VERIFY = 0x69, - OP_RETURN = 0x6a, - - // stack ops - OP_TOALTSTACK = 0x6b, - OP_FROMALTSTACK = 0x6c, - OP_2DROP = 0x6d, - OP_2DUP = 0x6e, - OP_3DUP = 0x6f, - OP_2OVER = 0x70, - OP_2ROT = 0x71, - OP_2SWAP = 0x72, - OP_IFDUP = 0x73, - OP_DEPTH = 0x74, - OP_DROP = 0x75, - OP_DUP = 0x76, - OP_NIP = 0x77, - OP_OVER = 0x78, - OP_PICK = 0x79, - OP_ROLL = 0x7a, - OP_ROT = 0x7b, - OP_SWAP = 0x7c, - OP_TUCK = 0x7d, - - // splice ops - OP_CAT = 0x7e, - OP_SUBSTR = 0x7f, - OP_LEFT = 0x80, - OP_RIGHT = 0x81, - OP_SIZE = 0x82, - - // bit logic - OP_INVERT = 0x83, - OP_AND = 0x84, - OP_OR = 0x85, - OP_XOR = 0x86, - OP_EQUAL = 0x87, - OP_EQUALVERIFY = 0x88, - OP_RESERVED1 = 0x89, - OP_RESERVED2 = 0x8a, - - // numeric - OP_1ADD = 0x8b, - OP_1SUB = 0x8c, - OP_2MUL = 0x8d, - OP_2DIV = 0x8e, - OP_NEGATE = 0x8f, - OP_ABS = 0x90, - OP_NOT = 0x91, - OP_0NOTEQUAL = 0x92, - - OP_ADD = 0x93, - OP_SUB = 0x94, - OP_MUL = 0x95, - OP_DIV = 0x96, - OP_MOD = 0x97, - OP_LSHIFT = 0x98, - OP_RSHIFT = 0x99, - - OP_BOOLAND = 0x9a, - OP_BOOLOR = 0x9b, - OP_NUMEQUAL = 0x9c, - OP_NUMEQUALVERIFY = 0x9d, - OP_NUMNOTEQUAL = 0x9e, - OP_LESSTHAN = 0x9f, - OP_GREATERTHAN = 0xa0, - OP_LESSTHANOREQUAL = 0xa1, - OP_GREATERTHANOREQUAL = 0xa2, - OP_MIN = 0xa3, - OP_MAX = 0xa4, - - OP_WITHIN = 0xa5, - - // crypto - OP_RIPEMD160 = 0xa6, - OP_SHA1 = 0xa7, - OP_SHA256 = 0xa8, - OP_HASH160 = 0xa9, - OP_HASH256 = 0xaa, - OP_CODESEPARATOR = 0xab, - OP_CHECKSIG = 0xac, - OP_CHECKSIGVERIFY = 0xad, - OP_CHECKMULTISIG = 0xae, - OP_CHECKMULTISIGVERIFY = 0xaf, - - // expansion - OP_NOP1 = 0xb0, - OP_NOP2 = 0xb1, - OP_NOP3 = 0xb2, - OP_NOP4 = 0xb3, - OP_NOP5 = 0xb4, - OP_NOP6 = 0xb5, - OP_NOP7 = 0xb6, - OP_NOP8 = 0xb7, - OP_NOP9 = 0xb8, - OP_NOP10 = 0xb9, - - - - // template matching params - OP_SMALLDATA = 0xf9, - OP_SMALLINTEGER = 0xfa, - OP_PUBKEYS = 0xfb, - OP_PUBKEYHASH = 0xfd, - OP_PUBKEY = 0xfe, - - OP_INVALIDOPCODE = 0xff, -}; - -const char* GetOpName(opcodetype opcode); - - - -inline std::string ValueString(const std::vector& vch) -{ - if (vch.size() <= 4) - return strprintf("%d", CScriptNum(vch).getint()); - else - return HexStr(vch); -} - -/** Serialized script, used inside transaction inputs and outputs */ -class CScript : public std::vector -{ -protected: - CScript& push_int64(int64_t n) - { - if (n == -1 || (n >= 1 && n <= 16)) - { - push_back(n + (OP_1 - 1)); - } - else - { - *this << CScriptNum::serialize(n); - } - return *this; - } -public: - CScript() { } - CScript(const CScript& b) : std::vector(b.begin(), b.end()) { } - CScript(const_iterator pbegin, const_iterator pend) : std::vector(pbegin, pend) { } -#ifndef _MSC_VER - CScript(const unsigned char* pbegin, const unsigned char* pend) : std::vector(pbegin, pend) { } -#endif - - CScript& operator+=(const CScript& b) - { - insert(end(), b.begin(), b.end()); - return *this; - } - - friend CScript operator+(const CScript& a, const CScript& b) - { - CScript ret = a; - ret += b; - return ret; - } - - - CScript(int64_t b) { operator<<(b); } - - explicit CScript(opcodetype b) { operator<<(b); } - explicit CScript(const uint256& b) { operator<<(b); } - explicit CScript(const CScriptNum& b) { operator<<(b); } - explicit CScript(const std::vector& b) { operator<<(b); } - - - CScript& operator<<(int64_t b) { return push_int64(b); } - - CScript& operator<<(opcodetype opcode) - { - if (opcode < 0 || opcode > 0xff) - throw std::runtime_error("CScript::operator<<() : invalid opcode"); - insert(end(), (unsigned char)opcode); - return *this; - } - - CScript& operator<<(const uint160& b) - { - insert(end(), sizeof(b)); - insert(end(), (unsigned char*)&b, (unsigned char*)&b + sizeof(b)); - return *this; - } - - CScript& operator<<(const uint256& b) - { - insert(end(), sizeof(b)); - insert(end(), (unsigned char*)&b, (unsigned char*)&b + sizeof(b)); - return *this; - } - - CScript& operator<<(const CPubKey& key) - { - assert(key.size() < OP_PUSHDATA1); - insert(end(), (unsigned char)key.size()); - insert(end(), key.begin(), key.end()); - return *this; - } - - CScript& operator<<(const CScriptNum& b) - { - *this << b.getvch(); - return *this; - } - - CScript& operator<<(const std::vector& b) - { - if (b.size() < OP_PUSHDATA1) - { - insert(end(), (unsigned char)b.size()); - } - else if (b.size() <= 0xff) - { - insert(end(), OP_PUSHDATA1); - insert(end(), (unsigned char)b.size()); - } - else if (b.size() <= 0xffff) - { - insert(end(), OP_PUSHDATA2); - unsigned short nSize = b.size(); - insert(end(), (unsigned char*)&nSize, (unsigned char*)&nSize + sizeof(nSize)); - } - else - { - insert(end(), OP_PUSHDATA4); - unsigned int nSize = b.size(); - insert(end(), (unsigned char*)&nSize, (unsigned char*)&nSize + sizeof(nSize)); - } - insert(end(), b.begin(), b.end()); - return *this; - } - - CScript& operator<<(const CScript& b) - { - // I'm not sure if this should push the script or concatenate scripts. - // If there's ever a use for pushing a script onto a script, delete this member fn - assert(!"Warning: Pushing a CScript onto a CScript with << is probably not intended, use + to concatenate!"); - return *this; - } - - - bool GetOp(iterator& pc, opcodetype& opcodeRet, std::vector& vchRet) - { - // Wrapper so it can be called with either iterator or const_iterator - const_iterator pc2 = pc; - bool fRet = GetOp2(pc2, opcodeRet, &vchRet); - pc = begin() + (pc2 - begin()); - return fRet; - } - - bool GetOp(iterator& pc, opcodetype& opcodeRet) - { - const_iterator pc2 = pc; - bool fRet = GetOp2(pc2, opcodeRet, NULL); - pc = begin() + (pc2 - begin()); - return fRet; - } - - bool GetOp(const_iterator& pc, opcodetype& opcodeRet, std::vector& vchRet) const - { - return GetOp2(pc, opcodeRet, &vchRet); - } - - bool GetOp(const_iterator& pc, opcodetype& opcodeRet) const - { - return GetOp2(pc, opcodeRet, NULL); - } - - bool GetOp2(const_iterator& pc, opcodetype& opcodeRet, std::vector* pvchRet) const - { - opcodeRet = OP_INVALIDOPCODE; - if (pvchRet) - pvchRet->clear(); - if (pc >= end()) - return false; - - // Read instruction - if (end() - pc < 1) - return false; - unsigned int opcode = *pc++; - - // Immediate operand - if (opcode <= OP_PUSHDATA4) - { - unsigned int nSize = 0; - if (opcode < OP_PUSHDATA1) - { - nSize = opcode; - } - else if (opcode == OP_PUSHDATA1) - { - if (end() - pc < 1) - return false; - nSize = *pc++; - } - else if (opcode == OP_PUSHDATA2) - { - if (end() - pc < 2) - return false; - nSize = 0; - memcpy(&nSize, &pc[0], 2); - pc += 2; - } - else if (opcode == OP_PUSHDATA4) - { - if (end() - pc < 4) - return false; - memcpy(&nSize, &pc[0], 4); - pc += 4; - } - if (end() - pc < 0 || (unsigned int)(end() - pc) < nSize) - return false; - if (pvchRet) - pvchRet->assign(pc, pc + nSize); - pc += nSize; - } - - opcodeRet = (opcodetype)opcode; - return true; - } - - // Encode/decode small integers: - static int DecodeOP_N(opcodetype opcode) - { - if (opcode == OP_0) - return 0; - assert(opcode >= OP_1 && opcode <= OP_16); - return (int)opcode - (int)(OP_1 - 1); - } - static opcodetype EncodeOP_N(int n) - { - assert(n >= 0 && n <= 16); - if (n == 0) - return OP_0; - return (opcodetype)(OP_1+n-1); - } - - int FindAndDelete(const CScript& b) - { - int nFound = 0; - if (b.empty()) - return nFound; - iterator pc = begin(); - opcodetype opcode; - do - { - while (end() - pc >= (long)b.size() && memcmp(&pc[0], &b[0], b.size()) == 0) - { - erase(pc, pc + b.size()); - ++nFound; - } - } - while (GetOp(pc, opcode)); - return nFound; - } - int Find(opcodetype op) const - { - int nFound = 0; - opcodetype opcode; - for (const_iterator pc = begin(); pc != end() && GetOp(pc, opcode);) - if (opcode == op) - ++nFound; - return nFound; - } - - // Pre-version-0.6, Bitcoin always counted CHECKMULTISIGs - // as 20 sigops. With pay-to-script-hash, that changed: - // CHECKMULTISIGs serialized in scriptSigs are - // counted more accurately, assuming they are of the form - // ... OP_N CHECKMULTISIG ... - unsigned int GetSigOpCount(bool fAccurate) const; - - // Accurately count sigOps, including sigOps in - // pay-to-script-hash transactions: - unsigned int GetSigOpCount(const CScript& scriptSig) const; - - bool IsPayToScriptHash() const; - - // Called by IsStandardTx and P2SH VerifyScript (which makes it consensus-critical). - bool IsPushOnly() const; - - // Called by IsStandardTx. - bool HasCanonicalPushes() const; - - // Returns whether the script is guaranteed to fail at execution, - // regardless of the initial stack. This allows outputs to be pruned - // instantly when entering the UTXO set. - bool IsUnspendable() const - { - return (size() > 0 && *begin() == OP_RETURN); - } - - void SetDestination(const CTxDestination& address); - void SetMultisig(int nRequired, const std::vector& keys); - - std::string ToString() const - { - std::string str; - opcodetype opcode; - std::vector vch; - const_iterator pc = begin(); - while (pc < end()) - { - if (!str.empty()) - str += " "; - if (!GetOp(pc, opcode, vch)) - { - str += "[error]"; - return str; - } - if (0 <= opcode && opcode <= OP_PUSHDATA4) - str += ValueString(vch); - else - str += GetOpName(opcode); - } - return str; - } - - CScriptID GetID() const - { - return CScriptID(Hash160(*this)); - } - - void clear() - { - // The default std::vector::clear() does not release memory. - std::vector().swap(*this); - } -}; - /** Compact serializer for scripts. * * It detects common cases and encodes them much more efficiently. diff --git a/src/test/base58_tests.cpp b/src/test/base58_tests.cpp index 0587ddac84..fe68e9e974 100644 --- a/src/test/base58_tests.cpp +++ b/src/test/base58_tests.cpp @@ -9,7 +9,7 @@ #include "data/base58_keys_valid.json.h" #include "key.h" -#include "scriptutils.h" +#include "script/script.h" #include "uint256.h" #include "util.h" diff --git a/src/test/key_tests.cpp b/src/test/key_tests.cpp index c6bf0db3af..203c20731a 100644 --- a/src/test/key_tests.cpp +++ b/src/test/key_tests.cpp @@ -5,7 +5,7 @@ #include "key.h" #include "base58.h" -#include "scriptutils.h" +#include "script/script.h" #include "uint256.h" #include "util.h" diff --git a/src/test/multisig_tests.cpp b/src/test/multisig_tests.cpp index 2e45a7a022..aa9b0de4ce 100644 --- a/src/test/multisig_tests.cpp +++ b/src/test/multisig_tests.cpp @@ -5,6 +5,7 @@ #include "key.h" #include "keystore.h" #include "main.h" +#include "script/script.h" #include "scriptutils.h" #include "uint256.h" diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index d27fc71598..9136d62292 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -5,6 +5,7 @@ #include "key.h" #include "keystore.h" #include "main.h" +#include "script/script.h" #include "scriptutils.h" #include diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index a8ccd50598..ff56bdf13b 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -8,6 +8,7 @@ #include "key.h" #include "keystore.h" #include "main.h" +#include "script/script.h" #include "scriptutils.h" #include "core_io.h" diff --git a/src/test/scriptnum_tests.cpp b/src/test/scriptnum_tests.cpp index c3cd41cf84..ac60fa426f 100644 --- a/src/test/scriptnum_tests.cpp +++ b/src/test/scriptnum_tests.cpp @@ -3,7 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "bignum.h" -#include "scriptutils.h" +#include "script/script.h" #include #include #include diff --git a/src/test/sighash_tests.cpp b/src/test/sighash_tests.cpp index 53f4d443c4..1421288eed 100644 --- a/src/test/sighash_tests.cpp +++ b/src/test/sighash_tests.cpp @@ -6,6 +6,7 @@ #include "main.h" #include "random.h" #include "serialize.h" +#include "script/script.h" #include "scriptutils.h" #include "util.h" #include "version.h" diff --git a/src/test/sigopcount_tests.cpp b/src/test/sigopcount_tests.cpp index 963ccf560d..2d10c356ac 100644 --- a/src/test/sigopcount_tests.cpp +++ b/src/test/sigopcount_tests.cpp @@ -3,7 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "key.h" -#include "scriptutils.h" +#include "script/script.h" #include "uint256.h" #include diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 2b5161b0cf..943568e89d 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -8,7 +8,7 @@ #include "key.h" #include "keystore.h" #include "main.h" -#include "scriptutils.h" +#include "script/script.h" #include "core_io.h" #include From da03e6ed7c380d8942592626b9677579267f86fd Mon Sep 17 00:00:00 2001 From: jtimon Date: Wed, 27 Aug 2014 20:11:41 +0200 Subject: [PATCH 0665/1288] Separate script/interpreter --- src/Makefile.am | 2 + src/script/interpreter.cpp | 1048 +++++++++++++++++++++++++++++++++ src/script/interpreter.h | 45 ++ src/scriptutils.cpp | 1058 ---------------------------------- src/scriptutils.h | 27 +- src/test/canonical_tests.cpp | 4 +- src/test/multisig_tests.cpp | 1 + src/test/sighash_tests.cpp | 2 +- 8 files changed, 1101 insertions(+), 1086 deletions(-) create mode 100644 src/script/interpreter.cpp create mode 100644 src/script/interpreter.h diff --git a/src/Makefile.am b/src/Makefile.am index a9f1ceeeba..a3fdd3ee6a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -98,6 +98,7 @@ BITCOIN_CORE_H = \ rpcclient.h \ rpcprotocol.h \ rpcserver.h \ + script/interpreter.h \ script/script.h \ scriptutils.h \ serialize.h \ @@ -207,6 +208,7 @@ libbitcoin_common_a_SOURCES = \ keystore.cpp \ netbase.cpp \ protocol.cpp \ + script/interpreter.cpp \ script/script.cpp \ scriptutils.cpp \ $(BITCOIN_CORE_H) diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp new file mode 100644 index 0000000000..4f4fdb6b7f --- /dev/null +++ b/src/script/interpreter.cpp @@ -0,0 +1,1048 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2013 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "interpreter.h" + +#include "core.h" +#include "crypto/ripemd160.h" +#include "crypto/sha1.h" +#include "crypto/sha2.h" +#include "random.h" +#include "script/script.h" +#include "uint256.h" +#include "util.h" + +#include +#include + +using namespace std; + +typedef vector valtype; +static const valtype vchFalse(0); +static const valtype vchZero(0); +static const valtype vchTrue(1, 1); +static const CScriptNum bnZero(0); +static const CScriptNum bnOne(1); +static const CScriptNum bnFalse(0); +static const CScriptNum bnTrue(1); + +bool CastToBool(const valtype& vch) +{ + for (unsigned int i = 0; i < vch.size(); i++) + { + if (vch[i] != 0) + { + // Can be negative zero + if (i == vch.size()-1 && vch[i] == 0x80) + return false; + return true; + } + } + return false; +} + +// +// Script is a stack machine (like Forth) that evaluates a predicate +// returning a bool indicating valid or not. There are no loops. +// +#define stacktop(i) (stack.at(stack.size()+(i))) +#define altstacktop(i) (altstack.at(altstack.size()+(i))) +static inline void popstack(vector& stack) +{ + if (stack.empty()) + throw runtime_error("popstack() : stack empty"); + stack.pop_back(); +} + +bool IsCanonicalPubKey(const valtype &vchPubKey, unsigned int flags) { + if (!(flags & SCRIPT_VERIFY_STRICTENC)) + return true; + + if (vchPubKey.size() < 33) + return error("Non-canonical public key: too short"); + if (vchPubKey[0] == 0x04) { + if (vchPubKey.size() != 65) + return error("Non-canonical public key: invalid length for uncompressed key"); + } else if (vchPubKey[0] == 0x02 || vchPubKey[0] == 0x03) { + if (vchPubKey.size() != 33) + return error("Non-canonical public key: invalid length for compressed key"); + } else { + return error("Non-canonical public key: neither compressed nor uncompressed"); + } + return true; +} + +bool IsCanonicalSignature(const valtype &vchSig, unsigned int flags) { + if (!(flags & SCRIPT_VERIFY_STRICTENC)) + return true; + + // See https://bitcointalk.org/index.php?topic=8392.msg127623#msg127623 + // A canonical signature exists of: <30> <02> <02> + // Where R and S are not negative (their first byte has its highest bit not set), and not + // excessively padded (do not start with a 0 byte, unless an otherwise negative number follows, + // in which case a single 0 byte is necessary and even required). + if (vchSig.size() < 9) + return error("Non-canonical signature: too short"); + if (vchSig.size() > 73) + return error("Non-canonical signature: too long"); + unsigned char nHashType = vchSig[vchSig.size() - 1] & (~(SIGHASH_ANYONECANPAY)); + if (nHashType < SIGHASH_ALL || nHashType > SIGHASH_SINGLE) + return error("Non-canonical signature: unknown hashtype byte"); + if (vchSig[0] != 0x30) + return error("Non-canonical signature: wrong type"); + if (vchSig[1] != vchSig.size()-3) + return error("Non-canonical signature: wrong length marker"); + unsigned int nLenR = vchSig[3]; + if (5 + nLenR >= vchSig.size()) + return error("Non-canonical signature: S length misplaced"); + unsigned int nLenS = vchSig[5+nLenR]; + if ((unsigned long)(nLenR+nLenS+7) != vchSig.size()) + return error("Non-canonical signature: R+S length mismatch"); + + const unsigned char *R = &vchSig[4]; + if (R[-2] != 0x02) + return error("Non-canonical signature: R value type mismatch"); + if (nLenR == 0) + return error("Non-canonical signature: R length is zero"); + if (R[0] & 0x80) + return error("Non-canonical signature: R value negative"); + if (nLenR > 1 && (R[0] == 0x00) && !(R[1] & 0x80)) + return error("Non-canonical signature: R value excessively padded"); + + const unsigned char *S = &vchSig[6+nLenR]; + if (S[-2] != 0x02) + return error("Non-canonical signature: S value type mismatch"); + if (nLenS == 0) + return error("Non-canonical signature: S length is zero"); + if (S[0] & 0x80) + return error("Non-canonical signature: S value negative"); + if (nLenS > 1 && (S[0] == 0x00) && !(S[1] & 0x80)) + return error("Non-canonical signature: S value excessively padded"); + + if (flags & SCRIPT_VERIFY_LOW_S) { + // If the S value is above the order of the curve divided by two, its + // complement modulo the order could have been used instead, which is + // one byte shorter when encoded correctly. + if (!CKey::CheckSignatureElement(S, nLenS, true)) + return error("Non-canonical signature: S value is unnecessarily high"); + } + + return true; +} + +bool EvalScript(vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType) +{ + CScript::const_iterator pc = script.begin(); + CScript::const_iterator pend = script.end(); + CScript::const_iterator pbegincodehash = script.begin(); + opcodetype opcode; + valtype vchPushValue; + vector vfExec; + vector altstack; + if (script.size() > 10000) + return false; + int nOpCount = 0; + + try + { + while (pc < pend) + { + bool fExec = !count(vfExec.begin(), vfExec.end(), false); + + // + // Read instruction + // + if (!script.GetOp(pc, opcode, vchPushValue)) + return false; + if (vchPushValue.size() > MAX_SCRIPT_ELEMENT_SIZE) + return false; + + // Note how OP_RESERVED does not count towards the opcode limit. + if (opcode > OP_16 && ++nOpCount > 201) + return false; + + if (opcode == OP_CAT || + opcode == OP_SUBSTR || + opcode == OP_LEFT || + opcode == OP_RIGHT || + opcode == OP_INVERT || + opcode == OP_AND || + opcode == OP_OR || + opcode == OP_XOR || + opcode == OP_2MUL || + opcode == OP_2DIV || + opcode == OP_MUL || + opcode == OP_DIV || + opcode == OP_MOD || + opcode == OP_LSHIFT || + opcode == OP_RSHIFT) + return false; // Disabled opcodes. + + if (fExec && 0 <= opcode && opcode <= OP_PUSHDATA4) + stack.push_back(vchPushValue); + else if (fExec || (OP_IF <= opcode && opcode <= OP_ENDIF)) + switch (opcode) + { + // + // Push value + // + case OP_1NEGATE: + case OP_1: + case OP_2: + case OP_3: + case OP_4: + case OP_5: + case OP_6: + case OP_7: + case OP_8: + case OP_9: + case OP_10: + case OP_11: + case OP_12: + case OP_13: + case OP_14: + case OP_15: + case OP_16: + { + // ( -- value) + CScriptNum bn((int)opcode - (int)(OP_1 - 1)); + stack.push_back(bn.getvch()); + } + break; + + + // + // Control + // + case OP_NOP: + case OP_NOP1: case OP_NOP2: case OP_NOP3: case OP_NOP4: case OP_NOP5: + case OP_NOP6: case OP_NOP7: case OP_NOP8: case OP_NOP9: case OP_NOP10: + break; + + case OP_IF: + case OP_NOTIF: + { + // if [statements] [else [statements]] endif + bool fValue = false; + if (fExec) + { + if (stack.size() < 1) + return false; + valtype& vch = stacktop(-1); + fValue = CastToBool(vch); + if (opcode == OP_NOTIF) + fValue = !fValue; + popstack(stack); + } + vfExec.push_back(fValue); + } + break; + + case OP_ELSE: + { + if (vfExec.empty()) + return false; + vfExec.back() = !vfExec.back(); + } + break; + + case OP_ENDIF: + { + if (vfExec.empty()) + return false; + vfExec.pop_back(); + } + break; + + case OP_VERIFY: + { + // (true -- ) or + // (false -- false) and return + if (stack.size() < 1) + return false; + bool fValue = CastToBool(stacktop(-1)); + if (fValue) + popstack(stack); + else + return false; + } + break; + + case OP_RETURN: + { + return false; + } + break; + + + // + // Stack ops + // + case OP_TOALTSTACK: + { + if (stack.size() < 1) + return false; + altstack.push_back(stacktop(-1)); + popstack(stack); + } + break; + + case OP_FROMALTSTACK: + { + if (altstack.size() < 1) + return false; + stack.push_back(altstacktop(-1)); + popstack(altstack); + } + break; + + case OP_2DROP: + { + // (x1 x2 -- ) + if (stack.size() < 2) + return false; + popstack(stack); + popstack(stack); + } + break; + + case OP_2DUP: + { + // (x1 x2 -- x1 x2 x1 x2) + if (stack.size() < 2) + return false; + valtype vch1 = stacktop(-2); + valtype vch2 = stacktop(-1); + stack.push_back(vch1); + stack.push_back(vch2); + } + break; + + case OP_3DUP: + { + // (x1 x2 x3 -- x1 x2 x3 x1 x2 x3) + if (stack.size() < 3) + return false; + valtype vch1 = stacktop(-3); + valtype vch2 = stacktop(-2); + valtype vch3 = stacktop(-1); + stack.push_back(vch1); + stack.push_back(vch2); + stack.push_back(vch3); + } + break; + + case OP_2OVER: + { + // (x1 x2 x3 x4 -- x1 x2 x3 x4 x1 x2) + if (stack.size() < 4) + return false; + valtype vch1 = stacktop(-4); + valtype vch2 = stacktop(-3); + stack.push_back(vch1); + stack.push_back(vch2); + } + break; + + case OP_2ROT: + { + // (x1 x2 x3 x4 x5 x6 -- x3 x4 x5 x6 x1 x2) + if (stack.size() < 6) + return false; + valtype vch1 = stacktop(-6); + valtype vch2 = stacktop(-5); + stack.erase(stack.end()-6, stack.end()-4); + stack.push_back(vch1); + stack.push_back(vch2); + } + break; + + case OP_2SWAP: + { + // (x1 x2 x3 x4 -- x3 x4 x1 x2) + if (stack.size() < 4) + return false; + swap(stacktop(-4), stacktop(-2)); + swap(stacktop(-3), stacktop(-1)); + } + break; + + case OP_IFDUP: + { + // (x - 0 | x x) + if (stack.size() < 1) + return false; + valtype vch = stacktop(-1); + if (CastToBool(vch)) + stack.push_back(vch); + } + break; + + case OP_DEPTH: + { + // -- stacksize + CScriptNum bn(stack.size()); + stack.push_back(bn.getvch()); + } + break; + + case OP_DROP: + { + // (x -- ) + if (stack.size() < 1) + return false; + popstack(stack); + } + break; + + case OP_DUP: + { + // (x -- x x) + if (stack.size() < 1) + return false; + valtype vch = stacktop(-1); + stack.push_back(vch); + } + break; + + case OP_NIP: + { + // (x1 x2 -- x2) + if (stack.size() < 2) + return false; + stack.erase(stack.end() - 2); + } + break; + + case OP_OVER: + { + // (x1 x2 -- x1 x2 x1) + if (stack.size() < 2) + return false; + valtype vch = stacktop(-2); + stack.push_back(vch); + } + break; + + case OP_PICK: + case OP_ROLL: + { + // (xn ... x2 x1 x0 n - xn ... x2 x1 x0 xn) + // (xn ... x2 x1 x0 n - ... x2 x1 x0 xn) + if (stack.size() < 2) + return false; + int n = CScriptNum(stacktop(-1)).getint(); + popstack(stack); + if (n < 0 || n >= (int)stack.size()) + return false; + valtype vch = stacktop(-n-1); + if (opcode == OP_ROLL) + stack.erase(stack.end()-n-1); + stack.push_back(vch); + } + break; + + case OP_ROT: + { + // (x1 x2 x3 -- x2 x3 x1) + // x2 x1 x3 after first swap + // x2 x3 x1 after second swap + if (stack.size() < 3) + return false; + swap(stacktop(-3), stacktop(-2)); + swap(stacktop(-2), stacktop(-1)); + } + break; + + case OP_SWAP: + { + // (x1 x2 -- x2 x1) + if (stack.size() < 2) + return false; + swap(stacktop(-2), stacktop(-1)); + } + break; + + case OP_TUCK: + { + // (x1 x2 -- x2 x1 x2) + if (stack.size() < 2) + return false; + valtype vch = stacktop(-1); + stack.insert(stack.end()-2, vch); + } + break; + + + case OP_SIZE: + { + // (in -- in size) + if (stack.size() < 1) + return false; + CScriptNum bn(stacktop(-1).size()); + stack.push_back(bn.getvch()); + } + break; + + + // + // Bitwise logic + // + case OP_EQUAL: + case OP_EQUALVERIFY: + //case OP_NOTEQUAL: // use OP_NUMNOTEQUAL + { + // (x1 x2 - bool) + if (stack.size() < 2) + return false; + valtype& vch1 = stacktop(-2); + valtype& vch2 = stacktop(-1); + bool fEqual = (vch1 == vch2); + // OP_NOTEQUAL is disabled because it would be too easy to say + // something like n != 1 and have some wiseguy pass in 1 with extra + // zero bytes after it (numerically, 0x01 == 0x0001 == 0x000001) + //if (opcode == OP_NOTEQUAL) + // fEqual = !fEqual; + popstack(stack); + popstack(stack); + stack.push_back(fEqual ? vchTrue : vchFalse); + if (opcode == OP_EQUALVERIFY) + { + if (fEqual) + popstack(stack); + else + return false; + } + } + break; + + + // + // Numeric + // + case OP_1ADD: + case OP_1SUB: + case OP_NEGATE: + case OP_ABS: + case OP_NOT: + case OP_0NOTEQUAL: + { + // (in -- out) + if (stack.size() < 1) + return false; + CScriptNum bn(stacktop(-1)); + switch (opcode) + { + case OP_1ADD: bn += bnOne; break; + case OP_1SUB: bn -= bnOne; break; + case OP_NEGATE: bn = -bn; break; + case OP_ABS: if (bn < bnZero) bn = -bn; break; + case OP_NOT: bn = (bn == bnZero); break; + case OP_0NOTEQUAL: bn = (bn != bnZero); break; + default: assert(!"invalid opcode"); break; + } + popstack(stack); + stack.push_back(bn.getvch()); + } + break; + + case OP_ADD: + case OP_SUB: + case OP_BOOLAND: + case OP_BOOLOR: + case OP_NUMEQUAL: + case OP_NUMEQUALVERIFY: + case OP_NUMNOTEQUAL: + case OP_LESSTHAN: + case OP_GREATERTHAN: + case OP_LESSTHANOREQUAL: + case OP_GREATERTHANOREQUAL: + case OP_MIN: + case OP_MAX: + { + // (x1 x2 -- out) + if (stack.size() < 2) + return false; + CScriptNum bn1(stacktop(-2)); + CScriptNum bn2(stacktop(-1)); + CScriptNum bn(0); + switch (opcode) + { + case OP_ADD: + bn = bn1 + bn2; + break; + + case OP_SUB: + bn = bn1 - bn2; + break; + + case OP_BOOLAND: bn = (bn1 != bnZero && bn2 != bnZero); break; + case OP_BOOLOR: bn = (bn1 != bnZero || bn2 != bnZero); break; + case OP_NUMEQUAL: bn = (bn1 == bn2); break; + case OP_NUMEQUALVERIFY: bn = (bn1 == bn2); break; + case OP_NUMNOTEQUAL: bn = (bn1 != bn2); break; + case OP_LESSTHAN: bn = (bn1 < bn2); break; + case OP_GREATERTHAN: bn = (bn1 > bn2); break; + case OP_LESSTHANOREQUAL: bn = (bn1 <= bn2); break; + case OP_GREATERTHANOREQUAL: bn = (bn1 >= bn2); break; + case OP_MIN: bn = (bn1 < bn2 ? bn1 : bn2); break; + case OP_MAX: bn = (bn1 > bn2 ? bn1 : bn2); break; + default: assert(!"invalid opcode"); break; + } + popstack(stack); + popstack(stack); + stack.push_back(bn.getvch()); + + if (opcode == OP_NUMEQUALVERIFY) + { + if (CastToBool(stacktop(-1))) + popstack(stack); + else + return false; + } + } + break; + + case OP_WITHIN: + { + // (x min max -- out) + if (stack.size() < 3) + return false; + CScriptNum bn1(stacktop(-3)); + CScriptNum bn2(stacktop(-2)); + CScriptNum bn3(stacktop(-1)); + bool fValue = (bn2 <= bn1 && bn1 < bn3); + popstack(stack); + popstack(stack); + popstack(stack); + stack.push_back(fValue ? vchTrue : vchFalse); + } + break; + + + // + // Crypto + // + case OP_RIPEMD160: + case OP_SHA1: + case OP_SHA256: + case OP_HASH160: + case OP_HASH256: + { + // (in -- hash) + if (stack.size() < 1) + return false; + valtype& vch = stacktop(-1); + valtype vchHash((opcode == OP_RIPEMD160 || opcode == OP_SHA1 || opcode == OP_HASH160) ? 20 : 32); + if (opcode == OP_RIPEMD160) + CRIPEMD160().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); + else if (opcode == OP_SHA1) + CSHA1().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); + else if (opcode == OP_SHA256) + CSHA256().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); + else if (opcode == OP_HASH160) + CHash160().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); + else if (opcode == OP_HASH256) + CHash256().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); + popstack(stack); + stack.push_back(vchHash); + } + break; + + case OP_CODESEPARATOR: + { + // Hash starts after the code separator + pbegincodehash = pc; + } + break; + + case OP_CHECKSIG: + case OP_CHECKSIGVERIFY: + { + // (sig pubkey -- bool) + if (stack.size() < 2) + return false; + + valtype& vchSig = stacktop(-2); + valtype& vchPubKey = stacktop(-1); + + // Subset of script starting at the most recent codeseparator + CScript scriptCode(pbegincodehash, pend); + + // Drop the signature, since there's no way for a signature to sign itself + scriptCode.FindAndDelete(CScript(vchSig)); + + bool fSuccess = IsCanonicalSignature(vchSig, flags) && IsCanonicalPubKey(vchPubKey, flags) && + CheckSig(vchSig, vchPubKey, scriptCode, txTo, nIn, nHashType, flags); + + popstack(stack); + popstack(stack); + stack.push_back(fSuccess ? vchTrue : vchFalse); + if (opcode == OP_CHECKSIGVERIFY) + { + if (fSuccess) + popstack(stack); + else + return false; + } + } + break; + + case OP_CHECKMULTISIG: + case OP_CHECKMULTISIGVERIFY: + { + // ([sig ...] num_of_signatures [pubkey ...] num_of_pubkeys -- bool) + + int i = 1; + if ((int)stack.size() < i) + return false; + + int nKeysCount = CScriptNum(stacktop(-i)).getint(); + if (nKeysCount < 0 || nKeysCount > 20) + return false; + nOpCount += nKeysCount; + if (nOpCount > 201) + return false; + int ikey = ++i; + i += nKeysCount; + if ((int)stack.size() < i) + return false; + + int nSigsCount = CScriptNum(stacktop(-i)).getint(); + if (nSigsCount < 0 || nSigsCount > nKeysCount) + return false; + int isig = ++i; + i += nSigsCount; + if ((int)stack.size() < i) + return false; + + // Subset of script starting at the most recent codeseparator + CScript scriptCode(pbegincodehash, pend); + + // Drop the signatures, since there's no way for a signature to sign itself + for (int k = 0; k < nSigsCount; k++) + { + valtype& vchSig = stacktop(-isig-k); + scriptCode.FindAndDelete(CScript(vchSig)); + } + + bool fSuccess = true; + while (fSuccess && nSigsCount > 0) + { + valtype& vchSig = stacktop(-isig); + valtype& vchPubKey = stacktop(-ikey); + + // Check signature + bool fOk = IsCanonicalSignature(vchSig, flags) && IsCanonicalPubKey(vchPubKey, flags) && + CheckSig(vchSig, vchPubKey, scriptCode, txTo, nIn, nHashType, flags); + + if (fOk) { + isig++; + nSigsCount--; + } + ikey++; + nKeysCount--; + + // If there are more signatures left than keys left, + // then too many signatures have failed + if (nSigsCount > nKeysCount) + fSuccess = false; + } + + // Clean up stack of actual arguments + while (i-- > 1) + popstack(stack); + + // A bug causes CHECKMULTISIG to consume one extra argument + // whose contents were not checked in any way. + // + // Unfortunately this is a potential source of mutability, + // so optionally verify it is exactly equal to zero prior + // to removing it from the stack. + if (stack.size() < 1) + return false; + if ((flags & SCRIPT_VERIFY_NULLDUMMY) && stacktop(-1).size()) + return error("CHECKMULTISIG dummy argument not null"); + popstack(stack); + + stack.push_back(fSuccess ? vchTrue : vchFalse); + + if (opcode == OP_CHECKMULTISIGVERIFY) + { + if (fSuccess) + popstack(stack); + else + return false; + } + } + break; + + default: + return false; + } + + // Size limits + if (stack.size() + altstack.size() > 1000) + return false; + } + } + catch (...) + { + return false; + } + + if (!vfExec.empty()) + return false; + + return true; +} + +namespace { + +/** Wrapper that serializes like CTransaction, but with the modifications + * required for the signature hash done in-place + */ +class CTransactionSignatureSerializer { +private: + const CTransaction &txTo; // reference to the spending transaction (the one being serialized) + const CScript &scriptCode; // output script being consumed + const unsigned int nIn; // input index of txTo being signed + const bool fAnyoneCanPay; // whether the hashtype has the SIGHASH_ANYONECANPAY flag set + const bool fHashSingle; // whether the hashtype is SIGHASH_SINGLE + const bool fHashNone; // whether the hashtype is SIGHASH_NONE + +public: + CTransactionSignatureSerializer(const CTransaction &txToIn, const CScript &scriptCodeIn, unsigned int nInIn, int nHashTypeIn) : + txTo(txToIn), scriptCode(scriptCodeIn), nIn(nInIn), + fAnyoneCanPay(!!(nHashTypeIn & SIGHASH_ANYONECANPAY)), + fHashSingle((nHashTypeIn & 0x1f) == SIGHASH_SINGLE), + fHashNone((nHashTypeIn & 0x1f) == SIGHASH_NONE) {} + + /** Serialize the passed scriptCode, skipping OP_CODESEPARATORs */ + template + void SerializeScriptCode(S &s, int nType, int nVersion) const { + CScript::const_iterator it = scriptCode.begin(); + CScript::const_iterator itBegin = it; + opcodetype opcode; + unsigned int nCodeSeparators = 0; + while (scriptCode.GetOp(it, opcode)) { + if (opcode == OP_CODESEPARATOR) + nCodeSeparators++; + } + ::WriteCompactSize(s, scriptCode.size() - nCodeSeparators); + it = itBegin; + while (scriptCode.GetOp(it, opcode)) { + if (opcode == OP_CODESEPARATOR) { + s.write((char*)&itBegin[0], it-itBegin-1); + itBegin = it; + } + } + s.write((char*)&itBegin[0], it-itBegin); + } + + /** Serialize an input of txTo */ + template + void SerializeInput(S &s, unsigned int nInput, int nType, int nVersion) const { + // In case of SIGHASH_ANYONECANPAY, only the input being signed is serialized + if (fAnyoneCanPay) + nInput = nIn; + // Serialize the prevout + ::Serialize(s, txTo.vin[nInput].prevout, nType, nVersion); + // Serialize the script + if (nInput != nIn) + // Blank out other inputs' signatures + ::Serialize(s, CScript(), nType, nVersion); + else + SerializeScriptCode(s, nType, nVersion); + // Serialize the nSequence + if (nInput != nIn && (fHashSingle || fHashNone)) + // let the others update at will + ::Serialize(s, (int)0, nType, nVersion); + else + ::Serialize(s, txTo.vin[nInput].nSequence, nType, nVersion); + } + + /** Serialize an output of txTo */ + template + void SerializeOutput(S &s, unsigned int nOutput, int nType, int nVersion) const { + if (fHashSingle && nOutput != nIn) + // Do not lock-in the txout payee at other indices as txin + ::Serialize(s, CTxOut(), nType, nVersion); + else + ::Serialize(s, txTo.vout[nOutput], nType, nVersion); + } + + /** Serialize txTo */ + template + void Serialize(S &s, int nType, int nVersion) const { + // Serialize nVersion + ::Serialize(s, txTo.nVersion, nType, nVersion); + // Serialize vin + unsigned int nInputs = fAnyoneCanPay ? 1 : txTo.vin.size(); + ::WriteCompactSize(s, nInputs); + for (unsigned int nInput = 0; nInput < nInputs; nInput++) + SerializeInput(s, nInput, nType, nVersion); + // Serialize vout + unsigned int nOutputs = fHashNone ? 0 : (fHashSingle ? nIn+1 : txTo.vout.size()); + ::WriteCompactSize(s, nOutputs); + for (unsigned int nOutput = 0; nOutput < nOutputs; nOutput++) + SerializeOutput(s, nOutput, nType, nVersion); + // Serialie nLockTime + ::Serialize(s, txTo.nLockTime, nType, nVersion); + } +}; + +} // anon namespace + +uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType) +{ + if (nIn >= txTo.vin.size()) { + LogPrintf("ERROR: SignatureHash() : nIn=%d out of range\n", nIn); + return 1; + } + + // Check for invalid use of SIGHASH_SINGLE + if ((nHashType & 0x1f) == SIGHASH_SINGLE) { + if (nIn >= txTo.vout.size()) { + LogPrintf("ERROR: SignatureHash() : nOut=%d out of range\n", nIn); + return 1; + } + } + + // Wrapper to serialize only the necessary parts of the transaction being signed + CTransactionSignatureSerializer txTmp(txTo, scriptCode, nIn, nHashType); + + // Serialize and hash + CHashWriter ss(SER_GETHASH, 0); + ss << txTmp << nHashType; + return ss.GetHash(); +} + +// Valid signature cache, to avoid doing expensive ECDSA signature checking +// twice for every transaction (once when accepted into memory pool, and +// again when accepted into the block chain) +class CSignatureCache +{ +private: + // sigdata_type is (signature hash, signature, public key): + typedef boost::tuple, CPubKey> sigdata_type; + std::set< sigdata_type> setValid; + boost::shared_mutex cs_sigcache; + +public: + bool + Get(const uint256 &hash, const std::vector& vchSig, const CPubKey& pubKey) + { + boost::shared_lock lock(cs_sigcache); + + sigdata_type k(hash, vchSig, pubKey); + std::set::iterator mi = setValid.find(k); + if (mi != setValid.end()) + return true; + return false; + } + + void Set(const uint256 &hash, const std::vector& vchSig, const CPubKey& pubKey) + { + // DoS prevention: limit cache size to less than 10MB + // (~200 bytes per cache entry times 50,000 entries) + // Since there are a maximum of 20,000 signature operations per block + // 50,000 is a reasonable default. + int64_t nMaxCacheSize = GetArg("-maxsigcachesize", 50000); + if (nMaxCacheSize <= 0) return; + + boost::unique_lock lock(cs_sigcache); + + while (static_cast(setValid.size()) > nMaxCacheSize) + { + // Evict a random entry. Random because that helps + // foil would-be DoS attackers who might try to pre-generate + // and re-use a set of valid signatures just-slightly-greater + // than our cache size. + uint256 randomHash = GetRandHash(); + std::vector unused; + std::set::iterator it = + setValid.lower_bound(sigdata_type(randomHash, unused, unused)); + if (it == setValid.end()) + it = setValid.begin(); + setValid.erase(*it); + } + + sigdata_type k(hash, vchSig, pubKey); + setValid.insert(k); + } +}; + +bool CheckSig(vector vchSig, const vector &vchPubKey, const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, int flags) +{ + static CSignatureCache signatureCache; + + CPubKey pubkey(vchPubKey); + if (!pubkey.IsValid()) + return false; + + // Hash type is one byte tacked on to the end of the signature + if (vchSig.empty()) + return false; + if (nHashType == 0) + nHashType = vchSig.back(); + else if (nHashType != vchSig.back()) + return false; + vchSig.pop_back(); + + uint256 sighash = SignatureHash(scriptCode, txTo, nIn, nHashType); + + if (signatureCache.Get(sighash, vchSig, pubkey)) + return true; + + if (!pubkey.Verify(sighash, vchSig)) + return false; + + if (!(flags & SCRIPT_VERIFY_NOCACHE)) + signatureCache.Set(sighash, vchSig, pubkey); + + return true; +} + +bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, + unsigned int flags, int nHashType) +{ + vector > stack, stackCopy; + if (!EvalScript(stack, scriptSig, txTo, nIn, flags, nHashType)) + return false; + if (flags & SCRIPT_VERIFY_P2SH) + stackCopy = stack; + if (!EvalScript(stack, scriptPubKey, txTo, nIn, flags, nHashType)) + return false; + if (stack.empty()) + return false; + + if (CastToBool(stack.back()) == false) + return false; + + // Additional validation for spend-to-script-hash transactions: + if ((flags & SCRIPT_VERIFY_P2SH) && scriptPubKey.IsPayToScriptHash()) + { + if (!scriptSig.IsPushOnly()) // scriptSig must be literals-only + return false; // or validation fails + + // stackCopy cannot be empty here, because if it was the + // P2SH HASH <> EQUAL scriptPubKey would be evaluated with + // an empty stack and the EvalScript above would return false. + assert(!stackCopy.empty()); + + const valtype& pubKeySerialized = stackCopy.back(); + CScript pubKey2(pubKeySerialized.begin(), pubKeySerialized.end()); + popstack(stackCopy); + + if (!EvalScript(stackCopy, pubKey2, txTo, nIn, flags, nHashType)) + return false; + if (stackCopy.empty()) + return false; + return CastToBool(stackCopy.back()); + } + + return true; +} diff --git a/src/script/interpreter.h b/src/script/interpreter.h new file mode 100644 index 0000000000..0c6f8b9d13 --- /dev/null +++ b/src/script/interpreter.h @@ -0,0 +1,45 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2013 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef H_BITCOIN_SCRIPT_INTERPRETER +#define H_BITCOIN_SCRIPT_INTERPRETER + +#include +#include +#include + +class uint256; +class CScript; +class CTransaction; + +/** Signature hash types/flags */ +enum +{ + SIGHASH_ALL = 1, + SIGHASH_NONE = 2, + SIGHASH_SINGLE = 3, + SIGHASH_ANYONECANPAY = 0x80, +}; + +/** Script verification flags */ +enum +{ + SCRIPT_VERIFY_NONE = 0, + SCRIPT_VERIFY_P2SH = (1U << 0), // evaluate P2SH (BIP16) subscripts + SCRIPT_VERIFY_STRICTENC = (1U << 1), // enforce strict conformance to DER and SEC2 for signatures and pubkeys + SCRIPT_VERIFY_LOW_S = (1U << 2), // enforce low S values ( &vchPubKey, unsigned int flags); +bool IsCanonicalSignature(const std::vector &vchSig, unsigned int flags); + +uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType); +bool CheckSig(std::vector vchSig, const std::vector &vchPubKey, const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, int flags); +bool EvalScript(std::vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); +bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); + +#endif diff --git a/src/scriptutils.cpp b/src/scriptutils.cpp index 56edc2c2dd..fb3766ab15 100644 --- a/src/scriptutils.cpp +++ b/src/scriptutils.cpp @@ -5,67 +5,17 @@ #include "scriptutils.h" -#include "crypto/ripemd160.h" -#include "crypto/sha1.h" -#include "crypto/sha2.h" #include "core.h" -#include "hash.h" #include "key.h" #include "keystore.h" -#include "random.h" -#include "sync.h" #include "uint256.h" #include "util.h" #include -#include -#include -#include using namespace std; -using namespace boost; typedef vector valtype; -static const valtype vchFalse(0); -static const valtype vchZero(0); -static const valtype vchTrue(1, 1); -static const CScriptNum bnZero(0); -static const CScriptNum bnOne(1); -static const CScriptNum bnFalse(0); -static const CScriptNum bnTrue(1); - -bool CheckSig(vector vchSig, const vector &vchPubKey, const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, int flags); - -bool CastToBool(const valtype& vch) -{ - for (unsigned int i = 0; i < vch.size(); i++) - { - if (vch[i] != 0) - { - // Can be negative zero - if (i == vch.size()-1 && vch[i] == 0x80) - return false; - return true; - } - } - return false; -} - - - -// -// Script is a stack machine (like Forth) that evaluates a predicate -// returning a bool indicating valid or not. There are no loops. -// -#define stacktop(i) (stack.at(stack.size()+(i))) -#define altstacktop(i) (altstack.at(altstack.size()+(i))) -static inline void popstack(vector& stack) -{ - if (stack.empty()) - throw runtime_error("popstack() : stack empty"); - stack.pop_back(); -} - const char* GetTxnOutputType(txnouttype t) { @@ -81,972 +31,6 @@ const char* GetTxnOutputType(txnouttype t) return NULL; } -bool IsCanonicalPubKey(const valtype &vchPubKey, unsigned int flags) { - if (!(flags & SCRIPT_VERIFY_STRICTENC)) - return true; - - if (vchPubKey.size() < 33) - return error("Non-canonical public key: too short"); - if (vchPubKey[0] == 0x04) { - if (vchPubKey.size() != 65) - return error("Non-canonical public key: invalid length for uncompressed key"); - } else if (vchPubKey[0] == 0x02 || vchPubKey[0] == 0x03) { - if (vchPubKey.size() != 33) - return error("Non-canonical public key: invalid length for compressed key"); - } else { - return error("Non-canonical public key: neither compressed nor uncompressed"); - } - return true; -} - -bool IsCanonicalSignature(const valtype &vchSig, unsigned int flags) { - if (!(flags & SCRIPT_VERIFY_STRICTENC)) - return true; - - // See https://bitcointalk.org/index.php?topic=8392.msg127623#msg127623 - // A canonical signature exists of: <30> <02> <02> - // Where R and S are not negative (their first byte has its highest bit not set), and not - // excessively padded (do not start with a 0 byte, unless an otherwise negative number follows, - // in which case a single 0 byte is necessary and even required). - if (vchSig.size() < 9) - return error("Non-canonical signature: too short"); - if (vchSig.size() > 73) - return error("Non-canonical signature: too long"); - unsigned char nHashType = vchSig[vchSig.size() - 1] & (~(SIGHASH_ANYONECANPAY)); - if (nHashType < SIGHASH_ALL || nHashType > SIGHASH_SINGLE) - return error("Non-canonical signature: unknown hashtype byte"); - if (vchSig[0] != 0x30) - return error("Non-canonical signature: wrong type"); - if (vchSig[1] != vchSig.size()-3) - return error("Non-canonical signature: wrong length marker"); - unsigned int nLenR = vchSig[3]; - if (5 + nLenR >= vchSig.size()) - return error("Non-canonical signature: S length misplaced"); - unsigned int nLenS = vchSig[5+nLenR]; - if ((unsigned long)(nLenR+nLenS+7) != vchSig.size()) - return error("Non-canonical signature: R+S length mismatch"); - - const unsigned char *R = &vchSig[4]; - if (R[-2] != 0x02) - return error("Non-canonical signature: R value type mismatch"); - if (nLenR == 0) - return error("Non-canonical signature: R length is zero"); - if (R[0] & 0x80) - return error("Non-canonical signature: R value negative"); - if (nLenR > 1 && (R[0] == 0x00) && !(R[1] & 0x80)) - return error("Non-canonical signature: R value excessively padded"); - - const unsigned char *S = &vchSig[6+nLenR]; - if (S[-2] != 0x02) - return error("Non-canonical signature: S value type mismatch"); - if (nLenS == 0) - return error("Non-canonical signature: S length is zero"); - if (S[0] & 0x80) - return error("Non-canonical signature: S value negative"); - if (nLenS > 1 && (S[0] == 0x00) && !(S[1] & 0x80)) - return error("Non-canonical signature: S value excessively padded"); - - if (flags & SCRIPT_VERIFY_LOW_S) { - // If the S value is above the order of the curve divided by two, its - // complement modulo the order could have been used instead, which is - // one byte shorter when encoded correctly. - if (!CKey::CheckSignatureElement(S, nLenS, true)) - return error("Non-canonical signature: S value is unnecessarily high"); - } - - return true; -} - -bool EvalScript(vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType) -{ - CScript::const_iterator pc = script.begin(); - CScript::const_iterator pend = script.end(); - CScript::const_iterator pbegincodehash = script.begin(); - opcodetype opcode; - valtype vchPushValue; - vector vfExec; - vector altstack; - if (script.size() > 10000) - return false; - int nOpCount = 0; - - try - { - while (pc < pend) - { - bool fExec = !count(vfExec.begin(), vfExec.end(), false); - - // - // Read instruction - // - if (!script.GetOp(pc, opcode, vchPushValue)) - return false; - if (vchPushValue.size() > MAX_SCRIPT_ELEMENT_SIZE) - return false; - - // Note how OP_RESERVED does not count towards the opcode limit. - if (opcode > OP_16 && ++nOpCount > 201) - return false; - - if (opcode == OP_CAT || - opcode == OP_SUBSTR || - opcode == OP_LEFT || - opcode == OP_RIGHT || - opcode == OP_INVERT || - opcode == OP_AND || - opcode == OP_OR || - opcode == OP_XOR || - opcode == OP_2MUL || - opcode == OP_2DIV || - opcode == OP_MUL || - opcode == OP_DIV || - opcode == OP_MOD || - opcode == OP_LSHIFT || - opcode == OP_RSHIFT) - return false; // Disabled opcodes. - - if (fExec && 0 <= opcode && opcode <= OP_PUSHDATA4) - stack.push_back(vchPushValue); - else if (fExec || (OP_IF <= opcode && opcode <= OP_ENDIF)) - switch (opcode) - { - // - // Push value - // - case OP_1NEGATE: - case OP_1: - case OP_2: - case OP_3: - case OP_4: - case OP_5: - case OP_6: - case OP_7: - case OP_8: - case OP_9: - case OP_10: - case OP_11: - case OP_12: - case OP_13: - case OP_14: - case OP_15: - case OP_16: - { - // ( -- value) - CScriptNum bn((int)opcode - (int)(OP_1 - 1)); - stack.push_back(bn.getvch()); - } - break; - - - // - // Control - // - case OP_NOP: - case OP_NOP1: case OP_NOP2: case OP_NOP3: case OP_NOP4: case OP_NOP5: - case OP_NOP6: case OP_NOP7: case OP_NOP8: case OP_NOP9: case OP_NOP10: - break; - - case OP_IF: - case OP_NOTIF: - { - // if [statements] [else [statements]] endif - bool fValue = false; - if (fExec) - { - if (stack.size() < 1) - return false; - valtype& vch = stacktop(-1); - fValue = CastToBool(vch); - if (opcode == OP_NOTIF) - fValue = !fValue; - popstack(stack); - } - vfExec.push_back(fValue); - } - break; - - case OP_ELSE: - { - if (vfExec.empty()) - return false; - vfExec.back() = !vfExec.back(); - } - break; - - case OP_ENDIF: - { - if (vfExec.empty()) - return false; - vfExec.pop_back(); - } - break; - - case OP_VERIFY: - { - // (true -- ) or - // (false -- false) and return - if (stack.size() < 1) - return false; - bool fValue = CastToBool(stacktop(-1)); - if (fValue) - popstack(stack); - else - return false; - } - break; - - case OP_RETURN: - { - return false; - } - break; - - - // - // Stack ops - // - case OP_TOALTSTACK: - { - if (stack.size() < 1) - return false; - altstack.push_back(stacktop(-1)); - popstack(stack); - } - break; - - case OP_FROMALTSTACK: - { - if (altstack.size() < 1) - return false; - stack.push_back(altstacktop(-1)); - popstack(altstack); - } - break; - - case OP_2DROP: - { - // (x1 x2 -- ) - if (stack.size() < 2) - return false; - popstack(stack); - popstack(stack); - } - break; - - case OP_2DUP: - { - // (x1 x2 -- x1 x2 x1 x2) - if (stack.size() < 2) - return false; - valtype vch1 = stacktop(-2); - valtype vch2 = stacktop(-1); - stack.push_back(vch1); - stack.push_back(vch2); - } - break; - - case OP_3DUP: - { - // (x1 x2 x3 -- x1 x2 x3 x1 x2 x3) - if (stack.size() < 3) - return false; - valtype vch1 = stacktop(-3); - valtype vch2 = stacktop(-2); - valtype vch3 = stacktop(-1); - stack.push_back(vch1); - stack.push_back(vch2); - stack.push_back(vch3); - } - break; - - case OP_2OVER: - { - // (x1 x2 x3 x4 -- x1 x2 x3 x4 x1 x2) - if (stack.size() < 4) - return false; - valtype vch1 = stacktop(-4); - valtype vch2 = stacktop(-3); - stack.push_back(vch1); - stack.push_back(vch2); - } - break; - - case OP_2ROT: - { - // (x1 x2 x3 x4 x5 x6 -- x3 x4 x5 x6 x1 x2) - if (stack.size() < 6) - return false; - valtype vch1 = stacktop(-6); - valtype vch2 = stacktop(-5); - stack.erase(stack.end()-6, stack.end()-4); - stack.push_back(vch1); - stack.push_back(vch2); - } - break; - - case OP_2SWAP: - { - // (x1 x2 x3 x4 -- x3 x4 x1 x2) - if (stack.size() < 4) - return false; - swap(stacktop(-4), stacktop(-2)); - swap(stacktop(-3), stacktop(-1)); - } - break; - - case OP_IFDUP: - { - // (x - 0 | x x) - if (stack.size() < 1) - return false; - valtype vch = stacktop(-1); - if (CastToBool(vch)) - stack.push_back(vch); - } - break; - - case OP_DEPTH: - { - // -- stacksize - CScriptNum bn(stack.size()); - stack.push_back(bn.getvch()); - } - break; - - case OP_DROP: - { - // (x -- ) - if (stack.size() < 1) - return false; - popstack(stack); - } - break; - - case OP_DUP: - { - // (x -- x x) - if (stack.size() < 1) - return false; - valtype vch = stacktop(-1); - stack.push_back(vch); - } - break; - - case OP_NIP: - { - // (x1 x2 -- x2) - if (stack.size() < 2) - return false; - stack.erase(stack.end() - 2); - } - break; - - case OP_OVER: - { - // (x1 x2 -- x1 x2 x1) - if (stack.size() < 2) - return false; - valtype vch = stacktop(-2); - stack.push_back(vch); - } - break; - - case OP_PICK: - case OP_ROLL: - { - // (xn ... x2 x1 x0 n - xn ... x2 x1 x0 xn) - // (xn ... x2 x1 x0 n - ... x2 x1 x0 xn) - if (stack.size() < 2) - return false; - int n = CScriptNum(stacktop(-1)).getint(); - popstack(stack); - if (n < 0 || n >= (int)stack.size()) - return false; - valtype vch = stacktop(-n-1); - if (opcode == OP_ROLL) - stack.erase(stack.end()-n-1); - stack.push_back(vch); - } - break; - - case OP_ROT: - { - // (x1 x2 x3 -- x2 x3 x1) - // x2 x1 x3 after first swap - // x2 x3 x1 after second swap - if (stack.size() < 3) - return false; - swap(stacktop(-3), stacktop(-2)); - swap(stacktop(-2), stacktop(-1)); - } - break; - - case OP_SWAP: - { - // (x1 x2 -- x2 x1) - if (stack.size() < 2) - return false; - swap(stacktop(-2), stacktop(-1)); - } - break; - - case OP_TUCK: - { - // (x1 x2 -- x2 x1 x2) - if (stack.size() < 2) - return false; - valtype vch = stacktop(-1); - stack.insert(stack.end()-2, vch); - } - break; - - - case OP_SIZE: - { - // (in -- in size) - if (stack.size() < 1) - return false; - CScriptNum bn(stacktop(-1).size()); - stack.push_back(bn.getvch()); - } - break; - - - // - // Bitwise logic - // - case OP_EQUAL: - case OP_EQUALVERIFY: - //case OP_NOTEQUAL: // use OP_NUMNOTEQUAL - { - // (x1 x2 - bool) - if (stack.size() < 2) - return false; - valtype& vch1 = stacktop(-2); - valtype& vch2 = stacktop(-1); - bool fEqual = (vch1 == vch2); - // OP_NOTEQUAL is disabled because it would be too easy to say - // something like n != 1 and have some wiseguy pass in 1 with extra - // zero bytes after it (numerically, 0x01 == 0x0001 == 0x000001) - //if (opcode == OP_NOTEQUAL) - // fEqual = !fEqual; - popstack(stack); - popstack(stack); - stack.push_back(fEqual ? vchTrue : vchFalse); - if (opcode == OP_EQUALVERIFY) - { - if (fEqual) - popstack(stack); - else - return false; - } - } - break; - - - // - // Numeric - // - case OP_1ADD: - case OP_1SUB: - case OP_NEGATE: - case OP_ABS: - case OP_NOT: - case OP_0NOTEQUAL: - { - // (in -- out) - if (stack.size() < 1) - return false; - CScriptNum bn(stacktop(-1)); - switch (opcode) - { - case OP_1ADD: bn += bnOne; break; - case OP_1SUB: bn -= bnOne; break; - case OP_NEGATE: bn = -bn; break; - case OP_ABS: if (bn < bnZero) bn = -bn; break; - case OP_NOT: bn = (bn == bnZero); break; - case OP_0NOTEQUAL: bn = (bn != bnZero); break; - default: assert(!"invalid opcode"); break; - } - popstack(stack); - stack.push_back(bn.getvch()); - } - break; - - case OP_ADD: - case OP_SUB: - case OP_BOOLAND: - case OP_BOOLOR: - case OP_NUMEQUAL: - case OP_NUMEQUALVERIFY: - case OP_NUMNOTEQUAL: - case OP_LESSTHAN: - case OP_GREATERTHAN: - case OP_LESSTHANOREQUAL: - case OP_GREATERTHANOREQUAL: - case OP_MIN: - case OP_MAX: - { - // (x1 x2 -- out) - if (stack.size() < 2) - return false; - CScriptNum bn1(stacktop(-2)); - CScriptNum bn2(stacktop(-1)); - CScriptNum bn(0); - switch (opcode) - { - case OP_ADD: - bn = bn1 + bn2; - break; - - case OP_SUB: - bn = bn1 - bn2; - break; - - case OP_BOOLAND: bn = (bn1 != bnZero && bn2 != bnZero); break; - case OP_BOOLOR: bn = (bn1 != bnZero || bn2 != bnZero); break; - case OP_NUMEQUAL: bn = (bn1 == bn2); break; - case OP_NUMEQUALVERIFY: bn = (bn1 == bn2); break; - case OP_NUMNOTEQUAL: bn = (bn1 != bn2); break; - case OP_LESSTHAN: bn = (bn1 < bn2); break; - case OP_GREATERTHAN: bn = (bn1 > bn2); break; - case OP_LESSTHANOREQUAL: bn = (bn1 <= bn2); break; - case OP_GREATERTHANOREQUAL: bn = (bn1 >= bn2); break; - case OP_MIN: bn = (bn1 < bn2 ? bn1 : bn2); break; - case OP_MAX: bn = (bn1 > bn2 ? bn1 : bn2); break; - default: assert(!"invalid opcode"); break; - } - popstack(stack); - popstack(stack); - stack.push_back(bn.getvch()); - - if (opcode == OP_NUMEQUALVERIFY) - { - if (CastToBool(stacktop(-1))) - popstack(stack); - else - return false; - } - } - break; - - case OP_WITHIN: - { - // (x min max -- out) - if (stack.size() < 3) - return false; - CScriptNum bn1(stacktop(-3)); - CScriptNum bn2(stacktop(-2)); - CScriptNum bn3(stacktop(-1)); - bool fValue = (bn2 <= bn1 && bn1 < bn3); - popstack(stack); - popstack(stack); - popstack(stack); - stack.push_back(fValue ? vchTrue : vchFalse); - } - break; - - - // - // Crypto - // - case OP_RIPEMD160: - case OP_SHA1: - case OP_SHA256: - case OP_HASH160: - case OP_HASH256: - { - // (in -- hash) - if (stack.size() < 1) - return false; - valtype& vch = stacktop(-1); - valtype vchHash((opcode == OP_RIPEMD160 || opcode == OP_SHA1 || opcode == OP_HASH160) ? 20 : 32); - if (opcode == OP_RIPEMD160) - CRIPEMD160().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); - else if (opcode == OP_SHA1) - CSHA1().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); - else if (opcode == OP_SHA256) - CSHA256().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); - else if (opcode == OP_HASH160) - CHash160().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); - else if (opcode == OP_HASH256) - CHash256().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); - popstack(stack); - stack.push_back(vchHash); - } - break; - - case OP_CODESEPARATOR: - { - // Hash starts after the code separator - pbegincodehash = pc; - } - break; - - case OP_CHECKSIG: - case OP_CHECKSIGVERIFY: - { - // (sig pubkey -- bool) - if (stack.size() < 2) - return false; - - valtype& vchSig = stacktop(-2); - valtype& vchPubKey = stacktop(-1); - - // Subset of script starting at the most recent codeseparator - CScript scriptCode(pbegincodehash, pend); - - // Drop the signature, since there's no way for a signature to sign itself - scriptCode.FindAndDelete(CScript(vchSig)); - - bool fSuccess = IsCanonicalSignature(vchSig, flags) && IsCanonicalPubKey(vchPubKey, flags) && - CheckSig(vchSig, vchPubKey, scriptCode, txTo, nIn, nHashType, flags); - - popstack(stack); - popstack(stack); - stack.push_back(fSuccess ? vchTrue : vchFalse); - if (opcode == OP_CHECKSIGVERIFY) - { - if (fSuccess) - popstack(stack); - else - return false; - } - } - break; - - case OP_CHECKMULTISIG: - case OP_CHECKMULTISIGVERIFY: - { - // ([sig ...] num_of_signatures [pubkey ...] num_of_pubkeys -- bool) - - int i = 1; - if ((int)stack.size() < i) - return false; - - int nKeysCount = CScriptNum(stacktop(-i)).getint(); - if (nKeysCount < 0 || nKeysCount > 20) - return false; - nOpCount += nKeysCount; - if (nOpCount > 201) - return false; - int ikey = ++i; - i += nKeysCount; - if ((int)stack.size() < i) - return false; - - int nSigsCount = CScriptNum(stacktop(-i)).getint(); - if (nSigsCount < 0 || nSigsCount > nKeysCount) - return false; - int isig = ++i; - i += nSigsCount; - if ((int)stack.size() < i) - return false; - - // Subset of script starting at the most recent codeseparator - CScript scriptCode(pbegincodehash, pend); - - // Drop the signatures, since there's no way for a signature to sign itself - for (int k = 0; k < nSigsCount; k++) - { - valtype& vchSig = stacktop(-isig-k); - scriptCode.FindAndDelete(CScript(vchSig)); - } - - bool fSuccess = true; - while (fSuccess && nSigsCount > 0) - { - valtype& vchSig = stacktop(-isig); - valtype& vchPubKey = stacktop(-ikey); - - // Check signature - bool fOk = IsCanonicalSignature(vchSig, flags) && IsCanonicalPubKey(vchPubKey, flags) && - CheckSig(vchSig, vchPubKey, scriptCode, txTo, nIn, nHashType, flags); - - if (fOk) { - isig++; - nSigsCount--; - } - ikey++; - nKeysCount--; - - // If there are more signatures left than keys left, - // then too many signatures have failed - if (nSigsCount > nKeysCount) - fSuccess = false; - } - - // Clean up stack of actual arguments - while (i-- > 1) - popstack(stack); - - // A bug causes CHECKMULTISIG to consume one extra argument - // whose contents were not checked in any way. - // - // Unfortunately this is a potential source of mutability, - // so optionally verify it is exactly equal to zero prior - // to removing it from the stack. - if (stack.size() < 1) - return false; - if ((flags & SCRIPT_VERIFY_NULLDUMMY) && stacktop(-1).size()) - return error("CHECKMULTISIG dummy argument not null"); - popstack(stack); - - stack.push_back(fSuccess ? vchTrue : vchFalse); - - if (opcode == OP_CHECKMULTISIGVERIFY) - { - if (fSuccess) - popstack(stack); - else - return false; - } - } - break; - - default: - return false; - } - - // Size limits - if (stack.size() + altstack.size() > 1000) - return false; - } - } - catch (...) - { - return false; - } - - - if (!vfExec.empty()) - return false; - - return true; -} - - - - - - - -namespace { - -/** Wrapper that serializes like CTransaction, but with the modifications - * required for the signature hash done in-place - */ -class CTransactionSignatureSerializer { -private: - const CTransaction &txTo; // reference to the spending transaction (the one being serialized) - const CScript &scriptCode; // output script being consumed - const unsigned int nIn; // input index of txTo being signed - const bool fAnyoneCanPay; // whether the hashtype has the SIGHASH_ANYONECANPAY flag set - const bool fHashSingle; // whether the hashtype is SIGHASH_SINGLE - const bool fHashNone; // whether the hashtype is SIGHASH_NONE - -public: - CTransactionSignatureSerializer(const CTransaction &txToIn, const CScript &scriptCodeIn, unsigned int nInIn, int nHashTypeIn) : - txTo(txToIn), scriptCode(scriptCodeIn), nIn(nInIn), - fAnyoneCanPay(!!(nHashTypeIn & SIGHASH_ANYONECANPAY)), - fHashSingle((nHashTypeIn & 0x1f) == SIGHASH_SINGLE), - fHashNone((nHashTypeIn & 0x1f) == SIGHASH_NONE) {} - - /** Serialize the passed scriptCode, skipping OP_CODESEPARATORs */ - template - void SerializeScriptCode(S &s, int nType, int nVersion) const { - CScript::const_iterator it = scriptCode.begin(); - CScript::const_iterator itBegin = it; - opcodetype opcode; - unsigned int nCodeSeparators = 0; - while (scriptCode.GetOp(it, opcode)) { - if (opcode == OP_CODESEPARATOR) - nCodeSeparators++; - } - ::WriteCompactSize(s, scriptCode.size() - nCodeSeparators); - it = itBegin; - while (scriptCode.GetOp(it, opcode)) { - if (opcode == OP_CODESEPARATOR) { - s.write((char*)&itBegin[0], it-itBegin-1); - itBegin = it; - } - } - s.write((char*)&itBegin[0], it-itBegin); - } - - /** Serialize an input of txTo */ - template - void SerializeInput(S &s, unsigned int nInput, int nType, int nVersion) const { - // In case of SIGHASH_ANYONECANPAY, only the input being signed is serialized - if (fAnyoneCanPay) - nInput = nIn; - // Serialize the prevout - ::Serialize(s, txTo.vin[nInput].prevout, nType, nVersion); - // Serialize the script - if (nInput != nIn) - // Blank out other inputs' signatures - ::Serialize(s, CScript(), nType, nVersion); - else - SerializeScriptCode(s, nType, nVersion); - // Serialize the nSequence - if (nInput != nIn && (fHashSingle || fHashNone)) - // let the others update at will - ::Serialize(s, (int)0, nType, nVersion); - else - ::Serialize(s, txTo.vin[nInput].nSequence, nType, nVersion); - } - - /** Serialize an output of txTo */ - template - void SerializeOutput(S &s, unsigned int nOutput, int nType, int nVersion) const { - if (fHashSingle && nOutput != nIn) - // Do not lock-in the txout payee at other indices as txin - ::Serialize(s, CTxOut(), nType, nVersion); - else - ::Serialize(s, txTo.vout[nOutput], nType, nVersion); - } - - /** Serialize txTo */ - template - void Serialize(S &s, int nType, int nVersion) const { - // Serialize nVersion - ::Serialize(s, txTo.nVersion, nType, nVersion); - // Serialize vin - unsigned int nInputs = fAnyoneCanPay ? 1 : txTo.vin.size(); - ::WriteCompactSize(s, nInputs); - for (unsigned int nInput = 0; nInput < nInputs; nInput++) - SerializeInput(s, nInput, nType, nVersion); - // Serialize vout - unsigned int nOutputs = fHashNone ? 0 : (fHashSingle ? nIn+1 : txTo.vout.size()); - ::WriteCompactSize(s, nOutputs); - for (unsigned int nOutput = 0; nOutput < nOutputs; nOutput++) - SerializeOutput(s, nOutput, nType, nVersion); - // Serialie nLockTime - ::Serialize(s, txTo.nLockTime, nType, nVersion); - } -}; - -} // anon namespace - -uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType) -{ - if (nIn >= txTo.vin.size()) { - LogPrintf("ERROR: SignatureHash() : nIn=%d out of range\n", nIn); - return 1; - } - - // Check for invalid use of SIGHASH_SINGLE - if ((nHashType & 0x1f) == SIGHASH_SINGLE) { - if (nIn >= txTo.vout.size()) { - LogPrintf("ERROR: SignatureHash() : nOut=%d out of range\n", nIn); - return 1; - } - } - - // Wrapper to serialize only the necessary parts of the transaction being signed - CTransactionSignatureSerializer txTmp(txTo, scriptCode, nIn, nHashType); - - // Serialize and hash - CHashWriter ss(SER_GETHASH, 0); - ss << txTmp << nHashType; - return ss.GetHash(); -} - -// Valid signature cache, to avoid doing expensive ECDSA signature checking -// twice for every transaction (once when accepted into memory pool, and -// again when accepted into the block chain) -class CSignatureCache -{ -private: - // sigdata_type is (signature hash, signature, public key): - typedef boost::tuple, CPubKey> sigdata_type; - std::set< sigdata_type> setValid; - boost::shared_mutex cs_sigcache; - -public: - bool - Get(const uint256 &hash, const std::vector& vchSig, const CPubKey& pubKey) - { - boost::shared_lock lock(cs_sigcache); - - sigdata_type k(hash, vchSig, pubKey); - std::set::iterator mi = setValid.find(k); - if (mi != setValid.end()) - return true; - return false; - } - - void Set(const uint256 &hash, const std::vector& vchSig, const CPubKey& pubKey) - { - // DoS prevention: limit cache size to less than 10MB - // (~200 bytes per cache entry times 50,000 entries) - // Since there are a maximum of 20,000 signature operations per block - // 50,000 is a reasonable default. - int64_t nMaxCacheSize = GetArg("-maxsigcachesize", 50000); - if (nMaxCacheSize <= 0) return; - - boost::unique_lock lock(cs_sigcache); - - while (static_cast(setValid.size()) > nMaxCacheSize) - { - // Evict a random entry. Random because that helps - // foil would-be DoS attackers who might try to pre-generate - // and re-use a set of valid signatures just-slightly-greater - // than our cache size. - uint256 randomHash = GetRandHash(); - std::vector unused; - std::set::iterator it = - setValid.lower_bound(sigdata_type(randomHash, unused, unused)); - if (it == setValid.end()) - it = setValid.begin(); - setValid.erase(*it); - } - - sigdata_type k(hash, vchSig, pubKey); - setValid.insert(k); - } -}; - -bool CheckSig(vector vchSig, const vector &vchPubKey, const CScript &scriptCode, - const CTransaction& txTo, unsigned int nIn, int nHashType, int flags) -{ - static CSignatureCache signatureCache; - - CPubKey pubkey(vchPubKey); - if (!pubkey.IsValid()) - return false; - - // Hash type is one byte tacked on to the end of the signature - if (vchSig.empty()) - return false; - if (nHashType == 0) - nHashType = vchSig.back(); - else if (nHashType != vchSig.back()) - return false; - vchSig.pop_back(); - - uint256 sighash = SignatureHash(scriptCode, txTo, nIn, nHashType); - - if (signatureCache.Get(sighash, vchSig, pubkey)) - return true; - - if (!pubkey.Verify(sighash, vchSig)) - return false; - - if (!(flags & SCRIPT_VERIFY_NOCACHE)) - signatureCache.Set(sighash, vchSig, pubkey); - - return true; -} - - - - - - - - - // // Return public keys or hashes from scriptPubKey, for 'standard' transaction types. // @@ -1459,48 +443,6 @@ void ExtractAffectedKeys(const CKeyStore &keystore, const CScript& scriptPubKey, CAffectedKeysVisitor(keystore, vKeys).Process(scriptPubKey); } -bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, - unsigned int flags, int nHashType) -{ - vector > stack, stackCopy; - if (!EvalScript(stack, scriptSig, txTo, nIn, flags, nHashType)) - return false; - if (flags & SCRIPT_VERIFY_P2SH) - stackCopy = stack; - if (!EvalScript(stack, scriptPubKey, txTo, nIn, flags, nHashType)) - return false; - if (stack.empty()) - return false; - - if (CastToBool(stack.back()) == false) - return false; - - // Additional validation for spend-to-script-hash transactions: - if ((flags & SCRIPT_VERIFY_P2SH) && scriptPubKey.IsPayToScriptHash()) - { - if (!scriptSig.IsPushOnly()) // scriptSig must be literals-only - return false; // or validation fails - - // stackCopy cannot be empty here, because if it was the - // P2SH HASH <> EQUAL scriptPubKey would be evaluated with - // an empty stack and the EvalScript above would return false. - assert(!stackCopy.empty()); - - const valtype& pubKeySerialized = stackCopy.back(); - CScript pubKey2(pubKeySerialized.begin(), pubKeySerialized.end()); - popstack(stackCopy); - - if (!EvalScript(stackCopy, pubKey2, txTo, nIn, flags, nHashType)) - return false; - if (stackCopy.empty()) - return false; - return CastToBool(stackCopy.back()); - } - - return true; -} - - bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, int nHashType) { assert(nIn < txTo.vin.size()); diff --git a/src/scriptutils.h b/src/scriptutils.h index 4f29f7ab29..1df95b1fa0 100644 --- a/src/scriptutils.h +++ b/src/scriptutils.h @@ -8,6 +8,7 @@ #include "key.h" #include "script/script.h" +#include "script/interpreter.h" #include #include @@ -20,26 +21,6 @@ struct CMutableTransaction; static const unsigned int MAX_OP_RETURN_RELAY = 40; // bytes -/** Signature hash types/flags */ -enum -{ - SIGHASH_ALL = 1, - SIGHASH_NONE = 2, - SIGHASH_SINGLE = 3, - SIGHASH_ANYONECANPAY = 0x80, -}; - -/** Script verification flags */ -enum -{ - SCRIPT_VERIFY_NONE = 0, - SCRIPT_VERIFY_P2SH = (1U << 0), // evaluate P2SH (BIP16) subscripts - SCRIPT_VERIFY_STRICTENC = (1U << 1), // enforce strict conformance to DER and SEC2 for signatures and pubkeys - SCRIPT_VERIFY_LOW_S = (1U << 2), // enforce low S values ( &vchPubKey, unsigned int flags); -bool IsCanonicalSignature(const std::vector &vchSig, unsigned int flags); - -bool EvalScript(std::vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); -uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType); bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector >& vSolutionsRet); int ScriptSigArgsExpected(txnouttype t, const std::vector >& vSolutions); bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType); @@ -171,7 +147,6 @@ bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet) bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::vector& addressRet, int& nRequiredRet); bool SignSignature(const CKeyStore& keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); -bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); // Given two sets of signatures for scriptPubKey, possibly with OP_0 placeholders, // combine them intelligently and return the result. diff --git a/src/test/canonical_tests.cpp b/src/test/canonical_tests.cpp index 2d2a600740..a17099de72 100644 --- a/src/test/canonical_tests.cpp +++ b/src/test/canonical_tests.cpp @@ -8,9 +8,11 @@ #include "data/sig_noncanonical.json.h" #include "data/sig_canonical.json.h" +#include "key.h" #include "random.h" -#include "scriptutils.h" +#include "script/interpreter.h" #include "util.h" +#include "utilstrencodings.h" #include #include diff --git a/src/test/multisig_tests.cpp b/src/test/multisig_tests.cpp index aa9b0de4ce..e28682522b 100644 --- a/src/test/multisig_tests.cpp +++ b/src/test/multisig_tests.cpp @@ -6,6 +6,7 @@ #include "keystore.h" #include "main.h" #include "script/script.h" +#include "script/interpreter.h" #include "scriptutils.h" #include "uint256.h" diff --git a/src/test/sighash_tests.cpp b/src/test/sighash_tests.cpp index 1421288eed..8abde887ce 100644 --- a/src/test/sighash_tests.cpp +++ b/src/test/sighash_tests.cpp @@ -7,7 +7,7 @@ #include "random.h" #include "serialize.h" #include "script/script.h" -#include "scriptutils.h" +#include "script/interpreter.h" #include "util.h" #include "version.h" From c4408a6c8534a36711557028a69314024cbc1bbe Mon Sep 17 00:00:00 2001 From: jtimon Date: Sat, 23 Aug 2014 03:35:51 +0200 Subject: [PATCH 0666/1288] Separate script/standard --- src/Makefile.am | 2 + src/bitcoin-tx.cpp | 2 + src/bloom.cpp | 3 +- src/core_write.cpp | 3 +- src/main.h | 3 +- src/rpcrawtransaction.cpp | 2 + src/script/standard.cpp | 254 ++++++++++++++++++++++++++++++++++++++ src/script/standard.h | 56 +++++++++ src/scriptutils.cpp | 241 ------------------------------------ src/scriptutils.h | 40 +----- src/wallet.h | 1 + 11 files changed, 324 insertions(+), 283 deletions(-) create mode 100644 src/script/standard.cpp create mode 100644 src/script/standard.h diff --git a/src/Makefile.am b/src/Makefile.am index a3fdd3ee6a..c3e2f7ed82 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -100,6 +100,7 @@ BITCOIN_CORE_H = \ rpcserver.h \ script/interpreter.h \ script/script.h \ + script/standard.h \ scriptutils.h \ serialize.h \ sync.h \ @@ -210,6 +211,7 @@ libbitcoin_common_a_SOURCES = \ protocol.cpp \ script/interpreter.cpp \ script/script.cpp \ + script/standard.cpp \ scriptutils.cpp \ $(BITCOIN_CORE_H) diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 5f547bba83..3f12304bb2 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -8,6 +8,8 @@ #include "core.h" #include "main.h" // for MAX_BLOCK_SIZE #include "keystore.h" +#include "script/script.h" +#include "scriptutils.h" #include "ui_interface.h" // for _(...) #include "univalue/univalue.h" #include "core_io.h" diff --git a/src/bloom.cpp b/src/bloom.cpp index 07990beb15..cef74a3a54 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -5,7 +5,8 @@ #include "bloom.h" #include "core.h" -#include "scriptutils.h" +#include "script/script.h" +#include "script/standard.h" #include #include diff --git a/src/core_write.cpp b/src/core_write.cpp index e816611809..62712b1ba0 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -4,7 +4,8 @@ #include "core_io.h" #include "univalue/univalue.h" -#include "scriptutils.h" +#include "script/script.h" +#include "script/standard.h" #include "core.h" #include "serialize.h" #include "util.h" diff --git a/src/main.h b/src/main.h index 1fc9b3ecf1..30cccab2f1 100644 --- a/src/main.h +++ b/src/main.h @@ -15,7 +15,8 @@ #include "core.h" #include "net.h" #include "pow.h" -#include "scriptutils.h" +#include "script/script.h" +#include "script/standard.h" #include "sync.h" #include "txmempool.h" #include "uint256.h" diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index a73641834d..901a16cd3c 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -11,6 +11,8 @@ #include "main.h" #include "net.h" #include "rpcserver.h" +#include "script/script.h" +#include "script/standard.h" #include "uint256.h" #ifdef ENABLE_WALLET #include "wallet.h" diff --git a/src/script/standard.cpp b/src/script/standard.cpp new file mode 100644 index 0000000000..684edff4d2 --- /dev/null +++ b/src/script/standard.cpp @@ -0,0 +1,254 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2013 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "script/standard.h" + +#include "script/script.h" +#include "util.h" + +#include + +using namespace std; + +typedef vector valtype; + +const char* GetTxnOutputType(txnouttype t) +{ + switch (t) + { + case TX_NONSTANDARD: return "nonstandard"; + case TX_PUBKEY: return "pubkey"; + case TX_PUBKEYHASH: return "pubkeyhash"; + case TX_SCRIPTHASH: return "scripthash"; + case TX_MULTISIG: return "multisig"; + case TX_NULL_DATA: return "nulldata"; + } + return NULL; +} + +// +// Return public keys or hashes from scriptPubKey, for 'standard' transaction types. +// +bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector >& vSolutionsRet) +{ + // Templates + static multimap mTemplates; + if (mTemplates.empty()) + { + // Standard tx, sender provides pubkey, receiver adds signature + mTemplates.insert(make_pair(TX_PUBKEY, CScript() << OP_PUBKEY << OP_CHECKSIG)); + + // Bitcoin address tx, sender provides hash of pubkey, receiver provides signature and pubkey + mTemplates.insert(make_pair(TX_PUBKEYHASH, CScript() << OP_DUP << OP_HASH160 << OP_PUBKEYHASH << OP_EQUALVERIFY << OP_CHECKSIG)); + + // Sender provides N pubkeys, receivers provides M signatures + mTemplates.insert(make_pair(TX_MULTISIG, CScript() << OP_SMALLINTEGER << OP_PUBKEYS << OP_SMALLINTEGER << OP_CHECKMULTISIG)); + + // Empty, provably prunable, data-carrying output + if (GetBoolArg("-datacarrier", true)) + mTemplates.insert(make_pair(TX_NULL_DATA, CScript() << OP_RETURN << OP_SMALLDATA)); + mTemplates.insert(make_pair(TX_NULL_DATA, CScript() << OP_RETURN)); + } + + // Shortcut for pay-to-script-hash, which are more constrained than the other types: + // it is always OP_HASH160 20 [20 byte hash] OP_EQUAL + if (scriptPubKey.IsPayToScriptHash()) + { + typeRet = TX_SCRIPTHASH; + vector hashBytes(scriptPubKey.begin()+2, scriptPubKey.begin()+22); + vSolutionsRet.push_back(hashBytes); + return true; + } + + // Scan templates + const CScript& script1 = scriptPubKey; + BOOST_FOREACH(const PAIRTYPE(txnouttype, CScript)& tplate, mTemplates) + { + const CScript& script2 = tplate.second; + vSolutionsRet.clear(); + + opcodetype opcode1, opcode2; + vector vch1, vch2; + + // Compare + CScript::const_iterator pc1 = script1.begin(); + CScript::const_iterator pc2 = script2.begin(); + while (true) + { + if (pc1 == script1.end() && pc2 == script2.end()) + { + // Found a match + typeRet = tplate.first; + if (typeRet == TX_MULTISIG) + { + // Additional checks for TX_MULTISIG: + unsigned char m = vSolutionsRet.front()[0]; + unsigned char n = vSolutionsRet.back()[0]; + if (m < 1 || n < 1 || m > n || vSolutionsRet.size()-2 != n) + return false; + } + return true; + } + if (!script1.GetOp(pc1, opcode1, vch1)) + break; + if (!script2.GetOp(pc2, opcode2, vch2)) + break; + + // Template matching opcodes: + if (opcode2 == OP_PUBKEYS) + { + while (vch1.size() >= 33 && vch1.size() <= 65) + { + vSolutionsRet.push_back(vch1); + if (!script1.GetOp(pc1, opcode1, vch1)) + break; + } + if (!script2.GetOp(pc2, opcode2, vch2)) + break; + // Normal situation is to fall through + // to other if/else statements + } + + if (opcode2 == OP_PUBKEY) + { + if (vch1.size() < 33 || vch1.size() > 65) + break; + vSolutionsRet.push_back(vch1); + } + else if (opcode2 == OP_PUBKEYHASH) + { + if (vch1.size() != sizeof(uint160)) + break; + vSolutionsRet.push_back(vch1); + } + else if (opcode2 == OP_SMALLINTEGER) + { // Single-byte small integer pushed onto vSolutions + if (opcode1 == OP_0 || + (opcode1 >= OP_1 && opcode1 <= OP_16)) + { + char n = (char)CScript::DecodeOP_N(opcode1); + vSolutionsRet.push_back(valtype(1, n)); + } + else + break; + } + else if (opcode2 == OP_SMALLDATA) + { + // small pushdata, <= MAX_OP_RETURN_RELAY bytes + if (vch1.size() > MAX_OP_RETURN_RELAY) + break; + } + else if (opcode1 != opcode2 || vch1 != vch2) + { + // Others must match exactly + break; + } + } + } + + vSolutionsRet.clear(); + typeRet = TX_NONSTANDARD; + return false; +} + +int ScriptSigArgsExpected(txnouttype t, const std::vector >& vSolutions) +{ + switch (t) + { + case TX_NONSTANDARD: + case TX_NULL_DATA: + return -1; + case TX_PUBKEY: + return 1; + case TX_PUBKEYHASH: + return 2; + case TX_MULTISIG: + if (vSolutions.size() < 1 || vSolutions[0].size() < 1) + return -1; + return vSolutions[0][0] + 1; + case TX_SCRIPTHASH: + return 1; // doesn't include args needed by the script + } + return -1; +} + +bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType) +{ + vector vSolutions; + if (!Solver(scriptPubKey, whichType, vSolutions)) + return false; + + if (whichType == TX_MULTISIG) + { + unsigned char m = vSolutions.front()[0]; + unsigned char n = vSolutions.back()[0]; + // Support up to x-of-3 multisig txns as standard + if (n < 1 || n > 3) + return false; + if (m < 1 || m > n) + return false; + } + + return whichType != TX_NONSTANDARD; +} + +bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet) +{ + vector vSolutions; + txnouttype whichType; + if (!Solver(scriptPubKey, whichType, vSolutions)) + return false; + + if (whichType == TX_PUBKEY) + { + addressRet = CPubKey(vSolutions[0]).GetID(); + return true; + } + else if (whichType == TX_PUBKEYHASH) + { + addressRet = CKeyID(uint160(vSolutions[0])); + return true; + } + else if (whichType == TX_SCRIPTHASH) + { + addressRet = CScriptID(uint160(vSolutions[0])); + return true; + } + // Multisig txns have more than one address... + return false; +} + +bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, vector& addressRet, int& nRequiredRet) +{ + addressRet.clear(); + typeRet = TX_NONSTANDARD; + vector vSolutions; + if (!Solver(scriptPubKey, typeRet, vSolutions)) + return false; + if (typeRet == TX_NULL_DATA){ + // This is data, not addresses + return false; + } + + if (typeRet == TX_MULTISIG) + { + nRequiredRet = vSolutions.front()[0]; + for (unsigned int i = 1; i < vSolutions.size()-1; i++) + { + CTxDestination address = CPubKey(vSolutions[i]).GetID(); + addressRet.push_back(address); + } + } + else + { + nRequiredRet = 1; + CTxDestination address; + if (!ExtractDestination(scriptPubKey, address)) + return false; + addressRet.push_back(address); + } + + return true; +} diff --git a/src/script/standard.h b/src/script/standard.h new file mode 100644 index 0000000000..18092e879e --- /dev/null +++ b/src/script/standard.h @@ -0,0 +1,56 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2013 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef H_BITCOIN_SCRIPT_STANDARD +#define H_BITCOIN_SCRIPT_STANDARD + +#include "script/script.h" +#include "script/interpreter.h" + +#include + +class CScript; + +static const unsigned int MAX_OP_RETURN_RELAY = 40; // bytes + +// Mandatory script verification flags that all new blocks must comply with for +// them to be valid. (but old blocks may not comply with) Currently just P2SH, +// but in the future other flags may be added, such as a soft-fork to enforce +// strict DER encoding. +// +// Failing one of these tests may trigger a DoS ban - see CheckInputs() for +// details. +static const unsigned int MANDATORY_SCRIPT_VERIFY_FLAGS = SCRIPT_VERIFY_P2SH; + +// Standard script verification flags that standard transactions will comply +// with. However scripts violating these flags may still be present in valid +// blocks and we must accept those blocks. +static const unsigned int STANDARD_SCRIPT_VERIFY_FLAGS = MANDATORY_SCRIPT_VERIFY_FLAGS | + SCRIPT_VERIFY_STRICTENC | + SCRIPT_VERIFY_NULLDUMMY; + +// For convenience, standard but not mandatory verify flags. +static const unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS = STANDARD_SCRIPT_VERIFY_FLAGS & ~MANDATORY_SCRIPT_VERIFY_FLAGS; + +enum txnouttype +{ + TX_NONSTANDARD, + // 'standard' transaction types: + TX_PUBKEY, + TX_PUBKEYHASH, + TX_SCRIPTHASH, + TX_MULTISIG, + TX_NULL_DATA, +}; + +const char* GetTxnOutputType(txnouttype t); + +bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector >& vSolutionsRet); +int ScriptSigArgsExpected(txnouttype t, const std::vector >& vSolutions); +bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType); +bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet); +bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::vector& addressRet, int& nRequiredRet); + +#endif diff --git a/src/scriptutils.cpp b/src/scriptutils.cpp index fb3766ab15..cede11d6a7 100644 --- a/src/scriptutils.cpp +++ b/src/scriptutils.cpp @@ -17,146 +17,6 @@ using namespace std; typedef vector valtype; -const char* GetTxnOutputType(txnouttype t) -{ - switch (t) - { - case TX_NONSTANDARD: return "nonstandard"; - case TX_PUBKEY: return "pubkey"; - case TX_PUBKEYHASH: return "pubkeyhash"; - case TX_SCRIPTHASH: return "scripthash"; - case TX_MULTISIG: return "multisig"; - case TX_NULL_DATA: return "nulldata"; - } - return NULL; -} - -// -// Return public keys or hashes from scriptPubKey, for 'standard' transaction types. -// -bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector >& vSolutionsRet) -{ - // Templates - static multimap mTemplates; - if (mTemplates.empty()) - { - // Standard tx, sender provides pubkey, receiver adds signature - mTemplates.insert(make_pair(TX_PUBKEY, CScript() << OP_PUBKEY << OP_CHECKSIG)); - - // Bitcoin address tx, sender provides hash of pubkey, receiver provides signature and pubkey - mTemplates.insert(make_pair(TX_PUBKEYHASH, CScript() << OP_DUP << OP_HASH160 << OP_PUBKEYHASH << OP_EQUALVERIFY << OP_CHECKSIG)); - - // Sender provides N pubkeys, receivers provides M signatures - mTemplates.insert(make_pair(TX_MULTISIG, CScript() << OP_SMALLINTEGER << OP_PUBKEYS << OP_SMALLINTEGER << OP_CHECKMULTISIG)); - - // Empty, provably prunable, data-carrying output - if (GetBoolArg("-datacarrier", true)) - mTemplates.insert(make_pair(TX_NULL_DATA, CScript() << OP_RETURN << OP_SMALLDATA)); - mTemplates.insert(make_pair(TX_NULL_DATA, CScript() << OP_RETURN)); - } - - // Shortcut for pay-to-script-hash, which are more constrained than the other types: - // it is always OP_HASH160 20 [20 byte hash] OP_EQUAL - if (scriptPubKey.IsPayToScriptHash()) - { - typeRet = TX_SCRIPTHASH; - vector hashBytes(scriptPubKey.begin()+2, scriptPubKey.begin()+22); - vSolutionsRet.push_back(hashBytes); - return true; - } - - // Scan templates - const CScript& script1 = scriptPubKey; - BOOST_FOREACH(const PAIRTYPE(txnouttype, CScript)& tplate, mTemplates) - { - const CScript& script2 = tplate.second; - vSolutionsRet.clear(); - - opcodetype opcode1, opcode2; - vector vch1, vch2; - - // Compare - CScript::const_iterator pc1 = script1.begin(); - CScript::const_iterator pc2 = script2.begin(); - while (true) - { - if (pc1 == script1.end() && pc2 == script2.end()) - { - // Found a match - typeRet = tplate.first; - if (typeRet == TX_MULTISIG) - { - // Additional checks for TX_MULTISIG: - unsigned char m = vSolutionsRet.front()[0]; - unsigned char n = vSolutionsRet.back()[0]; - if (m < 1 || n < 1 || m > n || vSolutionsRet.size()-2 != n) - return false; - } - return true; - } - if (!script1.GetOp(pc1, opcode1, vch1)) - break; - if (!script2.GetOp(pc2, opcode2, vch2)) - break; - - // Template matching opcodes: - if (opcode2 == OP_PUBKEYS) - { - while (vch1.size() >= 33 && vch1.size() <= 65) - { - vSolutionsRet.push_back(vch1); - if (!script1.GetOp(pc1, opcode1, vch1)) - break; - } - if (!script2.GetOp(pc2, opcode2, vch2)) - break; - // Normal situation is to fall through - // to other if/else statements - } - - if (opcode2 == OP_PUBKEY) - { - if (vch1.size() < 33 || vch1.size() > 65) - break; - vSolutionsRet.push_back(vch1); - } - else if (opcode2 == OP_PUBKEYHASH) - { - if (vch1.size() != sizeof(uint160)) - break; - vSolutionsRet.push_back(vch1); - } - else if (opcode2 == OP_SMALLINTEGER) - { // Single-byte small integer pushed onto vSolutions - if (opcode1 == OP_0 || - (opcode1 >= OP_1 && opcode1 <= OP_16)) - { - char n = (char)CScript::DecodeOP_N(opcode1); - vSolutionsRet.push_back(valtype(1, n)); - } - else - break; - } - else if (opcode2 == OP_SMALLDATA) - { - // small pushdata, <= MAX_OP_RETURN_RELAY bytes - if (vch1.size() > MAX_OP_RETURN_RELAY) - break; - } - else if (opcode1 != opcode2 || vch1 != vch2) - { - // Others must match exactly - break; - } - } - } - - vSolutionsRet.clear(); - typeRet = TX_NONSTANDARD; - return false; -} - - bool Sign1(const CKeyID& address, const CKeyStore& keystore, uint256 hash, int nHashType, CScript& scriptSigRet) { CKey key; @@ -231,48 +91,6 @@ bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash return false; } -int ScriptSigArgsExpected(txnouttype t, const std::vector >& vSolutions) -{ - switch (t) - { - case TX_NONSTANDARD: - case TX_NULL_DATA: - return -1; - case TX_PUBKEY: - return 1; - case TX_PUBKEYHASH: - return 2; - case TX_MULTISIG: - if (vSolutions.size() < 1 || vSolutions[0].size() < 1) - return -1; - return vSolutions[0][0] + 1; - case TX_SCRIPTHASH: - return 1; // doesn't include args needed by the script - } - return -1; -} - -bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType) -{ - vector vSolutions; - if (!Solver(scriptPubKey, whichType, vSolutions)) - return false; - - if (whichType == TX_MULTISIG) - { - unsigned char m = vSolutions.front()[0]; - unsigned char n = vSolutions.back()[0]; - // Support up to x-of-3 multisig txns as standard - if (n < 1 || n > 3) - return false; - if (m < 1 || m > n) - return false; - } - - return whichType != TX_NONSTANDARD; -} - - unsigned int HaveKeys(const vector& pubkeys, const CKeyStore& keystore) { unsigned int nResult = 0; @@ -348,65 +166,6 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey) return ISMINE_NO; } -bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet) -{ - vector vSolutions; - txnouttype whichType; - if (!Solver(scriptPubKey, whichType, vSolutions)) - return false; - - if (whichType == TX_PUBKEY) - { - addressRet = CPubKey(vSolutions[0]).GetID(); - return true; - } - else if (whichType == TX_PUBKEYHASH) - { - addressRet = CKeyID(uint160(vSolutions[0])); - return true; - } - else if (whichType == TX_SCRIPTHASH) - { - addressRet = CScriptID(uint160(vSolutions[0])); - return true; - } - // Multisig txns have more than one address... - return false; -} - -bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, vector& addressRet, int& nRequiredRet) -{ - addressRet.clear(); - typeRet = TX_NONSTANDARD; - vector vSolutions; - if (!Solver(scriptPubKey, typeRet, vSolutions)) - return false; - if (typeRet == TX_NULL_DATA){ - // This is data, not addresses - return false; - } - - if (typeRet == TX_MULTISIG) - { - nRequiredRet = vSolutions.front()[0]; - for (unsigned int i = 1; i < vSolutions.size()-1; i++) - { - CTxDestination address = CPubKey(vSolutions[i]).GetID(); - addressRet.push_back(address); - } - } - else - { - nRequiredRet = 1; - CTxDestination address; - if (!ExtractDestination(scriptPubKey, address)) - return false; - addressRet.push_back(address); - } - - return true; -} - class CAffectedKeysVisitor : public boost::static_visitor { private: const CKeyStore &keystore; diff --git a/src/scriptutils.h b/src/scriptutils.h index 1df95b1fa0..7ea2c9e6a5 100644 --- a/src/scriptutils.h +++ b/src/scriptutils.h @@ -9,6 +9,7 @@ #include "key.h" #include "script/script.h" #include "script/interpreter.h" +#include "script/standard.h" #include #include @@ -19,8 +20,6 @@ class CKeyStore; class CTransaction; struct CMutableTransaction; -static const unsigned int MAX_OP_RETURN_RELAY = 40; // bytes - /** IsMine() return codes */ enum isminetype { @@ -32,38 +31,6 @@ enum isminetype /** used for bitflags of isminetype */ typedef uint8_t isminefilter; -// Mandatory script verification flags that all new blocks must comply with for -// them to be valid. (but old blocks may not comply with) Currently just P2SH, -// but in the future other flags may be added, such as a soft-fork to enforce -// strict DER encoding. -// -// Failing one of these tests may trigger a DoS ban - see CheckInputs() for -// details. -static const unsigned int MANDATORY_SCRIPT_VERIFY_FLAGS = SCRIPT_VERIFY_P2SH; - -// Standard script verification flags that standard transactions will comply -// with. However scripts violating these flags may still be present in valid -// blocks and we must accept those blocks. -static const unsigned int STANDARD_SCRIPT_VERIFY_FLAGS = MANDATORY_SCRIPT_VERIFY_FLAGS | - SCRIPT_VERIFY_STRICTENC | - SCRIPT_VERIFY_NULLDUMMY; - -// For convenience, standard but not mandatory verify flags. -static const unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS = STANDARD_SCRIPT_VERIFY_FLAGS & ~MANDATORY_SCRIPT_VERIFY_FLAGS; - -enum txnouttype -{ - TX_NONSTANDARD, - // 'standard' transaction types: - TX_PUBKEY, - TX_PUBKEYHASH, - TX_SCRIPTHASH, - TX_MULTISIG, - TX_NULL_DATA, -}; - -const char* GetTxnOutputType(txnouttype t); - /** Compact serializer for scripts. * * It detects common cases and encodes them much more efficiently. @@ -137,14 +104,9 @@ public: } }; -bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector >& vSolutionsRet); -int ScriptSigArgsExpected(txnouttype t, const std::vector >& vSolutions); -bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType); isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey); isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest); void ExtractAffectedKeys(const CKeyStore &keystore, const CScript& scriptPubKey, std::vector &vKeys); -bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet); -bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::vector& addressRet, int& nRequiredRet); bool SignSignature(const CKeyStore& keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); diff --git a/src/wallet.h b/src/wallet.h index f8e1ebac12..6788986f88 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -11,6 +11,7 @@ #include "key.h" #include "keystore.h" #include "main.h" +#include "scriptutils.h" #include "ui_interface.h" #include "walletdb.h" From 9294a4bbe7ec067a45905b6e693414ad7d3b5669 Mon Sep 17 00:00:00 2001 From: jtimon Date: Wed, 20 Aug 2014 18:33:30 +0200 Subject: [PATCH 0667/1288] Separate CScriptCompressor --- src/Makefile.am | 2 + src/core.h | 3 +- src/script/compressor.cpp | 127 ++++++++++++++++++++++++++++++++++++++ src/script/compressor.h | 84 +++++++++++++++++++++++++ src/scriptutils.cpp | 121 ------------------------------------ src/scriptutils.h | 73 ---------------------- 6 files changed, 215 insertions(+), 195 deletions(-) create mode 100644 src/script/compressor.cpp create mode 100644 src/script/compressor.h diff --git a/src/Makefile.am b/src/Makefile.am index c3e2f7ed82..efa55f0dc2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -99,6 +99,7 @@ BITCOIN_CORE_H = \ rpcprotocol.h \ rpcserver.h \ script/interpreter.h \ + script/compressor.h \ script/script.h \ script/standard.h \ scriptutils.h \ @@ -210,6 +211,7 @@ libbitcoin_common_a_SOURCES = \ netbase.cpp \ protocol.cpp \ script/interpreter.cpp \ + script/compressor.cpp \ script/script.cpp \ script/standard.cpp \ scriptutils.cpp \ diff --git a/src/core.h b/src/core.h index 0df75670fd..030eb17734 100644 --- a/src/core.h +++ b/src/core.h @@ -6,7 +6,8 @@ #ifndef BITCOIN_CORE_H #define BITCOIN_CORE_H -#include "scriptutils.h" +#include "script/compressor.h" +#include "script/script.h" #include "serialize.h" #include "uint256.h" diff --git a/src/script/compressor.cpp b/src/script/compressor.cpp new file mode 100644 index 0000000000..2f8df602bf --- /dev/null +++ b/src/script/compressor.cpp @@ -0,0 +1,127 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2013 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "compressor.h" + +bool CScriptCompressor::IsToKeyID(CKeyID &hash) const +{ + if (script.size() == 25 && script[0] == OP_DUP && script[1] == OP_HASH160 + && script[2] == 20 && script[23] == OP_EQUALVERIFY + && script[24] == OP_CHECKSIG) { + memcpy(&hash, &script[3], 20); + return true; + } + return false; +} + +bool CScriptCompressor::IsToScriptID(CScriptID &hash) const +{ + if (script.size() == 23 && script[0] == OP_HASH160 && script[1] == 20 + && script[22] == OP_EQUAL) { + memcpy(&hash, &script[2], 20); + return true; + } + return false; +} + +bool CScriptCompressor::IsToPubKey(CPubKey &pubkey) const +{ + if (script.size() == 35 && script[0] == 33 && script[34] == OP_CHECKSIG + && (script[1] == 0x02 || script[1] == 0x03)) { + pubkey.Set(&script[1], &script[34]); + return true; + } + if (script.size() == 67 && script[0] == 65 && script[66] == OP_CHECKSIG + && script[1] == 0x04) { + pubkey.Set(&script[1], &script[66]); + return pubkey.IsFullyValid(); // if not fully valid, a case that would not be compressible + } + return false; +} + +bool CScriptCompressor::Compress(std::vector &out) const +{ + CKeyID keyID; + if (IsToKeyID(keyID)) { + out.resize(21); + out[0] = 0x00; + memcpy(&out[1], &keyID, 20); + return true; + } + CScriptID scriptID; + if (IsToScriptID(scriptID)) { + out.resize(21); + out[0] = 0x01; + memcpy(&out[1], &scriptID, 20); + return true; + } + CPubKey pubkey; + if (IsToPubKey(pubkey)) { + out.resize(33); + memcpy(&out[1], &pubkey[1], 32); + if (pubkey[0] == 0x02 || pubkey[0] == 0x03) { + out[0] = pubkey[0]; + return true; + } else if (pubkey[0] == 0x04) { + out[0] = 0x04 | (pubkey[64] & 0x01); + return true; + } + } + return false; +} + +unsigned int CScriptCompressor::GetSpecialSize(unsigned int nSize) const +{ + if (nSize == 0 || nSize == 1) + return 20; + if (nSize == 2 || nSize == 3 || nSize == 4 || nSize == 5) + return 32; + return 0; +} + +bool CScriptCompressor::Decompress(unsigned int nSize, const std::vector &in) +{ + switch(nSize) { + case 0x00: + script.resize(25); + script[0] = OP_DUP; + script[1] = OP_HASH160; + script[2] = 20; + memcpy(&script[3], &in[0], 20); + script[23] = OP_EQUALVERIFY; + script[24] = OP_CHECKSIG; + return true; + case 0x01: + script.resize(23); + script[0] = OP_HASH160; + script[1] = 20; + memcpy(&script[2], &in[0], 20); + script[22] = OP_EQUAL; + return true; + case 0x02: + case 0x03: + script.resize(35); + script[0] = 33; + script[1] = nSize; + memcpy(&script[2], &in[0], 32); + script[34] = OP_CHECKSIG; + return true; + case 0x04: + case 0x05: + unsigned char vch[33] = {}; + vch[0] = nSize - 2; + memcpy(&vch[1], &in[0], 32); + CPubKey pubkey(&vch[0], &vch[33]); + if (!pubkey.Decompress()) + return false; + assert(pubkey.size() == 65); + script.resize(67); + script[0] = 65; + memcpy(&script[1], pubkey.begin(), 65); + script[66] = OP_CHECKSIG; + return true; + } + return false; +} diff --git a/src/script/compressor.h b/src/script/compressor.h new file mode 100644 index 0000000000..f0a3754f02 --- /dev/null +++ b/src/script/compressor.h @@ -0,0 +1,84 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2013 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef H_BITCOIN_SCRIPT_COMPRESSOR +#define H_BITCOIN_SCRIPT_COMPRESSOR + +#include "script/script.h" + +/** Compact serializer for scripts. + * + * It detects common cases and encodes them much more efficiently. + * 3 special cases are defined: + * * Pay to pubkey hash (encoded as 21 bytes) + * * Pay to script hash (encoded as 21 bytes) + * * Pay to pubkey starting with 0x02, 0x03 or 0x04 (encoded as 33 bytes) + * + * Other scripts up to 121 bytes require 1 byte + script length. Above + * that, scripts up to 16505 bytes require 2 bytes + script length. + */ +class CScriptCompressor +{ +private: + // make this static for now (there are only 6 special scripts defined) + // this can potentially be extended together with a new nVersion for + // transactions, in which case this value becomes dependent on nVersion + // and nHeight of the enclosing transaction. + static const unsigned int nSpecialScripts = 6; + + CScript &script; +protected: + // These check for scripts for which a special case with a shorter encoding is defined. + // They are implemented separately from the CScript test, as these test for exact byte + // sequence correspondences, and are more strict. For example, IsToPubKey also verifies + // whether the public key is valid (as invalid ones cannot be represented in compressed + // form). + bool IsToKeyID(CKeyID &hash) const; + bool IsToScriptID(CScriptID &hash) const; + bool IsToPubKey(CPubKey &pubkey) const; + + bool Compress(std::vector &out) const; + unsigned int GetSpecialSize(unsigned int nSize) const; + bool Decompress(unsigned int nSize, const std::vector &out); +public: + CScriptCompressor(CScript &scriptIn) : script(scriptIn) { } + + unsigned int GetSerializeSize(int nType, int nVersion) const { + std::vector compr; + if (Compress(compr)) + return compr.size(); + unsigned int nSize = script.size() + nSpecialScripts; + return script.size() + VARINT(nSize).GetSerializeSize(nType, nVersion); + } + + template + void Serialize(Stream &s, int nType, int nVersion) const { + std::vector compr; + if (Compress(compr)) { + s << CFlatData(compr); + return; + } + unsigned int nSize = script.size() + nSpecialScripts; + s << VARINT(nSize); + s << CFlatData(script); + } + + template + void Unserialize(Stream &s, int nType, int nVersion) { + unsigned int nSize = 0; + s >> VARINT(nSize); + if (nSize < nSpecialScripts) { + std::vector vch(GetSpecialSize(nSize), 0x00); + s >> REF(CFlatData(vch)); + Decompress(nSize, vch); + return; + } + nSize -= nSpecialScripts; + script.resize(nSize); + s >> REF(CFlatData(script)); + } +}; + +#endif diff --git a/src/scriptutils.cpp b/src/scriptutils.cpp index cede11d6a7..cc38706d34 100644 --- a/src/scriptutils.cpp +++ b/src/scriptutils.cpp @@ -369,124 +369,3 @@ CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsign return CombineSignatures(scriptPubKey, txTo, nIn, txType, vSolutions, stack1, stack2); } - -bool CScriptCompressor::IsToKeyID(CKeyID &hash) const -{ - if (script.size() == 25 && script[0] == OP_DUP && script[1] == OP_HASH160 - && script[2] == 20 && script[23] == OP_EQUALVERIFY - && script[24] == OP_CHECKSIG) { - memcpy(&hash, &script[3], 20); - return true; - } - return false; -} - -bool CScriptCompressor::IsToScriptID(CScriptID &hash) const -{ - if (script.size() == 23 && script[0] == OP_HASH160 && script[1] == 20 - && script[22] == OP_EQUAL) { - memcpy(&hash, &script[2], 20); - return true; - } - return false; -} - -bool CScriptCompressor::IsToPubKey(CPubKey &pubkey) const -{ - if (script.size() == 35 && script[0] == 33 && script[34] == OP_CHECKSIG - && (script[1] == 0x02 || script[1] == 0x03)) { - pubkey.Set(&script[1], &script[34]); - return true; - } - if (script.size() == 67 && script[0] == 65 && script[66] == OP_CHECKSIG - && script[1] == 0x04) { - pubkey.Set(&script[1], &script[66]); - return pubkey.IsFullyValid(); // if not fully valid, a case that would not be compressible - } - return false; -} - -bool CScriptCompressor::Compress(std::vector &out) const -{ - CKeyID keyID; - if (IsToKeyID(keyID)) { - out.resize(21); - out[0] = 0x00; - memcpy(&out[1], &keyID, 20); - return true; - } - CScriptID scriptID; - if (IsToScriptID(scriptID)) { - out.resize(21); - out[0] = 0x01; - memcpy(&out[1], &scriptID, 20); - return true; - } - CPubKey pubkey; - if (IsToPubKey(pubkey)) { - out.resize(33); - memcpy(&out[1], &pubkey[1], 32); - if (pubkey[0] == 0x02 || pubkey[0] == 0x03) { - out[0] = pubkey[0]; - return true; - } else if (pubkey[0] == 0x04) { - out[0] = 0x04 | (pubkey[64] & 0x01); - return true; - } - } - return false; -} - -unsigned int CScriptCompressor::GetSpecialSize(unsigned int nSize) const -{ - if (nSize == 0 || nSize == 1) - return 20; - if (nSize == 2 || nSize == 3 || nSize == 4 || nSize == 5) - return 32; - return 0; -} - -bool CScriptCompressor::Decompress(unsigned int nSize, const std::vector &in) -{ - switch(nSize) { - case 0x00: - script.resize(25); - script[0] = OP_DUP; - script[1] = OP_HASH160; - script[2] = 20; - memcpy(&script[3], &in[0], 20); - script[23] = OP_EQUALVERIFY; - script[24] = OP_CHECKSIG; - return true; - case 0x01: - script.resize(23); - script[0] = OP_HASH160; - script[1] = 20; - memcpy(&script[2], &in[0], 20); - script[22] = OP_EQUAL; - return true; - case 0x02: - case 0x03: - script.resize(35); - script[0] = 33; - script[1] = nSize; - memcpy(&script[2], &in[0], 32); - script[34] = OP_CHECKSIG; - return true; - case 0x04: - case 0x05: - unsigned char vch[33] = {}; - vch[0] = nSize - 2; - memcpy(&vch[1], &in[0], 32); - CPubKey pubkey(&vch[0], &vch[33]); - if (!pubkey.Decompress()) - return false; - assert(pubkey.size() == 65); - script.resize(67); - script[0] = 65; - memcpy(&script[1], pubkey.begin(), 65); - script[66] = OP_CHECKSIG; - return true; - } - return false; -} diff --git a/src/scriptutils.h b/src/scriptutils.h index 7ea2c9e6a5..1c7408124e 100644 --- a/src/scriptutils.h +++ b/src/scriptutils.h @@ -31,79 +31,6 @@ enum isminetype /** used for bitflags of isminetype */ typedef uint8_t isminefilter; -/** Compact serializer for scripts. - * - * It detects common cases and encodes them much more efficiently. - * 3 special cases are defined: - * * Pay to pubkey hash (encoded as 21 bytes) - * * Pay to script hash (encoded as 21 bytes) - * * Pay to pubkey starting with 0x02, 0x03 or 0x04 (encoded as 33 bytes) - * - * Other scripts up to 121 bytes require 1 byte + script length. Above - * that, scripts up to 16505 bytes require 2 bytes + script length. - */ -class CScriptCompressor -{ -private: - // make this static for now (there are only 6 special scripts defined) - // this can potentially be extended together with a new nVersion for - // transactions, in which case this value becomes dependent on nVersion - // and nHeight of the enclosing transaction. - static const unsigned int nSpecialScripts = 6; - - CScript &script; -protected: - // These check for scripts for which a special case with a shorter encoding is defined. - // They are implemented separately from the CScript test, as these test for exact byte - // sequence correspondences, and are more strict. For example, IsToPubKey also verifies - // whether the public key is valid (as invalid ones cannot be represented in compressed - // form). - bool IsToKeyID(CKeyID &hash) const; - bool IsToScriptID(CScriptID &hash) const; - bool IsToPubKey(CPubKey &pubkey) const; - - bool Compress(std::vector &out) const; - unsigned int GetSpecialSize(unsigned int nSize) const; - bool Decompress(unsigned int nSize, const std::vector &out); -public: - CScriptCompressor(CScript &scriptIn) : script(scriptIn) { } - - unsigned int GetSerializeSize(int nType, int nVersion) const { - std::vector compr; - if (Compress(compr)) - return compr.size(); - unsigned int nSize = script.size() + nSpecialScripts; - return script.size() + VARINT(nSize).GetSerializeSize(nType, nVersion); - } - - template - void Serialize(Stream &s, int nType, int nVersion) const { - std::vector compr; - if (Compress(compr)) { - s << CFlatData(compr); - return; - } - unsigned int nSize = script.size() + nSpecialScripts; - s << VARINT(nSize); - s << CFlatData(script); - } - - template - void Unserialize(Stream &s, int nType, int nVersion) { - unsigned int nSize = 0; - s >> VARINT(nSize); - if (nSize < nSpecialScripts) { - std::vector vch(GetSpecialSize(nSize), 0x00); - s >> REF(CFlatData(vch)); - Decompress(nSize, vch); - return; - } - nSize -= nSpecialScripts; - script.resize(nSize); - s >> REF(CFlatData(script)); - } -}; - isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey); isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest); void ExtractAffectedKeys(const CKeyStore &keystore, const CScript& scriptPubKey, std::vector &vKeys); From e088d65acbb181220b64a45a2a62bb79c0e40304 Mon Sep 17 00:00:00 2001 From: jtimon Date: Wed, 27 Aug 2014 17:22:33 +0200 Subject: [PATCH 0668/1288] Separate script/sign --- src/Makefile.am | 2 + src/bitcoin-tx.cpp | 2 +- src/rpcrawtransaction.cpp | 1 + src/script/sign.cpp | 260 +++++++++++++++++++++++++++++++++ src/script/sign.h | 23 +++ src/scriptutils.cpp | 246 +------------------------------ src/scriptutils.h | 15 -- src/test/DoS_tests.cpp | 2 +- src/test/multisig_tests.cpp | 1 + src/test/script_P2SH_tests.cpp | 1 + src/test/script_tests.cpp | 2 +- src/wallet.cpp | 2 + 12 files changed, 294 insertions(+), 263 deletions(-) create mode 100644 src/script/sign.cpp create mode 100644 src/script/sign.h diff --git a/src/Makefile.am b/src/Makefile.am index efa55f0dc2..9b7e99861d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -101,6 +101,7 @@ BITCOIN_CORE_H = \ script/interpreter.h \ script/compressor.h \ script/script.h \ + script/sign.h \ script/standard.h \ scriptutils.h \ serialize.h \ @@ -213,6 +214,7 @@ libbitcoin_common_a_SOURCES = \ script/interpreter.cpp \ script/compressor.cpp \ script/script.cpp \ + script/sign.cpp \ script/standard.cpp \ scriptutils.cpp \ $(BITCOIN_CORE_H) diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 3f12304bb2..c455351411 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -9,7 +9,7 @@ #include "main.h" // for MAX_BLOCK_SIZE #include "keystore.h" #include "script/script.h" -#include "scriptutils.h" +#include "script/sign.h" #include "ui_interface.h" // for _(...) #include "univalue/univalue.h" #include "core_io.h" diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 901a16cd3c..b5551524be 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -13,6 +13,7 @@ #include "rpcserver.h" #include "script/script.h" #include "script/standard.h" +#include "script/sign.h" #include "uint256.h" #ifdef ENABLE_WALLET #include "wallet.h" diff --git a/src/script/sign.cpp b/src/script/sign.cpp new file mode 100644 index 0000000000..958177de3d --- /dev/null +++ b/src/script/sign.cpp @@ -0,0 +1,260 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2013 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "script/sign.h" + +#include "core.h" +#include "key.h" +#include "keystore.h" +#include "script/standard.h" +#include "uint256.h" + +#include + +using namespace std; + +typedef vector valtype; + +bool Sign1(const CKeyID& address, const CKeyStore& keystore, uint256 hash, int nHashType, CScript& scriptSigRet) +{ + CKey key; + if (!keystore.GetKey(address, key)) + return false; + + vector vchSig; + if (!key.Sign(hash, vchSig)) + return false; + vchSig.push_back((unsigned char)nHashType); + scriptSigRet << vchSig; + + return true; +} + +bool SignN(const vector& multisigdata, const CKeyStore& keystore, uint256 hash, int nHashType, CScript& scriptSigRet) +{ + int nSigned = 0; + int nRequired = multisigdata.front()[0]; + for (unsigned int i = 1; i < multisigdata.size()-1 && nSigned < nRequired; i++) + { + const valtype& pubkey = multisigdata[i]; + CKeyID keyID = CPubKey(pubkey).GetID(); + if (Sign1(keyID, keystore, hash, nHashType, scriptSigRet)) + ++nSigned; + } + return nSigned==nRequired; +} + +// +// Sign scriptPubKey with private keys stored in keystore, given transaction hash and hash type. +// Signatures are returned in scriptSigRet (or returns false if scriptPubKey can't be signed), +// unless whichTypeRet is TX_SCRIPTHASH, in which case scriptSigRet is the redemption script. +// Returns false if scriptPubKey could not be completely satisfied. +// +bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash, int nHashType, + CScript& scriptSigRet, txnouttype& whichTypeRet) +{ + scriptSigRet.clear(); + + vector vSolutions; + if (!Solver(scriptPubKey, whichTypeRet, vSolutions)) + return false; + + CKeyID keyID; + switch (whichTypeRet) + { + case TX_NONSTANDARD: + case TX_NULL_DATA: + return false; + case TX_PUBKEY: + keyID = CPubKey(vSolutions[0]).GetID(); + return Sign1(keyID, keystore, hash, nHashType, scriptSigRet); + case TX_PUBKEYHASH: + keyID = CKeyID(uint160(vSolutions[0])); + if (!Sign1(keyID, keystore, hash, nHashType, scriptSigRet)) + return false; + else + { + CPubKey vch; + keystore.GetPubKey(keyID, vch); + scriptSigRet << vch; + } + return true; + case TX_SCRIPTHASH: + return keystore.GetCScript(uint160(vSolutions[0]), scriptSigRet); + + case TX_MULTISIG: + scriptSigRet << OP_0; // workaround CHECKMULTISIG bug + return (SignN(vSolutions, keystore, hash, nHashType, scriptSigRet)); + } + return false; +} + +bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, int nHashType) +{ + assert(nIn < txTo.vin.size()); + CTxIn& txin = txTo.vin[nIn]; + + // Leave out the signature from the hash, since a signature can't sign itself. + // The checksig op will also drop the signatures from its hash. + uint256 hash = SignatureHash(fromPubKey, txTo, nIn, nHashType); + + txnouttype whichType; + if (!Solver(keystore, fromPubKey, hash, nHashType, txin.scriptSig, whichType)) + return false; + + if (whichType == TX_SCRIPTHASH) + { + // Solver returns the subscript that need to be evaluated; + // the final scriptSig is the signatures from that + // and then the serialized subscript: + CScript subscript = txin.scriptSig; + + // Recompute txn hash using subscript in place of scriptPubKey: + uint256 hash2 = SignatureHash(subscript, txTo, nIn, nHashType); + + txnouttype subType; + bool fSolved = + Solver(keystore, subscript, hash2, nHashType, txin.scriptSig, subType) && subType != TX_SCRIPTHASH; + // Append serialized subscript whether or not it is completely signed: + txin.scriptSig << static_cast(subscript); + if (!fSolved) return false; + } + + // Test solution + return VerifyScript(txin.scriptSig, fromPubKey, txTo, nIn, STANDARD_SCRIPT_VERIFY_FLAGS, 0); +} + +bool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType) +{ + assert(nIn < txTo.vin.size()); + CTxIn& txin = txTo.vin[nIn]; + assert(txin.prevout.n < txFrom.vout.size()); + const CTxOut& txout = txFrom.vout[txin.prevout.n]; + + return SignSignature(keystore, txout.scriptPubKey, txTo, nIn, nHashType); +} + +static CScript PushAll(const vector& values) +{ + CScript result; + BOOST_FOREACH(const valtype& v, values) + result << v; + return result; +} + +static CScript CombineMultisig(CScript scriptPubKey, const CMutableTransaction& txTo, unsigned int nIn, + const vector& vSolutions, + vector& sigs1, vector& sigs2) +{ + // Combine all the signatures we've got: + set allsigs; + BOOST_FOREACH(const valtype& v, sigs1) + { + if (!v.empty()) + allsigs.insert(v); + } + BOOST_FOREACH(const valtype& v, sigs2) + { + if (!v.empty()) + allsigs.insert(v); + } + + // Build a map of pubkey -> signature by matching sigs to pubkeys: + assert(vSolutions.size() > 1); + unsigned int nSigsRequired = vSolutions.front()[0]; + unsigned int nPubKeys = vSolutions.size()-2; + map sigs; + BOOST_FOREACH(const valtype& sig, allsigs) + { + for (unsigned int i = 0; i < nPubKeys; i++) + { + const valtype& pubkey = vSolutions[i+1]; + if (sigs.count(pubkey)) + continue; // Already got a sig for this pubkey + + if (CheckSig(sig, pubkey, scriptPubKey, txTo, nIn, 0, 0)) + { + sigs[pubkey] = sig; + break; + } + } + } + // Now build a merged CScript: + unsigned int nSigsHave = 0; + CScript result; result << OP_0; // pop-one-too-many workaround + for (unsigned int i = 0; i < nPubKeys && nSigsHave < nSigsRequired; i++) + { + if (sigs.count(vSolutions[i+1])) + { + result << sigs[vSolutions[i+1]]; + ++nSigsHave; + } + } + // Fill any missing with OP_0: + for (unsigned int i = nSigsHave; i < nSigsRequired; i++) + result << OP_0; + + return result; +} + +static CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, + const txnouttype txType, const vector& vSolutions, + vector& sigs1, vector& sigs2) +{ + switch (txType) + { + case TX_NONSTANDARD: + case TX_NULL_DATA: + // Don't know anything about this, assume bigger one is correct: + if (sigs1.size() >= sigs2.size()) + return PushAll(sigs1); + return PushAll(sigs2); + case TX_PUBKEY: + case TX_PUBKEYHASH: + // Signatures are bigger than placeholders or empty scripts: + if (sigs1.empty() || sigs1[0].empty()) + return PushAll(sigs2); + return PushAll(sigs1); + case TX_SCRIPTHASH: + if (sigs1.empty() || sigs1.back().empty()) + return PushAll(sigs2); + else if (sigs2.empty() || sigs2.back().empty()) + return PushAll(sigs1); + else + { + // Recur to combine: + valtype spk = sigs1.back(); + CScript pubKey2(spk.begin(), spk.end()); + + txnouttype txType2; + vector > vSolutions2; + Solver(pubKey2, txType2, vSolutions2); + sigs1.pop_back(); + sigs2.pop_back(); + CScript result = CombineSignatures(pubKey2, txTo, nIn, txType2, vSolutions2, sigs1, sigs2); + result << spk; + return result; + } + case TX_MULTISIG: + return CombineMultisig(scriptPubKey, txTo, nIn, vSolutions, sigs1, sigs2); + } + + return CScript(); +} + +CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, + const CScript& scriptSig1, const CScript& scriptSig2) +{ + txnouttype txType; + vector > vSolutions; + Solver(scriptPubKey, txType, vSolutions); + + vector stack1; + EvalScript(stack1, scriptSig1, CTransaction(), 0, SCRIPT_VERIFY_STRICTENC, 0); + vector stack2; + EvalScript(stack2, scriptSig2, CTransaction(), 0, SCRIPT_VERIFY_STRICTENC, 0); + + return CombineSignatures(scriptPubKey, txTo, nIn, txType, vSolutions, stack1, stack2); +} diff --git a/src/script/sign.h b/src/script/sign.h new file mode 100644 index 0000000000..51723b53af --- /dev/null +++ b/src/script/sign.h @@ -0,0 +1,23 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2013 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef H_BITCOIN_SCRIPT_SIGN +#define H_BITCOIN_SCRIPT_SIGN + +#include "script/interpreter.h" + +class CKeyStore; +class CScript; +class CTransaction; +struct CMutableTransaction; + +bool SignSignature(const CKeyStore& keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); +bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); + +// Given two sets of signatures for scriptPubKey, possibly with OP_0 placeholders, +// combine them intelligently and return the result. +CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2); + +#endif diff --git a/src/scriptutils.cpp b/src/scriptutils.cpp index cc38706d34..a636eeedab 100644 --- a/src/scriptutils.cpp +++ b/src/scriptutils.cpp @@ -5,11 +5,9 @@ #include "scriptutils.h" -#include "core.h" #include "key.h" #include "keystore.h" -#include "uint256.h" -#include "util.h" +#include "script/standard.h" #include @@ -17,80 +15,6 @@ using namespace std; typedef vector valtype; -bool Sign1(const CKeyID& address, const CKeyStore& keystore, uint256 hash, int nHashType, CScript& scriptSigRet) -{ - CKey key; - if (!keystore.GetKey(address, key)) - return false; - - vector vchSig; - if (!key.Sign(hash, vchSig)) - return false; - vchSig.push_back((unsigned char)nHashType); - scriptSigRet << vchSig; - - return true; -} - -bool SignN(const vector& multisigdata, const CKeyStore& keystore, uint256 hash, int nHashType, CScript& scriptSigRet) -{ - int nSigned = 0; - int nRequired = multisigdata.front()[0]; - for (unsigned int i = 1; i < multisigdata.size()-1 && nSigned < nRequired; i++) - { - const valtype& pubkey = multisigdata[i]; - CKeyID keyID = CPubKey(pubkey).GetID(); - if (Sign1(keyID, keystore, hash, nHashType, scriptSigRet)) - ++nSigned; - } - return nSigned==nRequired; -} - -// -// Sign scriptPubKey with private keys stored in keystore, given transaction hash and hash type. -// Signatures are returned in scriptSigRet (or returns false if scriptPubKey can't be signed), -// unless whichTypeRet is TX_SCRIPTHASH, in which case scriptSigRet is the redemption script. -// Returns false if scriptPubKey could not be completely satisfied. -// -bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash, int nHashType, - CScript& scriptSigRet, txnouttype& whichTypeRet) -{ - scriptSigRet.clear(); - - vector vSolutions; - if (!Solver(scriptPubKey, whichTypeRet, vSolutions)) - return false; - - CKeyID keyID; - switch (whichTypeRet) - { - case TX_NONSTANDARD: - case TX_NULL_DATA: - return false; - case TX_PUBKEY: - keyID = CPubKey(vSolutions[0]).GetID(); - return Sign1(keyID, keystore, hash, nHashType, scriptSigRet); - case TX_PUBKEYHASH: - keyID = CKeyID(uint160(vSolutions[0])); - if (!Sign1(keyID, keystore, hash, nHashType, scriptSigRet)) - return false; - else - { - CPubKey vch; - keystore.GetPubKey(keyID, vch); - scriptSigRet << vch; - } - return true; - case TX_SCRIPTHASH: - return keystore.GetCScript(uint160(vSolutions[0]), scriptSigRet); - - case TX_MULTISIG: - scriptSigRet << OP_0; // workaround CHECKMULTISIG bug - return (SignN(vSolutions, keystore, hash, nHashType, scriptSigRet)); - } - return false; -} - unsigned int HaveKeys(const vector& pubkeys, const CKeyStore& keystore) { unsigned int nResult = 0; @@ -201,171 +125,3 @@ public: void ExtractAffectedKeys(const CKeyStore &keystore, const CScript& scriptPubKey, std::vector &vKeys) { CAffectedKeysVisitor(keystore, vKeys).Process(scriptPubKey); } - -bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, int nHashType) -{ - assert(nIn < txTo.vin.size()); - CTxIn& txin = txTo.vin[nIn]; - - // Leave out the signature from the hash, since a signature can't sign itself. - // The checksig op will also drop the signatures from its hash. - uint256 hash = SignatureHash(fromPubKey, txTo, nIn, nHashType); - - txnouttype whichType; - if (!Solver(keystore, fromPubKey, hash, nHashType, txin.scriptSig, whichType)) - return false; - - if (whichType == TX_SCRIPTHASH) - { - // Solver returns the subscript that need to be evaluated; - // the final scriptSig is the signatures from that - // and then the serialized subscript: - CScript subscript = txin.scriptSig; - - // Recompute txn hash using subscript in place of scriptPubKey: - uint256 hash2 = SignatureHash(subscript, txTo, nIn, nHashType); - - txnouttype subType; - bool fSolved = - Solver(keystore, subscript, hash2, nHashType, txin.scriptSig, subType) && subType != TX_SCRIPTHASH; - // Append serialized subscript whether or not it is completely signed: - txin.scriptSig << static_cast(subscript); - if (!fSolved) return false; - } - - // Test solution - return VerifyScript(txin.scriptSig, fromPubKey, txTo, nIn, STANDARD_SCRIPT_VERIFY_FLAGS, 0); -} - -bool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType) -{ - assert(nIn < txTo.vin.size()); - CTxIn& txin = txTo.vin[nIn]; - assert(txin.prevout.n < txFrom.vout.size()); - const CTxOut& txout = txFrom.vout[txin.prevout.n]; - - return SignSignature(keystore, txout.scriptPubKey, txTo, nIn, nHashType); -} - -static CScript PushAll(const vector& values) -{ - CScript result; - BOOST_FOREACH(const valtype& v, values) - result << v; - return result; -} - -static CScript CombineMultisig(CScript scriptPubKey, const CMutableTransaction& txTo, unsigned int nIn, - const vector& vSolutions, - vector& sigs1, vector& sigs2) -{ - // Combine all the signatures we've got: - set allsigs; - BOOST_FOREACH(const valtype& v, sigs1) - { - if (!v.empty()) - allsigs.insert(v); - } - BOOST_FOREACH(const valtype& v, sigs2) - { - if (!v.empty()) - allsigs.insert(v); - } - - // Build a map of pubkey -> signature by matching sigs to pubkeys: - assert(vSolutions.size() > 1); - unsigned int nSigsRequired = vSolutions.front()[0]; - unsigned int nPubKeys = vSolutions.size()-2; - map sigs; - BOOST_FOREACH(const valtype& sig, allsigs) - { - for (unsigned int i = 0; i < nPubKeys; i++) - { - const valtype& pubkey = vSolutions[i+1]; - if (sigs.count(pubkey)) - continue; // Already got a sig for this pubkey - - if (CheckSig(sig, pubkey, scriptPubKey, txTo, nIn, 0, 0)) - { - sigs[pubkey] = sig; - break; - } - } - } - // Now build a merged CScript: - unsigned int nSigsHave = 0; - CScript result; result << OP_0; // pop-one-too-many workaround - for (unsigned int i = 0; i < nPubKeys && nSigsHave < nSigsRequired; i++) - { - if (sigs.count(vSolutions[i+1])) - { - result << sigs[vSolutions[i+1]]; - ++nSigsHave; - } - } - // Fill any missing with OP_0: - for (unsigned int i = nSigsHave; i < nSigsRequired; i++) - result << OP_0; - - return result; -} - -static CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, - const txnouttype txType, const vector& vSolutions, - vector& sigs1, vector& sigs2) -{ - switch (txType) - { - case TX_NONSTANDARD: - case TX_NULL_DATA: - // Don't know anything about this, assume bigger one is correct: - if (sigs1.size() >= sigs2.size()) - return PushAll(sigs1); - return PushAll(sigs2); - case TX_PUBKEY: - case TX_PUBKEYHASH: - // Signatures are bigger than placeholders or empty scripts: - if (sigs1.empty() || sigs1[0].empty()) - return PushAll(sigs2); - return PushAll(sigs1); - case TX_SCRIPTHASH: - if (sigs1.empty() || sigs1.back().empty()) - return PushAll(sigs2); - else if (sigs2.empty() || sigs2.back().empty()) - return PushAll(sigs1); - else - { - // Recur to combine: - valtype spk = sigs1.back(); - CScript pubKey2(spk.begin(), spk.end()); - - txnouttype txType2; - vector > vSolutions2; - Solver(pubKey2, txType2, vSolutions2); - sigs1.pop_back(); - sigs2.pop_back(); - CScript result = CombineSignatures(pubKey2, txTo, nIn, txType2, vSolutions2, sigs1, sigs2); - result << spk; - return result; - } - case TX_MULTISIG: - return CombineMultisig(scriptPubKey, txTo, nIn, vSolutions, sigs1, sigs2); - } - - return CScript(); -} - -CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, - const CScript& scriptSig1, const CScript& scriptSig2) -{ - txnouttype txType; - vector > vSolutions; - Solver(scriptPubKey, txType, vSolutions); - - vector stack1; - EvalScript(stack1, scriptSig1, CTransaction(), 0, SCRIPT_VERIFY_STRICTENC, 0); - vector stack2; - EvalScript(stack2, scriptSig2, CTransaction(), 0, SCRIPT_VERIFY_STRICTENC, 0); - - return CombineSignatures(scriptPubKey, txTo, nIn, txType, vSolutions, stack1, stack2); -} diff --git a/src/scriptutils.h b/src/scriptutils.h index 1c7408124e..98080fc456 100644 --- a/src/scriptutils.h +++ b/src/scriptutils.h @@ -8,17 +8,8 @@ #include "key.h" #include "script/script.h" -#include "script/interpreter.h" -#include "script/standard.h" - -#include -#include -#include -#include class CKeyStore; -class CTransaction; -struct CMutableTransaction; /** IsMine() return codes */ enum isminetype @@ -34,11 +25,5 @@ typedef uint8_t isminefilter; isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey); isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest); void ExtractAffectedKeys(const CKeyStore &keystore, const CScript& scriptPubKey, std::vector &vKeys); -bool SignSignature(const CKeyStore& keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); -bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); - -// Given two sets of signatures for scriptPubKey, possibly with OP_0 placeholders, -// combine them intelligently and return the result. -CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2); #endif // H_BITCOIN_SCRIPT diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index a113425891..fa4edff63f 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -12,7 +12,7 @@ #include "main.h" #include "net.h" #include "pow.h" -#include "scriptutils.h" +#include "script/sign.h" #include "serialize.h" #include "util.h" diff --git a/src/test/multisig_tests.cpp b/src/test/multisig_tests.cpp index e28682522b..6c5afa130c 100644 --- a/src/test/multisig_tests.cpp +++ b/src/test/multisig_tests.cpp @@ -7,6 +7,7 @@ #include "main.h" #include "script/script.h" #include "script/interpreter.h" +#include "script/sign.h" #include "scriptutils.h" #include "uint256.h" diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index 9136d62292..b7e7487bb2 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -6,6 +6,7 @@ #include "keystore.h" #include "main.h" #include "script/script.h" +#include "script/sign.h" #include "scriptutils.h" #include diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index ff56bdf13b..88efc38964 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -9,7 +9,7 @@ #include "keystore.h" #include "main.h" #include "script/script.h" -#include "scriptutils.h" +#include "script/sign.h" #include "core_io.h" #include diff --git a/src/wallet.cpp b/src/wallet.cpp index d3ad4869bb..b69ed223b4 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -9,6 +9,8 @@ #include "checkpoints.h" #include "coincontrol.h" #include "net.h" +#include "script/script.h" +#include "script/sign.h" #include "timedata.h" #include "util.h" #include "utilmoneystr.h" From 21f139b4a622f07679f1d1c30ad32e2b40a2617e Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 5 Sep 2014 22:55:54 -0400 Subject: [PATCH 0669/1288] qt: fix tablet crash. closes #4854. This backports the relevant parts of: https://codereview.qt-project.org/#/c/82689/ --- depends/packages/qt.mk | 5 +++-- depends/patches/qt/qt5-tablet-osx.patch | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 depends/patches/qt/qt5-tablet-osx.patch diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index cce7d6e6ef..e719e2e506 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -7,7 +7,7 @@ $(package)_dependencies=openssl $(package)_linux_dependencies=freetype fontconfig dbus libxcb libX11 xproto libXext $(package)_build_subdir=qtbase $(package)_qt_libs=corelib network widgets gui plugins testlib -$(package)_patches=mac-qmake.conf fix-xcb-include-order.patch +$(package)_patches=mac-qmake.conf fix-xcb-include-order.patch qt5-tablet-osx.patch define $(package)_set_vars $(package)_config_opts = -release -opensource -confirm-license @@ -52,7 +52,8 @@ define $(package)_preprocess_cmds cp -f qtbase/mkspecs/macx-clang/Info.plist.app qtbase/mkspecs/macx-clang-linux/ &&\ cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\ cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \ - patch -p1 < $($(package)_patch_dir)/fix-xcb-include-order.patch + patch -p1 < $($(package)_patch_dir)/fix-xcb-include-order.patch && \ + patch -p1 < $($(package)_patch_dir)/qt5-tablet-osx.patch endef define $(package)_config_cmds diff --git a/depends/patches/qt/qt5-tablet-osx.patch b/depends/patches/qt/qt5-tablet-osx.patch new file mode 100644 index 0000000000..7deabf8d4e --- /dev/null +++ b/depends/patches/qt/qt5-tablet-osx.patch @@ -0,0 +1,20 @@ +--- old/qtbase/src/widgets/kernel/qwidgetwindow.cpp 2014-09-05 20:45:18.717570370 -0400 ++++ new/qtbase/src/widgets/kernel/qwidgetwindow.cpp 2014-09-05 20:52:38.653576561 -0400 +@@ -57,7 +57,7 @@ + Q_WIDGETS_EXPORT extern bool qt_tab_all_widgets(); + + QWidget *qt_button_down = 0; // widget got last button-down +-static QWidget *qt_tablet_target = 0; ++static QPointer qt_tablet_target = 0; + + // popup control + QWidget *qt_popup_down = 0; // popup that contains the pressed widget +@@ -96,8 +96,6 @@ + + QWidgetWindow::~QWidgetWindow() + { +- if (m_widget == qt_tablet_target) +- qt_tablet_target = 0; + } + + #ifndef QT_NO_ACCESSIBILITY From 6db83db3eb96809da3e680464b152f82785e38e6 Mon Sep 17 00:00:00 2001 From: jtimon Date: Wed, 3 Sep 2014 02:52:01 +0200 Subject: [PATCH 0670/1288] Decouple CChain from mapBlockIndex --- src/init.cpp | 2 +- src/main.cpp | 11 ++++++----- src/main.h | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 31f64878fb..f83dfe2f99 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1151,7 +1151,7 @@ bool AppInit2(boost::thread_group& threadGroup) CWalletDB walletdb(strWalletFile); CBlockLocator locator; if (walletdb.ReadBestBlock(locator)) - pindexRescan = chainActive.FindFork(locator); + pindexRescan = FindForkInGlobalIndex(chainActive, locator); else pindexRescan = chainActive.Genesis(); } diff --git a/src/main.cpp b/src/main.cpp index a3b31b719d..108f8e0823 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -431,18 +431,19 @@ CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const { return CBlockLocator(vHave); } -CBlockIndex *CChain::FindFork(const CBlockLocator &locator) const { +CBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& locator) +{ // Find the first block the caller has in the main chain BOOST_FOREACH(const uint256& hash, locator.vHave) { BlockMap::iterator mi = mapBlockIndex.find(hash); if (mi != mapBlockIndex.end()) { CBlockIndex* pindex = (*mi).second; - if (Contains(pindex)) + if (chain.Contains(pindex)) return pindex; } } - return Genesis(); + return chain.Genesis(); } const CBlockIndex *CChain::FindFork(const CBlockIndex *pindex) const { @@ -3672,7 +3673,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, LOCK(cs_main); // Find the last block the caller has in the main chain - CBlockIndex* pindex = chainActive.FindFork(locator); + CBlockIndex* pindex = FindForkInGlobalIndex(chainActive, locator); // Send the rest of the chain if (pindex) @@ -3719,7 +3720,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, else { // Find the last block the caller has in the main chain - pindex = chainActive.FindFork(locator); + pindex = FindForkInGlobalIndex(chainActive, locator); if (pindex) pindex = chainActive.Next(pindex); } diff --git a/src/main.h b/src/main.h index 30cccab2f1..dbc20783bb 100644 --- a/src/main.h +++ b/src/main.h @@ -953,13 +953,13 @@ public: /** Return a CBlockLocator that refers to a block in this chain (by default the tip). */ CBlockLocator GetLocator(const CBlockIndex *pindex = NULL) const; - /** Find the last common block between this chain and a locator. */ - CBlockIndex *FindFork(const CBlockLocator &locator) const; - /** Find the last common block between this chain and a block index entry. */ const CBlockIndex *FindFork(const CBlockIndex *pindex) const; }; +/** Find the last common block between the parameter chain and a locator. */ +CBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& locator); + /** The currently-connected chain of blocks. */ extern CChain chainActive; From e8b5f0d549b1b76611c7374bed9ceec7d09fa847 Mon Sep 17 00:00:00 2001 From: jtimon Date: Wed, 3 Sep 2014 02:20:09 +0200 Subject: [PATCH 0671/1288] Move CBlockIndex, CChain and related code out of main --- src/Makefile.am | 2 + src/chain.cpp | 59 ++++++++ src/chain.h | 390 ++++++++++++++++++++++++++++++++++++++++++++++++ src/main.cpp | 54 ------- src/main.h | 381 +--------------------------------------------- 5 files changed, 452 insertions(+), 434 deletions(-) create mode 100644 src/chain.cpp create mode 100644 src/chain.h diff --git a/src/Makefile.am b/src/Makefile.am index 9b7e99861d..56e141532a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -67,6 +67,7 @@ BITCOIN_CORE_H = \ allocators.h \ base58.h \ bloom.h \ + chain.h \ chainparams.h \ chainparamsbase.h \ chainparamsseeds.h \ @@ -145,6 +146,7 @@ libbitcoin_server_a_SOURCES = \ addrman.cpp \ alert.cpp \ bloom.cpp \ + chain.cpp \ checkpoints.cpp \ init.cpp \ leveldbwrapper.cpp \ diff --git a/src/chain.cpp b/src/chain.cpp new file mode 100644 index 0000000000..bcb497b2d4 --- /dev/null +++ b/src/chain.cpp @@ -0,0 +1,59 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "chain.h" + +using namespace std; + +// CChain implementation + +CBlockIndex *CChain::SetTip(CBlockIndex *pindex) { + if (pindex == NULL) { + vChain.clear(); + return NULL; + } + vChain.resize(pindex->nHeight + 1); + while (pindex && vChain[pindex->nHeight] != pindex) { + vChain[pindex->nHeight] = pindex; + pindex = pindex->pprev; + } + return pindex; +} + +CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const { + int nStep = 1; + std::vector vHave; + vHave.reserve(32); + + if (!pindex) + pindex = Tip(); + while (pindex) { + vHave.push_back(pindex->GetBlockHash()); + // Stop when we have added the genesis block. + if (pindex->nHeight == 0) + break; + // Exponentially larger steps back, plus the genesis block. + int nHeight = std::max(pindex->nHeight - nStep, 0); + if (Contains(pindex)) { + // Use O(1) CChain index if possible. + pindex = (*this)[nHeight]; + } else { + // Otherwise, use O(log n) skiplist. + pindex = pindex->GetAncestor(nHeight); + } + if (vHave.size() > 10) + nStep *= 2; + } + + return CBlockLocator(vHave); +} + +const CBlockIndex *CChain::FindFork(const CBlockIndex *pindex) const { + if (pindex->nHeight > Height()) + pindex = pindex->GetAncestor(Height()); + while (pindex && !Contains(pindex)) + pindex = pindex->pprev; + return pindex; +} diff --git a/src/chain.h b/src/chain.h new file mode 100644 index 0000000000..91bdf38347 --- /dev/null +++ b/src/chain.h @@ -0,0 +1,390 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef H_BITCOIN_CHAIN +#define H_BITCOIN_CHAIN + +#include "core.h" +#include "pow.h" +#include "uint256.h" + +#include + +#include + +struct CDiskBlockPos +{ + int nFile; + unsigned int nPos; + + ADD_SERIALIZE_METHODS; + + template + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + READWRITE(VARINT(nFile)); + READWRITE(VARINT(nPos)); + } + + CDiskBlockPos() { + SetNull(); + } + + CDiskBlockPos(int nFileIn, unsigned int nPosIn) { + nFile = nFileIn; + nPos = nPosIn; + } + + friend bool operator==(const CDiskBlockPos &a, const CDiskBlockPos &b) { + return (a.nFile == b.nFile && a.nPos == b.nPos); + } + + friend bool operator!=(const CDiskBlockPos &a, const CDiskBlockPos &b) { + return !(a == b); + } + + void SetNull() { nFile = -1; nPos = 0; } + bool IsNull() const { return (nFile == -1); } +}; + +enum BlockStatus { + BLOCK_VALID_UNKNOWN = 0, + BLOCK_VALID_HEADER = 1, // parsed, version ok, hash satisfies claimed PoW, 1 <= vtx count <= max, timestamp not in future + BLOCK_VALID_TREE = 2, // parent found, difficulty matches, timestamp >= median previous, checkpoint + BLOCK_VALID_TRANSACTIONS = 3, // only first tx is coinbase, 2 <= coinbase input script length <= 100, transactions valid, no duplicate txids, sigops, size, merkle root + BLOCK_VALID_CHAIN = 4, // outputs do not overspend inputs, no double spends, coinbase output ok, immature coinbase spends, BIP30 + BLOCK_VALID_SCRIPTS = 5, // scripts/signatures ok + BLOCK_VALID_MASK = BLOCK_VALID_HEADER | BLOCK_VALID_TREE | BLOCK_VALID_TRANSACTIONS | + BLOCK_VALID_CHAIN | BLOCK_VALID_SCRIPTS, + + BLOCK_HAVE_DATA = 8, // full block available in blk*.dat + BLOCK_HAVE_UNDO = 16, // undo data available in rev*.dat + BLOCK_HAVE_MASK = BLOCK_HAVE_DATA | BLOCK_HAVE_UNDO, + + BLOCK_FAILED_VALID = 32, // stage after last reached validness failed + BLOCK_FAILED_CHILD = 64, // descends from failed block + BLOCK_FAILED_MASK = BLOCK_FAILED_VALID | BLOCK_FAILED_CHILD, +}; + +/** The block chain is a tree shaped structure starting with the + * genesis block at the root, with each block potentially having multiple + * candidates to be the next block. A blockindex may have multiple pprev pointing + * to it, but at most one of them can be part of the currently active branch. + */ +class CBlockIndex +{ +public: + // pointer to the hash of the block, if any. memory is owned by this CBlockIndex + const uint256* phashBlock; + + // pointer to the index of the predecessor of this block + CBlockIndex* pprev; + + // pointer to the index of some further predecessor of this block + CBlockIndex* pskip; + + // height of the entry in the chain. The genesis block has height 0 + int nHeight; + + // Which # file this block is stored in (blk?????.dat) + int nFile; + + // Byte offset within blk?????.dat where this block's data is stored + unsigned int nDataPos; + + // Byte offset within rev?????.dat where this block's undo data is stored + unsigned int nUndoPos; + + // (memory only) Total amount of work (expected number of hashes) in the chain up to and including this block + uint256 nChainWork; + + // Number of transactions in this block. + // Note: in a potential headers-first mode, this number cannot be relied upon + unsigned int nTx; + + // (memory only) Number of transactions in the chain up to and including this block + unsigned int nChainTx; // change to 64-bit type when necessary; won't happen before 2030 + + // Verification status of this block. See enum BlockStatus + unsigned int nStatus; + + // block header + int nVersion; + uint256 hashMerkleRoot; + unsigned int nTime; + unsigned int nBits; + unsigned int nNonce; + + // (memory only) Sequencial id assigned to distinguish order in which blocks are received. + uint32_t nSequenceId; + + void SetNull() + { + phashBlock = NULL; + pprev = NULL; + pskip = NULL; + nHeight = 0; + nFile = 0; + nDataPos = 0; + nUndoPos = 0; + nChainWork = 0; + nTx = 0; + nChainTx = 0; + nStatus = 0; + nSequenceId = 0; + + nVersion = 0; + hashMerkleRoot = 0; + nTime = 0; + nBits = 0; + nNonce = 0; + } + + CBlockIndex() + { + SetNull(); + } + + CBlockIndex(CBlockHeader& block) + { + SetNull(); + + nVersion = block.nVersion; + hashMerkleRoot = block.hashMerkleRoot; + nTime = block.nTime; + nBits = block.nBits; + nNonce = block.nNonce; + } + + CDiskBlockPos GetBlockPos() const { + CDiskBlockPos ret; + if (nStatus & BLOCK_HAVE_DATA) { + ret.nFile = nFile; + ret.nPos = nDataPos; + } + return ret; + } + + CDiskBlockPos GetUndoPos() const { + CDiskBlockPos ret; + if (nStatus & BLOCK_HAVE_UNDO) { + ret.nFile = nFile; + ret.nPos = nUndoPos; + } + return ret; + } + + CBlockHeader GetBlockHeader() const + { + CBlockHeader block; + block.nVersion = nVersion; + if (pprev) + block.hashPrevBlock = pprev->GetBlockHash(); + block.hashMerkleRoot = hashMerkleRoot; + block.nTime = nTime; + block.nBits = nBits; + block.nNonce = nNonce; + return block; + } + + uint256 GetBlockHash() const + { + return *phashBlock; + } + + int64_t GetBlockTime() const + { + return (int64_t)nTime; + } + + uint256 GetBlockWork() const + { + return GetProofIncrement(nBits); + } + + enum { nMedianTimeSpan=11 }; + + int64_t GetMedianTimePast() const + { + int64_t pmedian[nMedianTimeSpan]; + int64_t* pbegin = &pmedian[nMedianTimeSpan]; + int64_t* pend = &pmedian[nMedianTimeSpan]; + + const CBlockIndex* pindex = this; + for (int i = 0; i < nMedianTimeSpan && pindex; i++, pindex = pindex->pprev) + *(--pbegin) = pindex->GetBlockTime(); + + std::sort(pbegin, pend); + return pbegin[(pend - pbegin)/2]; + } + + /** + * Returns true if there are nRequired or more blocks of minVersion or above + * in the last Params().ToCheckBlockUpgradeMajority() blocks, starting at pstart + * and going backwards. + */ + static bool IsSuperMajority(int minVersion, const CBlockIndex* pstart, + unsigned int nRequired); + + std::string ToString() const + { + return strprintf("CBlockIndex(pprev=%p, nHeight=%d, merkle=%s, hashBlock=%s)", + pprev, nHeight, + hashMerkleRoot.ToString(), + GetBlockHash().ToString()); + } + + // Check whether this block index entry is valid up to the passed validity level. + bool IsValid(enum BlockStatus nUpTo = BLOCK_VALID_TRANSACTIONS) const + { + assert(!(nUpTo & ~BLOCK_VALID_MASK)); // Only validity flags allowed. + if (nStatus & BLOCK_FAILED_MASK) + return false; + return ((nStatus & BLOCK_VALID_MASK) >= nUpTo); + } + + // Raise the validity level of this block index entry. + // Returns true if the validity was changed. + bool RaiseValidity(enum BlockStatus nUpTo) + { + assert(!(nUpTo & ~BLOCK_VALID_MASK)); // Only validity flags allowed. + if (nStatus & BLOCK_FAILED_MASK) + return false; + if ((nStatus & BLOCK_VALID_MASK) < nUpTo) { + nStatus = (nStatus & ~BLOCK_VALID_MASK) | nUpTo; + return true; + } + return false; + } + + // Build the skiplist pointer for this entry. + void BuildSkip(); + + // Efficiently find an ancestor of this block. + CBlockIndex* GetAncestor(int height); + const CBlockIndex* GetAncestor(int height) const; +}; + +/** Used to marshal pointers into hashes for db storage. */ +class CDiskBlockIndex : public CBlockIndex +{ +public: + uint256 hashPrev; + + CDiskBlockIndex() { + hashPrev = 0; + } + + explicit CDiskBlockIndex(CBlockIndex* pindex) : CBlockIndex(*pindex) { + hashPrev = (pprev ? pprev->GetBlockHash() : 0); + } + + ADD_SERIALIZE_METHODS; + + template + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + if (!(nType & SER_GETHASH)) + READWRITE(VARINT(nVersion)); + + READWRITE(VARINT(nHeight)); + READWRITE(VARINT(nStatus)); + READWRITE(VARINT(nTx)); + if (nStatus & (BLOCK_HAVE_DATA | BLOCK_HAVE_UNDO)) + READWRITE(VARINT(nFile)); + if (nStatus & BLOCK_HAVE_DATA) + READWRITE(VARINT(nDataPos)); + if (nStatus & BLOCK_HAVE_UNDO) + READWRITE(VARINT(nUndoPos)); + + // block header + READWRITE(this->nVersion); + READWRITE(hashPrev); + READWRITE(hashMerkleRoot); + READWRITE(nTime); + READWRITE(nBits); + READWRITE(nNonce); + } + + uint256 GetBlockHash() const + { + CBlockHeader block; + block.nVersion = nVersion; + block.hashPrevBlock = hashPrev; + block.hashMerkleRoot = hashMerkleRoot; + block.nTime = nTime; + block.nBits = nBits; + block.nNonce = nNonce; + return block.GetHash(); + } + + + std::string ToString() const + { + std::string str = "CDiskBlockIndex("; + str += CBlockIndex::ToString(); + str += strprintf("\n hashBlock=%s, hashPrev=%s)", + GetBlockHash().ToString(), + hashPrev.ToString()); + return str; + } +}; + +/** An in-memory indexed chain of blocks. */ +class CChain { +private: + std::vector vChain; + +public: + /** Returns the index entry for the genesis block of this chain, or NULL if none. */ + CBlockIndex *Genesis() const { + return vChain.size() > 0 ? vChain[0] : NULL; + } + + /** Returns the index entry for the tip of this chain, or NULL if none. */ + CBlockIndex *Tip() const { + return vChain.size() > 0 ? vChain[vChain.size() - 1] : NULL; + } + + /** Returns the index entry at a particular height in this chain, or NULL if no such height exists. */ + CBlockIndex *operator[](int nHeight) const { + if (nHeight < 0 || nHeight >= (int)vChain.size()) + return NULL; + return vChain[nHeight]; + } + + /** Compare two chains efficiently. */ + friend bool operator==(const CChain &a, const CChain &b) { + return a.vChain.size() == b.vChain.size() && + a.vChain[a.vChain.size() - 1] == b.vChain[b.vChain.size() - 1]; + } + + /** Efficiently check whether a block is present in this chain. */ + bool Contains(const CBlockIndex *pindex) const { + return (*this)[pindex->nHeight] == pindex; + } + + /** Find the successor of a block in this chain, or NULL if the given index is not found or is the tip. */ + CBlockIndex *Next(const CBlockIndex *pindex) const { + if (Contains(pindex)) + return (*this)[pindex->nHeight + 1]; + else + return NULL; + } + + /** Return the maximal height in the chain. Is equal to chain.Tip() ? chain.Tip()->nHeight : -1. */ + int Height() const { + return vChain.size() - 1; + } + + /** Set/initialize a chain with a given tip. Returns the forking point. */ + CBlockIndex *SetTip(CBlockIndex *pindex); + + /** Return a CBlockLocator that refers to a block in this chain (by default the tip). */ + CBlockLocator GetLocator(const CBlockIndex *pindex = NULL) const; + + /** Find the last common block between this chain and a block index entry. */ + const CBlockIndex *FindFork(const CBlockIndex *pindex) const; +}; + +#endif diff --git a/src/main.cpp b/src/main.cpp index 108f8e0823..5210f8ef55 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -385,52 +385,6 @@ void UnregisterNodeSignals(CNodeSignals& nodeSignals) nodeSignals.FinalizeNode.disconnect(&FinalizeNode); } -////////////////////////////////////////////////////////////////////////////// -// -// CChain implementation -// - -CBlockIndex *CChain::SetTip(CBlockIndex *pindex) { - if (pindex == NULL) { - vChain.clear(); - return NULL; - } - vChain.resize(pindex->nHeight + 1); - while (pindex && vChain[pindex->nHeight] != pindex) { - vChain[pindex->nHeight] = pindex; - pindex = pindex->pprev; - } - return pindex; -} - -CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const { - int nStep = 1; - std::vector vHave; - vHave.reserve(32); - - if (!pindex) - pindex = Tip(); - while (pindex) { - vHave.push_back(pindex->GetBlockHash()); - // Stop when we have added the genesis block. - if (pindex->nHeight == 0) - break; - // Exponentially larger steps back, plus the genesis block. - int nHeight = std::max(pindex->nHeight - nStep, 0); - if (Contains(pindex)) { - // Use O(1) CChain index if possible. - pindex = (*this)[nHeight]; - } else { - // Otherwise, use O(log n) skiplist. - pindex = pindex->GetAncestor(nHeight); - } - if (vHave.size() > 10) - nStep *= 2; - } - - return CBlockLocator(vHave); -} - CBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& locator) { // Find the first block the caller has in the main chain @@ -446,14 +400,6 @@ CBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& loc return chain.Genesis(); } -const CBlockIndex *CChain::FindFork(const CBlockIndex *pindex) const { - if (pindex->nHeight > Height()) - pindex = pindex->GetAncestor(Height()); - while (pindex && !Contains(pindex)) - pindex = pindex->pprev; - return pindex; -} - CCoinsViewCache *pcoinsTip = NULL; CBlockTreeDB *pblocktree = NULL; diff --git a/src/main.h b/src/main.h index dbc20783bb..ff55a26cac 100644 --- a/src/main.h +++ b/src/main.h @@ -10,6 +10,7 @@ #include "config/bitcoin-config.h" #endif +#include "chain.h" #include "chainparams.h" #include "coins.h" #include "core.h" @@ -113,7 +114,6 @@ static const uint64_t nMinDiskSpace = 52428800; class CBlockTreeDB; -struct CDiskBlockPos; class CTxUndo; class CScriptCheck; class CValidationState; @@ -189,51 +189,11 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa bool* pfMissingInputs, bool fRejectInsaneFee=false); - - - - - - struct CNodeStateStats { int nMisbehavior; int nSyncHeight; }; -struct CDiskBlockPos -{ - int nFile; - unsigned int nPos; - - ADD_SERIALIZE_METHODS; - - template - inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - READWRITE(VARINT(nFile)); - READWRITE(VARINT(nPos)); - } - - CDiskBlockPos() { - SetNull(); - } - - CDiskBlockPos(int nFileIn, unsigned int nPosIn) { - nFile = nFileIn; - nPos = nPosIn; - } - - friend bool operator==(const CDiskBlockPos &a, const CDiskBlockPos &b) { - return (a.nFile == b.nFile && a.nPos == b.nPos); - } - - friend bool operator!=(const CDiskBlockPos &a, const CDiskBlockPos &b) { - return !(a == b); - } - - void SetNull() { nFile = -1; nPos = 0; } - bool IsNull() const { return (nFile == -1); } -}; - struct CDiskTxPos : public CDiskBlockPos { unsigned int nTxOffset; // after header @@ -547,288 +507,6 @@ public: } }; -enum BlockStatus { - BLOCK_VALID_UNKNOWN = 0, - BLOCK_VALID_HEADER = 1, // parsed, version ok, hash satisfies claimed PoW, 1 <= vtx count <= max, timestamp not in future - BLOCK_VALID_TREE = 2, // parent found, difficulty matches, timestamp >= median previous, checkpoint - BLOCK_VALID_TRANSACTIONS = 3, // only first tx is coinbase, 2 <= coinbase input script length <= 100, transactions valid, no duplicate txids, sigops, size, merkle root - BLOCK_VALID_CHAIN = 4, // outputs do not overspend inputs, no double spends, coinbase output ok, immature coinbase spends, BIP30 - BLOCK_VALID_SCRIPTS = 5, // scripts/signatures ok - BLOCK_VALID_MASK = BLOCK_VALID_HEADER | BLOCK_VALID_TREE | BLOCK_VALID_TRANSACTIONS | - BLOCK_VALID_CHAIN | BLOCK_VALID_SCRIPTS, - - BLOCK_HAVE_DATA = 8, // full block available in blk*.dat - BLOCK_HAVE_UNDO = 16, // undo data available in rev*.dat - BLOCK_HAVE_MASK = BLOCK_HAVE_DATA | BLOCK_HAVE_UNDO, - - BLOCK_FAILED_VALID = 32, // stage after last reached validness failed - BLOCK_FAILED_CHILD = 64, // descends from failed block - BLOCK_FAILED_MASK = BLOCK_FAILED_VALID | BLOCK_FAILED_CHILD, -}; - -/** The block chain is a tree shaped structure starting with the - * genesis block at the root, with each block potentially having multiple - * candidates to be the next block. A blockindex may have multiple pprev pointing - * to it, but at most one of them can be part of the currently active branch. - */ -class CBlockIndex -{ -public: - // pointer to the hash of the block, if any. memory is owned by this CBlockIndex - const uint256* phashBlock; - - // pointer to the index of the predecessor of this block - CBlockIndex* pprev; - - // pointer to the index of some further predecessor of this block - CBlockIndex* pskip; - - // height of the entry in the chain. The genesis block has height 0 - int nHeight; - - // Which # file this block is stored in (blk?????.dat) - int nFile; - - // Byte offset within blk?????.dat where this block's data is stored - unsigned int nDataPos; - - // Byte offset within rev?????.dat where this block's undo data is stored - unsigned int nUndoPos; - - // (memory only) Total amount of work (expected number of hashes) in the chain up to and including this block - uint256 nChainWork; - - // Number of transactions in this block. - // Note: in a potential headers-first mode, this number cannot be relied upon - unsigned int nTx; - - // (memory only) Number of transactions in the chain up to and including this block - unsigned int nChainTx; // change to 64-bit type when necessary; won't happen before 2030 - - // Verification status of this block. See enum BlockStatus - unsigned int nStatus; - - // block header - int nVersion; - uint256 hashMerkleRoot; - unsigned int nTime; - unsigned int nBits; - unsigned int nNonce; - - // (memory only) Sequencial id assigned to distinguish order in which blocks are received. - uint32_t nSequenceId; - - void SetNull() - { - phashBlock = NULL; - pprev = NULL; - pskip = NULL; - nHeight = 0; - nFile = 0; - nDataPos = 0; - nUndoPos = 0; - nChainWork = 0; - nTx = 0; - nChainTx = 0; - nStatus = 0; - nSequenceId = 0; - - nVersion = 0; - hashMerkleRoot = 0; - nTime = 0; - nBits = 0; - nNonce = 0; - } - - CBlockIndex() - { - SetNull(); - } - - CBlockIndex(CBlockHeader& block) - { - SetNull(); - - nVersion = block.nVersion; - hashMerkleRoot = block.hashMerkleRoot; - nTime = block.nTime; - nBits = block.nBits; - nNonce = block.nNonce; - } - - CDiskBlockPos GetBlockPos() const { - CDiskBlockPos ret; - if (nStatus & BLOCK_HAVE_DATA) { - ret.nFile = nFile; - ret.nPos = nDataPos; - } - return ret; - } - - CDiskBlockPos GetUndoPos() const { - CDiskBlockPos ret; - if (nStatus & BLOCK_HAVE_UNDO) { - ret.nFile = nFile; - ret.nPos = nUndoPos; - } - return ret; - } - - CBlockHeader GetBlockHeader() const - { - CBlockHeader block; - block.nVersion = nVersion; - if (pprev) - block.hashPrevBlock = pprev->GetBlockHash(); - block.hashMerkleRoot = hashMerkleRoot; - block.nTime = nTime; - block.nBits = nBits; - block.nNonce = nNonce; - return block; - } - - uint256 GetBlockHash() const - { - return *phashBlock; - } - - int64_t GetBlockTime() const - { - return (int64_t)nTime; - } - - uint256 GetBlockWork() const - { - return GetProofIncrement(nBits); - } - - enum { nMedianTimeSpan=11 }; - - int64_t GetMedianTimePast() const - { - int64_t pmedian[nMedianTimeSpan]; - int64_t* pbegin = &pmedian[nMedianTimeSpan]; - int64_t* pend = &pmedian[nMedianTimeSpan]; - - const CBlockIndex* pindex = this; - for (int i = 0; i < nMedianTimeSpan && pindex; i++, pindex = pindex->pprev) - *(--pbegin) = pindex->GetBlockTime(); - - std::sort(pbegin, pend); - return pbegin[(pend - pbegin)/2]; - } - - /** - * Returns true if there are nRequired or more blocks of minVersion or above - * in the last Params().ToCheckBlockUpgradeMajority() blocks, starting at pstart - * and going backwards. - */ - static bool IsSuperMajority(int minVersion, const CBlockIndex* pstart, - unsigned int nRequired); - - std::string ToString() const - { - return strprintf("CBlockIndex(pprev=%p, nHeight=%d, merkle=%s, hashBlock=%s)", - pprev, nHeight, - hashMerkleRoot.ToString(), - GetBlockHash().ToString()); - } - - // Check whether this block index entry is valid up to the passed validity level. - bool IsValid(enum BlockStatus nUpTo = BLOCK_VALID_TRANSACTIONS) const - { - assert(!(nUpTo & ~BLOCK_VALID_MASK)); // Only validity flags allowed. - if (nStatus & BLOCK_FAILED_MASK) - return false; - return ((nStatus & BLOCK_VALID_MASK) >= nUpTo); - } - - // Raise the validity level of this block index entry. - // Returns true if the validity was changed. - bool RaiseValidity(enum BlockStatus nUpTo) - { - assert(!(nUpTo & ~BLOCK_VALID_MASK)); // Only validity flags allowed. - if (nStatus & BLOCK_FAILED_MASK) - return false; - if ((nStatus & BLOCK_VALID_MASK) < nUpTo) { - nStatus = (nStatus & ~BLOCK_VALID_MASK) | nUpTo; - return true; - } - return false; - } - - // Build the skiplist pointer for this entry. - void BuildSkip(); - - // Efficiently find an ancestor of this block. - CBlockIndex* GetAncestor(int height); - const CBlockIndex* GetAncestor(int height) const; -}; - -/** Used to marshal pointers into hashes for db storage. */ -class CDiskBlockIndex : public CBlockIndex -{ -public: - uint256 hashPrev; - - CDiskBlockIndex() { - hashPrev = 0; - } - - explicit CDiskBlockIndex(CBlockIndex* pindex) : CBlockIndex(*pindex) { - hashPrev = (pprev ? pprev->GetBlockHash() : 0); - } - - ADD_SERIALIZE_METHODS; - - template - inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - if (!(nType & SER_GETHASH)) - READWRITE(VARINT(nVersion)); - - READWRITE(VARINT(nHeight)); - READWRITE(VARINT(nStatus)); - READWRITE(VARINT(nTx)); - if (nStatus & (BLOCK_HAVE_DATA | BLOCK_HAVE_UNDO)) - READWRITE(VARINT(nFile)); - if (nStatus & BLOCK_HAVE_DATA) - READWRITE(VARINT(nDataPos)); - if (nStatus & BLOCK_HAVE_UNDO) - READWRITE(VARINT(nUndoPos)); - - // block header - READWRITE(this->nVersion); - READWRITE(hashPrev); - READWRITE(hashMerkleRoot); - READWRITE(nTime); - READWRITE(nBits); - READWRITE(nNonce); - } - - uint256 GetBlockHash() const - { - CBlockHeader block; - block.nVersion = nVersion; - block.hashPrevBlock = hashPrev; - block.hashMerkleRoot = hashMerkleRoot; - block.nTime = nTime; - block.nBits = nBits; - block.nNonce = nNonce; - return block.GetHash(); - } - - - std::string ToString() const - { - std::string str = "CDiskBlockIndex("; - str += CBlockIndex::ToString(); - str += strprintf("\n hashBlock=%s, hashPrev=%s)", - GetBlockHash().ToString(), - hashPrev.ToString()); - return str; - } -}; - /** Capture information about block/transaction validation */ class CValidationState { private: @@ -900,63 +578,6 @@ public: bool VerifyDB(CCoinsView *coinsview, int nCheckLevel, int nCheckDepth); }; -/** An in-memory indexed chain of blocks. */ -class CChain { -private: - std::vector vChain; - -public: - /** Returns the index entry for the genesis block of this chain, or NULL if none. */ - CBlockIndex *Genesis() const { - return vChain.size() > 0 ? vChain[0] : NULL; - } - - /** Returns the index entry for the tip of this chain, or NULL if none. */ - CBlockIndex *Tip() const { - return vChain.size() > 0 ? vChain[vChain.size() - 1] : NULL; - } - - /** Returns the index entry at a particular height in this chain, or NULL if no such height exists. */ - CBlockIndex *operator[](int nHeight) const { - if (nHeight < 0 || nHeight >= (int)vChain.size()) - return NULL; - return vChain[nHeight]; - } - - /** Compare two chains efficiently. */ - friend bool operator==(const CChain &a, const CChain &b) { - return a.vChain.size() == b.vChain.size() && - a.vChain[a.vChain.size() - 1] == b.vChain[b.vChain.size() - 1]; - } - - /** Efficiently check whether a block is present in this chain. */ - bool Contains(const CBlockIndex *pindex) const { - return (*this)[pindex->nHeight] == pindex; - } - - /** Find the successor of a block in this chain, or NULL if the given index is not found or is the tip. */ - CBlockIndex *Next(const CBlockIndex *pindex) const { - if (Contains(pindex)) - return (*this)[pindex->nHeight + 1]; - else - return NULL; - } - - /** Return the maximal height in the chain. Is equal to chain.Tip() ? chain.Tip()->nHeight : -1. */ - int Height() const { - return vChain.size() - 1; - } - - /** Set/initialize a chain with a given tip. Returns the forking point. */ - CBlockIndex *SetTip(CBlockIndex *pindex); - - /** Return a CBlockLocator that refers to a block in this chain (by default the tip). */ - CBlockLocator GetLocator(const CBlockIndex *pindex = NULL) const; - - /** Find the last common block between this chain and a block index entry. */ - const CBlockIndex *FindFork(const CBlockIndex *pindex) const; -}; - /** Find the last common block between the parameter chain and a locator. */ CBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& locator); From 6022b5dc6ba930797db46e00426923b53d6594b3 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 8 Sep 2014 21:15:31 +0200 Subject: [PATCH 0672/1288] Make script_{valid,invalid}.json validation flags configurable --- src/test/data/script_invalid.json | 585 ++++++++++---------- src/test/data/script_valid.json | 868 +++++++++++++++--------------- src/test/script_tests.cpp | 12 +- src/test/transaction_tests.cpp | 6 +- 4 files changed, 749 insertions(+), 722 deletions(-) diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index e3e1ccbf3c..75de4716f8 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -1,366 +1,377 @@ [ -["", "DEPTH", "Test the test: we should have an empty stack after scriptSig evaluation"], -[" ", "DEPTH", "and multiple spaces should not change that."], -[" ", "DEPTH"], -[" ", "DEPTH"], +["", "DEPTH", "P2SH,STRICTENC", "Test the test: we should have an empty stack after scriptSig evaluation"], +[" ", "DEPTH", "P2SH,STRICTENC", "and multiple spaces should not change that."], +[" ", "DEPTH", "P2SH,STRICTENC"], +[" ", "DEPTH", "P2SH,STRICTENC"], -["", ""], -["", "NOP"], -["", "NOP DEPTH"], -["NOP", ""], -["NOP", "DEPTH"], -["NOP","NOP"], -["NOP","NOP DEPTH"], +["", "", "P2SH,STRICTENC"], +["", "NOP", "P2SH,STRICTENC"], +["", "NOP DEPTH", "P2SH,STRICTENC"], +["NOP", "", "P2SH,STRICTENC"], +["NOP", "DEPTH", "P2SH,STRICTENC"], +["NOP","NOP", "P2SH,STRICTENC"], +["NOP","NOP DEPTH", "P2SH,STRICTENC"], -["DEPTH", ""], +["DEPTH", "", "P2SH,STRICTENC"], -["0x4c01","0x01 NOP", "PUSHDATA1 with not enough bytes"], -["0x4d0200ff","0x01 NOP", "PUSHDATA2 with not enough bytes"], -["0x4e03000000ffff","0x01 NOP", "PUSHDATA4 with not enough bytes"], +["0x4c01","0x01 NOP", "P2SH,STRICTENC", "PUSHDATA1 with not enough bytes"], +["0x4d0200ff","0x01 NOP", "P2SH,STRICTENC", "PUSHDATA2 with not enough bytes"], +["0x4e03000000ffff","0x01 NOP", "P2SH,STRICTENC", "PUSHDATA4 with not enough bytes"], -["1", "IF 0x50 ENDIF 1", "0x50 is reserved"], -["0x52", "0x5f ADD 0x60 EQUAL", "0x51 through 0x60 push 1 through 16 onto stack"], -["0","NOP"], -["1", "IF VER ELSE 1 ENDIF", "VER non-functional"], -["0", "IF VERIF ELSE 1 ENDIF", "VERIF illegal everywhere"], -["0", "IF ELSE 1 ELSE VERIF ENDIF", "VERIF illegal everywhere"], -["0", "IF VERNOTIF ELSE 1 ENDIF", "VERNOTIF illegal everywhere"], -["0", "IF ELSE 1 ELSE VERNOTIF ENDIF", "VERNOTIF illegal everywhere"], +["1", "IF 0x50 ENDIF 1", "P2SH,STRICTENC", "0x50 is reserved"], +["0x52", "0x5f ADD 0x60 EQUAL", "P2SH,STRICTENC", "0x51 through 0x60 push 1 through 16 onto stack"], +["0","NOP", "P2SH,STRICTENC"], +["1", "IF VER ELSE 1 ENDIF", "P2SH,STRICTENC", "VER non-functional"], +["0", "IF VERIF ELSE 1 ENDIF", "P2SH,STRICTENC", "VERIF illegal everywhere"], +["0", "IF ELSE 1 ELSE VERIF ENDIF", "P2SH,STRICTENC", "VERIF illegal everywhere"], +["0", "IF VERNOTIF ELSE 1 ENDIF", "P2SH,STRICTENC", "VERNOTIF illegal everywhere"], +["0", "IF ELSE 1 ELSE VERNOTIF ENDIF", "P2SH,STRICTENC", "VERNOTIF illegal everywhere"], -["1 IF", "1 ENDIF", "IF/ENDIF can't span scriptSig/scriptPubKey"], -["1 IF 0 ENDIF", "1 ENDIF"], -["1 ELSE 0 ENDIF", "1"], -["0 NOTIF", "123"], +["1 IF", "1 ENDIF", "P2SH,STRICTENC", "IF/ENDIF can't span scriptSig/scriptPubKey"], +["1 IF 0 ENDIF", "1 ENDIF", "P2SH,STRICTENC"], +["1 ELSE 0 ENDIF", "1", "P2SH,STRICTENC"], +["0 NOTIF", "123", "P2SH,STRICTENC"], -["0", "DUP IF ENDIF"], -["0", "IF 1 ENDIF"], -["0", "DUP IF ELSE ENDIF"], -["0", "IF 1 ELSE ENDIF"], -["0", "NOTIF ELSE 1 ENDIF"], +["0", "DUP IF ENDIF", "P2SH,STRICTENC"], +["0", "IF 1 ENDIF", "P2SH,STRICTENC"], +["0", "DUP IF ELSE ENDIF", "P2SH,STRICTENC"], +["0", "IF 1 ELSE ENDIF", "P2SH,STRICTENC"], +["0", "NOTIF ELSE 1 ENDIF", "P2SH,STRICTENC"], -["0 1", "IF IF 1 ELSE 0 ENDIF ENDIF"], -["0 0", "IF IF 1 ELSE 0 ENDIF ENDIF"], -["1 0", "IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF"], -["0 1", "IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF"], +["0 1", "IF IF 1 ELSE 0 ENDIF ENDIF", "P2SH,STRICTENC"], +["0 0", "IF IF 1 ELSE 0 ENDIF ENDIF", "P2SH,STRICTENC"], +["1 0", "IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "P2SH,STRICTENC"], +["0 1", "IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "P2SH,STRICTENC"], -["0 0", "NOTIF IF 1 ELSE 0 ENDIF ENDIF"], -["0 1", "NOTIF IF 1 ELSE 0 ENDIF ENDIF"], -["1 1", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF"], -["0 0", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF"], +["0 0", "NOTIF IF 1 ELSE 0 ENDIF ENDIF", "P2SH,STRICTENC"], +["0 1", "NOTIF IF 1 ELSE 0 ENDIF ENDIF", "P2SH,STRICTENC"], +["1 1", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "P2SH,STRICTENC"], +["0 0", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "P2SH,STRICTENC"], -["1", "IF RETURN ELSE ELSE 1 ENDIF", "Multiple ELSEs"], -["1", "IF 1 ELSE ELSE RETURN ENDIF"], +["1", "IF RETURN ELSE ELSE 1 ENDIF", "P2SH,STRICTENC", "Multiple ELSEs"], +["1", "IF 1 ELSE ELSE RETURN ENDIF", "P2SH,STRICTENC"], -["1", "ENDIF", "Malformed IF/ELSE/ENDIF sequence"], -["1", "ELSE ENDIF"], -["1", "ENDIF ELSE"], -["1", "ENDIF ELSE IF"], -["1", "IF ELSE ENDIF ELSE"], -["1", "IF ELSE ENDIF ELSE ENDIF"], -["1", "IF ENDIF ENDIF"], -["1", "IF ELSE ELSE ENDIF ENDIF"], +["1", "ENDIF", "P2SH,STRICTENC", "Malformed IF/ELSE/ENDIF sequence"], +["1", "ELSE ENDIF", "P2SH,STRICTENC"], +["1", "ENDIF ELSE", "P2SH,STRICTENC"], +["1", "ENDIF ELSE IF", "P2SH,STRICTENC"], +["1", "IF ELSE ENDIF ELSE", "P2SH,STRICTENC"], +["1", "IF ELSE ENDIF ELSE ENDIF", "P2SH,STRICTENC"], +["1", "IF ENDIF ENDIF", "P2SH,STRICTENC"], +["1", "IF ELSE ELSE ENDIF ENDIF", "P2SH,STRICTENC"], -["1", "RETURN"], -["1", "DUP IF RETURN ENDIF"], +["1", "RETURN", "P2SH,STRICTENC"], +["1", "DUP IF RETURN ENDIF", "P2SH,STRICTENC"], -["1", "RETURN 'data'", "canonical prunable txout format"], -["0 IF", "RETURN ENDIF 1", "still prunable because IF/ENDIF can't span scriptSig/scriptPubKey"], +["1", "RETURN 'data'", "P2SH,STRICTENC", "canonical prunable txout format"], +["0 IF", "RETURN ENDIF 1", "P2SH,STRICTENC", "still prunable because IF/ENDIF can't span scriptSig/scriptPubKey"], -["0", "VERIFY 1"], -["1", "VERIFY"], -["1", "VERIFY 0"], +["0", "VERIFY 1", "P2SH,STRICTENC"], +["1", "VERIFY", "P2SH,STRICTENC"], +["1", "VERIFY 0", "P2SH,STRICTENC"], -["1 TOALTSTACK", "FROMALTSTACK 1", "alt stack not shared between sig/pubkey"], +["1 TOALTSTACK", "FROMALTSTACK 1", "P2SH,STRICTENC", "alt stack not shared between sig/pubkey"], -["IFDUP", "DEPTH 0 EQUAL"], -["DROP", "DEPTH 0 EQUAL"], -["DUP", "DEPTH 0 EQUAL"], -["1", "DUP 1 ADD 2 EQUALVERIFY 0 EQUAL"], -["NOP", "NIP"], -["NOP", "1 NIP"], -["NOP", "1 0 NIP"], -["NOP", "OVER 1"], -["1", "OVER"], -["0 1", "OVER DEPTH 3 EQUALVERIFY"], -["19 20 21", "PICK 19 EQUALVERIFY DEPTH 2 EQUAL"], -["NOP", "0 PICK"], -["1", "-1 PICK"], -["19 20 21", "0 PICK 20 EQUALVERIFY DEPTH 3 EQUAL"], -["19 20 21", "1 PICK 21 EQUALVERIFY DEPTH 3 EQUAL"], -["19 20 21", "2 PICK 22 EQUALVERIFY DEPTH 3 EQUAL"], -["NOP", "0 ROLL"], -["1", "-1 ROLL"], -["19 20 21", "0 ROLL 20 EQUALVERIFY DEPTH 2 EQUAL"], -["19 20 21", "1 ROLL 21 EQUALVERIFY DEPTH 2 EQUAL"], -["19 20 21", "2 ROLL 22 EQUALVERIFY DEPTH 2 EQUAL"], -["NOP", "ROT 1"], -["NOP", "1 ROT 1"], -["NOP", "1 2 ROT 1"], -["NOP", "0 1 2 ROT"], -["NOP", "SWAP 1"], -["1", "SWAP 1"], -["0 1", "SWAP 1 EQUALVERIFY"], -["NOP", "TUCK 1"], -["1", "TUCK 1"], -["1 0", "TUCK DEPTH 3 EQUALVERIFY SWAP 2DROP"], -["NOP", "2DUP 1"], -["1", "2DUP 1"], -["NOP", "3DUP 1"], -["1", "3DUP 1"], -["1 2", "3DUP 1"], -["NOP", "2OVER 1"], -["1", "2 3 2OVER 1"], -["NOP", "2SWAP 1"], -["1", "2 3 2SWAP 1"], +["IFDUP", "DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["DROP", "DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["DUP", "DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["1", "DUP 1 ADD 2 EQUALVERIFY 0 EQUAL", "P2SH,STRICTENC"], +["NOP", "NIP", "P2SH,STRICTENC"], +["NOP", "1 NIP", "P2SH,STRICTENC"], +["NOP", "1 0 NIP", "P2SH,STRICTENC"], +["NOP", "OVER 1", "P2SH,STRICTENC"], +["1", "OVER", "P2SH,STRICTENC"], +["0 1", "OVER DEPTH 3 EQUALVERIFY", "P2SH,STRICTENC"], +["19 20 21", "PICK 19 EQUALVERIFY DEPTH 2 EQUAL", "P2SH,STRICTENC"], +["NOP", "0 PICK", "P2SH,STRICTENC"], +["1", "-1 PICK", "P2SH,STRICTENC"], +["19 20 21", "0 PICK 20 EQUALVERIFY DEPTH 3 EQUAL", "P2SH,STRICTENC"], +["19 20 21", "1 PICK 21 EQUALVERIFY DEPTH 3 EQUAL", "P2SH,STRICTENC"], +["19 20 21", "2 PICK 22 EQUALVERIFY DEPTH 3 EQUAL", "P2SH,STRICTENC"], +["NOP", "0 ROLL", "P2SH,STRICTENC"], +["1", "-1 ROLL", "P2SH,STRICTENC"], +["19 20 21", "0 ROLL 20 EQUALVERIFY DEPTH 2 EQUAL", "P2SH,STRICTENC"], +["19 20 21", "1 ROLL 21 EQUALVERIFY DEPTH 2 EQUAL", "P2SH,STRICTENC"], +["19 20 21", "2 ROLL 22 EQUALVERIFY DEPTH 2 EQUAL", "P2SH,STRICTENC"], +["NOP", "ROT 1", "P2SH,STRICTENC"], +["NOP", "1 ROT 1", "P2SH,STRICTENC"], +["NOP", "1 2 ROT 1", "P2SH,STRICTENC"], +["NOP", "0 1 2 ROT", "P2SH,STRICTENC"], +["NOP", "SWAP 1", "P2SH,STRICTENC"], +["1", "SWAP 1", "P2SH,STRICTENC"], +["0 1", "SWAP 1 EQUALVERIFY", "P2SH,STRICTENC"], +["NOP", "TUCK 1", "P2SH,STRICTENC"], +["1", "TUCK 1", "P2SH,STRICTENC"], +["1 0", "TUCK DEPTH 3 EQUALVERIFY SWAP 2DROP", "P2SH,STRICTENC"], +["NOP", "2DUP 1", "P2SH,STRICTENC"], +["1", "2DUP 1", "P2SH,STRICTENC"], +["NOP", "3DUP 1", "P2SH,STRICTENC"], +["1", "3DUP 1", "P2SH,STRICTENC"], +["1 2", "3DUP 1", "P2SH,STRICTENC"], +["NOP", "2OVER 1", "P2SH,STRICTENC"], +["1", "2 3 2OVER 1", "P2SH,STRICTENC"], +["NOP", "2SWAP 1", "P2SH,STRICTENC"], +["1", "2 3 2SWAP 1", "P2SH,STRICTENC"], -["'a' 'b'", "CAT", "CAT disabled"], -["'a' 'b' 0", "IF CAT ELSE 1 ENDIF", "CAT disabled"], -["'abc' 1 1", "SUBSTR", "SUBSTR disabled"], -["'abc' 1 1 0", "IF SUBSTR ELSE 1 ENDIF", "SUBSTR disabled"], -["'abc' 2 0", "IF LEFT ELSE 1 ENDIF", "LEFT disabled"], -["'abc' 2 0", "IF RIGHT ELSE 1 ENDIF", "RIGHT disabled"], +["'a' 'b'", "CAT", "P2SH,STRICTENC", "CAT disabled"], +["'a' 'b' 0", "IF CAT ELSE 1 ENDIF", "P2SH,STRICTENC", "CAT disabled"], +["'abc' 1 1", "SUBSTR", "P2SH,STRICTENC", "SUBSTR disabled"], +["'abc' 1 1 0", "IF SUBSTR ELSE 1 ENDIF", "P2SH,STRICTENC", "SUBSTR disabled"], +["'abc' 2 0", "IF LEFT ELSE 1 ENDIF", "P2SH,STRICTENC", "LEFT disabled"], +["'abc' 2 0", "IF RIGHT ELSE 1 ENDIF", "P2SH,STRICTENC", "RIGHT disabled"], -["NOP", "SIZE 1"], +["NOP", "SIZE 1", "P2SH,STRICTENC"], -["'abc'", "IF INVERT ELSE 1 ENDIF", "INVERT disabled"], -["1 2 0 IF AND ELSE 1 ENDIF", "NOP", "AND disabled"], -["1 2 0 IF OR ELSE 1 ENDIF", "NOP", "OR disabled"], -["1 2 0 IF XOR ELSE 1 ENDIF", "NOP", "XOR disabled"], -["2 0 IF 2MUL ELSE 1 ENDIF", "NOP", "2MUL disabled"], -["2 0 IF 2DIV ELSE 1 ENDIF", "NOP", "2DIV disabled"], -["2 2 0 IF MUL ELSE 1 ENDIF", "NOP", "MUL disabled"], -["2 2 0 IF DIV ELSE 1 ENDIF", "NOP", "DIV disabled"], -["2 2 0 IF MOD ELSE 1 ENDIF", "NOP", "MOD disabled"], -["2 2 0 IF LSHIFT ELSE 1 ENDIF", "NOP", "LSHIFT disabled"], -["2 2 0 IF RSHIFT ELSE 1 ENDIF", "NOP", "RSHIFT disabled"], +["'abc'", "IF INVERT ELSE 1 ENDIF", "P2SH,STRICTENC", "INVERT disabled"], +["1 2 0 IF AND ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "AND disabled"], +["1 2 0 IF OR ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "OR disabled"], +["1 2 0 IF XOR ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "XOR disabled"], +["2 0 IF 2MUL ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "2MUL disabled"], +["2 0 IF 2DIV ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "2DIV disabled"], +["2 2 0 IF MUL ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "MUL disabled"], +["2 2 0 IF DIV ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "DIV disabled"], +["2 2 0 IF MOD ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "MOD disabled"], +["2 2 0 IF LSHIFT ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "LSHIFT disabled"], +["2 2 0 IF RSHIFT ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "RSHIFT disabled"], -["0 1","EQUAL"], -["1 1 ADD", "0 EQUAL"], -["11 1 ADD 12 SUB", "11 EQUAL"], +["0 1","EQUAL", "P2SH,STRICTENC"], +["1 1 ADD", "0 EQUAL", "P2SH,STRICTENC"], +["11 1 ADD 12 SUB", "11 EQUAL", "P2SH,STRICTENC"], -["2147483648 0 ADD", "NOP", "arithmetic operands must be in range [-2^31...2^31] "], -["-2147483648 0 ADD", "NOP", "arithmetic operands must be in range [-2^31...2^31] "], -["2147483647 DUP ADD", "4294967294 NUMEQUAL", "NUMEQUAL must be in numeric range"], -["'abcdef' NOT", "0 EQUAL", "NOT is an arithmetic operand"], +["2147483648 0 ADD", "NOP", "P2SH,STRICTENC", "arithmetic operands must be in range [-2^31...2^31] "], +["-2147483648 0 ADD", "NOP", "P2SH,STRICTENC", "arithmetic operands must be in range [-2^31...2^31] "], +["2147483647 DUP ADD", "4294967294 NUMEQUAL", "P2SH,STRICTENC", "NUMEQUAL must be in numeric range"], +["'abcdef' NOT", "0 EQUAL", "P2SH,STRICTENC", "NOT is an arithmetic operand"], -["2 DUP MUL", "4 EQUAL", "disabled"], -["2 DUP DIV", "1 EQUAL", "disabled"], -["2 2MUL", "4 EQUAL", "disabled"], -["2 2DIV", "1 EQUAL", "disabled"], -["7 3 MOD", "1 EQUAL", "disabled"], -["2 2 LSHIFT", "8 EQUAL", "disabled"], -["2 1 RSHIFT", "1 EQUAL", "disabled"], +["2 DUP MUL", "4 EQUAL", "P2SH,STRICTENC", "disabled"], +["2 DUP DIV", "1 EQUAL", "P2SH,STRICTENC", "disabled"], +["2 2MUL", "4 EQUAL", "P2SH,STRICTENC", "disabled"], +["2 2DIV", "1 EQUAL", "P2SH,STRICTENC", "disabled"], +["7 3 MOD", "1 EQUAL", "P2SH,STRICTENC", "disabled"], +["2 2 LSHIFT", "8 EQUAL", "P2SH,STRICTENC", "disabled"], +["2 1 RSHIFT", "1 EQUAL", "P2SH,STRICTENC", "disabled"], -["1","NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10 2 EQUAL"], -["'NOP_1_to_10' NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10","'NOP_1_to_11' EQUAL"], +["1","NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10 2 EQUAL", "P2SH,STRICTENC"], +["'NOP_1_to_10' NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10","'NOP_1_to_11' EQUAL", "P2SH,STRICTENC"], -["0x50","1", "opcode 0x50 is reserved"], -["1", "IF 0xba ELSE 1 ENDIF", "opcodes above NOP10 invalid if executed"], -["1", "IF 0xbb ELSE 1 ENDIF"], -["1", "IF 0xbc ELSE 1 ENDIF"], -["1", "IF 0xbd ELSE 1 ENDIF"], -["1", "IF 0xbe ELSE 1 ENDIF"], -["1", "IF 0xbf ELSE 1 ENDIF"], -["1", "IF 0xc0 ELSE 1 ENDIF"], -["1", "IF 0xc1 ELSE 1 ENDIF"], -["1", "IF 0xc2 ELSE 1 ENDIF"], -["1", "IF 0xc3 ELSE 1 ENDIF"], -["1", "IF 0xc4 ELSE 1 ENDIF"], -["1", "IF 0xc5 ELSE 1 ENDIF"], -["1", "IF 0xc6 ELSE 1 ENDIF"], -["1", "IF 0xc7 ELSE 1 ENDIF"], -["1", "IF 0xc8 ELSE 1 ENDIF"], -["1", "IF 0xc9 ELSE 1 ENDIF"], -["1", "IF 0xca ELSE 1 ENDIF"], -["1", "IF 0xcb ELSE 1 ENDIF"], -["1", "IF 0xcc ELSE 1 ENDIF"], -["1", "IF 0xcd ELSE 1 ENDIF"], -["1", "IF 0xce ELSE 1 ENDIF"], -["1", "IF 0xcf ELSE 1 ENDIF"], -["1", "IF 0xd0 ELSE 1 ENDIF"], -["1", "IF 0xd1 ELSE 1 ENDIF"], -["1", "IF 0xd2 ELSE 1 ENDIF"], -["1", "IF 0xd3 ELSE 1 ENDIF"], -["1", "IF 0xd4 ELSE 1 ENDIF"], -["1", "IF 0xd5 ELSE 1 ENDIF"], -["1", "IF 0xd6 ELSE 1 ENDIF"], -["1", "IF 0xd7 ELSE 1 ENDIF"], -["1", "IF 0xd8 ELSE 1 ENDIF"], -["1", "IF 0xd9 ELSE 1 ENDIF"], -["1", "IF 0xda ELSE 1 ENDIF"], -["1", "IF 0xdb ELSE 1 ENDIF"], -["1", "IF 0xdc ELSE 1 ENDIF"], -["1", "IF 0xdd ELSE 1 ENDIF"], -["1", "IF 0xde ELSE 1 ENDIF"], -["1", "IF 0xdf ELSE 1 ENDIF"], -["1", "IF 0xe0 ELSE 1 ENDIF"], -["1", "IF 0xe1 ELSE 1 ENDIF"], -["1", "IF 0xe2 ELSE 1 ENDIF"], -["1", "IF 0xe3 ELSE 1 ENDIF"], -["1", "IF 0xe4 ELSE 1 ENDIF"], -["1", "IF 0xe5 ELSE 1 ENDIF"], -["1", "IF 0xe6 ELSE 1 ENDIF"], -["1", "IF 0xe7 ELSE 1 ENDIF"], -["1", "IF 0xe8 ELSE 1 ENDIF"], -["1", "IF 0xe9 ELSE 1 ENDIF"], -["1", "IF 0xea ELSE 1 ENDIF"], -["1", "IF 0xeb ELSE 1 ENDIF"], -["1", "IF 0xec ELSE 1 ENDIF"], -["1", "IF 0xed ELSE 1 ENDIF"], -["1", "IF 0xee ELSE 1 ENDIF"], -["1", "IF 0xef ELSE 1 ENDIF"], -["1", "IF 0xf0 ELSE 1 ENDIF"], -["1", "IF 0xf1 ELSE 1 ENDIF"], -["1", "IF 0xf2 ELSE 1 ENDIF"], -["1", "IF 0xf3 ELSE 1 ENDIF"], -["1", "IF 0xf4 ELSE 1 ENDIF"], -["1", "IF 0xf5 ELSE 1 ENDIF"], -["1", "IF 0xf6 ELSE 1 ENDIF"], -["1", "IF 0xf7 ELSE 1 ENDIF"], -["1", "IF 0xf8 ELSE 1 ENDIF"], -["1", "IF 0xf9 ELSE 1 ENDIF"], -["1", "IF 0xfa ELSE 1 ENDIF"], -["1", "IF 0xfb ELSE 1 ENDIF"], -["1", "IF 0xfc ELSE 1 ENDIF"], -["1", "IF 0xfd ELSE 1 ENDIF"], -["1", "IF 0xfe ELSE 1 ENDIF"], -["1", "IF 0xff ELSE 1 ENDIF"], +["0x50","1", "P2SH,STRICTENC", "opcode 0x50 is reserved"], +["1", "IF 0xba ELSE 1 ENDIF", "P2SH,STRICTENC", "opcodes above NOP10 invalid if executed"], +["1", "IF 0xbb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xbc ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xbd ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xbe ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xbf ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc1 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc2 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc3 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc4 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc5 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc6 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc7 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc8 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xc9 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xca ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xcb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xcc ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xcd ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xce ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xcf ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd1 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd2 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd3 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd4 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd5 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd6 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd7 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd8 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xd9 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xda ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xdb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xdc ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xdd ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xde ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xdf ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe1 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe2 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe3 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe4 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe5 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe6 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe7 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe8 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xe9 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xea ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xeb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xec ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xed ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xee ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xef ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf1 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf2 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf3 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf4 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf5 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf6 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf7 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf8 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xf9 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xfa ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xfb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xfc ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xfd ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xfe ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 0xff ELSE 1 ENDIF", "P2SH,STRICTENC"], -["1 IF 1 ELSE", "0xff ENDIF", "invalid because scriptSig and scriptPubKey are processed separately"], +["1 IF 1 ELSE", "0xff ENDIF", "P2SH,STRICTENC", "invalid because scriptSig and scriptPubKey are processed separately"], -["NOP", "RIPEMD160"], -["NOP", "SHA1"], -["NOP", "SHA256"], -["NOP", "HASH160"], -["NOP", "HASH256"], +["NOP", "RIPEMD160", "P2SH,STRICTENC"], +["NOP", "SHA1", "P2SH,STRICTENC"], +["NOP", "SHA256", "P2SH,STRICTENC"], +["NOP", "HASH160", "P2SH,STRICTENC"], +["NOP", "HASH256", "P2SH,STRICTENC"], ["NOP", "'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'", +"P2SH,STRICTENC", ">520 byte push"], ["0", "IF 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' ENDIF 1", +"P2SH,STRICTENC", ">520 byte push in non-executed IF branch"], ["1", "0x61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161", +"P2SH,STRICTENC", ">201 opcodes executed. 0x61 is NOP"], ["0", "IF 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 ENDIF 1", +"P2SH,STRICTENC", ">201 opcodes including non-executed IF branch. 0x61 is NOP"], ["1 2 3 4 5 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "1 2 3 4 5 6 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", +"P2SH,STRICTENC", ">1,000 stack size (0x6f is 3DUP)"], ["1 2 3 4 5 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "1 TOALTSTACK 2 TOALTSTACK 3 4 5 6 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", +"P2SH,STRICTENC", ">1,000 stack+altstack size"], ["NOP", "0 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f 2DUP 0x616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161", +"P2SH,STRICTENC", "10,001-byte scriptPubKey"], -["NOP1","NOP10"], +["NOP1","NOP10", "P2SH,STRICTENC"], -["1","VER", "OP_VER is reserved"], -["1","VERIF", "OP_VERIF is reserved"], -["1","VERNOTIF", "OP_VERNOTIF is reserved"], -["1","RESERVED", "OP_RESERVED is reserved"], -["1","RESERVED1", "OP_RESERVED1 is reserved"], -["1","RESERVED2", "OP_RESERVED2 is reserved"], -["1","0xba", "0xba == OP_NOP10 + 1"], +["1","VER", "P2SH,STRICTENC", "OP_VER is reserved"], +["1","VERIF", "P2SH,STRICTENC", "OP_VERIF is reserved"], +["1","VERNOTIF", "P2SH,STRICTENC", "OP_VERNOTIF is reserved"], +["1","RESERVED", "P2SH,STRICTENC", "OP_RESERVED is reserved"], +["1","RESERVED1", "P2SH,STRICTENC", "OP_RESERVED1 is reserved"], +["1","RESERVED2", "P2SH,STRICTENC", "OP_RESERVED2 is reserved"], +["1","0xba", "P2SH,STRICTENC", "0xba == OP_NOP10 + 1"], -["2147483648", "1ADD 1", "We cannot do math on 5-byte integers"], -["2147483648", "NEGATE 1", "We cannot do math on 5-byte integers"], -["-2147483648", "1ADD 1", "Because we use a sign bit, -2147483648 is also 5 bytes"], -["2147483647", "1ADD 1SUB 1", "We cannot do math on 5-byte integers, even if the result is 4-bytes"], -["2147483648", "1SUB 1", "We cannot do math on 5-byte integers, even if the result is 4-bytes"], +["2147483648", "1ADD 1", "P2SH,STRICTENC", "We cannot do math on 5-byte integers"], +["2147483648", "NEGATE 1", "P2SH,STRICTENC", "We cannot do math on 5-byte integers"], +["-2147483648", "1ADD 1", "P2SH,STRICTENC", "Because we use a sign bit, -2147483648 is also 5 bytes"], +["2147483647", "1ADD 1SUB 1", "P2SH,STRICTENC", "We cannot do math on 5-byte integers, even if the result is 4-bytes"], +["2147483648", "1SUB 1", "P2SH,STRICTENC", "We cannot do math on 5-byte integers, even if the result is 4-bytes"], -["2147483648 1", "BOOLOR 1", "We cannot do BOOLOR on 5-byte integers (but we can still do IF etc)"], -["2147483648 1", "BOOLAND 1", "We cannot do BOOLAND on 5-byte integers"], +["2147483648 1", "BOOLOR 1", "P2SH,STRICTENC", "We cannot do BOOLOR on 5-byte integers (but we can still do IF etc)"], +["2147483648 1", "BOOLAND 1", "P2SH,STRICTENC", "We cannot do BOOLAND on 5-byte integers"], -["1", "1 ENDIF", "ENDIF without IF"], -["1", "IF 1", "IF without ENDIF"], -["1 IF 1", "ENDIF", "IFs don't carry over"], +["1", "1 ENDIF", "P2SH,STRICTENC", "ENDIF without IF"], +["1", "IF 1", "P2SH,STRICTENC", "IF without ENDIF"], +["1 IF 1", "ENDIF", "P2SH,STRICTENC", "IFs don't carry over"], -["NOP", "IF 1 ENDIF", "The following tests check the if(stack.size() < N) tests in each opcode"], -["NOP", "NOTIF 1 ENDIF", "They are here to catch copy-and-paste errors"], -["NOP", "VERIFY 1", "Most of them are duplicated elsewhere,"], +["NOP", "IF 1 ENDIF", "P2SH,STRICTENC", "The following tests check the if(stack.size() < N) tests in each opcode"], +["NOP", "NOTIF 1 ENDIF", "P2SH,STRICTENC", "They are here to catch copy-and-paste errors"], +["NOP", "VERIFY 1", "P2SH,STRICTENC", "Most of them are duplicated elsewhere,"], -["NOP", "TOALTSTACK 1", "but, hey, more is always better, right?"], -["1", "FROMALTSTACK"], -["1", "2DROP 1"], -["1", "2DUP"], -["1 1", "3DUP"], -["1 1 1", "2OVER"], -["1 1 1 1 1", "2ROT"], -["1 1 1", "2SWAP"], -["NOP", "IFDUP 1"], -["NOP", "DROP 1"], -["NOP", "DUP 1"], -["1", "NIP"], -["1", "OVER"], -["1 1 1 3", "PICK"], -["0", "PICK 1"], -["1 1 1 3", "ROLL"], -["0", "ROLL 1"], -["1 1", "ROT"], -["1", "SWAP"], -["1", "TUCK"], +["NOP", "TOALTSTACK 1", "P2SH,STRICTENC", "but, hey, more is always better, right?"], +["1", "FROMALTSTACK", "P2SH,STRICTENC"], +["1", "2DROP 1", "P2SH,STRICTENC"], +["1", "2DUP", "P2SH,STRICTENC"], +["1 1", "3DUP", "P2SH,STRICTENC"], +["1 1 1", "2OVER", "P2SH,STRICTENC"], +["1 1 1 1 1", "2ROT", "P2SH,STRICTENC"], +["1 1 1", "2SWAP", "P2SH,STRICTENC"], +["NOP", "IFDUP 1", "P2SH,STRICTENC"], +["NOP", "DROP 1", "P2SH,STRICTENC"], +["NOP", "DUP 1", "P2SH,STRICTENC"], +["1", "NIP", "P2SH,STRICTENC"], +["1", "OVER", "P2SH,STRICTENC"], +["1 1 1 3", "PICK", "P2SH,STRICTENC"], +["0", "PICK 1", "P2SH,STRICTENC"], +["1 1 1 3", "ROLL", "P2SH,STRICTENC"], +["0", "ROLL 1", "P2SH,STRICTENC"], +["1 1", "ROT", "P2SH,STRICTENC"], +["1", "SWAP", "P2SH,STRICTENC"], +["1", "TUCK", "P2SH,STRICTENC"], -["NOP", "SIZE 1"], +["NOP", "SIZE 1", "P2SH,STRICTENC"], -["1", "EQUAL 1"], -["1", "EQUALVERIFY 1"], +["1", "EQUAL 1", "P2SH,STRICTENC"], +["1", "EQUALVERIFY 1", "P2SH,STRICTENC"], -["NOP", "1ADD 1"], -["NOP", "1SUB 1"], -["NOP", "NEGATE 1"], -["NOP", "ABS 1"], -["NOP", "NOT 1"], -["NOP", "0NOTEQUAL 1"], +["NOP", "1ADD 1", "P2SH,STRICTENC"], +["NOP", "1SUB 1", "P2SH,STRICTENC"], +["NOP", "NEGATE 1", "P2SH,STRICTENC"], +["NOP", "ABS 1", "P2SH,STRICTENC"], +["NOP", "NOT 1", "P2SH,STRICTENC"], +["NOP", "0NOTEQUAL 1", "P2SH,STRICTENC"], -["1", "ADD"], -["1", "SUB"], -["1", "BOOLAND"], -["1", "BOOLOR"], -["1", "NUMEQUAL"], -["1", "NUMEQUALVERIFY 1"], -["1", "NUMNOTEQUAL"], -["1", "LESSTHAN"], -["1", "GREATERTHAN"], -["1", "LESSTHANOREQUAL"], -["1", "GREATERTHANOREQUAL"], -["1", "MIN"], -["1", "MAX"], -["1 1", "WITHIN"], +["1", "ADD", "P2SH,STRICTENC"], +["1", "SUB", "P2SH,STRICTENC"], +["1", "BOOLAND", "P2SH,STRICTENC"], +["1", "BOOLOR", "P2SH,STRICTENC"], +["1", "NUMEQUAL", "P2SH,STRICTENC"], +["1", "NUMEQUALVERIFY 1", "P2SH,STRICTENC"], +["1", "NUMNOTEQUAL", "P2SH,STRICTENC"], +["1", "LESSTHAN", "P2SH,STRICTENC"], +["1", "GREATERTHAN", "P2SH,STRICTENC"], +["1", "LESSTHANOREQUAL", "P2SH,STRICTENC"], +["1", "GREATERTHANOREQUAL", "P2SH,STRICTENC"], +["1", "MIN", "P2SH,STRICTENC"], +["1", "MAX", "P2SH,STRICTENC"], +["1 1", "WITHIN", "P2SH,STRICTENC"], -["NOP", "RIPEMD160 1"], -["NOP", "SHA1 1"], -["NOP", "SHA256 1"], -["NOP", "HASH160 1"], -["NOP", "HASH256 1"], +["NOP", "RIPEMD160 1", "P2SH,STRICTENC"], +["NOP", "SHA1 1", "P2SH,STRICTENC"], +["NOP", "SHA256 1", "P2SH,STRICTENC"], +["NOP", "HASH160 1", "P2SH,STRICTENC"], +["NOP", "HASH256 1", "P2SH,STRICTENC"], ["", "0 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG", +"P2SH,STRICTENC", "202 CHECKMULTISIGS, fails due to 201 op limit"], ["1", -"0 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY"], +"0 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY", +"P2SH,STRICTENC"], ["", "NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG", +"P2SH,STRICTENC", "Fails due to 201 sig op limit"], ["1", -"NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY"], +"NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY", +"P2SH,STRICTENC"], -["0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21", "21 CHECKMULTISIG 1", "nPubKeys > 20"], -["0 'sig' 1 0", "CHECKMULTISIG 1", "nSigs > nPubKeys"], +["0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21", "21 CHECKMULTISIG 1", "P2SH,STRICTENC", "nPubKeys > 20"], +["0 'sig' 1 0", "CHECKMULTISIG 1", "P2SH,STRICTENC", "nSigs > nPubKeys"], -["NOP 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL", "Tests for Script.IsPushOnly()"], -["NOP1 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL"], +["NOP 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL", "P2SH,STRICTENC", "Tests for Script.IsPushOnly()"], +["NOP1 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL", "P2SH,STRICTENC"], -["0 0x01 0x50", "HASH160 0x14 0xece424a6bb6ddf4db592c0faed60685047a361b1 EQUAL", "OP_RESERVED in P2SH should fail"], -["0 0x01 VER", "HASH160 0x14 0x0f4d7845db968f2a81b530b6f3c1d6246d4c7e01 EQUAL", "OP_VER in P2SH should fail"], +["0 0x01 0x50", "HASH160 0x14 0xece424a6bb6ddf4db592c0faed60685047a361b1 EQUAL", "P2SH,STRICTENC", "OP_RESERVED in P2SH should fail"], +["0 0x01 VER", "HASH160 0x14 0x0f4d7845db968f2a81b530b6f3c1d6246d4c7e01 EQUAL", "P2SH,STRICTENC", "OP_VER in P2SH should fail"], -["0x00", "'00' EQUAL", "Basic OP_0 execution"] +["0x00", "'00' EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"] ] diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index 082c65efed..c1db4c6061 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -1,510 +1,522 @@ [ -["", "DEPTH 0 EQUAL", "Test the test: we should have an empty stack after scriptSig evaluation"], -[" ", "DEPTH 0 EQUAL", "and multiple spaces should not change that."], -[" ", "DEPTH 0 EQUAL"], -[" ", "DEPTH 0 EQUAL"], -["1 2", "2 EQUALVERIFY 1 EQUAL", "Similarly whitespace around and between symbols"], -["1 2", "2 EQUALVERIFY 1 EQUAL"], -[" 1 2", "2 EQUALVERIFY 1 EQUAL"], -["1 2 ", "2 EQUALVERIFY 1 EQUAL"], -[" 1 2 ", "2 EQUALVERIFY 1 EQUAL"], +["", "DEPTH 0 EQUAL", "P2SH,STRICTENC", "Test the test: we should have an empty stack after scriptSig evaluation"], +[" ", "DEPTH 0 EQUAL", "P2SH,STRICTENC", "and multiple spaces should not change that."], +[" ", "DEPTH 0 EQUAL", "P2SH,STRICTENC"], +[" ", "DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["1 2", "2 EQUALVERIFY 1 EQUAL", "P2SH,STRICTENC", "Similarly whitespace around and between symbols"], +["1 2", "2 EQUALVERIFY 1 EQUAL", "P2SH,STRICTENC"], +[" 1 2", "2 EQUALVERIFY 1 EQUAL", "P2SH,STRICTENC"], +["1 2 ", "2 EQUALVERIFY 1 EQUAL", "P2SH,STRICTENC"], +[" 1 2 ", "2 EQUALVERIFY 1 EQUAL", "P2SH,STRICTENC"], -["1", ""], -["0x02 0x01 0x00", "", "all bytes are significant, not only the last one"], -["0x09 0x00000000 0x00000000 0x10", "", "equals zero when cast to Int64"], +["1", "", "P2SH,STRICTENC"], +["0x02 0x01 0x00", "", "P2SH,STRICTENC", "all bytes are significant, not only the last one"], +["0x09 0x00000000 0x00000000 0x10", "", "P2SH,STRICTENC", "equals zero when cast to Int64"], -["0x01 0x0b", "11 EQUAL", "push 1 byte"], -["0x02 0x417a", "'Az' EQUAL"], +["0x01 0x0b", "11 EQUAL", "P2SH,STRICTENC", "push 1 byte"], +["0x02 0x417a", "'Az' EQUAL", "P2SH,STRICTENC"], ["0x4b 0x417a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a", - "'Azzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz' EQUAL", "push 75 bytes"], + "'Azzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz' EQUAL", "P2SH,STRICTENC", "push 75 bytes"], -["0x4c 0x01 0x07","7 EQUAL", "0x4c is OP_PUSHDATA1"], -["0x4d 0x0100 0x08","8 EQUAL", "0x4d is OP_PUSHDATA2"], -["0x4e 0x01000000 0x09","9 EQUAL", "0x4e is OP_PUSHDATA4"], +["0x4c 0x01 0x07","7 EQUAL", "P2SH,STRICTENC", "0x4c is OP_PUSHDATA1"], +["0x4d 0x0100 0x08","8 EQUAL", "P2SH,STRICTENC", "0x4d is OP_PUSHDATA2"], +["0x4e 0x01000000 0x09","9 EQUAL", "P2SH,STRICTENC", "0x4e is OP_PUSHDATA4"], -["0x4c 0x00","0 EQUAL"], -["0x4d 0x0000","0 EQUAL"], -["0x4e 0x00000000","0 EQUAL"], -["0x4f 1000 ADD","999 EQUAL"], -["0", "IF 0x50 ENDIF 1", "0x50 is reserved (ok if not executed)"], -["0x51", "0x5f ADD 0x60 EQUAL", "0x51 through 0x60 push 1 through 16 onto stack"], -["1","NOP"], -["0", "IF VER ELSE 1 ENDIF", "VER non-functional (ok if not executed)"], -["0", "IF RESERVED RESERVED1 RESERVED2 ELSE 1 ENDIF", "RESERVED ok in un-executed IF"], +["0x4c 0x00","0 EQUAL", "P2SH,STRICTENC"], +["0x4d 0x0000","0 EQUAL", "P2SH,STRICTENC"], +["0x4e 0x00000000","0 EQUAL", "P2SH,STRICTENC"], +["0x4f 1000 ADD","999 EQUAL", "P2SH,STRICTENC"], +["0", "IF 0x50 ENDIF 1", "P2SH,STRICTENC", "0x50 is reserved (ok if not executed)"], +["0x51", "0x5f ADD 0x60 EQUAL", "P2SH,STRICTENC", "0x51 through 0x60 push 1 through 16 onto stack"], +["1","NOP", "P2SH,STRICTENC"], +["0", "IF VER ELSE 1 ENDIF", "P2SH,STRICTENC", "VER non-functional (ok if not executed)"], +["0", "IF RESERVED RESERVED1 RESERVED2 ELSE 1 ENDIF", "P2SH,STRICTENC", "RESERVED ok in un-executed IF"], -["1", "DUP IF ENDIF"], -["1", "IF 1 ENDIF"], -["1", "DUP IF ELSE ENDIF"], -["1", "IF 1 ELSE ENDIF"], -["0", "IF ELSE 1 ENDIF"], +["1", "DUP IF ENDIF", "P2SH,STRICTENC"], +["1", "IF 1 ENDIF", "P2SH,STRICTENC"], +["1", "DUP IF ELSE ENDIF", "P2SH,STRICTENC"], +["1", "IF 1 ELSE ENDIF", "P2SH,STRICTENC"], +["0", "IF ELSE 1 ENDIF", "P2SH,STRICTENC"], -["1 1", "IF IF 1 ELSE 0 ENDIF ENDIF"], -["1 0", "IF IF 1 ELSE 0 ENDIF ENDIF"], -["1 1", "IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF"], -["0 0", "IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF"], +["1 1", "IF IF 1 ELSE 0 ENDIF ENDIF", "P2SH,STRICTENC"], +["1 0", "IF IF 1 ELSE 0 ENDIF ENDIF", "P2SH,STRICTENC"], +["1 1", "IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "P2SH,STRICTENC"], +["0 0", "IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "P2SH,STRICTENC"], -["1 0", "NOTIF IF 1 ELSE 0 ENDIF ENDIF"], -["1 1", "NOTIF IF 1 ELSE 0 ENDIF ENDIF"], -["1 0", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF"], -["0 1", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF"], +["1 0", "NOTIF IF 1 ELSE 0 ENDIF ENDIF", "P2SH,STRICTENC"], +["1 1", "NOTIF IF 1 ELSE 0 ENDIF ENDIF", "P2SH,STRICTENC"], +["1 0", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "P2SH,STRICTENC"], +["0 1", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "P2SH,STRICTENC"], -["0", "IF 0 ELSE 1 ELSE 0 ENDIF", "Multiple ELSE's are valid and executed inverts on each ELSE encountered"], -["1", "IF 1 ELSE 0 ELSE ENDIF"], -["1", "IF ELSE 0 ELSE 1 ENDIF"], -["1", "IF 1 ELSE 0 ELSE 1 ENDIF ADD 2 EQUAL"], -["'' 1", "IF SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ENDIF 0x14 0x68ca4fec736264c13b859bac43d5173df6871682 EQUAL"], +["0", "IF 0 ELSE 1 ELSE 0 ENDIF", "P2SH,STRICTENC", "Multiple ELSE's are valid and executed inverts on each ELSE encountered"], +["1", "IF 1 ELSE 0 ELSE ENDIF", "P2SH,STRICTENC"], +["1", "IF ELSE 0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["1", "IF 1 ELSE 0 ELSE 1 ENDIF ADD 2 EQUAL", "P2SH,STRICTENC"], +["'' 1", "IF SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ENDIF 0x14 0x68ca4fec736264c13b859bac43d5173df6871682 EQUAL", "P2SH,STRICTENC"], -["1", "NOTIF 0 ELSE 1 ELSE 0 ENDIF", "Multiple ELSE's are valid and execution inverts on each ELSE encountered"], -["0", "NOTIF 1 ELSE 0 ELSE ENDIF"], -["0", "NOTIF ELSE 0 ELSE 1 ENDIF"], -["0", "NOTIF 1 ELSE 0 ELSE 1 ENDIF ADD 2 EQUAL"], -["'' 0", "NOTIF SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ENDIF 0x14 0x68ca4fec736264c13b859bac43d5173df6871682 EQUAL"], +["1", "NOTIF 0 ELSE 1 ELSE 0 ENDIF", "P2SH,STRICTENC", "Multiple ELSE's are valid and execution inverts on each ELSE encountered"], +["0", "NOTIF 1 ELSE 0 ELSE ENDIF", "P2SH,STRICTENC"], +["0", "NOTIF ELSE 0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "NOTIF 1 ELSE 0 ELSE 1 ENDIF ADD 2 EQUAL", "P2SH,STRICTENC"], +["'' 0", "NOTIF SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ENDIF 0x14 0x68ca4fec736264c13b859bac43d5173df6871682 EQUAL", "P2SH,STRICTENC"], -["0", "IF 1 IF RETURN ELSE RETURN ELSE RETURN ENDIF ELSE 1 IF 1 ELSE RETURN ELSE 1 ENDIF ELSE RETURN ENDIF ADD 2 EQUAL", "Nested ELSE ELSE"], -["1", "NOTIF 0 NOTIF RETURN ELSE RETURN ELSE RETURN ENDIF ELSE 0 NOTIF 1 ELSE RETURN ELSE 1 ENDIF ELSE RETURN ENDIF ADD 2 EQUAL"], +["0", "IF 1 IF RETURN ELSE RETURN ELSE RETURN ENDIF ELSE 1 IF 1 ELSE RETURN ELSE 1 ENDIF ELSE RETURN ENDIF ADD 2 EQUAL", "P2SH,STRICTENC", "Nested ELSE ELSE"], +["1", "NOTIF 0 NOTIF RETURN ELSE RETURN ELSE RETURN ENDIF ELSE 0 NOTIF 1 ELSE RETURN ELSE 1 ENDIF ELSE RETURN ENDIF ADD 2 EQUAL", "P2SH,STRICTENC"], -["0", "IF RETURN ENDIF 1", "RETURN only works if executed"], +["0", "IF RETURN ENDIF 1", "P2SH,STRICTENC", "RETURN only works if executed"], -["1 1", "VERIFY"], -["1 0x05 0x01 0x00 0x00 0x00 0x00", "VERIFY", "values >4 bytes can be cast to boolean"], +["1 1", "VERIFY", "P2SH,STRICTENC"], +["1 0x05 0x01 0x00 0x00 0x00 0x00", "VERIFY", "P2SH,STRICTENC", "values >4 bytes can be cast to boolean"], -["10 0 11 TOALTSTACK DROP FROMALTSTACK", "ADD 21 EQUAL"], -["'gavin_was_here' TOALTSTACK 11 FROMALTSTACK", "'gavin_was_here' EQUALVERIFY 11 EQUAL"], +["10 0 11 TOALTSTACK DROP FROMALTSTACK", "ADD 21 EQUAL", "P2SH,STRICTENC"], +["'gavin_was_here' TOALTSTACK 11 FROMALTSTACK", "'gavin_was_here' EQUALVERIFY 11 EQUAL", "P2SH,STRICTENC"], -["0 IFDUP", "DEPTH 1 EQUALVERIFY 0 EQUAL"], -["1 IFDUP", "DEPTH 2 EQUALVERIFY 1 EQUALVERIFY 1 EQUAL"], -["0 DROP", "DEPTH 0 EQUAL"], -["0", "DUP 1 ADD 1 EQUALVERIFY 0 EQUAL"], -["0 1", "NIP"], -["1 0", "OVER DEPTH 3 EQUALVERIFY"], -["22 21 20", "0 PICK 20 EQUALVERIFY DEPTH 3 EQUAL"], -["22 21 20", "1 PICK 21 EQUALVERIFY DEPTH 3 EQUAL"], -["22 21 20", "2 PICK 22 EQUALVERIFY DEPTH 3 EQUAL"], -["22 21 20", "0 ROLL 20 EQUALVERIFY DEPTH 2 EQUAL"], -["22 21 20", "1 ROLL 21 EQUALVERIFY DEPTH 2 EQUAL"], -["22 21 20", "2 ROLL 22 EQUALVERIFY DEPTH 2 EQUAL"], -["22 21 20", "ROT 22 EQUAL"], -["22 21 20", "ROT DROP 20 EQUAL"], -["22 21 20", "ROT DROP DROP 21 EQUAL"], -["22 21 20", "ROT ROT 21 EQUAL"], -["22 21 20", "ROT ROT ROT 20 EQUAL"], -["25 24 23 22 21 20", "2ROT 24 EQUAL"], -["25 24 23 22 21 20", "2ROT DROP 25 EQUAL"], -["25 24 23 22 21 20", "2ROT 2DROP 20 EQUAL"], -["25 24 23 22 21 20", "2ROT 2DROP DROP 21 EQUAL"], -["25 24 23 22 21 20", "2ROT 2DROP 2DROP 22 EQUAL"], -["25 24 23 22 21 20", "2ROT 2DROP 2DROP DROP 23 EQUAL"], -["25 24 23 22 21 20", "2ROT 2ROT 22 EQUAL"], -["25 24 23 22 21 20", "2ROT 2ROT 2ROT 20 EQUAL"], -["1 0", "SWAP 1 EQUALVERIFY 0 EQUAL"], -["0 1", "TUCK DEPTH 3 EQUALVERIFY SWAP 2DROP"], -["13 14", "2DUP ROT EQUALVERIFY EQUAL"], -["-1 0 1 2", "3DUP DEPTH 7 EQUALVERIFY ADD ADD 3 EQUALVERIFY 2DROP 0 EQUALVERIFY"], -["1 2 3 5", "2OVER ADD ADD 8 EQUALVERIFY ADD ADD 6 EQUAL"], -["1 3 5 7", "2SWAP ADD 4 EQUALVERIFY ADD 12 EQUAL"], -["0", "SIZE 0 EQUAL"], -["1", "SIZE 1 EQUAL"], -["127", "SIZE 1 EQUAL"], -["128", "SIZE 2 EQUAL"], -["32767", "SIZE 2 EQUAL"], -["32768", "SIZE 3 EQUAL"], -["8388607", "SIZE 3 EQUAL"], -["8388608", "SIZE 4 EQUAL"], -["2147483647", "SIZE 4 EQUAL"], -["2147483648", "SIZE 5 EQUAL"], -["549755813887", "SIZE 5 EQUAL"], -["549755813888", "SIZE 6 EQUAL"], -["9223372036854775807", "SIZE 8 EQUAL"], -["-1", "SIZE 1 EQUAL"], -["-127", "SIZE 1 EQUAL"], -["-128", "SIZE 2 EQUAL"], -["-32767", "SIZE 2 EQUAL"], -["-32768", "SIZE 3 EQUAL"], -["-8388607", "SIZE 3 EQUAL"], -["-8388608", "SIZE 4 EQUAL"], -["-2147483647", "SIZE 4 EQUAL"], -["-2147483648", "SIZE 5 EQUAL"], -["-549755813887", "SIZE 5 EQUAL"], -["-549755813888", "SIZE 6 EQUAL"], -["-9223372036854775807", "SIZE 8 EQUAL"], -["'abcdefghijklmnopqrstuvwxyz'", "SIZE 26 EQUAL"], +["0 IFDUP", "DEPTH 1 EQUALVERIFY 0 EQUAL", "P2SH,STRICTENC"], +["1 IFDUP", "DEPTH 2 EQUALVERIFY 1 EQUALVERIFY 1 EQUAL", "P2SH,STRICTENC"], +["0 DROP", "DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["0", "DUP 1 ADD 1 EQUALVERIFY 0 EQUAL", "P2SH,STRICTENC"], +["0 1", "NIP", "P2SH,STRICTENC"], +["1 0", "OVER DEPTH 3 EQUALVERIFY", "P2SH,STRICTENC"], +["22 21 20", "0 PICK 20 EQUALVERIFY DEPTH 3 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "1 PICK 21 EQUALVERIFY DEPTH 3 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "2 PICK 22 EQUALVERIFY DEPTH 3 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "0 ROLL 20 EQUALVERIFY DEPTH 2 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "1 ROLL 21 EQUALVERIFY DEPTH 2 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "2 ROLL 22 EQUALVERIFY DEPTH 2 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "ROT 22 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "ROT DROP 20 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "ROT DROP DROP 21 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "ROT ROT 21 EQUAL", "P2SH,STRICTENC"], +["22 21 20", "ROT ROT ROT 20 EQUAL", "P2SH,STRICTENC"], +["25 24 23 22 21 20", "2ROT 24 EQUAL", "P2SH,STRICTENC"], +["25 24 23 22 21 20", "2ROT DROP 25 EQUAL", "P2SH,STRICTENC"], +["25 24 23 22 21 20", "2ROT 2DROP 20 EQUAL", "P2SH,STRICTENC"], +["25 24 23 22 21 20", "2ROT 2DROP DROP 21 EQUAL", "P2SH,STRICTENC"], +["25 24 23 22 21 20", "2ROT 2DROP 2DROP 22 EQUAL", "P2SH,STRICTENC"], +["25 24 23 22 21 20", "2ROT 2DROP 2DROP DROP 23 EQUAL", "P2SH,STRICTENC"], +["25 24 23 22 21 20", "2ROT 2ROT 22 EQUAL", "P2SH,STRICTENC"], +["25 24 23 22 21 20", "2ROT 2ROT 2ROT 20 EQUAL", "P2SH,STRICTENC"], +["1 0", "SWAP 1 EQUALVERIFY 0 EQUAL", "P2SH,STRICTENC"], +["0 1", "TUCK DEPTH 3 EQUALVERIFY SWAP 2DROP", "P2SH,STRICTENC"], +["13 14", "2DUP ROT EQUALVERIFY EQUAL", "P2SH,STRICTENC"], +["-1 0 1 2", "3DUP DEPTH 7 EQUALVERIFY ADD ADD 3 EQUALVERIFY 2DROP 0 EQUALVERIFY", "P2SH,STRICTENC"], +["1 2 3 5", "2OVER ADD ADD 8 EQUALVERIFY ADD ADD 6 EQUAL", "P2SH,STRICTENC"], +["1 3 5 7", "2SWAP ADD 4 EQUALVERIFY ADD 12 EQUAL", "P2SH,STRICTENC"], +["0", "SIZE 0 EQUAL", "P2SH,STRICTENC"], +["1", "SIZE 1 EQUAL", "P2SH,STRICTENC"], +["127", "SIZE 1 EQUAL", "P2SH,STRICTENC"], +["128", "SIZE 2 EQUAL", "P2SH,STRICTENC"], +["32767", "SIZE 2 EQUAL", "P2SH,STRICTENC"], +["32768", "SIZE 3 EQUAL", "P2SH,STRICTENC"], +["8388607", "SIZE 3 EQUAL", "P2SH,STRICTENC"], +["8388608", "SIZE 4 EQUAL", "P2SH,STRICTENC"], +["2147483647", "SIZE 4 EQUAL", "P2SH,STRICTENC"], +["2147483648", "SIZE 5 EQUAL", "P2SH,STRICTENC"], +["549755813887", "SIZE 5 EQUAL", "P2SH,STRICTENC"], +["549755813888", "SIZE 6 EQUAL", "P2SH,STRICTENC"], +["9223372036854775807", "SIZE 8 EQUAL", "P2SH,STRICTENC"], +["-1", "SIZE 1 EQUAL", "P2SH,STRICTENC"], +["-127", "SIZE 1 EQUAL", "P2SH,STRICTENC"], +["-128", "SIZE 2 EQUAL", "P2SH,STRICTENC"], +["-32767", "SIZE 2 EQUAL", "P2SH,STRICTENC"], +["-32768", "SIZE 3 EQUAL", "P2SH,STRICTENC"], +["-8388607", "SIZE 3 EQUAL", "P2SH,STRICTENC"], +["-8388608", "SIZE 4 EQUAL", "P2SH,STRICTENC"], +["-2147483647", "SIZE 4 EQUAL", "P2SH,STRICTENC"], +["-2147483648", "SIZE 5 EQUAL", "P2SH,STRICTENC"], +["-549755813887", "SIZE 5 EQUAL", "P2SH,STRICTENC"], +["-549755813888", "SIZE 6 EQUAL", "P2SH,STRICTENC"], +["-9223372036854775807", "SIZE 8 EQUAL", "P2SH,STRICTENC"], +["'abcdefghijklmnopqrstuvwxyz'", "SIZE 26 EQUAL", "P2SH,STRICTENC"], -["42", "SIZE 1 EQUALVERIFY 42 EQUAL", "SIZE does not consume argument"], +["42", "SIZE 1 EQUALVERIFY 42 EQUAL", "P2SH,STRICTENC", "SIZE does not consume argument"], -["2 -2 ADD", "0 EQUAL"], -["2147483647 -2147483647 ADD", "0 EQUAL"], -["-1 -1 ADD", "-2 EQUAL"], +["2 -2 ADD", "0 EQUAL", "P2SH,STRICTENC"], +["2147483647 -2147483647 ADD", "0 EQUAL", "P2SH,STRICTENC"], +["-1 -1 ADD", "-2 EQUAL", "P2SH,STRICTENC"], -["0 0","EQUAL"], -["1 1 ADD", "2 EQUAL"], -["1 1ADD", "2 EQUAL"], -["111 1SUB", "110 EQUAL"], -["111 1 ADD 12 SUB", "100 EQUAL"], -["0 ABS", "0 EQUAL"], -["16 ABS", "16 EQUAL"], -["-16 ABS", "-16 NEGATE EQUAL"], -["0 NOT", "NOP"], -["1 NOT", "0 EQUAL"], -["11 NOT", "0 EQUAL"], -["0 0NOTEQUAL", "0 EQUAL"], -["1 0NOTEQUAL", "1 EQUAL"], -["111 0NOTEQUAL", "1 EQUAL"], -["-111 0NOTEQUAL", "1 EQUAL"], -["1 1 BOOLAND", "NOP"], -["1 0 BOOLAND", "NOT"], -["0 1 BOOLAND", "NOT"], -["0 0 BOOLAND", "NOT"], -["16 17 BOOLAND", "NOP"], -["1 1 BOOLOR", "NOP"], -["1 0 BOOLOR", "NOP"], -["0 1 BOOLOR", "NOP"], -["0 0 BOOLOR", "NOT"], -["16 17 BOOLOR", "NOP"], -["11 10 1 ADD", "NUMEQUAL"], -["11 10 1 ADD", "NUMEQUALVERIFY 1"], -["11 10 1 ADD", "NUMNOTEQUAL NOT"], -["111 10 1 ADD", "NUMNOTEQUAL"], -["11 10", "LESSTHAN NOT"], -["4 4", "LESSTHAN NOT"], -["10 11", "LESSTHAN"], -["-11 11", "LESSTHAN"], -["-11 -10", "LESSTHAN"], -["11 10", "GREATERTHAN"], -["4 4", "GREATERTHAN NOT"], -["10 11", "GREATERTHAN NOT"], -["-11 11", "GREATERTHAN NOT"], -["-11 -10", "GREATERTHAN NOT"], -["11 10", "LESSTHANOREQUAL NOT"], -["4 4", "LESSTHANOREQUAL"], -["10 11", "LESSTHANOREQUAL"], -["-11 11", "LESSTHANOREQUAL"], -["-11 -10", "LESSTHANOREQUAL"], -["11 10", "GREATERTHANOREQUAL"], -["4 4", "GREATERTHANOREQUAL"], -["10 11", "GREATERTHANOREQUAL NOT"], -["-11 11", "GREATERTHANOREQUAL NOT"], -["-11 -10", "GREATERTHANOREQUAL NOT"], -["1 0 MIN", "0 NUMEQUAL"], -["0 1 MIN", "0 NUMEQUAL"], -["-1 0 MIN", "-1 NUMEQUAL"], -["0 -2147483647 MIN", "-2147483647 NUMEQUAL"], -["2147483647 0 MAX", "2147483647 NUMEQUAL"], -["0 100 MAX", "100 NUMEQUAL"], -["-100 0 MAX", "0 NUMEQUAL"], -["0 -2147483647 MAX", "0 NUMEQUAL"], -["0 0 1", "WITHIN"], -["1 0 1", "WITHIN NOT"], -["0 -2147483647 2147483647", "WITHIN"], -["-1 -100 100", "WITHIN"], -["11 -100 100", "WITHIN"], -["-2147483647 -100 100", "WITHIN NOT"], -["2147483647 -100 100", "WITHIN NOT"], +["0 0","EQUAL", "P2SH,STRICTENC"], +["1 1 ADD", "2 EQUAL", "P2SH,STRICTENC"], +["1 1ADD", "2 EQUAL", "P2SH,STRICTENC"], +["111 1SUB", "110 EQUAL", "P2SH,STRICTENC"], +["111 1 ADD 12 SUB", "100 EQUAL", "P2SH,STRICTENC"], +["0 ABS", "0 EQUAL", "P2SH,STRICTENC"], +["16 ABS", "16 EQUAL", "P2SH,STRICTENC"], +["-16 ABS", "-16 NEGATE EQUAL", "P2SH,STRICTENC"], +["0 NOT", "NOP", "P2SH,STRICTENC"], +["1 NOT", "0 EQUAL", "P2SH,STRICTENC"], +["11 NOT", "0 EQUAL", "P2SH,STRICTENC"], +["0 0NOTEQUAL", "0 EQUAL", "P2SH,STRICTENC"], +["1 0NOTEQUAL", "1 EQUAL", "P2SH,STRICTENC"], +["111 0NOTEQUAL", "1 EQUAL", "P2SH,STRICTENC"], +["-111 0NOTEQUAL", "1 EQUAL", "P2SH,STRICTENC"], +["1 1 BOOLAND", "NOP", "P2SH,STRICTENC"], +["1 0 BOOLAND", "NOT", "P2SH,STRICTENC"], +["0 1 BOOLAND", "NOT", "P2SH,STRICTENC"], +["0 0 BOOLAND", "NOT", "P2SH,STRICTENC"], +["16 17 BOOLAND", "NOP", "P2SH,STRICTENC"], +["1 1 BOOLOR", "NOP", "P2SH,STRICTENC"], +["1 0 BOOLOR", "NOP", "P2SH,STRICTENC"], +["0 1 BOOLOR", "NOP", "P2SH,STRICTENC"], +["0 0 BOOLOR", "NOT", "P2SH,STRICTENC"], +["16 17 BOOLOR", "NOP", "P2SH,STRICTENC"], +["11 10 1 ADD", "NUMEQUAL", "P2SH,STRICTENC"], +["11 10 1 ADD", "NUMEQUALVERIFY 1", "P2SH,STRICTENC"], +["11 10 1 ADD", "NUMNOTEQUAL NOT", "P2SH,STRICTENC"], +["111 10 1 ADD", "NUMNOTEQUAL", "P2SH,STRICTENC"], +["11 10", "LESSTHAN NOT", "P2SH,STRICTENC"], +["4 4", "LESSTHAN NOT", "P2SH,STRICTENC"], +["10 11", "LESSTHAN", "P2SH,STRICTENC"], +["-11 11", "LESSTHAN", "P2SH,STRICTENC"], +["-11 -10", "LESSTHAN", "P2SH,STRICTENC"], +["11 10", "GREATERTHAN", "P2SH,STRICTENC"], +["4 4", "GREATERTHAN NOT", "P2SH,STRICTENC"], +["10 11", "GREATERTHAN NOT", "P2SH,STRICTENC"], +["-11 11", "GREATERTHAN NOT", "P2SH,STRICTENC"], +["-11 -10", "GREATERTHAN NOT", "P2SH,STRICTENC"], +["11 10", "LESSTHANOREQUAL NOT", "P2SH,STRICTENC"], +["4 4", "LESSTHANOREQUAL", "P2SH,STRICTENC"], +["10 11", "LESSTHANOREQUAL", "P2SH,STRICTENC"], +["-11 11", "LESSTHANOREQUAL", "P2SH,STRICTENC"], +["-11 -10", "LESSTHANOREQUAL", "P2SH,STRICTENC"], +["11 10", "GREATERTHANOREQUAL", "P2SH,STRICTENC"], +["4 4", "GREATERTHANOREQUAL", "P2SH,STRICTENC"], +["10 11", "GREATERTHANOREQUAL NOT", "P2SH,STRICTENC"], +["-11 11", "GREATERTHANOREQUAL NOT", "P2SH,STRICTENC"], +["-11 -10", "GREATERTHANOREQUAL NOT", "P2SH,STRICTENC"], +["1 0 MIN", "0 NUMEQUAL", "P2SH,STRICTENC"], +["0 1 MIN", "0 NUMEQUAL", "P2SH,STRICTENC"], +["-1 0 MIN", "-1 NUMEQUAL", "P2SH,STRICTENC"], +["0 -2147483647 MIN", "-2147483647 NUMEQUAL", "P2SH,STRICTENC"], +["2147483647 0 MAX", "2147483647 NUMEQUAL", "P2SH,STRICTENC"], +["0 100 MAX", "100 NUMEQUAL", "P2SH,STRICTENC"], +["-100 0 MAX", "0 NUMEQUAL", "P2SH,STRICTENC"], +["0 -2147483647 MAX", "0 NUMEQUAL", "P2SH,STRICTENC"], +["0 0 1", "WITHIN", "P2SH,STRICTENC"], +["1 0 1", "WITHIN NOT", "P2SH,STRICTENC"], +["0 -2147483647 2147483647", "WITHIN", "P2SH,STRICTENC"], +["-1 -100 100", "WITHIN", "P2SH,STRICTENC"], +["11 -100 100", "WITHIN", "P2SH,STRICTENC"], +["-2147483647 -100 100", "WITHIN NOT", "P2SH,STRICTENC"], +["2147483647 -100 100", "WITHIN NOT", "P2SH,STRICTENC"], -["2147483647 2147483647 SUB", "0 EQUAL"], -["2147483647 DUP ADD", "4294967294 EQUAL", ">32 bit EQUAL is valid"], -["2147483647 NEGATE DUP ADD", "-4294967294 EQUAL"], +["2147483647 2147483647 SUB", "0 EQUAL", "P2SH,STRICTENC"], +["2147483647 DUP ADD", "4294967294 EQUAL", "P2SH,STRICTENC", ">32 bit EQUAL is valid"], +["2147483647 NEGATE DUP ADD", "-4294967294 EQUAL", "P2SH,STRICTENC"], -["''", "RIPEMD160 0x14 0x9c1185a5c5e9fc54612808977ee8f548b2258d31 EQUAL"], -["'a'", "RIPEMD160 0x14 0x0bdc9d2d256b3ee9daae347be6f4dc835a467ffe EQUAL"], -["'abcdefghijklmnopqrstuvwxyz'", "RIPEMD160 0x14 0xf71c27109c692c1b56bbdceb5b9d2865b3708dbc EQUAL"], -["''", "SHA1 0x14 0xda39a3ee5e6b4b0d3255bfef95601890afd80709 EQUAL"], -["'a'", "SHA1 0x14 0x86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 EQUAL"], -["'abcdefghijklmnopqrstuvwxyz'", "SHA1 0x14 0x32d10c7b8cf96570ca04ce37f2a19d84240d3a89 EQUAL"], -["''", "SHA256 0x20 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 EQUAL"], -["'a'", "SHA256 0x20 0xca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb EQUAL"], -["'abcdefghijklmnopqrstuvwxyz'", "SHA256 0x20 0x71c480df93d6ae2f1efad1447c66c9525e316218cf51fc8d9ed832f2daf18b73 EQUAL"], -["''", "DUP HASH160 SWAP SHA256 RIPEMD160 EQUAL"], -["''", "DUP HASH256 SWAP SHA256 SHA256 EQUAL"], -["''", "NOP HASH160 0x14 0xb472a266d0bd89c13706a4132ccfb16f7c3b9fcb EQUAL"], -["'a'", "HASH160 NOP 0x14 0x994355199e516ff76c4fa4aab39337b9d84cf12b EQUAL"], -["'abcdefghijklmnopqrstuvwxyz'", "HASH160 0x4c 0x14 0xc286a1af0947f58d1ad787385b1c2c4a976f9e71 EQUAL"], -["''", "HASH256 0x20 0x5df6e0e2761359d30a8275058e299fcc0381534545f55cf43e41983f5d4c9456 EQUAL"], -["'a'", "HASH256 0x20 0xbf5d3affb73efd2ec6c36ad3112dd933efed63c4e1cbffcfa88e2759c144f2d8 EQUAL"], -["'abcdefghijklmnopqrstuvwxyz'", "HASH256 0x4c 0x20 0xca139bc10c2f660da42666f72e89a225936fc60f193c161124a672050c434671 EQUAL"], +["''", "RIPEMD160 0x14 0x9c1185a5c5e9fc54612808977ee8f548b2258d31 EQUAL", "P2SH,STRICTENC"], +["'a'", "RIPEMD160 0x14 0x0bdc9d2d256b3ee9daae347be6f4dc835a467ffe EQUAL", "P2SH,STRICTENC"], +["'abcdefghijklmnopqrstuvwxyz'", "RIPEMD160 0x14 0xf71c27109c692c1b56bbdceb5b9d2865b3708dbc EQUAL", "P2SH,STRICTENC"], +["''", "SHA1 0x14 0xda39a3ee5e6b4b0d3255bfef95601890afd80709 EQUAL", "P2SH,STRICTENC"], +["'a'", "SHA1 0x14 0x86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 EQUAL", "P2SH,STRICTENC"], +["'abcdefghijklmnopqrstuvwxyz'", "SHA1 0x14 0x32d10c7b8cf96570ca04ce37f2a19d84240d3a89 EQUAL", "P2SH,STRICTENC"], +["''", "SHA256 0x20 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 EQUAL", "P2SH,STRICTENC"], +["'a'", "SHA256 0x20 0xca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb EQUAL", "P2SH,STRICTENC"], +["'abcdefghijklmnopqrstuvwxyz'", "SHA256 0x20 0x71c480df93d6ae2f1efad1447c66c9525e316218cf51fc8d9ed832f2daf18b73 EQUAL", "P2SH,STRICTENC"], +["''", "DUP HASH160 SWAP SHA256 RIPEMD160 EQUAL", "P2SH,STRICTENC"], +["''", "DUP HASH256 SWAP SHA256 SHA256 EQUAL", "P2SH,STRICTENC"], +["''", "NOP HASH160 0x14 0xb472a266d0bd89c13706a4132ccfb16f7c3b9fcb EQUAL", "P2SH,STRICTENC"], +["'a'", "HASH160 NOP 0x14 0x994355199e516ff76c4fa4aab39337b9d84cf12b EQUAL", "P2SH,STRICTENC"], +["'abcdefghijklmnopqrstuvwxyz'", "HASH160 0x4c 0x14 0xc286a1af0947f58d1ad787385b1c2c4a976f9e71 EQUAL", "P2SH,STRICTENC"], +["''", "HASH256 0x20 0x5df6e0e2761359d30a8275058e299fcc0381534545f55cf43e41983f5d4c9456 EQUAL", "P2SH,STRICTENC"], +["'a'", "HASH256 0x20 0xbf5d3affb73efd2ec6c36ad3112dd933efed63c4e1cbffcfa88e2759c144f2d8 EQUAL", "P2SH,STRICTENC"], +["'abcdefghijklmnopqrstuvwxyz'", "HASH256 0x4c 0x20 0xca139bc10c2f660da42666f72e89a225936fc60f193c161124a672050c434671 EQUAL", "P2SH,STRICTENC"], -["1","NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10 1 EQUAL"], -["'NOP_1_to_10' NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10","'NOP_1_to_10' EQUAL"], +["1","NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10 1 EQUAL", "P2SH,STRICTENC"], +["'NOP_1_to_10' NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10","'NOP_1_to_10' EQUAL", "P2SH,STRICTENC"], -["0", "IF 0xba ELSE 1 ENDIF", "opcodes above NOP10 invalid if executed"], -["0", "IF 0xbb ELSE 1 ENDIF"], -["0", "IF 0xbc ELSE 1 ENDIF"], -["0", "IF 0xbd ELSE 1 ENDIF"], -["0", "IF 0xbe ELSE 1 ENDIF"], -["0", "IF 0xbf ELSE 1 ENDIF"], -["0", "IF 0xc0 ELSE 1 ENDIF"], -["0", "IF 0xc1 ELSE 1 ENDIF"], -["0", "IF 0xc2 ELSE 1 ENDIF"], -["0", "IF 0xc3 ELSE 1 ENDIF"], -["0", "IF 0xc4 ELSE 1 ENDIF"], -["0", "IF 0xc5 ELSE 1 ENDIF"], -["0", "IF 0xc6 ELSE 1 ENDIF"], -["0", "IF 0xc7 ELSE 1 ENDIF"], -["0", "IF 0xc8 ELSE 1 ENDIF"], -["0", "IF 0xc9 ELSE 1 ENDIF"], -["0", "IF 0xca ELSE 1 ENDIF"], -["0", "IF 0xcb ELSE 1 ENDIF"], -["0", "IF 0xcc ELSE 1 ENDIF"], -["0", "IF 0xcd ELSE 1 ENDIF"], -["0", "IF 0xce ELSE 1 ENDIF"], -["0", "IF 0xcf ELSE 1 ENDIF"], -["0", "IF 0xd0 ELSE 1 ENDIF"], -["0", "IF 0xd1 ELSE 1 ENDIF"], -["0", "IF 0xd2 ELSE 1 ENDIF"], -["0", "IF 0xd3 ELSE 1 ENDIF"], -["0", "IF 0xd4 ELSE 1 ENDIF"], -["0", "IF 0xd5 ELSE 1 ENDIF"], -["0", "IF 0xd6 ELSE 1 ENDIF"], -["0", "IF 0xd7 ELSE 1 ENDIF"], -["0", "IF 0xd8 ELSE 1 ENDIF"], -["0", "IF 0xd9 ELSE 1 ENDIF"], -["0", "IF 0xda ELSE 1 ENDIF"], -["0", "IF 0xdb ELSE 1 ENDIF"], -["0", "IF 0xdc ELSE 1 ENDIF"], -["0", "IF 0xdd ELSE 1 ENDIF"], -["0", "IF 0xde ELSE 1 ENDIF"], -["0", "IF 0xdf ELSE 1 ENDIF"], -["0", "IF 0xe0 ELSE 1 ENDIF"], -["0", "IF 0xe1 ELSE 1 ENDIF"], -["0", "IF 0xe2 ELSE 1 ENDIF"], -["0", "IF 0xe3 ELSE 1 ENDIF"], -["0", "IF 0xe4 ELSE 1 ENDIF"], -["0", "IF 0xe5 ELSE 1 ENDIF"], -["0", "IF 0xe6 ELSE 1 ENDIF"], -["0", "IF 0xe7 ELSE 1 ENDIF"], -["0", "IF 0xe8 ELSE 1 ENDIF"], -["0", "IF 0xe9 ELSE 1 ENDIF"], -["0", "IF 0xea ELSE 1 ENDIF"], -["0", "IF 0xeb ELSE 1 ENDIF"], -["0", "IF 0xec ELSE 1 ENDIF"], -["0", "IF 0xed ELSE 1 ENDIF"], -["0", "IF 0xee ELSE 1 ENDIF"], -["0", "IF 0xef ELSE 1 ENDIF"], -["0", "IF 0xf0 ELSE 1 ENDIF"], -["0", "IF 0xf1 ELSE 1 ENDIF"], -["0", "IF 0xf2 ELSE 1 ENDIF"], -["0", "IF 0xf3 ELSE 1 ENDIF"], -["0", "IF 0xf4 ELSE 1 ENDIF"], -["0", "IF 0xf5 ELSE 1 ENDIF"], -["0", "IF 0xf6 ELSE 1 ENDIF"], -["0", "IF 0xf7 ELSE 1 ENDIF"], -["0", "IF 0xf8 ELSE 1 ENDIF"], -["0", "IF 0xf9 ELSE 1 ENDIF"], -["0", "IF 0xfa ELSE 1 ENDIF"], -["0", "IF 0xfb ELSE 1 ENDIF"], -["0", "IF 0xfc ELSE 1 ENDIF"], -["0", "IF 0xfd ELSE 1 ENDIF"], -["0", "IF 0xfe ELSE 1 ENDIF"], -["0", "IF 0xff ELSE 1 ENDIF"], +["0", "IF 0xba ELSE 1 ENDIF", "P2SH,STRICTENC", "opcodes above NOP10 invalid if executed"], +["0", "IF 0xbb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xbc ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xbd ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xbe ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xbf ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc1 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc2 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc3 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc4 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc5 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc6 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc7 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc8 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xc9 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xca ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xcb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xcc ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xcd ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xce ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xcf ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd1 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd2 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd3 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd4 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd5 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd6 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd7 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd8 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xd9 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xda ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xdb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xdc ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xdd ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xde ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xdf ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe1 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe2 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe3 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe4 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe5 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe6 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe7 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe8 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xe9 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xea ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xeb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xec ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xed ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xee ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xef ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf0 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf1 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf2 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf3 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf4 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf5 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf6 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf7 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf8 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xf9 ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xfa ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xfb ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xfc ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xfd ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xfe ELSE 1 ENDIF", "P2SH,STRICTENC"], +["0", "IF 0xff ELSE 1 ENDIF", "P2SH,STRICTENC"], ["NOP", "'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'", +"P2SH,STRICTENC", "520 byte push"], ["1", "0x616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161", +"P2SH,STRICTENC", "201 opcodes executed. 0x61 is NOP"], ["1 2 3 4 5 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "1 2 3 4 5 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", +"P2SH,STRICTENC", "1,000 stack size (0x6f is 3DUP)"], ["1 TOALTSTACK 2 TOALTSTACK 3 4 5 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "1 2 3 4 5 6 7 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", +"P2SH,STRICTENC", "1,000 stack size (altstack cleared between scriptSig/scriptPubKey)"], ["'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f 2DUP 0x616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161", +"P2SH,STRICTENC", "Max-size (10,000-byte), max-push(520 bytes), max-opcodes(201), max stack size(1,000 items). 0x6f is 3DUP, 0x61 is NOP"], ["0", "IF 0x5050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050 ENDIF 1", +"P2SH,STRICTENC", ">201 opcodes, but RESERVED (0x50) doesn't count towards opcode limit."], -["NOP","1"], +["NOP","1", "P2SH,STRICTENC"], -["1", "0x01 0x01 EQUAL", "The following is useful for checking implementations of BN_bn2mpi"], -["127", "0x01 0x7F EQUAL"], -["128", "0x02 0x8000 EQUAL", "Leave room for the sign bit"], -["32767", "0x02 0xFF7F EQUAL"], -["32768", "0x03 0x008000 EQUAL"], -["8388607", "0x03 0xFFFF7F EQUAL"], -["8388608", "0x04 0x00008000 EQUAL"], -["2147483647", "0x04 0xFFFFFF7F EQUAL"], -["2147483648", "0x05 0x0000008000 EQUAL"], -["549755813887", "0x05 0xFFFFFFFF7F EQUAL"], -["549755813888", "0x06 0xFFFFFFFF7F EQUAL"], -["9223372036854775807", "0x08 0xFFFFFFFFFFFFFF7F EQUAL"], -["-1", "0x01 0x81 EQUAL", "Numbers are little-endian with the MSB being a sign bit"], -["-127", "0x01 0xFF EQUAL"], -["-128", "0x02 0x8080 EQUAL"], -["-32767", "0x02 0xFFFF EQUAL"], -["-32768", "0x03 0x008080 EQUAL"], -["-8388607", "0x03 0xFFFFFF EQUAL"], -["-8388608", "0x04 0x00008080 EQUAL"], -["-2147483647", "0x04 0xFFFFFFFF EQUAL"], -["-2147483648", "0x05 0x0000008080 EQUAL"], -["-4294967295", "0x05 0xFFFFFFFF80 EQUAL"], -["-549755813887", "0x05 0xFFFFFFFFFF EQUAL"], -["-549755813888", "0x06 0x000000008080 EQUAL"], -["-9223372036854775807", "0x08 0xFFFFFFFFFFFFFFFF EQUAL"], +["1", "0x01 0x01 EQUAL", "P2SH,STRICTENC", "The following is useful for checking implementations of BN_bn2mpi"], +["127", "0x01 0x7F EQUAL", "P2SH,STRICTENC"], +["128", "0x02 0x8000 EQUAL", "P2SH,STRICTENC", "Leave room for the sign bit"], +["32767", "0x02 0xFF7F EQUAL", "P2SH,STRICTENC"], +["32768", "0x03 0x008000 EQUAL", "P2SH,STRICTENC"], +["8388607", "0x03 0xFFFF7F EQUAL", "P2SH,STRICTENC"], +["8388608", "0x04 0x00008000 EQUAL", "P2SH,STRICTENC"], +["2147483647", "0x04 0xFFFFFF7F EQUAL", "P2SH,STRICTENC"], +["2147483648", "0x05 0x0000008000 EQUAL", "P2SH,STRICTENC"], +["549755813887", "0x05 0xFFFFFFFF7F EQUAL", "P2SH,STRICTENC"], +["549755813888", "0x06 0xFFFFFFFF7F EQUAL", "P2SH,STRICTENC"], +["9223372036854775807", "0x08 0xFFFFFFFFFFFFFF7F EQUAL", "P2SH,STRICTENC"], +["-1", "0x01 0x81 EQUAL", "P2SH,STRICTENC", "Numbers are little-endian with the MSB being a sign bit"], +["-127", "0x01 0xFF EQUAL", "P2SH,STRICTENC"], +["-128", "0x02 0x8080 EQUAL", "P2SH,STRICTENC"], +["-32767", "0x02 0xFFFF EQUAL", "P2SH,STRICTENC"], +["-32768", "0x03 0x008080 EQUAL", "P2SH,STRICTENC"], +["-8388607", "0x03 0xFFFFFF EQUAL", "P2SH,STRICTENC"], +["-8388608", "0x04 0x00008080 EQUAL", "P2SH,STRICTENC"], +["-2147483647", "0x04 0xFFFFFFFF EQUAL", "P2SH,STRICTENC"], +["-2147483648", "0x05 0x0000008080 EQUAL", "P2SH,STRICTENC"], +["-4294967295", "0x05 0xFFFFFFFF80 EQUAL", "P2SH,STRICTENC"], +["-549755813887", "0x05 0xFFFFFFFFFF EQUAL", "P2SH,STRICTENC"], +["-549755813888", "0x06 0x000000008080 EQUAL", "P2SH,STRICTENC"], +["-9223372036854775807", "0x08 0xFFFFFFFFFFFFFFFF EQUAL", "P2SH,STRICTENC"], -["2147483647", "1ADD 2147483648 EQUAL", "We can do math on 4-byte integers, and compare 5-byte ones"], -["2147483647", "1ADD 1"], -["-2147483647", "1ADD 1"], +["2147483647", "1ADD 2147483648 EQUAL", "P2SH,STRICTENC", "We can do math on 4-byte integers, and compare 5-byte ones"], +["2147483647", "1ADD 1", "P2SH,STRICTENC"], +["-2147483647", "1ADD 1", "P2SH,STRICTENC"], -["1", "0x02 0x0100 EQUAL NOT", "Not the same byte array..."], -["1", "0x02 0x0100 NUMEQUAL", "... but they are numerically equal"], -["11", "0x4c 0x03 0x0b0000 NUMEQUAL"], -["0", "0x01 0x80 EQUAL NOT"], -["0", "0x01 0x80 NUMEQUAL", "Zero numerically equals negative zero"], -["0", "0x02 0x0080 NUMEQUAL"], -["0x03 0x000080", "0x04 0x00000080 NUMEQUAL"], -["0x03 0x100080", "0x04 0x10000080 NUMEQUAL"], -["0x03 0x100000", "0x04 0x10000000 NUMEQUAL"], +["1", "0x02 0x0100 EQUAL NOT", "P2SH,STRICTENC", "Not the same byte array..."], +["1", "0x02 0x0100 NUMEQUAL", "P2SH,STRICTENC", "... but they are numerically equal"], +["11", "0x4c 0x03 0x0b0000 NUMEQUAL", "P2SH,STRICTENC"], +["0", "0x01 0x80 EQUAL NOT", "P2SH,STRICTENC"], +["0", "0x01 0x80 NUMEQUAL", "P2SH,STRICTENC", "Zero numerically equals negative zero"], +["0", "0x02 0x0080 NUMEQUAL", "P2SH,STRICTENC"], +["0x03 0x000080", "0x04 0x00000080 NUMEQUAL", "P2SH,STRICTENC"], +["0x03 0x100080", "0x04 0x10000080 NUMEQUAL", "P2SH,STRICTENC"], +["0x03 0x100000", "0x04 0x10000000 NUMEQUAL", "P2SH,STRICTENC"], -["NOP", "NOP 1", "The following tests check the if(stack.size() < N) tests in each opcode"], -["1", "IF 1 ENDIF", "They are here to catch copy-and-paste errors"], -["0", "NOTIF 1 ENDIF", "Most of them are duplicated elsewhere,"], -["1", "VERIFY 1", "but, hey, more is always better, right?"], +["NOP", "NOP 1", "P2SH,STRICTENC", "The following tests check the if(stack.size() < N) tests in each opcode"], +["1", "IF 1 ENDIF", "P2SH,STRICTENC", "They are here to catch copy-and-paste errors"], +["0", "NOTIF 1 ENDIF", "P2SH,STRICTENC", "Most of them are duplicated elsewhere,"], +["1", "VERIFY 1", "P2SH,STRICTENC", "but, hey, more is always better, right?"], -["0", "TOALTSTACK 1"], -["1", "TOALTSTACK FROMALTSTACK"], -["0 0", "2DROP 1"], -["0 1", "2DUP"], -["0 0 1", "3DUP"], -["0 1 0 0", "2OVER"], -["0 1 0 0 0 0", "2ROT"], -["0 1 0 0", "2SWAP"], -["1", "IFDUP"], -["NOP", "DEPTH 1"], -["0", "DROP 1"], -["1", "DUP"], -["0 1", "NIP"], -["1 0", "OVER"], -["1 0 0 0 3", "PICK"], -["1 0", "PICK"], -["1 0 0 0 3", "ROLL"], -["1 0", "ROLL"], -["1 0 0", "ROT"], -["1 0", "SWAP"], -["0 1", "TUCK"], +["0", "TOALTSTACK 1", "P2SH,STRICTENC"], +["1", "TOALTSTACK FROMALTSTACK", "P2SH,STRICTENC"], +["0 0", "2DROP 1", "P2SH,STRICTENC"], +["0 1", "2DUP", "P2SH,STRICTENC"], +["0 0 1", "3DUP", "P2SH,STRICTENC"], +["0 1 0 0", "2OVER", "P2SH,STRICTENC"], +["0 1 0 0 0 0", "2ROT", "P2SH,STRICTENC"], +["0 1 0 0", "2SWAP", "P2SH,STRICTENC"], +["1", "IFDUP", "P2SH,STRICTENC"], +["NOP", "DEPTH 1", "P2SH,STRICTENC"], +["0", "DROP 1", "P2SH,STRICTENC"], +["1", "DUP", "P2SH,STRICTENC"], +["0 1", "NIP", "P2SH,STRICTENC"], +["1 0", "OVER", "P2SH,STRICTENC"], +["1 0 0 0 3", "PICK", "P2SH,STRICTENC"], +["1 0", "PICK", "P2SH,STRICTENC"], +["1 0 0 0 3", "ROLL", "P2SH,STRICTENC"], +["1 0", "ROLL", "P2SH,STRICTENC"], +["1 0 0", "ROT", "P2SH,STRICTENC"], +["1 0", "SWAP", "P2SH,STRICTENC"], +["0 1", "TUCK", "P2SH,STRICTENC"], -["1", "SIZE"], +["1", "SIZE", "P2SH,STRICTENC"], -["0 0", "EQUAL"], -["0 0", "EQUALVERIFY 1"], +["0 0", "EQUAL", "P2SH,STRICTENC"], +["0 0", "EQUALVERIFY 1", "P2SH,STRICTENC"], -["0", "1ADD"], -["2", "1SUB"], -["-1", "NEGATE"], -["-1", "ABS"], -["0", "NOT"], -["-1", "0NOTEQUAL"], +["0", "1ADD", "P2SH,STRICTENC"], +["2", "1SUB", "P2SH,STRICTENC"], +["-1", "NEGATE", "P2SH,STRICTENC"], +["-1", "ABS", "P2SH,STRICTENC"], +["0", "NOT", "P2SH,STRICTENC"], +["-1", "0NOTEQUAL", "P2SH,STRICTENC"], -["1 0", "ADD"], -["1 0", "SUB"], -["-1 -1", "BOOLAND"], -["-1 0", "BOOLOR"], -["0 0", "NUMEQUAL"], -["0 0", "NUMEQUALVERIFY 1"], -["-1 0", "NUMNOTEQUAL"], -["-1 0", "LESSTHAN"], -["1 0", "GREATERTHAN"], -["0 0", "LESSTHANOREQUAL"], -["0 0", "GREATERTHANOREQUAL"], -["-1 0", "MIN"], -["1 0", "MAX"], -["-1 -1 0", "WITHIN"], +["1 0", "ADD", "P2SH,STRICTENC"], +["1 0", "SUB", "P2SH,STRICTENC"], +["-1 -1", "BOOLAND", "P2SH,STRICTENC"], +["-1 0", "BOOLOR", "P2SH,STRICTENC"], +["0 0", "NUMEQUAL", "P2SH,STRICTENC"], +["0 0", "NUMEQUALVERIFY 1", "P2SH,STRICTENC"], +["-1 0", "NUMNOTEQUAL", "P2SH,STRICTENC"], +["-1 0", "LESSTHAN", "P2SH,STRICTENC"], +["1 0", "GREATERTHAN", "P2SH,STRICTENC"], +["0 0", "LESSTHANOREQUAL", "P2SH,STRICTENC"], +["0 0", "GREATERTHANOREQUAL", "P2SH,STRICTENC"], +["-1 0", "MIN", "P2SH,STRICTENC"], +["1 0", "MAX", "P2SH,STRICTENC"], +["-1 -1 0", "WITHIN", "P2SH,STRICTENC"], -["0", "RIPEMD160"], -["0", "SHA1"], -["0", "SHA256"], -["0", "HASH160"], -["0", "HASH256"], -["NOP", "CODESEPARATOR 1"], +["0", "RIPEMD160", "P2SH,STRICTENC"], +["0", "SHA1", "P2SH,STRICTENC"], +["0", "SHA256", "P2SH,STRICTENC"], +["0", "HASH160", "P2SH,STRICTENC"], +["0", "HASH256", "P2SH,STRICTENC"], +["NOP", "CODESEPARATOR 1", "P2SH,STRICTENC"], -["NOP", "NOP1 1"], -["NOP", "NOP2 1"], -["NOP", "NOP3 1"], -["NOP", "NOP4 1"], -["NOP", "NOP5 1"], -["NOP", "NOP6 1"], -["NOP", "NOP7 1"], -["NOP", "NOP8 1"], -["NOP", "NOP9 1"], -["NOP", "NOP10 1"], +["NOP", "NOP1 1", "P2SH,STRICTENC"], +["NOP", "NOP2 1", "P2SH,STRICTENC"], +["NOP", "NOP3 1", "P2SH,STRICTENC"], +["NOP", "NOP4 1", "P2SH,STRICTENC"], +["NOP", "NOP5 1", "P2SH,STRICTENC"], +["NOP", "NOP6 1", "P2SH,STRICTENC"], +["NOP", "NOP7 1", "P2SH,STRICTENC"], +["NOP", "NOP8 1", "P2SH,STRICTENC"], +["NOP", "NOP9 1", "P2SH,STRICTENC"], +["NOP", "NOP10 1", "P2SH,STRICTENC"], -["", "0 0 0 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "CHECKMULTISIG is allowed to have zero keys and/or sigs"], -["", "0 0 0 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 0 1 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "Zero sigs means no sigs are checked"], -["", "0 0 0 1 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 0 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC", "CHECKMULTISIG is allowed to have zero keys and/or sigs"], +["", "0 0 0 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 0 1 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC", "Zero sigs means no sigs are checked"], +["", "0 0 0 1 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], -["", "0 0 0 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "CHECKMULTISIG is allowed to have zero keys and/or sigs"], -["", "0 0 0 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 0 1 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "Zero sigs means no sigs are checked"], -["", "0 0 0 1 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 0 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC", "CHECKMULTISIG is allowed to have zero keys and/or sigs"], +["", "0 0 0 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 0 1 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC", "Zero sigs means no sigs are checked"], +["", "0 0 0 1 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], -["", "0 0 'a' 'b' 2 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "Test from up to 20 pubkeys, all not checked"], -["", "0 0 'a' 'b' 'c' 3 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 4 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 5 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 6 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 7 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 8 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 9 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 10 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 11 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 12 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 13 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 14 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 15 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 16 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 17 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 18 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 19 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG VERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 1 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 2 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 3 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 4 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 5 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 6 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 7 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 8 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 9 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 10 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 11 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 12 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 13 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 14 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 15 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 16 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 17 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 18 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 19 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], -["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY DEPTH 0 EQUAL"], +["", "0 0 'a' 'b' 2 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC", "Test from up to 20 pubkeys, all not checked"], +["", "0 0 'a' 'b' 'c' 3 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 4 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 5 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 6 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 7 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 8 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 9 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 10 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 11 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 12 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 13 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 14 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 15 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 16 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 17 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 18 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 19 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG VERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 1 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 2 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 3 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 4 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 5 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 6 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 7 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 8 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 9 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 10 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 11 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 12 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 13 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 14 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 15 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 16 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 17 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 18 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 19 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], +["", "0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "P2SH,STRICTENC"], ["", "0 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG", +"P2SH,STRICTENC", "nOpCount is incremented by the number of keys evaluated in addition to the usual one op per op. In this case we have zero keys, so we can execute 201 CHECKMULTISIGS"], ["1", -"0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY"], +"0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY", +"P2SH,STRICTENC"], ["", "NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG", +"P2SH,STRICTENC", "Even though there are no signatures being checked nOpCount is incremented by the number of keys."], ["1", -"NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY"], +"NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY", +"P2SH,STRICTENC"], -["0 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL", "Very basic P2SH"], -["0x4c 0 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL"], +["0 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL", "P2SH,STRICTENC", "Very basic P2SH"], +["0x4c 0 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL", "P2SH,STRICTENC"], ["0x40 0x42424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242", "0x4d 0x4000 0x42424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242 EQUAL", +"P2SH,STRICTENC", "Basic PUSH signedness check"], ["0x4c 0x40 0x42424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242", "0x4d 0x4000 0x42424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242 EQUAL", +"P2SH,STRICTENC", "Basic PUSHDATA1 signedness check"], -["0x00", "SIZE 0 EQUAL", "Basic OP_0 execution"] +["0x00", "SIZE 0 EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"] ] diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 88efc38964..bc610778c4 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -35,6 +35,8 @@ using namespace boost::algorithm; static const unsigned int flags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC; +unsigned int ParseScriptFlags(string strFlags); + Array read_json(const std::string& jsondata) { @@ -54,7 +56,7 @@ BOOST_AUTO_TEST_CASE(script_valid) { // Read tests from test/data/script_valid.json // Format is an array of arrays - // Inner arrays are [ "scriptSig", "scriptPubKey" ] + // Inner arrays are [ "scriptSig", "scriptPubKey", "flags" ] // ... where scriptSig and scriptPubKey are stringified // scripts. Array tests = read_json(std::string(json_tests::script_valid, json_tests::script_valid + sizeof(json_tests::script_valid))); @@ -63,7 +65,7 @@ BOOST_AUTO_TEST_CASE(script_valid) { Array test = tv.get_array(); string strTest = write_string(tv, false); - if (test.size() < 2) // Allow size > 2; extra stuff ignored (useful for comments) + if (test.size() < 3) // Allow size > 3; extra stuff ignored (useful for comments) { BOOST_ERROR("Bad test: " << strTest); continue; @@ -72,9 +74,10 @@ BOOST_AUTO_TEST_CASE(script_valid) CScript scriptSig = ParseScript(scriptSigString); string scriptPubKeyString = test[1].get_str(); CScript scriptPubKey = ParseScript(scriptPubKeyString); + unsigned int scriptflags = ParseScriptFlags(test[2].get_str()); CTransaction tx; - BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, tx, 0, flags, SIGHASH_NONE), strTest); + BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, tx, 0, scriptflags, SIGHASH_NONE), strTest); } } @@ -96,9 +99,10 @@ BOOST_AUTO_TEST_CASE(script_invalid) CScript scriptSig = ParseScript(scriptSigString); string scriptPubKeyString = test[1].get_str(); CScript scriptPubKey = ParseScript(scriptPubKeyString); + unsigned int scriptflags = ParseScriptFlags(test[2].get_str()); CTransaction tx; - BOOST_CHECK_MESSAGE(!VerifyScript(scriptSig, scriptPubKey, tx, 0, flags, SIGHASH_NONE), strTest); + BOOST_CHECK_MESSAGE(!VerifyScript(scriptSig, scriptPubKey, tx, 0, scriptflags, SIGHASH_NONE), strTest); } } diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 943568e89d..21377395cf 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -26,7 +26,7 @@ using namespace boost::algorithm; // In script_tests.cpp extern Array read_json(const std::string& jsondata); -unsigned int ParseFlags(string strFlags){ +unsigned int ParseScriptFlags(string strFlags){ unsigned int flags = 0; vector words; split(words, strFlags, is_any_of(",")); @@ -119,7 +119,7 @@ BOOST_AUTO_TEST_CASE(tx_valid) break; } - unsigned int verify_flags = ParseFlags(test[2].get_str()); + unsigned int verify_flags = ParseScriptFlags(test[2].get_str()); BOOST_CHECK_MESSAGE(VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout], tx, i, verify_flags, 0), strTest); @@ -192,7 +192,7 @@ BOOST_AUTO_TEST_CASE(tx_invalid) break; } - unsigned int verify_flags = ParseFlags(test[2].get_str()); + unsigned int verify_flags = ParseScriptFlags(test[2].get_str()); fValid = VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout], tx, i, verify_flags, 0); } From d4168c82bef0d86fd254a9d993906a09f5fd7fc0 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 9 Sep 2014 09:18:05 +0200 Subject: [PATCH 0673/1288] Limit CNode::mapAskFor Tighten resource constraints on CNode. --- src/net.cpp | 2 ++ src/net.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/net.cpp b/src/net.cpp index 2546826f9a..6b7e62d7cb 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2106,6 +2106,8 @@ CNode::~CNode() void CNode::AskFor(const CInv& inv) { + if (mapAskFor.size() > MAPASKFOR_MAX_SZ) + return; // We're using mapAskFor as a priority queue, // the key is the earliest time the request can be sent int64_t nRequestTime; diff --git a/src/net.h b/src/net.h index e2700c0975..ad0a1df7e2 100644 --- a/src/net.h +++ b/src/net.h @@ -51,6 +51,8 @@ static const bool DEFAULT_UPNP = USE_UPNP; #else static const bool DEFAULT_UPNP = false; #endif +/** The maximum number of entries in mapAskFor */ +static const size_t MAPASKFOR_MAX_SZ = MAX_INV_SZ; unsigned int ReceiveFloodSize(); unsigned int SendBufferSize(); From 540ac4514dbe4e077917bad1750768218ef5f9cf Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 9 Sep 2014 09:26:52 +0200 Subject: [PATCH 0674/1288] Avoid returning many "inv" orphans --- src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 2e24eb950f..21a352f7ba 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3639,6 +3639,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // Track requests for our stuff g_signals.Inventory(inv.hash); + + if (pfrom->nSendSize > (SendBufferSize() * 2)) { + Misbehaving(pfrom->GetId(), 50); + return error("send buffer size() = %u", pfrom->nSendSize); + } } } From 2c2cc5dac1102c1eb86c7dd825a893ab388abba1 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 8 Sep 2014 12:25:52 +0200 Subject: [PATCH 0675/1288] Remove some unnecessary c_strs() in logging and the GUI Includes `core: remove unneeded c_str() / Qt: replace c_str() with Qt code` by P. Kaufmann. --- src/addrman.h | 2 +- src/main.cpp | 4 ++-- src/net.cpp | 2 +- src/qt/coincontroldialog.cpp | 4 ++-- src/qt/walletmodel.cpp | 2 +- src/txmempool.cpp | 2 +- src/wallet.cpp | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/addrman.h b/src/addrman.h index 90507cb458..5fd698f18a 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -424,7 +424,7 @@ public: Check(); } if (fRet) - LogPrint("addrman", "Added %s from %s: %i tried, %i new\n", addr.ToStringIPPort().c_str(), source.ToString(), nTried, nNew); + LogPrint("addrman", "Added %s from %s: %i tried, %i new\n", addr.ToStringIPPort(), source.ToString(), nTried, nNew); return fRet; } diff --git a/src/main.cpp b/src/main.cpp index a3b31b719d..ff4560c2d0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4392,7 +4392,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) if (!pto->fDisconnect && state.nBlocksInFlight && state.nLastBlockReceive < state.nLastBlockProcess - BLOCK_DOWNLOAD_TIMEOUT*1000000 && state.vBlocksInFlight.front().nTime < state.nLastBlockProcess - 2*BLOCK_DOWNLOAD_TIMEOUT*1000000) { - LogPrintf("Peer %s is stalling block download, disconnecting\n", state.name.c_str()); + LogPrintf("Peer %s is stalling block download, disconnecting\n", state.name); pto->fDisconnect = true; } @@ -4502,7 +4502,7 @@ bool CBlockUndo::ReadFromDisk(const CDiskBlockPos &pos, const uint256 &hashBlock } std::string CBlockFileInfo::ToString() const { - return strprintf("CBlockFileInfo(blocks=%u, size=%u, heights=%u...%u, time=%s...%s)", nBlocks, nSize, nHeightFirst, nHeightLast, DateTimeStrFormat("%Y-%m-%d", nTimeFirst).c_str(), DateTimeStrFormat("%Y-%m-%d", nTimeLast).c_str()); + return strprintf("CBlockFileInfo(blocks=%u, size=%u, heights=%u...%u, time=%s...%s)", nBlocks, nSize, nHeightFirst, nHeightLast, DateTimeStrFormat("%Y-%m-%d", nTimeFirst), DateTimeStrFormat("%Y-%m-%d", nTimeLast)); } diff --git a/src/net.cpp b/src/net.cpp index 2546826f9a..633a3a34e7 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2114,7 +2114,7 @@ void CNode::AskFor(const CInv& inv) nRequestTime = it->second; else nRequestTime = 0; - LogPrint("net", "askfor %s %d (%s) peer=%d\n", inv.ToString(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str(), id); + LogPrint("net", "askfor %s %d (%s) peer=%d\n", inv.ToString(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000), id); // Make sure not to reuse time indexes to keep things in the same order int64_t nNow = GetTimeMicros() - 1000000; diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index 7b30f8de09..d10463fd8f 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -705,7 +705,7 @@ void CoinControlDialog::updateView() QString sAddress = ""; if(ExtractDestination(out.tx->vout[out.i].scriptPubKey, outputAddress)) { - sAddress = CBitcoinAddress(outputAddress).ToString().c_str(); + sAddress = QString::fromStdString(CBitcoinAddress(outputAddress).ToString()); // if listMode or change => show bitcoin address. In tree mode, address is not shown again for direct wallet address outputs if (!treeMode || (!(sAddress == sWalletAddress))) @@ -752,7 +752,7 @@ void CoinControlDialog::updateView() // transaction hash uint256 txhash = out.tx->GetHash(); - itemOutput->setText(COLUMN_TXHASH, txhash.GetHex().c_str()); + itemOutput->setText(COLUMN_TXHASH, QString::fromStdString(txhash.GetHex())); // vout index itemOutput->setText(COLUMN_VOUT_INDEX, QString::number(out.i)); diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 530c46cdb4..8d2c2e96d8 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -622,7 +622,7 @@ void WalletModel::listCoins(std::map >& mapCoins) CTxDestination address; if(!out.fSpendable || !ExtractDestination(cout.tx->vout[cout.i].scriptPubKey, address)) continue; - mapCoins[CBitcoinAddress(address).ToString().c_str()].push_back(out); + mapCoins[QString::fromStdString(CBitcoinAddress(address).ToString())].push_back(out); } } diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 238d5bab16..28339837bf 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -606,7 +606,7 @@ void CTxMemPool::PrioritiseTransaction(const uint256 hash, const string strHash, deltas.first += dPriorityDelta; deltas.second += nFeeDelta; } - LogPrintf("PrioritiseTransaction: %s priority += %f, fee += %d\n", strHash.c_str(), dPriorityDelta, nFeeDelta); + LogPrintf("PrioritiseTransaction: %s priority += %f, fee += %d\n", strHash, dPriorityDelta, nFeeDelta); } void CTxMemPool::ApplyDeltas(const uint256 hash, double &dPriorityDelta, int64_t &nFeeDelta) diff --git a/src/wallet.cpp b/src/wallet.cpp index d3ad4869bb..c018c221b4 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -42,7 +42,7 @@ struct CompareValueOnly std::string COutput::ToString() const { - return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString(), i, nDepth, FormatMoney(tx->vout[i].nValue).c_str()); + return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString(), i, nDepth, FormatMoney(tx->vout[i].nValue)); } const CWalletTx* CWallet::GetWalletTx(const uint256& hash) const From faadbe17333a41fc1c15551f74a6ae5dcbd6aedc Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 9 Sep 2014 10:09:59 +0200 Subject: [PATCH 0676/1288] remove unneeded cast in rpcmisc.cpp --- src/rpcmisc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index bd992397b8..917c840536 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -74,8 +74,8 @@ Value getinfo(const Array& params, bool fHelp) GetProxy(NET_IPV4, proxy); Object obj; - obj.push_back(Pair("version", (int)CLIENT_VERSION)); - obj.push_back(Pair("protocolversion",(int)PROTOCOL_VERSION)); + obj.push_back(Pair("version", CLIENT_VERSION)); + obj.push_back(Pair("protocolversion", PROTOCOL_VERSION)); #ifdef ENABLE_WALLET if (pwalletMain) { obj.push_back(Pair("walletversion", pwalletMain->GetVersion())); From 234bfbf6a5fcba37e510e9cb6c1f2a629cd0290e Mon Sep 17 00:00:00 2001 From: Adam Weiss Date: Thu, 31 Jul 2014 11:56:17 -0400 Subject: [PATCH 0677/1288] Add init scripts and docs for Upstart and OpenRC --- contrib/init/README.md | 10 +++ contrib/init/bitcoind.conf | 65 +++++++++++++++ contrib/init/bitcoind.openrc | 86 ++++++++++++++++++++ contrib/init/bitcoind.openrcconf | 27 +++++++ contrib/{systemd => init}/bitcoind.service | 11 ++- doc/README.md | 2 +- doc/init.md | 92 ++++++++++++++++++++++ doc/systemd.md | 47 ----------- 8 files changed, 289 insertions(+), 51 deletions(-) create mode 100644 contrib/init/README.md create mode 100644 contrib/init/bitcoind.conf create mode 100644 contrib/init/bitcoind.openrc create mode 100644 contrib/init/bitcoind.openrcconf rename contrib/{systemd => init}/bitcoind.service (59%) create mode 100644 doc/init.md delete mode 100644 doc/systemd.md diff --git a/contrib/init/README.md b/contrib/init/README.md new file mode 100644 index 0000000000..d3fa966583 --- /dev/null +++ b/contrib/init/README.md @@ -0,0 +1,10 @@ +Sample configuration files for: + +SystemD: bitcoind.service +Upstart: bitcoind.conf +OpenRC: bitcoind.openrc + bitcoind.openrcconf + +have been made available to assist packagers in creating node packages here. + +See doc/init.md for more information. diff --git a/contrib/init/bitcoind.conf b/contrib/init/bitcoind.conf new file mode 100644 index 0000000000..f9554eecde --- /dev/null +++ b/contrib/init/bitcoind.conf @@ -0,0 +1,65 @@ +description "Bitcoin Core Daemon" + +start on runlevel [2345] +stop on starting rc RUNLEVEL=[016] + +env BITCOIND_BIN="/usr/bin/bitcoind" +env BITCOIND_USER="bitcoin" +env BITCOIND_GROUP="bitcoin" +env BITCOIND_PIDDIR="/var/run/bitcoind" +# upstart can't handle variables constructed with other variables +env BITCOIND_PIDFILE="/var/run/bitcoind/bitcoind.pid" +env BITCOIND_CONFIGFILE="/etc/bitcoin/bitcoin.conf" +env BITCOIND_DATADIR="/var/lib/bitcoind" + +expect fork + +respawn +respawn limit 5 120 +kill timeout 60 + +pre-start script + # this will catch non-existent config files + # bitcoind will check and exit with this very warning, but it can do so + # long after forking, leaving upstart to think everything started fine. + # since this is a commonly encountered case on install, just check and + # warn here. + if ! grep -qs '^rpcpassword=' "$BITCOIND_CONFIGFILE" ; then + echo "ERROR: You must set a secure rpcpassword to run bitcoind." + echo "The setting must appear in $BITCOIND_CONFIGFILE" + echo + echo "This password is security critical to securing wallets " + echo "and must not be the same as the rpcuser setting." + echo "You can generate a suitable random password using the following" + echo "command from the shell:" + echo + echo "bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'" + echo + echo "It is also recommended that you also set alertnotify so you are " + echo "notified of problems:" + echo + echo "ie: alertnotify=echo %%s | mail -s \"Bitcoin Alert\"" \ + "admin@foo.com" + echo + exit 1 + fi + + mkdir -p "$BITCOIND_PIDDIR" + chmod 0755 "$BITCOIND_PIDDIR" + chown $BITCOIND_USER:$BITCOIND_GROUP "$BITCOIND_PIDDIR" + chown $BITCOIND_USER:$BITCOIND_GROUP "$BITCOIND_CONFIGFILE" + chmod 0660 "$BITCOIND_CONFIGFILE" +end script + +exec start-stop-daemon \ + --start \ + --pidfile "$BITCOIND_PIDFILE" \ + --chuid $BITCOIND_USER:$BITCOIND_GROUP \ + --exec "$BITCOIND_BIN" \ + -- \ + -pid="$BITCOIND_PIDFILE" \ + -conf="$BITCOIND_CONFIGFILE" \ + -datadir="$BITCOIND_DATADIR" \ + -disablewallet \ + -daemon + diff --git a/contrib/init/bitcoind.openrc b/contrib/init/bitcoind.openrc new file mode 100644 index 0000000000..1f7758c920 --- /dev/null +++ b/contrib/init/bitcoind.openrc @@ -0,0 +1,86 @@ +#!/sbin/runscript + +# backward compatibility for existing gentoo layout +# +if [ -d "/var/lib/bitcoin/.bitcoin" ]; then + BITCOIND_DEFAULT_DATADIR="/var/lib/bitcoin/.bitcoin" +else + BITCOIND_DEFAULT_DATADIR="/var/lib/bitcoind" +fi + +BITCOIND_CONFIGFILE=${BITCOIND_CONFIGFILE:-/etc/bitcoin/bitcoin.conf} +BITCOIND_PIDDIR=${BITCOIND_PIDDIR:-/var/run/bitcoind} +BITCOIND_PIDFILE=${BITCOIND_PIDFILE:-${BITCOIND_PIDDIR}/bitcoind.pid} +BITCOIND_DATADIR=${BITCOIND_DATADIR:-${BITCOIND_DEFAULT_DATADIR}} +BITCOIND_USER=${BITCOIND_USER:-bitcoin} +BITCOIND_GROUP=${BITCOIND_GROUP:-bitcoin} +BITCOIND_BIN=${BITCOIND_BIN:-/usr/bin/bitcoind} + +name="Bitcoin Core Daemon" +description="Bitcoin crypto-currency p2p network daemon" + +command="/usr/bin/bitcoind" +command_args="-pid=\"${BITCOIND_PIDFILE}\" \ + -conf=\"${BITCOIND_CONFIGFILE}\" \ + -datadir=\"${BITCOIND_DATADIR}\" \ + -daemon \ + ${BITCOIND_OPTS}" + +required_files="${BITCOIND_CONFIGFILE}" +start_stop_daemon_args="-u ${BITCOIND_USER} \ + -N ${BITCOIND_NICE:-0} -w 2000" +pidfile="${BITCOIND_PIDFILE}" +retry=60 + +depend() { + need localmount net +} + +# verify +# 1) that the datadir exists and is writable (or create it) +# 2) that a directory for the pid exists and is writable +# 3) ownership and permissions on the config file +start_pre() { + checkpath \ + -d \ + --mode 0750 \ + --owner "${BITCOIND_USER}:${BITCOIND_GROUP}" \ + "${BITCOIND_DATADIR}" + + checkpath \ + -d \ + --mode 0755 \ + --owner "${BITCOIND_USER}:${BITCOIND_GROUP}" \ + "${BITCOIND_PIDDIR}" + + checkpath -f \ + -o ${BITCOIND_USER}:${BITCOIND_GROUP} \ + -m 0660 \ + ${BITCOIND_CONFIGFILE} + + checkconfig || return 1 +} + +checkconfig() +{ + if ! grep -qs '^rpcpassword=' "${BITCOIND_CONFIGFILE}" ; then + eerror "" + eerror "ERROR: You must set a secure rpcpassword to run bitcoind." + eerror "The setting must appear in ${BITCOIND_CONFIGFILE}" + eerror "" + eerror "This password is security critical to securing wallets " + eerror "and must not be the same as the rpcuser setting." + eerror "You can generate a suitable random password using the following" + eerror "command from the shell:" + eerror "" + eerror "bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'" + eerror "" + eerror "It is also recommended that you also set alertnotify so you are " + eerror "notified of problems:" + eerror "" + eerror "ie: alertnotify=echo %%s | mail -s \"Bitcoin Alert\"" \ + "admin@foo.com" + eerror "" + return 1 + fi +} diff --git a/contrib/init/bitcoind.openrcconf b/contrib/init/bitcoind.openrcconf new file mode 100644 index 0000000000..d8d7f58337 --- /dev/null +++ b/contrib/init/bitcoind.openrcconf @@ -0,0 +1,27 @@ +# /etc/conf.d/bitcoind: config file for /etc/init.d/bitcoind + +# Config file location +#BITCOIND_CONFIGFILE="/etc/bitcoin/bitcoin.conf" + +# What directory to write pidfile to? (created and owned by $BITCOIND_USER) +#BITCOIND_PIDDIR="/var/run/bitcoind" + +# What filename to give the pidfile +#BITCOIND_PIDFILE="${BITCOIND_PIDDIR}/bitcoind.pid" + +# Where to write bitcoind data (be mindful that the blockchain is large) +#BITCOIND_DATADIR="/var/lib/bitcoind" + +# User and group to own bitcoind process +#BITCOIND_USER="bitcoin" +#BITCOIND_GROUP="bitcoin" + +# Path to bitcoind executable +#BITCOIND_BIN="/usr/bin/bitcoind" + +# Nice value to run bitcoind under +#BITCOIND_NICE=0 + +# Additional options (avoid -conf and -datadir, use flags above) +BITCOIND_OPTS="-disablewallet" + diff --git a/contrib/systemd/bitcoind.service b/contrib/init/bitcoind.service similarity index 59% rename from contrib/systemd/bitcoind.service rename to contrib/init/bitcoind.service index edc81cc763..9132957c38 100644 --- a/contrib/systemd/bitcoind.service +++ b/contrib/init/bitcoind.service @@ -3,15 +3,20 @@ Description=Bitcoin's distributed currency daemon After=network.target [Service] -User=bitcoind -Group=bitcoind +User=bitcoin +Group=bitcoin Type=forking PIDFile=/var/lib/bitcoind/bitcoind.pid -ExecStart=/usr/bin/bitcoind -daemon -pid=/var/lib/bitcoind/bitcoind.pid -conf=/etc/bitcoind.conf -datadir=/var/lib/bitcoind +ExecStart=/usr/bin/bitcoind -daemon -pid=/var/lib/bitcoind/bitcoind.pid \ +-conf=/etc/bitcoin/bitcoin.conf -datadir=/var/lib/bitcoind -disablewallet Restart=always PrivateTmp=true +TimeoutStopSec=60s +TimeoutStartSec=2s +StartLimitInterval=120s +StartLimitBurst=5 [Install] WantedBy=multi-user.target diff --git a/doc/README.md b/doc/README.md index f8bb8020d4..8368e4644b 100644 --- a/doc/README.md +++ b/doc/README.md @@ -68,7 +68,7 @@ The Bitcoin repo's [root README](https://github.com/bitcoin/bitcoin/blob/master/ - [Assets Attribution](assets-attribution.md) - [Files](files.md) - [Tor Support](tor.md) -- [Systemd](systemd.md) +- [Init Scripts (systemd/upstart/openrc)](init.md) License --------------------- diff --git a/doc/init.md b/doc/init.md new file mode 100644 index 0000000000..3d14025ab4 --- /dev/null +++ b/doc/init.md @@ -0,0 +1,92 @@ +Sample init scripts and service configuration for bitcoind +========================================================== + +Sample scripts and configuration files for systemd, Upstart and OpenRC +can be found in the contrib/init folder. + +contrib/init/bitcoind.service: systemd service unit configuration +contrib/init/bitcoind.openrc: OpenRC compatible SysV style init script +contrib/init/bitcoind.openrcconf: OpenRC conf.d file +contrib/init/bitcoind.conf: Upstart service configuration file + +1. Service User +--------------------------------- + +All three startup configurations assume the existence of a "bitcoin" user +and group. They must be created before attempting to use these scripts. + +2. Configuration +--------------------------------- + +At a bare minimum, bitcoind requires that the rpcpassword setting be set +when running as a daemon. If the configuration file does not exist or this +setting is not set, bitcoind will shutdown promptly after startup. + +This password does not have to be remembered or typed as it is mostly used +as a fixed token that bitcoind and client programs read from the configuration +file, however it is recommended that a strong and secure password be used +as this password is security critical to securing the wallet should the +wallet be enabled. + +If bitcoind is run with "-daemon" flag, and no rpcpassword is set, it will +print a randomly generated suitable password to stderr. You can also +generate one from the shell yourself like this: + +bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo' + +Once you have a password in hand, set rpcpassword= in /etc/bitcoin/bitcoin.conf + +For an example configuration file that describes the configuration settings, +see contrib/debian/examples/bitcoin.conf. + +3. Paths +--------------------------------- + +All three configurations assume several paths that might need to be adjusted. + +Binary: /usr/bin/bitcoind +Configuration file: /etc/bitcoin/bitcoin.conf +Data directory: /var/lib/bitcoind +PID file: /var/run/bitcoind/bitcoind.pid (OpenRC and Upstart) + /var/lib/bitcoind/bitcoind.pid (systemd) + +The configuration file, PID directory (if applicable) and data directory +should all be owned by the bitcoin user and group. It is advised for security +reasons to make the configuration file and data directory only readable by the +bitcoin user and group. Access to bitcoin-cli and other bitcoind rpc clients +can then be controlled by group membership. + +4. Installing Service Configuration +----------------------------------- + +4a) systemd + +Installing this .service file consists on just copying it to +/usr/lib/systemd/system directory, followed by the command +"systemctl daemon-reload" in order to update running systemd configuration. + +To test, run "systemctl start bitcoind" and to enable for system startup run +"systemctl enable bitcoind" + +4b) OpenRC + +Rename bitcoind.openrc to bitcoind and drop it in /etc/init.d. Double +check ownership and permissions and make it executable. Test it with +"/etc/init.d/bitcoind start" and configure it to run on startup with +"rc-update add bitcoind" + +4c) Upstart (for Debian/Ubuntu based distributions) + +Drop bitcoind.conf in /etc/init. Test by running "service bitcoind start" +it will automatically start on reboot. + +NOTE: This script is incompatible with CentOS 5 and Amazon Linux 2014 as they +use old versions of Upstart and do not supply the start-stop-daemon uitility. + +5. Auto-respawn +----------------------------------- + +Auto respawning is currently only configured for Upstart and systemd. +Reasonable defaults have been chosen but YMMV. + + diff --git a/doc/systemd.md b/doc/systemd.md deleted file mode 100644 index 96202c1532..0000000000 --- a/doc/systemd.md +++ /dev/null @@ -1,47 +0,0 @@ -SYSTEMD SUPPORT IN BITCOIN -========================== - -Packagers can find a .service file in this repo in order to integrate bitcoin's -daemon into systemd based distributions. - -bitcoind.service file is located in contrib/systemd/ folder. - -1. Users ---------------------------------- - -This .service file assumes bitcoind user and group exist in the system, so packager -should make sure they are created on installation. - -2. Files ---------------------------------- - -The .service file assumes several paths that might need to be adjusted according -to packager's needs. - -Daemon's config file is assumed to be located at /etc/bitcoind.conf (you can -use contrib/debian/examples/bitcoin.conf as an example). Once installed, users -must edit the file in order to update at least these two -values: rpcuser and rpcpassword . Failing to do so will make the daemon fail -to boot. However, the message written to /var/lib/bitcoind/debug.log file is -very helpful and no default values should be set: - - YYYY-MM-DD HH:MM:DD Error: To use the "-server" option, you must set a rpcpassword in the configuration file: - /etc/bitcoind.conf - It is recommended you use the following random password: - rpcuser=bitcoinrpc - rpcpassword=HdYZ5HGtAF7mx8aTw6uCATtD2maMAK4E12Ysp4YNZQcX - (you do not need to remember this password) - The username and password MUST NOT be the same. - If the file does not exist, create it with owner-readable-only file permissions. - It is also recommended to set alertnotify so you are notified of problems; - for example: alertnotify=echo %s | mail -s "Bitcoin Alert" admin@foo.com - -Daemon's data and pid files will be stored in /var/lib/bitcoind directory, so it -should be created on installation and make bitcoind user/group it's owner. - -3. Installing .service file ---------------------------------- - -Installing this .service file consists on just copying it to /usr/lib/systemd/system -directory, followed by the command "systemctl daemon-reload" in order to update -running systemd configuration. From 6050ab685553c7312ef105d2c4a5230c3fcf4002 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 8 Sep 2014 13:49:56 +0200 Subject: [PATCH 0678/1288] netbase: Make SOCKS5 negotiation interruptible Avoids that SOCKS5 negotiation will hold up the shutdown process. - Sockets can stay in non-blocking mode, no need to switch it on/off anymore - Adds a timeout (20 seconds) on SOCK5 negotiation. This should be enough for even Tor to get a connection to a hidden service, and avoids blocking the opencon thread indefinitely on a hanging proxy. Fixes #2954. --- src/net.cpp | 4 --- src/netbase.cpp | 88 +++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 70 insertions(+), 22 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 633a3a34e7..4c9ff4ebed 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -488,10 +488,6 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest) { addrman.Attempt(addrConnect); - // Set to non-blocking - if (!SetSocketNonBlocking(hSocket, true)) - LogPrintf("ConnectNode: Setting socket to non-blocking failed, error %s\n", NetworkErrorString(WSAGetLastError())); - // Add node CNode* pnode = new CNode(hSocket, addrConnect, pszDest ? pszDest : "", false); pnode->AddRef(); diff --git a/src/netbase.cpp b/src/netbase.cpp index 954c11f77d..5819c152a3 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -45,6 +45,9 @@ bool fNameLookup = false; static const unsigned char pchIPv4[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff }; +// Need ample time for negotiation for very slow proxies such as Tor (milliseconds) +static const int SOCKS5_RECV_TIMEOUT = 20 * 1000; + enum Network ParseNetwork(std::string net) { boost::to_lower(net); if (net == "ipv4") return NET_IPV4; @@ -225,6 +228,63 @@ bool LookupNumeric(const char *pszName, CService& addr, int portDefault) return Lookup(pszName, addr, portDefault, false); } +/** + * Convert milliseconds to a struct timeval for select. + */ +struct timeval static MillisToTimeval(int64_t nTimeout) +{ + struct timeval timeout; + timeout.tv_sec = nTimeout / 1000; + timeout.tv_usec = (nTimeout % 1000) * 1000; + return timeout; +} + +/** + * Read bytes from socket. This will either read the full number of bytes requested + * or return False on error or timeout. + * This function can be interrupted by boost thread interrupt. + * + * @param data Buffer to receive into + * @param len Length of data to receive + * @param timeout Timeout in milliseconds for receive operation + * + * @note This function requires that hSocket is in non-blocking mode. + */ +bool static InterruptibleRecv(char* data, size_t len, int timeout, SOCKET& hSocket) +{ + int64_t curTime = GetTimeMillis(); + int64_t endTime = curTime + timeout; + // Maximum time to wait in one select call. It will take up until this time (in millis) + // to break off in case of an interruption. + const int64_t maxWait = 1000; + while (len > 0 && curTime < endTime) { + ssize_t ret = recv(hSocket, data, len, 0); // Optimistically try the recv first + if (ret > 0) { + len -= ret; + data += ret; + } else if (ret == 0) { // Unexpected disconnection + return false; + } else { // Other error or blocking + int nErr = WSAGetLastError(); + if (nErr == WSAEINPROGRESS || nErr == WSAEWOULDBLOCK || nErr == WSAEINVAL) { + struct timeval tval = MillisToTimeval(std::min(endTime - curTime, maxWait)); + fd_set fdset; + FD_ZERO(&fdset); + FD_SET(hSocket, &fdset); + int nRet = select(hSocket + 1, &fdset, NULL, NULL, &tval); + if (nRet == SOCKET_ERROR) { + return false; + } + } else { + return false; + } + } + boost::this_thread::interruption_point(); + curTime = GetTimeMillis(); + } + return len == 0; +} + bool static Socks5(string strDest, int port, SOCKET& hSocket) { LogPrintf("SOCKS5 connecting %s\n", strDest); @@ -243,7 +303,7 @@ bool static Socks5(string strDest, int port, SOCKET& hSocket) return error("Error sending to proxy"); } char pchRet1[2]; - if (recv(hSocket, pchRet1, 2, 0) != 2) + if (!InterruptibleRecv(pchRet1, 2, SOCKS5_RECV_TIMEOUT, hSocket)) { CloseSocket(hSocket); return error("Error reading proxy response"); @@ -266,7 +326,7 @@ bool static Socks5(string strDest, int port, SOCKET& hSocket) return error("Error sending to proxy"); } char pchRet2[4]; - if (recv(hSocket, pchRet2, 4, 0) != 4) + if (!InterruptibleRecv(pchRet2, 4, SOCKS5_RECV_TIMEOUT, hSocket)) { CloseSocket(hSocket); return error("Error reading proxy response"); @@ -300,27 +360,27 @@ bool static Socks5(string strDest, int port, SOCKET& hSocket) char pchRet3[256]; switch (pchRet2[3]) { - case 0x01: ret = recv(hSocket, pchRet3, 4, 0) != 4; break; - case 0x04: ret = recv(hSocket, pchRet3, 16, 0) != 16; break; + case 0x01: ret = InterruptibleRecv(pchRet3, 4, SOCKS5_RECV_TIMEOUT, hSocket); break; + case 0x04: ret = InterruptibleRecv(pchRet3, 16, SOCKS5_RECV_TIMEOUT, hSocket); break; case 0x03: { - ret = recv(hSocket, pchRet3, 1, 0) != 1; - if (ret) { + ret = InterruptibleRecv(pchRet3, 1, SOCKS5_RECV_TIMEOUT, hSocket); + if (!ret) { CloseSocket(hSocket); return error("Error reading from proxy"); } int nRecv = pchRet3[0]; - ret = recv(hSocket, pchRet3, nRecv, 0) != nRecv; + ret = InterruptibleRecv(pchRet3, nRecv, SOCKS5_RECV_TIMEOUT, hSocket); break; } default: CloseSocket(hSocket); return error("Error: malformed proxy response"); } - if (ret) + if (!ret) { CloseSocket(hSocket); return error("Error reading from proxy"); } - if (recv(hSocket, pchRet3, 2, 0) != 2) + if (!InterruptibleRecv(pchRet3, 2, SOCKS5_RECV_TIMEOUT, hSocket)) { CloseSocket(hSocket); return error("Error reading from proxy"); @@ -360,10 +420,7 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe // WSAEINVAL is here because some legacy version of winsock uses it if (nErr == WSAEINPROGRESS || nErr == WSAEWOULDBLOCK || nErr == WSAEINVAL) { - struct timeval timeout; - timeout.tv_sec = nTimeout / 1000; - timeout.tv_usec = (nTimeout % 1000) * 1000; - + struct timeval timeout = MillisToTimeval(nTimeout); fd_set fdset; FD_ZERO(&fdset); FD_SET(hSocket, &fdset); @@ -410,11 +467,6 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe } } - // This is required when using SOCKS5 proxy! - // CNode::ConnectNode turns the socket back to non-blocking. - if (!SetSocketNonBlocking(hSocket, false)) - return error("ConnectSocketDirectly: Setting socket to blocking failed, error %s\n", NetworkErrorString(WSAGetLastError())); - hSocketRet = hSocket; return true; } From 0d2fa14a3434fb259319aedec0124df305e652c0 Mon Sep 17 00:00:00 2001 From: jtimon Date: Fri, 29 Aug 2014 22:07:39 +0200 Subject: [PATCH 0679/1288] Move scriptutils.o to wallet --- src/Makefile.am | 2 +- src/test/multisig_tests.cpp | 13 ++++++++++++- src/test/script_P2SH_tests.cpp | 7 +++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 9b7e99861d..27bcdc7bcc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -173,6 +173,7 @@ libbitcoin_wallet_a_SOURCES = \ crypter.cpp \ rpcdump.cpp \ rpcwallet.cpp \ + scriptutils.cpp \ wallet.cpp \ walletdb.cpp \ $(BITCOIN_CORE_H) @@ -216,7 +217,6 @@ libbitcoin_common_a_SOURCES = \ script/script.cpp \ script/sign.cpp \ script/standard.cpp \ - scriptutils.cpp \ $(BITCOIN_CORE_H) # util: shared between all executables. diff --git a/src/test/multisig_tests.cpp b/src/test/multisig_tests.cpp index 6c5afa130c..427477edcc 100644 --- a/src/test/multisig_tests.cpp +++ b/src/test/multisig_tests.cpp @@ -8,9 +8,12 @@ #include "script/script.h" #include "script/interpreter.h" #include "script/sign.h" -#include "scriptutils.h" #include "uint256.h" +#ifdef ENABLE_WALLET +#include "scriptutils.h" +#endif + #include #include #include @@ -195,8 +198,10 @@ BOOST_AUTO_TEST_CASE(multisig_Solver1) CTxDestination addr; BOOST_CHECK(ExtractDestination(s, addr)); BOOST_CHECK(addr == keyaddr[0]); +#ifdef ENABLE_WALLET BOOST_CHECK(IsMine(keystore, s)); BOOST_CHECK(!IsMine(emptykeystore, s)); +#endif } { vector solutions; @@ -208,8 +213,10 @@ BOOST_AUTO_TEST_CASE(multisig_Solver1) CTxDestination addr; BOOST_CHECK(ExtractDestination(s, addr)); BOOST_CHECK(addr == keyaddr[0]); +#ifdef ENABLE_WALLET BOOST_CHECK(IsMine(keystore, s)); BOOST_CHECK(!IsMine(emptykeystore, s)); +#endif } { vector solutions; @@ -220,9 +227,11 @@ BOOST_AUTO_TEST_CASE(multisig_Solver1) BOOST_CHECK_EQUAL(solutions.size(), 4U); CTxDestination addr; BOOST_CHECK(!ExtractDestination(s, addr)); +#ifdef ENABLE_WALLET BOOST_CHECK(IsMine(keystore, s)); BOOST_CHECK(!IsMine(emptykeystore, s)); BOOST_CHECK(!IsMine(partialkeystore, s)); +#endif } { vector solutions; @@ -237,9 +246,11 @@ BOOST_AUTO_TEST_CASE(multisig_Solver1) BOOST_CHECK(addrs[0] == keyaddr[0]); BOOST_CHECK(addrs[1] == keyaddr[1]); BOOST_CHECK(nRequired == 1); +#ifdef ENABLE_WALLET BOOST_CHECK(IsMine(keystore, s)); BOOST_CHECK(!IsMine(emptykeystore, s)); BOOST_CHECK(!IsMine(partialkeystore, s)); +#endif } { vector solutions; diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index b7e7487bb2..b1c1052de4 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -7,7 +7,10 @@ #include "main.h" #include "script/script.h" #include "script/sign.h" + +#ifdef ENABLE_WALLET #include "scriptutils.h" +#endif #include @@ -95,7 +98,9 @@ BOOST_AUTO_TEST_CASE(sign) txTo[i].vin[0].prevout.n = i; txTo[i].vin[0].prevout.hash = txFrom.GetHash(); txTo[i].vout[0].nValue = 1; +#ifdef ENABLE_WALLET BOOST_CHECK_MESSAGE(IsMine(keystore, txFrom.vout[i].scriptPubKey), strprintf("IsMine %d", i)); +#endif } for (int i = 0; i < 8; i++) { @@ -189,7 +194,9 @@ BOOST_AUTO_TEST_CASE(set) txTo[i].vin[0].prevout.hash = txFrom.GetHash(); txTo[i].vout[0].nValue = 1*CENT; txTo[i].vout[0].scriptPubKey = inner[i]; +#ifdef ENABLE_WALLET BOOST_CHECK_MESSAGE(IsMine(keystore, txFrom.vout[i].scriptPubKey), strprintf("IsMine %d", i)); +#endif } for (int i = 0; i < 4; i++) { From 8b59a3d36626085db79db2874ae76272b2b42f25 Mon Sep 17 00:00:00 2001 From: jtimon Date: Wed, 27 Aug 2014 17:46:30 +0200 Subject: [PATCH 0680/1288] Move CAffectedKeysVisitor to wallet.cpp (remove ExtractAffectedKeys) --- src/scriptutils.cpp | 36 ------------------------------------ src/scriptutils.h | 1 - src/wallet.cpp | 35 ++++++++++++++++++++++++++++++++++- 3 files changed, 34 insertions(+), 38 deletions(-) diff --git a/src/scriptutils.cpp b/src/scriptutils.cpp index a636eeedab..5099d7515a 100644 --- a/src/scriptutils.cpp +++ b/src/scriptutils.cpp @@ -89,39 +89,3 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey) return ISMINE_WATCH_ONLY; return ISMINE_NO; } - -class CAffectedKeysVisitor : public boost::static_visitor { -private: - const CKeyStore &keystore; - std::vector &vKeys; - -public: - CAffectedKeysVisitor(const CKeyStore &keystoreIn, std::vector &vKeysIn) : keystore(keystoreIn), vKeys(vKeysIn) {} - - void Process(const CScript &script) { - txnouttype type; - std::vector vDest; - int nRequired; - if (ExtractDestinations(script, type, vDest, nRequired)) { - BOOST_FOREACH(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 ExtractAffectedKeys(const CKeyStore &keystore, const CScript& scriptPubKey, std::vector &vKeys) { - CAffectedKeysVisitor(keystore, vKeys).Process(scriptPubKey); -} diff --git a/src/scriptutils.h b/src/scriptutils.h index 98080fc456..4e98a1f74f 100644 --- a/src/scriptutils.h +++ b/src/scriptutils.h @@ -24,6 +24,5 @@ typedef uint8_t isminefilter; isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey); isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest); -void ExtractAffectedKeys(const CKeyStore &keystore, const CScript& scriptPubKey, std::vector &vKeys); #endif // H_BITCOIN_SCRIPT diff --git a/src/wallet.cpp b/src/wallet.cpp index 218a137966..52660be9a0 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -2086,6 +2086,39 @@ void CWallet::ListLockedCoins(std::vector& vOutpts) } } + +class CAffectedKeysVisitor : public boost::static_visitor { +private: + const CKeyStore &keystore; + std::vector &vKeys; + +public: + CAffectedKeysVisitor(const CKeyStore &keystoreIn, std::vector &vKeysIn) : keystore(keystoreIn), vKeys(vKeysIn) {} + + void Process(const CScript &script) { + txnouttype type; + std::vector vDest; + int nRequired; + if (ExtractDestinations(script, type, vDest, nRequired)) { + BOOST_FOREACH(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 &mapKeyBirth) const { AssertLockHeld(cs_wallet); // mapKeyMetadata mapKeyBirth.clear(); @@ -2121,7 +2154,7 @@ void CWallet::GetKeyBirthTimes(std::map &mapKeyBirth) const { int nHeight = blit->second->nHeight; BOOST_FOREACH(const CTxOut &txout, wtx.vout) { // iterate over all their outputs - ::ExtractAffectedKeys(*this, txout.scriptPubKey, vAffected); + CAffectedKeysVisitor(*this, vAffected).Process(txout.scriptPubKey); BOOST_FOREACH(const CKeyID &keyid, vAffected) { // ... and all their affected keys std::map::iterator rit = mapKeyFirstBlock.find(keyid); From c1e433b717fbc26a74ca395771076b203630a5a2 Mon Sep 17 00:00:00 2001 From: jtimon Date: Sat, 30 Aug 2014 13:40:37 +0200 Subject: [PATCH 0681/1288] Rename scriptutils.o to wallet_ismine.o --- src/Makefile.am | 4 ++-- src/test/multisig_tests.cpp | 2 +- src/test/script_P2SH_tests.cpp | 2 +- src/wallet.h | 2 +- src/{scriptutils.cpp => wallet_ismine.cpp} | 2 +- src/{scriptutils.h => wallet_ismine.h} | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) rename src/{scriptutils.cpp => wallet_ismine.cpp} (98%) rename src/{scriptutils.h => wallet_ismine.h} (91%) diff --git a/src/Makefile.am b/src/Makefile.am index 27bcdc7bcc..b2071f49e2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -103,7 +103,7 @@ BITCOIN_CORE_H = \ script/script.h \ script/sign.h \ script/standard.h \ - scriptutils.h \ + wallet_ismine.h \ serialize.h \ sync.h \ threadsafety.h \ @@ -173,7 +173,7 @@ libbitcoin_wallet_a_SOURCES = \ crypter.cpp \ rpcdump.cpp \ rpcwallet.cpp \ - scriptutils.cpp \ + wallet_ismine.cpp \ wallet.cpp \ walletdb.cpp \ $(BITCOIN_CORE_H) diff --git a/src/test/multisig_tests.cpp b/src/test/multisig_tests.cpp index 427477edcc..91dfa39505 100644 --- a/src/test/multisig_tests.cpp +++ b/src/test/multisig_tests.cpp @@ -11,7 +11,7 @@ #include "uint256.h" #ifdef ENABLE_WALLET -#include "scriptutils.h" +#include "wallet_ismine.h" #endif #include diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index b1c1052de4..f99002017f 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -9,7 +9,7 @@ #include "script/sign.h" #ifdef ENABLE_WALLET -#include "scriptutils.h" +#include "wallet_ismine.h" #endif #include diff --git a/src/wallet.h b/src/wallet.h index 6788986f88..5c26186730 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -11,7 +11,7 @@ #include "key.h" #include "keystore.h" #include "main.h" -#include "scriptutils.h" +#include "wallet_ismine.h" #include "ui_interface.h" #include "walletdb.h" diff --git a/src/scriptutils.cpp b/src/wallet_ismine.cpp similarity index 98% rename from src/scriptutils.cpp rename to src/wallet_ismine.cpp index 5099d7515a..1c2c117fad 100644 --- a/src/scriptutils.cpp +++ b/src/wallet_ismine.cpp @@ -3,7 +3,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "scriptutils.h" +#include "wallet_ismine.h" #include "key.h" #include "keystore.h" diff --git a/src/scriptutils.h b/src/wallet_ismine.h similarity index 91% rename from src/scriptutils.h rename to src/wallet_ismine.h index 4e98a1f74f..9915e9f7bb 100644 --- a/src/scriptutils.h +++ b/src/wallet_ismine.h @@ -3,8 +3,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef H_BITCOIN_SCRIPTUTILS -#define H_BITCOIN_SCRIPTUTILS +#ifndef H_BITCOIN_WALLET_ISMINE +#define H_BITCOIN_WALLET_ISMINE #include "key.h" #include "script/script.h" From def2fdb4b9b52fa908c11fe2f5a42ea04f8e9f11 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Tue, 9 Sep 2014 14:01:11 -0400 Subject: [PATCH 0682/1288] Fix crashing bug caused by orphan(s) with duplicate prevout.hash --- src/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index f063a48fe5..27100d62c2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -498,6 +498,8 @@ void static EraseOrphanTx(uint256 hash) BOOST_FOREACH(const CTxIn& txin, it->second.vin) { map >::iterator itPrev = mapOrphanTransactionsByPrev.find(txin.prevout.hash); + if (itPrev == mapOrphanTransactionsByPrev.end()) + continue; itPrev->second.erase(hash); if (itPrev->second.empty()) mapOrphanTransactionsByPrev.erase(itPrev); From e982b574a5e8878fb50f8f75c179474f2b1661dd Mon Sep 17 00:00:00 2001 From: Adam Weiss Date: Wed, 10 Sep 2014 12:26:59 -0400 Subject: [PATCH 0683/1288] Use explicit fflush() instead of setvbuf() Flushing after every line when printing to console is desirable when running with systemd but setvbuf() has slightly different semantics on Windows that causes warnings. Just do an explicit fflush() after each line print to console instead. --- src/init.cpp | 1 - src/util.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index 31f64878fb..2e18f485bf 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -630,7 +630,6 @@ bool AppInit2(boost::thread_group& threadGroup) fPrintToConsole = GetBoolArg("-printtoconsole", false); fLogTimestamps = GetBoolArg("-logtimestamps", true); fLogIPs = GetBoolArg("-logips", false); - setvbuf(stdout, NULL, _IOLBF, 0); #ifdef ENABLE_WALLET bool fDisableWallet = GetBoolArg("-disablewallet", false); #endif diff --git a/src/util.cpp b/src/util.cpp index 5a4e187f9e..20aff49c86 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -211,6 +211,7 @@ int LogPrintStr(const std::string &str) { // print to console ret = fwrite(str.data(), 1, str.size(), stdout); + fflush(stdout); } else if (fPrintToDebugLog && AreBaseParamsConfigured()) { From ec7eb0fa80ce50f0c45c7f764bf4958224721ca0 Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Mon, 8 Sep 2014 13:29:14 -0400 Subject: [PATCH 0684/1288] When reindexing check for file before trying to open (refactored) --- src/init.cpp | 4 +++- src/main.cpp | 8 +++++++- src/main.h | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 31f64878fb..4b95f29365 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -401,9 +401,11 @@ void ThreadImport(std::vector vImportFiles) int nFile = 0; while (true) { CDiskBlockPos pos(nFile, 0); + if (!boost::filesystem::exists(GetBlockPosFilename(pos, "blk"))) + break; // No block files left to reindex FILE *file = OpenBlockFile(pos, true); if (!file) - break; + break; // This error is logged in OpenBlockFile LogPrintf("Reindexing block file blk%05u.dat...\n", (unsigned int)nFile); LoadExternalBlockFile(file, &pos); nFile++; diff --git a/src/main.cpp b/src/main.cpp index a3b31b719d..0816e36633 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2766,7 +2766,7 @@ FILE* OpenDiskFile(const CDiskBlockPos &pos, const char *prefix, bool fReadOnly) { if (pos.IsNull()) return NULL; - boost::filesystem::path path = GetDataDir() / "blocks" / strprintf("%s%05u.dat", prefix, pos.nFile); + boost::filesystem::path path = GetBlockPosFilename(pos, prefix); boost::filesystem::create_directories(path.parent_path()); FILE* file = fopen(path.string().c_str(), "rb+"); if (!file && !fReadOnly) @@ -2793,6 +2793,12 @@ FILE* OpenUndoFile(const CDiskBlockPos &pos, bool fReadOnly) { return OpenDiskFile(pos, "rev", fReadOnly); } +boost::filesystem::path GetBlockPosFilename(const CDiskBlockPos &pos, const char *prefix) +{ + boost::filesystem::path path = GetDataDir() / "blocks" / strprintf("%s%05u.dat", prefix, pos.nFile); + return path; +} + CBlockIndex * InsertBlockIndex(uint256 hash) { if (hash == 0) diff --git a/src/main.h b/src/main.h index 8c0a743e24..09de2187c4 100644 --- a/src/main.h +++ b/src/main.h @@ -145,6 +145,8 @@ bool CheckDiskSpace(uint64_t nAdditionalBytes = 0); FILE* OpenBlockFile(const CDiskBlockPos &pos, bool fReadOnly = false); /** Open an undo file (rev?????.dat) */ FILE* OpenUndoFile(const CDiskBlockPos &pos, bool fReadOnly = false); +/** Translation to a filesystem path */ +boost::filesystem::path GetBlockPosFilename(const CDiskBlockPos &pos, const char *prefix); /** Import blocks from an external file */ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp = NULL); /** Initialize a new block tree database + block data on disk */ From c74332c67806ed92e6e18de174671a7c30608780 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Thu, 28 Aug 2014 13:23:24 -0400 Subject: [PATCH 0685/1288] Stricter handling of orphan transactions Prevent denial-of-service attacks by banning peers that send us invalid orphan transactions and only storing orphan transactions given to us by a peer while the peer is connected. --- src/main.cpp | 65 +++++++++++++++++++++++++++++++++--------- src/test/DoS_tests.cpp | 17 ++++++++--- 2 files changed, 65 insertions(+), 17 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 27100d62c2..6a2e6ac659 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -63,8 +63,13 @@ struct COrphanBlock { map mapOrphanBlocks; multimap mapOrphanBlocksByPrev; -map mapOrphanTransactions; +struct COrphanTx { + CTransaction tx; + NodeId fromPeer; +}; +map mapOrphanTransactions; map > mapOrphanTransactionsByPrev; +void EraseOrphansFor(NodeId peer); // Constant stuff for coinbase transactions we create: CScript COINBASE_FLAGS; @@ -264,6 +269,7 @@ void FinalizeNode(NodeId nodeid) { mapBlocksInFlight.erase(entry.hash); BOOST_FOREACH(const uint256& hash, state->vBlocksToDownload) mapBlocksToDownload.erase(hash); + EraseOrphansFor(nodeid); mapNodeState.erase(nodeid); } @@ -461,7 +467,7 @@ CBlockTreeDB *pblocktree = NULL; // mapOrphanTransactions // -bool AddOrphanTx(const CTransaction& tx) +bool AddOrphanTx(const CTransaction& tx, NodeId peer) { uint256 hash = tx.GetHash(); if (mapOrphanTransactions.count(hash)) @@ -481,21 +487,22 @@ bool AddOrphanTx(const CTransaction& tx) return false; } - mapOrphanTransactions[hash] = tx; + mapOrphanTransactions[hash].tx = tx; + mapOrphanTransactions[hash].fromPeer = peer; BOOST_FOREACH(const CTxIn& txin, tx.vin) mapOrphanTransactionsByPrev[txin.prevout.hash].insert(hash); - LogPrint("mempool", "stored orphan tx %s (mapsz %u)\n", hash.ToString(), - mapOrphanTransactions.size()); + LogPrint("mempool", "stored orphan tx %s (mapsz %u prevsz %u)\n", hash.ToString(), + mapOrphanTransactions.size(), mapOrphanTransactionsByPrev.size()); return true; } void static EraseOrphanTx(uint256 hash) { - map::iterator it = mapOrphanTransactions.find(hash); + map::iterator it = mapOrphanTransactions.find(hash); if (it == mapOrphanTransactions.end()) return; - BOOST_FOREACH(const CTxIn& txin, it->second.vin) + BOOST_FOREACH(const CTxIn& txin, it->second.tx.vin) { map >::iterator itPrev = mapOrphanTransactionsByPrev.find(txin.prevout.hash); if (itPrev == mapOrphanTransactionsByPrev.end()) @@ -507,6 +514,23 @@ void static EraseOrphanTx(uint256 hash) mapOrphanTransactions.erase(it); } +void EraseOrphansFor(NodeId peer) +{ + int nErased = 0; + map::iterator iter = mapOrphanTransactions.begin(); + while (iter != mapOrphanTransactions.end()) + { + map::iterator maybeErase = iter++; // increment to avoid iterator becoming invalid + if (maybeErase->second.fromPeer == peer) + { + EraseOrphanTx(maybeErase->second.tx.GetHash()); + ++nErased; + } + } + if (nErased > 0) LogPrint("mempool", "Erased %d orphan tx from peer %d\n", nErased, peer); +} + + unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans) { unsigned int nEvicted = 0; @@ -514,7 +538,7 @@ unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans) { // Evict a random orphan: uint256 randomhash = GetRandHash(); - map::iterator it = mapOrphanTransactions.lower_bound(randomhash); + map::iterator it = mapOrphanTransactions.lower_bound(randomhash); if (it == mapOrphanTransactions.end()) it = mapOrphanTransactions.begin(); EraseOrphanTx(it->first); @@ -3777,6 +3801,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, mempool.mapTx.size()); // Recursively process any orphan transactions that depended on this one + set setMisbehaving; for (unsigned int i = 0; i < vWorkQueue.size(); i++) { map >::iterator itByPrev = mapOrphanTransactionsByPrev.find(vWorkQueue[i]); @@ -3787,25 +3812,36 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, ++mi) { const uint256& orphanHash = *mi; - const CTransaction& orphanTx = mapOrphanTransactions[orphanHash]; + const CTransaction& orphanTx = mapOrphanTransactions[orphanHash].tx; + NodeId fromPeer = mapOrphanTransactions[orphanHash].fromPeer; bool fMissingInputs2 = false; // Use a dummy CValidationState so someone can't setup nodes to counter-DoS based on orphan // resolution (that is, feeding people an invalid transaction based on LegitTxX in order to get // anyone relaying LegitTxX banned) CValidationState stateDummy; + vEraseQueue.push_back(orphanHash); + + if (setMisbehaving.count(fromPeer)) + continue; if (AcceptToMemoryPool(mempool, stateDummy, orphanTx, true, &fMissingInputs2)) { LogPrint("mempool", " accepted orphan tx %s\n", orphanHash.ToString()); RelayTransaction(orphanTx); mapAlreadyAskedFor.erase(CInv(MSG_TX, orphanHash)); vWorkQueue.push_back(orphanHash); - vEraseQueue.push_back(orphanHash); } else if (!fMissingInputs2) { - // invalid or too-little-fee orphan - vEraseQueue.push_back(orphanHash); + int nDos = 0; + if (stateDummy.IsInvalid(nDos) && nDos > 0) + { + // Punish peer that gave us an invalid orphan tx + Misbehaving(fromPeer, nDos); + setMisbehaving.insert(fromPeer); + LogPrint("mempool", " invalid orphan tx %s\n", orphanHash.ToString()); + } + // too-little-fee orphan LogPrint("mempool", " removed orphan tx %s\n", orphanHash.ToString()); } mempool.check(pcoinsTip); @@ -3817,7 +3853,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } else if (fMissingInputs) { - AddOrphanTx(tx); + AddOrphanTx(tx, pfrom->GetId()); // DoS prevention: do not allow mapOrphanTransactions to grow unbounded unsigned int nEvicted = LimitOrphanTxSize(MAX_ORPHAN_TRANSACTIONS); @@ -4324,7 +4360,9 @@ bool SendMessages(CNode* pto, bool fSendTrickle) if (pto->addr.IsLocal()) LogPrintf("Warning: not banning local peer %s!\n", pto->addr.ToString()); else + { CNode::Ban(pto->addr); + } } state.fShouldBan = false; } @@ -4538,5 +4576,6 @@ public: // orphan transactions mapOrphanTransactions.clear(); + mapOrphanTransactionsByPrev.clear(); } } instance_of_cmaincleanup; diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index fa4edff63f..e019674816 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -24,7 +24,8 @@ #include // Tests this internal-to-main.cpp method: -extern bool AddOrphanTx(const CTransaction& tx); +extern bool AddOrphanTx(const CTransaction& tx, NodeId peer); +extern void EraseOrphansFor(NodeId peer); extern unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans); extern std::map mapOrphanTransactions; extern std::map > mapOrphanTransactionsByPrev; @@ -174,7 +175,7 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans) tx.vout[0].nValue = 1*CENT; tx.vout[0].scriptPubKey.SetDestination(key.GetPubKey().GetID()); - AddOrphanTx(tx); + AddOrphanTx(tx, i); } // ... and 50 that depend on other orphans: @@ -191,7 +192,7 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans) tx.vout[0].scriptPubKey.SetDestination(key.GetPubKey().GetID()); SignSignature(keystore, txPrev, tx, 0); - AddOrphanTx(tx); + AddOrphanTx(tx, i); } // This really-big orphan should be ignored: @@ -215,7 +216,15 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans) for (unsigned int j = 1; j < tx.vin.size(); j++) tx.vin[j].scriptSig = tx.vin[0].scriptSig; - BOOST_CHECK(!AddOrphanTx(tx)); + BOOST_CHECK(!AddOrphanTx(tx, i)); + } + + // Test EraseOrphansFor: + for (NodeId i = 0; i < 3; i++) + { + size_t sizeBefore = mapOrphanTransactions.size(); + EraseOrphansFor(i); + BOOST_CHECK(mapOrphanTransactions.size() < sizeBefore); } // Test LimitOrphanTxSize() function: From aa3c697e90c02d5797a59a7bfb1ecac6fbd918cf Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Wed, 10 Sep 2014 14:08:03 -0400 Subject: [PATCH 0686/1288] Store fewer orphan tx by default, add -maxorphantx option There is no reason to store thousands of orphan transactions; normally an orphan's parents will either be broadcast or mined reasonably quickly. This pull drops the maximum number of orphans from 10,000 down to 100, and adds a command-line option (-maxorphantx) that is just like -maxorphanblocks to override the default. --- src/init.cpp | 1 + src/main.cpp | 3 ++- src/main.h | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 31f64878fb..8f336c31fb 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -226,6 +226,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -dbcache= " + strprintf(_("Set database cache size in megabytes (%d to %d, default: %d)"), nMinDbCache, nMaxDbCache, nDefaultDbCache) + "\n"; strUsage += " -loadblock= " + _("Imports blocks from external blk000??.dat file") + " " + _("on startup") + "\n"; strUsage += " -maxorphanblocks= " + strprintf(_("Keep at most unconnectable blocks in memory (default: %u)"), DEFAULT_MAX_ORPHAN_BLOCKS) + "\n"; + strUsage += " -maxorphantx= " + strprintf(_("Keep at most unconnectable transactions in memory (default: %u)"), DEFAULT_MAX_ORPHAN_TRANSACTIONS) + "\n"; strUsage += " -par= " + strprintf(_("Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)"), -(int)boost::thread::hardware_concurrency(), MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS) + "\n"; strUsage += " -pid= " + _("Specify pid file (default: bitcoind.pid)") + "\n"; strUsage += " -reindex " + _("Rebuild block chain index from current blk000??.dat files") + " " + _("on startup") + "\n"; diff --git a/src/main.cpp b/src/main.cpp index 6a2e6ac659..f978254961 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3856,7 +3856,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, AddOrphanTx(tx, pfrom->GetId()); // DoS prevention: do not allow mapOrphanTransactions to grow unbounded - unsigned int nEvicted = LimitOrphanTxSize(MAX_ORPHAN_TRANSACTIONS); + unsigned int nMaxOrphanTx = (unsigned int)std::max((int64_t)0, GetArg("-maxorphantx", DEFAULT_MAX_ORPHAN_TRANSACTIONS)); + unsigned int nEvicted = LimitOrphanTxSize(nMaxOrphanTx); if (nEvicted > 0) LogPrint("mempool", "mapOrphan overflow, removed %u tx\n", nEvicted); } else if (pfrom->fWhitelisted) { diff --git a/src/main.h b/src/main.h index 30cccab2f1..d340fd0b6a 100644 --- a/src/main.h +++ b/src/main.h @@ -51,8 +51,8 @@ static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50; static const unsigned int MAX_P2SH_SIGOPS = 15; /** The maximum number of sigops we're willing to relay/mine in a single tx */ static const unsigned int MAX_TX_SIGOPS = MAX_BLOCK_SIGOPS/5; -/** The maximum number of orphan transactions kept in memory */ -static const unsigned int MAX_ORPHAN_TRANSACTIONS = MAX_BLOCK_SIZE/100; +/** Default for -maxorphantx, maximum number of orphan transactions kept in memory */ +static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100; /** Default for -maxorphanblocks, maximum number of orphan blocks kept in memory */ static const unsigned int DEFAULT_MAX_ORPHAN_BLOCKS = 750; /** The maximum size of a blk?????.dat file (since 0.8) */ From 07d5287f42ececa2e059724c7c5bba55c8658bc6 Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Thu, 11 Sep 2014 09:22:39 -0400 Subject: [PATCH 0687/1288] Catch error when done reading files --- contrib/linearize/linearize-data.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/linearize/linearize-data.py b/contrib/linearize/linearize-data.py index 383bb38198..3b5d198c14 100755 --- a/contrib/linearize/linearize-data.py +++ b/contrib/linearize/linearize-data.py @@ -110,7 +110,11 @@ def copydata(settings, blkindex, blkset): if not inF: fname = "%s/blk%05d.dat" % (settings['input'], inFn) print("Input file" + fname) - inF = open(fname, "rb") + try: + inF = open(fname, "rb") + except IOError: + print "Done" + return inhdr = inF.read(8) if (not inhdr or (inhdr[0] == "\0")): From efad808aaece74a0308a77e35ad35e845edb97f8 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 12 Sep 2014 16:37:53 +0200 Subject: [PATCH 0688/1288] Avoid reject message feedback loops --- src/main.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f978254961..7a126ca495 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4106,21 +4106,25 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, else if (strCommand == "reject") { - if (fDebug) - { - string strMsg; unsigned char ccode; string strReason; - vRecv >> LIMITED_STRING(strMsg, CMessageHeader::COMMAND_SIZE) >> ccode >> LIMITED_STRING(strReason, 111); + if (fDebug) { + try { + string strMsg; unsigned char ccode; string strReason; + vRecv >> LIMITED_STRING(strMsg, CMessageHeader::COMMAND_SIZE) >> ccode >> LIMITED_STRING(strReason, 111); - ostringstream ss; - ss << strMsg << " code " << itostr(ccode) << ": " << strReason; + ostringstream ss; + ss << strMsg << " code " << itostr(ccode) << ": " << strReason; - if (strMsg == "block" || strMsg == "tx") - { - uint256 hash; - vRecv >> hash; - ss << ": hash " << hash.ToString(); + if (strMsg == "block" || strMsg == "tx") + { + uint256 hash; + vRecv >> hash; + ss << ": hash " << hash.ToString(); + } + LogPrint("net", "Reject %s\n", SanitizeString(ss.str())); + } catch (std::ios_base::failure& e) { + // Avoid feedback loops by preventing reject messages from triggering a new reject message. + LogPrint("net", "Unparseable reject message received\n"); } - LogPrint("net", "Reject %s\n", SanitizeString(ss.str())); } } From 358562b65189dce982ad30a1c158606a540e9bcb Mon Sep 17 00:00:00 2001 From: jtimon Date: Fri, 18 Jul 2014 15:41:55 +0200 Subject: [PATCH 0689/1288] Remove unused function main:VerifySignature --- src/main.cpp | 5 ----- src/main.h | 2 -- src/test/script_P2SH_tests.cpp | 2 +- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f978254961..2163b90bfe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1372,11 +1372,6 @@ bool CScriptCheck::operator()() const { return true; } -bool VerifySignature(const CCoins& txFrom, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType) -{ - return CScriptCheck(txFrom, txTo, nIn, flags, nHashType)(); -} - bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsViewCache &inputs, bool fScriptChecks, unsigned int flags, std::vector *pvChecks) { if (!tx.IsCoinBase()) diff --git a/src/main.h b/src/main.h index d340fd0b6a..f7682c213c 100644 --- a/src/main.h +++ b/src/main.h @@ -174,8 +174,6 @@ int64_t GetBlockValue(int nHeight, int64_t nFees); /** Create a new block index entry for a given block hash */ CBlockIndex * InsertBlockIndex(uint256 hash); -/** Verify a signature */ -bool VerifySignature(const CCoins& txFrom, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); /** Abort with a message */ bool AbortNode(const std::string &msg); /** Get statistics from node state */ diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index f99002017f..ef63d9d349 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -113,7 +113,7 @@ BOOST_AUTO_TEST_CASE(sign) { CScript sigSave = txTo[i].vin[0].scriptSig; txTo[i].vin[0].scriptSig = txTo[j].vin[0].scriptSig; - bool sigOK = VerifySignature(CCoins(txFrom, 0), txTo[i], 0, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC, 0); + bool sigOK = CScriptCheck(CCoins(txFrom, 0), txTo[i], 0, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC, 0)(); if (i == j) BOOST_CHECK_MESSAGE(sigOK, strprintf("VerifySignature %d %d", i, j)); else From ce3649fb61b2b421aa4e36ab107e5f2f9838378b Mon Sep 17 00:00:00 2001 From: jtimon Date: Fri, 18 Jul 2014 16:51:33 +0200 Subject: [PATCH 0690/1288] Remove CScriptCheck::nHashType (was always 0) --- src/main.cpp | 6 +++--- src/main.h | 8 +++----- src/test/script_P2SH_tests.cpp | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 2163b90bfe..2fde266f11 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1367,7 +1367,7 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach bool CScriptCheck::operator()() const { const CScript &scriptSig = ptxTo->vin[nIn].scriptSig; - if (!VerifyScript(scriptSig, scriptPubKey, *ptxTo, nIn, nFlags, nHashType)) + if (!VerifyScript(scriptSig, scriptPubKey, *ptxTo, nIn, nFlags, 0)) return error("CScriptCheck() : %s VerifySignature failed", ptxTo->GetHash().ToString()); return true; } @@ -1440,7 +1440,7 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi assert(coins); // Verify signature - CScriptCheck check(*coins, tx, i, flags, 0); + CScriptCheck check(*coins, tx, i, flags); if (pvChecks) { pvChecks->push_back(CScriptCheck()); check.swap(pvChecks->back()); @@ -1453,7 +1453,7 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi // avoid splitting the network between upgraded and // non-upgraded nodes. CScriptCheck check(*coins, tx, i, - flags & ~STANDARD_NOT_MANDATORY_VERIFY_FLAGS, 0); + flags & ~STANDARD_NOT_MANDATORY_VERIFY_FLAGS); if (check()) return state.Invalid(false, REJECT_NONSTANDARD, "non-mandatory-script-verify-flag"); } diff --git a/src/main.h b/src/main.h index f7682c213c..2ec1691471 100644 --- a/src/main.h +++ b/src/main.h @@ -340,13 +340,12 @@ private: const CTransaction *ptxTo; unsigned int nIn; unsigned int nFlags; - int nHashType; public: - CScriptCheck(): ptxTo(0), nIn(0), nFlags(0), nHashType(0) {} - CScriptCheck(const CCoins& txFromIn, const CTransaction& txToIn, unsigned int nInIn, unsigned int nFlagsIn, int nHashTypeIn) : + CScriptCheck(): ptxTo(0), nIn(0), nFlags(0) {} + CScriptCheck(const CCoins& txFromIn, const CTransaction& txToIn, unsigned int nInIn, unsigned int nFlagsIn) : scriptPubKey(txFromIn.vout[txToIn.vin[nInIn].prevout.n].scriptPubKey), - ptxTo(&txToIn), nIn(nInIn), nFlags(nFlagsIn), nHashType(nHashTypeIn) { } + ptxTo(&txToIn), nIn(nInIn), nFlags(nFlagsIn) { } bool operator()() const; @@ -355,7 +354,6 @@ public: std::swap(ptxTo, check.ptxTo); std::swap(nIn, check.nIn); std::swap(nFlags, check.nFlags); - std::swap(nHashType, check.nHashType); } }; diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index ef63d9d349..add1987664 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -113,7 +113,7 @@ BOOST_AUTO_TEST_CASE(sign) { CScript sigSave = txTo[i].vin[0].scriptSig; txTo[i].vin[0].scriptSig = txTo[j].vin[0].scriptSig; - bool sigOK = CScriptCheck(CCoins(txFrom, 0), txTo[i], 0, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC, 0)(); + bool sigOK = CScriptCheck(CCoins(txFrom, 0), txTo[i], 0, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC)(); if (i == j) BOOST_CHECK_MESSAGE(sigOK, strprintf("VerifySignature %d %d", i, j)); else From 2b23a87599b7d28e86ca193e7b52f429bcdf144f Mon Sep 17 00:00:00 2001 From: jtimon Date: Fri, 18 Jul 2014 17:48:00 +0200 Subject: [PATCH 0691/1288] Don't pass nHashType to VerifyScript --- src/bitcoin-tx.cpp | 2 +- src/main.cpp | 2 +- src/rpcrawtransaction.cpp | 2 +- src/script/interpreter.cpp | 9 ++++----- src/script/interpreter.h | 2 +- src/script/sign.cpp | 2 +- src/test/multisig_tests.cpp | 18 +++++++++--------- src/test/script_P2SH_tests.cpp | 2 +- src/test/script_tests.cpp | 30 +++++++++++++++--------------- src/test/transaction_tests.cpp | 4 ++-- 10 files changed, 36 insertions(+), 37 deletions(-) diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 91525b51c9..1e27d400c8 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -436,7 +436,7 @@ static void MutateTxSign(CMutableTransaction& tx, const string& flagStr) BOOST_FOREACH(const CTransaction& txv, txVariants) { txin.scriptSig = CombineSignatures(prevPubKey, mergedTx, i, txin.scriptSig, txv.vin[i].scriptSig); } - if (!VerifyScript(txin.scriptSig, prevPubKey, mergedTx, i, STANDARD_SCRIPT_VERIFY_FLAGS, 0)) + if (!VerifyScript(txin.scriptSig, prevPubKey, mergedTx, i, STANDARD_SCRIPT_VERIFY_FLAGS)) fComplete = false; } diff --git a/src/main.cpp b/src/main.cpp index 2fde266f11..c59bc40c69 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1367,7 +1367,7 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach bool CScriptCheck::operator()() const { const CScript &scriptSig = ptxTo->vin[nIn].scriptSig; - if (!VerifyScript(scriptSig, scriptPubKey, *ptxTo, nIn, nFlags, 0)) + if (!VerifyScript(scriptSig, scriptPubKey, *ptxTo, nIn, nFlags)) return error("CScriptCheck() : %s VerifySignature failed", ptxTo->GetHash().ToString()); return true; } diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index c5c99870fc..5730f72a85 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -688,7 +688,7 @@ Value signrawtransaction(const Array& params, bool fHelp) BOOST_FOREACH(const CMutableTransaction& txv, txVariants) { txin.scriptSig = CombineSignatures(prevPubKey, mergedTx, i, txin.scriptSig, txv.vin[i].scriptSig); } - if (!VerifyScript(txin.scriptSig, prevPubKey, mergedTx, i, STANDARD_SCRIPT_VERIFY_FLAGS, 0)) + if (!VerifyScript(txin.scriptSig, prevPubKey, mergedTx, i, STANDARD_SCRIPT_VERIFY_FLAGS)) fComplete = false; } diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 4f4fdb6b7f..0b3d63e5d3 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -1006,15 +1006,14 @@ bool CheckSig(vector vchSig, const vector &vchPubK return true; } -bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, - unsigned int flags, int nHashType) +bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags) { vector > stack, stackCopy; - if (!EvalScript(stack, scriptSig, txTo, nIn, flags, nHashType)) + if (!EvalScript(stack, scriptSig, txTo, nIn, flags, 0)) return false; if (flags & SCRIPT_VERIFY_P2SH) stackCopy = stack; - if (!EvalScript(stack, scriptPubKey, txTo, nIn, flags, nHashType)) + if (!EvalScript(stack, scriptPubKey, txTo, nIn, flags, 0)) return false; if (stack.empty()) return false; @@ -1037,7 +1036,7 @@ bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const C CScript pubKey2(pubKeySerialized.begin(), pubKeySerialized.end()); popstack(stackCopy); - if (!EvalScript(stackCopy, pubKey2, txTo, nIn, flags, nHashType)) + if (!EvalScript(stackCopy, pubKey2, txTo, nIn, flags, 0)) return false; if (stackCopy.empty()) return false; diff --git a/src/script/interpreter.h b/src/script/interpreter.h index 0c6f8b9d13..ca57387a13 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -40,6 +40,6 @@ bool IsCanonicalSignature(const std::vector &vchSig, unsigned int uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType); bool CheckSig(std::vector vchSig, const std::vector &vchPubKey, const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, int flags); bool EvalScript(std::vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); -bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); +bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags); #endif diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 958177de3d..7037193b9c 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -123,7 +123,7 @@ bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CMutabl } // Test solution - return VerifyScript(txin.scriptSig, fromPubKey, txTo, nIn, STANDARD_SCRIPT_VERIFY_FLAGS, 0); + return VerifyScript(txin.scriptSig, fromPubKey, txTo, nIn, STANDARD_SCRIPT_VERIFY_FLAGS); } bool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType) diff --git a/src/test/multisig_tests.cpp b/src/test/multisig_tests.cpp index 91dfa39505..cb37740068 100644 --- a/src/test/multisig_tests.cpp +++ b/src/test/multisig_tests.cpp @@ -82,19 +82,19 @@ BOOST_AUTO_TEST_CASE(multisig_verify) keys.clear(); keys += key[0],key[1]; // magic operator+= from boost.assign s = sign_multisig(a_and_b, keys, txTo[0], 0); - BOOST_CHECK(VerifyScript(s, a_and_b, txTo[0], 0, flags, 0)); + BOOST_CHECK(VerifyScript(s, a_and_b, txTo[0], 0, flags)); for (int i = 0; i < 4; i++) { keys.clear(); keys += key[i]; s = sign_multisig(a_and_b, keys, txTo[0], 0); - BOOST_CHECK_MESSAGE(!VerifyScript(s, a_and_b, txTo[0], 0, flags, 0), strprintf("a&b 1: %d", i)); + BOOST_CHECK_MESSAGE(!VerifyScript(s, a_and_b, txTo[0], 0, flags), strprintf("a&b 1: %d", i)); keys.clear(); keys += key[1],key[i]; s = sign_multisig(a_and_b, keys, txTo[0], 0); - BOOST_CHECK_MESSAGE(!VerifyScript(s, a_and_b, txTo[0], 0, flags, 0), strprintf("a&b 2: %d", i)); + BOOST_CHECK_MESSAGE(!VerifyScript(s, a_and_b, txTo[0], 0, flags), strprintf("a&b 2: %d", i)); } // Test a OR b: @@ -104,16 +104,16 @@ BOOST_AUTO_TEST_CASE(multisig_verify) keys += key[i]; s = sign_multisig(a_or_b, keys, txTo[1], 0); if (i == 0 || i == 1) - BOOST_CHECK_MESSAGE(VerifyScript(s, a_or_b, txTo[1], 0, flags, 0), strprintf("a|b: %d", i)); + BOOST_CHECK_MESSAGE(VerifyScript(s, a_or_b, txTo[1], 0, flags), strprintf("a|b: %d", i)); else - BOOST_CHECK_MESSAGE(!VerifyScript(s, a_or_b, txTo[1], 0, flags, 0), strprintf("a|b: %d", i)); + BOOST_CHECK_MESSAGE(!VerifyScript(s, a_or_b, txTo[1], 0, flags), strprintf("a|b: %d", i)); } s.clear(); s << OP_0 << OP_0; - BOOST_CHECK(!VerifyScript(s, a_or_b, txTo[1], 0, flags, 0)); + BOOST_CHECK(!VerifyScript(s, a_or_b, txTo[1], 0, flags)); s.clear(); s << OP_0 << OP_1; - BOOST_CHECK(!VerifyScript(s, a_or_b, txTo[1], 0, flags, 0)); + BOOST_CHECK(!VerifyScript(s, a_or_b, txTo[1], 0, flags)); for (int i = 0; i < 4; i++) @@ -123,9 +123,9 @@ BOOST_AUTO_TEST_CASE(multisig_verify) keys += key[i],key[j]; s = sign_multisig(escrow, keys, txTo[2], 0); if (i < j && i < 3 && j < 3) - BOOST_CHECK_MESSAGE(VerifyScript(s, escrow, txTo[2], 0, flags, 0), strprintf("escrow 1: %d %d", i, j)); + BOOST_CHECK_MESSAGE(VerifyScript(s, escrow, txTo[2], 0, flags), strprintf("escrow 1: %d %d", i, j)); else - BOOST_CHECK_MESSAGE(!VerifyScript(s, escrow, txTo[2], 0, flags, 0), strprintf("escrow 2: %d %d", i, j)); + BOOST_CHECK_MESSAGE(!VerifyScript(s, escrow, txTo[2], 0, flags), strprintf("escrow 2: %d %d", i, j)); } } diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index add1987664..d866380229 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -42,7 +42,7 @@ Verify(const CScript& scriptSig, const CScript& scriptPubKey, bool fStrict) txTo.vin[0].scriptSig = scriptSig; txTo.vout[0].nValue = 1; - return VerifyScript(scriptSig, scriptPubKey, txTo, 0, fStrict ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE, 0); + return VerifyScript(scriptSig, scriptPubKey, txTo, 0, fStrict ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE); } diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index bc610778c4..0b4035f8d7 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -77,7 +77,7 @@ BOOST_AUTO_TEST_CASE(script_valid) unsigned int scriptflags = ParseScriptFlags(test[2].get_str()); CTransaction tx; - BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, tx, 0, scriptflags, SIGHASH_NONE), strTest); + BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, tx, 0, scriptflags), strTest); } } @@ -102,7 +102,7 @@ BOOST_AUTO_TEST_CASE(script_invalid) unsigned int scriptflags = ParseScriptFlags(test[2].get_str()); CTransaction tx; - BOOST_CHECK_MESSAGE(!VerifyScript(scriptSig, scriptPubKey, tx, 0, scriptflags, SIGHASH_NONE), strTest); + BOOST_CHECK_MESSAGE(!VerifyScript(scriptSig, scriptPubKey, tx, 0, scriptflags), strTest); } } @@ -185,15 +185,15 @@ BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG12) txTo12.vout[0].nValue = 1; CScript goodsig1 = sign_multisig(scriptPubKey12, key1, txTo12); - BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey12, txTo12, 0, flags, 0)); + BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey12, txTo12, 0, flags)); txTo12.vout[0].nValue = 2; - BOOST_CHECK(!VerifyScript(goodsig1, scriptPubKey12, txTo12, 0, flags, 0)); + BOOST_CHECK(!VerifyScript(goodsig1, scriptPubKey12, txTo12, 0, flags)); CScript goodsig2 = sign_multisig(scriptPubKey12, key2, txTo12); - BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey12, txTo12, 0, flags, 0)); + BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey12, txTo12, 0, flags)); CScript badsig1 = sign_multisig(scriptPubKey12, key3, txTo12); - BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey12, txTo12, 0, flags, 0)); + BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey12, txTo12, 0, flags)); } BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG23) @@ -221,46 +221,46 @@ BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG23) std::vector keys; keys.push_back(key1); keys.push_back(key2); CScript goodsig1 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey23, txTo23, 0, flags, 0)); + BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey23, txTo23, 0, flags)); keys.clear(); keys.push_back(key1); keys.push_back(key3); CScript goodsig2 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey23, txTo23, 0, flags, 0)); + BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey23, txTo23, 0, flags)); keys.clear(); keys.push_back(key2); keys.push_back(key3); CScript goodsig3 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(VerifyScript(goodsig3, scriptPubKey23, txTo23, 0, flags, 0)); + BOOST_CHECK(VerifyScript(goodsig3, scriptPubKey23, txTo23, 0, flags)); keys.clear(); keys.push_back(key2); keys.push_back(key2); // Can't re-use sig CScript badsig1 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey23, txTo23, 0, flags, 0)); + BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey23, txTo23, 0, flags)); keys.clear(); keys.push_back(key2); keys.push_back(key1); // sigs must be in correct order CScript badsig2 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig2, scriptPubKey23, txTo23, 0, flags, 0)); + BOOST_CHECK(!VerifyScript(badsig2, scriptPubKey23, txTo23, 0, flags)); keys.clear(); keys.push_back(key3); keys.push_back(key2); // sigs must be in correct order CScript badsig3 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig3, scriptPubKey23, txTo23, 0, flags, 0)); + BOOST_CHECK(!VerifyScript(badsig3, scriptPubKey23, txTo23, 0, flags)); keys.clear(); keys.push_back(key4); keys.push_back(key2); // sigs must match pubkeys CScript badsig4 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig4, scriptPubKey23, txTo23, 0, flags, 0)); + BOOST_CHECK(!VerifyScript(badsig4, scriptPubKey23, txTo23, 0, flags)); keys.clear(); keys.push_back(key1); keys.push_back(key4); // sigs must match pubkeys CScript badsig5 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig5, scriptPubKey23, txTo23, 0, flags, 0)); + BOOST_CHECK(!VerifyScript(badsig5, scriptPubKey23, txTo23, 0, flags)); keys.clear(); // Must have signatures CScript badsig6 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig6, scriptPubKey23, txTo23, 0, flags, 0)); + BOOST_CHECK(!VerifyScript(badsig6, scriptPubKey23, txTo23, 0, flags)); } BOOST_AUTO_TEST_CASE(script_combineSigs) diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 21377395cf..42f400ef41 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -121,7 +121,7 @@ BOOST_AUTO_TEST_CASE(tx_valid) unsigned int verify_flags = ParseScriptFlags(test[2].get_str()); BOOST_CHECK_MESSAGE(VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout], - tx, i, verify_flags, 0), + tx, i, verify_flags), strTest); } } @@ -194,7 +194,7 @@ BOOST_AUTO_TEST_CASE(tx_invalid) unsigned int verify_flags = ParseScriptFlags(test[2].get_str()); fValid = VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout], - tx, i, verify_flags, 0); + tx, i, verify_flags); } BOOST_CHECK_MESSAGE(!fValid, strTest); From 6dcfda2dc48bee2148acd571dce7d3f09608d7a2 Mon Sep 17 00:00:00 2001 From: jtimon Date: Fri, 18 Jul 2014 18:47:10 +0200 Subject: [PATCH 0692/1288] Don't pass nHashType to EvalScript nor CheckSig --- src/main.cpp | 2 +- src/script/interpreter.cpp | 19 ++++++++----------- src/script/interpreter.h | 4 ++-- src/script/sign.cpp | 6 +++--- src/test/script_tests.cpp | 8 ++++---- 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c59bc40c69..134e87fc99 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -697,7 +697,7 @@ bool AreInputsStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs) // IsStandard() will have already returned false // and this method isn't called. vector > stack; - if (!EvalScript(stack, tx.vin[i].scriptSig, tx, i, false, 0)) + if (!EvalScript(stack, tx.vin[i].scriptSig, tx, i, false)) return false; if (whichType == TX_SCRIPTHASH) diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 0b3d63e5d3..c745564599 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -132,7 +132,7 @@ bool IsCanonicalSignature(const valtype &vchSig, unsigned int flags) { return true; } -bool EvalScript(vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType) +bool EvalScript(vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags) { CScript::const_iterator pc = script.begin(); CScript::const_iterator pend = script.end(); @@ -675,7 +675,7 @@ bool EvalScript(vector >& stack, const CScript& script, co scriptCode.FindAndDelete(CScript(vchSig)); bool fSuccess = IsCanonicalSignature(vchSig, flags) && IsCanonicalPubKey(vchPubKey, flags) && - CheckSig(vchSig, vchPubKey, scriptCode, txTo, nIn, nHashType, flags); + CheckSig(vchSig, vchPubKey, scriptCode, txTo, nIn, flags); popstack(stack); popstack(stack); @@ -736,7 +736,7 @@ bool EvalScript(vector >& stack, const CScript& script, co // Check signature bool fOk = IsCanonicalSignature(vchSig, flags) && IsCanonicalPubKey(vchPubKey, flags) && - CheckSig(vchSig, vchPubKey, scriptCode, txTo, nIn, nHashType, flags); + CheckSig(vchSig, vchPubKey, scriptCode, txTo, nIn, flags); if (fOk) { isig++; @@ -975,7 +975,7 @@ public: } }; -bool CheckSig(vector vchSig, const vector &vchPubKey, const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, int flags) +bool CheckSig(vector vchSig, const vector& vchPubKey, const CScript& scriptCode, const CTransaction& txTo, unsigned int nIn, int flags) { static CSignatureCache signatureCache; @@ -986,10 +986,7 @@ bool CheckSig(vector vchSig, const vector &vchPubK // Hash type is one byte tacked on to the end of the signature if (vchSig.empty()) return false; - if (nHashType == 0) - nHashType = vchSig.back(); - else if (nHashType != vchSig.back()) - return false; + int nHashType = vchSig.back(); vchSig.pop_back(); uint256 sighash = SignatureHash(scriptCode, txTo, nIn, nHashType); @@ -1009,11 +1006,11 @@ bool CheckSig(vector vchSig, const vector &vchPubK bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags) { vector > stack, stackCopy; - if (!EvalScript(stack, scriptSig, txTo, nIn, flags, 0)) + if (!EvalScript(stack, scriptSig, txTo, nIn, flags)) return false; if (flags & SCRIPT_VERIFY_P2SH) stackCopy = stack; - if (!EvalScript(stack, scriptPubKey, txTo, nIn, flags, 0)) + if (!EvalScript(stack, scriptPubKey, txTo, nIn, flags)) return false; if (stack.empty()) return false; @@ -1036,7 +1033,7 @@ bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const C CScript pubKey2(pubKeySerialized.begin(), pubKeySerialized.end()); popstack(stackCopy); - if (!EvalScript(stackCopy, pubKey2, txTo, nIn, flags, 0)) + if (!EvalScript(stackCopy, pubKey2, txTo, nIn, flags)) return false; if (stackCopy.empty()) return false; diff --git a/src/script/interpreter.h b/src/script/interpreter.h index ca57387a13..0c00eefe7d 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -38,8 +38,8 @@ bool IsCanonicalPubKey(const std::vector &vchPubKey, unsigned int bool IsCanonicalSignature(const std::vector &vchSig, unsigned int flags); uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType); -bool CheckSig(std::vector vchSig, const std::vector &vchPubKey, const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, int flags); -bool EvalScript(std::vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); +bool CheckSig(std::vector vchSig, const std::vector &vchPubKey, const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int flags); +bool EvalScript(std::vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags); bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags); #endif diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 7037193b9c..cbddc1b72a 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -174,7 +174,7 @@ static CScript CombineMultisig(CScript scriptPubKey, const CMutableTransaction& if (sigs.count(pubkey)) continue; // Already got a sig for this pubkey - if (CheckSig(sig, pubkey, scriptPubKey, txTo, nIn, 0, 0)) + if (CheckSig(sig, pubkey, scriptPubKey, txTo, nIn, 0)) { sigs[pubkey] = sig; break; @@ -252,9 +252,9 @@ CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsign Solver(scriptPubKey, txType, vSolutions); vector stack1; - EvalScript(stack1, scriptSig1, CTransaction(), 0, SCRIPT_VERIFY_STRICTENC, 0); + EvalScript(stack1, scriptSig1, CTransaction(), 0, SCRIPT_VERIFY_STRICTENC); vector stack2; - EvalScript(stack2, scriptSig2, CTransaction(), 0, SCRIPT_VERIFY_STRICTENC, 0); + EvalScript(stack2, scriptSig2, CTransaction(), 0, SCRIPT_VERIFY_STRICTENC); return CombineSignatures(scriptPubKey, txTo, nIn, txType, vSolutions, stack1, stack2); } diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 0b4035f8d7..fc4cf05ebd 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -116,18 +116,18 @@ BOOST_AUTO_TEST_CASE(script_PushData) static const unsigned char pushdata4[] = { OP_PUSHDATA4, 1, 0, 0, 0, 0x5a }; vector > directStack; - BOOST_CHECK(EvalScript(directStack, CScript(&direct[0], &direct[sizeof(direct)]), CTransaction(), 0, true, 0)); + BOOST_CHECK(EvalScript(directStack, CScript(&direct[0], &direct[sizeof(direct)]), CTransaction(), 0, true)); vector > pushdata1Stack; - BOOST_CHECK(EvalScript(pushdata1Stack, CScript(&pushdata1[0], &pushdata1[sizeof(pushdata1)]), CTransaction(), 0, true, 0)); + BOOST_CHECK(EvalScript(pushdata1Stack, CScript(&pushdata1[0], &pushdata1[sizeof(pushdata1)]), CTransaction(), 0, true)); BOOST_CHECK(pushdata1Stack == directStack); vector > pushdata2Stack; - BOOST_CHECK(EvalScript(pushdata2Stack, CScript(&pushdata2[0], &pushdata2[sizeof(pushdata2)]), CTransaction(), 0, true, 0)); + BOOST_CHECK(EvalScript(pushdata2Stack, CScript(&pushdata2[0], &pushdata2[sizeof(pushdata2)]), CTransaction(), 0, true)); BOOST_CHECK(pushdata2Stack == directStack); vector > pushdata4Stack; - BOOST_CHECK(EvalScript(pushdata4Stack, CScript(&pushdata4[0], &pushdata4[sizeof(pushdata4)]), CTransaction(), 0, true, 0)); + BOOST_CHECK(EvalScript(pushdata4Stack, CScript(&pushdata4[0], &pushdata4[sizeof(pushdata4)]), CTransaction(), 0, true)); BOOST_CHECK(pushdata4Stack == directStack); } From 15ef1b905b3b468a024b8d5b20c94d80d3c4296a Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sun, 14 Sep 2014 05:28:41 +0000 Subject: [PATCH 0693/1288] Bugfix: bitcoin-tx: scriptPubKey may be null, so accept outscript=: --- src/bitcoin-tx.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 91525b51c9..70819ff2e5 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -237,8 +237,7 @@ static void MutateTxAddOutScript(CMutableTransaction& tx, const string& strInput // separate VALUE:SCRIPT in string size_t pos = strInput.find(':'); if ((pos == string::npos) || - (pos == 0) || - (pos == (strInput.size() - 1))) + (pos == 0)) throw runtime_error("TX output missing separator"); // extract and validate VALUE From a65e320747133723f02c1947a4cc257214325b0b Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sun, 14 Sep 2014 06:01:51 +0000 Subject: [PATCH 0694/1288] bitcoin-util-test: Test bitcoin-tx with null scriptPubKey --- src/Makefile.test.include | 3 ++- src/test/data/bitcoin-util-test.json | 3 +++ src/test/data/txcreate2.hex | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 src/test/data/txcreate2.hex diff --git a/src/Makefile.test.include b/src/Makefile.test.include index b4360831bb..ab449f3e71 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -13,7 +13,8 @@ EXTRA_DIST += \ test/data/tt-delout1-out.hex \ test/data/tt-locktime317000-out.hex \ test/data/tx394b54bb.hex \ - test/data/txcreate1.hex + test/data/txcreate1.hex \ + test/data/txcreate2.hex JSON_TEST_FILES = \ test/data/script_valid.json \ diff --git a/src/test/data/bitcoin-util-test.json b/src/test/data/bitcoin-util-test.json index 7db87d7c11..cb74d73ef2 100644 --- a/src/test/data/bitcoin-util-test.json +++ b/src/test/data/bitcoin-util-test.json @@ -34,5 +34,8 @@ "outaddr=0.18:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o", "outaddr=4:1P8yWvZW8jVihP1bzHeqfE4aoXNX8AVa46"], "output_cmp": "txcreate1.hex" + }, + { "exec": ["./bitcoin-tx", "-create", "outscript=0:"], + "output_cmp": "txcreate2.hex" } ] diff --git a/src/test/data/txcreate2.hex b/src/test/data/txcreate2.hex new file mode 100644 index 0000000000..5243c2d02e --- /dev/null +++ b/src/test/data/txcreate2.hex @@ -0,0 +1 @@ +01000000000100000000000000000000000000 From 2d79bba36b028dd803fb17124420b9d209b842b6 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 9 Sep 2014 10:00:42 +0200 Subject: [PATCH 0695/1288] cleanup new script files (no code changes) - add missing header end comments - ensure alphabetical ordering - update copyright year and license --- src/Makefile.am | 4 ++-- src/script/compressor.cpp | 4 ++-- src/script/compressor.h | 6 +++--- src/script/interpreter.cpp | 4 ++-- src/script/interpreter.h | 8 ++++---- src/script/script.cpp | 4 ++-- src/script/script.h | 6 +++--- src/script/sign.cpp | 4 ++-- src/script/sign.h | 7 ++++--- src/script/standard.cpp | 4 ++-- src/script/standard.h | 6 +++--- src/wallet_ismine.cpp | 4 ++-- src/wallet_ismine.h | 6 +++--- 13 files changed, 34 insertions(+), 33 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index b2071f49e2..78bb6cd6d1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -98,8 +98,8 @@ BITCOIN_CORE_H = \ rpcclient.h \ rpcprotocol.h \ rpcserver.h \ - script/interpreter.h \ script/compressor.h \ + script/interpreter.h \ script/script.h \ script/sign.h \ script/standard.h \ @@ -212,8 +212,8 @@ libbitcoin_common_a_SOURCES = \ keystore.cpp \ netbase.cpp \ protocol.cpp \ - script/interpreter.cpp \ script/compressor.cpp \ + script/interpreter.cpp \ script/script.cpp \ script/sign.cpp \ script/standard.cpp \ diff --git a/src/script/compressor.cpp b/src/script/compressor.cpp index 2f8df602bf..51a3cf6025 100644 --- a/src/script/compressor.cpp +++ b/src/script/compressor.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "compressor.h" diff --git a/src/script/compressor.h b/src/script/compressor.h index f0a3754f02..53c6bf3ecc 100644 --- a/src/script/compressor.h +++ b/src/script/compressor.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef H_BITCOIN_SCRIPT_COMPRESSOR @@ -81,4 +81,4 @@ public: } }; -#endif +#endif // H_BITCOIN_SCRIPT_COMPRESSOR diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 4f4fdb6b7f..471edf1c98 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "interpreter.h" diff --git a/src/script/interpreter.h b/src/script/interpreter.h index 0c6f8b9d13..6fbcd92a3d 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef H_BITCOIN_SCRIPT_INTERPRETER @@ -10,9 +10,9 @@ #include #include -class uint256; class CScript; class CTransaction; +class uint256; /** Signature hash types/flags */ enum @@ -42,4 +42,4 @@ bool CheckSig(std::vector vchSig, const std::vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); -#endif +#endif // H_BITCOIN_SCRIPT_INTERPRETER diff --git a/src/script/script.cpp b/src/script/script.cpp index 60d1beac95..3c9f38dc8b 100644 --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "script.h" diff --git a/src/script/script.h b/src/script/script.h index 21847c09bd..2336cafd67 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef H_BITCOIN_SCRIPT @@ -642,4 +642,4 @@ public: } }; -#endif +#endif // H_BITCOIN_SCRIPT diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 958177de3d..db9513db9f 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "script/sign.h" diff --git a/src/script/sign.h b/src/script/sign.h index 51723b53af..f218a64562 100644 --- a/src/script/sign.h +++ b/src/script/sign.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef H_BITCOIN_SCRIPT_SIGN @@ -11,6 +11,7 @@ class CKeyStore; class CScript; class CTransaction; + struct CMutableTransaction; bool SignSignature(const CKeyStore& keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); @@ -20,4 +21,4 @@ bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CMutab // combine them intelligently and return the result. CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2); -#endif +#endif // H_BITCOIN_SCRIPT_SIGN diff --git a/src/script/standard.cpp b/src/script/standard.cpp index 684edff4d2..bda4b8b0ae 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "script/standard.h" diff --git a/src/script/standard.h b/src/script/standard.h index 18092e879e..6c17a9394e 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef H_BITCOIN_SCRIPT_STANDARD @@ -53,4 +53,4 @@ bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType); bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet); bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::vector& addressRet, int& nRequiredRet); -#endif +#endif // H_BITCOIN_SCRIPT_STANDARD diff --git a/src/wallet_ismine.cpp b/src/wallet_ismine.cpp index 1c2c117fad..a3c221d3ab 100644 --- a/src/wallet_ismine.cpp +++ b/src/wallet_ismine.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "wallet_ismine.h" diff --git a/src/wallet_ismine.h b/src/wallet_ismine.h index 9915e9f7bb..29e13a94a6 100644 --- a/src/wallet_ismine.h +++ b/src/wallet_ismine.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef H_BITCOIN_WALLET_ISMINE @@ -25,4 +25,4 @@ typedef uint8_t isminefilter; isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey); isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest); -#endif // H_BITCOIN_SCRIPT +#endif // H_BITCOIN_WALLET_ISMINE From 611116d4e31634384e9757befbd5e5a1a80e8cd3 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sun, 14 Sep 2014 12:43:56 +0200 Subject: [PATCH 0696/1288] header include cleanup - ensures alphabetical ordering for includes etc. in source file headers --- src/Makefile.am | 10 +++++----- src/allocators.h | 1 + src/bitcoin-cli.cpp | 4 ++-- src/bitcoin-tx.cpp | 15 ++++++++------- src/chainparamsbase.h | 2 +- src/core_io.h | 2 +- src/core_read.cpp | 11 ++++++----- src/core_write.cpp | 7 ++++--- src/crypto/ripemd160.cpp | 1 + src/crypto/sha1.cpp | 1 + src/crypto/sha2.cpp | 1 + src/db.cpp | 1 + src/db.h | 4 +++- src/hash.h | 2 +- src/init.cpp | 2 +- src/leveldbwrapper.h | 1 + src/net.cpp | 2 +- src/pow.h | 2 +- src/random.cpp | 4 +++- src/rpcclient.cpp | 2 +- src/rpcdump.cpp | 3 ++- src/rpcmining.cpp | 4 ++-- src/rpcnet.cpp | 1 + src/rpcprotocol.cpp | 2 +- src/rpcrawtransaction.cpp | 4 ++-- src/serialize.h | 2 +- src/sync.cpp | 3 ++- src/timedata.h | 4 ++-- src/txdb.cpp | 3 ++- src/txmempool.cpp | 4 ++-- src/uint256.h | 2 +- src/util.h | 2 +- src/utilstrencodings.cpp | 3 ++- src/version.cpp | 1 + src/wallet.h | 2 +- src/walletdb.cpp | 2 +- 36 files changed, 68 insertions(+), 49 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index b2071f49e2..94a582dfac 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -98,12 +98,11 @@ BITCOIN_CORE_H = \ rpcclient.h \ rpcprotocol.h \ rpcserver.h \ - script/interpreter.h \ script/compressor.h \ + script/interpreter.h \ script/script.h \ script/sign.h \ script/standard.h \ - wallet_ismine.h \ serialize.h \ sync.h \ threadsafety.h \ @@ -118,8 +117,9 @@ BITCOIN_CORE_H = \ utilmoneystr.h \ utiltime.h \ version.h \ - walletdb.h \ wallet.h \ + wallet_ismine.h \ + walletdb.h \ compat/sanity.h JSON_H = \ @@ -173,8 +173,8 @@ libbitcoin_wallet_a_SOURCES = \ crypter.cpp \ rpcdump.cpp \ rpcwallet.cpp \ - wallet_ismine.cpp \ wallet.cpp \ + wallet_ismine.cpp \ walletdb.cpp \ $(BITCOIN_CORE_H) @@ -212,8 +212,8 @@ libbitcoin_common_a_SOURCES = \ keystore.cpp \ netbase.cpp \ protocol.cpp \ - script/interpreter.cpp \ script/compressor.cpp \ + script/interpreter.cpp \ script/script.cpp \ script/sign.cpp \ script/standard.cpp \ diff --git a/src/allocators.h b/src/allocators.h index 0b1c9fea68..65a7d08987 100644 --- a/src/allocators.h +++ b/src/allocators.h @@ -12,6 +12,7 @@ #include #include + #include // for OPENSSL_cleanse() /** diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 871aaf93df..badb376cb3 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -3,11 +3,11 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "util.h" +#include "chainparamsbase.h" #include "init.h" #include "rpcclient.h" #include "rpcprotocol.h" -#include "chainparamsbase.h" +#include "util.h" #include "utilstrencodings.h" #include "version.h" diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 91525b51c9..2cc4fda9df 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -3,23 +3,24 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "base58.h" -#include "util.h" -#include "utilmoneystr.h" #include "core.h" -#include "main.h" // for MAX_BLOCK_SIZE +#include "core_io.h" #include "keystore.h" +#include "main.h" // for MAX_BLOCK_SIZE #include "script/script.h" #include "script/sign.h" #include "ui_interface.h" // for _(...) #include "univalue/univalue.h" -#include "core_io.h" +#include "util.h" +#include "utilmoneystr.h" #include -#include -#include -using namespace std; +#include +#include + using namespace boost::assign; +using namespace std; static bool fCreateBlank; static map registers; diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h index 2d3a07b44a..743c8c541a 100644 --- a/src/chainparamsbase.h +++ b/src/chainparamsbase.h @@ -5,8 +5,8 @@ #ifndef BITCOIN_CHAIN_PARAMS_BASE_H #define BITCOIN_CHAIN_PARAMS_BASE_H -#include #include +#include /** * CBaseChainParams defines the base parameters (shared between bitcoin-cli and bitcoind) diff --git a/src/core_io.h b/src/core_io.h index adf74cce32..6268a3bf58 100644 --- a/src/core_io.h +++ b/src/core_io.h @@ -8,9 +8,9 @@ #include #include -class uint256; class CScript; class CTransaction; +class uint256; class UniValue; // core_read.cpp diff --git a/src/core_read.cpp b/src/core_read.cpp index efcecb106f..11ec72f243 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -3,21 +3,22 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "core_io.h" + #include "core.h" -#include "serialize.h" #include "script/script.h" +#include "serialize.h" +#include "univalue/univalue.h" #include "util.h" -#include #include #include -#include #include -#include "univalue/univalue.h" +#include +#include -using namespace std; using namespace boost; using namespace boost::algorithm; +using namespace std; CScript ParseScript(std::string s) { diff --git a/src/core_write.cpp b/src/core_write.cpp index 62712b1ba0..cd64aabf63 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -3,14 +3,15 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "core_io.h" -#include "univalue/univalue.h" + +#include "base58.h" +#include "core.h" #include "script/script.h" #include "script/standard.h" -#include "core.h" #include "serialize.h" +#include "univalue/univalue.h" #include "util.h" #include "utilmoneystr.h" -#include "base58.h" #include diff --git a/src/crypto/ripemd160.cpp b/src/crypto/ripemd160.cpp index 24bd318d43..b5e9f0df49 100644 --- a/src/crypto/ripemd160.cpp +++ b/src/crypto/ripemd160.cpp @@ -5,6 +5,7 @@ #include "crypto/ripemd160.h" #include "crypto/common.h" + #include // Internal implementation code. diff --git a/src/crypto/sha1.cpp b/src/crypto/sha1.cpp index 304401a50f..819abab579 100644 --- a/src/crypto/sha1.cpp +++ b/src/crypto/sha1.cpp @@ -5,6 +5,7 @@ #include "crypto/sha1.h" #include "crypto/common.h" + #include // Internal implementation code. diff --git a/src/crypto/sha2.cpp b/src/crypto/sha2.cpp index 99a251cb12..72f191afcd 100644 --- a/src/crypto/sha2.cpp +++ b/src/crypto/sha2.cpp @@ -5,6 +5,7 @@ #include "crypto/sha2.h" #include "crypto/common.h" + #include // Internal implementation code. diff --git a/src/db.cpp b/src/db.cpp index 23d2cc988d..419b71e30d 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -20,6 +20,7 @@ #include #include #include + #include using namespace std; diff --git a/src/db.h b/src/db.h index bba267b84f..d1df950548 100644 --- a/src/db.h +++ b/src/db.h @@ -15,12 +15,14 @@ #include #include + #include -struct CBlockLocator; class CDiskBlockIndex; class COutPoint; +struct CBlockLocator; + extern unsigned int nWalletDBUpdated; void ThreadFlushWalletDB(const std::string& strWalletFile); diff --git a/src/hash.h b/src/hash.h index 98a2d1fb11..bdcd4afb47 100644 --- a/src/hash.h +++ b/src/hash.h @@ -6,8 +6,8 @@ #ifndef BITCOIN_HASH_H #define BITCOIN_HASH_H -#include "crypto/sha2.h" #include "crypto/ripemd160.h" +#include "crypto/sha2.h" #include "serialize.h" #include "uint256.h" #include "version.h" diff --git a/src/init.cpp b/src/init.cpp index 6e47536d38..a3f75d61df 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -11,6 +11,7 @@ #include "addrman.h" #include "checkpoints.h" +#include "compat/sanity.h" #include "key.h" #include "main.h" #include "miner.h" @@ -32,7 +33,6 @@ #ifndef WIN32 #include #endif -#include "compat/sanity.h" #include #include diff --git a/src/leveldbwrapper.h b/src/leveldbwrapper.h index 452df92839..e2a4f286b2 100644 --- a/src/leveldbwrapper.h +++ b/src/leveldbwrapper.h @@ -10,6 +10,7 @@ #include "version.h" #include + #include #include diff --git a/src/net.cpp b/src/net.cpp index b18944a264..891772cf62 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -48,8 +48,8 @@ #endif #endif -using namespace std; using namespace boost; +using namespace std; namespace { const int MAX_OUTBOUND_CONNECTIONS = 8; diff --git a/src/pow.h b/src/pow.h index 2a0d9b24bb..5d91108ac4 100644 --- a/src/pow.h +++ b/src/pow.h @@ -8,8 +8,8 @@ #include -class CBlockIndex; class CBlockHeader; +class CBlockIndex; class uint256; unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock); diff --git a/src/random.cpp b/src/random.cpp index 22c942acc0..fb5258a442 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -12,10 +12,12 @@ #include "util.h" // for LogPrint() #include "utilstrencodings.h" // for GetTime() +#include + #ifndef WIN32 #include #endif -#include + #include #include #include diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index a0921453cc..81797248b4 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -3,7 +3,6 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include #include "rpcclient.h" #include "rpcprotocol.h" @@ -11,6 +10,7 @@ #include "ui_interface.h" #include "chainparams.h" // for Params().RPCPort() +#include #include using namespace std; diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index c286626fd3..dc73161bf1 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -7,8 +7,8 @@ #include "init.h" #include "main.h" #include "sync.h" -#include "utiltime.h" #include "util.h" +#include "utiltime.h" #include "wallet.h" #include @@ -16,6 +16,7 @@ #include #include + #include "json/json_spirit_value.h" using namespace json_spirit; diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index e4a5bc4162..4c80a91e1b 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -3,14 +3,14 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "rpcserver.h" #include "chainparams.h" +#include "core_io.h" #include "init.h" #include "net.h" #include "main.h" #include "miner.h" #include "pow.h" -#include "core_io.h" +#include "rpcserver.h" #include "util.h" #ifdef ENABLE_WALLET #include "db.h" diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 2baa481c4e..4afbe442ee 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -13,6 +13,7 @@ #include "util.h" #include + #include "json/json_spirit_value.h" using namespace json_spirit; diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp index 808b9bbd2a..c99d113bc3 100644 --- a/src/rpcprotocol.cpp +++ b/src/rpcprotocol.cpp @@ -5,8 +5,8 @@ #include "rpcprotocol.h" -#include "util.h" #include "tinyformat.h" +#include "util.h" #include "utilstrencodings.h" #include "utiltime.h" #include "version.h" diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index c5c99870fc..3c89be078d 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -12,8 +12,8 @@ #include "net.h" #include "rpcserver.h" #include "script/script.h" -#include "script/standard.h" #include "script/sign.h" +#include "script/standard.h" #include "uint256.h" #ifdef ENABLE_WALLET #include "wallet.h" @@ -25,10 +25,10 @@ #include "json/json_spirit_utils.h" #include "json/json_spirit_value.h" -using namespace std; using namespace boost; using namespace boost::assign; using namespace json_spirit; +using namespace std; void ScriptPubKeyToJSON(const CScript& scriptPubKey, Object& out, bool fIncludeHex) { diff --git a/src/serialize.h b/src/serialize.h index dba3460d1b..57f5fd069b 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -10,8 +10,8 @@ #include #include -#include #include +#include #include #include #include diff --git a/src/sync.cpp b/src/sync.cpp index 066c1ca744..d424f7bc95 100644 --- a/src/sync.cpp +++ b/src/sync.cpp @@ -7,9 +7,10 @@ #include "util.h" #include "utilstrencodings.h" +#include + #include #include -#include #ifdef DEBUG_LOCKCONTENTION void PrintLockContention(const char* pszName, const char* pszFile, int nLine) diff --git a/src/timedata.h b/src/timedata.h index 9cc47bec13..155f6872da 100644 --- a/src/timedata.h +++ b/src/timedata.h @@ -5,10 +5,10 @@ #ifndef BITCOIN_TIMEDATA_H #define BITCOIN_TIMEDATA_H -#include -#include #include #include +#include +#include class CNetAddr; diff --git a/src/txdb.cpp b/src/txdb.cpp index d4c6007558..79838b6116 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -9,9 +9,10 @@ #include "pow.h" #include "uint256.h" -#include #include +#include + using namespace std; void static BatchWriteCoins(CLevelDBBatch &batch, const uint256 &hash, const CCoins &coins) { diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 6bbadc8345..50e6fed2ad 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -3,8 +3,9 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "core.h" #include "txmempool.h" + +#include "core.h" #include "util.h" #include @@ -644,4 +645,3 @@ bool CCoinsViewMemPool::GetCoins(const uint256 &txid, CCoins &coins) const { bool CCoinsViewMemPool::HaveCoins(const uint256 &txid) const { return mempool.exists(txid) || base->HaveCoins(txid); } - diff --git a/src/uint256.h b/src/uint256.h index 6bb9a59400..28de540226 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -7,10 +7,10 @@ #define BITCOIN_UINT256_H #include +#include #include #include #include -#include #include class uint_error : public std::runtime_error { diff --git a/src/util.h b/src/util.h index 6e1f439ff7..e72c99adc7 100644 --- a/src/util.h +++ b/src/util.h @@ -15,8 +15,8 @@ #endif #include "compat.h" -#include "utiltime.h" #include "tinyformat.h" +#include "utiltime.h" #include #include diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index ef13555104..6837e4e267 100644 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -7,10 +7,11 @@ #include "tinyformat.h" -#include #include #include +#include + using namespace std; // safeChars chosen to allow simple messages/URLs/email addresses, but avoid anything diff --git a/src/version.cpp b/src/version.cpp index 8311041ed2..e441cc463f 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -7,6 +7,7 @@ #include "tinyformat.h" #include + #include // Name of client reported in the 'version' message. Report the same name diff --git a/src/wallet.h b/src/wallet.h index 5c26186730..3461446b8b 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -11,8 +11,8 @@ #include "key.h" #include "keystore.h" #include "main.h" -#include "wallet_ismine.h" #include "ui_interface.h" +#include "wallet_ismine.h" #include "walletdb.h" #include diff --git a/src/walletdb.cpp b/src/walletdb.cpp index 48045b98c8..03161250db 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -9,8 +9,8 @@ #include "protocol.h" #include "serialize.h" #include "sync.h" -#include "utiltime.h" #include "util.h" +#include "utiltime.h" #include "wallet.h" #include From 21b7addc9bee35349d5f26b7e752d4d231d7ca1a Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Mon, 15 Sep 2014 07:41:53 +0000 Subject: [PATCH 0697/1288] Bugfix: Add missing equals-sign to Travis config --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 379a0e1df7..7580adf5c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,7 @@ matrix: fast_finish: true include: - compiler: "true 1" - env: HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="NO_QT=1" GOAL="install" BITCOIN_CONFIG"--enable-glibc-back-compat" + env: HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="NO_QT=1" GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" - compiler: "true 2" env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_QT=1 NO_WALLET=1 NO_UPNP=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" - compiler: "true 3" From ec91092df8f70c4abef6bbb3c4dec6d9511405fe Mon Sep 17 00:00:00 2001 From: ENikS Date: Fri, 5 Sep 2014 11:37:01 -0400 Subject: [PATCH 0698/1288] Fixing compiler warning C4101 Github-Pull: #4856 --- src/core_read.cpp | 2 +- src/db.h | 2 +- src/leveldbwrapper.h | 2 +- src/main.cpp | 2 +- src/net.cpp | 2 +- src/rpcmining.cpp | 2 +- src/rpcrawtransaction.cpp | 2 +- src/rpcserver.cpp | 2 +- src/txmempool.cpp | 4 ++-- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/core_read.cpp b/src/core_read.cpp index efcecb106f..179d3514a4 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -97,7 +97,7 @@ bool DecodeHexTx(CTransaction& tx, const std::string& strHexTx) try { ssData >> tx; } - catch (std::exception &e) { + catch (const std::exception &) { return false; } diff --git a/src/db.h b/src/db.h index bba267b84f..0a8c8537e8 100644 --- a/src/db.h +++ b/src/db.h @@ -129,7 +129,7 @@ protected: CDataStream ssValue((char*)datValue.get_data(), (char*)datValue.get_data() + datValue.get_size(), SER_DISK, CLIENT_VERSION); ssValue >> value; } - catch (std::exception &e) { + catch (const std::exception &) { return false; } diff --git a/src/leveldbwrapper.h b/src/leveldbwrapper.h index 452df92839..95a22219db 100644 --- a/src/leveldbwrapper.h +++ b/src/leveldbwrapper.h @@ -99,7 +99,7 @@ public: try { CDataStream ssValue(strValue.data(), strValue.data() + strValue.size(), SER_DISK, CLIENT_VERSION); ssValue >> value; - } catch(std::exception &e) { + } catch(const std::exception &) { return false; } return true; diff --git a/src/main.cpp b/src/main.cpp index 02d4bfa8a0..1b746a0b08 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3163,7 +3163,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp) blkdat >> nSize; if (nSize < 80 || nSize > MAX_BLOCK_SIZE) continue; - } catch (std::exception &e) { + } catch (const std::exception &) { // no valid block header found; don't complain break; } diff --git a/src/net.cpp b/src/net.cpp index b18944a264..a4bafe5914 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -689,7 +689,7 @@ int CNetMessage::readHeader(const char *pch, unsigned int nBytes) try { hdrbuf >> hdr; } - catch (std::exception &e) { + catch (const std::exception &) { return -1; } diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index e4a5bc4162..1613f04708 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -553,7 +553,7 @@ Value submitblock(const Array& params, bool fHelp) try { ssBlock >> pblock; } - catch (std::exception &e) { + catch (const std::exception &) { throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Block decode failed"); } diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index c5c99870fc..cf19c277d8 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -543,7 +543,7 @@ Value signrawtransaction(const Array& params, bool fHelp) ssData >> tx; txVariants.push_back(tx); } - catch (std::exception &e) { + catch (const std::exception &) { throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); } } diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index c9133bd3d2..190de62282 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -628,7 +628,7 @@ void StartRPCThreads() try { vEndpoints.push_back(ParseEndpoint(addr, defaultPort)); } - catch(boost::system::system_error &e) + catch(const boost::system::system_error &) { uiInterface.ThreadSafeMessageBox( strprintf(_("Could not parse -rpcbind value %s as network address"), addr), diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 119509ae3c..e538645e17 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -574,7 +574,7 @@ CTxMemPool::WriteFeeEstimates(CAutoFile& fileout) const fileout << CLIENT_VERSION; // version that wrote the file minerPolicyEstimator->Write(fileout); } - catch (std::exception &e) { + catch (const std::exception &) { LogPrintf("CTxMemPool::WriteFeeEstimates() : unable to write policy estimator data (non-fatal)"); return false; } @@ -593,7 +593,7 @@ CTxMemPool::ReadFeeEstimates(CAutoFile& filein) LOCK(cs); minerPolicyEstimator->Read(filein, minRelayFee); } - catch (std::exception &e) { + catch (const std::exception &) { LogPrintf("CTxMemPool::ReadFeeEstimates() : unable to read policy estimator data (non-fatal)"); return false; } From f7e36370f36ca806076cdcf0cd3ed0c35fd38c42 Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Mon, 15 Sep 2014 09:56:10 -0400 Subject: [PATCH 0699/1288] Eliminate extra assignment --- src/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 0816e36633..7242c3ab5c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2795,8 +2795,7 @@ FILE* OpenUndoFile(const CDiskBlockPos &pos, bool fReadOnly) { boost::filesystem::path GetBlockPosFilename(const CDiskBlockPos &pos, const char *prefix) { - boost::filesystem::path path = GetDataDir() / "blocks" / strprintf("%s%05u.dat", prefix, pos.nFile); - return path; + return GetDataDir() / "blocks" / strprintf("%s%05u.dat", prefix, pos.nFile); } CBlockIndex * InsertBlockIndex(uint256 hash) From ee304b6e355ac324f4054e7672d5f8e6b8eb44e9 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 16 Sep 2014 09:00:36 +0200 Subject: [PATCH 0700/1288] minor changes for help message of getpeerinfo --- src/rpcnet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 4afbe442ee..52f98fbf00 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -95,8 +95,8 @@ Value getpeerinfo(const Array& params, bool fHelp) " \"subver\": \"/Satoshi:0.8.5/\", (string) The string version\n" " \"inbound\": true|false, (boolean) Inbound (true) or Outbound (false)\n" " \"startingheight\": n, (numeric) The starting height (block) of the peer\n" - " \"banscore\": n, (numeric) The ban score (stats.nMisbehavior)\n" - " \"syncnode\" : true|false (booleamn) if sync node\n" + " \"banscore\": n, (numeric) The ban score\n" + " \"syncnode\": true|false (booleamn) if sync node\n" " }\n" " ,...\n" "]\n" From e9992fb6453209e93dee0f886fc8e3fe39ef89d4 Mon Sep 17 00:00:00 2001 From: imharrywu Date: Tue, 16 Sep 2014 15:53:04 +0800 Subject: [PATCH 0701/1288] remove include of chainparams.h chainparams.h has not been used in this cpp file already, consider to remove it for clean. --- src/rpcclient.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index 81797248b4..0279cd76ec 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -8,7 +8,6 @@ #include "rpcprotocol.h" #include "util.h" #include "ui_interface.h" -#include "chainparams.h" // for Params().RPCPort() #include #include From 52a5f903605760f54370863679740f5ac0354f13 Mon Sep 17 00:00:00 2001 From: randy-waterhouse Date: Sun, 14 Sep 2014 11:09:25 +1200 Subject: [PATCH 0702/1288] Create the common location for all m4 autotool build scripts, build-aux/m4. Update .gitignore. --- .gitignore | 23 +++++--- Makefile.am | 2 +- {src => build-aux}/m4/ax_boost_base.m4 | 0 {src => build-aux}/m4/ax_boost_chrono.m4 | 0 {src => build-aux}/m4/ax_boost_filesystem.m4 | 0 .../m4/ax_boost_program_options.m4 | 0 {src => build-aux}/m4/ax_boost_system.m4 | 0 {src => build-aux}/m4/ax_boost_thread.m4 | 0 .../m4/ax_boost_unit_test_framework.m4 | 0 .../m4/ax_check_compile_flag.m4 | 0 {src => build-aux}/m4/ax_check_link_flag.m4 | 0 .../m4/ax_check_preproc_flag.m4 | 0 {src => build-aux}/m4/ax_pthread.m4 | 0 {src => build-aux}/m4/bitcoin_find_bdb48.m4 | 0 {src => build-aux}/m4/bitcoin_qt.m4 | 0 .../m4/bitcoin_subdir_to_include.m4 | 0 configure.ac | 52 +++++++++---------- 17 files changed, 42 insertions(+), 35 deletions(-) rename {src => build-aux}/m4/ax_boost_base.m4 (100%) rename {src => build-aux}/m4/ax_boost_chrono.m4 (100%) rename {src => build-aux}/m4/ax_boost_filesystem.m4 (100%) rename {src => build-aux}/m4/ax_boost_program_options.m4 (100%) rename {src => build-aux}/m4/ax_boost_system.m4 (100%) rename {src => build-aux}/m4/ax_boost_thread.m4 (100%) rename {src => build-aux}/m4/ax_boost_unit_test_framework.m4 (100%) rename {src => build-aux}/m4/ax_check_compile_flag.m4 (100%) rename {src => build-aux}/m4/ax_check_link_flag.m4 (100%) rename {src => build-aux}/m4/ax_check_preproc_flag.m4 (100%) rename {src => build-aux}/m4/ax_pthread.m4 (100%) rename {src => build-aux}/m4/bitcoin_find_bdb48.m4 (100%) rename {src => build-aux}/m4/bitcoin_qt.m4 (100%) rename {src => build-aux}/m4/bitcoin_subdir_to_include.m4 (100%) diff --git a/.gitignore b/.gitignore index 24af4cb72e..7d00051f23 100644 --- a/.gitignore +++ b/.gitignore @@ -8,25 +8,32 @@ src/bitcoin-tx src/test/test_bitcoin src/qt/test/test_bitcoin-qt +# autoreconf Makefile.in aclocal.m4 autom4te.cache/ +build-aux/config.guess +build-aux/config.sub +build-aux/depcomp +build-aux/install-sh +build-aux/ltmain.sh +build-aux/m4/libtool.m4 +build-aux/m4/lt~obsolete.m4 +build-aux/m4/ltoptions.m4 +build-aux/m4/ltsugar.m4 +build-aux/m4/ltversion.m4 +build-aux/missing +build-aux/compile +build-aux/test-driver config.log config.status configure +libtool src/config/bitcoin-config.h src/config/bitcoin-config.h.in src/config/stamp-h1 -src/build-aux/ share/setup.nsi share/qt/Info.plist -# Libtool -libtool -src/m4/libtool.m4 -src/m4/ltoptions.m4 -src/m4/ltsugar.m4 -src/m4/ltversion.m4 -src/m4/lt~obsolete.m4 src/univalue/gen diff --git a/Makefile.am b/Makefile.am index a64666a32b..fe7244edf8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -ACLOCAL_AMFLAGS = -I src/m4 +ACLOCAL_AMFLAGS = -I build-aux/m4 SUBDIRS = src .PHONY: deploy FORCE diff --git a/src/m4/ax_boost_base.m4 b/build-aux/m4/ax_boost_base.m4 similarity index 100% rename from src/m4/ax_boost_base.m4 rename to build-aux/m4/ax_boost_base.m4 diff --git a/src/m4/ax_boost_chrono.m4 b/build-aux/m4/ax_boost_chrono.m4 similarity index 100% rename from src/m4/ax_boost_chrono.m4 rename to build-aux/m4/ax_boost_chrono.m4 diff --git a/src/m4/ax_boost_filesystem.m4 b/build-aux/m4/ax_boost_filesystem.m4 similarity index 100% rename from src/m4/ax_boost_filesystem.m4 rename to build-aux/m4/ax_boost_filesystem.m4 diff --git a/src/m4/ax_boost_program_options.m4 b/build-aux/m4/ax_boost_program_options.m4 similarity index 100% rename from src/m4/ax_boost_program_options.m4 rename to build-aux/m4/ax_boost_program_options.m4 diff --git a/src/m4/ax_boost_system.m4 b/build-aux/m4/ax_boost_system.m4 similarity index 100% rename from src/m4/ax_boost_system.m4 rename to build-aux/m4/ax_boost_system.m4 diff --git a/src/m4/ax_boost_thread.m4 b/build-aux/m4/ax_boost_thread.m4 similarity index 100% rename from src/m4/ax_boost_thread.m4 rename to build-aux/m4/ax_boost_thread.m4 diff --git a/src/m4/ax_boost_unit_test_framework.m4 b/build-aux/m4/ax_boost_unit_test_framework.m4 similarity index 100% rename from src/m4/ax_boost_unit_test_framework.m4 rename to build-aux/m4/ax_boost_unit_test_framework.m4 diff --git a/src/m4/ax_check_compile_flag.m4 b/build-aux/m4/ax_check_compile_flag.m4 similarity index 100% rename from src/m4/ax_check_compile_flag.m4 rename to build-aux/m4/ax_check_compile_flag.m4 diff --git a/src/m4/ax_check_link_flag.m4 b/build-aux/m4/ax_check_link_flag.m4 similarity index 100% rename from src/m4/ax_check_link_flag.m4 rename to build-aux/m4/ax_check_link_flag.m4 diff --git a/src/m4/ax_check_preproc_flag.m4 b/build-aux/m4/ax_check_preproc_flag.m4 similarity index 100% rename from src/m4/ax_check_preproc_flag.m4 rename to build-aux/m4/ax_check_preproc_flag.m4 diff --git a/src/m4/ax_pthread.m4 b/build-aux/m4/ax_pthread.m4 similarity index 100% rename from src/m4/ax_pthread.m4 rename to build-aux/m4/ax_pthread.m4 diff --git a/src/m4/bitcoin_find_bdb48.m4 b/build-aux/m4/bitcoin_find_bdb48.m4 similarity index 100% rename from src/m4/bitcoin_find_bdb48.m4 rename to build-aux/m4/bitcoin_find_bdb48.m4 diff --git a/src/m4/bitcoin_qt.m4 b/build-aux/m4/bitcoin_qt.m4 similarity index 100% rename from src/m4/bitcoin_qt.m4 rename to build-aux/m4/bitcoin_qt.m4 diff --git a/src/m4/bitcoin_subdir_to_include.m4 b/build-aux/m4/bitcoin_subdir_to_include.m4 similarity index 100% rename from src/m4/bitcoin_subdir_to_include.m4 rename to build-aux/m4/bitcoin_subdir_to_include.m4 diff --git a/configure.ac b/configure.ac index 6dc71292df..7d525f8251 100644 --- a/configure.ac +++ b/configure.ac @@ -7,8 +7,8 @@ define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_IS_RELEASE, false) define(_COPYRIGHT_YEAR, 2014) AC_INIT([Bitcoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@bitcoin.org],[bitcoin]) -AC_CONFIG_AUX_DIR([src/build-aux]) -AC_CONFIG_MACRO_DIR([src/m4]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_MACRO_DIR([build-aux/m4]) LT_INIT([disable-shared]) AC_CANONICAL_HOST AH_TOP([#ifndef BITCOIN_CONFIG_H]) @@ -44,6 +44,30 @@ AM_MAINTAINER_MODE([enable]) dnl make the compilation flags quiet unless V=1 is used m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl Checks for programs. +AC_PROG_CXX +AC_PROG_CC +AC_PROG_CPP +AC_PROG_CXXCPP +AC_PROG_INSTALL +AC_PROG_OBJC +AC_PROG_LN_S +m4_ifdef([AC_PROG_OBJCXX],[AC_PROG_OBJCXX]) +AC_PROG_MKDIR_P +AC_PROG_SED +AC_PATH_TOOL(AR, ar) +AC_PATH_TOOL(RANLIB, ranlib) +AC_PATH_TOOL(STRIP, strip) +AC_PATH_TOOL(GCOV, gcov) +AC_PATH_PROG(LCOV, lcov) +AC_PATH_PROG(JAVA, java) +AC_PATH_PROG(GENHTML, genhtml) +AC_PATH_PROG([GIT], [git]) +AC_PATH_PROG(CCACHE,ccache) +AC_PATH_PROG(XGETTEXT,xgettext) +AC_PATH_PROG(HEXDUMP,hexdump) +PKG_PROG_PKG_CONFIG + # Enable wallet AC_ARG_ENABLE([wallet], [AS_HELP_STRING([--enable-wallet], @@ -120,30 +144,6 @@ AC_ARG_WITH([protoc-bindir],[AS_HELP_STRING([--with-protoc-bindir=BIN_DIR],[spec AC_CONFIG_SRCDIR([src]) AC_CONFIG_HEADERS([src/config/bitcoin-config.h]) -dnl Checks for programs. -AC_PROG_CXX -AC_PROG_CC -AC_PROG_CPP -AC_PROG_CXXCPP -AC_PROG_INSTALL -AC_PROG_OBJC -AC_PROG_LN_S -m4_ifdef([AC_PROG_OBJCXX],[AC_PROG_OBJCXX]) -AC_PROG_MKDIR_P -AC_PROG_SED -AC_PATH_TOOL(AR, ar) -AC_PATH_TOOL(RANLIB, ranlib) -AC_PATH_TOOL(STRIP, strip) -AC_PATH_TOOL(GCOV, gcov) -AC_PATH_PROG(LCOV, lcov) -AC_PATH_PROG(JAVA, java) -AC_PATH_PROG(GENHTML, genhtml) -AC_PATH_PROG([GIT], [git]) -AC_PATH_PROG(CCACHE,ccache) -AC_PATH_PROG(XGETTEXT,xgettext) -AC_PATH_PROG(HEXDUMP,hexdump) -PKG_PROG_PKG_CONFIG - # Enable debug AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], From 57e1716de6a6deba23ad8c4152cc0a32a4974c41 Mon Sep 17 00:00:00 2001 From: Benedict Chan Date: Sun, 7 Sep 2014 12:37:13 +0000 Subject: [PATCH 0703/1288] update rpc help message for gettransaction to add includeWatchonly param --- src/rpcwallet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 997b861e59..9e345d74fa 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1490,7 +1490,7 @@ Value gettransaction(const Array& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 2) throw runtime_error( - "gettransaction \"txid\"\n" + "gettransaction \"txid\" ( includeWatchonly )\n" "\nGet detailed information about in-wallet transaction \n" "\nArguments:\n" "1. \"txid\" (string, required) The transaction id\n" @@ -1520,6 +1520,7 @@ Value gettransaction(const Array& params, bool fHelp) "\nExamples:\n" + HelpExampleCli("gettransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") + + HelpExampleCli("gettransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\" true") + HelpExampleRpc("gettransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") ); From 1a613963e1567fd6102e783422cc6cad672dd1a5 Mon Sep 17 00:00:00 2001 From: Benedict Chan Date: Sun, 7 Sep 2014 12:38:42 +0000 Subject: [PATCH 0704/1288] fix missing gettransaction entries in rpcclient --- src/rpcclient.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index 81797248b4..05e54dcbf6 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -67,6 +67,7 @@ static const CRPCConvertParam vRPCConvertParams[] = { "listunspent", 1 }, { "listunspent", 2 }, { "getblock", 1 }, + { "gettransaction", 1 }, { "getrawtransaction", 1 }, { "createrawtransaction", 0 }, { "createrawtransaction", 1 }, From e54381117a86f51a129056b18ad7f48967bdcf3a Mon Sep 17 00:00:00 2001 From: randy-waterhouse Date: Tue, 26 Aug 2014 21:39:32 +1200 Subject: [PATCH 0705/1288] Add warnings for autogen.sh. Fix AC_CONFIG_SRCDIR. --- autogen.sh | 2 +- configure.ac | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/autogen.sh b/autogen.sh index 50b85bcba0..ddfc09607e 100755 --- a/autogen.sh +++ b/autogen.sh @@ -5,4 +5,4 @@ cd "$srcdir" if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="`which glibtoolize 2>/dev/null`"; then export LIBTOOLIZE="${GLIBTOOLIZE}" fi -autoreconf --install --force +autoreconf --install --force --warnings=all diff --git a/configure.ac b/configure.ac index 7d525f8251..9c7a53819e 100644 --- a/configure.ac +++ b/configure.ac @@ -7,6 +7,8 @@ define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_IS_RELEASE, false) define(_COPYRIGHT_YEAR, 2014) AC_INIT([Bitcoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@bitcoin.org],[bitcoin]) +AC_CONFIG_SRCDIR([src/main.cpp]) +AC_CONFIG_HEADERS([src/config/bitcoin-config.h]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([build-aux/m4]) LT_INIT([disable-shared]) @@ -140,10 +142,6 @@ AC_ARG_ENABLE([glibc-back-compat], AC_ARG_WITH([protoc-bindir],[AS_HELP_STRING([--with-protoc-bindir=BIN_DIR],[specify protoc bin path])], [protoc_bin_path=$withval], []) - -AC_CONFIG_SRCDIR([src]) -AC_CONFIG_HEADERS([src/config/bitcoin-config.h]) - # Enable debug AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], From e2a98d270d511711111a54f350c25733bc15a5b2 Mon Sep 17 00:00:00 2001 From: randy-waterhouse Date: Wed, 27 Aug 2014 09:25:33 +1200 Subject: [PATCH 0706/1288] Update obsolete AC macros. --- build-aux/m4/bitcoin_find_bdb48.m4 | 14 +++++++------- build-aux/m4/bitcoin_qt.m4 | 28 ++++++++++++++-------------- configure.ac | 20 ++++++++++---------- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/build-aux/m4/bitcoin_find_bdb48.m4 b/build-aux/m4/bitcoin_find_bdb48.m4 index 5223163fe5..f3b14461eb 100644 --- a/build-aux/m4/bitcoin_find_bdb48.m4 +++ b/build-aux/m4/bitcoin_find_bdb48.m4 @@ -12,29 +12,29 @@ AC_DEFUN([BITCOIN_FIND_BDB48],[ done for searchpath in $bdbdirlist ''; do test -n "${searchpath}" && searchpath="${searchpath}/" - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <${searchpath}db_cxx.h> - ],[ + ]],[[ #if !((DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) || DB_VERSION_MAJOR > 4) #error "failed to find bdb 4.8+" #endif - ],[ + ]])],[ if test "x$bdbpath" = "xX"; then bdbpath="${searchpath}" fi ],[ continue ]) - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <${searchpath}db_cxx.h> - ],[ + ]],[[ #if !(DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 8) #error "failed to find bdb 4.8" #endif - ],[ + ]])],[ bdb48path="${searchpath}" break - ]) + ],[]) done if test "x$bdbpath" = "xX"; then AC_MSG_RESULT([no]) diff --git a/build-aux/m4/bitcoin_qt.m4 b/build-aux/m4/bitcoin_qt.m4 index e141033b19..edfde4cd79 100644 --- a/build-aux/m4/bitcoin_qt.m4 +++ b/build-aux/m4/bitcoin_qt.m4 @@ -217,17 +217,17 @@ dnl Requires: INCLUDES must be populated as necessary. dnl Output: bitcoin_cv_qt5=yes|no AC_DEFUN([_BITCOIN_QT_CHECK_QT5],[ AC_CACHE_CHECK(for Qt 5, bitcoin_cv_qt5,[ - AC_TRY_COMPILE( - [#include ], - [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[#include ]], + [[ #if QT_VERSION < 0x050000 choke me #else return 0; #endif - ], - bitcoin_cv_qt5=yes, - bitcoin_cv_qt5=no) + ]])], + [bitcoin_cv_qt5=yes], + [bitcoin_cv_qt5=no]) ])]) dnl Internal. Check if the linked version of Qt was built as static libs. @@ -237,15 +237,15 @@ dnl Output: bitcoin_cv_static_qt=yes|no dnl Output: Defines QT_STATICPLUGIN if plugins are static. AC_DEFUN([_BITCOIN_QT_IS_STATIC],[ AC_CACHE_CHECK(for static Qt, bitcoin_cv_static_qt,[ - AC_TRY_COMPILE( - [#include ], - [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[#include ]], + [[ #if defined(QT_STATIC) return 0; #else choke me #endif - ], + ]])], [bitcoin_cv_static_qt=yes], [bitcoin_cv_static_qt=no]) ]) @@ -263,13 +263,13 @@ AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_PLUGINS],[ AC_MSG_CHECKING(for static Qt plugins: $2) CHECK_STATIC_PLUGINS_TEMP_LIBS="$LIBS" LIBS="$2 $QT_LIBS $LIBS" - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #define QT_STATICPLUGIN #include - $1], - [return 0;], + $1]], + [[return 0;]])], [AC_MSG_RESULT(yes); QT_LIBS="$2 $QT_LIBS"], - [AC_MSG_RESULT(no)]; BITCOIN_QT_FAIL(Could not resolve: $2)) + [AC_MSG_RESULT(no); BITCOIN_QT_FAIL(Could not resolve: $2)]) LIBS="$CHECK_STATIC_PLUGINS_TEMP_LIBS" ]) diff --git a/configure.ac b/configure.ac index 9c7a53819e..0f9e78b74f 100644 --- a/configure.ac +++ b/configure.ac @@ -335,12 +335,12 @@ if test x$use_glibc_compat != xno; then #__fdelt_chk's params and return type have changed from long unsigned int to long int. # See which one is present here. AC_MSG_CHECKING(__fdelt_chk type) - AC_TRY_COMPILE([#ifdef _FORTIFY_SOURCE + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef _FORTIFY_SOURCE #undef _FORTIFY_SOURCE #endif #define _FORTIFY_SOURCE 2 #include - extern "C" long unsigned int __fdelt_warn(long unsigned int);],[], + extern "C" long unsigned int __fdelt_warn(long unsigned int);]],[[]])], [ fdelt_type="long unsigned int"], [ fdelt_type="long int"]) AC_MSG_RESULT($fdelt_type) @@ -392,8 +392,8 @@ AC_CHECK_DECLS([le32toh, le64toh, htole32, htole64, be32toh, be64toh, htobe32, h dnl Check for MSG_NOSIGNAL AC_MSG_CHECKING(for MSG_NOSIGNAL) -AC_TRY_COMPILE([#include ], - [ int f = MSG_NOSIGNAL; ], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[ int f = MSG_NOSIGNAL; ]])], [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,[Define this symbol if you have MSG_NOSIGNAL]) ], [ AC_MSG_RESULT(no)] ) @@ -535,16 +535,16 @@ TEMP_LIBS="$LIBS" LIBS="$BOOST_LIBS $BOOST_CHRONO_LIB $LIBS" TEMP_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" -AC_TRY_LINK([ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include - ],[ + ]],[[ #if BOOST_VERSION >= 105000 && (!defined(BOOST_HAS_NANOSLEEP) || BOOST_VERSION >= 105200) boost::this_thread::sleep_for(boost::chrono::milliseconds(0)); #else choke me #endif - ], + ]])], [boost_sleep=yes; BOOST_LIBS="$BOOST_LIBS $BOOST_CHRONO_LIB"; AC_DEFINE(HAVE_WORKING_BOOST_SLEEP_FOR, 1, [Define this symbol if boost sleep_for works])], [boost_sleep=no]) @@ -557,17 +557,17 @@ TEMP_LIBS="$LIBS" LIBS="$BOOST_LIBS $LIBS" TEMP_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" -AC_TRY_LINK([ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include #include - ],[ + ]],[[ #if BOOST_VERSION <= 105600 boost::this_thread::sleep(boost::posix_time::milliseconds(0)); #else choke me #endif - ], + ]])], [boost_sleep=yes; AC_DEFINE(HAVE_WORKING_BOOST_SLEEP, 1, [Define this symbol if boost sleep works])], [boost_sleep=no]) LIBS="$TEMP_LIBS" From f4fe20503433032e08cfa2133ce799a4c3d27d61 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 16 Sep 2014 10:28:53 +0200 Subject: [PATCH 0707/1288] add nModSize init to default constructor of CTxMemPoolEntry --- src/txmempool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 404cca2373..52d07bf6a0 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -13,7 +13,7 @@ using namespace std; CTxMemPoolEntry::CTxMemPoolEntry(): - nFee(0), nTxSize(0), nTime(0), dPriority(0.0) + nFee(0), nTxSize(0), nModSize(0), nTime(0), dPriority(0.0) { nHeight = MEMPOOL_HEIGHT; } From 0be990ba34110184c8a5a2c04094311dab5cd84c Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 11 Sep 2014 19:15:29 +0200 Subject: [PATCH 0708/1288] Move CTxDestination from script/script to script/standard --- src/base58.h | 1 + src/bitcoin-tx.cpp | 5 ++-- src/qt/guiutil.cpp | 4 ++- src/qt/paymentserver.cpp | 4 +-- src/qt/walletmodel.cpp | 3 +-- src/rpcdump.cpp | 4 ++- src/rpcmisc.cpp | 3 +-- src/rpcrawtransaction.cpp | 3 +-- src/rpcwallet.cpp | 9 +++---- src/script/script.cpp | 40 ----------------------------- src/script/script.h | 17 ------------ src/script/standard.cpp | 47 ++++++++++++++++++++++++++++++++++ src/script/standard.h | 17 ++++++++++++ src/test/DoS_tests.cpp | 6 ++--- src/test/miner_tests.cpp | 2 +- src/test/script_P2SH_tests.cpp | 45 +++++++++++++++----------------- src/test/script_tests.cpp | 6 ++--- src/test/sigopcount_tests.cpp | 9 +++---- src/test/transaction_tests.cpp | 6 ++--- src/wallet.cpp | 7 +++-- src/wallet_ismine.cpp | 3 +-- src/wallet_ismine.h | 3 ++- 22 files changed, 122 insertions(+), 122 deletions(-) diff --git a/src/base58.h b/src/base58.h index 15bf710f5e..c5e230c72e 100644 --- a/src/base58.h +++ b/src/base58.h @@ -17,6 +17,7 @@ #include "chainparams.h" #include "key.h" #include "script/script.h" +#include "script/standard.h" #include #include diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 354d6ba41d..6445042f9c 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -224,9 +224,8 @@ static void MutateTxAddOutAddr(CMutableTransaction& tx, const string& strInput) if (!addr.IsValid()) throw runtime_error("invalid TX output address"); - // build standard output script via SetDestination() - CScript scriptPubKey; - scriptPubKey.SetDestination(addr.Get()); + // build standard output script via GetScriptForDestination() + CScript scriptPubKey = GetScriptForDestination(addr.Get()); // construct TxOut, append to transaction output list CTxOut txout(value, scriptPubKey); diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 304177ee11..fc22871a6b 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -13,6 +13,8 @@ #include "init.h" #include "main.h" #include "protocol.h" +#include "script/script.h" +#include "script/standard.h" #include "util.h" #ifdef WIN32 @@ -222,7 +224,7 @@ QString formatBitcoinURI(const SendCoinsRecipient &info) bool isDust(const QString& address, qint64 amount) { CTxDestination dest = CBitcoinAddress(address.toStdString()).Get(); - CScript script; script.SetDestination(dest); + CScript script = GetScriptForDestination(dest); CTxOut txOut(amount, script); return txOut.IsDust(::minRelayTxFee); } diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 219a685faf..cc4478f39f 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -609,7 +609,7 @@ void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipien std::string strAccount = account.toStdString(); set refundAddresses = wallet->GetAccountAddresses(strAccount); if (!refundAddresses.empty()) { - CScript s; s.SetDestination(*refundAddresses.begin()); + CScript s = GetScriptForDestination(*refundAddresses.begin()); payments::Output* refund_to = payment.add_refund_to(); refund_to->set_script(&s[0], s.size()); } @@ -620,7 +620,7 @@ void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipien CKeyID keyID = newKey.GetID(); wallet->SetAddressBook(keyID, strAccount, "refund"); - CScript s; s.SetDestination(keyID); + CScript s = GetScriptForDestination(keyID); payments::Output* refund_to = payment.add_refund_to(); refund_to->set_script(&s[0], s.size()); } diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 8d2c2e96d8..ed90914ba7 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -241,8 +241,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact setAddress.insert(rcp.address); ++nAddresses; - CScript scriptPubKey; - scriptPubKey.SetDestination(CBitcoinAddress(rcp.address.toStdString()).Get()); + CScript scriptPubKey = GetScriptForDestination(CBitcoinAddress(rcp.address.toStdString()).Get()); vecSend.push_back(std::pair(scriptPubKey, rcp.amount)); total += rcp.amount; diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index dc73161bf1..1ac7024550 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -6,6 +6,8 @@ #include "rpcserver.h" #include "init.h" #include "main.h" +#include "script/script.h" +#include "script/standard.h" #include "sync.h" #include "util.h" #include "utiltime.h" @@ -161,7 +163,7 @@ Value importaddress(const Array& params, bool fHelp) CBitcoinAddress address(params[0].get_str()); if (address.IsValid()) { - script.SetDestination(address.Get()); + script = GetScriptForDestination(address.Get()); } else if (IsHex(params[0].get_str())) { std::vector data(ParseHex(params[0].get_str())); script = CScript(data.begin(), data.end()); diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 917c840536..dd45eefd58 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -250,8 +250,7 @@ CScript _createmultisig_redeemScript(const Array& params) throw runtime_error(" Invalid public key: "+ks); } } - CScript result; - result.SetMultisig(nRequired, pubkeys); + CScript result = GetScriptForMultisig(nRequired, pubkeys); if (result.size() > MAX_SCRIPT_ELEMENT_SIZE) throw runtime_error( diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 1828a5dc7d..b295be3b51 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -366,8 +366,7 @@ Value createrawtransaction(const Array& params, bool fHelp) throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+s.name_); setAddress.insert(address); - CScript scriptPubKey; - scriptPubKey.SetDestination(address.Get()); + CScript scriptPubKey = GetScriptForDestination(address.Get()); int64_t nAmount = AmountFromValue(s.value_); CTxOut out(nAmount, scriptPubKey); diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 997b861e59..d9a23b2347 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -124,8 +124,7 @@ CBitcoinAddress GetAccountAddress(string strAccount, bool bForceNew=false) // Check if the current key has been used if (account.vchPubKey.IsValid()) { - CScript scriptPubKey; - scriptPubKey.SetDestination(account.vchPubKey.GetID()); + CScript scriptPubKey = GetScriptForDestination(account.vchPubKey.GetID()); for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end() && account.vchPubKey.IsValid(); ++it) @@ -472,10 +471,9 @@ Value getreceivedbyaddress(const Array& params, bool fHelp) // Bitcoin address CBitcoinAddress address = CBitcoinAddress(params[0].get_str()); - CScript scriptPubKey; if (!address.IsValid()) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address"); - scriptPubKey.SetDestination(address.Get()); + CScript scriptPubKey = GetScriptForDestination(address.Get()); if (!IsMine(*pwalletMain,scriptPubKey)) return (double)0.0; @@ -849,8 +847,7 @@ Value sendmany(const Array& params, bool fHelp) throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+s.name_); setAddress.insert(address); - CScript scriptPubKey; - scriptPubKey.SetDestination(address.Get()); + CScript scriptPubKey = GetScriptForDestination(address.Get()); int64_t nAmount = AmountFromValue(s.value_); totalAmount += nAmount; diff --git a/src/script/script.cpp b/src/script/script.cpp index 3c9f38dc8b..a5126e7cc2 100644 --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -253,43 +253,3 @@ bool CScript::HasCanonicalPushes() const } return true; } - -class CScriptVisitor : public boost::static_visitor -{ -private: - CScript *script; -public: - CScriptVisitor(CScript *scriptin) { script = scriptin; } - - bool operator()(const CNoDestination &dest) const { - script->clear(); - return false; - } - - bool operator()(const CKeyID &keyID) const { - script->clear(); - *script << OP_DUP << OP_HASH160 << keyID << OP_EQUALVERIFY << OP_CHECKSIG; - return true; - } - - bool operator()(const CScriptID &scriptID) const { - script->clear(); - *script << OP_HASH160 << scriptID << OP_EQUAL; - return true; - } -}; - -void CScript::SetDestination(const CTxDestination& dest) -{ - boost::apply_visitor(CScriptVisitor(this), dest); -} - -void CScript::SetMultisig(int nRequired, const std::vector& keys) -{ - this->clear(); - - *this << EncodeOP_N(nRequired); - BOOST_FOREACH(const CPubKey& key, keys) - *this << key; - *this << EncodeOP_N(keys.size()) << OP_CHECKMULTISIG; -} diff --git a/src/script/script.h b/src/script/script.h index 2336cafd67..07a4229f85 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -320,20 +320,6 @@ inline std::string ValueString(const std::vector& vch) return HexStr(vch); } -class CNoDestination { -public: - friend bool operator==(const CNoDestination &a, const CNoDestination &b) { return true; } - friend bool operator<(const CNoDestination &a, const CNoDestination &b) { return true; } -}; - -/** A txout script template with a specific destination. It is either: - * * CNoDestination: no destination set - * * CKeyID: TX_PUBKEYHASH destination - * * CScriptID: TX_SCRIPTHASH destination - * A CTxDestination is the internal data type encoded in a CBitcoinAddress - */ -typedef boost::variant CTxDestination; - /** Serialized script, used inside transaction inputs and outputs */ class CScript : public std::vector { @@ -604,9 +590,6 @@ public: return (size() > 0 && *begin() == OP_RETURN); } - void SetDestination(const CTxDestination& address); - void SetMultisig(int nRequired, const std::vector& keys); - std::string ToString() const { std::string str; diff --git a/src/script/standard.cpp b/src/script/standard.cpp index bda4b8b0ae..407baf621d 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -252,3 +252,50 @@ bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, vecto return true; } + +namespace +{ +class CScriptVisitor : public boost::static_visitor +{ +private: + CScript *script; +public: + CScriptVisitor(CScript *scriptin) { script = scriptin; } + + bool operator()(const CNoDestination &dest) const { + script->clear(); + return false; + } + + bool operator()(const CKeyID &keyID) const { + script->clear(); + *script << OP_DUP << OP_HASH160 << keyID << OP_EQUALVERIFY << OP_CHECKSIG; + return true; + } + + bool operator()(const CScriptID &scriptID) const { + script->clear(); + *script << OP_HASH160 << scriptID << OP_EQUAL; + return true; + } +}; +} + +CScript GetScriptForDestination(const CTxDestination& dest) +{ + CScript script; + + boost::apply_visitor(CScriptVisitor(&script), dest); + return script; +} + +CScript GetScriptForMultisig(int nRequired, const std::vector& keys) +{ + CScript script; + + script << CScript::EncodeOP_N(nRequired); + BOOST_FOREACH(const CPubKey& key, keys) + script << key; + script << CScript::EncodeOP_N(keys.size()) << OP_CHECKMULTISIG; + return script; +} diff --git a/src/script/standard.h b/src/script/standard.h index 6c17a9394e..ead79b82a2 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -45,6 +45,20 @@ enum txnouttype TX_NULL_DATA, }; +class CNoDestination { +public: + friend bool operator==(const CNoDestination &a, const CNoDestination &b) { return true; } + friend bool operator<(const CNoDestination &a, const CNoDestination &b) { return true; } +}; + +/** A txout script template with a specific destination. It is either: + * * CNoDestination: no destination set + * * CKeyID: TX_PUBKEYHASH destination + * * CScriptID: TX_SCRIPTHASH destination + * A CTxDestination is the internal data type encoded in a CBitcoinAddress + */ +typedef boost::variant CTxDestination; + const char* GetTxnOutputType(txnouttype t); bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector >& vSolutionsRet); @@ -53,4 +67,7 @@ bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType); bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet); bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::vector& addressRet, int& nRequiredRet); +CScript GetScriptForDestination(const CTxDestination& dest); +CScript GetScriptForMultisig(int nRequired, const std::vector& keys); + #endif // H_BITCOIN_SCRIPT_STANDARD diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index e019674816..af01e5518c 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -173,7 +173,7 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans) tx.vin[0].scriptSig << OP_1; tx.vout.resize(1); tx.vout[0].nValue = 1*CENT; - tx.vout[0].scriptPubKey.SetDestination(key.GetPubKey().GetID()); + tx.vout[0].scriptPubKey = GetScriptForDestination(key.GetPubKey().GetID()); AddOrphanTx(tx, i); } @@ -189,7 +189,7 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans) tx.vin[0].prevout.hash = txPrev.GetHash(); tx.vout.resize(1); tx.vout[0].nValue = 1*CENT; - tx.vout[0].scriptPubKey.SetDestination(key.GetPubKey().GetID()); + tx.vout[0].scriptPubKey = GetScriptForDestination(key.GetPubKey().GetID()); SignSignature(keystore, txPrev, tx, 0); AddOrphanTx(tx, i); @@ -203,7 +203,7 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans) CMutableTransaction tx; tx.vout.resize(1); tx.vout[0].nValue = 1*CENT; - tx.vout[0].scriptPubKey.SetDestination(key.GetPubKey().GetID()); + tx.vout[0].scriptPubKey = GetScriptForDestination(key.GetPubKey().GetID()); tx.vin.resize(500); for (unsigned int j = 0; j < tx.vin.size(); j++) { diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index 47977cf295..9e4669eba9 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -170,7 +170,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) tx.vin[0].scriptSig = CScript() << OP_1; tx.vout[0].nValue = 4900000000LL; script = CScript() << OP_0; - tx.vout[0].scriptPubKey.SetDestination(script.GetID()); + tx.vout[0].scriptPubKey = GetScriptForDestination(script.GetID()); hash = tx.GetHash(); mempool.addUnchecked(hash, CTxMemPoolEntry(tx, 11, GetTime(), 111.0, 11)); tx.vin[0].prevout.hash = hash; diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index f99002017f..1f3991d7b6 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -68,14 +68,14 @@ BOOST_AUTO_TEST_CASE(sign) // different keys, straight/P2SH, pubkey/pubkeyhash CScript standardScripts[4]; standardScripts[0] << key[0].GetPubKey() << OP_CHECKSIG; - standardScripts[1].SetDestination(key[1].GetPubKey().GetID()); + standardScripts[1] = GetScriptForDestination(key[1].GetPubKey().GetID()); standardScripts[2] << key[1].GetPubKey() << OP_CHECKSIG; - standardScripts[3].SetDestination(key[2].GetPubKey().GetID()); + standardScripts[3] = GetScriptForDestination(key[2].GetPubKey().GetID()); CScript evalScripts[4]; for (int i = 0; i < 4; i++) { keystore.AddCScript(standardScripts[i]); - evalScripts[i].SetDestination(standardScripts[i].GetID()); + evalScripts[i] = GetScriptForDestination(standardScripts[i].GetID()); } CMutableTransaction txFrom; // Funding transaction: @@ -129,8 +129,7 @@ BOOST_AUTO_TEST_CASE(norecurse) CScript invalidAsScript; invalidAsScript << OP_INVALIDOPCODE << OP_INVALIDOPCODE; - CScript p2sh; - p2sh.SetDestination(invalidAsScript.GetID()); + CScript p2sh = GetScriptForDestination(invalidAsScript.GetID()); CScript scriptSig; scriptSig << Serialize(invalidAsScript); @@ -140,8 +139,7 @@ BOOST_AUTO_TEST_CASE(norecurse) // Try to recur, and verification should succeed because // the inner HASH160 <> EQUAL should only check the hash: - CScript p2sh2; - p2sh2.SetDestination(p2sh.GetID()); + CScript p2sh2 = GetScriptForDestination(p2sh.GetID()); CScript scriptSig2; scriptSig2 << Serialize(invalidAsScript) << Serialize(p2sh); @@ -163,15 +161,15 @@ BOOST_AUTO_TEST_CASE(set) } CScript inner[4]; - inner[0].SetDestination(key[0].GetPubKey().GetID()); - inner[1].SetMultisig(2, std::vector(keys.begin(), keys.begin()+2)); - inner[2].SetMultisig(1, std::vector(keys.begin(), keys.begin()+2)); - inner[3].SetMultisig(2, std::vector(keys.begin(), keys.begin()+3)); + inner[0] = GetScriptForDestination(key[0].GetPubKey().GetID()); + inner[1] = GetScriptForMultisig(2, std::vector(keys.begin(), keys.begin()+2)); + inner[2] = GetScriptForMultisig(1, std::vector(keys.begin(), keys.begin()+2)); + inner[3] = GetScriptForMultisig(2, std::vector(keys.begin(), keys.begin()+3)); CScript outer[4]; for (int i = 0; i < 4; i++) { - outer[i].SetDestination(inner[i].GetID()); + outer[i] = GetScriptForDestination(inner[i].GetID()); keystore.AddCScript(inner[i]); } @@ -244,8 +242,7 @@ BOOST_AUTO_TEST_CASE(switchover) CScript scriptSig; scriptSig << Serialize(notValid); - CScript fund; - fund.SetDestination(notValid.GetID()); + CScript fund = GetScriptForDestination(notValid.GetID()); // Validation should succeed under old rules (hash is correct): @@ -274,11 +271,11 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) txFrom.vout.resize(7); // First three are standard: - CScript pay1; pay1.SetDestination(key[0].GetPubKey().GetID()); + CScript pay1 = GetScriptForDestination(key[0].GetPubKey().GetID()); keystore.AddCScript(pay1); - CScript pay1of3; pay1of3.SetMultisig(1, keys); + CScript pay1of3 = GetScriptForMultisig(1, keys); - txFrom.vout[0].scriptPubKey.SetDestination(pay1.GetID()); // P2SH (OP_CHECKSIG) + txFrom.vout[0].scriptPubKey = GetScriptForDestination(pay1.GetID()); // P2SH (OP_CHECKSIG) txFrom.vout[0].nValue = 1000; txFrom.vout[1].scriptPubKey = pay1; // ordinary OP_CHECKSIG txFrom.vout[1].nValue = 2000; @@ -293,7 +290,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) oneAndTwo << OP_2 << key[3].GetPubKey() << key[4].GetPubKey() << key[5].GetPubKey(); oneAndTwo << OP_3 << OP_CHECKMULTISIG; keystore.AddCScript(oneAndTwo); - txFrom.vout[3].scriptPubKey.SetDestination(oneAndTwo.GetID()); + txFrom.vout[3].scriptPubKey = GetScriptForDestination(oneAndTwo.GetID()); txFrom.vout[3].nValue = 4000; // vout[4] is max sigops: @@ -302,17 +299,17 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) fifteenSigops << key[i%3].GetPubKey(); fifteenSigops << OP_15 << OP_CHECKMULTISIG; keystore.AddCScript(fifteenSigops); - txFrom.vout[4].scriptPubKey.SetDestination(fifteenSigops.GetID()); + txFrom.vout[4].scriptPubKey = GetScriptForDestination(fifteenSigops.GetID()); txFrom.vout[4].nValue = 5000; // vout[5/6] are non-standard because they exceed MAX_P2SH_SIGOPS CScript sixteenSigops; sixteenSigops << OP_16 << OP_CHECKMULTISIG; keystore.AddCScript(sixteenSigops); - txFrom.vout[5].scriptPubKey.SetDestination(fifteenSigops.GetID()); + txFrom.vout[5].scriptPubKey = GetScriptForDestination(fifteenSigops.GetID()); txFrom.vout[5].nValue = 5000; CScript twentySigops; twentySigops << OP_CHECKMULTISIG; keystore.AddCScript(twentySigops); - txFrom.vout[6].scriptPubKey.SetDestination(twentySigops.GetID()); + txFrom.vout[6].scriptPubKey = GetScriptForDestination(twentySigops.GetID()); txFrom.vout[6].nValue = 6000; @@ -320,7 +317,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) CMutableTransaction txTo; txTo.vout.resize(1); - txTo.vout[0].scriptPubKey.SetDestination(key[1].GetPubKey().GetID()); + txTo.vout[0].scriptPubKey = GetScriptForDestination(key[1].GetPubKey().GetID()); txTo.vin.resize(5); for (int i = 0; i < 5; i++) @@ -352,7 +349,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) CMutableTransaction txToNonStd1; txToNonStd1.vout.resize(1); - txToNonStd1.vout[0].scriptPubKey.SetDestination(key[1].GetPubKey().GetID()); + txToNonStd1.vout[0].scriptPubKey = GetScriptForDestination(key[1].GetPubKey().GetID()); txToNonStd1.vout[0].nValue = 1000; txToNonStd1.vin.resize(1); txToNonStd1.vin[0].prevout.n = 5; @@ -364,7 +361,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) CMutableTransaction txToNonStd2; txToNonStd2.vout.resize(1); - txToNonStd2.vout[0].scriptPubKey.SetDestination(key[1].GetPubKey().GetID()); + txToNonStd2.vout[0].scriptPubKey = GetScriptForDestination(key[1].GetPubKey().GetID()); txToNonStd2.vout[0].nValue = 1000; txToNonStd2.vin.resize(1); txToNonStd2.vin[0].prevout.n = 6; diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index bc610778c4..7afe840897 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -280,7 +280,7 @@ BOOST_AUTO_TEST_CASE(script_combineSigs) CMutableTransaction txFrom; txFrom.vout.resize(1); - txFrom.vout[0].scriptPubKey.SetDestination(keys[0].GetPubKey().GetID()); + txFrom.vout[0].scriptPubKey = GetScriptForDestination(keys[0].GetPubKey().GetID()); CScript& scriptPubKey = txFrom.vout[0].scriptPubKey; CMutableTransaction txTo; txTo.vin.resize(1); @@ -309,7 +309,7 @@ BOOST_AUTO_TEST_CASE(script_combineSigs) // P2SH, single-signature case: CScript pkSingle; pkSingle << keys[0].GetPubKey() << OP_CHECKSIG; keystore.AddCScript(pkSingle); - scriptPubKey.SetDestination(pkSingle.GetID()); + scriptPubKey = GetScriptForDestination(pkSingle.GetID()); SignSignature(keystore, txFrom, txTo, 0); combined = CombineSignatures(scriptPubKey, txTo, 0, scriptSig, empty); BOOST_CHECK(combined == scriptSig); @@ -327,7 +327,7 @@ BOOST_AUTO_TEST_CASE(script_combineSigs) BOOST_CHECK(combined == scriptSig); // Hardest case: Multisig 2-of-3 - scriptPubKey.SetMultisig(2, pubkeys); + scriptPubKey = GetScriptForMultisig(2, pubkeys); keystore.AddCScript(scriptPubKey); SignSignature(keystore, txFrom, txTo, 0); combined = CombineSignatures(scriptPubKey, txTo, 0, scriptSig, empty); diff --git a/src/test/sigopcount_tests.cpp b/src/test/sigopcount_tests.cpp index 2d10c356ac..62a6cd63d6 100644 --- a/src/test/sigopcount_tests.cpp +++ b/src/test/sigopcount_tests.cpp @@ -4,6 +4,7 @@ #include "key.h" #include "script/script.h" +#include "script/standard.h" #include "uint256.h" #include @@ -37,8 +38,7 @@ BOOST_AUTO_TEST_CASE(GetSigOpCount) BOOST_CHECK_EQUAL(s1.GetSigOpCount(true), 3U); BOOST_CHECK_EQUAL(s1.GetSigOpCount(false), 21U); - CScript p2sh; - p2sh.SetDestination(s1.GetID()); + CScript p2sh = GetScriptForDestination(s1.GetID()); CScript scriptSig; scriptSig << OP_0 << Serialize(s1); BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(scriptSig), 3U); @@ -50,12 +50,11 @@ BOOST_AUTO_TEST_CASE(GetSigOpCount) k.MakeNewKey(true); keys.push_back(k.GetPubKey()); } - CScript s2; - s2.SetMultisig(1, keys); + CScript s2 = GetScriptForMultisig(1, keys); BOOST_CHECK_EQUAL(s2.GetSigOpCount(true), 3U); BOOST_CHECK_EQUAL(s2.GetSigOpCount(false), 20U); - p2sh.SetDestination(s2.GetID()); + p2sh = GetScriptForDestination(s2.GetID()); BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(true), 0U); BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(false), 0U); CScript scriptSig2; diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 21377395cf..221afa3420 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -248,9 +248,9 @@ SetupDummyInputs(CBasicKeyStore& keystoreRet, CCoinsView & coinsRet) dummyTransactions[1].vout.resize(2); dummyTransactions[1].vout[0].nValue = 21*CENT; - dummyTransactions[1].vout[0].scriptPubKey.SetDestination(key[2].GetPubKey().GetID()); + dummyTransactions[1].vout[0].scriptPubKey = GetScriptForDestination(key[2].GetPubKey().GetID()); dummyTransactions[1].vout[1].nValue = 22*CENT; - dummyTransactions[1].vout[1].scriptPubKey.SetDestination(key[3].GetPubKey().GetID()); + dummyTransactions[1].vout[1].scriptPubKey = GetScriptForDestination(key[3].GetPubKey().GetID()); coinsRet.SetCoins(dummyTransactions[1].GetHash(), CCoins(dummyTransactions[1], 0)); return dummyTransactions; @@ -307,7 +307,7 @@ BOOST_AUTO_TEST_CASE(test_IsStandard) t.vout[0].nValue = 90*CENT; CKey key; key.MakeNewKey(true); - t.vout[0].scriptPubKey.SetDestination(key.GetPubKey().GetID()); + t.vout[0].scriptPubKey = GetScriptForDestination(key.GetPubKey().GetID()); string reason; BOOST_CHECK(IsStandardTx(t, reason)); diff --git a/src/wallet.cpp b/src/wallet.cpp index 611fb8bbcd..6bfaec3681 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1385,7 +1385,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, // coin control: send change to custom address if (coinControl && !boost::get(&coinControl->destChange)) - scriptChange.SetDestination(coinControl->destChange); + scriptChange = GetScriptForDestination(coinControl->destChange); // no coin control: send change to newly generated address else @@ -1403,7 +1403,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, ret = reservekey.GetReservedKey(vchPubKey); assert(ret); // should never fail, as we just unlocked - scriptChange.SetDestination(vchPubKey.GetID()); + scriptChange = GetScriptForDestination(vchPubKey.GetID()); } CTxOut newTxOut(nChange, scriptChange); @@ -1556,8 +1556,7 @@ string CWallet::SendMoney(const CTxDestination &address, int64_t nValue, CWallet } // Parse Bitcoin address - CScript scriptPubKey; - scriptPubKey.SetDestination(address); + CScript scriptPubKey = GetScriptForDestination(address); // Create and send the transaction CReserveKey reservekey(this); diff --git a/src/wallet_ismine.cpp b/src/wallet_ismine.cpp index a3c221d3ab..07149ebd0b 100644 --- a/src/wallet_ismine.cpp +++ b/src/wallet_ismine.cpp @@ -29,8 +29,7 @@ unsigned int HaveKeys(const vector& pubkeys, const CKeyStore& keystore) isminetype IsMine(const CKeyStore &keystore, const CTxDestination& dest) { - CScript script; - script.SetDestination(dest); + CScript script = GetScriptForDestination(dest); return IsMine(keystore, script); } diff --git a/src/wallet_ismine.h b/src/wallet_ismine.h index 29e13a94a6..f326b86815 100644 --- a/src/wallet_ismine.h +++ b/src/wallet_ismine.h @@ -7,9 +7,10 @@ #define H_BITCOIN_WALLET_ISMINE #include "key.h" -#include "script/script.h" +#include "script/standard.h" class CKeyStore; +class CScript; /** IsMine() return codes */ enum isminetype From 7e3821c097c05a4790abac53ddd26ef28cb7cf4d Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 16 Sep 2014 13:25:46 -0400 Subject: [PATCH 0709/1288] travis: retry tests before giving up --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7580adf5c4..82f3290110 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,6 +58,6 @@ script: - cd bitcoin-$HOST - ./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false) - make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false ) - - if [ "$RUN_TESTS" = "true" ]; then make check; fi + - if [ "$RUN_TESTS" = "true" ]; then travis_retry make check; fi after_script: - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then (echo "Upload goes here. Something like: scp -r $BASE_OUTDIR server" || echo "upload failed"); fi From cf12c223d093d349822333582bd1899bdfb03bbc Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 16 Sep 2014 14:23:39 -0400 Subject: [PATCH 0710/1288] depends: respect CPPFLAGS when configuring with depends --- depends/config.site.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/config.site.in b/depends/config.site.in index 4012f5a8d1..1df04eec3f 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -52,7 +52,7 @@ export PATH=$prefix/native/bin:$PATH export PKG_CONFIG="`which pkg-config` --static" export PKG_CONFIG_LIBDIR=$prefix/lib/pkgconfig export PKG_CONFIG_PATH=$prefix/share/pkgconfig -export CPPFLAGS=-I$prefix/include/ +export CPPFLAGS="-I$prefix/include/ $CPPFLAGS" export CC="@CC@" export CXX="@CXX@" From 1b0c981cb69c63f09fef71241ded8a6279e4b993 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 16 Sep 2014 13:54:36 -0400 Subject: [PATCH 0711/1288] travis: use DEBUG_LOCKORDER for our quick/small Linux build --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 82f3290110..54799362a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ matrix: - compiler: "true 1" env: HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="NO_QT=1" GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" - compiler: "true 2" - env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_QT=1 NO_WALLET=1 NO_UPNP=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" + env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_QT=1 NO_WALLET=1 NO_UPNP=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat CPPFLAGS=-DDEBUG_LOCKORDER" - compiler: "true 3" env: HOST=x86_64-unknown-linux-gnu RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" - compiler: "true 4" From ab15b2ec71da7a82b1b08d09c0252582668a2a60 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 3 Sep 2014 15:54:37 +0200 Subject: [PATCH 0712/1288] Avoid copying undo data --- src/main.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 6c1c7166a8..15c3916a6f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1351,12 +1351,13 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach bool ret; // mark inputs spent if (!tx.IsCoinBase()) { - BOOST_FOREACH(const CTxIn &txin, tx.vin) { + txundo.vprevout.reserve(tx.vin.size()); + for (unsigned int i = 0; i < tx.vin.size(); i++) { + const CTxIn &txin = tx.vin[i]; CCoins &coins = inputs.GetCoins(txin.prevout.hash); - CTxInUndo undo; - ret = coins.Spend(txin.prevout, undo); + txundo.vprevout.push_back(CTxInUndo()); + ret = coins.Spend(txin.prevout, txundo.vprevout.back()); assert(ret); - txundo.vprevout.push_back(undo); } } @@ -1663,6 +1664,7 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C CDiskTxPos pos(pindex->GetBlockPos(), GetSizeOfCompactSize(block.vtx.size())); std::vector > vPos; vPos.reserve(block.vtx.size()); + blockundo.vtxundo.reserve(block.vtx.size() - 1); for (unsigned int i = 0; i < block.vtx.size(); i++) { const CTransaction &tx = block.vtx[i]; @@ -1698,10 +1700,11 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C control.Add(vChecks); } - CTxUndo txundo; - UpdateCoins(tx, state, view, txundo, pindex->nHeight); - if (!tx.IsCoinBase()) - blockundo.vtxundo.push_back(txundo); + CTxUndo undoDummy; + if (i > 0) { + blockundo.vtxundo.push_back(CTxUndo()); + } + UpdateCoins(tx, state, view, i == 0 ? undoDummy : blockundo.vtxundo.back(), pindex->nHeight); vPos.push_back(std::make_pair(tx.GetHash(), pos)); pos.nTxOffset += ::GetSerializeSize(tx, SER_DISK, CLIENT_VERSION); From c15e483f2394e51163ba2514cd56fdba32bb92a4 Mon Sep 17 00:00:00 2001 From: imharrywu Date: Thu, 18 Sep 2014 08:15:09 +0800 Subject: [PATCH 0713/1288] typo fix of booleamn to boolean --- src/rpcnet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 52f98fbf00..95f42eb47f 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -96,7 +96,7 @@ Value getpeerinfo(const Array& params, bool fHelp) " \"inbound\": true|false, (boolean) Inbound (true) or Outbound (false)\n" " \"startingheight\": n, (numeric) The starting height (block) of the peer\n" " \"banscore\": n, (numeric) The ban score\n" - " \"syncnode\": true|false (booleamn) if sync node\n" + " \"syncnode\": true|false (boolean) if sync node\n" " }\n" " ,...\n" "]\n" From 22d7e7014f2064fb9e52c634f68b3c5e965faec0 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 16 Sep 2014 15:16:29 +0200 Subject: [PATCH 0714/1288] prefer const string& over char* in CDB and CWalletDB constructor - also make parameter of CDBEnv::CheckpointLSN a constant reference --- src/db.cpp | 22 +++++++++++----------- src/db.h | 6 ++++-- src/walletdb.h | 2 +- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/db.cpp b/src/db.cpp index edbff6fd49..24206d34e1 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -215,7 +215,7 @@ bool CDBEnv::Salvage(std::string strFile, bool fAggressive, } -void CDBEnv::CheckpointLSN(std::string strFile) +void CDBEnv::CheckpointLSN(const std::string& strFile) { dbenv.txn_checkpoint(0, 0, 0); if (fMockDb) @@ -224,12 +224,12 @@ void CDBEnv::CheckpointLSN(std::string strFile) } -CDB::CDB(const char *pszFile, const char* pszMode) : +CDB::CDB(const std::string& strFilename, const char* pszMode) : pdb(NULL), activeTxn(NULL) { int ret; fReadOnly = (!strchr(pszMode, '+') && !strchr(pszMode, 'w')); - if (pszFile == NULL) + if (strFilename.empty()) return; bool fCreate = strchr(pszMode, 'c') != NULL; @@ -242,7 +242,7 @@ CDB::CDB(const char *pszFile, const char* pszMode) : if (!bitdb.Open(GetDataDir())) throw runtime_error("CDB : Failed to open database environment."); - strFile = pszFile; + strFile = strFilename; ++bitdb.mapFileUseCount[strFile]; pdb = bitdb.mapDb[strFile]; if (pdb == NULL) @@ -255,14 +255,14 @@ CDB::CDB(const char *pszFile, const char* pszMode) : DbMpoolFile*mpf = pdb->get_mpf(); ret = mpf->set_flags(DB_MPOOL_NOFILE, 1); if (ret != 0) - throw runtime_error(strprintf("CDB : Failed to configure for no temp file backing for database %s", pszFile)); + throw runtime_error(strprintf("CDB : Failed to configure for no temp file backing for database %s", strFile)); } - ret = pdb->open(NULL, // Txn pointer - fMockDb ? NULL : pszFile, // Filename - fMockDb ? pszFile : "main", // Logical db name - DB_BTREE, // Database type - nFlags, // Flags + ret = pdb->open(NULL, // Txn pointer + fMockDb ? NULL : strFile.c_str(), // Filename + fMockDb ? strFile.c_str() : "main", // Logical db name + DB_BTREE, // Database type + nFlags, // Flags 0); if (ret != 0) @@ -271,7 +271,7 @@ CDB::CDB(const char *pszFile, const char* pszMode) : pdb = NULL; --bitdb.mapFileUseCount[strFile]; strFile = ""; - throw runtime_error(strprintf("CDB : Error %d, can't open database %s", ret, pszFile)); + throw runtime_error(strprintf("CDB : Error %d, can't open database %s", ret, strFile)); } if (fCreate && !Exists(string("version"))) diff --git a/src/db.h b/src/db.h index 999750ff3f..eab27f43af 100644 --- a/src/db.h +++ b/src/db.h @@ -69,7 +69,7 @@ public: bool Open(const boost::filesystem::path &path); void Close(); void Flush(bool fShutdown); - void CheckpointLSN(std::string strFile); + void CheckpointLSN(const std::string& strFile); void CloseDb(const std::string& strFile); bool RemoveDb(const std::string& strFile); @@ -96,11 +96,13 @@ protected: DbTxn *activeTxn; bool fReadOnly; - explicit CDB(const char* pszFile, const char* pszMode="r+"); + explicit CDB(const std::string& strFilename, const char* pszMode="r+"); ~CDB() { Close(); } + public: void Flush(); void Close(); + private: CDB(const CDB&); void operator=(const CDB&); diff --git a/src/walletdb.h b/src/walletdb.h index ce63bb0b97..475d4fb96d 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -75,7 +75,7 @@ public: class CWalletDB : public CDB { public: - CWalletDB(std::string strFilename, const char* pszMode="r+") : CDB(strFilename.c_str(), pszMode) + CWalletDB(const std::string& strFilename, const char* pszMode = "r+") : CDB(strFilename, pszMode) { } private: From 93f84d0417e8e1c590b405bde6e153b413bd43f2 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 16 Sep 2014 15:18:33 +0200 Subject: [PATCH 0715/1288] cleanup class private and public areas in walletdb - only code movement --- src/walletdb.cpp | 4 +--- src/walletdb.h | 17 +++++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/walletdb.cpp b/src/walletdb.cpp index 03161250db..a84f44db01 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -242,9 +242,7 @@ void CWalletDB::ListAccountCreditDebit(const string& strAccount, listclose(); } - -DBErrors -CWalletDB::ReorderTransactions(CWallet* pwallet) +DBErrors CWalletDB::ReorderTransactions(CWallet* pwallet) { LOCK(pwallet->cs_wallet); // Old wallets didn't have any defined order for transactions diff --git a/src/walletdb.h b/src/walletdb.h index 475d4fb96d..2c5b608f3d 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -78,10 +78,7 @@ public: CWalletDB(const std::string& strFilename, const char* pszMode = "r+") : CDB(strFilename, pszMode) { } -private: - CWalletDB(const CWalletDB&); - void operator=(const CWalletDB&); -public: + bool WriteName(const std::string& strAddress, const std::string& strName); bool EraseName(const std::string& strAddress); @@ -119,19 +116,23 @@ public: bool WriteDestData(const std::string &address, const std::string &key, const std::string &value); /// Erase destination data tuple from wallet database bool EraseDestData(const std::string &address, const std::string &key); -private: - bool WriteAccountingEntry(const uint64_t nAccEntryNum, const CAccountingEntry& acentry); -public: + bool WriteAccountingEntry(const CAccountingEntry& acentry); int64_t GetAccountCreditDebit(const std::string& strAccount); void ListAccountCreditDebit(const std::string& strAccount, std::list& acentries); - DBErrors ReorderTransactions(CWallet*); + DBErrors ReorderTransactions(CWallet* pwallet); DBErrors LoadWallet(CWallet* pwallet); DBErrors FindWalletTx(CWallet* pwallet, std::vector& vTxHash, std::vector& vWtx); DBErrors ZapWalletTx(CWallet* pwallet, std::vector& vWtx); static bool Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys); static bool Recover(CDBEnv& dbenv, std::string filename); + +private: + CWalletDB(const CWalletDB&); + void operator=(const CWalletDB&); + + bool WriteAccountingEntry(const uint64_t nAccEntryNum, const CAccountingEntry& acentry); }; bool BackupWallet(const CWallet& wallet, const std::string& strDest); From d547ebf56ea1eeffd415ee9529c45f162bccaaf3 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 18 Sep 2014 10:11:45 +0200 Subject: [PATCH 0716/1288] Remove mention of MacPorts from OSX build docs --- doc/build-osx.md | 48 +++--------------------------------------------- 1 file changed, 3 insertions(+), 45 deletions(-) diff --git a/doc/build-osx.md b/doc/build-osx.md index ade9eb466b..5eeda5b08e 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -26,44 +26,14 @@ There's also an assumption that you already have `git` installed. If not, it's the path of least resistance to install [Github for Mac](https://mac.github.com/) (OS X 10.7+) or [Git for OS X](https://code.google.com/p/git-osx-installer/). It is also -available via Homebrew or MacPorts. +available via Homebrew. -You will also need to install [Homebrew](http://brew.sh) -or [MacPorts](https://www.macports.org/) in order to install library -dependencies. It's largely a religious decision which to choose, however, Homebrew -is now used for building release versions. +You will also need to install [Homebrew](http://brew.sh) in order to install library +dependencies. The installation of the actual dependencies is covered in the Instructions sections below. -Instructions: MacPorts ----------------------- - -### Install dependencies - - sudo port install boost db48@+no_java openssl miniupnpc autoconf pkgconfig automake libtool - -Optional: install Qt4 - - sudo port install qt4-mac qrencode protobuf-cpp - -### Building `bitcoind` - -1. Clone the github tree to get the source code and go into the directory. - - git clone git@github.com:bitcoin/bitcoin.git bitcoin - cd bitcoin - -2. Build bitcoind (and Bitcoin-Qt, if configured): - - ./autogen.sh - ./configure - make - -3. It is a good idea to build and run the unit tests, too: - - make check - Instructions: Homebrew ---------------------- @@ -126,18 +96,6 @@ All dependencies should be compiled with these flags: -arch x86_64 -isysroot $(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -For MacPorts, that means editing your macports.conf and setting -`macosx_deployment_target` and `build_arch`: - - macosx_deployment_target=10.6 - build_arch=x86_64 - -... and then uninstalling and re-installing, or simply rebuilding, all ports. - -As of December 2012, the `boost` port does not obey `macosx_deployment_target`. -Download `https://gavinandresen-bitcoin.s3.amazonaws.com/boost_macports_fix.zip` -for a fix. - Once dependencies are compiled, see release-process.md for how the Bitcoin-Qt.app bundle is packaged and signed to create the .dmg disk image that is distributed. From 62e5f8f96114a872354103ef566b5c74a16154d4 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 16 Sep 2014 18:13:05 +0200 Subject: [PATCH 0717/1288] CMessageHeader sanity changes - Remove spurious `pchCommand[1] = 1` in CMessageHeader() - Make sure that pchCommand is zero-padded if length is shorter than COMMAND_SIZE - Use strnlen to determine length of pcmCommand in GetCommand --- src/protocol.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/protocol.cpp b/src/protocol.cpp index 341de0602a..0e28f3abbd 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -24,7 +24,6 @@ CMessageHeader::CMessageHeader() { memcpy(pchMessageStart, Params().MessageStart(), MESSAGE_START_SIZE); memset(pchCommand, 0, sizeof(pchCommand)); - pchCommand[1] = 1; nMessageSize = -1; nChecksum = 0; } @@ -32,6 +31,7 @@ CMessageHeader::CMessageHeader() CMessageHeader::CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn) { memcpy(pchMessageStart, Params().MessageStart(), MESSAGE_START_SIZE); + memset(pchCommand, 0, sizeof(pchCommand)); strncpy(pchCommand, pszCommand, COMMAND_SIZE); nMessageSize = nMessageSizeIn; nChecksum = 0; @@ -39,10 +39,7 @@ CMessageHeader::CMessageHeader(const char* pszCommand, unsigned int nMessageSize std::string CMessageHeader::GetCommand() const { - if (pchCommand[COMMAND_SIZE-1] == 0) - return std::string(pchCommand, pchCommand + strlen(pchCommand)); - else - return std::string(pchCommand, pchCommand + COMMAND_SIZE); + return std::string(pchCommand, pchCommand + strnlen(pchCommand, COMMAND_SIZE)); } bool CMessageHeader::IsValid() const From a49f11d9edf2f7dbce154ca370494a8f86e013d0 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 18 Sep 2014 13:14:38 +0200 Subject: [PATCH 0718/1288] qt: Change splash screen to normal window Makes it possible to move, minimize, unminimize the window while Bitcoin Core is initializing. --- src/qt/bitcoin.cpp | 7 +++--- src/qt/splashscreen.cpp | 55 +++++++++++++++++++++++++++++++---------- src/qt/splashscreen.h | 15 +++++++++-- 3 files changed, 58 insertions(+), 19 deletions(-) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 6cc6b99ceb..676f218f20 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -338,8 +338,7 @@ void BitcoinApplication::createWindow(bool isaTestNet) void BitcoinApplication::createSplashScreen(bool isaTestNet) { - SplashScreen *splash = new SplashScreen(QPixmap(), 0, isaTestNet); - splash->setAttribute(Qt::WA_DeleteOnClose); + SplashScreen *splash = new SplashScreen(0, isaTestNet); splash->show(); connect(this, SIGNAL(splashFinished(QWidget*)), splash, SLOT(slotFinish(QWidget*))); } @@ -423,8 +422,6 @@ void BitcoinApplication::initializeResult(int retval) } #endif - emit splashFinished(window); - // If -min option passed, start window minimized. if(GetBoolArg("-min", false)) { @@ -434,6 +431,8 @@ void BitcoinApplication::initializeResult(int retval) { window->show(); } + emit splashFinished(window); + #ifdef ENABLE_WALLET // Now that initialization/startup is done, process any command-line // bitcoin: URIs or payment requests: diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 5dd110b36a..b6443d47ff 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -15,11 +15,12 @@ #include #include +#include -SplashScreen::SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f, bool isTestNet) : - QSplashScreen(pixmap, f) +SplashScreen::SplashScreen(Qt::WindowFlags f, bool isTestNet) : + QWidget(0, f), curAlignment(0) { - setAutoFillBackground(true); + //setAutoFillBackground(true); // set reference point, paddings int paddingRight = 50; @@ -38,15 +39,14 @@ SplashScreen::SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f, bool isTest QString font = "Arial"; // load the bitmap for writing some text over it - QPixmap newPixmap; if(isTestNet) { - newPixmap = QPixmap(":/images/splash_testnet"); + pixmap = QPixmap(":/images/splash_testnet"); } else { - newPixmap = QPixmap(":/images/splash"); + pixmap = QPixmap(":/images/splash"); } - QPainter pixPaint(&newPixmap); + QPainter pixPaint(&pixmap); pixPaint.setPen(QColor(100,100,100)); // check font size and drawing with @@ -61,7 +61,7 @@ SplashScreen::SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f, bool isTest pixPaint.setFont(QFont(font, 33*fontFactor)); fm = pixPaint.fontMetrics(); titleTextWidth = fm.width(titleText); - pixPaint.drawText(newPixmap.width()-titleTextWidth-paddingRight,paddingTop,titleText); + pixPaint.drawText(pixmap.width()-titleTextWidth-paddingRight,paddingTop,titleText); pixPaint.setFont(QFont(font, 15*fontFactor)); @@ -72,11 +72,11 @@ SplashScreen::SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f, bool isTest pixPaint.setFont(QFont(font, 10*fontFactor)); titleVersionVSpace -= 5; } - pixPaint.drawText(newPixmap.width()-titleTextWidth-paddingRight+2,paddingTop+titleVersionVSpace,versionText); + pixPaint.drawText(pixmap.width()-titleTextWidth-paddingRight+2,paddingTop+titleVersionVSpace,versionText); // draw copyright stuff pixPaint.setFont(QFont(font, 10*fontFactor)); - pixPaint.drawText(newPixmap.width()-titleTextWidth-paddingRight,paddingTop+titleCopyrightVSpace,copyrightText); + pixPaint.drawText(pixmap.width()-titleTextWidth-paddingRight,paddingTop+titleCopyrightVSpace,copyrightText); // draw testnet string if testnet is on if(isTestNet) { @@ -85,12 +85,22 @@ SplashScreen::SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f, bool isTest pixPaint.setFont(boldFont); fm = pixPaint.fontMetrics(); int testnetAddTextWidth = fm.width(testnetAddText); - pixPaint.drawText(newPixmap.width()-testnetAddTextWidth-10,15,testnetAddText); + pixPaint.drawText(pixmap.width()-testnetAddTextWidth-10,15,testnetAddText); } pixPaint.end(); - this->setPixmap(newPixmap); + // Set window title + if(isTestNet) + setWindowTitle(titleText + " " + testnetAddText); + else + setWindowTitle(titleText); + + // Resize window and move to center of desktop, disallow resizing + QRect r(QPoint(), pixmap.size()); + resize(r.size()); + setFixedSize(r.size()); + move(QApplication::desktop()->screenGeometry().center() - r.center()); subscribeToCoreSignals(); } @@ -102,7 +112,8 @@ SplashScreen::~SplashScreen() void SplashScreen::slotFinish(QWidget *mainWin) { - finish(mainWin); + hide(); + deleteLater(); } static void InitMessage(SplashScreen *splash, const std::string &message) @@ -146,3 +157,21 @@ void SplashScreen::unsubscribeFromCoreSignals() pwalletMain->ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2)); #endif } + +void SplashScreen::showMessage(const QString &message, int alignment, const QColor &color) +{ + curMessage = message; + curAlignment = alignment; + curColor = color; + update(); +} + +void SplashScreen::paintEvent(QPaintEvent *event) +{ + QPainter painter(this); + painter.drawPixmap(0, 0, pixmap); + QRect r = rect().adjusted(5, 5, -5, -5); + painter.setPen(curColor); + painter.drawText(r, curAlignment, curMessage); +} + diff --git a/src/qt/splashscreen.h b/src/qt/splashscreen.h index d79038d81d..1151d6c111 100644 --- a/src/qt/splashscreen.h +++ b/src/qt/splashscreen.h @@ -9,23 +9,34 @@ /** class for the splashscreen with information of the running client */ -class SplashScreen : public QSplashScreen +class SplashScreen : public QWidget { Q_OBJECT public: - explicit SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f, bool isTestNet); + explicit SplashScreen(Qt::WindowFlags f, bool isTestNet); ~SplashScreen(); +protected: + void paintEvent(QPaintEvent *event); + public slots: /** Slot to call finish() method as it's not defined as slot */ void slotFinish(QWidget *mainWin); + /** Show message and progress */ + void showMessage(const QString &message, int alignment, const QColor &color); + private: /** Connect core signals to splash screen */ void subscribeToCoreSignals(); /** Disconnect core signals to splash screen */ void unsubscribeFromCoreSignals(); + + QPixmap pixmap; + QString curMessage; + QColor curColor; + int curAlignment; }; #endif // SPLASHSCREEN_H From 5e83bc404c77d6e70c62152f1f97eb264afcc80d Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 5 Sep 2014 13:18:35 +0200 Subject: [PATCH 0719/1288] [Qt] include and file header cleanup - alphabetical ordering - correct ordering own headers before normal headers etc. --- src/qt/bitcoin.cpp | 5 ++++- src/qt/bitcoinamountfield.h | 4 ++-- src/qt/bitcoingui.cpp | 5 +++-- src/qt/coincontroldialog.h | 8 +++++--- src/qt/intro.h | 2 +- src/qt/openuridialog.h | 2 +- src/qt/optionsdialog.cpp | 2 ++ src/qt/optionsmodel.cpp | 1 + src/qt/paymentrequestplus.cpp | 1 + src/qt/receivecoinsdialog.h | 7 ++++--- src/qt/rpcconsole.cpp | 4 +++- src/qt/rpcconsole.h | 8 ++++---- src/qt/sendcoinsdialog.h | 8 ++++---- src/qt/splashscreen.cpp | 3 ++- src/qt/transactiondesc.cpp | 4 ++-- 15 files changed, 39 insertions(+), 25 deletions(-) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 6cc6b99ceb..d9ca423015 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -16,6 +16,7 @@ #include "splashscreen.h" #include "utilitydialog.h" #include "winshutdownmonitor.h" + #ifdef ENABLE_WALLET #include "paymentserver.h" #include "walletmodel.h" @@ -26,6 +27,7 @@ #include "rpcserver.h" #include "ui_interface.h" #include "util.h" + #ifdef ENABLE_WALLET #include "wallet.h" #endif @@ -34,15 +36,16 @@ #include #include + #include #include #include #include #include #include +#include #include #include -#include #if defined(QT_STATICPLUGIN) #include diff --git a/src/qt/bitcoinamountfield.h b/src/qt/bitcoinamountfield.h index c713f5d687..84795a7e7a 100644 --- a/src/qt/bitcoinamountfield.h +++ b/src/qt/bitcoinamountfield.h @@ -7,12 +7,12 @@ #include +class AmountSpinBox; + QT_BEGIN_NAMESPACE class QValueComboBox; QT_END_NAMESPACE -class AmountSpinBox; - /** Widget for entering bitcoin amounts. */ class BitcoinAmountField: public QWidget diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 790301a1eb..dd5192982e 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -14,6 +14,7 @@ #include "optionsmodel.h" #include "rpcconsole.h" #include "utilitydialog.h" + #ifdef ENABLE_WALLET #include "walletframe.h" #include "walletmodel.h" @@ -24,8 +25,8 @@ #endif #include "init.h" -#include "util.h" #include "ui_interface.h" +#include "util.h" #include @@ -50,8 +51,8 @@ #include #if QT_VERSION < 0x050000 -#include #include +#include #else #include #endif diff --git a/src/qt/coincontroldialog.h b/src/qt/coincontroldialog.h index 4f7422642f..a6f239a898 100644 --- a/src/qt/coincontroldialog.h +++ b/src/qt/coincontroldialog.h @@ -14,12 +14,14 @@ #include #include +class WalletModel; + +class CCoinControl; +class CTxMemPool; + namespace Ui { class CoinControlDialog; } -class WalletModel; -class CCoinControl; -class CTxMemPool; class CoinControlDialog : public QDialog { diff --git a/src/qt/intro.h b/src/qt/intro.h index 295a75562f..e3e396d369 100644 --- a/src/qt/intro.h +++ b/src/qt/intro.h @@ -12,7 +12,7 @@ class FreespaceChecker; namespace Ui { -class Intro; + class Intro; } /** Introduction screen (pre-GUI startup). diff --git a/src/qt/openuridialog.h b/src/qt/openuridialog.h index 28da7d6d9d..67a5f167d1 100644 --- a/src/qt/openuridialog.h +++ b/src/qt/openuridialog.h @@ -8,7 +8,7 @@ #include namespace Ui { -class OpenURIDialog; + class OpenURIDialog; } class OpenURIDialog : public QDialog diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index c775a7f8d6..279467129f 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -17,11 +17,13 @@ #include "main.h" // for MAX_SCRIPTCHECK_THREADS #include "netbase.h" #include "txdb.h" // for -dbcache defaults + #ifdef ENABLE_WALLET #include "wallet.h" // for CWallet::minTxFee #endif #include + #include #include #include diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 99928ebe4d..bd747faeb6 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -15,6 +15,7 @@ #include "main.h" #include "net.h" #include "txdb.h" // for -dbcache defaults + #ifdef ENABLE_WALLET #include "wallet.h" #include "walletdb.h" diff --git a/src/qt/paymentrequestplus.cpp b/src/qt/paymentrequestplus.cpp index acce42e203..7b7de49831 100644 --- a/src/qt/paymentrequestplus.cpp +++ b/src/qt/paymentrequestplus.cpp @@ -13,6 +13,7 @@ #include #include + #include #include #include diff --git a/src/qt/receivecoinsdialog.h b/src/qt/receivecoinsdialog.h index 663cb157a4..7a7e38e25e 100644 --- a/src/qt/receivecoinsdialog.h +++ b/src/qt/receivecoinsdialog.h @@ -5,6 +5,8 @@ #ifndef RECEIVECOINSDIALOG_H #define RECEIVECOINSDIALOG_H +#include "guiutil.h" + #include #include #include @@ -13,13 +15,12 @@ #include #include -#include "guiutil.h" +class OptionsModel; +class WalletModel; namespace Ui { class ReceiveCoinsDialog; } -class OptionsModel; -class WalletModel; QT_BEGIN_NAMESPACE class QModelIndex; diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 11089b2497..8129353d4b 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -16,10 +16,12 @@ #include "util.h" #include "json/json_spirit_value.h" + +#include + #ifdef ENABLE_WALLET #include #endif -#include #include #include diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 64bb5c29b3..1ffff92758 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -14,14 +14,14 @@ class ClientModel; -QT_BEGIN_NAMESPACE -class QItemSelection; -QT_END_NAMESPACE - namespace Ui { class RPCConsole; } +QT_BEGIN_NAMESPACE +class QItemSelection; +QT_END_NAMESPACE + /** Local Bitcoin RPC console. */ class RPCConsole: public QDialog { diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h index 6cdf4a00c8..a090fa42d5 100644 --- a/src/qt/sendcoinsdialog.h +++ b/src/qt/sendcoinsdialog.h @@ -14,14 +14,14 @@ class OptionsModel; class SendCoinsEntry; class SendCoinsRecipient; -QT_BEGIN_NAMESPACE -class QUrl; -QT_END_NAMESPACE - namespace Ui { class SendCoinsDialog; } +QT_BEGIN_NAMESPACE +class QUrl; +QT_END_NAMESPACE + /** Dialog for sending bitcoins */ class SendCoinsDialog : public QDialog { diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 5dd110b36a..feb0f3350f 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -4,11 +4,12 @@ #include "splashscreen.h" -#include "version.h" #include "clientversion.h" #include "init.h" #include "ui_interface.h" #include "util.h" +#include "version.h" + #ifdef ENABLE_WALLET #include "wallet.h" #endif diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 727b8dc66d..4923718341 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -6,13 +6,13 @@ #include "bitcoinunits.h" #include "guiutil.h" +#include "paymentserver.h" +#include "transactionrecord.h" #include "base58.h" #include "db.h" #include "main.h" -#include "paymentserver.h" #include "script/script.h" -#include "transactionrecord.h" #include "timedata.h" #include "ui_interface.h" #include "util.h" From 94064710b9123dfb3df8cfd6c32efae349aec281 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 18 Sep 2014 14:08:43 +0200 Subject: [PATCH 0720/1288] Write fee estimate and peers files only when initialized Fixes #4669. Move the loading of addresses to StartNode() to make it more self-contained. --- src/init.cpp | 27 ++++++++++----------------- src/net.cpp | 20 +++++++++++++++++++- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 67f53e044c..0a6b5abac5 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -47,6 +47,7 @@ using namespace std; #ifdef ENABLE_WALLET CWallet* pwalletMain; #endif +bool fFeeEstimatesInitialized = false; #ifdef WIN32 // Win32 LevelDB doesn't use filedescriptors, and the ones used for @@ -119,6 +120,10 @@ void Shutdown() if (!lockShutdown) return; + /// Note: Shutdown() must be able to handle cases in which AppInit2() failed part of the way, + /// for example if the data directory was found to be locked. + /// Be sure that anything that writes files or flushes caches only does this if the respective + /// module was initialized. RenameThread("bitcoin-shutoff"); mempool.AddTransactionsUpdated(1); StopRPCThreads(); @@ -130,6 +135,7 @@ void Shutdown() StopNode(); UnregisterNodeSignals(GetNodeSignals()); + if (fFeeEstimatesInitialized) { boost::filesystem::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME; CAutoFile est_fileout(fopen(est_path.string().c_str(), "wb"), SER_DISK, CLIENT_VERSION); @@ -137,6 +143,7 @@ void Shutdown() mempool.WriteFeeEstimates(est_fileout); else LogPrintf("%s: Failed to write fee estimates to %s\n", __func__, est_path.string()); + fFeeEstimatesInitialized = false; } { @@ -1056,6 +1063,7 @@ bool AppInit2(boost::thread_group& threadGroup) // Allowed to fail as this file IS missing on first startup. if (est_filein) mempool.ReadFeeEstimates(est_filein); + fFeeEstimatesInitialized = true; // ********************************************************* Step 8: load wallet #ifdef ENABLE_WALLET @@ -1212,22 +1220,7 @@ bool AppInit2(boost::thread_group& threadGroup) } threadGroup.create_thread(boost::bind(&ThreadImport, vImportFiles)); - // ********************************************************* Step 10: load peers - - uiInterface.InitMessage(_("Loading addresses...")); - - nStart = GetTimeMillis(); - - { - CAddrDB adb; - if (!adb.Read(addrman)) - LogPrintf("Invalid or missing peers.dat; recreating\n"); - } - - LogPrintf("Loaded %i addresses from peers.dat %dms\n", - addrman.size(), GetTimeMillis() - nStart); - - // ********************************************************* Step 11: start node + // ********************************************************* Step 10: start node if (!CheckDiskSpace()) return false; @@ -1256,7 +1249,7 @@ bool AppInit2(boost::thread_group& threadGroup) GenerateBitcoins(GetBoolArg("-gen", false), pwalletMain, GetArg("-genproclimit", -1)); #endif - // ********************************************************* Step 12: finished + // ********************************************************* Step 11: finished uiInterface.InitMessage(_("Done loading")); diff --git a/src/net.cpp b/src/net.cpp index ab547e2fd7..ebb103b636 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -78,6 +78,7 @@ uint64_t nLocalHostNonce = 0; static std::vector vhListenSocket; CAddrMan addrman; int nMaxConnections = 125; +bool fAddressesInitialized = false; vector vNodes; CCriticalSection cs_vNodes; @@ -1739,6 +1740,18 @@ void static Discover(boost::thread_group& threadGroup) void StartNode(boost::thread_group& threadGroup) { + uiInterface.InitMessage(_("Loading addresses...")); + // Load addresses for peers.dat + int64_t nStart = GetTimeMillis(); + { + CAddrDB adb; + if (!adb.Read(addrman)) + LogPrintf("Invalid or missing peers.dat; recreating\n"); + } + LogPrintf("Loaded %i addresses from peers.dat %dms\n", + addrman.size(), GetTimeMillis() - nStart); + fAddressesInitialized = true; + if (semOutbound == NULL) { // initialize semaphore int nMaxOutbound = min(MAX_OUTBOUND_CONNECTIONS, nMaxConnections); @@ -1785,7 +1798,12 @@ bool StopNode() if (semOutbound) for (int i=0; ipost(); - DumpAddresses(); + + if (fAddressesInitialized) + { + DumpAddresses(); + fAddressesInitialized = false; + } return true; } From 018cec7c41e5fca9cfe80c618444a4d343fc44e2 Mon Sep 17 00:00:00 2001 From: ENikS Date: Thu, 18 Sep 2014 16:57:01 -0400 Subject: [PATCH 0721/1288] Fixing 'vector out of bounds' issue in base 32 and 64 --- src/utilstrencodings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index 6837e4e267..2cec3023b5 100644 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -224,7 +224,7 @@ vector DecodeBase64(const char* p, bool* pfInvalid) string DecodeBase64(const string& str) { vector vchRet = DecodeBase64(str.c_str()); - return string((const char*)&vchRet[0], vchRet.size()); + return (vchRet.size() == 0) ? string() : string((const char*)&vchRet[0], vchRet.size()); } string EncodeBase32(const unsigned char* pch, size_t len) @@ -411,7 +411,7 @@ vector DecodeBase32(const char* p, bool* pfInvalid) string DecodeBase32(const string& str) { vector vchRet = DecodeBase32(str.c_str()); - return string((const char*)&vchRet[0], vchRet.size()); + return (vchRet.size() == 0) ? string() : string((const char*)&vchRet[0], vchRet.size()); } bool ParseInt32(const std::string& str, int32_t *out) From 20e01b1a03819d843a860284033b48a5e3b65ff7 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 19 Sep 2014 19:21:46 +0200 Subject: [PATCH 0722/1288] Apply clang-format on some infrequently-updated files --- src/addrman.cpp | 225 ++++++++++++++++++++-------------------- src/allocators.cpp | 7 +- src/allocators.h | 94 +++++++++-------- src/base58.cpp | 129 ++++++++++++++--------- src/chainparamsbase.cpp | 56 ++++++---- src/chainparamsbase.h | 3 +- src/checkpoints.h | 20 ++-- src/checkqueue.h | 59 +++++++---- src/clientversion.h | 12 +-- src/coincontrol.h | 1 - src/db.cpp | 144 +++++++++++-------------- src/db.h | 33 +++--- src/hash.cpp | 32 +++--- src/init.h | 8 +- src/key.h | 131 +++++++++++++---------- src/leveldbwrapper.cpp | 15 ++- src/leveldbwrapper.h | 47 ++++++--- src/limitedmap.h | 18 ++-- src/mruset.h | 18 ++-- src/noui.cpp | 2 +- src/protocol.h | 143 ++++++++++++------------- src/random.cpp | 28 +++-- src/random.h | 2 +- src/rpcclient.h | 2 +- src/sync.cpp | 48 ++++----- src/sync.h | 70 +++++++------ src/threadsafety.h | 40 +++---- src/timedata.h | 23 ++-- src/uint256.cpp | 133 ++++++++++++++---------- src/version.cpp | 44 ++++---- 30 files changed, 845 insertions(+), 742 deletions(-) diff --git a/src/addrman.cpp b/src/addrman.cpp index 68948ac7ff..7b674a66e7 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -9,7 +9,7 @@ using namespace std; -int CAddrInfo::GetTriedBucket(const std::vector &nKey) const +int CAddrInfo::GetTriedBucket(const std::vector& nKey) const { CDataStream ss1(SER_GETHASH, 0); std::vector vchKey = GetKey(); @@ -23,7 +23,7 @@ int CAddrInfo::GetTriedBucket(const std::vector &nKey) const return hash2 % ADDRMAN_TRIED_BUCKET_COUNT; } -int CAddrInfo::GetNewBucket(const std::vector &nKey, const CNetAddr& src) const +int CAddrInfo::GetNewBucket(const std::vector& nKey, const CNetAddr& src) const { CDataStream ss1(SER_GETHASH, 0); std::vector vchGroupKey = GetGroup(); @@ -39,19 +39,19 @@ int CAddrInfo::GetNewBucket(const std::vector &nKey, const CNetAd bool CAddrInfo::IsTerrible(int64_t nNow) const { - if (nLastTry && nLastTry >= nNow-60) // never remove things tried the last minute + if (nLastTry && nLastTry >= nNow - 60) // never remove things tried the last minute return false; - if (nTime > nNow + 10*60) // came in a flying DeLorean + if (nTime > nNow + 10 * 60) // came in a flying DeLorean return true; - if (nTime==0 || nNow-nTime > ADDRMAN_HORIZON_DAYS*24*60*60) // not seen in recent history + if (nTime == 0 || nNow - nTime > ADDRMAN_HORIZON_DAYS * 24 * 60 * 60) // not seen in recent history return true; - if (nLastSuccess==0 && nAttempts>=ADDRMAN_RETRIES) // tried N times and never a success + if (nLastSuccess == 0 && nAttempts >= ADDRMAN_RETRIES) // tried N times and never a success return true; - if (nNow-nLastSuccess > ADDRMAN_MIN_FAIL_DAYS*24*60*60 && nAttempts>=ADDRMAN_MAX_FAILURES) // N successive failures in the last week + if (nNow - nLastSuccess > ADDRMAN_MIN_FAIL_DAYS * 24 * 60 * 60 && nAttempts >= ADDRMAN_MAX_FAILURES) // N successive failures in the last week return true; return false; @@ -64,23 +64,25 @@ double CAddrInfo::GetChance(int64_t nNow) const int64_t nSinceLastSeen = nNow - nTime; int64_t nSinceLastTry = nNow - nLastTry; - if (nSinceLastSeen < 0) nSinceLastSeen = 0; - if (nSinceLastTry < 0) nSinceLastTry = 0; + if (nSinceLastSeen < 0) + nSinceLastSeen = 0; + if (nSinceLastTry < 0) + nSinceLastTry = 0; fChance *= 600.0 / (600.0 + nSinceLastSeen); // deprioritize very recent attempts away - if (nSinceLastTry < 60*10) + if (nSinceLastTry < 60 * 10) fChance *= 0.01; // deprioritize 50% after each failed attempt - for (int n=0; n::iterator it = mapAddr.find(addr); if (it == mapAddr.end()) @@ -93,7 +95,7 @@ CAddrInfo* CAddrMan::Find(const CNetAddr& addr, int *pnId) return NULL; } -CAddrInfo* CAddrMan::Create(const CAddress &addr, const CNetAddr &addrSource, int *pnId) +CAddrInfo* CAddrMan::Create(const CAddress& addr, const CNetAddr& addrSource, int* pnId) { int nId = nIdCount++; mapInfo[nId] = CAddrInfo(addr, addrSource); @@ -127,22 +129,21 @@ void CAddrMan::SwapRandom(unsigned int nRndPos1, unsigned int nRndPos2) int CAddrMan::SelectTried(int nKBucket) { - std::vector &vTried = vvTried[nKBucket]; + std::vector& vTried = vvTried[nKBucket]; // random shuffle the first few elements (using the entire list) // find the least recently tried among them int64_t nOldest = -1; int nOldestPos = -1; - for (unsigned int i = 0; i < ADDRMAN_TRIED_ENTRIES_INSPECT_ON_EVICT && i < vTried.size(); i++) - { + for (unsigned int i = 0; i < ADDRMAN_TRIED_ENTRIES_INSPECT_ON_EVICT && i < vTried.size(); i++) { int nPos = GetRandInt(vTried.size() - i) + i; int nTemp = vTried[nPos]; vTried[nPos] = vTried[i]; vTried[i] = nTemp; assert(nOldest == -1 || mapInfo.count(nTemp) == 1); if (nOldest == -1 || mapInfo[nTemp].nLastSuccess < mapInfo[nOldest].nLastSuccess) { - nOldest = nTemp; - nOldestPos = nPos; + nOldest = nTemp; + nOldestPos = nPos; } } @@ -152,18 +153,15 @@ int CAddrMan::SelectTried(int nKBucket) int CAddrMan::ShrinkNew(int nUBucket) { assert(nUBucket >= 0 && (unsigned int)nUBucket < vvNew.size()); - std::set &vNew = vvNew[nUBucket]; + std::set& vNew = vvNew[nUBucket]; // first look for deletable items - for (std::set::iterator it = vNew.begin(); it != vNew.end(); it++) - { + for (std::set::iterator it = vNew.begin(); it != vNew.end(); it++) { assert(mapInfo.count(*it)); - CAddrInfo &info = mapInfo[*it]; - if (info.IsTerrible()) - { - if (--info.nRefCount == 0) - { - SwapRandom(info.nRandomPos, vRandom.size()-1); + CAddrInfo& info = mapInfo[*it]; + if (info.IsTerrible()) { + if (--info.nRefCount == 0) { + SwapRandom(info.nRandomPos, vRandom.size() - 1); vRandom.pop_back(); mapAddr.erase(info); mapInfo.erase(*it); @@ -178,10 +176,8 @@ int CAddrMan::ShrinkNew(int nUBucket) int n[4] = {GetRandInt(vNew.size()), GetRandInt(vNew.size()), GetRandInt(vNew.size()), GetRandInt(vNew.size())}; int nI = 0; int nOldest = -1; - for (std::set::iterator it = vNew.begin(); it != vNew.end(); it++) - { - if (nI == n[0] || nI == n[1] || nI == n[2] || nI == n[3]) - { + for (std::set::iterator it = vNew.begin(); it != vNew.end(); it++) { + if (nI == n[0] || nI == n[1] || nI == n[2] || nI == n[3]) { assert(nOldest == -1 || mapInfo.count(*it) == 1); if (nOldest == -1 || mapInfo[*it].nTime < mapInfo[nOldest].nTime) nOldest = *it; @@ -189,10 +185,9 @@ int CAddrMan::ShrinkNew(int nUBucket) nI++; } assert(mapInfo.count(nOldest) == 1); - CAddrInfo &info = mapInfo[nOldest]; - if (--info.nRefCount == 0) - { - SwapRandom(info.nRandomPos, vRandom.size()-1); + CAddrInfo& info = mapInfo[nOldest]; + if (--info.nRefCount == 0) { + SwapRandom(info.nRandomPos, vRandom.size() - 1); vRandom.pop_back(); mapAddr.erase(info); mapInfo.erase(nOldest); @@ -208,8 +203,7 @@ void CAddrMan::MakeTried(CAddrInfo& info, int nId, int nOrigin) assert(vvNew[nOrigin].count(nId) == 1); // remove the entry from all new buckets - for (std::vector >::iterator it = vvNew.begin(); it != vvNew.end(); it++) - { + for (std::vector >::iterator it = vvNew.begin(); it != vvNew.end(); it++) { if ((*it).erase(nId)) info.nRefCount--; } @@ -219,11 +213,10 @@ void CAddrMan::MakeTried(CAddrInfo& info, int nId, int nOrigin) // what tried bucket to move the entry to int nKBucket = info.GetTriedBucket(nKey); - std::vector &vTried = vvTried[nKBucket]; + std::vector& vTried = vvTried[nKBucket]; // first check whether there is place to just add it - if (vTried.size() < ADDRMAN_TRIED_BUCKET_SIZE) - { + if (vTried.size() < ADDRMAN_TRIED_BUCKET_SIZE) { vTried.push_back(nId); nTried++; info.fInTried = true; @@ -236,7 +229,7 @@ void CAddrMan::MakeTried(CAddrInfo& info, int nId, int nOrigin) // find which new bucket it belongs to assert(mapInfo.count(vTried[nPos]) == 1); int nUBucket = mapInfo[vTried[nPos]].GetNewBucket(nKey); - std::set &vNew = vvNew[nUBucket]; + std::set& vNew = vvNew[nUBucket]; // remove the to-be-replaced tried entry from the tried set CAddrInfo& infoOld = mapInfo[vTried[nPos]]; @@ -245,8 +238,7 @@ void CAddrMan::MakeTried(CAddrInfo& info, int nId, int nOrigin) // do not update nTried, as we are going to move something else there immediately // check whether there is place in that one, - if (vNew.size() < ADDRMAN_NEW_BUCKET_SIZE) - { + if (vNew.size() < ADDRMAN_NEW_BUCKET_SIZE) { // if so, move it back there vNew.insert(vTried[nPos]); } else { @@ -261,16 +253,16 @@ void CAddrMan::MakeTried(CAddrInfo& info, int nId, int nOrigin) return; } -void CAddrMan::Good_(const CService &addr, int64_t nTime) +void CAddrMan::Good_(const CService& addr, int64_t nTime) { int nId; - CAddrInfo *pinfo = Find(addr, &nId); + CAddrInfo* pinfo = Find(addr, &nId); // if not found, bail out if (!pinfo) return; - CAddrInfo &info = *pinfo; + CAddrInfo& info = *pinfo; // check whether we are talking about the exact same CService (including same port) if (info != addr) @@ -289,12 +281,10 @@ void CAddrMan::Good_(const CService &addr, int64_t nTime) // find a bucket it is in now int nRnd = GetRandInt(vvNew.size()); int nUBucket = -1; - for (unsigned int n = 0; n < vvNew.size(); n++) - { - int nB = (n+nRnd) % vvNew.size(); - std::set &vNew = vvNew[nB]; - if (vNew.count(nId)) - { + for (unsigned int n = 0; n < vvNew.size(); n++) { + int nB = (n + nRnd) % vvNew.size(); + std::set& vNew = vvNew[nB]; + if (vNew.count(nId)) { nUBucket = nB; break; } @@ -302,7 +292,8 @@ void CAddrMan::Good_(const CService &addr, int64_t nTime) // if no bucket is found, something bad happened; // TODO: maybe re-add the node, but for now, just bail out - if (nUBucket == -1) return; + if (nUBucket == -1) + return; LogPrint("addrman", "Moving %s to tried\n", addr.ToString()); @@ -310,17 +301,16 @@ void CAddrMan::Good_(const CService &addr, int64_t nTime) MakeTried(info, nId, nUBucket); } -bool CAddrMan::Add_(const CAddress &addr, const CNetAddr& source, int64_t nTimePenalty) +bool CAddrMan::Add_(const CAddress& addr, const CNetAddr& source, int64_t nTimePenalty) { if (!addr.IsRoutable()) return false; bool fNew = false; int nId; - CAddrInfo *pinfo = Find(addr, &nId); + CAddrInfo* pinfo = Find(addr, &nId); - if (pinfo) - { + if (pinfo) { // periodically update nTime bool fCurrentlyOnline = (GetAdjustedTime() - addr.nTime < 24 * 60 * 60); int64_t nUpdateInterval = (fCurrentlyOnline ? 60 * 60 : 24 * 60 * 60); @@ -344,7 +334,7 @@ bool CAddrMan::Add_(const CAddress &addr, const CNetAddr& source, int64_t nTimeP // stochastic test: previous nRefCount == N: 2^N times harder to increase it int nFactor = 1; - for (int n=0; nnRefCount; n++) + for (int n = 0; n < pinfo->nRefCount; n++) nFactor *= 2; if (nFactor > 1 && (GetRandInt(nFactor) != 0)) return false; @@ -356,9 +346,8 @@ bool CAddrMan::Add_(const CAddress &addr, const CNetAddr& source, int64_t nTimeP } int nUBucket = pinfo->GetNewBucket(nKey, source); - std::set &vNew = vvNew[nUBucket]; - if (!vNew.count(nId)) - { + std::set& vNew = vvNew[nUBucket]; + if (!vNew.count(nId)) { pinfo->nRefCount++; if (vNew.size() == ADDRMAN_NEW_BUCKET_SIZE) ShrinkNew(nUBucket); @@ -367,15 +356,15 @@ bool CAddrMan::Add_(const CAddress &addr, const CNetAddr& source, int64_t nTimeP return fNew; } -void CAddrMan::Attempt_(const CService &addr, int64_t nTime) +void CAddrMan::Attempt_(const CService& addr, int64_t nTime) { - CAddrInfo *pinfo = Find(addr); + CAddrInfo* pinfo = Find(addr); // if not found, bail out if (!pinfo) return; - CAddrInfo &info = *pinfo; + CAddrInfo& info = *pinfo; // check whether we are talking about the exact same CService (including same port) if (info != addr) @@ -393,37 +382,36 @@ CAddress CAddrMan::Select_(int nUnkBias) double nCorTried = sqrt(nTried) * (100.0 - nUnkBias); double nCorNew = sqrt(nNew) * nUnkBias; - if ((nCorTried + nCorNew)*GetRandInt(1<<30)/(1<<30) < nCorTried) - { + if ((nCorTried + nCorNew) * GetRandInt(1 << 30) / (1 << 30) < nCorTried) { // use a tried node double fChanceFactor = 1.0; - while(1) - { + while (1) { int nKBucket = GetRandInt(vvTried.size()); - std::vector &vTried = vvTried[nKBucket]; - if (vTried.size() == 0) continue; + std::vector& vTried = vvTried[nKBucket]; + if (vTried.size() == 0) + continue; int nPos = GetRandInt(vTried.size()); assert(mapInfo.count(vTried[nPos]) == 1); - CAddrInfo &info = mapInfo[vTried[nPos]]; - if (GetRandInt(1<<30) < fChanceFactor*info.GetChance()*(1<<30)) + CAddrInfo& info = mapInfo[vTried[nPos]]; + if (GetRandInt(1 << 30) < fChanceFactor * info.GetChance() * (1 << 30)) return info; fChanceFactor *= 1.2; } } else { // use a new node double fChanceFactor = 1.0; - while(1) - { + while (1) { int nUBucket = GetRandInt(vvNew.size()); - std::set &vNew = vvNew[nUBucket]; - if (vNew.size() == 0) continue; + std::set& vNew = vvNew[nUBucket]; + if (vNew.size() == 0) + continue; int nPos = GetRandInt(vNew.size()); std::set::iterator it = vNew.begin(); while (nPos--) it++; assert(mapInfo.count(*it) == 1); - CAddrInfo &info = mapInfo[*it]; - if (GetRandInt(1<<30) < fChanceFactor*info.GetChance()*(1<<30)) + CAddrInfo& info = mapInfo[*it]; + if (GetRandInt(1 << 30) < fChanceFactor * info.GetChance() * (1 << 30)) return info; fChanceFactor *= 1.2; } @@ -436,69 +424,76 @@ int CAddrMan::Check_() std::set setTried; std::map mapNew; - if (vRandom.size() != nTried + nNew) return -7; + if (vRandom.size() != nTried + nNew) + return -7; - for (std::map::iterator it = mapInfo.begin(); it != mapInfo.end(); it++) - { + for (std::map::iterator it = mapInfo.begin(); it != mapInfo.end(); it++) { int n = (*it).first; - CAddrInfo &info = (*it).second; - if (info.fInTried) - { - - if (!info.nLastSuccess) return -1; - if (info.nRefCount) return -2; + CAddrInfo& info = (*it).second; + if (info.fInTried) { + if (!info.nLastSuccess) + return -1; + if (info.nRefCount) + return -2; setTried.insert(n); } else { - if (info.nRefCount < 0 || info.nRefCount > ADDRMAN_NEW_BUCKETS_PER_ADDRESS) return -3; - if (!info.nRefCount) return -4; + if (info.nRefCount < 0 || info.nRefCount > ADDRMAN_NEW_BUCKETS_PER_ADDRESS) + return -3; + if (!info.nRefCount) + return -4; mapNew[n] = info.nRefCount; } - if (mapAddr[info] != n) return -5; - if (info.nRandomPos<0 || info.nRandomPos>=vRandom.size() || vRandom[info.nRandomPos] != n) return -14; - if (info.nLastTry < 0) return -6; - if (info.nLastSuccess < 0) return -8; + if (mapAddr[info] != n) + return -5; + if (info.nRandomPos < 0 || info.nRandomPos >= vRandom.size() || vRandom[info.nRandomPos] != n) + return -14; + if (info.nLastTry < 0) + return -6; + if (info.nLastSuccess < 0) + return -8; } - if (setTried.size() != nTried) return -9; - if (mapNew.size() != nNew) return -10; + if (setTried.size() != nTried) + return -9; + if (mapNew.size() != nNew) + return -10; - for (int n=0; n &vTried = vvTried[n]; - for (std::vector::iterator it = vTried.begin(); it != vTried.end(); it++) - { - if (!setTried.count(*it)) return -11; + for (int n = 0; n < vvTried.size(); n++) { + std::vector& vTried = vvTried[n]; + for (std::vector::iterator it = vTried.begin(); it != vTried.end(); it++) { + if (!setTried.count(*it)) + return -11; setTried.erase(*it); } } - for (int n=0; n &vNew = vvNew[n]; - for (std::set::iterator it = vNew.begin(); it != vNew.end(); it++) - { - if (!mapNew.count(*it)) return -12; + for (int n = 0; n < vvNew.size(); n++) { + std::set& vNew = vvNew[n]; + for (std::set::iterator it = vNew.begin(); it != vNew.end(); it++) { + if (!mapNew.count(*it)) + return -12; if (--mapNew[*it] == 0) mapNew.erase(*it); } } - if (setTried.size()) return -13; - if (mapNew.size()) return -15; + if (setTried.size()) + return -13; + if (mapNew.size()) + return -15; return 0; } #endif -void CAddrMan::GetAddr_(std::vector &vAddr) +void CAddrMan::GetAddr_(std::vector& vAddr) { unsigned int nNodes = ADDRMAN_GETADDR_MAX_PCT * vRandom.size() / 100; if (nNodes > ADDRMAN_GETADDR_MAX) nNodes = ADDRMAN_GETADDR_MAX; // gather a list of random nodes, skipping those of low quality - for (unsigned int n = 0; n < vRandom.size(); n++) - { + for (unsigned int n = 0; n < vRandom.size(); n++) { if (vAddr.size() >= nNodes) break; @@ -512,15 +507,15 @@ void CAddrMan::GetAddr_(std::vector &vAddr) } } -void CAddrMan::Connected_(const CService &addr, int64_t nTime) +void CAddrMan::Connected_(const CService& addr, int64_t nTime) { - CAddrInfo *pinfo = Find(addr); + CAddrInfo* pinfo = Find(addr); // if not found, bail out if (!pinfo) return; - CAddrInfo &info = *pinfo; + CAddrInfo& info = *pinfo; // check whether we are talking about the exact same CService (including same port) if (info != addr) diff --git a/src/allocators.cpp b/src/allocators.cpp index 8ecd7206cd..dfe26f1b1e 100644 --- a/src/allocators.cpp +++ b/src/allocators.cpp @@ -37,13 +37,13 @@ static inline size_t GetSystemPageSize() page_size = sSysInfo.dwPageSize; #elif defined(PAGESIZE) // defined in limits.h page_size = PAGESIZE; -#else // assume some POSIX OS +#else // assume some POSIX OS page_size = sysconf(_SC_PAGESIZE); #endif return page_size; } -bool MemoryPageLocker::Lock(const void *addr, size_t len) +bool MemoryPageLocker::Lock(const void* addr, size_t len) { #ifdef WIN32 return VirtualLock(const_cast(addr), len) != 0; @@ -52,7 +52,7 @@ bool MemoryPageLocker::Lock(const void *addr, size_t len) #endif } -bool MemoryPageLocker::Unlock(const void *addr, size_t len) +bool MemoryPageLocker::Unlock(const void* addr, size_t len) { #ifdef WIN32 return VirtualUnlock(const_cast(addr), len) != 0; @@ -64,4 +64,3 @@ bool MemoryPageLocker::Unlock(const void *addr, size_t len) LockedPageManager::LockedPageManager() : LockedPageManagerBase(GetSystemPageSize()) { } - diff --git a/src/allocators.h b/src/allocators.h index 65a7d08987..6b69e7ae69 100644 --- a/src/allocators.h +++ b/src/allocators.h @@ -26,14 +26,14 @@ * small objects that span up to a few pages, mostly smaller than a page. To support large allocations, * something like an interval tree would be the preferred data structure. */ -template class LockedPageManagerBase +template +class LockedPageManagerBase { public: - LockedPageManagerBase(size_t page_size): - page_size(page_size) + LockedPageManagerBase(size_t page_size) : page_size(page_size) { // Determine bitmask for extracting page from address - assert(!(page_size & (page_size-1))); // size must be power of two + assert(!(page_size & (page_size - 1))); // size must be power of two page_mask = ~(page_size - 1); } @@ -44,22 +44,21 @@ public: // For all pages in affected range, increase lock count - void LockRange(void *p, size_t size) + void LockRange(void* p, size_t size) { boost::mutex::scoped_lock lock(mutex); - if(!size) return; + if (!size) + return; const size_t base_addr = reinterpret_cast(p); const size_t start_page = base_addr & page_mask; const size_t end_page = (base_addr + size - 1) & page_mask; - for(size_t page = start_page; page <= end_page; page += page_size) - { + for (size_t page = start_page; page <= end_page; page += page_size) { Histogram::iterator it = histogram.find(page); - if(it == histogram.end()) // Newly locked page + if (it == histogram.end()) // Newly locked page { locker.Lock(reinterpret_cast(page), page_size); histogram.insert(std::make_pair(page, 1)); - } - else // Page was already locked; increase counter + } else // Page was already locked; increase counter { it->second += 1; } @@ -67,20 +66,20 @@ public: } // For all pages in affected range, decrease lock count - void UnlockRange(void *p, size_t size) + void UnlockRange(void* p, size_t size) { boost::mutex::scoped_lock lock(mutex); - if(!size) return; + if (!size) + return; const size_t base_addr = reinterpret_cast(p); const size_t start_page = base_addr & page_mask; const size_t end_page = (base_addr + size - 1) & page_mask; - for(size_t page = start_page; page <= end_page; page += page_size) - { + for (size_t page = start_page; page <= end_page; page += page_size) { Histogram::iterator it = histogram.find(page); assert(it != histogram.end()); // Cannot unlock an area that was not locked // Decrease counter for page, when it is zero, the page will be unlocked it->second -= 1; - if(it->second == 0) // Nothing on the page anymore that keeps it locked + if (it->second == 0) // Nothing on the page anymore that keeps it locked { // Unlock page and remove the count from histogram locker.Unlock(reinterpret_cast(page), page_size); @@ -101,7 +100,7 @@ private: boost::mutex mutex; size_t page_size, page_mask; // map of page base address to lock count - typedef std::map Histogram; + typedef std::map Histogram; Histogram histogram; }; @@ -116,11 +115,11 @@ public: /** Lock memory pages. * addr and len must be a multiple of the system page size */ - bool Lock(const void *addr, size_t len); + bool Lock(const void* addr, size_t len); /** Unlock memory pages. * addr and len must be a multiple of the system page size */ - bool Unlock(const void *addr, size_t len); + bool Unlock(const void* addr, size_t len); }; /** @@ -134,10 +133,10 @@ public: * secure_allocator are created. So instead of having LockedPageManager also be * static-initialized, it is created on demand. */ -class LockedPageManager: public LockedPageManagerBase +class LockedPageManager : public LockedPageManagerBase { public: - static LockedPageManager& Instance() + static LockedPageManager& Instance() { boost::call_once(LockedPageManager::CreateInstance, LockedPageManager::init_flag); return *LockedPageManager::_instance; @@ -165,11 +164,15 @@ private: // Functions for directly locking/unlocking memory objects. // Intended for non-dynamically allocated structures. // -template void LockObject(const T &t) { +template +void LockObject(const T& t) +{ LockedPageManager::Instance().LockRange((void*)(&t), sizeof(T)); } -template void UnlockObject(const T &t) { +template +void UnlockObject(const T& t) +{ OPENSSL_cleanse((void*)(&t), sizeof(T)); LockedPageManager::Instance().UnlockRange((void*)(&t), sizeof(T)); } @@ -178,13 +181,12 @@ template void UnlockObject(const T &t) { // Allocator that locks its contents from being paged // out of memory and clears its contents before deletion. // -template -struct secure_allocator : public std::allocator -{ +template +struct secure_allocator : public std::allocator { // MSVC8 default copy constructor is broken typedef std::allocator base; typedef typename base::size_type size_type; - typedef typename base::difference_type difference_type; + typedef typename base::difference_type difference_type; typedef typename base::pointer pointer; typedef typename base::const_pointer const_pointer; typedef typename base::reference reference; @@ -193,14 +195,18 @@ struct secure_allocator : public std::allocator secure_allocator() throw() {} secure_allocator(const secure_allocator& a) throw() : base(a) {} template - secure_allocator(const secure_allocator& a) throw() : base(a) {} - ~secure_allocator() throw() {} - template struct rebind - { typedef secure_allocator<_Other> other; }; - - T* allocate(std::size_t n, const void *hint = 0) + secure_allocator(const secure_allocator& a) throw() : base(a) { - T *p; + } + ~secure_allocator() throw() {} + template + struct rebind { + typedef secure_allocator<_Other> other; + }; + + T* allocate(std::size_t n, const void* hint = 0) + { + T* p; p = std::allocator::allocate(n, hint); if (p != NULL) LockedPageManager::Instance().LockRange(p, sizeof(T) * n); @@ -209,8 +215,7 @@ struct secure_allocator : public std::allocator void deallocate(T* p, std::size_t n) { - if (p != NULL) - { + if (p != NULL) { OPENSSL_cleanse(p, sizeof(T) * n); LockedPageManager::Instance().UnlockRange(p, sizeof(T) * n); } @@ -222,13 +227,12 @@ struct secure_allocator : public std::allocator // // Allocator that clears its contents before deletion. // -template -struct zero_after_free_allocator : public std::allocator -{ +template +struct zero_after_free_allocator : public std::allocator { // MSVC8 default copy constructor is broken typedef std::allocator base; typedef typename base::size_type size_type; - typedef typename base::difference_type difference_type; + typedef typename base::difference_type difference_type; typedef typename base::pointer pointer; typedef typename base::const_pointer const_pointer; typedef typename base::reference reference; @@ -237,10 +241,14 @@ struct zero_after_free_allocator : public std::allocator zero_after_free_allocator() throw() {} zero_after_free_allocator(const zero_after_free_allocator& a) throw() : base(a) {} template - zero_after_free_allocator(const zero_after_free_allocator& a) throw() : base(a) {} + zero_after_free_allocator(const zero_after_free_allocator& a) throw() : base(a) + { + } ~zero_after_free_allocator() throw() {} - template struct rebind - { typedef zero_after_free_allocator<_Other> other; }; + template + struct rebind { + typedef zero_after_free_allocator<_Other> other; + }; void deallocate(T* p, std::size_t n) { diff --git a/src/base58.cpp b/src/base58.cpp index 76f0404a18..9750f0a161 100644 --- a/src/base58.cpp +++ b/src/base58.cpp @@ -18,7 +18,8 @@ /* All alphanumeric characters except for "0", "I", "O", and "l" */ static const char* pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; -bool DecodeBase58(const char *psz, std::vector& vch) { +bool DecodeBase58(const char* psz, std::vector& vch) +{ // Skip leading spaces. while (*psz && isspace(*psz)) psz++; @@ -33,7 +34,7 @@ bool DecodeBase58(const char *psz, std::vector& vch) { // Process the characters. while (*psz && !isspace(*psz)) { // Decode base58 character - const char *ch = strchr(pszBase58, *psz); + const char* ch = strchr(pszBase58, *psz); if (ch == NULL) return false; // Apply "b256 = b256 * 58 + ch". @@ -59,11 +60,12 @@ bool DecodeBase58(const char *psz, std::vector& vch) { vch.reserve(zeroes + (b256.end() - it)); vch.assign(zeroes, 0x00); while (it != b256.end()) - vch.push_back(*(it++)); + vch.push_back(*(it++)); return true; } -std::string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend) { +std::string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend) +{ // Skip & count leading zeroes. int zeroes = 0; while (pbegin != pend && *pbegin == 0) { @@ -97,15 +99,18 @@ std::string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend) return str; } -std::string EncodeBase58(const std::vector& vch) { +std::string EncodeBase58(const std::vector& vch) +{ return EncodeBase58(&vch[0], &vch[0] + vch.size()); } -bool DecodeBase58(const std::string& str, std::vector& vchRet) { +bool DecodeBase58(const std::string& str, std::vector& vchRet) +{ return DecodeBase58(str.c_str(), vchRet); } -std::string EncodeBase58Check(const std::vector& vchIn) { +std::string EncodeBase58Check(const std::vector& vchIn) +{ // add 4-byte hash check to the end std::vector vch(vchIn); uint256 hash = Hash(vch.begin(), vch.end()); @@ -113,45 +118,49 @@ std::string EncodeBase58Check(const std::vector& vchIn) { return EncodeBase58(vch); } -bool DecodeBase58Check(const char* psz, std::vector& vchRet) { +bool DecodeBase58Check(const char* psz, std::vector& vchRet) +{ if (!DecodeBase58(psz, vchRet) || - (vchRet.size() < 4)) - { + (vchRet.size() < 4)) { vchRet.clear(); return false; } // re-calculate the checksum, insure it matches the included 4-byte checksum - uint256 hash = Hash(vchRet.begin(), vchRet.end()-4); - if (memcmp(&hash, &vchRet.end()[-4], 4) != 0) - { + uint256 hash = Hash(vchRet.begin(), vchRet.end() - 4); + if (memcmp(&hash, &vchRet.end()[-4], 4) != 0) { vchRet.clear(); return false; } - vchRet.resize(vchRet.size()-4); + vchRet.resize(vchRet.size() - 4); return true; } -bool DecodeBase58Check(const std::string& str, std::vector& vchRet) { +bool DecodeBase58Check(const std::string& str, std::vector& vchRet) +{ return DecodeBase58Check(str.c_str(), vchRet); } -CBase58Data::CBase58Data() { +CBase58Data::CBase58Data() +{ vchVersion.clear(); vchData.clear(); } -void CBase58Data::SetData(const std::vector &vchVersionIn, const void* pdata, size_t nSize) { +void CBase58Data::SetData(const std::vector& vchVersionIn, const void* pdata, size_t nSize) +{ vchVersion = vchVersionIn; vchData.resize(nSize); if (!vchData.empty()) memcpy(&vchData[0], pdata, nSize); } -void CBase58Data::SetData(const std::vector &vchVersionIn, const unsigned char *pbegin, const unsigned char *pend) { +void CBase58Data::SetData(const std::vector& vchVersionIn, const unsigned char* pbegin, const unsigned char* pend) +{ SetData(vchVersionIn, (void*)pbegin, pend - pbegin); } -bool CBase58Data::SetString(const char* psz, unsigned int nVersionBytes) { +bool CBase58Data::SetString(const char* psz, unsigned int nVersionBytes) +{ std::vector vchTemp; bool rc58 = DecodeBase58Check(psz, vchTemp); if ((!rc58) || (vchTemp.size() < nVersionBytes)) { @@ -167,65 +176,80 @@ bool CBase58Data::SetString(const char* psz, unsigned int nVersionBytes) { return true; } -bool CBase58Data::SetString(const std::string& str) { +bool CBase58Data::SetString(const std::string& str) +{ return SetString(str.c_str()); } -std::string CBase58Data::ToString() const { +std::string CBase58Data::ToString() const +{ std::vector vch = vchVersion; vch.insert(vch.end(), vchData.begin(), vchData.end()); return EncodeBase58Check(vch); } -int CBase58Data::CompareTo(const CBase58Data& b58) const { - if (vchVersion < b58.vchVersion) return -1; - if (vchVersion > b58.vchVersion) return 1; - if (vchData < b58.vchData) return -1; - if (vchData > b58.vchData) return 1; +int CBase58Data::CompareTo(const CBase58Data& b58) const +{ + if (vchVersion < b58.vchVersion) + return -1; + if (vchVersion > b58.vchVersion) + return 1; + if (vchData < b58.vchData) + return -1; + if (vchData > b58.vchData) + return 1; return 0; } -namespace { +namespace +{ +class CBitcoinAddressVisitor : public boost::static_visitor +{ +private: + CBitcoinAddress* addr; - class CBitcoinAddressVisitor : public boost::static_visitor { - private: - CBitcoinAddress *addr; - public: - CBitcoinAddressVisitor(CBitcoinAddress *addrIn) : addr(addrIn) { } +public: + CBitcoinAddressVisitor(CBitcoinAddress* addrIn) : addr(addrIn) {} - bool operator()(const CKeyID &id) const { return addr->Set(id); } - bool operator()(const CScriptID &id) const { return addr->Set(id); } - bool operator()(const CNoDestination &no) const { return false; } - }; + bool operator()(const CKeyID& id) const { return addr->Set(id); } + bool operator()(const CScriptID& id) const { return addr->Set(id); } + bool operator()(const CNoDestination& no) const { return false; } +}; } // anon namespace -bool CBitcoinAddress::Set(const CKeyID &id) { +bool CBitcoinAddress::Set(const CKeyID& id) +{ SetData(Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS), &id, 20); return true; } -bool CBitcoinAddress::Set(const CScriptID &id) { +bool CBitcoinAddress::Set(const CScriptID& id) +{ SetData(Params().Base58Prefix(CChainParams::SCRIPT_ADDRESS), &id, 20); return true; } -bool CBitcoinAddress::Set(const CTxDestination &dest) { +bool CBitcoinAddress::Set(const CTxDestination& dest) +{ return boost::apply_visitor(CBitcoinAddressVisitor(this), dest); } -bool CBitcoinAddress::IsValid() const { +bool CBitcoinAddress::IsValid() const +{ return IsValid(Params()); } -bool CBitcoinAddress::IsValid(const CChainParams ¶ms) const { +bool CBitcoinAddress::IsValid(const CChainParams& params) const +{ bool fCorrectSize = vchData.size() == 20; bool fKnownVersion = vchVersion == params.Base58Prefix(CChainParams::PUBKEY_ADDRESS) || vchVersion == params.Base58Prefix(CChainParams::SCRIPT_ADDRESS); return fCorrectSize && fKnownVersion; } -CTxDestination CBitcoinAddress::Get() const { +CTxDestination CBitcoinAddress::Get() const +{ if (!IsValid()) return CNoDestination(); uint160 id; @@ -238,7 +262,8 @@ CTxDestination CBitcoinAddress::Get() const { return CNoDestination(); } -bool CBitcoinAddress::GetKeyID(CKeyID &keyID) const { +bool CBitcoinAddress::GetKeyID(CKeyID& keyID) const +{ if (!IsValid() || vchVersion != Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS)) return false; uint160 id; @@ -247,33 +272,39 @@ bool CBitcoinAddress::GetKeyID(CKeyID &keyID) const { return true; } -bool CBitcoinAddress::IsScript() const { +bool CBitcoinAddress::IsScript() const +{ return IsValid() && vchVersion == Params().Base58Prefix(CChainParams::SCRIPT_ADDRESS); } -void CBitcoinSecret::SetKey(const CKey& vchSecret) { +void CBitcoinSecret::SetKey(const CKey& vchSecret) +{ assert(vchSecret.IsValid()); SetData(Params().Base58Prefix(CChainParams::SECRET_KEY), vchSecret.begin(), vchSecret.size()); if (vchSecret.IsCompressed()) vchData.push_back(1); } -CKey CBitcoinSecret::GetKey() { +CKey CBitcoinSecret::GetKey() +{ CKey ret; ret.Set(&vchData[0], &vchData[32], vchData.size() > 32 && vchData[32] == 1); return ret; } -bool CBitcoinSecret::IsValid() const { +bool CBitcoinSecret::IsValid() const +{ bool fExpectedFormat = vchData.size() == 32 || (vchData.size() == 33 && vchData[32] == 1); bool fCorrectVersion = vchVersion == Params().Base58Prefix(CChainParams::SECRET_KEY); return fExpectedFormat && fCorrectVersion; } -bool CBitcoinSecret::SetString(const char* pszSecret) { +bool CBitcoinSecret::SetString(const char* pszSecret) +{ return CBase58Data::SetString(pszSecret) && IsValid(); } -bool CBitcoinSecret::SetString(const std::string& strSecret) { +bool CBitcoinSecret::SetString(const std::string& strSecret) +{ return SetString(strSecret.c_str()); } diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index d1e19871c3..98bb5b855f 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -17,9 +17,11 @@ using namespace boost::assign; // Main network // -class CBaseMainParams : public CBaseChainParams { +class CBaseMainParams : public CBaseChainParams +{ public: - CBaseMainParams() { + CBaseMainParams() + { networkID = CBaseChainParams::MAIN; nRPCPort = 8332; } @@ -29,9 +31,11 @@ static CBaseMainParams mainParams; // // Testnet (v3) // -class CBaseTestNetParams : public CBaseMainParams { +class CBaseTestNetParams : public CBaseMainParams +{ public: - CBaseTestNetParams() { + CBaseTestNetParams() + { networkID = CBaseChainParams::TESTNET; nRPCPort = 18332; strDataDir = "testnet3"; @@ -42,40 +46,45 @@ static CBaseTestNetParams testNetParams; // // Regression test // -class CBaseRegTestParams : public CBaseTestNetParams { +class CBaseRegTestParams : public CBaseTestNetParams +{ public: - CBaseRegTestParams() { + CBaseRegTestParams() + { networkID = CBaseChainParams::REGTEST; strDataDir = "regtest"; } }; static CBaseRegTestParams regTestParams; -static CBaseChainParams *pCurrentBaseParams = 0; +static CBaseChainParams* pCurrentBaseParams = 0; -const CBaseChainParams &BaseParams() { +const CBaseChainParams& BaseParams() +{ assert(pCurrentBaseParams); return *pCurrentBaseParams; } -void SelectBaseParams(CBaseChainParams::Network network) { +void SelectBaseParams(CBaseChainParams::Network network) +{ switch (network) { - case CBaseChainParams::MAIN: - pCurrentBaseParams = &mainParams; - break; - case CBaseChainParams::TESTNET: - pCurrentBaseParams = &testNetParams; - break; - case CBaseChainParams::REGTEST: - pCurrentBaseParams = ®TestParams; - break; - default: - assert(false && "Unimplemented network"); - return; + case CBaseChainParams::MAIN: + pCurrentBaseParams = &mainParams; + break; + case CBaseChainParams::TESTNET: + pCurrentBaseParams = &testNetParams; + break; + case CBaseChainParams::REGTEST: + pCurrentBaseParams = ®TestParams; + break; + default: + assert(false && "Unimplemented network"); + return; } } -bool SelectBaseParamsFromCommandLine() { +bool SelectBaseParamsFromCommandLine() +{ bool fRegTest = GetBoolArg("-regtest", false); bool fTestNet = GetBoolArg("-testnet", false); @@ -93,6 +102,7 @@ bool SelectBaseParamsFromCommandLine() { return true; } -bool AreBaseParamsConfigured() { +bool AreBaseParamsConfigured() +{ return pCurrentBaseParams != NULL; } diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h index 743c8c541a..c054f03f17 100644 --- a/src/chainparamsbase.h +++ b/src/chainparamsbase.h @@ -26,6 +26,7 @@ public: const std::string& DataDir() const { return strDataDir; } int RPCPort() const { return nRPCPort; } Network NetworkID() const { return networkID; } + protected: CBaseChainParams() {} @@ -38,7 +39,7 @@ protected: * Return the currently selected parameters. This won't change after app startup * outside of the unit tests. */ -const CBaseChainParams &BaseParams(); +const CBaseChainParams& BaseParams(); /** Sets the params returned by Params() to those for the given network. */ void SelectBaseParams(CBaseChainParams::Network network); diff --git a/src/checkpoints.h b/src/checkpoints.h index 6d3f2d4935..fca046559a 100644 --- a/src/checkpoints.h +++ b/src/checkpoints.h @@ -13,20 +13,20 @@ class uint256; /** Block-chain checkpoints are compiled-in sanity checks. * They are updated every release or three. */ -namespace Checkpoints { +namespace Checkpoints +{ +// Returns true if block passes checkpoint checks +bool CheckBlock(int nHeight, const uint256& hash); - // Returns true if block passes checkpoint checks - bool CheckBlock(int nHeight, const uint256& hash); +// Return conservative estimate of total number of blocks, 0 if unknown +int GetTotalBlocksEstimate(); - // Return conservative estimate of total number of blocks, 0 if unknown - int GetTotalBlocksEstimate(); +// Returns last CBlockIndex* in mapBlockIndex that is a checkpoint +CBlockIndex* GetLastCheckpoint(); - // Returns last CBlockIndex* in mapBlockIndex that is a checkpoint - CBlockIndex* GetLastCheckpoint(); +double GuessVerificationProgress(CBlockIndex* pindex, bool fSigchecks = true); - double GuessVerificationProgress(CBlockIndex *pindex, bool fSigchecks = true); - - extern bool fEnabled; +extern bool fEnabled; } //namespace Checkpoints diff --git a/src/checkqueue.h b/src/checkqueue.h index c2c7d8ca24..b2a713e646 100644 --- a/src/checkqueue.h +++ b/src/checkqueue.h @@ -13,7 +13,8 @@ #include #include -template class CCheckQueueControl; +template +class CCheckQueueControl; /** Queue for verifications that have to be performed. * The verifications are represented by a type T, which must provide an @@ -24,7 +25,9 @@ template class CCheckQueueControl; * the master is done adding work, it temporarily joins the worker pool * as an N'th worker, until all jobs are done. */ -template class CCheckQueue { +template +class CCheckQueue +{ private: // Mutex to protect the inner state boost::mutex mutex; @@ -60,8 +63,9 @@ private: unsigned int nBatchSize; // Internal function that does bulk of the verification work. - bool Loop(bool fMaster = false) { - boost::condition_variable &cond = fMaster ? condMaster : condWorker; + bool Loop(bool fMaster = false) + { + boost::condition_variable& cond = fMaster ? condMaster : condWorker; std::vector vChecks; vChecks.reserve(nBatchSize); unsigned int nNow = 0; @@ -103,41 +107,43 @@ private: nNow = std::max(1U, std::min(nBatchSize, (unsigned int)queue.size() / (nTotal + nIdle + 1))); vChecks.resize(nNow); for (unsigned int i = 0; i < nNow; i++) { - // We want the lock on the mutex to be as short as possible, so swap jobs from the global - // queue to the local batch vector instead of copying. - vChecks[i].swap(queue.back()); - queue.pop_back(); + // We want the lock on the mutex to be as short as possible, so swap jobs from the global + // queue to the local batch vector instead of copying. + vChecks[i].swap(queue.back()); + queue.pop_back(); } // Check whether we need to do work at all fOk = fAllOk; } // execute work - BOOST_FOREACH(T &check, vChecks) + BOOST_FOREACH (T& check, vChecks) if (fOk) fOk = check(); vChecks.clear(); - } while(true); + } while (true); } public: // Create a new check queue - CCheckQueue(unsigned int nBatchSizeIn) : - nIdle(0), nTotal(0), fAllOk(true), nTodo(0), fQuit(false), nBatchSize(nBatchSizeIn) {} + CCheckQueue(unsigned int nBatchSizeIn) : nIdle(0), nTotal(0), fAllOk(true), nTodo(0), fQuit(false), nBatchSize(nBatchSizeIn) {} // Worker thread - void Thread() { + void Thread() + { Loop(); } // Wait until execution finishes, and return whether all evaluations where succesful. - bool Wait() { + bool Wait() + { return Loop(true); } // Add a batch of checks to the queue - void Add(std::vector &vChecks) { + void Add(std::vector& vChecks) + { boost::unique_lock lock(mutex); - BOOST_FOREACH(T &check, vChecks) { + BOOST_FOREACH (T& check, vChecks) { queue.push_back(T()); check.swap(queue.back()); } @@ -148,7 +154,8 @@ public: condWorker.notify_all(); } - ~CCheckQueue() { + ~CCheckQueue() + { } friend class CCheckQueueControl; @@ -157,13 +164,16 @@ public: /** RAII-style controller object for a CCheckQueue that guarantees the passed * queue is finished before continuing. */ -template class CCheckQueueControl { +template +class CCheckQueueControl +{ private: - CCheckQueue *pqueue; + CCheckQueue* pqueue; bool fDone; public: - CCheckQueueControl(CCheckQueue *pqueueIn) : pqueue(pqueueIn), fDone(false) { + CCheckQueueControl(CCheckQueue* pqueueIn) : pqueue(pqueueIn), fDone(false) + { // passed queue is supposed to be unused, or NULL if (pqueue != NULL) { assert(pqueue->nTotal == pqueue->nIdle); @@ -172,7 +182,8 @@ public: } } - bool Wait() { + bool Wait() + { if (pqueue == NULL) return true; bool fRet = pqueue->Wait(); @@ -180,12 +191,14 @@ public: return fRet; } - void Add(std::vector &vChecks) { + void Add(std::vector& vChecks) + { if (pqueue != NULL) pqueue->Add(vChecks); } - ~CCheckQueueControl() { + ~CCheckQueueControl() + { if (!fDone) Wait(); } diff --git a/src/clientversion.h b/src/clientversion.h index 5634516ca4..cd7ceb78f0 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -13,13 +13,13 @@ // // These need to be macros, as version.cpp's and bitcoin*-res.rc's voodoo requires it -#define CLIENT_VERSION_MAJOR 0 -#define CLIENT_VERSION_MINOR 9 -#define CLIENT_VERSION_REVISION 99 -#define CLIENT_VERSION_BUILD 0 +#define CLIENT_VERSION_MAJOR 0 +#define CLIENT_VERSION_MINOR 9 +#define CLIENT_VERSION_REVISION 99 +#define CLIENT_VERSION_BUILD 0 // Set to true for release, false for prerelease or test build -#define CLIENT_VERSION_IS_RELEASE false +#define CLIENT_VERSION_IS_RELEASE false // Copyright year (2009-this) // Todo: update this when changing our copyright comments in the source @@ -33,6 +33,6 @@ #define DO_STRINGIZE(X) #X // Copyright string used in Windows .rc files -#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers" +#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers" #endif // CLIENTVERSION_H diff --git a/src/coincontrol.h b/src/coincontrol.h index 97c30c2713..033092c019 100644 --- a/src/coincontrol.h +++ b/src/coincontrol.h @@ -57,7 +57,6 @@ public: private: std::set setSelected; - }; #endif // COINCONTROL_H diff --git a/src/db.cpp b/src/db.cpp index 24206d34e1..12650e459f 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -30,7 +30,6 @@ using namespace boost; unsigned int nWalletDBUpdated; - // // CDB // @@ -94,15 +93,15 @@ bool CDBEnv::Open(const boost::filesystem::path& pathIn) dbenv.set_flags(DB_TXN_WRITE_NOSYNC, 1); dbenv.log_set_config(DB_LOG_AUTO_REMOVE, 1); int ret = dbenv.open(path.string().c_str(), - DB_CREATE | - DB_INIT_LOCK | - DB_INIT_LOG | - DB_INIT_MPOOL | - DB_INIT_TXN | - DB_THREAD | - DB_RECOVER | - nEnvFlags, - S_IRUSR | S_IWUSR); + DB_CREATE | + DB_INIT_LOCK | + DB_INIT_LOG | + DB_INIT_MPOOL | + DB_INIT_TXN | + DB_THREAD | + DB_RECOVER | + nEnvFlags, + S_IRUSR | S_IWUSR); if (ret != 0) return error("CDBEnv::Open : Error %d opening database environment: %s\n", ret, DbEnv::strerror(ret)); @@ -121,21 +120,21 @@ void CDBEnv::MakeMock() LogPrint("db", "CDBEnv::MakeMock\n"); dbenv.set_cachesize(1, 0, 1); - dbenv.set_lg_bsize(10485760*4); + dbenv.set_lg_bsize(10485760 * 4); dbenv.set_lg_max(10485760); dbenv.set_lk_max_locks(10000); dbenv.set_lk_max_objects(10000); dbenv.set_flags(DB_AUTO_COMMIT, 1); dbenv.log_set_config(DB_LOG_IN_MEMORY, 1); int ret = dbenv.open(NULL, - DB_CREATE | - DB_INIT_LOCK | - DB_INIT_LOG | - DB_INIT_MPOOL | - DB_INIT_TXN | - DB_THREAD | - DB_PRIVATE, - S_IRUSR | S_IWUSR); + DB_CREATE | + DB_INIT_LOCK | + DB_INIT_LOG | + DB_INIT_MPOOL | + DB_INIT_TXN | + DB_THREAD | + DB_PRIVATE, + S_IRUSR | S_IWUSR); if (ret > 0) throw runtime_error(strprintf("CDBEnv::MakeMock : Error %d opening database environment.", ret)); @@ -160,30 +159,27 @@ CDBEnv::VerifyResult CDBEnv::Verify(std::string strFile, bool (*recoverFunc)(CDB return (fRecovered ? RECOVER_OK : RECOVER_FAIL); } -bool CDBEnv::Salvage(std::string strFile, bool fAggressive, - std::vector& vResult) +bool CDBEnv::Salvage(std::string strFile, bool fAggressive, std::vector& vResult) { LOCK(cs_db); assert(mapFileUseCount.count(strFile) == 0); u_int32_t flags = DB_SALVAGE; - if (fAggressive) flags |= DB_AGGRESSIVE; + if (fAggressive) + flags |= DB_AGGRESSIVE; stringstream strDump; Db db(&dbenv, 0); int result = db.verify(strFile.c_str(), NULL, &strDump, flags); - if (result == DB_VERIFY_BAD) - { + if (result == DB_VERIFY_BAD) { LogPrintf("CDBEnv::Salvage : Database salvage found errors, all data may not be recoverable.\n"); - if (!fAggressive) - { + if (!fAggressive) { LogPrintf("CDBEnv::Salvage : Rerun with aggressive mode to ignore errors and continue.\n"); return false; } } - if (result != 0 && result != DB_VERIFY_BAD) - { + if (result != 0 && result != DB_VERIFY_BAD) { LogPrintf("CDBEnv::Salvage : Database salvage failed with result %d.\n", result); return false; } @@ -201,13 +197,11 @@ bool CDBEnv::Salvage(std::string strFile, bool fAggressive, getline(strDump, strLine); // Skip past header std::string keyHex, valueHex; - while (!strDump.eof() && keyHex != "DATA=END") - { + while (!strDump.eof() && keyHex != "DATA=END") { getline(strDump, keyHex); - if (keyHex != "DATA_END") - { + if (keyHex != "DATA_END") { getline(strDump, valueHex); - vResult.push_back(make_pair(ParseHex(keyHex),ParseHex(valueHex))); + vResult.push_back(make_pair(ParseHex(keyHex), ParseHex(valueHex))); } } @@ -224,8 +218,7 @@ void CDBEnv::CheckpointLSN(const std::string& strFile) } -CDB::CDB(const std::string& strFilename, const char* pszMode) : - pdb(NULL), activeTxn(NULL) +CDB::CDB(const std::string& strFilename, const char* pszMode) : pdb(NULL), activeTxn(NULL) { int ret; fReadOnly = (!strchr(pszMode, '+') && !strchr(pszMode, 'w')); @@ -245,28 +238,25 @@ CDB::CDB(const std::string& strFilename, const char* pszMode) : strFile = strFilename; ++bitdb.mapFileUseCount[strFile]; pdb = bitdb.mapDb[strFile]; - if (pdb == NULL) - { + if (pdb == NULL) { pdb = new Db(&bitdb.dbenv, 0); bool fMockDb = bitdb.IsMock(); - if (fMockDb) - { - DbMpoolFile*mpf = pdb->get_mpf(); + if (fMockDb) { + DbMpoolFile* mpf = pdb->get_mpf(); ret = mpf->set_flags(DB_MPOOL_NOFILE, 1); if (ret != 0) throw runtime_error(strprintf("CDB : Failed to configure for no temp file backing for database %s", strFile)); } - ret = pdb->open(NULL, // Txn pointer - fMockDb ? NULL : strFile.c_str(), // Filename + ret = pdb->open(NULL, // Txn pointer + fMockDb ? NULL : strFile.c_str(), // Filename fMockDb ? strFile.c_str() : "main", // Logical db name - DB_BTREE, // Database type - nFlags, // Flags + DB_BTREE, // Database type + nFlags, // Flags 0); - if (ret != 0) - { + if (ret != 0) { delete pdb; pdb = NULL; --bitdb.mapFileUseCount[strFile]; @@ -274,8 +264,7 @@ CDB::CDB(const std::string& strFilename, const char* pszMode) : throw runtime_error(strprintf("CDB : Error %d, can't open database %s", ret, strFile)); } - if (fCreate && !Exists(string("version"))) - { + if (fCreate && !Exists(string("version"))) { bool fTmp = fReadOnly; fReadOnly = false; WriteVersion(CLIENT_VERSION); @@ -297,7 +286,7 @@ void CDB::Flush() if (fReadOnly) nMinutes = 1; - bitdb.dbenv.txn_checkpoint(nMinutes ? GetArg("-dblogsize", 100)*1024 : 0, nMinutes, 0); + bitdb.dbenv.txn_checkpoint(nMinutes ? GetArg("-dblogsize", 100) * 1024 : 0, nMinutes, 0); } void CDB::Close() @@ -321,8 +310,7 @@ void CDBEnv::CloseDb(const string& strFile) { { LOCK(cs_db); - if (mapDb[strFile] != NULL) - { + if (mapDb[strFile] != NULL) { // Close the database handle Db* pdb = mapDb[strFile]; pdb->close(0); @@ -343,12 +331,10 @@ bool CDBEnv::RemoveDb(const string& strFile) bool CDB::Rewrite(const string& strFile, const char* pszSkip) { - while (true) - { + while (true) { { LOCK(bitdb.cs_db); - if (!bitdb.mapFileUseCount.count(strFile) || bitdb.mapFileUseCount[strFile] == 0) - { + if (!bitdb.mapFileUseCount.count(strFile) || bitdb.mapFileUseCount[strFile] == 0) { // Flush log data to the dat file bitdb.CloseDb(strFile); bitdb.CheckpointLSN(strFile); @@ -361,32 +347,27 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip) CDB db(strFile.c_str(), "r"); Db* pdbCopy = new Db(&bitdb.dbenv, 0); - int ret = pdbCopy->open(NULL, // Txn pointer - strFileRes.c_str(), // Filename - "main", // Logical db name - DB_BTREE, // Database type - DB_CREATE, // Flags + int ret = pdbCopy->open(NULL, // Txn pointer + strFileRes.c_str(), // Filename + "main", // Logical db name + DB_BTREE, // Database type + DB_CREATE, // Flags 0); - if (ret > 0) - { + if (ret > 0) { LogPrintf("CDB::Rewrite : Can't create database file %s\n", strFileRes); fSuccess = false; } Dbc* pcursor = db.GetCursor(); if (pcursor) - while (fSuccess) - { + while (fSuccess) { CDataStream ssKey(SER_DISK, CLIENT_VERSION); CDataStream ssValue(SER_DISK, CLIENT_VERSION); int ret = db.ReadAtCursor(pcursor, ssKey, ssValue, DB_NEXT); - if (ret == DB_NOTFOUND) - { + if (ret == DB_NOTFOUND) { pcursor->close(); break; - } - else if (ret != 0) - { + } else if (ret != 0) { pcursor->close(); fSuccess = false; break; @@ -394,8 +375,7 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip) if (pszSkip && strncmp(&ssKey[0], pszSkip, std::min(ssKey.size(), strlen(pszSkip))) == 0) continue; - if (strncmp(&ssKey[0], "\x07version", 8) == 0) - { + if (strncmp(&ssKey[0], "\x07version", 8) == 0) { // Update version: ssValue.clear(); ssValue << CLIENT_VERSION; @@ -406,8 +386,7 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip) if (ret2 > 0) fSuccess = false; } - if (fSuccess) - { + if (fSuccess) { db.Close(); bitdb.CloseDb(strFile); if (pdbCopy->close(0)) @@ -415,8 +394,7 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip) delete pdbCopy; } } - if (fSuccess) - { + if (fSuccess) { Db dbA(&bitdb.dbenv, 0); if (dbA.remove(strFile.c_str(), NULL, 0)) fSuccess = false; @@ -445,13 +423,11 @@ void CDBEnv::Flush(bool fShutdown) { LOCK(cs_db); map::iterator mi = mapFileUseCount.begin(); - while (mi != mapFileUseCount.end()) - { + while (mi != mapFileUseCount.end()) { string strFile = (*mi).first; int nRefCount = (*mi).second; LogPrint("db", "CDBEnv::Flush : Flushing %s (refcount = %d)...\n", strFile, nRefCount); - if (nRefCount == 0) - { + if (nRefCount == 0) { // Move log data to the dat file CloseDb(strFile); LogPrint("db", "CDBEnv::Flush : %s checkpoint\n", strFile); @@ -461,16 +437,13 @@ void CDBEnv::Flush(bool fShutdown) dbenv.lsn_reset(strFile.c_str(), 0); LogPrint("db", "CDBEnv::Flush : %s closed\n", strFile); mapFileUseCount.erase(mi++); - } - else + } else mi++; } LogPrint("db", "CDBEnv::Flush : Flush(%s)%s took %15dms\n", fShutdown ? "true" : "false", fDbEnvInit ? "" : " database not started", GetTimeMillis() - nStart); - if (fShutdown) - { + if (fShutdown) { char** listp; - if (mapFileUseCount.empty()) - { + if (mapFileUseCount.empty()) { dbenv.log_archive(&listp, DB_ARCH_REMOVE); Close(); if (!fMockDb) @@ -479,4 +452,3 @@ void CDBEnv::Flush(bool fShutdown) } } } - diff --git a/src/db.h b/src/db.h index eab27f43af..d202399383 100644 --- a/src/db.h +++ b/src/db.h @@ -54,7 +54,9 @@ public: * This must be called BEFORE strFile is opened. * Returns true if strFile is OK. */ - enum VerifyResult { VERIFY_OK, RECOVER_OK, RECOVER_FAIL }; + enum VerifyResult { VERIFY_OK, + RECOVER_OK, + RECOVER_FAIL }; VerifyResult Verify(std::string strFile, bool (*recoverFunc)(CDBEnv& dbenv, std::string strFile)); /* * Salvage data from a file that Verify says is bad. @@ -66,7 +68,7 @@ public: typedef std::pair, std::vector > KeyValPair; bool Salvage(std::string strFile, bool fAggressive, std::vector& vResult); - bool Open(const boost::filesystem::path &path); + bool Open(const boost::filesystem::path& path); void Close(); void Flush(bool fShutdown); void CheckpointLSN(const std::string& strFile); @@ -74,7 +76,7 @@ public: void CloseDb(const std::string& strFile); bool RemoveDb(const std::string& strFile); - DbTxn *TxnBegin(int flags=DB_TXN_WRITE_NOSYNC) + DbTxn* TxnBegin(int flags = DB_TXN_WRITE_NOSYNC) { DbTxn* ptxn = NULL; int ret = dbenv.txn_begin(NULL, &ptxn, flags); @@ -93,10 +95,10 @@ class CDB protected: Db* pdb; std::string strFile; - DbTxn *activeTxn; + DbTxn* activeTxn; bool fReadOnly; - explicit CDB(const std::string& strFilename, const char* pszMode="r+"); + explicit CDB(const std::string& strFilename, const char* pszMode = "r+"); ~CDB() { Close(); } public: @@ -108,7 +110,7 @@ private: void operator=(const CDB&); protected: - template + template bool Read(const K& key, T& value) { if (!pdb) @@ -132,8 +134,7 @@ protected: try { CDataStream ssValue((char*)datValue.get_data(), (char*)datValue.get_data() + datValue.get_size(), SER_DISK, CLIENT_VERSION); ssValue >> value; - } - catch (const std::exception &) { + } catch (const std::exception&) { return false; } @@ -143,8 +144,8 @@ protected: return (ret == 0); } - template - bool Write(const K& key, const T& value, bool fOverwrite=true) + template + bool Write(const K& key, const T& value, bool fOverwrite = true) { if (!pdb) return false; @@ -172,7 +173,7 @@ protected: return (ret == 0); } - template + template bool Erase(const K& key) { if (!pdb) @@ -194,7 +195,7 @@ protected: return (ret == 0 || ret == DB_NOTFOUND); } - template + template bool Exists(const K& key) { if (!pdb) @@ -225,18 +226,16 @@ protected: return pcursor; } - int ReadAtCursor(Dbc* pcursor, CDataStream& ssKey, CDataStream& ssValue, unsigned int fFlags=DB_NEXT) + int ReadAtCursor(Dbc* pcursor, CDataStream& ssKey, CDataStream& ssValue, unsigned int fFlags = DB_NEXT) { // Read at cursor Dbt datKey; - if (fFlags == DB_SET || fFlags == DB_SET_RANGE || fFlags == DB_GET_BOTH || fFlags == DB_GET_BOTH_RANGE) - { + if (fFlags == DB_SET || fFlags == DB_SET_RANGE || fFlags == DB_GET_BOTH || fFlags == DB_GET_BOTH_RANGE) { datKey.set_data(&ssKey[0]); datKey.set_size(ssKey.size()); } Dbt datValue; - if (fFlags == DB_GET_BOTH || fFlags == DB_GET_BOTH_RANGE) - { + if (fFlags == DB_GET_BOTH || fFlags == DB_GET_BOTH_RANGE) { datValue.set_data(&ssValue[0]); datValue.set_size(ssValue.size()); } diff --git a/src/hash.cpp b/src/hash.cpp index bddd8abf38..4ce4da4c30 100644 --- a/src/hash.cpp +++ b/src/hash.cpp @@ -1,6 +1,6 @@ #include "hash.h" -inline uint32_t ROTL32 ( uint32_t x, int8_t r ) +inline uint32_t ROTL32(uint32_t x, int8_t r) { return (x << r) | (x >> (32 - r)); } @@ -16,33 +16,37 @@ unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector - void Set(const T pbegin, const T pend) { + template + void Set(const T pbegin, const T pend) + { int len = pend == pbegin ? 0 : GetLen(pbegin[0]); - if (len && len == (pend-pbegin)) + if (len && len == (pend - pbegin)) memcpy(vch, (unsigned char*)&pbegin[0], len); else Invalidate(); } // Construct a public key using begin/end iterators to byte data. - template - CPubKey(const T pbegin, const T pend) { + template + CPubKey(const T pbegin, const T pend) + { Set(pbegin, pend); } // Construct a public key from a byte vector. - CPubKey(const std::vector &vch) { + CPubKey(const std::vector& vch) + { Set(vch.begin(), vch.end()); } // Simple read-only vector-like interface to the pubkey data. unsigned int size() const { return GetLen(vch[0]); } - const unsigned char *begin() const { return vch; } - const unsigned char *end() const { return vch+size(); } - const unsigned char &operator[](unsigned int pos) const { return vch[pos]; } + const unsigned char* begin() const { return vch; } + const unsigned char* end() const { return vch + size(); } + const unsigned char& operator[](unsigned int pos) const { return vch[pos]; } // Comparator implementation. - friend bool operator==(const CPubKey &a, const CPubKey &b) { + friend bool operator==(const CPubKey& a, const CPubKey& b) + { return a.vch[0] == b.vch[0] && memcmp(a.vch, b.vch, a.size()) == 0; } - friend bool operator!=(const CPubKey &a, const CPubKey &b) { + friend bool operator!=(const CPubKey& a, const CPubKey& b) + { return !(a == b); } - friend bool operator<(const CPubKey &a, const CPubKey &b) { + friend bool operator<(const CPubKey& a, const CPubKey& b) + { return a.vch[0] < b.vch[0] || (a.vch[0] == b.vch[0] && memcmp(a.vch, b.vch, a.size()) < 0); } // Implement serialization, as if this was a byte vector. - unsigned int GetSerializeSize(int nType, int nVersion) const { + unsigned int GetSerializeSize(int nType, int nVersion) const + { return size() + 1; } - template void Serialize(Stream &s, int nType, int nVersion) const { + template + void Serialize(Stream& s, int nType, int nVersion) const + { unsigned int len = size(); ::WriteCompactSize(s, len); s.write((char*)vch, len); } - template void Unserialize(Stream &s, int nType, int nVersion) { + template + void Unserialize(Stream& s, int nType, int nVersion) + { unsigned int len = ::ReadCompactSize(s); if (len <= 65) { s.read((char*)vch, len); @@ -128,19 +143,22 @@ public: } // Get the KeyID of this public key (hash of its serialization) - CKeyID GetID() const { - return CKeyID(Hash160(vch, vch+size())); + CKeyID GetID() const + { + return CKeyID(Hash160(vch, vch + size())); } // Get the 256-bit hash of this public key. - uint256 GetHash() const { - return Hash(vch, vch+size()); + uint256 GetHash() const + { + return Hash(vch, vch + size()); } // Check syntactic correctness. // // Note that this is consensus critical as CheckSig() calls it! - bool IsValid() const { + bool IsValid() const + { return size() > 0; } @@ -148,16 +166,17 @@ public: bool IsFullyValid() const; // Check whether this is a compressed public key. - bool IsCompressed() const { + bool IsCompressed() const + { return size() == 33; } // Verify a DER signature (~72 bytes). // If this public key is not fully valid, the return value will be false. - bool Verify(const uint256 &hash, const std::vector& vchSig) const; + bool Verify(const uint256& hash, const std::vector& vchSig) const; // Recover a public key from a compact signature. - bool RecoverCompact(const uint256 &hash, const std::vector& vchSig); + bool RecoverCompact(const uint256& hash, const std::vector& vchSig); // Turn this public key into an uncompressed public key. bool Decompress(); @@ -172,7 +191,8 @@ public: typedef std::vector > CPrivKey; /** An encapsulated private key. */ -class CKey { +class CKey +{ private: // Whether this private key is valid. We check for correctness when modifying the key // data, so fValid should always correspond to the actual state. @@ -185,33 +205,38 @@ private: unsigned char vch[32]; // Check whether the 32-byte array pointed to be vch is valid keydata. - bool static Check(const unsigned char *vch); -public: + bool static Check(const unsigned char* vch); +public: // Construct an invalid private key. - CKey() : fValid(false), fCompressed(false) { + CKey() : fValid(false), fCompressed(false) + { LockObject(vch); } // Copy constructor. This is necessary because of memlocking. - CKey(const CKey &secret) : fValid(secret.fValid), fCompressed(secret.fCompressed) { + CKey(const CKey& secret) : fValid(secret.fValid), fCompressed(secret.fCompressed) + { LockObject(vch); memcpy(vch, secret.vch, sizeof(vch)); } // Destructor (again necessary because of memlocking). - ~CKey() { + ~CKey() + { UnlockObject(vch); } - friend bool operator==(const CKey &a, const CKey &b) { + friend bool operator==(const CKey& a, const CKey& b) + { return a.fCompressed == b.fCompressed && a.size() == b.size() && memcmp(&a.vch[0], &b.vch[0], a.size()) == 0; } // Initialize using begin and end iterators to byte data. - template - void Set(const T pbegin, const T pend, bool fCompressedIn) { + template + void Set(const T pbegin, const T pend, bool fCompressedIn) + { if (pend - pbegin != 32) { fValid = false; return; @@ -227,8 +252,8 @@ public: // Simple read-only vector-like interface. unsigned int size() const { return (fValid ? 32 : 0); } - const unsigned char *begin() const { return vch; } - const unsigned char *end() const { return vch + size(); } + const unsigned char* begin() const { return vch; } + const unsigned char* end() const { return vch + size(); } // Check whether this private key is valid. bool IsValid() const { return fValid; } @@ -237,7 +262,7 @@ public: bool IsCompressed() const { return fCompressed; } // Initialize from a CPrivKey (serialized OpenSSL private key data). - bool SetPrivKey(const CPrivKey &vchPrivKey, bool fCompressed); + bool SetPrivKey(const CPrivKey& vchPrivKey, bool fCompressed); // Generate a new private key using a cryptographic PRNG. void MakeNewKey(bool fCompressed); @@ -251,23 +276,23 @@ public: CPubKey GetPubKey() const; // Create a DER-serialized signature. - bool Sign(const uint256 &hash, std::vector& vchSig) const; + bool Sign(const uint256& hash, std::vector& vchSig) const; // Create a compact signature (65 bytes), which allows reconstructing the used public key. // The format is one header byte, followed by two times 32 bytes for the serialized r and s values. // The header byte: 0x1B = first key with even y, 0x1C = first key with odd y, // 0x1D = second key with even y, 0x1E = second key with odd y, // add 0x04 for compressed keys. - bool SignCompact(const uint256 &hash, std::vector& vchSig) const; + bool SignCompact(const uint256& hash, std::vector& vchSig) const; // Derive BIP32 child key. bool Derive(CKey& keyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const; // Load private key and check that public key matches. - bool Load(CPrivKey &privkey, CPubKey &vchPubKey, bool fSkipCheck); + bool Load(CPrivKey& privkey, CPubKey& vchPubKey, bool fSkipCheck); // Check whether an element of a signature (r or s) is valid. - static bool CheckSignatureElement(const unsigned char *vch, int len, bool half); + static bool CheckSignatureElement(const unsigned char* vch, int len, bool half); }; struct CExtPubKey { @@ -277,14 +302,15 @@ struct CExtPubKey { unsigned char vchChainCode[32]; CPubKey pubkey; - friend bool operator==(const CExtPubKey &a, const CExtPubKey &b) { + friend bool operator==(const CExtPubKey& a, const CExtPubKey& b) + { return a.nDepth == b.nDepth && memcmp(&a.vchFingerprint[0], &b.vchFingerprint[0], 4) == 0 && a.nChild == b.nChild && memcmp(&a.vchChainCode[0], &b.vchChainCode[0], 32) == 0 && a.pubkey == b.pubkey; } void Encode(unsigned char code[74]) const; void Decode(const unsigned char code[74]); - bool Derive(CExtPubKey &out, unsigned int nChild) const; + bool Derive(CExtPubKey& out, unsigned int nChild) const; }; struct CExtKey { @@ -294,16 +320,17 @@ struct CExtKey { unsigned char vchChainCode[32]; CKey key; - friend bool operator==(const CExtKey &a, const CExtKey &b) { + friend bool operator==(const CExtKey& a, const CExtKey& b) + { return a.nDepth == b.nDepth && memcmp(&a.vchFingerprint[0], &b.vchFingerprint[0], 4) == 0 && a.nChild == b.nChild && memcmp(&a.vchChainCode[0], &b.vchChainCode[0], 32) == 0 && a.key == b.key; } void Encode(unsigned char code[74]) const; void Decode(const unsigned char code[74]); - bool Derive(CExtKey &out, unsigned int nChild) const; + bool Derive(CExtKey& out, unsigned int nChild) const; CExtPubKey Neuter() const; - void SetMaster(const unsigned char *seed, unsigned int nSeedLen); + void SetMaster(const unsigned char* seed, unsigned int nSeedLen); }; /** Check that required EC support is available at runtime */ diff --git a/src/leveldbwrapper.cpp b/src/leveldbwrapper.cpp index 9e849696a8..8ce3e7b470 100644 --- a/src/leveldbwrapper.cpp +++ b/src/leveldbwrapper.cpp @@ -12,7 +12,8 @@ #include #include -void HandleError(const leveldb::Status &status) throw(leveldb_error) { +void HandleError(const leveldb::Status& status) throw(leveldb_error) +{ if (status.ok()) return; LogPrintf("%s\n", status.ToString()); @@ -25,7 +26,8 @@ void HandleError(const leveldb::Status &status) throw(leveldb_error) { throw leveldb_error("Unknown database error"); } -static leveldb::Options GetOptions(size_t nCacheSize) { +static leveldb::Options GetOptions(size_t nCacheSize) +{ leveldb::Options options; options.block_cache = leveldb::NewLRUCache(nCacheSize / 2); options.write_buffer_size = nCacheSize / 4; // up to two write buffers may be held in memory simultaneously @@ -40,7 +42,8 @@ static leveldb::Options GetOptions(size_t nCacheSize) { return options; } -CLevelDBWrapper::CLevelDBWrapper(const boost::filesystem::path &path, size_t nCacheSize, bool fMemory, bool fWipe) { +CLevelDBWrapper::CLevelDBWrapper(const boost::filesystem::path& path, size_t nCacheSize, bool fMemory, bool fWipe) +{ penv = NULL; readoptions.verify_checksums = true; iteroptions.verify_checksums = true; @@ -64,7 +67,8 @@ CLevelDBWrapper::CLevelDBWrapper(const boost::filesystem::path &path, size_t nCa LogPrintf("Opened LevelDB successfully\n"); } -CLevelDBWrapper::~CLevelDBWrapper() { +CLevelDBWrapper::~CLevelDBWrapper() +{ delete pdb; pdb = NULL; delete options.filter_policy; @@ -75,7 +79,8 @@ CLevelDBWrapper::~CLevelDBWrapper() { options.env = NULL; } -bool CLevelDBWrapper::WriteBatch(CLevelDBBatch &batch, bool fSync) throw(leveldb_error) { +bool CLevelDBWrapper::WriteBatch(CLevelDBBatch& batch, bool fSync) throw(leveldb_error) +{ leveldb::Status status = pdb->Write(fSync ? syncoptions : writeoptions, &batch.batch); HandleError(status); return true; diff --git a/src/leveldbwrapper.h b/src/leveldbwrapper.h index 29bc71f99d..da5ba61c7b 100644 --- a/src/leveldbwrapper.h +++ b/src/leveldbwrapper.h @@ -17,10 +17,10 @@ class leveldb_error : public std::runtime_error { public: - leveldb_error(const std::string &msg) : std::runtime_error(msg) {} + leveldb_error(const std::string& msg) : std::runtime_error(msg) {} }; -void HandleError(const leveldb::Status &status) throw(leveldb_error); +void HandleError(const leveldb::Status& status) throw(leveldb_error); // Batch of changes queued to be written to a CLevelDBWrapper class CLevelDBBatch @@ -31,7 +31,9 @@ private: leveldb::WriteBatch batch; public: - template void Write(const K& key, const V& value) { + template + void Write(const K& key, const V& value) + { CDataStream ssKey(SER_DISK, CLIENT_VERSION); ssKey.reserve(ssKey.GetSerializeSize(key)); ssKey << key; @@ -45,7 +47,9 @@ public: batch.Put(slKey, slValue); } - template void Erase(const K& key) { + template + void Erase(const K& key) + { CDataStream ssKey(SER_DISK, CLIENT_VERSION); ssKey.reserve(ssKey.GetSerializeSize(key)); ssKey << key; @@ -59,7 +63,7 @@ class CLevelDBWrapper { private: // custom environment this database is using (may be NULL in case of default environment) - leveldb::Env *penv; + leveldb::Env* penv; // database options used leveldb::Options options; @@ -77,13 +81,15 @@ private: leveldb::WriteOptions syncoptions; // the database itself - leveldb::DB *pdb; + leveldb::DB* pdb; public: - CLevelDBWrapper(const boost::filesystem::path &path, size_t nCacheSize, bool fMemory = false, bool fWipe = false); + CLevelDBWrapper(const boost::filesystem::path& path, size_t nCacheSize, bool fMemory = false, bool fWipe = false); ~CLevelDBWrapper(); - template bool Read(const K& key, V& value) const throw(leveldb_error) { + template + bool Read(const K& key, V& value) const throw(leveldb_error) + { CDataStream ssKey(SER_DISK, CLIENT_VERSION); ssKey.reserve(ssKey.GetSerializeSize(key)); ssKey << key; @@ -100,19 +106,23 @@ public: try { CDataStream ssValue(strValue.data(), strValue.data() + strValue.size(), SER_DISK, CLIENT_VERSION); ssValue >> value; - } catch(const std::exception &) { + } catch (const std::exception&) { return false; } return true; } - template bool Write(const K& key, const V& value, bool fSync = false) throw(leveldb_error) { + template + bool Write(const K& key, const V& value, bool fSync = false) throw(leveldb_error) + { CLevelDBBatch batch; batch.Write(key, value); return WriteBatch(batch, fSync); } - template bool Exists(const K& key) const throw(leveldb_error) { + template + bool Exists(const K& key) const throw(leveldb_error) + { CDataStream ssKey(SER_DISK, CLIENT_VERSION); ssKey.reserve(ssKey.GetSerializeSize(key)); ssKey << key; @@ -129,26 +139,31 @@ public: return true; } - template bool Erase(const K& key, bool fSync = false) throw(leveldb_error) { + template + bool Erase(const K& key, bool fSync = false) throw(leveldb_error) + { CLevelDBBatch batch; batch.Erase(key); return WriteBatch(batch, fSync); } - bool WriteBatch(CLevelDBBatch &batch, bool fSync = false) throw(leveldb_error); + bool WriteBatch(CLevelDBBatch& batch, bool fSync = false) throw(leveldb_error); // not available for LevelDB; provide for compatibility with BDB - bool Flush() { + bool Flush() + { return true; } - bool Sync() throw(leveldb_error) { + bool Sync() throw(leveldb_error) + { CLevelDBBatch batch; return WriteBatch(batch, true); } // not exactly clean encapsulation, but it's easiest for now - leveldb::Iterator *NewIterator() { + leveldb::Iterator* NewIterator() + { return pdb->NewIterator(iteroptions); } }; diff --git a/src/limitedmap.h b/src/limitedmap.h index 58593688af..4bc8d9e5aa 100644 --- a/src/limitedmap.h +++ b/src/limitedmap.h @@ -9,7 +9,8 @@ #include /** STL-like map container that only keeps the N elements with the highest value. */ -template class limitedmap +template +class limitedmap { public: typedef K key_type; @@ -36,10 +37,8 @@ public: void insert(const value_type& x) { std::pair ret = map.insert(x); - if (ret.second) - { - if (nMaxSize && map.size() == nMaxSize) - { + if (ret.second) { + if (nMaxSize && map.size() == nMaxSize) { map.erase(rmap.begin()->second); rmap.erase(rmap.begin()); } @@ -54,8 +53,7 @@ public: return; std::pair itPair = rmap.equal_range(itTarget->second); for (rmap_iterator it = itPair.first; it != itPair.second; ++it) - if (it->second == itTarget) - { + if (it->second == itTarget) { rmap.erase(it); map.erase(itTarget); return; @@ -72,8 +70,7 @@ public: return; std::pair itPair = rmap.equal_range(itTarget->second); for (rmap_iterator it = itPair.first; it != itPair.second; ++it) - if (it->second == itTarget) - { + if (it->second == itTarget) { rmap.erase(it); itTarget->second = v; rmap.insert(make_pair(v, itTarget)); @@ -88,8 +85,7 @@ public: size_type max_size(size_type s) { if (s) - while (map.size() > s) - { + while (map.size() > s) { map.erase(rmap.begin()->second); rmap.erase(rmap.begin()); } diff --git a/src/mruset.h b/src/mruset.h index b9f325d874..1691875f57 100644 --- a/src/mruset.h +++ b/src/mruset.h @@ -10,7 +10,8 @@ #include /** STL-like set container that only keeps the most recent N elements. */ -template class mruset +template +class mruset { public: typedef T key_type; @@ -32,17 +33,19 @@ public: bool empty() const { return set.empty(); } iterator find(const key_type& k) const { return set.find(k); } size_type count(const key_type& k) const { return set.count(k); } - void clear() { set.clear(); queue.clear(); } + void clear() + { + set.clear(); + queue.clear(); + } bool inline friend operator==(const mruset& a, const mruset& b) { return a.set == b.set; } bool inline friend operator==(const mruset& a, const std::set& b) { return a.set == b; } bool inline friend operator<(const mruset& a, const mruset& b) { return a.set < b.set; } std::pair insert(const key_type& x) { std::pair ret = set.insert(x); - if (ret.second) - { - if (nMaxSize && queue.size() == nMaxSize) - { + if (ret.second) { + if (nMaxSize && queue.size() == nMaxSize) { set.erase(queue.front()); queue.pop_front(); } @@ -54,8 +57,7 @@ public: size_type max_size(size_type s) { if (s) - while (queue.size() > s) - { + while (queue.size() > s) { set.erase(queue.front()); queue.pop_front(); } diff --git a/src/noui.cpp b/src/noui.cpp index 8b00fd4057..f786a20db5 100644 --- a/src/noui.cpp +++ b/src/noui.cpp @@ -35,7 +35,7 @@ static bool noui_ThreadSafeMessageBox(const std::string& message, const std::str return false; } -static void noui_InitMessage(const std::string &message) +static void noui_InitMessage(const std::string& message) { LogPrintf("init message: %s\n", message); } diff --git a/src/protocol.h b/src/protocol.h index 82d29e66de..b73041a9fd 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -4,7 +4,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef __cplusplus -# error This header can only be compiled as C++. +#error This header can only be compiled as C++. #endif #ifndef __INCLUDED_PROTOCOL_H__ @@ -28,43 +28,43 @@ */ class CMessageHeader { - public: - CMessageHeader(); - CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn); +public: + CMessageHeader(); + CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn); - std::string GetCommand() const; - bool IsValid() const; + std::string GetCommand() const; + bool IsValid() const; - ADD_SERIALIZE_METHODS; + ADD_SERIALIZE_METHODS; - template - inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - READWRITE(FLATDATA(pchMessageStart)); - READWRITE(FLATDATA(pchCommand)); - READWRITE(nMessageSize); - READWRITE(nChecksum); - } + template + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) + { + READWRITE(FLATDATA(pchMessageStart)); + READWRITE(FLATDATA(pchCommand)); + READWRITE(nMessageSize); + READWRITE(nChecksum); + } // TODO: make private (improves encapsulation) - public: - enum { - COMMAND_SIZE=12, - MESSAGE_SIZE_SIZE=sizeof(int), - CHECKSUM_SIZE=sizeof(int), +public: + enum { + COMMAND_SIZE = 12, + MESSAGE_SIZE_SIZE = sizeof(int), + CHECKSUM_SIZE = sizeof(int), - MESSAGE_SIZE_OFFSET=MESSAGE_START_SIZE+COMMAND_SIZE, - CHECKSUM_OFFSET=MESSAGE_SIZE_OFFSET+MESSAGE_SIZE_SIZE, - HEADER_SIZE=MESSAGE_START_SIZE+COMMAND_SIZE+MESSAGE_SIZE_SIZE+CHECKSUM_SIZE - }; - char pchMessageStart[MESSAGE_START_SIZE]; - char pchCommand[COMMAND_SIZE]; - unsigned int nMessageSize; - unsigned int nChecksum; + MESSAGE_SIZE_OFFSET = MESSAGE_START_SIZE + COMMAND_SIZE, + CHECKSUM_OFFSET = MESSAGE_SIZE_OFFSET + MESSAGE_SIZE_SIZE, + HEADER_SIZE = MESSAGE_START_SIZE + COMMAND_SIZE + MESSAGE_SIZE_SIZE + CHECKSUM_SIZE + }; + char pchMessageStart[MESSAGE_START_SIZE]; + char pchCommand[COMMAND_SIZE]; + unsigned int nMessageSize; + unsigned int nChecksum; }; /** nServices flags */ -enum -{ +enum { NODE_NETWORK = (1 << 0), // Bits 24-31 are reserved for temporary experiments. Just pick a bit that @@ -79,68 +79,69 @@ enum /** A CService with information about it as peer */ class CAddress : public CService { - public: - CAddress(); - explicit CAddress(CService ipIn, uint64_t nServicesIn=NODE_NETWORK); +public: + CAddress(); + explicit CAddress(CService ipIn, uint64_t nServicesIn = NODE_NETWORK); - void Init(); + void Init(); - ADD_SERIALIZE_METHODS; + ADD_SERIALIZE_METHODS; - template - inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - if (ser_action.ForRead()) - Init(); - if (nType & SER_DISK) - READWRITE(nVersion); - if ((nType & SER_DISK) || - (nVersion >= CADDR_TIME_VERSION && !(nType & SER_GETHASH))) - READWRITE(nTime); - READWRITE(nServices); - READWRITE(*(CService*)this); - } + template + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) + { + if (ser_action.ForRead()) + Init(); + if (nType & SER_DISK) + READWRITE(nVersion); + if ((nType & SER_DISK) || + (nVersion >= CADDR_TIME_VERSION && !(nType & SER_GETHASH))) + READWRITE(nTime); + READWRITE(nServices); + READWRITE(*(CService*)this); + } // TODO: make private (improves encapsulation) - public: - uint64_t nServices; +public: + uint64_t nServices; - // disk and network only - unsigned int nTime; + // disk and network only + unsigned int nTime; - // memory only - int64_t nLastTry; + // memory only + int64_t nLastTry; }; /** inv message data */ class CInv { - public: - CInv(); - CInv(int typeIn, const uint256& hashIn); - CInv(const std::string& strType, const uint256& hashIn); +public: + CInv(); + CInv(int typeIn, const uint256& hashIn); + CInv(const std::string& strType, const uint256& hashIn); - ADD_SERIALIZE_METHODS; + ADD_SERIALIZE_METHODS; - template - inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - READWRITE(type); - READWRITE(hash); - } + template + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) + { + READWRITE(type); + READWRITE(hash); + } - friend bool operator<(const CInv& a, const CInv& b); + friend bool operator<(const CInv& a, const CInv& b); - bool IsKnownType() const; - const char* GetCommand() const; - std::string ToString() const; + bool IsKnownType() const; + const char* GetCommand() const; + std::string ToString() const; // TODO: make private (improves encapsulation) - public: - int type; - uint256 hash; +public: + int type; + uint256 hash; }; -enum -{ +enum { MSG_TX = 1, MSG_BLOCK, // Nodes may always request a MSG_FILTERED_BLOCK in a getdata, however, diff --git a/src/random.cpp b/src/random.cpp index fb5258a442..998e7dfb08 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -8,8 +8,8 @@ #ifdef WIN32 #include "compat.h" // for Windows API #endif -#include "serialize.h" // for begin_ptr(vec) -#include "util.h" // for LogPrint() +#include "serialize.h" // for begin_ptr(vec) +#include "util.h" // for LogPrint() #include "utilstrencodings.h" // for GetTime() #include @@ -56,28 +56,25 @@ void RandAddSeedPerfmon() #ifdef WIN32 // Don't need this on Linux, OpenSSL automatically uses /dev/urandom // Seed with the entire set of perfmon data - std::vector vData(250000,0); + std::vector vData(250000, 0); long ret = 0; unsigned long nSize = 0; const size_t nMaxSize = 10000000; // Bail out at more than 10MB of performance data - while (true) - { + while (true) { nSize = vData.size(); ret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, begin_ptr(vData), &nSize); if (ret != ERROR_MORE_DATA || vData.size() >= nMaxSize) break; - vData.resize(std::max((vData.size()*3)/2, nMaxSize)); // Grow size of buffer exponentially + vData.resize(std::max((vData.size() * 3) / 2, nMaxSize)); // Grow size of buffer exponentially } RegCloseKey(HKEY_PERFORMANCE_DATA); - if (ret == ERROR_SUCCESS) - { - RAND_add(begin_ptr(vData), nSize, nSize/100.0); + if (ret == ERROR_SUCCESS) { + RAND_add(begin_ptr(vData), nSize, nSize / 100.0); OPENSSL_cleanse(begin_ptr(vData), nSize); LogPrint("rand", "%s: %lu bytes\n", __func__, nSize); } else { static bool warned = false; // Warn only once - if (!warned) - { + if (!warned) { LogPrintf("%s: Warning: RegQueryValueExA(HKEY_PERFORMANCE_DATA) failed with code %i\n", __func__, ret); warned = true; } @@ -85,7 +82,7 @@ void RandAddSeedPerfmon() #endif } -bool GetRandBytes(unsigned char *buf, int num) +bool GetRandBytes(unsigned char* buf, int num) { if (RAND_bytes(buf, num) != 1) { LogPrintf("%s: OpenSSL RAND_bytes() failed with error: %s\n", __func__, ERR_error_string(ERR_get_error(), NULL)); @@ -126,18 +123,17 @@ uint32_t insecure_rand_Rw = 11; void seed_insecure_rand(bool fDeterministic) { // The seed values have some unlikely fixed points which we avoid. - if(fDeterministic) - { + if (fDeterministic) { insecure_rand_Rz = insecure_rand_Rw = 11; } else { uint32_t tmp; do { GetRandBytes((unsigned char*)&tmp, 4); - } while(tmp == 0 || tmp == 0x9068ffffU); + } while (tmp == 0 || tmp == 0x9068ffffU); insecure_rand_Rz = tmp; do { GetRandBytes((unsigned char*)&tmp, 4); - } while(tmp == 0 || tmp == 0x464fffffU); + } while (tmp == 0 || tmp == 0x464fffffU); insecure_rand_Rw = tmp; } } diff --git a/src/random.h b/src/random.h index a599b08478..161ebe8986 100644 --- a/src/random.h +++ b/src/random.h @@ -19,7 +19,7 @@ void RandAddSeedPerfmon(); /** * Functions to gather random data via the OpenSSL PRNG */ -bool GetRandBytes(unsigned char *buf, int num); +bool GetRandBytes(unsigned char* buf, int num); uint64_t GetRand(uint64_t nMax); int GetRandInt(int nMax); uint256 GetRandHash(); diff --git a/src/rpcclient.h b/src/rpcclient.h index 1233ea3875..307aa2aab8 100644 --- a/src/rpcclient.h +++ b/src/rpcclient.h @@ -10,6 +10,6 @@ #include "json/json_spirit_utils.h" #include "json/json_spirit_writer_template.h" -json_spirit::Array RPCConvertValues(const std::string &strMethod, const std::vector &strParams); +json_spirit::Array RPCConvertValues(const std::string& strMethod, const std::vector& strParams); #endif // _BITCOINRPC_CLIENT_H_ diff --git a/src/sync.cpp b/src/sync.cpp index d424f7bc95..ef35c9d646 100644 --- a/src/sync.cpp +++ b/src/sync.cpp @@ -32,8 +32,7 @@ void PrintLockContention(const char* pszName, const char* pszFile, int nLine) // Complain if any thread tries to lock in a different order. // -struct CLockLocation -{ +struct CLockLocation { CLockLocation(const char* pszName, const char* pszFile, int nLine) { mutexName = pszName; @@ -43,7 +42,7 @@ struct CLockLocation std::string ToString() const { - return mutexName+" "+sourceFile+":"+itostr(sourceLine); + return mutexName + " " + sourceFile + ":" + itostr(sourceLine); } std::string MutexName() const { return mutexName; } @@ -54,7 +53,7 @@ private: int sourceLine; }; -typedef std::vector< std::pair > LockStack; +typedef std::vector > LockStack; static boost::mutex dd_mutex; static std::map, LockStack> lockorders; @@ -65,17 +64,19 @@ static void potential_deadlock_detected(const std::pair& mismatch, { LogPrintf("POTENTIAL DEADLOCK DETECTED\n"); LogPrintf("Previous lock order was:\n"); - BOOST_FOREACH(const PAIRTYPE(void*, CLockLocation)& i, s2) - { - if (i.first == mismatch.first) LogPrintf(" (1)"); - if (i.first == mismatch.second) LogPrintf(" (2)"); + BOOST_FOREACH (const PAIRTYPE(void*, CLockLocation) & i, s2) { + if (i.first == mismatch.first) + LogPrintf(" (1)"); + if (i.first == mismatch.second) + LogPrintf(" (2)"); LogPrintf(" %s\n", i.second.ToString()); } LogPrintf("Current lock order is:\n"); - BOOST_FOREACH(const PAIRTYPE(void*, CLockLocation)& i, s1) - { - if (i.first == mismatch.first) LogPrintf(" (1)"); - if (i.first == mismatch.second) LogPrintf(" (2)"); + BOOST_FOREACH (const PAIRTYPE(void*, CLockLocation) & i, s1) { + if (i.first == mismatch.first) + LogPrintf(" (1)"); + if (i.first == mismatch.second) + LogPrintf(" (2)"); LogPrintf(" %s\n", i.second.ToString()); } } @@ -91,8 +92,9 @@ static void push_lock(void* c, const CLockLocation& locklocation, bool fTry) (*lockstack).push_back(std::make_pair(c, locklocation)); if (!fTry) { - BOOST_FOREACH(const PAIRTYPE(void*, CLockLocation)& i, (*lockstack)) { - if (i.first == c) break; + BOOST_FOREACH (const PAIRTYPE(void*, CLockLocation) & i, (*lockstack)) { + if (i.first == c) + break; std::pair p1 = std::make_pair(i.first, c); if (lockorders.count(p1)) @@ -100,8 +102,7 @@ static void push_lock(void* c, const CLockLocation& locklocation, bool fTry) lockorders[p1] = (*lockstack); std::pair p2 = std::make_pair(c, i.first); - if (lockorders.count(p2)) - { + if (lockorders.count(p2)) { potential_deadlock_detected(p1, lockorders[p2], lockorders[p1]); break; } @@ -112,8 +113,7 @@ static void push_lock(void* c, const CLockLocation& locklocation, bool fTry) static void pop_lock() { - if (fDebug) - { + if (fDebug) { const CLockLocation& locklocation = (*lockstack).rbegin()->second; LogPrint("lock", "Unlocked: %s\n", locklocation.ToString()); } @@ -135,17 +135,17 @@ void LeaveCritical() std::string LocksHeld() { std::string result; - BOOST_FOREACH(const PAIRTYPE(void*, CLockLocation)&i, *lockstack) + BOOST_FOREACH (const PAIRTYPE(void*, CLockLocation) & i, *lockstack) result += i.second.ToString() + std::string("\n"); return result; } -void AssertLockHeldInternal(const char *pszName, const char* pszFile, int nLine, void *cs) +void AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs) { - BOOST_FOREACH(const PAIRTYPE(void*, CLockLocation)&i, *lockstack) - if (i.first == cs) return; - fprintf(stderr, "Assertion failed: lock %s not held in %s:%i; locks held:\n%s", - pszName, pszFile, nLine, LocksHeld().c_str()); + BOOST_FOREACH (const PAIRTYPE(void*, CLockLocation) & i, *lockstack) + if (i.first == cs) + return; + fprintf(stderr, "Assertion failed: lock %s not held in %s:%i; locks held:\n%s", pszName, pszFile, nLine, LocksHeld().c_str()); abort(); } diff --git a/src/sync.h b/src/sync.h index 4b81b4bd32..cd0aa7b20e 100644 --- a/src/sync.h +++ b/src/sync.h @@ -48,7 +48,6 @@ LEAVE_CRITICAL_SECTION(mutex); // no RAII */ - /////////////////////////////// // // // THE ACTUAL IMPLEMENTATION // @@ -63,17 +62,17 @@ class LOCKABLE AnnotatedMixin : public PARENT public: void lock() EXCLUSIVE_LOCK_FUNCTION() { - PARENT::lock(); + PARENT::lock(); } void unlock() UNLOCK_FUNCTION() { - PARENT::unlock(); + PARENT::unlock(); } bool try_lock() EXCLUSIVE_TRYLOCK_FUNCTION(true) { - return PARENT::try_lock(); + return PARENT::try_lock(); } }; @@ -91,11 +90,13 @@ typedef boost::condition_variable CConditionVariable; void EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry = false); void LeaveCritical(); std::string LocksHeld(); -void AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void *cs); +void AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs); #else -void static inline EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry = false) {} +void static inline EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry = false) +{ +} void static inline LeaveCritical() {} -void static inline AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void *cs) {} +void static inline AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs) {} #endif #define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs) @@ -104,7 +105,7 @@ void PrintLockContention(const char* pszName, const char* pszFile, int nLine); #endif /** Wrapper around boost::unique_lock */ -template +template class CMutexLock { private: @@ -114,11 +115,10 @@ private: { EnterCritical(pszName, pszFile, nLine, (void*)(lock.mutex())); #ifdef DEBUG_LOCKCONTENTION - if (!lock.try_lock()) - { + if (!lock.try_lock()) { PrintLockContention(pszName, pszFile, nLine); #endif - lock.lock(); + lock.lock(); #ifdef DEBUG_LOCKCONTENTION } #endif @@ -157,19 +157,19 @@ public: typedef CMutexLock CCriticalBlock; #define LOCK(cs) CCriticalBlock criticalblock(cs, #cs, __FILE__, __LINE__) -#define LOCK2(cs1,cs2) CCriticalBlock criticalblock1(cs1, #cs1, __FILE__, __LINE__),criticalblock2(cs2, #cs2, __FILE__, __LINE__) -#define TRY_LOCK(cs,name) CCriticalBlock name(cs, #cs, __FILE__, __LINE__, true) +#define LOCK2(cs1, cs2) CCriticalBlock criticalblock1(cs1, #cs1, __FILE__, __LINE__), criticalblock2(cs2, #cs2, __FILE__, __LINE__) +#define TRY_LOCK(cs, name) CCriticalBlock name(cs, #cs, __FILE__, __LINE__, true) -#define ENTER_CRITICAL_SECTION(cs) \ - { \ +#define ENTER_CRITICAL_SECTION(cs) \ + { \ EnterCritical(#cs, __FILE__, __LINE__, (void*)(&cs)); \ - (cs).lock(); \ + (cs).lock(); \ } #define LEAVE_CRITICAL_SECTION(cs) \ - { \ - (cs).unlock(); \ - LeaveCritical(); \ + { \ + (cs).unlock(); \ + LeaveCritical(); \ } class CSemaphore @@ -182,7 +182,8 @@ private: public: CSemaphore(int init) : value(init) {} - void wait() { + void wait() + { boost::unique_lock lock(mutex); while (value < 1) { condition.wait(lock); @@ -190,7 +191,8 @@ public: value--; } - bool try_wait() { + bool try_wait() + { boost::unique_lock lock(mutex); if (value < 1) return false; @@ -198,7 +200,8 @@ public: return true; } - void post() { + void post() + { { boost::unique_lock lock(mutex); value++; @@ -211,31 +214,35 @@ public: class CSemaphoreGrant { private: - CSemaphore *sem; + CSemaphore* sem; bool fHaveGrant; public: - void Acquire() { + void Acquire() + { if (fHaveGrant) return; sem->wait(); fHaveGrant = true; } - void Release() { + void Release() + { if (!fHaveGrant) return; sem->post(); fHaveGrant = false; } - bool TryAcquire() { + bool TryAcquire() + { if (!fHaveGrant && sem->try_wait()) fHaveGrant = true; return fHaveGrant; } - void MoveTo(CSemaphoreGrant &grant) { + void MoveTo(CSemaphoreGrant& grant) + { grant.Release(); grant.sem = sem; grant.fHaveGrant = fHaveGrant; @@ -245,18 +252,21 @@ public: CSemaphoreGrant() : sem(NULL), fHaveGrant(false) {} - CSemaphoreGrant(CSemaphore &sema, bool fTry = false) : sem(&sema), fHaveGrant(false) { + CSemaphoreGrant(CSemaphore& sema, bool fTry = false) : sem(&sema), fHaveGrant(false) + { if (fTry) TryAcquire(); else Acquire(); } - ~CSemaphoreGrant() { + ~CSemaphoreGrant() + { Release(); } - operator bool() { + operator bool() + { return fHaveGrant; } }; diff --git a/src/threadsafety.h b/src/threadsafety.h index 9ee39372e1..7515d050e7 100644 --- a/src/threadsafety.h +++ b/src/threadsafety.h @@ -13,24 +13,24 @@ // See http://clang.llvm.org/docs/LanguageExtensions.html#threadsafety // for documentation. The clang compiler can do advanced static analysis // of locking when given the -Wthread-safety option. -#define LOCKABLE __attribute__ ((lockable)) -#define SCOPED_LOCKABLE __attribute__ ((scoped_lockable)) -#define GUARDED_BY(x) __attribute__ ((guarded_by(x))) -#define GUARDED_VAR __attribute__ ((guarded_var)) -#define PT_GUARDED_BY(x) __attribute__ ((pt_guarded_by(x))) -#define PT_GUARDED_VAR __attribute__ ((pt_guarded_var)) -#define ACQUIRED_AFTER(...) __attribute__ ((acquired_after(__VA_ARGS__))) -#define ACQUIRED_BEFORE(...) __attribute__ ((acquired_before(__VA_ARGS__))) -#define EXCLUSIVE_LOCK_FUNCTION(...) __attribute__ ((exclusive_lock_function(__VA_ARGS__))) -#define SHARED_LOCK_FUNCTION(...) __attribute__ ((shared_lock_function(__VA_ARGS__))) -#define EXCLUSIVE_TRYLOCK_FUNCTION(...) __attribute__ ((exclusive_trylock_function(__VA_ARGS__))) -#define SHARED_TRYLOCK_FUNCTION(...) __attribute__ ((shared_trylock_function(__VA_ARGS__))) -#define UNLOCK_FUNCTION(...) __attribute__ ((unlock_function(__VA_ARGS__))) -#define LOCK_RETURNED(x) __attribute__ ((lock_returned(x))) -#define LOCKS_EXCLUDED(...) __attribute__ ((locks_excluded(__VA_ARGS__))) -#define EXCLUSIVE_LOCKS_REQUIRED(...) __attribute__ ((exclusive_locks_required(__VA_ARGS__))) -#define SHARED_LOCKS_REQUIRED(...) __attribute__ ((shared_locks_required(__VA_ARGS__))) -#define NO_THREAD_SAFETY_ANALYSIS __attribute__ ((no_thread_safety_analysis)) +#define LOCKABLE __attribute__((lockable)) +#define SCOPED_LOCKABLE __attribute__((scoped_lockable)) +#define GUARDED_BY(x) __attribute__((guarded_by(x))) +#define GUARDED_VAR __attribute__((guarded_var)) +#define PT_GUARDED_BY(x) __attribute__((pt_guarded_by(x))) +#define PT_GUARDED_VAR __attribute__((pt_guarded_var)) +#define ACQUIRED_AFTER(...) __attribute__((acquired_after(__VA_ARGS__))) +#define ACQUIRED_BEFORE(...) __attribute__((acquired_before(__VA_ARGS__))) +#define EXCLUSIVE_LOCK_FUNCTION(...) __attribute__((exclusive_lock_function(__VA_ARGS__))) +#define SHARED_LOCK_FUNCTION(...) __attribute__((shared_lock_function(__VA_ARGS__))) +#define EXCLUSIVE_TRYLOCK_FUNCTION(...) __attribute__((exclusive_trylock_function(__VA_ARGS__))) +#define SHARED_TRYLOCK_FUNCTION(...) __attribute__((shared_trylock_function(__VA_ARGS__))) +#define UNLOCK_FUNCTION(...) __attribute__((unlock_function(__VA_ARGS__))) +#define LOCK_RETURNED(x) __attribute__((lock_returned(x))) +#define LOCKS_EXCLUDED(...) __attribute__((locks_excluded(__VA_ARGS__))) +#define EXCLUSIVE_LOCKS_REQUIRED(...) __attribute__((exclusive_locks_required(__VA_ARGS__))) +#define SHARED_LOCKS_REQUIRED(...) __attribute__((shared_locks_required(__VA_ARGS__))) +#define NO_THREAD_SAFETY_ANALYSIS __attribute__((no_thread_safety_analysis)) #else #define LOCKABLE #define SCOPED_LOCKABLE @@ -50,6 +50,6 @@ #define EXCLUSIVE_LOCKS_REQUIRED(...) #define SHARED_LOCKS_REQUIRED(...) #define NO_THREAD_SAFETY_ANALYSIS -#endif // __GNUC__ +#endif // __GNUC__ -#endif // BITCOIN_THREADSAFETY_H +#endif // BITCOIN_THREADSAFETY_H diff --git a/src/timedata.h b/src/timedata.h index 155f6872da..2c20f4efd5 100644 --- a/src/timedata.h +++ b/src/timedata.h @@ -15,15 +15,16 @@ class CNetAddr; /** Median filter over a stream of values. * Returns the median of the last N numbers */ -template class CMedianFilter +template +class CMedianFilter { private: std::vector vValues; std::vector vSorted; unsigned int nSize; + public: - CMedianFilter(unsigned int size, T initial_value): - nSize(size) + CMedianFilter(unsigned int size, T initial_value) : nSize(size) { vValues.reserve(size); vValues.push_back(initial_value); @@ -32,8 +33,7 @@ public: void input(T value) { - if(vValues.size() == nSize) - { + if (vValues.size() == nSize) { vValues.erase(vValues.begin()); } vValues.push_back(value); @@ -46,14 +46,13 @@ public: T median() const { int size = vSorted.size(); - assert(size>0); - if(size & 1) // Odd number of elements + assert(size > 0); + if (size & 1) // Odd number of elements { - return vSorted[size/2]; - } - else // Even number of elements + return vSorted[size / 2]; + } else // Even number of elements { - return (vSorted[size/2-1] + vSorted[size/2]) / 2; + return (vSorted[size / 2 - 1] + vSorted[size / 2]) / 2; } } @@ -62,7 +61,7 @@ public: return vValues.size(); } - std::vector sorted () const + std::vector sorted() const { return vSorted; } diff --git a/src/uint256.cpp b/src/uint256.cpp index feda0ca5a9..79406f2475 100644 --- a/src/uint256.cpp +++ b/src/uint256.cpp @@ -10,13 +10,13 @@ #include #include -template +template base_uint::base_uint(const std::string& str) { SetHex(str); } -template +template base_uint::base_uint(const std::vector& vch) { if (vch.size() != sizeof(pn)) @@ -24,7 +24,7 @@ base_uint::base_uint(const std::vector& vch) memcpy(pn, &vch[0], sizeof(pn)); } -template +template base_uint& base_uint::operator<<=(unsigned int shift) { base_uint a(*this); @@ -33,15 +33,15 @@ base_uint& base_uint::operator<<=(unsigned int shift) int k = shift / 32; shift = shift % 32; for (int i = 0; i < WIDTH; i++) { - if (i+k+1 < WIDTH && shift != 0) - pn[i+k+1] |= (a.pn[i] >> (32-shift)); - if (i+k < WIDTH) - pn[i+k] |= (a.pn[i] << shift); + if (i + k + 1 < WIDTH && shift != 0) + pn[i + k + 1] |= (a.pn[i] >> (32 - shift)); + if (i + k < WIDTH) + pn[i + k] |= (a.pn[i] << shift); } return *this; } -template +template base_uint& base_uint::operator>>=(unsigned int shift) { base_uint a(*this); @@ -50,15 +50,15 @@ base_uint& base_uint::operator>>=(unsigned int shift) int k = shift / 32; shift = shift % 32; for (int i = 0; i < WIDTH; i++) { - if (i-k-1 >= 0 && shift != 0) - pn[i-k-1] |= (a.pn[i] << (32-shift)); - if (i-k >= 0) - pn[i-k] |= (a.pn[i] >> shift); + if (i - k - 1 >= 0 && shift != 0) + pn[i - k - 1] |= (a.pn[i] << (32 - shift)); + if (i - k >= 0) + pn[i - k] |= (a.pn[i] >> shift); } return *this; } -template +template base_uint& base_uint::operator*=(uint32_t b32) { uint64_t carry = 0; @@ -70,7 +70,7 @@ base_uint& base_uint::operator*=(uint32_t b32) return *this; } -template +template base_uint& base_uint::operator*=(const base_uint& b) { base_uint a = *this; @@ -86,12 +86,12 @@ base_uint& base_uint::operator*=(const base_uint& b) return *this; } -template +template base_uint& base_uint::operator/=(const base_uint& b) { - base_uint div = b; // make a copy, so we can shift. + base_uint div = b; // make a copy, so we can shift. base_uint num = *this; // make a copy, so we can subtract. - *this = 0; // the quotient. + *this = 0; // the quotient. int num_bits = num.bits(); int div_bits = div.bits(); if (div_bits == 0) @@ -112,9 +112,10 @@ base_uint& base_uint::operator/=(const base_uint& b) return *this; } -template -int base_uint::CompareTo(const base_uint& b) const { - for (int i = WIDTH-1; i >= 0; i--) { +template +int base_uint::CompareTo(const base_uint& b) const +{ + for (int i = WIDTH - 1; i >= 0; i--) { if (pn[i] < b.pn[i]) return -1; if (pn[i] > b.pn[i]) @@ -123,9 +124,10 @@ int base_uint::CompareTo(const base_uint& b) const { return 0; } -template -bool base_uint::EqualTo(uint64_t b) const { - for (int i = WIDTH-1; i >= 2; i--) { +template +bool base_uint::EqualTo(uint64_t b) const +{ + for (int i = WIDTH - 1; i >= 2; i--) { if (pn[i]) return false; } @@ -136,7 +138,7 @@ bool base_uint::EqualTo(uint64_t b) const { return true; } -template +template double base_uint::getdouble() const { double ret = 0.0; @@ -148,19 +150,19 @@ double base_uint::getdouble() const return ret; } -template +template std::string base_uint::GetHex() const { - char psz[sizeof(pn)*2 + 1]; + char psz[sizeof(pn) * 2 + 1]; for (unsigned int i = 0; i < sizeof(pn); i++) - sprintf(psz + i*2, "%02x", ((unsigned char*)pn)[sizeof(pn) - i - 1]); - return std::string(psz, psz + sizeof(pn)*2); + sprintf(psz + i * 2, "%02x", ((unsigned char*)pn)[sizeof(pn) - i - 1]); + return std::string(psz, psz + sizeof(pn) * 2); } -template +template void base_uint::SetHex(const char* psz) { - memset(pn,0,sizeof(pn)); + memset(pn, 0, sizeof(pn)); // skip leading spaces while (isspace(*psz)) @@ -186,28 +188,28 @@ void base_uint::SetHex(const char* psz) } } -template +template void base_uint::SetHex(const std::string& str) { SetHex(str.c_str()); } -template +template std::string base_uint::ToString() const { return (GetHex()); } -template +template unsigned int base_uint::bits() const { - for (int pos = WIDTH-1; pos >= 0; pos--) { + for (int pos = WIDTH - 1; pos >= 0; pos--) { if (pn[pos]) { for (int bits = 31; bits > 0; bits--) { - if (pn[pos] & 1<::bits() const; // This implementation directly uses shifts instead of going // through an intermediate MPI representation. -uint256& uint256::SetCompact(uint32_t nCompact, bool *pfNegative, bool *pfOverflow) +uint256& uint256::SetCompact(uint32_t nCompact, bool* pfNegative, bool* pfOverflow) { int nSize = nCompact >> 24; uint32_t nWord = nCompact & 0x007fffff; if (nSize <= 3) { - nWord >>= 8*(3-nSize); + nWord >>= 8 * (3 - nSize); *this = nWord; } else { *this = nWord; - *this <<= 8*(nSize-3); + *this <<= 8 * (nSize - 3); } if (pfNegative) *pfNegative = nWord != 0 && (nCompact & 0x00800000) != 0; @@ -274,9 +276,9 @@ uint32_t uint256::GetCompact(bool fNegative) const int nSize = (bits() + 7) / 8; uint32_t nCompact = 0; if (nSize <= 3) { - nCompact = GetLow64() << 8*(3-nSize); + nCompact = GetLow64() << 8 * (3 - nSize); } else { - uint256 bn = *this >> 8*(nSize-3); + uint256 bn = *this >> 8 * (nSize - 3); nCompact = bn.GetLow64(); } // The 0x00800000 bit denotes the sign. @@ -295,27 +297,46 @@ uint32_t uint256::GetCompact(bool fNegative) const static void inline HashMix(uint32_t& a, uint32_t& b, uint32_t& c) { // Taken from lookup3, by Bob Jenkins. - a -= c; a ^= ((c << 4) | (c >> 28)); c += b; - b -= a; b ^= ((a << 6) | (a >> 26)); a += c; - c -= b; c ^= ((b << 8) | (b >> 24)); b += a; - a -= c; a ^= ((c << 16) | (c >> 16)); c += b; - b -= a; b ^= ((a << 19) | (a >> 13)); a += c; - c -= b; c ^= ((b << 4) | (b >> 28)); b += a; + a -= c; + a ^= ((c << 4) | (c >> 28)); + c += b; + b -= a; + b ^= ((a << 6) | (a >> 26)); + a += c; + c -= b; + c ^= ((b << 8) | (b >> 24)); + b += a; + a -= c; + a ^= ((c << 16) | (c >> 16)); + c += b; + b -= a; + b ^= ((a << 19) | (a >> 13)); + a += c; + c -= b; + c ^= ((b << 4) | (b >> 28)); + b += a; } static void inline HashFinal(uint32_t& a, uint32_t& b, uint32_t& c) { // Taken from lookup3, by Bob Jenkins. - c ^= b; c -= ((b << 14) | (b >> 18)); - a ^= c; a -= ((c << 11) | (c >> 21)); - b ^= a; b -= ((a << 25) | (a >> 7)); - c ^= b; c -= ((b << 16) | (b >> 16)); - a ^= c; a -= ((c << 4) | (c >> 28)); - b ^= a; b -= ((a << 14) | (a >> 18)); - c ^= b; c -= ((b << 24) | (b >> 8)); + c ^= b; + c -= ((b << 14) | (b >> 18)); + a ^= c; + a -= ((c << 11) | (c >> 21)); + b ^= a; + b -= ((a << 25) | (a >> 7)); + c ^= b; + c -= ((b << 16) | (b >> 16)); + a ^= c; + a -= ((c << 4) | (c >> 28)); + b ^= a; + b -= ((a << 14) | (a >> 18)); + c ^= b; + c -= ((b << 24) | (b >> 8)); } -uint64_t uint256::GetHash(const uint256 &salt) const +uint64_t uint256::GetHash(const uint256& salt) const { uint32_t a, b, c; a = b = c = 0xdeadbeef + (WIDTH << 2); diff --git a/src/version.cpp b/src/version.cpp index e441cc463f..95632fdab7 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -16,7 +16,7 @@ const std::string CLIENT_NAME("Satoshi"); // Client version number -#define CLIENT_VERSION_SUFFIX "" +#define CLIENT_VERSION_SUFFIX "" // The following part of the code determines the CLIENT_BUILD variable. @@ -35,40 +35,40 @@ const std::string CLIENT_NAME("Satoshi"); // First, include build.h if requested #ifdef HAVE_BUILD_INFO -# include "build.h" +#include "build.h" #endif // git will put "#define GIT_ARCHIVE 1" on the next line inside archives. $Format:%n#define GIT_ARCHIVE 1$ #ifdef GIT_ARCHIVE -# define GIT_COMMIT_ID "$Format:%h$" -# define GIT_COMMIT_DATE "$Format:%cD$" +#define GIT_COMMIT_ID "$Format:%h$" +#define GIT_COMMIT_DATE "$Format:%cD$" #endif -#define BUILD_DESC_WITH_SUFFIX(maj,min,rev,build,suffix) \ +#define BUILD_DESC_WITH_SUFFIX(maj, min, rev, build, suffix) \ "v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-" DO_STRINGIZE(suffix) -#define BUILD_DESC_FROM_COMMIT(maj,min,rev,build,commit) \ +#define BUILD_DESC_FROM_COMMIT(maj, min, rev, build, commit) \ "v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-g" commit -#define BUILD_DESC_FROM_UNKNOWN(maj,min,rev,build) \ +#define BUILD_DESC_FROM_UNKNOWN(maj, min, rev, build) \ "v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-unk" #ifndef BUILD_DESC -# ifdef BUILD_SUFFIX -# define BUILD_DESC BUILD_DESC_WITH_SUFFIX(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, BUILD_SUFFIX) -# elif defined(GIT_COMMIT_ID) -# define BUILD_DESC BUILD_DESC_FROM_COMMIT(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, GIT_COMMIT_ID) -# else -# define BUILD_DESC BUILD_DESC_FROM_UNKNOWN(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD) -# endif +#ifdef BUILD_SUFFIX +#define BUILD_DESC BUILD_DESC_WITH_SUFFIX(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, BUILD_SUFFIX) +#elif defined(GIT_COMMIT_ID) +#define BUILD_DESC BUILD_DESC_FROM_COMMIT(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, GIT_COMMIT_ID) +#else +#define BUILD_DESC BUILD_DESC_FROM_UNKNOWN(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD) +#endif #endif #ifndef BUILD_DATE -# ifdef GIT_COMMIT_DATE -# define BUILD_DATE GIT_COMMIT_DATE -# else -# define BUILD_DATE __DATE__ ", " __TIME__ -# endif +#ifdef GIT_COMMIT_DATE +#define BUILD_DATE GIT_COMMIT_DATE +#else +#define BUILD_DATE __DATE__ ", " __TIME__ +#endif #endif const std::string CLIENT_BUILD(BUILD_DESC CLIENT_VERSION_SUFFIX); @@ -76,10 +76,10 @@ const std::string CLIENT_DATE(BUILD_DATE); static std::string FormatVersion(int nVersion) { - if (nVersion%100 == 0) - return strprintf("%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100); + if (nVersion % 100 == 0) + return strprintf("%d.%d.%d", nVersion / 1000000, (nVersion / 10000) % 100, (nVersion / 100) % 100); else - return strprintf("%d.%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100, nVersion%100); + return strprintf("%d.%d.%d.%d", nVersion / 1000000, (nVersion / 10000) % 100, (nVersion / 100) % 100, nVersion % 100); } std::string FormatFullVersion() From c65cc8cde30dd34a81962fda51a754f1cc0bdde8 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 19 Sep 2014 15:22:33 -0400 Subject: [PATCH 0723/1288] build: fix release name strings for gitian builds When building from a distdir as gitian does, checking for the .git dir is not reliable. Instead, ask git if we're in a repo. --- share/genbuild.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/genbuild.sh b/share/genbuild.sh index 0800b31229..679566e596 100755 --- a/share/genbuild.sh +++ b/share/genbuild.sh @@ -16,7 +16,7 @@ fi DESC="" SUFFIX="" LAST_COMMIT_DATE="" -if [ -e "$(which git 2>/dev/null)" -a -d ".git" ]; then +if [ -e "$(which git 2>/dev/null)" -a $(git rev-parse --is-inside-work-tree 2>/dev/null) = "true" ]; then # clean 'dirty' status of touched files that haven't been modified git diff >/dev/null 2>/dev/null From 6134b43ba9ffc277a3b0cd8cceb5abe8e5c8bd56 Mon Sep 17 00:00:00 2001 From: ENikS Date: Fri, 19 Sep 2014 18:29:58 -0400 Subject: [PATCH 0724/1288] Fixing condition 'sabotaging' MSVC build --- src/script/script.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/script/script.h b/src/script/script.h index 07a4229f85..4c9ac74b78 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -340,9 +340,7 @@ public: CScript() { } CScript(const CScript& b) : std::vector(b.begin(), b.end()) { } CScript(const_iterator pbegin, const_iterator pend) : std::vector(pbegin, pend) { } -#ifndef _MSC_VER CScript(const unsigned char* pbegin, const unsigned char* pend) : std::vector(pbegin, pend) { } -#endif CScript& operator+=(const CScript& b) { From 33a27716fc4389e7acb53708f0e02fc9b4606498 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sat, 20 Sep 2014 09:53:50 +0200 Subject: [PATCH 0725/1288] test: Fix DoS tests after c74332c Fix data structure mismatch ... The mind boggles that they were still passing at all. --- src/test/DoS_tests.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index af01e5518c..7bec12b665 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -27,7 +27,11 @@ extern bool AddOrphanTx(const CTransaction& tx, NodeId peer); extern void EraseOrphansFor(NodeId peer); extern unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans); -extern std::map mapOrphanTransactions; +struct COrphanTx { + CTransaction tx; + NodeId fromPeer; +}; +extern std::map mapOrphanTransactions; extern std::map > mapOrphanTransactionsByPrev; CService ip(uint32_t i) @@ -149,11 +153,11 @@ BOOST_AUTO_TEST_CASE(DoS_checknbits) CTransaction RandomOrphan() { - std::map::iterator it; + std::map::iterator it; it = mapOrphanTransactions.lower_bound(GetRandHash()); if (it == mapOrphanTransactions.end()) it = mapOrphanTransactions.begin(); - return it->second; + return it->second.tx; } BOOST_AUTO_TEST_CASE(DoS_mapOrphans) From d6712db35419e36b2c89191eb730a86d95abf4b0 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sat, 20 Sep 2014 10:56:25 +0200 Subject: [PATCH 0726/1288] Also create pid file in non-daemon mode Always make a pid file, not only when `-daemon` specified. This is useful for troubleshooting, for attaching debuggers and loggers and such. - Write the pid file only after the datadir lock was acquired - Don't create or remove a pid file on WIN32, and also don't show the option --- src/bitcoind.cpp | 1 - src/init.cpp | 8 +++++++- src/util.cpp | 2 +- src/util.h | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 5be8708979..0737b5a83d 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -129,7 +129,6 @@ bool AppInit(int argc, char* argv[]) } if (pid > 0) // Parent process, pid is child process id { - CreatePidFile(GetPidFile(), pid); return true; } // Child process falls through to rest of initialization diff --git a/src/init.cpp b/src/init.cpp index 67f53e044c..7299bd0f4a 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -160,7 +160,9 @@ void Shutdown() if (pwalletMain) bitdb.Flush(true); #endif +#ifndef WIN32 boost::filesystem::remove(GetPidFile()); +#endif UnregisterAllWallets(); #ifdef ENABLE_WALLET if (pwalletMain) @@ -228,7 +230,9 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -maxorphanblocks= " + strprintf(_("Keep at most unconnectable blocks in memory (default: %u)"), DEFAULT_MAX_ORPHAN_BLOCKS) + "\n"; strUsage += " -maxorphantx= " + strprintf(_("Keep at most unconnectable transactions in memory (default: %u)"), DEFAULT_MAX_ORPHAN_TRANSACTIONS) + "\n"; strUsage += " -par= " + strprintf(_("Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)"), -(int)boost::thread::hardware_concurrency(), MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS) + "\n"; +#ifndef WIN32 strUsage += " -pid= " + _("Specify pid file (default: bitcoind.pid)") + "\n"; +#endif strUsage += " -reindex " + _("Rebuild block chain index from current blk000??.dat files") + " " + _("on startup") + "\n"; #if !defined(WIN32) strUsage += " -sysperms " + _("Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)") + "\n"; @@ -714,7 +718,9 @@ bool AppInit2(boost::thread_group& threadGroup) static boost::interprocess::file_lock lock(pathLockFile.string().c_str()); if (!lock.try_lock()) return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running."), strDataDir)); - +#ifndef WIN32 + CreatePidFile(GetPidFile(), getpid()); +#endif if (GetBoolArg("-shrinkdebugfile", !fDebug)) ShrinkDebugFile(); LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); diff --git a/src/util.cpp b/src/util.cpp index 0ac0f70a79..f387fce8c7 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -472,6 +472,7 @@ void ReadConfigFile(map& mapSettingsRet, ClearDatadirCache(); } +#ifndef WIN32 boost::filesystem::path GetPidFile() { boost::filesystem::path pathPidFile(GetArg("-pid", "bitcoind.pid")); @@ -479,7 +480,6 @@ boost::filesystem::path GetPidFile() return pathPidFile; } -#ifndef WIN32 void CreatePidFile(const boost::filesystem::path &path, pid_t pid) { FILE* file = fopen(path.string().c_str(), "w"); diff --git a/src/util.h b/src/util.h index e72c99adc7..4b2415278b 100644 --- a/src/util.h +++ b/src/util.h @@ -93,8 +93,8 @@ bool TryCreateDirectory(const boost::filesystem::path& p); boost::filesystem::path GetDefaultDataDir(); const boost::filesystem::path &GetDataDir(bool fNetSpecific = true); boost::filesystem::path GetConfigFile(); -boost::filesystem::path GetPidFile(); #ifndef WIN32 +boost::filesystem::path GetPidFile(); void CreatePidFile(const boost::filesystem::path &path, pid_t pid); #endif void ReadConfigFile(std::map& mapSettingsRet, std::map >& mapMultiSettingsRet); From 01c28073ba2cae5a53124c7dc7123240b98513ce Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Sat, 20 Sep 2014 12:32:42 -0400 Subject: [PATCH 0727/1288] Add warning about the merkle-tree algorithm duplicate txid flaw Lots of people read the Bitcoin Core codebase to learn more about crypto; better to warn about flaws explicitly so they don't blindly copy the code for other uses and create broken systems. --- src/core.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core.cpp b/src/core.cpp index 491e4fa68b..e52327ba8e 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -226,6 +226,13 @@ uint256 CBlockHeader::GetHash() const uint256 CBlock::BuildMerkleTree() const { + // WARNING! If you're reading this because you're learning about crypto + // and/or designing a new system that will use merkle trees, keep in mind + // that the following merkle tree algorithm has a serious flaw related to + // duplicate txids, resulting in a vulnerability. (CVE-2012-2459) Bitcoin + // has since worked around the flaw, but for new applications you should + // use something different; don't just copy-and-paste this code without + // understanding the problem first. vMerkleTree.clear(); BOOST_FOREACH(const CTransaction& tx, vtx) vMerkleTree.push_back(tx.GetHash()); From f297479a1995bd147c21c58fca103cd3ab3e54c1 Mon Sep 17 00:00:00 2001 From: jtimon Date: Mon, 1 Sep 2014 00:01:54 +0200 Subject: [PATCH 0728/1288] Reserve only one network specific cached path per session --- src/util.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 0ac0f70a79..7bb65f6584 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -395,7 +395,7 @@ boost::filesystem::path GetDefaultDataDir() #endif } -static boost::filesystem::path pathCached[CBaseChainParams::MAX_NETWORK_TYPES+1]; +static boost::filesystem::path pathCached[2]; static CCriticalSection csPathCached; const boost::filesystem::path &GetDataDir(bool fNetSpecific) @@ -404,10 +404,7 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific) LOCK(csPathCached); - int nNet = CBaseChainParams::MAX_NETWORK_TYPES; - if (fNetSpecific) nNet = BaseParams().NetworkID(); - - fs::path &path = pathCached[nNet]; + fs::path &path = pathCached[fNetSpecific ? 1 : 0]; // This can be called during exceptions by LogPrintf(), so we cache the // value so we don't have to do memory allocations after that. @@ -433,8 +430,7 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific) void ClearDatadirCache() { - std::fill(&pathCached[0], &pathCached[CBaseChainParams::MAX_NETWORK_TYPES+1], - boost::filesystem::path()); + std::fill(&pathCached[0], &pathCached[2], boost::filesystem::path()); } boost::filesystem::path GetConfigFile() From 3fdb9e8c159a2bc3ac853b469dae9ba0ecf739f3 Mon Sep 17 00:00:00 2001 From: jtimon Date: Mon, 1 Sep 2014 00:41:28 +0200 Subject: [PATCH 0729/1288] Remove CBaseChainParams::NetworkID() --- src/chainparams.cpp | 9 ++++++--- src/chainparamsbase.cpp | 27 ++++++++++++++++----------- src/chainparamsbase.h | 8 ++++++-- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 179db5a818..f561877d9f 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -240,10 +240,13 @@ void SelectParams(CBaseChainParams::Network network) { pCurrentParams = &Params(network); } -bool SelectParamsFromCommandLine() { - if (!SelectBaseParamsFromCommandLine()) +bool SelectParamsFromCommandLine() +{ + CBaseChainParams::Network network = CBaseChainParams::NetworkIdFromCommandLine(); + if (network == CBaseChainParams::MAX_NETWORK_TYPES) return false; - SelectParams(BaseParams().NetworkID()); + SelectBaseParams(network); + SelectParams(network); return true; } diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index 98bb5b855f..05ef5dd463 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -83,22 +83,27 @@ void SelectBaseParams(CBaseChainParams::Network network) } } -bool SelectBaseParamsFromCommandLine() +CBaseChainParams::Network CBaseChainParams::NetworkIdFromCommandLine() { bool fRegTest = GetBoolArg("-regtest", false); bool fTestNet = GetBoolArg("-testnet", false); - if (fTestNet && fRegTest) { - return false; - } + if (fTestNet && fRegTest) + return MAX_NETWORK_TYPES; + if (fRegTest) + return REGTEST; + if (fTestNet) + return TESTNET; + return MAIN; +} - if (fRegTest) { - SelectBaseParams(CBaseChainParams::REGTEST); - } else if (fTestNet) { - SelectBaseParams(CBaseChainParams::TESTNET); - } else { - SelectBaseParams(CBaseChainParams::MAIN); - } +bool SelectBaseParamsFromCommandLine() +{ + CBaseChainParams::Network network = CBaseChainParams::NetworkIdFromCommandLine(); + if (network == CBaseChainParams::MAX_NETWORK_TYPES) + return false; + + SelectBaseParams(network); return true; } diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h index c054f03f17..f24337cef0 100644 --- a/src/chainparamsbase.h +++ b/src/chainparamsbase.h @@ -25,8 +25,12 @@ public: const std::string& DataDir() const { return strDataDir; } int RPCPort() const { return nRPCPort; } - Network NetworkID() const { return networkID; } + /** + * Looks for -regtest or -testnet and returns the appropriate Network ID. + * Returns MAX_NETWORK_TYPES if an invalid combination is given. + */ + static Network NetworkIdFromCommandLine(); protected: CBaseChainParams() {} @@ -45,7 +49,7 @@ const CBaseChainParams& BaseParams(); void SelectBaseParams(CBaseChainParams::Network network); /** - * Looks for -regtest or -testnet and then calls SelectParams as appropriate. + * Calls CBaseChainParams::NetworkIdFromCommandLine() and then calls SelectParams as appropriate. * Returns false if an invalid combination is given. */ bool SelectBaseParamsFromCommandLine(); From 87314c1c5e69035fefa638de8e237e4ce09788e9 Mon Sep 17 00:00:00 2001 From: ENikS Date: Sun, 21 Sep 2014 21:18:48 -0400 Subject: [PATCH 0730/1288] Fixing improper input syntax and failing bounds check --- src/serialize.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serialize.h b/src/serialize.h index 57f5fd069b..447d808dee 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -921,7 +921,7 @@ public: Init(nTypeIn, nVersionIn); } - CDataStream(const std::vector& vchIn, int nTypeIn, int nVersionIn) : vch((char*)&vchIn.begin()[0], (char*)&vchIn.end()[0]) + CDataStream(const std::vector& vchIn, int nTypeIn, int nVersionIn) : vch(vchIn.begin(), vchIn.end()) { Init(nTypeIn, nVersionIn); } From 2e5361b9c20517a22a4d1fdae3077d23800ecba7 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 28 Aug 2014 23:00:55 +0200 Subject: [PATCH 0731/1288] remove code below asserts in limitedmap.h (fixes a ToDo) --- src/limitedmap.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/limitedmap.h b/src/limitedmap.h index 4bc8d9e5aa..03727d7c42 100644 --- a/src/limitedmap.h +++ b/src/limitedmap.h @@ -1,11 +1,11 @@ -// Copyright (c) 2012 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2012-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_LIMITEDMAP_H #define BITCOIN_LIMITEDMAP_H -#include // TODO: remove +#include #include /** STL-like map container that only keeps the N elements with the highest value. */ @@ -59,12 +59,11 @@ public: return; } // Shouldn't ever get here - assert(0); //TODO remove me - map.erase(itTarget); + assert(0); } void update(const_iterator itIn, const mapped_type& v) { - //TODO: When we switch to C++11, use map.erase(itIn, itIn) to get the non-const iterator + // TODO: When we switch to C++11, use map.erase(itIn, itIn) to get the non-const iterator. iterator itTarget = map.find(itIn->first); if (itTarget == map.end()) return; @@ -77,9 +76,7 @@ public: return; } // Shouldn't ever get here - assert(0); //TODO remove me - itTarget->second = v; - rmap.insert(make_pair(v, itTarget)); + assert(0); } size_type max_size() const { return nMaxSize; } size_type max_size(size_type s) From cfc5cfb0f0d074774b17adcb88aaed11e6847c92 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 22 Sep 2014 10:08:47 +0200 Subject: [PATCH 0732/1288] qt: Make splash and shutdown window ignore close events It's strange to be able to close these windows while there is work in progress. Also set Qt::WA_DeleteOnClose on both windows to make sure that they are deleted eventually, no matter what happens. --- src/qt/bitcoin.cpp | 3 +++ src/qt/splashscreen.cpp | 9 +++++++-- src/qt/splashscreen.h | 9 +++++++-- src/qt/utilitydialog.cpp | 26 ++++++++++++++++++++------ src/qt/utilitydialog.h | 6 +++++- 5 files changed, 42 insertions(+), 11 deletions(-) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 676f218f20..fd629ccd2c 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -339,6 +339,9 @@ void BitcoinApplication::createWindow(bool isaTestNet) void BitcoinApplication::createSplashScreen(bool isaTestNet) { SplashScreen *splash = new SplashScreen(0, isaTestNet); + // We don't hold a direct pointer to the splash screen after creation, so use + // Qt::WA_DeleteOnClose to make sure that the window will be deleted eventually. + splash->setAttribute(Qt::WA_DeleteOnClose); splash->show(); connect(this, SIGNAL(splashFinished(QWidget*)), splash, SLOT(slotFinish(QWidget*))); } diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index b6443d47ff..382f0e67b6 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -14,8 +14,9 @@ #endif #include -#include +#include #include +#include SplashScreen::SplashScreen(Qt::WindowFlags f, bool isTestNet) : QWidget(0, f), curAlignment(0) @@ -113,7 +114,6 @@ SplashScreen::~SplashScreen() void SplashScreen::slotFinish(QWidget *mainWin) { hide(); - deleteLater(); } static void InitMessage(SplashScreen *splash, const std::string &message) @@ -175,3 +175,8 @@ void SplashScreen::paintEvent(QPaintEvent *event) painter.drawText(r, curAlignment, curMessage); } +void SplashScreen::closeEvent(QCloseEvent *event) +{ + event->ignore(); +} + diff --git a/src/qt/splashscreen.h b/src/qt/splashscreen.h index 1151d6c111..89c21e6457 100644 --- a/src/qt/splashscreen.h +++ b/src/qt/splashscreen.h @@ -7,7 +7,11 @@ #include -/** class for the splashscreen with information of the running client +/** Class for the splashscreen with information of the running client. + * + * @note this is intentionally not a QSplashScreen. Bitcoin Core initialization + * can take a long time, and in that case a progress window that cannot be + * moved around and minimized has turned out to be frustrating to the user. */ class SplashScreen : public QWidget { @@ -18,7 +22,8 @@ public: ~SplashScreen(); protected: - void paintEvent(QPaintEvent *event); + void paintEvent(QPaintEvent *event); + void closeEvent(QCloseEvent *event); public slots: /** Slot to call finish() method as it's not defined as slot */ diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index 7df9d1bc2d..84f88dff5a 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -15,6 +15,7 @@ #include +#include #include #include #include @@ -106,18 +107,26 @@ void HelpMessageDialog::on_okButton_accepted() /** "Shutdown" window */ +ShutdownWindow::ShutdownWindow(QWidget *parent, Qt::WindowFlags f): + QWidget(parent, f) +{ + QVBoxLayout *layout = new QVBoxLayout(); + layout->addWidget(new QLabel( + tr("Bitcoin Core is shutting down...") + "

" + + tr("Do not shut down the computer until this window disappears."))); + setLayout(layout); +} + void ShutdownWindow::showShutdownWindow(BitcoinGUI *window) { if (!window) return; // Show a simple window indicating shutdown status - QWidget *shutdownWindow = new QWidget(); - QVBoxLayout *layout = new QVBoxLayout(); - layout->addWidget(new QLabel( - tr("Bitcoin Core is shutting down...") + "

" + - tr("Do not shut down the computer until this window disappears."))); - shutdownWindow->setLayout(layout); + QWidget *shutdownWindow = new ShutdownWindow(); + // We don't hold a direct pointer to the shutdown window after creation, so use + // Qt::WA_DeleteOnClose to make sure that the window will be deleted eventually. + shutdownWindow->setAttribute(Qt::WA_DeleteOnClose); shutdownWindow->setWindowTitle(window->windowTitle()); // Center shutdown window at where main window was @@ -125,3 +134,8 @@ void ShutdownWindow::showShutdownWindow(BitcoinGUI *window) shutdownWindow->move(global.x() - shutdownWindow->width() / 2, global.y() - shutdownWindow->height() / 2); shutdownWindow->show(); } + +void ShutdownWindow::closeEvent(QCloseEvent *event) +{ + event->ignore(); +} diff --git a/src/qt/utilitydialog.h b/src/qt/utilitydialog.h index 154bb70b8b..ae5045cca9 100644 --- a/src/qt/utilitydialog.h +++ b/src/qt/utilitydialog.h @@ -37,12 +37,16 @@ private slots: /** "Shutdown" window */ -class ShutdownWindow : public QObject +class ShutdownWindow : public QWidget { Q_OBJECT public: + ShutdownWindow(QWidget *parent=0, Qt::WindowFlags f=0); static void showShutdownWindow(BitcoinGUI *window); + +protected: + void closeEvent(QCloseEvent *event); }; #endif // UTILITYDIALOG_H From 27fc5277f73e510c2150dc29308fdf2dc6a96053 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 22 Sep 2014 16:40:49 +0200 Subject: [PATCH 0733/1288] build: change cdrkit location in build-process.md The cdrkit.org domain expired. Thanks to gdm85 on IRC for reporting this. --- doc/release-process.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/release-process.md b/doc/release-process.md index c5ead4199b..8934be66c4 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -64,7 +64,7 @@ Release Process wget 'http://www.opensource.apple.com/tarballs/cctools/cctools-809.tar.gz' wget 'http://www.opensource.apple.com/tarballs/dyld/dyld-195.5.tar.gz' wget 'http://www.opensource.apple.com/tarballs/ld64/ld64-127.2.tar.gz' - wget 'http://cdrkit.org/releases/cdrkit-1.1.11.tar.gz' + wget 'http://pkgs.fedoraproject.org/repo/pkgs/cdrkit/cdrkit-1.1.11.tar.gz/efe08e2f3ca478486037b053acd512e9/cdrkit-1.1.11.tar.gz' wget 'https://github.com/theuni/libdmg-hfsplus/archive/libdmg-hfsplus-v0.1.tar.gz' wget 'http://llvm.org/releases/3.2/clang+llvm-3.2-x86-linux-ubuntu-12.04.tar.gz' -O clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz wget 'https://raw.githubusercontent.com/theuni/osx-cross-depends/master/patches/cdrtools/genisoimage.diff' -O cdrkit-deterministic.patch From 76ec8677965570d344ef6f556920a00a47f54248 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 20 Sep 2014 00:20:53 +0200 Subject: [PATCH 0734/1288] Use actually valid transactions for script tests --- src/test/data/script_invalid.json | 9 ++++++ src/test/data/script_valid.json | 9 ++++++ src/test/script_tests.cpp | 49 +++++++++++++++++++++++++++---- 3 files changed, 62 insertions(+), 5 deletions(-) diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index 75de4716f8..6c13fdf175 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -1,4 +1,13 @@ [ +[" +Format is: [scriptPubKey, scriptSig, flags, ... comments] +It is evaluated as if there was a crediting coinbase transaction with two 0 +pushes as scriptSig, and one output of 0 satoshi and given scriptPubKey, +followed by a spending transaction which spends this output as only input (and +correct prevout hash), using the given scriptSig. All nLockTimes are 0, all +nSequences are max. +"], + ["", "DEPTH", "P2SH,STRICTENC", "Test the test: we should have an empty stack after scriptSig evaluation"], [" ", "DEPTH", "P2SH,STRICTENC", "and multiple spaces should not change that."], [" ", "DEPTH", "P2SH,STRICTENC"], diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index c1db4c6061..7fa74c1ca3 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -1,4 +1,13 @@ [ +[" +Format is: [scriptPubKey, scriptSig, flags, ... comments] +It is evaluated as if there was a crediting coinbase transaction with two 0 +pushes as scriptSig, and one output of 0 satoshi and given scriptPubKey, +followed by a spending transaction which spends this output as only input (and +correct prevout hash), using the given scriptSig. All nLockTimes are 0, all +nSequences are max. +"], + ["", "DEPTH 0 EQUAL", "P2SH,STRICTENC", "Test the test: we should have an empty stack after scriptSig evaluation"], [" ", "DEPTH 0 EQUAL", "P2SH,STRICTENC", "and multiple spaces should not change that."], [" ", "DEPTH 0 EQUAL", "P2SH,STRICTENC"], diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index cb543a0cf1..178b35fa2d 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -52,6 +52,41 @@ read_json(const std::string& jsondata) BOOST_AUTO_TEST_SUITE(script_tests) +CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey) +{ + CMutableTransaction txCredit; + txCredit.nVersion = 1; + txCredit.nLockTime = 0; + txCredit.vin.resize(1); + txCredit.vout.resize(1); + txCredit.vin[0].prevout.SetNull(); + txCredit.vin[0].scriptSig = CScript() << CScriptNum(0) << CScriptNum(0); + txCredit.vin[0].nSequence = std::numeric_limits::max(); + txCredit.vout[0].scriptPubKey = scriptPubKey; + txCredit.vout[0].nValue = 0; + + return txCredit; +} + +CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CScript& scriptPubKey) +{ + CMutableTransaction txCredit = BuildCreditingTransaction(scriptPubKey); + + CMutableTransaction txSpend; + txSpend.nVersion = 1; + txSpend.nLockTime = 0; + txSpend.vin.resize(1); + txSpend.vout.resize(1); + txSpend.vin[0].prevout.hash = txCredit.GetHash(); + txSpend.vin[0].prevout.n = 0; + txSpend.vin[0].scriptSig = scriptSig; + txSpend.vin[0].nSequence = std::numeric_limits::max(); + txSpend.vout[0].scriptPubKey = CScript(); + txSpend.vout[0].nValue = 0; + + return txSpend; +} + BOOST_AUTO_TEST_CASE(script_valid) { // Read tests from test/data/script_valid.json @@ -67,7 +102,9 @@ BOOST_AUTO_TEST_CASE(script_valid) string strTest = write_string(tv, false); if (test.size() < 3) // Allow size > 3; extra stuff ignored (useful for comments) { - BOOST_ERROR("Bad test: " << strTest); + if (test.size() != 1) { + BOOST_ERROR("Bad test: " << strTest); + } continue; } string scriptSigString = test[0].get_str(); @@ -77,7 +114,7 @@ BOOST_AUTO_TEST_CASE(script_valid) unsigned int scriptflags = ParseScriptFlags(test[2].get_str()); CTransaction tx; - BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, tx, 0, scriptflags), strTest); + BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, BuildSpendingTransaction(scriptSig, scriptPubKey), 0, scriptflags), strTest); } } @@ -90,9 +127,11 @@ BOOST_AUTO_TEST_CASE(script_invalid) { Array test = tv.get_array(); string strTest = write_string(tv, false); - if (test.size() < 2) // Allow size > 2; extra stuff ignored (useful for comments) + if (test.size() < 3) // Allow size > 3; extra stuff ignored (useful for comments) { - BOOST_ERROR("Bad test: " << strTest); + if (test.size() != 1) { + BOOST_ERROR("Bad test: " << strTest); + } continue; } string scriptSigString = test[0].get_str(); @@ -102,7 +141,7 @@ BOOST_AUTO_TEST_CASE(script_invalid) unsigned int scriptflags = ParseScriptFlags(test[2].get_str()); CTransaction tx; - BOOST_CHECK_MESSAGE(!VerifyScript(scriptSig, scriptPubKey, tx, 0, scriptflags), strTest); + BOOST_CHECK_MESSAGE(!VerifyScript(scriptSig, scriptPubKey, BuildSpendingTransaction(scriptSig, scriptPubKey), 0, scriptflags), strTest); } } From c8589bf99e7d4b352763905e56799a03adda25a7 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 20 Sep 2014 03:13:04 +0200 Subject: [PATCH 0735/1288] Add actual signature tests --- src/test/data/script_invalid.json | 18 +++++++++++++++++- src/test/data/script_valid.json | 17 ++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index 6c13fdf175..401031ad12 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -382,5 +382,21 @@ nSequences are max. ["0 0x01 0x50", "HASH160 0x14 0xece424a6bb6ddf4db592c0faed60685047a361b1 EQUAL", "P2SH,STRICTENC", "OP_RESERVED in P2SH should fail"], ["0 0x01 VER", "HASH160 0x14 0x0f4d7845db968f2a81b530b6f3c1d6246d4c7e01 EQUAL", "P2SH,STRICTENC", "OP_VER in P2SH should fail"], -["0x00", "'00' EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"] +["0x00", "'00' EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"], + +["0x48 0x3045022100ea4d62e1fb351ad977596457bb01dfce58e050541784277bd825c33bd98c2a9502203003347cf04573be4dc786c3fc5e7db09821565bf45c7d60160709b962f0398401 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH,STRICTENC", "Normal pay to pubkeyhash with wrong signature"], +["0x47 0x304402207d09de5e34968c3f8b27d8217f173629f1106ee5216aa11d6b1f9813b3a214060220610a6ed25c704f901c6278f4f57fb11eadefdf0b22df298cfb6ce7ea84c86bf401 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH,STRICTENC", "Normal pay to pubkeyhash using an anyonecanpay sighash"], +["0x47 0x3044022028686fb3c8d3e5068cc9924c494fb5026df201d23340896da62fe9bb73fd9d5f02202a239609524959c4ca3651fd0cc48245b0b240862146fc579f3a962a4f46942b01", "0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKSIG", "P2SH,STRICTENC", "Normal pay to pubkey with wrong signature"], +["0x47 0x3044022054cb0a3fca8694a0c231848ed9f965078148fd653e49dd4b6981fadac0f5ba0702204085be5af427d4561f13a07fd5a1c5ab0ff02126e9ba191448f5a9dae0da585301 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x19 0x76a914751e76e8199196d454941c45d1b3a323f1433bd688ac", "HASH160 0x14 0xcd7b44d0b03f2d026d1e586d7ae18903b0d385f6 EQUAL", "P2SH,STRICTENC", "P2SH with a pay to pubkeyhash inside with wrong signature"], +["0 0x48 0x3045022100e1c4e8800bd00c9ec3cd3df0e53e63bc5e8c018d0b68099a652f0b121f1a7e020220108dab275be7d1358530d3451d48aed747af77cc54e0423cbae5c572b2e1abb801", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG", "P2SH,STRICTENC", "Raw multisig with one pubkey with wrong signature"], +["0x49 0x304602220000ea4d62e1fb351ad977596457bb01dfce58e050541774277bd825c33bd98c2a9502203003347cf04573be4dc786c3fc5e7db09821565bf45c7d60160709b962f0398401 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH,STRICTENC", "Normal pay to pubkeyhash with non-DER signature (too much R padding)"], +["0x47 0x30440220ea4d62e1fb351ad977596457bb01dfce58e050541774277bd825c33bd98c2a9502203003347cf04573be4dc786c3fc5e7db09821565bf45c7d60160709b962f0398401 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH,STRICTENC", "Normal pay to pubkeyhash with non-DER signature (too little R padding)"], +["0x49 0x3046022100ea4d62e1fb351ad977596457bb01dfce58e050541774277bd825c33bd98c2a950221003003347cf04573be4dc786c3fc5e7db09821565bf45c7d60160709b962f0398401 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH,STRICTENC", "Normal pay to pubkeyhash with non-DER signature (too much S padding)"], +["0x48 0x3045022100e6eda3fd34862078233463cae19f0b47995e3f892102e5b175175e92a9163cc402204bf58445819093638481084322b61a2d49b68c96fd6fea17ed494722d0d67b4f01", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "P2SH,STRICTENC", "Pay to pubkey with hybrid pubkey encoding"], +["0x48 0x304502203b56d65863e0cdb89313043c2402f46f518c31658648151b01ec6b5b6c89206a022100d71efefb4c24fab36abb44ade106963d8114c5af1bda033faa1923f54ec4ea6a01", "0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKSIG", "P2SH,STRICTENC,LOW_S", "Pay to pubkey with high S"], +["0x47 0x3044022054cb0a3fca8694a0c231848fd9f965078148fd653e49dd4b6980fadac0f5ba0702204085be5af427d4561f13a07fd5a1c5ab0ff02126e9ba191448f5a9dae0da585301 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x19 0x76a914751e76e8199196d454941c45d1b3a323f1433bd688ac", "HASH160 0x14 0xcd7b44d0b03f2d026d1e586d7ae18903b0d385f6 EQUAL", "P2SH,STRICTENC", "P2SH with a pay to pubkeyhash inside with invalid signature"], +["1 0x48 0x3045022100e1c4e8800bd00c9ec3cd3de0e53e63bc5e8c018d0b68099a652f0b121f1a7e020220108dab275be7d1358530d3451d48aed747af77cc54e0423cbae5c572b2e1abb801", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG", "P2SH,STRICTENC,NULLDUMMY", "Raw multisig with one pubkey with non-zero dummy"], + +["The End"] + ] diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index 7fa74c1ca3..e0b527996c 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -527,5 +527,20 @@ nSequences are max. "P2SH,STRICTENC", "Basic PUSHDATA1 signedness check"], -["0x00", "SIZE 0 EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"] +["0x00", "SIZE 0 EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"], + +["0x48 0x3045022100ea4d62e1fb351ad977596457bb01dfce58e050541774277bd825c33bd98c2a9502203003347cf04573be4dc786c3fc5e7db09821565bf45c7d60160709b962f0398401 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH,STRICTENC", "Normal pay to pubkeyhash"], +["0x47 0x304402207d09de5e34968c3f8b27d8217f173629f1106ee5216aa11d6b1f9813b3a214060220610a6ed25c704f901c6278f4f57fb11eadefdf0b22df298cfb6ce7ea84c86bf481 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH,STRICTENC", "Anyonecanpay pay to pubkeyhash"], +["0x47 0x3044022028686fb3c8d3e5069cc9924c494fb5026df201d23340896da62fe9bb73fd9d5f02202a239609524959c4ca3651fd0cc48245b0b240862146fc579f3a962a4f46942b01", "0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKSIG", "P2SH,STRICTENC", "Normal pay to pubkey"], +["0x47 0x3044022054cb0a3fca8694a0c231848ed9f965078148fd653e49dd4b6980fadac0f5ba0702204085be5af427d4561f13a07fd5a1c5ab0ff02126e9ba191448f5a9dae0da585301 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x19 0x76a914751e76e8199196d454941c45d1b3a323f1433bd688ac", "HASH160 0x14 0xcd7b44d0b03f2d026d1e586d7ae18903b0d385f6 EQUAL", "P2SH,STRICTENC", "P2SH with a pay to pubkeyhash inside"], +["0 0x48 0x3045022100e1c4e8800bd00c9ec3cd3de0e53e63bc5e8c018d0b68099a652f0b121f1a7e020220108dab275be7d1358530d3451d48aed747af77cc54e0423cbae5c572b2e1abb801", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG", "P2SH,STRICTENC", "Raw multisig with one pubkey"], +["0x49 0x304602220000ea4d62e1fb351ad977596457bb01dfce58e050541774277bd825c33bd98c2a9502203003347cf04573be4dc786c3fc5e7db09821565bf45c7d60160709b962f0398401 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH", "Normal pay to pubkeyhash with non-DER signature (too much R padding)"], +["0x47 0x30440220ea4d62e1fb351ad977596457bb01dfce58e050541774277bd825c33bd98c2a9502203003347cf04573be4dc786c3fc5e7db09821565bf45c7d60160709b962f0398401 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH", "Normal pay to pubkeyhash with non-DER signature (too little R padding)"], +["0x49 0x3046022100ea4d62e1fb351ad977596457bb01dfce58e050541774277bd825c33bd98c2a950221003003347cf04573be4dc786c3fc5e7db09821565bf45c7d60160709b962f0398401 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH", "Normal pay to pubkeyhash with non-DER signature (too much S padding)"], +["0x48 0x3045022100e6eda3fd34862078233463cae19f0b47995e3f892102e5b175175e92a9163cc402204bf58445819093638481084322b61a2d49b68c96fd6fea17ed494722d0d67b4f01", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "P2SH", "Pay to pubkey with hybrid pubkey encoding"], +["0x48 0x304502203b56d65863e0cdb89313043c2402f46f518c31658648151b01ec6b5b6c89206a022100d71efefb4c24fab36abb44ade106963d8114c5af1bda033faa1923f54ec4ea6a01", "0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKSIG", "P2SH,STRICTENC", "Pay to pubkey with high S"], +["0x47 0x3044022054cb0a3fca8694a0c231848fd9f965078148fd653e49dd4b6980fadac0f5ba0702204085be5af427d4561f13a07fd5a1c5ab0ff02126e9ba191448f5a9dae0da585301 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x19 0x76a914751e76e8199196d454941c45d1b3a323f1433bd688ac", "HASH160 0x14 0xcd7b44d0b03f2d026d1e586d7ae18903b0d385f6 EQUAL", "STRICTENC", "P2SH with a pay to pubkeyhash inside with invalid signature"], +["1 0x48 0x3045022100e1c4e8800bd00c9ec3cd3de0e53e63bc5e8c018d0b68099a652f0b121f1a7e020220108dab275be7d1358530d3451d48aed747af77cc54e0423cbae5c572b2e1abb801", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG", "P2SH,STRICTENC", "Raw multisig with one pubkey with non-zero dummy"], + +["The End"] ] From bb26e2c896a92b7d9376e2a903ebc9a1825b92d8 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 22 Sep 2014 15:48:34 +0200 Subject: [PATCH 0736/1288] [Qt] minor changes in splashscreen.cpp - guard an unused variable with Q_UNUSED() macro - remove a commented out line of code --- src/qt/splashscreen.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 673e984691..4fe610794f 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -22,8 +22,6 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, bool isTestNet) : QWidget(0, f), curAlignment(0) { - //setAutoFillBackground(true); - // set reference point, paddings int paddingRight = 50; int paddingTop = 50; @@ -114,6 +112,7 @@ SplashScreen::~SplashScreen() void SplashScreen::slotFinish(QWidget *mainWin) { + Q_UNUSED(mainWin); hide(); } @@ -180,4 +179,3 @@ void SplashScreen::closeEvent(QCloseEvent *event) { event->ignore(); } - From 2027450d4270afdde691f71231f5c81282c2e711 Mon Sep 17 00:00:00 2001 From: Alexander Jeng Date: Sun, 21 Sep 2014 23:13:18 -0700 Subject: [PATCH 0737/1288] Grammar fixes in README Github-Pull: #4956 --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 43be738c62..d13011d6dc 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ CXXFLAGS="-g -ggdb -O0" or whatever debug flags you need. **debug.log** If the code is behaving strangely, take a look in the debug.log file in the data directory; -error and debugging message are written there. +error and debugging messages are written there. The -debug=... command-line option controls debugging; running with just -debug will turn on all categories (and give you a very large debug.log file). @@ -111,12 +111,12 @@ Run with the -testnet option to run with "play bitcoins" on the test network, if are testing multi-machine code that needs to operate across the internet. If you are testing something that can run on one machine, run with the -regtest option. -In regression test mode blocks can be created on-demand; see qa/rpc-tests/ for tests +In regression test mode, blocks can be created on-demand; see qa/rpc-tests/ for tests that run in -regest mode. **DEBUG_LOCKORDER** Bitcoin Core is a multithreaded application, and deadlocks or other multithreading bugs can be very difficult to track down. Compiling with -DDEBUG_LOCKORDER (configure -CXXFLAGS="-DDEBUG_LOCKORDER -g") inserts run-time checks to keep track of what locks -are held, and adds warning to the debug.log file if inconsistencies are detected. +CXXFLAGS="-DDEBUG_LOCKORDER -g") inserts run-time checks to keep track of which locks +are held, and adds warnings to the debug.log file if inconsistencies are detected. From 6f3ae9b5df1a65c47aeb221afcf079b0fae566d4 Mon Sep 17 00:00:00 2001 From: ENikS Date: Mon, 22 Sep 2014 16:24:42 -0400 Subject: [PATCH 0738/1288] Fixing out of bounds error in GetKey() --- src/base58.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/base58.cpp b/src/base58.cpp index 9750f0a161..d94db2c51b 100644 --- a/src/base58.cpp +++ b/src/base58.cpp @@ -288,7 +288,8 @@ void CBitcoinSecret::SetKey(const CKey& vchSecret) CKey CBitcoinSecret::GetKey() { CKey ret; - ret.Set(&vchData[0], &vchData[32], vchData.size() > 32 && vchData[32] == 1); + assert(vchData.size() >= 32); + ret.Set(vchData.begin(), vchData.begin() + 32, vchData.size() > 32 && vchData[32] == 1); return ret; } From c8063b57124600ae4e8e2a65eab402d3c47babe2 Mon Sep 17 00:00:00 2001 From: ENikS Date: Tue, 23 Sep 2014 11:17:43 -0400 Subject: [PATCH 0739/1288] Fixing out of bounds asses error --- src/test/crypto_tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/crypto_tests.cpp b/src/test/crypto_tests.cpp index a3eec270ee..68232a2ff1 100644 --- a/src/test/crypto_tests.cpp +++ b/src/test/crypto_tests.cpp @@ -32,7 +32,7 @@ void TestVector(const Hasher &h, const In &in, const Out &out) { size_t len = insecure_rand() % ((in.size() - pos + 1) / 2 + 1); hasher.Write((unsigned char*)&in[pos], len); pos += len; - if (pos > 0 && pos + 2 * out.size() > in.size()) { + if (pos > 0 && pos + 2 * out.size() > in.size() && pos < in.size()) { // Test that writing the rest at once to a copy of a hasher works. Hasher(hasher).Write((unsigned char*)&in[pos], in.size() - pos).Finalize(&hash[0]); BOOST_CHECK(hash == out); From 459a2d25e0c91d1650974900a902285bedb85f39 Mon Sep 17 00:00:00 2001 From: ENikS Date: Tue, 23 Sep 2014 11:54:12 -0400 Subject: [PATCH 0740/1288] Avoiding referencing elements of an empty vector --- src/hash.cpp | 69 +++++++++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/src/hash.cpp b/src/hash.cpp index 4ce4da4c30..218607a6fd 100644 --- a/src/hash.cpp +++ b/src/hash.cpp @@ -9,46 +9,49 @@ unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector 0) + { + const uint32_t c1 = 0xcc9e2d51; + const uint32_t c2 = 0x1b873593; - const int nblocks = vDataToHash.size() / 4; + const int nblocks = vDataToHash.size() / 4; - //---------- - // body - const uint32_t* blocks = (const uint32_t*)(&vDataToHash[0] + nblocks * 4); + //---------- + // body + const uint32_t* blocks = (const uint32_t*)(&vDataToHash[0] + nblocks * 4); - for (int i = -nblocks; i; i++) { - uint32_t k1 = blocks[i]; + for (int i = -nblocks; i; i++) { + uint32_t k1 = blocks[i]; - k1 *= c1; - k1 = ROTL32(k1, 15); - k1 *= c2; + k1 *= c1; + k1 = ROTL32(k1, 15); + k1 *= c2; - h1 ^= k1; - h1 = ROTL32(h1, 13); - h1 = h1 * 5 + 0xe6546b64; + h1 ^= k1; + h1 = ROTL32(h1, 13); + h1 = h1 * 5 + 0xe6546b64; + } + + //---------- + // tail + const uint8_t* tail = (const uint8_t*)(&vDataToHash[0] + nblocks * 4); + + uint32_t k1 = 0; + + switch (vDataToHash.size() & 3) { + case 3: + k1 ^= tail[2] << 16; + case 2: + k1 ^= tail[1] << 8; + case 1: + k1 ^= tail[0]; + k1 *= c1; + k1 = ROTL32(k1, 15); + k1 *= c2; + h1 ^= k1; + }; } - //---------- - // tail - const uint8_t* tail = (const uint8_t*)(&vDataToHash[0] + nblocks * 4); - - uint32_t k1 = 0; - - switch (vDataToHash.size() & 3) { - case 3: - k1 ^= tail[2] << 16; - case 2: - k1 ^= tail[1] << 8; - case 1: - k1 ^= tail[0]; - k1 *= c1; - k1 = ROTL32(k1, 15); - k1 *= c2; - h1 ^= k1; - }; - //---------- // finalization h1 ^= vDataToHash.size(); From f28aec014edd29cfc669cf1c3f795c0f1e2ae7e2 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 3 Sep 2014 09:01:24 +0200 Subject: [PATCH 0741/1288] Use ModifyCoins instead of mutable GetCoins. Replace the mutable non-copying GetCoins method with a ModifyCoins, which returns an encapsulated iterator, so we can keep track of concurrent modifications (as iterators can be invalidated by those) and run cleanup code after a modification is finished. This also removes the overloading of the 'GetCoins' name. --- src/bitcoin-tx.cpp | 18 +++++++------- src/coins.cpp | 36 +++++++++++++++++++--------- src/coins.h | 49 +++++++++++++++++++++++++++++++++++---- src/main.cpp | 49 ++++++++++++++++++--------------------- src/rpcrawtransaction.cpp | 18 +++++++------- 5 files changed, 108 insertions(+), 62 deletions(-) diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index b6e7a6c540..4d6dbc1dfc 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -384,21 +384,19 @@ static void MutateTxSign(CMutableTransaction& tx, const string& flagStr) vector pkData(ParseHexUV(prevOut, "scriptPubKey")); CScript scriptPubKey(pkData.begin(), pkData.end()); - CCoins coins; - if (view.GetCoins(txid, coins)) { - if (coins.IsAvailable(nOut) && coins.vout[nOut].scriptPubKey != scriptPubKey) { + { + CCoinsModifier coins = view.ModifyCoins(txid); + if (coins->IsAvailable(nOut) && coins->vout[nOut].scriptPubKey != scriptPubKey) { string err("Previous output scriptPubKey mismatch:\n"); - err = err + coins.vout[nOut].scriptPubKey.ToString() + "\nvs:\n"+ + err = err + coins->vout[nOut].scriptPubKey.ToString() + "\nvs:\n"+ scriptPubKey.ToString(); throw runtime_error(err); } - // what todo if txid is known, but the actual output isn't? + if ((unsigned int)nOut >= coins->vout.size()) + coins->vout.resize(nOut+1); + coins->vout[nOut].scriptPubKey = scriptPubKey; + coins->vout[nOut].nValue = 0; // we don't know the actual output value } - if ((unsigned int)nOut >= coins.vout.size()) - coins.vout.resize(nOut+1); - coins.vout[nOut].scriptPubKey = scriptPubKey; - coins.vout[nOut].nValue = 0; // we don't know the actual output value - view.SetCoins(txid, coins); // if redeemScript given and private keys given, // add redeemScript to the tempKeystore so it can be signed: diff --git a/src/coins.cpp b/src/coins.cpp index 34485db2bd..2b93c74c3a 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -73,7 +73,7 @@ bool CCoinsViewBacked::GetStats(CCoinsStats &stats) const { return base->GetStat CCoinsKeyHasher::CCoinsKeyHasher() : salt(GetRandHash()) {} -CCoinsViewCache::CCoinsViewCache(CCoinsView &baseIn, bool fDummy) : CCoinsViewBacked(baseIn), hashBlock(0) { } +CCoinsViewCache::CCoinsViewCache(CCoinsView &baseIn, bool fDummy) : CCoinsViewBacked(baseIn), hasModifier(false), hashBlock(0) { } bool CCoinsViewCache::GetCoins(const uint256 &txid, CCoins &coins) const { if (cacheCoins.count(txid)) { @@ -87,7 +87,12 @@ bool CCoinsViewCache::GetCoins(const uint256 &txid, CCoins &coins) const { return false; } -CCoinsMap::iterator CCoinsViewCache::FetchCoins(const uint256 &txid) { +CCoinsViewCache::~CCoinsViewCache() +{ + assert(!hasModifier); +} + +CCoinsMap::const_iterator CCoinsViewCache::FetchCoins(const uint256 &txid) const { CCoinsMap::iterator it = cacheCoins.find(txid); if (it != cacheCoins.end()) return it; @@ -99,15 +104,15 @@ CCoinsMap::iterator CCoinsViewCache::FetchCoins(const uint256 &txid) { return ret; } -CCoinsMap::const_iterator CCoinsViewCache::FetchCoins(const uint256 &txid) const { - /* Avoid redundant implementation with the const-cast. */ - return const_cast(this)->FetchCoins(txid); -} - -CCoins &CCoinsViewCache::GetCoins(const uint256 &txid) { - CCoinsMap::iterator it = FetchCoins(txid); - assert(it != cacheCoins.end()); - return it->second; +CCoinsModifier CCoinsViewCache::ModifyCoins(const uint256 &txid) { + assert(!hasModifier); + hasModifier = true; + std::pair ret = cacheCoins.insert(std::make_pair(txid, CCoins())); + if (ret.second) { + if (!base->GetCoins(txid, ret.first->second)) + ret.first->second.Clear(); + } + return CCoinsModifier(*this, ret.first); } const CCoins* CCoinsViewCache::AccessCoins(const uint256 &txid) const { @@ -145,6 +150,7 @@ bool CCoinsViewCache::SetBestBlock(const uint256 &hashBlockIn) { } bool CCoinsViewCache::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlockIn) { + assert(!hasModifier); for (CCoinsMap::iterator it = mapCoins.begin(); it != mapCoins.end();) { cacheCoins[it->first].swap(it->second); CCoinsMap::iterator itOld = it++; @@ -213,3 +219,11 @@ double CCoinsViewCache::GetPriority(const CTransaction &tx, int nHeight) const } return tx.ComputePriority(dResult); } + +CCoinsModifier::CCoinsModifier(CCoinsViewCache& cache_, CCoinsMap::iterator it_) : cache(cache_), it(it_) {} + +CCoinsModifier::~CCoinsModifier() { + assert(cache.hasModifier); + cache.hasModifier = false; + it->second.Cleanup(); +} diff --git a/src/coins.h b/src/coins.h index bf61f55aac..62beea3c23 100644 --- a/src/coins.h +++ b/src/coins.h @@ -83,11 +83,26 @@ public: // as new tx version will probably only be introduced at certain heights int nVersion; - // construct a CCoins from a CTransaction, at a given height - CCoins(const CTransaction &tx, int nHeightIn) : fCoinBase(tx.IsCoinBase()), vout(tx.vout), nHeight(nHeightIn), nVersion(tx.nVersion) { + void FromTx(const CTransaction &tx, int nHeightIn) { + fCoinBase = tx.IsCoinBase(); + vout = tx.vout; + nHeight = nHeightIn; + nVersion = tx.nVersion; ClearUnspendable(); } + // construct a CCoins from a CTransaction, at a given height + CCoins(const CTransaction &tx, int nHeightIn) { + FromTx(tx, nHeightIn); + } + + void Clear() { + fCoinBase = false; + std::vector().swap(vout); + nHeight = 0; + nVersion = 0; + } + // empty constructor CCoins() : fCoinBase(false), vout(0), nHeight(0), nVersion(0) { } @@ -323,10 +338,31 @@ public: }; +class CCoinsViewCache; + +/** A reference to a mutable cache entry. Encapsulating it allows us to run + * cleanup code after the modification is finished, and keeping track of + * concurrent modifications. */ +class CCoinsModifier +{ +private: + CCoinsViewCache& cache; + CCoinsMap::iterator it; + CCoinsModifier(CCoinsViewCache& cache_, CCoinsMap::iterator it_); + +public: + CCoins* operator->() { return &it->second; } + CCoins& operator*() { return it->second; } + ~CCoinsModifier(); + friend class CCoinsViewCache; +}; + /** CCoinsView that adds a memory cache for transactions to another CCoinsView */ class CCoinsViewCache : public CCoinsViewBacked { protected: + /* Whether this cache has an active modifier. */ + bool hasModifier; /* Make mutable so that we can "fill the cache" even from Get-methods declared as "const". */ @@ -335,6 +371,7 @@ protected: public: CCoinsViewCache(CCoinsView &baseIn, bool fDummy = false); + ~CCoinsViewCache(); // Standard CCoinsView methods bool GetCoins(const uint256 &txid, CCoins &coins) const; @@ -349,8 +386,10 @@ public: // allowed while accessing the returned pointer. const CCoins* AccessCoins(const uint256 &txid) const; - // Return a modifiable reference to a CCoins. Check HaveCoins first. - CCoins &GetCoins(const uint256 &txid); + // Return a modifiable reference to a CCoins. If no entry with the given + // txid exists, a new one is created. Simultaneous modifications are not + // allowed. + CCoinsModifier ModifyCoins(const uint256 &txid); // Push the modifications applied to this cache to its base. // Failure to call this method before destruction will cause the changes to be forgotten. @@ -377,6 +416,8 @@ public: const CTxOut &GetOutputFor(const CTxIn& input) const; + friend class CCoinsModifier; + private: CCoinsMap::iterator FetchCoins(const uint256 &txid); CCoinsMap::const_iterator FetchCoins(const uint256 &txid) const; diff --git a/src/main.cpp b/src/main.cpp index 15c3916a6f..5aed3a2528 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1348,22 +1348,18 @@ void static InvalidBlockFound(CBlockIndex *pindex, const CValidationState &state void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight) { - bool ret; // mark inputs spent if (!tx.IsCoinBase()) { txundo.vprevout.reserve(tx.vin.size()); - for (unsigned int i = 0; i < tx.vin.size(); i++) { - const CTxIn &txin = tx.vin[i]; - CCoins &coins = inputs.GetCoins(txin.prevout.hash); + BOOST_FOREACH(const CTxIn &txin, tx.vin) { txundo.vprevout.push_back(CTxInUndo()); - ret = coins.Spend(txin.prevout, txundo.vprevout.back()); + bool ret = inputs.ModifyCoins(txin.prevout.hash)->Spend(txin.prevout, txundo.vprevout.back()); assert(ret); } } // add outputs - ret = inputs.SetCoins(tx.GetHash(), CCoins(tx, nHeight)); - assert(ret); + inputs.ModifyCoins(tx.GetHash())->FromTx(tx, nHeight); } bool CScriptCheck::operator()() const { @@ -1504,21 +1500,23 @@ bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex // exactly. Note that transactions with only provably unspendable outputs won't // have outputs available even in the block itself, so we handle that case // specially with outsEmpty. + { CCoins outsEmpty; - CCoins &outs = view.HaveCoins(hash) ? view.GetCoins(hash) : outsEmpty; - outs.ClearUnspendable(); + CCoinsModifier outs = view.ModifyCoins(hash); + outs->ClearUnspendable(); - CCoins outsBlock = CCoins(tx, pindex->nHeight); + CCoins outsBlock(tx, pindex->nHeight); // The CCoins serialization does not serialize negative numbers. // No network rules currently depend on the version here, so an inconsistency is harmless // but it must be corrected before txout nversion ever influences a network rule. if (outsBlock.nVersion < 0) - outs.nVersion = outsBlock.nVersion; - if (outs != outsBlock) + outs->nVersion = outsBlock.nVersion; + if (*outs != outsBlock) fClean = fClean && error("DisconnectBlock() : added transaction mismatch? database corrupted"); // remove outputs - outs = CCoins(); + outs->Clear(); + } // restore inputs if (i > 0) { // not coinbases @@ -1528,27 +1526,24 @@ bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex for (unsigned int j = tx.vin.size(); j-- > 0;) { const COutPoint &out = tx.vin[j].prevout; const CTxInUndo &undo = txundo.vprevout[j]; - CCoins coins; - view.GetCoins(out.hash, coins); // this can fail if the prevout was already entirely spent + CCoinsModifier coins = view.ModifyCoins(out.hash); if (undo.nHeight != 0) { // undo data contains height: this is the last output of the prevout tx being spent - if (!coins.IsPruned()) + if (!coins->IsPruned()) fClean = fClean && error("DisconnectBlock() : undo data overwriting existing transaction"); - coins = CCoins(); - coins.fCoinBase = undo.fCoinBase; - coins.nHeight = undo.nHeight; - coins.nVersion = undo.nVersion; + coins->Clear(); + coins->fCoinBase = undo.fCoinBase; + coins->nHeight = undo.nHeight; + coins->nVersion = undo.nVersion; } else { - if (coins.IsPruned()) + if (coins->IsPruned()) fClean = fClean && error("DisconnectBlock() : undo data adding output to missing transaction"); } - if (coins.IsAvailable(out.n)) + if (coins->IsAvailable(out.n)) fClean = fClean && error("DisconnectBlock() : undo data overwriting existing output"); - if (coins.vout.size() < out.n+1) - coins.vout.resize(out.n+1); - coins.vout[out.n] = undo.txout; - if (!view.SetCoins(out.hash, coins)) - return error("DisconnectBlock() : cannot restore coin inputs"); + if (coins->vout.size() < out.n+1) + coins->vout.resize(out.n+1); + coins->vout[out.n] = undo.txout; } } } diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index dbb0966ae2..da2421f38e 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -612,21 +612,19 @@ Value signrawtransaction(const Array& params, bool fHelp) vector pkData(ParseHexO(prevOut, "scriptPubKey")); CScript scriptPubKey(pkData.begin(), pkData.end()); - CCoins coins; - if (view.GetCoins(txid, coins)) { - if (coins.IsAvailable(nOut) && coins.vout[nOut].scriptPubKey != scriptPubKey) { + { + CCoinsModifier coins = view.ModifyCoins(txid); + if (coins->IsAvailable(nOut) && coins->vout[nOut].scriptPubKey != scriptPubKey) { string err("Previous output scriptPubKey mismatch:\n"); - err = err + coins.vout[nOut].scriptPubKey.ToString() + "\nvs:\n"+ + err = err + coins->vout[nOut].scriptPubKey.ToString() + "\nvs:\n"+ scriptPubKey.ToString(); throw JSONRPCError(RPC_DESERIALIZATION_ERROR, err); } - // what todo if txid is known, but the actual output isn't? + if ((unsigned int)nOut >= coins->vout.size()) + coins->vout.resize(nOut+1); + coins->vout[nOut].scriptPubKey = scriptPubKey; + coins->vout[nOut].nValue = 0; // we don't know the actual output value } - if ((unsigned int)nOut >= coins.vout.size()) - coins.vout.resize(nOut+1); - coins.vout[nOut].scriptPubKey = scriptPubKey; - coins.vout[nOut].nValue = 0; // we don't know the actual output value - view.SetCoins(txid, coins); // if redeemScript given and not using the local wallet (private keys // given), add redeemScript to the tempKeystore so it can be signed: From c9d1a81ce76737a73c9706e074a4fe8440c8277e Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 3 Sep 2014 09:25:32 +0200 Subject: [PATCH 0742/1288] Get rid of CCoinsView's SetCoins and SetBestBlock. All direct modifications are now done through ModifyCoins, and BatchWrite is used for pushing batches of queued modifications up, so we don't need the low-level SetCoins and SetBestBlock anymore in the top-level CCoinsView class. --- src/coins.cpp | 12 +----------- src/coins.h | 13 ++----------- src/main.cpp | 4 +--- src/test/script_P2SH_tests.cpp | 3 +-- src/test/transaction_tests.cpp | 6 +++--- src/txdb.cpp | 12 ------------ src/txdb.h | 2 -- 7 files changed, 8 insertions(+), 44 deletions(-) diff --git a/src/coins.cpp b/src/coins.cpp index 2b93c74c3a..9632e67f20 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -53,20 +53,16 @@ bool CCoins::Spend(int nPos) { bool CCoinsView::GetCoins(const uint256 &txid, CCoins &coins) const { return false; } -bool CCoinsView::SetCoins(const uint256 &txid, const CCoins &coins) { return false; } bool CCoinsView::HaveCoins(const uint256 &txid) const { return false; } uint256 CCoinsView::GetBestBlock() const { return uint256(0); } -bool CCoinsView::SetBestBlock(const uint256 &hashBlock) { return false; } bool CCoinsView::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { return false; } bool CCoinsView::GetStats(CCoinsStats &stats) const { return false; } CCoinsViewBacked::CCoinsViewBacked(CCoinsView &viewIn) : base(&viewIn) { } bool CCoinsViewBacked::GetCoins(const uint256 &txid, CCoins &coins) const { return base->GetCoins(txid, coins); } -bool CCoinsViewBacked::SetCoins(const uint256 &txid, const CCoins &coins) { return base->SetCoins(txid, coins); } bool CCoinsViewBacked::HaveCoins(const uint256 &txid) const { return base->HaveCoins(txid); } uint256 CCoinsViewBacked::GetBestBlock() const { return base->GetBestBlock(); } -bool CCoinsViewBacked::SetBestBlock(const uint256 &hashBlock) { return base->SetBestBlock(hashBlock); } void CCoinsViewBacked::SetBackend(CCoinsView &viewIn) { base = &viewIn; } bool CCoinsViewBacked::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { return base->BatchWrite(mapCoins, hashBlock); } bool CCoinsViewBacked::GetStats(CCoinsStats &stats) const { return base->GetStats(stats); } @@ -124,11 +120,6 @@ const CCoins* CCoinsViewCache::AccessCoins(const uint256 &txid) const { } } -bool CCoinsViewCache::SetCoins(const uint256 &txid, const CCoins &coins) { - cacheCoins[txid] = coins; - return true; -} - bool CCoinsViewCache::HaveCoins(const uint256 &txid) const { CCoinsMap::const_iterator it = FetchCoins(txid); // We're using vtx.empty() instead of IsPruned here for performance reasons, @@ -144,9 +135,8 @@ uint256 CCoinsViewCache::GetBestBlock() const { return hashBlock; } -bool CCoinsViewCache::SetBestBlock(const uint256 &hashBlockIn) { +void CCoinsViewCache::SetBestBlock(const uint256 &hashBlockIn) { hashBlock = hashBlockIn; - return true; } bool CCoinsViewCache::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlockIn) { diff --git a/src/coins.h b/src/coins.h index 62beea3c23..ce7a79740b 100644 --- a/src/coins.h +++ b/src/coins.h @@ -294,9 +294,6 @@ public: // Retrieve the CCoins (unspent transaction outputs) for a given txid virtual bool GetCoins(const uint256 &txid, CCoins &coins) const; - // Modify the CCoins for a given txid - virtual bool SetCoins(const uint256 &txid, const CCoins &coins); - // Just check whether we have data for a given txid. // This may (but cannot always) return true for fully spent transactions virtual bool HaveCoins(const uint256 &txid) const; @@ -304,10 +301,7 @@ public: // Retrieve the block hash whose state this CCoinsView currently represents virtual uint256 GetBestBlock() const; - // Modify the currently active block hash - virtual bool SetBestBlock(const uint256 &hashBlock); - - // Do a bulk modification (multiple SetCoins + one SetBestBlock). + // Do a bulk modification (multiple CCoins changes + BestBlock change). // The passed mapCoins can be modified. virtual bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock); @@ -328,10 +322,8 @@ protected: public: CCoinsViewBacked(CCoinsView &viewIn); bool GetCoins(const uint256 &txid, CCoins &coins) const; - bool SetCoins(const uint256 &txid, const CCoins &coins); bool HaveCoins(const uint256 &txid) const; uint256 GetBestBlock() const; - bool SetBestBlock(const uint256 &hashBlock); void SetBackend(CCoinsView &viewIn); bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock); bool GetStats(CCoinsStats &stats) const; @@ -375,10 +367,9 @@ public: // Standard CCoinsView methods bool GetCoins(const uint256 &txid, CCoins &coins) const; - bool SetCoins(const uint256 &txid, const CCoins &coins); bool HaveCoins(const uint256 &txid) const; uint256 GetBestBlock() const; - bool SetBestBlock(const uint256 &hashBlock); + void SetBestBlock(const uint256 &hashBlock); bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock); // Return a pointer to CCoins in the cache, or NULL if not found. This is diff --git a/src/main.cpp b/src/main.cpp index 5aed3a2528..af8810ebd6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1753,9 +1753,7 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C return state.Abort(_("Failed to write transaction index")); // add this block to the view's block chain - bool ret; - ret = view.SetBestBlock(pindex->GetBlockHash()); - assert(ret); + view.SetBestBlock(pindex->GetBlockHash()); int64_t nTime3 = GetTimeMicros(); nTimeIndex += nTime3 - nTime2; LogPrint("bench", " - Index writing: %.2fms [%.2fs]\n", 0.001 * (nTime3 - nTime2), nTimeIndex * 0.000001); diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index e6cf00c2d0..645d3c6918 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -312,8 +312,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) txFrom.vout[6].scriptPubKey = GetScriptForDestination(twentySigops.GetID()); txFrom.vout[6].nValue = 6000; - - coins.SetCoins(txFrom.GetHash(), CCoins(txFrom, 0)); + coins.ModifyCoins(txFrom.GetHash())->FromTx(txFrom, 0); CMutableTransaction txTo; txTo.vout.resize(1); diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 41d8ee9f19..15c0034bfb 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -225,7 +225,7 @@ BOOST_AUTO_TEST_CASE(basic_transaction_tests) // paid to a TX_PUBKEYHASH. // static std::vector -SetupDummyInputs(CBasicKeyStore& keystoreRet, CCoinsView & coinsRet) +SetupDummyInputs(CBasicKeyStore& keystoreRet, CCoinsViewCache& coinsRet) { std::vector dummyTransactions; dummyTransactions.resize(2); @@ -244,14 +244,14 @@ SetupDummyInputs(CBasicKeyStore& keystoreRet, CCoinsView & coinsRet) dummyTransactions[0].vout[0].scriptPubKey << key[0].GetPubKey() << OP_CHECKSIG; dummyTransactions[0].vout[1].nValue = 50*CENT; dummyTransactions[0].vout[1].scriptPubKey << key[1].GetPubKey() << OP_CHECKSIG; - coinsRet.SetCoins(dummyTransactions[0].GetHash(), CCoins(dummyTransactions[0], 0)); + coinsRet.ModifyCoins(dummyTransactions[0].GetHash())->FromTx(dummyTransactions[0], 0); dummyTransactions[1].vout.resize(2); dummyTransactions[1].vout[0].nValue = 21*CENT; dummyTransactions[1].vout[0].scriptPubKey = GetScriptForDestination(key[2].GetPubKey().GetID()); dummyTransactions[1].vout[1].nValue = 22*CENT; dummyTransactions[1].vout[1].scriptPubKey = GetScriptForDestination(key[3].GetPubKey().GetID()); - coinsRet.SetCoins(dummyTransactions[1].GetHash(), CCoins(dummyTransactions[1], 0)); + coinsRet.ModifyCoins(dummyTransactions[1].GetHash())->FromTx(dummyTransactions[1], 0); return dummyTransactions; } diff --git a/src/txdb.cpp b/src/txdb.cpp index 79838b6116..3b353ab624 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -33,12 +33,6 @@ bool CCoinsViewDB::GetCoins(const uint256 &txid, CCoins &coins) const { return db.Read(make_pair('c', txid), coins); } -bool CCoinsViewDB::SetCoins(const uint256 &txid, const CCoins &coins) { - CLevelDBBatch batch; - BatchWriteCoins(batch, txid, coins); - return db.WriteBatch(batch); -} - bool CCoinsViewDB::HaveCoins(const uint256 &txid) const { return db.Exists(make_pair('c', txid)); } @@ -50,12 +44,6 @@ uint256 CCoinsViewDB::GetBestBlock() const { return hashBestChain; } -bool CCoinsViewDB::SetBestBlock(const uint256 &hashBlock) { - CLevelDBBatch batch; - BatchWriteHashBestChain(batch, hashBlock); - return db.WriteBatch(batch); -} - bool CCoinsViewDB::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { LogPrint("coindb", "Committing %u changed transactions to coin database...\n", (unsigned int)mapCoins.size()); diff --git a/src/txdb.h b/src/txdb.h index f0b6b9e1dd..8f2bd9af4d 100644 --- a/src/txdb.h +++ b/src/txdb.h @@ -33,10 +33,8 @@ public: CCoinsViewDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false); bool GetCoins(const uint256 &txid, CCoins &coins) const; - bool SetCoins(const uint256 &txid, const CCoins &coins); bool HaveCoins(const uint256 &txid) const; uint256 GetBestBlock() const; - bool SetBestBlock(const uint256 &hashBlock); bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock); bool GetStats(CCoinsStats &stats) const; }; From 058b08c147a6d56b57221faa5b6fcdb83b4140b2 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 3 Sep 2014 09:37:47 +0200 Subject: [PATCH 0743/1288] Do not keep fully spent but unwritten CCoins entries cached. Instead of storing CCoins entries directly in CCoinsMap, store a CCoinsCacheEntry which additionally keeps track of whether a particular entry is: * dirty: potentially different from its parent view. * fresh: the parent view is known to not have a non-pruned version. This allows us to skip non-dirty cache entries when pushing batches of changes up, and to remove CCoins entries about transactions that are fully spent before the parent cache learns about them. --- src/coins.cpp | 85 +++++++++++++++++++++++++++++++++++++-------------- src/coins.h | 19 ++++++++++-- src/main.cpp | 4 +-- src/txdb.cpp | 11 +++++-- 4 files changed, 88 insertions(+), 31 deletions(-) diff --git a/src/coins.cpp b/src/coins.cpp index 9632e67f20..9d60089bf5 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -71,18 +71,6 @@ CCoinsKeyHasher::CCoinsKeyHasher() : salt(GetRandHash()) {} CCoinsViewCache::CCoinsViewCache(CCoinsView &baseIn, bool fDummy) : CCoinsViewBacked(baseIn), hasModifier(false), hashBlock(0) { } -bool CCoinsViewCache::GetCoins(const uint256 &txid, CCoins &coins) const { - if (cacheCoins.count(txid)) { - coins = cacheCoins[txid]; - return true; - } - if (base->GetCoins(txid, coins)) { - cacheCoins[txid] = coins; - return true; - } - return false; -} - CCoinsViewCache::~CCoinsViewCache() { assert(!hasModifier); @@ -93,21 +81,43 @@ CCoinsMap::const_iterator CCoinsViewCache::FetchCoins(const uint256 &txid) const if (it != cacheCoins.end()) return it; CCoins tmp; - if (!base->GetCoins(txid,tmp)) + if (!base->GetCoins(txid, tmp)) return cacheCoins.end(); - CCoinsMap::iterator ret = cacheCoins.insert(it, std::make_pair(txid, CCoins())); - tmp.swap(ret->second); + CCoinsMap::iterator ret = cacheCoins.insert(std::make_pair(txid, CCoinsCacheEntry())).first; + tmp.swap(ret->second.coins); + if (ret->second.coins.IsPruned()) { + // The parent only has an empty entry for this txid; we can consider our + // version as fresh. + ret->second.flags = CCoinsCacheEntry::FRESH; + } return ret; } +bool CCoinsViewCache::GetCoins(const uint256 &txid, CCoins &coins) const { + CCoinsMap::const_iterator it = FetchCoins(txid); + if (it != cacheCoins.end()) { + coins = it->second.coins; + return true; + } + return false; +} + CCoinsModifier CCoinsViewCache::ModifyCoins(const uint256 &txid) { assert(!hasModifier); hasModifier = true; - std::pair ret = cacheCoins.insert(std::make_pair(txid, CCoins())); + std::pair ret = cacheCoins.insert(std::make_pair(txid, CCoinsCacheEntry())); if (ret.second) { - if (!base->GetCoins(txid, ret.first->second)) - ret.first->second.Clear(); + if (!base->GetCoins(txid, ret.first->second.coins)) { + // The parent view does not have this entry; mark it as fresh. + ret.first->second.coins.Clear(); + ret.first->second.flags = CCoinsCacheEntry::FRESH; + } else if (ret.first->second.coins.IsPruned()) { + // The parent view only has a pruned entry for this; mark it as fresh. + ret.first->second.flags = CCoinsCacheEntry::FRESH; + } } + // Assume that whenever ModifyCoins is called, the entry will be modified. + ret.first->second.flags |= CCoinsCacheEntry::DIRTY; return CCoinsModifier(*this, ret.first); } @@ -116,7 +126,7 @@ const CCoins* CCoinsViewCache::AccessCoins(const uint256 &txid) const { if (it == cacheCoins.end()) { return NULL; } else { - return &it->second; + return &it->second.coins; } } @@ -126,7 +136,7 @@ bool CCoinsViewCache::HaveCoins(const uint256 &txid) const { // as we only care about the case where an transaction was replaced entirely // in a reorganization (which wipes vout entirely, as opposed to spending // which just cleans individual outputs). - return (it != cacheCoins.end() && !it->second.vout.empty()); + return (it != cacheCoins.end() && !it->second.coins.vout.empty()); } uint256 CCoinsViewCache::GetBestBlock() const { @@ -142,7 +152,32 @@ void CCoinsViewCache::SetBestBlock(const uint256 &hashBlockIn) { bool CCoinsViewCache::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlockIn) { assert(!hasModifier); for (CCoinsMap::iterator it = mapCoins.begin(); it != mapCoins.end();) { - cacheCoins[it->first].swap(it->second); + if (it->second.flags & CCoinsCacheEntry::DIRTY) { // Ignore non-dirty entries (optimization). + CCoinsMap::iterator itUs = cacheCoins.find(it->first); + if (itUs == cacheCoins.end()) { + if (!it->second.coins.IsPruned()) { + // The parent cache does not have an entry, while the child + // cache does have (a non-pruned) one. Move the data up, and + // mark it as fresh (if the grandparent did have it, we + // would have pulled it in at first GetCoins). + assert(it->second.flags & CCoinsCacheEntry::FRESH); + CCoinsCacheEntry& entry = cacheCoins[it->first]; + entry.coins.swap(it->second.coins); + entry.flags = CCoinsCacheEntry::DIRTY | CCoinsCacheEntry::FRESH; + } + } else { + if ((itUs->second.flags & CCoinsCacheEntry::FRESH) && it->second.coins.IsPruned()) { + // The grandparent does not have an entry, and the child is + // modified and being pruned. This means we can just delete + // it from the parent. + cacheCoins.erase(itUs); + } else { + // A normal modification. + itUs->second.coins.swap(it->second.coins); + itUs->second.flags |= CCoinsCacheEntry::DIRTY; + } + } + } CCoinsMap::iterator itOld = it++; mapCoins.erase(itOld); } @@ -212,8 +247,12 @@ double CCoinsViewCache::GetPriority(const CTransaction &tx, int nHeight) const CCoinsModifier::CCoinsModifier(CCoinsViewCache& cache_, CCoinsMap::iterator it_) : cache(cache_), it(it_) {} -CCoinsModifier::~CCoinsModifier() { +CCoinsModifier::~CCoinsModifier() +{ assert(cache.hasModifier); cache.hasModifier = false; - it->second.Cleanup(); + it->second.coins.Cleanup(); + if ((it->second.flags & CCoinsCacheEntry::FRESH) && it->second.coins.IsPruned()) { + cache.cacheCoins.erase(it); + } } diff --git a/src/coins.h b/src/coins.h index ce7a79740b..71aea79adc 100644 --- a/src/coins.h +++ b/src/coins.h @@ -271,7 +271,20 @@ public: } }; -typedef boost::unordered_map CCoinsMap; +struct CCoinsCacheEntry +{ + CCoins coins; // The actual cached data. + unsigned char flags; + + enum Flags { + DIRTY = (1 << 0), // This cache entry is potentially different from the version in the parent view. + FRESH = (1 << 1), // The parent view does not have this entry (or it is pruned). + }; + + CCoinsCacheEntry() : coins(), flags(0) {} +}; + +typedef boost::unordered_map CCoinsMap; struct CCoinsStats { @@ -343,8 +356,8 @@ private: CCoinsModifier(CCoinsViewCache& cache_, CCoinsMap::iterator it_); public: - CCoins* operator->() { return &it->second; } - CCoins& operator*() { return it->second; } + CCoins* operator->() { return &it->second.coins; } + CCoins& operator*() { return it->second.coins; } ~CCoinsModifier(); friend class CCoinsViewCache; }; diff --git a/src/main.cpp b/src/main.cpp index af8810ebd6..fbe63411d7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1797,10 +1797,10 @@ void static UpdateTip(CBlockIndex *pindexNew) { nTimeBestReceived = GetTime(); mempool.AddTransactionsUpdated(1); - LogPrintf("UpdateTip: new best=%s height=%d log2_work=%.8g tx=%lu date=%s progress=%f\n", + LogPrintf("UpdateTip: new best=%s height=%d log2_work=%.8g tx=%lu date=%s progress=%f cache=%u\n", chainActive.Tip()->GetBlockHash().ToString(), chainActive.Height(), log(chainActive.Tip()->nChainWork.getdouble())/log(2.0), (unsigned long)chainActive.Tip()->nChainTx, DateTimeStrFormat("%Y-%m-%d %H:%M:%S", chainActive.Tip()->GetBlockTime()), - Checkpoints::GuessVerificationProgress(chainActive.Tip())); + Checkpoints::GuessVerificationProgress(chainActive.Tip()), (unsigned int)pcoinsTip->GetCacheSize()); cvBlockChange.notify_all(); diff --git a/src/txdb.cpp b/src/txdb.cpp index 3b353ab624..89830ced73 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -45,17 +45,22 @@ uint256 CCoinsViewDB::GetBestBlock() const { } bool CCoinsViewDB::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { - LogPrint("coindb", "Committing %u changed transactions to coin database...\n", (unsigned int)mapCoins.size()); - CLevelDBBatch batch; + size_t count = 0; + size_t changed = 0; for (CCoinsMap::iterator it = mapCoins.begin(); it != mapCoins.end();) { - BatchWriteCoins(batch, it->first, it->second); + if (it->second.flags & CCoinsCacheEntry::DIRTY) { + BatchWriteCoins(batch, it->first, it->second.coins); + changed++; + } + count++; CCoinsMap::iterator itOld = it++; mapCoins.erase(itOld); } if (hashBlock != uint256(0)) BatchWriteHashBestChain(batch, hashBlock); + LogPrint("coindb", "Committing %u changed transactions (out of %u) to coin database...\n", (unsigned int)changed, (unsigned int)count); return db.WriteBatch(batch); } From ed27e53c9be3c2e194b3e7cff85933531aef4cc8 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 17 Sep 2014 01:27:06 +0200 Subject: [PATCH 0744/1288] Add coins_tests with a large randomized CCoinViewCache test. --- src/Makefile.test.include | 1 + src/test/coins_tests.cpp | 178 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 179 insertions(+) create mode 100644 src/test/coins_tests.cpp diff --git a/src/Makefile.test.include b/src/Makefile.test.include index ab449f3e71..99ac09e1a4 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -44,6 +44,7 @@ BITCOIN_TESTS =\ test/checkblock_tests.cpp \ test/Checkpoints_tests.cpp \ test/compress_tests.cpp \ + test/coins_tests.cpp \ test/crypto_tests.cpp \ test/DoS_tests.cpp \ test/getarg_tests.cpp \ diff --git a/src/test/coins_tests.cpp b/src/test/coins_tests.cpp new file mode 100644 index 0000000000..214aaff900 --- /dev/null +++ b/src/test/coins_tests.cpp @@ -0,0 +1,178 @@ +// Copyright (c) 2014 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "coins.h" +#include "random.h" +#include "uint256.h" + +#include +#include + +#include + +namespace +{ +class CCoinsViewTest : public CCoinsView +{ + uint256 hashBestBlock_; + std::map map_; + +public: + bool GetCoins(const uint256& txid, CCoins& coins) const + { + std::map::const_iterator it = map_.find(txid); + if (it == map_.end()) { + return false; + } + coins = it->second; + if (coins.IsPruned() && insecure_rand() % 2 == 0) { + // Randomly return false in case of an empty entry. + return false; + } + return true; + } + + bool HaveCoins(const uint256& txid) const + { + CCoins coins; + return GetCoins(txid, coins); + } + + uint256 GetBestBlock() const { return hashBestBlock_; } + + bool BatchWrite(CCoinsMap& mapCoins, const uint256& hashBlock) + { + for (CCoinsMap::iterator it = mapCoins.begin(); it != mapCoins.end(); ) { + map_[it->first] = it->second.coins; + if (it->second.coins.IsPruned() && insecure_rand() % 3 == 0) { + // Randomly delete empty entries on write. + map_.erase(it->first); + } + mapCoins.erase(it++); + } + mapCoins.clear(); + hashBestBlock_ = hashBlock; + return true; + } + + bool GetStats(CCoinsStats& stats) const { return false; } +}; +} + +BOOST_AUTO_TEST_SUITE(coins_tests) + +static const unsigned int NUM_SIMULATION_ITERATIONS = 40000; + +// This is a large randomized insert/remove simulation test on a variable-size +// stack of caches on top of CCoinsViewTest. +// +// It will randomly create/update/delete CCoins entries to a tip of caches, with +// txids picked from a limited list of random 256-bit hashes. Occasionally, a +// new tip is added to the stack of caches, or the tip is flushed and removed. +// +// During the process, booleans are kept to make sure that the randomized +// operation hits all branches. +BOOST_AUTO_TEST_CASE(coins_cache_simulation_test) +{ + // Various coverage trackers. + bool removed_all_caches = false; + bool reached_4_caches = false; + bool added_an_entry = false; + bool removed_an_entry = false; + bool updated_an_entry = false; + bool found_an_entry = false; + bool missed_an_entry = false; + + // A simple map to track what we expect the cache stack to represent. + std::map result; + + // The cache stack. + CCoinsViewTest base; // A CCoinsViewTest at the bottom. + std::vector stack; // A stack of CCoinsViewCaches on top. + stack.push_back(new CCoinsViewCache(base, false)); // Start with one cache. + + // Use a limited set of random transaction ids, so we do test overwriting entries. + std::vector txids; + txids.resize(NUM_SIMULATION_ITERATIONS / 8); + for (unsigned int i = 0; i < txids.size(); i++) { + txids[i] = GetRandHash(); + } + + for (unsigned int i = 0; i < NUM_SIMULATION_ITERATIONS; i++) { + // Do a random modification. + { + uint256 txid = txids[insecure_rand() % txids.size()]; // txid we're going to modify in this iteration. + CCoins& coins = result[txid]; + CCoinsModifier entry = stack.back()->ModifyCoins(txid); + BOOST_CHECK(coins == *entry); + if (insecure_rand() % 5 == 0 || coins.IsPruned()) { + if (coins.IsPruned()) { + added_an_entry = true; + } else { + updated_an_entry = true; + } + coins.nVersion = insecure_rand(); + coins.vout.resize(1); + coins.vout[0].nValue = insecure_rand(); + *entry = coins; + } else { + coins.Clear(); + entry->Clear(); + removed_an_entry = true; + } + } + + // Once every 1000 iterations and at the end, verify the full cache. + if (insecure_rand() % 1000 == 1 || i == NUM_SIMULATION_ITERATIONS - 1) { + for (std::map::iterator it = result.begin(); it != result.end(); it++) { + const CCoins* coins = stack.back()->AccessCoins(it->first); + if (coins) { + BOOST_CHECK(*coins == it->second); + found_an_entry = true; + } else { + BOOST_CHECK(it->second.IsPruned()); + missed_an_entry = true; + } + } + } + + if (insecure_rand() % 100 == 0) { + // Every 100 iterations, change the cache stack. + if (stack.size() > 0 && insecure_rand() % 2 == 0) { + stack.back()->Flush(); + delete stack.back(); + stack.pop_back(); + } + if (stack.size() == 0 || (stack.size() < 4 && insecure_rand() % 2)) { + CCoinsView* tip = &base; + if (stack.size() > 0) { + tip = stack.back(); + } else { + removed_all_caches = true; + } + stack.push_back(new CCoinsViewCache(*tip, false)); + if (stack.size() == 4) { + reached_4_caches = true; + } + } + } + } + + // Clean up the stack. + while (stack.size() > 0) { + delete stack.back(); + stack.pop_back(); + } + + // Verify coverage. + BOOST_CHECK(removed_all_caches); + BOOST_CHECK(reached_4_caches); + BOOST_CHECK(added_an_entry); + BOOST_CHECK(removed_an_entry); + BOOST_CHECK(updated_an_entry); + BOOST_CHECK(found_an_entry); + BOOST_CHECK(missed_an_entry); +} + +BOOST_AUTO_TEST_SUITE_END() From cda45b5131c3546b870d8cea3191fb29df182b27 Mon Sep 17 00:00:00 2001 From: ENikS Date: Tue, 23 Sep 2014 18:33:16 -0400 Subject: [PATCH 0745/1288] Reinitializing list's begin iterator after few elements were erased from the head --- src/script/script.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/script.h b/src/script/script.h index 4c9ac74b78..b5336eb997 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -544,7 +544,7 @@ public: { while (end() - pc >= (long)b.size() && memcmp(&pc[0], &b[0], b.size()) == 0) { - erase(pc, pc + b.size()); + pc = erase(pc, pc + b.size()); ++nFound; } } From 7c70438dc67547e83953ba0343a071fae304ce65 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 24 Sep 2014 03:19:04 +0200 Subject: [PATCH 0746/1288] Get rid of the dummy CCoinsViewCache constructor arg --- src/bitcoin-tx.cpp | 2 +- src/coins.cpp | 4 ++-- src/coins.h | 4 ++-- src/init.cpp | 2 +- src/main.cpp | 10 +++++----- src/miner.cpp | 4 ++-- src/rpcblockchain.cpp | 2 +- src/rpcrawtransaction.cpp | 4 ++-- src/test/coins_tests.cpp | 4 ++-- src/test/script_P2SH_tests.cpp | 2 +- src/test/test_bitcoin.cpp | 2 +- src/test/transaction_tests.cpp | 4 ++-- src/txmempool.cpp | 2 +- src/txmempool.h | 2 +- 14 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 4d6dbc1dfc..7ce80a04cb 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -340,7 +340,7 @@ static void MutateTxSign(CMutableTransaction& tx, const string& flagStr) CMutableTransaction mergedTx(txVariants[0]); bool fComplete = true; CCoinsView viewDummy; - CCoinsViewCache view(viewDummy); + CCoinsViewCache view(&viewDummy); if (!registers.count("privatekeys")) throw runtime_error("privatekeys register variable must be set."); diff --git a/src/coins.cpp b/src/coins.cpp index 9d60089bf5..6b7ebf6078 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -59,7 +59,7 @@ bool CCoinsView::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { ret bool CCoinsView::GetStats(CCoinsStats &stats) const { return false; } -CCoinsViewBacked::CCoinsViewBacked(CCoinsView &viewIn) : base(&viewIn) { } +CCoinsViewBacked::CCoinsViewBacked(CCoinsView *viewIn) : base(viewIn) { } bool CCoinsViewBacked::GetCoins(const uint256 &txid, CCoins &coins) const { return base->GetCoins(txid, coins); } bool CCoinsViewBacked::HaveCoins(const uint256 &txid) const { return base->HaveCoins(txid); } uint256 CCoinsViewBacked::GetBestBlock() const { return base->GetBestBlock(); } @@ -69,7 +69,7 @@ bool CCoinsViewBacked::GetStats(CCoinsStats &stats) const { return base->GetStat CCoinsKeyHasher::CCoinsKeyHasher() : salt(GetRandHash()) {} -CCoinsViewCache::CCoinsViewCache(CCoinsView &baseIn, bool fDummy) : CCoinsViewBacked(baseIn), hasModifier(false), hashBlock(0) { } +CCoinsViewCache::CCoinsViewCache(CCoinsView *baseIn) : CCoinsViewBacked(baseIn), hasModifier(false), hashBlock(0) { } CCoinsViewCache::~CCoinsViewCache() { diff --git a/src/coins.h b/src/coins.h index 71aea79adc..4cb28e40c4 100644 --- a/src/coins.h +++ b/src/coins.h @@ -333,7 +333,7 @@ protected: CCoinsView *base; public: - CCoinsViewBacked(CCoinsView &viewIn); + CCoinsViewBacked(CCoinsView *viewIn); bool GetCoins(const uint256 &txid, CCoins &coins) const; bool HaveCoins(const uint256 &txid) const; uint256 GetBestBlock() const; @@ -375,7 +375,7 @@ protected: mutable CCoinsMap cacheCoins; public: - CCoinsViewCache(CCoinsView &baseIn, bool fDummy = false); + CCoinsViewCache(CCoinsView *baseIn); ~CCoinsViewCache(); // Standard CCoinsView methods diff --git a/src/init.cpp b/src/init.cpp index 7299bd0f4a..787b850e74 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -958,7 +958,7 @@ bool AppInit2(boost::thread_group& threadGroup) pblocktree = new CBlockTreeDB(nBlockTreeDBCache, false, fReindex); pcoinsdbview = new CCoinsViewDB(nCoinDBCache, false, fReindex); - pcoinsTip = new CCoinsViewCache(*pcoinsdbview); + pcoinsTip = new CCoinsViewCache(pcoinsdbview); if (fReindex) pblocktree->WriteReindexing(true); diff --git a/src/main.cpp b/src/main.cpp index fbe63411d7..0b3eaafcb1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -896,12 +896,12 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa { CCoinsView dummy; - CCoinsViewCache view(dummy); + CCoinsViewCache view(&dummy); int64_t nValueIn = 0; { LOCK(pool.cs); - CCoinsViewMemPool viewMemPool(*pcoinsTip, pool); + CCoinsViewMemPool viewMemPool(pcoinsTip, pool); view.SetBackend(viewMemPool); // do we already have it? @@ -1835,7 +1835,7 @@ bool static DisconnectTip(CValidationState &state) { // Apply the block atomically to the chain state. int64_t nStart = GetTimeMicros(); { - CCoinsViewCache view(*pcoinsTip, true); + CCoinsViewCache view(pcoinsTip); if (!DisconnectBlock(block, state, pindexDelete, view)) return error("DisconnectTip() : DisconnectBlock %s failed", pindexDelete->GetBlockHash().ToString()); assert(view.Flush()); @@ -1888,7 +1888,7 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock * int64_t nTime3; LogPrint("bench", " - Load block from disk: %.2fms [%.2fs]\n", (nTime2 - nTime1) * 0.001, nTimeReadFromDisk * 0.000001); { - CCoinsViewCache view(*pcoinsTip, true); + CCoinsViewCache view(pcoinsTip); CInv inv(MSG_BLOCK, pindexNew->GetBlockHash()); if (!ConnectBlock(*pblock, state, pindexNew, view)) { if (state.IsInvalid()) @@ -2936,7 +2936,7 @@ bool CVerifyDB::VerifyDB(CCoinsView *coinsview, int nCheckLevel, int nCheckDepth nCheckDepth = chainActive.Height(); nCheckLevel = std::max(0, std::min(4, nCheckLevel)); LogPrintf("Verifying last %i blocks at level %i\n", nCheckDepth, nCheckLevel); - CCoinsViewCache coins(*coinsview, true); + CCoinsViewCache coins(coinsview); CBlockIndex* pindexState = chainActive.Tip(); CBlockIndex* pindexFailure = NULL; int nGoodTransactions = 0; diff --git a/src/miner.cpp b/src/miner.cpp index d05ddbeb1f..010ee844af 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -116,7 +116,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) { LOCK2(cs_main, mempool.cs); CBlockIndex* pindexPrev = chainActive.Tip(); - CCoinsViewCache view(*pcoinsTip, true); + CCoinsViewCache view(pcoinsTip); // Priority order to process transactions list vOrphan; // list memory doesn't move @@ -316,7 +316,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) CBlockIndex indexDummy(*pblock); indexDummy.pprev = pindexPrev; indexDummy.nHeight = pindexPrev->nHeight + 1; - CCoinsViewCache viewNew(*pcoinsTip, true); + CCoinsViewCache viewNew(pcoinsTip); CValidationState state; if (!ConnectBlock(*pblock, state, &indexDummy, viewNew, true)) throw std::runtime_error("CreateNewBlock() : ConnectBlock failed"); diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 4b3beae20c..24175215bf 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -381,7 +381,7 @@ Value gettxout(const Array& params, bool fHelp) CCoins coins; if (fMempool) { LOCK(mempool.cs); - CCoinsViewMemPool view(*pcoinsTip, mempool); + CCoinsViewMemPool view(pcoinsTip, mempool); if (!view.GetCoins(hash, coins)) return Value::null; mempool.pruneSpent(hash, coins); // TODO: this should be done by the CCoinsViewMemPool diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index da2421f38e..a85a6e0ad0 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -557,11 +557,11 @@ Value signrawtransaction(const Array& params, bool fHelp) // Fetch previous transactions (inputs): CCoinsView viewDummy; - CCoinsViewCache view(viewDummy); + CCoinsViewCache view(&viewDummy); { LOCK(mempool.cs); CCoinsViewCache &viewChain = *pcoinsTip; - CCoinsViewMemPool viewMempool(viewChain, mempool); + CCoinsViewMemPool viewMempool(&viewChain, mempool); view.SetBackend(viewMempool); // temporarily switch cache backend to db+mempool view BOOST_FOREACH(const CTxIn& txin, mergedTx.vin) { diff --git a/src/test/coins_tests.cpp b/src/test/coins_tests.cpp index 214aaff900..3ecd301bc7 100644 --- a/src/test/coins_tests.cpp +++ b/src/test/coins_tests.cpp @@ -90,7 +90,7 @@ BOOST_AUTO_TEST_CASE(coins_cache_simulation_test) // The cache stack. CCoinsViewTest base; // A CCoinsViewTest at the bottom. std::vector stack; // A stack of CCoinsViewCaches on top. - stack.push_back(new CCoinsViewCache(base, false)); // Start with one cache. + stack.push_back(new CCoinsViewCache(&base)); // Start with one cache. // Use a limited set of random transaction ids, so we do test overwriting entries. std::vector txids; @@ -151,7 +151,7 @@ BOOST_AUTO_TEST_CASE(coins_cache_simulation_test) } else { removed_all_caches = true; } - stack.push_back(new CCoinsViewCache(*tip, false)); + stack.push_back(new CCoinsViewCache(tip)); if (stack.size() == 4) { reached_4_caches = true; } diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index 645d3c6918..5d962ca3c1 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -255,7 +255,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) { LOCK(cs_main); CCoinsView coinsDummy; - CCoinsViewCache coins(coinsDummy); + CCoinsViewCache coins(&coinsDummy); CBasicKeyStore keystore; CKey key[6]; vector keys; diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 68fad8d038..04f9c708cb 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -41,7 +41,7 @@ struct TestingSetup { mapArgs["-datadir"] = pathTemp.string(); pblocktree = new CBlockTreeDB(1 << 20, true); pcoinsdbview = new CCoinsViewDB(1 << 23, true); - pcoinsTip = new CCoinsViewCache(*pcoinsdbview); + pcoinsTip = new CCoinsViewCache(pcoinsdbview); InitBlockIndex(); #ifdef ENABLE_WALLET bool fFirstRun; diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 15c0034bfb..68f3ebf342 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -260,7 +260,7 @@ BOOST_AUTO_TEST_CASE(test_Get) { CBasicKeyStore keystore; CCoinsView coinsDummy; - CCoinsViewCache coins(coinsDummy); + CCoinsViewCache coins(&coinsDummy); std::vector dummyTransactions = SetupDummyInputs(keystore, coins); CMutableTransaction t1; @@ -295,7 +295,7 @@ BOOST_AUTO_TEST_CASE(test_IsStandard) LOCK(cs_main); CBasicKeyStore keystore; CCoinsView coinsDummy; - CCoinsViewCache coins(coinsDummy); + CCoinsViewCache coins(&coinsDummy); std::vector dummyTransactions = SetupDummyInputs(keystore, coins); CMutableTransaction t; diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 52d07bf6a0..bfa8dbb465 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -630,7 +630,7 @@ void CTxMemPool::ClearPrioritisation(const uint256 hash) } -CCoinsViewMemPool::CCoinsViewMemPool(CCoinsView &baseIn, CTxMemPool &mempoolIn) : CCoinsViewBacked(baseIn), mempool(mempoolIn) { } +CCoinsViewMemPool::CCoinsViewMemPool(CCoinsView *baseIn, CTxMemPool &mempoolIn) : CCoinsViewBacked(baseIn), mempool(mempoolIn) { } bool CCoinsViewMemPool::GetCoins(const uint256 &txid, CCoins &coins) const { // If an entry in the mempool exists, always return that one, as it's guaranteed to never diff --git a/src/txmempool.h b/src/txmempool.h index b9d50ee0bc..9e91e6d48c 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -144,7 +144,7 @@ protected: CTxMemPool &mempool; public: - CCoinsViewMemPool(CCoinsView &baseIn, CTxMemPool &mempoolIn); + CCoinsViewMemPool(CCoinsView *baseIn, CTxMemPool &mempoolIn); bool GetCoins(const uint256 &txid, CCoins &coins) const; bool HaveCoins(const uint256 &txid) const; }; From 584a358997e52a87e8c5402269c7fb3784ed2065 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 16 Sep 2014 00:30:05 +0200 Subject: [PATCH 0747/1288] Do merkle root and txid duplicates check simultaneously Move the txid duplicates check into BuildMerkleTree, where it can be done much more efficiently (without needing to build a full txid set to detect duplicates). The previous version (using the std::set to detect duplicates) was also slightly too weak. A block mined with actual duplicate transactions (which is invalid, due to the inputs of the duplicated transactions being seen as double spends) would trigger the duplicates logic, resulting in the block not being stored on disk, and rerequested. This change fixes that by only triggering in the case of duplicated transactions that can actually result in an identical merkle root. --- src/core.cpp | 53 ++++++++++++++++++++++++++++++++++++++++++++-------- src/core.h | 6 +++++- src/main.cpp | 15 +++++++-------- 3 files changed, 57 insertions(+), 17 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index e52327ba8e..85cca1ebf0 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -224,29 +224,66 @@ uint256 CBlockHeader::GetHash() const return Hash(BEGIN(nVersion), END(nNonce)); } -uint256 CBlock::BuildMerkleTree() const +uint256 CBlock::BuildMerkleTree(bool* fMutated) const { - // WARNING! If you're reading this because you're learning about crypto - // and/or designing a new system that will use merkle trees, keep in mind - // that the following merkle tree algorithm has a serious flaw related to - // duplicate txids, resulting in a vulnerability. (CVE-2012-2459) Bitcoin - // has since worked around the flaw, but for new applications you should - // use something different; don't just copy-and-paste this code without - // understanding the problem first. + /* WARNING! If you're reading this because you're learning about crypto + and/or designing a new system that will use merkle trees, keep in mind + that the following merkle tree algorithm has a serious flaw related to + duplicate txids, resulting in a vulnerability (CVE-2012-2459). + + The reason is that if the number of hashes in the list at a given time + is odd, the last one is duplicated before computing the next level (which + is unusual in Merkle trees). This results in certain sequences of + transactions leading to the same merkle root. For example, these two + trees: + + A A + / \ / \ + B C B C + / \ | / \ / \ + D E F D E F F + / \ / \ / \ / \ / \ / \ / \ + 1 2 3 4 5 6 1 2 3 4 5 6 5 6 + + for transaction lists [1,2,3,4,5,6] and [1,2,3,4,5,6,5,6] (where 5 and + 6 are repeated) result in the same root hash A (because the hash of both + of (F) and (F,F) is C). + + The vulnerability results from being able to send a block with such a + transaction list, with the same merkle root, and the same block hash as + the original without duplication, resulting in failed validation. If the + receiving node proceeds to mark that block as permanently invalid + however, it will fail to accept further unmodified (and thus potentially + valid) versions of the same block. We defend against this by detecting + the case where we would hash two identical hashes at the end of the list + together, and treating that identically to the block having an invalid + merkle root. Assuming no double-SHA256 collisions, this will detect all + known ways of changing the transactions without affecting the merkle + root. + */ vMerkleTree.clear(); + vMerkleTree.reserve(vtx.size() * 2 + 16); // Safe upper bound for the number of total nodes. BOOST_FOREACH(const CTransaction& tx, vtx) vMerkleTree.push_back(tx.GetHash()); int j = 0; + bool mutated = false; for (int nSize = vtx.size(); nSize > 1; nSize = (nSize + 1) / 2) { for (int i = 0; i < nSize; i += 2) { int i2 = std::min(i+1, nSize-1); + if (i2 == i + 1 && i2 + 1 == nSize && vMerkleTree[j+i] == vMerkleTree[j+i2]) { + // Two identical hashes at the end of the list at a particular level. + mutated = true; + } vMerkleTree.push_back(Hash(BEGIN(vMerkleTree[j+i]), END(vMerkleTree[j+i]), BEGIN(vMerkleTree[j+i2]), END(vMerkleTree[j+i2]))); } j += nSize; } + if (fMutated) { + *fMutated = mutated; + } return (vMerkleTree.empty() ? 0 : vMerkleTree.back()); } diff --git a/src/core.h b/src/core.h index 9a2ac47487..de41b8621b 100644 --- a/src/core.h +++ b/src/core.h @@ -528,7 +528,11 @@ public: return block; } - uint256 BuildMerkleTree() const; + // Build the in-memory merkle tree for this block and return the merkle root. + // If non-NULL, *mutated is set to whether mutation was detected in the merkle + // tree (a duplication of transactions in the block leading to an identical + // merkle root). + uint256 BuildMerkleTree(bool* mutated = NULL) const; std::vector GetMerkleBranch(int nIndex) const; static uint256 CheckMerkleBranch(uint256 hash, const std::vector& vMerkleBranch, int nIndex); diff --git a/src/main.cpp b/src/main.cpp index 15c3916a6f..d79644e638 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2289,13 +2289,12 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo if (!CheckTransaction(tx, state)) return error("CheckBlock() : CheckTransaction failed"); - // Check for duplicate txids. This is caught by ConnectInputs(), - // but catching it earlier avoids a potential DoS attack: - set uniqueTx; - BOOST_FOREACH(const CTransaction &tx, block.vtx) { - uniqueTx.insert(tx.GetHash()); - } - if (uniqueTx.size() != block.vtx.size()) + // Check for merkle tree malleability (CVE-2012-2459): repeating sequences + // of transactions in a block without affecting the merkle root of a block, + // while still invalidating it. + bool mutated; + uint256 hashMerkleRoot2 = block.BuildMerkleTree(&mutated); + if (mutated) return state.DoS(100, error("CheckBlock() : duplicate transaction"), REJECT_INVALID, "bad-txns-duplicate", true); @@ -2309,7 +2308,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo REJECT_INVALID, "bad-blk-sigops", true); // Check merkle root - if (fCheckMerkleRoot && block.hashMerkleRoot != block.BuildMerkleTree()) + if (fCheckMerkleRoot && block.hashMerkleRoot != hashMerkleRoot2) return state.DoS(100, error("CheckBlock() : hashMerkleRoot mismatch"), REJECT_INVALID, "bad-txnmrklroot", true); From b498a9493ce55d790307543685d8acc4676a4be6 Mon Sep 17 00:00:00 2001 From: Eric Shaw Date: Wed, 24 Sep 2014 15:13:59 -0400 Subject: [PATCH 0748/1288] Fixed typo in README.md file. "-regest" "-regtest" There was a typo in the README.md file. It previously read "-regest" instead of the proper "-regtest" and it has been updated to the proper reading. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d13011d6dc..cf650fe543 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ are testing multi-machine code that needs to operate across the internet. If you are testing something that can run on one machine, run with the -regtest option. In regression test mode, blocks can be created on-demand; see qa/rpc-tests/ for tests -that run in -regest mode. +that run in -regtest mode. **DEBUG_LOCKORDER** From cf42c36e9963f9cf13704d8d74a9546f0db33d40 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 25 Sep 2014 08:23:32 +0200 Subject: [PATCH 0749/1288] Apply clang-format on crypto/* and compat/* --- src/compat/glibc_compat.cpp | 4 +- src/compat/glibc_sanity.cpp | 14 +- src/compat/glibcxx_compat.cpp | 19 +- src/compat/glibcxx_sanity.cpp | 24 +-- src/crypto/common.h | 55 +++-- src/crypto/ripemd160.cpp | 315 +++++++++++++++++----------- src/crypto/ripemd160.h | 5 +- src/crypto/sha1.cpp | 192 +++++++++--------- src/crypto/sha1.h | 5 +- src/crypto/sha2.cpp | 372 ++++++++++++++++++---------------- src/crypto/sha2.h | 18 +- 11 files changed, 577 insertions(+), 446 deletions(-) diff --git a/src/compat/glibc_compat.cpp b/src/compat/glibc_compat.cpp index 22f82e4259..94c79e4b97 100644 --- a/src/compat/glibc_compat.cpp +++ b/src/compat/glibc_compat.cpp @@ -18,11 +18,11 @@ extern "C" void* memcpy(void* a, const void* b, size_t c) return memmove(a, b, c); } -extern "C" void __chk_fail (void) __attribute__((__noreturn__)); +extern "C" void __chk_fail(void) __attribute__((__noreturn__)); extern "C" FDELT_TYPE __fdelt_warn(FDELT_TYPE a) { if (a >= FD_SETSIZE) - __chk_fail (); + __chk_fail(); return a / __NFDBITS; } extern "C" FDELT_TYPE __fdelt_chk(FDELT_TYPE) __attribute__((weak, alias("__fdelt_warn"))); diff --git a/src/compat/glibc_sanity.cpp b/src/compat/glibc_sanity.cpp index d93602e0fe..acc7809d77 100644 --- a/src/compat/glibc_sanity.cpp +++ b/src/compat/glibc_sanity.cpp @@ -14,10 +14,11 @@ extern "C" void* memcpy(void* a, const void* b, size_t c); void* memcpy_int(void* a, const void* b, size_t c) { - return memcpy(a,b,c); + return memcpy(a, b, c); } -namespace { +namespace +{ // trigger: Use the memcpy_int wrapper which calls our internal memcpy. // A direct call to memcpy may be optimized away by the compiler. // test: Fill an array with a sequence of integers. memcpy to a new empty array. @@ -31,11 +32,10 @@ bool sanity_test_memcpy() for (unsigned int i = 0; i != T; ++i) memcpy_test[i] = i; - memcpy_int(memcpy_verify,memcpy_test,sizeof(memcpy_test)); + memcpy_int(memcpy_verify, memcpy_test, sizeof(memcpy_test)); - for (unsigned int i = 0; i != T; ++i) - { - if(memcpy_verify[i] != i) + for (unsigned int i = 0; i != T; ++i) { + if (memcpy_verify[i] != i) return false; } return true; @@ -51,7 +51,7 @@ bool sanity_test_fdelt() fd_set fds; FD_ZERO(&fds); FD_SET(0, &fds); - return FD_ISSET(0,&fds); + return FD_ISSET(0, &fds); } #endif diff --git a/src/compat/glibcxx_compat.cpp b/src/compat/glibcxx_compat.cpp index cbe059735b..41d8458cb2 100644 --- a/src/compat/glibcxx_compat.cpp +++ b/src/compat/glibcxx_compat.cpp @@ -11,8 +11,8 @@ #define _GLIBCXX_USE_NOEXCEPT throw() #endif -namespace std { - +namespace std +{ const char* bad_exception::what() const throw() { return "std::bad_exception"; @@ -30,9 +30,8 @@ const char* bad_alloc::what() const throw() namespace __detail { -struct _List_node_base -{ - void _M_hook(std::__detail::_List_node_base* const __position) throw () __attribute__((used)) +struct _List_node_base { + void _M_hook(std::__detail::_List_node_base* const __position) throw() __attribute__((used)) { _M_next = __position; _M_prev = __position->_M_prev; @@ -62,9 +61,9 @@ template ostream& __ostream_insert(ostream&, const char*, streamsize); template istream& istream::_M_extract(long&); template istream& istream::_M_extract(unsigned short&); -out_of_range::~out_of_range() _GLIBCXX_USE_NOEXCEPT { } +out_of_range::~out_of_range() _GLIBCXX_USE_NOEXCEPT {} -length_error::~length_error() _GLIBCXX_USE_NOEXCEPT { } +length_error::~length_error() _GLIBCXX_USE_NOEXCEPT {} // Used with permission. // See: https://github.com/madlib/madlib/commit/c3db418c0d34d6813608f2137fef1012ce03043d @@ -85,11 +84,11 @@ void ctype::_M_widen_init() const } } -void __throw_out_of_range_fmt(const char*, ...) __attribute__((__noreturn__)); -void __throw_out_of_range_fmt(const char* err, ...) +void __throw_out_of_range_fmt(const char*, ...) __attribute__((__noreturn__)); +void __throw_out_of_range_fmt(const char* err, ...) { // Safe and over-simplified version. Ignore the format and print it as-is. __throw_out_of_range(err); } -}// namespace std +} // namespace std diff --git a/src/compat/glibcxx_sanity.cpp b/src/compat/glibcxx_sanity.cpp index cd8da4fd67..9b1fefd448 100644 --- a/src/compat/glibcxx_sanity.cpp +++ b/src/compat/glibcxx_sanity.cpp @@ -6,15 +6,15 @@ #include #include -namespace{ - +namespace +{ // trigger: use ctype::widen to trigger ctype::_M_widen_init(). // test: convert a char from narrow to wide and back. Verify that the result // matches the original. bool sanity_test_widen(char testchar) { - const std::ctype& test(std::use_facet< std::ctype >(std::locale())); - return test.narrow(test.widen(testchar),'b') == testchar; + const std::ctype& test(std::use_facet >(std::locale())); + return test.narrow(test.widen(testchar), 'b') == testchar; } // trigger: use list::push_back and list::pop_back to trigger _M_hook and @@ -25,14 +25,13 @@ bool sanity_test_list(unsigned int size) { std::list test; for (unsigned int i = 0; i != size; ++i) - test.push_back(i+1); + test.push_back(i + 1); if (test.size() != size) return false; - while (!test.empty()) - { - if(test.back() != test.size()) + while (!test.empty()) { + if (test.back() != test.size()) return false; test.pop_back(); } @@ -47,15 +46,12 @@ bool sanity_test_list(unsigned int size) bool sanity_test_range_fmt() { std::string test; - try - { + try { test.at(1); - } - catch (const std::out_of_range&) - { + } catch (const std::out_of_range&) { return true; + } catch (...) { } - catch (...){} return false; } diff --git a/src/crypto/common.h b/src/crypto/common.h index 8f675a16c5..7c3d0a135b 100644 --- a/src/crypto/common.h +++ b/src/crypto/common.h @@ -13,7 +13,8 @@ #include #endif -uint32_t static inline ReadLE32(const unsigned char *ptr) { +uint32_t static inline ReadLE32(const unsigned char* ptr) +{ #if HAVE_DECL_LE32TOH == 1 return le32toh(*((uint32_t*)ptr)); #elif !defined(WORDS_BIGENDIAN) @@ -23,8 +24,8 @@ uint32_t static inline ReadLE32(const unsigned char *ptr) { #endif } -uint64_t static inline ReadLE64(const unsigned char *ptr) { - +uint64_t static inline ReadLE64(const unsigned char* ptr) +{ #if HAVE_DECL_LE64TOH == 1 return le64toh(*((uint64_t*)ptr)); #elif !defined(WORDS_BIGENDIAN) @@ -35,28 +36,40 @@ uint64_t static inline ReadLE64(const unsigned char *ptr) { #endif } -void static inline WriteLE32(unsigned char *ptr, uint32_t x) { +void static inline WriteLE32(unsigned char* ptr, uint32_t x) +{ #if HAVE_DECL_HTOLE32 == 1 *((uint32_t*)ptr) = htole32(x); #elif !defined(WORDS_BIGENDIAN) *((uint32_t*)ptr) = x; #else - ptr[3] = x >> 24; ptr[2] = x >> 16; ptr[1] = x >> 8; ptr[0] = x; + ptr[3] = x >> 24; + ptr[2] = x >> 16; + ptr[1] = x >> 8; + ptr[0] = x; #endif } -void static inline WriteLE64(unsigned char *ptr, uint64_t x) { +void static inline WriteLE64(unsigned char* ptr, uint64_t x) +{ #if HAVE_DECL_HTOLE64 == 1 *((uint64_t*)ptr) = htole64(x); #elif !defined(WORDS_BIGENDIAN) *((uint64_t*)ptr) = x; #else - ptr[7] = x >> 56; ptr[6] = x >> 48; ptr[5] = x >> 40; ptr[4] = x >> 32; - ptr[3] = x >> 24; ptr[2] = x >> 16; ptr[1] = x >> 8; ptr[0] = x; + ptr[7] = x >> 56; + ptr[6] = x >> 48; + ptr[5] = x >> 40; + ptr[4] = x >> 32; + ptr[3] = x >> 24; + ptr[2] = x >> 16; + ptr[1] = x >> 8; + ptr[0] = x; #endif } -uint32_t static inline ReadBE32(const unsigned char *ptr) { +uint32_t static inline ReadBE32(const unsigned char* ptr) +{ #if HAVE_DECL_BE32TOH == 1 return be32toh(*((uint32_t*)ptr)); #else @@ -64,7 +77,8 @@ uint32_t static inline ReadBE32(const unsigned char *ptr) { #endif } -uint64_t static inline ReadBE64(const unsigned char *ptr) { +uint64_t static inline ReadBE64(const unsigned char* ptr) +{ #if HAVE_DECL_BE64TOH == 1 return be64toh(*((uint64_t*)ptr)); #else @@ -73,20 +87,31 @@ uint64_t static inline ReadBE64(const unsigned char *ptr) { #endif } -void static inline WriteBE32(unsigned char *ptr, uint32_t x) { +void static inline WriteBE32(unsigned char* ptr, uint32_t x) +{ #if HAVE_DECL_HTOBE32 == 1 *((uint32_t*)ptr) = htobe32(x); #else - ptr[0] = x >> 24; ptr[1] = x >> 16; ptr[2] = x >> 8; ptr[3] = x; + ptr[0] = x >> 24; + ptr[1] = x >> 16; + ptr[2] = x >> 8; + ptr[3] = x; #endif } -void static inline WriteBE64(unsigned char *ptr, uint64_t x) { +void static inline WriteBE64(unsigned char* ptr, uint64_t x) +{ #if HAVE_DECL_HTOBE64 == 1 *((uint64_t*)ptr) = htobe64(x); #else - ptr[0] = x >> 56; ptr[1] = x >> 48; ptr[2] = x >> 40; ptr[3] = x >> 32; - ptr[4] = x >> 24; ptr[5] = x >> 16; ptr[6] = x >> 8; ptr[7] = x; + ptr[0] = x >> 56; + ptr[1] = x >> 48; + ptr[2] = x >> 40; + ptr[3] = x >> 32; + ptr[4] = x >> 24; + ptr[5] = x >> 16; + ptr[6] = x >> 8; + ptr[7] = x; #endif } diff --git a/src/crypto/ripemd160.cpp b/src/crypto/ripemd160.cpp index b5e9f0df49..90b196ba32 100644 --- a/src/crypto/ripemd160.cpp +++ b/src/crypto/ripemd160.cpp @@ -9,11 +9,11 @@ #include // Internal implementation code. -namespace { - +namespace +{ /// Internal RIPEMD-160 implementation. -namespace ripemd160 { - +namespace ripemd160 +{ uint32_t inline f1(uint32_t x, uint32_t y, uint32_t z) { return x ^ y ^ z; } uint32_t inline f2(uint32_t x, uint32_t y, uint32_t z) { return (x & y) | (~x & z); } uint32_t inline f3(uint32_t x, uint32_t y, uint32_t z) { return (x | ~y) ^ z; } @@ -21,7 +21,8 @@ uint32_t inline f4(uint32_t x, uint32_t y, uint32_t z) { return (x & z) | (y & ~ uint32_t inline f5(uint32_t x, uint32_t y, uint32_t z) { return x ^ (y | ~z); } /** Initialize RIPEMD-160 state. */ -void inline Initialize(uint32_t *s) { +void inline Initialize(uint32_t* s) +{ s[0] = 0x67452301ul; s[1] = 0xEFCDAB89ul; s[2] = 0x98BADCFEul; @@ -29,139 +30,223 @@ void inline Initialize(uint32_t *s) { s[4] = 0xC3D2E1F0ul; } -uint32_t inline rol(uint32_t x, int i) { return (x << i) | (x >> (32-i)); } +uint32_t inline rol(uint32_t x, int i) { return (x << i) | (x >> (32 - i)); } -void inline Round(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t f, uint32_t x, uint32_t k, int r) { +void inline Round(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t f, uint32_t x, uint32_t k, int r) +{ a = rol(a + f + x + k, r) + e; c = rol(c, 10); } -void inline R11(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f1(b, c, d), x, 0, r); } -void inline R21(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f2(b, c, d), x, 0x5A827999ul, r); } -void inline R31(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f3(b, c, d), x, 0x6ED9EBA1ul, r); } -void inline R41(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f4(b, c, d), x, 0x8F1BBCDCul, r); } -void inline R51(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f5(b, c, d), x, 0xA953FD4Eul, r); } +void inline R11(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f1(b, c, d), x, 0, r); } +void inline R21(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f2(b, c, d), x, 0x5A827999ul, r); } +void inline R31(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f3(b, c, d), x, 0x6ED9EBA1ul, r); } +void inline R41(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f4(b, c, d), x, 0x8F1BBCDCul, r); } +void inline R51(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f5(b, c, d), x, 0xA953FD4Eul, r); } -void inline R12(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f5(b, c, d), x, 0x50A28BE6ul, r); } -void inline R22(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f4(b, c, d), x, 0x5C4DD124ul, r); } -void inline R32(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f3(b, c, d), x, 0x6D703EF3ul, r); } -void inline R42(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f2(b, c, d), x, 0x7A6D76E9ul, r); } -void inline R52(uint32_t &a, uint32_t b, uint32_t &c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f1(b, c, d), x, 0, r); } +void inline R12(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f5(b, c, d), x, 0x50A28BE6ul, r); } +void inline R22(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f4(b, c, d), x, 0x5C4DD124ul, r); } +void inline R32(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f3(b, c, d), x, 0x6D703EF3ul, r); } +void inline R42(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f2(b, c, d), x, 0x7A6D76E9ul, r); } +void inline R52(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f1(b, c, d), x, 0, r); } /** Perform a RIPEMD-160 transformation, processing a 64-byte chunk. */ -void Transform(uint32_t *s, const unsigned char *chunk) { +void Transform(uint32_t* s, const unsigned char* chunk) +{ uint32_t a1 = s[0], b1 = s[1], c1 = s[2], d1 = s[3], e1 = s[4]; - uint32_t a2 = a1 , b2 = b1 , c2 = c1 , d2 = d1 , e2 = e1 ; - uint32_t w0 = ReadLE32(chunk + 0), w1 = ReadLE32(chunk + 4), w2 = ReadLE32(chunk + 8), w3 = ReadLE32(chunk + 12); - uint32_t w4 = ReadLE32(chunk + 16), w5 = ReadLE32(chunk + 20), w6 = ReadLE32(chunk + 24), w7 = ReadLE32(chunk + 28); - uint32_t w8 = ReadLE32(chunk + 32), w9 = ReadLE32(chunk + 36), w10 = ReadLE32(chunk + 40), w11 = ReadLE32(chunk + 44); + uint32_t a2 = a1, b2 = b1, c2 = c1, d2 = d1, e2 = e1; + uint32_t w0 = ReadLE32(chunk + 0), w1 = ReadLE32(chunk + 4), w2 = ReadLE32(chunk + 8), w3 = ReadLE32(chunk + 12); + uint32_t w4 = ReadLE32(chunk + 16), w5 = ReadLE32(chunk + 20), w6 = ReadLE32(chunk + 24), w7 = ReadLE32(chunk + 28); + uint32_t w8 = ReadLE32(chunk + 32), w9 = ReadLE32(chunk + 36), w10 = ReadLE32(chunk + 40), w11 = ReadLE32(chunk + 44); uint32_t w12 = ReadLE32(chunk + 48), w13 = ReadLE32(chunk + 52), w14 = ReadLE32(chunk + 56), w15 = ReadLE32(chunk + 60); - R11(a1, b1, c1, d1, e1, w0 , 11); R12(a2, b2, c2, d2, e2, w5 , 8); - R11(e1, a1, b1, c1, d1, w1 , 14); R12(e2, a2, b2, c2, d2, w14, 9); - R11(d1, e1, a1, b1, c1, w2 , 15); R12(d2, e2, a2, b2, c2, w7 , 9); - R11(c1, d1, e1, a1, b1, w3 , 12); R12(c2, d2, e2, a2, b2, w0 , 11); - R11(b1, c1, d1, e1, a1, w4 , 5); R12(b2, c2, d2, e2, a2, w9 , 13); - R11(a1, b1, c1, d1, e1, w5 , 8); R12(a2, b2, c2, d2, e2, w2 , 15); - R11(e1, a1, b1, c1, d1, w6 , 7); R12(e2, a2, b2, c2, d2, w11, 15); - R11(d1, e1, a1, b1, c1, w7 , 9); R12(d2, e2, a2, b2, c2, w4 , 5); - R11(c1, d1, e1, a1, b1, w8 , 11); R12(c2, d2, e2, a2, b2, w13, 7); - R11(b1, c1, d1, e1, a1, w9 , 13); R12(b2, c2, d2, e2, a2, w6 , 7); - R11(a1, b1, c1, d1, e1, w10, 14); R12(a2, b2, c2, d2, e2, w15, 8); - R11(e1, a1, b1, c1, d1, w11, 15); R12(e2, a2, b2, c2, d2, w8 , 11); - R11(d1, e1, a1, b1, c1, w12, 6); R12(d2, e2, a2, b2, c2, w1 , 14); - R11(c1, d1, e1, a1, b1, w13, 7); R12(c2, d2, e2, a2, b2, w10, 14); - R11(b1, c1, d1, e1, a1, w14, 9); R12(b2, c2, d2, e2, a2, w3 , 12); - R11(a1, b1, c1, d1, e1, w15, 8); R12(a2, b2, c2, d2, e2, w12, 6); + R11(a1, b1, c1, d1, e1, w0, 11); + R12(a2, b2, c2, d2, e2, w5, 8); + R11(e1, a1, b1, c1, d1, w1, 14); + R12(e2, a2, b2, c2, d2, w14, 9); + R11(d1, e1, a1, b1, c1, w2, 15); + R12(d2, e2, a2, b2, c2, w7, 9); + R11(c1, d1, e1, a1, b1, w3, 12); + R12(c2, d2, e2, a2, b2, w0, 11); + R11(b1, c1, d1, e1, a1, w4, 5); + R12(b2, c2, d2, e2, a2, w9, 13); + R11(a1, b1, c1, d1, e1, w5, 8); + R12(a2, b2, c2, d2, e2, w2, 15); + R11(e1, a1, b1, c1, d1, w6, 7); + R12(e2, a2, b2, c2, d2, w11, 15); + R11(d1, e1, a1, b1, c1, w7, 9); + R12(d2, e2, a2, b2, c2, w4, 5); + R11(c1, d1, e1, a1, b1, w8, 11); + R12(c2, d2, e2, a2, b2, w13, 7); + R11(b1, c1, d1, e1, a1, w9, 13); + R12(b2, c2, d2, e2, a2, w6, 7); + R11(a1, b1, c1, d1, e1, w10, 14); + R12(a2, b2, c2, d2, e2, w15, 8); + R11(e1, a1, b1, c1, d1, w11, 15); + R12(e2, a2, b2, c2, d2, w8, 11); + R11(d1, e1, a1, b1, c1, w12, 6); + R12(d2, e2, a2, b2, c2, w1, 14); + R11(c1, d1, e1, a1, b1, w13, 7); + R12(c2, d2, e2, a2, b2, w10, 14); + R11(b1, c1, d1, e1, a1, w14, 9); + R12(b2, c2, d2, e2, a2, w3, 12); + R11(a1, b1, c1, d1, e1, w15, 8); + R12(a2, b2, c2, d2, e2, w12, 6); - R21(e1, a1, b1, c1, d1, w7 , 7); R22(e2, a2, b2, c2, d2, w6 , 9); - R21(d1, e1, a1, b1, c1, w4 , 6); R22(d2, e2, a2, b2, c2, w11, 13); - R21(c1, d1, e1, a1, b1, w13, 8); R22(c2, d2, e2, a2, b2, w3 , 15); - R21(b1, c1, d1, e1, a1, w1 , 13); R22(b2, c2, d2, e2, a2, w7 , 7); - R21(a1, b1, c1, d1, e1, w10, 11); R22(a2, b2, c2, d2, e2, w0 , 12); - R21(e1, a1, b1, c1, d1, w6 , 9); R22(e2, a2, b2, c2, d2, w13, 8); - R21(d1, e1, a1, b1, c1, w15, 7); R22(d2, e2, a2, b2, c2, w5 , 9); - R21(c1, d1, e1, a1, b1, w3 , 15); R22(c2, d2, e2, a2, b2, w10, 11); - R21(b1, c1, d1, e1, a1, w12, 7); R22(b2, c2, d2, e2, a2, w14, 7); - R21(a1, b1, c1, d1, e1, w0 , 12); R22(a2, b2, c2, d2, e2, w15, 7); - R21(e1, a1, b1, c1, d1, w9 , 15); R22(e2, a2, b2, c2, d2, w8 , 12); - R21(d1, e1, a1, b1, c1, w5 , 9); R22(d2, e2, a2, b2, c2, w12, 7); - R21(c1, d1, e1, a1, b1, w2 , 11); R22(c2, d2, e2, a2, b2, w4 , 6); - R21(b1, c1, d1, e1, a1, w14, 7); R22(b2, c2, d2, e2, a2, w9 , 15); - R21(a1, b1, c1, d1, e1, w11, 13); R22(a2, b2, c2, d2, e2, w1 , 13); - R21(e1, a1, b1, c1, d1, w8 , 12); R22(e2, a2, b2, c2, d2, w2 , 11); + R21(e1, a1, b1, c1, d1, w7, 7); + R22(e2, a2, b2, c2, d2, w6, 9); + R21(d1, e1, a1, b1, c1, w4, 6); + R22(d2, e2, a2, b2, c2, w11, 13); + R21(c1, d1, e1, a1, b1, w13, 8); + R22(c2, d2, e2, a2, b2, w3, 15); + R21(b1, c1, d1, e1, a1, w1, 13); + R22(b2, c2, d2, e2, a2, w7, 7); + R21(a1, b1, c1, d1, e1, w10, 11); + R22(a2, b2, c2, d2, e2, w0, 12); + R21(e1, a1, b1, c1, d1, w6, 9); + R22(e2, a2, b2, c2, d2, w13, 8); + R21(d1, e1, a1, b1, c1, w15, 7); + R22(d2, e2, a2, b2, c2, w5, 9); + R21(c1, d1, e1, a1, b1, w3, 15); + R22(c2, d2, e2, a2, b2, w10, 11); + R21(b1, c1, d1, e1, a1, w12, 7); + R22(b2, c2, d2, e2, a2, w14, 7); + R21(a1, b1, c1, d1, e1, w0, 12); + R22(a2, b2, c2, d2, e2, w15, 7); + R21(e1, a1, b1, c1, d1, w9, 15); + R22(e2, a2, b2, c2, d2, w8, 12); + R21(d1, e1, a1, b1, c1, w5, 9); + R22(d2, e2, a2, b2, c2, w12, 7); + R21(c1, d1, e1, a1, b1, w2, 11); + R22(c2, d2, e2, a2, b2, w4, 6); + R21(b1, c1, d1, e1, a1, w14, 7); + R22(b2, c2, d2, e2, a2, w9, 15); + R21(a1, b1, c1, d1, e1, w11, 13); + R22(a2, b2, c2, d2, e2, w1, 13); + R21(e1, a1, b1, c1, d1, w8, 12); + R22(e2, a2, b2, c2, d2, w2, 11); - R31(d1, e1, a1, b1, c1, w3 , 11); R32(d2, e2, a2, b2, c2, w15, 9); - R31(c1, d1, e1, a1, b1, w10, 13); R32(c2, d2, e2, a2, b2, w5 , 7); - R31(b1, c1, d1, e1, a1, w14, 6); R32(b2, c2, d2, e2, a2, w1 , 15); - R31(a1, b1, c1, d1, e1, w4 , 7); R32(a2, b2, c2, d2, e2, w3 , 11); - R31(e1, a1, b1, c1, d1, w9 , 14); R32(e2, a2, b2, c2, d2, w7 , 8); - R31(d1, e1, a1, b1, c1, w15, 9); R32(d2, e2, a2, b2, c2, w14, 6); - R31(c1, d1, e1, a1, b1, w8 , 13); R32(c2, d2, e2, a2, b2, w6 , 6); - R31(b1, c1, d1, e1, a1, w1 , 15); R32(b2, c2, d2, e2, a2, w9 , 14); - R31(a1, b1, c1, d1, e1, w2 , 14); R32(a2, b2, c2, d2, e2, w11, 12); - R31(e1, a1, b1, c1, d1, w7 , 8); R32(e2, a2, b2, c2, d2, w8 , 13); - R31(d1, e1, a1, b1, c1, w0 , 13); R32(d2, e2, a2, b2, c2, w12, 5); - R31(c1, d1, e1, a1, b1, w6 , 6); R32(c2, d2, e2, a2, b2, w2 , 14); - R31(b1, c1, d1, e1, a1, w13, 5); R32(b2, c2, d2, e2, a2, w10, 13); - R31(a1, b1, c1, d1, e1, w11, 12); R32(a2, b2, c2, d2, e2, w0 , 13); - R31(e1, a1, b1, c1, d1, w5 , 7); R32(e2, a2, b2, c2, d2, w4 , 7); - R31(d1, e1, a1, b1, c1, w12, 5); R32(d2, e2, a2, b2, c2, w13, 5); + R31(d1, e1, a1, b1, c1, w3, 11); + R32(d2, e2, a2, b2, c2, w15, 9); + R31(c1, d1, e1, a1, b1, w10, 13); + R32(c2, d2, e2, a2, b2, w5, 7); + R31(b1, c1, d1, e1, a1, w14, 6); + R32(b2, c2, d2, e2, a2, w1, 15); + R31(a1, b1, c1, d1, e1, w4, 7); + R32(a2, b2, c2, d2, e2, w3, 11); + R31(e1, a1, b1, c1, d1, w9, 14); + R32(e2, a2, b2, c2, d2, w7, 8); + R31(d1, e1, a1, b1, c1, w15, 9); + R32(d2, e2, a2, b2, c2, w14, 6); + R31(c1, d1, e1, a1, b1, w8, 13); + R32(c2, d2, e2, a2, b2, w6, 6); + R31(b1, c1, d1, e1, a1, w1, 15); + R32(b2, c2, d2, e2, a2, w9, 14); + R31(a1, b1, c1, d1, e1, w2, 14); + R32(a2, b2, c2, d2, e2, w11, 12); + R31(e1, a1, b1, c1, d1, w7, 8); + R32(e2, a2, b2, c2, d2, w8, 13); + R31(d1, e1, a1, b1, c1, w0, 13); + R32(d2, e2, a2, b2, c2, w12, 5); + R31(c1, d1, e1, a1, b1, w6, 6); + R32(c2, d2, e2, a2, b2, w2, 14); + R31(b1, c1, d1, e1, a1, w13, 5); + R32(b2, c2, d2, e2, a2, w10, 13); + R31(a1, b1, c1, d1, e1, w11, 12); + R32(a2, b2, c2, d2, e2, w0, 13); + R31(e1, a1, b1, c1, d1, w5, 7); + R32(e2, a2, b2, c2, d2, w4, 7); + R31(d1, e1, a1, b1, c1, w12, 5); + R32(d2, e2, a2, b2, c2, w13, 5); - R41(c1, d1, e1, a1, b1, w1 , 11); R42(c2, d2, e2, a2, b2, w8 , 15); - R41(b1, c1, d1, e1, a1, w9 , 12); R42(b2, c2, d2, e2, a2, w6 , 5); - R41(a1, b1, c1, d1, e1, w11, 14); R42(a2, b2, c2, d2, e2, w4 , 8); - R41(e1, a1, b1, c1, d1, w10, 15); R42(e2, a2, b2, c2, d2, w1 , 11); - R41(d1, e1, a1, b1, c1, w0 , 14); R42(d2, e2, a2, b2, c2, w3 , 14); - R41(c1, d1, e1, a1, b1, w8 , 15); R42(c2, d2, e2, a2, b2, w11, 14); - R41(b1, c1, d1, e1, a1, w12, 9); R42(b2, c2, d2, e2, a2, w15, 6); - R41(a1, b1, c1, d1, e1, w4 , 8); R42(a2, b2, c2, d2, e2, w0 , 14); - R41(e1, a1, b1, c1, d1, w13, 9); R42(e2, a2, b2, c2, d2, w5 , 6); - R41(d1, e1, a1, b1, c1, w3 , 14); R42(d2, e2, a2, b2, c2, w12, 9); - R41(c1, d1, e1, a1, b1, w7 , 5); R42(c2, d2, e2, a2, b2, w2 , 12); - R41(b1, c1, d1, e1, a1, w15, 6); R42(b2, c2, d2, e2, a2, w13, 9); - R41(a1, b1, c1, d1, e1, w14, 8); R42(a2, b2, c2, d2, e2, w9 , 12); - R41(e1, a1, b1, c1, d1, w5 , 6); R42(e2, a2, b2, c2, d2, w7 , 5); - R41(d1, e1, a1, b1, c1, w6 , 5); R42(d2, e2, a2, b2, c2, w10, 15); - R41(c1, d1, e1, a1, b1, w2 , 12); R42(c2, d2, e2, a2, b2, w14, 8); + R41(c1, d1, e1, a1, b1, w1, 11); + R42(c2, d2, e2, a2, b2, w8, 15); + R41(b1, c1, d1, e1, a1, w9, 12); + R42(b2, c2, d2, e2, a2, w6, 5); + R41(a1, b1, c1, d1, e1, w11, 14); + R42(a2, b2, c2, d2, e2, w4, 8); + R41(e1, a1, b1, c1, d1, w10, 15); + R42(e2, a2, b2, c2, d2, w1, 11); + R41(d1, e1, a1, b1, c1, w0, 14); + R42(d2, e2, a2, b2, c2, w3, 14); + R41(c1, d1, e1, a1, b1, w8, 15); + R42(c2, d2, e2, a2, b2, w11, 14); + R41(b1, c1, d1, e1, a1, w12, 9); + R42(b2, c2, d2, e2, a2, w15, 6); + R41(a1, b1, c1, d1, e1, w4, 8); + R42(a2, b2, c2, d2, e2, w0, 14); + R41(e1, a1, b1, c1, d1, w13, 9); + R42(e2, a2, b2, c2, d2, w5, 6); + R41(d1, e1, a1, b1, c1, w3, 14); + R42(d2, e2, a2, b2, c2, w12, 9); + R41(c1, d1, e1, a1, b1, w7, 5); + R42(c2, d2, e2, a2, b2, w2, 12); + R41(b1, c1, d1, e1, a1, w15, 6); + R42(b2, c2, d2, e2, a2, w13, 9); + R41(a1, b1, c1, d1, e1, w14, 8); + R42(a2, b2, c2, d2, e2, w9, 12); + R41(e1, a1, b1, c1, d1, w5, 6); + R42(e2, a2, b2, c2, d2, w7, 5); + R41(d1, e1, a1, b1, c1, w6, 5); + R42(d2, e2, a2, b2, c2, w10, 15); + R41(c1, d1, e1, a1, b1, w2, 12); + R42(c2, d2, e2, a2, b2, w14, 8); - R51(b1, c1, d1, e1, a1, w4 , 9); R52(b2, c2, d2, e2, a2, w12, 8); - R51(a1, b1, c1, d1, e1, w0 , 15); R52(a2, b2, c2, d2, e2, w15, 5); - R51(e1, a1, b1, c1, d1, w5 , 5); R52(e2, a2, b2, c2, d2, w10, 12); - R51(d1, e1, a1, b1, c1, w9 , 11); R52(d2, e2, a2, b2, c2, w4 , 9); - R51(c1, d1, e1, a1, b1, w7 , 6); R52(c2, d2, e2, a2, b2, w1 , 12); - R51(b1, c1, d1, e1, a1, w12, 8); R52(b2, c2, d2, e2, a2, w5 , 5); - R51(a1, b1, c1, d1, e1, w2 , 13); R52(a2, b2, c2, d2, e2, w8 , 14); - R51(e1, a1, b1, c1, d1, w10, 12); R52(e2, a2, b2, c2, d2, w7 , 6); - R51(d1, e1, a1, b1, c1, w14, 5); R52(d2, e2, a2, b2, c2, w6 , 8); - R51(c1, d1, e1, a1, b1, w1 , 12); R52(c2, d2, e2, a2, b2, w2 , 13); - R51(b1, c1, d1, e1, a1, w3 , 13); R52(b2, c2, d2, e2, a2, w13, 6); - R51(a1, b1, c1, d1, e1, w8 , 14); R52(a2, b2, c2, d2, e2, w14, 5); - R51(e1, a1, b1, c1, d1, w11, 11); R52(e2, a2, b2, c2, d2, w0 , 15); - R51(d1, e1, a1, b1, c1, w6 , 8); R52(d2, e2, a2, b2, c2, w3 , 13); - R51(c1, d1, e1, a1, b1, w15, 5); R52(c2, d2, e2, a2, b2, w9 , 11); - R51(b1, c1, d1, e1, a1, w13, 6); R52(b2, c2, d2, e2, a2, w11, 11); + R51(b1, c1, d1, e1, a1, w4, 9); + R52(b2, c2, d2, e2, a2, w12, 8); + R51(a1, b1, c1, d1, e1, w0, 15); + R52(a2, b2, c2, d2, e2, w15, 5); + R51(e1, a1, b1, c1, d1, w5, 5); + R52(e2, a2, b2, c2, d2, w10, 12); + R51(d1, e1, a1, b1, c1, w9, 11); + R52(d2, e2, a2, b2, c2, w4, 9); + R51(c1, d1, e1, a1, b1, w7, 6); + R52(c2, d2, e2, a2, b2, w1, 12); + R51(b1, c1, d1, e1, a1, w12, 8); + R52(b2, c2, d2, e2, a2, w5, 5); + R51(a1, b1, c1, d1, e1, w2, 13); + R52(a2, b2, c2, d2, e2, w8, 14); + R51(e1, a1, b1, c1, d1, w10, 12); + R52(e2, a2, b2, c2, d2, w7, 6); + R51(d1, e1, a1, b1, c1, w14, 5); + R52(d2, e2, a2, b2, c2, w6, 8); + R51(c1, d1, e1, a1, b1, w1, 12); + R52(c2, d2, e2, a2, b2, w2, 13); + R51(b1, c1, d1, e1, a1, w3, 13); + R52(b2, c2, d2, e2, a2, w13, 6); + R51(a1, b1, c1, d1, e1, w8, 14); + R52(a2, b2, c2, d2, e2, w14, 5); + R51(e1, a1, b1, c1, d1, w11, 11); + R52(e2, a2, b2, c2, d2, w0, 15); + R51(d1, e1, a1, b1, c1, w6, 8); + R52(d2, e2, a2, b2, c2, w3, 13); + R51(c1, d1, e1, a1, b1, w15, 5); + R52(c2, d2, e2, a2, b2, w9, 11); + R51(b1, c1, d1, e1, a1, w13, 6); + R52(b2, c2, d2, e2, a2, w11, 11); uint32_t t = s[0]; s[0] = s[1] + c1 + d2; s[1] = s[2] + d1 + e2; s[2] = s[3] + e1 + a2; s[3] = s[4] + a1 + b2; - s[4] = t + b1 + c2; + s[4] = t + b1 + c2; } -} // namespace ripemd160 +} // namespace ripemd160 -} // namespace +} // namespace ////// RIPEMD160 -CRIPEMD160::CRIPEMD160() : bytes(0) { +CRIPEMD160::CRIPEMD160() : bytes(0) +{ ripemd160::Initialize(s); } -CRIPEMD160& CRIPEMD160::Write(const unsigned char *data, size_t len) { - const unsigned char *end = data + len; +CRIPEMD160& CRIPEMD160::Write(const unsigned char* data, size_t len) +{ + const unsigned char* end = data + len; size_t bufsize = bytes % 64; if (bufsize && bufsize + len >= 64) { // Fill the buffer, and process it. @@ -185,20 +270,22 @@ CRIPEMD160& CRIPEMD160::Write(const unsigned char *data, size_t len) { return *this; } -void CRIPEMD160::Finalize(unsigned char hash[OUTPUT_SIZE]) { +void CRIPEMD160::Finalize(unsigned char hash[OUTPUT_SIZE]) +{ static const unsigned char pad[64] = {0x80}; unsigned char sizedesc[8]; WriteLE64(sizedesc, bytes << 3); Write(pad, 1 + ((119 - (bytes % 64)) % 64)); Write(sizedesc, 8); WriteLE32(hash, s[0]); - WriteLE32(hash+4, s[1]); - WriteLE32(hash+8, s[2]); - WriteLE32(hash+12, s[3]); - WriteLE32(hash+16, s[4]); + WriteLE32(hash + 4, s[1]); + WriteLE32(hash + 8, s[2]); + WriteLE32(hash + 12, s[3]); + WriteLE32(hash + 16, s[4]); } -CRIPEMD160& CRIPEMD160::Reset() { +CRIPEMD160& CRIPEMD160::Reset() +{ bytes = 0; ripemd160::Initialize(s); return *this; diff --git a/src/crypto/ripemd160.h b/src/crypto/ripemd160.h index 44bd4879a5..76197543be 100644 --- a/src/crypto/ripemd160.h +++ b/src/crypto/ripemd160.h @@ -9,7 +9,8 @@ #include /** A hasher class for RIPEMD-160. */ -class CRIPEMD160 { +class CRIPEMD160 +{ private: uint32_t s[5]; unsigned char buf[64]; @@ -19,7 +20,7 @@ public: static const size_t OUTPUT_SIZE = 20; CRIPEMD160(); - CRIPEMD160& Write(const unsigned char *data, size_t len); + CRIPEMD160& Write(const unsigned char* data, size_t len); void Finalize(unsigned char hash[OUTPUT_SIZE]); CRIPEMD160& Reset(); }; diff --git a/src/crypto/sha1.cpp b/src/crypto/sha1.cpp index 819abab579..5fbea002d6 100644 --- a/src/crypto/sha1.cpp +++ b/src/crypto/sha1.cpp @@ -9,14 +9,14 @@ #include // Internal implementation code. -namespace { - +namespace +{ /// Internal SHA-1 implementation. -namespace sha1 { - +namespace sha1 +{ /** One round of SHA-1. */ -void inline Round(uint32_t a, uint32_t &b, uint32_t c, uint32_t d, uint32_t &e, - uint32_t f, uint32_t k, uint32_t w) { +void inline Round(uint32_t a, uint32_t& b, uint32_t c, uint32_t d, uint32_t& e, uint32_t f, uint32_t k, uint32_t w) +{ e += ((a << 5) | (a >> 27)) + f + k + w; b = (b << 30) | (b >> 2); } @@ -28,7 +28,8 @@ uint32_t inline f3(uint32_t b, uint32_t c, uint32_t d) { return (b & c) | (d & ( uint32_t inline left(uint32_t x) { return (x << 1) | (x >> 31); } /** Initialize SHA-1 state. */ -void inline Initialize(uint32_t *s) { +void inline Initialize(uint32_t* s) +{ s[0] = 0x67452301ul; s[1] = 0xEFCDAB89ul; s[2] = 0x98BADCFEul; @@ -42,20 +43,21 @@ const uint32_t k3 = 0x8F1BBCDCul; const uint32_t k4 = 0xCA62C1D6ul; /** Perform a SHA-1 transformation, processing a 64-byte chunk. */ -void Transform(uint32_t *s, const unsigned char *chunk) { +void Transform(uint32_t* s, const unsigned char* chunk) +{ uint32_t a = s[0], b = s[1], c = s[2], d = s[3], e = s[4]; uint32_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15; - Round(a, b, c, d, e, f1(b, c, d), k1, w0 = ReadBE32(chunk + 0)); - Round(e, a, b, c, d, f1(a, b, c), k1, w1 = ReadBE32(chunk + 4)); - Round(d, e, a, b, c, f1(e, a, b), k1, w2 = ReadBE32(chunk + 8)); - Round(c, d, e, a, b, f1(d, e, a), k1, w3 = ReadBE32(chunk + 12)); - Round(b, c, d, e, a, f1(c, d, e), k1, w4 = ReadBE32(chunk + 16)); - Round(a, b, c, d, e, f1(b, c, d), k1, w5 = ReadBE32(chunk + 20)); - Round(e, a, b, c, d, f1(a, b, c), k1, w6 = ReadBE32(chunk + 24)); - Round(d, e, a, b, c, f1(e, a, b), k1, w7 = ReadBE32(chunk + 28)); - Round(c, d, e, a, b, f1(d, e, a), k1, w8 = ReadBE32(chunk + 32)); - Round(b, c, d, e, a, f1(c, d, e), k1, w9 = ReadBE32(chunk + 36)); + Round(a, b, c, d, e, f1(b, c, d), k1, w0 = ReadBE32(chunk + 0)); + Round(e, a, b, c, d, f1(a, b, c), k1, w1 = ReadBE32(chunk + 4)); + Round(d, e, a, b, c, f1(e, a, b), k1, w2 = ReadBE32(chunk + 8)); + Round(c, d, e, a, b, f1(d, e, a), k1, w3 = ReadBE32(chunk + 12)); + Round(b, c, d, e, a, f1(c, d, e), k1, w4 = ReadBE32(chunk + 16)); + Round(a, b, c, d, e, f1(b, c, d), k1, w5 = ReadBE32(chunk + 20)); + Round(e, a, b, c, d, f1(a, b, c), k1, w6 = ReadBE32(chunk + 24)); + Round(d, e, a, b, c, f1(e, a, b), k1, w7 = ReadBE32(chunk + 28)); + Round(c, d, e, a, b, f1(d, e, a), k1, w8 = ReadBE32(chunk + 32)); + Round(b, c, d, e, a, f1(c, d, e), k1, w9 = ReadBE32(chunk + 36)); Round(a, b, c, d, e, f1(b, c, d), k1, w10 = ReadBE32(chunk + 40)); Round(e, a, b, c, d, f1(a, b, c), k1, w11 = ReadBE32(chunk + 44)); Round(d, e, a, b, c, f1(e, a, b), k1, w12 = ReadBE32(chunk + 48)); @@ -63,73 +65,73 @@ void Transform(uint32_t *s, const unsigned char *chunk) { Round(b, c, d, e, a, f1(c, d, e), k1, w14 = ReadBE32(chunk + 56)); Round(a, b, c, d, e, f1(b, c, d), k1, w15 = ReadBE32(chunk + 60)); - Round(e, a, b, c, d, f1(a, b, c), k1, w0 = left(w0 ^ w13 ^ w8 ^ w2 )); - Round(d, e, a, b, c, f1(e, a, b), k1, w1 = left(w1 ^ w14 ^ w9 ^ w3 )); - Round(c, d, e, a, b, f1(d, e, a), k1, w2 = left(w2 ^ w15 ^ w10 ^ w4 )); - Round(b, c, d, e, a, f1(c, d, e), k1, w3 = left(w3 ^ w0 ^ w11 ^ w5 )); - Round(a, b, c, d, e, f2(b, c, d), k2, w4 = left(w4 ^ w1 ^ w12 ^ w6 )); - Round(e, a, b, c, d, f2(a, b, c), k2, w5 = left(w5 ^ w2 ^ w13 ^ w7 )); - Round(d, e, a, b, c, f2(e, a, b), k2, w6 = left(w6 ^ w3 ^ w14 ^ w8 )); - Round(c, d, e, a, b, f2(d, e, a), k2, w7 = left(w7 ^ w4 ^ w15 ^ w9 )); - Round(b, c, d, e, a, f2(c, d, e), k2, w8 = left(w8 ^ w5 ^ w0 ^ w10)); - Round(a, b, c, d, e, f2(b, c, d), k2, w9 = left(w9 ^ w6 ^ w1 ^ w11)); - Round(e, a, b, c, d, f2(a, b, c), k2, w10 = left(w10 ^ w7 ^ w2 ^ w12)); - Round(d, e, a, b, c, f2(e, a, b), k2, w11 = left(w11 ^ w8 ^ w3 ^ w13)); - Round(c, d, e, a, b, f2(d, e, a), k2, w12 = left(w12 ^ w9 ^ w4 ^ w14)); - Round(b, c, d, e, a, f2(c, d, e), k2, w13 = left(w13 ^ w10 ^ w5 ^ w15)); - Round(a, b, c, d, e, f2(b, c, d), k2, w14 = left(w14 ^ w11 ^ w6 ^ w0 )); - Round(e, a, b, c, d, f2(a, b, c), k2, w15 = left(w15 ^ w12 ^ w7 ^ w1 )); + Round(e, a, b, c, d, f1(a, b, c), k1, w0 = left(w0 ^ w13 ^ w8 ^ w2)); + Round(d, e, a, b, c, f1(e, a, b), k1, w1 = left(w1 ^ w14 ^ w9 ^ w3)); + Round(c, d, e, a, b, f1(d, e, a), k1, w2 = left(w2 ^ w15 ^ w10 ^ w4)); + Round(b, c, d, e, a, f1(c, d, e), k1, w3 = left(w3 ^ w0 ^ w11 ^ w5)); + Round(a, b, c, d, e, f2(b, c, d), k2, w4 = left(w4 ^ w1 ^ w12 ^ w6)); + Round(e, a, b, c, d, f2(a, b, c), k2, w5 = left(w5 ^ w2 ^ w13 ^ w7)); + Round(d, e, a, b, c, f2(e, a, b), k2, w6 = left(w6 ^ w3 ^ w14 ^ w8)); + Round(c, d, e, a, b, f2(d, e, a), k2, w7 = left(w7 ^ w4 ^ w15 ^ w9)); + Round(b, c, d, e, a, f2(c, d, e), k2, w8 = left(w8 ^ w5 ^ w0 ^ w10)); + Round(a, b, c, d, e, f2(b, c, d), k2, w9 = left(w9 ^ w6 ^ w1 ^ w11)); + Round(e, a, b, c, d, f2(a, b, c), k2, w10 = left(w10 ^ w7 ^ w2 ^ w12)); + Round(d, e, a, b, c, f2(e, a, b), k2, w11 = left(w11 ^ w8 ^ w3 ^ w13)); + Round(c, d, e, a, b, f2(d, e, a), k2, w12 = left(w12 ^ w9 ^ w4 ^ w14)); + Round(b, c, d, e, a, f2(c, d, e), k2, w13 = left(w13 ^ w10 ^ w5 ^ w15)); + Round(a, b, c, d, e, f2(b, c, d), k2, w14 = left(w14 ^ w11 ^ w6 ^ w0)); + Round(e, a, b, c, d, f2(a, b, c), k2, w15 = left(w15 ^ w12 ^ w7 ^ w1)); - Round(d, e, a, b, c, f2(e, a, b), k2, w0 = left(w0 ^ w13 ^ w8 ^ w2 )); - Round(c, d, e, a, b, f2(d, e, a), k2, w1 = left(w1 ^ w14 ^ w9 ^ w3 )); - Round(b, c, d, e, a, f2(c, d, e), k2, w2 = left(w2 ^ w15 ^ w10 ^ w4 )); - Round(a, b, c, d, e, f2(b, c, d), k2, w3 = left(w3 ^ w0 ^ w11 ^ w5 )); - Round(e, a, b, c, d, f2(a, b, c), k2, w4 = left(w4 ^ w1 ^ w12 ^ w6 )); - Round(d, e, a, b, c, f2(e, a, b), k2, w5 = left(w5 ^ w2 ^ w13 ^ w7 )); - Round(c, d, e, a, b, f2(d, e, a), k2, w6 = left(w6 ^ w3 ^ w14 ^ w8 )); - Round(b, c, d, e, a, f2(c, d, e), k2, w7 = left(w7 ^ w4 ^ w15 ^ w9 )); - Round(a, b, c, d, e, f3(b, c, d), k3, w8 = left(w8 ^ w5 ^ w0 ^ w10)); - Round(e, a, b, c, d, f3(a, b, c), k3, w9 = left(w9 ^ w6 ^ w1 ^ w11)); - Round(d, e, a, b, c, f3(e, a, b), k3, w10 = left(w10 ^ w7 ^ w2 ^ w12)); - Round(c, d, e, a, b, f3(d, e, a), k3, w11 = left(w11 ^ w8 ^ w3 ^ w13)); - Round(b, c, d, e, a, f3(c, d, e), k3, w12 = left(w12 ^ w9 ^ w4 ^ w14)); - Round(a, b, c, d, e, f3(b, c, d), k3, w13 = left(w13 ^ w10 ^ w5 ^ w15)); - Round(e, a, b, c, d, f3(a, b, c), k3, w14 = left(w14 ^ w11 ^ w6 ^ w0 )); - Round(d, e, a, b, c, f3(e, a, b), k3, w15 = left(w15 ^ w12 ^ w7 ^ w1 )); + Round(d, e, a, b, c, f2(e, a, b), k2, w0 = left(w0 ^ w13 ^ w8 ^ w2)); + Round(c, d, e, a, b, f2(d, e, a), k2, w1 = left(w1 ^ w14 ^ w9 ^ w3)); + Round(b, c, d, e, a, f2(c, d, e), k2, w2 = left(w2 ^ w15 ^ w10 ^ w4)); + Round(a, b, c, d, e, f2(b, c, d), k2, w3 = left(w3 ^ w0 ^ w11 ^ w5)); + Round(e, a, b, c, d, f2(a, b, c), k2, w4 = left(w4 ^ w1 ^ w12 ^ w6)); + Round(d, e, a, b, c, f2(e, a, b), k2, w5 = left(w5 ^ w2 ^ w13 ^ w7)); + Round(c, d, e, a, b, f2(d, e, a), k2, w6 = left(w6 ^ w3 ^ w14 ^ w8)); + Round(b, c, d, e, a, f2(c, d, e), k2, w7 = left(w7 ^ w4 ^ w15 ^ w9)); + Round(a, b, c, d, e, f3(b, c, d), k3, w8 = left(w8 ^ w5 ^ w0 ^ w10)); + Round(e, a, b, c, d, f3(a, b, c), k3, w9 = left(w9 ^ w6 ^ w1 ^ w11)); + Round(d, e, a, b, c, f3(e, a, b), k3, w10 = left(w10 ^ w7 ^ w2 ^ w12)); + Round(c, d, e, a, b, f3(d, e, a), k3, w11 = left(w11 ^ w8 ^ w3 ^ w13)); + Round(b, c, d, e, a, f3(c, d, e), k3, w12 = left(w12 ^ w9 ^ w4 ^ w14)); + Round(a, b, c, d, e, f3(b, c, d), k3, w13 = left(w13 ^ w10 ^ w5 ^ w15)); + Round(e, a, b, c, d, f3(a, b, c), k3, w14 = left(w14 ^ w11 ^ w6 ^ w0)); + Round(d, e, a, b, c, f3(e, a, b), k3, w15 = left(w15 ^ w12 ^ w7 ^ w1)); - Round(c, d, e, a, b, f3(d, e, a), k3, w0 = left(w0 ^ w13 ^ w8 ^ w2 )); - Round(b, c, d, e, a, f3(c, d, e), k3, w1 = left(w1 ^ w14 ^ w9 ^ w3 )); - Round(a, b, c, d, e, f3(b, c, d), k3, w2 = left(w2 ^ w15 ^ w10 ^ w4 )); - Round(e, a, b, c, d, f3(a, b, c), k3, w3 = left(w3 ^ w0 ^ w11 ^ w5 )); - Round(d, e, a, b, c, f3(e, a, b), k3, w4 = left(w4 ^ w1 ^ w12 ^ w6 )); - Round(c, d, e, a, b, f3(d, e, a), k3, w5 = left(w5 ^ w2 ^ w13 ^ w7 )); - Round(b, c, d, e, a, f3(c, d, e), k3, w6 = left(w6 ^ w3 ^ w14 ^ w8 )); - Round(a, b, c, d, e, f3(b, c, d), k3, w7 = left(w7 ^ w4 ^ w15 ^ w9 )); - Round(e, a, b, c, d, f3(a, b, c), k3, w8 = left(w8 ^ w5 ^ w0 ^ w10)); - Round(d, e, a, b, c, f3(e, a, b), k3, w9 = left(w9 ^ w6 ^ w1 ^ w11)); - Round(c, d, e, a, b, f3(d, e, a), k3, w10 = left(w10 ^ w7 ^ w2 ^ w12)); - Round(b, c, d, e, a, f3(c, d, e), k3, w11 = left(w11 ^ w8 ^ w3 ^ w13)); - Round(a, b, c, d, e, f2(b, c, d), k4, w12 = left(w12 ^ w9 ^ w4 ^ w14)); - Round(e, a, b, c, d, f2(a, b, c), k4, w13 = left(w13 ^ w10 ^ w5 ^ w15)); - Round(d, e, a, b, c, f2(e, a, b), k4, w14 = left(w14 ^ w11 ^ w6 ^ w0 )); - Round(c, d, e, a, b, f2(d, e, a), k4, w15 = left(w15 ^ w12 ^ w7 ^ w1 )); + Round(c, d, e, a, b, f3(d, e, a), k3, w0 = left(w0 ^ w13 ^ w8 ^ w2)); + Round(b, c, d, e, a, f3(c, d, e), k3, w1 = left(w1 ^ w14 ^ w9 ^ w3)); + Round(a, b, c, d, e, f3(b, c, d), k3, w2 = left(w2 ^ w15 ^ w10 ^ w4)); + Round(e, a, b, c, d, f3(a, b, c), k3, w3 = left(w3 ^ w0 ^ w11 ^ w5)); + Round(d, e, a, b, c, f3(e, a, b), k3, w4 = left(w4 ^ w1 ^ w12 ^ w6)); + Round(c, d, e, a, b, f3(d, e, a), k3, w5 = left(w5 ^ w2 ^ w13 ^ w7)); + Round(b, c, d, e, a, f3(c, d, e), k3, w6 = left(w6 ^ w3 ^ w14 ^ w8)); + Round(a, b, c, d, e, f3(b, c, d), k3, w7 = left(w7 ^ w4 ^ w15 ^ w9)); + Round(e, a, b, c, d, f3(a, b, c), k3, w8 = left(w8 ^ w5 ^ w0 ^ w10)); + Round(d, e, a, b, c, f3(e, a, b), k3, w9 = left(w9 ^ w6 ^ w1 ^ w11)); + Round(c, d, e, a, b, f3(d, e, a), k3, w10 = left(w10 ^ w7 ^ w2 ^ w12)); + Round(b, c, d, e, a, f3(c, d, e), k3, w11 = left(w11 ^ w8 ^ w3 ^ w13)); + Round(a, b, c, d, e, f2(b, c, d), k4, w12 = left(w12 ^ w9 ^ w4 ^ w14)); + Round(e, a, b, c, d, f2(a, b, c), k4, w13 = left(w13 ^ w10 ^ w5 ^ w15)); + Round(d, e, a, b, c, f2(e, a, b), k4, w14 = left(w14 ^ w11 ^ w6 ^ w0)); + Round(c, d, e, a, b, f2(d, e, a), k4, w15 = left(w15 ^ w12 ^ w7 ^ w1)); - Round(b, c, d, e, a, f2(c, d, e), k4, w0 = left(w0 ^ w13 ^ w8 ^ w2 )); - Round(a, b, c, d, e, f2(b, c, d), k4, w1 = left(w1 ^ w14 ^ w9 ^ w3 )); - Round(e, a, b, c, d, f2(a, b, c), k4, w2 = left(w2 ^ w15 ^ w10 ^ w4 )); - Round(d, e, a, b, c, f2(e, a, b), k4, w3 = left(w3 ^ w0 ^ w11 ^ w5 )); - Round(c, d, e, a, b, f2(d, e, a), k4, w4 = left(w4 ^ w1 ^ w12 ^ w6 )); - Round(b, c, d, e, a, f2(c, d, e), k4, w5 = left(w5 ^ w2 ^ w13 ^ w7 )); - Round(a, b, c, d, e, f2(b, c, d), k4, w6 = left(w6 ^ w3 ^ w14 ^ w8 )); - Round(e, a, b, c, d, f2(a, b, c), k4, w7 = left(w7 ^ w4 ^ w15 ^ w9 )); - Round(d, e, a, b, c, f2(e, a, b), k4, w8 = left(w8 ^ w5 ^ w0 ^ w10)); - Round(c, d, e, a, b, f2(d, e, a), k4, w9 = left(w9 ^ w6 ^ w1 ^ w11)); - Round(b, c, d, e, a, f2(c, d, e), k4, w10 = left(w10 ^ w7 ^ w2 ^ w12)); - Round(a, b, c, d, e, f2(b, c, d), k4, w11 = left(w11 ^ w8 ^ w3 ^ w13)); - Round(e, a, b, c, d, f2(a, b, c), k4, w12 = left(w12 ^ w9 ^ w4 ^ w14)); - Round(d, e, a, b, c, f2(e, a, b), k4, left(w13 ^ w10 ^ w5 ^ w15)); - Round(c, d, e, a, b, f2(d, e, a), k4, left(w14 ^ w11 ^ w6 ^ w0 )); - Round(b, c, d, e, a, f2(c, d, e), k4, left(w15 ^ w12 ^ w7 ^ w1 )); + Round(b, c, d, e, a, f2(c, d, e), k4, w0 = left(w0 ^ w13 ^ w8 ^ w2)); + Round(a, b, c, d, e, f2(b, c, d), k4, w1 = left(w1 ^ w14 ^ w9 ^ w3)); + Round(e, a, b, c, d, f2(a, b, c), k4, w2 = left(w2 ^ w15 ^ w10 ^ w4)); + Round(d, e, a, b, c, f2(e, a, b), k4, w3 = left(w3 ^ w0 ^ w11 ^ w5)); + Round(c, d, e, a, b, f2(d, e, a), k4, w4 = left(w4 ^ w1 ^ w12 ^ w6)); + Round(b, c, d, e, a, f2(c, d, e), k4, w5 = left(w5 ^ w2 ^ w13 ^ w7)); + Round(a, b, c, d, e, f2(b, c, d), k4, w6 = left(w6 ^ w3 ^ w14 ^ w8)); + Round(e, a, b, c, d, f2(a, b, c), k4, w7 = left(w7 ^ w4 ^ w15 ^ w9)); + Round(d, e, a, b, c, f2(e, a, b), k4, w8 = left(w8 ^ w5 ^ w0 ^ w10)); + Round(c, d, e, a, b, f2(d, e, a), k4, w9 = left(w9 ^ w6 ^ w1 ^ w11)); + Round(b, c, d, e, a, f2(c, d, e), k4, w10 = left(w10 ^ w7 ^ w2 ^ w12)); + Round(a, b, c, d, e, f2(b, c, d), k4, w11 = left(w11 ^ w8 ^ w3 ^ w13)); + Round(e, a, b, c, d, f2(a, b, c), k4, w12 = left(w12 ^ w9 ^ w4 ^ w14)); + Round(d, e, a, b, c, f2(e, a, b), k4, left(w13 ^ w10 ^ w5 ^ w15)); + Round(c, d, e, a, b, f2(d, e, a), k4, left(w14 ^ w11 ^ w6 ^ w0)); + Round(b, c, d, e, a, f2(c, d, e), k4, left(w15 ^ w12 ^ w7 ^ w1)); s[0] += a; s[1] += b; @@ -138,18 +140,20 @@ void Transform(uint32_t *s, const unsigned char *chunk) { s[4] += e; } -} // namespace sha1 +} // namespace sha1 -} // namespace +} // namespace ////// SHA1 -CSHA1::CSHA1() : bytes(0) { +CSHA1::CSHA1() : bytes(0) +{ sha1::Initialize(s); } -CSHA1& CSHA1::Write(const unsigned char *data, size_t len) { - const unsigned char *end = data + len; +CSHA1& CSHA1::Write(const unsigned char* data, size_t len) +{ + const unsigned char* end = data + len; size_t bufsize = bytes % 64; if (bufsize && bufsize + len >= 64) { // Fill the buffer, and process it. @@ -173,20 +177,22 @@ CSHA1& CSHA1::Write(const unsigned char *data, size_t len) { return *this; } -void CSHA1::Finalize(unsigned char hash[OUTPUT_SIZE]) { +void CSHA1::Finalize(unsigned char hash[OUTPUT_SIZE]) +{ static const unsigned char pad[64] = {0x80}; unsigned char sizedesc[8]; WriteBE64(sizedesc, bytes << 3); Write(pad, 1 + ((119 - (bytes % 64)) % 64)); Write(sizedesc, 8); WriteBE32(hash, s[0]); - WriteBE32(hash+4, s[1]); - WriteBE32(hash+8, s[2]); - WriteBE32(hash+12, s[3]); - WriteBE32(hash+16, s[4]); + WriteBE32(hash + 4, s[1]); + WriteBE32(hash + 8, s[2]); + WriteBE32(hash + 12, s[3]); + WriteBE32(hash + 16, s[4]); } -CSHA1& CSHA1::Reset() { +CSHA1& CSHA1::Reset() +{ bytes = 0; sha1::Initialize(s); return *this; diff --git a/src/crypto/sha1.h b/src/crypto/sha1.h index b16f2c88ce..4fa2b333ba 100644 --- a/src/crypto/sha1.h +++ b/src/crypto/sha1.h @@ -9,7 +9,8 @@ #include /** A hasher class for SHA1. */ -class CSHA1 { +class CSHA1 +{ private: uint32_t s[5]; unsigned char buf[64]; @@ -19,7 +20,7 @@ public: static const size_t OUTPUT_SIZE = 20; CSHA1(); - CSHA1& Write(const unsigned char *data, size_t len); + CSHA1& Write(const unsigned char* data, size_t len); void Finalize(unsigned char hash[OUTPUT_SIZE]); CSHA1& Reset(); }; diff --git a/src/crypto/sha2.cpp b/src/crypto/sha2.cpp index 72f191afcd..9a96c5125a 100644 --- a/src/crypto/sha2.cpp +++ b/src/crypto/sha2.cpp @@ -9,11 +9,11 @@ #include // Internal implementation code. -namespace { - +namespace +{ /// Internal SHA-256 implementation. -namespace sha256 { - +namespace sha256 +{ uint32_t inline Ch(uint32_t x, uint32_t y, uint32_t z) { return z ^ (x & (y ^ z)); } uint32_t inline Maj(uint32_t x, uint32_t y, uint32_t z) { return (x & y) | (z & (x | y)); } uint32_t inline Sigma0(uint32_t x) { return (x >> 2 | x << 30) ^ (x >> 13 | x << 19) ^ (x >> 22 | x << 10); } @@ -22,9 +22,8 @@ uint32_t inline sigma0(uint32_t x) { return (x >> 7 | x << 25) ^ (x >> 18 | x << uint32_t inline sigma1(uint32_t x) { return (x >> 17 | x << 15) ^ (x >> 19 | x << 13) ^ (x >> 10); } /** One round of SHA-256. */ -void inline Round(uint32_t a, uint32_t b, uint32_t c, uint32_t &d, - uint32_t e, uint32_t f, uint32_t g, uint32_t &h, - uint32_t k, uint32_t w) { +void inline Round(uint32_t a, uint32_t b, uint32_t c, uint32_t& d, uint32_t e, uint32_t f, uint32_t g, uint32_t& h, uint32_t k, uint32_t w) +{ uint32_t t1 = h + Sigma1(e) + Ch(e, f, g) + k + w; uint32_t t2 = Sigma0(a) + Maj(a, b, c); d += t1; @@ -32,7 +31,8 @@ void inline Round(uint32_t a, uint32_t b, uint32_t c, uint32_t &d, } /** Initialize SHA-256 state. */ -void inline Initialize(uint32_t *s) { +void inline Initialize(uint32_t* s) +{ s[0] = 0x6a09e667ul; s[1] = 0xbb67ae85ul; s[2] = 0x3c6ef372ul; @@ -44,20 +44,21 @@ void inline Initialize(uint32_t *s) { } /** Perform one SHA-256 transformation, processing a 64-byte chunk. */ -void Transform(uint32_t *s, const unsigned char *chunk) { +void Transform(uint32_t* s, const unsigned char* chunk) +{ uint32_t a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5], g = s[6], h = s[7]; uint32_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15; - Round(a, b, c, d, e, f, g, h, 0x428a2f98, w0 = ReadBE32(chunk + 0)); - Round(h, a, b, c, d, e, f, g, 0x71374491, w1 = ReadBE32(chunk + 4)); - Round(g, h, a, b, c, d, e, f, 0xb5c0fbcf, w2 = ReadBE32(chunk + 8)); - Round(f, g, h, a, b, c, d, e, 0xe9b5dba5, w3 = ReadBE32(chunk + 12)); - Round(e, f, g, h, a, b, c, d, 0x3956c25b, w4 = ReadBE32(chunk + 16)); - Round(d, e, f, g, h, a, b, c, 0x59f111f1, w5 = ReadBE32(chunk + 20)); - Round(c, d, e, f, g, h, a, b, 0x923f82a4, w6 = ReadBE32(chunk + 24)); - Round(b, c, d, e, f, g, h, a, 0xab1c5ed5, w7 = ReadBE32(chunk + 28)); - Round(a, b, c, d, e, f, g, h, 0xd807aa98, w8 = ReadBE32(chunk + 32)); - Round(h, a, b, c, d, e, f, g, 0x12835b01, w9 = ReadBE32(chunk + 36)); + Round(a, b, c, d, e, f, g, h, 0x428a2f98, w0 = ReadBE32(chunk + 0)); + Round(h, a, b, c, d, e, f, g, 0x71374491, w1 = ReadBE32(chunk + 4)); + Round(g, h, a, b, c, d, e, f, 0xb5c0fbcf, w2 = ReadBE32(chunk + 8)); + Round(f, g, h, a, b, c, d, e, 0xe9b5dba5, w3 = ReadBE32(chunk + 12)); + Round(e, f, g, h, a, b, c, d, 0x3956c25b, w4 = ReadBE32(chunk + 16)); + Round(d, e, f, g, h, a, b, c, 0x59f111f1, w5 = ReadBE32(chunk + 20)); + Round(c, d, e, f, g, h, a, b, 0x923f82a4, w6 = ReadBE32(chunk + 24)); + Round(b, c, d, e, f, g, h, a, 0xab1c5ed5, w7 = ReadBE32(chunk + 28)); + Round(a, b, c, d, e, f, g, h, 0xd807aa98, w8 = ReadBE32(chunk + 32)); + Round(h, a, b, c, d, e, f, g, 0x12835b01, w9 = ReadBE32(chunk + 36)); Round(g, h, a, b, c, d, e, f, 0x243185be, w10 = ReadBE32(chunk + 40)); Round(f, g, h, a, b, c, d, e, 0x550c7dc3, w11 = ReadBE32(chunk + 44)); Round(e, f, g, h, a, b, c, d, 0x72be5d74, w12 = ReadBE32(chunk + 48)); @@ -65,56 +66,56 @@ void Transform(uint32_t *s, const unsigned char *chunk) { Round(c, d, e, f, g, h, a, b, 0x9bdc06a7, w14 = ReadBE32(chunk + 56)); Round(b, c, d, e, f, g, h, a, 0xc19bf174, w15 = ReadBE32(chunk + 60)); - Round(a, b, c, d, e, f, g, h, 0xe49b69c1, w0 += sigma1(w14) + w9 + sigma0( w1)); - Round(h, a, b, c, d, e, f, g, 0xefbe4786, w1 += sigma1(w15) + w10 + sigma0( w2)); - Round(g, h, a, b, c, d, e, f, 0x0fc19dc6, w2 += sigma1( w0) + w11 + sigma0( w3)); - Round(f, g, h, a, b, c, d, e, 0x240ca1cc, w3 += sigma1( w1) + w12 + sigma0( w4)); - Round(e, f, g, h, a, b, c, d, 0x2de92c6f, w4 += sigma1( w2) + w13 + sigma0( w5)); - Round(d, e, f, g, h, a, b, c, 0x4a7484aa, w5 += sigma1( w3) + w14 + sigma0( w6)); - Round(c, d, e, f, g, h, a, b, 0x5cb0a9dc, w6 += sigma1( w4) + w15 + sigma0( w7)); - Round(b, c, d, e, f, g, h, a, 0x76f988da, w7 += sigma1( w5) + w0 + sigma0( w8)); - Round(a, b, c, d, e, f, g, h, 0x983e5152, w8 += sigma1( w6) + w1 + sigma0( w9)); - Round(h, a, b, c, d, e, f, g, 0xa831c66d, w9 += sigma1( w7) + w2 + sigma0(w10)); - Round(g, h, a, b, c, d, e, f, 0xb00327c8, w10 += sigma1( w8) + w3 + sigma0(w11)); - Round(f, g, h, a, b, c, d, e, 0xbf597fc7, w11 += sigma1( w9) + w4 + sigma0(w12)); - Round(e, f, g, h, a, b, c, d, 0xc6e00bf3, w12 += sigma1(w10) + w5 + sigma0(w13)); - Round(d, e, f, g, h, a, b, c, 0xd5a79147, w13 += sigma1(w11) + w6 + sigma0(w14)); - Round(c, d, e, f, g, h, a, b, 0x06ca6351, w14 += sigma1(w12) + w7 + sigma0(w15)); - Round(b, c, d, e, f, g, h, a, 0x14292967, w15 += sigma1(w13) + w8 + sigma0( w0)); + Round(a, b, c, d, e, f, g, h, 0xe49b69c1, w0 += sigma1(w14) + w9 + sigma0(w1)); + Round(h, a, b, c, d, e, f, g, 0xefbe4786, w1 += sigma1(w15) + w10 + sigma0(w2)); + Round(g, h, a, b, c, d, e, f, 0x0fc19dc6, w2 += sigma1(w0) + w11 + sigma0(w3)); + Round(f, g, h, a, b, c, d, e, 0x240ca1cc, w3 += sigma1(w1) + w12 + sigma0(w4)); + Round(e, f, g, h, a, b, c, d, 0x2de92c6f, w4 += sigma1(w2) + w13 + sigma0(w5)); + Round(d, e, f, g, h, a, b, c, 0x4a7484aa, w5 += sigma1(w3) + w14 + sigma0(w6)); + Round(c, d, e, f, g, h, a, b, 0x5cb0a9dc, w6 += sigma1(w4) + w15 + sigma0(w7)); + Round(b, c, d, e, f, g, h, a, 0x76f988da, w7 += sigma1(w5) + w0 + sigma0(w8)); + Round(a, b, c, d, e, f, g, h, 0x983e5152, w8 += sigma1(w6) + w1 + sigma0(w9)); + Round(h, a, b, c, d, e, f, g, 0xa831c66d, w9 += sigma1(w7) + w2 + sigma0(w10)); + Round(g, h, a, b, c, d, e, f, 0xb00327c8, w10 += sigma1(w8) + w3 + sigma0(w11)); + Round(f, g, h, a, b, c, d, e, 0xbf597fc7, w11 += sigma1(w9) + w4 + sigma0(w12)); + Round(e, f, g, h, a, b, c, d, 0xc6e00bf3, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, g, h, a, b, c, 0xd5a79147, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, f, g, h, a, b, 0x06ca6351, w14 += sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, e, f, g, h, a, 0x14292967, w15 += sigma1(w13) + w8 + sigma0(w0)); - Round(a, b, c, d, e, f, g, h, 0x27b70a85, w0 += sigma1(w14) + w9 + sigma0( w1)); - Round(h, a, b, c, d, e, f, g, 0x2e1b2138, w1 += sigma1(w15) + w10 + sigma0( w2)); - Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc, w2 += sigma1( w0) + w11 + sigma0( w3)); - Round(f, g, h, a, b, c, d, e, 0x53380d13, w3 += sigma1( w1) + w12 + sigma0( w4)); - Round(e, f, g, h, a, b, c, d, 0x650a7354, w4 += sigma1( w2) + w13 + sigma0( w5)); - Round(d, e, f, g, h, a, b, c, 0x766a0abb, w5 += sigma1( w3) + w14 + sigma0( w6)); - Round(c, d, e, f, g, h, a, b, 0x81c2c92e, w6 += sigma1( w4) + w15 + sigma0( w7)); - Round(b, c, d, e, f, g, h, a, 0x92722c85, w7 += sigma1( w5) + w0 + sigma0( w8)); - Round(a, b, c, d, e, f, g, h, 0xa2bfe8a1, w8 += sigma1( w6) + w1 + sigma0( w9)); - Round(h, a, b, c, d, e, f, g, 0xa81a664b, w9 += sigma1( w7) + w2 + sigma0(w10)); - Round(g, h, a, b, c, d, e, f, 0xc24b8b70, w10 += sigma1( w8) + w3 + sigma0(w11)); - Round(f, g, h, a, b, c, d, e, 0xc76c51a3, w11 += sigma1( w9) + w4 + sigma0(w12)); - Round(e, f, g, h, a, b, c, d, 0xd192e819, w12 += sigma1(w10) + w5 + sigma0(w13)); - Round(d, e, f, g, h, a, b, c, 0xd6990624, w13 += sigma1(w11) + w6 + sigma0(w14)); - Round(c, d, e, f, g, h, a, b, 0xf40e3585, w14 += sigma1(w12) + w7 + sigma0(w15)); - Round(b, c, d, e, f, g, h, a, 0x106aa070, w15 += sigma1(w13) + w8 + sigma0( w0)); + Round(a, b, c, d, e, f, g, h, 0x27b70a85, w0 += sigma1(w14) + w9 + sigma0(w1)); + Round(h, a, b, c, d, e, f, g, 0x2e1b2138, w1 += sigma1(w15) + w10 + sigma0(w2)); + Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc, w2 += sigma1(w0) + w11 + sigma0(w3)); + Round(f, g, h, a, b, c, d, e, 0x53380d13, w3 += sigma1(w1) + w12 + sigma0(w4)); + Round(e, f, g, h, a, b, c, d, 0x650a7354, w4 += sigma1(w2) + w13 + sigma0(w5)); + Round(d, e, f, g, h, a, b, c, 0x766a0abb, w5 += sigma1(w3) + w14 + sigma0(w6)); + Round(c, d, e, f, g, h, a, b, 0x81c2c92e, w6 += sigma1(w4) + w15 + sigma0(w7)); + Round(b, c, d, e, f, g, h, a, 0x92722c85, w7 += sigma1(w5) + w0 + sigma0(w8)); + Round(a, b, c, d, e, f, g, h, 0xa2bfe8a1, w8 += sigma1(w6) + w1 + sigma0(w9)); + Round(h, a, b, c, d, e, f, g, 0xa81a664b, w9 += sigma1(w7) + w2 + sigma0(w10)); + Round(g, h, a, b, c, d, e, f, 0xc24b8b70, w10 += sigma1(w8) + w3 + sigma0(w11)); + Round(f, g, h, a, b, c, d, e, 0xc76c51a3, w11 += sigma1(w9) + w4 + sigma0(w12)); + Round(e, f, g, h, a, b, c, d, 0xd192e819, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, g, h, a, b, c, 0xd6990624, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, f, g, h, a, b, 0xf40e3585, w14 += sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, e, f, g, h, a, 0x106aa070, w15 += sigma1(w13) + w8 + sigma0(w0)); - Round(a, b, c, d, e, f, g, h, 0x19a4c116, w0 += sigma1(w14) + w9 + sigma0( w1)); - Round(h, a, b, c, d, e, f, g, 0x1e376c08, w1 += sigma1(w15) + w10 + sigma0( w2)); - Round(g, h, a, b, c, d, e, f, 0x2748774c, w2 += sigma1( w0) + w11 + sigma0( w3)); - Round(f, g, h, a, b, c, d, e, 0x34b0bcb5, w3 += sigma1( w1) + w12 + sigma0( w4)); - Round(e, f, g, h, a, b, c, d, 0x391c0cb3, w4 += sigma1( w2) + w13 + sigma0( w5)); - Round(d, e, f, g, h, a, b, c, 0x4ed8aa4a, w5 += sigma1( w3) + w14 + sigma0( w6)); - Round(c, d, e, f, g, h, a, b, 0x5b9cca4f, w6 += sigma1( w4) + w15 + sigma0( w7)); - Round(b, c, d, e, f, g, h, a, 0x682e6ff3, w7 += sigma1( w5) + w0 + sigma0( w8)); - Round(a, b, c, d, e, f, g, h, 0x748f82ee, w8 += sigma1( w6) + w1 + sigma0( w9)); - Round(h, a, b, c, d, e, f, g, 0x78a5636f, w9 += sigma1( w7) + w2 + sigma0(w10)); - Round(g, h, a, b, c, d, e, f, 0x84c87814, w10 += sigma1( w8) + w3 + sigma0(w11)); - Round(f, g, h, a, b, c, d, e, 0x8cc70208, w11 += sigma1( w9) + w4 + sigma0(w12)); - Round(e, f, g, h, a, b, c, d, 0x90befffa, w12 += sigma1(w10) + w5 + sigma0(w13)); - Round(d, e, f, g, h, a, b, c, 0xa4506ceb, w13 += sigma1(w11) + w6 + sigma0(w14)); - Round(c, d, e, f, g, h, a, b, 0xbef9a3f7, w14 + sigma1(w12) + w7 + sigma0(w15)); - Round(b, c, d, e, f, g, h, a, 0xc67178f2, w15 + sigma1(w13) + w8 + sigma0( w0)); + Round(a, b, c, d, e, f, g, h, 0x19a4c116, w0 += sigma1(w14) + w9 + sigma0(w1)); + Round(h, a, b, c, d, e, f, g, 0x1e376c08, w1 += sigma1(w15) + w10 + sigma0(w2)); + Round(g, h, a, b, c, d, e, f, 0x2748774c, w2 += sigma1(w0) + w11 + sigma0(w3)); + Round(f, g, h, a, b, c, d, e, 0x34b0bcb5, w3 += sigma1(w1) + w12 + sigma0(w4)); + Round(e, f, g, h, a, b, c, d, 0x391c0cb3, w4 += sigma1(w2) + w13 + sigma0(w5)); + Round(d, e, f, g, h, a, b, c, 0x4ed8aa4a, w5 += sigma1(w3) + w14 + sigma0(w6)); + Round(c, d, e, f, g, h, a, b, 0x5b9cca4f, w6 += sigma1(w4) + w15 + sigma0(w7)); + Round(b, c, d, e, f, g, h, a, 0x682e6ff3, w7 += sigma1(w5) + w0 + sigma0(w8)); + Round(a, b, c, d, e, f, g, h, 0x748f82ee, w8 += sigma1(w6) + w1 + sigma0(w9)); + Round(h, a, b, c, d, e, f, g, 0x78a5636f, w9 += sigma1(w7) + w2 + sigma0(w10)); + Round(g, h, a, b, c, d, e, f, 0x84c87814, w10 += sigma1(w8) + w3 + sigma0(w11)); + Round(f, g, h, a, b, c, d, e, 0x8cc70208, w11 += sigma1(w9) + w4 + sigma0(w12)); + Round(e, f, g, h, a, b, c, d, 0x90befffa, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, g, h, a, b, c, 0xa4506ceb, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, f, g, h, a, b, 0xbef9a3f7, w14 + sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, e, f, g, h, a, 0xc67178f2, w15 + sigma1(w13) + w8 + sigma0(w0)); s[0] += a; s[1] += b; @@ -126,11 +127,11 @@ void Transform(uint32_t *s, const unsigned char *chunk) { s[7] += h; } -} // namespace sha256 +} // namespace sha256 /// Internal SHA-512 implementation. -namespace sha512 { - +namespace sha512 +{ uint64_t inline Ch(uint64_t x, uint64_t y, uint64_t z) { return z ^ (x & (y ^ z)); } uint64_t inline Maj(uint64_t x, uint64_t y, uint64_t z) { return (x & y) | (z & (x | y)); } uint64_t inline Sigma0(uint64_t x) { return (x >> 28 | x << 36) ^ (x >> 34 | x << 30) ^ (x >> 39 | x << 25); } @@ -139,9 +140,8 @@ uint64_t inline sigma0(uint64_t x) { return (x >> 1 | x << 63) ^ (x >> 8 | x << uint64_t inline sigma1(uint64_t x) { return (x >> 19 | x << 45) ^ (x >> 61 | x << 3) ^ (x >> 6); } /** One round of SHA-512. */ -void inline Round(uint64_t a, uint64_t b, uint64_t c, uint64_t &d, - uint64_t e, uint64_t f, uint64_t g, uint64_t &h, - uint64_t k, uint64_t w) { +void inline Round(uint64_t a, uint64_t b, uint64_t c, uint64_t& d, uint64_t e, uint64_t f, uint64_t g, uint64_t& h, uint64_t k, uint64_t w) +{ uint64_t t1 = h + Sigma1(e) + Ch(e, f, g) + k + w; uint64_t t2 = Sigma0(a) + Maj(a, b, c); d += t1; @@ -149,7 +149,8 @@ void inline Round(uint64_t a, uint64_t b, uint64_t c, uint64_t &d, } /** Initialize SHA-256 state. */ -void inline Initialize(uint64_t *s) { +void inline Initialize(uint64_t* s) +{ s[0] = 0x6a09e667f3bcc908ull; s[1] = 0xbb67ae8584caa73bull; s[2] = 0x3c6ef372fe94f82bull; @@ -161,20 +162,21 @@ void inline Initialize(uint64_t *s) { } /** Perform one SHA-512 transformation, processing a 128-byte chunk. */ -void Transform(uint64_t *s, const unsigned char *chunk) { +void Transform(uint64_t* s, const unsigned char* chunk) +{ uint64_t a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5], g = s[6], h = s[7]; uint64_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15; - Round(a, b, c, d, e, f, g, h, 0x428a2f98d728ae22ull, w0 = ReadBE64(chunk + 0)); - Round(h, a, b, c, d, e, f, g, 0x7137449123ef65cdull, w1 = ReadBE64(chunk + 8)); - Round(g, h, a, b, c, d, e, f, 0xb5c0fbcfec4d3b2full, w2 = ReadBE64(chunk + 16)); - Round(f, g, h, a, b, c, d, e, 0xe9b5dba58189dbbcull, w3 = ReadBE64(chunk + 24)); - Round(e, f, g, h, a, b, c, d, 0x3956c25bf348b538ull, w4 = ReadBE64(chunk + 32)); - Round(d, e, f, g, h, a, b, c, 0x59f111f1b605d019ull, w5 = ReadBE64(chunk + 40)); - Round(c, d, e, f, g, h, a, b, 0x923f82a4af194f9bull, w6 = ReadBE64(chunk + 48)); - Round(b, c, d, e, f, g, h, a, 0xab1c5ed5da6d8118ull, w7 = ReadBE64(chunk + 56)); - Round(a, b, c, d, e, f, g, h, 0xd807aa98a3030242ull, w8 = ReadBE64(chunk + 64)); - Round(h, a, b, c, d, e, f, g, 0x12835b0145706fbeull, w9 = ReadBE64(chunk + 72)); + Round(a, b, c, d, e, f, g, h, 0x428a2f98d728ae22ull, w0 = ReadBE64(chunk + 0)); + Round(h, a, b, c, d, e, f, g, 0x7137449123ef65cdull, w1 = ReadBE64(chunk + 8)); + Round(g, h, a, b, c, d, e, f, 0xb5c0fbcfec4d3b2full, w2 = ReadBE64(chunk + 16)); + Round(f, g, h, a, b, c, d, e, 0xe9b5dba58189dbbcull, w3 = ReadBE64(chunk + 24)); + Round(e, f, g, h, a, b, c, d, 0x3956c25bf348b538ull, w4 = ReadBE64(chunk + 32)); + Round(d, e, f, g, h, a, b, c, 0x59f111f1b605d019ull, w5 = ReadBE64(chunk + 40)); + Round(c, d, e, f, g, h, a, b, 0x923f82a4af194f9bull, w6 = ReadBE64(chunk + 48)); + Round(b, c, d, e, f, g, h, a, 0xab1c5ed5da6d8118ull, w7 = ReadBE64(chunk + 56)); + Round(a, b, c, d, e, f, g, h, 0xd807aa98a3030242ull, w8 = ReadBE64(chunk + 64)); + Round(h, a, b, c, d, e, f, g, 0x12835b0145706fbeull, w9 = ReadBE64(chunk + 72)); Round(g, h, a, b, c, d, e, f, 0x243185be4ee4b28cull, w10 = ReadBE64(chunk + 80)); Round(f, g, h, a, b, c, d, e, 0x550c7dc3d5ffb4e2ull, w11 = ReadBE64(chunk + 88)); Round(e, f, g, h, a, b, c, d, 0x72be5d74f27b896full, w12 = ReadBE64(chunk + 96)); @@ -182,73 +184,73 @@ void Transform(uint64_t *s, const unsigned char *chunk) { Round(c, d, e, f, g, h, a, b, 0x9bdc06a725c71235ull, w14 = ReadBE64(chunk + 112)); Round(b, c, d, e, f, g, h, a, 0xc19bf174cf692694ull, w15 = ReadBE64(chunk + 120)); - Round(a, b, c, d, e, f, g, h, 0xe49b69c19ef14ad2ull, w0 += sigma1(w14) + w9 + sigma0( w1)); - Round(h, a, b, c, d, e, f, g, 0xefbe4786384f25e3ull, w1 += sigma1(w15) + w10 + sigma0( w2)); - Round(g, h, a, b, c, d, e, f, 0x0fc19dc68b8cd5b5ull, w2 += sigma1( w0) + w11 + sigma0( w3)); - Round(f, g, h, a, b, c, d, e, 0x240ca1cc77ac9c65ull, w3 += sigma1( w1) + w12 + sigma0( w4)); - Round(e, f, g, h, a, b, c, d, 0x2de92c6f592b0275ull, w4 += sigma1( w2) + w13 + sigma0( w5)); - Round(d, e, f, g, h, a, b, c, 0x4a7484aa6ea6e483ull, w5 += sigma1( w3) + w14 + sigma0( w6)); - Round(c, d, e, f, g, h, a, b, 0x5cb0a9dcbd41fbd4ull, w6 += sigma1( w4) + w15 + sigma0( w7)); - Round(b, c, d, e, f, g, h, a, 0x76f988da831153b5ull, w7 += sigma1( w5) + w0 + sigma0( w8)); - Round(a, b, c, d, e, f, g, h, 0x983e5152ee66dfabull, w8 += sigma1( w6) + w1 + sigma0( w9)); - Round(h, a, b, c, d, e, f, g, 0xa831c66d2db43210ull, w9 += sigma1( w7) + w2 + sigma0(w10)); - Round(g, h, a, b, c, d, e, f, 0xb00327c898fb213full, w10 += sigma1( w8) + w3 + sigma0(w11)); - Round(f, g, h, a, b, c, d, e, 0xbf597fc7beef0ee4ull, w11 += sigma1( w9) + w4 + sigma0(w12)); - Round(e, f, g, h, a, b, c, d, 0xc6e00bf33da88fc2ull, w12 += sigma1(w10) + w5 + sigma0(w13)); - Round(d, e, f, g, h, a, b, c, 0xd5a79147930aa725ull, w13 += sigma1(w11) + w6 + sigma0(w14)); - Round(c, d, e, f, g, h, a, b, 0x06ca6351e003826full, w14 += sigma1(w12) + w7 + sigma0(w15)); - Round(b, c, d, e, f, g, h, a, 0x142929670a0e6e70ull, w15 += sigma1(w13) + w8 + sigma0( w0)); + Round(a, b, c, d, e, f, g, h, 0xe49b69c19ef14ad2ull, w0 += sigma1(w14) + w9 + sigma0(w1)); + Round(h, a, b, c, d, e, f, g, 0xefbe4786384f25e3ull, w1 += sigma1(w15) + w10 + sigma0(w2)); + Round(g, h, a, b, c, d, e, f, 0x0fc19dc68b8cd5b5ull, w2 += sigma1(w0) + w11 + sigma0(w3)); + Round(f, g, h, a, b, c, d, e, 0x240ca1cc77ac9c65ull, w3 += sigma1(w1) + w12 + sigma0(w4)); + Round(e, f, g, h, a, b, c, d, 0x2de92c6f592b0275ull, w4 += sigma1(w2) + w13 + sigma0(w5)); + Round(d, e, f, g, h, a, b, c, 0x4a7484aa6ea6e483ull, w5 += sigma1(w3) + w14 + sigma0(w6)); + Round(c, d, e, f, g, h, a, b, 0x5cb0a9dcbd41fbd4ull, w6 += sigma1(w4) + w15 + sigma0(w7)); + Round(b, c, d, e, f, g, h, a, 0x76f988da831153b5ull, w7 += sigma1(w5) + w0 + sigma0(w8)); + Round(a, b, c, d, e, f, g, h, 0x983e5152ee66dfabull, w8 += sigma1(w6) + w1 + sigma0(w9)); + Round(h, a, b, c, d, e, f, g, 0xa831c66d2db43210ull, w9 += sigma1(w7) + w2 + sigma0(w10)); + Round(g, h, a, b, c, d, e, f, 0xb00327c898fb213full, w10 += sigma1(w8) + w3 + sigma0(w11)); + Round(f, g, h, a, b, c, d, e, 0xbf597fc7beef0ee4ull, w11 += sigma1(w9) + w4 + sigma0(w12)); + Round(e, f, g, h, a, b, c, d, 0xc6e00bf33da88fc2ull, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, g, h, a, b, c, 0xd5a79147930aa725ull, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, f, g, h, a, b, 0x06ca6351e003826full, w14 += sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, e, f, g, h, a, 0x142929670a0e6e70ull, w15 += sigma1(w13) + w8 + sigma0(w0)); - Round(a, b, c, d, e, f, g, h, 0x27b70a8546d22ffcull, w0 += sigma1(w14) + w9 + sigma0( w1)); - Round(h, a, b, c, d, e, f, g, 0x2e1b21385c26c926ull, w1 += sigma1(w15) + w10 + sigma0( w2)); - Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc5ac42aedull, w2 += sigma1( w0) + w11 + sigma0( w3)); - Round(f, g, h, a, b, c, d, e, 0x53380d139d95b3dfull, w3 += sigma1( w1) + w12 + sigma0( w4)); - Round(e, f, g, h, a, b, c, d, 0x650a73548baf63deull, w4 += sigma1( w2) + w13 + sigma0( w5)); - Round(d, e, f, g, h, a, b, c, 0x766a0abb3c77b2a8ull, w5 += sigma1( w3) + w14 + sigma0( w6)); - Round(c, d, e, f, g, h, a, b, 0x81c2c92e47edaee6ull, w6 += sigma1( w4) + w15 + sigma0( w7)); - Round(b, c, d, e, f, g, h, a, 0x92722c851482353bull, w7 += sigma1( w5) + w0 + sigma0( w8)); - Round(a, b, c, d, e, f, g, h, 0xa2bfe8a14cf10364ull, w8 += sigma1( w6) + w1 + sigma0( w9)); - Round(h, a, b, c, d, e, f, g, 0xa81a664bbc423001ull, w9 += sigma1( w7) + w2 + sigma0(w10)); - Round(g, h, a, b, c, d, e, f, 0xc24b8b70d0f89791ull, w10 += sigma1( w8) + w3 + sigma0(w11)); - Round(f, g, h, a, b, c, d, e, 0xc76c51a30654be30ull, w11 += sigma1( w9) + w4 + sigma0(w12)); - Round(e, f, g, h, a, b, c, d, 0xd192e819d6ef5218ull, w12 += sigma1(w10) + w5 + sigma0(w13)); - Round(d, e, f, g, h, a, b, c, 0xd69906245565a910ull, w13 += sigma1(w11) + w6 + sigma0(w14)); - Round(c, d, e, f, g, h, a, b, 0xf40e35855771202aull, w14 += sigma1(w12) + w7 + sigma0(w15)); - Round(b, c, d, e, f, g, h, a, 0x106aa07032bbd1b8ull, w15 += sigma1(w13) + w8 + sigma0( w0)); + Round(a, b, c, d, e, f, g, h, 0x27b70a8546d22ffcull, w0 += sigma1(w14) + w9 + sigma0(w1)); + Round(h, a, b, c, d, e, f, g, 0x2e1b21385c26c926ull, w1 += sigma1(w15) + w10 + sigma0(w2)); + Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc5ac42aedull, w2 += sigma1(w0) + w11 + sigma0(w3)); + Round(f, g, h, a, b, c, d, e, 0x53380d139d95b3dfull, w3 += sigma1(w1) + w12 + sigma0(w4)); + Round(e, f, g, h, a, b, c, d, 0x650a73548baf63deull, w4 += sigma1(w2) + w13 + sigma0(w5)); + Round(d, e, f, g, h, a, b, c, 0x766a0abb3c77b2a8ull, w5 += sigma1(w3) + w14 + sigma0(w6)); + Round(c, d, e, f, g, h, a, b, 0x81c2c92e47edaee6ull, w6 += sigma1(w4) + w15 + sigma0(w7)); + Round(b, c, d, e, f, g, h, a, 0x92722c851482353bull, w7 += sigma1(w5) + w0 + sigma0(w8)); + Round(a, b, c, d, e, f, g, h, 0xa2bfe8a14cf10364ull, w8 += sigma1(w6) + w1 + sigma0(w9)); + Round(h, a, b, c, d, e, f, g, 0xa81a664bbc423001ull, w9 += sigma1(w7) + w2 + sigma0(w10)); + Round(g, h, a, b, c, d, e, f, 0xc24b8b70d0f89791ull, w10 += sigma1(w8) + w3 + sigma0(w11)); + Round(f, g, h, a, b, c, d, e, 0xc76c51a30654be30ull, w11 += sigma1(w9) + w4 + sigma0(w12)); + Round(e, f, g, h, a, b, c, d, 0xd192e819d6ef5218ull, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, g, h, a, b, c, 0xd69906245565a910ull, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, f, g, h, a, b, 0xf40e35855771202aull, w14 += sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, e, f, g, h, a, 0x106aa07032bbd1b8ull, w15 += sigma1(w13) + w8 + sigma0(w0)); - Round(a, b, c, d, e, f, g, h, 0x19a4c116b8d2d0c8ull, w0 += sigma1(w14) + w9 + sigma0( w1)); - Round(h, a, b, c, d, e, f, g, 0x1e376c085141ab53ull, w1 += sigma1(w15) + w10 + sigma0( w2)); - Round(g, h, a, b, c, d, e, f, 0x2748774cdf8eeb99ull, w2 += sigma1( w0) + w11 + sigma0( w3)); - Round(f, g, h, a, b, c, d, e, 0x34b0bcb5e19b48a8ull, w3 += sigma1( w1) + w12 + sigma0( w4)); - Round(e, f, g, h, a, b, c, d, 0x391c0cb3c5c95a63ull, w4 += sigma1( w2) + w13 + sigma0( w5)); - Round(d, e, f, g, h, a, b, c, 0x4ed8aa4ae3418acbull, w5 += sigma1( w3) + w14 + sigma0( w6)); - Round(c, d, e, f, g, h, a, b, 0x5b9cca4f7763e373ull, w6 += sigma1( w4) + w15 + sigma0( w7)); - Round(b, c, d, e, f, g, h, a, 0x682e6ff3d6b2b8a3ull, w7 += sigma1( w5) + w0 + sigma0( w8)); - Round(a, b, c, d, e, f, g, h, 0x748f82ee5defb2fcull, w8 += sigma1( w6) + w1 + sigma0( w9)); - Round(h, a, b, c, d, e, f, g, 0x78a5636f43172f60ull, w9 += sigma1( w7) + w2 + sigma0(w10)); - Round(g, h, a, b, c, d, e, f, 0x84c87814a1f0ab72ull, w10 += sigma1( w8) + w3 + sigma0(w11)); - Round(f, g, h, a, b, c, d, e, 0x8cc702081a6439ecull, w11 += sigma1( w9) + w4 + sigma0(w12)); - Round(e, f, g, h, a, b, c, d, 0x90befffa23631e28ull, w12 += sigma1(w10) + w5 + sigma0(w13)); - Round(d, e, f, g, h, a, b, c, 0xa4506cebde82bde9ull, w13 += sigma1(w11) + w6 + sigma0(w14)); - Round(c, d, e, f, g, h, a, b, 0xbef9a3f7b2c67915ull, w14 += sigma1(w12) + w7 + sigma0(w15)); - Round(b, c, d, e, f, g, h, a, 0xc67178f2e372532bull, w15 += sigma1(w13) + w8 + sigma0( w0)); + Round(a, b, c, d, e, f, g, h, 0x19a4c116b8d2d0c8ull, w0 += sigma1(w14) + w9 + sigma0(w1)); + Round(h, a, b, c, d, e, f, g, 0x1e376c085141ab53ull, w1 += sigma1(w15) + w10 + sigma0(w2)); + Round(g, h, a, b, c, d, e, f, 0x2748774cdf8eeb99ull, w2 += sigma1(w0) + w11 + sigma0(w3)); + Round(f, g, h, a, b, c, d, e, 0x34b0bcb5e19b48a8ull, w3 += sigma1(w1) + w12 + sigma0(w4)); + Round(e, f, g, h, a, b, c, d, 0x391c0cb3c5c95a63ull, w4 += sigma1(w2) + w13 + sigma0(w5)); + Round(d, e, f, g, h, a, b, c, 0x4ed8aa4ae3418acbull, w5 += sigma1(w3) + w14 + sigma0(w6)); + Round(c, d, e, f, g, h, a, b, 0x5b9cca4f7763e373ull, w6 += sigma1(w4) + w15 + sigma0(w7)); + Round(b, c, d, e, f, g, h, a, 0x682e6ff3d6b2b8a3ull, w7 += sigma1(w5) + w0 + sigma0(w8)); + Round(a, b, c, d, e, f, g, h, 0x748f82ee5defb2fcull, w8 += sigma1(w6) + w1 + sigma0(w9)); + Round(h, a, b, c, d, e, f, g, 0x78a5636f43172f60ull, w9 += sigma1(w7) + w2 + sigma0(w10)); + Round(g, h, a, b, c, d, e, f, 0x84c87814a1f0ab72ull, w10 += sigma1(w8) + w3 + sigma0(w11)); + Round(f, g, h, a, b, c, d, e, 0x8cc702081a6439ecull, w11 += sigma1(w9) + w4 + sigma0(w12)); + Round(e, f, g, h, a, b, c, d, 0x90befffa23631e28ull, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, g, h, a, b, c, 0xa4506cebde82bde9ull, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, f, g, h, a, b, 0xbef9a3f7b2c67915ull, w14 += sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, e, f, g, h, a, 0xc67178f2e372532bull, w15 += sigma1(w13) + w8 + sigma0(w0)); - Round(a, b, c, d, e, f, g, h, 0xca273eceea26619cull, w0 += sigma1(w14) + w9 + sigma0( w1)); - Round(h, a, b, c, d, e, f, g, 0xd186b8c721c0c207ull, w1 += sigma1(w15) + w10 + sigma0( w2)); - Round(g, h, a, b, c, d, e, f, 0xeada7dd6cde0eb1eull, w2 += sigma1( w0) + w11 + sigma0( w3)); - Round(f, g, h, a, b, c, d, e, 0xf57d4f7fee6ed178ull, w3 += sigma1( w1) + w12 + sigma0( w4)); - Round(e, f, g, h, a, b, c, d, 0x06f067aa72176fbaull, w4 += sigma1( w2) + w13 + sigma0( w5)); - Round(d, e, f, g, h, a, b, c, 0x0a637dc5a2c898a6ull, w5 += sigma1( w3) + w14 + sigma0( w6)); - Round(c, d, e, f, g, h, a, b, 0x113f9804bef90daeull, w6 += sigma1( w4) + w15 + sigma0( w7)); - Round(b, c, d, e, f, g, h, a, 0x1b710b35131c471bull, w7 += sigma1( w5) + w0 + sigma0( w8)); - Round(a, b, c, d, e, f, g, h, 0x28db77f523047d84ull, w8 += sigma1( w6) + w1 + sigma0( w9)); - Round(h, a, b, c, d, e, f, g, 0x32caab7b40c72493ull, w9 += sigma1( w7) + w2 + sigma0(w10)); - Round(g, h, a, b, c, d, e, f, 0x3c9ebe0a15c9bebcull, w10 += sigma1( w8) + w3 + sigma0(w11)); - Round(f, g, h, a, b, c, d, e, 0x431d67c49c100d4cull, w11 += sigma1( w9) + w4 + sigma0(w12)); - Round(e, f, g, h, a, b, c, d, 0x4cc5d4becb3e42b6ull, w12 += sigma1(w10) + w5 + sigma0(w13)); - Round(d, e, f, g, h, a, b, c, 0x597f299cfc657e2aull, w13 += sigma1(w11) + w6 + sigma0(w14)); - Round(c, d, e, f, g, h, a, b, 0x5fcb6fab3ad6faecull, w14 += sigma1(w12) + w7 + sigma0(w15)); - Round(b, c, d, e, f, g, h, a, 0x6c44198c4a475817ull, w15 += sigma1(w13) + w8 + sigma0( w0)); + Round(a, b, c, d, e, f, g, h, 0xca273eceea26619cull, w0 += sigma1(w14) + w9 + sigma0(w1)); + Round(h, a, b, c, d, e, f, g, 0xd186b8c721c0c207ull, w1 += sigma1(w15) + w10 + sigma0(w2)); + Round(g, h, a, b, c, d, e, f, 0xeada7dd6cde0eb1eull, w2 += sigma1(w0) + w11 + sigma0(w3)); + Round(f, g, h, a, b, c, d, e, 0xf57d4f7fee6ed178ull, w3 += sigma1(w1) + w12 + sigma0(w4)); + Round(e, f, g, h, a, b, c, d, 0x06f067aa72176fbaull, w4 += sigma1(w2) + w13 + sigma0(w5)); + Round(d, e, f, g, h, a, b, c, 0x0a637dc5a2c898a6ull, w5 += sigma1(w3) + w14 + sigma0(w6)); + Round(c, d, e, f, g, h, a, b, 0x113f9804bef90daeull, w6 += sigma1(w4) + w15 + sigma0(w7)); + Round(b, c, d, e, f, g, h, a, 0x1b710b35131c471bull, w7 += sigma1(w5) + w0 + sigma0(w8)); + Round(a, b, c, d, e, f, g, h, 0x28db77f523047d84ull, w8 += sigma1(w6) + w1 + sigma0(w9)); + Round(h, a, b, c, d, e, f, g, 0x32caab7b40c72493ull, w9 += sigma1(w7) + w2 + sigma0(w10)); + Round(g, h, a, b, c, d, e, f, 0x3c9ebe0a15c9bebcull, w10 += sigma1(w8) + w3 + sigma0(w11)); + Round(f, g, h, a, b, c, d, e, 0x431d67c49c100d4cull, w11 += sigma1(w9) + w4 + sigma0(w12)); + Round(e, f, g, h, a, b, c, d, 0x4cc5d4becb3e42b6ull, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, g, h, a, b, c, 0x597f299cfc657e2aull, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, f, g, h, a, b, 0x5fcb6fab3ad6faecull, w14 += sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, e, f, g, h, a, 0x6c44198c4a475817ull, w15 += sigma1(w13) + w8 + sigma0(w0)); s[0] += a; s[1] += b; @@ -260,19 +262,21 @@ void Transform(uint64_t *s, const unsigned char *chunk) { s[7] += h; } -} // namespace sha512 +} // namespace sha512 -} // namespace +} // namespace ////// SHA-256 -CSHA256::CSHA256() : bytes(0) { +CSHA256::CSHA256() : bytes(0) +{ sha256::Initialize(s); } -CSHA256& CSHA256::Write(const unsigned char *data, size_t len) { - const unsigned char *end = data + len; +CSHA256& CSHA256::Write(const unsigned char* data, size_t len) +{ + const unsigned char* end = data + len; size_t bufsize = bytes % 64; if (bufsize && bufsize + len >= 64) { // Fill the buffer, and process it. @@ -296,23 +300,25 @@ CSHA256& CSHA256::Write(const unsigned char *data, size_t len) { return *this; } -void CSHA256::Finalize(unsigned char hash[OUTPUT_SIZE]) { +void CSHA256::Finalize(unsigned char hash[OUTPUT_SIZE]) +{ static const unsigned char pad[64] = {0x80}; unsigned char sizedesc[8]; WriteBE64(sizedesc, bytes << 3); Write(pad, 1 + ((119 - (bytes % 64)) % 64)); Write(sizedesc, 8); WriteBE32(hash, s[0]); - WriteBE32(hash+4, s[1]); - WriteBE32(hash+8, s[2]); - WriteBE32(hash+12, s[3]); - WriteBE32(hash+16, s[4]); - WriteBE32(hash+20, s[5]); - WriteBE32(hash+24, s[6]); - WriteBE32(hash+28, s[7]); + WriteBE32(hash + 4, s[1]); + WriteBE32(hash + 8, s[2]); + WriteBE32(hash + 12, s[3]); + WriteBE32(hash + 16, s[4]); + WriteBE32(hash + 20, s[5]); + WriteBE32(hash + 24, s[6]); + WriteBE32(hash + 28, s[7]); } -CSHA256& CSHA256::Reset() { +CSHA256& CSHA256::Reset() +{ bytes = 0; sha256::Initialize(s); return *this; @@ -320,12 +326,14 @@ CSHA256& CSHA256::Reset() { ////// SHA-512 -CSHA512::CSHA512() : bytes(0) { +CSHA512::CSHA512() : bytes(0) +{ sha512::Initialize(s); } -CSHA512& CSHA512::Write(const unsigned char *data, size_t len) { - const unsigned char *end = data + len; +CSHA512& CSHA512::Write(const unsigned char* data, size_t len) +{ + const unsigned char* end = data + len; size_t bufsize = bytes % 128; if (bufsize && bufsize + len >= 128) { // Fill the buffer, and process it. @@ -349,23 +357,25 @@ CSHA512& CSHA512::Write(const unsigned char *data, size_t len) { return *this; } -void CSHA512::Finalize(unsigned char hash[OUTPUT_SIZE]) { +void CSHA512::Finalize(unsigned char hash[OUTPUT_SIZE]) +{ static const unsigned char pad[128] = {0x80}; unsigned char sizedesc[16] = {0x00}; - WriteBE64(sizedesc+8, bytes << 3); + WriteBE64(sizedesc + 8, bytes << 3); Write(pad, 1 + ((239 - (bytes % 128)) % 128)); Write(sizedesc, 16); WriteBE64(hash, s[0]); - WriteBE64(hash+8, s[1]); - WriteBE64(hash+16, s[2]); - WriteBE64(hash+24, s[3]); - WriteBE64(hash+32, s[4]); - WriteBE64(hash+40, s[5]); - WriteBE64(hash+48, s[6]); - WriteBE64(hash+56, s[7]); + WriteBE64(hash + 8, s[1]); + WriteBE64(hash + 16, s[2]); + WriteBE64(hash + 24, s[3]); + WriteBE64(hash + 32, s[4]); + WriteBE64(hash + 40, s[5]); + WriteBE64(hash + 48, s[6]); + WriteBE64(hash + 56, s[7]); } -CSHA512& CSHA512::Reset() { +CSHA512& CSHA512::Reset() +{ bytes = 0; sha512::Initialize(s); return *this; @@ -373,7 +383,8 @@ CSHA512& CSHA512::Reset() { ////// HMAC-SHA-512 -CHMAC_SHA512::CHMAC_SHA512(const unsigned char *key, size_t keylen) { +CHMAC_SHA512::CHMAC_SHA512(const unsigned char* key, size_t keylen) +{ unsigned char rkey[128]; if (keylen <= 128) { memcpy(rkey, key, keylen); @@ -383,16 +394,17 @@ CHMAC_SHA512::CHMAC_SHA512(const unsigned char *key, size_t keylen) { memset(rkey + 64, 0, 64); } - for (int n=0; n<128; n++) + for (int n = 0; n < 128; n++) rkey[n] ^= 0x5c; outer.Write(rkey, 128); - for (int n=0; n<128; n++) + for (int n = 0; n < 128; n++) rkey[n] ^= 0x5c ^ 0x36; inner.Write(rkey, 128); } -void CHMAC_SHA512::Finalize(unsigned char hash[OUTPUT_SIZE]) { +void CHMAC_SHA512::Finalize(unsigned char hash[OUTPUT_SIZE]) +{ unsigned char temp[64]; inner.Finalize(temp); outer.Write(temp, 64).Finalize(hash); diff --git a/src/crypto/sha2.h b/src/crypto/sha2.h index 088d5e194c..15ad5ac383 100644 --- a/src/crypto/sha2.h +++ b/src/crypto/sha2.h @@ -9,7 +9,8 @@ #include /** A hasher class for SHA-256. */ -class CSHA256 { +class CSHA256 +{ private: uint32_t s[8]; unsigned char buf[64]; @@ -19,13 +20,14 @@ public: static const size_t OUTPUT_SIZE = 32; CSHA256(); - CSHA256& Write(const unsigned char *data, size_t len); + CSHA256& Write(const unsigned char* data, size_t len); void Finalize(unsigned char hash[OUTPUT_SIZE]); CSHA256& Reset(); }; /** A hasher class for SHA-512. */ -class CSHA512 { +class CSHA512 +{ private: uint64_t s[8]; unsigned char buf[128]; @@ -35,13 +37,14 @@ public: static const size_t OUTPUT_SIZE = 64; CSHA512(); - CSHA512& Write(const unsigned char *data, size_t len); + CSHA512& Write(const unsigned char* data, size_t len); void Finalize(unsigned char hash[OUTPUT_SIZE]); CSHA512& Reset(); }; /** A hasher class for HMAC-SHA-512. */ -class CHMAC_SHA512 { +class CHMAC_SHA512 +{ private: CSHA512 outer; CSHA512 inner; @@ -49,8 +52,9 @@ private: public: static const size_t OUTPUT_SIZE = 64; - CHMAC_SHA512(const unsigned char *key, size_t keylen); - CHMAC_SHA512& Write(const unsigned char *data, size_t len) { + CHMAC_SHA512(const unsigned char* key, size_t keylen); + CHMAC_SHA512& Write(const unsigned char* data, size_t len) + { inner.Write(data, len); return *this; } From e6beedc496093d98ba40500fd12bcb191c87bf6e Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 22 Sep 2014 14:41:54 +0200 Subject: [PATCH 0750/1288] [Qt] add more NULL pointer checks in bitcoingui - add missing checks for clientModel and optionsModel - small cleanups for an #ifdef on Mac - remove an unneeded else --- src/qt/bitcoingui.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index dd5192982e..443bed14d7 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -662,6 +662,9 @@ void BitcoinGUI::setNumConnections(int count) void BitcoinGUI::setNumBlocks(int count) { + if(!clientModel) + return; + // Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbelled text) statusBar()->clearMessage(); @@ -832,7 +835,7 @@ void BitcoinGUI::changeEvent(QEvent *e) #ifndef Q_OS_MAC // Ignored on Mac if(e->type() == QEvent::WindowStateChange) { - if(clientModel && clientModel->getOptionsModel()->getMinimizeToTray()) + if(clientModel && clientModel->getOptionsModel() && clientModel->getOptionsModel()->getMinimizeToTray()) { QWindowStateChangeEvent *wsevt = static_cast(e); if(!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized()) @@ -847,16 +850,16 @@ void BitcoinGUI::changeEvent(QEvent *e) void BitcoinGUI::closeEvent(QCloseEvent *event) { - if(clientModel) - { #ifndef Q_OS_MAC // Ignored on Mac + if(clientModel && clientModel->getOptionsModel()) + { if(!clientModel->getOptionsModel()->getMinimizeToTray() && !clientModel->getOptionsModel()->getMinimizeOnClose()) { QApplication::quit(); } -#endif } +#endif QMainWindow::closeEvent(event); } @@ -917,8 +920,7 @@ bool BitcoinGUI::handlePaymentRequest(const SendCoinsRecipient& recipient) gotoSendCoinsPage(); return true; } - else - return false; + return false; } void BitcoinGUI::setEncryptionStatus(int status) From ff36cbe8d010bd17d7d8fe2ba9293864833884e2 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sun, 14 Sep 2014 21:54:32 -0400 Subject: [PATCH 0751/1288] RPC getnetworkinfo: export local node's client sub-version string --- src/rpcnet.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 95f42eb47f..fb159d96f6 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -11,6 +11,7 @@ #include "sync.h" #include "timedata.h" #include "util.h" +#include "version.h" #include @@ -393,6 +394,8 @@ Value getnetworkinfo(const Array& params, bool fHelp) Object obj; obj.push_back(Pair("version", (int)CLIENT_VERSION)); + obj.push_back(Pair("subversion", + FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, std::vector()))); obj.push_back(Pair("protocolversion",(int)PROTOCOL_VERSION)); obj.push_back(Pair("localservices", strprintf("%016x", nLocalServices))); obj.push_back(Pair("timeoffset", GetTimeOffset())); From 346d5443f1b12a14fca90cc3ccbfa6ce94798aae Mon Sep 17 00:00:00 2001 From: Janusz Lenar Date: Sun, 14 Sep 2014 14:09:13 +0200 Subject: [PATCH 0752/1288] Fixed the broken `brew` shell command --- doc/build-osx.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/build-osx.md b/doc/build-osx.md index 5eeda5b08e..0364d3a01b 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -50,7 +50,7 @@ Running this command takes you into brew's interactive mode, which allows you to $ brew install https://raw.github.com/mxcl/homebrew/master/Library/Formula/berkeley-db4.rb -–without-java ``` -These rest of these commands are run inside brew interactive mode: +The rest of these commands are run inside brew interactive mode: ``` /private/tmp/berkeley-db4-UGpd0O/db-4.8.30 $ cd .. /private/tmp/berkeley-db4-UGpd0O $ db-4.8.30/dist/configure --prefix=/usr/local/Cellar/berkeley-db4/4.8.30 --mandir=/usr/local/Cellar/berkeley-db4/4.8.30/share/man --enable-cxx @@ -61,7 +61,7 @@ These rest of these commands are run inside brew interactive mode: After exiting, you'll get a warning that the install is keg-only, which means it wasn't symlinked to `/usr/local`. You don't need it to link it to build bitcoin, but if you want to, here's how: - $ brew --force link berkeley-db4 + $ brew link --force berkeley-db4 ### Building `bitcoind` From 219372f1dd504b0e187da88e3c0adf25a7e6b8d2 Mon Sep 17 00:00:00 2001 From: ENikS Date: Tue, 23 Sep 2014 13:30:27 -0400 Subject: [PATCH 0753/1288] script: Fix reference into empty vector run time exception Edit by laanwj: `begin_ptr(sourcedata) + sourcedata.size()` -> `end_ptr(sourcedata)` --- src/script/interpreter.cpp | 12 ++++++------ src/test/base58_tests.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index fd3e4f1ff7..d742fb9eb9 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -637,19 +637,19 @@ bool EvalScript(vector >& stack, const CScript& script, co valtype& vch = stacktop(-1); valtype vchHash((opcode == OP_RIPEMD160 || opcode == OP_SHA1 || opcode == OP_HASH160) ? 20 : 32); if (opcode == OP_RIPEMD160) - CRIPEMD160().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); + CRIPEMD160().Write(begin_ptr(vch), vch.size()).Finalize(begin_ptr(vchHash)); else if (opcode == OP_SHA1) - CSHA1().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); + CSHA1().Write(begin_ptr(vch), vch.size()).Finalize(begin_ptr(vchHash)); else if (opcode == OP_SHA256) - CSHA256().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); + CSHA256().Write(begin_ptr(vch), vch.size()).Finalize(begin_ptr(vchHash)); else if (opcode == OP_HASH160) - CHash160().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); + CHash160().Write(begin_ptr(vch), vch.size()).Finalize(begin_ptr(vchHash)); else if (opcode == OP_HASH256) - CHash256().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); + CHash256().Write(begin_ptr(vch), vch.size()).Finalize(begin_ptr(vchHash)); popstack(stack); stack.push_back(vchHash); } - break; + break; case OP_CODESEPARATOR: { diff --git a/src/test/base58_tests.cpp b/src/test/base58_tests.cpp index fe68e9e974..58fffb6df4 100644 --- a/src/test/base58_tests.cpp +++ b/src/test/base58_tests.cpp @@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE(base58_EncodeBase58) std::vector sourcedata = ParseHex(test[0].get_str()); std::string base58string = test[1].get_str(); BOOST_CHECK_MESSAGE( - EncodeBase58(&sourcedata[0], &sourcedata[sourcedata.size()]) == base58string, + EncodeBase58(begin_ptr(sourcedata), end_ptr(sourcedata)) == base58string, strTest); } } From d14d7deff0a93d81946abec671dc47c967c9b027 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 25 Sep 2014 12:42:51 +0200 Subject: [PATCH 0754/1288] SanitizeString: allow '(' and ')' '(' and ')' are valid in user agent strings, so should be reported as such in RPC `getpeerinfo`. Fixes #4537. --- src/utilstrencodings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index 2cec3023b5..b9e64c5fe1 100644 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -16,7 +16,7 @@ using namespace std; // safeChars chosen to allow simple messages/URLs/email addresses, but avoid anything // even possibly remotely dangerous like & or > -static string safeChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 .,;_/:?@"); +static string safeChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 .,;_/:?@()"); string SanitizeString(const string& str) { string strResult; From 20a11ffabf0c6936ab2dbb7cfda676996318650a Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 25 Sep 2014 09:03:30 +0200 Subject: [PATCH 0755/1288] minor variable init changes in init.cpp - explicit init of pcoinsdbview and pwalletMain (even if not needed, as globals are init to NULL, it seems cleaner) - remove check if (pwalletMain) in Shutdown() as delete is valid even if pwalletMain is NULL --- src/init.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 7299bd0f4a..87b5ae7a44 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -45,7 +45,7 @@ using namespace boost; using namespace std; #ifdef ENABLE_WALLET -CWallet* pwalletMain; +CWallet* pwalletMain = NULL; #endif #ifdef WIN32 @@ -109,7 +109,7 @@ bool ShutdownRequested() return fRequestShutdown; } -static CCoinsViewDB *pcoinsdbview; +static CCoinsViewDB *pcoinsdbview = NULL; void Shutdown() { @@ -165,8 +165,8 @@ void Shutdown() #endif UnregisterAllWallets(); #ifdef ENABLE_WALLET - if (pwalletMain) - delete pwalletMain; + delete pwalletMain; + pwalletMain = NULL; #endif LogPrintf("%s: done\n", __func__); } @@ -701,6 +701,7 @@ bool AppInit2(boost::thread_group& threadGroup) fIsBareMultisigStd = GetArg("-permitbaremultisig", true) != 0; // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log + // Sanity check if (!InitSanityCheck()) return InitError(_("Initialization sanity check failed. Bitcoin Core is shutting down.")); From 1e7350486582fafc651d07a43d209d30eaaef1d7 Mon Sep 17 00:00:00 2001 From: ENikS Date: Tue, 2 Sep 2014 17:36:45 -0400 Subject: [PATCH 0756/1288] Fixing C4146 warning Rebased-By: Wladimir J. van der Laan --- src/script/script.h | 2 +- src/util.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/script/script.h b/src/script/script.h index 4c9ac74b78..4aea439e01 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -304,7 +304,7 @@ private: // If the input vector's most significant byte is 0x80, remove it from // the result's msb and return a negative. if (vch.back() & 0x80) - return -(result & ~(0x80ULL << (8 * (vch.size() - 1)))); + return -((int64_t)(result & ~(0x80ULL << (8 * (vch.size() - 1))))); return result; } diff --git a/src/util.cpp b/src/util.cpp index f387fce8c7..632d0965bf 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -618,7 +618,7 @@ void ShrinkDebugFile() { // Restart the file with some of the end std::vector vch(200000,0); - fseek(file, -vch.size(), SEEK_END); + fseek(file, -((long)vch.size()), SEEK_END); int nBytes = fread(begin_ptr(vch), 1, vch.size(), file); fclose(file); From 2027ad30e7b436b1341a0013398732c10f880bb9 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 23 Sep 2014 16:59:03 -0400 Subject: [PATCH 0757/1288] depends: add the debug/release concept to depends --- depends/Makefile | 14 ++++++++-- depends/config.site.in | 3 ++ depends/funcs.mk | 59 ++++++++++++++++++++++------------------ depends/hosts/default.mk | 5 +++- 4 files changed, 51 insertions(+), 30 deletions(-) diff --git a/depends/Makefile b/depends/Makefile index f5fb5b865f..fc763bedeb 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -22,6 +22,12 @@ host:=$(HOST) host_toolchain:=$(HOST)- endif +ifneq ($(DEBUG),) +release_type=debug +else +release_type=release +endif + base_build_dir=$(BASEDIR)/work/build base_staging_dir=$(BASEDIR)/work/staging canonical_host:=$(shell ./config.sub $(HOST)) @@ -103,12 +109,14 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_ -e 's|@STRIP@|$(toolchain_path)$(host_STRIP)|' \ -e 's|@build_os@|$(build_os)|' \ -e 's|@host_os@|$(host_os)|' \ - -e 's|@CFLAGS@|$(host_CFLAGS)|' \ - -e 's|@CXXFLAGS@|$(host_CXXFLAGS)|' \ - -e 's|@LDFLAGS@|$(host_LDFLAGS)|' \ + -e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \ + -e 's|@CXXFLAGS@|$(strip $(host_CXXFLAGS) $(host_$(release_type)_CXXFLAGS))|' \ + -e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \ + -e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \ -e 's|@no_qt@|$(NO_QT)|' \ -e 's|@no_wallet@|$(NO_WALLET)|' \ -e 's|@no_upnp@|$(NO_UPNP)|' \ + -e 's|@debug@|$(DEBUG)|' \ $< > $@ $(AT)touch $@ diff --git a/depends/config.site.in b/depends/config.site.in index 1df04eec3f..abd814ea65 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -81,4 +81,7 @@ fi if test -n "@CXXFLAGS@"; then export CXXFLAGS="@CXXFLAGS@ $CXXFLAGS" fi +if test -n "@CPPFLAGS@"; then + export CPPFLAGS="@CPPFLAGS@ $CPPFLAGS" +fi export LDFLAGS="-L$prefix/lib @LDFLAGS@ $LDFLAGS" diff --git a/depends/funcs.mk b/depends/funcs.mk index 28bfb85492..c1fc0a0e33 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -8,10 +8,10 @@ $(1)_ar=$($($(1)_type)_AR) $(1)_ranlib=$($($(1)_type)_RANLIB) $(1)_libtool=$($($(1)_type)_LIBTOOL) $(1)_nm=$($($(1)_type)_NM) -$(1)_cflags=$($($(1)_type)_CFLAGS) -$(1)_cxxflags=$($($(1)_type)_CXXFLAGS) -$(1)_ldflags=$($($(1)_type)_LDFLAGS) -L$($($(1)_type)_prefix)/lib -$(1)_cppflags:=-I$($($(1)_type)_prefix)/include +$(1)_cflags=$($($(1)_type)_CFLAGS) $($($(1)_type)_$(release_type)_CFLAGS) +$(1)_cxxflags=$($($(1)_type)_CXXFLAGS) $($($(1)_type)_$(release_type)_CXXFLAGS) +$(1)_ldflags=$($($(1)_type)_LDFLAGS) $($($(1)_type)_$(release_type)_LDFLAGS) -L$($($(1)_type)_prefix)/lib +$(1)_cppflags=$($($(1)_type)_CPPFLAGS) $($($(1)_type)_$(release_type)_CPPFLAGS) -I$($($(1)_type)_prefix)/include $(1)_recipe_hash:= endef @@ -38,7 +38,7 @@ define int_get_build_id $(eval $(1)_dependencies += $($(1)_$(host_arch)_$(host_os)_dependencies) $($(1)_$(host_os)_dependencies)) $(eval $(1)_all_dependencies:=$(call int_get_all_dependencies,$(1),$($($(1)_type)_native_toolchain) $($(1)_dependencies))) $(foreach dep,$($(1)_all_dependencies),$(eval $(1)_build_id_deps+=$(dep)-$($(dep)_version)-$($(dep)_recipe_hash))) -$(eval $(1)_build_id_long:=$(1)-$($(1)_version)-$($(1)_recipe_hash) $($(1)_build_id_deps)) +$(eval $(1)_build_id_long:=$(1)-$($(1)_version)-$($(1)_recipe_hash)-$(release_type) $($(1)_build_id_deps)) $(eval $(1)_build_id:=$(shell echo -n "$($(1)_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH))) final_build_id_long+=$($(package)_build_id_long) @@ -83,33 +83,40 @@ endef define int_config_attach_build_config $(eval $(call $(1)_set_vars,$(1))) -$(1)_cflags+=$($(1)_cflags_$(host_arch)) -$(1)_cflags+=$($(1)_cflags_$(host_os)) -$(1)_cflags+=$($(1)_cflags_$(host_arch)_$(host_os)) +$(1)_cflags+=$($(1)_cflags_$(release_type)) +$(1)_cflags+=$($(1)_cflags_$(host_arch)) $($(1)_cflags_$(host_arch)_$(release_type)) +$(1)_cflags+=$($(1)_cflags_$(host_os)) $($(1)_cflags_$(host_os)_$(release_type)) +$(1)_cflags+=$($(1)_cflags_$(host_arch)_$(host_os)) $($(1)_cflags_$(host_arch)_$(host_os)_$(release_type)) -$(1)_cxxflags+=$($(1)_cxxflags_$(host_arch)) -$(1)_cxxflags+=$($(1)_cxxflags_$(host_os)) -$(1)_cxxflags+=$($(1)_cxxflags_$(host_arch)_$(host_os)) +$(1)_cxxflags+=$($(1)_cxxflags_$(release_type)) +$(1)_cxxflags+=$($(1)_cxxflags_$(host_arch)) $($(1)_cxxflags_$(host_arch)_$(release_type)) +$(1)_cxxflags+=$($(1)_cxxflags_$(host_os)) $($(1)_cxxflags_$(host_os)_$(release_type)) +$(1)_cxxflags+=$($(1)_cxxflags_$(host_arch)_$(host_os)) $($(1)_cxxflags_$(host_arch)_$(host_os)_$(release_type)) -$(1)_cppflags+=$($(1)_cppflags_$(host_arch)) -$(1)_cppflags+=$($(1)_cppflags_$(host_os)) -$(1)_cppflags+=$($(1)_cppflags_$(host_arch)_$(host_os)) +$(1)_cppflags+=$($(1)_cppflags_$(release_type)) +$(1)_cppflags+=$($(1)_cppflags_$(host_arch)) $($(1)_cppflags_$(host_arch)_$(release_type)) +$(1)_cppflags+=$($(1)_cppflags_$(host_os)) $($(1)_cppflags_$(host_os)_$(release_type)) +$(1)_cppflags+=$($(1)_cppflags_$(host_arch)_$(host_os)) $($(1)_cppflags_$(host_arch)_$(host_os)_$(release_type)) -$(1)_ldflags+=$($(1)_ldflags_$(host_arch)) -$(1)_ldflags+=$($(1)_ldflags_$(host_os)) -$(1)_ldflags+=$($(1)_ldflags_$(host_arch)_$(host_os)) +$(1)_ldflags+=$($(1)_ldflags_$(release_type)) +$(1)_ldflags+=$($(1)_ldflags_$(host_arch)) $($(1)_ldflags_$(host_arch)_$(release_type)) +$(1)_ldflags+=$($(1)_ldflags_$(host_os)) $($(1)_ldflags_$(host_os)_$(release_type)) +$(1)_ldflags+=$($(1)_ldflags_$(host_arch)_$(host_os)) $($(1)_ldflags_$(host_arch)_$(host_os)_$(release_type)) -$(1)_build_opts+=$$($(1)_build_opts_$(host_arch)) -$(1)_build_opts+=$$($(1)_build_opts_$(host_os)) -$(1)_build_opts+=$$($(1)_build_opts_$(host_arch)_$(host_os)) +$(1)_build_opts+=$$($(1)_build_opts_$(release_type)) +$(1)_build_opts+=$$($(1)_build_opts_$(host_arch)) $$($(1)_build_opts_$(host_arch)_$(release_type)) +$(1)_build_opts+=$$($(1)_build_opts_$(host_os)) $$($(1)_build_opts_$(host_os)_$(release_type)) +$(1)_build_opts+=$$($(1)_build_opts_$(host_arch)_$(host_os)) $$($(1)_build_opts_$(host_arch)_$(host_os)_$(release_type)) -$(1)_config_opts+=$$($(1)_config_opts_$(host_arch)) -$(1)_config_opts+=$$($(1)_config_opts_$(host_os)) -$(1)_config_opts+=$$($(1)_config_opts_$(host_arch)_$(host_os)) +$(1)_config_opts+=$$($(1)_config_opts_$(release_type)) +$(1)_config_opts+=$$($(1)_config_opts_$(host_arch)) $$($(1)_config_opts_$(host_arch)_$(release_type)) +$(1)_config_opts+=$$($(1)_config_opts_$(host_os)) $$($(1)_config_opts_$(host_os)_$(release_type)) +$(1)_config_opts+=$$($(1)_config_opts_$(host_arch)_$(host_os)) $$($(1)_config_opts_$(host_arch)_$(host_os)_$(release_type)) -$(1)_config_env+=$($(1)_config_env_$(host_arch)) -$(1)_config_env+=$($(1)_config_env_$(host_os)) -$(1)_config_env+=$($(1)_config_env_$(host_arch)_$(host_os)) +$(1)_config_env+=$$($(1)_config_env_$(release_type)) +$(1)_config_env+=$($(1)_config_env_$(host_arch)) $($(1)_config_env_$(host_arch)_$(release_type)) +$(1)_config_env+=$($(1)_config_env_$(host_os)) $($(1)_config_env_$(host_os)_$(release_type)) +$(1)_config_env+=$($(1)_config_env_$(host_arch)_$(host_os)) $($(1)_config_env_$(host_arch)_$(host_os)_$(release_type)) $(1)_config_env+=PKG_CONFIG_LIBDIR=$($($(1)_type)_prefix)/lib/pkgconfig $(1)_config_env+=PKG_CONFIG_PATH=$($($(1)_type)_prefix)/share/pkgconfig diff --git a/depends/hosts/default.mk b/depends/hosts/default.mk index b9fe5d858a..6f60d6b3fd 100644 --- a/depends/hosts/default.mk +++ b/depends/hosts/default.mk @@ -11,13 +11,16 @@ default_host_NM = $(host_toolchain)nm define add_host_tool_func $(host_os)_$1?=$$(default_host_$1) $(host_arch)_$(host_os)_$1?=$$($(host_os)_$1) +$(host_arch)_$(host_os)_$(release_type)_$1?=$$($(host_os)_$1) host_$1=$$($(host_arch)_$(host_os)_$1) endef define add_host_flags_func $(host_arch)_$(host_os)_$1 += $($(host_os)_$1) +$(host_arch)_$(host_os)_$(release_type)_$1 += $($(host_os)_$(release_type)_$1) host_$1 = $$($(host_arch)_$(host_os)_$1) +host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1) endef $(foreach tool,CC CXX AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL,$(eval $(call add_host_tool_func,$(tool)))) -$(foreach flags,CFLAGS CXXFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags)))) +$(foreach flags,CFLAGS CXXFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags)))) From f3973040028d6a7335a3265fa0e13b599b2fac3d Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 23 Sep 2014 17:00:31 -0400 Subject: [PATCH 0758/1288] depends: add debug/release flags for linux/osx/win Linux and mingw enable libstdc++ debugging for extra runtime checks. OSX doesn't play nice, so don't enable it there. --- depends/hosts/darwin.mk | 10 +++++++++- depends/hosts/linux.mk | 10 +++++++++- depends/hosts/mingw32.mk | 10 +++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 9e2415655e..8d718eba17 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -3,6 +3,14 @@ OSX_SDK_VERSION=10.7 OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -darwin_CFLAGS=-pipe -O2 + +darwin_CFLAGS=-pipe darwin_CXXFLAGS=$(darwin_CFLAGS) + +darwin_release_CFLAGS=-O2 +darwin_release_CXXFLAGS=$(darwin_release_CFLAGS) + +darwin_debug_CFLAGS=-O1 +darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS) + darwin_native_toolchain=native_cctools diff --git a/depends/hosts/linux.mk b/depends/hosts/linux.mk index 194d71d557..b13a0f1ad7 100644 --- a/depends/hosts/linux.mk +++ b/depends/hosts/linux.mk @@ -1,6 +1,14 @@ -linux_CFLAGS=-pipe -O2 +linux_CFLAGS=-pipe linux_CXXFLAGS=$(linux_CFLAGS) +linux_release_CFLAGS=-O2 +linux_release_CXXFLAGS=$(linux_release_CFLAGS) + +linux_debug_CFLAGS=-O1 +linux_debug_CXXFLAGS=$(linux_debug_CFLAGS) + +linux_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC + ifeq (86,$(findstring 86,$(build_arch))) i686_linux_CC=gcc -m32 i686_linux_CXX=g++ -m32 diff --git a/depends/hosts/mingw32.mk b/depends/hosts/mingw32.mk index ffe4a55842..dbfb62fdcf 100644 --- a/depends/hosts/mingw32.mk +++ b/depends/hosts/mingw32.mk @@ -1,2 +1,10 @@ -mingw32_CFLAGS=-pipe -O2 +mingw32_CFLAGS=-pipe mingw32_CXXFLAGS=$(mingw32_CFLAGS) + +mingw32_release_CFLAGS=-O2 +mingw32_release_CXXFLAGS=$(mingw32_release_CFLAGS) + +mingw32_debug_CFLAGS=-O1 +mingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS) + +mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC From 7e99df78c4e9f93f2f31298c00bb5568bfd42a43 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 23 Sep 2014 17:02:22 -0400 Subject: [PATCH 0759/1288] depends: make sure openssl sees cppflags --- depends/packages/openssl.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/openssl.mk b/depends/packages/openssl.mk index b1dcc6f81f..3ccdaf6f2f 100644 --- a/depends/packages/openssl.mk +++ b/depends/packages/openssl.mk @@ -9,7 +9,7 @@ $(package)_config_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$( $(package)_config_opts=--prefix=$(host_prefix) --openssldir=$(host_prefix)/etc/openssl no-zlib no-shared no-dso $(package)_config_opts+=no-krb5 no-camellia no-capieng no-cast no-cms no-dtls1 no-gost no-gmp no-heartbeats no-idea no-jpake no-md2 $(package)_config_opts+=no-mdc2 no-rc5 no-rdrand no-rfc3779 no-rsax no-sctp no-seed no-sha0 no-static_engine no-whirlpool no-rc2 no-rc4 no-ssl3 -$(package)_config_opts+=$($(package)_cflags) +$(package)_config_opts+=$($(package)_cflags) $($(package)_cppflags) $(package)_config_opts_x86_64_linux=-fPIC linux-x86_64 $(package)_config_opts_arm_linux=-fPIC linux-generic32 $(package)_config_opts_x86_64_darwin=darwin64-x86_64-cc From 3b63df5fac7c65c87036aec2bdf8130b74873577 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 23 Sep 2014 17:03:09 -0400 Subject: [PATCH 0760/1288] depends: boost: build for debug or release as requested Also hook up cppflags there, which was missing before. --- depends/packages/boost.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index a3cacbcbb6..98ed3de772 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -6,8 +6,10 @@ $(package)_sha256_hash=fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7 $(package)_patches=darwin_boost_atomic-1.patch darwin_boost_atomic-2.patch define $(package)_set_vars +$(package)_config_opts_release=variant=release +$(package)_config_opts_debug=variant=debug $(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam -$(package)_config_opts+=variant=release threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1 +$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1 $(package)_config_opts_linux=threadapi=pthread runtime-link=shared $(package)_config_opts_darwin=--toolset=darwin-4.2.1 runtime-link=shared $(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static @@ -26,7 +28,7 @@ endef define $(package)_preprocess_cmds patch -p2 < $($(package)_patch_dir)/darwin_boost_atomic-1.patch && \ patch -p2 < $($(package)_patch_dir)/darwin_boost_atomic-2.patch && \ - echo "using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cxxflags)\" \"$($(package)_ldflags)\" \"$(boost_archiver_$(host_os))\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam + echo "using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cxxflags) $($(package)_cppflags)\" \"$($(package)_ldflags)\" \"$(boost_archiver_$(host_os))\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam endef define $(package)_config_cmds From 1d154db4570a523362366ba5698b9692edc998a2 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 23 Sep 2014 17:41:42 -0400 Subject: [PATCH 0761/1288] depends: teach qt to honor debug/release This means it also needs to honor our flags, so patch them in as necessary. --- depends/packages/qt.mk | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index e719e2e506..5fbab57dd4 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -10,8 +10,9 @@ $(package)_qt_libs=corelib network widgets gui plugins testlib $(package)_patches=mac-qmake.conf fix-xcb-include-order.patch qt5-tablet-osx.patch define $(package)_set_vars -$(package)_config_opts = -release -opensource -confirm-license -$(package)_config_opts += -no-audio-backend -no-sql-tds -no-glib -no-icu +$(package)_config_opts_release = -release +$(package)_config_opts_debug = -debug +$(package)_config_opts += -opensource -confirm-license -no-audio-backend -no-sql-tds -no-glib -no-icu $(package)_config_opts += -no-cups -no-iconv -no-gif -no-audio-backend -no-freetype $(package)_config_opts += -no-sql-sqlite -no-nis -no-cups -no-iconv -no-pch $(package)_config_opts += -no-gif -no-feature-style-plastique @@ -53,7 +54,13 @@ define $(package)_preprocess_cmds cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\ cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \ patch -p1 < $($(package)_patch_dir)/fix-xcb-include-order.patch && \ - patch -p1 < $($(package)_patch_dir)/qt5-tablet-osx.patch + patch -p1 < $($(package)_patch_dir)/qt5-tablet-osx.patch && \ + echo "QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ + echo "QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ + echo "QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ + sed -i.old "s|QMAKE_CFLAGS = |QMAKE_CFLAGS = $($(package)_cflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \ + sed -i.old "s|QMAKE_LFLAGS = |QMAKE_LFLAGS = $($(package)_ldflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \ + sed -i.old "s|QMAKE_CXXFLAGS = |QMAKE_CXXFLAGS = $($(package)_cxxflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf endef define $(package)_config_cmds From b1efba82982ea9e120ced226bdbff6402bc99f64 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 23 Sep 2014 19:27:57 -0400 Subject: [PATCH 0762/1288] depends: give miniupnpc cppflags --- depends/packages/miniupnpc.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/miniupnpc.mk b/depends/packages/miniupnpc.mk index 30f2d3f315..00101f1b91 100644 --- a/depends/packages/miniupnpc.mk +++ b/depends/packages/miniupnpc.mk @@ -8,7 +8,7 @@ define $(package)_set_vars $(package)_build_opts=CC="$($(package)_cc)" $(package)_build_opts_darwin=OS=Darwin $(package)_build_opts_mingw32=-f Makefile.mingw -$(package)_build_env+=CFLAGS="$($(package)_cflags)" AR="$($(package)_ar)" +$(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)" endef define $(package)_preprocess_cmds From dc66ff53b4b4d31fda4ec4ee500a6a8f98bae6ac Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 23 Sep 2014 17:52:43 -0400 Subject: [PATCH 0763/1288] depends: make LDFLAGS act like the other flags --- depends/config.site.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/depends/config.site.in b/depends/config.site.in index abd814ea65..c80c3e8f20 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -52,7 +52,9 @@ export PATH=$prefix/native/bin:$PATH export PKG_CONFIG="`which pkg-config` --static" export PKG_CONFIG_LIBDIR=$prefix/lib/pkgconfig export PKG_CONFIG_PATH=$prefix/share/pkgconfig + export CPPFLAGS="-I$prefix/include/ $CPPFLAGS" +export LDFLAGS="-L$prefix/lib $LDFLAGS" export CC="@CC@" export CXX="@CXX@" @@ -84,4 +86,6 @@ fi if test -n "@CPPFLAGS@"; then export CPPFLAGS="@CPPFLAGS@ $CPPFLAGS" fi -export LDFLAGS="-L$prefix/lib @LDFLAGS@ $LDFLAGS" +if test -n "@LDFLAGS@"; then + export LDFLAGS="@LDFLAGS@ $LDFLAGS" +fi From 1f7fff2beea20c3f1bf5a4496f81cb9be9e0e07e Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 23 Sep 2014 17:51:10 -0400 Subject: [PATCH 0764/1288] depends: add docs for debug --- depends/README.packages | 12 ++++++++++++ depends/README.usage | 1 + 2 files changed, 13 insertions(+) diff --git a/depends/README.packages b/depends/README.packages index c35abfbdc1..5ab7ed7dee 100644 --- a/depends/README.packages +++ b/depends/README.packages @@ -65,10 +65,22 @@ These variables may be set to override or append their default values. $(package)_config_env $(package)_build_env $(package)_stage_env + $(package)_build_opts + $(package)_config_opts The *_env variables are used to add environment variables to the respective commands. +Many variables respect a debug/release suffix as well, in order to use them for +only the appropriate build config. For example: + $(package)_cflags_release = -O3 + $(package)_cflags_i686_debug = -g + $(package)_config_opts_release = --disable-debug + +These will be used in addition to the options that do not specify +debug/release. All builds are considered to be release unless DEBUG=1 is set by +the user. + Other variables may be defined as needed. Build commands: diff --git a/depends/README.usage b/depends/README.usage index 0aacefbf94..d3c57956f1 100644 --- a/depends/README.usage +++ b/depends/README.usage @@ -22,6 +22,7 @@ FALLBACK_DOWNLOAD_PATH: If a source file can't be fetched, try here before givin NO_QT: Don't download/build/cache qt and its dependencies NO_WALLET: Don't download/build/cache libs needed to enable the wallet NO_UPNP: Don't download/build/cache packages needed for enabling upnp +DEBUG: disable some optimizations and enable more runtime checking If some packages are not built, for example 'make NO_WALLET=1', the appropriate options will be passed to bitcoin's configure. In this case, --disable-wallet. From 00522cd45b7c093975a7684876b26abeced58da9 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 23 Sep 2014 18:18:03 -0400 Subject: [PATCH 0765/1288] depends: disable reduced exports for debug builds Some debug options may not be compatible. --- depends/config.site.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/depends/config.site.in b/depends/config.site.in index c80c3e8f20..3426050cd3 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -77,6 +77,10 @@ if test -n "@NM@"; then ac_cv_path_ac_pt_NM=${NM} fi +if test -n "@debug@"; then + enable_reduce_exports=no +fi + if test -n "@CFLAGS@"; then export CFLAGS="@CFLAGS@ $CFLAGS" fi From a94496fbb672fce43b66f56ed0bbd69a560d5654 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 23 Sep 2014 16:53:34 -0400 Subject: [PATCH 0766/1288] tests: don't split an empty string --- src/test/getarg_tests.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/getarg_tests.cpp b/src/test/getarg_tests.cpp index 8cadcdd716..8a984304f4 100644 --- a/src/test/getarg_tests.cpp +++ b/src/test/getarg_tests.cpp @@ -16,7 +16,8 @@ BOOST_AUTO_TEST_SUITE(getarg_tests) static void ResetArgs(const std::string& strArg) { std::vector vecArg; - boost::split(vecArg, strArg, boost::is_space(), boost::token_compress_on); + if (strArg.size()) + boost::split(vecArg, strArg, boost::is_space(), boost::token_compress_on); // Insert dummy executable name: vecArg.insert(vecArg.begin(), "testbitcoin"); From be6d87aa60c1aca886b557901a493119c2aac024 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 23 Sep 2014 16:53:58 -0400 Subject: [PATCH 0767/1288] script: don't read past the end --- src/script/interpreter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index d742fb9eb9..a71f55dd26 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -839,7 +839,8 @@ public: itBegin = it; } } - s.write((char*)&itBegin[0], it-itBegin); + if (itBegin != scriptCode.end()) + s.write((char*)&itBegin[0], it-itBegin); } /** Serialize an input of txTo */ From 93e24dddf3b7063a157b414c07e08ac7f31eaf03 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 23 Sep 2014 18:19:09 -0400 Subject: [PATCH 0768/1288] travis: use debug for one build For the all-off build, enable the wallet and debug. This ensures that debug options will catch wallet problems as well. In order to make sure the no-wallet path is still tested, disable the wallet in the other x86_64 build. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 54799362a2..155ac012d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,9 +27,9 @@ matrix: - compiler: "true 1" env: HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="NO_QT=1" GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" - compiler: "true 2" - env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_QT=1 NO_WALLET=1 NO_UPNP=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat CPPFLAGS=-DDEBUG_LOCKORDER" + env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat CPPFLAGS=-DDEBUG_LOCKORDER" - compiler: "true 3" - env: HOST=x86_64-unknown-linux-gnu RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" + env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" - compiler: "true 4" env: HOST=i686-pc-linux-gnu PACKAGES="g++-multilib" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" - compiler: "true 5" From 27c3e91014d65091b096b97680b95d1b130a284d Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 24 Sep 2014 21:53:19 -0400 Subject: [PATCH 0769/1288] qt: add proxy to options overridden if necessary. If proxy is disabled in the gui but enabled via the command line, it needs to be added to the override list. --- src/qt/optionsmodel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index bd747faeb6..21e390eb6d 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -119,6 +119,8 @@ void OptionsModel::Init() // Only try to set -proxy, if user has enabled fUseProxy if (settings.value("fUseProxy").toBool() && !SoftSetArg("-proxy", settings.value("addrProxy").toString().toStdString())) addOverriddenOption("-proxy"); + else if(!settings.value("fUseProxy").toBool() && !GetArg("-proxy", "").empty()) + addOverriddenOption("-proxy"); // Display if (!settings.contains("language")) From eee030f6bc62117b4d3c27aa78818964d95a7063 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 25 Sep 2014 19:25:19 -0400 Subject: [PATCH 0770/1288] autofile: don't copy CAutoFile by value --- src/init.cpp | 2 +- src/main.cpp | 8 ++++---- src/net.cpp | 4 ++-- src/test/checkblock_tests.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 7299bd0f4a..27594ecbe3 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1058,7 +1058,7 @@ bool AppInit2(boost::thread_group& threadGroup) } boost::filesystem::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME; - CAutoFile est_filein = CAutoFile(fopen(est_path.string().c_str(), "rb"), SER_DISK, CLIENT_VERSION); + CAutoFile est_filein(fopen(est_path.string().c_str(), "rb"), SER_DISK, CLIENT_VERSION); // Allowed to fail as this file IS missing on first startup. if (est_filein) mempool.ReadFeeEstimates(est_filein); diff --git a/src/main.cpp b/src/main.cpp index 15c3916a6f..60e2a56795 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1082,7 +1082,7 @@ bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock bool WriteBlockToDisk(CBlock& block, CDiskBlockPos& pos) { // Open history file to append - CAutoFile fileout = CAutoFile(OpenBlockFile(pos), SER_DISK, CLIENT_VERSION); + CAutoFile fileout(OpenBlockFile(pos), SER_DISK, CLIENT_VERSION); if (!fileout) return error("WriteBlockToDisk : OpenBlockFile failed"); @@ -1110,7 +1110,7 @@ bool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos) block.SetNull(); // Open history file to read - CAutoFile filein = CAutoFile(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION); + CAutoFile filein(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION); if (!filein) return error("ReadBlockFromDisk : OpenBlockFile failed"); @@ -4503,7 +4503,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) bool CBlockUndo::WriteToDisk(CDiskBlockPos &pos, const uint256 &hashBlock) { // Open history file to append - CAutoFile fileout = CAutoFile(OpenUndoFile(pos), SER_DISK, CLIENT_VERSION); + CAutoFile fileout(OpenUndoFile(pos), SER_DISK, CLIENT_VERSION); if (!fileout) return error("CBlockUndo::WriteToDisk : OpenUndoFile failed"); @@ -4535,7 +4535,7 @@ bool CBlockUndo::WriteToDisk(CDiskBlockPos &pos, const uint256 &hashBlock) bool CBlockUndo::ReadFromDisk(const CDiskBlockPos &pos, const uint256 &hashBlock) { // Open history file to read - CAutoFile filein = CAutoFile(OpenUndoFile(pos, true), SER_DISK, CLIENT_VERSION); + CAutoFile filein(OpenUndoFile(pos, true), SER_DISK, CLIENT_VERSION); if (!filein) return error("CBlockUndo::ReadFromDisk : OpenBlockFile failed"); diff --git a/src/net.cpp b/src/net.cpp index ab547e2fd7..866bac2c0e 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1957,7 +1957,7 @@ bool CAddrDB::Write(const CAddrMan& addr) // open temp output file, and associate with CAutoFile boost::filesystem::path pathTmp = GetDataDir() / tmpfn; FILE *file = fopen(pathTmp.string().c_str(), "wb"); - CAutoFile fileout = CAutoFile(file, SER_DISK, CLIENT_VERSION); + CAutoFile fileout(file, SER_DISK, CLIENT_VERSION); if (!fileout) return error("%s : Failed to open file %s", __func__, pathTmp.string()); @@ -1982,7 +1982,7 @@ bool CAddrDB::Read(CAddrMan& addr) { // open input file, and associate with CAutoFile FILE *file = fopen(pathAddr.string().c_str(), "rb"); - CAutoFile filein = CAutoFile(file, SER_DISK, CLIENT_VERSION); + CAutoFile filein(file, SER_DISK, CLIENT_VERSION); if (!filein) return error("%s : Failed to open file %s", __func__, pathAddr.string()); diff --git a/src/test/checkblock_tests.cpp b/src/test/checkblock_tests.cpp index fdea12846a..67d40a45c7 100644 --- a/src/test/checkblock_tests.cpp +++ b/src/test/checkblock_tests.cpp @@ -35,7 +35,7 @@ bool read_block(const std::string& filename, CBlock& block) fseek(fp, 8, SEEK_SET); // skip msgheader/size - CAutoFile filein = CAutoFile(fp, SER_DISK, CLIENT_VERSION); + CAutoFile filein(fp, SER_DISK, CLIENT_VERSION); if (!filein) return false; filein >> block; From 6eb67b0ed2b350b772f7edb67aee1bcf09c91b0b Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 25 Sep 2014 19:25:47 -0400 Subject: [PATCH 0771/1288] autofile: Disallow by-value copies of CAutoFile One might assume that CAutoFile would be ref-counted so that a copied object would delay closing the underlying file until all copies have gone out of scope. Since that's not the case with CAutoFile, explicitly disable copying. --- src/serialize.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/serialize.h b/src/serialize.h index 447d808dee..7f8f933284 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -1154,7 +1154,7 @@ public: -/** RAII wrapper for FILE*. +/** Non-refcounted RAII wrapper for FILE*. * * Will automatically close the file when it goes out of scope if not null. * If you're returning the file pointer, return file.release(). @@ -1162,6 +1162,10 @@ public: */ class CAutoFile { +private: + // Disallow copies + CAutoFile(const CAutoFile&); + CAutoFile& operator=(const CAutoFile&); protected: FILE* file; public: From 8138cbea3c405e142d70b43b6c452e1738de3332 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 20 Sep 2014 03:13:04 +0200 Subject: [PATCH 0772/1288] Add automatic script test generation, and actual checksig tests --- src/core_io.h | 1 + src/core_write.cpp | 35 ++++ src/key.cpp | 8 +- src/key.h | 2 +- src/test/data/script_invalid.json | 24 +-- src/test/data/script_valid.json | 25 +-- src/test/script_tests.cpp | 325 +++++++++++++++++++++++++++++- src/test/transaction_tests.cpp | 42 ++-- 8 files changed, 413 insertions(+), 49 deletions(-) diff --git a/src/core_io.h b/src/core_io.h index 6268a3bf58..94848f1c3d 100644 --- a/src/core_io.h +++ b/src/core_io.h @@ -20,6 +20,7 @@ extern uint256 ParseHashUV(const UniValue& v, const std::string& strName); extern std::vector ParseHexUV(const UniValue& v, const std::string& strName); // core_write.cpp +extern std::string FormatScript(const CScript& script); extern std::string EncodeHexTx(const CTransaction& tx); extern void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex); diff --git a/src/core_write.cpp b/src/core_write.cpp index cd64aabf63..40d547fb33 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -17,6 +17,41 @@ using namespace std; +string FormatScript(const CScript& script) +{ + string ret; + CScript::const_iterator it = script.begin(); + opcodetype op; + while (it != script.end()) { + CScript::const_iterator it2 = it; + vector vch; + if (script.GetOp2(it, op, &vch)) { + if (op == OP_0) { + ret += "0 "; + continue; + } else if ((op >= OP_1 && op <= OP_16) || op == OP_1NEGATE) { + ret += strprintf("%i ", op - OP_1NEGATE - 1); + continue; + } else if (op >= OP_NOP && op <= OP_CHECKMULTISIGVERIFY) { + string str(GetOpName(op)); + if (str.substr(0, 3) == string("OP_")) { + ret += str.substr(3, string::npos) + " "; + continue; + } + } + if (vch.size() > 0) { + ret += strprintf("0x%x 0x%x ", HexStr(it2, it - vch.size()), HexStr(it - vch.size(), it)); + } else { + ret += strprintf("0x%x", HexStr(it2, it)); + } + continue; + } + ret += strprintf("0x%x ", HexStr(it2, script.end())); + break; + } + return ret.substr(0, ret.size() - 1); +} + string EncodeHexTx(const CTransaction& tx) { CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); diff --git a/src/key.cpp b/src/key.cpp index 8ed787654a..c2251b4f2a 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -220,7 +220,7 @@ public: return o2i_ECPublicKey(&pkey, &pbegin, pubkey.size()) != NULL; } - bool Sign(const uint256 &hash, std::vector& vchSig) { + bool Sign(const uint256 &hash, std::vector& vchSig, bool lowS) { vchSig.clear(); ECDSA_SIG *sig = ECDSA_do_sign((unsigned char*)&hash, sizeof(hash), pkey); if (sig == NULL) @@ -232,7 +232,7 @@ public: BIGNUM *halforder = BN_CTX_get(ctx); EC_GROUP_get_order(group, order, ctx); BN_rshift1(halforder, order); - if (BN_cmp(sig->s, halforder) > 0) { + if (lowS && BN_cmp(sig->s, halforder) > 0) { // enforce low S values, by negating the value (modulo the order) if above order/2. BN_sub(sig->s, order, sig->s); } @@ -467,7 +467,7 @@ CPubKey CKey::GetPubKey() const { return pubkey; } -bool CKey::Sign(const uint256 &hash, std::vector& vchSig) const { +bool CKey::Sign(const uint256 &hash, std::vector& vchSig, bool lowS) const { if (!fValid) return false; #ifdef USE_SECP256K1 @@ -484,7 +484,7 @@ bool CKey::Sign(const uint256 &hash, std::vector& vchSig) const { #else CECKey key; key.SetSecretBytes(vch); - return key.Sign(hash, vchSig); + return key.Sign(hash, vchSig, lowS); #endif } diff --git a/src/key.h b/src/key.h index 3863e95cff..f6f6d35d34 100644 --- a/src/key.h +++ b/src/key.h @@ -276,7 +276,7 @@ public: CPubKey GetPubKey() const; // Create a DER-serialized signature. - bool Sign(const uint256& hash, std::vector& vchSig) const; + bool Sign(const uint256& hash, std::vector& vchSig, bool lowS = true) const; // Create a compact signature (65 bytes), which allows reconstructing the used public key. // The format is one header byte, followed by two times 32 bytes for the serialized r and s values. diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index 401031ad12..35a6794b01 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -384,18 +384,18 @@ nSequences are max. ["0x00", "'00' EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"], -["0x48 0x3045022100ea4d62e1fb351ad977596457bb01dfce58e050541784277bd825c33bd98c2a9502203003347cf04573be4dc786c3fc5e7db09821565bf45c7d60160709b962f0398401 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH,STRICTENC", "Normal pay to pubkeyhash with wrong signature"], -["0x47 0x304402207d09de5e34968c3f8b27d8217f173629f1106ee5216aa11d6b1f9813b3a214060220610a6ed25c704f901c6278f4f57fb11eadefdf0b22df298cfb6ce7ea84c86bf401 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH,STRICTENC", "Normal pay to pubkeyhash using an anyonecanpay sighash"], -["0x47 0x3044022028686fb3c8d3e5068cc9924c494fb5026df201d23340896da62fe9bb73fd9d5f02202a239609524959c4ca3651fd0cc48245b0b240862146fc579f3a962a4f46942b01", "0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKSIG", "P2SH,STRICTENC", "Normal pay to pubkey with wrong signature"], -["0x47 0x3044022054cb0a3fca8694a0c231848ed9f965078148fd653e49dd4b6981fadac0f5ba0702204085be5af427d4561f13a07fd5a1c5ab0ff02126e9ba191448f5a9dae0da585301 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x19 0x76a914751e76e8199196d454941c45d1b3a323f1433bd688ac", "HASH160 0x14 0xcd7b44d0b03f2d026d1e586d7ae18903b0d385f6 EQUAL", "P2SH,STRICTENC", "P2SH with a pay to pubkeyhash inside with wrong signature"], -["0 0x48 0x3045022100e1c4e8800bd00c9ec3cd3df0e53e63bc5e8c018d0b68099a652f0b121f1a7e020220108dab275be7d1358530d3451d48aed747af77cc54e0423cbae5c572b2e1abb801", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG", "P2SH,STRICTENC", "Raw multisig with one pubkey with wrong signature"], -["0x49 0x304602220000ea4d62e1fb351ad977596457bb01dfce58e050541774277bd825c33bd98c2a9502203003347cf04573be4dc786c3fc5e7db09821565bf45c7d60160709b962f0398401 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH,STRICTENC", "Normal pay to pubkeyhash with non-DER signature (too much R padding)"], -["0x47 0x30440220ea4d62e1fb351ad977596457bb01dfce58e050541774277bd825c33bd98c2a9502203003347cf04573be4dc786c3fc5e7db09821565bf45c7d60160709b962f0398401 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH,STRICTENC", "Normal pay to pubkeyhash with non-DER signature (too little R padding)"], -["0x49 0x3046022100ea4d62e1fb351ad977596457bb01dfce58e050541774277bd825c33bd98c2a950221003003347cf04573be4dc786c3fc5e7db09821565bf45c7d60160709b962f0398401 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH,STRICTENC", "Normal pay to pubkeyhash with non-DER signature (too much S padding)"], -["0x48 0x3045022100e6eda3fd34862078233463cae19f0b47995e3f892102e5b175175e92a9163cc402204bf58445819093638481084322b61a2d49b68c96fd6fea17ed494722d0d67b4f01", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "P2SH,STRICTENC", "Pay to pubkey with hybrid pubkey encoding"], -["0x48 0x304502203b56d65863e0cdb89313043c2402f46f518c31658648151b01ec6b5b6c89206a022100d71efefb4c24fab36abb44ade106963d8114c5af1bda033faa1923f54ec4ea6a01", "0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKSIG", "P2SH,STRICTENC,LOW_S", "Pay to pubkey with high S"], -["0x47 0x3044022054cb0a3fca8694a0c231848fd9f965078148fd653e49dd4b6980fadac0f5ba0702204085be5af427d4561f13a07fd5a1c5ab0ff02126e9ba191448f5a9dae0da585301 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x19 0x76a914751e76e8199196d454941c45d1b3a323f1433bd688ac", "HASH160 0x14 0xcd7b44d0b03f2d026d1e586d7ae18903b0d385f6 EQUAL", "P2SH,STRICTENC", "P2SH with a pay to pubkeyhash inside with invalid signature"], -["1 0x48 0x3045022100e1c4e8800bd00c9ec3cd3de0e53e63bc5e8c018d0b68099a652f0b121f1a7e020220108dab275be7d1358530d3451d48aed747af77cc54e0423cbae5c572b2e1abb801", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG", "P2SH,STRICTENC,NULLDUMMY", "Raw multisig with one pubkey with non-zero dummy"], +["0x47 0x30440220304eff7556bba9560df47873275e64db45f3cd735998ce3f00d2e57b1bb5f31302205c0c9d14b8b80d43e2ac9b87532f1af6d8a3271262bc694ec4e14068392bb0a001", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "", "P2PK, bad sig"], +["0x47 0x3044022037fcdb8e08f41e27588de8bc036d2c4b16eb3d09c1ba53b8f47a0a9c27722a39022058664b7a53b507e71dfafb77193e3786c3f0c119d78ce9104480ee7ece04f09301 0x21 0x03363d90d446b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", "DUP HASH160 0x14 0xc0834c0c158f53be706d234c38fd52de7eece656 EQUALVERIFY CHECKSIG", "", "P2PKH, bad pubkey"], +["0x47 0x3044022035e5b6742d299861c84cebaf2ea64145ee427a95facab39e2594d6deebb0c1d602200acb16778faa2e467a59006f342f2535b1418d55ba63a8605b387b7f9ac86d9a01", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", "", "P2PK anyonecanpay marked with normal hashtype"], +["0x47 0x3044022029b2b8765ca950cf75a69e80b73b7ddfcaa8b27080c2db4c23b36aae60688e790220598ff368e17872ee065aa54d7d3a590682ca5204325b23b31d7da3c4a21ae67901 0x23 0x210279be667ef9dcbbac54a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac", "HASH160 0x14 0x23b0ad3477f2178bc0b3eed26e4e6316f4e83aa1 EQUAL", "P2SH", "P2SH(P2PK), bad redeemscript"], +["0x47 0x30440220647f906e63890df5ef1d3fed47ba892b31976c634281079e2bd38504fb54a1fb022021e8811f38fbe90efb6b74cb78da01d9badbac3bafdf70a861d7538a220d0b2601 0x19 0x76a9147cf9c846cd4882efec4bf07e44ebdad495c94f4b88ac", "HASH160 0x14 0x2df519943d5acc0ef5222091f9dfe3543f489a82 EQUAL", "P2SH", "P2SH(P2PKH), bad sig"], +["0 0x47 0x304402203ef170402f8887f2ac183f31b1f503b0bc60bfc968dd469b097ea6124aefac5002200612febadc4e4cacc086982cb85830a17af3680c1b6a3cf77c1708af7621cf1301 0 0x47 0x304402207821838251a24a2234844f68e7169e6d11945cdf052ea12bd3e4e37457aceb4402200b6b46c81361e314c740ae5133c072af5fa5c209d65d2db1679e1716f19a538101", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "", "3-of-3, 2 sigs"], +["0 0 0x47 0x304402204661f7795e8db7be3132e8974e9a76d1d24b31f23df94c6fbcea07d1c205789102203f5e45a1c0b085279b58d11b36d5fea5449c3cf16f844ad10124e9b65e8777d201 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae", "HASH160 0x14 0xc9e4a896d149702d0d1695434feddd52e24ad78d EQUAL", "P2SH", "P2SH(2-of-3), 1 sig"], +["0x47 0x304402200052bc1600ca45c71f3538720fe62a5e8548dffd137af04467598c98466e9c0a0220789318ddbc9991ee477974089220a2feb6a6298a7c93d5ff6c25a92a2f4b48d501", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "STRICTENC", "P2PK with too much R padding"], +["0x48 0x304502206eb7b92628bfb3c4d2a04b65b986987bcbb1af4fceedb144d5a0437b7ee410590221005f57a52df4aa26366742eed0db182fce51fbcd7159011b0644a7c05943eb228901", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "STRICTENC", "P2PK with too much S padding"], +["0x47 0x30440220d8ad1efd55a3d2b8896495c38aba72056e1b3ca4a6ca15760e843eb1a9b9907602203eb0e8f3d6bec998262dfd03eaeb0f31c4e5105965436dec77550724b3771f3201", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "STRICTENC", "P2PK with too little R padding"], +["0x48 0x304502206c43e065c8a8db3bbe69015afb86a51fb2fc8870defd41d436da2a197d9d6c12022100fcec35816ee2d84ec271ad159fcabf5dd712157051169e48ac328a7818cdb51e01", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "LOW_S,STRICTENC", "P2PK with high S"], +["0x01 0x01 0x47 0x304402200e48ba1cf4d7182db94ffb57bd72ea31b5545dc0d1c512e665779b4fb2badc52022054b8388dfc074c708a75b62359b7be46402751ee40c0a111aef38a837b6ed09801 0x47 0x304402201c9820f59c49107bb30e6175cfc9ec95f897b03beb628b4bc854d2b80392aa0602200235d986ae418bcd111b8814f4c26a0ab5f475fb542a44884fc14912a97a252301 0x47 0x304402204cd7894c6f10a871f5b0c1f9c13228f8cdd4050248f0d0f498ee86be69ee3080022051bd2932c7d585eb600c7194235c74da820935f0d67972fd9545673aa1fd023301", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "NULLDUMMY", "3-of-3 with nonzero dummy"], ["The End"] diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index e0b527996c..653f60d982 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -529,18 +529,19 @@ nSequences are max. ["0x00", "SIZE 0 EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"], -["0x48 0x3045022100ea4d62e1fb351ad977596457bb01dfce58e050541774277bd825c33bd98c2a9502203003347cf04573be4dc786c3fc5e7db09821565bf45c7d60160709b962f0398401 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH,STRICTENC", "Normal pay to pubkeyhash"], -["0x47 0x304402207d09de5e34968c3f8b27d8217f173629f1106ee5216aa11d6b1f9813b3a214060220610a6ed25c704f901c6278f4f57fb11eadefdf0b22df298cfb6ce7ea84c86bf481 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH,STRICTENC", "Anyonecanpay pay to pubkeyhash"], -["0x47 0x3044022028686fb3c8d3e5069cc9924c494fb5026df201d23340896da62fe9bb73fd9d5f02202a239609524959c4ca3651fd0cc48245b0b240862146fc579f3a962a4f46942b01", "0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKSIG", "P2SH,STRICTENC", "Normal pay to pubkey"], -["0x47 0x3044022054cb0a3fca8694a0c231848ed9f965078148fd653e49dd4b6980fadac0f5ba0702204085be5af427d4561f13a07fd5a1c5ab0ff02126e9ba191448f5a9dae0da585301 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x19 0x76a914751e76e8199196d454941c45d1b3a323f1433bd688ac", "HASH160 0x14 0xcd7b44d0b03f2d026d1e586d7ae18903b0d385f6 EQUAL", "P2SH,STRICTENC", "P2SH with a pay to pubkeyhash inside"], -["0 0x48 0x3045022100e1c4e8800bd00c9ec3cd3de0e53e63bc5e8c018d0b68099a652f0b121f1a7e020220108dab275be7d1358530d3451d48aed747af77cc54e0423cbae5c572b2e1abb801", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG", "P2SH,STRICTENC", "Raw multisig with one pubkey"], -["0x49 0x304602220000ea4d62e1fb351ad977596457bb01dfce58e050541774277bd825c33bd98c2a9502203003347cf04573be4dc786c3fc5e7db09821565bf45c7d60160709b962f0398401 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH", "Normal pay to pubkeyhash with non-DER signature (too much R padding)"], -["0x47 0x30440220ea4d62e1fb351ad977596457bb01dfce58e050541774277bd825c33bd98c2a9502203003347cf04573be4dc786c3fc5e7db09821565bf45c7d60160709b962f0398401 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH", "Normal pay to pubkeyhash with non-DER signature (too little R padding)"], -["0x49 0x3046022100ea4d62e1fb351ad977596457bb01dfce58e050541774277bd825c33bd98c2a950221003003347cf04573be4dc786c3fc5e7db09821565bf45c7d60160709b962f0398401 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "DUP HASH160 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6 EQUALVERIFY CHECKSIG", "P2SH", "Normal pay to pubkeyhash with non-DER signature (too much S padding)"], -["0x48 0x3045022100e6eda3fd34862078233463cae19f0b47995e3f892102e5b175175e92a9163cc402204bf58445819093638481084322b61a2d49b68c96fd6fea17ed494722d0d67b4f01", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "P2SH", "Pay to pubkey with hybrid pubkey encoding"], -["0x48 0x304502203b56d65863e0cdb89313043c2402f46f518c31658648151b01ec6b5b6c89206a022100d71efefb4c24fab36abb44ade106963d8114c5af1bda033faa1923f54ec4ea6a01", "0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 CHECKSIG", "P2SH,STRICTENC", "Pay to pubkey with high S"], -["0x47 0x3044022054cb0a3fca8694a0c231848fd9f965078148fd653e49dd4b6980fadac0f5ba0702204085be5af427d4561f13a07fd5a1c5ab0ff02126e9ba191448f5a9dae0da585301 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x19 0x76a914751e76e8199196d454941c45d1b3a323f1433bd688ac", "HASH160 0x14 0xcd7b44d0b03f2d026d1e586d7ae18903b0d385f6 EQUAL", "STRICTENC", "P2SH with a pay to pubkeyhash inside with invalid signature"], -["1 0x48 0x3045022100e1c4e8800bd00c9ec3cd3de0e53e63bc5e8c018d0b68099a652f0b121f1a7e020220108dab275be7d1358530d3451d48aed747af77cc54e0423cbae5c572b2e1abb801", "1 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 1 CHECKMULTISIG", "P2SH,STRICTENC", "Raw multisig with one pubkey with non-zero dummy"], +["0x47 0x3044022007415aa37ce7eaa6146001ac8bdefca0ddcba0e37c5dc08c4ac99392124ebac802207d382307fd53f65778b07b9c63b6e196edeadf0be719130c5db21ff1e700d67501", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "", "P2PK"], +["0x47 0x3044022069d40999786aeb2fd874f9eb2636461a062dc963471627ed8390a3a5f9556f640220350132a52415ce622f2aadd07f791c591500917ec1f8c5edbc5381ef7942534d01 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", "DUP HASH160 0x14 0x1018853670f9f3b0582c5b9ee8ce93764ac32b93 EQUALVERIFY CHECKSIG", "", "P2PKH"], +["0x47 0x30440220519f2a6632ffa134c7811ea2819e9dcc951f0c7baf461f2dffdd09133f3b080a02203ec6bab5eb6619ed7f41b8701d7c6d70cfc83bb26c5c97f54b2ca6e304fc2bb581", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", "", "P2PK anyonecanpay"], +["0x47 0x30440220279dad2170ffb5639f0a1ea71fc462ee37d75d420d86f84c978bac523c09b7f20220683b2789f5c5528a9e0a0d78f6e40db3f616cf1adb5a5fdef117d5974795cfe201 0x23 0x210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac", "HASH160 0x14 0x23b0ad3477f2178bc0b3eed26e4e6316f4e83aa1 EQUAL", "P2SH", "P2SH(P2PK)"], +["0x47 0x3044022066acbfb5ac96b7cbf3f05a2aaf358c32438c45d1d7359dee9fc1ee636940735f02205606a03fd8cbf6a6fcbcba60c8abb1e385c0b5753cb57a97538159106fd3684e01 0x19 0x76a9147cf9c846cd4882efec4bf07e44ebdad495c94f4b88ac", "HASH160 0x14 0x2df519943d5acc0ef5222091f9dfe3543f489a82 EQUAL", "", "P2SH(P2PKH), bad sig but no VERIFY_P2SH"], +["0 0x47 0x3044022004e791dd30a64c70e55e84e150c002af9feb3ce0ab1f20e86c53d1209003927502205a60453987fcd72aebaaacebc8ce4b15449cdd79e54cc82cefb83e69dbcfeabf01 0x47 0x304402201d021808ce93dd8574cc4f99ae4f11b44305528b0aecbd9f156f08315173643802200944a0ea5c884bd86180aef76d8b1e444860776b251e47d2d6c651a1c6f9930801 0x47 0x30440220446336d7b7de05ebb5683b82b05248ec7d78e88ae8d6125985f5776c887a4cf90220674ab2b2c2f954ba1cf35457d273c90d0c0c1c224d0ae128628740e81129486801", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "", "3-of-3"], +["0 0x47 0x30440220288b06d057cf0eac434ed0c3be9257cc0ca144dd99c11cc8f1a49467a37d8e8002203c496c72253c528e6bc81c42e683aba974d46041a96ef7b00915c863eb2a702901 0x47 0x304402207ffb4da33f40cac839a43000a187bd76a1ee5bf95e46dc1534b38bb7bd0321db022038c078f29d1831f8eb68ffdc2634c654fb01c3467b6457b98ad220653bb2478501 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae", "HASH160 0x14 0xc9e4a896d149702d0d1695434feddd52e24ad78d EQUAL", "P2SH", "P2SH(2-of-3)"], +["0x47 0x304402200001cae94b795baaafb05db38cf24cd75560cab2c36c91e29fac7d0fd2a723a3022058e2e56e568ce7c4b2b106210d114e1faa079407a6ed4154f230667c7d3583bc01", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "", "P2PK with too much R padding but no STRICTENC"], +["0x48 0x304502206d01de7c2a40ac2bb1231ed97f3890a1782f421d4c28b97166deff317990288f0221005e720213b089355be2cf785d81a82c59307d30e1624f450ed9ca1ebbc11cca6d01", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "", "P2PK with too much S padding but no STRICTENC"], +["0x47 0x30440220f3d8889602147d60d26c1d3b21b8db183eac02bf6d2fec1424c0ef377ca6fd7b02202bae8bfe39d00a432d4538a592e338b0ffc44c17d4b7056043d55063cf91f5ef01", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "", "P2PK with too little R padding but no STRICTENC"], +["0x48 0x3045022021bf9184d94f208ac9f4757ebca9b1cbebf008cfc244fe5be1360b1b9aba0e92022100e55074f72f3a1bfddf2ea4ea7ba984f78822e136fe04c8f9c1363238e0233bd801", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "STRICTENC", "P2PK with high S but no LOW_S"], +["0x48 0x304502205c3e81aaf2aad0673f349035b180eba783eba7797af91c979920dea6b17a16d6022100d1d46825c68da1b325f320a3503dad27bb818227f64a38d153554bfd360c0e5301", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "LOW_S", "P2PK with high S but no STRICTENC"], +["0x01 0x01 0x47 0x3044022046ce33d1771b0127dd4c4cef8fdc3218ebdfa60e3793ed700292d8ebd93fb1f402201029d47a414db83e96e31443c2d8b552f971469c4800f5eff7df2f0648521aed01 0x47 0x304402205c53911ad55b054920043962bbda98cf6e57e2db1cd5611138251490baabaa8702201dc80dfceae6007e7772dc13ff6e7ca66a983cb017fe5d46d30118462d83bcf801 0x47 0x304402201937e44a4ec12364f9d32f9d25e7ecbc68aee9ef90069af80efef4c05f6ace9602206c515101c00c75710b32ff7ff8dbaf7c9a0be6e86ed14a0755b47626604f31fd01", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "", "3-of-3 with nonzero dummy but no NULLDUMMY"], ["The End"] ] diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 178b35fa2d..f9086b6a64 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -5,12 +5,13 @@ #include "data/script_invalid.json.h" #include "data/script_valid.json.h" +#include "core_io.h" #include "key.h" #include "keystore.h" #include "main.h" #include "script/script.h" #include "script/sign.h" -#include "core_io.h" +#include "util.h" #include #include @@ -36,6 +37,7 @@ using namespace boost::algorithm; static const unsigned int flags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC; unsigned int ParseScriptFlags(string strFlags); +string FormatScriptFlags(unsigned int flags); Array read_json(const std::string& jsondata) @@ -68,10 +70,8 @@ CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey) return txCredit; } -CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CScript& scriptPubKey) +CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CTransaction& txCredit) { - CMutableTransaction txCredit = BuildCreditingTransaction(scriptPubKey); - CMutableTransaction txSpend; txSpend.nVersion = 1; txSpend.nLockTime = 0; @@ -87,6 +87,317 @@ CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CSc return txSpend; } +void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, int flags, bool expect, const std::string& message) +{ + BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, BuildSpendingTransaction(scriptSig, BuildCreditingTransaction(scriptPubKey)), 0, flags) == expect, message); +} + +namespace +{ +const unsigned char vchKey0[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}; +const unsigned char vchKey1[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}; +const unsigned char vchKey2[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0}; + +struct KeyData +{ + CKey key0, key0C, key1, key1C, key2, key2C; + CPubKey pubkey0, pubkey0C, pubkey0H; + CPubKey pubkey1, pubkey1C; + CPubKey pubkey2, pubkey2C; + + KeyData() + { + + key0.Set(&vchKey0[0], &vchKey0[32], false); + key0C.Set(&vchKey0[0], &vchKey0[32], true); + pubkey0 = key0.GetPubKey(); + pubkey0H = key0.GetPubKey(); + pubkey0C = key0C.GetPubKey(); + *const_cast(&pubkey0H[0]) = 0x06 | (pubkey0H[64] & 1); + + key1.Set(&vchKey1[0], &vchKey1[32], false); + key1C.Set(&vchKey1[0], &vchKey1[32], true); + pubkey1 = key1.GetPubKey(); + pubkey1C = key1C.GetPubKey(); + + key2.Set(&vchKey2[0], &vchKey2[32], false); + key2C.Set(&vchKey2[0], &vchKey2[32], true); + pubkey2 = key2.GetPubKey(); + pubkey2C = key2C.GetPubKey(); + } +}; + +const KeyData keys; + +class TestBuilder +{ +private: + CScript scriptPubKey; + CTransaction creditTx; + CMutableTransaction spendTx; + bool havePush; + std::vector push; + std::string comment; + int flags; + + void DoPush() + { + if (havePush) { + spendTx.vin[0].scriptSig << push; + havePush = false; + } + } + + void DoPush(const std::vector& data) + { + DoPush(); + push = data; + havePush = true; + } + +public: + TestBuilder(const CScript& redeemScript, const std::string& comment_, int flags_, bool P2SH = false) : scriptPubKey(redeemScript), havePush(false), comment(comment_), flags(flags_) + { + if (P2SH) { + creditTx = BuildCreditingTransaction(CScript() << OP_HASH160 << redeemScript.GetID() << OP_EQUAL); + } else { + creditTx = BuildCreditingTransaction(redeemScript); + } + spendTx = BuildSpendingTransaction(CScript(), creditTx); + } + + TestBuilder& Add(const CScript& script) + { + spendTx.vin[0].scriptSig += script; + return *this; + } + + TestBuilder& Num(int num) + { + spendTx.vin[0].scriptSig << CScriptNum(num); + return *this; + } + + TestBuilder& Push(const std::string& hex) + { + DoPush(ParseHex(hex)); + return *this; + } + + TestBuilder& PushSig(const CKey& key, int nHashType = SIGHASH_ALL, unsigned int lenR = 32, unsigned int lenS = 32) + { + uint256 hash = SignatureHash(scriptPubKey, spendTx, 0, nHashType); + std::vector vchSig, r, s; + do { + key.Sign(hash, vchSig, lenS <= 32); + r = std::vector(&vchSig[4], &vchSig[4 + vchSig[3]]); + s = std::vector(&vchSig[6 + vchSig[3]], &vchSig[6 + vchSig[3] + vchSig[5 + vchSig[3]]]); + } while (lenR != r.size() || lenS != s.size()); + vchSig.push_back(static_cast(nHashType)); + DoPush(vchSig); + return *this; + } + + TestBuilder& Push(const CPubKey& pubkey) + { + DoPush(std::vector(pubkey.begin(), pubkey.end())); + return *this; + } + + TestBuilder& PushRedeem() + { + DoPush(static_cast >(scriptPubKey)); + return *this; + } + + TestBuilder& EditPush(unsigned int pos, const std::string& hexin, const std::string& hexout) + { + assert(havePush); + std::vector datain = ParseHex(hexin); + std::vector dataout = ParseHex(hexout); + assert(pos + datain.size() <= push.size()); + BOOST_CHECK_MESSAGE(std::vector(push.begin() + pos, push.begin() + pos + datain.size()) == datain, comment); + push.erase(push.begin() + pos, push.begin() + pos + datain.size()); + push.insert(push.begin() + pos, dataout.begin(), dataout.end()); + return *this; + } + + TestBuilder& DamagePush(unsigned int pos) + { + assert(havePush); + assert(pos < push.size()); + push[pos] ^= 1; + return *this; + } + + TestBuilder& Test(bool expect) + { + TestBuilder copy = *this; // Make a copy so we can rollback the push. + DoPush(); + DoTest(creditTx.vout[0].scriptPubKey, spendTx.vin[0].scriptSig, flags, expect, comment); + *this = copy; + return *this; + } + + operator std::string() + { + DoPush(); + return "[\"" + + FormatScript(spendTx.vin[0].scriptSig) + "\", \"" + + FormatScript(creditTx.vout[0].scriptPubKey) + "\", \"" + + FormatScriptFlags(flags) + "\", \"" + + comment + "\"],\n"; + } + + std::string GetComment() + { + return comment; + } + + const CScript& GetScriptPubKey() + { + return creditTx.vout[0].scriptPubKey; + } +}; +} + +BOOST_AUTO_TEST_CASE(script_build) +{ + std::vector good; + std::vector bad; + + good.push_back(TestBuilder(CScript() << keys.pubkey0 << OP_CHECKSIG, + "P2PK", 0 + ).PushSig(keys.key0)); + bad.push_back(TestBuilder(CScript() << keys.pubkey0 << OP_CHECKSIG, + "P2PK, bad sig", 0 + ).PushSig(keys.key0).DamagePush(10)); + + good.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 << keys.pubkey1C.GetID() << OP_EQUALVERIFY << OP_CHECKSIG, + "P2PKH", 0 + ).PushSig(keys.key1).Push(keys.pubkey1C)); + bad.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 << keys.pubkey2C.GetID() << OP_EQUALVERIFY << OP_CHECKSIG, + "P2PKH, bad pubkey", 0 + ).PushSig(keys.key2).Push(keys.pubkey2C).DamagePush(5)); + + good.push_back(TestBuilder(CScript() << keys.pubkey1 << OP_CHECKSIG, + "P2PK anyonecanpay", 0 + ).PushSig(keys.key1, SIGHASH_ALL | SIGHASH_ANYONECANPAY)); + bad.push_back(TestBuilder(CScript() << keys.pubkey1 << OP_CHECKSIG, + "P2PK anyonecanpay marked with normal hashtype", 0 + ).PushSig(keys.key1, SIGHASH_ALL | SIGHASH_ANYONECANPAY).EditPush(70, "81", "01")); + + good.push_back(TestBuilder(CScript() << keys.pubkey0C << OP_CHECKSIG, + "P2SH(P2PK)", SCRIPT_VERIFY_P2SH, true + ).PushSig(keys.key0).PushRedeem()); + bad.push_back(TestBuilder(CScript() << keys.pubkey0C << OP_CHECKSIG, + "P2SH(P2PK), bad redeemscript", SCRIPT_VERIFY_P2SH, true + ).PushSig(keys.key0).PushRedeem().DamagePush(10)); + + good.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 << keys.pubkey1.GetID() << OP_EQUALVERIFY << OP_CHECKSIG, + "P2SH(P2PKH), bad sig but no VERIFY_P2SH", 0, true + ).PushSig(keys.key0).DamagePush(10).PushRedeem()); + bad.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 << keys.pubkey1.GetID() << OP_EQUALVERIFY << OP_CHECKSIG, + "P2SH(P2PKH), bad sig", SCRIPT_VERIFY_P2SH, true + ).PushSig(keys.key0).DamagePush(10).PushRedeem()); + + good.push_back(TestBuilder(CScript() << OP_3 << keys.pubkey0C << keys.pubkey1C << keys.pubkey2C << OP_3 << OP_CHECKMULTISIG, + "3-of-3", 0 + ).Num(0).PushSig(keys.key0).PushSig(keys.key1).PushSig(keys.key2)); + bad.push_back(TestBuilder(CScript() << OP_3 << keys.pubkey0C << keys.pubkey1C << keys.pubkey2C << OP_3 << OP_CHECKMULTISIG, + "3-of-3, 2 sigs", 0 + ).Num(0).PushSig(keys.key0).PushSig(keys.key1).Num(0)); + + good.push_back(TestBuilder(CScript() << OP_2 << keys.pubkey0C << keys.pubkey1C << keys.pubkey2C << OP_3 << OP_CHECKMULTISIG, + "P2SH(2-of-3)", SCRIPT_VERIFY_P2SH, true + ).Num(0).PushSig(keys.key1).PushSig(keys.key2).PushRedeem()); + bad.push_back(TestBuilder(CScript() << OP_2 << keys.pubkey0C << keys.pubkey1C << keys.pubkey2C << OP_3 << OP_CHECKMULTISIG, + "P2SH(2-of-3), 1 sig", SCRIPT_VERIFY_P2SH, true + ).Num(0).PushSig(keys.key1).Num(0).PushRedeem()); + + good.push_back(TestBuilder(CScript() << keys.pubkey1C << OP_CHECKSIG, + "P2PK with too much R padding but no STRICTENC", 0 + ).PushSig(keys.key1, SIGHASH_ALL, 31, 32).EditPush(1, "43021F", "44022000")); + bad.push_back(TestBuilder(CScript() << keys.pubkey1C << OP_CHECKSIG, + "P2PK with too much R padding", SCRIPT_VERIFY_STRICTENC + ).PushSig(keys.key1, SIGHASH_ALL, 31, 32).EditPush(1, "43021F", "44022000")); + good.push_back(TestBuilder(CScript() << keys.pubkey1C << OP_CHECKSIG, + "P2PK with too much S padding but no STRICTENC", 0 + ).PushSig(keys.key1, SIGHASH_ALL).EditPush(1, "44", "45").EditPush(37, "20", "2100")); + bad.push_back(TestBuilder(CScript() << keys.pubkey1C << OP_CHECKSIG, + "P2PK with too much S padding", SCRIPT_VERIFY_STRICTENC + ).PushSig(keys.key1, SIGHASH_ALL).EditPush(1, "44", "45").EditPush(37, "20", "2100")); + good.push_back(TestBuilder(CScript() << keys.pubkey1C << OP_CHECKSIG, + "P2PK with too little R padding but no STRICTENC", 0 + ).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, "45022100", "440220")); + bad.push_back(TestBuilder(CScript() << keys.pubkey1C << OP_CHECKSIG, + "P2PK with too little R padding", SCRIPT_VERIFY_STRICTENC + ).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, "45022100", "440220")); + + good.push_back(TestBuilder(CScript() << keys.pubkey2C << OP_CHECKSIG, + "P2PK with high S but no LOW_S", SCRIPT_VERIFY_STRICTENC + ).PushSig(keys.key2, SIGHASH_ALL, 32, 33)); + good.push_back(TestBuilder(CScript() << keys.pubkey2C << OP_CHECKSIG, + "P2PK with high S but no STRICTENC", SCRIPT_VERIFY_LOW_S + ).PushSig(keys.key2, SIGHASH_ALL, 32, 33)); + bad.push_back(TestBuilder(CScript() << keys.pubkey2C << OP_CHECKSIG, + "P2PK with high S", SCRIPT_VERIFY_LOW_S | SCRIPT_VERIFY_STRICTENC + ).PushSig(keys.key2, SIGHASH_ALL, 32, 33)); + + good.push_back(TestBuilder(CScript() << OP_3 << keys.pubkey0C << keys.pubkey1C << keys.pubkey2C << OP_3 << OP_CHECKMULTISIG, + "3-of-3 with nonzero dummy but no NULLDUMMY", 0 + ).Num(1).PushSig(keys.key0).PushSig(keys.key1).PushSig(keys.key2)); + bad.push_back(TestBuilder(CScript() << OP_3 << keys.pubkey0C << keys.pubkey1C << keys.pubkey2C << OP_3 << OP_CHECKMULTISIG, + "3-of-3 with nonzero dummy", SCRIPT_VERIFY_NULLDUMMY + ).Num(1).PushSig(keys.key0).PushSig(keys.key1).PushSig(keys.key2)); + + std::map tests_good; + std::map tests_bad; + + { + Array json_good = read_json(std::string(json_tests::script_valid, json_tests::script_valid + sizeof(json_tests::script_valid))); + Array json_bad = read_json(std::string(json_tests::script_invalid, json_tests::script_invalid + sizeof(json_tests::script_invalid))); + + BOOST_FOREACH(Value& tv, json_good) { + Array test = tv.get_array(); + if (test.size() >= 4) { + tests_good[test[3].get_str()] = test; + } + } + BOOST_FOREACH(Value& tv, json_bad) { + Array test = tv.get_array(); + if (test.size() >= 4) { + tests_bad[test[3].get_str()] = test; + } + } + } + + std::string strGood; + std::string strBad; + + BOOST_FOREACH(TestBuilder& test, good) { + test.Test(true); + BOOST_CHECK_MESSAGE(tests_good.count(test.GetComment()) > 0, "Missing auto script_valid test: " + test.GetComment()); + BOOST_CHECK_MESSAGE(ParseScript(tests_good[test.GetComment()][1].get_str()) == test.GetScriptPubKey(), "ScriptPubKey mismatch in auto script_valid test: " + test.GetComment()); + strGood += test; + } + BOOST_FOREACH(TestBuilder& test, bad) { + test.Test(false); + BOOST_CHECK_MESSAGE(tests_bad.count(test.GetComment()) > 0, "Missing auto script_invalid test: " + test.GetComment()); + BOOST_CHECK_MESSAGE(ParseScript(tests_bad[test.GetComment()][1].get_str()) == test.GetScriptPubKey(), "ScriptPubKey mismatch in auto script_invalid test: " + test.GetComment()); + strBad += test; + } + +#if 0 + FILE* valid = fopen("script_valid.json.gen", "w"); + fputs(strGood.c_str(), valid); + fclose(valid); + FILE* invalid = fopen("script_invalid.json.gen", "w"); + fputs(strBad.c_str(), invalid); + fclose(invalid); +#endif +} + BOOST_AUTO_TEST_CASE(script_valid) { // Read tests from test/data/script_valid.json @@ -113,8 +424,7 @@ BOOST_AUTO_TEST_CASE(script_valid) CScript scriptPubKey = ParseScript(scriptPubKeyString); unsigned int scriptflags = ParseScriptFlags(test[2].get_str()); - CTransaction tx; - BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, BuildSpendingTransaction(scriptSig, scriptPubKey), 0, scriptflags), strTest); + DoTest(scriptPubKey, scriptSig, scriptflags, true, strTest); } } @@ -140,8 +450,7 @@ BOOST_AUTO_TEST_CASE(script_invalid) CScript scriptPubKey = ParseScript(scriptPubKeyString); unsigned int scriptflags = ParseScriptFlags(test[2].get_str()); - CTransaction tx; - BOOST_CHECK_MESSAGE(!VerifyScript(scriptSig, scriptPubKey, BuildSpendingTransaction(scriptSig, scriptPubKey), 0, scriptflags), strTest); + DoTest(scriptPubKey, scriptSig, scriptflags, false, strTest); } } diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 41d8ee9f19..83116b51e5 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include "json/json_spirit_writer_template.h" using namespace std; @@ -26,22 +27,23 @@ using namespace boost::algorithm; // In script_tests.cpp extern Array read_json(const std::string& jsondata); -unsigned int ParseScriptFlags(string strFlags){ +// Note how NOCACHE is not included as it is a runtime-only flag. +static std::map mapFlagNames = boost::assign::map_list_of + (string("NONE"), (unsigned int)SCRIPT_VERIFY_NONE) + (string("P2SH"), (unsigned int)SCRIPT_VERIFY_P2SH) + (string("STRICTENC"), (unsigned int)SCRIPT_VERIFY_STRICTENC) + (string("LOW_S"), (unsigned int)SCRIPT_VERIFY_LOW_S) + (string("NULLDUMMY"), (unsigned int)SCRIPT_VERIFY_NULLDUMMY); + +unsigned int ParseScriptFlags(string strFlags) +{ + if (strFlags.empty()) { + return 0; + } unsigned int flags = 0; vector words; split(words, strFlags, is_any_of(",")); - // Note how NOCACHE is not included as it is a runtime-only flag. - static map mapFlagNames; - if (mapFlagNames.size() == 0) - { - mapFlagNames["NONE"] = SCRIPT_VERIFY_NONE; - mapFlagNames["P2SH"] = SCRIPT_VERIFY_P2SH; - mapFlagNames["STRICTENC"] = SCRIPT_VERIFY_STRICTENC; - mapFlagNames["LOW_S"] = SCRIPT_VERIFY_LOW_S; - mapFlagNames["NULLDUMMY"] = SCRIPT_VERIFY_NULLDUMMY; - } - BOOST_FOREACH(string word, words) { if (!mapFlagNames.count(word)) @@ -52,6 +54,22 @@ unsigned int ParseScriptFlags(string strFlags){ return flags; } +string FormatScriptFlags(unsigned int flags) +{ + if (flags == 0) { + return ""; + } + string ret; + std::map::const_iterator it = mapFlagNames.begin(); + while (it != mapFlagNames.end()) { + if (flags & it->second) { + ret += it->first + ","; + } + it++; + } + return ret.substr(0, ret.size() - 1); +} + BOOST_AUTO_TEST_SUITE(transaction_tests) BOOST_AUTO_TEST_CASE(tx_valid) From a372168e77a8a195613a02983f2589252698bf0f Mon Sep 17 00:00:00 2001 From: Mark Friedenbach Date: Tue, 22 Apr 2014 15:46:19 -0700 Subject: [PATCH 0773/1288] Use a typedef for monetary values --- src/Makefile.am | 1 + src/amount.h | 13 ++++ src/bitcoin-tx.cpp | 4 +- src/coins.cpp | 4 +- src/coins.h | 4 +- src/core.cpp | 12 ++-- src/core.h | 21 +++--- src/init.cpp | 6 +- src/main.cpp | 26 +++---- src/main.h | 6 +- src/miner.cpp | 10 +-- src/qt/bitcoinamountfield.cpp | 28 ++++---- src/qt/bitcoinamountfield.h | 10 +-- src/qt/bitcoingui.cpp | 2 +- src/qt/bitcoingui.h | 4 +- src/qt/bitcoinunits.cpp | 13 ++-- src/qt/bitcoinunits.h | 12 ++-- src/qt/coincontroldialog.cpp | 16 ++--- src/qt/coincontroldialog.h | 4 +- src/qt/guiutil.cpp | 2 +- src/qt/guiutil.h | 4 +- src/qt/optionsmodel.cpp | 4 +- src/qt/optionsmodel.h | 4 +- src/qt/overviewpage.cpp | 4 +- src/qt/overviewpage.h | 18 ++--- src/qt/paymentrequestplus.cpp | 4 +- src/qt/paymentrequestplus.h | 2 +- src/qt/paymentserver.cpp | 4 +- src/qt/sendcoinsdialog.cpp | 10 +-- src/qt/sendcoinsdialog.h | 4 +- src/qt/transactiondesc.cpp | 14 ++-- src/qt/transactionfilterproxy.cpp | 2 +- src/qt/transactionfilterproxy.h | 6 +- src/qt/transactionrecord.cpp | 12 ++-- src/qt/transactionrecord.h | 7 +- src/qt/transactiontablemodel.cpp | 4 +- src/qt/transactionview.cpp | 2 +- src/qt/walletmodel.cpp | 40 +++++------ src/qt/walletmodel.h | 32 ++++----- src/qt/walletmodeltransaction.cpp | 8 +-- src/qt/walletmodeltransaction.h | 8 +-- src/qt/walletview.cpp | 2 +- src/qt/walletview.h | 4 +- src/rpcmining.cpp | 2 +- src/rpcrawtransaction.cpp | 4 +- src/rpcserver.cpp | 6 +- src/rpcserver.h | 5 +- src/rpcwallet.cpp | 62 ++++++++--------- src/test/accounting_tests.cpp | 4 +- src/test/main_tests.cpp | 4 +- src/test/util_tests.cpp | 2 +- src/test/wallet_tests.cpp | 4 +- src/txdb.cpp | 2 +- src/txmempool.cpp | 17 ++--- src/txmempool.h | 12 ++-- src/util.h | 1 + src/utilmoneystr.cpp | 8 +-- src/utilmoneystr.h | 8 ++- src/wallet.cpp | 108 +++++++++++++++--------------- src/wallet.h | 100 +++++++++++++-------------- src/walletdb.cpp | 4 +- src/walletdb.h | 3 +- 62 files changed, 397 insertions(+), 356 deletions(-) create mode 100644 src/amount.h diff --git a/src/Makefile.am b/src/Makefile.am index 94a582dfac..48e4fc5d8f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -65,6 +65,7 @@ BITCOIN_CORE_H = \ addrman.h \ alert.h \ allocators.h \ + amount.h \ base58.h \ bloom.h \ chainparams.h \ diff --git a/src/amount.h b/src/amount.h new file mode 100644 index 0000000000..42006a0388 --- /dev/null +++ b/src/amount.h @@ -0,0 +1,13 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_AMOUNT_H +#define BITCOIN_AMOUNT_H + +#include + +typedef int64_t CAmount; + +#endif diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index b6e7a6c540..a61b4fe29d 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -214,7 +214,7 @@ static void MutateTxAddOutAddr(CMutableTransaction& tx, const string& strInput) // extract and validate VALUE string strValue = strInput.substr(0, pos); - int64_t value; + CAmount value; if (!ParseMoney(strValue, value)) throw runtime_error("invalid TX output value"); @@ -242,7 +242,7 @@ static void MutateTxAddOutScript(CMutableTransaction& tx, const string& strInput // extract and validate VALUE string strValue = strInput.substr(0, pos); - int64_t value; + CAmount value; if (!ParseMoney(strValue, value)) throw runtime_error("invalid TX output value"); diff --git a/src/coins.cpp b/src/coins.cpp index 34485db2bd..9b8d63d4e4 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -171,12 +171,12 @@ const CTxOut &CCoinsViewCache::GetOutputFor(const CTxIn& input) const return coins->vout[input.prevout.n]; } -int64_t CCoinsViewCache::GetValueIn(const CTransaction& tx) const +CAmount CCoinsViewCache::GetValueIn(const CTransaction& tx) const { if (tx.IsCoinBase()) return 0; - int64_t nResult = 0; + CAmount nResult = 0; for (unsigned int i = 0; i < tx.vin.size(); i++) nResult += GetOutputFor(tx.vin[i]).nValue; diff --git a/src/coins.h b/src/coins.h index bf61f55aac..2583475323 100644 --- a/src/coins.h +++ b/src/coins.h @@ -266,7 +266,7 @@ struct CCoinsStats uint64_t nTransactionOutputs; uint64_t nSerializedSize; uint256 hashSerialized; - int64_t nTotalAmount; + CAmount nTotalAmount; CCoinsStats() : nHeight(0), hashBlock(0), nTransactions(0), nTransactionOutputs(0), nSerializedSize(0), hashSerialized(0), nTotalAmount(0) {} }; @@ -367,7 +367,7 @@ public: @param[in] tx transaction for which we are checking input total @return Sum of value of all inputs (scriptSigs) */ - int64_t GetValueIn(const CTransaction& tx) const; + CAmount GetValueIn(const CTransaction& tx) const; // Check whether all prevouts of the transaction are present in the UTXO set represented by this view bool HaveInputs(const CTransaction& tx) const; diff --git a/src/core.cpp b/src/core.cpp index e52327ba8e..1489d77bb3 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -43,7 +43,7 @@ std::string CTxIn::ToString() const return str; } -CTxOut::CTxOut(int64_t nValueIn, CScript scriptPubKeyIn) +CTxOut::CTxOut(const CAmount& nValueIn, CScript scriptPubKeyIn) { nValue = nValueIn; scriptPubKey = scriptPubKeyIn; @@ -59,7 +59,7 @@ std::string CTxOut::ToString() const return strprintf("CTxOut(nValue=%d.%08d, scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30)); } -CFeeRate::CFeeRate(int64_t nFeePaid, size_t nSize) +CFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nSize) { if (nSize > 0) nSatoshisPerK = nFeePaid*1000/nSize; @@ -67,9 +67,9 @@ CFeeRate::CFeeRate(int64_t nFeePaid, size_t nSize) nSatoshisPerK = 0; } -int64_t CFeeRate::GetFee(size_t nSize) const +CAmount CFeeRate::GetFee(size_t nSize) const { - int64_t nFee = nSatoshisPerK*nSize / 1000; + CAmount nFee = nSatoshisPerK*nSize / 1000; if (nFee == 0 && nSatoshisPerK > 0) nFee = nSatoshisPerK; @@ -110,9 +110,9 @@ CTransaction& CTransaction::operator=(const CTransaction &tx) { return *this; } -int64_t CTransaction::GetValueOut() const +CAmount CTransaction::GetValueOut() const { - int64_t nValueOut = 0; + CAmount nValueOut = 0; BOOST_FOREACH(const CTxOut& txout, vout) { nValueOut += txout.nValue; diff --git a/src/core.h b/src/core.h index 9a2ac47487..e8435c8b0d 100644 --- a/src/core.h +++ b/src/core.h @@ -6,6 +6,7 @@ #ifndef BITCOIN_CORE_H #define BITCOIN_CORE_H +#include "amount.h" #include "script/compressor.h" #include "script/script.h" #include "serialize.h" @@ -19,8 +20,8 @@ static const int64_t COIN = 100000000; static const int64_t CENT = 1000000; /** No amount larger than this (in satoshi) is valid */ -static const int64_t MAX_MONEY = 21000000 * COIN; -inline bool MoneyRange(int64_t nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } +static const CAmount MAX_MONEY = 21000000 * COIN; +inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } /** An outpoint - a combination of a transaction hash and an index n into its vout */ class COutPoint @@ -129,15 +130,15 @@ public: class CFeeRate { private: - int64_t nSatoshisPerK; // unit is satoshis-per-1,000-bytes + CAmount nSatoshisPerK; // unit is satoshis-per-1,000-bytes public: CFeeRate() : nSatoshisPerK(0) { } - explicit CFeeRate(int64_t _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) { } - CFeeRate(int64_t nFeePaid, size_t nSize); + explicit CFeeRate(const CAmount& _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) { } + CFeeRate(const CAmount& nFeePaid, size_t nSize); CFeeRate(const CFeeRate& other) { nSatoshisPerK = other.nSatoshisPerK; } - int64_t GetFee(size_t size) const; // unit returned is satoshis - int64_t GetFeePerK() const { return GetFee(1000); } // satoshis-per-1000-bytes + CAmount GetFee(size_t size) const; // unit returned is satoshis + CAmount GetFeePerK() const { return GetFee(1000); } // satoshis-per-1000-bytes friend bool operator<(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK < b.nSatoshisPerK; } friend bool operator>(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK > b.nSatoshisPerK; } @@ -161,7 +162,7 @@ public: class CTxOut { public: - int64_t nValue; + CAmount nValue; CScript scriptPubKey; CTxOut() @@ -169,7 +170,7 @@ public: SetNull(); } - CTxOut(int64_t nValueIn, CScript scriptPubKeyIn); + CTxOut(const CAmount& nValueIn, CScript scriptPubKeyIn); ADD_SERIALIZE_METHODS; @@ -276,7 +277,7 @@ public: } // Return sum of txouts. - int64_t GetValueOut() const; + CAmount GetValueOut() const; // GetValueIn() is a method on CCoinsViewCache, because // inputs must be known to compute value in. diff --git a/src/init.cpp b/src/init.cpp index 27594ecbe3..dfb984cb0d 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -662,7 +662,7 @@ bool AppInit2(boost::thread_group& threadGroup) // cost to you of processing a transaction. if (mapArgs.count("-minrelaytxfee")) { - int64_t n = 0; + CAmount n = 0; if (ParseMoney(mapArgs["-minrelaytxfee"], n) && n > 0) ::minRelayTxFee = CFeeRate(n); else @@ -672,7 +672,7 @@ bool AppInit2(boost::thread_group& threadGroup) #ifdef ENABLE_WALLET if (mapArgs.count("-mintxfee")) { - int64_t n = 0; + CAmount n = 0; if (ParseMoney(mapArgs["-mintxfee"], n) && n > 0) CWallet::minTxFee = CFeeRate(n); else @@ -680,7 +680,7 @@ bool AppInit2(boost::thread_group& threadGroup) } if (mapArgs.count("-paytxfee")) { - int64_t nFeePerK = 0; + CAmount nFeePerK = 0; if (!ParseMoney(mapArgs["-paytxfee"], nFeePerK)) return InitError(strprintf(_("Invalid amount for -paytxfee=: '%s'"), mapArgs["-paytxfee"])); if (nFeePerK > nHighTransactionFeeWarning) diff --git a/src/main.cpp b/src/main.cpp index 60e2a56795..234b343983 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -781,7 +781,7 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state) REJECT_INVALID, "bad-txns-oversize"); // Check for negative or overflow output values - int64_t nValueOut = 0; + CAmount nValueOut = 0; BOOST_FOREACH(const CTxOut& txout, tx.vout) { if (txout.nValue < 0) @@ -823,19 +823,19 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state) return true; } -int64_t GetMinRelayFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree) +CAmount GetMinRelayFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree) { { LOCK(mempool.cs); uint256 hash = tx.GetHash(); double dPriorityDelta = 0; - int64_t nFeeDelta = 0; + CAmount nFeeDelta = 0; mempool.ApplyDeltas(hash, dPriorityDelta, nFeeDelta); if (dPriorityDelta > 0 || nFeeDelta > 0) return 0; } - int64_t nMinFee = ::minRelayTxFee.GetFee(nBytes); + CAmount nMinFee = ::minRelayTxFee.GetFee(nBytes); if (fAllowFree) { @@ -898,7 +898,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa CCoinsView dummy; CCoinsViewCache view(dummy); - int64_t nValueIn = 0; + CAmount nValueIn = 0; { LOCK(pool.cs); CCoinsViewMemPool viewMemPool(*pcoinsTip, pool); @@ -950,15 +950,15 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa hash.ToString(), nSigOps, MAX_TX_SIGOPS), REJECT_NONSTANDARD, "bad-txns-too-many-sigops"); - int64_t nValueOut = tx.GetValueOut(); - int64_t nFees = nValueIn-nValueOut; + CAmount nValueOut = tx.GetValueOut(); + CAmount nFees = nValueIn-nValueOut; double dPriority = view.GetPriority(tx, chainActive.Height()); CTxMemPoolEntry entry(tx, nFees, GetTime(), dPriority, chainActive.Height()); unsigned int nSize = entry.GetTxSize(); // Don't accept it if it can't get into a block - int64_t txMinFee = GetMinRelayFee(tx, nSize, true); + CAmount txMinFee = GetMinRelayFee(tx, nSize, true); if (fLimitFree && nFees < txMinFee) return state.DoS(0, error("AcceptToMemoryPool : not enough fees %s, %d < %d", hash.ToString(), nFees, txMinFee), @@ -1178,7 +1178,7 @@ void static PruneOrphanBlocks() mapOrphanBlocks.erase(hash); } -int64_t GetBlockValue(int nHeight, int64_t nFees) +CAmount GetBlockValue(int nHeight, const CAmount& nFees) { int64_t nSubsidy = 50 * COIN; int halvings = nHeight / Params().SubsidyHalvingInterval(); @@ -1389,8 +1389,8 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi // This is also true for mempool checks. CBlockIndex *pindexPrev = mapBlockIndex.find(inputs.GetBestBlock())->second; int nSpendHeight = pindexPrev->nHeight + 1; - int64_t nValueIn = 0; - int64_t nFees = 0; + CAmount nValueIn = 0; + CAmount nFees = 0; for (unsigned int i = 0; i < tx.vin.size(); i++) { const COutPoint &prevout = tx.vin[i].prevout; @@ -1418,7 +1418,7 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi REJECT_INVALID, "bad-txns-in-belowout"); // Tally transaction fees - int64_t nTxFee = nValueIn - tx.GetValueOut(); + CAmount nTxFee = nValueIn - tx.GetValueOut(); if (nTxFee < 0) return state.DoS(100, error("CheckInputs() : %s nTxFee < 0", tx.GetHash().ToString()), REJECT_INVALID, "bad-txns-fee-negative"); @@ -1658,7 +1658,7 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C CCheckQueueControl control(fScriptChecks && nScriptCheckThreads ? &scriptcheckqueue : NULL); int64_t nTimeStart = GetTimeMicros(); - int64_t nFees = 0; + CAmount nFees = 0; int nInputs = 0; unsigned int nSigOps = 0; CDiskTxPos pos(pindex->GetBlockPos(), GetSizeOfCompactSize(block.vtx.size())); diff --git a/src/main.h b/src/main.h index 5acc551793..93915db519 100644 --- a/src/main.h +++ b/src/main.h @@ -172,7 +172,7 @@ std::string GetWarnings(std::string strFor); bool GetTransaction(const uint256 &hash, CTransaction &tx, uint256 &hashBlock, bool fAllowSlow = false); /** Find the best known block, and make it the tip of the block chain */ bool ActivateBestChain(CValidationState &state, CBlock *pblock = NULL); -int64_t GetBlockValue(int nHeight, int64_t nFees); +CAmount GetBlockValue(int nHeight, const CAmount& nFees); /** Create a new block index entry for a given block hash */ CBlockIndex * InsertBlockIndex(uint256 hash); @@ -260,7 +260,7 @@ struct CDiskTxPos : public CDiskBlockPos }; -int64_t GetMinRelayFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree); +CAmount GetMinRelayFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree); // // Check transaction inputs, and make sure any @@ -970,7 +970,7 @@ extern CBlockTreeDB *pblocktree; struct CBlockTemplate { CBlock block; - std::vector vTxFees; + std::vector vTxFees; std::vector vTxSigOps; }; diff --git a/src/miner.cpp b/src/miner.cpp index d05ddbeb1f..361a2bea41 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -111,7 +111,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) nBlockMinSize = std::min(nBlockMaxSize, nBlockMinSize); // Collect memory pool transactions into the block - int64_t nFees = 0; + CAmount nFees = 0; { LOCK2(cs_main, mempool.cs); @@ -135,7 +135,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) COrphan* porphan = NULL; double dPriority = 0; - int64_t nTotalIn = 0; + CAmount nTotalIn = 0; bool fMissingInputs = false; BOOST_FOREACH(const CTxIn& txin, tx.vin) { @@ -170,7 +170,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) const CCoins* coins = view.AccessCoins(txin.prevout.hash); assert(coins); - int64_t nValueIn = coins->vout[txin.prevout.n].nValue; + CAmount nValueIn = coins->vout[txin.prevout.n].nValue; nTotalIn += nValueIn; int nConf = pindexPrev->nHeight - coins->nHeight + 1; @@ -229,7 +229,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) // Skip free transactions if we're past the minimum block size: const uint256& hash = tx.GetHash(); double dPriorityDelta = 0; - int64_t nFeeDelta = 0; + CAmount nFeeDelta = 0; mempool.ApplyDeltas(hash, dPriorityDelta, nFeeDelta); if (fSortedByFee && (dPriorityDelta <= 0) && (nFeeDelta <= 0) && (feeRate < ::minRelayTxFee) && (nBlockSize + nTxSize >= nBlockMinSize)) continue; @@ -247,7 +247,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) if (!view.HaveInputs(tx)) continue; - int64_t nTxFees = view.GetValueIn(tx)-tx.GetValueOut(); + CAmount nTxFees = view.GetValueIn(tx)-tx.GetValueOut(); nTxSigOps += GetP2SHSigOpCount(tx, view); if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS) diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp index 6466039013..6e35bf17b3 100644 --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -44,7 +44,7 @@ public: void fixup(QString &input) const { bool valid = false; - qint64 val = parse(input, &valid); + CAmount val = parse(input, &valid); if(valid) { input = BitcoinUnits::format(currentUnit, val, false, BitcoinUnits::separatorAlways); @@ -52,12 +52,12 @@ public: } } - qint64 value(bool *valid_out=0) const + CAmount value(bool *valid_out=0) const { return parse(text(), valid_out); } - void setValue(qint64 value) + void setValue(const CAmount& value) { lineEdit()->setText(BitcoinUnits::format(currentUnit, value, false, BitcoinUnits::separatorAlways)); emit valueChanged(); @@ -66,9 +66,9 @@ public: void stepBy(int steps) { bool valid = false; - qint64 val = value(&valid); + CAmount val = value(&valid); val = val + steps * singleStep; - val = qMin(qMax(val, Q_INT64_C(0)), BitcoinUnits::maxMoney()); + val = qMin(qMax(val, CAmount(0)), BitcoinUnits::maxMoney()); setValue(val); } @@ -78,7 +78,7 @@ public: if(text().isEmpty()) // Allow step-up with empty field return StepUpEnabled; bool valid = false; - qint64 val = value(&valid); + CAmount val = value(&valid); if(valid) { if(val > 0) @@ -92,7 +92,7 @@ public: void setDisplayUnit(int unit) { bool valid = false; - qint64 val = value(&valid); + CAmount val = value(&valid); currentUnit = unit; @@ -102,7 +102,7 @@ public: clear(); } - void setSingleStep(qint64 step) + void setSingleStep(const CAmount& step) { singleStep = step; } @@ -140,7 +140,7 @@ public: } private: int currentUnit; - qint64 singleStep; + CAmount singleStep; mutable QSize cachedMinimumSizeHint; /** @@ -148,9 +148,9 @@ private: * return validity. * @note Must return 0 if !valid. */ - qint64 parse(const QString &text, bool *valid_out=0) const + CAmount parse(const QString &text, bool *valid_out=0) const { - qint64 val = 0; + CAmount val = 0; bool valid = BitcoinUnits::parse(currentUnit, text, &val); if(valid) { @@ -253,12 +253,12 @@ QWidget *BitcoinAmountField::setupTabChain(QWidget *prev) return unit; } -qint64 BitcoinAmountField::value(bool *valid_out) const +CAmount BitcoinAmountField::value(bool *valid_out) const { return amount->value(valid_out); } -void BitcoinAmountField::setValue(qint64 value) +void BitcoinAmountField::setValue(const CAmount& value) { amount->setValue(value); } @@ -285,7 +285,7 @@ void BitcoinAmountField::setDisplayUnit(int newUnit) unit->setValue(newUnit); } -void BitcoinAmountField::setSingleStep(qint64 step) +void BitcoinAmountField::setSingleStep(const CAmount& step) { amount->setSingleStep(step); } diff --git a/src/qt/bitcoinamountfield.h b/src/qt/bitcoinamountfield.h index 84795a7e7a..e52feeb46e 100644 --- a/src/qt/bitcoinamountfield.h +++ b/src/qt/bitcoinamountfield.h @@ -5,6 +5,8 @@ #ifndef BITCOINAMOUNTFIELD_H #define BITCOINAMOUNTFIELD_H +#include "amount.h" + #include class AmountSpinBox; @@ -19,16 +21,16 @@ class BitcoinAmountField: public QWidget { Q_OBJECT - Q_PROPERTY(qint64 value READ value WRITE setValue NOTIFY valueChanged USER true) + Q_PROPERTY(CAmount value READ value WRITE setValue NOTIFY valueChanged USER true) public: explicit BitcoinAmountField(QWidget *parent = 0); - qint64 value(bool *valid=0) const; - void setValue(qint64 value); + CAmount value(bool *value=0) const; + void setValue(const CAmount& value); /** Set single step in satoshis **/ - void setSingleStep(qint64 step); + void setSingleStep(const CAmount& step); /** Make read-only **/ void setReadOnly(bool fReadOnly); diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 443bed14d7..7380fbd240 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -864,7 +864,7 @@ void BitcoinGUI::closeEvent(QCloseEvent *event) } #ifdef ENABLE_WALLET -void BitcoinGUI::incomingTransaction(const QString& date, int unit, qint64 amount, const QString& type, const QString& address) +void BitcoinGUI::incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address) { // On new transaction, make an info balloon message((amount)<0 ? tr("Sent transaction") : tr("Incoming transaction"), diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 30b05cb7d9..8af6eda867 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -9,6 +9,8 @@ #include "config/bitcoin-config.h" #endif +#include "amount.h" + #include #include #include @@ -159,7 +161,7 @@ public slots: bool handlePaymentRequest(const SendCoinsRecipient& recipient); /** Show incoming transaction notification for new transactions. */ - void incomingTransaction(const QString& date, int unit, qint64 amount, const QString& type, const QString& address); + void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address); #endif private slots: diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp index 3215363fa0..423b559bf7 100644 --- a/src/qt/bitcoinunits.cpp +++ b/src/qt/bitcoinunits.cpp @@ -91,12 +91,13 @@ int BitcoinUnits::decimals(int unit) } } -QString BitcoinUnits::format(int unit, qint64 n, bool fPlus, SeparatorStyle separators) +QString BitcoinUnits::format(int unit, const CAmount& nIn, bool fPlus, SeparatorStyle separators) { // Note: not using straight sprintf here because we do NOT want // localized number formatting. if(!valid(unit)) return QString(); // Refuse to format invalid unit + qint64 n = (qint64)nIn; qint64 coin = factor(unit); int num_decimals = decimals(unit); qint64 n_abs = (n > 0 ? n : -n); @@ -138,12 +139,12 @@ QString BitcoinUnits::format(int unit, qint64 n, bool fPlus, SeparatorStyle sepa // Please take care to use formatHtmlWithUnit instead, when // appropriate. -QString BitcoinUnits::formatWithUnit(int unit, qint64 amount, bool plussign, SeparatorStyle separators) +QString BitcoinUnits::formatWithUnit(int unit, const CAmount& amount, bool plussign, SeparatorStyle separators) { return format(unit, amount, plussign, separators) + QString(" ") + name(unit); } -QString BitcoinUnits::formatHtmlWithUnit(int unit, qint64 amount, bool plussign, SeparatorStyle separators) +QString BitcoinUnits::formatHtmlWithUnit(int unit, const CAmount& amount, bool plussign, SeparatorStyle separators) { QString str(formatWithUnit(unit, amount, plussign, separators)); str.replace(QChar(THIN_SP_CP), QString(THIN_SP_HTML)); @@ -151,7 +152,7 @@ QString BitcoinUnits::formatHtmlWithUnit(int unit, qint64 amount, bool plussign, } -bool BitcoinUnits::parse(int unit, const QString &value, qint64 *val_out) +bool BitcoinUnits::parse(int unit, const QString &value, CAmount *val_out) { if(!valid(unit) || value.isEmpty()) return false; // Refuse to parse invalid unit or empty string @@ -182,7 +183,7 @@ bool BitcoinUnits::parse(int unit, const QString &value, qint64 *val_out) { return false; // Longer numbers will exceed 63 bits } - qint64 retvalue = str.toLongLong(&ok); + CAmount retvalue(str.toLongLong(&ok)); if(val_out) { *val_out = retvalue; @@ -226,7 +227,7 @@ QVariant BitcoinUnits::data(const QModelIndex &index, int role) const return QVariant(); } -qint64 BitcoinUnits::maxMoney() +CAmount BitcoinUnits::maxMoney() { return MAX_MONEY; } diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h index be9dca6012..a392c42b9b 100644 --- a/src/qt/bitcoinunits.h +++ b/src/qt/bitcoinunits.h @@ -5,6 +5,8 @@ #ifndef BITCOINUNITS_H #define BITCOINUNITS_H +#include "amount.h" + #include #include @@ -85,12 +87,12 @@ public: //! Number of decimals left static int decimals(int unit); //! Format as string - static QString format(int unit, qint64 amount, bool plussign=false, SeparatorStyle separators=separatorStandard); + static QString format(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard); //! Format as string (with unit) - static QString formatWithUnit(int unit, qint64 amount, bool plussign=false, SeparatorStyle separators=separatorStandard); - static QString formatHtmlWithUnit(int unit, qint64 amount, bool plussign=false, SeparatorStyle separators=separatorStandard); + static QString formatWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard); + static QString formatHtmlWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard); //! Parse string to coin amount - static bool parse(int unit, const QString &value, qint64 *val_out); + static bool parse(int unit, const QString &value, CAmount *val_out); //! Gets title for amount column including current display unit if optionsModel reference available */ static QString getAmountColumnTitle(int unit); ///@} @@ -117,7 +119,7 @@ public: } //! Return maximum number of base units (Satoshis) - static qint64 maxMoney(); + static CAmount maxMoney(); private: QList unitlist; diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index d10463fd8f..ba0febe546 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -29,7 +29,7 @@ #include using namespace std; -QList CoinControlDialog::payAmounts; +QList CoinControlDialog::payAmounts; CCoinControl* CoinControlDialog::coinControl = new CCoinControl(); CoinControlDialog::CoinControlDialog(QWidget *parent) : @@ -443,10 +443,10 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) return; // nPayAmount - qint64 nPayAmount = 0; + CAmount nPayAmount = 0; bool fDust = false; CMutableTransaction txDummy; - foreach(const qint64 &amount, CoinControlDialog::payAmounts) + foreach(const CAmount &amount, CoinControlDialog::payAmounts) { nPayAmount += amount; @@ -460,10 +460,10 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) } QString sPriorityLabel = tr("none"); - int64_t nAmount = 0; - int64_t nPayFee = 0; - int64_t nAfterFee = 0; - int64_t nChange = 0; + CAmount nAmount = 0; + CAmount nPayFee = 0; + CAmount nAfterFee = 0; + CAmount nChange = 0; unsigned int nBytes = 0; unsigned int nBytesInputs = 0; double dPriority = 0; @@ -684,7 +684,7 @@ void CoinControlDialog::updateView() itemWalletAddress->setText(COLUMN_ADDRESS, sWalletAddress); } - int64_t nSum = 0; + CAmount nSum = 0; double dPrioritySum = 0; int nChildren = 0; int nInputSum = 0; diff --git a/src/qt/coincontroldialog.h b/src/qt/coincontroldialog.h index a6f239a898..9eaa8eb41d 100644 --- a/src/qt/coincontroldialog.h +++ b/src/qt/coincontroldialog.h @@ -5,6 +5,8 @@ #ifndef COINCONTROLDIALOG_H #define COINCONTROLDIALOG_H +#include "amount.h" + #include #include #include @@ -37,7 +39,7 @@ public: static void updateLabels(WalletModel*, QDialog*); static QString getPriorityLabel(const CTxMemPool& pool, double); - static QList payAmounts; + static QList payAmounts; static CCoinControl *coinControl; private: diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index fc22871a6b..91bb10755a 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -221,7 +221,7 @@ QString formatBitcoinURI(const SendCoinsRecipient &info) return ret; } -bool isDust(const QString& address, qint64 amount) +bool isDust(const QString& address, const CAmount& amount) { CTxDestination dest = CBitcoinAddress(address.toStdString()).Get(); CScript script = GetScriptForDestination(dest); diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 67e11e59a0..0939c78f64 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -5,6 +5,8 @@ #ifndef GUIUTIL_H #define GUIUTIL_H +#include "amount.h" + #include #include #include @@ -46,7 +48,7 @@ namespace GUIUtil QString formatBitcoinURI(const SendCoinsRecipient &info); // Returns true if given address+amount meets "dust" definition - bool isDust(const QString& address, qint64 amount); + bool isDust(const QString& address, const CAmount& amount); // HTML escaping for rich text controls QString HtmlEscape(const QString& str, bool fMultiLine=false); diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index bd747faeb6..cb80bd0e3d 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -275,9 +275,9 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in #ifdef ENABLE_WALLET case Fee: { // core option - can be changed on-the-fly // Todo: Add is valid check and warn via message, if not - qint64 nTransactionFee = value.toLongLong(); + CAmount nTransactionFee(value.toLongLong()); payTxFee = CFeeRate(nTransactionFee, 1000); - settings.setValue("nTransactionFee", nTransactionFee); + settings.setValue("nTransactionFee", qint64(nTransactionFee)); emit transactionFeeChanged(nTransactionFee); break; } diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 80adab89c8..42ea3bf8e5 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -5,6 +5,8 @@ #ifndef OPTIONSMODEL_H #define OPTIONSMODEL_H +#include "amount.h" + #include QT_BEGIN_NAMESPACE @@ -82,7 +84,7 @@ private: signals: void displayUnitChanged(int unit); - void transactionFeeChanged(qint64); + void transactionFeeChanged(const CAmount&); void coinControlFeaturesChanged(bool); }; diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 90762bea5d..1d6c23f8a0 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -146,7 +146,7 @@ OverviewPage::~OverviewPage() delete ui; } -void OverviewPage::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance, qint64 watchOnlyBalance, qint64 watchUnconfBalance, qint64 watchImmatureBalance) +void OverviewPage::setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance) { int unit = walletModel->getOptionsModel()->getDisplayUnit(); currentBalance = balance; @@ -220,7 +220,7 @@ void OverviewPage::setWalletModel(WalletModel *model) // Keep up to date with wallet setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance(), model->getWatchBalance(), model->getWatchUnconfirmedBalance(), model->getWatchImmatureBalance()); - connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64, qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64, qint64, qint64, qint64))); + connect(model, SIGNAL(balanceChanged(const CAmount&, const CAmount&, const CAmount&, const CAmount&, const CAmount&, const CAmount&)), this, SLOT(setBalance(const CAmount&, const CAmount&, const CAmount&, const CAmount&, const CAmount&, const CAmount&))); connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h index f46374efba..03f239008f 100644 --- a/src/qt/overviewpage.h +++ b/src/qt/overviewpage.h @@ -5,6 +5,8 @@ #ifndef OVERVIEWPAGE_H #define OVERVIEWPAGE_H +#include "amount.h" + #include class ClientModel; @@ -34,8 +36,8 @@ public: void showOutOfSyncWarning(bool fShow); public slots: - void setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance, - qint64 watchOnlyBalance, qint64 watchUnconfBalance, qint64 watchImmatureBalance); + void setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, + const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance); signals: void transactionClicked(const QModelIndex &index); @@ -44,12 +46,12 @@ private: Ui::OverviewPage *ui; ClientModel *clientModel; WalletModel *walletModel; - qint64 currentBalance; - qint64 currentUnconfirmedBalance; - qint64 currentImmatureBalance; - qint64 currentWatchOnlyBalance; - qint64 currentWatchUnconfBalance; - qint64 currentWatchImmatureBalance; + CAmount currentBalance; + CAmount currentUnconfirmedBalance; + CAmount currentImmatureBalance; + CAmount currentWatchOnlyBalance; + CAmount currentWatchUnconfBalance; + CAmount currentWatchImmatureBalance; TxViewDelegate *txdelegate; TransactionFilterProxy *filter; diff --git a/src/qt/paymentrequestplus.cpp b/src/qt/paymentrequestplus.cpp index 7b7de49831..7aefffe24a 100644 --- a/src/qt/paymentrequestplus.cpp +++ b/src/qt/paymentrequestplus.cpp @@ -196,9 +196,9 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c return fResult; } -QList > PaymentRequestPlus::getPayTo() const +QList > PaymentRequestPlus::getPayTo() const { - QList > result; + QList > result; for (int i = 0; i < details.outputs_size(); i++) { const unsigned char* scriptStr = (const unsigned char*)details.outputs(i).script().data(); diff --git a/src/qt/paymentrequestplus.h b/src/qt/paymentrequestplus.h index 3c4861a4d4..3d94d93269 100644 --- a/src/qt/paymentrequestplus.h +++ b/src/qt/paymentrequestplus.h @@ -33,7 +33,7 @@ public: bool getMerchant(X509_STORE* certStore, QString& merchant) const; // Returns list of outputs, amount - QList > getPayTo() const; + QList > getPayTo() const; const payments::PaymentDetails& getDetails() const { return details; } diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index cc4478f39f..707de55290 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -532,10 +532,10 @@ bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoins request.getMerchant(PaymentServer::certStore, recipient.authenticatedMerchant); - QList > sendingTos = request.getPayTo(); + QList > sendingTos = request.getPayTo(); QStringList addresses; - foreach(const PAIRTYPE(CScript, qint64)& sendingTo, sendingTos) { + foreach(const PAIRTYPE(CScript, CAmount)& sendingTo, sendingTos) { // Extract and check destination addresses CTxDestination dest; if (ExtractDestination(sendingTo.first, dest)) { diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 25e3d2a0dc..d67cac57b4 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -92,7 +92,7 @@ void SendCoinsDialog::setModel(WalletModel *model) setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance(), model->getWatchBalance(), model->getWatchUnconfirmedBalance(), model->getWatchImmatureBalance()); - connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64, qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64, qint64, qint64, qint64))); + connect(model, SIGNAL(balanceChanged(const CAmount&, const CAmount&, const CAmount&, const CAmount&, const CAmount&, const CAmount&)), this, SLOT(setBalance(const CAmount&, const CAmount&, const CAmount&, const CAmount&, const CAmount&, const CAmount&))); connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); // Coin Control @@ -203,7 +203,7 @@ void SendCoinsDialog::on_sendButton_clicked() return; } - qint64 txFee = currentTransaction.getTransactionFee(); + CAmount txFee = currentTransaction.getTransactionFee(); QString questionString = tr("Are you sure you want to send?"); questionString.append("

%1"); @@ -218,7 +218,7 @@ void SendCoinsDialog::on_sendButton_clicked() // add total amount in all subdivision units questionString.append("
"); - qint64 totalAmount = currentTransaction.getTotalTransactionAmount() + txFee; + CAmount totalAmount = currentTransaction.getTotalTransactionAmount() + txFee; QStringList alternativeUnits; foreach(BitcoinUnits::Unit u, BitcoinUnits::availableUnits()) { @@ -384,8 +384,8 @@ bool SendCoinsDialog::handlePaymentRequest(const SendCoinsRecipient &rv) return true; } -void SendCoinsDialog::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance, - qint64 watchBalance, qint64 watchUnconfirmedBalance, qint64 watchImmatureBalance) +void SendCoinsDialog::setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, + const CAmount& watchBalance, const CAmount& watchUnconfirmedBalance, const CAmount& watchImmatureBalance) { Q_UNUSED(unconfirmedBalance); Q_UNUSED(immatureBalance); diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h index a090fa42d5..74cc4bde56 100644 --- a/src/qt/sendcoinsdialog.h +++ b/src/qt/sendcoinsdialog.h @@ -47,8 +47,8 @@ public slots: void accept(); SendCoinsEntry *addEntry(); void updateTabsAndLabels(); - void setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance, - qint64 watchOnlyBalance, qint64 watchUnconfBalance, qint64 watchImmatureBalance); + void setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, + const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance); private: Ui::SendCoinsDialog *ui; diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 4923718341..1efad8259b 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -56,9 +56,9 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco strHTML += ""; int64_t nTime = wtx.GetTxTime(); - int64_t nCredit = wtx.GetCredit(ISMINE_ALL); - int64_t nDebit = wtx.GetDebit(ISMINE_ALL); - int64_t nNet = nCredit - nDebit; + CAmount nCredit = wtx.GetCredit(ISMINE_ALL); + CAmount nDebit = wtx.GetDebit(ISMINE_ALL); + CAmount nNet = nCredit - nDebit; strHTML += "" + tr("Status") + ": " + FormatTxStatus(wtx); int nRequests = wtx.GetRequestCount(); @@ -132,7 +132,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco // // Coinbase // - int64_t nUnmatured = 0; + CAmount nUnmatured = 0; BOOST_FOREACH(const CTxOut& txout, wtx.vout) nUnmatured += wallet->GetCredit(txout, ISMINE_ALL); strHTML += "" + tr("Credit") + ": "; @@ -206,13 +206,13 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco if (fAllToMe) { // Payment to self - int64_t nChange = wtx.GetChange(); - int64_t nValue = nCredit - nChange; + CAmount nChange = wtx.GetChange(); + CAmount nValue = nCredit - nChange; strHTML += "" + tr("Total debit") + ": " + BitcoinUnits::formatHtmlWithUnit(unit, -nValue) + "
"; strHTML += "" + tr("Total credit") + ": " + BitcoinUnits::formatHtmlWithUnit(unit, nValue) + "
"; } - int64_t nTxFee = nDebit - wtx.GetValueOut(); + CAmount nTxFee = nDebit - wtx.GetValueOut(); if (nTxFee > 0) strHTML += "" + tr("Transaction fee") + ": " + BitcoinUnits::formatHtmlWithUnit(unit, -nTxFee) + "
"; } diff --git a/src/qt/transactionfilterproxy.cpp b/src/qt/transactionfilterproxy.cpp index 6ab029173b..2a0f621d1e 100644 --- a/src/qt/transactionfilterproxy.cpp +++ b/src/qt/transactionfilterproxy.cpp @@ -78,7 +78,7 @@ void TransactionFilterProxy::setTypeFilter(quint32 modes) invalidateFilter(); } -void TransactionFilterProxy::setMinAmount(qint64 minimum) +void TransactionFilterProxy::setMinAmount(const CAmount& minimum) { this->minAmount = minimum; invalidateFilter(); diff --git a/src/qt/transactionfilterproxy.h b/src/qt/transactionfilterproxy.h index f408317b53..ca31ee8f87 100644 --- a/src/qt/transactionfilterproxy.h +++ b/src/qt/transactionfilterproxy.h @@ -5,6 +5,8 @@ #ifndef TRANSACTIONFILTERPROXY_H #define TRANSACTIONFILTERPROXY_H +#include "amount.h" + #include #include @@ -38,7 +40,7 @@ public: @note Type filter takes a bit field created with TYPE() or ALL_TYPES */ void setTypeFilter(quint32 modes); - void setMinAmount(qint64 minimum); + void setMinAmount(const CAmount& minimum); void setWatchOnlyFilter(WatchOnlyFilter filter); /** Set maximum number of rows returned, -1 if unlimited. */ @@ -58,7 +60,7 @@ private: QString addrPrefix; quint32 typeFilter; WatchOnlyFilter watchOnlyFilter; - qint64 minAmount; + CAmount minAmount; int limitRows; bool showInactive; }; diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 20c1449c92..afb343f349 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -32,9 +32,9 @@ QList TransactionRecord::decomposeTransaction(const CWallet * { QList parts; int64_t nTime = wtx.GetTxTime(); - int64_t nCredit = wtx.GetCredit(true); - int64_t nDebit = wtx.GetDebit(ISMINE_ALL); - int64_t nNet = nCredit - nDebit; + CAmount nCredit = wtx.GetCredit(true); + CAmount nDebit = wtx.GetDebit(ISMINE_ALL); + CAmount nNet = nCredit - nDebit; uint256 hash = wtx.GetHash(); std::map mapValue = wtx.mapValue; @@ -97,7 +97,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * if (fAllFromMe && fAllToMe) { // Payment to self - int64_t nChange = wtx.GetChange(); + CAmount nChange = wtx.GetChange(); parts.append(TransactionRecord(hash, nTime, TransactionRecord::SendToSelf, "", -(nDebit - nChange), nCredit - nChange)); @@ -108,7 +108,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * // // Debit // - int64_t nTxFee = nDebit - wtx.GetValueOut(); + CAmount nTxFee = nDebit - wtx.GetValueOut(); for (unsigned int nOut = 0; nOut < wtx.vout.size(); nOut++) { @@ -138,7 +138,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * sub.address = mapValue["to"]; } - int64_t nValue = txout.nValue; + CAmount nValue = txout.nValue; /* Add fee to first output */ if (nTxFee > 0) { diff --git a/src/qt/transactionrecord.h b/src/qt/transactionrecord.h index 626b7654c6..9276c9f0af 100644 --- a/src/qt/transactionrecord.h +++ b/src/qt/transactionrecord.h @@ -5,6 +5,7 @@ #ifndef TRANSACTIONRECORD_H #define TRANSACTIONRECORD_H +#include "amount.h" #include "uint256.h" #include @@ -94,7 +95,7 @@ public: TransactionRecord(uint256 hash, qint64 time, Type type, const std::string &address, - qint64 debit, qint64 credit): + const CAmount& debit, const CAmount& credit): hash(hash), time(time), type(type), address(address), debit(debit), credit(credit), idx(0) { @@ -111,8 +112,8 @@ public: qint64 time; Type type; std::string address; - qint64 debit; - qint64 credit; + CAmount debit; + CAmount credit; /**@}*/ /** Subtransaction index, for sort key */ diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 2b869b4ea5..e34d776818 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -546,7 +546,7 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const case ToAddress: return formatTxToAddress(rec, true); case Amount: - return rec->credit + rec->debit; + return qint64(rec->credit + rec->debit); } break; case Qt::ToolTipRole: @@ -583,7 +583,7 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const case LabelRole: return walletModel->getAddressTableModel()->labelForAddress(QString::fromStdString(rec->address)); case AmountRole: - return rec->credit + rec->debit; + return qint64(rec->credit + rec->debit); case TxIDRole: return rec->getTxID(); case TxHashRole: diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index a7ba100cd2..d153973872 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -304,7 +304,7 @@ void TransactionView::changedAmount(const QString &amount) { if(!transactionProxyModel) return; - qint64 amount_parsed = 0; + CAmount amount_parsed = 0; if(BitcoinUnits::parse(model->getOptionsModel()->getDisplayUnit(), amount, &amount_parsed)) { transactionProxyModel->setMinAmount(amount_parsed); diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index ed90914ba7..b8701a23a6 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -55,11 +55,11 @@ WalletModel::~WalletModel() unsubscribeFromCoreSignals(); } -qint64 WalletModel::getBalance(const CCoinControl *coinControl) const +CAmount WalletModel::getBalance(const CCoinControl *coinControl) const { if (coinControl) { - qint64 nBalance = 0; + CAmount nBalance = 0; std::vector vCoins; wallet->AvailableCoins(vCoins, true, coinControl); BOOST_FOREACH(const COutput& out, vCoins) @@ -72,12 +72,12 @@ qint64 WalletModel::getBalance(const CCoinControl *coinControl) const return wallet->GetBalance(); } -qint64 WalletModel::getUnconfirmedBalance() const +CAmount WalletModel::getUnconfirmedBalance() const { return wallet->GetUnconfirmedBalance(); } -qint64 WalletModel::getImmatureBalance() const +CAmount WalletModel::getImmatureBalance() const { return wallet->GetImmatureBalance(); } @@ -87,17 +87,17 @@ bool WalletModel::haveWatchOnly() const return fHaveWatchOnly; } -qint64 WalletModel::getWatchBalance() const +CAmount WalletModel::getWatchBalance() const { return wallet->GetWatchOnlyBalance(); } -qint64 WalletModel::getWatchUnconfirmedBalance() const +CAmount WalletModel::getWatchUnconfirmedBalance() const { return wallet->GetUnconfirmedWatchOnlyBalance(); } -qint64 WalletModel::getWatchImmatureBalance() const +CAmount WalletModel::getWatchImmatureBalance() const { return wallet->GetImmatureWatchOnlyBalance(); } @@ -137,12 +137,12 @@ void WalletModel::pollBalanceChanged() void WalletModel::checkBalanceChanged() { - qint64 newBalance = getBalance(); - qint64 newUnconfirmedBalance = getUnconfirmedBalance(); - qint64 newImmatureBalance = getImmatureBalance(); - qint64 newWatchOnlyBalance = 0; - qint64 newWatchUnconfBalance = 0; - qint64 newWatchImmatureBalance = 0; + CAmount newBalance = getBalance(); + CAmount newUnconfirmedBalance = getUnconfirmedBalance(); + CAmount newImmatureBalance = getImmatureBalance(); + CAmount newWatchOnlyBalance = 0; + CAmount newWatchUnconfBalance = 0; + CAmount newWatchImmatureBalance = 0; if (haveWatchOnly()) { newWatchOnlyBalance = getWatchBalance(); @@ -194,9 +194,9 @@ bool WalletModel::validateAddress(const QString &address) WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransaction &transaction, const CCoinControl *coinControl) { - qint64 total = 0; + CAmount total = 0; QList recipients = transaction.getRecipients(); - std::vector > vecSend; + std::vector > vecSend; if(recipients.empty()) { @@ -211,7 +211,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact { if (rcp.paymentRequest.IsInitialized()) { // PaymentRequest... - int64_t subtotal = 0; + CAmount subtotal = 0; const payments::PaymentDetails& details = rcp.paymentRequest.getDetails(); for (int i = 0; i < details.outputs_size(); i++) { @@ -220,7 +220,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact subtotal += out.amount(); const unsigned char* scriptStr = (const unsigned char*)out.script().data(); CScript scriptPubKey(scriptStr, scriptStr+out.script().size()); - vecSend.push_back(std::pair(scriptPubKey, out.amount())); + vecSend.push_back(std::pair(scriptPubKey, out.amount())); } if (subtotal <= 0) { @@ -242,7 +242,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact ++nAddresses; CScript scriptPubKey = GetScriptForDestination(CBitcoinAddress(rcp.address.toStdString()).Get()); - vecSend.push_back(std::pair(scriptPubKey, rcp.amount)); + vecSend.push_back(std::pair(scriptPubKey, rcp.amount)); total += rcp.amount; } @@ -252,7 +252,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact return DuplicateAddress; } - qint64 nBalance = getBalance(coinControl); + CAmount nBalance = getBalance(coinControl); if(total > nBalance) { @@ -263,7 +263,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact LOCK2(cs_main, wallet->cs_wallet); transaction.newPossibleKeyChange(wallet); - int64_t nFeeRequired = 0; + CAmount nFeeRequired = 0; std::string strFailReason; CWalletTx *newTx = transaction.getTransaction(); diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 111ae2178c..b1d0f28f12 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -37,7 +37,7 @@ class SendCoinsRecipient { public: explicit SendCoinsRecipient() : amount(0), nVersion(SendCoinsRecipient::CURRENT_VERSION) { } - explicit SendCoinsRecipient(const QString &addr, const QString &label, quint64 amount, const QString &message): + explicit SendCoinsRecipient(const QString &addr, const QString &label, const CAmount& amount, const QString &message): address(addr), label(label), amount(amount), message(message), nVersion(SendCoinsRecipient::CURRENT_VERSION) {} // If from an insecure payment request, this is used for storing @@ -47,7 +47,7 @@ public: // Todo: This is a hack, should be replaced with a cleaner solution! QString address; QString label; - qint64 amount; + CAmount amount; // If from a payment request, this is used for storing the memo QString message; @@ -125,13 +125,13 @@ public: TransactionTableModel *getTransactionTableModel(); RecentRequestsTableModel *getRecentRequestsTableModel(); - qint64 getBalance(const CCoinControl *coinControl = NULL) const; - qint64 getUnconfirmedBalance() const; - qint64 getImmatureBalance() const; + CAmount getBalance(const CCoinControl *coinControl = NULL) const; + CAmount getUnconfirmedBalance() const; + CAmount getImmatureBalance() const; bool haveWatchOnly() const; - qint64 getWatchBalance() const; - qint64 getWatchUnconfirmedBalance() const; - qint64 getWatchImmatureBalance() const; + CAmount getWatchBalance() const; + CAmount getWatchUnconfirmedBalance() const; + CAmount getWatchImmatureBalance() const; EncryptionStatus getEncryptionStatus() const; bool processingQueuedTransactions() { return fProcessingQueuedTransactions; } @@ -210,12 +210,12 @@ private: RecentRequestsTableModel *recentRequestsTableModel; // Cache some values to be able to detect changes - qint64 cachedBalance; - qint64 cachedUnconfirmedBalance; - qint64 cachedImmatureBalance; - qint64 cachedWatchOnlyBalance; - qint64 cachedWatchUnconfBalance; - qint64 cachedWatchImmatureBalance; + CAmount cachedBalance; + CAmount cachedUnconfirmedBalance; + CAmount cachedImmatureBalance; + CAmount cachedWatchOnlyBalance; + CAmount cachedWatchUnconfBalance; + CAmount cachedWatchImmatureBalance; EncryptionStatus cachedEncryptionStatus; int cachedNumBlocks; @@ -227,8 +227,8 @@ private: signals: // Signal that balance in wallet changed - void balanceChanged(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance, - qint64 watchOnlyBalance, qint64 watchUnconfBalance, qint64 watchImmatureBalance); + void balanceChanged(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, + const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance); // Encryption status of wallet changed void encryptionStatusChanged(int status); diff --git a/src/qt/walletmodeltransaction.cpp b/src/qt/walletmodeltransaction.cpp index 943f13e208..ddd2d09bb5 100644 --- a/src/qt/walletmodeltransaction.cpp +++ b/src/qt/walletmodeltransaction.cpp @@ -31,19 +31,19 @@ CWalletTx *WalletModelTransaction::getTransaction() return walletTransaction; } -qint64 WalletModelTransaction::getTransactionFee() +CAmount WalletModelTransaction::getTransactionFee() { return fee; } -void WalletModelTransaction::setTransactionFee(qint64 newFee) +void WalletModelTransaction::setTransactionFee(const CAmount& newFee) { fee = newFee; } -qint64 WalletModelTransaction::getTotalTransactionAmount() +CAmount WalletModelTransaction::getTotalTransactionAmount() { - qint64 totalTransactionAmount = 0; + CAmount totalTransactionAmount = 0; foreach(const SendCoinsRecipient &rcp, recipients) { totalTransactionAmount += rcp.amount; diff --git a/src/qt/walletmodeltransaction.h b/src/qt/walletmodeltransaction.h index b7e85bcd11..4eadfbe4d1 100644 --- a/src/qt/walletmodeltransaction.h +++ b/src/qt/walletmodeltransaction.h @@ -26,10 +26,10 @@ public: CWalletTx *getTransaction(); - void setTransactionFee(qint64 newFee); - qint64 getTransactionFee(); + void setTransactionFee(const CAmount& newFee); + CAmount getTransactionFee(); - qint64 getTotalTransactionAmount(); + CAmount getTotalTransactionAmount(); void newPossibleKeyChange(CWallet *wallet); CReserveKey *getPossibleKeyChange(); @@ -38,7 +38,7 @@ private: const QList recipients; CWalletTx *walletTransaction; CReserveKey *keyChange; - qint64 fee; + CAmount fee; }; #endif // WALLETMODELTRANSACTION_H diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index b40ddc0a2f..322d0a6ee6 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -92,7 +92,7 @@ void WalletView::setBitcoinGUI(BitcoinGUI *gui) connect(this, SIGNAL(encryptionStatusChanged(int)), gui, SLOT(setEncryptionStatus(int))); // Pass through transaction notifications - connect(this, SIGNAL(incomingTransaction(QString,int,qint64,QString,QString)), gui, SLOT(incomingTransaction(QString,int,qint64,QString,QString))); + connect(this, SIGNAL(incomingTransaction(QString,int,const CAmount&,QString,QString)), gui, SLOT(incomingTransaction(QString,int,const CAmount&,QString,QString))); } } diff --git a/src/qt/walletview.h b/src/qt/walletview.h index 9cfa8d6760..cafba517fd 100644 --- a/src/qt/walletview.h +++ b/src/qt/walletview.h @@ -5,6 +5,8 @@ #ifndef WALLETVIEW_H #define WALLETVIEW_H +#include "amount.h" + #include class BitcoinGUI; @@ -111,7 +113,7 @@ signals: /** Encryption status of wallet changed */ void encryptionStatusChanged(int status); /** Notify that a new transaction appeared */ - void incomingTransaction(const QString& date, int unit, qint64 amount, const QString& type, const QString& address); + void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address); }; #endif // WALLETVIEW_H diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 82eaf5d037..e794bf69e0 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -273,7 +273,7 @@ Value prioritisetransaction(const Array& params, bool fHelp) uint256 hash; hash.SetHex(params[0].get_str()); - int64_t nAmount = 0; + CAmount nAmount = 0; if (params[2].get_real() != 0.0) nAmount = AmountFromValue(params[2]); diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index dbb0966ae2..bd87d77704 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -269,7 +269,7 @@ Value listunspent(const Array& params, bool fHelp) continue; } - int64_t nValue = out.tx->vout[out.i].nValue; + CAmount nValue = out.tx->vout[out.i].nValue; const CScript& pk = out.tx->vout[out.i].scriptPubKey; Object entry; entry.push_back(Pair("txid", out.tx->GetHash().GetHex())); @@ -367,7 +367,7 @@ Value createrawtransaction(const Array& params, bool fHelp) setAddress.insert(address); CScript scriptPubKey = GetScriptForDestination(address.Get()); - int64_t nAmount = AmountFromValue(s.value_); + CAmount nAmount = AmountFromValue(s.value_); CTxOut out(nAmount, scriptPubKey); rawTx.vout.push_back(out); diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 190de62282..1a41344da5 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -88,18 +88,18 @@ static inline int64_t roundint64(double d) return (int64_t)(d > 0 ? d + 0.5 : d - 0.5); } -int64_t AmountFromValue(const Value& value) +CAmount AmountFromValue(const Value& value) { double dAmount = value.get_real(); if (dAmount <= 0.0 || dAmount > 21000000.0) throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount"); - int64_t nAmount = roundint64(dAmount * COIN); + CAmount nAmount = roundint64(dAmount * COIN); if (!MoneyRange(nAmount)) throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount"); return nAmount; } -Value ValueFromAmount(int64_t amount) +Value ValueFromAmount(const CAmount& amount) { return (double)amount / (double)COIN; } diff --git a/src/rpcserver.h b/src/rpcserver.h index 820c1bc081..d440035f15 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -6,6 +6,7 @@ #ifndef _BITCOINRPC_SERVER_H_ #define _BITCOINRPC_SERVER_H_ +#include "amount.h" #include "uint256.h" #include "rpcprotocol.h" @@ -116,8 +117,8 @@ extern void InitRPCMining(); extern void ShutdownRPCMining(); extern int64_t nWalletUnlockTime; -extern int64_t AmountFromValue(const json_spirit::Value& value); -extern json_spirit::Value ValueFromAmount(int64_t amount); +extern CAmount AmountFromValue(const json_spirit::Value& value); +extern json_spirit::Value ValueFromAmount(const CAmount& amount); extern double GetDifficulty(const CBlockIndex* blockindex = NULL); extern std::string HelpRequiringPassphrase(); extern std::string HelpExampleCli(std::string methodname, std::string args); diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 35637362a4..632c46acd5 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -331,7 +331,7 @@ Value sendtoaddress(const Array& params, bool fHelp) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address"); // Amount - int64_t nAmount = AmountFromValue(params[1]); + CAmount nAmount = AmountFromValue(params[1]); // Wallet comments CWalletTx wtx; @@ -375,7 +375,7 @@ Value listaddressgroupings(const Array& params, bool fHelp) ); Array jsonGroupings; - map balances = pwalletMain->GetAddressBalances(); + map balances = pwalletMain->GetAddressBalances(); BOOST_FOREACH(set grouping, pwalletMain->GetAddressGroupings()) { Array jsonGrouping; @@ -483,7 +483,7 @@ Value getreceivedbyaddress(const Array& params, bool fHelp) nMinDepth = params[1].get_int(); // Tally - int64_t nAmount = 0; + CAmount nAmount = 0; for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) { const CWalletTx& wtx = (*it).second; @@ -532,7 +532,7 @@ Value getreceivedbyaccount(const Array& params, bool fHelp) set setAddress = pwalletMain->GetAccountAddresses(strAccount); // Tally - int64_t nAmount = 0; + CAmount nAmount = 0; for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) { const CWalletTx& wtx = (*it).second; @@ -552,9 +552,9 @@ Value getreceivedbyaccount(const Array& params, bool fHelp) } -int64_t GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMinDepth, const isminefilter& filter) +CAmount GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMinDepth, const isminefilter& filter) { - int64_t nBalance = 0; + CAmount nBalance = 0; // Tally wallet transactions for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) @@ -563,7 +563,7 @@ int64_t GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMi if (!IsFinalTx(wtx) || wtx.GetBlocksToMaturity() > 0 || wtx.GetDepthInMainChain() < 0) continue; - int64_t nReceived, nSent, nFee; + CAmount nReceived, nSent, nFee; wtx.GetAccountAmounts(strAccount, nReceived, nSent, nFee, filter); if (nReceived != 0 && wtx.GetDepthInMainChain() >= nMinDepth) @@ -577,7 +577,7 @@ int64_t GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMi return nBalance; } -int64_t GetAccountBalance(const string& strAccount, int nMinDepth, const isminefilter& filter) +CAmount GetAccountBalance(const string& strAccount, int nMinDepth, const isminefilter& filter) { CWalletDB walletdb(pwalletMain->strWalletFile); return GetAccountBalance(walletdb, strAccount, nMinDepth, filter); @@ -627,14 +627,14 @@ Value getbalance(const Array& params, bool fHelp) // Calculate total balance a different way from GetBalance() // (GetBalance() sums up all unspent TxOuts) // getbalance and getbalance '*' 0 should return the same number - int64_t nBalance = 0; + CAmount nBalance = 0; for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) { const CWalletTx& wtx = (*it).second; if (!wtx.IsTrusted() || wtx.GetBlocksToMaturity() > 0) continue; - int64_t allFee; + CAmount allFee; string strSentAccount; list listReceived; list listSent; @@ -653,7 +653,7 @@ Value getbalance(const Array& params, bool fHelp) string strAccount = AccountFromValue(params[0]); - int64_t nBalance = GetAccountBalance(strAccount, nMinDepth, filter); + CAmount nBalance = GetAccountBalance(strAccount, nMinDepth, filter); return ValueFromAmount(nBalance); } @@ -692,7 +692,7 @@ Value movecmd(const Array& params, bool fHelp) string strFrom = AccountFromValue(params[0]); string strTo = AccountFromValue(params[1]); - int64_t nAmount = AmountFromValue(params[2]); + CAmount nAmount = AmountFromValue(params[2]); if (params.size() > 3) // unused parameter, used to be nMinDepth, keep type-checking it though (void)params[3].get_int(); @@ -766,7 +766,7 @@ Value sendfrom(const Array& params, bool fHelp) CBitcoinAddress address(params[1].get_str()); if (!address.IsValid()) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address"); - int64_t nAmount = AmountFromValue(params[2]); + CAmount nAmount = AmountFromValue(params[2]); int nMinDepth = 1; if (params.size() > 3) nMinDepth = params[3].get_int(); @@ -781,7 +781,7 @@ Value sendfrom(const Array& params, bool fHelp) EnsureWalletIsUnlocked(); // Check funds - int64_t nBalance = GetAccountBalance(strAccount, nMinDepth, ISMINE_SPENDABLE); + CAmount nBalance = GetAccountBalance(strAccount, nMinDepth, ISMINE_SPENDABLE); if (nAmount > nBalance) throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds"); @@ -834,9 +834,9 @@ Value sendmany(const Array& params, bool fHelp) wtx.mapValue["comment"] = params[3].get_str(); set setAddress; - vector > vecSend; + vector > vecSend; - int64_t totalAmount = 0; + CAmount totalAmount = 0; BOOST_FOREACH(const Pair& s, sendTo) { CBitcoinAddress address(s.name_); @@ -848,7 +848,7 @@ Value sendmany(const Array& params, bool fHelp) setAddress.insert(address); CScript scriptPubKey = GetScriptForDestination(address.Get()); - int64_t nAmount = AmountFromValue(s.value_); + CAmount nAmount = AmountFromValue(s.value_); totalAmount += nAmount; vecSend.push_back(make_pair(scriptPubKey, nAmount)); @@ -857,13 +857,13 @@ Value sendmany(const Array& params, bool fHelp) EnsureWalletIsUnlocked(); // Check funds - int64_t nBalance = GetAccountBalance(strAccount, nMinDepth, ISMINE_SPENDABLE); + CAmount nBalance = GetAccountBalance(strAccount, nMinDepth, ISMINE_SPENDABLE); if (totalAmount > nBalance) throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds"); // Send CReserveKey keyChange(pwalletMain); - int64_t nFeeRequired = 0; + CAmount nFeeRequired = 0; string strFailReason; bool fCreated = pwalletMain->CreateTransaction(vecSend, wtx, keyChange, nFeeRequired, strFailReason); if (!fCreated) @@ -923,7 +923,7 @@ Value addmultisigaddress(const Array& params, bool fHelp) struct tallyitem { - int64_t nAmount; + CAmount nAmount; int nConf; vector txids; bool fIsWatchonly; @@ -995,7 +995,7 @@ Value ListReceived(const Array& params, bool fByAccounts) if (it == mapTally.end() && !fIncludeEmpty) continue; - int64_t nAmount = 0; + CAmount nAmount = 0; int nConf = std::numeric_limits::max(); bool fIsWatchonly = false; if (it != mapTally.end()) @@ -1038,7 +1038,7 @@ Value ListReceived(const Array& params, bool fByAccounts) { for (map::iterator it = mapAccountTally.begin(); it != mapAccountTally.end(); ++it) { - int64_t nAmount = (*it).second.nAmount; + CAmount nAmount = (*it).second.nAmount; int nConf = (*it).second.nConf; Object obj; if((*it).second.fIsWatchonly) @@ -1125,7 +1125,7 @@ static void MaybePushAddress(Object & entry, const CTxDestination &dest) void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDepth, bool fLong, Array& ret, const isminefilter& filter) { - int64_t nFee; + CAmount nFee; string strSentAccount; list listReceived; list listSent; @@ -1355,7 +1355,7 @@ Value listaccounts(const Array& params, bool fHelp) if(params[1].get_bool()) includeWatchonly = includeWatchonly | ISMINE_WATCH_ONLY; - map mapAccountBalances; + map mapAccountBalances; BOOST_FOREACH(const PAIRTYPE(CTxDestination, CAddressBookData)& entry, pwalletMain->mapAddressBook) { if (IsMine(*pwalletMain, entry.first) & includeWatchonly) // This address belongs to me mapAccountBalances[entry.second.name] = 0; @@ -1364,7 +1364,7 @@ Value listaccounts(const Array& params, bool fHelp) for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) { const CWalletTx& wtx = (*it).second; - int64_t nFee; + CAmount nFee; string strSentAccount; list listReceived; list listSent; @@ -1391,7 +1391,7 @@ Value listaccounts(const Array& params, bool fHelp) mapAccountBalances[entry.strAccount] += entry.nCreditDebit; Object ret; - BOOST_FOREACH(const PAIRTYPE(string, int64_t)& accountBalance, mapAccountBalances) { + BOOST_FOREACH(const PAIRTYPE(string, CAmount)& accountBalance, mapAccountBalances) { ret.push_back(Pair(accountBalance.first, ValueFromAmount(accountBalance.second))); } return ret; @@ -1534,10 +1534,10 @@ Value gettransaction(const Array& params, bool fHelp) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid or non-wallet transaction id"); const CWalletTx& wtx = pwalletMain->mapWallet[hash]; - int64_t nCredit = wtx.GetCredit(filter != 0); - int64_t nDebit = wtx.GetDebit(filter); - int64_t nNet = nCredit - nDebit; - int64_t nFee = (wtx.IsFromMe(filter) ? wtx.GetValueOut() - nDebit : 0); + CAmount nCredit = wtx.GetCredit(filter != 0); + CAmount nDebit = wtx.GetDebit(filter); + CAmount nNet = nCredit - nDebit; + CAmount nFee = (wtx.IsFromMe(filter) ? wtx.GetValueOut() - nDebit : 0); entry.push_back(Pair("amount", ValueFromAmount(nNet - nFee))); if (wtx.IsFromMe(filter)) @@ -1937,7 +1937,7 @@ Value settxfee(const Array& params, bool fHelp) ); // Amount - int64_t nAmount = 0; + CAmount nAmount = 0; if (params[0].get_real() != 0.0) nAmount = AmountFromValue(params[0]); // rejects 0.0 amounts diff --git a/src/test/accounting_tests.cpp b/src/test/accounting_tests.cpp index 4bee0f6b6e..af2a9a214f 100644 --- a/src/test/accounting_tests.cpp +++ b/src/test/accounting_tests.cpp @@ -15,7 +15,7 @@ extern CWallet* pwalletMain; BOOST_AUTO_TEST_SUITE(accounting_tests) static void -GetResults(CWalletDB& walletdb, std::map& results) +GetResults(CWalletDB& walletdb, std::map& results) { std::list aes; @@ -34,7 +34,7 @@ BOOST_AUTO_TEST_CASE(acc_orderupgrade) std::vector vpwtx; CWalletTx wtx; CAccountingEntry ae; - std::map results; + std::map results; LOCK(pwalletMain->cs_wallet); diff --git a/src/test/main_tests.cpp b/src/test/main_tests.cpp index 8863ba4004..70a800af51 100644 --- a/src/test/main_tests.cpp +++ b/src/test/main_tests.cpp @@ -11,9 +11,9 @@ BOOST_AUTO_TEST_SUITE(main_tests) BOOST_AUTO_TEST_CASE(subsidy_limit_test) { - uint64_t nSum = 0; + CAmount nSum = 0; for (int nHeight = 0; nHeight < 14000000; nHeight += 1000) { - uint64_t nSubsidy = GetBlockValue(nHeight, 0); + CAmount nSubsidy = GetBlockValue(nHeight, 0); BOOST_CHECK(nSubsidy <= 50 * COIN); nSum += nSubsidy * 1000; BOOST_CHECK(MoneyRange(nSum)); diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index e077c9de3b..6378bd0941 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -171,7 +171,7 @@ BOOST_AUTO_TEST_CASE(util_FormatMoney) BOOST_AUTO_TEST_CASE(util_ParseMoney) { - int64_t ret = 0; + CAmount ret = 0; BOOST_CHECK(ParseMoney("0.0", ret)); BOOST_CHECK_EQUAL(ret, 0); diff --git a/src/test/wallet_tests.cpp b/src/test/wallet_tests.cpp index 3887efbd0d..90fc470e06 100644 --- a/src/test/wallet_tests.cpp +++ b/src/test/wallet_tests.cpp @@ -28,7 +28,7 @@ BOOST_AUTO_TEST_SUITE(wallet_tests) static CWallet wallet; static vector vCoins; -static void add_coin(int64_t nValue, int nAge = 6*24, bool fIsFromMe = false, int nInput=0) +static void add_coin(const CAmount& nValue, int nAge = 6*24, bool fIsFromMe = false, int nInput=0) { static int nextLockTime = 0; CMutableTransaction tx; @@ -66,7 +66,7 @@ static bool equal_sets(CoinSet a, CoinSet b) BOOST_AUTO_TEST_CASE(coin_selection_tests) { CoinSet setCoinsRet, setCoinsRet2; - int64_t nValueRet; + CAmount nValueRet; LOCK(wallet.cs_wallet); diff --git a/src/txdb.cpp b/src/txdb.cpp index 79838b6116..d5f424fabd 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -117,7 +117,7 @@ bool CCoinsViewDB::GetStats(CCoinsStats &stats) const { CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION); stats.hashBlock = GetBestBlock(); ss << stats.hashBlock; - int64_t nTotalAmount = 0; + CAmount nTotalAmount = 0; while (pcursor->Valid()) { boost::this_thread::interruption_point(); try { diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 52d07bf6a0..d923c2204a 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -7,6 +7,7 @@ #include "core.h" #include "util.h" +#include "utilmoneystr.h" #include @@ -18,7 +19,7 @@ CTxMemPoolEntry::CTxMemPoolEntry(): nHeight = MEMPOOL_HEIGHT; } -CTxMemPoolEntry::CTxMemPoolEntry(const CTransaction& _tx, int64_t _nFee, +CTxMemPoolEntry::CTxMemPoolEntry(const CTransaction& _tx, const CAmount& _nFee, int64_t _nTime, double _dPriority, unsigned int _nHeight): tx(_tx), nFee(_nFee), nTime(_nTime), dPriority(_dPriority), nHeight(_nHeight) @@ -36,7 +37,7 @@ CTxMemPoolEntry::CTxMemPoolEntry(const CTxMemPoolEntry& other) double CTxMemPoolEntry::GetPriority(unsigned int currentHeight) const { - int64_t nValueIn = tx.GetValueOut()+nFee; + CAmount nValueIn = tx.GetValueOut()+nFee; double deltaPriority = ((double)(currentHeight-nHeight)*nValueIn)/nModSize; double dResult = dPriority + deltaPriority; return dResult; @@ -601,24 +602,24 @@ CTxMemPool::ReadFeeEstimates(CAutoFile& filein) return true; } -void CTxMemPool::PrioritiseTransaction(const uint256 hash, const string strHash, double dPriorityDelta, int64_t nFeeDelta) +void CTxMemPool::PrioritiseTransaction(const uint256 hash, const string strHash, double dPriorityDelta, const CAmount& nFeeDelta) { { LOCK(cs); - std::pair &deltas = mapDeltas[hash]; + std::pair &deltas = mapDeltas[hash]; deltas.first += dPriorityDelta; deltas.second += nFeeDelta; } - LogPrintf("PrioritiseTransaction: %s priority += %f, fee += %d\n", strHash, dPriorityDelta, nFeeDelta); + LogPrintf("PrioritiseTransaction: %s priority += %f, fee += %d\n", strHash, dPriorityDelta, FormatMoney(nFeeDelta)); } -void CTxMemPool::ApplyDeltas(const uint256 hash, double &dPriorityDelta, int64_t &nFeeDelta) +void CTxMemPool::ApplyDeltas(const uint256 hash, double &dPriorityDelta, CAmount &nFeeDelta) { LOCK(cs); - std::map >::iterator pos = mapDeltas.find(hash); + std::map >::iterator pos = mapDeltas.find(hash); if (pos == mapDeltas.end()) return; - const std::pair &deltas = pos->second; + const std::pair &deltas = pos->second; dPriorityDelta += deltas.first; nFeeDelta += deltas.second; } diff --git a/src/txmempool.h b/src/txmempool.h index b9d50ee0bc..c35ea52d4e 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -29,7 +29,7 @@ class CTxMemPoolEntry { private: CTransaction tx; - int64_t nFee; // Cached to avoid expensive parent-transaction lookups + CAmount nFee; // Cached to avoid expensive parent-transaction lookups size_t nTxSize; // ... and avoid recomputing tx size size_t nModSize; // ... and modified size for priority int64_t nTime; // Local time when entering the mempool @@ -37,14 +37,14 @@ private: unsigned int nHeight; // Chain height when entering the mempool public: - CTxMemPoolEntry(const CTransaction& _tx, int64_t _nFee, + CTxMemPoolEntry(const CTransaction& _tx, const CAmount& _nFee, int64_t _nTime, double _dPriority, unsigned int _nHeight); CTxMemPoolEntry(); CTxMemPoolEntry(const CTxMemPoolEntry& other); const CTransaction& GetTx() const { return this->tx; } double GetPriority(unsigned int currentHeight) const; - int64_t GetFee() const { return nFee; } + CAmount GetFee() const { return nFee; } size_t GetTxSize() const { return nTxSize; } int64_t GetTime() const { return nTime; } unsigned int GetHeight() const { return nHeight; } @@ -76,7 +76,7 @@ public: mutable CCriticalSection cs; std::map mapTx; std::map mapNextTx; - std::map > mapDeltas; + std::map > mapDeltas; CTxMemPool(const CFeeRate& _minRelayFee); ~CTxMemPool(); @@ -102,8 +102,8 @@ public: void AddTransactionsUpdated(unsigned int n); /** Affect CreateNewBlock prioritisation of transactions */ - void PrioritiseTransaction(const uint256 hash, const std::string strHash, double dPriorityDelta, int64_t nFeeDelta); - void ApplyDeltas(const uint256 hash, double &dPriorityDelta, int64_t &nFeeDelta); + void PrioritiseTransaction(const uint256 hash, const std::string strHash, double dPriorityDelta, const CAmount& nFeeDelta); + void ApplyDeltas(const uint256 hash, double &dPriorityDelta, CAmount &nFeeDelta); void ClearPrioritisation(const uint256 hash); unsigned long size() diff --git a/src/util.h b/src/util.h index 4b2415278b..fb1d3eacb5 100644 --- a/src/util.h +++ b/src/util.h @@ -14,6 +14,7 @@ #include "config/bitcoin-config.h" #endif +#include "amount.h" #include "compat.h" #include "tinyformat.h" #include "utiltime.h" diff --git a/src/utilmoneystr.cpp b/src/utilmoneystr.cpp index c169355f05..1a5635bfb8 100644 --- a/src/utilmoneystr.cpp +++ b/src/utilmoneystr.cpp @@ -10,7 +10,7 @@ using namespace std; -string FormatMoney(int64_t n, bool fPlus) +string FormatMoney(const CAmount& n, bool fPlus) { // Note: not using straight sprintf here because we do NOT want // localized number formatting. @@ -34,12 +34,12 @@ string FormatMoney(int64_t n, bool fPlus) } -bool ParseMoney(const string& str, int64_t& nRet) +bool ParseMoney(const string& str, CAmount& nRet) { return ParseMoney(str.c_str(), nRet); } -bool ParseMoney(const char* pszIn, int64_t& nRet) +bool ParseMoney(const char* pszIn, CAmount& nRet) { string strWhole; int64_t nUnits = 0; @@ -73,7 +73,7 @@ bool ParseMoney(const char* pszIn, int64_t& nRet) if (nUnits < 0 || nUnits > COIN) return false; int64_t nWhole = atoi64(strWhole); - int64_t nValue = nWhole*COIN + nUnits; + CAmount nValue = nWhole*COIN + nUnits; nRet = nValue; return true; diff --git a/src/utilmoneystr.h b/src/utilmoneystr.h index f0c61aa138..65415afd3f 100644 --- a/src/utilmoneystr.h +++ b/src/utilmoneystr.h @@ -12,8 +12,10 @@ #include #include -std::string FormatMoney(int64_t n, bool fPlus=false); -bool ParseMoney(const std::string& str, int64_t& nRet); -bool ParseMoney(const char* pszIn, int64_t& nRet); +#include "amount.h" + +std::string FormatMoney(const CAmount& n, bool fPlus=false); +bool ParseMoney(const std::string& str, CAmount& nRet); +bool ParseMoney(const char* pszIn, CAmount& nRet); #endif // BITCOIN_UTILMONEYSTR_H diff --git a/src/wallet.cpp b/src/wallet.cpp index e69f59aacd..b20b0007ce 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -35,8 +35,8 @@ CFeeRate CWallet::minTxFee = CFeeRate(10000); // Override with -mintxfee struct CompareValueOnly { - bool operator()(const pair >& t1, - const pair >& t2) const + bool operator()(const pair >& t1, + const pair >& t2) const { return t1.first < t2.first; } @@ -697,7 +697,7 @@ isminetype CWallet::IsMine(const CTxIn &txin) const return ISMINE_NO; } -int64_t CWallet::GetDebit(const CTxIn &txin, const isminefilter& filter) const +CAmount CWallet::GetDebit(const CTxIn &txin, const isminefilter& filter) const { { LOCK(cs_wallet); @@ -781,7 +781,7 @@ int CWalletTx::GetRequestCount() const } void CWalletTx::GetAmounts(list& listReceived, - list& listSent, int64_t& nFee, string& strSentAccount, const isminefilter& filter) const + list& listSent, CAmount& nFee, string& strSentAccount, const isminefilter& filter) const { nFee = 0; listReceived.clear(); @@ -789,10 +789,10 @@ void CWalletTx::GetAmounts(list& listReceived, strSentAccount = strFromAccount; // Compute fee: - int64_t nDebit = GetDebit(filter); + CAmount nDebit = GetDebit(filter); if (nDebit > 0) // debit>0 means we signed/sent this transaction { - int64_t nValueOut = GetValueOut(); + CAmount nValueOut = GetValueOut(); nFee = nDebit - nValueOut; } @@ -835,12 +835,12 @@ void CWalletTx::GetAmounts(list& listReceived, } -void CWalletTx::GetAccountAmounts(const string& strAccount, int64_t& nReceived, - int64_t& nSent, int64_t& nFee, const isminefilter& filter) const +void CWalletTx::GetAccountAmounts(const string& strAccount, CAmount& nReceived, + CAmount& nSent, CAmount& nFee, const isminefilter& filter) const { nReceived = nSent = nFee = 0; - int64_t allFee; + CAmount allFee; string strSentAccount; list listReceived; list listSent; @@ -1011,9 +1011,9 @@ void CWallet::ResendWalletTransactions() // -int64_t CWallet::GetBalance() const +CAmount CWallet::GetBalance() const { - int64_t nTotal = 0; + CAmount nTotal = 0; { LOCK2(cs_main, cs_wallet); for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) @@ -1027,9 +1027,9 @@ int64_t CWallet::GetBalance() const return nTotal; } -int64_t CWallet::GetUnconfirmedBalance() const +CAmount CWallet::GetUnconfirmedBalance() const { - int64_t nTotal = 0; + CAmount nTotal = 0; { LOCK2(cs_main, cs_wallet); for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) @@ -1042,9 +1042,9 @@ int64_t CWallet::GetUnconfirmedBalance() const return nTotal; } -int64_t CWallet::GetImmatureBalance() const +CAmount CWallet::GetImmatureBalance() const { - int64_t nTotal = 0; + CAmount nTotal = 0; { LOCK2(cs_main, cs_wallet); for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) @@ -1056,9 +1056,9 @@ int64_t CWallet::GetImmatureBalance() const return nTotal; } -int64_t CWallet::GetWatchOnlyBalance() const +CAmount CWallet::GetWatchOnlyBalance() const { - int64_t nTotal = 0; + CAmount nTotal = 0; { LOCK2(cs_main, cs_wallet); for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) @@ -1072,9 +1072,9 @@ int64_t CWallet::GetWatchOnlyBalance() const return nTotal; } -int64_t CWallet::GetUnconfirmedWatchOnlyBalance() const +CAmount CWallet::GetUnconfirmedWatchOnlyBalance() const { - int64_t nTotal = 0; + CAmount nTotal = 0; { LOCK2(cs_main, cs_wallet); for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) @@ -1087,9 +1087,9 @@ int64_t CWallet::GetUnconfirmedWatchOnlyBalance() const return nTotal; } -int64_t CWallet::GetImmatureWatchOnlyBalance() const +CAmount CWallet::GetImmatureWatchOnlyBalance() const { - int64_t nTotal = 0; + CAmount nTotal = 0; { LOCK2(cs_main, cs_wallet); for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) @@ -1137,8 +1137,8 @@ void CWallet::AvailableCoins(vector& vCoins, bool fOnlyConfirmed, const } } -static void ApproximateBestSubset(vector > >vValue, int64_t nTotalLower, int64_t nTargetValue, - vector& vfBest, int64_t& nBest, int iterations = 1000) +static void ApproximateBestSubset(vector > >vValue, const CAmount& nTotalLower, const CAmount& nTargetValue, + vector& vfBest, CAmount& nBest, int iterations = 1000) { vector vfIncluded; @@ -1150,7 +1150,7 @@ static void ApproximateBestSubset(vector vCoins, - set >& setCoinsRet, int64_t& nValueRet) const +bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, int nConfMine, int nConfTheirs, vector vCoins, + set >& setCoinsRet, CAmount& nValueRet) const { setCoinsRet.clear(); nValueRet = 0; // List of values less than target - pair > coinLowestLarger; - coinLowestLarger.first = std::numeric_limits::max(); + pair > coinLowestLarger; + coinLowestLarger.first = std::numeric_limits::max(); coinLowestLarger.second.first = NULL; - vector > > vValue; - int64_t nTotalLower = 0; + vector > > vValue; + CAmount nTotalLower = 0; random_shuffle(vCoins.begin(), vCoins.end(), GetRandInt); @@ -1209,9 +1209,9 @@ bool CWallet::SelectCoinsMinConf(int64_t nTargetValue, int nConfMine, int nConfT continue; int i = output.i; - int64_t n = pcoin->vout[i].nValue; + CAmount n = pcoin->vout[i].nValue; - pair > coin = make_pair(n,make_pair(pcoin, i)); + pair > coin = make_pair(n,make_pair(pcoin, i)); if (n == nTargetValue) { @@ -1252,7 +1252,7 @@ bool CWallet::SelectCoinsMinConf(int64_t nTargetValue, int nConfMine, int nConfT // Solve subset sum by stochastic approximation sort(vValue.rbegin(), vValue.rend(), CompareValueOnly()); vector vfBest; - int64_t nBest; + CAmount nBest; ApproximateBestSubset(vValue, nTotalLower, nTargetValue, vfBest, nBest, 1000); if (nBest != nTargetValue && nTotalLower >= nTargetValue + CENT) @@ -1284,7 +1284,7 @@ bool CWallet::SelectCoinsMinConf(int64_t nTargetValue, int nConfMine, int nConfT return true; } -bool CWallet::SelectCoins(int64_t nTargetValue, set >& setCoinsRet, int64_t& nValueRet, const CCoinControl* coinControl) const +bool CWallet::SelectCoins(const CAmount& nTargetValue, set >& setCoinsRet, CAmount& nValueRet, const CCoinControl* coinControl) const { vector vCoins; AvailableCoins(vCoins, true, coinControl); @@ -1310,11 +1310,11 @@ bool CWallet::SelectCoins(int64_t nTargetValue, set >& vecSend, - CWalletTx& wtxNew, CReserveKey& reservekey, int64_t& nFeeRet, std::string& strFailReason, const CCoinControl* coinControl) +bool CWallet::CreateTransaction(const vector >& vecSend, + CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet, std::string& strFailReason, const CCoinControl* coinControl) { - int64_t nValue = 0; - BOOST_FOREACH (const PAIRTYPE(CScript, int64_t)& s, vecSend) + CAmount nValue = 0; + BOOST_FOREACH (const PAIRTYPE(CScript, CAmount)& s, vecSend) { if (nValue < 0) { @@ -1343,10 +1343,10 @@ bool CWallet::CreateTransaction(const vector >& vecSend, txNew.vout.clear(); wtxNew.fFromMe = true; - int64_t nTotalValue = nValue + nFeeRet; + CAmount nTotalValue = nValue + nFeeRet; double dPriority = 0; // vouts to the payees - BOOST_FOREACH (const PAIRTYPE(CScript, int64_t)& s, vecSend) + BOOST_FOREACH (const PAIRTYPE(CScript, CAmount)& s, vecSend) { CTxOut txout(s.second, s.first); if (txout.IsDust(::minRelayTxFee)) @@ -1359,7 +1359,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, // Choose coins to use set > setCoins; - int64_t nValueIn = 0; + CAmount nValueIn = 0; if (!SelectCoins(nTotalValue, setCoins, nValueIn, coinControl)) { strFailReason = _("Insufficient funds"); @@ -1367,14 +1367,14 @@ bool CWallet::CreateTransaction(const vector >& vecSend, } BOOST_FOREACH(PAIRTYPE(const CWalletTx*, unsigned int) pcoin, setCoins) { - int64_t nCredit = pcoin.first->vout[pcoin.second].nValue; + CAmount nCredit = pcoin.first->vout[pcoin.second].nValue; //The priority after the next block (depth+1) is used instead of the current, //reflecting an assumption the user would accept a bit more delay for //a chance at a free transaction. dPriority += (double)nCredit * (pcoin.first->GetDepthInMainChain()+1); } - int64_t nChange = nValueIn - nValue - nFeeRet; + CAmount nChange = nValueIn - nValue - nFeeRet; if (nChange > 0) { @@ -1450,7 +1450,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, } dPriority = wtxNew.ComputePriority(dPriority, nBytes); - int64_t nFeeNeeded = GetMinimumFee(nBytes, nTxConfirmTarget, mempool); + CAmount nFeeNeeded = GetMinimumFee(nBytes, nTxConfirmTarget, mempool); if (nFeeRet >= nFeeNeeded) break; // Done, enough fee included. @@ -1481,10 +1481,10 @@ bool CWallet::CreateTransaction(const vector >& vecSend, return true; } -bool CWallet::CreateTransaction(CScript scriptPubKey, int64_t nValue, - CWalletTx& wtxNew, CReserveKey& reservekey, int64_t& nFeeRet, std::string& strFailReason, const CCoinControl* coinControl) +bool CWallet::CreateTransaction(CScript scriptPubKey, const CAmount& nValue, + CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet, std::string& strFailReason, const CCoinControl* coinControl) { - vector< pair > vecSend; + vector< pair > vecSend; vecSend.push_back(make_pair(scriptPubKey, nValue)); return CreateTransaction(vecSend, wtxNew, reservekey, nFeeRet, strFailReason, coinControl); } @@ -1539,7 +1539,7 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey) -string CWallet::SendMoney(const CTxDestination &address, int64_t nValue, CWalletTx& wtxNew) +string CWallet::SendMoney(const CTxDestination &address, CAmount nValue, CWalletTx& wtxNew) { // Check amount if (nValue <= 0) @@ -1560,7 +1560,7 @@ string CWallet::SendMoney(const CTxDestination &address, int64_t nValue, CWallet // Create and send the transaction CReserveKey reservekey(this); - int64_t nFeeRequired; + CAmount nFeeRequired; if (!CreateTransaction(scriptPubKey, nValue, wtxNew, reservekey, nFeeRequired, strError)) { if (nValue + nFeeRequired > GetBalance()) @@ -1576,10 +1576,10 @@ string CWallet::SendMoney(const CTxDestination &address, int64_t nValue, CWallet -int64_t CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool& pool) +CAmount CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool& pool) { // payTxFee is user-set "I want to pay this much" - int64_t nFeeNeeded = payTxFee.GetFee(nTxBytes); + CAmount nFeeNeeded = payTxFee.GetFee(nTxBytes); // User didn't set: use -txconfirmtarget to estimate... if (nFeeNeeded == 0) nFeeNeeded = pool.estimateFee(nConfirmTarget).GetFee(nTxBytes); @@ -1838,9 +1838,9 @@ int64_t CWallet::GetOldestKeyPoolTime() return keypool.nTime; } -std::map CWallet::GetAddressBalances() +std::map CWallet::GetAddressBalances() { - map balances; + map balances; { LOCK(cs_wallet); @@ -1866,7 +1866,7 @@ std::map CWallet::GetAddressBalances() if(!ExtractDestination(pcoin->vout[i].scriptPubKey, addr)) continue; - int64_t n = IsSpent(walletEntry.first, i) ? 0 : pcoin->vout[i].nValue; + CAmount n = IsSpent(walletEntry.first, i) ? 0 : pcoin->vout[i].nValue; if (!balances.count(addr)) balances[addr] = 0; diff --git a/src/wallet.h b/src/wallet.h index fde87a8a2f..f3fffb2253 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -30,9 +30,9 @@ extern unsigned int nTxConfirmTarget; extern bool bSpendZeroConfChange; // -paytxfee default -static const int64_t DEFAULT_TRANSACTION_FEE = 0; +static const CAmount DEFAULT_TRANSACTION_FEE = 0; // -paytxfee will warn if called with a higher fee than this amount (in satoshis) per KB -static const int nHighTransactionFeeWarning = 0.01 * COIN; +static const CAmount nHighTransactionFeeWarning = 0.01 * COIN; // Largest (in bytes) free transaction we're willing to create static const unsigned int MAX_FREE_TRANSACTION_CREATE_SIZE = 1000; @@ -98,7 +98,7 @@ public: class CWallet : public CCryptoKeyStore, public CWalletInterface { private: - bool SelectCoins(int64_t nTargetValue, std::set >& setCoinsRet, int64_t& nValueRet, const CCoinControl *coinControl = NULL) const; + bool SelectCoins(const CAmount& nTargetValue, std::set >& setCoinsRet, CAmount& nValueRet, const CCoinControl *coinControl = NULL) const; CWalletDB *pwalletdbEncryption; @@ -182,7 +182,7 @@ public: bool CanSupportFeature(enum WalletFeature wf) { AssertLockHeld(cs_wallet); return nWalletMaxVersion >= wf; } void AvailableCoins(std::vector& vCoins, bool fOnlyConfirmed=true, const CCoinControl *coinControl = NULL) const; - bool SelectCoinsMinConf(int64_t nTargetValue, int nConfMine, int nConfTheirs, std::vector vCoins, std::set >& setCoinsRet, int64_t& nValueRet) const; + bool SelectCoinsMinConf(const CAmount& nTargetValue, int nConfMine, int nConfTheirs, std::vector vCoins, std::set >& setCoinsRet, CAmount& nValueRet) const; bool IsSpent(const uint256& hash, unsigned int n) const; @@ -253,21 +253,21 @@ public: int ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate = false); void ReacceptWalletTransactions(); void ResendWalletTransactions(); - int64_t GetBalance() const; - int64_t GetUnconfirmedBalance() const; - int64_t GetImmatureBalance() const; - int64_t GetWatchOnlyBalance() const; - int64_t GetUnconfirmedWatchOnlyBalance() const; - int64_t GetImmatureWatchOnlyBalance() const; - bool CreateTransaction(const std::vector >& vecSend, - CWalletTx& wtxNew, CReserveKey& reservekey, int64_t& nFeeRet, std::string& strFailReason, const CCoinControl *coinControl = NULL); - bool CreateTransaction(CScript scriptPubKey, int64_t nValue, - CWalletTx& wtxNew, CReserveKey& reservekey, int64_t& nFeeRet, std::string& strFailReason, const CCoinControl *coinControl = NULL); + CAmount GetBalance() const; + CAmount GetUnconfirmedBalance() const; + CAmount GetImmatureBalance() const; + CAmount GetWatchOnlyBalance() const; + CAmount GetUnconfirmedWatchOnlyBalance() const; + CAmount GetImmatureWatchOnlyBalance() const; + bool CreateTransaction(const std::vector >& vecSend, + CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet, std::string& strFailReason, const CCoinControl *coinControl = NULL); + bool CreateTransaction(CScript scriptPubKey, const CAmount& nValue, + CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet, std::string& strFailReason, const CCoinControl *coinControl = NULL); bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey); - std::string SendMoney(const CTxDestination &address, int64_t nValue, CWalletTx& wtxNew); + std::string SendMoney(const CTxDestination &address, CAmount nValue, CWalletTx& wtxNew); static CFeeRate minTxFee; - static int64_t GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool& pool); + static CAmount GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool& pool); bool NewKeyPool(); bool TopUpKeyPool(unsigned int kpSize = 0); @@ -279,24 +279,24 @@ public: void GetAllReserveKeys(std::set& setAddress) const; std::set< std::set > GetAddressGroupings(); - std::map GetAddressBalances(); + std::map GetAddressBalances(); std::set GetAccountAddresses(std::string strAccount) const; isminetype IsMine(const CTxIn& txin) const; - int64_t GetDebit(const CTxIn& txin, const isminefilter& filter) const; + CAmount GetDebit(const CTxIn& txin, const isminefilter& filter) const; isminetype IsMine(const CTxOut& txout) const { return ::IsMine(*this, txout.scriptPubKey); } - int64_t GetCredit(const CTxOut& txout, const isminefilter& filter) const + CAmount GetCredit(const CTxOut& txout, const isminefilter& filter) const { if (!MoneyRange(txout.nValue)) throw std::runtime_error("CWallet::GetCredit() : value out of range"); return ((IsMine(txout) & filter) ? txout.nValue : 0); } bool IsChange(const CTxOut& txout) const; - int64_t GetChange(const CTxOut& txout) const + CAmount GetChange(const CTxOut& txout) const { if (!MoneyRange(txout.nValue)) throw std::runtime_error("CWallet::GetChange() : value out of range"); @@ -313,9 +313,9 @@ public: { return (GetDebit(tx, ISMINE_ALL) > 0); } - int64_t GetDebit(const CTransaction& tx, const isminefilter& filter) const + CAmount GetDebit(const CTransaction& tx, const isminefilter& filter) const { - int64_t nDebit = 0; + CAmount nDebit = 0; BOOST_FOREACH(const CTxIn& txin, tx.vin) { nDebit += GetDebit(txin, filter); @@ -324,9 +324,9 @@ public: } return nDebit; } - int64_t GetCredit(const CTransaction& tx, const isminefilter& filter) const + CAmount GetCredit(const CTransaction& tx, const isminefilter& filter) const { - int64_t nCredit = 0; + CAmount nCredit = 0; BOOST_FOREACH(const CTxOut& txout, tx.vout) { nCredit += GetCredit(txout, filter); @@ -335,9 +335,9 @@ public: } return nCredit; } - int64_t GetChange(const CTransaction& tx) const + CAmount GetChange(const CTransaction& tx) const { - int64_t nChange = 0; + CAmount nChange = 0; BOOST_FOREACH(const CTxOut& txout, tx.vout) { nChange += GetChange(txout); @@ -457,7 +457,7 @@ static void WriteOrderPos(const int64_t& nOrderPos, mapValue_t& mapValue) struct COutputEntry { CTxDestination destination; - int64_t amount; + CAmount amount; int vout; }; @@ -545,15 +545,15 @@ public: mutable bool fImmatureWatchCreditCached; mutable bool fAvailableWatchCreditCached; mutable bool fChangeCached; - mutable int64_t nDebitCached; - mutable int64_t nCreditCached; - mutable int64_t nImmatureCreditCached; - mutable int64_t nAvailableCreditCached; - mutable int64_t nWatchDebitCached; - mutable int64_t nWatchCreditCached; - mutable int64_t nImmatureWatchCreditCached; - mutable int64_t nAvailableWatchCreditCached; - mutable int64_t nChangeCached; + mutable CAmount nDebitCached; + mutable CAmount nCreditCached; + mutable CAmount nImmatureCreditCached; + mutable CAmount nAvailableCreditCached; + mutable CAmount nWatchDebitCached; + mutable CAmount nWatchCreditCached; + mutable CAmount nImmatureWatchCreditCached; + mutable CAmount nAvailableWatchCreditCached; + mutable CAmount nChangeCached; CWalletTx() { @@ -670,12 +670,12 @@ public: } // filter decides which addresses will count towards the debit - int64_t GetDebit(const isminefilter& filter) const + CAmount GetDebit(const isminefilter& filter) const { if (vin.empty()) return 0; - int64_t debit = 0; + CAmount debit = 0; if(filter & ISMINE_SPENDABLE) { if (fDebitCached) @@ -701,7 +701,7 @@ public: return debit; } - int64_t GetCredit(bool fUseCache=true) const + CAmount GetCredit(bool fUseCache=true) const { // Must wait until coinbase is safely deep enough in the chain before valuing it if (IsCoinBase() && GetBlocksToMaturity() > 0) @@ -715,7 +715,7 @@ public: return nCreditCached; } - int64_t GetImmatureCredit(bool fUseCache=true) const + CAmount GetImmatureCredit(bool fUseCache=true) const { if (IsCoinBase() && GetBlocksToMaturity() > 0 && IsInMainChain()) { @@ -729,7 +729,7 @@ public: return 0; } - int64_t GetAvailableCredit(bool fUseCache=true) const + CAmount GetAvailableCredit(bool fUseCache=true) const { if (pwallet == 0) return 0; @@ -741,7 +741,7 @@ public: if (fUseCache && fAvailableCreditCached) return nAvailableCreditCached; - int64_t nCredit = 0; + CAmount nCredit = 0; uint256 hashTx = GetHash(); for (unsigned int i = 0; i < vout.size(); i++) { @@ -759,7 +759,7 @@ public: return nCredit; } - int64_t GetImmatureWatchOnlyCredit(const bool& fUseCache=true) const + CAmount GetImmatureWatchOnlyCredit(const bool& fUseCache=true) const { if (IsCoinBase() && GetBlocksToMaturity() > 0 && IsInMainChain()) { @@ -773,7 +773,7 @@ public: return 0; } - int64_t GetAvailableWatchOnlyCredit(const bool& fUseCache=true) const + CAmount GetAvailableWatchOnlyCredit(const bool& fUseCache=true) const { if (pwallet == 0) return 0; @@ -785,7 +785,7 @@ public: if (fUseCache && fAvailableWatchCreditCached) return nAvailableWatchCreditCached; - int64_t nCredit = 0; + CAmount nCredit = 0; for (unsigned int i = 0; i < vout.size(); i++) { if (!pwallet->IsSpent(GetHash(), i)) @@ -802,7 +802,7 @@ public: return nCredit; } - int64_t GetChange() const + CAmount GetChange() const { if (fChangeCached) return nChangeCached; @@ -812,10 +812,10 @@ public: } void GetAmounts(std::list& listReceived, - std::list& listSent, int64_t& nFee, std::string& strSentAccount, const isminefilter& filter) const; + std::list& listSent, CAmount& nFee, std::string& strSentAccount, const isminefilter& filter) const; - void GetAccountAmounts(const std::string& strAccount, int64_t& nReceived, - int64_t& nSent, int64_t& nFee, const isminefilter& filter) const; + void GetAccountAmounts(const std::string& strAccount, CAmount& nReceived, + CAmount& nSent, CAmount& nFee, const isminefilter& filter) const; bool IsFromMe(const isminefilter& filter) const { @@ -949,7 +949,7 @@ class CAccountingEntry { public: std::string strAccount; - int64_t nCreditDebit; + CAmount nCreditDebit; int64_t nTime; std::string strOtherAccount; std::string strComment; diff --git a/src/walletdb.cpp b/src/walletdb.cpp index a84f44db01..67218bf2c8 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -187,12 +187,12 @@ bool CWalletDB::WriteAccountingEntry(const CAccountingEntry& acentry) return WriteAccountingEntry(++nAccountingEntryNumber, acentry); } -int64_t CWalletDB::GetAccountCreditDebit(const string& strAccount) +CAmount CWalletDB::GetAccountCreditDebit(const string& strAccount) { list entries; ListAccountCreditDebit(strAccount, entries); - int64_t nCreditDebit = 0; + CAmount nCreditDebit = 0; BOOST_FOREACH (const CAccountingEntry& entry, entries) nCreditDebit += entry.nCreditDebit; diff --git a/src/walletdb.h b/src/walletdb.h index 2c5b608f3d..f3d6e61f8b 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -6,6 +6,7 @@ #ifndef BITCOIN_WALLETDB_H #define BITCOIN_WALLETDB_H +#include "amount.h" #include "db.h" #include "key.h" #include "keystore.h" @@ -118,7 +119,7 @@ public: bool EraseDestData(const std::string &address, const std::string &key); bool WriteAccountingEntry(const CAccountingEntry& acentry); - int64_t GetAccountCreditDebit(const std::string& strAccount); + CAmount GetAccountCreditDebit(const std::string& strAccount); void ListAccountCreditDebit(const std::string& strAccount, std::list& acentries); DBErrors ReorderTransactions(CWallet* pwallet); From 0866948e18cb65d2afbc49e4103f3cce05875999 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 26 Sep 2014 20:50:52 -0700 Subject: [PATCH 0774/1288] Add 0.9.3 and fix control --- contrib/debian/changelog | 6 ++++++ contrib/debian/control | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/debian/changelog b/contrib/debian/changelog index 4f22567f85..fe910b65a5 100644 --- a/contrib/debian/changelog +++ b/contrib/debian/changelog @@ -1,3 +1,9 @@ +bitcoin (0.9.3-precise1) precise; urgency=medium + + * New upstream releases. + + -- Matt Corallo (BlueMatt) Fri, 26 Sep 2014 12:01:00 -0700 + bitcoin (0.9.1-precise1) precise; urgency=medium * New upstream release. diff --git a/contrib/debian/control b/contrib/debian/control index ac635f43e0..a653260ad3 100644 --- a/contrib/debian/control +++ b/contrib/debian/control @@ -39,7 +39,6 @@ Description: peer-to-peer network based digital currency - daemon Full transaction history is stored locally at each client. This requires 20+ GB of space, slowly growing. . - This package provides the daemon, bitcoind, and the CLI tool bitcoin-cli to interact with the daemon. From a38eaea082692d0dac6996dcace2084cd7f29179 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sat, 27 Sep 2014 15:58:47 +0200 Subject: [PATCH 0775/1288] doc: Update SHA256SUMS.asc step in release-process.md - The Hash: header is prepended by gpg, and states the hashing used by gpg, not what is used to hash the files - Add more detailed steps --- doc/release-process.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/doc/release-process.md b/doc/release-process.md index 8934be66c4..5b8029955d 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -178,15 +178,11 @@ Commit your signature to gitian.sigs: Note: only Gavin has the code-signing keys currently. -- Create `SHA256SUMS.asc` for builds, and PGP-sign it. This is done manually. - Include all the files to be uploaded. The file has `sha256sum` format with a - simple header at the top: - -``` -Hash: SHA256 - -0060f7d38b98113ab912d4c184000291d7f026eaf77ca5830deec15059678f54 bitcoin-x.y.z-linux.tar.gz -... +- Create `SHA256SUMS.asc` for the builds, and GPG-sign it: +```bash +sha256sum * > SHA256SUMS +gpg --clearsign SHA256SUMS # outputs SHA256SUMS.asc +rm SHA256SUMS ``` - Upload zips and installers, as well as `SHA256SUMS.asc` from last step, to the bitcoin.org server From 0dcb0a55782d676798013f20d7e2ab826ad4d96d Mon Sep 17 00:00:00 2001 From: Saivann Date: Sat, 27 Sep 2014 14:47:12 -0400 Subject: [PATCH 0776/1288] doc: Add instructions for consistent Mac OS X build names --- doc/release-process.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/release-process.md b/doc/release-process.md index 5b8029955d..7d9dd5edb4 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -154,6 +154,10 @@ repackage gitian builds for release as stand-alone zip/tar/installer exe zip -r bitcoin-${VERSION}-win.zip bitcoin-${VERSION}-win rm -rf bitcoin-${VERSION}-win +**Mac OS X .dmg:** + + mv Bitcoin-Qt.dmg bitcoin-${VERSION}-osx.dmg + ###Next steps: Commit your signature to gitian.sigs: From 775b7b8d70da34029d3f29cbd67e82fbfcd30481 Mon Sep 17 00:00:00 2001 From: sinetek Date: Sun, 28 Sep 2014 18:22:44 -0400 Subject: [PATCH 0777/1288] LLu is standard, but not portable. use ULL --- src/serialize.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serialize.h b/src/serialize.h index 7f8f933284..68501facf2 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -245,7 +245,7 @@ uint64_t ReadCompactSize(Stream& is) uint64_t xSize; READDATA(is, xSize); nSizeRet = xSize; - if (nSizeRet < 0x100000000LLu) + if (nSizeRet < 0x100000000ULL) throw std::ios_base::failure("non-canonical ReadCompactSize()"); } if (nSizeRet > (uint64_t)MAX_SIZE) From 0db65d8798193cf9615f5693c66cafcd5af4be5c Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sat, 27 Sep 2014 13:49:21 +0200 Subject: [PATCH 0778/1288] update license of compat and crypto - change license to be just MIT for all files in compat and crypto - also add missing header end comments - ensure default header include style --- src/compat/glibc_compat.cpp | 3 ++- src/compat/glibc_sanity.cpp | 3 ++- src/compat/glibcxx_compat.cpp | 2 +- src/compat/glibcxx_sanity.cpp | 2 +- src/compat/sanity.h | 2 +- src/crypto/common.h | 6 ++++-- src/crypto/ripemd160.cpp | 2 +- src/crypto/ripemd160.h | 4 ++-- src/crypto/sha1.cpp | 2 +- src/crypto/sha1.h | 4 ++-- src/crypto/sha2.cpp | 2 +- src/crypto/sha2.h | 4 ++-- 12 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/compat/glibc_compat.cpp b/src/compat/glibc_compat.cpp index 94c79e4b97..f149a08cd5 100644 --- a/src/compat/glibc_compat.cpp +++ b/src/compat/glibc_compat.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) @@ -7,6 +7,7 @@ #endif #include + #if defined(HAVE_SYS_SELECT_H) #include #endif diff --git a/src/compat/glibc_sanity.cpp b/src/compat/glibc_sanity.cpp index acc7809d77..607e23b568 100644 --- a/src/compat/glibc_sanity.cpp +++ b/src/compat/glibc_sanity.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) @@ -7,6 +7,7 @@ #endif #include + #if defined(HAVE_SYS_SELECT_H) #include #endif diff --git a/src/compat/glibcxx_compat.cpp b/src/compat/glibcxx_compat.cpp index 41d8458cb2..e0b4ac51f5 100644 --- a/src/compat/glibcxx_compat.cpp +++ b/src/compat/glibcxx_compat.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include diff --git a/src/compat/glibcxx_sanity.cpp b/src/compat/glibcxx_sanity.cpp index 9b1fefd448..aafa4a6aef 100644 --- a/src/compat/glibcxx_sanity.cpp +++ b/src/compat/glibcxx_sanity.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include diff --git a/src/compat/sanity.h b/src/compat/sanity.h index e7df44307a..7016ac0ab7 100644 --- a/src/compat/sanity.h +++ b/src/compat/sanity.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCON_COMPAT_SANITY_H diff --git a/src/crypto/common.h b/src/crypto/common.h index 7c3d0a135b..67c30023c3 100644 --- a/src/crypto/common.h +++ b/src/crypto/common.h @@ -1,5 +1,5 @@ // Copyright (c) 2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CRYPTO_COMMON_H @@ -8,7 +8,9 @@ #if defined(HAVE_CONFIG_H) #include "bitcoin-config.h" #endif + #include + #if defined(HAVE_ENDIAN_H) #include #endif @@ -115,4 +117,4 @@ void static inline WriteBE64(unsigned char* ptr, uint64_t x) #endif } -#endif +#endif // BITCOIN_CRYPTO_COMMON_H diff --git a/src/crypto/ripemd160.cpp b/src/crypto/ripemd160.cpp index 90b196ba32..cb4a94a44d 100644 --- a/src/crypto/ripemd160.cpp +++ b/src/crypto/ripemd160.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "crypto/ripemd160.h" diff --git a/src/crypto/ripemd160.h b/src/crypto/ripemd160.h index 76197543be..902e7ca83f 100644 --- a/src/crypto/ripemd160.h +++ b/src/crypto/ripemd160.h @@ -1,5 +1,5 @@ // Copyright (c) 2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_RIPEMD160_H @@ -25,4 +25,4 @@ public: CRIPEMD160& Reset(); }; -#endif +#endif // BITCOIN_RIPEMD160_H diff --git a/src/crypto/sha1.cpp b/src/crypto/sha1.cpp index 5fbea002d6..7f78fdfc6d 100644 --- a/src/crypto/sha1.cpp +++ b/src/crypto/sha1.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "crypto/sha1.h" diff --git a/src/crypto/sha1.h b/src/crypto/sha1.h index 4fa2b333ba..68bd7ced9f 100644 --- a/src/crypto/sha1.h +++ b/src/crypto/sha1.h @@ -1,5 +1,5 @@ // Copyright (c) 2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_SHA1_H @@ -25,4 +25,4 @@ public: CSHA1& Reset(); }; -#endif +#endif // BITCOIN_SHA1_H diff --git a/src/crypto/sha2.cpp b/src/crypto/sha2.cpp index 9a96c5125a..613aac2d71 100644 --- a/src/crypto/sha2.cpp +++ b/src/crypto/sha2.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "crypto/sha2.h" diff --git a/src/crypto/sha2.h b/src/crypto/sha2.h index 15ad5ac383..a6cbe58554 100644 --- a/src/crypto/sha2.h +++ b/src/crypto/sha2.h @@ -1,5 +1,5 @@ // Copyright (c) 2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_SHA2_H @@ -61,4 +61,4 @@ public: void Finalize(unsigned char hash[OUTPUT_SIZE]); }; -#endif +#endif // BITCOIN_SHA2_H From 7bec6dd2305281255efc510c16297556b26268e2 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 29 Sep 2014 08:22:03 +0200 Subject: [PATCH 0779/1288] cleanup license and header end comment in chain.cpp/.h --- src/chain.cpp | 2 +- src/chain.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chain.cpp b/src/chain.cpp index bcb497b2d4..05427a4569 100644 --- a/src/chain.cpp +++ b/src/chain.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "chain.h" diff --git a/src/chain.h b/src/chain.h index 91bdf38347..0aafb40b98 100644 --- a/src/chain.h +++ b/src/chain.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef H_BITCOIN_CHAIN @@ -387,4 +387,4 @@ public: const CBlockIndex *FindFork(const CBlockIndex *pindex) const; }; -#endif +#endif // H_BITCOIN_CHAIN From a25fd6be138ff2bff7e2ad6a1a789db523c0193f Mon Sep 17 00:00:00 2001 From: SergioDemianLerner Date: Thu, 4 Sep 2014 16:23:42 -0300 Subject: [PATCH 0780/1288] Switch testing framework from MAIN to new UNITTEST network UNITTEST inherites from MAIN but allows synamically changing its parameters using the ModifiableParams() interface --- src/Makefile.test.include | 1 + src/chainparams.cpp | 44 +++++++ src/chainparams.h | 23 ++++ src/chainparamsbase.cpp | 17 +++ src/chainparamsbase.h | 1 + src/checkpoints.cpp | 2 + src/main.cpp | 1 + src/pow.cpp | 4 + src/test/base58_tests.cpp | 4 +- src/test/blockv2_tests.cpp | 232 +++++++++++++++++++++++++++++++++++++ src/test/miner_tests.cpp | 1 + src/test/test_bitcoin.cpp | 2 +- 12 files changed, 329 insertions(+), 3 deletions(-) create mode 100644 src/test/blockv2_tests.cpp diff --git a/src/Makefile.test.include b/src/Makefile.test.include index ab449f3e71..d376961996 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -51,6 +51,7 @@ BITCOIN_TESTS =\ test/key_tests.cpp \ test/main_tests.cpp \ test/miner_tests.cpp \ + test/blockv2_tests.cpp \ test/mruset_tests.cpp \ test/multisig_tests.cpp \ test/netbase_tests.cpp \ diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 179db5a818..d924a6a2b0 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -214,8 +214,50 @@ public: }; static CRegTestParams regTestParams; +// +// Regression test +// +class CUnitTestParams : public CMainParams, public CModifiableParams { +public: + CUnitTestParams() { + networkID = CBaseChainParams::UNITTEST; + strNetworkID = "unittest"; + nDefaultPort = 18445; + vFixedSeeds.clear(); + vSeeds.clear(); // Regtest mode doesn't have any DNS seeds. + + fRequireRPCPassword = false; + fMiningRequiresPeers = false; + fDefaultCheckMemPool = true; + fAllowMinDifficultyBlocks = false; + fMineBlocksOnDemand = true; + fSkipProofOfWorkCheck = false; + } + virtual bool SkipProofOfWorkCheck() const { return fSkipProofOfWorkCheck; } +protected: + bool fSkipProofOfWorkCheck; +public: + // Published setters to allow changing values in unit test cases + virtual void setSubsidyHalvingInterval(int anSubsidyHalvingInterval) { nSubsidyHalvingInterval=anSubsidyHalvingInterval; } + virtual void setEnforceBlockUpgradeMajority(int anEnforceBlockUpgradeMajority) { nEnforceBlockUpgradeMajority=anEnforceBlockUpgradeMajority; } + virtual void setRejectBlockOutdatedMajority(int anRejectBlockOutdatedMajority) { nRejectBlockOutdatedMajority=anRejectBlockOutdatedMajority; } + virtual void setToCheckBlockUpgradeMajority(int anToCheckBlockUpgradeMajority) { nToCheckBlockUpgradeMajority=anToCheckBlockUpgradeMajority; } + virtual void setDefaultCheckMemPool(bool aDefaultCheckMemPool) { fDefaultCheckMemPool=aDefaultCheckMemPool; } + virtual void setAllowMinDifficultyBlocks(bool aAllowMinDifficultyBlocks) { fAllowMinDifficultyBlocks=aAllowMinDifficultyBlocks; } + virtual void setSkipProofOfWorkCheck(bool aSkipProofOfWorkCheck) { fSkipProofOfWorkCheck = aSkipProofOfWorkCheck; } +}; +static CUnitTestParams unitTestParams; + + static CChainParams *pCurrentParams = 0; +CModifiableParams *ModifiableParams() +{ + assert(pCurrentParams); + assert(pCurrentParams==&unitTestParams); + return (CModifiableParams*)&unitTestParams; +} + const CChainParams &Params() { assert(pCurrentParams); return *pCurrentParams; @@ -229,6 +271,8 @@ CChainParams &Params(CBaseChainParams::Network network) { return testNetParams; case CBaseChainParams::REGTEST: return regTestParams; + case CBaseChainParams::UNITTEST: + return unitTestParams; default: assert(false && "Unimplemented network"); return mainParams; diff --git a/src/chainparams.h b/src/chainparams.h index e5dfc87c6d..171a590a5f 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -61,6 +61,8 @@ public: bool DefaultCheckMemPool() const { return fDefaultCheckMemPool; } /* Allow mining of a min-difficulty block */ bool AllowMinDifficultyBlocks() const { return fAllowMinDifficultyBlocks; } + /* Skip proof-of-work check: allow mining of any difficulty block */ + virtual bool SkipProofOfWorkCheck() const { return false; } /* Make standard checks */ bool RequireStandard() const { return fRequireStandard; } int64_t TargetTimespan() const { return nTargetTimespan; } @@ -105,6 +107,24 @@ protected: bool fMineBlocksOnDemand; }; +/** Modifiable parameters interface is used by test cases to adapt the parameters in order +*** to test specific features more easily. Test cases should always restore the previous +*** values after finalization. +**/ + +class CModifiableParams { +public: + // Published setters to allow changing values in unit test cases + virtual void setSubsidyHalvingInterval(int anSubsidyHalvingInterval) =0; + virtual void setEnforceBlockUpgradeMajority(int anEnforceBlockUpgradeMajority)=0; + virtual void setRejectBlockOutdatedMajority(int anRejectBlockOutdatedMajority)=0; + virtual void setToCheckBlockUpgradeMajority(int anToCheckBlockUpgradeMajority)=0; + virtual void setDefaultCheckMemPool(bool aDefaultCheckMemPool)=0; + virtual void setAllowMinDifficultyBlocks(bool aAllowMinDifficultyBlocks)=0; + virtual void setSkipProofOfWorkCheck(bool aSkipProofOfWorkCheck)=0; +}; + + /** * Return the currently selected parameters. This won't change after app startup * outside of the unit tests. @@ -114,6 +134,9 @@ const CChainParams &Params(); /** Return parameters for the given network. */ CChainParams &Params(CBaseChainParams::Network network); +/** Get modifyable network parameters (UNITTEST only) */ +CModifiableParams *ModifiableParams(); + /** Sets the params returned by Params() to those for the given network. */ void SelectParams(CBaseChainParams::Network network); diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index 98bb5b855f..e9d63197bd 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -57,6 +57,20 @@ public: }; static CBaseRegTestParams regTestParams; +// +// Unit test +// +class CBaseUnitTestParams : public CBaseMainParams +{ +public: + CBaseUnitTestParams() + { + networkID = CBaseChainParams::UNITTEST; + strDataDir = "unittest"; + } +}; +static CBaseUnitTestParams unitTestParams; + static CBaseChainParams* pCurrentBaseParams = 0; const CBaseChainParams& BaseParams() @@ -77,6 +91,9 @@ void SelectBaseParams(CBaseChainParams::Network network) case CBaseChainParams::REGTEST: pCurrentBaseParams = ®TestParams; break; + case CBaseChainParams::UNITTEST: + pCurrentBaseParams = &unitTestParams; + break; default: assert(false && "Unimplemented network"); return; diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h index c054f03f17..cc154cf501 100644 --- a/src/chainparamsbase.h +++ b/src/chainparamsbase.h @@ -19,6 +19,7 @@ public: MAIN, TESTNET, REGTEST, + UNITTEST, MAX_NETWORK_TYPES }; diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index c41deea7ce..9a6bc05e63 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -88,6 +88,8 @@ namespace Checkpoints { return dataTestnet; else if (Params().NetworkID() == CBaseChainParams::MAIN) return data; + else if (Params().NetworkID() == CBaseChainParams::UNITTEST) // UnitTest share the same checkpoints as MAIN + return data; else return dataRegtest; } diff --git a/src/main.cpp b/src/main.cpp index 9a4271eda2..4bd8fd6e36 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2304,6 +2304,7 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex nHeight = pindexPrev->nHeight+1; // Check proof of work + if (!Params().SkipProofOfWorkCheck()) if (block.nBits != GetNextWorkRequired(pindexPrev, &block)) return state.DoS(100, error("AcceptBlock() : incorrect proof of work"), REJECT_INVALID, "bad-diffbits"); diff --git a/src/pow.cpp b/src/pow.cpp index 893f6c18be..d50222849c 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -81,6 +81,10 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits) bool fNegative; bool fOverflow; uint256 bnTarget; + + if (Params().SkipProofOfWorkCheck()) + return true; + bnTarget.SetCompact(nBits, &fNegative, &fOverflow); // Check range diff --git a/src/test/base58_tests.cpp b/src/test/base58_tests.cpp index 58fffb6df4..c298c805da 100644 --- a/src/test/base58_tests.cpp +++ b/src/test/base58_tests.cpp @@ -175,7 +175,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_parse) BOOST_CHECK_MESSAGE(!secret.IsValid(), "IsValid pubkey as privkey:" + strTest); } } - SelectParams(CBaseChainParams::MAIN); + SelectParams(CBaseChainParams::UNITTEST); } // Goal: check that generated keys match test vectors @@ -243,7 +243,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_gen) CTxDestination nodest = CNoDestination(); BOOST_CHECK(!dummyAddr.Set(nodest)); - SelectParams(CBaseChainParams::MAIN); + SelectParams(CBaseChainParams::UNITTEST); } // Goal: check that base58 parsing code is robust against a variety of corrupted data diff --git a/src/test/blockv2_tests.cpp b/src/test/blockv2_tests.cpp new file mode 100644 index 0000000000..0d59c8761b --- /dev/null +++ b/src/test/blockv2_tests.cpp @@ -0,0 +1,232 @@ +// Copyright (c) 2011-2014 The Bitcoin Core developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "main.h" +#include "miner.h" +#include "uint256.h" +#include "util.h" + +#include + +// Tests the majority rule which states that after 1000 v2 blocks no v1 block can go +BOOST_AUTO_TEST_SUITE(blockv2_tests) + +static CScript scriptPubKey = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG; + +static void SetEmptyBlock(CBlock * pblock) +{ + pblock->nVersion = 2; + pblock->nTime = chainActive.Tip()->GetMedianTimePast()+1; + pblock->nNonce = 0; +} + +static void SetBlockDefaultAttributesAndHeight(CBlock * pblock,bool addHeight,int difValue) +{ + SetEmptyBlock(pblock); + + // Add the coinbase + CMutableTransaction txCoinbase(pblock->vtx[0]); + + if (addHeight) + txCoinbase.vin[0].scriptSig = (CScript() << (chainActive.Height()+1+difValue) << 0); + else + txCoinbase.vin[0].scriptSig = (CScript() << difValue << 0); // At least size 2, this is a protocol spec + + txCoinbase.vout[0].scriptPubKey = CScript(); + pblock->vtx[0] = CTransaction(txCoinbase); + pblock->hashMerkleRoot = pblock->BuildMerkleTree(); +} + +void CheckSubsidyHalving(CBlockTemplate * &pblocktemplate, CBlock * &pblock) +{ + if ((chainActive.Height()+1) % Params().SubsidyHalvingInterval() == 0) + { + // The RegTest network has a low subsidy halving interval (150) so + // we must recompute the coinbase subsidy if we reach the boundary. + + // preserve parent hash + uint256 prevParent = pblock->hashPrevBlock; + delete pblocktemplate; + pblocktemplate = CreateNewBlock(scriptPubKey); + pblock = &pblocktemplate->block; // pointer for convenience + pblock->hashPrevBlock = prevParent; + } +} + +void Blockv2test() +{ + assert(Params().NetworkID() == CBaseChainParams::UNITTEST); + ModifiableParams()->setSkipProofOfWorkCheck(true); + + // We don't know the state of the block-chain here: it depends on which other tests are run before this test. + // See https://github.com/bitcoin/bitcoin/pull/4688 for a patch that allows the re-creation of the block-chain + // for each testcase that requires it. + + // If miner_tests.cpp is run before, the chain will be 100 blocks long, and all of them will be v1 + + + LogPrintf("Blockv2test testcase starts\n"); + + CBlockTemplate *pblocktemplate; + CScript script; + uint256 hash; + int PreviousHeight; + + + LOCK(cs_main); + + + // Simple block creation, nothing special yet. + pblocktemplate = CreateNewBlock(scriptPubKey); + CBlock *pblock = &pblocktemplate->block; // pointer for convenience + + LogPrintf("Blockv2test block v1 add begin\n"); + // First create a block v1, check that it is accepted. The block has an invalid height + SetBlockDefaultAttributesAndHeight(pblock,false,5000); + pblock->nVersion = 1; + CValidationState state1; + PreviousHeight = chainActive.Height(); + BOOST_CHECK(ProcessBlock(state1, NULL, pblock)); + BOOST_CHECK(state1.IsValid()); + BOOST_CHECK((PreviousHeight+1) == chainActive.Height()); // to differentiate from orphan blocks, which also get accepted in ProcessBlock() + pblock->hashPrevBlock = pblock->GetHash(); // update parent + + + // Now create exactly 1000 blocks v2 + + // First check that the supermajority threshold is exactly 1000 blocks + BOOST_CHECK(Params().ToCheckBlockUpgradeMajority()==1000); // + BOOST_CHECK(Params().EnforceBlockUpgradeMajority()==750); + BOOST_CHECK(Params().RejectBlockOutdatedMajority()==950); + + // Over the last 1000 blocks, 750 blocks must be v2 to switch to v2-only mode. + // Here we're testing only the last 750, not any subset. + + LogPrintf("Blockv2test BIP30 repetition begin\n"); + + // First, if we try to add a block v2 with the same coinbase tx, we should get + // "bad-txns-BIP30" because the coinbase tx has the same hash as the previous. + // Unluckily, even if ConnectBlock returns a "bad-txns-BIP30", ActivateBestChainStep clears + // the state, so we get true here and the "bad-txns-BIP30" reason is lost. + // We verify instead that the chain height has not been incremented. + + CValidationState state7; + PreviousHeight = chainActive.Height(); + CheckSubsidyHalving(pblocktemplate,pblock); + SetBlockDefaultAttributesAndHeight(pblock,false,5000); // + pblock->nVersion = 2; + BOOST_CHECK(ProcessBlock(state7, NULL, pblock)); // should we care about the return value? + BOOST_CHECK(state7.IsValid()); + BOOST_CHECK(PreviousHeight == chainActive.Height()); // we check the block has not been added. + + LogPrintf("Blockv2test 750 v2 blocks begin\n"); + for (int i=0;i<750;i++) + { + + LogPrintf("Blockv2test block %d begin\n",i); + + CheckSubsidyHalving(pblocktemplate,pblock); + + // We add a value to the height to make is NOT equal to the actual height. + SetBlockDefaultAttributesAndHeight(pblock,true,1000); // blocks version 2 without height are allowed! for only 750 blocks + pblock->nVersion = 2; + CValidationState state; + + PreviousHeight = chainActive.Height(); + BOOST_CHECK(ProcessBlock(state, NULL, pblock)); + BOOST_CHECK(state.IsValid()); + BOOST_CHECK((PreviousHeight+1) == chainActive.Height()); // to differentiate from orphan blocks, which also get accepted in ProcessBlock() + pblock->hashPrevBlock = pblock->GetHash(); // update parent + } + + LogPrintf("Blockv2test v2 without height rejected begin\n"); + + // Now we try to add a block v2, with an invalid height and it should be rejected. We use 2000 because is not in the range [1000..1750]. + CheckSubsidyHalving(pblocktemplate,pblock); + SetBlockDefaultAttributesAndHeight(pblock,true,2000); // + pblock->nVersion = 2; + CValidationState state0; + BOOST_CHECK(ProcessBlock(state0, NULL, pblock)==false); + BOOST_CHECK(!state0.IsValid()); + BOOST_CHECK(state0.GetRejectReason()=="bad-cb-height"); + // Do not update parent since block has failed + + LogPrintf("Blockv2test v2 with height accepted begin\n"); + + + // Now we add a block with height, must be ok. + for (int i=0;i<200;i++) + { + + LogPrintf("Blockv2test v2block %d begin\n",i); + CheckSubsidyHalving(pblocktemplate,pblock); + SetBlockDefaultAttributesAndHeight(pblock,true,0); + pblock->nVersion = 2; + CValidationState state; + PreviousHeight = chainActive.Height(); + BOOST_CHECK(ProcessBlock(state, NULL, pblock)); + BOOST_CHECK(state.IsValid()); + BOOST_CHECK((PreviousHeight+1) == chainActive.Height()); // to differentiate from orphan blocks, which also get accepted in ProcessBlock() + + pblock->hashPrevBlock = pblock->GetHash(); // update parent + } + + + LogPrintf("Blockv2test block v1 rejected\n"); + // Now we add 200 additional blocks, until we get 950 (the threshold were v1 blocks are not accepted anymore) + // Now we try to add a block v1, it should be rejected, even if it hash the height field + CheckSubsidyHalving(pblocktemplate,pblock); + SetBlockDefaultAttributesAndHeight(pblock,true,0); + pblock->nVersion = 1; + CValidationState state2; + BOOST_CHECK(ProcessBlock(state2, NULL, pblock)==false); + BOOST_CHECK(!state2.IsValid()); + BOOST_CHECK(state2.GetRejectReason()=="bad-version"); + // Do not update parent since block has failed + + + + // Some other missing tests, added here as bonus... + + // Block time too old check + CheckSubsidyHalving(pblocktemplate,pblock); + SetBlockDefaultAttributesAndHeight(pblock,true,0); + pblock->nVersion = 2; + pblock->nTime = chainActive.Tip()->GetMedianTimePast()-1; + CValidationState state4; + BOOST_CHECK(ProcessBlock(state4, NULL, pblock)==false); + BOOST_CHECK(!state4.IsValid()); + BOOST_CHECK(state4.GetRejectReason()=="time-too-old"); + // Do not update parent since block has failed + + // Adding a non-final coinbase, must modify coinbase + CheckSubsidyHalving(pblocktemplate,pblock); + SetEmptyBlock(pblock); + // Use a mutable coinbase to change nLockTime and nSequence + CMutableTransaction txCoinbase(pblock->vtx[0]); + txCoinbase.vin[0].scriptSig = (CScript() << chainActive.Height() << 0); + txCoinbase.nLockTime = LOCKTIME_THRESHOLD-1; // refers to height + txCoinbase.vin[0].nSequence = 1; // non-zero sequence + pblock->vtx[0] = CTransaction(txCoinbase); + pblock->nVersion = 2; + pblock->hashMerkleRoot = pblock->BuildMerkleTree(); + CValidationState state5; + BOOST_CHECK(ProcessBlock(state5, NULL, pblock)==false); + BOOST_CHECK(!state5.IsValid()); + BOOST_CHECK(state5.GetRejectReason()=="bad-txns-nonfinal"); + // Do not update parent since block has failed + + + delete pblocktemplate; + + ModifiableParams()->setSkipProofOfWorkCheck(false); + LogPrintf("Blockv2test testcase ends\n"); +} + +BOOST_AUTO_TEST_CASE(Blockv2testcase) +{ + Blockv2test(); +} + +BOOST_AUTO_TEST_SUITE_END() diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index 9e4669eba9..bad5c13ac2 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -253,6 +253,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) chainActive.Tip()->nHeight--; SetMockTime(0); + mempool.clear(); BOOST_FOREACH(CTransaction *tx, txFirst) delete tx; diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 68fad8d038..6e5f0e3fac 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -31,7 +31,7 @@ struct TestingSetup { TestingSetup() { fPrintToDebugLog = false; // don't want to write to debug.log file - SelectParams(CBaseChainParams::MAIN); + SelectParams(CBaseChainParams::UNITTEST); noui_connect(); #ifdef ENABLE_WALLET bitdb.MakeMock(); From 5e2e7fcb99738d9254d4030d53e4f711b2fc5ee0 Mon Sep 17 00:00:00 2001 From: SergioDemianLerner Date: Tue, 9 Sep 2014 13:29:24 -0300 Subject: [PATCH 0781/1288] Suggested corrections on comments, variable names. Also new test case testing the PoW skip in UNITTEST. --- src/chainparams.cpp | 8 +-- src/main.cpp | 4 +- src/test/blockv2_tests.cpp | 127 +++++++++++++++++++++++++------------ 3 files changed, 91 insertions(+), 48 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index d924a6a2b0..8a00da0bb5 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -215,7 +215,7 @@ public: static CRegTestParams regTestParams; // -// Regression test +// Unit test // class CUnitTestParams : public CMainParams, public CModifiableParams { public: @@ -242,9 +242,9 @@ public: virtual void setEnforceBlockUpgradeMajority(int anEnforceBlockUpgradeMajority) { nEnforceBlockUpgradeMajority=anEnforceBlockUpgradeMajority; } virtual void setRejectBlockOutdatedMajority(int anRejectBlockOutdatedMajority) { nRejectBlockOutdatedMajority=anRejectBlockOutdatedMajority; } virtual void setToCheckBlockUpgradeMajority(int anToCheckBlockUpgradeMajority) { nToCheckBlockUpgradeMajority=anToCheckBlockUpgradeMajority; } - virtual void setDefaultCheckMemPool(bool aDefaultCheckMemPool) { fDefaultCheckMemPool=aDefaultCheckMemPool; } - virtual void setAllowMinDifficultyBlocks(bool aAllowMinDifficultyBlocks) { fAllowMinDifficultyBlocks=aAllowMinDifficultyBlocks; } - virtual void setSkipProofOfWorkCheck(bool aSkipProofOfWorkCheck) { fSkipProofOfWorkCheck = aSkipProofOfWorkCheck; } + virtual void setDefaultCheckMemPool(bool afDefaultCheckMemPool) { fDefaultCheckMemPool=afDefaultCheckMemPool; } + virtual void setAllowMinDifficultyBlocks(bool afAllowMinDifficultyBlocks) { fAllowMinDifficultyBlocks=afAllowMinDifficultyBlocks; } + virtual void setSkipProofOfWorkCheck(bool afSkipProofOfWorkCheck) { fSkipProofOfWorkCheck = afSkipProofOfWorkCheck; } }; static CUnitTestParams unitTestParams; diff --git a/src/main.cpp b/src/main.cpp index 4bd8fd6e36..7e60fd4ff9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2304,8 +2304,8 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex nHeight = pindexPrev->nHeight+1; // Check proof of work - if (!Params().SkipProofOfWorkCheck()) - if (block.nBits != GetNextWorkRequired(pindexPrev, &block)) + if ((!Params().SkipProofOfWorkCheck()) && + (block.nBits != GetNextWorkRequired(pindexPrev, &block))) return state.DoS(100, error("AcceptBlock() : incorrect proof of work"), REJECT_INVALID, "bad-diffbits"); diff --git a/src/test/blockv2_tests.cpp b/src/test/blockv2_tests.cpp index 0d59c8761b..96c0df5e6b 100644 --- a/src/test/blockv2_tests.cpp +++ b/src/test/blockv2_tests.cpp @@ -9,33 +9,34 @@ #include -// Tests the majority rule which states that after 1000 v2 blocks no v1 block can go +// This test cheecks the majority rule which states that after 1000 v2 blocks no new v1 block can be part of that branch. + BOOST_AUTO_TEST_SUITE(blockv2_tests) static CScript scriptPubKey = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG; static void SetEmptyBlock(CBlock * pblock) { - pblock->nVersion = 2; - pblock->nTime = chainActive.Tip()->GetMedianTimePast()+1; - pblock->nNonce = 0; + pblock->nVersion = 2; + pblock->nTime = chainActive.Tip()->GetMedianTimePast()+1; + pblock->nNonce = 0; } -static void SetBlockDefaultAttributesAndHeight(CBlock * pblock,bool addHeight,int difValue) +static void SetBlockDefaultAttributesAndHeight(CBlock * pblock,bool addHeight,int heightDifference) { - SetEmptyBlock(pblock); + SetEmptyBlock(pblock); - // Add the coinbase - CMutableTransaction txCoinbase(pblock->vtx[0]); + // Add the coinbase + CMutableTransaction txCoinbase(pblock->vtx[0]); - if (addHeight) - txCoinbase.vin[0].scriptSig = (CScript() << (chainActive.Height()+1+difValue) << 0); - else - txCoinbase.vin[0].scriptSig = (CScript() << difValue << 0); // At least size 2, this is a protocol spec + if (addHeight) + txCoinbase.vin[0].scriptSig = (CScript() << (chainActive.Height()+1+heightDifference) << 0); + else + txCoinbase.vin[0].scriptSig = (CScript() << heightDifference << 0); // At least size 2, this is a protocol spec - txCoinbase.vout[0].scriptPubKey = CScript(); - pblock->vtx[0] = CTransaction(txCoinbase); - pblock->hashMerkleRoot = pblock->BuildMerkleTree(); + txCoinbase.vout[0].scriptPubKey = CScript(); + pblock->vtx[0] = CTransaction(txCoinbase); + pblock->hashMerkleRoot = pblock->BuildMerkleTree(); } void CheckSubsidyHalving(CBlockTemplate * &pblocktemplate, CBlock * &pblock) @@ -44,6 +45,8 @@ void CheckSubsidyHalving(CBlockTemplate * &pblocktemplate, CBlock * &pblock) { // The RegTest network has a low subsidy halving interval (150) so // we must recompute the coinbase subsidy if we reach the boundary. + // The unittest network allows modifying this interval. We check it so this + // test can work in any network. // preserve parent hash uint256 prevParent = pblock->hashPrevBlock; @@ -54,6 +57,22 @@ void CheckSubsidyHalving(CBlockTemplate * &pblocktemplate, CBlock * &pblock) } } +void CheckBlockAddedToBestChainSuccessfully(CBlock *pblock) +{ + int PreviousHeight; + CValidationState state; + + PreviousHeight = chainActive.Height(); + BOOST_CHECK(ProcessBlock(state, NULL, pblock)); + BOOST_CHECK(state.IsValid()); + BOOST_CHECK((PreviousHeight+1) == chainActive.Height()); // to differentiate from orphan blocks, which also get accepted in ProcessBlock() + + // Previous checks do not assure the current best chain has pblock as tip. It could be the case that a because + // of a malfunction in the chain reorganization code, a reorganization causes an increase of the chain length, but with another tip. + // So we also check that. + BOOST_CHECK(chainActive.Tip()->GetBlockHash()==pblock->GetHash()); +} + void Blockv2test() { assert(Params().NetworkID() == CBaseChainParams::UNITTEST); @@ -73,16 +92,17 @@ void Blockv2test() uint256 hash; int PreviousHeight; - LOCK(cs_main); - // Simple block creation, nothing special yet. pblocktemplate = CreateNewBlock(scriptPubKey); CBlock *pblock = &pblocktemplate->block; // pointer for convenience LogPrintf("Blockv2test block v1 add begin\n"); - // First create a block v1, check that it is accepted. The block has an invalid height + + //////////////////////////////////////////////////////////////////////////////////////// + // First create a block v1, check that it is accepted. The block has an invalid height. + //////////////////////////////////////////////////////////////////////////////////////// SetBlockDefaultAttributesAndHeight(pblock,false,5000); pblock->nVersion = 1; CValidationState state1; @@ -93,7 +113,6 @@ void Blockv2test() pblock->hashPrevBlock = pblock->GetHash(); // update parent - // Now create exactly 1000 blocks v2 // First check that the supermajority threshold is exactly 1000 blocks BOOST_CHECK(Params().ToCheckBlockUpgradeMajority()==1000); // @@ -105,11 +124,19 @@ void Blockv2test() LogPrintf("Blockv2test BIP30 repetition begin\n"); + /////////////////////////////////////////////////////////////////////////////////////////////////////// // First, if we try to add a block v2 with the same coinbase tx, we should get // "bad-txns-BIP30" because the coinbase tx has the same hash as the previous. - // Unluckily, even if ConnectBlock returns a "bad-txns-BIP30", ActivateBestChainStep clears - // the state, so we get true here and the "bad-txns-BIP30" reason is lost. - // We verify instead that the chain height has not been incremented. + // Even if ConnectBlock returns a "bad-txns-BIP30", ActivateBestChainStep clears + // the state, so we get true here and the "bad-txns-BIP30" reason is lost. But this + // is the intended behaviour: Receiving a single block can cause zero or multiple blocks to be + // connected, and ActivateBestChain's responsibility is just switching the best block whatsoever. + // Feedback about failures causes a reject message to be sent to the peer from which we received + // the actual block (not necessarily the same as from whom we got the block that caused the reorg), + // for which we remember the peerid. + // Because we cannot access the failure reason here, we just verify instead that the chain + // height has not been incremented. + ////////////////////////////////////////////////////////////////////////////////////////////////////// CValidationState state7; PreviousHeight = chainActive.Height(); @@ -121,6 +148,11 @@ void Blockv2test() BOOST_CHECK(PreviousHeight == chainActive.Height()); // we check the block has not been added. LogPrintf("Blockv2test 750 v2 blocks begin\n"); + + //////////////////////////// + // Now create 750 v2 blocks + //////////////////////////// + for (int i=0;i<750;i++) { @@ -131,18 +163,17 @@ void Blockv2test() // We add a value to the height to make is NOT equal to the actual height. SetBlockDefaultAttributesAndHeight(pblock,true,1000); // blocks version 2 without height are allowed! for only 750 blocks pblock->nVersion = 2; - CValidationState state; - PreviousHeight = chainActive.Height(); - BOOST_CHECK(ProcessBlock(state, NULL, pblock)); - BOOST_CHECK(state.IsValid()); - BOOST_CHECK((PreviousHeight+1) == chainActive.Height()); // to differentiate from orphan blocks, which also get accepted in ProcessBlock() + CheckBlockAddedToBestChainSuccessfully(pblock); pblock->hashPrevBlock = pblock->GetHash(); // update parent } LogPrintf("Blockv2test v2 without height rejected begin\n"); - // Now we try to add a block v2, with an invalid height and it should be rejected. We use 2000 because is not in the range [1000..1750]. + ///////////////////////////////////////////////////////////////////////////////////// + // Now we try to add a block v2, with an invalid height and it should be rejected. + // We use 2000 as argument heightDifference because is not in the range [1000..1750]. + ///////////////////////////////////////////////////////////////////////////////////// CheckSubsidyHalving(pblocktemplate,pblock); SetBlockDefaultAttributesAndHeight(pblock,true,2000); // pblock->nVersion = 2; @@ -154,8 +185,10 @@ void Blockv2test() LogPrintf("Blockv2test v2 with height accepted begin\n"); - - // Now we add a block with height, must be ok. + ///////////////////////////////////////////////////////////// + // Now we add 200 additional blocks, until we get 950 + // (the threshold where v1 blocks are not accepted anymore) + ///////////////////////////////////////////////////////////// for (int i=0;i<200;i++) { @@ -163,19 +196,16 @@ void Blockv2test() CheckSubsidyHalving(pblocktemplate,pblock); SetBlockDefaultAttributesAndHeight(pblock,true,0); pblock->nVersion = 2; - CValidationState state; - PreviousHeight = chainActive.Height(); - BOOST_CHECK(ProcessBlock(state, NULL, pblock)); - BOOST_CHECK(state.IsValid()); - BOOST_CHECK((PreviousHeight+1) == chainActive.Height()); // to differentiate from orphan blocks, which also get accepted in ProcessBlock() - + CheckBlockAddedToBestChainSuccessfully(pblock); pblock->hashPrevBlock = pblock->GetHash(); // update parent } LogPrintf("Blockv2test block v1 rejected\n"); - // Now we add 200 additional blocks, until we get 950 (the threshold were v1 blocks are not accepted anymore) + + ///////////////////////////////////////////////////////////////////////////////////////// // Now we try to add a block v1, it should be rejected, even if it hash the height field + ///////////////////////////////////////////////////////////////////////////////////////// CheckSubsidyHalving(pblocktemplate,pblock); SetBlockDefaultAttributesAndHeight(pblock,true,0); pblock->nVersion = 1; @@ -185,11 +215,9 @@ void Blockv2test() BOOST_CHECK(state2.GetRejectReason()=="bad-version"); // Do not update parent since block has failed - - - // Some other missing tests, added here as bonus... - + //////////////////////////////////////////////////////// // Block time too old check + //////////////////////////////////////////////////////// CheckSubsidyHalving(pblocktemplate,pblock); SetBlockDefaultAttributesAndHeight(pblock,true,0); pblock->nVersion = 2; @@ -200,7 +228,9 @@ void Blockv2test() BOOST_CHECK(state4.GetRejectReason()=="time-too-old"); // Do not update parent since block has failed + //////////////////////////////////////////////////////// // Adding a non-final coinbase, must modify coinbase + //////////////////////////////////////////////////////// CheckSubsidyHalving(pblocktemplate,pblock); SetEmptyBlock(pblock); // Use a mutable coinbase to change nLockTime and nSequence @@ -217,10 +247,23 @@ void Blockv2test() BOOST_CHECK(state5.GetRejectReason()=="bad-txns-nonfinal"); // Do not update parent since block has failed + ModifiableParams()->setSkipProofOfWorkCheck(false); + + //////////////////////////////////////////////////////////////////////////////// + // Just to be sure that proof-of-work skipping is working ok, we submit a block + // without enought proof of work and it must be rejected. + //////////////////////////////////////////////////////////////////////////////// + CheckSubsidyHalving(pblocktemplate,pblock); + SetBlockDefaultAttributesAndHeight(pblock,true,0); + pblock->nVersion = 2; + CValidationState state6; + BOOST_CHECK(ProcessBlock(state6, NULL, pblock)==false); + BOOST_CHECK(!state6.IsValid()); + BOOST_CHECK(state6.GetRejectReason()=="high-hash"); delete pblocktemplate; - ModifiableParams()->setSkipProofOfWorkCheck(false); + LogPrintf("Blockv2test testcase ends\n"); } From 470590277782cce2fe73275c74523aef59a51eab Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 29 Sep 2014 13:13:47 +0200 Subject: [PATCH 0782/1288] Avoid introducing a virtual into CChainParams Treat fSkipProofOfWorkCheck the same as other parameters. --- src/chainparams.cpp | 5 +---- src/chainparams.h | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 8a00da0bb5..31c67715c8 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -115,6 +115,7 @@ public: fAllowMinDifficultyBlocks = false; fRequireStandard = true; fMineBlocksOnDemand = false; + fSkipProofOfWorkCheck = false; } }; static CMainParams mainParams; @@ -231,11 +232,7 @@ public: fDefaultCheckMemPool = true; fAllowMinDifficultyBlocks = false; fMineBlocksOnDemand = true; - fSkipProofOfWorkCheck = false; } - virtual bool SkipProofOfWorkCheck() const { return fSkipProofOfWorkCheck; } -protected: - bool fSkipProofOfWorkCheck; public: // Published setters to allow changing values in unit test cases virtual void setSubsidyHalvingInterval(int anSubsidyHalvingInterval) { nSubsidyHalvingInterval=anSubsidyHalvingInterval; } diff --git a/src/chainparams.h b/src/chainparams.h index 171a590a5f..50441a89f3 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -62,7 +62,7 @@ public: /* Allow mining of a min-difficulty block */ bool AllowMinDifficultyBlocks() const { return fAllowMinDifficultyBlocks; } /* Skip proof-of-work check: allow mining of any difficulty block */ - virtual bool SkipProofOfWorkCheck() const { return false; } + bool SkipProofOfWorkCheck() const { return fSkipProofOfWorkCheck; } /* Make standard checks */ bool RequireStandard() const { return fRequireStandard; } int64_t TargetTimespan() const { return nTargetTimespan; } @@ -105,6 +105,7 @@ protected: bool fAllowMinDifficultyBlocks; bool fRequireStandard; bool fMineBlocksOnDemand; + bool fSkipProofOfWorkCheck; }; /** Modifiable parameters interface is used by test cases to adapt the parameters in order From 28fb5f388da2243386c26ab8793383db40715ea5 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 29 Sep 2014 16:58:30 +0200 Subject: [PATCH 0783/1288] doc: update gpg command line for SHA256SUMS.asc in release process --- doc/release-process.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/release-process.md b/doc/release-process.md index 5b8029955d..940f934baf 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -181,9 +181,10 @@ Commit your signature to gitian.sigs: - Create `SHA256SUMS.asc` for the builds, and GPG-sign it: ```bash sha256sum * > SHA256SUMS -gpg --clearsign SHA256SUMS # outputs SHA256SUMS.asc +gpg --digest-algo sha256 --clearsign SHA256SUMS # outputs SHA256SUMS.asc rm SHA256SUMS ``` +(the digest algorithm is forced to sha256 to avoid confusion of the `Hash:` header that GPG adds with the SHA256 used for the files) - Upload zips and installers, as well as `SHA256SUMS.asc` from last step, to the bitcoin.org server From 68af7d02cf63eb3d2ed015013d245fe5d3aadbd1 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 29 Sep 2014 19:16:24 +0200 Subject: [PATCH 0784/1288] Fix vector out of bounds in script tests --- src/test/script_tests.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index f9086b6a64..7f09b3daa1 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -108,20 +108,20 @@ struct KeyData KeyData() { - key0.Set(&vchKey0[0], &vchKey0[32], false); - key0C.Set(&vchKey0[0], &vchKey0[32], true); + key0.Set(vchKey0, vchKey0 + 32, false); + key0C.Set(vchKey0, vchKey0 + 32, true); pubkey0 = key0.GetPubKey(); pubkey0H = key0.GetPubKey(); pubkey0C = key0C.GetPubKey(); *const_cast(&pubkey0H[0]) = 0x06 | (pubkey0H[64] & 1); - key1.Set(&vchKey1[0], &vchKey1[32], false); - key1C.Set(&vchKey1[0], &vchKey1[32], true); + key1.Set(vchKey1, vchKey1 + 32, false); + key1C.Set(vchKey1, vchKey1 + 32, true); pubkey1 = key1.GetPubKey(); pubkey1C = key1C.GetPubKey(); - key2.Set(&vchKey2[0], &vchKey2[32], false); - key2C.Set(&vchKey2[0], &vchKey2[32], true); + key2.Set(vchKey2, vchKey2 + 32, false); + key2C.Set(vchKey2, vchKey2 + 32, true); pubkey2 = key2.GetPubKey(); pubkey2C = key2C.GetPubKey(); } @@ -190,8 +190,8 @@ public: std::vector vchSig, r, s; do { key.Sign(hash, vchSig, lenS <= 32); - r = std::vector(&vchSig[4], &vchSig[4 + vchSig[3]]); - s = std::vector(&vchSig[6 + vchSig[3]], &vchSig[6 + vchSig[3] + vchSig[5 + vchSig[3]]]); + r = std::vector(vchSig.begin() + 4, vchSig.begin() + 4 + vchSig[3]); + s = std::vector(vchSig.begin() + 6 + vchSig[3], vchSig.begin() + 6 + vchSig[3] + vchSig[5 + vchSig[3]]); } while (lenR != r.size() || lenS != s.size()); vchSig.push_back(static_cast(nHashType)); DoPush(vchSig); From af0bd5ee7f8ad241830436e932af2486715327e9 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 29 Sep 2014 22:03:11 -0400 Subject: [PATCH 0785/1288] osx: fix signing to make Gatekeeper happy (again) The approach from 65f3fa8d1 worked for signing on 10.9.4, but not newer versions. 10.9.5 (and up) want each framework to stand alone. Now in addition to copying the plist's from Qt for each framework, we put them in per-version dirs and only symlink to the latest, rather than using symlinks for any contents. --- contrib/macdeploy/macdeployqtplus | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index 5ab6a222dd..1b50981f0a 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -283,8 +283,8 @@ def copyFramework(framework, path, verbose): if not framework.isDylib(): # Copy resources for real frameworks - linkfrom = os.path.join(path, "Contents/Frameworks/", framework.frameworkName, framework.binaryName) - linkto = os.path.join(framework.binaryPath) + linkfrom = os.path.join(path, "Contents","Frameworks", framework.frameworkName, "Versions", "Current") + linkto = framework.version if not os.path.exists(linkfrom): os.symlink(linkto, linkfrom) if verbose >= 2: @@ -303,11 +303,6 @@ def copyFramework(framework, path, verbose): toContentsDir = os.path.join(path, framework.destinationVersionContentsDirectory) shutil.copytree(fromContentsDir, toContentsDir) contentslinkfrom = os.path.join(path, framework.destinationContentsDirectory) - if not os.path.exists(contentslinkfrom): - contentslinkto = os.path.join("Versions/", framework.version, "Contents") - os.symlink(contentslinkto, contentslinkfrom) - if verbose >= 3: - print "Linked:", contentslinkfrom, "->", contentslinkto if verbose >= 3: print "Copied Contents:", fromContentsDir print " to:", toContentsDir From 41020ebe862416931b009256020a4e7a8191c8ae Mon Sep 17 00:00:00 2001 From: Whit J Date: Tue, 30 Sep 2014 10:41:31 -0700 Subject: [PATCH 0786/1288] Fix formatting in init.md --- doc/init.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/init.md b/doc/init.md index 3d14025ab4..1f0559d806 100644 --- a/doc/init.md +++ b/doc/init.md @@ -4,10 +4,10 @@ Sample init scripts and service configuration for bitcoind Sample scripts and configuration files for systemd, Upstart and OpenRC can be found in the contrib/init folder. -contrib/init/bitcoind.service: systemd service unit configuration -contrib/init/bitcoind.openrc: OpenRC compatible SysV style init script -contrib/init/bitcoind.openrcconf: OpenRC conf.d file -contrib/init/bitcoind.conf: Upstart service configuration file + contrib/init/bitcoind.service: systemd service unit configuration + contrib/init/bitcoind.openrc: OpenRC compatible SysV style init script + contrib/init/bitcoind.openrcconf: OpenRC conf.d file + contrib/init/bitcoind.conf: Upstart service configuration file 1. Service User --------------------------------- From 6d7a0fa4e5a691764dc532d64af40b2dd3dc9e8b Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 3 Sep 2014 16:36:06 -0400 Subject: [PATCH 0787/1288] depends: update the comparison tool to a more recent version --- depends/packages/native_comparisontool.mk | 39 +++++------------------ 1 file changed, 8 insertions(+), 31 deletions(-) diff --git a/depends/packages/native_comparisontool.mk b/depends/packages/native_comparisontool.mk index 003923d7dd..d9f7722190 100644 --- a/depends/packages/native_comparisontool.mk +++ b/depends/packages/native_comparisontool.mk @@ -1,30 +1,12 @@ package=native_comparisontool -$(package)_version=1 -$(package)_download_path=https://github.com/TheBlueMatt/test-scripts/raw/master/BitcoindComparisonTool_jar -$(package)_file_name=BitcoindComparisonTool.jar -$(package)_sha256_hash=a08b1a55523e7f57768cb66c35f47a926710e5b6c82822e1ccfbe38fcce37db2 -$(package)_guava_file_name=guava-13.0.1.jar -$(package)_guava_sha256_hash=feb4b5b2e79a63b72ec47a693b1cf35cf1cea1f60a2bb2615bf21f74c7a60bb0 -$(package)_h2_file_name=h2-1.3.167.jar -$(package)_h2_sha256_hash=fa97521a2e72174485a96276bcf6f573d5e44ca6aba2f62de87b33b5bb0d4b91 -$(package)_sc-light-jdk15on_file_name=sc-light-jdk15on-1.47.0.2.jar -$(package)_sc-light-jdk15on_sha256_hash=931f39d351429fb96c2f749e7ecb1a256a8ebbf5edca7995c9cc085b94d1841d -$(package)_slf4j-api_file_name=slf4j-api-1.6.4.jar -$(package)_slf4j-api_sha256_hash=367b909030f714ee1176ab096b681e06348f03385e98d1bce0ed801b5452357e -$(package)_slf4j-jdk14_file_name=slf4j-jdk14-1.6.4.jar -$(package)_slf4j-jdk14_sha256_hash=064bd81796710f713f9f4a2309c0e032309934c2d2b4f7d3b6958325e584e13f - -define $(package)_fetch_cmds -$(call fetch_file,$(package),$($(package)_download_path),$($(package)_file_name),$($(package)_file_name),$($(package)_sha256_hash)) && \ -$(call fetch_file,$(package),$($(package)_download_path),$($(package)_guava_file_name),$($(package)_guava_file_name),$($(package)_guava_sha256_hash)) && \ -$(call fetch_file,$(package),$($(package)_download_path),$($(package)_h2_file_name),$($(package)_h2_file_name),$($(package)_h2_sha256_hash)) && \ -$(call fetch_file,$(package),$($(package)_download_path),$($(package)_sc-light-jdk15on_file_name),$($(package)_sc-light-jdk15on_file_name),$($(package)_sc-light-jdk15on_sha256_hash)) && \ -$(call fetch_file,$(package),$($(package)_download_path),$($(package)_slf4j-api_file_name),$($(package)_slf4j-api_file_name),$($(package)_slf4j-api_sha256_hash)) && \ -$(call fetch_file,$(package),$($(package)_download_path),$($(package)_slf4j-jdk14_file_name),$($(package)_slf4j-jdk14_file_name),$($(package)_slf4j-jdk14_sha256_hash)) -endef +$(package)_version=adfd3de7 +$(package)_download_path=https://github.com/TheBlueMatt/test-scripts/raw/10222bfdace65a0c5f3bd4a766eeb6b3a8b869fb/ +$(package)_file_name=pull-tests-$($(package)_version).jar +$(package)_sha256_hash=fd2282b112e35f339dbe3729b08a04834ad719f8c9c10eeec1178465e6d36a18 +$(package)_install_dirname=BitcoindComparisonTool_jar +$(package)_install_filename=BitcoindComparisonTool.jar define $(package)_extract_cmds -echo none endef define $(package)_configure_cmds @@ -34,11 +16,6 @@ define $(package)_build_cmds endef define $(package)_stage_cmds - mkdir -p $($(package)_staging_prefix_dir)/share/BitcoindComparisonTool_jar && \ - cp $(SOURCES_PATH)/$($(package)_file_name) $($(package)_staging_prefix_dir)/share/BitcoindComparisonTool_jar/ && \ - cp $(SOURCES_PATH)/$($(package)_guava_file_name) $($(package)_staging_prefix_dir)/share/BitcoindComparisonTool_jar/ && \ - cp $(SOURCES_PATH)/$($(package)_h2_file_name) $($(package)_staging_prefix_dir)/share/BitcoindComparisonTool_jar/ && \ - cp $(SOURCES_PATH)/$($(package)_sc-light-jdk15on_file_name) $($(package)_staging_prefix_dir)/share/BitcoindComparisonTool_jar/ && \ - cp $(SOURCES_PATH)/$($(package)_slf4j-api_file_name) $($(package)_staging_prefix_dir)/share/BitcoindComparisonTool_jar/ && \ - cp $(SOURCES_PATH)/$($(package)_slf4j-jdk14_file_name) $($(package)_staging_prefix_dir)/share/BitcoindComparisonTool_jar/ + mkdir -p $($(package)_staging_prefix_dir)/share/$($(package)_install_dirname) && \ + mv $(SOURCES_PATH)/$($(package)_file_name) $($(package)_staging_prefix_dir)/share/$($(package)_install_dirname)/$($(package)_install_filename) endef From e166c177bccdaf5b3c1b2238e8e04d53554d138e Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 29 Sep 2014 22:51:47 -0700 Subject: [PATCH 0788/1288] Revert "travis: retry tests before giving up" This reverts commit 7e3821c097c05a4790abac53ddd26ef28cb7cf4d. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 155ac012d8..f7d94df646 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,6 +58,6 @@ script: - cd bitcoin-$HOST - ./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false) - make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false ) - - if [ "$RUN_TESTS" = "true" ]; then travis_retry make check; fi + - if [ "$RUN_TESTS" = "true" ]; then make check; fi after_script: - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then (echo "Upload goes here. Something like: scp -r $BASE_OUTDIR server" || echo "upload failed"); fi From 41d67c78bf66c8c171947148e18b9ec01768ba65 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 30 Sep 2014 16:05:27 -0400 Subject: [PATCH 0789/1288] tests: fix python test-runner for windows Windows needed a few fixups to get the tests running: 1. bitcoin-tx needs a file extension in Windows. Take this opportunity to add an env file, which pulls variables out of our build config. This can be extended as needed, for now it's very simple. 2. After #1, split the args out of the exec key in the test data. 3. Correct the line-endings from windows stdout --- configure.ac | 2 +- src/test/bctest.py | 15 +++++++------- src/test/bitcoin-util-test.py | 3 ++- src/test/buildenv.py.in | 2 ++ src/test/data/bitcoin-util-test.json | 29 ++++++++++++++++++---------- 5 files changed, 32 insertions(+), 19 deletions(-) create mode 100644 src/test/buildenv.py.in diff --git a/configure.ac b/configure.ac index 0f9e78b74f..7025249aba 100644 --- a/configure.ac +++ b/configure.ac @@ -793,7 +793,7 @@ AC_SUBST(BUILD_TEST) AC_SUBST(BUILD_QT) AC_SUBST(BUILD_TEST_QT) AC_SUBST(MINIUPNPC_CPPFLAGS) -AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist]) +AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py]) AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh]) AC_CONFIG_FILES([qa/pull-tester/build-tests.sh],[chmod +x qa/pull-tester/build-tests.sh]) AC_OUTPUT diff --git a/src/test/bctest.py b/src/test/bctest.py index 1839f4fef4..ef461014ea 100644 --- a/src/test/bctest.py +++ b/src/test/bctest.py @@ -7,9 +7,11 @@ import os import json import sys -def bctest(testDir, testObj): - execargs = testObj['exec'] +def bctest(testDir, testObj, exeext): + execprog = testObj['exec'] + exeext + execargs = testObj['args'] + execrun = [execprog] + execargs stdinCfg = None inputData = None if "input" in testObj: @@ -22,12 +24,11 @@ def bctest(testDir, testObj): if "output_cmp" in testObj: outputFn = testObj['output_cmp'] outputData = open(testDir + "/" + outputFn).read() - - proc = subprocess.Popen(execargs, stdin=stdinCfg, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + proc = subprocess.Popen(execrun, stdin=stdinCfg, stdout=subprocess.PIPE, stderr=subprocess.PIPE,universal_newlines=True) try: outs = proc.communicate(input=inputData) except OSError: - print("OSError, Failed to execute " + execargs[0]) + print("OSError, Failed to execute " + execprog) sys.exit(1) if outputData and (outs[0] != outputData): @@ -41,13 +42,13 @@ def bctest(testDir, testObj): print("Return code mismatch for " + outputFn) sys.exit(1) -def bctester(testDir, input_basename): +def bctester(testDir, input_basename, buildenv): input_filename = testDir + "/" + input_basename raw_data = open(input_filename).read() input_data = json.loads(raw_data) for testObj in input_data: - bctest(testDir, testObj) + bctest(testDir, testObj, buildenv.exeext) sys.exit(0) diff --git a/src/test/bitcoin-util-test.py b/src/test/bitcoin-util-test.py index 40690c2fed..0eece14cfe 100755 --- a/src/test/bitcoin-util-test.py +++ b/src/test/bitcoin-util-test.py @@ -5,8 +5,9 @@ import os import bctest +import buildenv if __name__ == '__main__': bctest.bctester(os.environ["srcdir"] + "/test/data", - "bitcoin-util-test.json") + "bitcoin-util-test.json",buildenv) diff --git a/src/test/buildenv.py.in b/src/test/buildenv.py.in new file mode 100644 index 0000000000..1618bdeb76 --- /dev/null +++ b/src/test/buildenv.py.in @@ -0,0 +1,2 @@ +#!/usr/bin/python +exeext="@EXEEXT@" diff --git a/src/test/data/bitcoin-util-test.json b/src/test/data/bitcoin-util-test.json index cb74d73ef2..f8424b72a3 100644 --- a/src/test/data/bitcoin-util-test.json +++ b/src/test/data/bitcoin-util-test.json @@ -1,33 +1,41 @@ [ - { "exec": ["./bitcoin-tx", "-create"], + { "exec": "././bitcoin-tx", + "args": ["-create"], "output_cmp": "blanktx.hex" }, - { "exec": ["./bitcoin-tx", "-"], + { "exec": "./bitcoin-tx", + "args": ["-"], "input": "blanktx.hex", "output_cmp": "blanktx.hex" }, - { "exec": ["./bitcoin-tx", "-", "delin=1"], + { "exec": "./bitcoin-tx", + "args": ["-", "delin=1"], "input": "tx394b54bb.hex", "output_cmp": "tt-delin1-out.hex" }, - { "exec": ["./bitcoin-tx", "-", "delin=31"], + { "exec": "./bitcoin-tx", + "args": ["-", "delin=31"], "input": "tx394b54bb.hex", "return_code": 1 }, - { "exec": ["./bitcoin-tx", "-", "delout=1"], + { "exec": "./bitcoin-tx", + "args": ["-", "delout=1"], "input": "tx394b54bb.hex", "output_cmp": "tt-delout1-out.hex" }, - { "exec": ["./bitcoin-tx", "-", "delout=2"], + { "exec": "./bitcoin-tx", + "args": ["-", "delout=2"], "input": "tx394b54bb.hex", "return_code": 1 }, - { "exec": ["./bitcoin-tx", "-", "locktime=317000"], + { "exec": "./bitcoin-tx", + "args": ["-", "locktime=317000"], "input": "tx394b54bb.hex", "output_cmp": "tt-locktime317000-out.hex" }, - { "exec": - ["./bitcoin-tx", "-create", + { "exec": "./bitcoin-tx", + "args": + ["-create", "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0", "in=bf829c6bcf84579331337659d31f89dfd138f7f7785802d5501c92333145ca7c:18", "in=22a6f904655d53ae2ff70e701a0bbd90aa3975c0f40bfc6cc996a9049e31cdfc:1", @@ -35,7 +43,8 @@ "outaddr=4:1P8yWvZW8jVihP1bzHeqfE4aoXNX8AVa46"], "output_cmp": "txcreate1.hex" }, - { "exec": ["./bitcoin-tx", "-create", "outscript=0:"], + { "exec": "./bitcoin-tx", + "args": ["-create", "outscript=0:"], "output_cmp": "txcreate2.hex" } ] From 63c17613ab808208c8a760fc750e0429c8e53a39 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 30 Sep 2014 16:29:01 -0400 Subject: [PATCH 0790/1288] tests: fix false-positive under win64 BN_ULONG isn't necessarily an unsigned long, as is the case on win64. --- src/test/bignum.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/bignum.h b/src/test/bignum.h index a75f5250fa..86980b2af6 100644 --- a/src/test/bignum.h +++ b/src/test/bignum.h @@ -63,11 +63,11 @@ public: int getint() const { - unsigned long n = BN_get_word(this); + BN_ULONG n = BN_get_word(this); if (!BN_is_negative(this)) - return (n > (unsigned long)std::numeric_limits::max() ? std::numeric_limits::max() : n); + return (n > (BN_ULONG)std::numeric_limits::max() ? std::numeric_limits::max() : n); else - return (n > (unsigned long)std::numeric_limits::max() ? std::numeric_limits::min() : -(int)n); + return (n > (BN_ULONG)std::numeric_limits::max() ? std::numeric_limits::min() : -(int)n); } void setint64(int64_t sn) From 347a3a3eaad4096af668b67b2ae236258d63287c Mon Sep 17 00:00:00 2001 From: JL2035 Date: Wed, 1 Oct 2014 01:53:46 +0200 Subject: [PATCH 0791/1288] Update build-unix.md Debian also need libboost-all-dev installed. --- doc/build-unix.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/build-unix.md b/doc/build-unix.md index 8a76a8b2cd..0c3376df4b 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -63,7 +63,7 @@ Build requirements: sudo apt-get install build-essential libtool autotools-dev autoconf pkg-config libssl-dev -for Ubuntu 12.04 and later: +for Ubuntu 12.04 and later or Debian 7 and later libboost-all-dev has to be installed: sudo apt-get install libboost-all-dev From f606bb9bafafb12bcf9bc0834125c884da97f9e1 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sun, 28 Sep 2014 16:09:19 +0200 Subject: [PATCH 0792/1288] fix a possible memory leak in CWalletDB::Recover - convert pdbCopy into a boost::scoped_ptr to ensure memory gets freed in all cases (e.g. after "ret > 0") --- src/walletdb.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/walletdb.cpp b/src/walletdb.cpp index a84f44db01..e13830a8f4 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -15,11 +15,11 @@ #include #include +#include #include -using namespace std; using namespace boost; - +using namespace std; static uint64_t nAccountingEntryNumber = 0; @@ -926,7 +926,7 @@ bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys) LogPrintf("Salvage(aggressive) found %u records\n", salvagedData.size()); bool fSuccess = allOK; - Db* pdbCopy = new Db(&dbenv.dbenv, 0); + boost::scoped_ptr pdbCopy(new Db(&dbenv.dbenv, 0)); int ret = pdbCopy->open(NULL, // Txn pointer filename.c_str(), // Filename "main", // Logical db name @@ -967,7 +967,6 @@ bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys) } ptxn->commit(0); pdbCopy->close(0); - delete pdbCopy; return fSuccess; } From 870da77da632501e8eec58ed73e8f30549cc41e9 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sun, 28 Sep 2014 16:11:17 +0200 Subject: [PATCH 0793/1288] fix possible memory leaks in CWallet::EncryptWallet - add missing deletes for pwalletdbEncryption - add an assert before trying to reserve memory for pwalletdbEncryption - add a destructor to CWallet, which ensures deletion of pwalletdbEncryption on object destruction --- src/wallet.cpp | 24 ++++++++++++++++++------ src/wallet.h | 8 ++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index e69f59aacd..897f53b8b7 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -426,17 +426,25 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase) mapMasterKeys[++nMasterKeyMaxID] = kMasterKey; if (fFileBacked) { + assert(!pwalletdbEncryption); pwalletdbEncryption = new CWalletDB(strWalletFile); - if (!pwalletdbEncryption->TxnBegin()) + if (!pwalletdbEncryption->TxnBegin()) { + delete pwalletdbEncryption; + pwalletdbEncryption = NULL; return false; + } pwalletdbEncryption->WriteMasterKey(nMasterKeyMaxID, kMasterKey); } if (!EncryptKeys(vMasterKey)) { - if (fFileBacked) + if (fFileBacked) { pwalletdbEncryption->TxnAbort(); - exit(1); //We now probably have half of our keys encrypted in memory, and half not...die and let the user reload their unencrypted wallet. + delete pwalletdbEncryption; + } + // We now probably have half of our keys encrypted in memory, and half not... + // die and let the user reload their unencrypted wallet. + exit(1); } // Encryption was introduced in version 0.4.0 @@ -444,8 +452,12 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase) if (fFileBacked) { - if (!pwalletdbEncryption->TxnCommit()) - exit(1); //We now have keys encrypted in memory, but no on disk...die to avoid confusion and let the user reload their unencrypted wallet. + if (!pwalletdbEncryption->TxnCommit()) { + delete pwalletdbEncryption; + // We now have keys encrypted in memory, but no on disk... + // die to avoid confusion and let the user reload their unencrypted wallet. + exit(1); + } delete pwalletdbEncryption; pwalletdbEncryption = NULL; @@ -1068,7 +1080,7 @@ int64_t CWallet::GetWatchOnlyBalance() const nTotal += pcoin->GetAvailableWatchOnlyCredit(); } } - + return nTotal; } diff --git a/src/wallet.h b/src/wallet.h index fde87a8a2f..344f9c0e04 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -143,6 +143,7 @@ public: { SetNull(); } + CWallet(std::string strWalletFileIn) { SetNull(); @@ -150,6 +151,13 @@ public: strWalletFile = strWalletFileIn; fFileBacked = true; } + + ~CWallet() + { + delete pwalletdbEncryption; + pwalletdbEncryption = NULL; + } + void SetNull() { nWalletVersion = FEATURE_BASE; From d0c4197ef6ecfdaff792579810107e2f1b8b319e Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 1 Oct 2014 08:50:24 +0200 Subject: [PATCH 0794/1288] change exit(1) to an assert in CWallet::EncryptWallet --- src/wallet.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index 897f53b8b7..be063ccb42 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -15,6 +15,8 @@ #include "util.h" #include "utilmoneystr.h" +#include + #include #include @@ -444,7 +446,7 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase) } // We now probably have half of our keys encrypted in memory, and half not... // die and let the user reload their unencrypted wallet. - exit(1); + assert(false); } // Encryption was introduced in version 0.4.0 @@ -456,7 +458,7 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase) delete pwalletdbEncryption; // We now have keys encrypted in memory, but no on disk... // die to avoid confusion and let the user reload their unencrypted wallet. - exit(1); + assert(false); } delete pwalletdbEncryption; From b5ec5fe0cb0a85cb626167b66fdda3bed8c5ba19 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 25 Sep 2014 11:56:05 +0200 Subject: [PATCH 0795/1288] update getnetworkinfo help with subversion - add missing subversion field to getnetworkinfo help - fix style and format errors in help string - remove unneeded int casts --- src/rpcnet.cpp | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index fb159d96f6..bc19d1372a 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -368,23 +368,29 @@ Value getnetworkinfo(const Array& params, bool fHelp) "Returns an object containing various state info regarding P2P networking.\n" "\nResult:\n" "{\n" - " \"version\": xxxxx, (numeric) the server version\n" - " \"protocolversion\": xxxxx, (numeric) the protocol version\n" - " \"localservices\": \"xxxxxxxxxxxxxxxx\", (string) the services we offer to the network\n" - " \"timeoffset\": xxxxx, (numeric) the time offset\n" - " \"connections\": xxxxx, (numeric) the number of connections\n" - " \"networks\": [ (array) information per network\n" - " \"name\": \"xxx\", (string) network (ipv4, ipv6 or onion)\n" - " \"limited\": xxx, (boolean) is the network limited using -onlynet?\n" - " \"reachable\": xxx, (boolean) is the network reachable?\n" - " \"proxy\": \"host:port\" (string) the proxy that is used for this network, or empty if none\n" - " },\n" + " \"version\": xxxxx, (numeric) the server version\n" + " \"subversion\": \"/Satoshi:x.x.x/\", (string) the server subversion string\n" + " \"protocolversion\": xxxxx, (numeric) the protocol version\n" + " \"localservices\": \"xxxxxxxxxxxxxxxx\", (string) the services we offer to the network\n" + " \"timeoffset\": xxxxx, (numeric) the time offset\n" + " \"connections\": xxxxx, (numeric) the number of connections\n" + " \"networks\": [ (array) information per network\n" + " {\n" + " \"name\": \"xxx\", (string) network (ipv4, ipv6 or onion)\n" + " \"limited\": true|false, (boolean) is the network limited using -onlynet?\n" + " \"reachable\": true|false, (boolean) is the network reachable?\n" + " \"proxy\": \"host:port\" (string) the proxy that is used for this network, or empty if none\n" + " }\n" + " ,...\n" " ],\n" - " \"relayfee\": x.xxxx, (numeric) minimum relay fee for non-free transactions in btc/kb\n" - " \"localaddresses\": [, (array) list of local addresses\n" - " \"address\": \"xxxx\", (string) network address\n" - " \"port\": xxx, (numeric) network port\n" - " \"score\": xxx (numeric) relative score\n" + " \"relayfee\": x.xxxxxxxx, (numeric) minimum relay fee for non-free transactions in btc/kb\n" + " \"localaddresses\": [ (array) list of local addresses\n" + " {\n" + " \"address\": \"xxxx\", (string) network address\n" + " \"port\": xxx, (numeric) network port\n" + " \"score\": xxx (numeric) relative score\n" + " }\n" + " ,...\n" " ]\n" "}\n" "\nExamples:\n" @@ -393,10 +399,10 @@ Value getnetworkinfo(const Array& params, bool fHelp) ); Object obj; - obj.push_back(Pair("version", (int)CLIENT_VERSION)); + obj.push_back(Pair("version", CLIENT_VERSION)); obj.push_back(Pair("subversion", FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, std::vector()))); - obj.push_back(Pair("protocolversion",(int)PROTOCOL_VERSION)); + obj.push_back(Pair("protocolversion",PROTOCOL_VERSION)); obj.push_back(Pair("localservices", strprintf("%016x", nLocalServices))); obj.push_back(Pair("timeoffset", GetTimeOffset())); obj.push_back(Pair("connections", (int)vNodes.size())); From c375b5c102971abfefaaf07776b5b65f1cca54f1 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 1 Oct 2014 11:00:29 +0200 Subject: [PATCH 0796/1288] remove dead/unused code in walletdb.cpp - closes #5021 --- src/walletdb.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/walletdb.cpp b/src/walletdb.cpp index a84f44db01..b21cb4eabd 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -391,13 +391,6 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, wss.fAnyUnordered = true; pwallet->AddToWallet(wtx, true); - //// debug print - //LogPrintf("LoadWallet %s\n", wtx.GetHash().ToString()); - //LogPrintf(" %12d %s %s %s\n", - // wtx.vout[0].nValue, - // DateTimeStrFormat("%Y-%m-%d %H:%M:%S", wtx.GetBlockTime()), - // wtx.hashBlock.ToString(), - // wtx.mapValue["message"]); } else if (strType == "acentry") { @@ -708,7 +701,6 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet) DBErrors CWalletDB::FindWalletTx(CWallet* pwallet, vector& vTxHash, vector& vWtx) { pwallet->vchDefaultKey = CPubKey(); - CWalletScanState wss; bool fNoncriticalErrors = false; DBErrors result = DB_LOAD_OK; From c122f5528c882efc8aebe31fd4d84612175f66aa Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 1 Oct 2014 10:09:08 +0200 Subject: [PATCH 0797/1288] qt: Register CAmount metatype This allows sending the type over queued connections. Also normalize signal/slot names. --- src/qt/bitcoin.cpp | 4 ++++ src/qt/overviewpage.cpp | 2 +- src/qt/sendcoinsdialog.cpp | 4 ++-- src/qt/walletview.cpp | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index bd686041c1..5e2fdc6c30 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -73,6 +73,7 @@ Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin); // Declare meta types used for QMetaObject::invokeMethod Q_DECLARE_METATYPE(bool*) +Q_DECLARE_METATYPE(CAmount) static void InitMessage(const std::string &message) { @@ -509,6 +510,9 @@ int main(int argc, char *argv[]) // Register meta types used for QMetaObject::invokeMethod qRegisterMetaType< bool* >(); + // Need to pass name here as CAmount is a typedef (see http://qt-project.org/doc/qt-5/qmetatype.html#qRegisterMetaType) + // IMPORTANT if it is no longer a typedef use the normal variant above + qRegisterMetaType< CAmount >("CAmount"); /// 3. Application identification // must be set before OptionsModel is initialized or translations are loaded, diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 1d6c23f8a0..669d5474fd 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -220,7 +220,7 @@ void OverviewPage::setWalletModel(WalletModel *model) // Keep up to date with wallet setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance(), model->getWatchBalance(), model->getWatchUnconfirmedBalance(), model->getWatchImmatureBalance()); - connect(model, SIGNAL(balanceChanged(const CAmount&, const CAmount&, const CAmount&, const CAmount&, const CAmount&, const CAmount&)), this, SLOT(setBalance(const CAmount&, const CAmount&, const CAmount&, const CAmount&, const CAmount&, const CAmount&))); + connect(model, SIGNAL(balanceChanged(CAmount,CAmount,CAmount,CAmount,CAmount,CAmount)), this, SLOT(setBalance(CAmount,CAmount,CAmount,CAmount,CAmount,CAmount))); connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index d67cac57b4..ce94131cce 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -92,13 +92,13 @@ void SendCoinsDialog::setModel(WalletModel *model) setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance(), model->getWatchBalance(), model->getWatchUnconfirmedBalance(), model->getWatchImmatureBalance()); - connect(model, SIGNAL(balanceChanged(const CAmount&, const CAmount&, const CAmount&, const CAmount&, const CAmount&, const CAmount&)), this, SLOT(setBalance(const CAmount&, const CAmount&, const CAmount&, const CAmount&, const CAmount&, const CAmount&))); + connect(model, SIGNAL(balanceChanged(CAmount,CAmount,CAmount,CAmount,CAmount,CAmount)), this, SLOT(setBalance(CAmount,CAmount,CAmount,CAmount,CAmount,CAmount))); connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); // Coin Control connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(coinControlUpdateLabels())); connect(model->getOptionsModel(), SIGNAL(coinControlFeaturesChanged(bool)), this, SLOT(coinControlFeatureChanged(bool))); - connect(model->getOptionsModel(), SIGNAL(transactionFeeChanged(qint64)), this, SLOT(coinControlUpdateLabels())); + connect(model->getOptionsModel(), SIGNAL(transactionFeeChanged(CAmount)), this, SLOT(coinControlUpdateLabels())); ui->frameCoinControl->setVisible(model->getOptionsModel()->getCoinControlFeatures()); coinControlUpdateLabels(); } diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index 322d0a6ee6..eff50593bd 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -92,7 +92,7 @@ void WalletView::setBitcoinGUI(BitcoinGUI *gui) connect(this, SIGNAL(encryptionStatusChanged(int)), gui, SLOT(setEncryptionStatus(int))); // Pass through transaction notifications - connect(this, SIGNAL(incomingTransaction(QString,int,const CAmount&,QString,QString)), gui, SLOT(incomingTransaction(QString,int,const CAmount&,QString,QString))); + connect(this, SIGNAL(incomingTransaction(QString,int,CAmount,QString,QString)), gui, SLOT(incomingTransaction(QString,int,CAmount,QString,QString))); } } From f60dc15c50e8fad52f8ee3e313041e2d224be667 Mon Sep 17 00:00:00 2001 From: Whit J Date: Tue, 30 Sep 2014 10:48:40 -0700 Subject: [PATCH 0798/1288] doc: add make install to build-osx.md and build-unix.md --- doc/build-osx.md | 4 ++++ doc/build-unix.md | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/build-osx.md b/doc/build-osx.md index 0364d3a01b..dc55f8259e 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -81,6 +81,10 @@ After exiting, you'll get a warning that the install is keg-only, which means it make check +4. (Optional) You can also install bitcoind to your path: + + make install + Creating a release build ------------------------ You can ignore this section if you are building `bitcoind` for your own use. diff --git a/doc/build-unix.md b/doc/build-unix.md index 0c3376df4b..fb5eaec431 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -15,9 +15,12 @@ the usage of the absolute path. To Build --------------------- - ./autogen.sh - ./configure - make +```bash +./autogen.sh +./configure +make +make install # optional +``` This will build bitcoin-qt as well if the dependencies are met. From e9f3fa7c0b2c605f2ecd9733ca11979bad75d3e8 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 30 Sep 2014 21:52:19 -0400 Subject: [PATCH 0799/1288] travis: enable windows tests --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f7d94df646..eae07ead8e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,9 +35,9 @@ matrix: - compiler: "true 5" env: HOST=x86_64-apple-darwin11 PACKAGES="gcc-multilib g++-multilib cmake libcap-dev libz-dev libbz2-dev" OSX_SDK=10.7 GOAL="deploy" - compiler: "true 6" - env: HOST=x86_64-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev" GOAL="deploy" + env: HOST=x86_64-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev wine" RUN_TESTS=true GOAL="deploy" - compiler: "true 7" - env: HOST=i686-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-dev" GOAL="deploy" + env: HOST=i686-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-dev wine" RUN_TESTS=true GOAL="deploy" install: - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-upgrade -qq $PACKAGES; fi From 965c306d6d6ee3695dc50615a87e25c248c41a89 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Mon, 29 Sep 2014 12:09:46 -0400 Subject: [PATCH 0800/1288] Keep symlinks when copying into .app bundle Code signing failed for me on OSX 10.9.5 because the Versions/Current symbolic links were being replaced with a duplicate copy of the frameworks' code. Releases were bigger than they needed to be, for the same reason. --- contrib/macdeploy/macdeployqtplus | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index 1b50981f0a..8f826ace09 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -292,7 +292,7 @@ def copyFramework(framework, path, verbose): fromResourcesDir = framework.sourceResourcesDirectory if os.path.exists(fromResourcesDir): toResourcesDir = os.path.join(path, framework.destinationResourcesDirectory) - shutil.copytree(fromResourcesDir, toResourcesDir) + shutil.copytree(fromResourcesDir, toResourcesDir, symlinks=True) if verbose >= 3: print "Copied resources:", fromResourcesDir print " to:", toResourcesDir @@ -301,7 +301,7 @@ def copyFramework(framework, path, verbose): fromContentsDir = framework.sourceContentsDirectory if os.path.exists(fromContentsDir): toContentsDir = os.path.join(path, framework.destinationVersionContentsDirectory) - shutil.copytree(fromContentsDir, toContentsDir) + shutil.copytree(fromContentsDir, toContentsDir, symlinks=True) contentslinkfrom = os.path.join(path, framework.destinationContentsDirectory) if verbose >= 3: print "Copied Contents:", fromContentsDir @@ -310,7 +310,7 @@ def copyFramework(framework, path, verbose): qtMenuNibSourcePath = os.path.join(framework.frameworkDirectory, "Resources", "qt_menu.nib") qtMenuNibDestinationPath = os.path.join(path, "Contents", "Resources", "qt_menu.nib") if os.path.exists(qtMenuNibSourcePath) and not os.path.exists(qtMenuNibDestinationPath): - shutil.copytree(qtMenuNibSourcePath, qtMenuNibDestinationPath) + shutil.copytree(qtMenuNibSourcePath, qtMenuNibDestinationPath, symlinks=True) if verbose >= 3: print "Copied for libQtGui:", qtMenuNibSourcePath print " to:", qtMenuNibDestinationPath @@ -584,7 +584,7 @@ if verbose >= 3: print app_bundle, "->", target os.mkdir("dist") -shutil.copytree(app_bundle, target) +shutil.copytree(app_bundle, target, symlinks=True) applicationBundle = ApplicationBundleInfo(target) @@ -671,7 +671,7 @@ for p in config.add_resources: if verbose >= 3: print p, "->", t if os.path.isdir(p): - shutil.copytree(p, t) + shutil.copytree(p, t, symlinks=True) else: shutil.copy2(p, t) From 217a5c92380173ac43d303b1ba9548544121eefd Mon Sep 17 00:00:00 2001 From: Mark Friedenbach Date: Mon, 5 Aug 2013 18:27:09 -0700 Subject: [PATCH 0801/1288] When transaction outputs exceed inputs, show the offending amounts so as to aid debugging. --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 9a4271eda2..c1fabdd55e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,6 +17,7 @@ #include "txmempool.h" #include "ui_interface.h" #include "util.h" +#include "utilmoneystr.h" #include @@ -1361,7 +1362,8 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi } if (nValueIn < tx.GetValueOut()) - return state.DoS(100, error("CheckInputs() : %s value in < value out", tx.GetHash().ToString()), + return state.DoS(100, error("CheckInputs() : %s value in (%s) < value out (%s)", + tx.GetHash().ToString(), FormatMoney(nValueIn), FormatMoney(tx.GetValueOut())), REJECT_INVALID, "bad-txns-in-belowout"); // Tally transaction fees From f74fc9b22d7f39e36d0cbf80f5c06958c516c8ec Mon Sep 17 00:00:00 2001 From: Mark Friedenbach Date: Fri, 21 Mar 2014 12:27:44 -0700 Subject: [PATCH 0802/1288] Print input index when signature validation fails, to aid debugging. --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index c1fabdd55e..7bb61f251c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1317,7 +1317,7 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach bool CScriptCheck::operator()() const { const CScript &scriptSig = ptxTo->vin[nIn].scriptSig; if (!VerifyScript(scriptSig, scriptPubKey, *ptxTo, nIn, nFlags)) - return error("CScriptCheck() : %s VerifySignature failed", ptxTo->GetHash().ToString()); + return error("CScriptCheck() : %s:%d VerifySignature failed", ptxTo->GetHash().ToString(), nIn); return true; } From 5ad450a65ad2b0e7760d77816800bd51826ed175 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 1 Oct 2014 16:47:33 -0400 Subject: [PATCH 0803/1288] travis: If the comparison-tool fails, dump the tail of the debug log The entire debug log would be huge, and could cause issues for automated tools like travis. Printing 200 lines is an initial guess at a reasonable number, more may be required. --- qa/pull-tester/run-bitcoind-for-test.sh.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qa/pull-tester/run-bitcoind-for-test.sh.in b/qa/pull-tester/run-bitcoind-for-test.sh.in index 67318e5a4c..210fc3c42f 100755 --- a/qa/pull-tester/run-bitcoind-for-test.sh.in +++ b/qa/pull-tester/run-bitcoind-for-test.sh.in @@ -29,4 +29,8 @@ fi kill $BITCOIND && wait $BITCOIND # timeout returns 124 on timeout, otherwise the return value of the child + +# If $RETURN is not 0, the test failed. Dump the tail of the debug log. +if [ $RETURN -ne 0 ]; then tail -n 200 $DATADIR/regtest/debug.log; fi + exit $RETURN From 9fedafba4b903d7f3af044eb86dc313856e40b08 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 29 Sep 2014 15:26:31 -0400 Subject: [PATCH 0804/1288] build: Fix OSX build when using Homebrew and qt5 Qt5 is bottled, so configure won't find it without some help. Use brew to find out its prefix. Also, qt5 added the host_bins variable to pkg-config, use it. --- build-aux/m4/bitcoin_qt.m4 | 7 +++++++ configure.ac | 25 +++++++++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/build-aux/m4/bitcoin_qt.m4 b/build-aux/m4/bitcoin_qt.m4 index edfde4cd79..71b1484894 100644 --- a/build-aux/m4/bitcoin_qt.m4 +++ b/build-aux/m4/bitcoin_qt.m4 @@ -152,6 +152,13 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ fi CPPFLAGS=$TEMP_CPPFLAGS ]) + + if test x$use_pkgconfig$qt_bin_path = xyes; then + if test x$bitcoin_qt_got_major_vers = x5; then + qt_bin_path="`$PKG_CONFIG --variable=host_bins Qt5Core 2>/dev/null`" + fi + fi + BITCOIN_QT_PATH_PROGS([MOC], [moc-qt${bitcoin_qt_got_major_vers} moc${bitcoin_qt_got_major_vers} moc], $qt_bin_path) BITCOIN_QT_PATH_PROGS([UIC], [uic-qt${bitcoin_qt_got_major_vers} uic${bitcoin_qt_got_major_vers} uic], $qt_bin_path) BITCOIN_QT_PATH_PROGS([RCC], [rcc-qt${bitcoin_qt_got_major_vers} rcc${bitcoin_qt_got_major_vers} rcc], $qt_bin_path) diff --git a/configure.ac b/configure.ac index 7025249aba..abf9f39e65 100644 --- a/configure.ac +++ b/configure.ac @@ -240,12 +240,25 @@ case $host in AC_CHECK_PROG([BREW],brew, brew) if test x$BREW = xbrew; then - dnl add default homebrew paths - openssl_prefix=`$BREW --prefix openssl` - bdb_prefix=`$BREW --prefix berkeley-db4` - export PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" - CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include" - LIBS="$LIBS -L$bdb_prefix/lib" + dnl These Homebrew packages may be bottled, meaning that they won't be found + dnl in expected paths because they may conflict with system files. Ask + dnl Homebrew where each one is located, then adjust paths accordingly. + dnl It's safe to add these paths even if the functionality is disabled by + dnl the user (--without-wallet or --without-gui for example). + + openssl_prefix=`$BREW --prefix openssl 2>/dev/null` + bdb_prefix=`$BREW --prefix berkeley-db4 2>/dev/null` + qt5_prefix=`$BREW --prefix qt5 2>/dev/null` + if test x$openssl_prefix != x; then + export PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" + fi + if test x$bdb_prefix != x; then + CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include" + LIBS="$LIBS -L$bdb_prefix/lib" + fi + if test x$qt5_prefix != x; then + export PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" + fi fi else case $build_os in From dd367ff8c93c2f9e112a324f5cd737c7fa7a2ffa Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 1 Oct 2014 19:22:20 -0400 Subject: [PATCH 0805/1288] build: macdeploy: filter out irrelevant qt5 frameworks and dylibs --- contrib/macdeploy/macdeployqtplus | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index 8f826ace09..541136001f 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -393,7 +393,7 @@ def deployPlugins(appBundleInfo, deploymentInfo, strip, verbose): # Deploy the script plugins only if QtScript is in use if not deploymentInfo.usesFramework("QtScript"): continue - elif pluginDirectory == "qmltooling": + elif pluginDirectory == "qmltooling" or pluginDirectory == "qml1tooling": # Deploy the qml plugins only if QtDeclarative is in use if not deploymentInfo.usesFramework("QtDeclarative"): continue @@ -401,7 +401,23 @@ def deployPlugins(appBundleInfo, deploymentInfo, strip, verbose): # Deploy the bearer plugins only if QtNetwork is in use if not deploymentInfo.usesFramework("QtNetwork"): continue - + elif pluginDirectory == "position": + # Deploy the position plugins only if QtPositioning is in use + if not deploymentInfo.usesFramework("QtPositioning"): + continue + elif pluginDirectory == "sensors" or pluginDirectory == "sensorgestures": + # Deploy the sensor plugins only if QtSensors is in use + if not deploymentInfo.usesFramework("QtSensors"): + continue + elif pluginDirectory == "audio" or pluginDirectory == "playlistformats": + # Deploy the audio plugins only if QtMultimedia is in use + if not deploymentInfo.usesFramework("QtMultimedia"): + continue + elif pluginDirectory == "mediaservice": + # Deploy the mediaservice plugins only if QtMultimediaWidgets is in use + if not deploymentInfo.usesFramework("QtMultimediaWidgets"): + continue + for pluginName in filenames: pluginPath = os.path.join(pluginDirectory, pluginName) if pluginName.endswith("_debug.dylib"): @@ -419,7 +435,11 @@ def deployPlugins(appBundleInfo, deploymentInfo, strip, verbose): # Deploy the opengl graphicssystem plugin only if QtOpenGL is in use if not deploymentInfo.usesFramework("QtOpenGL"): continue - + elif pluginPath == "accessible/libqtaccessiblequick.dylib": + # Deploy the accessible qtquick plugin only if QtQuick is in use + if not deploymentInfo.usesFramework("QtQuick"): + continue + plugins.append((pluginDirectory, pluginName)) for pluginDirectory, pluginName in plugins: From 0f78a0a2eb2e19e0d41b8f913f15358886cd6238 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 2 Oct 2014 03:19:32 +0200 Subject: [PATCH 0806/1288] Upgrade comparison tool further --- depends/packages/native_comparisontool.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/depends/packages/native_comparisontool.mk b/depends/packages/native_comparisontool.mk index d9f7722190..4c40f8b123 100644 --- a/depends/packages/native_comparisontool.mk +++ b/depends/packages/native_comparisontool.mk @@ -1,8 +1,8 @@ package=native_comparisontool -$(package)_version=adfd3de7 -$(package)_download_path=https://github.com/TheBlueMatt/test-scripts/raw/10222bfdace65a0c5f3bd4a766eeb6b3a8b869fb/ +$(package)_version=5caed78 +$(package)_download_path=https://github.com/TheBlueMatt/test-scripts/raw/2d76ce92d68e6746988adde731318605a70e252c $(package)_file_name=pull-tests-$($(package)_version).jar -$(package)_sha256_hash=fd2282b112e35f339dbe3729b08a04834ad719f8c9c10eeec1178465e6d36a18 +$(package)_sha256_hash=b55a98828b17060e327c5dabe5e4631898f422c0cba07c46170930a9eaf5e7c0 $(package)_install_dirname=BitcoindComparisonTool_jar $(package)_install_filename=BitcoindComparisonTool.jar From 8d132431b4f6a7676482815231cd923d9047d541 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 2 Oct 2014 10:27:36 +0200 Subject: [PATCH 0807/1288] Revert merge of pull #4845 It breaks the new mingw tests! See - https://travis-ci.org/bitcoin/bitcoin/jobs/36845581 - https://travis-ci.org/bitcoin/bitcoin/jobs/36845582 This reverts commit 470590277782cce2fe73275c74523aef59a51eab, 5e2e7fcb99738d9254d4030d53e4f711b2fc5ee0, a25fd6be138ff2bff7e2ad6a1a789db523c0193f. --- src/Makefile.test.include | 1 - src/chainparams.cpp | 41 ------ src/chainparams.h | 24 ---- src/chainparamsbase.cpp | 17 --- src/chainparamsbase.h | 1 - src/checkpoints.cpp | 2 - src/main.cpp | 3 +- src/pow.cpp | 4 - src/test/base58_tests.cpp | 4 +- src/test/blockv2_tests.cpp | 275 ------------------------------------- src/test/miner_tests.cpp | 1 - src/test/test_bitcoin.cpp | 2 +- 12 files changed, 4 insertions(+), 371 deletions(-) delete mode 100644 src/test/blockv2_tests.cpp diff --git a/src/Makefile.test.include b/src/Makefile.test.include index d376961996..ab449f3e71 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -51,7 +51,6 @@ BITCOIN_TESTS =\ test/key_tests.cpp \ test/main_tests.cpp \ test/miner_tests.cpp \ - test/blockv2_tests.cpp \ test/mruset_tests.cpp \ test/multisig_tests.cpp \ test/netbase_tests.cpp \ diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 31c67715c8..179db5a818 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -115,7 +115,6 @@ public: fAllowMinDifficultyBlocks = false; fRequireStandard = true; fMineBlocksOnDemand = false; - fSkipProofOfWorkCheck = false; } }; static CMainParams mainParams; @@ -215,46 +214,8 @@ public: }; static CRegTestParams regTestParams; -// -// Unit test -// -class CUnitTestParams : public CMainParams, public CModifiableParams { -public: - CUnitTestParams() { - networkID = CBaseChainParams::UNITTEST; - strNetworkID = "unittest"; - nDefaultPort = 18445; - vFixedSeeds.clear(); - vSeeds.clear(); // Regtest mode doesn't have any DNS seeds. - - fRequireRPCPassword = false; - fMiningRequiresPeers = false; - fDefaultCheckMemPool = true; - fAllowMinDifficultyBlocks = false; - fMineBlocksOnDemand = true; - } -public: - // Published setters to allow changing values in unit test cases - virtual void setSubsidyHalvingInterval(int anSubsidyHalvingInterval) { nSubsidyHalvingInterval=anSubsidyHalvingInterval; } - virtual void setEnforceBlockUpgradeMajority(int anEnforceBlockUpgradeMajority) { nEnforceBlockUpgradeMajority=anEnforceBlockUpgradeMajority; } - virtual void setRejectBlockOutdatedMajority(int anRejectBlockOutdatedMajority) { nRejectBlockOutdatedMajority=anRejectBlockOutdatedMajority; } - virtual void setToCheckBlockUpgradeMajority(int anToCheckBlockUpgradeMajority) { nToCheckBlockUpgradeMajority=anToCheckBlockUpgradeMajority; } - virtual void setDefaultCheckMemPool(bool afDefaultCheckMemPool) { fDefaultCheckMemPool=afDefaultCheckMemPool; } - virtual void setAllowMinDifficultyBlocks(bool afAllowMinDifficultyBlocks) { fAllowMinDifficultyBlocks=afAllowMinDifficultyBlocks; } - virtual void setSkipProofOfWorkCheck(bool afSkipProofOfWorkCheck) { fSkipProofOfWorkCheck = afSkipProofOfWorkCheck; } -}; -static CUnitTestParams unitTestParams; - - static CChainParams *pCurrentParams = 0; -CModifiableParams *ModifiableParams() -{ - assert(pCurrentParams); - assert(pCurrentParams==&unitTestParams); - return (CModifiableParams*)&unitTestParams; -} - const CChainParams &Params() { assert(pCurrentParams); return *pCurrentParams; @@ -268,8 +229,6 @@ CChainParams &Params(CBaseChainParams::Network network) { return testNetParams; case CBaseChainParams::REGTEST: return regTestParams; - case CBaseChainParams::UNITTEST: - return unitTestParams; default: assert(false && "Unimplemented network"); return mainParams; diff --git a/src/chainparams.h b/src/chainparams.h index 50441a89f3..e5dfc87c6d 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -61,8 +61,6 @@ public: bool DefaultCheckMemPool() const { return fDefaultCheckMemPool; } /* Allow mining of a min-difficulty block */ bool AllowMinDifficultyBlocks() const { return fAllowMinDifficultyBlocks; } - /* Skip proof-of-work check: allow mining of any difficulty block */ - bool SkipProofOfWorkCheck() const { return fSkipProofOfWorkCheck; } /* Make standard checks */ bool RequireStandard() const { return fRequireStandard; } int64_t TargetTimespan() const { return nTargetTimespan; } @@ -105,27 +103,8 @@ protected: bool fAllowMinDifficultyBlocks; bool fRequireStandard; bool fMineBlocksOnDemand; - bool fSkipProofOfWorkCheck; }; -/** Modifiable parameters interface is used by test cases to adapt the parameters in order -*** to test specific features more easily. Test cases should always restore the previous -*** values after finalization. -**/ - -class CModifiableParams { -public: - // Published setters to allow changing values in unit test cases - virtual void setSubsidyHalvingInterval(int anSubsidyHalvingInterval) =0; - virtual void setEnforceBlockUpgradeMajority(int anEnforceBlockUpgradeMajority)=0; - virtual void setRejectBlockOutdatedMajority(int anRejectBlockOutdatedMajority)=0; - virtual void setToCheckBlockUpgradeMajority(int anToCheckBlockUpgradeMajority)=0; - virtual void setDefaultCheckMemPool(bool aDefaultCheckMemPool)=0; - virtual void setAllowMinDifficultyBlocks(bool aAllowMinDifficultyBlocks)=0; - virtual void setSkipProofOfWorkCheck(bool aSkipProofOfWorkCheck)=0; -}; - - /** * Return the currently selected parameters. This won't change after app startup * outside of the unit tests. @@ -135,9 +114,6 @@ const CChainParams &Params(); /** Return parameters for the given network. */ CChainParams &Params(CBaseChainParams::Network network); -/** Get modifyable network parameters (UNITTEST only) */ -CModifiableParams *ModifiableParams(); - /** Sets the params returned by Params() to those for the given network. */ void SelectParams(CBaseChainParams::Network network); diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index e9d63197bd..98bb5b855f 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -57,20 +57,6 @@ public: }; static CBaseRegTestParams regTestParams; -// -// Unit test -// -class CBaseUnitTestParams : public CBaseMainParams -{ -public: - CBaseUnitTestParams() - { - networkID = CBaseChainParams::UNITTEST; - strDataDir = "unittest"; - } -}; -static CBaseUnitTestParams unitTestParams; - static CBaseChainParams* pCurrentBaseParams = 0; const CBaseChainParams& BaseParams() @@ -91,9 +77,6 @@ void SelectBaseParams(CBaseChainParams::Network network) case CBaseChainParams::REGTEST: pCurrentBaseParams = ®TestParams; break; - case CBaseChainParams::UNITTEST: - pCurrentBaseParams = &unitTestParams; - break; default: assert(false && "Unimplemented network"); return; diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h index cc154cf501..c054f03f17 100644 --- a/src/chainparamsbase.h +++ b/src/chainparamsbase.h @@ -19,7 +19,6 @@ public: MAIN, TESTNET, REGTEST, - UNITTEST, MAX_NETWORK_TYPES }; diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index 9a6bc05e63..c41deea7ce 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -88,8 +88,6 @@ namespace Checkpoints { return dataTestnet; else if (Params().NetworkID() == CBaseChainParams::MAIN) return data; - else if (Params().NetworkID() == CBaseChainParams::UNITTEST) // UnitTest share the same checkpoints as MAIN - return data; else return dataRegtest; } diff --git a/src/main.cpp b/src/main.cpp index 55485c86ff..a3e36ff872 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2305,8 +2305,7 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex nHeight = pindexPrev->nHeight+1; // Check proof of work - if ((!Params().SkipProofOfWorkCheck()) && - (block.nBits != GetNextWorkRequired(pindexPrev, &block))) + if (block.nBits != GetNextWorkRequired(pindexPrev, &block)) return state.DoS(100, error("AcceptBlock() : incorrect proof of work"), REJECT_INVALID, "bad-diffbits"); diff --git a/src/pow.cpp b/src/pow.cpp index d50222849c..893f6c18be 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -81,10 +81,6 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits) bool fNegative; bool fOverflow; uint256 bnTarget; - - if (Params().SkipProofOfWorkCheck()) - return true; - bnTarget.SetCompact(nBits, &fNegative, &fOverflow); // Check range diff --git a/src/test/base58_tests.cpp b/src/test/base58_tests.cpp index c298c805da..58fffb6df4 100644 --- a/src/test/base58_tests.cpp +++ b/src/test/base58_tests.cpp @@ -175,7 +175,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_parse) BOOST_CHECK_MESSAGE(!secret.IsValid(), "IsValid pubkey as privkey:" + strTest); } } - SelectParams(CBaseChainParams::UNITTEST); + SelectParams(CBaseChainParams::MAIN); } // Goal: check that generated keys match test vectors @@ -243,7 +243,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_gen) CTxDestination nodest = CNoDestination(); BOOST_CHECK(!dummyAddr.Set(nodest)); - SelectParams(CBaseChainParams::UNITTEST); + SelectParams(CBaseChainParams::MAIN); } // Goal: check that base58 parsing code is robust against a variety of corrupted data diff --git a/src/test/blockv2_tests.cpp b/src/test/blockv2_tests.cpp deleted file mode 100644 index 96c0df5e6b..0000000000 --- a/src/test/blockv2_tests.cpp +++ /dev/null @@ -1,275 +0,0 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers -// Distributed under the MIT/X11 software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "main.h" -#include "miner.h" -#include "uint256.h" -#include "util.h" - -#include - -// This test cheecks the majority rule which states that after 1000 v2 blocks no new v1 block can be part of that branch. - -BOOST_AUTO_TEST_SUITE(blockv2_tests) - -static CScript scriptPubKey = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG; - -static void SetEmptyBlock(CBlock * pblock) -{ - pblock->nVersion = 2; - pblock->nTime = chainActive.Tip()->GetMedianTimePast()+1; - pblock->nNonce = 0; -} - -static void SetBlockDefaultAttributesAndHeight(CBlock * pblock,bool addHeight,int heightDifference) -{ - SetEmptyBlock(pblock); - - // Add the coinbase - CMutableTransaction txCoinbase(pblock->vtx[0]); - - if (addHeight) - txCoinbase.vin[0].scriptSig = (CScript() << (chainActive.Height()+1+heightDifference) << 0); - else - txCoinbase.vin[0].scriptSig = (CScript() << heightDifference << 0); // At least size 2, this is a protocol spec - - txCoinbase.vout[0].scriptPubKey = CScript(); - pblock->vtx[0] = CTransaction(txCoinbase); - pblock->hashMerkleRoot = pblock->BuildMerkleTree(); -} - -void CheckSubsidyHalving(CBlockTemplate * &pblocktemplate, CBlock * &pblock) -{ - if ((chainActive.Height()+1) % Params().SubsidyHalvingInterval() == 0) - { - // The RegTest network has a low subsidy halving interval (150) so - // we must recompute the coinbase subsidy if we reach the boundary. - // The unittest network allows modifying this interval. We check it so this - // test can work in any network. - - // preserve parent hash - uint256 prevParent = pblock->hashPrevBlock; - delete pblocktemplate; - pblocktemplate = CreateNewBlock(scriptPubKey); - pblock = &pblocktemplate->block; // pointer for convenience - pblock->hashPrevBlock = prevParent; - } -} - -void CheckBlockAddedToBestChainSuccessfully(CBlock *pblock) -{ - int PreviousHeight; - CValidationState state; - - PreviousHeight = chainActive.Height(); - BOOST_CHECK(ProcessBlock(state, NULL, pblock)); - BOOST_CHECK(state.IsValid()); - BOOST_CHECK((PreviousHeight+1) == chainActive.Height()); // to differentiate from orphan blocks, which also get accepted in ProcessBlock() - - // Previous checks do not assure the current best chain has pblock as tip. It could be the case that a because - // of a malfunction in the chain reorganization code, a reorganization causes an increase of the chain length, but with another tip. - // So we also check that. - BOOST_CHECK(chainActive.Tip()->GetBlockHash()==pblock->GetHash()); -} - -void Blockv2test() -{ - assert(Params().NetworkID() == CBaseChainParams::UNITTEST); - ModifiableParams()->setSkipProofOfWorkCheck(true); - - // We don't know the state of the block-chain here: it depends on which other tests are run before this test. - // See https://github.com/bitcoin/bitcoin/pull/4688 for a patch that allows the re-creation of the block-chain - // for each testcase that requires it. - - // If miner_tests.cpp is run before, the chain will be 100 blocks long, and all of them will be v1 - - - LogPrintf("Blockv2test testcase starts\n"); - - CBlockTemplate *pblocktemplate; - CScript script; - uint256 hash; - int PreviousHeight; - - LOCK(cs_main); - - // Simple block creation, nothing special yet. - pblocktemplate = CreateNewBlock(scriptPubKey); - CBlock *pblock = &pblocktemplate->block; // pointer for convenience - - LogPrintf("Blockv2test block v1 add begin\n"); - - //////////////////////////////////////////////////////////////////////////////////////// - // First create a block v1, check that it is accepted. The block has an invalid height. - //////////////////////////////////////////////////////////////////////////////////////// - SetBlockDefaultAttributesAndHeight(pblock,false,5000); - pblock->nVersion = 1; - CValidationState state1; - PreviousHeight = chainActive.Height(); - BOOST_CHECK(ProcessBlock(state1, NULL, pblock)); - BOOST_CHECK(state1.IsValid()); - BOOST_CHECK((PreviousHeight+1) == chainActive.Height()); // to differentiate from orphan blocks, which also get accepted in ProcessBlock() - pblock->hashPrevBlock = pblock->GetHash(); // update parent - - - - // First check that the supermajority threshold is exactly 1000 blocks - BOOST_CHECK(Params().ToCheckBlockUpgradeMajority()==1000); // - BOOST_CHECK(Params().EnforceBlockUpgradeMajority()==750); - BOOST_CHECK(Params().RejectBlockOutdatedMajority()==950); - - // Over the last 1000 blocks, 750 blocks must be v2 to switch to v2-only mode. - // Here we're testing only the last 750, not any subset. - - LogPrintf("Blockv2test BIP30 repetition begin\n"); - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - // First, if we try to add a block v2 with the same coinbase tx, we should get - // "bad-txns-BIP30" because the coinbase tx has the same hash as the previous. - // Even if ConnectBlock returns a "bad-txns-BIP30", ActivateBestChainStep clears - // the state, so we get true here and the "bad-txns-BIP30" reason is lost. But this - // is the intended behaviour: Receiving a single block can cause zero or multiple blocks to be - // connected, and ActivateBestChain's responsibility is just switching the best block whatsoever. - // Feedback about failures causes a reject message to be sent to the peer from which we received - // the actual block (not necessarily the same as from whom we got the block that caused the reorg), - // for which we remember the peerid. - // Because we cannot access the failure reason here, we just verify instead that the chain - // height has not been incremented. - ////////////////////////////////////////////////////////////////////////////////////////////////////// - - CValidationState state7; - PreviousHeight = chainActive.Height(); - CheckSubsidyHalving(pblocktemplate,pblock); - SetBlockDefaultAttributesAndHeight(pblock,false,5000); // - pblock->nVersion = 2; - BOOST_CHECK(ProcessBlock(state7, NULL, pblock)); // should we care about the return value? - BOOST_CHECK(state7.IsValid()); - BOOST_CHECK(PreviousHeight == chainActive.Height()); // we check the block has not been added. - - LogPrintf("Blockv2test 750 v2 blocks begin\n"); - - //////////////////////////// - // Now create 750 v2 blocks - //////////////////////////// - - for (int i=0;i<750;i++) - { - - LogPrintf("Blockv2test block %d begin\n",i); - - CheckSubsidyHalving(pblocktemplate,pblock); - - // We add a value to the height to make is NOT equal to the actual height. - SetBlockDefaultAttributesAndHeight(pblock,true,1000); // blocks version 2 without height are allowed! for only 750 blocks - pblock->nVersion = 2; - - CheckBlockAddedToBestChainSuccessfully(pblock); - pblock->hashPrevBlock = pblock->GetHash(); // update parent - } - - LogPrintf("Blockv2test v2 without height rejected begin\n"); - - ///////////////////////////////////////////////////////////////////////////////////// - // Now we try to add a block v2, with an invalid height and it should be rejected. - // We use 2000 as argument heightDifference because is not in the range [1000..1750]. - ///////////////////////////////////////////////////////////////////////////////////// - CheckSubsidyHalving(pblocktemplate,pblock); - SetBlockDefaultAttributesAndHeight(pblock,true,2000); // - pblock->nVersion = 2; - CValidationState state0; - BOOST_CHECK(ProcessBlock(state0, NULL, pblock)==false); - BOOST_CHECK(!state0.IsValid()); - BOOST_CHECK(state0.GetRejectReason()=="bad-cb-height"); - // Do not update parent since block has failed - - LogPrintf("Blockv2test v2 with height accepted begin\n"); - - ///////////////////////////////////////////////////////////// - // Now we add 200 additional blocks, until we get 950 - // (the threshold where v1 blocks are not accepted anymore) - ///////////////////////////////////////////////////////////// - for (int i=0;i<200;i++) - { - - LogPrintf("Blockv2test v2block %d begin\n",i); - CheckSubsidyHalving(pblocktemplate,pblock); - SetBlockDefaultAttributesAndHeight(pblock,true,0); - pblock->nVersion = 2; - CheckBlockAddedToBestChainSuccessfully(pblock); - pblock->hashPrevBlock = pblock->GetHash(); // update parent - } - - - LogPrintf("Blockv2test block v1 rejected\n"); - - ///////////////////////////////////////////////////////////////////////////////////////// - // Now we try to add a block v1, it should be rejected, even if it hash the height field - ///////////////////////////////////////////////////////////////////////////////////////// - CheckSubsidyHalving(pblocktemplate,pblock); - SetBlockDefaultAttributesAndHeight(pblock,true,0); - pblock->nVersion = 1; - CValidationState state2; - BOOST_CHECK(ProcessBlock(state2, NULL, pblock)==false); - BOOST_CHECK(!state2.IsValid()); - BOOST_CHECK(state2.GetRejectReason()=="bad-version"); - // Do not update parent since block has failed - - //////////////////////////////////////////////////////// - // Block time too old check - //////////////////////////////////////////////////////// - CheckSubsidyHalving(pblocktemplate,pblock); - SetBlockDefaultAttributesAndHeight(pblock,true,0); - pblock->nVersion = 2; - pblock->nTime = chainActive.Tip()->GetMedianTimePast()-1; - CValidationState state4; - BOOST_CHECK(ProcessBlock(state4, NULL, pblock)==false); - BOOST_CHECK(!state4.IsValid()); - BOOST_CHECK(state4.GetRejectReason()=="time-too-old"); - // Do not update parent since block has failed - - //////////////////////////////////////////////////////// - // Adding a non-final coinbase, must modify coinbase - //////////////////////////////////////////////////////// - CheckSubsidyHalving(pblocktemplate,pblock); - SetEmptyBlock(pblock); - // Use a mutable coinbase to change nLockTime and nSequence - CMutableTransaction txCoinbase(pblock->vtx[0]); - txCoinbase.vin[0].scriptSig = (CScript() << chainActive.Height() << 0); - txCoinbase.nLockTime = LOCKTIME_THRESHOLD-1; // refers to height - txCoinbase.vin[0].nSequence = 1; // non-zero sequence - pblock->vtx[0] = CTransaction(txCoinbase); - pblock->nVersion = 2; - pblock->hashMerkleRoot = pblock->BuildMerkleTree(); - CValidationState state5; - BOOST_CHECK(ProcessBlock(state5, NULL, pblock)==false); - BOOST_CHECK(!state5.IsValid()); - BOOST_CHECK(state5.GetRejectReason()=="bad-txns-nonfinal"); - // Do not update parent since block has failed - - ModifiableParams()->setSkipProofOfWorkCheck(false); - - //////////////////////////////////////////////////////////////////////////////// - // Just to be sure that proof-of-work skipping is working ok, we submit a block - // without enought proof of work and it must be rejected. - //////////////////////////////////////////////////////////////////////////////// - CheckSubsidyHalving(pblocktemplate,pblock); - SetBlockDefaultAttributesAndHeight(pblock,true,0); - pblock->nVersion = 2; - CValidationState state6; - BOOST_CHECK(ProcessBlock(state6, NULL, pblock)==false); - BOOST_CHECK(!state6.IsValid()); - BOOST_CHECK(state6.GetRejectReason()=="high-hash"); - - delete pblocktemplate; - - - LogPrintf("Blockv2test testcase ends\n"); -} - -BOOST_AUTO_TEST_CASE(Blockv2testcase) -{ - Blockv2test(); -} - -BOOST_AUTO_TEST_SUITE_END() diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index bad5c13ac2..9e4669eba9 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -253,7 +253,6 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) chainActive.Tip()->nHeight--; SetMockTime(0); - mempool.clear(); BOOST_FOREACH(CTransaction *tx, txFirst) delete tx; diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 6e5f0e3fac..68fad8d038 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -31,7 +31,7 @@ struct TestingSetup { TestingSetup() { fPrintToDebugLog = false; // don't want to write to debug.log file - SelectParams(CBaseChainParams::UNITTEST); + SelectParams(CBaseChainParams::MAIN); noui_connect(); #ifdef ENABLE_WALLET bitdb.MakeMock(); From c9fb27da0a72135417956dca8dafa959ebb67c10 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 25 Sep 2014 08:53:43 +0200 Subject: [PATCH 0808/1288] CBufferedFile: convert into a non-refcounted RAII wrapper - it now takes over the passed file descriptor and closes it in the destructor - this fixes a leak in LoadExternalBlockFile(), where an exception could cause the file to not getting closed - disallow copies (like recently added for CAutoFile) - make nType and nVersion private --- src/main.cpp | 2 +- src/serialize.h | 30 +++++++++++++++++++++--------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a3e36ff872..0333738887 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3084,6 +3084,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp) int nLoaded = 0; try { + // This takes over fileIn and calls fclose() on it in the CBufferedFile destructor CBufferedFile blkdat(fileIn, 2*MAX_BLOCK_SIZE, MAX_BLOCK_SIZE+8, SER_DISK, CLIENT_VERSION); uint64_t nStartByte = 0; if (dbp) { @@ -3140,7 +3141,6 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp) LogPrintf("%s : Deserialize or I/O error - %s", __func__, e.what()); } } - fclose(fileIn); } catch(std::runtime_error &e) { AbortNode(_("Error: system error: ") + e.what()); } diff --git a/src/serialize.h b/src/serialize.h index 68501facf2..f56dce1481 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -1256,13 +1256,19 @@ public: } }; -/** Wrapper around a FILE* that implements a ring buffer to - * deserialize from. It guarantees the ability to rewind - * a given number of bytes. */ +/** Non-refcounted RAII wrapper around a FILE* that implements a ring buffer to + * deserialize from. It guarantees the ability to rewind a given number of bytes. */ class CBufferedFile { private: - FILE *src; // source file + // Disallow copies + CBufferedFile(const CBufferedFile&); + CBufferedFile& operator=(const CBufferedFile&); + + int nType; + int nVersion; + + FILE *src; // source file uint64_t nSrcPos; // how many bytes have been read from source uint64_t nReadPos; // how many bytes have been read from this uint64_t nReadLimit; // up to which position we're allowed to read @@ -1289,12 +1295,18 @@ protected: } public: - int nType; - int nVersion; - CBufferedFile(FILE *fileIn, uint64_t nBufSize, uint64_t nRewindIn, int nTypeIn, int nVersionIn) : - src(fileIn), nSrcPos(0), nReadPos(0), nReadLimit((uint64_t)(-1)), nRewind(nRewindIn), vchBuf(nBufSize, 0), - nType(nTypeIn), nVersion(nVersionIn) { + nSrcPos(0), nReadPos(0), nReadLimit((uint64_t)(-1)), nRewind(nRewindIn), vchBuf(nBufSize, 0) + { + src = fileIn; + nType = nTypeIn; + nVersion = nVersionIn; + } + + ~CBufferedFile() + { + if (src) + fclose(src); } // check whether we're at the end of the source file From 0c35486dc97909cea67b24e8758bd0f40ac33a9a Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 29 Sep 2014 16:10:29 +0200 Subject: [PATCH 0809/1288] CBufferedFile: add explicit close function - also use identical close function for CAutoFile (avoids setting file to NULL under wrong conditions) --- src/serialize.h | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/serialize.h b/src/serialize.h index f56dce1481..63c72cb8e8 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -1154,7 +1154,7 @@ public: -/** Non-refcounted RAII wrapper for FILE*. +/** Non-refcounted RAII wrapper for FILE* * * Will automatically close the file when it goes out of scope if not null. * If you're returning the file pointer, return file.release(). @@ -1186,9 +1186,10 @@ public: void fclose() { - if (file != NULL && file != stdin && file != stdout && file != stderr) + if (file) { ::fclose(file); - file = NULL; + file = NULL; + } } FILE* release() { FILE* ret = file; file = NULL; return ret; } @@ -1257,7 +1258,11 @@ public: }; /** Non-refcounted RAII wrapper around a FILE* that implements a ring buffer to - * deserialize from. It guarantees the ability to rewind a given number of bytes. */ + * deserialize from. It guarantees the ability to rewind a given number of bytes. + * + * Will automatically close the file when it goes out of scope if not null. + * If you need to close the file early, use file.fclose() instead of fclose(file). + */ class CBufferedFile { private: @@ -1305,8 +1310,15 @@ public: ~CBufferedFile() { - if (src) - fclose(src); + fclose(); + } + + void fclose() + { + if (src) { + ::fclose(src); + src = NULL; + } } // check whether we're at the end of the source file From 938bccebf1cb3ed6c7b8bfb8236a5172433bf890 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 2 Oct 2014 10:59:28 +0200 Subject: [PATCH 0810/1288] CAutoFile: make file private --- src/serialize.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/serialize.h b/src/serialize.h index 63c72cb8e8..ff11edc06c 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -1166,12 +1166,13 @@ private: // Disallow copies CAutoFile(const CAutoFile&); CAutoFile& operator=(const CAutoFile&); -protected: - FILE* file; -public: + int nType; int nVersion; + + FILE* file; +public: CAutoFile(FILE* filenew, int nTypeIn, int nVersionIn) { file = filenew; From e2efdf3937e71c0ae91b7a1e5d381d04bc814bb6 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 2 Oct 2014 11:25:21 +0200 Subject: [PATCH 0811/1288] amount.h: update license, add header end comment + rem from util.h --- src/amount.h | 4 ++-- src/util.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/amount.h b/src/amount.h index 42006a0388..831fa1f6ca 100644 --- a/src/amount.h +++ b/src/amount.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_AMOUNT_H @@ -10,4 +10,4 @@ typedef int64_t CAmount; -#endif +#endif // BITCOIN_AMOUNT_H diff --git a/src/util.h b/src/util.h index fb1d3eacb5..4b2415278b 100644 --- a/src/util.h +++ b/src/util.h @@ -14,7 +14,6 @@ #include "config/bitcoin-config.h" #endif -#include "amount.h" #include "compat.h" #include "tinyformat.h" #include "utiltime.h" From 4bd11852802f3ed11e17e8d66660ce2e60f02287 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 2 Oct 2014 11:26:36 +0200 Subject: [PATCH 0812/1288] Qt: allow "emergency" shutdown during startup - allows closing our splash screen to abort startup --- src/qt/splashscreen.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 4fe610794f..74512e62aa 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -177,5 +177,6 @@ void SplashScreen::paintEvent(QPaintEvent *event) void SplashScreen::closeEvent(QCloseEvent *event) { + StartShutdown(); // allows an "emergency" shutdown during startup event->ignore(); } From f0fd00cb77d91ec9ac729bc4cf35ff7d9f676d8f Mon Sep 17 00:00:00 2001 From: SergioDemianLerner Date: Thu, 4 Sep 2014 16:23:42 -0300 Subject: [PATCH 0813/1288] Switch testing framework from MAIN to new UNITTEST network UNITTEST inherites from MAIN but allows synamically changing its parameters using the ModifiableParams() interface --- src/chainparams.cpp | 44 +++++++++++++++++++++++++++++++++++++++ src/chainparams.h | 23 ++++++++++++++++++++ src/chainparamsbase.cpp | 17 +++++++++++++++ src/chainparamsbase.h | 1 + src/checkpoints.cpp | 2 ++ src/main.cpp | 3 ++- src/pow.cpp | 4 ++++ src/test/base58_tests.cpp | 4 ++-- src/test/miner_tests.cpp | 1 + src/test/test_bitcoin.cpp | 2 +- 10 files changed, 97 insertions(+), 4 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 179db5a818..8a00da0bb5 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -214,8 +214,50 @@ public: }; static CRegTestParams regTestParams; +// +// Unit test +// +class CUnitTestParams : public CMainParams, public CModifiableParams { +public: + CUnitTestParams() { + networkID = CBaseChainParams::UNITTEST; + strNetworkID = "unittest"; + nDefaultPort = 18445; + vFixedSeeds.clear(); + vSeeds.clear(); // Regtest mode doesn't have any DNS seeds. + + fRequireRPCPassword = false; + fMiningRequiresPeers = false; + fDefaultCheckMemPool = true; + fAllowMinDifficultyBlocks = false; + fMineBlocksOnDemand = true; + fSkipProofOfWorkCheck = false; + } + virtual bool SkipProofOfWorkCheck() const { return fSkipProofOfWorkCheck; } +protected: + bool fSkipProofOfWorkCheck; +public: + // Published setters to allow changing values in unit test cases + virtual void setSubsidyHalvingInterval(int anSubsidyHalvingInterval) { nSubsidyHalvingInterval=anSubsidyHalvingInterval; } + virtual void setEnforceBlockUpgradeMajority(int anEnforceBlockUpgradeMajority) { nEnforceBlockUpgradeMajority=anEnforceBlockUpgradeMajority; } + virtual void setRejectBlockOutdatedMajority(int anRejectBlockOutdatedMajority) { nRejectBlockOutdatedMajority=anRejectBlockOutdatedMajority; } + virtual void setToCheckBlockUpgradeMajority(int anToCheckBlockUpgradeMajority) { nToCheckBlockUpgradeMajority=anToCheckBlockUpgradeMajority; } + virtual void setDefaultCheckMemPool(bool afDefaultCheckMemPool) { fDefaultCheckMemPool=afDefaultCheckMemPool; } + virtual void setAllowMinDifficultyBlocks(bool afAllowMinDifficultyBlocks) { fAllowMinDifficultyBlocks=afAllowMinDifficultyBlocks; } + virtual void setSkipProofOfWorkCheck(bool afSkipProofOfWorkCheck) { fSkipProofOfWorkCheck = afSkipProofOfWorkCheck; } +}; +static CUnitTestParams unitTestParams; + + static CChainParams *pCurrentParams = 0; +CModifiableParams *ModifiableParams() +{ + assert(pCurrentParams); + assert(pCurrentParams==&unitTestParams); + return (CModifiableParams*)&unitTestParams; +} + const CChainParams &Params() { assert(pCurrentParams); return *pCurrentParams; @@ -229,6 +271,8 @@ CChainParams &Params(CBaseChainParams::Network network) { return testNetParams; case CBaseChainParams::REGTEST: return regTestParams; + case CBaseChainParams::UNITTEST: + return unitTestParams; default: assert(false && "Unimplemented network"); return mainParams; diff --git a/src/chainparams.h b/src/chainparams.h index e5dfc87c6d..171a590a5f 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -61,6 +61,8 @@ public: bool DefaultCheckMemPool() const { return fDefaultCheckMemPool; } /* Allow mining of a min-difficulty block */ bool AllowMinDifficultyBlocks() const { return fAllowMinDifficultyBlocks; } + /* Skip proof-of-work check: allow mining of any difficulty block */ + virtual bool SkipProofOfWorkCheck() const { return false; } /* Make standard checks */ bool RequireStandard() const { return fRequireStandard; } int64_t TargetTimespan() const { return nTargetTimespan; } @@ -105,6 +107,24 @@ protected: bool fMineBlocksOnDemand; }; +/** Modifiable parameters interface is used by test cases to adapt the parameters in order +*** to test specific features more easily. Test cases should always restore the previous +*** values after finalization. +**/ + +class CModifiableParams { +public: + // Published setters to allow changing values in unit test cases + virtual void setSubsidyHalvingInterval(int anSubsidyHalvingInterval) =0; + virtual void setEnforceBlockUpgradeMajority(int anEnforceBlockUpgradeMajority)=0; + virtual void setRejectBlockOutdatedMajority(int anRejectBlockOutdatedMajority)=0; + virtual void setToCheckBlockUpgradeMajority(int anToCheckBlockUpgradeMajority)=0; + virtual void setDefaultCheckMemPool(bool aDefaultCheckMemPool)=0; + virtual void setAllowMinDifficultyBlocks(bool aAllowMinDifficultyBlocks)=0; + virtual void setSkipProofOfWorkCheck(bool aSkipProofOfWorkCheck)=0; +}; + + /** * Return the currently selected parameters. This won't change after app startup * outside of the unit tests. @@ -114,6 +134,9 @@ const CChainParams &Params(); /** Return parameters for the given network. */ CChainParams &Params(CBaseChainParams::Network network); +/** Get modifyable network parameters (UNITTEST only) */ +CModifiableParams *ModifiableParams(); + /** Sets the params returned by Params() to those for the given network. */ void SelectParams(CBaseChainParams::Network network); diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index 98bb5b855f..e9d63197bd 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -57,6 +57,20 @@ public: }; static CBaseRegTestParams regTestParams; +// +// Unit test +// +class CBaseUnitTestParams : public CBaseMainParams +{ +public: + CBaseUnitTestParams() + { + networkID = CBaseChainParams::UNITTEST; + strDataDir = "unittest"; + } +}; +static CBaseUnitTestParams unitTestParams; + static CBaseChainParams* pCurrentBaseParams = 0; const CBaseChainParams& BaseParams() @@ -77,6 +91,9 @@ void SelectBaseParams(CBaseChainParams::Network network) case CBaseChainParams::REGTEST: pCurrentBaseParams = ®TestParams; break; + case CBaseChainParams::UNITTEST: + pCurrentBaseParams = &unitTestParams; + break; default: assert(false && "Unimplemented network"); return; diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h index c054f03f17..cc154cf501 100644 --- a/src/chainparamsbase.h +++ b/src/chainparamsbase.h @@ -19,6 +19,7 @@ public: MAIN, TESTNET, REGTEST, + UNITTEST, MAX_NETWORK_TYPES }; diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index c41deea7ce..9a6bc05e63 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -88,6 +88,8 @@ namespace Checkpoints { return dataTestnet; else if (Params().NetworkID() == CBaseChainParams::MAIN) return data; + else if (Params().NetworkID() == CBaseChainParams::UNITTEST) // UnitTest share the same checkpoints as MAIN + return data; else return dataRegtest; } diff --git a/src/main.cpp b/src/main.cpp index a3e36ff872..55485c86ff 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2305,7 +2305,8 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex nHeight = pindexPrev->nHeight+1; // Check proof of work - if (block.nBits != GetNextWorkRequired(pindexPrev, &block)) + if ((!Params().SkipProofOfWorkCheck()) && + (block.nBits != GetNextWorkRequired(pindexPrev, &block))) return state.DoS(100, error("AcceptBlock() : incorrect proof of work"), REJECT_INVALID, "bad-diffbits"); diff --git a/src/pow.cpp b/src/pow.cpp index 893f6c18be..d50222849c 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -81,6 +81,10 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits) bool fNegative; bool fOverflow; uint256 bnTarget; + + if (Params().SkipProofOfWorkCheck()) + return true; + bnTarget.SetCompact(nBits, &fNegative, &fOverflow); // Check range diff --git a/src/test/base58_tests.cpp b/src/test/base58_tests.cpp index 58fffb6df4..c298c805da 100644 --- a/src/test/base58_tests.cpp +++ b/src/test/base58_tests.cpp @@ -175,7 +175,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_parse) BOOST_CHECK_MESSAGE(!secret.IsValid(), "IsValid pubkey as privkey:" + strTest); } } - SelectParams(CBaseChainParams::MAIN); + SelectParams(CBaseChainParams::UNITTEST); } // Goal: check that generated keys match test vectors @@ -243,7 +243,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_gen) CTxDestination nodest = CNoDestination(); BOOST_CHECK(!dummyAddr.Set(nodest)); - SelectParams(CBaseChainParams::MAIN); + SelectParams(CBaseChainParams::UNITTEST); } // Goal: check that base58 parsing code is robust against a variety of corrupted data diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index 9e4669eba9..bad5c13ac2 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -253,6 +253,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) chainActive.Tip()->nHeight--; SetMockTime(0); + mempool.clear(); BOOST_FOREACH(CTransaction *tx, txFirst) delete tx; diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 68fad8d038..6e5f0e3fac 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -31,7 +31,7 @@ struct TestingSetup { TestingSetup() { fPrintToDebugLog = false; // don't want to write to debug.log file - SelectParams(CBaseChainParams::MAIN); + SelectParams(CBaseChainParams::UNITTEST); noui_connect(); #ifdef ENABLE_WALLET bitdb.MakeMock(); From fbd36d8fb5245a5511b2db7a35270fb1250e21d5 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 29 Sep 2014 13:13:47 +0200 Subject: [PATCH 0814/1288] Avoid introducing a virtual into CChainParams Treat fSkipProofOfWorkCheck the same as other parameters. --- src/chainparams.cpp | 5 +---- src/chainparams.h | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 8a00da0bb5..31c67715c8 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -115,6 +115,7 @@ public: fAllowMinDifficultyBlocks = false; fRequireStandard = true; fMineBlocksOnDemand = false; + fSkipProofOfWorkCheck = false; } }; static CMainParams mainParams; @@ -231,11 +232,7 @@ public: fDefaultCheckMemPool = true; fAllowMinDifficultyBlocks = false; fMineBlocksOnDemand = true; - fSkipProofOfWorkCheck = false; } - virtual bool SkipProofOfWorkCheck() const { return fSkipProofOfWorkCheck; } -protected: - bool fSkipProofOfWorkCheck; public: // Published setters to allow changing values in unit test cases virtual void setSubsidyHalvingInterval(int anSubsidyHalvingInterval) { nSubsidyHalvingInterval=anSubsidyHalvingInterval; } diff --git a/src/chainparams.h b/src/chainparams.h index 171a590a5f..50441a89f3 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -62,7 +62,7 @@ public: /* Allow mining of a min-difficulty block */ bool AllowMinDifficultyBlocks() const { return fAllowMinDifficultyBlocks; } /* Skip proof-of-work check: allow mining of any difficulty block */ - virtual bool SkipProofOfWorkCheck() const { return false; } + bool SkipProofOfWorkCheck() const { return fSkipProofOfWorkCheck; } /* Make standard checks */ bool RequireStandard() const { return fRequireStandard; } int64_t TargetTimespan() const { return nTargetTimespan; } @@ -105,6 +105,7 @@ protected: bool fAllowMinDifficultyBlocks; bool fRequireStandard; bool fMineBlocksOnDemand; + bool fSkipProofOfWorkCheck; }; /** Modifiable parameters interface is used by test cases to adapt the parameters in order From 31d6390fd17803ab9870e239a0c0c4d0a6be5c68 Mon Sep 17 00:00:00 2001 From: Eric Shaw Date: Thu, 25 Sep 2014 18:39:28 -0400 Subject: [PATCH 0815/1288] Fixed setaccount accepting foreign address Fixed issue #4209 where using setaccount with a foreign address causes the address to be added to your receiving addresses. --- src/rpcwallet.cpp | 19 ++++++++++++------- src/test/rpc_wallet_tests.cpp | 8 ++++++-- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 35637362a4..b361e67911 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -230,15 +230,20 @@ Value setaccount(const Array& params, bool fHelp) if (params.size() > 1) strAccount = AccountFromValue(params[1]); - // Detect when changing the account of an address that is the 'unused current key' of another account: - if (pwalletMain->mapAddressBook.count(address.Get())) + // Only add the account if the address is yours. + if (IsMine(*pwalletMain, address.Get())) { - string strOldAccount = pwalletMain->mapAddressBook[address.Get()].name; - if (address == GetAccountAddress(strOldAccount)) - GetAccountAddress(strOldAccount, true); + // Detect when changing the account of an address that is the 'unused current key' of another account: + if (pwalletMain->mapAddressBook.count(address.Get())) + { + string strOldAccount = pwalletMain->mapAddressBook[address.Get()].name; + if (address == GetAccountAddress(strOldAccount)) + GetAccountAddress(strOldAccount, true); + } + pwalletMain->SetAddressBook(address.Get(), strAccount, "receive"); } - - pwalletMain->SetAddressBook(address.Get(), strAccount, "receive"); + else + throw JSONRPCError(RPC_MISC_ERROR, "setaccount can only be used with own address"); return Value::null; } diff --git a/src/test/rpc_wallet_tests.cpp b/src/test/rpc_wallet_tests.cpp index 1dc2a3d82f..8c1d2900bc 100644 --- a/src/test/rpc_wallet_tests.cpp +++ b/src/test/rpc_wallet_tests.cpp @@ -80,11 +80,15 @@ BOOST_AUTO_TEST_CASE(rpc_wallet) walletdb.WriteAccount(strAccount, account); }); - + CPubKey setaccountDemoPubkey = pwalletMain->GenerateNewKey(); + CBitcoinAddress setaccountDemoAddress = CBitcoinAddress(CTxDestination(setaccountDemoPubkey.GetID())); + /********************************* * setaccount *********************************/ - BOOST_CHECK_NO_THROW(CallRPC("setaccount 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ nullaccount")); + BOOST_CHECK_NO_THROW(CallRPC("setaccount " + setaccountDemoAddress.ToString() + " nullaccount")); + /* 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ is not owned by the test wallet. */ + BOOST_CHECK_THROW(CallRPC("setaccount 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ nullaccount"), runtime_error); BOOST_CHECK_THROW(CallRPC("setaccount"), runtime_error); /* 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4X (33 chars) is an illegal address (should be 34 chars) */ BOOST_CHECK_THROW(CallRPC("setaccount 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4X nullaccount"), runtime_error); From bc470c43eecd40057a54fbfe4f34eb6fbda7134d Mon Sep 17 00:00:00 2001 From: Eric Shaw Date: Thu, 2 Oct 2014 12:19:18 -0400 Subject: [PATCH 0816/1288] Changed mixed indentation to four spaces Put `test/rpc_wallet_tests.cpp` through clang-format. --- src/test/rpc_wallet_tests.cpp | 141 +++++++++++++++++----------------- 1 file changed, 70 insertions(+), 71 deletions(-) diff --git a/src/test/rpc_wallet_tests.cpp b/src/test/rpc_wallet_tests.cpp index 8c1d2900bc..91da0c4420 100644 --- a/src/test/rpc_wallet_tests.cpp +++ b/src/test/rpc_wallet_tests.cpp @@ -14,7 +14,7 @@ using namespace std; using namespace json_spirit; -extern Array createArgs(int nRequired, const char* address1=NULL, const char* address2=NULL); +extern Array createArgs(int nRequired, const char* address1 = NULL, const char* address2 = NULL); extern Value CallRPC(string args); extern CWallet* pwalletMain; @@ -53,10 +53,10 @@ BOOST_AUTO_TEST_CASE(rpc_addmultisig) BOOST_CHECK_THROW(addmultisig(createArgs(1, ""), false), runtime_error); BOOST_CHECK_THROW(addmultisig(createArgs(1, "NotAValidPubkey"), false), runtime_error); - string short1(address1Hex, address1Hex+sizeof(address1Hex)-2); // last byte missing + string short1(address1Hex, address1Hex + sizeof(address1Hex) - 2); // last byte missing BOOST_CHECK_THROW(addmultisig(createArgs(2, short1.c_str()), false), runtime_error); - string short2(address1Hex+1, address1Hex+sizeof(address1Hex)); // first byte missing + string short2(address1Hex + 1, address1Hex + sizeof(address1Hex)); // first byte missing BOOST_CHECK_THROW(addmultisig(createArgs(2, short2.c_str()), false), runtime_error); } @@ -68,30 +68,30 @@ BOOST_AUTO_TEST_CASE(rpc_wallet) LOCK2(cs_main, pwalletMain->cs_wallet); CPubKey demoPubkey = pwalletMain->GenerateNewKey(); - CBitcoinAddress demoAddress = CBitcoinAddress(CTxDestination(demoPubkey.GetID())); - Value retValue; - string strAccount = "walletDemoAccount"; - string strPurpose = "receive"; - BOOST_CHECK_NO_THROW({ /*Initialize Wallet with an account */ - CWalletDB walletdb(pwalletMain->strWalletFile); - CAccount account; - account.vchPubKey = demoPubkey; - pwalletMain->SetAddressBook(account.vchPubKey.GetID(), strAccount, strPurpose); - walletdb.WriteAccount(strAccount, account); - }); + CBitcoinAddress demoAddress = CBitcoinAddress(CTxDestination(demoPubkey.GetID())); + Value retValue; + string strAccount = "walletDemoAccount"; + string strPurpose = "receive"; + BOOST_CHECK_NO_THROW({ /*Initialize Wallet with an account */ + CWalletDB walletdb(pwalletMain->strWalletFile); + CAccount account; + account.vchPubKey = demoPubkey; + pwalletMain->SetAddressBook(account.vchPubKey.GetID(), strAccount, strPurpose); + walletdb.WriteAccount(strAccount, account); + }); CPubKey setaccountDemoPubkey = pwalletMain->GenerateNewKey(); - CBitcoinAddress setaccountDemoAddress = CBitcoinAddress(CTxDestination(setaccountDemoPubkey.GetID())); - - /********************************* - * setaccount - *********************************/ - BOOST_CHECK_NO_THROW(CallRPC("setaccount " + setaccountDemoAddress.ToString() + " nullaccount")); - /* 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ is not owned by the test wallet. */ - BOOST_CHECK_THROW(CallRPC("setaccount 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ nullaccount"), runtime_error); - BOOST_CHECK_THROW(CallRPC("setaccount"), runtime_error); - /* 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4X (33 chars) is an illegal address (should be 34 chars) */ - BOOST_CHECK_THROW(CallRPC("setaccount 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4X nullaccount"), runtime_error); + CBitcoinAddress setaccountDemoAddress = CBitcoinAddress(CTxDestination(setaccountDemoPubkey.GetID())); + + /********************************* + * setaccount + *********************************/ + BOOST_CHECK_NO_THROW(CallRPC("setaccount " + setaccountDemoAddress.ToString() + " nullaccount")); + /* 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ is not owned by the test wallet. */ + BOOST_CHECK_THROW(CallRPC("setaccount 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ nullaccount"), runtime_error); + BOOST_CHECK_THROW(CallRPC("setaccount"), runtime_error); + /* 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4X (33 chars) is an illegal address (should be 34 chars) */ + BOOST_CHECK_THROW(CallRPC("setaccount 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4X nullaccount"), runtime_error); /********************************* * listunspent @@ -101,12 +101,12 @@ BOOST_AUTO_TEST_CASE(rpc_wallet) BOOST_CHECK_THROW(CallRPC("listunspent 0 string"), runtime_error); BOOST_CHECK_THROW(CallRPC("listunspent 0 1 not_array"), runtime_error); BOOST_CHECK_THROW(CallRPC("listunspent 0 1 [] extra"), runtime_error); - BOOST_CHECK_NO_THROW(r=CallRPC("listunspent 0 1 []")); + BOOST_CHECK_NO_THROW(r = CallRPC("listunspent 0 1 []")); BOOST_CHECK(r.get_array().empty()); /********************************* - * listreceivedbyaddress - *********************************/ + * listreceivedbyaddress + *********************************/ BOOST_CHECK_NO_THROW(CallRPC("listreceivedbyaddress")); BOOST_CHECK_NO_THROW(CallRPC("listreceivedbyaddress 0")); BOOST_CHECK_THROW(CallRPC("listreceivedbyaddress not_int"), runtime_error); @@ -115,8 +115,8 @@ BOOST_AUTO_TEST_CASE(rpc_wallet) BOOST_CHECK_THROW(CallRPC("listreceivedbyaddress 0 true extra"), runtime_error); /********************************* - * listreceivedbyaccount - *********************************/ + * listreceivedbyaccount + *********************************/ BOOST_CHECK_NO_THROW(CallRPC("listreceivedbyaccount")); BOOST_CHECK_NO_THROW(CallRPC("listreceivedbyaccount 0")); BOOST_CHECK_THROW(CallRPC("listreceivedbyaccount not_int"), runtime_error); @@ -125,59 +125,58 @@ BOOST_AUTO_TEST_CASE(rpc_wallet) BOOST_CHECK_THROW(CallRPC("listreceivedbyaccount 0 true extra"), runtime_error); /********************************* - * getrawchangeaddress - *********************************/ + * getrawchangeaddress + *********************************/ BOOST_CHECK_NO_THROW(CallRPC("getrawchangeaddress")); /********************************* - * getnewaddress - *********************************/ + * getnewaddress + *********************************/ BOOST_CHECK_NO_THROW(CallRPC("getnewaddress")); BOOST_CHECK_NO_THROW(CallRPC("getnewaddress getnewaddress_demoaccount")); /********************************* - * getaccountaddress - *********************************/ + * getaccountaddress + *********************************/ BOOST_CHECK_NO_THROW(CallRPC("getaccountaddress \"\"")); - BOOST_CHECK_NO_THROW(CallRPC("getaccountaddress accountThatDoesntExists")); // Should generate a new account - BOOST_CHECK_NO_THROW(retValue = CallRPC("getaccountaddress " + strAccount)); - BOOST_CHECK(CBitcoinAddress(retValue.get_str()).Get() == demoAddress.Get()); + BOOST_CHECK_NO_THROW(CallRPC("getaccountaddress accountThatDoesntExists")); // Should generate a new account + BOOST_CHECK_NO_THROW(retValue = CallRPC("getaccountaddress " + strAccount)); + BOOST_CHECK(CBitcoinAddress(retValue.get_str()).Get() == demoAddress.Get()); - /********************************* - * getaccount - *********************************/ - BOOST_CHECK_THROW(CallRPC("getaccount"), runtime_error); - BOOST_CHECK_NO_THROW(CallRPC("getaccount " + demoAddress.ToString())); + /********************************* + * getaccount + *********************************/ + BOOST_CHECK_THROW(CallRPC("getaccount"), runtime_error); + BOOST_CHECK_NO_THROW(CallRPC("getaccount " + demoAddress.ToString())); - /********************************* - * signmessage + verifymessage - *********************************/ - BOOST_CHECK_NO_THROW(retValue = CallRPC("signmessage " + demoAddress.ToString() + " mymessage")); - BOOST_CHECK_THROW(CallRPC("signmessage"), runtime_error); - /* Should throw error because this address is not loaded in the wallet */ - BOOST_CHECK_THROW(CallRPC("signmessage 1QFqqMUD55ZV3PJEJZtaKCsQmjLT6JkjvJ mymessage"), runtime_error); + /********************************* + * signmessage + verifymessage + *********************************/ + BOOST_CHECK_NO_THROW(retValue = CallRPC("signmessage " + demoAddress.ToString() + " mymessage")); + BOOST_CHECK_THROW(CallRPC("signmessage"), runtime_error); + /* Should throw error because this address is not loaded in the wallet */ + BOOST_CHECK_THROW(CallRPC("signmessage 1QFqqMUD55ZV3PJEJZtaKCsQmjLT6JkjvJ mymessage"), runtime_error); - /* missing arguments */ - BOOST_CHECK_THROW(CallRPC("verifymessage "+ demoAddress.ToString()), runtime_error); - BOOST_CHECK_THROW(CallRPC("verifymessage "+ demoAddress.ToString() + " " + retValue.get_str()), runtime_error); - /* Illegal address */ - BOOST_CHECK_THROW(CallRPC("verifymessage 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4X " + retValue.get_str() + " mymessage"), runtime_error); - /* wrong address */ - BOOST_CHECK(CallRPC("verifymessage 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ " + retValue.get_str() + " mymessage").get_bool() == false); - /* Correct address and signature but wrong message */ - BOOST_CHECK(CallRPC("verifymessage "+ demoAddress.ToString() + " " + retValue.get_str() + " wrongmessage").get_bool() == false); - /* Correct address, message and signature*/ - BOOST_CHECK(CallRPC("verifymessage "+ demoAddress.ToString() + " " + retValue.get_str() + " mymessage").get_bool() == true); - - /********************************* - * getaddressesbyaccount - *********************************/ - BOOST_CHECK_THROW(CallRPC("getaddressesbyaccount"), runtime_error); - BOOST_CHECK_NO_THROW(retValue = CallRPC("getaddressesbyaccount " + strAccount)); - Array arr = retValue.get_array(); - BOOST_CHECK(arr.size() > 0); - BOOST_CHECK(CBitcoinAddress(arr[0].get_str()).Get() == demoAddress.Get()); + /* missing arguments */ + BOOST_CHECK_THROW(CallRPC("verifymessage " + demoAddress.ToString()), runtime_error); + BOOST_CHECK_THROW(CallRPC("verifymessage " + demoAddress.ToString() + " " + retValue.get_str()), runtime_error); + /* Illegal address */ + BOOST_CHECK_THROW(CallRPC("verifymessage 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4X " + retValue.get_str() + " mymessage"), runtime_error); + /* wrong address */ + BOOST_CHECK(CallRPC("verifymessage 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ " + retValue.get_str() + " mymessage").get_bool() == false); + /* Correct address and signature but wrong message */ + BOOST_CHECK(CallRPC("verifymessage " + demoAddress.ToString() + " " + retValue.get_str() + " wrongmessage").get_bool() == false); + /* Correct address, message and signature*/ + BOOST_CHECK(CallRPC("verifymessage " + demoAddress.ToString() + " " + retValue.get_str() + " mymessage").get_bool() == true); + /********************************* + * getaddressesbyaccount + *********************************/ + BOOST_CHECK_THROW(CallRPC("getaddressesbyaccount"), runtime_error); + BOOST_CHECK_NO_THROW(retValue = CallRPC("getaddressesbyaccount " + strAccount)); + Array arr = retValue.get_array(); + BOOST_CHECK(arr.size() > 0); + BOOST_CHECK(CBitcoinAddress(arr[0].get_str()).Get() == demoAddress.Get()); } From 4bb30a1eb81009cf75b75c8371e361ef149e3744 Mon Sep 17 00:00:00 2001 From: R E Broadley Date: Wed, 10 Sep 2014 11:06:34 +0700 Subject: [PATCH 0817/1288] Correct logging AcceptBlock()->AcceptBlockHeader() --- src/main.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 55485c86ff..f49c4dcede 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2274,7 +2274,7 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex if (miSelf != mapBlockIndex.end()) { pindex = miSelf->second; if (pindex->nStatus & BLOCK_FAILED_MASK) - return state.Invalid(error("AcceptBlock() : block is marked invalid"), 0, "duplicate"); + return state.Invalid(error("%s : block is marked invalid", __func__), 0, "duplicate"); } CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(); @@ -2284,12 +2284,12 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex int64_t deltaTime = block.GetBlockTime() - pcheckpoint->GetBlockTime(); if (deltaTime < 0) { - return state.DoS(100, error("CheckBlockHeader() : block with timestamp before last checkpoint"), + return state.DoS(100, error("%s : block with timestamp before last checkpoint", __func__), REJECT_CHECKPOINT, "time-too-old"); } if (!CheckMinWork(block.nBits, pcheckpoint->nBits, deltaTime)) { - return state.DoS(100, error("CheckBlockHeader() : block with too little proof-of-work"), + return state.DoS(100, error("%s : block with too little proof-of-work", __func__), REJECT_INVALID, "bad-diffbits"); } } @@ -2300,36 +2300,36 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex if (hash != Params().HashGenesisBlock()) { BlockMap::iterator mi = mapBlockIndex.find(block.hashPrevBlock); if (mi == mapBlockIndex.end()) - return state.DoS(10, error("AcceptBlock() : prev block not found"), 0, "bad-prevblk"); + return state.DoS(10, error("%s : prev block not found", __func__), 0, "bad-prevblk"); pindexPrev = (*mi).second; nHeight = pindexPrev->nHeight+1; // Check proof of work if ((!Params().SkipProofOfWorkCheck()) && (block.nBits != GetNextWorkRequired(pindexPrev, &block))) - return state.DoS(100, error("AcceptBlock() : incorrect proof of work"), + return state.DoS(100, error("%s : incorrect proof of work", __func__), REJECT_INVALID, "bad-diffbits"); // Check timestamp against prev if (block.GetBlockTime() <= pindexPrev->GetMedianTimePast()) - return state.Invalid(error("AcceptBlock() : block's timestamp is too early"), + return state.Invalid(error("%s : block's timestamp is too early", __func__), REJECT_INVALID, "time-too-old"); // Check that the block chain matches the known block chain up to a checkpoint if (!Checkpoints::CheckBlock(nHeight, hash)) - return state.DoS(100, error("AcceptBlock() : rejected by checkpoint lock-in at %d", nHeight), + return state.DoS(100, error("%s : rejected by checkpoint lock-in at %d", __func__, nHeight), REJECT_CHECKPOINT, "checkpoint mismatch"); // Don't accept any forks from the main chain prior to last checkpoint CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(); if (pcheckpoint && nHeight < pcheckpoint->nHeight) - return state.DoS(100, error("AcceptBlock() : forked chain older than last checkpoint (height %d)", nHeight)); + return state.DoS(100, error("%s : forked chain older than last checkpoint (height %d)", __func__, nHeight)); // Reject block.nVersion=1 blocks when 95% (75% on testnet) of the network has upgraded: if (block.nVersion < 2 && CBlockIndex::IsSuperMajority(2, pindexPrev, Params().RejectBlockOutdatedMajority())) { - return state.Invalid(error("AcceptBlock() : rejected nVersion=1 block"), + return state.Invalid(error("%s : rejected nVersion=1 block", __func__), REJECT_OBSOLETE, "bad-version"); } } From 609adc7660dd94bd683e65268c27716beed2de89 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 2 Oct 2014 13:39:32 -0400 Subject: [PATCH 0818/1288] depends: disable unused bdb replication manager. Fixes new mingw builds Newer mingw supports the features necessary to enable this api, whereas older versions didn't. However once enabled (automatically by configure), it triggers an unrelated build bug. Since it was not enabled previously anyway, and we don't depend on the functionality, just disable it across the board. --- depends/packages/bdb.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/bdb.mk b/depends/packages/bdb.mk index 503409c5e5..f39925723b 100644 --- a/depends/packages/bdb.mk +++ b/depends/packages/bdb.mk @@ -6,7 +6,7 @@ $(package)_sha256_hash=12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b857327 $(package)_build_subdir=build_unix define $(package)_set_vars -$(package)_config_opts=--disable-shared --enable-cxx +$(package)_config_opts=--disable-shared --enable-cxx --disable-replication $(package)_config_opts_mingw32=--enable-mingw $(package)_config_opts_x86_64_linux=--with-pic $(package)_config_opts_arm_linux=--with-pic From c7829ea797c840dda7888ee860a50b7a3308069d Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 10 Sep 2014 14:42:22 +0200 Subject: [PATCH 0819/1288] Abstract out SignatureChecker --- src/script/interpreter.cpp | 19 ++++++++++--------- src/script/interpreter.h | 28 +++++++++++++++++++++++++--- src/script/sign.cpp | 2 +- src/test/script_tests.cpp | 2 +- 4 files changed, 37 insertions(+), 14 deletions(-) diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index a71f55dd26..048d298f0b 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -132,7 +132,7 @@ bool IsCanonicalSignature(const valtype &vchSig, unsigned int flags) { return true; } -bool EvalScript(vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags) +bool EvalScript(vector >& stack, const CScript& script, unsigned int flags, const SignatureChecker& checker) { CScript::const_iterator pc = script.begin(); CScript::const_iterator pend = script.end(); @@ -675,7 +675,7 @@ bool EvalScript(vector >& stack, const CScript& script, co scriptCode.FindAndDelete(CScript(vchSig)); bool fSuccess = IsCanonicalSignature(vchSig, flags) && IsCanonicalPubKey(vchPubKey, flags) && - CheckSig(vchSig, vchPubKey, scriptCode, txTo, nIn, flags); + checker.CheckSig(vchSig, vchPubKey, scriptCode, flags); popstack(stack); popstack(stack); @@ -736,7 +736,7 @@ bool EvalScript(vector >& stack, const CScript& script, co // Check signature bool fOk = IsCanonicalSignature(vchSig, flags) && IsCanonicalPubKey(vchPubKey, flags) && - CheckSig(vchSig, vchPubKey, scriptCode, txTo, nIn, flags); + checker.CheckSig(vchSig, vchPubKey, scriptCode, flags); if (fOk) { isig++; @@ -897,7 +897,7 @@ public: } // anon namespace -uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType) +uint256 SignatureHash(const CScript& scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType) { if (nIn >= txTo.vin.size()) { LogPrintf("ERROR: SignatureHash() : nIn=%d out of range\n", nIn); @@ -976,7 +976,7 @@ public: } }; -bool CheckSig(vector vchSig, const vector& vchPubKey, const CScript& scriptCode, const CTransaction& txTo, unsigned int nIn, int flags) +bool SignatureChecker::CheckSig(const vector& vchSigIn, const vector& vchPubKey, const CScript& scriptCode, int flags) const { static CSignatureCache signatureCache; @@ -985,6 +985,7 @@ bool CheckSig(vector vchSig, const vector& vchPubK return false; // Hash type is one byte tacked on to the end of the signature + vector vchSig(vchSigIn); if (vchSig.empty()) return false; int nHashType = vchSig.back(); @@ -1004,14 +1005,14 @@ bool CheckSig(vector vchSig, const vector& vchPubK return true; } -bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags) +bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigned int flags, const SignatureChecker& checker) { vector > stack, stackCopy; - if (!EvalScript(stack, scriptSig, txTo, nIn, flags)) + if (!EvalScript(stack, scriptSig, flags, checker)) return false; if (flags & SCRIPT_VERIFY_P2SH) stackCopy = stack; - if (!EvalScript(stack, scriptPubKey, txTo, nIn, flags)) + if (!EvalScript(stack, scriptPubKey, flags, checker)) return false; if (stack.empty()) return false; @@ -1034,7 +1035,7 @@ bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const C CScript pubKey2(pubKeySerialized.begin(), pubKeySerialized.end()); popstack(stackCopy); - if (!EvalScript(stackCopy, pubKey2, txTo, nIn, flags)) + if (!EvalScript(stackCopy, pubKey2, flags, checker)) return false; if (stackCopy.empty()) return false; diff --git a/src/script/interpreter.h b/src/script/interpreter.h index adca2142ac..f3fd49a3b6 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -38,8 +38,30 @@ bool IsCanonicalPubKey(const std::vector &vchPubKey, unsigned int bool IsCanonicalSignature(const std::vector &vchSig, unsigned int flags); uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType); -bool CheckSig(std::vector vchSig, const std::vector &vchPubKey, const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int flags); -bool EvalScript(std::vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags); -bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags); + +class SignatureChecker +{ +private: + const CTransaction& txTo; + unsigned int nIn; + +public: + SignatureChecker(const CTransaction& txToIn, unsigned int nInIn) : txTo(txToIn), nIn(nInIn) {} + bool CheckSig(const std::vector& scriptSig, const std::vector& vchPubKey, const CScript& scriptCode, int nFlags) const; +}; + +bool EvalScript(std::vector >& stack, const CScript& script, unsigned int flags, const SignatureChecker& checker); +bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigned int flags, const SignatureChecker& checker); + +// Wrappers using a default SignatureChecker. +bool inline EvalScript(std::vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags) +{ + return EvalScript(stack, script, flags, SignatureChecker(txTo, nIn)); +} + +bool inline VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags) +{ + return VerifyScript(scriptSig, scriptPubKey, flags, SignatureChecker(txTo, nIn)); +} #endif // H_BITCOIN_SCRIPT_INTERPRETER diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 8abd8d221d..a17fb58787 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -174,7 +174,7 @@ static CScript CombineMultisig(CScript scriptPubKey, const CMutableTransaction& if (sigs.count(pubkey)) continue; // Already got a sig for this pubkey - if (CheckSig(sig, pubkey, scriptPubKey, txTo, nIn, 0)) + if (SignatureChecker(txTo, nIn).CheckSig(sig, pubkey, scriptPubKey, 0)) { sigs[pubkey] = sig; break; diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 7f09b3daa1..992f32cc4c 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -89,7 +89,7 @@ CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CTr void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, int flags, bool expect, const std::string& message) { - BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, BuildSpendingTransaction(scriptSig, BuildCreditingTransaction(scriptPubKey)), 0, flags) == expect, message); + BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, flags, SignatureChecker(BuildSpendingTransaction(scriptSig, BuildCreditingTransaction(scriptPubKey)), 0)) == expect, message); } namespace From 5c1e798a8e9df15f8fbd120e57fc67e585f13843 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 10 Sep 2014 16:16:09 +0200 Subject: [PATCH 0820/1288] Make signature cache optional --- src/Makefile.am | 2 + src/bitcoin-tx.cpp | 2 +- src/main.cpp | 2 +- src/main.h | 1 + src/script/interpreter.cpp | 74 +++----------------------------- src/script/interpreter.h | 34 ++++++++------- src/script/sigcache.cpp | 88 ++++++++++++++++++++++++++++++++++++++ src/script/sigcache.h | 34 +++++++++++++++ src/script/sign.cpp | 6 +-- 9 files changed, 155 insertions(+), 88 deletions(-) create mode 100644 src/script/sigcache.cpp create mode 100644 src/script/sigcache.h diff --git a/src/Makefile.am b/src/Makefile.am index bd6f1ba0d5..155adfef7d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -103,6 +103,7 @@ BITCOIN_CORE_H = \ script/compressor.h \ script/interpreter.h \ script/script.h \ + script/sigcache.h \ script/sign.h \ script/standard.h \ serialize.h \ @@ -218,6 +219,7 @@ libbitcoin_common_a_SOURCES = \ script/compressor.cpp \ script/interpreter.cpp \ script/script.cpp \ + script/sigcache.cpp \ script/sign.cpp \ script/standard.cpp \ $(BITCOIN_CORE_H) diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index a61b4fe29d..a198eb586e 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -435,7 +435,7 @@ static void MutateTxSign(CMutableTransaction& tx, const string& flagStr) BOOST_FOREACH(const CTransaction& txv, txVariants) { txin.scriptSig = CombineSignatures(prevPubKey, mergedTx, i, txin.scriptSig, txv.vin[i].scriptSig); } - if (!VerifyScript(txin.scriptSig, prevPubKey, mergedTx, i, STANDARD_SCRIPT_VERIFY_FLAGS)) + if (!VerifyScript(txin.scriptSig, prevPubKey, STANDARD_SCRIPT_VERIFY_FLAGS, SignatureChecker(mergedTx, i))) fComplete = false; } diff --git a/src/main.cpp b/src/main.cpp index 55485c86ff..5faa0086f5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -645,7 +645,7 @@ bool AreInputsStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs) // IsStandard() will have already returned false // and this method isn't called. vector > stack; - if (!EvalScript(stack, tx.vin[i].scriptSig, tx, i, false)) + if (!EvalScript(stack, tx.vin[i].scriptSig, false, BaseSignatureChecker())) return false; if (whichType == TX_SCRIPTHASH) diff --git a/src/main.h b/src/main.h index 7e849505dd..ded6c15530 100644 --- a/src/main.h +++ b/src/main.h @@ -17,6 +17,7 @@ #include "net.h" #include "pow.h" #include "script/script.h" +#include "script/sigcache.h" #include "script/standard.h" #include "sync.h" #include "txmempool.h" diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 048d298f0b..f0b4268390 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -9,14 +9,10 @@ #include "crypto/ripemd160.h" #include "crypto/sha1.h" #include "crypto/sha2.h" -#include "random.h" #include "script/script.h" #include "uint256.h" #include "util.h" -#include -#include - using namespace std; typedef vector valtype; @@ -132,7 +128,7 @@ bool IsCanonicalSignature(const valtype &vchSig, unsigned int flags) { return true; } -bool EvalScript(vector >& stack, const CScript& script, unsigned int flags, const SignatureChecker& checker) +bool EvalScript(vector >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker) { CScript::const_iterator pc = script.begin(); CScript::const_iterator pend = script.end(); @@ -921,65 +917,13 @@ uint256 SignatureHash(const CScript& scriptCode, const CTransaction& txTo, unsig return ss.GetHash(); } -// Valid signature cache, to avoid doing expensive ECDSA signature checking -// twice for every transaction (once when accepted into memory pool, and -// again when accepted into the block chain) -class CSignatureCache +bool SignatureChecker::VerifySignature(const std::vector& vchSig, const CPubKey& pubkey, const uint256& sighash, int flags) const { -private: - // sigdata_type is (signature hash, signature, public key): - typedef boost::tuple, CPubKey> sigdata_type; - std::set< sigdata_type> setValid; - boost::shared_mutex cs_sigcache; - -public: - bool - Get(const uint256 &hash, const std::vector& vchSig, const CPubKey& pubKey) - { - boost::shared_lock lock(cs_sigcache); - - sigdata_type k(hash, vchSig, pubKey); - std::set::iterator mi = setValid.find(k); - if (mi != setValid.end()) - return true; - return false; - } - - void Set(const uint256 &hash, const std::vector& vchSig, const CPubKey& pubKey) - { - // DoS prevention: limit cache size to less than 10MB - // (~200 bytes per cache entry times 50,000 entries) - // Since there are a maximum of 20,000 signature operations per block - // 50,000 is a reasonable default. - int64_t nMaxCacheSize = GetArg("-maxsigcachesize", 50000); - if (nMaxCacheSize <= 0) return; - - boost::unique_lock lock(cs_sigcache); - - while (static_cast(setValid.size()) > nMaxCacheSize) - { - // Evict a random entry. Random because that helps - // foil would-be DoS attackers who might try to pre-generate - // and re-use a set of valid signatures just-slightly-greater - // than our cache size. - uint256 randomHash = GetRandHash(); - std::vector unused; - std::set::iterator it = - setValid.lower_bound(sigdata_type(randomHash, unused, unused)); - if (it == setValid.end()) - it = setValid.begin(); - setValid.erase(*it); - } - - sigdata_type k(hash, vchSig, pubKey); - setValid.insert(k); - } -}; + return pubkey.Verify(sighash, vchSig); +} bool SignatureChecker::CheckSig(const vector& vchSigIn, const vector& vchPubKey, const CScript& scriptCode, int flags) const { - static CSignatureCache signatureCache; - CPubKey pubkey(vchPubKey); if (!pubkey.IsValid()) return false; @@ -993,19 +937,13 @@ bool SignatureChecker::CheckSig(const vector& vchSigIn, const vec uint256 sighash = SignatureHash(scriptCode, txTo, nIn, nHashType); - if (signatureCache.Get(sighash, vchSig, pubkey)) - return true; - - if (!pubkey.Verify(sighash, vchSig)) + if (!VerifySignature(vchSig, pubkey, sighash, flags)) return false; - if (!(flags & SCRIPT_VERIFY_NOCACHE)) - signatureCache.Set(sighash, vchSig, pubkey); - return true; } -bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigned int flags, const SignatureChecker& checker) +bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigned int flags, const BaseSignatureChecker& checker) { vector > stack, stackCopy; if (!EvalScript(stack, scriptSig, flags, checker)) diff --git a/src/script/interpreter.h b/src/script/interpreter.h index f3fd49a3b6..801f7e0ce1 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -10,9 +10,10 @@ #include #include +class uint256; +class CPubKey; class CScript; class CTransaction; -class uint256; /** Signature hash types/flags */ enum @@ -39,29 +40,32 @@ bool IsCanonicalSignature(const std::vector &vchSig, unsigned int uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType); -class SignatureChecker +class BaseSignatureChecker +{ +public: + virtual bool CheckSig(const std::vector& scriptSig, const std::vector& vchPubKey, const CScript& scriptCode, int nFlags) const + { + return false; + } + + virtual ~BaseSignatureChecker() {} +}; + +class SignatureChecker : public BaseSignatureChecker { private: const CTransaction& txTo; unsigned int nIn; +protected: + virtual bool VerifySignature(const std::vector& vchSig, const CPubKey& vchPubKey, const uint256& sighash, int flags) const; + public: SignatureChecker(const CTransaction& txToIn, unsigned int nInIn) : txTo(txToIn), nIn(nInIn) {} bool CheckSig(const std::vector& scriptSig, const std::vector& vchPubKey, const CScript& scriptCode, int nFlags) const; }; -bool EvalScript(std::vector >& stack, const CScript& script, unsigned int flags, const SignatureChecker& checker); -bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigned int flags, const SignatureChecker& checker); - -// Wrappers using a default SignatureChecker. -bool inline EvalScript(std::vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags) -{ - return EvalScript(stack, script, flags, SignatureChecker(txTo, nIn)); -} - -bool inline VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags) -{ - return VerifyScript(scriptSig, scriptPubKey, flags, SignatureChecker(txTo, nIn)); -} +bool EvalScript(std::vector >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker); +bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigned int flags, const BaseSignatureChecker& checker); #endif // H_BITCOIN_SCRIPT_INTERPRETER diff --git a/src/script/sigcache.cpp b/src/script/sigcache.cpp new file mode 100644 index 0000000000..a1dec64dbc --- /dev/null +++ b/src/script/sigcache.cpp @@ -0,0 +1,88 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2013 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "sigcache.h" + +#include "key.h" +#include "random.h" +#include "uint256.h" +#include "util.h" + +#include +#include + +namespace { + +// Valid signature cache, to avoid doing expensive ECDSA signature checking +// twice for every transaction (once when accepted into memory pool, and +// again when accepted into the block chain) +class CSignatureCache +{ +private: + // sigdata_type is (signature hash, signature, public key): + typedef boost::tuple, CPubKey> sigdata_type; + std::set< sigdata_type> setValid; + boost::shared_mutex cs_sigcache; + +public: + bool + Get(const uint256 &hash, const std::vector& vchSig, const CPubKey& pubKey) + { + boost::shared_lock lock(cs_sigcache); + + sigdata_type k(hash, vchSig, pubKey); + std::set::iterator mi = setValid.find(k); + if (mi != setValid.end()) + return true; + return false; + } + + void Set(const uint256 &hash, const std::vector& vchSig, const CPubKey& pubKey) + { + // DoS prevention: limit cache size to less than 10MB + // (~200 bytes per cache entry times 50,000 entries) + // Since there are a maximum of 20,000 signature operations per block + // 50,000 is a reasonable default. + int64_t nMaxCacheSize = GetArg("-maxsigcachesize", 50000); + if (nMaxCacheSize <= 0) return; + + boost::unique_lock lock(cs_sigcache); + + while (static_cast(setValid.size()) > nMaxCacheSize) + { + // Evict a random entry. Random because that helps + // foil would-be DoS attackers who might try to pre-generate + // and re-use a set of valid signatures just-slightly-greater + // than our cache size. + uint256 randomHash = GetRandHash(); + std::vector unused; + std::set::iterator it = + setValid.lower_bound(sigdata_type(randomHash, unused, unused)); + if (it == setValid.end()) + it = setValid.begin(); + setValid.erase(*it); + } + + sigdata_type k(hash, vchSig, pubKey); + setValid.insert(k); + } +}; + +} + +bool CachingSignatureChecker::VerifySignature(const std::vector& vchSig, const CPubKey& pubkey, const uint256& sighash, int flags) const +{ + static CSignatureCache signatureCache; + + if (signatureCache.Get(sighash, vchSig, pubkey)) + return true; + + if (!SignatureChecker::VerifySignature(vchSig, pubkey, sighash, flags)) + return false; + + if (!(flags & SCRIPT_VERIFY_NOCACHE)) + signatureCache.Set(sighash, vchSig, pubkey); + return true; +} diff --git a/src/script/sigcache.h b/src/script/sigcache.h new file mode 100644 index 0000000000..8faa7ae01f --- /dev/null +++ b/src/script/sigcache.h @@ -0,0 +1,34 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2013 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef H_BITCOIN_SCRIPT_SIGCACHE +#define H_BITCOIN_SCRIPT_SIGCACHE + +#include "script/interpreter.h" + +#include + +class CPubKey; + +class CachingSignatureChecker : public SignatureChecker +{ +public: + CachingSignatureChecker(const CTransaction& txToIn, unsigned int nInIn) : SignatureChecker(txToIn, nInIn) {} + + bool VerifySignature(const std::vector& vchSig, const CPubKey& vchPubKey, const uint256& sighash, int flags) const; +}; + +// Wrappers using a default SignatureChecker. +bool inline EvalScript(std::vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags) +{ + return EvalScript(stack, script, flags, CachingSignatureChecker(txTo, nIn)); +} + +bool inline VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags) +{ + return VerifyScript(scriptSig, scriptPubKey, flags, CachingSignatureChecker(txTo, nIn)); +} + +#endif diff --git a/src/script/sign.cpp b/src/script/sign.cpp index a17fb58787..a524ac8e5e 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -123,7 +123,7 @@ bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CMutabl } // Test solution - return VerifyScript(txin.scriptSig, fromPubKey, txTo, nIn, STANDARD_SCRIPT_VERIFY_FLAGS); + return VerifyScript(txin.scriptSig, fromPubKey, STANDARD_SCRIPT_VERIFY_FLAGS, SignatureChecker(txTo, nIn)); } bool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType) @@ -252,9 +252,9 @@ CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsign Solver(scriptPubKey, txType, vSolutions); vector stack1; - EvalScript(stack1, scriptSig1, CTransaction(), 0, SCRIPT_VERIFY_STRICTENC); + EvalScript(stack1, scriptSig1, SCRIPT_VERIFY_STRICTENC, BaseSignatureChecker()); vector stack2; - EvalScript(stack2, scriptSig2, CTransaction(), 0, SCRIPT_VERIFY_STRICTENC); + EvalScript(stack2, scriptSig2, SCRIPT_VERIFY_STRICTENC, BaseSignatureChecker()); return CombineSignatures(scriptPubKey, txTo, nIn, txType, vSolutions, stack1, stack2); } From e790c370b5971dd096d1bbfd55960ccf71b7594a Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 14 Sep 2014 04:48:32 +0200 Subject: [PATCH 0821/1288] Replace SCRIPT_VERIFY_NOCACHE by flag directly to checker --- src/main.cpp | 15 +++++++-------- src/main.h | 13 +++++++------ src/miner.cpp | 2 +- src/rpcrawtransaction.cpp | 2 +- src/script/interpreter.cpp | 10 +++++----- src/script/interpreter.h | 9 ++++----- src/script/sigcache.cpp | 6 +++--- src/script/sigcache.h | 20 ++++++-------------- src/script/sign.cpp | 2 +- src/test/multisig_tests.cpp | 18 +++++++++--------- src/test/script_P2SH_tests.cpp | 4 ++-- src/test/script_tests.cpp | 34 +++++++++++++++++----------------- src/test/transaction_tests.cpp | 5 ++--- 13 files changed, 65 insertions(+), 75 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 5faa0086f5..61d5f2c177 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -943,7 +943,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa // Check against previous transactions // This is done last to help prevent CPU exhaustion denial-of-service attacks. - if (!CheckInputs(tx, state, view, true, STANDARD_SCRIPT_VERIFY_FLAGS)) + if (!CheckInputs(tx, state, view, true, STANDARD_SCRIPT_VERIFY_FLAGS, true)) { return error("AcceptToMemoryPool: : ConnectInputs failed %s", hash.ToString()); } @@ -1316,12 +1316,12 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach bool CScriptCheck::operator()() const { const CScript &scriptSig = ptxTo->vin[nIn].scriptSig; - if (!VerifyScript(scriptSig, scriptPubKey, *ptxTo, nIn, nFlags)) + if (!VerifyScript(scriptSig, scriptPubKey, nFlags, CachingSignatureChecker(*ptxTo, nIn, cacheStore))) return error("CScriptCheck() : %s:%d VerifySignature failed", ptxTo->GetHash().ToString(), nIn); return true; } -bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsViewCache &inputs, bool fScriptChecks, unsigned int flags, std::vector *pvChecks) +bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsViewCache &inputs, bool fScriptChecks, unsigned int flags, bool cacheStore, std::vector *pvChecks) { if (!tx.IsCoinBase()) { @@ -1390,7 +1390,7 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi assert(coins); // Verify signature - CScriptCheck check(*coins, tx, i, flags); + CScriptCheck check(*coins, tx, i, flags, cacheStore); if (pvChecks) { pvChecks->push_back(CScriptCheck()); check.swap(pvChecks->back()); @@ -1403,7 +1403,7 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi // avoid splitting the network between upgraded and // non-upgraded nodes. CScriptCheck check(*coins, tx, i, - flags & ~STANDARD_NOT_MANDATORY_VERIFY_FLAGS); + flags & ~STANDARD_NOT_MANDATORY_VERIFY_FLAGS, cacheStore); if (check()) return state.Invalid(false, REJECT_NONSTANDARD, "non-mandatory-script-verify-flag"); } @@ -1599,8 +1599,7 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C int64_t nBIP16SwitchTime = 1333238400; bool fStrictPayToScriptHash = (pindex->GetBlockTime() >= nBIP16SwitchTime); - unsigned int flags = SCRIPT_VERIFY_NOCACHE | - (fStrictPayToScriptHash ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE); + unsigned int flags = fStrictPayToScriptHash ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE; CBlockUndo blockundo; @@ -1644,7 +1643,7 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C nFees += view.GetValueIn(tx)-tx.GetValueOut(); std::vector vChecks; - if (!CheckInputs(tx, state, view, fScriptChecks, flags, nScriptCheckThreads ? &vChecks : NULL)) + if (!CheckInputs(tx, state, view, fScriptChecks, flags, false, nScriptCheckThreads ? &vChecks : NULL)) return false; control.Add(vChecks); } diff --git a/src/main.h b/src/main.h index ded6c15530..c09a139b24 100644 --- a/src/main.h +++ b/src/main.h @@ -259,9 +259,8 @@ unsigned int GetP2SHSigOpCount(const CTransaction& tx, const CCoinsViewCache& ma // Check whether all inputs of this transaction are valid (no double spends, scripts & sigs, amounts) // This does not modify the UTXO set. If pvChecks is not NULL, script checks are pushed onto it // instead of being performed inline. -bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsViewCache &view, bool fScriptChecks = true, - unsigned int flags = STANDARD_SCRIPT_VERIFY_FLAGS, - std::vector *pvChecks = NULL); +bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsViewCache &view, bool fScriptChecks, + unsigned int flags, bool cacheStore, std::vector *pvChecks = NULL); // Apply the effects of this transaction on the UTXO set represented by view void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight); @@ -303,12 +302,13 @@ private: const CTransaction *ptxTo; unsigned int nIn; unsigned int nFlags; + bool cacheStore; public: - CScriptCheck(): ptxTo(0), nIn(0), nFlags(0) {} - CScriptCheck(const CCoins& txFromIn, const CTransaction& txToIn, unsigned int nInIn, unsigned int nFlagsIn) : + CScriptCheck(): ptxTo(0), nIn(0), nFlags(0), cacheStore(false) {} + CScriptCheck(const CCoins& txFromIn, const CTransaction& txToIn, unsigned int nInIn, unsigned int nFlagsIn, bool cacheIn) : scriptPubKey(txFromIn.vout[txToIn.vin[nInIn].prevout.n].scriptPubKey), - ptxTo(&txToIn), nIn(nInIn), nFlags(nFlagsIn) { } + ptxTo(&txToIn), nIn(nInIn), nFlags(nFlagsIn), cacheStore(cacheIn) { } bool operator()() const; @@ -317,6 +317,7 @@ public: std::swap(ptxTo, check.ptxTo); std::swap(nIn, check.nIn); std::swap(nFlags, check.nFlags); + std::swap(cacheStore, check.cacheStore); } }; diff --git a/src/miner.cpp b/src/miner.cpp index 361a2bea41..280349e8c2 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -257,7 +257,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) // policy here, but we still have to ensure that the block we // create only contains transactions that are valid in new blocks. CValidationState state; - if (!CheckInputs(tx, state, view, true, MANDATORY_SCRIPT_VERIFY_FLAGS)) + if (!CheckInputs(tx, state, view, true, MANDATORY_SCRIPT_VERIFY_FLAGS, true)) continue; CTxUndo txundo; diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index bd87d77704..e50a278bc8 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -687,7 +687,7 @@ Value signrawtransaction(const Array& params, bool fHelp) BOOST_FOREACH(const CMutableTransaction& txv, txVariants) { txin.scriptSig = CombineSignatures(prevPubKey, mergedTx, i, txin.scriptSig, txv.vin[i].scriptSig); } - if (!VerifyScript(txin.scriptSig, prevPubKey, mergedTx, i, STANDARD_SCRIPT_VERIFY_FLAGS)) + if (!VerifyScript(txin.scriptSig, prevPubKey, STANDARD_SCRIPT_VERIFY_FLAGS, SignatureChecker(mergedTx, i))) fComplete = false; } diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index f0b4268390..56140f19db 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -671,7 +671,7 @@ bool EvalScript(vector >& stack, const CScript& script, un scriptCode.FindAndDelete(CScript(vchSig)); bool fSuccess = IsCanonicalSignature(vchSig, flags) && IsCanonicalPubKey(vchPubKey, flags) && - checker.CheckSig(vchSig, vchPubKey, scriptCode, flags); + checker.CheckSig(vchSig, vchPubKey, scriptCode); popstack(stack); popstack(stack); @@ -732,7 +732,7 @@ bool EvalScript(vector >& stack, const CScript& script, un // Check signature bool fOk = IsCanonicalSignature(vchSig, flags) && IsCanonicalPubKey(vchPubKey, flags) && - checker.CheckSig(vchSig, vchPubKey, scriptCode, flags); + checker.CheckSig(vchSig, vchPubKey, scriptCode); if (fOk) { isig++; @@ -917,12 +917,12 @@ uint256 SignatureHash(const CScript& scriptCode, const CTransaction& txTo, unsig return ss.GetHash(); } -bool SignatureChecker::VerifySignature(const std::vector& vchSig, const CPubKey& pubkey, const uint256& sighash, int flags) const +bool SignatureChecker::VerifySignature(const std::vector& vchSig, const CPubKey& pubkey, const uint256& sighash) const { return pubkey.Verify(sighash, vchSig); } -bool SignatureChecker::CheckSig(const vector& vchSigIn, const vector& vchPubKey, const CScript& scriptCode, int flags) const +bool SignatureChecker::CheckSig(const vector& vchSigIn, const vector& vchPubKey, const CScript& scriptCode) const { CPubKey pubkey(vchPubKey); if (!pubkey.IsValid()) @@ -937,7 +937,7 @@ bool SignatureChecker::CheckSig(const vector& vchSigIn, const vec uint256 sighash = SignatureHash(scriptCode, txTo, nIn, nHashType); - if (!VerifySignature(vchSig, pubkey, sighash, flags)) + if (!VerifySignature(vchSig, pubkey, sighash)) return false; return true; diff --git a/src/script/interpreter.h b/src/script/interpreter.h index 801f7e0ce1..f5363a7535 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -31,8 +31,7 @@ enum SCRIPT_VERIFY_P2SH = (1U << 0), // evaluate P2SH (BIP16) subscripts SCRIPT_VERIFY_STRICTENC = (1U << 1), // enforce strict conformance to DER and SEC2 for signatures and pubkeys SCRIPT_VERIFY_LOW_S = (1U << 2), // enforce low S values ( &vchPubKey, unsigned int flags); @@ -43,7 +42,7 @@ uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsig class BaseSignatureChecker { public: - virtual bool CheckSig(const std::vector& scriptSig, const std::vector& vchPubKey, const CScript& scriptCode, int nFlags) const + virtual bool CheckSig(const std::vector& scriptSig, const std::vector& vchPubKey, const CScript& scriptCode) const { return false; } @@ -58,11 +57,11 @@ private: unsigned int nIn; protected: - virtual bool VerifySignature(const std::vector& vchSig, const CPubKey& vchPubKey, const uint256& sighash, int flags) const; + virtual bool VerifySignature(const std::vector& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const; public: SignatureChecker(const CTransaction& txToIn, unsigned int nInIn) : txTo(txToIn), nIn(nInIn) {} - bool CheckSig(const std::vector& scriptSig, const std::vector& vchPubKey, const CScript& scriptCode, int nFlags) const; + bool CheckSig(const std::vector& scriptSig, const std::vector& vchPubKey, const CScript& scriptCode) const; }; bool EvalScript(std::vector >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker); diff --git a/src/script/sigcache.cpp b/src/script/sigcache.cpp index a1dec64dbc..981563b7ae 100644 --- a/src/script/sigcache.cpp +++ b/src/script/sigcache.cpp @@ -72,17 +72,17 @@ public: } -bool CachingSignatureChecker::VerifySignature(const std::vector& vchSig, const CPubKey& pubkey, const uint256& sighash, int flags) const +bool CachingSignatureChecker::VerifySignature(const std::vector& vchSig, const CPubKey& pubkey, const uint256& sighash) const { static CSignatureCache signatureCache; if (signatureCache.Get(sighash, vchSig, pubkey)) return true; - if (!SignatureChecker::VerifySignature(vchSig, pubkey, sighash, flags)) + if (!SignatureChecker::VerifySignature(vchSig, pubkey, sighash)) return false; - if (!(flags & SCRIPT_VERIFY_NOCACHE)) + if (store) signatureCache.Set(sighash, vchSig, pubkey); return true; } diff --git a/src/script/sigcache.h b/src/script/sigcache.h index 8faa7ae01f..9537efbd11 100644 --- a/src/script/sigcache.h +++ b/src/script/sigcache.h @@ -14,21 +14,13 @@ class CPubKey; class CachingSignatureChecker : public SignatureChecker { -public: - CachingSignatureChecker(const CTransaction& txToIn, unsigned int nInIn) : SignatureChecker(txToIn, nInIn) {} +private: + bool store; - bool VerifySignature(const std::vector& vchSig, const CPubKey& vchPubKey, const uint256& sighash, int flags) const; +public: + CachingSignatureChecker(const CTransaction& txToIn, unsigned int nInIn, bool storeIn=true) : SignatureChecker(txToIn, nInIn), store(storeIn) {} + + bool VerifySignature(const std::vector& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const; }; -// Wrappers using a default SignatureChecker. -bool inline EvalScript(std::vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags) -{ - return EvalScript(stack, script, flags, CachingSignatureChecker(txTo, nIn)); -} - -bool inline VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags) -{ - return VerifyScript(scriptSig, scriptPubKey, flags, CachingSignatureChecker(txTo, nIn)); -} - #endif diff --git a/src/script/sign.cpp b/src/script/sign.cpp index a524ac8e5e..da77e7d1f1 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -174,7 +174,7 @@ static CScript CombineMultisig(CScript scriptPubKey, const CMutableTransaction& if (sigs.count(pubkey)) continue; // Already got a sig for this pubkey - if (SignatureChecker(txTo, nIn).CheckSig(sig, pubkey, scriptPubKey, 0)) + if (SignatureChecker(txTo, nIn).CheckSig(sig, pubkey, scriptPubKey)) { sigs[pubkey] = sig; break; diff --git a/src/test/multisig_tests.cpp b/src/test/multisig_tests.cpp index cb37740068..5a2ec1cb31 100644 --- a/src/test/multisig_tests.cpp +++ b/src/test/multisig_tests.cpp @@ -82,19 +82,19 @@ BOOST_AUTO_TEST_CASE(multisig_verify) keys.clear(); keys += key[0],key[1]; // magic operator+= from boost.assign s = sign_multisig(a_and_b, keys, txTo[0], 0); - BOOST_CHECK(VerifyScript(s, a_and_b, txTo[0], 0, flags)); + BOOST_CHECK(VerifyScript(s, a_and_b, flags, SignatureChecker(txTo[0], 0))); for (int i = 0; i < 4; i++) { keys.clear(); keys += key[i]; s = sign_multisig(a_and_b, keys, txTo[0], 0); - BOOST_CHECK_MESSAGE(!VerifyScript(s, a_and_b, txTo[0], 0, flags), strprintf("a&b 1: %d", i)); + BOOST_CHECK_MESSAGE(!VerifyScript(s, a_and_b, flags, SignatureChecker(txTo[0], 0)), strprintf("a&b 1: %d", i)); keys.clear(); keys += key[1],key[i]; s = sign_multisig(a_and_b, keys, txTo[0], 0); - BOOST_CHECK_MESSAGE(!VerifyScript(s, a_and_b, txTo[0], 0, flags), strprintf("a&b 2: %d", i)); + BOOST_CHECK_MESSAGE(!VerifyScript(s, a_and_b, flags, SignatureChecker(txTo[0], 0)), strprintf("a&b 2: %d", i)); } // Test a OR b: @@ -104,16 +104,16 @@ BOOST_AUTO_TEST_CASE(multisig_verify) keys += key[i]; s = sign_multisig(a_or_b, keys, txTo[1], 0); if (i == 0 || i == 1) - BOOST_CHECK_MESSAGE(VerifyScript(s, a_or_b, txTo[1], 0, flags), strprintf("a|b: %d", i)); + BOOST_CHECK_MESSAGE(VerifyScript(s, a_or_b, flags, SignatureChecker(txTo[1], 0)), strprintf("a|b: %d", i)); else - BOOST_CHECK_MESSAGE(!VerifyScript(s, a_or_b, txTo[1], 0, flags), strprintf("a|b: %d", i)); + BOOST_CHECK_MESSAGE(!VerifyScript(s, a_or_b, flags, SignatureChecker(txTo[1], 0)), strprintf("a|b: %d", i)); } s.clear(); s << OP_0 << OP_0; - BOOST_CHECK(!VerifyScript(s, a_or_b, txTo[1], 0, flags)); + BOOST_CHECK(!VerifyScript(s, a_or_b, flags, SignatureChecker(txTo[1], 0))); s.clear(); s << OP_0 << OP_1; - BOOST_CHECK(!VerifyScript(s, a_or_b, txTo[1], 0, flags)); + BOOST_CHECK(!VerifyScript(s, a_or_b, flags, SignatureChecker(txTo[1], 0))); for (int i = 0; i < 4; i++) @@ -123,9 +123,9 @@ BOOST_AUTO_TEST_CASE(multisig_verify) keys += key[i],key[j]; s = sign_multisig(escrow, keys, txTo[2], 0); if (i < j && i < 3 && j < 3) - BOOST_CHECK_MESSAGE(VerifyScript(s, escrow, txTo[2], 0, flags), strprintf("escrow 1: %d %d", i, j)); + BOOST_CHECK_MESSAGE(VerifyScript(s, escrow, flags, SignatureChecker(txTo[2], 0)), strprintf("escrow 1: %d %d", i, j)); else - BOOST_CHECK_MESSAGE(!VerifyScript(s, escrow, txTo[2], 0, flags), strprintf("escrow 2: %d %d", i, j)); + BOOST_CHECK_MESSAGE(!VerifyScript(s, escrow, flags, SignatureChecker(txTo[2], 0)), strprintf("escrow 2: %d %d", i, j)); } } diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index e6cf00c2d0..6c32a263a9 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -42,7 +42,7 @@ Verify(const CScript& scriptSig, const CScript& scriptPubKey, bool fStrict) txTo.vin[0].scriptSig = scriptSig; txTo.vout[0].nValue = 1; - return VerifyScript(scriptSig, scriptPubKey, txTo, 0, fStrict ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE); + return VerifyScript(scriptSig, scriptPubKey, fStrict ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE, SignatureChecker(txTo, 0)); } @@ -113,7 +113,7 @@ BOOST_AUTO_TEST_CASE(sign) { CScript sigSave = txTo[i].vin[0].scriptSig; txTo[i].vin[0].scriptSig = txTo[j].vin[0].scriptSig; - bool sigOK = CScriptCheck(CCoins(txFrom, 0), txTo[i], 0, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC)(); + bool sigOK = CScriptCheck(CCoins(txFrom, 0), txTo[i], 0, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC, false)(); if (i == j) BOOST_CHECK_MESSAGE(sigOK, strprintf("VerifySignature %d %d", i, j)); else diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 992f32cc4c..bfba0ea7fe 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -464,18 +464,18 @@ BOOST_AUTO_TEST_CASE(script_PushData) static const unsigned char pushdata4[] = { OP_PUSHDATA4, 1, 0, 0, 0, 0x5a }; vector > directStack; - BOOST_CHECK(EvalScript(directStack, CScript(&direct[0], &direct[sizeof(direct)]), CTransaction(), 0, true)); + BOOST_CHECK(EvalScript(directStack, CScript(&direct[0], &direct[sizeof(direct)]), true, BaseSignatureChecker())); vector > pushdata1Stack; - BOOST_CHECK(EvalScript(pushdata1Stack, CScript(&pushdata1[0], &pushdata1[sizeof(pushdata1)]), CTransaction(), 0, true)); + BOOST_CHECK(EvalScript(pushdata1Stack, CScript(&pushdata1[0], &pushdata1[sizeof(pushdata1)]), true, BaseSignatureChecker())); BOOST_CHECK(pushdata1Stack == directStack); vector > pushdata2Stack; - BOOST_CHECK(EvalScript(pushdata2Stack, CScript(&pushdata2[0], &pushdata2[sizeof(pushdata2)]), CTransaction(), 0, true)); + BOOST_CHECK(EvalScript(pushdata2Stack, CScript(&pushdata2[0], &pushdata2[sizeof(pushdata2)]), true, BaseSignatureChecker())); BOOST_CHECK(pushdata2Stack == directStack); vector > pushdata4Stack; - BOOST_CHECK(EvalScript(pushdata4Stack, CScript(&pushdata4[0], &pushdata4[sizeof(pushdata4)]), CTransaction(), 0, true)); + BOOST_CHECK(EvalScript(pushdata4Stack, CScript(&pushdata4[0], &pushdata4[sizeof(pushdata4)]), true, BaseSignatureChecker())); BOOST_CHECK(pushdata4Stack == directStack); } @@ -533,15 +533,15 @@ BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG12) txTo12.vout[0].nValue = 1; CScript goodsig1 = sign_multisig(scriptPubKey12, key1, txTo12); - BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey12, txTo12, 0, flags)); + BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey12, flags, SignatureChecker(txTo12, 0))); txTo12.vout[0].nValue = 2; - BOOST_CHECK(!VerifyScript(goodsig1, scriptPubKey12, txTo12, 0, flags)); + BOOST_CHECK(!VerifyScript(goodsig1, scriptPubKey12, flags, SignatureChecker(txTo12, 0))); CScript goodsig2 = sign_multisig(scriptPubKey12, key2, txTo12); - BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey12, txTo12, 0, flags)); + BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey12, flags, SignatureChecker(txTo12, 0))); CScript badsig1 = sign_multisig(scriptPubKey12, key3, txTo12); - BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey12, txTo12, 0, flags)); + BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey12, flags, SignatureChecker(txTo12, 0))); } BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG23) @@ -569,46 +569,46 @@ BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG23) std::vector keys; keys.push_back(key1); keys.push_back(key2); CScript goodsig1 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey23, txTo23, 0, flags)); + BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey23, flags, SignatureChecker(txTo23, 0))); keys.clear(); keys.push_back(key1); keys.push_back(key3); CScript goodsig2 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey23, txTo23, 0, flags)); + BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey23, flags, SignatureChecker(txTo23, 0))); keys.clear(); keys.push_back(key2); keys.push_back(key3); CScript goodsig3 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(VerifyScript(goodsig3, scriptPubKey23, txTo23, 0, flags)); + BOOST_CHECK(VerifyScript(goodsig3, scriptPubKey23, flags, SignatureChecker(txTo23, 0))); keys.clear(); keys.push_back(key2); keys.push_back(key2); // Can't re-use sig CScript badsig1 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey23, txTo23, 0, flags)); + BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey23, flags, SignatureChecker(txTo23, 0))); keys.clear(); keys.push_back(key2); keys.push_back(key1); // sigs must be in correct order CScript badsig2 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig2, scriptPubKey23, txTo23, 0, flags)); + BOOST_CHECK(!VerifyScript(badsig2, scriptPubKey23, flags, SignatureChecker(txTo23, 0))); keys.clear(); keys.push_back(key3); keys.push_back(key2); // sigs must be in correct order CScript badsig3 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig3, scriptPubKey23, txTo23, 0, flags)); + BOOST_CHECK(!VerifyScript(badsig3, scriptPubKey23, flags, SignatureChecker(txTo23, 0))); keys.clear(); keys.push_back(key4); keys.push_back(key2); // sigs must match pubkeys CScript badsig4 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig4, scriptPubKey23, txTo23, 0, flags)); + BOOST_CHECK(!VerifyScript(badsig4, scriptPubKey23, flags, SignatureChecker(txTo23, 0))); keys.clear(); keys.push_back(key1); keys.push_back(key4); // sigs must match pubkeys CScript badsig5 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig5, scriptPubKey23, txTo23, 0, flags)); + BOOST_CHECK(!VerifyScript(badsig5, scriptPubKey23, flags, SignatureChecker(txTo23, 0))); keys.clear(); // Must have signatures CScript badsig6 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig6, scriptPubKey23, txTo23, 0, flags)); + BOOST_CHECK(!VerifyScript(badsig6, scriptPubKey23, flags, SignatureChecker(txTo23, 0))); } BOOST_AUTO_TEST_CASE(script_combineSigs) diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 83116b51e5..823afa1680 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -27,7 +27,6 @@ using namespace boost::algorithm; // In script_tests.cpp extern Array read_json(const std::string& jsondata); -// Note how NOCACHE is not included as it is a runtime-only flag. static std::map mapFlagNames = boost::assign::map_list_of (string("NONE"), (unsigned int)SCRIPT_VERIFY_NONE) (string("P2SH"), (unsigned int)SCRIPT_VERIFY_P2SH) @@ -139,7 +138,7 @@ BOOST_AUTO_TEST_CASE(tx_valid) unsigned int verify_flags = ParseScriptFlags(test[2].get_str()); BOOST_CHECK_MESSAGE(VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout], - tx, i, verify_flags), + verify_flags, SignatureChecker(tx, i)), strTest); } } @@ -212,7 +211,7 @@ BOOST_AUTO_TEST_CASE(tx_invalid) unsigned int verify_flags = ParseScriptFlags(test[2].get_str()); fValid = VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout], - tx, i, verify_flags); + verify_flags, SignatureChecker(tx, i)); } BOOST_CHECK_MESSAGE(!fValid, strTest); From 54510f267228e3f6934fdcf8d02d02a95a06d876 Mon Sep 17 00:00:00 2001 From: jtimon Date: Sun, 28 Sep 2014 06:33:33 +0200 Subject: [PATCH 0822/1288] DRY: Avoid repetitions in script_test --- src/test/script_tests.cpp | 37 +++++++------------------------------ 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 7f09b3daa1..48a5635d8f 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -70,7 +70,7 @@ CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey) return txCredit; } -CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CTransaction& txCredit) +CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CMutableTransaction& txCredit) { CMutableTransaction txSpend; txSpend.nVersion = 1; @@ -521,16 +521,8 @@ BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG12) CScript scriptPubKey12; scriptPubKey12 << OP_1 << key1.GetPubKey() << key2.GetPubKey() << OP_2 << OP_CHECKMULTISIG; - CMutableTransaction txFrom12; - txFrom12.vout.resize(1); - txFrom12.vout[0].scriptPubKey = scriptPubKey12; - - CMutableTransaction txTo12; - txTo12.vin.resize(1); - txTo12.vout.resize(1); - txTo12.vin[0].prevout.n = 0; - txTo12.vin[0].prevout.hash = txFrom12.GetHash(); - txTo12.vout[0].nValue = 1; + CMutableTransaction txFrom12 = BuildCreditingTransaction(scriptPubKey12); + CMutableTransaction txTo12 = BuildSpendingTransaction(CScript(), txFrom12); CScript goodsig1 = sign_multisig(scriptPubKey12, key1, txTo12); BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey12, txTo12, 0, flags)); @@ -555,16 +547,8 @@ BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG23) CScript scriptPubKey23; scriptPubKey23 << OP_2 << key1.GetPubKey() << key2.GetPubKey() << key3.GetPubKey() << OP_3 << OP_CHECKMULTISIG; - CMutableTransaction txFrom23; - txFrom23.vout.resize(1); - txFrom23.vout[0].scriptPubKey = scriptPubKey23; - - CMutableTransaction txTo23; - txTo23.vin.resize(1); - txTo23.vout.resize(1); - txTo23.vin[0].prevout.n = 0; - txTo23.vin[0].prevout.hash = txFrom23.GetHash(); - txTo23.vout[0].nValue = 1; + CMutableTransaction txFrom23 = BuildCreditingTransaction(scriptPubKey23); + CMutableTransaction txTo23 = BuildSpendingTransaction(CScript(), txFrom23); std::vector keys; keys.push_back(key1); keys.push_back(key2); @@ -626,17 +610,10 @@ BOOST_AUTO_TEST_CASE(script_combineSigs) keystore.AddKey(key); } - CMutableTransaction txFrom; - txFrom.vout.resize(1); - txFrom.vout[0].scriptPubKey = GetScriptForDestination(keys[0].GetPubKey().GetID()); + CMutableTransaction txFrom = BuildCreditingTransaction(GetScriptForDestination(keys[0].GetPubKey().GetID())); + CMutableTransaction txTo = BuildSpendingTransaction(CScript(), txFrom); CScript& scriptPubKey = txFrom.vout[0].scriptPubKey; - CMutableTransaction txTo; - txTo.vin.resize(1); - txTo.vout.resize(1); - txTo.vin[0].prevout.n = 0; - txTo.vin[0].prevout.hash = txFrom.GetHash(); CScript& scriptSig = txTo.vin[0].scriptSig; - txTo.vout[0].nValue = 1; CScript empty; CScript combined = CombineSignatures(scriptPubKey, txTo, 0, empty, empty); From b9b2e3fabd36b9f93b09c2deb53aa626c26df9e2 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 2 Oct 2014 22:17:57 +0200 Subject: [PATCH 0823/1288] Don't translate state.Abort() messages There is only one message passed to AbortNode() that makes sense to translate to the user specifically: Disk space is low. For the others show a generic message and refer to debug.log for details. Reduces the number of confusing jargon translation messages. --- src/main.cpp | 38 ++++++++++++++++++++------------------ src/main.h | 2 +- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 55485c86ff..793b3511aa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1688,7 +1688,7 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C if (!FindUndoPos(state, pindex->nFile, pos, ::GetSerializeSize(blockundo, SER_DISK, CLIENT_VERSION) + 40)) return error("ConnectBlock() : FindUndoPos failed"); if (!blockundo.WriteToDisk(pos, pindex->pprev->GetBlockHash())) - return state.Abort(_("Failed to write undo data")); + return state.Abort("Failed to write undo data"); // update nUndoPos in block index pindex->nUndoPos = pos.nPos; @@ -1699,12 +1699,12 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C CDiskBlockIndex blockindex(pindex); if (!pblocktree->WriteBlockIndex(blockindex)) - return state.Abort(_("Failed to write block index")); + return state.Abort("Failed to write block index"); } if (fTxIndex) if (!pblocktree->WriteTxIndex(vPos)) - return state.Abort(_("Failed to write transaction index")); + return state.Abort("Failed to write transaction index"); // add this block to the view's block chain bool ret; @@ -1739,7 +1739,7 @@ bool static WriteChainState(CValidationState &state) { FlushBlockFile(); pblocktree->Sync(); if (!pcoinsTip->Flush()) - return state.Abort(_("Failed to write to coin database")); + return state.Abort("Failed to write to coin database"); nLastWrite = GetTimeMicros(); } return true; @@ -1787,7 +1787,7 @@ bool static DisconnectTip(CValidationState &state) { // Read block from disk. CBlock block; if (!ReadBlockFromDisk(block, pindexDelete)) - return state.Abort(_("Failed to read block")); + return state.Abort("Failed to read block"); // Apply the block atomically to the chain state. int64_t nStart = GetTimeMicros(); { @@ -1836,7 +1836,7 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock * CBlock block; if (!pblock) { if (!ReadBlockFromDisk(block, pindexNew)) - return state.Abort(_("Failed to read block")); + return state.Abort("Failed to read block"); pblock = █ } // Apply the block atomically to the chain state. @@ -1990,7 +1990,7 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo CheckForkWarningConditions(); if (!pblocktree->Flush()) - return state.Abort(_("Failed to sync block index")); + return state.Abort("Failed to sync block index"); return true; } @@ -2097,7 +2097,7 @@ bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBl setBlockIndexValid.insert(pindexNew); if (!pblocktree->WriteBlockIndex(CDiskBlockIndex(pindexNew))) - return state.Abort(_("Failed to write block index")); + return state.Abort("Failed to write block index"); return true; } @@ -2149,7 +2149,7 @@ bool FindBlockPos(CValidationState &state, CDiskBlockPos &pos, unsigned int nAdd } if (!pblocktree->WriteBlockFileInfo(nLastBlockFile, infoLastBlockFile)) - return state.Abort(_("Failed to write file info")); + return state.Abort("Failed to write file info"); if (fUpdatedLast) pblocktree->WriteLastBlockFile(nLastBlockFile); @@ -2167,15 +2167,15 @@ bool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos, unsigne pos.nPos = infoLastBlockFile.nUndoSize; nNewSize = (infoLastBlockFile.nUndoSize += nAddSize); if (!pblocktree->WriteBlockFileInfo(nLastBlockFile, infoLastBlockFile)) - return state.Abort(_("Failed to write block info")); + return state.Abort("Failed to write block info"); } else { CBlockFileInfo info; if (!pblocktree->ReadBlockFileInfo(nFile, info)) - return state.Abort(_("Failed to read block info")); + return state.Abort("Failed to read block info"); pos.nPos = info.nUndoSize; nNewSize = (info.nUndoSize += nAddSize); if (!pblocktree->WriteBlockFileInfo(nFile, info)) - return state.Abort(_("Failed to write block info")); + return state.Abort("Failed to write block info"); } unsigned int nOldChunks = (pos.nPos + UNDOFILE_CHUNK_SIZE - 1) / UNDOFILE_CHUNK_SIZE; @@ -2392,11 +2392,11 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex, return error("AcceptBlock() : FindBlockPos failed"); if (dbp == NULL) if (!WriteBlockToDisk(block, blockPos)) - return state.Abort(_("Failed to write block")); + return state.Abort("Failed to write block"); if (!ReceivedBlockTransactions(block, state, pindex, blockPos)) return error("AcceptBlock() : ReceivedBlockTransactions failed"); } catch(std::runtime_error &e) { - return state.Abort(_("System error: ") + e.what()); + return state.Abort(std::string("System error: ") + e.what()); } return true; @@ -2719,10 +2719,12 @@ uint256 CPartialMerkleTree::ExtractMatches(std::vector &vMatch) { -bool AbortNode(const std::string &strMessage) { +bool AbortNode(const std::string &strMessage, const std::string &userMessage) { strMiscWarning = strMessage; LogPrintf("*** %s\n", strMessage); - uiInterface.ThreadSafeMessageBox(strMessage, "", CClientUIInterface::MSG_ERROR); + uiInterface.ThreadSafeMessageBox( + userMessage.empty() ? _("Error: A fatal internal error occured, see debug.log for details") : userMessage, + "", CClientUIInterface::MSG_ERROR); StartShutdown(); return false; } @@ -2733,7 +2735,7 @@ bool CheckDiskSpace(uint64_t nAdditionalBytes) // Check for nMinDiskSpace bytes (currently 50MB) if (nFreeBytesAvailable < nMinDiskSpace + nAdditionalBytes) - return AbortNode(_("Error: Disk space is low!")); + return AbortNode("Disk space is low!", _("Error: Disk space is low!")); return true; } @@ -3143,7 +3145,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp) } fclose(fileIn); } catch(std::runtime_error &e) { - AbortNode(_("Error: system error: ") + e.what()); + AbortNode(std::string("System error: ") + e.what()); } if (nLoaded > 0) LogPrintf("Loaded %i blocks from external file in %dms\n", nLoaded, GetTimeMillis() - nStart); diff --git a/src/main.h b/src/main.h index 7e849505dd..156a0af19f 100644 --- a/src/main.h +++ b/src/main.h @@ -177,7 +177,7 @@ CAmount GetBlockValue(int nHeight, const CAmount& nFees); /** Create a new block index entry for a given block hash */ CBlockIndex * InsertBlockIndex(uint256 hash); /** Abort with a message */ -bool AbortNode(const std::string &msg); +bool AbortNode(const std::string &msg, const std::string &userMessage=""); /** Get statistics from node state */ bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats); /** Increase a node's misbehavior score. */ From eb6b3b245cab5bb172ba27a0072edf9c2de32c29 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 2 Oct 2014 22:20:23 +0200 Subject: [PATCH 0824/1288] Update English translation --- src/qt/bitcoinstrings.cpp | 16 +- src/qt/locale/bitcoin_en.ts | 346 ++++++++++++++++-------------------- 2 files changed, 161 insertions(+), 201 deletions(-) diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index 3b4b40aae3..25c811183f 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -195,21 +195,11 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet corrupted"), QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet requires newer version of Bitcoin Core"), QT_TRANSLATE_NOOP("bitcoin-core", "Error opening block database"), QT_TRANSLATE_NOOP("bitcoin-core", "Error"), +QT_TRANSLATE_NOOP("bitcoin-core", "Error: A fatal internal error occured, see debug.log for details"), QT_TRANSLATE_NOOP("bitcoin-core", "Error: Disk space is low!"), QT_TRANSLATE_NOOP("bitcoin-core", "Error: Unsupported argument -tor found, use -onion."), QT_TRANSLATE_NOOP("bitcoin-core", "Error: Wallet locked, unable to create transaction!"), -QT_TRANSLATE_NOOP("bitcoin-core", "Error: system error: "), QT_TRANSLATE_NOOP("bitcoin-core", "Failed to listen on any port. Use -listen=0 if you want this."), -QT_TRANSLATE_NOOP("bitcoin-core", "Failed to read block info"), -QT_TRANSLATE_NOOP("bitcoin-core", "Failed to read block"), -QT_TRANSLATE_NOOP("bitcoin-core", "Failed to sync block index"), -QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write block index"), -QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write block info"), -QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write block"), -QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write file info"), -QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write to coin database"), -QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write transaction index"), -QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write undo data"), QT_TRANSLATE_NOOP("bitcoin-core", "Fee (in BTC/kB) to add to transactions you send (default: %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "Force safe mode (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "Generate coins (default: 0)"), @@ -231,6 +221,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -paytxfee=: '%s'") QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid netmask specified in -whitelist: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Keep at most unconnectable blocks in memory (default: %u)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Keep at most unconnectable transactions in memory (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Limit size of signature cache to entries (default: 50000)"), QT_TRANSLATE_NOOP("bitcoin-core", "Listen for connections on (default: 8333 or testnet: 18333)"), QT_TRANSLATE_NOOP("bitcoin-core", "Loading addresses..."), @@ -245,7 +236,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Need to specify a port with -whitebind: '%s'" QT_TRANSLATE_NOOP("bitcoin-core", "Node relay options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Not enough file descriptors available."), QT_TRANSLATE_NOOP("bitcoin-core", "Only accept block chain matching built-in checkpoints (default: 1)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Only connect to nodes in network (IPv4, IPv6 or Tor)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Only connect to nodes in network (ipv4, ipv6 or onion)"), QT_TRANSLATE_NOOP("bitcoin-core", "Options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Password for JSON-RPC connections"), QT_TRANSLATE_NOOP("bitcoin-core", "Prepend debug output with timestamp (default: 1)"), @@ -282,7 +273,6 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Specify wallet file (within data directory)") QT_TRANSLATE_NOOP("bitcoin-core", "Specify your own public address"), QT_TRANSLATE_NOOP("bitcoin-core", "Spend unconfirmed change when sending transactions (default: 1)"), QT_TRANSLATE_NOOP("bitcoin-core", "Stop running after importing blocks from disk (default: 0)"), -QT_TRANSLATE_NOOP("bitcoin-core", "System error: "), QT_TRANSLATE_NOOP("bitcoin-core", "This help message"), QT_TRANSLATE_NOOP("bitcoin-core", "This is experimental software."), QT_TRANSLATE_NOOP("bitcoin-core", "This is intended for regression testing tools and app development."), diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index a527602b5a..5c3abef2e7 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -19,7 +19,7 @@ - + Copy the currently selected address to the system clipboard Copy the currently selected address to the system clipboard @@ -29,7 +29,7 @@ - + C&lose @@ -39,12 +39,12 @@ &Copy Address - + Delete the currently selected address from the list Delete the currently selected address from the list - + Export the data in the current tab to a file Export the data in the current tab to a file @@ -54,7 +54,7 @@ &Export - + &Delete &Delete @@ -286,17 +286,17 @@ BitcoinGUI - + Sign &message... Sign &message... - + Synchronizing with network... Synchronizing with network... - + &Overview &Overview @@ -377,13 +377,13 @@ - + Bitcoin Core client - + Importing blocks from disk... Importing blocks from disk... @@ -393,7 +393,7 @@ Reindexing blocks on disk... - + Send coins to a Bitcoin address Send coins to a Bitcoin address @@ -428,12 +428,12 @@ &Verify message... - + Bitcoin Bitcoin - + Wallet Wallet @@ -500,12 +500,12 @@ - + [testnet] [testnet] - + Bitcoin Core Bitcoin Core @@ -546,7 +546,7 @@ - + %n active connection(s) to Bitcoin network %n active connection to Bitcoin network @@ -554,7 +554,7 @@ - + No block source available... No block source available... @@ -665,7 +665,7 @@ Address: %4 - + Wallet is <b>encrypted</b> and currently <b>unlocked</b> Wallet is <b>encrypted</b> and currently <b>unlocked</b> @@ -678,7 +678,7 @@ Address: %4 ClientModel - + Network Alert Network Alert @@ -736,7 +736,7 @@ Address: %4 - + Tree mode @@ -1059,7 +1059,7 @@ Address: %4 HelpMessageDialog - + Bitcoin Core Bitcoin Core @@ -1201,7 +1201,7 @@ Address: %4 - + Select payment request file @@ -1430,12 +1430,12 @@ Address: %4 &OK - + &Cancel &Cancel - + default default @@ -1479,23 +1479,18 @@ Address: %4 Form - - + + The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - - Wallet - Wallet - - - + Watch-only: - + Available: @@ -1505,62 +1500,72 @@ Address: %4 Your current spendable balance - + Pending: - + Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - + Immature: Immature: - + Mined balance that has not yet matured Mined balance that has not yet matured - + + Balances + + + + Total: Total: - + Your current total balance Your current total balance - + Your current balance in watch-only addresses - + + Spendable: + + + + + Recent transactions + + + + Unconfirmed transactions to watch-only addresses - + Mined balance in watch-only addresses that has not yet matured - + Current total balance in watch-only addresses - - <b>Recent transactions</b> - <b>Recent transactions</b> - - - + out of sync out of sync @@ -1569,7 +1574,7 @@ Address: %4 PaymentServer - + URI handling @@ -1681,7 +1686,7 @@ Address: %4 PeerTableModel - + User Agent @@ -1699,17 +1704,17 @@ Address: %4 QObject - + Amount Amount - + Enter a Bitcoin address (e.g. %1) - + %1 d @@ -1795,7 +1800,7 @@ Address: %4 - + @@ -1813,7 +1818,7 @@ Address: %4 N/A - + Client version Client version @@ -1873,7 +1878,7 @@ Address: %4 Current number of blocks - + Received @@ -1889,7 +1894,7 @@ Address: %4 - + Select a peer to view detailed information. @@ -1965,7 +1970,7 @@ Address: %4 - + Last block time Last block time @@ -1990,7 +1995,7 @@ Address: %4 - + Totals @@ -2005,7 +2010,7 @@ Address: %4 - + Build date Build date @@ -2163,12 +2168,12 @@ Address: %4 - + Requested payments history - + &Request payment @@ -2183,7 +2188,7 @@ Address: %4 - + Remove the selected entries from the list @@ -2221,12 +2226,12 @@ Address: %4 - + Copy &Address - + &Save Image... @@ -2279,7 +2284,7 @@ Address: %4 RecentRequestsTableModel - + Date Date @@ -2333,7 +2338,7 @@ Address: %4 - + automatically selected @@ -2398,22 +2403,22 @@ Address: %4 Add &Recipient - + Clear all fields of the form. - + Dust: - + Clear &All Clear &All - + Balance: Balance: @@ -2653,7 +2658,7 @@ Address: %4 ShutdownWindow - + Bitcoin Core is shutting down... @@ -2671,7 +2676,7 @@ Address: %4 Signatures - Sign / Verify a Message - + &Sign Message &Sign Message @@ -2848,7 +2853,7 @@ Address: %4 SplashScreen - + Bitcoin Core Bitcoin Core @@ -2874,7 +2879,7 @@ Address: %4 TransactionDesc - + Open until %1 Open until %1 @@ -3098,7 +3103,7 @@ Address: %4 TransactionTableModel - + Date Date @@ -3166,7 +3171,7 @@ Address: %4 - + Received with Received with @@ -3191,12 +3196,17 @@ Address: %4 Mined - + + watch-only + + + + (n/a) (n/a) - + Transaction status. Hover over this field to show number of confirmations. Transaction status. Hover over this field to show number of confirmations. @@ -3210,6 +3220,11 @@ Address: %4 Type of transaction. Type of transaction. + + + Whether or not a watch-only address is involved in this transaction. + + Destination address of transaction. @@ -3224,7 +3239,7 @@ Address: %4 TransactionView - + All All @@ -3325,12 +3340,17 @@ Address: %4 Show transaction details - + Export Transaction History - + + Watch-only + + + + Exporting Failed @@ -3350,7 +3370,7 @@ Address: %4 - + Comma separated file (*.csv) Comma separated file (*.csv) @@ -3360,7 +3380,7 @@ Address: %4 Confirmed - + Date Date @@ -3398,7 +3418,7 @@ Address: %4 UnitDisplayStatusBarControl - + Unit to show amounts in. Click to select another unit. @@ -3465,7 +3485,7 @@ Address: %4 bitcoin-core - + Options: Options: @@ -3495,22 +3515,22 @@ Address: %4 Maintain at most <n> connections to peers (default: 125) - + Connect to a node to retrieve peer addresses, and disconnect Connect to a node to retrieve peer addresses, and disconnect - + Specify your own public address Specify your own public address - + Threshold for disconnecting misbehaving peers (default: 100) Threshold for disconnecting misbehaving peers (default: 100) - + Number of seconds to keep misbehaving peers from reconnecting (default: 86400) Number of seconds to keep misbehaving peers from reconnecting (default: 86400) @@ -3525,17 +3545,17 @@ Address: %4 Accept command line and JSON-RPC commands - + Run in the background as a daemon and accept commands Run in the background as a daemon and accept commands - + Use the test network Use the test network - + Accept connections from outside (default: 1 if no -proxy or -connect) Accept connections from outside (default: 1 if no -proxy or -connect) @@ -3756,6 +3776,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. + Error: A fatal internal error occured, see debug.log for details + + + + Error: Disk space is low! Error: Disk space is low! @@ -3764,66 +3789,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error: Wallet locked, unable to create transaction! Error: Wallet locked, unable to create transaction! - - - Error: system error: - Error: system error: - Failed to listen on any port. Use -listen=0 if you want this. Failed to listen on any port. Use -listen=0 if you want this. - - - Failed to read block info - Failed to read block info - - - - Failed to read block - Failed to read block - - - - Failed to sync block index - Failed to sync block index - - - - Failed to write block index - Failed to write block index - - - - Failed to write block info - Failed to write block info - - - - Failed to write block - Failed to write block - - - - Failed to write file info - Failed to write file info - - - - Failed to write to coin database - Failed to write to coin database - - - - Failed to write transaction index - Failed to write transaction index - - - - Failed to write undo data - Failed to write undo data - Force safe mode (default: 0) @@ -3860,12 +3830,17 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - + Not enough file descriptors available. Not enough file descriptors available. - + + Only connect to nodes in network <net> (ipv4, ipv6 or onion) + + + + Prepend debug output with timestamp (default: 1) @@ -3905,7 +3880,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - + This is intended for regression testing tools and app development. @@ -3940,7 +3915,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Imports blocks from external blk000??.dat file - + (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) @@ -4080,12 +4055,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - + Error: Unsupported argument -tor found, use -onion. - + Fee (in BTC/kB) to add to transactions you send (default: %s) @@ -4129,6 +4104,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Keep at most <n> unconnectable blocks in memory (default: %u) + + + Keep at most <n> unconnectable transactions in memory (default: %u) + + Limit size of signature cache to <n> entries (default: 50000) @@ -4170,12 +4150,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Only accept block chain matching built-in checkpoints (default: 1) - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - - - + Print block on startup, if found in block index @@ -4255,12 +4230,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Specify connection timeout in milliseconds (default: 5000) - - System error: - System error: - - - + This is experimental software. @@ -4340,22 +4310,22 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. wallet.dat corrupt, salvage failed - + Password for JSON-RPC connections Password for JSON-RPC connections - + Execute command when the best block changes (%s in cmd is replaced by block hash) Execute command when the best block changes (%s in cmd is replaced by block hash) - + Upgrade wallet to latest format Upgrade wallet to latest format - + Set key pool size to <n> (default: 100) Set key pool size to <n> (default: 100) @@ -4365,12 +4335,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Rescan the block chain for missing wallet transactions - + Use OpenSSL (https) for JSON-RPC connections Use OpenSSL (https) for JSON-RPC connections - + Server certificate file (default: server.cert) Server certificate file (default: server.cert) @@ -4380,22 +4350,22 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Server private key (default: server.pem) - + This help message This help message - + Allow DNS lookups for -addnode, -seednode and -connect Allow DNS lookups for -addnode, -seednode and -connect - + Loading addresses... Loading addresses... - + Error loading wallet.dat: Wallet corrupted Error loading wallet.dat: Wallet corrupted @@ -4405,7 +4375,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat - + Invalid -proxy address: '%s' Invalid -proxy address: '%s' @@ -4415,7 +4385,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Unknown network specified in -onlynet: '%s' - + Cannot resolve -bind address: '%s' Cannot resolve -bind address: '%s' @@ -4425,7 +4395,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Cannot resolve -externalip address: '%s' - + Invalid amount for -paytxfee=<amount>: '%s' Invalid amount for -paytxfee=<amount>: '%s' @@ -4440,22 +4410,22 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Insufficient funds - + Loading block index... Loading block index... - + Add a node to connect to and attempt to keep the connection open Add a node to connect to and attempt to keep the connection open - + Loading wallet... Loading wallet... - + Cannot downgrade wallet Cannot downgrade wallet @@ -4465,22 +4435,22 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Cannot write default address - + Rescanning... Rescanning... - + Done loading Done loading - + To use the %s option To use the %s option - + Error Error From c9c51cba4e3e1905c154ecf9f6559ced7606dc75 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 2 Oct 2014 13:15:59 -0700 Subject: [PATCH 0825/1288] Make comptool more deterministic --- depends/packages/native_comparisontool.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/depends/packages/native_comparisontool.mk b/depends/packages/native_comparisontool.mk index 4c40f8b123..3d430d4306 100644 --- a/depends/packages/native_comparisontool.mk +++ b/depends/packages/native_comparisontool.mk @@ -1,8 +1,8 @@ package=native_comparisontool -$(package)_version=5caed78 -$(package)_download_path=https://github.com/TheBlueMatt/test-scripts/raw/2d76ce92d68e6746988adde731318605a70e252c +$(package)_version=0f7b5d8 +$(package)_download_path=https://github.com/TheBlueMatt/test-scripts/raw/38b490a2599d422b12d5ce8f165792f63fd8f54f $(package)_file_name=pull-tests-$($(package)_version).jar -$(package)_sha256_hash=b55a98828b17060e327c5dabe5e4631898f422c0cba07c46170930a9eaf5e7c0 +$(package)_sha256_hash=ecd43b988a8b673b483e4f69f931596360a5e90fc415c75c4c259faa690df198 $(package)_install_dirname=BitcoindComparisonTool_jar $(package)_install_filename=BitcoindComparisonTool.jar From ccca27a788fe1ae13661308243c20a1d7a3d0074 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sat, 26 Jul 2014 21:05:11 +0200 Subject: [PATCH 0826/1288] [Wallet] Watch-only fixes --- src/keystore.cpp | 7 +++++++ src/keystore.h | 2 ++ src/qt/transactionrecord.cpp | 2 +- src/qt/walletmodel.cpp | 3 ++- src/rpcdump.cpp | 5 ++--- src/rpcwallet.cpp | 2 +- src/wallet.cpp | 21 +++++++++++++++++++++ src/wallet.h | 34 +++++++++++++++++++++++++++------- src/walletdb.cpp | 6 ++++++ src/walletdb.h | 1 + 10 files changed, 70 insertions(+), 13 deletions(-) diff --git a/src/keystore.cpp b/src/keystore.cpp index 98bc0e9e28..755defa26d 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -67,6 +67,13 @@ bool CBasicKeyStore::AddWatchOnly(const CScript &dest) return true; } +bool CBasicKeyStore::RemoveWatchOnly(const CScript &dest) +{ + LOCK(cs_KeyStore); + setWatchOnly.erase(dest); + return true; +} + bool CBasicKeyStore::HaveWatchOnly(const CScript &dest) const { LOCK(cs_KeyStore); diff --git a/src/keystore.h b/src/keystore.h index 3b49e282d9..d3478f7672 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -40,6 +40,7 @@ public: // Support for Watch-only addresses virtual bool AddWatchOnly(const CScript &dest) =0; + virtual bool RemoveWatchOnly(const CScript &dest) =0; virtual bool HaveWatchOnly(const CScript &dest) const =0; virtual bool HaveWatchOnly() const =0; }; @@ -98,6 +99,7 @@ public: virtual bool GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const; virtual bool AddWatchOnly(const CScript &dest); + virtual bool RemoveWatchOnly(const CScript &dest); virtual bool HaveWatchOnly(const CScript &dest) const; virtual bool HaveWatchOnly() const; }; diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index afb343f349..5278c8673a 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -32,7 +32,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * { QList parts; int64_t nTime = wtx.GetTxTime(); - CAmount nCredit = wtx.GetCredit(true); + CAmount nCredit = wtx.GetCredit(ISMINE_ALL); CAmount nDebit = wtx.GetDebit(ISMINE_ALL); CAmount nNet = nCredit - nDebit; uint256 hash = wtx.GetHash(); diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index b8701a23a6..b4733d369e 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -605,7 +605,8 @@ void WalletModel::listCoins(std::map >& mapCoins) int nDepth = wallet->mapWallet[outpoint.hash].GetDepthInMainChain(); if (nDepth < 0) continue; COutput out(&wallet->mapWallet[outpoint.hash], outpoint.n, nDepth, true); - vCoins.push_back(out); + if (outpoint.n < out.tx->vout.size() && wallet->IsMine(out.tx->vout[outpoint.n]) == ISMINE_SPENDABLE) + vCoins.push_back(out); } BOOST_FOREACH(const COutput& out, vCoins) diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index 1ac7024550..9da0a7d091 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -114,8 +114,6 @@ Value importprivkey(const Array& params, bool fHelp) CPubKey pubkey = key.GetPubKey(); CKeyID vchAddress = pubkey.GetID(); { - LOCK2(cs_main, pwalletMain->cs_wallet); - pwalletMain->MarkDirty(); pwalletMain->SetAddressBook(vchAddress, strLabel, "receive"); @@ -181,7 +179,8 @@ Value importaddress(const Array& params, bool fHelp) fRescan = params[2].get_bool(); { - LOCK2(cs_main, pwalletMain->cs_wallet); + if (::IsMine(*pwalletMain, script) == ISMINE_SPENDABLE) + throw JSONRPCError(RPC_WALLET_ERROR, "The wallet already contains the private key for this address or script"); // add to address book or update label if (address.IsValid()) diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index d7c0c0ef5c..d11455e389 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1539,7 +1539,7 @@ Value gettransaction(const Array& params, bool fHelp) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid or non-wallet transaction id"); const CWalletTx& wtx = pwalletMain->mapWallet[hash]; - CAmount nCredit = wtx.GetCredit(filter != 0); + CAmount nCredit = wtx.GetCredit(filter); CAmount nDebit = wtx.GetDebit(filter); CAmount nNet = nCredit - nDebit; CAmount nFee = (wtx.IsFromMe(filter) ? wtx.GetValueOut() - nDebit : 0); diff --git a/src/wallet.cpp b/src/wallet.cpp index b20b0007ce..1653084495 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -87,6 +87,13 @@ bool CWallet::AddKeyPubKey(const CKey& secret, const CPubKey &pubkey) AssertLockHeld(cs_wallet); // mapKeyMetadata if (!CCryptoKeyStore::AddKeyPubKey(secret, pubkey)) return false; + + // check if we need to remove from watch-only + CScript script; + script = GetScriptForDestination(pubkey.GetID()); + if (HaveWatchOnly(script)) + RemoveWatchOnly(script); + if (!fFileBacked) return true; if (!IsCrypted()) { @@ -169,6 +176,20 @@ bool CWallet::AddWatchOnly(const CScript &dest) return CWalletDB(strWalletFile).WriteWatchOnly(dest); } +bool CWallet::RemoveWatchOnly(const CScript &dest) +{ + AssertLockHeld(cs_wallet); + if (!CCryptoKeyStore::RemoveWatchOnly(dest)) + return false; + if (!HaveWatchOnly()) + NotifyWatchonlyChanged(false); + if (fFileBacked) + if (!CWalletDB(strWalletFile).EraseWatchOnly(dest)) + return false; + + return true; +} + bool CWallet::LoadWatchOnly(const CScript &dest) { return CCryptoKeyStore::AddWatchOnly(dest); diff --git a/src/wallet.h b/src/wallet.h index f3fffb2253..1ccc29d3c8 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -222,6 +222,7 @@ public: // Adds a watch-only address to the store, and saves it to disk. bool AddWatchOnly(const CScript &dest); + bool RemoveWatchOnly(const CScript &dest); // Adds a watch-only address to the store, without saving it to disk (used by LoadWallet) bool LoadWatchOnly(const CScript &dest); @@ -701,18 +702,37 @@ public: return debit; } - CAmount GetCredit(bool fUseCache=true) const + CAmount GetCredit(const isminefilter& filter) const { // Must wait until coinbase is safely deep enough in the chain before valuing it if (IsCoinBase() && GetBlocksToMaturity() > 0) return 0; - // GetBalance can assume transactions in mapWallet won't change - if (fUseCache && fCreditCached) - return nCreditCached; - nCreditCached = pwallet->GetCredit(*this, ISMINE_ALL); - fCreditCached = true; - return nCreditCached; + int64_t credit = 0; + if (filter & ISMINE_SPENDABLE) + { + // GetBalance can assume transactions in mapWallet won't change + if (fCreditCached) + credit += nCreditCached; + else + { + nCreditCached = pwallet->GetCredit(*this, ISMINE_SPENDABLE); + fCreditCached = true; + credit += nCreditCached; + } + } + if (filter & ISMINE_WATCH_ONLY) + { + if (fWatchCreditCached) + credit += nWatchCreditCached; + else + { + nWatchCreditCached = pwallet->GetCredit(*this, ISMINE_WATCH_ONLY); + fWatchCreditCached = true; + credit += nWatchCreditCached; + } + } + return credit; } CAmount GetImmatureCredit(bool fUseCache=true) const diff --git a/src/walletdb.cpp b/src/walletdb.cpp index 3e5a664a5d..a851db65cd 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -121,6 +121,12 @@ bool CWalletDB::WriteWatchOnly(const CScript &dest) return Write(std::make_pair(std::string("watchs"), dest), '1'); } +bool CWalletDB::EraseWatchOnly(const CScript &dest) +{ + nWalletDBUpdated++; + return Erase(std::make_pair(std::string("watchs"), dest)); +} + bool CWalletDB::WriteBestBlock(const CBlockLocator& locator) { nWalletDBUpdated++; diff --git a/src/walletdb.h b/src/walletdb.h index f3d6e61f8b..7ff41c7c8d 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -96,6 +96,7 @@ public: bool WriteCScript(const uint160& hash, const CScript& redeemScript); bool WriteWatchOnly(const CScript &script); + bool EraseWatchOnly(const CScript &script); bool WriteBestBlock(const CBlockLocator& locator); bool ReadBestBlock(CBlockLocator& locator); From d6b0539f452527d340c6d7e6c57652147214196d Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 3 Oct 2014 17:34:34 -0400 Subject: [PATCH 0827/1288] travis: add non-default shell testing to travis. --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index eae07ead8e..89b2238655 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ matrix: - compiler: "true 3" env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" - compiler: "true 4" - env: HOST=i686-pc-linux-gnu PACKAGES="g++-multilib" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" + env: HOST=i686-pc-linux-gnu PACKAGES="g++-multilib" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" USE_SHELL="/bin/dash" - compiler: "true 5" env: HOST=x86_64-apple-darwin11 PACKAGES="gcc-multilib g++-multilib cmake libcap-dev libz-dev libbz2-dev" OSX_SDK=10.7 GOAL="deploy" - compiler: "true 6" @@ -48,11 +48,12 @@ before_script: - if [ -n "$OSX_SDK" -a -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then tar -C depends/SDKs -xf depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi - make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS || (echo "Build failure. Verbose build follows." && make -C depends V=1 HOST=$HOST $DEP_OPTS) script: + - if [ -n "$USE_SHELL" ]; then export CONFIG_SHELL="$USE_SHELL"; fi - OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST - BITCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$TRAVIS_BUILD_DIR/depends/$HOST --bindir=$OUTDIR/bin --libdir=$OUTDIR/lib" - depends/$HOST/native/bin/ccache --max-size=$CCACHE_SIZE - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then export CCACHE_READONLY=1; fi - - ./autogen.sh + - test -n "$USE_SHELL" && eval '"$USE_SHELL" -c "./autogen.sh"' || ./autogen.sh - ./configure --cache-file=config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false) - make distdir PACKAGE=bitcoin VERSION=$HOST - cd bitcoin-$HOST From b77b4eda8db4e7ebd7762d8543c713c15b207e90 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Fri, 3 Oct 2014 18:58:59 +0000 Subject: [PATCH 0828/1288] Bugfix: Replace bashisms with standard sh to fix build on non-BASH systems --- autogen.sh | 3 ++- build-aux/m4/bitcoin_qt.m4 | 32 ++++++++++++++++---------------- configure.ac | 34 ++++++++++++++++++---------------- 3 files changed, 36 insertions(+), 33 deletions(-) diff --git a/autogen.sh b/autogen.sh index ddfc09607e..3e26a18305 100755 --- a/autogen.sh +++ b/autogen.sh @@ -3,6 +3,7 @@ set -e srcdir="$(dirname $0)" cd "$srcdir" if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="`which glibtoolize 2>/dev/null`"; then - export LIBTOOLIZE="${GLIBTOOLIZE}" + LIBTOOLIZE="${GLIBTOOLIZE}" + export LIBTOOLIZE fi autoreconf --install --force --warnings=all diff --git a/build-aux/m4/bitcoin_qt.m4 b/build-aux/m4/bitcoin_qt.m4 index 71b1484894..2a72262653 100644 --- a/build-aux/m4/bitcoin_qt.m4 +++ b/build-aux/m4/bitcoin_qt.m4 @@ -84,7 +84,7 @@ dnl Outputs: bitcoin_enable_qt, bitcoin_enable_qt_dbus, bitcoin_enable_qt_test AC_DEFUN([BITCOIN_QT_CONFIGURE],[ use_pkgconfig=$1 - if test x$use_pkgconfig == x; then + if test x$use_pkgconfig = x; then use_pkgconfig=yes fi @@ -106,9 +106,9 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ BITCOIN_QT_CHECK([ TEMP_CPPFLAGS=$CPPFLAGS CPPFLAGS=$QT_INCLUDES - if test x$bitcoin_qt_got_major_vers == x5; then + if test x$bitcoin_qt_got_major_vers = x5; then _BITCOIN_QT_IS_STATIC - if test x$bitcoin_cv_static_qt == xyes; then + if test x$bitcoin_cv_static_qt = xyes; then AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) if test x$qt_plugin_path != x; then QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible" @@ -118,14 +118,14 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"]) fi _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(AccessibleFactory)], [-lqtaccessiblewidgets]) - if test x$TARGET_OS == xwindows; then + if test x$TARGET_OS = xwindows; then _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)],[-lqwindows]) AC_DEFINE(QT_QPA_PLATFORM_WINDOWS, 1, [Define this symbol if the qt platform is windows]) - elif test x$TARGET_OS == xlinux; then + elif test x$TARGET_OS = xlinux; then PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"]) _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)],[-lqxcb -lxcb-static]) AC_DEFINE(QT_QPA_PLATFORM_XCB, 1, [Define this symbol if the qt platform is xcb]) - elif test x$TARGET_OS == xdarwin; then + elif test x$TARGET_OS = xdarwin; then if test x$use_pkgconfig = xyes; then PKG_CHECK_MODULES([QTPRINT], [Qt5PrintSupport], [QT_LIBS="$QTPRINT_LIBS $QT_LIBS"]) fi @@ -135,7 +135,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ fi fi else - if test x$TARGET_OS == xwindows; then + if test x$TARGET_OS = xwindows; then AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) if test x$qt_plugin_path != x; then QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible" @@ -196,7 +196,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ if test x$use_dbus = xyes && test x$have_qt_dbus = xno; then AC_MSG_ERROR("libQtDBus not found. Install libQtDBus or remove --with-qtdbus.") fi - if test x$LUPDATE == x; then + if test x$LUPDATE = x; then AC_MSG_WARN("lupdate is required to update qt translations") fi ],[ @@ -291,10 +291,10 @@ dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no. AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[ m4_ifdef([PKG_CHECK_MODULES],[ auto_priority_version=$1 - if test x$auto_priority_version == x; then + if test x$auto_priority_version = x; then auto_priority_version=qt5 fi - if test x$bitcoin_qt_want_version == xqt5 || ( test x$bitcoin_qt_want_version == xauto && test x$auto_priority_version == xqt5 ); then + if test x$bitcoin_qt_want_version = xqt5 || ( test x$bitcoin_qt_want_version = xauto && test x$auto_priority_version = xqt5 ); then QT_LIB_PREFIX=Qt5 bitcoin_qt_got_major_vers=5 else @@ -304,14 +304,14 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[ qt5_modules="Qt5Core Qt5Gui Qt5Network Qt5Widgets" qt4_modules="QtCore QtGui QtNetwork" BITCOIN_QT_CHECK([ - if test x$bitcoin_qt_want_version == xqt5 || ( test x$bitcoin_qt_want_version == xauto && test x$auto_priority_version == xqt5 ); then + if test x$bitcoin_qt_want_version = xqt5 || ( test x$bitcoin_qt_want_version = xauto && test x$auto_priority_version = xqt5 ); then PKG_CHECK_MODULES([QT], [$qt5_modules], [QT_INCLUDES="$QT_CFLAGS"; have_qt=yes],[have_qt=no]) - elif test x$bitcoin_qt_want_version == xqt4 || ( test x$bitcoin_qt_want_version == xauto && test x$auto_priority_version == xqt4 ); then + elif test x$bitcoin_qt_want_version = xqt4 || ( test x$bitcoin_qt_want_version = xauto && test x$auto_priority_version = xqt4 ); then PKG_CHECK_MODULES([QT], [$qt4_modules], [QT_INCLUDES="$QT_CFLAGS"; have_qt=yes], [have_qt=no]) fi dnl qt version is set to 'auto' and the preferred version wasn't found. Now try the other. - if test x$have_qt == xno && test x$bitcoin_qt_want_version == xauto; then + if test x$have_qt = xno && test x$bitcoin_qt_want_version = xauto; then if test x$auto_priority_version = x$qt5; then PKG_CHECK_MODULES([QT], [$qt4_modules], [QT_INCLUDES="$QT_CFLAGS"; have_qt=yes; QT_LIB_PREFIX=Qt; bitcoin_qt_got_major_vers=4], [have_qt=no]) else @@ -358,7 +358,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ if test x$bitcoin_qt_want_version = xauto; then _BITCOIN_QT_CHECK_QT5 fi - if test x$bitcoin_cv_qt5 == xyes || test x$bitcoin_qt_want_version = xqt5; then + if test x$bitcoin_cv_qt5 = xyes || test x$bitcoin_qt_want_version = xqt5; then QT_LIB_PREFIX=Qt5 bitcoin_qt_got_major_vers=5 else @@ -373,7 +373,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ LIBS="$LIBS -L$qt_lib_path" fi - if test x$TARGET_OS == xwindows; then + if test x$TARGET_OS = xwindows; then AC_CHECK_LIB([imm32], [main],, BITCOIN_QT_FAIL(libimm32 not found)) fi ]) @@ -385,7 +385,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Core] ,[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXCore not found))) BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Gui] ,[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXGui not found))) BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Network],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXNetwork not found))) - if test x$bitcoin_qt_got_major_vers == x5; then + if test x$bitcoin_qt_got_major_vers = x5; then BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Widgets],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXWidgets not found))) fi QT_LIBS="$LIBS" diff --git a/configure.ac b/configure.ac index abf9f39e65..0bd309a3a8 100644 --- a/configure.ac +++ b/configure.ac @@ -250,14 +250,16 @@ case $host in bdb_prefix=`$BREW --prefix berkeley-db4 2>/dev/null` qt5_prefix=`$BREW --prefix qt5 2>/dev/null` if test x$openssl_prefix != x; then - export PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" + PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" + export PKG_CONFIG_PATH fi if test x$bdb_prefix != x; then CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include" LIBS="$LIBS -L$bdb_prefix/lib" fi if test x$qt5_prefix != x; then - export PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" + PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" + export PKG_CONFIG_PATH fi fi else @@ -287,7 +289,7 @@ if test x$use_comparison_tool != xno; then fi if test x$use_comparison_tool_reorg_tests != xno; then - if test x$use_comparison_tool == x; then + if test x$use_comparison_tool = x; then AC_MSG_ERROR("comparison tool reorg tests but comparison tool was not specified") fi AC_SUBST(COMPARISON_TOOL_REORG_TESTS, 1) @@ -295,20 +297,20 @@ else AC_SUBST(COMPARISON_TOOL_REORG_TESTS, 0) fi -if test x$use_lcov == xyes; then - if test x$LCOV == x; then +if test x$use_lcov = xyes; then + if test x$LCOV = x; then AC_MSG_ERROR("lcov testing requested but lcov not found") fi - if test x$GCOV == x; then + if test x$GCOV = x; then AC_MSG_ERROR("lcov testing requested but gcov not found") fi - if test x$JAVA == x; then + if test x$JAVA = x; then AC_MSG_ERROR("lcov testing requested but java not found") fi - if test x$GENHTML == x; then + if test x$GENHTML = x; then AC_MSG_ERROR("lcov testing requested but genhtml not found") fi - if test x$use_comparison_tool == x; then + if test x$use_comparison_tool = x; then AC_MSG_ERROR("lcov testing requested but comparison tool was not specified") fi LCOV="$LCOV --gcov-tool=$GCOV" @@ -607,7 +609,7 @@ BITCOIN_QT_INIT if test x$use_pkgconfig = xyes; then - if test x"$PKG_CONFIG" == "x"; then + if test x"$PKG_CONFIG" = "x"; then AC_MSG_ERROR(pkg-config not found.) fi @@ -721,7 +723,7 @@ if test x$bitcoin_enable_qt != xno; then dnl enable qr support AC_MSG_CHECKING([whether to build GUI with support for QR codes]) if test x$have_qrencode = xno; then - if test x$use_qr == xyes; then + if test x$use_qr = xyes; then AC_MSG_ERROR("QR support requested but cannot be built. use --without-qrencode") fi AC_MSG_RESULT(no) @@ -735,7 +737,7 @@ if test x$bitcoin_enable_qt != xno; then fi fi - if test x$XGETTEXT == x; then + if test x$XGETTEXT = x; then AC_MSG_WARN("xgettext is required to update qt translations") fi @@ -770,12 +772,12 @@ fi AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin]) AM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin]) AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows]) -AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet == xyes]) -AM_CONDITIONAL([ENABLE_TESTS],[test x$use_tests == xyes]) -AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt == xyes]) +AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet = xyes]) +AM_CONDITIONAL([ENABLE_TESTS],[test x$use_tests = xyes]) +AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt = xyes]) AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$use_tests$bitcoin_enable_qt_test = xyesyes]) AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes]) -AM_CONDITIONAL([USE_LCOV],[test x$use_lcov == xyes]) +AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes]) AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno]) AM_CONDITIONAL([USE_COMPARISON_TOOL_REORG_TESTS],[test x$use_comparison_tool_reorg_test != xno]) AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes]) From ab72068565e4417799843d2445da39d9e98efffd Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Fri, 3 Oct 2014 18:58:59 +0000 Subject: [PATCH 0829/1288] Bugfix: Replace bashisms with standard sh in gitian descriptors --- contrib/gitian-descriptors/boost-win.yml | 2 +- contrib/gitian-descriptors/deps-win.yml | 4 ++-- contrib/gitian-descriptors/gitian-win.yml | 4 ++-- contrib/gitian-descriptors/protobuf-win.yml | 2 +- contrib/gitian-descriptors/qt-linux.yml | 4 ++-- contrib/gitian-descriptors/qt-win.yml | 2 +- depends/config.site.in | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/contrib/gitian-descriptors/boost-win.yml b/contrib/gitian-descriptors/boost-win.yml index db5d6bab1d..347952e3a6 100644 --- a/contrib/gitian-descriptors/boost-win.yml +++ b/contrib/gitian-descriptors/boost-win.yml @@ -29,7 +29,7 @@ script: | # INSTALLPREFIX=$HOME/staging${BITS} BUILDDIR=$HOME/build${BITS} - if [ "$BITS" == "32" ]; then + if [ "x$BITS" = "x32" ]; then HOST=i686-w64-mingw32 else HOST=x86_64-w64-mingw32 diff --git a/contrib/gitian-descriptors/deps-win.yml b/contrib/gitian-descriptors/deps-win.yml index fabc2949eb..fe02950ef9 100644 --- a/contrib/gitian-descriptors/deps-win.yml +++ b/contrib/gitian-descriptors/deps-win.yml @@ -39,7 +39,7 @@ script: | # INSTALLPREFIX=$HOME/staging${BITS} BUILDDIR=$HOME/build${BITS} - if [ "$BITS" == "32" ]; then + if [ "x$BITS" = "x32" ]; then HOST=i686-w64-mingw32 else HOST=x86_64-w64-mingw32 @@ -50,7 +50,7 @@ script: | # tar xzf $INDIR/openssl-1.0.1h.tar.gz cd openssl-1.0.1h - if [ "$BITS" == "32" ]; then + if [ "x$BITS" = "x32" ]; then OPENSSL_TGT=mingw else OPENSSL_TGT=mingw64 diff --git a/contrib/gitian-descriptors/gitian-win.yml b/contrib/gitian-descriptors/gitian-win.yml index 245f15ccab..b2795c5376 100644 --- a/contrib/gitian-descriptors/gitian-win.yml +++ b/contrib/gitian-descriptors/gitian-win.yml @@ -50,7 +50,7 @@ script: | STAGING=$HOME/staging${BITS} BUILDDIR=$HOME/build${BITS} BINDIR=$OUTDIR/$BITS - if [ "$BITS" == "32" ]; then + if [ "x$BITS" = "x32" ]; then HOST=i686-w64-mingw32 else HOST=x86_64-w64-mingw32 @@ -63,7 +63,7 @@ script: | unzip $INDIR/boost-win${BITS}-1.55.0-gitian-r6.zip unzip $INDIR/bitcoin-deps-win${BITS}-gitian-r13.zip unzip $INDIR/protobuf-win${BITS}-2.5.0-gitian-r4.zip - if [ "$NEEDDIST" == "1" ]; then + if [ "x$NEEDDIST" = "x1" ]; then # Make source code archive which is architecture independent so it only needs to be done once cd $HOME/build/bitcoin ./autogen.sh diff --git a/contrib/gitian-descriptors/protobuf-win.yml b/contrib/gitian-descriptors/protobuf-win.yml index d2fdcaa7f2..1b7af08843 100644 --- a/contrib/gitian-descriptors/protobuf-win.yml +++ b/contrib/gitian-descriptors/protobuf-win.yml @@ -26,7 +26,7 @@ script: | # INSTALLPREFIX=$HOME/staging${BITS} BUILDDIR=$HOME/build${BITS} - if [ "$BITS" == "32" ]; then + if [ "x$BITS" = "x32" ]; then HOST=i686-w64-mingw32 else HOST=x86_64-w64-mingw32 diff --git a/contrib/gitian-descriptors/qt-linux.yml b/contrib/gitian-descriptors/qt-linux.yml index b163b4bb8c..fd86b4df1d 100644 --- a/contrib/gitian-descriptors/qt-linux.yml +++ b/contrib/gitian-descriptors/qt-linux.yml @@ -18,7 +18,7 @@ files: script: | export FAKETIME=$REFERENCE_DATETIME export TZ=UTC - if [ "$GBUILD_BITS" == "32" ]; then + if [ "x$GBUILD_BITS" = "x32" ]; then ARCH='i386-linux-gnu' else ARCH='x86_64-linux-gnu' @@ -74,7 +74,7 @@ script: | #endif ' > $QCONFIG - if [ "$GBUILD_BITS" == "32" ]; then + if [ "x$GBUILD_BITS" = "x32" ]; then echo ' /* Machine byte-order */ #define Q_BIG_ENDIAN 4321 diff --git a/contrib/gitian-descriptors/qt-win.yml b/contrib/gitian-descriptors/qt-win.yml index 7000c70051..57bc4c3180 100644 --- a/contrib/gitian-descriptors/qt-win.yml +++ b/contrib/gitian-descriptors/qt-win.yml @@ -38,7 +38,7 @@ script: | INSTALLPREFIX=$HOME/staging${BITS} BUILDDIR=$HOME/build${BITS} DEPSDIR=$HOME/deps${BITS} - if [ "$BITS" == "32" ]; then + if [ "x$BITS" = "x32" ]; then HOST=i686-w64-mingw32 else HOST=x86_64-w64-mingw32 diff --git a/depends/config.site.in b/depends/config.site.in index 3426050cd3..df076956bd 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -34,12 +34,12 @@ if test -z $with_gui && test -n "@no_qt@"; then with_gui=no fi -if test @host_os@ == darwin; then +if test x@host_os@ = xdarwin; then BREW=no PORT=no fi -if test @host_os@ == mingw32; then +if test x@host_os@ = xmingw32; then if test -z $with_qt_incdir; then with_qt_incdir=$prefix/include fi From 0b17964131c78daa6a3ee01c41f47a43ee2e1947 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Fri, 3 Oct 2014 18:58:59 +0000 Subject: [PATCH 0830/1288] Bugfix: Replace bashisms with standard sh in tests/tools --- contrib/devtools/github-merge.sh | 26 +++++++++++++------------- qa/rpc-tests/send.sh | 2 +- qa/rpc-tests/walletbackup.sh | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/contrib/devtools/github-merge.sh b/contrib/devtools/github-merge.sh index 3217a06195..a83a2a59be 100755 --- a/contrib/devtools/github-merge.sh +++ b/contrib/devtools/github-merge.sh @@ -13,7 +13,7 @@ # name $BRANCH is overwritten with the merged result, and optionally pushed. REPO="$(git config --get githubmerge.repository)" -if [[ "d$REPO" == "d" ]]; then +if [ "d$REPO" = "d" ]; then echo "ERROR: No repository configured. Use this command to set:" >&2 echo "git config githubmerge.repository /" >&2 echo "In addition, you can set the following variables:" >&2 @@ -24,12 +24,12 @@ if [[ "d$REPO" == "d" ]]; then fi HOST="$(git config --get githubmerge.host)" -if [[ "d$HOST" == "d" ]]; then +if [ "d$HOST" = "d" ]; then HOST="git@github.com" fi BRANCH="$(git config --get githubmerge.branch)" -if [[ "d$BRANCH" == "d" ]]; then +if [ "d$BRANCH" = "d" ]; then BRANCH="master" fi @@ -37,12 +37,12 @@ TESTCMD="$(git config --get githubmerge.testcmd)" PULL="$1" -if [[ "d$PULL" == "d" ]]; then +if [ "d$PULL" = "d" ]; then echo "Usage: $0 pullnumber [branch]" >&2 exit 2 fi -if [[ "d$2" != "d" ]]; then +if [ "d$2" != "d" ]; then BRANCH="$2" fi @@ -101,7 +101,7 @@ else fi # Run test command if configured. -if [[ "d$TESTCMD" != "d" ]]; then +if [ "d$TESTCMD" != "d" ]; then # Go up to the repository's root. while [ ! -d .git ]; do cd ..; done if ! $TESTCMD; then @@ -112,10 +112,10 @@ if [[ "d$TESTCMD" != "d" ]]; then # Show the created merge. git diff pull/"$PULL"/merge..pull/"$PULL"/local-merge >"$TMPDIR"/diff git diff pull/"$PULL"/base..pull/"$PULL"/local-merge - if [[ "$(<"$TMPDIR"/diff)" != "" ]]; then + if [ "$(<"$TMPDIR"/diff)" != "" ]; then echo "WARNING: merge differs from github!" >&2 read -p "Type 'ignore' to continue. " -r >&2 - if [[ "d$REPLY" =~ ^d[iI][gG][nN][oO][rR][eE]$ ]]; then + if [ "d$REPLY" =~ ^d[iI][gG][nN][oO][rR][eE]$ ]; then echo "Difference with github ignored." >&2 else cleanup @@ -124,7 +124,7 @@ if [[ "d$TESTCMD" != "d" ]]; then fi read -p "Press 'd' to accept the diff. " -n 1 -r >&2 echo - if [[ "d$REPLY" =~ ^d[dD]$ ]]; then + if [ "d$REPLY" =~ ^d[dD]$ ]; then echo "Diff accepted." >&2 else echo "ERROR: Diff rejected." >&2 @@ -139,7 +139,7 @@ else bash -i read -p "Press 'm' to accept the merge. " -n 1 -r >&2 echo - if [[ "d$REPLY" =~ ^d[Mm]$ ]]; then + if [ "d$REPLY" =~ ^d[Mm]$ ]; then echo "Merge accepted." >&2 else echo "ERROR: Merge rejected." >&2 @@ -151,8 +151,8 @@ fi # Sign the merge commit. read -p "Press 's' to sign off on the merge. " -n 1 -r >&2 echo -if [[ "d$REPLY" =~ ^d[Ss]$ ]]; then - if [[ "$(git config --get user.signingkey)" == "" ]]; then +if [ "d$REPLY" =~ ^d[Ss]$ ]; then + if [ "$(git config --get user.signingkey)" = "" ]; then echo "WARNING: No GPG signing key set, not signing. Set one using:" >&2 echo "git config --global user.signingkey " >&2 git commit -q --signoff --amend --no-edit @@ -168,6 +168,6 @@ cleanup # Push the result. read -p "Type 'push' to push the result to $HOST:$REPO, branch $BRANCH. " -r >&2 -if [[ "d$REPLY" =~ ^d[Pp][Uu][Ss][Hh]$ ]]; then +if [ "d$REPLY" =~ ^d[Pp][Uu][Ss][Hh]$ ]; then git push "$HOST":"$REPO" refs/heads/"$BRANCH" fi diff --git a/qa/rpc-tests/send.sh b/qa/rpc-tests/send.sh index bfbf791d07..8c0f114590 100755 --- a/qa/rpc-tests/send.sh +++ b/qa/rpc-tests/send.sh @@ -14,7 +14,7 @@ if [ $# -eq 0 ]; then exit 0 fi -if [ $1 == "-STOP" ]; then +if [ $1 = "-STOP" ]; then if [ -s ${PIDFILE} ]; then kill -s ${SIGNAL} $(<${PIDFILE}) fi diff --git a/qa/rpc-tests/walletbackup.sh b/qa/rpc-tests/walletbackup.sh index 7444670980..b88d5920f7 100755 --- a/qa/rpc-tests/walletbackup.sh +++ b/qa/rpc-tests/walletbackup.sh @@ -149,7 +149,7 @@ echo "Creating transactions..." function S { TXID=$( $CLI -datadir=${D}/node${1} sendtoaddress ${2} "${3}" 0 ) - if [[ $TXID == "" ]] ; then + if [ x$TXID = x ] ; then echoerr "node${1}: error sending ${3} btc" echo -n "node${1} balance: " $CLI -datadir=${D}/node${1} getbalance "*" 0 From 1f9be984db13e9bed98d2aadb8f0577a2057f7cc Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Sat, 4 Oct 2014 19:34:15 +0800 Subject: [PATCH 0831/1288] Disable App Nap on OSX 10.9+ --- share/qt/Info.plist.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/qt/Info.plist.in b/share/qt/Info.plist.in index e79e59a568..dd6edde8d2 100644 --- a/share/qt/Info.plist.in +++ b/share/qt/Info.plist.in @@ -91,6 +91,9 @@ NSHighResolutionCapable True + LSAppNapIsDisabled + True + LSApplicationCategoryType public.app-category.finance From ed6d1a2c7be9d046d5e78330d5e163023a6b302a Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 25 Sep 2014 08:21:21 +0200 Subject: [PATCH 0832/1288] Keep information about all block files in memory --- src/main.cpp | 82 +++++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 44ac232aad..9cf3afef7d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -108,7 +108,7 @@ namespace { set setBlockIndexValid; CCriticalSection cs_LastBlockFile; - CBlockFileInfo infoLastBlockFile; + std::vector vinfoBlockFile; int nLastBlockFile = 0; // Every received block is assigned a unique and increasing identifier, so we @@ -1522,7 +1522,7 @@ void static FlushBlockFile(bool fFinalize = false) FILE *fileOld = OpenBlockFile(posOld); if (fileOld) { if (fFinalize) - TruncateFile(fileOld, infoLastBlockFile.nSize); + TruncateFile(fileOld, vinfoBlockFile[nLastBlockFile].nSize); FileCommit(fileOld); fclose(fileOld); } @@ -1530,7 +1530,7 @@ void static FlushBlockFile(bool fFinalize = false) fileOld = OpenUndoFile(posOld); if (fileOld) { if (fFinalize) - TruncateFile(fileOld, infoLastBlockFile.nUndoSize); + TruncateFile(fileOld, vinfoBlockFile[nLastBlockFile].nUndoSize); FileCommit(fileOld); fclose(fileOld); } @@ -2107,32 +2107,32 @@ bool FindBlockPos(CValidationState &state, CDiskBlockPos &pos, unsigned int nAdd LOCK(cs_LastBlockFile); - if (fKnown) { - if (nLastBlockFile != pos.nFile) { - nLastBlockFile = pos.nFile; - infoLastBlockFile.SetNull(); - pblocktree->ReadBlockFileInfo(nLastBlockFile, infoLastBlockFile); - fUpdatedLast = true; - } - } else { - while (infoLastBlockFile.nSize + nAddSize >= MAX_BLOCKFILE_SIZE) { - LogPrintf("Leaving block file %i: %s\n", nLastBlockFile, infoLastBlockFile.ToString()); - FlushBlockFile(true); - nLastBlockFile++; - infoLastBlockFile.SetNull(); - pblocktree->ReadBlockFileInfo(nLastBlockFile, infoLastBlockFile); // check whether data for the new file somehow already exist; can fail just fine - fUpdatedLast = true; - } - pos.nFile = nLastBlockFile; - pos.nPos = infoLastBlockFile.nSize; + unsigned int nFile = fKnown ? pos.nFile : nLastBlockFile; + if (vinfoBlockFile.size() <= nFile) { + vinfoBlockFile.resize(nFile + 1); } - infoLastBlockFile.nSize += nAddSize; - infoLastBlockFile.AddBlock(nHeight, nTime); + if (!fKnown) { + while (vinfoBlockFile[nFile].nSize + nAddSize >= MAX_BLOCKFILE_SIZE) { + LogPrintf("Leaving block file %i: %s\n", nFile, vinfoBlockFile[nFile].ToString()); + FlushBlockFile(true); + nFile++; + if (vinfoBlockFile.size() <= nFile) { + vinfoBlockFile.resize(nFile + 1); + } + fUpdatedLast = true; + } + pos.nFile = nFile; + pos.nPos = vinfoBlockFile[nFile].nSize; + } + + nLastBlockFile = nFile; + vinfoBlockFile[nFile].nSize += nAddSize; + vinfoBlockFile[nFile].AddBlock(nHeight, nTime); if (!fKnown) { unsigned int nOldChunks = (pos.nPos + BLOCKFILE_CHUNK_SIZE - 1) / BLOCKFILE_CHUNK_SIZE; - unsigned int nNewChunks = (infoLastBlockFile.nSize + BLOCKFILE_CHUNK_SIZE - 1) / BLOCKFILE_CHUNK_SIZE; + unsigned int nNewChunks = (vinfoBlockFile[nFile].nSize + BLOCKFILE_CHUNK_SIZE - 1) / BLOCKFILE_CHUNK_SIZE; if (nNewChunks > nOldChunks) { if (CheckDiskSpace(nNewChunks * BLOCKFILE_CHUNK_SIZE - pos.nPos)) { FILE *file = OpenBlockFile(pos); @@ -2147,7 +2147,7 @@ bool FindBlockPos(CValidationState &state, CDiskBlockPos &pos, unsigned int nAdd } } - if (!pblocktree->WriteBlockFileInfo(nLastBlockFile, infoLastBlockFile)) + if (!pblocktree->WriteBlockFileInfo(nLastBlockFile, vinfoBlockFile[nFile])) return state.Abort("Failed to write file info"); if (fUpdatedLast) pblocktree->WriteLastBlockFile(nLastBlockFile); @@ -2162,19 +2162,10 @@ bool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos, unsigne LOCK(cs_LastBlockFile); unsigned int nNewSize; - if (nFile == nLastBlockFile) { - pos.nPos = infoLastBlockFile.nUndoSize; - nNewSize = (infoLastBlockFile.nUndoSize += nAddSize); - if (!pblocktree->WriteBlockFileInfo(nLastBlockFile, infoLastBlockFile)) - return state.Abort("Failed to write block info"); - } else { - CBlockFileInfo info; - if (!pblocktree->ReadBlockFileInfo(nFile, info)) - return state.Abort("Failed to read block info"); - pos.nPos = info.nUndoSize; - nNewSize = (info.nUndoSize += nAddSize); - if (!pblocktree->WriteBlockFileInfo(nFile, info)) - return state.Abort("Failed to write block info"); + pos.nPos = vinfoBlockFile[nFile].nUndoSize; + nNewSize = vinfoBlockFile[nFile].nUndoSize += nAddSize; + if (!pblocktree->WriteBlockFileInfo(nLastBlockFile, vinfoBlockFile[nLastBlockFile])) { + return state.Abort("Failed to write block info"); } unsigned int nOldChunks = (pos.nPos + UNDOFILE_CHUNK_SIZE - 1) / UNDOFILE_CHUNK_SIZE; @@ -2826,9 +2817,20 @@ bool static LoadBlockIndexDB() // Load block file info pblocktree->ReadLastBlockFile(nLastBlockFile); + vinfoBlockFile.resize(nLastBlockFile + 1); LogPrintf("LoadBlockIndexDB(): last block file = %i\n", nLastBlockFile); - if (pblocktree->ReadBlockFileInfo(nLastBlockFile, infoLastBlockFile)) - LogPrintf("LoadBlockIndexDB(): last block file info: %s\n", infoLastBlockFile.ToString()); + for (int nFile = 0; nFile <= nLastBlockFile; nFile++) { + pblocktree->ReadBlockFileInfo(nFile, vinfoBlockFile[nFile]); + } + LogPrintf("LoadBlockIndexDB(): last block file info: %s\n", vinfoBlockFile[nLastBlockFile].ToString()); + for (int nFile = nLastBlockFile + 1; true; nFile++) { + CBlockFileInfo info; + if (pblocktree->ReadBlockFileInfo(nFile, info)) { + vinfoBlockFile.push_back(info); + } else { + break; + } + } // Check presence of blk files LogPrintf("Checking all blk files are present...\n"); From 5eed8c21c7be355a2b5368843e383f40aa4642d6 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 6 Oct 2014 13:00:55 +0200 Subject: [PATCH 0833/1288] minor license, header end comment etc. cleanup in /script - ensure all licenses are just MIT - add a missing header end comment - ensure alphabetical ordering --- src/script/interpreter.h | 2 +- src/script/sigcache.cpp | 4 ++-- src/script/sigcache.h | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/script/interpreter.h b/src/script/interpreter.h index f5363a7535..0ff73964ba 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -10,10 +10,10 @@ #include #include -class uint256; class CPubKey; class CScript; class CTransaction; +class uint256; /** Signature hash types/flags */ enum diff --git a/src/script/sigcache.cpp b/src/script/sigcache.cpp index 981563b7ae..ab366898d8 100644 --- a/src/script/sigcache.cpp +++ b/src/script/sigcache.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "sigcache.h" diff --git a/src/script/sigcache.h b/src/script/sigcache.h index 9537efbd11..46b8f4d335 100644 --- a/src/script/sigcache.h +++ b/src/script/sigcache.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef H_BITCOIN_SCRIPT_SIGCACHE @@ -23,4 +23,4 @@ public: bool VerifySignature(const std::vector& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const; }; -#endif +#endif // H_BITCOIN_SCRIPT_SIGCACHE From 4dc5eb057c1d3b3cab8eb6462a0e134b128de1fd Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 6 Oct 2014 13:04:02 +0200 Subject: [PATCH 0834/1288] fix a lock indentation in main.cpp - also ensure alphabetical ordering in file header --- src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 44ac232aad..5d46c30a9b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,8 +26,8 @@ #include #include -using namespace std; using namespace boost; +using namespace std; #if defined(NDEBUG) # error "Bitcoin cannot be compiled without assertions." @@ -2026,10 +2026,10 @@ bool ActivateBestChain(CValidationState &state, CBlock *pblock) { // Relay inventory, but don't relay old inventory during initial block download. int nBlockEstimate = Checkpoints::GetTotalBlocksEstimate(); { - LOCK(cs_vNodes); - BOOST_FOREACH(CNode* pnode, vNodes) - if (chainActive.Height() > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : nBlockEstimate)) - pnode->PushInventory(CInv(MSG_BLOCK, hashNewTip)); + LOCK(cs_vNodes); + BOOST_FOREACH(CNode* pnode, vNodes) + if (chainActive.Height() > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : nBlockEstimate)) + pnode->PushInventory(CInv(MSG_BLOCK, hashNewTip)); } uiInterface.NotifyBlockTip(hashNewTip); From de10efd154d6c02fe8549a2dc9649a96cf601fd2 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 25 Sep 2014 09:01:54 +0200 Subject: [PATCH 0835/1288] add -timeout default as constant and use them - update help message text - simplify code in init to check for -timeout --- src/init.cpp | 11 ++++------- src/netbase.cpp | 2 +- src/netbase.h | 3 +++ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 980c589b29..d3cb3c32d5 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -260,7 +260,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -port= " + _("Listen for connections on (default: 8333 or testnet: 18333)") + "\n"; strUsage += " -proxy= " + _("Connect through SOCKS5 proxy") + "\n"; strUsage += " -seednode= " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n"; - strUsage += " -timeout= " + _("Specify connection timeout in milliseconds (default: 5000)") + "\n"; + strUsage += " -timeout= " + strprintf(_("Specify connection timeout in milliseconds (minimum: 1, default: %d)"), DEFAULT_CONNECT_TIMEOUT) + "\n"; #ifdef USE_UPNP #if USE_UPNP strUsage += " -upnp " + _("Use UPnP to map the listening port (default: 1 when listening)") + "\n"; @@ -641,12 +641,9 @@ bool AppInit2(boost::thread_group& threadGroup) bool fDisableWallet = GetBoolArg("-disablewallet", false); #endif - if (mapArgs.count("-timeout")) - { - int nNewTimeout = GetArg("-timeout", 5000); - if (nNewTimeout > 0 && nNewTimeout < 600000) - nConnectTimeout = nNewTimeout; - } + nConnectTimeout = GetArg("-timeout", DEFAULT_CONNECT_TIMEOUT); + if (nConnectTimeout <= 0) + nConnectTimeout = DEFAULT_CONNECT_TIMEOUT; // Continue to put "/P2SH/" in the coinbase to monitor // BIP16 support. diff --git a/src/netbase.cpp b/src/netbase.cpp index 5819c152a3..b3d1001547 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -40,7 +40,7 @@ using namespace std; static proxyType proxyInfo[NET_MAX]; static CService nameProxy; static CCriticalSection cs_proxyInfos; -int nConnectTimeout = 5000; +int nConnectTimeout = DEFAULT_CONNECT_TIMEOUT; bool fNameLookup = false; static const unsigned char pchIPv4[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff }; diff --git a/src/netbase.h b/src/netbase.h index 9fc5c72eb8..1455cd8c33 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -19,6 +19,9 @@ extern int nConnectTimeout; extern bool fNameLookup; +/** -timeout default */ +static const int DEFAULT_CONNECT_TIMEOUT = 5000; + #ifdef WIN32 // In MSVC, this is defined as a macro, undefine it to prevent a compile and link error #undef SetPort From 772ab0ea98b31020095eaf9baa6a6504957507af Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 6 Oct 2014 13:23:27 +0200 Subject: [PATCH 0836/1288] contrib: use batched JSON-RPC in linarize-hashes Batch up to 10000 requests for a ~30x speedup. --- contrib/linearize/linearize-hashes.py | 71 +++++++++++++++------------ 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/contrib/linearize/linearize-hashes.py b/contrib/linearize/linearize-hashes.py index 791b71bc33..dc7f654049 100755 --- a/contrib/linearize/linearize-hashes.py +++ b/contrib/linearize/linearize-hashes.py @@ -2,11 +2,12 @@ # # linearize-hashes.py: List blocks in a linear, no-fork version of the chain. # -# Copyright (c) 2013 The Bitcoin developers +# Copyright (c) 2013-2014 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # +from __future__ import print_function import json import struct import re @@ -17,59 +18,65 @@ import sys settings = {} class BitcoinRPC: - OBJID = 1 - def __init__(self, host, port, username, password): authpair = "%s:%s" % (username, password) self.authhdr = "Basic %s" % (base64.b64encode(authpair)) self.conn = httplib.HTTPConnection(host, port, False, 30) - def rpc(self, method, params=None): - self.OBJID += 1 - obj = { 'version' : '1.1', - 'method' : method, - 'id' : self.OBJID } - if params is None: - obj['params'] = [] - else: - obj['params'] = params + + def execute(self, obj): self.conn.request('POST', '/', json.dumps(obj), { 'Authorization' : self.authhdr, 'Content-type' : 'application/json' }) resp = self.conn.getresponse() if resp is None: - print "JSON-RPC: no response" + print("JSON-RPC: no response", file=sys.stderr) return None body = resp.read() resp_obj = json.loads(body) - if resp_obj is None: - print "JSON-RPC: cannot JSON-decode body" - return None - if 'error' in resp_obj and resp_obj['error'] != None: - return resp_obj['error'] - if 'result' not in resp_obj: - print "JSON-RPC: no result in object" - return None + return resp_obj - return resp_obj['result'] - def getblock(self, hash, verbose=True): - return self.rpc('getblock', [hash, verbose]) - def getblockhash(self, index): - return self.rpc('getblockhash', [index]) + @staticmethod + def build_request(idx, method, params): + obj = { 'version' : '1.1', + 'method' : method, + 'id' : idx } + if params is None: + obj['params'] = [] + else: + obj['params'] = params + return obj -def get_block_hashes(settings): + @staticmethod + def response_is_error(resp_obj): + return 'error' in resp_obj and resp_obj['error'] is not None + +def get_block_hashes(settings, max_blocks_per_call=10000): rpc = BitcoinRPC(settings['host'], settings['port'], settings['rpcuser'], settings['rpcpassword']) - for height in xrange(settings['min_height'], settings['max_height']+1): - hash = rpc.getblockhash(height) + height = settings['min_height'] + while height < settings['max_height']+1: + num_blocks = min(settings['max_height']+1-height, max_blocks_per_call) + batch = [] + for x in range(num_blocks): + batch.append(rpc.build_request(x, 'getblockhash', [height + x])) - print(hash) + reply = rpc.execute(batch) + + for x,resp_obj in enumerate(reply): + if rpc.response_is_error(resp_obj): + print('JSON-RPC: error at height', height+x, ': ', resp_obj['error'], file=sys.stderr) + exit(1) + assert(resp_obj['id'] == x) # assume replies are in-sequence + print(resp_obj['result']) + + height += num_blocks if __name__ == '__main__': if len(sys.argv) != 2: - print "Usage: linearize-hashes.py CONFIG-FILE" + print("Usage: linearize-hashes.py CONFIG-FILE") sys.exit(1) f = open(sys.argv[1]) @@ -95,7 +102,7 @@ if __name__ == '__main__': if 'max_height' not in settings: settings['max_height'] = 313000 if 'rpcuser' not in settings or 'rpcpassword' not in settings: - print "Missing username and/or password in cfg file" + print("Missing username and/or password in cfg file", file=stderr) sys.exit(1) settings['port'] = int(settings['port']) From aedc74dfa688306c5a139a88782da74f69ba6757 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 6 Oct 2014 17:55:55 +0200 Subject: [PATCH 0837/1288] contrib: make linearize-data.py cope with out-of-order blocks Make it possible to read blocks in any order. This will be required after headers-first (#4468), so should be merged before that. - Read block header. For expected blocks, continue, else skip. - For in-order blocks: copy block contents directly. Write prior out-of-order blocks if this connects a consecutive span. - For out-of-order blocks, store extents of block data for later retrieval. Cache out-of-order blocks in memory up to 100MB (configurable). --- contrib/linearize/example-linearize.cfg | 2 + contrib/linearize/linearize-data.py | 242 +++++++++++++++--------- 2 files changed, 154 insertions(+), 90 deletions(-) diff --git a/contrib/linearize/example-linearize.cfg b/contrib/linearize/example-linearize.cfg index 071345f23a..e0fef13886 100644 --- a/contrib/linearize/example-linearize.cfg +++ b/contrib/linearize/example-linearize.cfg @@ -15,3 +15,5 @@ output_file=/home/example/Downloads/bootstrap.dat hashlist=hashlist.txt split_year=1 +# Maxmimum size in bytes of out-of-order blocks cache in memory +out_of_order_cache_sz = 100000000 diff --git a/contrib/linearize/linearize-data.py b/contrib/linearize/linearize-data.py index 3b5d198c14..2dac3a614b 100755 --- a/contrib/linearize/linearize-data.py +++ b/contrib/linearize/linearize-data.py @@ -2,11 +2,12 @@ # # linearize-data.py: Construct a linear, no-fork version of the chain. # -# Copyright (c) 2013 The Bitcoin developers +# Copyright (c) 2013-2014 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # +from __future__ import print_function, division import json import struct import re @@ -17,10 +18,10 @@ import sys import hashlib import datetime import time +from collections import namedtuple settings = {} - def uint32(x): return x & 0xffffffffL @@ -78,116 +79,174 @@ def get_block_hashes(settings): return blkindex -def mkblockset(blkindex): +def mkblockmap(blkindex): blkmap = {} - for hash in blkindex: - blkmap[hash] = True + for height,hash in enumerate(blkindex): + blkmap[hash] = height return blkmap -def copydata(settings, blkindex, blkset): - inFn = 0 - inF = None - outFn = 0 - outsz = 0 - outF = None - outFname = None - blkCount = 0 +# Block header and extent on disk +BlockExtent = namedtuple('BlockExtent', ['fn', 'offset', 'inhdr', 'blkhdr', 'size']) - lastDate = datetime.datetime(2000, 1, 1) - highTS = 1408893517 - 315360000 - timestampSplit = False - fileOutput = True - setFileTime = False - maxOutSz = settings['max_out_sz'] - if 'output' in settings: - fileOutput = False - if settings['file_timestamp'] != 0: - setFileTime = True - if settings['split_timestamp'] != 0: - timestampSplit = True +class BlockDataCopier: + def __init__(self, settings, blkindex, blkmap): + self.settings = settings + self.blkindex = blkindex + self.blkmap = blkmap - while True: - if not inF: - fname = "%s/blk%05d.dat" % (settings['input'], inFn) - print("Input file" + fname) - try: - inF = open(fname, "rb") - except IOError: - print "Done" - return + self.inFn = 0 + self.inF = None + self.outFn = 0 + self.outsz = 0 + self.outF = None + self.outFname = None + self.blkCountIn = 0 + self.blkCountOut = 0 - inhdr = inF.read(8) - if (not inhdr or (inhdr[0] == "\0")): - inF.close() - inF = None - inFn = inFn + 1 - continue + self.lastDate = datetime.datetime(2000, 1, 1) + self.highTS = 1408893517 - 315360000 + self.timestampSplit = False + self.fileOutput = True + self.setFileTime = False + self.maxOutSz = settings['max_out_sz'] + if 'output' in settings: + self.fileOutput = False + if settings['file_timestamp'] != 0: + self.setFileTime = True + if settings['split_timestamp'] != 0: + self.timestampSplit = True + # Extents and cache for out-of-order blocks + self.blockExtents = {} + self.outOfOrderData = {} + self.outOfOrderSize = 0 # running total size for items in outOfOrderData - inMagic = inhdr[:4] - if (inMagic != settings['netmagic']): - print("Invalid magic:" + inMagic) - return - inLenLE = inhdr[4:] - su = struct.unpack(" maxOutSz): - outF.close() - if setFileTime: + def writeBlock(self, inhdr, blk_hdr, rawblock): + if not self.fileOutput and ((self.outsz + self.inLen) > self.maxOutSz): + self.outF.close() + if self.setFileTime: os.utime(outFname, (int(time.time()), highTS)) - outF = None - outFname = None - outFn = outFn + 1 - outsz = 0 + self.outF = None + self.outFname = None + self.outFn = outFn + 1 + self.outsz = 0 (blkDate, blkTS) = get_blk_dt(blk_hdr) - if timestampSplit and (blkDate > lastDate): + if self.timestampSplit and (blkDate > self.lastDate): print("New month " + blkDate.strftime("%Y-%m") + " @ " + hash_str) lastDate = blkDate if outF: outF.close() if setFileTime: os.utime(outFname, (int(time.time()), highTS)) - outF = None - outFname = None - outFn = outFn + 1 - outsz = 0 + self.outF = None + self.outFname = None + self.outFn = self.outFn + 1 + self.outsz = 0 - if not outF: - if fileOutput: - outFname = settings['output_file'] + if not self.outF: + if self.fileOutput: + outFname = self.settings['output_file'] else: - outFname = "%s/blk%05d.dat" % (settings['output'], outFn) + outFname = "%s/blk%05d.dat" % (self.settings['output'], outFn) print("Output file" + outFname) - outF = open(outFname, "wb") + self.outF = open(outFname, "wb") - outF.write(inhdr) - outF.write(rawblock) - outsz = outsz + inLen + 8 + self.outF.write(inhdr) + self.outF.write(blk_hdr) + self.outF.write(rawblock) + self.outsz = self.outsz + len(inhdr) + len(blk_hdr) + len(rawblock) - blkCount = blkCount + 1 - if blkTS > highTS: - highTS = blkTS + self.blkCountOut = self.blkCountOut + 1 + if blkTS > self.highTS: + self.highTS = blkTS - if (blkCount % 1000) == 0: - print("Wrote " + str(blkCount) + " blocks") + if (self.blkCountOut % 1000) == 0: + print('%i blocks scanned, %i blocks written (of %i, %.1f%% complete)' % + (self.blkCountIn, self.blkCountOut, len(self.blkindex), 100.0 * self.blkCountOut / len(self.blkindex))) + + def inFileName(self, fn): + return "%s/blk%05d.dat" % (self.settings['input'], fn) + + def fetchBlock(self, extent): + '''Fetch block contents from disk given extents''' + with open(self.inFileName(extent.fn), "rb") as f: + f.seek(extent.offset) + return f.read(extent.size) + + def copyOneBlock(self): + '''Find the next block to be written in the input, and copy it to the output.''' + extent = self.blockExtents.pop(self.blkCountOut) + if self.blkCountOut in self.outOfOrderData: + # If the data is cached, use it from memory and remove from the cache + rawblock = self.outOfOrderData.pop(self.blkCountOut) + self.outOfOrderSize -= len(rawblock) + else: # Otherwise look up data on disk + rawblock = self.fetchBlock(extent) + + self.writeBlock(extent.inhdr, extent.blkhdr, rawblock) + + def run(self): + while self.blkCountOut < len(self.blkindex): + if not self.inF: + fname = self.inFileName(self.inFn) + print("Input file" + fname) + try: + self.inF = open(fname, "rb") + except IOError: + print("Premature end of block data") + return + + inhdr = self.inF.read(8) + if (not inhdr or (inhdr[0] == "\0")): + self.inF.close() + self.inF = None + self.inFn = self.inFn + 1 + continue + + inMagic = inhdr[:4] + if (inMagic != self.settings['netmagic']): + print("Invalid magic:" + inMagic) + return + inLenLE = inhdr[4:] + su = struct.unpack(" Date: Sat, 4 Oct 2014 01:48:12 +0200 Subject: [PATCH 0838/1288] minor txindex documentation improvement --- src/init.cpp | 3 +-- src/rpcrawtransaction.cpp | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 980c589b29..36ba13b941 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -237,7 +237,7 @@ std::string HelpMessage(HelpMessageMode mode) #if !defined(WIN32) strUsage += " -sysperms " + _("Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)") + "\n"; #endif - strUsage += " -txindex " + _("Maintain a full transaction index (default: 0)") + "\n"; + strUsage += " -txindex " + _("Maintain a full transaction index, used by the getrawtransaction rpc call (default: 0)") + "\n"; strUsage += "\n" + _("Connection options:") + "\n"; strUsage += " -addnode= " + _("Add a node to connect to and attempt to keep the connection open") + "\n"; @@ -280,7 +280,6 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -mintxfee= " + strprintf(_("Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s)"), FormatMoney(CWallet::minTxFee.GetFeePerK())) + "\n"; strUsage += " -paytxfee= " + strprintf(_("Fee (in BTC/kB) to add to transactions you send (default: %s)"), FormatMoney(payTxFee.GetFeePerK())) + "\n"; strUsage += " -rescan " + _("Rescan the block chain for missing wallet transactions") + " " + _("on startup") + "\n"; - strUsage += " -respendnotify= " + _("Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID)") + "\n"; strUsage += " -salvagewallet " + _("Attempt to recover private keys from a corrupt wallet.dat") + " " + _("on startup") + "\n"; strUsage += " -spendzeroconfchange " + _("Spend unconfirmed change when sending transactions (default: 1)") + "\n"; strUsage += " -txconfirmtarget= " + _("If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1)") + "\n"; diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index bd87d77704..3c62272ecb 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -110,6 +110,9 @@ Value getrawtransaction(const Array& params, bool fHelp) if (fHelp || params.size() < 1 || params.size() > 2) throw runtime_error( "getrawtransaction \"txid\" ( verbose )\n" + "\nNOTE: By default this function only works sometimes. This is when the tx is in the mempool\n" + "or there is an unspent output in the utxo for this transaction. To make it always work,\n" + "you need to maintain a transaction index, using the -txindex command line option.\n" "\nReturn the raw transaction data.\n" "\nIf verbose=0, returns a string that is serialized, hex-encoded data for 'txid'.\n" "If verbose is non-zero, returns an Object with information about 'txid'.\n" @@ -202,7 +205,7 @@ Value listunspent(const Array& params, bool fHelp) "Results are an array of Objects, each of which has:\n" "{txid, vout, scriptPubKey, amount, confirmations}\n" "\nArguments:\n" - "1. minconf (numeric, optional, default=1) The minimum confirmationsi to filter\n" + "1. minconf (numeric, optional, default=1) The minimum confirmations to filter\n" "2. maxconf (numeric, optional, default=9999999) The maximum confirmations to filter\n" "3. \"addresses\" (string) A json array of bitcoin addresses to filter\n" " [\n" From 27368e76260564268a7994d7e179a675750dbd05 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Mon, 6 Oct 2014 21:36:24 +0100 Subject: [PATCH 0839/1288] Homebrew lang fix Very small tweak to correct the language on Homebrew's sandboxing process. Discussed in [this commit](https://github.com/bitcoin/bitcoin/commit/9fedafba4b903d7f3af044eb86dc313856e40b08). --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index abf9f39e65..7a54a16c42 100644 --- a/configure.ac +++ b/configure.ac @@ -240,7 +240,7 @@ case $host in AC_CHECK_PROG([BREW],brew, brew) if test x$BREW = xbrew; then - dnl These Homebrew packages may be bottled, meaning that they won't be found + dnl These Homebrew packages may be keg-only, meaning that they won't be found dnl in expected paths because they may conflict with system files. Ask dnl Homebrew where each one is located, then adjust paths accordingly. dnl It's safe to add these paths even if the functionality is disabled by From 9d7cd4c598edfff12f1f80629c9149b3f1cf75a6 Mon Sep 17 00:00:00 2001 From: Andy Alness Date: Sat, 20 Sep 2014 16:13:18 -0700 Subject: [PATCH 0840/1288] Don't return an address for invalid pubkeys --- src/script/standard.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/script/standard.cpp b/src/script/standard.cpp index 407baf621d..53ae254d59 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -203,7 +203,11 @@ bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet) if (whichType == TX_PUBKEY) { - addressRet = CPubKey(vSolutions[0]).GetID(); + CPubKey pubKey(vSolutions[0]); + if (!pubKey.IsValid()) + return false; + + addressRet = pubKey.GetID(); return true; } else if (whichType == TX_PUBKEYHASH) @@ -237,9 +241,16 @@ bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, vecto nRequiredRet = vSolutions.front()[0]; for (unsigned int i = 1; i < vSolutions.size()-1; i++) { - CTxDestination address = CPubKey(vSolutions[i]).GetID(); + CPubKey pubKey(vSolutions[i]); + if (!pubKey.IsValid()) + continue; + + CTxDestination address = pubKey.GetID(); addressRet.push_back(address); } + + if (addressRet.empty()) + return false; } else { From 2c930d932bdd4e1306f60dbb89f60c9a0149468b Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 7 Oct 2014 02:22:47 +0200 Subject: [PATCH 0841/1288] Prettify JSON tests and minimize diffs --- src/test/data/script_invalid.json | 85 ++++++++++++++++++++++++----- src/test/data/script_valid.json | 91 ++++++++++++++++++++++++++----- src/test/script_tests.cpp | 43 ++++++++++----- 3 files changed, 179 insertions(+), 40 deletions(-) diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index 35a6794b01..e62b8eeb75 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -384,19 +384,78 @@ nSequences are max. ["0x00", "'00' EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"], -["0x47 0x30440220304eff7556bba9560df47873275e64db45f3cd735998ce3f00d2e57b1bb5f31302205c0c9d14b8b80d43e2ac9b87532f1af6d8a3271262bc694ec4e14068392bb0a001", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "", "P2PK, bad sig"], -["0x47 0x3044022037fcdb8e08f41e27588de8bc036d2c4b16eb3d09c1ba53b8f47a0a9c27722a39022058664b7a53b507e71dfafb77193e3786c3f0c119d78ce9104480ee7ece04f09301 0x21 0x03363d90d446b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", "DUP HASH160 0x14 0xc0834c0c158f53be706d234c38fd52de7eece656 EQUALVERIFY CHECKSIG", "", "P2PKH, bad pubkey"], -["0x47 0x3044022035e5b6742d299861c84cebaf2ea64145ee427a95facab39e2594d6deebb0c1d602200acb16778faa2e467a59006f342f2535b1418d55ba63a8605b387b7f9ac86d9a01", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", "", "P2PK anyonecanpay marked with normal hashtype"], -["0x47 0x3044022029b2b8765ca950cf75a69e80b73b7ddfcaa8b27080c2db4c23b36aae60688e790220598ff368e17872ee065aa54d7d3a590682ca5204325b23b31d7da3c4a21ae67901 0x23 0x210279be667ef9dcbbac54a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac", "HASH160 0x14 0x23b0ad3477f2178bc0b3eed26e4e6316f4e83aa1 EQUAL", "P2SH", "P2SH(P2PK), bad redeemscript"], -["0x47 0x30440220647f906e63890df5ef1d3fed47ba892b31976c634281079e2bd38504fb54a1fb022021e8811f38fbe90efb6b74cb78da01d9badbac3bafdf70a861d7538a220d0b2601 0x19 0x76a9147cf9c846cd4882efec4bf07e44ebdad495c94f4b88ac", "HASH160 0x14 0x2df519943d5acc0ef5222091f9dfe3543f489a82 EQUAL", "P2SH", "P2SH(P2PKH), bad sig"], -["0 0x47 0x304402203ef170402f8887f2ac183f31b1f503b0bc60bfc968dd469b097ea6124aefac5002200612febadc4e4cacc086982cb85830a17af3680c1b6a3cf77c1708af7621cf1301 0 0x47 0x304402207821838251a24a2234844f68e7169e6d11945cdf052ea12bd3e4e37457aceb4402200b6b46c81361e314c740ae5133c072af5fa5c209d65d2db1679e1716f19a538101", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "", "3-of-3, 2 sigs"], -["0 0 0x47 0x304402204661f7795e8db7be3132e8974e9a76d1d24b31f23df94c6fbcea07d1c205789102203f5e45a1c0b085279b58d11b36d5fea5449c3cf16f844ad10124e9b65e8777d201 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae", "HASH160 0x14 0xc9e4a896d149702d0d1695434feddd52e24ad78d EQUAL", "P2SH", "P2SH(2-of-3), 1 sig"], -["0x47 0x304402200052bc1600ca45c71f3538720fe62a5e8548dffd137af04467598c98466e9c0a0220789318ddbc9991ee477974089220a2feb6a6298a7c93d5ff6c25a92a2f4b48d501", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "STRICTENC", "P2PK with too much R padding"], -["0x48 0x304502206eb7b92628bfb3c4d2a04b65b986987bcbb1af4fceedb144d5a0437b7ee410590221005f57a52df4aa26366742eed0db182fce51fbcd7159011b0644a7c05943eb228901", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "STRICTENC", "P2PK with too much S padding"], -["0x47 0x30440220d8ad1efd55a3d2b8896495c38aba72056e1b3ca4a6ca15760e843eb1a9b9907602203eb0e8f3d6bec998262dfd03eaeb0f31c4e5105965436dec77550724b3771f3201", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "STRICTENC", "P2PK with too little R padding"], -["0x48 0x304502206c43e065c8a8db3bbe69015afb86a51fb2fc8870defd41d436da2a197d9d6c12022100fcec35816ee2d84ec271ad159fcabf5dd712157051169e48ac328a7818cdb51e01", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "LOW_S,STRICTENC", "P2PK with high S"], -["0x01 0x01 0x47 0x304402200e48ba1cf4d7182db94ffb57bd72ea31b5545dc0d1c512e665779b4fb2badc52022054b8388dfc074c708a75b62359b7be46402751ee40c0a111aef38a837b6ed09801 0x47 0x304402201c9820f59c49107bb30e6175cfc9ec95f897b03beb628b4bc854d2b80392aa0602200235d986ae418bcd111b8814f4c26a0ab5f475fb542a44884fc14912a97a252301 0x47 0x304402204cd7894c6f10a871f5b0c1f9c13228f8cdd4050248f0d0f498ee86be69ee3080022051bd2932c7d585eb600c7194235c74da820935f0d67972fd9545673aa1fd023301", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "NULLDUMMY", "3-of-3 with nonzero dummy"], +[ + "0x47 0x30440220304eff7556bba9560df47873275e64db45f3cd735998ce3f00d2e57b1bb5f31302205c0c9d14b8b80d43e2ac9b87532f1af6d8a3271262bc694ec4e14068392bb0a001", + "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", + "", + "P2PK, bad sig" +], +[ + "0x47 0x3044022037fcdb8e08f41e27588de8bc036d2c4b16eb3d09c1ba53b8f47a0a9c27722a39022058664b7a53b507e71dfafb77193e3786c3f0c119d78ce9104480ee7ece04f09301 0x21 0x03363d90d446b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", + "DUP HASH160 0x14 0xc0834c0c158f53be706d234c38fd52de7eece656 EQUALVERIFY CHECKSIG", + "", + "P2PKH, bad pubkey" +], +[ + "0x47 0x3044022035e5b6742d299861c84cebaf2ea64145ee427a95facab39e2594d6deebb0c1d602200acb16778faa2e467a59006f342f2535b1418d55ba63a8605b387b7f9ac86d9a01", + "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", + "", + "P2PK anyonecanpay marked with normal hashtype" +], +[ + "0x47 0x3044022029b2b8765ca950cf75a69e80b73b7ddfcaa8b27080c2db4c23b36aae60688e790220598ff368e17872ee065aa54d7d3a590682ca5204325b23b31d7da3c4a21ae67901 0x23 0x210279be667ef9dcbbac54a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac", + "HASH160 0x14 0x23b0ad3477f2178bc0b3eed26e4e6316f4e83aa1 EQUAL", + "P2SH", + "P2SH(P2PK), bad redeemscript" +], +[ + "0x47 0x30440220647f906e63890df5ef1d3fed47ba892b31976c634281079e2bd38504fb54a1fb022021e8811f38fbe90efb6b74cb78da01d9badbac3bafdf70a861d7538a220d0b2601 0x19 0x76a9147cf9c846cd4882efec4bf07e44ebdad495c94f4b88ac", + "HASH160 0x14 0x2df519943d5acc0ef5222091f9dfe3543f489a82 EQUAL", + "P2SH", + "P2SH(P2PKH), bad sig" +], +[ + "0 0x47 0x304402203ef170402f8887f2ac183f31b1f503b0bc60bfc968dd469b097ea6124aefac5002200612febadc4e4cacc086982cb85830a17af3680c1b6a3cf77c1708af7621cf1301 0 0x47 0x304402207821838251a24a2234844f68e7169e6d11945cdf052ea12bd3e4e37457aceb4402200b6b46c81361e314c740ae5133c072af5fa5c209d65d2db1679e1716f19a538101", + "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", + "", + "3-of-3, 2 sigs" +], +[ + "0 0 0x47 0x304402204661f7795e8db7be3132e8974e9a76d1d24b31f23df94c6fbcea07d1c205789102203f5e45a1c0b085279b58d11b36d5fea5449c3cf16f844ad10124e9b65e8777d201 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae", + "HASH160 0x14 0xc9e4a896d149702d0d1695434feddd52e24ad78d EQUAL", + "P2SH", + "P2SH(2-of-3), 1 sig" +], +[ + "0x47 0x304402200052bc1600ca45c71f3538720fe62a5e8548dffd137af04467598c98466e9c0a0220789318ddbc9991ee477974089220a2feb6a6298a7c93d5ff6c25a92a2f4b48d501", + "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", + "STRICTENC", + "P2PK with too much R padding" +], +[ + "0x48 0x304502206eb7b92628bfb3c4d2a04b65b986987bcbb1af4fceedb144d5a0437b7ee410590221005f57a52df4aa26366742eed0db182fce51fbcd7159011b0644a7c05943eb228901", + "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", + "STRICTENC", + "P2PK with too much S padding" +], +[ + "0x47 0x30440220d8ad1efd55a3d2b8896495c38aba72056e1b3ca4a6ca15760e843eb1a9b9907602203eb0e8f3d6bec998262dfd03eaeb0f31c4e5105965436dec77550724b3771f3201", + "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", + "STRICTENC", + "P2PK with too little R padding" +], +[ + "0x48 0x304502206c43e065c8a8db3bbe69015afb86a51fb2fc8870defd41d436da2a197d9d6c12022100fcec35816ee2d84ec271ad159fcabf5dd712157051169e48ac328a7818cdb51e01", + "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", + "LOW_S,STRICTENC", + "P2PK with high S" +], +[ + "0x01 0x01 0x47 0x304402200e48ba1cf4d7182db94ffb57bd72ea31b5545dc0d1c512e665779b4fb2badc52022054b8388dfc074c708a75b62359b7be46402751ee40c0a111aef38a837b6ed09801 0x47 0x304402201c9820f59c49107bb30e6175cfc9ec95f897b03beb628b4bc854d2b80392aa0602200235d986ae418bcd111b8814f4c26a0ab5f475fb542a44884fc14912a97a252301 0x47 0x304402204cd7894c6f10a871f5b0c1f9c13228f8cdd4050248f0d0f498ee86be69ee3080022051bd2932c7d585eb600c7194235c74da820935f0d67972fd9545673aa1fd023301", + "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", + "NULLDUMMY", + "3-of-3 with nonzero dummy" +], ["The End"] - ] diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index 653f60d982..49c7abbb31 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -529,19 +529,84 @@ nSequences are max. ["0x00", "SIZE 0 EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"], -["0x47 0x3044022007415aa37ce7eaa6146001ac8bdefca0ddcba0e37c5dc08c4ac99392124ebac802207d382307fd53f65778b07b9c63b6e196edeadf0be719130c5db21ff1e700d67501", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "", "P2PK"], -["0x47 0x3044022069d40999786aeb2fd874f9eb2636461a062dc963471627ed8390a3a5f9556f640220350132a52415ce622f2aadd07f791c591500917ec1f8c5edbc5381ef7942534d01 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", "DUP HASH160 0x14 0x1018853670f9f3b0582c5b9ee8ce93764ac32b93 EQUALVERIFY CHECKSIG", "", "P2PKH"], -["0x47 0x30440220519f2a6632ffa134c7811ea2819e9dcc951f0c7baf461f2dffdd09133f3b080a02203ec6bab5eb6619ed7f41b8701d7c6d70cfc83bb26c5c97f54b2ca6e304fc2bb581", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", "", "P2PK anyonecanpay"], -["0x47 0x30440220279dad2170ffb5639f0a1ea71fc462ee37d75d420d86f84c978bac523c09b7f20220683b2789f5c5528a9e0a0d78f6e40db3f616cf1adb5a5fdef117d5974795cfe201 0x23 0x210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac", "HASH160 0x14 0x23b0ad3477f2178bc0b3eed26e4e6316f4e83aa1 EQUAL", "P2SH", "P2SH(P2PK)"], -["0x47 0x3044022066acbfb5ac96b7cbf3f05a2aaf358c32438c45d1d7359dee9fc1ee636940735f02205606a03fd8cbf6a6fcbcba60c8abb1e385c0b5753cb57a97538159106fd3684e01 0x19 0x76a9147cf9c846cd4882efec4bf07e44ebdad495c94f4b88ac", "HASH160 0x14 0x2df519943d5acc0ef5222091f9dfe3543f489a82 EQUAL", "", "P2SH(P2PKH), bad sig but no VERIFY_P2SH"], -["0 0x47 0x3044022004e791dd30a64c70e55e84e150c002af9feb3ce0ab1f20e86c53d1209003927502205a60453987fcd72aebaaacebc8ce4b15449cdd79e54cc82cefb83e69dbcfeabf01 0x47 0x304402201d021808ce93dd8574cc4f99ae4f11b44305528b0aecbd9f156f08315173643802200944a0ea5c884bd86180aef76d8b1e444860776b251e47d2d6c651a1c6f9930801 0x47 0x30440220446336d7b7de05ebb5683b82b05248ec7d78e88ae8d6125985f5776c887a4cf90220674ab2b2c2f954ba1cf35457d273c90d0c0c1c224d0ae128628740e81129486801", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "", "3-of-3"], -["0 0x47 0x30440220288b06d057cf0eac434ed0c3be9257cc0ca144dd99c11cc8f1a49467a37d8e8002203c496c72253c528e6bc81c42e683aba974d46041a96ef7b00915c863eb2a702901 0x47 0x304402207ffb4da33f40cac839a43000a187bd76a1ee5bf95e46dc1534b38bb7bd0321db022038c078f29d1831f8eb68ffdc2634c654fb01c3467b6457b98ad220653bb2478501 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae", "HASH160 0x14 0xc9e4a896d149702d0d1695434feddd52e24ad78d EQUAL", "P2SH", "P2SH(2-of-3)"], -["0x47 0x304402200001cae94b795baaafb05db38cf24cd75560cab2c36c91e29fac7d0fd2a723a3022058e2e56e568ce7c4b2b106210d114e1faa079407a6ed4154f230667c7d3583bc01", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "", "P2PK with too much R padding but no STRICTENC"], -["0x48 0x304502206d01de7c2a40ac2bb1231ed97f3890a1782f421d4c28b97166deff317990288f0221005e720213b089355be2cf785d81a82c59307d30e1624f450ed9ca1ebbc11cca6d01", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "", "P2PK with too much S padding but no STRICTENC"], -["0x47 0x30440220f3d8889602147d60d26c1d3b21b8db183eac02bf6d2fec1424c0ef377ca6fd7b02202bae8bfe39d00a432d4538a592e338b0ffc44c17d4b7056043d55063cf91f5ef01", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "", "P2PK with too little R padding but no STRICTENC"], -["0x48 0x3045022021bf9184d94f208ac9f4757ebca9b1cbebf008cfc244fe5be1360b1b9aba0e92022100e55074f72f3a1bfddf2ea4ea7ba984f78822e136fe04c8f9c1363238e0233bd801", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "STRICTENC", "P2PK with high S but no LOW_S"], -["0x48 0x304502205c3e81aaf2aad0673f349035b180eba783eba7797af91c979920dea6b17a16d6022100d1d46825c68da1b325f320a3503dad27bb818227f64a38d153554bfd360c0e5301", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "LOW_S", "P2PK with high S but no STRICTENC"], -["0x01 0x01 0x47 0x3044022046ce33d1771b0127dd4c4cef8fdc3218ebdfa60e3793ed700292d8ebd93fb1f402201029d47a414db83e96e31443c2d8b552f971469c4800f5eff7df2f0648521aed01 0x47 0x304402205c53911ad55b054920043962bbda98cf6e57e2db1cd5611138251490baabaa8702201dc80dfceae6007e7772dc13ff6e7ca66a983cb017fe5d46d30118462d83bcf801 0x47 0x304402201937e44a4ec12364f9d32f9d25e7ecbc68aee9ef90069af80efef4c05f6ace9602206c515101c00c75710b32ff7ff8dbaf7c9a0be6e86ed14a0755b47626604f31fd01", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "", "3-of-3 with nonzero dummy but no NULLDUMMY"], +[ + "0x47 0x3044022007415aa37ce7eaa6146001ac8bdefca0ddcba0e37c5dc08c4ac99392124ebac802207d382307fd53f65778b07b9c63b6e196edeadf0be719130c5db21ff1e700d67501", + "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", + "", + "P2PK" +], +[ + "0x47 0x3044022069d40999786aeb2fd874f9eb2636461a062dc963471627ed8390a3a5f9556f640220350132a52415ce622f2aadd07f791c591500917ec1f8c5edbc5381ef7942534d01 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", + "DUP HASH160 0x14 0x1018853670f9f3b0582c5b9ee8ce93764ac32b93 EQUALVERIFY CHECKSIG", + "", + "P2PKH" +], +[ + "0x47 0x30440220519f2a6632ffa134c7811ea2819e9dcc951f0c7baf461f2dffdd09133f3b080a02203ec6bab5eb6619ed7f41b8701d7c6d70cfc83bb26c5c97f54b2ca6e304fc2bb581", + "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", + "", + "P2PK anyonecanpay" +], +[ + "0x47 0x30440220279dad2170ffb5639f0a1ea71fc462ee37d75d420d86f84c978bac523c09b7f20220683b2789f5c5528a9e0a0d78f6e40db3f616cf1adb5a5fdef117d5974795cfe201 0x23 0x210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac", + "HASH160 0x14 0x23b0ad3477f2178bc0b3eed26e4e6316f4e83aa1 EQUAL", + "P2SH", + "P2SH(P2PK)" +], +[ + "0x47 0x3044022066acbfb5ac96b7cbf3f05a2aaf358c32438c45d1d7359dee9fc1ee636940735f02205606a03fd8cbf6a6fcbcba60c8abb1e385c0b5753cb57a97538159106fd3684e01 0x19 0x76a9147cf9c846cd4882efec4bf07e44ebdad495c94f4b88ac", + "HASH160 0x14 0x2df519943d5acc0ef5222091f9dfe3543f489a82 EQUAL", + "", + "P2SH(P2PKH), bad sig but no VERIFY_P2SH" +], +[ + "0 0x47 0x3044022004e791dd30a64c70e55e84e150c002af9feb3ce0ab1f20e86c53d1209003927502205a60453987fcd72aebaaacebc8ce4b15449cdd79e54cc82cefb83e69dbcfeabf01 0x47 0x304402201d021808ce93dd8574cc4f99ae4f11b44305528b0aecbd9f156f08315173643802200944a0ea5c884bd86180aef76d8b1e444860776b251e47d2d6c651a1c6f9930801 0x47 0x30440220446336d7b7de05ebb5683b82b05248ec7d78e88ae8d6125985f5776c887a4cf90220674ab2b2c2f954ba1cf35457d273c90d0c0c1c224d0ae128628740e81129486801", + "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", + "", + "3-of-3" +], +[ + "0 0x47 0x30440220288b06d057cf0eac434ed0c3be9257cc0ca144dd99c11cc8f1a49467a37d8e8002203c496c72253c528e6bc81c42e683aba974d46041a96ef7b00915c863eb2a702901 0x47 0x304402207ffb4da33f40cac839a43000a187bd76a1ee5bf95e46dc1534b38bb7bd0321db022038c078f29d1831f8eb68ffdc2634c654fb01c3467b6457b98ad220653bb2478501 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae", + "HASH160 0x14 0xc9e4a896d149702d0d1695434feddd52e24ad78d EQUAL", + "P2SH", + "P2SH(2-of-3)" +], +[ + "0x47 0x304402200001cae94b795baaafb05db38cf24cd75560cab2c36c91e29fac7d0fd2a723a3022058e2e56e568ce7c4b2b106210d114e1faa079407a6ed4154f230667c7d3583bc01", + "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", + "", + "P2PK with too much R padding but no STRICTENC" +], +[ + "0x48 0x304502206d01de7c2a40ac2bb1231ed97f3890a1782f421d4c28b97166deff317990288f0221005e720213b089355be2cf785d81a82c59307d30e1624f450ed9ca1ebbc11cca6d01", + "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", + "", + "P2PK with too much S padding but no STRICTENC" +], +[ + "0x47 0x30440220f3d8889602147d60d26c1d3b21b8db183eac02bf6d2fec1424c0ef377ca6fd7b02202bae8bfe39d00a432d4538a592e338b0ffc44c17d4b7056043d55063cf91f5ef01", + "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", + "", + "P2PK with too little R padding but no STRICTENC" +], +[ + "0x48 0x3045022021bf9184d94f208ac9f4757ebca9b1cbebf008cfc244fe5be1360b1b9aba0e92022100e55074f72f3a1bfddf2ea4ea7ba984f78822e136fe04c8f9c1363238e0233bd801", + "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", + "STRICTENC", + "P2PK with high S but no LOW_S" +], +[ + "0x48 0x304502205c3e81aaf2aad0673f349035b180eba783eba7797af91c979920dea6b17a16d6022100d1d46825c68da1b325f320a3503dad27bb818227f64a38d153554bfd360c0e5301", + "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", + "LOW_S", + "P2PK with high S but no STRICTENC" +], +[ + "0x01 0x01 0x47 0x3044022046ce33d1771b0127dd4c4cef8fdc3218ebdfa60e3793ed700292d8ebd93fb1f402201029d47a414db83e96e31443c2d8b552f971469c4800f5eff7df2f0648521aed01 0x47 0x304402205c53911ad55b054920043962bbda98cf6e57e2db1cd5611138251490baabaa8702201dc80dfceae6007e7772dc13ff6e7ca66a983cb017fe5d46d30118462d83bcf801 0x47 0x304402201937e44a4ec12364f9d32f9d25e7ecbc68aee9ef90069af80efef4c05f6ace9602206c515101c00c75710b32ff7ff8dbaf7c9a0be6e86ed14a0755b47626604f31fd01", + "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", + "", + "3-of-3 with nonzero dummy but no NULLDUMMY" +], ["The End"] ] diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 6ed3e03f53..424eea11f5 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -34,6 +34,9 @@ using namespace std; using namespace json_spirit; using namespace boost::algorithm; +// Uncomment if you want to output updated JSON tests. +// #define UPDATE_JSON_TESTS + static const unsigned int flags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC; unsigned int ParseScriptFlags(string strFlags); @@ -239,14 +242,14 @@ public: return *this; } - operator std::string() + Array GetJSON() const { - DoPush(); - return "[\"" + - FormatScript(spendTx.vin[0].scriptSig) + "\", \"" + - FormatScript(creditTx.vout[0].scriptPubKey) + "\", \"" + - FormatScriptFlags(flags) + "\", \"" + - comment + "\"],\n"; + Array array; + array.push_back(FormatScript(spendTx.vin[0].scriptSig)); + array.push_back(FormatScript(creditTx.vout[0].scriptPubKey)); + array.push_back(FormatScriptFlags(flags)); + array.push_back(comment); + return array; } std::string GetComment() @@ -377,18 +380,30 @@ BOOST_AUTO_TEST_CASE(script_build) BOOST_FOREACH(TestBuilder& test, good) { test.Test(true); - BOOST_CHECK_MESSAGE(tests_good.count(test.GetComment()) > 0, "Missing auto script_valid test: " + test.GetComment()); - BOOST_CHECK_MESSAGE(ParseScript(tests_good[test.GetComment()][1].get_str()) == test.GetScriptPubKey(), "ScriptPubKey mismatch in auto script_valid test: " + test.GetComment()); - strGood += test; + if (tests_good.count(test.GetComment()) == 0) { +#ifndef UPDATE_JSON_TESTS + BOOST_CHECK_MESSAGE(false, "Missing auto script_valid test: " + test.GetComment()); +#endif + strGood += write_string(Value(test.GetJSON()), true) + ",\n"; + } else { + BOOST_CHECK_MESSAGE(ParseScript(tests_good[test.GetComment()][1].get_str()) == test.GetScriptPubKey(), "ScriptPubKey mismatch in auto script_valid test: " + test.GetComment()); + strGood += write_string(Value(tests_good[test.GetComment()]), true) + ",\n"; + } } BOOST_FOREACH(TestBuilder& test, bad) { test.Test(false); - BOOST_CHECK_MESSAGE(tests_bad.count(test.GetComment()) > 0, "Missing auto script_invalid test: " + test.GetComment()); - BOOST_CHECK_MESSAGE(ParseScript(tests_bad[test.GetComment()][1].get_str()) == test.GetScriptPubKey(), "ScriptPubKey mismatch in auto script_invalid test: " + test.GetComment()); - strBad += test; + if (tests_bad.count(test.GetComment()) == 0) { +#ifndef UPDATE_JSON_TESTS + BOOST_CHECK_MESSAGE(false, "Missing auto script_invalid test: " + test.GetComment()); +#endif + strBad += write_string(Value(test.GetJSON()), true) + ",\n"; + } else { + BOOST_CHECK_MESSAGE(ParseScript(tests_bad[test.GetComment()][1].get_str()) == test.GetScriptPubKey(), "ScriptPubKey mismatch in auto script_invalid test: " + test.GetComment()); + strBad += write_string(Value(tests_bad[test.GetComment()]), true) + ",\n"; + } } -#if 0 +#ifdef UPDATE_JSON_TESTS FILE* valid = fopen("script_valid.json.gen", "w"); fputs(strGood.c_str(), valid); fclose(valid); From cd3269e38e082df3370463221d399e353516ebdc Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 7 Oct 2014 09:34:46 +0200 Subject: [PATCH 0842/1288] contrib: revert changes to github-merge.sh in #5038 --- contrib/devtools/github-merge.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/contrib/devtools/github-merge.sh b/contrib/devtools/github-merge.sh index a83a2a59be..3217a06195 100755 --- a/contrib/devtools/github-merge.sh +++ b/contrib/devtools/github-merge.sh @@ -13,7 +13,7 @@ # name $BRANCH is overwritten with the merged result, and optionally pushed. REPO="$(git config --get githubmerge.repository)" -if [ "d$REPO" = "d" ]; then +if [[ "d$REPO" == "d" ]]; then echo "ERROR: No repository configured. Use this command to set:" >&2 echo "git config githubmerge.repository /" >&2 echo "In addition, you can set the following variables:" >&2 @@ -24,12 +24,12 @@ if [ "d$REPO" = "d" ]; then fi HOST="$(git config --get githubmerge.host)" -if [ "d$HOST" = "d" ]; then +if [[ "d$HOST" == "d" ]]; then HOST="git@github.com" fi BRANCH="$(git config --get githubmerge.branch)" -if [ "d$BRANCH" = "d" ]; then +if [[ "d$BRANCH" == "d" ]]; then BRANCH="master" fi @@ -37,12 +37,12 @@ TESTCMD="$(git config --get githubmerge.testcmd)" PULL="$1" -if [ "d$PULL" = "d" ]; then +if [[ "d$PULL" == "d" ]]; then echo "Usage: $0 pullnumber [branch]" >&2 exit 2 fi -if [ "d$2" != "d" ]; then +if [[ "d$2" != "d" ]]; then BRANCH="$2" fi @@ -101,7 +101,7 @@ else fi # Run test command if configured. -if [ "d$TESTCMD" != "d" ]; then +if [[ "d$TESTCMD" != "d" ]]; then # Go up to the repository's root. while [ ! -d .git ]; do cd ..; done if ! $TESTCMD; then @@ -112,10 +112,10 @@ if [ "d$TESTCMD" != "d" ]; then # Show the created merge. git diff pull/"$PULL"/merge..pull/"$PULL"/local-merge >"$TMPDIR"/diff git diff pull/"$PULL"/base..pull/"$PULL"/local-merge - if [ "$(<"$TMPDIR"/diff)" != "" ]; then + if [[ "$(<"$TMPDIR"/diff)" != "" ]]; then echo "WARNING: merge differs from github!" >&2 read -p "Type 'ignore' to continue. " -r >&2 - if [ "d$REPLY" =~ ^d[iI][gG][nN][oO][rR][eE]$ ]; then + if [[ "d$REPLY" =~ ^d[iI][gG][nN][oO][rR][eE]$ ]]; then echo "Difference with github ignored." >&2 else cleanup @@ -124,7 +124,7 @@ if [ "d$TESTCMD" != "d" ]; then fi read -p "Press 'd' to accept the diff. " -n 1 -r >&2 echo - if [ "d$REPLY" =~ ^d[dD]$ ]; then + if [[ "d$REPLY" =~ ^d[dD]$ ]]; then echo "Diff accepted." >&2 else echo "ERROR: Diff rejected." >&2 @@ -139,7 +139,7 @@ else bash -i read -p "Press 'm' to accept the merge. " -n 1 -r >&2 echo - if [ "d$REPLY" =~ ^d[Mm]$ ]; then + if [[ "d$REPLY" =~ ^d[Mm]$ ]]; then echo "Merge accepted." >&2 else echo "ERROR: Merge rejected." >&2 @@ -151,8 +151,8 @@ fi # Sign the merge commit. read -p "Press 's' to sign off on the merge. " -n 1 -r >&2 echo -if [ "d$REPLY" =~ ^d[Ss]$ ]; then - if [ "$(git config --get user.signingkey)" = "" ]; then +if [[ "d$REPLY" =~ ^d[Ss]$ ]]; then + if [[ "$(git config --get user.signingkey)" == "" ]]; then echo "WARNING: No GPG signing key set, not signing. Set one using:" >&2 echo "git config --global user.signingkey " >&2 git commit -q --signoff --amend --no-edit @@ -168,6 +168,6 @@ cleanup # Push the result. read -p "Type 'push' to push the result to $HOST:$REPO, branch $BRANCH. " -r >&2 -if [ "d$REPLY" =~ ^d[Pp][Uu][Ss][Hh]$ ]; then +if [[ "d$REPLY" =~ ^d[Pp][Uu][Ss][Hh]$ ]]; then git push "$HOST":"$REPO" refs/heads/"$BRANCH" fi From 9df9cf5a9f5f56261b0b226dec6249f9dfbefed6 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 7 Oct 2014 02:22:47 +0200 Subject: [PATCH 0843/1288] Make SCRIPT_VERIFY_STRICTENC compatible with BIP62 * Delete canonical_tests.cpp, and move the tests to script_tests.cpp. * Split off SCRIPT_VERIFY_DERSIG from SCRIPT_VERIFY_STRICTENC (the BIP62 part of it). * Change signature STRICTENC/DERSIG semantics to fail the script entirely rather than the CHECKSIG result (softfork safety, and BIP62 requirement). * Add many autogenerated tests for several odd cases. * Mention specific BIP62 rules in the script verification flags. --- src/Makefile.test.include | 1 - src/script/interpreter.cpp | 78 +++++++++++++++------ src/script/interpreter.h | 25 +++++-- src/test/canonical_tests.cpp | 113 ------------------------------ src/test/data/script_invalid.json | 48 +++++++++++++ src/test/data/script_valid.json | 62 +++++++++++++--- src/test/script_tests.cpp | 72 +++++++++++++++---- src/test/transaction_tests.cpp | 1 + 8 files changed, 235 insertions(+), 165 deletions(-) delete mode 100644 src/test/canonical_tests.cpp diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 99ac09e1a4..b20e226c3d 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -40,7 +40,6 @@ BITCOIN_TESTS =\ test/base58_tests.cpp \ test/base64_tests.cpp \ test/bloom_tests.cpp \ - test/canonical_tests.cpp \ test/checkblock_tests.cpp \ test/Checkpoints_tests.cpp \ test/compress_tests.cpp \ diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 56140f19db..ae66217b7c 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -52,10 +52,7 @@ static inline void popstack(vector& stack) stack.pop_back(); } -bool IsCanonicalPubKey(const valtype &vchPubKey, unsigned int flags) { - if (!(flags & SCRIPT_VERIFY_STRICTENC)) - return true; - +bool static IsCompressedOrUncompressedPubKey(const valtype &vchPubKey) { if (vchPubKey.size() < 33) return error("Non-canonical public key: too short"); if (vchPubKey[0] == 0x04) { @@ -70,10 +67,7 @@ bool IsCanonicalPubKey(const valtype &vchPubKey, unsigned int flags) { return true; } -bool IsCanonicalSignature(const valtype &vchSig, unsigned int flags) { - if (!(flags & SCRIPT_VERIFY_STRICTENC)) - return true; - +bool static IsDERSignature(const valtype &vchSig) { // See https://bitcointalk.org/index.php?topic=8392.msg127623#msg127623 // A canonical signature exists of: <30> <02> <02> // Where R and S are not negative (their first byte has its highest bit not set), and not @@ -83,9 +77,6 @@ bool IsCanonicalSignature(const valtype &vchSig, unsigned int flags) { return error("Non-canonical signature: too short"); if (vchSig.size() > 73) return error("Non-canonical signature: too long"); - unsigned char nHashType = vchSig[vchSig.size() - 1] & (~(SIGHASH_ANYONECANPAY)); - if (nHashType < SIGHASH_ALL || nHashType > SIGHASH_SINGLE) - return error("Non-canonical signature: unknown hashtype byte"); if (vchSig[0] != 0x30) return error("Non-canonical signature: wrong type"); if (vchSig[1] != vchSig.size()-3) @@ -117,14 +108,51 @@ bool IsCanonicalSignature(const valtype &vchSig, unsigned int flags) { if (nLenS > 1 && (S[0] == 0x00) && !(S[1] & 0x80)) return error("Non-canonical signature: S value excessively padded"); - if (flags & SCRIPT_VERIFY_LOW_S) { - // If the S value is above the order of the curve divided by two, its - // complement modulo the order could have been used instead, which is - // one byte shorter when encoded correctly. - if (!CKey::CheckSignatureElement(S, nLenS, true)) - return error("Non-canonical signature: S value is unnecessarily high"); - } + return true; +} +bool static IsLowDERSignature(const valtype &vchSig) { + if (!IsDERSignature(vchSig)) { + return false; + } + unsigned int nLenR = vchSig[3]; + unsigned int nLenS = vchSig[5+nLenR]; + const unsigned char *S = &vchSig[6+nLenR]; + // If the S value is above the order of the curve divided by two, its + // complement modulo the order could have been used instead, which is + // one byte shorter when encoded correctly. + if (!CKey::CheckSignatureElement(S, nLenS, true)) + return error("Non-canonical signature: S value is unnecessarily high"); + + return true; +} + +bool static IsDefinedHashtypeSignature(const valtype &vchSig) { + if (vchSig.size() == 0) { + return false; + } + unsigned char nHashType = vchSig[vchSig.size() - 1] & (~(SIGHASH_ANYONECANPAY)); + if (nHashType < SIGHASH_ALL || nHashType > SIGHASH_SINGLE) + return error("Non-canonical signature: unknown hashtype byte"); + + return true; +} + +bool static CheckSignatureEncoding(const valtype &vchSig, unsigned int flags) { + if ((flags & (SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_LOW_S | SCRIPT_VERIFY_STRICTENC)) != 0 && !IsDERSignature(vchSig)) { + return false; + } else if ((flags & SCRIPT_VERIFY_LOW_S) != 0 && !IsLowDERSignature(vchSig)) { + return false; + } else if ((flags & SCRIPT_VERIFY_STRICTENC) != 0 && !IsDefinedHashtypeSignature(vchSig)) { + return false; + } + return true; +} + +bool static CheckPubKeyEncoding(const valtype &vchSig, unsigned int flags) { + if ((flags & SCRIPT_VERIFY_STRICTENC) != 0 && !IsCompressedOrUncompressedPubKey(vchSig)) { + return false; + } return true; } @@ -670,8 +698,11 @@ bool EvalScript(vector >& stack, const CScript& script, un // Drop the signature, since there's no way for a signature to sign itself scriptCode.FindAndDelete(CScript(vchSig)); - bool fSuccess = IsCanonicalSignature(vchSig, flags) && IsCanonicalPubKey(vchPubKey, flags) && - checker.CheckSig(vchSig, vchPubKey, scriptCode); + if (!CheckSignatureEncoding(vchSig, flags)) { + return false; + } + + bool fSuccess = CheckPubKeyEncoding(vchPubKey, flags) && checker.CheckSig(vchSig, vchPubKey, scriptCode); popstack(stack); popstack(stack); @@ -730,9 +761,12 @@ bool EvalScript(vector >& stack, const CScript& script, un valtype& vchSig = stacktop(-isig); valtype& vchPubKey = stacktop(-ikey); + if (!CheckSignatureEncoding(vchSig, flags)) { + return false; + } + // Check signature - bool fOk = IsCanonicalSignature(vchSig, flags) && IsCanonicalPubKey(vchPubKey, flags) && - checker.CheckSig(vchSig, vchPubKey, scriptCode); + bool fOk = CheckPubKeyEncoding(vchPubKey, flags) && checker.CheckSig(vchSig, vchPubKey, scriptCode); if (fOk) { isig++; diff --git a/src/script/interpreter.h b/src/script/interpreter.h index 0ff73964ba..de5ce2ced1 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -28,14 +28,25 @@ enum enum { SCRIPT_VERIFY_NONE = 0, - SCRIPT_VERIFY_P2SH = (1U << 0), // evaluate P2SH (BIP16) subscripts - SCRIPT_VERIFY_STRICTENC = (1U << 1), // enforce strict conformance to DER and SEC2 for signatures and pubkeys - SCRIPT_VERIFY_LOW_S = (1U << 2), // enforce low S values ( &vchPubKey, unsigned int flags); -bool IsCanonicalSignature(const std::vector &vchSig, unsigned int flags); + // Evaluate P2SH subscripts (softfork safe, BIP16). + SCRIPT_VERIFY_P2SH = (1U << 0), + + // Passing a non-strict-DER signature or one with undefined hashtype to a checksig operation causes script failure. + // Passing a pubkey that is not (0x04 + 64 bytes) or (0x02 or 0x03 + 32 bytes) to checksig causes that pubkey to be + // skipped (not softfork safe: this flag can widen the validity of OP_CHECKSIG OP_NOT). + SCRIPT_VERIFY_STRICTENC = (1U << 1), + + // Passing a non-strict-DER signature to a checksig operation causes script failure (softfork safe, BIP62 rule 1) + SCRIPT_VERIFY_DERSIG = (1U << 2), + + // Passing a non-strict-DER signature or one with S > order/2 to a checksig operation causes script failure + // (softfork safe, BIP62 rule 5). + SCRIPT_VERIFY_LOW_S = (1U << 3), + + // verify dummy stack item consumed by CHECKMULTISIG is of zero-length (softfork safe, BIP62 rule 7). + SCRIPT_VERIFY_NULLDUMMY = (1U << 4), +}; uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType); diff --git a/src/test/canonical_tests.cpp b/src/test/canonical_tests.cpp deleted file mode 100644 index a17099de72..0000000000 --- a/src/test/canonical_tests.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers -// Distributed under the MIT/X11 software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -// -// Unit tests for canonical signatures -// - -#include "data/sig_noncanonical.json.h" -#include "data/sig_canonical.json.h" -#include "key.h" -#include "random.h" -#include "script/interpreter.h" -#include "util.h" -#include "utilstrencodings.h" - -#include -#include -#include "json/json_spirit_writer_template.h" -#include - -using namespace std; -using namespace json_spirit; - -// In script_tests.cpp -extern Array read_json(const std::string& jsondata); - -BOOST_AUTO_TEST_SUITE(canonical_tests) - -// OpenSSL-based test for canonical signature (without test for hashtype byte) -bool static IsCanonicalSignature_OpenSSL_inner(const std::vector& vchSig) -{ - if (vchSig.size() == 0) - return false; - const unsigned char *input = &vchSig[0]; - ECDSA_SIG *psig = NULL; - d2i_ECDSA_SIG(&psig, &input, vchSig.size()); - if (psig == NULL) - return false; - unsigned char buf[256]; - unsigned char *pbuf = buf; - unsigned int nLen = i2d_ECDSA_SIG(psig, NULL); - if (nLen != vchSig.size()) { - ECDSA_SIG_free(psig); - return false; - } - nLen = i2d_ECDSA_SIG(psig, &pbuf); - ECDSA_SIG_free(psig); - return (memcmp(&vchSig[0], &buf[0], nLen) == 0); -} - -// OpenSSL-based test for canonical signature -bool static IsCanonicalSignature_OpenSSL(const std::vector &vchSignature) { - if (vchSignature.size() < 1) - return false; - if (vchSignature.size() > 127) - return false; - if (vchSignature[vchSignature.size() - 1] & 0x7C) - return false; - - std::vector vchSig(vchSignature); - vchSig.pop_back(); - if (!IsCanonicalSignature_OpenSSL_inner(vchSig)) - return false; - return true; -} - -BOOST_AUTO_TEST_CASE(script_canon) -{ - Array tests = read_json(std::string(json_tests::sig_canonical, json_tests::sig_canonical + sizeof(json_tests::sig_canonical))); - - BOOST_FOREACH(Value &tv, tests) { - string test = tv.get_str(); - if (IsHex(test)) { - std::vector sig = ParseHex(test); - BOOST_CHECK_MESSAGE(IsCanonicalSignature(sig, SCRIPT_VERIFY_STRICTENC), test); - BOOST_CHECK_MESSAGE(IsCanonicalSignature_OpenSSL(sig), test); - } - } -} - -BOOST_AUTO_TEST_CASE(script_noncanon) -{ - Array tests = read_json(std::string(json_tests::sig_noncanonical, json_tests::sig_noncanonical + sizeof(json_tests::sig_noncanonical))); - - BOOST_FOREACH(Value &tv, tests) { - string test = tv.get_str(); - if (IsHex(test)) { - std::vector sig = ParseHex(test); - BOOST_CHECK_MESSAGE(!IsCanonicalSignature(sig, SCRIPT_VERIFY_STRICTENC), test); - BOOST_CHECK_MESSAGE(!IsCanonicalSignature_OpenSSL(sig), test); - } - } -} - -BOOST_AUTO_TEST_CASE(script_signstrict) -{ - for (int i=0; i<100; i++) { - CKey key; - key.MakeNewKey(i & 1); - std::vector sig; - uint256 hash = GetRandHash(); - - BOOST_CHECK(key.Sign(hash, sig)); // Generate a random signature. - BOOST_CHECK(key.GetPubKey().Verify(hash, sig)); // Check it. - sig.push_back(0x01); // Append a sighash type. - - BOOST_CHECK(IsCanonicalSignature(sig, SCRIPT_VERIFY_STRICTENC | SCRIPT_VERIFY_LOW_S)); - BOOST_CHECK(IsCanonicalSignature_OpenSSL(sig)); - } -} - -BOOST_AUTO_TEST_SUITE_END() diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index e62b8eeb75..b6447cb221 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -444,18 +444,66 @@ nSequences are max. "STRICTENC", "P2PK with too little R padding" ], +[ + "0x47 0x30440220001d0f82c127470cb38316c96b1719b33382353687a1146a776dee8259606905022062cd1fc8eacef819d68f0f41cc9ae9fdc2e29b70c3c7ad2c6c18f39b4e35c42701", + "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT", + "DERSIG", + "P2PK NOT with bad sig with too much R padding" +], +[ + "0x47 0x30440220005d727e2a82d6e8a98a6da6fbc281325644d1a40455e386fdb17883a8e6bc4d02202d15cca42ce136047a980d288e60c679d7e84cce18c3ceffb6bc81b9e9ba517801", + "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT", + "", + "P2PK NOT with too much R padding but no DERSIG" +], +[ + "0x47 0x30440220006e8bc4f82032b12bd594847c16d8b2986de734aa3b0528bd89d664d41e6d1c02200cfd582694891bcfa2e630e899bda257486eba00a007222fae71144dba07dc2901", + "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT", + "DERSIG", + "P2PK NOT with too much R padding" +], [ "0x48 0x304502206c43e065c8a8db3bbe69015afb86a51fb2fc8870defd41d436da2a197d9d6c12022100fcec35816ee2d84ec271ad159fcabf5dd712157051169e48ac328a7818cdb51e01", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "LOW_S,STRICTENC", "P2PK with high S" ], +[ + "0x47 0x304402203aab50cd7c30cc1e1475dee615b295bcee6ccf8aa8a7f6cda6b696c70d79cbb40220558e43fe7596c31146e2d077698d5a9c38351d8ba567549a2ae43ca97231c39501", + "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", + "STRICTENC", + "P2PK with hybrid pubkey" +], +[ + "0x47 0x304402205745e8f846110c185ee1185c01843a108588b81463d2c34d4a3f2445529f12fe02206ee6a2657bbc4e2bb74bfc44c3a5c4f410ed6356ca68982465de6ca807c807c201", + "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", + "", + "P2PK NOT with hybrid pubkey but no STRICTENC" +], +[ + "0x47 0x304402201f82b99a813c9c48c8dee8d2c43b8f637b72353fe9bdcc084537bc17e2ab770402200c43b96a5f7e115f0114eabda32e068145965cb6c7b5ef64833bb4fcf9fc1b3b05", + "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", + "STRICTENC", + "P2PK with undefined hashtype" +], +[ + "0x47 0x30440220166848cd5b82a32b5944d90de3c35249354b43773c2ece1844ee8d1103e2f6c602203b6b046da4243c77adef80ada9201b27bbfdf7f9d5428f40434b060432afd62005", + "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG NOT", + "STRICTENC", + "P2PK NOT with invalid sig and undefined hashtype" +], [ "0x01 0x01 0x47 0x304402200e48ba1cf4d7182db94ffb57bd72ea31b5545dc0d1c512e665779b4fb2badc52022054b8388dfc074c708a75b62359b7be46402751ee40c0a111aef38a837b6ed09801 0x47 0x304402201c9820f59c49107bb30e6175cfc9ec95f897b03beb628b4bc854d2b80392aa0602200235d986ae418bcd111b8814f4c26a0ab5f475fb542a44884fc14912a97a252301 0x47 0x304402204cd7894c6f10a871f5b0c1f9c13228f8cdd4050248f0d0f498ee86be69ee3080022051bd2932c7d585eb600c7194235c74da820935f0d67972fd9545673aa1fd023301", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "NULLDUMMY", "3-of-3 with nonzero dummy" ], +[ + "0x01 0x01 0x47 0x304402201847fc3b8f7597768e7f543c58da1fca6e8e35eb28979431e6b637572ce6eaa4022048dd58608e040841d0bf52a70cfb70e1a9c8d2826fad068f4e9d2bf5c87766a501 0x47 0x30440220711311a72516affed73363763983d05c3d6a06a2eadf5d76b90b4354162ba94302204841a69e5955a7dc8e4ab3105fd0c86040c1dac6016297a51ddbf5079c28756801 0x47 0x30440220267e331a378191e7282fd10d61c97bf74bc97c233c5833d677936424ac08dee502201eee83d88b91988e1c4d9b979df2404aa190e0987a8ca09c4e5cd61da1d48ecc01", + "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG NOT", + "NULLDUMMY", + "3-of-3 NOT with invalid sig with nonzero dummy" +], ["The End"] ] diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index 49c7abbb31..88bec7238c 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -572,22 +572,28 @@ nSequences are max. "P2SH(2-of-3)" ], [ - "0x47 0x304402200001cae94b795baaafb05db38cf24cd75560cab2c36c91e29fac7d0fd2a723a3022058e2e56e568ce7c4b2b106210d114e1faa079407a6ed4154f230667c7d3583bc01", + "0x47 0x30440220001fff8863c84c0efc8eea5bffb7f388313f966f23a00ad3c0acc30ff5339684022016e6d78f51a3a1c362745931ca40b24f71cba2903dbfe5a6d392a9189127d83701", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "", - "P2PK with too much R padding but no STRICTENC" + "P2PK with too much R padding but no DERSIG" ], [ - "0x48 0x304502206d01de7c2a40ac2bb1231ed97f3890a1782f421d4c28b97166deff317990288f0221005e720213b089355be2cf785d81a82c59307d30e1624f450ed9ca1ebbc11cca6d01", + "0x48 0x304502202323d56f293842b544cacedd06baafb999196dfa1c2975314848c158ac606655022100514bd98186b8a3a1cc87f4aff76aed797781389f13f50d87bf95b2df6e488fcc01", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "", - "P2PK with too much S padding but no STRICTENC" + "P2PK with too much S padding but no DERSIG" ], [ - "0x47 0x30440220f3d8889602147d60d26c1d3b21b8db183eac02bf6d2fec1424c0ef377ca6fd7b02202bae8bfe39d00a432d4538a592e338b0ffc44c17d4b7056043d55063cf91f5ef01", + "0x47 0x30440220d31c24bb6c08a496e7698a08fd41975115d7b55bfaa31cb2d573e09481e59a6702206a691239996434076b78a4e1cf46fc8e993b468a9c77fb1832186aa8040a61a201", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "", - "P2PK with too little R padding but no STRICTENC" + "P2PK with too little R padding but no DERSIG" +], +[ + "0x47 0x30440220007c2cc7aef1801c2937447703c87ef2a3744209ad98da2abadd4ba8bb2e3ea00220503a275582c9f9e9ff30260c81b7f64b8b696f22105605cc8241fb76a797316201", + "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT", + "", + "P2PK NOT with bad sig with too much R padding but no DERSIG" ], [ "0x48 0x3045022021bf9184d94f208ac9f4757ebca9b1cbebf008cfc244fe5be1360b1b9aba0e92022100e55074f72f3a1bfddf2ea4ea7ba984f78822e136fe04c8f9c1363238e0233bd801", @@ -596,10 +602,40 @@ nSequences are max. "P2PK with high S but no LOW_S" ], [ - "0x48 0x304502205c3e81aaf2aad0673f349035b180eba783eba7797af91c979920dea6b17a16d6022100d1d46825c68da1b325f320a3503dad27bb818227f64a38d153554bfd360c0e5301", - "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", - "LOW_S", - "P2PK with high S but no STRICTENC" + "0x47 0x304402202163bc732c21b7de0251297d3c6c2ece182782e85fc5e19d6036f1130a79051e022033827811634924ebba68767537d78dd7bd9109ae2a89a60587927abdc25eb06401", + "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", + "", + "P2PK with hybrid pubkey but no STRICTENC" +], +[ + "0x47 0x3044022078033e4227aa05ded69d8da579966578e230d8a7fb44d5f1a0620c3853c24f78022006a2e3f4d872ac8dfdc529110aa37301d65a76255a4b6cce2992adacd4d2c4e201", + "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", + "STRICTENC", + "P2PK NOT with hybrid pubkey" +], +[ + "0x47 0x3044022078d6c447887e88dcbe1bc5b613645280df6f4e5935648bc226e9d91da71b3216022047d6b7ef0949b228fc1b359afb8d50500268711354298217b983c26970790c7601", + "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", + "", + "P2PK NOT with invalid hybrid pubkey but no STRICTENC" +], +[ + "0x47 0x304402207592427de20e315d644839754f2a5cca5b978b983a15e6da82109ede01722baa022032ceaf78590faa3f7743821e1b47b897ed1a57f6ee1c8a7519d23774d8de3c4401", + "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", + "STRICTENC", + "P2PK NOT with invalid hybrid pubkey" +], +[ + "0x47 0x304402204649e9517ef0377a8f8270bd423053fd98ddff62d74ea553e9579558abbb75e4022044a2b2344469c12e35ed898987711272b634733dd0f5e051288eceb04bd4669e05", + "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", + "", + "P2PK with undefined hashtype but no STRICTENC" +], +[ + "0x47 0x304402207f1cf1866a2df0bb4b8d84d0ade72aa3abb6aaab0639d608b23d9e10ead0c48202203caa97f22c3439443eea4b89f7f6729854df0f567a8184d6ecc6e8b6c68c3e9d05", + "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG NOT", + "", + "P2PK NOT with invalid sig and undefined hashtype but no STRICTENC" ], [ "0x01 0x01 0x47 0x3044022046ce33d1771b0127dd4c4cef8fdc3218ebdfa60e3793ed700292d8ebd93fb1f402201029d47a414db83e96e31443c2d8b552f971469c4800f5eff7df2f0648521aed01 0x47 0x304402205c53911ad55b054920043962bbda98cf6e57e2db1cd5611138251490baabaa8702201dc80dfceae6007e7772dc13ff6e7ca66a983cb017fe5d46d30118462d83bcf801 0x47 0x304402201937e44a4ec12364f9d32f9d25e7ecbc68aee9ef90069af80efef4c05f6ace9602206c515101c00c75710b32ff7ff8dbaf7c9a0be6e86ed14a0755b47626604f31fd01", @@ -607,6 +643,12 @@ nSequences are max. "", "3-of-3 with nonzero dummy but no NULLDUMMY" ], +[ + "0x01 0x01 0x47 0x30440220195038dbc6b2ae1199f86a6777824f7c5149789d85f655a3534a4422b8fba38c02204df9db87d2eb9fe06edc66870d9ac4c9ce673459f9d43cee0347ce4ffb02ee5a01 0x47 0x3044022010a45f30c6fa97a186eba9e6b595ab87d3dfcbf05dcaf1f1b8e3e7bf39515bb802203474e78d3d372e5f5c0f8c257ce8300c4bb8f37c51d4a894e11a91b5817da6ed01 0x47 0x30440220039cffd8e39850f95112662b1220b14b3c0d3d8a2772e13c947bfbf96345a64e02204154bfa77e2c0134d5434353bed82141e5da1cc479954aa288d5f0671480a04b01", + "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG NOT", + "", + "3-of-3 NOT with invalid sig and nonzero dummy but no NULLDUMMY" +], ["The End"] ] diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 424eea11f5..a4b0212494 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -242,8 +242,9 @@ public: return *this; } - Array GetJSON() const + Array GetJSON() { + DoPush(); Array array; array.push_back(FormatScript(spendTx.vin[0].scriptSig)); array.push_back(FormatScript(creditTx.vout[0].scriptPubKey)); @@ -319,40 +320,87 @@ BOOST_AUTO_TEST_CASE(script_build) ).Num(0).PushSig(keys.key1).Num(0).PushRedeem()); good.push_back(TestBuilder(CScript() << keys.pubkey1C << OP_CHECKSIG, - "P2PK with too much R padding but no STRICTENC", 0 + "P2PK with too much R padding but no DERSIG", 0 ).PushSig(keys.key1, SIGHASH_ALL, 31, 32).EditPush(1, "43021F", "44022000")); bad.push_back(TestBuilder(CScript() << keys.pubkey1C << OP_CHECKSIG, - "P2PK with too much R padding", SCRIPT_VERIFY_STRICTENC + "P2PK with too much R padding", SCRIPT_VERIFY_DERSIG ).PushSig(keys.key1, SIGHASH_ALL, 31, 32).EditPush(1, "43021F", "44022000")); good.push_back(TestBuilder(CScript() << keys.pubkey1C << OP_CHECKSIG, - "P2PK with too much S padding but no STRICTENC", 0 + "P2PK with too much S padding but no DERSIG", 0 ).PushSig(keys.key1, SIGHASH_ALL).EditPush(1, "44", "45").EditPush(37, "20", "2100")); bad.push_back(TestBuilder(CScript() << keys.pubkey1C << OP_CHECKSIG, - "P2PK with too much S padding", SCRIPT_VERIFY_STRICTENC + "P2PK with too much S padding", SCRIPT_VERIFY_DERSIG ).PushSig(keys.key1, SIGHASH_ALL).EditPush(1, "44", "45").EditPush(37, "20", "2100")); good.push_back(TestBuilder(CScript() << keys.pubkey1C << OP_CHECKSIG, - "P2PK with too little R padding but no STRICTENC", 0 + "P2PK with too little R padding but no DERSIG", 0 ).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, "45022100", "440220")); bad.push_back(TestBuilder(CScript() << keys.pubkey1C << OP_CHECKSIG, - "P2PK with too little R padding", SCRIPT_VERIFY_STRICTENC + "P2PK with too little R padding", SCRIPT_VERIFY_DERSIG ).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, "45022100", "440220")); + good.push_back(TestBuilder(CScript() << keys.pubkey2C << OP_CHECKSIG << OP_NOT, + "P2PK NOT with bad sig with too much R padding but no DERSIG", 0 + ).PushSig(keys.key2, SIGHASH_ALL, 31, 32).EditPush(1, "43021F", "44022000").DamagePush(10)); + bad.push_back(TestBuilder(CScript() << keys.pubkey2C << OP_CHECKSIG << OP_NOT, + "P2PK NOT with bad sig with too much R padding", SCRIPT_VERIFY_DERSIG + ).PushSig(keys.key2, SIGHASH_ALL, 31, 32).EditPush(1, "43021F", "44022000").DamagePush(10)); + bad.push_back(TestBuilder(CScript() << keys.pubkey2C << OP_CHECKSIG << OP_NOT, + "P2PK NOT with too much R padding but no DERSIG", 0 + ).PushSig(keys.key2, SIGHASH_ALL, 31, 32).EditPush(1, "43021F", "44022000")); + bad.push_back(TestBuilder(CScript() << keys.pubkey2C << OP_CHECKSIG << OP_NOT, + "P2PK NOT with too much R padding", SCRIPT_VERIFY_DERSIG + ).PushSig(keys.key2, SIGHASH_ALL, 31, 32).EditPush(1, "43021F", "44022000")); good.push_back(TestBuilder(CScript() << keys.pubkey2C << OP_CHECKSIG, - "P2PK with high S but no LOW_S", SCRIPT_VERIFY_STRICTENC - ).PushSig(keys.key2, SIGHASH_ALL, 32, 33)); - good.push_back(TestBuilder(CScript() << keys.pubkey2C << OP_CHECKSIG, - "P2PK with high S but no STRICTENC", SCRIPT_VERIFY_LOW_S + "P2PK with high S but no LOW_S", 0 ).PushSig(keys.key2, SIGHASH_ALL, 32, 33)); bad.push_back(TestBuilder(CScript() << keys.pubkey2C << OP_CHECKSIG, - "P2PK with high S", SCRIPT_VERIFY_LOW_S | SCRIPT_VERIFY_STRICTENC + "P2PK with high S", SCRIPT_VERIFY_LOW_S ).PushSig(keys.key2, SIGHASH_ALL, 32, 33)); + good.push_back(TestBuilder(CScript() << keys.pubkey0H << OP_CHECKSIG, + "P2PK with hybrid pubkey but no STRICTENC", 0 + ).PushSig(keys.key0, SIGHASH_ALL)); + bad.push_back(TestBuilder(CScript() << keys.pubkey0H << OP_CHECKSIG, + "P2PK with hybrid pubkey", SCRIPT_VERIFY_STRICTENC + ).PushSig(keys.key0, SIGHASH_ALL)); + bad.push_back(TestBuilder(CScript() << keys.pubkey0H << OP_CHECKSIG << OP_NOT, + "P2PK NOT with hybrid pubkey but no STRICTENC", 0 + ).PushSig(keys.key0, SIGHASH_ALL)); + good.push_back(TestBuilder(CScript() << keys.pubkey0H << OP_CHECKSIG << OP_NOT, + "P2PK NOT with hybrid pubkey", SCRIPT_VERIFY_STRICTENC + ).PushSig(keys.key0, SIGHASH_ALL)); + good.push_back(TestBuilder(CScript() << keys.pubkey0H << OP_CHECKSIG << OP_NOT, + "P2PK NOT with invalid hybrid pubkey but no STRICTENC", 0 + ).PushSig(keys.key0, SIGHASH_ALL).DamagePush(10)); + good.push_back(TestBuilder(CScript() << keys.pubkey0H << OP_CHECKSIG << OP_NOT, + "P2PK NOT with invalid hybrid pubkey", SCRIPT_VERIFY_STRICTENC + ).PushSig(keys.key0, SIGHASH_ALL).DamagePush(10)); + + good.push_back(TestBuilder(CScript() << keys.pubkey1 << OP_CHECKSIG, + "P2PK with undefined hashtype but no STRICTENC", 0 + ).PushSig(keys.key1, 5)); + bad.push_back(TestBuilder(CScript() << keys.pubkey1 << OP_CHECKSIG, + "P2PK with undefined hashtype", SCRIPT_VERIFY_STRICTENC + ).PushSig(keys.key1, 5)); + good.push_back(TestBuilder(CScript() << keys.pubkey1 << OP_CHECKSIG << OP_NOT, + "P2PK NOT with invalid sig and undefined hashtype but no STRICTENC", 0 + ).PushSig(keys.key1, 5).DamagePush(10)); + bad.push_back(TestBuilder(CScript() << keys.pubkey1 << OP_CHECKSIG << OP_NOT, + "P2PK NOT with invalid sig and undefined hashtype", SCRIPT_VERIFY_STRICTENC + ).PushSig(keys.key1, 5).DamagePush(10)); + good.push_back(TestBuilder(CScript() << OP_3 << keys.pubkey0C << keys.pubkey1C << keys.pubkey2C << OP_3 << OP_CHECKMULTISIG, "3-of-3 with nonzero dummy but no NULLDUMMY", 0 ).Num(1).PushSig(keys.key0).PushSig(keys.key1).PushSig(keys.key2)); bad.push_back(TestBuilder(CScript() << OP_3 << keys.pubkey0C << keys.pubkey1C << keys.pubkey2C << OP_3 << OP_CHECKMULTISIG, "3-of-3 with nonzero dummy", SCRIPT_VERIFY_NULLDUMMY ).Num(1).PushSig(keys.key0).PushSig(keys.key1).PushSig(keys.key2)); + good.push_back(TestBuilder(CScript() << OP_3 << keys.pubkey0C << keys.pubkey1C << keys.pubkey2C << OP_3 << OP_CHECKMULTISIG << OP_NOT, + "3-of-3 NOT with invalid sig and nonzero dummy but no NULLDUMMY", 0 + ).Num(1).PushSig(keys.key0).PushSig(keys.key1).PushSig(keys.key2).DamagePush(10)); + bad.push_back(TestBuilder(CScript() << OP_3 << keys.pubkey0C << keys.pubkey1C << keys.pubkey2C << OP_3 << OP_CHECKMULTISIG << OP_NOT, + "3-of-3 NOT with invalid sig with nonzero dummy", SCRIPT_VERIFY_NULLDUMMY + ).Num(1).PushSig(keys.key0).PushSig(keys.key1).PushSig(keys.key2).DamagePush(10)); std::map tests_good; std::map tests_bad; diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index f14f600bbe..18cb8f3d1b 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -31,6 +31,7 @@ static std::map mapFlagNames = boost::assign::map_list_of (string("NONE"), (unsigned int)SCRIPT_VERIFY_NONE) (string("P2SH"), (unsigned int)SCRIPT_VERIFY_P2SH) (string("STRICTENC"), (unsigned int)SCRIPT_VERIFY_STRICTENC) + (string("DERSIG"), (unsigned int)SCRIPT_VERIFY_DERSIG) (string("LOW_S"), (unsigned int)SCRIPT_VERIFY_LOW_S) (string("NULLDUMMY"), (unsigned int)SCRIPT_VERIFY_NULLDUMMY); From e01a7939d3a3b231f68ae2f36cbc4de0cf4d4999 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Tue, 7 Oct 2014 13:11:48 -0400 Subject: [PATCH 0844/1288] Refactor -alertnotify code Refactor common -alertnotify code into static CAlert::Notify method. --- src/alert.cpp | 37 +++++++++++++++++++++---------------- src/alert.h | 3 ++- src/main.cpp | 11 +++-------- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/src/alert.cpp b/src/alert.cpp index 3271ecfbfd..d495849206 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -233,25 +233,30 @@ bool CAlert::ProcessAlert(bool fThread) if(AppliesToMe()) { uiInterface.NotifyAlertChanged(GetHash(), CT_NEW); - std::string strCmd = GetArg("-alertnotify", ""); - if (!strCmd.empty()) - { - // Alert text should be plain ascii coming from a trusted source, but to - // be safe we first strip anything not in safeChars, then add single quotes around - // the whole string before passing it to the shell: - std::string singleQuote("'"); - std::string safeStatus = SanitizeString(strStatusBar); - safeStatus = singleQuote+safeStatus+singleQuote; - boost::replace_all(strCmd, "%s", safeStatus); - - if (fThread) - boost::thread t(runCommand, strCmd); // thread runs free - else - runCommand(strCmd); - } + Notify(strStatusBar, fThread); } } LogPrint("alert", "accepted alert %d, AppliesToMe()=%d\n", nID, AppliesToMe()); return true; } + +void +CAlert::Notify(const std::string& strMessage, bool fThread) +{ + std::string strCmd = GetArg("-alertnotify", ""); + if (strCmd.empty()) return; + + // Alert text should be plain ascii coming from a trusted source, but to + // be safe we first strip anything not in safeChars, then add single quotes around + // the whole string before passing it to the shell: + std::string singleQuote("'"); + std::string safeStatus = SanitizeString(strMessage); + safeStatus = singleQuote+safeStatus+singleQuote; + boost::replace_all(strCmd, "%s", safeStatus); + + if (fThread) + boost::thread t(runCommand, strCmd); // thread runs free + else + runCommand(strCmd); +} diff --git a/src/alert.h b/src/alert.h index 5ecf94cea8..ba3235858d 100644 --- a/src/alert.h +++ b/src/alert.h @@ -101,7 +101,8 @@ public: bool AppliesToMe() const; bool RelayTo(CNode* pnode) const; bool CheckSignature() const; - bool ProcessAlert(bool fThread = true); + bool ProcessAlert(bool fThread = true); // fThread means run -alertnotify in a free-running thread + static void Notify(const std::string& strMessage, bool fThread); /* * Get copy of (active) alert object by hash. Returns a null alert if it is not found. diff --git a/src/main.cpp b/src/main.cpp index 5d46c30a9b..106c336a83 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1178,14 +1178,9 @@ void CheckForkWarningConditions() { if (!fLargeWorkForkFound) { - std::string strCmd = GetArg("-alertnotify", ""); - if (!strCmd.empty()) - { - std::string warning = std::string("'Warning: Large-work fork detected, forking after block ") + - pindexBestForkBase->phashBlock->ToString() + std::string("'"); - boost::replace_all(strCmd, "%s", warning); - boost::thread t(runCommand, strCmd); // thread runs free - } + std::string warning = std::string("'Warning: Large-work fork detected, forking after block ") + + pindexBestForkBase->phashBlock->ToString() + std::string("'"); + CAlert::Notify(warning, true); } if (pindexBestForkTip) { From dbca89b74b76610331d21656cd6747f5bf8375d6 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Tue, 7 Oct 2014 14:22:58 -0400 Subject: [PATCH 0845/1288] Trigger -alertnotify if network is upgrading without you This adds a -regetest-only undocumented (for regression testing only) command-line option -blockversion=N to set block.nVersion. Adds to the "has the rest of the network upgraded to a block.nVersion we don't understand" code so it calls -alertnotify when 51 of the last 100 blocks are up-version. But it only alerts once, not with every subsequent new, upversion block. And adds a forknotify.py regression test to make sure it works. Tested using forknotify.py: Before adding CAlert::Notify, get: Assertion failed: -alertnotify did not warn of up-version blocks Before adding code to only alert once: Assertion failed: -alertnotify excessive warning of up-version blocks After final code in this pull: Tests successful --- qa/pull-tester/build-tests.sh.in | 1 + qa/rpc-tests/forknotify.py | 65 ++++++++++++++++++++++++++++++++ src/main.cpp | 7 +++- src/miner.cpp | 5 +++ 4 files changed, 77 insertions(+), 1 deletion(-) create mode 100755 qa/rpc-tests/forknotify.py diff --git a/qa/pull-tester/build-tests.sh.in b/qa/pull-tester/build-tests.sh.in index ebf377a489..1ef47d77f4 100755 --- a/qa/pull-tester/build-tests.sh.in +++ b/qa/pull-tester/build-tests.sh.in @@ -75,6 +75,7 @@ make check # Run RPC integration test on Linux: @abs_top_srcdir@/qa/rpc-tests/wallet.sh @abs_top_srcdir@/linux-build/src @abs_top_srcdir@/qa/rpc-tests/listtransactions.py --srcdir @abs_top_srcdir@/linux-build/src +@abs_top_srcdir@/qa/rpc-tests/forknotify.py --srcdir @abs_top_srcdir@/linux-build/src # Clean up cache/ directory that the python regression tests create rm -rf cache diff --git a/qa/rpc-tests/forknotify.py b/qa/rpc-tests/forknotify.py new file mode 100755 index 0000000000..a482f7cc5a --- /dev/null +++ b/qa/rpc-tests/forknotify.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# Copyright (c) 2014 The Bitcoin Core developers +# Distributed under the MIT/X11 software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +# +# Test -alertnotify +# + +from test_framework import BitcoinTestFramework +from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException +from util import * +import os +import shutil + +class ForkNotifyTest(BitcoinTestFramework): + + alert_filename = None # Set by setup_network + + def setup_network(self, test_dir): + nodes = [] + self.alert_filename = os.path.join(test_dir, "alert.txt") + with open(self.alert_filename, 'w') as f: + pass # Just open then close to create zero-length file + nodes.append(start_node(0, test_dir, + ["-blockversion=2", "-alertnotify=echo %s >> '" + self.alert_filename + "'"])) + # Node1 mines block.version=211 blocks + nodes.append(start_node(1, test_dir, + ["-blockversion=211"])) + connect_nodes(nodes[1], 0) + + sync_blocks(nodes) + return nodes + + + def run_test(self, nodes): + # Mine 51 up-version blocks + nodes[1].setgenerate(True, 51) + sync_blocks(nodes) + # -alertnotify should trigger on the 51'st, + # but mine and sync another to give + # -alertnotify time to write + nodes[1].setgenerate(True, 1) + sync_blocks(nodes) + + with open(self.alert_filename, 'r') as f: + alert_text = f.read() + + if len(alert_text) == 0: + raise AssertionError("-alertnotify did not warn of up-version blocks") + + # Mine more up-version blocks, should not get more alerts: + nodes[1].setgenerate(True, 1) + sync_blocks(nodes) + nodes[1].setgenerate(True, 1) + sync_blocks(nodes) + + with open(self.alert_filename, 'r') as f: + alert_text2 = f.read() + + if alert_text != alert_text2: + raise AssertionError("-alertnotify excessive warning of up-version blocks") + +if __name__ == '__main__': + ForkNotifyTest().main() diff --git a/src/main.cpp b/src/main.cpp index 106c336a83..43b81aaef8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1755,7 +1755,8 @@ void static UpdateTip(CBlockIndex *pindexNew) { cvBlockChange.notify_all(); // Check the version of the last 100 blocks to see if we need to upgrade: - if (!IsInitialBlockDownload()) + static bool fWarned = false; + if (!IsInitialBlockDownload() && !fWarned) { int nUpgraded = 0; const CBlockIndex* pindex = chainActive.Tip(); @@ -1768,8 +1769,12 @@ void static UpdateTip(CBlockIndex *pindexNew) { if (nUpgraded > 0) LogPrintf("SetBestChain: %d of last 100 blocks above version %d\n", nUpgraded, (int)CBlock::CURRENT_VERSION); if (nUpgraded > 100/2) + { // strMiscWarning is read by GetWarnings(), called by Qt and the JSON-RPC code to warn the user: strMiscWarning = _("Warning: This version is obsolete, upgrade required!"); + CAlert::Notify(strMiscWarning, true); + fWarned = true; + } } } diff --git a/src/miner.cpp b/src/miner.cpp index 280349e8c2..2eb028b1d3 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -83,6 +83,11 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) return NULL; CBlock *pblock = &pblocktemplate->block; // pointer for convenience + // -regtest only: allow overriding block.nVersion with + // -blockversion=N to test forking scenarios + if (Params().MineBlocksOnDemand()) + pblock->nVersion = GetArg("-blockversion", pblock->nVersion); + // Create coinbase tx CMutableTransaction txNew; txNew.vin.resize(1); From caecb42b3863634aa2c2301f85b1297e5044ecf4 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Fri, 10 Oct 2014 03:23:44 +0000 Subject: [PATCH 0846/1288] Travis: Descriptive build names --- .travis.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 89b2238655..94d1c15f80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ # errata: # - A travis bug causes caches to trample eachother when using the same # compiler key (which we don't use anyway). This is worked around for now by -# using the phony compilers "true X". These can be removed when the travis -# bug is fixed. See: https://github.com/travis-ci/casher/issues/6 +# replacing the "compilers" with a build name prefixed by the no-op ":" +# command. See: https://github.com/travis-ci/casher/issues/6 os: linux language: cpp @@ -24,19 +24,19 @@ cache: matrix: fast_finish: true include: - - compiler: "true 1" + - compiler: ": ARM" env: HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="NO_QT=1" GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" - - compiler: "true 2" + - compiler: ": bitcoind" env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat CPPFLAGS=-DDEBUG_LOCKORDER" - - compiler: "true 3" + - compiler: ": No wallet" env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" - - compiler: "true 4" + - compiler: ": 32-bit + dash" env: HOST=i686-pc-linux-gnu PACKAGES="g++-multilib" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" USE_SHELL="/bin/dash" - - compiler: "true 5" + - compiler: ": Cross-Mac" env: HOST=x86_64-apple-darwin11 PACKAGES="gcc-multilib g++-multilib cmake libcap-dev libz-dev libbz2-dev" OSX_SDK=10.7 GOAL="deploy" - - compiler: "true 6" + - compiler: ": Win64" env: HOST=x86_64-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev wine" RUN_TESTS=true GOAL="deploy" - - compiler: "true 7" + - compiler: ": Win32" env: HOST=i686-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-dev wine" RUN_TESTS=true GOAL="deploy" install: - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi From 6de50c3c9a89e72f3152a1df7775572d5c8ad0e7 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 9 Oct 2014 11:04:49 +0200 Subject: [PATCH 0847/1288] qt: add network-specific style object Mainly cleanups: Gets rid of isTestNet everywhere, by keeping track of network-specific theming in a central place. Also makes GUI no longer dependent on the network ID enumeration, which alleviates concerns about #4802. --- src/Makefile.qt.include | 2 ++ src/qt/bitcoin.cpp | 25 +++++++++--------- src/qt/bitcoingui.cpp | 57 +++++++++++------------------------------ src/qt/bitcoingui.h | 7 ++--- src/qt/networkstyle.cpp | 47 +++++++++++++++++++++++++++++++++ src/qt/networkstyle.h | 33 ++++++++++++++++++++++++ src/qt/splashscreen.cpp | 25 +++++++----------- src/qt/splashscreen.h | 4 ++- 8 files changed, 125 insertions(+), 75 deletions(-) create mode 100644 src/qt/networkstyle.cpp create mode 100644 src/qt/networkstyle.h diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 1ea039adb3..872a0cf1c5 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -178,6 +178,7 @@ BITCOIN_QT_H = \ qt/macdockiconhandler.h \ qt/macnotificationhandler.h \ qt/monitoreddatamapper.h \ + qt/networkstyle.h \ qt/notificator.h \ qt/openuridialog.h \ qt/optionsdialog.h \ @@ -269,6 +270,7 @@ BITCOIN_QT_CPP = \ qt/guiutil.cpp \ qt/intro.cpp \ qt/monitoreddatamapper.cpp \ + qt/networkstyle.cpp \ qt/notificator.cpp \ qt/optionsdialog.cpp \ qt/optionsmodel.cpp \ diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 5e2fdc6c30..9872ebc1f6 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -12,6 +12,7 @@ #include "guiconstants.h" #include "guiutil.h" #include "intro.h" +#include "networkstyle.h" #include "optionsmodel.h" #include "splashscreen.h" #include "utilitydialog.h" @@ -190,9 +191,9 @@ public: /// Create options model void createOptionsModel(); /// Create main window - void createWindow(bool isaTestNet); + void createWindow(const NetworkStyle *networkStyle); /// Create splash screen - void createSplashScreen(bool isaTestNet); + void createSplashScreen(const NetworkStyle *networkStyle); /// Request core initialization void requestInitialize(); @@ -331,18 +332,18 @@ void BitcoinApplication::createOptionsModel() optionsModel = new OptionsModel(); } -void BitcoinApplication::createWindow(bool isaTestNet) +void BitcoinApplication::createWindow(const NetworkStyle *networkStyle) { - window = new BitcoinGUI(isaTestNet, 0); + window = new BitcoinGUI(networkStyle, 0); pollShutdownTimer = new QTimer(window); connect(pollShutdownTimer, SIGNAL(timeout()), window, SLOT(detectShutdown())); pollShutdownTimer->start(200); } -void BitcoinApplication::createSplashScreen(bool isaTestNet) +void BitcoinApplication::createSplashScreen(const NetworkStyle *networkStyle) { - SplashScreen *splash = new SplashScreen(0, isaTestNet); + SplashScreen *splash = new SplashScreen(0, networkStyle); // We don't hold a direct pointer to the splash screen after creation, so use // Qt::WA_DeleteOnClose to make sure that the window will be deleted eventually. splash->setAttribute(Qt::WA_DeleteOnClose); @@ -572,12 +573,10 @@ int main(int argc, char *argv[]) if (!PaymentServer::ipcParseCommandLine(argc, argv)) exit(0); #endif - bool isaTestNet = Params().NetworkID() != CBaseChainParams::MAIN; + QScopedPointer networkStyle(NetworkStyle::instantiate(QString::fromStdString(Params().NetworkIDString()))); + assert(!networkStyle.isNull()); // Allow for separate UI settings for testnets - if (isaTestNet) - QApplication::setApplicationName(QAPP_APP_NAME_TESTNET); - else - QApplication::setApplicationName(QAPP_APP_NAME_DEFAULT); + QApplication::setApplicationName(networkStyle->getAppName()); // Re-initialize translations after changing application name (language in network-specific settings can be different) initTranslations(qtTranslatorBase, qtTranslator, translatorBase, translator); @@ -617,11 +616,11 @@ int main(int argc, char *argv[]) uiInterface.InitMessage.connect(InitMessage); if (GetBoolArg("-splash", true) && !GetBoolArg("-min", false)) - app.createSplashScreen(isaTestNet); + app.createSplashScreen(networkStyle.data()); try { - app.createWindow(isaTestNet); + app.createWindow(networkStyle.data()); app.requestInitialize(); #if defined(Q_OS_WIN) && QT_VERSION >= 0x050000 WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("Bitcoin Core didn't yet exit safely..."), (HWND)app.getMainWinId()); diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 7380fbd240..8a945606dc 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -8,6 +8,7 @@ #include "clientmodel.h" #include "guiconstants.h" #include "guiutil.h" +#include "networkstyle.h" #include "notificator.h" #include "openuridialog.h" #include "optionsdialog.h" @@ -59,7 +60,7 @@ const QString BitcoinGUI::DEFAULT_WALLET = "~Default"; -BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : +BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) : QMainWindow(parent), clientModel(0), walletFrame(0), @@ -112,26 +113,13 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : } else { windowTitle += tr("Node"); } - - if (!fIsTestnet) - { + windowTitle += " " + networkStyle->getTitleAddText(); #ifndef Q_OS_MAC - QApplication::setWindowIcon(QIcon(":icons/bitcoin")); - setWindowIcon(QIcon(":icons/bitcoin")); + QApplication::setWindowIcon(networkStyle->getAppIcon()); + setWindowIcon(networkStyle->getAppIcon()); #else - MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin")); + MacDockIconHandler::instance()->setIcon(networkStyle->getAppIcon()); #endif - } - else - { - windowTitle += " " + tr("[testnet]"); -#ifndef Q_OS_MAC - QApplication::setWindowIcon(QIcon(":icons/bitcoin_testnet")); - setWindowIcon(QIcon(":icons/bitcoin_testnet")); -#else - MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin_testnet")); -#endif - } setWindowTitle(windowTitle); #if defined(Q_OS_MAC) && QT_VERSION < 0x050000 @@ -161,7 +149,7 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : // Create actions for the toolbar, menu bar and tray/dock icon // Needs walletFrame to be initialized - createActions(fIsTestnet); + createActions(networkStyle); // Create application menu bar createMenuBar(); @@ -170,7 +158,7 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : createToolBars(); // Create system tray icon and notification - createTrayIcon(fIsTestnet); + createTrayIcon(networkStyle); // Create status bar statusBar(); @@ -248,7 +236,7 @@ BitcoinGUI::~BitcoinGUI() #endif } -void BitcoinGUI::createActions(bool fIsTestnet) +void BitcoinGUI::createActions(const NetworkStyle *networkStyle) { QActionGroup *tabGroup = new QActionGroup(this); @@ -295,10 +283,7 @@ void BitcoinGUI::createActions(bool fIsTestnet) quitAction->setStatusTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); - if (!fIsTestnet) - aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About Bitcoin Core"), this); - else - aboutAction = new QAction(QIcon(":/icons/bitcoin_testnet"), tr("&About Bitcoin Core"), this); + aboutAction = new QAction(networkStyle->getAppIcon(), tr("&About Bitcoin Core"), this); aboutAction->setStatusTip(tr("Show information about Bitcoin Core")); aboutAction->setMenuRole(QAction::AboutRole); #if QT_VERSION < 0x050000 @@ -311,10 +296,7 @@ void BitcoinGUI::createActions(bool fIsTestnet) optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this); optionsAction->setStatusTip(tr("Modify configuration options for Bitcoin")); optionsAction->setMenuRole(QAction::PreferencesRole); - if (!fIsTestnet) - toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("&Show / Hide"), this); - else - toggleHideAction = new QAction(QIcon(":/icons/bitcoin_testnet"), tr("&Show / Hide"), this); + toggleHideAction = new QAction(networkStyle->getAppIcon(), tr("&Show / Hide"), this); toggleHideAction->setStatusTip(tr("Show or hide the main Window")); encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this); @@ -505,22 +487,13 @@ void BitcoinGUI::setWalletActionsEnabled(bool enabled) openAction->setEnabled(enabled); } -void BitcoinGUI::createTrayIcon(bool fIsTestnet) +void BitcoinGUI::createTrayIcon(const NetworkStyle *networkStyle) { #ifndef Q_OS_MAC trayIcon = new QSystemTrayIcon(this); - - if (!fIsTestnet) - { - trayIcon->setToolTip(tr("Bitcoin Core client")); - trayIcon->setIcon(QIcon(":/icons/bitcoin")); - } - else - { - trayIcon->setToolTip(tr("Bitcoin Core client") + " " + tr("[testnet]")); - trayIcon->setIcon(QIcon(":/icons/bitcoin_testnet")); - } - + QString toolTip = tr("Bitcoin Core client") + " " + networkStyle->getTitleAddText(); + trayIcon->setToolTip(toolTip); + trayIcon->setIcon(networkStyle->getAppIcon()); trayIcon->show(); #endif diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 8af6eda867..f65f0e9137 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -19,6 +19,7 @@ #include class ClientModel; +class NetworkStyle; class Notificator; class OptionsModel; class RPCConsole; @@ -46,7 +47,7 @@ class BitcoinGUI : public QMainWindow public: static const QString DEFAULT_WALLET; - explicit BitcoinGUI(bool fIsTestnet = false, QWidget *parent = 0); + explicit BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent = 0); ~BitcoinGUI(); /** Set the client model. @@ -114,13 +115,13 @@ private: int spinnerFrame; /** Create the main UI actions. */ - void createActions(bool fIsTestnet); + void createActions(const NetworkStyle *networkStyle); /** Create the menu bar and sub-menus. */ void createMenuBar(); /** Create the toolbars */ void createToolBars(); /** Create system tray icon and notification */ - void createTrayIcon(bool fIsTestnet); + void createTrayIcon(const NetworkStyle *networkStyle); /** Create system tray menu (or setup the dock menu) */ void createTrayIconMenu(); diff --git a/src/qt/networkstyle.cpp b/src/qt/networkstyle.cpp new file mode 100644 index 0000000000..62c44703f4 --- /dev/null +++ b/src/qt/networkstyle.cpp @@ -0,0 +1,47 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "networkstyle.h" + +#include "guiconstants.h" + +#include + +static const struct { + const char *networkId; + const char *appName; + const char *appIcon; + const char *titleAddText; + const char *splashImage; +} network_styles[] = { + {"main", QAPP_APP_NAME_DEFAULT, ":/icons/bitcoin", "", ":/images/splash"}, + {"test", QAPP_APP_NAME_TESTNET, ":/icons/bitcoin_testnet", QT_TRANSLATE_NOOP("SplashScreen", "[testnet]"), ":/images/splash_testnet"}, + {"regtest", QAPP_APP_NAME_TESTNET, ":/icons/bitcoin_testnet", "[regtest]", ":/images/splash_testnet"} +}; +static const unsigned network_styles_count = sizeof(network_styles)/sizeof(*network_styles); + +// titleAddText needs to be const char* for tr() +NetworkStyle::NetworkStyle(const QString &appName, const QString &appIcon, const char *titleAddText, const QString &splashImage): + appName(appName), + appIcon(appIcon), + titleAddText(qApp->translate("SplashScreen", titleAddText)), + splashImage(splashImage) +{ +} + +const NetworkStyle *NetworkStyle::instantiate(const QString &networkId) +{ + for (unsigned x=0; x +#include +#include + +/* Coin network-specific GUI style information */ +class NetworkStyle +{ +public: + /** Get style associated with provided BIP70 network id, or 0 if not known */ + static const NetworkStyle *instantiate(const QString &networkId); + + const QString &getAppName() const { return appName; } + const QIcon &getAppIcon() const { return appIcon; } + const QString &getTitleAddText() const { return titleAddText; } + const QPixmap &getSplashImage() const { return splashImage; } + +private: + NetworkStyle(const QString &appName, const QString &appIcon, const char *titleAddText, const QString &splashImage); + + QString appName; + QIcon appIcon; + QString titleAddText; + QPixmap splashImage; +}; + +#endif // H_NETWORKSTYLE diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 4fe610794f..360008ea83 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -6,6 +6,7 @@ #include "clientversion.h" #include "init.h" +#include "networkstyle.h" #include "ui_interface.h" #include "util.h" #include "version.h" @@ -19,7 +20,7 @@ #include #include -SplashScreen::SplashScreen(Qt::WindowFlags f, bool isTestNet) : +SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) : QWidget(0, f), curAlignment(0) { // set reference point, paddings @@ -34,17 +35,12 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, bool isTestNet) : QString titleText = tr("Bitcoin Core"); QString versionText = QString("Version %1").arg(QString::fromStdString(FormatFullVersion())); QString copyrightText = QChar(0xA9)+QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoin Core developers")); - QString testnetAddText = QString(tr("[testnet]")); // define text to place as single text object + QString titleAddText = networkStyle->getTitleAddText(); QString font = "Arial"; // load the bitmap for writing some text over it - if(isTestNet) { - pixmap = QPixmap(":/images/splash_testnet"); - } - else { - pixmap = QPixmap(":/images/splash"); - } + pixmap = networkStyle->getSplashImage(); QPainter pixPaint(&pixmap); pixPaint.setPen(QColor(100,100,100)); @@ -78,23 +74,20 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, bool isTestNet) : pixPaint.setFont(QFont(font, 10*fontFactor)); pixPaint.drawText(pixmap.width()-titleTextWidth-paddingRight,paddingTop+titleCopyrightVSpace,copyrightText); - // draw testnet string if testnet is on - if(isTestNet) { + // draw additional text if special network + if(!titleAddText.isEmpty()) { QFont boldFont = QFont(font, 10*fontFactor); boldFont.setWeight(QFont::Bold); pixPaint.setFont(boldFont); fm = pixPaint.fontMetrics(); - int testnetAddTextWidth = fm.width(testnetAddText); - pixPaint.drawText(pixmap.width()-testnetAddTextWidth-10,15,testnetAddText); + int titleAddTextWidth = fm.width(titleAddText); + pixPaint.drawText(pixmap.width()-titleAddTextWidth-10,15,titleAddText); } pixPaint.end(); // Set window title - if(isTestNet) - setWindowTitle(titleText + " " + testnetAddText); - else - setWindowTitle(titleText); + setWindowTitle(titleText + " " + titleAddText); // Resize window and move to center of desktop, disallow resizing QRect r(QPoint(), pixmap.size()); diff --git a/src/qt/splashscreen.h b/src/qt/splashscreen.h index 89c21e6457..128edadbee 100644 --- a/src/qt/splashscreen.h +++ b/src/qt/splashscreen.h @@ -7,6 +7,8 @@ #include +class NetworkStyle; + /** Class for the splashscreen with information of the running client. * * @note this is intentionally not a QSplashScreen. Bitcoin Core initialization @@ -18,7 +20,7 @@ class SplashScreen : public QWidget Q_OBJECT public: - explicit SplashScreen(Qt::WindowFlags f, bool isTestNet); + explicit SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle); ~SplashScreen(); protected: From e11712df7ea5e946c5ec008d1c761187b495f872 Mon Sep 17 00:00:00 2001 From: jtimon Date: Sun, 31 Aug 2014 21:32:23 +0200 Subject: [PATCH 0848/1288] Move checkpoint data selection to chainparams --- src/chainparams.cpp | 72 +++++++++++++++++++++++++++++++++++++++- src/chainparams.h | 2 ++ src/checkpoints.cpp | 81 +++------------------------------------------ src/checkpoints.h | 12 ++++++- 4 files changed, 89 insertions(+), 78 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 31c67715c8..a81b618208 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -44,6 +44,57 @@ static void convertSeed6(std::vector &vSeedsOut, const SeedSpec6 *data } } + // What makes a good checkpoint block? + // + Is surrounded by blocks with reasonable timestamps + // (no blocks before with a timestamp after, none after with + // timestamp before) + // + Contains no strange transactions +static Checkpoints::MapCheckpoints mapCheckpoints = + boost::assign::map_list_of + ( 11111, uint256("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d")) + ( 33333, uint256("0x000000002dd5588a74784eaa7ab0507a18ad16a236e7b1ce69f00d7ddfb5d0a6")) + ( 74000, uint256("0x0000000000573993a3c9e41ce34471c079dcf5f52a0e824a81e7f953b8661a20")) + (105000, uint256("0x00000000000291ce28027faea320c8d2b054b2e0fe44a773f3eefb151d6bdc97")) + (134444, uint256("0x00000000000005b12ffd4cd315cd34ffd4a594f430ac814c91184a0d42d2b0fe")) + (168000, uint256("0x000000000000099e61ea72015e79632f216fe6cb33d7899acb35b75c8303b763")) + (193000, uint256("0x000000000000059f452a5f7340de6682a977387c17010ff6e6c3bd83ca8b1317")) + (210000, uint256("0x000000000000048b95347e83192f69cf0366076336c639f9b7228e9ba171342e")) + (216116, uint256("0x00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e")) + (225430, uint256("0x00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932")) + (250000, uint256("0x000000000000003887df1f29024b06fc2200b55f8af8f35453d7be294df2d214")) + (279000, uint256("0x0000000000000001ae8c72a0b0c301f67e3afca10e819efa9041e458e9bd7e40")) + (295000, uint256("0x00000000000000004d9b4ef50f0f9d686fd69db2e03af35a100370c64632a983")) + ; +static const Checkpoints::CCheckpointData data = { + &mapCheckpoints, + 1397080064, // * UNIX timestamp of last checkpoint block + 36544669, // * total number of transactions between genesis and last checkpoint + // (the tx=... number in the SetBestChain debug.log lines) + 60000.0 // * estimated number of transactions per day after checkpoint + }; + +static Checkpoints::MapCheckpoints mapCheckpointsTestnet = + boost::assign::map_list_of + ( 546, uint256("000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70")) + ; +static const Checkpoints::CCheckpointData dataTestnet = { + &mapCheckpointsTestnet, + 1337966069, + 1488, + 300 + }; + +static Checkpoints::MapCheckpoints mapCheckpointsRegtest = + boost::assign::map_list_of + ( 0, uint256("0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206")) + ; +static const Checkpoints::CCheckpointData dataRegtest = { + &mapCheckpointsRegtest, + 0, + 0, + 0 + }; + class CMainParams : public CChainParams { public: CMainParams() { @@ -117,6 +168,11 @@ public: fMineBlocksOnDemand = false; fSkipProofOfWorkCheck = false; } + + const Checkpoints::CCheckpointData& Checkpoints() const + { + return data; + } }; static CMainParams mainParams; @@ -173,6 +229,10 @@ public: fRequireStandard = false; fMineBlocksOnDemand = false; } + const Checkpoints::CCheckpointData& Checkpoints() const + { + return dataTestnet; + } }; static CTestNetParams testNetParams; @@ -212,6 +272,10 @@ public: fRequireStandard = false; fMineBlocksOnDemand = true; } + const Checkpoints::CCheckpointData& Checkpoints() const + { + return dataRegtest; + } }; static CRegTestParams regTestParams; @@ -233,7 +297,13 @@ public: fAllowMinDifficultyBlocks = false; fMineBlocksOnDemand = true; } -public: + + const Checkpoints::CCheckpointData& Checkpoints() const + { + // UnitTest share the same checkpoints as MAIN + return data; + } + // Published setters to allow changing values in unit test cases virtual void setSubsidyHalvingInterval(int anSubsidyHalvingInterval) { nSubsidyHalvingInterval=anSubsidyHalvingInterval; } virtual void setEnforceBlockUpgradeMajority(int anEnforceBlockUpgradeMajority) { nEnforceBlockUpgradeMajority=anEnforceBlockUpgradeMajority; } diff --git a/src/chainparams.h b/src/chainparams.h index 50441a89f3..d3b1781b4d 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -8,6 +8,7 @@ #include "core.h" #include "chainparamsbase.h" +#include "checkpoints.h" #include "protocol.h" #include "uint256.h" @@ -77,6 +78,7 @@ public: const std::vector& DNSSeeds() const { return vSeeds; } const std::vector& Base58Prefix(Base58Type type) const { return base58Prefixes[type]; } const std::vector& FixedSeeds() const { return vFixedSeeds; } + virtual const Checkpoints::CCheckpointData& Checkpoints() const = 0; protected: CChainParams() {} diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index 9a6bc05e63..fbde47339d 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -4,18 +4,16 @@ #include "checkpoints.h" +#include "chainparams.h" #include "main.h" #include "uint256.h" #include -#include // for 'map_list_of()' #include namespace Checkpoints { - typedef std::map MapCheckpoints; - // How many times we expect transactions after the last checkpoint to // be slower. This number is a compromise, as it can't be accurate for // every system. When reindexing from a fast disk with a slow CPU, it @@ -23,83 +21,14 @@ namespace Checkpoints { // fast multicore CPU, it won't be much higher than 1. static const double SIGCHECK_VERIFICATION_FACTOR = 5.0; - struct CCheckpointData { - const MapCheckpoints *mapCheckpoints; - int64_t nTimeLastCheckpoint; - int64_t nTransactionsLastCheckpoint; - double fTransactionsPerDay; - }; - bool fEnabled = true; - // What makes a good checkpoint block? - // + Is surrounded by blocks with reasonable timestamps - // (no blocks before with a timestamp after, none after with - // timestamp before) - // + Contains no strange transactions - static MapCheckpoints mapCheckpoints = - boost::assign::map_list_of - ( 11111, uint256("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d")) - ( 33333, uint256("0x000000002dd5588a74784eaa7ab0507a18ad16a236e7b1ce69f00d7ddfb5d0a6")) - ( 74000, uint256("0x0000000000573993a3c9e41ce34471c079dcf5f52a0e824a81e7f953b8661a20")) - (105000, uint256("0x00000000000291ce28027faea320c8d2b054b2e0fe44a773f3eefb151d6bdc97")) - (134444, uint256("0x00000000000005b12ffd4cd315cd34ffd4a594f430ac814c91184a0d42d2b0fe")) - (168000, uint256("0x000000000000099e61ea72015e79632f216fe6cb33d7899acb35b75c8303b763")) - (193000, uint256("0x000000000000059f452a5f7340de6682a977387c17010ff6e6c3bd83ca8b1317")) - (210000, uint256("0x000000000000048b95347e83192f69cf0366076336c639f9b7228e9ba171342e")) - (216116, uint256("0x00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e")) - (225430, uint256("0x00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932")) - (250000, uint256("0x000000000000003887df1f29024b06fc2200b55f8af8f35453d7be294df2d214")) - (279000, uint256("0x0000000000000001ae8c72a0b0c301f67e3afca10e819efa9041e458e9bd7e40")) - (295000, uint256("0x00000000000000004d9b4ef50f0f9d686fd69db2e03af35a100370c64632a983")) - ; - static const CCheckpointData data = { - &mapCheckpoints, - 1397080064, // * UNIX timestamp of last checkpoint block - 36544669, // * total number of transactions between genesis and last checkpoint - // (the tx=... number in the SetBestChain debug.log lines) - 60000.0 // * estimated number of transactions per day after checkpoint - }; - - static MapCheckpoints mapCheckpointsTestnet = - boost::assign::map_list_of - ( 546, uint256("000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70")) - ; - static const CCheckpointData dataTestnet = { - &mapCheckpointsTestnet, - 1337966069, - 1488, - 300 - }; - - static MapCheckpoints mapCheckpointsRegtest = - boost::assign::map_list_of - ( 0, uint256("0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206")) - ; - static const CCheckpointData dataRegtest = { - &mapCheckpointsRegtest, - 0, - 0, - 0 - }; - - const CCheckpointData &Checkpoints() { - if (Params().NetworkID() == CBaseChainParams::TESTNET) - return dataTestnet; - else if (Params().NetworkID() == CBaseChainParams::MAIN) - return data; - else if (Params().NetworkID() == CBaseChainParams::UNITTEST) // UnitTest share the same checkpoints as MAIN - return data; - else - return dataRegtest; - } - bool CheckBlock(int nHeight, const uint256& hash) { if (!fEnabled) return true; - const MapCheckpoints& checkpoints = *Checkpoints().mapCheckpoints; + const MapCheckpoints& checkpoints = *Params().Checkpoints().mapCheckpoints; MapCheckpoints::const_iterator i = checkpoints.find(nHeight); if (i == checkpoints.end()) return true; @@ -119,7 +48,7 @@ namespace Checkpoints { // Work is defined as: 1.0 per transaction before the last checkpoint, and // fSigcheckVerificationFactor per transaction after. - const CCheckpointData &data = Checkpoints(); + const CCheckpointData &data = Params().Checkpoints(); if (pindex->nChainTx <= data.nTransactionsLastCheckpoint) { double nCheapBefore = pindex->nChainTx; @@ -143,7 +72,7 @@ namespace Checkpoints { if (!fEnabled) return 0; - const MapCheckpoints& checkpoints = *Checkpoints().mapCheckpoints; + const MapCheckpoints& checkpoints = *Params().Checkpoints().mapCheckpoints; return checkpoints.rbegin()->first; } @@ -153,7 +82,7 @@ namespace Checkpoints { if (!fEnabled) return NULL; - const MapCheckpoints& checkpoints = *Checkpoints().mapCheckpoints; + const MapCheckpoints& checkpoints = *Params().Checkpoints().mapCheckpoints; BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, checkpoints) { diff --git a/src/checkpoints.h b/src/checkpoints.h index fca046559a..b5b620fa6b 100644 --- a/src/checkpoints.h +++ b/src/checkpoints.h @@ -5,16 +5,26 @@ #ifndef BITCOIN_CHECKPOINT_H #define BITCOIN_CHECKPOINT_H +#include "uint256.h" + #include class CBlockIndex; -class uint256; /** Block-chain checkpoints are compiled-in sanity checks. * They are updated every release or three. */ namespace Checkpoints { +typedef std::map MapCheckpoints; + +struct CCheckpointData { + const MapCheckpoints *mapCheckpoints; + int64_t nTimeLastCheckpoint; + int64_t nTransactionsLastCheckpoint; + double fTransactionsPerDay; +}; + // Returns true if block passes checkpoint checks bool CheckBlock(int nHeight, const uint256& hash); From cc972107997122cb31f015b4e70f81781dbce784 Mon Sep 17 00:00:00 2001 From: jtimon Date: Sun, 31 Aug 2014 22:32:52 +0200 Subject: [PATCH 0849/1288] Add fTestnetToBeDeprecatedFieldRPC to CChainParams --- src/chainparams.cpp | 3 +++ src/chainparams.h | 3 +++ src/rpcmining.cpp | 2 +- src/rpcmisc.cpp | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index a81b618208..f2a14b8293 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -167,6 +167,7 @@ public: fRequireStandard = true; fMineBlocksOnDemand = false; fSkipProofOfWorkCheck = false; + fTestnetToBeDeprecatedFieldRPC = false; } const Checkpoints::CCheckpointData& Checkpoints() const @@ -228,6 +229,7 @@ public: fAllowMinDifficultyBlocks = true; fRequireStandard = false; fMineBlocksOnDemand = false; + fTestnetToBeDeprecatedFieldRPC = true; } const Checkpoints::CCheckpointData& Checkpoints() const { @@ -271,6 +273,7 @@ public: fAllowMinDifficultyBlocks = true; fRequireStandard = false; fMineBlocksOnDemand = true; + fTestnetToBeDeprecatedFieldRPC = false; } const Checkpoints::CCheckpointData& Checkpoints() const { diff --git a/src/chainparams.h b/src/chainparams.h index d3b1781b4d..21d3b4d526 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -72,6 +72,8 @@ public: /* Make miner stop after a block is found. In RPC, don't return * until nGenProcLimit blocks are generated */ bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; } + /* In the future use NetworkIDString() for RPC fields */ + bool TestnetToBeDeprecatedFieldRPC() const { return fTestnetToBeDeprecatedFieldRPC; } CBaseChainParams::Network NetworkID() const { return networkID; } /* Return the BIP70 network string (main, test or regtest) */ std::string NetworkIDString() const { return strNetworkID; } @@ -108,6 +110,7 @@ protected: bool fRequireStandard; bool fMineBlocksOnDemand; bool fSkipProofOfWorkCheck; + bool fTestnetToBeDeprecatedFieldRPC; }; /** Modifiable parameters interface is used by test cases to adapt the parameters in order diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index e794bf69e0..c767835a27 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -239,7 +239,7 @@ Value getmininginfo(const Array& params, bool fHelp) obj.push_back(Pair("genproclimit", (int)GetArg("-genproclimit", -1))); obj.push_back(Pair("networkhashps", getnetworkhashps(params, false))); obj.push_back(Pair("pooledtx", (uint64_t)mempool.size())); - obj.push_back(Pair("testnet", Params().NetworkID() == CBaseChainParams::TESTNET)); + obj.push_back(Pair("testnet", Params().TestnetToBeDeprecatedFieldRPC())); obj.push_back(Pair("chain", Params().NetworkIDString())); #ifdef ENABLE_WALLET obj.push_back(Pair("generate", getgenerate(params, false))); diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index dd45eefd58..8be14b567c 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -87,7 +87,7 @@ Value getinfo(const Array& params, bool fHelp) obj.push_back(Pair("connections", (int)vNodes.size())); obj.push_back(Pair("proxy", (proxy.IsValid() ? proxy.ToStringIPPort() : string()))); obj.push_back(Pair("difficulty", (double)GetDifficulty())); - obj.push_back(Pair("testnet", Params().NetworkID() == CBaseChainParams::TESTNET)); + obj.push_back(Pair("testnet", Params().TestnetToBeDeprecatedFieldRPC())); #ifdef ENABLE_WALLET if (pwalletMain) { obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime())); From 6fd546dd9680fff2c442075e511875acbd18b486 Mon Sep 17 00:00:00 2001 From: jtimon Date: Sun, 31 Aug 2014 23:01:54 +0200 Subject: [PATCH 0850/1288] Remove CChainParams::NetworkID() --- src/chainparams.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/chainparams.h b/src/chainparams.h index 21d3b4d526..f157419bb2 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -74,7 +74,6 @@ public: bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; } /* In the future use NetworkIDString() for RPC fields */ bool TestnetToBeDeprecatedFieldRPC() const { return fTestnetToBeDeprecatedFieldRPC; } - CBaseChainParams::Network NetworkID() const { return networkID; } /* Return the BIP70 network string (main, test or regtest) */ std::string NetworkIDString() const { return strNetworkID; } const std::vector& DNSSeeds() const { return vSeeds; } From b796cb084bd3865d094d86da2f33cd5c68294a43 Mon Sep 17 00:00:00 2001 From: jtimon Date: Thu, 9 Oct 2014 19:15:38 +0200 Subject: [PATCH 0851/1288] SQUASHME: NetworkIdFromCommandLine() function instead of method --- src/chainparams.cpp | 2 +- src/chainparamsbase.cpp | 12 ++++++------ src/chainparamsbase.h | 13 +++++++------ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index f561877d9f..ec05f592b9 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -242,7 +242,7 @@ void SelectParams(CBaseChainParams::Network network) { bool SelectParamsFromCommandLine() { - CBaseChainParams::Network network = CBaseChainParams::NetworkIdFromCommandLine(); + CBaseChainParams::Network network = NetworkIdFromCommandLine(); if (network == CBaseChainParams::MAX_NETWORK_TYPES) return false; diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index 05ef5dd463..f275bd544f 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -83,23 +83,23 @@ void SelectBaseParams(CBaseChainParams::Network network) } } -CBaseChainParams::Network CBaseChainParams::NetworkIdFromCommandLine() +CBaseChainParams::Network NetworkIdFromCommandLine() { bool fRegTest = GetBoolArg("-regtest", false); bool fTestNet = GetBoolArg("-testnet", false); if (fTestNet && fRegTest) - return MAX_NETWORK_TYPES; + return CBaseChainParams::MAX_NETWORK_TYPES; if (fRegTest) - return REGTEST; + return CBaseChainParams::REGTEST; if (fTestNet) - return TESTNET; - return MAIN; + return CBaseChainParams::TESTNET; + return CBaseChainParams::MAIN; } bool SelectBaseParamsFromCommandLine() { - CBaseChainParams::Network network = CBaseChainParams::NetworkIdFromCommandLine(); + CBaseChainParams::Network network = NetworkIdFromCommandLine(); if (network == CBaseChainParams::MAX_NETWORK_TYPES) return false; diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h index f24337cef0..ff3e811988 100644 --- a/src/chainparamsbase.h +++ b/src/chainparamsbase.h @@ -26,11 +26,6 @@ public: const std::string& DataDir() const { return strDataDir; } int RPCPort() const { return nRPCPort; } - /** - * Looks for -regtest or -testnet and returns the appropriate Network ID. - * Returns MAX_NETWORK_TYPES if an invalid combination is given. - */ - static Network NetworkIdFromCommandLine(); protected: CBaseChainParams() {} @@ -49,7 +44,13 @@ const CBaseChainParams& BaseParams(); void SelectBaseParams(CBaseChainParams::Network network); /** - * Calls CBaseChainParams::NetworkIdFromCommandLine() and then calls SelectParams as appropriate. + * Looks for -regtest or -testnet and returns the appropriate Network ID. + * Returns MAX_NETWORK_TYPES if an invalid combination is given. + */ +CBaseChainParams::Network NetworkIdFromCommandLine(); + +/** + * Calls NetworkIdFromCommandLine() and then calls SelectParams as appropriate. * Returns false if an invalid combination is given. */ bool SelectBaseParamsFromCommandLine(); From a7d1f035ae2b33d5242d9aee5da1b538a0f5adba Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 10 Oct 2014 13:00:50 -0400 Subject: [PATCH 0852/1288] build: fix dynamic boost check when --with-boost= is used --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 87c7833bce..90aa112421 100644 --- a/configure.ac +++ b/configure.ac @@ -521,7 +521,7 @@ if test x$use_tests = xyes; then dnl Determine if -DBOOST_TEST_DYN_LINK is needed AC_MSG_CHECKING([for dynamic linked boost test]) TEMP_LIBS="$LIBS" - LIBS="$LIBS $BOOST_UNIT_TEST_FRAMEWORK_LIB" + LIBS="$LIBS $BOOST_LDFLAGS $BOOST_UNIT_TEST_FRAMEWORK_LIB" TEMP_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" AC_LINK_IFELSE([AC_LANG_SOURCE([ From d5fd094569e74595af18d42d2aa06738304b715b Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 10 Oct 2014 13:03:28 -0400 Subject: [PATCH 0853/1288] build: fix qt test build when libprotobuf is in a non-standard path --- src/Makefile.qttest.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 2cba5b7e1e..23375bef82 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -13,7 +13,7 @@ TEST_QT_H = \ qt/test/paymentservertests.h qt_test_test_bitcoin_qt_CPPFLAGS = $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \ - $(QT_INCLUDES) $(QT_TEST_INCLUDES) + $(QT_INCLUDES) $(QT_TEST_INCLUDES) $(PROTOBUF_CFLAGS) qt_test_test_bitcoin_qt_SOURCES = \ qt/test/test_main.cpp \ From 005b5af6e2d32cc2a4a37b6edb60aacdfb5e8ed0 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 10 Oct 2014 13:11:47 -0400 Subject: [PATCH 0854/1288] rpc-tests: don't spew non-errors to stdout There's a brief race here, the process might've already exited and cleaned up after itself. If that's the case, reading from the pidfile will harmlessly fail. Keep those quiet. --- qa/rpc-tests/send.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/rpc-tests/send.sh b/qa/rpc-tests/send.sh index 8c0f114590..37367865c1 100755 --- a/qa/rpc-tests/send.sh +++ b/qa/rpc-tests/send.sh @@ -16,7 +16,7 @@ fi if [ $1 = "-STOP" ]; then if [ -s ${PIDFILE} ]; then - kill -s ${SIGNAL} $(<${PIDFILE}) + kill -s ${SIGNAL} $(<$PIDFILE 2>/dev/null) 2>/dev/null fi exit 0 fi From 0a08aa8f2ae9acd8e83e09bfae41de2c0a02e1d8 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Fri, 10 Oct 2014 21:59:04 +0000 Subject: [PATCH 0855/1288] Parameterise command line option defaults, so translations are independent of them --- src/bitcoin-cli.cpp | 6 ++-- src/init.cpp | 86 ++++++++++++++++++++++----------------------- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index badb376cb3..aa5e285b10 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -25,13 +25,13 @@ std::string HelpMessageCli() string strUsage; strUsage += _("Options:") + "\n"; strUsage += " -? " + _("This help message") + "\n"; - strUsage += " -conf= " + _("Specify configuration file (default: bitcoin.conf)") + "\n"; + strUsage += " -conf= " + strprintf(_("Specify configuration file (default: %s)"), "bitcoin.conf") + "\n"; strUsage += " -datadir= " + _("Specify data directory") + "\n"; strUsage += " -testnet " + _("Use the test network") + "\n"; strUsage += " -regtest " + _("Enter regression test mode, which uses a special chain in which blocks can be " "solved instantly. This is intended for regression testing tools and app development.") + "\n"; - strUsage += " -rpcconnect= " + _("Send commands to node running on (default: 127.0.0.1)") + "\n"; - strUsage += " -rpcport= " + _("Connect to JSON-RPC on (default: 8332 or testnet: 18332)") + "\n"; + strUsage += " -rpcconnect= " + strprintf(_("Send commands to node running on (default: %s)"), "127.0.0.1") + "\n"; + strUsage += " -rpcport= " + strprintf(_("Connect to JSON-RPC on (default: %u or testnet: %u)"), 8332, 18332) + "\n"; strUsage += " -rpcwait " + _("Wait for RPC server to start") + "\n"; strUsage += " -rpcuser= " + _("Username for JSON-RPC connections") + "\n"; strUsage += " -rpcpassword= " + _("Password for JSON-RPC connections") + "\n"; diff --git a/src/init.cpp b/src/init.cpp index 8dcd35fb8f..1150bb1f5e 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -215,9 +215,9 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -? " + _("This help message") + "\n"; strUsage += " -alertnotify= " + _("Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)") + "\n"; strUsage += " -blocknotify= " + _("Execute command when the best block changes (%s in cmd is replaced by block hash)") + "\n"; - strUsage += " -checkblocks= " + _("How many blocks to check at startup (default: 288, 0 = all)") + "\n"; - strUsage += " -checklevel= " + _("How thorough the block verification of -checkblocks is (0-4, default: 3)") + "\n"; - strUsage += " -conf= " + _("Specify configuration file (default: bitcoin.conf)") + "\n"; + strUsage += " -checkblocks= " + strprintf(_("How many blocks to check at startup (default: %u, 0 = all)"), 288) + "\n"; + strUsage += " -checklevel= " + strprintf(_("How thorough the block verification of -checkblocks is (0-4, default: %u)"), 3) + "\n"; + strUsage += " -conf= " + strprintf(_("Specify configuration file (default: %s)"), "bitcoin.conf") + "\n"; if (mode == HMM_BITCOIND) { #if !defined(WIN32) @@ -231,33 +231,33 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -maxorphantx= " + strprintf(_("Keep at most unconnectable transactions in memory (default: %u)"), DEFAULT_MAX_ORPHAN_TRANSACTIONS) + "\n"; strUsage += " -par= " + strprintf(_("Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)"), -(int)boost::thread::hardware_concurrency(), MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS) + "\n"; #ifndef WIN32 - strUsage += " -pid= " + _("Specify pid file (default: bitcoind.pid)") + "\n"; + strUsage += " -pid= " + strprintf(_("Specify pid file (default: %s)"), "bitcoind.pid") + "\n"; #endif strUsage += " -reindex " + _("Rebuild block chain index from current blk000??.dat files") + " " + _("on startup") + "\n"; #if !defined(WIN32) strUsage += " -sysperms " + _("Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)") + "\n"; #endif - strUsage += " -txindex " + _("Maintain a full transaction index, used by the getrawtransaction rpc call (default: 0)") + "\n"; + strUsage += " -txindex " + strprintf(_("Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)"), 0) + "\n"; strUsage += "\n" + _("Connection options:") + "\n"; strUsage += " -addnode= " + _("Add a node to connect to and attempt to keep the connection open") + "\n"; - strUsage += " -banscore= " + _("Threshold for disconnecting misbehaving peers (default: 100)") + "\n"; - strUsage += " -bantime= " + _("Number of seconds to keep misbehaving peers from reconnecting (default: 86400)") + "\n"; + strUsage += " -banscore= " + strprintf(_("Threshold for disconnecting misbehaving peers (default: %u)"), 100) + "\n"; + strUsage += " -bantime= " + strprintf(_("Number of seconds to keep misbehaving peers from reconnecting (default: %u)"), 86400) + "\n"; strUsage += " -bind= " + _("Bind to given address and always listen on it. Use [host]:port notation for IPv6") + "\n"; strUsage += " -connect= " + _("Connect only to the specified node(s)") + "\n"; strUsage += " -discover " + _("Discover own IP address (default: 1 when listening and no -externalip)") + "\n"; strUsage += " -dns " + _("Allow DNS lookups for -addnode, -seednode and -connect") + " " + _("(default: 1)") + "\n"; strUsage += " -dnsseed " + _("Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect)") + "\n"; strUsage += " -externalip= " + _("Specify your own public address") + "\n"; - strUsage += " -forcednsseed " + _("Always query for peer addresses via DNS lookup (default: 0)") + "\n"; + strUsage += " -forcednsseed " + strprintf(_("Always query for peer addresses via DNS lookup (default: %u)"), 0) + "\n"; strUsage += " -listen " + _("Accept connections from outside (default: 1 if no -proxy or -connect)") + "\n"; - strUsage += " -maxconnections= " + _("Maintain at most connections to peers (default: 125)") + "\n"; - strUsage += " -maxreceivebuffer= " + _("Maximum per-connection receive buffer, *1000 bytes (default: 5000)") + "\n"; - strUsage += " -maxsendbuffer= " + _("Maximum per-connection send buffer, *1000 bytes (default: 1000)") + "\n"; - strUsage += " -onion= " + _("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy)") + "\n"; + strUsage += " -maxconnections= " + strprintf(_("Maintain at most connections to peers (default: %u)"), 125) + "\n"; + strUsage += " -maxreceivebuffer= " + strprintf(_("Maximum per-connection receive buffer, *1000 bytes (default: %u)"), 5000) + "\n"; + strUsage += " -maxsendbuffer= " + strprintf(_("Maximum per-connection send buffer, *1000 bytes (default: %u)"), 1000) + "\n"; + strUsage += " -onion= " + strprintf(_("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)"), "-proxy") + "\n"; strUsage += " -onlynet= " + _("Only connect to nodes in network (ipv4, ipv6 or onion)") + "\n"; - strUsage += " -permitbaremultisig " + _("Relay non-P2SH multisig (default: 1)") + "\n"; - strUsage += " -port= " + _("Listen for connections on (default: 8333 or testnet: 18333)") + "\n"; + strUsage += " -permitbaremultisig " + strprintf(_("Relay non-P2SH multisig (default: %u)"), 1) + "\n"; + strUsage += " -port= " + strprintf(_("Listen for connections on (default: %u or testnet: %u)"), 8333, 18333) + "\n"; strUsage += " -proxy= " + _("Connect through SOCKS5 proxy") + "\n"; strUsage += " -seednode= " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n"; strUsage += " -timeout= " + strprintf(_("Specify connection timeout in milliseconds (minimum: 1, default: %d)"), DEFAULT_CONNECT_TIMEOUT) + "\n"; @@ -265,7 +265,7 @@ std::string HelpMessage(HelpMessageMode mode) #if USE_UPNP strUsage += " -upnp " + _("Use UPnP to map the listening port (default: 1 when listening)") + "\n"; #else - strUsage += " -upnp " + _("Use UPnP to map the listening port (default: 0)") + "\n"; + strUsage += " -upnp " + strprintf(_("Use UPnP to map the listening port (default: %u)"), 0) + "\n"; #endif #endif strUsage += " -whitebind= " + _("Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6") + "\n"; @@ -275,34 +275,34 @@ std::string HelpMessage(HelpMessageMode mode) #ifdef ENABLE_WALLET strUsage += "\n" + _("Wallet options:") + "\n"; strUsage += " -disablewallet " + _("Do not load the wallet and disable wallet RPC calls") + "\n"; - strUsage += " -keypool= " + _("Set key pool size to (default: 100)") + "\n"; + strUsage += " -keypool= " + strprintf(_("Set key pool size to (default: %u)"), 100) + "\n"; if (GetBoolArg("-help-debug", false)) strUsage += " -mintxfee= " + strprintf(_("Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s)"), FormatMoney(CWallet::minTxFee.GetFeePerK())) + "\n"; strUsage += " -paytxfee= " + strprintf(_("Fee (in BTC/kB) to add to transactions you send (default: %s)"), FormatMoney(payTxFee.GetFeePerK())) + "\n"; strUsage += " -rescan " + _("Rescan the block chain for missing wallet transactions") + " " + _("on startup") + "\n"; strUsage += " -salvagewallet " + _("Attempt to recover private keys from a corrupt wallet.dat") + " " + _("on startup") + "\n"; - strUsage += " -spendzeroconfchange " + _("Spend unconfirmed change when sending transactions (default: 1)") + "\n"; - strUsage += " -txconfirmtarget= " + _("If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1)") + "\n"; + strUsage += " -spendzeroconfchange " + strprintf(_("Spend unconfirmed change when sending transactions (default: %u)"), 1) + "\n"; + strUsage += " -txconfirmtarget= " + strprintf(_("If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: %u)"), 1) + "\n"; strUsage += " -upgradewallet " + _("Upgrade wallet to latest format") + " " + _("on startup") + "\n"; - strUsage += " -wallet= " + _("Specify wallet file (within data directory)") + " " + _("(default: wallet.dat)") + "\n"; + strUsage += " -wallet= " + _("Specify wallet file (within data directory)") + " " + strprintf(_("(default: %s)"), "wallet.dat") + "\n"; strUsage += " -walletnotify= " + _("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)") + "\n"; strUsage += " -zapwallettxes= " + _("Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup") + "\n"; - strUsage += " " + _("(default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)") + "\n"; + strUsage += " " + strprintf(_("(default: %u, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)"), 1) + "\n"; #endif strUsage += "\n" + _("Debugging/Testing options:") + "\n"; if (GetBoolArg("-help-debug", false)) { - strUsage += " -checkpoints " + _("Only accept block chain matching built-in checkpoints (default: 1)") + "\n"; - strUsage += " -dblogsize= " + _("Flush database activity from memory pool to disk log every megabytes (default: 100)") + "\n"; - strUsage += " -disablesafemode " + _("Disable safemode, override a real safe mode event (default: 0)") + "\n"; - strUsage += " -testsafemode " + _("Force safe mode (default: 0)") + "\n"; + strUsage += " -checkpoints " + strprintf(_("Only accept block chain matching built-in checkpoints (default: %u)"), 1) + "\n"; + strUsage += " -dblogsize= " + strprintf(_("Flush database activity from memory pool to disk log every megabytes (default: %u)"), 100) + "\n"; + strUsage += " -disablesafemode " + strprintf(_("Disable safemode, override a real safe mode event (default: %u)"), 0) + "\n"; + strUsage += " -testsafemode " + strprintf(_("Force safe mode (default: %u)"), 0) + "\n"; strUsage += " -dropmessagestest= " + _("Randomly drop 1 of every network messages") + "\n"; strUsage += " -fuzzmessagestest= " + _("Randomly fuzz 1 of every network messages") + "\n"; - strUsage += " -flushwallet " + _("Run a thread to flush wallet periodically (default: 1)") + "\n"; - strUsage += " -stopafterblockimport " + _("Stop running after importing blocks from disk (default: 0)") + "\n"; + strUsage += " -flushwallet " + strprintf(_("Run a thread to flush wallet periodically (default: %u)"), 1) + "\n"; + strUsage += " -stopafterblockimport " + strprintf(_("Stop running after importing blocks from disk (default: %u)"), 0) + "\n"; } - strUsage += " -debug= " + _("Output debugging information (default: 0, supplying is optional)") + "\n"; + strUsage += " -debug= " + strprintf(_("Output debugging information (default: %u, supplying is optional)"), 0) + "\n"; strUsage += " " + _("If is not supplied, output all debugging information.") + "\n"; strUsage += " " + _(" can be:"); strUsage += " addrman, alert, bench, coindb, db, lock, rand, rpc, selectcoins, mempool, net"; // Don't translate these and qt below @@ -310,25 +310,25 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += ", qt"; strUsage += ".\n"; #ifdef ENABLE_WALLET - strUsage += " -gen " + _("Generate coins (default: 0)") + "\n"; - strUsage += " -genproclimit= " + _("Set the processor limit for when generation is on (-1 = unlimited, default: -1)") + "\n"; + strUsage += " -gen " + strprintf(_("Generate coins (default: %u)"), 0) + "\n"; + strUsage += " -genproclimit= " + strprintf(_("Set the processor limit for when generation is on (-1 = unlimited, default: %d)"), -1) + "\n"; #endif strUsage += " -help-debug " + _("Show all debugging options (usage: --help -help-debug)") + "\n"; - strUsage += " -logips " + _("Include IP addresses in debug output (default: 0)") + "\n"; - strUsage += " -logtimestamps " + _("Prepend debug output with timestamp (default: 1)") + "\n"; + strUsage += " -logips " + strprintf(_("Include IP addresses in debug output (default: %u)"), 0) + "\n"; + strUsage += " -logtimestamps " + strprintf(_("Prepend debug output with timestamp (default: %u)"), 1) + "\n"; if (GetBoolArg("-help-debug", false)) { - strUsage += " -limitfreerelay= " + _("Continuously rate-limit free transactions to *1000 bytes per minute (default:15)") + "\n"; - strUsage += " -maxsigcachesize= " + _("Limit size of signature cache to entries (default: 50000)") + "\n"; + strUsage += " -limitfreerelay= " + strprintf(_("Continuously rate-limit free transactions to *1000 bytes per minute (default:%u)"), 15) + "\n"; + strUsage += " -maxsigcachesize= " + strprintf(_("Limit size of signature cache to entries (default: %u)"), 50000) + "\n"; } strUsage += " -minrelaytxfee= " + strprintf(_("Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s)"), FormatMoney(::minRelayTxFee.GetFeePerK())) + "\n"; strUsage += " -printtoconsole " + _("Send trace/debug info to console instead of debug.log file") + "\n"; if (GetBoolArg("-help-debug", false)) { strUsage += " -printblock= " + _("Print block on startup, if found in block index") + "\n"; - strUsage += " -printblocktree " + _("Print block tree on startup (default: 0)") + "\n"; - strUsage += " -printpriority " + _("Log transaction priority and fee per kB when mining blocks (default: 0)") + "\n"; - strUsage += " -privdb " + _("Sets the DB_PRIVATE flag in the wallet db environment (default: 1)") + "\n"; + strUsage += " -printblocktree " + strprintf(_("Print block tree on startup (default: %u)"), 0) + "\n"; + strUsage += " -printpriority " + strprintf(_("Log transaction priority and fee per kB when mining blocks (default: %u)"), 0) + "\n"; + strUsage += " -privdb " + strprintf(_("Sets the DB_PRIVATE flag in the wallet db environment (default: %u)"), 1) + "\n"; strUsage += " -regtest " + _("Enter regression test mode, which uses a special chain in which blocks can be solved instantly.") + "\n"; strUsage += " " + _("This is intended for regression testing tools and app development.") + "\n"; strUsage += " " + _("In this mode -genproclimit controls how many blocks are generated immediately.") + "\n"; @@ -337,10 +337,10 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -testnet " + _("Use the test network") + "\n"; strUsage += "\n" + _("Node relay options:") + "\n"; - strUsage += " -datacarrier " + _("Relay and mine data carrier transactions (default: 1)") + "\n"; + strUsage += " -datacarrier " + strprintf(_("Relay and mine data carrier transactions (default: %u)"), 1) + "\n"; strUsage += "\n" + _("Block creation options:") + "\n"; - strUsage += " -blockminsize= " + _("Set minimum block size in bytes (default: 0)") + "\n"; + strUsage += " -blockminsize= " + strprintf(_("Set minimum block size in bytes (default: %u)"), 0) + "\n"; strUsage += " -blockmaxsize= " + strprintf(_("Set maximum block size in bytes (default: %d)"), DEFAULT_BLOCK_MAX_SIZE) + "\n"; strUsage += " -blockprioritysize= " + strprintf(_("Set maximum size of high-priority/low-fee transactions in bytes (default: %d)"), DEFAULT_BLOCK_PRIORITY_SIZE) + "\n"; @@ -349,15 +349,15 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -rpcbind= " + _("Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces)") + "\n"; strUsage += " -rpcuser= " + _("Username for JSON-RPC connections") + "\n"; strUsage += " -rpcpassword= " + _("Password for JSON-RPC connections") + "\n"; - strUsage += " -rpcport= " + _("Listen for JSON-RPC connections on (default: 8332 or testnet: 18332)") + "\n"; + strUsage += " -rpcport= " + strprintf(_("Listen for JSON-RPC connections on (default: %u or testnet: %u)"), 8332, 18332) + "\n"; strUsage += " -rpcallowip= " + _("Allow JSON-RPC connections from specified source. Valid for are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times") + "\n"; - strUsage += " -rpcthreads= " + _("Set the number of threads to service RPC calls (default: 4)") + "\n"; + strUsage += " -rpcthreads= " + strprintf(_("Set the number of threads to service RPC calls (default: %d)"), 4) + "\n"; strUsage += "\n" + _("RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions)") + "\n"; strUsage += " -rpcssl " + _("Use OpenSSL (https) for JSON-RPC connections") + "\n"; - strUsage += " -rpcsslcertificatechainfile= " + _("Server certificate file (default: server.cert)") + "\n"; - strUsage += " -rpcsslprivatekeyfile= " + _("Server private key (default: server.pem)") + "\n"; - strUsage += " -rpcsslciphers= " + _("Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)") + "\n"; + strUsage += " -rpcsslcertificatechainfile= " + strprintf(_("Server certificate file (default: %s)"), "server.cert") + "\n"; + strUsage += " -rpcsslprivatekeyfile= " + strprintf(_("Server private key (default: %s)"), "server.pem") + "\n"; + strUsage += " -rpcsslciphers= " + strprintf(_("Acceptable ciphers (default: %s)"), "TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH") + "\n"; return strUsage; } From ebdb9ff63992fe685688f6d47cd1f3a2938ee607 Mon Sep 17 00:00:00 2001 From: jtimon Date: Sat, 11 Oct 2014 20:56:27 +0200 Subject: [PATCH 0856/1288] SQUASHME: fix "Reserve only one network specific cached path per session" --- src/util.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 7bb65f6584..ae7767a1f5 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -395,7 +395,8 @@ boost::filesystem::path GetDefaultDataDir() #endif } -static boost::filesystem::path pathCached[2]; +static boost::filesystem::path pathCached; +static boost::filesystem::path pathCachedNetSpecific; static CCriticalSection csPathCached; const boost::filesystem::path &GetDataDir(bool fNetSpecific) @@ -404,7 +405,7 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific) LOCK(csPathCached); - fs::path &path = pathCached[fNetSpecific ? 1 : 0]; + fs::path &path = fNetSpecific ? pathCachedNetSpecific : pathCached; // This can be called during exceptions by LogPrintf(), so we cache the // value so we don't have to do memory allocations after that. @@ -430,7 +431,8 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific) void ClearDatadirCache() { - std::fill(&pathCached[0], &pathCached[2], boost::filesystem::path()); + pathCached = boost::filesystem::path(); + pathCachedNetSpecific = boost::filesystem::path(); } boost::filesystem::path GetConfigFile() From e21b2e0d5f621de5d8d5a9daae910ec512e29aa2 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 13 Oct 2014 16:57:09 +0100 Subject: [PATCH 0857/1288] Typo in test --- src/test/key_tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/key_tests.cpp b/src/test/key_tests.cpp index 203c20731a..b32f3774fe 100644 --- a/src/test/key_tests.cpp +++ b/src/test/key_tests.cpp @@ -75,7 +75,7 @@ BOOST_AUTO_TEST_CASE(key_test1) CKey key1C = bsecret1C.GetKey(); BOOST_CHECK(key1C.IsCompressed() == true); CKey key2C = bsecret2C.GetKey(); - BOOST_CHECK(key1C.IsCompressed() == true); + BOOST_CHECK(key2C.IsCompressed() == true); CPubKey pubkey1 = key1. GetPubKey(); CPubKey pubkey2 = key2. GetPubKey(); From 28d412ff20309b275da1375839dae0ee236a5ac2 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Sun, 12 Oct 2014 23:28:58 -0400 Subject: [PATCH 0858/1288] build: quit abusing LIBS for Windows builds. Similar to the INCLUDES changes in 6b099402b40, split out LIBS into individual entries for more fine-grained control. Also add MINIUPNPC_LIBS which was missing before, and hook it up to executables. --- configure.ac | 7 ++++--- src/Makefile.am | 9 ++++++--- src/Makefile.qt.include | 2 +- src/Makefile.qttest.include | 2 +- src/Makefile.test.include | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 90aa112421..dbc86c6f39 100644 --- a/configure.ac +++ b/configure.ac @@ -462,7 +462,7 @@ dnl Check for libminiupnpc (optional) if test x$use_upnp != xno; then AC_CHECK_HEADERS( [miniupnpc/miniwget.h miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h], - [AC_CHECK_LIB([miniupnpc], [main],, [have_miniupnpc=no])], + [AC_CHECK_LIB([miniupnpc], [main],[MINIUPNPC_LIBS=-lminiupnpc], [have_miniupnpc=no])], [have_miniupnpc=no] ) fi @@ -632,9 +632,9 @@ else AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),) AC_CHECK_LIB([ssl], [main],SSL_LIBS=-lssl, AC_MSG_ERROR(libssl missing)) - BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],,BITCOIN_QT_FAIL(libprotobuf not found))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],[PROTOBUF_LIBS=-lprotobuf], BITCOIN_QT_FAIL(libprotobuf not found))) if test x$use_qr != xno; then - BITCOIN_QT_CHECK([AC_CHECK_LIB([qrencode], [main],, [have_qrencode=no])]) + BITCOIN_QT_CHECK([AC_CHECK_LIB([qrencode], [main],[QR_LIBS=-lqrencode], [have_qrencode=no])]) BITCOIN_QT_CHECK([AC_CHECK_HEADER([qrencode.h],, have_qrencode=no)]) fi fi @@ -808,6 +808,7 @@ AC_SUBST(BUILD_TEST) AC_SUBST(BUILD_QT) AC_SUBST(BUILD_TEST_QT) AC_SUBST(MINIUPNPC_CPPFLAGS) +AC_SUBST(MINIUPNPC_LIBS) AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py]) AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh]) AC_CONFIG_FILES([qa/pull-tester/build-tests.sh],[chmod +x qa/pull-tester/build-tests.sh]) diff --git a/src/Makefile.am b/src/Makefile.am index 155adfef7d..42ecda155c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -281,7 +281,7 @@ if TARGET_WINDOWS bitcoind_SOURCES += bitcoind-res.rc endif -bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) +bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES) bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) @@ -293,7 +293,8 @@ bitcoin_cli_LDADD = \ $(LIBBITCOIN_CRYPTO) \ $(BOOST_LIBS) \ $(SSL_LIBS) \ - $(CRYPTO_LIBS) + $(CRYPTO_LIBS) \ + $(MINIUPNPC_LIBS) bitcoin_cli_SOURCES = \ bitcoin-cli.cpp @@ -317,7 +318,9 @@ endif bitcoin_tx_LDADD += $(BOOST_LIBS) \ $(SSL_LIBS) \ - $(CRYPTO_LIBS) + $(CRYPTO_LIBS) \ + $(MINIUPNPC_LIBS) + bitcoin_tx_SOURCES = bitcoin-tx.cpp bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES) # diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 872a0cf1c5..1c69773647 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -363,7 +363,7 @@ if ENABLE_WALLET qt_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) endif qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ - $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) + $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) if USE_LIBSECP256K1 qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la endif diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 23375bef82..064b531b93 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -32,7 +32,7 @@ qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) endif qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) \ $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ - $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) + $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) if USE_LIBSECP256K1 qt_test_test_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la endif diff --git a/src/Makefile.test.include b/src/Makefile.test.include index b20e226c3d..340eb9f1a7 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -89,7 +89,7 @@ if USE_LIBSECP256K1 test_test_bitcoin_LDADD += secp256k1/libsecp256k1.la endif -test_test_bitcoin_LDADD += $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) +test_test_bitcoin_LDADD += $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES) From c0195b1c31042a7e5d80fa902b149fe2c7f67bb0 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Tue, 14 Oct 2014 20:13:44 +0000 Subject: [PATCH 0859/1288] Bugfix: Remove default from -zapwallettxes description (inaccurate) --- src/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index 1150bb1f5e..ce72b415aa 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -287,7 +287,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -wallet= " + _("Specify wallet file (within data directory)") + " " + strprintf(_("(default: %s)"), "wallet.dat") + "\n"; strUsage += " -walletnotify= " + _("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)") + "\n"; strUsage += " -zapwallettxes= " + _("Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup") + "\n"; - strUsage += " " + strprintf(_("(default: %u, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)"), 1) + "\n"; + strUsage += " " + _("(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)") + "\n"; #endif strUsage += "\n" + _("Debugging/Testing options:") + "\n"; From 341735eb8f42e898cf9d4d130709471e5d01abe2 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 12 Jul 2014 00:02:35 +0200 Subject: [PATCH 0860/1288] Headers-first synchronization Many changes: * Do not use 'getblocks', but 'getheaders', and use it to build a headers tree. * Blocks are fetched in parallel from all available outbound peers, using a limited moving window. When one peer stalls the movement of the window, it is disconnected. * No more orphan blocks. At all. We only ever request a block for which we have verified the headers, and store it to disk immediately. This means that a disk-fill attack would require PoW. * Require protocol version 31800 for every peer (released in december 2010). * No more syncnode (we sync from everyone we can, though limited to 1 during initial *headers* sync). * Introduce some extra named constants, comments and asserts. --- src/chain.h | 32 +- src/main.cpp | 608 ++++++++++++++++++++----------------- src/main.h | 21 +- src/net.cpp | 50 --- src/net.h | 4 - src/qt/forms/rpcconsole.ui | 23 -- src/qt/rpcconsole.cpp | 1 - src/rpcnet.cpp | 1 - src/version.h | 5 +- 9 files changed, 375 insertions(+), 370 deletions(-) diff --git a/src/chain.h b/src/chain.h index 0aafb40b98..4e6a466c6a 100644 --- a/src/chain.h +++ b/src/chain.h @@ -49,12 +49,29 @@ struct CDiskBlockPos }; enum BlockStatus { + // Unused. BLOCK_VALID_UNKNOWN = 0, - BLOCK_VALID_HEADER = 1, // parsed, version ok, hash satisfies claimed PoW, 1 <= vtx count <= max, timestamp not in future - BLOCK_VALID_TREE = 2, // parent found, difficulty matches, timestamp >= median previous, checkpoint - BLOCK_VALID_TRANSACTIONS = 3, // only first tx is coinbase, 2 <= coinbase input script length <= 100, transactions valid, no duplicate txids, sigops, size, merkle root - BLOCK_VALID_CHAIN = 4, // outputs do not overspend inputs, no double spends, coinbase output ok, immature coinbase spends, BIP30 - BLOCK_VALID_SCRIPTS = 5, // scripts/signatures ok + + // Parsed, version ok, hash satisfies claimed PoW, 1 <= vtx count <= max, timestamp not in future + BLOCK_VALID_HEADER = 1, + + // All parent headers found, difficulty matches, timestamp >= median previous, checkpoint. Implies all parents + // are also at least TREE. + BLOCK_VALID_TREE = 2, + + // Only first tx is coinbase, 2 <= coinbase input script length <= 100, transactions valid, no duplicate txids, + // sigops, size, merkle root. Implies all parents are at least TREE but not necessarily TRANSACTIONS. When all + // parent blocks also have TRANSACTIONS, CBlockIndex::nChainTx will be set. + BLOCK_VALID_TRANSACTIONS = 3, + + // Outputs do not overspend inputs, no double spends, coinbase output ok, immature coinbase spends, BIP30. + // Implies all parents are also at least CHAIN. + BLOCK_VALID_CHAIN = 4, + + // Scripts & signatures ok. Implies all parents are also at least SCRIPTS. + BLOCK_VALID_SCRIPTS = 5, + + // All validity bits. BLOCK_VALID_MASK = BLOCK_VALID_HEADER | BLOCK_VALID_TREE | BLOCK_VALID_TRANSACTIONS | BLOCK_VALID_CHAIN | BLOCK_VALID_SCRIPTS, @@ -103,7 +120,8 @@ public: // Note: in a potential headers-first mode, this number cannot be relied upon unsigned int nTx; - // (memory only) Number of transactions in the chain up to and including this block + // (memory only) Number of transactions in the chain up to and including this block. + // This value will be non-zero only if and only if transactions for this block and all its parents are available. unsigned int nChainTx; // change to 64-bit type when necessary; won't happen before 2030 // Verification status of this block. See enum BlockStatus @@ -146,7 +164,7 @@ public: SetNull(); } - CBlockIndex(CBlockHeader& block) + CBlockIndex(const CBlockHeader& block) { SetNull(); diff --git a/src/main.cpp b/src/main.cpp index fc8167e40e..816cab7e1f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -56,14 +56,6 @@ CFeeRate minRelayTxFee = CFeeRate(1000); CTxMemPool mempool(::minRelayTxFee); -struct COrphanBlock { - uint256 hashBlock; - uint256 hashPrev; - vector vchBlock; -}; -map mapOrphanBlocks; -multimap mapOrphanBlocksByPrev; - struct COrphanTx { CTransaction tx; NodeId fromPeer; @@ -106,6 +98,12 @@ namespace { // The set of all CBlockIndex entries with BLOCK_VALID_TRANSACTIONS or better that are at least // as good as our current tip. Entries may be failed, though. set setBlockIndexValid; + // Best header we've seen so far (used for getheaders queries' starting points). + CBlockIndex *pindexBestHeader = NULL; + // Number of nodes with fSyncStarted. + int nSyncStarted = 0; + // All pairs A->B, where A (or one if its ancestors) misses transactions, but B has transactions. + multimap mapBlocksUnlinked; CCriticalSection cs_LastBlockFile; CBlockFileInfo infoLastBlockFile; @@ -125,11 +123,10 @@ namespace { // Protected by cs_main. struct QueuedBlock { uint256 hash; + CBlockIndex *pindex; // Optional. int64_t nTime; // Time of "getdata" request in microseconds. - int nQueuedBefore; // Number of blocks in flight at the time of request. }; map::iterator> > mapBlocksInFlight; - map::iterator> > mapBlocksToDownload; } // anon namespace @@ -220,22 +217,24 @@ struct CNodeState { CBlockIndex *pindexBestKnownBlock; // The hash of the last unknown block this peer has announced. uint256 hashLastUnknownBlock; + // The last full block we both have. + CBlockIndex *pindexLastCommonBlock; + // Whether we've started headers synchronization with this peer. + bool fSyncStarted; + // Since when we're stalling block download progress (in microseconds), or 0. + int64_t nStallingSince; list vBlocksInFlight; int nBlocksInFlight; - list vBlocksToDownload; - int nBlocksToDownload; - int64_t nLastBlockReceive; - int64_t nLastBlockProcess; CNodeState() { nMisbehavior = 0; fShouldBan = false; pindexBestKnownBlock = NULL; hashLastUnknownBlock = uint256(0); - nBlocksToDownload = 0; + pindexLastCommonBlock = NULL; + fSyncStarted = false; + nStallingSince = 0; nBlocksInFlight = 0; - nLastBlockReceive = 0; - nLastBlockProcess = 0; } }; @@ -266,64 +265,37 @@ void FinalizeNode(NodeId nodeid) { LOCK(cs_main); CNodeState *state = State(nodeid); + if (state->fSyncStarted) + nSyncStarted--; + BOOST_FOREACH(const QueuedBlock& entry, state->vBlocksInFlight) mapBlocksInFlight.erase(entry.hash); - BOOST_FOREACH(const uint256& hash, state->vBlocksToDownload) - mapBlocksToDownload.erase(hash); EraseOrphansFor(nodeid); mapNodeState.erase(nodeid); } // Requires cs_main. -void MarkBlockAsReceived(const uint256 &hash, NodeId nodeFrom = -1) { - map::iterator> >::iterator itToDownload = mapBlocksToDownload.find(hash); - if (itToDownload != mapBlocksToDownload.end()) { - CNodeState *state = State(itToDownload->second.first); - state->vBlocksToDownload.erase(itToDownload->second.second); - state->nBlocksToDownload--; - mapBlocksToDownload.erase(itToDownload); - } - +void MarkBlockAsReceived(const uint256& hash) { map::iterator> >::iterator itInFlight = mapBlocksInFlight.find(hash); if (itInFlight != mapBlocksInFlight.end()) { CNodeState *state = State(itInFlight->second.first); state->vBlocksInFlight.erase(itInFlight->second.second); state->nBlocksInFlight--; - if (itInFlight->second.first == nodeFrom) - state->nLastBlockReceive = GetTimeMicros(); + state->nStallingSince = 0; mapBlocksInFlight.erase(itInFlight); } } // Requires cs_main. -bool AddBlockToQueue(NodeId nodeid, const uint256 &hash) { - if (mapBlocksToDownload.count(hash) || mapBlocksInFlight.count(hash)) - return false; - - CNodeState *state = State(nodeid); - if (state == NULL) - return false; - - list::iterator it = state->vBlocksToDownload.insert(state->vBlocksToDownload.end(), hash); - state->nBlocksToDownload++; - if (state->nBlocksToDownload > 5000) - Misbehaving(nodeid, 10); - mapBlocksToDownload[hash] = std::make_pair(nodeid, it); - return true; -} - -// Requires cs_main. -void MarkBlockAsInFlight(NodeId nodeid, const uint256 &hash) { +void MarkBlockAsInFlight(NodeId nodeid, const uint256& hash, CBlockIndex *pindex = NULL) { CNodeState *state = State(nodeid); assert(state != NULL); // Make sure it's not listed somewhere already. MarkBlockAsReceived(hash); - QueuedBlock newentry = {hash, GetTimeMicros(), state->nBlocksInFlight}; - if (state->nBlocksInFlight == 0) - state->nLastBlockReceive = newentry.nTime; // Reset when a first request is sent. + QueuedBlock newentry = {hash, pindex, GetTimeMicros()}; list::iterator it = state->vBlocksInFlight.insert(state->vBlocksInFlight.end(), newentry); state->nBlocksInFlight++; mapBlocksInFlight[hash] = std::make_pair(nodeid, it); @@ -362,6 +334,103 @@ void UpdateBlockAvailability(NodeId nodeid, const uint256 &hash) { } } +/** Find the last common ancestor two blocks have. + * Both pa and pb must be non-NULL. */ +CBlockIndex* LastCommonAncestor(CBlockIndex* pa, CBlockIndex* pb) { + if (pa->nHeight > pb->nHeight) { + pa = pa->GetAncestor(pb->nHeight); + } else if (pb->nHeight > pa->nHeight) { + pb = pb->GetAncestor(pa->nHeight); + } + + while (pa != pb && pa && pb) { + pa = pa->pprev; + pb = pb->pprev; + } + + // Eventually all chain branches meet at the genesis block. + assert(pa == pb); + return pa; +} + +/** Update pindexLastCommonBlock and add not-in-flight missing successors to vBlocks, until it has + * at most count entries. */ +void FindNextBlocksToDownload(NodeId nodeid, unsigned int count, std::vector& vBlocks, NodeId& nodeStaller) { + if (count == 0) + return; + + vBlocks.reserve(vBlocks.size() + count); + CNodeState *state = State(nodeid); + assert(state != NULL); + + // Make sure pindexBestKnownBlock is up to date, we'll need it. + ProcessBlockAvailability(nodeid); + + if (state->pindexBestKnownBlock == NULL || state->pindexBestKnownBlock->nChainWork < chainActive.Tip()->nChainWork) { + // This peer has nothing interesting. + return; + } + + if (state->pindexLastCommonBlock == NULL) { + // Bootstrap quickly by guessing a parent of our best tip is the forking point. + // Guessing wrong in either direction is not a problem. + state->pindexLastCommonBlock = chainActive[std::min(state->pindexBestKnownBlock->nHeight, chainActive.Height())]; + } + + // If the peer reorganized, our previous pindexLastCommonBlock may not be an ancestor + // of their current tip anymore. Go back enough to fix that. + state->pindexLastCommonBlock = LastCommonAncestor(state->pindexLastCommonBlock, state->pindexBestKnownBlock); + if (state->pindexLastCommonBlock == state->pindexBestKnownBlock) + return; + + std::vector vToFetch; + CBlockIndex *pindexWalk = state->pindexLastCommonBlock; + // Never fetch further than the best block we know the peer has, or more than BLOCK_DOWNLOAD_WINDOW + 1 beyond our + // current tip. The +1 is so we can detect stalling, namely if we would be able to download that next block if the + // window were 1 larger. + int nMaxHeight = std::min(state->pindexBestKnownBlock->nHeight, chainActive.Height() + BLOCK_DOWNLOAD_WINDOW + 1); + NodeId waitingfor = -1; + while (pindexWalk->nHeight < nMaxHeight) { + // Read up to 128 (or more, if more blocks than that are needed) successors of pindexWalk (towards + // pindexBestKnownBlock) into vToFetch. We fetch 128, because CBlockIndex::GetAncestor may be as expensive + // as iterating over ~100 CBlockIndex* entries anyway. + int nToFetch = std::min(nMaxHeight - pindexWalk->nHeight, std::max(count - vBlocks.size(), 128)); + vToFetch.resize(nToFetch); + pindexWalk = state->pindexBestKnownBlock->GetAncestor(pindexWalk->nHeight + nToFetch); + vToFetch[nToFetch - 1] = pindexWalk; + for (unsigned int i = nToFetch - 1; i > 0; i--) { + vToFetch[i - 1] = vToFetch[i]->pprev; + } + + // Iterate over those blocks in vToFetch (in forward direction), adding the ones that + // are not yet downloaded and not in flight to vBlocks. In the mean time, update + // pindexLastCommonBlock as long as all ancestors are already downloaded. + BOOST_FOREACH(CBlockIndex* pindex, vToFetch) { + if (pindex->nStatus & BLOCK_HAVE_DATA) { + if (pindex->nChainTx) + state->pindexLastCommonBlock = pindex; + } else if (mapBlocksInFlight.count(pindex->GetBlockHash()) == 0) { + // The block is not already downloaded, and not yet in flight. + if (pindex->nHeight > chainActive.Height() + (int)BLOCK_DOWNLOAD_WINDOW) { + // We reached the end of the window. + if (vBlocks.size() == 0 && waitingfor != nodeid) { + // We aren't able to fetch anything, but we would be if the download window was one larger. + nodeStaller = waitingfor; + } + return; + } + vBlocks.push_back(pindex); + if (vBlocks.size() == count) { + return; + } + } else if (waitingfor == -1) { + // This is the first already-in-flight block. + waitingfor = mapBlocksInFlight[pindex->GetBlockHash()].first; + } + } + } +} + } // anon namespace bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats) { @@ -1086,46 +1155,6 @@ bool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex) return true; } -uint256 static GetOrphanRoot(const uint256& hash) -{ - map::iterator it = mapOrphanBlocks.find(hash); - if (it == mapOrphanBlocks.end()) - return hash; - - // Work back to the first block in the orphan chain - do { - map::iterator it2 = mapOrphanBlocks.find(it->second->hashPrev); - if (it2 == mapOrphanBlocks.end()) - return it->first; - it = it2; - } while(true); -} - -// Remove a random orphan block (which does not have any dependent orphans). -void static PruneOrphanBlocks() -{ - if (mapOrphanBlocksByPrev.size() <= (size_t)std::max((int64_t)0, GetArg("-maxorphanblocks", DEFAULT_MAX_ORPHAN_BLOCKS))) - return; - - // Pick a random orphan block. - int pos = insecure_rand() % mapOrphanBlocksByPrev.size(); - std::multimap::iterator it = mapOrphanBlocksByPrev.begin(); - while (pos--) it++; - - // As long as this block has other orphans depending on it, move to one of those successors. - do { - std::multimap::iterator it2 = mapOrphanBlocksByPrev.find(it->second->hashBlock); - if (it2 == mapOrphanBlocksByPrev.end()) - break; - it = it2; - } while(1); - - uint256 hash = it->second->hashBlock; - delete it->second; - mapOrphanBlocksByPrev.erase(it); - mapOrphanBlocks.erase(hash); -} - CAmount GetBlockValue(int nHeight, const CAmount& nFees) { int64_t nSubsidy = 50 * COIN; @@ -1664,11 +1693,6 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C if (fJustCheck) return true; - // Correct transaction counts. - pindex->nTx = block.vtx.size(); - if (pindex->pprev) - pindex->nChainTx = pindex->pprev->nChainTx + block.vtx.size(); - // Write undo information to disk if (pindex->GetUndoPos().IsNull() || !pindex->IsValid(BLOCK_VALID_SCRIPTS)) { @@ -1900,6 +1924,8 @@ static CBlockIndex* FindMostWorkChain() { CBlockIndex *pindexTest = pindexNew; bool fInvalidAncestor = false; while (pindexTest && !chainActive.Contains(pindexTest)) { + assert(pindexTest->nStatus & BLOCK_HAVE_DATA); + assert(pindexTest->nChainTx || pindexTest->nHeight == 0); if (pindexTest->nStatus & BLOCK_FAILED_MASK) { // Candidate has an invalid ancestor, remove entire chain from the set. if (pindexBestInvalid == NULL || pindexNew->nChainWork > pindexBestInvalid->nChainWork) @@ -2032,7 +2058,7 @@ bool ActivateBestChain(CValidationState &state, CBlock *pblock) { return true; } -CBlockIndex* AddToBlockIndex(CBlockHeader& block) +CBlockIndex* AddToBlockIndex(const CBlockHeader& block) { // Check for duplicate uint256 hash = block.GetHash(); @@ -2043,10 +2069,10 @@ CBlockIndex* AddToBlockIndex(CBlockHeader& block) // Construct new block index object CBlockIndex* pindexNew = new CBlockIndex(block); assert(pindexNew); - { - LOCK(cs_nBlockSequenceId); - pindexNew->nSequenceId = nBlockSequenceId++; - } + // We assign the sequence id to blocks only when the full data is available, + // to avoid miners withholding blocks but broadcasting headers, to get a + // competitive advantage. + pindexNew->nSequenceId = 0; BlockMap::iterator mi = mapBlockIndex.insert(make_pair(hash, pindexNew)).first; pindexNew->phashBlock = &((*mi).first); BlockMap::iterator miPrev = mapBlockIndex.find(block.hashPrevBlock); @@ -2058,6 +2084,11 @@ CBlockIndex* AddToBlockIndex(CBlockHeader& block) } pindexNew->nChainWork = (pindexNew->pprev ? pindexNew->pprev->nChainWork : 0) + pindexNew->GetBlockWork(); pindexNew->RaiseValidity(BLOCK_VALID_TREE); + if (pindexBestHeader == NULL || pindexBestHeader->nChainWork < pindexNew->nChainWork) + pindexBestHeader = pindexNew; + + // Ok if it fails, we'll download the header again next time. + pblocktree->WriteBlockIndex(CDiskBlockIndex(pindexNew)); return pindexNew; } @@ -2066,30 +2097,45 @@ CBlockIndex* AddToBlockIndex(CBlockHeader& block) bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBlockIndex *pindexNew, const CDiskBlockPos& pos) { pindexNew->nTx = block.vtx.size(); - if (pindexNew->pprev) { - // Not the genesis block. - if (pindexNew->pprev->nChainTx) { - // This parent's block's total number transactions is known, so compute outs. - pindexNew->nChainTx = pindexNew->pprev->nChainTx + pindexNew->nTx; - } else { - // The total number of transactions isn't known yet. - // We will compute it when the block is connected. - pindexNew->nChainTx = 0; - } - } else { - // Genesis block. - pindexNew->nChainTx = pindexNew->nTx; - } + pindexNew->nChainTx = 0; pindexNew->nFile = pos.nFile; pindexNew->nDataPos = pos.nPos; pindexNew->nUndoPos = 0; pindexNew->nStatus |= BLOCK_HAVE_DATA; + pindexNew->RaiseValidity(BLOCK_VALID_TRANSACTIONS); + { + LOCK(cs_nBlockSequenceId); + pindexNew->nSequenceId = nBlockSequenceId++; + } - if (pindexNew->RaiseValidity(BLOCK_VALID_TRANSACTIONS)) - setBlockIndexValid.insert(pindexNew); + if (pindexNew->pprev == NULL || pindexNew->pprev->nChainTx) { + // If pindexNew is the genesis block or all parents are BLOCK_VALID_TRANSACTIONS. + deque queue; + queue.push_back(pindexNew); - if (!pblocktree->WriteBlockIndex(CDiskBlockIndex(pindexNew))) - return state.Abort("Failed to write block index"); + // Recursively process any descendant blocks that now may be eligible to be connected. + while (!queue.empty()) { + CBlockIndex *pindex = queue.front(); + queue.pop_front(); + pindex->nChainTx = (pindex->pprev ? pindex->pprev->nChainTx : 0) + pindex->nTx; + setBlockIndexValid.insert(pindex); + std::pair::iterator, std::multimap::iterator> range = mapBlocksUnlinked.equal_range(pindex); + while (range.first != range.second) { + std::multimap::iterator it = range.first; + queue.push_back(it->second); + range.first++; + mapBlocksUnlinked.erase(it); + } + if (!pblocktree->WriteBlockIndex(CDiskBlockIndex(pindex))) + return state.Abort("Failed to write block index"); + } + } else { + if (pindexNew->pprev && pindexNew->pprev->IsValid(BLOCK_VALID_TREE)) { + mapBlocksUnlinked.insert(std::make_pair(pindexNew->pprev, pindexNew)); + } + if (!pblocktree->WriteBlockIndex(CDiskBlockIndex(pindexNew))) + return state.Abort("Failed to write block index"); + } return true; } @@ -2205,12 +2251,31 @@ bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool f bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bool fCheckMerkleRoot) { - // These are checks that are independent of context - // that can be verified before saving an orphan block. + // These are checks that are independent of context. if (!CheckBlockHeader(block, state, fCheckPOW)) return false; + // Check the merkle root. + if (fCheckMerkleRoot) { + bool mutated; + uint256 hashMerkleRoot2 = block.BuildMerkleTree(&mutated); + if (block.hashMerkleRoot != hashMerkleRoot2) + return state.DoS(100, error("CheckBlock() : hashMerkleRoot mismatch"), + REJECT_INVALID, "bad-txnmrklroot", true); + + // Check for merkle tree malleability (CVE-2012-2459): repeating sequences + // of transactions in a block without affecting the merkle root of a block, + // while still invalidating it. + if (mutated) + return state.DoS(100, error("CheckBlock() : duplicate transaction"), + REJECT_INVALID, "bad-txns-duplicate", true); + } + + // All potential-corruption validation must be done before we do any + // transaction validation, as otherwise we may mark the header as invalid + // because we receive the wrong transactions for it. + // Size limits if (block.vtx.empty() || block.vtx.size() > MAX_BLOCK_SIZE || ::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION) > MAX_BLOCK_SIZE) return state.DoS(100, error("CheckBlock() : size limits failed"), @@ -2230,15 +2295,6 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo if (!CheckTransaction(tx, state)) return error("CheckBlock() : CheckTransaction failed"); - // Check for merkle tree malleability (CVE-2012-2459): repeating sequences - // of transactions in a block without affecting the merkle root of a block, - // while still invalidating it. - bool mutated; - uint256 hashMerkleRoot2 = block.BuildMerkleTree(&mutated); - if (mutated) - return state.DoS(100, error("CheckBlock() : duplicate transaction"), - REJECT_INVALID, "bad-txns-duplicate", true); - unsigned int nSigOps = 0; BOOST_FOREACH(const CTransaction& tx, block.vtx) { @@ -2248,15 +2304,10 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo return state.DoS(100, error("CheckBlock() : out-of-bounds SigOpCount"), REJECT_INVALID, "bad-blk-sigops", true); - // Check merkle root - if (fCheckMerkleRoot && block.hashMerkleRoot != hashMerkleRoot2) - return state.DoS(100, error("CheckBlock() : hashMerkleRoot mismatch"), - REJECT_INVALID, "bad-txnmrklroot", true); - return true; } -bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex** ppindex) +bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBlockIndex** ppindex) { AssertLockHeld(cs_main); // Check for duplicate @@ -2264,9 +2315,13 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex BlockMap::iterator miSelf = mapBlockIndex.find(hash); CBlockIndex *pindex = NULL; if (miSelf != mapBlockIndex.end()) { + // Block header is already known. pindex = miSelf->second; + if (ppindex) + *ppindex = pindex; if (pindex->nStatus & BLOCK_FAILED_MASK) return state.Invalid(error("%s : block is marked invalid", __func__), 0, "duplicate"); + return true; } CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(); @@ -2344,6 +2399,12 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex, if (!AcceptBlockHeader(block, state, &pindex)) return false; + if (pindex->nStatus & BLOCK_HAVE_DATA) { + // TODO: deal better with duplicate blocks. + // return state.DoS(20, error("AcceptBlock() : already have block %d %s", pindex->nHeight, pindex->GetBlockHash().ToString()), REJECT_DUPLICATE, "duplicate"); + return true; + } + if (!CheckBlock(block, state)) { if (state.IsInvalid() && !state.CorruptionPossible()) { pindex->nStatus |= BLOCK_FAILED_VALID; @@ -2456,93 +2517,26 @@ void CBlockIndex::BuildSkip() pskip = pprev->GetAncestor(GetSkipHeight(nHeight)); } -void PushGetBlocks(CNode* pnode, CBlockIndex* pindexBegin, uint256 hashEnd) -{ - AssertLockHeld(cs_main); - // Filter out duplicate requests - if (pindexBegin == pnode->pindexLastGetBlocksBegin && hashEnd == pnode->hashLastGetBlocksEnd) - return; - pnode->pindexLastGetBlocksBegin = pindexBegin; - pnode->hashLastGetBlocksEnd = hashEnd; - - pnode->PushMessage("getblocks", chainActive.GetLocator(pindexBegin), hashEnd); -} - bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBlockPos *dbp) { - // Check for duplicate - uint256 hash = pblock->GetHash(); - - { - LOCK(cs_main); - if (mapBlockIndex.count(hash)) - return state.Invalid(error("ProcessBlock() : already have block %d %s", mapBlockIndex[hash]->nHeight, hash.ToString()), 0, "duplicate"); - if (mapOrphanBlocks.count(hash)) - return state.Invalid(error("ProcessBlock() : already have block (orphan) %s", hash.ToString()), 0, "duplicate"); - // Preliminary checks - if (!CheckBlock(*pblock, state)) - return error("ProcessBlock() : CheckBlock FAILED"); + bool checked = CheckBlock(*pblock, state); - // If we don't already have its previous block (with full data), shunt it off to holding area until we get it - BlockMap::iterator it = mapBlockIndex.find(pblock->hashPrevBlock); - if (pblock->hashPrevBlock != 0 && (it == mapBlockIndex.end() || !(it->second->nStatus & BLOCK_HAVE_DATA))) { - LogPrintf("ProcessBlock: ORPHAN BLOCK %lu, prev=%s\n", (unsigned long)mapOrphanBlocks.size(), pblock->hashPrevBlock.ToString()); - - // Accept orphans as long as there is a node to request its parents from - if (pfrom) { - PruneOrphanBlocks(); - COrphanBlock* pblock2 = new COrphanBlock(); - { - CDataStream ss(SER_DISK, CLIENT_VERSION); - ss << *pblock; - pblock2->vchBlock = std::vector(ss.begin(), ss.end()); - } - pblock2->hashBlock = hash; - pblock2->hashPrev = pblock->hashPrevBlock; - mapOrphanBlocks.insert(make_pair(hash, pblock2)); - mapOrphanBlocksByPrev.insert(make_pair(pblock2->hashPrev, pblock2)); - - // Ask this guy to fill in what we're missing - PushGetBlocks(pfrom, chainActive.Tip(), GetOrphanRoot(hash)); + LOCK(cs_main); + MarkBlockAsReceived(pblock->GetHash()); + if (!checked) { + return error("ProcessBlock() : CheckBlock FAILED"); } - return true; - } - // Store to disk - CBlockIndex *pindex = NULL; - bool ret = AcceptBlock(*pblock, state, &pindex, dbp); - if (!ret) - return error("ProcessBlock() : AcceptBlock FAILED"); - - // Recursively process any orphan blocks that depended on this one - vector vWorkQueue; - vWorkQueue.push_back(hash); - for (unsigned int i = 0; i < vWorkQueue.size(); i++) - { - uint256 hashPrev = vWorkQueue[i]; - for (multimap::iterator mi = mapOrphanBlocksByPrev.lower_bound(hashPrev); - mi != mapOrphanBlocksByPrev.upper_bound(hashPrev); - ++mi) - { - CBlock block; - { - CDataStream ss(mi->second->vchBlock, SER_DISK, CLIENT_VERSION); - ss >> block; - } - block.BuildMerkleTree(); - // Use a dummy CValidationState so someone can't setup nodes to counter-DoS based on orphan resolution (that is, feeding people an invalid block based on LegitBlockX in order to get anyone relaying LegitBlockX banned) - CValidationState stateDummy; - CBlockIndex *pindexChild = NULL; - if (AcceptBlock(block, stateDummy, &pindexChild)) - vWorkQueue.push_back(mi->second->hashBlock); - mapOrphanBlocks.erase(mi->second->hashBlock); - delete mi->second; + // Store to disk + CBlockIndex *pindex = NULL; + bool ret = AcceptBlock(*pblock, state, &pindex, dbp); + if (pindex && pfrom) { + mapBlockSource[pindex->GetBlockHash()] = pfrom->GetId(); } - mapOrphanBlocksByPrev.erase(hashPrev); - } - + if (!ret) + return error("ProcessBlock() : AcceptBlock FAILED"); } if (!ActivateBestChain(state, pblock)) @@ -2808,13 +2802,26 @@ bool static LoadBlockIndexDB() { CBlockIndex* pindex = item.second; pindex->nChainWork = (pindex->pprev ? pindex->pprev->nChainWork : 0) + pindex->GetBlockWork(); - pindex->nChainTx = (pindex->pprev ? pindex->pprev->nChainTx : 0) + pindex->nTx; - if (pindex->IsValid(BLOCK_VALID_TRANSACTIONS)) + if (pindex->nStatus & BLOCK_HAVE_DATA) { + if (pindex->pprev) { + if (pindex->pprev->nChainTx) { + pindex->nChainTx = pindex->pprev->nChainTx + pindex->nTx; + } else { + pindex->nChainTx = 0; + mapBlocksUnlinked.insert(std::make_pair(pindex->pprev, pindex)); + } + } else { + pindex->nChainTx = pindex->nTx; + } + } + if (pindex->IsValid(BLOCK_VALID_TRANSACTIONS) && (pindex->nChainTx || pindex->pprev == NULL)) setBlockIndexValid.insert(pindex); if (pindex->nStatus & BLOCK_FAILED_MASK && (!pindexBestInvalid || pindex->nChainWork > pindexBestInvalid->nChainWork)) pindexBestInvalid = pindex; if (pindex->pprev) pindex->BuildSkip(); + if (pindex->IsValid(BLOCK_VALID_TREE) && (pindexBestHeader == NULL || CBlockIndexWorkComparator()(pindexBestHeader, pindex))) + pindexBestHeader = pindex; } // Load block file info @@ -3226,8 +3233,7 @@ bool static AlreadyHave(const CInv& inv) pcoinsTip->HaveCoins(inv.hash); } case MSG_BLOCK: - return mapBlockIndex.count(inv.hash) || - mapOrphanBlocks.count(inv.hash); + return mapBlockIndex.count(inv.hash); } // Don't know what it is, just say we already got one return true; @@ -3375,10 +3381,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, return true; } - { - LOCK(cs_main); - State(pfrom->GetId())->nLastBlockProcess = GetTimeMicros(); - } @@ -3587,6 +3589,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, LOCK(cs_main); + std::vector vToFetch; + for (unsigned int nInv = 0; nInv < vInv.size(); nInv++) { const CInv &inv = vInv[nInv]; @@ -3597,19 +3601,29 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, bool fAlreadyHave = AlreadyHave(inv); LogPrint("net", "got inv: %s %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom->id); - if (!fAlreadyHave) { - if (!fImporting && !fReindex) { - if (inv.type == MSG_BLOCK) - AddBlockToQueue(pfrom->GetId(), inv.hash); - else - pfrom->AskFor(inv); - } - } else if (inv.type == MSG_BLOCK && mapOrphanBlocks.count(inv.hash)) { - PushGetBlocks(pfrom, chainActive.Tip(), GetOrphanRoot(inv.hash)); - } + if (!fAlreadyHave && !fImporting && !fReindex && inv.type != MSG_BLOCK) + pfrom->AskFor(inv); - if (inv.type == MSG_BLOCK) + if (inv.type == MSG_BLOCK) { UpdateBlockAvailability(pfrom->GetId(), inv.hash); + if (!fAlreadyHave && !fImporting && !fReindex && !mapBlocksInFlight.count(inv.hash)) { + // First request the headers preceeding the announced block. In the normal fully-synced + // case where a new block is announced that succeeds the current tip (no reorganization), + // there are no such headers. + // Secondly, and only when we are close to being synced, we request the announced block directly, + // to avoid an extra round-trip. Note that we must *first* ask for the headers, so by the + // time the block arrives, the header chain leading up to it is already validated. Not + // doing this will result in the received block being rejected as an orphan in case it is + // not a direct successor. + pfrom->PushMessage("getheaders", chainActive.GetLocator(pindexBestHeader), inv.hash); + if (chainActive.Tip()->GetBlockTime() > GetAdjustedTime() - Params().TargetSpacing() * 20) { + vToFetch.push_back(inv); + // Mark block as in flight already, even though the actual "getdata" message only goes out + // later (within the same cs_main lock, though). + MarkBlockAsInFlight(pfrom->GetId(), inv.hash); + } + } + } // Track requests for our stuff g_signals.Inventory(inv.hash); @@ -3619,6 +3633,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, return error("send buffer size() = %u", pfrom->nSendSize); } } + + if (!vToFetch.empty()) + pfrom->PushMessage("getdata", vToFetch); } @@ -3706,7 +3723,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // we must use CBlocks, as CBlockHeaders won't include the 0x00 nTx count at the end vector vHeaders; - int nLimit = 2000; + int nLimit = MAX_HEADERS_RESULTS; LogPrint("net", "getheaders %d to %s\n", (pindex ? pindex->nHeight : -1), hashStop.ToString()); for (; pindex; pindex = chainActive.Next(pindex)) { @@ -3826,22 +3843,66 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } + else if (strCommand == "headers" && !fImporting && !fReindex) // Ignore headers received while importing + { + std::vector headers; + + // Bypass the normal CBlock deserialization, as we don't want to risk deserializing 2000 full blocks. + unsigned int nCount = ReadCompactSize(vRecv); + if (nCount > MAX_HEADERS_RESULTS) { + Misbehaving(pfrom->GetId(), 20); + return error("headers message size = %u", nCount); + } + headers.resize(nCount); + for (unsigned int n = 0; n < nCount; n++) { + vRecv >> headers[n]; + ReadCompactSize(vRecv); // ignore tx count; assume it is 0. + } + + LOCK(cs_main); + + if (nCount == 0) { + // Nothing interesting. Stop asking this peers for more headers. + return true; + } + + CBlockIndex *pindexLast = NULL; + BOOST_FOREACH(const CBlockHeader& header, headers) { + CValidationState state; + if (pindexLast != NULL && header.hashPrevBlock != pindexLast->GetBlockHash()) { + Misbehaving(pfrom->GetId(), 20); + return error("non-continuous headers sequence"); + } + if (!AcceptBlockHeader(header, state, &pindexLast)) { + int nDoS; + if (state.IsInvalid(nDoS)) { + if (nDoS > 0) + Misbehaving(pfrom->GetId(), nDoS); + return error("invalid header received"); + } + } + } + + if (pindexLast) + UpdateBlockAvailability(pfrom->GetId(), pindexLast->GetBlockHash()); + + if (nCount == MAX_HEADERS_RESULTS && pindexLast) { + // Headers message had its maximum size; the peer may have more headers. + // TODO: optimize: if pindexLast is an ancestor of chainActive.Tip or pindexBestHeader, continue + // from there instead. + pfrom->PushMessage("getheaders", chainActive.GetLocator(pindexLast), uint256(0)); + } + } + else if (strCommand == "block" && !fImporting && !fReindex) // Ignore blocks received while importing { CBlock block; vRecv >> block; - LogPrint("net", "received block %s peer=%d\n", block.GetHash().ToString(), pfrom->id); - CInv inv(MSG_BLOCK, block.GetHash()); - pfrom->AddInventoryKnown(inv); + LogPrint("net", "received block %s peer=%d\n", inv.hash.ToString(), pfrom->id); - { - LOCK(cs_main); - // Remember who we got this block from. - mapBlockSource[inv.hash] = pfrom->GetId(); - MarkBlockAsReceived(inv.hash, pfrom->GetId()); - } + pfrom->AddInventoryKnown(inv); CValidationState state; ProcessBlock(state, pfrom, &block); @@ -4323,9 +4384,17 @@ bool SendMessages(CNode* pto, bool fSendTrickle) state.rejects.clear(); // Start block sync - if (pto->fStartSync && !fImporting && !fReindex) { - pto->fStartSync = false; - PushGetBlocks(pto, chainActive.Tip(), uint256(0)); + if (pindexBestHeader == NULL) + pindexBestHeader = chainActive.Tip(); + bool fFetch = !pto->fInbound || (pindexBestHeader && (state.pindexLastCommonBlock ? state.pindexLastCommonBlock->nHeight : 0) + 144 > pindexBestHeader->nHeight); + if (!state.fSyncStarted && !pto->fClient && fFetch && !fImporting && !fReindex) { + // Only actively request headers from a single peer, unless we're close to today. + if (nSyncStarted == 0 || pindexBestHeader->GetBlockTime() > GetAdjustedTime() - 24 * 60 * 60) { + state.fSyncStarted = true; + nSyncStarted++; + CBlockIndex *pindexStart = pindexBestHeader->pprev ? pindexBestHeader->pprev : pindexBestHeader; + pto->PushMessage("getheaders", chainActive.GetLocator(pindexStart), uint256(0)); + } } // Resend wallet transactions that haven't gotten in a block yet @@ -4384,35 +4453,32 @@ bool SendMessages(CNode* pto, bool fSendTrickle) if (!vInv.empty()) pto->PushMessage("inv", vInv); - - // Detect stalled peers. Require that blocks are in flight, we haven't - // received a (requested) block in one minute, and that all blocks are - // in flight for over two minutes, since we first had a chance to - // process an incoming block. + // Detect whether we're stalling int64_t nNow = GetTimeMicros(); - if (!pto->fDisconnect && state.nBlocksInFlight && - state.nLastBlockReceive < state.nLastBlockProcess - BLOCK_DOWNLOAD_TIMEOUT*1000000 && - state.vBlocksInFlight.front().nTime < state.nLastBlockProcess - 2*BLOCK_DOWNLOAD_TIMEOUT*1000000) { - LogPrintf("Peer %s is stalling block download, disconnecting\n", state.name); + if (!pto->fDisconnect && state.nStallingSince && state.nStallingSince < nNow - 1000000 * BLOCK_STALLING_TIMEOUT) { + // Stalling only triggers when the block download window cannot move. During normal steady state, + // the download window should be much larger than the to-be-downloaded set of blocks, so disconnection + // should only happen during initial block download. + LogPrintf("Peer=%d is stalling block download, disconnecting\n", pto->id); pto->fDisconnect = true; } - // Update knowledge of peer's block availability. - ProcessBlockAvailability(pto->GetId()); - // // Message: getdata (blocks) // vector vGetData; - while (!pto->fDisconnect && state.nBlocksToDownload && state.nBlocksInFlight < MAX_BLOCKS_IN_TRANSIT_PER_PEER) { - uint256 hash = state.vBlocksToDownload.front(); - vGetData.push_back(CInv(MSG_BLOCK, hash)); - MarkBlockAsInFlight(pto->GetId(), hash); - LogPrint("net", "Requesting block %s peer=%d\n", hash.ToString(), pto->id); - if (vGetData.size() >= 1000) - { - pto->PushMessage("getdata", vGetData); - vGetData.clear(); + if (!pto->fDisconnect && !pto->fClient && fFetch && state.nBlocksInFlight < MAX_BLOCKS_IN_TRANSIT_PER_PEER) { + vector vToDownload; + NodeId staller = -1; + FindNextBlocksToDownload(pto->GetId(), MAX_BLOCKS_IN_TRANSIT_PER_PEER - state.nBlocksInFlight, vToDownload, staller); + BOOST_FOREACH(CBlockIndex *pindex, vToDownload) { + vGetData.push_back(CInv(MSG_BLOCK, pindex->GetBlockHash())); + MarkBlockAsInFlight(pto->GetId(), pindex->GetBlockHash(), pindex); + LogPrint("net", "Requesting block %s peer=%d\n", pindex->GetBlockHash().ToString(), pto->id); + } + if (state.nBlocksInFlight == 0 && staller != -1) { + if (State(staller)->nStallingSince == 0) + State(staller)->nStallingSince = nNow; } } @@ -4519,12 +4585,6 @@ public: delete (*it1).second; mapBlockIndex.clear(); - // orphan blocks - std::map::iterator it2 = mapOrphanBlocks.begin(); - for (; it2 != mapOrphanBlocks.end(); it2++) - delete (*it2).second; - mapOrphanBlocks.clear(); - // orphan transactions mapOrphanTransactions.clear(); mapOrphanTransactionsByPrev.clear(); diff --git a/src/main.h b/src/main.h index cad7eebfb7..674f2fe4a4 100644 --- a/src/main.h +++ b/src/main.h @@ -72,9 +72,17 @@ static const int MAX_SCRIPTCHECK_THREADS = 16; /** -par default (number of script-checking threads, 0 = auto) */ static const int DEFAULT_SCRIPTCHECK_THREADS = 0; /** Number of blocks that can be requested at any given time from a single peer. */ -static const int MAX_BLOCKS_IN_TRANSIT_PER_PEER = 128; -/** Timeout in seconds before considering a block download peer unresponsive. */ -static const unsigned int BLOCK_DOWNLOAD_TIMEOUT = 60; +static const int MAX_BLOCKS_IN_TRANSIT_PER_PEER = 16; +/** Timeout in seconds during which a peer must stall block download progress before being disconnected. */ +static const unsigned int BLOCK_STALLING_TIMEOUT = 2; +/** Number of headers sent in one getheaders result. We rely on the assumption that if a peer sends + * less than this number, we reached their tip. Changing this value is a protocol upgrade. */ +static const unsigned int MAX_HEADERS_RESULTS = 2000; +/** Size of the "block download window": how far ahead of our current height do we fetch? + * Larger windows tolerate larger download speed differences between peer, but increase the potential + * degree of disordering of blocks on disk (which make reindexing and in the future perhaps pruning + * harder). We'll probably want to make this a per-peer adaptive value at some point. */ +static const unsigned int BLOCK_DOWNLOAD_WINDOW = 1024; /** "reject" message codes **/ static const unsigned char REJECT_MALFORMED = 0x01; @@ -137,8 +145,6 @@ void RegisterNodeSignals(CNodeSignals& nodeSignals); /** Unregister a network node */ void UnregisterNodeSignals(CNodeSignals& nodeSignals); -void PushGetBlocks(CNode* pnode, CBlockIndex* pindexBegin, uint256 hashEnd); - /** Process an incoming block */ bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBlockPos *dbp = NULL); /** Check whether enough disk space is available for an incoming block */ @@ -439,9 +445,6 @@ bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex // Apply the effects of this block (with given index) on the UTXO set represented by coins bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& coins, bool fJustCheck = false); -// Add this block to the block index, and if necessary, switch the active block chain to this -bool AddToBlockIndex(CBlock& block, CValidationState& state, const CDiskBlockPos& pos); - // Context-independent validity checks bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool fCheckPOW = true); bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW = true, bool fCheckMerkleRoot = true); @@ -449,7 +452,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW = t // Store block on disk // if dbp is provided, the file is known to already reside on disk bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex **pindex, CDiskBlockPos* dbp = NULL); -bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex **ppindex= NULL); +bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBlockIndex **ppindex= NULL); diff --git a/src/net.cpp b/src/net.cpp index dd5cb480cc..50b435cf14 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -73,7 +73,6 @@ map mapLocalHost; static bool vfReachable[NET_MAX] = {}; static bool vfLimited[NET_MAX] = {}; static CNode* pnodeLocalHost = NULL; -static CNode* pnodeSync = NULL; uint64_t nLocalHostNonce = 0; static std::vector vhListenSocket; CAddrMan addrman; @@ -519,10 +518,6 @@ void CNode::CloseSocketDisconnect() TRY_LOCK(cs_vRecvMsg, lockRecv); if (lockRecv) vRecvMsg.clear(); - - // if this was the sync node, we'll need a new one - if (this == pnodeSync) - pnodeSync = NULL; } void CNode::PushVersion() @@ -615,7 +610,6 @@ void CNode::copyStats(CNodeStats &stats) X(nSendBytes); X(nRecvBytes); X(fWhitelisted); - stats.fSyncNode = (this == pnodeSync); // It is common for nodes with good ping times to suddenly become lagged, // due to a new block arriving or other large transfer. @@ -1487,61 +1481,20 @@ bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOu } -// for now, use a very simple selection metric: the node from which we received -// most recently -static int64_t NodeSyncScore(const CNode *pnode) { - return pnode->nLastRecv; -} - -void static StartSync(const vector &vNodes) { - CNode *pnodeNewSync = NULL; - int64_t nBestScore = 0; - - int nBestHeight = g_signals.GetHeight().get_value_or(0); - - // Iterate over all nodes - BOOST_FOREACH(CNode* pnode, vNodes) { - // check preconditions for allowing a sync - if (!pnode->fClient && !pnode->fOneShot && - !pnode->fDisconnect && pnode->fSuccessfullyConnected && - (pnode->nStartingHeight > (nBestHeight - 144)) && - (pnode->nVersion < NOBLKS_VERSION_START || pnode->nVersion >= NOBLKS_VERSION_END)) { - // if ok, compare node's score with the best so far - int64_t nScore = NodeSyncScore(pnode); - if (pnodeNewSync == NULL || nScore > nBestScore) { - pnodeNewSync = pnode; - nBestScore = nScore; - } - } - } - // if a new sync candidate was found, start sync! - if (pnodeNewSync) { - pnodeNewSync->fStartSync = true; - pnodeSync = pnodeNewSync; - } -} - void ThreadMessageHandler() { SetThreadPriority(THREAD_PRIORITY_BELOW_NORMAL); while (true) { - bool fHaveSyncNode = false; - vector vNodesCopy; { LOCK(cs_vNodes); vNodesCopy = vNodes; BOOST_FOREACH(CNode* pnode, vNodesCopy) { pnode->AddRef(); - if (pnode == pnodeSync) - fHaveSyncNode = true; } } - if (!fHaveSyncNode) - StartSync(vNodesCopy); - // Poll the connected nodes for messages CNode* pnodeTrickle = NULL; if (!vNodesCopy.empty()) @@ -2078,10 +2031,7 @@ CNode::CNode(SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn, bool fIn nSendSize = 0; nSendOffset = 0; hashContinue = 0; - pindexLastGetBlocksBegin = 0; - hashLastGetBlocksEnd = 0; nStartingHeight = -1; - fStartSync = false; fGetAddr = false; fRelayTxes = false; setInventoryKnown.max_size(SendBufferSize() / 1000); diff --git a/src/net.h b/src/net.h index ad0a1df7e2..18da24183f 100644 --- a/src/net.h +++ b/src/net.h @@ -158,7 +158,6 @@ public: int nStartingHeight; uint64_t nSendBytes; uint64_t nRecvBytes; - bool fSyncNode; bool fWhitelisted; double dPingTime; double dPingWait; @@ -276,10 +275,7 @@ protected: public: uint256 hashContinue; - CBlockIndex* pindexLastGetBlocksBegin; - uint256 hashLastGetBlocksEnd; int nStartingHeight; - bool fStartSync; // flood relay std::vector vAddrToSend; diff --git a/src/qt/forms/rpcconsole.ui b/src/qt/forms/rpcconsole.ui index 7f28209c9a..898df2b080 100644 --- a/src/qt/forms/rpcconsole.ui +++ b/src/qt/forms/rpcconsole.ui @@ -836,29 +836,6 @@ - - - - Sync Node - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 8129353d4b..2d2d448b49 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -611,7 +611,6 @@ void RPCConsole::updateNodeDetail(const CNodeCombinedStats *stats) ui->peerSubversion->setText(QString::fromStdString(stats->nodeStats.cleanSubVer)); ui->peerDirection->setText(stats->nodeStats.fInbound ? tr("Inbound") : tr("Outbound")); ui->peerHeight->setText(QString("%1").arg(stats->nodeStats.nStartingHeight)); - ui->peerSyncNode->setText(stats->nodeStats.fSyncNode ? tr("Yes") : tr("No")); // This check fails for example if the lock was busy and // nodeStateStats couldn't be fetched. diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index bc19d1372a..3bc4bb30c3 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -139,7 +139,6 @@ Value getpeerinfo(const Array& params, bool fHelp) obj.push_back(Pair("banscore", statestats.nMisbehavior)); obj.push_back(Pair("syncheight", statestats.nSyncHeight)); } - obj.push_back(Pair("syncnode", stats.fSyncNode)); obj.push_back(Pair("whitelisted", stats.fWhitelisted)); ret.push_back(obj); diff --git a/src/version.h b/src/version.h index 75cbec39b7..a1e440de24 100644 --- a/src/version.h +++ b/src/version.h @@ -33,8 +33,11 @@ static const int PROTOCOL_VERSION = 70002; // initial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209; +// In this version, 'getheaders' was introduced. +static const int GETHEADERS_VERSION = 31800; + // disconnect from peers older than this proto version -static const int MIN_PEER_PROTO_VERSION = 209; +static const int MIN_PEER_PROTO_VERSION = GETHEADERS_VERSION; // nTime field added to CAddress, starting with this version; // if possible, avoid requesting addresses nodes older than this From ad6e6017127ec2a3a8d1a71aaab7a6e945c5b0f9 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 12 Jul 2014 00:03:10 +0200 Subject: [PATCH 0861/1288] RPC additions after headers-first --- src/main.cpp | 9 +++++++-- src/main.h | 5 +++++ src/rpcblockchain.cpp | 2 ++ src/rpcnet.cpp | 15 +++++++++++++-- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 816cab7e1f..604ca670ef 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -41,6 +41,7 @@ CCriticalSection cs_main; BlockMap mapBlockIndex; CChain chainActive; +CBlockIndex *pindexBestHeader = NULL; int64_t nTimeBestReceived = 0; CWaitableCriticalSection csBestBlock; CConditionVariable cvBlockChange; @@ -51,6 +52,7 @@ bool fTxIndex = false; bool fIsBareMultisigStd = true; unsigned int nCoinCacheSize = 5000; + /** Fees smaller than this (in satoshi) are considered zero fee (for relaying and mining) */ CFeeRate minRelayTxFee = CFeeRate(1000); @@ -98,8 +100,6 @@ namespace { // The set of all CBlockIndex entries with BLOCK_VALID_TRANSACTIONS or better that are at least // as good as our current tip. Entries may be failed, though. set setBlockIndexValid; - // Best header we've seen so far (used for getheaders queries' starting points). - CBlockIndex *pindexBestHeader = NULL; // Number of nodes with fSyncStarted. int nSyncStarted = 0; // All pairs A->B, where A (or one if its ancestors) misses transactions, but B has transactions. @@ -440,6 +440,11 @@ bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats) { return false; stats.nMisbehavior = state->nMisbehavior; stats.nSyncHeight = state->pindexBestKnownBlock ? state->pindexBestKnownBlock->nHeight : -1; + stats.nCommonHeight = state->pindexLastCommonBlock ? state->pindexLastCommonBlock->nHeight : -1; + BOOST_FOREACH(const QueuedBlock& queue, state->vBlocksInFlight) { + if (queue.pindex) + stats.vHeightInFlight.push_back(queue.pindex->nHeight); + } return true; } diff --git a/src/main.h b/src/main.h index 674f2fe4a4..7939b087ec 100644 --- a/src/main.h +++ b/src/main.h @@ -118,6 +118,9 @@ extern bool fIsBareMultisigStd; extern unsigned int nCoinCacheSize; extern CFeeRate minRelayTxFee; +// Best header we've seen so far (used for getheaders queries' starting points). +extern CBlockIndex *pindexBestHeader; + // Minimum disk space required - used in CheckDiskSpace() static const uint64_t nMinDiskSpace = 52428800; @@ -199,6 +202,8 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa struct CNodeStateStats { int nMisbehavior; int nSyncHeight; + int nCommonHeight; + std::vector vHeightInFlight; }; struct CDiskTxPos : public CDiskBlockPos diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 24175215bf..5beac0512a 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -445,6 +445,7 @@ Value getblockchaininfo(const Array& params, bool fHelp) "{\n" " \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n" " \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n" + " \"headers\": xxxxxx, (numeric) the current number of headers we have validated\n" " \"bestblockhash\": \"...\", (string) the hash of the currently best block\n" " \"difficulty\": xxxxxx, (numeric) the current difficulty\n" " \"verificationprogress\": xxxx, (numeric) estimate of verification progress [0..1]\n" @@ -458,6 +459,7 @@ Value getblockchaininfo(const Array& params, bool fHelp) Object obj; obj.push_back(Pair("chain", Params().NetworkIDString())); obj.push_back(Pair("blocks", (int)chainActive.Height())); + obj.push_back(Pair("headers", pindexBestHeader ? pindexBestHeader->nHeight : -1)); obj.push_back(Pair("bestblockhash", chainActive.Tip()->GetBlockHash().GetHex())); obj.push_back(Pair("difficulty", (double)GetDifficulty())); obj.push_back(Pair("verificationprogress", Checkpoints::GuessVerificationProgress(chainActive.Tip()))); diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 3bc4bb30c3..12dcd5b540 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -97,7 +97,12 @@ Value getpeerinfo(const Array& params, bool fHelp) " \"inbound\": true|false, (boolean) Inbound (true) or Outbound (false)\n" " \"startingheight\": n, (numeric) The starting height (block) of the peer\n" " \"banscore\": n, (numeric) The ban score\n" - " \"syncnode\": true|false (boolean) if sync node\n" + " \"synced_headers\": n, (numeric) The last header we have in common with this peer\n" + " \"synced_blocks\": n, (numeric) The last block we have in common with this peer\n" + " \"inflight\": [\n" + " n, (numeric) The heights of blocks we're currently asking from this peer\n" + " ...\n" + " ]\n" " }\n" " ,...\n" "]\n" @@ -137,7 +142,13 @@ Value getpeerinfo(const Array& params, bool fHelp) obj.push_back(Pair("startingheight", stats.nStartingHeight)); if (fStateStats) { obj.push_back(Pair("banscore", statestats.nMisbehavior)); - obj.push_back(Pair("syncheight", statestats.nSyncHeight)); + obj.push_back(Pair("synced_headers", statestats.nSyncHeight)); + obj.push_back(Pair("synced_blocks", statestats.nCommonHeight)); + Array heights; + BOOST_FOREACH(int height, statestats.vHeightInFlight) { + heights.push_back(height); + } + obj.push_back(Pair("inflight", heights)); } obj.push_back(Pair("whitelisted", stats.fWhitelisted)); From f244c99c96636136678f17e7ef3952a864613ad0 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 6 Sep 2014 21:16:25 +0200 Subject: [PATCH 0862/1288] Remove CheckMinWork, as we always know all parent headers --- src/main.cpp | 17 ---------------- src/pow.cpp | 33 ------------------------------- src/pow.h | 2 -- src/test/DoS_tests.cpp | 45 ------------------------------------------ 4 files changed, 97 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 604ca670ef..dba4292f50 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2329,23 +2329,6 @@ bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBloc return true; } - CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(); - if (pcheckpoint && block.hashPrevBlock != (chainActive.Tip() ? chainActive.Tip()->GetBlockHash() : uint256(0))) - { - // Extra checks to prevent "fill up memory by spamming with bogus blocks" - int64_t deltaTime = block.GetBlockTime() - pcheckpoint->GetBlockTime(); - if (deltaTime < 0) - { - return state.DoS(100, error("%s : block with timestamp before last checkpoint", __func__), - REJECT_CHECKPOINT, "time-too-old"); - } - if (!CheckMinWork(block.nBits, pcheckpoint->nBits, deltaTime)) - { - return state.DoS(100, error("%s : block with too little proof-of-work", __func__), - REJECT_INVALID, "bad-diffbits"); - } - } - // Get prev block index CBlockIndex* pindexPrev = NULL; int nHeight = 0; diff --git a/src/pow.cpp b/src/pow.cpp index d50222849c..75fbfc6a6d 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -98,39 +98,6 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits) return true; } -// -// true if nBits is greater than the minimum amount of work that could -// possibly be required deltaTime after minimum work required was nBase -// -bool CheckMinWork(unsigned int nBits, unsigned int nBase, int64_t deltaTime) -{ - bool fOverflow = false; - uint256 bnNewBlock; - bnNewBlock.SetCompact(nBits, NULL, &fOverflow); - if (fOverflow) - return false; - - const uint256 &bnLimit = Params().ProofOfWorkLimit(); - // Testnet has min-difficulty blocks - // after Params().TargetSpacing()*2 time between blocks: - if (Params().AllowMinDifficultyBlocks() && deltaTime > Params().TargetSpacing()*2) - return bnNewBlock <= bnLimit; - - uint256 bnResult; - bnResult.SetCompact(nBase); - while (deltaTime > 0 && bnResult < bnLimit) - { - // Maximum 400% adjustment... - bnResult *= 4; - // ... in best-case exactly 4-times-normal target time - deltaTime -= Params().TargetTimespan()*4; - } - if (bnResult > bnLimit) - bnResult = bnLimit; - - return bnNewBlock <= bnResult; -} - void UpdateTime(CBlockHeader* pblock, const CBlockIndex* pindexPrev) { pblock->nTime = std::max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime()); diff --git a/src/pow.h b/src/pow.h index 5d91108ac4..233d1f3795 100644 --- a/src/pow.h +++ b/src/pow.h @@ -16,8 +16,6 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead /** Check whether a block hash satisfies the proof-of-work requirement specified by nBits */ bool CheckProofOfWork(uint256 hash, unsigned int nBits); -/** Check the work is more than the minimum a received block needs, without knowing its direct parent */ -bool CheckMinWork(unsigned int nBits, unsigned int nBase, int64_t deltaTime); void UpdateTime(CBlockHeader* block, const CBlockIndex* pindexPrev); diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index 7bec12b665..f9746fdaa5 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -106,51 +106,6 @@ BOOST_AUTO_TEST_CASE(DoS_bantime) BOOST_CHECK(!CNode::IsBanned(addr)); } -static bool CheckNBits(unsigned int nbits1, int64_t time1, unsigned int nbits2, int64_t time2)\ -{ - if (time1 > time2) - return CheckNBits(nbits2, time2, nbits1, time1); - int64_t deltaTime = time2-time1; - - return CheckMinWork(nbits2, nbits1, deltaTime); -} - -BOOST_AUTO_TEST_CASE(DoS_checknbits) -{ - using namespace boost::assign; // for 'map_list_of()' - - // Timestamps,nBits from the bitcoin block chain. - // These are the block-chain checkpoint blocks - typedef std::map BlockData; - BlockData chainData = - map_list_of(1239852051,486604799)(1262749024,486594666) - (1279305360,469854461)(1280200847,469830746)(1281678674,469809688) - (1296207707,453179945)(1302624061,453036989)(1309640330,437004818) - (1313172719,436789733); - - // Make sure CheckNBits considers every combination of block-chain-lock-in-points - // "sane": - BOOST_FOREACH(const BlockData::value_type& i, chainData) - { - BOOST_FOREACH(const BlockData::value_type& j, chainData) - { - BOOST_CHECK(CheckNBits(i.second, i.first, j.second, j.first)); - } - } - - // Test a couple of insane combinations: - BlockData::value_type firstcheck = *(chainData.begin()); - BlockData::value_type lastcheck = *(chainData.rbegin()); - - // First checkpoint difficulty at or a while after the last checkpoint time should fail when - // compared to last checkpoint - BOOST_CHECK(!CheckNBits(firstcheck.second, lastcheck.first+60*10, lastcheck.second, lastcheck.first)); - BOOST_CHECK(!CheckNBits(firstcheck.second, lastcheck.first+60*60*24*14, lastcheck.second, lastcheck.first)); - - // ... but OK if enough time passed for difficulty to adjust downward: - BOOST_CHECK(CheckNBits(firstcheck.second, lastcheck.first+60*60*24*365*4, lastcheck.second, lastcheck.first)); -} - CTransaction RandomOrphan() { std::map::iterator it; From 4c93322923130b1554937de44545d949c54a6e39 Mon Sep 17 00:00:00 2001 From: R E Broadley Date: Tue, 2 Sep 2014 17:16:32 +0700 Subject: [PATCH 0863/1288] Improve getheaders (sending) logging --- src/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index dba4292f50..f032882ff8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3610,6 +3610,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // later (within the same cs_main lock, though). MarkBlockAsInFlight(pfrom->GetId(), inv.hash); } + LogPrint("net", "getheaders (%d) %s to peer=%d\n", pindexBestHeader->nHeight, inv.hash.ToString(), pfrom->id); } } @@ -3712,7 +3713,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // we must use CBlocks, as CBlockHeaders won't include the 0x00 nTx count at the end vector vHeaders; int nLimit = MAX_HEADERS_RESULTS; - LogPrint("net", "getheaders %d to %s\n", (pindex ? pindex->nHeight : -1), hashStop.ToString()); + LogPrint("net", "getheaders %d to %s from peer=%d\n", (pindex ? pindex->nHeight : -1), hashStop.ToString(), pfrom->id); for (; pindex; pindex = chainActive.Next(pindex)) { vHeaders.push_back(pindex->GetBlockHeader()); @@ -3878,6 +3879,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // Headers message had its maximum size; the peer may have more headers. // TODO: optimize: if pindexLast is an ancestor of chainActive.Tip or pindexBestHeader, continue // from there instead. + LogPrint("net", "more getheaders (%d) to end to peer=%d (startheight:%d)\n", pindexLast->nHeight, pfrom->id, pfrom->nStartingHeight); pfrom->PushMessage("getheaders", chainActive.GetLocator(pindexLast), uint256(0)); } } @@ -4381,6 +4383,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) state.fSyncStarted = true; nSyncStarted++; CBlockIndex *pindexStart = pindexBestHeader->pprev ? pindexBestHeader->pprev : pindexBestHeader; + LogPrint("net", "initial getheaders (%d) to peer=%d (startheight:%d)\n", pindexStart->nHeight, pto->id, pto->nStartingHeight); pto->PushMessage("getheaders", chainActive.GetLocator(pindexStart), uint256(0)); } } From 1bcee67ee780bc44d22b2e44783a04bc330d4f1f Mon Sep 17 00:00:00 2001 From: R E Broadley Date: Thu, 4 Sep 2014 01:31:01 +0700 Subject: [PATCH 0864/1288] Better logging of stalling --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index f032882ff8..c5ad82c14e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4468,8 +4468,10 @@ bool SendMessages(CNode* pto, bool fSendTrickle) LogPrint("net", "Requesting block %s peer=%d\n", pindex->GetBlockHash().ToString(), pto->id); } if (state.nBlocksInFlight == 0 && staller != -1) { - if (State(staller)->nStallingSince == 0) + if (State(staller)->nStallingSince == 0) { State(staller)->nStallingSince = nNow; + LogPrint("net", "Stall started peer=%d\n", staller); + } } } From 1af838b3393ac3d4f6b75ef56f907cb760695952 Mon Sep 17 00:00:00 2001 From: R E Broadley Date: Fri, 5 Sep 2014 22:32:22 +0700 Subject: [PATCH 0865/1288] Add height to "Requesting block" debug --- src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index c5ad82c14e..a2e50b2934 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4465,7 +4465,8 @@ bool SendMessages(CNode* pto, bool fSendTrickle) BOOST_FOREACH(CBlockIndex *pindex, vToDownload) { vGetData.push_back(CInv(MSG_BLOCK, pindex->GetBlockHash())); MarkBlockAsInFlight(pto->GetId(), pindex->GetBlockHash(), pindex); - LogPrint("net", "Requesting block %s peer=%d\n", pindex->GetBlockHash().ToString(), pto->id); + LogPrint("net", "Requesting block %s (%d) peer=%d\n", pindex->GetBlockHash().ToString(), + pindex->nHeight, pto->id); } if (state.nBlocksInFlight == 0 && staller != -1) { if (State(staller)->nStallingSince == 0) { From e17bd58392bb81d5343d0b73e4aa6b113f5828f9 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 6 Oct 2014 08:31:33 +0200 Subject: [PATCH 0866/1288] Rename setBlockIndexValid to setBlockIndexCandidates --- src/main.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a2e50b2934..bb16b716dc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -99,7 +99,7 @@ namespace { // The set of all CBlockIndex entries with BLOCK_VALID_TRANSACTIONS or better that are at least // as good as our current tip. Entries may be failed, though. - set setBlockIndexValid; + set setBlockIndexCandidates; // Number of nodes with fSyncStarted. int nSyncStarted = 0; // All pairs A->B, where A (or one if its ancestors) misses transactions, but B has transactions. @@ -1318,7 +1318,7 @@ void static InvalidBlockFound(CBlockIndex *pindex, const CValidationState &state if (!state.CorruptionPossible()) { pindex->nStatus |= BLOCK_FAILED_VALID; pblocktree->WriteBlockIndex(CDiskBlockIndex(pindex)); - setBlockIndexValid.erase(pindex); + setBlockIndexCandidates.erase(pindex); InvalidChainFound(pindex); } } @@ -1918,8 +1918,8 @@ static CBlockIndex* FindMostWorkChain() { // Find the best candidate header. { - std::set::reverse_iterator it = setBlockIndexValid.rbegin(); - if (it == setBlockIndexValid.rend()) + std::set::reverse_iterator it = setBlockIndexCandidates.rbegin(); + if (it == setBlockIndexCandidates.rend()) return NULL; pindexNew = *it; } @@ -1938,10 +1938,10 @@ static CBlockIndex* FindMostWorkChain() { CBlockIndex *pindexFailed = pindexNew; while (pindexTest != pindexFailed) { pindexFailed->nStatus |= BLOCK_FAILED_CHILD; - setBlockIndexValid.erase(pindexFailed); + setBlockIndexCandidates.erase(pindexFailed); pindexFailed = pindexFailed->pprev; } - setBlockIndexValid.erase(pindexTest); + setBlockIndexCandidates.erase(pindexTest); fInvalidAncestor = true; break; } @@ -1990,15 +1990,15 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo return false; } } else { - // Delete all entries in setBlockIndexValid that are worse than our new current block. + // Delete all entries in setBlockIndexCandidates that are worse than our new current block. // Note that we can't delete the current block itself, as we may need to return to it later in case a // reorganization to a better block fails. - std::set::iterator it = setBlockIndexValid.begin(); - while (setBlockIndexValid.value_comp()(*it, chainActive.Tip())) { - setBlockIndexValid.erase(it++); + std::set::iterator it = setBlockIndexCandidates.begin(); + while (setBlockIndexCandidates.value_comp()(*it, chainActive.Tip())) { + setBlockIndexCandidates.erase(it++); } - // Either the current tip or a successor of it we're working towards is left in setBlockIndexValid. - assert(!setBlockIndexValid.empty()); + // Either the current tip or a successor of it we're working towards is left in setBlockIndexCandidates. + assert(!setBlockIndexCandidates.empty()); if (!pindexOldTip || chainActive.Tip()->nChainWork > pindexOldTip->nChainWork) { // We're in a better position than we were. Return temporarily to release the lock. break; @@ -2123,7 +2123,7 @@ bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBl CBlockIndex *pindex = queue.front(); queue.pop_front(); pindex->nChainTx = (pindex->pprev ? pindex->pprev->nChainTx : 0) + pindex->nTx; - setBlockIndexValid.insert(pindex); + setBlockIndexCandidates.insert(pindex); std::pair::iterator, std::multimap::iterator> range = mapBlocksUnlinked.equal_range(pindex); while (range.first != range.second) { std::multimap::iterator it = range.first; @@ -2803,7 +2803,7 @@ bool static LoadBlockIndexDB() } } if (pindex->IsValid(BLOCK_VALID_TRANSACTIONS) && (pindex->nChainTx || pindex->pprev == NULL)) - setBlockIndexValid.insert(pindex); + setBlockIndexCandidates.insert(pindex); if (pindex->nStatus & BLOCK_FAILED_MASK && (!pindexBestInvalid || pindex->nChainWork > pindexBestInvalid->nChainWork)) pindexBestInvalid = pindex; if (pindex->pprev) @@ -2947,7 +2947,7 @@ bool CVerifyDB::VerifyDB(CCoinsView *coinsview, int nCheckLevel, int nCheckDepth void UnloadBlockIndex() { mapBlockIndex.clear(); - setBlockIndexValid.clear(); + setBlockIndexCandidates.clear(); chainActive.SetTip(NULL); pindexBestInvalid = NULL; } From ad96e7ccd94679d9125a436ceb5b476aacdfca82 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 7 Oct 2014 18:06:30 +0200 Subject: [PATCH 0867/1288] Make -reindex cope with out-of-order blocks Remember out-of-order block headers along with disk positions. This is likely the simplest and least-impact way to make -reindex work with headers first. Based on top of #4468. --- src/main.cpp | 62 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index bb16b716dc..ad133e1bb8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3070,6 +3070,8 @@ void PrintBlockTree() bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp) { + // Map of disk positions for blocks with unknown parent (only used for reindex) + static std::multimap mapBlocksUnknownParent; int64_t nStart = GetTimeMillis(); int nLoaded = 0; @@ -3112,20 +3114,64 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp) try { // read block uint64_t nBlockPos = blkdat.GetPos(); + if (nBlockPos < nStartByte) // skip already indexed part + continue; + if (dbp) + dbp->nPos = nBlockPos; blkdat.SetLimit(nBlockPos + nSize); + + // read block header + CBlockHeader blockhdr; + blkdat >> blockhdr; + nRewind = blkdat.GetPos(); + + // process block header + uint256 hash = blockhdr.GetHash(); + if (hash != Params().HashGenesisBlock() && mapBlockIndex.find(blockhdr.hashPrevBlock) == mapBlockIndex.end()) { + LogPrint("reindex", "%s: Out of order block %s, parent %s not known\n", __func__, hash.ToString(), + blockhdr.hashPrevBlock.ToString()); + if (dbp) + mapBlocksUnknownParent.insert(std::make_pair(blockhdr.hashPrevBlock, *dbp)); + // TODO a slight optimization would be: blkdat.Skip(nSize - 80) + continue; + } + + // read block + blkdat.SetPos(nBlockPos); CBlock block; blkdat >> block; nRewind = blkdat.GetPos(); // process block - if (nBlockPos >= nStartByte) { - if (dbp) - dbp->nPos = nBlockPos; - CValidationState state; - if (ProcessBlock(state, NULL, &block, dbp)) - nLoaded++; - if (state.IsError()) - break; + CValidationState state; + if (ProcessBlock(state, NULL, &block, dbp)) + nLoaded++; + if (state.IsError()) + break; + + // Recursively process earlier encountered successors of this block + deque queue; + queue.push_back(hash); + while (!queue.empty()) { + uint256 head = queue.front(); + queue.pop_front(); + std::pair::iterator, std::multimap::iterator> range = mapBlocksUnknownParent.equal_range(head); + while (range.first != range.second) { + std::multimap::iterator it = range.first; + if (ReadBlockFromDisk(block, it->second)) + { + LogPrintf("%s: Processing out of order child %s of %s\n", __func__, block.GetHash().ToString(), + head.ToString()); + CValidationState dummy; + if (ProcessBlock(dummy, NULL, &block, &it->second)) + { + nLoaded++; + queue.push_back(block.GetHash()); + } + } + range.first++; + mapBlocksUnknownParent.erase(it); + } } } catch (std::exception &e) { LogPrintf("%s : Deserialize or I/O error - %s", __func__, e.what()); From 16d5194165c8c83492b95f431a664d98c40ff254 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 7 Oct 2014 21:15:32 +0200 Subject: [PATCH 0868/1288] Skip reindexed blocks individually Instead of skipping to the last reindexed block in each file (which could jump over processed out-of-order blocks), just skip each already processed block individually. --- src/main.cpp | 53 ++++++++++++++++++---------------------------------- 1 file changed, 18 insertions(+), 35 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ad133e1bb8..908f4c95b6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3078,15 +3078,6 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp) try { // This takes over fileIn and calls fclose() on it in the CBufferedFile destructor CBufferedFile blkdat(fileIn, 2*MAX_BLOCK_SIZE, MAX_BLOCK_SIZE+8, SER_DISK, CLIENT_VERSION); - uint64_t nStartByte = 0; - if (dbp) { - // (try to) skip already indexed part - CBlockFileInfo info; - if (pblocktree->ReadBlockFileInfo(dbp->nFile, info)) { - nStartByte = info.nSize; - blkdat.Seek(info.nSize); - } - } uint64_t nRewind = blkdat.GetPos(); while (!blkdat.eof()) { boost::this_thread::interruption_point(); @@ -3114,40 +3105,32 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp) try { // read block uint64_t nBlockPos = blkdat.GetPos(); - if (nBlockPos < nStartByte) // skip already indexed part - continue; if (dbp) dbp->nPos = nBlockPos; blkdat.SetLimit(nBlockPos + nSize); - - // read block header - CBlockHeader blockhdr; - blkdat >> blockhdr; - nRewind = blkdat.GetPos(); - - // process block header - uint256 hash = blockhdr.GetHash(); - if (hash != Params().HashGenesisBlock() && mapBlockIndex.find(blockhdr.hashPrevBlock) == mapBlockIndex.end()) { - LogPrint("reindex", "%s: Out of order block %s, parent %s not known\n", __func__, hash.ToString(), - blockhdr.hashPrevBlock.ToString()); - if (dbp) - mapBlocksUnknownParent.insert(std::make_pair(blockhdr.hashPrevBlock, *dbp)); - // TODO a slight optimization would be: blkdat.Skip(nSize - 80) - continue; - } - - // read block blkdat.SetPos(nBlockPos); CBlock block; blkdat >> block; nRewind = blkdat.GetPos(); - // process block - CValidationState state; - if (ProcessBlock(state, NULL, &block, dbp)) - nLoaded++; - if (state.IsError()) - break; + // detect out of order blocks, and store them for later + uint256 hash = block.GetHash(); + if (hash != Params().HashGenesisBlock() && mapBlockIndex.find(block.hashPrevBlock) == mapBlockIndex.end()) { + LogPrint("reindex", "%s: Out of order block %s, parent %s not known\n", __func__, hash.ToString(), + block.hashPrevBlock.ToString()); + if (dbp) + mapBlocksUnknownParent.insert(std::make_pair(block.hashPrevBlock, *dbp)); + continue; + } + + // process in case the block isn't known yet + if (mapBlockIndex.count(hash) == 0) { + CValidationState state; + if (ProcessBlock(state, NULL, &block, dbp)) + nLoaded++; + if (state.IsError()) + break; + } // Recursively process earlier encountered successors of this block deque queue; From afc32c5eeada01b141706e32f0405bdb86c00f04 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 10 Oct 2014 13:13:47 -0700 Subject: [PATCH 0869/1288] Fix rebuild-chainstate feature and improve its performance Previous refactorings broke the ability to rebuild the chainstate by deleting the chainstate directory, resulting in an incorrect "Incorrect or no genesis block found" error message. Fix that. Also, improve the performance of ActivateBestBlockStep by using the skiplist to only discover a few potential blocks to connect at a time, instead of all blocks forever - as we likely bail out after connecting a single one anyway. --- src/init.cpp | 2 +- src/main.cpp | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 8772be5539..55991ac9b3 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -974,7 +974,7 @@ bool AppInit2(boost::thread_group& threadGroup) // If the loaded chain has a wrong genesis, bail out immediately // (we're likely using a testnet datadir, or the other way around). - if (!mapBlockIndex.empty() && chainActive.Genesis() == NULL) + if (!mapBlockIndex.empty() && mapBlockIndex.count(Params().HashGenesisBlock()) == 0) return InitError(_("Incorrect or no genesis block found. Wrong datadir for network?")); // Initialize the block index (no-op if non-empty database was already loaded) diff --git a/src/main.cpp b/src/main.cpp index 908f4c95b6..0612f584ac 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1968,12 +1968,20 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo // Build list of new blocks to connect. std::vector vpindexToConnect; - vpindexToConnect.reserve(pindexMostWork->nHeight - (pindexFork ? pindexFork->nHeight : -1)); - CBlockIndex *pindexIter = pindexMostWork; - while (pindexIter && pindexIter != pindexFork) { + bool fContinue = true; + int nHeight = pindexFork ? pindexFork->nHeight : -1; + while (fContinue && nHeight != pindexMostWork->nHeight) { + // Don't iterate the entire list of potential improvements toward the best tip, as we likely only need + // a few blocks along the way. + int nTargetHeight = std::min(nHeight + 32, pindexMostWork->nHeight); + vpindexToConnect.clear(); + vpindexToConnect.reserve(nTargetHeight - nHeight); + CBlockIndex *pindexIter = pindexMostWork->GetAncestor(nTargetHeight); + while (pindexIter && pindexIter->nHeight != nHeight) { vpindexToConnect.push_back(pindexIter); pindexIter = pindexIter->pprev; } + nHeight = nTargetHeight; // Connect new blocks. BOOST_REVERSE_FOREACH(CBlockIndex *pindexConnect, vpindexToConnect) { @@ -1984,6 +1992,7 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo InvalidChainFound(vpindexToConnect.back()); state = CValidationState(); fInvalidFound = true; + fContinue = false; break; } else { // A system error occurred (disk space, database error, ...). @@ -2001,10 +2010,12 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo assert(!setBlockIndexCandidates.empty()); if (!pindexOldTip || chainActive.Tip()->nChainWork > pindexOldTip->nChainWork) { // We're in a better position than we were. Return temporarily to release the lock. + fContinue = false; break; } } } + } // Callbacks/notifications for a new best chain. if (fInvalidFound) From e11b2ce4c63b87efa60b163b50d155969ccd7e08 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 14 Oct 2014 15:41:23 -0700 Subject: [PATCH 0870/1288] Fix large reorgs --- qa/pull-tester/run-bitcoind-for-test.sh.in | 2 +- src/main.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/qa/pull-tester/run-bitcoind-for-test.sh.in b/qa/pull-tester/run-bitcoind-for-test.sh.in index 210fc3c42f..15363d09a6 100755 --- a/qa/pull-tester/run-bitcoind-for-test.sh.in +++ b/qa/pull-tester/run-bitcoind-for-test.sh.in @@ -10,7 +10,7 @@ touch "$DATADIR/regtest/debug.log" tail -q -n 1 -F "$DATADIR/regtest/debug.log" | grep -m 1 -q "Done loading" & WAITER=$! PORT=`expr 10000 + $$ % 55536` -"@abs_top_builddir@/src/bitcoind@EXEEXT@" -connect=0.0.0.0 -datadir="$DATADIR" -rpcuser=user -rpcpassword=pass -listen -keypool=3 -debug -debug=net -logtimestamps -port=$PORT -whitelist=127.0.0.1 -regtest -rpcport=`expr $PORT + 1` & +"@abs_top_builddir@/src/bitcoind@EXEEXT@" -connect=0.0.0.0 -datadir="$DATADIR" -rpcuser=user -rpcpassword=pass -listen -keypool=3 -debug -debug=net -logtimestamps -checkmempool=0 -port=$PORT -whitelist=127.0.0.1 -regtest -rpcport=`expr $PORT + 1` & BITCOIND=$! #Install a watchdog. diff --git a/src/main.cpp b/src/main.cpp index 0612f584ac..f5fd7561c6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -385,10 +385,11 @@ void FindNextBlocksToDownload(NodeId nodeid, unsigned int count, std::vector vToFetch; CBlockIndex *pindexWalk = state->pindexLastCommonBlock; - // Never fetch further than the best block we know the peer has, or more than BLOCK_DOWNLOAD_WINDOW + 1 beyond our - // current tip. The +1 is so we can detect stalling, namely if we would be able to download that next block if the - // window were 1 larger. - int nMaxHeight = std::min(state->pindexBestKnownBlock->nHeight, chainActive.Height() + BLOCK_DOWNLOAD_WINDOW + 1); + // Never fetch further than the best block we know the peer has, or more than BLOCK_DOWNLOAD_WINDOW + 1 beyond the last + // linked block we have in common with this peer. The +1 is so we can detect stalling, namely if we would be able to + // download that next block if the window were 1 larger. + int nWindowEnd = state->pindexLastCommonBlock->nHeight + BLOCK_DOWNLOAD_WINDOW; + int nMaxHeight = std::min(state->pindexBestKnownBlock->nHeight, nWindowEnd + 1); NodeId waitingfor = -1; while (pindexWalk->nHeight < nMaxHeight) { // Read up to 128 (or more, if more blocks than that are needed) successors of pindexWalk (towards @@ -411,7 +412,7 @@ void FindNextBlocksToDownload(NodeId nodeid, unsigned int count, std::vectorpindexLastCommonBlock = pindex; } else if (mapBlocksInFlight.count(pindex->GetBlockHash()) == 0) { // The block is not already downloaded, and not yet in flight. - if (pindex->nHeight > chainActive.Height() + (int)BLOCK_DOWNLOAD_WINDOW) { + if (pindex->nHeight > nWindowEnd) { // We reached the end of the window. if (vBlocks.size() == 0 && waitingfor != nodeid) { // We aren't able to fetch anything, but we would be if the download window was one larger. From 1723862e82926ef24ccf1d098dc02933f893cf48 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 13 Oct 2014 21:59:59 -0400 Subject: [PATCH 0871/1288] build: fix libtool's refusal to link static libs into a dll --- configure.ac | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index dbc86c6f39..b603d1766d 100644 --- a/configure.ac +++ b/configure.ac @@ -11,8 +11,21 @@ AC_CONFIG_SRCDIR([src/main.cpp]) AC_CONFIG_HEADERS([src/config/bitcoin-config.h]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([build-aux/m4]) -LT_INIT([disable-shared]) + AC_CANONICAL_HOST + +dnl By default, libtool for mingw refuses to link static libs into a dll for +dnl fear of mixing pic/non-pic objects, and import/export complications. Since +dnl we have those under control, re-enable that functionality. + +case $host in + *mingw*) + lt_cv_deplibs_check_method="pass_all" + ;; +esac + +LT_INIT([disable-shared]) + AH_TOP([#ifndef BITCOIN_CONFIG_H]) AH_TOP([#define BITCOIN_CONFIG_H]) AH_BOTTOM([#endif //BITCOIN_CONFIG_H]) From 1d9b86d584542fbc34bf49726badaba2ca764228 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 8 Oct 2014 14:27:07 -0400 Subject: [PATCH 0872/1288] boost: drop dependency on is_fundamental in serialization There's only one case where a vector containing a fundamental type is serialized all-at-once, unsigned char. Anything else would lead to strange results. Use a dummy argument to overload in that case. --- src/serialize.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/serialize.h b/src/serialize.h index ff11edc06c..8220fecb9c 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -21,7 +21,6 @@ #include #include -#include class CAutoFile; class CDataStream; @@ -432,14 +431,15 @@ template void Serialize(Stream& os, const std::basi template void Unserialize(Stream& is, std::basic_string& str, int, int=0); // vector -template unsigned int GetSerializeSize_impl(const std::vector& v, int nType, int nVersion, const boost::true_type&); -template unsigned int GetSerializeSize_impl(const std::vector& v, int nType, int nVersion, const boost::false_type&); +// vectors of unsigned char are a special case and are intended to be serialized as a single opaque blob. +template unsigned int GetSerializeSize_impl(const std::vector& v, int nType, int nVersion, const unsigned char&); +template unsigned int GetSerializeSize_impl(const std::vector& v, int nType, int nVersion, const V&); template inline unsigned int GetSerializeSize(const std::vector& v, int nType, int nVersion); -template void Serialize_impl(Stream& os, const std::vector& v, int nType, int nVersion, const boost::true_type&); -template void Serialize_impl(Stream& os, const std::vector& v, int nType, int nVersion, const boost::false_type&); +template void Serialize_impl(Stream& os, const std::vector& v, int nType, int nVersion, const unsigned char&); +template void Serialize_impl(Stream& os, const std::vector& v, int nType, int nVersion, const V&); template inline void Serialize(Stream& os, const std::vector& v, int nType, int nVersion); -template void Unserialize_impl(Stream& is, std::vector& v, int nType, int nVersion, const boost::true_type&); -template void Unserialize_impl(Stream& is, std::vector& v, int nType, int nVersion, const boost::false_type&); +template void Unserialize_impl(Stream& is, std::vector& v, int nType, int nVersion, const unsigned char&); +template void Unserialize_impl(Stream& is, std::vector& v, int nType, int nVersion, const V&); template inline void Unserialize(Stream& is, std::vector& v, int nType, int nVersion); // others derived from vector @@ -536,13 +536,13 @@ void Unserialize(Stream& is, std::basic_string& str, int, int) // vector // template -unsigned int GetSerializeSize_impl(const std::vector& v, int nType, int nVersion, const boost::true_type&) +unsigned int GetSerializeSize_impl(const std::vector& v, int nType, int nVersion, const unsigned char&) { return (GetSizeOfCompactSize(v.size()) + v.size() * sizeof(T)); } -template -unsigned int GetSerializeSize_impl(const std::vector& v, int nType, int nVersion, const boost::false_type&) +template +unsigned int GetSerializeSize_impl(const std::vector& v, int nType, int nVersion, const V&) { unsigned int nSize = GetSizeOfCompactSize(v.size()); for (typename std::vector::const_iterator vi = v.begin(); vi != v.end(); ++vi) @@ -553,20 +553,20 @@ unsigned int GetSerializeSize_impl(const std::vector& v, int nType, int nV template inline unsigned int GetSerializeSize(const std::vector& v, int nType, int nVersion) { - return GetSerializeSize_impl(v, nType, nVersion, boost::is_fundamental()); + return GetSerializeSize_impl(v, nType, nVersion, T()); } template -void Serialize_impl(Stream& os, const std::vector& v, int nType, int nVersion, const boost::true_type&) +void Serialize_impl(Stream& os, const std::vector& v, int nType, int nVersion, const unsigned char&) { WriteCompactSize(os, v.size()); if (!v.empty()) os.write((char*)&v[0], v.size() * sizeof(T)); } -template -void Serialize_impl(Stream& os, const std::vector& v, int nType, int nVersion, const boost::false_type&) +template +void Serialize_impl(Stream& os, const std::vector& v, int nType, int nVersion, const V&) { WriteCompactSize(os, v.size()); for (typename std::vector::const_iterator vi = v.begin(); vi != v.end(); ++vi) @@ -576,12 +576,12 @@ void Serialize_impl(Stream& os, const std::vector& v, int nType, int nVers template inline void Serialize(Stream& os, const std::vector& v, int nType, int nVersion) { - Serialize_impl(os, v, nType, nVersion, boost::is_fundamental()); + Serialize_impl(os, v, nType, nVersion, T()); } template -void Unserialize_impl(Stream& is, std::vector& v, int nType, int nVersion, const boost::true_type&) +void Unserialize_impl(Stream& is, std::vector& v, int nType, int nVersion, const unsigned char&) { // Limit size per read so bogus size value won't cause out of memory v.clear(); @@ -596,8 +596,8 @@ void Unserialize_impl(Stream& is, std::vector& v, int nType, int nVersion, } } -template -void Unserialize_impl(Stream& is, std::vector& v, int nType, int nVersion, const boost::false_type&) +template +void Unserialize_impl(Stream& is, std::vector& v, int nType, int nVersion, const V&) { v.clear(); unsigned int nSize = ReadCompactSize(is); @@ -617,7 +617,7 @@ void Unserialize_impl(Stream& is, std::vector& v, int nType, int nVersion, template inline void Unserialize(Stream& is, std::vector& v, int nType, int nVersion) { - Unserialize_impl(is, v, nType, nVersion, boost::is_fundamental()); + Unserialize_impl(is, v, nType, nVersion, T()); } From 52955068b70fdd4166ffe443e716b0b2f6fe9f6d Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 8 Oct 2014 14:28:03 -0400 Subject: [PATCH 0873/1288] boost: drop dependency on tuple in serialization There's only one user of this form of serialization, so it can be easily dropped. It could be re-added if desired when we switch to c++11. --- src/serialize.h | 77 ------------------------------------------------ src/walletdb.cpp | 8 ++--- 2 files changed, 4 insertions(+), 81 deletions(-) diff --git a/src/serialize.h b/src/serialize.h index 8220fecb9c..55b6891394 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -20,8 +20,6 @@ #include #include -#include - class CAutoFile; class CDataStream; class CScript; @@ -452,16 +450,6 @@ template unsigned int GetSerializeSize(const std::pair void Serialize(Stream& os, const std::pair& item, int nType, int nVersion); template void Unserialize(Stream& is, std::pair& item, int nType, int nVersion); -// 3 tuple -template unsigned int GetSerializeSize(const boost::tuple& item, int nType, int nVersion); -template void Serialize(Stream& os, const boost::tuple& item, int nType, int nVersion); -template void Unserialize(Stream& is, boost::tuple& item, int nType, int nVersion); - -// 4 tuple -template unsigned int GetSerializeSize(const boost::tuple& item, int nType, int nVersion); -template void Serialize(Stream& os, const boost::tuple& item, int nType, int nVersion); -template void Unserialize(Stream& is, boost::tuple& item, int nType, int nVersion); - // map template unsigned int GetSerializeSize(const std::map& m, int nType, int nVersion); template void Serialize(Stream& os, const std::map& m, int nType, int nVersion); @@ -669,71 +657,6 @@ void Unserialize(Stream& is, std::pair& item, int nType, int nVersion) -// -// 3 tuple -// -template -unsigned int GetSerializeSize(const boost::tuple& item, int nType, int nVersion) -{ - unsigned int nSize = 0; - nSize += GetSerializeSize(boost::get<0>(item), nType, nVersion); - nSize += GetSerializeSize(boost::get<1>(item), nType, nVersion); - nSize += GetSerializeSize(boost::get<2>(item), nType, nVersion); - return nSize; -} - -template -void Serialize(Stream& os, const boost::tuple& item, int nType, int nVersion) -{ - Serialize(os, boost::get<0>(item), nType, nVersion); - Serialize(os, boost::get<1>(item), nType, nVersion); - Serialize(os, boost::get<2>(item), nType, nVersion); -} - -template -void Unserialize(Stream& is, boost::tuple& item, int nType, int nVersion) -{ - Unserialize(is, boost::get<0>(item), nType, nVersion); - Unserialize(is, boost::get<1>(item), nType, nVersion); - Unserialize(is, boost::get<2>(item), nType, nVersion); -} - - - -// -// 4 tuple -// -template -unsigned int GetSerializeSize(const boost::tuple& item, int nType, int nVersion) -{ - unsigned int nSize = 0; - nSize += GetSerializeSize(boost::get<0>(item), nType, nVersion); - nSize += GetSerializeSize(boost::get<1>(item), nType, nVersion); - nSize += GetSerializeSize(boost::get<2>(item), nType, nVersion); - nSize += GetSerializeSize(boost::get<3>(item), nType, nVersion); - return nSize; -} - -template -void Serialize(Stream& os, const boost::tuple& item, int nType, int nVersion) -{ - Serialize(os, boost::get<0>(item), nType, nVersion); - Serialize(os, boost::get<1>(item), nType, nVersion); - Serialize(os, boost::get<2>(item), nType, nVersion); - Serialize(os, boost::get<3>(item), nType, nVersion); -} - -template -void Unserialize(Stream& is, boost::tuple& item, int nType, int nVersion) -{ - Unserialize(is, boost::get<0>(item), nType, nVersion); - Unserialize(is, boost::get<1>(item), nType, nVersion); - Unserialize(is, boost::get<2>(item), nType, nVersion); - Unserialize(is, boost::get<3>(item), nType, nVersion); -} - - - // // map // diff --git a/src/walletdb.cpp b/src/walletdb.cpp index 783f766f6f..ffddd8106b 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -185,7 +185,7 @@ bool CWalletDB::WriteAccount(const string& strAccount, const CAccount& account) bool CWalletDB::WriteAccountingEntry(const uint64_t nAccEntryNum, const CAccountingEntry& acentry) { - return Write(boost::make_tuple(string("acentry"), acentry.strAccount, nAccEntryNum), acentry); + return Write(std::make_pair(std::string("acentry"), std::make_pair(acentry.strAccount, nAccEntryNum)), acentry); } bool CWalletDB::WriteAccountingEntry(const CAccountingEntry& acentry) @@ -218,7 +218,7 @@ void CWalletDB::ListAccountCreditDebit(const string& strAccount, list Date: Thu, 9 Oct 2014 16:38:38 -0400 Subject: [PATCH 0874/1288] boost: remove CPrivKey dependency from CECKey This allows CECKey to be used without directly depending on the secure allocators --- src/key.cpp | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/key.cpp b/src/key.cpp index c2251b4f2a..079e2c6540 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -179,19 +179,17 @@ public: BN_clear_free(&bn); } - void GetPrivKey(CPrivKey &privkey, bool fCompressed) { + int GetPrivKeySize(bool fCompressed) { EC_KEY_set_conv_form(pkey, fCompressed ? POINT_CONVERSION_COMPRESSED : POINT_CONVERSION_UNCOMPRESSED); - int nSize = i2d_ECPrivateKey(pkey, NULL); - assert(nSize); - privkey.resize(nSize); - unsigned char* pbegin = &privkey[0]; - int nSize2 = i2d_ECPrivateKey(pkey, &pbegin); - assert(nSize == nSize2); + return i2d_ECPrivateKey(pkey, NULL); + } + int GetPrivKey(unsigned char* privkey, bool fCompressed) { + EC_KEY_set_conv_form(pkey, fCompressed ? POINT_CONVERSION_COMPRESSED : POINT_CONVERSION_UNCOMPRESSED); + return i2d_ECPrivateKey(pkey, &privkey); } - bool SetPrivKey(const CPrivKey &privkey, bool fSkipCheck=false) { - const unsigned char* pbegin = &privkey[0]; - if (d2i_ECPrivateKey(&pkey, &pbegin, privkey.size())) { + bool SetPrivKey(const unsigned char* privkey, size_t size, bool fSkipCheck=false) { + if (d2i_ECPrivateKey(&pkey, &privkey, size)) { if(fSkipCheck) return true; @@ -424,7 +422,7 @@ bool CKey::SetPrivKey(const CPrivKey &privkey, bool fCompressedIn) { return false; #else CECKey key; - if (!key.SetPrivKey(privkey)) + if (!key.SetPrivKey(&privkey[0], privkey.size())) return false; key.GetSecretBytes(vch); #endif @@ -436,16 +434,21 @@ bool CKey::SetPrivKey(const CPrivKey &privkey, bool fCompressedIn) { CPrivKey CKey::GetPrivKey() const { assert(fValid); CPrivKey privkey; + int privkeylen, ret; #ifdef USE_SECP256K1 privkey.resize(279); - int privkeylen = 279; - int ret = secp256k1_ecdsa_privkey_export(begin(), (unsigned char*)&privkey[0], &privkeylen, fCompressed); + privkeylen = 279; + ret = secp256k1_ecdsa_privkey_export(begin(), (unsigned char*)&privkey[0], &privkeylen, fCompressed); assert(ret); privkey.resize(privkeylen); #else CECKey key; key.SetSecretBytes(vch); - key.GetPrivKey(privkey, fCompressed); + privkeylen = key.GetPrivKeySize(fCompressed); + assert(privkeylen); + privkey.resize(privkeylen); + ret = key.GetPrivKey(&privkey[0], fCompressed); + assert(ret == (int)privkey.size()); #endif return privkey; } @@ -517,7 +520,7 @@ bool CKey::Load(CPrivKey &privkey, CPubKey &vchPubKey, bool fSkipCheck=false) { return false; #else CECKey key; - if (!key.SetPrivKey(privkey, fSkipCheck)) + if (!key.SetPrivKey(&privkey[0], privkey.size(), fSkipCheck)) return false; key.GetSecretBytes(vch); #endif From e1c946776652a177e3b46db02391263cc24bfd5a Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 10 Oct 2014 00:42:03 -0400 Subject: [PATCH 0875/1288] boost: drop boost dependency in core.cpp --- src/core.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index 380b1c38e0..6a7a9ff378 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -7,8 +7,6 @@ #include "tinyformat.h" -#include - std::string COutPoint::ToString() const { return strprintf("COutPoint(%s, %u)", hash.ToString().substr(0,10), n); @@ -113,10 +111,10 @@ CTransaction& CTransaction::operator=(const CTransaction &tx) { CAmount CTransaction::GetValueOut() const { CAmount nValueOut = 0; - BOOST_FOREACH(const CTxOut& txout, vout) + for (std::vector::const_iterator it(vout.begin()); it != vout.end(); ++it) { - nValueOut += txout.nValue; - if (!MoneyRange(txout.nValue) || !MoneyRange(nValueOut)) + nValueOut += it->nValue; + if (!MoneyRange(it->nValue) || !MoneyRange(nValueOut)) throw std::runtime_error("CTransaction::GetValueOut() : value out of range"); } return nValueOut; @@ -139,10 +137,9 @@ unsigned int CTransaction::CalculateModifiedSize(unsigned int nTxSize) const // risk encouraging people to create junk outputs to redeem later. if (nTxSize == 0) nTxSize = ::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION); - - BOOST_FOREACH(const CTxIn& txin, vin) + for (std::vector::const_iterator it(vin.begin()); it != vin.end(); ++it) { - unsigned int offset = 41U + std::min(110U, (unsigned int)txin.scriptSig.size()); + unsigned int offset = 41U + std::min(110U, (unsigned int)it->scriptSig.size()); if (nTxSize > offset) nTxSize -= offset; } @@ -263,8 +260,8 @@ uint256 CBlock::BuildMerkleTree(bool* fMutated) const */ vMerkleTree.clear(); vMerkleTree.reserve(vtx.size() * 2 + 16); // Safe upper bound for the number of total nodes. - BOOST_FOREACH(const CTransaction& tx, vtx) - vMerkleTree.push_back(tx.GetHash()); + for (std::vector::const_iterator it(vtx.begin()); it != vtx.end(); ++it) + vMerkleTree.push_back(it->GetHash()); int j = 0; bool mutated = false; for (int nSize = vtx.size(); nSize > 1; nSize = (nSize + 1) / 2) @@ -307,12 +304,12 @@ uint256 CBlock::CheckMerkleBranch(uint256 hash, const std::vector& vMer { if (nIndex == -1) return 0; - BOOST_FOREACH(const uint256& otherside, vMerkleBranch) + for (std::vector::const_iterator it(vMerkleBranch.begin()); it != vMerkleBranch.end(); ++it) { if (nIndex & 1) - hash = Hash(BEGIN(otherside), END(otherside), BEGIN(hash), END(hash)); + hash = Hash(BEGIN(*it), END(*it), BEGIN(hash), END(hash)); else - hash = Hash(BEGIN(hash), END(hash), BEGIN(otherside), END(otherside)); + hash = Hash(BEGIN(hash), END(hash), BEGIN(*it), END(*it)); nIndex >>= 1; } return hash; From 352058e8b0da4ec37b2f1891716c53adc2957a02 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 10 Oct 2014 13:24:12 -0400 Subject: [PATCH 0876/1288] boost: drop boost dependency in utilstrencodings.cpp --- src/utilstrencodings.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index b9e64c5fe1..81e156f43f 100644 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -9,8 +9,8 @@ #include #include - -#include +#include +#include using namespace std; @@ -53,9 +53,9 @@ signed char HexDigit(char c) bool IsHex(const string& str) { - BOOST_FOREACH(char c, str) + for(std::string::const_iterator it(str.begin()); it != str.end(); ++it) { - if (HexDigit(c) < 0) + if (HexDigit(*it) < 0) return false; } return (str.size() > 0) && (str.size()%2 == 0); From 5f4bcf6b14eb45da408e19295332d2a8486d70df Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 13 Oct 2014 14:15:19 -0400 Subject: [PATCH 0877/1288] boost: drop boost dependency in version.cpp. Also add a test to verify. --- src/test/util_tests.cpp | 12 ++++++++++++ src/version.cpp | 10 +++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 6378bd0941..61daa0a3fe 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -9,6 +9,7 @@ #include "sync.h" #include "utilstrencodings.h" #include "utilmoneystr.h" +#include "version.h" #include #include @@ -341,4 +342,15 @@ BOOST_AUTO_TEST_CASE(test_FormatParagraph) BOOST_CHECK_EQUAL(FormatParagraph("test test", 4, 4), "test\n test"); } +BOOST_AUTO_TEST_CASE(test_FormatSubVersion) +{ + std::vector comments; + comments.push_back(std::string("comment1")); + std::vector comments2; + comments2.push_back(std::string("comment1")); + comments2.push_back(std::string("comment2")); + BOOST_CHECK_EQUAL(FormatSubVersion("Test", 99900, std::vector()),std::string("/Test:0.9.99/")); + BOOST_CHECK_EQUAL(FormatSubVersion("Test", 99900, comments),std::string("/Test:0.9.99(comment1)/")); + BOOST_CHECK_EQUAL(FormatSubVersion("Test", 99900, comments2),std::string("/Test:0.9.99(comment1; comment2)/")); +} BOOST_AUTO_TEST_SUITE_END() diff --git a/src/version.cpp b/src/version.cpp index 95632fdab7..d12b681e5c 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -8,8 +8,6 @@ #include -#include - // Name of client reported in the 'version' message. Report the same name // for both bitcoind and bitcoin-qt, to make it harder for attackers to // target servers or GUI users specifically. @@ -94,7 +92,13 @@ std::string FormatSubVersion(const std::string& name, int nClientVersion, const ss << "/"; ss << name << ":" << FormatVersion(nClientVersion); if (!comments.empty()) - ss << "(" << boost::algorithm::join(comments, "; ") << ")"; + { + std::vector::const_iterator it(comments.begin()); + ss << "(" << *it; + for(++it; it != comments.end(); ++it) + ss << "; " << *it; + ss << ")"; + } ss << "/"; return ss.str(); } From 6f155bdb80f045f8542550a5a9b97a00201fa0c5 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Thu, 16 Oct 2014 19:50:49 +0800 Subject: [PATCH 0878/1288] Add LIBTOOLFLAGS CXX tag to qt makefile include Related #4993 --- src/Makefile.qt.include | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 872a0cf1c5..f8f4439159 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -368,6 +368,7 @@ if USE_LIBSECP256K1 qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la endif qt_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) +qt_bitcoin_qt_LIBTOOLFLAGS = --tag CXX #locale/foo.ts -> locale/foo.qm QT_QM=$(QT_TS:.ts=.qm) From 4b0e2d75d78036e7e76fd9584e17b0379ba08d24 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 16 Oct 2014 12:23:50 -0700 Subject: [PATCH 0879/1288] Squashed 'src/leveldb/' changes from 7924331..7d41e6f 7d41e6f Merge upstream LevelDB 1.18 803d692 Release 1.18 git-subtree-dir: src/leveldb git-subtree-split: 7d41e6f89ff04ce9e6a742932924796f69c6e23d --- CONTRIBUTING.md | 36 ++++++ Makefile | 28 +++-- README.md | 138 +++++++++++++++++++++ build_detect_platform | 15 ++- db/db_bench.cc | 3 +- db/db_impl.cc | 4 +- db/db_test.cc | 2 +- db/dbformat.h | 6 +- db/dumpfile.cc | 225 ++++++++++++++++++++++++++++++++++ db/leveldb_main.cc | 204 +++--------------------------- db/log_format.h | 4 +- db/log_reader.cc | 6 +- db/log_reader.h | 4 +- db/log_test.cc | 2 +- db/repair.cc | 2 +- db/skiplist.h | 5 + db/write_batch_internal.h | 4 +- doc/bench/db_bench_tree_db.cc | 2 +- doc/impl.html | 4 +- doc/log_format.txt | 6 +- helpers/memenv/memenv.cc | 9 +- include/leveldb/cache.h | 2 +- include/leveldb/db.h | 2 +- include/leveldb/dumpfile.h | 25 ++++ include/leveldb/env.h | 2 +- include/leveldb/iterator.h | 2 +- include/leveldb/options.h | 2 +- port/atomic_pointer.h | 21 ++-- port/port_posix.h | 9 +- port/thread_annotations.h | 5 +- table/block.cc | 2 +- table/block_builder.h | 2 +- table/format.cc | 2 +- table/table.cc | 14 ++- util/bloom.cc | 2 +- util/env_posix.cc | 10 +- util/hash.cc | 6 +- util/hash_test.cc | 54 ++++++++ util/logging.cc | 9 -- util/logging.h | 4 - 40 files changed, 602 insertions(+), 282 deletions(-) create mode 100644 CONTRIBUTING.md create mode 100644 README.md create mode 100644 db/dumpfile.cc create mode 100644 include/leveldb/dumpfile.h create mode 100644 util/hash_test.cc diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..cd600ff46b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,36 @@ +# Contributing + +We'd love to accept your code patches! However, before we can take them, we +have to jump a couple of legal hurdles. + +## Contributor License Agreements + +Please fill out either the individual or corporate Contributor License +Agreement as appropriate. + +* If you are an individual writing original source code and you're sure you +own the intellectual property, then sign an [individual CLA](https://developers.google.com/open-source/cla/individual). +* If you work for a company that wants to allow you to contribute your work, +then sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. + +## Submitting a Patch + +1. Sign the contributors license agreement above. +2. Decide which code you want to submit. A submission should be a set of changes +that addresses one issue in the [issue tracker](https://github.com/google/leveldb/issues). +Please don't mix more than one logical change per submission, because it makes +the history hard to follow. If you want to make a change +(e.g. add a sample or feature) that doesn't have a corresponding issue in the +issue tracker, please create one. +3. **Submitting**: When you are ready to submit, send us a Pull Request. Be +sure to include the issue number you fixed and the name you used to sign +the CLA. + +## Writing Code ## + +If your contribution contains code, please make sure that it follows +[the style guide](http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml). +Otherwise we will have to ask you to make changes, and that's no fun for anyone. diff --git a/Makefile b/Makefile index f8903b69e4..2bd2cadcdd 100644 --- a/Makefile +++ b/Makefile @@ -6,9 +6,12 @@ # Uncomment exactly one of the lines labelled (A), (B), and (C) below # to switch between compilation modes. -OPT ?= -O2 -DNDEBUG # (A) Production use (optimized mode) -# OPT ?= -g2 # (B) Debug mode, w/ full line-level debugging symbols -# OPT ?= -O2 -g2 -DNDEBUG # (C) Profiling mode: opt, but w/debugging symbols +# (A) Production use (optimized mode) +OPT ?= -O2 -DNDEBUG +# (B) Debug mode, w/ full line-level debugging symbols +# OPT ?= -g2 +# (C) Profiling mode: opt, but w/debugging symbols +# OPT ?= -O2 -g2 -DNDEBUG #----------------------------------------------- # detect what platform we're building on @@ -29,6 +32,11 @@ MEMENVOBJECTS = $(MEMENV_SOURCES:.cc=.o) TESTUTIL = ./util/testutil.o TESTHARNESS = ./util/testharness.o $(TESTUTIL) +# Note: iOS should probably be using libtool, not ar. +ifeq ($(PLATFORM), IOS) +AR=xcrun ar +endif + TESTS = \ arena_test \ autocompact_test \ @@ -43,6 +51,7 @@ TESTS = \ env_test \ filename_test \ filter_block_test \ + hash_test \ issue178_test \ issue200_test \ log_test \ @@ -72,7 +81,7 @@ SHARED = $(SHARED1) else # Update db.h if you change these. SHARED_MAJOR = 1 -SHARED_MINOR = 17 +SHARED_MINOR = 18 SHARED1 = libleveldb.$(PLATFORM_SHARED_EXT) SHARED2 = $(SHARED1).$(SHARED_MAJOR) SHARED3 = $(SHARED1).$(SHARED_MAJOR).$(SHARED_MINOR) @@ -152,6 +161,9 @@ filename_test: db/filename_test.o $(LIBOBJECTS) $(TESTHARNESS) filter_block_test: table/filter_block_test.o $(LIBOBJECTS) $(TESTHARNESS) $(CXX) $(LDFLAGS) table/filter_block_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS) +hash_test: util/hash_test.o $(LIBOBJECTS) $(TESTHARNESS) + $(CXX) $(LDFLAGS) util/hash_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS) + issue178_test: issues/issue178_test.o $(LIBOBJECTS) $(TESTHARNESS) $(CXX) $(LDFLAGS) issues/issue178_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS) @@ -194,17 +206,17 @@ IOSARCH=-arch armv6 -arch armv7 -arch armv7s -arch arm64 .cc.o: mkdir -p ios-x86/$(dir $@) - $(CXX) $(CXXFLAGS) -isysroot $(SIMULATORROOT)/SDKs/iPhoneSimulator$(IOSVERSION).sdk -arch i686 -arch x86_64 -c $< -o ios-x86/$@ + xcrun -sdk iphonesimulator $(CXX) $(CXXFLAGS) -isysroot $(SIMULATORROOT)/SDKs/iPhoneSimulator$(IOSVERSION).sdk -arch i686 -arch x86_64 -c $< -o ios-x86/$@ mkdir -p ios-arm/$(dir $@) xcrun -sdk iphoneos $(CXX) $(CXXFLAGS) -isysroot $(DEVICEROOT)/SDKs/iPhoneOS$(IOSVERSION).sdk $(IOSARCH) -c $< -o ios-arm/$@ - lipo ios-x86/$@ ios-arm/$@ -create -output $@ + xcrun lipo ios-x86/$@ ios-arm/$@ -create -output $@ .c.o: mkdir -p ios-x86/$(dir $@) - $(CC) $(CFLAGS) -isysroot $(SIMULATORROOT)/SDKs/iPhoneSimulator$(IOSVERSION).sdk -arch i686 -arch x86_64 -c $< -o ios-x86/$@ + xcrun -sdk iphonesimulator $(CC) $(CFLAGS) -isysroot $(SIMULATORROOT)/SDKs/iPhoneSimulator$(IOSVERSION).sdk -arch i686 -arch x86_64 -c $< -o ios-x86/$@ mkdir -p ios-arm/$(dir $@) xcrun -sdk iphoneos $(CC) $(CFLAGS) -isysroot $(DEVICEROOT)/SDKs/iPhoneOS$(IOSVERSION).sdk $(IOSARCH) -c $< -o ios-arm/$@ - lipo ios-x86/$@ ios-arm/$@ -create -output $@ + xcrun lipo ios-x86/$@ ios-arm/$@ -create -output $@ else .cc.o: diff --git a/README.md b/README.md new file mode 100644 index 0000000000..480affb5ca --- /dev/null +++ b/README.md @@ -0,0 +1,138 @@ +**LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.** + +Authors: Sanjay Ghemawat (sanjay@google.com) and Jeff Dean (jeff@google.com) + +# Features + * Keys and values are arbitrary byte arrays. + * Data is stored sorted by key. + * Callers can provide a custom comparison function to override the sort order. + * The basic operations are `Put(key,value)`, `Get(key)`, `Delete(key)`. + * Multiple changes can be made in one atomic batch. + * Users can create a transient snapshot to get a consistent view of data. + * Forward and backward iteration is supported over the data. + * Data is automatically compressed using the [Snappy compression library](http://code.google.com/p/snappy). + * External activity (file system operations etc.) is relayed through a virtual interface so users can customize the operating system interactions. + * [Detailed documentation](http://htmlpreview.github.io/?https://github.com/google/leveldb/blob/master/doc/index.html) about how to use the library is included with the source code. + + +# Limitations + * This is not a SQL database. It does not have a relational data model, it does not support SQL queries, and it has no support for indexes. + * Only a single process (possibly multi-threaded) can access a particular database at a time. + * There is no client-server support builtin to the library. An application that needs such support will have to wrap their own server around the library. + +# Performance + +Here is a performance report (with explanations) from the run of the +included db_bench program. The results are somewhat noisy, but should +be enough to get a ballpark performance estimate. + +## Setup + +We use a database with a million entries. Each entry has a 16 byte +key, and a 100 byte value. Values used by the benchmark compress to +about half their original size. + + LevelDB: version 1.1 + Date: Sun May 1 12:11:26 2011 + CPU: 4 x Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz + CPUCache: 4096 KB + Keys: 16 bytes each + Values: 100 bytes each (50 bytes after compression) + Entries: 1000000 + Raw Size: 110.6 MB (estimated) + File Size: 62.9 MB (estimated) + +## Write performance + +The "fill" benchmarks create a brand new database, in either +sequential, or random order. The "fillsync" benchmark flushes data +from the operating system to the disk after every operation; the other +write operations leave the data sitting in the operating system buffer +cache for a while. The "overwrite" benchmark does random writes that +update existing keys in the database. + + fillseq : 1.765 micros/op; 62.7 MB/s + fillsync : 268.409 micros/op; 0.4 MB/s (10000 ops) + fillrandom : 2.460 micros/op; 45.0 MB/s + overwrite : 2.380 micros/op; 46.5 MB/s + +Each "op" above corresponds to a write of a single key/value pair. +I.e., a random write benchmark goes at approximately 400,000 writes per second. + +Each "fillsync" operation costs much less (0.3 millisecond) +than a disk seek (typically 10 milliseconds). We suspect that this is +because the hard disk itself is buffering the update in its memory and +responding before the data has been written to the platter. This may +or may not be safe based on whether or not the hard disk has enough +power to save its memory in the event of a power failure. + +## Read performance + +We list the performance of reading sequentially in both the forward +and reverse direction, and also the performance of a random lookup. +Note that the database created by the benchmark is quite small. +Therefore the report characterizes the performance of leveldb when the +working set fits in memory. The cost of reading a piece of data that +is not present in the operating system buffer cache will be dominated +by the one or two disk seeks needed to fetch the data from disk. +Write performance will be mostly unaffected by whether or not the +working set fits in memory. + + readrandom : 16.677 micros/op; (approximately 60,000 reads per second) + readseq : 0.476 micros/op; 232.3 MB/s + readreverse : 0.724 micros/op; 152.9 MB/s + +LevelDB compacts its underlying storage data in the background to +improve read performance. The results listed above were done +immediately after a lot of random writes. The results after +compactions (which are usually triggered automatically) are better. + + readrandom : 11.602 micros/op; (approximately 85,000 reads per second) + readseq : 0.423 micros/op; 261.8 MB/s + readreverse : 0.663 micros/op; 166.9 MB/s + +Some of the high cost of reads comes from repeated decompression of blocks +read from disk. If we supply enough cache to the leveldb so it can hold the +uncompressed blocks in memory, the read performance improves again: + + readrandom : 9.775 micros/op; (approximately 100,000 reads per second before compaction) + readrandom : 5.215 micros/op; (approximately 190,000 reads per second after compaction) + +## Repository contents + +See doc/index.html for more explanation. See doc/impl.html for a brief overview of the implementation. + +The public interface is in include/*.h. Callers should not include or +rely on the details of any other header files in this package. Those +internal APIs may be changed without warning. + +Guide to header files: + +* **include/db.h**: Main interface to the DB: Start here + +* **include/options.h**: Control over the behavior of an entire database, +and also control over the behavior of individual reads and writes. + +* **include/comparator.h**: Abstraction for user-specified comparison function. +If you want just bytewise comparison of keys, you can use the default +comparator, but clients can write their own comparator implementations if they +want custom ordering (e.g. to handle different character encodings, etc.) + +* **include/iterator.h**: Interface for iterating over data. You can get +an iterator from a DB object. + +* **include/write_batch.h**: Interface for atomically applying multiple +updates to a database. + +* **include/slice.h**: A simple module for maintaining a pointer and a +length into some other byte array. + +* **include/status.h**: Status is returned from many of the public interfaces +and is used to report success and various kinds of errors. + +* **include/env.h**: +Abstraction of the OS environment. A posix implementation of this interface is +in util/env_posix.cc + +* **include/table.h, include/table_builder.h**: Lower-level modules that most +clients probably won't use directly diff --git a/build_detect_platform b/build_detect_platform index 85b1ce0224..a1101c1bda 100755 --- a/build_detect_platform +++ b/build_detect_platform @@ -20,7 +20,7 @@ # # The PLATFORM_CCFLAGS and PLATFORM_CXXFLAGS might include the following: # -# -DLEVELDB_CSTDATOMIC_PRESENT if is present +# -DLEVELDB_ATOMIC_PRESENT if is present # -DLEVELDB_PLATFORM_POSIX for Posix-based platforms # -DSNAPPY if the Snappy library is present # @@ -72,6 +72,12 @@ if [ "$CXX" = "g++" ]; then fi case "$TARGET_OS" in + CYGWIN_*) + PLATFORM=OS_LINUX + COMMON_FLAGS="$MEMCMP_FLAG -lpthread -DOS_LINUX -DCYGWIN" + PLATFORM_LDFLAGS="-lpthread" + PORT_FILE=port/port_posix.cc + ;; Darwin) PLATFORM=OS_MACOSX COMMON_FLAGS="$MEMCMP_FLAG -DOS_MACOSX" @@ -185,13 +191,14 @@ if [ "$CROSS_COMPILE" = "true" ]; then else CXXOUTPUT="${TMPDIR}/leveldb_build_detect_platform-cxx.$$" - # If -std=c++0x works, use . Otherwise use port_posix.h. + # If -std=c++0x works, use as fallback for when memory barriers + # are not available. $CXX $CXXFLAGS -std=c++0x -x c++ - -o $CXXOUTPUT 2>/dev/null < + #include int main() {} EOF if [ "$?" = 0 ]; then - COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX -DLEVELDB_CSTDATOMIC_PRESENT" + COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX -DLEVELDB_ATOMIC_PRESENT" PLATFORM_CXXFLAGS="-std=c++0x" else COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX" diff --git a/db/db_bench.cc b/db/db_bench.cc index fc46d89693..705a170aae 100644 --- a/db/db_bench.cc +++ b/db/db_bench.cc @@ -431,7 +431,7 @@ class Benchmark { benchmarks = sep + 1; } - // Reset parameters that may be overriddden bwlow + // Reset parameters that may be overridden below num_ = FLAGS_num; reads_ = (FLAGS_reads < 0 ? FLAGS_num : FLAGS_reads); value_size_ = FLAGS_value_size; @@ -811,7 +811,6 @@ class Benchmark { void SeekRandom(ThreadState* thread) { ReadOptions options; - std::string value; int found = 0; for (int i = 0; i < reads_; i++) { Iterator* iter = db_->NewIterator(options); diff --git a/db/db_impl.cc b/db/db_impl.cc index faf5e7d7ba..49b95953b4 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -392,7 +392,7 @@ Status DBImpl::RecoverLogFile(uint64_t log_number, reporter.info_log = options_.info_log; reporter.fname = fname.c_str(); reporter.status = (options_.paranoid_checks ? &status : NULL); - // We intentially make log::Reader do checksumming even if + // We intentionally make log::Reader do checksumming even if // paranoid_checks==false so that corruptions cause entire commits // to be skipped instead of propagating bad information (like overly // large sequence numbers). @@ -1267,7 +1267,7 @@ WriteBatch* DBImpl::BuildBatchGroup(Writer** last_writer) { break; } - // Append to *reuslt + // Append to *result if (result == first->batch) { // Switch to temporary batch instead of disturbing caller's batch result = tmp_batch_; diff --git a/db/db_test.cc b/db/db_test.cc index 280b01c14b..0fed9137d5 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -626,7 +626,7 @@ TEST(DBTest, GetEncountersEmptyLevel) { // * sstable B in level 2 // Then do enough Get() calls to arrange for an automatic compaction // of sstable A. A bug would cause the compaction to be marked as - // occuring at level 1 (instead of the correct level 0). + // occurring at level 1 (instead of the correct level 0). // Step 1: First place sstables in levels 0 and 2 int compaction_count = 0; diff --git a/db/dbformat.h b/db/dbformat.h index 5d8a032bd3..ea897b13c0 100644 --- a/db/dbformat.h +++ b/db/dbformat.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#ifndef STORAGE_LEVELDB_DB_FORMAT_H_ -#define STORAGE_LEVELDB_DB_FORMAT_H_ +#ifndef STORAGE_LEVELDB_DB_DBFORMAT_H_ +#define STORAGE_LEVELDB_DB_DBFORMAT_H_ #include #include "leveldb/comparator.h" @@ -227,4 +227,4 @@ inline LookupKey::~LookupKey() { } // namespace leveldb -#endif // STORAGE_LEVELDB_DB_FORMAT_H_ +#endif // STORAGE_LEVELDB_DB_DBFORMAT_H_ diff --git a/db/dumpfile.cc b/db/dumpfile.cc new file mode 100644 index 0000000000..61c47c2ff9 --- /dev/null +++ b/db/dumpfile.cc @@ -0,0 +1,225 @@ +// Copyright (c) 2012 The LevelDB Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. See the AUTHORS file for names of contributors. + +#include +#include "db/dbformat.h" +#include "db/filename.h" +#include "db/log_reader.h" +#include "db/version_edit.h" +#include "db/write_batch_internal.h" +#include "leveldb/env.h" +#include "leveldb/iterator.h" +#include "leveldb/options.h" +#include "leveldb/status.h" +#include "leveldb/table.h" +#include "leveldb/write_batch.h" +#include "util/logging.h" + +namespace leveldb { + +namespace { + +bool GuessType(const std::string& fname, FileType* type) { + size_t pos = fname.rfind('/'); + std::string basename; + if (pos == std::string::npos) { + basename = fname; + } else { + basename = std::string(fname.data() + pos + 1, fname.size() - pos - 1); + } + uint64_t ignored; + return ParseFileName(basename, &ignored, type); +} + +// Notified when log reader encounters corruption. +class CorruptionReporter : public log::Reader::Reporter { + public: + WritableFile* dst_; + virtual void Corruption(size_t bytes, const Status& status) { + std::string r = "corruption: "; + AppendNumberTo(&r, bytes); + r += " bytes; "; + r += status.ToString(); + r.push_back('\n'); + dst_->Append(r); + } +}; + +// Print contents of a log file. (*func)() is called on every record. +Status PrintLogContents(Env* env, const std::string& fname, + void (*func)(uint64_t, Slice, WritableFile*), + WritableFile* dst) { + SequentialFile* file; + Status s = env->NewSequentialFile(fname, &file); + if (!s.ok()) { + return s; + } + CorruptionReporter reporter; + reporter.dst_ = dst; + log::Reader reader(file, &reporter, true, 0); + Slice record; + std::string scratch; + while (reader.ReadRecord(&record, &scratch)) { + (*func)(reader.LastRecordOffset(), record, dst); + } + delete file; + return Status::OK(); +} + +// Called on every item found in a WriteBatch. +class WriteBatchItemPrinter : public WriteBatch::Handler { + public: + WritableFile* dst_; + virtual void Put(const Slice& key, const Slice& value) { + std::string r = " put '"; + AppendEscapedStringTo(&r, key); + r += "' '"; + AppendEscapedStringTo(&r, value); + r += "'\n"; + dst_->Append(r); + } + virtual void Delete(const Slice& key) { + std::string r = " del '"; + AppendEscapedStringTo(&r, key); + r += "'\n"; + dst_->Append(r); + } +}; + + +// Called on every log record (each one of which is a WriteBatch) +// found in a kLogFile. +static void WriteBatchPrinter(uint64_t pos, Slice record, WritableFile* dst) { + std::string r = "--- offset "; + AppendNumberTo(&r, pos); + r += "; "; + if (record.size() < 12) { + r += "log record length "; + AppendNumberTo(&r, record.size()); + r += " is too small\n"; + dst->Append(r); + return; + } + WriteBatch batch; + WriteBatchInternal::SetContents(&batch, record); + r += "sequence "; + AppendNumberTo(&r, WriteBatchInternal::Sequence(&batch)); + r.push_back('\n'); + dst->Append(r); + WriteBatchItemPrinter batch_item_printer; + batch_item_printer.dst_ = dst; + Status s = batch.Iterate(&batch_item_printer); + if (!s.ok()) { + dst->Append(" error: " + s.ToString() + "\n"); + } +} + +Status DumpLog(Env* env, const std::string& fname, WritableFile* dst) { + return PrintLogContents(env, fname, WriteBatchPrinter, dst); +} + +// Called on every log record (each one of which is a WriteBatch) +// found in a kDescriptorFile. +static void VersionEditPrinter(uint64_t pos, Slice record, WritableFile* dst) { + std::string r = "--- offset "; + AppendNumberTo(&r, pos); + r += "; "; + VersionEdit edit; + Status s = edit.DecodeFrom(record); + if (!s.ok()) { + r += s.ToString(); + r.push_back('\n'); + } else { + r += edit.DebugString(); + } + dst->Append(r); +} + +Status DumpDescriptor(Env* env, const std::string& fname, WritableFile* dst) { + return PrintLogContents(env, fname, VersionEditPrinter, dst); +} + +Status DumpTable(Env* env, const std::string& fname, WritableFile* dst) { + uint64_t file_size; + RandomAccessFile* file = NULL; + Table* table = NULL; + Status s = env->GetFileSize(fname, &file_size); + if (s.ok()) { + s = env->NewRandomAccessFile(fname, &file); + } + if (s.ok()) { + // We use the default comparator, which may or may not match the + // comparator used in this database. However this should not cause + // problems since we only use Table operations that do not require + // any comparisons. In particular, we do not call Seek or Prev. + s = Table::Open(Options(), file, file_size, &table); + } + if (!s.ok()) { + delete table; + delete file; + return s; + } + + ReadOptions ro; + ro.fill_cache = false; + Iterator* iter = table->NewIterator(ro); + std::string r; + for (iter->SeekToFirst(); iter->Valid(); iter->Next()) { + r.clear(); + ParsedInternalKey key; + if (!ParseInternalKey(iter->key(), &key)) { + r = "badkey '"; + AppendEscapedStringTo(&r, iter->key()); + r += "' => '"; + AppendEscapedStringTo(&r, iter->value()); + r += "'\n"; + dst->Append(r); + } else { + r = "'"; + AppendEscapedStringTo(&r, key.user_key); + r += "' @ "; + AppendNumberTo(&r, key.sequence); + r += " : "; + if (key.type == kTypeDeletion) { + r += "del"; + } else if (key.type == kTypeValue) { + r += "val"; + } else { + AppendNumberTo(&r, key.type); + } + r += " => '"; + AppendEscapedStringTo(&r, iter->value()); + r += "'\n"; + dst->Append(r); + } + } + s = iter->status(); + if (!s.ok()) { + dst->Append("iterator error: " + s.ToString() + "\n"); + } + + delete iter; + delete table; + delete file; + return Status::OK(); +} + +} // namespace + +Status DumpFile(Env* env, const std::string& fname, WritableFile* dst) { + FileType ftype; + if (!GuessType(fname, &ftype)) { + return Status::InvalidArgument(fname + ": unknown file type"); + } + switch (ftype) { + case kLogFile: return DumpLog(env, fname, dst); + case kDescriptorFile: return DumpDescriptor(env, fname, dst); + case kTableFile: return DumpTable(env, fname, dst); + default: + break; + } + return Status::InvalidArgument(fname + ": not a dump-able file type"); +} + +} // namespace leveldb diff --git a/db/leveldb_main.cc b/db/leveldb_main.cc index 995d76107a..9f4b7dd70c 100644 --- a/db/leveldb_main.cc +++ b/db/leveldb_main.cc @@ -3,212 +3,38 @@ // found in the LICENSE file. See the AUTHORS file for names of contributors. #include -#include "db/dbformat.h" -#include "db/filename.h" -#include "db/log_reader.h" -#include "db/version_edit.h" -#include "db/write_batch_internal.h" +#include "leveldb/dumpfile.h" #include "leveldb/env.h" -#include "leveldb/iterator.h" -#include "leveldb/options.h" #include "leveldb/status.h" -#include "leveldb/table.h" -#include "leveldb/write_batch.h" -#include "util/logging.h" namespace leveldb { - namespace { -bool GuessType(const std::string& fname, FileType* type) { - size_t pos = fname.rfind('/'); - std::string basename; - if (pos == std::string::npos) { - basename = fname; - } else { - basename = std::string(fname.data() + pos + 1, fname.size() - pos - 1); - } - uint64_t ignored; - return ParseFileName(basename, &ignored, type); -} - -// Notified when log reader encounters corruption. -class CorruptionReporter : public log::Reader::Reporter { +class StdoutPrinter : public WritableFile { public: - virtual void Corruption(size_t bytes, const Status& status) { - printf("corruption: %d bytes; %s\n", - static_cast(bytes), - status.ToString().c_str()); + virtual Status Append(const Slice& data) { + fwrite(data.data(), 1, data.size(), stdout); + return Status::OK(); } + virtual Status Close() { return Status::OK(); } + virtual Status Flush() { return Status::OK(); } + virtual Status Sync() { return Status::OK(); } }; -// Print contents of a log file. (*func)() is called on every record. -bool PrintLogContents(Env* env, const std::string& fname, - void (*func)(Slice)) { - SequentialFile* file; - Status s = env->NewSequentialFile(fname, &file); - if (!s.ok()) { - fprintf(stderr, "%s\n", s.ToString().c_str()); - return false; - } - CorruptionReporter reporter; - log::Reader reader(file, &reporter, true, 0); - Slice record; - std::string scratch; - while (reader.ReadRecord(&record, &scratch)) { - printf("--- offset %llu; ", - static_cast(reader.LastRecordOffset())); - (*func)(record); - } - delete file; - return true; -} - -// Called on every item found in a WriteBatch. -class WriteBatchItemPrinter : public WriteBatch::Handler { - public: - uint64_t offset_; - uint64_t sequence_; - - virtual void Put(const Slice& key, const Slice& value) { - printf(" put '%s' '%s'\n", - EscapeString(key).c_str(), - EscapeString(value).c_str()); - } - virtual void Delete(const Slice& key) { - printf(" del '%s'\n", - EscapeString(key).c_str()); - } -}; - - -// Called on every log record (each one of which is a WriteBatch) -// found in a kLogFile. -static void WriteBatchPrinter(Slice record) { - if (record.size() < 12) { - printf("log record length %d is too small\n", - static_cast(record.size())); - return; - } - WriteBatch batch; - WriteBatchInternal::SetContents(&batch, record); - printf("sequence %llu\n", - static_cast(WriteBatchInternal::Sequence(&batch))); - WriteBatchItemPrinter batch_item_printer; - Status s = batch.Iterate(&batch_item_printer); - if (!s.ok()) { - printf(" error: %s\n", s.ToString().c_str()); - } -} - -bool DumpLog(Env* env, const std::string& fname) { - return PrintLogContents(env, fname, WriteBatchPrinter); -} - -// Called on every log record (each one of which is a WriteBatch) -// found in a kDescriptorFile. -static void VersionEditPrinter(Slice record) { - VersionEdit edit; - Status s = edit.DecodeFrom(record); - if (!s.ok()) { - printf("%s\n", s.ToString().c_str()); - return; - } - printf("%s", edit.DebugString().c_str()); -} - -bool DumpDescriptor(Env* env, const std::string& fname) { - return PrintLogContents(env, fname, VersionEditPrinter); -} - -bool DumpTable(Env* env, const std::string& fname) { - uint64_t file_size; - RandomAccessFile* file = NULL; - Table* table = NULL; - Status s = env->GetFileSize(fname, &file_size); - if (s.ok()) { - s = env->NewRandomAccessFile(fname, &file); - } - if (s.ok()) { - // We use the default comparator, which may or may not match the - // comparator used in this database. However this should not cause - // problems since we only use Table operations that do not require - // any comparisons. In particular, we do not call Seek or Prev. - s = Table::Open(Options(), file, file_size, &table); - } - if (!s.ok()) { - fprintf(stderr, "%s\n", s.ToString().c_str()); - delete table; - delete file; - return false; - } - - ReadOptions ro; - ro.fill_cache = false; - Iterator* iter = table->NewIterator(ro); - for (iter->SeekToFirst(); iter->Valid(); iter->Next()) { - ParsedInternalKey key; - if (!ParseInternalKey(iter->key(), &key)) { - printf("badkey '%s' => '%s'\n", - EscapeString(iter->key()).c_str(), - EscapeString(iter->value()).c_str()); - } else { - char kbuf[20]; - const char* type; - if (key.type == kTypeDeletion) { - type = "del"; - } else if (key.type == kTypeValue) { - type = "val"; - } else { - snprintf(kbuf, sizeof(kbuf), "%d", static_cast(key.type)); - type = kbuf; - } - printf("'%s' @ %8llu : %s => '%s'\n", - EscapeString(key.user_key).c_str(), - static_cast(key.sequence), - type, - EscapeString(iter->value()).c_str()); - } - } - s = iter->status(); - if (!s.ok()) { - printf("iterator error: %s\n", s.ToString().c_str()); - } - - delete iter; - delete table; - delete file; - return true; -} - -bool DumpFile(Env* env, const std::string& fname) { - FileType ftype; - if (!GuessType(fname, &ftype)) { - fprintf(stderr, "%s: unknown file type\n", fname.c_str()); - return false; - } - switch (ftype) { - case kLogFile: return DumpLog(env, fname); - case kDescriptorFile: return DumpDescriptor(env, fname); - case kTableFile: return DumpTable(env, fname); - - default: { - fprintf(stderr, "%s: not a dump-able file type\n", fname.c_str()); - break; - } - } - return false; -} - bool HandleDumpCommand(Env* env, char** files, int num) { + StdoutPrinter printer; bool ok = true; for (int i = 0; i < num; i++) { - ok &= DumpFile(env, files[i]); + Status s = DumpFile(env, files[i], &printer); + if (!s.ok()) { + fprintf(stderr, "%s\n", s.ToString().c_str()); + ok = false; + } } return ok; } -} +} // namespace } // namespace leveldb static void Usage() { diff --git a/db/log_format.h b/db/log_format.h index 2690cb9789..a8c06efe18 100644 --- a/db/log_format.h +++ b/db/log_format.h @@ -26,8 +26,8 @@ static const int kMaxRecordType = kLastType; static const int kBlockSize = 32768; -// Header is checksum (4 bytes), type (1 byte), length (2 bytes). -static const int kHeaderSize = 4 + 1 + 2; +// Header is checksum (4 bytes), length (2 bytes), type (1 byte). +static const int kHeaderSize = 4 + 2 + 1; } // namespace log } // namespace leveldb diff --git a/db/log_reader.cc b/db/log_reader.cc index 4919216d04..e44b66c85b 100644 --- a/db/log_reader.cc +++ b/db/log_reader.cc @@ -167,14 +167,14 @@ uint64_t Reader::LastRecordOffset() { return last_record_offset_; } -void Reader::ReportCorruption(size_t bytes, const char* reason) { +void Reader::ReportCorruption(uint64_t bytes, const char* reason) { ReportDrop(bytes, Status::Corruption(reason)); } -void Reader::ReportDrop(size_t bytes, const Status& reason) { +void Reader::ReportDrop(uint64_t bytes, const Status& reason) { if (reporter_ != NULL && end_of_buffer_offset_ - buffer_.size() - bytes >= initial_offset_) { - reporter_->Corruption(bytes, reason); + reporter_->Corruption(static_cast(bytes), reason); } } diff --git a/db/log_reader.h b/db/log_reader.h index 82d4bee68d..6aff791716 100644 --- a/db/log_reader.h +++ b/db/log_reader.h @@ -94,8 +94,8 @@ class Reader { // Reports dropped bytes to the reporter. // buffer_ must be updated to remove the dropped bytes prior to invocation. - void ReportCorruption(size_t bytes, const char* reason); - void ReportDrop(size_t bytes, const Status& reason); + void ReportCorruption(uint64_t bytes, const char* reason); + void ReportDrop(uint64_t bytes, const Status& reason); // No copying allowed Reader(const Reader&); diff --git a/db/log_test.cc b/db/log_test.cc index 91d3caafc3..dcf0562652 100644 --- a/db/log_test.cc +++ b/db/log_test.cc @@ -463,7 +463,7 @@ TEST(LogTest, ErrorJoinsRecords) { ASSERT_EQ("correct", Read()); ASSERT_EQ("EOF", Read()); - const int dropped = DroppedBytes(); + const size_t dropped = DroppedBytes(); ASSERT_LE(dropped, 2*kBlockSize + 100); ASSERT_GE(dropped, 2*kBlockSize); } diff --git a/db/repair.cc b/db/repair.cc index 7727fafc58..4cd4bb047f 100644 --- a/db/repair.cc +++ b/db/repair.cc @@ -186,7 +186,7 @@ class Repairer { reporter.env = env_; reporter.info_log = options_.info_log; reporter.lognum = log; - // We intentially make log::Reader do checksumming so that + // We intentionally make log::Reader do checksumming so that // corruptions cause entire commits to be skipped instead of // propagating bad information (like overly large sequence // numbers). diff --git a/db/skiplist.h b/db/skiplist.h index af85be6d01..ed8b092203 100644 --- a/db/skiplist.h +++ b/db/skiplist.h @@ -1,3 +1,6 @@ +#ifndef STORAGE_LEVELDB_DB_SKIPLIST_H_ +#define STORAGE_LEVELDB_DB_SKIPLIST_H_ + // Copyright (c) 2011 The LevelDB Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. @@ -377,3 +380,5 @@ bool SkipList::Contains(const Key& key) const { } } // namespace leveldb + +#endif // STORAGE_LEVELDB_DB_SKIPLIST_H_ diff --git a/db/write_batch_internal.h b/db/write_batch_internal.h index 4423a7f318..310a3c8912 100644 --- a/db/write_batch_internal.h +++ b/db/write_batch_internal.h @@ -21,10 +21,10 @@ class WriteBatchInternal { // Set the count for the number of entries in the batch. static void SetCount(WriteBatch* batch, int n); - // Return the seqeunce number for the start of this batch. + // Return the sequence number for the start of this batch. static SequenceNumber Sequence(const WriteBatch* batch); - // Store the specified number as the seqeunce number for the start of + // Store the specified number as the sequence number for the start of // this batch. static void SetSequence(WriteBatch* batch, SequenceNumber seq); diff --git a/doc/bench/db_bench_tree_db.cc b/doc/bench/db_bench_tree_db.cc index ed86f031c2..4ca381f11f 100644 --- a/doc/bench/db_bench_tree_db.cc +++ b/doc/bench/db_bench_tree_db.cc @@ -338,7 +338,7 @@ class Benchmark { bool write_sync = false; if (name == Slice("fillseq")) { Write(write_sync, SEQUENTIAL, FRESH, num_, FLAGS_value_size, 1); - + DBSynchronize(db_); } else if (name == Slice("fillrandom")) { Write(write_sync, RANDOM, FRESH, num_, FLAGS_value_size, 1); DBSynchronize(db_); diff --git a/doc/impl.html b/doc/impl.html index 28817fe0da..6a468be095 100644 --- a/doc/impl.html +++ b/doc/impl.html @@ -111,7 +111,7 @@ A compaction merges the contents of the picked files to produce a sequence of level-(L+1) files. We switch to producing a new level-(L+1) file after the current output file has reached the target file size (2MB). We also switch to a new output file when the key -range of the current output file has grown enough to overlap more then +range of the current output file has grown enough to overlap more than ten level-(L+2) files. This last rule ensures that a later compaction of a level-(L+1) file will not pick up too much data from level-(L+2). @@ -151,7 +151,7 @@ compaction cost will be approximately 0.5 second. If we throttle the background writing to something small, say 10% of the full 100MB/s speed, a compaction may take up to 5 seconds. If the user is writing at 10MB/s, we might build up lots of level-0 files -(~50 to hold the 5*10MB). This may signficantly increase the cost of +(~50 to hold the 5*10MB). This may significantly increase the cost of reads due to the overhead of merging more files together on every read. diff --git a/doc/log_format.txt b/doc/log_format.txt index 5228f624de..4cca5ef6ea 100644 --- a/doc/log_format.txt +++ b/doc/log_format.txt @@ -11,7 +11,7 @@ Each block consists of a sequence of records: A record never starts within the last six bytes of a block (since it won't fit). Any leftover bytes here form the trailer, which must -consist entirely of zero bytes and must be skipped by readers. +consist entirely of zero bytes and must be skipped by readers. Aside: if exactly seven bytes are left in the current block, and a new non-zero length record is added, the writer must emit a FIRST record @@ -33,8 +33,8 @@ The FULL record contains the contents of an entire user record. FIRST, MIDDLE, LAST are types used for user records that have been split into multiple fragments (typically because of block boundaries). FIRST is the type of the first fragment of a user record, LAST is the -type of the last fragment of a user record, and MID is the type of all -interior fragments of a user record. +type of the last fragment of a user record, and MIDDLE is the type of +all interior fragments of a user record. Example: consider a sequence of user records: A: length 1000 diff --git a/helpers/memenv/memenv.cc b/helpers/memenv/memenv.cc index 5879de1214..43ef2e0729 100644 --- a/helpers/memenv/memenv.cc +++ b/helpers/memenv/memenv.cc @@ -55,14 +55,15 @@ class FileState { } const uint64_t available = size_ - offset; if (n > available) { - n = available; + n = static_cast(available); } if (n == 0) { *result = Slice(); return Status::OK(); } - size_t block = offset / kBlockSize; + assert(offset / kBlockSize <= SIZE_MAX); + size_t block = static_cast(offset / kBlockSize); size_t block_offset = offset % kBlockSize; if (n <= kBlockSize - block_offset) { @@ -167,7 +168,7 @@ class SequentialFileImpl : public SequentialFile { if (pos_ > file_->Size()) { return Status::IOError("pos_ > file_->Size()"); } - const size_t available = file_->Size() - pos_; + const uint64_t available = file_->Size() - pos_; if (n > available) { n = available; } @@ -177,7 +178,7 @@ class SequentialFileImpl : public SequentialFile { private: FileState* file_; - size_t pos_; + uint64_t pos_; }; class RandomAccessFileImpl : public RandomAccessFile { diff --git a/include/leveldb/cache.h b/include/leveldb/cache.h index 5e3b47637d..1a201e5e0a 100644 --- a/include/leveldb/cache.h +++ b/include/leveldb/cache.h @@ -96,4 +96,4 @@ class Cache { } // namespace leveldb -#endif // STORAGE_LEVELDB_UTIL_CACHE_H_ +#endif // STORAGE_LEVELDB_INCLUDE_CACHE_H_ diff --git a/include/leveldb/db.h b/include/leveldb/db.h index 40851b2aa8..4c169bf22e 100644 --- a/include/leveldb/db.h +++ b/include/leveldb/db.h @@ -14,7 +14,7 @@ namespace leveldb { // Update Makefile if you change these static const int kMajorVersion = 1; -static const int kMinorVersion = 17; +static const int kMinorVersion = 18; struct Options; struct ReadOptions; diff --git a/include/leveldb/dumpfile.h b/include/leveldb/dumpfile.h new file mode 100644 index 0000000000..3f97fda16b --- /dev/null +++ b/include/leveldb/dumpfile.h @@ -0,0 +1,25 @@ +// Copyright (c) 2014 The LevelDB Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. See the AUTHORS file for names of contributors. + +#ifndef STORAGE_LEVELDB_INCLUDE_DUMPFILE_H_ +#define STORAGE_LEVELDB_INCLUDE_DUMPFILE_H_ + +#include +#include "leveldb/env.h" +#include "leveldb/status.h" + +namespace leveldb { + +// Dump the contents of the file named by fname in text format to +// *dst. Makes a sequence of dst->Append() calls; each call is passed +// the newline-terminated text corresponding to a single item found +// in the file. +// +// Returns a non-OK result if fname does not name a leveldb storage +// file, or if the file cannot be read. +Status DumpFile(Env* env, const std::string& fname, WritableFile* dst); + +} // namespace leveldb + +#endif // STORAGE_LEVELDB_INCLUDE_DUMPFILE_H_ diff --git a/include/leveldb/env.h b/include/leveldb/env.h index b2072d02c1..f709514da6 100644 --- a/include/leveldb/env.h +++ b/include/leveldb/env.h @@ -142,7 +142,7 @@ class Env { // useful for computing deltas of time. virtual uint64_t NowMicros() = 0; - // Sleep/delay the thread for the perscribed number of micro-seconds. + // Sleep/delay the thread for the prescribed number of micro-seconds. virtual void SleepForMicroseconds(int micros) = 0; private: diff --git a/include/leveldb/iterator.h b/include/leveldb/iterator.h index ad543eb46c..76aced04bd 100644 --- a/include/leveldb/iterator.h +++ b/include/leveldb/iterator.h @@ -61,7 +61,7 @@ class Iterator { // Return the value for the current entry. The underlying storage for // the returned slice is valid only until the next modification of // the iterator. - // REQUIRES: !AtEnd() && !AtStart() + // REQUIRES: Valid() virtual Slice value() const = 0; // If an error has occurred, return it. Else return an ok status. diff --git a/include/leveldb/options.h b/include/leveldb/options.h index fdda718d30..7c9b973454 100644 --- a/include/leveldb/options.h +++ b/include/leveldb/options.h @@ -153,7 +153,7 @@ struct ReadOptions { // If "snapshot" is non-NULL, read as of the supplied snapshot // (which must belong to the DB that is being read and which must - // not have been released). If "snapshot" is NULL, use an impliicit + // not have been released). If "snapshot" is NULL, use an implicit // snapshot of the state at the beginning of this read operation. // Default: NULL const Snapshot* snapshot; diff --git a/port/atomic_pointer.h b/port/atomic_pointer.h index a9866b2302..9bf091f757 100644 --- a/port/atomic_pointer.h +++ b/port/atomic_pointer.h @@ -5,14 +5,13 @@ // AtomicPointer provides storage for a lock-free pointer. // Platform-dependent implementation of AtomicPointer: // - If the platform provides a cheap barrier, we use it with raw pointers -// - If cstdatomic is present (on newer versions of gcc, it is), we use -// a cstdatomic-based AtomicPointer. However we prefer the memory +// - If is present (on newer versions of gcc, it is), we use +// a -based AtomicPointer. However we prefer the memory // barrier based version, because at least on a gcc 4.4 32-bit build -// on linux, we have encountered a buggy -// implementation. Also, some implementations are much -// slower than a memory-barrier based implementation (~16ns for -// based acquire-load vs. ~1ns for a barrier based -// acquire-load). +// on linux, we have encountered a buggy implementation. +// Also, some implementations are much slower than a memory-barrier +// based implementation (~16ns for based acquire-load vs. ~1ns for +// a barrier based acquire-load). // This code is based on atomicops-internals-* in Google's perftools: // http://code.google.com/p/google-perftools/source/browse/#svn%2Ftrunk%2Fsrc%2Fbase @@ -20,8 +19,8 @@ #define PORT_ATOMIC_POINTER_H_ #include -#ifdef LEVELDB_CSTDATOMIC_PRESENT -#include +#ifdef LEVELDB_ATOMIC_PRESENT +#include #endif #ifdef OS_WIN #include @@ -126,7 +125,7 @@ class AtomicPointer { }; // AtomicPointer based on -#elif defined(LEVELDB_CSTDATOMIC_PRESENT) +#elif defined(LEVELDB_ATOMIC_PRESENT) class AtomicPointer { private: std::atomic rep_; @@ -207,7 +206,7 @@ class AtomicPointer { inline void NoBarrier_Store(void* v) { rep_ = v; } }; -// We have neither MemoryBarrier(), nor +// We have neither MemoryBarrier(), nor #else #error Please implement AtomicPointer for this platform. diff --git a/port/port_posix.h b/port/port_posix.h index 21c845e211..ccca9939d3 100644 --- a/port/port_posix.h +++ b/port/port_posix.h @@ -21,14 +21,11 @@ #else #define PLATFORM_IS_LITTLE_ENDIAN false #endif -#elif defined(OS_FREEBSD) +#elif defined(OS_FREEBSD) || defined(OS_OPENBSD) ||\ + defined(OS_NETBSD) || defined(OS_DRAGONFLYBSD) #include #include #define PLATFORM_IS_LITTLE_ENDIAN (_BYTE_ORDER == _LITTLE_ENDIAN) -#elif defined(OS_OPENBSD) || defined(OS_NETBSD) ||\ - defined(OS_DRAGONFLYBSD) - #include - #include #elif defined(OS_HPUX) #define PLATFORM_IS_LITTLE_ENDIAN false #elif defined(OS_ANDROID) @@ -55,7 +52,7 @@ #if defined(OS_MACOSX) || defined(OS_SOLARIS) || defined(OS_FREEBSD) ||\ defined(OS_NETBSD) || defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD) ||\ - defined(OS_ANDROID) || defined(OS_HPUX) + defined(OS_ANDROID) || defined(OS_HPUX) || defined(CYGWIN) // Use fread/fwrite/fflush on platforms without _unlocked variants #define fread_unlocked fread #define fwrite_unlocked fwrite diff --git a/port/thread_annotations.h b/port/thread_annotations.h index 6f9b6a7924..9470ef587c 100644 --- a/port/thread_annotations.h +++ b/port/thread_annotations.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#ifndef STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H +#ifndef STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H_ +#define STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H_ // Some environments provide custom macros to aid in static thread-safety // analysis. Provide empty definitions of such macros unless they are already @@ -56,4 +57,4 @@ #define NO_THREAD_SAFETY_ANALYSIS #endif -#endif // STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H +#endif // STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H_ diff --git a/table/block.cc b/table/block.cc index 79ea9d9ee5..43e402c9c0 100644 --- a/table/block.cc +++ b/table/block.cc @@ -46,7 +46,7 @@ Block::~Block() { // Helper routine: decode the next block entry starting at "p", // storing the number of shared key bytes, non_shared key bytes, // and the length of the value in "*shared", "*non_shared", and -// "*value_length", respectively. Will not derefence past "limit". +// "*value_length", respectively. Will not dereference past "limit". // // If any errors are detected, returns NULL. Otherwise, returns a // pointer to the key delta (just past the three decoded values). diff --git a/table/block_builder.h b/table/block_builder.h index 5b545bd1af..4fbcb33972 100644 --- a/table/block_builder.h +++ b/table/block_builder.h @@ -21,7 +21,7 @@ class BlockBuilder { // Reset the contents as if the BlockBuilder was just constructed. void Reset(); - // REQUIRES: Finish() has not been callled since the last call to Reset(). + // REQUIRES: Finish() has not been called since the last call to Reset(). // REQUIRES: key is larger than any previously added key void Add(const Slice& key, const Slice& value); diff --git a/table/format.cc b/table/format.cc index cda1decdf3..aa63144c9e 100644 --- a/table/format.cc +++ b/table/format.cc @@ -48,7 +48,7 @@ Status Footer::DecodeFrom(Slice* input) { const uint64_t magic = ((static_cast(magic_hi) << 32) | (static_cast(magic_lo))); if (magic != kTableMagicNumber) { - return Status::InvalidArgument("not an sstable (bad magic number)"); + return Status::Corruption("not an sstable (bad magic number)"); } Status result = metaindex_handle_.DecodeFrom(input); diff --git a/table/table.cc b/table/table.cc index 71c1756e5f..dff8a82590 100644 --- a/table/table.cc +++ b/table/table.cc @@ -41,7 +41,7 @@ Status Table::Open(const Options& options, Table** table) { *table = NULL; if (size < Footer::kEncodedLength) { - return Status::InvalidArgument("file is too short to be an sstable"); + return Status::Corruption("file is too short to be an sstable"); } char footer_space[Footer::kEncodedLength]; @@ -58,7 +58,11 @@ Status Table::Open(const Options& options, BlockContents contents; Block* index_block = NULL; if (s.ok()) { - s = ReadBlock(file, ReadOptions(), footer.index_handle(), &contents); + ReadOptions opt; + if (options.paranoid_checks) { + opt.verify_checksums = true; + } + s = ReadBlock(file, opt, footer.index_handle(), &contents); if (s.ok()) { index_block = new Block(contents); } @@ -92,6 +96,9 @@ void Table::ReadMeta(const Footer& footer) { // TODO(sanjay): Skip this if footer.metaindex_handle() size indicates // it is an empty block. ReadOptions opt; + if (rep_->options.paranoid_checks) { + opt.verify_checksums = true; + } BlockContents contents; if (!ReadBlock(rep_->file, opt, footer.metaindex_handle(), &contents).ok()) { // Do not propagate errors since meta info is not needed for operation @@ -120,6 +127,9 @@ void Table::ReadFilter(const Slice& filter_handle_value) { // We might want to unify with ReadBlock() if we start // requiring checksum verification in Table::Open. ReadOptions opt; + if (rep_->options.paranoid_checks) { + opt.verify_checksums = true; + } BlockContents block; if (!ReadBlock(rep_->file, opt, filter_handle, &block).ok()) { return; diff --git a/util/bloom.cc b/util/bloom.cc index d7941cd21f..a27a2ace28 100644 --- a/util/bloom.cc +++ b/util/bloom.cc @@ -29,7 +29,7 @@ class BloomFilterPolicy : public FilterPolicy { } virtual const char* Name() const { - return "leveldb.BuiltinBloomFilter"; + return "leveldb.BuiltinBloomFilter2"; } virtual void CreateFilter(const Slice* keys, int n, std::string* dst) const { diff --git a/util/env_posix.cc b/util/env_posix.cc index 93eadb1a4f..ba2667864a 100644 --- a/util/env_posix.cc +++ b/util/env_posix.cc @@ -3,8 +3,6 @@ // found in the LICENSE file. See the AUTHORS file for names of contributors. #if !defined(LEVELDB_PLATFORM_WINDOWS) -#include -#include #include #include #include @@ -18,9 +16,8 @@ #include #include #include -#if defined(LEVELDB_PLATFORM_ANDROID) -#include -#endif +#include +#include #include "leveldb/env.h" #include "leveldb/slice.h" #include "port/port.h" @@ -296,7 +293,8 @@ class PosixEnv : public Env { public: PosixEnv(); virtual ~PosixEnv() { - fprintf(stderr, "Destroying Env::Default()\n"); + char msg[] = "Destroying Env::Default()\n"; + fwrite(msg, 1, sizeof(msg), stderr); abort(); } diff --git a/util/hash.cc b/util/hash.cc index 07cf022060..ed439ce7a2 100644 --- a/util/hash.cc +++ b/util/hash.cc @@ -34,13 +34,13 @@ uint32_t Hash(const char* data, size_t n, uint32_t seed) { // Pick up remaining bytes switch (limit - data) { case 3: - h += data[2] << 16; + h += static_cast(data[2]) << 16; FALLTHROUGH_INTENDED; case 2: - h += data[1] << 8; + h += static_cast(data[1]) << 8; FALLTHROUGH_INTENDED; case 1: - h += data[0]; + h += static_cast(data[0]); h *= m; h ^= (h >> r); break; diff --git a/util/hash_test.cc b/util/hash_test.cc new file mode 100644 index 0000000000..eaa1c92c23 --- /dev/null +++ b/util/hash_test.cc @@ -0,0 +1,54 @@ +// Copyright (c) 2011 The LevelDB Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. See the AUTHORS file for names of contributors. + +#include "util/hash.h" +#include "util/testharness.h" + +namespace leveldb { + +class HASH { }; + +TEST(HASH, SignedUnsignedIssue) { + const unsigned char data1[1] = {0x62}; + const unsigned char data2[2] = {0xc3, 0x97}; + const unsigned char data3[3] = {0xe2, 0x99, 0xa5}; + const unsigned char data4[4] = {0xe1, 0x80, 0xb9, 0x32}; + const unsigned char data5[48] = { + 0x01, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x14, + 0x00, 0x00, 0x00, 0x18, + 0x28, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + }; + + ASSERT_EQ(Hash(0, 0, 0xbc9f1d34), 0xbc9f1d34); + ASSERT_EQ( + Hash(reinterpret_cast(data1), sizeof(data1), 0xbc9f1d34), + 0xef1345c4); + ASSERT_EQ( + Hash(reinterpret_cast(data2), sizeof(data2), 0xbc9f1d34), + 0x5b663814); + ASSERT_EQ( + Hash(reinterpret_cast(data3), sizeof(data3), 0xbc9f1d34), + 0x323c078f); + ASSERT_EQ( + Hash(reinterpret_cast(data4), sizeof(data4), 0xbc9f1d34), + 0xed21633a); + ASSERT_EQ( + Hash(reinterpret_cast(data5), sizeof(data5), 0x12345678), + 0xf333dabb); +} + +} // namespace leveldb + +int main(int argc, char** argv) { + return leveldb::test::RunAllTests(); +} diff --git a/util/logging.cc b/util/logging.cc index 22cf278512..ca6b324403 100644 --- a/util/logging.cc +++ b/util/logging.cc @@ -45,15 +45,6 @@ std::string EscapeString(const Slice& value) { return r; } -bool ConsumeChar(Slice* in, char c) { - if (!in->empty() && (*in)[0] == c) { - in->remove_prefix(1); - return true; - } else { - return false; - } -} - bool ConsumeDecimalNumber(Slice* in, uint64_t* val) { uint64_t v = 0; int digits = 0; diff --git a/util/logging.h b/util/logging.h index b0c5da813e..1b450d2480 100644 --- a/util/logging.h +++ b/util/logging.h @@ -32,10 +32,6 @@ extern std::string NumberToString(uint64_t num); // Escapes any non-printable characters found in "value". extern std::string EscapeString(const Slice& value); -// If *in starts with "c", advances *in past the first character and -// returns true. Otherwise, returns false. -extern bool ConsumeChar(Slice* in, char c); - // Parse a human-readable number from "*in" into *value. On success, // advances "*in" past the consumed number and sets "*val" to the // numeric value. Otherwise, returns false and leaves *in in an From ca3ce0fa037a94f2c357ad04d42e5f526cbcb78e Mon Sep 17 00:00:00 2001 From: jtimon Date: Thu, 16 Oct 2014 22:49:33 +0200 Subject: [PATCH 0880/1288] squashme on 3fdb9e8c (Bluematt's bikeshedding) --- src/chainparams.cpp | 2 +- src/chainparamsbase.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index ec05f592b9..3177266069 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -240,7 +240,7 @@ void SelectParams(CBaseChainParams::Network network) { pCurrentParams = &Params(network); } -bool SelectParamsFromCommandLine() +bool SelectParamsFromCommandLine() { CBaseChainParams::Network network = NetworkIdFromCommandLine(); if (network == CBaseChainParams::MAX_NETWORK_TYPES) diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index f275bd544f..a602d8e30e 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -97,7 +97,7 @@ CBaseChainParams::Network NetworkIdFromCommandLine() return CBaseChainParams::MAIN; } -bool SelectBaseParamsFromCommandLine() +bool SelectBaseParamsFromCommandLine() { CBaseChainParams::Network network = NetworkIdFromCommandLine(); if (network == CBaseChainParams::MAX_NETWORK_TYPES) From e8ea0fd19e16abdcc95a0cdd8f9ae1d348a53168 Mon Sep 17 00:00:00 2001 From: jtimon Date: Fri, 17 Oct 2014 01:58:43 +0200 Subject: [PATCH 0881/1288] MOVEONLY: CInPoint from core to txmempool --- src/core.h | 13 ------------- src/txmempool.h | 13 +++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/core.h b/src/core.h index a348293578..a024dad740 100644 --- a/src/core.h +++ b/src/core.h @@ -61,19 +61,6 @@ public: std::string ToString() const; }; -/** An inpoint - a combination of a transaction and an index n into its vin */ -class CInPoint -{ -public: - const CTransaction* ptx; - uint32_t n; - - CInPoint() { SetNull(); } - CInPoint(const CTransaction* ptxIn, uint32_t nIn) { ptx = ptxIn; n = nIn; } - void SetNull() { ptx = NULL; n = (uint32_t) -1; } - bool IsNull() const { return (ptx == NULL && n == (uint32_t) -1); } -}; - /** An input of a transaction. It contains the location of the previous * transaction's output that it claims and a signature that matches the * output's public key. diff --git a/src/txmempool.h b/src/txmempool.h index c63fd6f590..ad190eea9d 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -52,6 +52,19 @@ public: class CMinerPolicyEstimator; +/** An inpoint - a combination of a transaction and an index n into its vin */ +class CInPoint +{ +public: + const CTransaction* ptx; + uint32_t n; + + CInPoint() { SetNull(); } + CInPoint(const CTransaction* ptxIn, uint32_t nIn) { ptx = ptxIn; n = nIn; } + void SetNull() { ptx = NULL; n = (uint32_t) -1; } + bool IsNull() const { return (ptx == NULL && n == (uint32_t) -1); } +}; + /* * CTxMemPool stores valid-according-to-the-current-best-chain * transactions that may be included in the next block. From d4746d56c0c45b8721da36bc19b2bdaba5d7d094 Mon Sep 17 00:00:00 2001 From: Mark Friedenbach Date: Thu, 16 Oct 2014 16:16:29 -0700 Subject: [PATCH 0882/1288] Add a SECURE style flag for ThreadSafeMessageBox, which indicates that the message contains sensitive information. This keeps the message from being output to the debug log by bitcoind. Fixes a possible security risk when starting bitcoind in server mode without the 'rpcpassword' option configured, resulting in the "suggested" password being output to the debug log. --- src/noui.cpp | 6 +++++- src/qt/bitcoingui.cpp | 3 +++ src/rpcserver.cpp | 2 +- src/ui_interface.h | 3 +++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/noui.cpp b/src/noui.cpp index f786a20db5..8f3b0275b0 100644 --- a/src/noui.cpp +++ b/src/noui.cpp @@ -14,6 +14,9 @@ static bool noui_ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style) { + bool fSecure = style & CClientUIInterface::SECURE; + style &= ~CClientUIInterface::SECURE; + std::string strCaption; // Check for usage of predefined caption switch (style) { @@ -30,7 +33,8 @@ static bool noui_ThreadSafeMessageBox(const std::string& message, const std::str strCaption += caption; // Use supplied caption (can be empty) } - LogPrintf("%s: %s\n", strCaption, message); + if (!fSecure) + LogPrintf("%s: %s\n", strCaption, message); fprintf(stderr, "%s: %s\n", strCaption.c_str(), message.c_str()); return false; } diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 8a945606dc..9d6d07a56b 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -992,6 +992,9 @@ void BitcoinGUI::showProgress(const QString &title, int nProgress) static bool ThreadSafeMessageBox(BitcoinGUI *gui, const std::string& message, const std::string& caption, unsigned int style) { bool modal = (style & CClientUIInterface::MODAL); + // The SECURE flag has no effect in the Qt GUI. + // bool secure = (style & CClientUIInterface::SECURE); + style &= ~CClientUIInterface::SECURE; bool ret = false; // In case of modal message, use blocking connection to wait for user to click a button QMetaObject::invokeMethod(gui, "message", diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 1a41344da5..9668c78831 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -581,7 +581,7 @@ void StartRPCThreads() strWhatAmI, GetConfigFile().string(), EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32)), - "", CClientUIInterface::MSG_ERROR); + "", CClientUIInterface::MSG_ERROR | CClientUIInterface::SECURE); StartShutdown(); return; } diff --git a/src/ui_interface.h b/src/ui_interface.h index f5224ba57d..1231d5ed0b 100644 --- a/src/ui_interface.h +++ b/src/ui_interface.h @@ -63,6 +63,9 @@ public: /** Force blocking, modal message box dialog (not just OS notification) */ MODAL = 0x10000000U, + /** Do not print contents of message to debug log */ + SECURE = 0x40000000U, + /** Predefined combinations for certain default usage cases */ MSG_INFORMATION = ICON_INFORMATION, MSG_WARNING = (ICON_WARNING | BTN_OK | MODAL), From 8e9a665f5518637b618d8b1f74d440ac07b482cf Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 17 Oct 2014 11:12:34 +0200 Subject: [PATCH 0883/1288] doc: Add historical release notes for 0.9.3 --- doc/release-notes/release-notes-0.9.3.md | 101 +++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 doc/release-notes/release-notes-0.9.3.md diff --git a/doc/release-notes/release-notes-0.9.3.md b/doc/release-notes/release-notes-0.9.3.md new file mode 100644 index 0000000000..0765a360b2 --- /dev/null +++ b/doc/release-notes/release-notes-0.9.3.md @@ -0,0 +1,101 @@ +Bitcoin Core version 0.9.3 is now available from: + + https://bitcoin.org/bin/0.9.3/ + +This is a new minor version release, bringing only bug fixes and updated +translations. Upgrading to this release is recommended. + +Please report bugs using the issue tracker at github: + + https://github.com/bitcoin/bitcoin/issues + +Upgrading and downgrading +========================== + +How to Upgrade +-------------- + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes for older versions), then run the +installer (on Windows) or just copy over /Applications/Bitcoin-Qt (on Mac) or +bitcoind/bitcoin-qt (on Linux). + +If you are upgrading from version 0.7.2 or earlier, the first time you run +0.9.3 your blockchain files will be re-indexed, which will take anywhere from +30 minutes to several hours, depending on the speed of your machine. + +Downgrading warnings +-------------------- + +The 'chainstate' for this release is not always compatible with previous +releases, so if you run 0.9.x and then decide to switch back to a +0.8.x release you might get a blockchain validation error when starting the +old release (due to 'pruned outputs' being omitted from the index of +unspent transaction outputs). + +Running the old release with the -reindex option will rebuild the chainstate +data structures and correct the problem. + +Also, the first time you run a 0.8.x release on a 0.9 wallet it will rescan +the blockchain for missing spent coins, which will take a long time (tens +of minutes on a typical machine). + +0.9.3 Release notes +======================= + +RPC: +- Avoid a segfault on getblock if it can't read a block from disk +- Add paranoid return value checks in base58 + +Protocol and network code: +- Don't poll showmyip.com, it doesn't exist anymore +- Add a way to limit deserialized string lengths and use it +- Add a new checkpoint at block 295,000 +- Increase IsStandard() scriptSig length +- Avoid querying DNS seeds, if we have open connections +- Remove a useless millisleep in socket handler +- Stricter memory limits on CNode +- Better orphan transaction handling +- Add `-maxorphantx=` and `-maxorphanblocks=` options for control over the maximum orphan transactions and blocks + +Wallet: +- Check redeemScript size does not exceed 520 byte limit +- Ignore (and warn about) too-long redeemScripts while loading wallet + +GUI: +- fix 'opens in testnet mode when presented with a BIP-72 link with no fallback' +- AvailableCoins: acquire cs_main mutex +- Fix unicode character display on MacOSX + +Miscellaneous: +- key.cpp: fail with a friendlier message on missing ssl EC support +- Remove bignum dependency for scripts +- Upgrade OpenSSL to 1.0.1i (see https://www.openssl.org/news/secadv_20140806.txt - just to be sure, no critical issues for Bitcoin Core) +- Upgrade miniupnpc to 1.9.20140701 +- Fix boost detection in build system on some platforms + +Credits +-------- + +Thanks to everyone who contributed to this release: + +- Andrew Poelstra +- Cory Fields +- Gavin Andresen +- Jeff Garzik +- Johnathan Corgan +- Julian Haight +- Michael Ford +- Pavel Vasin +- Peter Todd +- phantomcircuit +- Pieter Wuille +- Rose Toomey +- Ruben Dario Ponticelli +- shshshsh +- Trevin Hofmann +- Warren Togami +- Wladimir J. van der Laan +- Zak Wilcox + +As well as everyone that helped translating on [Transifex](https://www.transifex.com/projects/p/bitcoin/). From 1d66bbcbfc6a792ff9827e706024f03b37200afc Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Fri, 17 Oct 2014 20:48:43 +0800 Subject: [PATCH 0884/1288] Add buildenv.py to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7d00051f23..9f1b2a4695 100644 --- a/.gitignore +++ b/.gitignore @@ -75,6 +75,7 @@ Bitcoin-Qt.app # Unit-tests Makefile.test bitcoin-qt_test +src/test/buildenv.py # Resources cpp qrc_*.cpp From 066e2a1403fe306787a2ce0c8571aa9de57386cf Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 24 Sep 2014 22:24:46 -0400 Subject: [PATCH 0885/1288] script: move CScriptID to standard.h and add a ctor for creating them from CScripts This allows for a reversal of the current behavior. This: CScript foo; CScriptID bar(foo.GetID()); Becomes: CScript foo; CScriptID bar(foo); This way, CScript is no longer dependent on CScriptID or Hash(); --- src/crypter.cpp | 1 + src/key.h | 8 -------- src/keystore.cpp | 3 ++- src/keystore.h | 1 + src/rpcmisc.cpp | 2 +- src/rpcrawtransaction.cpp | 2 +- src/rpcwallet.cpp | 2 +- src/script/compressor.cpp | 1 + src/script/compressor.h | 2 ++ src/script/script.h | 6 ------ src/script/standard.cpp | 2 ++ src/script/standard.h | 9 +++++++++ src/test/miner_tests.cpp | 2 +- src/test/script_P2SH_tests.cpp | 20 ++++++++++---------- src/test/script_tests.cpp | 4 ++-- src/test/sigopcount_tests.cpp | 4 ++-- src/wallet.cpp | 2 +- 17 files changed, 37 insertions(+), 34 deletions(-) diff --git a/src/crypter.cpp b/src/crypter.cpp index a872df7024..756538836d 100644 --- a/src/crypter.cpp +++ b/src/crypter.cpp @@ -5,6 +5,7 @@ #include "crypter.h" #include "script/script.h" +#include "script/standard.h" #include "util.h" #include diff --git a/src/key.h b/src/key.h index f6f6d35d34..48b1652536 100644 --- a/src/key.h +++ b/src/key.h @@ -30,14 +30,6 @@ public: CKeyID(const uint160& in) : uint160(in) {} }; -/** A reference to a CScript: the Hash160 of its serialization (see script.h) */ -class CScriptID : public uint160 -{ -public: - CScriptID() : uint160(0) {} - CScriptID(const uint160& in) : uint160(in) {} -}; - /** An encapsulated public key. */ class CPubKey { diff --git a/src/keystore.cpp b/src/keystore.cpp index 755defa26d..039c690625 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -8,6 +8,7 @@ #include "crypter.h" #include "key.h" #include "script/script.h" +#include "script/standard.h" #include "util.h" #include @@ -38,7 +39,7 @@ bool CBasicKeyStore::AddCScript(const CScript& redeemScript) return error("CBasicKeyStore::AddCScript() : redeemScripts > %i bytes are invalid", MAX_SCRIPT_ELEMENT_SIZE); LOCK(cs_KeyStore); - mapScripts[redeemScript.GetID()] = redeemScript; + mapScripts[CScriptID(redeemScript)] = redeemScript; return true; } diff --git a/src/keystore.h b/src/keystore.h index d3478f7672..4f8189c8f5 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -13,6 +13,7 @@ #include class CScript; +class CScriptID; /** A virtual base class for key stores */ class CKeyStore diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 8be14b567c..92ed1c3e2b 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -292,7 +292,7 @@ Value createmultisig(const Array& params, bool fHelp) // Construct using pay-to-script-hash: CScript inner = _createmultisig_redeemScript(params); - CScriptID innerID = inner.GetID(); + CScriptID innerID(inner); CBitcoinAddress address(innerID); Object result; diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 78372da685..fdfcb59eeb 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -480,7 +480,7 @@ Value decodescript(const Array& params, bool fHelp) } ScriptPubKeyToJSON(script, r, false); - r.push_back(Pair("p2sh", CBitcoinAddress(script.GetID()).ToString())); + r.push_back(Pair("p2sh", CBitcoinAddress(CScriptID(script)).ToString())); return r; } diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index d11455e389..68bb4068b8 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -918,7 +918,7 @@ Value addmultisigaddress(const Array& params, bool fHelp) // Construct using pay-to-script-hash: CScript inner = _createmultisig_redeemScript(params); - CScriptID innerID = inner.GetID(); + CScriptID innerID(inner); pwalletMain->AddCScript(inner); pwalletMain->SetAddressBook(innerID, strAccount, "send"); diff --git a/src/script/compressor.cpp b/src/script/compressor.cpp index 51a3cf6025..dbb4df8b7c 100644 --- a/src/script/compressor.cpp +++ b/src/script/compressor.cpp @@ -4,6 +4,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "compressor.h" +#include "script/standard.h" bool CScriptCompressor::IsToKeyID(CKeyID &hash) const { diff --git a/src/script/compressor.h b/src/script/compressor.h index 53c6bf3ecc..f48ecf5001 100644 --- a/src/script/compressor.h +++ b/src/script/compressor.h @@ -8,6 +8,8 @@ #include "script/script.h" +class CScriptID; + /** Compact serializer for scripts. * * It detects common cases and encodes them much more efficiently. diff --git a/src/script/script.h b/src/script/script.h index caf176476f..4d685f5596 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -610,12 +610,6 @@ public: } return str; } - - CScriptID GetID() const - { - return CScriptID(Hash160(*this)); - } - void clear() { // The default std::vector::clear() does not release memory. diff --git a/src/script/standard.cpp b/src/script/standard.cpp index 53ae254d59..adbec01f2e 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -14,6 +14,8 @@ using namespace std; typedef vector valtype; +CScriptID::CScriptID(const CScript& in) : uint160(in.size() ? Hash160(in.begin(), in.end()) : 0) {} + const char* GetTxnOutputType(txnouttype t) { switch (t) diff --git a/src/script/standard.h b/src/script/standard.h index ead79b82a2..38d0b59885 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -13,6 +13,15 @@ class CScript; +/** A reference to a CScript: the Hash160 of its serialization (see script.h) */ +class CScriptID : public uint160 +{ +public: + CScriptID() : uint160(0) {} + CScriptID(const CScript& in); + CScriptID(const uint160& in) : uint160(in) {} +}; + static const unsigned int MAX_OP_RETURN_RELAY = 40; // bytes // Mandatory script verification flags that all new blocks must comply with for diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index bad5c13ac2..93b7fe189a 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -170,7 +170,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) tx.vin[0].scriptSig = CScript() << OP_1; tx.vout[0].nValue = 4900000000LL; script = CScript() << OP_0; - tx.vout[0].scriptPubKey = GetScriptForDestination(script.GetID()); + tx.vout[0].scriptPubKey = GetScriptForDestination(CScriptID(script)); hash = tx.GetHash(); mempool.addUnchecked(hash, CTxMemPoolEntry(tx, 11, GetTime(), 111.0, 11)); tx.vin[0].prevout.hash = hash; diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index f8361a0dc8..a23792a4f3 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -75,7 +75,7 @@ BOOST_AUTO_TEST_CASE(sign) for (int i = 0; i < 4; i++) { keystore.AddCScript(standardScripts[i]); - evalScripts[i] = GetScriptForDestination(standardScripts[i].GetID()); + evalScripts[i] = GetScriptForDestination(CScriptID(standardScripts[i])); } CMutableTransaction txFrom; // Funding transaction: @@ -129,7 +129,7 @@ BOOST_AUTO_TEST_CASE(norecurse) CScript invalidAsScript; invalidAsScript << OP_INVALIDOPCODE << OP_INVALIDOPCODE; - CScript p2sh = GetScriptForDestination(invalidAsScript.GetID()); + CScript p2sh = GetScriptForDestination(CScriptID(invalidAsScript)); CScript scriptSig; scriptSig << Serialize(invalidAsScript); @@ -139,7 +139,7 @@ BOOST_AUTO_TEST_CASE(norecurse) // Try to recur, and verification should succeed because // the inner HASH160 <> EQUAL should only check the hash: - CScript p2sh2 = GetScriptForDestination(p2sh.GetID()); + CScript p2sh2 = GetScriptForDestination(CScriptID(p2sh)); CScript scriptSig2; scriptSig2 << Serialize(invalidAsScript) << Serialize(p2sh); @@ -169,7 +169,7 @@ BOOST_AUTO_TEST_CASE(set) CScript outer[4]; for (int i = 0; i < 4; i++) { - outer[i] = GetScriptForDestination(inner[i].GetID()); + outer[i] = GetScriptForDestination(CScriptID(inner[i])); keystore.AddCScript(inner[i]); } @@ -242,7 +242,7 @@ BOOST_AUTO_TEST_CASE(switchover) CScript scriptSig; scriptSig << Serialize(notValid); - CScript fund = GetScriptForDestination(notValid.GetID()); + CScript fund = GetScriptForDestination(CScriptID(notValid)); // Validation should succeed under old rules (hash is correct): @@ -275,7 +275,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) keystore.AddCScript(pay1); CScript pay1of3 = GetScriptForMultisig(1, keys); - txFrom.vout[0].scriptPubKey = GetScriptForDestination(pay1.GetID()); // P2SH (OP_CHECKSIG) + txFrom.vout[0].scriptPubKey = GetScriptForDestination(CScriptID(pay1)); // P2SH (OP_CHECKSIG) txFrom.vout[0].nValue = 1000; txFrom.vout[1].scriptPubKey = pay1; // ordinary OP_CHECKSIG txFrom.vout[1].nValue = 2000; @@ -290,7 +290,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) oneAndTwo << OP_2 << key[3].GetPubKey() << key[4].GetPubKey() << key[5].GetPubKey(); oneAndTwo << OP_3 << OP_CHECKMULTISIG; keystore.AddCScript(oneAndTwo); - txFrom.vout[3].scriptPubKey = GetScriptForDestination(oneAndTwo.GetID()); + txFrom.vout[3].scriptPubKey = GetScriptForDestination(CScriptID(oneAndTwo)); txFrom.vout[3].nValue = 4000; // vout[4] is max sigops: @@ -299,17 +299,17 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) fifteenSigops << key[i%3].GetPubKey(); fifteenSigops << OP_15 << OP_CHECKMULTISIG; keystore.AddCScript(fifteenSigops); - txFrom.vout[4].scriptPubKey = GetScriptForDestination(fifteenSigops.GetID()); + txFrom.vout[4].scriptPubKey = GetScriptForDestination(CScriptID(fifteenSigops)); txFrom.vout[4].nValue = 5000; // vout[5/6] are non-standard because they exceed MAX_P2SH_SIGOPS CScript sixteenSigops; sixteenSigops << OP_16 << OP_CHECKMULTISIG; keystore.AddCScript(sixteenSigops); - txFrom.vout[5].scriptPubKey = GetScriptForDestination(fifteenSigops.GetID()); + txFrom.vout[5].scriptPubKey = GetScriptForDestination(CScriptID(fifteenSigops)); txFrom.vout[5].nValue = 5000; CScript twentySigops; twentySigops << OP_CHECKMULTISIG; keystore.AddCScript(twentySigops); - txFrom.vout[6].scriptPubKey = GetScriptForDestination(twentySigops.GetID()); + txFrom.vout[6].scriptPubKey = GetScriptForDestination(CScriptID(twentySigops)); txFrom.vout[6].nValue = 6000; coins.ModifyCoins(txFrom.GetHash())->FromTx(txFrom, 0); diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index a4b0212494..cfb4fa6e7d 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -162,7 +162,7 @@ public: TestBuilder(const CScript& redeemScript, const std::string& comment_, int flags_, bool P2SH = false) : scriptPubKey(redeemScript), havePush(false), comment(comment_), flags(flags_) { if (P2SH) { - creditTx = BuildCreditingTransaction(CScript() << OP_HASH160 << redeemScript.GetID() << OP_EQUAL); + creditTx = BuildCreditingTransaction(CScript() << OP_HASH160 << CScriptID(redeemScript) << OP_EQUAL); } else { creditTx = BuildCreditingTransaction(redeemScript); } @@ -697,7 +697,7 @@ BOOST_AUTO_TEST_CASE(script_combineSigs) // P2SH, single-signature case: CScript pkSingle; pkSingle << keys[0].GetPubKey() << OP_CHECKSIG; keystore.AddCScript(pkSingle); - scriptPubKey = GetScriptForDestination(pkSingle.GetID()); + scriptPubKey = GetScriptForDestination(CScriptID(pkSingle)); SignSignature(keystore, txFrom, txTo, 0); combined = CombineSignatures(scriptPubKey, txTo, 0, scriptSig, empty); BOOST_CHECK(combined == scriptSig); diff --git a/src/test/sigopcount_tests.cpp b/src/test/sigopcount_tests.cpp index 62a6cd63d6..4ce2c87a0d 100644 --- a/src/test/sigopcount_tests.cpp +++ b/src/test/sigopcount_tests.cpp @@ -38,7 +38,7 @@ BOOST_AUTO_TEST_CASE(GetSigOpCount) BOOST_CHECK_EQUAL(s1.GetSigOpCount(true), 3U); BOOST_CHECK_EQUAL(s1.GetSigOpCount(false), 21U); - CScript p2sh = GetScriptForDestination(s1.GetID()); + CScript p2sh = GetScriptForDestination(CScriptID(s1)); CScript scriptSig; scriptSig << OP_0 << Serialize(s1); BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(scriptSig), 3U); @@ -54,7 +54,7 @@ BOOST_AUTO_TEST_CASE(GetSigOpCount) BOOST_CHECK_EQUAL(s2.GetSigOpCount(true), 3U); BOOST_CHECK_EQUAL(s2.GetSigOpCount(false), 20U); - p2sh = GetScriptForDestination(s2.GetID()); + p2sh = GetScriptForDestination(CScriptID(s2)); BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(true), 0U); BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(false), 0U); CScript scriptSig2; diff --git a/src/wallet.cpp b/src/wallet.cpp index 19e43f6ec2..65944587f8 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -158,7 +158,7 @@ bool CWallet::LoadCScript(const CScript& redeemScript) * these. Do not add them to the wallet and warn. */ if (redeemScript.size() > MAX_SCRIPT_ELEMENT_SIZE) { - std::string strAddr = CBitcoinAddress(redeemScript.GetID()).ToString(); + std::string strAddr = CBitcoinAddress(CScriptID(redeemScript)).ToString(); LogPrintf("%s: Warning: This wallet contains a redeemScript of size %i which exceeds maximum size %i thus can never be redeemed. Do not use address %s.\n", __func__, redeemScript.size(), MAX_SCRIPT_ELEMENT_SIZE, strAddr); return true; From e9ca4280f3abb8b2b6fa35a41e881996278ebfff Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 24 Sep 2014 22:54:08 -0400 Subject: [PATCH 0886/1288] script: add ToByteVector() for converting anything with begin/end This should move to a util header once their dependencies are cleaned up. --- src/miner.cpp | 2 +- src/script/script.h | 29 +++-------- src/script/sign.cpp | 2 +- src/script/standard.cpp | 6 +-- src/test/multisig_tests.cpp | 42 ++++++++-------- src/test/script_P2SH_tests.cpp | 20 ++++---- src/test/script_tests.cpp | 88 +++++++++++++++++----------------- src/test/sigopcount_tests.cpp | 6 +-- src/test/transaction_tests.cpp | 4 +- 9 files changed, 91 insertions(+), 108 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index c2762bf44e..6a2718e403 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -398,7 +398,7 @@ CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey) if (!reservekey.GetReservedKey(pubkey)) return NULL; - CScript scriptPubKey = CScript() << pubkey << OP_CHECKSIG; + CScript scriptPubKey = CScript() << ToByteVector(pubkey) << OP_CHECKSIG; return CreateNewBlock(scriptPubKey); } diff --git a/src/script/script.h b/src/script/script.h index 4d685f5596..6676e852ae 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -16,6 +16,12 @@ static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; // bytes +template +std::vector ToByteVector(const T& in) +{ + return std::vector(in.begin(), in.end()); +} + /** Script opcodes */ enum opcodetype { @@ -358,7 +364,6 @@ public: CScript(int64_t b) { operator<<(b); } explicit CScript(opcodetype b) { operator<<(b); } - explicit CScript(const uint256& b) { operator<<(b); } explicit CScript(const CScriptNum& b) { operator<<(b); } explicit CScript(const std::vector& b) { operator<<(b); } @@ -373,28 +378,6 @@ public: return *this; } - CScript& operator<<(const uint160& b) - { - insert(end(), sizeof(b)); - insert(end(), (unsigned char*)&b, (unsigned char*)&b + sizeof(b)); - return *this; - } - - CScript& operator<<(const uint256& b) - { - insert(end(), sizeof(b)); - insert(end(), (unsigned char*)&b, (unsigned char*)&b + sizeof(b)); - return *this; - } - - CScript& operator<<(const CPubKey& key) - { - assert(key.size() < OP_PUSHDATA1); - insert(end(), (unsigned char)key.size()); - insert(end(), key.begin(), key.end()); - return *this; - } - CScript& operator<<(const CScriptNum& b) { *this << b.getvch(); diff --git a/src/script/sign.cpp b/src/script/sign.cpp index da77e7d1f1..bf98c40394 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -78,7 +78,7 @@ bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash { CPubKey vch; keystore.GetPubKey(keyID, vch); - scriptSigRet << vch; + scriptSigRet << ToByteVector(vch); } return true; case TX_SCRIPTHASH: diff --git a/src/script/standard.cpp b/src/script/standard.cpp index adbec01f2e..7e6b136a28 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -282,13 +282,13 @@ public: bool operator()(const CKeyID &keyID) const { script->clear(); - *script << OP_DUP << OP_HASH160 << keyID << OP_EQUALVERIFY << OP_CHECKSIG; + *script << OP_DUP << OP_HASH160 << ToByteVector(keyID) << OP_EQUALVERIFY << OP_CHECKSIG; return true; } bool operator()(const CScriptID &scriptID) const { script->clear(); - *script << OP_HASH160 << scriptID << OP_EQUAL; + *script << OP_HASH160 << ToByteVector(scriptID) << OP_EQUAL; return true; } }; @@ -308,7 +308,7 @@ CScript GetScriptForMultisig(int nRequired, const std::vector& keys) script << CScript::EncodeOP_N(nRequired); BOOST_FOREACH(const CPubKey& key, keys) - script << key; + script << ToByteVector(key); script << CScript::EncodeOP_N(keys.size()) << OP_CHECKMULTISIG; return script; } diff --git a/src/test/multisig_tests.cpp b/src/test/multisig_tests.cpp index 5a2ec1cb31..e9fc86779a 100644 --- a/src/test/multisig_tests.cpp +++ b/src/test/multisig_tests.cpp @@ -51,13 +51,13 @@ BOOST_AUTO_TEST_CASE(multisig_verify) key[i].MakeNewKey(true); CScript a_and_b; - a_and_b << OP_2 << key[0].GetPubKey() << key[1].GetPubKey() << OP_2 << OP_CHECKMULTISIG; + a_and_b << OP_2 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_2 << OP_CHECKMULTISIG; CScript a_or_b; - a_or_b << OP_1 << key[0].GetPubKey() << key[1].GetPubKey() << OP_2 << OP_CHECKMULTISIG; + a_or_b << OP_1 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_2 << OP_CHECKMULTISIG; CScript escrow; - escrow << OP_2 << key[0].GetPubKey() << key[1].GetPubKey() << key[2].GetPubKey() << OP_3 << OP_CHECKMULTISIG; + escrow << OP_2 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << ToByteVector(key[2].GetPubKey()) << OP_3 << OP_CHECKMULTISIG; CMutableTransaction txFrom; // Funding transaction txFrom.vout.resize(3); @@ -138,28 +138,28 @@ BOOST_AUTO_TEST_CASE(multisig_IsStandard) txnouttype whichType; CScript a_and_b; - a_and_b << OP_2 << key[0].GetPubKey() << key[1].GetPubKey() << OP_2 << OP_CHECKMULTISIG; + a_and_b << OP_2 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_2 << OP_CHECKMULTISIG; BOOST_CHECK(::IsStandard(a_and_b, whichType)); CScript a_or_b; - a_or_b << OP_1 << key[0].GetPubKey() << key[1].GetPubKey() << OP_2 << OP_CHECKMULTISIG; + a_or_b << OP_1 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_2 << OP_CHECKMULTISIG; BOOST_CHECK(::IsStandard(a_or_b, whichType)); CScript escrow; - escrow << OP_2 << key[0].GetPubKey() << key[1].GetPubKey() << key[2].GetPubKey() << OP_3 << OP_CHECKMULTISIG; + escrow << OP_2 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << ToByteVector(key[2].GetPubKey()) << OP_3 << OP_CHECKMULTISIG; BOOST_CHECK(::IsStandard(escrow, whichType)); CScript one_of_four; - one_of_four << OP_1 << key[0].GetPubKey() << key[1].GetPubKey() << key[2].GetPubKey() << key[3].GetPubKey() << OP_4 << OP_CHECKMULTISIG; + one_of_four << OP_1 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << ToByteVector(key[2].GetPubKey()) << ToByteVector(key[3].GetPubKey()) << OP_4 << OP_CHECKMULTISIG; BOOST_CHECK(!::IsStandard(one_of_four, whichType)); CScript malformed[6]; - malformed[0] << OP_3 << key[0].GetPubKey() << key[1].GetPubKey() << OP_2 << OP_CHECKMULTISIG; - malformed[1] << OP_2 << key[0].GetPubKey() << key[1].GetPubKey() << OP_3 << OP_CHECKMULTISIG; - malformed[2] << OP_0 << key[0].GetPubKey() << key[1].GetPubKey() << OP_2 << OP_CHECKMULTISIG; - malformed[3] << OP_1 << key[0].GetPubKey() << key[1].GetPubKey() << OP_0 << OP_CHECKMULTISIG; - malformed[4] << OP_1 << key[0].GetPubKey() << key[1].GetPubKey() << OP_CHECKMULTISIG; - malformed[5] << OP_1 << key[0].GetPubKey() << key[1].GetPubKey(); + malformed[0] << OP_3 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_2 << OP_CHECKMULTISIG; + malformed[1] << OP_2 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_3 << OP_CHECKMULTISIG; + malformed[2] << OP_0 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_2 << OP_CHECKMULTISIG; + malformed[3] << OP_1 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_0 << OP_CHECKMULTISIG; + malformed[4] << OP_1 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_CHECKMULTISIG; + malformed[5] << OP_1 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()); for (int i = 0; i < 6; i++) BOOST_CHECK(!::IsStandard(malformed[i], whichType)); @@ -192,7 +192,7 @@ BOOST_AUTO_TEST_CASE(multisig_Solver1) vector solutions; txnouttype whichType; CScript s; - s << key[0].GetPubKey() << OP_CHECKSIG; + s << ToByteVector(key[0].GetPubKey()) << OP_CHECKSIG; BOOST_CHECK(Solver(s, whichType, solutions)); BOOST_CHECK(solutions.size() == 1); CTxDestination addr; @@ -207,7 +207,7 @@ BOOST_AUTO_TEST_CASE(multisig_Solver1) vector solutions; txnouttype whichType; CScript s; - s << OP_DUP << OP_HASH160 << key[0].GetPubKey().GetID() << OP_EQUALVERIFY << OP_CHECKSIG; + s << OP_DUP << OP_HASH160 << ToByteVector(key[0].GetPubKey().GetID()) << OP_EQUALVERIFY << OP_CHECKSIG; BOOST_CHECK(Solver(s, whichType, solutions)); BOOST_CHECK(solutions.size() == 1); CTxDestination addr; @@ -222,7 +222,7 @@ BOOST_AUTO_TEST_CASE(multisig_Solver1) vector solutions; txnouttype whichType; CScript s; - s << OP_2 << key[0].GetPubKey() << key[1].GetPubKey() << OP_2 << OP_CHECKMULTISIG; + s << OP_2 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_2 << OP_CHECKMULTISIG; BOOST_CHECK(Solver(s, whichType, solutions)); BOOST_CHECK_EQUAL(solutions.size(), 4U); CTxDestination addr; @@ -237,7 +237,7 @@ BOOST_AUTO_TEST_CASE(multisig_Solver1) vector solutions; txnouttype whichType; CScript s; - s << OP_1 << key[0].GetPubKey() << key[1].GetPubKey() << OP_2 << OP_CHECKMULTISIG; + s << OP_1 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_2 << OP_CHECKMULTISIG; BOOST_CHECK(Solver(s, whichType, solutions)); BOOST_CHECK_EQUAL(solutions.size(), 4U); vector addrs; @@ -256,7 +256,7 @@ BOOST_AUTO_TEST_CASE(multisig_Solver1) vector solutions; txnouttype whichType; CScript s; - s << OP_2 << key[0].GetPubKey() << key[1].GetPubKey() << key[2].GetPubKey() << OP_3 << OP_CHECKMULTISIG; + s << OP_2 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << ToByteVector(key[2].GetPubKey()) << OP_3 << OP_CHECKMULTISIG; BOOST_CHECK(Solver(s, whichType, solutions)); BOOST_CHECK(solutions.size() == 5); } @@ -274,13 +274,13 @@ BOOST_AUTO_TEST_CASE(multisig_Sign) } CScript a_and_b; - a_and_b << OP_2 << key[0].GetPubKey() << key[1].GetPubKey() << OP_2 << OP_CHECKMULTISIG; + a_and_b << OP_2 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_2 << OP_CHECKMULTISIG; CScript a_or_b; - a_or_b << OP_1 << key[0].GetPubKey() << key[1].GetPubKey() << OP_2 << OP_CHECKMULTISIG; + a_or_b << OP_1 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_2 << OP_CHECKMULTISIG; CScript escrow; - escrow << OP_2 << key[0].GetPubKey() << key[1].GetPubKey() << key[2].GetPubKey() << OP_3 << OP_CHECKMULTISIG; + escrow << OP_2 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << ToByteVector(key[2].GetPubKey()) << OP_3 << OP_CHECKMULTISIG; CMutableTransaction txFrom; // Funding transaction txFrom.vout.resize(3); diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index a23792a4f3..fcab652783 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -67,9 +67,9 @@ BOOST_AUTO_TEST_CASE(sign) // 8 Scripts: checking all combinations of // different keys, straight/P2SH, pubkey/pubkeyhash CScript standardScripts[4]; - standardScripts[0] << key[0].GetPubKey() << OP_CHECKSIG; + standardScripts[0] << ToByteVector(key[0].GetPubKey()) << OP_CHECKSIG; standardScripts[1] = GetScriptForDestination(key[1].GetPubKey().GetID()); - standardScripts[2] << key[1].GetPubKey() << OP_CHECKSIG; + standardScripts[2] << ToByteVector(key[1].GetPubKey()) << OP_CHECKSIG; standardScripts[3] = GetScriptForDestination(key[2].GetPubKey().GetID()); CScript evalScripts[4]; for (int i = 0; i < 4; i++) @@ -206,9 +206,9 @@ BOOST_AUTO_TEST_CASE(set) BOOST_AUTO_TEST_CASE(is) { // Test CScript::IsPayToScriptHash() - uint160 dummy; + uint160 dummy(0); CScript p2sh; - p2sh << OP_HASH160 << dummy << OP_EQUAL; + p2sh << OP_HASH160 << ToByteVector(dummy) << OP_EQUAL; BOOST_CHECK(p2sh.IsPayToScriptHash()); // Not considered pay-to-script-hash if using one of the OP_PUSHDATA opcodes: @@ -224,13 +224,13 @@ BOOST_AUTO_TEST_CASE(is) CScript not_p2sh; BOOST_CHECK(!not_p2sh.IsPayToScriptHash()); - not_p2sh.clear(); not_p2sh << OP_HASH160 << dummy << dummy << OP_EQUAL; + not_p2sh.clear(); not_p2sh << OP_HASH160 << ToByteVector(dummy) << ToByteVector(dummy) << OP_EQUAL; BOOST_CHECK(!not_p2sh.IsPayToScriptHash()); - not_p2sh.clear(); not_p2sh << OP_NOP << dummy << OP_EQUAL; + not_p2sh.clear(); not_p2sh << OP_NOP << ToByteVector(dummy) << OP_EQUAL; BOOST_CHECK(!not_p2sh.IsPayToScriptHash()); - not_p2sh.clear(); not_p2sh << OP_HASH160 << dummy << OP_CHECKSIG; + not_p2sh.clear(); not_p2sh << OP_HASH160 << ToByteVector(dummy) << OP_CHECKSIG; BOOST_CHECK(!not_p2sh.IsPayToScriptHash()); } @@ -285,9 +285,9 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) // vout[3] is complicated 1-of-3 AND 2-of-3 // ... that is OK if wrapped in P2SH: CScript oneAndTwo; - oneAndTwo << OP_1 << key[0].GetPubKey() << key[1].GetPubKey() << key[2].GetPubKey(); + oneAndTwo << OP_1 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << ToByteVector(key[2].GetPubKey()); oneAndTwo << OP_3 << OP_CHECKMULTISIGVERIFY; - oneAndTwo << OP_2 << key[3].GetPubKey() << key[4].GetPubKey() << key[5].GetPubKey(); + oneAndTwo << OP_2 << ToByteVector(key[3].GetPubKey()) << ToByteVector(key[4].GetPubKey()) << ToByteVector(key[5].GetPubKey()); oneAndTwo << OP_3 << OP_CHECKMULTISIG; keystore.AddCScript(oneAndTwo); txFrom.vout[3].scriptPubKey = GetScriptForDestination(CScriptID(oneAndTwo)); @@ -296,7 +296,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) // vout[4] is max sigops: CScript fifteenSigops; fifteenSigops << OP_1; for (unsigned i = 0; i < MAX_P2SH_SIGOPS; i++) - fifteenSigops << key[i%3].GetPubKey(); + fifteenSigops << ToByteVector(key[i%3].GetPubKey()); fifteenSigops << OP_15 << OP_CHECKMULTISIG; keystore.AddCScript(fifteenSigops); txFrom.vout[4].scriptPubKey = GetScriptForDestination(CScriptID(fifteenSigops)); diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index cfb4fa6e7d..d3fc673a79 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -162,7 +162,7 @@ public: TestBuilder(const CScript& redeemScript, const std::string& comment_, int flags_, bool P2SH = false) : scriptPubKey(redeemScript), havePush(false), comment(comment_), flags(flags_) { if (P2SH) { - creditTx = BuildCreditingTransaction(CScript() << OP_HASH160 << CScriptID(redeemScript) << OP_EQUAL); + creditTx = BuildCreditingTransaction(CScript() << OP_HASH160 << ToByteVector(CScriptID(redeemScript)) << OP_EQUAL); } else { creditTx = BuildCreditingTransaction(redeemScript); } @@ -270,135 +270,135 @@ BOOST_AUTO_TEST_CASE(script_build) std::vector good; std::vector bad; - good.push_back(TestBuilder(CScript() << keys.pubkey0 << OP_CHECKSIG, + good.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG, "P2PK", 0 ).PushSig(keys.key0)); - bad.push_back(TestBuilder(CScript() << keys.pubkey0 << OP_CHECKSIG, + bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG, "P2PK, bad sig", 0 ).PushSig(keys.key0).DamagePush(10)); - good.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 << keys.pubkey1C.GetID() << OP_EQUALVERIFY << OP_CHECKSIG, + good.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 << ToByteVector(keys.pubkey1C.GetID()) << OP_EQUALVERIFY << OP_CHECKSIG, "P2PKH", 0 ).PushSig(keys.key1).Push(keys.pubkey1C)); - bad.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 << keys.pubkey2C.GetID() << OP_EQUALVERIFY << OP_CHECKSIG, + bad.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 << ToByteVector(keys.pubkey2C.GetID()) << OP_EQUALVERIFY << OP_CHECKSIG, "P2PKH, bad pubkey", 0 ).PushSig(keys.key2).Push(keys.pubkey2C).DamagePush(5)); - good.push_back(TestBuilder(CScript() << keys.pubkey1 << OP_CHECKSIG, + good.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG, "P2PK anyonecanpay", 0 ).PushSig(keys.key1, SIGHASH_ALL | SIGHASH_ANYONECANPAY)); - bad.push_back(TestBuilder(CScript() << keys.pubkey1 << OP_CHECKSIG, + bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG, "P2PK anyonecanpay marked with normal hashtype", 0 ).PushSig(keys.key1, SIGHASH_ALL | SIGHASH_ANYONECANPAY).EditPush(70, "81", "01")); - good.push_back(TestBuilder(CScript() << keys.pubkey0C << OP_CHECKSIG, + good.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0C) << OP_CHECKSIG, "P2SH(P2PK)", SCRIPT_VERIFY_P2SH, true ).PushSig(keys.key0).PushRedeem()); - bad.push_back(TestBuilder(CScript() << keys.pubkey0C << OP_CHECKSIG, + bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0C) << OP_CHECKSIG, "P2SH(P2PK), bad redeemscript", SCRIPT_VERIFY_P2SH, true ).PushSig(keys.key0).PushRedeem().DamagePush(10)); - good.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 << keys.pubkey1.GetID() << OP_EQUALVERIFY << OP_CHECKSIG, + good.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 << ToByteVector(keys.pubkey1.GetID()) << OP_EQUALVERIFY << OP_CHECKSIG, "P2SH(P2PKH), bad sig but no VERIFY_P2SH", 0, true ).PushSig(keys.key0).DamagePush(10).PushRedeem()); - bad.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 << keys.pubkey1.GetID() << OP_EQUALVERIFY << OP_CHECKSIG, + bad.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 << ToByteVector(keys.pubkey1.GetID()) << OP_EQUALVERIFY << OP_CHECKSIG, "P2SH(P2PKH), bad sig", SCRIPT_VERIFY_P2SH, true ).PushSig(keys.key0).DamagePush(10).PushRedeem()); - good.push_back(TestBuilder(CScript() << OP_3 << keys.pubkey0C << keys.pubkey1C << keys.pubkey2C << OP_3 << OP_CHECKMULTISIG, + good.push_back(TestBuilder(CScript() << OP_3 << ToByteVector(keys.pubkey0C) << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_3 << OP_CHECKMULTISIG, "3-of-3", 0 ).Num(0).PushSig(keys.key0).PushSig(keys.key1).PushSig(keys.key2)); - bad.push_back(TestBuilder(CScript() << OP_3 << keys.pubkey0C << keys.pubkey1C << keys.pubkey2C << OP_3 << OP_CHECKMULTISIG, + bad.push_back(TestBuilder(CScript() << OP_3 << ToByteVector(keys.pubkey0C) << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_3 << OP_CHECKMULTISIG, "3-of-3, 2 sigs", 0 ).Num(0).PushSig(keys.key0).PushSig(keys.key1).Num(0)); - good.push_back(TestBuilder(CScript() << OP_2 << keys.pubkey0C << keys.pubkey1C << keys.pubkey2C << OP_3 << OP_CHECKMULTISIG, + good.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey0C) << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_3 << OP_CHECKMULTISIG, "P2SH(2-of-3)", SCRIPT_VERIFY_P2SH, true ).Num(0).PushSig(keys.key1).PushSig(keys.key2).PushRedeem()); - bad.push_back(TestBuilder(CScript() << OP_2 << keys.pubkey0C << keys.pubkey1C << keys.pubkey2C << OP_3 << OP_CHECKMULTISIG, + bad.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey0C) << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_3 << OP_CHECKMULTISIG, "P2SH(2-of-3), 1 sig", SCRIPT_VERIFY_P2SH, true ).Num(0).PushSig(keys.key1).Num(0).PushRedeem()); - good.push_back(TestBuilder(CScript() << keys.pubkey1C << OP_CHECKSIG, + good.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG, "P2PK with too much R padding but no DERSIG", 0 ).PushSig(keys.key1, SIGHASH_ALL, 31, 32).EditPush(1, "43021F", "44022000")); - bad.push_back(TestBuilder(CScript() << keys.pubkey1C << OP_CHECKSIG, + bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG, "P2PK with too much R padding", SCRIPT_VERIFY_DERSIG ).PushSig(keys.key1, SIGHASH_ALL, 31, 32).EditPush(1, "43021F", "44022000")); - good.push_back(TestBuilder(CScript() << keys.pubkey1C << OP_CHECKSIG, + good.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG, "P2PK with too much S padding but no DERSIG", 0 ).PushSig(keys.key1, SIGHASH_ALL).EditPush(1, "44", "45").EditPush(37, "20", "2100")); - bad.push_back(TestBuilder(CScript() << keys.pubkey1C << OP_CHECKSIG, + bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG, "P2PK with too much S padding", SCRIPT_VERIFY_DERSIG ).PushSig(keys.key1, SIGHASH_ALL).EditPush(1, "44", "45").EditPush(37, "20", "2100")); - good.push_back(TestBuilder(CScript() << keys.pubkey1C << OP_CHECKSIG, + good.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG, "P2PK with too little R padding but no DERSIG", 0 ).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, "45022100", "440220")); - bad.push_back(TestBuilder(CScript() << keys.pubkey1C << OP_CHECKSIG, + bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG, "P2PK with too little R padding", SCRIPT_VERIFY_DERSIG ).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, "45022100", "440220")); - good.push_back(TestBuilder(CScript() << keys.pubkey2C << OP_CHECKSIG << OP_NOT, + good.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG << OP_NOT, "P2PK NOT with bad sig with too much R padding but no DERSIG", 0 ).PushSig(keys.key2, SIGHASH_ALL, 31, 32).EditPush(1, "43021F", "44022000").DamagePush(10)); - bad.push_back(TestBuilder(CScript() << keys.pubkey2C << OP_CHECKSIG << OP_NOT, + bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG << OP_NOT, "P2PK NOT with bad sig with too much R padding", SCRIPT_VERIFY_DERSIG ).PushSig(keys.key2, SIGHASH_ALL, 31, 32).EditPush(1, "43021F", "44022000").DamagePush(10)); - bad.push_back(TestBuilder(CScript() << keys.pubkey2C << OP_CHECKSIG << OP_NOT, + bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG << OP_NOT, "P2PK NOT with too much R padding but no DERSIG", 0 ).PushSig(keys.key2, SIGHASH_ALL, 31, 32).EditPush(1, "43021F", "44022000")); - bad.push_back(TestBuilder(CScript() << keys.pubkey2C << OP_CHECKSIG << OP_NOT, + bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG << OP_NOT, "P2PK NOT with too much R padding", SCRIPT_VERIFY_DERSIG ).PushSig(keys.key2, SIGHASH_ALL, 31, 32).EditPush(1, "43021F", "44022000")); - good.push_back(TestBuilder(CScript() << keys.pubkey2C << OP_CHECKSIG, + good.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG, "P2PK with high S but no LOW_S", 0 ).PushSig(keys.key2, SIGHASH_ALL, 32, 33)); - bad.push_back(TestBuilder(CScript() << keys.pubkey2C << OP_CHECKSIG, + bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG, "P2PK with high S", SCRIPT_VERIFY_LOW_S ).PushSig(keys.key2, SIGHASH_ALL, 32, 33)); - good.push_back(TestBuilder(CScript() << keys.pubkey0H << OP_CHECKSIG, + good.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG, "P2PK with hybrid pubkey but no STRICTENC", 0 ).PushSig(keys.key0, SIGHASH_ALL)); - bad.push_back(TestBuilder(CScript() << keys.pubkey0H << OP_CHECKSIG, + bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG, "P2PK with hybrid pubkey", SCRIPT_VERIFY_STRICTENC ).PushSig(keys.key0, SIGHASH_ALL)); - bad.push_back(TestBuilder(CScript() << keys.pubkey0H << OP_CHECKSIG << OP_NOT, + bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG << OP_NOT, "P2PK NOT with hybrid pubkey but no STRICTENC", 0 ).PushSig(keys.key0, SIGHASH_ALL)); - good.push_back(TestBuilder(CScript() << keys.pubkey0H << OP_CHECKSIG << OP_NOT, + good.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG << OP_NOT, "P2PK NOT with hybrid pubkey", SCRIPT_VERIFY_STRICTENC ).PushSig(keys.key0, SIGHASH_ALL)); - good.push_back(TestBuilder(CScript() << keys.pubkey0H << OP_CHECKSIG << OP_NOT, + good.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG << OP_NOT, "P2PK NOT with invalid hybrid pubkey but no STRICTENC", 0 ).PushSig(keys.key0, SIGHASH_ALL).DamagePush(10)); - good.push_back(TestBuilder(CScript() << keys.pubkey0H << OP_CHECKSIG << OP_NOT, + good.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG << OP_NOT, "P2PK NOT with invalid hybrid pubkey", SCRIPT_VERIFY_STRICTENC ).PushSig(keys.key0, SIGHASH_ALL).DamagePush(10)); - good.push_back(TestBuilder(CScript() << keys.pubkey1 << OP_CHECKSIG, + good.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG, "P2PK with undefined hashtype but no STRICTENC", 0 ).PushSig(keys.key1, 5)); - bad.push_back(TestBuilder(CScript() << keys.pubkey1 << OP_CHECKSIG, + bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG, "P2PK with undefined hashtype", SCRIPT_VERIFY_STRICTENC ).PushSig(keys.key1, 5)); - good.push_back(TestBuilder(CScript() << keys.pubkey1 << OP_CHECKSIG << OP_NOT, + good.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG << OP_NOT, "P2PK NOT with invalid sig and undefined hashtype but no STRICTENC", 0 ).PushSig(keys.key1, 5).DamagePush(10)); - bad.push_back(TestBuilder(CScript() << keys.pubkey1 << OP_CHECKSIG << OP_NOT, + bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG << OP_NOT, "P2PK NOT with invalid sig and undefined hashtype", SCRIPT_VERIFY_STRICTENC ).PushSig(keys.key1, 5).DamagePush(10)); - good.push_back(TestBuilder(CScript() << OP_3 << keys.pubkey0C << keys.pubkey1C << keys.pubkey2C << OP_3 << OP_CHECKMULTISIG, + good.push_back(TestBuilder(CScript() << OP_3 << ToByteVector(keys.pubkey0C) << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_3 << OP_CHECKMULTISIG, "3-of-3 with nonzero dummy but no NULLDUMMY", 0 ).Num(1).PushSig(keys.key0).PushSig(keys.key1).PushSig(keys.key2)); - bad.push_back(TestBuilder(CScript() << OP_3 << keys.pubkey0C << keys.pubkey1C << keys.pubkey2C << OP_3 << OP_CHECKMULTISIG, + bad.push_back(TestBuilder(CScript() << OP_3 << ToByteVector(keys.pubkey0C) << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_3 << OP_CHECKMULTISIG, "3-of-3 with nonzero dummy", SCRIPT_VERIFY_NULLDUMMY ).Num(1).PushSig(keys.key0).PushSig(keys.key1).PushSig(keys.key2)); - good.push_back(TestBuilder(CScript() << OP_3 << keys.pubkey0C << keys.pubkey1C << keys.pubkey2C << OP_3 << OP_CHECKMULTISIG << OP_NOT, + good.push_back(TestBuilder(CScript() << OP_3 << ToByteVector(keys.pubkey0C) << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_3 << OP_CHECKMULTISIG << OP_NOT, "3-of-3 NOT with invalid sig and nonzero dummy but no NULLDUMMY", 0 ).Num(1).PushSig(keys.key0).PushSig(keys.key1).PushSig(keys.key2).DamagePush(10)); - bad.push_back(TestBuilder(CScript() << OP_3 << keys.pubkey0C << keys.pubkey1C << keys.pubkey2C << OP_3 << OP_CHECKMULTISIG << OP_NOT, + bad.push_back(TestBuilder(CScript() << OP_3 << ToByteVector(keys.pubkey0C) << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_3 << OP_CHECKMULTISIG << OP_NOT, "3-of-3 NOT with invalid sig with nonzero dummy", SCRIPT_VERIFY_NULLDUMMY ).Num(1).PushSig(keys.key0).PushSig(keys.key1).PushSig(keys.key2).DamagePush(10)); @@ -582,7 +582,7 @@ BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG12) key3.MakeNewKey(true); CScript scriptPubKey12; - scriptPubKey12 << OP_1 << key1.GetPubKey() << key2.GetPubKey() << OP_2 << OP_CHECKMULTISIG; + scriptPubKey12 << OP_1 << ToByteVector(key1.GetPubKey()) << ToByteVector(key2.GetPubKey()) << OP_2 << OP_CHECKMULTISIG; CMutableTransaction txFrom12 = BuildCreditingTransaction(scriptPubKey12); CMutableTransaction txTo12 = BuildSpendingTransaction(CScript(), txFrom12); @@ -608,7 +608,7 @@ BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG23) key4.MakeNewKey(false); CScript scriptPubKey23; - scriptPubKey23 << OP_2 << key1.GetPubKey() << key2.GetPubKey() << key3.GetPubKey() << OP_3 << OP_CHECKMULTISIG; + scriptPubKey23 << OP_2 << ToByteVector(key1.GetPubKey()) << ToByteVector(key2.GetPubKey()) << ToByteVector(key3.GetPubKey()) << OP_3 << OP_CHECKMULTISIG; CMutableTransaction txFrom23 = BuildCreditingTransaction(scriptPubKey23); CMutableTransaction txTo23 = BuildSpendingTransaction(CScript(), txFrom23); @@ -695,7 +695,7 @@ BOOST_AUTO_TEST_CASE(script_combineSigs) BOOST_CHECK(combined == scriptSigCopy || combined == scriptSig); // P2SH, single-signature case: - CScript pkSingle; pkSingle << keys[0].GetPubKey() << OP_CHECKSIG; + CScript pkSingle; pkSingle << ToByteVector(keys[0].GetPubKey()) << OP_CHECKSIG; keystore.AddCScript(pkSingle); scriptPubKey = GetScriptForDestination(CScriptID(pkSingle)); SignSignature(keystore, txFrom, txTo, 0); diff --git a/src/test/sigopcount_tests.cpp b/src/test/sigopcount_tests.cpp index 4ce2c87a0d..7b27703b62 100644 --- a/src/test/sigopcount_tests.cpp +++ b/src/test/sigopcount_tests.cpp @@ -31,8 +31,8 @@ BOOST_AUTO_TEST_CASE(GetSigOpCount) BOOST_CHECK_EQUAL(s1.GetSigOpCount(false), 0U); BOOST_CHECK_EQUAL(s1.GetSigOpCount(true), 0U); - uint160 dummy; - s1 << OP_1 << dummy << dummy << OP_2 << OP_CHECKMULTISIG; + uint160 dummy(0); + s1 << OP_1 << ToByteVector(dummy) << ToByteVector(dummy) << OP_2 << OP_CHECKMULTISIG; BOOST_CHECK_EQUAL(s1.GetSigOpCount(true), 2U); s1 << OP_IF << OP_CHECKSIG << OP_ENDIF; BOOST_CHECK_EQUAL(s1.GetSigOpCount(true), 3U); @@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE(GetSigOpCount) BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(true), 0U); BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(false), 0U); CScript scriptSig2; - scriptSig2 << OP_1 << dummy << dummy << Serialize(s2); + scriptSig2 << OP_1 << ToByteVector(dummy) << ToByteVector(dummy) << Serialize(s2); BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(scriptSig2), 3U); } diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 18cb8f3d1b..41ccaaac94 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -259,9 +259,9 @@ SetupDummyInputs(CBasicKeyStore& keystoreRet, CCoinsViewCache& coinsRet) // Create some dummy input transactions dummyTransactions[0].vout.resize(2); dummyTransactions[0].vout[0].nValue = 11*CENT; - dummyTransactions[0].vout[0].scriptPubKey << key[0].GetPubKey() << OP_CHECKSIG; + dummyTransactions[0].vout[0].scriptPubKey << ToByteVector(key[0].GetPubKey()) << OP_CHECKSIG; dummyTransactions[0].vout[1].nValue = 50*CENT; - dummyTransactions[0].vout[1].scriptPubKey << key[1].GetPubKey() << OP_CHECKSIG; + dummyTransactions[0].vout[1].scriptPubKey << ToByteVector(key[1].GetPubKey()) << OP_CHECKSIG; coinsRet.ModifyCoins(dummyTransactions[0].GetHash())->FromTx(dummyTransactions[0], 0); dummyTransactions[1].vout.resize(2); From db8eb54bd7239ff2b046fe34b1c8d692860c6b5b Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 30 Sep 2014 19:45:20 -0400 Subject: [PATCH 0887/1288] script: move ToString and ValueString out of the header --- src/script/script.cpp | 33 +++++++++++++++++++++++++++++++++ src/script/script.h | 30 +----------------------------- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/src/script/script.cpp b/src/script/script.cpp index a5126e7cc2..1ce8ddb6df 100644 --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -7,6 +7,16 @@ #include +namespace { +inline std::string ValueString(const std::vector& vch) +{ + if (vch.size() <= 4) + return strprintf("%d", CScriptNum(vch).getint()); + else + return HexStr(vch); +} +} // anon namespace + using namespace std; const char* GetOpName(opcodetype opcode) @@ -253,3 +263,26 @@ bool CScript::HasCanonicalPushes() const } return true; } + +std::string CScript::ToString() const +{ + std::string str; + opcodetype opcode; + std::vector vch; + const_iterator pc = begin(); + while (pc < end()) + { + if (!str.empty()) + str += " "; + if (!GetOp(pc, opcode, vch)) + { + str += "[error]"; + return str; + } + if (0 <= opcode && opcode <= OP_PUSHDATA4) + str += ValueString(vch); + else + str += GetOpName(opcode); + } + return str; +} diff --git a/src/script/script.h b/src/script/script.h index 6676e852ae..4f6ee0c521 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -318,13 +318,6 @@ private: int64_t m_value; }; -inline std::string ValueString(const std::vector& vch) -{ - if (vch.size() <= 4) - return strprintf("%d", CScriptNum(vch).getint()); - else - return HexStr(vch); -} /** Serialized script, used inside transaction inputs and outputs */ class CScript : public std::vector @@ -571,28 +564,7 @@ public: return (size() > 0 && *begin() == OP_RETURN); } - std::string ToString() const - { - std::string str; - opcodetype opcode; - std::vector vch; - const_iterator pc = begin(); - while (pc < end()) - { - if (!str.empty()) - str += " "; - if (!GetOp(pc, opcode, vch)) - { - str += "[error]"; - return str; - } - if (0 <= opcode && opcode <= OP_PUSHDATA4) - str += ValueString(vch); - else - str += GetOpName(opcode); - } - return str; - } + std::string ToString() const; void clear() { // The default std::vector::clear() does not release memory. From 85c579e3a63cf505d6cedc454755265572e97d3e Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 24 Sep 2014 23:32:36 -0400 Subject: [PATCH 0888/1288] script: add a slew of includes all around and drop includes from script.h Lots of files ended up with indirect includes from script.h. --- src/chain.h | 1 + src/chainparams.cpp | 1 + src/core.cpp | 2 ++ src/core_read.cpp | 2 ++ src/core_write.cpp | 1 + src/main.h | 1 + src/protocol.cpp | 1 + src/qt/test/paymentservertests.cpp | 1 + src/script/compressor.cpp | 2 ++ src/script/compressor.h | 3 +++ src/script/interpreter.cpp | 1 + src/script/script.cpp | 3 ++- src/script/script.h | 12 ++++++------ src/script/standard.cpp | 1 + src/script/standard.h | 3 +++ src/test/base58_tests.cpp | 1 + src/txmempool.cpp | 1 + src/utilmoneystr.cpp | 1 + 18 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/chain.h b/src/chain.h index 0aafb40b98..961919d97e 100644 --- a/src/chain.h +++ b/src/chain.h @@ -8,6 +8,7 @@ #include "core.h" #include "pow.h" +#include "tinyformat.h" #include "uint256.h" #include diff --git a/src/chainparams.cpp b/src/chainparams.cpp index f2a14b8293..6896076245 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -7,6 +7,7 @@ #include "random.h" #include "util.h" +#include "utilstrencodings.h" #include diff --git a/src/core.cpp b/src/core.cpp index 6a7a9ff378..73e6de88e1 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -5,7 +5,9 @@ #include "core.h" +#include "hash.h" #include "tinyformat.h" +#include "utilstrencodings.h" std::string COutPoint::ToString() const { diff --git a/src/core_read.cpp b/src/core_read.cpp index 6bd3d9a4fa..8b85a03c54 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -9,6 +9,8 @@ #include "serialize.h" #include "univalue/univalue.h" #include "util.h" +#include "utilstrencodings.h" +#include "version.h" #include #include diff --git a/src/core_write.cpp b/src/core_write.cpp index 40d547fb33..e42e0b62a9 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -12,6 +12,7 @@ #include "univalue/univalue.h" #include "util.h" #include "utilmoneystr.h" +#include "utilstrencodings.h" #include diff --git a/src/main.h b/src/main.h index cad7eebfb7..9f9401653e 100644 --- a/src/main.h +++ b/src/main.h @@ -20,6 +20,7 @@ #include "script/sigcache.h" #include "script/standard.h" #include "sync.h" +#include "tinyformat.h" #include "txmempool.h" #include "uint256.h" diff --git a/src/protocol.cpp b/src/protocol.cpp index 0e28f3abbd..72fdd753a8 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -7,6 +7,7 @@ #include "chainparams.h" #include "util.h" +#include "utilstrencodings.h" #ifndef WIN32 # include diff --git a/src/qt/test/paymentservertests.cpp b/src/qt/test/paymentservertests.cpp index 5d7fe96285..84cab01c50 100644 --- a/src/qt/test/paymentservertests.cpp +++ b/src/qt/test/paymentservertests.cpp @@ -8,6 +8,7 @@ #include "paymentrequestdata.h" #include "util.h" +#include "utilstrencodings.h" #include #include diff --git a/src/script/compressor.cpp b/src/script/compressor.cpp index dbb4df8b7c..af1acf48db 100644 --- a/src/script/compressor.cpp +++ b/src/script/compressor.cpp @@ -4,6 +4,8 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "compressor.h" + +#include "key.h" #include "script/standard.h" bool CScriptCompressor::IsToKeyID(CKeyID &hash) const diff --git a/src/script/compressor.h b/src/script/compressor.h index f48ecf5001..154e0b2662 100644 --- a/src/script/compressor.h +++ b/src/script/compressor.h @@ -7,7 +7,10 @@ #define H_BITCOIN_SCRIPT_COMPRESSOR #include "script/script.h" +#include "serialize.h" +class CKeyID; +class CPubKey; class CScriptID; /** Compact serializer for scripts. diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index ae66217b7c..cd73b88210 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -9,6 +9,7 @@ #include "crypto/ripemd160.h" #include "crypto/sha1.h" #include "crypto/sha2.h" +#include "key.h" #include "script/script.h" #include "uint256.h" #include "util.h" diff --git a/src/script/script.cpp b/src/script/script.cpp index 1ce8ddb6df..3e19d0c2bf 100644 --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -5,7 +5,8 @@ #include "script.h" -#include +#include "tinyformat.h" +#include "utilstrencodings.h" namespace { inline std::string ValueString(const std::vector& vch) diff --git a/src/script/script.h b/src/script/script.h index 4f6ee0c521..a68924c73a 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -6,13 +6,13 @@ #ifndef H_BITCOIN_SCRIPT #define H_BITCOIN_SCRIPT -#include "key.h" -#include "tinyformat.h" -#include "utilstrencodings.h" - +#include +#include +#include #include - -#include +#include +#include +#include static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; // bytes diff --git a/src/script/standard.cpp b/src/script/standard.cpp index 7e6b136a28..05938961bc 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -7,6 +7,7 @@ #include "script/script.h" #include "util.h" +#include "utilstrencodings.h" #include diff --git a/src/script/standard.h b/src/script/standard.h index 38d0b59885..961b214c89 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -6,9 +6,12 @@ #ifndef H_BITCOIN_SCRIPT_STANDARD #define H_BITCOIN_SCRIPT_STANDARD +#include "key.h" #include "script/script.h" #include "script/interpreter.h" +#include + #include class CScript; diff --git a/src/test/base58_tests.cpp b/src/test/base58_tests.cpp index c298c805da..e495435b81 100644 --- a/src/test/base58_tests.cpp +++ b/src/test/base58_tests.cpp @@ -12,6 +12,7 @@ #include "script/script.h" #include "uint256.h" #include "util.h" +#include "utilstrencodings.h" #include #include diff --git a/src/txmempool.cpp b/src/txmempool.cpp index fa1802ad31..4522c63617 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -8,6 +8,7 @@ #include "core.h" #include "util.h" #include "utilmoneystr.h" +#include "version.h" #include diff --git a/src/utilmoneystr.cpp b/src/utilmoneystr.cpp index 1a5635bfb8..95be06aa18 100644 --- a/src/utilmoneystr.cpp +++ b/src/utilmoneystr.cpp @@ -7,6 +7,7 @@ #include "core.h" #include "tinyformat.h" +#include "utilstrencodings.h" using namespace std; From fef24cab1a4a13a864783dfcd6613ce8100f990d Mon Sep 17 00:00:00 2001 From: Ruben Dario Ponticeli Date: Mon, 13 Oct 2014 20:48:34 -0300 Subject: [PATCH 0889/1288] Add IsNull() to class CAutoFile and remove operator ! --- src/main.cpp | 8 ++++---- src/net.cpp | 4 ++-- src/serialize.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f5fd7561c6..05f1a2eb4d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1106,7 +1106,7 @@ bool WriteBlockToDisk(CBlock& block, CDiskBlockPos& pos) { // Open history file to append CAutoFile fileout(OpenBlockFile(pos), SER_DISK, CLIENT_VERSION); - if (!fileout) + if (fileout.IsNull()) return error("WriteBlockToDisk : OpenBlockFile failed"); // Write index header @@ -1134,7 +1134,7 @@ bool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos) // Open history file to read CAutoFile filein(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION); - if (!filein) + if (filein.IsNull()) return error("ReadBlockFromDisk : OpenBlockFile failed"); // Read block @@ -4548,7 +4548,7 @@ bool CBlockUndo::WriteToDisk(CDiskBlockPos &pos, const uint256 &hashBlock) { // Open history file to append CAutoFile fileout(OpenUndoFile(pos), SER_DISK, CLIENT_VERSION); - if (!fileout) + if (fileout.IsNull()) return error("CBlockUndo::WriteToDisk : OpenUndoFile failed"); // Write index header @@ -4580,7 +4580,7 @@ bool CBlockUndo::ReadFromDisk(const CDiskBlockPos &pos, const uint256 &hashBlock { // Open history file to read CAutoFile filein(OpenUndoFile(pos, true), SER_DISK, CLIENT_VERSION); - if (!filein) + if (filein.IsNull()) return error("CBlockUndo::ReadFromDisk : OpenBlockFile failed"); // Read block diff --git a/src/net.cpp b/src/net.cpp index 50b435cf14..b7c958143c 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1929,7 +1929,7 @@ bool CAddrDB::Write(const CAddrMan& addr) boost::filesystem::path pathTmp = GetDataDir() / tmpfn; FILE *file = fopen(pathTmp.string().c_str(), "wb"); CAutoFile fileout(file, SER_DISK, CLIENT_VERSION); - if (!fileout) + if (fileout.IsNull()) return error("%s : Failed to open file %s", __func__, pathTmp.string()); // Write and commit header, data @@ -1954,7 +1954,7 @@ bool CAddrDB::Read(CAddrMan& addr) // open input file, and associate with CAutoFile FILE *file = fopen(pathAddr.string().c_str(), "rb"); CAutoFile filein(file, SER_DISK, CLIENT_VERSION); - if (!filein) + if (filein.IsNull()) return error("%s : Failed to open file %s", __func__, pathAddr.string()); // use file size to size memory buffer diff --git a/src/serialize.h b/src/serialize.h index 55b6891394..d8f0b76d59 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -1122,7 +1122,7 @@ public: FILE& operator*() { return *file; } FILE** operator&() { return &file; } FILE* operator=(FILE* pnew) { return file = pnew; } - bool operator!() { return (file == NULL); } + bool IsNull() const { return (file == NULL); } // From a96d113962b92b550a04d6ab0f580d29401039da Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 19 Oct 2014 18:17:01 -0700 Subject: [PATCH 0890/1288] Rename CWalletInterface to CValidationInterface It's useful for much more than wallets. --- src/init.cpp | 4 ++-- src/main.cpp | 30 +++++++++++++++--------------- src/main.h | 28 ++++++++++++++-------------- src/test/test_bitcoin.cpp | 2 +- src/wallet.h | 2 +- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 55991ac9b3..273c21f12f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -170,7 +170,7 @@ void Shutdown() #ifndef WIN32 boost::filesystem::remove(GetPidFile()); #endif - UnregisterAllWallets(); + UnregisterAllValidationInterfaces(); #ifdef ENABLE_WALLET delete pwalletMain; pwalletMain = NULL; @@ -1154,7 +1154,7 @@ bool AppInit2(boost::thread_group& threadGroup) LogPrintf("%s", strErrors.str()); LogPrintf(" wallet %15dms\n", GetTimeMillis() - nStart); - RegisterWallet(pwalletMain); + RegisterValidationInterface(pwalletMain); CBlockIndex *pindexRescan = chainActive.Tip(); if (GetBoolArg("-rescan", false)) diff --git a/src/main.cpp b/src/main.cpp index f5fd7561c6..630891bd3f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -156,25 +156,25 @@ struct CMainSignals { } // anon namespace -void RegisterWallet(CWalletInterface* pwalletIn) { - g_signals.SyncTransaction.connect(boost::bind(&CWalletInterface::SyncTransaction, pwalletIn, _1, _2)); - g_signals.EraseTransaction.connect(boost::bind(&CWalletInterface::EraseFromWallet, pwalletIn, _1)); - g_signals.UpdatedTransaction.connect(boost::bind(&CWalletInterface::UpdatedTransaction, pwalletIn, _1)); - g_signals.SetBestChain.connect(boost::bind(&CWalletInterface::SetBestChain, pwalletIn, _1)); - g_signals.Inventory.connect(boost::bind(&CWalletInterface::Inventory, pwalletIn, _1)); - g_signals.Broadcast.connect(boost::bind(&CWalletInterface::ResendWalletTransactions, pwalletIn)); +void RegisterValidationInterface(CValidationInterface* pwalletIn) { + g_signals.SyncTransaction.connect(boost::bind(&CValidationInterface::SyncTransaction, pwalletIn, _1, _2)); + g_signals.EraseTransaction.connect(boost::bind(&CValidationInterface::EraseFromWallet, pwalletIn, _1)); + g_signals.UpdatedTransaction.connect(boost::bind(&CValidationInterface::UpdatedTransaction, pwalletIn, _1)); + g_signals.SetBestChain.connect(boost::bind(&CValidationInterface::SetBestChain, pwalletIn, _1)); + g_signals.Inventory.connect(boost::bind(&CValidationInterface::Inventory, pwalletIn, _1)); + g_signals.Broadcast.connect(boost::bind(&CValidationInterface::ResendWalletTransactions, pwalletIn)); } -void UnregisterWallet(CWalletInterface* pwalletIn) { - g_signals.Broadcast.disconnect(boost::bind(&CWalletInterface::ResendWalletTransactions, pwalletIn)); - g_signals.Inventory.disconnect(boost::bind(&CWalletInterface::Inventory, pwalletIn, _1)); - g_signals.SetBestChain.disconnect(boost::bind(&CWalletInterface::SetBestChain, pwalletIn, _1)); - g_signals.UpdatedTransaction.disconnect(boost::bind(&CWalletInterface::UpdatedTransaction, pwalletIn, _1)); - g_signals.EraseTransaction.disconnect(boost::bind(&CWalletInterface::EraseFromWallet, pwalletIn, _1)); - g_signals.SyncTransaction.disconnect(boost::bind(&CWalletInterface::SyncTransaction, pwalletIn, _1, _2)); +void UnregisterValidationInterface(CValidationInterface* pwalletIn) { + g_signals.Broadcast.disconnect(boost::bind(&CValidationInterface::ResendWalletTransactions, pwalletIn)); + g_signals.Inventory.disconnect(boost::bind(&CValidationInterface::Inventory, pwalletIn, _1)); + g_signals.SetBestChain.disconnect(boost::bind(&CValidationInterface::SetBestChain, pwalletIn, _1)); + g_signals.UpdatedTransaction.disconnect(boost::bind(&CValidationInterface::UpdatedTransaction, pwalletIn, _1)); + g_signals.EraseTransaction.disconnect(boost::bind(&CValidationInterface::EraseFromWallet, pwalletIn, _1)); + g_signals.SyncTransaction.disconnect(boost::bind(&CValidationInterface::SyncTransaction, pwalletIn, _1, _2)); } -void UnregisterAllWallets() { +void UnregisterAllValidationInterfaces() { g_signals.Broadcast.disconnect_all_slots(); g_signals.Inventory.disconnect_all_slots(); g_signals.SetBestChain.disconnect_all_slots(); diff --git a/src/main.h b/src/main.h index 7939b087ec..c0c1fb2707 100644 --- a/src/main.h +++ b/src/main.h @@ -129,17 +129,17 @@ class CBlockTreeDB; class CTxUndo; class CScriptCheck; class CValidationState; -class CWalletInterface; +class CValidationInterface; struct CNodeStateStats; struct CBlockTemplate; /** Register a wallet to receive updates from core */ -void RegisterWallet(CWalletInterface* pwalletIn); +void RegisterValidationInterface(CValidationInterface* pwalletIn); /** Unregister a wallet from core */ -void UnregisterWallet(CWalletInterface* pwalletIn); +void UnregisterValidationInterface(CValidationInterface* pwalletIn); /** Unregister all wallets from core */ -void UnregisterAllWallets(); +void UnregisterAllValidationInterfaces(); /** Push an updated transaction to all registered wallets */ void SyncWithWallets(const CTransaction& tx, const CBlock* pblock = NULL); @@ -640,17 +640,17 @@ public: }; -class CWalletInterface { +class CValidationInterface { protected: - virtual void SyncTransaction(const CTransaction &tx, const CBlock *pblock) =0; - virtual void EraseFromWallet(const uint256 &hash) =0; - virtual void SetBestChain(const CBlockLocator &locator) =0; - virtual void UpdatedTransaction(const uint256 &hash) =0; - virtual void Inventory(const uint256 &hash) =0; - virtual void ResendWalletTransactions() =0; - friend void ::RegisterWallet(CWalletInterface*); - friend void ::UnregisterWallet(CWalletInterface*); - friend void ::UnregisterAllWallets(); + virtual void SyncTransaction(const CTransaction &tx, const CBlock *pblock) {}; + virtual void EraseFromWallet(const uint256 &hash) {}; + virtual void SetBestChain(const CBlockLocator &locator) {}; + virtual void UpdatedTransaction(const uint256 &hash) {}; + virtual void Inventory(const uint256 &hash) {}; + virtual void ResendWalletTransactions() {}; + friend void ::RegisterValidationInterface(CValidationInterface*); + friend void ::UnregisterValidationInterface(CValidationInterface*); + friend void ::UnregisterAllValidationInterfaces(); }; #endif // BITCOIN_MAIN_H diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index afd63d2717..e50218d8ef 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -47,7 +47,7 @@ struct TestingSetup { bool fFirstRun; pwalletMain = new CWallet("wallet.dat"); pwalletMain->LoadWallet(fFirstRun); - RegisterWallet(pwalletMain); + RegisterValidationInterface(pwalletMain); #endif nScriptCheckThreads = 3; for (int i=0; i < nScriptCheckThreads-1; i++) diff --git a/src/wallet.h b/src/wallet.h index fa8a94dfc1..06706655f8 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -95,7 +95,7 @@ public: /** A CWallet is an extension of a keystore, which also maintains a set of transactions and balances, * and provides the ability to create new transactions. */ -class CWallet : public CCryptoKeyStore, public CWalletInterface +class CWallet : public CCryptoKeyStore, public CValidationInterface { private: bool SelectCoins(const CAmount& nTargetValue, std::set >& setCoinsRet, CAmount& nValueRet, const CCoinControl *coinControl = NULL) const; From b7ae2c172a93489fc621622e36dc4258c3934cb7 Mon Sep 17 00:00:00 2001 From: 21E14 <21xe14@gmail.com> Date: Sun, 19 Oct 2014 21:41:37 -0400 Subject: [PATCH 0891/1288] Chain::SetTip return type to void --- src/chain.cpp | 5 ++--- src/chain.h | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/chain.cpp b/src/chain.cpp index 05427a4569..56ed22ce71 100644 --- a/src/chain.cpp +++ b/src/chain.cpp @@ -9,17 +9,16 @@ using namespace std; // CChain implementation -CBlockIndex *CChain::SetTip(CBlockIndex *pindex) { +void CChain::SetTip(CBlockIndex *pindex) { if (pindex == NULL) { vChain.clear(); - return NULL; + return; } vChain.resize(pindex->nHeight + 1); while (pindex && vChain[pindex->nHeight] != pindex) { vChain[pindex->nHeight] = pindex; pindex = pindex->pprev; } - return pindex; } CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const { diff --git a/src/chain.h b/src/chain.h index 4e6a466c6a..0533eeb730 100644 --- a/src/chain.h +++ b/src/chain.h @@ -395,8 +395,8 @@ public: return vChain.size() - 1; } - /** Set/initialize a chain with a given tip. Returns the forking point. */ - CBlockIndex *SetTip(CBlockIndex *pindex); + /** Set/initialize a chain with a given tip. */ + void SetTip(CBlockIndex *pindex); /** Return a CBlockLocator that refers to a block in this chain (by default the tip). */ CBlockLocator GetLocator(const CBlockIndex *pindex = NULL) const; From a3c26c2e856c53706efd2932203dc3539445c66c Mon Sep 17 00:00:00 2001 From: randy-waterhouse Date: Tue, 21 Oct 2014 17:33:06 +1300 Subject: [PATCH 0892/1288] Fixes for missing boost tuple.hpp header include. --- src/miner.cpp | 1 + src/test/bloom_tests.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/miner.cpp b/src/miner.cpp index c2762bf44e..a1f9bd597f 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -17,6 +17,7 @@ #endif #include +#include using namespace std; diff --git a/src/test/bloom_tests.cpp b/src/test/bloom_tests.cpp index 2cdafa4bdd..99b21a23a0 100644 --- a/src/test/bloom_tests.cpp +++ b/src/test/bloom_tests.cpp @@ -14,6 +14,7 @@ #include #include +#include using namespace std; using namespace boost::tuples; From 24e8896430ca73f0642ed1c5f3bdd1406cdd66f6 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Mon, 20 Oct 2014 03:55:04 +0000 Subject: [PATCH 0893/1288] Add CValidationInterface::BlockChecked notification --- src/main.cpp | 9 ++++++++- src/main.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 630891bd3f..d2f999ee56 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -152,6 +152,8 @@ struct CMainSignals { boost::signals2::signal Inventory; // Tells listeners to broadcast their data. boost::signals2::signal Broadcast; + // Notifies listeners of a block validation result + boost::signals2::signal BlockChecked; } g_signals; } // anon namespace @@ -163,9 +165,11 @@ void RegisterValidationInterface(CValidationInterface* pwalletIn) { g_signals.SetBestChain.connect(boost::bind(&CValidationInterface::SetBestChain, pwalletIn, _1)); g_signals.Inventory.connect(boost::bind(&CValidationInterface::Inventory, pwalletIn, _1)); g_signals.Broadcast.connect(boost::bind(&CValidationInterface::ResendWalletTransactions, pwalletIn)); + g_signals.BlockChecked.connect(boost::bind(&CValidationInterface::BlockChecked, pwalletIn, _1, _2)); } void UnregisterValidationInterface(CValidationInterface* pwalletIn) { + g_signals.BlockChecked.disconnect(boost::bind(&CValidationInterface::BlockChecked, pwalletIn, _1, _2)); g_signals.Broadcast.disconnect(boost::bind(&CValidationInterface::ResendWalletTransactions, pwalletIn)); g_signals.Inventory.disconnect(boost::bind(&CValidationInterface::Inventory, pwalletIn, _1)); g_signals.SetBestChain.disconnect(boost::bind(&CValidationInterface::SetBestChain, pwalletIn, _1)); @@ -175,6 +179,7 @@ void UnregisterValidationInterface(CValidationInterface* pwalletIn) { } void UnregisterAllValidationInterfaces() { + g_signals.BlockChecked.disconnect_all_slots(); g_signals.Broadcast.disconnect_all_slots(); g_signals.Inventory.disconnect_all_slots(); g_signals.SetBestChain.disconnect_all_slots(); @@ -1868,7 +1873,9 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock * { CCoinsViewCache view(pcoinsTip); CInv inv(MSG_BLOCK, pindexNew->GetBlockHash()); - if (!ConnectBlock(*pblock, state, pindexNew, view)) { + bool rv = ConnectBlock(*pblock, state, pindexNew, view); + g_signals.BlockChecked(*pblock, state); + if (!rv) { if (state.IsInvalid()) InvalidBlockFound(pindexNew, state); return error("ConnectTip() : ConnectBlock %s failed", pindexNew->GetBlockHash().ToString()); diff --git a/src/main.h b/src/main.h index c0c1fb2707..69be26a4ee 100644 --- a/src/main.h +++ b/src/main.h @@ -648,6 +648,7 @@ protected: virtual void UpdatedTransaction(const uint256 &hash) {}; virtual void Inventory(const uint256 &hash) {}; virtual void ResendWalletTransactions() {}; + virtual void BlockChecked(const CBlock&, const CValidationState&) {}; friend void ::RegisterValidationInterface(CValidationInterface*); friend void ::UnregisterValidationInterface(CValidationInterface*); friend void ::UnregisterAllValidationInterfaces(); From f877aaaf16e40254bf685b4195b809138501feab Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Mon, 20 Oct 2014 04:18:00 +0000 Subject: [PATCH 0894/1288] Bugfix: submitblock: Use a temporary CValidationState to determine accurately the outcome of ProcessBlock, now that it no longer does the full block validity check --- src/rpcmining.cpp | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index c767835a27..a6494163aa 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -526,6 +526,24 @@ Value getblocktemplate(const Array& params, bool fHelp) return result; } +class submitblock_StateCatcher : public CValidationInterface +{ +public: + uint256 hash; + bool found; + CValidationState state; + + submitblock_StateCatcher(const uint256 &hashIn) : hash(hashIn), found(false), state() {}; + +protected: + virtual void BlockChecked(const CBlock& block, const CValidationState& stateIn) { + if (block.GetHash() != hash) + return; + found = true; + state = stateIn; + }; +}; + Value submitblock(const Array& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 2) @@ -558,8 +576,22 @@ Value submitblock(const Array& params, bool fHelp) } CValidationState state; + submitblock_StateCatcher sc(pblock.GetHash()); + RegisterValidationInterface(&sc); bool fAccepted = ProcessBlock(state, NULL, &pblock); - if (!fAccepted) + UnregisterValidationInterface(&sc); + if (fAccepted) + { + if (!sc.found) + return "inconclusive"; + state = sc.state; + } + if (state.IsError()) + { + std::string strRejectReason = state.GetRejectReason(); + throw JSONRPCError(RPC_MISC_ERROR, strRejectReason); + } + if (state.IsInvalid()) return "rejected"; // TODO: report validation state return Value::null; From d29a2917ff73f7e82b32bd94a87df3ee211a27c2 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 26 Jun 2014 14:39:27 +0000 Subject: [PATCH 0895/1288] Rename RPC_TRANSACTION_* errors to RPC_VERIFY_* and use RPC_VERIFY_ERROR for submitblock --- src/rpcmining.cpp | 2 +- src/rpcprotocol.h | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index a6494163aa..28076607b4 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -589,7 +589,7 @@ Value submitblock(const Array& params, bool fHelp) if (state.IsError()) { std::string strRejectReason = state.GetRejectReason(); - throw JSONRPCError(RPC_MISC_ERROR, strRejectReason); + throw JSONRPCError(RPC_VERIFY_ERROR, strRejectReason); } if (state.IsInvalid()) return "rejected"; // TODO: report validation state diff --git a/src/rpcprotocol.h b/src/rpcprotocol.h index a9adb58803..9117248506 100644 --- a/src/rpcprotocol.h +++ b/src/rpcprotocol.h @@ -49,9 +49,14 @@ enum RPCErrorCode RPC_INVALID_PARAMETER = -8, // Invalid, missing or duplicate parameter RPC_DATABASE_ERROR = -20, // Database error RPC_DESERIALIZATION_ERROR = -22, // Error parsing or validating structure in raw format - RPC_TRANSACTION_ERROR = -25, // General error during transaction submission - RPC_TRANSACTION_REJECTED = -26, // Transaction was rejected by network rules - RPC_TRANSACTION_ALREADY_IN_CHAIN= -27, // Transaction already in chain + RPC_VERIFY_ERROR = -25, // General error during transaction or block submission + RPC_VERIFY_REJECTED = -26, // Transaction or block was rejected by network rules + RPC_VERIFY_ALREADY_IN_CHAIN = -27, // Transaction already in chain + + // Aliases for backward compatibility + RPC_TRANSACTION_ERROR = RPC_VERIFY_ERROR, + RPC_TRANSACTION_REJECTED = RPC_VERIFY_REJECTED, + RPC_TRANSACTION_ALREADY_IN_CHAIN= RPC_VERIFY_ALREADY_IN_CHAIN, // P2P client errors RPC_CLIENT_NOT_CONNECTED = -9, // Bitcoin is not connected From 6d3ab8564c3d4cd03e3f193d9029a4e271131edc Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 21 Oct 2014 14:55:10 +0200 Subject: [PATCH 0896/1288] qt: English translation update after 0a08aa8 --- src/qt/bitcoinstrings.cpp | 100 +++--- src/qt/locale/bitcoin_en.ts | 634 +++++++++++++++++------------------- 2 files changed, 350 insertions(+), 384 deletions(-) diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index 25c811183f..e397857faa 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -22,11 +22,8 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "It is also recommended to set alertnotify so you are notified of problems;\n" "for example: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com\n"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"(default: 1, 1 = keep tx meta data e.g. account owner and payment request " -"information, 2 = drop tx meta data)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!" -"3DES:@STRENGTH)"), +"(1 = keep tx meta data e.g. account owner and payment request information, 2 " +"= drop tx meta data)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Allow JSON-RPC connections from specified source. Valid for are a " "single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or " @@ -49,7 +46,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "running."), QT_TRANSLATE_NOOP("bitcoin-core", "" "Continuously rate-limit free transactions to *1000 bytes per minute " -"(default:15)"), +"(default:%u)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Create new files with system default permissions, instead of umask 077 (only " "effective with disabled wallet functionality)"), @@ -75,9 +72,6 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Error: Unsupported argument -socks found. Setting SOCKS version isn't " "possible anymore, only SOCKS5 proxies are supported."), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Execute command when a network tx respends wallet tx input (%s=respend TxID, " -"%t=wallet TxID)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" "Execute command when a relevant alert is received or we see a really long " "fork (%s in cmd is replaced by message)"), QT_TRANSLATE_NOOP("bitcoin-core", "" @@ -94,22 +88,24 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "creation (default: %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Flush database activity from memory pool to disk log every megabytes " -"(default: 100)"), +"(default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"How thorough the block verification of -checkblocks is (0-4, default: 3)"), +"How thorough the block verification of -checkblocks is (0-4, default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "If paytxfee is not set, include enough fee so transactions are confirmed on " -"average within n blocks (default: 1)"), +"average within n blocks (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "In this mode -genproclimit controls how many blocks are generated " "immediately."), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Listen for JSON-RPC connections on (default: 8332 or testnet: 18332)"), +"Log transaction priority and fee per kB when mining blocks (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Number of seconds to keep misbehaving peers from reconnecting (default: " -"86400)"), +"Maintain a full transaction index, used by the getrawtransaction rpc call " +"(default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Output debugging information (default: 0, supplying is optional)"), +"Number of seconds to keep misbehaving peers from reconnecting (default: %u)"), +QT_TRANSLATE_NOOP("bitcoin-core", "" +"Output debugging information (default: %u, supplying is optional)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Query for peer addresses via DNS lookup, if low on addresses (default: 1 " "unless -connect)"), @@ -120,7 +116,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "leave that many cores free, default: %d)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Set the processor limit for when generation is on (-1 = unlimited, default: " -"-1)"), +"%d)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "This is a pre-release test build - use at your own risk - do not use for " "mining or merchant applications"), @@ -132,8 +128,8 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Unable to bind to %s on this computer. Bitcoin Core is probably already " "running."), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -" -"proxy)"), +"Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: " +"%s)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Warning: -paytxfee is set very high! This is the transaction fee you will " "pay if you send a transaction."), @@ -159,14 +155,15 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" QT_TRANSLATE_NOOP("bitcoin-core", "" "Whitelisted peers cannot be DoS banned and their transactions are always " "relayed, even if they are already in the mempool, useful e.g. for a gateway"), +QT_TRANSLATE_NOOP("bitcoin-core", "(default: %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "(default: 1)"), -QT_TRANSLATE_NOOP("bitcoin-core", "(default: wallet.dat)"), QT_TRANSLATE_NOOP("bitcoin-core", " can be:"), QT_TRANSLATE_NOOP("bitcoin-core", "Accept command line and JSON-RPC commands"), QT_TRANSLATE_NOOP("bitcoin-core", "Accept connections from outside (default: 1 if no -proxy or -connect)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Acceptable ciphers (default: %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "Add a node to connect to and attempt to keep the connection open"), QT_TRANSLATE_NOOP("bitcoin-core", "Allow DNS lookups for -addnode, -seednode and -connect"), -QT_TRANSLATE_NOOP("bitcoin-core", "Always query for peer addresses via DNS lookup (default: 0)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Always query for peer addresses via DNS lookup (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Attempt to recover private keys from a corrupt wallet.dat"), QT_TRANSLATE_NOOP("bitcoin-core", "Block creation options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot downgrade wallet"), @@ -182,7 +179,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Copyright (C) 2009-%i The Bitcoin Core Develo QT_TRANSLATE_NOOP("bitcoin-core", "Corrupted block database detected"), QT_TRANSLATE_NOOP("bitcoin-core", "Could not parse -rpcbind value %s as network address"), QT_TRANSLATE_NOOP("bitcoin-core", "Debugging/Testing options:"), -QT_TRANSLATE_NOOP("bitcoin-core", "Disable safemode, override a real safe mode event (default: 0)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Disable safemode, override a real safe mode event (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Discover own IP address (default: 1 when listening and no -externalip)"), QT_TRANSLATE_NOOP("bitcoin-core", "Do not load the wallet and disable wallet RPC calls"), QT_TRANSLATE_NOOP("bitcoin-core", "Do you want to rebuild the block database now?"), @@ -201,13 +198,13 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Error: Unsupported argument -tor found, use - QT_TRANSLATE_NOOP("bitcoin-core", "Error: Wallet locked, unable to create transaction!"), QT_TRANSLATE_NOOP("bitcoin-core", "Failed to listen on any port. Use -listen=0 if you want this."), QT_TRANSLATE_NOOP("bitcoin-core", "Fee (in BTC/kB) to add to transactions you send (default: %s)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Force safe mode (default: 0)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Generate coins (default: 0)"), -QT_TRANSLATE_NOOP("bitcoin-core", "How many blocks to check at startup (default: 288, 0 = all)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Force safe mode (default: %u)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Generate coins (default: %u)"), +QT_TRANSLATE_NOOP("bitcoin-core", "How many blocks to check at startup (default: %u, 0 = all)"), QT_TRANSLATE_NOOP("bitcoin-core", "If is not supplied, output all debugging information."), QT_TRANSLATE_NOOP("bitcoin-core", "Importing..."), QT_TRANSLATE_NOOP("bitcoin-core", "Imports blocks from external blk000??.dat file"), -QT_TRANSLATE_NOOP("bitcoin-core", "Include IP addresses in debug output (default: 0)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Include IP addresses in debug output (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Incorrect or no genesis block found. Wrong datadir for network?"), QT_TRANSLATE_NOOP("bitcoin-core", "Information"), QT_TRANSLATE_NOOP("bitcoin-core", "Initialization sanity check failed. Bitcoin Core is shutting down."), @@ -222,61 +219,60 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid netmask specified in -whitelist: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Keep at most unconnectable blocks in memory (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Keep at most unconnectable transactions in memory (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Limit size of signature cache to entries (default: 50000)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Listen for connections on (default: 8333 or testnet: 18333)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Limit size of signature cache to entries (default: %u)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Listen for JSON-RPC connections on (default: %u or testnet: %u)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Listen for connections on (default: %u or testnet: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Loading addresses..."), QT_TRANSLATE_NOOP("bitcoin-core", "Loading block index..."), QT_TRANSLATE_NOOP("bitcoin-core", "Loading wallet..."), -QT_TRANSLATE_NOOP("bitcoin-core", "Log transaction priority and fee per kB when mining blocks (default: 0)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Maintain a full transaction index (default: 0)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Maintain at most connections to peers (default: 125)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Maximum per-connection receive buffer, *1000 bytes (default: 5000)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Maximum per-connection send buffer, *1000 bytes (default: 1000)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Maintain at most connections to peers (default: %u)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Maximum per-connection receive buffer, *1000 bytes (default: %u)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Maximum per-connection send buffer, *1000 bytes (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Need to specify a port with -whitebind: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Node relay options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Not enough file descriptors available."), -QT_TRANSLATE_NOOP("bitcoin-core", "Only accept block chain matching built-in checkpoints (default: 1)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Only accept block chain matching built-in checkpoints (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Only connect to nodes in network (ipv4, ipv6 or onion)"), QT_TRANSLATE_NOOP("bitcoin-core", "Options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Password for JSON-RPC connections"), -QT_TRANSLATE_NOOP("bitcoin-core", "Prepend debug output with timestamp (default: 1)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Prepend debug output with timestamp (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Print block on startup, if found in block index"), -QT_TRANSLATE_NOOP("bitcoin-core", "Print block tree on startup (default: 0)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Print block tree on startup (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions)"), QT_TRANSLATE_NOOP("bitcoin-core", "RPC server options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Randomly drop 1 of every network messages"), QT_TRANSLATE_NOOP("bitcoin-core", "Randomly fuzz 1 of every network messages"), QT_TRANSLATE_NOOP("bitcoin-core", "Rebuild block chain index from current blk000??.dat files"), -QT_TRANSLATE_NOOP("bitcoin-core", "Relay and mine data carrier transactions (default: 1)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Relay non-P2SH multisig (default: 1)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Relay and mine data carrier transactions (default: %u)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Relay non-P2SH multisig (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Rescan the block chain for missing wallet transactions"), QT_TRANSLATE_NOOP("bitcoin-core", "Rescanning..."), -QT_TRANSLATE_NOOP("bitcoin-core", "Run a thread to flush wallet periodically (default: 1)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Run a thread to flush wallet periodically (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Run in the background as a daemon and accept commands"), QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to console instead of debug.log file"), -QT_TRANSLATE_NOOP("bitcoin-core", "Server certificate file (default: server.cert)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Server private key (default: server.pem)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Server certificate file (default: %s)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Server private key (default: %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "Set database cache size in megabytes (%d to %d, default: %d)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Set key pool size to (default: 100)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Set key pool size to (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Set maximum block size in bytes (default: %d)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Set minimum block size in bytes (default: 0)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Set the number of threads to service RPC calls (default: 4)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Sets the DB_PRIVATE flag in the wallet db environment (default: 1)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Set minimum block size in bytes (default: %u)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Set the number of threads to service RPC calls (default: %d)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Sets the DB_PRIVATE flag in the wallet db environment (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Show all debugging options (usage: --help -help-debug)"), QT_TRANSLATE_NOOP("bitcoin-core", "Shrink debug.log file on client startup (default: 1 when no -debug)"), QT_TRANSLATE_NOOP("bitcoin-core", "Signing transaction failed"), -QT_TRANSLATE_NOOP("bitcoin-core", "Specify configuration file (default: bitcoin.conf)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Specify connection timeout in milliseconds (default: 5000)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Specify configuration file (default: %s)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Specify connection timeout in milliseconds (minimum: 1, default: %d)"), QT_TRANSLATE_NOOP("bitcoin-core", "Specify data directory"), -QT_TRANSLATE_NOOP("bitcoin-core", "Specify pid file (default: bitcoind.pid)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Specify pid file (default: %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "Specify wallet file (within data directory)"), QT_TRANSLATE_NOOP("bitcoin-core", "Specify your own public address"), -QT_TRANSLATE_NOOP("bitcoin-core", "Spend unconfirmed change when sending transactions (default: 1)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Stop running after importing blocks from disk (default: 0)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Spend unconfirmed change when sending transactions (default: %u)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Stop running after importing blocks from disk (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "This help message"), QT_TRANSLATE_NOOP("bitcoin-core", "This is experimental software."), QT_TRANSLATE_NOOP("bitcoin-core", "This is intended for regression testing tools and app development."), -QT_TRANSLATE_NOOP("bitcoin-core", "Threshold for disconnecting misbehaving peers (default: 100)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Threshold for disconnecting misbehaving peers (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "To use the %s option"), QT_TRANSLATE_NOOP("bitcoin-core", "Transaction amount too small"), QT_TRANSLATE_NOOP("bitcoin-core", "Transaction amounts must be positive"), @@ -285,7 +281,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Unable to bind to %s on this computer (bind r QT_TRANSLATE_NOOP("bitcoin-core", "Unknown network specified in -onlynet: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Upgrade wallet to latest format"), QT_TRANSLATE_NOOP("bitcoin-core", "Use OpenSSL (https) for JSON-RPC connections"), -QT_TRANSLATE_NOOP("bitcoin-core", "Use UPnP to map the listening port (default: 0)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Use UPnP to map the listening port (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Use UPnP to map the listening port (default: 1 when listening)"), QT_TRANSLATE_NOOP("bitcoin-core", "Use the test network"), QT_TRANSLATE_NOOP("bitcoin-core", "Username for JSON-RPC connections"), diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index 5c3abef2e7..f16af5f201 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -286,27 +286,27 @@ BitcoinGUI - + Sign &message... Sign &message... - + Synchronizing with network... Synchronizing with network... - + &Overview &Overview - + Node - + Show general overview of wallet Show general overview of wallet @@ -331,7 +331,7 @@ Quit application - + About &Qt About &Qt @@ -347,7 +347,7 @@ &Options... - + &Encrypt Wallet... &Encrypt Wallet... @@ -377,13 +377,12 @@ - - + Bitcoin Core client - + Importing blocks from disk... Importing blocks from disk... @@ -393,17 +392,17 @@ Reindexing blocks on disk... - + Send coins to a Bitcoin address Send coins to a Bitcoin address - + Modify configuration options for Bitcoin Modify configuration options for Bitcoin - + Backup wallet to another location Backup wallet to another location @@ -428,17 +427,17 @@ &Verify message... - + Bitcoin Bitcoin - + Wallet Wallet - + &Send &Send @@ -448,13 +447,12 @@ &Receive - + Show information about Bitcoin Core - - + &Show / Hide &Show / Hide @@ -499,29 +497,22 @@ Tabs toolbar - - - [testnet] - [testnet] - - - + Bitcoin Core Bitcoin Core - + Request payments (generates QR codes and bitcoin: URIs) - - + &About Bitcoin Core - + Show the list of used sending addresses and labels @@ -546,7 +537,7 @@ - + %n active connection(s) to Bitcoin network %n active connection to Bitcoin network @@ -1813,12 +1804,11 @@ Address: %4 - N/A N/A - + Client version Client version @@ -1919,11 +1909,6 @@ Address: %4 Services - - - Sync Node - - Starting Height @@ -1970,7 +1955,7 @@ Address: %4 - + Last block time Last block time @@ -2086,17 +2071,7 @@ Address: %4 - - Yes - - - - - No - - - - + Unknown @@ -2853,7 +2828,7 @@ Address: %4 SplashScreen - + Bitcoin Core Bitcoin Core @@ -2863,7 +2838,7 @@ Address: %4 - + [testnet] [testnet] @@ -3418,7 +3393,7 @@ Address: %4 UnitDisplayStatusBarControl - + Unit to show amounts in. Click to select another unit. @@ -3485,62 +3460,27 @@ Address: %4 bitcoin-core - + Options: Options: - - Specify configuration file (default: bitcoin.conf) - Specify configuration file (default: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - Specify pid file (default: bitcoind.pid) - - - + Specify data directory Specify data directory - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Listen for connections on <port> (default: 8333 or testnet: 18333) - - - - Maintain at most <n> connections to peers (default: 125) - Maintain at most <n> connections to peers (default: 125) - - - + Connect to a node to retrieve peer addresses, and disconnect Connect to a node to retrieve peer addresses, and disconnect - + Specify your own public address Specify your own public address - - Threshold for disconnecting misbehaving peers (default: 100) - Threshold for disconnecting misbehaving peers (default: 100) - - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - - - + Accept command line and JSON-RPC commands Accept command line and JSON-RPC commands @@ -3560,7 +3500,7 @@ Address: %4 Accept connections from outside (default: 1 if no -proxy or -connect) - + %s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: @@ -3585,22 +3525,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - - - - + Bind to given address and always listen on it. Use [host]:port notation for IPv6 Bind to given address and always listen on it. Use [host]:port notation for IPv6 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - - - - + Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup @@ -3620,37 +3550,22 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - + Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - - - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - - - - + In this mode -genproclimit controls how many blocks are generated immediately. - + Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - - - - + This is a pre-release test build - use at your own risk - do not use for mining or merchant applications This is a pre-release test build - use at your own risk - do not use for mining or merchant applications @@ -3660,12 +3575,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - - - - + Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. @@ -3690,22 +3600,17 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - + (default: 1) - - - (default: wallet.dat) - - <category> can be: - + Attempt to recover private keys from a corrupt wallet.dat Attempt to recover private keys from a corrupt wallet.dat @@ -3735,12 +3640,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - Disable safemode, override a real safe mode event (default: 0) - - - - + Discover own IP address (default: 1 when listening and no -externalip) Discover own IP address (default: 1 when listening and no -externalip) @@ -3795,22 +3695,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Failed to listen on any port. Use -listen=0 if you want this. - - Force safe mode (default: 0) - - - - - Generate coins (default: 0) - Generate coins (default: 0) - - - - How many blocks to check at startup (default: 288, 0 = all) - How many blocks to check at startup (default: 288, 0 = all) - - - + If <category> is not supplied, output all debugging information. @@ -3830,7 +3715,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - + Not enough file descriptors available. Not enough file descriptors available. @@ -3840,12 +3725,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - Prepend debug output with timestamp (default: 1) - - - - + Rebuild block chain index from current blk000??.dat files Rebuild block chain index from current blk000??.dat files @@ -3860,32 +3740,22 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - Set the number of threads to service RPC calls (default: 4) - Set the number of threads to service RPC calls (default: 4) - - - + Specify wallet file (within data directory) Specify wallet file (within data directory) - - Spend unconfirmed change when sending transactions (default: 1) - - - - - Stop running after importing blocks from disk (default: 0) - - - - + This is intended for regression testing tools and app development. - + + Use UPnP to map the listening port (default: %u) + + + + Verifying blocks... Verifying blocks... @@ -3910,17 +3780,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. You need to rebuild the database using -reindex to change -txindex - + Imports blocks from external blk000??.dat file Imports blocks from external blk000??.dat file - - (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) - - - - + Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times @@ -3945,7 +3810,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - + + Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:%u) + + + + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) @@ -3964,11 +3834,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. - - - Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) - - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) @@ -3985,17 +3850,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) - - - - - Output debugging information (default: 0, supplying <category> is optional) - - - - + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) @@ -4025,12 +3880,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - Always query for peer addresses via DNS lookup (default: 0) - - - - + Cannot resolve -whitebind address: '%s' @@ -4065,12 +3915,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - Include IP addresses in debug output (default: 0) - - - - + Information Information @@ -4110,32 +3955,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - Limit size of signature cache to <n> entries (default: 50000) - - - - - Log transaction priority and fee per kB when mining blocks (default: 0) - - - - - Maintain a full transaction index (default: 0) - Maintain a full transaction index (default: 0) - - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - - - + Need to specify a port with -whitebind: '%s' @@ -4145,22 +3965,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - Only accept block chain matching built-in checkpoints (default: 1) - Only accept block chain matching built-in checkpoints (default: 1) - - - + Print block on startup, if found in block index - - Print block tree on startup (default: 0) - - - - + RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) @@ -4180,37 +3990,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - Relay and mine data carrier transactions (default: 1) - - - - - Relay non-P2SH multisig (default: 1) - - - - - Run a thread to flush wallet periodically (default: 1) - - - - + Send trace/debug info to console instead of debug.log file Send trace/debug info to console instead of debug.log file - - Set minimum block size in bytes (default: 0) - Set minimum block size in bytes (default: 0) - - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - - - - + Show all debugging options (usage: --help -help-debug) @@ -4225,12 +4010,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Signing transaction failed - - Specify connection timeout in milliseconds (default: 5000) - Specify connection timeout in milliseconds (default: 5000) - - - + This is experimental software. @@ -4255,12 +4035,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - Use UPnP to map the listening port (default: 0) - Use UPnP to map the listening port (default: 0) - - - + Use UPnP to map the listening port (default: 1 when listening) Use UPnP to map the listening port (default: 1 when listening) @@ -4315,22 +4090,17 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Password for JSON-RPC connections - + Execute command when the best block changes (%s in cmd is replaced by block hash) Execute command when the best block changes (%s in cmd is replaced by block hash) - + Upgrade wallet to latest format Upgrade wallet to latest format - - Set key pool size to <n> (default: 100) - Set key pool size to <n> (default: 100) - - - + Rescan the block chain for missing wallet transactions Rescan the block chain for missing wallet transactions @@ -4340,52 +4110,252 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Use OpenSSL (https) for JSON-RPC connections - - Server certificate file (default: server.cert) - Server certificate file (default: server.cert) - - - - Server private key (default: server.pem) - Server private key (default: server.pem) - - - + This help message This help message - + Allow DNS lookups for -addnode, -seednode and -connect Allow DNS lookups for -addnode, -seednode and -connect - + Loading addresses... Loading addresses... - + Error loading wallet.dat: Wallet corrupted Error loading wallet.dat: Wallet corrupted - + + (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + + + + + Flush database activity from memory pool to disk log every <n> megabytes (default: %u) + + + + + How thorough the block verification of -checkblocks is (0-4, default: %u) + + + + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: %u) + + + + + Log transaction priority and fee per kB when mining blocks (default: %u) + + + + + Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u) + + + + + Number of seconds to keep misbehaving peers from reconnecting (default: %u) + + + + + Output debugging information (default: %u, supplying <category> is optional) + + + + + Set the processor limit for when generation is on (-1 = unlimited, default: %d) + + + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) + + + + + (default: %s) + + + + + Acceptable ciphers (default: %s) + + + + + Always query for peer addresses via DNS lookup (default: %u) + + + + + Disable safemode, override a real safe mode event (default: %u) + + + + Error loading wallet.dat Error loading wallet.dat - + + Force safe mode (default: %u) + + + + + Generate coins (default: %u) + + + + + How many blocks to check at startup (default: %u, 0 = all) + + + + + Include IP addresses in debug output (default: %u) + + + + Invalid -proxy address: '%s' Invalid -proxy address: '%s' - + + Limit size of signature cache to <n> entries (default: %u) + + + + + Listen for JSON-RPC connections on <port> (default: %u or testnet: %u) + + + + + Listen for connections on <port> (default: %u or testnet: %u) + + + + + Maintain at most <n> connections to peers (default: %u) + + + + + Maximum per-connection receive buffer, <n>*1000 bytes (default: %u) + + + + + Maximum per-connection send buffer, <n>*1000 bytes (default: %u) + + + + + Only accept block chain matching built-in checkpoints (default: %u) + + + + + Prepend debug output with timestamp (default: %u) + + + + + Print block tree on startup (default: %u) + + + + + Relay and mine data carrier transactions (default: %u) + + + + + Relay non-P2SH multisig (default: %u) + + + + + Run a thread to flush wallet periodically (default: %u) + + + + + Server certificate file (default: %s) + + + + + Server private key (default: %s) + + + + + Set key pool size to <n> (default: %u) + + + + + Set minimum block size in bytes (default: %u) + + + + + Set the number of threads to service RPC calls (default: %d) + + + + + Sets the DB_PRIVATE flag in the wallet db environment (default: %u) + + + + + Specify configuration file (default: %s) + + + + + Specify connection timeout in milliseconds (minimum: 1, default: %d) + + + + + Specify pid file (default: %s) + + + + + Spend unconfirmed change when sending transactions (default: %u) + + + + + Stop running after importing blocks from disk (default: %u) + + + + + Threshold for disconnecting misbehaving peers (default: %u) + + + + Unknown network specified in -onlynet: '%s' Unknown network specified in -onlynet: '%s' - + Cannot resolve -bind address: '%s' Cannot resolve -bind address: '%s' @@ -4410,22 +4380,22 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Insufficient funds - + Loading block index... Loading block index... - + Add a node to connect to and attempt to keep the connection open Add a node to connect to and attempt to keep the connection open - + Loading wallet... Loading wallet... - + Cannot downgrade wallet Cannot downgrade wallet @@ -4435,22 +4405,22 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Cannot write default address - + Rescanning... Rescanning... - + Done loading Done loading - + To use the %s option To use the %s option - + Error Error From c313d6ecb945f8d908b061989d31d53cb6d0297d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 17 Oct 2014 13:11:59 +0200 Subject: [PATCH 0897/1288] doc: add headers first backwards compat warning --- doc/release-notes.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/doc/release-notes.md b/doc/release-notes.md index 967a39a0e7..de13daf3e4 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -1,6 +1,27 @@ (note: this is a temporary file, to be added-to by anybody, and moved to release-notes at release time) +Block file backwards-compatibility warning +=========================================== + +Because release 0.10.0 makes use of headers-first synchronization and parallel +block download, the block files and databases are not backwards-compatible +with older versions of Bitcoin Core: + +* Blocks will be stored on disk out of order (in the order they are +received, really), which makes it incompatible with some tools or +other programs. Reindexing using earlier versions will also not work +anymore as a result of this. + +* The block index database will now hold headers for which no block is +stored on disk, which earlier versions won't support. + +If you want to be able to downgrade smoothly, make a backup of your entire data +directory. Without this your node will need start syncing (or importing from +bootstrap.dat) anew afterwards. + +This does not affect wallet forward or backward compatibility. + Transaction fee changes ======================= From 9acbb4180a383ff123e07887a24b439cef846e89 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 21 Oct 2014 15:40:00 +0200 Subject: [PATCH 0898/1288] qt: small English language updates from translators More friendly language, use placeholders where possible --- src/init.cpp | 2 +- src/qt/bitcoingui.cpp | 2 +- src/qt/bitcoinstrings.cpp | 4 +-- src/qt/intro.cpp | 4 +-- src/qt/locale/bitcoin_en.ts | 49 ++++++++++++++++++++++--------------- 5 files changed, 35 insertions(+), 26 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 8b2a32532c..743cdd4386 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -276,7 +276,7 @@ std::string HelpMessage(HelpMessageMode mode) #endif #endif strUsage += " -whitebind= " + _("Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6") + "\n"; - strUsage += " -whitelist= " + _("Whitelist peers connecting from the given netmask or ip. Can be specified multiple times.") + "\n"; + strUsage += " -whitelist= " + _("Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times.") + "\n"; strUsage += " " + _("Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway") + "\n"; #ifdef ENABLE_WALLET diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 9d6d07a56b..f0471c32f9 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -665,7 +665,7 @@ void BitcoinGUI::setNumBlocks(int count) QDateTime currentDate = QDateTime::currentDateTime(); int secs = lastBlockDate.secsTo(currentDate); - tooltip = tr("Processed %1 blocks of transaction history.").arg(count); + tooltip = tr("Processed %n blocks of transaction history.", "", count); // Set icon state: spinning if catching up, tick otherwise if(secs < 90*60) diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index e397857faa..1073b6a472 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -150,8 +150,8 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect " "you should restore from a backup."), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Whitelist peers connecting from the given netmask or ip. Can be specified " -"multiple times."), +"Whitelist peers connecting from the given netmask or IP address. Can be " +"specified multiple times."), QT_TRANSLATE_NOOP("bitcoin-core", "" "Whitelisted peers cannot be DoS banned and their transactions are always " "relayed, even if they are already in the mempool, useful e.g. for a gateway"), diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp index d469c9a0bd..7618bff69d 100644 --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -215,10 +215,10 @@ void Intro::setStatus(int status, const QString &message, quint64 bytesAvailable { ui->freeSpace->setText(""); } else { - QString freeString = QString::number(bytesAvailable/GB_BYTES) + tr("GB of free space available"); + QString freeString = tr("%n GB of free space available", "", bytesAvailable/GB_BYTES); if(bytesAvailable < BLOCK_CHAIN_SIZE) { - freeString += " " + tr("(of %1GB needed)").arg(BLOCK_CHAIN_SIZE/GB_BYTES); + freeString += " " + tr("(of %n GB needed)", "", BLOCK_CHAIN_SIZE/GB_BYTES); ui->freeSpace->setStyleSheet("QLabel { color: #800000 }"); } else { ui->freeSpace->setStyleSheet(""); diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index f16af5f201..df285441e1 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -549,13 +549,8 @@ No block source available... No block source available... - - - Processed %1 blocks of transaction history. - Processed %1 blocks of transaction history. - - + %n hour(s) %n hour @@ -627,8 +622,16 @@ Up to date Up to date + + + Processed %n blocks of transaction history. + + + + + - + Catching up... Catching up... @@ -1163,15 +1166,21 @@ Address: %4 Error Error - + - GB of free space available - GB of free space available + %n GB of free space available + + + + - + - (of %1GB needed) - (of %1GB needed) + (of %n GB needed) + + + + @@ -3600,7 +3609,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - + + Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times. + + + + (default: 1) @@ -3870,12 +3884,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. - - - - + Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway From 33dfbf57d34882aef7b83bc5ea9bf561e1f3e7b0 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 21 Oct 2014 16:08:20 +0200 Subject: [PATCH 0899/1288] rpc: Fix leveldb iterator leak, and flush before `gettxoutsetinfo` This fixes an iterator leak resulting in bitcoind: db/version_set.cc:789: leveldb::VersionSet::~VersionSet(): Assertion `dummy_versions_.next_ == &dummy_versions_' failed." exception on shutdown. Also make sure to flush pcoinsTip before calling GetStats() to make sure we apply them to the current height. --- src/rpcblockchain.cpp | 1 + src/txdb.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 5beac0512a..b0da1d6a5c 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -319,6 +319,7 @@ Value gettxoutsetinfo(const Array& params, bool fHelp) Object ret; CCoinsStats stats; + pcoinsTip->Flush(); if (pcoinsTip->GetStats(stats)) { ret.push_back(Pair("height", (int64_t)stats.nHeight)); ret.push_back(Pair("bestblock", stats.hashBlock.GetHex())); diff --git a/src/txdb.cpp b/src/txdb.cpp index cb9f150011..8a73ce961c 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -104,7 +104,7 @@ bool CCoinsViewDB::GetStats(CCoinsStats &stats) const { /* It seems that there are no "const iterators" for LevelDB. Since we only need read operations on it, use a const-cast to get around that restriction. */ - leveldb::Iterator *pcursor = const_cast(&db)->NewIterator(); + boost::scoped_ptr pcursor(const_cast(&db)->NewIterator()); pcursor->SeekToFirst(); CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION); From a6a3f141b1b62a816510ba78d9e6aca991f4815b Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Tue, 21 Oct 2014 21:49:45 +0100 Subject: [PATCH 0900/1288] openssl version bump Bumps the OpenSSL version to the latest release, and kills SSL2. (SSL3 was already killed here, so I'm not sure why SSL2 was left around?) No other changes. --- depends/packages/openssl.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/depends/packages/openssl.mk b/depends/packages/openssl.mk index 3ccdaf6f2f..70b0b8d39f 100644 --- a/depends/packages/openssl.mk +++ b/depends/packages/openssl.mk @@ -1,14 +1,14 @@ package=openssl -$(package)_version=1.0.1i +$(package)_version=1.0.1j $(package)_download_path=https://www.openssl.org/source $(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=3c179f46ca77069a6a0bac70212a9b3b838b2f66129cb52d568837fc79d8fcc7 +$(package)_sha256_hash=1b60ca8789ba6f03e8ef20da2293b8dc131c39d83814e775069f02d26354edf3 define $(package)_set_vars $(package)_config_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)" $(package)_config_opts=--prefix=$(host_prefix) --openssldir=$(host_prefix)/etc/openssl no-zlib no-shared no-dso $(package)_config_opts+=no-krb5 no-camellia no-capieng no-cast no-cms no-dtls1 no-gost no-gmp no-heartbeats no-idea no-jpake no-md2 -$(package)_config_opts+=no-mdc2 no-rc5 no-rdrand no-rfc3779 no-rsax no-sctp no-seed no-sha0 no-static_engine no-whirlpool no-rc2 no-rc4 no-ssl3 +$(package)_config_opts+=no-mdc2 no-rc5 no-rdrand no-rfc3779 no-rsax no-sctp no-seed no-sha0 no-static_engine no-whirlpool no-rc2 no-rc4 no-ssl2 no-ssl3 $(package)_config_opts+=$($(package)_cflags) $($(package)_cppflags) $(package)_config_opts_x86_64_linux=-fPIC linux-x86_64 $(package)_config_opts_arm_linux=-fPIC linux-generic32 From 7b2bb96271cb456c2b958b502788ac5ca94c84d4 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 21 Oct 2014 16:17:13 -0700 Subject: [PATCH 0901/1288] Replace some function names with __func__ --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 9cf3afef7d..8b4c03c190 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2818,11 +2818,11 @@ bool static LoadBlockIndexDB() // Load block file info pblocktree->ReadLastBlockFile(nLastBlockFile); vinfoBlockFile.resize(nLastBlockFile + 1); - LogPrintf("LoadBlockIndexDB(): last block file = %i\n", nLastBlockFile); + LogPrintf("%s: last block file = %i\n", __func__, nLastBlockFile); for (int nFile = 0; nFile <= nLastBlockFile; nFile++) { pblocktree->ReadBlockFileInfo(nFile, vinfoBlockFile[nFile]); } - LogPrintf("LoadBlockIndexDB(): last block file info: %s\n", vinfoBlockFile[nLastBlockFile].ToString()); + LogPrintf("%s: last block file info: %s\n", __func__, vinfoBlockFile[nLastBlockFile].ToString()); for (int nFile = nLastBlockFile + 1; true; nFile++) { CBlockFileInfo info; if (pblocktree->ReadBlockFileInfo(nFile, info)) { From a873823864a00f68772eb2b85a70e933839ca3f5 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 20 Oct 2014 12:45:50 +0200 Subject: [PATCH 0902/1288] CAutoFile: Explicit Get() and remove unused methods Also add documentation to some methods. --- src/init.cpp | 4 ++-- src/main.cpp | 16 ++++++++-------- src/net.cpp | 2 +- src/serialize.h | 19 +++++++++++++------ src/test/checkblock_tests.cpp | 2 +- 5 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 55991ac9b3..76eb48a177 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -139,7 +139,7 @@ void Shutdown() { boost::filesystem::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME; CAutoFile est_fileout(fopen(est_path.string().c_str(), "wb"), SER_DISK, CLIENT_VERSION); - if (est_fileout) + if (!est_fileout.IsNull()) mempool.WriteFeeEstimates(est_fileout); else LogPrintf("%s: Failed to write fee estimates to %s\n", __func__, est_path.string()); @@ -1064,7 +1064,7 @@ bool AppInit2(boost::thread_group& threadGroup) boost::filesystem::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME; CAutoFile est_filein(fopen(est_path.string().c_str(), "rb"), SER_DISK, CLIENT_VERSION); // Allowed to fail as this file IS missing on first startup. - if (est_filein) + if (!est_filein.IsNull()) mempool.ReadFeeEstimates(est_filein); fFeeEstimatesInitialized = true; diff --git a/src/main.cpp b/src/main.cpp index 05f1a2eb4d..45e679b3c3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1051,7 +1051,7 @@ bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock CBlockHeader header; try { file >> header; - fseek(file, postx.nTxOffset, SEEK_CUR); + fseek(file.Get(), postx.nTxOffset, SEEK_CUR); file >> txOut; } catch (std::exception &e) { return error("%s : Deserialize or I/O error - %s", __func__, e.what()); @@ -1114,16 +1114,16 @@ bool WriteBlockToDisk(CBlock& block, CDiskBlockPos& pos) fileout << FLATDATA(Params().MessageStart()) << nSize; // Write block - long fileOutPos = ftell(fileout); + long fileOutPos = ftell(fileout.Get()); if (fileOutPos < 0) return error("WriteBlockToDisk : ftell failed"); pos.nPos = (unsigned int)fileOutPos; fileout << block; // Flush stdio buffers and commit to disk before returning - fflush(fileout); + fflush(fileout.Get()); if (!IsInitialBlockDownload()) - FileCommit(fileout); + FileCommit(fileout.Get()); return true; } @@ -2843,7 +2843,7 @@ bool static LoadBlockIndexDB() for (std::set::iterator it = setBlkDataFiles.begin(); it != setBlkDataFiles.end(); it++) { CDiskBlockPos pos(*it, 0); - if (!CAutoFile(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION)) { + if (CAutoFile(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION).IsNull()) { return false; } } @@ -4556,7 +4556,7 @@ bool CBlockUndo::WriteToDisk(CDiskBlockPos &pos, const uint256 &hashBlock) fileout << FLATDATA(Params().MessageStart()) << nSize; // Write undo data - long fileOutPos = ftell(fileout); + long fileOutPos = ftell(fileout.Get()); if (fileOutPos < 0) return error("CBlockUndo::WriteToDisk : ftell failed"); pos.nPos = (unsigned int)fileOutPos; @@ -4569,9 +4569,9 @@ bool CBlockUndo::WriteToDisk(CDiskBlockPos &pos, const uint256 &hashBlock) fileout << hasher.GetHash(); // Flush stdio buffers and commit to disk before returning - fflush(fileout); + fflush(fileout.Get()); if (!IsInitialBlockDownload()) - FileCommit(fileout); + FileCommit(fileout.Get()); return true; } diff --git a/src/net.cpp b/src/net.cpp index b7c958143c..6cf64f51c3 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1939,7 +1939,7 @@ bool CAddrDB::Write(const CAddrMan& addr) catch (std::exception &e) { return error("%s : Serialize or I/O error - %s", __func__, e.what()); } - FileCommit(fileout); + FileCommit(fileout.Get()); fileout.fclose(); // replace existing peers.dat, if any, with new peers.dat.XXXX diff --git a/src/serialize.h b/src/serialize.h index d8f0b76d59..b9d5f95463 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -1116,14 +1116,21 @@ public: } } + /** Get wrapped FILE* with transfer of ownership. + * @note This will invalidate the CAutoFile object, and makes it the responsibility of the caller + * of this function to clean up the returned FILE*. + */ FILE* release() { FILE* ret = file; file = NULL; return ret; } - operator FILE*() { return file; } - FILE* operator->() { return file; } - FILE& operator*() { return *file; } - FILE** operator&() { return &file; } - FILE* operator=(FILE* pnew) { return file = pnew; } - bool IsNull() const { return (file == NULL); } + /** Get wrapped FILE* without transfer of ownership. + * @note Ownership of the FILE* will remain with this class. Use this only if the scope of the + * CAutoFile outlives use of the passed pointer. + */ + FILE* Get() const { return file; } + + /** Return true if the wrapped FILE* is NULL, false otherwise. + */ + bool IsNull() const { return (file == NULL); } // // Stream subset diff --git a/src/test/checkblock_tests.cpp b/src/test/checkblock_tests.cpp index 67d40a45c7..9151fdc0c8 100644 --- a/src/test/checkblock_tests.cpp +++ b/src/test/checkblock_tests.cpp @@ -36,7 +36,7 @@ bool read_block(const std::string& filename, CBlock& block) fseek(fp, 8, SEEK_SET); // skip msgheader/size CAutoFile filein(fp, SER_DISK, CLIENT_VERSION); - if (!filein) return false; + if (filein.IsNull()) return false; filein >> block; From fa7361907a0a5d6698bb7e8e45fa5ac034b81066 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 22 Oct 2014 15:08:30 -0400 Subject: [PATCH 0903/1288] boost: split stream classes out of serialize.h serialization now has no dependencies. --- src/Makefile.am | 1 + src/addrman.cpp | 1 + src/allocators.h | 4 + src/bloom.cpp | 1 + src/core_read.cpp | 1 + src/core_write.cpp | 1 + src/db.h | 1 + src/leveldbwrapper.h | 1 + src/net.h | 1 + src/qt/recentrequeststablemodel.cpp | 1 + src/serialize.h | 553 --------------------------- src/streams.h | 571 ++++++++++++++++++++++++++++ src/test/alert_tests.cpp | 1 + src/test/serialize_tests.cpp | 1 + src/txmempool.cpp | 1 + src/txmempool.h | 2 + 16 files changed, 589 insertions(+), 553 deletions(-) create mode 100644 src/streams.h diff --git a/src/Makefile.am b/src/Makefile.am index 155adfef7d..77443686db 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -107,6 +107,7 @@ BITCOIN_CORE_H = \ script/sign.h \ script/standard.h \ serialize.h \ + streams.h \ sync.h \ threadsafety.h \ timedata.h \ diff --git a/src/addrman.cpp b/src/addrman.cpp index 7b674a66e7..3c6f8d9e72 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -6,6 +6,7 @@ #include "hash.h" #include "serialize.h" +#include "streams.h" using namespace std; diff --git a/src/allocators.h b/src/allocators.h index 6b69e7ae69..78a3b76d0c 100644 --- a/src/allocators.h +++ b/src/allocators.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -261,4 +262,7 @@ struct zero_after_free_allocator : public std::allocator { // This is exactly like std::string, but with a custom allocator. typedef std::basic_string, secure_allocator > SecureString; +// Byte-vector that clears its contents before deletion. +typedef std::vector > CSerializeData; + #endif // BITCOIN_ALLOCATORS_H diff --git a/src/bloom.cpp b/src/bloom.cpp index cef74a3a54..cac71fdbbf 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -7,6 +7,7 @@ #include "core.h" #include "script/script.h" #include "script/standard.h" +#include "streams.h" #include #include diff --git a/src/core_read.cpp b/src/core_read.cpp index 8b85a03c54..dcbcf4b4f7 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -7,6 +7,7 @@ #include "core.h" #include "script/script.h" #include "serialize.h" +#include "streams.h" #include "univalue/univalue.h" #include "util.h" #include "utilstrencodings.h" diff --git a/src/core_write.cpp b/src/core_write.cpp index e42e0b62a9..b2b29fb367 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -9,6 +9,7 @@ #include "script/script.h" #include "script/standard.h" #include "serialize.h" +#include "streams.h" #include "univalue/univalue.h" #include "util.h" #include "utilmoneystr.h" diff --git a/src/db.h b/src/db.h index d202399383..0cbdd8b91b 100644 --- a/src/db.h +++ b/src/db.h @@ -7,6 +7,7 @@ #define BITCOIN_DB_H #include "serialize.h" +#include "streams.h" #include "sync.h" #include "version.h" diff --git a/src/leveldbwrapper.h b/src/leveldbwrapper.h index da5ba61c7b..d997d56e00 100644 --- a/src/leveldbwrapper.h +++ b/src/leveldbwrapper.h @@ -6,6 +6,7 @@ #define BITCOIN_LEVELDBWRAPPER_H #include "serialize.h" +#include "streams.h" #include "util.h" #include "version.h" diff --git a/src/net.h b/src/net.h index 18da24183f..340158512d 100644 --- a/src/net.h +++ b/src/net.h @@ -14,6 +14,7 @@ #include "netbase.h" #include "protocol.h" #include "random.h" +#include "streams.h" #include "sync.h" #include "uint256.h" #include "utilstrencodings.h" diff --git a/src/qt/recentrequeststablemodel.cpp b/src/qt/recentrequeststablemodel.cpp index 0e5802922c..5deac8007c 100644 --- a/src/qt/recentrequeststablemodel.cpp +++ b/src/qt/recentrequeststablemodel.cpp @@ -7,6 +7,7 @@ #include "bitcoinunits.h" #include "guiutil.h" #include "optionsmodel.h" +#include "streams.h" #include diff --git a/src/serialize.h b/src/serialize.h index b9d5f95463..877ef8640a 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -6,8 +6,6 @@ #ifndef BITCOIN_SERIALIZE_H #define BITCOIN_SERIALIZE_H -#include "allocators.h" - #include #include #include @@ -20,8 +18,6 @@ #include #include -class CAutoFile; -class CDataStream; class CScript; static const unsigned int MAX_SIZE = 0x02000000; @@ -761,8 +757,6 @@ inline void SerReadWrite(Stream& s, T& obj, int nType, int nVersion, CSerActionU -typedef std::vector > CSerializeData; - class CSizeComputer { protected: @@ -792,551 +786,4 @@ public: } }; -/** Double ended buffer combining vector and stream-like interfaces. - * - * >> and << read and write unformatted data using the above serialization templates. - * Fills with data in linear time; some stringstream implementations take N^2 time. - */ -class CDataStream -{ -protected: - typedef CSerializeData vector_type; - vector_type vch; - unsigned int nReadPos; -public: - int nType; - int nVersion; - - typedef vector_type::allocator_type allocator_type; - typedef vector_type::size_type size_type; - typedef vector_type::difference_type difference_type; - typedef vector_type::reference reference; - typedef vector_type::const_reference const_reference; - typedef vector_type::value_type value_type; - typedef vector_type::iterator iterator; - typedef vector_type::const_iterator const_iterator; - typedef vector_type::reverse_iterator reverse_iterator; - - explicit CDataStream(int nTypeIn, int nVersionIn) - { - Init(nTypeIn, nVersionIn); - } - - CDataStream(const_iterator pbegin, const_iterator pend, int nTypeIn, int nVersionIn) : vch(pbegin, pend) - { - Init(nTypeIn, nVersionIn); - } - -#if !defined(_MSC_VER) || _MSC_VER >= 1300 - CDataStream(const char* pbegin, const char* pend, int nTypeIn, int nVersionIn) : vch(pbegin, pend) - { - Init(nTypeIn, nVersionIn); - } -#endif - - CDataStream(const vector_type& vchIn, int nTypeIn, int nVersionIn) : vch(vchIn.begin(), vchIn.end()) - { - Init(nTypeIn, nVersionIn); - } - - CDataStream(const std::vector& vchIn, int nTypeIn, int nVersionIn) : vch(vchIn.begin(), vchIn.end()) - { - Init(nTypeIn, nVersionIn); - } - - CDataStream(const std::vector& vchIn, int nTypeIn, int nVersionIn) : vch(vchIn.begin(), vchIn.end()) - { - Init(nTypeIn, nVersionIn); - } - - void Init(int nTypeIn, int nVersionIn) - { - nReadPos = 0; - nType = nTypeIn; - nVersion = nVersionIn; - } - - CDataStream& operator+=(const CDataStream& b) - { - vch.insert(vch.end(), b.begin(), b.end()); - return *this; - } - - friend CDataStream operator+(const CDataStream& a, const CDataStream& b) - { - CDataStream ret = a; - ret += b; - return (ret); - } - - std::string str() const - { - return (std::string(begin(), end())); - } - - - // - // Vector subset - // - const_iterator begin() const { return vch.begin() + nReadPos; } - iterator begin() { return vch.begin() + nReadPos; } - const_iterator end() const { return vch.end(); } - iterator end() { return vch.end(); } - size_type size() const { return vch.size() - nReadPos; } - bool empty() const { return vch.size() == nReadPos; } - void resize(size_type n, value_type c=0) { vch.resize(n + nReadPos, c); } - void reserve(size_type n) { vch.reserve(n + nReadPos); } - const_reference operator[](size_type pos) const { return vch[pos + nReadPos]; } - reference operator[](size_type pos) { return vch[pos + nReadPos]; } - void clear() { vch.clear(); nReadPos = 0; } - iterator insert(iterator it, const char& x=char()) { return vch.insert(it, x); } - void insert(iterator it, size_type n, const char& x) { vch.insert(it, n, x); } - - void insert(iterator it, std::vector::const_iterator first, std::vector::const_iterator last) - { - assert(last - first >= 0); - if (it == vch.begin() + nReadPos && (unsigned int)(last - first) <= nReadPos) - { - // special case for inserting at the front when there's room - nReadPos -= (last - first); - memcpy(&vch[nReadPos], &first[0], last - first); - } - else - vch.insert(it, first, last); - } - -#if !defined(_MSC_VER) || _MSC_VER >= 1300 - void insert(iterator it, const char* first, const char* last) - { - assert(last - first >= 0); - if (it == vch.begin() + nReadPos && (unsigned int)(last - first) <= nReadPos) - { - // special case for inserting at the front when there's room - nReadPos -= (last - first); - memcpy(&vch[nReadPos], &first[0], last - first); - } - else - vch.insert(it, first, last); - } -#endif - - iterator erase(iterator it) - { - if (it == vch.begin() + nReadPos) - { - // special case for erasing from the front - if (++nReadPos >= vch.size()) - { - // whenever we reach the end, we take the opportunity to clear the buffer - nReadPos = 0; - return vch.erase(vch.begin(), vch.end()); - } - return vch.begin() + nReadPos; - } - else - return vch.erase(it); - } - - iterator erase(iterator first, iterator last) - { - if (first == vch.begin() + nReadPos) - { - // special case for erasing from the front - if (last == vch.end()) - { - nReadPos = 0; - return vch.erase(vch.begin(), vch.end()); - } - else - { - nReadPos = (last - vch.begin()); - return last; - } - } - else - return vch.erase(first, last); - } - - inline void Compact() - { - vch.erase(vch.begin(), vch.begin() + nReadPos); - nReadPos = 0; - } - - bool Rewind(size_type n) - { - // Rewind by n characters if the buffer hasn't been compacted yet - if (n > nReadPos) - return false; - nReadPos -= n; - return true; - } - - - // - // Stream subset - // - bool eof() const { return size() == 0; } - CDataStream* rdbuf() { return this; } - int in_avail() { return size(); } - - void SetType(int n) { nType = n; } - int GetType() { return nType; } - void SetVersion(int n) { nVersion = n; } - int GetVersion() { return nVersion; } - void ReadVersion() { *this >> nVersion; } - void WriteVersion() { *this << nVersion; } - - CDataStream& read(char* pch, size_t nSize) - { - // Read from the beginning of the buffer - unsigned int nReadPosNext = nReadPos + nSize; - if (nReadPosNext >= vch.size()) - { - if (nReadPosNext > vch.size()) - { - throw std::ios_base::failure("CDataStream::read() : end of data"); - } - memcpy(pch, &vch[nReadPos], nSize); - nReadPos = 0; - vch.clear(); - return (*this); - } - memcpy(pch, &vch[nReadPos], nSize); - nReadPos = nReadPosNext; - return (*this); - } - - CDataStream& ignore(int nSize) - { - // Ignore from the beginning of the buffer - assert(nSize >= 0); - unsigned int nReadPosNext = nReadPos + nSize; - if (nReadPosNext >= vch.size()) - { - if (nReadPosNext > vch.size()) - throw std::ios_base::failure("CDataStream::ignore() : end of data"); - nReadPos = 0; - vch.clear(); - return (*this); - } - nReadPos = nReadPosNext; - return (*this); - } - - CDataStream& write(const char* pch, size_t nSize) - { - // Write to the end of the buffer - vch.insert(vch.end(), pch, pch + nSize); - return (*this); - } - - template - void Serialize(Stream& s, int nType, int nVersion) const - { - // Special case: stream << stream concatenates like stream += stream - if (!vch.empty()) - s.write((char*)&vch[0], vch.size() * sizeof(vch[0])); - } - - template - unsigned int GetSerializeSize(const T& obj) - { - // Tells the size of the object if serialized to this stream - return ::GetSerializeSize(obj, nType, nVersion); - } - - template - CDataStream& operator<<(const T& obj) - { - // Serialize to this stream - ::Serialize(*this, obj, nType, nVersion); - return (*this); - } - - template - CDataStream& operator>>(T& obj) - { - // Unserialize from this stream - ::Unserialize(*this, obj, nType, nVersion); - return (*this); - } - - void GetAndClear(CSerializeData &data) { - data.insert(data.end(), begin(), end()); - clear(); - } -}; - - - - - - - - - - -/** Non-refcounted RAII wrapper for FILE* - * - * Will automatically close the file when it goes out of scope if not null. - * If you're returning the file pointer, return file.release(). - * If you need to close the file early, use file.fclose() instead of fclose(file). - */ -class CAutoFile -{ -private: - // Disallow copies - CAutoFile(const CAutoFile&); - CAutoFile& operator=(const CAutoFile&); - - int nType; - int nVersion; - - FILE* file; - -public: - CAutoFile(FILE* filenew, int nTypeIn, int nVersionIn) - { - file = filenew; - nType = nTypeIn; - nVersion = nVersionIn; - } - - ~CAutoFile() - { - fclose(); - } - - void fclose() - { - if (file) { - ::fclose(file); - file = NULL; - } - } - - /** Get wrapped FILE* with transfer of ownership. - * @note This will invalidate the CAutoFile object, and makes it the responsibility of the caller - * of this function to clean up the returned FILE*. - */ - FILE* release() { FILE* ret = file; file = NULL; return ret; } - - /** Get wrapped FILE* without transfer of ownership. - * @note Ownership of the FILE* will remain with this class. Use this only if the scope of the - * CAutoFile outlives use of the passed pointer. - */ - FILE* Get() const { return file; } - - /** Return true if the wrapped FILE* is NULL, false otherwise. - */ - bool IsNull() const { return (file == NULL); } - - // - // Stream subset - // - void SetType(int n) { nType = n; } - int GetType() { return nType; } - void SetVersion(int n) { nVersion = n; } - int GetVersion() { return nVersion; } - void ReadVersion() { *this >> nVersion; } - void WriteVersion() { *this << nVersion; } - - CAutoFile& read(char* pch, size_t nSize) - { - if (!file) - throw std::ios_base::failure("CAutoFile::read : file handle is NULL"); - if (fread(pch, 1, nSize, file) != nSize) - throw std::ios_base::failure(feof(file) ? "CAutoFile::read : end of file" : "CAutoFile::read : fread failed"); - return (*this); - } - - CAutoFile& write(const char* pch, size_t nSize) - { - if (!file) - throw std::ios_base::failure("CAutoFile::write : file handle is NULL"); - if (fwrite(pch, 1, nSize, file) != nSize) - throw std::ios_base::failure("CAutoFile::write : write failed"); - return (*this); - } - - template - unsigned int GetSerializeSize(const T& obj) - { - // Tells the size of the object if serialized to this stream - return ::GetSerializeSize(obj, nType, nVersion); - } - - template - CAutoFile& operator<<(const T& obj) - { - // Serialize to this stream - if (!file) - throw std::ios_base::failure("CAutoFile::operator<< : file handle is NULL"); - ::Serialize(*this, obj, nType, nVersion); - return (*this); - } - - template - CAutoFile& operator>>(T& obj) - { - // Unserialize from this stream - if (!file) - throw std::ios_base::failure("CAutoFile::operator>> : file handle is NULL"); - ::Unserialize(*this, obj, nType, nVersion); - return (*this); - } -}; - -/** Non-refcounted RAII wrapper around a FILE* that implements a ring buffer to - * deserialize from. It guarantees the ability to rewind a given number of bytes. - * - * Will automatically close the file when it goes out of scope if not null. - * If you need to close the file early, use file.fclose() instead of fclose(file). - */ -class CBufferedFile -{ -private: - // Disallow copies - CBufferedFile(const CBufferedFile&); - CBufferedFile& operator=(const CBufferedFile&); - - int nType; - int nVersion; - - FILE *src; // source file - uint64_t nSrcPos; // how many bytes have been read from source - uint64_t nReadPos; // how many bytes have been read from this - uint64_t nReadLimit; // up to which position we're allowed to read - uint64_t nRewind; // how many bytes we guarantee to rewind - std::vector vchBuf; // the buffer - -protected: - // read data from the source to fill the buffer - bool Fill() { - unsigned int pos = nSrcPos % vchBuf.size(); - unsigned int readNow = vchBuf.size() - pos; - unsigned int nAvail = vchBuf.size() - (nSrcPos - nReadPos) - nRewind; - if (nAvail < readNow) - readNow = nAvail; - if (readNow == 0) - return false; - size_t read = fread((void*)&vchBuf[pos], 1, readNow, src); - if (read == 0) { - throw std::ios_base::failure(feof(src) ? "CBufferedFile::Fill : end of file" : "CBufferedFile::Fill : fread failed"); - } else { - nSrcPos += read; - return true; - } - } - -public: - CBufferedFile(FILE *fileIn, uint64_t nBufSize, uint64_t nRewindIn, int nTypeIn, int nVersionIn) : - nSrcPos(0), nReadPos(0), nReadLimit((uint64_t)(-1)), nRewind(nRewindIn), vchBuf(nBufSize, 0) - { - src = fileIn; - nType = nTypeIn; - nVersion = nVersionIn; - } - - ~CBufferedFile() - { - fclose(); - } - - void fclose() - { - if (src) { - ::fclose(src); - src = NULL; - } - } - - // check whether we're at the end of the source file - bool eof() const { - return nReadPos == nSrcPos && feof(src); - } - - // read a number of bytes - CBufferedFile& read(char *pch, size_t nSize) { - if (nSize + nReadPos > nReadLimit) - throw std::ios_base::failure("Read attempted past buffer limit"); - if (nSize + nRewind > vchBuf.size()) - throw std::ios_base::failure("Read larger than buffer size"); - while (nSize > 0) { - if (nReadPos == nSrcPos) - Fill(); - unsigned int pos = nReadPos % vchBuf.size(); - size_t nNow = nSize; - if (nNow + pos > vchBuf.size()) - nNow = vchBuf.size() - pos; - if (nNow + nReadPos > nSrcPos) - nNow = nSrcPos - nReadPos; - memcpy(pch, &vchBuf[pos], nNow); - nReadPos += nNow; - pch += nNow; - nSize -= nNow; - } - return (*this); - } - - // return the current reading position - uint64_t GetPos() { - return nReadPos; - } - - // rewind to a given reading position - bool SetPos(uint64_t nPos) { - nReadPos = nPos; - if (nReadPos + nRewind < nSrcPos) { - nReadPos = nSrcPos - nRewind; - return false; - } else if (nReadPos > nSrcPos) { - nReadPos = nSrcPos; - return false; - } else { - return true; - } - } - - bool Seek(uint64_t nPos) { - long nLongPos = nPos; - if (nPos != (uint64_t)nLongPos) - return false; - if (fseek(src, nLongPos, SEEK_SET)) - return false; - nLongPos = ftell(src); - nSrcPos = nLongPos; - nReadPos = nLongPos; - return true; - } - - // prevent reading beyond a certain position - // no argument removes the limit - bool SetLimit(uint64_t nPos = (uint64_t)(-1)) { - if (nPos < nReadPos) - return false; - nReadLimit = nPos; - return true; - } - - template - CBufferedFile& operator>>(T& obj) { - // Unserialize from this stream - ::Unserialize(*this, obj, nType, nVersion); - return (*this); - } - - // search for a given byte in the stream, and remain positioned on it - void FindByte(char ch) { - while (true) { - if (nReadPos == nSrcPos) - Fill(); - if (vchBuf[nReadPos % vchBuf.size()] == ch) - break; - nReadPos++; - } - } -}; - #endif // BITCOIN_SERIALIZE_H diff --git a/src/streams.h b/src/streams.h new file mode 100644 index 0000000000..b07b11eb3d --- /dev/null +++ b/src/streams.h @@ -0,0 +1,571 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2013 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_STREAMS_H +#define BITCOIN_STREAMS_H + +#include "allocators.h" +#include "serialize.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** Double ended buffer combining vector and stream-like interfaces. + * + * >> and << read and write unformatted data using the above serialization templates. + * Fills with data in linear time; some stringstream implementations take N^2 time. + */ +class CDataStream +{ +protected: + typedef CSerializeData vector_type; + vector_type vch; + unsigned int nReadPos; +public: + int nType; + int nVersion; + + typedef vector_type::allocator_type allocator_type; + typedef vector_type::size_type size_type; + typedef vector_type::difference_type difference_type; + typedef vector_type::reference reference; + typedef vector_type::const_reference const_reference; + typedef vector_type::value_type value_type; + typedef vector_type::iterator iterator; + typedef vector_type::const_iterator const_iterator; + typedef vector_type::reverse_iterator reverse_iterator; + + explicit CDataStream(int nTypeIn, int nVersionIn) + { + Init(nTypeIn, nVersionIn); + } + + CDataStream(const_iterator pbegin, const_iterator pend, int nTypeIn, int nVersionIn) : vch(pbegin, pend) + { + Init(nTypeIn, nVersionIn); + } + +#if !defined(_MSC_VER) || _MSC_VER >= 1300 + CDataStream(const char* pbegin, const char* pend, int nTypeIn, int nVersionIn) : vch(pbegin, pend) + { + Init(nTypeIn, nVersionIn); + } +#endif + + CDataStream(const vector_type& vchIn, int nTypeIn, int nVersionIn) : vch(vchIn.begin(), vchIn.end()) + { + Init(nTypeIn, nVersionIn); + } + + CDataStream(const std::vector& vchIn, int nTypeIn, int nVersionIn) : vch(vchIn.begin(), vchIn.end()) + { + Init(nTypeIn, nVersionIn); + } + + CDataStream(const std::vector& vchIn, int nTypeIn, int nVersionIn) : vch(vchIn.begin(), vchIn.end()) + { + Init(nTypeIn, nVersionIn); + } + + void Init(int nTypeIn, int nVersionIn) + { + nReadPos = 0; + nType = nTypeIn; + nVersion = nVersionIn; + } + + CDataStream& operator+=(const CDataStream& b) + { + vch.insert(vch.end(), b.begin(), b.end()); + return *this; + } + + friend CDataStream operator+(const CDataStream& a, const CDataStream& b) + { + CDataStream ret = a; + ret += b; + return (ret); + } + + std::string str() const + { + return (std::string(begin(), end())); + } + + + // + // Vector subset + // + const_iterator begin() const { return vch.begin() + nReadPos; } + iterator begin() { return vch.begin() + nReadPos; } + const_iterator end() const { return vch.end(); } + iterator end() { return vch.end(); } + size_type size() const { return vch.size() - nReadPos; } + bool empty() const { return vch.size() == nReadPos; } + void resize(size_type n, value_type c=0) { vch.resize(n + nReadPos, c); } + void reserve(size_type n) { vch.reserve(n + nReadPos); } + const_reference operator[](size_type pos) const { return vch[pos + nReadPos]; } + reference operator[](size_type pos) { return vch[pos + nReadPos]; } + void clear() { vch.clear(); nReadPos = 0; } + iterator insert(iterator it, const char& x=char()) { return vch.insert(it, x); } + void insert(iterator it, size_type n, const char& x) { vch.insert(it, n, x); } + + void insert(iterator it, std::vector::const_iterator first, std::vector::const_iterator last) + { + assert(last - first >= 0); + if (it == vch.begin() + nReadPos && (unsigned int)(last - first) <= nReadPos) + { + // special case for inserting at the front when there's room + nReadPos -= (last - first); + memcpy(&vch[nReadPos], &first[0], last - first); + } + else + vch.insert(it, first, last); + } + +#if !defined(_MSC_VER) || _MSC_VER >= 1300 + void insert(iterator it, const char* first, const char* last) + { + assert(last - first >= 0); + if (it == vch.begin() + nReadPos && (unsigned int)(last - first) <= nReadPos) + { + // special case for inserting at the front when there's room + nReadPos -= (last - first); + memcpy(&vch[nReadPos], &first[0], last - first); + } + else + vch.insert(it, first, last); + } +#endif + + iterator erase(iterator it) + { + if (it == vch.begin() + nReadPos) + { + // special case for erasing from the front + if (++nReadPos >= vch.size()) + { + // whenever we reach the end, we take the opportunity to clear the buffer + nReadPos = 0; + return vch.erase(vch.begin(), vch.end()); + } + return vch.begin() + nReadPos; + } + else + return vch.erase(it); + } + + iterator erase(iterator first, iterator last) + { + if (first == vch.begin() + nReadPos) + { + // special case for erasing from the front + if (last == vch.end()) + { + nReadPos = 0; + return vch.erase(vch.begin(), vch.end()); + } + else + { + nReadPos = (last - vch.begin()); + return last; + } + } + else + return vch.erase(first, last); + } + + inline void Compact() + { + vch.erase(vch.begin(), vch.begin() + nReadPos); + nReadPos = 0; + } + + bool Rewind(size_type n) + { + // Rewind by n characters if the buffer hasn't been compacted yet + if (n > nReadPos) + return false; + nReadPos -= n; + return true; + } + + + // + // Stream subset + // + bool eof() const { return size() == 0; } + CDataStream* rdbuf() { return this; } + int in_avail() { return size(); } + + void SetType(int n) { nType = n; } + int GetType() { return nType; } + void SetVersion(int n) { nVersion = n; } + int GetVersion() { return nVersion; } + void ReadVersion() { *this >> nVersion; } + void WriteVersion() { *this << nVersion; } + + CDataStream& read(char* pch, size_t nSize) + { + // Read from the beginning of the buffer + unsigned int nReadPosNext = nReadPos + nSize; + if (nReadPosNext >= vch.size()) + { + if (nReadPosNext > vch.size()) + { + throw std::ios_base::failure("CDataStream::read() : end of data"); + } + memcpy(pch, &vch[nReadPos], nSize); + nReadPos = 0; + vch.clear(); + return (*this); + } + memcpy(pch, &vch[nReadPos], nSize); + nReadPos = nReadPosNext; + return (*this); + } + + CDataStream& ignore(int nSize) + { + // Ignore from the beginning of the buffer + assert(nSize >= 0); + unsigned int nReadPosNext = nReadPos + nSize; + if (nReadPosNext >= vch.size()) + { + if (nReadPosNext > vch.size()) + throw std::ios_base::failure("CDataStream::ignore() : end of data"); + nReadPos = 0; + vch.clear(); + return (*this); + } + nReadPos = nReadPosNext; + return (*this); + } + + CDataStream& write(const char* pch, size_t nSize) + { + // Write to the end of the buffer + vch.insert(vch.end(), pch, pch + nSize); + return (*this); + } + + template + void Serialize(Stream& s, int nType, int nVersion) const + { + // Special case: stream << stream concatenates like stream += stream + if (!vch.empty()) + s.write((char*)&vch[0], vch.size() * sizeof(vch[0])); + } + + template + unsigned int GetSerializeSize(const T& obj) + { + // Tells the size of the object if serialized to this stream + return ::GetSerializeSize(obj, nType, nVersion); + } + + template + CDataStream& operator<<(const T& obj) + { + // Serialize to this stream + ::Serialize(*this, obj, nType, nVersion); + return (*this); + } + + template + CDataStream& operator>>(T& obj) + { + // Unserialize from this stream + ::Unserialize(*this, obj, nType, nVersion); + return (*this); + } + + void GetAndClear(CSerializeData &data) { + data.insert(data.end(), begin(), end()); + clear(); + } +}; + + + + + + + + + + +/** Non-refcounted RAII wrapper for FILE* + * + * Will automatically close the file when it goes out of scope if not null. + * If you're returning the file pointer, return file.release(). + * If you need to close the file early, use file.fclose() instead of fclose(file). + */ +class CAutoFile +{ +private: + // Disallow copies + CAutoFile(const CAutoFile&); + CAutoFile& operator=(const CAutoFile&); + + int nType; + int nVersion; + + FILE* file; + +public: + CAutoFile(FILE* filenew, int nTypeIn, int nVersionIn) + { + file = filenew; + nType = nTypeIn; + nVersion = nVersionIn; + } + + ~CAutoFile() + { + fclose(); + } + + void fclose() + { + if (file) { + ::fclose(file); + file = NULL; + } + } + + /** Get wrapped FILE* with transfer of ownership. + * @note This will invalidate the CAutoFile object, and makes it the responsibility of the caller + * of this function to clean up the returned FILE*. + */ + FILE* release() { FILE* ret = file; file = NULL; return ret; } + + /** Get wrapped FILE* without transfer of ownership. + * @note Ownership of the FILE* will remain with this class. Use this only if the scope of the + * CAutoFile outlives use of the passed pointer. + */ + FILE* Get() const { return file; } + + /** Return true if the wrapped FILE* is NULL, false otherwise. + */ + bool IsNull() const { return (file == NULL); } + + // + // Stream subset + // + void SetType(int n) { nType = n; } + int GetType() { return nType; } + void SetVersion(int n) { nVersion = n; } + int GetVersion() { return nVersion; } + void ReadVersion() { *this >> nVersion; } + void WriteVersion() { *this << nVersion; } + + CAutoFile& read(char* pch, size_t nSize) + { + if (!file) + throw std::ios_base::failure("CAutoFile::read : file handle is NULL"); + if (fread(pch, 1, nSize, file) != nSize) + throw std::ios_base::failure(feof(file) ? "CAutoFile::read : end of file" : "CAutoFile::read : fread failed"); + return (*this); + } + + CAutoFile& write(const char* pch, size_t nSize) + { + if (!file) + throw std::ios_base::failure("CAutoFile::write : file handle is NULL"); + if (fwrite(pch, 1, nSize, file) != nSize) + throw std::ios_base::failure("CAutoFile::write : write failed"); + return (*this); + } + + template + unsigned int GetSerializeSize(const T& obj) + { + // Tells the size of the object if serialized to this stream + return ::GetSerializeSize(obj, nType, nVersion); + } + + template + CAutoFile& operator<<(const T& obj) + { + // Serialize to this stream + if (!file) + throw std::ios_base::failure("CAutoFile::operator<< : file handle is NULL"); + ::Serialize(*this, obj, nType, nVersion); + return (*this); + } + + template + CAutoFile& operator>>(T& obj) + { + // Unserialize from this stream + if (!file) + throw std::ios_base::failure("CAutoFile::operator>> : file handle is NULL"); + ::Unserialize(*this, obj, nType, nVersion); + return (*this); + } +}; + +/** Non-refcounted RAII wrapper around a FILE* that implements a ring buffer to + * deserialize from. It guarantees the ability to rewind a given number of bytes. + * + * Will automatically close the file when it goes out of scope if not null. + * If you need to close the file early, use file.fclose() instead of fclose(file). + */ +class CBufferedFile +{ +private: + // Disallow copies + CBufferedFile(const CBufferedFile&); + CBufferedFile& operator=(const CBufferedFile&); + + int nType; + int nVersion; + + FILE *src; // source file + uint64_t nSrcPos; // how many bytes have been read from source + uint64_t nReadPos; // how many bytes have been read from this + uint64_t nReadLimit; // up to which position we're allowed to read + uint64_t nRewind; // how many bytes we guarantee to rewind + std::vector vchBuf; // the buffer + +protected: + // read data from the source to fill the buffer + bool Fill() { + unsigned int pos = nSrcPos % vchBuf.size(); + unsigned int readNow = vchBuf.size() - pos; + unsigned int nAvail = vchBuf.size() - (nSrcPos - nReadPos) - nRewind; + if (nAvail < readNow) + readNow = nAvail; + if (readNow == 0) + return false; + size_t read = fread((void*)&vchBuf[pos], 1, readNow, src); + if (read == 0) { + throw std::ios_base::failure(feof(src) ? "CBufferedFile::Fill : end of file" : "CBufferedFile::Fill : fread failed"); + } else { + nSrcPos += read; + return true; + } + } + +public: + CBufferedFile(FILE *fileIn, uint64_t nBufSize, uint64_t nRewindIn, int nTypeIn, int nVersionIn) : + nSrcPos(0), nReadPos(0), nReadLimit((uint64_t)(-1)), nRewind(nRewindIn), vchBuf(nBufSize, 0) + { + src = fileIn; + nType = nTypeIn; + nVersion = nVersionIn; + } + + ~CBufferedFile() + { + fclose(); + } + + void fclose() + { + if (src) { + ::fclose(src); + src = NULL; + } + } + + // check whether we're at the end of the source file + bool eof() const { + return nReadPos == nSrcPos && feof(src); + } + + // read a number of bytes + CBufferedFile& read(char *pch, size_t nSize) { + if (nSize + nReadPos > nReadLimit) + throw std::ios_base::failure("Read attempted past buffer limit"); + if (nSize + nRewind > vchBuf.size()) + throw std::ios_base::failure("Read larger than buffer size"); + while (nSize > 0) { + if (nReadPos == nSrcPos) + Fill(); + unsigned int pos = nReadPos % vchBuf.size(); + size_t nNow = nSize; + if (nNow + pos > vchBuf.size()) + nNow = vchBuf.size() - pos; + if (nNow + nReadPos > nSrcPos) + nNow = nSrcPos - nReadPos; + memcpy(pch, &vchBuf[pos], nNow); + nReadPos += nNow; + pch += nNow; + nSize -= nNow; + } + return (*this); + } + + // return the current reading position + uint64_t GetPos() { + return nReadPos; + } + + // rewind to a given reading position + bool SetPos(uint64_t nPos) { + nReadPos = nPos; + if (nReadPos + nRewind < nSrcPos) { + nReadPos = nSrcPos - nRewind; + return false; + } else if (nReadPos > nSrcPos) { + nReadPos = nSrcPos; + return false; + } else { + return true; + } + } + + bool Seek(uint64_t nPos) { + long nLongPos = nPos; + if (nPos != (uint64_t)nLongPos) + return false; + if (fseek(src, nLongPos, SEEK_SET)) + return false; + nLongPos = ftell(src); + nSrcPos = nLongPos; + nReadPos = nLongPos; + return true; + } + + // prevent reading beyond a certain position + // no argument removes the limit + bool SetLimit(uint64_t nPos = (uint64_t)(-1)) { + if (nPos < nReadPos) + return false; + nReadLimit = nPos; + return true; + } + + template + CBufferedFile& operator>>(T& obj) { + // Unserialize from this stream + ::Unserialize(*this, obj, nType, nVersion); + return (*this); + } + + // search for a given byte in the stream, and remain positioned on it + void FindByte(char ch) { + while (true) { + if (nReadPos == nSrcPos) + Fill(); + if (vchBuf[nReadPos % vchBuf.size()] == ch) + break; + nReadPos++; + } + } +}; + +#endif // BITCOIN_STREAMS_H diff --git a/src/test/alert_tests.cpp b/src/test/alert_tests.cpp index 4af87cf8ef..28610f0d2e 100644 --- a/src/test/alert_tests.cpp +++ b/src/test/alert_tests.cpp @@ -10,6 +10,7 @@ #include "data/alertTests.raw.h" #include "serialize.h" +#include "streams.h" #include "util.h" #include "utilstrencodings.h" #include "version.h" diff --git a/src/test/serialize_tests.cpp b/src/test/serialize_tests.cpp index 867a7df888..59e95f2fd1 100644 --- a/src/test/serialize_tests.cpp +++ b/src/test/serialize_tests.cpp @@ -3,6 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "serialize.h" +#include "streams.h" #include diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 4522c63617..b0d6b4aefa 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -6,6 +6,7 @@ #include "txmempool.h" #include "core.h" +#include "streams.h" #include "util.h" #include "utilmoneystr.h" #include "version.h" diff --git a/src/txmempool.h b/src/txmempool.h index ad190eea9d..85cf5310ff 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -12,6 +12,8 @@ #include "core.h" #include "sync.h" +class CAutoFile; + inline bool AllowFree(double dPriority) { // Large (in bytes) low-priority (new, small-coin) transactions From 214091d584506f23b1c02e9c8a280d5b04791d7f Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Thu, 23 Oct 2014 09:48:19 +0800 Subject: [PATCH 0904/1288] Update license in pull-tester and rpc-tests Add missing copyright/license header where necessary --- qa/pull-tester/build-tests.sh.in | 4 ++-- qa/pull-tester/pull-tester.py | 4 ++-- qa/pull-tester/pull-tester.sh | 4 ++-- qa/pull-tester/run-bitcoind-for-test.sh.in | 4 ++-- qa/rpc-tests/conflictedbalance.sh | 2 +- qa/rpc-tests/forknotify.py | 2 +- qa/rpc-tests/getblocktemplate.py | 2 +- qa/rpc-tests/getchaintips.py | 2 +- qa/rpc-tests/keypool.py | 2 +- qa/rpc-tests/listtransactions.py | 2 +- qa/rpc-tests/netutil.py | 5 +++++ qa/rpc-tests/receivedby.py | 2 +- qa/rpc-tests/rpcbind_test.py | 2 +- qa/rpc-tests/send.sh | 2 +- qa/rpc-tests/smartfees.py | 3 +++ qa/rpc-tests/test_framework.py | 2 +- qa/rpc-tests/txnmall.sh | 2 +- qa/rpc-tests/util.py | 2 +- qa/rpc-tests/util.sh | 2 +- qa/rpc-tests/wallet.sh | 2 +- qa/rpc-tests/walletbackup.sh | 2 +- qa/rpc-tests/zapwallettxes.sh | 3 +++ 22 files changed, 34 insertions(+), 23 deletions(-) diff --git a/qa/pull-tester/build-tests.sh.in b/qa/pull-tester/build-tests.sh.in index 1ef47d77f4..f5c5f0bf70 100755 --- a/qa/pull-tester/build-tests.sh.in +++ b/qa/pull-tester/build-tests.sh.in @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2013 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Copyright (c) 2013-2014 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Param1: The prefix to mingw staging diff --git a/qa/pull-tester/pull-tester.py b/qa/pull-tester/pull-tester.py index 61ce813d80..66688dd4b5 100755 --- a/qa/pull-tester/pull-tester.py +++ b/qa/pull-tester/pull-tester.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (c) 2013 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Copyright (c) 2013-2014 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import json diff --git a/qa/pull-tester/pull-tester.sh b/qa/pull-tester/pull-tester.sh index d3356f736a..3fe4a05c76 100755 --- a/qa/pull-tester/pull-tester.sh +++ b/qa/pull-tester/pull-tester.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (c) 2013 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Copyright (c) 2013-2014 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Helper script for pull-tester. diff --git a/qa/pull-tester/run-bitcoind-for-test.sh.in b/qa/pull-tester/run-bitcoind-for-test.sh.in index 15363d09a6..42d8ad52e8 100755 --- a/qa/pull-tester/run-bitcoind-for-test.sh.in +++ b/qa/pull-tester/run-bitcoind-for-test.sh.in @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2013 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Copyright (c) 2013-2014 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # DATADIR="@abs_top_builddir@/.bitcoin" diff --git a/qa/rpc-tests/conflictedbalance.sh b/qa/rpc-tests/conflictedbalance.sh index 849ad31fb8..71761321ed 100755 --- a/qa/rpc-tests/conflictedbalance.sh +++ b/qa/rpc-tests/conflictedbalance.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Copyright (c) 2014 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Test marking of spent outputs diff --git a/qa/rpc-tests/forknotify.py b/qa/rpc-tests/forknotify.py index a482f7cc5a..772f9a035b 100755 --- a/qa/rpc-tests/forknotify.py +++ b/qa/rpc-tests/forknotify.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # Copyright (c) 2014 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # diff --git a/qa/rpc-tests/getblocktemplate.py b/qa/rpc-tests/getblocktemplate.py index 8d97719ec3..828373f9a5 100755 --- a/qa/rpc-tests/getblocktemplate.py +++ b/qa/rpc-tests/getblocktemplate.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # Copyright (c) 2014 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the listtransactions API diff --git a/qa/rpc-tests/getchaintips.py b/qa/rpc-tests/getchaintips.py index a83c499743..a2019917d6 100755 --- a/qa/rpc-tests/getchaintips.py +++ b/qa/rpc-tests/getchaintips.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # Copyright (c) 2014 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the getchaintips API. diff --git a/qa/rpc-tests/keypool.py b/qa/rpc-tests/keypool.py index 86ad20de52..354ee0822c 100755 --- a/qa/rpc-tests/keypool.py +++ b/qa/rpc-tests/keypool.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # Copyright (c) 2014 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the wallet keypool, and interaction with wallet encryption/locking diff --git a/qa/rpc-tests/listtransactions.py b/qa/rpc-tests/listtransactions.py index 50385b4372..fdc6c6e452 100755 --- a/qa/rpc-tests/listtransactions.py +++ b/qa/rpc-tests/listtransactions.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # Copyright (c) 2014 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the listtransactions API diff --git a/qa/rpc-tests/netutil.py b/qa/rpc-tests/netutil.py index 9bea2e355e..b740ee0f98 100644 --- a/qa/rpc-tests/netutil.py +++ b/qa/rpc-tests/netutil.py @@ -1,3 +1,8 @@ +#!/usr/bin/env python +# Copyright (c) 2014 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + # Linux network utilities import sys import socket diff --git a/qa/rpc-tests/receivedby.py b/qa/rpc-tests/receivedby.py index 61f5e0452b..c3c387db72 100755 --- a/qa/rpc-tests/receivedby.py +++ b/qa/rpc-tests/receivedby.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # Copyright (c) 2014 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the listreceivedbyaddress API diff --git a/qa/rpc-tests/rpcbind_test.py b/qa/rpc-tests/rpcbind_test.py index a823404e00..5e476e2505 100755 --- a/qa/rpc-tests/rpcbind_test.py +++ b/qa/rpc-tests/rpcbind_test.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # Copyright (c) 2014 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Test for -rpcbind, as well as -rpcallowip and -rpcconnect diff --git a/qa/rpc-tests/send.sh b/qa/rpc-tests/send.sh index 37367865c1..2d54cc6ded 100755 --- a/qa/rpc-tests/send.sh +++ b/qa/rpc-tests/send.sh @@ -1,6 +1,6 @@ #!/bin/bash # Copyright (c) 2014 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. TIMEOUT=10 SIGNAL=HUP diff --git a/qa/rpc-tests/smartfees.py b/qa/rpc-tests/smartfees.py index 352a1de2d0..405cbb4412 100755 --- a/qa/rpc-tests/smartfees.py +++ b/qa/rpc-tests/smartfees.py @@ -1,4 +1,7 @@ #!/usr/bin/env python +# Copyright (c) 2014 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test fee estimation code diff --git a/qa/rpc-tests/test_framework.py b/qa/rpc-tests/test_framework.py index 5a18556655..be56c45b25 100755 --- a/qa/rpc-tests/test_framework.py +++ b/qa/rpc-tests/test_framework.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # Copyright (c) 2014 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Base class for RPC testing diff --git a/qa/rpc-tests/txnmall.sh b/qa/rpc-tests/txnmall.sh index bd36967a63..035e7ee15f 100755 --- a/qa/rpc-tests/txnmall.sh +++ b/qa/rpc-tests/txnmall.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Copyright (c) 2014 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Test proper accounting with malleable transactions diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index 87baadc5d6..f111839dee 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -1,5 +1,5 @@ # Copyright (c) 2014 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Helpful routines for regression testing diff --git a/qa/rpc-tests/util.sh b/qa/rpc-tests/util.sh index b726ef627f..c2b7004308 100644 --- a/qa/rpc-tests/util.sh +++ b/qa/rpc-tests/util.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Copyright (c) 2014 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Functions used by more than one test diff --git a/qa/rpc-tests/wallet.sh b/qa/rpc-tests/wallet.sh index 98532fa858..bb5f34f590 100755 --- a/qa/rpc-tests/wallet.sh +++ b/qa/rpc-tests/wallet.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Copyright (c) 2013-2014 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Test block generation and basic wallet sending diff --git a/qa/rpc-tests/walletbackup.sh b/qa/rpc-tests/walletbackup.sh index b88d5920f7..ee11418bef 100755 --- a/qa/rpc-tests/walletbackup.sh +++ b/qa/rpc-tests/walletbackup.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Copyright (c) 2014 The Bitcoin Core developers -# Distributed under the MIT/X11 software license, see the accompanying +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Test wallet backup / dump / restore functionality diff --git a/qa/rpc-tests/zapwallettxes.sh b/qa/rpc-tests/zapwallettxes.sh index bc52a7dacd..e6d490cccc 100755 --- a/qa/rpc-tests/zapwallettxes.sh +++ b/qa/rpc-tests/zapwallettxes.sh @@ -1,4 +1,7 @@ #!/usr/bin/env bash +# Copyright (c) 2014 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. # Test -zapwallettxes= From c8a25189bcb1381eddf46b9a9743ba48e929439e Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 23 Oct 2014 13:24:58 +0200 Subject: [PATCH 0905/1288] doc: release notes update for `rpcallowip` syntax change --- doc/release-notes.md | 46 +++++++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/doc/release-notes.md b/doc/release-notes.md index de13daf3e4..169ad71a0f 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -34,29 +34,53 @@ confirmation times. Prior releases used hard-coded fees (and priorities), and would sometimes create transactions that took a very long time to confirm. +Statistics used to estimate fees and priorities are saved in the +data directory in the `fee_estimates.dat` file just before +program shutdown, and are read in at startup. New Command Line Options -======================== +--------------------------- --txconfirmtarget=n : create transactions that have enough fees (or priority) +- `-txconfirmtarget=n` : create transactions that have enough fees (or priority) so they are likely to confirm within n blocks (default: 1). This setting is over-ridden by the -paytxfee option. New RPC methods -=============== +---------------- -Fee/Priority estimation ------------------------ - -estimatefee nblocks : Returns approximate fee-per-1,000-bytes needed for +- `estimatefee nblocks` : Returns approximate fee-per-1,000-bytes needed for a transaction to be confirmed within nblocks. Returns -1 if not enough transactions have been observed to compute a good estimate. -estimatepriority nblocks : Returns approximate priority needed for +- `estimatepriority nblocks` : Returns approximate priority needed for a zero-fee transaction to confirm within nblocks. Returns -1 if not enough free transactions have been observed to compute a good estimate. -Statistics used to estimate fees and priorities are saved in the -data directory in the 'fee_estimates.dat' file just before -program shutdown, and are read in at startup. +RPC access control changes +========================================== + +Subnet matching for the purpose of access control is now done +by matching the binary network address, instead of with string wildcard matching. +For the user this means that `-rpcallowip` takes a subnet specification, which can be + +- a single IP address (e.g. `1.2.3.4` or `fe80::0012:3456:789a:bcde`) +- a network/CIDR (e.g. `1.2.3.0/24` or `fe80::0000/64`) +- a network/netmask (e.g. `1.2.3.4/255.255.255.0` or `fe80::0012:3456:789a:bcde/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff`) + +An arbitrary number of `-rpcallow` arguments can be given. An incoming connection will be accepted if its origin address +matches one of them. + +For example: + +| 0.9.x and before | 0.10.x | +|--------------------------------------------|---------------------------------------| +| `-rpcallowip=192.168.1.1` | `-rpcallowip=192.168.1.1` (unchanged) | +| `-rpcallowip=192.168.1.*` | `-rpcallowip=192.168.1.0/24` | +| `-rpcallowip=192.168.*` | `-rpcallowip=192.168.0.0/16` | +| `-rpcallowip=*` (dangerous!) | `-rpcallowip=::/0` | + +Using wildcards will result in the rule being rejected with the following error in debug.log: + + Error: Invalid -rpcallowip subnet specification: *. Valid are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). + From d2833de42430b7771eb572d71ba81eec1079f91f Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 23 Oct 2014 19:08:10 +0200 Subject: [PATCH 0906/1288] qt: remove monitoreddatamapper We haven't used the viewModified signal in ages, so we can use a normal QDataWidgetMapper. --- src/Makefile.qt.include | 3 --- src/qt/monitoreddatamapper.cpp | 39 ---------------------------------- src/qt/monitoreddatamapper.h | 34 ----------------------------- src/qt/optionsdialog.cpp | 4 ++-- src/qt/optionsdialog.h | 4 ++-- 5 files changed, 4 insertions(+), 80 deletions(-) delete mode 100644 src/qt/monitoreddatamapper.cpp delete mode 100644 src/qt/monitoreddatamapper.h diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index f8f4439159..8fb4af81ac 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -110,7 +110,6 @@ QT_MOC_CPP = \ qt/moc_intro.cpp \ qt/moc_macdockiconhandler.cpp \ qt/moc_macnotificationhandler.cpp \ - qt/moc_monitoreddatamapper.cpp \ qt/moc_notificator.cpp \ qt/moc_openuridialog.cpp \ qt/moc_optionsdialog.cpp \ @@ -177,7 +176,6 @@ BITCOIN_QT_H = \ qt/intro.h \ qt/macdockiconhandler.h \ qt/macnotificationhandler.h \ - qt/monitoreddatamapper.h \ qt/networkstyle.h \ qt/notificator.h \ qt/openuridialog.h \ @@ -269,7 +267,6 @@ BITCOIN_QT_CPP = \ qt/csvmodelwriter.cpp \ qt/guiutil.cpp \ qt/intro.cpp \ - qt/monitoreddatamapper.cpp \ qt/networkstyle.cpp \ qt/notificator.cpp \ qt/optionsdialog.cpp \ diff --git a/src/qt/monitoreddatamapper.cpp b/src/qt/monitoreddatamapper.cpp deleted file mode 100644 index 5931c53872..0000000000 --- a/src/qt/monitoreddatamapper.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2011-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "monitoreddatamapper.h" - -#include -#include -#include - -MonitoredDataMapper::MonitoredDataMapper(QObject *parent) : - QDataWidgetMapper(parent) -{ -} - -void MonitoredDataMapper::addMapping(QWidget *widget, int section) -{ - QDataWidgetMapper::addMapping(widget, section); - addChangeMonitor(widget); -} - -void MonitoredDataMapper::addMapping(QWidget *widget, int section, const QByteArray &propertyName) -{ - QDataWidgetMapper::addMapping(widget, section, propertyName); - addChangeMonitor(widget); -} - -void MonitoredDataMapper::addChangeMonitor(QWidget *widget) -{ - // Watch user property of widget for changes, and connect - // the signal to our viewModified signal. - QMetaProperty prop = widget->metaObject()->userProperty(); - int signal = prop.notifySignalIndex(); - int method = this->metaObject()->indexOfMethod("viewModified()"); - if(signal != -1 && method != -1) - { - QMetaObject::connect(widget, signal, this, method); - } -} diff --git a/src/qt/monitoreddatamapper.h b/src/qt/monitoreddatamapper.h deleted file mode 100644 index b3237d3e09..0000000000 --- a/src/qt/monitoreddatamapper.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2011-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef MONITOREDDATAMAPPER_H -#define MONITOREDDATAMAPPER_H - -#include - -QT_BEGIN_NAMESPACE -class QWidget; -QT_END_NAMESPACE - -/** Data to Widget mapper that watches for edits and notifies listeners when a field is edited. - This can be used, for example, to enable a commit/apply button in a configuration dialog. - */ -class MonitoredDataMapper : public QDataWidgetMapper -{ - Q_OBJECT - -public: - explicit MonitoredDataMapper(QObject *parent=0); - - void addMapping(QWidget *widget, int section); - void addMapping(QWidget *widget, int section, const QByteArray &propertyName); - -private: - void addChangeMonitor(QWidget *widget); - -signals: - void viewModified(); -}; - -#endif // MONITOREDDATAMAPPER_H diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 279467129f..67be174d55 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -11,7 +11,6 @@ #include "bitcoinunits.h" #include "guiutil.h" -#include "monitoreddatamapper.h" #include "optionsmodel.h" #include "main.h" // for MAX_SCRIPTCHECK_THREADS @@ -24,6 +23,7 @@ #include +#include #include #include #include @@ -105,7 +105,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) : #endif /* Widget-to-option mapper */ - mapper = new MonitoredDataMapper(this); + mapper = new QDataWidgetMapper(this); mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit); mapper->setOrientation(Qt::Vertical); diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h index 6b62069660..39c53f4391 100644 --- a/src/qt/optionsdialog.h +++ b/src/qt/optionsdialog.h @@ -7,7 +7,7 @@ #include -class MonitoredDataMapper; +class QDataWidgetMapper; class OptionsModel; class QValidatedLineEdit; @@ -52,7 +52,7 @@ signals: private: Ui::OptionsDialog *ui; OptionsModel *model; - MonitoredDataMapper *mapper; + QDataWidgetMapper *mapper; bool fProxyIpValid; }; From 3a757c52947a5a1beefb456ca7d3ebab7a5a14a2 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 23 Oct 2014 14:24:22 -0400 Subject: [PATCH 0907/1288] fix build with libc++ after 85c579e --- src/script/script.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/script/script.h b/src/script/script.h index a68924c73a..d450db5cad 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -12,6 +12,7 @@ #include #include #include +#include #include static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; // bytes From c772f4cb04aa2edc04d849039b07c5a454d3f666 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Fri, 24 Oct 2014 11:23:14 +0800 Subject: [PATCH 0908/1288] Add doc/doxygen to .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 9f1b2a4695..bafc5919c1 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,5 @@ qa/pull-tester/run-bitcoind-for-test.sh qa/pull-tester/build-tests.sh !src/leveldb*/Makefile + +/doc/doxygen/ From dcb98466b4f8193fc28656d17b2317f21665fa3a Mon Sep 17 00:00:00 2001 From: Daniel Kraft Date: Mon, 20 Oct 2014 14:14:04 +0200 Subject: [PATCH 0909/1288] Extend getchaintips RPC test. Add the capability to simulate network splits to the RPC test framework and use it to do more extensive testing of 'getchaintips'. --- qa/rpc-tests/forknotify.py | 35 ++++++++-------- qa/rpc-tests/getblocktemplate.py | 20 ++++----- qa/rpc-tests/getchaintips.py | 50 ++++++++++++++++++----- qa/rpc-tests/listtransactions.py | 50 ++++++++++++----------- qa/rpc-tests/receivedby.py | 68 +++++++++++++++---------------- qa/rpc-tests/smartfees.py | 48 +++++++++++----------- qa/rpc-tests/test_framework.py | 69 +++++++++++++++++++++++++------- 7 files changed, 206 insertions(+), 134 deletions(-) diff --git a/qa/rpc-tests/forknotify.py b/qa/rpc-tests/forknotify.py index a482f7cc5a..23bfb74175 100755 --- a/qa/rpc-tests/forknotify.py +++ b/qa/rpc-tests/forknotify.py @@ -17,31 +17,30 @@ class ForkNotifyTest(BitcoinTestFramework): alert_filename = None # Set by setup_network - def setup_network(self, test_dir): - nodes = [] - self.alert_filename = os.path.join(test_dir, "alert.txt") + def setup_network(self): + self.nodes = [] + self.alert_filename = os.path.join(self.options.tmpdir, "alert.txt") with open(self.alert_filename, 'w') as f: pass # Just open then close to create zero-length file - nodes.append(start_node(0, test_dir, + self.nodes.append(start_node(0, self.options.tmpdir, ["-blockversion=2", "-alertnotify=echo %s >> '" + self.alert_filename + "'"])) # Node1 mines block.version=211 blocks - nodes.append(start_node(1, test_dir, + self.nodes.append(start_node(1, self.options.tmpdir, ["-blockversion=211"])) - connect_nodes(nodes[1], 0) + connect_nodes(self.nodes[1], 0) - sync_blocks(nodes) - return nodes - + self.is_network_split = False + self.sync_all() - def run_test(self, nodes): + def run_test(self): # Mine 51 up-version blocks - nodes[1].setgenerate(True, 51) - sync_blocks(nodes) + self.nodes[1].setgenerate(True, 51) + self.sync_all() # -alertnotify should trigger on the 51'st, # but mine and sync another to give # -alertnotify time to write - nodes[1].setgenerate(True, 1) - sync_blocks(nodes) + self.nodes[1].setgenerate(True, 1) + self.sync_all() with open(self.alert_filename, 'r') as f: alert_text = f.read() @@ -50,10 +49,10 @@ class ForkNotifyTest(BitcoinTestFramework): raise AssertionError("-alertnotify did not warn of up-version blocks") # Mine more up-version blocks, should not get more alerts: - nodes[1].setgenerate(True, 1) - sync_blocks(nodes) - nodes[1].setgenerate(True, 1) - sync_blocks(nodes) + self.nodes[1].setgenerate(True, 1) + self.sync_all() + self.nodes[1].setgenerate(True, 1) + self.sync_all() with open(self.alert_filename, 'r') as f: alert_text2 = f.read() diff --git a/qa/rpc-tests/getblocktemplate.py b/qa/rpc-tests/getblocktemplate.py index 8d97719ec3..5ae5d09601 100755 --- a/qa/rpc-tests/getblocktemplate.py +++ b/qa/rpc-tests/getblocktemplate.py @@ -51,40 +51,40 @@ class GetBlockTemplateTest(BitcoinTestFramework): Test longpolling with getblocktemplate. ''' - def run_test(self, nodes): + def run_test(self): print "Warning: this test will take about 70 seconds in the best case. Be patient." - nodes[0].setgenerate(True, 10) - templat = nodes[0].getblocktemplate() + self.nodes[0].setgenerate(True, 10) + templat = self.nodes[0].getblocktemplate() longpollid = templat['longpollid'] # longpollid should not change between successive invocations if nothing else happens - templat2 = nodes[0].getblocktemplate() + templat2 = self.nodes[0].getblocktemplate() assert(templat2['longpollid'] == longpollid) # Test 1: test that the longpolling wait if we do nothing - thr = LongpollThread(nodes[0]) + thr = LongpollThread(self.nodes[0]) thr.start() # check that thread still lives thr.join(5) # wait 5 seconds or until thread exits assert(thr.is_alive()) # Test 2: test that longpoll will terminate if another node generates a block - nodes[1].setgenerate(True, 1) # generate a block on another node + self.nodes[1].setgenerate(True, 1) # generate a block on another node # check that thread will exit now that new transaction entered mempool thr.join(5) # wait 5 seconds or until thread exits assert(not thr.is_alive()) # Test 3: test that longpoll will terminate if we generate a block ourselves - thr = LongpollThread(nodes[0]) + thr = LongpollThread(self.nodes[0]) thr.start() - nodes[0].setgenerate(True, 1) # generate a block on another node + self.nodes[0].setgenerate(True, 1) # generate a block on another node thr.join(5) # wait 5 seconds or until thread exits assert(not thr.is_alive()) # Test 4: test that introducing a new transaction into the mempool will terminate the longpoll - thr = LongpollThread(nodes[0]) + thr = LongpollThread(self.nodes[0]) thr.start() # generate a random transaction and submit it - (txid, txhex, fee) = random_transaction(nodes, Decimal("1.1"), Decimal("0.0"), Decimal("0.001"), 20) + (txid, txhex, fee) = random_transaction(self.nodes, Decimal("1.1"), Decimal("0.0"), Decimal("0.001"), 20) # after one minute, every 10 seconds the mempool is probed, so in 80 seconds it should have returned thr.join(60 + 20) assert(not thr.is_alive()) diff --git a/qa/rpc-tests/getchaintips.py b/qa/rpc-tests/getchaintips.py index a83c499743..842fcad2b2 100755 --- a/qa/rpc-tests/getchaintips.py +++ b/qa/rpc-tests/getchaintips.py @@ -3,22 +3,52 @@ # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -# Exercise the getchaintips API. - -# Since the test framework does not generate orphan blocks, we can -# unfortunately not check for them! +# Exercise the getchaintips API. We introduce a network split, work +# on chains of different lengths, and join the network together again. +# This gives us two tips, verify that it works. from test_framework import BitcoinTestFramework from util import assert_equal class GetChainTipsTest (BitcoinTestFramework): - def run_test (self, nodes): - res = nodes[0].getchaintips () - assert_equal (len (res), 1) - res = res[0] - assert_equal (res['branchlen'], 0) - assert_equal (res['height'], 200) + def run_test (self): + BitcoinTestFramework.run_test (self) + + tips = self.nodes[0].getchaintips () + assert_equal (len (tips), 1) + assert_equal (tips[0]['branchlen'], 0) + assert_equal (tips[0]['height'], 200) + + # Split the network and build two chains of different lengths. + self.split_network () + self.nodes[0].setgenerate (True, 10); + self.nodes[2].setgenerate (True, 20); + self.sync_all () + + tips = self.nodes[1].getchaintips () + assert_equal (len (tips), 1) + shortTip = tips[0] + assert_equal (shortTip['branchlen'], 0) + assert_equal (shortTip['height'], 210) + + tips = self.nodes[3].getchaintips () + assert_equal (len (tips), 1) + longTip = tips[0] + assert_equal (longTip['branchlen'], 0) + assert_equal (longTip['height'], 220) + + # Join the network halves and check that we now have two tips + # (at least at the nodes that previously had the short chain). + self.join_network () + + tips = self.nodes[0].getchaintips () + assert_equal (len (tips), 2) + assert_equal (tips[0], longTip) + + assert_equal (tips[1]['branchlen'], 10) + tips[1]['branchlen'] = 0; + assert_equal (tips[1], shortTip) if __name__ == '__main__': GetChainTipsTest ().main () diff --git a/qa/rpc-tests/listtransactions.py b/qa/rpc-tests/listtransactions.py index 50385b4372..6102052a6f 100755 --- a/qa/rpc-tests/listtransactions.py +++ b/qa/rpc-tests/listtransactions.py @@ -33,62 +33,64 @@ def check_array_result(object_array, to_match, expected): class ListTransactionsTest(BitcoinTestFramework): - def run_test(self, nodes): + def run_test(self): # Simple send, 0 to 1: - txid = nodes[0].sendtoaddress(nodes[1].getnewaddress(), 0.1) - sync_mempools(nodes) - check_array_result(nodes[0].listtransactions(), + txid = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.1) + self.sync_all() + check_array_result(self.nodes[0].listtransactions(), {"txid":txid}, {"category":"send","account":"","amount":Decimal("-0.1"),"confirmations":0}) - check_array_result(nodes[1].listtransactions(), + check_array_result(self.nodes[1].listtransactions(), {"txid":txid}, {"category":"receive","account":"","amount":Decimal("0.1"),"confirmations":0}) # mine a block, confirmations should change: - nodes[0].setgenerate(True, 1) - sync_blocks(nodes) - check_array_result(nodes[0].listtransactions(), + self.nodes[0].setgenerate(True, 1) + self.sync_all() + check_array_result(self.nodes[0].listtransactions(), {"txid":txid}, {"category":"send","account":"","amount":Decimal("-0.1"),"confirmations":1}) - check_array_result(nodes[1].listtransactions(), + check_array_result(self.nodes[1].listtransactions(), {"txid":txid}, {"category":"receive","account":"","amount":Decimal("0.1"),"confirmations":1}) # send-to-self: - txid = nodes[0].sendtoaddress(nodes[0].getnewaddress(), 0.2) - check_array_result(nodes[0].listtransactions(), + txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 0.2) + check_array_result(self.nodes[0].listtransactions(), {"txid":txid, "category":"send"}, {"amount":Decimal("-0.2")}) - check_array_result(nodes[0].listtransactions(), + check_array_result(self.nodes[0].listtransactions(), {"txid":txid, "category":"receive"}, {"amount":Decimal("0.2")}) # sendmany from node1: twice to self, twice to node2: - send_to = { nodes[0].getnewaddress() : 0.11, nodes[1].getnewaddress() : 0.22, - nodes[0].getaccountaddress("from1") : 0.33, nodes[1].getaccountaddress("toself") : 0.44 } - txid = nodes[1].sendmany("", send_to) - sync_mempools(nodes) - check_array_result(nodes[1].listtransactions(), + send_to = { self.nodes[0].getnewaddress() : 0.11, + self.nodes[1].getnewaddress() : 0.22, + self.nodes[0].getaccountaddress("from1") : 0.33, + self.nodes[1].getaccountaddress("toself") : 0.44 } + txid = self.nodes[1].sendmany("", send_to) + self.sync_all() + check_array_result(self.nodes[1].listtransactions(), {"category":"send","amount":Decimal("-0.11")}, {"txid":txid} ) - check_array_result(nodes[0].listtransactions(), + check_array_result(self.nodes[0].listtransactions(), {"category":"receive","amount":Decimal("0.11")}, {"txid":txid} ) - check_array_result(nodes[1].listtransactions(), + check_array_result(self.nodes[1].listtransactions(), {"category":"send","amount":Decimal("-0.22")}, {"txid":txid} ) - check_array_result(nodes[1].listtransactions(), + check_array_result(self.nodes[1].listtransactions(), {"category":"receive","amount":Decimal("0.22")}, {"txid":txid} ) - check_array_result(nodes[1].listtransactions(), + check_array_result(self.nodes[1].listtransactions(), {"category":"send","amount":Decimal("-0.33")}, {"txid":txid} ) - check_array_result(nodes[0].listtransactions(), + check_array_result(self.nodes[0].listtransactions(), {"category":"receive","amount":Decimal("0.33")}, {"txid":txid, "account" : "from1"} ) - check_array_result(nodes[1].listtransactions(), + check_array_result(self.nodes[1].listtransactions(), {"category":"send","amount":Decimal("-0.44")}, {"txid":txid, "account" : ""} ) - check_array_result(nodes[1].listtransactions(), + check_array_result(self.nodes[1].listtransactions(), {"category":"receive","amount":Decimal("0.44")}, {"txid":txid, "account" : "toself"} ) diff --git a/qa/rpc-tests/receivedby.py b/qa/rpc-tests/receivedby.py index 61f5e0452b..7170255242 100755 --- a/qa/rpc-tests/receivedby.py +++ b/qa/rpc-tests/receivedby.py @@ -54,36 +54,36 @@ def check_array_result(object_array, to_match, expected, should_not_find = False class ReceivedByTest(BitcoinTestFramework): - def run_test(self, nodes): + def run_test(self): ''' listreceivedbyaddress Test ''' # Send from node 0 to 1 - addr = nodes[1].getnewaddress() - txid = nodes[0].sendtoaddress(addr, 0.1) - sync_mempools(nodes) + addr = self.nodes[1].getnewaddress() + txid = self.nodes[0].sendtoaddress(addr, 0.1) + self.sync_all() #Check not listed in listreceivedbyaddress because has 0 confirmations - check_array_result(nodes[1].listreceivedbyaddress(), + check_array_result(self.nodes[1].listreceivedbyaddress(), {"address":addr}, { }, True) #Bury Tx under 10 block so it will be returned by listreceivedbyaddress - nodes[1].setgenerate(True, 10) - sync_blocks(nodes) - check_array_result(nodes[1].listreceivedbyaddress(), + self.nodes[1].setgenerate(True, 10) + self.sync_all() + check_array_result(self.nodes[1].listreceivedbyaddress(), {"address":addr}, {"address":addr, "account":"", "amount":Decimal("0.1"), "confirmations":10, "txids":[txid,]}) #With min confidence < 10 - check_array_result(nodes[1].listreceivedbyaddress(5), + check_array_result(self.nodes[1].listreceivedbyaddress(5), {"address":addr}, {"address":addr, "account":"", "amount":Decimal("0.1"), "confirmations":10, "txids":[txid,]}) #With min confidence > 10, should not find Tx - check_array_result(nodes[1].listreceivedbyaddress(11),{"address":addr},{ },True) + check_array_result(self.nodes[1].listreceivedbyaddress(11),{"address":addr},{ },True) #Empty Tx - addr = nodes[1].getnewaddress() - check_array_result(nodes[1].listreceivedbyaddress(0,True), + addr = self.nodes[1].getnewaddress() + check_array_result(self.nodes[1].listreceivedbyaddress(0,True), {"address":addr}, {"address":addr, "account":"", "amount":0, "confirmations":0, "txids":[]}) @@ -91,24 +91,24 @@ class ReceivedByTest(BitcoinTestFramework): getreceivedbyaddress Test ''' # Send from node 0 to 1 - addr = nodes[1].getnewaddress() - txid = nodes[0].sendtoaddress(addr, 0.1) - sync_mempools(nodes) + addr = self.nodes[1].getnewaddress() + txid = self.nodes[0].sendtoaddress(addr, 0.1) + self.sync_all() #Check balance is 0 because of 0 confirmations - balance = nodes[1].getreceivedbyaddress(addr) + balance = self.nodes[1].getreceivedbyaddress(addr) if balance != Decimal("0.0"): raise AssertionError("Wrong balance returned by getreceivedbyaddress, %0.2f"%(balance)) #Check balance is 0.1 - balance = nodes[1].getreceivedbyaddress(addr,0) + balance = self.nodes[1].getreceivedbyaddress(addr,0) if balance != Decimal("0.1"): raise AssertionError("Wrong balance returned by getreceivedbyaddress, %0.2f"%(balance)) #Bury Tx under 10 block so it will be returned by the default getreceivedbyaddress - nodes[1].setgenerate(True, 10) - sync_blocks(nodes) - balance = nodes[1].getreceivedbyaddress(addr) + self.nodes[1].setgenerate(True, 10) + self.sync_all() + balance = self.nodes[1].getreceivedbyaddress(addr) if balance != Decimal("0.1"): raise AssertionError("Wrong balance returned by getreceivedbyaddress, %0.2f"%(balance)) @@ -116,40 +116,40 @@ class ReceivedByTest(BitcoinTestFramework): listreceivedbyaccount + getreceivedbyaccount Test ''' #set pre-state - addrArr = nodes[1].getnewaddress() - account = nodes[1].getaccount(addrArr) - received_by_account_json = get_sub_array_from_array(nodes[1].listreceivedbyaccount(),{"account":account}) + addrArr = self.nodes[1].getnewaddress() + account = self.nodes[1].getaccount(addrArr) + received_by_account_json = get_sub_array_from_array(self.nodes[1].listreceivedbyaccount(),{"account":account}) if len(received_by_account_json) == 0: raise AssertionError("No accounts found in node") - balance_by_account = rec_by_accountArr = nodes[1].getreceivedbyaccount(account) + balance_by_account = rec_by_accountArr = self.nodes[1].getreceivedbyaccount(account) - txid = nodes[0].sendtoaddress(addr, 0.1) + txid = self.nodes[0].sendtoaddress(addr, 0.1) # listreceivedbyaccount should return received_by_account_json because of 0 confirmations - check_array_result(nodes[1].listreceivedbyaccount(), + check_array_result(self.nodes[1].listreceivedbyaccount(), {"account":account}, received_by_account_json) # getreceivedbyaddress should return same balance because of 0 confirmations - balance = nodes[1].getreceivedbyaccount(account) + balance = self.nodes[1].getreceivedbyaccount(account) if balance != balance_by_account: raise AssertionError("Wrong balance returned by getreceivedbyaccount, %0.2f"%(balance)) - nodes[1].setgenerate(True, 10) - sync_blocks(nodes) + self.nodes[1].setgenerate(True, 10) + self.sync_all() # listreceivedbyaccount should return updated account balance - check_array_result(nodes[1].listreceivedbyaccount(), + check_array_result(self.nodes[1].listreceivedbyaccount(), {"account":account}, {"account":received_by_account_json["account"], "amount":(received_by_account_json["amount"] + Decimal("0.1"))}) # getreceivedbyaddress should return updates balance - balance = nodes[1].getreceivedbyaccount(account) + balance = self.nodes[1].getreceivedbyaccount(account) if balance != balance_by_account + Decimal("0.1"): raise AssertionError("Wrong balance returned by getreceivedbyaccount, %0.2f"%(balance)) #Create a new account named "mynewaccount" that has a 0 balance - nodes[1].getaccountaddress("mynewaccount") - received_by_account_json = get_sub_array_from_array(nodes[1].listreceivedbyaccount(0,True),{"account":"mynewaccount"}) + self.nodes[1].getaccountaddress("mynewaccount") + received_by_account_json = get_sub_array_from_array(self.nodes[1].listreceivedbyaccount(0,True),{"account":"mynewaccount"}) if len(received_by_account_json) == 0: raise AssertionError("No accounts found in node") @@ -158,7 +158,7 @@ class ReceivedByTest(BitcoinTestFramework): raise AssertionError("Wrong balance returned by listreceivedbyaccount, %0.2f"%(received_by_account_json["amount"])) # Test getreceivedbyaccount for 0 amount accounts - balance = nodes[1].getreceivedbyaccount("mynewaccount") + balance = self.nodes[1].getreceivedbyaccount("mynewaccount") if balance != Decimal("0.0"): raise AssertionError("Wrong balance returned by getreceivedbyaccount, %0.2f"%(balance)) diff --git a/qa/rpc-tests/smartfees.py b/qa/rpc-tests/smartfees.py index 352a1de2d0..065bdb01c3 100755 --- a/qa/rpc-tests/smartfees.py +++ b/qa/rpc-tests/smartfees.py @@ -10,48 +10,48 @@ from util import * class EstimateFeeTest(BitcoinTestFramework): - def setup_network(self, test_dir): - nodes = [] - nodes.append(start_node(0, test_dir, + def setup_network(self): + self.nodes = [] + self.nodes.append(start_node(0, self.options.tmpdir, ["-debug=mempool", "-debug=estimatefee"])) # Node1 mines small-but-not-tiny blocks, and allows free transactions. # NOTE: the CreateNewBlock code starts counting block size at 1,000 bytes, # so blockmaxsize of 2,000 is really just 1,000 bytes (room enough for # 6 or 7 transactions) - nodes.append(start_node(1, test_dir, + self.nodes.append(start_node(1, self.options.tmpdir, ["-blockprioritysize=1500", "-blockmaxsize=2000", "-debug=mempool", "-debug=estimatefee"])) - connect_nodes(nodes[1], 0) + connect_nodes(self.nodes[1], 0) # Node2 is a stingy miner, that # produces very small blocks (room for only 3 or so transactions) node2args = [ "-blockprioritysize=0", "-blockmaxsize=1500", "-debug=mempool", "-debug=estimatefee"] - nodes.append(start_node(2, test_dir, node2args)) - connect_nodes(nodes[2], 0) + self.nodes.append(start_node(2, self.options.tmpdir, node2args)) + connect_nodes(self.nodes[2], 0) - sync_blocks(nodes) - return nodes + self.is_network_split = False + self.sync_all() - def run_test(self, nodes): + def run_test(self): # Prime the memory pool with pairs of transactions # (high-priority, random fee and zero-priority, random fee) min_fee = Decimal("0.001") fees_per_kb = []; for i in range(12): - (txid, txhex, fee) = random_zeropri_transaction(nodes, Decimal("1.1"), + (txid, txhex, fee) = random_zeropri_transaction(self.nodes, Decimal("1.1"), min_fee, min_fee, 20) tx_kbytes = (len(txhex)/2)/1000.0 fees_per_kb.append(float(fee)/tx_kbytes) # Mine blocks with node2 until the memory pool clears: - count_start = nodes[2].getblockcount() - while len(nodes[2].getrawmempool()) > 0: - nodes[2].setgenerate(True, 1) - sync_blocks(nodes) + count_start = self.nodes[2].getblockcount() + while len(self.nodes[2].getrawmempool()) > 0: + self.nodes[2].setgenerate(True, 1) + self.sync_all() - all_estimates = [ nodes[0].estimatefee(i) for i in range(1,20) ] + all_estimates = [ self.nodes[0].estimatefee(i) for i in range(1,20) ] print("Fee estimates, super-stingy miner: "+str([str(e) for e in all_estimates])) # Estimates should be within the bounds of what transactions fees actually were: @@ -63,25 +63,25 @@ class EstimateFeeTest(BitcoinTestFramework): # Generate transactions while mining 30 more blocks, this time with node1: for i in range(30): for j in range(random.randrange(6-4,6+4)): - (txid, txhex, fee) = random_transaction(nodes, Decimal("1.1"), + (txid, txhex, fee) = random_transaction(self.nodes, Decimal("1.1"), Decimal("0.0"), min_fee, 20) tx_kbytes = (len(txhex)/2)/1000.0 fees_per_kb.append(float(fee)/tx_kbytes) - nodes[1].setgenerate(True, 1) - sync_blocks(nodes) + self.nodes[1].setgenerate(True, 1) + self.sync_all() - all_estimates = [ nodes[0].estimatefee(i) for i in range(1,20) ] + all_estimates = [ self.nodes[0].estimatefee(i) for i in range(1,20) ] print("Fee estimates, more generous miner: "+str([ str(e) for e in all_estimates])) for e in filter(lambda x: x >= 0, all_estimates): if float(e)+delta < min(fees_per_kb) or float(e)-delta > max(fees_per_kb): raise AssertionError("Estimated fee (%f) out of range (%f,%f)"%(float(e), min_fee_kb, max_fee_kb)) # Finish by mining a normal-sized block: - while len(nodes[0].getrawmempool()) > 0: - nodes[0].setgenerate(True, 1) - sync_blocks(nodes) + while len(self.nodes[0].getrawmempool()) > 0: + self.nodes[0].setgenerate(True, 1) + self.sync_all() - final_estimates = [ nodes[0].estimatefee(i) for i in range(1,20) ] + final_estimates = [ self.nodes[0].estimatefee(i) for i in range(1,20) ] print("Final fee estimates: "+str([ str(e) for e in final_estimates])) diff --git a/qa/rpc-tests/test_framework.py b/qa/rpc-tests/test_framework.py index 5a18556655..f226496d0f 100755 --- a/qa/rpc-tests/test_framework.py +++ b/qa/rpc-tests/test_framework.py @@ -21,22 +21,64 @@ from util import * class BitcoinTestFramework(object): # These may be over-ridden by subclasses: - def run_test(self, nodes): + def run_test(self): + for node in self.nodes: assert_equal(node.getblockcount(), 200) assert_equal(node.getbalance(), 25*50) def add_options(self, parser): pass - def setup_chain(self, tmp_directory): - print("Initializing test directory "+tmp_directory) - initialize_chain(tmp_directory) + def setup_chain(self): + print("Initializing test directory "+self.options.tmpdir) + initialize_chain(self.options.tmpdir) - def setup_network(self, tmp_directory): - nodes = start_nodes(2, tmp_directory) - connect_nodes(nodes[1], 0) - sync_blocks(nodes) - return nodes + def setup_network(self, split = False): + self.nodes = start_nodes(4, self.options.tmpdir) + + # Connect the nodes as a "chain". This allows us + # to split the network between nodes 1 and 2 to get + # two halves that can work on competing chains. + + # If we joined network halves, connect the nodes from the joint + # on outward. This ensures that chains are properly reorganised. + if not split: + connect_nodes(self.nodes[2], 1) + sync_blocks(self.nodes[1:2]) + sync_mempools(self.nodes[1:2]) + + connect_nodes(self.nodes[1], 0) + connect_nodes(self.nodes[3], 2) + self.is_network_split = split + self.sync_all() + + def split_network(self): + """ + Split the network of four nodes into nodes 0/1 and 2/3. + """ + assert not self.is_network_split + stop_nodes(self.nodes) + wait_bitcoinds() + self.setup_network(True) + + def sync_all(self): + if self.is_network_split: + sync_blocks(self.nodes[:1]) + sync_blocks(self.nodes[2:]) + sync_mempools(self.nodes[:1]) + sync_mempools(self.nodes[2:]) + else: + sync_blocks(self.nodes) + sync_mempools(self.nodes) + + def join_network(self): + """ + Join the (previously split) network halves together. + """ + assert self.is_network_split + stop_nodes(self.nodes) + wait_bitcoinds() + self.setup_network(False) def main(self): import optparse @@ -56,15 +98,14 @@ class BitcoinTestFramework(object): check_json_precision() success = False - nodes = [] try: if not os.path.isdir(self.options.tmpdir): os.makedirs(self.options.tmpdir) - self.setup_chain(self.options.tmpdir) + self.setup_chain() - nodes = self.setup_network(self.options.tmpdir) + self.setup_network() - self.run_test(nodes) + self.run_test() success = True @@ -80,7 +121,7 @@ class BitcoinTestFramework(object): if not self.options.nocleanup: print("Cleaning up") - stop_nodes(nodes) + stop_nodes(self.nodes) wait_bitcoinds() shutil.rmtree(self.options.tmpdir) From 2290ed01bc1b4176a0c6b976707bf7dd6bc49f43 Mon Sep 17 00:00:00 2001 From: Daniel Kraft Date: Fri, 24 Oct 2014 09:06:37 +0200 Subject: [PATCH 0910/1288] Work around #5113. --- qa/rpc-tests/test_framework.py | 6 +++--- qa/rpc-tests/util.py | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/qa/rpc-tests/test_framework.py b/qa/rpc-tests/test_framework.py index f226496d0f..1746294691 100755 --- a/qa/rpc-tests/test_framework.py +++ b/qa/rpc-tests/test_framework.py @@ -43,12 +43,12 @@ class BitcoinTestFramework(object): # If we joined network halves, connect the nodes from the joint # on outward. This ensures that chains are properly reorganised. if not split: - connect_nodes(self.nodes[2], 1) + connect_nodes_bi(self.nodes, 1, 2) sync_blocks(self.nodes[1:2]) sync_mempools(self.nodes[1:2]) - connect_nodes(self.nodes[1], 0) - connect_nodes(self.nodes[3], 2) + connect_nodes_bi(self.nodes, 0, 1) + connect_nodes_bi(self.nodes, 2, 3) self.is_network_split = split self.sync_all() diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index 87baadc5d6..036ac577e6 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -194,6 +194,10 @@ def connect_nodes(from_connection, node_num): while any(peer['version'] == 0 for peer in from_connection.getpeerinfo()): time.sleep(0.1) +def connect_nodes_bi(nodes, a, b): + connect_nodes(nodes[a], b) + connect_nodes(nodes[b], a) + def find_output(node, txid, amount): """ Return index to output of txid with value amount From 7c0f36c431532c787f55b256bd1d6fadbd5b8468 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 24 Oct 2014 09:33:16 +0200 Subject: [PATCH 0911/1288] Clear vFixedSeeds for regtest network It shouldn't inherit these from testnet. (seems to be already done for unit test network but forgotten here...) Fixes #5127. --- src/chainparams.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index dd76ca6c26..1ab292517a 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -266,6 +266,7 @@ public: nDefaultPort = 18444; assert(hashGenesisBlock == uint256("0x0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206")); + vFixedSeeds.clear(); // Regtest mode doesn't have any fixed seeds. vSeeds.clear(); // Regtest mode doesn't have any DNS seeds. fRequireRPCPassword = false; From 24f5c94015cd15adbf9a7018e11667ee36799cec Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Fri, 24 Oct 2014 12:04:27 +0800 Subject: [PATCH 0912/1288] Update comments in addrman to be doxygen compatible Also correct the file license --- src/addrman.cpp | 8 +- src/addrman.h | 237 +++++++++++++++++++++++++----------------------- 2 files changed, 127 insertions(+), 118 deletions(-) diff --git a/src/addrman.cpp b/src/addrman.cpp index 7b674a66e7..7ff21b00ec 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2012 Pieter Wuille -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "addrman.h" @@ -39,7 +39,7 @@ int CAddrInfo::GetNewBucket(const std::vector& nKey, const CNetAd bool CAddrInfo::IsTerrible(int64_t nNow) const { - if (nLastTry && nLastTry >= nNow - 60) // never remove things tried the last minute + if (nLastTry && nLastTry >= nNow - 60) // never remove things tried in the last minute return false; if (nTime > nNow + 10 * 60) // came in a flying DeLorean @@ -131,7 +131,7 @@ int CAddrMan::SelectTried(int nKBucket) { std::vector& vTried = vvTried[nKBucket]; - // random shuffle the first few elements (using the entire list) + // randomly shuffle the first few elements (using the entire list) // find the least recently tried among them int64_t nOldest = -1; int nOldestPos = -1; @@ -211,7 +211,7 @@ void CAddrMan::MakeTried(CAddrInfo& info, int nId, int nOrigin) assert(info.nRefCount == 0); - // what tried bucket to move the entry to + // which tried bucket to move the entry to int nKBucket = info.GetTriedBucket(nKey); std::vector& vTried = vvTried[nKBucket]; diff --git a/src/addrman.h b/src/addrman.h index 5fd698f18a..914086fc76 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -1,5 +1,5 @@ // Copyright (c) 2012 Pieter Wuille -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef _BITCOIN_ADDRMAN @@ -17,29 +17,31 @@ #include #include -/** Extended statistics about a CAddress */ +/** + * Extended statistics about a CAddress + */ class CAddrInfo : public CAddress { private: - // where knowledge about this address first came from + //! where knowledge about this address first came from CNetAddr source; - // last successful connection by us + //! last successful connection by us int64_t nLastSuccess; - // last try whatsoever by us: + //! last try whatsoever by us: // int64_t CAddress::nLastTry - // connection attempts since last successful attempt + //! connection attempts since last successful attempt int nAttempts; - // reference count in new sets (memory only) + //! reference count in new sets (memory only) int nRefCount; - // in tried set? (memory only) + //! in tried set? (memory only) bool fInTried; - // position in vRandom + //! position in vRandom int nRandomPos; friend class CAddrMan; @@ -76,200 +78,205 @@ public: Init(); } - // Calculate in which "tried" bucket this entry belongs + //! Calculate in which "tried" bucket this entry belongs int GetTriedBucket(const std::vector &nKey) const; - // Calculate in which "new" bucket this entry belongs, given a certain source + //! Calculate in which "new" bucket this entry belongs, given a certain source int GetNewBucket(const std::vector &nKey, const CNetAddr& src) const; - // Calculate in which "new" bucket this entry belongs, using its default source + //! Calculate in which "new" bucket this entry belongs, using its default source int GetNewBucket(const std::vector &nKey) const { return GetNewBucket(nKey, source); } - // Determine whether the statistics about this entry are bad enough so that it can just be deleted + //! Determine whether the statistics about this entry are bad enough so that it can just be deleted bool IsTerrible(int64_t nNow = GetAdjustedTime()) const; - // Calculate the relative chance this entry should be given when selecting nodes to connect to + //! Calculate the relative chance this entry should be given when selecting nodes to connect to double GetChance(int64_t nNow = GetAdjustedTime()) const; }; -// Stochastic address manager -// -// Design goals: -// * Only keep a limited number of addresses around, so that addr.dat and memory requirements do not grow without bound. -// * Keep the address tables in-memory, and asynchronously dump the entire to able in addr.dat. -// * Make sure no (localized) attacker can fill the entire table with his nodes/addresses. -// -// To that end: -// * Addresses are organized into buckets. -// * Address that have not yet been tried go into 256 "new" buckets. -// * Based on the address range (/16 for IPv4) of source of the information, 32 buckets are selected at random -// * The actual bucket is chosen from one of these, based on the range the address itself is located. -// * One single address can occur in up to 4 different buckets, to increase selection chances for addresses that -// are seen frequently. The chance for increasing this multiplicity decreases exponentially. -// * When adding a new address to a full bucket, a randomly chosen entry (with a bias favoring less recently seen -// ones) is removed from it first. -// * Addresses of nodes that are known to be accessible go into 64 "tried" buckets. -// * Each address range selects at random 4 of these buckets. -// * The actual bucket is chosen from one of these, based on the full address. -// * When adding a new good address to a full bucket, a randomly chosen entry (with a bias favoring less recently -// tried ones) is evicted from it, back to the "new" buckets. -// * Bucket selection is based on cryptographic hashing, using a randomly-generated 256-bit key, which should not -// be observable by adversaries. -// * Several indexes are kept for high performance. Defining DEBUG_ADDRMAN will introduce frequent (and expensive) -// consistency checks for the entire data structure. +/** Stochastic address manager + * + * Design goals: + * * Keep the address tables in-memory, and asynchronously dump the entire to able in peers.dat. + * * Make sure no (localized) attacker can fill the entire table with his nodes/addresses. + * + * To that end: + * * Addresses are organized into buckets. + * * Address that have not yet been tried go into 256 "new" buckets. + * * Based on the address range (/16 for IPv4) of source of the information, 32 buckets are selected at random + * * The actual bucket is chosen from one of these, based on the range the address itself is located. + * * One single address can occur in up to 4 different buckets, to increase selection chances for addresses that + * are seen frequently. The chance for increasing this multiplicity decreases exponentially. + * * When adding a new address to a full bucket, a randomly chosen entry (with a bias favoring less recently seen + * ones) is removed from it first. + * * Addresses of nodes that are known to be accessible go into 64 "tried" buckets. + * * Each address range selects at random 4 of these buckets. + * * The actual bucket is chosen from one of these, based on the full address. + * * When adding a new good address to a full bucket, a randomly chosen entry (with a bias favoring less recently + * tried ones) is evicted from it, back to the "new" buckets. + * * Bucket selection is based on cryptographic hashing, using a randomly-generated 256-bit key, which should not + * be observable by adversaries. + * * Several indexes are kept for high performance. Defining DEBUG_ADDRMAN will introduce frequent (and expensive) + * consistency checks for the entire data structure. + */ -// total number of buckets for tried addresses +//! total number of buckets for tried addresses #define ADDRMAN_TRIED_BUCKET_COUNT 64 -// maximum allowed number of entries in buckets for tried addresses +//! maximum allowed number of entries in buckets for tried addresses #define ADDRMAN_TRIED_BUCKET_SIZE 64 -// total number of buckets for new addresses +//! total number of buckets for new addresses #define ADDRMAN_NEW_BUCKET_COUNT 256 -// maximum allowed number of entries in buckets for new addresses +//! maximum allowed number of entries in buckets for new addresses #define ADDRMAN_NEW_BUCKET_SIZE 64 -// over how many buckets entries with tried addresses from a single group (/16 for IPv4) are spread +//! over how many buckets entries with tried addresses from a single group (/16 for IPv4) are spread #define ADDRMAN_TRIED_BUCKETS_PER_GROUP 4 -// over how many buckets entries with new addresses originating from a single group are spread +//! over how many buckets entries with new addresses originating from a single group are spread #define ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP 32 -// in how many buckets for entries with new addresses a single address may occur +//! in how many buckets for entries with new addresses a single address may occur #define ADDRMAN_NEW_BUCKETS_PER_ADDRESS 4 -// how many entries in a bucket with tried addresses are inspected, when selecting one to replace +//! how many entries in a bucket with tried addresses are inspected, when selecting one to replace #define ADDRMAN_TRIED_ENTRIES_INSPECT_ON_EVICT 4 -// how old addresses can maximally be +//! how old addresses can maximally be #define ADDRMAN_HORIZON_DAYS 30 -// after how many failed attempts we give up on a new node +//! after how many failed attempts we give up on a new node #define ADDRMAN_RETRIES 3 -// how many successive failures are allowed ... +//! how many successive failures are allowed ... #define ADDRMAN_MAX_FAILURES 10 -// ... in at least this many days +//! ... in at least this many days #define ADDRMAN_MIN_FAIL_DAYS 7 -// the maximum percentage of nodes to return in a getaddr call +//! the maximum percentage of nodes to return in a getaddr call #define ADDRMAN_GETADDR_MAX_PCT 23 -// the maximum number of nodes to return in a getaddr call +//! the maximum number of nodes to return in a getaddr call #define ADDRMAN_GETADDR_MAX 2500 -/** Stochastical (IP) address manager */ +/** + * Stochastical (IP) address manager + */ class CAddrMan { private: - // critical section to protect the inner data structures + //! critical section to protect the inner data structures mutable CCriticalSection cs; - // secret key to randomize bucket select with + //! secret key to randomize bucket select with std::vector nKey; - // last used nId + //! last used nId int nIdCount; - // table with information about all nIds + //! table with information about all nIds std::map mapInfo; - // find an nId based on its network address + //! find an nId based on its network address std::map mapAddr; - // randomly-ordered vector of all nIds + //! randomly-ordered vector of all nIds std::vector vRandom; // number of "tried" entries int nTried; - // list of "tried" buckets + //! list of "tried" buckets std::vector > vvTried; - // number of (unique) "new" entries + //! number of (unique) "new" entries int nNew; - // list of "new" buckets + //! list of "new" buckets std::vector > vvNew; protected: - // Find an entry. + //! Find an entry. CAddrInfo* Find(const CNetAddr& addr, int *pnId = NULL); - // find an entry, creating it if necessary. - // nTime and nServices of found node is updated, if necessary. + //! find an entry, creating it if necessary. + //! nTime and nServices of the found node are updated, if necessary. CAddrInfo* Create(const CAddress &addr, const CNetAddr &addrSource, int *pnId = NULL); - // Swap two elements in vRandom. + //! Swap two elements in vRandom. void SwapRandom(unsigned int nRandomPos1, unsigned int nRandomPos2); - // Return position in given bucket to replace. + //! Return position in given bucket to replace. int SelectTried(int nKBucket); - // Remove an element from a "new" bucket. - // This is the only place where actual deletes occur. - // They are never deleted while in the "tried" table, only possibly evicted back to the "new" table. + //! Remove an element from a "new" bucket. + //! This is the only place where actual deletions occur. + //! Elements are never deleted while in the "tried" table, only possibly evicted back to the "new" table. int ShrinkNew(int nUBucket); - // Move an entry from the "new" table(s) to the "tried" table - // @pre vvUnkown[nOrigin].count(nId) != 0 + //! Move an entry from the "new" table(s) to the "tried" table + //! @pre vvUnkown[nOrigin].count(nId) != 0 void MakeTried(CAddrInfo& info, int nId, int nOrigin); - // Mark an entry "good", possibly moving it from "new" to "tried". + //! Mark an entry "good", possibly moving it from "new" to "tried". void Good_(const CService &addr, int64_t nTime); - // Add an entry to the "new" table. + //! Add an entry to the "new" table. bool Add_(const CAddress &addr, const CNetAddr& source, int64_t nTimePenalty); - // Mark an entry as attempted to connect. + //! Mark an entry as attempted to connect. void Attempt_(const CService &addr, int64_t nTime); - // Select an address to connect to. - // nUnkBias determines how much to favor new addresses over tried ones (min=0, max=100) + //! Select an address to connect to. + //! nUnkBias determines how much to favor new addresses over tried ones (min=0, max=100) CAddress Select_(int nUnkBias); #ifdef DEBUG_ADDRMAN - // Perform consistency check. Returns an error code or zero. + //! Perform consistency check. Returns an error code or zero. int Check_(); #endif - // Select several addresses at once. + //! Select several addresses at once. void GetAddr_(std::vector &vAddr); - // Mark an entry as currently-connected-to. + //! Mark an entry as currently-connected-to. void Connected_(const CService &addr, int64_t nTime); public: - // serialized format: - // * version byte (currently 0) - // * nKey - // * nNew - // * nTried - // * number of "new" buckets - // * all nNew addrinfos in vvNew - // * all nTried addrinfos in vvTried - // * for each bucket: - // * number of elements - // * for each element: index - // - // Notice that vvTried, mapAddr and vVector are never encoded explicitly; - // they are instead reconstructed from the other information. - // - // vvNew is serialized, but only used if ADDRMAN_UNKOWN_BUCKET_COUNT didn't change, - // otherwise it is reconstructed as well. - // - // This format is more complex, but significantly smaller (at most 1.5 MiB), and supports - // changes to the ADDRMAN_ parameters without breaking the on-disk structure. - // - // We don't use ADD_SERIALIZE_METHODS since the serialization and deserialization code has - // very little in common. + /** + * serialized format: + * * version byte (currently 0) + * * nKey + * * nNew + * * nTried + * * number of "new" buckets + * * all nNew addrinfos in vvNew + * * all nTried addrinfos in vvTried + * * for each bucket: + * * number of elements + * * for each element: index + * + * Notice that vvTried, mapAddr and vVector are never encoded explicitly; + * they are instead reconstructed from the other information. + * + * vvNew is serialized, but only used if ADDRMAN_UNKOWN_BUCKET_COUNT didn't change, + * otherwise it is reconstructed as well. + * + * This format is more complex, but significantly smaller (at most 1.5 MiB), and supports + * changes to the ADDRMAN_ parameters without breaking the on-disk structure. + * + * We don't use ADD_SERIALIZE_METHODS since the serialization and deserialization code has + * very little in common. + * + */ template void Serialize(Stream &s, int nType, int nVersionDummy) const { @@ -394,13 +401,13 @@ public: nNew = 0; } - // Return the number of (unique) addresses in all tables. + //! Return the number of (unique) addresses in all tables. int size() { return vRandom.size(); } - // Consistency check + //! Consistency check void Check() { #ifdef DEBUG_ADDRMAN @@ -413,7 +420,7 @@ public: #endif } - // Add a single address. + //! Add a single address. bool Add(const CAddress &addr, const CNetAddr& source, int64_t nTimePenalty = 0) { bool fRet = false; @@ -428,7 +435,7 @@ public: return fRet; } - // Add multiple addresses. + //! Add multiple addresses. bool Add(const std::vector &vAddr, const CNetAddr& source, int64_t nTimePenalty = 0) { int nAdd = 0; @@ -444,7 +451,7 @@ public: return nAdd > 0; } - // Mark an entry as accessible. + //! Mark an entry as accessible. void Good(const CService &addr, int64_t nTime = GetAdjustedTime()) { { @@ -455,7 +462,7 @@ public: } } - // Mark an entry as connection attempted to. + //! Mark an entry as connection attempted to. void Attempt(const CService &addr, int64_t nTime = GetAdjustedTime()) { { @@ -466,8 +473,10 @@ public: } } - // Choose an address to connect to. - // nUnkBias determines how much "new" entries are favored over "tried" ones (0-100). + /** + * Choose an address to connect to. + * nUnkBias determines how much "new" entries are favored over "tried" ones (0-100). + */ CAddress Select(int nUnkBias = 50) { CAddress addrRet; @@ -480,7 +489,7 @@ public: return addrRet; } - // Return a bunch of addresses, selected at random. + //! Return a bunch of addresses, selected at random. std::vector GetAddr() { Check(); @@ -493,7 +502,7 @@ public: return vAddr; } - // Mark an entry as currently-connected-to. + //! Mark an entry as currently-connected-to. void Connected(const CService &addr, int64_t nTime = GetAdjustedTime()) { { From a31e8bad53e44629b26e7f36e0431b9fa01c1ed6 Mon Sep 17 00:00:00 2001 From: Daniel Kraft Date: Fri, 24 Oct 2014 16:13:41 +0200 Subject: [PATCH 0913/1288] Make CBlockIndex* returned by GetDepthInMainChain const. Make the CBlockIndex* (optionally) returned by GetDepthInMainChain const. This prevents accidental modification. The result is for reading its properties rather than modifying it. --- src/wallet.cpp | 4 ++-- src/wallet.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index 65944587f8..3812c22fe2 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -2298,7 +2298,7 @@ int CMerkleTx::SetMerkleBranch(const CBlock& block) return chainActive.Height() - pindex->nHeight + 1; } -int CMerkleTx::GetDepthInMainChainINTERNAL(CBlockIndex* &pindexRet) const +int CMerkleTx::GetDepthInMainChainINTERNAL(const CBlockIndex* &pindexRet) const { if (hashBlock == 0 || nIndex == -1) return 0; @@ -2324,7 +2324,7 @@ int CMerkleTx::GetDepthInMainChainINTERNAL(CBlockIndex* &pindexRet) const return chainActive.Height() - pindex->nHeight + 1; } -int CMerkleTx::GetDepthInMainChain(CBlockIndex* &pindexRet) const +int CMerkleTx::GetDepthInMainChain(const CBlockIndex* &pindexRet) const { AssertLockHeld(cs_main); int nResult = GetDepthInMainChainINTERNAL(pindexRet); diff --git a/src/wallet.h b/src/wallet.h index 06706655f8..9b6895090c 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -474,7 +474,7 @@ struct COutputEntry class CMerkleTx : public CTransaction { private: - int GetDepthInMainChainINTERNAL(CBlockIndex* &pindexRet) const; + int GetDepthInMainChainINTERNAL(const CBlockIndex* &pindexRet) const; public: uint256 hashBlock; @@ -519,9 +519,9 @@ public: // -1 : not in blockchain, and not in memory pool (conflicted transaction) // 0 : in memory pool, waiting to be included in a block // >=1 : this many blocks deep in the main chain - int GetDepthInMainChain(CBlockIndex* &pindexRet) const; - int GetDepthInMainChain() const { CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet); } - bool IsInMainChain() const { CBlockIndex *pindexRet; return GetDepthInMainChainINTERNAL(pindexRet) > 0; } + int GetDepthInMainChain(const CBlockIndex* &pindexRet) const; + int GetDepthInMainChain() const { const CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet); } + bool IsInMainChain() const { const CBlockIndex *pindexRet; return GetDepthInMainChainINTERNAL(pindexRet) > 0; } int GetBlocksToMaturity() const; bool AcceptToMemoryPool(bool fLimitFree=true, bool fRejectInsaneFee=true); }; From ec01243c14294c0e6f25d093156aae6b4458466e Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Thu, 23 Oct 2014 13:11:20 -0400 Subject: [PATCH 0914/1288] --tracerpc option for regression tests Run tests with --tracerpc and all RPC calls will dump to the console. Very helpful for debugging. --- qa/rpc-tests/test_framework.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qa/rpc-tests/test_framework.py b/qa/rpc-tests/test_framework.py index 5a18556655..bd20d4c9fe 100755 --- a/qa/rpc-tests/test_framework.py +++ b/qa/rpc-tests/test_framework.py @@ -48,9 +48,15 @@ class BitcoinTestFramework(object): help="Source directory containing bitcoind/bitcoin-cli (default: %default%)") parser.add_option("--tmpdir", dest="tmpdir", default=tempfile.mkdtemp(prefix="test"), help="Root directory for datadirs") + parser.add_option("--tracerpc", dest="trace_rpc", default=False, action="store_true", + help="Print out all RPC calls as they are made") self.add_options(parser) (self.options, self.args) = parser.parse_args() + if self.options.trace_rpc: + import logging + logging.basicConfig(level=logging.DEBUG) + os.environ['PATH'] = self.options.srcdir+":"+os.environ['PATH'] check_json_precision() From 6261e6e6e0ae9860d322efe0f11d0960b300dad4 Mon Sep 17 00:00:00 2001 From: dexX7 Date: Fri, 24 Oct 2014 15:43:40 +0200 Subject: [PATCH 0915/1288] getblockhash: throw JSONRPCError (not runtime_error) --- src/rpcblockchain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 5beac0512a..02b510aa41 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -225,7 +225,7 @@ Value getblockhash(const Array& params, bool fHelp) int nHeight = params[0].get_int(); if (nHeight < 0 || nHeight > chainActive.Height()) - throw runtime_error("Block number out of range."); + throw JSONRPCError(RPC_INVALID_PARAMETER, "Block height out of range"); CBlockIndex* pblockindex = chainActive[nHeight]; return pblockindex->GetBlockHash().GetHex(); From 9f87325b220e6766ffee524ff54528d7bc2eb13f Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Fri, 24 Oct 2014 15:48:06 -0400 Subject: [PATCH 0916/1288] Start with tidier cache directories Remove more files from the cached, 200-block-chain data directories. --- qa/rpc-tests/util.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index 036ac577e6..276b5c635f 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -110,11 +110,14 @@ def initialize_chain(test_dir): rpcs[i].setgenerate(True, 25) sync_blocks(rpcs) - # Shut them down, and remove debug.logs: + # Shut them down, and clean up cache directories: stop_nodes(rpcs) wait_bitcoinds() for i in range(4): - os.remove(debug_log("cache", i)) + os.remove(log_filename("cache", i, "debug.log")) + os.remove(log_filename("cache", i, "db.log")) + os.remove(log_filename("cache", i, "peers.dat")) + os.remove(log_filename("cache", i, "fee_estimates.dat")) for i in range(4): from_dir = os.path.join("cache", "node"+str(i)) @@ -167,8 +170,8 @@ def start_nodes(num_nodes, dir, extra_args=None, rpchost=None): if extra_args is None: extra_args = [ None for i in range(num_nodes) ] return [ start_node(i, dir, extra_args[i], rpchost) for i in range(num_nodes) ] -def debug_log(dir, n_node): - return os.path.join(dir, "node"+str(n_node), "regtest", "debug.log") +def log_filename(dir, n_node, logname): + return os.path.join(dir, "node"+str(n_node), "regtest", logname) def stop_node(node, i): node.stop() From 7014f382e3fd99226b7d844984e50706e2f67247 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Wed, 22 Oct 2014 06:07:59 +0200 Subject: [PATCH 0917/1288] [Qt] Remove CAmount from BitcoinAmountField Q_PROPERTY --- src/qt/bitcoinamountfield.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qt/bitcoinamountfield.h b/src/qt/bitcoinamountfield.h index e52feeb46e..040a234177 100644 --- a/src/qt/bitcoinamountfield.h +++ b/src/qt/bitcoinamountfield.h @@ -21,7 +21,9 @@ class BitcoinAmountField: public QWidget { Q_OBJECT - Q_PROPERTY(CAmount value READ value WRITE setValue NOTIFY valueChanged USER true) + // ugly hack: for some unknown reason CAmount (instead of qint64) does not work here as expected + // discussion: https://github.com/bitcoin/bitcoin/pull/5117 + Q_PROPERTY(qint64 value READ value WRITE setValue NOTIFY valueChanged USER true) public: explicit BitcoinAmountField(QWidget *parent = 0); From 2fdc3351d72af2ad26280cd0ca07c2ae4080db55 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Sat, 25 Oct 2014 16:46:54 +0800 Subject: [PATCH 0918/1288] Update comments in chain to be doxygen compatible --- src/chain.cpp | 5 ++-- src/chain.h | 75 ++++++++++++++++++++++++++------------------------- 2 files changed, 42 insertions(+), 38 deletions(-) diff --git a/src/chain.cpp b/src/chain.cpp index 56ed22ce71..e13c047861 100644 --- a/src/chain.cpp +++ b/src/chain.cpp @@ -7,8 +7,9 @@ using namespace std; -// CChain implementation - +/** + * CChain implementation + */ void CChain::SetTip(CBlockIndex *pindex) { if (pindex == NULL) { vChain.clear(); diff --git a/src/chain.h b/src/chain.h index 290150476e..07e72d3498 100644 --- a/src/chain.h +++ b/src/chain.h @@ -50,38 +50,40 @@ struct CDiskBlockPos }; enum BlockStatus { - // Unused. + //! Unused. BLOCK_VALID_UNKNOWN = 0, - // Parsed, version ok, hash satisfies claimed PoW, 1 <= vtx count <= max, timestamp not in future + //! Parsed, version ok, hash satisfies claimed PoW, 1 <= vtx count <= max, timestamp not in future BLOCK_VALID_HEADER = 1, - // All parent headers found, difficulty matches, timestamp >= median previous, checkpoint. Implies all parents - // are also at least TREE. + //! All parent headers found, difficulty matches, timestamp >= median previous, checkpoint. Implies all parents + //! are also at least TREE. BLOCK_VALID_TREE = 2, - // Only first tx is coinbase, 2 <= coinbase input script length <= 100, transactions valid, no duplicate txids, - // sigops, size, merkle root. Implies all parents are at least TREE but not necessarily TRANSACTIONS. When all - // parent blocks also have TRANSACTIONS, CBlockIndex::nChainTx will be set. + /** + * Only first tx is coinbase, 2 <= coinbase input script length <= 100, transactions valid, no duplicate txids, + * sigops, size, merkle root. Implies all parents are at least TREE but not necessarily TRANSACTIONS. When all + * parent blocks also have TRANSACTIONS, CBlockIndex::nChainTx will be set. + */ BLOCK_VALID_TRANSACTIONS = 3, - // Outputs do not overspend inputs, no double spends, coinbase output ok, immature coinbase spends, BIP30. - // Implies all parents are also at least CHAIN. + //! Outputs do not overspend inputs, no double spends, coinbase output ok, immature coinbase spends, BIP30. + //! Implies all parents are also at least CHAIN. BLOCK_VALID_CHAIN = 4, - // Scripts & signatures ok. Implies all parents are also at least SCRIPTS. + //! Scripts & signatures ok. Implies all parents are also at least SCRIPTS. BLOCK_VALID_SCRIPTS = 5, - // All validity bits. + //! All validity bits. BLOCK_VALID_MASK = BLOCK_VALID_HEADER | BLOCK_VALID_TREE | BLOCK_VALID_TRANSACTIONS | BLOCK_VALID_CHAIN | BLOCK_VALID_SCRIPTS, - BLOCK_HAVE_DATA = 8, // full block available in blk*.dat - BLOCK_HAVE_UNDO = 16, // undo data available in rev*.dat + BLOCK_HAVE_DATA = 8, //! full block available in blk*.dat + BLOCK_HAVE_UNDO = 16, //! undo data available in rev*.dat BLOCK_HAVE_MASK = BLOCK_HAVE_DATA | BLOCK_HAVE_UNDO, - BLOCK_FAILED_VALID = 32, // stage after last reached validness failed - BLOCK_FAILED_CHILD = 64, // descends from failed block + BLOCK_FAILED_VALID = 32, //! stage after last reached validness failed + BLOCK_FAILED_CHILD = 64, //! descends from failed block BLOCK_FAILED_MASK = BLOCK_FAILED_VALID | BLOCK_FAILED_CHILD, }; @@ -93,49 +95,50 @@ enum BlockStatus { class CBlockIndex { public: - // pointer to the hash of the block, if any. memory is owned by this CBlockIndex + //! pointer to the hash of the block, if any. memory is owned by this CBlockIndex const uint256* phashBlock; - // pointer to the index of the predecessor of this block + //! pointer to the index of the predecessor of this block CBlockIndex* pprev; - // pointer to the index of some further predecessor of this block + //! pointer to the index of some further predecessor of this block CBlockIndex* pskip; - // height of the entry in the chain. The genesis block has height 0 + //! height of the entry in the chain. The genesis block has height 0 int nHeight; - // Which # file this block is stored in (blk?????.dat) + //! Which # file this block is stored in (blk?????.dat) int nFile; - // Byte offset within blk?????.dat where this block's data is stored + //! Byte offset within blk?????.dat where this block's data is stored unsigned int nDataPos; - // Byte offset within rev?????.dat where this block's undo data is stored + //! Byte offset within rev?????.dat where this block's undo data is stored unsigned int nUndoPos; - // (memory only) Total amount of work (expected number of hashes) in the chain up to and including this block + //! (memory only) Total amount of work (expected number of hashes) in the chain up to and including this block uint256 nChainWork; - // Number of transactions in this block. - // Note: in a potential headers-first mode, this number cannot be relied upon + //! Number of transactions in this block. + //! Note: in a potential headers-first mode, this number cannot be relied upon unsigned int nTx; - // (memory only) Number of transactions in the chain up to and including this block. - // This value will be non-zero only if and only if transactions for this block and all its parents are available. - unsigned int nChainTx; // change to 64-bit type when necessary; won't happen before 2030 + //! (memory only) Number of transactions in the chain up to and including this block. + //! This value will be non-zero only if and only if transactions for this block and all its parents are available. + //! Change to 64-bit type when necessary; won't happen before 2030 + unsigned int nChainTx; - // Verification status of this block. See enum BlockStatus + //! Verification status of this block. See enum BlockStatus unsigned int nStatus; - // block header + //! block header int nVersion; uint256 hashMerkleRoot; unsigned int nTime; unsigned int nBits; unsigned int nNonce; - // (memory only) Sequencial id assigned to distinguish order in which blocks are received. + //! (memory only) Sequential id assigned to distinguish order in which blocks are received. uint32_t nSequenceId; void SetNull() @@ -254,7 +257,7 @@ public: GetBlockHash().ToString()); } - // Check whether this block index entry is valid up to the passed validity level. + //! Check whether this block index entry is valid up to the passed validity level. bool IsValid(enum BlockStatus nUpTo = BLOCK_VALID_TRANSACTIONS) const { assert(!(nUpTo & ~BLOCK_VALID_MASK)); // Only validity flags allowed. @@ -263,8 +266,8 @@ public: return ((nStatus & BLOCK_VALID_MASK) >= nUpTo); } - // Raise the validity level of this block index entry. - // Returns true if the validity was changed. + //! Raise the validity level of this block index entry. + //! Returns true if the validity was changed. bool RaiseValidity(enum BlockStatus nUpTo) { assert(!(nUpTo & ~BLOCK_VALID_MASK)); // Only validity flags allowed. @@ -277,10 +280,10 @@ public: return false; } - // Build the skiplist pointer for this entry. + //! Build the skiplist pointer for this entry. void BuildSkip(); - // Efficiently find an ancestor of this block. + //! Efficiently find an ancestor of this block. CBlockIndex* GetAncestor(int height); const CBlockIndex* GetAncestor(int height) const; }; From f2e03ffae92ec1333c0eb724835ad56138f54716 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Sat, 25 Oct 2014 17:24:16 +0800 Subject: [PATCH 0919/1288] Update comments in chainparams to be doxygen compatible --- src/chainparams.cpp | 91 ++++++++++++++++++++++------------------- src/chainparams.h | 40 +++++++++--------- src/chainparamsbase.cpp | 27 ++++++------ src/chainparamsbase.h | 2 +- src/chainparamsseeds.h | 11 +++-- 5 files changed, 90 insertions(+), 81 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 1ab292517a..9ffc369b40 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "chainparams.h" @@ -23,11 +23,11 @@ struct SeedSpec6 { #include "chainparamsseeds.h" -// -// Main network -// +/** + * Main network + */ -// Convert the pnSeeds6 array into usable address objects. +//! Convert the pnSeeds6 array into usable address objects. static void convertSeed6(std::vector &vSeedsOut, const SeedSpec6 *data, unsigned int count) { // It'll only connect to one or two seed nodes because once it connects, @@ -45,11 +45,13 @@ static void convertSeed6(std::vector &vSeedsOut, const SeedSpec6 *data } } - // What makes a good checkpoint block? - // + Is surrounded by blocks with reasonable timestamps - // (no blocks before with a timestamp after, none after with - // timestamp before) - // + Contains no strange transactions +/** + * What makes a good checkpoint block? + * + Is surrounded by blocks with reasonable timestamps + * (no blocks before with a timestamp after, none after with + * timestamp before) + * + Contains no strange transactions + */ static Checkpoints::MapCheckpoints mapCheckpoints = boost::assign::map_list_of ( 11111, uint256("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d")) @@ -101,9 +103,11 @@ public: CMainParams() { networkID = CBaseChainParams::MAIN; strNetworkID = "main"; - // The message start string is designed to be unlikely to occur in normal data. - // The characters are rarely used upper ASCII, not valid as UTF-8, and produce - // a large 4-byte int at any alignment. + /** + * The message start string is designed to be unlikely to occur in normal data. + * The characters are rarely used upper ASCII, not valid as UTF-8, and produce + * a large 4-byte int at any alignment. + */ pchMessageStart[0] = 0xf9; pchMessageStart[1] = 0xbe; pchMessageStart[2] = 0xb4; @@ -119,14 +123,16 @@ public: nTargetTimespan = 14 * 24 * 60 * 60; // two weeks nTargetSpacing = 10 * 60; - // Build the genesis block. Note that the output of the genesis coinbase cannot - // be spent as it did not originally exist in the database. - // - // CBlock(hash=000000000019d6, ver=1, hashPrevBlock=00000000000000, hashMerkleRoot=4a5e1e, nTime=1231006505, nBits=1d00ffff, nNonce=2083236893, vtx=1) - // CTransaction(hash=4a5e1e, ver=1, vin.size=1, vout.size=1, nLockTime=0) - // CTxIn(COutPoint(000000, -1), coinbase 04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73) - // CTxOut(nValue=50.00000000, scriptPubKey=0x5F1DF16B2B704C8A578D0B) - // vMerkleTree: 4a5e1e + /** + * Build the genesis block. Note that the output of the genesis coinbase cannot + * be spent as it did not originally exist in the database. + * + * CBlock(hash=000000000019d6, ver=1, hashPrevBlock=00000000000000, hashMerkleRoot=4a5e1e, nTime=1231006505, nBits=1d00ffff, nNonce=2083236893, vtx=1) + * CTransaction(hash=4a5e1e, ver=1, vin.size=1, vout.size=1, nLockTime=0) + * CTxIn(COutPoint(000000, -1), coinbase 04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73) + * CTxOut(nValue=50.00000000, scriptPubKey=0x5F1DF16B2B704C8A578D0B) + * vMerkleTree: 4a5e1e + */ const char* pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"; CMutableTransaction txNew; txNew.vin.resize(1); @@ -178,18 +184,19 @@ public: }; static CMainParams mainParams; -// -// Testnet (v3) -// - +/** + * Testnet (v3) + */ class CTestNetParams : public CMainParams { public: CTestNetParams() { networkID = CBaseChainParams::TESTNET; strNetworkID = "test"; - // The message start string is designed to be unlikely to occur in normal data. - // The characters are rarely used upper ASCII, not valid as UTF-8, and produce - // a large 4-byte int at any alignment. + /** + * The message start string is designed to be unlikely to occur in normal data. + * The characters are rarely used upper ASCII, not valid as UTF-8, and produce + * a large 4-byte int at any alignment. + */ pchMessageStart[0] = 0x0b; pchMessageStart[1] = 0x11; pchMessageStart[2] = 0x09; @@ -200,10 +207,10 @@ public: nRejectBlockOutdatedMajority = 75; nToCheckBlockUpgradeMajority = 100; nMinerThreads = 0; - nTargetTimespan = 14 * 24 * 60 * 60; // two weeks + nTargetTimespan = 14 * 24 * 60 * 60; //! two weeks nTargetSpacing = 10 * 60; - // Modify the testnet genesis block so the timestamp is valid for a later start. + //! Modify the testnet genesis block so the timestamp is valid for a later start. genesis.nTime = 1296688602; genesis.nNonce = 414098458; hashGenesisBlock = genesis.GetHash(); @@ -239,9 +246,9 @@ public: }; static CTestNetParams testNetParams; -// -// Regression test -// +/** + * Regression test + */ class CRegTestParams : public CTestNetParams { public: CRegTestParams() { @@ -256,7 +263,7 @@ public: nRejectBlockOutdatedMajority = 950; nToCheckBlockUpgradeMajority = 1000; nMinerThreads = 1; - nTargetTimespan = 14 * 24 * 60 * 60; // two weeks + nTargetTimespan = 14 * 24 * 60 * 60; //! two weeks nTargetSpacing = 10 * 60; bnProofOfWorkLimit = ~uint256(0) >> 1; genesis.nTime = 1296688602; @@ -266,8 +273,8 @@ public: nDefaultPort = 18444; assert(hashGenesisBlock == uint256("0x0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206")); - vFixedSeeds.clear(); // Regtest mode doesn't have any fixed seeds. - vSeeds.clear(); // Regtest mode doesn't have any DNS seeds. + vFixedSeeds.clear(); //! Regtest mode doesn't have any fixed seeds. + vSeeds.clear(); //! Regtest mode doesn't have any DNS seeds. fRequireRPCPassword = false; fMiningRequiresPeers = false; @@ -284,17 +291,17 @@ public: }; static CRegTestParams regTestParams; -// -// Unit test -// +/** + * Unit test + */ class CUnitTestParams : public CMainParams, public CModifiableParams { public: CUnitTestParams() { networkID = CBaseChainParams::UNITTEST; strNetworkID = "unittest"; nDefaultPort = 18445; - vFixedSeeds.clear(); - vSeeds.clear(); // Regtest mode doesn't have any DNS seeds. + vFixedSeeds.clear(); //! Unit test mode doesn't have any fixed seeds. + vSeeds.clear(); //! Unit test mode doesn't have any DNS seeds. fRequireRPCPassword = false; fMiningRequiresPeers = false; @@ -309,7 +316,7 @@ public: return data; } - // Published setters to allow changing values in unit test cases + //! Published setters to allow changing values in unit test cases virtual void setSubsidyHalvingInterval(int anSubsidyHalvingInterval) { nSubsidyHalvingInterval=anSubsidyHalvingInterval; } virtual void setEnforceBlockUpgradeMajority(int anEnforceBlockUpgradeMajority) { nEnforceBlockUpgradeMajority=anEnforceBlockUpgradeMajority; } virtual void setRejectBlockOutdatedMajority(int anRejectBlockOutdatedMajority) { nRejectBlockOutdatedMajority=anRejectBlockOutdatedMajority; } diff --git a/src/chainparams.h b/src/chainparams.h index f157419bb2..6eba970ccc 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CHAIN_PARAMS_H @@ -47,34 +47,33 @@ public: int GetDefaultPort() const { return nDefaultPort; } const uint256& ProofOfWorkLimit() const { return bnProofOfWorkLimit; } int SubsidyHalvingInterval() const { return nSubsidyHalvingInterval; } - /* Used to check majorities for block version upgrade */ + /** Used to check majorities for block version upgrade */ int EnforceBlockUpgradeMajority() const { return nEnforceBlockUpgradeMajority; } int RejectBlockOutdatedMajority() const { return nRejectBlockOutdatedMajority; } int ToCheckBlockUpgradeMajority() const { return nToCheckBlockUpgradeMajority; } - /* Used if GenerateBitcoins is called with a negative number of threads */ + /** Used if GenerateBitcoins is called with a negative number of threads */ int DefaultMinerThreads() const { return nMinerThreads; } const CBlock& GenesisBlock() const { return genesis; } bool RequireRPCPassword() const { return fRequireRPCPassword; } - /* Make miner wait to have peers to avoid wasting work */ + /** Make miner wait to have peers to avoid wasting work */ bool MiningRequiresPeers() const { return fMiningRequiresPeers; } - /* Default value for -checkmempool argument */ + /** Default value for -checkmempool argument */ bool DefaultCheckMemPool() const { return fDefaultCheckMemPool; } - /* Allow mining of a min-difficulty block */ + /** Allow mining of a min-difficulty block */ bool AllowMinDifficultyBlocks() const { return fAllowMinDifficultyBlocks; } - /* Skip proof-of-work check: allow mining of any difficulty block */ + /** Skip proof-of-work check: allow mining of any difficulty block */ bool SkipProofOfWorkCheck() const { return fSkipProofOfWorkCheck; } - /* Make standard checks */ + /** Make standard checks */ bool RequireStandard() const { return fRequireStandard; } int64_t TargetTimespan() const { return nTargetTimespan; } int64_t TargetSpacing() const { return nTargetSpacing; } int64_t Interval() const { return nTargetTimespan / nTargetSpacing; } - /* Make miner stop after a block is found. In RPC, don't return - * until nGenProcLimit blocks are generated */ + /** Make miner stop after a block is found. In RPC, don't return until nGenProcLimit blocks are generated */ bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; } - /* In the future use NetworkIDString() for RPC fields */ + /** In the future use NetworkIDString() for RPC fields */ bool TestnetToBeDeprecatedFieldRPC() const { return fTestnetToBeDeprecatedFieldRPC; } - /* Return the BIP70 network string (main, test or regtest) */ + /** Return the BIP70 network string (main, test or regtest) */ std::string NetworkIDString() const { return strNetworkID; } const std::vector& DNSSeeds() const { return vSeeds; } const std::vector& Base58Prefix(Base58Type type) const { return base58Prefixes[type]; } @@ -85,7 +84,7 @@ protected: uint256 hashGenesisBlock; MessageStartChars pchMessageStart; - // Raw pub key bytes for the broadcast alert signing key. + //! Raw pub key bytes for the broadcast alert signing key. std::vector vAlertPubKey; int nDefaultPort; uint256 bnProofOfWorkLimit; @@ -112,14 +111,15 @@ protected: bool fTestnetToBeDeprecatedFieldRPC; }; -/** Modifiable parameters interface is used by test cases to adapt the parameters in order -*** to test specific features more easily. Test cases should always restore the previous -*** values after finalization. -**/ +/** + * Modifiable parameters interface is used by test cases to adapt the parameters in order + * to test specific features more easily. Test cases should always restore the previous + * values after finalization. + */ class CModifiableParams { public: - // Published setters to allow changing values in unit test cases + //! Published setters to allow changing values in unit test cases virtual void setSubsidyHalvingInterval(int anSubsidyHalvingInterval) =0; virtual void setEnforceBlockUpgradeMajority(int anEnforceBlockUpgradeMajority)=0; virtual void setRejectBlockOutdatedMajority(int anRejectBlockOutdatedMajority)=0; @@ -139,7 +139,7 @@ const CChainParams &Params(); /** Return parameters for the given network. */ CChainParams &Params(CBaseChainParams::Network network); -/** Get modifyable network parameters (UNITTEST only) */ +/** Get modifiable network parameters (UNITTEST only) */ CModifiableParams *ModifiableParams(); /** Sets the params returned by Params() to those for the given network. */ diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index 5d9ec7927b..8646a31603 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "chainparamsbase.h" @@ -13,10 +13,9 @@ using namespace boost::assign; -// -// Main network -// - +/** + * Main network + */ class CBaseMainParams : public CBaseChainParams { public: @@ -28,9 +27,9 @@ public: }; static CBaseMainParams mainParams; -// -// Testnet (v3) -// +/** + * Testnet (v3) + */ class CBaseTestNetParams : public CBaseMainParams { public: @@ -43,9 +42,9 @@ public: }; static CBaseTestNetParams testNetParams; -// -// Regression test -// +/* + * Regression test + */ class CBaseRegTestParams : public CBaseTestNetParams { public: @@ -57,9 +56,9 @@ public: }; static CBaseRegTestParams regTestParams; -// -// Unit test -// +/* + * Unit test + */ class CBaseUnitTestParams : public CBaseMainParams { public: diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h index 911d1181ac..4042b8c879 100644 --- a/src/chainparamsbase.h +++ b/src/chainparamsbase.h @@ -1,5 +1,5 @@ // Copyright (c) 2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CHAIN_PARAMS_BASE_H diff --git a/src/chainparamsseeds.h b/src/chainparamsseeds.h index 3f3278361e..c3323c48bd 100644 --- a/src/chainparamsseeds.h +++ b/src/chainparamsseeds.h @@ -1,10 +1,13 @@ #ifndef H_CHAINPARAMSSEEDS #define H_CHAINPARAMSSEEDS -// List of fixed seed nodes for the bitcoin network -// AUTOGENERATED by contrib/devtools/generate-seeds.py -// Each line contains a 16-byte IPv6 address and a port. -// IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly. +/** + * List of fixed seed nodes for the bitcoin network + * AUTOGENERATED by contrib/devtools/generate-seeds.py + * + * Each line contains a 16-byte IPv6 address and a port. + * IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly. + */ static SeedSpec6 pnSeed6_main[] = { {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x69,0x6a,0x7e}, 8333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa2,0xd1,0x04,0x7d}, 8333}, From d752ba86c1872f64a4641cf77008826d32bde65f Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 8 Oct 2014 16:29:45 -0700 Subject: [PATCH 0920/1288] Add SCRIPT_VERIFY_SIGPUSHONLY (BIP62 rule 2) --- src/script/interpreter.cpp | 4 ++++ src/script/interpreter.h | 3 +++ src/script/script.cpp | 2 +- src/script/script.h | 2 +- src/test/data/script_invalid.json | 18 ++++++++++++++++++ src/test/data/script_valid.json | 12 ++++++++++++ src/test/script_tests.cpp | 23 +++++++++++++++++++++-- src/test/transaction_tests.cpp | 1 + 8 files changed, 61 insertions(+), 4 deletions(-) diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index cd73b88210..e463de8cc2 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -980,6 +980,10 @@ bool SignatureChecker::CheckSig(const vector& vchSigIn, const vec bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigned int flags, const BaseSignatureChecker& checker) { + if ((flags & SCRIPT_VERIFY_SIGPUSHONLY) != 0 && !scriptSig.IsPushOnly()) { + return false; + } + vector > stack, stackCopy; if (!EvalScript(stack, scriptSig, flags, checker)) return false; diff --git a/src/script/interpreter.h b/src/script/interpreter.h index de5ce2ced1..085cd867da 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -46,6 +46,9 @@ enum // verify dummy stack item consumed by CHECKMULTISIG is of zero-length (softfork safe, BIP62 rule 7). SCRIPT_VERIFY_NULLDUMMY = (1U << 4), + + // Using a non-push operator in the scriptSig causes script failure (softfork safe, BIP62 rule 2). + SCRIPT_VERIFY_SIGPUSHONLY = (1U << 5), }; uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType); diff --git a/src/script/script.cpp b/src/script/script.cpp index 3e19d0c2bf..bbcfe9dfdd 100644 --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -230,7 +230,7 @@ bool CScript::IsPushOnly() const return false; // Note that IsPushOnly() *does* consider OP_RESERVED to be a // push-type opcode, however execution of OP_RESERVED fails, so - // it's not relevant to P2SH as the scriptSig would fail prior to + // it's not relevant to P2SH/BIP62 as the scriptSig would fail prior to // the P2SH special validation code being executed. if (opcode > OP_16) return false; diff --git a/src/script/script.h b/src/script/script.h index d450db5cad..706a85a29b 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -551,7 +551,7 @@ public: bool IsPayToScriptHash() const; - // Called by IsStandardTx and P2SH VerifyScript (which makes it consensus-critical). + // Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical). bool IsPushOnly() const; // Called by IsStandardTx. diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index b6447cb221..e4dd8fe9aa 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -504,6 +504,24 @@ nSequences are max. "NULLDUMMY", "3-of-3 NOT with invalid sig with nonzero dummy" ], +[ + "0 0x47 0x3044022035341cc377b19138f944f90c45772cb06338c6d56a4c0c31a65bf1a8a105fadc022046dd232850b6bacb25879c9da82a7a628982aa19d055f1753468f68047662e0301 DUP", + "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", + "SIGPUSHONLY", + "2-of-2 with two identical keys and sigs pushed using OP_DUP" +], +[ + "0x47 0x304402204d8b99eea2f53382fd67e0dbc8ed0596bd614aa0dad6bc6843c7860c79b901c3022062f022a71993013e3d9b22302a8e4b40109d7bb057aeb250b9aab2197b3e96b801 0x23 0x2103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640ac", + "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", + "", + "P2SH(P2PK) with non-push scriptSig but no SIGPUSHONLY" +], +[ + "0x47 0x30440220078c887c33abc67fbbd827ceb3f661c1c459e78218161b652f23e3ca76cfabbd022047df245eacb8a88d8c5ca7b5228e3b4d070c102d2f542433362d3f443cd24eda01 0x23 0x2103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640ac", + "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", + "SIGPUSHONLY", + "P2SH(P2PK) with non-push scriptSig" +], ["The End"] ] diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index 88bec7238c..f7d1531698 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -649,6 +649,18 @@ nSequences are max. "", "3-of-3 NOT with invalid sig and nonzero dummy but no NULLDUMMY" ], +[ + "0 0x47 0x3044022002a27769ee33db258bdf7a3792e7da4143ec4001b551f73e6a190b8d1bde449d02206742c56ccd94a7a2e16ca52fc1ae4a0aa122b0014a867a80de104f9cb18e472c01 DUP", + "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", + "", + "2-of-2 with two identical keys and sigs pushed using OP_DUP but no SIGPUSHONLY" +], +[ + "0 0x47 0x304402203acf75dd59bbef171aeeedae4f1020b824195820db82575c2b323b8899f95de9022067df297d3a5fad049ba0bb81255d0e495643cbcf9abae9e396988618bc0c6dfe01 0x47 0x304402205f8b859230c1cab7d4e8de38ff244d2ebe046b64e8d3f4219b01e483c203490a022071bdc488e31b557f7d9e5c8a8bec90dc92289ca70fa317685f4f140e38b30c4601", + "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", + "SIGPUSHONLY", + "2-of-2 with two identical keys and sigs pushed" +], ["The End"] ] diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index d3fc673a79..0729119017 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -1,5 +1,5 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2011-2014 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "data/script_invalid.json.h" @@ -171,12 +171,14 @@ public: TestBuilder& Add(const CScript& script) { + DoPush(); spendTx.vin[0].scriptSig += script; return *this; } TestBuilder& Num(int num) { + DoPush(); spendTx.vin[0].scriptSig << CScriptNum(num); return *this; } @@ -402,6 +404,23 @@ BOOST_AUTO_TEST_CASE(script_build) "3-of-3 NOT with invalid sig with nonzero dummy", SCRIPT_VERIFY_NULLDUMMY ).Num(1).PushSig(keys.key0).PushSig(keys.key1).PushSig(keys.key2).DamagePush(10)); + good.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey1C) << OP_2 << OP_CHECKMULTISIG, + "2-of-2 with two identical keys and sigs pushed using OP_DUP but no SIGPUSHONLY", 0 + ).Num(0).PushSig(keys.key1).Add(CScript() << OP_DUP)); + bad.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey1C) << OP_2 << OP_CHECKMULTISIG, + "2-of-2 with two identical keys and sigs pushed using OP_DUP", SCRIPT_VERIFY_SIGPUSHONLY + ).Num(0).PushSig(keys.key1).Add(CScript() << OP_DUP)); + bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG, + "P2SH(P2PK) with non-push scriptSig but no SIGPUSHONLY", 0 + ).PushSig(keys.key2).PushRedeem()); + bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG, + "P2SH(P2PK) with non-push scriptSig", SCRIPT_VERIFY_SIGPUSHONLY + ).PushSig(keys.key2).PushRedeem()); + good.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey1C) << OP_2 << OP_CHECKMULTISIG, + "2-of-2 with two identical keys and sigs pushed", SCRIPT_VERIFY_SIGPUSHONLY + ).Num(0).PushSig(keys.key1).PushSig(keys.key1)); + + std::map tests_good; std::map tests_bad; diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 41ccaaac94..9209c6697f 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -33,6 +33,7 @@ static std::map mapFlagNames = boost::assign::map_list_of (string("STRICTENC"), (unsigned int)SCRIPT_VERIFY_STRICTENC) (string("DERSIG"), (unsigned int)SCRIPT_VERIFY_DERSIG) (string("LOW_S"), (unsigned int)SCRIPT_VERIFY_LOW_S) + (string("SIGPUSHONLY"), (unsigned int)SCRIPT_VERIFY_SIGPUSHONLY) (string("NULLDUMMY"), (unsigned int)SCRIPT_VERIFY_NULLDUMMY); unsigned int ParseScriptFlags(string strFlags) From 698c6abb25c1fbbc7fa4ba46b60e9f17d97332ef Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 8 Oct 2014 18:48:59 -0700 Subject: [PATCH 0921/1288] Add SCRIPT_VERIFY_MINIMALDATA (BIP62 rules 3 and 4) Also use the new flag as a standard rule, and replace the IsCanonicalPush standardness check with it (as it is more complete). --- src/main.cpp | 4 --- src/script/interpreter.cpp | 51 ++++++++++++++++++++++++------- src/script/interpreter.h | 7 +++++ src/script/script.cpp | 29 +----------------- src/script/script.h | 18 ++++++----- src/script/standard.h | 1 + src/test/data/script_invalid.json | 4 +++ src/test/data/script_valid.json | 31 +++++++++++++++++-- src/test/script_tests.cpp | 10 +++--- src/test/scriptnum_tests.cpp | 4 +-- src/test/transaction_tests.cpp | 1 + 11 files changed, 101 insertions(+), 59 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 0cfe90beda..008a059103 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -633,10 +633,6 @@ bool IsStandardTx(const CTransaction& tx, string& reason) reason = "scriptsig-not-pushonly"; return false; } - if (!txin.scriptSig.HasCanonicalPushes()) { - reason = "scriptsig-non-canonical-push"; - return false; - } } unsigned int nDataOut = 0; diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index e463de8cc2..11c909472a 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -157,6 +157,29 @@ bool static CheckPubKeyEncoding(const valtype &vchSig, unsigned int flags) { return true; } +bool static CheckMinimalPush(const valtype& data, opcodetype opcode) { + if (data.size() == 0) { + // Could have used OP_0. + return opcode == OP_0; + } else if (data.size() == 1 && data[0] >= 1 && data[0] <= 16) { + // Could have used OP_1 .. OP_16. + return opcode == OP_1 + (data[0] - 1); + } else if (data.size() == 1 && data[0] == 0x81) { + // Could have used OP_1NEGATE. + return opcode == OP_1NEGATE; + } else if (data.size() <= 75) { + // Could have used a direct push (opcode indicating number of bytes pushed + those bytes). + return opcode == data.size(); + } else if (data.size() <= 255) { + // Could have used OP_PUSHDATA. + return opcode == OP_PUSHDATA1; + } else if (data.size() <= 65535) { + // Could have used OP_PUSHDATA2. + return opcode == OP_PUSHDATA2; + } + return true; +} + bool EvalScript(vector >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker) { CScript::const_iterator pc = script.begin(); @@ -169,6 +192,7 @@ bool EvalScript(vector >& stack, const CScript& script, un if (script.size() > 10000) return false; int nOpCount = 0; + bool fRequireMinimal = (flags & SCRIPT_VERIFY_MINIMALDATA) != 0; try { @@ -205,9 +229,12 @@ bool EvalScript(vector >& stack, const CScript& script, un opcode == OP_RSHIFT) return false; // Disabled opcodes. - if (fExec && 0 <= opcode && opcode <= OP_PUSHDATA4) + if (fExec && 0 <= opcode && opcode <= OP_PUSHDATA4) { + if (fRequireMinimal && !CheckMinimalPush(vchPushValue, opcode)) { + return false; + } stack.push_back(vchPushValue); - else if (fExec || (OP_IF <= opcode && opcode <= OP_ENDIF)) + } else if (fExec || (OP_IF <= opcode && opcode <= OP_ENDIF)) switch (opcode) { // @@ -234,6 +261,8 @@ bool EvalScript(vector >& stack, const CScript& script, un // ( -- value) CScriptNum bn((int)opcode - (int)(OP_1 - 1)); stack.push_back(bn.getvch()); + // The result of these opcodes should always be the minimal way to push the data + // they push, so no need for a CheckMinimalPush here. } break; @@ -458,7 +487,7 @@ bool EvalScript(vector >& stack, const CScript& script, un // (xn ... x2 x1 x0 n - ... x2 x1 x0 xn) if (stack.size() < 2) return false; - int n = CScriptNum(stacktop(-1)).getint(); + int n = CScriptNum(stacktop(-1), fRequireMinimal).getint(); popstack(stack); if (n < 0 || n >= (int)stack.size()) return false; @@ -557,7 +586,7 @@ bool EvalScript(vector >& stack, const CScript& script, un // (in -- out) if (stack.size() < 1) return false; - CScriptNum bn(stacktop(-1)); + CScriptNum bn(stacktop(-1), fRequireMinimal); switch (opcode) { case OP_1ADD: bn += bnOne; break; @@ -590,8 +619,8 @@ bool EvalScript(vector >& stack, const CScript& script, un // (x1 x2 -- out) if (stack.size() < 2) return false; - CScriptNum bn1(stacktop(-2)); - CScriptNum bn2(stacktop(-1)); + CScriptNum bn1(stacktop(-2), fRequireMinimal); + CScriptNum bn2(stacktop(-1), fRequireMinimal); CScriptNum bn(0); switch (opcode) { @@ -635,9 +664,9 @@ bool EvalScript(vector >& stack, const CScript& script, un // (x min max -- out) if (stack.size() < 3) return false; - CScriptNum bn1(stacktop(-3)); - CScriptNum bn2(stacktop(-2)); - CScriptNum bn3(stacktop(-1)); + CScriptNum bn1(stacktop(-3), fRequireMinimal); + CScriptNum bn2(stacktop(-2), fRequireMinimal); + CScriptNum bn3(stacktop(-1), fRequireMinimal); bool fValue = (bn2 <= bn1 && bn1 < bn3); popstack(stack); popstack(stack); @@ -727,7 +756,7 @@ bool EvalScript(vector >& stack, const CScript& script, un if ((int)stack.size() < i) return false; - int nKeysCount = CScriptNum(stacktop(-i)).getint(); + int nKeysCount = CScriptNum(stacktop(-i), fRequireMinimal).getint(); if (nKeysCount < 0 || nKeysCount > 20) return false; nOpCount += nKeysCount; @@ -738,7 +767,7 @@ bool EvalScript(vector >& stack, const CScript& script, un if ((int)stack.size() < i) return false; - int nSigsCount = CScriptNum(stacktop(-i)).getint(); + int nSigsCount = CScriptNum(stacktop(-i), fRequireMinimal).getint(); if (nSigsCount < 0 || nSigsCount > nKeysCount) return false; int isig = ++i; diff --git a/src/script/interpreter.h b/src/script/interpreter.h index 085cd867da..5133c80aab 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -49,6 +49,13 @@ enum // Using a non-push operator in the scriptSig causes script failure (softfork safe, BIP62 rule 2). SCRIPT_VERIFY_SIGPUSHONLY = (1U << 5), + + // Require minimal encodings for all push operations (OP_0... OP_16, OP_1NEGATE where possible, direct + // pushes up to 75 bytes, OP_PUSHDATA up to 255 bytes, OP_PUSHDATA2 for anything larger). Evaluating + // any other push causes the script to fail (BIP62 rule 3). + // In addition, whenever a stack element is interpreted as a number, it must be of minimal length (BIP62 rule 4). + // (softfork safe) + SCRIPT_VERIFY_MINIMALDATA = (1U << 6) }; uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType); diff --git a/src/script/script.cpp b/src/script/script.cpp index bbcfe9dfdd..b879d72d6b 100644 --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -12,7 +12,7 @@ namespace { inline std::string ValueString(const std::vector& vch) { if (vch.size() <= 4) - return strprintf("%d", CScriptNum(vch).getint()); + return strprintf("%d", CScriptNum(vch, false).getint()); else return HexStr(vch); } @@ -238,33 +238,6 @@ bool CScript::IsPushOnly() const return true; } -bool CScript::HasCanonicalPushes() const -{ - const_iterator pc = begin(); - while (pc < end()) - { - opcodetype opcode; - std::vector data; - if (!GetOp(pc, opcode, data)) - return false; - if (opcode > OP_16) - continue; - if (opcode < OP_PUSHDATA1 && opcode > OP_0 && (data.size() == 1 && data[0] <= 16)) - // Could have used an OP_n code, rather than a 1-byte push. - return false; - if (opcode == OP_PUSHDATA1 && data.size() < OP_PUSHDATA1) - // Could have used a normal n-byte push, rather than OP_PUSHDATA1. - return false; - if (opcode == OP_PUSHDATA2 && data.size() <= 0xFF) - // Could have used an OP_PUSHDATA1. - return false; - if (opcode == OP_PUSHDATA4 && data.size() <= 0xFFFF) - // Could have used an OP_PUSHDATA2. - return false; - } - return true; -} - std::string CScript::ToString() const { std::string str; diff --git a/src/script/script.h b/src/script/script.h index 706a85a29b..e97967dcea 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -192,10 +192,14 @@ public: m_value = n; } - explicit CScriptNum(const std::vector& vch) + explicit CScriptNum(const std::vector& vch, bool fRequireMinimal) { - if (vch.size() > nMaxNumSize) - throw scriptnum_error("CScriptNum(const std::vector&) : overflow"); + if (vch.size() > nMaxNumSize) { + throw scriptnum_error("script number overflow"); + } + if (fRequireMinimal && vch.size() > 0 && (vch.back() & 0x7f) == 0 && (vch.size() <= 1 || (vch[vch.size() - 2] & 0x80) == 0)) { + throw scriptnum_error("non-minimally encoded script number"); + } m_value = set_vch(vch); } @@ -319,7 +323,6 @@ private: int64_t m_value; }; - /** Serialized script, used inside transaction inputs and outputs */ class CScript : public std::vector { @@ -330,6 +333,10 @@ protected: { push_back(n + (OP_1 - 1)); } + else if (n == 0) + { + push_back(OP_0); + } else { *this << CScriptNum::serialize(n); @@ -554,9 +561,6 @@ public: // Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical). bool IsPushOnly() const; - // Called by IsStandardTx. - bool HasCanonicalPushes() const; - // Returns whether the script is guaranteed to fail at execution, // regardless of the initial stack. This allows outputs to be pruned // instantly when entering the UTXO set. diff --git a/src/script/standard.h b/src/script/standard.h index 961b214c89..248b941a64 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -41,6 +41,7 @@ static const unsigned int MANDATORY_SCRIPT_VERIFY_FLAGS = SCRIPT_VERIFY_P2SH; // blocks and we must accept those blocks. static const unsigned int STANDARD_SCRIPT_VERIFY_FLAGS = MANDATORY_SCRIPT_VERIFY_FLAGS | SCRIPT_VERIFY_STRICTENC | + SCRIPT_VERIFY_MINIMALDATA | SCRIPT_VERIFY_NULLDUMMY; // For convenience, standard but not mandatory verify flags. diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index e4dd8fe9aa..5ead65f17f 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -384,6 +384,10 @@ nSequences are max. ["0x00", "'00' EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"], +["1 IF 0x01 0x81 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"], +["1 IF 0x01 0x05 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"], +["1 IF 0x4c 0x03 0x222222 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"], + [ "0x47 0x30440220304eff7556bba9560df47873275e64db45f3cd735998ce3f00d2e57b1bb5f31302205c0c9d14b8b80d43e2ac9b87532f1af6d8a3271262bc694ec4e14068392bb0a001", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index f7d1531698..89619a9ddc 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -529,6 +529,33 @@ nSequences are max. ["0x00", "SIZE 0 EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"], +["0x01 0x81", "0x4f EQUAL", "", "direct push of 0x81 equals 1NEGATE"], +["0x01 0x05", "5 EQUAL", "", "direct push of 0x05 equals 5"], +["0x4c 0x4b 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "0x4b 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 EQUAL", "", "PUSHDATA1 of 75 bytes equals direct push of it"], +["0x4d 0xFF00 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "0x4c 0xFF 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 EQUAL", "", "PUSHDATA2 of 255 bytes equals PUSHDATA1 of it"], +["0x02 0x8000", "128 NUMEQUAL", "", "0x8000 equals 128"], +["0x01 0x00", "0 NUMEQUAL", "", "0x00 numequals 0"], +["0x01 0x80", "0 NUMEQUAL", "", "0x80 (negative zero) numequals 0"], +["0x02 0x0080", "0 NUMEQUAL", "", "0x0080 numequals 0"], +["0x02 0x0500", "5 NUMEQUAL", "", "0x0500 numequals 5"], +["0x03 0xff7f80", "0x02 0xffff NUMEQUAL", "", ""], +["0x03 0xff7f00", "0x02 0xff7f NUMEQUAL", "", ""], +["0x04 0xffff7f80", "0x03 0xffffff NUMEQUAL", "", ""], +["0x04 0xffff7f00", "0x03 0xffff7f NUMEQUAL", "", ""], +["0 IF 0x01 0x81 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], +["0 IF 0x01 0x05 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], +["0 IF 0x02 0x8000 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], +["0 IF 0x01 0x00 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], +["0 IF 0x01 0x80 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], +["0 IF 0x02 0x0080 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], +["0 IF 0x02 0x0400 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], +["0 IF 0x03 0xff7f80 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], +["0 IF 0x03 0xff7f00 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], +["0 IF 0x04 0xffff7f80 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], +["0 IF 0x04 0xffff7f00 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], +["0 IF 0x4c 0x03 0x222222 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], + + [ "0x47 0x3044022007415aa37ce7eaa6146001ac8bdefca0ddcba0e37c5dc08c4ac99392124ebac802207d382307fd53f65778b07b9c63b6e196edeadf0be719130c5db21ff1e700d67501", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", @@ -638,13 +665,13 @@ nSequences are max. "P2PK NOT with invalid sig and undefined hashtype but no STRICTENC" ], [ - "0x01 0x01 0x47 0x3044022046ce33d1771b0127dd4c4cef8fdc3218ebdfa60e3793ed700292d8ebd93fb1f402201029d47a414db83e96e31443c2d8b552f971469c4800f5eff7df2f0648521aed01 0x47 0x304402205c53911ad55b054920043962bbda98cf6e57e2db1cd5611138251490baabaa8702201dc80dfceae6007e7772dc13ff6e7ca66a983cb017fe5d46d30118462d83bcf801 0x47 0x304402201937e44a4ec12364f9d32f9d25e7ecbc68aee9ef90069af80efef4c05f6ace9602206c515101c00c75710b32ff7ff8dbaf7c9a0be6e86ed14a0755b47626604f31fd01", + "1 0x47 0x3044022046ce33d1771b0127dd4c4cef8fdc3218ebdfa60e3793ed700292d8ebd93fb1f402201029d47a414db83e96e31443c2d8b552f971469c4800f5eff7df2f0648521aed01 0x47 0x304402205c53911ad55b054920043962bbda98cf6e57e2db1cd5611138251490baabaa8702201dc80dfceae6007e7772dc13ff6e7ca66a983cb017fe5d46d30118462d83bcf801 0x47 0x304402201937e44a4ec12364f9d32f9d25e7ecbc68aee9ef90069af80efef4c05f6ace9602206c515101c00c75710b32ff7ff8dbaf7c9a0be6e86ed14a0755b47626604f31fd01", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "", "3-of-3 with nonzero dummy but no NULLDUMMY" ], [ - "0x01 0x01 0x47 0x30440220195038dbc6b2ae1199f86a6777824f7c5149789d85f655a3534a4422b8fba38c02204df9db87d2eb9fe06edc66870d9ac4c9ce673459f9d43cee0347ce4ffb02ee5a01 0x47 0x3044022010a45f30c6fa97a186eba9e6b595ab87d3dfcbf05dcaf1f1b8e3e7bf39515bb802203474e78d3d372e5f5c0f8c257ce8300c4bb8f37c51d4a894e11a91b5817da6ed01 0x47 0x30440220039cffd8e39850f95112662b1220b14b3c0d3d8a2772e13c947bfbf96345a64e02204154bfa77e2c0134d5434353bed82141e5da1cc479954aa288d5f0671480a04b01", + "1 0x47 0x30440220195038dbc6b2ae1199f86a6777824f7c5149789d85f655a3534a4422b8fba38c02204df9db87d2eb9fe06edc66870d9ac4c9ce673459f9d43cee0347ce4ffb02ee5a01 0x47 0x3044022010a45f30c6fa97a186eba9e6b595ab87d3dfcbf05dcaf1f1b8e3e7bf39515bb802203474e78d3d372e5f5c0f8c257ce8300c4bb8f37c51d4a894e11a91b5817da6ed01 0x47 0x30440220039cffd8e39850f95112662b1220b14b3c0d3d8a2772e13c947bfbf96345a64e02204154bfa77e2c0134d5434353bed82141e5da1cc479954aa288d5f0671480a04b01", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG NOT", "", "3-of-3 NOT with invalid sig and nonzero dummy but no NULLDUMMY" diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 0729119017..a41552fea1 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -179,7 +179,7 @@ public: TestBuilder& Num(int num) { DoPush(); - spendTx.vin[0].scriptSig << CScriptNum(num); + spendTx.vin[0].scriptSig << num; return *this; } @@ -788,19 +788,19 @@ BOOST_AUTO_TEST_CASE(script_combineSigs) BOOST_AUTO_TEST_CASE(script_standard_push) { - for (int i=0; i<1000; i++) { + for (int i=0; i<67000; i++) { CScript script; script << i; BOOST_CHECK_MESSAGE(script.IsPushOnly(), "Number " << i << " is not pure push."); - BOOST_CHECK_MESSAGE(script.HasCanonicalPushes(), "Number " << i << " push is not canonical."); + BOOST_CHECK_MESSAGE(VerifyScript(script, CScript() << OP_1, SCRIPT_VERIFY_MINIMALDATA, BaseSignatureChecker()), "Number " << i << " push is not minimal data."); } - for (int i=0; i<1000; i++) { + for (unsigned int i=0; i<=MAX_SCRIPT_ELEMENT_SIZE; i++) { std::vector data(i, '\111'); CScript script; script << data; BOOST_CHECK_MESSAGE(script.IsPushOnly(), "Length " << i << " is not pure push."); - BOOST_CHECK_MESSAGE(script.HasCanonicalPushes(), "Length " << i << " push is not canonical."); + BOOST_CHECK_MESSAGE(VerifyScript(script, CScript() << OP_1, SCRIPT_VERIFY_MINIMALDATA, BaseSignatureChecker()), "Length " << i << " push is not minimal data."); } } diff --git a/src/test/scriptnum_tests.cpp b/src/test/scriptnum_tests.cpp index ac60fa426f..5621e12729 100644 --- a/src/test/scriptnum_tests.cpp +++ b/src/test/scriptnum_tests.cpp @@ -25,11 +25,11 @@ static void CheckCreateVch(const int64_t& num) BOOST_CHECK(verify(bignum, scriptnum)); CBigNum bignum2(bignum.getvch()); - CScriptNum scriptnum2(scriptnum.getvch()); + CScriptNum scriptnum2(scriptnum.getvch(), false); BOOST_CHECK(verify(bignum2, scriptnum2)); CBigNum bignum3(scriptnum2.getvch()); - CScriptNum scriptnum3(bignum2.getvch()); + CScriptNum scriptnum3(bignum2.getvch(), false); BOOST_CHECK(verify(bignum3, scriptnum3)); } diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 9209c6697f..c46c31e99f 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -34,6 +34,7 @@ static std::map mapFlagNames = boost::assign::map_list_of (string("DERSIG"), (unsigned int)SCRIPT_VERIFY_DERSIG) (string("LOW_S"), (unsigned int)SCRIPT_VERIFY_LOW_S) (string("SIGPUSHONLY"), (unsigned int)SCRIPT_VERIFY_SIGPUSHONLY) + (string("MINIMALDATA"), (unsigned int)SCRIPT_VERIFY_MINIMALDATA) (string("NULLDUMMY"), (unsigned int)SCRIPT_VERIFY_NULLDUMMY); unsigned int ParseScriptFlags(string strFlags) From 6004e77b926b5588e4b8eebdff843fe6652e5885 Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Tue, 14 Oct 2014 11:18:24 -0400 Subject: [PATCH 0922/1288] Improve CScriptNum() comment Edited-by: Pieter Wuille --- src/script/script.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/script/script.h b/src/script/script.h index e97967dcea..05f2e7e3a9 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -197,8 +197,23 @@ public: if (vch.size() > nMaxNumSize) { throw scriptnum_error("script number overflow"); } - if (fRequireMinimal && vch.size() > 0 && (vch.back() & 0x7f) == 0 && (vch.size() <= 1 || (vch[vch.size() - 2] & 0x80) == 0)) { - throw scriptnum_error("non-minimally encoded script number"); + if (fRequireMinimal && vch.size() > 0) { + // Check that the number is encoded with the minimum possible + // number of bytes. + // + // If the most-significant-byte - excluding the sign bit - is zero + // then we're not minimal. Note how this test also rejects the + // negative-zero encoding, 0x80. + if ((vch.back() & 0x7f) == 0) { + // One exception: if there's more than one byte and the most + // significant bit of the second-most-significant-byte is set + // it would conflict with the sign bit. An example of this case + // is +-255, which encode to 0xff00 and 0xff80 respectively. + // (big-endian). + if (vch.size() <= 1 || (vch[vch.size() - 2] & 0x80) == 0) { + throw scriptnum_error("non-minimally encoded script number"); + } + } } m_value = set_vch(vch); } From 554147ad9e6fee1c1d3827ca971647a97a5c0d66 Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Tue, 14 Oct 2014 13:38:17 -0400 Subject: [PATCH 0923/1288] Ensure MINIMALDATA invalid tests can only fail one way Removes the need for the 'negated' versions of the tests, and ensures other failures don't mask what we're trying to test. --- src/test/data/script_invalid.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index 5ead65f17f..c5d8781029 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -384,6 +384,18 @@ nSequences are max. ["0x00", "'00' EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"], +["0x01 0x81", "DROP 1", "MINIMALDATA", "direct push of 0x81 equals 1NEGATE"], +["0x01 0x05", "DROP 1", "MINIMALDATA", "direct push of 0x05 equals 5"], +["0x4c 0x48 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "DROP 1", "MINIMALDATA", "PUSHDATA1 of 72 bytes equals direct push of it"], +["0x4d 0xFF00 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "DROP 1", "MINIMALDATA", "PUSHDATA2 of 255 bytes equals PUSHDATA1 of it"], +["0x01 0x00", "NOT DROP 1", "MINIMALDATA", "0x00 numequals 0"], +["0x01 0x80", "NOT DROP 1", "MINIMALDATA", "0x80 (negative zero) numequals 0"], +["0x02 0x0080", "NOT DROP 1", "MINIMALDATA", "0x0080 numequals 0"], +["0x02 0x0500", "NOT DROP 1", "MINIMALDATA", "0x0500 numequals 5"], +["0x03 0xff7f80", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is ffff"], +["0x03 0xff7f00", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is ff7f"], +["0x04 0xffff7f80", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is ffffff"], +["0x04 0xffff7f00", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is ffff7f"], ["1 IF 0x01 0x81 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"], ["1 IF 0x01 0x05 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"], ["1 IF 0x4c 0x03 0x222222 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"], From dfeec18b85a3a209899dddd6af0ca47dfe48c4d4 Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Tue, 14 Oct 2014 14:24:13 -0400 Subject: [PATCH 0924/1288] Test every numeric-accepting opcode for correct handling of the numeric minimal encoding rule --- src/test/data/script_invalid.json | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index c5d8781029..3e7bbe73de 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -400,6 +400,56 @@ nSequences are max. ["1 IF 0x01 0x05 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"], ["1 IF 0x4c 0x03 0x222222 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"], + +["Test every numeric-accepting opcode for correct handling of the numeric minimal encoding rule"], + +["1 0x02 0x0000", "PICK DROP", "MINIMALDATA"], +["1 0x02 0x0000", "ROLL DROP 1", "MINIMALDATA"], +["0x02 0x0000", "1ADD DROP 1", "MINIMALDATA"], +["0x02 0x0000", "1SUB DROP 1", "MINIMALDATA"], +["0x02 0x0000", "NEGATE DROP 1", "MINIMALDATA"], +["0x02 0x0000", "ABS DROP 1", "MINIMALDATA"], +["0x02 0x0000", "NOT DROP 1", "MINIMALDATA"], +["0x02 0x0000", "0NOTEQUAL DROP 1", "MINIMALDATA"], + +["0 0x02 0x0000", "ADD DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "ADD DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "SUB DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "SUB DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "BOOLAND DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "BOOLAND DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "BOOLOR DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "BOOLOR DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "NUMEQUAL DROP 1", "MINIMALDATA"], +["0x02 0x0000 1", "NUMEQUAL DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "NUMEQUALVERIFY 1", "MINIMALDATA"], +["0x02 0x0000 0", "NUMEQUALVERIFY 1", "MINIMALDATA"], +["0 0x02 0x0000", "NUMNOTEQUAL DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "NUMNOTEQUAL DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "LESSTHAN DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "LESSTHAN DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "GREATERTHAN DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "GREATERTHAN DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "LESSTHANOREQUAL DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "LESSTHANOREQUAL DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "GREATERTHANOREQUAL DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "GREATERTHANOREQUAL DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "MIN DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "MIN DROP 1", "MINIMALDATA"], +["0 0x02 0x0000", "MAX DROP 1", "MINIMALDATA"], +["0x02 0x0000 0", "MAX DROP 1", "MINIMALDATA"], + +["0x02 0x0000 0 0", "WITHIN DROP 1", "MINIMALDATA"], +["0 0x02 0x0000 0", "WITHIN DROP 1", "MINIMALDATA"], +["0 0 0x02 0x0000", "WITHIN DROP 1", "MINIMALDATA"], + +["0 0 0x02 0x0000", "CHECKMULTISIG DROP 1", "MINIMALDATA"], +["0 0x02 0x0000 0", "CHECKMULTISIG DROP 1", "MINIMALDATA"], +["0 0x02 0x0000 0 1", "CHECKMULTISIG DROP 1", "MINIMALDATA"], +["0 0 0x02 0x0000", "CHECKMULTISIGVERIFY 1", "MINIMALDATA"], +["0 0x02 0x0000 0", "CHECKMULTISIGVERIFY 1", "MINIMALDATA"], + + [ "0x47 0x30440220304eff7556bba9560df47873275e64db45f3cd735998ce3f00d2e57b1bb5f31302205c0c9d14b8b80d43e2ac9b87532f1af6d8a3271262bc694ec4e14068392bb0a001", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", From 2b62e1796bb58d1ef2e2a83e42958111467f0562 Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Tue, 14 Oct 2014 15:08:48 -0400 Subject: [PATCH 0925/1288] Clearly separate PUSHDATA and numeric argument MINIMALDATA tests --- src/test/data/script_invalid.json | 59 +++++++++++++++------ src/test/data/script_valid.json | 85 +++++++++++++++++++++++++------ 2 files changed, 114 insertions(+), 30 deletions(-) diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index 3e7bbe73de..6f451a36ee 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -384,22 +384,51 @@ nSequences are max. ["0x00", "'00' EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"], -["0x01 0x81", "DROP 1", "MINIMALDATA", "direct push of 0x81 equals 1NEGATE"], -["0x01 0x05", "DROP 1", "MINIMALDATA", "direct push of 0x05 equals 5"], -["0x4c 0x48 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "DROP 1", "MINIMALDATA", "PUSHDATA1 of 72 bytes equals direct push of it"], -["0x4d 0xFF00 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "DROP 1", "MINIMALDATA", "PUSHDATA2 of 255 bytes equals PUSHDATA1 of it"], -["0x01 0x00", "NOT DROP 1", "MINIMALDATA", "0x00 numequals 0"], -["0x01 0x80", "NOT DROP 1", "MINIMALDATA", "0x80 (negative zero) numequals 0"], -["0x02 0x0080", "NOT DROP 1", "MINIMALDATA", "0x0080 numequals 0"], -["0x02 0x0500", "NOT DROP 1", "MINIMALDATA", "0x0500 numequals 5"], -["0x03 0xff7f80", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is ffff"], -["0x03 0xff7f00", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is ff7f"], -["0x04 0xffff7f80", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is ffffff"], -["0x04 0xffff7f00", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is ffff7f"], -["1 IF 0x01 0x81 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"], -["1 IF 0x01 0x05 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"], -["1 IF 0x4c 0x03 0x222222 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"], +["MINIMALDATA enforcement for PUSHDATAs"], +["0x4c 0x00", "DROP 1", "MINIMALDATA", "Empty vector minimally represented by OP_0"], +["0x01 0x81", "DROP 1", "MINIMALDATA", "-1 minimally represented by OP_1NEGATE"], +["0x01 0x01", "DROP 1", "MINIMALDATA", "1 to 16 minimally represented by OP_1 to OP_16"], +["0x01 0x02", "DROP 1", "MINIMALDATA"], +["0x01 0x03", "DROP 1", "MINIMALDATA"], +["0x01 0x04", "DROP 1", "MINIMALDATA"], +["0x01 0x05", "DROP 1", "MINIMALDATA"], +["0x01 0x06", "DROP 1", "MINIMALDATA"], +["0x01 0x07", "DROP 1", "MINIMALDATA"], +["0x01 0x08", "DROP 1", "MINIMALDATA"], +["0x01 0x09", "DROP 1", "MINIMALDATA"], +["0x01 0x0a", "DROP 1", "MINIMALDATA"], +["0x01 0x0b", "DROP 1", "MINIMALDATA"], +["0x01 0x0c", "DROP 1", "MINIMALDATA"], +["0x01 0x0d", "DROP 1", "MINIMALDATA"], +["0x01 0x0e", "DROP 1", "MINIMALDATA"], +["0x01 0x0f", "DROP 1", "MINIMALDATA"], +["0x01 0x10", "DROP 1", "MINIMALDATA"], + +["0x4c 0x48 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "DROP 1", "MINIMALDATA", + "PUSHDATA1 of 72 bytes minimally represented by direct push"], + +["0x4d 0xFF00 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "DROP 1", "MINIMALDATA", + "PUSHDATA2 of 255 bytes minimally represented by PUSHDATA1"], + +["0x4f 0x00100000 0x11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "DROP 1", "MINIMALDATA", + "PUSHDATA4 of 256 bytes minimally represented by PUSHDATA2"], + + +["MINIMALDATA enforcement for numeric arguments"], + +["0x01 0x00", "NOT DROP 1", "MINIMALDATA", "numequals 0"], +["0x02 0x0000", "NOT DROP 1", "MINIMALDATA", "numequals 0"], +["0x01 0x80", "NOT DROP 1", "MINIMALDATA", "0x80 (negative zero) numequals 0"], +["0x02 0x0080", "NOT DROP 1", "MINIMALDATA", "numequals 0"], +["0x02 0x0500", "NOT DROP 1", "MINIMALDATA", "numequals 5"], +["0x03 0x050000", "NOT DROP 1", "MINIMALDATA", "numequals 5"], +["0x02 0x0580", "NOT DROP 1", "MINIMALDATA", "numequals -5"], +["0x03 0x050080", "NOT DROP 1", "MINIMALDATA", "numequals -5"], +["0x03 0xff7f80", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is 0xffff"], +["0x03 0xff7f00", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is 0xff7f"], +["0x04 0xffff7f80", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is 0xffffff"], +["0x04 0xffff7f00", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is 0xffff7f"], ["Test every numeric-accepting opcode for correct handling of the numeric minimal encoding rule"], diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index 89619a9ddc..b2601deb53 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -527,12 +527,35 @@ nSequences are max. "P2SH,STRICTENC", "Basic PUSHDATA1 signedness check"], -["0x00", "SIZE 0 EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"], +["all PUSHDATA forms are equivalent"], -["0x01 0x81", "0x4f EQUAL", "", "direct push of 0x81 equals 1NEGATE"], -["0x01 0x05", "5 EQUAL", "", "direct push of 0x05 equals 5"], ["0x4c 0x4b 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "0x4b 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 EQUAL", "", "PUSHDATA1 of 75 bytes equals direct push of it"], ["0x4d 0xFF00 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "0x4c 0xFF 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 EQUAL", "", "PUSHDATA2 of 255 bytes equals PUSHDATA1 of it"], + +["0x00", "SIZE 0 EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"], + +["Numeric pushes"], + +["0x01 0x81", "0x4f EQUAL", "", "OP1_NEGATE pushes 0x81"], +["0x01 0x01", "0x51 EQUAL", "", "OP_1 pushes 0x01"], +["0x01 0x02", "0x52 EQUAL", "", "OP_2 pushes 0x02"], +["0x01 0x03", "0x53 EQUAL", "", "OP_3 pushes 0x03"], +["0x01 0x04", "0x54 EQUAL", "", "OP_4 pushes 0x04"], +["0x01 0x05", "0x55 EQUAL", "", "OP_5 pushes 0x05"], +["0x01 0x06", "0x56 EQUAL", "", "OP_6 pushes 0x06"], +["0x01 0x07", "0x57 EQUAL", "", "OP_7 pushes 0x07"], +["0x01 0x08", "0x58 EQUAL", "", "OP_8 pushes 0x08"], +["0x01 0x09", "0x59 EQUAL", "", "OP_9 pushes 0x09"], +["0x01 0x0a", "0x5a EQUAL", "", "OP_10 pushes 0x0a"], +["0x01 0x0b", "0x5b EQUAL", "", "OP_11 pushes 0x0b"], +["0x01 0x0c", "0x5c EQUAL", "", "OP_12 pushes 0x0c"], +["0x01 0x0d", "0x5d EQUAL", "", "OP_13 pushes 0x0d"], +["0x01 0x0e", "0x5e EQUAL", "", "OP_14 pushes 0x0e"], +["0x01 0x0f", "0x5f EQUAL", "", "OP_15 pushes 0x0f"], +["0x01 0x10", "0x60 EQUAL", "", "OP_16 pushes 0x10"], + +["Equivalency of different numeric encodings"], + ["0x02 0x8000", "128 NUMEQUAL", "", "0x8000 equals 128"], ["0x01 0x00", "0 NUMEQUAL", "", "0x00 numequals 0"], ["0x01 0x80", "0 NUMEQUAL", "", "0x80 (negative zero) numequals 0"], @@ -542,19 +565,51 @@ nSequences are max. ["0x03 0xff7f00", "0x02 0xff7f NUMEQUAL", "", ""], ["0x04 0xffff7f80", "0x03 0xffffff NUMEQUAL", "", ""], ["0x04 0xffff7f00", "0x03 0xffff7f NUMEQUAL", "", ""], -["0 IF 0x01 0x81 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], -["0 IF 0x01 0x05 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], -["0 IF 0x02 0x8000 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], -["0 IF 0x01 0x00 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], -["0 IF 0x01 0x80 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], -["0 IF 0x02 0x0080 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], -["0 IF 0x02 0x0400 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], -["0 IF 0x03 0xff7f80 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], -["0 IF 0x03 0xff7f00 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], -["0 IF 0x04 0xffff7f80 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], -["0 IF 0x04 0xffff7f00 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], -["0 IF 0x4c 0x03 0x222222 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"], +["Unevaluated non-minimal pushes are ignored"], + +["0 IF 0x4c 0x00 ENDIF 1", "", "MINIMALDATA", "non-minimal PUSHDATA1 ignored"], +["0 IF 0x4d 0x0000 ENDIF 1", "", "MINIMALDATA", "non-minimal PUSHDATA2 ignored"], +["0 IF 0x4c 0x00000000 ENDIF 1", "", "MINIMALDATA", "non-minimal PUSHDATA4 ignored"], +["0 IF 0x01 0x81 ENDIF 1", "", "MINIMALDATA", "1NEGATE equiv"], +["0 IF 0x01 0x01 ENDIF 1", "", "MINIMALDATA", "OP_1 equiv"], +["0 IF 0x01 0x02 ENDIF 1", "", "MINIMALDATA", "OP_2 equiv"], +["0 IF 0x01 0x03 ENDIF 1", "", "MINIMALDATA", "OP_3 equiv"], +["0 IF 0x01 0x04 ENDIF 1", "", "MINIMALDATA", "OP_4 equiv"], +["0 IF 0x01 0x05 ENDIF 1", "", "MINIMALDATA", "OP_5 equiv"], +["0 IF 0x01 0x06 ENDIF 1", "", "MINIMALDATA", "OP_6 equiv"], +["0 IF 0x01 0x07 ENDIF 1", "", "MINIMALDATA", "OP_7 equiv"], +["0 IF 0x01 0x08 ENDIF 1", "", "MINIMALDATA", "OP_8 equiv"], +["0 IF 0x01 0x09 ENDIF 1", "", "MINIMALDATA", "OP_9 equiv"], +["0 IF 0x01 0x0a ENDIF 1", "", "MINIMALDATA", "OP_10 equiv"], +["0 IF 0x01 0x0b ENDIF 1", "", "MINIMALDATA", "OP_11 equiv"], +["0 IF 0x01 0x0c ENDIF 1", "", "MINIMALDATA", "OP_12 equiv"], +["0 IF 0x01 0x0d ENDIF 1", "", "MINIMALDATA", "OP_13 equiv"], +["0 IF 0x01 0x0e ENDIF 1", "", "MINIMALDATA", "OP_14 equiv"], +["0 IF 0x01 0x0f ENDIF 1", "", "MINIMALDATA", "OP_15 equiv"], +["0 IF 0x01 0x10 ENDIF 1", "", "MINIMALDATA", "OP_16 equiv"], + +["Numeric minimaldata rules are only applied when a stack item is numerically evaluated; the push itself is allowed"], + +["0x01 0x00", "1", "MINIMALDATA"], +["0x01 0x80", "1", "MINIMALDATA"], +["0x02 0x0180", "1", "MINIMALDATA"], +["0x02 0x0100", "1", "MINIMALDATA"], +["0x02 0x0200", "1", "MINIMALDATA"], +["0x02 0x0300", "1", "MINIMALDATA"], +["0x02 0x0400", "1", "MINIMALDATA"], +["0x02 0x0500", "1", "MINIMALDATA"], +["0x02 0x0600", "1", "MINIMALDATA"], +["0x02 0x0700", "1", "MINIMALDATA"], +["0x02 0x0800", "1", "MINIMALDATA"], +["0x02 0x0900", "1", "MINIMALDATA"], +["0x02 0x0a00", "1", "MINIMALDATA"], +["0x02 0x0b00", "1", "MINIMALDATA"], +["0x02 0x0c00", "1", "MINIMALDATA"], +["0x02 0x0d00", "1", "MINIMALDATA"], +["0x02 0x0e00", "1", "MINIMALDATA"], +["0x02 0x0f00", "1", "MINIMALDATA"], +["0x02 0x1000", "1", "MINIMALDATA"], [ "0x47 0x3044022007415aa37ce7eaa6146001ac8bdefca0ddcba0e37c5dc08c4ac99392124ebac802207d382307fd53f65778b07b9c63b6e196edeadf0be719130c5db21ff1e700d67501", From 16d78bd68e1488a2a84e368b50bf511c77392d2e Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Tue, 14 Oct 2014 16:00:29 -0400 Subject: [PATCH 0926/1288] Add valid invert of invalid every numeric opcode tests --- src/test/data/script_valid.json | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index b2601deb53..439c82ef32 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -611,6 +611,55 @@ nSequences are max. ["0x02 0x0f00", "1", "MINIMALDATA"], ["0x02 0x1000", "1", "MINIMALDATA"], +["Valid version of the 'Test every numeric-accepting opcode for correct handling of the numeric minimal encoding rule' script_invalid test"], + +["1 0x02 0x0000", "PICK DROP", ""], +["1 0x02 0x0000", "ROLL DROP 1", ""], +["0x02 0x0000", "1ADD DROP 1", ""], +["0x02 0x0000", "1SUB DROP 1", ""], +["0x02 0x0000", "NEGATE DROP 1", ""], +["0x02 0x0000", "ABS DROP 1", ""], +["0x02 0x0000", "NOT DROP 1", ""], +["0x02 0x0000", "0NOTEQUAL DROP 1", ""], + +["0 0x02 0x0000", "ADD DROP 1", ""], +["0x02 0x0000 0", "ADD DROP 1", ""], +["0 0x02 0x0000", "SUB DROP 1", ""], +["0x02 0x0000 0", "SUB DROP 1", ""], +["0 0x02 0x0000", "BOOLAND DROP 1", ""], +["0x02 0x0000 0", "BOOLAND DROP 1", ""], +["0 0x02 0x0000", "BOOLOR DROP 1", ""], +["0x02 0x0000 0", "BOOLOR DROP 1", ""], +["0 0x02 0x0000", "NUMEQUAL DROP 1", ""], +["0x02 0x0000 1", "NUMEQUAL DROP 1", ""], +["0 0x02 0x0000", "NUMEQUALVERIFY 1", ""], +["0x02 0x0000 0", "NUMEQUALVERIFY 1", ""], +["0 0x02 0x0000", "NUMNOTEQUAL DROP 1", ""], +["0x02 0x0000 0", "NUMNOTEQUAL DROP 1", ""], +["0 0x02 0x0000", "LESSTHAN DROP 1", ""], +["0x02 0x0000 0", "LESSTHAN DROP 1", ""], +["0 0x02 0x0000", "GREATERTHAN DROP 1", ""], +["0x02 0x0000 0", "GREATERTHAN DROP 1", ""], +["0 0x02 0x0000", "LESSTHANOREQUAL DROP 1", ""], +["0x02 0x0000 0", "LESSTHANOREQUAL DROP 1", ""], +["0 0x02 0x0000", "GREATERTHANOREQUAL DROP 1", ""], +["0x02 0x0000 0", "GREATERTHANOREQUAL DROP 1", ""], +["0 0x02 0x0000", "MIN DROP 1", ""], +["0x02 0x0000 0", "MIN DROP 1", ""], +["0 0x02 0x0000", "MAX DROP 1", ""], +["0x02 0x0000 0", "MAX DROP 1", ""], + +["0x02 0x0000 0 0", "WITHIN DROP 1", ""], +["0 0x02 0x0000 0", "WITHIN DROP 1", ""], +["0 0 0x02 0x0000", "WITHIN DROP 1", ""], + +["0 0 0x02 0x0000", "CHECKMULTISIG DROP 1", ""], +["0 0x02 0x0000 0", "CHECKMULTISIG DROP 1", ""], +["0 0x02 0x0000 0 1", "CHECKMULTISIG DROP 1", ""], +["0 0 0x02 0x0000", "CHECKMULTISIGVERIFY 1", ""], +["0 0x02 0x0000 0", "CHECKMULTISIGVERIFY 1", ""], + + [ "0x47 0x3044022007415aa37ce7eaa6146001ac8bdefca0ddcba0e37c5dc08c4ac99392124ebac802207d382307fd53f65778b07b9c63b6e196edeadf0be719130c5db21ff1e700d67501", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", From 2aa632921efd861a7c9968e8faf6c73cb3d62c4a Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Fri, 10 Oct 2014 23:55:14 +0000 Subject: [PATCH 0927/1288] Enable customising node policy for datacarrier data size with a -datacarriersize option --- src/init.cpp | 3 +++ src/script/standard.cpp | 6 ++++-- src/script/standard.h | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 70ac5190d3..a33452aa30 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -17,6 +17,7 @@ #include "miner.h" #include "net.h" #include "rpcserver.h" +#include "script/standard.h" #include "txdb.h" #include "ui_interface.h" #include "util.h" @@ -345,6 +346,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += "\n" + _("Node relay options:") + "\n"; strUsage += " -datacarrier " + strprintf(_("Relay and mine data carrier transactions (default: %u)"), 1) + "\n"; + strUsage += " -datacarriersize " + strprintf(_("Maximum size of data in data carrier transactions we relay and mine (default: %u)"), MAX_OP_RETURN_RELAY) + "\n"; strUsage += "\n" + _("Block creation options:") + "\n"; strUsage += " -blockminsize= " + strprintf(_("Set minimum block size in bytes (default: %u)"), 0) + "\n"; @@ -702,6 +704,7 @@ bool AppInit2(boost::thread_group& threadGroup) #endif // ENABLE_WALLET fIsBareMultisigStd = GetArg("-permitbaremultisig", true) != 0; + nMaxDatacarrierBytes = GetArg("-datacarriersize", nMaxDatacarrierBytes); // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log diff --git a/src/script/standard.cpp b/src/script/standard.cpp index 05938961bc..7356e541a6 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -15,6 +15,8 @@ using namespace std; typedef vector valtype; +unsigned nMaxDatacarrierBytes = MAX_OP_RETURN_RELAY; + CScriptID::CScriptID(const CScript& in) : uint160(in.size() ? Hash160(in.begin(), in.end()) : 0) {} const char* GetTxnOutputType(txnouttype t) @@ -139,8 +141,8 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector MAX_OP_RETURN_RELAY) + // small pushdata, <= nMaxDatacarrierBytes + if (vch1.size() > nMaxDatacarrierBytes) break; } else if (opcode1 != opcode2 || vch1 != vch2) diff --git a/src/script/standard.h b/src/script/standard.h index 961b214c89..d795121e3c 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -26,6 +26,7 @@ public: }; static const unsigned int MAX_OP_RETURN_RELAY = 40; // bytes +extern unsigned nMaxDatacarrierBytes; // Mandatory script verification flags that all new blocks must comply with for // them to be valid. (but old blocks may not comply with) Currently just P2SH, From 071473c55c11c267fe1dec898faf4e3286a3916e Mon Sep 17 00:00:00 2001 From: jtimon Date: Tue, 21 Oct 2014 08:36:09 +0200 Subject: [PATCH 0928/1288] Build util and common before building server --- src/Makefile.am | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 42f325e09d..dbefa71fc6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -36,13 +36,15 @@ LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a LIBBITCOIN_UNIVALUE=univalue/libbitcoin_univalue.a LIBBITCOINQT=qt/libbitcoinqt.a +# Make is not made aware of per-object dependencies to avoid limiting building parallelization +# But to build the less dependent modules first, we manually select their order here: noinst_LIBRARIES = \ - libbitcoin_server.a \ - libbitcoin_common.a \ - libbitcoin_cli.a \ + crypto/libbitcoin_crypto.a \ libbitcoin_util.a \ + libbitcoin_common.a \ univalue/libbitcoin_univalue.a \ - crypto/libbitcoin_crypto.a + libbitcoin_server.a \ + libbitcoin_cli.a if ENABLE_WALLET BITCOIN_INCLUDES += $(BDB_CPPFLAGS) noinst_LIBRARIES += libbitcoin_wallet.a From eda37330911b005f4be0c2d934346b26247d50f5 Mon Sep 17 00:00:00 2001 From: jtimon Date: Thu, 23 Oct 2014 02:05:11 +0200 Subject: [PATCH 0929/1288] MOVEONLY: Move CFeeRate and Amount constants to amount.o --- src/Makefile.am | 1 + src/amount.cpp | 31 +++++++++++++++++++++++++++++ src/amount.h | 43 ++++++++++++++++++++++++++++++++++++++++- src/core.cpp | 23 ---------------------- src/core.h | 41 --------------------------------------- src/init.cpp | 1 + src/main.h | 1 + src/miner.cpp | 1 + src/qt/optionsmodel.cpp | 1 + src/rpcmining.cpp | 1 + src/rpcwallet.cpp | 1 + src/txmempool.h | 1 + src/wallet.h | 1 + 13 files changed, 82 insertions(+), 65 deletions(-) create mode 100644 src/amount.cpp diff --git a/src/Makefile.am b/src/Makefile.am index dbefa71fc6..d5abbc17d3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -208,6 +208,7 @@ univalue_libbitcoin_univalue_a_SOURCES = \ libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_common_a_SOURCES = \ allocators.cpp \ + amount.cpp \ base58.cpp \ chainparams.cpp \ coins.cpp \ diff --git a/src/amount.cpp b/src/amount.cpp new file mode 100644 index 0000000000..e6f5b7d440 --- /dev/null +++ b/src/amount.cpp @@ -0,0 +1,31 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "amount.h" + +#include "tinyformat.h" + +CFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nSize) +{ + if (nSize > 0) + nSatoshisPerK = nFeePaid*1000/nSize; + else + nSatoshisPerK = 0; +} + +CAmount CFeeRate::GetFee(size_t nSize) const +{ + CAmount nFee = nSatoshisPerK*nSize / 1000; + + if (nFee == 0 && nSatoshisPerK > 0) + nFee = nSatoshisPerK; + + return nFee; +} + +std::string CFeeRate::ToString() const +{ + return strprintf("%d.%08d BTC/kB", nSatoshisPerK / COIN, nSatoshisPerK % COIN); +} diff --git a/src/amount.h b/src/amount.h index 831fa1f6ca..c0d37954cb 100644 --- a/src/amount.h +++ b/src/amount.h @@ -6,8 +6,49 @@ #ifndef BITCOIN_AMOUNT_H #define BITCOIN_AMOUNT_H -#include +#include "serialize.h" + +#include +#include typedef int64_t CAmount; +static const CAmount COIN = 100000000; +static const CAmount CENT = 1000000; + +/** No amount larger than this (in satoshi) is valid */ +static const CAmount MAX_MONEY = 21000000 * COIN; +inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } + +/** Type-safe wrapper class to for fee rates + * (how much to pay based on transaction size) + */ +class CFeeRate +{ +private: + CAmount nSatoshisPerK; // unit is satoshis-per-1,000-bytes +public: + CFeeRate() : nSatoshisPerK(0) { } + explicit CFeeRate(const CAmount& _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) { } + CFeeRate(const CAmount& nFeePaid, size_t nSize); + CFeeRate(const CFeeRate& other) { nSatoshisPerK = other.nSatoshisPerK; } + + CAmount GetFee(size_t size) const; // unit returned is satoshis + CAmount GetFeePerK() const { return GetFee(1000); } // satoshis-per-1000-bytes + + friend bool operator<(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK < b.nSatoshisPerK; } + friend bool operator>(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK > b.nSatoshisPerK; } + friend bool operator==(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK == b.nSatoshisPerK; } + friend bool operator<=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK <= b.nSatoshisPerK; } + friend bool operator>=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK >= b.nSatoshisPerK; } + std::string ToString() const; + + ADD_SERIALIZE_METHODS; + + template + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + READWRITE(nSatoshisPerK); + } +}; + #endif // BITCOIN_AMOUNT_H diff --git a/src/core.cpp b/src/core.cpp index 73e6de88e1..ac180cc509 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -59,29 +59,6 @@ std::string CTxOut::ToString() const return strprintf("CTxOut(nValue=%d.%08d, scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30)); } -CFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nSize) -{ - if (nSize > 0) - nSatoshisPerK = nFeePaid*1000/nSize; - else - nSatoshisPerK = 0; -} - -CAmount CFeeRate::GetFee(size_t nSize) const -{ - CAmount nFee = nSatoshisPerK*nSize / 1000; - - if (nFee == 0 && nSatoshisPerK > 0) - nFee = nSatoshisPerK; - - return nFee; -} - -std::string CFeeRate::ToString() const -{ - return strprintf("%d.%08d BTC/kB", nSatoshisPerK / COIN, nSatoshisPerK % COIN); -} - CMutableTransaction::CMutableTransaction() : nVersion(CTransaction::CURRENT_VERSION), nLockTime(0) {} CMutableTransaction::CMutableTransaction(const CTransaction& tx) : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), nLockTime(tx.nLockTime) {} diff --git a/src/core.h b/src/core.h index a024dad740..f7a46da2c1 100644 --- a/src/core.h +++ b/src/core.h @@ -16,13 +16,6 @@ class CTransaction; -static const int64_t COIN = 100000000; -static const int64_t CENT = 1000000; - -/** No amount larger than this (in satoshi) is valid */ -static const CAmount MAX_MONEY = 21000000 * COIN; -inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } - /** An outpoint - a combination of a transaction hash and an index n into its vout */ class COutPoint { @@ -109,40 +102,6 @@ public: std::string ToString() const; }; - - -/** Type-safe wrapper class to for fee rates - * (how much to pay based on transaction size) - */ -class CFeeRate -{ -private: - CAmount nSatoshisPerK; // unit is satoshis-per-1,000-bytes -public: - CFeeRate() : nSatoshisPerK(0) { } - explicit CFeeRate(const CAmount& _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) { } - CFeeRate(const CAmount& nFeePaid, size_t nSize); - CFeeRate(const CFeeRate& other) { nSatoshisPerK = other.nSatoshisPerK; } - - CAmount GetFee(size_t size) const; // unit returned is satoshis - CAmount GetFeePerK() const { return GetFee(1000); } // satoshis-per-1000-bytes - - friend bool operator<(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK < b.nSatoshisPerK; } - friend bool operator>(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK > b.nSatoshisPerK; } - friend bool operator==(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK == b.nSatoshisPerK; } - friend bool operator<=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK <= b.nSatoshisPerK; } - friend bool operator>=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK >= b.nSatoshisPerK; } - std::string ToString() const; - - ADD_SERIALIZE_METHODS; - - template - inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - READWRITE(nSatoshisPerK); - } -}; - - /** An output of a transaction. It contains the public key that the next input * must be able to sign with to claim it. */ diff --git a/src/init.cpp b/src/init.cpp index 70ac5190d3..d928094bba 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -10,6 +10,7 @@ #include "init.h" #include "addrman.h" +#include "amount.h" #include "checkpoints.h" #include "compat/sanity.h" #include "key.h" diff --git a/src/main.h b/src/main.h index 1ef51918c5..2686ed948f 100644 --- a/src/main.h +++ b/src/main.h @@ -10,6 +10,7 @@ #include "config/bitcoin-config.h" #endif +#include "amount.h" #include "chain.h" #include "chainparams.h" #include "coins.h" diff --git a/src/miner.cpp b/src/miner.cpp index eefccfd641..897f7c56d7 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -5,6 +5,7 @@ #include "miner.h" +#include "amount.h" #include "core.h" #include "hash.h" #include "main.h" diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 6db654dff7..c941ebd4ca 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -11,6 +11,7 @@ #include "bitcoinunits.h" #include "guiutil.h" +#include "amount.h" #include "init.h" #include "main.h" #include "net.h" diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index c767835a27..8af3c46348 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -3,6 +3,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include "amount.h" #include "chainparams.h" #include "core_io.h" #include "init.h" diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 68bb4068b8..2728fb4fb3 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -3,6 +3,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include "amount.h" #include "base58.h" #include "core_io.h" #include "rpcserver.h" diff --git a/src/txmempool.h b/src/txmempool.h index 85cf5310ff..df2fbc78c3 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -8,6 +8,7 @@ #include +#include "amount.h" #include "coins.h" #include "core.h" #include "sync.h" diff --git a/src/wallet.h b/src/wallet.h index 06706655f8..6a4b4b7f8d 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -6,6 +6,7 @@ #ifndef BITCOIN_WALLET_H #define BITCOIN_WALLET_H +#include "amount.h" #include "core.h" #include "crypter.h" #include "key.h" From 4a3587d8db9f651866ce70312ac9de11316b42c9 Mon Sep 17 00:00:00 2001 From: jtimon Date: Sat, 18 Oct 2014 02:34:06 +0200 Subject: [PATCH 0930/1288] MOVEONLY: Separate CTransaction and dependencies from core --- src/Makefile.am | 2 + src/bitcoin-tx.cpp | 2 +- src/bloom.cpp | 2 +- src/coincontrol.h | 2 +- src/coins.h | 3 +- src/core.cpp | 132 ------------------ src/core.h | 270 +----------------------------------- src/core/transaction.cpp | 142 +++++++++++++++++++ src/core/transaction.h | 276 +++++++++++++++++++++++++++++++++++++ src/core_read.cpp | 2 +- src/core_write.cpp | 2 +- src/main.h | 1 + src/miner.cpp | 1 + src/net.cpp | 2 +- src/qt/bitcoinunits.cpp | 2 +- src/qt/guiutil.cpp | 2 +- src/rpcrawtransaction.cpp | 2 +- src/script/interpreter.cpp | 2 +- src/script/sign.cpp | 2 +- src/test/main_tests.cpp | 2 +- src/test/util_tests.cpp | 2 +- src/txdb.cpp | 1 - src/txmempool.cpp | 1 - src/txmempool.h | 2 +- src/utilmoneystr.cpp | 2 +- src/wallet.h | 1 + 26 files changed, 441 insertions(+), 419 deletions(-) create mode 100644 src/core/transaction.cpp create mode 100644 src/core/transaction.h diff --git a/src/Makefile.am b/src/Makefile.am index d5abbc17d3..5485127e68 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -81,6 +81,7 @@ BITCOIN_CORE_H = \ coins.h \ compat.h \ core.h \ + core/transaction.h \ core_io.h \ crypter.h \ db.h \ @@ -213,6 +214,7 @@ libbitcoin_common_a_SOURCES = \ chainparams.cpp \ coins.cpp \ core.cpp \ + core/transaction.cpp \ core_read.cpp \ core_write.cpp \ hash.cpp \ diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index da37e60c7f..6f3409edf3 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -3,7 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "base58.h" -#include "core.h" +#include "core/transaction.h" #include "core_io.h" #include "keystore.h" #include "main.h" // for MAX_BLOCK_SIZE diff --git a/src/bloom.cpp b/src/bloom.cpp index cac71fdbbf..c1e7aeb3bf 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -4,7 +4,7 @@ #include "bloom.h" -#include "core.h" +#include "core/transaction.h" #include "script/script.h" #include "script/standard.h" #include "streams.h" diff --git a/src/coincontrol.h b/src/coincontrol.h index 033092c019..c8f12d92de 100644 --- a/src/coincontrol.h +++ b/src/coincontrol.h @@ -5,7 +5,7 @@ #ifndef COINCONTROL_H #define COINCONTROL_H -#include "core.h" +#include "core/transaction.h" /** Coin Control Features. */ class CCoinControl diff --git a/src/coins.h b/src/coins.h index b8f1e5bcc5..eafe3bec64 100644 --- a/src/coins.h +++ b/src/coins.h @@ -6,7 +6,8 @@ #ifndef BITCOIN_COINS_H #define BITCOIN_COINS_H -#include "core.h" +#include "core.h" // Only for CTxOutCompressor +#include "core/transaction.h" #include "serialize.h" #include "uint256.h" diff --git a/src/core.cpp b/src/core.cpp index ac180cc509..34188bca63 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -9,138 +9,6 @@ #include "tinyformat.h" #include "utilstrencodings.h" -std::string COutPoint::ToString() const -{ - return strprintf("COutPoint(%s, %u)", hash.ToString().substr(0,10), n); -} - -CTxIn::CTxIn(COutPoint prevoutIn, CScript scriptSigIn, uint32_t nSequenceIn) -{ - prevout = prevoutIn; - scriptSig = scriptSigIn; - nSequence = nSequenceIn; -} - -CTxIn::CTxIn(uint256 hashPrevTx, uint32_t nOut, CScript scriptSigIn, uint32_t nSequenceIn) -{ - prevout = COutPoint(hashPrevTx, nOut); - scriptSig = scriptSigIn; - nSequence = nSequenceIn; -} - -std::string CTxIn::ToString() const -{ - std::string str; - str += "CTxIn("; - str += prevout.ToString(); - if (prevout.IsNull()) - str += strprintf(", coinbase %s", HexStr(scriptSig)); - else - str += strprintf(", scriptSig=%s", scriptSig.ToString().substr(0,24)); - if (nSequence != std::numeric_limits::max()) - str += strprintf(", nSequence=%u", nSequence); - str += ")"; - return str; -} - -CTxOut::CTxOut(const CAmount& nValueIn, CScript scriptPubKeyIn) -{ - nValue = nValueIn; - scriptPubKey = scriptPubKeyIn; -} - -uint256 CTxOut::GetHash() const -{ - return SerializeHash(*this); -} - -std::string CTxOut::ToString() const -{ - return strprintf("CTxOut(nValue=%d.%08d, scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30)); -} - -CMutableTransaction::CMutableTransaction() : nVersion(CTransaction::CURRENT_VERSION), nLockTime(0) {} -CMutableTransaction::CMutableTransaction(const CTransaction& tx) : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), nLockTime(tx.nLockTime) {} - -uint256 CMutableTransaction::GetHash() const -{ - return SerializeHash(*this); -} - -void CTransaction::UpdateHash() const -{ - *const_cast(&hash) = SerializeHash(*this); -} - -CTransaction::CTransaction() : hash(0), nVersion(CTransaction::CURRENT_VERSION), vin(), vout(), nLockTime(0) { } - -CTransaction::CTransaction(const CMutableTransaction &tx) : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), nLockTime(tx.nLockTime) { - UpdateHash(); -} - -CTransaction& CTransaction::operator=(const CTransaction &tx) { - *const_cast(&nVersion) = tx.nVersion; - *const_cast*>(&vin) = tx.vin; - *const_cast*>(&vout) = tx.vout; - *const_cast(&nLockTime) = tx.nLockTime; - *const_cast(&hash) = tx.hash; - return *this; -} - -CAmount CTransaction::GetValueOut() const -{ - CAmount nValueOut = 0; - for (std::vector::const_iterator it(vout.begin()); it != vout.end(); ++it) - { - nValueOut += it->nValue; - if (!MoneyRange(it->nValue) || !MoneyRange(nValueOut)) - throw std::runtime_error("CTransaction::GetValueOut() : value out of range"); - } - return nValueOut; -} - -double CTransaction::ComputePriority(double dPriorityInputs, unsigned int nTxSize) const -{ - nTxSize = CalculateModifiedSize(nTxSize); - if (nTxSize == 0) return 0.0; - - return dPriorityInputs / nTxSize; -} - -unsigned int CTransaction::CalculateModifiedSize(unsigned int nTxSize) const -{ - // In order to avoid disincentivizing cleaning up the UTXO set we don't count - // the constant overhead for each txin and up to 110 bytes of scriptSig (which - // is enough to cover a compressed pubkey p2sh redemption) for priority. - // Providing any more cleanup incentive than making additional inputs free would - // risk encouraging people to create junk outputs to redeem later. - if (nTxSize == 0) - nTxSize = ::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION); - for (std::vector::const_iterator it(vin.begin()); it != vin.end(); ++it) - { - unsigned int offset = 41U + std::min(110U, (unsigned int)it->scriptSig.size()); - if (nTxSize > offset) - nTxSize -= offset; - } - return nTxSize; -} - -std::string CTransaction::ToString() const -{ - std::string str; - str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%u, vout.size=%u, nLockTime=%u)\n", - GetHash().ToString().substr(0,10), - nVersion, - vin.size(), - vout.size(), - nLockTime); - for (unsigned int i = 0; i < vin.size(); i++) - str += " " + vin[i].ToString() + "\n"; - for (unsigned int i = 0; i < vout.size(); i++) - str += " " + vout[i].ToString() + "\n"; - return str; -} - // Amount compression: // * If the amount is 0, output 0 // * first, divide the amount (in base units) by the largest power of 10 possible; call the exponent e (e is max 9) diff --git a/src/core.h b/src/core.h index f7a46da2c1..ad4c883250 100644 --- a/src/core.h +++ b/src/core.h @@ -6,279 +6,11 @@ #ifndef BITCOIN_CORE_H #define BITCOIN_CORE_H -#include "amount.h" +#include "core/transaction.h" #include "script/compressor.h" -#include "script/script.h" #include "serialize.h" #include "uint256.h" -#include - -class CTransaction; - -/** An outpoint - a combination of a transaction hash and an index n into its vout */ -class COutPoint -{ -public: - uint256 hash; - uint32_t n; - - COutPoint() { SetNull(); } - COutPoint(uint256 hashIn, uint32_t nIn) { hash = hashIn; n = nIn; } - - ADD_SERIALIZE_METHODS; - - template - inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - READWRITE(FLATDATA(*this)); - } - - void SetNull() { hash = 0; n = (uint32_t) -1; } - bool IsNull() const { return (hash == 0 && n == (uint32_t) -1); } - - friend bool operator<(const COutPoint& a, const COutPoint& b) - { - return (a.hash < b.hash || (a.hash == b.hash && a.n < b.n)); - } - - friend bool operator==(const COutPoint& a, const COutPoint& b) - { - return (a.hash == b.hash && a.n == b.n); - } - - friend bool operator!=(const COutPoint& a, const COutPoint& b) - { - return !(a == b); - } - - std::string ToString() const; -}; - -/** An input of a transaction. It contains the location of the previous - * transaction's output that it claims and a signature that matches the - * output's public key. - */ -class CTxIn -{ -public: - COutPoint prevout; - CScript scriptSig; - uint32_t nSequence; - - CTxIn() - { - nSequence = std::numeric_limits::max(); - } - - explicit CTxIn(COutPoint prevoutIn, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=std::numeric_limits::max()); - CTxIn(uint256 hashPrevTx, uint32_t nOut, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=std::numeric_limits::max()); - - ADD_SERIALIZE_METHODS; - - template - inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - READWRITE(prevout); - READWRITE(scriptSig); - READWRITE(nSequence); - } - - bool IsFinal() const - { - return (nSequence == std::numeric_limits::max()); - } - - friend bool operator==(const CTxIn& a, const CTxIn& b) - { - return (a.prevout == b.prevout && - a.scriptSig == b.scriptSig && - a.nSequence == b.nSequence); - } - - friend bool operator!=(const CTxIn& a, const CTxIn& b) - { - return !(a == b); - } - - std::string ToString() const; -}; - -/** An output of a transaction. It contains the public key that the next input - * must be able to sign with to claim it. - */ -class CTxOut -{ -public: - CAmount nValue; - CScript scriptPubKey; - - CTxOut() - { - SetNull(); - } - - CTxOut(const CAmount& nValueIn, CScript scriptPubKeyIn); - - ADD_SERIALIZE_METHODS; - - template - inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - READWRITE(nValue); - READWRITE(scriptPubKey); - } - - void SetNull() - { - nValue = -1; - scriptPubKey.clear(); - } - - bool IsNull() const - { - return (nValue == -1); - } - - uint256 GetHash() const; - - bool IsDust(CFeeRate minRelayTxFee) const - { - // "Dust" is defined in terms of CTransaction::minRelayTxFee, - // which has units satoshis-per-kilobyte. - // If you'd pay more than 1/3 in fees - // to spend something, then we consider it dust. - // A typical txout is 34 bytes big, and will - // need a CTxIn of at least 148 bytes to spend: - // so dust is a txout less than 546 satoshis - // with default minRelayTxFee. - size_t nSize = GetSerializeSize(SER_DISK,0)+148u; - return (nValue < 3*minRelayTxFee.GetFee(nSize)); - } - - friend bool operator==(const CTxOut& a, const CTxOut& b) - { - return (a.nValue == b.nValue && - a.scriptPubKey == b.scriptPubKey); - } - - friend bool operator!=(const CTxOut& a, const CTxOut& b) - { - return !(a == b); - } - - std::string ToString() const; -}; - - -struct CMutableTransaction; - -/** The basic transaction that is broadcasted on the network and contained in - * blocks. A transaction can contain multiple inputs and outputs. - */ -class CTransaction -{ -private: - /** Memory only. */ - const uint256 hash; - void UpdateHash() const; - -public: - static const int32_t CURRENT_VERSION=1; - - // The local variables are made const to prevent unintended modification - // without updating the cached hash value. However, CTransaction is not - // actually immutable; deserialization and assignment are implemented, - // and bypass the constness. This is safe, as they update the entire - // structure, including the hash. - const int32_t nVersion; - const std::vector vin; - const std::vector vout; - const uint32_t nLockTime; - - /** Construct a CTransaction that qualifies as IsNull() */ - CTransaction(); - - /** Convert a CMutableTransaction into a CTransaction. */ - CTransaction(const CMutableTransaction &tx); - - CTransaction& operator=(const CTransaction& tx); - - ADD_SERIALIZE_METHODS; - - template - inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - READWRITE(*const_cast(&this->nVersion)); - nVersion = this->nVersion; - READWRITE(*const_cast*>(&vin)); - READWRITE(*const_cast*>(&vout)); - READWRITE(*const_cast(&nLockTime)); - if (ser_action.ForRead()) - UpdateHash(); - } - - bool IsNull() const { - return vin.empty() && vout.empty(); - } - - const uint256& GetHash() const { - return hash; - } - - // Return sum of txouts. - CAmount GetValueOut() const; - // GetValueIn() is a method on CCoinsViewCache, because - // inputs must be known to compute value in. - - // Compute priority, given priority of inputs and (optionally) tx size - double ComputePriority(double dPriorityInputs, unsigned int nTxSize=0) const; - - // Compute modified tx size for priority calculation (optionally given tx size) - unsigned int CalculateModifiedSize(unsigned int nTxSize=0) const; - - bool IsCoinBase() const - { - return (vin.size() == 1 && vin[0].prevout.IsNull()); - } - - friend bool operator==(const CTransaction& a, const CTransaction& b) - { - return a.hash == b.hash; - } - - friend bool operator!=(const CTransaction& a, const CTransaction& b) - { - return a.hash != b.hash; - } - - std::string ToString() const; -}; - -/** A mutable version of CTransaction. */ -struct CMutableTransaction -{ - int32_t nVersion; - std::vector vin; - std::vector vout; - uint32_t nLockTime; - - CMutableTransaction(); - CMutableTransaction(const CTransaction& tx); - - ADD_SERIALIZE_METHODS; - - template - inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - READWRITE(this->nVersion); - nVersion = this->nVersion; - READWRITE(vin); - READWRITE(vout); - READWRITE(nLockTime); - } - - /** Compute the hash of this CMutableTransaction. This is computed on the - * fly, as opposed to GetHash() in CTransaction, which uses a cached result. - */ - uint256 GetHash() const; -}; - /** wrapper for CTxOut that provides a more compact serialization */ class CTxOutCompressor { diff --git a/src/core/transaction.cpp b/src/core/transaction.cpp new file mode 100644 index 0000000000..f835bafb9f --- /dev/null +++ b/src/core/transaction.cpp @@ -0,0 +1,142 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "core/transaction.h" + +#include "hash.h" +#include "tinyformat.h" +#include "utilstrencodings.h" + +std::string COutPoint::ToString() const +{ + return strprintf("COutPoint(%s, %u)", hash.ToString().substr(0,10), n); +} + +CTxIn::CTxIn(COutPoint prevoutIn, CScript scriptSigIn, uint32_t nSequenceIn) +{ + prevout = prevoutIn; + scriptSig = scriptSigIn; + nSequence = nSequenceIn; +} + +CTxIn::CTxIn(uint256 hashPrevTx, uint32_t nOut, CScript scriptSigIn, uint32_t nSequenceIn) +{ + prevout = COutPoint(hashPrevTx, nOut); + scriptSig = scriptSigIn; + nSequence = nSequenceIn; +} + +std::string CTxIn::ToString() const +{ + std::string str; + str += "CTxIn("; + str += prevout.ToString(); + if (prevout.IsNull()) + str += strprintf(", coinbase %s", HexStr(scriptSig)); + else + str += strprintf(", scriptSig=%s", scriptSig.ToString().substr(0,24)); + if (nSequence != std::numeric_limits::max()) + str += strprintf(", nSequence=%u", nSequence); + str += ")"; + return str; +} + +CTxOut::CTxOut(const CAmount& nValueIn, CScript scriptPubKeyIn) +{ + nValue = nValueIn; + scriptPubKey = scriptPubKeyIn; +} + +uint256 CTxOut::GetHash() const +{ + return SerializeHash(*this); +} + +std::string CTxOut::ToString() const +{ + return strprintf("CTxOut(nValue=%d.%08d, scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30)); +} + +CMutableTransaction::CMutableTransaction() : nVersion(CTransaction::CURRENT_VERSION), nLockTime(0) {} +CMutableTransaction::CMutableTransaction(const CTransaction& tx) : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), nLockTime(tx.nLockTime) {} + +uint256 CMutableTransaction::GetHash() const +{ + return SerializeHash(*this); +} + +void CTransaction::UpdateHash() const +{ + *const_cast(&hash) = SerializeHash(*this); +} + +CTransaction::CTransaction() : hash(0), nVersion(CTransaction::CURRENT_VERSION), vin(), vout(), nLockTime(0) { } + +CTransaction::CTransaction(const CMutableTransaction &tx) : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), nLockTime(tx.nLockTime) { + UpdateHash(); +} + +CTransaction& CTransaction::operator=(const CTransaction &tx) { + *const_cast(&nVersion) = tx.nVersion; + *const_cast*>(&vin) = tx.vin; + *const_cast*>(&vout) = tx.vout; + *const_cast(&nLockTime) = tx.nLockTime; + *const_cast(&hash) = tx.hash; + return *this; +} + +CAmount CTransaction::GetValueOut() const +{ + CAmount nValueOut = 0; + for (std::vector::const_iterator it(vout.begin()); it != vout.end(); ++it) + { + nValueOut += it->nValue; + if (!MoneyRange(it->nValue) || !MoneyRange(nValueOut)) + throw std::runtime_error("CTransaction::GetValueOut() : value out of range"); + } + return nValueOut; +} + +double CTransaction::ComputePriority(double dPriorityInputs, unsigned int nTxSize) const +{ + nTxSize = CalculateModifiedSize(nTxSize); + if (nTxSize == 0) return 0.0; + + return dPriorityInputs / nTxSize; +} + +unsigned int CTransaction::CalculateModifiedSize(unsigned int nTxSize) const +{ + // In order to avoid disincentivizing cleaning up the UTXO set we don't count + // the constant overhead for each txin and up to 110 bytes of scriptSig (which + // is enough to cover a compressed pubkey p2sh redemption) for priority. + // Providing any more cleanup incentive than making additional inputs free would + // risk encouraging people to create junk outputs to redeem later. + if (nTxSize == 0) + nTxSize = ::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION); + for (std::vector::const_iterator it(vin.begin()); it != vin.end(); ++it) + { + unsigned int offset = 41U + std::min(110U, (unsigned int)it->scriptSig.size()); + if (nTxSize > offset) + nTxSize -= offset; + } + return nTxSize; +} + +std::string CTransaction::ToString() const +{ + std::string str; + str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%u, vout.size=%u, nLockTime=%u)\n", + GetHash().ToString().substr(0,10), + nVersion, + vin.size(), + vout.size(), + nLockTime); + for (unsigned int i = 0; i < vin.size(); i++) + str += " " + vin[i].ToString() + "\n"; + for (unsigned int i = 0; i < vout.size(); i++) + str += " " + vout[i].ToString() + "\n"; + return str; +} diff --git a/src/core/transaction.h b/src/core/transaction.h new file mode 100644 index 0000000000..c21558cfeb --- /dev/null +++ b/src/core/transaction.h @@ -0,0 +1,276 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef H_BITCOIN_CORE_TRANSACTION +#define H_BITCOIN_CORE_TRANSACTION + +#include "amount.h" +#include "script/script.h" +#include "serialize.h" +#include "uint256.h" + +/** An outpoint - a combination of a transaction hash and an index n into its vout */ +class COutPoint +{ +public: + uint256 hash; + uint32_t n; + + COutPoint() { SetNull(); } + COutPoint(uint256 hashIn, uint32_t nIn) { hash = hashIn; n = nIn; } + + ADD_SERIALIZE_METHODS; + + template + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + READWRITE(FLATDATA(*this)); + } + + void SetNull() { hash = 0; n = (uint32_t) -1; } + bool IsNull() const { return (hash == 0 && n == (uint32_t) -1); } + + friend bool operator<(const COutPoint& a, const COutPoint& b) + { + return (a.hash < b.hash || (a.hash == b.hash && a.n < b.n)); + } + + friend bool operator==(const COutPoint& a, const COutPoint& b) + { + return (a.hash == b.hash && a.n == b.n); + } + + friend bool operator!=(const COutPoint& a, const COutPoint& b) + { + return !(a == b); + } + + std::string ToString() const; +}; + +/** An input of a transaction. It contains the location of the previous + * transaction's output that it claims and a signature that matches the + * output's public key. + */ +class CTxIn +{ +public: + COutPoint prevout; + CScript scriptSig; + uint32_t nSequence; + + CTxIn() + { + nSequence = std::numeric_limits::max(); + } + + explicit CTxIn(COutPoint prevoutIn, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=std::numeric_limits::max()); + CTxIn(uint256 hashPrevTx, uint32_t nOut, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=std::numeric_limits::max()); + + ADD_SERIALIZE_METHODS; + + template + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + READWRITE(prevout); + READWRITE(scriptSig); + READWRITE(nSequence); + } + + bool IsFinal() const + { + return (nSequence == std::numeric_limits::max()); + } + + friend bool operator==(const CTxIn& a, const CTxIn& b) + { + return (a.prevout == b.prevout && + a.scriptSig == b.scriptSig && + a.nSequence == b.nSequence); + } + + friend bool operator!=(const CTxIn& a, const CTxIn& b) + { + return !(a == b); + } + + std::string ToString() const; +}; + +/** An output of a transaction. It contains the public key that the next input + * must be able to sign with to claim it. + */ +class CTxOut +{ +public: + CAmount nValue; + CScript scriptPubKey; + + CTxOut() + { + SetNull(); + } + + CTxOut(const CAmount& nValueIn, CScript scriptPubKeyIn); + + ADD_SERIALIZE_METHODS; + + template + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + READWRITE(nValue); + READWRITE(scriptPubKey); + } + + void SetNull() + { + nValue = -1; + scriptPubKey.clear(); + } + + bool IsNull() const + { + return (nValue == -1); + } + + uint256 GetHash() const; + + bool IsDust(CFeeRate minRelayTxFee) const + { + // "Dust" is defined in terms of CTransaction::minRelayTxFee, + // which has units satoshis-per-kilobyte. + // If you'd pay more than 1/3 in fees + // to spend something, then we consider it dust. + // A typical txout is 34 bytes big, and will + // need a CTxIn of at least 148 bytes to spend: + // so dust is a txout less than 546 satoshis + // with default minRelayTxFee. + size_t nSize = GetSerializeSize(SER_DISK,0)+148u; + return (nValue < 3*minRelayTxFee.GetFee(nSize)); + } + + friend bool operator==(const CTxOut& a, const CTxOut& b) + { + return (a.nValue == b.nValue && + a.scriptPubKey == b.scriptPubKey); + } + + friend bool operator!=(const CTxOut& a, const CTxOut& b) + { + return !(a == b); + } + + std::string ToString() const; +}; + +struct CMutableTransaction; + +/** The basic transaction that is broadcasted on the network and contained in + * blocks. A transaction can contain multiple inputs and outputs. + */ +class CTransaction +{ +private: + /** Memory only. */ + const uint256 hash; + void UpdateHash() const; + +public: + static const int32_t CURRENT_VERSION=1; + + // The local variables are made const to prevent unintended modification + // without updating the cached hash value. However, CTransaction is not + // actually immutable; deserialization and assignment are implemented, + // and bypass the constness. This is safe, as they update the entire + // structure, including the hash. + const int32_t nVersion; + const std::vector vin; + const std::vector vout; + const uint32_t nLockTime; + + /** Construct a CTransaction that qualifies as IsNull() */ + CTransaction(); + + /** Convert a CMutableTransaction into a CTransaction. */ + CTransaction(const CMutableTransaction &tx); + + CTransaction& operator=(const CTransaction& tx); + + ADD_SERIALIZE_METHODS; + + template + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + READWRITE(*const_cast(&this->nVersion)); + nVersion = this->nVersion; + READWRITE(*const_cast*>(&vin)); + READWRITE(*const_cast*>(&vout)); + READWRITE(*const_cast(&nLockTime)); + if (ser_action.ForRead()) + UpdateHash(); + } + + bool IsNull() const { + return vin.empty() && vout.empty(); + } + + const uint256& GetHash() const { + return hash; + } + + // Return sum of txouts. + CAmount GetValueOut() const; + // GetValueIn() is a method on CCoinsViewCache, because + // inputs must be known to compute value in. + + // Compute priority, given priority of inputs and (optionally) tx size + double ComputePriority(double dPriorityInputs, unsigned int nTxSize=0) const; + + // Compute modified tx size for priority calculation (optionally given tx size) + unsigned int CalculateModifiedSize(unsigned int nTxSize=0) const; + + bool IsCoinBase() const + { + return (vin.size() == 1 && vin[0].prevout.IsNull()); + } + + friend bool operator==(const CTransaction& a, const CTransaction& b) + { + return a.hash == b.hash; + } + + friend bool operator!=(const CTransaction& a, const CTransaction& b) + { + return a.hash != b.hash; + } + + std::string ToString() const; +}; + +/** A mutable version of CTransaction. */ +struct CMutableTransaction +{ + int32_t nVersion; + std::vector vin; + std::vector vout; + uint32_t nLockTime; + + CMutableTransaction(); + CMutableTransaction(const CTransaction& tx); + + ADD_SERIALIZE_METHODS; + + template + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + READWRITE(this->nVersion); + nVersion = this->nVersion; + READWRITE(vin); + READWRITE(vout); + READWRITE(nLockTime); + } + + /** Compute the hash of this CMutableTransaction. This is computed on the + * fly, as opposed to GetHash() in CTransaction, which uses a cached result. + */ + uint256 GetHash() const; +}; + +#endif // H_BITCOIN_CORE_TRANSACTION diff --git a/src/core_read.cpp b/src/core_read.cpp index dcbcf4b4f7..d39bc9a780 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -4,7 +4,7 @@ #include "core_io.h" -#include "core.h" +#include "core/transaction.h" #include "script/script.h" #include "serialize.h" #include "streams.h" diff --git a/src/core_write.cpp b/src/core_write.cpp index b2b29fb367..a3ae8eec07 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -5,7 +5,7 @@ #include "core_io.h" #include "base58.h" -#include "core.h" +#include "core/transaction.h" #include "script/script.h" #include "script/standard.h" #include "serialize.h" diff --git a/src/main.h b/src/main.h index 2686ed948f..3a3687ec1d 100644 --- a/src/main.h +++ b/src/main.h @@ -15,6 +15,7 @@ #include "chainparams.h" #include "coins.h" #include "core.h" +#include "core/transaction.h" #include "net.h" #include "pow.h" #include "script/script.h" diff --git a/src/miner.cpp b/src/miner.cpp index 897f7c56d7..cf47b65a5c 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -7,6 +7,7 @@ #include "amount.h" #include "core.h" +#include "core/transaction.h" #include "hash.h" #include "main.h" #include "net.h" diff --git a/src/net.cpp b/src/net.cpp index 6cf64f51c3..6cccdca952 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -11,7 +11,7 @@ #include "addrman.h" #include "chainparams.h" -#include "core.h" +#include "core/transaction.h" #include "ui_interface.h" #ifdef WIN32 diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp index 423b559bf7..c85f569fd3 100644 --- a/src/qt/bitcoinunits.cpp +++ b/src/qt/bitcoinunits.cpp @@ -4,7 +4,7 @@ #include "bitcoinunits.h" -#include "core.h" +#include "core/transaction.h" #include diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 91bb10755a..22a1f019e9 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -9,7 +9,7 @@ #include "qvalidatedlineedit.h" #include "walletmodel.h" -#include "core.h" +#include "core/transaction.h" #include "init.h" #include "main.h" #include "protocol.h" diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index fdfcb59eeb..d3ce3b3191 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -4,7 +4,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "base58.h" -#include "core.h" +#include "core/transaction.h" #include "core_io.h" #include "init.h" #include "keystore.h" diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index cd73b88210..44f5df28f3 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -5,7 +5,7 @@ #include "interpreter.h" -#include "core.h" +#include "core/transaction.h" #include "crypto/ripemd160.h" #include "crypto/sha1.h" #include "crypto/sha2.h" diff --git a/src/script/sign.cpp b/src/script/sign.cpp index bf98c40394..0eab0626e5 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -5,7 +5,7 @@ #include "script/sign.h" -#include "core.h" +#include "core/transaction.h" #include "key.h" #include "keystore.h" #include "script/standard.h" diff --git a/src/test/main_tests.cpp b/src/test/main_tests.cpp index 70a800af51..78c4181409 100644 --- a/src/test/main_tests.cpp +++ b/src/test/main_tests.cpp @@ -2,7 +2,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "core.h" +#include "core/transaction.h" #include "main.h" #include diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 61daa0a3fe..761210feac 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -4,7 +4,7 @@ #include "util.h" -#include "core.h" +#include "core/transaction.h" #include "random.h" #include "sync.h" #include "utilstrencodings.h" diff --git a/src/txdb.cpp b/src/txdb.cpp index 8a73ce961c..0731d843f3 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -5,7 +5,6 @@ #include "txdb.h" -#include "core.h" #include "pow.h" #include "uint256.h" diff --git a/src/txmempool.cpp b/src/txmempool.cpp index b0d6b4aefa..c042dd8467 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -5,7 +5,6 @@ #include "txmempool.h" -#include "core.h" #include "streams.h" #include "util.h" #include "utilmoneystr.h" diff --git a/src/txmempool.h b/src/txmempool.h index df2fbc78c3..2ec80cb860 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -10,7 +10,7 @@ #include "amount.h" #include "coins.h" -#include "core.h" +#include "core/transaction.h" #include "sync.h" class CAutoFile; diff --git a/src/utilmoneystr.cpp b/src/utilmoneystr.cpp index 95be06aa18..267a5b845c 100644 --- a/src/utilmoneystr.cpp +++ b/src/utilmoneystr.cpp @@ -5,7 +5,7 @@ #include "utilmoneystr.h" -#include "core.h" +#include "core/transaction.h" #include "tinyformat.h" #include "utilstrencodings.h" diff --git a/src/wallet.h b/src/wallet.h index 6a4b4b7f8d..4c559cb7b1 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -8,6 +8,7 @@ #include "amount.h" #include "core.h" +#include "core/transaction.h" #include "crypter.h" #include "key.h" #include "keystore.h" From 999a2ab41ec96311c145d74822c246a3b92a9b33 Mon Sep 17 00:00:00 2001 From: jtimon Date: Sat, 18 Oct 2014 19:53:37 +0200 Subject: [PATCH 0931/1288] MOVEONLY: separate CTxUndo out of core --- src/Makefile.am | 1 + src/coins.h | 1 + src/core.h | 59 ---------------------------------------- src/main.h | 2 +- src/undo.h | 71 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 74 insertions(+), 60 deletions(-) create mode 100644 src/undo.h diff --git a/src/Makefile.am b/src/Makefile.am index 5485127e68..6d0e1ed7b8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -119,6 +119,7 @@ BITCOIN_CORE_H = \ txmempool.h \ ui_interface.h \ uint256.h \ + undo.h \ util.h \ utilstrencodings.h \ utilmoneystr.h \ diff --git a/src/coins.h b/src/coins.h index eafe3bec64..295b3d70d1 100644 --- a/src/coins.h +++ b/src/coins.h @@ -10,6 +10,7 @@ #include "core/transaction.h" #include "serialize.h" #include "uint256.h" +#include "undo.h" #include #include diff --git a/src/core.h b/src/core.h index ad4c883250..aeae9a1911 100644 --- a/src/core.h +++ b/src/core.h @@ -40,65 +40,6 @@ public: } }; -/** Undo information for a CTxIn - * - * Contains the prevout's CTxOut being spent, and if this was the - * last output of the affected transaction, its metadata as well - * (coinbase or not, height, transaction version) - */ -class CTxInUndo -{ -public: - CTxOut txout; // the txout data before being spent - bool fCoinBase; // if the outpoint was the last unspent: whether it belonged to a coinbase - unsigned int nHeight; // if the outpoint was the last unspent: its height - int nVersion; // if the outpoint was the last unspent: its version - - CTxInUndo() : txout(), fCoinBase(false), nHeight(0), nVersion(0) {} - CTxInUndo(const CTxOut &txoutIn, bool fCoinBaseIn = false, unsigned int nHeightIn = 0, int nVersionIn = 0) : txout(txoutIn), fCoinBase(fCoinBaseIn), nHeight(nHeightIn), nVersion(nVersionIn) { } - - unsigned int GetSerializeSize(int nType, int nVersion) const { - return ::GetSerializeSize(VARINT(nHeight*2+(fCoinBase ? 1 : 0)), nType, nVersion) + - (nHeight > 0 ? ::GetSerializeSize(VARINT(this->nVersion), nType, nVersion) : 0) + - ::GetSerializeSize(CTxOutCompressor(REF(txout)), nType, nVersion); - } - - template - void Serialize(Stream &s, int nType, int nVersion) const { - ::Serialize(s, VARINT(nHeight*2+(fCoinBase ? 1 : 0)), nType, nVersion); - if (nHeight > 0) - ::Serialize(s, VARINT(this->nVersion), nType, nVersion); - ::Serialize(s, CTxOutCompressor(REF(txout)), nType, nVersion); - } - - template - void Unserialize(Stream &s, int nType, int nVersion) { - unsigned int nCode = 0; - ::Unserialize(s, VARINT(nCode), nType, nVersion); - nHeight = nCode / 2; - fCoinBase = nCode & 1; - if (nHeight > 0) - ::Unserialize(s, VARINT(this->nVersion), nType, nVersion); - ::Unserialize(s, REF(CTxOutCompressor(REF(txout))), nType, nVersion); - } -}; - -/** Undo information for a CTransaction */ -class CTxUndo -{ -public: - // undo information for all txins - std::vector vprevout; - - ADD_SERIALIZE_METHODS; - - template - inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - READWRITE(vprevout); - } -}; - - /** Nodes collect new transactions into a block, hash them into a hash tree, * and scan through nonce values to make the block's hash satisfy proof-of-work * requirements. When they solve the proof-of-work, they broadcast the block diff --git a/src/main.h b/src/main.h index 3a3687ec1d..09f22471d6 100644 --- a/src/main.h +++ b/src/main.h @@ -25,6 +25,7 @@ #include "tinyformat.h" #include "txmempool.h" #include "uint256.h" +#include "undo.h" #include #include @@ -129,7 +130,6 @@ static const uint64_t nMinDiskSpace = 52428800; class CBlockTreeDB; -class CTxUndo; class CScriptCheck; class CValidationState; class CValidationInterface; diff --git a/src/undo.h b/src/undo.h new file mode 100644 index 0000000000..78e37f628c --- /dev/null +++ b/src/undo.h @@ -0,0 +1,71 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2013 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef H_BITCOIN_TXUNDO +#define H_BITCOIN_TXUNDO + +#include "core.h" // Only for CTxOutCompressor +#include "core/transaction.h" +#include "serialize.h" + +/** Undo information for a CTxIn + * + * Contains the prevout's CTxOut being spent, and if this was the + * last output of the affected transaction, its metadata as well + * (coinbase or not, height, transaction version) + */ +class CTxInUndo +{ +public: + CTxOut txout; // the txout data before being spent + bool fCoinBase; // if the outpoint was the last unspent: whether it belonged to a coinbase + unsigned int nHeight; // if the outpoint was the last unspent: its height + int nVersion; // if the outpoint was the last unspent: its version + + CTxInUndo() : txout(), fCoinBase(false), nHeight(0), nVersion(0) {} + CTxInUndo(const CTxOut &txoutIn, bool fCoinBaseIn = false, unsigned int nHeightIn = 0, int nVersionIn = 0) : txout(txoutIn), fCoinBase(fCoinBaseIn), nHeight(nHeightIn), nVersion(nVersionIn) { } + + unsigned int GetSerializeSize(int nType, int nVersion) const { + return ::GetSerializeSize(VARINT(nHeight*2+(fCoinBase ? 1 : 0)), nType, nVersion) + + (nHeight > 0 ? ::GetSerializeSize(VARINT(this->nVersion), nType, nVersion) : 0) + + ::GetSerializeSize(CTxOutCompressor(REF(txout)), nType, nVersion); + } + + template + void Serialize(Stream &s, int nType, int nVersion) const { + ::Serialize(s, VARINT(nHeight*2+(fCoinBase ? 1 : 0)), nType, nVersion); + if (nHeight > 0) + ::Serialize(s, VARINT(this->nVersion), nType, nVersion); + ::Serialize(s, CTxOutCompressor(REF(txout)), nType, nVersion); + } + + template + void Unserialize(Stream &s, int nType, int nVersion) { + unsigned int nCode = 0; + ::Unserialize(s, VARINT(nCode), nType, nVersion); + nHeight = nCode / 2; + fCoinBase = nCode & 1; + if (nHeight > 0) + ::Unserialize(s, VARINT(this->nVersion), nType, nVersion); + ::Unserialize(s, REF(CTxOutCompressor(REF(txout))), nType, nVersion); + } +}; + +/** Undo information for a CTransaction */ +class CTxUndo +{ +public: + // undo information for all txins + std::vector vprevout; + + ADD_SERIALIZE_METHODS; + + template + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + READWRITE(vprevout); + } +}; + +#endif // H_BITCOIN_TXUNDO From 561e9e9de9793c187f29ab2d41b43a36447e9357 Mon Sep 17 00:00:00 2001 From: jtimon Date: Sun, 19 Oct 2014 04:28:43 +0200 Subject: [PATCH 0932/1288] MOVEONLY: Move script/compressor out of script and put CTxOutCompressor (from core) with it --- src/Makefile.am | 4 +-- src/coins.h | 3 +- src/{script => }/compressor.cpp | 55 +++++++++++++++++++++++++++++++++ src/{script => }/compressor.h | 36 +++++++++++++++++++-- src/core.cpp | 54 -------------------------------- src/core.h | 30 ------------------ src/test/compress_tests.cpp | 2 +- src/undo.h | 2 +- 8 files changed, 93 insertions(+), 93 deletions(-) rename src/{script => }/compressor.cpp (73%) rename src/{script => }/compressor.h (76%) diff --git a/src/Makefile.am b/src/Makefile.am index 6d0e1ed7b8..0385ad9025 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -80,6 +80,7 @@ BITCOIN_CORE_H = \ coincontrol.h \ coins.h \ compat.h \ + compressor.h \ core.h \ core/transaction.h \ core_io.h \ @@ -103,7 +104,6 @@ BITCOIN_CORE_H = \ rpcclient.h \ rpcprotocol.h \ rpcserver.h \ - script/compressor.h \ script/interpreter.h \ script/script.h \ script/sigcache.h \ @@ -214,6 +214,7 @@ libbitcoin_common_a_SOURCES = \ base58.cpp \ chainparams.cpp \ coins.cpp \ + compressor.cpp \ core.cpp \ core/transaction.cpp \ core_read.cpp \ @@ -223,7 +224,6 @@ libbitcoin_common_a_SOURCES = \ keystore.cpp \ netbase.cpp \ protocol.cpp \ - script/compressor.cpp \ script/interpreter.cpp \ script/script.cpp \ script/sigcache.cpp \ diff --git a/src/coins.h b/src/coins.h index 295b3d70d1..ee9051562b 100644 --- a/src/coins.h +++ b/src/coins.h @@ -6,8 +6,7 @@ #ifndef BITCOIN_COINS_H #define BITCOIN_COINS_H -#include "core.h" // Only for CTxOutCompressor -#include "core/transaction.h" +#include "compressor.h" #include "serialize.h" #include "uint256.h" #include "undo.h" diff --git a/src/script/compressor.cpp b/src/compressor.cpp similarity index 73% rename from src/script/compressor.cpp rename to src/compressor.cpp index af1acf48db..806175dd3e 100644 --- a/src/script/compressor.cpp +++ b/src/compressor.cpp @@ -5,6 +5,7 @@ #include "compressor.h" +#include "hash.h" #include "key.h" #include "script/standard.h" @@ -128,3 +129,57 @@ bool CScriptCompressor::Decompress(unsigned int nSize, const std::vector= 1 && d <= 9); + n /= 10; + return 1 + (n*9 + d - 1)*10 + e; + } else { + return 1 + (n - 1)*10 + 9; + } +} + +uint64_t CTxOutCompressor::DecompressAmount(uint64_t x) +{ + // x = 0 OR x = 1+10*(9*n + d - 1) + e OR x = 1+10*(n - 1) + 9 + if (x == 0) + return 0; + x--; + // x = 10*(9*n + d - 1) + e + int e = x % 10; + x /= 10; + uint64_t n = 0; + if (e < 9) { + // x = 9*n + d - 1 + int d = (x % 9) + 1; + x /= 9; + // x = n + n = x*10 + d; + } else { + n = x+1; + } + while (e) { + n *= 10; + e--; + } + return n; +} diff --git a/src/script/compressor.h b/src/compressor.h similarity index 76% rename from src/script/compressor.h rename to src/compressor.h index 154e0b2662..a612c3a883 100644 --- a/src/script/compressor.h +++ b/src/compressor.h @@ -3,9 +3,10 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef H_BITCOIN_SCRIPT_COMPRESSOR -#define H_BITCOIN_SCRIPT_COMPRESSOR +#ifndef H_BITCOIN_COMPRESSOR +#define H_BITCOIN_COMPRESSOR +#include "core/transaction.h" #include "script/script.h" #include "serialize.h" @@ -86,4 +87,33 @@ public: } }; -#endif // H_BITCOIN_SCRIPT_COMPRESSOR +/** wrapper for CTxOut that provides a more compact serialization */ +class CTxOutCompressor +{ +private: + CTxOut &txout; + +public: + static uint64_t CompressAmount(uint64_t nAmount); + static uint64_t DecompressAmount(uint64_t nAmount); + + CTxOutCompressor(CTxOut &txoutIn) : txout(txoutIn) { } + + ADD_SERIALIZE_METHODS; + + template + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { + if (!ser_action.ForRead()) { + uint64_t nVal = CompressAmount(txout.nValue); + READWRITE(VARINT(nVal)); + } else { + uint64_t nVal = 0; + READWRITE(VARINT(nVal)); + txout.nValue = DecompressAmount(nVal); + } + CScriptCompressor cscript(REF(txout.scriptPubKey)); + READWRITE(cscript); + } +}; + +#endif // H_BITCOIN_COMPRESSOR diff --git a/src/core.cpp b/src/core.cpp index 34188bca63..08139d5424 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -9,60 +9,6 @@ #include "tinyformat.h" #include "utilstrencodings.h" -// Amount compression: -// * If the amount is 0, output 0 -// * first, divide the amount (in base units) by the largest power of 10 possible; call the exponent e (e is max 9) -// * if e<9, the last digit of the resulting number cannot be 0; store it as d, and drop it (divide by 10) -// * call the result n -// * output 1 + 10*(9*n + d - 1) + e -// * if e==9, we only know the resulting number is not zero, so output 1 + 10*(n - 1) + 9 -// (this is decodable, as d is in [1-9] and e is in [0-9]) - -uint64_t CTxOutCompressor::CompressAmount(uint64_t n) -{ - if (n == 0) - return 0; - int e = 0; - while (((n % 10) == 0) && e < 9) { - n /= 10; - e++; - } - if (e < 9) { - int d = (n % 10); - assert(d >= 1 && d <= 9); - n /= 10; - return 1 + (n*9 + d - 1)*10 + e; - } else { - return 1 + (n - 1)*10 + 9; - } -} - -uint64_t CTxOutCompressor::DecompressAmount(uint64_t x) -{ - // x = 0 OR x = 1+10*(9*n + d - 1) + e OR x = 1+10*(n - 1) + 9 - if (x == 0) - return 0; - x--; - // x = 10*(9*n + d - 1) + e - int e = x % 10; - x /= 10; - uint64_t n = 0; - if (e < 9) { - // x = 9*n + d - 1 - int d = (x % 9) + 1; - x /= 9; - // x = n - n = x*10 + d; - } else { - n = x+1; - } - while (e) { - n *= 10; - e--; - } - return n; -} - uint256 CBlockHeader::GetHash() const { return Hash(BEGIN(nVersion), END(nNonce)); diff --git a/src/core.h b/src/core.h index aeae9a1911..b2288e24ca 100644 --- a/src/core.h +++ b/src/core.h @@ -7,39 +7,9 @@ #define BITCOIN_CORE_H #include "core/transaction.h" -#include "script/compressor.h" #include "serialize.h" #include "uint256.h" -/** wrapper for CTxOut that provides a more compact serialization */ -class CTxOutCompressor -{ -private: - CTxOut &txout; - -public: - static uint64_t CompressAmount(uint64_t nAmount); - static uint64_t DecompressAmount(uint64_t nAmount); - - CTxOutCompressor(CTxOut &txoutIn) : txout(txoutIn) { } - - ADD_SERIALIZE_METHODS; - - template - inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - if (!ser_action.ForRead()) { - uint64_t nVal = CompressAmount(txout.nValue); - READWRITE(VARINT(nVal)); - } else { - uint64_t nVal = 0; - READWRITE(VARINT(nVal)); - txout.nValue = DecompressAmount(nVal); - } - CScriptCompressor cscript(REF(txout.scriptPubKey)); - READWRITE(cscript); - } -}; - /** Nodes collect new transactions into a block, hash them into a hash tree, * and scan through nonce values to make the block's hash satisfy proof-of-work * requirements. When they solve the proof-of-work, they broadcast the block diff --git a/src/test/compress_tests.cpp b/src/test/compress_tests.cpp index 719955ba85..bf404cf0cf 100644 --- a/src/test/compress_tests.cpp +++ b/src/test/compress_tests.cpp @@ -2,7 +2,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "main.h" +#include "compressor.h" #include "util.h" #include diff --git a/src/undo.h b/src/undo.h index 78e37f628c..232c193429 100644 --- a/src/undo.h +++ b/src/undo.h @@ -6,7 +6,7 @@ #ifndef H_BITCOIN_TXUNDO #define H_BITCOIN_TXUNDO -#include "core.h" // Only for CTxOutCompressor +#include "compressor.h" #include "core/transaction.h" #include "serialize.h" From 99f41b9cf7b8e039cea75500a905498a1f6969f3 Mon Sep 17 00:00:00 2001 From: jtimon Date: Tue, 21 Oct 2014 00:13:47 +0200 Subject: [PATCH 0933/1288] MOVEONLY: core.o -> core/block.o --- src/Makefile.am | 4 ++-- src/chain.h | 2 +- src/chainparams.h | 2 +- src/{core.cpp => core/block.cpp} | 2 +- src/{core.h => core/block.h} | 6 +++--- src/main.h | 2 +- src/miner.cpp | 2 +- src/pow.cpp | 2 +- src/wallet.h | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) rename src/{core.cpp => core/block.cpp} (99%) rename src/{core.h => core/block.h} (97%) diff --git a/src/Makefile.am b/src/Makefile.am index 0385ad9025..4ca75d6a77 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -81,7 +81,7 @@ BITCOIN_CORE_H = \ coins.h \ compat.h \ compressor.h \ - core.h \ + core/block.h \ core/transaction.h \ core_io.h \ crypter.h \ @@ -215,7 +215,7 @@ libbitcoin_common_a_SOURCES = \ chainparams.cpp \ coins.cpp \ compressor.cpp \ - core.cpp \ + core/block.cpp \ core/transaction.cpp \ core_read.cpp \ core_write.cpp \ diff --git a/src/chain.h b/src/chain.h index 290150476e..2a55771622 100644 --- a/src/chain.h +++ b/src/chain.h @@ -6,7 +6,7 @@ #ifndef H_BITCOIN_CHAIN #define H_BITCOIN_CHAIN -#include "core.h" +#include "core/block.h" #include "pow.h" #include "tinyformat.h" #include "uint256.h" diff --git a/src/chainparams.h b/src/chainparams.h index f157419bb2..e27728dbd5 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -6,9 +6,9 @@ #ifndef BITCOIN_CHAIN_PARAMS_H #define BITCOIN_CHAIN_PARAMS_H -#include "core.h" #include "chainparamsbase.h" #include "checkpoints.h" +#include "core/block.h" #include "protocol.h" #include "uint256.h" diff --git a/src/core.cpp b/src/core/block.cpp similarity index 99% rename from src/core.cpp rename to src/core/block.cpp index 08139d5424..2010d44dac 100644 --- a/src/core.cpp +++ b/src/core/block.cpp @@ -3,7 +3,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "core.h" +#include "core/block.h" #include "hash.h" #include "tinyformat.h" diff --git a/src/core.h b/src/core/block.h similarity index 97% rename from src/core.h rename to src/core/block.h index b2288e24ca..f1eb7a844f 100644 --- a/src/core.h +++ b/src/core/block.h @@ -3,8 +3,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_CORE_H -#define BITCOIN_CORE_H +#ifndef H_BITCOIN_CORE_BLOCK +#define H_BITCOIN_CORE_BLOCK #include "core/transaction.h" #include "serialize.h" @@ -165,4 +165,4 @@ struct CBlockLocator } }; -#endif // BITCOIN_CORE_H +#endif // H_BITCOIN_CORE_BLOCK diff --git a/src/main.h b/src/main.h index 09f22471d6..1941ca7059 100644 --- a/src/main.h +++ b/src/main.h @@ -14,7 +14,7 @@ #include "chain.h" #include "chainparams.h" #include "coins.h" -#include "core.h" +#include "core/block.h" #include "core/transaction.h" #include "net.h" #include "pow.h" diff --git a/src/miner.cpp b/src/miner.cpp index cf47b65a5c..0235de3ab3 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -6,7 +6,7 @@ #include "miner.h" #include "amount.h" -#include "core.h" +#include "core/block.h" #include "core/transaction.h" #include "hash.h" #include "main.h" diff --git a/src/pow.cpp b/src/pow.cpp index 75fbfc6a6d..af7fc488ef 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -6,7 +6,7 @@ #include "pow.h" #include "chainparams.h" -#include "core.h" +#include "core/block.h" #include "main.h" #include "timedata.h" #include "uint256.h" diff --git a/src/wallet.h b/src/wallet.h index 4c559cb7b1..acb30970c6 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -7,7 +7,7 @@ #define BITCOIN_WALLET_H #include "amount.h" -#include "core.h" +#include "core/block.h" #include "core/transaction.h" #include "crypter.h" #include "key.h" From bdaec6abd35dd93ae6b29f44b8cbf9c3af3f6805 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 21 Oct 2014 14:38:25 -0400 Subject: [PATCH 0934/1288] boost: remove CPubKey dependency from CECKey. Follow-up of e405aa48 --- src/key.cpp | 49 ++++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/src/key.cpp b/src/key.cpp index 079e2c6540..d2001717f1 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -201,21 +201,20 @@ public: return false; } - void GetPubKey(CPubKey &pubkey, bool fCompressed) { + void GetPubKey(std::vector &pubkey, bool fCompressed) { EC_KEY_set_conv_form(pkey, fCompressed ? POINT_CONVERSION_COMPRESSED : POINT_CONVERSION_UNCOMPRESSED); int nSize = i2o_ECPublicKey(pkey, NULL); assert(nSize); assert(nSize <= 65); - unsigned char c[65]; - unsigned char *pbegin = c; + pubkey.clear(); + pubkey.resize(nSize); + unsigned char *pbegin(begin_ptr(pubkey)); int nSize2 = i2o_ECPublicKey(pkey, &pbegin); assert(nSize == nSize2); - pubkey.Set(&c[0], &c[nSize]); } - bool SetPubKey(const CPubKey &pubkey) { - const unsigned char* pbegin = pubkey.begin(); - return o2i_ECPublicKey(&pkey, &pbegin, pubkey.size()) != NULL; + bool SetPubKey(const unsigned char* pubkey, size_t size) { + return o2i_ECPublicKey(&pkey, &pubkey, size) != NULL; } bool Sign(const uint256 &hash, std::vector& vchSig, bool lowS) { @@ -261,12 +260,12 @@ public: int nBitsR = BN_num_bits(sig->r); int nBitsS = BN_num_bits(sig->s); if (nBitsR <= 256 && nBitsS <= 256) { - CPubKey pubkey; + std::vector pubkey; GetPubKey(pubkey, true); for (int i=0; i<4; i++) { CECKey keyRec; if (ECDSA_SIG_recover_key_GFp(keyRec.pkey, sig, (unsigned char*)&hash, sizeof(hash), i, 1) == 1) { - CPubKey pubkeyRec; + std::vector pubkeyRec; keyRec.GetPubKey(pubkeyRec, true); if (pubkeyRec == pubkey) { rec = i; @@ -455,19 +454,21 @@ CPrivKey CKey::GetPrivKey() const { CPubKey CKey::GetPubKey() const { assert(fValid); - CPubKey pubkey; + CPubKey result; #ifdef USE_SECP256K1 int clen = 65; - int ret = secp256k1_ecdsa_pubkey_create((unsigned char*)pubkey.begin(), &clen, begin(), fCompressed); + int ret = secp256k1_ecdsa_pubkey_create((unsigned char*)result.begin(), &clen, begin(), fCompressed); + assert((int)result.size() == clen); assert(ret); - assert(pubkey.IsValid()); - assert((int)pubkey.size() == clen); #else + std::vector pubkey; CECKey key; key.SetSecretBytes(vch); key.GetPubKey(pubkey, fCompressed); + result.Set(pubkey.begin(), pubkey.end()); #endif - return pubkey; + assert(result.IsValid()); + return result; } bool CKey::Sign(const uint256 &hash, std::vector& vchSig, bool lowS) const { @@ -544,7 +545,7 @@ bool CPubKey::Verify(const uint256 &hash, const std::vector& vchS return false; #else CECKey key; - if (!key.SetPubKey(*this)) + if (!key.SetPubKey(begin(), size())) return false; if (!key.Verify(hash, vchSig)) return false; @@ -566,7 +567,9 @@ bool CPubKey::RecoverCompact(const uint256 &hash, const std::vector pubkey; + key.GetPubKey(pubkey, fComp); + Set(pubkey.begin(), pubkey.end()); #endif return true; } @@ -579,7 +582,7 @@ bool CPubKey::IsFullyValid() const { return false; #else CECKey key; - if (!key.SetPubKey(*this)) + if (!key.SetPubKey(begin(), size())) return false; #endif return true; @@ -595,9 +598,11 @@ bool CPubKey::Decompress() { assert(clen == (int)size()); #else CECKey key; - if (!key.SetPubKey(*this)) + if (!key.SetPubKey(begin(), size())) return false; - key.GetPubKey(*this, false); + std::vector pubkey; + key.GetPubKey(pubkey, false); + Set(pubkey.begin(), pubkey.end()); #endif return true; } @@ -652,9 +657,11 @@ bool CPubKey::Derive(CPubKey& pubkeyChild, unsigned char ccChild[32], unsigned i bool ret = secp256k1_ecdsa_pubkey_tweak_add((unsigned char*)pubkeyChild.begin(), pubkeyChild.size(), out); #else CECKey key; - bool ret = key.SetPubKey(*this); + bool ret = key.SetPubKey(begin(), size()); ret &= key.TweakPublic(out); - key.GetPubKey(pubkeyChild, true); + std::vector pubkey; + key.GetPubKey(pubkey, true); + pubkeyChild.Set(pubkey.begin(), pubkey.end()); #endif return ret; } From 50f71cd52e1eb35b10564f73a54fe5ea5b245418 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 21 Oct 2014 15:04:03 -0400 Subject: [PATCH 0935/1288] boost: code movement only: split CECKey into separate files --- src/Makefile.am | 2 + src/ecwrapper.cpp | 333 ++++++++++++++++++++++++++++++++++++++++++++++ src/ecwrapper.h | 46 +++++++ src/key.cpp | 333 +--------------------------------------------- 4 files changed, 384 insertions(+), 330 deletions(-) create mode 100644 src/ecwrapper.cpp create mode 100644 src/ecwrapper.h diff --git a/src/Makefile.am b/src/Makefile.am index 155adfef7d..00da8b2372 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -82,6 +82,7 @@ BITCOIN_CORE_H = \ core_io.h \ crypter.h \ db.h \ + ecwrapper.h \ hash.h \ init.h \ key.h \ @@ -211,6 +212,7 @@ libbitcoin_common_a_SOURCES = \ core.cpp \ core_read.cpp \ core_write.cpp \ + ecwrapper.cpp \ hash.cpp \ key.cpp \ keystore.cpp \ diff --git a/src/ecwrapper.cpp b/src/ecwrapper.cpp new file mode 100644 index 0000000000..e5db670927 --- /dev/null +++ b/src/ecwrapper.cpp @@ -0,0 +1,333 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "ecwrapper.h" + +#include "serialize.h" +#include "uint256.h" + +#include +#include +#include + +namespace { + +// Generate a private key from just the secret parameter +int EC_KEY_regenerate_key(EC_KEY *eckey, BIGNUM *priv_key) +{ + int ok = 0; + BN_CTX *ctx = NULL; + EC_POINT *pub_key = NULL; + + if (!eckey) return 0; + + const EC_GROUP *group = EC_KEY_get0_group(eckey); + + if ((ctx = BN_CTX_new()) == NULL) + goto err; + + pub_key = EC_POINT_new(group); + + if (pub_key == NULL) + goto err; + + if (!EC_POINT_mul(group, pub_key, priv_key, NULL, NULL, ctx)) + goto err; + + EC_KEY_set_private_key(eckey,priv_key); + EC_KEY_set_public_key(eckey,pub_key); + + ok = 1; + +err: + + if (pub_key) + EC_POINT_free(pub_key); + if (ctx != NULL) + BN_CTX_free(ctx); + + return(ok); +} + +// Perform ECDSA key recovery (see SEC1 4.1.6) for curves over (mod p)-fields +// recid selects which key is recovered +// if check is non-zero, additional checks are performed +int ECDSA_SIG_recover_key_GFp(EC_KEY *eckey, ECDSA_SIG *ecsig, const unsigned char *msg, int msglen, int recid, int check) +{ + if (!eckey) return 0; + + int ret = 0; + BN_CTX *ctx = NULL; + + BIGNUM *x = NULL; + BIGNUM *e = NULL; + BIGNUM *order = NULL; + BIGNUM *sor = NULL; + BIGNUM *eor = NULL; + BIGNUM *field = NULL; + EC_POINT *R = NULL; + EC_POINT *O = NULL; + EC_POINT *Q = NULL; + BIGNUM *rr = NULL; + BIGNUM *zero = NULL; + int n = 0; + int i = recid / 2; + + const EC_GROUP *group = EC_KEY_get0_group(eckey); + if ((ctx = BN_CTX_new()) == NULL) { ret = -1; goto err; } + BN_CTX_start(ctx); + order = BN_CTX_get(ctx); + if (!EC_GROUP_get_order(group, order, ctx)) { ret = -2; goto err; } + x = BN_CTX_get(ctx); + if (!BN_copy(x, order)) { ret=-1; goto err; } + if (!BN_mul_word(x, i)) { ret=-1; goto err; } + if (!BN_add(x, x, ecsig->r)) { ret=-1; goto err; } + field = BN_CTX_get(ctx); + if (!EC_GROUP_get_curve_GFp(group, field, NULL, NULL, ctx)) { ret=-2; goto err; } + if (BN_cmp(x, field) >= 0) { ret=0; goto err; } + if ((R = EC_POINT_new(group)) == NULL) { ret = -2; goto err; } + if (!EC_POINT_set_compressed_coordinates_GFp(group, R, x, recid % 2, ctx)) { ret=0; goto err; } + if (check) + { + if ((O = EC_POINT_new(group)) == NULL) { ret = -2; goto err; } + if (!EC_POINT_mul(group, O, NULL, R, order, ctx)) { ret=-2; goto err; } + if (!EC_POINT_is_at_infinity(group, O)) { ret = 0; goto err; } + } + if ((Q = EC_POINT_new(group)) == NULL) { ret = -2; goto err; } + n = EC_GROUP_get_degree(group); + e = BN_CTX_get(ctx); + if (!BN_bin2bn(msg, msglen, e)) { ret=-1; goto err; } + if (8*msglen > n) BN_rshift(e, e, 8-(n & 7)); + zero = BN_CTX_get(ctx); + if (!BN_zero(zero)) { ret=-1; goto err; } + if (!BN_mod_sub(e, zero, e, order, ctx)) { ret=-1; goto err; } + rr = BN_CTX_get(ctx); + if (!BN_mod_inverse(rr, ecsig->r, order, ctx)) { ret=-1; goto err; } + sor = BN_CTX_get(ctx); + if (!BN_mod_mul(sor, ecsig->s, rr, order, ctx)) { ret=-1; goto err; } + eor = BN_CTX_get(ctx); + if (!BN_mod_mul(eor, e, rr, order, ctx)) { ret=-1; goto err; } + if (!EC_POINT_mul(group, Q, eor, R, sor, ctx)) { ret=-2; goto err; } + if (!EC_KEY_set_public_key(eckey, Q)) { ret=-2; goto err; } + + ret = 1; + +err: + if (ctx) { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } + if (R != NULL) EC_POINT_free(R); + if (O != NULL) EC_POINT_free(O); + if (Q != NULL) EC_POINT_free(Q); + return ret; +} + +} // anon namespace + +CECKey::CECKey() { + pkey = EC_KEY_new_by_curve_name(NID_secp256k1); + assert(pkey != NULL); +} + +CECKey::~CECKey() { + EC_KEY_free(pkey); +} + +void CECKey::GetSecretBytes(unsigned char vch[32]) const { + const BIGNUM *bn = EC_KEY_get0_private_key(pkey); + assert(bn); + int nBytes = BN_num_bytes(bn); + int n=BN_bn2bin(bn,&vch[32 - nBytes]); + assert(n == nBytes); + memset(vch, 0, 32 - nBytes); +} + +void CECKey::SetSecretBytes(const unsigned char vch[32]) { + bool ret; + BIGNUM bn; + BN_init(&bn); + ret = BN_bin2bn(vch, 32, &bn) != NULL; + assert(ret); + ret = EC_KEY_regenerate_key(pkey, &bn) != 0; + assert(ret); + BN_clear_free(&bn); +} + +int CECKey::GetPrivKeySize(bool fCompressed) { + EC_KEY_set_conv_form(pkey, fCompressed ? POINT_CONVERSION_COMPRESSED : POINT_CONVERSION_UNCOMPRESSED); + return i2d_ECPrivateKey(pkey, NULL); +} +int CECKey::GetPrivKey(unsigned char* privkey, bool fCompressed) { + EC_KEY_set_conv_form(pkey, fCompressed ? POINT_CONVERSION_COMPRESSED : POINT_CONVERSION_UNCOMPRESSED); + return i2d_ECPrivateKey(pkey, &privkey); +} + +bool CECKey::SetPrivKey(const unsigned char* privkey, size_t size, bool fSkipCheck) { + if (d2i_ECPrivateKey(&pkey, &privkey, size)) { + if(fSkipCheck) + return true; + + // d2i_ECPrivateKey returns true if parsing succeeds. + // This doesn't necessarily mean the key is valid. + if (EC_KEY_check_key(pkey)) + return true; + } + return false; +} + +void CECKey::GetPubKey(std::vector &pubkey, bool fCompressed) { + EC_KEY_set_conv_form(pkey, fCompressed ? POINT_CONVERSION_COMPRESSED : POINT_CONVERSION_UNCOMPRESSED); + int nSize = i2o_ECPublicKey(pkey, NULL); + assert(nSize); + assert(nSize <= 65); + pubkey.clear(); + pubkey.resize(nSize); + unsigned char *pbegin(begin_ptr(pubkey)); + int nSize2 = i2o_ECPublicKey(pkey, &pbegin); + assert(nSize == nSize2); +} + +bool CECKey::SetPubKey(const unsigned char* pubkey, size_t size) { + return o2i_ECPublicKey(&pkey, &pubkey, size) != NULL; +} + +bool CECKey::Sign(const uint256 &hash, std::vector& vchSig, bool lowS) { + vchSig.clear(); + ECDSA_SIG *sig = ECDSA_do_sign((unsigned char*)&hash, sizeof(hash), pkey); + if (sig == NULL) + return false; + BN_CTX *ctx = BN_CTX_new(); + BN_CTX_start(ctx); + const EC_GROUP *group = EC_KEY_get0_group(pkey); + BIGNUM *order = BN_CTX_get(ctx); + BIGNUM *halforder = BN_CTX_get(ctx); + EC_GROUP_get_order(group, order, ctx); + BN_rshift1(halforder, order); + if (lowS && BN_cmp(sig->s, halforder) > 0) { + // enforce low S values, by negating the value (modulo the order) if above order/2. + BN_sub(sig->s, order, sig->s); + } + BN_CTX_end(ctx); + BN_CTX_free(ctx); + unsigned int nSize = ECDSA_size(pkey); + vchSig.resize(nSize); // Make sure it is big enough + unsigned char *pos = &vchSig[0]; + nSize = i2d_ECDSA_SIG(sig, &pos); + ECDSA_SIG_free(sig); + vchSig.resize(nSize); // Shrink to fit actual size + return true; +} + +bool CECKey::Verify(const uint256 &hash, const std::vector& vchSig) { + // -1 = error, 0 = bad sig, 1 = good + if (ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), &vchSig[0], vchSig.size(), pkey) != 1) + return false; + return true; +} + +bool CECKey::SignCompact(const uint256 &hash, unsigned char *p64, int &rec) { + bool fOk = false; + ECDSA_SIG *sig = ECDSA_do_sign((unsigned char*)&hash, sizeof(hash), pkey); + if (sig==NULL) + return false; + memset(p64, 0, 64); + int nBitsR = BN_num_bits(sig->r); + int nBitsS = BN_num_bits(sig->s); + if (nBitsR <= 256 && nBitsS <= 256) { + std::vector pubkey; + GetPubKey(pubkey, true); + for (int i=0; i<4; i++) { + CECKey keyRec; + if (ECDSA_SIG_recover_key_GFp(keyRec.pkey, sig, (unsigned char*)&hash, sizeof(hash), i, 1) == 1) { + std::vector pubkeyRec; + keyRec.GetPubKey(pubkeyRec, true); + if (pubkeyRec == pubkey) { + rec = i; + fOk = true; + break; + } + } + } + assert(fOk); + BN_bn2bin(sig->r,&p64[32-(nBitsR+7)/8]); + BN_bn2bin(sig->s,&p64[64-(nBitsS+7)/8]); + } + ECDSA_SIG_free(sig); + return fOk; +} + +bool CECKey::Recover(const uint256 &hash, const unsigned char *p64, int rec) +{ + if (rec<0 || rec>=3) + return false; + ECDSA_SIG *sig = ECDSA_SIG_new(); + BN_bin2bn(&p64[0], 32, sig->r); + BN_bin2bn(&p64[32], 32, sig->s); + bool ret = ECDSA_SIG_recover_key_GFp(pkey, sig, (unsigned char*)&hash, sizeof(hash), rec, 0) == 1; + ECDSA_SIG_free(sig); + return ret; +} + +bool CECKey::TweakSecret(unsigned char vchSecretOut[32], const unsigned char vchSecretIn[32], const unsigned char vchTweak[32]) +{ + bool ret = true; + BN_CTX *ctx = BN_CTX_new(); + BN_CTX_start(ctx); + BIGNUM *bnSecret = BN_CTX_get(ctx); + BIGNUM *bnTweak = BN_CTX_get(ctx); + BIGNUM *bnOrder = BN_CTX_get(ctx); + EC_GROUP *group = EC_GROUP_new_by_curve_name(NID_secp256k1); + EC_GROUP_get_order(group, bnOrder, ctx); // what a grossly inefficient way to get the (constant) group order... + BN_bin2bn(vchTweak, 32, bnTweak); + if (BN_cmp(bnTweak, bnOrder) >= 0) + ret = false; // extremely unlikely + BN_bin2bn(vchSecretIn, 32, bnSecret); + BN_add(bnSecret, bnSecret, bnTweak); + BN_nnmod(bnSecret, bnSecret, bnOrder, ctx); + if (BN_is_zero(bnSecret)) + ret = false; // ridiculously unlikely + int nBits = BN_num_bits(bnSecret); + memset(vchSecretOut, 0, 32); + BN_bn2bin(bnSecret, &vchSecretOut[32-(nBits+7)/8]); + EC_GROUP_free(group); + BN_CTX_end(ctx); + BN_CTX_free(ctx); + return ret; +} + +bool CECKey::TweakPublic(const unsigned char vchTweak[32]) { + bool ret = true; + BN_CTX *ctx = BN_CTX_new(); + BN_CTX_start(ctx); + BIGNUM *bnTweak = BN_CTX_get(ctx); + BIGNUM *bnOrder = BN_CTX_get(ctx); + BIGNUM *bnOne = BN_CTX_get(ctx); + const EC_GROUP *group = EC_KEY_get0_group(pkey); + EC_GROUP_get_order(group, bnOrder, ctx); // what a grossly inefficient way to get the (constant) group order... + BN_bin2bn(vchTweak, 32, bnTweak); + if (BN_cmp(bnTweak, bnOrder) >= 0) + ret = false; // extremely unlikely + EC_POINT *point = EC_POINT_dup(EC_KEY_get0_public_key(pkey), group); + BN_one(bnOne); + EC_POINT_mul(group, point, bnTweak, point, bnOne, ctx); + if (EC_POINT_is_at_infinity(group, point)) + ret = false; // ridiculously unlikely + EC_KEY_set_public_key(pkey, point); + EC_POINT_free(point); + BN_CTX_end(ctx); + BN_CTX_free(ctx); + return ret; +} + +bool CECKey::SanityCheck() +{ + EC_KEY *pkey = EC_KEY_new_by_curve_name(NID_secp256k1); + if(pkey == NULL) + return false; + EC_KEY_free(pkey); + + // TODO Is there more EC functionality that could be missing? + return true; +} diff --git a/src/ecwrapper.h b/src/ecwrapper.h new file mode 100644 index 0000000000..072da4a942 --- /dev/null +++ b/src/ecwrapper.h @@ -0,0 +1,46 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_EC_WRAPPER_H +#define BITCOIN_EC_WRAPPER_H + +#include +#include + +#include + +class uint256; + +// RAII Wrapper around OpenSSL's EC_KEY +class CECKey { +private: + EC_KEY *pkey; + +public: + CECKey(); + ~CECKey(); + + void GetSecretBytes(unsigned char vch[32]) const; + void SetSecretBytes(const unsigned char vch[32]); + int GetPrivKeySize(bool fCompressed); + int GetPrivKey(unsigned char* privkey, bool fCompressed); + bool SetPrivKey(const unsigned char* privkey, size_t size, bool fSkipCheck=false); + void GetPubKey(std::vector& pubkey, bool fCompressed); + bool SetPubKey(const unsigned char* pubkey, size_t size); + bool Sign(const uint256 &hash, std::vector& vchSig, bool lowS); + bool Verify(const uint256 &hash, const std::vector& vchSig); + bool SignCompact(const uint256 &hash, unsigned char *p64, int &rec); + + // reconstruct public key from a compact signature + // This is only slightly more CPU intensive than just verifying it. + // If this function succeeds, the recovered public key is guaranteed to be valid + // (the signature is a valid signature of the given data for that key) + bool Recover(const uint256 &hash, const unsigned char *p64, int rec); + + static bool TweakSecret(unsigned char vchSecretOut[32], const unsigned char vchSecretIn[32], const unsigned char vchTweak[32]); + bool TweakPublic(const unsigned char vchTweak[32]); + static bool SanityCheck(); +}; + +#endif diff --git a/src/key.cpp b/src/key.cpp index d2001717f1..0f4bc6652c 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -10,12 +10,10 @@ #ifdef USE_SECP256K1 #include #else -#include -#include -#include +#include "ecwrapper.h" #endif -// anonymous namespace with local implementation code (OpenSSL interaction) +// anonymous namespace namespace { #ifdef USE_SECP256K1 @@ -31,325 +29,6 @@ public: }; static CSecp256k1Init instance_of_csecp256k1; -#else - -// Generate a private key from just the secret parameter -int EC_KEY_regenerate_key(EC_KEY *eckey, BIGNUM *priv_key) -{ - int ok = 0; - BN_CTX *ctx = NULL; - EC_POINT *pub_key = NULL; - - if (!eckey) return 0; - - const EC_GROUP *group = EC_KEY_get0_group(eckey); - - if ((ctx = BN_CTX_new()) == NULL) - goto err; - - pub_key = EC_POINT_new(group); - - if (pub_key == NULL) - goto err; - - if (!EC_POINT_mul(group, pub_key, priv_key, NULL, NULL, ctx)) - goto err; - - EC_KEY_set_private_key(eckey,priv_key); - EC_KEY_set_public_key(eckey,pub_key); - - ok = 1; - -err: - - if (pub_key) - EC_POINT_free(pub_key); - if (ctx != NULL) - BN_CTX_free(ctx); - - return(ok); -} - -// Perform ECDSA key recovery (see SEC1 4.1.6) for curves over (mod p)-fields -// recid selects which key is recovered -// if check is non-zero, additional checks are performed -int ECDSA_SIG_recover_key_GFp(EC_KEY *eckey, ECDSA_SIG *ecsig, const unsigned char *msg, int msglen, int recid, int check) -{ - if (!eckey) return 0; - - int ret = 0; - BN_CTX *ctx = NULL; - - BIGNUM *x = NULL; - BIGNUM *e = NULL; - BIGNUM *order = NULL; - BIGNUM *sor = NULL; - BIGNUM *eor = NULL; - BIGNUM *field = NULL; - EC_POINT *R = NULL; - EC_POINT *O = NULL; - EC_POINT *Q = NULL; - BIGNUM *rr = NULL; - BIGNUM *zero = NULL; - int n = 0; - int i = recid / 2; - - const EC_GROUP *group = EC_KEY_get0_group(eckey); - if ((ctx = BN_CTX_new()) == NULL) { ret = -1; goto err; } - BN_CTX_start(ctx); - order = BN_CTX_get(ctx); - if (!EC_GROUP_get_order(group, order, ctx)) { ret = -2; goto err; } - x = BN_CTX_get(ctx); - if (!BN_copy(x, order)) { ret=-1; goto err; } - if (!BN_mul_word(x, i)) { ret=-1; goto err; } - if (!BN_add(x, x, ecsig->r)) { ret=-1; goto err; } - field = BN_CTX_get(ctx); - if (!EC_GROUP_get_curve_GFp(group, field, NULL, NULL, ctx)) { ret=-2; goto err; } - if (BN_cmp(x, field) >= 0) { ret=0; goto err; } - if ((R = EC_POINT_new(group)) == NULL) { ret = -2; goto err; } - if (!EC_POINT_set_compressed_coordinates_GFp(group, R, x, recid % 2, ctx)) { ret=0; goto err; } - if (check) - { - if ((O = EC_POINT_new(group)) == NULL) { ret = -2; goto err; } - if (!EC_POINT_mul(group, O, NULL, R, order, ctx)) { ret=-2; goto err; } - if (!EC_POINT_is_at_infinity(group, O)) { ret = 0; goto err; } - } - if ((Q = EC_POINT_new(group)) == NULL) { ret = -2; goto err; } - n = EC_GROUP_get_degree(group); - e = BN_CTX_get(ctx); - if (!BN_bin2bn(msg, msglen, e)) { ret=-1; goto err; } - if (8*msglen > n) BN_rshift(e, e, 8-(n & 7)); - zero = BN_CTX_get(ctx); - if (!BN_zero(zero)) { ret=-1; goto err; } - if (!BN_mod_sub(e, zero, e, order, ctx)) { ret=-1; goto err; } - rr = BN_CTX_get(ctx); - if (!BN_mod_inverse(rr, ecsig->r, order, ctx)) { ret=-1; goto err; } - sor = BN_CTX_get(ctx); - if (!BN_mod_mul(sor, ecsig->s, rr, order, ctx)) { ret=-1; goto err; } - eor = BN_CTX_get(ctx); - if (!BN_mod_mul(eor, e, rr, order, ctx)) { ret=-1; goto err; } - if (!EC_POINT_mul(group, Q, eor, R, sor, ctx)) { ret=-2; goto err; } - if (!EC_KEY_set_public_key(eckey, Q)) { ret=-2; goto err; } - - ret = 1; - -err: - if (ctx) { - BN_CTX_end(ctx); - BN_CTX_free(ctx); - } - if (R != NULL) EC_POINT_free(R); - if (O != NULL) EC_POINT_free(O); - if (Q != NULL) EC_POINT_free(Q); - return ret; -} - -// RAII Wrapper around OpenSSL's EC_KEY -class CECKey { -private: - EC_KEY *pkey; - -public: - CECKey() { - pkey = EC_KEY_new_by_curve_name(NID_secp256k1); - assert(pkey != NULL); - } - - ~CECKey() { - EC_KEY_free(pkey); - } - - void GetSecretBytes(unsigned char vch[32]) const { - const BIGNUM *bn = EC_KEY_get0_private_key(pkey); - assert(bn); - int nBytes = BN_num_bytes(bn); - int n=BN_bn2bin(bn,&vch[32 - nBytes]); - assert(n == nBytes); - memset(vch, 0, 32 - nBytes); - } - - void SetSecretBytes(const unsigned char vch[32]) { - bool ret; - BIGNUM bn; - BN_init(&bn); - ret = BN_bin2bn(vch, 32, &bn) != NULL; - assert(ret); - ret = EC_KEY_regenerate_key(pkey, &bn) != 0; - assert(ret); - BN_clear_free(&bn); - } - - int GetPrivKeySize(bool fCompressed) { - EC_KEY_set_conv_form(pkey, fCompressed ? POINT_CONVERSION_COMPRESSED : POINT_CONVERSION_UNCOMPRESSED); - return i2d_ECPrivateKey(pkey, NULL); - } - int GetPrivKey(unsigned char* privkey, bool fCompressed) { - EC_KEY_set_conv_form(pkey, fCompressed ? POINT_CONVERSION_COMPRESSED : POINT_CONVERSION_UNCOMPRESSED); - return i2d_ECPrivateKey(pkey, &privkey); - } - - bool SetPrivKey(const unsigned char* privkey, size_t size, bool fSkipCheck=false) { - if (d2i_ECPrivateKey(&pkey, &privkey, size)) { - if(fSkipCheck) - return true; - - // d2i_ECPrivateKey returns true if parsing succeeds. - // This doesn't necessarily mean the key is valid. - if (EC_KEY_check_key(pkey)) - return true; - } - return false; - } - - void GetPubKey(std::vector &pubkey, bool fCompressed) { - EC_KEY_set_conv_form(pkey, fCompressed ? POINT_CONVERSION_COMPRESSED : POINT_CONVERSION_UNCOMPRESSED); - int nSize = i2o_ECPublicKey(pkey, NULL); - assert(nSize); - assert(nSize <= 65); - pubkey.clear(); - pubkey.resize(nSize); - unsigned char *pbegin(begin_ptr(pubkey)); - int nSize2 = i2o_ECPublicKey(pkey, &pbegin); - assert(nSize == nSize2); - } - - bool SetPubKey(const unsigned char* pubkey, size_t size) { - return o2i_ECPublicKey(&pkey, &pubkey, size) != NULL; - } - - bool Sign(const uint256 &hash, std::vector& vchSig, bool lowS) { - vchSig.clear(); - ECDSA_SIG *sig = ECDSA_do_sign((unsigned char*)&hash, sizeof(hash), pkey); - if (sig == NULL) - return false; - BN_CTX *ctx = BN_CTX_new(); - BN_CTX_start(ctx); - const EC_GROUP *group = EC_KEY_get0_group(pkey); - BIGNUM *order = BN_CTX_get(ctx); - BIGNUM *halforder = BN_CTX_get(ctx); - EC_GROUP_get_order(group, order, ctx); - BN_rshift1(halforder, order); - if (lowS && BN_cmp(sig->s, halforder) > 0) { - // enforce low S values, by negating the value (modulo the order) if above order/2. - BN_sub(sig->s, order, sig->s); - } - BN_CTX_end(ctx); - BN_CTX_free(ctx); - unsigned int nSize = ECDSA_size(pkey); - vchSig.resize(nSize); // Make sure it is big enough - unsigned char *pos = &vchSig[0]; - nSize = i2d_ECDSA_SIG(sig, &pos); - ECDSA_SIG_free(sig); - vchSig.resize(nSize); // Shrink to fit actual size - return true; - } - - bool Verify(const uint256 &hash, const std::vector& vchSig) { - // -1 = error, 0 = bad sig, 1 = good - if (ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), &vchSig[0], vchSig.size(), pkey) != 1) - return false; - return true; - } - - bool SignCompact(const uint256 &hash, unsigned char *p64, int &rec) { - bool fOk = false; - ECDSA_SIG *sig = ECDSA_do_sign((unsigned char*)&hash, sizeof(hash), pkey); - if (sig==NULL) - return false; - memset(p64, 0, 64); - int nBitsR = BN_num_bits(sig->r); - int nBitsS = BN_num_bits(sig->s); - if (nBitsR <= 256 && nBitsS <= 256) { - std::vector pubkey; - GetPubKey(pubkey, true); - for (int i=0; i<4; i++) { - CECKey keyRec; - if (ECDSA_SIG_recover_key_GFp(keyRec.pkey, sig, (unsigned char*)&hash, sizeof(hash), i, 1) == 1) { - std::vector pubkeyRec; - keyRec.GetPubKey(pubkeyRec, true); - if (pubkeyRec == pubkey) { - rec = i; - fOk = true; - break; - } - } - } - assert(fOk); - BN_bn2bin(sig->r,&p64[32-(nBitsR+7)/8]); - BN_bn2bin(sig->s,&p64[64-(nBitsS+7)/8]); - } - ECDSA_SIG_free(sig); - return fOk; - } - - // reconstruct public key from a compact signature - // This is only slightly more CPU intensive than just verifying it. - // If this function succeeds, the recovered public key is guaranteed to be valid - // (the signature is a valid signature of the given data for that key) - bool Recover(const uint256 &hash, const unsigned char *p64, int rec) - { - if (rec<0 || rec>=3) - return false; - ECDSA_SIG *sig = ECDSA_SIG_new(); - BN_bin2bn(&p64[0], 32, sig->r); - BN_bin2bn(&p64[32], 32, sig->s); - bool ret = ECDSA_SIG_recover_key_GFp(pkey, sig, (unsigned char*)&hash, sizeof(hash), rec, 0) == 1; - ECDSA_SIG_free(sig); - return ret; - } - - static bool TweakSecret(unsigned char vchSecretOut[32], const unsigned char vchSecretIn[32], const unsigned char vchTweak[32]) - { - bool ret = true; - BN_CTX *ctx = BN_CTX_new(); - BN_CTX_start(ctx); - BIGNUM *bnSecret = BN_CTX_get(ctx); - BIGNUM *bnTweak = BN_CTX_get(ctx); - BIGNUM *bnOrder = BN_CTX_get(ctx); - EC_GROUP *group = EC_GROUP_new_by_curve_name(NID_secp256k1); - EC_GROUP_get_order(group, bnOrder, ctx); // what a grossly inefficient way to get the (constant) group order... - BN_bin2bn(vchTweak, 32, bnTweak); - if (BN_cmp(bnTweak, bnOrder) >= 0) - ret = false; // extremely unlikely - BN_bin2bn(vchSecretIn, 32, bnSecret); - BN_add(bnSecret, bnSecret, bnTweak); - BN_nnmod(bnSecret, bnSecret, bnOrder, ctx); - if (BN_is_zero(bnSecret)) - ret = false; // ridiculously unlikely - int nBits = BN_num_bits(bnSecret); - memset(vchSecretOut, 0, 32); - BN_bn2bin(bnSecret, &vchSecretOut[32-(nBits+7)/8]); - EC_GROUP_free(group); - BN_CTX_end(ctx); - BN_CTX_free(ctx); - return ret; - } - - bool TweakPublic(const unsigned char vchTweak[32]) { - bool ret = true; - BN_CTX *ctx = BN_CTX_new(); - BN_CTX_start(ctx); - BIGNUM *bnTweak = BN_CTX_get(ctx); - BIGNUM *bnOrder = BN_CTX_get(ctx); - BIGNUM *bnOne = BN_CTX_get(ctx); - const EC_GROUP *group = EC_KEY_get0_group(pkey); - EC_GROUP_get_order(group, bnOrder, ctx); // what a grossly inefficient way to get the (constant) group order... - BN_bin2bn(vchTweak, 32, bnTweak); - if (BN_cmp(bnTweak, bnOrder) >= 0) - ret = false; // extremely unlikely - EC_POINT *point = EC_POINT_dup(EC_KEY_get0_public_key(pkey), group); - BN_one(bnOne); - EC_POINT_mul(group, point, bnTweak, point, bnOne, ctx); - if (EC_POINT_is_at_infinity(group, point)) - ret = false; // ridiculously unlikely - EC_KEY_set_public_key(pkey, point); - EC_POINT_free(point); - BN_CTX_end(ctx); - BN_CTX_free(ctx); - return ret; - } -}; - #endif int CompareBigEndian(const unsigned char *c1, size_t c1len, const unsigned char *c2, size_t c2len) { @@ -746,12 +425,6 @@ bool ECC_InitSanityCheck() { #ifdef USE_SECP256K1 return true; #else - EC_KEY *pkey = EC_KEY_new_by_curve_name(NID_secp256k1); - if(pkey == NULL) - return false; - EC_KEY_free(pkey); - - // TODO Is there more EC functionality that could be missing? - return true; + return CECKey::SanityCheck(); #endif } From 02fe12dcf4414eaff0161c6b5df7334135958485 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Tue, 28 Oct 2014 10:10:59 +0800 Subject: [PATCH 0936/1288] Update generate-seeds.py to produce doxygen compatible comments --- share/seeds/generate-seeds.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/share/seeds/generate-seeds.py b/share/seeds/generate-seeds.py index 6c1b4ed860..5f06740560 100755 --- a/share/seeds/generate-seeds.py +++ b/share/seeds/generate-seeds.py @@ -1,6 +1,6 @@ #!/usr/bin/python # Copyright (c) 2014 Wladmir J. van der Laan -# Distributed under the MIT/X11 software license, see the accompanying +# Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Script to generate list of seed nodes for chainparams.cpp. @@ -116,10 +116,13 @@ def main(): indir = sys.argv[1] g.write('#ifndef H_CHAINPARAMSSEEDS\n') g.write('#define H_CHAINPARAMSSEEDS\n') - g.write('// List of fixed seed nodes for the bitcoin network\n') - g.write('// AUTOGENERATED by contrib/devtools/generate-seeds.py\n\n') - g.write('// Each line contains a 16-byte IPv6 address and a port.\n') - g.write('// IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly.\n') + g.write('/**\n') + g.write(' * List of fixed seed nodes for the bitcoin network\n') + g.write(' * AUTOGENERATED by share/seeds/generate-seeds.py\n') + g.write(' *\n') + g.write(' * Each line contains a 16-byte IPv6 address and a port.\n') + g.write(' * IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly.\n') + g.write(' */\n') with open(os.path.join(indir,'nodes_main.txt'),'r') as f: process_nodes(g, f, 'pnSeed6_main', 8333) g.write('\n') From 5b40d8868820265adb24fec097905e84edb85762 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Sun, 26 Oct 2014 15:03:12 +0800 Subject: [PATCH 0937/1288] Update comments in wallet to be doxygen compatible --- src/wallet.cpp | 76 ++++++++++++++++----------- src/wallet.h | 138 ++++++++++++++++++++++++++++--------------------- 2 files changed, 125 insertions(+), 89 deletions(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index 3812c22fe2..d392149dbb 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "wallet.h" @@ -22,18 +22,23 @@ using namespace std; -// Settings +/** + * Settings + */ CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE); unsigned int nTxConfirmTarget = 1; bool bSpendZeroConfChange = true; -/** Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) */ -CFeeRate CWallet::minTxFee = CFeeRate(10000); // Override with -mintxfee +/** + * Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) + * Override with -mintxfee + */ +CFeeRate CWallet::minTxFee = CFeeRate(10000); -////////////////////////////////////////////////////////////////////////////// -// -// mapWallet -// +/** @defgroup mapWallet + * + * @{ + */ struct CompareValueOnly { @@ -367,8 +372,10 @@ void CWallet::SyncMetaData(pair range) } } -// Outpoint is spent if any non-conflicted transaction -// spends it: +/** + * Outpoint is spent if any non-conflicted transaction + * spends it: + */ bool CWallet::IsSpent(const uint256& hash, unsigned int n) const { const COutPoint outpoint(hash, n); @@ -477,7 +484,7 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase) { if (!pwalletdbEncryption->TxnCommit()) { delete pwalletdbEncryption; - // We now have keys encrypted in memory, but no on disk... + // We now have keys encrypted in memory, but not on disk... // die to avoid confusion and let the user reload their unencrypted wallet. assert(false); } @@ -667,9 +674,11 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet) return true; } -// Add a transaction to the wallet, or update it. -// pblock is optional, but should be provided if the transaction is known to be in a block. -// If fUpdate is true, existing transactions will be updated. +/** + * Add a transaction to the wallet, or update it. + * pblock is optional, but should be provided if the transaction is known to be in a block. + * If fUpdate is true, existing transactions will be updated. + */ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate) { { @@ -911,9 +920,11 @@ bool CWalletTx::WriteToDisk() return CWalletDB(pwallet->strWalletFile).WriteTx(GetHash(), *this); } -// Scan the block chain (starting in pindexStart) for transactions -// from or to us. If fUpdate is true, found transactions that already -// exist in the wallet will be updated. +/** + * Scan the block chain (starting in pindexStart) for transactions + * from or to us. If fUpdate is true, found transactions that already + * exist in the wallet will be updated. + */ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate) { int ret = 0; @@ -1035,15 +1046,15 @@ void CWallet::ResendWalletTransactions() } } +/** @} */ // end of mapWallet - -////////////////////////////////////////////////////////////////////////////// -// -// Actions -// +/** @defgroup Actions + * + * @{ + */ CAmount CWallet::GetBalance() const @@ -1136,7 +1147,9 @@ CAmount CWallet::GetImmatureWatchOnlyBalance() const return nTotal; } -// populate vCoins with vector of available COutputs. +/** + * populate vCoins with vector of available COutputs. + */ void CWallet::AvailableCoins(vector& vCoins, bool fOnlyConfirmed, const CCoinControl *coinControl) const { vCoins.clear(); @@ -1194,7 +1207,7 @@ static void ApproximateBestSubset(vector& vWtx) setKeyPool.clear(); // Note: can't top-up keypool here, because wallet is locked. // User will be prompted to unlock wallet the next operation - // the requires a new key. + // that requires a new key. } } @@ -1736,10 +1751,10 @@ bool CWallet::SetDefaultKey(const CPubKey &vchPubKey) return true; } -// -// Mark old keypool keys as used, -// and generate all new keys -// +/** + * Mark old keypool keys as used, + * and generate all new keys + */ bool CWallet::NewKeyPool() { { @@ -2120,6 +2135,7 @@ void CWallet::ListLockedCoins(std::vector& vOutpts) } } +/** @} */ // end of Actions class CAffectedKeysVisitor : public boost::static_visitor { private: diff --git a/src/wallet.h b/src/wallet.h index 9b6895090c..6ef830f220 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_WALLET_H @@ -24,16 +24,18 @@ #include #include -// Settings +/** + * Settings + */ extern CFeeRate payTxFee; extern unsigned int nTxConfirmTarget; extern bool bSpendZeroConfChange; -// -paytxfee default +//! -paytxfee default static const CAmount DEFAULT_TRANSACTION_FEE = 0; -// -paytxfee will warn if called with a higher fee than this amount (in satoshis) per KB +//! -paytxfee will warn if called with a higher fee than this amount (in satoshis) per KB static const CAmount nHighTransactionFeeWarning = 0.01 * COIN; -// Largest (in bytes) free transaction we're willing to create +//! Largest (in bytes) free transaction we're willing to create static const unsigned int MAX_FREE_TRANSACTION_CREATE_SIZE = 1000; class CAccountingEntry; @@ -92,7 +94,8 @@ public: StringMap destdata; }; -/** A CWallet is an extension of a keystore, which also maintains a set of transactions and balances, +/** + * A CWallet is an extension of a keystore, which also maintains a set of transactions and balances, * and provides the ability to create new transactions. */ class CWallet : public CCryptoKeyStore, public CValidationInterface @@ -102,18 +105,20 @@ private: CWalletDB *pwalletdbEncryption; - // the current wallet version: clients below this version are not able to load the wallet + //! the current wallet version: clients below this version are not able to load the wallet int nWalletVersion; - // the maximum wallet format version: memory-only variable that specifies to what version this wallet may be upgraded + //! the maximum wallet format version: memory-only variable that specifies to what version this wallet may be upgraded int nWalletMaxVersion; int64_t nNextResend; int64_t nLastResend; - // Used to keep track of spent outpoints, and - // detect and report conflicts (double-spends or - // mutated transactions where the mutant gets mined). + /** + * Used to keep track of spent outpoints, and + * detect and report conflicts (double-spends or + * mutated transactions where the mutant gets mined). + */ typedef std::multimap TxSpends; TxSpends mapTxSpends; void AddToSpends(const COutPoint& outpoint, const uint256& wtxid); @@ -122,11 +127,13 @@ private: void SyncMetaData(std::pair); public: - /// Main wallet lock. - /// This lock protects all the fields added by CWallet - /// except for: - /// fFileBacked (immutable after instantiation) - /// strWalletFile (immutable after instantiation) + /* + * Main wallet lock. + * This lock protects all the fields added by CWallet + * except for: + * fFileBacked (immutable after instantiation) + * strWalletFile (immutable after instantiation) + */ mutable CCriticalSection cs_wallet; bool fFileBacked; @@ -186,7 +193,7 @@ public: const CWalletTx* GetWalletTx(const uint256& hash) const; - // check whether we are allowed to upgrade (or already support) to the named feature + //! 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; } void AvailableCoins(std::vector& vCoins, bool fOnlyConfirmed=true, const CCoinControl *coinControl = NULL) const; @@ -200,38 +207,40 @@ public: void UnlockAllCoins(); void ListLockedCoins(std::vector& vOutpts); - // keystore implementation - // Generate a new key + /** + * keystore implementation + * Generate a new key + */ CPubKey GenerateNewKey(); - // Adds a key to the store, and saves it to disk. + //! Adds a key to the store, and saves it to disk. bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey); - // Adds a key to the store, without saving it to disk (used by LoadWallet) + //! Adds a key to the store, without saving it to disk (used by LoadWallet) bool LoadKey(const CKey& key, const CPubKey &pubkey) { return CCryptoKeyStore::AddKeyPubKey(key, pubkey); } - // Load metadata (used by LoadWallet) + //! Load metadata (used by LoadWallet) bool LoadKeyMetadata(const CPubKey &pubkey, const CKeyMetadata &metadata); bool LoadMinVersion(int nVersion) { AssertLockHeld(cs_wallet); nWalletVersion = nVersion; nWalletMaxVersion = std::max(nWalletMaxVersion, nVersion); return true; } - // Adds an encrypted key to the store, and saves it to disk. + //! Adds an encrypted key to the store, and saves it to disk. bool AddCryptedKey(const CPubKey &vchPubKey, const std::vector &vchCryptedSecret); - // Adds an encrypted key to the store, without saving it to disk (used by LoadWallet) + //! Adds an encrypted key to the store, without saving it to disk (used by LoadWallet) bool LoadCryptedKey(const CPubKey &vchPubKey, const std::vector &vchCryptedSecret); bool AddCScript(const CScript& redeemScript); bool LoadCScript(const CScript& redeemScript); - /// Adds a destination data tuple to the store, and saves it to disk + //! Adds a destination data tuple to the store, and saves it to disk bool AddDestData(const CTxDestination &dest, const std::string &key, const std::string &value); - /// Erases a destination data tuple in the store and on disk + //! Erases a destination data tuple in the store and on disk bool EraseDestData(const CTxDestination &dest, const std::string &key); - /// Adds a destination data tuple to the store, without saving it to disk + //! Adds a destination data tuple to the store, without saving it to disk bool LoadDestData(const CTxDestination &dest, const std::string &key, const std::string &value); - /// Look up a destination data tuple in the store, return true if found false otherwise + //! Look up a destination data tuple in the store, return true if found false otherwise bool GetDestData(const CTxDestination &dest, const std::string &key, std::string *value) const; - // Adds a watch-only address to the store, and saves it to disk. + //! Adds a watch-only address to the store, and saves it to disk. bool AddWatchOnly(const CScript &dest); bool RemoveWatchOnly(const CScript &dest); - // Adds a watch-only address to the store, without saving it to disk (used by LoadWallet) + //! Adds a watch-only address to the store, without saving it to disk (used by LoadWallet) bool LoadWatchOnly(const CScript &dest); bool Unlock(const SecureString& strWalletPassphrase); @@ -240,17 +249,19 @@ public: void GetKeyBirthTimes(std::map &mapKeyBirth) const; - /** Increment the next transaction order id - @return next transaction order id + /** + * Increment the next transaction order id + * @return next transaction order id */ int64_t IncOrderPosNext(CWalletDB *pwalletdb = NULL); typedef std::pair TxPair; typedef std::multimap TxItems; - /** Get the wallet's activity log - @return multimap of ordered transactions and accounting entries - @warning Returned pointers are *only* valid within the scope of passed acentries + /** + * Get the wallet's activity log + * @return multimap of ordered transactions and accounting entries + * @warning Returned pointers are *only* valid within the scope of passed acentries */ TxItems OrderedTxItems(std::list& acentries, std::string strAccount = ""); @@ -318,7 +329,8 @@ public: return true; return false; } - bool IsFromMe(const CTransaction& tx) const // should probably be renamed to IsRelevantToMe + /** should probably be renamed to IsRelevantToMe */ + bool IsFromMe(const CTransaction& tx) const { return (GetDebit(tx, ISMINE_ALL) > 0); } @@ -384,19 +396,20 @@ public: bool SetDefaultKey(const CPubKey &vchPubKey); - // signify that a particular wallet feature is now used. this may change nWalletVersion and nWalletMaxVersion if those are lower + //! signify that a particular wallet feature is now used. this may change nWalletVersion and nWalletMaxVersion if those are lower bool SetMinVersion(enum WalletFeature, CWalletDB* pwalletdbIn = NULL, bool fExplicit = false); - // change which version we're allowed to upgrade to (note that this does not immediately imply upgrading to that format) + //! change which version we're allowed to upgrade to (note that this does not immediately imply upgrading to that format) bool SetMaxVersion(int nVersion); - // get the current wallet format (the oldest client version guaranteed to understand this wallet) + //! get the current wallet format (the oldest client version guaranteed to understand this wallet) int GetVersion() { LOCK(cs_wallet); return nWalletVersion; } - // Get wallet transactions that conflict with given transaction (spend same outputs) + //! Get wallet transactions that conflict with given transaction (spend same outputs) std::set GetConflicts(const uint256& txid) const; - /** Address book entry changed. + /** + * Address book entry changed. * @note called with lock cs_wallet held. */ boost::signals2::signal NotifyAddressBookChanged; - /** Wallet transaction added, removed or updated. + /** + * Wallet transaction added, removed or updated. * @note called with lock cs_wallet held. */ boost::signals2::signal=1 : this many blocks deep in the main chain + + /** + * Return depth of transaction in blockchain: + * -1 : not in blockchain, and not in memory pool (conflicted transaction) + * 0 : in memory pool, waiting to be included in a block + * >=1 : this many blocks deep in the main chain + */ int GetDepthInMainChain(const CBlockIndex* &pindexRet) const; int GetDepthInMainChain() const { const CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet); } bool IsInMainChain() const { const CBlockIndex *pindexRet; return GetDepthInMainChainINTERNAL(pindexRet) > 0; } @@ -526,7 +543,8 @@ public: bool AcceptToMemoryPool(bool fLimitFree=true, bool fRejectInsaneFee=true); }; -/** A transaction with a bunch of additional info that only the owner cares about. +/** + * A transaction with a bunch of additional info that only the owner cares about. * It includes any unrecorded transactions needed to link it back to the block chain. */ class CWalletTx : public CMerkleTx @@ -538,11 +556,11 @@ public: mapValue_t mapValue; std::vector > vOrderForm; unsigned int fTimeReceivedIsTxTime; - unsigned int nTimeReceived; // time received by this node + unsigned int nTimeReceived; //! time received by this node unsigned int nTimeSmart; char fFromMe; std::string strFromAccount; - int64_t nOrderPos; // position in ordered transaction list + int64_t nOrderPos; //! position in ordered transaction list // memory only mutable bool fDebitCached; @@ -634,7 +652,7 @@ public: } READWRITE(*(CMerkleTx*)this); - std::vector vUnused; // Used to be vtxPrev + std::vector vUnused; //! Used to be vtxPrev READWRITE(vUnused); READWRITE(mapValue); READWRITE(vOrderForm); @@ -659,7 +677,7 @@ public: mapValue.erase("timesmart"); } - // make sure balances are recalculated + //! make sure balances are recalculated void MarkDirty() { fCreditCached = false; @@ -678,7 +696,7 @@ public: MarkDirty(); } - // filter decides which addresses will count towards the debit + //! filter decides which addresses will count towards the debit CAmount GetDebit(const isminefilter& filter) const { if (vin.empty()) @@ -917,8 +935,8 @@ public: int64_t nTimeCreated; int64_t nTimeExpires; std::string strComment; - //// todo: add something to note what created it (user, getnewaddress, change) - //// maybe should have a map property map + //! todo: add something to note what created it (user, getnewaddress, change) + //! maybe should have a map property map CWalletKey(int64_t nExpires=0); @@ -940,7 +958,8 @@ public: -/** Account information. +/** + * Account information. * Stored in wallet with key "acc"+string account name. */ class CAccount @@ -970,7 +989,8 @@ public: -/** Internal transfers. +/** + * Internal transfers. * Database key is acentry. */ class CAccountingEntry @@ -982,7 +1002,7 @@ public: std::string strOtherAccount; std::string strComment; mapValue_t mapValue; - int64_t nOrderPos; // position in ordered transaction list + int64_t nOrderPos; //! position in ordered transaction list uint64_t nEntryNo; CAccountingEntry() @@ -1007,7 +1027,7 @@ public: inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { if (!(nType & SER_GETHASH)) READWRITE(nVersion); - // Note: strAccount is serialized as part of the key, not here. + //! Note: strAccount is serialized as part of the key, not here. READWRITE(nCreditDebit); READWRITE(nTime); READWRITE(LIMITED_STRING(strOtherAccount, 65536)); From ffd8eddab540a9692bef681f2637f757d84e28a2 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Sun, 26 Oct 2014 16:33:52 +0800 Subject: [PATCH 0938/1288] Update comments in key to be doxygen compatible --- src/key.cpp | 8 +-- src/key.h | 139 +++++++++++++++++++++++++++++----------------------- 2 files changed, 82 insertions(+), 65 deletions(-) diff --git a/src/key.cpp b/src/key.cpp index 0f4bc6652c..48431f3dc5 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "key.h" @@ -13,7 +13,7 @@ #include "ecwrapper.h" #endif -// anonymous namespace +//! anonymous namespace with local implementation code (OpenSSL interaction) namespace { #ifdef USE_SECP256K1 @@ -56,7 +56,7 @@ int CompareBigEndian(const unsigned char *c1, size_t c1len, const unsigned char return 0; } -// Order of secp256k1's generator minus 1. +/** Order of secp256k1's generator minus 1. */ const unsigned char vchMaxModOrder[32] = { 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE, @@ -64,7 +64,7 @@ const unsigned char vchMaxModOrder[32] = { 0xBF,0xD2,0x5E,0x8C,0xD0,0x36,0x41,0x40 }; -// Half of the order of secp256k1's generator minus 1. +/** Half of the order of secp256k1's generator minus 1. */ const unsigned char vchMaxModHalfOrder[32] = { 0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, diff --git a/src/key.h b/src/key.h index 48b1652536..b4cb647681 100644 --- a/src/key.h +++ b/src/key.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_KEY_H @@ -14,13 +14,15 @@ #include #include -// secp256k1: -// const unsigned int PRIVATE_KEY_SIZE = 279; -// const unsigned int PUBLIC_KEY_SIZE = 65; -// const unsigned int SIGNATURE_SIZE = 72; -// -// see www.keylength.com -// script supports up to 75 for single byte push +/** + * secp256k1: + * const unsigned int PRIVATE_KEY_SIZE = 279; + * const unsigned int PUBLIC_KEY_SIZE = 65; + * const unsigned int SIGNATURE_SIZE = 72; + * + * see www.keylength.com + * script supports up to 75 for single byte push + */ /** A reference to a CKey: the Hash160 of its serialized public key */ class CKeyID : public uint160 @@ -34,11 +36,14 @@ public: class CPubKey { private: - // Just store the serialized data. - // Its length can very cheaply be computed from the first byte. + + /** + * Just store the serialized data. + * Its length can very cheaply be computed from the first byte. + */ unsigned char vch[65]; - // Compute the length of a pubkey with a given first byte. + //! Compute the length of a pubkey with a given first byte. unsigned int static GetLen(unsigned char chHeader) { if (chHeader == 2 || chHeader == 3) @@ -48,20 +53,20 @@ private: return 0; } - // Set this key data to be invalid + //! Set this key data to be invalid void Invalidate() { vch[0] = 0xFF; } public: - // Construct an invalid public key. + //! Construct an invalid public key. CPubKey() { Invalidate(); } - // Initialize a public key using begin/end iterators to byte data. + //! Initialize a public key using begin/end iterators to byte data. template void Set(const T pbegin, const T pend) { @@ -72,26 +77,26 @@ public: Invalidate(); } - // Construct a public key using begin/end iterators to byte data. + //! Construct a public key using begin/end iterators to byte data. template CPubKey(const T pbegin, const T pend) { Set(pbegin, pend); } - // Construct a public key from a byte vector. + //! Construct a public key from a byte vector. CPubKey(const std::vector& vch) { Set(vch.begin(), vch.end()); } - // Simple read-only vector-like interface to the pubkey data. + //! Simple read-only vector-like interface to the pubkey data. unsigned int size() const { return GetLen(vch[0]); } const unsigned char* begin() const { return vch; } const unsigned char* end() const { return vch + size(); } const unsigned char& operator[](unsigned int pos) const { return vch[pos]; } - // Comparator implementation. + //! Comparator implementation. friend bool operator==(const CPubKey& a, const CPubKey& b) { return a.vch[0] == b.vch[0] && @@ -107,7 +112,7 @@ public: (a.vch[0] == b.vch[0] && memcmp(a.vch, b.vch, a.size()) < 0); } - // Implement serialization, as if this was a byte vector. + //! Implement serialization, as if this was a byte vector. unsigned int GetSerializeSize(int nType, int nVersion) const { return size() + 1; @@ -134,86 +139,92 @@ public: } } - // Get the KeyID of this public key (hash of its serialization) + //! Get the KeyID of this public key (hash of its serialization) CKeyID GetID() const { return CKeyID(Hash160(vch, vch + size())); } - // Get the 256-bit hash of this public key. + //! Get the 256-bit hash of this public key. uint256 GetHash() const { return Hash(vch, vch + size()); } - // Check syntactic correctness. - // - // Note that this is consensus critical as CheckSig() calls it! + /* + * Check syntactic correctness. + * + * Note that this is consensus critical as CheckSig() calls it! + */ bool IsValid() const { return size() > 0; } - // fully validate whether this is a valid public key (more expensive than IsValid()) + //! fully validate whether this is a valid public key (more expensive than IsValid()) bool IsFullyValid() const; - // Check whether this is a compressed public key. + //! Check whether this is a compressed public key. bool IsCompressed() const { return size() == 33; } - // Verify a DER signature (~72 bytes). - // If this public key is not fully valid, the return value will be false. + /** + * Verify a DER signature (~72 bytes). + * If this public key is not fully valid, the return value will be false. + */ bool Verify(const uint256& hash, const std::vector& vchSig) const; - // Recover a public key from a compact signature. + //! Recover a public key from a compact signature. bool RecoverCompact(const uint256& hash, const std::vector& vchSig); - // Turn this public key into an uncompressed public key. + //! Turn this public key into an uncompressed public key. bool Decompress(); - // Derive BIP32 child pubkey. + //! Derive BIP32 child pubkey. bool Derive(CPubKey& pubkeyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const; }; -// secure_allocator is defined in allocators.h -// CPrivKey is a serialized private key, with all parameters included (279 bytes) +/** + * secure_allocator is defined in allocators.h + * CPrivKey is a serialized private key, with all parameters included (279 bytes) + */ typedef std::vector > CPrivKey; /** An encapsulated private key. */ class CKey { private: - // Whether this private key is valid. We check for correctness when modifying the key - // data, so fValid should always correspond to the actual state. + //! Whether this private key is valid. We check for correctness when modifying the key + //! data, so fValid should always correspond to the actual state. bool fValid; - // Whether the public key corresponding to this private key is (to be) compressed. + //! Whether the public key corresponding to this private key is (to be) compressed. bool fCompressed; - // The actual byte data + //! The actual byte data unsigned char vch[32]; - // Check whether the 32-byte array pointed to be vch is valid keydata. + //! Check whether the 32-byte array pointed to be vch is valid keydata. bool static Check(const unsigned char* vch); public: - // Construct an invalid private key. + //! Construct an invalid private key. CKey() : fValid(false), fCompressed(false) { LockObject(vch); } - // Copy constructor. This is necessary because of memlocking. + //! Copy constructor. This is necessary because of memlocking. CKey(const CKey& secret) : fValid(secret.fValid), fCompressed(secret.fCompressed) { LockObject(vch); memcpy(vch, secret.vch, sizeof(vch)); } - // Destructor (again necessary because of memlocking). + //! Destructor (again necessary because of memlocking). ~CKey() { UnlockObject(vch); @@ -225,7 +236,7 @@ public: memcmp(&a.vch[0], &b.vch[0], a.size()) == 0; } - // Initialize using begin and end iterators to byte data. + //! Initialize using begin and end iterators to byte data. template void Set(const T pbegin, const T pend, bool fCompressedIn) { @@ -242,48 +253,54 @@ public: } } - // Simple read-only vector-like interface. + //! Simple read-only vector-like interface. unsigned int size() const { return (fValid ? 32 : 0); } const unsigned char* begin() const { return vch; } const unsigned char* end() const { return vch + size(); } - // Check whether this private key is valid. + //! Check whether this private key is valid. bool IsValid() const { return fValid; } - // Check whether the public key corresponding to this private key is (to be) compressed. + //! Check whether the public key corresponding to this private key is (to be) compressed. bool IsCompressed() const { return fCompressed; } - // Initialize from a CPrivKey (serialized OpenSSL private key data). + //! Initialize from a CPrivKey (serialized OpenSSL private key data). bool SetPrivKey(const CPrivKey& vchPrivKey, bool fCompressed); - // Generate a new private key using a cryptographic PRNG. + //! Generate a new private key using a cryptographic PRNG. void MakeNewKey(bool fCompressed); - // Convert the private key to a CPrivKey (serialized OpenSSL private key data). - // This is expensive. + /** + * Convert the private key to a CPrivKey (serialized OpenSSL private key data). + * This is expensive. + */ CPrivKey GetPrivKey() const; - // Compute the public key from a private key. - // This is expensive. + /** + * Compute the public key from a private key. + * This is expensive. + */ CPubKey GetPubKey() const; - // Create a DER-serialized signature. + //! Create a DER-serialized signature. bool Sign(const uint256& hash, std::vector& vchSig, bool lowS = true) const; - // Create a compact signature (65 bytes), which allows reconstructing the used public key. - // The format is one header byte, followed by two times 32 bytes for the serialized r and s values. - // The header byte: 0x1B = first key with even y, 0x1C = first key with odd y, - // 0x1D = second key with even y, 0x1E = second key with odd y, - // add 0x04 for compressed keys. + /** + * Create a compact signature (65 bytes), which allows reconstructing the used public key. + * The format is one header byte, followed by two times 32 bytes for the serialized r and s values. + * The header byte: 0x1B = first key with even y, 0x1C = first key with odd y, + * 0x1D = second key with even y, 0x1E = second key with odd y, + * add 0x04 for compressed keys. + */ bool SignCompact(const uint256& hash, std::vector& vchSig) const; - // Derive BIP32 child key. + //! Derive BIP32 child key. bool Derive(CKey& keyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const; - // Load private key and check that public key matches. + //! Load private key and check that public key matches. bool Load(CPrivKey& privkey, CPubKey& vchPubKey, bool fSkipCheck); - // Check whether an element of a signature (r or s) is valid. + //! Check whether an element of a signature (r or s) is valid. static bool CheckSignatureElement(const unsigned char* vch, int len, bool half); }; From 2b173d3bcca8fdd89a92eb2058be341b3a61a1c8 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Sun, 26 Oct 2014 16:35:06 +0800 Subject: [PATCH 0939/1288] Update comments in keystore to be doxygen compatible --- src/key.cpp | 2 +- src/keystore.cpp | 4 ++-- src/keystore.h | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/key.cpp b/src/key.cpp index 48431f3dc5..c466e84f26 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -13,7 +13,7 @@ #include "ecwrapper.h" #endif -//! anonymous namespace with local implementation code (OpenSSL interaction) +//! anonymous namespace namespace { #ifdef USE_SECP256K1 diff --git a/src/keystore.cpp b/src/keystore.cpp index 039c690625..879f099720 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "keystore.h" diff --git a/src/keystore.h b/src/keystore.h index 4f8189c8f5..66f8771d4a 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_KEYSTORE_H @@ -24,22 +24,22 @@ protected: public: virtual ~CKeyStore() {} - // Add a key to the store. + //! Add a key to the store. virtual bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey) =0; virtual bool AddKey(const CKey &key); - // Check whether a key corresponding to a given address is present in the store. + //! Check whether a key corresponding to a given address is present in the store. virtual bool HaveKey(const CKeyID &address) const =0; virtual bool GetKey(const CKeyID &address, CKey& keyOut) const =0; virtual void GetKeys(std::set &setAddress) const =0; virtual bool GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const; - // Support for BIP 0013 : see https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki + //! Support for BIP 0013 : see https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki virtual bool AddCScript(const CScript& redeemScript) =0; virtual bool HaveCScript(const CScriptID &hash) const =0; virtual bool GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const =0; - // Support for Watch-only addresses + //! Support for Watch-only addresses virtual bool AddWatchOnly(const CScript &dest) =0; virtual bool RemoveWatchOnly(const CScript &dest) =0; virtual bool HaveWatchOnly(const CScript &dest) const =0; From 1bea2bbddce6abaf2640c4aab56ad08de53c4b90 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Tue, 28 Oct 2014 07:41:33 +0000 Subject: [PATCH 0940/1288] Rename ProcessBlock to ProcessNewBlock to indicate change of behaviour, and document it --- src/main.cpp | 14 +++++++------- src/main.h | 12 ++++++++++-- src/miner.cpp | 4 ++-- src/rpcmining.cpp | 2 +- src/test/miner_tests.cpp | 2 +- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index d2f999ee56..ce1211cca5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2524,7 +2524,7 @@ void CBlockIndex::BuildSkip() pskip = pprev->GetAncestor(GetSkipHeight(nHeight)); } -bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBlockPos *dbp) +bool ProcessNewBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBlockPos *dbp) { // Preliminary checks bool checked = CheckBlock(*pblock, state); @@ -2533,7 +2533,7 @@ bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBl LOCK(cs_main); MarkBlockAsReceived(pblock->GetHash()); if (!checked) { - return error("ProcessBlock() : CheckBlock FAILED"); + return error("%s : CheckBlock FAILED", __func__); } // Store to disk @@ -2543,11 +2543,11 @@ bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBl mapBlockSource[pindex->GetBlockHash()] = pfrom->GetId(); } if (!ret) - return error("ProcessBlock() : AcceptBlock FAILED"); + return error("%s : AcceptBlock FAILED", __func__); } if (!ActivateBestChain(state, pblock)) - return error("ProcessBlock() : ActivateBestChain failed"); + return error("%s : ActivateBestChain failed", __func__); return true; } @@ -3145,7 +3145,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp) // process in case the block isn't known yet if (mapBlockIndex.count(hash) == 0) { CValidationState state; - if (ProcessBlock(state, NULL, &block, dbp)) + if (ProcessNewBlock(state, NULL, &block, dbp)) nLoaded++; if (state.IsError()) break; @@ -3165,7 +3165,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp) LogPrintf("%s: Processing out of order child %s of %s\n", __func__, block.GetHash().ToString(), head.ToString()); CValidationState dummy; - if (ProcessBlock(dummy, NULL, &block, &it->second)) + if (ProcessNewBlock(dummy, NULL, &block, &it->second)) { nLoaded++; queue.push_back(block.GetHash()); @@ -3943,7 +3943,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, pfrom->AddInventoryKnown(inv); CValidationState state; - ProcessBlock(state, pfrom, &block); + ProcessNewBlock(state, pfrom, &block); int nDoS; if (state.IsInvalid(nDoS)) { pfrom->PushMessage("reject", strCommand, state.GetRejectCode(), diff --git a/src/main.h b/src/main.h index 69be26a4ee..9d08b3c09f 100644 --- a/src/main.h +++ b/src/main.h @@ -148,8 +148,16 @@ void RegisterNodeSignals(CNodeSignals& nodeSignals); /** Unregister a network node */ void UnregisterNodeSignals(CNodeSignals& nodeSignals); -/** Process an incoming block */ -bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBlockPos *dbp = NULL); +/** Process an incoming block. This only returns after the best known valid + block is made active. Note that it does not, however, guarantee that the + specific block passed to it has been checked for validity! + @param[out] state This may be set to an Error state if any error occurred processing it, including during validation/connection/etc of otherwise unrelated blocks during reorganisation; or it may be set to an Invalid state iff pblock is itself invalid (but this is not guaranteed even when the block is checked). If you want to *possibly* get feedback on whether pblock is valid, you must also install a CValidationInterface - this will have its BlockChecked method called whenever *any* block completes validation. + @param[in] pfrom The node which we are receiving the block from; it is added to mapBlockSource and may be penalised if the block is invalid. + @param[in] pblock The block we want to process. + @param[out] dbp If pblock is stored to disk (or already there), this will be set to its location. + @return True if state.IsValid() +*/ +bool ProcessNewBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBlockPos *dbp = NULL); /** Check whether enough disk space is available for an incoming block */ bool CheckDiskSpace(uint64_t nAdditionalBytes = 0); /** Open a block file (blk?????.dat) */ diff --git a/src/miner.cpp b/src/miner.cpp index c2762bf44e..3ad33a0062 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -425,8 +425,8 @@ bool ProcessBlockFound(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey) // Process this block the same as if we had received it from another node CValidationState state; - if (!ProcessBlock(state, NULL, pblock)) - return error("BitcoinMiner : ProcessBlock, block not accepted"); + if (!ProcessNewBlock(state, NULL, pblock)) + return error("BitcoinMiner : ProcessNewBlock, block not accepted"); return true; } diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 28076607b4..b063159721 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -578,7 +578,7 @@ Value submitblock(const Array& params, bool fHelp) CValidationState state; submitblock_StateCatcher sc(pblock.GetHash()); RegisterValidationInterface(&sc); - bool fAccepted = ProcessBlock(state, NULL, &pblock); + bool fAccepted = ProcessNewBlock(state, NULL, &pblock); UnregisterValidationInterface(&sc); if (fAccepted) { diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index bad5c13ac2..6e1fcf0a7d 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -79,7 +79,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) pblock->hashMerkleRoot = pblock->BuildMerkleTree(); pblock->nNonce = blockinfo[i].nonce; CValidationState state; - BOOST_CHECK(ProcessBlock(state, NULL, pblock)); + BOOST_CHECK(ProcessNewBlock(state, NULL, pblock)); BOOST_CHECK(state.IsValid()); pblock->hashPrevBlock = pblock->GetHash(); } From 023e63df78b847812040bf6958c97476606dfbfd Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 28 Oct 2014 19:52:21 +0100 Subject: [PATCH 0941/1288] qt: Move transaction notification to transaction table model Move transaction new/update notification to TransactionTableModel. This moves the concerns to where they're actually handled. No need to bounce this through wallet model. - Do wallet transaction preprocessing on signal handler side; avoids locking cs_main/cs_wallet on notification in GUI thread (except for new transactions) --- src/qt/transactiontablemodel.cpp | 208 +++++++++++++++++++++---------- src/qt/transactiontablemodel.h | 10 +- src/qt/walletmodel.cpp | 43 +------ src/qt/walletmodel.h | 6 +- src/qt/walletview.cpp | 4 +- 5 files changed, 160 insertions(+), 111 deletions(-) diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index e34d776818..79cb4a6296 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -91,87 +91,80 @@ public: Call with transaction that was added, removed or changed. */ - void updateWallet(const uint256 &hash, int status) + void updateWallet(const uint256 &hash, int status, bool showTransaction) { qDebug() << "TransactionTablePriv::updateWallet : " + QString::fromStdString(hash.ToString()) + " " + QString::number(status); + + // Find bounds of this transaction in model + QList::iterator lower = qLowerBound( + cachedWallet.begin(), cachedWallet.end(), hash, TxLessThan()); + QList::iterator upper = qUpperBound( + cachedWallet.begin(), cachedWallet.end(), hash, TxLessThan()); + int lowerIndex = (lower - cachedWallet.begin()); + int upperIndex = (upper - cachedWallet.begin()); + bool inModel = (lower != upper); + + if(status == CT_UPDATED) { - LOCK2(cs_main, wallet->cs_wallet); + if(showTransaction && !inModel) + status = CT_NEW; /* Not in model, but want to show, treat as new */ + if(!showTransaction && inModel) + status = CT_DELETED; /* In model, but want to hide, treat as deleted */ + } - // Find transaction in wallet - std::map::iterator mi = wallet->mapWallet.find(hash); - bool inWallet = mi != wallet->mapWallet.end(); + qDebug() << " inModel=" + QString::number(inModel) + + " Index=" + QString::number(lowerIndex) + "-" + QString::number(upperIndex) + + " showTransaction=" + QString::number(showTransaction) + " derivedStatus=" + QString::number(status); - // Find bounds of this transaction in model - QList::iterator lower = qLowerBound( - cachedWallet.begin(), cachedWallet.end(), hash, TxLessThan()); - QList::iterator upper = qUpperBound( - cachedWallet.begin(), cachedWallet.end(), hash, TxLessThan()); - int lowerIndex = (lower - cachedWallet.begin()); - int upperIndex = (upper - cachedWallet.begin()); - bool inModel = (lower != upper); - - // Determine whether to show transaction or not - bool showTransaction = (inWallet && TransactionRecord::showTransaction(mi->second)); - - if(status == CT_UPDATED) + switch(status) + { + case CT_NEW: + if(inModel) { - if(showTransaction && !inModel) - status = CT_NEW; /* Not in model, but want to show, treat as new */ - if(!showTransaction && inModel) - status = CT_DELETED; /* In model, but want to hide, treat as deleted */ + qWarning() << "TransactionTablePriv::updateWallet : Warning: Got CT_NEW, but transaction is already in model"; + break; } - - qDebug() << " inWallet=" + QString::number(inWallet) + " inModel=" + QString::number(inModel) + - " Index=" + QString::number(lowerIndex) + "-" + QString::number(upperIndex) + - " showTransaction=" + QString::number(showTransaction) + " derivedStatus=" + QString::number(status); - - switch(status) + if(showTransaction) { - case CT_NEW: - if(inModel) - { - qWarning() << "TransactionTablePriv::updateWallet : Warning: Got CT_NEW, but transaction is already in model"; - break; - } - if(!inWallet) + LOCK2(cs_main, wallet->cs_wallet); + // Find transaction in wallet + std::map::iterator mi = wallet->mapWallet.find(hash); + if(mi == wallet->mapWallet.end()) { qWarning() << "TransactionTablePriv::updateWallet : Warning: Got CT_NEW, but transaction is not in wallet"; break; } - if(showTransaction) + // Added -- insert at the right position + QList toInsert = + TransactionRecord::decomposeTransaction(wallet, mi->second); + if(!toInsert.isEmpty()) /* only if something to insert */ { - // Added -- insert at the right position - QList toInsert = - TransactionRecord::decomposeTransaction(wallet, mi->second); - if(!toInsert.isEmpty()) /* only if something to insert */ + parent->beginInsertRows(QModelIndex(), lowerIndex, lowerIndex+toInsert.size()-1); + int insert_idx = lowerIndex; + foreach(const TransactionRecord &rec, toInsert) { - parent->beginInsertRows(QModelIndex(), lowerIndex, lowerIndex+toInsert.size()-1); - int insert_idx = lowerIndex; - foreach(const TransactionRecord &rec, toInsert) - { - cachedWallet.insert(insert_idx, rec); - insert_idx += 1; - } - parent->endInsertRows(); + cachedWallet.insert(insert_idx, rec); + insert_idx += 1; } + parent->endInsertRows(); } - break; - case CT_DELETED: - if(!inModel) - { - qWarning() << "TransactionTablePriv::updateWallet : Warning: Got CT_DELETED, but transaction is not in model"; - break; - } - // Removed -- remove entire transaction from table - parent->beginRemoveRows(QModelIndex(), lowerIndex, upperIndex-1); - cachedWallet.erase(lower, upper); - parent->endRemoveRows(); - break; - case CT_UPDATED: - // Miscellaneous updates -- nothing to do, status update will take care of this, and is only computed for - // visible transactions. + } + break; + case CT_DELETED: + if(!inModel) + { + qWarning() << "TransactionTablePriv::updateWallet : Warning: Got CT_DELETED, but transaction is not in model"; break; } + // Removed -- remove entire transaction from table + parent->beginRemoveRows(QModelIndex(), lowerIndex, upperIndex-1); + cachedWallet.erase(lower, upper); + parent->endRemoveRows(); + break; + case CT_UPDATED: + // Miscellaneous updates -- nothing to do, status update will take care of this, and is only computed for + // visible transactions. + break; } } @@ -230,16 +223,20 @@ TransactionTableModel::TransactionTableModel(CWallet* wallet, WalletModel *paren QAbstractTableModel(parent), wallet(wallet), walletModel(parent), - priv(new TransactionTablePriv(wallet, this)) + priv(new TransactionTablePriv(wallet, this)), + fProcessingQueuedTransactions(false) { columns << QString() << QString() << tr("Date") << tr("Type") << tr("Address") << BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit()); priv->refreshWallet(); connect(walletModel->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); + + subscribeToCoreSignals(); } TransactionTableModel::~TransactionTableModel() { + unsubscribeFromCoreSignals(); delete priv; } @@ -250,12 +247,12 @@ void TransactionTableModel::updateAmountColumnTitle() emit headerDataChanged(Qt::Horizontal,Amount,Amount); } -void TransactionTableModel::updateTransaction(const QString &hash, int status) +void TransactionTableModel::updateTransaction(const QString &hash, int status, bool showTransaction) { uint256 updated; updated.SetHex(hash.toStdString()); - priv->updateWallet(updated, status); + priv->updateWallet(updated, status, showTransaction); } void TransactionTableModel::updateConfirmations() @@ -649,3 +646,82 @@ void TransactionTableModel::updateDisplayUnit() updateAmountColumnTitle(); emit dataChanged(index(0, Amount), index(priv->size()-1, Amount)); } + +// queue notifications to show a non freezing progress dialog e.g. for rescan +struct TransactionNotification +{ +public: + TransactionNotification() {} + TransactionNotification(uint256 hash, ChangeType status, bool showTransaction): + hash(hash), status(status), showTransaction(showTransaction) {} + + void invoke(QObject *ttm) + { + QString strHash = QString::fromStdString(hash.GetHex()); + qDebug() << "NotifyTransactionChanged : " + strHash + " status= " + QString::number(status); + QMetaObject::invokeMethod(ttm, "updateTransaction", Qt::QueuedConnection, + Q_ARG(QString, strHash), + Q_ARG(int, status), + Q_ARG(bool, showTransaction)); + } +private: + uint256 hash; + ChangeType status; + bool showTransaction; +}; + +static bool fQueueNotifications = false; +static std::vector< TransactionNotification > vQueueNotifications; + +static void NotifyTransactionChanged(TransactionTableModel *ttm, CWallet *wallet, const uint256 &hash, ChangeType status) +{ + // Find transaction in wallet + std::map::iterator mi = wallet->mapWallet.find(hash); + // Determine whether to show transaction or not (determine this here so that no relocking is needed in GUI thread) + bool inWallet = mi != wallet->mapWallet.end(); + bool showTransaction = (inWallet && TransactionRecord::showTransaction(mi->second)); + + TransactionNotification notification(hash, status, showTransaction); + + if (fQueueNotifications) + { + vQueueNotifications.push_back(notification); + return; + } + notification.invoke(ttm); +} + +static void ShowProgress(TransactionTableModel *ttm, const std::string &title, int nProgress) +{ + if (nProgress == 0) + fQueueNotifications = true; + + if (nProgress == 100) + { + fQueueNotifications = false; + if (vQueueNotifications.size() > 10) // prevent balloon spam, show maximum 10 balloons + QMetaObject::invokeMethod(ttm, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, true)); + for (unsigned int i = 0; i < vQueueNotifications.size(); ++i) + { + if (vQueueNotifications.size() - i <= 10) + QMetaObject::invokeMethod(ttm, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, false)); + + vQueueNotifications[i].invoke(ttm); + } + std::vector().swap(vQueueNotifications); // clear + } +} + +void TransactionTableModel::subscribeToCoreSignals() +{ + // Connect signals to wallet + wallet->NotifyTransactionChanged.connect(boost::bind(NotifyTransactionChanged, this, _1, _2, _3)); + wallet->ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2)); +} + +void TransactionTableModel::unsubscribeFromCoreSignals() +{ + // Disconnect signals from wallet + wallet->NotifyTransactionChanged.disconnect(boost::bind(NotifyTransactionChanged, this, _1, _2, _3)); + wallet->ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2)); +} diff --git a/src/qt/transactiontablemodel.h b/src/qt/transactiontablemodel.h index 413f3f9bf1..bb517a969c 100644 --- a/src/qt/transactiontablemodel.h +++ b/src/qt/transactiontablemodel.h @@ -72,12 +72,17 @@ public: QVariant data(const QModelIndex &index, int role) const; QVariant headerData(int section, Qt::Orientation orientation, int role) const; QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const; + bool processingQueuedTransactions() { return fProcessingQueuedTransactions; } private: CWallet* wallet; WalletModel *walletModel; QStringList columns; TransactionTablePriv *priv; + bool fProcessingQueuedTransactions; + + void subscribeToCoreSignals(); + void unsubscribeFromCoreSignals(); QString lookupAddress(const std::string &address, bool tooltip) const; QVariant addressColor(const TransactionRecord *wtx) const; @@ -92,11 +97,14 @@ private: QVariant txAddressDecoration(const TransactionRecord *wtx) const; public slots: - void updateTransaction(const QString &hash, int status); + /* New transaction, or transaction changed status */ + void updateTransaction(const QString &hash, int status, bool showTransaction); void updateConfirmations(); void updateDisplayUnit(); /** Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table headers to react. */ void updateAmountColumnTitle(); + /* Needed to update fProcessingQueuedTransactions through a QueuedConnection */ + void setProcessingQueuedTransactions(bool value) { fProcessingQueuedTransactions = value; } friend class TransactionTablePriv; }; diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index b4733d369e..f7b1552f3e 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -34,7 +34,6 @@ WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *p cachedEncryptionStatus(Unencrypted), cachedNumBlocks(0) { - fProcessingQueuedTransactions = false; fHaveWatchOnly = wallet->HaveWatchOnly(); fForceCheckBalanceChanged = false; @@ -164,11 +163,8 @@ void WalletModel::checkBalanceChanged() } } -void WalletModel::updateTransaction(const QString &hash, int status) +void WalletModel::updateTransaction() { - if(transactionTableModel) - transactionTableModel->updateTransaction(hash, status); - // Balance and number of transactions might have changed fForceCheckBalanceChanged = true; } @@ -455,45 +451,16 @@ static void NotifyAddressBookChanged(WalletModel *walletmodel, CWallet *wallet, Q_ARG(int, status)); } -// queue notifications to show a non freezing progress dialog e.g. for rescan -static bool fQueueNotifications = false; -static std::vector > vQueueNotifications; static void NotifyTransactionChanged(WalletModel *walletmodel, CWallet *wallet, const uint256 &hash, ChangeType status) { - if (fQueueNotifications) - { - vQueueNotifications.push_back(make_pair(hash, status)); - return; - } - - QString strHash = QString::fromStdString(hash.GetHex()); - - qDebug() << "NotifyTransactionChanged : " + strHash + " status= " + QString::number(status); - QMetaObject::invokeMethod(walletmodel, "updateTransaction", Qt::QueuedConnection, - Q_ARG(QString, strHash), - Q_ARG(int, status)); + Q_UNUSED(wallet); + Q_UNUSED(hash); + Q_UNUSED(status); + QMetaObject::invokeMethod(walletmodel, "updateTransaction", Qt::QueuedConnection); } static void ShowProgress(WalletModel *walletmodel, const std::string &title, int nProgress) { - if (nProgress == 0) - fQueueNotifications = true; - - if (nProgress == 100) - { - fQueueNotifications = false; - if (vQueueNotifications.size() > 10) // prevent balloon spam, show maximum 10 balloons - QMetaObject::invokeMethod(walletmodel, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, true)); - for (unsigned int i = 0; i < vQueueNotifications.size(); ++i) - { - if (vQueueNotifications.size() - i <= 10) - QMetaObject::invokeMethod(walletmodel, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, false)); - - NotifyTransactionChanged(walletmodel, NULL, vQueueNotifications[i].first, vQueueNotifications[i].second); - } - std::vector >().swap(vQueueNotifications); // clear - } - // emits signal "showProgress" QMetaObject::invokeMethod(walletmodel, "showProgress", Qt::QueuedConnection, Q_ARG(QString, QString::fromStdString(title)), diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index b1d0f28f12..fe91e9d9fa 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -133,7 +133,6 @@ public: CAmount getWatchUnconfirmedBalance() const; CAmount getWatchImmatureBalance() const; EncryptionStatus getEncryptionStatus() const; - bool processingQueuedTransactions() { return fProcessingQueuedTransactions; } // Check address for validity bool validateAddress(const QString &address); @@ -197,7 +196,6 @@ public: private: CWallet *wallet; - bool fProcessingQueuedTransactions; bool fHaveWatchOnly; bool fForceCheckBalanceChanged; @@ -254,15 +252,13 @@ public slots: /* Wallet status might have changed */ void updateStatus(); /* New transaction, or transaction changed status */ - void updateTransaction(const QString &hash, int status); + void updateTransaction(); /* New, updated or removed address book entry */ void updateAddressBook(const QString &address, const QString &label, bool isMine, const QString &purpose, int status); /* Watch-only added */ void updateWatchOnlyFlag(bool fHaveWatchonly); /* Current, immature or unconfirmed balance might have changed - emit 'balanceChanged' if so */ void pollBalanceChanged(); - /* Needed to update fProcessingQueuedTransactions through a QueuedConnection */ - void setProcessingQueuedTransactions(bool value) { fProcessingQueuedTransactions = value; } }; #endif // WALLETMODEL_H diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index eff50593bd..3b8fdd7e5f 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -137,10 +137,12 @@ void WalletView::setWalletModel(WalletModel *walletModel) void WalletView::processNewTransaction(const QModelIndex& parent, int start, int /*end*/) { // Prevent balloon-spam when initial block download is in progress - if (!walletModel || walletModel->processingQueuedTransactions() || !clientModel || clientModel->inInitialBlockDownload()) + if (!walletModel || !clientModel || clientModel->inInitialBlockDownload()) return; TransactionTableModel *ttm = walletModel->getTransactionTableModel(); + if (!ttm || ttm->processingQueuedTransactions()) + return; QString date = ttm->index(start, TransactionTableModel::Date, parent).data().toString(); qint64 amount = ttm->index(start, TransactionTableModel::Amount, parent).data(Qt::EditRole).toULongLong(); From a2d0fc658a7b21d2d41ef2a6c657d24114b6c49e Mon Sep 17 00:00:00 2001 From: Ruben Dario Ponticelli Date: Tue, 28 Oct 2014 14:48:50 -0300 Subject: [PATCH 0942/1288] Fix IsInitialBlockDownload which was broken by headers first. --- src/main.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 008a059103..bf487df39f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1177,15 +1177,8 @@ bool IsInitialBlockDownload() LOCK(cs_main); if (fImporting || fReindex || chainActive.Height() < Checkpoints::GetTotalBlocksEstimate()) return true; - static int64_t nLastUpdate; - static CBlockIndex* pindexLastBest; - if (chainActive.Tip() != pindexLastBest) - { - pindexLastBest = chainActive.Tip(); - nLastUpdate = GetTime(); - } - return (GetTime() - nLastUpdate < 10 && - chainActive.Tip()->GetBlockTime() < GetTime() - 24 * 60 * 60); + return (chainActive.Height() < pindexBestHeader->nHeight - 24 * 6 || + pindexBestHeader->GetBlockTime() < GetTime() - 24 * 60 * 60); } bool fLargeWorkForkFound = false; From 71697f97d3f9512f0af934070690c14f1c0d95ea Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 28 Oct 2014 21:33:23 -0400 Subject: [PATCH 0943/1288] Separate protocol versioning from clientversion --- .gitattributes | 2 +- Makefile.am | 2 +- src/Makefile.am | 6 +++--- src/alert.cpp | 1 + src/bitcoin-cli.cpp | 2 +- src/bitcoin-tx.cpp | 1 + src/bitcoind.cpp | 1 + src/{version.cpp => clientversion.cpp} | 2 +- src/clientversion.h | 27 ++++++++++++++++++++++++++ src/db.h | 1 + src/leveldbwrapper.h | 1 + src/net.cpp | 1 + src/qt/clientmodel.cpp | 1 + src/qt/recentrequeststablemodel.cpp | 1 + src/qt/utilitydialog.cpp | 2 +- src/rpcmisc.cpp | 1 + src/rpcnet.cpp | 1 + src/rpcprotocol.cpp | 1 + src/test/alert_tests.cpp | 2 +- src/test/bloom_tests.cpp | 1 + src/test/checkblock_tests.cpp | 1 + src/test/transaction_tests.cpp | 1 + src/test/util_tests.cpp | 2 +- src/txmempool.cpp | 1 + src/version.h | 22 --------------------- 25 files changed, 52 insertions(+), 32 deletions(-) rename src/{version.cpp => clientversion.cpp} (99%) diff --git a/.gitattributes b/.gitattributes index 26d7549356..c9cf4a7d9c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -src/version.cpp export-subst +src/clientversion.cpp export-subst diff --git a/Makefile.am b/Makefile.am index fe7244edf8..7fe3811476 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,7 +36,7 @@ COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \ dist-hook: -$(MAKE) -C $(top_distdir)/src/leveldb clean -$(MAKE) -C $(top_distdir)/src/secp256k1 distclean - -$(GIT) archive --format=tar HEAD -- src/version.cpp | $(AMTAR) -C $(top_distdir) -xf - + -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf - distcheck-hook: $(MKDIR_P) $(top_distdir)/_build/src/leveldb diff --git a/src/Makefile.am b/src/Makefile.am index 91cc1b96e7..8253c4ab14 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -146,7 +146,7 @@ obj/build.h: FORCE @$(MKDIR_P) $(builddir)/obj @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \ $(abs_top_srcdir) -libbitcoin_util_a-version.$(OBJEXT): obj/build.h +libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h # server: shared between bitcoind and bitcoin-qt libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS) @@ -241,6 +241,7 @@ libbitcoin_util_a_SOURCES = \ compat/glibc_sanity.cpp \ compat/glibcxx_sanity.cpp \ chainparamsbase.cpp \ + clientversion.cpp \ random.cpp \ rpcprotocol.cpp \ sync.cpp \ @@ -249,7 +250,6 @@ libbitcoin_util_a_SOURCES = \ utilstrencodings.cpp \ utilmoneystr.cpp \ utiltime.cpp \ - version.cpp \ $(BITCOIN_CORE_H) if GLIBC_BACK_COMPAT @@ -354,7 +354,7 @@ clean-local: .rc.o: @test -f $(WINDRES) - $(AM_V_GEN) $(WINDRES) -i $< -o $@ + $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@ .mm.o: $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ diff --git a/src/alert.cpp b/src/alert.cpp index d495849206..f16898dc38 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -6,6 +6,7 @@ #include "alert.h" #include "chainparams.h" +#include "clientversion.h" #include "key.h" #include "net.h" #include "timedata.h" diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index aa5e285b10..38fbc29faf 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -4,12 +4,12 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "chainparamsbase.h" +#include "clientversion.h" #include "init.h" #include "rpcclient.h" #include "rpcprotocol.h" #include "util.h" #include "utilstrencodings.h" -#include "version.h" #include diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 6f3409edf3..c0d21ed36f 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -3,6 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "base58.h" +#include "clientversion.h" #include "core/transaction.h" #include "core_io.h" #include "keystore.h" diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 0737b5a83d..a79e581a80 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -3,6 +3,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include "clientversion.h" #include "rpcserver.h" #include "init.h" #include "main.h" diff --git a/src/version.cpp b/src/clientversion.cpp similarity index 99% rename from src/version.cpp rename to src/clientversion.cpp index d12b681e5c..4987c3ed38 100644 --- a/src/version.cpp +++ b/src/clientversion.cpp @@ -2,7 +2,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "version.h" +#include "clientversion.h" #include "tinyformat.h" diff --git a/src/clientversion.h b/src/clientversion.h index cd7ceb78f0..acaf54c6af 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -35,4 +35,31 @@ // Copyright string used in Windows .rc files #define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers" +/* + bitcoind-res.rc includes this file, but it cannot cope with real c++ code. + WINDRES_PREPROC is defined to indicate that its pre-processor is running. + Anything other than a define should be guarded below. +*/ + +#if !defined(WINDRES_PREPROC) + +#include +#include + +static const int CLIENT_VERSION = + 1000000 * CLIENT_VERSION_MAJOR + + 10000 * CLIENT_VERSION_MINOR + + 100 * CLIENT_VERSION_REVISION + + 1 * CLIENT_VERSION_BUILD; + +extern const std::string CLIENT_NAME; +extern const std::string CLIENT_BUILD; +extern const std::string CLIENT_DATE; + + +std::string FormatFullVersion(); +std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector& comments); + +#endif // WINDRES_PREPROC + #endif // CLIENTVERSION_H diff --git a/src/db.h b/src/db.h index 0cbdd8b91b..85ffbae1cb 100644 --- a/src/db.h +++ b/src/db.h @@ -6,6 +6,7 @@ #ifndef BITCOIN_DB_H #define BITCOIN_DB_H +#include "clientversion.h" #include "serialize.h" #include "streams.h" #include "sync.h" diff --git a/src/leveldbwrapper.h b/src/leveldbwrapper.h index d997d56e00..10b7a2427c 100644 --- a/src/leveldbwrapper.h +++ b/src/leveldbwrapper.h @@ -5,6 +5,7 @@ #ifndef BITCOIN_LEVELDBWRAPPER_H #define BITCOIN_LEVELDBWRAPPER_H +#include "clientversion.h" #include "serialize.h" #include "streams.h" #include "util.h" diff --git a/src/net.cpp b/src/net.cpp index 6cccdca952..5ceb82cf8b 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -11,6 +11,7 @@ #include "addrman.h" #include "chainparams.h" +#include "clientversion.h" #include "core/transaction.h" #include "ui_interface.h" diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 738fb48ef8..aedda49071 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -10,6 +10,7 @@ #include "alert.h" #include "chainparams.h" #include "checkpoints.h" +#include "clientversion.h" #include "main.h" #include "net.h" #include "ui_interface.h" diff --git a/src/qt/recentrequeststablemodel.cpp b/src/qt/recentrequeststablemodel.cpp index 5deac8007c..5533adab8b 100644 --- a/src/qt/recentrequeststablemodel.cpp +++ b/src/qt/recentrequeststablemodel.cpp @@ -5,6 +5,7 @@ #include "recentrequeststablemodel.h" #include "bitcoinunits.h" +#include "clientversion.h" #include "guiutil.h" #include "optionsmodel.h" #include "streams.h" diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index 84f88dff5a..58bf040624 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -10,8 +10,8 @@ #include "clientmodel.h" #include "guiutil.h" +#include "clientversion.h" #include "init.h" -#include "version.h" #include diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 92ed1c3e2b..08e956c961 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -4,6 +4,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "base58.h" +#include "clientversion.h" #include "init.h" #include "main.h" #include "net.h" diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 12dcd5b540..46b5f3d7ad 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -4,6 +4,7 @@ #include "rpcserver.h" +#include "clientversion.h" #include "main.h" #include "net.h" #include "netbase.h" diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp index c99d113bc3..c2ce73106f 100644 --- a/src/rpcprotocol.cpp +++ b/src/rpcprotocol.cpp @@ -5,6 +5,7 @@ #include "rpcprotocol.h" +#include "clientversion.h" #include "tinyformat.h" #include "util.h" #include "utilstrencodings.h" diff --git a/src/test/alert_tests.cpp b/src/test/alert_tests.cpp index 28610f0d2e..9cf7a98f46 100644 --- a/src/test/alert_tests.cpp +++ b/src/test/alert_tests.cpp @@ -7,13 +7,13 @@ // #include "alert.h" +#include "clientversion.h" #include "data/alertTests.raw.h" #include "serialize.h" #include "streams.h" #include "util.h" #include "utilstrencodings.h" -#include "version.h" #include diff --git a/src/test/bloom_tests.cpp b/src/test/bloom_tests.cpp index 99b21a23a0..783e284af5 100644 --- a/src/test/bloom_tests.cpp +++ b/src/test/bloom_tests.cpp @@ -5,6 +5,7 @@ #include "bloom.h" #include "base58.h" +#include "clientversion.h" #include "key.h" #include "main.h" #include "serialize.h" diff --git a/src/test/checkblock_tests.cpp b/src/test/checkblock_tests.cpp index 9151fdc0c8..fc36b43e16 100644 --- a/src/test/checkblock_tests.cpp +++ b/src/test/checkblock_tests.cpp @@ -8,6 +8,7 @@ +#include "clientversion.h" #include "main.h" #include "utiltime.h" diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index c46c31e99f..d4c9b1a0ea 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -5,6 +5,7 @@ #include "data/tx_invalid.json.h" #include "data/tx_valid.json.h" +#include "clientversion.h" #include "key.h" #include "keystore.h" #include "main.h" diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 761210feac..67d50fccf4 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -4,12 +4,12 @@ #include "util.h" +#include "clientversion.h" #include "core/transaction.h" #include "random.h" #include "sync.h" #include "utilstrencodings.h" #include "utilmoneystr.h" -#include "version.h" #include #include diff --git a/src/txmempool.cpp b/src/txmempool.cpp index c042dd8467..d3d9cb8a01 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -5,6 +5,7 @@ #include "txmempool.h" +#include "clientversion.h" #include "streams.h" #include "util.h" #include "utilmoneystr.h" diff --git a/src/version.h b/src/version.h index a1e440de24..6ee08c205b 100644 --- a/src/version.h +++ b/src/version.h @@ -5,25 +5,6 @@ #ifndef BITCOIN_VERSION_H #define BITCOIN_VERSION_H -#include "clientversion.h" - -#include -#include - -// -// client versioning -// - -static const int CLIENT_VERSION = - 1000000 * CLIENT_VERSION_MAJOR - + 10000 * CLIENT_VERSION_MINOR - + 100 * CLIENT_VERSION_REVISION - + 1 * CLIENT_VERSION_BUILD; - -extern const std::string CLIENT_NAME; -extern const std::string CLIENT_BUILD; -extern const std::string CLIENT_DATE; - // // network protocol versioning // @@ -53,7 +34,4 @@ static const int BIP0031_VERSION = 60000; // "mempool" command, enhanced "getdata" behavior starts with this version static const int MEMPOOL_GD_VERSION = 60002; -std::string FormatFullVersion(); -std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector& comments); - #endif // BITCOIN_VERSION_H From 2d06c0febfbe073c166717e4108deceefba38830 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 28 Oct 2014 23:54:06 -0700 Subject: [PATCH 0944/1288] Add missing reserved address spaces. --- src/netbase.cpp | 19 ++++++++++++++++++- src/netbase.h | 3 +++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/netbase.cpp b/src/netbase.cpp index b3d1001547..ea05b8766f 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -667,11 +667,28 @@ bool CNetAddr::IsRFC1918() const (GetByte(3) == 172 && (GetByte(2) >= 16 && GetByte(2) <= 31))); } +bool CNetAddr::IsRFC2544() const +{ + return IsIPv4() && GetByte(3) == 198 && (GetByte(2) == 18 || GetByte(2) == 19); +} + bool CNetAddr::IsRFC3927() const { return IsIPv4() && (GetByte(3) == 169 && GetByte(2) == 254); } +bool CNetAddr::IsRFC6598() const +{ + return IsIPv4() && GetByte(3) == 100 && GetByte(2) >= 64 && GetByte(2) <= 127; +} + +bool CNetAddr::IsRFC5737() const +{ + return IsIPv4() && ((GetByte(3) == 192 && GetByte(2) == 0 && GetByte(1) == 2) || + (GetByte(3) == 198 && GetByte(2) == 51 && GetByte(1) == 100) || + (GetByte(3) == 203 && GetByte(2) == 0 && GetByte(1) == 113)); +} + bool CNetAddr::IsRFC3849() const { return GetByte(15) == 0x20 && GetByte(14) == 0x01 && GetByte(13) == 0x0D && GetByte(12) == 0xB8; @@ -778,7 +795,7 @@ bool CNetAddr::IsValid() const bool CNetAddr::IsRoutable() const { - return IsValid() && !(IsRFC1918() || IsRFC3927() || IsRFC4862() || (IsRFC4193() && !IsTor()) || IsRFC4843() || IsLocal()); + return IsValid() && !(IsRFC1918() || IsRFC2544() || IsRFC3927() || IsRFC4862() || IsRFC6598() || IsRFC5737() || (IsRFC4193() && !IsTor()) || IsRFC4843() || IsLocal()); } enum Network CNetAddr::GetNetwork() const diff --git a/src/netbase.h b/src/netbase.h index 1455cd8c33..9d8697dcc6 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -61,6 +61,9 @@ class CNetAddr bool IsIPv4() const; // IPv4 mapped address (::FFFF:0:0/96, 0.0.0.0/0) bool IsIPv6() const; // IPv6 address (not mapped IPv4, not Tor) bool IsRFC1918() const; // IPv4 private networks (10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12) + bool IsRFC2544() const; // IPv4 inter-network communcations (192.18.0.0/15) + bool IsRFC6598() const; // IPv4 ISP-level NAT (100.64.0.0/10) + bool IsRFC5737() const; // IPv4 documentation addresses (192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24) bool IsRFC3849() const; // IPv6 documentation address (2001:0DB8::/32) bool IsRFC3927() const; // IPv4 autoconfig (169.254.0.0/16) bool IsRFC3964() const; // IPv6 6to4 tunnelling (2002::/16) From 20a5f610d344dfc1dc0c6e5e9e4b0211370aa563 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 29 Oct 2014 16:03:09 +0100 Subject: [PATCH 0945/1288] Don't relay alerts to peers before version negotiation Fixes #1436 --- src/alert.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/alert.cpp b/src/alert.cpp index d495849206..b6d3804792 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -127,6 +127,9 @@ bool CAlert::RelayTo(CNode* pnode) const { if (!IsInEffect()) return false; + // don't relay to nodes which haven't sent their version message + if (pnode->nVersion == 0) + return false; // returns true if wasn't already contained in the set if (pnode->setKnown.insert(GetHash()).second) { From b4ee0bddad94cb580c1b56c592021bb102ed7b1a Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 28 Oct 2014 09:33:55 -0700 Subject: [PATCH 0946/1288] Introduce preferred download peers --- src/main.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 008a059103..36af1c2827 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -128,6 +128,8 @@ namespace { }; map::iterator> > mapBlocksInFlight; + // Number of preferrable block download peers. + int nPreferredDownload = 0; } // anon namespace ////////////////////////////////////////////////////////////////////////////// @@ -225,6 +227,8 @@ struct CNodeState { int64_t nStallingSince; list vBlocksInFlight; int nBlocksInFlight; + // Whether we consider this a preferred download peer. + bool fPreferredDownload; CNodeState() { nMisbehavior = 0; @@ -235,6 +239,7 @@ struct CNodeState { fSyncStarted = false; nStallingSince = 0; nBlocksInFlight = 0; + fPreferredDownload = false; } }; @@ -255,6 +260,16 @@ int GetHeight() return chainActive.Height(); } +void UpdatePreferredDownload(CNode* node, CNodeState* state) +{ + nPreferredDownload -= state->fPreferredDownload; + + // Whether this node should be marked as a preferred download node. + state->fPreferredDownload = (!node->fInbound || node->fWhitelisted) && !node->fOneShot && !node->fClient; + + nPreferredDownload += state->fPreferredDownload; +} + void InitializeNode(NodeId nodeid, const CNode *pnode) { LOCK(cs_main); CNodeState &state = mapNodeState.insert(std::make_pair(nodeid, CNodeState())).first->second; @@ -271,6 +286,7 @@ void FinalizeNode(NodeId nodeid) { BOOST_FOREACH(const QueuedBlock& entry, state->vBlocksInFlight) mapBlocksInFlight.erase(entry.hash); EraseOrphansFor(nodeid); + nPreferredDownload -= state->fPreferredDownload; mapNodeState.erase(nodeid); } @@ -3471,6 +3487,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, pfrom->fClient = !(pfrom->nServices & NODE_NETWORK); + // Potentially mark this peer as a preferred download peer. + UpdatePreferredDownload(pfrom, State(pfrom->GetId())); // Change version pfrom->PushMessage("verack"); @@ -4415,7 +4433,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) // Start block sync if (pindexBestHeader == NULL) pindexBestHeader = chainActive.Tip(); - bool fFetch = !pto->fInbound || (pindexBestHeader && (state.pindexLastCommonBlock ? state.pindexLastCommonBlock->nHeight : 0) + 144 > pindexBestHeader->nHeight); + bool fFetch = state.fPreferredDownload || (nPreferredDownload == 0 && !pto->fClient && !pto->fOneShot); // Download if this is a nice peer, or we have no nice peers and this one might do. if (!state.fSyncStarted && !pto->fClient && fFetch && !fImporting && !fReindex) { // Only actively request headers from a single peer, unless we're close to today. if (nSyncStarted == 0 || pindexBestHeader->GetBlockTime() > GetAdjustedTime() - 24 * 60 * 60) { From 22c4272bf4ea04689fc0ea08e637caa46ba12c98 Mon Sep 17 00:00:00 2001 From: jtimon Date: Wed, 22 Oct 2014 01:31:01 +0200 Subject: [PATCH 0947/1288] MOVEONLY: Move void UpdateTime() from pow.o to miner.o (plus fix include main.h -> chain.h) --- src/miner.cpp | 10 ++++++++++ src/miner.h | 2 ++ src/pow.cpp | 12 +----------- src/pow.h | 2 -- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 0235de3ab3..d3bbc6235e 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -12,6 +12,7 @@ #include "main.h" #include "net.h" #include "pow.h" +#include "timedata.h" #include "util.h" #include "utilmoneystr.h" #ifdef ENABLE_WALLET @@ -78,6 +79,15 @@ public: } }; +void UpdateTime(CBlockHeader* pblock, const CBlockIndex* pindexPrev) +{ + pblock->nTime = std::max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime()); + + // Updating time can change work required on testnet: + if (Params().AllowMinDifficultyBlocks()) + pblock->nBits = GetNextWorkRequired(pindexPrev, pblock); +} + CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) { // Create new block diff --git a/src/miner.h b/src/miner.h index 1fa499dc5b..aede0e6d4b 100644 --- a/src/miner.h +++ b/src/miner.h @@ -9,6 +9,7 @@ #include class CBlock; +class CBlockHeader; class CBlockIndex; class CReserveKey; class CScript; @@ -25,6 +26,7 @@ CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey); void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce); /** Check mined block */ bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey); +void UpdateTime(CBlockHeader* block, const CBlockIndex* pindexPrev); extern double dHashesPerSec; extern int64_t nHPSTimerStart; diff --git a/src/pow.cpp b/src/pow.cpp index af7fc488ef..483122a76a 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -5,10 +5,9 @@ #include "pow.h" +#include "chain.h" #include "chainparams.h" #include "core/block.h" -#include "main.h" -#include "timedata.h" #include "uint256.h" #include "util.h" @@ -98,15 +97,6 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits) return true; } -void UpdateTime(CBlockHeader* pblock, const CBlockIndex* pindexPrev) -{ - pblock->nTime = std::max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime()); - - // Updating time can change work required on testnet: - if (Params().AllowMinDifficultyBlocks()) - pblock->nBits = GetNextWorkRequired(pindexPrev, pblock); -} - uint256 GetProofIncrement(unsigned int nBits) { uint256 bnTarget; diff --git a/src/pow.h b/src/pow.h index 233d1f3795..9ee6ce44d6 100644 --- a/src/pow.h +++ b/src/pow.h @@ -17,8 +17,6 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead /** Check whether a block hash satisfies the proof-of-work requirement specified by nBits */ bool CheckProofOfWork(uint256 hash, unsigned int nBits); -void UpdateTime(CBlockHeader* block, const CBlockIndex* pindexPrev); - uint256 GetProofIncrement(unsigned int nBits); #endif // BITCOIN_POW_H From 092b58d13d658baebbf03a6d5209f368f19e50a8 Mon Sep 17 00:00:00 2001 From: jtimon Date: Wed, 29 Oct 2014 17:00:02 +0100 Subject: [PATCH 0948/1288] CBlockIndex::GetBlockWork() + GetProofIncrement(nBits) -> GetBlockProof(CBlockIndex) --- src/chain.h | 5 ----- src/main.cpp | 8 ++++---- src/pow.cpp | 4 ++-- src/pow.h | 3 +-- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/chain.h b/src/chain.h index 2a55771622..0f513019d0 100644 --- a/src/chain.h +++ b/src/chain.h @@ -217,11 +217,6 @@ public: return (int64_t)nTime; } - uint256 GetBlockWork() const - { - return GetProofIncrement(nBits); - } - enum { nMedianTimeSpan=11 }; int64_t GetMedianTimePast() const diff --git a/src/main.cpp b/src/main.cpp index 008a059103..0ac23ab876 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1205,7 +1205,7 @@ void CheckForkWarningConditions() if (pindexBestForkTip && chainActive.Height() - pindexBestForkTip->nHeight >= 72) pindexBestForkTip = NULL; - if (pindexBestForkTip || (pindexBestInvalid && pindexBestInvalid->nChainWork > chainActive.Tip()->nChainWork + (chainActive.Tip()->GetBlockWork() * 6))) + if (pindexBestForkTip || (pindexBestInvalid && pindexBestInvalid->nChainWork > chainActive.Tip()->nChainWork + (GetBlockProof(*chainActive.Tip()) * 6))) { if (!fLargeWorkForkFound) { @@ -1256,7 +1256,7 @@ void CheckForkWarningConditionsOnNewFork(CBlockIndex* pindexNewForkTip) // We define it this way because it allows us to only store the highest fork tip (+ base) which meets // the 7-block condition and from this always have the most-likely-to-cause-warning fork if (pfork && (!pindexBestForkTip || (pindexBestForkTip && pindexNewForkTip->nHeight > pindexBestForkTip->nHeight)) && - pindexNewForkTip->nChainWork - pfork->nChainWork > (pfork->GetBlockWork() * 7) && + pindexNewForkTip->nChainWork - pfork->nChainWork > (GetBlockProof(*pfork) * 7) && chainActive.Height() - pindexNewForkTip->nHeight < 72) { pindexBestForkTip = pindexNewForkTip; @@ -2095,7 +2095,7 @@ CBlockIndex* AddToBlockIndex(const CBlockHeader& block) pindexNew->nHeight = pindexNew->pprev->nHeight + 1; pindexNew->BuildSkip(); } - pindexNew->nChainWork = (pindexNew->pprev ? pindexNew->pprev->nChainWork : 0) + pindexNew->GetBlockWork(); + pindexNew->nChainWork = (pindexNew->pprev ? pindexNew->pprev->nChainWork : 0) + GetBlockProof(*pindexNew); pindexNew->RaiseValidity(BLOCK_VALID_TREE); if (pindexBestHeader == NULL || pindexBestHeader->nChainWork < pindexNew->nChainWork) pindexBestHeader = pindexNew; @@ -2788,7 +2788,7 @@ bool static LoadBlockIndexDB() BOOST_FOREACH(const PAIRTYPE(int, CBlockIndex*)& item, vSortedByHeight) { CBlockIndex* pindex = item.second; - pindex->nChainWork = (pindex->pprev ? pindex->pprev->nChainWork : 0) + pindex->GetBlockWork(); + pindex->nChainWork = (pindex->pprev ? pindex->pprev->nChainWork : 0) + GetBlockProof(*pindex); if (pindex->nStatus & BLOCK_HAVE_DATA) { if (pindex->pprev) { if (pindex->pprev->nChainTx) { diff --git a/src/pow.cpp b/src/pow.cpp index 483122a76a..e07e7ff770 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -97,12 +97,12 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits) return true; } -uint256 GetProofIncrement(unsigned int nBits) +uint256 GetBlockProof(const CBlockIndex& block) { uint256 bnTarget; bool fNegative; bool fOverflow; - bnTarget.SetCompact(nBits, &fNegative, &fOverflow); + bnTarget.SetCompact(block.nBits, &fNegative, &fOverflow); if (fNegative || fOverflow || bnTarget == 0) return 0; // We need to compute 2**256 / (bnTarget+1), but we can't represent 2**256 diff --git a/src/pow.h b/src/pow.h index 9ee6ce44d6..cf28656bd8 100644 --- a/src/pow.h +++ b/src/pow.h @@ -16,7 +16,6 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead /** Check whether a block hash satisfies the proof-of-work requirement specified by nBits */ bool CheckProofOfWork(uint256 hash, unsigned int nBits); - -uint256 GetProofIncrement(unsigned int nBits); +uint256 GetBlockProof(const CBlockIndex& block); #endif // BITCOIN_POW_H From 4ead850fe54ae0bdfb4b3724cbefb3425a16b74a Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 29 Oct 2014 17:01:01 -0700 Subject: [PATCH 0949/1288] Fix for crash during block download --- src/main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 008a059103..0506a7f598 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1739,9 +1739,9 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C } // Update the on-disk chain state. -bool static WriteChainState(CValidationState &state) { +bool static WriteChainState(CValidationState &state, bool forceWrite=false) { static int64_t nLastWrite = 0; - if (pcoinsTip->GetCacheSize() > nCoinCacheSize || (!IsInitialBlockDownload() && GetTimeMicros() > nLastWrite + 600*1000000)) { + if (forceWrite || pcoinsTip->GetCacheSize() > nCoinCacheSize || (!IsInitialBlockDownload() && GetTimeMicros() > nLastWrite + 600*1000000)) { // Typical CCoins structures on disk are around 100 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 @@ -2999,6 +2999,8 @@ bool InitBlockIndex() { return error("LoadBlockIndex() : genesis block not accepted"); if (!ActivateBestChain(state, &block)) return error("LoadBlockIndex() : genesis block cannot be activated"); + // Force a chainstate write so that when we VerifyDB in a moment, it doesnt check stale data + return WriteChainState(state, true); } catch(std::runtime_error &e) { return error("LoadBlockIndex() : failed to initialize block database: %s", e.what()); } From 8375e2215f24ff4b92c634d2dc56898e9cda437b Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 29 Oct 2014 17:01:18 -0700 Subject: [PATCH 0950/1288] Fix -loadblock after shutdown during IBD --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 0506a7f598..238b0400ea 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3136,7 +3136,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp) } // process in case the block isn't known yet - if (mapBlockIndex.count(hash) == 0) { + if (mapBlockIndex.count(hash) == 0 || (mapBlockIndex[hash]->nStatus & BLOCK_HAVE_DATA) == 0) { CValidationState state; if (ProcessBlock(state, NULL, &block, dbp)) nLoaded++; From 50b43fda08afeeaf22e0ad991a9885ee078a7c78 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 29 Oct 2014 17:02:48 -0700 Subject: [PATCH 0951/1288] Be a bit more verbose during -loadblock if we already have blocks --- src/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 238b0400ea..5302f0bcb4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3142,6 +3142,8 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp) nLoaded++; if (state.IsError()) break; + } else if (hash != Params().HashGenesisBlock() && mapBlockIndex[hash]->nHeight % 1000 == 0) { + LogPrintf("Block Import: already had block %s at height %d\n", hash.ToString(), mapBlockIndex[hash]->nHeight); } // Recursively process earlier encountered successors of this block From e69a5873e705b132b787415b375c206b1f615bac Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Mon, 10 Sep 2012 02:02:35 +0000 Subject: [PATCH 0952/1288] RPC: submitblock: Support for returning specific rejection reasons --- src/rpcmining.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index b063159721..6b390b1b95 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -592,7 +592,12 @@ Value submitblock(const Array& params, bool fHelp) throw JSONRPCError(RPC_VERIFY_ERROR, strRejectReason); } if (state.IsInvalid()) - return "rejected"; // TODO: report validation state + { + std::string strRejectReason = state.GetRejectReason(); + if (strRejectReason.empty()) + return "rejected"; + return strRejectReason; + } return Value::null; } From eadcd0c802fecce1486cc5be4740e078292facff Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 29 Oct 2014 18:55:53 -0700 Subject: [PATCH 0953/1288] Print parameter interactions to console, too --- src/init.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index d928094bba..3fd08ce006 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -548,6 +548,10 @@ bool AppInit2(boost::thread_group& threadGroup) #endif // ********************************************************* Step 2: parameter interactions + // Set this early so that parameter interactions go to console + fPrintToConsole = GetBoolArg("-printtoconsole", false); + fLogTimestamps = GetBoolArg("-logtimestamps", true); + fLogIPs = GetBoolArg("-logips", false); if (mapArgs.count("-bind") || mapArgs.count("-whitebind")) { // when specifying an explicit binding address, you want to listen on it @@ -641,9 +645,6 @@ bool AppInit2(boost::thread_group& threadGroup) nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS; fServer = GetBoolArg("-server", false); - fPrintToConsole = GetBoolArg("-printtoconsole", false); - fLogTimestamps = GetBoolArg("-logtimestamps", true); - fLogIPs = GetBoolArg("-logips", false); #ifdef ENABLE_WALLET bool fDisableWallet = GetBoolArg("-disablewallet", false); #endif From 779204029463ed89fa74c52510017954f4cb2411 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Thu, 30 Oct 2014 10:14:08 +0800 Subject: [PATCH 0954/1288] Update comments in rpcserver to be doxygen compatible --- src/rpcserver.cpp | 22 ++++++++++------------ src/rpcserver.h | 39 ++++++++++++++++++++------------------- 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 9668c78831..08ed73f6de 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "rpcserver.h" @@ -34,7 +34,7 @@ using namespace std; static std::string strRPCUserColonPass; static bool fRPCRunning = false; -// These are created by StartRPCThreads, destroyed in StopRPCThreads +//! These are created by StartRPCThreads, destroyed in StopRPCThreads static asio::io_service* rpc_io_service = NULL; static map > deadlineTimers; static ssl::context* rpc_ssl_context = NULL; @@ -134,9 +134,9 @@ vector ParseHexO(const Object& o, string strKey) } -/// -/// Note: This interface may still be subject to change. -/// +/** + * Note: This interface may still be subject to change. + */ string CRPCTable::help(string strCommand) const { @@ -232,11 +232,9 @@ Value stop(const Array& params, bool fHelp) -// -// Call Table -// - - +/** + * Call Table + */ static const CRPCCommand vRPCCommands[] = { // category name actor (function) okSafeMode threadSafe reqWallet // --------------------- ------------------------ ----------------------- ---------- ---------- --------- @@ -453,7 +451,7 @@ private: void ServiceConnection(AcceptedConnection *conn); -// Forward declaration required for RPCListen +//! Forward declaration required for RPCListen template static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor > acceptor, ssl::context& context, @@ -669,7 +667,7 @@ void StartRPCThreads() fListening = true; rpc_acceptors.push_back(acceptor); - // If dual IPv6/IPv4 bind succesful, skip binding to IPv4 separately + // If dual IPv6/IPv4 bind successful, skip binding to IPv4 separately if(bBindAny && bindAddress == asio::ip::address_v6::any() && !v6_only_error) break; } diff --git a/src/rpcserver.h b/src/rpcserver.h index d440035f15..cc444cef1f 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -1,6 +1,6 @@ // Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef _BITCOINRPC_SERVER_H_ @@ -32,9 +32,10 @@ public: virtual void close() = 0; }; -/* Start RPC threads */ +/** Start RPC threads */ void StartRPCThreads(); -/* Alternative to StartRPCThreads for the GUI, when no server is +/** + * Alternative to StartRPCThreads for the GUI, when no server is * used. The RPC thread in this case is only used to handle timeouts. * If real RPC threads have already been started this is a no-op. */ @@ -44,23 +45,23 @@ void StopRPCThreads(); /* Query whether RPC is running */ bool IsRPCRunning(); -/* - Type-check arguments; throws JSONRPCError if wrong type given. Does not check that - the right number of arguments are passed, just that any passed are the correct type. - Use like: RPCTypeCheck(params, boost::assign::list_of(str_type)(int_type)(obj_type)); -*/ +/** + * Type-check arguments; throws JSONRPCError if wrong type given. Does not check that + * the right number of arguments are passed, just that any passed are the correct type. + * Use like: RPCTypeCheck(params, boost::assign::list_of(str_type)(int_type)(obj_type)); + */ void RPCTypeCheck(const json_spirit::Array& params, const std::list& typesExpected, bool fAllowNull=false); -/* - Check for expected keys/value types in an Object. - Use like: RPCTypeCheck(object, boost::assign::map_list_of("name", str_type)("value", int_type)); -*/ +/** + * Check for expected keys/value types in an Object. + * Use like: RPCTypeCheck(object, boost::assign::map_list_of("name", str_type)("value", int_type)); + */ void RPCTypeCheck(const json_spirit::Object& o, const std::map& typesExpected, bool fAllowNull=false); -/* - Run func nSeconds from now. Uses boost deadline timers. - Overrides previous timer (if any). +/** + * Run func nSeconds from now. Uses boost deadline timers. + * Overrides previous timer (if any). */ void RPCRunLater(const std::string& name, boost::function func, int64_t nSeconds); @@ -104,10 +105,10 @@ public: extern const CRPCTable tableRPC; -// -// Utilities: convert hex-encoded Values -// (throws error if not hex). -// +/** + * Utilities: convert hex-encoded Values + * (throws error if not hex). + */ extern uint256 ParseHashV(const json_spirit::Value& v, std::string strName); extern uint256 ParseHashO(const json_spirit::Object& o, std::string strKey); extern std::vector ParseHexV(const json_spirit::Value& v, std::string strName); From 981f7907c48580623125230aa5082f3d67f72633 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 30 Oct 2014 07:31:34 +0100 Subject: [PATCH 0955/1288] [Qt] fix slot connection problems when no wallet is loaded - guard 4 connect calls by an #ifdef when no wallet is loaded to fix "No such slot" warnings - also add comments when #ifdef ENABLE_WALLET end - fixes #5175 --- src/qt/bitcoingui.cpp | 24 +++++++++++++----------- src/qt/bitcoingui.h | 6 +++--- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index f0471c32f9..77cfdceef0 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -19,7 +19,7 @@ #ifdef ENABLE_WALLET #include "walletframe.h" #include "walletmodel.h" -#endif +#endif // ENABLE_WALLET #ifdef Q_OS_MAC #include "macdockiconhandler.h" @@ -106,7 +106,7 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) : bool enableWallet = !GetBoolArg("-disablewallet", false); #else bool enableWallet = false; -#endif +#endif // ENABLE_WALLET if(enableWallet) { windowTitle += tr("Wallet"); @@ -136,7 +136,7 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) : walletFrame = new WalletFrame(this); setCentralWidget(walletFrame); } else -#endif +#endif // ENABLE_WALLET { /* When compiled without wallet or -disablewallet is provided, * the central widget is the rpc console. @@ -268,6 +268,7 @@ void BitcoinGUI::createActions(const NetworkStyle *networkStyle) historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); tabGroup->addAction(historyAction); +#ifdef ENABLE_WALLET // These showNormalIfMinimized are needed because Send Coins and Receive Coins // can be triggered from the tray menu, and need to show the GUI to be useful. connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); @@ -278,6 +279,7 @@ void BitcoinGUI::createActions(const NetworkStyle *networkStyle) connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); +#endif // ENABLE_WALLET quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setStatusTip(tr("Quit application")); @@ -343,7 +345,7 @@ void BitcoinGUI::createActions(const NetworkStyle *networkStyle) connect(usedReceivingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedReceivingAddresses())); connect(openAction, SIGNAL(triggered()), this, SLOT(openClicked())); } -#endif +#endif // ENABLE_WALLET } void BitcoinGUI::createMenuBar() @@ -433,7 +435,7 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel) { walletFrame->setClientModel(clientModel); } -#endif +#endif // ENABLE_WALLET unitDisplayControl->setOptionsModel(clientModel->getOptionsModel()); } else { // Disable possibility to show main window via action @@ -469,7 +471,7 @@ void BitcoinGUI::removeAllWallets() setWalletActionsEnabled(false); walletFrame->removeAllWallets(); } -#endif +#endif // ENABLE_WALLET void BitcoinGUI::setWalletActionsEnabled(bool enabled) { @@ -616,7 +618,7 @@ void BitcoinGUI::gotoVerifyMessageTab(QString addr) { if (walletFrame) walletFrame->gotoVerifyMessageTab(addr); } -#endif +#endif // ENABLE_WALLET void BitcoinGUI::setNumConnections(int count) { @@ -676,7 +678,7 @@ void BitcoinGUI::setNumBlocks(int count) #ifdef ENABLE_WALLET if(walletFrame) walletFrame->showOutOfSyncWarning(false); -#endif +#endif // ENABLE_WALLET progressBarLabel->setVisible(false); progressBar->setVisible(false); @@ -727,7 +729,7 @@ void BitcoinGUI::setNumBlocks(int count) #ifdef ENABLE_WALLET if(walletFrame) walletFrame->showOutOfSyncWarning(true); -#endif +#endif // ENABLE_WALLET tooltip += QString("
"); tooltip += tr("Last received block was generated %1 ago.").arg(timeBehindText); @@ -850,7 +852,7 @@ void BitcoinGUI::incomingTransaction(const QString& date, int unit, const CAmoun .arg(type) .arg(address), CClientUIInterface::MSG_INFORMATION); } -#endif +#endif // ENABLE_WALLET void BitcoinGUI::dragEnterEvent(QDragEnterEvent *event) { @@ -924,7 +926,7 @@ void BitcoinGUI::setEncryptionStatus(int status) break; } } -#endif +#endif // ENABLE_WALLET void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden) { diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index f65f0e9137..0ef4101127 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -63,7 +63,7 @@ public: bool addWallet(const QString& name, WalletModel *walletModel); bool setCurrentWallet(const QString& name); void removeAllWallets(); -#endif +#endif // ENABLE_WALLET protected: void changeEvent(QEvent *e); @@ -163,7 +163,7 @@ public slots: /** Show incoming transaction notification for new transactions. */ void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address); -#endif +#endif // ENABLE_WALLET private slots: #ifdef ENABLE_WALLET @@ -183,7 +183,7 @@ private slots: /** Show open dialog */ void openClicked(); -#endif +#endif // ENABLE_WALLET /** Show configuration dialog */ void optionsClicked(); /** Show about dialog */ From 6395ba30366949b8631a7bf56c1898f1667284c8 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Sun, 26 Oct 2014 14:32:29 +0800 Subject: [PATCH 0956/1288] Update comments in version to be doxygen compatible --- src/clientversion.cpp | 52 +++++++++++++++++++++++++------------------ src/version.h | 26 +++++++++++----------- 2 files changed, 43 insertions(+), 35 deletions(-) diff --git a/src/clientversion.cpp b/src/clientversion.cpp index 4987c3ed38..b3414fdb4b 100644 --- a/src/clientversion.cpp +++ b/src/clientversion.cpp @@ -1,5 +1,5 @@ -// Copyright (c) 2012 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2012-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "clientversion.h" @@ -8,35 +8,41 @@ #include -// Name of client reported in the 'version' message. Report the same name -// for both bitcoind and bitcoin-qt, to make it harder for attackers to -// target servers or GUI users specifically. +/** + * Name of client reported in the 'version' message. Report the same name + * for both bitcoind and bitcoin-core, to make it harder for attackers to + * target servers or GUI users specifically. + */ const std::string CLIENT_NAME("Satoshi"); -// Client version number +/** + * Client version number + */ #define CLIENT_VERSION_SUFFIX "" -// The following part of the code determines the CLIENT_BUILD variable. -// Several mechanisms are used for this: -// * first, if HAVE_BUILD_INFO is defined, include build.h, a file that is -// generated by the build environment, possibly containing the output -// of git-describe in a macro called BUILD_DESC -// * secondly, if this is an exported version of the code, GIT_ARCHIVE will -// be defined (automatically using the export-subst git attribute), and -// GIT_COMMIT will contain the commit id. -// * then, three options exist for determining CLIENT_BUILD: -// * if BUILD_DESC is defined, use that literally (output of git-describe) -// * if not, but GIT_COMMIT is defined, use v[maj].[min].[rev].[build]-g[commit] -// * otherwise, use v[maj].[min].[rev].[build]-unk -// finally CLIENT_VERSION_SUFFIX is added +/** + * The following part of the code determines the CLIENT_BUILD variable. + * Several mechanisms are used for this: + * * first, if HAVE_BUILD_INFO is defined, include build.h, a file that is + * generated by the build environment, possibly containing the output + * of git-describe in a macro called BUILD_DESC + * * secondly, if this is an exported version of the code, GIT_ARCHIVE will + * be defined (automatically using the export-subst git attribute), and + * GIT_COMMIT will contain the commit id. + * * then, three options exist for determining CLIENT_BUILD: + * * if BUILD_DESC is defined, use that literally (output of git-describe) + * * if not, but GIT_COMMIT is defined, use v[maj].[min].[rev].[build]-g[commit] + * * otherwise, use v[maj].[min].[rev].[build]-unk + * finally CLIENT_VERSION_SUFFIX is added + */ -// First, include build.h if requested +//! First, include build.h if requested #ifdef HAVE_BUILD_INFO #include "build.h" #endif -// git will put "#define GIT_ARCHIVE 1" on the next line inside archives. $Format:%n#define GIT_ARCHIVE 1$ +//! git will put "#define GIT_ARCHIVE 1" on the next line inside archives. $Format:%n#define GIT_ARCHIVE 1$ #ifdef GIT_ARCHIVE #define GIT_COMMIT_ID "$Format:%h$" #define GIT_COMMIT_DATE "$Format:%cD$" @@ -85,7 +91,9 @@ std::string FormatFullVersion() return CLIENT_BUILD; } -// Format the subversion field according to BIP 14 spec (https://en.bitcoin.it/wiki/BIP_0014) +/** + * Format the subversion field according to BIP 14 spec (https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki) + */ std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector& comments) { std::ostringstream ss; diff --git a/src/version.h b/src/version.h index 6ee08c205b..a5a72c5467 100644 --- a/src/version.h +++ b/src/version.h @@ -1,37 +1,37 @@ -// Copyright (c) 2012 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2012-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_VERSION_H #define BITCOIN_VERSION_H -// -// network protocol versioning -// +/** + * network protocol versioning + */ static const int PROTOCOL_VERSION = 70002; -// initial proto version, to be increased after version/verack negotiation +//! initial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209; -// In this version, 'getheaders' was introduced. +//! In this version, 'getheaders' was introduced. static const int GETHEADERS_VERSION = 31800; -// disconnect from peers older than this proto version +//! disconnect from peers older than this proto version static const int MIN_PEER_PROTO_VERSION = GETHEADERS_VERSION; -// nTime field added to CAddress, starting with this version; -// if possible, avoid requesting addresses nodes older than this +//! nTime field added to CAddress, starting with this version; +//! if possible, avoid requesting addresses nodes older than this static const int CADDR_TIME_VERSION = 31402; -// only request blocks from nodes outside this range of versions +//! only request blocks from nodes outside this range of versions static const int NOBLKS_VERSION_START = 32000; static const int NOBLKS_VERSION_END = 32400; -// BIP 0031, pong message, is enabled for all versions AFTER this one +//! BIP 0031, pong message, is enabled for all versions AFTER this one static const int BIP0031_VERSION = 60000; -// "mempool" command, enhanced "getdata" behavior starts with this version +//! "mempool" command, enhanced "getdata" behavior starts with this version static const int MEMPOOL_GD_VERSION = 60002; #endif // BITCOIN_VERSION_H From 484e350f0428d3d0ad067238866b99b2780cb0cf Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Sun, 26 Oct 2014 16:32:04 +0800 Subject: [PATCH 0957/1288] Update comments in client version to be doxygen compatible --- src/clientversion.h | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/src/clientversion.h b/src/clientversion.h index acaf54c6af..a187e185c1 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef CLIENTVERSION_H @@ -8,38 +8,43 @@ #if defined(HAVE_CONFIG_H) #include "config/bitcoin-config.h" #else -// -// client versioning and copyright year -// -// These need to be macros, as version.cpp's and bitcoin*-res.rc's voodoo requires it +/** + * client versioning and copyright year + */ + +//! These need to be macros, as clientversion.cpp's and bitcoin*-res.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 9 #define CLIENT_VERSION_REVISION 99 #define CLIENT_VERSION_BUILD 0 -// Set to true for release, false for prerelease or test build +//! Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE false -// Copyright year (2009-this) -// Todo: update this when changing our copyright comments in the source +/** + * Copyright year (2009-this) + * Todo: update this when changing our copyright comments in the source + */ #define COPYRIGHT_YEAR 2014 #endif //HAVE_CONFIG_H -// Converts the parameter X to a string after macro replacement on X has been performed. -// Don't merge these into one macro! +/** + * Converts the parameter X to a string after macro replacement on X has been performed. + * Don't merge these into one macro! + */ #define STRINGIZE(X) DO_STRINGIZE(X) #define DO_STRINGIZE(X) #X -// Copyright string used in Windows .rc files +//! Copyright string used in Windows .rc files #define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers" -/* - bitcoind-res.rc includes this file, but it cannot cope with real c++ code. - WINDRES_PREPROC is defined to indicate that its pre-processor is running. - Anything other than a define should be guarded below. -*/ +/** + * bitcoind-res.rc includes this file, but it cannot cope with real c++ code. + * WINDRES_PREPROC is defined to indicate that its pre-processor is running. + * Anything other than a define should be guarded below. + */ #if !defined(WINDRES_PREPROC) From f635269cd154eb69ad67a6fb004ed360b6112e27 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 30 Oct 2014 18:47:08 -0400 Subject: [PATCH 0958/1288] tests: enable alertnotify test for Windows The semantics of "echo" are different there and they change the resulting text, but they're still correct and predictable. --- src/test/alert_tests.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/test/alert_tests.cpp b/src/test/alert_tests.cpp index 9cf7a98f46..4869ba52ac 100644 --- a/src/test/alert_tests.cpp +++ b/src/test/alert_tests.cpp @@ -154,9 +154,6 @@ BOOST_AUTO_TEST_CASE(AlertApplies) } -// This uses sh 'echo' to test the -alertnotify function, writing to a -// /tmp file. So skip it on Windows: -#ifndef WIN32 BOOST_AUTO_TEST_CASE(AlertNotify) { SetMockTime(11); @@ -171,15 +168,24 @@ BOOST_AUTO_TEST_CASE(AlertNotify) std::vector r = read_lines(temp); BOOST_CHECK_EQUAL(r.size(), 4u); + +// Windows built-in echo semantics are different than posixy shells. Quotes and +// whitespace are printed literally. + +#ifndef WIN32 BOOST_CHECK_EQUAL(r[0], "Alert 1"); BOOST_CHECK_EQUAL(r[1], "Alert 2, cancels 1"); BOOST_CHECK_EQUAL(r[2], "Alert 2, cancels 1"); BOOST_CHECK_EQUAL(r[3], "Evil Alert; /bin/ls; echo "); // single-quotes should be removed - +#else + BOOST_CHECK_EQUAL(r[0], "'Alert 1' "); + BOOST_CHECK_EQUAL(r[1], "'Alert 2, cancels 1' "); + BOOST_CHECK_EQUAL(r[2], "'Alert 2, cancels 1' "); + BOOST_CHECK_EQUAL(r[3], "'Evil Alert; /bin/ls; echo ' "); +#endif boost::filesystem::remove(temp); SetMockTime(0); } -#endif BOOST_AUTO_TEST_SUITE_END() From 7a41614aa27b9d3855b6145831cb4ad958f78823 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 30 Oct 2014 18:59:58 -0400 Subject: [PATCH 0959/1288] tests: allow rpc-tests to get filenames for bitcoind and bitcoin-cli from the environment This will allow for windows tests to run with bitcoind.exe and bitcoin-cli.exe --- qa/rpc-tests/conflictedbalance.sh | 5 +++-- qa/rpc-tests/txnmall.sh | 5 +++-- qa/rpc-tests/util.py | 8 ++++---- qa/rpc-tests/wallet.sh | 5 +++-- qa/rpc-tests/walletbackup.sh | 5 +++-- qa/rpc-tests/zapwallettxes.sh | 5 +++-- 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/qa/rpc-tests/conflictedbalance.sh b/qa/rpc-tests/conflictedbalance.sh index 71761321ed..a112244c74 100755 --- a/qa/rpc-tests/conflictedbalance.sh +++ b/qa/rpc-tests/conflictedbalance.sh @@ -18,13 +18,14 @@ if [ $# -lt 1 ]; then echo "Usage: $0 path_to_binaries" echo "e.g. $0 ../../src" + echo "Env vars BITCOIND and BITCOINCLI may be used to specify the exact binaries used" exit 1 fi set -f -BITCOIND=${1}/bitcoind -CLI=${1}/bitcoin-cli +BITCOIND=${BITCOIND:-${1}/bitcoind} +CLI=${BITCOINCLI:-${1}/bitcoin-cli} DIR="${BASH_SOURCE%/*}" SENDANDWAIT="${DIR}/send.sh" diff --git a/qa/rpc-tests/txnmall.sh b/qa/rpc-tests/txnmall.sh index 035e7ee15f..1296d54d92 100755 --- a/qa/rpc-tests/txnmall.sh +++ b/qa/rpc-tests/txnmall.sh @@ -8,13 +8,14 @@ if [ $# -lt 1 ]; then echo "Usage: $0 path_to_binaries" echo "e.g. $0 ../../src" + echo "Env vars BITCOIND and BITCOINCLI may be used to specify the exact binaries used" exit 1 fi set -f -BITCOIND=${1}/bitcoind -CLI=${1}/bitcoin-cli +BITCOIND=${BITCOIND:-${1}/bitcoind} +CLI=${BITCOINCLI:-${1}/bitcoin-cli} DIR="${BASH_SOURCE%/*}" SENDANDWAIT="${DIR}/send.sh" diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index 6d0b21c927..c895eb1619 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -85,11 +85,11 @@ def initialize_chain(test_dir): # Create cache directories, run bitcoinds: for i in range(4): datadir=initialize_datadir("cache", i) - args = [ "bitcoind", "-keypool=1", "-datadir="+datadir, "-discover=0" ] + args = [ os.getenv("BITCOIND", "bitcoind"), "-keypool=1", "-datadir="+datadir, "-discover=0" ] if i > 0: args.append("-connect=127.0.0.1:"+str(p2p_port(0))) bitcoind_processes[i] = subprocess.Popen(args) - subprocess.check_call([ "bitcoin-cli", "-datadir="+datadir, + subprocess.check_call([ os.getenv("BITCOINCLI", "bitcoin-cli"), "-datadir="+datadir, "-rpcwait", "getblockcount"], stdout=devnull) devnull.close() rpcs = [] @@ -150,11 +150,11 @@ def start_node(i, dir, extra_args=None, rpchost=None): Start a bitcoind and return RPC connection to it """ datadir = os.path.join(dir, "node"+str(i)) - args = [ "bitcoind", "-datadir="+datadir, "-keypool=1", "-discover=0" ] + args = [ os.getenv("BITCOIND", "bitcoind"), "-datadir="+datadir, "-keypool=1", "-discover=0" ] if extra_args is not None: args.extend(extra_args) bitcoind_processes[i] = subprocess.Popen(args) devnull = open("/dev/null", "w+") - subprocess.check_call([ "bitcoin-cli", "-datadir="+datadir] + + subprocess.check_call([ os.getenv("BITCOINCLI", "bitcoin-cli"), "-datadir="+datadir] + _rpchost_to_args(rpchost) + ["-rpcwait", "getblockcount"], stdout=devnull) devnull.close() diff --git a/qa/rpc-tests/wallet.sh b/qa/rpc-tests/wallet.sh index bb5f34f590..c9ad0f2a78 100755 --- a/qa/rpc-tests/wallet.sh +++ b/qa/rpc-tests/wallet.sh @@ -8,13 +8,14 @@ if [ $# -lt 1 ]; then echo "Usage: $0 path_to_binaries" echo "e.g. $0 ../../src" + echo "Env vars BITCOIND and BITCOINCLI may be used to specify the exact binaries used" exit 1 fi set -f -BITCOIND=${1}/bitcoind -CLI=${1}/bitcoin-cli +BITCOIND=${BITCOIND:-${1}/bitcoind} +CLI=${BITCOINCLI:-${1}/bitcoin-cli} DIR="${BASH_SOURCE%/*}" SENDANDWAIT="${DIR}/send.sh" diff --git a/qa/rpc-tests/walletbackup.sh b/qa/rpc-tests/walletbackup.sh index ee11418bef..4af3d97f35 100755 --- a/qa/rpc-tests/walletbackup.sh +++ b/qa/rpc-tests/walletbackup.sh @@ -36,11 +36,12 @@ if [ $# -lt 1 ]; then echo "Usage: $0 path_to_binaries" echo "e.g. $0 ../../src" + echo "Env vars BITCOIND and BITCOINCLI may be used to specify the exact binaries used" exit 1 fi -BITCOIND=${1}/bitcoind -CLI=${1}/bitcoin-cli +BITCOIND=${BITCOIND:-${1}/bitcoind} +CLI=${BITCOINCLI:-${1}/bitcoin-cli} DIR="${BASH_SOURCE%/*}" SENDANDWAIT="${DIR}/send.sh" diff --git a/qa/rpc-tests/zapwallettxes.sh b/qa/rpc-tests/zapwallettxes.sh index e6d490cccc..4312d84e94 100755 --- a/qa/rpc-tests/zapwallettxes.sh +++ b/qa/rpc-tests/zapwallettxes.sh @@ -8,13 +8,14 @@ if [ $# -lt 1 ]; then echo "Usage: $0 path_to_binaries" echo "e.g. $0 ../../src" + echo "Env vars BITCOIND and BITCOINCLI may be used to specify the exact binaries used" exit 1 fi set -f -BITCOIND=${1}/bitcoind -CLI=${1}/bitcoin-cli +BITCOIND=${BITCOIND:-${1}/bitcoind} +CLI=${BITCOINCLI:-${1}/bitcoin-cli} DIR="${BASH_SOURCE%/*}" SENDANDWAIT="${DIR}/send.sh" From 5122ea7190f85952ef27153bb1778831efb3e0ec Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 30 Oct 2014 23:01:34 -0400 Subject: [PATCH 0960/1288] tests: fix forknotify.py on windows Windows interprets 'foo.txt' as a literal filename while "foo.txt" is treated as expected. --- qa/rpc-tests/forknotify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/rpc-tests/forknotify.py b/qa/rpc-tests/forknotify.py index a4c2dc944e..1d2c4a9966 100755 --- a/qa/rpc-tests/forknotify.py +++ b/qa/rpc-tests/forknotify.py @@ -23,7 +23,7 @@ class ForkNotifyTest(BitcoinTestFramework): with open(self.alert_filename, 'w') as f: pass # Just open then close to create zero-length file self.nodes.append(start_node(0, self.options.tmpdir, - ["-blockversion=2", "-alertnotify=echo %s >> '" + self.alert_filename + "'"])) + ["-blockversion=2", "-alertnotify=echo %s >> \"" + self.alert_filename + "\""])) # Node1 mines block.version=211 blocks self.nodes.append(start_node(1, self.options.tmpdir, ["-blockversion=211"])) From fa7f8cdc1ac92047cd876d750851cf4230fc8295 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 30 Oct 2014 22:29:35 -0400 Subject: [PATCH 0961/1288] tests: remove old pull-tester scripts They're unused since the switch to Travis --- Makefile.am | 2 +- qa/pull-tester/pull-tester.py | 193 ---------------------------------- qa/pull-tester/pull-tester.sh | 22 ---- 3 files changed, 1 insertion(+), 216 deletions(-) delete mode 100755 qa/pull-tester/pull-tester.py delete mode 100755 qa/pull-tester/pull-tester.sh diff --git a/Makefile.am b/Makefile.am index 7fe3811476..c6a045150e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -172,7 +172,7 @@ check-local: @qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS) 2>&1 endif -EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/pull-tester.sh qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) +EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER) diff --git a/qa/pull-tester/pull-tester.py b/qa/pull-tester/pull-tester.py deleted file mode 100755 index 66688dd4b5..0000000000 --- a/qa/pull-tester/pull-tester.py +++ /dev/null @@ -1,193 +0,0 @@ -#!/usr/bin/python -# Copyright (c) 2013-2014 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. -# -import json -from urllib import urlopen -import requests -import getpass -from string import Template -import sys -import os -import subprocess - -class RunError(Exception): - def __init__(self, value): - self.value = value - def __str__(self): - return repr(self.value) - -def run(command, **kwargs): - fail_hard = kwargs.pop("fail_hard", True) - # output to /dev/null by default: - kwargs.setdefault("stdout", open('/dev/null', 'w')) - kwargs.setdefault("stderr", open('/dev/null', 'w')) - command = Template(command).substitute(os.environ) - if "TRACE" in os.environ: - if 'cwd' in kwargs: - print("[cwd=%s] %s"%(kwargs['cwd'], command)) - else: print(command) - try: - process = subprocess.Popen(command.split(' '), **kwargs) - process.wait() - except KeyboardInterrupt: - process.terminate() - raise - if process.returncode != 0 and fail_hard: - raise RunError("Failed: "+command) - return process.returncode - -def checkout_pull(clone_url, commit, out): - # Init - build_dir=os.environ["BUILD_DIR"] - run("umount ${CHROOT_COPY}/proc", fail_hard=False) - run("rsync --delete -apv ${CHROOT_MASTER}/ ${CHROOT_COPY}") - run("rm -rf ${CHROOT_COPY}${SCRIPTS_DIR}") - run("cp -a ${SCRIPTS_DIR} ${CHROOT_COPY}${SCRIPTS_DIR}") - # Merge onto upstream/master - run("rm -rf ${BUILD_DIR}") - run("mkdir -p ${BUILD_DIR}") - run("git clone ${CLONE_URL} ${BUILD_DIR}") - run("git remote add pull "+clone_url, cwd=build_dir, stdout=out, stderr=out) - run("git fetch pull", cwd=build_dir, stdout=out, stderr=out) - if run("git merge "+ commit, fail_hard=False, cwd=build_dir, stdout=out, stderr=out) != 0: - return False - run("chown -R ${BUILD_USER}:${BUILD_GROUP} ${BUILD_DIR}", stdout=out, stderr=out) - run("mount --bind /proc ${CHROOT_COPY}/proc") - return True - -def commentOn(commentUrl, success, inMerge, needTests, linkUrl): - common_message = """ -This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ -Contact BlueMatt on freenode if something looks broken.""" - - # Remove old BitcoinPullTester comments (I'm being lazy and not paginating here) - recentcomments = requests.get(commentUrl+"?sort=created&direction=desc", - auth=(os.environ['GITHUB_USER'], os.environ["GITHUB_AUTH_TOKEN"])).json - for comment in recentcomments: - if comment["user"]["login"] == os.environ["GITHUB_USER"] and common_message in comment["body"]: - requests.delete(comment["url"], - auth=(os.environ['GITHUB_USER'], os.environ["GITHUB_AUTH_TOKEN"])) - - if success == True: - if needTests: - message = "Automatic sanity-testing: PLEASE ADD TEST-CASES, though technically passed. See " + linkUrl + " for binaries and test log." - else: - message = "Automatic sanity-testing: PASSED, see " + linkUrl + " for binaries and test log." - - post_data = { "body" : message + common_message} - elif inMerge: - post_data = { "body" : "Automatic sanity-testing: FAILED MERGE, see " + linkUrl + " for test log." + """ - -This pull does not merge cleanly onto current master""" + common_message} - else: - post_data = { "body" : "Automatic sanity-testing: FAILED BUILD/TEST, see " + linkUrl + " for binaries and test log." + """ - -This could happen for one of several reasons: -1. It chanages changes build scripts in a way that made them incompatible with the automated testing scripts (please tweak those patches in qa/pull-tester) -2. It adds/modifies tests which test network rules (thanks for doing that), which conflicts with a patch applied at test time -3. It does not build on either Linux i386 or Win32 (via MinGW cross compile) -4. The test suite fails on either Linux i386 or Win32 -5. The block test-cases failed (lookup the first bNN identifier which failed in https://github.com/TheBlueMatt/test-scripts/blob/master/FullBlockTestGenerator.java) - -If you believe this to be in error, please ping BlueMatt on freenode or TheBlueMatt here. -""" + common_message} - - resp = requests.post(commentUrl, json.dumps(post_data), auth=(os.environ['GITHUB_USER'], os.environ["GITHUB_AUTH_TOKEN"])) - -def testpull(number, comment_url, clone_url, commit): - print("Testing pull %d: %s : %s"%(number, clone_url,commit)) - - dir = os.environ["RESULTS_DIR"] + "/" + commit + "/" - print(" ouput to %s"%dir) - if os.path.exists(dir): - os.system("rm -r " + dir) - os.makedirs(dir) - currentdir = os.environ["RESULTS_DIR"] + "/current" - os.system("rm -r "+currentdir) - os.system("ln -s " + dir + " " + currentdir) - out = open(dir + "test.log", 'w+') - - resultsurl = os.environ["RESULTS_URL"] + commit - checkedout = checkout_pull(clone_url, commit, out) - if checkedout != True: - print("Failed to test pull - sending comment to: " + comment_url) - commentOn(comment_url, False, True, False, resultsurl) - open(os.environ["TESTED_DB"], "a").write(commit + "\n") - return - - run("rm -rf ${CHROOT_COPY}/${OUT_DIR}", fail_hard=False); - run("mkdir -p ${CHROOT_COPY}/${OUT_DIR}", fail_hard=False); - run("chown -R ${BUILD_USER}:${BUILD_GROUP} ${CHROOT_COPY}/${OUT_DIR}", fail_hard=False) - - script = os.environ["BUILD_PATH"]+"/qa/pull-tester/pull-tester.sh" - script += " ${BUILD_PATH} ${MINGW_DEPS_DIR} ${SCRIPTS_DIR}/BitcoindComparisonTool_jar/BitcoindComparisonTool.jar 0 6 ${OUT_DIR}" - returncode = run("chroot ${CHROOT_COPY} sudo -u ${BUILD_USER} -H timeout ${TEST_TIMEOUT} "+script, - fail_hard=False, stdout=out, stderr=out) - - run("mv ${CHROOT_COPY}/${OUT_DIR} " + dir) - run("mv ${BUILD_DIR} " + dir) - - if returncode == 42: - print("Successfully tested pull (needs tests) - sending comment to: " + comment_url) - commentOn(comment_url, True, False, True, resultsurl) - elif returncode != 0: - print("Failed to test pull - sending comment to: " + comment_url) - commentOn(comment_url, False, False, False, resultsurl) - else: - print("Successfully tested pull - sending comment to: " + comment_url) - commentOn(comment_url, True, False, False, resultsurl) - open(os.environ["TESTED_DB"], "a").write(commit + "\n") - -def environ_default(setting, value): - if not setting in os.environ: - os.environ[setting] = value - -if getpass.getuser() != "root": - print("Run me as root!") - sys.exit(1) - -if "GITHUB_USER" not in os.environ or "GITHUB_AUTH_TOKEN" not in os.environ: - print("GITHUB_USER and/or GITHUB_AUTH_TOKEN environment variables not set") - sys.exit(1) - -environ_default("CLONE_URL", "https://github.com/bitcoin/bitcoin.git") -environ_default("MINGW_DEPS_DIR", "/mnt/w32deps") -environ_default("SCRIPTS_DIR", "/mnt/test-scripts") -environ_default("CHROOT_COPY", "/mnt/chroot-tmp") -environ_default("CHROOT_MASTER", "/mnt/chroot") -environ_default("OUT_DIR", "/mnt/out") -environ_default("BUILD_PATH", "/mnt/bitcoin") -os.environ["BUILD_DIR"] = os.environ["CHROOT_COPY"] + os.environ["BUILD_PATH"] -environ_default("RESULTS_DIR", "/mnt/www/pull-tester") -environ_default("RESULTS_URL", "http://jenkins.bluematt.me/pull-tester/") -environ_default("GITHUB_REPO", "bitcoin/bitcoin") -environ_default("TESTED_DB", "/mnt/commits-tested.txt") -environ_default("BUILD_USER", "matt") -environ_default("BUILD_GROUP", "matt") -environ_default("TEST_TIMEOUT", str(60*60*2)) - -print("Optional usage: pull-tester.py 2112") - -f = open(os.environ["TESTED_DB"]) -tested = set( line.rstrip() for line in f.readlines() ) -f.close() - -if len(sys.argv) > 1: - pull = requests.get("https://api.github.com/repos/"+os.environ["GITHUB_REPO"]+"/pulls/"+sys.argv[1], - auth=(os.environ['GITHUB_USER'], os.environ["GITHUB_AUTH_TOKEN"])).json - testpull(pull["number"], pull["_links"]["comments"]["href"], - pull["head"]["repo"]["clone_url"], pull["head"]["sha"]) - -else: - for page in range(1,100): - result = requests.get("https://api.github.com/repos/"+os.environ["GITHUB_REPO"]+"/pulls?state=open&page=%d"%(page,), - auth=(os.environ['GITHUB_USER'], os.environ["GITHUB_AUTH_TOKEN"])).json - if len(result) == 0: break; - for pull in result: - if pull["head"]["sha"] in tested: - print("Pull %d already tested"%(pull["number"],)) - continue - testpull(pull["number"], pull["_links"]["comments"]["href"], - pull["head"]["repo"]["clone_url"], pull["head"]["sha"]) diff --git a/qa/pull-tester/pull-tester.sh b/qa/pull-tester/pull-tester.sh deleted file mode 100755 index 3fe4a05c76..0000000000 --- a/qa/pull-tester/pull-tester.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# Copyright (c) 2013-2014 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. -# -# Helper script for pull-tester. -#Param 1: path to bitcoin srcroot -#Param ...: arguments for build-test.sh - -if [ $# -lt 1 ]; then - echo "usage: $0 [bitcoin srcroot] build-test arguments..." -fi - -killall -q bitcoin-cli -killall -q bitcoind - -cd $1 -shift - -./autogen.sh -./configure -./qa/pull-tester/build-tests.sh "$@" From 7667850dbfac0ced6eb2711d922c263b65ffaeee Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 30 Oct 2014 22:58:13 -0400 Subject: [PATCH 0962/1288] tests: replace the old (unused since Travis) tests with new rpc test scripts --- .gitignore | 4 +- Makefile.am | 2 +- configure.ac | 2 +- qa/pull-tester/build-tests.sh.in | 102 ------------------------------ qa/pull-tester/rpc-tests.sh | 19 ++++++ qa/pull-tester/run-bitcoin-cli | 13 ++++ qa/pull-tester/tests-config.sh.in | 16 +++++ 7 files changed, 53 insertions(+), 105 deletions(-) delete mode 100755 qa/pull-tester/build-tests.sh.in create mode 100755 qa/pull-tester/rpc-tests.sh create mode 100755 qa/pull-tester/run-bitcoin-cli create mode 100755 qa/pull-tester/tests-config.sh.in diff --git a/.gitignore b/.gitignore index bafc5919c1..c97432df92 100644 --- a/.gitignore +++ b/.gitignore @@ -99,7 +99,9 @@ linux-coverage-build linux-build win32-build qa/pull-tester/run-bitcoind-for-test.sh -qa/pull-tester/build-tests.sh +qa/pull-tester/tests-config.sh +qa/pull-tester/cache/* +qa/pull-tester/test.*/* !src/leveldb*/Makefile diff --git a/Makefile.am b/Makefile.am index c6a045150e..6bc0044313 100644 --- a/Makefile.am +++ b/Makefile.am @@ -172,7 +172,7 @@ check-local: @qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS) 2>&1 endif -EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) +EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.sh qa/pull-tester/run-bitcoin-cli qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER) diff --git a/configure.ac b/configure.ac index b603d1766d..17efd987ac 100644 --- a/configure.ac +++ b/configure.ac @@ -824,7 +824,7 @@ AC_SUBST(MINIUPNPC_CPPFLAGS) AC_SUBST(MINIUPNPC_LIBS) AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py]) AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh]) -AC_CONFIG_FILES([qa/pull-tester/build-tests.sh],[chmod +x qa/pull-tester/build-tests.sh]) +AC_CONFIG_FILES([qa/pull-tester/tests-config.sh],[chmod +x qa/pull-tester/tests-config.sh]) AC_OUTPUT dnl Taken from https://wiki.debian.org/RpathIssue diff --git a/qa/pull-tester/build-tests.sh.in b/qa/pull-tester/build-tests.sh.in deleted file mode 100755 index f5c5f0bf70..0000000000 --- a/qa/pull-tester/build-tests.sh.in +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/bash -# Copyright (c) 2013-2014 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. -# -# Param1: The prefix to mingw staging -# Param2: Path to java comparison tool -# Param3: Number of make jobs. Defaults to 1. - -# Exit immediately if anything fails: -set -e -set -o xtrace - -MINGWPREFIX=$1 -JAVA_COMPARISON_TOOL=$2 -RUN_EXPENSIVE_TESTS=$3 -JOBS=${4-1} -OUT_DIR=${5-} - -if [ $# -lt 2 ]; then - echo "Usage: $0 [mingw-prefix] [java-comparison-tool] " - exit 1 -fi - -DISTDIR=@PACKAGE@-@VERSION@ - -# Cross-compile for windows first (breaking the mingw/windows build is most common) -cd @abs_top_srcdir@ -make distdir -mkdir -p win32-build -rsync -av $DISTDIR/ win32-build/ -rm -r $DISTDIR -cd win32-build - -if [ $RUN_EXPENSIVE_TESTS = 1 ]; then - ./configure --disable-silent-rules --disable-ccache --prefix=$MINGWPREFIX --host=i586-mingw32msvc --with-qt-bindir=$MINGWPREFIX/host/bin --with-qt-plugindir=$MINGWPREFIX/plugins --with-qt-incdir=$MINGWPREFIX/include --with-boost=$MINGWPREFIX --with-protoc-bindir=$MINGWPREFIX/host/bin CPPFLAGS=-I$MINGWPREFIX/include LDFLAGS=-L$MINGWPREFIX/lib --with-comparison-tool="$JAVA_COMPARISON_TOOL" -else - ./configure --disable-silent-rules --disable-ccache --prefix=$MINGWPREFIX --host=i586-mingw32msvc --with-qt-bindir=$MINGWPREFIX/host/bin --with-qt-plugindir=$MINGWPREFIX/plugins --with-qt-incdir=$MINGWPREFIX/include --with-boost=$MINGWPREFIX --with-protoc-bindir=$MINGWPREFIX/host/bin CPPFLAGS=-I$MINGWPREFIX/include LDFLAGS=-L$MINGWPREFIX/lib -fi -make -j$JOBS - -# And compile for Linux: -cd @abs_top_srcdir@ -make distdir -mkdir -p linux-build -rsync -av $DISTDIR/ linux-build/ -rm -r $DISTDIR -cd linux-build -if [ $RUN_EXPENSIVE_TESTS = 1 ]; then - ./configure --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL" --enable-comparison-tool-reorg-tests -else - ./configure --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL" -fi -make -j$JOBS - -# link interesting binaries to parent out/ directory, if it exists. Do this before -# running unit tests (we want bad binaries to be easy to find) -if [ -d "$OUT_DIR" -a -w "$OUT_DIR" ]; then - set +e - # Windows: - cp @abs_top_srcdir@/win32-build/src/bitcoind.exe $OUT_DIR/bitcoind.exe - cp @abs_top_srcdir@/win32-build/src/test/test_bitcoin.exe $OUT_DIR/test_bitcoin.exe - cp @abs_top_srcdir@/win32-build/src/qt/bitcoind-qt.exe $OUT_DIR/bitcoin-qt.exe - # Linux: - cp @abs_top_srcdir@/linux-build/src/bitcoind $OUT_DIR/bitcoind - cp @abs_top_srcdir@/linux-build/src/test/test_bitcoin $OUT_DIR/test_bitcoin - cp @abs_top_srcdir@/linux-build/src/qt/bitcoind-qt $OUT_DIR/bitcoin-qt - set -e -fi - -# Run unit tests and blockchain-tester on Linux: -cd @abs_top_srcdir@/linux-build -make check - -# Run RPC integration test on Linux: -@abs_top_srcdir@/qa/rpc-tests/wallet.sh @abs_top_srcdir@/linux-build/src -@abs_top_srcdir@/qa/rpc-tests/listtransactions.py --srcdir @abs_top_srcdir@/linux-build/src -@abs_top_srcdir@/qa/rpc-tests/forknotify.py --srcdir @abs_top_srcdir@/linux-build/src -# Clean up cache/ directory that the python regression tests create -rm -rf cache - -if [ $RUN_EXPENSIVE_TESTS = 1 ]; then - # Run unit tests and blockchain-tester on Windows: - cd @abs_top_srcdir@/win32-build - make check -fi - -# Clean up builds (pull-tester machine doesn't have infinite disk space) -cd @abs_top_srcdir@/linux-build -make clean -cd @abs_top_srcdir@/win32-build -make clean - -# TODO: Fix code coverage builds on pull-tester machine -# # Test code coverage -# cd @abs_top_srcdir@ -# make distdir -# mv $DISTDIR linux-coverage-build -# cd linux-coverage-build -# ./configure --enable-lcov --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL" -# make -j$JOBS -# make cov diff --git a/qa/pull-tester/rpc-tests.sh b/qa/pull-tester/rpc-tests.sh new file mode 100755 index 0000000000..f07e3c6d9d --- /dev/null +++ b/qa/pull-tester/rpc-tests.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e + +CURDIR=$(cd $(dirname "$0"); pwd) +# Get BUILDDIR and REAL_BITCOIND +. "${CURDIR}/tests-config.sh" + +export BITCOINCLI=${BUILDDIR}/qa/pull-tester/run-bitcoin-cli +export BITCOIND=${REAL_BITCOIND} + +#Run the tests + +if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then + ${BUILDDIR}/qa/rpc-tests/wallet.sh "${BUILDDIR}/src" + ${BUILDDIR}/qa/rpc-tests/listtransactions.py --srcdir "${BUILDDIR}/src" + ${BUILDDIR}/qa/rpc-tests/forknotify.py --srcdir "${BUILDDIR}/src" +else + echo "No rpc tests to run. Wallet, utils, and bitcoind must all be enabled" +fi diff --git a/qa/pull-tester/run-bitcoin-cli b/qa/pull-tester/run-bitcoin-cli new file mode 100755 index 0000000000..93c25bb9fc --- /dev/null +++ b/qa/pull-tester/run-bitcoin-cli @@ -0,0 +1,13 @@ +#!/bin/bash + +# This is a thin wrapper around bitcoin-cli that strips the Windows-style EOLs +# from the output if present. It is necessary when using bitcoin-cli.exe on +# Linux since shells will interpret the line-endings as part of the result. + +CURDIR=$(cd $(dirname "$0"); pwd) +# Get BUILDDIR and REAL_BITCOIND + +# Grab the value of $REAL_BITCOINCLI which may be bitcoin-cli.exe. +. "${CURDIR}/tests-config.sh" + +"${REAL_BITCOINCLI}" "$@" | sed 's/\r//' diff --git a/qa/pull-tester/tests-config.sh.in b/qa/pull-tester/tests-config.sh.in new file mode 100755 index 0000000000..10f4d33e47 --- /dev/null +++ b/qa/pull-tester/tests-config.sh.in @@ -0,0 +1,16 @@ +#!/bin/bash +# Copyright (c) 2013-2014 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +BUILDDIR="@abs_top_builddir@" +EXEEXT="@EXEEXT@" + +# These will turn into comments if they were disabled when configuring. +@ENABLE_WALLET_TRUE@ENABLE_WALLET=1 +@BUILD_BITCOIN_UTILS_TRUE@ENABLE_UTILS=1 +@BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=1 + +REAL_BITCOIND="$BUILDDIR/src/bitcoind${EXEEXT}" +REAL_BITCOINCLI="$BUILDDIR/src/bitcoin-cli${EXEEXT}" + From 2191eac812a72fe57167be882bddd2e6a3f0340e Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 31 Oct 2014 00:00:02 -0400 Subject: [PATCH 0963/1288] add tests to travis --- .travis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 94d1c15f80..b685fbb5cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,17 +27,17 @@ matrix: - compiler: ": ARM" env: HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="NO_QT=1" GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" - compiler: ": bitcoind" - env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat CPPFLAGS=-DDEBUG_LOCKORDER" + env: HOST=x86_64-unknown-linux-gnu PACKAGES="bc" DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat CPPFLAGS=-DDEBUG_LOCKORDER" - compiler: ": No wallet" env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" - compiler: ": 32-bit + dash" - env: HOST=i686-pc-linux-gnu PACKAGES="g++-multilib" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" USE_SHELL="/bin/dash" + env: HOST=i686-pc-linux-gnu PACKAGES="g++-multilib bc" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" USE_SHELL="/bin/dash" - compiler: ": Cross-Mac" env: HOST=x86_64-apple-darwin11 PACKAGES="gcc-multilib g++-multilib cmake libcap-dev libz-dev libbz2-dev" OSX_SDK=10.7 GOAL="deploy" - compiler: ": Win64" - env: HOST=x86_64-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev wine" RUN_TESTS=true GOAL="deploy" + env: HOST=x86_64-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" - compiler: ": Win32" - env: HOST=i686-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-dev wine" RUN_TESTS=true GOAL="deploy" + env: HOST=i686-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" install: - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-upgrade -qq $PACKAGES; fi @@ -60,5 +60,6 @@ script: - ./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false) - make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false ) - if [ "$RUN_TESTS" = "true" ]; then make check; fi + - if [ "$RUN_TESTS" = "true" ]; then qa/pull-tester/rpc-tests.sh; fi after_script: - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then (echo "Upload goes here. Something like: scp -r $BASE_OUTDIR server" || echo "upload failed"); fi From 1c0aa9110e0cbe207f16e8bf2cc6c410b9ec1cef Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Fri, 31 Oct 2014 11:34:30 +0800 Subject: [PATCH 0964/1288] Update serialize comments to be doxygen compatible --- src/serialize.h | 178 +++++++++++++++++++++++++++--------------------- 1 file changed, 100 insertions(+), 78 deletions(-) diff --git a/src/serialize.h b/src/serialize.h index 877ef8640a..ad38a3fa22 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_SERIALIZE_H @@ -22,23 +22,28 @@ class CScript; static const unsigned int MAX_SIZE = 0x02000000; -// Used to bypass the rule against non-const reference to temporary -// where it makes sense with wrappers such as CFlatData or CTxDB +/** + * Used to bypass the rule against non-const reference to temporary + * where it makes sense with wrappers such as CFlatData or CTxDB + */ template inline T& REF(const T& val) { return const_cast(val); } -// Used to acquire a non-const pointer "this" to generate bodies -// of const serialization operations from a template +/** + * Used to acquire a non-const pointer "this" to generate bodies + * of const serialization operations from a template + */ template inline T* NCONST_PTR(const T* val) { return const_cast(val); } -/** Get begin pointer of vector (non-const version). +/** + * Get begin pointer of vector (non-const version). * @note These functions avoid the undefined case of indexing into an empty * vector, as well as that of indexing after the end of the vector. */ @@ -82,10 +87,12 @@ enum #define READWRITE(obj) (::SerReadWrite(s, (obj), nType, nVersion, ser_action)) -/* Implement three methods for serializable objects. These are actually wrappers over +/** + * Implement three methods for serializable objects. These are actually wrappers over * "SerializationOp" template, which implements the body of each class' serialization * code. Adding "ADD_SERIALIZE_METHODS" in the body of the class causes these wrappers to be - * added as members. */ + * added as members. + */ #define ADD_SERIALIZE_METHODS \ size_t GetSerializeSize(int nType, int nVersion) const { \ CSizeComputer s(nType, nVersion); \ @@ -103,9 +110,9 @@ enum -// -// Basic types -// +/* + * Basic Types + */ #define WRITEDATA(s, obj) s.write((char*)&(obj), sizeof(obj)) #define READDATA(s, obj) s.read((char*)&(obj), sizeof(obj)) @@ -160,13 +167,13 @@ template inline void Unserialize(Stream& s, bool& a, int, int=0 -// -// Compact size -// size < 253 -- 1 byte -// size <= USHRT_MAX -- 3 bytes (253 + 2 bytes) -// size <= UINT_MAX -- 5 bytes (254 + 4 bytes) -// size > UINT_MAX -- 9 bytes (255 + 8 bytes) -// +/** + * Compact Size + * size < 253 -- 1 byte + * size <= USHRT_MAX -- 3 bytes (253 + 2 bytes) + * size <= UINT_MAX -- 5 bytes (254 + 4 bytes) + * size > UINT_MAX -- 9 bytes (255 + 8 bytes) + */ inline unsigned int GetSizeOfCompactSize(uint64_t nSize) { if (nSize < 253) return sizeof(unsigned char); @@ -246,27 +253,29 @@ uint64_t ReadCompactSize(Stream& is) return nSizeRet; } -// Variable-length integers: bytes are a MSB base-128 encoding of the number. -// The high bit in each byte signifies whether another digit follows. To make -// the encoding is one-to-one, one is subtracted from all but the last digit. -// Thus, the byte sequence a[] with length len, where all but the last byte -// has bit 128 set, encodes the number: -// -// (a[len-1] & 0x7F) + sum(i=1..len-1, 128^i*((a[len-i-1] & 0x7F)+1)) -// -// Properties: -// * Very small (0-127: 1 byte, 128-16511: 2 bytes, 16512-2113663: 3 bytes) -// * Every integer has exactly one encoding -// * Encoding does not depend on size of original integer type -// * No redundancy: every (infinite) byte sequence corresponds to a list -// of encoded integers. -// -// 0: [0x00] 256: [0x81 0x00] -// 1: [0x01] 16383: [0xFE 0x7F] -// 127: [0x7F] 16384: [0xFF 0x00] -// 128: [0x80 0x00] 16511: [0x80 0xFF 0x7F] -// 255: [0x80 0x7F] 65535: [0x82 0xFD 0x7F] -// 2^32: [0x8E 0xFE 0xFE 0xFF 0x00] +/** + * Variable-length integers: bytes are a MSB base-128 encoding of the number. + * The high bit in each byte signifies whether another digit follows. To make + * sure the encoding is one-to-one, one is subtracted from all but the last digit. + * Thus, the byte sequence a[] with length len, where all but the last byte + * has bit 128 set, encodes the number: + * + * (a[len-1] & 0x7F) + sum(i=1..len-1, 128^i*((a[len-i-1] & 0x7F)+1)) + * + * Properties: + * * Very small (0-127: 1 byte, 128-16511: 2 bytes, 16512-2113663: 3 bytes) + * * Every integer has exactly one encoding + * * Encoding does not depend on size of original integer type + * * No redundancy: every (infinite) byte sequence corresponds to a list + * of encoded integers. + * + * 0: [0x00] 256: [0x81 0x00] + * 1: [0x01] 16383: [0xFE 0x7F] + * 127: [0x7F] 16384: [0xFF 0x00] + * 128: [0x80 0x00] 16511: [0x80 0xFF 0x7F] + * 255: [0x80 0x7F] 65535: [0x82 0xFD 0x7F] + * 2^32: [0x8E 0xFE 0xFE 0xFF 0x00] + */ template inline unsigned int GetSizeOfVarInt(I n) @@ -317,7 +326,8 @@ I ReadVarInt(Stream& is) #define VARINT(obj) REF(WrapVarInt(REF(obj))) #define LIMITED_STRING(obj,n) REF(LimitedString< n >(REF(obj))) -/** Wrapper for serializing arrays and POD. +/** + * Wrapper for serializing arrays and POD. */ class CFlatData { @@ -415,17 +425,21 @@ public: template CVarInt WrapVarInt(I& n) { return CVarInt(n); } -// -// Forward declarations -// +/** + * Forward declarations + */ -// string +/** + * string + */ template unsigned int GetSerializeSize(const std::basic_string& str, int, int=0); template void Serialize(Stream& os, const std::basic_string& str, int, int=0); template void Unserialize(Stream& is, std::basic_string& str, int, int=0); -// vector -// vectors of unsigned char are a special case and are intended to be serialized as a single opaque blob. +/** + * vector + * vectors of unsigned char are a special case and are intended to be serialized as a single opaque blob. + */ template unsigned int GetSerializeSize_impl(const std::vector& v, int nType, int nVersion, const unsigned char&); template unsigned int GetSerializeSize_impl(const std::vector& v, int nType, int nVersion, const V&); template inline unsigned int GetSerializeSize(const std::vector& v, int nType, int nVersion); @@ -436,22 +450,30 @@ template void Unserialize_impl(Stream& template void Unserialize_impl(Stream& is, std::vector& v, int nType, int nVersion, const V&); template inline void Unserialize(Stream& is, std::vector& v, int nType, int nVersion); -// others derived from vector +/** + * others derived from vector + */ extern inline unsigned int GetSerializeSize(const CScript& v, int nType, int nVersion); template void Serialize(Stream& os, const CScript& v, int nType, int nVersion); template void Unserialize(Stream& is, CScript& v, int nType, int nVersion); -// pair +/** + * pair + */ template unsigned int GetSerializeSize(const std::pair& item, int nType, int nVersion); template void Serialize(Stream& os, const std::pair& item, int nType, int nVersion); template void Unserialize(Stream& is, std::pair& item, int nType, int nVersion); -// map +/** + * map + */ template unsigned int GetSerializeSize(const std::map& m, int nType, int nVersion); template void Serialize(Stream& os, const std::map& m, int nType, int nVersion); template void Unserialize(Stream& is, std::map& m, int nType, int nVersion); -// set +/** + * set + */ template unsigned int GetSerializeSize(const std::set& m, int nType, int nVersion); template void Serialize(Stream& os, const std::set& m, int nType, int nVersion); template void Unserialize(Stream& is, std::set& m, int nType, int nVersion); @@ -460,12 +482,12 @@ template void Unserializ -// -// If none of the specialized versions above matched, default to calling member function. -// "int nType" is changed to "long nType" to keep from getting an ambiguous overload error. -// The compiler will only cast int to long if none of the other templates matched. -// Thanks to Boost serialization for this idea. -// +/** + * If none of the specialized versions above matched, default to calling member function. + * "int nType" is changed to "long nType" to keep from getting an ambiguous overload error. + * The compiler will only cast int to long if none of the other templates matched. + * Thanks to Boost serialization for this idea. + */ template inline unsigned int GetSerializeSize(const T& a, long nType, int nVersion) { @@ -488,9 +510,9 @@ inline void Unserialize(Stream& is, T& a, long nType, int nVersion) -// -// string -// +/** + * string + */ template unsigned int GetSerializeSize(const std::basic_string& str, int, int) { @@ -516,9 +538,9 @@ void Unserialize(Stream& is, std::basic_string& str, int, int) -// -// vector -// +/** + * vector + */ template unsigned int GetSerializeSize_impl(const std::vector& v, int nType, int nVersion, const unsigned char&) { @@ -606,9 +628,9 @@ inline void Unserialize(Stream& is, std::vector& v, int nType, int nVersio -// -// others derived from vector -// +/** + * others derived from vector + */ inline unsigned int GetSerializeSize(const CScript& v, int nType, int nVersion) { return GetSerializeSize((const std::vector&)v, nType, nVersion); @@ -628,9 +650,9 @@ void Unserialize(Stream& is, CScript& v, int nType, int nVersion) -// -// pair -// +/** + * pair + */ template unsigned int GetSerializeSize(const std::pair& item, int nType, int nVersion) { @@ -653,9 +675,9 @@ void Unserialize(Stream& is, std::pair& item, int nType, int nVersion) -// -// map -// +/** + * map + */ template unsigned int GetSerializeSize(const std::map& m, int nType, int nVersion) { @@ -689,9 +711,9 @@ void Unserialize(Stream& is, std::map& m, int nType, int nVersion -// -// set -// +/** + * set + */ template unsigned int GetSerializeSize(const std::set& m, int nType, int nVersion) { @@ -725,9 +747,9 @@ void Unserialize(Stream& is, std::set& m, int nType, int nVersion) -// -// Support for ADD_SERIALIZE_METHODS and READWRITE macro -// +/** + * Support for ADD_SERIALIZE_METHODS and READWRITE macro + */ struct CSerActionSerialize { bool ForRead() const { return false; } From 900078aeb4088b63ee271e774a00ccd126628528 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 21 Oct 2014 16:05:51 -0400 Subject: [PATCH 0965/1288] boost: moveonly: create eccryptoverify.h|cpp and move helper functions there Eventually (after 0.10) these files will hold the logic for crypto verification routines, and CKey/CPubKey will call into them. --- src/Makefile.am | 2 ++ src/eccryptoverify.cpp | 63 ++++++++++++++++++++++++++++++++++++++ src/eccryptoverify.h | 19 ++++++++++++ src/key.cpp | 53 ++------------------------------ src/script/interpreter.cpp | 3 +- 5 files changed, 88 insertions(+), 52 deletions(-) create mode 100644 src/eccryptoverify.cpp create mode 100644 src/eccryptoverify.h diff --git a/src/Makefile.am b/src/Makefile.am index 8253c4ab14..c9adf859f4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -86,6 +86,7 @@ BITCOIN_CORE_H = \ core_io.h \ crypter.h \ db.h \ + eccryptoverify.h \ ecwrapper.h \ hash.h \ init.h \ @@ -220,6 +221,7 @@ libbitcoin_common_a_SOURCES = \ core/transaction.cpp \ core_read.cpp \ core_write.cpp \ + eccryptoverify.cpp \ ecwrapper.cpp \ hash.cpp \ key.cpp \ diff --git a/src/eccryptoverify.cpp b/src/eccryptoverify.cpp new file mode 100644 index 0000000000..0a904f44ba --- /dev/null +++ b/src/eccryptoverify.cpp @@ -0,0 +1,63 @@ +#include "eccryptoverify.h" + +namespace { + +int CompareBigEndian(const unsigned char *c1, size_t c1len, const unsigned char *c2, size_t c2len) { + while (c1len > c2len) { + if (*c1) + return 1; + c1++; + c1len--; + } + while (c2len > c1len) { + if (*c2) + return -1; + c2++; + c2len--; + } + while (c1len > 0) { + if (*c1 > *c2) + return 1; + if (*c2 > *c1) + return -1; + c1++; + c2++; + c1len--; + } + return 0; +} + +/** Order of secp256k1's generator minus 1. */ +const unsigned char vchMaxModOrder[32] = { + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE, + 0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B, + 0xBF,0xD2,0x5E,0x8C,0xD0,0x36,0x41,0x40 +}; + +/** Half of the order of secp256k1's generator minus 1. */ +const unsigned char vchMaxModHalfOrder[32] = { + 0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0x5D,0x57,0x6E,0x73,0x57,0xA4,0x50,0x1D, + 0xDF,0xE9,0x2F,0x46,0x68,0x1B,0x20,0xA0 +}; + +const unsigned char vchZero[1] = {0}; +} // anon namespace + +namespace eccrypto { + +bool Check(const unsigned char *vch) { + return vch && + CompareBigEndian(vch, 32, vchZero, 0) > 0 && + CompareBigEndian(vch, 32, vchMaxModOrder, 32) <= 0; +} + +bool CheckSignatureElement(const unsigned char *vch, int len, bool half) { + return vch && + CompareBigEndian(vch, len, vchZero, 0) > 0 && + CompareBigEndian(vch, len, half ? vchMaxModHalfOrder : vchMaxModOrder, 32) <= 0; +} + +} // namespace eccrypto diff --git a/src/eccryptoverify.h b/src/eccryptoverify.h new file mode 100644 index 0000000000..7740e31db1 --- /dev/null +++ b/src/eccryptoverify.h @@ -0,0 +1,19 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2013 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_EC_CRYPTO_VERIFY_H +#define BITCOIN_EC_CRYPTO_VERIFY_H + +#include +#include +class uint256; + +namespace eccrypto { + +bool Check(const unsigned char *vch); +bool CheckSignatureElement(const unsigned char *vch, int len, bool half); + +} // eccrypto namespace +#endif diff --git a/src/key.cpp b/src/key.cpp index c466e84f26..925b80ba0f 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -5,6 +5,7 @@ #include "key.h" #include "crypto/sha2.h" +#include "eccryptoverify.h" #include "random.h" #ifdef USE_SECP256K1 @@ -30,60 +31,10 @@ public: static CSecp256k1Init instance_of_csecp256k1; #endif - -int CompareBigEndian(const unsigned char *c1, size_t c1len, const unsigned char *c2, size_t c2len) { - while (c1len > c2len) { - if (*c1) - return 1; - c1++; - c1len--; - } - while (c2len > c1len) { - if (*c2) - return -1; - c2++; - c2len--; - } - while (c1len > 0) { - if (*c1 > *c2) - return 1; - if (*c2 > *c1) - return -1; - c1++; - c2++; - c1len--; - } - return 0; -} - -/** Order of secp256k1's generator minus 1. */ -const unsigned char vchMaxModOrder[32] = { - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE, - 0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B, - 0xBF,0xD2,0x5E,0x8C,0xD0,0x36,0x41,0x40 -}; - -/** Half of the order of secp256k1's generator minus 1. */ -const unsigned char vchMaxModHalfOrder[32] = { - 0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0x5D,0x57,0x6E,0x73,0x57,0xA4,0x50,0x1D, - 0xDF,0xE9,0x2F,0x46,0x68,0x1B,0x20,0xA0 -}; - -const unsigned char vchZero[1] = {0}; - } // anon namespace bool CKey::Check(const unsigned char *vch) { - return CompareBigEndian(vch, 32, vchZero, 0) > 0 && - CompareBigEndian(vch, 32, vchMaxModOrder, 32) <= 0; -} - -bool CKey::CheckSignatureElement(const unsigned char *vch, int len, bool half) { - return CompareBigEndian(vch, len, vchZero, 0) > 0 && - CompareBigEndian(vch, len, half ? vchMaxModHalfOrder : vchMaxModOrder, 32) <= 0; + return eccrypto::Check(vch); } void CKey::MakeNewKey(bool fCompressedIn) { diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 3625972ebf..e1e242882f 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -9,6 +9,7 @@ #include "crypto/ripemd160.h" #include "crypto/sha1.h" #include "crypto/sha2.h" +#include "eccryptoverify.h" #include "key.h" #include "script/script.h" #include "uint256.h" @@ -122,7 +123,7 @@ bool static IsLowDERSignature(const valtype &vchSig) { // If the S value is above the order of the curve divided by two, its // complement modulo the order could have been used instead, which is // one byte shorter when encoded correctly. - if (!CKey::CheckSignatureElement(S, nLenS, true)) + if (!eccrypto::CheckSignatureElement(S, nLenS, true)) return error("Non-canonical signature: S value is unnecessarily high"); return true; From 78c228c6e5f35b6f2e1917d8677694779f837618 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 28 Oct 2014 17:35:24 -0400 Subject: [PATCH 0966/1288] boost: moveonly: move BIP32Hash to hash.h --- src/hash.cpp | 13 +++++++++++++ src/hash.h | 1 + src/key.cpp | 12 ------------ 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/hash.cpp b/src/hash.cpp index 218607a6fd..29376b45aa 100644 --- a/src/hash.cpp +++ b/src/hash.cpp @@ -63,3 +63,16 @@ unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector> 24) & 0xFF; + num[1] = (nChild >> 16) & 0xFF; + num[2] = (nChild >> 8) & 0xFF; + num[3] = (nChild >> 0) & 0xFF; + CHMAC_SHA512(chainCode, 32).Write(&header, 1) + .Write(data, 32) + .Write(num, 4) + .Finalize(output); +} diff --git a/src/hash.h b/src/hash.h index bdcd4afb47..53a7672a8f 100644 --- a/src/hash.h +++ b/src/hash.h @@ -159,4 +159,5 @@ uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=PROTOCOL unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector& vDataToHash); +void BIP32Hash(const unsigned char chainCode[32], unsigned int nChild, unsigned char header, const unsigned char data[32], unsigned char output[64]); #endif // BITCOIN_HASH_H diff --git a/src/key.cpp b/src/key.cpp index 925b80ba0f..2369aa2521 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -237,18 +237,6 @@ bool CPubKey::Decompress() { return true; } -void static BIP32Hash(const unsigned char chainCode[32], unsigned int nChild, unsigned char header, const unsigned char data[32], unsigned char output[64]) { - unsigned char num[4]; - num[0] = (nChild >> 24) & 0xFF; - num[1] = (nChild >> 16) & 0xFF; - num[2] = (nChild >> 8) & 0xFF; - num[3] = (nChild >> 0) & 0xFF; - CHMAC_SHA512(chainCode, 32).Write(&header, 1) - .Write(data, 32) - .Write(num, 4) - .Finalize(output); -} - bool CKey::Derive(CKey& keyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const { assert(IsValid()); assert(IsCompressed()); From d2e74c55bdd8cee6a0cca49aca0e2ab1a182c9b5 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 28 Oct 2014 17:47:18 -0400 Subject: [PATCH 0967/1288] boost: moveonly: split CPubKey and friends to new files --- src/Makefile.am | 2 + src/alert.cpp | 2 +- src/base58.h | 1 + src/bloom.cpp | 1 + src/compressor.cpp | 2 +- src/key.cpp | 118 +------------------ src/key.h | 185 +----------------------------- src/keystore.h | 1 + src/pubkey.cpp | 131 +++++++++++++++++++++ src/pubkey.h | 206 ++++++++++++++++++++++++++++++++++ src/script/interpreter.cpp | 2 +- src/script/sigcache.cpp | 2 +- src/script/standard.cpp | 1 + src/script/standard.h | 4 +- src/test/miner_tests.cpp | 1 + src/test/sigopcount_tests.cpp | 1 + src/wallet_ismine.cpp | 1 + 17 files changed, 356 insertions(+), 305 deletions(-) create mode 100644 src/pubkey.cpp create mode 100644 src/pubkey.h diff --git a/src/Makefile.am b/src/Makefile.am index c9adf859f4..3089b2ff40 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -102,6 +102,7 @@ BITCOIN_CORE_H = \ noui.h \ pow.h \ protocol.h \ + pubkey.h \ random.h \ rpcclient.h \ rpcprotocol.h \ @@ -228,6 +229,7 @@ libbitcoin_common_a_SOURCES = \ keystore.cpp \ netbase.cpp \ protocol.cpp \ + pubkey.cpp \ script/interpreter.cpp \ script/script.cpp \ script/sigcache.cpp \ diff --git a/src/alert.cpp b/src/alert.cpp index f16898dc38..ee8c496691 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -7,7 +7,7 @@ #include "chainparams.h" #include "clientversion.h" -#include "key.h" +#include "pubkey.h" #include "net.h" #include "timedata.h" #include "ui_interface.h" diff --git a/src/base58.h b/src/base58.h index c5e230c72e..7cd2d651a1 100644 --- a/src/base58.h +++ b/src/base58.h @@ -16,6 +16,7 @@ #include "chainparams.h" #include "key.h" +#include "pubkey.h" #include "script/script.h" #include "script/standard.h" diff --git a/src/bloom.cpp b/src/bloom.cpp index c1e7aeb3bf..df8cedaf6a 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -5,6 +5,7 @@ #include "bloom.h" #include "core/transaction.h" +#include "hash.h" #include "script/script.h" #include "script/standard.h" #include "streams.h" diff --git a/src/compressor.cpp b/src/compressor.cpp index 806175dd3e..c47a0f6f8c 100644 --- a/src/compressor.cpp +++ b/src/compressor.cpp @@ -6,7 +6,7 @@ #include "compressor.h" #include "hash.h" -#include "key.h" +#include "pubkey.h" #include "script/standard.h" bool CScriptCompressor::IsToKeyID(CKeyID &hash) const diff --git a/src/key.cpp b/src/key.cpp index 2369aa2521..1b539d073a 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -6,6 +6,7 @@ #include "crypto/sha2.h" #include "eccryptoverify.h" +#include "pubkey.h" #include "random.h" #ifdef USE_SECP256K1 @@ -167,76 +168,6 @@ bool CKey::Load(CPrivKey &privkey, CPubKey &vchPubKey, bool fSkipCheck=false) { return true; } -bool CPubKey::Verify(const uint256 &hash, const std::vector& vchSig) const { - if (!IsValid()) - return false; -#ifdef USE_SECP256K1 - if (secp256k1_ecdsa_verify((const unsigned char*)&hash, 32, &vchSig[0], vchSig.size(), begin(), size()) != 1) - return false; -#else - CECKey key; - if (!key.SetPubKey(begin(), size())) - return false; - if (!key.Verify(hash, vchSig)) - return false; -#endif - return true; -} - -bool CPubKey::RecoverCompact(const uint256 &hash, const std::vector& vchSig) { - if (vchSig.size() != 65) - return false; - int recid = (vchSig[0] - 27) & 3; - bool fComp = ((vchSig[0] - 27) & 4) != 0; -#ifdef USE_SECP256K1 - int pubkeylen = 65; - if (!secp256k1_ecdsa_recover_compact((const unsigned char*)&hash, 32, &vchSig[1], (unsigned char*)begin(), &pubkeylen, fComp, recid)) - return false; - assert((int)size() == pubkeylen); -#else - CECKey key; - if (!key.Recover(hash, &vchSig[1], recid)) - return false; - std::vector pubkey; - key.GetPubKey(pubkey, fComp); - Set(pubkey.begin(), pubkey.end()); -#endif - return true; -} - -bool CPubKey::IsFullyValid() const { - if (!IsValid()) - return false; -#ifdef USE_SECP256K1 - if (!secp256k1_ecdsa_pubkey_verify(begin(), size())) - return false; -#else - CECKey key; - if (!key.SetPubKey(begin(), size())) - return false; -#endif - return true; -} - -bool CPubKey::Decompress() { - if (!IsValid()) - return false; -#ifdef USE_SECP256K1 - int clen = size(); - int ret = secp256k1_ecdsa_pubkey_decompress((unsigned char*)begin(), &clen); - assert(ret); - assert(clen == (int)size()); -#else - CECKey key; - if (!key.SetPubKey(begin(), size())) - return false; - std::vector pubkey; - key.GetPubKey(pubkey, false); - Set(pubkey.begin(), pubkey.end()); -#endif - return true; -} - bool CKey::Derive(CKey& keyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const { assert(IsValid()); assert(IsCompressed()); @@ -263,27 +194,6 @@ bool CKey::Derive(CKey& keyChild, unsigned char ccChild[32], unsigned int nChild return ret; } -bool CPubKey::Derive(CPubKey& pubkeyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const { - assert(IsValid()); - assert((nChild >> 31) == 0); - assert(begin() + 33 == end()); - unsigned char out[64]; - BIP32Hash(cc, nChild, *begin(), begin()+1, out); - memcpy(ccChild, out+32, 32); -#ifdef USE_SECP256K1 - pubkeyChild = *this; - bool ret = secp256k1_ecdsa_pubkey_tweak_add((unsigned char*)pubkeyChild.begin(), pubkeyChild.size(), out); -#else - CECKey key; - bool ret = key.SetPubKey(begin(), size()); - ret &= key.TweakPublic(out); - std::vector pubkey; - key.GetPubKey(pubkey, true); - pubkeyChild.Set(pubkey.begin(), pubkey.end()); -#endif - return ret; -} - bool CExtKey::Derive(CExtKey &out, unsigned int nChild) const { out.nDepth = nDepth + 1; CKeyID id = key.GetPubKey().GetID(); @@ -334,32 +244,6 @@ void CExtKey::Decode(const unsigned char code[74]) { key.Set(code+42, code+74, true); } -void CExtPubKey::Encode(unsigned char code[74]) const { - code[0] = nDepth; - memcpy(code+1, vchFingerprint, 4); - code[5] = (nChild >> 24) & 0xFF; code[6] = (nChild >> 16) & 0xFF; - code[7] = (nChild >> 8) & 0xFF; code[8] = (nChild >> 0) & 0xFF; - memcpy(code+9, vchChainCode, 32); - assert(pubkey.size() == 33); - memcpy(code+41, pubkey.begin(), 33); -} - -void CExtPubKey::Decode(const unsigned char code[74]) { - nDepth = code[0]; - memcpy(vchFingerprint, code+1, 4); - nChild = (code[5] << 24) | (code[6] << 16) | (code[7] << 8) | code[8]; - memcpy(vchChainCode, code+9, 32); - pubkey.Set(code+41, code+74); -} - -bool CExtPubKey::Derive(CExtPubKey &out, unsigned int nChild) const { - out.nDepth = nDepth + 1; - CKeyID id = pubkey.GetID(); - memcpy(&out.vchFingerprint[0], &id, 4); - out.nChild = nChild; - return pubkey.Derive(out.pubkey, out.vchChainCode, nChild, vchChainCode); -} - bool ECC_InitSanityCheck() { #ifdef USE_SECP256K1 return true; diff --git a/src/key.h b/src/key.h index b4cb647681..b35cf0cad5 100644 --- a/src/key.h +++ b/src/key.h @@ -7,13 +7,15 @@ #define BITCOIN_KEY_H #include "allocators.h" -#include "hash.h" #include "serialize.h" #include "uint256.h" #include #include +class CPubKey; +class CExtPubKey; + /** * secp256k1: * const unsigned int PRIVATE_KEY_SIZE = 279; @@ -24,169 +26,6 @@ * script supports up to 75 for single byte push */ -/** A reference to a CKey: the Hash160 of its serialized public key */ -class CKeyID : public uint160 -{ -public: - CKeyID() : uint160(0) {} - CKeyID(const uint160& in) : uint160(in) {} -}; - -/** An encapsulated public key. */ -class CPubKey -{ -private: - - /** - * Just store the serialized data. - * Its length can very cheaply be computed from the first byte. - */ - unsigned char vch[65]; - - //! Compute the length of a pubkey with a given first byte. - unsigned int static GetLen(unsigned char chHeader) - { - if (chHeader == 2 || chHeader == 3) - return 33; - if (chHeader == 4 || chHeader == 6 || chHeader == 7) - return 65; - return 0; - } - - //! Set this key data to be invalid - void Invalidate() - { - vch[0] = 0xFF; - } - -public: - //! Construct an invalid public key. - CPubKey() - { - Invalidate(); - } - - //! Initialize a public key using begin/end iterators to byte data. - template - void Set(const T pbegin, const T pend) - { - int len = pend == pbegin ? 0 : GetLen(pbegin[0]); - if (len && len == (pend - pbegin)) - memcpy(vch, (unsigned char*)&pbegin[0], len); - else - Invalidate(); - } - - //! Construct a public key using begin/end iterators to byte data. - template - CPubKey(const T pbegin, const T pend) - { - Set(pbegin, pend); - } - - //! Construct a public key from a byte vector. - CPubKey(const std::vector& vch) - { - Set(vch.begin(), vch.end()); - } - - //! Simple read-only vector-like interface to the pubkey data. - unsigned int size() const { return GetLen(vch[0]); } - const unsigned char* begin() const { return vch; } - const unsigned char* end() const { return vch + size(); } - const unsigned char& operator[](unsigned int pos) const { return vch[pos]; } - - //! Comparator implementation. - friend bool operator==(const CPubKey& a, const CPubKey& b) - { - return a.vch[0] == b.vch[0] && - memcmp(a.vch, b.vch, a.size()) == 0; - } - friend bool operator!=(const CPubKey& a, const CPubKey& b) - { - return !(a == b); - } - friend bool operator<(const CPubKey& a, const CPubKey& b) - { - return a.vch[0] < b.vch[0] || - (a.vch[0] == b.vch[0] && memcmp(a.vch, b.vch, a.size()) < 0); - } - - //! Implement serialization, as if this was a byte vector. - unsigned int GetSerializeSize(int nType, int nVersion) const - { - return size() + 1; - } - template - void Serialize(Stream& s, int nType, int nVersion) const - { - unsigned int len = size(); - ::WriteCompactSize(s, len); - s.write((char*)vch, len); - } - template - void Unserialize(Stream& s, int nType, int nVersion) - { - unsigned int len = ::ReadCompactSize(s); - if (len <= 65) { - s.read((char*)vch, len); - } else { - // invalid pubkey, skip available data - char dummy; - while (len--) - s.read(&dummy, 1); - Invalidate(); - } - } - - //! Get the KeyID of this public key (hash of its serialization) - CKeyID GetID() const - { - return CKeyID(Hash160(vch, vch + size())); - } - - //! Get the 256-bit hash of this public key. - uint256 GetHash() const - { - return Hash(vch, vch + size()); - } - - /* - * Check syntactic correctness. - * - * Note that this is consensus critical as CheckSig() calls it! - */ - bool IsValid() const - { - return size() > 0; - } - - //! fully validate whether this is a valid public key (more expensive than IsValid()) - bool IsFullyValid() const; - - //! Check whether this is a compressed public key. - bool IsCompressed() const - { - return size() == 33; - } - - /** - * Verify a DER signature (~72 bytes). - * If this public key is not fully valid, the return value will be false. - */ - bool Verify(const uint256& hash, const std::vector& vchSig) const; - - //! Recover a public key from a compact signature. - bool RecoverCompact(const uint256& hash, const std::vector& vchSig); - - //! Turn this public key into an uncompressed public key. - bool Decompress(); - - //! Derive BIP32 child pubkey. - bool Derive(CPubKey& pubkeyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const; -}; - - /** * secure_allocator is defined in allocators.h * CPrivKey is a serialized private key, with all parameters included (279 bytes) @@ -304,24 +143,6 @@ public: static bool CheckSignatureElement(const unsigned char* vch, int len, bool half); }; -struct CExtPubKey { - unsigned char nDepth; - unsigned char vchFingerprint[4]; - unsigned int nChild; - unsigned char vchChainCode[32]; - CPubKey pubkey; - - friend bool operator==(const CExtPubKey& a, const CExtPubKey& b) - { - return a.nDepth == b.nDepth && memcmp(&a.vchFingerprint[0], &b.vchFingerprint[0], 4) == 0 && a.nChild == b.nChild && - memcmp(&a.vchChainCode[0], &b.vchChainCode[0], 32) == 0 && a.pubkey == b.pubkey; - } - - void Encode(unsigned char code[74]) const; - void Decode(const unsigned char code[74]); - bool Derive(CExtPubKey& out, unsigned int nChild) const; -}; - struct CExtKey { unsigned char nDepth; unsigned char vchFingerprint[4]; diff --git a/src/keystore.h b/src/keystore.h index 66f8771d4a..60502e9a29 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -7,6 +7,7 @@ #define BITCOIN_KEYSTORE_H #include "key.h" +#include "pubkey.h" #include "sync.h" #include diff --git a/src/pubkey.cpp b/src/pubkey.cpp new file mode 100644 index 0000000000..3f16a4b4be --- /dev/null +++ b/src/pubkey.cpp @@ -0,0 +1,131 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "pubkey.h" + +#include "crypto/sha2.h" +#include "eccryptoverify.h" + +#ifdef USE_SECP256K1 +#include +#else +#include "ecwrapper.h" +#endif + +bool CPubKey::Verify(const uint256 &hash, const std::vector& vchSig) const { + if (!IsValid()) + return false; +#ifdef USE_SECP256K1 + if (secp256k1_ecdsa_verify((const unsigned char*)&hash, 32, &vchSig[0], vchSig.size(), begin(), size()) != 1) + return false; +#else + CECKey key; + if (!key.SetPubKey(begin(), size())) + return false; + if (!key.Verify(hash, vchSig)) + return false; +#endif + return true; +} + +bool CPubKey::RecoverCompact(const uint256 &hash, const std::vector& vchSig) { + if (vchSig.size() != 65) + return false; + int recid = (vchSig[0] - 27) & 3; + bool fComp = ((vchSig[0] - 27) & 4) != 0; +#ifdef USE_SECP256K1 + int pubkeylen = 65; + if (!secp256k1_ecdsa_recover_compact((const unsigned char*)&hash, 32, &vchSig[1], (unsigned char*)begin(), &pubkeylen, fComp, recid)) + return false; + assert((int)size() == pubkeylen); +#else + CECKey key; + if (!key.Recover(hash, &vchSig[1], recid)) + return false; + std::vector pubkey; + key.GetPubKey(pubkey, fComp); + Set(pubkey.begin(), pubkey.end()); +#endif + return true; +} + +bool CPubKey::IsFullyValid() const { + if (!IsValid()) + return false; +#ifdef USE_SECP256K1 + if (!secp256k1_ecdsa_pubkey_verify(begin(), size())) + return false; +#else + CECKey key; + if (!key.SetPubKey(begin(), size())) + return false; +#endif + return true; +} + +bool CPubKey::Decompress() { + if (!IsValid()) + return false; +#ifdef USE_SECP256K1 + int clen = size(); + int ret = secp256k1_ecdsa_pubkey_decompress((unsigned char*)begin(), &clen); + assert(ret); + assert(clen == (int)size()); +#else + CECKey key; + if (!key.SetPubKey(begin(), size())) + return false; + std::vector pubkey; + key.GetPubKey(pubkey, false); + Set(pubkey.begin(), pubkey.end()); +#endif + return true; +} + +bool CPubKey::Derive(CPubKey& pubkeyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const { + assert(IsValid()); + assert((nChild >> 31) == 0); + assert(begin() + 33 == end()); + unsigned char out[64]; + BIP32Hash(cc, nChild, *begin(), begin()+1, out); + memcpy(ccChild, out+32, 32); +#ifdef USE_SECP256K1 + pubkeyChild = *this; + bool ret = secp256k1_ecdsa_pubkey_tweak_add((unsigned char*)pubkeyChild.begin(), pubkeyChild.size(), out); +#else + CECKey key; + bool ret = key.SetPubKey(begin(), size()); + ret &= key.TweakPublic(out); + std::vector pubkey; + key.GetPubKey(pubkey, true); + pubkeyChild.Set(pubkey.begin(), pubkey.end()); +#endif + return ret; +} + +void CExtPubKey::Encode(unsigned char code[74]) const { + code[0] = nDepth; + memcpy(code+1, vchFingerprint, 4); + code[5] = (nChild >> 24) & 0xFF; code[6] = (nChild >> 16) & 0xFF; + code[7] = (nChild >> 8) & 0xFF; code[8] = (nChild >> 0) & 0xFF; + memcpy(code+9, vchChainCode, 32); + assert(pubkey.size() == 33); + memcpy(code+41, pubkey.begin(), 33); +} + +void CExtPubKey::Decode(const unsigned char code[74]) { + nDepth = code[0]; + memcpy(vchFingerprint, code+1, 4); + nChild = (code[5] << 24) | (code[6] << 16) | (code[7] << 8) | code[8]; + memcpy(vchChainCode, code+9, 32); + pubkey.Set(code+41, code+74); +} + +bool CExtPubKey::Derive(CExtPubKey &out, unsigned int nChild) const { + out.nDepth = nDepth + 1; + CKeyID id = pubkey.GetID(); + memcpy(&out.vchFingerprint[0], &id, 4); + out.nChild = nChild; + return pubkey.Derive(out.pubkey, out.vchChainCode, nChild, vchChainCode); +} diff --git a/src/pubkey.h b/src/pubkey.h new file mode 100644 index 0000000000..ccf9673453 --- /dev/null +++ b/src/pubkey.h @@ -0,0 +1,206 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2013 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_PUBKEY_H +#define BITCOIN_PUBKEY_H + +#include "hash.h" +#include "serialize.h" +#include "uint256.h" + +#include +#include + +/** + * secp256k1: + * const unsigned int PRIVATE_KEY_SIZE = 279; + * const unsigned int PUBLIC_KEY_SIZE = 65; + * const unsigned int SIGNATURE_SIZE = 72; + * + * see www.keylength.com + * script supports up to 75 for single byte push + */ + +/** A reference to a CKey: the Hash160 of its serialized public key */ +class CKeyID : public uint160 +{ +public: + CKeyID() : uint160(0) {} + CKeyID(const uint160& in) : uint160(in) {} +}; + +/** An encapsulated public key. */ +class CPubKey +{ +private: + + /** + * Just store the serialized data. + * Its length can very cheaply be computed from the first byte. + */ + unsigned char vch[65]; + + //! Compute the length of a pubkey with a given first byte. + unsigned int static GetLen(unsigned char chHeader) + { + if (chHeader == 2 || chHeader == 3) + return 33; + if (chHeader == 4 || chHeader == 6 || chHeader == 7) + return 65; + return 0; + } + + //! Set this key data to be invalid + void Invalidate() + { + vch[0] = 0xFF; + } + +public: + //! Construct an invalid public key. + CPubKey() + { + Invalidate(); + } + + //! Initialize a public key using begin/end iterators to byte data. + template + void Set(const T pbegin, const T pend) + { + int len = pend == pbegin ? 0 : GetLen(pbegin[0]); + if (len && len == (pend - pbegin)) + memcpy(vch, (unsigned char*)&pbegin[0], len); + else + Invalidate(); + } + + //! Construct a public key using begin/end iterators to byte data. + template + CPubKey(const T pbegin, const T pend) + { + Set(pbegin, pend); + } + + //! Construct a public key from a byte vector. + CPubKey(const std::vector& vch) + { + Set(vch.begin(), vch.end()); + } + + //! Simple read-only vector-like interface to the pubkey data. + unsigned int size() const { return GetLen(vch[0]); } + const unsigned char* begin() const { return vch; } + const unsigned char* end() const { return vch + size(); } + const unsigned char& operator[](unsigned int pos) const { return vch[pos]; } + + //! Comparator implementation. + friend bool operator==(const CPubKey& a, const CPubKey& b) + { + return a.vch[0] == b.vch[0] && + memcmp(a.vch, b.vch, a.size()) == 0; + } + friend bool operator!=(const CPubKey& a, const CPubKey& b) + { + return !(a == b); + } + friend bool operator<(const CPubKey& a, const CPubKey& b) + { + return a.vch[0] < b.vch[0] || + (a.vch[0] == b.vch[0] && memcmp(a.vch, b.vch, a.size()) < 0); + } + + //! Implement serialization, as if this was a byte vector. + unsigned int GetSerializeSize(int nType, int nVersion) const + { + return size() + 1; + } + template + void Serialize(Stream& s, int nType, int nVersion) const + { + unsigned int len = size(); + ::WriteCompactSize(s, len); + s.write((char*)vch, len); + } + template + void Unserialize(Stream& s, int nType, int nVersion) + { + unsigned int len = ::ReadCompactSize(s); + if (len <= 65) { + s.read((char*)vch, len); + } else { + // invalid pubkey, skip available data + char dummy; + while (len--) + s.read(&dummy, 1); + Invalidate(); + } + } + + //! Get the KeyID of this public key (hash of its serialization) + CKeyID GetID() const + { + return CKeyID(Hash160(vch, vch + size())); + } + + //! Get the 256-bit hash of this public key. + uint256 GetHash() const + { + return Hash(vch, vch + size()); + } + + /* + * Check syntactic correctness. + * + * Note that this is consensus critical as CheckSig() calls it! + */ + bool IsValid() const + { + return size() > 0; + } + + //! fully validate whether this is a valid public key (more expensive than IsValid()) + bool IsFullyValid() const; + + //! Check whether this is a compressed public key. + bool IsCompressed() const + { + return size() == 33; + } + + /** + * Verify a DER signature (~72 bytes). + * If this public key is not fully valid, the return value will be false. + */ + bool Verify(const uint256& hash, const std::vector& vchSig) const; + + //! Recover a public key from a compact signature. + bool RecoverCompact(const uint256& hash, const std::vector& vchSig); + + //! Turn this public key into an uncompressed public key. + bool Decompress(); + + //! Derive BIP32 child pubkey. + bool Derive(CPubKey& pubkeyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const; +}; + +struct CExtPubKey { + unsigned char nDepth; + unsigned char vchFingerprint[4]; + unsigned int nChild; + unsigned char vchChainCode[32]; + CPubKey pubkey; + + friend bool operator==(const CExtPubKey& a, const CExtPubKey& b) + { + return a.nDepth == b.nDepth && memcmp(&a.vchFingerprint[0], &b.vchFingerprint[0], 4) == 0 && a.nChild == b.nChild && + memcmp(&a.vchChainCode[0], &b.vchChainCode[0], 32) == 0 && a.pubkey == b.pubkey; + } + + void Encode(unsigned char code[74]) const; + void Decode(const unsigned char code[74]); + bool Derive(CExtPubKey& out, unsigned int nChild) const; +}; + +#endif // BITCOIN_PUBKEY_H diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index e1e242882f..54c2847f79 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -10,7 +10,7 @@ #include "crypto/sha1.h" #include "crypto/sha2.h" #include "eccryptoverify.h" -#include "key.h" +#include "pubkey.h" #include "script/script.h" #include "uint256.h" #include "util.h" diff --git a/src/script/sigcache.cpp b/src/script/sigcache.cpp index ab366898d8..d76a5acd63 100644 --- a/src/script/sigcache.cpp +++ b/src/script/sigcache.cpp @@ -5,7 +5,7 @@ #include "sigcache.h" -#include "key.h" +#include "pubkey.h" #include "random.h" #include "uint256.h" #include "util.h" diff --git a/src/script/standard.cpp b/src/script/standard.cpp index 05938961bc..9cae0508e1 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -5,6 +5,7 @@ #include "script/standard.h" +#include "pubkey.h" #include "script/script.h" #include "util.h" #include "utilstrencodings.h" diff --git a/src/script/standard.h b/src/script/standard.h index 248b941a64..171178ce3d 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -6,8 +6,7 @@ #ifndef H_BITCOIN_SCRIPT_STANDARD #define H_BITCOIN_SCRIPT_STANDARD -#include "key.h" -#include "script/script.h" +#include "uint256.h" #include "script/interpreter.h" #include @@ -15,6 +14,7 @@ #include class CScript; +class CKeyID; /** A reference to a CScript: the Hash160 of its serialization (see script.h) */ class CScriptID : public uint160 diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index 93b7fe189a..fa10ca1298 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -4,6 +4,7 @@ #include "main.h" #include "miner.h" +#include "pubkey.h" #include "uint256.h" #include "util.h" diff --git a/src/test/sigopcount_tests.cpp b/src/test/sigopcount_tests.cpp index 7b27703b62..5bf0862c71 100644 --- a/src/test/sigopcount_tests.cpp +++ b/src/test/sigopcount_tests.cpp @@ -2,6 +2,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include "pubkey.h" #include "key.h" #include "script/script.h" #include "script/standard.h" diff --git a/src/wallet_ismine.cpp b/src/wallet_ismine.cpp index 07149ebd0b..05dc40aaee 100644 --- a/src/wallet_ismine.cpp +++ b/src/wallet_ismine.cpp @@ -7,6 +7,7 @@ #include "key.h" #include "keystore.h" +#include "script/script.h" #include "script/standard.h" #include From 771d500283129cf19d14045a58d0e2fb0ce2cba1 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 31 Oct 2014 09:36:30 +0100 Subject: [PATCH 0968/1288] minor cleanup: include orders, end comments etc. - no code changes --- src/Makefile.test.include | 8 ++++---- src/ecwrapper.cpp | 2 +- src/ecwrapper.h | 4 ++-- src/main.h | 16 +++++++--------- src/qt/optionsdialog.h | 5 ++++- src/rpcblockchain.cpp | 2 +- src/rpcserver.h | 2 +- src/txmempool.cpp | 6 +++--- src/utilstrencodings.cpp | 4 ++-- 9 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 340eb9f1a7..6a8d9e58a4 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -42,8 +42,8 @@ BITCOIN_TESTS =\ test/bloom_tests.cpp \ test/checkblock_tests.cpp \ test/Checkpoints_tests.cpp \ - test/compress_tests.cpp \ test/coins_tests.cpp \ + test/compress_tests.cpp \ test/crypto_tests.cpp \ test/DoS_tests.cpp \ test/getarg_tests.cpp \ @@ -58,7 +58,9 @@ BITCOIN_TESTS =\ test/rpc_tests.cpp \ test/script_P2SH_tests.cpp \ test/script_tests.cpp \ + test/scriptnum_tests.cpp \ test/serialize_tests.cpp \ + test/sighash_tests.cpp \ test/sigopcount_tests.cpp \ test/skiplist_tests.cpp \ test/test_bitcoin.cpp \ @@ -66,9 +68,7 @@ BITCOIN_TESTS =\ test/transaction_tests.cpp \ test/uint256_tests.cpp \ test/univalue_tests.cpp \ - test/util_tests.cpp \ - test/scriptnum_tests.cpp \ - test/sighash_tests.cpp + test/util_tests.cpp if ENABLE_WALLET BITCOIN_TESTS += \ diff --git a/src/ecwrapper.cpp b/src/ecwrapper.cpp index e5db670927..ebaa350264 100644 --- a/src/ecwrapper.cpp +++ b/src/ecwrapper.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "ecwrapper.h" diff --git a/src/ecwrapper.h b/src/ecwrapper.h index 072da4a942..e2d1e7edc4 100644 --- a/src/ecwrapper.h +++ b/src/ecwrapper.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_EC_WRAPPER_H @@ -43,4 +43,4 @@ public: static bool SanityCheck(); }; -#endif +#endif // BITCOIN_EC_WRAPPER_H diff --git a/src/main.h b/src/main.h index 1941ca7059..e5ce924a48 100644 --- a/src/main.h +++ b/src/main.h @@ -39,8 +39,15 @@ #include class CBlockIndex; +class CBlockTreeDB; class CBloomFilter; class CInv; +class CScriptCheck; +class CValidationInterface; +class CValidationState; + +struct CBlockTemplate; +struct CNodeStateStats; /** The maximum allowed size for a serialized block, in bytes (network rule) */ static const unsigned int MAX_BLOCK_SIZE = 1000000; @@ -128,15 +135,6 @@ extern CBlockIndex *pindexBestHeader; // Minimum disk space required - used in CheckDiskSpace() static const uint64_t nMinDiskSpace = 52428800; - -class CBlockTreeDB; -class CScriptCheck; -class CValidationState; -class CValidationInterface; -struct CNodeStateStats; - -struct CBlockTemplate; - /** Register a wallet to receive updates from core */ void RegisterValidationInterface(CValidationInterface* pwalletIn); /** Unregister a wallet from core */ diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h index 39c53f4391..2abd92cae5 100644 --- a/src/qt/optionsdialog.h +++ b/src/qt/optionsdialog.h @@ -7,10 +7,13 @@ #include -class QDataWidgetMapper; class OptionsModel; class QValidatedLineEdit; +QT_BEGIN_NAMESPACE +class QDataWidgetMapper; +QT_END_NAMESPACE + namespace Ui { class OptionsDialog; } diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 78f5569895..a7cd63bd95 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -474,7 +474,7 @@ struct CompareBlocksByHeight bool operator()(const CBlockIndex* a, const CBlockIndex* b) const { /* Make sure that unequal blocks with the same height do not compare - equal. Use the pointers themselves to make a distinction. */ + equal. Use the pointers themselves to make a distinction. */ if (a->nHeight != b->nHeight) return (a->nHeight > b->nHeight); diff --git a/src/rpcserver.h b/src/rpcserver.h index cc444cef1f..dc46637399 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -7,8 +7,8 @@ #define _BITCOINRPC_SERVER_H_ #include "amount.h" -#include "uint256.h" #include "rpcprotocol.h" +#include "uint256.h" #include #include diff --git a/src/txmempool.cpp b/src/txmempool.cpp index d3d9cb8a01..b5070d5104 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -332,7 +332,7 @@ public: size_t numEntries; filein >> numEntries; if (numEntries <= 0 || numEntries > 10000) - throw runtime_error("Corrupt estimates file. Must have between 1 and 10k entires."); + throw runtime_error("Corrupt estimates file. Must have between 1 and 10k entires."); std::vector fileHistory; @@ -343,8 +343,8 @@ public: fileHistory.push_back(entry); } - //Now that we've processed the entire fee estimate data file and not - //thrown any errors, we can copy it to our history + // Now that we've processed the entire fee estimate data file and not + // thrown any errors, we can copy it to our history nBestSeenHeight = nFileBestSeenHeight; history = fileHistory; assert(history.size() > 0); diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index 81e156f43f..15094e5999 100644 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -7,10 +7,10 @@ #include "tinyformat.h" -#include -#include #include #include +#include +#include using namespace std; From 917b83127de0163f829cda48aa1c65f11b586faa Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 31 Oct 2014 11:19:05 +0100 Subject: [PATCH 0969/1288] qt: translations update from Transifex --- src/qt/locale/bitcoin_af_ZA.ts | 20 - src/qt/locale/bitcoin_ar.ts | 114 +- src/qt/locale/bitcoin_be_BY.ts | 178 ++- src/qt/locale/bitcoin_bg.ts | 68 -- src/qt/locale/bitcoin_ca.ts | 422 +++---- src/qt/locale/bitcoin_ca@valencia.ts | 640 +++++++---- src/qt/locale/bitcoin_ca_ES.ts | 274 +---- src/qt/locale/bitcoin_cs.ts | 278 +---- src/qt/locale/bitcoin_cy.ts | 8 - src/qt/locale/bitcoin_da.ts | 656 +++++------ src/qt/locale/bitcoin_de.ts | 474 ++++---- src/qt/locale/bitcoin_el_GR.ts | 166 +-- src/qt/locale/bitcoin_eo.ts | 162 +-- src/qt/locale/bitcoin_es.ts | 465 ++++---- src/qt/locale/bitcoin_es_CL.ts | 97 -- src/qt/locale/bitcoin_es_DO.ts | 179 +-- src/qt/locale/bitcoin_es_MX.ts | 4 - src/qt/locale/bitcoin_es_UY.ts | 8 - src/qt/locale/bitcoin_et.ts | 144 --- src/qt/locale/bitcoin_eu_ES.ts | 16 - src/qt/locale/bitcoin_fa.ts | 158 +-- src/qt/locale/bitcoin_fa_IR.ts | 56 - src/qt/locale/bitcoin_fi.ts | 292 ++--- src/qt/locale/bitcoin_fr.ts | 298 +---- src/qt/locale/bitcoin_gl.ts | 162 +-- src/qt/locale/bitcoin_he.ts | 1564 +++++++++++++++++--------- src/qt/locale/bitcoin_hi_IN.ts | 20 - src/qt/locale/bitcoin_hr.ts | 244 ++-- src/qt/locale/bitcoin_hu.ts | 155 +-- src/qt/locale/bitcoin_id_ID.ts | 164 +-- src/qt/locale/bitcoin_it.ts | 504 +++++---- src/qt/locale/bitcoin_ja.ts | 178 +-- src/qt/locale/bitcoin_ka.ts | 178 +-- src/qt/locale/bitcoin_ko_KR.ts | 230 +--- src/qt/locale/bitcoin_ky.ts | 4 - src/qt/locale/bitcoin_la.ts | 148 --- src/qt/locale/bitcoin_lt.ts | 330 ++++-- src/qt/locale/bitcoin_lv_LV.ts | 82 +- src/qt/locale/bitcoin_mn.ts | 12 - src/qt/locale/bitcoin_ms_MY.ts | 32 + src/qt/locale/bitcoin_nb.ts | 488 ++++---- src/qt/locale/bitcoin_nl.ts | 372 +++--- src/qt/locale/bitcoin_pam.ts | 140 +-- src/qt/locale/bitcoin_pl.ts | 190 +--- src/qt/locale/bitcoin_pt_BR.ts | 328 ++---- src/qt/locale/bitcoin_pt_PT.ts | 186 +-- src/qt/locale/bitcoin_ro_RO.ts | 186 +-- src/qt/locale/bitcoin_ru.ts | 334 +----- src/qt/locale/bitcoin_sk.ts | 244 +--- src/qt/locale/bitcoin_sl_SI.ts | 274 +++-- src/qt/locale/bitcoin_sq.ts | 8 - src/qt/locale/bitcoin_sr.ts | 41 +- src/qt/locale/bitcoin_sv.ts | 278 +---- src/qt/locale/bitcoin_th_TH.ts | 8 - src/qt/locale/bitcoin_tr.ts | 488 ++++---- src/qt/locale/bitcoin_uk.ts | 1554 ++++++++++++++++++++++--- src/qt/locale/bitcoin_ur_PK.ts | 32 + src/qt/locale/bitcoin_uz@Cyrl.ts | 1094 +++++++++++++++++- src/qt/locale/bitcoin_zh_CN.ts | 255 +---- src/qt/locale/bitcoin_zh_TW.ts | 302 +---- 60 files changed, 7042 insertions(+), 8944 deletions(-) diff --git a/src/qt/locale/bitcoin_af_ZA.ts b/src/qt/locale/bitcoin_af_ZA.ts index 474b6b3298..851c261d0b 100644 --- a/src/qt/locale/bitcoin_af_ZA.ts +++ b/src/qt/locale/bitcoin_af_ZA.ts @@ -277,14 +277,6 @@ Form Vorm - - Wallet - Beursie - - - <b>Recent transactions</b> - <b>Onlangse transaksies</b> -
PaymentServer @@ -650,14 +642,6 @@ Options: Opsies: - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Luister vir konneksies op <port> (standaard: 8333 of testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Onderhou op die meeste <n> konneksies na eweknieë (standaard: 125) - Use the test network Gebruik die toets netwerk @@ -670,10 +654,6 @@ Information Informasie - - System error: - Sisteem fout: - This help message Hierdie help boodskap diff --git a/src/qt/locale/bitcoin_ar.ts b/src/qt/locale/bitcoin_ar.ts index ea1bc0ea4b..f05270a9fa 100644 --- a/src/qt/locale/bitcoin_ar.ts +++ b/src/qt/locale/bitcoin_ar.ts @@ -33,6 +33,10 @@ Delete the currently selected address from the list حذف العنوان المحدد من القائمة + + Export the data in the current tab to a file + تحميل البيانات في علامة التبويب الحالية إلى ملف. + &Export &تصدير @@ -61,6 +65,14 @@ Receiving addresses استقبال العناوين + + These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. + هذه هي عناوين Bitcion التابعة لك من أجل إرسال الدفعات. تحقق دائما من المبلغ و عنوان المرسل المستقبل قبل إرسال العملات + + + These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. + هذه هي عناوين Bitcion التابعة لك من أجل إستقبال الدفعات. ينصح استخدام عنوان جديد من أجل كل صفقة + Copy &Label نسخ &الوصف @@ -73,6 +85,10 @@ Export Address List تصدير قائمة العناوين + + Comma separated file (*.csv) + ملف مفصول بفواصل (*.csv) + Exporting Failed فشل التصدير @@ -95,6 +111,10 @@ AskPassphraseDialog + + Passphrase Dialog + حوار جملة السر + Enter passphrase ادخل كلمة المرور @@ -139,6 +159,18 @@ Confirm wallet encryption تأكيد تشفير المحفظة + + Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! + تحذير: إذا قمت بتشفير محفظتك وفقدت كلمة المرور الخاص بك, ستفقد كل عملات BITCOINS الخاصة بك. + + + Are you sure you wish to encrypt your wallet? + هل أنت متأكد من رغبتك في تشفير محفظتك ؟ + + + 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. + هام: أي نسخة إحتياطية سابقة قمت بها لمحفظتك يجب استبدالها بأخرى حديثة، مشفرة. لأسباب أمنية، النسخ الاحتياطية السابقة لملفات المحفظة الغير مشفرة تصبح عديمة الفائدة مع بداية استخدام المحفظة المشفرة الجديدة. + Warning: The Caps Lock key is on! تحذير: مفتاح الحروف الكبيرة مفعل @@ -147,6 +179,10 @@ Wallet encrypted محفظة مشفرة + + 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>. + أدخل عبارة مرور جديدة إلى المحفظة. الرجاء استخدام عبارة مرور تتكون من10 حروف عشوائية على الاقل, أو أكثر من 7 كلمات + Bitcoin 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. بتكوين سوف يغلق الآن لإنهاء عملية التشفير. تذكر أن التشفير لا يستطيع حماية محفظتك تمامًا من السرقة من خلال البرمجيات الخبيثة التي تصيب جهازك @@ -175,7 +211,11 @@ Wallet decryption failed فشل فك التشفير المحفظة - + + Wallet passphrase was successfully changed. + لقد تم تغير عبارة مرور المحفظة بنجاح + +
BitcoinGUI @@ -238,14 +278,30 @@ &Change Passphrase... &تغيير كلمة المرور + + &Sending addresses... + ارسال العناوين. + + + &Receiving addresses... + استقبال العناوين + Open &URI... افتح &URI... + + Bitcoin Core client + عميل bitcion core + Send coins to a Bitcoin address ارسل عملات الى عنوان بيتكوين + + Modify configuration options for Bitcoin + تعديل إعدادات bitcoin + Backup wallet to another location احفظ نسخة احتياطية للمحفظة في مكان آخر @@ -274,6 +330,10 @@ &Receive &استقبل + + Show information about Bitcoin Core + اظهار معلومات حول bitcion core + &Show / Hide &عرض / اخفاء @@ -282,6 +342,10 @@ Show or hide the main Window عرض او اخفاء النافذة الرئيسية + + Encrypt the private keys that belong to your wallet + تشفير المفتاح الخاص لمحفظتك + &File &ملف @@ -298,14 +362,14 @@ Tabs toolbar شريط أدوات علامات التبويب - - [testnet] - [testnet] - Bitcoin Core جوهر البيت كوين + + &About Bitcoin Core + حول bitcoin core + %n hour(s) %n ساعة%n ساعة%n ساعة%n ساعات%n ساعات%n ساعات @@ -596,10 +660,6 @@ Error خطأ - - GB of free space available - قيقا بايت مساحة متاحة - OpenURIDialog @@ -709,10 +769,6 @@ Form نمودج - - Wallet - محفظة - Available: متوفر @@ -733,10 +789,6 @@ Your current total balance رصيدك الكلي الحالي - - <b>Recent transactions</b> - اخر المعملات - out of sync خارج المزامنه @@ -876,14 +928,6 @@ Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. استخدم اسهم الاعلى و الاسفل للتنقل بين السجلات و <b>Ctrl-L</b> لمسح الشاشة - - Yes - نعم - - - No - لا - Unknown غير معرف @@ -1539,6 +1583,10 @@ Exporting Successful نجح التصدير + + Comma separated file (*.csv) + ملف مفصول بفواصل (*.csv) + Confirmed تأكيد @@ -1591,6 +1639,10 @@ &Export &تصدير + + Export the data in the current tab to a file + تحميل البيانات في علامة التبويب الحالية إلى ملف. + Backup Wallet نسخ احتياط للمحفظة @@ -1630,10 +1682,6 @@ Error: Wallet locked, unable to create transaction! تحذير: المحفظة مغلقة , لا تستطيع تنفيذ المعاملة - - Error: system error: - خطأ: خطأ في النظام: - Failed to listen on any port. Use -listen=0 if you want this. فشل في الاستماع على أي منفذ. استخدام الاستماع = 0 إذا كنت تريد هذا. @@ -1658,10 +1706,6 @@ Signing transaction failed فشل توقيع المعاملة - - System error: - خطأ في النظام : - Transaction amount too small قيمة العملية صغيره جدا @@ -1686,10 +1730,6 @@ Upgrade wallet to latest format تحديث المحفظة للنسخة الاخيرة - - Server private key (default: server.pem) - المفتاح الخاص بالسيرفر (default: server.pem) - This help message رسالة المساعدة هذه diff --git a/src/qt/locale/bitcoin_be_BY.ts b/src/qt/locale/bitcoin_be_BY.ts index 8fac417b73..f4b82ce2cc 100644 --- a/src/qt/locale/bitcoin_be_BY.ts +++ b/src/qt/locale/bitcoin_be_BY.ts @@ -9,10 +9,34 @@ Create a new address Стварыць новы адрас + + &New + Новы + Copy the currently selected address to the system clipboard Капіяваць пазначаны адрас у сістэмны буфер абмену + + &Copy + Капіяваць + + + C&lose + Зачыніць + + + &Copy Address + Капіяваць адрас + + + Delete the currently selected address from the list + Выдаліць абраны адрас са спісу + + + Export the data in the current tab to a file + Экспартаваць гэтыя звесткі у файл + &Export Экспарт @@ -21,10 +45,38 @@ &Delete Выдаліць + + Choose the address to send coins to + Выбраць адрас, куды выслаць сродкі + + + Choose the address to receive coins with + Выбраць адрас, на які атрымаць сродкі + + + C&hoose + Выбраць + + + Sending addresses + адрасы Адпраўкі + + + Receiving addresses + адрасы Прымання + + + &Edit + Рэдагаваць + Comma separated file (*.csv) Коскамі падзелены файл (*.csv) + + Exporting Failed + Экспартаванне няўдалае + AddressTableModel @@ -87,6 +139,18 @@ Confirm wallet encryption Пацвердзіце шыфраванне гаманца + + Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! + Увага: калі вы зашыфруеце свой гаманец і страціце парольную фразу, то <b>СТРАЦІЦЕ ЎСЕ СВАЕ БІТКОЙНЫ</b>! + + + Are you sure you wish to encrypt your wallet? + Ці ўпэўненыя вы, што жадаеце зашыфраваць свой гаманец? + + + Warning: The Caps Lock key is on! + Увага: Caps Lock уключаны! + Wallet encrypted Гаманец зашыфраваны @@ -119,9 +183,17 @@ Wallet decryption failed Расшыфраванне гаманца няўдалае - + + Wallet passphrase was successfully changed. + Парольная фраза гаманца паспяхова зменена. + +
BitcoinGUI + + Sign &message... + Падпісаць паведамленне... + Synchronizing with network... Сінхранізацыя з сецівам... @@ -130,6 +202,10 @@ &Overview Агляд + + Node + Вузел + Show general overview of wallet Паказвае агульныя звесткі аб гаманцы @@ -162,6 +238,14 @@ &Options... Опцыі... + + &Encrypt Wallet... + Зашыфраваць Гаманец... + + + Open &URI... + Адчыниць &URI... + Backup wallet to another location Зрабіце копію гаманца ў іншае месца @@ -170,6 +254,14 @@ Change the passphrase used for wallet encryption Змяніць пароль шыфравання гаманца + + &Debug window + Вакно адладкі + + + Wallet + Гаманец + &Send Даслаць @@ -178,6 +270,18 @@ &Receive Атрымаць + + &Show / Hide + &Паказаць / Схаваць + + + Show or hide the main Window + Паказаць альбо схаваць галоўнае вакно + + + Encrypt the private keys that belong to your wallet + Зашыфраваць прыватныя ключы, якия належаць вашаму гаманцу + &File Ф&айл @@ -190,10 +294,6 @@ &Help Дапамога - - [testnet] - [testnet] - %n active connection(s) to Bitcoin network %n актыўнае злучэнне з Bitcoin-сецівам%n актыўных злучэнняў з Bitcoin-сецівам @@ -244,6 +344,10 @@ Address: %4 CoinControlDialog + + Amount: + Колькасць: + Amount Колькасць @@ -329,6 +433,14 @@ Address: %4 HelpMessageDialog + + (%1-bit) + (%1-біт) + + + About Bitcoin Core + Аб Bitcoin Core + Usage: Ужыванне: @@ -357,10 +469,6 @@ Address: %4 Form Форма - - <b>Recent transactions</b> - <b>Нядаўнія транзаццыі</b> - PaymentServer @@ -436,6 +544,10 @@ Address: %4 Send Coins Даслаць Манеты + + Amount: + Колькасць: + Send to multiple recipients at once Даслаць адразу некалькім атрымальнікам @@ -516,6 +628,10 @@ Address: %4 SplashScreen + + The Bitcoin Core developers + Распрацоўнікі Bitcoin Core + [testnet] [testnet] @@ -715,6 +831,10 @@ Address: %4 Edit label Рэдагаваць пазнаку + + Exporting Failed + Экспартаванне няўдалае + Comma separated file (*.csv) Коскамі падзелены файл (*.csv) @@ -771,6 +891,10 @@ Address: %4 &Export Экспарт + + Export the data in the current tab to a file + Экспартаваць гэтыя звесткі у файл + bitcoin-core @@ -778,34 +902,10 @@ Address: %4 Options: Опцыі: - - Specify configuration file (default: bitcoin.conf) - Вызначыць канфігурацыйны файл (зыходна: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Вызначыць pid-файл (зыходна: bitcoind.pid) - Specify data directory Вызначыць каталог даных - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Слухаць злучэнні на <port> (зыходна: 8333 ці testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Трымаць не больш за <n> злучэнняў на асобу (зыходна: 125) - - - Threshold for disconnecting misbehaving peers (default: 100) - Парог для адлучэння злаўмысных карыстальнікаў (тыпова: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Колькасць секунд для ўстрымання асобаў да перадалучэння (заходна: 86400) - Accept command line and JSON-RPC commands Прымаць камандны радок і JSON-RPC каманды @@ -838,10 +938,6 @@ Address: %4 Upgrade wallet to latest format Абнавіць гаманец на новы фармат - - Set key pool size to <n> (default: 100) - Устанавіць памер фонда ключоў у <n> (тыпова: 100) - Rescan the block chain for missing wallet transactions Перасканаваць ланцуг блокаў дзеля пошуку адсутных транзакцый @@ -850,14 +946,6 @@ Address: %4 Use OpenSSL (https) for JSON-RPC connections Ужываць OpenSSL (https) для JSON-RPC злучэнняў - - Server certificate file (default: server.cert) - Файл-сертыфікат сервера (зыходна: server.cert) - - - Server private key (default: server.pem) - Прыватны ключ сервера (зыходна: server.pem) - Loading addresses... Загружаем адрасы... diff --git a/src/qt/locale/bitcoin_bg.ts b/src/qt/locale/bitcoin_bg.ts index 11bf594a42..a1f3dd092a 100644 --- a/src/qt/locale/bitcoin_bg.ts +++ b/src/qt/locale/bitcoin_bg.ts @@ -278,10 +278,6 @@ Tabs toolbar Раздели - - [testnet] - [testnet] - %n active connection(s) to Bitcoin network %n връзка към Биткоин мрежата%n връзки към Биткоин мрежата @@ -609,10 +605,6 @@ Form Форма - - Wallet - Портфейл - Available: Налично: @@ -629,10 +621,6 @@ Your current total balance Текущият ви общ баланс - - <b>Recent transactions</b> - <b>Последни трансакции</b> - out of sync несинхронизиран @@ -1426,22 +1414,10 @@ Options: Опции: - - Specify configuration file (default: bitcoin.conf) - Задаване на файл с настройки (по подразбиране bitcoin.conf) - Specify data directory Определете директория за данните - - Threshold for disconnecting misbehaving peers (default: 100) - Праг на прекъсване на връзката при непорядъчно държащи се пиъри (по подразбиране:100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Брой секунди до възтановяване на връзката за зле държащите се пиъри (по подразбиране:86400) - Use the test network Използвайте тестовата мрежа @@ -1454,10 +1430,6 @@ (default: 1) (по подразбиране 1) - - (default: wallet.dat) - (по подразбиране wallet.dat) - Connection options: Настройки на връзката: @@ -1466,30 +1438,10 @@ Error: Disk space is low! Грешка: мястото на диска е малко! - - Error: system error: - Грешка: системна грешка: - Failed to listen on any port. Use -listen=0 if you want this. Провалено "слушане" на всеки порт. Използвайте -listen=0 ако искате това. - - Failed to read block info - Грешка при четене данни на блок - - - Failed to read block - Грешка при четене на блок - - - Failed to write block info - Грешка при запис данни на блок - - - Failed to write block - Грешка при запис на блок - Importing... Внасяне... @@ -1514,18 +1466,6 @@ Send trace/debug info to console instead of debug.log file Изпрати локализиращата или дебъг информацията към конзолата, вместо файлът debug.log - - Set minimum block size in bytes (default: 0) - Задайте минимален размер на блок-а в байтове (подразбиране: 0) - - - Specify connection timeout in milliseconds (default: 5000) - Определете таймаут за свързване в милисекунди (подразбиране: 5000) - - - System error: - Системна грешка: - Transaction amount too small Сумата на трансакцията е твърде малка @@ -1566,14 +1506,6 @@ Use OpenSSL (https) for JSON-RPC connections Използвайте OpenSSL (https) за JSON-RPC връзките - - Server certificate file (default: server.cert) - Сертификатен файл на сървъра (По подразбиране:server.cert) - - - Server private key (default: server.pem) - Поверителен ключ за сървъра (default: server.pem) - This help message Това помощно съобщение diff --git a/src/qt/locale/bitcoin_ca.ts b/src/qt/locale/bitcoin_ca.ts index 0d45ab63b6..1e19a3ff18 100644 --- a/src/qt/locale/bitcoin_ca.ts +++ b/src/qt/locale/bitcoin_ca.ts @@ -390,10 +390,6 @@ Tabs toolbar Barra d'eines de les pestanyes - - [testnet] - [testnet] - Bitcoin Core Nucli de Bitcoin @@ -434,10 +430,6 @@ No block source available... No hi ha cap font de bloc disponible... - - Processed %1 blocks of transaction history. - Proccessats %1 blocs del històric de transaccions. - %n hour(s) %n hora%n hores @@ -912,15 +904,7 @@ Address: %4 Error Error - - GB of free space available - GB d'espai lliure disponible - - - (of %1GB needed) - (d' %1GB necessari) - - +
OpenURIDialog @@ -1162,8 +1146,8 @@ Address: %4 La informació mostrada pot no estar al día. El teu moneder es sincronitza automàticament amb la xarxa Bitcoin un cop s'ha establert connexió, però aquest proces no s'ha completat encara. - Wallet - Moneder + Watch-only: + Només lectura: Available: @@ -1198,8 +1182,20 @@ Address: %4 El balanç total actual - <b>Recent transactions</b> - <b>Transaccions recents</b> + Your current balance in watch-only addresses + El vostre balanç actual en adreces de només lectura + + + Unconfirmed transactions to watch-only addresses + Transaccions sense confirmar a adreces de només lectura + + + Mined balance in watch-only addresses that has not yet matured + Balanç minat en adreces de només lectura que encara no ha madurat + + + Current total balance in watch-only addresses + Balanç total actual en adreces de només lectura out of sync @@ -1461,8 +1457,36 @@ Address: %4 Serveis - Sync Node - Node de sincronització + Starting Height + Alçada inicial + + + Sync Height + Sincronitza l'alçada + + + Ban Score + Puntuació de bandeig + + + Connection Time + Temps de connexió + + + Last Send + Darrer enviament + + + Last Receive + Darrera recepció + + + Bytes Sent + Bytes enviats + + + Bytes Received + Bytes rebuts Ping Time @@ -1544,7 +1568,31 @@ Address: %4 %1 GB %1 GB - + + via %1 + a través de %1 + + + never + mai + + + Inbound + Entrant + + + Outbound + Sortint + + + Unknown + Desconegut + + + Fetching... + S'està obtenint... + + ReceiveCoinsDialog @@ -1927,6 +1975,10 @@ Address: %4 This is a normal payment. Això és un pagament normal. + + The Bitcoin address to send the payment to + L'adreça Bitcoin on enviar el pagament + Alt+A Alta+A @@ -1997,6 +2049,10 @@ Address: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Podeu signar missatges amb la vostra adreça per provar que són vostres. Aneu amb compte no signar qualsevol cosa, ja que els atacs de pesca electrònica (phishing) poden provar de confondre-us perquè els signeu amb la vostra identitat. Només signeu als documents completament detallats amb què hi esteu d'acord. + + The Bitcoin address to sign the message with + L'adreça Bitcoin amb què signar el missatge + Choose previously used address Tria les adreces fetes servir amb anterioritat @@ -2049,6 +2105,10 @@ Address: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Introdueixi l'adreça signant, missatge (assegura't que copies salts de línia, espais, tabuladors, etc excactament tot el text) i la signatura a sota per verificar el missatge. Per evitar ser enganyat per un atac home-entre-mig, vés amb compte de no llegir més en la signatura del que hi ha al missatge signat mateix. + + The Bitcoin address the message was signed with + L'adreça Bitcoin amb què va ser signat el missatge + Verify the message to ensure it was signed with the specified Bitcoin address Verificar el missatge per assegurar-se que ha estat signat amb una adreça Bitcoin específica @@ -2190,6 +2250,10 @@ Address: %4 own address Adreça pròpia + + watch-only + només lectura + label etiqueta @@ -2210,6 +2274,14 @@ Address: %4 Debit Dèbit + + Total debit + Dèbit total + + + Total credit + Crèdit total + Transaction fee Comissió de transacció @@ -2360,6 +2432,10 @@ Address: %4 Mined Minat + + watch-only + només lectura + (n/a) (n/a) @@ -2526,7 +2602,11 @@ Address: %4 UnitDisplayStatusBarControl - + + Unit to show amounts in. Click to select another unit. + Unitat en què mostrar els imports. Feu clic per seleccionar una altra unitat. + + WalletFrame @@ -2582,26 +2662,10 @@ Address: %4 Options: Opcions: - - Specify configuration file (default: bitcoin.conf) - Especifica un fitxer de configuració (per defecte: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Especifica un fitxer pid (per defecte: bitcoind.pid) - Specify data directory Especifica el directori de dades - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Escolta connexions a <port> (per defecte: 8333 o testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Manté com a molt <n> connexions a iguals (per defecte: 125) - Connect to a node to retrieve peer addresses, and disconnect Connecta al node per obtenir les adreces de les connexions, i desconnecta @@ -2610,18 +2674,6 @@ Address: %4 Specify your own public address Especifiqueu la vostra adreça pública - - Threshold for disconnecting misbehaving peers (default: 100) - Límit per a desconectar connexions errònies (per defecte: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Nombre de segons abans de reconectar amb connexions errònies (per defecte: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Escolta connexions JSON-RPC al port <port> (per defecte: 8332 o testnet:18332) - Accept command line and JSON-RPC commands Accepta la línia d'ordres i ordres JSON-RPC @@ -2661,17 +2713,13 @@ També es recomana establir la notificació d'alertes i així sereu notificat de per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Xifrats acceptables (per defecte: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Vincula a una adreça específica i sempre escolta-hi. Utilitza la notació [host]:port per IPv6 - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - Limita contínuament les transaccions gratuïtes a <n>*1000 bytes per minut (per defecte: 15) + Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup + Elimina totes les transaccions del moneder i només recupera aquelles de la cadena de blocs a través de -rescan a l'inici Enter regression test mode, which uses a special chain in which blocks can be solved instantly. @@ -2689,14 +2737,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Executa una ordre quan una transacció del moneder canviï (%s en cmd es canvia per TxID) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - Buida l'activitat de la base de dades de la memòria disponible al registre del disc cada <n> megabytes (per defecte: 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - Com d'exhaustiva és la verificació de blocs de -checkblocks is (0-4, per defecte: 3) - In this mode -genproclimit controls how many blocks are generated immediately. En aquest mode -genproclimit controla quants blocs es generen immediatament. @@ -2705,10 +2745,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Defineix el nombre de fils de verificació d'scripts (%u a %d, 0 = auto, <0 = deixa tants nuclis lliures, per defecte: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - Defineix el límit de processadors quan està activada la generació (-1 = sense límit, per defecte: -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Aquesta és una versió de pre-llançament - utilitza-la sota la teva responsabilitat - No usar per a minería o aplicacions de compra-venda @@ -2717,10 +2753,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Unable to bind to %s on this computer. Bitcoin Core is probably already running. No es pot enllaçar %s a aquest ordinador. El Bitcoin Core probablement ja estigui executant-s'hi. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Utilitza un proxy SOCKS5 apart per arribar a iguals a través de serveis de Tor ocults (per defecte: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Avís: el -paytxfee és molt elevat! Aquesta és la comissió de transacció que pagareu si envieu una transacció. @@ -2745,10 +2777,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com (default: 1) (per defecte: 1) - - (default: wallet.dat) - (per defecte: wallet.dat) - <category> can be: <category> pot ser: @@ -2777,10 +2805,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Debugging/Testing options: Opcions de depuració/proves: - - Disable safemode, override a real safe mode event (default: 0) - Inhabilia el mode segur (safemode), invalida un esdeveniment de mode segur real (per defecte: 0) - Discover own IP address (default: 1 when listening and no -externalip) Descobreix la pròpia adreça IP (per defecte: 1 quan escoltant i no -externalip) @@ -2817,66 +2841,10 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Wallet locked, unable to create transaction! Error: El moneder està bloquejat, no és possible crear la transacció! - - Error: system error: - Error: error de sistema: - Failed to listen on any port. Use -listen=0 if you want this. Ha fallat escoltar a qualsevol port. Feu servir -listen=0 si voleu fer això. - - Failed to read block info - Ha fallat la lectura de la informació del bloc - - - Failed to read block - Ha fallat la lectura del bloc - - - Failed to sync block index - Ha fallat la sincronització de l'índex de blocs - - - Failed to write block index - Ha fallat la escriptura de l'índex de blocs - - - Failed to write block info - Ha fallat la escriptura de la informació de bloc - - - Failed to write block - Ha fallat l'escriptura del bloc - - - Failed to write file info - Ha fallat l'escriptura de la informació de fitxer - - - Failed to write to coin database - Ha fallat l'escriptura de la basse de dades de monedes - - - Failed to write transaction index - Ha fallat l'escriptura de l'índex de transaccions - - - Failed to write undo data - Ha fallat el desfer de dades - - - Force safe mode (default: 0) - Força el mode segur (per defecte: 0) - - - Generate coins (default: 0) - Genera monedes (per defecte: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Quants blocs s'han de confirmar a l'inici (per defecte: 288, 0 = tots) - If <category> is not supplied, output all debugging information. Si no se subministra <category>, mostra tota la informació de depuració. @@ -2897,10 +2865,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Not enough file descriptors available. No hi ha suficient descriptors de fitxers disponibles. - - Prepend debug output with timestamp (default: 1) - Posa davant de la sortida de depuració una marca horària (per defecte: 1) - Rebuild block chain index from current blk000??.dat files Reconstrueix l'índex de la cadena de blocs dels fitxers actuals blk000??.dat @@ -2913,18 +2877,10 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set maximum block size in bytes (default: %d) Defineix la mida màxim del bloc en bytes (per defecte: %d) - - Set the number of threads to service RPC calls (default: 4) - Estableix el nombre de fils per atendre trucades RPC (per defecte: 4) - Specify wallet file (within data directory) Especifica un fitxer de moneder (dins del directori de dades) - - Spend unconfirmed change when sending transactions (default: 1) - Gasta el canvi sense confirmar en enviar transaccions (per defecte: 1) - This is intended for regression testing tools and app development. Això es així per a eines de proves de regressió per al desenvolupament d'aplicacions. @@ -2953,26 +2909,106 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Imports blocks from external blk000??.dat file Importa blocs de un fitxer blk000??.dat extern + + Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times + Permet les connexions JSON-RPC d'una font específica. Vàlid per a <ip> són una IP individual (p. ex., 1.2.3.4), una xarxa / màscara de xarxa (p. ex., 1.2.3.4/255.255.255.0) o una xarxa/CIDR (p. ex., 1.2.3.4/24). Es pot especificar aquesta opció moltes vegades + + + Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6 + Vincula l'adreça donada i posa a la llista blanca els iguals que s'hi connectin. Feu servir la notació [host]:port per a IPv6 + + + Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces) + Vincula a l'adreça donada per a escoltar les connexions JSON-RPC. Feu servir la notació [host]:port per a IPv6. Aquesta opció pot ser especificada moltes vegades (per defecte: vincula a totes les interfícies) + Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. No es pot obtenir un bloqueig del directori de dades %s. El Bitcoin Core probablement ja s'estigui executant. + + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) + Crea fitxers nous amb els permisos per defecte del sistema, en comptes de l'umask 077 (només efectiu amb la funcionalitat de moneder inhabilitada) + + + Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + Distribuït sota la llicència de programari MIT/X11. Vegeu el fitxer acompanyant COPYING o <http://www.opensource.org/licenses/mit-license.php>. + + + Error: Listening for incoming connections failed (listen returned error %s) + Error: ha fallat escoltar les connexions entrants (l'escoltament ha retornat l'error %s) + + + Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + Error: s'ha trobat un argument no permès de -socks. Ja no es pot definir més la versió de SOCKS, només s'accepten els proxies de SOCKS5.ç + Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Executa l'ordre quan es rebi un avís rellevant o veiem una forquilla molt llarga (%s en cmd és reemplaçat per un missatge) - Output debugging information (default: 0, supplying <category> is optional) - Informació de la depuració de sortida (per defecte: 0, proporcionar <category> és opcional) + Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) + Comissions (en BTC/Kb) inferiors a això es consideren de comissió zero per a la transmissió (per defecte: %s) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) + Comissions (en BTC/Kb) inferiors a això es consideren de comissió zero per a la creació de la transacció (per defecte: %s) + + + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) + Consulta a adreces d'iguals a través de DNS, si es troba baix en adreces (per defecte: 1 a menys que -connect) Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Defineix la mida màxima de transaccions d'alta prioritat / baixa comissió en bytes (per defecte: %d) + + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. + Aquest producte inclou programari desenvolupat pel projecte OpenSSL per a ús a l'OpenSSL Toolkit <https://www.openssl.org/> i programari criptogràfic escrit per Eric Young i programari UPnP escrit per Thomas Bernard. + + + Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + Avís: comproveu que la data i hora del vostre ordinador siguin correctes! Si el vostre rellotge no és correcte, el Bitcoin Core no funcionarà correctament. + + + Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway + Els iguals en la llista blanca no poden ser bandejats per DoS i es transmetran sempre llurs transaccions, fins i tot si ja són a la mempool. Això és útil, p. ex., per a una passarel·la + + + Cannot resolve -whitebind address: '%s' + No es pot resoldre l'adreça -whitebind: «%s» + + + Connect through SOCKS5 proxy + Connecta a través del proxy SOCKS5 + + + Copyright (C) 2009-%i The Bitcoin Core Developers + Copyright (C) 2009-%i Els desenvolupadors del Bitcoin Core + + + Could not parse -rpcbind value %s as network address + No s'ha pogut analitzar el valor -rpcbind %s com una adreça de xarxa + + + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core + Error en carregar wallet.dat: el moneder requereix una versió més nova del Bitcoin core + + + Error: Unsupported argument -tor found, use -onion. + Error: s'ha trobat un argument -tor no acceptat. Feu servir -onion. + + + Fee (in BTC/kB) to add to transactions you send (default: %s) + Comissió en (BTC/kB) per afegir a les transaccions que envieu (per defecte: %s) + Information &Informació + + Initialization sanity check failed. Bitcoin Core is shutting down. + Ha fallat la inicialització de la comprovació de validesa. El Bitcoin Core s'està aturant. + Invalid amount for -minrelaytxfee=<amount>: '%s' Import no vàlid per a -minrelaytxfee=<amount>: «%s» @@ -2982,41 +3018,29 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Import no vàlid per a -mintxfee=<amount>: «%s» - Limit size of signature cache to <n> entries (default: 50000) - Mida límit de la memòria cau de signatura per a <n> entrades (per defecte: 50000) + Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) + Import no vàlid per a -paytxfee=<amount>: «%s» (ha de ser com a mínim %s) - Log transaction priority and fee per kB when mining blocks (default: 0) - Registra la prioritat de transacció i comissió per kB en minar blocs (per defecte: 0) + Invalid netmask specified in -whitelist: '%s' + S'ha especificat una màscara de xarxa no vàlida a -whitelist: «%s» - Maintain a full transaction index (default: 0) - Manté l'índex sencer de transaccions (per defecte: 0) + Keep at most <n> unconnectable blocks in memory (default: %u) + Manté com a màxim <n> blocs no connectables en memòria (per defecte: %u) - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Mida màxima del buffer de recepció per a cada connexió, <n>*1000 bytes (default: 5000) + Need to specify a port with -whitebind: '%s' + Cal especificar un port amb -whitebind: «%s» - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Mida màxima del buffer d'enviament per a cada connexió, <n>*1000 bytes (default: 5000) - - - Only accept block chain matching built-in checkpoints (default: 1) - Només accepta cadenes de blocs que coincideixin amb els punts de prova (per defecte: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Només connecta als nodes de la xarxa <net> (IPv4, IPv6 o Tor) + Node relay options: + Opcions de transmissió del node: Print block on startup, if found in block index Imprimeix el block a l'inici, si es troba l'índex de blocs - - Print block tree on startup (default: 0) - Imprimeix l'arbre de blocs a l'inici (per defecte: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) Opcions RPC SSL: (veieu el wiki del Bitcoin per a instruccions de configuració de l'SSL) @@ -3033,22 +3057,10 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Randomly fuzz 1 of every <n> network messages Introdueix incertesa en 1 de cada <n> missatges de la xarxa - - Run a thread to flush wallet periodically (default: 1) - Executa un fil per buidar el moneder periòdicament (per defecte: 1) - Send trace/debug info to console instead of debug.log file Envia informació de traça/depuració a la consola en comptes del fitxer debug.log - - Set minimum block size in bytes (default: 0) - Defineix una mida mínima de bloc en bytes (per defecte: 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - Defineix el senyal DB_PRIVATE en l'entorn db del moneder (per defecte: 1) - Show all debugging options (usage: --help -help-debug) Mostra totes les opcions de depuració (ús: --help --help-debug) @@ -3062,12 +3074,8 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Ha fallat la signatura de la transacció - Specify connection timeout in milliseconds (default: 5000) - Especifica el temps limit per a un intent de connexió en mil·lisegons (per defecte: 5000) - - - System error: - Error de sistema: + This is experimental software. + Això és programari experimental. Transaction amount too small @@ -3082,8 +3090,8 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com La transacció és massa gran - Use UPnP to map the listening port (default: 0) - Utilitza UPnP per a mapejar els ports d'escolta (per defecte: 0) + Unable to bind to %s on this computer (bind returned error %s) + No s'ha pogut vincular a %s en aquest ordinador (la vinculació ha retornat l'error %s) Use UPnP to map the listening port (default: 1 when listening) @@ -3093,6 +3101,10 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Username for JSON-RPC connections Nom d'usuari per a connexions JSON-RPC + + Wallet needed to be rewritten: restart Bitcoin Core to complete + Cal reescriure el moneder: reiniceu el Bitcoin Core per completar-ho. + Warning Avís @@ -3101,6 +3113,14 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Warning: This version is obsolete, upgrade required! Avís: aquesta versió està obsoleta. És necessari actualitzar-la! + + Warning: Unsupported argument -benchmark ignored, use -debug=bench. + Avís: s'ha ignorat l'argument no acceptat de -benchmark. Feu servir -debug=bench. + + + Warning: Unsupported argument -debugnet ignored, use -debug=net. + Avís: s'ha ignorat l'argument no acceptat de -debugnet. Feu servir -debug=net. + Zapping all transactions from wallet... Se suprimeixen totes les transaccions del moneder... @@ -3125,10 +3145,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Upgrade wallet to latest format Actualitza el moneder a l'últim format - - Set key pool size to <n> (default: 100) - Defineix el límit de nombre de claus a <n> (per defecte: 100) - Rescan the block chain for missing wallet transactions Reescaneja la cadena de blocs en les transaccions de moneder perdudes @@ -3137,14 +3153,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Use OpenSSL (https) for JSON-RPC connections Utilitza OpenSSL (https) per a connexions JSON-RPC - - Server certificate file (default: server.cert) - Fitxer del certificat de servidor (per defecte: server.cert) - - - Server private key (default: server.pem) - Clau privada del servidor (per defecte: server.pem) - This help message Aquest misatge d'ajuda diff --git a/src/qt/locale/bitcoin_ca@valencia.ts b/src/qt/locale/bitcoin_ca@valencia.ts index 0d43d95d2a..9d49da2dbd 100644 --- a/src/qt/locale/bitcoin_ca@valencia.ts +++ b/src/qt/locale/bitcoin_ca@valencia.ts @@ -3,11 +3,11 @@ AddressBookPage Double-click to edit address or label - Doble click per editar la direccio o la etiqueta + Feu doble clic per editar l'adreça o l'etiqueta Create a new address - Crear nova direccio + Crea una nova adreça &New @@ -15,7 +15,7 @@ Copy the currently selected address to the system clipboard - Copieu l'adreça seleccionada al porta-retalls del sistema + Copia l'adreça seleccionada al porta-retalls del sistema &Copy @@ -43,7 +43,7 @@ &Delete - Eliminar + &Elimina Choose the address to send coins to @@ -93,7 +93,11 @@ Exporting Failed L'exportació ha fallat - + + There was an error trying to save the address list to %1. Please try again. + S'ha produït un error en guardar la llista d'adreces a %1. Torneu-ho a provar. + + AddressTableModel @@ -179,6 +183,10 @@ Wallet encrypted Moneder encriptat + + 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>. + Introduïu la contrasenya nova al moneder.<br/>Utilitzeu una contrasenya de <b>deu o més caràcters aleatoris</b>, o <b>vuit o més paraules</b>. + Bitcoin 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. Bitcoin es tancarà ara per acabar el procés d'encriptació. Recordeu que encriptar el moneder no protegeix completament els bitcoins de ser robats per programari maliciós instal·lat a l'ordinador. @@ -286,6 +294,10 @@ Open &URI... Obri un &URI... + + Bitcoin Core client + Client del Bitcoin Core + Importing blocks from disk... S'estan important els blocs del disc... @@ -338,6 +350,10 @@ &Receive &Rep + + Show information about Bitcoin Core + Mostra informació del Bitcoin Core + &Show / Hide &Mostra / Amaga @@ -374,13 +390,9 @@ Tabs toolbar Barra d'eines de les pestanyes - - [testnet] - [testnet] - Bitcoin Core - Bitcoin Core + Nucli de Bitcoin Request payments (generates QR codes and bitcoin: URIs) @@ -414,10 +426,6 @@ No block source available... No hi ha cap font de bloc disponible... - - Processed %1 blocks of transaction history. - Proccessats %1 blocs del històric de transaccions. - %1 and %2 %1 i %2 @@ -512,9 +520,13 @@ Address: %4 Fee: Quota: + + Dust: + Polsim: + After Fee: - Comissió posterior: + Quota posterior: Change: @@ -534,7 +546,7 @@ Address: %4 Amount - Import + Quantitat Address @@ -600,6 +612,10 @@ Address: %4 Copy priority Copia la prioritat + + Copy dust + Copia el polsim + Copy change Copia el canvi @@ -648,6 +664,10 @@ Address: %4 none cap + + Can vary +/- %1 satoshi(s) per input. + Pot variar +/- %1 satoshi(s) per entrada. + yes @@ -775,7 +795,7 @@ Address: %4 HelpMessageDialog Bitcoin Core - Bitcoin Core + Nucli de Bitcoin version @@ -789,6 +809,10 @@ Address: %4 About Bitcoin Core Quant al Bitcoin Core + + Command-line options + Opcions de línia d'ordes + Usage: Ús: @@ -850,21 +874,17 @@ Address: %4 Bitcoin Core - Bitcoin Core + Nucli de Bitcoin + + + Error: Specified data directory "%1" cannot be created. + Error: el directori de dades «%1» especificat no pot ser creat. Error Error - - GB of free space available - GB d'espai lliure disponible - - - (of %1GB needed) - (d' %1GB necessari) - - + OpenURIDialog @@ -926,6 +946,14 @@ Address: %4 Number of script &verification threads Nombre de fils de &verificació d'scripts + + Accept connections from outside + Accepta connexions de fora + + + Allow incoming connections + Permet connexions entrants + Connect to the Bitcoin network through a SOCKS proxy. Connecta a la xarxa Bitcoin a través d'un proxy SOCKS. @@ -1098,8 +1126,8 @@ Address: %4 La informació mostrada pot no estar al día. El teu moneder es sincronitza automàticament amb la xarxa Bitcoin un cop s'ha establit connexió, però este proces no s'ha completat encara. - Wallet - Moneder + Watch-only: + Només lectura: Available: @@ -1134,8 +1162,20 @@ Address: %4 El balanç total actual - <b>Recent transactions</b> - <b>Transaccions recents</b> + Your current balance in watch-only addresses + El vostre balanç actual en adreces de només lectura + + + Unconfirmed transactions to watch-only addresses + Transaccions sense confirmar a adreces de només lectura + + + Mined balance in watch-only addresses that has not yet matured + Balanç minat en adreces de només lectura que encara no ha madurat + + + Current total balance in watch-only addresses + Balanç total actual en adreces de només lectura out of sync @@ -1152,6 +1192,22 @@ Address: %4 Invalid payment address %1 Adreça de pagament no vàlida %1 + + Payment request rejected + La sol·licitud de pagament s'ha rebutjat + + + Payment request network doesn't match client network. + La xarxa de la sol·licitud de pagament no coincideix amb la xarxa del client. + + + Payment request has expired. + La sol·licitud de pagament ha caducat. + + + Payment request is not initialized. + La sol·licitud de pagament no està inicialitzada. + Requested payment amount of %1 is too small (considered dust). L'import de pagament sol·licitat %1 és massa petit (es considera polsim). @@ -1168,10 +1224,18 @@ Address: %4 Payment request fetch URL is invalid: %1 L'URL de recuperació de la sol·licitud de pagament no és vàlida: %1 + + URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + L'URI no pot ser analitzat! Això pot ser a causa d'una adreça de Bitcoin no vàlida o per paràmetres URI amb mal format. + Payment request file handling Gestió de fitxers de les sol·licituds de pagament + + Payment request file cannot be read! This can be caused by an invalid payment request file. + No es pot llegir el fitxer de la sol·licitud de pagament. Això pot ser causat per un fitxer de sol·licitud de pagament no vàlid. + Unverified payment requests to custom payment scripts are unsupported. No s'accepten sol·licituds de pagament no verificades a scripts de pagament personalitzats. @@ -1184,6 +1248,10 @@ Address: %4 Error communicating with %1: %2 Error en comunicar amb %1: %2 + + Payment request cannot be parsed! + No es pot analitzar la sol·licitud de pagament! + Bad response from server %1 Mala resposta del servidor %1 @@ -1199,12 +1267,32 @@ Address: %4 PeerTableModel - + + User Agent + Agent d'usuari + + + Address/Hostname + Adreça / nom de l'ordinador + + + Ping Time + Temps de ping + + QObject Amount - Import + Quantitat + + + Enter a Bitcoin address (e.g. %1) + Introduïu una adreça de Bitcoin (p. ex. %1) + + + %1 d + %1 d %1 h @@ -1215,10 +1303,30 @@ Address: %4 %1 m - N/A - N/D + %1 s + %1 s - + + NETWORK + XARXA + + + UNKNOWN + DESCONEGUT + + + None + Cap + + + N/A + N/A + + + %1 ms + %1 ms + + QRImageWidget @@ -1246,7 +1354,7 @@ Address: %4 N/A - N/D + N/A Client version @@ -1268,6 +1376,10 @@ Address: %4 Using OpenSSL version Utilitzant OpenSSL versió + + Using BerkeleyDB version + Utilitzant BerkeleyDB versió + Startup time &Temps d'inici @@ -1292,6 +1404,74 @@ Address: %4 Current number of blocks Nombre de blocs actuals + + Received + Rebut + + + Sent + Enviat + + + &Peers + &Iguals + + + Select a peer to view detailed information. + Seleccioneu un igual per mostrar informació detallada. + + + Direction + Direcció + + + Version + Versió + + + User Agent + Agent d'usuari + + + Services + Serveis + + + Starting Height + Alçada inicial + + + Sync Height + Sincronitza l'alçada + + + Ban Score + Puntuació de bandeig + + + Connection Time + Temps de connexió + + + Last Send + Darrer enviament + + + Last Receive + Darrera recepció + + + Bytes Sent + Bytes enviats + + + Bytes Received + Bytes rebuts + + + Ping Time + Temps de ping + Last block time Últim temps de bloc @@ -1368,7 +1548,31 @@ Address: %4 %1 GB %1 GB - + + via %1 + a través de %1 + + + never + mai + + + Inbound + Entrant + + + Outbound + Eixint + + + Unknown + Desconegut + + + Fetching... + S'està obtenint... + + ReceiveCoinsDialog @@ -1409,7 +1613,7 @@ Address: %4 Clear all fields of the form. - Neteja tots els camps del formulari. + Esborra tots els camps del formuari. Clear @@ -1441,7 +1645,7 @@ Address: %4 Copy label - Copiar etiqueta + Copia l'etiqueta Copy message @@ -1578,11 +1782,11 @@ Address: %4 Fee: - Quota: + Comissió: After Fee: - Comissió posterior: + Quota posterior: Change: @@ -1606,7 +1810,11 @@ Address: %4 Clear all fields of the form. - Neteja tots els camps del formulari. + Netejar tots els camps del formulari. + + + Dust: + Polsim: Clear &All @@ -1642,7 +1850,7 @@ Address: %4 Copy fee - Copia la comissió + Copia la comissi Copy after fee @@ -1708,6 +1916,10 @@ Address: %4 Warning: Unknown change address Avís: adreça de canvi desconeguda + + Copy dust + Copia el polsim + Are you sure you want to send? Esteu segur que ho voleu enviar? @@ -1737,19 +1949,23 @@ Address: %4 Choose previously used address - Tria les adreces fetes servir amb anterioritat + Trieu una adreça feta servir anteriorment This is a normal payment. Això és un pagament normal. + + The Bitcoin address to send the payment to + L'adreça Bitcoin on enviar el pagament + Alt+A - Alt+A + Alta+A Paste address from clipboard - Apega l'adreça del porta-retalls + Apegar adreça del porta-retalls Alt+P @@ -1813,6 +2029,10 @@ Address: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Podeu signar missatges amb la vostra adreça per provar que són vostres. Aneu amb compte no signar qualsevol cosa, ja que els atacs de pesca electrònica (phishing) poden provar de confondre-vos perquè els signeu amb la vostra identitat. Només signeu als documents completament detallats amb què hi esteu d'acord. + + The Bitcoin address to sign the message with + L'adreça Bitcoin amb què signar el missatge + Choose previously used address Tria les adreces fetes servir amb anterioritat @@ -1865,6 +2085,10 @@ Address: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Introduïsca l'adreça signant, missatge (assegura't que copies salts de línia, espais, tabuladors, etc excactament tot el text) i la signatura a sota per verificar el missatge. Per evitar ser enganyat per un atac home-entre-mig, vés amb compte de no llegir més en la signatura del que hi ha al missatge signat mateix. + + The Bitcoin address the message was signed with + L'adreça Bitcoin amb què va ser signat el missatge + Verify the message to ensure it was signed with the specified Bitcoin address Verificar el missatge per assegurar-se que ha estat signat amb una adreça Bitcoin específica @@ -2002,6 +2226,10 @@ Address: %4 own address Adreça pròpia + + watch-only + només lectura + label etiqueta @@ -2018,6 +2246,14 @@ Address: %4 Debit Dèbit + + Total debit + Dèbit total + + + Total credit + Crèdit total + Transaction fee Comissió de transacció @@ -2060,7 +2296,7 @@ Address: %4 Amount - Import + Quantitat true @@ -2160,6 +2396,10 @@ Address: %4 Mined Minat + + watch-only + només lectura + (n/a) (n/a) @@ -2245,7 +2485,7 @@ Address: %4 Copy address - Copiar adreça + Copia l'adreça Copy label @@ -2289,7 +2529,7 @@ Address: %4 Comma separated file (*.csv) - Fitxer de separació amb comes (*.csv) + Fitxer separat per comes (*.csv) Confirmed @@ -2326,7 +2566,11 @@ Address: %4 UnitDisplayStatusBarControl - + + Unit to show amounts in. Click to select another unit. + Unitat en què mostrar els imports. Feu clic per seleccionar una altra unitat. + + WalletFrame @@ -2382,26 +2626,10 @@ Address: %4 Options: Opcions: - - Specify configuration file (default: bitcoin.conf) - Especifica un fitxer de configuració (per defecte: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Especifica un fitxer pid (per defecte: bitcoind.pid) - Specify data directory Especifica el directori de dades - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Escolta connexions a <port> (per defecte: 8333 o testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Manté com a molt <n> connexions a iguals (per defecte: 125) - Connect to a node to retrieve peer addresses, and disconnect Connecta al node per obtindre les adreces de les connexions, i desconnecta @@ -2410,18 +2638,6 @@ Address: %4 Specify your own public address Especifiqueu la vostra adreça pública - - Threshold for disconnecting misbehaving peers (default: 100) - Límit per a desconectar connexions errònies (per defecte: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Nombre de segons abans de reconectar amb connexions errònies (per defecte: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Escolta connexions JSON-RPC al port <port> (per defecte: 8332 o testnet:18332) - Accept command line and JSON-RPC commands Accepta la línia d'ordes i ordes JSON-RPC @@ -2461,17 +2677,13 @@ També es recomana establir la notificació d'alertes i així sereu notificat de per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Xifrats acceptables (per defecte: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Vincula a una adreça específica i sempre escolta-hi. Utilitza la notació [host]:port per IPv6 - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - Limita contínuament les transaccions gratuïtes a <n>*1000 bytes per minut (per defecte: 15) + Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup + Elimina totes les transaccions del moneder i només recupera aquelles de la cadena de blocs a través de -rescan a l'inici Enter regression test mode, which uses a special chain in which blocks can be solved instantly. @@ -2489,14 +2701,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Executa una orde quan una transacció del moneder canvie (%s en cmd es canvia per TxID) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - Buida l'activitat de la base de dades de la memòria disponible al registre del disc cada <n> megabytes (per defecte: 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - Com d'exhaustiva és la verificació de blocs de -checkblocks is (0-4, per defecte: 3) - In this mode -genproclimit controls how many blocks are generated immediately. En este mode -genproclimit controla quants blocs es generen immediatament. @@ -2505,10 +2709,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Defineix el nombre de fils de verificació d'scripts (%u a %d, 0 = auto, <0 = deixa tants nuclis lliures, per defecte: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - Defineix el límit de processadors quan està activada la generació (-1 = sense límit, per defecte: -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Esta és una versió de pre-llançament - utilitza-la sota la teva responsabilitat - No usar per a minería o aplicacions de compra-venda @@ -2517,10 +2717,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Unable to bind to %s on this computer. Bitcoin Core is probably already running. No es pot enllaçar %s a este ordinador. El Bitcoin Core probablement ja estiga executant-s'hi. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Utilitza un proxy SOCKS5 apart per arribar a iguals a través de serveis de Tor ocults (per defecte: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Avís: el -paytxfee és molt elevat! Esta és la comissió de transacció que pagareu si envieu una transacció. @@ -2545,10 +2741,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com (default: 1) (per defecte: 1) - - (default: wallet.dat) - (per defecte: wallet.dat) - <category> can be: <category> pot ser: @@ -2577,10 +2769,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Debugging/Testing options: Opcions de depuració/proves: - - Disable safemode, override a real safe mode event (default: 0) - Inhabilia el mode segur (safemode), invalida un esdeveniment de mode segur real (per defecte: 0) - Discover own IP address (default: 1 when listening and no -externalip) Descobreix la pròpia adreça IP (per defecte: 1 quan escoltant i no -externalip) @@ -2617,66 +2805,10 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Wallet locked, unable to create transaction! Error: El moneder està bloquejat, no és possible crear la transacció! - - Error: system error: - Error: error de sistema: - Failed to listen on any port. Use -listen=0 if you want this. Ha fallat escoltar a qualsevol port. Feu servir -listen=0 si voleu fer això. - - Failed to read block info - Ha fallat la lectura de la informació del bloc - - - Failed to read block - Ha fallat la lectura del bloc - - - Failed to sync block index - Ha fallat la sincronització de l'índex de blocs - - - Failed to write block index - Ha fallat la escriptura de l'índex de blocs - - - Failed to write block info - Ha fallat la escriptura de la informació de bloc - - - Failed to write block - Ha fallat l'escriptura del bloc - - - Failed to write file info - Ha fallat l'escriptura de la informació de fitxer - - - Failed to write to coin database - Ha fallat l'escriptura de la basse de dades de monedes - - - Failed to write transaction index - Ha fallat l'escriptura de l'índex de transaccions - - - Failed to write undo data - Ha fallat el desfer de dades - - - Force safe mode (default: 0) - Força el mode segur (per defecte: 0) - - - Generate coins (default: 0) - Genera monedes (per defecte: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Quants blocs s'han de confirmar a l'inici (per defecte: 288, 0 = tots) - If <category> is not supplied, output all debugging information. Si no se subministra <category>, mostra tota la informació de depuració. @@ -2697,10 +2829,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Not enough file descriptors available. No hi ha suficient descriptors de fitxers disponibles. - - Prepend debug output with timestamp (default: 1) - Posa davant de l'eixida de depuració una marca horària (per defecte: 1) - Rebuild block chain index from current blk000??.dat files Reconstrueix l'índex de la cadena de blocs dels fitxers actuals blk000??.dat @@ -2713,18 +2841,10 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set maximum block size in bytes (default: %d) Defineix la mida màxim del bloc en bytes (per defecte: %d) - - Set the number of threads to service RPC calls (default: 4) - Estableix el nombre de fils per atendre trucades RPC (per defecte: 4) - Specify wallet file (within data directory) Especifica un fitxer de moneder (dins del directori de dades) - - Spend unconfirmed change when sending transactions (default: 1) - Gasta el canvi sense confirmar en enviar transaccions (per defecte: 1) - This is intended for regression testing tools and app development. Això s'així per a eines de proves de regressió per al desenvolupament d'aplicacions. @@ -2753,25 +2873,105 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Imports blocks from external blk000??.dat file Importa blocs d'un fitxer blk000??.dat extern + + Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times + Permet les connexions JSON-RPC d'una font específica. Vàlid per a <ip> són una IP individual (p. ex., 1.2.3.4), una xarxa / màscara de xarxa (p. ex., 1.2.3.4/255.255.255.0) o una xarxa/CIDR (p. ex., 1.2.3.4/24). Es pot especificar esta opció moltes vegades + + + Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6 + Vincula l'adreça donada i posa a la llista blanca els iguals que s'hi connecten. Feu servir la notació [host]:port per a IPv6 + + + Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces) + Vincula a l'adreça donada per a escoltar les connexions JSON-RPC. Feu servir la notació [host]:port per a IPv6. Esta opció pot ser especificada moltes vegades (per defecte: vincula a totes les interfícies) + Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. No es pot obtindre un bloqueig del directori de dades %s. El Bitcoin Core probablement ja s'estiga executant. + + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) + Crea fitxers nous amb els permisos per defecte del sistema, en comptes de l'umask 077 (només efectiu amb la funcionalitat de moneder inhabilitada) + + + Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + Distribuït sota la llicència de programari MIT/X11. Vegeu el fitxer acompanyant COPYING o <http://www.opensource.org/licenses/mit-license.php>. + + + Error: Listening for incoming connections failed (listen returned error %s) + Error: ha fallat escoltar les connexions entrants (l'escoltament ha retornat l'error %s) + + + Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + Error: s'ha trobat un argument no permés de -socks. Ja no es pot definir més la versió de SOCKS, només s'accepten els proxies de SOCKS5.ç + Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Executa l'orde quan es reba un avís rellevant o veiem una forquilla molt llarga (%s en cmd és reemplaçat per un missatge) - Output debugging information (default: 0, supplying <category> is optional) - Informació de la depuració d'eixida (per defecte: 0, proporcionar <category> és opcional) + Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) + Comissions (en BTC/Kb) inferiors a això es consideren de comissió zero per a la transmissió (per defecte: %s) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) + Comissions (en BTC/Kb) inferiors a això es consideren de comissió zero per a la creació de la transacció (per defecte: %s) + + + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) + Consulta a adreces d'iguals a través de DNS, si es troba baix en adreces (per defecte: 1 a menys que -connect) Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Defineix la mida màxima de transaccions d'alta prioritat / baixa comissió en bytes (per defecte: %d) + + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. + Este producte inclou programari desenvolupat pel projecte OpenSSL per a ús a l'OpenSSL Toolkit <https://www.openssl.org/> i programari criptogràfic escrit per Eric Young i programari UPnP escrit per Thomas Bernard. + + + Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + Avís: comproveu que la data i hora del vostre ordinador siguen correctes! Si el vostre rellotge no és correcte, el Bitcoin Core no funcionarà correctament. + + + Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway + Els iguals en la llista blanca no poden ser bandejats per DoS i es transmetran sempre llurs transaccions, fins i tot si ja són a la mempool. Això és útil, p. ex., per a una passarel·la + + + Cannot resolve -whitebind address: '%s' + No es pot resoldre l'adreça -whitebind: «%s» + + + Connect through SOCKS5 proxy + Connecta a través del proxy SOCKS5 + + + Copyright (C) 2009-%i The Bitcoin Core Developers + Copyright (C) 2009-%i Els desenvolupadors del Bitcoin Core + + + Could not parse -rpcbind value %s as network address + No s'ha pogut analitzar el valor -rpcbind %s com una adreça de xarxa + + + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core + Error en carregar wallet.dat: el moneder requereix una versió més nova del Bitcoin core + + + Error: Unsupported argument -tor found, use -onion. + Error: s'ha trobat un argument -tor no acceptat. Feu servir -onion. + + + Fee (in BTC/kB) to add to transactions you send (default: %s) + Comissió en (BTC/kB) per afegir a les transaccions que envieu (per defecte: %s) + Information - Informació + &Informació + + + Initialization sanity check failed. Bitcoin Core is shutting down. + Ha fallat la inicialització de la comprovació de validesa. El Bitcoin Core s'està parant. Invalid amount for -minrelaytxfee=<amount>: '%s' @@ -2782,41 +2982,29 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Import no vàlid per a -mintxfee=<amount>: «%s» - Limit size of signature cache to <n> entries (default: 50000) - Mida límit de la memòria cau de signatura per a <n> entrades (per defecte: 50000) + Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) + Import no vàlid per a -paytxfee=<amount>: «%s» (ha de ser com a mínim %s) - Log transaction priority and fee per kB when mining blocks (default: 0) - Registra la prioritat de transacció i comissió per kB en minar blocs (per defecte: 0) + Invalid netmask specified in -whitelist: '%s' + S'ha especificat una màscara de xarxa no vàlida a -whitelist: «%s» - Maintain a full transaction index (default: 0) - Manté l'índex sencer de transaccions (per defecte: 0) + Keep at most <n> unconnectable blocks in memory (default: %u) + Manté com a màxim <n> blocs no connectables en memòria (per defecte: %u) - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Mida màxima del buffer de recepció per a cada connexió, <n>*1000 bytes (default: 5000) + Need to specify a port with -whitebind: '%s' + Cal especificar un port amb -whitebind: «%s» - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Mida màxima del buffer d'enviament per a cada connexió, <n>*1000 bytes (default: 5000) - - - Only accept block chain matching built-in checkpoints (default: 1) - Només accepta cadenes de blocs que coincidisquen amb els punts de prova (per defecte: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Només connecta als nodes de la xarxa <net> (IPv4, IPv6 o Tor) + Node relay options: + Opcions de transmissió del node: Print block on startup, if found in block index Imprimeix el block a l'inici, si es troba l'índex de blocs - - Print block tree on startup (default: 0) - Imprimeix l'arbre de blocs a l'inici (per defecte: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) Opcions RPC SSL: (veieu el wiki del Bitcoin per a instruccions de configuració de l'SSL) @@ -2833,22 +3021,10 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Randomly fuzz 1 of every <n> network messages Introdueix incertesa en 1 de cada <n> missatges de la xarxa - - Run a thread to flush wallet periodically (default: 1) - Executa un fil per buidar el moneder periòdicament (per defecte: 1) - Send trace/debug info to console instead of debug.log file Envia informació de traça/depuració a la consola en comptes del fitxer debug.log - - Set minimum block size in bytes (default: 0) - Defineix una mida mínima de bloc en bytes (per defecte: 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - Defineix el senyal DB_PRIVATE en l'entorn db del moneder (per defecte: 1) - Show all debugging options (usage: --help -help-debug) Mostra totes les opcions de depuració (ús: --help --help-debug) @@ -2862,12 +3038,8 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Ha fallat la signatura de la transacció - Specify connection timeout in milliseconds (default: 5000) - Especifica el temps limit per a un intent de connexió en mil·lisegons (per defecte: 5000) - - - System error: - Error de sistema: + This is experimental software. + Això és programari experimental. Transaction amount too small @@ -2882,8 +3054,8 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com La transacció és massa gran - Use UPnP to map the listening port (default: 0) - Utilitza UPnP per a mapejar els ports d'escolta (per defecte: 0) + Unable to bind to %s on this computer (bind returned error %s) + No s'ha pogut vincular a %s en este ordinador (la vinculació ha retornat l'error %s) Use UPnP to map the listening port (default: 1 when listening) @@ -2893,6 +3065,10 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Username for JSON-RPC connections Nom d'usuari per a connexions JSON-RPC + + Wallet needed to be rewritten: restart Bitcoin Core to complete + Cal reescriure el moneder: reiniceu el Bitcoin Core per completar-ho. + Warning Avís @@ -2901,6 +3077,14 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Warning: This version is obsolete, upgrade required! Avís: esta versió està obsoleta. És necessari actualitzar-la! + + Warning: Unsupported argument -benchmark ignored, use -debug=bench. + Avís: s'ha ignorat l'argument no acceptat de -benchmark. Feu servir -debug=bench. + + + Warning: Unsupported argument -debugnet ignored, use -debug=net. + Avís: s'ha ignorat l'argument no acceptat de -debugnet. Feu servir -debug=net. + Zapping all transactions from wallet... Se suprimeixen totes les transaccions del moneder... @@ -2925,10 +3109,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Upgrade wallet to latest format Actualitza el moneder a l'últim format - - Set key pool size to <n> (default: 100) - Defineix el límit de nombre de claus a <n> (per defecte: 100) - Rescan the block chain for missing wallet transactions Reescaneja la cadena de blocs en les transaccions de moneder perdudes @@ -2937,14 +3117,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Use OpenSSL (https) for JSON-RPC connections Utilitza OpenSSL (https) per a connexions JSON-RPC - - Server certificate file (default: server.cert) - Fitxer del certificat de servidor (per defecte: server.cert) - - - Server private key (default: server.pem) - Clau privada del servidor (per defecte: server.pem) - This help message Este misatge d'ajuda diff --git a/src/qt/locale/bitcoin_ca_ES.ts b/src/qt/locale/bitcoin_ca_ES.ts index f3b2b4a926..5fa69e798d 100644 --- a/src/qt/locale/bitcoin_ca_ES.ts +++ b/src/qt/locale/bitcoin_ca_ES.ts @@ -390,10 +390,6 @@ Tabs toolbar Barra d'eines de les pestanyes - - [testnet] - [testnet] - Bitcoin Core Nucli de Bitcoin @@ -434,10 +430,6 @@ No block source available... No hi ha cap font de bloc disponible... - - Processed %1 blocks of transaction history. - Proccessats %1 blocs del històric de transaccions. - %n hour(s) %n hora%n hores @@ -912,15 +904,7 @@ Address: %4 Error Error - - GB of free space available - GB d'espai lliure disponible - - - (of %1GB needed) - (d' %1GB necessari) - - + OpenURIDialog @@ -1161,10 +1145,6 @@ Address: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. La informació mostrada pot no estar al día. El teu moneder es sincronitza automàticament amb la xarxa Bitcoin un cop s'ha establert connexió, però aquest proces no s'ha completat encara. - - Wallet - Moneder - Watch-only: Només lectura: @@ -1217,10 +1197,6 @@ Address: %4 Current total balance in watch-only addresses Balanç total actual en adreces de només lectura - - <b>Recent transactions</b> - <b>Transaccions recents</b> - out of sync Fora de sincronia @@ -1480,10 +1456,6 @@ Address: %4 Services Serveis - - Sync Node - Node de sincronització - Starting Height Alçada inicial @@ -1612,14 +1584,6 @@ Address: %4 Outbound Sortint - - Yes - - - - No - No - Unknown Desconegut @@ -2468,6 +2432,10 @@ Address: %4 Mined Minat + + watch-only + només lectura + (n/a) (n/a) @@ -2694,26 +2662,10 @@ Address: %4 Options: Opcions: - - Specify configuration file (default: bitcoin.conf) - Especifica un fitxer de configuració (per defecte: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Especifica un fitxer pid (per defecte: bitcoind.pid) - Specify data directory Especifica el directori de dades - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Escolta connexions a <port> (per defecte: 8333 o testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Manté com a molt <n> connexions a iguals (per defecte: 125) - Connect to a node to retrieve peer addresses, and disconnect Connecta al node per obtenir les adreces de les connexions, i desconnecta @@ -2722,18 +2674,6 @@ Address: %4 Specify your own public address Especifiqueu la vostra adreça pública - - Threshold for disconnecting misbehaving peers (default: 100) - Límit per a desconectar connexions errònies (per defecte: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Nombre de segons abans de reconectar amb connexions errònies (per defecte: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Escolta connexions JSON-RPC al port <port> (per defecte: 8332 o testnet:18332) - Accept command line and JSON-RPC commands Accepta la línia d'ordres i ordres JSON-RPC @@ -2773,18 +2713,10 @@ També es recomana establir la notificació d'alertes i així sereu notificat de per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Xifrats acceptables (per defecte: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Vincula a una adreça específica i sempre escolta-hi. Utilitza la notació [host]:port per IPv6 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - Limita contínuament les transaccions gratuïtes a <n>*1000 bytes per minut (per defecte: 15) - Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup Elimina totes les transaccions del moneder i només recupera aquelles de la cadena de blocs a través de -rescan a l'inici @@ -2805,14 +2737,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Executa una ordre quan una transacció del moneder canviï (%s en cmd es canvia per TxID) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - Buida l'activitat de la base de dades de la memòria disponible al registre del disc cada <n> megabytes (per defecte: 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - Com d'exhaustiva és la verificació de blocs de -checkblocks is (0-4, per defecte: 3) - In this mode -genproclimit controls how many blocks are generated immediately. En aquest mode -genproclimit controla quants blocs es generen immediatament. @@ -2821,10 +2745,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Defineix el nombre de fils de verificació d'scripts (%u a %d, 0 = auto, <0 = deixa tants nuclis lliures, per defecte: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - Defineix el límit de processadors quan està activada la generació (-1 = sense límit, per defecte: -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Aquesta és una versió de pre-llançament - utilitza-la sota la teva responsabilitat - No usar per a minería o aplicacions de compra-venda @@ -2833,10 +2753,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Unable to bind to %s on this computer. Bitcoin Core is probably already running. No es pot enllaçar %s a aquest ordinador. El Bitcoin Core probablement ja estigui executant-s'hi. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Utilitza un proxy SOCKS5 apart per arribar a iguals a través de serveis de Tor ocults (per defecte: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Avís: el -paytxfee és molt elevat! Aquesta és la comissió de transacció que pagareu si envieu una transacció. @@ -2861,10 +2777,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com (default: 1) (per defecte: 1) - - (default: wallet.dat) - (per defecte: wallet.dat) - <category> can be: <category> pot ser: @@ -2893,10 +2805,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Debugging/Testing options: Opcions de depuració/proves: - - Disable safemode, override a real safe mode event (default: 0) - Inhabilia el mode segur (safemode), invalida un esdeveniment de mode segur real (per defecte: 0) - Discover own IP address (default: 1 when listening and no -externalip) Descobreix la pròpia adreça IP (per defecte: 1 quan escoltant i no -externalip) @@ -2933,66 +2841,10 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Wallet locked, unable to create transaction! Error: El moneder està bloquejat, no és possible crear la transacció! - - Error: system error: - Error: error de sistema: - Failed to listen on any port. Use -listen=0 if you want this. Ha fallat escoltar a qualsevol port. Feu servir -listen=0 si voleu fer això. - - Failed to read block info - Ha fallat la lectura de la informació del bloc - - - Failed to read block - Ha fallat la lectura del bloc - - - Failed to sync block index - Ha fallat la sincronització de l'índex de blocs - - - Failed to write block index - Ha fallat la escriptura de l'índex de blocs - - - Failed to write block info - Ha fallat la escriptura de la informació de bloc - - - Failed to write block - Ha fallat l'escriptura del bloc - - - Failed to write file info - Ha fallat l'escriptura de la informació de fitxer - - - Failed to write to coin database - Ha fallat l'escriptura de la basse de dades de monedes - - - Failed to write transaction index - Ha fallat l'escriptura de l'índex de transaccions - - - Failed to write undo data - Ha fallat el desfer de dades - - - Force safe mode (default: 0) - Força el mode segur (per defecte: 0) - - - Generate coins (default: 0) - Genera monedes (per defecte: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Quants blocs s'han de confirmar a l'inici (per defecte: 288, 0 = tots) - If <category> is not supplied, output all debugging information. Si no se subministra <category>, mostra tota la informació de depuració. @@ -3013,10 +2865,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Not enough file descriptors available. No hi ha suficient descriptors de fitxers disponibles. - - Prepend debug output with timestamp (default: 1) - Posa davant de la sortida de depuració una marca horària (per defecte: 1) - Rebuild block chain index from current blk000??.dat files Reconstrueix l'índex de la cadena de blocs dels fitxers actuals blk000??.dat @@ -3029,22 +2877,10 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set maximum block size in bytes (default: %d) Defineix la mida màxim del bloc en bytes (per defecte: %d) - - Set the number of threads to service RPC calls (default: 4) - Estableix el nombre de fils per atendre trucades RPC (per defecte: 4) - Specify wallet file (within data directory) Especifica un fitxer de moneder (dins del directori de dades) - - Spend unconfirmed change when sending transactions (default: 1) - Gasta el canvi sense confirmar en enviar transaccions (per defecte: 1) - - - Stop running after importing blocks from disk (default: 0) - Atura l'execució després d'importar blocs del disc (per defecte: 0) - This is intended for regression testing tools and app development. Això es així per a eines de proves de regressió per al desenvolupament d'aplicacions. @@ -3073,10 +2909,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Imports blocks from external blk000??.dat file Importa blocs de un fitxer blk000??.dat extern - - (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) - (per defecte: 1, 1 = mantingues les metadades de les tx, p. ex., el propietari del compte i la informació de sol·licitud de pagament, 2 = descarta les metadades de tx) - Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times Permet les connexions JSON-RPC d'una font específica. Vàlid per a <ip> són una IP individual (p. ex., 1.2.3.4), una xarxa / màscara de xarxa (p. ex., 1.2.3.4/255.255.255.0) o una xarxa/CIDR (p. ex., 1.2.3.4/24). Es pot especificar aquesta opció moltes vegades @@ -3109,10 +2941,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. Error: s'ha trobat un argument no permès de -socks. Ja no es pot definir més la versió de SOCKS, només s'accepten els proxies de SOCKS5.ç - - Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) - Executa l'ordre quan una tx de xarxa gasta de nou una tx d'entrada del moneder (%s=torna a gastar TxID, %t=TxID del moneder) - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Executa l'ordre quan es rebi un avís rellevant o veiem una forquilla molt llarga (%s en cmd és reemplaçat per un missatge) @@ -3125,14 +2953,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) Comissions (en BTC/Kb) inferiors a això es consideren de comissió zero per a la creació de la transacció (per defecte: %s) - - If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) - Si no s'ha definit paytxfee, inclou comissió suficient per tal que les transaccions siguin confirmades dins d'una mitja de n blocs (per defecte: 1) - - - Output debugging information (default: 0, supplying <category> is optional) - Informació de la depuració de sortida (per defecte: 0, proporcionar <category> és opcional) - Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) Consulta a adreces d'iguals a través de DNS, si es troba baix en adreces (per defecte: 1 a menys que -connect) @@ -3149,18 +2969,10 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. Avís: comproveu que la data i hora del vostre ordinador siguin correctes! Si el vostre rellotge no és correcte, el Bitcoin Core no funcionarà correctament. - - Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. - Posa en la llista blanca els iguals que es connectin de la màscara de xarxa o ip donada. Es pot especificar moltes vegades. - Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway Els iguals en la llista blanca no poden ser bandejats per DoS i es transmetran sempre llurs transaccions, fins i tot si ja són a la mempool. Això és útil, p. ex., per a una passarel·la - - Always query for peer addresses via DNS lookup (default: 0) - Consulta sempre adreces d'iguals a través de consultes DNS (per defecte: 0) - Cannot resolve -whitebind address: '%s' No es pot resoldre l'adreça -whitebind: «%s» @@ -3189,14 +3001,14 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Fee (in BTC/kB) to add to transactions you send (default: %s) Comissió en (BTC/kB) per afegir a les transaccions que envieu (per defecte: %s) - - Include IP addresses in debug output (default: 0) - Inclou adreces IP en la sortida de depuració (per defecte: 0) - Information &Informació + + Initialization sanity check failed. Bitcoin Core is shutting down. + Ha fallat la inicialització de la comprovació de validesa. El Bitcoin Core s'està aturant. + Invalid amount for -minrelaytxfee=<amount>: '%s' Import no vàlid per a -minrelaytxfee=<amount>: «%s» @@ -3206,41 +3018,29 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Import no vàlid per a -mintxfee=<amount>: «%s» - Limit size of signature cache to <n> entries (default: 50000) - Mida límit de la memòria cau de signatura per a <n> entrades (per defecte: 50000) + Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) + Import no vàlid per a -paytxfee=<amount>: «%s» (ha de ser com a mínim %s) - Log transaction priority and fee per kB when mining blocks (default: 0) - Registra la prioritat de transacció i comissió per kB en minar blocs (per defecte: 0) + Invalid netmask specified in -whitelist: '%s' + S'ha especificat una màscara de xarxa no vàlida a -whitelist: «%s» - Maintain a full transaction index (default: 0) - Manté l'índex sencer de transaccions (per defecte: 0) + Keep at most <n> unconnectable blocks in memory (default: %u) + Manté com a màxim <n> blocs no connectables en memòria (per defecte: %u) - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Mida màxima del buffer de recepció per a cada connexió, <n>*1000 bytes (default: 5000) + Need to specify a port with -whitebind: '%s' + Cal especificar un port amb -whitebind: «%s» - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Mida màxima del buffer d'enviament per a cada connexió, <n>*1000 bytes (default: 5000) - - - Only accept block chain matching built-in checkpoints (default: 1) - Només accepta cadenes de blocs que coincideixin amb els punts de prova (per defecte: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Només connecta als nodes de la xarxa <net> (IPv4, IPv6 o Tor) + Node relay options: + Opcions de transmissió del node: Print block on startup, if found in block index Imprimeix el block a l'inici, si es troba l'índex de blocs - - Print block tree on startup (default: 0) - Imprimeix l'arbre de blocs a l'inici (per defecte: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) Opcions RPC SSL: (veieu el wiki del Bitcoin per a instruccions de configuració de l'SSL) @@ -3257,22 +3057,10 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Randomly fuzz 1 of every <n> network messages Introdueix incertesa en 1 de cada <n> missatges de la xarxa - - Run a thread to flush wallet periodically (default: 1) - Executa un fil per buidar el moneder periòdicament (per defecte: 1) - Send trace/debug info to console instead of debug.log file Envia informació de traça/depuració a la consola en comptes del fitxer debug.log - - Set minimum block size in bytes (default: 0) - Defineix una mida mínima de bloc en bytes (per defecte: 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - Defineix el senyal DB_PRIVATE en l'entorn db del moneder (per defecte: 1) - Show all debugging options (usage: --help -help-debug) Mostra totes les opcions de depuració (ús: --help --help-debug) @@ -3286,12 +3074,8 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Ha fallat la signatura de la transacció - Specify connection timeout in milliseconds (default: 5000) - Especifica el temps limit per a un intent de connexió en mil·lisegons (per defecte: 5000) - - - System error: - Error de sistema: + This is experimental software. + Això és programari experimental. Transaction amount too small @@ -3306,8 +3090,8 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com La transacció és massa gran - Use UPnP to map the listening port (default: 0) - Utilitza UPnP per a mapejar els ports d'escolta (per defecte: 0) + Unable to bind to %s on this computer (bind returned error %s) + No s'ha pogut vincular a %s en aquest ordinador (la vinculació ha retornat l'error %s) Use UPnP to map the listening port (default: 1 when listening) @@ -3361,10 +3145,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Upgrade wallet to latest format Actualitza el moneder a l'últim format - - Set key pool size to <n> (default: 100) - Defineix el límit de nombre de claus a <n> (per defecte: 100) - Rescan the block chain for missing wallet transactions Reescaneja la cadena de blocs en les transaccions de moneder perdudes @@ -3373,14 +3153,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Use OpenSSL (https) for JSON-RPC connections Utilitza OpenSSL (https) per a connexions JSON-RPC - - Server certificate file (default: server.cert) - Fitxer del certificat de servidor (per defecte: server.cert) - - - Server private key (default: server.pem) - Clau privada del servidor (per defecte: server.pem) - This help message Aquest misatge d'ajuda diff --git a/src/qt/locale/bitcoin_cs.ts b/src/qt/locale/bitcoin_cs.ts index 2aa017fdf8..44fda5afed 100644 --- a/src/qt/locale/bitcoin_cs.ts +++ b/src/qt/locale/bitcoin_cs.ts @@ -390,10 +390,6 @@ Tabs toolbar Panel s listy - - [testnet] - [testnet] - Bitcoin Core Bitcoin Core @@ -434,10 +430,6 @@ No block source available... Není dostupný žádný zdroj bloků... - - Processed %1 blocks of transaction history. - Zpracováno %1 bloků transakční historie. - %1 and %2 %1 a %2 @@ -900,15 +892,7 @@ Adresa: %4 Error Chyba - - GB of free space available - GB volného místa - - - (of %1GB needed) - (z potřebných %1 GB) - - + OpenURIDialog @@ -1149,10 +1133,6 @@ Adresa: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Zobrazené informace nemusí být aktuální. Tvá peněženka se automaticky sesynchronizuje s Bitcoinovou sítí, jakmile se s ní spojí. Zatím ale ještě není synchronizace dokončena. - - Wallet - Peněženka - Watch-only: Sledované: @@ -1205,10 +1185,6 @@ Adresa: %4 Current total balance in watch-only addresses Aktuální stav účtu sledovaných adres - - <b>Recent transactions</b> - <b>Poslední transakce</b> - out of sync nesynchronizováno @@ -1468,10 +1444,6 @@ Adresa: %4 Services Služby - - Sync Node - Synchronizační uzel - Starting Height Prvotní výška @@ -1600,14 +1572,6 @@ Adresa: %4 Outbound Ven - - Yes - Ano - - - No - Ne - Unknown Neznámá @@ -2452,6 +2416,10 @@ Adresa: %4 Mined Vytěženo + + watch-only + sledovací + (n/a) (n/a) @@ -2678,26 +2646,10 @@ Adresa: %4 Options: Možnosti: - - Specify configuration file (default: bitcoin.conf) - Konfigurační soubor (výchozí: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - PID soubor (výchozí: bitcoind.pid) - Specify data directory Adresář pro data - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Čekat na spojení na <portu> (výchozí: 8333 nebo testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Povolit nejvýše <n> protějšků (výchozí: 125) - Connect to a node to retrieve peer addresses, and disconnect Připojit se k uzlu, získat adresy jeho protějšků a odpojit se @@ -2706,18 +2658,6 @@ Adresa: %4 Specify your own public address Specifikuj svou veřejnou adresu - - Threshold for disconnecting misbehaving peers (default: 100) - Práh pro odpojování zlobivých protějšků (výchozí: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Doba ve vteřinách, po kterou se nebudou moci zlobivé protějšky znovu připojit (výchozí: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Čekat na JSON RPC spojení na <portu> (výchozí: 8332 nebo testnet: 18332) - Accept command line and JSON-RPC commands Akceptovat příkazy z příkazové řádky a přes JSON-RPC @@ -2758,18 +2698,10 @@ Je také doporučeno si nastavit alertnotify, abys byl upozorněn na případné například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Akceptovatelné šifry (výchozí: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Poslouchat na zadané adrese. Pro zápis IPv6 adresy použij notaci [adresa]:port - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - Kontinuálně omezovat bezpoplatkové transakce na <n>*1000 bajtů za minutu (výchozí: 15) - Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup Smazat všechny transakce peněženky a při startu obnovit pouze relevantní části řetězce bloků pomocí -rescan @@ -2790,14 +2722,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Spustit příkaz, když se objeví transakce týkající se peněženky (%s se v příkazu nahradí za TxID) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - Promítnout databázovou aktivitu z paměťového prostoru do záznamu na disku každých <n> megabajtů (výchozí: 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - Jak moc důkladná má být verifikace bloků -checkblocks (0-4, výchozí: 3) - In this mode -genproclimit controls how many blocks are generated immediately. V tomto módu -genproclimit určuje, kolik bloků je vygenerováno okamžitě. @@ -2806,10 +2730,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Nastavení počtu vláken pro verifikaci skriptů (%u až %d, 0 = automaticky, <0 = nechat daný počet jader volný, výchozí: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - Nastavit omezení procesoru pro zapnuté generování (-1 = bez omezení, výchozí: -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Tohle je testovací verze – používej ji jen na vlastní riziko, ale rozhodně ji nepoužívej k těžbě nebo pro obchodní aplikace @@ -2818,10 +2738,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Unable to bind to %s on this computer. Bitcoin Core is probably already running. Nedaří se mi připojit na %s na tomhle počítači. Bitcoin Core už pravděpodobně jednou běží. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Použít samostatnou SOCKS5 proxy ke spojení s protějšky přes skryté služby v Toru (výchozí: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Upozornění: -paytxfee je nastaveno velmi vysoko! Toto je transakční poplatek, který zaplatíš za každou poslanou transakci. @@ -2846,10 +2762,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com (default: 1) (výchozí: 1) - - (default: wallet.dat) - (výchozí: wallet.dat) - <category> can be: <category> může být: @@ -2878,10 +2790,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Debugging/Testing options: Možnosti ladění/testování: - - Disable safemode, override a real safe mode event (default: 0) - Vypnout bezpečný režim (safemode), překrýt skutečnou událost bezpečného režimu (výchozí: 0) - Discover own IP address (default: 1 when listening and no -externalip) Zjistit vlastní IP adresu (výchozí: 1, pokud naslouchá a není zadáno -externalip) @@ -2918,66 +2826,10 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Wallet locked, unable to create transaction! Chyba: Peněženka je zamčená, nemohu vytvořit transakci! - - Error: system error: - Chyba: systémová chyba: - Failed to listen on any port. Use -listen=0 if you want this. Nepodařilo se naslouchat na žádném portu. Použij -listen=0, pokud to byl tvůj záměr. - - Failed to read block info - Nepodařilo se přečíst informace o bloku - - - Failed to read block - Nepodařilo se přečíst blok - - - Failed to sync block index - Nepodařilo se sesynchronizovat index bloků - - - Failed to write block index - Nepodařilo se zapsat index bloků - - - Failed to write block info - Nepodařilo se zapsat informace o bloku - - - Failed to write block - Nepodařilo se zapsat blok - - - Failed to write file info - Nepodařilo se zapsat informace o souboru - - - Failed to write to coin database - Selhal zápis do databáze mincí - - - Failed to write transaction index - Nepodařilo se zapsat index transakcí - - - Failed to write undo data - Nepodařilo se zapsat data o vracení změn - - - Force safe mode (default: 0) - Vynutit bezpečný mód (výchozí: 0) - - - Generate coins (default: 0) - Generovat mince (výchozí: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Kolik bloků při startu zkontrolovat (výchozí: 288, 0 = všechny) - If <category> is not supplied, output all debugging information. Pokud není <category> zadána, bude tisknout veškeré ladicí informace. @@ -2998,10 +2850,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Not enough file descriptors available. Je nedostatek deskriptorů souborů. - - Prepend debug output with timestamp (default: 1) - Připojit před ladicí výstup časové razítko (výchozí: 1) - Rebuild block chain index from current blk000??.dat files Znovu vytvořit index řetězce bloků z aktuálních blk000??.dat souborů @@ -3014,22 +2862,10 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set maximum block size in bytes (default: %d) Nastavit maximální velikost bloku v bajtech (výchozí: %d) - - Set the number of threads to service RPC calls (default: 4) - Nastavení počtu vláken pro servisní RPC volání (výchozí: 4) - Specify wallet file (within data directory) Udej název souboru s peněženkou (v rámci datového adresáře) - - Spend unconfirmed change when sending transactions (default: 1) - Utrácet i ještě nepotvrzené drobné při posílání transakcí (výchozí: 1) - - - Stop running after importing blocks from disk (default: 0) - Ukončit se po importu bloků z disku (výchozí: 0) - This is intended for regression testing tools and app development. Tohle je určeno pro nástroje na regresní testování a vyvíjení aplikací. @@ -3058,10 +2894,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Imports blocks from external blk000??.dat file Importovat bloky z externího souboru blk000??.dat - - (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) - (výchozí: 1, 1 = ukládat transakční metadata, např. majitele účtu a informace o platebním požadavku, 2 = mazat transakční metadata) - Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times Povolit JSON-RPC spojení ze specifikovaného zdroje. Platnou hodnotou <ip> je jednotlivá IP adresa (např. 1.2.3.4), síť/maska (např. 1.2.3.4/255.255.255.0) nebo síť/CIDR (např. 1.2.3.4/24). Tuto volbu lze použít i vícekrát @@ -3098,10 +2930,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. Chyba: Byl použit nepodporovaný argument -socks. Nastavení verze SOCKS už není možné, podporovány jsou pouze SOCKS5 proxy. - - Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) - Spustit příkaz, když nějaká transakce na síti znovu utrácí vstup transakce této peněženky (%s=TxID cizí transakce, %t=TxID transakce peněženky) - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Spustit příkaz, když přijde relevantní upozornění nebo když dojde k opravdu dlouhému rozštěpení řetezce bloků (%s se v příkazu nahradí zprávou) @@ -3114,14 +2942,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) Poplatky (v BTC/Kb) menší než tato hodnota jsou považovány za nulové pro účely vytváření transakcí (výchozí: %s) - - If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) - Pokud paytxfee není nastaveno, platit dostatečný poplatek na to, aby byly transakce potvrzeny v průměru během n bloků (výchozí: 1) - - - Output debugging information (default: 0, supplying <category> is optional) - Tisknout ladicí informace (výchozí: 0, zadání <category> je volitelné) - Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) Při nedostatku adres získat další protějšky z DNS (výchozí: 1, pokud není použito -connect) @@ -3138,18 +2958,10 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. Upozornění: Zkontroluj, že máš v počítači správně nastavený datum a čas! Pokud jsou nastaveny špatně, Bitcoin Core nebude fungovat správně. - - Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. - Umístit na bílou listinu protějšky připojující se z dané podsítě či ip. Lze zadat i vícekrát. - Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway Na protějšky na bílé listině se nevztahuje DoS klatba a jejich transakce jsou vždy přeposílány, i když už třeba jsou v mempoolu, což je užitečné např. pro bránu - - Always query for peer addresses via DNS lookup (default: 0) - Vždy získávat adresy dalších protějšků přes DNS (výchozí: 0) - Cannot resolve -whitebind address: '%s' Nemohu přeložit -whitebind adresu: '%s' @@ -3178,10 +2990,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Fee (in BTC/kB) to add to transactions you send (default: %s) Poplatek (v BTC/kB), který se přidá ke každé odeslané transakci (výchozí: %s) - - Include IP addresses in debug output (default: 0) - Zaznamenávat do ladicích výstupů i IP adresy (výchozí: 0) - Information Informace @@ -3210,26 +3018,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Keep at most <n> unconnectable blocks in memory (default: %u) Držet v paměti nejvýše <n> nespojitelných bloků (výchozí: %u) - - Limit size of signature cache to <n> entries (default: 50000) - Omezit velikost vyrovnávací paměti pro podpisy na <n> položek (výchozí: 50000) - - - Log transaction priority and fee per kB when mining blocks (default: 0) - Zaznamenávat během těžení bloků prioritu transakce a poplatek za kB (výchozí: 0) - - - Maintain a full transaction index (default: 0) - Spravovat úplný index transakcí (výchozí: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Maximální velikost přijímacího bufferu pro každé spojení, <n>*1000 bajtů (výchozí: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Maximální velikost odesílacího bufferu pro každé spojení, <n>*1000 bajtů (výchozí: 1000) - Need to specify a port with -whitebind: '%s' V rámci -whitebind je třeba specifikovat i port: '%s' @@ -3238,22 +3026,10 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Node relay options: Možnosti přeposílání: - - Only accept block chain matching built-in checkpoints (default: 1) - Uznávat pouze řetězec bloků, který odpovídá vnitřním kontrolním bodům (výchozí: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Připojit se pouze k uzlům v <net> síti (IPv4, IPv6 nebo Tor) - Print block on startup, if found in block index Vypsat při startu blok,pokud se nachází v indexu bloků - - Print block tree on startup (default: 0) - Vypsat při startu strom bloků (výchozí: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) Možnosti SSL pro RPC: (viz instrukce nastavení SSL na Bitcoin Wiki) @@ -3270,30 +3046,10 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Randomly fuzz 1 of every <n> network messages Náhodně pozměňovat jednu z každých <n> síťových zpráv - - Relay and mine data carrier transactions (default: 1) - Přeposílat a těžit transakce nesoucí data (výchozí: 1) - - - Relay non-P2SH multisig (default: 1) - Přeposílat ne-P2SH multisig (výchozí: 1) - - - Run a thread to flush wallet periodically (default: 1) - Spustit vlákno pročišťující periodicky peněženku (výchozí: 1) - Send trace/debug info to console instead of debug.log file Posílat stopovací/ladicí informace do konzole místo do souboru debug.log - - Set minimum block size in bytes (default: 0) - Nastavit minimální velikost bloku v bajtech (výchozí: 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - Nastavit příznak DB_PRIVATE v databázovém prostředí peněženky (výchozí: 1) - Show all debugging options (usage: --help -help-debug) Zobrazit všechny možnosti ladění (užití: --help -help-debug) @@ -3306,14 +3062,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Signing transaction failed Nepodařilo se podepsat transakci - - Specify connection timeout in milliseconds (default: 5000) - Zadej časový limit spojení v milisekundách (výchozí: 5000) - - - System error: - Systémová chyba: - This is experimental software. Tohle je experimentální program. @@ -3334,10 +3082,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Unable to bind to %s on this computer (bind returned error %s) Nedaří se mi připojit na %s na tomhle počítači (operace bind vrátila chybu %s) - - Use UPnP to map the listening port (default: 0) - Použít UPnP k namapování naslouchacího portu (výchozí: 0) - Use UPnP to map the listening port (default: 1 when listening) Použít UPnP k namapování naslouchacího portu (výchozí: 1, pokud naslouchá) @@ -3390,10 +3134,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Upgrade wallet to latest format Převést peněženku na nejnovější formát - - Set key pool size to <n> (default: 100) - Nastavit zásobník klíčů na velikost <n> (výchozí: 100) - Rescan the block chain for missing wallet transactions Přeskenovat řetězec bloků na chybějící transakce tvé pěněženky @@ -3402,14 +3142,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Use OpenSSL (https) for JSON-RPC connections Použít OpenSSL (https) pro JSON-RPC spojení - - Server certificate file (default: server.cert) - Soubor se serverovým certifikátem (výchozí: server.cert) - - - Server private key (default: server.pem) - Soubor se serverovým soukromým klíčem (výchozí: server.pem) - This help message Tato nápověda diff --git a/src/qt/locale/bitcoin_cy.ts b/src/qt/locale/bitcoin_cy.ts index 3380733c63..cf82f2be27 100644 --- a/src/qt/locale/bitcoin_cy.ts +++ b/src/qt/locale/bitcoin_cy.ts @@ -154,10 +154,6 @@ Tabs toolbar Bar offer tabiau - - [testnet] - [testnet] - Error Gwall @@ -285,10 +281,6 @@ Form Ffurflen - - <b>Recent transactions</b> - <b>Trafodion diweddar</b> - PaymentServer diff --git a/src/qt/locale/bitcoin_da.ts b/src/qt/locale/bitcoin_da.ts index f292766ec8..05ee62e020 100644 --- a/src/qt/locale/bitcoin_da.ts +++ b/src/qt/locale/bitcoin_da.ts @@ -11,7 +11,7 @@ &New - Ny + &Ny Copy the currently selected address to the system clipboard @@ -19,15 +19,15 @@ &Copy - Kopiér + &Kopiér C&lose - Luk + &Luk &Copy Address - Kopiér adresse + &Kopiér adresse Delete the currently selected address from the list @@ -39,11 +39,11 @@ &Export - Eksportér + &Eksportér &Delete - Slet + &Slet Choose the address to send coins to @@ -55,7 +55,7 @@ C&hoose - Vælg + &Vælg Sending addresses @@ -75,11 +75,11 @@ Copy &Label - Kopiér mærkat + Kopiér &mærkat &Edit - Redigér + &Redigér Export Address List @@ -224,7 +224,7 @@ BitcoinGUI Sign &message... - Underskriv besked … + Underskriv &besked … Synchronizing with network... @@ -232,7 +232,7 @@ &Overview - Oversigt + &Oversigt Node @@ -244,7 +244,7 @@ &Transactions - Transaktioner + &Transaktioner Browse transaction history @@ -252,7 +252,7 @@ E&xit - Luk + &Luk Quit application @@ -260,7 +260,7 @@ About &Qt - Om Qt + Om &Qt Show information about Qt @@ -268,31 +268,31 @@ &Options... - Indstillinger … + &Indstillinger … &Encrypt Wallet... - Kryptér tegnebog … + &Kryptér tegnebog … &Backup Wallet... - Sikkerhedskopiér tegnebog … + &Sikkerhedskopiér tegnebog … &Change Passphrase... - Skift adgangskode … + &Skift adgangskode … &Sending addresses... - Afsendelsesadresser … + &Afsendelsesadresser … &Receiving addresses... - Modtagelsesadresser … + &Modtagelsesadresser … Open &URI... - Åbn URI … + &Åbn URI … Bitcoin Core client @@ -324,7 +324,7 @@ &Debug window - Fejlsøgningsvindue + &Fejlsøgningsvindue Open debugging and diagnostic console @@ -332,7 +332,7 @@ &Verify message... - Verificér besked … + &Verificér besked … Bitcoin @@ -344,11 +344,11 @@ &Send - Send + &Send &Receive - Modtag + &Modtag Show information about Bitcoin Core @@ -356,7 +356,7 @@ &Show / Hide - Vis / skjul + &Vis / skjul Show or hide the main Window @@ -376,24 +376,20 @@ &File - Fil + &Fil &Settings - Opsætning + &Opsætning &Help - Hjælp + &Hjælp Tabs toolbar Faneværktøjslinje - - [testnet] - [testnetværk] - Bitcoin Core Bitcoin Core @@ -404,7 +400,7 @@ &About Bitcoin Core - Om Bitcoin Core + &Om Bitcoin Core Show the list of used sending addresses and labels @@ -420,7 +416,7 @@ &Command-line options - Tilvalg for kommandolinje + Tilvalg for &kommandolinje Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options @@ -434,10 +430,6 @@ No block source available... Ingen blokkilde tilgængelig … - - Processed %1 blocks of transaction history. - Behandlet %1 blokke af transaktionshistorikken. - %n hour(s) %n time%n timer @@ -486,6 +478,10 @@ Up to date Opdateret + + Processed %n blocks of transaction history. + %n blok af transaktionshistorikken er blevet behandlet.%n blokke af transaktionshistorikken er blevet behandlet. + Catching up... Indhenter … @@ -753,7 +749,7 @@ Adresse: %4 &Label - Mærkat + &Mærkat The label associated with this address list entry @@ -765,7 +761,7 @@ Adresse: %4 &Address - Adresse + &Adresse New receiving address @@ -916,15 +912,11 @@ Adresse: %4 Error Fejl - - GB of free space available - GB fri plads tilgængelig + + %n GB of free space available + %n GB fri plads tilgængelig%n GB fri plads tilgængelig - - (of %1GB needed) - (ud af %1 GB behøvet) - - + OpenURIDialog @@ -956,7 +948,7 @@ Adresse: %4 &Main - Generelt + &Generelt Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. @@ -964,7 +956,7 @@ Adresse: %4 Pay transaction &fee - Betal transaktionsgebyr + Betal transaktions&gebyr Automatically start Bitcoin after logging in to the system. @@ -972,11 +964,11 @@ Adresse: %4 &Start Bitcoin on system login - Start Bitcoin ved systemlogin + &Start Bitcoin ved systemlogin Size of &database cache - Størrelsen på databasens cache + Størrelsen på &databasens cache MB @@ -984,7 +976,7 @@ Adresse: %4 Number of script &verification threads - Antallet af scriptverificeringstråde + Antallet af script&verificeringstråde Accept connections from outside @@ -1000,7 +992,7 @@ Adresse: %4 &Connect through SOCKS proxy (default proxy): - Forbind gennem SOCKS-proxy (standard-proxy): + &Forbind gennem SOCKS-proxy (standard-proxy): IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) @@ -1024,11 +1016,11 @@ Adresse: %4 &Reset Options - Nulstil indstillinger + &Nulstil indstillinger &Network - Netværk + &Netværk (0 = auto, <0 = leave that many cores free) @@ -1036,7 +1028,7 @@ Adresse: %4 W&allet - Tegnebog + &Tegnebog Expert @@ -1044,7 +1036,7 @@ Adresse: %4 Enable coin &control features - Slå egenskaber for coin-styring til + Slå egenskaber for &coin-styring til 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. @@ -1052,7 +1044,7 @@ Adresse: %4 &Spend unconfirmed change - Brug ubekræftede byttepenge + &Brug ubekræftede byttepenge Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. @@ -1060,15 +1052,15 @@ Adresse: %4 Map port using &UPnP - Konfigurér port vha. UPnP + Konfigurér port vha. &UPnP Proxy &IP: - Proxy-IP: + Proxy-&IP: &Port: - Port: + &Port: Port of the proxy (e.g. 9050) @@ -1076,7 +1068,7 @@ Adresse: %4 &Window - Vindue + &Vindue Show only a tray icon after minimizing the window. @@ -1084,7 +1076,7 @@ Adresse: %4 &Minimize to the tray instead of the taskbar - Minimér til statusfeltet i stedet for proceslinjen + &Minimér til statusfeltet i stedet for proceslinjen Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. @@ -1092,15 +1084,15 @@ Adresse: %4 M&inimize on close - Minimér ved lukning + M&inimér ved lukning &Display - Visning + &Visning User Interface &language: - Sprog for brugergrænseflade: + &Sprog for brugergrænseflade: The user interface language can be set here. This setting will take effect after restarting Bitcoin. @@ -1108,7 +1100,7 @@ Adresse: %4 &Unit to show amounts in: - Enhed at vise beløb i: + &Enhed at vise beløb i: Choose the default subdivision unit to show in the interface and when sending coins. @@ -1120,11 +1112,11 @@ Adresse: %4 &OK - OK + &O.k. &Cancel - Annullér + &Annullér default @@ -1165,10 +1157,6 @@ Adresse: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Den viste information kan være forældet. Din tegnebog synkroniserer automatisk med Bitcoin-netværket, når en forbindelse etableres, men denne proces er ikke gennemført endnu. - - Wallet - Tegnebog - Watch-only: Kigge: @@ -1197,6 +1185,10 @@ Adresse: %4 Mined balance that has not yet matured Minet saldo, som endnu ikke er modnet + + Balances + Saldi: + Total: Total: @@ -1209,6 +1201,14 @@ Adresse: %4 Your current balance in watch-only addresses Din nuværende saldo på kigge-adresser + + Spendable: + Spendérbar: + + + Recent transactions + Nylige transaktioner + Unconfirmed transactions to watch-only addresses Ubekræftede transaktioner til kigge-adresser @@ -1221,10 +1221,6 @@ Adresse: %4 Current total balance in watch-only addresses Nuværende totalsaldo på kigge-adresser - - <b>Recent transactions</b> - <b>Nyeste transaktioner</b> - out of sync ikke synkroniseret @@ -1379,11 +1375,11 @@ Adresse: %4 QRImageWidget &Save Image... - Gem billede … + &Gem billede … &Copy Image - Kopiér foto + &Kopiér foto Save QR Code @@ -1410,7 +1406,7 @@ Adresse: %4 &Information - Information + &Information Debug window @@ -1462,7 +1458,7 @@ Adresse: %4 &Peers - Andre knuder + Andre &knuder Select a peer to view detailed information. @@ -1484,10 +1480,6 @@ Adresse: %4 Services Tjenester - - Sync Node - Synkroniseringsknude - Starting Height Starthøjde @@ -1530,19 +1522,19 @@ Adresse: %4 &Open - Åbn + &Åbn &Console - Konsol + &Konsol &Network Traffic - Netværkstrafik + &Netværkstrafik &Clear - Ryd + &Ryd Totals @@ -1616,14 +1608,6 @@ Adresse: %4 Outbound Udgående - - Yes - Ja - - - No - Nej - Unknown Ukendt @@ -1637,15 +1621,15 @@ Adresse: %4 ReceiveCoinsDialog &Amount: - Beløb: + &Beløb: &Label: - Mærkat: + &Mærkat: &Message: - Besked: + &Besked: Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. @@ -1653,7 +1637,7 @@ Adresse: %4 R&euse an existing receiving address (not recommended) - Genbrug en eksisterende modtagelsesadresse (anbefales ikke) + &Genbrug en eksisterende modtagelsesadresse (anbefales ikke) An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. @@ -1685,7 +1669,7 @@ Adresse: %4 &Request payment - Anmod om betaling + &Anmod om betaling Show the selected request (does the same as double clicking an entry) @@ -1724,15 +1708,15 @@ Adresse: %4 Copy &URI - Kopiér URI + Kopiér &URI Copy &Address - Kopiér adresse + Kopiér &adresse &Save Image... - Gem billede … + &Gem billede … Request payment to %1 @@ -1866,7 +1850,7 @@ Adresse: %4 Add &Recipient - Tilføj modtager + Tilføj &modtager Clear all fields of the form. @@ -1878,7 +1862,7 @@ Adresse: %4 Clear &All - Ryd alle + Ryd &alle Balance: @@ -1890,7 +1874,7 @@ Adresse: %4 S&end - Afsend + &Afsend Confirm send coins @@ -1993,11 +1977,11 @@ Adresse: %4 SendCoinsEntry A&mount: - Beløb: + &Beløb: Pay &To: - Betal til: + Betal &til: Enter a label for this address to add it to your address book @@ -2005,7 +1989,7 @@ Adresse: %4 &Label: - Mærkat: + &Mærkat: Choose previously used address @@ -2083,7 +2067,7 @@ Adresse: %4 &Sign Message - Underskriv besked + &Underskriv besked You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. @@ -2127,7 +2111,7 @@ Adresse: %4 Sign &Message - Underskriv besked + Underskriv &besked Reset all sign message fields @@ -2135,11 +2119,11 @@ Adresse: %4 Clear &All - Ryd alle + Ryd &alle &Verify Message - Verificér besked + &Verificér besked Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. @@ -2155,7 +2139,7 @@ Adresse: %4 Verify &Message - Verificér besked + Verificér &besked Reset all verify message fields @@ -2472,6 +2456,10 @@ Adresse: %4 Mined Minet + + watch-only + kigge + (n/a) (n/a) @@ -2488,6 +2476,10 @@ Adresse: %4 Type of transaction. Transaktionstype. + + Whether or not a watch-only address is involved in this transaction. + Afgør hvorvidt en kigge-adresse er involveret i denne transaktion. + Destination address of transaction. Destinationsadresse for transaktion. @@ -2583,6 +2575,10 @@ Adresse: %4 Export Transaction History Historik for eksport af transaktioner + + Watch-only + Kigge + Exporting Failed Eksport mislykkedes @@ -2661,7 +2657,7 @@ Adresse: %4 WalletView &Export - Eksportér + &Eksportér Export the data in the current tab to a file @@ -2698,26 +2694,10 @@ Adresse: %4 Options: Indstillinger: - - Specify configuration file (default: bitcoin.conf) - Angiv konfigurationsfil (standard: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Angiv pid-fil (default: bitcoind.pid) - Specify data directory Angiv datamappe - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Lyt til forbindelser på <port> (standard: 8333 eller testnetværk: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Oprethold højest <n> forbindelser til andre knuder i netværket (standard: 125) - Connect to a node to retrieve peer addresses, and disconnect Forbind til en knude for at modtage adresser på andre knuder, og afbryd derefter @@ -2726,18 +2706,6 @@ Adresse: %4 Specify your own public address Angiv din egen offentlige adresse - - Threshold for disconnecting misbehaving peers (default: 100) - Grænse for frakobling fra andre knuder, der opfører sig dårligt (standard: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Antal sekunder, som andre knuder der opfører sig dårligt, skal vente før reetablering af forbindelse (standard: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Lyt til JSON-RPC-forbindelser på <port> (standard: 8332 eller testnetværk: 18332) - Accept command line and JSON-RPC commands Acceptér kommandolinje- og JSON-RPC-kommandoer @@ -2778,18 +2746,10 @@ Det anbefales også at angive alertnotify, så du påmindes om problemer; fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Accepterede krypteringer (standard: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Tildel til den givne adresse og lyt altid på den. Brug [vært]:port-notation for IPv6 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - Rate-begræns kontinuerligt frie transaktioner til <n>*1000 byte i minuttet (standard:15) - Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup Slet alle transaktioner i tegnebogen og genskab kun disse dele af blokkæden gennem -rescan under opstart @@ -2810,14 +2770,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Udfør kommando, når en transaktion i tegnebogen ændres (%s i kommandoen erstattes med TxID) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - Flyt databaseaktivitet fra hukommelsespulje til disklog hver <n> megabytes (standard: 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - Hvor gennemarbejdet blokverificeringen for -checkblocks er (0-4; standard: 3) - In this mode -genproclimit controls how many blocks are generated immediately. I denne tilstand styrer -genproclimit hvor mange blokke, der genereres med det samme. @@ -2826,10 +2778,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Sæt antallet af scriptverificeringstråde (%u til %d, 0 = auto, <0 = efterlad det antal kernet fri, standard: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - Sæt processorbegrænsning for når generering er slået til (-1 = ubegrænset, standard: -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Dette er en foreløbig testudgivelse - brug på eget ansvar - brug ikke til udvinding eller handelsprogrammer @@ -2838,10 +2786,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Unable to bind to %s on this computer. Bitcoin Core is probably already running. Ikke i stand til at tildele til %s på denne computer. Bitcoin Core kører sansynligvis allerede. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Brug separat SOCS5-proxy for at nå andre knuder via tjenester skjult med Tor (standard: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Advarsel: -paytxfee er sat meget højt! Dette er det gebyr du vil betale, hvis du sender en transaktion. @@ -2863,12 +2807,12 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Advarsel: wallet.dat ødelagt, data reddet! Oprindelig wallet.dat gemt som wallet.{timestamp}.bak i %s; hvis din saldo eller dine transaktioner er forkert, bør du genskabe fra en sikkerhedskopi. - (default: 1) - (standard: 1) + Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times. + Sæt andre knuder, der forbinder fra den angivne netmaske eller IP, på hvidliste. Kan angives flere gange. - (default: wallet.dat) - (standard: wallet.dat) + (default: 1) + (standard: 1) <category> can be: @@ -2898,10 +2842,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Debugging/Testing options: Tilvalg for fejlfinding/test: - - Disable safemode, override a real safe mode event (default: 0) - Slå sikker tilstand fra, tilsidesæt hændelser fra sikker tilstand (standard: 0) - Discover own IP address (default: 1 when listening and no -externalip) Find egen IP-adresse (standard: 1 når lytter og ingen -externalip) @@ -2930,6 +2870,10 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error opening block database Åbning af blokdatabase mislykkedes + + Error: A fatal internal error occured, see debug.log for details + Fejl: En fatal intern fejl opstod; se debug.log for detaljer + Error: Disk space is low! Fejl: Mangel på ledig diskplads! @@ -2938,66 +2882,10 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Wallet locked, unable to create transaction! Fejl: Tegnebog låst, kan ikke oprette transaktion! - - Error: system error: - Fejl: systemfejl: - Failed to listen on any port. Use -listen=0 if you want this. Lytning på enhver port mislykkedes. Brug -listen=0, hvis du ønsker dette. - - Failed to read block info - Læsning af blokinformation mislykkedes - - - Failed to read block - Læsning af blok mislykkedes - - - Failed to sync block index - Synkronisering af blokindeks mislykkedes - - - Failed to write block index - Skrivning af blokindeks mislykkedes - - - Failed to write block info - Skrivning af blokinformation mislykkedes - - - Failed to write block - Skrivning af blok mislykkedes - - - Failed to write file info - Skriving af filinformation mislykkedes - - - Failed to write to coin database - Skrivning af bitcoin-database mislykkedes - - - Failed to write transaction index - Skrivning af transaktionsindeks mislykkedes - - - Failed to write undo data - Skrivning af genskabelsesdata mislykkedes - - - Force safe mode (default: 0) - Gennemtving sikker tilstand (standard: 0) - - - Generate coins (default: 0) - Generér bitcoins (standard: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Antal blokke som tjekkes ved opstart (standard: 288, 0=alle) - If <category> is not supplied, output all debugging information. Hvis <kategori> ikke angives, udskriv al fejlsøgningsinformation. @@ -3019,8 +2907,8 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com For få tilgængelige fildeskriptorer. - Prepend debug output with timestamp (default: 1) - Føj tidsstempel foran fejlsøgningsoutput (standard: 1) + Only connect to nodes in network <net> (ipv4, ipv6 or onion) + Tilslut kun til knuder i netværk <net> (IPv4, IPv6 eller Onion) Rebuild block chain index from current blk000??.dat files @@ -3034,26 +2922,18 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set maximum block size in bytes (default: %d) Sæt maksimum blokstørrelse i byte (standard: %d) - - Set the number of threads to service RPC calls (default: 4) - Angiv antallet af tråde til at håndtere RPC-kald (standard: 4) - Specify wallet file (within data directory) Angiv tegnebogsfil (inden for datamappe) - - Spend unconfirmed change when sending transactions (default: 1) - Brug ubekræftede byttepenge under afsendelse af transaktioner (standard: 1) - - - Stop running after importing blocks from disk (default: 0) - Stop kørsel efter import af blokke fra disk (standard: 0) - This is intended for regression testing tools and app development. This is intended for regression testing tools and app development. + + Use UPnP to map the listening port (default: %u) + Brug UPnP til at konfigurere den lyttende port (standard: %u) + Verifying blocks... Verificerer blokke … @@ -3078,10 +2958,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Imports blocks from external blk000??.dat file Importerer blokke fra ekstern blk000??.dat fil - - (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) - (standard: 1, 1 = behold metadata for transaktion, fx kontoindehaver og information om betalingsanmodning, 2 = drop metadata for transaktion) - Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times Tillad JSON-RPC-forbindelser fra angivet kilde. Gyldig for <ip> er en enkelt IP (fx 1.2.3.4), et netværk/netmaske (fx 1.2.3.4/255.255.255.0) eller et netværk/CIDR (fx 1.2.3.4/24). Dette tilvalg kan angives flere gange @@ -3102,6 +2978,10 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. Kan ikke opnå en lås på datamappe %s. Bitcoin Core kører sansynligvis allerede. + + Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:%u) + Rate-begræns kontinuerligt gratis transaktioner til <n>*1000 byte i minuttet (standard: %u) + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) Opret nye filer med systemstandard for rettigheder i stedet for umask 077 (kun virksomt med tegnebogsfunktionalitet slået fra) @@ -3118,10 +2998,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. Fejl: Ikke understøttet argument -socks blev fundet. Det er ikke muligt at angive SOCKS-version længere, da kun SOCKS5-proxier er understøttet. - - Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) - Udfør kommando når en netværkstransaktion genspenderer input fra tegnebogstransaktion (%s=transaktions-ID fra genspendering, %t=transaktions-ID fra tegnebog) - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Udfør kommando, når en relevant alarm modtages eller vi ser en virkelig lang udsplitning (%s i cmd erstattes af besked) @@ -3134,14 +3010,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) Gebyrer (i BTC/Kb) mindre end dette opfattes som nulgebyr for oprettelse af transaktion (standard: %s) - - If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) - Hvis paytxfee ikke er angivet, inkludér da nok gebyr til at transaktioner gennemsnitligt bekræftes inden for n blokke (standard: 1) - - - Output debugging information (default: 0, supplying <category> is optional) - Udskriv fejlsøgningsinformation (standard: 0, angivelse af <kategori> er valgfri) - Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) Forespørgsel @@ -3158,18 +3026,10 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. Advarsel: Undersøg venligst at din computers dato og klokkeslet er korrekt indstillet! Hvis der er fejl i disse vil Bitcoin Core ikke fungere korrekt. - - Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. - Sæt andre knuder, der forbinder fra den angivne netmaske eller ip, på hvidliste. Kan angives flere gange. - Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway Andre knuder på hvidliste kan ikke DoS-bandlyses, og deres transaktioner videresendes altid, selv hvis de allerede er i mempool'en. Brugbart til fx et adgangspunkt - - Always query for peer addresses via DNS lookup (default: 0) - Forespørg altid adresser på andre knuder via DNS-opslag (default: 0) - Cannot resolve -whitebind address: '%s' Kan ikke løse -whitebind adresse: "%s" @@ -3198,10 +3058,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Fee (in BTC/kB) to add to transactions you send (default: %s) Gebyr (i BTC/kB) som skal føjes til transaktioner, du sender (standard: %s) - - Include IP addresses in debug output (default: 0) - Inkludér IP-adresser i fejlretningsoutput (standard: 0) - Information Information @@ -3231,24 +3087,8 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Behold højest <n> uforbindelige blokke i hukommelsen (standard: %u) - Limit size of signature cache to <n> entries (default: 50000) - Begræns størrelsen på signaturcache til <n> indgange (standard: 50000) - - - Log transaction priority and fee per kB when mining blocks (default: 0) - Prioritet for transaktionslog og gebyr pr. kB under udvinding af blokke (standard: 0) - - - Maintain a full transaction index (default: 0) - Vedligehold et komplet transaktionsindeks (standard: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Maksimum for modtagelsesbuffer pr. forbindelse, <n>*1000 byte (standard: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Maksimum for afsendelsesbuffer pr. forbindelse, <n>*1000 byte (standard: 1000) + Keep at most <n> unconnectable transactions in memory (default: %u) + Behold højest <n> uforbindelige transaktioner i hukommelsen (standard: %u) Need to specify a port with -whitebind: '%s' @@ -3258,22 +3098,10 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Node relay options: Videresendelsesvalgmuligheder for knude: - - Only accept block chain matching built-in checkpoints (default: 1) - Acceptér kun blokkæde, som matcher indbyggede kontrolposter (standard: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Tilslut kun til knuder i netværk <net> (IPv4, IPv6 eller Tor) - Print block on startup, if found in block index Udskriv blok under opstart, hvis den findes i blokindeks - - Print block tree on startup (default: 0) - Udskriv bloktræ under startop (standard: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) Tilvalg for RPC SSL: (se Bitcoin Wiki for instruktioner i SSL-opstart) @@ -3290,30 +3118,10 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Randomly fuzz 1 of every <n> network messages Slør tilfældigt 1 ud af hver <n> netværksbeskeder - - Relay and mine data carrier transactions (default: 1) - Videresend og mine databærer-transaktioner (standard: 1) - - - Relay non-P2SH multisig (default: 1) - Videresend ikke-P2SH multisig (standard: 1) - - - Run a thread to flush wallet periodically (default: 1) - Kør en tråd for at rydde tegnebog periodisk (standard: 1) - Send trace/debug info to console instead of debug.log file Send sporings-/fejlsøgningsinformation til konsollen i stedet for debug.log filen - - Set minimum block size in bytes (default: 0) - Angiv minimumsblokstørrelse i byte (standard: 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - Sætter DB_PRIVATE-flaget i tegnebogens db-miljø (standard: 1) - Show all debugging options (usage: --help -help-debug) Vis alle tilvalg for fejlsøgning (brug: --help -help-debug) @@ -3326,14 +3134,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Signing transaction failed Underskrift af transaktion mislykkedes - - Specify connection timeout in milliseconds (default: 5000) - Angiv tilslutningstimeout i millisekunder (standard: 5000) - - - System error: - Systemfejl: - This is experimental software. Dette er eksperimentelt software. @@ -3354,10 +3154,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Unable to bind to %s on this computer (bind returned error %s) Ikke i stand til at tildele til %s på denne computer (bind returnerede fejl %s) - - Use UPnP to map the listening port (default: 0) - Brug UPnP til at konfigurere den lyttende port (standard: 0) - Use UPnP to map the listening port (default: 1 when listening) Brug UPnP til at konfigurere den lyttende port (standard: 1 under lytning) @@ -3410,10 +3206,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Upgrade wallet to latest format Opgrader tegnebog til seneste format - - Set key pool size to <n> (default: 100) - Angiv nøglepoolstørrelse til <n> (standard: 100) - Rescan the block chain for missing wallet transactions Gennemsøg blokkæden for manglende tegnebogstransaktioner @@ -3422,14 +3214,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Use OpenSSL (https) for JSON-RPC connections Brug OpenSSL (https) for JSON-RPC-forbindelser - - Server certificate file (default: server.cert) - Servercertifikat-fil (standard: server.cert) - - - Server private key (default: server.pem) - Serverens private nøgle (standard: server.pem) - This help message Denne hjælpebesked @@ -3446,14 +3230,184 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error loading wallet.dat: Wallet corrupted Fejl ved indlæsning af wallet.dat: Tegnebog ødelagt + + (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + (1 = behold metadata for transaktion, fx kontoindehaver og information om betalingsanmodning, 2 = drop metadata for transaktion) + + + Flush database activity from memory pool to disk log every <n> megabytes (default: %u) + Flyt databaseaktivitet fra hukommelsespulje til disklog hver <n> megabyte (standard: %u) + + + How thorough the block verification of -checkblocks is (0-4, default: %u) + Hvor gennemarbejdet blokverificeringen for -checkblocks er (0-4; standard: %u) + + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: %u) + Hvis paytxfee ikke er angivet, inkludér da nok gebyr til at transaktioner gennemsnitligt bekræftes inden for n blokke (standard: %u) + + + Log transaction priority and fee per kB when mining blocks (default: %u) + Prioritet for transaktionslog og gebyr pr. kB under udvinding af blokke (standard: %u) + + + Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u) + Vedligehold et komplet transaktionsindeks, der bruges af rpc-kaldet getrawtransaction (standard: %u) + + + Number of seconds to keep misbehaving peers from reconnecting (default: %u) + Antal sekunder, som knuder der opfører sig upassende, skal vente før reetablering (standard: %u) + + + Output debugging information (default: %u, supplying <category> is optional) + Udskriv fejlsøgningsinformation (standard: %u, angivelse af <kategori> er valgfri) + + + Set the processor limit for when generation is on (-1 = unlimited, default: %d) + Sæt processorbegrænsning for når generering er slået til (-1 = ubegrænset, standard: %d) + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) + Brug separat SOCS5-proxy for at nå andre knuder via Tor skjulte tjenester (standard: %s) + + + (default: %s) + (standard: %s) + + + Acceptable ciphers (default: %s) + Accepterede kodninger (standard: %s) + + + Always query for peer addresses via DNS lookup (default: %u) + Forespørg altid adresser på andre knuder via DNS-opslag (default: %u) + + + Disable safemode, override a real safe mode event (default: %u) + Slå sikker tilstand fra, tilsidesæt hændelser fra sikker tilstand (standard: %u) + Error loading wallet.dat Fejl ved indlæsning af wallet.dat + + Force safe mode (default: %u) + Gennemtving sikker tilstand (standard: %u) + + + Generate coins (default: %u) + Generér bitcoins (standard: %u) + + + How many blocks to check at startup (default: %u, 0 = all) + Antal blokke som tjekkes ved opstart (standard: %u, 0 = alle) + + + Include IP addresses in debug output (default: %u) + Inkludér IP-adresser i fejlretningsoutput (standard: %u) + Invalid -proxy address: '%s' Ugyldig -proxy adresse: "%s" + + Limit size of signature cache to <n> entries (default: %u) + Begræns størrelsen på signaturcache til <n> indgange (standard: %u) + + + Listen for JSON-RPC connections on <port> (default: %u or testnet: %u) + Lyt efter JSON-RPC-forbindelser på <port> (standard: %u eller testnet: %u) + + + Listen for connections on <port> (default: %u or testnet: %u) + Lyt efter forbindelser på <port> (standard: %u eller testnet: %u) + + + Maintain at most <n> connections to peers (default: %u) + Oprethold højest <n> forbindelser til andre knuder (standard: %u) + + + Maximum per-connection receive buffer, <n>*1000 bytes (default: %u) + Maksimum for modtagelsesbuffer pr. forbindelse, <n>*1000 byte (standard: %u) + + + Maximum per-connection send buffer, <n>*1000 bytes (default: %u) + Maksimum for afsendelsesbuffer pr. forbindelse, <n>*1000 byte (standard: %u) + + + Only accept block chain matching built-in checkpoints (default: %u) + Acceptér kun indbyggede kontrolposter, der matcher blokkæden (standard: %u) + + + Prepend debug output with timestamp (default: %u) + Føj tidsstempel foran fejlsøgningsoutput (standard: %u) + + + Print block tree on startup (default: %u) + Udskriv bloktræ under opstart (standard: %u) + + + Relay and mine data carrier transactions (default: %u) + Videresend og udvind databærer-transaktioner (standard: %u) + + + Relay non-P2SH multisig (default: %u) + Videresend ikke-P2SH multisig (standard: %u) + + + Run a thread to flush wallet periodically (default: %u) + Kør en tråd for periodisk at rydde tegnebog (standard: %u) + + + Server certificate file (default: %s) + Servercertifikat-fil (standard: %s) + + + + Server private key (default: %s) + Serverens private nøgle (standard: %s) + + + Set key pool size to <n> (default: %u) + Sæt nøglepuljestørrelse til <n> (standard: %u) + + + + Set minimum block size in bytes (default: %u) + Angiv minimumsblokstørrelse i byte (standard: %u) + + + Set the number of threads to service RPC calls (default: %d) + Angiv antallet af tråde til at håndtere RPC-kald (standard: %d) + + + Sets the DB_PRIVATE flag in the wallet db environment (default: %u) + Sætter DB_PRIVATE-flaget i tegnebogens db-miljø (standard: %u) + + + Specify configuration file (default: %s) + Angiv konfigurationsfil (standard: %s) + + + Specify connection timeout in milliseconds (minimum: 1, default: %d) + Angiv tilslutningstimeout i millisekunder (minimum: 1, standard: %d) + + + Specify pid file (default: %s) + Angiv pid-fil (standard: %s) + + + Spend unconfirmed change when sending transactions (default: %u) + Brug ubekræftede byttepenge under afsendelse af transaktioner (standard: %u) + + + Stop running after importing blocks from disk (default: %u) + Stop kørsel efter import af blokke fra disk (standard: %u) + + + Threshold for disconnecting misbehaving peers (default: %u) + Grænse for afbrydelse af forbindelse til knuder, der opfører sig upassende (standard: %u) + Unknown network specified in -onlynet: '%s' Ukendt netværk anført i -onlynet: "%s" diff --git a/src/qt/locale/bitcoin_de.ts b/src/qt/locale/bitcoin_de.ts index 667f0eb239..8bc1c046a1 100644 --- a/src/qt/locale/bitcoin_de.ts +++ b/src/qt/locale/bitcoin_de.ts @@ -390,10 +390,6 @@ Tabs toolbar Registerkartenleiste - - [testnet] - [Testnetz] - Bitcoin Core Bitcoin Core @@ -434,10 +430,6 @@ No block source available... Keine Blockquelle verfügbar... - - Processed %1 blocks of transaction history. - %1 Blöcke des Transaktionsverlaufs verarbeitet. - %n hour(s) %n Stunde%n Stunden @@ -915,13 +907,13 @@ Adresse: %4 Error Fehler - - GB of free space available - GB freier Speicherplatz verfügbar + + %n GB of free space available + %n GB freier Speicherplatz verfügbar%n GB freier Speicherplatz verfügbar - - (of %1GB needed) - (von benötigten %1GB) + + (of %n GB needed) + (von benötigtem %n GB)(von benötigten %n GB) @@ -1164,10 +1156,6 @@ Adresse: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Die angezeigten Informationen sind möglicherweise nicht mehr aktuell. Ihre Wallet wird automatisch synchronisiert, nachdem eine Verbindung zum Bitcoin-Netzwerk hergestellt wurde. Dieser Prozess ist jedoch derzeit noch nicht abgeschlossen. - - Wallet - Wallet - Watch-only: Beobachtet: @@ -1196,6 +1184,10 @@ Adresse: %4 Mined balance that has not yet matured Erarbeiteter Betrag der noch nicht gereift ist + + Balances + Kontostände + Total: Gesamtbetrag: @@ -1208,6 +1200,14 @@ Adresse: %4 Your current balance in watch-only addresses Ihr aktueller Kontostand beobachteter Adressen + + Spendable: + Verfügbar: + + + Recent transactions + Letzte Transaktionen + Unconfirmed transactions to watch-only addresses Unbestätigte Transaktionen von beobachteten Adressen @@ -1220,10 +1220,6 @@ Adresse: %4 Current total balance in watch-only addresses Aktueller Gesamtbetrag in beobachteten Adressen aus obigen Kategorien - - <b>Recent transactions</b> - <b>Letzte Transaktionen</b> - out of sync nicht synchron @@ -1483,10 +1479,6 @@ Adresse: %4 Services Dienste - - Sync Node - Sync-Knoten - Starting Height Start-Höhe @@ -1615,14 +1607,6 @@ Adresse: %4 Outbound ausgehend - - Yes - Ja - - - No - Nein - Unknown Unbekannt @@ -2471,6 +2455,10 @@ Adresse: %4 Mined Erarbeitet + + watch-only + beobachtet + (n/a) (k.A.) @@ -2487,6 +2475,10 @@ Adresse: %4 Type of transaction. Art der Transaktion + + Whether or not a watch-only address is involved in this transaction. + Zeigt an, ob eine beobachtete Adresse in diese Transaktion involviert ist. + Destination address of transaction. Zieladresse der Transaktion. @@ -2582,6 +2574,10 @@ Adresse: %4 Export Transaction History Transaktionsverlauf exportieren + + Watch-only + Beobachtet + Exporting Failed Exportieren fehlgeschlagen @@ -2697,26 +2693,10 @@ Adresse: %4 Options: Optionen: - - Specify configuration file (default: bitcoin.conf) - Konfigurationsdatei festlegen (Standard: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - PID-Datei festlegen (Standard: bitcoind.pid) - Specify data directory Datenverzeichnis festlegen - - Listen for connections on <port> (default: 8333 or testnet: 18333) - <port> nach Verbindungen abhören (Standard: 8333 oder Testnetz: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Maximal <n> Verbindungen zu Gegenstellen aufrechterhalten (Standard: 125) - Connect to a node to retrieve peer addresses, and disconnect Mit dem angegebenen Knoten verbinden, um Adressen von Gegenstellen abzufragen, danach trennen @@ -2725,18 +2705,6 @@ Adresse: %4 Specify your own public address Die eigene öffentliche Adresse angeben - - Threshold for disconnecting misbehaving peers (default: 100) - Schwellenwert, um Verbindungen zu sich nicht konform verhaltenden Gegenstellen zu beenden (Standard: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Anzahl Sekunden, während denen sich nicht konform verhaltenden Gegenstellen die Wiederverbindung verweigert wird (Standard: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - <port> nach JSON-RPC-Verbindungen abhören (Standard: 8332 oder Testnetz: 18332) - Accept command line and JSON-RPC commands Kommandozeilen- und JSON-RPC-Befehle annehmen @@ -2777,17 +2745,9 @@ Es wird ebenfalls empfohlen alertnotify anzugeben, um im Problemfall benachricht zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Zulässige Chiffren (Standard: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - An die angegebene Adresse binden und immer abhören. Für IPv6 "[Host]:Port"-Schreibweise verwenden - - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - Anzahl der freien Transaktionen auf <n> * 1000 Byte pro Minute begrenzen (Standard: 15) + An die angegebene Adresse binden und immer abhören. Für IPv6 "[Host]:Port"-Notation verwenden Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup @@ -2807,15 +2767,7 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - Befehl ausführen wenn sich eine Wallet-Transaktion verändert (%s im Befehl wird durch die TxID ersetzt) - - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - Datenbankaktivitäten vom Arbeitsspeicher-Pool alle <n> Megabyte auf den Datenträger schreiben (Standard: 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - Legt fest, wie gründlich die Blockverifikation von -checkblocks ist (0-4, Standard: 3) + Befehl ausführen wenn sich eine Wallet-Transaktion verändert (%s im Befehl wird durch die Transaktions-ID ersetzt) In this mode -genproclimit controls how many blocks are generated immediately. @@ -2825,10 +2777,6 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Maximale Anzahl an Skript-Verifizierungs-Threads festlegen (%u bis %d, 0 = automatisch, <0 = so viele Kerne frei lassen, Standard: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - Legt ein Prozessor-/CPU-Kernlimit fest, wenn CPU-Mining aktiviert ist (-1 = unbegrenzt, Standard: -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Dies ist eine Vorab-Testversion - Verwendung auf eigene Gefahr - nicht für Mining- oder Handelsanwendungen nutzen! @@ -2837,10 +2785,6 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Unable to bind to %s on this computer. Bitcoin Core is probably already running. Kann auf diesem Computer nicht an %s binden, da Bitcoin Core wahrscheinlich bereits gestartet wurde. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Separaten SOCKS5-Proxy verwenden, um Gegenstellen über versteckte Tor-Dienste zu erreichen (Standard: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Warnung: -paytxfee ist auf einen sehr hohen Wert festgelegt! Dies ist die Gebühr die beim Senden einer Transaktion fällig wird. @@ -2865,10 +2809,6 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com (default: 1) (Standard: 1) - - (default: wallet.dat) - (Standard: wallet.dat) - <category> can be: <category> kann sein: @@ -2897,10 +2837,6 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Debugging/Testing options: Debugging-/Testoptionen: - - Disable safemode, override a real safe mode event (default: 0) - Sicherheitsmodus deaktivieren, übergeht ein echtes Sicherheitsmodusereignis (Standard: 0) - Discover own IP address (default: 1 when listening and no -externalip) Eigene IP-Adresse erkennen (Standard: 1, wenn abgehört wird und nicht -externalip) @@ -2929,6 +2865,10 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Error opening block database Fehler beim Öffnen der Blockdatenbank + + Error: A fatal internal error occured, see debug.log for details + Fehler: Ein schwerer Fehler ist aufgetreten, für Details debug.log ansehen. + Error: Disk space is low! Fehler: Zu wenig freier Speicherplatz auf dem Datenträger! @@ -2937,66 +2877,10 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Error: Wallet locked, unable to create transaction! Fehler: Wallet gesperrt, Transaktion kann nicht erstellt werden! - - Error: system error: - Fehler: Systemfehler: - Failed to listen on any port. Use -listen=0 if you want this. Fehler, es konnte kein Port abgehört werden. Wenn dies so gewünscht wird -listen=0 verwenden. - - Failed to read block info - Lesen der Blockinformationen fehlgeschlagen - - - Failed to read block - Lesen des Blocks fehlgeschlagen - - - Failed to sync block index - Synchronisation des Blockindex fehlgeschlagen - - - Failed to write block index - Schreiben des Blockindex fehlgeschlagen - - - Failed to write block info - Schreiben der Blockinformationen fehlgeschlagen - - - Failed to write block - Schreiben des Blocks fehlgeschlagen - - - Failed to write file info - Schreiben der Dateiinformationen fehlgeschlagen - - - Failed to write to coin database - Schreiben in die Münzendatenbank fehlgeschlagen - - - Failed to write transaction index - Schreiben des Transaktionsindex fehlgeschlagen - - - Failed to write undo data - Schreiben der Rücksetzdaten fehlgeschlagen - - - Force safe mode (default: 0) - Sicherheitsmodus erzwingen (Standard: 0) - - - Generate coins (default: 0) - Bitcoins erzeugen (Standard: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Wieviele Blöcke beim Starten geprüft werden sollen (Standard: 288, 0 = alle) - If <category> is not supplied, output all debugging information. Wenn <category> nicht angegeben wird, jegliche Debugginginformationen ausgeben. @@ -3018,8 +2902,8 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Nicht genügend Datei-Deskriptoren verfügbar. - Prepend debug output with timestamp (default: 1) - Debugausgaben einen Zeitstempel voranstellen (Standard: 1) + Only connect to nodes in network <net> (ipv4, ipv6 or onion) + Nur zu Knoten des Netzwerktyps <net> verbinden (ipv4, ipv6 oder onion) Rebuild block chain index from current blk000??.dat files @@ -3033,26 +2917,18 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Set maximum block size in bytes (default: %d) Maximale Blockgröße in Byte festlegen (Standard: %d) - - Set the number of threads to service RPC calls (default: 4) - Maximale Anzahl an Threads zur Verarbeitung von RPC-Anfragen festlegen (Standard: 4) - Specify wallet file (within data directory) Wallet-Datei angeben (innerhalb des Datenverzeichnisses) - - Spend unconfirmed change when sending transactions (default: 1) - Unbestätigtes Wechselgeld beim Senden von Transaktionen ausgeben (Standard: 1) - - - Stop running after importing blocks from disk (default: 0) - Beenden, nachdem Blöcke vom Datenträger importiert wurden (Standard: 0) - This is intended for regression testing tools and app development. Dies ist für Regressionstest-Tools und Anwendungsentwicklung gedacht. + + Use UPnP to map the listening port (default: %u) + UPnP verwenden, um eine Portweiterleitung einzurichten (Standard: %u) + Verifying blocks... Verifiziere Blöcke... @@ -3078,13 +2954,33 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Blöcke aus externer Datei blk000??.dat importieren - (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) - (Standard: 1, 1 = TX-Metadaten wie z.B. Accountbesitzer und Zahlungsanforderungsinformationen behalten, 2 = TX-Metadaten verwerfen) + Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times + JSON-RPC-Verbindungen von der angegeben Quelle erlauben. Gültig für <ip> ist eine einzelne IP-Adresse (z.B. 1.2.3.4), ein Netzwerk bzw. eine Netzmaske (z.B. 1.2.3.4/255.255.255.0), oder die CIDR-Notation (z.B. 1.2.3.4/24). Kann mehrmals angegeben werden. + + + An error occurred while setting up the RPC address %s port %u for listening: %s + Beim Einrichten der abzuhörenden RPC-Adresse %s auf Port %u ist ein Fehler aufgetreten: %s + + + Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6 + An die angegebene Adresse binden und Gegenstellen, die sich dorthin verbinden, immer zulassen. Für IPv6 "[Host]:Port"-Notation verwenden + + + Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces) + An die angegebene Adresse binden und nach eingehenden JSON-RPC-Verbindungen abhören. Für IPv6 "[Host]:Port"-Notation verwenden. Kann mehrmals angegeben werden. (Standard: an alle Schnittstellen binden) Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. Datenverzeichnis %s kann nicht gesperrt werden, da Bitcoin Core wahrscheinlich bereits gestartet wurde. + + Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:%u) + Anzahl der freien Transaktionen auf <n> * 1000 Byte pro Minute begrenzen (Standard: %u) + + + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) + Neue Dateien mit Standard-Systemrechten erzeugen, anstatt mit umask 077 (nur mit deaktivierter Walletfunktion nutzbar) + Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. Veröffentlicht unter der MIT/X11-Softwarelizenz, siehe beiligende Datei COPYING oder <http://www.opensource.org/licenses/mit-license.php>. @@ -3103,15 +2999,15 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) - Niedrigere Gebühren (in BTC/Kb) als diese werden bei der Vermittlung als gebührenfrei angesehen (Standard: %s) + Niedrigere Gebühren (in BTC/Kb) als diese werden bei der Weiterleitung als gebührenfrei angesehen (Standard: %s) Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) Niedrigere Gebühren (in BTC/Kb) als diese werden bei der Transaktionserstellung als gebührenfrei angesehen (Standard: %s) - Output debugging information (default: 0, supplying <category> is optional) - Debugginginformationen ausgeben (Standard: 0, <category> anzugeben ist optional) + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) + Adressen von Gegenstellen via DNS-Namensauflösung finden, falls zu wenige Adressen verfügbar sind (Standard: 1, außer bei -connect) Set maximum size of high-priority/low-fee transactions in bytes (default: %d) @@ -3123,7 +3019,15 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. - Warnung: Bitte korrigieren Sie die Datums- und Uhrzeiteinstellungen Ihres Computers, da Bitcoin Core ansonsten nicht ordnungsgemäß funktionieren wird! + Warnung: Bitte korrigieren Sie die Datums- und Uhrzeiteinstellungen Ihres Computers, da Bitcoin Core ansonsten nicht ordnungsgemäß funktionieren wird. + + + Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway + Erlaubte Gegenstellen werden nicht für DoS-Attacken gesperrt und ihre Transkationen werden immer weitergeleitet, auch wenn sie sich bereits im Speicherpool befinden, was z.B. für Gateways sinnvoll ist. + + + Cannot resolve -whitebind address: '%s' + Kann Adresse in -whitebind nicht auflösen: '%s' Connect through SOCKS5 proxy @@ -3145,10 +3049,18 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Error: Unsupported argument -tor found, use -onion. Fehler: Nicht unterstütztes Argument -tor gefunden, bitte -onion verwenden. + + Fee (in BTC/kB) to add to transactions you send (default: %s) + Gebühr (in BTC/kB), die von Ihnen gesendeten Transaktionen hinzugefügt wird (Standard: %s) + Information Hinweis + + Initialization sanity check failed. Bitcoin Core is shutting down. + Initialisierungsplausibilitätsprüfung fehlgeschlagen. Bitcoin Core wird beendet. + Invalid amount for -minrelaytxfee=<amount>: '%s' Ungültiger Betrag für -minrelaytxfee=<amount>: '%s' @@ -3158,45 +3070,33 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Ungültiger Betrag für -mintxfee=<amount>: '%s' - Limit size of signature cache to <n> entries (default: 50000) - Größe des Signaturcaches auf <n> Einträge begrenzen (Standard: 50000) + Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) + Ungültiger Betrag für -paytxfee=<amount>: '%s' (muss mindestens %s sein) - Log transaction priority and fee per kB when mining blocks (default: 0) - Transaktionspriorität und Gebühr pro kB beim Erzeugen von Blöcken protokollieren (Standard: 0) + Invalid netmask specified in -whitelist: '%s' + Ungültige Netzmaske angegeben in -whitelist: '%s' - Maintain a full transaction index (default: 0) - Einen vollständigen Transaktionsindex führen (Standard: 0) + Keep at most <n> unconnectable blocks in memory (default: %u) + Maximal <n> nicht-verbindbare Blöcke im Speicher halten (Standard: %u) - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Maximale Größe des Empfangspuffers pro Verbindung, <n> * 1000 Byte (Standard: 5000) + Keep at most <n> unconnectable transactions in memory (default: %u) + Maximal <n> nicht-verbindbare Transaktionen im Speicher halten (Standard: %u) - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Maximale Größe des Sendepuffers pro Verbindung, <n> * 1000 Byte (Standard: 1000) + Need to specify a port with -whitebind: '%s' + Angabe eines Ports benötigt für -whitebind: '%s' Node relay options: - Knoten-Vermittlungsoptionen: - - - Only accept block chain matching built-in checkpoints (default: 1) - Blockkette nur als gültig ansehen, wenn sie mit den integrierten Prüfpunkten übereinstimmt (Standard: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Verbinde nur zu Knoten des Netztyps <net> (IPv4, IPv6 oder Tor) + Knoten-Weiterleitungsoptionen: Print block on startup, if found in block index Block beim Starten ausgeben, wenn dieser im Blockindex gefunden wurde. - - Print block tree on startup (default: 0) - Blockbaum beim Starten ausgeben (Standard: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) RPC-SSL-Optionen (siehe Bitcoin-Wiki für SSL-Einrichtung): @@ -3213,22 +3113,10 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Randomly fuzz 1 of every <n> network messages Zufällig eine von <n> Netzwerknachrichten verwürfeln - - Run a thread to flush wallet periodically (default: 1) - Einen Thread starten, der periodisch die Wallet sicher auf den Datenträger schreibt (Standard: 1) - Send trace/debug info to console instead of debug.log file Rückverfolgungs- und Debuginformationen an die Konsole senden, anstatt sie in debug.log zu schreiben - - Set minimum block size in bytes (default: 0) - Minimale Blockgröße in Byte festlegen (Standard: 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - DB_PRIVATE-Flag in der Wallet-Datenbankumgebung setzen (Standard: 1) - Show all debugging options (usage: --help -help-debug) Zeige alle Debuggingoptionen (Benutzung: --help -help-debug) @@ -3241,14 +3129,6 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Signing transaction failed Signierung der Transaktion fehlgeschlagen - - Specify connection timeout in milliseconds (default: 5000) - Verbindungzeitüberschreitung in Millisekunden festlegen (Standard: 5000) - - - System error: - Systemfehler: - This is experimental software. Dies ist experimentelle Software. @@ -3266,8 +3146,8 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Transaktion zu groß - Use UPnP to map the listening port (default: 0) - UPnP verwenden, um eine Portweiterleitung einzurichten (Standard: 0) + Unable to bind to %s on this computer (bind returned error %s) + Kann auf diesem Computer nicht an %s binden (bind meldete Fehler %s) Use UPnP to map the listening port (default: 1 when listening) @@ -3321,10 +3201,6 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Upgrade wallet to latest format Wallet auf das neueste Format aktualisieren - - Set key pool size to <n> (default: 100) - Größe des Schlüsselpools festlegen auf <n> (Standard: 100) - Rescan the block chain for missing wallet transactions Blockkette erneut nach fehlenden Wallet-Transaktionen durchsuchen @@ -3333,14 +3209,6 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Use OpenSSL (https) for JSON-RPC connections OpenSSL (https) für JSON-RPC-Verbindungen verwenden - - Server certificate file (default: server.cert) - Serverzertifikat (Standard: server.cert) - - - Server private key (default: server.pem) - Privater Serverschlüssel (Standard: server.pem) - This help message Dieser Hilfetext @@ -3357,14 +3225,162 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Error loading wallet.dat: Wallet corrupted Fehler beim Laden von wallet.dat: Wallet beschädigt + + Flush database activity from memory pool to disk log every <n> megabytes (default: %u) + Datenbankaktivitäten vom Arbeitsspeicher-Pool alle <n> Megabyte auf den Datenträger schreiben (Standard: %u) + + + How thorough the block verification of -checkblocks is (0-4, default: %u) + Legt fest, wie gründlich die Blockverifikation von -checkblocks ist (0-4, Standard: %u) + + + Log transaction priority and fee per kB when mining blocks (default: %u) + Transaktionspriorität und Gebühr pro kB beim Erzeugen von Blöcken protokollieren (Standard: %u) + + + Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u) + Einen vollständigen Transaktionsindex führen, der vom RPC-Befehl "getrawtransaction" genutzt wird (Standard: %u) + + + Number of seconds to keep misbehaving peers from reconnecting (default: %u) + Anzahl Sekunden, während denen sich nicht konform verhaltenden Gegenstellen die Wiederverbindung verweigert wird (Standard: %u) + + + Output debugging information (default: %u, supplying <category> is optional) + Debugginginformationen ausgeben (Standard: %u, <category> anzugeben ist optional) + + + Set the processor limit for when generation is on (-1 = unlimited, default: %d) + Legt ein Prozessor-/CPU-Kernlimit fest, wenn CPU-Mining aktiviert ist (-1 = unbegrenzt, Standard: %d) + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) + Separaten SOCKS5-Proxy verwenden, um Gegenstellen über versteckte Tor-Dienste zu erreichen (Standard: %s) + + + (default: %s) + (Standard: %s) + + + Acceptable ciphers (default: %s) + Zulässige Chiffren (Standard: %s) + + + Disable safemode, override a real safe mode event (default: %u) + Sicherheitsmodus deaktivieren, übergeht ein echtes Sicherheitsmodusereignis (Standard: %u) + Error loading wallet.dat Fehler beim Laden von wallet.dat + + Force safe mode (default: %u) + Sicherheitsmodus erzwingen (Standard: %u) + + + Generate coins (default: %u) + Bitcoins erzeugen (Standard: %u) + + + How many blocks to check at startup (default: %u, 0 = all) + Wieviele Blöcke beim Starten geprüft werden sollen (Standard: %u, 0 = alle) + + + Include IP addresses in debug output (default: %u) + IP-Adressen in Debugausgabe einschließen (Standard: %u) + Invalid -proxy address: '%s' Ungültige Adresse in -proxy: '%s' + + Limit size of signature cache to <n> entries (default: %u) + Größe des Signaturcaches auf <n> Einträge begrenzen (Standard: %u) + + + Listen for JSON-RPC connections on <port> (default: %u or testnet: %u) + <port> nach JSON-RPC-Verbindungen abhören (Standard: %u oder Testnetz: %u) + + + Maintain at most <n> connections to peers (default: %u) + Maximal <n> Verbindungen zu Gegenstellen aufrechterhalten (Standard: %u) + + + Maximum per-connection receive buffer, <n>*1000 bytes (default: %u) + Maximale Größe des Empfangspuffers pro Verbindung, <n> * 1000 Byte (Standard: %u) + + + Maximum per-connection send buffer, <n>*1000 bytes (default: %u) + Maximale Größe des Sendepuffers pro Verbindung, <n> * 1000 Byte (Standard: %u) + + + Only accept block chain matching built-in checkpoints (default: %u) + Blockkette nur als gültig ansehen, wenn sie mit den integrierten Prüfpunkten übereinstimmt (Standard: %u) + + + Prepend debug output with timestamp (default: %u) + Debugausgaben einen Zeitstempel voranstellen (Standard: %u) + + + Print block tree on startup (default: %u) + Blockbaum beim Starten ausgeben (Standard: %u) + + + Relay and mine data carrier transactions (default: %u) + "Data Carrier"-Transaktionen weiterleiten und erarbeiten (Standard: %u) + + + Relay non-P2SH multisig (default: %u) + Nicht-"P2SH-Multisig" weiterleiten (Standard: %u) + + + Run a thread to flush wallet periodically (default: %u) + Einen Thread starten, der periodisch die Wallet sicher auf den Datenträger schreibt (Standard: %u) + + + Server certificate file (default: %s) + Serverzertifikat (Standard: %s) + + + Server private key (default: %s) + Privater Serverschlüssel (Standard: %s) + + + Set key pool size to <n> (default: %u) + Größe des Schlüsselpools festlegen auf <n> (Standard: %u) + + + Set minimum block size in bytes (default: %u) + Minimale Blockgröße in Byte festlegen (Standard: %u) + + + Set the number of threads to service RPC calls (default: %d) + Maximale Anzahl an Threads zur Verarbeitung von RPC-Anfragen festlegen (Standard: %d) + + + Sets the DB_PRIVATE flag in the wallet db environment (default: %u) + "DB_PRIVATE"-Flag in der Wallet-Datenbankumgebung setzen (Standard: %u) + + + Specify configuration file (default: %s) + Konfigurationsdatei festlegen (Standard: %s) + + + Specify connection timeout in milliseconds (minimum: 1, default: %d) + Verbindungzeitüberschreitung in Millisekunden festlegen (Minimum: 1, Standard: %d) + + + Specify pid file (default: %s) + PID-Datei festlegen (Standard: %s) + + + Spend unconfirmed change when sending transactions (default: %u) + Unbestätigtes Wechselgeld darf beim Senden von Transaktionen ausgegeben werden (Standard: %u) + + + Threshold for disconnecting misbehaving peers (default: %u) + Schwellenwert, um Verbindungen zu sich nicht konform verhaltenden Gegenstellen zu beenden (Standard: %u) + Unknown network specified in -onlynet: '%s' Unbekannter Netztyp in -onlynet angegeben: '%s' diff --git a/src/qt/locale/bitcoin_el_GR.ts b/src/qt/locale/bitcoin_el_GR.ts index d5e9b57d99..b4e15ae2df 100644 --- a/src/qt/locale/bitcoin_el_GR.ts +++ b/src/qt/locale/bitcoin_el_GR.ts @@ -351,10 +351,6 @@ Tabs toolbar Εργαλειοθήκη καρτελών - - [testnet] - [testnet] - Bitcoin Core Bitcoin Core @@ -383,10 +379,6 @@ No block source available... Η πηγή του μπλοκ δεν ειναι διαθέσιμη... - - Processed %1 blocks of transaction history. - Έγινε λήψη %1 μπλοκ ιστορικού συναλλαγών - %n hour(s) %n ώρες %n ώρες @@ -609,6 +601,10 @@ Address: %4 no όχι + + This label turns red, if the transaction size is greater than 1000 bytes. + Η ετικετα γινετε κοκκινη , αν το μεγεθος της συναλαγης ειναι μεγαλητερο απο 1000 bytes. + (no label) (χωρίς ετικέτα) @@ -766,15 +762,7 @@ Address: %4 Error Σφάλμα - - GB of free space available - GB ελεύθερου χώρου διαθέσιμα - - - (of %1GB needed) - (από τα %1GB που χρειάζονται) - - + OpenURIDialog @@ -923,10 +911,6 @@ Address: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Οι πληροφορίες που εμφανίζονται μπορεί να είναι ξεπερασμένες. Το πορτοφόλι σας συγχρονίζεται αυτόματα με το δίκτυο Bitcoin μετά από μια σύνδεση, αλλά αυτή η διαδικασία δεν έχει ακόμη ολοκληρωθεί. - - Wallet - Πορτοφόλι - Available: Διαθέσιμο: @@ -955,10 +939,6 @@ Address: %4 Your current total balance Το τρέχον συνολικό υπόλοιπο - - <b>Recent transactions</b> - <b>Πρόσφατες συναλλαγές</b> - out of sync εκτός συγχρονισμού @@ -2052,26 +2032,10 @@ Address: %4 Options: Επιλογές: - - Specify configuration file (default: bitcoin.conf) - Ορίστε αρχείο ρυθμίσεων (προεπιλογή: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Ορίστε αρχείο pid (προεπιλογή: bitcoind.pid) - Specify data directory Ορισμός φακέλου δεδομένων - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Εισερχόμενες συνδέσεις στη θύρα <port> (προεπιλογή: 8333 ή στο testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Μέγιστες αριθμός συνδέσεων με τους peers <n> (προεπιλογή: 125) - Connect to a node to retrieve peer addresses, and disconnect Σύνδεση σε έναν κόμβο για την ανάκτηση διευθύνσεων από ομοτίμους, και αποσυνδέσh @@ -2080,18 +2044,6 @@ Address: %4 Specify your own public address Διευκρινίστε τη δικιά σας δημόσια διεύθυνση. - - Threshold for disconnecting misbehaving peers (default: 100) - Όριο αποσύνδεσης προβληματικών peers (προεπιλογή: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Δευτερόλεπτα πριν επιτραπεί ξανά η σύνδεση των προβληματικών peers (προεπιλογή: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Εισερχόμενες συνδέσεις JSON-RPC στη θύρα <port> (προεπιλογή: 8332 or testnet: 18332) - Accept command line and JSON-RPC commands Αποδοχή εντολών κονσόλας και JSON-RPC @@ -2169,10 +2121,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com (default: 1) (προεπιλογή: 1) - - (default: wallet.dat) - (προεπιλογή: wallet.dat) - Attempt to recover private keys from a corrupt wallet.dat Προσπάθεια για ανακτησει ιδιωτικων κλειδιων από ενα διεφθαρμένο αρχειο wallet.dat @@ -2225,62 +2173,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Wallet locked, unable to create transaction! Σφάλμα: το πορτοφόλι είναι κλειδωμένο, δεν μπορεί να δημιουργηθεί συναλλαγή - - Error: system error: - Λάθος: λάθος συστήματος: - Failed to listen on any port. Use -listen=0 if you want this. ταλαιπωρηθειτε για να ακούσετε σε οποιαδήποτε θύρα. Χρήση - ακούστε = 0 , αν θέλετε αυτό. - - Failed to read block info - Αποτυχία αναγνωσης των block πληροφοριων - - - Failed to read block - Η αναγνωση του μπλοκ απετυχε - - - Failed to sync block index - Ο συγχρονισμος του μπλοκ ευρετηριου απετυχε - - - Failed to write block index - Η δημιουργια του μπλοκ ευρετηριου απετυχε - - - Failed to write block info - Η δημιουργια των μπλοκ πληροφοριων απετυχε - - - Failed to write block - Η δημιουργια του μπλοκ απετυχε - - - Failed to write file info - Αδυναμία εγγραφής πληροφοριων αρχειου - - - Failed to write to coin database - Αποτυχία εγγραφής στη βάση δεδομένων νομίσματος - - - Failed to write transaction index - Αποτυχία εγγραφής δείκτη συναλλαγών - - - Failed to write undo data - Αποτυχία εγγραφής αναίρεσης δεδομένων - - - Generate coins (default: 0) - Δημιουργία νομισμάτων (προκαθορισμος: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Πόσα μπλοκ να ελέγχθουν κατά την εκκίνηση (προεπιλογή:288,0=όλα) - Invalid -onion address: '%s' Άκυρη διεύθυνση -onion : '%s' @@ -2293,10 +2189,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Rebuild block chain index from current blk000??.dat files Εισαγωγή μπλοκ από εξωτερικό αρχείο blk000?.dat - - Set the number of threads to service RPC calls (default: 4) - Ορίσμος του αριθμόυ θεματων στην υπηρεσία κλήσεων RPC (προεπιλογή: 4) - Verifying blocks... Επαλήθευση των μπλοκ... @@ -2325,34 +2217,10 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Invalid amount for -mintxfee=<amount>: '%s' Μη έγκυρο ποσό για την παράμετρο -paytxfee=<amount>: '%s' - - Maintain a full transaction index (default: 0) - Διατηρήση ένος πλήρες ευρετήριου συναλλαγών (προεπιλογή: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Μέγιστος buffer λήψης ανά σύνδεση, <n>*1000 bytes (προεπιλογή: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Μέγιστος buffer αποστολής ανά σύνδεση, <n>*1000 bytes (προεπιλογή: 1000) - - - Only accept block chain matching built-in checkpoints (default: 1) - Μονο αποδοχη αλυσίδας μπλοκ που ταιριάζει με τα ενσωματωμένα σημεία ελέγχου (προεπιλογή: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Συνδέση μόνο σε κόμβους του δικτύου <net> (IPv4, IPv6 ή Tor) - Send trace/debug info to console instead of debug.log file Αποστολή πληροφοριών εντοπισμού σφαλμάτων στην κονσόλα αντί του αρχείου debug.log - - Set minimum block size in bytes (default: 0) - Ορίστε το μέγιστο μέγεθος μπλοκ σε bytes (προεπιλογή: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Συρρίκνωση του αρχείο debug.log κατα την εκκίνηση του πελάτη (προεπιλογή: 1 όταν δεν-debug) @@ -2361,14 +2229,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Signing transaction failed Η υπογραφή συναλλαγής απέτυχε - - Specify connection timeout in milliseconds (default: 5000) - Ορισμός λήξης χρονικού ορίου σε χιλιοστά του δευτερολέπτου(προεπιλογή:5000) - - - System error: - Λάθος Συστήματος: - Transaction amount too small Το ποσό της συναλλαγής είναι πολύ μικρο @@ -2381,10 +2241,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Transaction too large Η συναλλαγή ειναι πολύ μεγάλη - - Use UPnP to map the listening port (default: 0) - Χρησιμοποίηση του UPnP για την χρήση της πόρτας αναμονής (προεπιλογή:0) - Use UPnP to map the listening port (default: 1 when listening) Χρησιμοποίηση του UPnP για την χρήση της πόρτας αναμονής (προεπιλογή:1) @@ -2421,10 +2277,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Upgrade wallet to latest format Αναβάθμισε το πορτοφόλι στην τελευταία έκδοση - - Set key pool size to <n> (default: 100) - Όριο πλήθους κλειδιών pool <n> (προεπιλογή: 100) - Rescan the block chain for missing wallet transactions Επανέλεγχος της αλυσίδας μπλοκ για απούσες συναλλαγές @@ -2433,14 +2285,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Use OpenSSL (https) for JSON-RPC connections Χρήση του OpenSSL (https) για συνδέσεις JSON-RPC - - Server certificate file (default: server.cert) - Αρχείο πιστοποιητικού του διακομιστή (προεπιλογή: server.cert) - - - Server private key (default: server.pem) - Προσωπικό κλειδί του διακομιστή (προεπιλογή: server.pem) - This help message Αυτό το κείμενο βοήθειας diff --git a/src/qt/locale/bitcoin_eo.ts b/src/qt/locale/bitcoin_eo.ts index 652ee2d9bf..4496dcc3d9 100644 --- a/src/qt/locale/bitcoin_eo.ts +++ b/src/qt/locale/bitcoin_eo.ts @@ -370,10 +370,6 @@ Tabs toolbar Langeto-breto - - [testnet] - [testnet] - Bitcoin Core Kerno de Bitmono @@ -410,10 +406,6 @@ No block source available... Neniu fonto de blokoj trovebla... - - Processed %1 blocks of transaction history. - Traktis %1 blokoj de la transakcia historio. - %n hour(s) %n horo%n horoj @@ -856,15 +848,7 @@ Adreso: %4 Error Eraro - - GB of free space available - GB de libera loko disponebla - - - (of %1GB needed) - (el %1GB bezonataj) - - + OpenURIDialog @@ -1033,10 +1017,6 @@ Adreso: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Eblas, ke la informoj videblaj ĉi tie estas eksdataj. Via monujo aŭtomate sinkoniĝas kun la bitmona reto kiam ili konektiĝas, sed tiu procezo ankoraŭ ne finfariĝis. - - Wallet - Monujo - Your current spendable balance via aktuala elspezebla saldo @@ -1061,10 +1041,6 @@ Adreso: %4 Your current total balance via aktuala totala saldo - - <b>Recent transactions</b> - <b>Lastaj transakcioj</b> - out of sync nesinkronigita @@ -2198,26 +2174,10 @@ Adreso: %4 Options: Agordoj: - - Specify configuration file (default: bitcoin.conf) - Specifi konfiguran dosieron (defaŭlte: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Specifi pid-dosieron (defaŭlte: bitcoind.pid) - Specify data directory Specifi dosieron por datumoj - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Aŭskulti al <port> por konektoj (defaŭlte: 8333 aŭ testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Subteni maksimume <n> konektojn al samtavolanoj (defaŭlte: 125) - Connect to a node to retrieve peer addresses, and disconnect Konekti al nodo por ricevi adresojn de samtavolanoj, kaj malkonekti @@ -2226,18 +2186,6 @@ Adreso: %4 Specify your own public address Specifi vian propran publikan adreson - - Threshold for disconnecting misbehaving peers (default: 100) - Sojlo por malkonekti misagantajn samtavolanojn (defaŭlte: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Nombro da sekundoj por rifuzi rekonekton de misagantaj samtavolanoj (defaŭlte: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Aŭskulti al <port> por JSON-RPC-konektoj (defaŭlte: 8332 aŭ testnet: 18332) - Accept command line and JSON-RPC commands Akcepti komandojn JSON-RPC kaj el komandlinio @@ -2278,10 +2226,6 @@ Estas konsilinde ankaŭ agordi alertnotify por ke vi ricevu avertojn pri eventu ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Akcepteblaj ĉifroj (defaŭlte: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Bindi al donita adreso kaj ĉiam aŭskulti per ĝi. Uzu la formaton [gastigo]:pordo por IPv6 @@ -2374,62 +2318,10 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo.com Error: Wallet locked, unable to create transaction! Eraro: monujo ŝlosita, ne eblas krei transakcion! - - Error: system error: - Eraro: sistema eraro: - Failed to listen on any port. Use -listen=0 if you want this. Ne sukcesis aŭskulti ajnan pordon. Uzu -listen=0 se tion vi volas. - - Failed to read block info - Malsukcesis legi blokinformojn - - - Failed to read block - Malsukcesis legi blokon - - - Failed to sync block index - Malsukcesis sinkronigi blokindekson - - - Failed to write block index - Malsukcesis skribi blokindekson - - - Failed to write block info - Malsukcesis skribi blokinformojn - - - Failed to write block - Malsukcesis skribi blokon - - - Failed to write file info - Malsukcesis skribi dosierinformojn - - - Failed to write to coin database - Malsukcesis skribi Bitmon-datumbazon - - - Failed to write transaction index - Malsukcesis skribi transakcian indekson - - - Failed to write undo data - Malsukcesis skribi malfarajn datumojn - - - Generate coins (default: 0) - Generi Bitmonon (defaŭlte: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Kiom da blokoj kontrolendas dum lanĉo (defaŭlte: 288, 0=ĉiuj) - Incorrect or no genesis block found. Wrong datadir for network? Geneza bloko aŭ netrovita aŭ neĝusta. Ĉu eble la datadir de la reto malĝustas? @@ -2446,10 +2338,6 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo.com Rebuild block chain index from current blk000??.dat files Rekontrui blokĉenan indekson el la aktualaj blk000??.dat dosieroj - - Set the number of threads to service RPC calls (default: 4) - Specifi la nombron de fadenoj por priatenti RPC-alvokojn (defaŭlte: 4) - Specify wallet file (within data directory) Specifi monujan dosieron (ene de dosierujo por datumoj) @@ -2494,34 +2382,10 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo.com Invalid amount for -mintxfee=<amount>: '%s' Nevalida sumo por -mintxfee=<amount>: '%s' - - Maintain a full transaction index (default: 0) - Varti kompletan transakcian indekton (defaŭlte: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Maksimuma po riceva bufro por konektoj, <n>*1000 bajtoj (defaŭlte: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Maksimuma po senda bufro por konektoj, <n>*1000 bajtoj (defaŭlte: 1000) - - - Only accept block chain matching built-in checkpoints (default: 1) - Akcepti nur blokĉenon, kiu kongruas kun integritaj kontrolpunktoj (defaŭlte: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Konekti nur la nodoj en la reto <net> (IPv4, IPv6 aŭ Tor) - Send trace/debug info to console instead of debug.log file Sendi spurajn/sencimigajn informojn al la konzolo anstataŭ al dosiero debug.log - - Set minimum block size in bytes (default: 0) - Agordi minimuman grandon de blokoj je bajtoj (defaŭlte: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Malpligrandigi la sencimigan protokol-dosieron kiam kliento lanĉiĝas (defaŭlte: 1 kiam mankas -debug) @@ -2530,14 +2394,6 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo.com Signing transaction failed Subskriba transakcio fiaskis - - Specify connection timeout in milliseconds (default: 5000) - Specifi konektan tempolimon je milisekundoj (defaŭlte: 5000) - - - System error: - Sistema eraro: - Transaction amount too small Transakcia sumo tro malgranda @@ -2550,10 +2406,6 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo.com Transaction too large Transakcio estas tro granda - - Use UPnP to map the listening port (default: 0) - Uzi UPnP por mapi la aŭskultan pordon (defaŭlte: 0) - Use UPnP to map the listening port (default: 1 when listening) Uzi UPnP por mapi la aŭskultan pordon (defaŭlte: 1 dum aŭskultado) @@ -2586,10 +2438,6 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo.com Upgrade wallet to latest format Ĝisdatigi monujon al plej lasta formato - - Set key pool size to <n> (default: 100) - Agordi la grandon de la ŝlosilo-vico al <n> (defaŭlte: 100) - Rescan the block chain for missing wallet transactions Reskani la blokĉenon por mankantaj monujaj transakcioj @@ -2598,14 +2446,6 @@ ekzemple: alertnotify=echo %%s | mail -s "Averto de Bitmono" admin@foo.com Use OpenSSL (https) for JSON-RPC connections Uzi OpenSSL (https) por konektoj JSON-RPC - - Server certificate file (default: server.cert) - Dosiero de servila atestilo (defaŭlte: server.cert) - - - Server private key (default: server.pem) - Dosiero de servila privata ŝlosilo (defaŭlte: server.pem) - This help message Tiu ĉi helpmesaĝo diff --git a/src/qt/locale/bitcoin_es.ts b/src/qt/locale/bitcoin_es.ts index fad8c9bbe8..0cb8991e11 100644 --- a/src/qt/locale/bitcoin_es.ts +++ b/src/qt/locale/bitcoin_es.ts @@ -390,10 +390,6 @@ Tabs toolbar Barra de pestañas - - [testnet] - [testnet] - Bitcoin Core Bitcoin Core @@ -434,10 +430,6 @@ No block source available... Ninguna fuente de bloques disponible ... - - Processed %1 blocks of transaction history. - Procesados %1 bloques del historial de transacciones. - %n hour(s) %n hora%n horas @@ -486,6 +478,10 @@ Up to date Actualizado + + Processed %n blocks of transaction history. + %n bloques procesados del historial de transaccionesProcesados %n bloques del historial de transacciones + Catching up... Actualizando... @@ -916,13 +912,13 @@ Dirección: %4 Error Error - - GB of free space available - GB de espacio libre disponible + + %n GB of free space available + %n GB de espacio libre%n GB de espacio disponible - - (of %1GB needed) - (de los %1GB necesarios) + + (of %n GB needed) + (de %n GB necesitados)(de %n GB requeridos) @@ -1165,10 +1161,6 @@ Dirección: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. La información mostrada puede estar desactualizada. Su monedero se sincroniza automáticamente con la red Bitcoin después de que se haya establecido una conexión, pero este proceso aún no se ha completado. - - Wallet - Monedero - Watch-only: De observación: @@ -1197,6 +1189,10 @@ Dirección: %4 Mined balance that has not yet matured Saldo recién minado que aún no ha madurado. + + Balances + Saldos + Total: Total: @@ -1209,6 +1205,14 @@ Dirección: %4 Your current balance in watch-only addresses Su saldo actual en direcciones watch-only + + Spendable: + Gastable: + + + Recent transactions + Transacciones recientes + Unconfirmed transactions to watch-only addresses Transacciones sin confirmar en direcciones watch-only @@ -1221,10 +1225,6 @@ Dirección: %4 Current total balance in watch-only addresses Saldo total en las direcciones watch-only - - <b>Recent transactions</b> - <b>Transacciones recientes</b> - out of sync desincronizado @@ -1484,10 +1484,6 @@ Dirección: %4 Services Servicios - - Sync Node - Sincronizar Nodo - Starting Height Altura de comienzo @@ -1616,14 +1612,6 @@ Dirección: %4 Outbound Saliente - - Yes - - - - No - No - Unknown Desconocido @@ -2472,6 +2460,10 @@ Dirección: %4 Mined Minado + + watch-only + de observación + (n/a) (nd) @@ -2583,6 +2575,10 @@ Dirección: %4 Export Transaction History Exportar historial de transacciones + + Watch-only + De observación + Exporting Failed Error exportando @@ -2697,30 +2693,12 @@ Dirección: %4 Options: Opciones: - - - - Specify configuration file (default: bitcoin.conf) - Especificar archivo de configuración (predeterminado: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - Especificar archivo pid (predeterminado: bitcoin.pid) Specify data directory Especificar directorio para los datos - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Escuchar conexiones en <puerto> (predeterminado: 8333 o testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Mantener como máximo <n> conexiones a pares (predeterminado: 125) - Connect to a node to retrieve peer addresses, and disconnect Conectar a un nodo para obtener direcciones de pares y desconectar @@ -2729,18 +2707,6 @@ Dirección: %4 Specify your own public address Especifique su propia dirección pública - - Threshold for disconnecting misbehaving peers (default: 100) - Umbral para la desconexión de pares con mal comportamiento (predeterminado: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Número de segundos en que se evita la reconexión de pares con mal comportamiento (predeterminado: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Escuchar conexiones JSON-RPC en <puerto> (predeterminado: 8332 o testnet:18332) - Accept command line and JSON-RPC commands Aceptar comandos consola y JSON-RPC @@ -2784,17 +2750,13 @@ Se recomienda también establecer alertnotify para recibir notificaciones de pro Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Cifrados aceptables (predeterminados: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Vincular a la dirección dada y escuchar siempre en ella. Utilice la notación [host]:port para IPv6 - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - Limitar continuamente las transacciones gratuitas a <n>*1000 bytes por minuto (predeterminado:15) + Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup + Borrar todas las transacciones del monedero y sólo recuperar aquellas partes de la cadena de bloques por medio de -rescan on startup. Enter regression test mode, which uses a special chain in which blocks can be solved instantly. @@ -2812,14 +2774,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Ejecutar comando cuando una transacción del monedero cambia (%s en cmd se remplazará por TxID) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - Volcar la actividad de la base de datos de memoria al registro en disco cada <n> megabytes (predeterminado: 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - Nivel de rigor en la verificación de bloques de -checkblocks (0-4; predeterminado: 3) - In this mode -genproclimit controls how many blocks are generated immediately. En este modo -genproclimit controla cuántos bloques se generan de inmediato. @@ -2828,10 +2782,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Establecer el número de hilos (threads) de verificación de scripts (entre %u y %d, 0 = automático, <0 = dejar libres ese número de núcleos; predeterminado: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - Establecer el límite de procesadores cuando está activada la generación (-1 = sin límite; predeterminado: -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Esta es una versión de pre-prueba - utilícela bajo su propio riesgo. No la utilice para usos comerciales o de minería. @@ -2840,10 +2790,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Unable to bind to %s on this computer. Bitcoin Core is probably already running. No se ha podido acceder a %s en esta máquina. Probablemente ya se está ejecutando Bitcoin Core. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Usar proxy SOCKS5 distinto para comunicarse vía Tor de forma anónima (Predeterminado: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Aviso: ¡-paytxfee tiene un valor muy alto! Esta es la comisión que pagará si envía una transacción. @@ -2865,12 +2811,12 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Aviso: ¡Recuperados datos de wallet.dat corrupto! El wallet.dat original se ha guardado como wallet.{timestamp}.bak en %s; si hubiera errores en su saldo o transacciones, deberá restaurar una copia de seguridad. - (default: 1) - (predeterminado: 1) + Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times. + Poner en lista blanca a los equipos que se conecten desde la máscara de subred o dirección IP especificada. Se puede especificar múltiples veces. - (default: wallet.dat) - (predeterminado: wallet.dat) + (default: 1) + (predeterminado: 1) <category> can be: @@ -2900,10 +2846,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Debugging/Testing options: Opciones de depuración/pruebas: - - Disable safemode, override a real safe mode event (default: 0) - Inhabilitar el modo seguro, no considerar un suceso real de modo seguro (predeterminado: 0) - Discover own IP address (default: 1 when listening and no -externalip) Descubrir dirección IP propia (predeterminado: 1 al escuchar sin -externalip) @@ -2932,6 +2874,10 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error opening block database Error al abrir base de datos de bloques. + + Error: A fatal internal error occured, see debug.log for details + Error: un error grave interno ocurrió, sea debug.log para más detalles. + Error: Disk space is low! Error: ¡Espacio en disco bajo! @@ -2940,66 +2886,10 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Wallet locked, unable to create transaction! Error: ¡El monedero está bloqueado; no se puede crear la transacción! - - Error: system error: - Error: error de sistema: - Failed to listen on any port. Use -listen=0 if you want this. Ha fallado la escucha en todos los puertos. Use -listen=0 si desea esto. - - Failed to read block info - No se ha podido leer la información de bloque - - - Failed to read block - No se ha podido leer el bloque - - - Failed to sync block index - No se ha podido sincronizar el índice de bloques - - - Failed to write block index - No se ha podido escribir en el índice de bloques - - - Failed to write block info - No se ha podido escribir la información de bloques - - - Failed to write block - No se ha podido escribir el bloque - - - Failed to write file info - No se ha podido escribir la información de archivo - - - Failed to write to coin database - No se ha podido escribir en la base de datos de bitcoins - - - Failed to write transaction index - No se ha podido escribir en el índice de transacciones - - - Failed to write undo data - No se han podido escribir los datos de deshacer - - - Force safe mode (default: 0) - Forzar modo seguro (predeterminado: 0) - - - Generate coins (default: 0) - Generar bitcoins (predeterminado: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Cuántos bloques comprobar al iniciar (predeterminado: 288, 0 = todos) - If <category> is not supplied, output all debugging information. Si no se proporciona <category>, mostrar toda la depuración @@ -3021,8 +2911,8 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com No hay suficientes descriptores de archivo disponibles. - Prepend debug output with timestamp (default: 1) - Anteponer marca temporal a la información de depuración (predeterminado: 1) + Only connect to nodes in network <net> (ipv4, ipv6 or onion) + Sólo conectar a nodos en redes <net> (ipv4, ipv6 o onion) Rebuild block chain index from current blk000??.dat files @@ -3036,22 +2926,18 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set maximum block size in bytes (default: %d) Establecer tamaño máximo de bloque en bytes (predeterminado: %d) - - Set the number of threads to service RPC calls (default: 4) - Establecer el número de procesos para atender las llamadas RPC (predeterminado: 4) - Specify wallet file (within data directory) Especificar archivo de monedero (dentro del directorio de datos) - - Spend unconfirmed change when sending transactions (default: 1) - Gastar cambio no confirmado al enviar transacciones (predeterminado: 1) - This is intended for regression testing tools and app development. Esto afecta a las herramientas de prueba de regresión y al desarrollo informático de la aplicación. + + Use UPnP to map the listening port (default: %u) + Usar UPnP para asignar el puerto de escucha (predeterminado:: %u) + Verifying blocks... Verificando bloques... @@ -3076,17 +2962,41 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Imports blocks from external blk000??.dat file Importa los bloques desde un archivo blk000??.dat externo + + An error occurred while setting up the RPC address %s port %u for listening: %s + Ocurrió un error al configurar la dirección de RPC %s puerto %u para escuchar en: %s + + + Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6 + Ligar a las direcciones especificadas y poner en lista blanca a los equipos conectados a ellas. Usar la notación para IPv6 [host]:puerto. + + + Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces) + Ligar a las direcciones especificadas para escuchar por conexiones JSON-RPC. Usar la notación para IPv6 [host]:puerto. Esta opción se puede especificar múltiples veces (por defecto: ligar a todas las interfaces) + Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. No se ha podido bloquear el directorio de datos %s. Probablemente ya se está ejecutando Bitcoin Core. - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - Ejecutar un comando cuando se reciba una alerta importante o cuando veamos un fork demasiado largo (%s en cmd se reemplazará por el mensaje) + Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:%u) + Limitar continuamente las transacciones gratuitas a <n>*1000 bytes por minuto (predeterminado:%u) - Output debugging information (default: 0, supplying <category> is optional) - Mostrar información de depuración (predeterminado: 0, proporcionar <category> es opcional) + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) + Crear nuevos archivos con permisos por defecto del sistema, en lugar de umask 077 (sólo efectivo con la funcionalidad de monedero desactivada) + + + Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + Distribuido bajo la licencia de software MIT/X11, vea la copia del archivo adjunto o <http://www.opensource.org/licenses/mit-license.php>. + + + Error: Listening for incoming connections failed (listen returned error %s) + Error: la escucha para conexiones entrantes falló (la escucha regresó el error %s) + + + Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) + Ejecutar un comando cuando se reciba una alerta importante o cuando veamos un fork demasiado largo (%s en cmd se reemplazará por el mensaje) Set maximum size of high-priority/low-fee transactions in bytes (default: %d) @@ -3108,6 +3018,10 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Copyright (C) 2009-%i The Bitcoin Core Developers Copyright (C) 2009-%i The Bitcoin Core Developers + + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core + Error al cargar wallet.dat: El monedero requiere una versión más reciente de Bitcoin Core + Information Información @@ -3121,41 +3035,13 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Cantidad inválida para -mintxfee=<amount>: '%s' - Limit size of signature cache to <n> entries (default: 50000) - Limitar tamaño de la cache de firmas a <n> entradas (predeterminado: 50000) - - - Log transaction priority and fee per kB when mining blocks (default: 0) - Registrar en el log la prioridad de transacciones y la comisión por kB al minar bloques (predeterminado: 0) - - - Maintain a full transaction index (default: 0) - Mantener índice de transacciones completo (predeterminado: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Búfer de recepción máximo por conexión, <n>*1000 bytes (predeterminado: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Búfer de recepción máximo por conexión, , <n>*1000 bytes (predeterminado: 1000) - - - Only accept block chain matching built-in checkpoints (default: 1) - Aceptar solamente cadena de bloques que concuerde con los puntos de control internos (predeterminado: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Conectarse solo a nodos de la red <net> (IPv4, IPv6 o Tor) + Node relay options: + Opciones de nodos de retransmisión: Print block on startup, if found in block index Imprimir bloque al iniciar, si se encuentra en el índice de bloques - - Print block tree on startup (default: 0) - Imprimir árbol de bloques al iniciar (predeterminado: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) Opciones SSL de RPC: (véase la wiki de Bitcoin para las instrucciones de instalación de SSL) @@ -3172,22 +3058,10 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Randomly fuzz 1 of every <n> network messages Introducir datos fuzz en 1 de cada <n> mensajes de red al azar - - Run a thread to flush wallet periodically (default: 1) - Ejecutar un hilo (thread) para limpiar de la memoria el monedero periódicamente (predeterminado: 1) - Send trace/debug info to console instead of debug.log file Enviar información de trazas/depuración a la consola en lugar de al archivo debug.log - - Set minimum block size in bytes (default: 0) - Establecer tamaño mínimo de bloque en bytes (predeterminado: 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - Establece la opción DB_PRIVATE en el entorno de base de datos del monedero (predeterminado: 1) - Show all debugging options (usage: --help -help-debug) Muestra todas las opciones de depuración (uso: --help -help-debug) @@ -3200,14 +3074,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Signing transaction failed Transacción falló - - Specify connection timeout in milliseconds (default: 5000) - Especificar el tiempo máximo de conexión en milisegundos (predeterminado: 5000) - - - System error: - Error de sistema: - This is experimental software. Este software es experimental. @@ -3225,8 +3091,8 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Transacción demasiado grande - Use UPnP to map the listening port (default: 0) - Usar UPnP para asignar el puerto de escucha (predeterminado: 0) + Unable to bind to %s on this computer (bind returned error %s) + No es posible conectar con %s en este sistema (bind ha dado el error %s) Use UPnP to map the listening port (default: 1 when listening) @@ -3237,6 +3103,10 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Nombre de usuario para las conexiones JSON-RPC + + Wallet needed to be rewritten: restart Bitcoin Core to complete + Monedero es necesario volver a escribir: reiniciar Bitcoin Core para completar + Warning Aviso @@ -3245,6 +3115,10 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Warning: This version is obsolete, upgrade required! Aviso: Esta versión es obsoleta, actualización necesaria! + + Warning: Unsupported argument -debugnet ignored, use -debug=net. + Aviso: Argumento no sportado -debugnet anticuado, utilice -debug=net. + Zapping all transactions from wallet... Eliminando todas las transacciones del monedero... @@ -3270,11 +3144,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Upgrade wallet to latest format Actualizar el monedero al último formato - - Set key pool size to <n> (default: 100) - Ajustar el número de claves en reserva <n> (predeterminado: 100) - - Rescan the block chain for missing wallet transactions Volver a examinar la cadena de bloques en busca de transacciones del monedero perdidas @@ -3282,16 +3151,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Use OpenSSL (https) for JSON-RPC connections Usar OpenSSL (https) para las conexiones JSON-RPC - - - - Server certificate file (default: server.cert) - Certificado del servidor (predeterminado: server.cert) - - - - Server private key (default: server.pem) - Clave privada del servidor (predeterminado: server.pem) @@ -3311,14 +3170,158 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error loading wallet.dat: Wallet corrupted Error al cargar wallet.dat: el monedero está dañado + + Flush database activity from memory pool to disk log every <n> megabytes (default: %u) + Volcar la actividad de la base de datos de memoria al registro en disco cada <n> megabytes (predeterminado: %u) + + + How thorough the block verification of -checkblocks is (0-4, default: %u) + Nivel de rigor en la verificación de bloques de -checkblocks (0-4; predeterminado: %u) + + + Log transaction priority and fee per kB when mining blocks (default: %u) + Registrar prioridad de las transacciones y cuota por kB cuando se minen bloques (por defecto: %u) + + + Number of seconds to keep misbehaving peers from reconnecting (default: %u) + Número de segundos en que se evita la reconexión de pares con mal comportamiento (predeterminado: %u) + + + Output debugging information (default: %u, supplying <category> is optional) + Mostrar depuración (por defecto: %u, proporcionar <category> es opcional) + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) + Usar distintos proxys SOCKS5 para comunicarse vía Tor de forma anónima (Por defecto: %s) + + + (default: %s) + (predeterminado: %s) + + + Acceptable ciphers (default: %s) + Aceptar cifrado (por defecto: %s) + + + Always query for peer addresses via DNS lookup (default: %u) + Siempre consultar direcciones de otros equipos por medio de DNS lookup (por defecto: %u) + + + Disable safemode, override a real safe mode event (default: %u) + Inhabilitar el modo seguro, no considerar un suceso real de modo seguro (predeterminado: %u) + Error loading wallet.dat Error al cargar wallet.dat + + Force safe mode (default: %u) + Forzar modo seguro (por defecto: %u) + + + Generate coins (default: %u) + Generar monedas (por defecto: %u) + + + How many blocks to check at startup (default: %u, 0 = all) + Cuántos bloques comprobar al iniciar (predeterminado: %u, 0 = todos) + + + Include IP addresses in debug output (default: %u) + Incluir direcciones IP en la salida de depuración (por defecto: %u) + Invalid -proxy address: '%s' Dirección -proxy inválida: '%s' + + Limit size of signature cache to <n> entries (default: %u) + Limitar tamaño de la cache de firmas a <n> entradas (predeterminado: %u) + + + Listen for JSON-RPC connections on <port> (default: %u or testnet: %u) + Escuchar conexiones JSON-RPC en <puerto> (predeterminado: %u o testnet: %u) + + + Listen for connections on <port> (default: %u or testnet: %u) + Escuchar conexiones en <puerto> (predeterminado: %u o testnet: %u) + + + Maintain at most <n> connections to peers (default: %u) + Mantener como máximo <n> conexiones a pares (predeterminado: %u) + + + Maximum per-connection receive buffer, <n>*1000 bytes (default: %u) + Búfer de recepción máximo por conexión, <n>*1000 bytes (por defecto: %u) + + + Maximum per-connection send buffer, <n>*1000 bytes (default: %u) + Búfer de recepción máximo por conexión, , <n>*1000 bytes (por defecto: %u) + + + Only accept block chain matching built-in checkpoints (default: %u) + Aceptar solamente cadena de bloques que concuerde con los puntos de control internos (predeterminado: %u) + + + Prepend debug output with timestamp (default: %u) + Anteponer marca temporal a la información de depuración (por defecto: %u) + + + Print block tree on startup (default: %u) + Imprimir árbol de bloques al iniciar (predeterminado: %u) + + + Run a thread to flush wallet periodically (default: %u) + Ejecutar un hilo para limpiar de la memoria el monedero periódicamente (predeterminado: %u) + + + Server certificate file (default: %s) + Archivo de certificado del servidor (por defecto: %s) + + + Server private key (default: %s) + Llave privada del servidor (por defecto: %s) + + + Set key pool size to <n> (default: %u) + Ajustar el número de claves en reserva <n> (predeterminado: %u) + + + Set minimum block size in bytes (default: %u) + Establecer tamaño mínimo de bloque en bytes (por defecto: %u) + + + Set the number of threads to service RPC calls (default: %d) + Establecer el número de procesos para llamadas del servicio RPC (por defecto: %d) + + + Sets the DB_PRIVATE flag in the wallet db environment (default: %u) + Establece la opción DB_PRIVATE en el entorno de base de datos del monedero (predeterminado: %u) + + + Specify configuration file (default: %s) + Especificar archivo de configuración (por defecto: %s) + + + Specify connection timeout in milliseconds (minimum: 1, default: %d) + Especificar tiempo de espera de la conexión (mínimo: 1, por defecto: %d) + + + Specify pid file (default: %s) + Especificar archivo pid (predeterminado: %s) + + + Spend unconfirmed change when sending transactions (default: %u) + Gastar cambio no confirmado al enviar transacciones (predeterminado: %u) + + + Stop running after importing blocks from disk (default: %u) + Detener después de importar los bloques del disco (por defecto: %u) + + + Threshold for disconnecting misbehaving peers (default: %u) + Umbral para la desconexión de pares con mal comportamiento (predeterminado: %u) + Unknown network specified in -onlynet: '%s' La red especificada en -onlynet '%s' es desconocida diff --git a/src/qt/locale/bitcoin_es_CL.ts b/src/qt/locale/bitcoin_es_CL.ts index b22ad3fb8e..930aac8449 100644 --- a/src/qt/locale/bitcoin_es_CL.ts +++ b/src/qt/locale/bitcoin_es_CL.ts @@ -274,10 +274,6 @@ Tabs toolbar Barra de pestañas - - [testnet] - [red-de-pruebas] - %n active connection(s) to Bitcoin network %n conexión activa hacia la red Bitcoin%n conexiones activas hacia la red Bitcoin @@ -573,18 +569,10 @@ Dirección: %4 Form Formulario - - Wallet - Cartera - Total: Total: - - <b>Recent transactions</b> - <b>Transacciones recientes</b> - out of sync desincronizado @@ -1277,16 +1265,6 @@ Dirección: %4 Options: Opciones: - - - - Specify configuration file (default: bitcoin.conf) - Especifica archivo de configuración (predeterminado: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - Especifica archivo pid (predeterminado: bitcoin.pid) @@ -1294,22 +1272,6 @@ Dirección: %4 Especifica directorio para los datos - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Escuchar por conecciones en <puerto> (Por defecto: 8333 o red de prueba: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Mantener al menos <n> conecciones por cliente (por defecto: 125) - - - Threshold for disconnecting misbehaving peers (default: 100) - Umbral de desconección de clientes con mal comportamiento (por defecto: 100) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Escucha conexiones JSON-RPC en el puerto <port> (predeterminado: 8332 or testnet: 18332) - Accept command line and JSON-RPC commands Aceptar comandos consola y JSON-RPC @@ -1342,34 +1304,6 @@ Dirección: %4 Error: Disk space is low! Atención: Poco espacio en el disco duro - - Error: system error: - Error: error de sistema: - - - Failed to read block info - Falló la lectura de la información del bloque - - - Failed to read block - Falló la lectura del bloque - - - Failed to sync block index - Falló sincronización del índice del bloque - - - Failed to write block index - Falló la escritura del bloque del índice - - - Failed to write block info - Falló la escritura de la información del bloque - - - Failed to write block - Falló la escritura del bloque - Imports blocks from external blk000??.dat file Importar bloques desde el archivo externo blk000??.dat @@ -1382,22 +1316,6 @@ Dirección: %4 Send trace/debug info to console instead of debug.log file Enviar informacion de seguimiento a la consola en vez del archivo debug.log - - Set minimum block size in bytes (default: 0) - Establezca el tamaño mínimo del bloque en bytes (por defecto: 0) - - - Specify connection timeout in milliseconds (default: 5000) - Especifica tiempo de espera para conexion en milisegundos (predeterminado: 5000) - - - System error: - Error de sistema: - - - Use UPnP to map the listening port (default: 0) - Intenta usar UPnP para mapear el puerto de escucha (default: 0) - Use UPnP to map the listening port (default: 1 when listening) Intenta usar UPnP para mapear el puerto de escucha (default: 1 when listening) @@ -1428,11 +1346,6 @@ Dirección: %4 Upgrade wallet to latest format Actualizar billetera al formato actual - - Set key pool size to <n> (default: 100) - Ajusta el numero de claves en reserva <n> (predeterminado: 100) - - Rescan the block chain for missing wallet transactions Rescanea la cadena de bloques para transacciones perdidas de la cartera @@ -1441,16 +1354,6 @@ Dirección: %4 Use OpenSSL (https) for JSON-RPC connections Usa OpenSSL (https) para las conexiones JSON-RPC - - - - Server certificate file (default: server.cert) - Certificado del servidor (Predeterminado: server.cert) - - - - Server private key (default: server.pem) - Clave privada del servidor (Predeterminado: server.pem) diff --git a/src/qt/locale/bitcoin_es_DO.ts b/src/qt/locale/bitcoin_es_DO.ts index a9cfe90895..8099b182ae 100644 --- a/src/qt/locale/bitcoin_es_DO.ts +++ b/src/qt/locale/bitcoin_es_DO.ts @@ -374,10 +374,6 @@ Tabs toolbar Barra de pestañas - - [testnet] - [testnet] - Bitcoin Core Núcleo de Bitcoin @@ -410,10 +406,6 @@ No block source available... Ninguna fuente de bloques disponible ... - - Processed %1 blocks of transaction history. - Procesados %1 bloques del historial de transacciones. - %1 behind %1 atrás @@ -848,15 +840,7 @@ Dirección: %4 Error Error - - GB of free space available - GB de espacio libre disponible - - - (of %1GB needed) - (de los %1GB necesarios) - - + OpenURIDialog @@ -1041,10 +1025,6 @@ Dirección: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. La información mostrada puede estar desactualizada. Su monedero se sincroniza automáticamente con la red Bitcoin después de que se haya establecido una conexión, pero este proceso aún no se ha completado. - - Wallet - Monedero - Your current spendable balance Su balance actual gastable @@ -1069,10 +1049,6 @@ Dirección: %4 Your current total balance Su balance actual total - - <b>Recent transactions</b> - <b>Movimientos recientes</b> - out of sync desincronizado @@ -2241,30 +2217,12 @@ Dirección: %4 Options: Opciones: - - - - Specify configuration file (default: bitcoin.conf) - Especificar archivo de configuración (predeterminado: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - Especificar archivo pid (predeterminado: bitcoin.pid) Specify data directory Especificar directorio para los datos - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Escuchar conexiones en <puerto> (predeterminado: 8333 o testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Mantener como máximo <n> conexiones a pares (predeterminado: 125) - Connect to a node to retrieve peer addresses, and disconnect Conectar a un nodo para obtener direcciones de pares y desconectar @@ -2273,18 +2231,6 @@ Dirección: %4 Specify your own public address Especifique su propia dirección pública - - Threshold for disconnecting misbehaving peers (default: 100) - Umbral para la desconexión de pares con mal comportamiento (predeterminado: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Número de segundos en que se evita la reconexión de pares con mal comportamiento (predeterminado: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Escuchar conexiones JSON-RPC en <puerto> (predeterminado: 8332 o testnet:18332) - Accept command line and JSON-RPC commands Aceptar comandos consola y JSON-RPC @@ -2328,10 +2274,6 @@ Se recomienda también establecer alertnotify para recibir notificaciones de pro Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Cifradores aceptables (por defecto: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Vincular a la dirección dada y escuchar siempre en ella. Utilice la notación [host]:port para IPv6 @@ -2352,10 +2294,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Esta es una versión de pre-prueba - utilícela bajo su propio riesgo. No la utilice para usos comerciales o de minería. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Usar distintos proxys SOCKS5 para comunicarse vía Tor de forma anónima (Por defecto: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Aviso: ¡-paytxfee tiene un valor muy alto! Esta es la comisión que pagará si envía una transacción. @@ -2428,62 +2366,10 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Wallet locked, unable to create transaction! Error: ¡El monedero está bloqueado; no se puede crear la transacción! - - Error: system error: - Error: error de sistema: - Failed to listen on any port. Use -listen=0 if you want this. Ha fallado la escucha en todos los puertos. Use -listen=0 si desea esto. - - Failed to read block info - No se ha podido leer la información de bloque - - - Failed to read block - No se ha podido leer el bloque - - - Failed to sync block index - No se ha podido sincronizar el índice de bloques - - - Failed to write block index - No se ha podido escribir en el índice de bloques - - - Failed to write block info - No se ha podido escribir la información de bloques - - - Failed to write block - No se ha podido escribir el bloque - - - Failed to write file info - No se ha podido escribir la información de archivo - - - Failed to write to coin database - No se ha podido escribir en la base de datos de monedas - - - Failed to write transaction index - No se ha podido escribir en el índice de transacciones - - - Failed to write undo data - No se han podido escribir los datos de deshacer - - - Generate coins (default: 0) - Generar monedas (por defecto: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Cuántos bloques comprobar al iniciar (predeterminado: 288, 0 = todos) - If <category> is not supplied, output all debugging information. Si no se proporciona <category>, mostrar toda la depuración @@ -2500,10 +2386,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Not enough file descriptors available. No hay suficientes descriptores de archivo disponibles. - - Prepend debug output with timestamp (default: 1) - Anteponer marca temporal a la información de depuración (por defecto: 1) - Rebuild block chain index from current blk000??.dat files Reconstruir el índice de la cadena de bloques a partir de los archivos blk000??.dat actuales @@ -2512,10 +2394,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set maximum block size in bytes (default: %d) Establecer tamaño máximo de bloque en bytes (por defecto: %d) - - Set the number of threads to service RPC calls (default: 4) - Establecer el número de hilos para atender las llamadas RPC (predeterminado: 4) - Specify wallet file (within data directory) Especificar archivo de monedero (dentro del directorio de datos) @@ -2544,10 +2422,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Ejecutar un comando cuando se reciba una alerta importante o cuando veamos un fork demasiado largo (%s en cmd se reemplazará por el mensaje) - - Output debugging information (default: 0, supplying <category> is optional) - Mostrar depuración (por defecto: 0, proporcionar <category> es opcional) - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Establecer tamaño máximo de las transacciones de alta prioridad/comisión baja en bytes (por defecto: %d) @@ -2564,34 +2438,10 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Invalid amount for -mintxfee=<amount>: '%s' Inválido por el monto -mintxfee=<amount>: '%s' - - Maintain a full transaction index (default: 0) - Mantener índice de transacciones completo (predeterminado: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Búfer de recepción máximo por conexión, <n>*1000 bytes (predeterminado: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Búfer de recepción máximo por conexión, , <n>*1000 bytes (predeterminado: 1000) - - - Only accept block chain matching built-in checkpoints (default: 1) - Aceptar solamente cadena de bloques que concuerde con los puntos de control internos (predeterminado: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Conectarse solo a nodos de la red <net> (IPv4, IPv6 o Tor) - Send trace/debug info to console instead of debug.log file Enviar información de trazas/depuración a la consola en lugar de al archivo debug.log - - Set minimum block size in bytes (default: 0) - Establecer tamaño mínimo de bloque en bytes (predeterminado: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Reducir el archivo debug.log al iniciar el cliente (predeterminado: 1 sin -debug) @@ -2600,14 +2450,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Signing transaction failed Transacción falló - - Specify connection timeout in milliseconds (default: 5000) - Especificar el tiempo máximo de conexión en milisegundos (predeterminado: 5000) - - - System error: - Error de sistema: - Transaction amount too small Monto de la transacción muy pequeño @@ -2620,10 +2462,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Transaction too large Transacción demasiado grande - - Use UPnP to map the listening port (default: 0) - Usar UPnP para asignar el puerto de escucha (predeterminado: 0) - Use UPnP to map the listening port (default: 1 when listening) Usar UPnP para asignar el puerto de escucha (predeterminado: 1 al escuchar) @@ -2658,11 +2496,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Upgrade wallet to latest format Actualizar el monedero al último formato - - Set key pool size to <n> (default: 100) - Ajustar el número de claves en reserva <n> (predeterminado: 100) - - Rescan the block chain for missing wallet transactions Volver a examinar la cadena de bloques en busca de transacciones del monedero perdidas @@ -2670,16 +2503,6 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Use OpenSSL (https) for JSON-RPC connections Usar OpenSSL (https) para las conexiones JSON-RPC - - - - Server certificate file (default: server.cert) - Certificado del servidor (predeterminado: server.cert) - - - - Server private key (default: server.pem) - Clave privada del servidor (predeterminado: server.pem) diff --git a/src/qt/locale/bitcoin_es_MX.ts b/src/qt/locale/bitcoin_es_MX.ts index c89ac5c6ef..93d9f6473d 100644 --- a/src/qt/locale/bitcoin_es_MX.ts +++ b/src/qt/locale/bitcoin_es_MX.ts @@ -569,10 +569,6 @@ Form Formulario - - <b>Recent transactions</b> - <b>Transacciones recientes</b> - PaymentServer diff --git a/src/qt/locale/bitcoin_es_UY.ts b/src/qt/locale/bitcoin_es_UY.ts index 321e5312ad..8bca84c219 100644 --- a/src/qt/locale/bitcoin_es_UY.ts +++ b/src/qt/locale/bitcoin_es_UY.ts @@ -162,10 +162,6 @@ Tabs toolbar Barra de herramientas - - [testnet] - [prueba_de_red] - %n active connection(s) to Bitcoin network %n conexión activa a la red Bitcoin %n conexiones activas a la red Bitcoin @@ -277,10 +273,6 @@ Form Formulario - - <b>Recent transactions</b> - <b>Transacciones recientes</b> - PaymentServer diff --git a/src/qt/locale/bitcoin_et.ts b/src/qt/locale/bitcoin_et.ts index cd3a39b6b9..82ed0337ab 100644 --- a/src/qt/locale/bitcoin_et.ts +++ b/src/qt/locale/bitcoin_et.ts @@ -310,10 +310,6 @@ Tabs toolbar Vahelehe tööriistariba - - [testnet] - [testnet] - Bitcoin Core Bitcoini tuumik @@ -322,10 +318,6 @@ %n active connection(s) to Bitcoin network %n aktiivne ühendus Bitcoini võrku%n aktiivset ühendust Bitcoini võrku - - Processed %1 blocks of transaction history. - Protsessitud %1 tehingute ajaloo blokki. - %n hour(s) %n tund%n tundi @@ -672,10 +664,6 @@ Aadress: %4⏎ The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Kuvatav info ei pruugi olla ajakohane. Ühenduse loomisel süngitakse sinu rahakott automaatselt Bitconi võrgustikuga, kuid see toiming on hetkel lõpetamata. - - Wallet - Rahakott - Immature: Ebaküps: @@ -684,10 +672,6 @@ Aadress: %4⏎ Mined balance that has not yet matured Mitte aegunud mine'itud jääk - - <b>Recent transactions</b> - <b>Uuesti saadetud tehingud</b> - out of sync sünkimata @@ -1493,26 +1477,10 @@ Aadress: %4⏎ Options: Valikud: - - Specify configuration file (default: bitcoin.conf) - Täpsusta sätete fail (vaikimisi: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Täpsusta PID fail (vaikimisi: bitcoin.pid) - Specify data directory Täpsusta andmekataloog - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Kuula ühendusi pordil <port> (vaikeväärtus: 8333 või testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Säilita vähemalt <n> ühendust peeridega (vaikeväärtus: 125) - Connect to a node to retrieve peer addresses, and disconnect Peeri aadressi saamiseks ühendu korraks node'iga @@ -1521,18 +1489,6 @@ Aadress: %4⏎ Specify your own public address Täpsusta enda avalik aadress - - Threshold for disconnecting misbehaving peers (default: 100) - Ulakate peeride valulävi (vaikeväärtus: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Mitme sekundi pärast ulakad peerid tagasi võivad tulla (vaikeväärtus: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Kuula JSON-RPC ühendusel seda porti <port> (vaikeväärtus: 8332 või testnet: 18332) - Accept command line and JSON-RPC commands Luba käsurea ning JSON-RPC käsklusi @@ -1653,66 +1609,14 @@ nt: alertnotify=echo %%s | email -s "Bitcoin Alert" admin@foo.com Error: Wallet locked, unable to create transaction! Tõrge: Rahakott on lukus, tehingu loomine ei ole võimalik! - - Error: system error: - Tõrge: süsteemi tõrge: - Failed to listen on any port. Use -listen=0 if you want this. Pordi kuulamine nurjus. Soovikorral kasuta -listen=0. - - Failed to read block info - Tõrge bloki sisu lugemisel - - - Failed to read block - Bloki lugemine ebaõnnestus - - - Failed to sync block index - Bloki indeksi sünkimine ebaõnnestus - - - Failed to write block index - Bloki indeksi kirjutamine ebaõnnestus - - - Failed to write block info - Bloki sisu kirjutamine ebaõnnestus - - - Failed to write block - Tõrge bloki sisu kirjutamisel - - - Failed to write file info - Tõrge faili info kirjutamisel - - - Failed to write to coin database - Tõrge mündi andmebaasi kirjutamisel - - - Failed to write transaction index - Tehingu indeksi kirjutamine ebaõnnestus - - - Failed to write undo data - Tagasivõtmise andmete kirjutamine ebaõnnestus - - - How many blocks to check at startup (default: 288, 0 = all) - Käivitamisel kontrollitavate blokkide arv (vaikeväärtus: 288, 0=kõik) - Rebuild block chain index from current blk000??.dat files Taasta bloki jada indeks blk000??.dat failist - - Set the number of threads to service RPC calls (default: 4) - Määra RPC kõnede haldurite arv (vaikeväärtus: 4) - Verifying blocks... Kontrollin blokke... @@ -1729,50 +1633,14 @@ nt: alertnotify=echo %%s | email -s "Bitcoin Alert" admin@foo.com Information Informatsioon - - Maintain a full transaction index (default: 0) - Säilita kogu tehingu indeks (vaikeväärtus: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Maksimaalne saamise puhver -connection kohta , <n>*1000 baiti (vaikeväärtus: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Maksimaalne saatmise puhver -connection kohta , <n>*1000 baiti (vaikeväärtus: 1000) - - - Only accept block chain matching built-in checkpoints (default: 1) - Tunnusta ainult sisseehitatud turvapunktidele vastavaid bloki jadu (vaikeväärtus: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Ühenda ainult node'idega <net> võrgus (IPv4, IPv6 või Tor) - Send trace/debug info to console instead of debug.log file Saada jälitus/debug, debug.log faili asemel, konsooli - - Set minimum block size in bytes (default: 0) - Sea minimaalne bloki suurus baitides (vaikeväärtus: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Kahanda programmi käivitamisel debug.log faili (vaikeväärtus: 1, kui ei ole -debug) - - Specify connection timeout in milliseconds (default: 5000) - Sea ühenduse timeout millisekundites (vaikeväärtus: 5000) - - - System error: - Süsteemi tõrge: - - - Use UPnP to map the listening port (default: 0) - Kasuta kuulatava pordi määramiseks UPnP ühendust (vaikeväärtus: 0) - Use UPnP to map the listening port (default: 1 when listening) Kasuta kuulatava pordi määramiseks UPnP ühendust (vaikeväärtus: 1, kui kuulatakse) @@ -1805,10 +1673,6 @@ nt: alertnotify=echo %%s | email -s "Bitcoin Alert" admin@foo.com Upgrade wallet to latest format Uuenda rahakott uusimasse vormingusse - - Set key pool size to <n> (default: 100) - Sea võtmete hulgaks <n> (vaikeväärtus: 100) - Rescan the block chain for missing wallet transactions Otsi ploki jadast rahakoti kadunud tehinguid @@ -1817,14 +1681,6 @@ nt: alertnotify=echo %%s | email -s "Bitcoin Alert" admin@foo.com Use OpenSSL (https) for JSON-RPC connections Kasuta JSON-RPC ühenduste jaoks OpenSSL'i (https) - - Server certificate file (default: server.cert) - Serveri sertifikaadifail (vaikeväärtus: server.cert) - - - Server private key (default: server.pem) - Serveri privaatvõti (vaikeväärtus: server.pem) - This help message Käesolev abitekst diff --git a/src/qt/locale/bitcoin_eu_ES.ts b/src/qt/locale/bitcoin_eu_ES.ts index f8f03c3d29..9a570890a1 100644 --- a/src/qt/locale/bitcoin_eu_ES.ts +++ b/src/qt/locale/bitcoin_eu_ES.ts @@ -174,10 +174,6 @@ Tabs toolbar Fitxen tresna-barra - - [testnet] - [testnet] - Up to date Egunean @@ -305,10 +301,6 @@ Form Inprimakia - - <b>Recent transactions</b> - <b>Azken transakzioak</b> - PaymentServer @@ -694,14 +686,6 @@ Options: Aukerak - - Specify configuration file (default: bitcoin.conf) - Ezarpen fitxategia aukeratu (berezkoa: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - pid fitxategia aukeratu (berezkoa: bitcoind.pid) - This help message Laguntza mezu hau diff --git a/src/qt/locale/bitcoin_fa.ts b/src/qt/locale/bitcoin_fa.ts index d806fa47ef..c33bbdf6b4 100644 --- a/src/qt/locale/bitcoin_fa.ts +++ b/src/qt/locale/bitcoin_fa.ts @@ -9,6 +9,10 @@ Create a new address ایجاد نشانی جدید + + &New + &جدید + Copy the currently selected address to the system clipboard کپی نشانی انتخاب شده به حافظهٔ سیستم @@ -61,6 +65,10 @@ Comma separated file (*.csv) پروندهٔ نوع CSV جداشونده با کاما (*.csv) + + Exporting Failed + استخراج انجام نشد + AddressTableModel @@ -326,10 +334,6 @@ Tabs toolbar نوارابزار برگه‌ها - - [testnet] - [شبکهٔ آزمایش] - Bitcoin Core هسته Bitcoin @@ -342,10 +346,6 @@ No block source available... منبعی برای دریافت بلاک در دسترس نیست... - - Processed %1 blocks of transaction history. - %1 بلاک از تاریخچهٔ تراکنش‌ها پردازش شده است. - %n hour(s) %n ساعت @@ -612,15 +612,7 @@ Address: %4 Error خطا - - GB of free space available - گیگابات فضا موجود است - - - (of %1GB needed) - (از %1 گیگابایت فضای مورد نیاز) - - + OpenURIDialog @@ -761,10 +753,6 @@ Address: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. اطلاعات نمایش‌داده شده ممکن است قدیمی باشند. بعد از این که یک اتصال با شبکه برقرار شد، کیف پول شما به‌صورت خودکار با شبکهٔ بیت‌کوین همگام‌سازی می‌شود. اما این روند هنوز کامل نشده است. - - Wallet - کیف پول - Available: در دسترس: @@ -793,10 +781,6 @@ Address: %4 Your current total balance تراز کل فعلی شما - - <b>Recent transactions</b> - <b>تراکنش‌های اخیر</b> - out of sync ناهمگام @@ -924,6 +908,10 @@ Address: %4 Type <b>help</b> for an overview of available commands. برای نمایش یک مرور کلی از دستورات ممکن، عبارت <b>help</b> را بنویسید. + + Unknown + ناشناخته + ReceiveCoinsDialog @@ -1543,6 +1531,10 @@ Address: %4 Show transaction details نمایش جزئیات تراکنش + + Exporting Failed + استخراج انجام نشد + Comma separated file (*.csv) پروندهٔ نوع CSV جداشونده با کاما (*.csv) @@ -1626,26 +1618,10 @@ Address: %4 Options: گزینه‌ها: - - Specify configuration file (default: bitcoin.conf) - مشخص کردن فایل پیکربندی (پیش‌فرض: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - مشخص کردن فایل شناسهٔ پردازش - pid - (پیش‌فرض: bitcoin.pid) - Specify data directory مشخص کردن دایرکتوری داده‌ها - - Listen for connections on <port> (default: 8333 or testnet: 18333) - پذیرش اتصالات روی پورت <port> (پیش‌فرض: 8833 یا شبکهٔ آزمایشی: 18333) - - - Maintain at most <n> connections to peers (default: 125) - حداکثر <n> اتصال با همتایان برقرار شود (پیش‌فرض: ۱۲۵) - Connect to a node to retrieve peer addresses, and disconnect اتصال به یک گره برای دریافت آدرس‌های همتا و قطع اتصال پس از اتمام عملیات @@ -1654,18 +1630,6 @@ Address: %4 Specify your own public address آدرس عمومی خود را مشخص کنید - - Threshold for disconnecting misbehaving peers (default: 100) - حد آستانه برای قطع ارتباط با همتایان بدرفتار (پیش‌فرض: ۱۰۰) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - مدت زمان جلوگیری از اتصال مجدد همتایان بدرفتار، به ثانیه (پیش‌فرض: ۸۴۶۰۰) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - پورت مورد شنود برای اتصالات JSON-RPC (پیش‌فرض: 8332 برای شبکهٔ تست 18332) - Accept command line and JSON-RPC commands پذیرش دستورات خط فرمان و دستورات JSON-RPC @@ -1738,58 +1702,10 @@ Address: %4 Error opening block database خطا در بازگشایی پایگاه داده ی بلوک - - Error: system error: - خطا: خطای سامانه: - Failed to listen on any port. Use -listen=0 if you want this. شنیدن هر گونه درگاه انجام پذیر نیست. ازlisten=0 برای اینکار استفاده کیند. - - Failed to read block info - خواندن اطلاعات بلوک با شکست مواجه شد - - - Failed to read block - خواندن بلوک با شکست مواجه شد - - - Failed to sync block index - همگام سازی فهرست بلوک با شکست مواجه شد - - - Failed to write block index - نوشتن فهرست بلوک با شکست مواجه شد - - - Failed to write block info - نوشتن اطلاعات بلوک با شکست مواجه شد - - - Failed to write block - نوشتن بلوک با شکست مواجه شد - - - Failed to write file info - نوشتن اطلاعات پرونده با شکست مواجه شد - - - Failed to write to coin database - نوشتن اطلاعات در پایگاه داده ی سکه ها با شکست مواجه شد - - - Failed to write transaction index - نوشتن فهرست تراکنش ها با شکست مواجه شد - - - Failed to write undo data - عملیات بازگشت دادن اطلاعات با شکست مواجه شدن - - - How many blocks to check at startup (default: 288, 0 = all) - چند بلوک نیاز است که در ابتدای راه اندازی بررسی شوند(پیش فرض:288 ،0=همه) - Verifying blocks... در حال بازبینی بلوک ها... @@ -1802,42 +1718,14 @@ Address: %4 Information اطلاعات - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - حداکثر بافر دریافت شده بر اساس اتصال <n>* 1000 بایت (پیش فرض:5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - حداکثر بافر دریافت شده بر اساس اتصال <n>* 1000 بایت (پیش فرض:1000) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - تنها =به گره ها در شبکه متصا شوید <net> (IPv4, IPv6 or Tor) - Send trace/debug info to console instead of debug.log file اطلاعات ردگیری/اشکال‌زدایی را به جای فایل لاگ اشکال‌زدایی به کنسول بفرستید - - Set minimum block size in bytes (default: 0) - حداقل سایز بلاک بر اساس بایت تنظیم شود (پیش فرض: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) فایل debug.log را در startup مشتری کوچک کن (پیش فرض:1 اگر اشکال زدایی روی نداد) - - Specify connection timeout in milliseconds (default: 5000) - (میلی ثانیه )فاصله ارتباط خاص - - - System error: - خطای سامانه - - - Use UPnP to map the listening port (default: 0) - از UPnP برای شناسایی درگاه شنیداری استفاده کنید (پیش فرض:0) - Use UPnP to map the listening port (default: 1 when listening) از UPnP برای شناسایی درگاه شنیداری استفاده کنید (پیش فرض:1 در زمان شنیدن) @@ -1866,10 +1754,6 @@ Address: %4 Upgrade wallet to latest format wallet را به جدیدترین فرمت روزآمد کنید - - Set key pool size to <n> (default: 100) - (100پیش فرض:)&lt;n&gt; گذاشتن اندازه کلید روی - Rescan the block chain for missing wallet transactions اسکان مجدد زنجیر بلوکها برای گم والت معامله @@ -1878,14 +1762,6 @@ Address: %4 Use OpenSSL (https) for JSON-RPC connections JSON-RPCبرای ارتباطات استفاده کنید OpenSSL (https) - - Server certificate file (default: server.cert) - (server.certپیش فرض: )گواهی نامه سرور - - - Server private key (default: server.pem) - (server.pemپیش فرض: ) کلید خصوصی سرور - This help message پیام کمکی diff --git a/src/qt/locale/bitcoin_fa_IR.ts b/src/qt/locale/bitcoin_fa_IR.ts index 92e0722767..5ff33fee1a 100644 --- a/src/qt/locale/bitcoin_fa_IR.ts +++ b/src/qt/locale/bitcoin_fa_IR.ts @@ -234,10 +234,6 @@ Tabs toolbar نوار ابزار - - [testnet] - [testnet] - Error خطا @@ -419,14 +415,6 @@ Address: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. اطلاعات نمایش داده شده ممکن است روزآمد نباشد. wallet شما به صورت خودکار بعد از برقراری اتصال با شبکه bitcoin به روز می شود اما این فرایند هنوز تکمیل نشده است. - - Wallet - کیف پول - - - <b>Recent transactions</b> - تراکنشهای اخیر - out of sync خارج از روزآمد سازی @@ -937,38 +925,10 @@ Address: %4 Options: انتخابها: - - Specify configuration file (default: bitcoin.conf) - فایل پیکربندیِ را مشخص کنید (پیش فرض: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - فایل pid را مشخص کنید (پیش فرض: bitcoind.pid) - Specify data directory دایرکتوری داده را مشخص کن - - Listen for connections on <port> (default: 8333 or testnet: 18333) - ارتباطات را در <PORT> بشنوید (پیش فرض: 8333 or testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - نگهداری <N> ارتباطات برای قرینه سازی (پیش فرض:125) - - - Threshold for disconnecting misbehaving peers (default: 100) - آستانه قطع برای قرینه سازی اشتباه (پیش فرض:100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - تعداد ثانیه ها برای اتصال دوباره قرینه های اشتباه (پیش فرض:86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - ارتباطاتِ JSON-RPC را در <port> گوش کنید (پیش فرض:8332) - Accept command line and JSON-RPC commands command line و JSON-RPC commands را قبول کنید @@ -985,10 +945,6 @@ Address: %4 Send trace/debug info to console instead of debug.log file ارسال اطلاعات پیگیری/خطایابی به کنسول به جای ارسال به فایل debug.log - - Specify connection timeout in milliseconds (default: 5000) - تعیین مدت زمان وقفه (time out) به هزارم ثانیه - Username for JSON-RPC connections شناسه کاربری برای ارتباطاتِ JSON-RPC @@ -1005,10 +961,6 @@ Address: %4 Upgrade wallet to latest format wallet را به جدیدترین نسخه روزآمد کنید - - Set key pool size to <n> (default: 100) - حجم key pool را به اندازه <n> تنظیم کنید (پیش فرض:100) - Rescan the block chain for missing wallet transactions زنجیره بلاک را برای تراکنش جا افتاده در WALLET دوباره اسکن کنید @@ -1017,14 +969,6 @@ Address: %4 Use OpenSSL (https) for JSON-RPC connections برای ارتباطاتِ JSON-RPC از OpenSSL (https) استفاده کنید - - Server certificate file (default: server.cert) - فایل certificate سرور (پیش فرض server.cert) - - - Server private key (default: server.pem) - رمز اختصاصی سرور (پیش فرض: server.pem) - This help message این پیام راهنما diff --git a/src/qt/locale/bitcoin_fi.ts b/src/qt/locale/bitcoin_fi.ts index 3541c58fcf..76ec6d4bf5 100644 --- a/src/qt/locale/bitcoin_fi.ts +++ b/src/qt/locale/bitcoin_fi.ts @@ -390,10 +390,6 @@ Tabs toolbar Välilehtipalkki - - [testnet] - [testnet] - Bitcoin Core Bitcoin-ydin @@ -434,10 +430,6 @@ No block source available... Lohkojen lähdettä ei saatavilla... - - Processed %1 blocks of transaction history. - Käsitelty %1 lohkoa rahansiirtohistoriasta - %n hour(s) %n tunti%n tuntia @@ -915,15 +907,7 @@ Osoite: %4 Error Virhe - - GB of free space available - GB vapaata tilaa - - - (of %1GB needed) - (tarvitaan %1GB) - - + OpenURIDialog @@ -1164,10 +1148,6 @@ Osoite: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Näytetyt tiedot eivät välttämättä ole ajantasalla. Lompakkosi synkronoituu Bitcoin-verkon kanssa automaattisesti yhteyden muodostamisen jälkeen, mutta synkronointi on vielä meneillään. - - Wallet - Lompakko - Watch-only: Seuranta: @@ -1209,8 +1189,8 @@ Osoite: %4 Nykyinen tase seurantaosoitetteissa - <b>Recent transactions</b> - <b>Viimeisimmät rahansiirrot</b> + Current total balance in watch-only addresses + Nykyinen tase seurantaosoitetteissa out of sync @@ -1227,6 +1207,14 @@ Osoite: %4 Invalid payment address %1 Virheellinen maksuosoite %1 + + Payment request rejected + Maksupyyntö hylätty + + + Payment request has expired. + Maksupyyntö on vanhentunut. + Requested payment amount of %1 is too small (considered dust). Maksupyyntö %1 on liian pieni (huomioidaan tomuna). @@ -1243,6 +1231,10 @@ Osoite: %4 Payment request fetch URL is invalid: %1 Maksupyynnön haku URL on virheellinen: %1 + + URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + URIa ei voitu jäsentää! Tämä voi johtua kelvottomasta Bitcoin-osoitteesta tai virheellisistä URI parametreista. + Payment request file handling Maksupyynnön tiedoston käsittely @@ -1274,6 +1266,10 @@ Osoite: %4 PeerTableModel + + User Agent + Käyttöliittymä + QObject @@ -1281,6 +1277,10 @@ Osoite: %4 Amount Määrä + + %1 d + %1 d + %1 h %1 h @@ -1289,11 +1289,19 @@ Osoite: %4 %1 m %1 m + + %1 s + %1 s + N/A Ei saatavilla - + + %1 ms + %1 ms + + QRImageWidget @@ -1367,6 +1375,22 @@ Osoite: %4 Current number of blocks Nykyinen Lohkojen määrä + + Received + Vastaanotetut + + + Sent + Lähetetyt + + + Version + Versio + + + User Agent + Käyttöliittymä + Last block time Viimeisimmän lohkon aika @@ -1443,6 +1467,10 @@ Osoite: %4 %1 GB %1 GB + + Unknown + Tuntematon + ReceiveCoinsDialog @@ -2481,26 +2509,10 @@ Osoite: %4 Options: Asetukset: - - Specify configuration file (default: bitcoin.conf) - Määritä asetustiedosto (oletus: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Määritä pid-tiedosto (oletus: bitcoin.pid) - Specify data directory Määritä data-hakemisto - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Kuuntele yhteyksiä portista <port> (oletus: 8333 tai testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Pidä enintään <n> yhteyttä verkkoihin (oletus: 125) - Connect to a node to retrieve peer addresses, and disconnect Yhdistä noodiin hakeaksesi naapurien osoitteet ja katkaise yhteys @@ -2509,18 +2521,6 @@ Osoite: %4 Specify your own public address Määritä julkinen osoitteesi - - Threshold for disconnecting misbehaving peers (default: 100) - Kynnysarvo aikakatkaisulle heikosti toimiville verkoille (oletus: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Sekuntien määrä, kuinka kauan uudelleenkytkeydytään verkkoihin (oletus: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Kuuntele JSON-RPC -yhteyksiä portista <port> (oletus: 8332 or testnet: 18332) - Accept command line and JSON-RPC commands Hyväksy merkkipohjaiset- ja JSON-RPC-käskyt @@ -2561,18 +2561,10 @@ Suositellaan asettaa alertnotify jotta saat tietoa ongelmista; esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Hyväksytyt koodit (oletus: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Kytkeydy annettuun osoitteeseen ja pidä linja aina auki. Käytä [host]:portin merkintätapaa IPv6:lle. - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - Yhtäaikaisesti rajaa vapaat rahansiirrot <n>*1000 tavua per minuutti (oletus: 15) - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Aloita regression testimoodi joka käyttää erikoisketjua jossa lohkoja voidaan ratkaista välittömästi. @@ -2589,14 +2581,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Suorita käsky kun lompakossa rahansiirto muuttuu (%s cmd on vaihdettu TxID kanssa) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - Aja tietokannan toimet muistivarannosta kovalevylogiin joka <n> megatavu (oletus: 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - Kuinka vaativa lohkonvarmistus -checkblocks on (0-4, oletus: 3) - In this mode -genproclimit controls how many blocks are generated immediately. Tässä moodissa -genproclimit ohjaa kuinka monta lohkoa luodaan välittömästi. @@ -2605,10 +2589,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Aseta script varmistuksen threadien lukumäärä (%u - %d, 0= auto, <0 = jätä näin monta ydintä vapaaksi, oletus: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - Aseta prosessorin raja kun luonti on päällä (-1 = rajoittamaton, oletus: -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Tämä on esi-julkaistu testiversio - Käytä omalla riskillä - Ei saa käytää louhimiseen tai kauppasovelluksiin. @@ -2617,10 +2597,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Unable to bind to %s on this computer. Bitcoin Core is probably already running. Ei voida yhdistää %s tässä tietokoneessa. Bitcoin Core on luultavasti jo käynnissä. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Käytä erillistä SOCKS5 proxya tavoittaaksesi vertaiset Tor palvelun kautta (oletus: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Varoitus: -paytxfee on asetettu erittäin korkeaksi! Tämä on maksukulu jonka tulet maksamaan kun lähetät siirron. @@ -2645,10 +2621,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com (default: 1) (oletus: 1) - - (default: wallet.dat) - (oletus: wallet.dat) - <category> can be: <category> voi olla: @@ -2677,10 +2649,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Debugging/Testing options: Debuggaus/Testauksen valinnat: - - Disable safemode, override a real safe mode event (default: 0) - Poista safemode, ohita oikea turvallinen mooditapahtuma (oletus: 0) - Discover own IP address (default: 1 when listening and no -externalip) Hae oma IP osoite (vakioasetus: 1 kun kuuntelemassa ja ei -externalip) @@ -2717,66 +2685,10 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Wallet locked, unable to create transaction! Virhe: Lompakko on lukittu, rahansiirtoa ei voida luoda - - Error: system error: - Virhe: Järjestelmävirhe - Failed to listen on any port. Use -listen=0 if you want this. Ei onnistuttu kuuntelemaan missään portissa. Käytä -listen=0 jos haluat tätä. - - Failed to read block info - Lohkotietojen luku epäonnistui - - - Failed to read block - Lohkon luku epäonnistui - - - Failed to sync block index - Lohkoindeksin synkronointi epäonnistui - - - Failed to write block index - Lohkoindeksin kirjoitus epäonnistui - - - Failed to write block info - Lohkotiedon kirjoitus epäonnistui - - - Failed to write block - Lohkon kirjoitus epäonnistui - - - Failed to write file info - Tiedoston tietojen kirjoitus epäonnistui - - - Failed to write to coin database - Kolikkotietokannan kirjoitus epäonnistui - - - Failed to write transaction index - Rahasiirtojen indeksin kirjoitus epäonnistui - - - Failed to write undo data - Palautustiedon kirjoitus epäonnistui - - - Force safe mode (default: 0) - Pakota safe moodi (oletus: 0) - - - Generate coins (default: 0) - Generoi kolikoita (vakio: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Kuinka monta lohkoa tarkistetaan käynnistettäessä (oletus: 288, 0 = kaikki) - If <category> is not supplied, output all debugging information. Jos <kategoria> ei annettu, tulosta kaikki debuggaustieto. @@ -2797,10 +2709,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Not enough file descriptors available. Ei tarpeeksi tiedostomerkintöjä vapaana. - - Prepend debug output with timestamp (default: 1) - Lisää aikamerkki debug tulosteen eteen (oletus: 1) - Rebuild block chain index from current blk000??.dat files Uudelleenrakenna lohkoketjuindeksi nykyisistä blk000??.dat tiedostoista @@ -2813,18 +2721,10 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set maximum block size in bytes (default: %d) Aseta lohkon maksimikoko tavuissa (oletus: %d) - - Set the number of threads to service RPC calls (default: 4) - Aseta threadien lukumäärä RPC kutsuille (oletus: 4) - Specify wallet file (within data directory) Aseta lompakkotiedosto (data-hakemiston sisällä) - - Spend unconfirmed change when sending transactions (default: 1) - Käytä varmistamattomia vaihtorahoja lähetettäessä rahansiirtoja (oletus: 1) - This is intended for regression testing tools and app development. Tämä on tarkoitettu regression testityökaluille ja ohjelman kehittämiseen. @@ -2861,14 +2761,22 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Aja komento kun olennainen hälytys vastaanotetaan tai nähdään todella pitkä haara (%s komennossa korvataan viestillä) - - Output debugging information (default: 0, supplying <category> is optional) - Tulosta debuggaustieto (oletus: 0, annettu <kategoria> valinnainen) - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Aseta maksimikoko korkea prioriteetti/pieni palkkio rahansiirtoihin tavuissa (oletus: %d) + + Connect through SOCKS5 proxy + Yhdistä SOCKS5 proxin kautta + + + Copyright (C) 2009-%i The Bitcoin Core Developers + Copyright (C) 2009-%i Bitcoin kehittäjät + + + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core + Virhe ladattaessa wallet.dat-tiedostoa: Tarvitset uudemman version Bitcoinista + Information Tietoa @@ -2881,42 +2789,10 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Invalid amount for -mintxfee=<amount>: '%s' Virheellinen määrä -mintxfee=<amount>: '%s' - - Limit size of signature cache to <n> entries (default: 50000) - Rajaa allekirjoituksen välimuistin koko <n> alkioon (oletus: 50000) - - - Log transaction priority and fee per kB when mining blocks (default: 0) - Kirjaa rahansiirron prioriteetti ja palkkio per kB kun louhitaan lohkoja (oletus: 0) - - - Maintain a full transaction index (default: 0) - Ylläpidä täydellistä rahasiirtojen indeksiä (oletus: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Suurin vastaanottopuskuri yksittäiselle yhteydelle, <n>*1000 tavua (vakioasetus: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Suurin lähetyspuskuri yksittäiselle yhteydelle, <n>*1000 tavua (vakioasetus: 1000) - - - Only accept block chain matching built-in checkpoints (default: 1) - Hyväksy vain lohkoketjua vastaavat sisäänrakennetut varmistuspisteet (Oletus: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Yhdistä vain noodeihin verkossa <net> (IPv4, IPv6 tai Tor) - Print block on startup, if found in block index Tulosta lohko käynnistyksessä jos löydetään lohkoindeksistä - - Print block tree on startup (default: 0) - Tulosta lohkopuu käynnistyksessä (oletus: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) RPC SSL valinnat: (katso Bitcoin Wikistä SSL-asennuksen ohjeet) @@ -2933,22 +2809,10 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Randomly fuzz 1 of every <n> network messages Satunnaisesti sekoita 1 joka <n> verkkoviestistä - - Run a thread to flush wallet periodically (default: 1) - Aja threadi jossa tallennetaan lompakko ajoittain (oletus: 1) - Send trace/debug info to console instead of debug.log file Lähetä jäljitys/debug-tieto konsoliin, debug.log-tiedoston sijaan - - Set minimum block size in bytes (default: 0) - Asetan pienin lohkon koko tavuissa (vakioasetus: 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - Asettaa DB_PRIVATE lipun lompakon tietokantaympäristössä (oletus: 1) - Show all debugging options (usage: --help -help-debug) Näytä kaikki debuggaus valinnat: (käyttö: --help -help-debug) @@ -2961,14 +2825,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Signing transaction failed Siirron vahvistus epäonnistui - - Specify connection timeout in milliseconds (default: 5000) - Määritä yhteyden aikakataisu millisekunneissa (vakioasetus: 5000) - - - System error: - Järjestelmävirhe: - Transaction amount too small Siirtosumma liian pieni @@ -2981,10 +2837,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Transaction too large Siirtosumma liian iso - - Use UPnP to map the listening port (default: 0) - Käytä UPnP:tä kuunneltavan portin avaamiseen (vakioasetus: 0) - Use UPnP to map the listening port (default: 1 when listening) Käytä UPnP:tä kuunneltavan portin avaamiseen (vakioasetus: 1 kun kuuntelemassa) @@ -2993,6 +2845,10 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Username for JSON-RPC connections Käyttäjätunnus JSON-RPC-yhteyksille + + Wallet needed to be rewritten: restart Bitcoin Core to complete + Lompakko tarvitsee uudelleenkirjoittaa: käynnistä Bitcoin uudelleen + Warning Varoitus @@ -3025,10 +2881,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Upgrade wallet to latest format Päivitä lompakko uusimpaan formaattiin - - Set key pool size to <n> (default: 100) - Aseta avainpoolin koko arvoon <n> (oletus: 100) - Rescan the block chain for missing wallet transactions Skannaa uudelleen lohkoketju lompakon puuttuvien rahasiirtojen vuoksi @@ -3037,14 +2889,6 @@ esimerkiksi: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Use OpenSSL (https) for JSON-RPC connections Käytä OpenSSL:ää (https) JSON-RPC-yhteyksille - - Server certificate file (default: server.cert) - Palvelimen sertifikaatti-tiedosto (oletus: server.cert) - - - Server private key (default: server.pem) - Palvelimen yksityisavain (oletus: server.pem) - This help message Tämä ohjeviesti diff --git a/src/qt/locale/bitcoin_fr.ts b/src/qt/locale/bitcoin_fr.ts index dfd7081593..86c23b6c3e 100644 --- a/src/qt/locale/bitcoin_fr.ts +++ b/src/qt/locale/bitcoin_fr.ts @@ -390,10 +390,6 @@ Tabs toolbar Barre d'outils des onglets - - [testnet] - [testnet] - Bitcoin Core Bitcoin Core @@ -434,10 +430,6 @@ No block source available... Aucune source de blocs disponible... - - Processed %1 blocks of transaction history. - À traité %1 blocs de l'historique des transactions. - %n hour(s) %n heure%n heures @@ -912,15 +904,7 @@ Adresse : %4 Error Erreur - - GB of free space available - Go d'espace libre disponible - - - (of %1GB needed) - (sur %1Go nécessaires) - - + OpenURIDialog @@ -1161,10 +1145,6 @@ Adresse : %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Les informations affichées peuvent être obsolètes. Votre portefeuille est automatiquement synchronisé avec le réseau Bitcoin lorsque la connexion s'établit, or ce processus n'est pas encore terminé. - - Wallet - Portefeuille - Watch-only: Juste-regarder : @@ -1193,6 +1173,10 @@ Adresse : %4 Mined balance that has not yet matured Le solde généré n'est pas encore mûr + + Balances + Soldes + Total: Total : @@ -1205,6 +1189,14 @@ Adresse : %4 Your current balance in watch-only addresses Votre balance actuelle en adresses juste-regarder + + Spendable: + Disponible: + + + Recent transactions + Transactions récentes + Unconfirmed transactions to watch-only addresses Transactions non confirmées vers des adresses juste-regarder @@ -1217,10 +1209,6 @@ Adresse : %4 Current total balance in watch-only addresses Solde total actuel dans des adresses juste-regarder - - <b>Recent transactions</b> - <b>Transactions récentes</b> - out of sync désynchronisé @@ -1480,10 +1468,6 @@ Adresse : %4 Services Services - - Sync Node - Nœud de synchro - Starting Height Hauteur de démarrage @@ -1612,14 +1596,6 @@ Adresse : %4 Outbound Sortant - - Yes - Oui - - - No - Non - Unknown Inconnu @@ -2468,6 +2444,10 @@ Adresse : %4 Mined Miné + + watch-only + juste-regarder + (n/a) (n.d) @@ -2484,6 +2464,10 @@ Adresse : %4 Type of transaction. Type de transaction. + + Whether or not a watch-only address is involved in this transaction. + Détermine si une adresse de type watch-only est impliquée dans cette transaction. + Destination address of transaction. L’adresse de destination de la transaction. @@ -2694,26 +2678,10 @@ Adresse : %4 Options: Options : - - Specify configuration file (default: bitcoin.conf) - Spécifier le fichier de configuration (par défaut : bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Spécifier le fichier PID (par défaut : bitcoind.pid) - Specify data directory Spécifier le répertoire de données - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Écouter les connexions sur le <port> (par défaut : 8333 ou testnet : 18333) - - - Maintain at most <n> connections to peers (default: 125) - Garder au plus <n> connexions avec les pairs (par défaut : 125) - Connect to a node to retrieve peer addresses, and disconnect Se connecter à un nœud pour obtenir des adresses de pairs puis se déconnecter @@ -2722,18 +2690,6 @@ Adresse : %4 Specify your own public address Spécifier votre propre adresse publique - - Threshold for disconnecting misbehaving peers (default: 100) - Seuil de déconnexion des pairs de mauvaise qualité (par défaut : 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Délai en secondes de refus de reconnexion aux pairs de mauvaise qualité (par défaut : 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Écouter les connexions JSON-RPC sur le <port> (par défaut : 8332 ou tesnet : 18332) - Accept command line and JSON-RPC commands Accepter les commandes de JSON-RPC et de la ligne de commande @@ -2774,18 +2730,10 @@ Il est aussi conseillé de régler alertnotify pour être prévenu des problème par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Chiffrements acceptables (par défaut : TLSv1.2+HIGH : TLSv1+HIGH : !SSLv2 : !aNULL : !eNULL : !3DES : @STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Se lier à l'adresse donnée et toujours l'écouter. Utilisez la notation [host]:port pour l'IPv6 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - Limiter continuellement les transactions gratuites à <n>*1000 octets par minute (par défaut : 15) - Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup Supprimer toutes les transactions du portefeuille et ne récupérer que ces parties de la chaîne de bloc avec -rescan au démarrage @@ -2806,14 +2754,6 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Exécuter la commande lorsqu'une transaction de portefeuille change (%s dans la commande est remplacée par TxID) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - Purger l’activité de la base de données de la mémoire vers le journal sur disque tous les <n> mégaoctets (par défaut : 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - À quel point la vérification des blocs -checkblocks est approfondie (0-4, par défaut : 3) - In this mode -genproclimit controls how many blocks are generated immediately. Dans ce mode -genproclimit contrôle combien de blocs sont générés immédiatement. @@ -2822,10 +2762,6 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Définir le nombre d'exétrons de vérification des scripts (%u à %d, 0 = auto, < 0 = laisser ce nombre de cœurs inutilisés, par défaut : %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - Définir la limite processeur définissant quand la génération est en fonction (-1 = illimité, par défaut : -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Ceci est une pré-version de test - l'utiliser à vos risques et périls - ne pas l'utiliser pour miner ou pour des applications marchandes @@ -2834,10 +2770,6 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Unable to bind to %s on this computer. Bitcoin Core is probably already running. Impossible de se lier à %s sur cet ordinateur. Bitcoin Core fonctionne probablement déjà. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Utiliser un serveur mandataire SOCKS5 séparé pour atteindre les pairs par les services cachés de Tor (par défaut : -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Avertissement : -paytxfee est réglé sur un montant très élevé ! Il s'agit des frais de transaction que vous payerez si vous envoyez une transaction. @@ -2862,10 +2794,6 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com (default: 1) (par défaut : 1) - - (default: wallet.dat) - (par défaut : wallet.dat) - <category> can be: <category> peut être : @@ -2894,10 +2822,6 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Debugging/Testing options: Options de test/de débogage : - - Disable safemode, override a real safe mode event (default: 0) - Désactiver le mode sans échec, passer outre un événement sans échec réel (par défaut : 0) - Discover own IP address (default: 1 when listening and no -externalip) Découvrir sa propre adresse IP (par défaut : 1 lors de l'écoute et si aucun -externalip) @@ -2926,6 +2850,10 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Error opening block database Erreur lors de l'ouverture de la base de données des blocs + + Error: A fatal internal error occured, see debug.log for details + Erreur: Une erreur fatale s'est produite, voir debug.log pour plus de détails + Error: Disk space is low! Erreur : l'espace disque est faible ! @@ -2934,66 +2862,10 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Error: Wallet locked, unable to create transaction! Erreur : Portefeuille verrouillé, impossible de créer la transaction ! - - Error: system error: - Erreur : erreur système : - Failed to listen on any port. Use -listen=0 if you want this. Échec de l'écoute sur un port quelconque. Utilisez -listen=0 si vous voulez ceci. - - Failed to read block info - La lecture des informations de bloc a échoué - - - Failed to read block - La lecture du bloc a échoué - - - Failed to sync block index - La synchronisation de l'index des blocs a échoué - - - Failed to write block index - L''écriture de l'index des blocs a échoué - - - Failed to write block info - L'écriture des informations du bloc a échoué - - - Failed to write block - L'écriture du bloc a échoué - - - Failed to write file info - L'écriture des informations de fichier a échoué - - - Failed to write to coin database - L'écriture dans la base de données des pièces a échoué - - - Failed to write transaction index - L'écriture de l'index des transactions a échoué - - - Failed to write undo data - L'écriture des données d'annulation a échoué - - - Force safe mode (default: 0) - Forcer le mode sans échec (par défaut : 0) - - - Generate coins (default: 0) - Générer des pièces (défaut : 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Nombre de blocs à vérifier au démarrage (par défaut : 288, 0 = tout) - If <category> is not supplied, output all debugging information. Si <category> n'est pas indiqué, extraire toutes les données de débogage. @@ -3015,8 +2887,8 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Pas assez de descripteurs de fichiers de disponibles. - Prepend debug output with timestamp (default: 1) - Ajouter l'horodatage au début des résultats de débogage (par défaut : 1) + Only connect to nodes in network <net> (ipv4, ipv6 or onion) + Se connecter uniquement aux nœuds du réseau <net> (IPv4, IPv6 ou Tor) Rebuild block chain index from current blk000??.dat files @@ -3030,22 +2902,10 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Set maximum block size in bytes (default: %d) Définir la taille minimale de bloc en octets (par défaut : %d) - - Set the number of threads to service RPC calls (default: 4) - Définir le nombre d'exétrons pour desservir les appels RPC (par défaut : 4) - Specify wallet file (within data directory) Spécifiez le fichier de portefeuille (dans le répertoire de données) - - Spend unconfirmed change when sending transactions (default: 1) - Dépenser la monnaie non confirmée lors de l'envoi de transactions (par défaut : 1) - - - Stop running after importing blocks from disk (default: 0) - Arrêter l'exécution après l'importation des blocs du disque (par défaut : 0) - This is intended for regression testing tools and app development. Ceci est à l'intention des outils de test de régression et du développement applicatif. @@ -3074,10 +2934,6 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Imports blocks from external blk000??.dat file Importe des blocs depuis un fichier blk000??.dat externe - - (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) - (par défaut : 1, 1 = conserver les données de transmission c.-à-d. propriétaire du compte et information de demande de paiement, 2 = abandonner les données de transmission) - Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times Permettre les connexions JSON-RPC de sources spécifiques. Valide pour <ip> qui sont une IP simple (p. ex. 1.2.3.4), un réseau/masque réseau (p. ex. 1.2.3.4/255.255.255.0) ou un réseau/CIDR (p. ex. 1.2.3.4/24). Cette option peut être être spécifiée plusieurs fois @@ -3114,10 +2970,6 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. Erreur : l'argument non pris en charge -socks a été trouvé. Il n'est plus possible de définir la version de SOCKS, seuls les serveurs mandataires SOCKS5 sont pris en charge. - - Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) - Exécuter la commande quand une transmission réseau redépense l'entrée d'une transmission du portefeuille (%s=respend TxID, %t=wallet TxID) - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Exécuter une commande lorsqu'une alerte pertinente est reçue ou si nous voyons une bifurcation vraiment étendue (%s dans la commande est remplacé par le message) @@ -3130,14 +2982,6 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) Les frais (en BTC/Ko) inférieurs à ce seuil sont considérés comme étant nuls pour la création de transactions (par défaut : %s) - - If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) - Si paytxfee n'est pas défini, inclure suffisamment de frais afin que les transactions soient confirmées avant n blocs (par défaut : 1) - - - Output debugging information (default: 0, supplying <category> is optional) - Informations du résultat de débogage (par défaut : 0, fournir <category> est optionnel) - Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) Demander les adresses des pairs par recherche DNS si l'on manque d'adresses (par défaut : 1 sauf si -connect) @@ -3154,18 +2998,10 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. Avertissement : veuillez vérifier que l'heure et la date de votre ordinateur sont correctes ! Si votre horloge n'est pas à l'heure, Bitcoin Core ne fonctionnera pas correctement. - - Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. - Pairs de la liste blanche se connectant à partir du masque réseau ou de l'IP donné. Peut être spécifié plusieurs fois. - Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway Les pairs de la liste blanche ne peuvent pas être bannis DoS et leurs transactions sont toujours relayées, même si elles sont déjà dans le mempool, utile p. ex. pour une passerelle - - Always query for peer addresses via DNS lookup (default: 0) - Toujours demander les adresses de pairs par recherche DNS (par défaut : 0) - Cannot resolve -whitebind address: '%s' Impossible de résoudre l'adresse -whitebind : « %s » @@ -3194,10 +3030,6 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Fee (in BTC/kB) to add to transactions you send (default: %s) Les frais (en BTC/ko) à ajouter aux transactions que vous envoyez (par défaut : %s) - - Include IP addresses in debug output (default: 0) - Inclure les adresses IP dans la sortie de débogage (par défaut : 0) - Information Informations @@ -3227,24 +3059,8 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Garder au plus <n> blocs non connectables en mémoire (par défaut : %u) - Limit size of signature cache to <n> entries (default: 50000) - Limiter la taille du cache des signatures à <n> entrées (par défaut : 50000) - - - Log transaction priority and fee per kB when mining blocks (default: 0) - Journaliser la priorité des transactions et les frais par ko lors du minage (par défaut : 0) - - - Maintain a full transaction index (default: 0) - Maintenir un index complet des transactions (par défaut : 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Tampon maximal de réception par « -connection » <n>*1 000 octets (par défaut : 5 000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Tampon maximal d'envoi par « -connection », <n>*1 000 octets (par défaut : 1 000) + Keep at most <n> unconnectable transactions in memory (default: %u) + Garder au plus <n> blocs non connectables en mémoire (par défaut : %u) Need to specify a port with -whitebind: '%s' @@ -3254,22 +3070,10 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Node relay options: Options de relais du nœud : - - Only accept block chain matching built-in checkpoints (default: 1) - N'accepter que la chaîne de blocs correspondant aux points de vérification internes (par défaut : 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Se connecter uniquement aux nœuds du réseau <net> (IPv4, IPv6 ou Tor) - Print block on startup, if found in block index Imprimer le bloc au démarrage s'il est trouvé dans l'index des blocs - - Print block tree on startup (default: 0) - Imprimer l'arborescence des blocs au démarrage (par défaut : 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) Options RPC SSL : (voir le wiki Bitcoin pour les instructions de configuration de SSL) @@ -3286,30 +3090,10 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Randomly fuzz 1 of every <n> network messages Tester aléatoirement 1 message du réseau sur <n> - - Relay and mine data carrier transactions (default: 1) - Relayer et miner les transactions du porteur de données (par défaut : 1) - - - Relay non-P2SH multisig (default: 1) - Relayer les multisig non-P2SH (par défaut : 1) - - - Run a thread to flush wallet periodically (default: 1) - Exécuter un exétron pour purger le portefeuille périodiquement (par défaut : 1) - Send trace/debug info to console instead of debug.log file Envoyer les informations de débogage/trace à la console au lieu du fichier debug.log - - Set minimum block size in bytes (default: 0) - Définir la taille minimale de bloc en octets (par défaut : 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - Définit le drapeau DB_PRIVATE dans l'environnement de la base de données du portefeuille (par défaut : 1) - Show all debugging options (usage: --help -help-debug) Montrer toutes les options de débogage (utilisation : --help --help-debug) @@ -3322,14 +3106,6 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Signing transaction failed La signature de la transaction a échoué - - Specify connection timeout in milliseconds (default: 5000) - Spécifier le délai d'expiration de la connexion en millisecondes (par défaut : 5 000) - - - System error: - Erreur système : - This is experimental software. Ceci est un logiciel expérimental. @@ -3350,10 +3126,6 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Unable to bind to %s on this computer (bind returned error %s) Impossible de se lier à %s sur cet ordinateur (bind a retourné l'erreur %s) - - Use UPnP to map the listening port (default: 0) - Utiliser l'UPnP pour rediriger le port d'écoute (par défaut : 0) - Use UPnP to map the listening port (default: 1 when listening) Utiliser l'UPnP pour rediriger le port d'écoute (par défaut : 1 lors de l'écoute) @@ -3406,10 +3178,6 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Upgrade wallet to latest format Mettre à niveau le portefeuille vers le format le plus récent - - Set key pool size to <n> (default: 100) - Régler la taille de la réserve de clefs sur <n> (par défaut : 100) - Rescan the block chain for missing wallet transactions Réanalyser la chaîne de blocs pour les transactions de portefeuille manquantes @@ -3418,14 +3186,6 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Use OpenSSL (https) for JSON-RPC connections Utiliser OpenSSL (https) pour les connexions JSON-RPC - - Server certificate file (default: server.cert) - Fichier de certificat serveur (par défaut : server.cert) - - - Server private key (default: server.pem) - Clef privée du serveur (par défaut : server.pem) - This help message Ce message d'aide diff --git a/src/qt/locale/bitcoin_gl.ts b/src/qt/locale/bitcoin_gl.ts index b047bb5a4b..8d9295e5c9 100644 --- a/src/qt/locale/bitcoin_gl.ts +++ b/src/qt/locale/bitcoin_gl.ts @@ -358,10 +358,6 @@ Tabs toolbar Barra de ferramentas - - [testnet] - [testnet] - Bitcoin Core Core de Bitcoin @@ -394,10 +390,6 @@ No block source available... Non hai orixe de bloques dispoñible... - - Processed %1 blocks of transaction history. - Procesados %1 bloques do historial de transacccións. - %n hour(s) %n hora%n horas @@ -792,15 +784,7 @@ Dirección: %4 Error Erro - - GB of free space available - GB de espacio libre dispoñible - - - (of %1GB needed) - (de %1 GB precisados) - - + OpenURIDialog @@ -953,10 +937,6 @@ Dirección: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. A información amosada por estar desactualizada. O teu moedeiro sincronízase automáticamente coa rede Bitcoin despois de que se estableza unha conexión, pero este proceso non está todavía rematado. - - Wallet - Moedeiro - Your current spendable balance O teu balance actualmente dispoñible @@ -981,10 +961,6 @@ Dirección: %4 Your current total balance O teu balance actual total - - <b>Recent transactions</b> - <b>Transaccións recentes</b> - out of sync non sincronizado @@ -2070,26 +2046,10 @@ Dirección: %4 Options: Opcións: - - Specify configuration file (default: bitcoin.conf) - Especificar arquivo de configuración (por defecto: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Especificar arquivo de pid (por defecto: bitcoind.pid) - Specify data directory Especificar directorio de datos - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Escoitar conexións no <porto> (por defecto: 8333 ou testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Manter como moito <n> conexións con pares (por defecto: 125) - Connect to a node to retrieve peer addresses, and disconnect Conectar a nodo para recuperar direccións de pares, e desconectar @@ -2098,18 +2058,6 @@ Dirección: %4 Specify your own public address Especificar a túa propia dirección pública - - Threshold for disconnecting misbehaving peers (default: 100) - Umbral para desconectar pares con mal comportamento (por defecto: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Número de segundos para manter sen reconectar aos pares con mal comportamento (por defecto: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Escoitar conexións JSON-RPC no <porto> (por defecto: 8332 ou testnet: 18332) - Accept command line and JSON-RPC commands Aceptar liña de comandos e comandos JSON-RPC @@ -2150,10 +2098,6 @@ Tamén é recomendable fixar alertnotify de modo que recibas notificación dos p por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Cifradores aceptables (por defecto: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Enlazar a unha dirección dada e escoitar sempre nela. Emprega a notación [host]:post para IPv6 @@ -2246,62 +2190,10 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Wallet locked, unable to create transaction! Erro: Moedeiro bloqueado, imposible crear transacción! - - Error: system error: - Erro: erro do sistema: - Failed to listen on any port. Use -listen=0 if you want this. Fallou escoitar en calquera porto. Emprega -listen=0 se queres esto. - - Failed to read block info - Fallou a lectura da información do bloque - - - Failed to read block - Fallou a lectura do bloque - - - Failed to sync block index - Fallou a sincronización do índice do bloque - - - Failed to write block index - Fallou a escritura do índice do bloque - - - Failed to write block info - Fallou a escritura da información do bloque - - - Failed to write block - Fallou a escritura do bloque - - - Failed to write file info - Fallou a escritura da información do arquivo - - - Failed to write to coin database - Fallou a escritura na base de datos de moedas - - - Failed to write transaction index - Fallou a escritura do índice de transaccións - - - Failed to write undo data - Fallou a escritura dos datos para desfacer - - - Generate coins (default: 0) - Xerar moedas (por defecto: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Cantos bloques para chequear ao arrancar (por defecto: 288, 0 = todos) - Incorrect or no genesis block found. Wrong datadir for network? Bloque genesis incorrecto o no existente. Datadir erróneo para a rede? @@ -2318,10 +2210,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Rebuild block chain index from current blk000??.dat files Reconstruír índice de cadea de bloque dende os ficheiros actuais blk000??.dat - - Set the number of threads to service RPC calls (default: 4) - Fixar o número de fíos para as chamadas aos servicios RPC (por defecto: 4) - Specify wallet file (within data directory) Especificar arquivo do moedeiro (dentro do directorio de datos) @@ -2362,34 +2250,10 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Invalid amount for -mintxfee=<amount>: '%s' Cantidade inválida para -mintxfee=<cantidade>: '%s' - - Maintain a full transaction index (default: 0) - Manter un índice completo de transaccións (por defecto: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Máximo buffer por-conexión para recibir, <n>*1000 bytes (por defecto: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Máximo buffer por-conexión para enviar, <n>*1000 bytes (por defecto: 1000) - - - Only accept block chain matching built-in checkpoints (default: 1) - Aceptar so cadeas de bloques coincidentes con check-points incorporados (por defecto: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Conectar so a nodos na rede <net> (IPv4, IPv6 ou Tor) - Send trace/debug info to console instead of debug.log file Enviar traza/información de depuración á consola en lugar de ao arquivo debug.log - - Set minimum block size in bytes (default: 0) - Fixar tamaño mínimo de bloque en bytes (por defecto: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Recortar o arquivo debug.log ao arrancar o cliente (por defecto: 1 cando no-debug) @@ -2398,14 +2262,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Signing transaction failed Fallou a sinatura da transacción - - Specify connection timeout in milliseconds (default: 5000) - Especificar tempo límite da conexión en milisegundos (por defecto: 5000) - - - System error: - Erro do sistema: - Transaction amount too small A cantidade da transacción é demasiado pequena @@ -2418,10 +2274,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Transaction too large A transacción é demasiado grande - - Use UPnP to map the listening port (default: 0) - Usar UPnP para mapear o porto de escoita (por defecto: 0) - Use UPnP to map the listening port (default: 1 when listening) Usar UPnP para mapear o porto de escoita (por defecto: 1 se á escoita) @@ -2454,10 +2306,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Upgrade wallet to latest format Actualizar moedeiro ao formato máis recente - - Set key pool size to <n> (default: 100) - Fixar tamaño do pool de claves a <n> (por defecto: 100) - Rescan the block chain for missing wallet transactions Rescanear transaccións ausentes na cadea de bloques @@ -2466,14 +2314,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Use OpenSSL (https) for JSON-RPC connections Empregar OpenSSL (https) para conexións JSON-RPC - - Server certificate file (default: server.cert) - Arquivo de certificado do servidor (por defecto: server.cert) - - - Server private key (default: server.pem) - Clave privada do servidor (por defecto: server.perm) - This help message Esta mensaxe de axuda diff --git a/src/qt/locale/bitcoin_he.ts b/src/qt/locale/bitcoin_he.ts index ae96d9f570..8c05228dbf 100644 --- a/src/qt/locale/bitcoin_he.ts +++ b/src/qt/locale/bitcoin_he.ts @@ -3,7 +3,7 @@ AddressBookPage Double-click to edit address or label - לחץ לחיצה כפולה לערוך כתובת או תוית + לחיצה כפולה לעריכת כתובת או תווית Create a new address @@ -11,15 +11,15 @@ &New - &חדש + &חדשה Copy the currently selected address to the system clipboard - העתק את הכתובת המסומנת ללוח העריכה + העתקת הכתובת המסומנת ללוח הגזירים &Copy - &העתק + ה&עתקה C&lose @@ -27,78 +27,82 @@ &Copy Address - העתק כתובת + העתקת כתובת Delete the currently selected address from the list - מחק את הכתובת שנבחרה מהרשימה + מחיקת הכתובת שנבחרה מהרשימה Export the data in the current tab to a file - יצוא הנתונים בטאב הנוכחי לקובץ + יצוא הנתונים מהלשונית הנוכחית לקובץ &Export - &ייצא + י&צוא &Delete - &מחק + מ&חיקה Choose the address to send coins to - בחר את הכתובת אליה תרצה לשלוח את המטבעות + נא לבחור את הכתובת המבוקשת לשליחת המטבעות Choose the address to receive coins with - בחר את הכתובת איתה תרצה לקבל את המטבעות + נא לבחור את הכתובת המבוקשת לקבלת המטבעות C&hoose - בחר + בחירה Sending addresses - כתובת לשליחה + כתובות לשליחה Receiving addresses - קבל כתובות + כתובות לקבלה These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - אלה כתובת הביטקוין שלך עבור שליחת תשלומים. תמיד בדוק את מספר ואת כתובות מקבלי התשלומים לפני שליחת מטבעות. + אלה כתובת הביטקוין שלך לצורך שליחת תשלומים. תמיד יש לבדוק את הכמות ואת כתובות מקבלי התשלומים לפני שליחת מטבעות. These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - אלה כתובות הביטקוין שלך עבור קבלת תשלומים. מומלץ להשתמש בכתובת חדשה לכל פעולה. + אלה כתובות הביטקוין שלך לצורך קבלת תשלומים. מומלץ להשתמש בכתובת קבלה חדשה לכל העברה. Copy &Label - העתק תוית + העתקת &תווית &Edit - עריכה + ע&ריכה Export Address List - ייצוא רשימת כתובות + יצוא רשימת כתובות Comma separated file (*.csv) - קובץ מופרד בפסיקים (*.csv) + קובץ מופרד בפסיקים (‎*.csv) Exporting Failed - הייצוא נכשל + היצוא נכשל - + + There was an error trying to save the address list to %1. Please try again. + אירעה שגיאה בעת הניסיון לשמור את רשימת הכתובת אל %1. נא לנסות שוב. + + AddressTableModel Label - תוית + תווית Address @@ -106,34 +110,34 @@ (no label) - (ללא תוית) + (ללא תווית) AskPassphraseDialog Passphrase Dialog - שיח סיסמא + דו־שיח מילת צופן Enter passphrase - הכנס סיסמה + נא להזין מילת צופן New passphrase - סיסמה חדשה + מילת צופן חדשה Repeat new passphrase - חזור על הסיסמה החדשה + נא לחזור על מילת הצופן החדשה Encrypt wallet - הצפן ארנק + הצפנת הארנק This operation needs your wallet passphrase to unlock the wallet. - הפעולה הזו דורשת את סיסמת הארנק שלך בשביל לפתוח את הארנק. + פעולה זו דורשת את מילת הצופן של הארנק שלך כדי לפתוח את הארנק. Unlock wallet @@ -141,7 +145,7 @@ This operation needs your wallet passphrase to decrypt the wallet. - הפעולה הזו דורשת את סיסמת הארנק שלך בשביל לפענח את הארנק. + פעולה זו דורשת את מילת הצופן של הארנק שלך כדי לפענח את הארנק. Decrypt wallet @@ -149,39 +153,43 @@ Change passphrase - שינוי סיסמה + שינוי מילת צופן Enter the old and new passphrase to the wallet. - הכנס את הסיסמות הישנה והחדשה לארנק. + נא להכניס את מילות הצופן הישנה והחדשה לארנק. Confirm wallet encryption - אשר הצפנת ארנק + אישור הצפנת הארנק Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! - אזהרה: אם אתה מצפין את הארנק ומאבד את הסיסמא, אתה <b>תאבד את כל הביטקוינים שלך</b>! + אזהרה: הצפנת הארנק ואיבוד מילת הצופן עשויה להוביל <b>לאיבוד כל הביטקוינים שלך</b>! Are you sure you wish to encrypt your wallet? - האם אתה בטוח שברצונך להצפין את הארנק? + האם אכן להצפין את הארנק? 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. - חשוב! כל גיבוי קודם שעשית לארנק שלך יש להחליף עם קובץ הארנק המוצפן שזה עתה נוצר. מסיבות אבטחה, גיבויים קודמים של קובץ הארנק הלא-מוצפן יהפכו לחסרי שימוש ברגע שתתחיל להשתמש בארנק החדש המוצפן. + לתשומת לבך: כל גיבוי קודם שביצעת לארנק שלך יש להחליף בקובץ הארנק המוצפן שזה עתה נוצר. מטעמי אבטחה, גיבויים קודמים של קובץ הארנק הבלתי-מוצפן יהפכו לחסרי תועלת עם התחלת השימוש בארנק החדש המוצפן. Warning: The Caps Lock key is on! - זהירות: מקש Caps Lock מופעל! + זהירות: מקש Caps Lock פעיל! Wallet encrypted הארנק הוצפן + + 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>. + נא להזין את מילת הצופן החדשה לארנק.<br/>כדאי להשתמש במילת צופן המורכבת מ<b>עשרה תווים אקראיים ומעלה</b>, או <b>שמונה מילים ומעלה</b>. + Bitcoin 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. - ביטקוין ייסגר עכשיו כדי להשלים את תהליך ההצפנה. זכור שהצפנת הארנק שלך אינו יכול להגן באופן מלא על הביטקוינים שלך מתוכנות זדוניות המושתלות על המחשב. + ביטקוין ייסגר כעת כדי להשלים את תהליך ההצפנה. עליך לזכור שהצפנת הארנק שלך אינה מגנה באופן מלא על הביטקוינים שלך מתכניות זדוניות המושתלות על המחשב. Wallet encryption failed @@ -193,7 +201,7 @@ The supplied passphrases do not match. - הסיסמות שניתנו אינן תואמות. + מילות הצופן שסופקו אינן תואמות. Wallet unlock failed @@ -201,7 +209,7 @@ The passphrase entered for the wallet decryption was incorrect. - הסיסמה שהוכנסה לפענוח הארנק שגויה. + מילת הצופן שהוכנסה לפענוח הארנק שגויה. Wallet decryption failed @@ -209,34 +217,38 @@ Wallet passphrase was successfully changed. - סיסמת הארנק שונתה בהצלחה. + מילת הצופן של הארנק שונתה בהצלחה. BitcoinGUI Sign &message... - חתום על הודעה + &חתימה על הודעה… Synchronizing with network... - מסתנכרן עם הרשת... + בסנכרון עם הרשת… &Overview &סקירה + + Node + מפרק + Show general overview of wallet - הצג סקירה כללית של הארנק + הצגת סקירה כללית של הארנק &Transactions - &פעולות + ה&עברות Browse transaction history - דפדף בהיסטוריית הפעולות + עיון בהיסטוריית ההעברות E&xit @@ -244,67 +256,83 @@ Quit application - סגור תוכנה + יציאה מהתכנית About &Qt - אודות Qt + על אודות Qt Show information about Qt - הצג מידע על Qt + הצגת מידע על Qt &Options... - &אפשרויות + &אפשרויות… &Encrypt Wallet... - הצפן ארנק + ה&צפנת הארנק… &Backup Wallet... - גיבוי ארנק + &גיבוי הארנק… &Change Passphrase... - שנה סיסמא + ה&חלפת מילת הצופן… + + + &Sending addresses... + כתובת ה&שליחה… + + + &Receiving addresses... + כתובות ה&קבלה… + + + Open &URI... + פתיחת &כתובת משאב… + + + Bitcoin Core client + לקוח ליבה של ביטקוין Importing blocks from disk... - מייבא בלוקים מהדיסק... + מקטעים מיובאים מהכונן… Reindexing blocks on disk... - מחדש את אינדקס הבלוקים בדיסק... + המקטעים נוספים למפתח בכונן… Send coins to a Bitcoin address - שלח מטבעות לכתובת ביטקוין + שליחת מטבעות לכתובת ביטקוין Modify configuration options for Bitcoin - שנה אפשרויות תצורה עבור ביטקוין + שינוי התצורה של ביטקוין Backup wallet to another location - גיבוי הארנק למקום אחר + גיבוי הארנק למיקום אחר Change the passphrase used for wallet encryption - שנה את הסיסמה להצפנת הארנק + החלפת מילת הצופן להצפנת הארנק &Debug window - חלון ניפוי + חלון &ניפוי Open debugging and diagnostic console - פתח את לוח הבקרה לאבחון וניפוי + פתיחת לוח הבקרה לאבחון ולניפוי &Verify message... - אמת הודעה... + &אימות הודעה… Bitcoin @@ -316,23 +344,27 @@ &Send - &שלח + &שליחה &Receive - וקבל + &קבלה + + + Show information about Bitcoin Core + הצגת מידע על ליבת ביטקוין &Show / Hide - הצג / הסתר + ה&צגה / הסתרה Show or hide the main Window - הצג או הסתר את החלון הראשי + הצגה או הסתרה של החלון הראשי Encrypt the private keys that belong to your wallet - הצפן את המפתחות הפרטיים ששייכים לארנק שלך + הצפנת המפתחות הפרטיים ששייכים לארנק שלך Sign messages with your Bitcoin addresses to prove you own them @@ -352,15 +384,11 @@ &Help - &עזרה + ע&זרה Tabs toolbar - סרגל כלים טאבים - - - [testnet] - [רשת-בדיקה] + סרגל כלים לשוניות Bitcoin Core @@ -368,11 +396,11 @@ Request payments (generates QR codes and bitcoin: URIs) - בקש תשלומים (מייצר קודיי QR וסכימות URI של :bitcoin) + בקשת תשלומים (יצירה של קודים מסוג QR וסכימות כתובות משאב של :bitcoin) &About Bitcoin Core - &אודות קליינט ביטקוין + על &אודות ליבת ביטקוין Show the list of used sending addresses and labels @@ -380,19 +408,23 @@ Show the list of used receiving addresses and labels - הצג את רשימת הכתובות והתויות המשומשות + הצגת רשימת הכתובות והתוויות הנמצאות בשימוש Open a bitcoin: URI or payment request - פתח ביטקוין: URI או בקשת תשלום + פתיחת ביטקוין: כתובת משאב או בקשת תשלום + + + &Command-line options + אפשרויות &שורת הפקודה + + + Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options + הצגת הודעות העזרה של ליבת ביטקוין כדי לקבל רשימה עם אפשרויות שורת הפקודה האפשריות של ביטקוין No block source available... - אין קוד נתון - - - Processed %1 blocks of transaction history. - הושלם עיבוד של %1 בלוקים של היסטוריית פעולות. + אין מקור מקטעים זמין… %n hour(s) @@ -406,13 +438,17 @@ %n week(s) %n שבוע%n שבועות + + %1 and %2 + %1 ו%2 + Last received block was generated %1 ago. - הבלוק האחרון שהתקבל נוצר לפני %1 + המקטע האחרון שהתקבל נוצר לפני %1. Transactions after this will not yet be visible. - לאחר זאת פעולות נספות טרם יהיו גלויות + ההעברות שבוצעו לאחר העברה זו לא יופיעו. Error @@ -432,15 +468,15 @@ Catching up... - מתעדכן... + מתבצע עדכון… Sent transaction - פעולה שנשלחה + העברת שליחה Incoming transaction - פעולה שהתקבלה + העברת קבלה Date: %1 @@ -455,11 +491,11 @@ Address: %4 Wallet is <b>encrypted</b> and currently <b>unlocked</b> - הארנק <b>מוצפן</b> וכרגע <b>פתוח</b> + הארנק <b>מוצפן</b> ו<b>פתוח</b> כרגע Wallet is <b>encrypted</b> and currently <b>locked</b> - הארנק <b>מוצפן</b> וכרגע <b>נעול</b> + הארנק <b>מוצפן</b> ו<b>נעול</b> כרגע @@ -473,7 +509,7 @@ Address: %4 CoinControlDialog Coin Control Address Selection - בחירת כתובת שליטת מטבעות + בחירת כתובת שליטה במטבעות Quantity: @@ -481,7 +517,7 @@ Address: %4 Bytes: - בייטים: + בתים: Amount: @@ -489,12 +525,16 @@ Address: %4 Priority: - קדימות: + עדיפות: Fee: תשלום: + + Dust: + אבק: + After Fee: לאחר עמלה: @@ -505,7 +545,7 @@ Address: %4 (un)select all - (מחק)(בחר) הכל + ביטול/אישור הבחירה Tree mode @@ -513,7 +553,7 @@ Address: %4 List mode - מצר רשימה + מצב רשימה Amount @@ -537,63 +577,67 @@ Address: %4 Priority - קדימות + עדיפות Copy address - העתק כתובת + העתקת כתובת Copy label - העתק תוית + העתקת תווית Copy amount - העתק כמות + העתקת כמות Copy transaction ID - העתק מזהה פעולה + העתקת מזהה העברה Lock unspent - נעל יתרה + נעילת יתרה Unlock unspent - פתח יתרה + פתיחת יתרה Copy quantity - העתק כמות + העתקת כמות Copy fee - העתק מחיר + העתקת מחיר Copy after fee - העתק אחרי עמלה + העתקת אחרי עמלה Copy bytes - העתק בייטים + העתקת בתים Copy priority - העתק קדימות + העתקת עדיפות + + + Copy dust + העתקת אבק Copy change - העתק עודף + העתקת עודף highest - הכי גבוה + הגבוה ביותר higher - גבוהה יותר + גבוה יותר high @@ -601,7 +645,7 @@ Address: %4 medium-high - בנוני גבוה + בינוני - גבוה medium @@ -621,7 +665,15 @@ Address: %4 lowest - הכי נמוך + הנמוך ביותר + + + none + ללא + + + Can vary +/- %1 satoshi(s) per input. + יכולה להשתנות ב+/- %1 סטושי לקלט. yes @@ -633,23 +685,27 @@ Address: %4 This label turns red, if the transaction size is greater than 1000 bytes. - תווית זו מאדימה במידה וגודל הפעולה עולה על 1000 בייט + תווית זו מאדימה אם גודל ההעברה עולה על 1000 בתים. This means a fee of at least %1 per kB is required. - זאת אומרת שנחוצה עמלה של לא פחות מ־%1 לכל קילו בייט. + זאת אומרת שנחוצה עמלה של לא פחות מ־%1 לכל קילו בית. Can vary +/- 1 byte per input. - הערך יכול להיות +/- בייט 1 פר כניסה + הערך יכול להיות +/- בית אחד לכל קלט. Transactions with higher priority are more likely to get included into a block. - העברות עם עדיפות גבוהה, יותר סיכוי שיכנסו לתוך הבלוק + העברות עם עדיפות גבוהה, יותר סיכוי שיכנסו לתוך המקטע. + + + This label turns red, if the priority is smaller than "medium". + תווית זו מאדימה אם העדיפות היא פחות מ„בינוני“ (no label) - (ללא תוית) + (אין תווית) change from %1 (%2) @@ -664,15 +720,15 @@ Address: %4 EditAddressDialog Edit Address - ערוך כתובת + עריכת כתובת &Label - ת&וית + ת&ווית The label associated with this address list entry - התוית המשויכת לרשומה הזו ברשימת הכתובות + התווית המשויכת לרשומה הזו ברשימת הכתובות The address associated with this address list entry. This can only be modified for sending addresses. @@ -692,19 +748,19 @@ Address: %4 Edit receiving address - ערוך כתובת לקבלה + עריכת כתובת לקבלה Edit sending address - ערוך כתובת לשליחה + עריכת כתובת לשליחה The entered address "%1" is already in the address book. - הכתובת שהכנסת "%1" כבר נמצאת בפנקס הכתובות. + הכתובת שהוכנסה „%1“ כבר נמצאת בפנקס הכתובות. The entered address "%1" is not a valid Bitcoin address. - הכתובת שהוכנסה "%1" אינה כתובת ביטקוין תקינה. + הכתובת שהוכנסה „%1“ אינה כתובת ביטקוין תקנית. Could not unlock wallet. @@ -719,7 +775,7 @@ Address: %4 FreespaceChecker A new data directory will be created. - ספריית מידע חדשה תיווצר. + תיקיית נתונים חדשה תיווצר. name @@ -727,15 +783,15 @@ Address: %4 Directory already exists. Add %1 if you intend to create a new directory here. - הספריה כבר קיימת. הוסף %1 אם ברצונך ליצור ספריה חדשה כאן. + התיקייה כבר קיימת. ניתן להוסיף %1 אם יש ליצור תיקייה חדשה כאן. Path already exists, and is not a directory. - הנתיב כבר קיים ואינו מצביע על ספרייה. + הנתיב כבר קיים ואינו מצביע על תיקייה. Cannot create data directory here. - לא ניתן ליצור ספריית מידע כאן. + לא ניתן ליצור כאן תיקיית נתונים. @@ -748,6 +804,10 @@ Address: %4 version גרסה + + (%1-bit) + (%1-סיביות) + About Bitcoin Core על אודות ליבת ביטקוין @@ -766,21 +826,29 @@ Address: %4 UI options - אפשרויות ממשק + אפשרויות מנשק Set language, for example "de_DE" (default: system locale) - קבע שפה, למשל "he_il" (ברירת מחדל: שפת המערכת) + הגדרת שפה, למשל „he_il“ (בררת מחדל: שפת המערכת) Start minimized - התחל ממוזער + התחלה במצב ממוזער + + + Set SSL root certificates for payment request (default: -system-) + הגדרות אישורי בסיס של SSL לבקשות תשלום (בררת המחדל: -מערכת-) Show splash screen on startup (default: 1) - הצג מסך פתיחה בעת הפעלה (ברירת מחדל: 1) + הצגת מסך פתיחה בעת הפעלה (בררת מחדל: 1) - + + Choose data directory on startup (default: 0) + בחירת תיקיית נתונים עם ההפעלה (בררת מחדל: 0) + + Intro @@ -789,54 +857,50 @@ Address: %4 Welcome to Bitcoin Core. - ברוך הבא לקליינט ביטקוין + ברוך בואך לליבת ביטקוין As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. - מכיוון שזאת הפעם הראשונה שהתוכנה הופעלה תוכל לבחור איפה ביטקויין קור תאכסן את + מכיוון שזאת הפעם הראשונה שהתכנית פועלת ניתן לבחור איפה ליבת ביטקוין תאחסן את הנתונים שלה. Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - קליינט ביטקוין יוריד וישמור העתק של שרשרת הבלוקים של ביטקוין. לפחות %1GB מהנתונים יאוכסנו בתיקיה הזו, ויגדל עם הזמן. הארנק גם יאוחסן בתיקיה הזו. + לקוח ביטקוין יוריד וישמור העתק של שרשרת המקטעים של ביטקוין. לפחות %1 ג״ב מהנתונים יאוחסנו בתיקייה זו, והיא תגדל עם הזמן. הארנק גם יאוחסן בתיקייה הזו. Use the default data directory - השתמש בברירת המחדל עבור ספריית המידע. + שימוש בבררת המחדל של תיקיית הנתונים. Use a custom data directory: - השתמש בספריית מידע מותאמת אישית: + שימוש בתיקיית נתונים מותאמת אישית: Bitcoin Core ליבת ביטקוין + + Error: Specified data directory "%1" cannot be created. + שגיאה: לא ניתן ליצור את תיקיית הנתונים שצוינה „%1“. + Error שגיאה - - GB of free space available - ג"ב של שטח אחסון פנוי - - - (of %1GB needed) - (מתוך %1 ג"ב נחוצים) - - + OpenURIDialog Open URI - פתח URI + פתיחת כתובת משאב Open payment request from URI or file - פתח בקשת תשלום מ-URI או קובץ + פתיחת בקשת תשלום מכתובת משאב או מקובץ URI: - כתובת: + כתובת משאב: Select payment request file @@ -855,63 +919,127 @@ Address: %4 &Main - ראשי + &ראשי Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - עמלת פעולה אופציונלית לכל kB תבטיח שהפעולה שלך תעובד בזריזות. רוב הפעולות הן 1 kB. + עמלת העברה כרשות לכל ק״ב תבטיח שההעברה שלך תעובד בזריזות. רוב ההעברות הן בנפח של ק״ב אחד. Pay transaction &fee - שלם &עמלת פעולה + תשלום &עמלת העברה Automatically start Bitcoin after logging in to the system. - הפעל את ביטקוין באופן עצמאי לאחר התחברות למערכת. + הפעלת ביטקוין אוטומטית לאחר כניסה למערכת. &Start Bitcoin on system login - התחל את ביטקוין בעת התחברות למערכת + ה&פעלת ביטקוין בעת הכניסה למערכת + + + Size of &database cache + גודל מ&טמון מסד הנתונים MB - מגה בייט + מ״ב + + + Number of script &verification threads + מספר תהליכי ה&אימות של הסקריפט + + + Accept connections from outside + קבלת חיבורים מבחוץ + + + Allow incoming connections + לאפשר חיבורים נכנסים + + + Connect to the Bitcoin network through a SOCKS proxy. + התחברות לרשת ביטקוין דרך מתווך SOCKS. + + + &Connect through SOCKS proxy (default proxy): + הת&חברות באמצעות מתווך SOCKS (מתווך בררת מחדל): + + + IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + כתובת ה־IP של המתווך (לדוגמה IPv4: 127.0.0.1‏ / IPv6: ::1) + + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + כתובות צד־שלישי (כגון: סייר מקטעים) שמופיעים בלשונית ההעברות בתור פריטים בתפריט ההקשר. %s בכתובת מוחלף בגיבוב ההעברה. מספר כתובות יופרדו בפס אנכי |. + + + Third party transaction URLs + כתובות העברה צד־שלישי + + + Active command-line options that override above options: + אפשרויות פעילות בשורת הפקודה שדורסות את האפשרויות שלהלן: Reset all client options to default. - אפס כל אפשרויות התוכנה לברירת המחדל. + איפוס כל אפשרויות התכנית לבררת המחדל. &Reset Options - איפוס אפשרויות + &איפוס אפשרויות &Network - רשת + &רשת + + + (0 = auto, <0 = leave that many cores free) + (0 = אוטומטי, <0 = להשאיר כזאת כמות של ליבות חופשיות) + + + W&allet + &ארנק + + + Expert + מומחה + + + Enable coin &control features + הפעלת תכונות &בקרת מטבעות + + + 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. + אם אפשרות ההשקעה של עודף בלתי מאושר תנוטרל, לא ניתן יהיה להשתמש בעודף מההעברה עד שלהעברה יהיה לפחות אישור אחד. פעולה זו גם משפיעה על חישוב המאזן שלך. + + + &Spend unconfirmed change + עודף &בלתי מאושר מההשקעה Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - פתח את פורט ביטקוין בנתב באופן אוטומטי. עובד רק אם UPnP מאופשר ונתמך ע"י הנתב. + פתיחת הפתחה של ביטקוין בנתב באופן אוטומטי. עובד רק אם UPnP מופעל ונתמך בנתב. Map port using &UPnP - מיפוי פורט באמצעות UPnP + מיפוי פתחה באמצעות UPnP Proxy &IP: - כתובת IP של פרוקסי: + כתובת ה־IP של המ&תווך: &Port: - פורט: + &פתחה: Port of the proxy (e.g. 9050) - הפורט של הפרוקסי (למשל 9050) + הפתחה של המתווך (למשל 9050) &Window - חלון + &חלון Show only a tray icon after minimizing the window. @@ -919,59 +1047,75 @@ Address: %4 &Minimize to the tray instead of the taskbar - מ&זער למגש במקום לשורת המשימות + מ&זעור למגש במקום לשורת המשימות Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu. - מזער את התוכנה במקום לצאת ממנה כשהחלון נסגר. כשאפשרות זו פעילה, התוכנה תיסגר רק לאחר בחירת יציאה מהתפריט. + מזעור התכנית במקום לצאת ממנה כשהחלון נסגר. כשאפשרות זו פעילה, התכנית תיסגר רק לאחר בחירת יציאה מהתפריט. M&inimize on close - מזער בעת סגירה + מ&זעור עם סגירה &Display - תצוגה + ת&צוגה User Interface &language: - שפת ממשק המשתמש: + &שפת מנשק המשתמש: The user interface language can be set here. This setting will take effect after restarting Bitcoin. - ניתן לקבוע כאן את שפת ממשק המשתמש. הגדרה זו תחול לאחר הפעלה מחדש של ביטקוין. + להלן ניתן לקבוע את שפת מנשק המשתמש. הגדרה זו תיכנס לתוקף לאחר הפעלה מחדש של ביטקוין. &Unit to show amounts in: - יחידת מדידה להצגת כמויות: + י&חידת מידה להצגת כמויות: Choose the default subdivision unit to show in the interface and when sending coins. - בחר את ברירת המחדל ליחידת החלוקה אשר תוצג בממשק ובעת שליחת מטבעות. + ניתן לבחור את בררת המחדל ליחידת החלוקה שתוצג במנשק ובעת שליחת מטבעות. Whether to show coin control features or not. - הצג תכונות שליטת מטבע או לא. + האם להציג תכונות שליטת מטבע או לא. &OK - אישור + &אישור &Cancel - ביטול + &ביטול default - ברירת מחדל + בררת מחדל + + + none + ללא Confirm options reset - אשר את איפוס האפשרויות + אישור איפוס האפשרויות + + + Client restart required to activate changes. + נדרשת הפעלה מחדש של הלקוח כדי להפעיל את השינויים. + + + Client will be shutdown, do you want to proceed? + הלקוח יכבה, האם להמשיך? + + + This change would require a client restart. + שינוי זה ידרוש הפעלה מחדש של תכנית הלקוח. The supplied proxy address is invalid. - כתובת הפרוקסי שסופקה אינה תקינה. + כתובת המתווך שסופקה אינה תקינה. @@ -982,19 +1126,27 @@ Address: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. - המידע המוצג עשוי להיות מיושן. הארנק שלך מסתנכרן באופן אוטומטי עם רשת הביטקוין לאחר כינון חיבור, אך התהליך טרם הסתיים. + המידע המוצג עשוי להיות מיושן. הארנק שלך מסתנכרן באופן אוטומטי עם רשת הביטקוין לאחר יצירת החיבור, אך התהליך טרם הסתיים. - Wallet - ארנק + Watch-only: + צפייה בלבד: + + + Available: + זמין: Your current spendable balance היתרה הזמינה הנוכחית + + Pending: + בהמתנה: + Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - הסכום הכולל של פעולות שטרם אושרו, ועוד אינן נספרות בחישוב היתרה הזמינה + הסכום הכולל של העברות שטרם אושרו ועדיין אינן נספרות בחישוב היתרה הזמינה Immature: @@ -1004,6 +1156,10 @@ Address: %4 Mined balance that has not yet matured מאזן שנכרה וטרם הבשיל + + Balances + מאזנים + Total: סך הכול: @@ -1013,27 +1169,59 @@ Address: %4 סך כל היתרה הנוכחית שלך - <b>Recent transactions</b> - <b>פעולות אחרונות</b> + Your current balance in watch-only addresses + המאזן הנוכחי שלך בכתובות לקריאה בלבד + + + Recent transactions + העברות אחרונות + + + Unconfirmed transactions to watch-only addresses + העברות בלתי מאושרות לכתובות לצפייה בלבד + + + Mined balance in watch-only addresses that has not yet matured + מאזן לאחר כרייה בכתובות לצפייה בלבד שעדיין לא הבשילו + + + Current total balance in watch-only addresses + המאזן הכולל הנוכחי בכתובות לצפייה בלבד out of sync - לא מסונכרן + לא בסנכרון PaymentServer URI handling - תפעול URI + תפעול כתובות משאב Invalid payment address %1 כתובת תשלום שגויה %1 + + Payment request rejected + בקשת התשלום נדחתה + + + Payment request network doesn't match client network. + רשת בקשת התשלום אינה תואמת לרשת הלקוח. + + + Payment request has expired. + בקשת התשלום פגה. + + + Payment request is not initialized. + בקשת התשלום לא החלה. + Requested payment amount of %1 is too small (considered dust). - הסכום הנדרש לתשלום %1 קטן מדי (נחשב לאבק) + הסכום על סך %1 הנדרש לתשלום קטן מדי (נחשב לאבק) Payment request error @@ -1041,11 +1229,27 @@ Address: %4 Cannot start bitcoin: click-to-pay handler - לא ניתן להתחיל את ביטקוין: מפעיל לחץ-לתשלום + לא ניתן להתחיל את ביטקוין: טיפול בלחיצה–לתשלום + + + Payment request fetch URL is invalid: %1 + כתובת אחזור בקשת התשלום שגויה: %1 + + + URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + לא ניתן לנתח את כתובת המשאב! מצב זה יכול לקרות עקב כתובת ביטקוין שגויה או פרמטרים שגויים בכתובת המשאב. + + + Payment request file handling + טיפול בקובצי בקשות תשלום + + + Payment request file cannot be read! This can be caused by an invalid payment request file. + לא ניתן לקרוא את קובץ בקשת התשלום! מצב כזה יכול לקרות בעקבות קובץ בקשת תשלום פגום. Unverified payment requests to custom payment scripts are unsupported. - בקשות לתשלום לסקריפטיי תשלום מותאמים אישית אינן נתמכות. + בקשות תשלום בלתי מאומתות לסקריפטים לתשלום מותאמים אישית אינן נתמכות. Refund from %1 @@ -1055,6 +1259,10 @@ Address: %4 Error communicating with %1: %2 שגיאה בתקשורת עם %1: %2 + + Payment request cannot be parsed! + לא ניתן לפענח את בקשת התשלום! + Bad response from server %1 מענה שגוי משרת %1 @@ -1070,62 +1278,106 @@ Address: %4 PeerTableModel - + + User Agent + סוכן משתמש + + + Address/Hostname + כתובת/שם מארח + + + Ping Time + זמן המענה + + QObject Amount כמות + + Enter a Bitcoin address (e.g. %1) + נא להזין כתובת ביטקוין (למשל: %1) + + + %1 d + %1 ימים + %1 h %1 שעות - N/A - N/A + %1 m + %1 דקות - + + %1 s + %1 שניות + + + NETWORK + רשת + + + UNKNOWN + לא ידוע + + + None + ללא + + + N/A + לא זמין + + + %1 ms + %1 מילישניות + + QRImageWidget &Save Image... - &שמור תמונה.. + &שמירת תמונה… &Copy Image - &העתק תמונה + ה&עתקת תמונה Save QR Code - שמור קוד QR + שמירת קוד QR PNG Image (*.png) - תמונת PNG (*.png) + תמונת PNG ‏(‎*.png) RPCConsole Client name - שם ממשק + שם לקוח N/A - N/A + לא זמין Client version - גרסת ממשק + גרסת מנשק &Information - מידע + מי&דע Debug window - חלון דיבאג + חלון ניפוי General @@ -1133,11 +1385,15 @@ Address: %4 Using OpenSSL version - משתמש ב-OpenSSL גרסה + שימוש ב־OpenSSL גרסה + + + Using BerkeleyDB version + שימוש ב־BerkeleyDB גרסה Startup time - זמן אתחול + זמן עלייה Network @@ -1153,23 +1409,91 @@ Address: %4 Block chain - שרשרת הבלוקים + שרשרת מקטעים Current number of blocks - מספר הבלוקים הנוכחי + מספר המקטעים הנוכחי + + + Received + התקבלו + + + Sent + נשלחו + + + &Peers + &עמיתים + + + Select a peer to view detailed information. + נא לבחור בעמית כדי להציג מידע מפורט. + + + Direction + כיוון + + + Version + גרסה + + + User Agent + סוכן משתמש + + + Services + שירותים + + + Starting Height + גובה התחלתי + + + Sync Height + גובה הסנכרון + + + Ban Score + דירוג חסימה + + + Connection Time + זמן החיבור + + + Last Send + שליחה אחרונה + + + Last Receive + קבלה אחרונה + + + Bytes Sent + בתים שנשלחו + + + Bytes Received + בתים שהתקבלו + + + Ping Time + זמן המענה Last block time - זמן הבלוק האחרון + זמן המקטע האחרון &Open - פתח + &פתיחה &Console - לוח בקרה + מ&סוף בקרה &Network Traffic @@ -1177,7 +1501,7 @@ Address: %4 &Clear - & נקה + &ניקוי Totals @@ -1193,7 +1517,7 @@ Address: %4 Build date - תאריך בניה + תאריך בנייה Debug log file @@ -1201,41 +1525,65 @@ Address: %4 Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - פתח את קובץ יומן הניפוי מתיקיית הנתונים הנוכחית. זה עשוי לקחת מספר שניות עבור קובצי יומן גדולים. + פתיחת קובץ יומן הניפוי מתיקיית הנתונים הנוכחית. פעולה זו עשויה להימשך מספר שניות עבור קובצי יומן גדולים. Clear console - נקה לוח בקרה + ניקוי מסוף הבקרה Welcome to the Bitcoin RPC console. - ברוכים הבאים ללוח בקרת RPC של ביטקוין + ברוכים הבאים למסוף ה־RPC של ביטקוין. Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. - השתמש בחיצים למעלה ולמטה כדי לנווט בהיסטוריה, ו- <b>Ctrl-L</b> כדי לנקות את המסך. + יש להשתמש בחצים למעלה ולמטה כדי לנווט בהיסטוריה, וב־<b>Ctrl-L</b> כדי לנקות את המסך. Type <b>help</b> for an overview of available commands. - הקלד <b>help</b> בשביל סקירה של הפקודות הזמינות. + ניתן להקליד <b>help</b> לקבלת סקירה של הפקודות הזמינות. %1 B - %1 בייט + %1 ב׳ %1 KB - %1 קילו בייט + %1 ק״ב %1 MB - %1 מגה בייט + %1 מ״ב %1 GB - %1 ג'יגה בייט + %1 ג״ב - + + via %1 + דרך %1 + + + never + לעולם לא + + + Inbound + תעבורה נכנסת + + + Outbound + תעבורה יוצאת + + + Unknown + לא ידוע + + + Fetching... + מתקבל… + + ReceiveCoinsDialog @@ -1244,55 +1592,79 @@ Address: %4 &Label: - ת&וית: + ת&ווית: &Message: - &הודעה: + הו&דעה: Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. - השתמש שוב באחת מכתובות הקבלה שכבר נעשה בהן שימוש. לשימוש חוזר בכתובות ישהן השלכות אבטחה ופרטיות. השתמש בזה רק אם אתה מייצר מחדש בקשת תשלום שכבר נעשתה. + ניתן להשתמש שוב באחת מכתובות הקבלה שכבר נעשה בהן שימוש. לשימוש חוזר בכתובות ישנן השלכות אבטחה ופרטיות. מומלץ שלא להשתמש באפשרות זו למעט יצירה מחדש של בקשת תשלום שנוצרה בעבר. R&euse an existing receiving address (not recommended) - ש&ימוש חוזר בכתובת קבלה קיימת(לא מומלץ) + ש&ימוש &חוזר בכתובת קבלה קיימת (לא מומלץ) + + + An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. + הודעת רשות לצירוף לבקשת התשלום שתוצג בעת פתיחת הבקשה. לתשומת לבך: ההודעה לא תישלח עם התשלום ברשת ביטקוין. + + + An optional label to associate with the new receiving address. + תווית רשות לשיוך עם כתובת הקבלה החדשה. + + + Use this form to request payments. All fields are <b>optional</b>. + יש להשתמש בטופס זה כדי לבקש תשלומים. כל השדות הם בגדר <b>רשות</b>. + + + An optional amount to request. Leave this empty or zero to not request a specific amount. + סכום כרשות לבקשה. ניתן להשאיר זאת ריק כדי לא לבקש סכום מסוים. Clear all fields of the form. - נקה את כל השדות + ניקוי כל השדות של הטופס. Clear - נקה + ניקוי + + + Requested payments history + היסטוריית בקשות תשלום &Request payment - &בקש תשלום + &בקשת תשלום Show the selected request (does the same as double clicking an entry) - הצג בקשות נבחרות (דומה ללחיצה כפולה על רשומה) + הצגת בקשות נבחרות (דומה ללחיצה כפולה על רשומה) Show - הצג + הצגה Remove the selected entries from the list - הסר הרשומות הנבחרות מהרשימה + הסרת הרשומות הנבחרות מהרשימה Remove - הסר + הסרה Copy label - העתק תוית + העתקת תווית + + + Copy message + העתקת הודעה Copy amount - העתק כמות + העתקת כמות @@ -1303,27 +1675,27 @@ Address: %4 Copy &URI - העתק &URI + העתקת &כתובת משאב Copy &Address - התעק &כתובת + העתקת &כתובת &Save Image... - &שמור תמונה.. + &שמירת תמונה… Request payment to %1 - בקש תשלום ל %1 + בקשת תשלום לטובת %1 Payment information - אנפרומצייה על התשלום + מידע על תשלום URI - כתובת (אתר או משאב) + כתובת משאב Address @@ -1335,7 +1707,7 @@ Address: %4 Label - תוית + תווית Message @@ -1343,11 +1715,11 @@ Address: %4 Resulting URI too long, try to reduce the text for label / message. - המזהה המתקבל ארוך מדי, נסה להפחית את הטקסט בתוית / הודעה. + כתובת המשאב המתקבלת ארוכה מדי, כדאי לנסות לצמצם את הטקסט בתווית / הודעה. Error encoding URI into QR Code. - שגיאה בקידוד URI לקוד QR + שגיאה בקידוד כתובת משאב לקוד QR @@ -1358,7 +1730,7 @@ Address: %4 Label - תוית + תווית Message @@ -1370,30 +1742,34 @@ Address: %4 (no label) - (ללא תוית) + (אין תווית) (no message) - (אין הודעות) + (אין הודעה) - + + (no amount) + (אין סכום) + + SendCoinsDialog Send Coins - שלח מטבעות + שליחת מטבעות Coin Control Features - ה + תכונות בקרת מטבעות Inputs... - כניסות... + קלטים… automatically selected - נבחר אוטומאטית + בבחירה אוטומטית Insufficient funds! @@ -1405,19 +1781,19 @@ Address: %4 Bytes: - בייטים: + בתים: Amount: - כמות: + סכום: Priority: - קדימות: + עדיפות: Fee: - תשלום: + עמלה: After Fee: @@ -1425,7 +1801,11 @@ Address: %4 Change: - שינוי: + עודף: + + + If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. + אם אפשרות זו מופעלת אך כתובת העודף ריקה או שגויה, העודף יישלח לכתובת חדשה שתיווצר. Custom change address @@ -1433,35 +1813,39 @@ Address: %4 Send to multiple recipients at once - שלח למספר מקבלים בו-זמנית + שליחה למספר מוטבים בו־זמנית Add &Recipient - הוסף מקבל + הוספת &מוטב Clear all fields of the form. - נקה את כל השדות + ניקוי של כל השדות בטופס. + + + Dust: + אבק: Clear &All - נקה הכל + ניקוי ה&כול Balance: - יתרה: + מאזן: Confirm the send action - אשר את פעולת השליחה + אישור פעולת השליחה S&end - שלח + &שליחה Confirm send coins - אשר שליחת מטבעות + אישור שליחת מטבעות %1 to %2 @@ -1469,31 +1853,35 @@ Address: %4 Copy quantity - העתק כמות + העתקת כמות Copy amount - העתק כמות + העתקת סכום Copy fee - העתק מחיר + העתקת עמלה Copy after fee - העתק אחרי עמלה + העתקת אחרי עמלה Copy bytes - העתק בייטים + העתקת בתים Copy priority - העתק קדימות + העתקת עדיפות Copy change - העתק עודף + העתקת עודף + + + Total Amount %1 (= %2) + הסכום הכולל %1 (= %2) or @@ -1501,11 +1889,11 @@ Address: %4 The recipient address is not valid, please recheck. - כתובת המקבל אינה תקינה, אנא בדוק שנית. + כתובת המוטב אינה תקינה, נא לבדוק שוב. The amount to pay must be larger than 0. - הכמות לשלם חייבת להיות גדולה מ-0. + הכמות לתשלום חייבת להיות גדולה מ־0. The amount exceeds your balance. @@ -1513,7 +1901,7 @@ Address: %4 The total exceeds your balance when the %1 transaction fee is included. - הכמות הכוללת, ובכללה עמלת פעולה בסך %1, עולה על המאזן שלך. + הכמות הכוללת, ובכללה עמלת העברה בסך %1, עולה על המאזן שלך. Duplicate address found, can only send to each address once per send operation. @@ -1521,11 +1909,27 @@ Address: %4 Transaction creation failed! - יצירת הפעולה נכשלה! + יצירת ההעברה נכשלה! + + + The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. + ההעברה נדחתה! מצב כזה עשוי לקרות אם חלק מהמטבעות בארנק שלך כבר הושקעו, כמו למשל עקב שימוש בעותק של wallet.dat והמטבעות הושקעו בעותק אבל לא סומנו כאילו הושקעו דרך כאן. + + + Warning: Invalid Bitcoin address + אזהרה: כתובת ביטקוין שגויה (no label) - (ללא תוית) + (אין תווית) + + + Warning: Unknown change address + אזהרה: כתובת עודף בלתי ידועה + + + Copy dust + העתקת אבק Are you sure you want to send? @@ -1533,47 +1937,55 @@ Address: %4 added as transaction fee - הוסף מחיר טיפול + נוסף כעמלת העברה SendCoinsEntry A&mount: - כ&מות: + &כמות: Pay &To: - שלם &ל: + לשלם ל&טובת: Enter a label for this address to add it to your address book - הכנס תוית לכתובת הזאת כדי להכניס לפנקס הכתובות + נא להכניס תווית לכתובת הזאת כדי להוסיף לפנקס הכתובות &Label: - ת&וית: + ת&ווית: Choose previously used address - בחר כתובת שהייתה בשימוש + בחירת כתובת שהייתה בשימוש This is a normal payment. זהו תשלום רגיל. + + The Bitcoin address to send the payment to + כתובת הביטקוין של המוטב + Alt+A Alt+A Paste address from clipboard - הדבר כתובת מהלוח + הדבקת כתובת מלוח הגזירים Alt+P Alt+P + + Remove this entry + הסרת רשומה זו + Message: הודעה: @@ -1584,7 +1996,11 @@ Address: %4 Enter a label for this address to add it to the list of used addresses - הקלד תווית עבור כתובת זו בכדי להוסיף אותה לרשימת הכתובות בשימוש + יש להזין תווית עבור כתובת זו כדי להוסיף אותה לרשימת הכתובות בשימוש + + + A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. + הודעה שצורפה לביטקוין: כתובת שתאוחסן בהעברה לצורך מעקב מצדך. לתשומת לבך: הודעה זו לא תישלח ברשת הביטקוין. This is an unverified payment request. @@ -1592,7 +2008,7 @@ Address: %4 Pay To: - תשלום ל: + תשלום לטובת: Memo: @@ -1601,6 +2017,10 @@ Address: %4 ShutdownWindow + + Bitcoin Core is shutting down... + ליבת ביטקוין נסגרת… + Do not shut down the computer until this window disappears. אין לכבות את המחשב עד שחלון זה נעלם. @@ -1610,19 +2030,23 @@ Address: %4 SignVerifyMessageDialog Signatures - Sign / Verify a Message - חתימות - חתום או אמת הודעה + חתימות - חתימה או אימות של הודעה &Sign Message - חתום על הו&דעה + חתימה על הו&דעה You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - אתה יכול לחתום על הודעות עם הכתובות שלך כדי להוכיח שהן בבעלותך. היזהר לא לחתום על משהו מעורפל, שכן התקפות פישינג עשויות לגרום לך בעורמה למסור את זהותך. חתום רק על אמרות מפורטות לחלוטין שאתה מסכים עימן. + ניתן לחתום על הודעות עם הכתובות שלך כדי להוכיח שהן בבעלותך. מומלץ להיזהר לא לחתום על משהו מפוקפק, שכן התקפות דיוג עשויות לגרום לך בעורמה למסור את זהותך. רצוי לחתום רק על הצהרות מפורטות לחלוטין שהסכמת עמן. + + + The Bitcoin address to sign the message with + כתובת הביטקוין אתה לחתום אתה את ההודעה Choose previously used address - בחר כתובת שהייתה בשימוש + בחירת כתובת שהייתה בשימוש Alt+A @@ -1630,7 +2054,7 @@ Address: %4 Paste address from clipboard - הדבק כתובת מהלוח + הדבקת כתובת מלוח הגזירים Alt+P @@ -1638,7 +2062,7 @@ Address: %4 Enter the message you want to sign here - הכנס כאן את ההודעה שעליך ברצונך לחתום + יש להוסיף כאן את ההודעה עליה לחתום Signature @@ -1646,47 +2070,51 @@ Address: %4 Copy the current signature to the system clipboard - העתק את החתימה הנוכחית ללוח המערכת + העתקת החתימה הנוכחית ללוח הגזירים Sign the message to prove you own this Bitcoin address - חתום על ההודעה כדי להוכיח שכתובת הביטקוין הזו בבעלותך. + ניתן לחתום על ההודעה כדי להוכיח שכתובת הביטקוין הזו בבעלותך. Sign &Message - חתום על הודעה + &חתימה על הודעה Reset all sign message fields - אפס את כל שדות החתימה על הודעה + איפוס כל שדות החתימה על הודעה Clear &All - נקה הכל + &ניקוי הכול &Verify Message - אמת הודעה + &אימות הודעה Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. הכנס למטה את הכתובת החותמת, ההודעה (ודא שאתה מעתיק מעברי שורה, רווחים, טאבים וכו' באופן מדויק) והחתימה כדי לאמת את ההודעה. היזהר לא לפרש את החתימה כיותר ממה שמופיע בהודעה החתומה בעצמה, כדי להימנע מליפול קורבן למתקפת איש-באמצע. + + The Bitcoin address the message was signed with + כתובת הביטקוין שאתה נחתמה ההודעה + Verify the message to ensure it was signed with the specified Bitcoin address - אמת את ההודעה כדי להבטיח שהיא נחתמה עם כתובת הביטקוין הנתונה + ניתן לאמת את ההודעה כדי להבטיח שהיא נחתמה עם כתובת הביטקוין הנתונה Verify &Message - אימות הודעה + &אימות הודעה Reset all verify message fields - אפס את כל שדות אימות הודעה + איפוס כל שדות אימות ההודעה Click "Sign Message" to generate signature - לחץ "חתום על ההודעה" כדי לחולל חתימה + יש ללחוץ על „חתימה על ההודעה“ כדי לחולל חתימה The entered address is invalid. @@ -1694,7 +2122,7 @@ Address: %4 Please check the address and try again. - אנא בדוק את הכתובת ונסה שנית. + נא לבדוק את הכתובת לנסות שנית. The entered address does not refer to a key. @@ -1722,7 +2150,7 @@ Address: %4 Please check the signature and try again. - אנא בדוק את החתימה ונסה שנית. + נא לבדוק את החתימה ולנסות שנית. The signature did not match the message digest. @@ -1743,6 +2171,10 @@ Address: %4 Bitcoin Core ליבת ביטקוין + + The Bitcoin Core developers + מתכנתי ליבת ביטקוין + [testnet] [רשת-בדיקה] @@ -1752,14 +2184,18 @@ Address: %4 TrafficGraphWidget KB/s - קילו בייט לשניה + ק״ב/ש׳ TransactionDesc Open until %1 - פתוח עד %1 + פתוחה עד %1 + + + conflicted + מתנגש %1/offline @@ -1767,7 +2203,7 @@ Address: %4 %1/unconfirmed - %1/ממתין לאישור + %1/המתנה לאישור %1 confirmations @@ -1801,9 +2237,13 @@ Address: %4 own address כתובת עצמית + + watch-only + צפייה בלבד + label - תוית + תווית Credit @@ -1817,13 +2257,21 @@ Address: %4 Debit חיוב + + Total debit + סך כל החיוב + + + Total credit + סך כל האשראי + Transaction fee - עמלת פעולה + עמלת העברה Net amount - כמות נקיה + כמות נקייה Message @@ -1835,7 +2283,7 @@ Address: %4 Transaction ID - זיהוי פעולה + מזהה העברה Merchant @@ -1843,7 +2291,7 @@ Address: %4 Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - מטבעות חדשים שנוצרו חייבים להבשיל במשך %1 בלוקים לפני שניתן לנצל אותם. כשבלוק זה נוצר הוא שודר ברשת על מנת שייכנס לשרשרת הבלוקים. במקרה והוא לא ייכנס לשרשרת, מצבו ישתנה ל"לא התקבל" ולא ניתן יהיה לנצלו. זה יכול לקרות מדי פעם אם במקרה צומת אחרת ייצרה בלוק בהבדל של שניות בודדות ממך. + מטבעות חדשים שנוצרו חייבים להבשיל במשך %1 מקטעים לפני שניתן לנצל אותם. כשמקטע זה נוצר הוא משודר ברשת על מנת שייכנס לשרשרת המקטעים. אם הוא לא ייכנס לשרשרת, מצבו ישתנה ל„לא התקבל“ ולא ניתן יהיה לנצלו. מצב כזה יכול לקרות מדי פעם אם במקרה מפרק אחר יצר מקטע בהבדל של שניות בודדות ממך. Debug information @@ -1851,7 +2299,7 @@ Address: %4 Transaction - פעולה + העברה Inputs @@ -1875,7 +2323,7 @@ Address: %4 Open for %n more block(s) - פתח למשך בלוק %n יותרפתח למשך %n בלוקים נוספים + פתיחה למשך מקטע %n נוסףפתיחה למשך %n מקטעים נוספים unknown @@ -1886,11 +2334,11 @@ Address: %4 TransactionDescDialog Transaction details - פרטי הפעולה + פרטי ההעברה This pane shows a detailed description of the transaction - חלונית זו מציגה תיאור מפורט של הפעולה + חלונית זו מציגה תיאור מפורט של ההעברה @@ -1907,13 +2355,17 @@ Address: %4 Address כתובת + + Immature (%1 confirmations, will be available after %2) + לא בשל (%1 אישורים, יהיו זמינים לאחר %2) + Open for %n more block(s) - פתח למשך בלוק %n יותרפתח למשך %n בלוקים נוספים + פתח למשך בלוק %n יותרפתיחה למשך %n מקטעים נוספים Open until %1 - פתוח עד %1 + פתוחה עד %1 Confirmed (%1 confirmations) @@ -1921,12 +2373,28 @@ Address: %4 This block was not received by any other nodes and will probably not be accepted! - הבלוק הזה לא נקלט על ידי אף צומת אחר, וכנראה לא יתקבל! + המקטע הזה לא נקלט על ידי אף מפרק אחר, וכנראה לא יתקבל! Generated but not accepted נוצר אך לא התקבל + + Offline + מנותק + + + Unconfirmed + ללא אישור + + + Confirming (%1 of %2 recommended confirmations) + מתקבל אישור (%1 מתוך %2 אישורים מומלצים) + + + Conflicted + מתנגש + Received with התקבל עם @@ -1937,7 +2405,7 @@ Address: %4 Sent to - נשלח ל + נשלח אל Payment to yourself @@ -1947,25 +2415,33 @@ Address: %4 Mined נכרה + + watch-only + צפייה בלבד + (n/a) - (n/a) + (לא זמין) Transaction status. Hover over this field to show number of confirmations. - מצב הפעולה. השהה את הסמן מעל שדה זה כדי לראות את מספר האישורים. + מצב ההעברה. יש להמתין עם הסמן מעל שדה זה כדי לראות את מספר האישורים. Date and time that the transaction was received. - התאריך והשעה בה הפעולה הזאת התקבלה. + התאריך והשעה בה ההעברה הזאת התקבלה. Type of transaction. - סוג הפעולה. + סוג ההעברה. + + + Whether or not a watch-only address is involved in this transaction. + האם כתובות לצפייה בלבד מעורבות בהעברה זאת או שלא. Destination address of transaction. - כתובת היעד של הפעולה. + כתובת היעד של ההעברה. Amount removed from or added to balance. @@ -1976,7 +2452,7 @@ Address: %4 TransactionView All - הכל + הכול Today @@ -2000,7 +2476,7 @@ Address: %4 Range... - טווח... + טווח… Received with @@ -2008,7 +2484,7 @@ Address: %4 Sent to - נשלח ל + נשלח אל To yourself @@ -2024,7 +2500,7 @@ Address: %4 Enter address or label to search - הכנס כתובת או תוית לחפש + נא להכניס כתובת או תווית לחיפוש Min amount @@ -2032,47 +2508,55 @@ Address: %4 Copy address - העתק כתובת + העתקת כתובת Copy label - העתק תוית + העתקת תווית Copy amount - העתק כמות + העתקת כמות Copy transaction ID - העתק מזהה פעולה + העתקת מזהה העברה Edit label - ערוך תוית + עריכת תווית Show transaction details - הצג פרטי פעולה + הצגת פרטי העברה Export Transaction History - יצוא היסטוריית פעולות + יצוא היסטוריית העברות + + + Watch-only + צפייה בלבד Exporting Failed - הייצוא נכשל + היצוא נכשל + + + There was an error trying to save the transaction history to %1. + אירעה שגיאה בעת ניסיון לשמור את היסטוריית ההעברות אל %1. Exporting Successful - הייצוא בוצע בהצלחה + היצוא בוצע בהצלחה The transaction history was successfully saved to %1. - היסטוריית הפעולות נשמרה ל־%1 בהצלחה. + היסטוריית ההעברות נשמרה ל־%1 בהצלחה. Comma separated file (*.csv) - קובץ מופרד בפסיקים (*.csv) + קובץ מופרד בפסיקים (‎*.csv) Confirmed @@ -2088,7 +2572,7 @@ Address: %4 Label - תוית + תווית Address @@ -2109,7 +2593,11 @@ Address: %4 UnitDisplayStatusBarControl - + + Unit to show amounts in. Click to select another unit. + יחידת המידה להצגת הסכומים. יש ללחוץ כדי לבחור ביחידת מידה אחרת. + + WalletFrame @@ -2121,34 +2609,42 @@ Address: %4 WalletModel Send Coins - שלח מטבעות + שליחת מטבעות WalletView &Export - &ייצא + י&צוא Export the data in the current tab to a file - יצוא הנתונים בטאב הנוכחי לקובץ + יצוא הנתונים מהלשונית הנוכחית לקובץ Backup Wallet - גבה ארנק + גיבוי ארנק Wallet Data (*.dat) - נתוני ארנק (*.dat) + נתוני ארנק (‎*.dat) Backup Failed גיבוי נכשל + + There was an error trying to save the wallet data to %1. + אירעה שגיאה בעת ניסיון לשמירת נתוני הארנק אל %1. + + + The wallet data was successfully saved to %1. + נתוני הארנק נשמרו בהצלחה אל %1. + Backup Successful - גיבוי הושלם בהצלחה + הגיבוי הושלם בהצלחה @@ -2157,61 +2653,33 @@ Address: %4 Options: אפשרויות: - - Specify configuration file (default: bitcoin.conf) - ציין קובץ הגדרות (ברירת מחדל: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - ציין קובץ pid (ברירת מחדל: bitcoind.pid) - Specify data directory - ציין תיקיית נתונים - - - Listen for connections on <port> (default: 8333 or testnet: 18333) - האזן לחיבורים ב<פורט> (ברירת מחדל: 8333 או ברשת הבדיקה: 18333) - - - Maintain at most <n> connections to peers (default: 125) - החזק לכל היותר <n> חיבורים לעמיתים (ברירת מחדל: 125) + ציון תיקיית נתונים Connect to a node to retrieve peer addresses, and disconnect - התחבר לצומת כדי לדלות כתובות עמיתים, ואז התנתק + יש להתחבר למפרק כדי לדלות כתובות עמיתים ואז להתנתק Specify your own public address - ציין את הכתובת הפומבית שלך - - - Threshold for disconnecting misbehaving peers (default: 100) - סף להתנתקות מעמיתים הנוהגים שלא כהלכה (ברירת מחדל: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - מספר שניות למנוע מעמיתים הנוהגים שלא כהלכה מלהתחבר מחדש (ברירת מחדל: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - האזן לחיבורי JSON-RPC ב- <port> (ברירת מחדל: 8332 או רשת בדיקה: 18332) + נא לציין את הכתובת הפומבית שלך Accept command line and JSON-RPC commands - קבל פקודות משורת הפקודה ו- JSON-RPC + קבלת פקודות משורת הפקודה ומ־JSON-RPC Run in the background as a daemon and accept commands - רוץ ברקע כדימון וקבל פקודות + ריצה כסוכן ברקע וקבלת פקודות Use the test network - השתמש ברשת הבדיקה + שימוש ברשת הבדיקה Accept connections from outside (default: 1 if no -proxy or -connect) - קבל חיבורים מבחוץ (ברירת מחדל: 1 ללא -proxy או -connect) + קבלת חיבורים מבחוץ (בררת מחדל: 1 ללא ‎-proxy או ‎-connect) %s, you must set a rpcpassword in the configuration file: @@ -2225,61 +2693,77 @@ If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - %s, עליך לקבוע סיסמת RPC בקובץ הקונפיגורציה: + %s, עליך להגדיר את ססמת ה־RPC בקובץ התצורה: %s -מומלץ להשתמש בסיסמא האקראית הבאה: +מומלץ להשתמש בססמה האקראית הבאה: rpcuser=bitcoinrpc rpcpassword=%s -(אין צורך לזכור את הסיסמה) -אסור ששם המשתמש והסיסמא יהיו זהים. -אם הקובץ אינו קיים, צור אותו עם הרשאות קריאה לבעלים בלבד. -זה מומלץ לסמן alertnotify כדי לקבל דיווח על תקלות; +(אין צורך לזכור את הססמה) +אסור ששם המשתמש והססמה יהיו זהים. +אם הקובץ אינו קיים, יש ליצור אותו עם הרשאות קריאה לבעלים בלבד. +כמו כן, מומלץ להגדיר את alertnotify כדי לקבל דיווח על תקלות; למשל: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - צפנים קבילים (ברירת מחדל: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) + Bind to given address and always listen on it. Use [host]:port notation for IPv6 + להתאגד לכתובת נתונה להאזין לה תמיד. יש להשתמש בצורה ‎[host]:port עבור IPv6. - Bind to given address and always listen on it. Use [host]:port notation for IPv6 - קשור עם כתובת נתונה והאזן לה תמיד. השתמש בסימון [host]:port עבוד IPv6. + Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup + מחיקת כל העברות הארנק ולשחזר רק את החלקים המסוימים בשרשרת המקטעים באמצעות ‎-rescan עם ההפעלה + + + Enter regression test mode, which uses a special chain in which blocks can be solved instantly. + כניסה למצב בדיקת נסיגה, שמשתמש בשרשרת מיוחדת בה ניתן לפתור את המקטעים במהירות. Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - שגיאה: הפעולה נדחתה! זה עלול לקרות אם כמה מהמטבעות בארנק שלך כבר נוצלו, למשל אם השתמשת בעותק של wallet.dat ומטבעות נשלחו בעותק אך לא סומנו כמנוצלות כאן. + שגיאה: ההעברה נדחתה! מצב כזה עלול לקרות אם כמה מהמטבעות בארנק שלך כבר נוצלו, למשל אם השתמשת בעותק של wallet.dat ומטבעות נשלחו בעותק אך לא סומנו כמושקעות כאן. Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! - שגיאה: הפעולה הזאת דורשת עמלת פעולה של לפחות %s עקב הכמות, המורכבות, או השימוש בכספים שהתקבלו לאחרונה! + שגיאה: ההעברה הזאת דורשת עמלת פעולה של לפחות %s עקב הכמות, המורכבות או השימוש בכספים שהתקבלו לאחרונה! Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) - בצע פקודה כאשר פעולת ארנק משתנה (%s ב cmd יוחלף ב TxID) + ביצוע פקודה כאשר העברה בארנק משתנה (%s ב־cmd יוחלף ב־TxID) This is a pre-release test build - use at your own risk - do not use for mining or merchant applications זוהי בניית ניסיון טרום-שחרור - השימוש בה על אחריותך - אין להשתמש לצורך כריה או יישומי מסחר + + Unable to bind to %s on this computer. Bitcoin Core is probably already running. + לא ניתן להתאגד אל %s במחשב זה. כנראה שליבת ביטקוין כבר פועלת. + Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - אזהרה: -paytxfee נקבע לערך מאד גבוה! זוהי עמלת הפעולה שתשלם אם אתה שולח פעולה. + אזהרה: ‎-paytxfee נקבע לערך מאד גבוה! זוהי עמלת הפעולה שתשולם בעת העברת שליחה. Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - אזהרה: נראה שלא כל הרשת מסכימה! נראה שישנם כורים אשר נתקלים בבעיות. + אזהרה: נראה שלא כל הרשת מסכימה! נראה שישנם כורים שנתקלים בבעיות. Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - אזהרה: נראה שאנחנו לא מסכימים לחלוטין עם העמיתים שלנו! ייתכן ואנחנו צריכים לשדרג, או שצמתים אחרות צריכות לשדרג. + אזהרה: נראה שישנה אי־הסכמה בינינו לבין שאר העמיתים שלנו! יתכן שעדיף לשדרג או שכל שאר העמיתים צריכים לשדרג. Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - אזהרה: שגיאה בקריאת wallet.dat! כל המתפחות נקראו באופן תקין, אך נתוני הפעולות או ספר הכתובות עלולים להיות חסרים או שגויים. + אזהרה: שגיאה בקריאת wallet.dat! כל המפתחות נקראו באופן תקין, אך נתוני ההעברות או ספר הכתובות עלולים להיות חסרים או שגויים. Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - אזהרה: קובץ wallet.dat מושחת, המידע חולץ! קובץ wallet.dat המקורח נשמר כ - wallet.{timestamp}.bak ב - %s; אם המאזן או הפעולות שגויים עליך לשחזר גיבוי. + אזהרה: הקובץ wallet.dat הושחת, המידע חולץ! קובץ ה־wallet.dat המקורי נשמר בשם wallet.{timestamp}.bak במיקום %s; אם המאזן או ההעברות שגויים עליך לשחזר גיבוי. + + + (default: 1) + (בררת מחדל: 1) + + + <category> can be: + <קטגוריה> יכולה להיות: Attempt to recover private keys from a corrupt wallet.dat @@ -2287,7 +2771,7 @@ rpcpassword=%s Block creation options: - אפשרויות יצירת בלוק: + אפשרויות יצירת מקטע: Connect only to the specified node(s) @@ -2299,19 +2783,27 @@ rpcpassword=%s Corrupted block database detected - התגלה מסד נתוני בלוקים לא תקין + התגלה מסד נתוני מקטעים לא תקין + + + Debugging/Testing options: + אפשרויות ניפוי/בדיקה: Discover own IP address (default: 1 when listening and no -externalip) - גלה את כתובת ה-IP העצמית (ברירת מחדל: 1 כשמאזינים וללא -externalip) + לגלות את כתובת ה־IP העצמית (בררת מחדל: 1 בעת האזנה וללא ‎-externalip) + + + Do not load the wallet and disable wallet RPC calls + לא לטעון את הארנק ולנטרל קריאות RPC Do you want to rebuild the block database now? - האם תרצה כעט לבנות מחדש את מסד נתוני הבלוקים? + האם לבנות מחדש את מסד נתוני המקטעים? Error initializing block database - שגיאה באתחול מסד נתוני הבלוקים + שגיאה באתחול מסד נתוני המקטעים Error initializing wallet database environment %s! @@ -2319,79 +2811,35 @@ rpcpassword=%s Error loading block database - שגיאה בטעינת מסד נתוני הבלוקים + שגיאה בטעינת מסד נתוני המקטעים Error opening block database - שגיאה בטעינת מסד נתוני הבלוקים + שגיאה בטעינת מסד נתוני המקטעים Error: Disk space is low! - שגיאה: מעט מקום פנוי בדיסק! + שגיאה: מעט מקום פנוי בכונן! Error: Wallet locked, unable to create transaction! - שגיאה: הארנק נעול, אין אפשרות ליצור פעולה! - - - Error: system error: - שגיאה: שגיאת מערכת: + שגיאה: הארנק נעול, אין אפשרות ליצור העברה! Failed to listen on any port. Use -listen=0 if you want this. האזנה נכשלה בכל פורט. השתמש ב- -listen=0 אם ברצונך בכך. - Failed to read block info - קריאת מידע הבלוקים נכשלה + If <category> is not supplied, output all debugging information. + אם לא סופקה <קטגוריה> יש לייצא את כל פרטי הניפוי. - Failed to read block - קריאת הבלוק נכשלה - - - Failed to sync block index - סנכרון אינדקס הבלוקים נכשל - - - Failed to write block index - כתיבת אינדקס הבלוקים נכשל - - - Failed to write block info - כתיבת מידע הבלוקים נכשל - - - Failed to write block - כתיבת הבלוק נכשלה - - - Failed to write file info - כתיבת מידע הקבצים נכשלה - - - Failed to write to coin database - כתיבת מסד נתוני המטבעות נכשלה - - - Failed to write transaction index - כתיבת אינדקס הפעולות נכשלה - - - Failed to write undo data - כתיבת נתוני ביטול נכשלה - - - Generate coins (default: 0) - ייצר מטבעות (ברגיל: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - מספר הבלוקים לבדוק בעת אתחול (ברירת מחדל: 288, 0 = כולם) + Importing... + מתבצע יבוא… Incorrect or no genesis block found. Wrong datadir for network? - בלוק בראשית הינו שגוי או לא נמצא. ספריית מידע לא נכונה עבור הרשת? + מקטע הפתיח הוא שגוי או לא נמצא. תיקיית נתונים שגויה עבור הרשת? Invalid -onion address: '%s' @@ -2402,125 +2850,189 @@ rpcpassword=%s אין מספיק מידע על הקובץ - Rebuild block chain index from current blk000??.dat files - בנה מחדש את אינדק שרשרת הבלוקים מקבצי ה-blk000??.dat הנוכחיים. + Only connect to nodes in network <net> (ipv4, ipv6 or onion) + תמיד להתחבר למפרקים ברשת <net>‏ (ipv4,‏ ipv6 או onion) - Set the number of threads to service RPC calls (default: 4) - קבע את מספר תהליכוני לשירות קריאות RPC (ברירת מחדל: 4) + Rebuild block chain index from current blk000??.dat files + בנייה מחדש של מפתח שרשרת המקטעים מקובצי ה־blk000??.dat הנוכחיים. + + + Set database cache size in megabytes (%d to %d, default: %d) + הגדרת גודל מטמון מסדי הנתונים במגה בתים (%d עד %d, בררת מחדל: %d) + + + Set maximum block size in bytes (default: %d) + הגדרת קובץ מקטע מרבי בבתים (בררת מחדל: %d) Specify wallet file (within data directory) - ציין קובץ ארנק (בתוך ספריית המידע) + ציון קובץ ארנק (בתוך תיקיית הנתונים) + + + This is intended for regression testing tools and app development. + תכונה זו מיועדת לכלי בדיקות נסיגה ופיתוח יישומים. Verifying blocks... - מאמת את שלמות מסד הנתונים... + המקטעים מאומתים… Verifying wallet... - מאמת את יושרת הארנק... + הארנק מאומת… Wallet %s resides outside data directory %s - הארנק %s יושב מחוץ לספריית המידע %s + הארנק %s יושב מחוץ לתיקיית הנתונים %s + + + Wallet options: + אפשרויות הארנק: You need to rebuild the database using -reindex to change -txindex - עליך לבנות מחדש את מסד הנתונים תוך שימוש ב- -reindex על מנת לשנות את -txindex + עליך לבנות מחדש את מסד הנתונים תוך שימוש ב־‎-reindex על מנת לשנות את ‎-txindex Imports blocks from external blk000??.dat file - מייבא בלוקים מקובצי blk000??.dat חיצוניים + מיובאים מקטעים מקובצי blk000??.dat חיצוניים Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) הרץ פקודה כאשר ההתראה הרלוונטית מתקבלת או כשאנחנו עדים לפיצול ארוך מאוד (%s בשורת הפקודה יוחלף ע"י ההודעה) + + Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) + העמלות (ב־BTC/ק״ב) הנמוכות מהסכום הזה נחשבות לעמלות אפס ליצירת העברה (בררת מחדל: %s) + + + Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + אזהרה: נא לבדוק שהתאריך והשעה של המחשב שלך נכונים! אם השעון שלך שגוי ליבת ביטקוין לא תעבוד כראוי. + + + Cannot resolve -whitebind address: '%s' + לא ניתן לפתור את הכתובת ‎-whitebind:‏ '%s' + + + Connect through SOCKS5 proxy + התחברות דרך מתווך SOCKS5 + + + Copyright (C) 2009-%i The Bitcoin Core Developers + כל הזכויות שמורות (C)‏ 2009‏-%i מתכנתי ליבת ביטקוין + + + Could not parse -rpcbind value %s as network address + לא ניתן לנתח את הערך של ‎-rpcbind שצוין בתור %s ככתובת רשת + + + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core + אירעה שגיאה בטעינת wallet.dat: הארנק דורש גרסה חדשה יותר של ליבת ביטקוין + + + Error: Unsupported argument -tor found, use -onion. + שגיאה: נמצא ארגומנט בלתי נתמך ‎-tor, יש להשתמש ב־‎-onion. + + + Fee (in BTC/kB) to add to transactions you send (default: %s) + עמלה (ב־BTC/ק״ב) להוספה להעברות שנשלחות ממך (בררת מחדל: %s) + Information מידע + + Initialization sanity check failed. Bitcoin Core is shutting down. + בדיקת התקינות ההתחלתית נכשלה. ליבת ביטקוין תיסגר כעת. + Invalid amount for -minrelaytxfee=<amount>: '%s' כמות לא תקינה עבור -paytxfee=<amount>: '%s' Invalid amount for -mintxfee=<amount>: '%s' - כמות לא תקינה עבור -paytxfee=<amount>: '%s' + כמות לא תקינה עבור ‎-mintxfee=<amount>‎:‏ '%s' - Maintain a full transaction index (default: 0) - תחזק אינדקס פעולות מלא (ברירת מחדל: 0) + Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) + כמות לא תקינה עבור ‎-paytxfee=<amount>‎:‏ '%s' (חייבת להיות לפחות %s) - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - חוצץ קבלה מירבי לכל חיבור, <n>*1000 בתים (ברירת מחדל: 5000) + Invalid netmask specified in -whitelist: '%s' + מסכת הרשת שצוינה עם ‎-whitelist שגויה: '%s' - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - חוצץ שליחה מירבי לכל חיבור, <n>*1000 בתים (ברירת מחדל: 1000) + Need to specify a port with -whitebind: '%s' + עליך לציין פתחה עם ‎-whitebind:‏ '%s' - Only accept block chain matching built-in checkpoints (default: 1) - קבל רק שרשרת בלוקים התואמת נקודות ביקורת מובנות (ברירת מחדל: 1) + Node relay options: + אפשרויות ממסר מפרק: - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - התחבר רק לצמתים ברשת <net> (IPv4, IPv6 או Tor) + Print block on startup, if found in block index + הצגת מקטע בהפעלה, אם נמצא במפתח המקטעים + + + RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) + אפשרויות RPC SSL: (נא לעיין בוויקי של ביטקוין לקבלת הנחיות על הגדרת SSL) RPC server options: הגדרות שרת RPC + + Randomly drop 1 of every <n> network messages + להשמיט אקראית אחת מתוך כל <n> הודעות רשת + Send trace/debug info to console instead of debug.log file שלח מידע דיבאג ועקבה לקונסולה במקום לקובץ debug.log - Set minimum block size in bytes (default: 0) - קבע את גודל הבלוק המינימלי בבתים (ברירת מחדל: 0) + Show all debugging options (usage: --help -help-debug) + הצגת כל אפשרויות הניפוי (שימוש: ‎--help -help-debug) Shrink debug.log file on client startup (default: 1 when no -debug) - כווץ את קובץ debug.log בהפעלת הקליינט (ברירת מחדל: 1 ללא -debug) + כיווץ הקובץ debug.log בהפעלת הלקוח (בררת מחדל: 1 ללא ‎-debug) Signing transaction failed - פעולה העברה נכשלה + החתימה על ההעברה נכשלה - Specify connection timeout in milliseconds (default: 5000) - ציין הגבלת זמן לחיבור במילישניות (ברירת מחדל: 5000) - - - System error: - שגיאת מערכת: + This is experimental software. + זוהי תכנית נסיונית. Transaction amount too small - סכום העברה קטן מדי + סכום ההעברה קטן מדי Transaction amounts must be positive - סכום ההעברה חייב להיות חיובי + סכומי ההעברות חייבים להיות חיוביים Transaction too large - סכום העברה גדול מדי + סכום ההעברה גדול מדי - Use UPnP to map the listening port (default: 0) - השתמש ב-UPnP כדי למפות את הפורט להאזנה (ברירת מחדל: 0) + Unable to bind to %s on this computer (bind returned error %s) + לא ניתן להתאגד עם הפתחה %s במחשב זה (פעולת האיגוד החזירה את השגיאה %s) Use UPnP to map the listening port (default: 1 when listening) - השתמש ב-UPnP כדי למפות את הפורט להאזנה (ברירת מחדל: 1 בעת האזנה) + יש להשתמש ב־UPnP כדי למפות את הפתחה להאזנה (בררת מחדל: 1 בעת האזנה) Username for JSON-RPC connections שם משתמש לחיבורי JSON-RPC + + Wallet needed to be rewritten: restart Bitcoin Core to complete + יש לכתוב את הארנק מחדש: נא להפעיל את ליבת ביטקוין מחדש כדי להשלים את הפעולה + Warning אזהרה @@ -2529,9 +3041,17 @@ rpcpassword=%s Warning: This version is obsolete, upgrade required! אזהרה: הגרסה הזאת מיושנת, יש צורך בשדרוג! + + Warning: Unsupported argument -benchmark ignored, use -debug=bench. + אזהרה: הארגומנט שאינו נתמך עוד ‎-benchmark לא הופעל, נא להשתמש ב־‎-debug=bench. + + + Warning: Unsupported argument -debugnet ignored, use -debug=net. + אזהרה: הארגומנט שאינו נתמך עוד ‎-debugnet לא הופעל, נא להשתמש ב־‎-debug=net. + on startup - בפתיחה + עם ההפעלה wallet.dat corrupt, salvage failed @@ -2539,35 +3059,23 @@ rpcpassword=%s Password for JSON-RPC connections - סיסמה לחיבורי JSON-RPC + ססמה לחיבורי JSON-RPC Execute command when the best block changes (%s in cmd is replaced by block hash) - בצע פקודה זו כשהבלוק הטוב ביותר משתנה (%s בפקודה יוחלף בגיבוב הבלוק) + יש לבצע פקודה זו כשהמקטע הטוב ביותר משתנה (%s בפקודה יוחלף בגיבוב המקטע) Upgrade wallet to latest format - שדרג את הארנק לפורמט העדכני - - - Set key pool size to <n> (default: 100) - קבע את גודל המאגר ל -<n> (ברירת מחדל: 100) + שדרוג הארנק למבנה העדכני Rescan the block chain for missing wallet transactions - סרוק מחדש את שרשרת הבלוקים למציאת פעולות חסרות בארנק + יש לסרוק מחדש את שרשרת המקטעים למציאת העברות חסרות בארנק Use OpenSSL (https) for JSON-RPC connections - השתמש ב-OpenSSL (https( עבור חיבורי JSON-RPC - - - Server certificate file (default: server.cert) - קובץ תעודת שרת (ברירת מחדל: server.cert) - - - Server private key (default: server.pem) - מפתח פרטי של השרת (ברירת מחדל: server.pem) + שימוש ב־OpenSSL (https)‎ עבור חיבורי JSON-RPC This help message @@ -2575,11 +3083,11 @@ rpcpassword=%s Allow DNS lookups for -addnode, -seednode and -connect - אפשר בדיקת DNS עבור -addnode, -seednode ו- -connect + הפעלת בדיקת DNS עבור ‎-addnode,‏ ‎-seednode ו־‎-connect Loading addresses... - טוען כתובות... + הכתובות בטעינה… Error loading wallet.dat: Wallet corrupted @@ -2591,23 +3099,23 @@ rpcpassword=%s Invalid -proxy address: '%s' - כתובת -proxy לא תקינה: '%s' + כתובת ‎-proxy לא תקינה: '%s' Unknown network specified in -onlynet: '%s' - רשת לא ידועה צוינה ב- -onlynet: '%s' + רשת לא ידועה צוינה דרך ‎-onlynet:‏ '%s' Cannot resolve -bind address: '%s' - לא מסוגל לפתור כתובת -bind: '%s' + לא ניתן לפתור את הכתובת ‎-bind:‏ '%s' Cannot resolve -externalip address: '%s' - לא מסוגל לפתור כתובת -externalip: '%s' + לא ניתן לפתור את הכתובת ‎-externalip:‏ '%s' Invalid amount for -paytxfee=<amount>: '%s' - כמות לא תקינה עבור -paytxfee=<amount>: '%s' + כמות לא תקינה עבור ‎-paytxfee=<amount>‎:‏ '%s' Invalid amount @@ -2619,27 +3127,27 @@ rpcpassword=%s Loading block index... - טוען את אינדקס הבלוקים... + מפתח המקטעים נטען… Add a node to connect to and attempt to keep the connection open - הוסף צומת להתחברות ונסה לשמור את החיבור פתוח + הוספת מפרק להתחברות ולנסות לשמור על החיבור פתוח Loading wallet... - טוען ארנק... + הארנק בטעינה… Cannot downgrade wallet - לא יכול להוריד דרגת הארנק + לא ניתן להחזיר את גרסת הארנק Cannot write default address - לא יכול לכתוב את כתובת ברירת המחדל + לא ניתן לכתוב את כתובת בררת המחדל Rescanning... - סורק מחדש... + סריקה מחדש… Done loading @@ -2647,7 +3155,7 @@ rpcpassword=%s To use the %s option - להשתמש באפשרות %s + שימוש באפשרות %s Error diff --git a/src/qt/locale/bitcoin_hi_IN.ts b/src/qt/locale/bitcoin_hi_IN.ts index 28778a0258..fcb094703f 100644 --- a/src/qt/locale/bitcoin_hi_IN.ts +++ b/src/qt/locale/bitcoin_hi_IN.ts @@ -191,10 +191,6 @@ Tabs toolbar टैबस टूलबार - - [testnet] - [टेस्टनेट] - %n active connection(s) to Bitcoin network %n सक्रिया संपर्क बीटकोइन नेटवर्क से%n सक्रिया संपर्क बीटकोइन नेटवर्क से @@ -389,14 +385,6 @@ Address: %4 Form फार्म - - Wallet - वॉलेट - - - <b>Recent transactions</b> - <b>हाल का लेन-देन</b> - PaymentServer @@ -860,14 +848,6 @@ Address: %4 Options: विकल्प: - - Specify configuration file (default: bitcoin.conf) - configuraion की फाइल का विवरण दें (default: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - pid फाइल का विवरण दें (default: bitcoin.pid) - Specify data directory डेटा डायरेक्टरी बताएं diff --git a/src/qt/locale/bitcoin_hr.ts b/src/qt/locale/bitcoin_hr.ts index bf365bb57e..794a7167e3 100644 --- a/src/qt/locale/bitcoin_hr.ts +++ b/src/qt/locale/bitcoin_hr.ts @@ -9,14 +9,30 @@ Create a new address Dodajte novu adresu + + &New + &Nova + Copy the currently selected address to the system clipboard Kopiraj trenutno odabranu adresu u međuspremnik + + &Copy + &Kopiraj + + + C&lose + &Zatvori + &Copy Address &Kopirati adresu + + Delete the currently selected address from the list + Brisanje trenutno odabrane adrese s popisa. + Export the data in the current tab to a file Izvoz podataka iz trenutnog taba u datoteku @@ -29,6 +45,34 @@ &Delete &Brisanje + + Choose the address to send coins to + Odaberi adresu na koju šalješ novac + + + Choose the address to receive coins with + Odaberi adresu na koju primaš novac + + + C&hoose + &Odaberi + + + Sending addresses + Adresa za slanje + + + Receiving addresses + Adresa za primanje + + + These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. + Ovo su vaše Bitcoin adrese za slanje uplate. Uvijek provjerite iznos i adresu primatelja prije slanja novca. + + + These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. + Ovo su vaše Bitcoin adrese za primanje isplate. Preporučamo da koristite novu primateljsku adresu za svaku transakciju. + Copy &Label Kopirati &oznaku @@ -37,11 +81,23 @@ &Edit &Izmjeniti + + Export Address List + Izvezi listu adresa + Comma separated file (*.csv) Datoteka vrijednosti odvojenih zarezom (*. csv) - + + Exporting Failed + Izvoz neuspješan + + + There was an error trying to save the address list to %1. Please try again. + Došlo je do pogreške kod spremanja liste adresa na %1. Molimo pokušajte ponovno. + + AddressTableModel @@ -59,6 +115,10 @@ AskPassphraseDialog + + Passphrase Dialog + Dijalog lozinke + Enter passphrase Unesite lozinku @@ -111,6 +171,10 @@ Are you sure you wish to encrypt your wallet? Jeste li sigurni da želite šifrirati svoj novčanik? + + 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. + VAŽNO: Sve prethodne pričuve vašeg novčanika trebale bi biti zamijenjene novo stvorenom, šifriranom datotekom novčanika. Zbog sigurnosnih razloga, prethodne pričuve nešifriranog novčanika će postati beskorisne čim počnete koristiti novi, šifrirani novčanik. + Warning: The Caps Lock key is on! Upozorenje: Tipka Caps Lock je uključena! @@ -119,6 +183,10 @@ Wallet encrypted Novčanik šifriran + + 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>. + Unesite novu lozinku za novčanik. <br/>Molimo Vas da koristite zaporku od <b>deset ili više slučajnih znakova</b>, ili <b>osam ili više riječi.</b> + Bitcoin 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. Bitcoin će se sada zatvoriti kako bi dovršio postupak šifriranja. Zapamtite da šifriranje vašeg novčanika ne može u potpunosti zaštititi vaše bitcoine od krađe preko zloćudnog softvera koji bi bio na vašem računalu. @@ -156,7 +224,7 @@ BitcoinGUI Sign &message... - &Potpišite poruku... + P&otpišite poruku... Synchronizing with network... @@ -166,6 +234,10 @@ &Overview &Pregled + + Node + Čvor + Show general overview of wallet Prikaži opći pregled novčanika @@ -196,19 +268,35 @@ &Options... - &Postavke + Pos&tavke &Encrypt Wallet... - &Šifriraj novčanik... + Ši&friraj novčanik... &Backup Wallet... - &Backup novčanika... + Si&gurnosno kopiraj novčanik... &Change Passphrase... - &Promijena lozinke... + &Promjena lozinke... + + + &Sending addresses... + Adrese za s&lanje + + + &Receiving addresses... + Adrese za p&rimanje + + + Open &URI... + Otvori &URI... + + + Bitcoin Core client + Bitcoin Core klijent Importing blocks from disk... @@ -234,6 +322,14 @@ Change the passphrase used for wallet encryption Promijenite lozinku za šifriranje novčanika + + &Debug window + &Ispravljanje programerskih pogrešaka + + + Open debugging and diagnostic console + Otvori konzolu za dijagnostiku i otklanjanje programskih pogrešaka. + &Verify message... &Potvrdite poruku... @@ -250,13 +346,41 @@ &Send &Pošalji + + &Receive + Pri&miti + + + Show information about Bitcoin Core + Prikaži informacije o Bitcoin Coreu + + + &Show / Hide + Po&kaži / Sakrij + + + Show or hide the main Window + Prikaži ili sakrij glavni prozor + + + Encrypt the private keys that belong to your wallet + Šifriraj privatne ključeve koji pripadaju tvom novčaniku + + + Sign messages with your Bitcoin addresses to prove you own them + Potpiši poruke svojim Bitcoin adresama kako bi dokazao da si njihov vlasnik + + + Verify messages to ensure they were signed with specified Bitcoin addresses + Provjerite porkue kako bi se uvjerili da su potpisane navedenim Bitcoin adresama + &File &Datoteka &Settings - &Konfiguracija + &Postavke &Help @@ -266,22 +390,30 @@ Tabs toolbar Traka kartica - - [testnet] - [testnet] - Bitcoin Core Bitcoin Jezgra + + Request payments (generates QR codes and bitcoin: URIs) + Zatraži uplate (Stvara QR kodove i bitcoin: URIje) + + + &About Bitcoin Core + &O Bitcoin Jezgri + + + Show the list of used sending addresses and labels + Prikaži popis korištenih adresa i oznaka za slanje isplate + + + Show the list of used receiving addresses and labels + Prikaži popis korištenih adresa i oznaka za primanje isplate + %n active connection(s) to Bitcoin network %n aktivna veza na Bitcoin mrežu%n aktivne veze na Bitcoin mrežu%n aktivnih veza na Bitcoin mrežu - - Processed %1 blocks of transaction history. - Obrađeno %1 blokova povijesti transakcije. - Error Greška @@ -468,11 +600,7 @@ Adresa:%4 Error Pogreška - - (of %1GB needed) - (od potrebnog %1GB) - - + OpenURIDialog @@ -577,18 +705,10 @@ Adresa:%4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Prikazani podatci mogu biti zastarjeli. Vaš novčanik se automatski sinkronizira s Bitcoin mrežom kada je veza uspostavljena, ali taj proces još nije završen. - - Wallet - Novčanik - Total: Ukupno: - - <b>Recent transactions</b> - <b>Nedavne transakcije</b> - PaymentServer @@ -1199,6 +1319,10 @@ Adresa:%4 Show transaction details Prikaži detalje transakcije + + Exporting Failed + Izvoz neuspješan + Comma separated file (*.csv) Datoteka podataka odvojenih zarezima (*.csv) @@ -1278,42 +1402,14 @@ Adresa:%4 Options: Postavke: - - Specify configuration file (default: bitcoin.conf) - Odredi konfiguracijsku datoteku (ugrađeni izbor: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Odredi proces ID datoteku (ugrađeni izbor: bitcoin.pid) - Specify data directory Odredi direktorij za datoteke - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Slušaj na <port>u (default: 8333 ili testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Održavaj najviše <n> veza sa članovima (default: 125) - Specify your own public address Odaberi vlastitu javnu adresu - - Threshold for disconnecting misbehaving peers (default: 100) - Prag za odspajanje članova koji se čudno ponašaju (default: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Broj sekundi koliko se članovima koji se čudno ponašaju neće dopustiti da se opet spoje (default: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Prihvaćaj JSON-RPC povezivanje na portu broj <port> (ugrađeni izbor: 8332 or testnet: 18332) - Accept command line and JSON-RPC commands Prihvati komande iz tekst moda i JSON-RPC @@ -1342,10 +1438,6 @@ Adresa:%4 Error: Disk space is low! Pogreška: Nema prostora na disku! - - Error: system error: - Pogreška: sistemska pogreška: - Imports blocks from external blk000??.dat file Importiraj blokove sa vanjskog blk000??.dat fajla @@ -1354,30 +1446,10 @@ Adresa:%4 Information Informacija - - Only accept block chain matching built-in checkpoints (default: 1) - Prihvati samo lance blokova koji se podudaraju sa ugrađenim checkpoint-ovima (default: 1) - Send trace/debug info to console instead of debug.log file Šalji trace/debug informacije na konzolu umjesto u debug.log datoteku - - Set minimum block size in bytes (default: 0) - Podesite minimalnu veličinu bloka u bajtovima (default: 0) - - - Specify connection timeout in milliseconds (default: 5000) - Odredi vremenski prozor za spajanje na mrežu u milisekundama (ugrađeni izbor: 5000) - - - System error: - Pogreška sistema: - - - Use UPnP to map the listening port (default: 0) - Pokušaj koristiti UPnP da otvoriš port za uslugu (default: 0) - Use UPnP to map the listening port (default: 1 when listening) Pokušaj koristiti UPnP da otvoriš port za uslugu (default: 1 when listening) @@ -1402,10 +1474,6 @@ Adresa:%4 Upgrade wallet to latest format Nadogradite novčanik u posljednji format. - - Set key pool size to <n> (default: 100) - Podesi memorijski prostor za ključeve na <n> (ugrađeni izbor: 100) - Rescan the block chain for missing wallet transactions Ponovno pretraži lanac blokova za transakcije koje nedostaju @@ -1414,14 +1482,6 @@ Adresa:%4 Use OpenSSL (https) for JSON-RPC connections Koristi OpenSSL (https) za JSON-RPC povezivanje - - Server certificate file (default: server.cert) - Uslužnikov SSL certifikat (ugrađeni izbor: server.cert) - - - Server private key (default: server.pem) - Uslužnikov privatni ključ (ugrađeni izbor: server.pem) - This help message Ova poruka za pomoć diff --git a/src/qt/locale/bitcoin_hu.ts b/src/qt/locale/bitcoin_hu.ts index b5eb262442..1edd2511eb 100644 --- a/src/qt/locale/bitcoin_hu.ts +++ b/src/qt/locale/bitcoin_hu.ts @@ -390,10 +390,6 @@ Tabs toolbar Fül eszköztár - - [testnet] - [teszthálózat] - Bitcoin Core Bitcoin Core @@ -434,10 +430,6 @@ No block source available... Blokk forrása ismeretlen... - - Processed %1 blocks of transaction history. - A tranzakció-történet %1 blokkja feldolgozva. - %n hour(s) %n óra%n óra @@ -893,15 +885,7 @@ Cím: %4 Error Hiba - - GB of free space available - GB hely érhető el - - - (of %1GB needed) - ( ebből %1GB szükséges) - - + OpenURIDialog @@ -1062,10 +1046,6 @@ Cím: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. A kijelzett információ lehet, hogy elavult. A pénztárcája automatikusan szinkronizálja magát a Bitcoin hálózattal miután a kapcsolat létrejön, de ez e folyamat még nem fejeződött be. - - Wallet - Tárca - Available: Elérhető: @@ -1098,10 +1078,6 @@ Cím: %4 Your current total balance Aktuális egyenleged - - <b>Recent transactions</b> - <b>Legutóbbi tranzakciók</b> - out of sync Nincs szinkronban. @@ -1289,14 +1265,6 @@ Cím: %4 never soha - - Yes - Igen - - - No - Nem - ReceiveCoinsDialog @@ -2075,16 +2043,6 @@ Cím: %4 Options: Opciók - - - - Specify configuration file (default: bitcoin.conf) - Konfigurációs fájl (alapértelmezett: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - pid-fájl (alapértelmezett: bitcoind.pid) @@ -2092,14 +2050,6 @@ Cím: %4 Adatkönyvtár - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Csatlakozásokhoz figyelendő <port> (alapértelmezett: 8333 or testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Maximálisan <n> számú kapcsolat fenntartása a peerekkel (alapértelmezés: 125) - Connect to a node to retrieve peer addresses, and disconnect Kapcsolódás egy csomóponthoz a peerek címeinek megszerzése miatt, majd szétkapcsolás @@ -2108,18 +2058,6 @@ Cím: %4 Specify your own public address Adja meg az Ön saját nyilvános címét - - Threshold for disconnecting misbehaving peers (default: 100) - Helytelenül viselkedő peerek leválasztási határértéke (alapértelmezés: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Helytelenül viselkedő peerek kizárási ideje másodpercben (alapértelmezés: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - JSON-RPC csatlakozásokhoz figyelendő <port> (alapértelmezett: 8332 or testnet: 18332) - Accept command line and JSON-RPC commands Parancssoros és JSON-RPC parancsok elfogadása @@ -2187,62 +2125,10 @@ Cím: %4 Error: Disk space is low! Hiba: kevés a hely a lemezen! - - Error: system error: - Hiba: rendszerhiba: - Failed to listen on any port. Use -listen=0 if you want this. Egyik hálózati porton sem sikerül hallgatni. Használja a -listen=0 kapcsolót, ha ezt szeretné. - - Failed to read block info - A blokkinformáció olvasása nem sikerült - - - Failed to read block - A blokk olvasása nem sikerült - - - Failed to sync block index - A blokkindex szinkronizálása nem sikerült - - - Failed to write block index - A blokkindex írása nem sikerült - - - Failed to write block info - A blokkinformáció írása nem sikerült - - - Failed to write block - A blokk írása nem sikerült - - - Failed to write file info - A fájlinformáció írása nem sikerült - - - Failed to write to coin database - Az érme-adatbázis írása nem sikerült - - - Failed to write transaction index - A tranzakcióindex írása nem sikerült - - - Failed to write undo data - A stornóadatok írása nem sikerült - - - Generate coins (default: 0) - Érmék generálása (alapértelmezett: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Hány blokkot ellenőrizzen induláskor (alapértelmezett: 288, 0 = mindet) - Importing... Importálás @@ -2283,18 +2169,6 @@ Cím: %4 Invalid amount for -mintxfee=<amount>: '%s' Érvénytelen -mintxfee=<amount>: '%s' összeg - - Maintain a full transaction index (default: 0) - Teljes tranzakcióindex megőrzése (alapértelmezett: 0) - - - Only accept block chain matching built-in checkpoints (default: 1) - Csak blokklánccal egyező beépített ellenőrző pontok elfogadása (alapértelmezés: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Csak a <net> hálózat csomópontjaihoz kapcsolódjon (IPv4, IPv6 vagy Tor) - Send trace/debug info to console instead of debug.log file trace/debug információ küldése a konzolra a debog.log fájl helyett @@ -2303,14 +2177,6 @@ Cím: %4 Signing transaction failed Tranzakció aláírása sikertelen - - Specify connection timeout in milliseconds (default: 5000) - Csatlakozás időkerete milliszekundumban (alapértelmezett: 5000) - - - System error: - Rendszerhiba: - This is experimental software. Ez egy kísérleti szoftver. @@ -2327,10 +2193,6 @@ Cím: %4 Transaction too large Túl nagy tranzakció - - Use UPnP to map the listening port (default: 0) - UPnP-használat engedélyezése a figyelő port feltérképezésénél (default: 0) - Use UPnP to map the listening port (default: 1 when listening) UPnP-használat engedélyezése a figyelő port feltérképezésénél (default: 1 when listening) @@ -2357,11 +2219,6 @@ Cím: %4 Upgrade wallet to latest format A Tárca frissítése a legfrissebb formátumra - - Set key pool size to <n> (default: 100) - Kulcskarika mérete <n> (alapértelmezett: 100) - - Rescan the block chain for missing wallet transactions Blokklánc újraszkennelése hiányzó tárca-tranzakciók után @@ -2370,16 +2227,6 @@ Cím: %4 Use OpenSSL (https) for JSON-RPC connections OpenSSL (https) használata JSON-RPC csatalkozásokhoz - - - - Server certificate file (default: server.cert) - Szervertanúsítvány-fájl (alapértelmezett: server.cert) - - - - Server private key (default: server.pem) - Szerver titkos kulcsa (alapértelmezett: server.pem) diff --git a/src/qt/locale/bitcoin_id_ID.ts b/src/qt/locale/bitcoin_id_ID.ts index 80d4141beb..6056c3a736 100644 --- a/src/qt/locale/bitcoin_id_ID.ts +++ b/src/qt/locale/bitcoin_id_ID.ts @@ -278,6 +278,10 @@ Open &URI... Buka &URI + + Bitcoin Core client + Client Bitcoin Inti + Importing blocks from disk... Blok-blok sedang di-impor dari disk @@ -330,6 +334,10 @@ &Receive &Menerima + + Show information about Bitcoin Core + Tampilkan informasi tentang Bitcoin Inti + &Show / Hide &Sunjukkan / Menyembungi @@ -366,10 +374,6 @@ Tabs toolbar Baris tab - - [testnet] - [testnet] - Bitcoin Core Bitcoin Core @@ -410,10 +414,6 @@ No block source available... Sumber blok tidak tersedia... - - Processed %1 blocks of transaction history. - %1 blok-blok riwayat transaksi telah diproses - %n hour(s) %n jam @@ -852,15 +852,11 @@ Alamat: %4 Error Gagal - - GB of free space available - GB di hard disk yang masih tersedia + + %n GB of free space available + %n GB dari ruang yang tersedia - - (of %1GB needed) - (dari %1GB yang diperlu) - - + OpenURIDialog @@ -1077,10 +1073,6 @@ Alamat: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Informasi terlampir mungkin sudah kedaluwarsa. Dompet Anda secara otomatis mensinkronisasi dengan jaringan Bitcoin ketika sebuah hubungan terbentuk, namun proses ini belum selesai. - - Wallet - Dompet - Available: Tersedia: @@ -1113,10 +1105,6 @@ Alamat: %4 Your current total balance Jumlah saldo Anda sekarang - - <b>Recent transactions</b> - <b>Transaksi sebelumnya</b> - out of sync tidak tersinkron @@ -2314,26 +2302,10 @@ Alamat: %4 Options: Pilihan: - - Specify configuration file (default: bitcoin.conf) - Tentukan berkas konfigurasi (standar: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Tentukan berkas pid (standar: bitcoind.pid) - Specify data directory Tentukan direktori data - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Menerima hubungan pada <port> (standar: 8333 atau testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Mengatur hubungan paling banyak <n> ke peer (standar: 125) - Connect to a node to retrieve peer addresses, and disconnect Hubungkan ke node untuk menerima alamat peer, dan putuskan @@ -2342,14 +2314,6 @@ Alamat: %4 Specify your own public address Tentukan alamat publik Anda sendiri - - Threshold for disconnecting misbehaving peers (default: 100) - Batas untuk memutuskan peer buruk (standar: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Jumlah kedua untuk menjaga peer buruk dari hubung-ulang (standar: 86400) - Accept command line and JSON-RPC commands Menerima perintah baris perintah dan JSON-RPC @@ -2366,10 +2330,6 @@ Alamat: %4 Accept connections from outside (default: 1 if no -proxy or -connect) Terima hubungan dari luar (standar: 1 kalau -proxy atau -connect tidak dipilih) - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Sandi yang diterima (biasanya: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Gagal: Transaksi ditolak. Ini mungkin terjadi jika beberapa dari koin dalam dompet Anda telah digunakan, seperti ketika Anda menggunakan salinan wallet.dat dan beberapa koin telah dibelanjakan dalam salinan tersebut tetapi disini tidak tertandai sebagai terpakai. @@ -2382,10 +2342,6 @@ Alamat: %4 Unable to bind to %s on this computer. Bitcoin Core is probably already running. Tidak bisa mengikat dengan %s di computer ini. Kemungkinan Bitcoin Core sudah mulai. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Gunakanlah proxy SOCKS5 yang tersendiri supaya menghubungkan peer dengan layanan tersembunyi Tor (biasanya: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Peringatan: -paytxfee sangat besar! Ini adalah biaya pengiriman yang akan dibayar oleh Anda jika transaksi terkirim. @@ -2406,10 +2362,6 @@ Alamat: %4 (default: 1) (pengaturan awal: 1) - - (default: wallet.dat) - (pengaturan awal: wallet.dat) - Attempt to recover private keys from a corrupt wallet.dat Coba memulihkan kunci-kunci pribadi dari wallet.dat yang rusak @@ -2466,58 +2418,6 @@ Alamat: %4 Error: Wallet locked, unable to create transaction! Gagal: Dompet terkunci, transaksi tidak bisa dibuat! - - Error: system error: - Error: system error: - - - Failed to read block info - Gagal membaca informasi dari blok - - - Failed to read block - Gagal membaca blok - - - Failed to sync block index - Gagal menyamakan daftar isi blok - - - Failed to write block index - Gagal menulis daftar isi blok - - - Failed to write block info - Gagal menulis info blok - - - Failed to write block - Gagal menulis blok - - - Failed to write file info - Gagal menulis info arsip - - - Failed to write to coin database - Gagal menuliskan ke dalam database koin - - - Failed to write transaction index - Gagal menulis daftar isi transaksi - - - Failed to write undo data - Gagal menulis ulang data - - - Generate coins (default: 0) - Buatlah koin (biasanya: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Periksakan berapa blok waktu mulai (biasanya: 288, 0 = setiapnya) - Importing... mengimpor... @@ -2538,18 +2438,10 @@ Alamat: %4 Set maximum block size in bytes (default: %d) Atur ukuran maksimal untuk blok dalam byte (biasanya: %d) - - Set the number of threads to service RPC calls (default: 4) - Mengatur jumlah urutan untuk layanan panggilan RPC (pengaturan awal: 4) - Specify wallet file (within data directory) Tentukan arsip dompet (dalam direktori data) - - Spend unconfirmed change when sending transactions (default: 1) - Perubahan saldo untuk transaksi yang belum dikonfirmasi setelah transaksi terkirim (default: 1) - Verifying blocks... Blok-blok sedang diverifikasi... @@ -2590,14 +2482,6 @@ Alamat: %4 Invalid amount for -mintxfee=<amount>: '%s' Nilai yang salah untuk -mintxfee=<amount>: '%s' - - Maintain a full transaction index (default: 0) - Jaga daftar transaksi yang lengkap (biasanya: 0) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Dilarang menghubungkan node-node selain <net> (IPv4, IPv6 atau Tor) - RPC server options: Opsi server RPC: @@ -2606,10 +2490,6 @@ Alamat: %4 Send trace/debug info to console instead of debug.log file Kirim info jejak/debug ke konsol bukan berkas debug.log - - Set minimum block size in bytes (default: 0) - Atur ukuran minimal untuk blok dalam byte (standar: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Mengecilkan berkas debug.log saat klien berjalan (Standar: 1 jika tidak -debug) @@ -2618,14 +2498,6 @@ Alamat: %4 Signing transaction failed Tandatangani transaksi tergagal - - Specify connection timeout in milliseconds (default: 5000) - Menetapkan waktu berakhir koneksi di milidetik (biasanya: 5000) - - - System error: - Kesalahan sistem: - Transaction amount too small Nilai transaksi terlalu kecil @@ -2670,10 +2542,6 @@ Alamat: %4 Upgrade wallet to latest format Perbarui dompet ke format terbaru - - Set key pool size to <n> (default: 100) - Kirim ukuran kolam kunci ke <n> (standar: 100) - Rescan the block chain for missing wallet transactions Pindai ulang rantai-blok untuk transaksi dompet yang hilang @@ -2682,14 +2550,6 @@ Alamat: %4 Use OpenSSL (https) for JSON-RPC connections Gunakan OpenSSL (https) untuk hubungan JSON-RPC - - Server certificate file (default: server.cert) - Berkas sertifikat server (standar: server.cert) - - - Server private key (default: server.pem) - Kunci pribadi server (standar: server.pem) - This help message Pesan bantuan ini diff --git a/src/qt/locale/bitcoin_it.ts b/src/qt/locale/bitcoin_it.ts index a803241d10..ddc7e44c47 100644 --- a/src/qt/locale/bitcoin_it.ts +++ b/src/qt/locale/bitcoin_it.ts @@ -35,7 +35,7 @@ Export the data in the current tab to a file - Esporta su file i dati della tabella corrente + Esporta i dati nella tabella corrente in un file &Export @@ -93,7 +93,11 @@ Exporting Failed Esportazione Fallita. - + + There was an error trying to save the address list to %1. Please try again. + Si è verificato un errore tentando di salvare la lista degli indirizzi. %1. Riprova + + AddressTableModel @@ -113,19 +117,19 @@ AskPassphraseDialog Passphrase Dialog - Finestra passphrase + Finestra parola d'ordine Enter passphrase - Inserisci la passphrase + Inserisci la parola d'ordine New passphrase - Nuova passphrase + Nuova parola d'ordine Repeat new passphrase - Ripeti la nuova passphrase + Ripeti la nuova parola d'ordine Encrypt wallet @@ -179,6 +183,10 @@ Wallet encrypted Portamonete cifrato + + 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>. + Inserisci una nuona password per il postafoglio.<br/>Perfavore usa una password di<b>dieci o più caratteri</b>, o <b>otto o più parole</b>. + Bitcoin 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. Bitcoin si chiuderà per portare a termine il processo di cifratura. Ricorda che cifrare il tuo portamonete non può fornire una protezione totale contro i furti causati da infezioni malware. @@ -286,6 +294,10 @@ Open &URI... Apri &URI... + + Bitcoin Core client + Bitcoin Core client + Importing blocks from disk... Importazione blocchi dal disco... @@ -338,6 +350,10 @@ &Receive &Ricevi + + Show information about Bitcoin Core + Mostra le informazioni riguardo a Bitcoin core + &Show / Hide &Mostra / Nascondi @@ -374,10 +390,6 @@ Tabs toolbar Barra degli strumenti "Tabs" - - [testnet] - [testnet] - Bitcoin Core Bitcoin Core @@ -418,10 +430,6 @@ No block source available... Nessuna fonte di blocchi disponibile - - Processed %1 blocks of transaction history. - Processati %1 blocchi della cronologia transazioni. - %n hour(s) %n ora%n ore @@ -537,6 +545,10 @@ Indirizzo: %4 Fee: Commissione: + + Dust: + Importo + After Fee: Dopo Commissione: @@ -625,6 +637,10 @@ Indirizzo: %4 Copy priority Copia priorità + + Copy dust + Copia l'importo + Copy change Copia resto @@ -673,6 +689,10 @@ Indirizzo: %4 none nessuno + + Can vary +/- %1 satoshi(s) per input. + Può variare +/- %1 satoshi(s) per input. + yes @@ -881,19 +901,15 @@ Indirizzo: %4 Bitcoin Core Bitcoin Core + + Error: Specified data directory "%1" cannot be created. + Errore: La cartella dati "%1" specificata non può essere creata. + Error Errore - - GB of free space available - GB di spazio libero disponibile - - - (of %1GB needed) - (di %1GB richiesti) - - + OpenURIDialog @@ -955,6 +971,14 @@ Indirizzo: %4 Number of script &verification threads Numero di thread di &verifica degli script + + Accept connections from outside + Accetta connessioni da fuori + + + Allow incoming connections + Permetti connessioni in entrata + Connect to the Bitcoin network through a SOCKS proxy. Connessione alla rete Bitcoin attraverso un proxy SOCKS. @@ -1128,8 +1152,8 @@ Più URL vengono separati da una barra verticale |. Le informazioni visualizzate potrebbero non essere aggiornate. Il portamonete si sincronizza automaticamente con la rete Bitcoin una volta stabilita una connessione, ma questo processo non è ancora stato completato. - Wallet - Portamonete + Watch-only: + Guarda solo Available: @@ -1155,6 +1179,10 @@ Più URL vengono separati da una barra verticale |. Mined balance that has not yet matured Importo generato dal mining e non ancora maturato + + Balances + Saldo + Total: Totale: @@ -1164,8 +1192,20 @@ Più URL vengono separati da una barra verticale |. Saldo totale attuale - <b>Recent transactions</b> - <b>Transazioni recenti</b> + Your current balance in watch-only addresses + Il tuo saldo attuale negli indirizzi watch-only + + + Spendable: + Saldo Spendibile: + + + Recent transactions + Transazioni recenti + + + Unconfirmed transactions to watch-only addresses + Transazioni non confermate su indirizzi di sola lettura out of sync @@ -1182,6 +1222,22 @@ Più URL vengono separati da una barra verticale |. Invalid payment address %1 Indirizzo di pagamento non valido %1 + + Payment request rejected + Richiesta di pagamento rifiutata + + + Payment request network doesn't match client network. + Il network della richiesta di pagamento non corrisponde al network del client. + + + Payment request has expired. + Richieda di pagamento scaduta + + + Payment request is not initialized. + La richiesta di pagamento non è stata inizializzata. + Requested payment amount of %1 is too small (considered dust). L'importo di pagamento richiesto di %1 è troppo basso (considerato come trascurabile). @@ -1198,10 +1254,18 @@ Più URL vengono separati da una barra verticale |. Payment request fetch URL is invalid: %1 URL di recupero della Richiesta di pagamento non valido: %1 + + URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + Impossibile interpretare l'URI! Ciò può essere causato da un indirizzo Bitcoin invalido o da parametri URI non corretti. + Payment request file handling Gestione del file di richiesta del pagamento + + Payment request file cannot be read! This can be caused by an invalid payment request file. + Il file di richiesta del pagamento non può essere letto o elaborato! Questo può essere causato da una richiesta di pagamento non valida. + Unverified payment requests to custom payment scripts are unsupported. Le richieste di pagamento non verificate verso script di pagamento personalizzati non sono supportate. @@ -1214,6 +1278,10 @@ Più URL vengono separati da una barra verticale |. Error communicating with %1: %2 Errore di comunicazione con %1: %2 + + Payment request cannot be parsed! + La richiesta di pagamento non può essere analizzata. + Bad response from server %1 Risposta errata da parte del server %1 @@ -1229,13 +1297,29 @@ Più URL vengono separati da una barra verticale |. PeerTableModel - + + User Agent + User Agent + + + Address/Hostname + Indirizzo/Hostname + + + Ping Time + Tempo di ping + + QObject Amount Importo + + Enter a Bitcoin address (e.g. %1) + Inserisci un indirizzo Bitcoin (e.g. %1) + %1 d %1 d @@ -1252,11 +1336,27 @@ Più URL vengono separati da una barra verticale |. %1 s %1 s + + NETWORK + RETE + + + UNKNOWN + SCONOSCIUTO + + + None + Nessuno + N/A N/D - + + %1 ms + %1 ms + + QRImageWidget @@ -1306,6 +1406,10 @@ Più URL vengono separati da una barra verticale |. Using OpenSSL version Versione OpenSSL in uso + + Using BerkeleyDB version + Versione BerkeleyDB in uso + Startup time Tempo di avvio @@ -1330,6 +1434,66 @@ Più URL vengono separati da una barra verticale |. Current number of blocks Numero attuale di blocchi + + Received + Ricevuto + + + Sent + Inviato + + + &Peers + &Peers + + + Select a peer to view detailed information. + Seleziona un peer per visualizzare informazioni più dettagliate. + + + Direction + Direzione + + + Version + Versione + + + User Agent + User Agent + + + Services + Servizi + + + Starting Height + Blocco di partenza + + + Connection Time + Tempo di connessione + + + Last Send + Ultimo invio + + + Last Receive + Ultima ricevuta + + + Bytes Sent + Bytes Inviati + + + Bytes Received + Bytes Ricevuti + + + Ping Time + Tempo di Ping + Last block time Ora del blocco più recente @@ -1406,17 +1570,25 @@ Più URL vengono separati da una barra verticale |. %1 GB %1 GB + + via %1 + via %1 + never mai - Yes - Si + Inbound + In entrata - No - No + Outbound + In uscita + + + Unknown + Sconosciuto @@ -1658,6 +1830,10 @@ Più URL vengono separati da una barra verticale |. Clear all fields of the form. Cancellare tutti i campi del modulo. + + Dust: + Trascurabile + Clear &All Cancella &tutto @@ -1758,6 +1934,10 @@ Più URL vengono separati da una barra verticale |. Warning: Unknown change address Attenzione: Indirizzo per il resto sconosciuto + + Copy dust + Copia l'importo + Are you sure you want to send? Sei sicuro di voler inviare? @@ -1793,6 +1973,10 @@ Più URL vengono separati da una barra verticale |. This is a normal payment. Questo è un normale pagamento. + + The Bitcoin address to send the payment to + L'indirizzo Bitcoin a cui vuoi inviare il pagamento + Alt+A Alt+A @@ -1863,6 +2047,10 @@ Più URL vengono separati da una barra verticale |. You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Puoi firmare messaggi con i tuoi indirizzi in modo da dimostrarne il possesso. Presta attenzione a non firmare dichiarazioni vaghe, attacchi di phishing potrebbero cercare di spingerti ad apporre la tua firma su di esse. Firma solo dichiarazioni completamente dettagliate e delle quali condividi in pieno il contenuto. + + The Bitcoin address to sign the message with + L'indirizzo Bitcoin con cui vuoi contrassegnare il messaggio + Choose previously used address Scegli un indirizzo usato precedentemente @@ -1915,6 +2103,10 @@ Più URL vengono separati da una barra verticale |. Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Inserisci l'indirizzo del firmatario, il messaggio (assicurati di copiare esattamente anche i ritorni a capo, gli spazi, le tabulazioni, etc..) e la firma qui sotto, per verificare il messaggio. Presta attenzione a non vedere nella firma più di quanto non sia riportato nel messaggio stesso, per evitare di cadere vittima di attacchi di tipo man-in-the-middle. + + The Bitcoin address the message was signed with + L'indirizzo Bitcoin con cui è stato contrassegnato il messaggio + Verify the message to ensure it was signed with the specified Bitcoin address Verifica il messaggio per accertare che sia stato firmato con l'indirizzo specificato @@ -2056,6 +2248,10 @@ Più URL vengono separati da una barra verticale |. own address proprio indirizzo + + watch-only + Guarda solo + label etichetta @@ -2076,6 +2272,14 @@ Più URL vengono separati da una barra verticale |. Debit Debito + + Total debit + Credito Totale + + + Total credit + Credito totale + Transaction fee Commissione transazione @@ -2226,6 +2430,10 @@ Più URL vengono separati da una barra verticale |. Mined Ottenuto dal mining + + watch-only + Guarda solo + (n/a) (N / a) @@ -2337,6 +2545,10 @@ Più URL vengono separati da una barra verticale |. Export Transaction History Esporta lo storico delle transazioni + + Watch-only + Sola lettura + Exporting Failed Esportazione Fallita. @@ -2392,7 +2604,11 @@ Più URL vengono separati da una barra verticale |. UnitDisplayStatusBarControl - + + Unit to show amounts in. Click to select another unit. + Tipo di unità visualizzata. Clicca per selezionare un altra unità + + WalletFrame @@ -2448,26 +2664,10 @@ Più URL vengono separati da una barra verticale |. Options: Opzioni: - - Specify configuration file (default: bitcoin.conf) - Specifica il file di configurazione (predefinito: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Specifica il file pid (predefinito: bitcoind.pid) - Specify data directory Specifica la cartella dati - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Attendi le connessioni su <porta> (predefinita: 8333 o testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Mantieni al massimo <n> connessioni ai peer (predefinite: 125) - Connect to a node to retrieve peer addresses, and disconnect Connettiti ad un nodo per recuperare gli indirizzi dei peer e scollegati @@ -2476,18 +2676,6 @@ Più URL vengono separati da una barra verticale |. Specify your own public address Specifica il tuo indirizzo pubblico - - Threshold for disconnecting misbehaving peers (default: 100) - Soglia di disconnessione dei peer di cattiva qualità (predefinita: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Numero di secondi di sospensione che i peer di cattiva qualità devono attendere prima di potersi riconnettere (predefiniti: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Attendi le connessioni JSON-RPC su <porta> (predefinita: 8332 or testnet: 18332) - Accept command line and JSON-RPC commands Accetta comandi da riga di comando e JSON-RPC @@ -2528,17 +2716,13 @@ Si raccomanda anche di impostare alertnotify così sarai avvisato di eventuali p ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Cifrature accettabili (predefinito: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Associa all'indirizzo indicato e resta permanentemente in ascolto su questo. Usa la notazione [host]:porta per l'IPv6 - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - Limita la quantità di transazioni gratuite ad <n>*1000 byte al minuto (predefinito: 15) + Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup + Elimina tutte le transazioni dal wallet e recupera solo le parti della blockchain con il comando -rescan all'avvio. Enter regression test mode, which uses a special chain in which blocks can be solved instantly. @@ -2556,14 +2740,6 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Esegui comando quando una transazione del portamonete cambia (%s in cmd è sostituito da TxID) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - Scarica l'attività del database dalla memoria al log su disco ogni <n> megabytes (predefinito: 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - Determina quanto sarà approfondita la verifica da parte di -checkblocks (0-4, predefinito: 3) - In this mode -genproclimit controls how many blocks are generated immediately. In questa modalità -genproclimit determina quanti blocchi saranno generati immediatamente. @@ -2572,10 +2748,6 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Imposta il numero di thread per la verifica degli script (da %u a %d, 0 = automatico, <0 = lascia questo numero di core liberi, predefinito: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - Imposta il limite della cpu quando la generazione è abilitata (-1 = non limitato, predefinito: -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Questa versione è una compilazione pre-rilascio - usala a tuo rischio - non utilizzarla per la generazione o per applicazioni di commercio @@ -2584,10 +2756,6 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com Unable to bind to %s on this computer. Bitcoin Core is probably already running. Impossibile associarsi a %s su questo computer. Probabilmente Bitcoin Core è già in esecuzione. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Usa un SOCKS5 proxy separato per raggiungere servizi nascosti di Tor (predefinito: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Attenzione: -paytxfee è molto alta. Questa è la commissione che si paga quando si invia una transazione. @@ -2612,10 +2780,6 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com (default: 1) (predefinito: 1) - - (default: wallet.dat) - (predefinito: wallet.dat) - <category> can be: <category> può essere: @@ -2644,10 +2808,6 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com Debugging/Testing options: Opzioni di Debug/Test: - - Disable safemode, override a real safe mode event (default: 0) - Disabilita la modalità sicura, escludi effettivamente gli eventi di modalità sicura (predefinito: 0) - Discover own IP address (default: 1 when listening and no -externalip) Scopre il proprio indirizzo IP (predefinito: 1 se in ascolto e no -externalip) @@ -2676,6 +2836,10 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com Error opening block database Errore caricamento database blocchi + + Error: A fatal internal error occured, see debug.log for details + Errore: si è verificato un errore fatale, consulta il file debug.log for maggiori dettagli. + Error: Disk space is low! Errore: la spazio libero sul disco è insufficiente! @@ -2684,66 +2848,10 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com Error: Wallet locked, unable to create transaction! Errore: portamonete bloccato, impossibile creare la transazione! - - Error: system error: - Errore: errore di sistema: - Failed to listen on any port. Use -listen=0 if you want this. Nessuna porta disponibile per l'ascolto. Usa -listen=0 se vuoi procedere comunque. - - Failed to read block info - Lettura informazioni blocco fallita - - - Failed to read block - Lettura blocco fallita - - - Failed to sync block index - Sincronizzazione dell'indice del blocco fallita - - - Failed to write block index - Scrittura dell'indice del blocco fallita - - - Failed to write block info - Scrittura informazioni blocco fallita - - - Failed to write block - Scrittura blocco fallita - - - Failed to write file info - Scrittura informazioni file fallita - - - Failed to write to coin database - Scrittura nel database dei bitcoin fallita - - - Failed to write transaction index - Scrittura dell'indice di transazione fallita - - - Failed to write undo data - Scrittura dei dati di ripristino fallita - - - Force safe mode (default: 0) - Forza modalità provvisoria (predefinito: 0) - - - Generate coins (default: 0) - Genera Bitcoin (predefinito: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Numero di blocchi da controllare all'avvio (predefinito: 288, 0 = tutti) - If <category> is not supplied, output all debugging information. Se <category> non è specificata, mostra tutte le informazioni di debug. @@ -2765,8 +2873,8 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com Non ci sono abbastanza descrittori di file disponibili. - Prepend debug output with timestamp (default: 1) - Preponi timestamp all'output di debug (predefinito: 1) + Only connect to nodes in network <net> (ipv4, ipv6 or onion) + Connetti solo ai nodi nella rete <net> (ipv4, ipv6 o Tor) Rebuild block chain index from current blk000??.dat files @@ -2780,18 +2888,10 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com Set maximum block size in bytes (default: %d) Imposta la dimensione massima del blocco in byte (predefinita: %d) - - Set the number of threads to service RPC calls (default: 4) - Specifica il numero massimo di richieste RPC in parallelo (predefinito: 4) - Specify wallet file (within data directory) Specifica il file portamonete (all'interno della cartella dati) - - Spend unconfirmed change when sending transactions (default: 1) - Spendi il resto non confermato quando si inviano transazioni (predefinito: 1) - This is intended for regression testing tools and app development. Questo è previsto per l'uso con test di regressione e per lo sviluppo di applicazioni. @@ -2820,17 +2920,29 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com Imports blocks from external blk000??.dat file Importa blocchi da un file blk000??.dat esterno + + An error occurred while setting up the RPC address %s port %u for listening: %s + Si è verificato un errore durante l'impostazione della %s porta %u RPC per l'ascolto su: %s + Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. Non è possibile ottenere un lock sulla cartella %s. Probabilmente Bitcoin Core è già in esecuzione. + + Error: Listening for incoming connections failed (listen returned error %s) + Errore: l'ascolto per per connessioni in arrivo fallito (errore riportato %s) + Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Esegue un comando quando viene ricevuto un allarme rilevante o quando vediamo un fork veramente lungo (%s in cmd è sostituito dal messaggio) - Output debugging information (default: 0, supplying <category> is optional) - Emette informazioni di debug in output (predefinito: 0, fornire <category> è opzionale) + Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) + Le commissioni (in BTC/kb) minori di questa saranno considerate nulle per la trasmissione (predefinito: %s) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) + Le commissioni inferiori a questo valore saranno considerate nulle per la creazione della transazione (predefinito: %s) Set maximum size of high-priority/low-fee transactions in bytes (default: %d) @@ -2849,41 +2961,13 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com Importo non valido per -mintxfee=<amount>: '%s' - Limit size of signature cache to <n> entries (default: 50000) - Limita la dimensione della cache delle firme a <n> voci (predefinito: 50000) - - - Log transaction priority and fee per kB when mining blocks (default: 0) - Abilita il log della priorità di transazione e della commissione per kB quando si generano blocchi (default: 0) - - - Maintain a full transaction index (default: 0) - Mantieni un indice di transazione completo (predefinito: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Buffer di ricezione massimo per connessione, <n>*1000 byte (predefinito: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Buffer di invio massimo per connessione, <n>*1000 byte (predefinito: 1000) - - - Only accept block chain matching built-in checkpoints (default: 1) - Accetta solo una catena di blocchi che corrisponde ai checkpoint predefiniti (predefinito: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Connetti solo a nodi nella rete <net> (IPv4, IPv6 o Tor) + Node relay options: + Opzioni relay nodo: Print block on startup, if found in block index Stampa il blocco all'avvio, se presente nell'indice dei blocchi - - Print block tree on startup (default: 0) - Stampa l'albero dei blocchi all'avvio (default: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) Opzioni RPC SSL: (consulta la Bitcoin Wiki per le istruzioni relative alla configurazione SSL) @@ -2900,22 +2984,10 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com Randomly fuzz 1 of every <n> network messages Altera casualmente 1 ogni <n> messaggi di rete - - Run a thread to flush wallet periodically (default: 1) - Mantieni in esecuzione un thread per scaricare periodicamente il portafoglio (predefinito: 1) - Send trace/debug info to console instead of debug.log file Invia le informazioni di trace/debug alla console invece che al file debug.log - - Set minimum block size in bytes (default: 0) - Imposta dimensione minima del blocco in bytes (predefinita: 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - Imposta il flag DB_PRIVATE nell'ambiente di database del portamonete (predefinito: 1) - Show all debugging options (usage: --help -help-debug) Mostra tutte le opzioni di debug (utilizzo: --help -help-debug) @@ -2928,14 +3000,6 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com Signing transaction failed Transazione di firma fallita - - Specify connection timeout in milliseconds (default: 5000) - Specifica il timeout di connessione in millisecondi (predefinito: 5000) - - - System error: - Errore di sistema: - This is experimental software. Questo è un software sperimentale. @@ -2952,10 +3016,6 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com Transaction too large Transazione troppo grande - - Use UPnP to map the listening port (default: 0) - Usa UPnP per mappare la porta in ascolto (predefinito: 0) - Use UPnP to map the listening port (default: 1 when listening) Usa UPnP per mappare la porta in ascolto (predefinito: 1 when listening) @@ -2965,6 +3025,10 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com Nome utente per connessioni JSON-RPC + + Wallet needed to be rewritten: restart Bitcoin Core to complete + Il wallet ha bisogno di essere reiscritto : riavvia Bitcoin Core per completare l'operazione + Warning Attenzione @@ -2998,10 +3062,6 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com Upgrade wallet to latest format Aggiorna il wallet all'ultimo formato - - Set key pool size to <n> (default: 100) - Impostare la quantità di chiavi nel key pool a <n> (predefinita: 100) - Rescan the block chain for missing wallet transactions Ripeti analisi della catena dei blocchi per cercare le transazioni mancanti dal portamonete @@ -3012,14 +3072,6 @@ ad esempio: alertnotify=echo %%s | mail -s "Allarme Bitcoin" admin@foo.com Utilizzare OpenSSL (https) per le connessioni JSON-RPC - - Server certificate file (default: server.cert) - File certificato del server (predefinito: server.cert) - - - Server private key (default: server.pem) - Chiave privata del server (predefinito: server.pem) - This help message Questo messaggio di aiuto diff --git a/src/qt/locale/bitcoin_ja.ts b/src/qt/locale/bitcoin_ja.ts index f056dd401e..c6ba60ec48 100644 --- a/src/qt/locale/bitcoin_ja.ts +++ b/src/qt/locale/bitcoin_ja.ts @@ -370,10 +370,6 @@ Tabs toolbar タブツールバー - - [testnet] - [testnet] - Bitcoin Core Bitcoin のコア @@ -398,10 +394,6 @@ No block source available... 利用可能なブロックがありません... - - Processed %1 blocks of transaction history. - 取引履歴の %1 ブロックを処理しました。 - %n hour(s) %n 時間 @@ -727,6 +719,10 @@ Address: %4 Welcome ようこそ + + Welcome to Bitcoin Core. + ようこそ! + Use the default data directory 初期値のデータ ディレクトリを使用 @@ -743,15 +739,7 @@ Address: %4 Error エラー - - GB of free space available - GBの利用可能な空き領域 - - - (of %1GB needed) - (%1GB が必要) - - + OpenURIDialog @@ -932,10 +920,6 @@ Address: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. 表示された情報は古いかもしれません。接続が確立されると、あなたのウォレットは Bitcoin ネットワークと自動的に同期しますが、このプロセスはまだ完了していません。 - - Wallet - ウォレット - Your current spendable balance あなたの利用可能残高 @@ -960,10 +944,6 @@ Address: %4 Your current total balance あなたの現在の残高 - - <b>Recent transactions</b> - <b>最近の取引</b> - out of sync 同期していない @@ -2029,26 +2009,10 @@ Address: %4 Options: オプション: - - Specify configuration file (default: bitcoin.conf) - 設定ファイルの指定 (初期値: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - pid ファイルの指定 (初期値: bitcoind.pid) - Specify data directory データ ディレクトリの指定 - - Listen for connections on <port> (default: 8333 or testnet: 18333) - 接続のポート番号 (初期値: 8333、testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - ピアの最大接続数 (初期値: 125) - Connect to a node to retrieve peer addresses, and disconnect ピア アドレスを取得するためにノードに接続し、そして切断します @@ -2057,18 +2021,6 @@ Address: %4 Specify your own public address あなた自身のパブリックなアドレスを指定 - - Threshold for disconnecting misbehaving peers (default: 100) - 不正なピアを切断するためのしきい値 (初期値: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - 不正なピアを再接続するまでの秒数 (初期値: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - <port> で JSON-RPC 接続をリスン (初期値: 8332、testnet は 18332) - Accept command line and JSON-RPC commands コマンドラインと JSON-RPC コマンドを許可 @@ -2152,10 +2104,6 @@ rpcpassword=%s (default: 1) (デフォルト: 1) - - (default: wallet.dat) - (デフォルト: wallet.dat) - Attempt to recover private keys from a corrupt wallet.dat 壊れた wallet.dat から秘密鍵を復旧することを試す @@ -2209,66 +2157,10 @@ rpcpassword=%s Error: Wallet locked, unable to create transaction! エラー: ウォレットはロックされ、取引を作成できません! - - Error: system error: - エラー: システム エラー: - Failed to listen on any port. Use -listen=0 if you want this. ポートのリスンに失敗しました。必要であれば -listen=0 を使用してください。 - - Failed to read block info - ブロック情報の読み取りに失敗しました - - - Failed to read block - ブロックの読み取りに失敗しました - - - Failed to sync block index - ブロック インデックスの同期に失敗しました - - - Failed to write block index - ブロック インデックスの書き込みに失敗しました - - - Failed to write block info - ブロック情報の書き込みに失敗しました - - - Failed to write block - ブロックの書き込みに失敗しました - - - Failed to write file info - ファイル情報の書き込みに失敗しました - - - Failed to write to coin database - コインデータベースへの書き込みに失敗しました - - - Failed to write transaction index - 取引インデックスの書き込みに失敗しました - - - Failed to write undo data - 元へ戻すデータの書き込みに失敗しました - - - Force safe mode (default: 0) - セーフモードを矯正する (デフォルト: 0) - - - Generate coins (default: 0) - コインを生成 (初期値: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - 起動時に点検するブロック数 (初期値: 288, 0=すべて) - If <category> is not supplied, output all debugging information. <category> が与えられなかった場合には、すべてのデバッグ情報が出力されます。 @@ -2285,10 +2177,6 @@ rpcpassword=%s Rebuild block chain index from current blk000??.dat files 現在の blk000??.dat ファイルからブロック チェーンのインデックスを再構築 - - Set the number of threads to service RPC calls (default: 4) - RPC サービスのスレッド数を設定 (初期値: 4) - Specify wallet file (within data directory) ウォレットのファイルを指定 (データ・ディレクトリの中に) @@ -2329,34 +2217,6 @@ rpcpassword=%s Invalid amount for -mintxfee=<amount>: '%s' 不正な額 -minrelaytxfee=<amount>: '%s' - - Limit size of signature cache to <n> entries (default: 50000) - 署名キャッシュのサイズを <n> エントリーに制限する (デフォルト: 50000) - - - Log transaction priority and fee per kB when mining blocks (default: 0) - ブロックの採掘時にトランザクションの優先度と1kBあたりの手数料をログに残す (デフォルト: 0) - - - Maintain a full transaction index (default: 0) - 完全な取引インデックスを維持する (初期値: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - 接続毎の最大受信バッファ <n>*1000 バイト (初期値: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - 接続毎の最大送信バッファ <n>*1000 バイト (初期値: 1000) - - - Only accept block chain matching built-in checkpoints (default: 1) - 内蔵のチェックポイントと一致するブロック チェーンのみを許可 (初期値: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - <net> (IPv4, IPv6, Tor) ネットワーク内のノードだけに接続する - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) RPC SSL オプション: (SSLのセットアップ手順はビットコインWikiを参照してください) @@ -2369,10 +2229,6 @@ rpcpassword=%s Send trace/debug info to console instead of debug.log file トレース/デバッグ情報を debug.log ファイルの代わりにコンソールへ送る - - Set minimum block size in bytes (default: 0) - 最小ブロックサイズをバイトで設定 (初期値: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) クライアント起動時に debug.log ファイルを縮小 (初期値: -debug オプションを指定しない場合は1) @@ -2381,14 +2237,6 @@ rpcpassword=%s Signing transaction failed 取引の署名に失敗しました - - Specify connection timeout in milliseconds (default: 5000) - 接続のタイムアウトをミリセコンドで指定 (初期値: 5000) - - - System error: - システム エラー: - Transaction amount too small 取引の額が小さ過ぎます @@ -2401,10 +2249,6 @@ rpcpassword=%s Transaction too large 取引が大き過ぎます - - Use UPnP to map the listening port (default: 0) - リスン ポートの割当に UPnP を使用 (初期値: 0) - Use UPnP to map the listening port (default: 1 when listening) リスン ポートの割当に UPnP を使用 (初期値: リスン中は1) @@ -2437,10 +2281,6 @@ rpcpassword=%s Upgrade wallet to latest format ウォレットを最新のフォーマットにアップグレード - - Set key pool size to <n> (default: 100) - key pool のサイズを <n> (初期値: 100) にセット - Rescan the block chain for missing wallet transactions 失ったウォレットの取引のブロック チェーンを再スキャン @@ -2449,14 +2289,6 @@ rpcpassword=%s Use OpenSSL (https) for JSON-RPC connections JSON-RPC 接続に OpenSSL (https) を使用 - - Server certificate file (default: server.cert) - サーバ証明書ファイル (初期値: server.cert) - - - Server private key (default: server.pem) - サーバの秘密鍵 (初期値: server.pem) - This help message このヘルプ メッセージ diff --git a/src/qt/locale/bitcoin_ka.ts b/src/qt/locale/bitcoin_ka.ts index c23367171d..5a566d4445 100644 --- a/src/qt/locale/bitcoin_ka.ts +++ b/src/qt/locale/bitcoin_ka.ts @@ -374,10 +374,6 @@ Tabs toolbar ბარათების პანელი - - [testnet] - [testnet] - Bitcoin Core Bitcoin Core @@ -414,10 +410,6 @@ No block source available... ბლოკების წყარო მიუწვდომელია... - - Processed %1 blocks of transaction history. - დამუშავებულია ტრანსაქციების ისტორიის %1 ბლოკი. - %1 and %2 %1 და %2 @@ -852,15 +844,7 @@ Address: %4 Error შეცდომა - - GB of free space available - გიგაბაიტია თავისუფალი - - - (of %1GB needed) - (საჭიროა %1GB) - - + OpenURIDialog @@ -1069,10 +1053,6 @@ Address: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. ნაჩვენები ინფორმაცია შეიძლება მოძველებული იყოს. თქვენი საფულე ავტომატურად სინქრონიზდება Bitcoin-ის ქსელთან კავშირის დამყარების შემდეგ, ეს პროცესი ჯერ არ არის დასრულებული. - - Wallet - საფულე - Available: ხელმისაწვდომია: @@ -1105,10 +1085,6 @@ Address: %4 Your current total balance თქვენი სრული მიმდინარე ბალანსი - - <b>Recent transactions</b> - <b>ბოლო ტრანსაქციები</b> - out of sync არ არის სინქრონიზებული @@ -2350,26 +2326,10 @@ Address: %4 Options: ოპციები: - - Specify configuration file (default: bitcoin.conf) - მიუთითეთ საკონფიგურაციო ფაილი (ნაგულისხმევია: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - მიუთითეთ pid ფაილი (ნაგულისხმევია: bitcoind.pid) - Specify data directory მიუთითეთ მონაცემთა კატალოგი - - Listen for connections on <port> (default: 8333 or testnet: 18333) - მიყურადება პორტზე <port> (ნაგულისხმევი: 8333 ან სატესტო ქსელში: 18333) - - - Maintain at most <n> connections to peers (default: 125) - არაუმეტეს <n> შეერთებისა პირებზე (ნაგულისხმევი: 125) - Connect to a node to retrieve peer addresses, and disconnect მიერთება კვანძთან, პირების მისამართების მიღება და გათიშვა @@ -2378,18 +2338,6 @@ Address: %4 Specify your own public address მიუთითეთ თქვენი საჯარო მისამართი - - Threshold for disconnecting misbehaving peers (default: 100) - არასწორად მოქმედი პირების გათიშვის ზღვარი (ნაგულისხმევი:100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - არასწორად მოქმედი პირების ბლოკირების დრო წამებში (ნაგულისხმევი: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - JSON-RPC-შეერთებების მიყურადება პორტზე <port> (ნაგულისხმევი: 8332 ან სატესტო ქსელში: 18332) - Accept command line and JSON-RPC commands საკომანდო სტრიქონისა და JSON-RPC-კომამდების ნებართვა @@ -2430,10 +2378,6 @@ rpcpassword=%s მაგალითად: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - დაშვებული ალგორითმები (ნაგულისხმევი: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 მოცემულ მისამართზე მიჯაჭვა მუდმივად მასზე მიყურადებით. გამოიყენეთ [host]:port ფორმა IPv6-სათვის @@ -2458,10 +2402,6 @@ rpcpassword=%s This is a pre-release test build - use at your own risk - do not use for mining or merchant applications ეს არის წინასწარი სატესტო ვერსია - გამოიყენეთ საკუთარი რისკით - არ გამოიყენოთ მოპოვებისა ან კომერციული მიზნებისათვის - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - ფარული Tor-სერვისებით პირების წვდომისათვის სხვა SOCKS5 პროქსის გამოყენება (ნაგულისხმევია: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. ყურადღება: ძალიან მაღალია -paytxfee - საკომისო, რომელსაც თქვენ გადაიხდით ამ ტრანსაქციის გაგზავნის საფასურად. @@ -2538,62 +2478,10 @@ rpcpassword=%s Error: Wallet locked, unable to create transaction! შეცდომა: საფულე დაბლოკილია, ტრანსაქცია ვერ შეიქმნება! - - Error: system error: - შეცდომა: სისტემური შეცდომა: - Failed to listen on any port. Use -listen=0 if you want this. ვერ ხერხდება პორტების მიყურადება. თუ გსურთ, გამოიყენეთ -listen=0. - - Failed to read block info - ბლოკის ინფორმაცია არ იკითხება - - - Failed to read block - ბლოკი არ იკითხება - - - Failed to sync block index - ბლოკების ინდექსის სინქრონიზება ვერ მოხერხდა - - - Failed to write block index - ბლოკების ინდექსის ჩაწერა ვერ მოხერხდა - - - Failed to write block info - ბლოკის ინფორმაციის ჩაწერა ვერ მოხერხდა - - - Failed to write block - ბლოკის ჩაწერა ვერ მოხერხდა - - - Failed to write file info - ფაილის ინფორმაციის ჩაწერა ვერ მოხერხდა - - - Failed to write to coin database - მონეტების ბაზის ჩაწერა ვერ მოხერხდა - - - Failed to write transaction index - ტრანსაქციების ინდექსის ჩაწერა ვერ მოხერხდა - - - Failed to write undo data - ცვლილებების გაუქმების მონაცემთა ჩაწერა ვერ მოხერხდა - - - Generate coins (default: 0) - მონეტების გენერირება (ნაგულისხმევი: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - რამდენი ბლოკი შემოწმდეს გაშვებისას (ნაგულისხმევი: 288, 0 - ყველა) - If <category> is not supplied, output all debugging information. თუ <category> არ არის მითითებული, ნაჩვენები იქნება სრული დახვეწის ინფორმაცია. @@ -2610,10 +2498,6 @@ rpcpassword=%s Not enough file descriptors available. არ არის საკმარისი ფაილ-დესკრიპტორები. - - Prepend debug output with timestamp (default: 1) - დაემატოს დახვეწის ინფორმაციას დროის ჭდეები (ნაგულისხმევი: 1) - Rebuild block chain index from current blk000??.dat files ბლოკთა ჯაჭვის ინდექსის ხელახლა აგება blk000??.dat ფაილიდან @@ -2622,18 +2506,10 @@ rpcpassword=%s Set maximum block size in bytes (default: %d) ბლოკის მაქსიმალური ზომის განსაზღვრა ბაიტებში (ნადულისხმევი: %d) - - Set the number of threads to service RPC calls (default: 4) - RPC-ნაკადების რაოდენობა (ნაგულისხმევი: 4) - Specify wallet file (within data directory) მიუთითეთ საფულის ფაილი (კატალოგში) - - Spend unconfirmed change when sending transactions (default: 1) - დაუდასტურებელი ხურდის გამოყენება ტრანსაქციის გაგზავნისას (ნაგულისხმევი: 1) - This is intended for regression testing tools and app development. გამოიყენება რეგრესული ტესტირების ინსტრუმენტებისა და პროგრამების შემუშავებისას. @@ -2666,10 +2542,6 @@ rpcpassword=%s Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) ბრძანების შესრულება შესაბამისი უწყების მიღებისას ან როცა შეინიშნება საგრძნობი გახლეჩა (cmd-ში %s შეიცვლება მესიჯით) - - Output debugging information (default: 0, supplying <category> is optional) - დახვეწის ინფორმაციის გამოყვანა (ნაგულისხმევი: 0, <category> - არააუცილებელი არგუმენტია) - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) მაღალპრიორიტეტული/დაბალსაკომისიოიანი ტრანსაქციების მაქსიმალური ზომა ბაიტებში (ნაგულისხმევი: %d) @@ -2686,34 +2558,10 @@ rpcpassword=%s Invalid amount for -mintxfee=<amount>: '%s' დაუშვებელი მნიშვნელობა -mintxfee=<amount>: '%s' - - Maintain a full transaction index (default: 0) - ტრანსაქციის სრული ინდექსი (ნაგულისხმევი: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - მიღების ბუფერის მაქსიმალური ზომა შეერთებაზე, <n>*1000 ბაიტი (ნაგულისხმევი: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - გაგზავნის ბუფერის მაქსიმალური ზომა შეერთებაზე, <n>*1000 ბაიტი (ნაგულისხმევი: 5000) - - - Only accept block chain matching built-in checkpoints (default: 1) - ბლოკთა ჯაჭვი მიიღეთ მხოლოდ მაშინ, თუ ემთხვევა შიდა ჩეკპოინტები (ნაგულისხმევი: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - შეერთება მხოლოდ <net> ქსელის კვანძებთან (IPv4, IPv6 ან Tor) - Send trace/debug info to console instead of debug.log file ტრასირების/დახვეწის ინფოს გაგზავნა კონსოლზე debug.log ფაილის ნაცვლად - - Set minimum block size in bytes (default: 0) - დააყენეთ ბლოკის მინიმალური ზომა ბაიტებში (ნაგულისხმევი: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) debug.log ფაილის შეკუმშვა გაშვებისას (ნაგულისხმევია: 1 როცა არ აყენია -debug) @@ -2722,14 +2570,6 @@ rpcpassword=%s Signing transaction failed ტრანსაქციების ხელმოწერა ვერ მოხერხდა - - Specify connection timeout in milliseconds (default: 5000) - მიუთითეთ შეერთების ტაიმაუტი მილიწამებში (ნაგულისხმევი: 5000) - - - System error: - სისტემური შეცდომა: - Transaction amount too small ტრანსაქციების რაოდენობა ძალიან ცოტაა @@ -2742,10 +2582,6 @@ rpcpassword=%s Transaction too large ტრანსაქცია ძალიან დიდია - - Use UPnP to map the listening port (default: 0) - გამოიყენეთ UPnP მისაყურადებელი პორტის გადასამისამართებლად (ნაგულისხმევი: 0) - Use UPnP to map the listening port (default: 1 when listening) გამოიყენეთ UPnP მისაყურადებელი პორტის გადასამისამართებლად (ნაგულისხმევი: 1 როცა ჩართულია მიყურადება) @@ -2782,10 +2618,6 @@ rpcpassword=%s Upgrade wallet to latest format საფულის ფორმატის განახლება - - Set key pool size to <n> (default: 100) - გასაღების პულის ზომა იქნება <n> (ნაგულისხმევი: 100) - Rescan the block chain for missing wallet transactions ბლოკების ჯაჭვის გადამოწმება საფულეში გამორჩენილ ტრანსაქციებზე @@ -2794,14 +2626,6 @@ rpcpassword=%s Use OpenSSL (https) for JSON-RPC connections OpenSSL-ის (https) გამოყენება JSON-RPC-შეერთებებისათვის - - Server certificate file (default: server.cert) - სერვერის სერტიფიკატის ფაილი (ნაგულისხმევი: server.cert) - - - Server private key (default: server.pem) - სერვერის პირადი გასაღები (ნაგულისხმევი: server.pem) - This help message ეს ტექსტი diff --git a/src/qt/locale/bitcoin_ko_KR.ts b/src/qt/locale/bitcoin_ko_KR.ts index 9fe31b4330..a8a2fbd16a 100644 --- a/src/qt/locale/bitcoin_ko_KR.ts +++ b/src/qt/locale/bitcoin_ko_KR.ts @@ -286,6 +286,10 @@ Open &URI... URI&열기... + + Bitcoin Core client + 비트코인 코어 클라이언트 + Importing blocks from disk... 디스크에서 블록 가져오는 중... @@ -338,6 +342,10 @@ &Receive 받기(&R) + + Show information about Bitcoin Core + 비트코인 코어에 관한 정보입니다. + &Show / Hide 보이기/숨기기(&S) @@ -374,10 +382,6 @@ Tabs toolbar 툴바 색인표 - - [testnet] - [테스트넷] - Bitcoin Core 비트코인 코어 @@ -414,10 +418,6 @@ No block source available... 사용 가능한 블록이 없습니다... - - Processed %1 blocks of transaction history. - %1 블록의 거래 기록들이 처리됨. - %n hour(s) %n시간 @@ -528,10 +528,18 @@ Address: %4 Fee: 수수료: + + Dust: + 더스트: + After Fee: 수수료 이후: + + Change: + 체인지: + (un)select all 모두 선택(하지 않음) @@ -852,15 +860,7 @@ Address: %4 Error 오류 - - GB of free space available - GB가 사용가능 - - - (of %1GB needed) - (%1GB가 필요) - - + OpenURIDialog @@ -922,6 +922,14 @@ Address: %4 Number of script &verification threads 스크립트 인증 쓰레드의 개수 + + Accept connections from outside + 외부로부터의 연결을 승인합니다. + + + Allow incoming connections + 연결 요청을 허용합니다. + Connect to the Bitcoin network through a SOCKS proxy. SOCKS 프록시를 통해 비트코인 네트워크 연결 @@ -1082,8 +1090,8 @@ Address: %4 표시한 정보가 오래된 것 같습니다. 비트코인 네트워크에 연결하고 난 다음에 지갑을 자동으로 동기화 하지만, 아직 과정이 끝나지는 않았습니다. - Wallet - 지갑 + Watch-only: + 모니터링 지갑: Available: @@ -1118,8 +1126,8 @@ Address: %4 당신의 현재 총액 - <b>Recent transactions</b> - <b>최근 거래내역</b> + Your current balance in watch-only addresses + 모니터링 지갑의 현재 잔액 out of sync @@ -1536,6 +1544,10 @@ Address: %4 After Fee: 수수료 이후: + + Change: + 체인지: + Custom change address 주소변경 @@ -1552,6 +1564,10 @@ Address: %4 Clear all fields of the form. 양식의 모든 필드를 지웁니다 + + Dust: + 더스트: + Clear &All 모두 지우기(&A) @@ -2318,26 +2334,10 @@ Address: %4 Options: 옵션: - - Specify configuration file (default: bitcoin.conf) - 설정파일 지정 (기본값: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - pid 파일 지정 (기본값: bitcoind.pid) - Specify data directory 데이터 폴더 지정 - - Listen for connections on <port> (default: 8333 or testnet: 18333) - <port>로 연결을 허용한다 (기본값: 8333 또는 테스트넷: 18333) - - - Maintain at most <n> connections to peers (default: 125) - 가장 잘 연결되는 사용자를 유지합니다(기본값: 125) - Connect to a node to retrieve peer addresses, and disconnect 피어 주소를 받기 위해 노드에 연결하고, 받은 후에 연결을 끊습니다 @@ -2346,18 +2346,6 @@ Address: %4 Specify your own public address 공인 주소를 지정하십시오 - - Threshold for disconnecting misbehaving peers (default: 100) - 이상행동 네트워크 참여자의 연결을 차단시키기 위한 한계치 (기본값: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - 이상행동을 하는 네트워크 참여자들을 다시 연결시키는데 걸리는 시간 (기본값: 86400초) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - 포트 <port>을 통해 JSON-RPC 연결 (기본값: 8332 또는 testnet: 18332) - Accept command line and JSON-RPC commands 명령줄과 JSON-RPC 명령 수락 @@ -2374,10 +2362,6 @@ Address: %4 Accept connections from outside (default: 1 if no -proxy or -connect) 외부 접속을 승인합니다 - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - 암호 허용(기본값: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 선택된 주소로 고정하며 항상 리슨(Listen)합니다. IPv6 프로토콜인 경우 [host]:port 방식의 명령어 표기법을 사용합니다. @@ -2400,10 +2384,6 @@ Address: %4 This is a pre-release test build - use at your own risk - do not use for mining or merchant applications 이 빌드 버전은 정식 출시 전 테스트의 목적이며, 예기치 않은 위험과 오류가 발생할 수 있습니다. 채굴과 상점용 소프트웨어로 사용하는 것을 권하지 않습니다. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Tor 서비스를 이용하여 네트워크에 참여하기 위해서 SOCKS5 프록시를 따로 사용함 (기본값: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. 경고: -paytxfee값이 너무 큽니다! 이 값은 송금할때 지불할 송금 수수료입니다. @@ -2428,10 +2408,6 @@ Address: %4 (default: 1) (기본값: 1) - - (default: wallet.dat) - (기본값: wallet.dat) - Attempt to recover private keys from a corrupt wallet.dat 손상된 wallet.dat에서 개인키 복원을 시도합니다 @@ -2456,10 +2432,6 @@ Address: %4 Debugging/Testing options: 디버그 및 테스트 설정 - - Disable safemode, override a real safe mode event (default: 0) - 안전 모드를 비활성화하고 안전 모드의 이벤트가 발생하더라도 무시합니다. (기본값: 0, 비활성화) - Discover own IP address (default: 1 when listening and no -externalip) 자신의 아이피 주소를 발견합니다 (기본값: 1 반응이 없거나 외부 아이피가 없을 때) @@ -2492,66 +2464,10 @@ Address: %4 Error: Wallet locked, unable to create transaction! 오류: 지갑이 잠금상태여서 거래를 생성할 수 없습니다! - - Error: system error: - 오류: 시스템 오류: - Failed to listen on any port. Use -listen=0 if you want this. 어떤 포트도 반응하지 않습니다. 사용자 반응=0 만약 원한다면 - - Failed to read block info - 블록 정보를 읽는데 실패했습니다 - - - Failed to read block - 블록을 읽는데 실패했습니다 - - - Failed to sync block index - 블록 인덱스를 동기화하는데 실패했습니다 - - - Failed to write block index - 블록 인덱스를 기록하는데 실패했습니다 - - - Failed to write block info - 블록 정보를 기록하는데 실패했습니다 - - - Failed to write block - 블록을 기록하는데 실패했습니다 - - - Failed to write file info - 파일 정보를 기록하는데 실패했습니다 - - - Failed to write to coin database - 코인 데이터베이스에 기록하는데 실패했습니다 - - - Failed to write transaction index - 송금 인덱스에 기록하는데 실패했습니다 - - - Failed to write undo data - 데이터 실행 취소를 기록하는데 실패했습니다 - - - Force safe mode (default: 0) - 안전 모드로 강제 진입하는 기능입니다.(기본값: 0) - - - Generate coins (default: 0) - 코인 생성(기본값: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - 시작할때 검사할 블록 갯수입니다(기본값: 288, 0 = 모두) - Importing... 들여오기 중... @@ -2580,10 +2496,6 @@ Address: %4 Set maximum block size in bytes (default: %d) 최대 블락 크기를 Bytes로 지정하세요 (기본: %d) - - Set the number of threads to service RPC calls (default: 4) - 원격 프로시져 호출 서비스를 위한 쓰레드 개수를 설정합니다 (기본값 : 4) - Specify wallet file (within data directory) 데이터 폴더 안에 지갑 파일을 선택하세요. @@ -2620,10 +2532,6 @@ Address: %4 Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) 이 사항과 관련있는 경고가 발생하거나 아주 긴 포크가 발생했을 때 명령어를 실행해 주세요. (cmd 명령어 목록에서 %s는 메시지로 대체됩니다) - - Output debugging information (default: 0, supplying <category> is optional) - 출력 오류 정보(기본값:0, 임의의 공급 카테고리) - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) 최대 크기를 최우선으로 설정 / 바이트당 최소 수수료로 거래(기본값: %d) @@ -2640,42 +2548,10 @@ Address: %4 Invalid amount for -mintxfee=<amount>: '%s' 최저 거래 수수료가 부족합니다. -mintxfee=<amount>: '%s' - - Limit size of signature cache to <n> entries (default: 50000) - <n>번 째 순서에서 전자서명 캐쉬의 용량을 제한합니다. (기본값: 50000) - - - Log transaction priority and fee per kB when mining blocks (default: 0) - 블럭을 채굴할 때 kB당 거래 우선 순위와 수수료를 로그에 남깁니다. (기본값: 0, 비활성화) - - - Maintain a full transaction index (default: 0) - 전체 거래 지수를 유지합니다(기본값: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - 최대 연결마다 1000bytes 버퍼를 받는다. (기본값: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - 최대 연결 마다 1000bytes 버퍼를 보낸다.(기본값: 1000) - - - Only accept block chain matching built-in checkpoints (default: 1) - 내부 중단점에 일치하는 블록 체인만 수용(기본값: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - 노드가 있는 네트워크에만 접속 합니다(IPv4, IPv6 또는 Tor) - Print block on startup, if found in block index 블럭 색인을 발견하면 구동 시 블럭을 출력합니다. - - Print block tree on startup (default: 0) - 구동 시 블럭 트리를 출력합니다. (기본값: 0, 비활성화) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) RPC SSL 옵션: (비트코인 위키의 SSL 설정 설명서 참고) @@ -2692,14 +2568,6 @@ Address: %4 Send trace/debug info to console instead of debug.log file 추적오류 정보를 degug.log 자료로 보내는 대신 콘솔로 보내기 - - Set minimum block size in bytes (default: 0) - 바이트 단위의 최소 블록 크기 설정(기본값: 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - 전자지갑 데이터베이스 환경에 DB_PRIVATE 플래그를 설정합니다. (기본값: 1, 활성화) - Show all debugging options (usage: --help -help-debug) 모든 디버그 설정 보기(설정: --help -help-debug) @@ -2712,14 +2580,6 @@ Address: %4 Signing transaction failed 거래를 서명하는것을 실패하였습니다. - - Specify connection timeout in milliseconds (default: 5000) - 밀리초 단위로 연결 제한시간을 설정하십시오(기본값: 5000) - - - System error: - 시스템 오류: - Transaction amount too small 거래량이 너무 적습니다 @@ -2732,10 +2592,6 @@ Address: %4 Transaction too large 너무 큰 거래 - - Use UPnP to map the listening port (default: 0) - UPnP사용하여 지도에서 포트 반응기다리는 중 (기본값: 0) - Use UPnP to map the listening port (default: 1 when listening) UPnP사용하여 지도에서 포트 반응기다리는 중 (기본값: 1 반응이 생기면) @@ -2776,10 +2632,6 @@ Address: %4 Upgrade wallet to latest format 지갑을 최근 형식으로 개선하시오 - - Set key pool size to <n> (default: 100) - 키 풀 크기 설정 <n>(기본값: 100) - Rescan the block chain for missing wallet transactions 누락된 지갑 송금에 대한 블록 체인 다시 검색 @@ -2788,14 +2640,6 @@ Address: %4 Use OpenSSL (https) for JSON-RPC connections JSON-RPC 연결에 OpenSSL(https) 사용 - - Server certificate file (default: server.cert) - 서버 인증 파일 (기본값: server.cert) - - - Server private key (default: server.pem) - 서버 개인 키(기본값: server.pem) - This help message 도움말 메시지입니다 diff --git a/src/qt/locale/bitcoin_ky.ts b/src/qt/locale/bitcoin_ky.ts index ad4b5eae03..91b3ccaf10 100644 --- a/src/qt/locale/bitcoin_ky.ts +++ b/src/qt/locale/bitcoin_ky.ts @@ -153,10 +153,6 @@ OverviewPage - - Wallet - Капчык - out of sync синхрондоштурулган эмес diff --git a/src/qt/locale/bitcoin_la.ts b/src/qt/locale/bitcoin_la.ts index 450228b221..cc43762310 100644 --- a/src/qt/locale/bitcoin_la.ts +++ b/src/qt/locale/bitcoin_la.ts @@ -314,10 +314,6 @@ Tabs toolbar Tabella instrumentorum "Tabs" - - [testnet] - [testnet] - Bitcoin Core Bitcoin Nucleus @@ -330,10 +326,6 @@ No block source available... Nulla fons frustorum absens... - - Processed %1 blocks of transaction history. - Processae %1 frusta historiae transactionum. - %n hour(s) %n hora%n horae @@ -689,10 +681,6 @@ Inscriptio: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Monstrata informatio fortasse non recentissima est. Tuum cassidile per se synchronizat cum rete Bitcoin postquam conexio constabilita est, sed hoc actio nondum perfecta est. - - Wallet - Cassidile - Immature: Immatura: @@ -701,10 +689,6 @@ Inscriptio: %4 Mined balance that has not yet matured Fossum pendendum quod nondum maturum est - - <b>Recent transactions</b> - <b>Recentes transactiones</b> - out of sync non synchronizato @@ -1514,26 +1498,10 @@ Inscriptio: %4 Options: Optiones: - - Specify configuration file (default: bitcoin.conf) - Specifica configurationis plicam (praedefinitum: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Specifica pid plicam (praedefinitum: bitcoin.pid) - Specify data directory Specifica indicem datorum - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Ausculta pro conexionibus in <porta> (praedefinitum: 8333 vel testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Manutene non plures quam <n> conexiones ad paria (praedefinitum: 125) - Connect to a node to retrieve peer addresses, and disconnect Conecta ad nodum acceptare inscriptiones parium, et disconecte @@ -1542,18 +1510,6 @@ Inscriptio: %4 Specify your own public address Specifica tuam propriam publicam inscriptionem - - Threshold for disconnecting misbehaving peers (default: 100) - Limen pro disconectendo paria improba (praedefinitum: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Numerum secundorum prohibere ne paria improba reconectant (praedefinitum: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Ausculta pro conexionibus JSON-RPC in <porta> (praedefinitum: 8332 vel testnet: 18332) - Accept command line and JSON-RPC commands Accipe terminalis et JSON-RPC mandata. @@ -1674,62 +1630,10 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" admin@foo.c Error: Wallet locked, unable to create transaction! Error: Cassidile seratum, non posse transactionem creare! - - Error: system error: - Error: systematis error: - Failed to listen on any port. Use -listen=0 if you want this. Non potuisse auscultare in ulla porta. Utere -listen=0 si hoc vis. - - Failed to read block info - Non potuisse informationem frusti legere - - - Failed to read block - Non potuisse frustum legere - - - Failed to sync block index - Synchronizare indicem frustorum abortum est - - - Failed to write block index - Scribere indicem frustorum abortum est - - - Failed to write block info - Scribere informationem abortum est - - - Failed to write block - Scribere frustum abortum est - - - Failed to write file info - Scribere informationem plicae abortum est - - - Failed to write to coin database - Scribere databasem nummorum abortum est - - - Failed to write transaction index - Scribere indicem transactionum abortum est - - - Failed to write undo data - Scribere data pro cancellando mutationes abortum est - - - Generate coins (default: 0) - Genera nummos (praedefinitum: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Quot frusta proba ad initium (praedefinitum: 288, 0 = omnia) - Not enough file descriptors available. Inopia descriptorum plicarum. @@ -1738,10 +1642,6 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" admin@foo.c Rebuild block chain index from current blk000??.dat files Restituere indicem catenae frustorum ex activis plicis blk000??.dat - - Set the number of threads to service RPC calls (default: 4) - Constitue numerum filorum ad tractandum RPC postulationes (praedefinitum: 4) - Verifying blocks... Verificante frusta... @@ -1766,34 +1666,10 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" admin@foo.c Invalid amount for -mintxfee=<amount>: '%s' Quantitas non valida pro -mintxfee=<amount>: '%s' - - Maintain a full transaction index (default: 0) - Manutene completam indicem transactionum (praedefinitum: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Maxima magnitudo memoriae pro datis accipendis singulis conexionibus, <n>*1000 octetis/bytes (praedefinitum: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Maxima magnitudo memoriae pro datis mittendis singulis conexionibus, <n>*1000 octetis/bytes (praedefinitum: 1000) - - - Only accept block chain matching built-in checkpoints (default: 1) - Tantum accipe catenam frustorum convenientem internis lapidibus (praedefinitum: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Tantum conecte ad nodos in rete <net> (IPv4, IPv6 aut Tor) - Send trace/debug info to console instead of debug.log file Mitte informationem vestigii/debug ad terminale potius quam plicam debug.log - - Set minimum block size in bytes (default: 0) - Constitue minimam magnitudinem frusti in octetis/bytes (praedefinitum: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Diminue plicam debug.log ad initium clientis (praedefinitum: 1 nisi -debug) @@ -1802,14 +1678,6 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" admin@foo.c Signing transaction failed Signandum transactionis abortum est - - Specify connection timeout in milliseconds (default: 5000) - Specifica tempumfati conexionis in millisecundis (praedefinitum: 5000) - - - System error: - Systematis error: - Transaction amount too small Magnitudo transactionis nimis parva @@ -1822,10 +1690,6 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" admin@foo.c Transaction too large Transactio nimis magna - - Use UPnP to map the listening port (default: 0) - Utere UPnP designare portam auscultandi (praedefinitum: 0) - Use UPnP to map the listening port (default: 1 when listening) Utere UPnP designare portam auscultandi (praedefinitum: 1 quando auscultans) @@ -1858,10 +1722,6 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" admin@foo.c Upgrade wallet to latest format Progredere cassidile ad formam recentissimam - - Set key pool size to <n> (default: 100) - Constitue magnitudinem stagni clavium ad <n> (praedefinitum: 100) - Rescan the block chain for missing wallet transactions Iterum perlege catenam frustorum propter absentes cassidilis transactiones @@ -1870,14 +1730,6 @@ exempli gratia: alertnotify=echo %%s | mail -s "Bitcoin Notificatio" admin@foo.c Use OpenSSL (https) for JSON-RPC connections Utere OpenSSL (https) pro conexionibus JSON-RPC - - Server certificate file (default: server.cert) - Plica certificationis daemonis moderantis (praedefinitum: server.cert) - - - Server private key (default: server.pem) - Clavis privata daemonis moderans (praedefinitum: server.pem) - This help message Hic nuntius auxilii diff --git a/src/qt/locale/bitcoin_lt.ts b/src/qt/locale/bitcoin_lt.ts index 6d0fb684da..b195a75d0f 100644 --- a/src/qt/locale/bitcoin_lt.ts +++ b/src/qt/locale/bitcoin_lt.ts @@ -37,6 +37,18 @@ &Delete &Trinti + + C&hoose + P&asirinkti + + + Sending addresses + Siunčiami adresai + + + Receiving addresses + Gaunami adresai + Copy &Label Kopijuoti ž&ymę @@ -45,11 +57,23 @@ &Edit &Keisti + + Export Address List + Eksportuoti adresų sąrašą + Comma separated file (*.csv) Kableliais išskirtas failas (*.csv) - + + Exporting Failed + Eksportavimas nepavyko + + + There was an error trying to save the address list to %1. Please try again. + Bandant išsaugoti adresų sąrašą - įvyko klaida keliant į %1. Prašome bandyti dar kartą. + + AddressTableModel @@ -178,6 +202,10 @@ &Overview &Apžvalga + + Node + Taškas + Show general overview of wallet Rodyti piniginės bendrą apžvalgą @@ -222,6 +250,18 @@ &Change Passphrase... &Keisti slaptafrazę... + + &Sending addresses... + &Siunčiami adresai... + + + &Receiving addresses... + &Gaunami adresai... + + + Bitcoin Core client + Bitcoin Core klientas + Importing blocks from disk... Blokai importuojami iš disko... @@ -274,6 +314,10 @@ &Receive &Gauti + + Show information about Bitcoin Core + Rodyti informaciją apie Bitcoin Core + &Show / Hide &Rodyti / Slėpti @@ -282,6 +326,10 @@ Show or hide the main Window Rodyti arba slėpti pagrindinį langą + + Encrypt the private keys that belong to your wallet + Užšifruoti privačius raktus, kurie priklauso jūsų piniginei + &File &Failas @@ -298,14 +346,14 @@ Tabs toolbar Kortelių įrankinė - - [testnet] - [testavimotinklas] - Bitcoin Core Bitcoin branduolys + + &About Bitcoin Core + &Apie Bitcoin Core + %n active connection(s) to Bitcoin network %n Bitcoin tinklo aktyvus ryšys%n Bitcoin tinklo aktyvūs ryšiai%n Bitcoin tinklo aktyvūs ryšiai @@ -322,6 +370,10 @@ %n week(s) %n savaitė%n savaitės%n savaičių + + %n year(s) + %n metas%n metai%n metų + Error Klaida @@ -379,10 +431,46 @@ Adresas: %4 CoinControlDialog + + Quantity: + Kiekis: + + + Bytes: + Baitai: + Amount: Suma: + + Priority: + Pirmumas: + + + Fee: + Mokestis: + + + After Fee: + Po mokesčio: + + + Change: + Graža: + + + (un)select all + (ne)pasirinkti viską + + + Tree mode + Medžio režimas + + + List mode + Sąrašo režimas + Amount Suma @@ -395,10 +483,18 @@ Adresas: %4 Date Data + + Confirmations + Patvirtinimai + Confirmed Patvirtintas + + Priority + Pirmumas + Copy address Kopijuoti adresą @@ -411,6 +507,74 @@ Adresas: %4 Copy amount Kopijuoti sumą + + Copy quantity + Kopijuoti kiekį + + + Copy fee + Kopijuoti mokestį + + + Copy after fee + Kopijuoti po mokesčio + + + Copy bytes + Kopijuoti baitus + + + Copy priority + Kopijuoti pirmumą + + + highest + auksčiausias + + + higher + aukštesnis + + + high + aukštas + + + medium-high + vidutiniškai aukštas + + + medium + vidutiniškai + + + low-medium + žemai-vidutiniškas + + + low + žemas + + + lower + žemesnis + + + lowest + žemiausias + + + none + niekas + + + yes + taip + + + no + ne + (no label) (nėra žymės) @@ -465,6 +629,10 @@ Adresas: %4 FreespaceChecker + + name + pavadinimas + HelpMessageDialog @@ -476,6 +644,10 @@ Adresas: %4 version versija + + About Bitcoin Core + Apie Bitcoin Core + Command-line options Komandinės eilutės parametrai @@ -507,6 +679,10 @@ Adresas: %4 Welcome Sveiki + + Welcome to Bitcoin Core. + Sveiki atvykę į Bitcoin Core. + Bitcoin Core Bitcoin branduolys @@ -617,6 +793,10 @@ Adresas: %4 default numatyta + + none + niekas + The supplied proxy address is invalid. Nurodytas tarpinio serverio adresas negalioja. @@ -628,10 +808,6 @@ Adresas: %4 Form Forma - - Wallet - Piniginė - Immature: Nepribrendę: @@ -644,10 +820,6 @@ Adresas: %4 Your current total balance Jūsų balansas - - <b>Recent transactions</b> - <b>Naujausi sandoriai</b> - out of sync nesinchronizuota @@ -859,10 +1031,34 @@ Adresas: %4 Send Coins Siųsti monetas + + Quantity: + Kiekis: + + + Bytes: + Baitai: + Amount: Suma: + + Priority: + Pirmumas: + + + Fee: + Mokestis: + + + After Fee: + Po mokesčio: + + + Change: + Graža: + Send to multiple recipients at once Siųsti keliems gavėjams vienu metu @@ -891,10 +1087,30 @@ Adresas: %4 Confirm send coins Patvirtinti monetų siuntimą + + Copy quantity + Kopijuoti kiekį + Copy amount Kopijuoti sumą + + Copy fee + Kopijuoti mokestį + + + Copy after fee + Kopijuoti po mokesčio + + + Copy bytes + Kopijuoti baitus + + + Copy priority + Kopijuoti pirmumą + The recipient address is not valid, please recheck. Negaliojantis gavėjo adresas. Patikrinkite. @@ -1338,6 +1554,10 @@ Adresas: %4 Show transaction details Rodyti sandėrio detales + + Exporting Failed + Eksportavimas nepavyko + Comma separated file (*.csv) Kableliais atskirtų duomenų failas (*.csv) @@ -1417,42 +1637,14 @@ Adresas: %4 Options: Parinktys: - - Specify configuration file (default: bitcoin.conf) - Nurodyti konfigūracijos failą (pagal nutylėjimąt: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Nurodyti pid failą (pagal nutylėjimą: bitcoind.pid) - Specify data directory Nustatyti duomenų aplanką - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Sujungimo klausymas prijungčiai <port> (pagal nutylėjimą: 8333 arba testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Palaikyti ne daugiau <n> jungčių kolegoms (pagal nutylėjimą: 125) - Specify your own public address Nurodykite savo nuosavą viešą adresą - - Threshold for disconnecting misbehaving peers (default: 100) - Atjungimo dėl netinkamo kolegų elgesio riba (pagal nutylėjimą: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Sekundžių kiekis eikiamas palaikyti ryšį dėl lygiarangių nestabilumo (pagal nutylėjimą: 86.400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Klausymas JSON-RPC sujungimui prijungčiai <port> (pagal nutylėjimą: 8332 or testnet: 18332) - Accept command line and JSON-RPC commands Priimti komandinę eilutę ir JSON-RPC komandas @@ -1477,30 +1669,6 @@ Adresas: %4 Error opening block database Klaida atveriant blokų duombazę - - Error: system error: - Klaida: sistemos klaida: - - - Failed to read block info - Nepavyko nuskaityti bloko informacijos - - - Failed to read block - Nepavyko nuskaityti bloko - - - Failed to write block - Nepavyko įrašyti bloko - - - Failed to write file info - Nepavyko įrašyti failo informacijos - - - Generate coins (default: 0) - Generuoti monetas (numatyta: 0) - Verifying blocks... Tikrinami blokai... @@ -1513,30 +1681,10 @@ Adresas: %4 Information Informacija - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Maksimalus buferis priėmimo sujungimui <n>*1000 bitų (pagal nutylėjimą: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Maksimalus buferis siuntimo sujungimui <n>*1000 bitų (pagal nutylėjimą: 1000) - Send trace/debug info to console instead of debug.log file Siųsti atsekimo/derinimo info į konsolę vietoj debug.log failo - - Specify connection timeout in milliseconds (default: 5000) - Nustatyti sujungimo trukmę milisekundėmis (pagal nutylėjimą: 5000) - - - System error: - Sistemos klaida: - - - Use UPnP to map the listening port (default: 0) - Bandymas naudoti UPnP struktūra klausymosi prievadui (default: 0) - Use UPnP to map the listening port (default: 1 when listening) Bandymas naudoti UPnP struktūra klausymosi prievadui (default: 1 when listening) @@ -1557,10 +1705,6 @@ Adresas: %4 Upgrade wallet to latest format Atnaujinti piniginę į naujausią formatą - - Set key pool size to <n> (default: 100) - Nustatyti rakto apimties dydį <n> (pagal nutylėjimą: 100) - Rescan the block chain for missing wallet transactions Ieškoti prarastų piniginės sandorių blokų grandinėje @@ -1569,14 +1713,6 @@ Adresas: %4 Use OpenSSL (https) for JSON-RPC connections Naudoti OpenSSL (https) jungimuisi JSON-RPC - - Server certificate file (default: server.cert) - Serverio sertifikato failas (pagal nutylėjimą: server.cert) - - - Server private key (default: server.pem) - Serverio privatus raktas (pagal nutylėjimą: server.pem) - This help message Pagelbos žinutė diff --git a/src/qt/locale/bitcoin_lv_LV.ts b/src/qt/locale/bitcoin_lv_LV.ts index 81b2688d03..f901b14d36 100644 --- a/src/qt/locale/bitcoin_lv_LV.ts +++ b/src/qt/locale/bitcoin_lv_LV.ts @@ -362,10 +362,6 @@ Tabs toolbar Ciļņu rīkjosla - - [testnet] - [testnet] - Bitcoin Core Bitcoin Core @@ -394,10 +390,6 @@ No block source available... Nav pieejams neviens bloku avots... - - Processed %1 blocks of transaction history. - Apstrādāti %1 bloki no transakciju vēstures. - %n hour(s) %n stundas%n stunda%n stundas @@ -800,15 +792,7 @@ Adrese: %4 Error Kļūda - - GB of free space available - GB ar brīvo vietu pieejams - - - (of %1GB needed) - (no %1GB nepieciešams) - - + OpenURIDialog @@ -1017,10 +1001,6 @@ Adrese: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Attēlotā informācija var būt novecojusi. Jūsu maciņš pēc savienojuma izveides automātiski sinhronizējas ar Bitcoin tīklu, taču šis process vēl nav beidzies. - - Wallet - Maciņš - Available: Pieejams: @@ -1049,10 +1029,6 @@ Adrese: %4 Your current total balance Jūsu kopējā tekošā bilance - - <b>Recent transactions</b> - <b>Pēdējās transakcijas</b> - out of sync nav sinhronizēts @@ -2210,26 +2186,10 @@ Adrese: %4 Options: Iespējas: - - Specify configuration file (default: bitcoin.conf) - Norādiet konfigurācijas failu (pēc noklusēšanas: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Norādiet pid failu (pēc noklusēšanas: bitcoind.pid) - Specify data directory Norādiet datu direktoriju - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Gaidīt savienojumus portā <port> (pēc noklusēšanas: 8333 vai testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Uzturēt līdz <n> savienojumiem ar citiem mezgliem(pēc noklusēšanas: 125) - Connect to a node to retrieve peer addresses, and disconnect Pievienoties mezglam, lai iegūtu citu mezglu adreses, un atvienoties @@ -2238,14 +2198,6 @@ Adrese: %4 Specify your own public address Norādiet savu publisko adresi - - Threshold for disconnecting misbehaving peers (default: 100) - Slieksnis pārkāpējmezglu atvienošanai (pēc noklusēšanas: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Sekundes, cik ilgi atturēt pārkāpējmezglus no atkārtotas pievienošanās (pēc noklusēšanas: 86400) - Accept command line and JSON-RPC commands Pieņemt komandrindas un JSON-RPC komandas @@ -2262,10 +2214,6 @@ Adrese: %4 (default: 1) (noklusējums: 1) - - (default: wallet.dat) - (noklusējums: wallet.dat) - <category> can be: <category> var būt: @@ -2302,14 +2250,6 @@ Adrese: %4 Error: Wallet locked, unable to create transaction! Kļūda: Maciņš ir aizslēgts, nevar izveidot transakciju! - - Error: system error: - Kļūda: sistēmas kļūda: - - - Force safe mode (default: 0) - Piespiest drošo režīmu (noklusējums: 0) - If <category> is not supplied, output all debugging information. Ja <category> nav norādīta, izvadīt visu atkļūdošanas informāciju. @@ -2318,10 +2258,6 @@ Adrese: %4 Importing... Importē... - - Spend unconfirmed change when sending transactions (default: 1) - Tērēt neapstiprinātu atlikumu kad sūta transakcijas (noklusējums: 1) - Verifying blocks... Pārbauda blokus... @@ -2354,10 +2290,6 @@ Adrese: %4 Signing transaction failed Transakcijas parakstīšana neizdevās - - System error: - Sistēmas kļūda: - Transaction amount too small Transakcijas summa ir pārāk maza @@ -2402,10 +2334,6 @@ Adrese: %4 Upgrade wallet to latest format Atjaunot maciņa formātu uz jaunāko - - Set key pool size to <n> (default: 100) - Uzstādīt atslēgu bufera izmēru uz <n> (pēc noklusēšanas: 100) - Rescan the block chain for missing wallet transactions Atkārtoti skanēt bloku virkni, meklējot trūkstošās maciņa transakcijas @@ -2414,14 +2342,6 @@ Adrese: %4 Use OpenSSL (https) for JSON-RPC connections JSON-RPC savienojumiem izmantot OpenSSL (https) - - Server certificate file (default: server.cert) - Servera sertifikāta fails (pēc noklusēšanas: server.cert) - - - Server private key (default: server.pem) - Servera privātā atslēga (pēc noklusēšanas: server.pem) - This help message Šis palīdzības paziņojums diff --git a/src/qt/locale/bitcoin_mn.ts b/src/qt/locale/bitcoin_mn.ts index 4a296dfce7..515d1b90df 100644 --- a/src/qt/locale/bitcoin_mn.ts +++ b/src/qt/locale/bitcoin_mn.ts @@ -424,18 +424,10 @@ Address: %4 OverviewPage - - Wallet - Түрүйвч - Available: Хэрэглэж болох хэмжээ: - - <b>Recent transactions</b> - <b>Сүүлд хийгдсэн гүйлгээнүүд</b> - PaymentServer @@ -1029,10 +1021,6 @@ Address: %4 Options: Сонголтууд: - - Listen for connections on <port> (default: 8333 or testnet: 18333) - <port> дээрх холболтуудыг чагна (ѳгѳгдмѳл: 8333 эсвэл testnet: 18333) - Wallet options: Түрүйвчийн сонголтууд: diff --git a/src/qt/locale/bitcoin_ms_MY.ts b/src/qt/locale/bitcoin_ms_MY.ts index 428819e92f..47e74111c2 100644 --- a/src/qt/locale/bitcoin_ms_MY.ts +++ b/src/qt/locale/bitcoin_ms_MY.ts @@ -9,14 +9,42 @@ Create a new address Cipta alamat baru + + &New + &Baru + Copy the currently selected address to the system clipboard Salin alamat terpilih ke dalam sistem papan klip + + &Copy + &Salin + + + &Copy Address + &Salin Alamat + + + &Export + &Eksport + &Delete &Padam + + Choose the address to send coins to + Pilih alamat untuk menghantar syiling + + + Choose the address to receive coins with + Pilih alamat untuk menerima syiling + + + C&hoose + &Pilih + Comma separated file (*.csv) Fail yang dipisahkan dengan koma @@ -163,6 +191,10 @@ WalletView + + &Export + &Eksport + bitcoin-core diff --git a/src/qt/locale/bitcoin_nb.ts b/src/qt/locale/bitcoin_nb.ts index bb6b78849c..435a412d09 100644 --- a/src/qt/locale/bitcoin_nb.ts +++ b/src/qt/locale/bitcoin_nb.ts @@ -390,10 +390,6 @@ Tabs toolbar Verktøylinje for faner - - [testnet] - [testnett] - Bitcoin Core Bitcoin Core @@ -434,10 +430,6 @@ No block source available... Ingen kilde for blokker tilgjengelig... - - Processed %1 blocks of transaction history. - Lastet %1 blokker med transaksjonshistorikk. - %n hour(s) %n time%n timer @@ -486,6 +478,10 @@ Up to date Ajour + + Processed %n blocks of transaction history. + Lastet %n blokk med transaksjonshistorikk.Lastet %n blokker med transaksjonshistorikk. + Catching up... Kommer ajour... @@ -916,13 +912,13 @@ Adresse: %4 Error Feil - - GB of free space available - GB ledig lagringsplass + + %n GB of free space available + %n GB med ledig lagringsplass%n GB med ledig lagringsplass - - (of %1GB needed) - (av %1GB behøvd) + + (of %n GB needed) + (av %n GB som trengs)(av %n GB som trengs) @@ -1165,10 +1161,6 @@ Adresse: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Informasjonen som vises kan være foreldet. Din lommebok synkroniseres automatisk med Bitcoin-nettverket etter at tilkobling er opprettet, men denne prosessen er ikke ferdig enda. - - Wallet - Lommebok - Watch-only: Kun observerbar: @@ -1197,6 +1189,10 @@ Adresse: %4 Mined balance that has not yet matured Minet saldo har ikke modnet enda + + Balances + Saldoer + Total: Totalt: @@ -1209,6 +1205,14 @@ Adresse: %4 Your current balance in watch-only addresses Din nåværende balanse i kun observerbare adresser + + Spendable: + Kan brukes: + + + Recent transactions + Nylige transaksjoner + Unconfirmed transactions to watch-only addresses Ubekreftede transaksjoner til kun observerbare adresser @@ -1221,10 +1225,6 @@ Adresse: %4 Current total balance in watch-only addresses Nåværende totale balanse i kun observerbare adresser - - <b>Recent transactions</b> - <b>Siste transaksjoner</b> - out of sync ute av synk @@ -1484,10 +1484,6 @@ Adresse: %4 Services Tjenester - - Sync Node - Synk-node - Starting Height Starthøyde @@ -1616,14 +1612,6 @@ Adresse: %4 Outbound Utgående - - Yes - Ja - - - No - Nei - Unknown Ukjent @@ -2472,6 +2460,10 @@ Adresse: %4 Mined Utvunnet + + watch-only + kun observerbar + (n/a) - @@ -2488,6 +2480,10 @@ Adresse: %4 Type of transaction. Type transaksjon. + + Whether or not a watch-only address is involved in this transaction. + Hvorvidt en kun observerbar adresse er involvert i denne transaksjonen. + Destination address of transaction. Mottaksadresse for transaksjonen. @@ -2583,6 +2579,10 @@ Adresse: %4 Export Transaction History Eksporter Transaksjonshistorikk + + Watch-only + Kun observer + Exporting Failed Ekport Feilet @@ -2698,26 +2698,10 @@ Adresse: %4 Options: Innstillinger: - - Specify configuration file (default: bitcoin.conf) - Angi konfigurasjonsfil (standardverdi: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Angi pid-fil (standardverdi: bitcoind.pid) - Specify data directory Angi mappe for datafiler - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Lytt etter tilkoblinger på <port> (standardverdi: 8333 eller testnett: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Hold maks <n> koblinger åpne til andre noder (standardverdi: 125) - Connect to a node to retrieve peer addresses, and disconnect Koble til node for å hente adresser til andre noder, koble så fra igjen @@ -2726,18 +2710,6 @@ Adresse: %4 Specify your own public address Angi din egen offentlige adresse - - Threshold for disconnecting misbehaving peers (default: 100) - Grenseverdi for å koble fra noder med dårlig oppførsel (standardverdi: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Antall sekunder noder med dårlig oppførsel hindres fra å koble til på nytt (standardverdi: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Lytt etter JSON-RPC tilkoblinger på <port> (standardverdi: 8332 eller testnett: 18332) - Accept command line and JSON-RPC commands Ta imot kommandolinje- og JSON-RPC-kommandoer @@ -2777,18 +2749,10 @@ Om filen ikke eksisterer, opprett den nå med eier-kun-les filrettigheter. Det er også anbefalt at å sette varselsmelding slik du får melding om problemer. For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Akseptable krypteringsmetoder (standardverdi: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Bind til angitt adresse. Bruk [vertsmaskin]:port notasjon for IPv6 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - Ratebegrens gratistransaksjoner kontinuerlig til <n>*1000 bytes per minutt (standard: 15) - Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup Slett alle transaksjoner i lommeboken og gjenopprett kun de delene av blokkjeden gjennom -rescan ved oppstart @@ -2809,14 +2773,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.com
Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Kjør kommando når en lommeboktransaksjon endres (%s i kommando er erstattet med TxID) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - Overfør aktiviteten i databasen fra minnelageret til loggen på harddisken for hver <n> megabytes (standardverdi: 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - Hvor grundig blokkverifiseringen til -checkblocks er (0-4, standard: 3) - In this mode -genproclimit controls how many blocks are generated immediately. I denne modusen kontrollerer -genproclimit hvor mange blokker som genereres øyeblikkelig. @@ -2825,10 +2781,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.com
Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Angi antall tråder for skriptverifisering (%u til %d, 0 = auto, <0 = la det antallet kjerner være ledig, standard: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - Sett prosessorgrensen for når blokkutvinning er på (-1 = ubegrenset, standard: -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Dette er en forhåndssluppet testversjon - bruk på egen risiko - ikke for bruk til blokkutvinning eller bedriftsapplikasjoner @@ -2837,10 +2789,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.com
Unable to bind to %s on this computer. Bitcoin Core is probably already running. Ute av stand til å binde til %s på denne datamaskinen. Bitcoin Core kjører sannsynligvis allerede. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Bruk separate SOCKS5 proxyer for å nå noder via Tor skjulte tjenester (standardverdi: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Advarsel: -paytxfee er satt veldig høyt! Dette er transaksjonsgebyret du betaler når du sender transaksjoner. @@ -2862,12 +2810,12 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comAdvarsel: wallet.dat korrupt, data reddet! Original wallet.dat lagret som wallet.{timestamp}.bak i %s; hvis din saldo eller dine transaksjoner ikke er korrekte bør du gjenopprette fra en backup. - (default: 1) - (standardverdi: 1) + Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times. + Hvitelist noder som kobler til fra den oppgitte nettmasken eller IP-adressen. Kan oppgis flere ganger. - (default: wallet.dat) - (standardverdi: wallet.dat) + (default: 1) + (standardverdi: 1) <category> can be: @@ -2897,10 +2845,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comDebugging/Testing options: Valg for feilsøking/testing: - - Disable safemode, override a real safe mode event (default: 0) - Slå av sikkerhetsmodus, overstyr en virkelig sikkerhetsmodushendelse (standard: 0) - Discover own IP address (default: 1 when listening and no -externalip) Oppdag egen IP-adresse (standardverdi: 1 ved lytting og uten -externalip) @@ -2929,6 +2873,10 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comError opening block database Feil under åpning av blokkdatabase + + Error: A fatal internal error occured, see debug.log for details + Feil: En fatal intern feil oppstod, se debug.log for detaljer + Error: Disk space is low! Feil: Lite ledig lagringsplass! @@ -2937,66 +2885,10 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comError: Wallet locked, unable to create transaction! Feil: Lommebok låst, kan ikke opprette transaksjon! - - Error: system error: - Feil: systemfeil: - Failed to listen on any port. Use -listen=0 if you want this. Kunne ikke lytte på noen port. Bruk -listen=0 hvis det er dette du vil. - - Failed to read block info - Feil ved lesing av blokkinfo - - - Failed to read block - Feil ved lesing av blokk - - - Failed to sync block index - Feil ved synkronisering av blokkindeks - - - Failed to write block index - Ved feil skriving av blokkindeks - - - Failed to write block info - Feil ved skriving av blokkinfo - - - Failed to write block - Feil ved skriving av blokk - - - Failed to write file info - Feil ved skriving av filinfo - - - Failed to write to coin database - Feil ved skriving til bitcoin sin database - - - Failed to write transaction index - Feil ved skriving av transaksjonsindeks - - - Failed to write undo data - Feil ved skriving av angredata - - - Force safe mode (default: 0) - Tving sikkerhetsmodus (standard: 0) - - - Generate coins (default: 0) - Generer bitcoins (standardverdi: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Hvor mange blokker skal sjekkes ved oppstart (standardverdi: 288, 0 = alle) - If <category> is not supplied, output all debugging information. Hvis <category> ikke er oppgitt, ta ut all informasjon om feilsøking. @@ -3018,8 +2910,8 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comFor få fildeskriptorer tilgjengelig. - Prepend debug output with timestamp (default: 1) - Sett inn tidsstempel i front av feilsøkingsdata (standardverdi: 1) + Only connect to nodes in network <net> (ipv4, ipv6 or onion) + Bare koble til noder i nettverket <net> (IPv4, IPv6 eller onion) Rebuild block chain index from current blk000??.dat files @@ -3033,26 +2925,18 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comSet maximum block size in bytes (default: %d) Sett maks blokkstørrelse i bytes (standardverdi: %d) - - Set the number of threads to service RPC calls (default: 4) - Sett nummer av tråder til betjening av RPC-kall (standardverdi: 4) - Specify wallet file (within data directory) Angi lommebokfil (inne i datamappe) - - Spend unconfirmed change when sending transactions (default: 1) - Bruk ubekreftet veksel ved sending av transaksjoner (standardverdi: 1) - - - Stop running after importing blocks from disk (default: 0) - Avslutt etter import av blokker fra disk (standard: 0) - This is intended for regression testing tools and app development. Dette er tiltenkt verktøy for regresjonstesting og apputvikling. + + Use UPnP to map the listening port (default: %u) + Bruk UPnP for å sette opp lytteport (standardverdi: %u) + Verifying blocks... Verifiserer blokker... @@ -3077,10 +2961,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comImports blocks from external blk000??.dat file Importerer blokker fra ekstern fil blk000??.dat - - (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) - (standardverdi: 1, 1 = behold metadata for transaksjon som f. eks. kontoeier og informasjon om betalingsanmodning, 2 = dropp metadata for transaksjon) - Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times Tillat JSON-RPC-tilkoblinger fra angitt kilde. Gyldig for <ip> er en enkelt IP (f. eks. 1.2.3.4), et nettverk/nettmaske (f. eks. 1.2.3.4/255.255.255.0) eller et nettverk/CIDR (f. eks. 1.2.3.4/24). Dette alternativet kan angis flere ganger @@ -3101,6 +2981,10 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comCannot obtain a lock on data directory %s. Bitcoin Core is probably already running. Ute av stand til å låse datamappen %s. Bitcoin Core kjører sannsynligvis allerede. + + Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:%u) + Ratebegrens gratistransaksjoner kontinuerlig til <n>*1000 bytes per minutt (standardverdi: %u) + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) Opprett nye filer med standardtillatelser i systemet, i stedet for umask 077 (kun virksom med lommebokfunksjonalitet slått av) @@ -3117,10 +3001,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comError: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. Feil: Argumentet -socks er ikke støttet. Det er ikke lenger mulig å sette SOCKS-versjon; bare SOCKS5-proxyer er støttet. - - Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) - Utfør kommando når et nettverkstransaksjon gjenbruker inndata fra lommeboktransaksjonen (%s=gjenbruk TxID, %t=lommebok TxID) - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Utfør kommando når et relevant varsel er mottatt eller vi ser en veldig lang gaffel (%s i kommando er erstattet med melding) @@ -3133,14 +3013,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comFees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) Gebyrer (i BTC/Kb) mindre enn dette anses som null gebyr for laging av transaksjoner (standardverdi: %s) - - If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) - Hvis paytxfee ikke er angitt, inkluderer da nok gebyr til at transaksjoner gjennomsnittligt bekreftes innen n blokker (standardverdi: 1) - - - Output debugging information (default: 0, supplying <category> is optional) - Ta ut feilsøkingsinformasjon (standardverdi: 0, bruk av <category> er valgfritt) - Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) Søk etter nodeadresser via DNS-oppslag, hvis vi har få adresser å koble til (standard: 1 med mindre -connect) @@ -3157,18 +3029,10 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comWarning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. Advarsel: Vennligst undersøk at din datamaskin har riktig dato og klokkeslett! Hvis klokken er stilt feil vil ikke Bitcoin Core fungere riktig. - - Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. - Hvitelist noder som kobler til fra den oppgitte nettmasken eller IP-adressen. Kan oppgis flere ganger. - Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway Hvitlistede noder kan ikke DoS-blokkeres, og deres transaksjoner videresendes alltid, selv om de allerede er i minnelageret. Nyttig f.eks. for en gateway. - - Always query for peer addresses via DNS lookup (default: 0) - Alltid søk etter nodeadresser via DNS-oppslag (standardverdi: 0) - Cannot resolve -whitebind address: '%s' Kan ikke løse -whitebind-adresse: '%s' @@ -3197,10 +3061,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comFee (in BTC/kB) to add to transactions you send (default: %s) Gebyr (i BTC/kB) for å legge til i transaksjoner du sender (standardverdi: %s) - - Include IP addresses in debug output (default: 0) - Inkludere IP-adresser i feilsøkingslogg (standard: 0) - Information Informasjon @@ -3230,24 +3090,8 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comBehold på det meste <n> blokker i minnet som ikke er mulig å koble (standardverdi: %u) - Limit size of signature cache to <n> entries (default: 50000) - Begrens størrelsen på signatur-hurtigbufferen til <n> oppføringer (standard: 50000) - - - Log transaction priority and fee per kB when mining blocks (default: 0) - Logg transaksjonsprioritet og gebyr per kB under blokkutvinning (standard: 0) - - - Maintain a full transaction index (default: 0) - Oppretthold en full transaksjonsindeks (standard: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Maks mottaksbuffer per forbindelse, <n>*1000 bytes (standardverdi: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Maks sendebuffer per forbindelse, <n>*1000 bytes (standardverdi: 1000) + Keep at most <n> unconnectable transactions in memory (default: %u) + Hold på det meste <n> transaksjoner som ikke kobles i minnet (standardverdi: %u) Need to specify a port with -whitebind: '%s' @@ -3257,22 +3101,10 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comNode relay options: Node alternativer for videresending: - - Only accept block chain matching built-in checkpoints (default: 1) - Aksepter kun en blokkjede som passer med innebygde sjekkpunkter (standardvalg: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Koble kun til noder i nettverket <nett> (IPv4, IPv6 eller Tor) - Print block on startup, if found in block index Skriv ut blokken ved oppstart, hvis funnet i blokkindeksen - - Print block tree on startup (default: 0) - Skriv ut blokktreet ved oppstart (standardverdi: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) RPC SSL-valg: (se Bitcoin Wiki for oppsettsinstruksjoner for SSL) @@ -3289,30 +3121,10 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comRandomly fuzz 1 of every <n> network messages Slumpvis bland 1 av hver <n> nettverksmeldinger - - Relay and mine data carrier transactions (default: 1) - Videresend og ufør graving av databærende transaksjoner (standardverdi: 1) - - - Relay non-P2SH multisig (default: 1) - Videresende ikke-P2SH multisig (standard: 1) - - - Run a thread to flush wallet periodically (default: 1) - Kjør en tråd som skriver lommeboken til disk periodisk (standard: 1) - Send trace/debug info to console instead of debug.log file Send spor-/feilsøkingsinformasjon til konsollen istedenfor filen debug.log - - Set minimum block size in bytes (default: 0) - Sett minimum blokkstørrelse i bytes (standardverdi: 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - Setter flagget DB_PRIVATE i miljøet til lommebokdatabasen (standard: 1) - Show all debugging options (usage: --help -help-debug) Vis alle feilsøkingsvalg (bruk: --help -help-debug) @@ -3325,14 +3137,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comSigning transaction failed Signering av transaksjon feilet - - Specify connection timeout in milliseconds (default: 5000) - Angi tidsavbrudd for forbindelse i millisekunder (standardverdi: 5000) - - - System error: - Systemfeil: - This is experimental software. Dette er eksperimentell programvare. @@ -3353,10 +3157,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comUnable to bind to %s on this computer (bind returned error %s) Kan ikke binde til %s på denne datamaskinen (binding returnerte feilen %s) - - Use UPnP to map the listening port (default: 0) - Bruk UPnP for lytteport (standardverdi: 0) - Use UPnP to map the listening port (default: 1 when listening) Bruk UPnP for lytteport (standardverdi: 1 ved lytting) @@ -3409,10 +3209,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comUpgrade wallet to latest format Oppgrader lommebok til nyeste format - - Set key pool size to <n> (default: 100) - Angi størrelsen på nøkkellageret til <n> (standardverdi: 100) - Rescan the block chain for missing wallet transactions Se gjennom blokkjeden etter manglende lommeboktransaksjoner @@ -3421,14 +3217,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comUse OpenSSL (https) for JSON-RPC connections Bruk OpenSSL (https) for JSON-RPC forbindelser - - Server certificate file (default: server.cert) - Servers sertifikat (standardverdi: server.cert) - - - Server private key (default: server.pem) - Servers private nøkkel (standardverdi: server.pem) - This help message Denne hjelpemeldingen @@ -3445,14 +3233,182 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comError loading wallet.dat: Wallet corrupted Feil ved lasting av wallet.dat: Lommeboken er skadet + + (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + (1 = behold metadata for transaksjon som f. eks. kontoeier og informasjon om betalingsanmodning, 2 = dropp metadata for transaksjon) + + + Flush database activity from memory pool to disk log every <n> megabytes (default: %u) + Overfør aktiviteten i databasen fra minnelageret til loggen på harddisken for hver <n> megabytes (standardverdi: %u) + + + How thorough the block verification of -checkblocks is (0-4, default: %u) + Hvor grundig blokkverifiseringen til -checkblocks er (0-4, standardverdi: %u) + + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: %u) + Hvis paytxfee ikke er angitt, inkluderer da nok gebyr til at transaksjoner gjennomsnittligt bekreftes innen n blokker (standardverdi: %u) + + + Log transaction priority and fee per kB when mining blocks (default: %u) + Logg transaksjonsprioritet og gebyr per kB under blokkutvinning (standardverdi: %u) + + + Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u) + Oppretthold en full transaksjonsindeks, brukt av getrawtransaction RPC-kall (standardverdi: %u) + + + Number of seconds to keep misbehaving peers from reconnecting (default: %u) + Antall sekunder noder med dårlig oppførsel hindres fra å koble til på nytt (standardverdi: %u) + + + Output debugging information (default: %u, supplying <category> is optional) + Ta ut feilsøkingsinformasjon (standardverdi: %u, bruk av <category> er valgfritt) + + + Set the processor limit for when generation is on (-1 = unlimited, default: %d) + Sett prosessorgrensen for når blokkutvinning er på (-1 = ubegrenset, standardverdi: %d) + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) + Bruk separate SOCKS5 proxyer for å nå noder via Tor skjulte tjenester (standardverdi: %s) + + + (default: %s) + (standardverdi: %s) + + + Acceptable ciphers (default: %s) + Akseptable sifre (standardverdi: %s) + + + Always query for peer addresses via DNS lookup (default: %u) + Alltid søk etter nodeadresser via DNS-oppslag (standardverdi: %u) + + + Disable safemode, override a real safe mode event (default: %u) + Slå av sikkerhetsmodus, overstyr en virkelig sikkerhetsmodushendelse (standardverdi: %u) + Error loading wallet.dat Feil ved lasting av wallet.dat + + Force safe mode (default: %u) + Tving sikkerhetsmodus (standardverdi: %u) + + + Generate coins (default: %u) + Generer mynter (standardverdi: %u) + + + How many blocks to check at startup (default: %u, 0 = all) + Hvor mange blokker skal sjekkes ved oppstart (standardverdi: %u, 0 = alle) + + + Include IP addresses in debug output (default: %u) + Inkludere IP-adresser i feilsøkingslogg (standardverdi: %u) + Invalid -proxy address: '%s' Ugyldig -proxy adresse: '%s' + + Limit size of signature cache to <n> entries (default: %u) + Begrens størrelsen på hurtigbufferen for signaturer til <n> oppføringer (standardverdi: %u) + + + Listen for JSON-RPC connections on <port> (default: %u or testnet: %u) + Lytt etter JSON-RPC tilkoblinger på <port> (standardverdi: %u eller testnett: %u) + + + Listen for connections on <port> (default: %u or testnet: %u) + Lytt etter tilkoblinger på <port> (standardverdi: %u eller testnett: %u) + + + Maintain at most <n> connections to peers (default: %u) + Hold maks <n> koblinger åpne til andre noder (standardverdi: %u) + + + Maximum per-connection receive buffer, <n>*1000 bytes (default: %u) + Maks mottaksbuffer per forbindelse, <n>*1000 bytes (standardverdi: %u) + + + Maximum per-connection send buffer, <n>*1000 bytes (default: %u) + Maks sendebuffer per forbindelse, <n>*1000 bytes (standardverdi: %u) + + + Only accept block chain matching built-in checkpoints (default: %u) + Aksepter kun blokkjeden som stemmer med innebygde sjekkpunkter (standardvalg: %u) + + + Prepend debug output with timestamp (default: %u) + Sett inn tidsstempel i front av feilsøkingsdata (standardverdi: %u) + + + Print block tree on startup (default: %u) + Skriv ut blokktreet ved oppstart (standardverdi: %u) + + + Relay and mine data carrier transactions (default: %u) + Videresend og ufør graving av databærende transaksjoner (standardverdi: %u) + + + Relay non-P2SH multisig (default: %u) + Videresend ikke-P2SH multisig (standardverdi: %u) + + + Run a thread to flush wallet periodically (default: %u) + Kjør en tråd som skriver lommeboken til disk periodisk (standardverdi: %u) + + + Server certificate file (default: %s) + Fil for tjenersertifikat (standardverdi: %s) + + + Server private key (default: %s) + Privat nøkkel for tjener (standardverdi: %s) + + + Set key pool size to <n> (default: %u) + Angi størrelse på nøkkel-lager til <n> (standardverdi: %u) + + + Set minimum block size in bytes (default: %u) + Sett minimum blokkstørrelse i bytes (standardverdi: %u) + + + Set the number of threads to service RPC calls (default: %d) + Sett antall tråder til betjening av RPC-kall (standardverdi: %d) + + + Sets the DB_PRIVATE flag in the wallet db environment (default: %u) + Setter flagget DB_PRIVATE i miljøet til lommebokdatabasen (standardverdi: %u) + + + Specify configuration file (default: %s) + Angi konfigurasjonsfil (standardverdi: %s) + + + Specify connection timeout in milliseconds (minimum: 1, default: %d) + Angi tidsavbrudd for forbindelse i millisekunder (minimum: 1, standardverdi: %d) + + + Specify pid file (default: %s) + Angi pid-fil (standardverdi: %s) + + + Spend unconfirmed change when sending transactions (default: %u) + Bruk ubekreftet veksel ved sending av transaksjoner (standardverdi: %u) + + + Stop running after importing blocks from disk (default: %u) + Avslutt etter import av blokker fra disk (standardverdi: %u) + + + Threshold for disconnecting misbehaving peers (default: %u) + Grenseverdi for å koble fra noder med dårlig oppførsel (standardverdi: %u) + Unknown network specified in -onlynet: '%s' Ukjent nettverk angitt i -onlynet '%s' diff --git a/src/qt/locale/bitcoin_nl.ts b/src/qt/locale/bitcoin_nl.ts index 0a9c6e2efa..fb81042d8e 100644 --- a/src/qt/locale/bitcoin_nl.ts +++ b/src/qt/locale/bitcoin_nl.ts @@ -3,7 +3,7 @@ AddressBookPage Double-click to edit address or label - Dubbelklik om adres of label te wijzigen + Dubbelklik om het adres of label te wijzigen Create a new address @@ -59,7 +59,7 @@ Sending addresses - Bezig met versturen adressen + Bezig met het versturen van de adressen Receiving addresses @@ -290,6 +290,10 @@ Open &URI... Open &URI... + + Bitcoin Core client + Bitcoin kern applicatie + Importing blocks from disk... Blokken aan het importeren vanaf harde schijf... @@ -342,6 +346,10 @@ &Receive &Ontvangen + + Show information about Bitcoin Core + Toon informatie over bitcoin kern + &Show / Hide &Toon / Verberg @@ -378,10 +386,6 @@ Tabs toolbar Tab-werkbalk - - [testnet] - [testnetwerk] - Bitcoin Core Bitcoin Kern @@ -422,10 +426,6 @@ No block source available... Geen bron van blokken beschikbaar... - - Processed %1 blocks of transaction history. - %1 blokken van transactiehistorie verwerkt. - %n hour(s) %n uur%n uur @@ -540,6 +540,10 @@ Adres: %4 Fee: Vergoeding: + + Dust: + Stof: + After Fee: Na vergoeding: @@ -628,6 +632,10 @@ Adres: %4 Copy priority Kopieer prioriteit + + Copy dust + Kopieër stof + Copy change Kopieer wisselgeld @@ -676,6 +684,10 @@ Adres: %4 none geen + + Can vary +/- %1 satoshi(s) per input. + Kan per input +/- %1 satoshi(s) variëren. + yes ja @@ -884,19 +896,19 @@ Adres: %4 Bitcoin Core Bitcoin Kern + + Error: Specified data directory "%1" cannot be created. + Fout: De gespecificeerde directory "%1" kan niet worden gecreëerd. + Error Fout - - GB of free space available - GB aan vrije opslagruimte beschikbaar + + %n GB of free space available + %n GB aan vrije oplsagruimte beschikbaar%n GB aan vrije oplsagruimte beschikbaar - - (of %1GB needed) - (van %1GB benodigd) - - + OpenURIDialog @@ -958,6 +970,14 @@ Adres: %4 Number of script &verification threads Aantal threads voor &scriptverificatie + + Accept connections from outside + Accepteer binnenkomende verbindingen + + + Allow incoming connections + Sta inkomende verbindingen toe + Connect to the Bitcoin network through a SOCKS proxy. Verbind met het Bitcoin-netwerk via een SOCKS-proxy. @@ -1129,10 +1149,6 @@ Adres: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. De weergegeven informatie kan verouderd zijn. Uw portemonnee synchroniseert automaticsh met het Bitcoinnetwerk nadat een verbinding is gelegd, maar dit proces is nog niet voltooid. - - Wallet - Portemonnee - Available: Beschikbaar: @@ -1166,8 +1182,8 @@ Adres: %4 Uw totale saldo - <b>Recent transactions</b> - <b>Recente transacties</b> + Recent transactions + Recente transacties out of sync @@ -1184,6 +1200,14 @@ Adres: %4 Invalid payment address %1 Ongeldig betalingsadres %1 + + Payment request rejected + Betalingsverzoek geweigerd + + + Payment request has expired. + Betalingsverzoek is verlopen. + Requested payment amount of %1 is too small (considered dust). Het gevraagde betalingsbedrag van %1 is te weinig (beschouwd als stof). @@ -1231,6 +1255,10 @@ Adres: %4 PeerTableModel + + User Agent + User Agent + QObject @@ -1238,6 +1266,14 @@ Adres: %4 Amount Bedrag + + Enter a Bitcoin address (e.g. %1) + Voer een Bitcoin-adres in (bijv. %1) + + + %1 d + %1d + %1 h %1 uur @@ -1246,11 +1282,31 @@ Adres: %4 %1 m %1 m + + %1 s + %1s + + + NETWORK + Netwerk + + + UNKNOWN + ONBEKEND + + + None + Geen + N/A N.v.t. - + + %1 ms + %1 ms + + QRImageWidget @@ -1324,6 +1380,50 @@ Adres: %4 Current number of blocks Huidig aantal blokken + + Received + Ontvangen + + + Sent + Verstuurd + + + Direction + Directie + + + Version + Versie + + + User Agent + User Agent + + + Services + Services + + + Connection Time + Connectie tijd + + + Last Send + Laatst verstuurd + + + Last Receive + Laatst ontvangen + + + Bytes Sent + Bytes Verzonden + + + Bytes Received + Bytes Ontvangen + Last block time Tijd laatste blok @@ -1400,6 +1500,18 @@ Adres: %4 %1 GB %1 Gb + + via %1 + via %1 + + + never + nooit + + + Unknown + Onbekend + ReceiveCoinsDialog @@ -1640,6 +1752,10 @@ Adres: %4 Clear all fields of the form. Wis alle velden van het formulier. + + Dust: + Stof: + Clear &All Verwijder &Alles @@ -1740,6 +1856,10 @@ Adres: %4 Warning: Unknown change address Waarschuwing: Onbekend wisselgeldadres + + Copy dust + Kopieër stof + Are you sure you want to send? Weet u zeker dat u wilt verzenden? @@ -2430,28 +2550,10 @@ Adres: %4 Options: Opties: - - Specify configuration file (default: bitcoin.conf) - Specificeer configuratiebestand (standaard: bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - Specificeer pid-bestand (standaard: bitcoind.pid) - - Specify data directory Stel datamap in - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Luister voor verbindingen op <poort> (standaard: 8333 of testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Onderhoud maximaal <n> verbindingen naar peers (standaard: 125) - Connect to a node to retrieve peer addresses, and disconnect Verbind naar een node om adressen van anderen op te halen, en verbreek vervolgens de verbinding @@ -2460,18 +2562,6 @@ Adres: %4 Specify your own public address Specificeer uw eigen publieke adres - - Threshold for disconnecting misbehaving peers (default: 100) - Drempel om verbinding te verbreken naar zich misdragende peers (standaard: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Aantal seconden dat zich misdragende peers niet opnieuw mogen verbinden (standaard: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Wacht op JSON-RPC-connecties op poort <port> (standaard: 8332 of testnet: 18332) - Accept command line and JSON-RPC commands Aanvaard commandoregel- en JSON-RPC-commando's @@ -2510,18 +2600,10 @@ Als het bestand niet bestaat, make hem dan aan met leesrechten voor enkel de eig Het is ook aan te bevelen "alertnotify" in te stellen zodat u op de hoogte gesteld wordt van problemen; bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Aanvaardbare cijfers (standaard: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Bind aan opgegeven adres en luister er altijd op. Gebruik [host]:port notatie voor IPv6 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - Doorlopend tarief-limiet op gratis transacties toepassen tot <n>*1000 bytes per minuut (standaard: 15) - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Schakel regressietest-modus in, die een speciale blokketen gebruikt waarin blokken onmiddellijk opgelost kunnen worden. @@ -2538,14 +2620,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comExecute command when a wallet transaction changes (%s in cmd is replaced by TxID) Voer opdracht uit zodra een portemonneetransactie verandert (%s in cmd wordt vervangen door TxID) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - Leeg database-activiteit uit de geheugenpool naar schijf log elke <n> megabytes (standaard: 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - Hoe grondig de blokverificatie van -checkblocks is (0-4, standaard: 3) - In this mode -genproclimit controls how many blocks are generated immediately. In deze modus, -genproclimit controleert hoeveel blokken er onmiddellijk worden gegenereerd. @@ -2554,10 +2628,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comSet the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Kies het aantal script verificatie processen (%u tot %d, 0 = auto, <0 = laat dit aantal kernen vrij, standaard: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - Kies de processorlimiet wanneer generation is aan (-1 = ongelimiteerd, standaard: -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Dit is een pre-release testversie - gebruik op eigen risico! Gebruik deze niet voor het delven van munten of handelsdoeleinden @@ -2566,10 +2636,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comUnable to bind to %s on this computer. Bitcoin Core is probably already running. Niet in staat om %s te verbinden op deze computer. Bitcoin Core draait waarschijnlijk al. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Gebruik een aparte SOCKS5 proxy om 'Tor hidden services' te bereiken (standaard: hetzelfde als -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Waarschuwing: -paytxfee is zeer hoog ingesteld. Dit zijn de transactiekosten die u betaalt bij het versturen van een transactie. @@ -2594,10 +2660,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com(default: 1) (standaard: 1) - - (default: wallet.dat) - (standaard: wallet.dat) - <category> can be: <category> kan zijn: @@ -2626,10 +2688,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comDebugging/Testing options: Foutopsporing/Testopties: - - Disable safemode, override a real safe mode event (default: 0) - Veilige modus uitschakelen, hef een echte veilige modus gebeurtenis uit (default: 0) - Discover own IP address (default: 1 when listening and no -externalip) Ontdek eigen IP-adres (standaard: 1 als er wordt geluisterd en geen -externalip is opgegeven) @@ -2666,66 +2724,10 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comError: Wallet locked, unable to create transaction! Fout: Portemonnee vergrendeld, aanmaak transactie niet mogelijk! - - Error: system error: - Fout: Systeemfout: - Failed to listen on any port. Use -listen=0 if you want this. Mislukt om op welke poort dan ook te luisteren. Gebruik -listen=0 as u dit wilt. - - Failed to read block info - Lezen van blokinformatie mislukt - - - Failed to read block - Lezen van blok mislukt - - - Failed to sync block index - Synchroniseren van blokindex mislukt - - - Failed to write block index - Schrijven van blokindex mislukt - - - Failed to write block info - Schrijven van blokinformatie mislukt - - - Failed to write block - Schrijven van blok mislukt - - - Failed to write file info - Schrijven van bestandsinformatie mislukt - - - Failed to write to coin database - Schrijven naar coindatabase mislukt - - - Failed to write transaction index - Schrijven van transactieindex mislukt - - - Failed to write undo data - Schrijven van undo-data mislukt - - - Force safe mode (default: 0) - Forceer veilige modus (default: 0) - - - Generate coins (default: 0) - Genereer munten (standaard: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Aantal te checken blokken bij het opstarten (standaard: 288, 0 = allemaal) - If <category> is not supplied, output all debugging information. Als er geen <category> is opgegeven, laat dan alle debugging informatie zien. @@ -2746,10 +2748,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comNot enough file descriptors available. Niet genoeg file descriptors beschikbaar. - - Prepend debug output with timestamp (default: 1) - Prepend debug output met tijdstempel (standaard: 1) - Rebuild block chain index from current blk000??.dat files Blokketen opnieuw opbouwen met behulp van huidige blk000??.dat-bestanden @@ -2762,18 +2760,10 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comSet maximum block size in bytes (default: %d) Stel maximum blokgrootte in in bytes (standaard: %d) - - Set the number of threads to service RPC calls (default: 4) - Stel het aantal threads in om RPC-aanvragen mee te bedienen (standaard: 4) - Specify wallet file (within data directory) Specificeer het portemonnee bestand (vanuit de gegevensmap) - - Spend unconfirmed change when sending transactions (default: 1) - Spendeer onbevestigd wisselgeld wanneer transacties verstuurd worden (standaard: 1) - This is intended for regression testing tools and app development. Dit is bedoeld voor regressie test toepassingen en applicatie onwikkeling. @@ -2810,10 +2800,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comExecute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Voer commando uit zodra een waarschuwing is ontvangen of wanneer we een erg lange fork detecteren (%s in commando wordt vervangen door bericht) - - Output debugging information (default: 0, supplying <category> is optional) - Output extra debugginginformatie (standaard: 0, het leveren van <category> is optioneel) - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Stel maximumgrootte in bytes in voor hoge-prioriteits-/lage-transactiekosten-transacties (standaard: %d) @@ -2830,42 +2816,10 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comInvalid amount for -mintxfee=<amount>: '%s' Ongeldig bedrag voor -mintxfee=<bedrag>: '%s' - - Limit size of signature cache to <n> entries (default: 50000) - Limiteer grootte van de handtekening cache tot <n> entries (default: 50000) - - - Log transaction priority and fee per kB when mining blocks (default: 0) - Log transactieprioriteit en vergoeding per kB bij mijnen blocks (standaard: 0) - - - Maintain a full transaction index (default: 0) - Onderhoud een volledige transactieindex (standaard: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Maximum per-connectie ontvangstbuffer, <n>*1000 bytes (standaard: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Maximum per-connectie zendbuffer, <n>*1000 bytes (standaard: 1000) - - - Only accept block chain matching built-in checkpoints (default: 1) - Accepteer alleen blokketen die overeenkomt met de ingebouwde checkpoints (standaard: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Verbind alleen naar nodes in netwerk <net> (IPv4, IPv6 of Tor) - Print block on startup, if found in block index Toon block bij opstarten, wanneer gevonden in block index - - Print block tree on startup (default: 0) - Toon block structuur bij opstarten (default: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) RPC SSL opties: (zie de Bitcoin Wiki voor SSL installatie-instructies) @@ -2882,22 +2836,10 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comRandomly fuzz 1 of every <n> network messages Fuzz willekeurig 1 van elke <n> netwerkberichten - - Run a thread to flush wallet periodically (default: 1) - Draai een proces om de wallet periodiek te flushen (default: 1) - Send trace/debug info to console instead of debug.log file Stuur trace/debug-info naar de console in plaats van het debug.log bestand - - Set minimum block size in bytes (default: 0) - Stel minimum blokgrootte in in bytes (standaard: 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - Plaatst de DB_PRIVATE vlag in de wallet db omgeving (default: 1) - Show all debugging options (usage: --help -help-debug) Toon alle foutopsporingsopties (gebruik: --help -help-debug) @@ -2911,12 +2853,8 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comOndertekenen van transactie mislukt - Specify connection timeout in milliseconds (default: 5000) - Specificeer de time-outtijd in milliseconden (standaard: 5000) - - - System error: - Systeemfout: + This is experimental software. + Dit is experimentele software. Transaction amount too small @@ -2930,10 +2868,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comTransaction too large Transactie te groot - - Use UPnP to map the listening port (default: 0) - Gebruik UPnP om de luisterende poort te mappen (standaard: 0) - Use UPnP to map the listening port (default: 1 when listening) Gebruik UPnP om de luisterende poort te mappen (standaard: 1 als er wordt geluisterd) @@ -2974,10 +2908,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comUpgrade wallet to latest format Vernieuw portemonnee naar nieuwste versie - - Set key pool size to <n> (default: 100) - Stel sleutelpoelgrootte in op <n> (standaard: 100) - Rescan the block chain for missing wallet transactions Doorzoek de blokketen op ontbrekende portemonnee-transacties @@ -2986,14 +2916,6 @@ bijvoorbeeld: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.comUse OpenSSL (https) for JSON-RPC connections Gebruik OpenSSL (https) voor JSON-RPC-verbindingen - - Server certificate file (default: server.cert) - Certificaat-bestand voor server (standaard: server.cert) - - - Server private key (default: server.pem) - Geheime sleutel voor server (standaard: server.pem) - This help message Dit helpbericht diff --git a/src/qt/locale/bitcoin_pam.ts b/src/qt/locale/bitcoin_pam.ts index d109c24423..c42cc73484 100644 --- a/src/qt/locale/bitcoin_pam.ts +++ b/src/qt/locale/bitcoin_pam.ts @@ -9,10 +9,22 @@ Create a new address Maglalang kang bayung address + + &New + &Bayu + Copy the currently selected address to the system clipboard Kopyan me ing salukuyan at makipiling address keng system clipboard + + &Copy + &Kopyan + + + C&lose + I&sara + &Copy Address &Kopyan ing address @@ -25,10 +37,34 @@ &Delete &Ilako + + Choose the address to send coins to + Pilinan ing address a magpadalang coins kang + + + Choose the address to receive coins with + Pilinan ing address a tumanggap coins a atin + + + C&hoose + P&ilinan + + + Sending addresses + Address king pamag-Padala + + + Receiving addresses + Address king pamag-Tanggap + These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. Reni reng kekang Bitcoin address king pamagpadalang kabayaran. Lawan mulang masalese reng alaga ampo ing address na ning tumanggap bayu ka magpadalang barya. + + These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. + Reni reng kekang Bitcoin addresses keng pamananggap bayad. Rerekomenda mi na gumamit kang bayung address keng balang transaksiyon. + Copy &Label Kopyan ing &Label @@ -278,10 +314,6 @@ Tabs toolbar Gamit para king Tabs - - [testnet] - [testnet] - Bitcoin Core Kapilubluban ning Bitcoin @@ -605,10 +637,6 @@ Address: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Ing makaltong impormasion mapalyaring luma ne. Ing kekang wallet otomatiku yang mag-synchronize keng Bitcoin network istung mekakonekta ne king network, oneng ing prosesung ini ali ya pa kumpletu. - - Wallet - Wallet - Your current spendable balance Ing kekang kasalungsungan balanse a malyari mung gastusan @@ -633,10 +661,6 @@ Address: %4 Your current total balance Ing kekang kasalungsungan kabuuang balanse - - <b>Recent transactions</b> - <b>Reng kapilan pamung transaksion</b> - out of sync ali ya maka-sync @@ -1374,26 +1398,10 @@ Address: %4 Options: Pipamilian: - - Specify configuration file (default: bitcoin.conf) - Pilinan ing configuration file(default: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Pilinan ing pid file(default: bitcoind.pid) - Specify data directory Pilinan ing data directory - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Makiramdam king koneksion king <port>(default: 8333 o testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Mag-maintain peka <n> koneksion keng peers (default: 125) - Connect to a node to retrieve peer addresses, and disconnect Kumunekta king note ban ayakua mula reng peer address, at mako king panga konekta @@ -1402,14 +1410,6 @@ Address: %4 Specify your own public address Sabyan me ing kekang pampublikong address - - Threshold for disconnecting misbehaving peers (default: 100) - Threshold for disconnecting misbehaving peers (default: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Accept command line and JSON-RPC commands Tumanggap command line at JSON-RPC commands @@ -1462,58 +1462,10 @@ Address: %4 Error: Disk space is low! Kamalian: Mababa ne ing espasyu king disk! - - Error: system error: - Kamalian: kamalian na ning sistema: - Failed to listen on any port. Use -listen=0 if you want this. Memali ya ing pamakiramdam kareng gang nanung port. Gamita me ini -listen=0 nung buri me ini. - - Failed to read block info - Me-mali king pamagbasa king impormasion ning block - - - Failed to read block - Me-mali king pamagbasa keng block - - - Failed to sync block index - Me-mali para i-sync ing block index - - - Failed to write block index - Me-mali king pamanyulat king block index - - - Failed to write block info - Me-mali king pamanyulat king block info - - - Failed to write block - Me-mali king pamanyulat block - - - Failed to write file info - Me-mali king pamanyulat king file info - - - Failed to write to coin database - Me-mali king pamanyulat king coin database - - - Failed to write transaction index - Me-mali king pamanyulat king index ning transaksion - - - Failed to write undo data - Me-mali king pamanyulat king undo data - - - How many blocks to check at startup (default: 288, 0 = all) - Pilan la reng block a lawan keng umpisa (default: 288, 0 = all) - Information &Impormasion @@ -1522,14 +1474,6 @@ Address: %4 Send trace/debug info to console instead of debug.log file Magpadalang trace/debug info okeng console kesa keng debug.log file - - Set minimum block size in bytes (default: 0) - Ilage ing pekaditak a dagul na ning block king bytes (default: 0) - - - System error: - Kamalian ning sistema: - Transaction too large Maragul yang masiadu ing transaksion @@ -1558,10 +1502,6 @@ Address: %4 Upgrade wallet to latest format I-upgrade ing wallet king pekabayung porma - - Set key pool size to <n> (default: 100) - I-set ing key pool size king <n>(default: 100) - Rescan the block chain for missing wallet transactions I-scan pasibayu ing block chain para kareng mauaualang transaksion @@ -1570,14 +1510,6 @@ Address: %4 Use OpenSSL (https) for JSON-RPC connections Gumamit OpenSSL(https) para king JSON-RPC koneksion - - Server certificate file (default: server.cert) - Server certificate file (default: server.cert) - - - Server private key (default: server.pem) - Server private key (default: server.pem) - This help message Ining saup a mensayi diff --git a/src/qt/locale/bitcoin_pl.ts b/src/qt/locale/bitcoin_pl.ts index 7cf3d042a1..25d04a0d49 100644 --- a/src/qt/locale/bitcoin_pl.ts +++ b/src/qt/locale/bitcoin_pl.ts @@ -386,10 +386,6 @@ Tabs toolbar Pasek zakładek - - [testnet] - [testnet] - Bitcoin Core Rdzeń BitCoin @@ -426,10 +422,6 @@ No block source available... Brak dostępnych źródeł bloków... - - Processed %1 blocks of transaction history. - Pobrano %1 bloków z historią transakcji. - %n hour(s) %n godzina%n godzin%n godzin @@ -888,15 +880,7 @@ Adres: %4 Error Błąd - - GB of free space available - GB dostępnego wolnego miejsca - - - (of %1GB needed) - (z %1GB potrzebnego) - - + OpenURIDialog @@ -1101,10 +1085,6 @@ Adres: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Wyświetlana informacja może być nieaktualna. Twój portfel synchronizuje się automatycznie z siecią bitcoin, zaraz po tym jak uzyskano połączenie, ale proces ten nie został jeszcze ukończony. - - Wallet - Portfel - Available: Dostępne: @@ -1137,10 +1117,6 @@ Adres: %4 Your current total balance Twoje obecne saldo - - <b>Recent transactions</b> - <b>Ostatnie transakcje</b> - out of sync desynchronizacja @@ -2346,26 +2322,10 @@ Adres: %4 Options: Opcje: - - Specify configuration file (default: bitcoin.conf) - Wskaż plik konfiguracyjny (domyślnie: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Wskaż plik pid (domyślnie: bitcoin.pid) - Specify data directory Wskaż folder danych - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Nasłuchuj połączeń na <port> (domyślnie: 8333 lub testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Utrzymuj maksymalnie <n> połączeń z peerami (domyślnie: 125) - Connect to a node to retrieve peer addresses, and disconnect Podłącz się do węzła aby otrzymać adresy peerów i rozłącz @@ -2374,18 +2334,6 @@ Adres: %4 Specify your own public address Podaj swój publiczny adres - - Threshold for disconnecting misbehaving peers (default: 100) - Próg po którym nastąpi rozłączenie nietrzymających się zasad peerów (domyślnie: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Czas w sekundach, przez jaki nietrzymający się zasad peerzy nie będą mogli ponownie się podłączyć (domyślnie: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Nasłuchuj połączeń JSON-RPC na <port> (domyślnie: 8332 or testnet: 18332) - Accept command line and JSON-RPC commands Akceptuj linię poleceń oraz polecenia JSON-RPC @@ -2425,10 +2373,6 @@ Jeśli plik nie istnieje, utwórz go z uprawnieniami tylko-do-odczytu dla właś Zalecane jest ustawienie alertnotify aby poinformować o problemach:⏎ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo.com⏎ - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Dopuszczalne szyfry (domyślnie: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Skojarz z podanym adresem. Użyj formatu [host]:port dla IPv6 @@ -2473,10 +2417,6 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo.com⏎(default: 1) (domyślnie: 1) - - (default: wallet.dat) - (domyślnie: wallet.dat) - Attempt to recover private keys from a corrupt wallet.dat Próbuj odzyskać klucze prywatne z uszkodzonego wallet.dat @@ -2537,66 +2477,10 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo.com⏎Error: Wallet locked, unable to create transaction! Błąd: Zablokowany portfel, nie można utworzyć transakcji! - - Error: system error: - Błąd: błąd systemu: - Failed to listen on any port. Use -listen=0 if you want this. Próba otwarcia jakiegokolwiek portu nie powiodła się. Użyj -listen=0 jeśli tego chcesz. - - Failed to read block info - Nie udało się odczytać informacji bloku - - - Failed to read block - Nie udało się odczytać bloku. - - - Failed to sync block index - Nie udało się zsynchronizować indeksu bloków. - - - Failed to write block index - Nie udało się zapisać indeksu bloków. - - - Failed to write block info - Nie udało się zapisać informacji bloku - - - Failed to write block - Nie udało się zapisać bloku - - - Failed to write file info - Nie udało się zapisać informacji o pliku - - - Failed to write to coin database - Nie udało się zapisać do bazy monet - - - Failed to write transaction index - Nie udało się zapisać indeksu transakcji - - - Failed to write undo data - Nie udało się zapisać danych odtwarzających - - - Force safe mode (default: 0) - Wymuś tryb bezpieczny (domyślnie: 0) - - - Generate coins (default: 0) - Generuj monety (domyślnie: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Ile bloków sprawdzić przy starcie (domyślnie: 288, 0 = wszystkie) - Importing... Importowanie… @@ -2625,18 +2509,10 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo.com⏎Set maximum block size in bytes (default: %d) Ustaw maksymalną wielkość bloku w bajtach (domyślnie: %d) - - Set the number of threads to service RPC calls (default: 4) - Ustaw liczbę wątków do odwołań RPC (domyślnie: 4) - Specify wallet file (within data directory) Określ plik portfela (w obrębie folderu danych) - - Spend unconfirmed change when sending transactions (default: 1) - Wydawaj niepotwierdzoną resztę podczas wysyłania transakcji (domyślnie: 1) - Verifying blocks... Weryfikacja bloków... @@ -2681,46 +2557,14 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo.com⏎Invalid amount for -mintxfee=<amount>: '%s' Nieprawidłowa kwota dla -mintxfee=<amount>: '%s' - - Limit size of signature cache to <n> entries (default: 50000) - Ogranicz rozmiar pamięci podręcznej sygnatur do <n> wpisów (domyslnie: 50000) - - - Log transaction priority and fee per kB when mining blocks (default: 0) - Loguj priorytety transakcji i opłaty na kB podczas kopania bloków (domyślnie: 0) - - - Maintain a full transaction index (default: 0) - Utrzymuj pełen indeks transakcji (domyślnie: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Maksymalny bufor odbioru na połączenie, <n>*1000 bajtów (domyślnie: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Maksymalny bufor wysyłu na połączenie, <n>*1000 bajtów (domyślnie: 1000) - Node relay options: Opcje przekaźnikowe węzła: - - Only accept block chain matching built-in checkpoints (default: 1) - Akceptuj tylko łańcuch bloków zgodny z wbudowanymi punktami kontrolnymi (domyślnie: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Łącz z węzłami tylko w sieci <net> (IPv4, IPv6 lub Tor) - Print block on startup, if found in block index Wyświetlaj blok podczas uruchamiania, jeżeli znaleziono indeks bloków - - Print block tree on startup (default: 0) - Wypisz drzewo bloków podczas uruchomienia (domyślnie: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) Opcje RPC SSL: (odwiedź Bitcoin Wiki w celu uzyskania instrukcji) @@ -2737,18 +2581,10 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo.com⏎Randomly fuzz 1 of every <n> network messages Losowo ignoruje 1 z wszystkich <n> wiadomości sieciowych. - - Run a thread to flush wallet periodically (default: 1) - Uruchom wątek do okresowego zapisywania portfela (domyślnie: 1) - Send trace/debug info to console instead of debug.log file Wyślij informację/raport do konsoli zamiast do pliku debug.log. - - Set minimum block size in bytes (default: 0) - Ustaw minimalny rozmiar bloku w bajtach (domyślnie: 0) - Show all debugging options (usage: --help -help-debug) Pokaż wszystkie opcje odpluskwiania (użycie: --help -help-debug) @@ -2761,14 +2597,6 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo.com⏎Signing transaction failed Podpisywanie transakcji nie powiodło się - - Specify connection timeout in milliseconds (default: 5000) - Wskaż czas oczekiwania bezczynności połączenia w milisekundach (domyślnie: 5000) - - - System error: - Błąd systemu: - This is experimental software. To oprogramowanie eksperymentalne. @@ -2785,10 +2613,6 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo.com⏎Transaction too large Transakcja zbyt duża - - Use UPnP to map the listening port (default: 0) - Używaj UPnP do mapowania portu nasłuchu (domyślnie: 0) - Use UPnP to map the listening port (default: 1 when listening) Używaj UPnP do mapowania portu nasłuchu (domyślnie: 1 gdy nasłuchuje) @@ -2829,10 +2653,6 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo.com⏎Upgrade wallet to latest format Zaktualizuj portfel do najnowszego formatu. - - Set key pool size to <n> (default: 100) - Ustaw rozmiar puli kluczy na <n> (domyślnie: 100) - Rescan the block chain for missing wallet transactions Przeskanuj blok łańcuchów żeby znaleźć zaginione transakcje portfela @@ -2841,14 +2661,6 @@ na przykład: alertnotify=echo %%s | mail -s "Alarm Bitcoin" admin@foo.com⏎Use OpenSSL (https) for JSON-RPC connections Użyj OpenSSL (https) do połączeń JSON-RPC - - Server certificate file (default: server.cert) - Plik certyfikatu serwera (domyślnie: server.cert) - - - Server private key (default: server.pem) - Klucz prywatny serwera (domyślnie: server.pem) - This help message Ta wiadomość pomocy diff --git a/src/qt/locale/bitcoin_pt_BR.ts b/src/qt/locale/bitcoin_pt_BR.ts index 0cdb7d6694..cbd730bde4 100644 --- a/src/qt/locale/bitcoin_pt_BR.ts +++ b/src/qt/locale/bitcoin_pt_BR.ts @@ -390,10 +390,6 @@ Tabs toolbar Barra de ferramentas - - [testnet] - [testnet] - Bitcoin Core Núcleo Bitcoin @@ -434,10 +430,6 @@ No block source available... Nenhum servidor disponível... - - Processed %1 blocks of transaction history. - Processado %1 blocos do histórico de transações. - %n hour(s) %n hora%n horas @@ -915,15 +907,7 @@ Endereço: %4 Error Erro - - GB of free space available - GB de espaço disponível - - - (of %1GB needed) - (Mais de %1GB necessário) - - + OpenURIDialog @@ -1164,10 +1148,6 @@ Endereço: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. A informação mostrada pode estar desatualizada. Sua carteira sincroniza automaticamente com a rede Bitcoin depois que a conexão é estabelecida, mas este processo pode não estar completo ainda. - - Wallet - Carteira - Watch-only: Apenas visualizar: @@ -1208,10 +1188,6 @@ Endereço: %4 Your current balance in watch-only addresses Sua balança atual em endereços apenas visualizados - - <b>Recent transactions</b> - <b>Transações recentes</b> - out of sync fora de sincronia @@ -1282,7 +1258,11 @@ Endereço: %4 PeerTableModel - + + Ping Time + Tempo de Ping + + QObject @@ -1415,6 +1395,10 @@ Endereço: %4 &Peers &Pares + + Direction + Direção + Version Versão @@ -1423,6 +1407,30 @@ Endereço: %4 Services Serviços + + Ban Score + Banir pontuação + + + Last Send + Ultimo Envio + + + Last Receive + Ultimo Recebido + + + Bytes Sent + Bytes Enviados + + + Bytes Received + bytes Recebidos + + + Ping Time + Tempo de Ping + Last block time Horário do último bloco @@ -1515,14 +1523,6 @@ Endereço: %4 Outbound Saída - - Yes - Sim - - - No - Não - Unknown Desconhecido @@ -1910,6 +1910,10 @@ Endereço: %4 This is a normal payment. Este é um pagamento normal. + + The Bitcoin address to send the payment to + O enderesso Bitcoin que enviarár o pagamento + Alt+A Alt+A @@ -1980,6 +1984,10 @@ Endereço: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. Você pode assinar mensagens com seus endereços para provar que você é o dono deles. Seja cuidadoso para não assinar algo vago, pois ataques de pishing podem tentar te enganar para dar sua assinatura de identidade para eles. Apenas assine afirmações completamente detalhadas com as quais você concorda. + + The Bitcoin address to sign the message with + O enderesso Bitcoin que assinará a mensagem + Choose previously used address Escolha um endereço usado anteriormente @@ -2032,6 +2040,10 @@ Endereço: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Forneça o endereço da assinatura, a mensagem (se assegure que você copiou quebras de linha, espaços, tabs, etc. exatamente) e a assinatura abaixo para verificar a mensagem. Cuidado para não ler mais na assinatura do que está escrito na mensagem propriamente, para evitar ser vítima de uma ataque do tipo "man-in-the-middle". + + The Bitcoin address the message was signed with + O enderesso Bitcoin que assionou a mesnagem + Verify the message to ensure it was signed with the specified Bitcoin address Verificar mensagem para se assegurar que ela foi assinada pelo dono de um endereço Bitcoin específico. @@ -2173,6 +2185,10 @@ Endereço: %4 own address seu próprio endereço + + watch-only + Vizualização apenas + label rótulo @@ -2193,6 +2209,14 @@ Endereço: %4 Debit Débito + + Total debit + Débito total + + + Total credit + Credito total + Transaction fee Taxa de transação @@ -2343,6 +2367,10 @@ Endereço: %4 Mined Minerado + + watch-only + Vizualização apenas + (n/a) (n/a) @@ -2454,6 +2482,10 @@ Endereço: %4 Export Transaction History Exportar Histórico de Transação + + Watch-only + Vizualização apenas + Exporting Failed Exportação Falhou @@ -2565,26 +2597,10 @@ Endereço: %4 Options: Opções: - - Specify configuration file (default: bitcoin.conf) - Especifique um arquivo de configurações (padrão: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Especifique um arquivo de pid (padrão: bitcoind.pid) - Specify data directory Especificar diretório de dados - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Procurar por conexões em <port> (padrão: 8333 ou testnet:18333) - - - Maintain at most <n> connections to peers (default: 125) - Manter no máximo <n> conexões aos peers (padrão: 125) - Connect to a node to retrieve peer addresses, and disconnect Conectar a um nó para receber endereços de participantes, e desconectar. @@ -2593,18 +2609,6 @@ Endereço: %4 Specify your own public address Especificar seu próprio endereço público - - Threshold for disconnecting misbehaving peers (default: 100) - Limite para desconectar peers mal comportados (padrão: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Número de segundos para impedir que peers mal comportados reconectem (padrão: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Escutar conexões JSON-RPC na porta <porta> (padrão: 8332 ou testnet: 18332) - Accept command line and JSON-RPC commands Aceitar linha de comando e comandos JSON-RPC @@ -2645,18 +2649,10 @@ Se o arquivo não existir, crie um com permissão de leitura apenas para o dono. por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Codificadores aceitos (padrão: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Vincular ao endereço fornecido e sempre escutar nele. Use a notação [host]:port para IPv6 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - Restringe a taxa de transações gratuitas para <n>*1000 bytes por minuto (padrão:15) - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Entra no modo de teste de regressão, que usa uma cadeia especial onde os blocos podem ser resolvidos instantaneamente. @@ -2673,14 +2669,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Executar comando quando uma transação da carteira mudar (%s no comando será substituído por TxID) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - Descarrega a atividade do banco de dados da memória para log em disco a cada <n> megabytes (padrão: 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - Quão completa a verificação de blocos do -checkblocks é (0-4, padrão: 3) - In this mode -genproclimit controls how many blocks are generated immediately. Neste modo -genproclimit controla quantos blocos são gerados imediatamente. @@ -2689,10 +2677,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Define o número de threads de verificação de script (%u a %d, 0 = automático, <0 = número de cores deixados livres, padrão: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - Define o limite de processador para quando geração está ativa (-1 = ilimitada, padrão: -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Este pode ser um build de teste pré-lançamento - use por sua conta e risco - não use para mineração ou aplicações de comércio. @@ -2701,10 +2685,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Unable to bind to %s on this computer. Bitcoin Core is probably already running. Impossível ouvir em %s neste computador. Bitcoin Core já está sendo executado provavelmente. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Use proxy SOCKS5 separado para alcançar nós via Tor hidden services (padrão: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Atenção: valor de -paytxfee escolhido é muito alto! Este é o valor da taxa de transação que você irá pagar se enviar a transação. @@ -2729,10 +2709,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ (default: 1) (padrão: 1) - - (default: wallet.dat) - (padrão: wallet.dat) - <category> can be: <category> pode ser: @@ -2761,10 +2737,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Debugging/Testing options: Opções de Debug/Teste: - - Disable safemode, override a real safe mode event (default: 0) - Desabilita modo seguro, sobrepõe um evento de modo seguro real (padrão: 0) - Discover own IP address (default: 1 when listening and no -externalip) Descobrir os próprios endereços IP (padrão: 1 quando no modo listening e opção -externalip não estiver presente) @@ -2793,6 +2765,10 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Error opening block database Erro ao abrir banco de dados de blocos + + Error: A fatal internal error occured, see debug.log for details + Erro: Um erro interno fatal ocorreu, ver o debug.log para detalhes + Error: Disk space is low! Erro: Espaço em disco insuficiente! @@ -2801,66 +2777,10 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Error: Wallet locked, unable to create transaction! Erro: Carteira bloqueada, impossível criar transação! - - Error: system error: - Erro: erro de sistema - Failed to listen on any port. Use -listen=0 if you want this. Falha ao escutar em qualquer porta. Use -listen=0 se você quiser isso. - - Failed to read block info - Falha ao ler informação de bloco - - - Failed to read block - Falha ao ler bloco - - - Failed to sync block index - Falha ao sincronizar índice de blocos - - - Failed to write block index - Falha ao escrever índice de blocos - - - Failed to write block info - Falha ao escrever informações de bloco - - - Failed to write block - Falha ao escrever bloco - - - Failed to write file info - Falha ao escrever informções de arquivo - - - Failed to write to coin database - Falha ao escrever banco de dados de moedas - - - Failed to write transaction index - Falha ao escrever índice de transações - - - Failed to write undo data - Falha ao escrever dados para desfazer ações - - - Force safe mode (default: 0) - Força modo seguro (padrão: 0) - - - Generate coins (default: 0) - Gerar moedas (padrão: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Quantos blocos checar ao inicializar (padrão: 288, 0 = todos) - If <category> is not supplied, output all debugging information. Se <category> não for informada, logar toda informação de debug. @@ -2881,10 +2801,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Not enough file descriptors available. Decriptadores de arquivos disponíveis insuficientes. - - Prepend debug output with timestamp (default: 1) - Adiciona timestamp como prefixo no debug (padrão: 1) - Rebuild block chain index from current blk000??.dat files Reconstruir índice de blockchain a partir dos arquivos atuais blk000??.dat @@ -2897,22 +2813,10 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Set maximum block size in bytes (default: %d) Define o tamanho máximo de cada bloco em bytes (padrão: %d) - - Set the number of threads to service RPC calls (default: 4) - Defina o número de threads de chamadas RPC (padrão: 4) - Specify wallet file (within data directory) Especifique o arquivo da carteira (dentro do diretório de dados) - - Spend unconfirmed change when sending transactions (default: 1) - Permite gastar troco não confirmado ao criar transações (padrão: 1) - - - Stop running after importing blocks from disk (default: 0) - Parar de executar após importar blocos do disco (padrão: 0) - This is intended for regression testing tools and app development. Isso é usado para testes de regressão e ferramentas de desenvolvimento. @@ -2953,10 +2857,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Error: Listening for incoming connections failed (listen returned error %s) Erro: Escutar por conexões de entrada falhou (escutar retornou erro %s) - - Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) - Executa comando quando uma transação da rede gasta novamente uma transação de entrada da carteira (%s=TxID do gasto duplo, %t=TxID da Carteira) - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Executa o comando quando um alerta relevante é recebido ou vemos uma longa segregação (%s em cmd é substituído pela mensagem) @@ -2969,10 +2869,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) Taxas (em BTC/Kb) menores do que este valor são consideradas inexistentes para a criação da transação (padrão: %s) - - Output debugging information (default: 0, supplying <category> is optional) - Informação de saída de debug (padrão: 0, definir <category> é opcional) - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Define o tamanho máximo de alta-prioridade por taxa baixa nas transações em bytes (padrão: %d) @@ -2981,6 +2877,10 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Cannot resolve -whitebind address: '%s' Impossível resolver endereço -whitebind: '%s' + + Connect through SOCKS5 proxy + Connecte-se através de um proxy SOCKS5 + Copyright (C) 2009-%i The Bitcoin Core Developers Copyright (C) 2009-%i Desenvolvedores Bitcoin Core @@ -2993,10 +2893,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Fee (in BTC/kB) to add to transactions you send (default: %s) Taxa (em BTC/kB) a adicionar nas transações que você envia (padrão: %s) - - Include IP addresses in debug output (default: 0) - Incluir endereços IP na saída de depuração (padrão: 0) - Information Informação @@ -3021,46 +2917,14 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Keep at most <n> unconnectable blocks in memory (default: %u) Manter no máximo <n> blocos pendentes em memória (padrão: %u) - - Limit size of signature cache to <n> entries (default: 50000) - Limita tamanho do cache de assinaturas em <n> entradas (padrão: 50000) - - - Log transaction priority and fee per kB when mining blocks (default: 0) - Registra log da prioridade de transação e taxa por kB quando minerando blocos (padrão: 0) - - - Maintain a full transaction index (default: 0) - Manter índice completo de transações (padrão: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Buffer máximo de recebimento por conexão, <n>*1000 bytes (padrão: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Buffer máximo de envio por conexão, <n>*1000 bytes (padrão: 1000) - Need to specify a port with -whitebind: '%s' Necessário informar uma porta com -whitebind: '%s' - - Only accept block chain matching built-in checkpoints (default: 1) - Apenas aceitar cadeia de blocos correspondente a marcas de verificação internas (padrão: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Apenas conectar em nós na rede <net> (IPv4, IPv6, ou Tor) - Print block on startup, if found in block index Imprime bloco ao iniciar, se encontrado no índice de blocos - - Print block tree on startup (default: 0) - Imprime árvore de blocos ao iniciar (padrão: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) Opções RPC SSL: (veja o Bitcoin Wiki para instruções de configuração SSL) @@ -3077,22 +2941,10 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Randomly fuzz 1 of every <n> network messages Aleatoriamente embaralha 1 em cada <n> mensagens da rede - - Run a thread to flush wallet periodically (default: 1) - Executa uma thread para limpar a carteira periodicamente (padrão: 1) - Send trace/debug info to console instead of debug.log file Mandar informação de trace/debug para o console em vez de para o arquivo debug.log - - Set minimum block size in bytes (default: 0) - Determinar tamanho mínimo de bloco em bytes (padrão: 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - Define a flag DB_PRIVATE no ambiente de banco de dados da carteira (padrão: 1) - Show all debugging options (usage: --help -help-debug) Exibir todas opções de debug (uso: --help -help-debug) @@ -3105,14 +2957,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Signing transaction failed Assinatura de transação falhou - - Specify connection timeout in milliseconds (default: 5000) - Especifique o tempo limite (timeout) da conexão em milissegundos (padrão: 5000) - - - System error: - Erro de sistema: - This is experimental software. Este é um software experimental. @@ -3133,10 +2977,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Unable to bind to %s on this computer (bind returned error %s) Impossível se ligar a %s neste computador (bind retornou erro %s) - - Use UPnP to map the listening port (default: 0) - Usar UPnP para mapear porta de escuta (padrão: 0) - Use UPnP to map the listening port (default: 1 when listening) Usar UPnP para mapear porta de escuta (padrão: 1 quando estiver escutando) @@ -3145,6 +2985,10 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Username for JSON-RPC connections Nome de usuário para conexões JSON-RPC + + Wallet needed to be rewritten: restart Bitcoin Core to complete + Sua carteira precisou ser reescrita: favor reiniciar o Bitcoin para completar + Warning Atenção @@ -3177,10 +3021,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Upgrade wallet to latest format Atualizar carteira para o formato mais recente - - Set key pool size to <n> (default: 100) - Determinar tamanho do pool de endereços para <n> (padrão: 100) - Rescan the block chain for missing wallet transactions Re-escanear blocos procurando por transações perdidas da carteira @@ -3189,14 +3029,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Use OpenSSL (https) for JSON-RPC connections Usar OpenSSL (https) para conexões JSON-RPC - - Server certificate file (default: server.cert) - Arquivo de certificado do servidor (padrão: server.cert) - - - Server private key (default: server.pem) - Chave privada do servidor (padrão: server.pem) - This help message Esta mensagem de ajuda @@ -3221,6 +3053,10 @@ por exemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com⏎ Invalid -proxy address: '%s' Endereço -proxy inválido: '%s' + + Specify pid file (default: %s) + Especificar aqrquivo pid (default: %s) + Unknown network specified in -onlynet: '%s' Rede desconhecida especificada em -onlynet: '%s' diff --git a/src/qt/locale/bitcoin_pt_PT.ts b/src/qt/locale/bitcoin_pt_PT.ts index 2d277528b1..edb1e87b6f 100644 --- a/src/qt/locale/bitcoin_pt_PT.ts +++ b/src/qt/locale/bitcoin_pt_PT.ts @@ -179,6 +179,10 @@ Wallet encrypted Carteira encriptada + + 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>. + Escreva a nova frase de seguraça da sua carteira. <br/> Por favor, use uma frase de <b>10 ou mais caracteres aleatórios,</b> ou <b>oito ou mais palavras</b>. + Bitcoin 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. O cliente Bitcoin irá agora ser fechado para terminar o processo de encriptação. Recorde que a encriptação da sua carteira não protegerá totalmente os seus bitcoins de serem roubados por programas maliciosos que infectem o seu computador. @@ -374,10 +378,6 @@ Tabs toolbar Barra de separadores - - [testnet] - [rede de testes] - Bitcoin Core Bitcoin Core @@ -418,10 +418,6 @@ No block source available... Nenhuma fonte de blocos disponível... - - Processed %1 blocks of transaction history. - Processados %1 blocos do histórico de transações. - %n hour(s) %n hora%n horas @@ -875,15 +871,7 @@ Endereço: %4 Error Erro - - GB of free space available - GB de espaço livre disponível - - - (of %1GB needed) - (de %1GB necessários) - - + OpenURIDialog @@ -1104,10 +1092,6 @@ Endereço: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. A informação mostrada poderá estar desatualizada. A sua carteira sincroniza automaticamente com a rede Bitcoin depois de estabelecer ligação, mas este processo ainda não está completo. - - Wallet - Carteira - Available: Disponível: @@ -1140,10 +1124,6 @@ Endereço: %4 Your current total balance O seu saldo total actual - - <b>Recent transactions</b> - <b>Transações recentes</b> - out of sync fora de sincronia @@ -1159,6 +1139,10 @@ Endereço: %4 Invalid payment address %1 Endereço de pagamento inválido %1 + + Payment request rejected + Pedido de pagamento rejeitado + Requested payment amount of %1 is too small (considered dust). Quantia solicitada para pagamento de %1 é muito pequena (considerada "pó"). @@ -2405,26 +2389,10 @@ Endereço: %4 Options: Opções: - - Specify configuration file (default: bitcoin.conf) - Especificar ficheiro de configuração (por defeito: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Especificar ficheiro pid (por defeito: bitcoind.pid) - Specify data directory Especificar pasta de dados - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Escute ligações na porta <n> (por defeito: 8333 ou testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Manter no máximo <n> ligações a outros nós da rede (por defeito: 125) - Connect to a node to retrieve peer addresses, and disconnect Ligar a um nó para recuperar endereços de pares, e desligar @@ -2433,18 +2401,6 @@ Endereço: %4 Specify your own public address Especifique o seu endereço público - - Threshold for disconnecting misbehaving peers (default: 100) - Tolerância para desligar nós com comportamento indesejável (por defeito: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Número de segundos a impedir que nós com comportamento indesejado se liguem de novo (por defeito: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Escutar por ligações JSON-RPC na porta <n> (por defeito: 8332 ou rede de testes: 18332) - Accept command line and JSON-RPC commands Aceitar comandos de linha de comandos e JSON-RPC @@ -2484,10 +2440,6 @@ Se o ficheiro não existir, crie-o com permissões de leitura apenas para o dono Também é recomendado definir um alertnotify para que seja alertado sobre problemas; por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Cifras aceitáveis (por defeito: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Associar a endereço específico e escutar sempre nele. Use a notação [anfitrião]:porta para IPv6 @@ -2516,10 +2468,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.comUnable to bind to %s on this computer. Bitcoin Core is probably already running. Incapaz de vincular à porta %s neste computador. O Bitcoin Core provavelmente já está a correr. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Usar um proxy SOCKS5 separado para aceder a pares através de Tor hidden services (por defeito: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Atenção: -paytxfee está definida com um valor muito alto! Esta é a taxa que irá pagar se enviar uma transação. @@ -2596,62 +2544,10 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.comError: Wallet locked, unable to create transaction! Erro: Carteira bloqueada, incapaz de criar transação! - - Error: system error: - Erro: erro do sistema: - Failed to listen on any port. Use -listen=0 if you want this. Falhou a escutar em qualquer porta. Use -listen=0 se quiser isto. - - Failed to read block info - Falha ao ler informação do bloco - - - Failed to read block - Falha ao ler bloco - - - Failed to sync block index - Falha ao sincronizar índice de blocos - - - Failed to write block index - Falha ao escrever índice de blocos - - - Failed to write block info - Falha ao escrever informação do bloco - - - Failed to write block - Falha ao escrever bloco - - - Failed to write file info - Falha ao escrever informação do ficheiro - - - Failed to write to coin database - Falha ao escrever na base de dados de moedas - - - Failed to write transaction index - Falha ao escrever índice de transações - - - Failed to write undo data - Falha ao escrever histórico de modificações - - - Generate coins (default: 0) - Gerar moedas (por defeito: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Quantos blocos verificar ao inicializar (por defeito: 288, 0 = todos) - If <category> is not supplied, output all debugging information. Se uma <categoria> não é fornecida, imprimir toda a informação de depuração. @@ -2668,10 +2564,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.comNot enough file descriptors available. Os descritores de ficheiros disponíveis são insuficientes. - - Prepend debug output with timestamp (default: 1) - Adicionar data e hora à informação de depuração (por defeito: 1) - Rebuild block chain index from current blk000??.dat files Reconstruir a cadeia de blocos a partir dos ficheiros blk000??.dat atuais @@ -2684,18 +2576,10 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.comSet maximum block size in bytes (default: %d) Definir tamanho máximo por bloco em bytes (por defeito: %d) - - Set the number of threads to service RPC calls (default: 4) - Defina o número de processos para servir as chamadas RPC (por defeito: 4) - Specify wallet file (within data directory) Especifique ficheiro de carteira (dentro da pasta de dados) - - Spend unconfirmed change when sending transactions (default: 1) - Gastar saldo não confirmado ao enviar transações (padrão: 1) - This is intended for regression testing tools and app development. Isto têm como fim a realização de testes de regressão para pools e desenvolvimento de aplicações. @@ -2732,10 +2616,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.comExecute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Executar comando quando um alerta relevante for recebido ou em caso de uma divisão longa da cadeia de blocos (no comando, %s é substituído pela mensagem) - - Output debugging information (default: 0, supplying <category> is optional) - Informação de depuração (por defeito: 0, fornecer uma <categoria> é opcional) - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Definir tamanho máximo de transações com alta-prioridade/baixa-taxa em bytes (por defeito: %d) @@ -2752,34 +2632,10 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.comInvalid amount for -mintxfee=<amount>: '%s' Quantia inválida para -mintxfee=<quantidade>: '%s' - - Maintain a full transaction index (default: 0) - Manter índice de transações completo (por defeito: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Maximo armazenamento intermédio de recepção por ligação, <n>*1000 bytes (por defeito: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Maximo armazenamento intermédio de envio por ligação, <n>*1000 bytes (por defeito: 1000) - - - Only accept block chain matching built-in checkpoints (default: 1) - Apenas aceitar cadeia de blocos coincidente com pontos de controle internos (por defeito: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Apenas ligar a nós na rede <net> (IPv4, IPv6 ou Tor) - Send trace/debug info to console instead of debug.log file Enviar informação de rastreio/depuração para a consola e não para o ficheiro debug.log - - Set minimum block size in bytes (default: 0) - Definir tamanho minímo de um bloco em bytes (por defeito: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Encolher ficheiro debug.log ao iniciar o cliente (por defeito: 1 sem -debug definido) @@ -2788,14 +2644,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.comSigning transaction failed Falhou assinatura da transação - - Specify connection timeout in milliseconds (default: 5000) - Especificar tempo de espera da ligação em millisegundos (por defeito: 5000) - - - System error: - Erro de sistema: - Transaction amount too small Quantia da transação é muito baixa @@ -2808,10 +2656,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.comTransaction too large Transação grande demais - - Use UPnP to map the listening port (default: 0) - Usar UPnP para mapear a porta de escuta (padrão: 0) - Use UPnP to map the listening port (default: 1 when listening) Usar UPnP para mapear a porta de escuta (padrão: 1 ao escutar) @@ -2848,10 +2692,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.comUpgrade wallet to latest format Atualize a carteira para o formato mais recente - - Set key pool size to <n> (default: 100) - Definir o tamanho da memória de chaves para <n> (por defeito: 100) - Rescan the block chain for missing wallet transactions Procurar transações em falta na cadeia de blocos @@ -2860,14 +2700,6 @@ por exemplo: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.comUse OpenSSL (https) for JSON-RPC connections Usar OpenSSL (https) para ligações JSON-RPC - - Server certificate file (default: server.cert) - Ficheiro de certificado do servidor (por defeito: server.cert) - - - Server private key (default: server.pem) - Chave privada do servidor (por defeito: server.pem) - This help message Esta mensagem de ajuda diff --git a/src/qt/locale/bitcoin_ro_RO.ts b/src/qt/locale/bitcoin_ro_RO.ts index c9cad3d92a..a20bc677a0 100644 --- a/src/qt/locale/bitcoin_ro_RO.ts +++ b/src/qt/locale/bitcoin_ro_RO.ts @@ -274,6 +274,14 @@ &Change Passphrase... S&chimbă parola... + + &Sending addresses... + &Trimitere adrese... + + + &Receiving addresses... + &Primire adrese... + Open &URI... Vizitaţi &URI... @@ -366,10 +374,6 @@ Tabs toolbar Bara de file - - [testnet] - [testnet] - Bitcoin Core Bitcoin Core @@ -398,6 +402,10 @@ &Command-line options Command-line setări + + Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options + Arată mesajul de ajutor Bitcoin Core pentru a obține o listă cu opțiunile posibile de linii de comandă Bitcoin + %n active connection(s) to Bitcoin network %n conexiune activă către rețeaua Bitcoin%n conexiuni active către rețeaua Bitcoin%n de conexiuni active către rețeaua Bitcoin @@ -406,10 +414,6 @@ No block source available... Nici o sursă de bloc disponibil ... - - Processed %1 blocks of transaction history. - S-au procesat %1 blocuri din istoricul tranzacțiilor. - %n hour(s) %n oră%n ore%n ore @@ -844,15 +848,7 @@ Adresa: %4 Error Eroare - - GB of free space available - GB de spațiu liber disponibil - - - (of %1GB needed) - (din %1GB necesari) - - + OpenURIDialog @@ -1037,10 +1033,6 @@ Adresa: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Informațiile afișate pot neactualizate. Portofelul tău se sincronizează automat cu rețeaua Bitcoin după ce o conexiune este stabilită, dar acest proces nu a fost finalizat încă. - - Wallet - Portofel - Available: Disponibil: @@ -1073,10 +1065,6 @@ Adresa: %4 Your current total balance Balanța totală curentă - - <b>Recent transactions</b> - <b>Tranzacții recente</b> - out of sync Nu este sincronizat @@ -2278,26 +2266,10 @@ Adresa: %4 Options: Setări: - - Specify configuration file (default: bitcoin.conf) - Specifică fișierul de configurare (implicit: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Specifică fișierul pid (implicit bitcoind.pid) - Specify data directory Specifică dosarul de date - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Ascultă pentru conectări pe <port> (implicit: 8333 sau testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Menține cel mult <n> conexiuni cu partenerii (implicit: 125) - Connect to a node to retrieve peer addresses, and disconnect Conectează-te la nod pentru a obține adresele partenerilor, și apoi deconectează-te @@ -2306,18 +2278,6 @@ Adresa: %4 Specify your own public address Specifică adresa ta publică - - Threshold for disconnecting misbehaving peers (default: 100) - Prag pentru deconectarea partenerilor care nu funcționează corect (implicit: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Numărul de secunde pentru a preveni reconectarea partenerilor care nu funcționează corect (implicit: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Ascultă pentru conexiuni JSON-RPC pe <port> (implicit:8332 sau testnet: 18332) - Accept command line and JSON-RPC commands Se acceptă comenzi din linia de comandă și comenzi JSON-RPC @@ -2359,10 +2319,6 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Cifruri acceptabile (implicit: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Atasati adresei date si ascultati totdeauna pe ea. Folositi [host]:port notatia pentru IPv6 @@ -2383,10 +2339,6 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.com This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Aceasta este o versiune de test preliminara - va asumati riscul folosind-o - nu folositi pentru minerit sau aplicatiile comerciantilor. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Utilizare proxy SOCKS5 separat pentru a ajunge la servicii ascunse TOR (implicit: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Atentie: setarea -paytxfee este foarte ridicata! Aceasta este taxa tranzactiei pe care o vei plati daca trimiti o tranzactie. @@ -2459,66 +2411,10 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.com Error: Wallet locked, unable to create transaction! Eroare: Portofel blocat, nu se poate crea o tranzacție! - - Error: system error: - Eroare: eroare de sistem: - Failed to listen on any port. Use -listen=0 if you want this. Am esuat ascultarea pe orice port. Folositi -listen=0 daca vreti asta. - - Failed to read block info - Citirea informațiilor despre bloc a eșuat - - - Failed to read block - Citirea blocului a eșuat - - - Failed to sync block index - A eșuat sincronizarea indexului de blocuri - - - Failed to write block index - A eșuat scrierea indexului de blocuri - - - Failed to write block info - Scrierea informațiilor despre bloc a eșuat - - - Failed to write block - Scrierea blocului a eșuat - - - Failed to write file info - Nu a reușit scrierea informației în fișier - - - Failed to write to coin database - Eșuarea scrierii în baza de date de monede - - - Failed to write transaction index - Nu a reușit scrierea indexului de tranzacție - - - Failed to write undo data - Esuare in scrierea datelor anulate - - - Force safe mode (default: 0) - Pornire fortata a modului safe mode (prestabilit: 0) - - - Generate coins (default: 0) - Generează monede (implicit: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Cate block-uri se verifica la initializare (implicit: 288, 0=toate) - Incorrect or no genesis block found. Wrong datadir for network? Incorect sau nici un bloc de Geneza găsite. Directorul de retea greşit? @@ -2539,10 +2435,6 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.com Set maximum block size in bytes (default: %d) Setaţi dimensiunea maximă a unui block în bytes (implicit: %d) - - Set the number of threads to service RPC calls (default: 4) - Stabileste numarul de thread-uri care servesc apeluri RPC (implicit: 4) - Specify wallet file (within data directory) Specifică fișierul wallet (în dosarul de date) @@ -2591,42 +2483,14 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.com Invalid amount for -mintxfee=<amount>: '%s' Suma invalida pentru -mintxfee=<suma>: '%s' - - Maintain a full transaction index (default: 0) - Păstrează un index complet al tranzacțiilor (implicit: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Tampon maxim pentru recepție per conexiune, <n>*1000 baiți (implicit: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Tampon maxim pentru transmitere per conexiune, <n>*1000 baiți (implicit: 1000) - - - Only accept block chain matching built-in checkpoints (default: 1) - Se accepta decat lantul de block care se potriveste punctului de control implementat (implicit: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Efectuează conexiuni doar către nodurile din rețeaua <net> (IPv4, IPv6 sau Tor) - Print block on startup, if found in block index Publica bloc la pornire daca exista in index-ul de blocuri. - - Print block tree on startup (default: 0) - Publicare arbore blocuri la pornire (prestabilit: 0) - Send trace/debug info to console instead of debug.log file Trimite informațiile trace/debug la consolă în locul fișierului debug.log - - Set minimum block size in bytes (default: 0) - Setează mărimea minimă a blocului în baiți (implicit: 0) - Shrink debug.log file on client startup (default: 1 when no -debug) Micsorati fisierul debug.log la inceperea clientului (implicit: 1 cand nu -debug) @@ -2635,14 +2499,6 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.com Signing transaction failed Semnarea tranzacției a eșuat - - Specify connection timeout in milliseconds (default: 5000) - Specifică intervalul maxim de conectare în milisecunde (implicit: 5000) - - - System error: - Eroare de sistem: - Transaction amount too small Suma tranzacționată este prea mică @@ -2655,10 +2511,6 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.com Transaction too large Tranzacția este prea mare - - Use UPnP to map the listening port (default: 0) - Foloseste UPnP pentru a vedea porturile (initial: 0) - Use UPnP to map the listening port (default: 1 when listening) Foloseste UPnP pentru a vedea porturile (initial: 1 cand listezi) @@ -2695,10 +2547,6 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.com Upgrade wallet to latest format Actualizează portofelul la ultimul format - - Set key pool size to <n> (default: 100) - Setează mărimea bazinului de chei la <n> (implicit: 100) - Rescan the block chain for missing wallet transactions Rescanează lanțul de bloc pentru tranzacțiile portofel lipsă @@ -2707,14 +2555,6 @@ spre exemplu: alertnotify=echo %%s | mail -s "Alerta Bitcoin" admin@foo.com Use OpenSSL (https) for JSON-RPC connections Folosește OpenSSL (https) pentru conexiunile JSON-RPC - - Server certificate file (default: server.cert) - Certificatul serverului (implicit: server.cert) - - - Server private key (default: server.pem) - Cheia privată a serverului (implicit: server.pem) - This help message Acest mesaj de ajutor diff --git a/src/qt/locale/bitcoin_ru.ts b/src/qt/locale/bitcoin_ru.ts index d6a145928c..93c116d0a2 100644 --- a/src/qt/locale/bitcoin_ru.ts +++ b/src/qt/locale/bitcoin_ru.ts @@ -264,7 +264,7 @@ &Options... - Опции + &Параметры &Encrypt Wallet... @@ -386,10 +386,6 @@ Tabs toolbar Панель вкладок - - [testnet] - [тестовая сеть] - Bitcoin Core Bitcoin Core @@ -416,11 +412,11 @@ &Command-line options - &Опции командной строки + &Пармаетры командной строки Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - Показать помощь по Bitcoin Core и получить список доступных опций командной строки. + Показать помощь по Bitcoin Core и получить список доступных параметров командной строки. %n active connection(s) to Bitcoin network @@ -430,10 +426,6 @@ No block source available... Источник блоков недоступен... - - Processed %1 blocks of transaction history. - Обработано %1 блоков истории транзакций. - %n hour(s) %n час%n часа%n часов @@ -482,6 +474,10 @@ Up to date Синхронизировано + + Processed %n blocks of transaction history. + Обработан %n блок истории транзакций.Обработано %n блока истории транзакций.Обработано %n блоков истории транзакций. + Catching up... Синхронизируется... @@ -847,11 +843,11 @@ Address: %4 command-line options - опции командной строки + параметры командной строки UI options - Опции интерфейса + Настройки интерфейса Set language, for example "de_DE" (default: system locale) @@ -912,13 +908,13 @@ Address: %4 Error Ошибка - - GB of free space available - ГБ свободного места доступно + + %n GB of free space available + %nГБ свободного места доступно%nГБ свободного места доступно%nГБ свободного места доступно - - (of %1GB needed) - (из необходимых %1ГБ) + + (of %n GB needed) + (из необходимых %nГБ)(из необходимых %nГБ)(из необходимых %nГБ) @@ -948,7 +944,7 @@ Address: %4 OptionsDialog Options - Опции + Параметры &Main @@ -1016,11 +1012,11 @@ Address: %4 Reset all client options to default. - Сбросить все опции клиента на значения по умолчанию. + Сбросить все настройки клиента на значения по умолчанию. &Reset Options - &Сбросить опции + &Сбросить параметры &Network @@ -1132,7 +1128,7 @@ Address: %4 Confirm options reset - Подтвердите сброс опций + Подтвердите сброс параметров Client restart required to activate changes. @@ -1161,10 +1157,6 @@ Address: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Отображаемая информация может быть устаревшей. Ваш бумажник автоматически синхронизируется с сетью Bitcoin после подключения, но этот процесс пока не завершён. - - Wallet - Бумажник - Watch-only: Только наблюдение: @@ -1193,6 +1185,10 @@ Address: %4 Mined balance that has not yet matured Баланс добытых монет, который ещё не созрел + + Balances + Балансы + Total: Итого: @@ -1205,6 +1201,14 @@ Address: %4 Your current balance in watch-only addresses Ваш текущий баланс в адресах наблюдения + + Spendable: + Доступно: + + + Recent transactions + Последние транзакции + Unconfirmed transactions to watch-only addresses Неподтверждённые транзакции на адреса наблюдения @@ -1217,10 +1221,6 @@ Address: %4 Current total balance in watch-only addresses Текущий общий баланс на адресах наблюдения - - <b>Recent transactions</b> - <b>Недавние транзакции</b> - out of sync не синхронизировано @@ -1480,10 +1480,6 @@ Address: %4 Services Сервисы - - Sync Node - Узел синхронизации - Starting Height Начальная высота @@ -1612,14 +1608,6 @@ Address: %4 Outbound Исходящие - - Yes - Да - - - No - Нет - Unknown Неизвестно @@ -2464,6 +2452,10 @@ Address: %4 Mined Добыто + + watch-only + только наблюдение + (n/a) [не доступно] @@ -2480,6 +2472,10 @@ Address: %4 Type of transaction. Тип транзакции. + + Whether or not a watch-only address is involved in this transaction. + Использовался ли в транзакции адрес для наблюдения. + Destination address of transaction. Адрес назначения транзакции. @@ -2575,6 +2571,10 @@ Address: %4 Export Transaction History Экспортировать историю транзакций + + Watch-only + Для наблюдения + Exporting Failed Экспорт не удался @@ -2688,28 +2688,12 @@ Address: %4 bitcoin-core Options: - Опции: - - - Specify configuration file (default: bitcoin.conf) - Указать конфигурационный файл (по умолчанию: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Задать pid-файл (по умолчанию: bitcoin.pid) + Параметры: Specify data directory Задать каталог данных - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Принимать входящие подключения на <port> (по умолчанию: 8333 или 18333 в тестовой сети) - - - Maintain at most <n> connections to peers (default: 125) - Поддерживать не более <n> подключений к участникам (по умолчанию: 125) - Connect to a node to retrieve peer addresses, and disconnect Подключиться к участнику, чтобы получить список адресов других участников и отключиться @@ -2718,18 +2702,6 @@ Address: %4 Specify your own public address Укажите ваш собственный публичный адрес - - Threshold for disconnecting misbehaving peers (default: 100) - Порог для отключения неправильно ведущих себя участников (по умолчанию: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Число секунд блокирования неправильно ведущих себя участников (по умолчанию: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Прослушивать подключения JSON-RPC на <порту> (по умолчанию: 8332 или для testnet: 18332) - Accept command line and JSON-RPC commands Принимать командную строку и команды JSON-RPC @@ -2770,18 +2742,10 @@ rpcpassword=%s Например: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Разрешённые алгоритмы(по умолчанию: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Привязаться к указанному адресу и всегда прослушивать только его. Используйте [хост]:порт для IPv6 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - Ограничить скорость передачи бесплатных транзакций до <n>*1000 байт в минуту (по умолчанию: 15) - Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup Удалить все транзакции бумажника с возможностью восстановить эти части цепи блоков с помощью -rescan при запуске @@ -2802,14 +2766,6 @@ rpcpassword=%s Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Выполнить команду, когда меняется транзакция в бумажнике (%s в команде заменяется на TxID) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - Сбрасывать активность базы данных из памяти на диск каждые <n> мегабайт (по умолчанию: 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - Насколько тщательна проверка контрольных блоков -checkblocks (0-4, по умолчанию: 3) - In this mode -genproclimit controls how many blocks are generated immediately. В этом режиме -genproclimit определяет, сколько блоков генерируется немедленно. @@ -2818,10 +2774,6 @@ rpcpassword=%s Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Задать число потоков проверки скрипта (от %u до %d, 0=авто, <0 = оставить столько ядер свободными, по умолчанию: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - Задать лимит процессора, когда генерация работает (-1 = безлимитно, по умолчанию: -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Это пре-релизная тестовая сборка - используйте на свой страх и риск - не используйте для добычи или торговых приложений @@ -2830,10 +2782,6 @@ rpcpassword=%s Unable to bind to %s on this computer. Bitcoin Core is probably already running. Не удалось забиндиться на %s на этом компьютере. Возможно, Bitcoin Core уже запущен. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Использовать отдельный прокси SOCKS5 для соединения с участниками через скрытые сервисы Tor (по умолчанию: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Внимание: установлено очень большое значение -paytxfee. Это комиссия, которую вы заплатите при проведении транзакции. @@ -2858,10 +2806,6 @@ rpcpassword=%s (default: 1) (по умолчанию: 1) - - (default: wallet.dat) - (по умолчанию: wallet.dat) - <category> can be: <category> может быть: @@ -2890,10 +2834,6 @@ rpcpassword=%s Debugging/Testing options: Параметры отладки/тестирования: - - Disable safemode, override a real safe mode event (default: 0) - Отключить безопасный режим, отклонить реальное событие безопасного режима (по умолчанию: 0) - Discover own IP address (default: 1 when listening and no -externalip) Определить свой IP (по умолчанию: 1 при прослушивании и если не используется -externalip) @@ -2922,6 +2862,10 @@ rpcpassword=%s Error opening block database Не удалось открыть БД блоков + + Error: A fatal internal error occured, see debug.log for details + Ошибка: произошла неустранимая ошибка, детали в debug.log + Error: Disk space is low! Ошибка: мало места на диске! @@ -2930,66 +2874,10 @@ rpcpassword=%s Error: Wallet locked, unable to create transaction! Ошибка: бумажник заблокирован, невозможно создать транзакцию! - - Error: system error: - Ошибка: системная ошибка: - Failed to listen on any port. Use -listen=0 if you want this. Не удалось начать прослушивание на порту. Используйте -listen=0 если вас это устраивает. - - Failed to read block info - Не удалось прочитать информацию блока - - - Failed to read block - Не удалось прочитать блок - - - Failed to sync block index - Не удалось синхронизировать индекс блоков - - - Failed to write block index - Не удалось записать индекс блоков - - - Failed to write block info - Не удалось записать информацию блока - - - Failed to write block - Не удалось записать блок - - - Failed to write file info - Не удалось записать информацию файла - - - Failed to write to coin database - Не удалось записать БД монет - - - Failed to write transaction index - Не удалось записать индекс транзакций - - - Failed to write undo data - Не удалось записать данные для отмены - - - Force safe mode (default: 0) - Принудительный безопасный режим (по умолчанию: 0) - - - Generate coins (default: 0) - Включить добычу монет (по умолчанию: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Сколько блоков проверять при запуске (по умолчанию: 288, 0 = все) - If <category> is not supplied, output all debugging information. Если <category> не предоставлена, выводить всю отладочную информацию. @@ -3011,8 +2899,8 @@ rpcpassword=%s Недостаточно файловых дескрипторов. - Prepend debug output with timestamp (default: 1) - Дописывать отметки времени к отладочному выводу (по умолчанию: 1) + Only connect to nodes in network <net> (ipv4, ipv6 or onion) + Соединяться только по сети <net> (ipv4, ipv6 или onion) Rebuild block chain index from current blk000??.dat files @@ -3026,22 +2914,10 @@ rpcpassword=%s Set maximum block size in bytes (default: %d) Задать максимальный размер блока в байтах (по умолчанию: %d) - - Set the number of threads to service RPC calls (default: 4) - Задать число потоков выполнения(по умолчанию: 4) - Specify wallet file (within data directory) Укажите файл бумажника (внутри каталога данных) - - Spend unconfirmed change when sending transactions (default: 1) - Тратить неподтвержденную сдачу при отправке транзакций (по умолчанию: 1) - - - Stop running after importing blocks from disk (default: 0) - Остановиться после импорта блоков с диска (по умолчанию: 0) - This is intended for regression testing tools and app development. Это рассчитано на инструменты регрессионного тестирования и разработку приложений. @@ -3060,7 +2936,7 @@ rpcpassword=%s Wallet options: - Опции бумажника: + Настройки бумажника: You need to rebuild the database using -reindex to change -txindex @@ -3070,10 +2946,6 @@ rpcpassword=%s Imports blocks from external blk000??.dat file Импортировать блоки из внешнего файла blk000??.dat - - (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) - (по умолчанию: 1, 1 = сохранять метаданные транзакции, например, владельца аккаунта и информацию запроса платежа, 2 = отбросить метаданные) - Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times Разрешить подключения JSON-RPC с указанного источника. Разрешённые значения для <ip> — отдельный IP (например, 1.2.3.4), сеть/маска сети (например, 1.2.3.4/255.255.255.0) или сеть/CIDR (например, 1.2.3.4/24). Эту опцию можно использовать многократно @@ -3110,10 +2982,6 @@ rpcpassword=%s Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. Ошибка: обнаружен неподдерживаемый аргумент -socks. Выбор версии SOCKS более невозможен, поддерживаются только прокси SOCKS5. - - Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) - Выполнить команду, когда транзакция из сети повторно тратит вход транзакции в бумажнике (%s=TxID транзакции сети, %t=TxID транзакции в бумажнике) - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Выполнить команду, когда приходит соответствующее сообщение о тревоге или наблюдается очень длинное расщепление цепи (%s в команде заменяется на сообщение) @@ -3126,14 +2994,6 @@ rpcpassword=%s Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) Комиссии (в BTC/Кб) меньшие этого значения считаются нулевыми для создания транзакции (по умолчанию: %s) - - If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) - Если paytxfee не задан, включить достаточную комиссию для подтверждения транзакции в среднем за n блоков (по умолчанию: 1) - - - Output debugging information (default: 0, supplying <category> is optional) - Выводить отладочную информацию (по умолчанию: 0, указание <category> необязательно) - Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) Запрашивать адреса участников с помощью DNS, если адресов мало (по умолчанию: 1, если не указан -connect) @@ -3150,18 +3010,10 @@ rpcpassword=%s Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. Внимание: убедитесь, что дата и время на Вашем компьютере выставлены верно. Если Ваши часы идут неправильно, Bitcoin Core будет работать некорректно. - - Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. - Вносить в белый список участников, подключающихся с указанной маски сети или ip. Можно использовать многократно. - Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway Участники из белого списка не могуть быть забанены за DoS, и их транзакции всегда транслируются, даже если они уже содержатся в памяти. Полезно, например, для шлюза. - - Always query for peer addresses via DNS lookup (default: 0) - Всегда запрашивать адреса участников с помощью DNS (по умолчанию: 0) - Cannot resolve -whitebind address: '%s' Не удаётся разрешить адрес в параметре -whitebind: '%s' @@ -3190,10 +3042,6 @@ rpcpassword=%s Fee (in BTC/kB) to add to transactions you send (default: %s) Комиссия (в BTC/Кб) для добавления к вашим транзакциям (по умолчанию: %s) - - Include IP addresses in debug output (default: 0) - Включать IP-адреса в отладочный вывод (по умолчанию: 0) - Information Информация @@ -3223,24 +3071,8 @@ rpcpassword=%s Хранить максимум <n> несоединённых блоков в памяти (по умолчанию: %u) - Limit size of signature cache to <n> entries (default: 50000) - Ограничить размер кэша подписей <n> записями (по умолчанию: 50000) - - - Log transaction priority and fee per kB when mining blocks (default: 0) - Записывать в лог приоритет транзакции и комиссию на килобайт во время добычи блоков (по умолчанию: 0) - - - Maintain a full transaction index (default: 0) - Держать полный индекс транзакций (по умолчанию: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Максимальный размер буфера приёма на соединение, <n>*1000 байт (по умолчанию: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Максимальный размер буфера отправки на соединение, <n>*1000 байт (по умолчанию: 1000) + Keep at most <n> unconnectable transactions in memory (default: %u) + Держать в памяти до <n> несвязных транзакций (по умолчанию: %u) Need to specify a port with -whitebind: '%s' @@ -3250,22 +3082,10 @@ rpcpassword=%s Node relay options: Параметры трансляции узла: - - Only accept block chain matching built-in checkpoints (default: 1) - Принимать цепь блоков, только если она соответствует встроенным контрольным точкам (по умолчанию: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Подключаться только к узлам из сети <net> (IPv4, IPv6 или Tor) - Print block on startup, if found in block index Печатать блок при запуске, если он найден в индексе блоков - - Print block tree on startup (default: 0) - Печатать дерево блоков при запуске (по умолчанию: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) Параметры RPC SSL: (см. Bitcoin вики для инструкций по настройке SSL) @@ -3282,30 +3102,10 @@ rpcpassword=%s Randomly fuzz 1 of every <n> network messages Случайно разбрасывать 1 из каждых <n> сетевых сообщений - - Relay and mine data carrier transactions (default: 1) - Транслировать и генерировать транзакции носители данных (по умолчанию: 1) - - - Relay non-P2SH multisig (default: 1) - Транслировать не-P2SH мультиподпись (по умолчанию: 1) - - - Run a thread to flush wallet periodically (default: 1) - Запустить поток для периодического сохранения бумажника (по умолчанию: 1) - Send trace/debug info to console instead of debug.log file Выводить информацию трассировки/отладки на консоль вместо файла debug.log - - Set minimum block size in bytes (default: 0) - Минимальный размер блока в байтах (по умолчанию: 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - Установить флаг DB_PRIVATE в окружении базы данных бумажника (по умолчанию: 1) - Show all debugging options (usage: --help -help-debug) Показать все отладочные параметры (использование: --help -help-debug) @@ -3318,14 +3118,6 @@ rpcpassword=%s Signing transaction failed Не удалось подписать транзакцию - - Specify connection timeout in milliseconds (default: 5000) - Тайм-аут соединения в миллисекундах (по умолчанию: 5000) - - - System error: - Системная ошибка: - This is experimental software. Это экспериментальное ПО. @@ -3346,10 +3138,6 @@ rpcpassword=%s Unable to bind to %s on this computer (bind returned error %s) Невозможно привязаться к %s на этом компьютере (bind вернул ошибку %s) - - Use UPnP to map the listening port (default: 0) - Использовать UPnP для проброса порта (по умолчанию: 0) - Use UPnP to map the listening port (default: 1 when listening) Использовать UPnP для проброса порта (по умолчанию: 1, если используется прослушивание) @@ -3402,10 +3190,6 @@ rpcpassword=%s Upgrade wallet to latest format Обновить бумажник до последнего формата - - Set key pool size to <n> (default: 100) - Установить размер запаса ключей в <n> (по умолчанию: 100) - Rescan the block chain for missing wallet transactions Перепроверить цепь блоков на предмет отсутствующих в бумажнике транзакций @@ -3414,14 +3198,6 @@ rpcpassword=%s Use OpenSSL (https) for JSON-RPC connections Использовать OpenSSL (https) для подключений JSON-RPC - - Server certificate file (default: server.cert) - Файл серверного сертификата (по умолчанию: server.cert) - - - Server private key (default: server.pem) - Приватный ключ сервера (по умолчанию: server.pem) - This help message Эта справка @@ -3438,6 +3214,10 @@ rpcpassword=%s Error loading wallet.dat: Wallet corrupted Ошибка загрузки wallet.dat: Бумажник поврежден + + (default: %s) + (по умолчанию: %s) + Error loading wallet.dat Ошибка при загрузке wallet.dat diff --git a/src/qt/locale/bitcoin_sk.ts b/src/qt/locale/bitcoin_sk.ts index 793cbfa377..7768288294 100644 --- a/src/qt/locale/bitcoin_sk.ts +++ b/src/qt/locale/bitcoin_sk.ts @@ -93,7 +93,11 @@ Exporting Failed Export zlyhal - + + There was an error trying to save the address list to %1. Please try again. + Nastala chyba pri pokuse uložiť zoznam adries do %1. Skúste znovu. + + AddressTableModel @@ -179,6 +183,10 @@ Wallet encrypted Peňaženka zašifrovaná + + 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>. + Zadajte nové heslo k peňaženke.<br/>Prosím použite heslo s dĺžkou aspoň <b>10 alebo viac náhodných znakov</b>, alebo <b>8 alebo viac slov</b>. + Bitcoin 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. Bitcoin sa teraz ukončí pre dokončenie procesu šifrovania. Pamätaj že šifrovanie peňaženky Ťa nemôže úplne ochrániť pred kráďežou bitcoinov pomocou škodlivého software. @@ -286,6 +294,10 @@ Open &URI... Otvoriť &URI... + + Bitcoin Core client + Bitcoin Core klient + Importing blocks from disk... Importujem bloky z disku... @@ -338,6 +350,10 @@ &Receive &Prijať + + Show information about Bitcoin Core + Zobraziť informácie o Bitcoin Core + &Show / Hide Zobraziť / skryť @@ -374,10 +390,6 @@ Tabs toolbar Lišta záložiek - - [testnet] - [testovacia sieť] - Bitcoin Core Jadro Bitcoin @@ -414,10 +426,6 @@ No block source available... Nedostupný zdroj blokov... - - Processed %1 blocks of transaction history. - Spracovaných %1 blokov transakčnej histórie. - %1 and %2 %1 a %2 @@ -863,15 +871,7 @@ Adresa: %4 Error Chyba - - GB of free space available - GB dostupného voľného miesta - - - (of %1GB needed) - (z %1GB potrebných) - - + OpenURIDialog @@ -1104,10 +1104,6 @@ Adresa: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Zobrazené informácie môžu byť neaktuápne. Vaša peňaženka sa automaticky synchronizuje so sieťou Bitcoin po nadviazaní spojenia ale tento proces ešte nieje ukončený. - - Wallet - Peňaženka - Available: Disponibilné: @@ -1140,10 +1136,6 @@ Adresa: %4 Your current total balance Váš súčasný celkový zostatok - - <b>Recent transactions</b> - <b>Nedávne transakcie</b> - out of sync nesynchronizované @@ -2389,26 +2381,10 @@ Adresa: %4 Options: Možnosti: - - Specify configuration file (default: bitcoin.conf) - Určiť súbor s nastaveniami (predvolené: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Určiť súbor pid (predvolené: bitcoind.pid) - Specify data directory Určiť priečinok s dátami - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Načúvať spojeniam na <port> (prednastavené: 8333 alebo testovacia sieť: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Udržiavať maximálne <n> spojení (predvolené: 125) - Connect to a node to retrieve peer addresses, and disconnect Pripojiť sa k nóde, získať adresy ďaľších počítačov v sieti a odpojit sa. @@ -2417,18 +2393,6 @@ Adresa: %4 Specify your own public address Určite vašu vlastnú verejnú adresu - - Threshold for disconnecting misbehaving peers (default: 100) - Hranica pre odpojenie zle sa správajúcich peerov (predvolené: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Počet sekúnd kedy sa zabráni zle sa správajúcim peerom znovupripojenie (predvolené: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Počúvať JSON-RPC spojeniam na <port> (predvolené: 8332 or testnet: 18332) - Accept command line and JSON-RPC commands Prijímať príkazy z príkazového riadku a JSON-RPC @@ -2469,18 +2433,10 @@ Tiež sa odporúča nastaviť alertnotify aby ste boli upozorňovaní na problé napríklad: alertnotify=echo %%s | mail -s "Bitcoin Výstraha" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Prijateľlné šifry (prednastavené: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Spojiť s danou adresou a vždy na nej počúvať. Použite zápis [host]:port pre IPv6 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - Priebežne obmedzuj transakcie bez poplatku na <n>*1000 bajtov za minútu (prednastavené: 15) - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Vojsť do režimu regresného testovania, ktorý používa špeciálnu reťaz v ktorej môžu byť bloky v okamihu vyriešené. @@ -2497,14 +2453,6 @@ napríklad: alertnotify=echo %%s | mail -s "Bitcoin Výstraha" admin@foo.com Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Vykonaj príkaz keď sa zmení transakcia peňaženky (%s v príkaze je nahradená TxID) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - Odložiť aktivitu databázy spoločnej pamäti do logu na disku každých <n> megabajtov (prednastavené: 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - Ako dôkladne sú overované bloky -checkblocks (0-4, prednastavené: 3) - In this mode -genproclimit controls how many blocks are generated immediately. V tomto režime -getproclimit kontroluje koľko blokov sa vytvorí okamžite. @@ -2513,10 +2461,6 @@ napríklad: alertnotify=echo %%s | mail -s "Bitcoin Výstraha" admin@foo.com Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Nastaviť počeť vlákien overujúcich skripty (%u až %d, 0 = auto, <0 = nechať toľkoto jadier voľných, prednastavené: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - Nastaviť obmedzenie pre procesor keď je zapnuté generovanie (-1 = bez obmedzenia, prednastavené: -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Toto je pred-testovacia verzia - použitie je na vlastné riziko - nepoužívajte na tvorbu bitcoin ani obchodovanie. @@ -2525,10 +2469,6 @@ napríklad: alertnotify=echo %%s | mail -s "Bitcoin Výstraha" admin@foo.com Unable to bind to %s on this computer. Bitcoin Core is probably already running. Nepodarilo sa pripojiť na %s na tomto počítači. Bitcoin Jadro je už pravdepodobne spustené. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Použite rozdielne SOCKS5 proxy pre dosiahnutie peer-ov cez Tor skryté služby (prednastavené: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Varovanie: -paytxfee je nastavené veľmi vysoko. Toto sú transakčné poplatky ktoré zaplatíte ak odošlete transakciu. @@ -2555,10 +2495,6 @@ The network does not appear to fully agree! Some miners appear to be experiencin (default: 1) (predvolené: 1) - - (default: wallet.dat) - (predvolené: wallet.dat) - <category> can be: <category> môže byť: @@ -2587,10 +2523,6 @@ The network does not appear to fully agree! Some miners appear to be experiencin Debugging/Testing options: Možnosti ladenia/testovania: - - Disable safemode, override a real safe mode event (default: 0) - Vypnúť bezpečný režim, vypnúť udalosť skutočný bezpečný režim (prednastavené: 0) - Discover own IP address (default: 1 when listening and no -externalip) Zisti vlastnú IP adresu (predvolené: 1 pri počúvaní/listening a žiadnej -externalip) @@ -2627,66 +2559,10 @@ The network does not appear to fully agree! Some miners appear to be experiencin Error: Wallet locked, unable to create transaction! Chyba: Peňaženka je zamknutá, nemôžem vytvoriť transakciu! - - Error: system error: - Chyba: systémová chyba: - Failed to listen on any port. Use -listen=0 if you want this. Chyba počúvania na ktoromkoľvek porte. Použi -listen=0 ak toto chcete. - - Failed to read block info - Zlyhalo čítanie info o bloku - - - Failed to read block - Zlyhalo čítanie bloku - - - Failed to sync block index - Zlyhalo synchronizovanie zoznamu blokov - - - Failed to write block index - Zlyhalo zapisovanie do zoznamu blokov - - - Failed to write block info - Zlyhal zápis info o bloku - - - Failed to write block - Zlyhal zápis bloku - - - Failed to write file info - Zlyhalo zapisovanie informácié o súbore - - - Failed to write to coin database - Zlyhalo zapisovanie do databázy coins - - - Failed to write transaction index - Zlyhal zápis zoznamu transakcií - - - Failed to write undo data - Zlyhalo zapisovanie - - - Force safe mode (default: 0) - Vnútiť bezpečný režim (prenastavené: 0) - - - Generate coins (default: 0) - Vytvárať mince (predvolené: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Koľko blokov skontrolovať pri spustení (predvolené: 288, 0 = všetky) - If <category> is not supplied, output all debugging information. Ak nie je uvedená <category>, na výstupe zobrazuj všetky informácie pre ladenie. @@ -2707,10 +2583,6 @@ The network does not appear to fully agree! Some miners appear to be experiencin Not enough file descriptors available. Nedostatok kľúčových slov súboru. - - Prepend debug output with timestamp (default: 1) - Na začiatok logu pre ladenie vlož dátum a čas (prednastavené: 1) - Rebuild block chain index from current blk000??.dat files Znovu vytvoriť zoznam blokov zo súčasných blk000??.dat súborov @@ -2723,18 +2595,10 @@ The network does not appear to fully agree! Some miners appear to be experiencin Set maximum block size in bytes (default: %d) Nastaviť najväčšiu veľkosť bloku v bytoch (predvolené: %d) - - Set the number of threads to service RPC calls (default: 4) - Nastaviť množstvo vlákien na obsluhu RPC volaní (predvolené: 4) - Specify wallet file (within data directory) Označ súbor peňaženky (v priečinku s dátami) - - Spend unconfirmed change when sending transactions (default: 1) - Míňať nepotvrdený výdavok pri odosielaní (prednastavené: 1) - This is intended for regression testing tools and app development. Toto je mienené nástrojom pre regresné testovania a vývoj programu. @@ -2771,10 +2635,6 @@ The network does not appear to fully agree! Some miners appear to be experiencin Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Vykonať príkaz keď po prijatí patričné varovanie alebo vidíme veľmi dlhé rozdvojenie siete (%s v cmd je nahradené správou) - - Output debugging information (default: 0, supplying <category> is optional) - Výstup informácií pre ladenie (prednastavené: 0, uvádzanie <category> je voliteľné) - Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Nastaviť najväčšiu veľkosť vysoká-dôležitosť/nízke-poplatky transakcií v bajtoch (prednastavené: %d) @@ -2791,42 +2651,10 @@ The network does not appear to fully agree! Some miners appear to be experiencin Invalid amount for -mintxfee=<amount>: '%s' Neplatná suma pre -mintxfee=<amount>: '%s' - - Limit size of signature cache to <n> entries (default: 50000) - Obmedziť veľkosť pomocnej pamäti pre podpisy na <n> vstupov (prednastavené: 50000) - - - Log transaction priority and fee per kB when mining blocks (default: 0) - Zaznamenávať dôležitosť transakcií a poplatky za kB ak hľadáme bloky (prednastavené: 0) - - - Maintain a full transaction index (default: 0) - Udržiavaj úplný zoznam transakcií (prednastavené: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Maximálna veľkosť prijímacieho zásobníka pre jedno spojenie, <n>*1000 bytov (predvolené: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Maximálna veľkosť vysielacieho zásobníka pre jedno spojenie, <n>*1000 bytov (predvolené: 1000) - - - Only accept block chain matching built-in checkpoints (default: 1) - Akceptuj iba kontrolné body zhodné s blockchain (prednastavené: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Pripájať sa len k nódam v sieti <net> (IPv4, IPv6 alebo Tor) - Print block on startup, if found in block index Vytlač blok pri spustení, ak nájdený v zozname blokov - - Print block tree on startup (default: 0) - Vytlačiť strom blokov pri spustení (prednastavené: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) Možnosti RPC SSL: (Pozri v Bitcoin Wiki pokyny pre SSL nastavenie) @@ -2843,22 +2671,10 @@ The network does not appear to fully agree! Some miners appear to be experiencin Randomly fuzz 1 of every <n> network messages Náhodne premiešaj 1 z každých <n> sieťových správ - - Run a thread to flush wallet periodically (default: 1) - Mať spustené vlákno pravidelného čístenia peňaženky (predvolené: 1) - Send trace/debug info to console instead of debug.log file Odoslať trace/debug informácie na konzolu namiesto debug.info žurnálu - - Set minimum block size in bytes (default: 0) - Nastaviť minimálnu veľkosť bloku v bytoch (predvolené: 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - Nastaví DB_PRIVATE možnosť v db prostredí peňaženky (prednastavené: 1) - Show all debugging options (usage: --help -help-debug) Zobraziť všetky možnosti ladenia (použitie: --help --help-debug) @@ -2871,14 +2687,6 @@ The network does not appear to fully agree! Some miners appear to be experiencin Signing transaction failed Podpísanie správy zlyhalo - - Specify connection timeout in milliseconds (default: 5000) - Určiť aut spojenia v milisekundách (predvolené: 5000) - - - System error: - Systémová chyba: - Transaction amount too small Suma transakcie príliš malá @@ -2891,10 +2699,6 @@ The network does not appear to fully agree! Some miners appear to be experiencin Transaction too large Transakcia príliš veľká - - Use UPnP to map the listening port (default: 0) - Skúsiť použiť UPnP pre mapovanie počúvajúceho portu (default: 0) - Use UPnP to map the listening port (default: 1 when listening) Skúsiť použiť UPnP pre mapovanie počúvajúceho portu (default: 1 when listening) @@ -2935,10 +2739,6 @@ The network does not appear to fully agree! Some miners appear to be experiencin Upgrade wallet to latest format Aktualizuj peňaženku na najnovší formát. - - Set key pool size to <n> (default: 100) - Nastaviť zásobu adries na <n> (predvolené: 100) - Rescan the block chain for missing wallet transactions Znovu skenovať reťaz blokov pre chýbajúce transakcie @@ -2947,14 +2747,6 @@ The network does not appear to fully agree! Some miners appear to be experiencin Use OpenSSL (https) for JSON-RPC connections Použiť OpenSSL (https) pre JSON-RPC spojenia - - Server certificate file (default: server.cert) - Súbor s certifikátom servra (predvolené: server.cert) - - - Server private key (default: server.pem) - Súkromný kľúč servra (predvolené: server.pem) - This help message Táto pomocná správa diff --git a/src/qt/locale/bitcoin_sl_SI.ts b/src/qt/locale/bitcoin_sl_SI.ts index f615d31343..ed6f813e7d 100644 --- a/src/qt/locale/bitcoin_sl_SI.ts +++ b/src/qt/locale/bitcoin_sl_SI.ts @@ -330,6 +330,10 @@ &Receive &Sprejmi + + Show information about Bitcoin Core + Pokaži informacije o Bitcoin Core + &Show / Hide &Prikaži / Skrij @@ -362,10 +366,6 @@ Tabs toolbar Orodna vrstica zavihkov - - [testnet] - [testnet] - Bitcoin Core Jedro Bitcoina @@ -402,6 +402,10 @@ %n week(s) %n teden%n tedna%n tedni%n tednov + + %1 and %2 + %1 in %2 + %n year(s) %n leto%n leti%n leta%n let @@ -500,6 +504,18 @@ Naslov: %4 Change: Sprememba: + + (un)select all + (ne)izberi vse + + + Tree mode + Drevo + + + List mode + Seznam + Amount Količina @@ -540,6 +556,14 @@ Naslov: %4 Copy transaction ID Kopiraj ID transakcije + + Lock unspent + Zakleni neporabljeno + + + Unlock unspent + Odkleni neporabljeno + Copy quantity Kopiraj količino @@ -556,6 +580,14 @@ Naslov: %4 Copy priority Kopiraj prednostno mesto + + Copy dust + Kopiraj prah + + + Copy change + Kopiraj drobiž + highest najvišja @@ -596,6 +628,14 @@ Naslov: %4 (%1 locked) (%1 zaklenjeno) + + none + Nič + + + Can vary +/- %1 satoshi(s) per input. + Se lahko razlikuje +/- %1 satošijev na vnos. + yes da @@ -608,11 +648,31 @@ Naslov: %4 This label turns red, if the transaction size is greater than 1000 bytes. V primeru, da je velikost transakcije večja od 1000 bitov, se ta oznaka se obarva rdeče. + + Can vary +/- 1 byte per input. + Se lahko razlikuje +/- 1 byte na vnos. + + + Transactions with higher priority are more likely to get included into a block. + Transakcije z višjo prioriteto imajo boljše možnosti za vključitev v blok. + + + This label turns red, if the priority is smaller than "medium". + Oznaka se obarva rdeče, kadar je prioriteta manjša od "srednje". + (no label) (ni oznake) - + + change from %1 (%2) + drobiž od %1 (%2) + + + (change) + (drobiž) + + EditAddressDialog @@ -627,6 +687,10 @@ Naslov: %4 The label associated with this address list entry Oznaka je povezana s tem vnosom seznama naslovov + + The address associated with this address list entry. This can only be modified for sending addresses. + Naslov povezan s tem vnosom seznama naslovov. Sprememba je mogoča le za naslove namenjene pošiljanju. + &Address &Naslov @@ -662,11 +726,27 @@ Naslov: %4 FreespaceChecker + + A new data directory will be created. + Ustvarjena bo nova mapa za shranjevanje podatkov. + name ime - + + Directory already exists. Add %1 if you intend to create a new directory here. + Mapa že obstaja. Dodaj %1, če tu želiš ustvariti novo mapo. + + + Path already exists, and is not a directory. + Pot že obstaja, vendar ni mapa. + + + Cannot create data directory here. + Na tem mestu ne moreš ustvariti nove mape. + + HelpMessageDialog @@ -677,6 +757,10 @@ Naslov: %4 version različica + + (%1-bit) + (%1-bit) + About Bitcoin Core O jedru Bitcoina @@ -705,7 +789,19 @@ Naslov: %4 Start minimized Zaženi pomanjšano - + + Set SSL root certificates for payment request (default: -system-) + Nastavi korenske SSL certifikate za plačilni zahtevek (privzeto: -system-) + + + Show splash screen on startup (default: 1) + Ob zagonu prikaži uvodni zaslon (privzeto: 1) + + + Choose data directory on startup (default: 0) + Ob zagonu izberi mapo za shranjevanje podatkov (privzeto: 0) + + Intro @@ -716,17 +812,33 @@ Naslov: %4 Welcome to Bitcoin Core. Dobrodošli v jedru Bitcoina + + As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. + Program poganjaš prvič. Izberi kje bo Bitcoin Core shranjeval svoje podatke. + + + Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. + Bitcoin Core bo prenesel in shranil kopijo Bitcoin verige blokov. V izbrano mapo bo shranjenih vsaj %1 GB podatkov, ta količina pa bo sčasoma še naraščala. Denarnica bo prav tako shranjena v to mapo. + + + Use the default data directory + Uporabi privzeto mapo za shranjevanje podatkov. + + + Use a custom data directory: + Uporabi to mapo za shranjevanje podatkov: + Bitcoin Core Jedro Bitcoina - Error - Napaka + Error: Specified data directory "%1" cannot be created. + Napaka: Ne morem ustvariti mape "%1". - GB of free space available - GB prostora na voljo + Error + Napaka @@ -743,7 +855,15 @@ Naslov: %4 URI: URI: - + + Select payment request file + Izberi datoteko plačilnega zahtevka + + + Select payment request file to open + Izberi datoteko plačilnega zahtevka + + OptionsDialog @@ -754,6 +874,10 @@ Naslov: %4 &Main &Glavno + + Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. + Neobvezna pristojbina k transakciji poskrbi, da je transackcija hitro opravljena. Velikost povprečne transakcije je 1 kB. + Pay transaction &fee Nakazilo plačila & provizija @@ -766,10 +890,38 @@ Naslov: %4 &Start Bitcoin on system login &Zaženi Bitcoin ob prijavi v sistem + + Size of &database cache + Velikost lokalne zbirke &podatkovne baze + MB megabite + + Accept connections from outside + Sprejmi povezave od zunaj + + + Allow incoming connections + Dovoli prihajajoče povezave + + + Connect to the Bitcoin network through a SOCKS proxy. + V Bitcoin omrežje se poveži skozu SOCKS proxy. + + + &Connect through SOCKS proxy (default proxy): + &Poveži se skozi SOCKS proxy (privzet proxy): + + + IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + IP naslov proxy strežnika (npr. IPv4: 127.0.0.1 ali IPv6: ::1) + + + &Reset Options + &Opcije resetiranja + &Network &Omrežje @@ -782,6 +934,10 @@ Naslov: %4 Expert Poznavalec + + Enable coin &control features + Omogoči Coin & Control funkcijo + Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Avtomatično odpri vrata Bitcoin odjemalca na usmerjevalniku. To deluje samo, če vaš usmerjevalnik podpira UPnP in je omogočen. @@ -850,6 +1006,10 @@ Naslov: %4 default privzeto + + none + Nič + OverviewPage @@ -862,8 +1022,8 @@ Naslov: %4 Prikazanim podatkom je lahko potekel rok. Vaša denarnica bo po vzpostavitvi povezave samodejno sinhronizirana z Bitcoin omrežjem, ampak ta proces še ni bil zaključen. - Wallet - Denarnica + Watch-only: + Samo gledanje Available: @@ -885,10 +1045,6 @@ Naslov: %4 Your current total balance Vaše trenutno skupno stanje - - <b>Recent transactions</b> - <b>Nedavne transakcije</> - out of sync iz sinhronizacije @@ -1104,14 +1260,6 @@ Naslov: %4 never nikoli - - Yes - Da - - - No - Ne - Unknown Neznano @@ -1348,6 +1496,10 @@ Naslov: %4 Copy priority Kopiraj prednostno mesto + + Copy change + Kopiraj drobiž + or ali @@ -1372,6 +1524,10 @@ Naslov: %4 (no label) (ni oznake) + + Copy dust + Kopiraj prah + Are you sure you want to send? Ali ste prepričani, da želite poslati? @@ -1922,26 +2078,10 @@ Naslov: %4 Options: Možnosti: - - Specify configuration file (default: bitcoin.conf) - Določi datoteko z nastavitvami (privzeta: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Določi pid datoteko (privzeta: bitcoin.pid) - Specify data directory Določi podatkovni imenik - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Sprejmi povezave na <port> (privzeta vrata: 8333 ali testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Obdrži maksimalno število <n> povezav (privzeto: 125) - Connect to a node to retrieve peer addresses, and disconnect Povežite se z vozliščem za pridobitev naslovov uporabnikov in nato prekinite povezavo. @@ -1950,14 +2090,6 @@ Naslov: %4 Specify your own public address Določite vaš lasten javni naslov - - Threshold for disconnecting misbehaving peers (default: 100) - Prag za prekinitev povezav s slabimi odjemalci (privzeto: 1000) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Število sekund za težavo pri vzpostavitvi povezave med uporabniki (privzeto: 86400) - Accept command line and JSON-RPC commands Sprejmi ukaze iz ukazne vrstice in JSON-RPC @@ -1986,10 +2118,6 @@ Naslov: %4 This is a pre-release test build - use at your own risk - do not use for mining or merchant applications To je pred izdana poizkusna verzija - uporaba na lastno odgovornost - ne uporabljajte je za rudarstvo ali trgovske aplikacije - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Za doseg soležnikov preko Tor skritih storitev uporabi ločen SOCKS5 proxy (privzeto: -proxy) - Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. Opozorilo: napaka pri branju wallet.dat! Vsi ključi so bili pravilno prebrani, podatki o transakciji ali imenik vnešenih naslovov so morda izgubljeni ali nepravilni. @@ -1998,13 +2126,9 @@ Naslov: %4 (default: 1) (privzeto: 1) - - (default: wallet.dat) - (privzeto: wallet.dat) - <category> can be: - <kategorija> je lahko: + <category> je lahko: Block creation options: @@ -2018,22 +2142,6 @@ Naslov: %4 Error: Wallet locked, unable to create transaction! Opozorilo: Denarnica je zaklenjena, ni mogoče opraviti transkacijo! - - Error: system error: - Napaka: sistemska napaka: - - - Failed to write file info - Zapisovanje informacij o datoteki neuspešno - - - Failed to write to coin database - Neuspešno zapisovanje na bazi podatkov kovancev - - - Generate coins (default: 0) - Ustvari kovance (privzeto: 0) - Importing... Uvažam... @@ -2050,10 +2158,6 @@ Naslov: %4 Signing transaction failed Podpisovanje transakcije spodletelo - - System error: - Sistemska napaka: - Transaction amount too small Količina transakcije je pramajhna @@ -2094,10 +2198,6 @@ Naslov: %4 Upgrade wallet to latest format Posodobi denarnico v najnovejši zapis - - Set key pool size to <n> (default: 100) - Nastavi velikost ključa bazena na <n> (privzeto: 100) - Rescan the block chain for missing wallet transactions Ponovno preglej verigo blokov za manjkajoče transakcije denarnice @@ -2106,14 +2206,6 @@ Naslov: %4 Use OpenSSL (https) for JSON-RPC connections Uporabi OpenSSL (https) za JSON-RPC povezave - - Server certificate file (default: server.cert) - Datoteka potrdila strežnika (privzeta: server.cert) - - - Server private key (default: server.pem) - Zasebni ključ strežnika (privzet: server.pem) - This help message To sporočilo pomoči diff --git a/src/qt/locale/bitcoin_sq.ts b/src/qt/locale/bitcoin_sq.ts index f779e391c0..0c60e482fe 100644 --- a/src/qt/locale/bitcoin_sq.ts +++ b/src/qt/locale/bitcoin_sq.ts @@ -162,10 +162,6 @@ Tabs toolbar Shiriti i mjeteve - - [testnet] - [testo rrjetin] - Up to date I azhornuar @@ -281,10 +277,6 @@ Form Formilarë - - <b>Recent transactions</b> - <b>Transaksionet e fundit</b> - PaymentServer diff --git a/src/qt/locale/bitcoin_sr.ts b/src/qt/locale/bitcoin_sr.ts index f5723efece..c3dc42e2f3 100644 --- a/src/qt/locale/bitcoin_sr.ts +++ b/src/qt/locale/bitcoin_sr.ts @@ -218,10 +218,6 @@ Tabs toolbar Трака са картицама - - [testnet] - [testnet] - Up to date Ажурно @@ -329,6 +325,10 @@ Address: %4 version верзија + + About Bitcoin Core + O Bitcoin Coru + Usage: Korišćenje: @@ -361,14 +361,6 @@ Address: %4 Form Форма - - Wallet - новчаник - - - <b>Recent transactions</b> - <b>Недавне трансакције</b> - PaymentServer @@ -762,27 +754,10 @@ Address: %4 Options: Opcije - - Specify configuration file (default: bitcoin.conf) - Potvrdi željeni konfiguracioni fajl (podrazumevani:bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Konkretizuj pid fajl (podrazumevani: bitcoind.pid) - Specify data directory Gde je konkretni data direktorijum - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Slušaj konekcije na <port> (default: 8333 or testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Održavaj najviše <n> konekcija po priključku (default: 125) - - Accept command line and JSON-RPC commands Prihvati komandnu liniju i JSON-RPC komande @@ -803,10 +778,6 @@ Address: %4 Password for JSON-RPC connections Lozinka za JSON-RPC konekcije - - Set key pool size to <n> (default: 100) - Odredi veličinu zaštićenih ključeva na <n> (default: 100) - Rescan the block chain for missing wallet transactions Ponovo skeniraj lanac blokova za nedostajuće transakcije iz novčanika @@ -815,10 +786,6 @@ Address: %4 Use OpenSSL (https) for JSON-RPC connections Koristi OpenSSL (https) za JSON-RPC konekcije - - Server private key (default: server.pem) - privatni ključ za Server (podrazumevan: server.pem) - This help message Ova poruka Pomoći diff --git a/src/qt/locale/bitcoin_sv.ts b/src/qt/locale/bitcoin_sv.ts index 8e771c5ce7..39cca4b278 100644 --- a/src/qt/locale/bitcoin_sv.ts +++ b/src/qt/locale/bitcoin_sv.ts @@ -391,10 +391,6 @@ Var vänlig och försök igen. Tabs toolbar Verktygsfält för Tabbar - - [testnet] - [testnet] - Bitcoin Core Bitcoin Kärna @@ -435,10 +431,6 @@ Var vänlig och försök igen. No block source available... Ingen block-källa tillgänglig... - - Processed %1 blocks of transaction history. - Bearbetat %1 block i transaktionshistoriken. - %n hour(s) %n timme%n timmar @@ -913,15 +905,7 @@ Adress: %4 Error Fel - - GB of free space available - GB ledigt utrymme är tillgängligt - - - (of %1GB needed) - (av %1GB behövs) - - + OpenURIDialog @@ -1162,10 +1146,6 @@ Adress: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Den visade informationen kan vara inaktuell. Plånboken synkroniseras automatiskt med Bitcoin-nätverket efter att anslutningen är upprättad, men denna process har inte slutförts ännu. - - Wallet - Plånbok - Watch-only: Granska-bara: @@ -1218,10 +1198,6 @@ Adress: %4 Current total balance in watch-only addresses Nuvarande total balans i granska-bara adresser - - <b>Recent transactions</b> - <b>Nyligen genomförda transaktioner</b> - out of sync osynkroniserad @@ -1481,10 +1457,6 @@ Adress: %4 Services Tjänster - - Sync Node - Syncnod - Starting Height Starthöjd @@ -1613,14 +1585,6 @@ Adress: %4 Outbound Utgående - - Yes - Ja - - - No - Nej - Unknown Okänd @@ -2465,6 +2429,10 @@ Adress: %4 Mined Genererade + + watch-only + granska-bara + (n/a) (n/a) @@ -2691,26 +2659,10 @@ Adress: %4 Options: Inställningar: - - Specify configuration file (default: bitcoin.conf) - Ange konfigurationsfil (förvalt: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Ange pid fil (förvalt: bitcoind.pid) - Specify data directory Ange katalog för data - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Lyssna efter anslutningar på <port> (förvalt: 8333 eller testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Ha som mest <n> anslutningar till andra klienter (förvalt: 125) - Connect to a node to retrieve peer addresses, and disconnect Anslut till en nod för att hämta klientadresser, och koppla från @@ -2719,18 +2671,6 @@ Adress: %4 Specify your own public address Ange din egen publika adress - - Threshold for disconnecting misbehaving peers (default: 100) - Tröskelvärde för att koppla ifrån klienter som missköter sig (förvalt: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Antal sekunder att hindra klienter som missköter sig från att ansluta (förvalt: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Lyssna på JSON-RPC-anslutningar på <port> (förvalt: 8332 eller testnet: 18332) - Accept command line and JSON-RPC commands Tillåt kommandon från kommandotolken och JSON-RPC-kommandon @@ -2771,18 +2711,10 @@ Det är också rekommenderat att sätta alertnotify så du meddelas om problem; till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Accepterade krypteringsalgoritmer (förvalt: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Bind till given adress och lyssna alltid på den. Använd [värd]:port notation för IPv6 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - Antalsbegränsa kontinuerligt fria transaktioner till <n>*1000 bytes per minut (förvalt:15) - Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup Ta bort alla plånbokstransaktioner och återskapa bara dom som är en del av blockkedjan genom att ange -rescan vid uppstart @@ -2803,14 +2735,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Exekvera kommando när en plånbokstransaktion ändras (%s i cmd är ersatt av TxID) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - Töm databasens minnespool till disk varje <n> megabytes (förvalt: 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - Hur grundlig blockverifikationen vid -checkblocks är (0-4, förvalt: 3) - In this mode -genproclimit controls how many blocks are generated immediately. I denna mode kontrollerar -genproclimit hur många block som genereras på en gång. @@ -2819,10 +2743,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Ange antalet skriptkontrolltrådar (%u till %d, 0 = auto, <0 = lämna så många kärnor lediga, förval: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - Sätt processorbegränsning när blockgenereringen är på (-1 = obegränsad, förvalt: -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Detta är ett förhands testbygge - använd på egen risk - använd inte för mining eller handels applikationer @@ -2831,10 +2751,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Unable to bind to %s on this computer. Bitcoin Core is probably already running. Det går inte att binda till %s på den här datorn. Bitcoin Core är förmodligen redan igång. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Använd separat SOCKS5 proxy för att nå kollegor via dolda tjänster i Tor (default: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Varning: -paytxfee är satt väldigt hög! Detta är avgiften du kommer betala för varje transaktion. @@ -2859,10 +2775,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com (default: 1) (förvalt: 1) - - (default: wallet.dat) - (förvalt: wallet.dat) - <category> can be: <category> Kan vara: @@ -2891,10 +2803,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Debugging/Testing options: Avlusnings/Testnings optioner: - - Disable safemode, override a real safe mode event (default: 0) - Avaktivera säkert läge. Åsidosätt en riktigt säkert läge händelse (förvalt: 0) - Discover own IP address (default: 1 when listening and no -externalip) Hitta egen IP-adress (förvalt: 1 under lyssning och utan -externalip) @@ -2931,66 +2839,10 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Wallet locked, unable to create transaction! Fel: Plånboken är låst, det går ej att skapa en transaktion! - - Error: system error: - Fel: systemfel: - Failed to listen on any port. Use -listen=0 if you want this. Misslyckades att lyssna på någon port. Använd -listen=0 om du vill detta. - - Failed to read block info - Misslyckades att läsa blockinformation - - - Failed to read block - Misslyckades att läsa blocket - - - Failed to sync block index - Misslyckades att synkronisera blockindex - - - Failed to write block index - Misslyckades att skriva blockindex - - - Failed to write block info - Misslyckades att skriva blockinformation - - - Failed to write block - Misslyckades att skriva blocket - - - Failed to write file info - Misslyckades att skriva filinformation - - - Failed to write to coin database - Misslyckades att skriva till myntdatabas - - - Failed to write transaction index - Misslyckades att skriva transaktionsindex - - - Failed to write undo data - Misslyckades att skriva ångradata - - - Force safe mode (default: 0) - Tvångskör i säkert läge (förvalt: 0) - - - Generate coins (default: 0) - Generera mynt (förvalt: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Hur många block att kontrollera vid uppstart (standardvärde: 288, 0 = alla) - If <category> is not supplied, output all debugging information. Om <category> inte anges, skrivs all avlusningsinformation ut. @@ -3011,10 +2863,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Not enough file descriptors available. Inte tillräckligt med filbeskrivningar tillgängliga. - - Prepend debug output with timestamp (default: 1) - Skriv ut tidsstämpel i avlusningsinformationen (förvalt: 1) - Rebuild block chain index from current blk000??.dat files Återskapa blockkedjans index från nuvarande blk000??.dat filer @@ -3027,22 +2875,10 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set maximum block size in bytes (default: %d) Sätt maximal blockstorlek i byte (förvalt: %d) - - Set the number of threads to service RPC calls (default: 4) - Ange antalet trådar för att hantera RPC anrop (standard: 4) - Specify wallet file (within data directory) Ange plånboksfil (inom datakatalogen) - - Spend unconfirmed change when sending transactions (default: 1) - Spendera okonfirmerad växel när transaktioner sänds (förvalt: 1) - - - Stop running after importing blocks from disk (default: 0) - Sluta köra efter importen av block från disk är klar (förvalt: 0) - This is intended for regression testing tools and app development. Detta är avsett för regressionstestningsverktyg och applikationsutveckling. @@ -3071,10 +2907,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Imports blocks from external blk000??.dat file Importerar block från extern blk000??.dat fil - - (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) - (förvalt: 1, 1 = spara tx metadata t.ex. kontoägare och betalningsbegäransinformation, 2 = släng tx metadata) - Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times Tillåt JSON-RPC anslutningar från specifik kalla. Tillåtet för <ip> är enkel IP (t.ex 1.2.3.4), en nätverk/nätmask (t.ex. 1.2.3.4/255.255.255.0) eller ett nätverk/CIDR (t.ex. 1.2.3.4/24). Denna option kan specificeras flera gånger @@ -3111,10 +2943,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. Fel: Argumentet -socks stöds inte. Att sätta SOCKS version är inte möjligt längre. Endast SOCKS5 proxy stöds. - - Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) - Kör kommando när en nätverks tx återspenderar plånbokens tx input (%s=återspendera TxID, %t=plånbok TxID) - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Exekvera kommando när ett relevant meddelande är mottagen eller när vi ser en väldigt lång förgrening (%s i cmd är utbytt med ett meddelande) @@ -3127,14 +2955,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) Avgifter (i BTC/Kb) mindre än detta betraktas som nollavgift för transaktionsskapande (förvalt: %s) - - If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) - Om paytxfee inte är satt, inkludera tillräcklig avgift så att transaktionen konfirmeras inom n blocks (förvalt: 1) - - - Output debugging information (default: 0, supplying <category> is optional) - Skriv ut avlusningsinformation (förvalt: 0, att ange <category> är frivilligt) - Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) Sök efter klientadresser med DNS sökningen, om det finns otillräckligt med adresser (förvalt: 1 om inte -connect) @@ -3151,18 +2971,10 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. Varning: Vänligen kolla så att din dators datum och tid är korrekt! Om din klocka går fel kommer Bitcoin Core inte att fungera korrekt. - - Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. - Vitlista klienter som ansluter från angivna nätmasker eller ip adresser. Kan specificeras flera gånger. - Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway Vitlistade klienter kan inte bli DoS bannade och deras transaktioner reläas alltid, även om dom redan är i mempoolen, användbart för t.ex en gateway - - Always query for peer addresses via DNS lookup (default: 0) - Sök alltid efter klientadresser med DNS sökningen (förvalt: 0) - Cannot resolve -whitebind address: '%s' Kan inte matcha -whitebind adress: '%s' @@ -3191,10 +3003,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Fee (in BTC/kB) to add to transactions you send (default: %s) Avgift (i BTC/Kb) att lägga till på transaktioner du skickar (förvalt: %s) - - Include IP addresses in debug output (default: 0) - Inkludera IP-adresser i debugutskrift (förvalt: 0) - Information Information @@ -3223,26 +3031,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Keep at most <n> unconnectable blocks in memory (default: %u) Håll som mest <n> oanslutningsbara block i minnet (förvalt: %u) - - Limit size of signature cache to <n> entries (default: 50000) - Begränsa signaturcachestorleken till <n> poster (förvalt: 50000) - - - Log transaction priority and fee per kB when mining blocks (default: 0) - Logga transaktionsprioritet och avgift per kB vid blockbrytning (förvalt: 0) - - - Maintain a full transaction index (default: 0) - Upprätthåll ett fullständigt transaktionsindex (förval: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Maximal buffert för mottagning per anslutning, <n>*1000 byte (förvalt: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Maximal buffert för sändning per anslutning, <n>*1000 byte (förvalt: 5000) - Need to specify a port with -whitebind: '%s' Port måste anges med -whitelist: '%s' @@ -3251,22 +3039,10 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Node relay options: Nodreläoptioner: - - Only accept block chain matching built-in checkpoints (default: 1) - Acceptera bara blockkedjans matchande inbyggda kontrollpunkter (förvalt: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Anslut enbart till noder i nätverket <net> (IPv4, IPv6 eller Tor) - Print block on startup, if found in block index Skriv ut block vid uppstart, om det hittas i blockindexet - - Print block tree on startup (default: 0) - Skriv ut blockträdet vid uppstart (förvalt: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) RPC SSL optioner: (se Bitcoin Wiki för SSL inställningsinstruktioner) @@ -3283,30 +3059,10 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Randomly fuzz 1 of every <n> network messages Slupmässigt brus 1 gång varje <n> nätverksmeddelande - - Relay and mine data carrier transactions (default: 1) - Reläa och bearbeta databärartransaktioner (förvalt: 1) - - - Relay non-P2SH multisig (default: 1) - Reläa icke P2SH multisig (förvalt: 1) - - - Run a thread to flush wallet periodically (default: 1) - Kör en tråd för att tömma plånboken periodiskt (förvalt: 1) - Send trace/debug info to console instead of debug.log file Skicka trace-/debuginformation till terminalen istället för till debug.log - - Set minimum block size in bytes (default: 0) - Sätt minsta blockstorlek i byte (förvalt: 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - Sätt DB_PRIVATE flaggan i plånbokens databasmiljö (förvalt: 1) - Show all debugging options (usage: --help -help-debug) Visa alla avlusningsoptioner (använd: --help -help-debug) @@ -3319,14 +3075,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Signing transaction failed Signering av transaktion misslyckades - - Specify connection timeout in milliseconds (default: 5000) - Ange timeout för uppkoppling i millisekunder (förvalt: 5000) - - - System error: - Systemfel: - This is experimental software. Detta är experimentmjukvara. @@ -3347,10 +3095,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Unable to bind to %s on this computer (bind returned error %s) Det går inte att binda till %s på den här datorn (bind returnerade felmeddelande %s) - - Use UPnP to map the listening port (default: 0) - Använd UPnP för att mappa den lyssnande porten (förvalt: 0) - Use UPnP to map the listening port (default: 1 when listening) Använd UPnP för att mappa den lyssnande porten (förvalt: 1 under lyssning) @@ -3403,10 +3147,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Upgrade wallet to latest format Uppgradera plånboken till senaste formatet - - Set key pool size to <n> (default: 100) - Sätt storleken på nyckelpoolen till <n> (förvalt: 100) - Rescan the block chain for missing wallet transactions Sök i blockkedjan efter saknade plånboks transaktioner @@ -3415,14 +3155,6 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Use OpenSSL (https) for JSON-RPC connections Använd OpenSSL (https) för JSON-RPC-anslutningar - - Server certificate file (default: server.cert) - Serverns certifikatfil (förvalt: server.cert) - - - Server private key (default: server.pem) - Serverns privata nyckel (förvalt: server.pem) - This help message Det här hjälp medelandet diff --git a/src/qt/locale/bitcoin_th_TH.ts b/src/qt/locale/bitcoin_th_TH.ts index cb52be61b2..e4b1e069cd 100644 --- a/src/qt/locale/bitcoin_th_TH.ts +++ b/src/qt/locale/bitcoin_th_TH.ts @@ -162,10 +162,6 @@ Tabs toolbar แถบเครื่องมือ - - [testnet] - [testnet] - %n active connection(s) to Bitcoin network %n ที่ใช้งานการเชื่อมต่อกับเครือข่าย Bitcoin @@ -277,10 +273,6 @@ Form รูป - - <b>Recent transactions</b> - <b>รายการทำธุรกรรมล่าสุด</b> - PaymentServer diff --git a/src/qt/locale/bitcoin_tr.ts b/src/qt/locale/bitcoin_tr.ts index b2a14c92fc..b5d00bc24e 100644 --- a/src/qt/locale/bitcoin_tr.ts +++ b/src/qt/locale/bitcoin_tr.ts @@ -390,10 +390,6 @@ Tabs toolbar Sekme araç çubuğu - - [testnet] - [testnet] - Bitcoin Core Bitcoin Çekirdeği @@ -434,10 +430,6 @@ No block source available... Hiçbir blok kaynağı mevcut değil... - - Processed %1 blocks of transaction history. - Muamele tarihçesinde %1 blok işlendi. - %n hour(s) %n saat%n saat @@ -486,6 +478,10 @@ Up to date Güncel + + Processed %n blocks of transaction history. + Muamele tarihçesinden %n blok işlendiMuamele tarihçesinden %n blok işlendi + Catching up... Aralık kapatılıyor... @@ -916,13 +912,13 @@ Adres: %4 Error Hata - - GB of free space available - GB boş alan mevcuttur + + %n GB of free space available + %n GB boş alan mevcuttur%n GB boş alan mevcuttur - - (of %1GB needed) - (gereken boyut: %1GB) + + (of %n GB needed) + (gereken %n GB alandan)(gereken %n GB alandan) @@ -1165,10 +1161,6 @@ Adres: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. Görüntülenen veriler zaman aşımına uğramış olabilir. Bağlantı kurulduğunda cüzdanınız otomatik olarak şebeke ile eşleşir ancak bu işlem henüz tamamlanmamıştır. - - Wallet - Cüzdan - Watch-only: Sadece-izlenen: @@ -1197,6 +1189,10 @@ Adres: %4 Mined balance that has not yet matured Oluşturulan bakiye henüz olgunlaşmamıştır + + Balances + Bakiyeler + Total: Toplam: @@ -1209,6 +1205,14 @@ Adres: %4 Your current balance in watch-only addresses Sadece izlenen adreslerdeki güncel bakiyeniz + + Spendable: + Harcanabilir: + + + Recent transactions + Son muameleler + Unconfirmed transactions to watch-only addresses Sadece izlenen adreslere gelen teyit edilmemiş muameleler @@ -1221,10 +1225,6 @@ Adres: %4 Current total balance in watch-only addresses Sadece izlenen adreslerdeki güncel toplam bakiye - - <b>Recent transactions</b> - <b>Son muameleler</b> - out of sync eşleşme dışı @@ -1484,10 +1484,6 @@ Adres: %4 Services Servisler - - Sync Node - Eşleşme Düğümü - Starting Height Başlama Yüksekliği @@ -1616,14 +1612,6 @@ Adres: %4 Outbound Giden - - Yes - Evet - - - No - Hayır - Unknown Bilinmiyor @@ -2472,6 +2460,10 @@ Adres: %4 Mined Madenden çıkarılan + + watch-only + sadece-izlenen + (n/a) (mevcut değil) @@ -2488,6 +2480,10 @@ Adres: %4 Type of transaction. Muamele türü. + + Whether or not a watch-only address is involved in this transaction. + Bu muamelede sadece izlenen bir adresin bulunup bulunmadığı. + Destination address of transaction. Muamelenin alıcı adresi. @@ -2583,6 +2579,10 @@ Adres: %4 Export Transaction History Muamele tarihçesini dışa aktar + + Watch-only + Sadece izlenen + Exporting Failed Dışa aktarım başarısız oldu @@ -2698,26 +2698,10 @@ Adres: %4 Options: Seçenekler: - - Specify configuration file (default: bitcoin.conf) - Yapılandırma dosyası belirt (varsayılan: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Pid dosyası belirt (varsayılan: bitcoind.pid) - Specify data directory Veri dizinini belirt - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Bağlantılar için dinlenecek <port> (varsayılan: 8333 ya da testnet: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Eşler ile en çok <n> adet bağlantı kur (varsayılan: 125) - Connect to a node to retrieve peer addresses, and disconnect Eş adresleri elde etmek için bir düğüme bağlan ve ardından bağlantıyı kes @@ -2726,18 +2710,6 @@ Adres: %4 Specify your own public address Kendi genel adresinizi tanımlayın - - Threshold for disconnecting misbehaving peers (default: 100) - Aksaklık gösteren eşlerle bağlantıyı kesme sınırı (varsayılan: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Aksaklık gösteren eşlerle yeni bağlantıları engelleme süresi, saniye olarak (varsayılan: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - JSON-RPC bağlantılarını <port> üzerinde dinle (varsayılan: 8332 veya tesnet: 18332) - Accept command line and JSON-RPC commands Komut satırı ve JSON-RPC komutlarını kabul et @@ -2778,18 +2750,10 @@ Sorunlar hakkında bildiri almak için alertnotify unsurunu ayarlamanız tavsiye mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Kabul edilebilir şifreler (varsayılan: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 Belirtilen adrese bağlan ve daima ondan dinle. IPv6 için [makine]:port yazımını kullanınız - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - Devamlı olarak ücretsiz muameleleri dakikada <n>*1000 bayt olarak sınırla (varsayılan: 15) - Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup Tüm cüzdan muamelelerini sil ve başlangıçta -rescan ile sadece blok zincirinin parçası olanları geri getir @@ -2810,14 +2774,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) Bir cüzdan muamelesi değiştiğinde komutu çalıştır (komuttaki %s muamele kimliği ile değiştirilecektir) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - Veritabanı etkinliğini bellekten disk kütüğüne her <n> megabaytta aktar (varsayılan: 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - -checkblocks'un blok kontrolünün ne kadar kapsamlı olacağı (0 ilâ 4, varsayılan: 3) - In this mode -genproclimit controls how many blocks are generated immediately. Bu kipte -genproclimit kaç sayıda bloğun anında oluşturulduğunu kontrol eder. @@ -2826,10 +2782,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Betik kontrolü iş parçacıklarının sayısını belirler (%u ilâ %d, 0 = otomatik, <0 = bu sayıda çekirdeği kullanma, varsayılan: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - Oluşturma etkinken işlemci sınırını belirler (-1 = sınırsız, varsayılan: -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Bu yayın öncesi bir deneme sürümüdür - tüm riski siz üstlenmiş olursunuz - bitcoin oluşturmak ya da ticari uygulamalar için kullanmayınız @@ -2838,10 +2790,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Unable to bind to %s on this computer. Bitcoin Core is probably already running. Bu bilgisayarda %s unsuruna bağlanılamadı. Bitcoin Çekirdeği muhtemelen hâlihazırda çalışmaktadır. - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - Eşlere gizli Tor servisleri ile ulaşmak için ayrı SOCKS5 vekil sunucusu kullan (varsayılan: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Uyarı: -paytxfee çok yüksek bir değere ayarlanmış! Bu, muamele gönderirseniz ödeyeceğiniz muamele ücretidir. @@ -2863,12 +2811,12 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Uyarı: wallet.dat bozuk, veriler geri kazanıldı! Özgün wallet.dat, wallet.{zamandamgası}.bak olarak %s klasörüne kaydedildi; bakiyeniz ya da muameleleriniz yanlışsa bir yedeklemeden tekrar yüklemeniz gerekir. - (default: 1) - (varsayılan: 1) + Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times. + Belirtilen ağ maskesi ya da IP adresinden bağlanan eşleri beyaz listeye al. Birden fazla kez belirtilebilir. - (default: wallet.dat) - (varsayılan: wallet.dat) + (default: 1) + (varsayılan: 1) <category> can be: @@ -2898,10 +2846,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Debugging/Testing options: Hata ayıklama/deneme seçenekleri: - - Disable safemode, override a real safe mode event (default: 0) - Güvenli kipi devre dışı bırak, gerçek bir güvenli olayı geçersiz kıl (varsayılan: 0) - Discover own IP address (default: 1 when listening and no -externalip) Kendi IP adresini keşfet (varsayılan: dinlenildiğinde ve -externalip yoksa 1) @@ -2930,6 +2874,10 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error opening block database Blok veritabanının açılışı sırasında hata + + Error: A fatal internal error occured, see debug.log for details + Hata: Ölümcül dahili bir hata meydana geldi, ayrıntılar için debug.log dosyasına bakınız + Error: Disk space is low! Hata: Disk alanı düşük! @@ -2938,66 +2886,10 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Wallet locked, unable to create transaction! Hata: Cüzdan kilitli, muamele oluşturulamadı! - - Error: system error: - Hata: sistem hatası: - Failed to listen on any port. Use -listen=0 if you want this. Herhangi bir portun dinlenmesi başarısız oldu. Bunu istiyorsanız -listen=0 seçeneğini kullanınız. - - Failed to read block info - Blok verileri okunamadı - - - Failed to read block - Blok okunamadı - - - Failed to sync block index - Blok indeksi eşleştirilemedi - - - Failed to write block index - Blok indeksi yazılamadı - - - Failed to write block info - Blok verileri yazılamadı - - - Failed to write block - Blok yazılamadı - - - Failed to write file info - Dosya verileri yazılamadı - - - Failed to write to coin database - Madenî para veritabanına yazılamadı - - - Failed to write transaction index - Muamele indeksi yazılamadı - - - Failed to write undo data - Geri alma verilerinin yazılamadı - - - Force safe mode (default: 0) - Güvenli kipi zorla (varsayılan: 0) - - - Generate coins (default: 0) - Bitcoin oluştur (varsayılan: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Başlangıçta kontrol edilecek blok sayısı (varsayılan: 288, 0 = hepsi) - If <category> is not supplied, output all debugging information. <kategori> sağlanmamışsa tüm hata ayıklama verilerini dök. @@ -3019,8 +2911,8 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Kafi derecede dosya tanımlayıcıları mevcut değil. - Prepend debug output with timestamp (default: 1) - Hata ayıklama verilerinin önüne zaman damgası ekle (varsayılan: 1) + Only connect to nodes in network <net> (ipv4, ipv6 or onion) + Sadece <net> şebekesindeki düğümlere bağlan (ipv4, ipv6 veya onion) Rebuild block chain index from current blk000??.dat files @@ -3034,26 +2926,18 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set maximum block size in bytes (default: %d) Azami blok boyutunu bayt olarak ayarla (varsayılan: %d) - - Set the number of threads to service RPC calls (default: 4) - RPC aramaları için iş parçacığı sayısını belirle (varsayılan: 4) - Specify wallet file (within data directory) Cüzdan dosyası belirtiniz (veri klasörünün içinde) - - Spend unconfirmed change when sending transactions (default: 1) - Gönderme muamelelerinde teyit edilmemiş para üstünü harca (varsayılan: 1) - - - Stop running after importing blocks from disk (default: 0) - Diskten blokları içeri aktardıktan sonra çalışmayı durdur (varsayılan: 0) - This is intended for regression testing tools and app development. Bu, regresyon deneme araçları ve uygulama geliştirmesi için tasarlanmıştır. + + Use UPnP to map the listening port (default: %u) + Dinleme portunu haritalamak için UPnP kullan (varsayılan: %u) + Verifying blocks... Bloklar kontrol ediliyor... @@ -3078,10 +2962,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Imports blocks from external blk000??.dat file Harici blk000??.dat dosyasından blokları içe aktarır - - (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) - (varsayılan: 1, 1 = tx meta verilerini tut mesela hesap sahibi ve ödeme talebi bilgileri, 2 = tx meta verilerini at) - Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times Belirtilen kaynaktan JSON-RPC bağlantılarını kabul et. Bir <ip> için geçerli olanlar şunlardır: salt IP adresi (mesela 1.2.3.4), bir şebeke/ağ maskesi (örneğin 1.2.3.4/255.255.255.0) ya da bir şebeke/CIDR (mesela 1.2.3.4/24). Bu seçenek birden fazla kez belirtilebilir @@ -3102,6 +2982,10 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. %s veri dizininde kilit elde edilemedi. Bitcoin Çekirdeği muhtemelen hâlihazırda çalışmaktadır. + + Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:%u) + Devamlı olarak ücretsiz muameleleri dakikada <n>*1000 bayt olarak sınırla (varsayılan: %u) + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) Yeni dosyaları umask 077 yerine varsayılan izinlerle oluştur (sadece devre dışı cüzdan işlevselliği ile etkilidir) @@ -3118,10 +3002,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. Hata: Desteklenmeyen -socks argümanı bulundu. SOCKS sürümünün ayarlanması artık mümkün değildir, sadece SOCKS5 vekilleri desteklenmektedir. - - Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) - Bir şebeke muamelesi cüzdan muamele girdisini tekrar harcadığında komut çalıştır (%s=tekrar harcama muamele kimliği, %t=cüzdan muamele kimliği) - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) İlgili bir uyarı alındığında ya da gerçekten uzun bir çatallama gördüğümüzde komutu çalıştır (komuttaki %s mesaj ile değiştirilir) @@ -3134,14 +3014,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) Kb başına BTC olarak bundan düşük ücretler muamele oluşturulması için sıfır değerinde ücret olarak kabul edilir (varsayılan: %s) - - If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) - Eğer paytxfee ayarlanmadıysa, kafi derecede ücret ekleyin ki muameleler vasati n blok içinde teyit edilsin (varsayılan: 1) - - - Output debugging information (default: 0, supplying <category> is optional) - Hata ayıklama bilgisi dök (varsayılan:0, <kategori> sağlanması seçime dayalıdır) - Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) Adres sayısı azaldıysa DNS sorgulamasıyla eş adresleri ara (varsayılan: 1 -connect kullanılmadıysa) @@ -3158,18 +3030,10 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. Uyarı: Lütfen bilgisayarınızın saat ve tarihinin doğru olduğunu kontol ediniz! Saatinizde gecikme varsa Bitcoin Çekirdeği doğru şekilde çalışamaz. - - Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. - Belirtilen ağ maskesi ya da IP adresinden bağlanan eşleri beyaz listeye al. Birden fazla kez belirtilebilir. - Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway Beyaz listeye alınan eşler DoS yasaklamasına uğramazlar ve muameleleri zaten mempool'da olsalar da daima aktarılır, bu mesela bir geçit için kullanışlıdır - - Always query for peer addresses via DNS lookup (default: 0) - Eş adreslerini daima DNS araması ile sorgula (varsayılan: 0) - Cannot resolve -whitebind address: '%s' -whitebind adresi çözümlenemedi: '%s' @@ -3198,10 +3062,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Fee (in BTC/kB) to add to transactions you send (default: %s) Yolladığınız muamelelere kB başına BTC olarak eklenecek ücret (varsayılan: %s) - - Include IP addresses in debug output (default: 0) - Hata ayıklama çıktısına IP adreslerini dahil et (varsayılan: 0) - Information Bilgi @@ -3231,24 +3091,8 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Hafızada en çok <n> bağlanılamaz blok tut (varsaylan: %u) - Limit size of signature cache to <n> entries (default: 50000) - İmza arabelleğinin boyutunu <n> unsurla sınırla (varsayılan: 50000) - - - Log transaction priority and fee per kB when mining blocks (default: 0) - Blok oluşturulduğunda muamele önceliğini ve kB başı ücreti kütüğe al (varsayılan: 0) - - - Maintain a full transaction index (default: 0) - Muamelelerin tamamının indeksini tut (varsayılan: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Bağlantı başına azami alım tamponu, <n>*1000 bayt (varsayılan: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Bağlantı başına azami yollama tamponu, <n>*1000 bayt (varsayılan: 1000) + Keep at most <n> unconnectable transactions in memory (default: %u) + Hafızada en çok <n> bağlanılamaz muamele tut (varsayılan: %u) Need to specify a port with -whitebind: '%s' @@ -3258,22 +3102,10 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Node relay options: Düğüm röle seçenekleri: - - Only accept block chain matching built-in checkpoints (default: 1) - Sadece yerleşik kontrol noktalarıyla eşleşen blok zincirini kabul et (varsayılan: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Sadece <net> şebekesindeki düğümlere bağlan (IPv4, IPv6 ya da Tor) - Print block on startup, if found in block index Başlangıçta bloğu göster, blok indeksinde bulunduysa - - Print block tree on startup (default: 0) - Başlangıçta blok ağacını göster (varsayılan: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) RPC SSL seçenekleri: (SSL kurulumu yönergeleri için Bitcoin vikisine bakınız) @@ -3290,30 +3122,10 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Randomly fuzz 1 of every <n> network messages Her <n> şebeke mesajından rastgele birini bulanıklaştır - - Relay and mine data carrier transactions (default: 1) - Veri taşıyıcı muameleleri oluştur ve aktar (varsayılan: 1) - - - Relay non-P2SH multisig (default: 1) - P2SH olmayan çoklu imzaları aktar (varsayılan: 1) - - - Run a thread to flush wallet periodically (default: 1) - Periyodik olarak cüdanı diske yazdırmak için bir iş parçacığı çalıştır (varsayılan: 1) - Send trace/debug info to console instead of debug.log file Trace/hata ayıklama verilerini debug.log dosyası yerine konsola gönder - - Set minimum block size in bytes (default: 0) - Bayt olarak asgari blok boyutunu tanımla (varsayılan: 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - Cüzdan veritabanı ortamında DB_PRIVATE bayrağını koyar (varsayılan: 1) - Show all debugging options (usage: --help -help-debug) Tüm hata ayıklama seçeneklerini göster (kullanımı: --help -help-debug) @@ -3326,14 +3138,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Signing transaction failed Muamelenin imzalanması başarısız oldu - - Specify connection timeout in milliseconds (default: 5000) - Bağlantı zaman aşım süresini milisaniye olarak belirt (varsayılan: 5000) - - - System error: - Sistem hatası: - This is experimental software. Bu, deneysel bir yazılımdır. @@ -3354,10 +3158,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Unable to bind to %s on this computer (bind returned error %s) Bu bilgisayarda %s unsuruna bağlanılamadı (bağlanma %s hatasını verdi) - - Use UPnP to map the listening port (default: 0) - Dinlenecek portu haritalamak için UPnP kullan (varsayılan: 0) - Use UPnP to map the listening port (default: 1 when listening) Dinlenecek portu haritalamak için UPnP kullan (varsayılan: dinlenildiğinde 1) @@ -3410,10 +3210,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Upgrade wallet to latest format Cüzdanı en yeni biçime güncelle - - Set key pool size to <n> (default: 100) - Anahtar alan boyutunu <n> değerine ayarla (varsayılan: 100) - Rescan the block chain for missing wallet transactions Blok zincirini eksik cüzdan muameleleri için tekrar tara @@ -3422,14 +3218,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Use OpenSSL (https) for JSON-RPC connections JSON-RPC bağlantıları için OpenSSL (https) kullan - - Server certificate file (default: server.cert) - Sunucu sertifika dosyası (varsayılan: server.cert) - - - Server private key (default: server.pem) - Sunucu özel anahtarı (varsayılan: server.pem) - This help message Bu yardım mesajı @@ -3446,14 +3234,182 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error loading wallet.dat: Wallet corrupted wallet.dat dosyasının yüklenmesinde hata oluştu: bozuk cüzdan + + (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + (1 = tx meta verilerini tut mesela hesap sahibi ve ödeme talebi bilgileri, 2 = tx meta verilerini at) + + + Flush database activity from memory pool to disk log every <n> megabytes (default: %u) + Veritabanı etkinliğini bellekten disk kütüğüne her <n> megabaytta aktar (varsayılan: %u) + + + How thorough the block verification of -checkblocks is (0-4, default: %u) + -checkblocks'un blok kontrolünün ne kadar kapsamlı olacağı (0 ilâ 4, varsayılan: %u) + + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: %u) + Eğer paytxfee ayarlanmadıysa, kafi derecede ücret ekleyin ki muameleler vasati n blok içinde teyit edilsin (varsayılan: %u) + + + Log transaction priority and fee per kB when mining blocks (default: %u) + Blok oluşturulduğunda muamele önceliğini ve kB başı ücreti kütüğe al (varsayılan: %u) + + + Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u) + Muamelelerin tamamının indeksini tut, getrawtransaction rpc çağrısı tarafından kullanılır (varsayılan: %u) + + + Number of seconds to keep misbehaving peers from reconnecting (default: %u) + Aksaklık gösteren eşlerle terkar bağlantıyı engelleme süresi, saniye olarak (varsayılan: %u) + + + Output debugging information (default: %u, supplying <category> is optional) + Hata ayıklama bilgisi dök (varsayılan: %u, <kategori> sağlanması seçime dayalıdır) + + + Set the processor limit for when generation is on (-1 = unlimited, default: %d) + Oluşturma etkinken işlemci sınırını belirle (-1 = sınırsız, varsayılan: %d) + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) + Eşlere gizli Tor servisleri ile ulaşmak için ayrı SOCKS5 vekil sunucusu kullan (varsayılan: %s) + + + (default: %s) + (varsayılan: %s) + + + Acceptable ciphers (default: %s) + Kabul edilebilir şifreler (varsayılan: %s) + + + Always query for peer addresses via DNS lookup (default: %u) + Eş adresleri sorgulaması için daima DNS aramasını kullan (varsayılan: %u) + + + Disable safemode, override a real safe mode event (default: %u) + Güvenli kipi devre dışı bırak, gerçek bir güvenli olayı geçersiz kıl (varsayılan: %u) + Error loading wallet.dat wallet.dat dosyasının yüklenmesinde hata oluştu + + Force safe mode (default: %u) + Güvenli kipi zorla (varsayılan: %u) + + + Generate coins (default: %u) + Bitcoin oluştur (varsayılan: %u) + + + How many blocks to check at startup (default: %u, 0 = all) + Başlangıçta kontrol edilecek blok sayısı (varsayılan: %u, 0 = hepsi) + + + Include IP addresses in debug output (default: %u) + Hata ayıklama çıktısına IP adreslerini dahil et (varsayılan: %u) + Invalid -proxy address: '%s' Geçersiz -proxy adresi: '%s' + + Limit size of signature cache to <n> entries (default: %u) + İmza arabelleğinin boyutunu <n> unsurla sınırla (varsayılan: %u) + + + Listen for JSON-RPC connections on <port> (default: %u or testnet: %u) + JSON-RPC bağlantılarını <port> üzerinde dinle (varsayılan: %u veya tesnet: %u) + + + Listen for connections on <port> (default: %u or testnet: %u) + Bağlantılar için dinlenecek <port> (varsayılan: %u ya da testnet: %u) + + + Maintain at most <n> connections to peers (default: %u) + Eşler ile en çok <n> adet bağlantı kur (varsayılan: %u) + + + Maximum per-connection receive buffer, <n>*1000 bytes (default: %u) + Her bağlantı için azami alım tamponu, <n>*1000 bayt (varsayılan: %u) + + + Maximum per-connection send buffer, <n>*1000 bytes (default: %u) + Her bağlantı için azami yollama tamponu, <n>*1000 bayt (varsayılan: %u) + + + Only accept block chain matching built-in checkpoints (default: %u) + Sadece yerleşik kontrol noktalarıyla eşleşen blok zincirini kabul et (varsayılan: %u) + + + Prepend debug output with timestamp (default: %u) + Hata ayıklama verilerinin önüne zaman damgası ekle (varsayılan: %u) + + + Print block tree on startup (default: %u) + Başlangıçta blok ağacını göster (varsayılan: %u) + + + Relay and mine data carrier transactions (default: %u) + Veri taşıyıcı muameleleri oluştur ve aktar (varsayılan: %u) + + + Relay non-P2SH multisig (default: %u) + P2SH olmayan çoklu imzaları aktar (varsayılan: %u) + + + Run a thread to flush wallet periodically (default: %u) + Periyodik olarak cüdanı diske yazdırmak için bir iş parçacığı çalıştır (varsayılan: %u) + + + Server certificate file (default: %s) + Sunucu sertifika dosyası (varsayılan: %s) + + + Server private key (default: %s) + Sunucu özel anahtarı (varsayılan: %s) + + + Set key pool size to <n> (default: %u) + Anahtar alan boyutunu <n> değerine ayarla (varsayılan: %u) + + + Set minimum block size in bytes (default: %u) + Bayt olarak asgari blok boyutunu tanımla (varsayılan: %u) + + + Set the number of threads to service RPC calls (default: %d) + Hizmet RCP aramaları iş parçacığı sayısını belirle (varsayılan: %d) + + + Sets the DB_PRIVATE flag in the wallet db environment (default: %u) + Cüzdan veritabanı ortamında DB_PRIVATE bayrağını koyar (varsayılan: %u) + + + Specify configuration file (default: %s) + Yapılandırma dosyası belirtiniz (varsayılan: %s) + + + Specify connection timeout in milliseconds (minimum: 1, default: %d) + Bağlantı zaman aşım süresini milisaniye olarak belirt (asgari: 1, varsayılan: %d) + + + Specify pid file (default: %s) + Pid dosyası belirtiniz (varsayılan: %s) + + + Spend unconfirmed change when sending transactions (default: %u) + Gönderme muamelelerinde teyit edilmemiş para üstünü harca (varsayılan: %u) + + + Stop running after importing blocks from disk (default: %u) + Diskten blokları içeri aktardıktan sonra çalışmayı durdur (varsayılan: %u) + + + Threshold for disconnecting misbehaving peers (default: %u) + Aksaklık gösteren eşlerle bağlantıyı kesme sınırı (varsayılan: %u) + Unknown network specified in -onlynet: '%s' -onlynet için bilinmeyen bir şebeke belirtildi: '%s' diff --git a/src/qt/locale/bitcoin_uk.ts b/src/qt/locale/bitcoin_uk.ts index ff8ac68022..c8fe1df9bf 100644 --- a/src/qt/locale/bitcoin_uk.ts +++ b/src/qt/locale/bitcoin_uk.ts @@ -9,10 +9,22 @@ Create a new address Створити нову адресу + + &New + &Нова + Copy the currently selected address to the system clipboard Копіювати виділену адресу в буфер обміну + + &Copy + &Копіювати + + + C&lose + З&акрити + &Copy Address &Скопіювати адресу @@ -33,13 +45,29 @@ &Delete &Видалити + + Choose the address to send coins to + Виберіть адресу для відправлення монет + + + Choose the address to receive coins with + Виберіть адресу для отримання монет + C&hoose &Обрати + + Sending addresses + Адреси для відправлення + + + Receiving addresses + Адреси для отримання + These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - Це ваші Bitcoin адреси для відправки платежів. Перед відправкою монети Завжди перевіряйте суму та адресу прийому. + Це ваші Bitcoin-адреси для відправлення платежів. Перед відправленням монет завжди перевіряйте суму та адресу прийому. These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. @@ -61,9 +89,13 @@ Comma separated file (*.csv) Файли, розділені комою (*.csv) + + Exporting Failed + Помилка експорту + There was an error trying to save the address list to %1. Please try again. - Сталася помилка підчас зберігання адрес до %1. Будь ласка спробуйте ще. + Виникла помилка при спробі зберігання адрес до %1. Будь ласка спробуйте ще. @@ -141,7 +173,7 @@ 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. - ВАЖЛИВО: Всі попередні резервні копії, які ви зробили з вашого файла гаманця повинні бути замінені новоствореним, зашифрованим файлом гаманця. З міркувань безпеки, попередні резервні копії в незашифрованого файла гаманця стануть марним, як тільки ви починаєте використовувати новий, зашифрований гаманець. + ВАЖЛИВО: Всі попередні резервні копії, які ви зробили з вашого файлу гаманця повинні бути замінені новоствореним, зашифрованим файлом гаманця. З міркувань безпеки, попередні резервні копії незашифрованого файла гаманця стануть марними одразу ж, як тільки ви почнете використовувати новий, зашифрований гаманець. Warning: The Caps Lock key is on! @@ -151,6 +183,10 @@ Wallet encrypted Гаманець зашифровано + + 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>. + Введіть нову кодову фразу для гаманця.<br/>Будь ласка, використовуйте кодові фрази що містять <b> як мінімум десять випадкових символів </b> або <b> як мінімум вісім слів </b>. + Bitcoin 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. Біткоін-клієнт буде закрито для завершення процесу шифрування. Пам'ятайте, що шифрування гаманця не може повністю захистити ваші біткоіни від крадіжки, у випадку якщо ваш комп'ютер буде інфіковано шкідливими програмами. @@ -173,7 +209,7 @@ The passphrase entered for the wallet decryption was incorrect. - Введений пароль є невірним. + Введений пароль є неправильним. Wallet decryption failed @@ -198,6 +234,10 @@ &Overview &Огляд + + Node + Вузол + Show general overview of wallet Показати загальний огляд гаманця @@ -254,6 +294,10 @@ Open &URI... Відкрити &URI + + Bitcoin Core client + Клієнт «Bitcoin Core» + Importing blocks from disk... Імпорт блоків з диску... @@ -288,7 +332,7 @@ &Verify message... - Перевірити повідомлення... + П&еревірити повідомлення... Bitcoin @@ -347,29 +391,45 @@ Панель вкладок - [testnet] - [тестова мережа] + Bitcoin Core + Bitcoin Core - Bitcoin Core - Bitcoin Ядро + Request payments (generates QR codes and bitcoin: URIs) + Створити запит платежу (генерує QR-код та bitcoin: URI) + + + &About Bitcoin Core + &Про Bitcoin Core + + + Show the list of used sending addresses and labels + Показати список адрес і міток, що були використані для відправлення + + + Show the list of used receiving addresses and labels + Показати список адрес і міток, що були використані для отримання + + + Open a bitcoin: URI or payment request + Відкрити bitcoin: URI чи запит платежу &Command-line options Параметри командного рядка + + Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options + Показати довідку Bitcoin Core для отримання переліку можливих параметрів командного рядка. + %n active connection(s) to Bitcoin network - %n активние з'єднання з мережею Bitcoin%n активниих з'єднань з мережею Bitcoin%n активних з'єднань з мережею Bitcoin + %n активне з'єднання з мережею%n активні з'єднання з мережею%n активних з'єднань з мережею Bitcoin No block source available... Недоступно жодного джерела блоків... - - Processed %1 blocks of transaction history. - Оброблено %1 блоків історії транзакцій. - %n hour(s) %n година%n години%n годин @@ -418,6 +478,10 @@ Up to date Синхронізовано + + Processed %n blocks of transaction history. + Оброблено %n блок історії транзакцій.Оброблено %n блоки історії транзакцій.Оброблено %n блоків історії транзакцій. + Catching up... Синхронізується... @@ -428,7 +492,7 @@ Incoming transaction - Отримані перекази + Отримані транзакції Date: %1 @@ -460,10 +524,18 @@ Address: %4 CoinControlDialog + + Coin Control Address Selection + Вибір адрес для керування монетами + Quantity: Кількість: + + Bytes: + Байтів: + Amount: Кількість: @@ -476,14 +548,30 @@ Address: %4 Fee: Комісія: + + Dust: + Пил: + After Fee: - Після комісії + Після комісії: Change: Решта: + + (un)select all + Вибрати/зняти всі + + + Tree mode + Деревом + + + List mode + Списком + Amount Кількість @@ -496,10 +584,18 @@ Address: %4 Date Дата + + Confirmations + Підтверджень + Confirmed Підтверджені + + Priority + Пріоритет + Copy address Скопіювати адресу @@ -516,6 +612,14 @@ Address: %4 Copy transaction ID Копіювати ID транзакції + + Lock unspent + Заблокувати + + + Unlock unspent + Розблокувати + Copy quantity Копіювати кількість @@ -536,6 +640,10 @@ Address: %4 Copy priority Копіювати пріорітет + + Copy dust + Копіювати пил + Copy change Копіювати решту @@ -576,6 +684,18 @@ Address: %4 lowest найнижчий + + (%1 locked) + (%1 заблоковано) + + + none + відсутній + + + Can vary +/- %1 satoshi(s) per input. + Може відрізнятися на +/- %1 сатоші за вхід + yes так @@ -588,9 +708,21 @@ Address: %4 This label turns red, if the transaction size is greater than 1000 bytes. Ця позначка буде червоною, якщо розмір транзакції вищий за 1000 байт. + + This means a fee of at least %1 per kB is required. + Це означає, що необхідно внести комісію (щонайменше %1 за КБ). + + + Can vary +/- 1 byte per input. + Може відрізнятися на +/- 1 байт за вхід. + + + Transactions with higher priority are more likely to get included into a block. + Транзакції з вищим пріоритетом мають більше шансів бути включеними до блоку. + This label turns red, if the priority is smaller than "medium". - Ця позначка буде червоною, якщо пріорітет транзакції нижчий за «середній»". + Ця позначка буде червоною, якщо пріоритет транзакції нижчий за «середній». This label turns red, if any recipient receives an amount smaller than %1. @@ -600,7 +732,15 @@ Address: %4 (no label) (немає назви) - + + change from %1 (%2) + решта з %1 (%2) + + + (change) + (решта) + + EditAddressDialog @@ -611,6 +751,14 @@ Address: %4 &Label &Мітка + + The label associated with this address list entry + Мітка, пов'язана з цим записом списку адрес + + + The address associated with this address list entry. This can only be modified for sending addresses. + Адреса, пов'язана з цим записом списку адрес. Це поле може бути модифіковане лише для адрес відправлення. + &Address &Адреса @@ -675,11 +823,19 @@ Address: %4 HelpMessageDialog Bitcoin Core - Bitcoin Ядро + Bitcoin Core version - версія + версії + + + (%1-bit) + (%1-бітний) + + + About Bitcoin Core + Про Bitcoin Core Command-line options @@ -705,6 +861,10 @@ Address: %4 Start minimized Запускати згорнутим + + Set SSL root certificates for payment request (default: -system-) + Вказати кореневі SSL-сертифікати для запиту платежу (типово: -системні-) + Show splash screen on startup (default: 1) Показувати заставку під час запуску (типово: 1) @@ -730,7 +890,7 @@ Address: %4 Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - Bitcoin Core завантажить та збереже копію ланцюга Bitcoin блоків. Щонайменше %1Gb даних буде збережено в цьому каталозі. Гаманець теж буде збережено в цьому каталозі. + Bitcoin Core завантажить та збереже копію ланцюжка блоків Bitcoin. Щонайменше %1ГБ даних буде збережено в цьому каталозі. Гаманець теж буде збережено в цьому каталозі. Use the default data directory @@ -746,19 +906,19 @@ Address: %4 Error: Specified data directory "%1" cannot be created. - Помилка: неожливо створити обраний каталог даних «%1». + Помилка: неможливо створити обраний каталог даних «%1». Error Помилка - - GB of free space available - Gb вільного простору доступно + + %n GB of free space available + Доступно %n ГБ вільного просторуДоступно %n ГБ вільного просторуДоступно %n ГБ вільного простору - - (of %1GB needed) - (з %1Gb, що потрібно) + + (of %n GB needed) + (в той час, як необхідно %n ГБ)(в той час, як необхідно %n ГБ)(в той час, як необхідно %n ГБ) @@ -767,11 +927,23 @@ Address: %4 Open URI Відкрити URI + + Open payment request from URI or file + Відкрити запит платежу з URI або файлу + URI: URI: - + + Select payment request file + Виберіть файл запиту платежу + + + Select payment request file to open + Виберіть файл запиту платежу для відкриття + + OptionsDialog @@ -798,6 +970,50 @@ Address: %4 &Start Bitcoin on system login &Запускати гаманець при вході в систему + + Size of &database cache + Розмір &кешу бази даних + + + MB + МБ + + + Number of script &verification threads + Кількість потоків сценарію перевірки + + + Accept connections from outside + Приймати підключення ззовні + + + Allow incoming connections + Дозволити вхідні з’єднання + + + Connect to the Bitcoin network through a SOCKS proxy. + Підключатись до мережі Bitcoin через SOCKS-проксі. + + + &Connect through SOCKS proxy (default proxy): + &Підключатись через SOCKS-проксі (типовий проксі): + + + IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + IP-адреса проксі-сервера (наприклад IPv4: 127.0.0.1 / IPv6: ::1) + + + Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |. + Сторонні URL (наприклад, block explorer), що з'являться на вкладці транзакцій у вигляді пункту контекстного меню. %s в URL буде замінено на хеш транзакції. Для відокремлення URLів використовуйте вертикальну риску |. + + + Third party transaction URLs + Сторонні URL транзакцій + + + Active command-line options that override above options: + Активовані параметри командного рядка, що перекривають вищевказані параметри: + Reset all client options to default. Скинути всі параметри клієнта на типові. @@ -810,6 +1026,30 @@ Address: %4 &Network &Мережа + + (0 = auto, <0 = leave that many cores free) + (0 = автоматично, <0 = вказує кількість вільних ядер) + + + W&allet + Г&аманець + + + Expert + Експерт + + + Enable coin &control features + Ввімкнути &керування входами + + + 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. + Якщо вимкнути витрату непідтвердженої решти, то решту від транзакції не можна буде використати, допоки ця транзакція не матиме хоча б одне підтвердження. Це також впливає на розрахунок балансу. + + + &Spend unconfirmed change + &Витрачати непідтверджену решту + Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Автоматично відкривати порт для клієнту біткоін на роутері. Працює лише якщо ваш роутер підтримує UPnP і ця функція увімкнена. @@ -856,7 +1096,7 @@ Address: %4 User Interface &language: - Мова інтерфейсу користувача: + Мов&а інтерфейсу користувача: The user interface language can be set here. This setting will take effect after restarting Bitcoin. @@ -870,6 +1110,10 @@ Address: %4 Choose the default subdivision unit to show in the interface and when sending coins. Виберіть одиницю вимірювання монет, яка буде відображатись в гаманці та при відправленні. + + Whether to show coin control features or not. + Показати або сховати керування входами. + &OK &Гаразд @@ -882,10 +1126,26 @@ Address: %4 default типово + + none + відсутні + Confirm options reset Підтвердження скидання параметрів + + Client restart required to activate changes. + Для застосування змін необхідно перезапустити клієнта. + + + Client will be shutdown, do you want to proceed? + Клієнт вимкнеться, продовжувати? + + + This change would require a client restart. + Ця зміна вступить в силу після перезапуску клієнта + The supplied proxy address is invalid. Невірно вказано адресу проксі. @@ -902,36 +1162,68 @@ Address: %4 Показана інформація вже може бути застарілою. Ваш гаманець буде автоматично синхронізовано з мережею Bitcoin після встановлення підключення, але цей процес ще не завершено. - Wallet - Гаманець + Watch-only: + Тільки спостереження: + + + Available: + Наявно: Your current spendable balance - Ваш поточний баланс расходуемого + Ваш поточний підтверджений баланс + + + Pending: + Очікується: Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance - Всього угод, які ще мають бути підтверджені, і до цих пір не враховуються в расходуемого балансу + Сума монет у непідтверджених транзакціях Immature: - незрілі: + Незрілі: Mined balance that has not yet matured - Замінований баланс, який ще не дозрів + Баланс видобутих та ще недозрілих монет + + + Balances + Баланси Total: - всього: + Всього: Your current total balance - Ваше поточне Сукупний баланс + Ваш поточний сукупний баланс - <b>Recent transactions</b> - <b>Недавні транзакції</b> + Your current balance in watch-only addresses + Ваш поточний баланс в адресах для спостереження + + + Spendable: + Доступно: + + + Recent transactions + Недавні транзакції + + + Unconfirmed transactions to watch-only addresses + Непідтверджені транзакції на адреси для спостереження + + + Mined balance in watch-only addresses that has not yet matured + Баланс видобутих та ще недозрілих монет на адресах для спостереження + + + Current total balance in watch-only addresses + Поточний сукупний баланс в адресах для спостереження out of sync @@ -944,16 +1236,108 @@ Address: %4 URI handling Обробка URI - + + Invalid payment address %1 + Помилка в адресі платежу %1 + + + Payment request rejected + Запит платежу відхилено + + + Payment request network doesn't match client network. + Мережа запиту платежу не є мережею клієнта. + + + Payment request has expired. + Запит платежу прострочено. + + + Payment request is not initialized. + Запит платежу не ініціалізовано. + + + Requested payment amount of %1 is too small (considered dust). + Сума запиту платежу для %1 занадто мала (вважається пилом) + + + Payment request error + Помилка запиту платежу + + + Cannot start bitcoin: click-to-pay handler + Неможливо запустити bitcoin: обробник click-to-pay + + + Payment request fetch URL is invalid: %1 + URL запиту платежу є некоректним: %1 + + + URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. + Неможливо обробити URI! Це може бути викликано неправильною Bitcoin-адресою, чи невірними параметрами URI. + + + Payment request file handling + Обробка файлу запиту платежу + + + Payment request file cannot be read! This can be caused by an invalid payment request file. + Неможливо прочитати файл запиту платежу! Ймовірно, файл пошкоджено. + + + Unverified payment requests to custom payment scripts are unsupported. + Неперевірені запити платежів з власними платіжними сценаріями не підтримуються. + + + Refund from %1 + Відшкодування з %1 + + + Error communicating with %1: %2 + Помилка зв'язку з %1: %2 + + + Payment request cannot be parsed! + Неможливо розпізнати запит платежу! + + + Bad response from server %1 + Погана відповідь від сервера %1 + + + Payment acknowledged + Платіж підтверджено + + + Network request error + Помилка мережевого запиту + + PeerTableModel - + + User Agent + Клієнт користувача + + + Address/Hostname + Адреса/Ім'я хоста + + + Ping Time + Затримка + + QObject Amount Кількість + + Enter a Bitcoin address (e.g. %1) + Введіть адресу Bitcoin (наприклад %1) + %1 d %1 д @@ -970,6 +1354,18 @@ Address: %4 %1 s %1 с + + NETWORK + МЕРЕЖА + + + UNKNOWN + НЕВІДОМО + + + None + Відсутні + N/A Н/Д @@ -993,7 +1389,11 @@ Address: %4 Save QR Code Зберегти QR-код - + + PNG Image (*.png) + Зображення PNG (*.png) + + RPCConsole @@ -1016,10 +1416,18 @@ Address: %4 Debug window Вікно зневадження + + General + Загальна + Using OpenSSL version Використовується OpenSSL версії + + Using BerkeleyDB version + Використовується BerkeleyDB версії + Startup time Час запуску @@ -1052,10 +1460,66 @@ Address: %4 Sent Відправлено + + &Peers + &Учасники + + + Select a peer to view detailed information. + Виберіть учасника для перегляду детальнішої інформації + + + Direction + Напрямок + Version Версія + + User Agent + Клієнт користувача + + + Services + Сервіси + + + Starting Height + Початкова висота + + + Sync Height + Висота синхронізації + + + Ban Score + Очки бану + + + Connection Time + Час з'єднання + + + Last Send + Востаннє відправлено + + + Last Receive + Востаннє отримано + + + Bytes Sent + Байтів відправлено + + + Bytes Received + Байтів отримано + + + Ping Time + Затримка + Last block time Час останнього блоку @@ -1068,9 +1532,25 @@ Address: %4 &Console Консоль + + &Network Traffic + &Мережевий трафік + + + &Clear + &Очистити + Totals - всього: + Всього + + + In: + Вхідних: + + + Out: + Вихідних: Build date @@ -1082,7 +1562,7 @@ Address: %4 Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. - Відкрийте налагодження файл журналу Bitcoin з поточного каталогу даних. Це може зайняти кілька секунд для великих файлів журналів. + Відкрийте файл журналу налагодження Bitcoin з поточного каталогу даних. Це може зайняти кілька секунд для великих файлів журналів. Clear console @@ -1100,19 +1580,47 @@ Address: %4 Type <b>help</b> for an overview of available commands. Наберіть <b>help</b> для перегляду доступних команд. + + %1 B + %1 Б + + + %1 KB + %1 КБ + + + %1 MB + %1 МБ + + + %1 GB + %1 ГБ + + + via %1 + через %1 + + + never + ніколи + Inbound Вхідний - Yes - Так + Outbound + Вихідний - No - Ні + Unknown + Невідома - + + Fetching... + Отримання... + + ReceiveCoinsDialog @@ -1127,6 +1635,30 @@ Address: %4 &Message: &Повідомлення: + + Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. + Повторно використати одну з адрес. Повторне використання адрес створює ризики безпеки та конфіденційності. Не використовуйте її, окрім як для створення повторного запиту платежу. + + + R&euse an existing receiving address (not recommended) + По&вторно використати адресу для отримання (не рекомендується) + + + An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network. + Необов'язкове повідомлення на додаток до запиту платежу, котре буде показане під час відкриття запиту. Примітка: Це повідомлення не буде відправлено з платежем через мережу Bitcoin. + + + An optional label to associate with the new receiving address. + Необов'язкове поле для мітки нової адреси отримувача. + + + Use this form to request payments. All fields are <b>optional</b>. + Використовуйте цю форму, щоб отримати платежі. Всі поля є <b>необов'язковими</b>. + + + An optional amount to request. Leave this empty or zero to not request a specific amount. + Необов'язкове поле для суми запиту. Залиште це поле пустим або впишіть нуль, щоб не надсилати у запиті конкретної суми. + Clear all fields of the form. Очистити всі поля в формі @@ -1135,6 +1667,30 @@ Address: %4 Clear Очистити + + Requested payments history + Історія запитів платежу + + + &Request payment + Н&адіслати запит платежу + + + Show the selected request (does the same as double clicking an entry) + Показати вибраний запит (робить те ж саме, що й подвійний клік по запису) + + + Show + Показати + + + Remove the selected entries from the list + Вилучити вибрані записи зі списку + + + Remove + Вилучити + Copy label Скопіювати мітку @@ -1166,6 +1722,14 @@ Address: %4 &Save Image... &Зберегти зображення... + + Request payment to %1 + Запит платежу на %1 + + + Payment information + Інформація про платіж + URI URI @@ -1217,20 +1781,48 @@ Address: %4 (no label) (немає назви) - + + (no message) + (без повідомлення) + + + (no amount) + (без суми) + + SendCoinsDialog Send Coins Відправити + + Coin Control Features + Керування монетами + + + Inputs... + Входи... + + + automatically selected + вибираються автоматично + + + Insufficient funds! + Недостатньо коштів! + Quantity: Кількість: + + Bytes: + Байтів: + Amount: - Кількість: + Сума: Priority: @@ -1248,6 +1840,14 @@ Address: %4 Change: Решта: + + If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. + Якщо це поле активовано, але адреса для решти відсутня або некоректна, то решта буде відправлена на новостворену адресу. + + + Custom change address + Вказати адресу для решти + Send to multiple recipients at once Відправити на декілька адрес @@ -1260,6 +1860,10 @@ Address: %4 Clear all fields of the form. Очистити всі поля в формі + + Dust: + Пил: + Clear &All Очистити &все @@ -1280,6 +1884,10 @@ Address: %4 Confirm send coins Підтвердіть відправлення + + %1 to %2 + %1 на %2 + Copy quantity Копіювати кількість @@ -1308,13 +1916,21 @@ Address: %4 Copy change Копіювати решту + + Total Amount %1 (= %2) + Всього %1 (= %2) + + + or + або + The recipient address is not valid, please recheck. Адреса отримувача невірна, будь ласка перепровірте. The amount to pay must be larger than 0. - Кількість монет для відправлення повинна бути більшою 0. + Кількість монет для відправлення повинна бути більше 0. The amount exceeds your balance. @@ -1328,15 +1944,39 @@ Address: %4 Duplicate address found, can only send to each address once per send operation. Знайдено адресу що дублюється. Відправлення на кожну адресу дозволяється лише один раз на кожну операцію переказу. + + Transaction creation failed! + Не вдалося створити транзакцію! + + + The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. + Транзакцію відхилено! Це може статись, якщо декілька монет з вашого гаманця вже використані, наприклад, якщо ви використовуєте одну копію гаманця (wallet.dat), а монети були використані з іншої копії, але не позначені як використані в цій. + + + Warning: Invalid Bitcoin address + Увага: Неправильна Bitcoin-адреса + (no label) (немає назви) + + Warning: Unknown change address + Увага: Невідома адреса для решти + + + Copy dust + Копіювати пил + Are you sure you want to send? Ви впевнені, що хочете відправити? - + + added as transaction fee + додано як комісія за транзакцію + + SendCoinsEntry @@ -1359,6 +1999,14 @@ Address: %4 Choose previously used address Обрати ранiш використовувану адресу + + This is a normal payment. + Це звичайний платіж. + + + The Bitcoin address to send the payment to + Адреса Bitcoin для відправлення платежу + Alt+A Alt+A @@ -1371,10 +2019,34 @@ Address: %4 Alt+P Alt+P + + Remove this entry + Видалити цей запис + Message: Повідомлення: + + This is a verified payment request. + Це перевірений запит платежу. + + + Enter a label for this address to add it to the list of used addresses + Введіть мітку для цієї адреси для додавання її в список використаних адрес + + + A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. + Повідомлення, що було додане до bitcoin:URI та буде збережено разом з транзакцією для довідки. Примітка: Це повідомлення не буде відправлено в мережу Bitcoin. + + + This is an unverified payment request. + Це неперевірений запит платежу. + + + Pay To: + Отримувач: + Memo: Нотатка: @@ -1382,7 +2054,15 @@ Address: %4 ShutdownWindow - + + Bitcoin Core is shutting down... + Bitcoin Core вимикається... + + + Do not shut down the computer until this window disappears. + Не вимикайте комп’ютер до зникнення цього вікна. + + SignVerifyMessageDialog @@ -1395,7 +2075,11 @@ Address: %4 You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to. - Ви можете зареєструватися повідомленнями зі своїми адресами, щоб довести, що ви є їх власником. Будьте обережні, щоб не підписувати що-небудь неясне, як фішинг-атак може спробувати обдурити вас в підписанні вашу особистість до них. Тільки підписати повністю докладні свідчення, користувач зобов'язується. + Ви можете підписувати повідомлення зі своїми адресами, щоб довести, що ви є їх власником. Остерігайтеся підписувати будь-що незрозуміле, так як за допомогою фішинг-атаки вас можуть спробувати обдурити для отримання вашого підпису під чужими словами. Підписуйте тільки ті повідомлення, з якими ви повністю згодні. + + + The Bitcoin address to sign the message with + Адреса Bitcoin для підпису цього повідомлення Choose previously used address @@ -1447,7 +2131,11 @@ Address: %4 Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. - Введіть адресу підписання, повідомлення (забезпечення копіюванні розриви рядків, прогалини, вкладки і т.д. точно) і підпис нижче, щоб перевірити повідомлення. Будьте обережні, щоб не читати далі в підпис, ніж те, що в підписаному самого повідомлення, щоб уникнути обдурять нападу чоловік-в-середній. + Введіть нижче адресу підпису, повідомлення (впевніться, що ви точно скопіювали символи завершення рядку, табуляцію, пробіли тощо) та підпис для перевірки повідомлення. Впевніться, що в підпис не було додано зайвих символів: це допоможе уникнути атак типу «людина посередині». + + + The Bitcoin address the message was signed with + Адреса Bitcoin, якою було підписано це повідомлення Verify the message to ensure it was signed with the specified Bitcoin address @@ -1475,11 +2163,11 @@ Address: %4 The entered address does not refer to a key. - Введений адреса не відноситься до ключа. + Введена адреса не відноситься до ключа. Wallet unlock was cancelled. - Розблокування Гаманець був скасований. + Розблокування гаманця було скасоване. Private key for the entered address is not available. @@ -1503,7 +2191,7 @@ Address: %4 The signature did not match the message digest. - Підпис не відповідає дайджест повідомлення. + Підпис не збігається з хешем повідомлення. Message verification failed. @@ -1518,7 +2206,11 @@ Address: %4 SplashScreen Bitcoin Core - Bitcoin Ядро + Bitcoin Core + + + The Bitcoin Core developers + Розробники Bitcoin Core [testnet] @@ -1536,7 +2228,11 @@ Address: %4 TransactionDesc Open until %1 - Відкрити до %1 + Відкрито до %1 + + + conflicted + суперечить %1/offline @@ -1554,6 +2250,10 @@ Address: %4 Status Статус + + , broadcast through %n node(s) + , розіслано через %n вузол, розіслано через %n вузли, розіслано через %n вузлів + Date Дата @@ -1578,6 +2278,10 @@ Address: %4 own address Власна адреса + + watch-only + тільки спостереження + label Мітка @@ -1586,6 +2290,10 @@ Address: %4 Credit Кредит + + matures in %n more block(s) + «дозріє» через %n блок«дозріє» через %n блоки«дозріє» через %n блоків + not accepted не прийнято @@ -1594,6 +2302,14 @@ Address: %4 Debit Дебет + + Total debit + Загальний дебет + + + Total credit + Загальний кредит + Transaction fee Комісія за транзакцію @@ -1614,9 +2330,17 @@ Address: %4 Transaction ID ID транзакції + + Merchant + Продавець + + + Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. + Після генерації монет, потрібно зачекати %1 блоків, перш ніж їх можна буде використати. Коли ви згенерували цей блок, його було відправлено в мережу для того, щоб він був доданий до ланцюжка блоків. Якщо ця процедура не вдасться, статус буде змінено на «не підтверджено» і ви не зможете витратити згенеровані монети. Таке може статись, якщо хтось інший згенерував блок на декілька секунд раніше. + Debug information - Отладочна інформація + Налагоджувальна інформація Transaction @@ -1642,6 +2366,10 @@ Address: %4 , has not been successfully broadcast yet , ще не було успішно розіслано + + Open for %n more block(s) + Відкрито на %n блокВідкрито на %n блокиВідкрито на %n блоків + unknown невідомо @@ -1672,9 +2400,17 @@ Address: %4 Address Адреса + + Immature (%1 confirmations, will be available after %2) + Незрілі (%1 підтверджень, будуть доступні після %2) + + + Open for %n more block(s) + Відкрито на %n блокВідкрито на %n блокиВідкрито на %n блоків + Open until %1 - Відкрити до %1 + Відкрито до %1 Confirmed (%1 confirmations) @@ -1688,6 +2424,22 @@ Address: %4 Generated but not accepted Згенеровано, але не підтверджено + + Offline + Поза мережею + + + Unconfirmed + Не підтверджено + + + Confirming (%1 of %2 recommended confirmations) + Підтверджується (%1 з %2 рекомендованих підтверджень) + + + Conflicted + Суперечить + Received with Отримані на @@ -1708,6 +2460,10 @@ Address: %4 Mined Добуті + + watch-only + тільки спостереження + (n/a) (недоступно) @@ -1724,6 +2480,10 @@ Address: %4 Type of transaction. Тип транзакції. + + Whether or not a watch-only address is involved in this transaction. + Показує, чи було залучено адресу для спостереження в цій транзакції. + Destination address of transaction. Адреса отримувача транзакції. @@ -1815,6 +2575,30 @@ Address: %4 Show transaction details Показати деталі транзакції + + Export Transaction History + Експортувати історію транзакцій + + + Watch-only + Для спостереження + + + Exporting Failed + Помилка експорту + + + There was an error trying to save the transaction history to %1. + Виникла помилка при спробі зберігання історії транзакцій до %1. + + + Exporting Successful + Експорт успішно виконано + + + The transaction history was successfully saved to %1. + Історію транзакцій було успішно збережено до %1. + Comma separated file (*.csv) Файли, розділені комою (*.csv) @@ -1854,10 +2638,18 @@ Address: %4 UnitDisplayStatusBarControl - + + Unit to show amounts in. Click to select another unit. + Одиниця виміру монет. Натисніть для вибору іншої. + + WalletFrame - + + No wallet has been loaded. + Гаманець не завантажувався + + WalletModel @@ -1869,7 +2661,7 @@ Address: %4 WalletView &Export - & Експорт + &Експорт Export the data in the current tab to a file @@ -1887,6 +2679,14 @@ Address: %4 Backup Failed Помилка резервного копіювання + + There was an error trying to save the wallet data to %1. + Виникла помилка при спробі зберегти гаманець в %1. + + + The wallet data was successfully saved to %1. + Дані гаманця успішно збережено в %1. + Backup Successful Успішне створення резервної копії @@ -1898,26 +2698,10 @@ Address: %4 Options: Параметри: - - Specify configuration file (default: bitcoin.conf) - Вкажіть файл конфігурації (типово: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - Вкажіть pid-файл (типово: bitcoind.pid) - Specify data directory Вкажіть робочий каталог - - Listen for connections on <port> (default: 8333 or testnet: 18333) - Чекати на з'єднання на <port> (типово: 8333 або тестова мережа: 18333) - - - Maintain at most <n> connections to peers (default: 125) - Підтримувати не більше <n> зв'язків з колегами (типово: 125) - Connect to a node to retrieve peer addresses, and disconnect Підключитись до вузла, щоб отримати список адрес інших учасників та від'єднатись @@ -1926,18 +2710,6 @@ Address: %4 Specify your own public address Вкажіть вашу власну публічну адресу - - Threshold for disconnecting misbehaving peers (default: 100) - Поріг відключення неправильно під'єднаних пірів (типово: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - Максимальній розмір вхідного буферу на одне з'єднання (типово: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - Прослуховувати <port> для JSON-RPC-з'єднань (типово: 8332 або тестова мережа: 18332) - Accept command line and JSON-RPC commands Приймати команди із командного рядка та команди JSON-RPC @@ -1952,24 +2724,84 @@ Address: %4 Accept connections from outside (default: 1 if no -proxy or -connect) - Приймати з'єднання ззовні (за замовчуванням: 1, якщо ні-проксі або-з'єднання) + Приймати підключення ззовні (типово: 1 за відсутності -proxy чи -connect) + + + %s, you must set a rpcpassword in the configuration file: +%s +It is recommended you use the following random password: +rpcuser=bitcoinrpc +rpcpassword=%s +(you do not need to remember this password) +The username and password MUST NOT be the same. +If the file does not exist, create it with owner-readable-only file permissions. +It is also recommended to set alertnotify so you are notified of problems; +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com + + %s, ви повинні встановити rpcpassword в файлі конфігурації: +%s +Рекомендується використати такий випадковий пароль: +rpcuser=bitcoinrpc +rpcpassword=%s +(ви не повинні пам'ятати цей пароль) +Ім’я користувача та пароль ПОВИННІ бути різними. +Якщо файлу не існує, створіть його, обмеживши доступ правом читання для власника. +Також рекомендується використовувати alertnotify для того, щоб отримувати сповіщення про проблеми; +наприклад: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com + Bind to given address and always listen on it. Use [host]:port notation for IPv6 - Прив'язка до даного адресою і завжди слухати на ньому. Використовуйте [господаря]: позначення порту для IPv6 + Прив'язатися до даної адреси та прослуховувати її. Використовуйте запис виду [хост]:порт для IPv6 + + + Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup + Видалити всі транзакції гаманця та відновити ті, що будуть знайдені під час запуску за допомогою -rescan + + + Enter regression test mode, which uses a special chain in which blocks can be solved instantly. + Ввійти в режим регресивного тестування, що використовує спеціальний ланцюг з миттєвим знаходженням блоків. Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Помилка: транзакцію було відхилено. Це може статись, якщо декілька монет з вашого гаманця вже використані, наприклад, якщо ви використовуєте одну копію гаманця (wallet.dat), а монети були використані з іншої копії, але не позначені як використані в цій. + + Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds! + Помилка: Ця транзакція потребує додавання комісії щонайменше в %s через її розмір, складність, або внаслідок використання недавно отриманих коштів! + + + Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) + Виконати команду, коли транзакція гаманця зміниться (замість %s в команді буде підставлено ідентифікатор транзакції) + + + In this mode -genproclimit controls how many blocks are generated immediately. + В цьому режимі -genproclimit встановлює кількість блоків, що можуть бути згенеровані негайно. + + + Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) + Встановити кількість потоків скрипту перевірки (від %u до %d, 0 = автоматично, <0 = вказує кількість вільних ядер, типово: %d) + This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - Це тест збірки попередньою версією - використовуйте на свій страх і ризик - не використовувати для гірничодобувних або торгових додатків + Це тестова збірка пре-релізної версії - використовуйте на свій страх і ризик - не застосовувати для добування монет або торгівлі + + + Unable to bind to %s on this computer. Bitcoin Core is probably already running. + Неможливо прив'язатися до %s на цьому комп'ютері. Можливо, Bitcoin Core вже запущено. Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. Увага: встановлено занадто велику комісію (-paytxfee). Комісія зніматиметься кожен раз коли ви проводитимете транзакції. + + Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. + Увага: Частина мережі використовує інший головний ланцюжок! Деякі добувачі, можливо, зазнають проблем. + + + Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. + Увага: Наш ланцюжок блоків відрізняється від ланцюжків підключених учасників! Можливо, вам, або іншим вузлам, необхідно оновитися. + Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. Увага: помилка читання wallet.dat! Всі ключі прочитано коректно, але дані транзакцій чи записи адресної книги можуть бути пропущені, або пошкоджені. @@ -1978,6 +2810,18 @@ Address: %4 Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. Увага: файл wallet.dat пошкоджено, дані врятовано! Оригінальний wallet.dat збережено як wallet.{timestamp}.bak до %s; якщо Ваш баланс чи транзакції неправильні, Ви можете відновити їх з резервної копії. + + Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times. + Додати учасників, що під'єднуються з заданої підмережі чи IP-адреси, в білий список. Можна вказувати декілька разів. + + + (default: 1) + (типово: 1) + + + <category> can be: + <category> може бути: + Attempt to recover private keys from a corrupt wallet.dat Спроба відновити закриті ключі з пошкодженого wallet.dat @@ -1990,22 +2834,38 @@ Address: %4 Connect only to the specified node(s) Підключитись лише до вказаного вузла + + Connection options: + Параметри з'єднання: + Corrupted block database detected Виявлено пошкоджений блок бази даних + + Debugging/Testing options: + Параметри тестування/налагодження: + Discover own IP address (default: 1 when listening and no -externalip) - Відкрийте власну IP-адресу (за замовчуванням: 1, коли не чує і-externalip) + Визначити власну IP-адресу (типово: 1 при прослуховуванні та за відсутності -externalip) + + + Do not load the wallet and disable wallet RPC calls + Не завантажувати гаманець та вимкнути звернення до нього через RPC Do you want to rebuild the block database now? - Ви хочете перебудувати базу даних блоку зараз? + Ви хочете перебудувати базу даних блоків зараз? Error initializing block database Помилка ініціалізації бази даних блоків + + Error initializing wallet database environment %s! + Помилка ініціалізації середовища бази даних гаманця %s! + Error loading block database Помилка завантаження бази даних блоків @@ -2014,6 +2874,10 @@ Address: %4 Error opening block database Помилка відкриття блоку бази даних + + Error: A fatal internal error occured, see debug.log for details + Помилка: Сталася фатальна помилка (детальніший опис наведено в debug.log) + Error: Disk space is low! Помилка: Мало вільного місця на диску! @@ -2022,69 +2886,57 @@ Address: %4 Error: Wallet locked, unable to create transaction! Помилка: Гаманець заблокований, неможливо створити транзакцію! - - Error: system error: - Помилка: системна помилка: - Failed to listen on any port. Use -listen=0 if you want this. - Не вдалося слухати на будь-якому порту. Використовуйте-слухати = 0, якщо ви хочете цього. + Не вдалося слухати на жодному порту. Використовуйте -listen=0, якщо ви хочете цього. - Failed to read block info - Не вдалося розпізнати блок інформації + If <category> is not supplied, output all debugging information. + Якщо <category> не задано, виводить всю налагоджувальну інформацію. - Failed to read block - Не вдалося розпізнати блок + Importing... + Імпорт... - Failed to sync block index - Не вдалося синхронізувати індекс блоку + Incorrect or no genesis block found. Wrong datadir for network? + Початковий блок некоректний/відсутній. Чи правильно вказано каталог даних для обраної мережі? - Failed to write block index - Не вдалося записати індекс блоку - - - Failed to write block info - Не вдалося записати інформацію індекса - - - Failed to write block - Не вдалося записати блок - - - Failed to write file info - Не вдалося записати інформацію файла - - - Failed to write to coin database - Не вдалося записати до бази даних монет - - - Failed to write transaction index - Не вдалося записати індекс транзакції - - - Failed to write undo data - Не вдалося записати скасувати дані - - - Generate coins (default: 0) - Генерація монети (за замовчуванням: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - Скільки блоків перевіряти під час запуску (типово: 288, 0 = всі) + Invalid -onion address: '%s' + Помилка в адресі -onion: «%s» Not enough file descriptors available. - Бракує дескрипторів файлів, доступних. + Бракує доступних дескрипторів файлів. - Set the number of threads to service RPC calls (default: 4) - Встановити число потоків до дзвінків служба RPC (за замовчуванням: 4) + Only connect to nodes in network <net> (ipv4, ipv6 or onion) + Підключити тільки до вузлів в мережі <net> (ipv4, ipv6 або onion) + + + Rebuild block chain index from current blk000??.dat files + Перебудувати індекс ланцюжка блоків з поточних файлів blk000??.dat + + + Set database cache size in megabytes (%d to %d, default: %d) + Встановити розмір кешу бази даних в мегабайтах (від %d до %d, типово: %d) + + + Set maximum block size in bytes (default: %d) + Встановити максимальний розмір блоку у байтах (типово: %d) + + + Specify wallet file (within data directory) + Вкажіть файл гаманця (в межах каталогу даних) + + + This is intended for regression testing tools and app development. + Це призначено для інструментів регресивного тестування та розробки додатків. + + + Use UPnP to map the listening port (default: %u) + Намагатись використовувати UPnP для відображення порту, що прослуховується, на роутері (типово: %u) Verifying blocks... @@ -2094,82 +2946,230 @@ Address: %4 Verifying wallet... Перевірка гаманця... + + Wallet %s resides outside data directory %s + Гаманець %s знаходиться поза каталогом даних %s + + + Wallet options: + Параметри гаманця: + + + You need to rebuild the database using -reindex to change -txindex + Вам необхідно перебудувати базу даних з використанням -reindex для того, щоб змінити -txindex + Imports blocks from external blk000??.dat file Імпорт блоків з зовнішнього файлу blk000??.dat + + Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times + Дозволити підключення по протоколу JSON-RPC зі вказаного джерела. Правильною для <ip> є окрема IP-адреса (наприклад, 1.2.3.4), IP-адреса та маска підмережі (наприклад, 1.2.3.4/255.255.255.0) або CIDR-адреса (наприклад, 1.2.3.4/24). Цей параметр можна вказувати декілька разів. + + + An error occurred while setting up the RPC address %s port %u for listening: %s + Сталася помилка при спробі відкрити порт RPC-адреси %s:%u для прослуховування: %s + + + Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6 + Прив'язатися до даної адреси та вносити до білого списку учасників, що під'єднуються до неї. Використовуйте запис виду [хост]:порт для IPv6 + + + Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces) + Прив'язатися до даної адреси для прослуховування JSON-RPC підключень. Використовуйте запис виду [хост]:порт для IPv6. Цей параметр можна вказувати декілька разів (типово: прив'язуватися до всіх інтерфейсів) + + + Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. + Не вдалося встановити блокування на каталог даних %s. Bitcoin Core, ймовірно, вже запущений. + + + Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:%u) + Обмежити швидкість передачі безкоштовних транзакцій до <n>*1000 байтів за хвилину (типово: %u) + + + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) + Створювати нові файли з типовими для системи атрибутами доступу замість маски 077 (діє тільки при вимкненому гаманці) + + + Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + Поширюється за ліцензією MIT/X11, додаткова інформація міститься у файлі COPYING, а також за адресою <http://www.opensource.org/licenses/mit-license.php>. + + + Error: Listening for incoming connections failed (listen returned error %s) + Помилка: Не вдалося налаштувати прослуховування вхідних підключень (listen повернув помилку: %s) + + + Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + Помилка: Параметр -socks не підтримується. Можливість вказувати версію SOCKS було видалено, так як підтримується лише SOCKS5. + + + Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) + Виконати команду при надходженні важливого попереджувального повідомлення або при спостереженні тривалого розгалуження ланцюжка (замість %s буде підставлено повідомлення) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) + Комісії (в BTC/КБ), що менші за вказану, вважатимуться нульовими (для ретрансляції) (типово: %s) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) + Комісії (в BTC/КБ), що менші за вказану, вважатимуться нульовими (для створення транзакції) (типово: %s) + + + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) + Дізнаватися адреси учасників через DNS при замалій кількості відомих адрес (типово: 1 за відсутності -connect) + + + Set maximum size of high-priority/low-fee transactions in bytes (default: %d) + Встановити максимальний розмір транзакцій з високим пріоритетом та низькою комісією (в байтах) (типово: %d) + + + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. + Цей продукт включає в себе програмне забезпечення, розроблене в рамках проекту OpenSSL <https://www.openssl.org/>, криптографічне програмне забезпечення, написане Еріком Янгом, та функції для роботи з UPnP, написані Томасом Бернардом. + + + Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + Увага: будь ласка, перевірте дату і час на своєму комп'ютері! Якщо ваш годинник йде неправильно, Bitcoin Core може працювати некоректно. + + + Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway + Учасники, що знаходяться в білому списку, не можуть бути заблоковані за DoS та їхні транзакції завжди ретранслюватимуться (навіть якщо вони є в пам'яті), що може бути корисним, наприклад, для шлюзу + + + Cannot resolve -whitebind address: '%s' + Не вдалося розпізнати адресу для -whitebind: «%s» + + + Connect through SOCKS5 proxy + Підключитись через SOCKS5-проксі + + + Copyright (C) 2009-%i The Bitcoin Core Developers + (C) 2009-%i Розробники Bitcoin Core + + + Could not parse -rpcbind value %s as network address + Неможливо розпізнати мережеву адресу для параметру -rpcbind (%s) + + + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core + Помилка при завантаженні wallet.dat: Гаманець потребує новішої версії Bitcoin Core + + + Error: Unsupported argument -tor found, use -onion. + Помилка: Параметр -tor не підтримується, використовуйте -onion + + + Fee (in BTC/kB) to add to transactions you send (default: %s) + Комісія (в BTC/КБ), що додаватиметься до вихідних транзакцій (типово: %s) + Information Інформація - Maintain a full transaction index (default: 0) - Підтримувати індекс повний транзакцій (за замовчуванням: 0) + Initialization sanity check failed. Bitcoin Core is shutting down. + Не вдалося пройти базові перевірки під час ініціалізації. Bitcoin Core буде вимкнено. - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - Максимальний буфер, <n>*1000 байт (типово: 5000) + Invalid amount for -minrelaytxfee=<amount>: '%s' + Вказано некоректну суму для параметру -minrelaytxfee: '%s' - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - Максимальній розмір вихідного буферу на одне з'єднання, <n>*1000 байт (типово: 1000) + Invalid amount for -mintxfee=<amount>: '%s' + Вказано некоректну суму для параметру -mintxfee: '%s' - Only accept block chain matching built-in checkpoints (default: 1) - Тільки приймати блок відповідності ланцюга вбудованих контрольно-пропускних пунктів (за замовчуванням: 1) + Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) + Вказано некоректну суму для параметру -paytxfee: '%s' (повинно бути щонайменше %s) - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - Підключити тільки до вузлів в мережі <net> (IPv4, IPv6 або Tor) + Invalid netmask specified in -whitelist: '%s' + Вказано неправильну маску підмережі для -whitelist: «%s» + + + Keep at most <n> unconnectable blocks in memory (default: %u) + Утримувати в пам'яті щонайбільше <n> блоків, не під'єднаних до основного ланцюжка (типово: %u) + + + Keep at most <n> unconnectable transactions in memory (default: %u) + Утримувати в пам'яті щонайбільше <n> транзакцій, що споживають невідомі входи (типово: %u) + + + Need to specify a port with -whitebind: '%s' + Необхідно вказати порт для -whitebind: «%s» + + + Node relay options: + Параметри вузла ретрансляції: + + + Print block on startup, if found in block index + Роздрукувати блок під час запуску (якщо він буде знайдений в індексі) + + + RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) + Параметри RPC SSL: (див. Bitcoin Wiki для налаштування SSL) + + + RPC server options: + Параметри сервера RPC: + + + Randomly drop 1 of every <n> network messages + Випадковим чином відкидати 1 з <n> мережевих повідомлень + + + Randomly fuzz 1 of every <n> network messages + Випадковим чином пошкоджувати 1 з <n> мережевих повідомлень Send trace/debug info to console instead of debug.log file Відсилати налагоджувальну інформацію на консоль, а не у файл debug.log - Set minimum block size in bytes (default: 0) - Встановити мінімальний розмір блоку у байтах (типово: 0) + Show all debugging options (usage: --help -help-debug) + Показати всі налагоджувальні параметри (використання: --help -help-debug) Shrink debug.log file on client startup (default: 1 when no -debug) - Стискати файл debug.log під час старту клієнта (типово: 1 коли відсутутній параметр -debug) + Стискати файл debug.log під час старту клієнта (типово: 1 коли відсутній параметр -debug) Signing transaction failed - Підписання угоди не вдалося + Підписання транзакції не вдалося - Specify connection timeout in milliseconds (default: 5000) - Вказати тайм-аут підключення у мілісекундах (типово: 5000) - - - System error: - Системна помилка: + This is experimental software. + Це програмне забезпечення є експериментальним. Transaction amount too small - Сума угоди занадто малий + Сума транзакції занадто мала Transaction amounts must be positive - Суми угоди має бути позитивним + Суми монет у транзакції мають бути позитивними Transaction too large - Угода занадто великий + Транзакція занадто велика - Use UPnP to map the listening port (default: 0) - Намагатись використовувати UPnP для відображення порту, що прослуховується на роутері (default: 0) + Unable to bind to %s on this computer (bind returned error %s) + Неможливо прив'язатися до %s на цьому комп'ютері (bind повернув помилку: %s) Use UPnP to map the listening port (default: 1 when listening) - Намагатись використовувати UPnP для відображення порту, що прослуховується на роутері (default: 1 when listening) + Намагатись використовувати UPnP для відображення порту, що прослуховується на роутері (типово: 1 коли прослуховується) Username for JSON-RPC connections Ім'я користувача для JSON-RPC-з'єднань + + Wallet needed to be rewritten: restart Bitcoin Core to complete + Потрібно перезаписати гаманець: перезапустіть Bitcoin Core для завершення + Warning Попередження @@ -2178,6 +3178,22 @@ Address: %4 Warning: This version is obsolete, upgrade required! Увага: Поточна версія застаріла, необхідне оновлення! + + Warning: Unsupported argument -benchmark ignored, use -debug=bench. + Увага: Параметр -benchmark не підтримується та буде проігнорований, використовуйте -debug=bench. + + + Warning: Unsupported argument -debugnet ignored, use -debug=net. + Увага: Параметр -debugnet не підтримується та буде проігнорований, використовуйте -debug=net. + + + Zapping all transactions from wallet... + Видалення всіх транзакцій з гаманця... + + + on startup + під час запуску + wallet.dat corrupt, salvage failed wallet.dat пошкоджено, відновлення не вдалося @@ -2192,11 +3208,7 @@ Address: %4 Upgrade wallet to latest format - Модернізувати гаманець до останнього формату - - - Set key pool size to <n> (default: 100) - Встановити розмір пулу ключів <n> (типово: 100) + Модернізувати гаманець до найновішого формату Rescan the block chain for missing wallet transactions @@ -2206,14 +3218,6 @@ Address: %4 Use OpenSSL (https) for JSON-RPC connections Використовувати OpenSSL (https) для JSON-RPC-з'єднань - - Server certificate file (default: server.cert) - Файл сертифіката сервера (типово: server.cert) - - - Server private key (default: server.pem) - Закритий ключ сервера (типово: server.pem) - This help message Дана довідка @@ -2230,18 +3234,194 @@ Address: %4 Error loading wallet.dat: Wallet corrupted Помилка при завантаженні wallet.dat: Гаманець пошкоджено + + (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + (1 = утримувати метадані транзакцій (до яких відноситься інформація про власника рахунку та запити платежів), 2 - відкинути) + + + Flush database activity from memory pool to disk log every <n> megabytes (default: %u) + Записувати зміни в базі даних до файлу кожні <n> мегабайтів (типово: %u) + + + How thorough the block verification of -checkblocks is (0-4, default: %u) + Рівень ретельності перевірки блоків (0-4, типово: %u) + + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: %u) + Якщо параметр paytxfee не встановлено, включити комісію, достатню для підтвердження транзакцій протягом n блоків (типово: %u) + + + Log transaction priority and fee per kB when mining blocks (default: %u) + Записувати в лог-файл пріоритет транзакції та комісію за кБ під час добування блоків (типово: %u) + + + Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u) + Утримувати повний індекс транзакцій (використовується RPC-викликом getrawtransaction) (типово: %u) + + + Number of seconds to keep misbehaving peers from reconnecting (default: %u) + Час в секундах, протягом якого відключені учасники з поганою поведінкою не зможуть підключитися (типово: %u) + + + Output debugging information (default: %u, supplying <category> is optional) + Виводити налагоджувальну інформацію (типово: %u, вказання <category> необов'язкове) + + + Set the processor limit for when generation is on (-1 = unlimited, default: %d) + Встановити максимальну кількість процесорів, що будуть використовуватися при ввімкненій генерації (-1 = необмежено, типово: %d) + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) + Використовувати окремий SOCKS5-проксі для з'єднання з учасниками через приховані сервіси Tor (типово: %s) + + + (default: %s) + (типово: %s) + + + Acceptable ciphers (default: %s) + Допустимі шифри (типово: %s) + + + Always query for peer addresses via DNS lookup (default: %u) + Завжди дізнаватися адреси учасників через DNS (типово: %u) + + + Disable safemode, override a real safe mode event (default: %u) + Вимкнути безпечний режим та ігнорувати події, що здатні ввімкнути його (типово: %u) + Error loading wallet.dat Помилка при завантаженні wallet.dat + + Force safe mode (default: %u) + Ввімкнути безпечний режим (типово: %u) + + + Generate coins (default: %u) + Генерація монет (типово: %u) + + + How many blocks to check at startup (default: %u, 0 = all) + Скільки блоків перевіряти під час запуску (типово: %u, 0 = всі) + + + Include IP addresses in debug output (default: %u) + Включити IP-адреси до налагоджувального виводу (типово: %u) + Invalid -proxy address: '%s' Помилка в адресі проксі-сервера: «%s» + + Limit size of signature cache to <n> entries (default: %u) + Обмежити розмір кешу підписів до <n> записів (типово: %u) + + + Listen for JSON-RPC connections on <port> (default: %u or testnet: %u) + Прослуховувати <port> для JSON-RPC з'єднань (типово: %u, для тестової мережі: %u) + + + Listen for connections on <port> (default: %u or testnet: %u) + Чекати на з'єднання на <port> (типово: %u, для тестової мережі: %u) + + + Maintain at most <n> connections to peers (default: %u) + Підтримувати щонайбільше <n> з'єднань з учасниками (типово: %u) + + + Maximum per-connection receive buffer, <n>*1000 bytes (default: %u) + Максимальний розмір вхідного буферу на одне з'єднання, <n>*1000 байтів (типово: %u) + + + Maximum per-connection send buffer, <n>*1000 bytes (default: %u) + Максимальний розмір вихідного буферу на одне з'єднання, <n>*1000 байтів (типово: %u) + + + Only accept block chain matching built-in checkpoints (default: %u) + Приймати тільки той ланцюжок блоків, що не суперечить вбудованим контрольним точкам (типово: %u) + + + Prepend debug output with timestamp (default: %u) + Доповнювати налагоджувальний вивід відміткою часу (типово: %u) + + + Print block tree on startup (default: %u) + Роздрукувати дерево блоків під час запуску (типово: %u) + + + Relay and mine data carrier transactions (default: %u) + Ретранслювати та створювати транзакції носіїв даних (типово: %u) + + + Relay non-P2SH multisig (default: %u) + Ретранслювати не-P2SH транзакції з мультипідписом (типово: %u) + + + Run a thread to flush wallet periodically (default: %u) + Запустити потік для періодичного збереження даних гаманця (типово: %u) + + + Server certificate file (default: %s) + Файл сертифіката сервера (типово: %s) + + + Server private key (default: %s) + Закритий ключ сервера (типово: %s) + + + Set key pool size to <n> (default: %u) + Встановити розмір пулу ключів <n> (типово: %u) + + + Set minimum block size in bytes (default: %u) + Встановити мінімальний розмір блоку в байтах (типово: %u) + + + Set the number of threads to service RPC calls (default: %d) + Встановити число потоків для обслуговування викликів RPC (типово: %d) + + + Sets the DB_PRIVATE flag in the wallet db environment (default: %u) + Встановити прапорець DB_PRIVATE в середовищі бази даних гаманця (типово: %u) + + + Specify configuration file (default: %s) + Вказати файл конфігурації (типово: %s) + + + Specify connection timeout in milliseconds (minimum: 1, default: %d) + Вказати тайм-аут підключення в мілісекундах (щонайменше: 1, типово: %d) + + + Specify pid file (default: %s) + Вказати pid-файл (типово: %s) + + + Spend unconfirmed change when sending transactions (default: %u) + Витрачати непідтверджену решту при відправленні транзакцій (типово: %u) + + + Stop running after importing blocks from disk (default: %u) + Вимкнутися після імпорту блоків з диску (типово: %u) + + + Threshold for disconnecting misbehaving peers (default: %u) + Поріг відключення учасників з поганою поведінкою (типово: %u) + Unknown network specified in -onlynet: '%s' Невідома мережа вказана в -onlynet: «%s» + + Cannot resolve -bind address: '%s' + Не вдалося розпізнати адресу для -bind: «%s» + + + Cannot resolve -externalip address: '%s' + Не вдалося розпізнати адресу для -externalip: «%s» + Invalid amount for -paytxfee=<amount>: '%s' Помилка у величині комісії -paytxfee=<amount>: «%s» diff --git a/src/qt/locale/bitcoin_ur_PK.ts b/src/qt/locale/bitcoin_ur_PK.ts index ab9106ca03..5bf7ce4344 100644 --- a/src/qt/locale/bitcoin_ur_PK.ts +++ b/src/qt/locale/bitcoin_ur_PK.ts @@ -9,6 +9,34 @@ Create a new address نیا ایڈریس بنائیں + + &New + نیا + + + &Copy + نقل + + + C&lose + بند + + + &Copy Address + کاپی پتہ + + + &Export + برآمد + + + &Delete + مٹا + + + C&hoose + چننا + AddressTableModel @@ -291,6 +319,10 @@ WalletView + + &Export + برآمد + bitcoin-core diff --git a/src/qt/locale/bitcoin_uz@Cyrl.ts b/src/qt/locale/bitcoin_uz@Cyrl.ts index 1a4d9f8108..ab4439b419 100644 --- a/src/qt/locale/bitcoin_uz@Cyrl.ts +++ b/src/qt/locale/bitcoin_uz@Cyrl.ts @@ -93,7 +93,11 @@ Exporting Failed Экспорт қилиб бўлмади - + + There was an error trying to save the address list to %1. Please try again. + Манзил рўйхатини %1.га сақлашда хатолик юз берди. Яна уриниб кўринг. + + AddressTableModel @@ -167,6 +171,10 @@ Are you sure you wish to encrypt your wallet? Ҳамёнингизни кодлашни ростдан хоҳлайсизми? + + 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. + МУҲИМ: Сиз қилган олдинги ҳамён файли заҳиралари янги яратилган, кодланган ҳамён файли билан алмаштирилиши керак. Хавфсизлик сабабларига кўра олдинги кодланган ҳамён файли заҳираси янги кодланган ҳамёндан фойдаланишингиз билан яроқсиз ҳолга келади. + Warning: The Caps Lock key is on! Диққат: Caps Lock тугмаси ёқилган! @@ -207,9 +215,17 @@ Wallet decryption failed Ҳамённи коддан чиқариш амалга ошмади - + + Wallet passphrase was successfully changed. + Ҳамён пароли муваффақиятли алмаштирилди. + + BitcoinGUI + + Sign &message... + &Хабар ёзиш... + Synchronizing with network... Тармоқ билан синхронланмоқда... @@ -218,6 +234,10 @@ &Overview &Кўриб чиқиш + + Node + Улам + Show general overview of wallet Ҳамённинг умумий кўринишини кўрсатиш @@ -238,10 +258,30 @@ Quit application Иловадан чиқиш + + About &Qt + &Qt ҳақида + + + Show information about Qt + Qt ҳақидаги маълумотларни кўрсатиш + &Options... &Мосламалар... + + &Encrypt Wallet... + Ҳамённи &кодлаш... + + + &Backup Wallet... + Ҳамённи &заҳиралаш... + + + &Change Passphrase... + Махфий сўзни &ўзгартириш... + &Sending addresses... &Жўнатилувчи манзиллар... @@ -254,13 +294,89 @@ Open &URI... Интернет манзилни очиш + + Bitcoin Core client + Bitcoin асос мижози + + + Importing blocks from disk... + Дискдан блоклар импорт қилинмоқда... + + + Reindexing blocks on disk... + Дискдаги блоклар қайта индексланмоқда... + + + Send coins to a Bitcoin address + Тангаларни Bitcoin манзилига жўнатиш + + + Modify configuration options for Bitcoin + Bitcoin учун мослаш танловларини ўзгартириш + + + Backup wallet to another location + Ҳамённи бошқа манзилга заҳиралаш + Change the passphrase used for wallet encryption Паролни ўзгартириш ҳамённи кодлашда фойдаланилади + + &Debug window + &Носозликни ҳал қилиш ойнаси + + + Open debugging and diagnostic console + Носозликни ҳал қилиш ва ташхис терминали + + + &Verify message... + Хабарни &тасдиқлаш... + + + Bitcoin + Bitcoin + + + Wallet + Ҳамён + + + &Send + &Жўнатиш + + + &Receive + &Қабул қилиш + + + Show information about Bitcoin Core + Bitcoin Core ҳақидаги маълумотларни кўрсатиш + + + &Show / Hide + &Кўрсатиш / Яшириш + + + Show or hide the main Window + Асосий ойнани кўрсатиш ёки яшириш + + + Encrypt the private keys that belong to your wallet + Ҳамёнингизга тегишли махфий калитларни кодлаш + + + Sign messages with your Bitcoin addresses to prove you own them + Bitcoin манзилидан унинг эгаси эканлигингизни исботлаш учун хабарлар ёзинг + + + Verify messages to ensure they were signed with specified Bitcoin addresses + Хабарларни махсус Bitcoin манзилларингиз билан ёзилганлигига ишонч ҳосил қилиш учун уларни тасдиқланг + &File - & файл + &Файл &Settings @@ -275,16 +391,44 @@ Ички ойналар асбоблар панели - [testnet] - [testnet] + Bitcoin Core + Bitcoin Core + + + Request payments (generates QR codes and bitcoin: URIs) + Тўловлар (QR кодлари ва bitcoin ёрдамида яратишлар: URI’лар) сўраш + + + &About Bitcoin Core + Bitcoin Core &ҳақида + + + Show the list of used sending addresses and labels + Фойдаланилган жўнатилган манзиллар ва ёрлиқлар рўйхатини кўрсатиш + + + Show the list of used receiving addresses and labels + Фойдаланилган қабул қилинган манзиллар ва ёрлиқлар рўйхатини кўрсатиш + + + Open a bitcoin: URI or payment request + Bitcoin’ни очиш: URI ёки тўлов сўрови + + + &Command-line options + &Буйруқлар сатри мосламалари + + + Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options + Мавжуд Bitcoin буйруқлар матни мосламалари билан Bitcoin Core ёрдам хабарларини олиш рўйхатини кўрсатиш %n active connection(s) to Bitcoin network %n та Bitcoin тармоғига фаол уланиш мавжуд - Processed %1 blocks of transaction history. - Ўтказма тарихи блоклари %1 та амалга оширилган. + No block source available... + Блок манбалари мавжуд эмас... %n hour(s) @@ -306,10 +450,38 @@ %n year(s) %n йил + + %1 behind + %1 орқада + + + Last received block was generated %1 ago. + Сўнги қабул қилинган блок %1 олдин яратилган. + + + Transactions after this will not yet be visible. + Бундан кейинги пул ўтказмалари кўринмайдиган бўлади. + + + Error + Хатолик + + + Warning + Диққат + + + Information + Маълумот + Up to date Янгиланган + + Catching up... + Банд қилинмоқда... + Sent transaction Жўнатилган операция @@ -318,6 +490,18 @@ Incoming transaction Кирувчи операция + + Date: %1 +Amount: %2 +Type: %3 +Address: %4 + + Санаси: %1 +Миқдори: %2 +Тури: %3 +Манзили: %4 + + Wallet is <b>encrypted</b> and currently <b>unlocked</b> Ҳамён <b>кодланган</b> ва вақтинча <b>қулфдан чиқарилган</b> @@ -329,13 +513,61 @@ ClientModel - + + Network Alert + Тармоқ огоҳлантиргичи + + CoinControlDialog + + Coin Control Address Selection + Танга бошқарув манзилини танлаш + + + Quantity: + Сони: + Bytes: Байт: + + Amount: + Миқдори: + + + Priority: + Муҳимлиги: + + + Fee: + Солиқ: + + + Dust: + Ахлат қутиси: + + + After Fee: + Солиқдан сўнг: + + + Change: + Ўзгартириш: + + + (un)select all + барчасини танаш (бекор қилиш) + + + Tree mode + Дарахт усулида + + + List mode + Рўйхат усулида + Amount Миқдори @@ -348,10 +580,18 @@ Date Сана + + Confirmations + Тасдиқлашлар + Confirmed Тасдиқланди + + Priority + Муҳимлиги + Copy address Манзилни нусхалаш @@ -364,15 +604,139 @@ Copy amount Кийматни нусхала + + Copy transaction ID + Ўтказам рақамидан нусха олиш + + + Lock unspent + Сарфланмаганларни қулфлаш + + + Unlock unspent + Сарфланмаганларни қулфдан чиқариш + + + Copy quantity + Нусха сони + + + Copy fee + Нусха солиғи + + + Copy after fee + Нусха солиқдан сўнг + + + Copy bytes + Нусха байти + + + Copy priority + Нусха муҳимлиги + + + Copy dust + Нусха чангги + + + Copy change + Нусха қайтими + + + highest + энг юқори + + + higher + юқорирок + + + high + юқори + + + medium-high + ўртача-юқори + medium ўрта + + low-medium + паст-юқори + + + low + паст + + + lower + пастроқ + + + lowest + энг паст + + + (%1 locked) + (%1 қулфланган) + + + none + йўқ + + + Can vary +/- %1 satoshi(s) per input. + Ҳар бир кирим +/- %1 сатоши(лар) билан ўзгариши мумкин. + + + yes + ҳа + + + no + йўқ + + + This label turns red, if the transaction size is greater than 1000 bytes. + Агар ўтказманинг ҳажми 1000 байтдан ошса, ёрлиқ қизаради. + + + This means a fee of at least %1 per kB is required. + Бу дегани солиқ ҳар кб учун камида %1 талаб қилинади. + + + Can vary +/- 1 byte per input. + Ҳар бир кирим +/- 1 байт билан ўзгариши мумкин. + + + Transactions with higher priority are more likely to get included into a block. + Юқори муҳимликка эга бўлган ўтказмалар тезда блокнинг ичига қўшимча олади. + + + This label turns red, if the priority is smaller than "medium". + Агар муҳимлиги "ўртача"дан паст бўлса, ушбу ёрлиқ қизил бўлиб ёнади. + + + This label turns red, if any recipient receives an amount smaller than %1. + Агар қабул қилувчи %1дан кичик миқдорни қабул қилса, ушбу ёрлиқ қизил бўлиб ёнади. + (no label) (Ёрлик мавжуд эмас) - + + change from %1 (%2) + %1 (%2)дан ўзгартириш + + + (change) + (ўзгартириш) + + EditAddressDialog @@ -383,6 +747,14 @@ &Label &Ёрлик + + The label associated with this address list entry + Ёрлиқ ушбу манзилар рўйхати ёзуви билан боғланган + + + The address associated with this address list entry. This can only be modified for sending addresses. + Манзил ушбу манзиллар рўйхати ёзуви билан боғланган. Уни фақат жўнатиладиган манзиллар учун ўзгартирса бўлади. + &Address &Манзил @@ -407,6 +779,10 @@ The entered address "%1" is already in the address book. Киритилган "%1" манзили аллақачон манзил китобида. + + The entered address "%1" is not a valid Bitcoin address. + Киритилган "%1" манзили тўғри Bitcoin манзили эмас. + Could not unlock wallet. Ҳамён қулфдан чиқмади. @@ -418,9 +794,37 @@ FreespaceChecker - + + A new data directory will be created. + Янги маълумотлар директорияси яратилади. + + + name + номи + + + Directory already exists. Add %1 if you intend to create a new directory here. + Директория аллақачон мавжуд. Агар бу ерда янги директория яратмоқчи бўлсангиз, %1 қўшинг. + + + Path already exists, and is not a directory. + Йўл аллақачон мавжуд. У директория эмас. + + + Cannot create data directory here. + Маълумотлар директориясини бу ерда яратиб бўлмайди.. + + HelpMessageDialog + + Bitcoin Core + Bitcoin Core + + + version + версияси + (%1-bit) (%1-bit) @@ -433,20 +837,232 @@ Usage: Фойдаланиш: - + + command-line options + буйруқлар қатори орқали мослаш + + + UI options + UI мосламалари + + + Start minimized + Йиғилганларни бошлаш + + + Set SSL root certificates for payment request (default: -system-) + Тўлов сўровлари учун SSL асос сертификатларини ўрнатиш (стандарт: -system-) + + + Choose data directory on startup (default: 0) + Ишга тушиш вақтида маълумотлар директориясини танлаш (стандарт: 0) + + Intro + + Welcome + Хуш келибсиз + + + Welcome to Bitcoin Core. + "Bitcoin Core"га хуш келибсиз. + + + As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. + Биринчи марта дастур ишга тушгани каби сиз Bitcoin Core маълумотларини жойлаштирадиган жойни танлашингиз мумкин. + + + Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. + Bitcoin Core юклаб олинади ва Bitcoin блок занжири нусхаси жойлаштирилади. Камида %1GB маълумот ушбу директорияга жойлаштирилади ва вақт давомида ўсиб боради. Ҳамён ҳам ушбу директорияда жойлашади. + + + Use the default data directory + Стандарт маълумотлар директориясидан фойдаланиш + + + Use a custom data directory: + Бошқа маълумотлар директориясида фойдаланинг: + + + Bitcoin Core + Bitcoin Core + + + Error: Specified data directory "%1" cannot be created. + Хато: кўрсатилган "%1" маълумотлар директориясини яратиб бўлмайди. + + + Error + Хатолик + OpenURIDialog - + + Open URI + URI ни очиш + + + Open payment request from URI or file + URL файлдан тўлов сўровларини очиш + + + URI: + URI: + + + Select payment request file + Тўлов сўрови файлини танлаш + + + Select payment request file to open + Очиш учун тўлов сўрови файлини танлаш + + OptionsDialog Options Танламалар - + + &Main + &Асосий + + + Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. + Ҳар бир кб учун ўтказма солиғи ўтказмаларингизни тезроқ ўтишига ишонишингизга ёрдам беради. Кўпгина ўтказмалар 1 кб. + + + Pay transaction &fee + Ўтказма &солиғини тўлаш + + + Automatically start Bitcoin after logging in to the system. + Тизимга киргандан сўнг Bitcoin дастури автоматик ишга туширилсин. + + + &Start Bitcoin on system login + Тизимга кирганда Bitcoin &ишга туширилсин + + + Size of &database cache + &Маълумотлар базаси кеши + + + MB + МБ + + + Number of script &verification threads + Мавзуларни &тўғрилаш скрипти миқдори + + + Accept connections from outside + Ташқаридан уланишларга рози бўлиш + + + Allow incoming connections + Кирувчи уланишларга рухсат бериш + + + Connect to the Bitcoin network through a SOCKS proxy. + Bitcoin тармоққа SOCKS прокси орқали уланинг. + + + &Connect through SOCKS proxy (default proxy): + SOCKS прокси орқали &уланинг (стандарт прокси): + + + IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + Прокси IP манзили (масалан: IPv4: 127.0.0.1 / IPv6: ::1) + + + Third party transaction URLs + Бегона тараф ўтказмалари URL манзиллари + + + Proxy &IP: + Прокси &IP рақами: + + + &Port: + &Порт: + + + Port of the proxy (e.g. 9050) + Прокси порти (e.g. 9050) + + + &Window + &Ойна + + + Show only a tray icon after minimizing the window. + Ойна йиғилгандан сўнг фақат трэй нишончаси кўрсатилсин. + + + &Minimize to the tray instead of the taskbar + Манзиллар панели ўрнига трэйни &йиғиш + + + M&inimize on close + Ёпишда й&иғиш + + + &Display + &Кўрсатиш + + + User Interface &language: + Фойдаланувчи интерфейси &тили: + + + The user interface language can be set here. This setting will take effect after restarting Bitcoin. + Фойдаланувчи тили интерфесини шу ерда ўрнатиш мумкин. TУшбу созлама Bitcoin қайта ишга туширилганда кучга киради. + + + &Unit to show amounts in: + Миқдорларни кўрсатиш учун &қисм: + + + &OK + &OK + + + &Cancel + &Бекор қилиш + + + default + стандарт + + + none + йўқ + + + Confirm options reset + Тасдиқлаш танловларини рад қилиш + + + Client restart required to activate changes. + Ўзгаришлар амалга ошиши учун мижозни қайта ишга тушириш талаб қилинади. + + + Client will be shutdown, do you want to proceed? + Мижоз ўчирилади. Давом эттиришни хоҳлайсизми? + + + This change would require a client restart. + Ушбу ўзгариш мижозни қайтадан ишга туширишни талаб қилади. + + + The supplied proxy address is invalid. + Келтирилган прокси манзили ишламайди. + + OverviewPage @@ -454,8 +1070,60 @@ Шакл - <b>Recent transactions</b> - <b>Жорий утказмалар</b> + The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. + Кўрсатилган маълумот эскирган бўлиши мумкин. Ҳамёнингиз алоқа ўрнатилгандан сўнг Bitcoin тармоқ билан автоматик тарзда синхронланади, аммо жараён ҳалигача тугалланмади. + + + Watch-only: + Фақат кўришга + + + Available: + Мавжуд: + + + Your current spendable balance + Жорий сарфланадиган балансингиз + + + Pending: + Кутилмоқда: + + + Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance + Жами ўтказмалар ҳозиргача тасдиқланган ва сафланадиган баланс томонга ҳали ҳам ҳисобланмади + + + Immature: + Тайёр эмас: + + + Mined balance that has not yet matured + Миналаштирилган баланс ҳалигача тайёр эмас + + + Balances + Баланслар + + + Total: + Жами: + + + Your current total balance + Жорий умумий балансингиз + + + Your current balance in watch-only addresses + Жорий балансингиз фақат кўринадиган манзилларда + + + Spendable: + Сарфланадиган: + + + Recent transactions + Сўнгги пул ўтказмалари @@ -463,34 +1131,290 @@ PeerTableModel - + + Ping Time + Ping вақти + + QObject Amount Миқдори - + + %1 m + %1 д + + + %1 s + %1 с + + + NETWORK + ТАРМОҚ + + + UNKNOWN + НОМАЪЛУМ + + + None + Йўқ + + + N/A + Тўғри келмайди + + + %1 ms + %1 мс + + QRImageWidget - + + &Save Image... + Расмни &сақлаш + + + &Copy Image + Расмдан &нусха олиш + + + Save QR Code + QR кодни сақлаш + + + PNG Image (*.png) + PNG расм (*.png) + + RPCConsole + + Client name + Мижоз номи + + + N/A + Тўғри келмайди + + + Client version + Мижоз номи + + + &Information + &Маълумот + + + Debug window + Тузатиш ойнаси + General Асосий + + Using OpenSSL version + Фойдаланилаётган OpenSSL версияси + + + Using BerkeleyDB version + Фойдаланилаётган BerkeleyDB версияси + + + Startup time + Бошланиш вақти + + + Network + Тармоқ + Name Ном - + + &Peers + &Уламлар + + + Select a peer to view detailed information. + Батафсил маълумотларни кўриш учун уламни танланг. + + + Starting Height + Узунликнинг бошланиши + + + Sync Height + Узунликни синхронлаш + + + Ban Score + Тезликни бан қилиш + + + Connection Time + Уланиш вақти + + + Last Send + Сўнгги жўнатилган + + + Last Receive + Сўнгги қабул қилинган + + + Bytes Sent + Жўнатилган байтлар + + + Bytes Received + Қабул қилинган байтлар + + + Ping Time + Ping вақти + + + Last block time + Сўнгги блок вақти + + + &Open + &Очиш + + + &Console + &Терминал + + + &Network Traffic + &Тармоқ трафиги + + + &Clear + &Тозалаш + + + Totals + Жами + + + In: + Ичига: + + + Out: + Ташқарига: + + + Build date + Тузилган санаси + + + Debug log file + Тузатиш журнали файли + + + Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files. + Жорий махлумотлар директориясидан Bitcoin тузатиш журнали файлини очинг. Бу катта журнал файллари учун бир неча сонияни олиши мумкин. + + + Clear console + Терминални тозалаш + + + Welcome to the Bitcoin RPC console. + Bitcoin RPC терминлга хуш келибсиз. + + + Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. + Тарихни кўриш учун тепага ва пастга кўрсаткичларидан фойдаланинг, экранни тозалаш учун <b>Ctrl-L</b> тугмалар бирикмасидан фойдаланинг. + + + Type <b>help</b> for an overview of available commands. + Мавжуд буйруқларни кўриш учун <b>help</b> деб ёзинг. + + + %1 B + %1 Б + + + %1 KB + %1 КБ + + + %1 MB + %1 МБ + + + %1 GB + %1 ГБ + + + via %1 + %1 орқали + + + never + ҳеч қачон + + + Unknown + Номаълум + + + Fetching... + Олинмоқда... + + ReceiveCoinsDialog + + &Amount: + &Миқдор: + &Label: &Ёрлиқ: + + &Message: + &Хабар: + + + Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before. + Олдинги фойдаланилган қабул қилинган манзиллардан биридан қайта фойдаланилсин. Хавсизлик ва махфийлик муаммолар мавжуд манзиллардан қайта фойдаланилмоқда. Бундан тўлов сўров қайта яратилмагунича фойдаланманг. + + + An optional label to associate with the new receiving address. + Янги қабул қилинаётган манзил билан боғланган танланадиган ёрлиқ. + + + Use this form to request payments. All fields are <b>optional</b>. + Ушбу сўровдан тўловларни сўраш учун фойдаланинг. Барча майдонлар <b>мажбурий эмас</b>. + + + An optional amount to request. Leave this empty or zero to not request a specific amount. + Хоҳланган миқдор сўрови. Кўрсатилган миқдорни сўраш учун буни бўш ёки ноль қолдиринг. + + + Clear all fields of the form. + Шаклнинг барча майдончаларини тозалаш + + + Clear + Тозалаш + + + Requested payments history + Сўралган тўлов тарихи + Copy label Ёрликни нусхала @@ -506,6 +1430,10 @@ ReceiveRequestDialog + + &Save Image... + Расмни &сақлаш + Address Манзил @@ -544,14 +1472,54 @@ Send Coins Тангаларни жунат + + Quantity: + Сони: + Bytes: Байт: + + Amount: + Миқдори: + + + Priority: + Муҳимлиги: + + + Fee: + Солиқ: + + + After Fee: + Солиқдан сўнг: + + + Change: + Ўзгартириш: + + + If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. + Агар бу фаоллаштирилса, аммо ўзгартирилган манзил бўл ёки нотўғри бўлса, ўзгариш янги яратилган манзилга жўнатилади. + + + Custom change address + Бошқа ўзгартирилган манзил + Send to multiple recipients at once Бирданига бир нечта қабул қилувчиларга жўнатиш + + Clear all fields of the form. + Шаклнинг барча майдончаларини тозалаш + + + Dust: + Ахлат қутиси: + Balance: Баланс @@ -564,19 +1532,63 @@ Confirm send coins Тангалар жўнаишни тасдиқлаш + + Copy quantity + Нусха сони + Copy amount Кийматни нусхала + + Copy fee + Нусха солиғи + + + Copy after fee + Нусха солиқдан сўнг + + + Copy bytes + Нусха байти + + + Copy priority + Нусха муҳимлиги + + + Copy change + Нусха қайтими + The amount to pay must be larger than 0. Тўлов миқдори 0. дан катта бўлиши керак. + + Warning: Invalid Bitcoin address + Диққат: Нотўғр Bitcoin манзили + (no label) (Ёрлик мавжуд эмас) - + + Warning: Unknown change address + Диққат: Номаълум ўзгариш манзили + + + Copy dust + Нусха чангги + + + Are you sure you want to send? + Жўнатишни хоҳлашингизга ишончингиз комилми? + + + added as transaction fee + ўтказма солиғи қўшилди + + SendCoinsEntry @@ -625,9 +1637,17 @@ Alt+P Alt+P + + Signature + Имзо + SplashScreen + + Bitcoin Core + Bitcoin Core + The Bitcoin Core developers Bitcoin Core дастурчилари @@ -827,6 +1847,10 @@ Copy amount Кийматни нусхала + + Copy transaction ID + Ўтказам рақамидан нусха олиш + Edit label Ёрликни тахрирлаш @@ -902,14 +1926,6 @@ Options: Танламалар: - - Specify configuration file (default: bitcoin.conf) - Мослаш файлини кўрсатинг (default: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - pid файлини кўрсатинг (default: bitcoind.pid) - Specify data directory Маълумотлар директориясини кўрсатинг @@ -926,10 +1942,18 @@ Use the test network Синов тармоғидан фойдаланинг + + Information + Маълумот + Username for JSON-RPC connections JSON-RPC уланишлари учун фойдаланувчи номи + + Warning + Диққат + Password for JSON-RPC connections JSON-RPC уланишлари учун парол @@ -938,14 +1962,6 @@ Use OpenSSL (https) for JSON-RPC connections JSON-RPC уланишлари учун OpenSSL (https)дан фойдаланиш - - Server certificate file (default: server.cert) - Сервер сертификат файли (default: server.cert) - - - Server private key (default: server.pem) - Сервер махфий калити (бирламчи: server.pem) - This help message Бу ёрдам хабари @@ -970,5 +1986,9 @@ Done loading Юклаш тайёр - + + Error + Хатолик + + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_zh_CN.ts b/src/qt/locale/bitcoin_zh_CN.ts index cd0caf53a1..75867460ab 100644 --- a/src/qt/locale/bitcoin_zh_CN.ts +++ b/src/qt/locale/bitcoin_zh_CN.ts @@ -386,10 +386,6 @@ Tabs toolbar 分页工具栏 - - [testnet] - [测试网络] - Bitcoin Core 比特币核心 @@ -430,10 +426,6 @@ No block source available... 沒有可用的区块来源... - - Processed %1 blocks of transaction history. - 已处理 %1 个交易历史数据块。 - %n hour(s) %n 小时 @@ -905,15 +897,7 @@ Address: %4 Error 错误 - - GB of free space available - 可用空间(GB) - - - (of %1GB needed) - (需要 %1GB) - - + OpenURIDialog @@ -1154,10 +1138,6 @@ Address: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. 现在显示的消息可能是过期的. 在连接上比特币网络节点后,您的钱包将自动与网络同步,但是这个过程还没有完成。 - - Wallet - 钱包 - Watch-only: 查看-只有: @@ -1194,10 +1174,6 @@ Address: %4 Your current total balance 您当前的总余额 - - <b>Recent transactions</b> - <b>最近交易记录</b> - out of sync 数据同步中 @@ -1437,10 +1413,6 @@ Address: %4 Services 服务 - - Sync Node - 同步节点 - Starting Height 开始高度 @@ -1569,14 +1541,6 @@ Address: %4 Outbound 传出 - - Yes - - - - No - - Unknown 未知 @@ -2606,16 +2570,6 @@ Address: %4 Options: 选项: - - - - Specify configuration file (default: bitcoin.conf) - 指定配置文件 (默认为 bitcoin.conf) - - - - Specify pid file (default: bitcoind.pid) - 指定 pid 文件 (默认为 bitcoind.pid) @@ -2623,14 +2577,6 @@ Address: %4 指定数据目录 - - Listen for connections on <port> (default: 8333 or testnet: 18333) - 监听端口连接 <port>(缺省: 8333 或测试网络: 18333) - - - Maintain at most <n> connections to peers (default: 125) - 最大连接数 <n> (缺省: 125) - Connect to a node to retrieve peer addresses, and disconnect 连接一个节点并获取对端地址,然后断开连接 @@ -2639,18 +2585,6 @@ Address: %4 Specify your own public address 指定您的公共地址 - - Threshold for disconnecting misbehaving peers (default: 100) - 断开行为不端对端阀值(缺省: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - 重新连接异常节点的秒数(缺省: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - JSON-RPC连接监听端口<port> (缺省:8332 testnet:18332) - Accept command line and JSON-RPC commands 接受命令行和 JSON-RPC 命令 @@ -2695,18 +2629,10 @@ rpcpassword=%s 像这样: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - 可接受的密码(默认:TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 绑定指定的IP地址开始监听。IPv6地址请使用[host]:port 格式 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - 自由交易不断的速率限制为<n>*1000 字节每分钟(默认值:15) - Enter regression test mode, which uses a special chain in which blocks can be solved instantly. 进入回归测试模式,它采用一种特殊的可立即解决的区块链模拟情况。 @@ -2723,14 +2649,6 @@ rpcpassword=%s Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) 当最佳区块变化时执行命令 (命令行中的 %s 会被替换成区块哈希值) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - 从缓冲池清理磁盘数据库活动日志每<n>兆字节 (默认值: 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - 如何有效的验证checkblocks区块(0-4, 默认值: 3) - In this mode -genproclimit controls how many blocks are generated immediately. 在-genproclimit这种模式下控制产出多少区块 @@ -2739,10 +2657,6 @@ rpcpassword=%s Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) 设置脚本验证的程序 (%u 到 %d, 0 = 自动, <0 = 保留自由的核心, 默认值: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - 设置处理器生成的限制 (-1 = 无限, 默认值: -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications 这是测试用的预发布版本 - 请谨慎使用 - 不要用来挖矿,或者在正式商用环境下使用 @@ -2751,10 +2665,6 @@ rpcpassword=%s Unable to bind to %s on this computer. Bitcoin Core is probably already running. 无法 %s的绑定到电脑上,比特币核心钱包可能已经在运行。 - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - 连接至 Tor隐藏服务器时 使用不同的SOCKS5代理 (缺省: -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. 警告:-paytxfee 交易费设置得太高了!每笔交易都将支付交易费。 @@ -2779,10 +2689,6 @@ rpcpassword=%s (default: 1) (默认值: 1) - - (default: wallet.dat) - (默认: wallet.dat) - <category> can be: <category> 可能是: @@ -2811,10 +2717,6 @@ rpcpassword=%s Debugging/Testing options: 调试/测试选项: - - Disable safemode, override a real safe mode event (default: 0) - 禁止使用安全模式,重新写入一个真正的安全模式日志(默认值: 0) - Discover own IP address (default: 1 when listening and no -externalip) 发现自己的IP地址(缺省:不带 -externalip 参数监听时设置为1) @@ -2851,66 +2753,10 @@ rpcpassword=%s Error: Wallet locked, unable to create transaction! 错误:钱包被锁定,无法创建交易! - - Error: system error: - 错误:系统出错。 - Failed to listen on any port. Use -listen=0 if you want this. 监听端口失败。请使用 -listen=0 参数。 - - Failed to read block info - 无法读取数据块信息 - - - Failed to read block - 读取数据块失败 - - - Failed to sync block index - 无法同步数据块索引 - - - Failed to write block index - 无法写入数据块索引 - - - Failed to write block info - 无法写入数据块信息 - - - Failed to write block - 无法写数据块 - - - Failed to write file info - 无法写入文件信息 - - - Failed to write to coin database - 无法写入coin数据库 - - - Failed to write transaction index - 无法写入交易索引 - - - Failed to write undo data - 无法写入回滚信息 - - - Force safe mode (default: 0) - 强制安全模式(默认值: 0) - - - Generate coins (default: 0) - 生成比特币(默认为 0) - - - How many blocks to check at startup (default: 288, 0 = all) - 启动时检测多少个数据块(缺省:288,0=所有) - If <category> is not supplied, output all debugging information. 如果<category>未提供,将输出所有调试信息。 @@ -2931,10 +2777,6 @@ rpcpassword=%s Not enough file descriptors available. 没有足够的文件描述符可用。 - - Prepend debug output with timestamp (default: 1) - 调试信息输出时,前面加上时间戳 (缺省: 1) - Rebuild block chain index from current blk000??.dat files 重新为当前的blk000??.dat文件建立索引 @@ -2947,18 +2789,10 @@ rpcpassword=%s Set maximum block size in bytes (default: %d) 设置最大区块大小 (默认: %d,单位字节) - - Set the number of threads to service RPC calls (default: 4) - 设置使用调用服务 RPC 的线程数量(默认:4) - Specify wallet file (within data directory) 指定钱包文件(数据目录内) - - Spend unconfirmed change when sending transactions (default: 1) - 付款时允许使用未确认的零钱 (缺省: 1) - This is intended for regression testing tools and app development. 这是用于回归测试和应用开发目的。 @@ -2995,10 +2829,6 @@ rpcpassword=%s Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) 当收到相关提醒或者我们看到一个长分叉时执行命令(%s 将替换为消息) - - Output debugging information (default: 0, supplying <category> is optional) - 输出调试信息(默认为0,提供 <category> 是可选的) - Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) 通过DNS查询每个地址,如果短地址 (默认值: 1 除非 -连接) @@ -3007,10 +2837,6 @@ rpcpassword=%s Set maximum size of high-priority/low-fee transactions in bytes (default: %d) 设置 高优先级/低交易费 交易的最大字节 (缺省: %d) - - Always query for peer addresses via DNS lookup (default: 0) - 始终通过 DNS 查询对等端地址 (默认: 0) - Cannot resolve -whitebind address: '%s' 无法解析 -whitebind 地址: '%s' @@ -3035,10 +2861,6 @@ rpcpassword=%s Error: Unsupported argument -tor found, use -onion. 错误:发现了不支持的参数 -tor,请使用 -onion。 - - Include IP addresses in debug output (default: 0) - 在调试输出中包含IP地址 (默认: 0) - Information 信息 @@ -3063,26 +2885,6 @@ rpcpassword=%s Invalid netmask specified in -whitelist: '%s' -whitelist: '%s' 指定的网络掩码无效 - - Limit size of signature cache to <n> entries (default: 50000) - 签名缓冲大小限制每<n> 条目 (默认值: 50000) - - - Log transaction priority and fee per kB when mining blocks (default: 0) - 开采区块时,日志优先级和手续费每KB (默认值: 0) - - - Maintain a full transaction index (default: 0) - 维护一份完整的交易索引(缺省:0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - 每个连接的最大接收缓存,<n>*1000 字节(缺省:5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - 每个连接的最大发送缓存,<n>*1000 字节(缺省:1000) - Need to specify a port with -whitebind: '%s' -whitebind: '%s' 需要指定一个端口 @@ -3091,22 +2893,10 @@ rpcpassword=%s Node relay options: 节点中继选项: - - Only accept block chain matching built-in checkpoints (default: 1) - 仅接受符合客户端检查点设置的数据块文件 - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - 仅连接至指定网络的节点<net>(IPv4, IPv6 或者 Tor) - Print block on startup, if found in block index 如果在搜索区块中找到,请启动打印区块 - - Print block tree on startup (default: 0) - 启动时打印区块树 (默认值: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) RPC SSL选项:(见有关比特币设置用于SSL说明的维基百科) @@ -3123,26 +2913,10 @@ rpcpassword=%s Randomly fuzz 1 of every <n> network messages 随机每1个模拟测试<n>网络信息 - - Relay non-P2SH multisig (default: 1) - 中转non-P2SH multisig (默认值: 1) - - - Run a thread to flush wallet periodically (default: 1) - 运行一个程序,定时清理钱包 (默认值:1) - Send trace/debug info to console instead of debug.log file 跟踪/调试信息输出到控制台,不输出到 debug.log 文件 - - Set minimum block size in bytes (default: 0) - 设置最小数据块大小(缺省:0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - 设置DB_PRIVATE钱包标志DB环境 (默认值: 1) - Show all debugging options (usage: --help -help-debug) 显示所有调试选项 (用法: --帮助 -帮助调试) @@ -3155,14 +2929,6 @@ rpcpassword=%s Signing transaction failed 签署交易失败 - - Specify connection timeout in milliseconds (default: 5000) - 设置连接超时时间(缺省:5000毫秒) - - - System error: - 系统错误: - This is experimental software. 这是实验性的软件。 @@ -3183,10 +2949,6 @@ rpcpassword=%s Unable to bind to %s on this computer (bind returned error %s) 无法在此计算机上绑定 %s (绑定返回错误 %s) - - Use UPnP to map the listening port (default: 0) - 使用UPnP映射监听端口 (缺省: 0) - Use UPnP to map the listening port (default: 1 when listening) 使用UPnp映射监听端口(缺省: 监听状态设为1) @@ -3240,11 +3002,6 @@ rpcpassword=%s Upgrade wallet to latest format 将钱包升级到最新的格式 - - Set key pool size to <n> (default: 100) - 设置密钥池大小为 <n> (缺省: 100) - - Rescan the block chain for missing wallet transactions 重新扫描区块链以查找遗漏的钱包交易 @@ -3253,16 +3010,6 @@ rpcpassword=%s Use OpenSSL (https) for JSON-RPC connections 为 JSON-RPC 连接使用 OpenSSL (https) 连接 - - Server certificate file (default: server.cert) - 服务器证书 (默认为 server.cert) - - - - Server private key (default: server.pem) - 服务器私钥 (默认为 server.pem) - - This help message 本帮助信息 diff --git a/src/qt/locale/bitcoin_zh_TW.ts b/src/qt/locale/bitcoin_zh_TW.ts index 51c0780ab0..6301bd4587 100644 --- a/src/qt/locale/bitcoin_zh_TW.ts +++ b/src/qt/locale/bitcoin_zh_TW.ts @@ -390,10 +390,6 @@ Tabs toolbar 分頁工具列 - - [testnet] - [testnet] - Bitcoin Core 位元幣核心 @@ -434,10 +430,6 @@ No block source available... 沒有可用的區塊來源... - - Processed %1 blocks of transaction history. - 已處理了 %1 個區塊的交易紀錄。 - %n hour(s) %n 個小時 @@ -916,15 +908,7 @@ Address: %4 Error 錯誤 - - GB of free space available - GB 可用空間 - - - (of %1GB needed) - (需要 %1GB) - - + OpenURIDialog @@ -1165,10 +1149,6 @@ Address: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. 顯示的資訊可能是過期的。跟位元幣網路的連線建立後,你的錢包會自動和網路同步,但是這個步驟還沒完成。 - - Wallet - 錢包 - Watch-only: 只能看: @@ -1197,6 +1177,10 @@ Address: %4 Mined balance that has not yet matured 還沒成熟的開採金額 + + Balances + 餘額 + Total: 總金額: @@ -1209,6 +1193,14 @@ Address: %4 Your current balance in watch-only addresses 所有只能看位址的目前餘額 + + Spendable: + 可支配: + + + Recent transactions + 最近的交易 + Unconfirmed transactions to watch-only addresses 所有只能看位址還沒確認的交易 @@ -1221,10 +1213,6 @@ Address: %4 Current total balance in watch-only addresses 所有只能看位址的目前全部餘額 - - <b>Recent transactions</b> - <b>最近交易</b> - out of sync 還沒同步 @@ -1484,10 +1472,6 @@ Address: %4 Services 服務 - - Sync Node - 同步節點 - Starting Height 起始高度 @@ -1616,14 +1600,6 @@ Address: %4 Outbound 出去 - - Yes - - - - No - - Unknown 不明 @@ -2472,6 +2448,10 @@ Address: %4 Mined 開採所得 + + watch-only + 只能看 + (n/a) (不適用) @@ -2488,6 +2468,10 @@ Address: %4 Type of transaction. 交易的種類。 + + Whether or not a watch-only address is involved in this transaction. + 不論如何有一個只能觀看的地只有參與這次的交易 + Destination address of transaction. 交易的目的地位址。 @@ -2583,6 +2567,10 @@ Address: %4 Export Transaction History 匯出交易記錄 + + Watch-only + 只能觀看的 + Exporting Failed 匯出失敗 @@ -2698,26 +2686,10 @@ Address: %4 Options: 選項: - - Specify configuration file (default: bitcoin.conf) - 指定設定檔(預設值: bitcoin.conf) - - - Specify pid file (default: bitcoind.pid) - 指定行程識別碼(PID)檔(預設值: bitcoind.pid) - Specify data directory 指定資料目錄 - - Listen for connections on <port> (default: 8333 or testnet: 18333) - 在通訊埠 <port> 聽候連線(預設值: 8333, 或若是測試網路: 18333) - - - Maintain at most <n> connections to peers (default: 125) - 維持連線節點數的上限為 <n> 個(預設值: 125) - Connect to a node to retrieve peer addresses, and disconnect 連線到某個節點來取得其它節點的位址,然後斷線 @@ -2726,18 +2698,6 @@ Address: %4 Specify your own public address 指定自己的公開位址 - - Threshold for disconnecting misbehaving peers (default: 100) - 把異常節點斷線的臨界值(預設值: 100) - - - Number of seconds to keep misbehaving peers from reconnecting (default: 86400) - 拒絕跟異常節點連線的秒數(預設值: 86400) - - - Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332) - 在通訊埠 <port> 聽候 JSON-RPC 連線(預設值: 8332, 或若是測試網路: 18332) - Accept command line and JSON-RPC commands 接受指令列和 JSON-RPC 指令 @@ -2779,18 +2739,10 @@ rpcpassword=%s 比如說設定成: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com - - Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - 可接受的加密演算法 (預設值: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - Bind to given address and always listen on it. Use [host]:port notation for IPv6 和指定的位址繫結,並且一直在指定位址聽候連線。IPv6 請用 [主機]:通訊埠 這種格式 - - Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:15) - 對沒付手續費的交易持續限制一分鐘內最多只能有 <n> 千位元組 (預設值: 15) - Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup 清掉錢包裡的所有交易,並且在下次啟動時,使用 -rescan 來從區塊鏈中復原回來。 @@ -2811,14 +2763,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) 當錢包有交易改變時要執行的指令(指令中的 %s 會被取代成交易識別碼) - - Flush database activity from memory pool to disk log every <n> megabytes (default: 100) - 每當累積到 <n> 百萬位元組(MB)時,才將資料庫的變動從記憶體暫存池中寫進磁碟紀錄檔 (預設值: 100) - - - How thorough the block verification of -checkblocks is (0-4, default: 3) - 使用 -checkblocks 檢查區塊的仔細程度 (0 到 4,預設值: 3) - In this mode -genproclimit controls how many blocks are generated immediately. 在這個運作模式下,-genproclimit 選項控制立刻產生出的區塊數目。 @@ -2827,10 +2771,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) 設定指令碼驗證的執行緒數目 (%u 到 %d,0 表示程式自動決定,小於 0 表示保留處理器核心不用的數目,預設值: %d) - - Set the processor limit for when generation is on (-1 = unlimited, default: -1) - 當生產位元幣打開時,設定處理器使用數目限制 (-1 表示不限制,預設值: -1) - This is a pre-release test build - use at your own risk - do not use for mining or merchant applications 這是個還沒發表的測試版本 - 使用請自負風險 - 請不要用來開採或商業應用 @@ -2839,10 +2779,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Unable to bind to %s on this computer. Bitcoin Core is probably already running. 沒辦法繫結在這台電腦上的 %s 。位元幣核心可能已經在執行了。 - - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy) - 使用另外的 SOCK5 代理伺服器,來透過 Tor 隱藏服務跟節點聯繫(預設值: 同 -proxy) - Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. 警告: -paytxfee 設定了很高的金額!這可是你交易付款所要付的手續費。 @@ -2867,10 +2803,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com (default: 1) (預設值: 1) - - (default: wallet.dat) - (預設值: wallet.dat) - <category> can be: <category> 可以是: @@ -2899,10 +2831,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Debugging/Testing options: 除錯與測試選項 - - Disable safemode, override a real safe mode event (default: 0) - 不進入安全模式,用在真的發生需要進入安全模式的事件時,強制不進入 (預設值: 0) - Discover own IP address (default: 1 when listening and no -externalip) 找出自己的網際網路位址(預設值: 當有聽候連線且沒有 -externalip 時為 1) @@ -2931,6 +2859,10 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error opening block database 打開區塊資料庫時發生錯誤 + + Error: A fatal internal error occured, see debug.log for details + 錯誤:一個致命的內部錯誤,到debug.log看更多細節 + Error: Disk space is low! 錯誤: 磁碟空間很少! @@ -2939,66 +2871,10 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Wallet locked, unable to create transaction! 錯誤: 錢包被上鎖了,沒辦法製造新的交易! - - Error: system error: - 錯誤: 系統錯誤: - Failed to listen on any port. Use -listen=0 if you want this. 在任意的通訊埠聽候失敗。如果你希望這樣的話,可以設定 -listen=0. - - Failed to read block info - 讀取區塊資訊失敗 - - - Failed to read block - 讀取區塊失敗 - - - Failed to sync block index - 同步區塊索引失敗 - - - Failed to write block index - 把區塊索引寫進去失敗了 - - - Failed to write block info - 把區塊資訊寫進去失敗了 - - - Failed to write block - 把區塊資料寫進去失敗了 - - - Failed to write file info - 把檔案資訊寫進去失敗了 - - - Failed to write to coin database - 寫進錢幣資料庫失敗了 - - - Failed to write transaction index - 把交易索引寫進去失敗了 - - - Failed to write undo data - 把回復資料寫進去失敗了 - - - Force safe mode (default: 0) - 強制進入安全模式 (預設值: 0) - - - Generate coins (default: 0) - 生產位元幣(預設值: 0) - - - How many blocks to check at startup (default: 288, 0 = all) - 啓動時檢查的區塊數(預設值: 288, 指定 0 表示全部) - If <category> is not supplied, output all debugging information. 如果沒有提供 <category> 就會輸出所有的除錯資訊。 @@ -3020,8 +2896,8 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com 檔案描述元不足。 - Prepend debug output with timestamp (default: 1) - 在除錯輸出內容前附加時間(預設值: 1) + Only connect to nodes in network <net> (ipv4, ipv6 or onion) + 只有連接到網絡節點 <net> (IPv4,IPv6或onion) Rebuild block chain index from current blk000??.dat files @@ -3035,22 +2911,10 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set maximum block size in bytes (default: %d) 設定區塊大小上限成多少位元組(預設值: %d) - - Set the number of threads to service RPC calls (default: 4) - 設定處理 RPC 服務請求的執行緒數目(預設值: 4) - Specify wallet file (within data directory) 指定錢包檔(會在資料目錄中) - - Spend unconfirmed change when sending transactions (default: 1) - 傳送交易時可以花還沒確認的零錢(預設值: 1) - - - Stop running after importing blocks from disk (default: 0) - 從磁碟匯入區塊資料後停止執行(預設值: 0) - This is intended for regression testing tools and app development. 這是設計用來給回歸測試工具和應用程式開發用的。 @@ -3079,10 +2943,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Imports blocks from external blk000??.dat file 從其它來源的 blk000??.dat 檔匯入區塊 - - (default: 1, 1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) - (預設值: 1。1 表示保留交易描述資料,像是帳戶使用者和付款請求資訊;2 表示丟掉交易描述資料) - Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times 允許指定的來源建立 JSON-RPC 連線。<ip> 的有效值可以是一個單獨位址(像是 1.2.3.4),一個網段/網段罩遮值(像是 1.2.3.4/255.255.255.0),或是網段/CIDR值(像是 1.2.3.4/24)。這個選項可以設定多次。 @@ -3119,10 +2979,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. 錯誤: 找到不再支援的 -socks 參數。現在只支援 SOCKS5 協定的代理伺服器了,因為不再能夠指定 SOCKS 協定版本。 - - Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) - 當發現網路上有重複花用錢包裡的交易輸入時所要執行的指令(指令中的 %s 會被取代為重複花用的交易代碼,%t 會被取代為錢包中的交易代碼) - Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) 當收到相關警示,或發現相當長的分支時,所要執行的指令(指令中的 %s 會被取代成警示訊息) @@ -3135,14 +2991,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) 當製造交易時,如果每千位元組(Kb)的手續費比這個值低,就視為沒付手續費 (預設值: %s) - - If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: 1) - 當沒有設定 paytxfee 時,自動包含可以讓交易能在平均 n 個區塊內確認的手續費 (預設值: 1) - - - Output debugging information (default: 0, supplying <category> is optional) - 輸出除錯資訊(預設值: 0, 可以不指定 <category>) - Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) 是否允許在節點位址數目不足時,使用域名查詢來搜尋節點 (預設值: 當沒用 -connect 時為 1) @@ -3159,18 +3007,10 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. 警告: 請檢查電腦日期和時間是否正確!位元幣核心沒辦法在時鐘不準的情況下正常運作。 - - Whitelist peers connecting from the given netmask or ip. Can be specified multiple times. - 把來自指定網域或位址的節點放進白名單。這個選項可以設定多次。 - Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway 在白名單中的節點不會因為偵測到阻斷服務攻擊而被停用。來自這些節點的交易也一定會被轉發,即使說交易本來就在記憶池裡了也一樣。適用於像是閘道伺服器。 - - Always query for peer addresses via DNS lookup (default: 0) - 是否一定要用域名查詢來搜尋節點 (預設值: 0) - Cannot resolve -whitebind address: '%s' 沒辦法解析 -whitebind 指定的位址: '%s' @@ -3199,10 +3039,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Fee (in BTC/kB) to add to transactions you send (default: %s) 交易付款時每千位元組(kB)的交易手續費 (預設值: %s) - - Include IP addresses in debug output (default: 0) - 在除錯輸出內容中包含網際網路位址(預設值: 0) - Information 資訊 @@ -3232,24 +3068,8 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com 在記憶體中保存最多 <n> 個不和其他區塊相連結的區塊(預設值 : %u) - Limit size of signature cache to <n> entries (default: 50000) - 限制簽章快取大小為 <n> 筆 (預設值: 50000) - - - Log transaction priority and fee per kB when mining blocks (default: 0) - 開採區塊的時候紀錄交易的優先度以及每千位元組(kB)的手續費 (預設值: 0) - - - Maintain a full transaction index (default: 0) - 維護全部交易的索引(預設值: 0) - - - Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) - 每個連線的接收緩衝區大小上限為 <n>*1000 個位元組(預設值: 5000) - - - Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) - 每個連線的傳送緩衝區大小上限為 <n>*1000 位元組(預設值: 1000) + Keep at most <n> unconnectable transactions in memory (default: %u) + 保持最多 <n> 無法連結的交易在記憶體 (預設: %u) Need to specify a port with -whitebind: '%s' @@ -3259,22 +3079,10 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Node relay options: 節點轉發選項: - - Only accept block chain matching built-in checkpoints (default: 1) - 只接受跟內建的檢查段點吻合的區塊鏈(預設值: 1) - - - Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - 只和 <net> 網路上的節點連線(IPv4, IPv6, 或 Tor) - Print block on startup, if found in block index 啟動時輸出指定的區塊內容,如果有在區塊索引中找到的話 - - Print block tree on startup (default: 0) - 啟動時輸出區塊樹 (預設值: 0) - RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) RPC SSL 選項: (SSL 設定程序請見 Bitcoin Wiki) @@ -3291,30 +3099,10 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Randomly fuzz 1 of every <n> network messages 隨機亂動 <n> 分之一的網路訊息裡的資料 - - Relay and mine data carrier transactions (default: 1) - 允許轉發和開採只帶資料的交易 (預設值: 1) - - - Relay non-P2SH multisig (default: 1) - 允許轉發非 P2SH 的多簽章交易 (預設值: 1) - - - Run a thread to flush wallet periodically (default: 1) - 啟用定期將變動寫入錢包檔的執行緒 (預設值: 1) - Send trace/debug info to console instead of debug.log file 在終端機顯示追蹤或除錯資訊,而不是寫到檔案 debug.log 中 - - Set minimum block size in bytes (default: 0) - 設定區塊大小下限成多少位元組(預設值: 0) - - - Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - 在錢包資料庫環境變數設定 DB_PRIVATE 旗標 (預設值: 1) - Show all debugging options (usage: --help -help-debug) 顯示所有的除錯選項 (用法: --help --help-debug) @@ -3327,14 +3115,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Signing transaction failed 簽署交易失敗 - - Specify connection timeout in milliseconds (default: 5000) - 指定連線在幾毫秒後逾時(預設值: 5000) - - - System error: - 系統錯誤: - This is experimental software. 這套軟體屬於實驗性質。 @@ -3355,10 +3135,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Unable to bind to %s on this computer (bind returned error %s) 無法和這台電腦上的 %s 繫結(回傳錯誤 %s) - - Use UPnP to map the listening port (default: 0) - 是否要使用「通用即插即用」協定(UPnP),來設定聽候連線的通訊埠的對應(預設值: 0) - Use UPnP to map the listening port (default: 1 when listening) 是否要使用「通用即插即用」協定(UPnP),來設定聽候連線的通訊埠的對應(預設值: 當有聽候連線時為 1) @@ -3411,10 +3187,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Upgrade wallet to latest format 把錢包檔案升級成最新的格式 - - Set key pool size to <n> (default: 100) - 設定密鑰池大小成 <n> (預設值: 100) - Rescan the block chain for missing wallet transactions 重新掃描區塊鏈,來尋找錢包可能漏掉的交易。 @@ -3423,14 +3195,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Use OpenSSL (https) for JSON-RPC connections 在 JSON-RPC 連線使用 OpenSSL (https) - - Server certificate file (default: server.cert) - 伺服器憑證檔(預設值: server.cert) - - - Server private key (default: server.pem) - 伺服器私鑰檔(預設值: server.pem) - This help message 這些說明訊息 From e743678d5a8d14288073606c5a7fe19096caaf74 Mon Sep 17 00:00:00 2001 From: Yoichi Hirai Date: Fri, 31 Oct 2014 20:51:05 +0900 Subject: [PATCH 0970/1288] fix a typo --- src/rpcwallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 2728fb4fb3..f2b5e2061e 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -314,7 +314,7 @@ Value sendtoaddress(const Array& params, bool fHelp) if (fHelp || params.size() < 2 || params.size() > 4) throw runtime_error( "sendtoaddress \"bitcoinaddress\" amount ( \"comment\" \"comment-to\" )\n" - "\nSent an amount to a given address. The amount is a real and is rounded to the nearest 0.00000001\n" + "\nSend an amount to a given address. The amount is a real and is rounded to the nearest 0.00000001\n" + HelpRequiringPassphrase() + "\nArguments:\n" "1. \"bitcoinaddress\" (string, required) The bitcoin address to send to.\n" From a2cfae8e18a5d4270d471ac226c963a7c5e7c39b Mon Sep 17 00:00:00 2001 From: 21E14 <21xe14@gmail.com> Date: Sat, 1 Nov 2014 09:41:48 -0400 Subject: [PATCH 0971/1288] util.cpp comment correction --- src/util.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 544ffc98b8..0f5c036352 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -159,8 +159,8 @@ instance_of_cinit; // the mutex). static boost::once_flag debugPrintInitFlag = BOOST_ONCE_INIT; -// We use boost::call_once() to make sure these are initialized in -// in a thread-safe manner the first time it is called: +// We use boost::call_once() to make sure these are initialized +// in a thread-safe manner the first time called: static FILE* fileout = NULL; static boost::mutex* mutexDebugLog = NULL; From be0e0703f28c575619cb671a4a44813206a3f388 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 3 Nov 2014 01:00:19 -0800 Subject: [PATCH 0972/1288] Remove file and class order guidelines --- doc/coding.md | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/doc/coding.md b/doc/coding.md index ceed8c18b4..b9d2006e3c 100644 --- a/doc/coding.md +++ b/doc/coding.md @@ -12,20 +12,6 @@ gradually. - No indentation for public/protected/private or for namespaces. - No extra spaces inside parenthesis; don't do ( this ) - No space after function names; one space after if, for and while. -- Includes need to be ordered alphabetically, separate own and foreign headers with a new-line (example key.cpp): -```c++ -#include "key.h" - -#include "crypto/sha2.h" -#include "util.h" - -#include -``` -- Class or struct keywords in header files need to be ordered alphabetically: -```c++ -class CAlpha; -class CBeta; -``` Block style example: ```c++ From 84738627ce32767bacb86e1ba109147fab29cafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jan=C3=ADk?= Date: Mon, 3 Nov 2014 16:16:40 +0100 Subject: [PATCH 0973/1288] Fix all header defines --- share/seeds/generate-seeds.py | 6 +++--- src/addrman.h | 6 +++--- src/alert.h | 6 +++--- src/chain.h | 6 +++--- src/chainparams.h | 6 +++--- src/chainparamsbase.h | 6 +++--- src/chainparamsseeds.h | 11 +++++------ src/checkpoints.h | 6 +++--- src/checkqueue.h | 6 +++--- src/clientversion.h | 6 +++--- src/coincontrol.h | 6 +++--- src/compat.h | 6 +++--- src/compat/sanity.h | 6 +++--- src/compressor.h | 6 +++--- src/core/block.h | 6 +++--- src/core/transaction.h | 6 +++--- src/core_io.h | 6 +++--- src/crypter.h | 6 +++--- src/crypto/ripemd160.h | 6 +++--- src/crypto/sha1.h | 6 +++--- src/crypto/sha2.h | 6 +++--- src/ecwrapper.h | 4 ++-- src/protocol.h | 6 +++--- src/qt/addressbookpage.h | 6 +++--- src/qt/addresstablemodel.h | 6 +++--- src/qt/askpassphrasedialog.h | 6 +++--- src/qt/bitcoinaddressvalidator.h | 6 +++--- src/qt/bitcoinamountfield.h | 6 +++--- src/qt/bitcoingui.h | 6 +++--- src/qt/bitcoinunits.h | 6 +++--- src/qt/clientmodel.h | 6 +++--- src/qt/coincontroldialog.h | 6 +++--- src/qt/coincontroltreewidget.h | 6 +++--- src/qt/csvmodelwriter.h | 6 +++--- src/qt/editaddressdialog.h | 6 +++--- src/qt/guiconstants.h | 6 +++--- src/qt/guiutil.h | 6 +++--- src/qt/intro.h | 6 +++--- src/qt/macdockiconhandler.h | 6 +++--- src/qt/macnotificationhandler.h | 6 +++--- src/qt/networkstyle.h | 6 +++--- src/qt/notificator.h | 6 +++--- src/qt/openuridialog.h | 6 +++--- src/qt/optionsdialog.h | 6 +++--- src/qt/optionsmodel.h | 6 +++--- src/qt/overviewpage.h | 6 +++--- src/qt/paymentrequestplus.h | 7 +++---- src/qt/paymentserver.h | 7 ++++--- src/qt/peertablemodel.h | 6 +++--- src/qt/qvalidatedlineedit.h | 6 +++--- src/qt/qvaluecombobox.h | 6 +++--- src/qt/receivecoinsdialog.h | 6 +++--- src/qt/receiverequestdialog.h | 6 +++--- src/qt/recentrequeststablemodel.h | 6 +++--- src/qt/rpcconsole.h | 6 +++--- src/qt/sendcoinsdialog.h | 6 +++--- src/qt/sendcoinsentry.h | 6 +++--- src/qt/signverifymessagedialog.h | 6 +++--- src/qt/splashscreen.h | 6 +++--- src/qt/test/paymentservertests.h | 6 +++--- src/qt/test/uritests.h | 6 +++--- src/qt/trafficgraphwidget.h | 6 +++--- src/qt/transactiondesc.h | 6 +++--- src/qt/transactiondescdialog.h | 6 +++--- src/qt/transactionfilterproxy.h | 6 +++--- src/qt/transactionrecord.h | 6 +++--- src/qt/transactiontablemodel.h | 6 +++--- src/qt/transactionview.h | 6 +++--- src/qt/utilitydialog.h | 6 +++--- src/qt/walletframe.h | 6 +++--- src/qt/walletmodel.h | 6 +++--- src/qt/walletmodeltransaction.h | 6 +++--- src/qt/walletview.h | 6 +++--- src/qt/winshutdownmonitor.h | 6 +++--- src/rpcclient.h | 6 +++--- src/rpcprotocol.h | 6 +++--- src/rpcserver.h | 6 +++--- src/script/interpreter.h | 6 +++--- src/script/script.h | 6 +++--- src/script/sigcache.h | 6 +++--- src/script/sign.h | 6 +++--- src/script/standard.h | 6 +++--- src/test/bignum.h | 6 +++--- src/txdb.h | 6 +++--- src/undo.h | 6 +++--- src/univalue/gen.cpp | 6 +++--- src/univalue/univalue.h | 6 +++--- src/univalue/univalue_escapes.h | 6 +++--- src/wallet_ismine.h | 6 +++--- 89 files changed, 269 insertions(+), 270 deletions(-) diff --git a/share/seeds/generate-seeds.py b/share/seeds/generate-seeds.py index 5f06740560..cdd6831218 100755 --- a/share/seeds/generate-seeds.py +++ b/share/seeds/generate-seeds.py @@ -114,8 +114,8 @@ def main(): exit(1) g = sys.stdout indir = sys.argv[1] - g.write('#ifndef H_CHAINPARAMSSEEDS\n') - g.write('#define H_CHAINPARAMSSEEDS\n') + g.write('#ifndef BITCOIN_CHAINPARAMSSEEDS_H\n') + g.write('#define BITCOIN_CHAINPARAMSSEEDS_H\n') g.write('/**\n') g.write(' * List of fixed seed nodes for the bitcoin network\n') g.write(' * AUTOGENERATED by share/seeds/generate-seeds.py\n') @@ -128,7 +128,7 @@ def main(): g.write('\n') with open(os.path.join(indir,'nodes_test.txt'),'r') as f: process_nodes(g, f, 'pnSeed6_test', 18333) - g.write('#endif\n') + g.write('#endif // BITCOIN_CHAINPARAMSSEEDS_H\n') if __name__ == '__main__': main() diff --git a/src/addrman.h b/src/addrman.h index 914086fc76..d47217683c 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -2,8 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef _BITCOIN_ADDRMAN -#define _BITCOIN_ADDRMAN +#ifndef BITCOIN_ADDRMAN_H +#define BITCOIN_ADDRMAN_H #include "netbase.h" #include "protocol.h" @@ -514,4 +514,4 @@ public: } }; -#endif // _BITCOIN_ADDRMAN +#endif // BITCOIN_ADDRMAN_H diff --git a/src/alert.h b/src/alert.h index ba3235858d..96c203b557 100644 --- a/src/alert.h +++ b/src/alert.h @@ -3,8 +3,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef _BITCOINALERT_H_ -#define _BITCOINALERT_H_ +#ifndef BITCOIN_ALERT_H +#define BITCOIN_ALERT_H #include "serialize.h" #include "sync.h" @@ -110,4 +110,4 @@ public: static CAlert getAlertByHash(const uint256 &hash); }; -#endif // _BITCOINALERT_H_ +#endif // BITCOIN_ALERT_H diff --git a/src/chain.h b/src/chain.h index 7c5603dafc..f99fd113b7 100644 --- a/src/chain.h +++ b/src/chain.h @@ -3,8 +3,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef H_BITCOIN_CHAIN -#define H_BITCOIN_CHAIN +#ifndef BITCOIN_CHAIN_H +#define BITCOIN_CHAIN_H #include "core/block.h" #include "pow.h" @@ -409,4 +409,4 @@ public: const CBlockIndex *FindFork(const CBlockIndex *pindex) const; }; -#endif // H_BITCOIN_CHAIN +#endif // BITCOIN_CHAIN_H diff --git a/src/chainparams.h b/src/chainparams.h index 9279edd6c0..9f24b70a26 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -3,8 +3,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_CHAIN_PARAMS_H -#define BITCOIN_CHAIN_PARAMS_H +#ifndef BITCOIN_CHAINPARAMS_H +#define BITCOIN_CHAINPARAMS_H #include "chainparamsbase.h" #include "checkpoints.h" @@ -151,4 +151,4 @@ void SelectParams(CBaseChainParams::Network network); */ bool SelectParamsFromCommandLine(); -#endif // BITCOIN_CHAIN_PARAMS_H +#endif // BITCOIN_CHAINPARAMS_H diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h index 4042b8c879..eaf3fea1b6 100644 --- a/src/chainparamsbase.h +++ b/src/chainparamsbase.h @@ -2,8 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_CHAIN_PARAMS_BASE_H -#define BITCOIN_CHAIN_PARAMS_BASE_H +#ifndef BITCOIN_CHAINPARAMSBASE_H +#define BITCOIN_CHAINPARAMSBASE_H #include #include @@ -62,4 +62,4 @@ bool SelectBaseParamsFromCommandLine(); */ bool AreBaseParamsConfigured(); -#endif // BITCOIN_CHAIN_PARAMS_BASE_H +#endif // BITCOIN_CHAINPARAMSBASE_H diff --git a/src/chainparamsseeds.h b/src/chainparamsseeds.h index c3323c48bd..575e129334 100644 --- a/src/chainparamsseeds.h +++ b/src/chainparamsseeds.h @@ -1,10 +1,9 @@ -#ifndef H_CHAINPARAMSSEEDS -#define H_CHAINPARAMSSEEDS - +#ifndef BITCOIN_CHAINPARAMSSEEDS_H +#define BITCOIN_CHAINPARAMSSEEDS_H /** * List of fixed seed nodes for the bitcoin network - * AUTOGENERATED by contrib/devtools/generate-seeds.py - * + * AUTOGENERATED by share/seeds/generate-seeds.py + * * Each line contains a 16-byte IPv6 address and a port. * IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly. */ @@ -638,4 +637,4 @@ static SeedSpec6 pnSeed6_test[] = { {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x99,0xcb,0x26,0x31,0xba,0x48,0x51,0x31,0x39,0x0d}, 18333}, {{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x44,0xf4,0xf4,0xf0,0xbf,0xf7,0x7e,0x6d,0xc4,0xe8}, 18333} }; -#endif +#endif // BITCOIN_CHAINPARAMSSEEDS_H diff --git a/src/checkpoints.h b/src/checkpoints.h index b5b620fa6b..847524a9f2 100644 --- a/src/checkpoints.h +++ b/src/checkpoints.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_CHECKPOINT_H -#define BITCOIN_CHECKPOINT_H +#ifndef BITCOIN_CHECKPOINTS_H +#define BITCOIN_CHECKPOINTS_H #include "uint256.h" @@ -40,4 +40,4 @@ extern bool fEnabled; } //namespace Checkpoints -#endif // BITCOIN_CHECKPOINT_H +#endif // BITCOIN_CHECKPOINTS_H diff --git a/src/checkqueue.h b/src/checkqueue.h index b2a713e646..afecfeede5 100644 --- a/src/checkqueue.h +++ b/src/checkqueue.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef CHECKQUEUE_H -#define CHECKQUEUE_H +#ifndef BITCOIN_CHECKQUEUE_H +#define BITCOIN_CHECKQUEUE_H #include #include @@ -204,4 +204,4 @@ public: } }; -#endif // CHECKQUEUE_H +#endif // BITCOIN_CHECKQUEUE_H diff --git a/src/clientversion.h b/src/clientversion.h index a187e185c1..0a36eb8012 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -2,8 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef CLIENTVERSION_H -#define CLIENTVERSION_H +#ifndef BITCOIN_CLIENTVERSION_H +#define BITCOIN_CLIENTVERSION_H #if defined(HAVE_CONFIG_H) #include "config/bitcoin-config.h" @@ -67,4 +67,4 @@ std::string FormatSubVersion(const std::string& name, int nClientVersion, const #endif // WINDRES_PREPROC -#endif // CLIENTVERSION_H +#endif // BITCOIN_CLIENTVERSION_H diff --git a/src/coincontrol.h b/src/coincontrol.h index c8f12d92de..c9057017d8 100644 --- a/src/coincontrol.h +++ b/src/coincontrol.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef COINCONTROL_H -#define COINCONTROL_H +#ifndef BITCOIN_COINCONTROL_H +#define BITCOIN_COINCONTROL_H #include "core/transaction.h" @@ -59,4 +59,4 @@ private: std::set setSelected; }; -#endif // COINCONTROL_H +#endif // BITCOIN_COINCONTROL_H diff --git a/src/compat.h b/src/compat.h index 4fc28a36e0..dade79aae0 100644 --- a/src/compat.h +++ b/src/compat.h @@ -3,8 +3,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef _BITCOIN_COMPAT_H -#define _BITCOIN_COMPAT_H +#ifndef BITCOIN_COMPAT_H +#define BITCOIN_COMPAT_H #ifdef WIN32 #ifdef _WIN32_WINNT @@ -84,4 +84,4 @@ typedef u_int SOCKET; #define THREAD_PRIORITY_ABOVE_NORMAL (-2) #endif -#endif // _BITCOIN_COMPAT_H +#endif // BITCOIN_COMPAT_H diff --git a/src/compat/sanity.h b/src/compat/sanity.h index 7016ac0ab7..7f5bc1a4fb 100644 --- a/src/compat/sanity.h +++ b/src/compat/sanity.h @@ -2,10 +2,10 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCON_COMPAT_SANITY_H -#define BITCON_COMPAT_SANITY_H +#ifndef BITCOIN_COMPAT_SANITY_H +#define BITCOIN_COMPAT_SANITY_H bool glibc_sanity_test(); bool glibcxx_sanity_test(); -#endif // BITCON_COMPAT_SANITY_H +#endif // BITCOIN_COMPAT_SANITY_H diff --git a/src/compressor.h b/src/compressor.h index a612c3a883..226be620e8 100644 --- a/src/compressor.h +++ b/src/compressor.h @@ -3,8 +3,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef H_BITCOIN_COMPRESSOR -#define H_BITCOIN_COMPRESSOR +#ifndef BITCOIN_COMPRESSOR_H +#define BITCOIN_COMPRESSOR_H #include "core/transaction.h" #include "script/script.h" @@ -116,4 +116,4 @@ public: } }; -#endif // H_BITCOIN_COMPRESSOR +#endif // BITCOIN_COMPRESSOR_H diff --git a/src/core/block.h b/src/core/block.h index f1eb7a844f..6e119c3699 100644 --- a/src/core/block.h +++ b/src/core/block.h @@ -3,8 +3,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef H_BITCOIN_CORE_BLOCK -#define H_BITCOIN_CORE_BLOCK +#ifndef BITCOIN_CORE_BLOCK_H +#define BITCOIN_CORE_BLOCK_H #include "core/transaction.h" #include "serialize.h" @@ -165,4 +165,4 @@ struct CBlockLocator } }; -#endif // H_BITCOIN_CORE_BLOCK +#endif // BITCOIN_CORE_BLOCK_H diff --git a/src/core/transaction.h b/src/core/transaction.h index c21558cfeb..724348020a 100644 --- a/src/core/transaction.h +++ b/src/core/transaction.h @@ -3,8 +3,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef H_BITCOIN_CORE_TRANSACTION -#define H_BITCOIN_CORE_TRANSACTION +#ifndef BITCOIN_CORE_TRANSACTION_H +#define BITCOIN_CORE_TRANSACTION_H #include "amount.h" #include "script/script.h" @@ -273,4 +273,4 @@ struct CMutableTransaction uint256 GetHash() const; }; -#endif // H_BITCOIN_CORE_TRANSACTION +#endif // BITCOIN_CORE_TRANSACTION_H diff --git a/src/core_io.h b/src/core_io.h index 94848f1c3d..b5ed03b8c8 100644 --- a/src/core_io.h +++ b/src/core_io.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef __BITCOIN_CORE_IO_H__ -#define __BITCOIN_CORE_IO_H__ +#ifndef BITCOIN_CORE_IO_H +#define BITCOIN_CORE_IO_H #include #include @@ -26,4 +26,4 @@ extern void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex); extern void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry); -#endif // __BITCOIN_CORE_IO_H__ +#endif // BITCOIN_CORE_IO_H diff --git a/src/crypter.h b/src/crypter.h index c7424c9b20..4d486c4313 100644 --- a/src/crypter.h +++ b/src/crypter.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef __CRYPTER_H__ -#define __CRYPTER_H__ +#ifndef BITCOIN_CRYPTER_H +#define BITCOIN_CRYPTER_H #include "allocators.h" #include "serialize.h" @@ -195,4 +195,4 @@ public: boost::signals2::signal NotifyStatusChanged; }; -#endif // __CRYPTER_H__ +#endif // BITCOIN_CRYPTER_H diff --git a/src/crypto/ripemd160.h b/src/crypto/ripemd160.h index 902e7ca83f..f468ec6722 100644 --- a/src/crypto/ripemd160.h +++ b/src/crypto/ripemd160.h @@ -2,8 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_RIPEMD160_H -#define BITCOIN_RIPEMD160_H +#ifndef BITCOIN_CRYPTO_RIPEMD160_H +#define BITCOIN_CRYPTO_RIPEMD160_H #include #include @@ -25,4 +25,4 @@ public: CRIPEMD160& Reset(); }; -#endif // BITCOIN_RIPEMD160_H +#endif // BITCOIN_CRYPTO_RIPEMD160_H diff --git a/src/crypto/sha1.h b/src/crypto/sha1.h index 68bd7ced9f..e28f98decd 100644 --- a/src/crypto/sha1.h +++ b/src/crypto/sha1.h @@ -2,8 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_SHA1_H -#define BITCOIN_SHA1_H +#ifndef BITCOIN_CRYPTO_SHA1_H +#define BITCOIN_CRYPTO_SHA1_H #include #include @@ -25,4 +25,4 @@ public: CSHA1& Reset(); }; -#endif // BITCOIN_SHA1_H +#endif // BITCOIN_CRYPTO_SHA1_H diff --git a/src/crypto/sha2.h b/src/crypto/sha2.h index a6cbe58554..329c6675ab 100644 --- a/src/crypto/sha2.h +++ b/src/crypto/sha2.h @@ -2,8 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_SHA2_H -#define BITCOIN_SHA2_H +#ifndef BITCOIN_CRYPTO_SHA2_H +#define BITCOIN_CRYPTO_SHA2_H #include #include @@ -61,4 +61,4 @@ public: void Finalize(unsigned char hash[OUTPUT_SIZE]); }; -#endif // BITCOIN_SHA2_H +#endif // BITCOIN_CRYPTO_SHA2_H diff --git a/src/ecwrapper.h b/src/ecwrapper.h index e2d1e7edc4..52e9e5dab0 100644 --- a/src/ecwrapper.h +++ b/src/ecwrapper.h @@ -2,8 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_EC_WRAPPER_H -#define BITCOIN_EC_WRAPPER_H +#ifndef BITCOIN_ECWRAPPER_H +#define BITCOIN_ECWRAPPER_H #include #include diff --git a/src/protocol.h b/src/protocol.h index b73041a9fd..2ac8f3d8f7 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -7,8 +7,8 @@ #error This header can only be compiled as C++. #endif -#ifndef __INCLUDED_PROTOCOL_H__ -#define __INCLUDED_PROTOCOL_H__ +#ifndef BITCOIN_PROTOCOL_H +#define BITCOIN_PROTOCOL_H #include "netbase.h" #include "serialize.h" @@ -149,4 +149,4 @@ enum { MSG_FILTERED_BLOCK, }; -#endif // __INCLUDED_PROTOCOL_H__ +#endif // BITCOIN_PROTOCOL_H diff --git a/src/qt/addressbookpage.h b/src/qt/addressbookpage.h index 20beb51ec4..031c424785 100644 --- a/src/qt/addressbookpage.h +++ b/src/qt/addressbookpage.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef ADDRESSBOOKPAGE_H -#define ADDRESSBOOKPAGE_H +#ifndef BITCOIN_QT_ADDRESSBOOKPAGE_H +#define BITCOIN_QT_ADDRESSBOOKPAGE_H #include @@ -84,4 +84,4 @@ signals: void sendCoins(QString addr); }; -#endif // ADDRESSBOOKPAGE_H +#endif // BITCOIN_QT_ADDRESSBOOKPAGE_H diff --git a/src/qt/addresstablemodel.h b/src/qt/addresstablemodel.h index 71691f5a26..310647d7c3 100644 --- a/src/qt/addresstablemodel.h +++ b/src/qt/addresstablemodel.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef ADDRESSTABLEMODEL_H -#define ADDRESSTABLEMODEL_H +#ifndef BITCOIN_QT_ADDRESSTABLEMODEL_H +#define BITCOIN_QT_ADDRESSTABLEMODEL_H #include #include @@ -92,4 +92,4 @@ public slots: friend class AddressTablePriv; }; -#endif // ADDRESSTABLEMODEL_H +#endif // BITCOIN_QT_ADDRESSTABLEMODEL_H diff --git a/src/qt/askpassphrasedialog.h b/src/qt/askpassphrasedialog.h index 1119e0861f..6605086060 100644 --- a/src/qt/askpassphrasedialog.h +++ b/src/qt/askpassphrasedialog.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef ASKPASSPHRASEDIALOG_H -#define ASKPASSPHRASEDIALOG_H +#ifndef BITCOIN_QT_ASKPASSPHRASEDIALOG_H +#define BITCOIN_QT_ASKPASSPHRASEDIALOG_H #include @@ -48,4 +48,4 @@ protected: bool eventFilter(QObject *object, QEvent *event); }; -#endif // ASKPASSPHRASEDIALOG_H +#endif // BITCOIN_QT_ASKPASSPHRASEDIALOG_H diff --git a/src/qt/bitcoinaddressvalidator.h b/src/qt/bitcoinaddressvalidator.h index 0fb779f7d8..15a6245da4 100644 --- a/src/qt/bitcoinaddressvalidator.h +++ b/src/qt/bitcoinaddressvalidator.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOINADDRESSVALIDATOR_H -#define BITCOINADDRESSVALIDATOR_H +#ifndef BITCOIN_QT_BITCOINADDRESSVALIDATOR_H +#define BITCOIN_QT_BITCOINADDRESSVALIDATOR_H #include @@ -32,4 +32,4 @@ public: State validate(QString &input, int &pos) const; }; -#endif // BITCOINADDRESSVALIDATOR_H +#endif // BITCOIN_QT_BITCOINADDRESSVALIDATOR_H diff --git a/src/qt/bitcoinamountfield.h b/src/qt/bitcoinamountfield.h index 040a234177..4ab66001f0 100644 --- a/src/qt/bitcoinamountfield.h +++ b/src/qt/bitcoinamountfield.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOINAMOUNTFIELD_H -#define BITCOINAMOUNTFIELD_H +#ifndef BITCOIN_QT_BITCOINAMOUNTFIELD_H +#define BITCOIN_QT_BITCOINAMOUNTFIELD_H #include "amount.h" @@ -69,4 +69,4 @@ private slots: }; -#endif // BITCOINAMOUNTFIELD_H +#endif // BITCOIN_QT_BITCOINAMOUNTFIELD_H diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 0ef4101127..35b36811c4 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOINGUI_H -#define BITCOINGUI_H +#ifndef BITCOIN_QT_BITCOINGUI_H +#define BITCOIN_QT_BITCOINGUI_H #if defined(HAVE_CONFIG_H) #include "config/bitcoin-config.h" @@ -236,4 +236,4 @@ private slots: void onMenuSelection(QAction* action); }; -#endif // BITCOINGUI_H +#endif // BITCOIN_QT_BITCOINGUI_H diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h index a392c42b9b..7a4f38274d 100644 --- a/src/qt/bitcoinunits.h +++ b/src/qt/bitcoinunits.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOINUNITS_H -#define BITCOINUNITS_H +#ifndef BITCOIN_QT_BITCOINUNITS_H +#define BITCOIN_QT_BITCOINUNITS_H #include "amount.h" @@ -126,4 +126,4 @@ private: }; typedef BitcoinUnits::Unit BitcoinUnit; -#endif // BITCOINUNITS_H +#endif // BITCOIN_QT_BITCOINUNITS_H diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h index c7bd60bd41..c7a05e287d 100644 --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef CLIENTMODEL_H -#define CLIENTMODEL_H +#ifndef BITCOIN_QT_CLIENTMODEL_H +#define BITCOIN_QT_CLIENTMODEL_H #include @@ -102,4 +102,4 @@ public slots: void updateAlert(const QString &hash, int status); }; -#endif // CLIENTMODEL_H +#endif // BITCOIN_QT_CLIENTMODEL_H diff --git a/src/qt/coincontroldialog.h b/src/qt/coincontroldialog.h index 9eaa8eb41d..cc388d626e 100644 --- a/src/qt/coincontroldialog.h +++ b/src/qt/coincontroldialog.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef COINCONTROLDIALOG_H -#define COINCONTROLDIALOG_H +#ifndef BITCOIN_QT_COINCONTROLDIALOG_H +#define BITCOIN_QT_COINCONTROLDIALOG_H #include "amount.h" @@ -124,4 +124,4 @@ private slots: void updateLabelLocked(); }; -#endif // COINCONTROLDIALOG_H +#endif // BITCOIN_QT_COINCONTROLDIALOG_H diff --git a/src/qt/coincontroltreewidget.h b/src/qt/coincontroltreewidget.h index a2cd34eb88..643eaf0c70 100644 --- a/src/qt/coincontroltreewidget.h +++ b/src/qt/coincontroltreewidget.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef COINCONTROLTREEWIDGET_H -#define COINCONTROLTREEWIDGET_H +#ifndef BITCOIN_QT_COINCONTROLTREEWIDGET_H +#define BITCOIN_QT_COINCONTROLTREEWIDGET_H #include #include @@ -19,4 +19,4 @@ protected: virtual void keyPressEvent(QKeyEvent *event); }; -#endif // COINCONTROLTREEWIDGET_H \ No newline at end of file +#endif // BITCOIN_QT_COINCONTROLTREEWIDGET_H diff --git a/src/qt/csvmodelwriter.h b/src/qt/csvmodelwriter.h index 29de251efe..c613ce73eb 100644 --- a/src/qt/csvmodelwriter.h +++ b/src/qt/csvmodelwriter.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef CSVMODELWRITER_H -#define CSVMODELWRITER_H +#ifndef BITCOIN_QT_CSVMODELWRITER_H +#define BITCOIN_QT_CSVMODELWRITER_H #include #include @@ -43,4 +43,4 @@ private: QList columns; }; -#endif // CSVMODELWRITER_H +#endif // BITCOIN_QT_CSVMODELWRITER_H diff --git a/src/qt/editaddressdialog.h b/src/qt/editaddressdialog.h index 6910c667cd..aa1103a2f5 100644 --- a/src/qt/editaddressdialog.h +++ b/src/qt/editaddressdialog.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef EDITADDRESSDIALOG_H -#define EDITADDRESSDIALOG_H +#ifndef BITCOIN_QT_EDITADDRESSDIALOG_H +#define BITCOIN_QT_EDITADDRESSDIALOG_H #include @@ -54,4 +54,4 @@ private: QString address; }; -#endif // EDITADDRESSDIALOG_H +#endif // BITCOIN_QT_EDITADDRESSDIALOG_H diff --git a/src/qt/guiconstants.h b/src/qt/guiconstants.h index 4c8a67b663..f23175049a 100644 --- a/src/qt/guiconstants.h +++ b/src/qt/guiconstants.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef GUICONSTANTS_H -#define GUICONSTANTS_H +#ifndef BITCOIN_QT_GUICONSTANTS_H +#define BITCOIN_QT_GUICONSTANTS_H /* Milliseconds between model updates */ static const int MODEL_UPDATE_DELAY = 250; @@ -52,4 +52,4 @@ static const int MAX_PAYMENT_REQUEST_SIZE = 50000; // bytes #define QAPP_APP_NAME_DEFAULT "Bitcoin-Qt" #define QAPP_APP_NAME_TESTNET "Bitcoin-Qt-testnet" -#endif // GUICONSTANTS_H +#endif // BITCOIN_QT_GUICONSTANTS_H diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 0939c78f64..5666744bd3 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef GUIUTIL_H -#define GUIUTIL_H +#ifndef BITCOIN_QT_GUIUTIL_H +#define BITCOIN_QT_GUIUTIL_H #include "amount.h" @@ -188,4 +188,4 @@ namespace GUIUtil QString formatPingTime(double dPingTime); } // namespace GUIUtil -#endif // GUIUTIL_H +#endif // BITCOIN_QT_GUIUTIL_H diff --git a/src/qt/intro.h b/src/qt/intro.h index e3e396d369..c9c0d448fa 100644 --- a/src/qt/intro.h +++ b/src/qt/intro.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef INTRO_H -#define INTRO_H +#ifndef BITCOIN_QT_INTRO_H +#define BITCOIN_QT_INTRO_H #include #include @@ -70,4 +70,4 @@ private: friend class FreespaceChecker; }; -#endif // INTRO_H +#endif // BITCOIN_QT_INTRO_H diff --git a/src/qt/macdockiconhandler.h b/src/qt/macdockiconhandler.h index b21a61cb07..1ffab75c9a 100644 --- a/src/qt/macdockiconhandler.h +++ b/src/qt/macdockiconhandler.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef MACDOCKICONHANDLER_H -#define MACDOCKICONHANDLER_H +#ifndef BITCOIN_QT_MACDOCKICONHANDLER_H +#define BITCOIN_QT_MACDOCKICONHANDLER_H #include #include @@ -48,4 +48,4 @@ private: QMainWindow *mainWindow; }; -#endif // MACDOCKICONCLICKHANDLER_H +#endif // BITCOIN_QT_MACDOCKICONHANDLER_H diff --git a/src/qt/macnotificationhandler.h b/src/qt/macnotificationhandler.h index bc335edede..f7a4cb7f5b 100644 --- a/src/qt/macnotificationhandler.h +++ b/src/qt/macnotificationhandler.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef MACNOTIFICATIONHANDLER_H -#define MACNOTIFICATIONHANDLER_H +#ifndef BITCOIN_QT_MACNOTIFICATIONHANDLER_H +#define BITCOIN_QT_MACNOTIFICATIONHANDLER_H #include @@ -27,4 +27,4 @@ public: }; -#endif // MACNOTIFICATIONHANDLER_H +#endif // BITCOIN_QT_MACNOTIFICATIONHANDLER_H diff --git a/src/qt/networkstyle.h b/src/qt/networkstyle.h index 99304d61a3..e49b86c950 100644 --- a/src/qt/networkstyle.h +++ b/src/qt/networkstyle.h @@ -2,8 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef H_NETWORKSTYLE -#define H_NETWORKSTYLE +#ifndef BITCOIN_QT_NETWORKSTYLE_H +#define BITCOIN_QT_NETWORKSTYLE_H #include #include @@ -30,4 +30,4 @@ private: QPixmap splashImage; }; -#endif // H_NETWORKSTYLE +#endif // BITCOIN_QT_NETWORKSTYLE_H diff --git a/src/qt/notificator.h b/src/qt/notificator.h index 3395e64350..61c27e7ff8 100644 --- a/src/qt/notificator.h +++ b/src/qt/notificator.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef NOTIFICATOR_H -#define NOTIFICATOR_H +#ifndef BITCOIN_QT_NOTIFICATOR_H +#define BITCOIN_QT_NOTIFICATOR_H #if defined(HAVE_CONFIG_H) #include "config/bitcoin-config.h" @@ -77,4 +77,4 @@ private: #endif }; -#endif // NOTIFICATOR_H +#endif // BITCOIN_QT_NOTIFICATOR_H diff --git a/src/qt/openuridialog.h b/src/qt/openuridialog.h index 67a5f167d1..f04ec71b32 100644 --- a/src/qt/openuridialog.h +++ b/src/qt/openuridialog.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef OPENURIDIALOG_H -#define OPENURIDIALOG_H +#ifndef BITCOIN_QT_OPENURIDIALOG_H +#define BITCOIN_QT_OPENURIDIALOG_H #include @@ -31,4 +31,4 @@ private: Ui::OpenURIDialog *ui; }; -#endif // OPENURIDIALOG_H +#endif // BITCOIN_QT_OPENURIDIALOG_H diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h index 2abd92cae5..108609610d 100644 --- a/src/qt/optionsdialog.h +++ b/src/qt/optionsdialog.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef OPTIONSDIALOG_H -#define OPTIONSDIALOG_H +#ifndef BITCOIN_QT_OPTIONSDIALOG_H +#define BITCOIN_QT_OPTIONSDIALOG_H #include @@ -59,4 +59,4 @@ private: bool fProxyIpValid; }; -#endif // OPTIONSDIALOG_H +#endif // BITCOIN_QT_OPTIONSDIALOG_H diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 42ea3bf8e5..e2dc067edb 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef OPTIONSMODEL_H -#define OPTIONSMODEL_H +#ifndef BITCOIN_QT_OPTIONSMODEL_H +#define BITCOIN_QT_OPTIONSMODEL_H #include "amount.h" @@ -88,4 +88,4 @@ signals: void coinControlFeaturesChanged(bool); }; -#endif // OPTIONSMODEL_H +#endif // BITCOIN_QT_OPTIONSMODEL_H diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h index 03f239008f..e889eae8be 100644 --- a/src/qt/overviewpage.h +++ b/src/qt/overviewpage.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef OVERVIEWPAGE_H -#define OVERVIEWPAGE_H +#ifndef BITCOIN_QT_OVERVIEWPAGE_H +#define BITCOIN_QT_OVERVIEWPAGE_H #include "amount.h" @@ -63,4 +63,4 @@ private slots: void updateWatchOnlyLabels(bool showWatchOnly); }; -#endif // OVERVIEWPAGE_H +#endif // BITCOIN_QT_OVERVIEWPAGE_H diff --git a/src/qt/paymentrequestplus.h b/src/qt/paymentrequestplus.h index 3d94d93269..91c704c520 100644 --- a/src/qt/paymentrequestplus.h +++ b/src/qt/paymentrequestplus.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef PAYMENTREQUESTPLUS_H -#define PAYMENTREQUESTPLUS_H +#ifndef BITCOIN_QT_PAYMENTREQUESTPLUS_H +#define BITCOIN_QT_PAYMENTREQUESTPLUS_H #include "paymentrequest.pb.h" @@ -42,5 +42,4 @@ private: payments::PaymentDetails details; }; -#endif // PAYMENTREQUESTPLUS_H - +#endif // BITCOIN_QT_PAYMENTREQUESTPLUS_H diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h index d84d09c57d..25b08cde49 100644 --- a/src/qt/paymentserver.h +++ b/src/qt/paymentserver.h @@ -2,8 +2,9 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef PAYMENTSERVER_H -#define PAYMENTSERVER_H +#ifndef BITCOIN_QT_PAYMENTSERVER_H +#define BITCOIN_QT_PAYMENTSERVER_H + // This class handles payment requests from clicking on // bitcoin: URIs // @@ -135,4 +136,4 @@ private: OptionsModel *optionsModel; }; -#endif // PAYMENTSERVER_H +#endif // BITCOIN_QT_PAYMENTSERVER_H diff --git a/src/qt/peertablemodel.h b/src/qt/peertablemodel.h index 38f2662f89..23e71fc685 100644 --- a/src/qt/peertablemodel.h +++ b/src/qt/peertablemodel.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef PEERTABLEMODEL_H -#define PEERTABLEMODEL_H +#ifndef BITCOIN_QT_PEERTABLEMODEL_H +#define BITCOIN_QT_PEERTABLEMODEL_H #include "main.h" #include "net.h" @@ -78,4 +78,4 @@ private: QTimer *timer; }; -#endif // PEERTABLEMODEL_H +#endif // BITCOIN_QT_PEERTABLEMODEL_H diff --git a/src/qt/qvalidatedlineedit.h b/src/qt/qvalidatedlineedit.h index c2a4817e65..0996164b0f 100644 --- a/src/qt/qvalidatedlineedit.h +++ b/src/qt/qvalidatedlineedit.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef QVALIDATEDLINEEDIT_H -#define QVALIDATEDLINEEDIT_H +#ifndef BITCOIN_QT_QVALIDATEDLINEEDIT_H +#define BITCOIN_QT_QVALIDATEDLINEEDIT_H #include @@ -36,4 +36,4 @@ private slots: void checkValidity(); }; -#endif // QVALIDATEDLINEEDIT_H +#endif // BITCOIN_QT_QVALIDATEDLINEEDIT_H diff --git a/src/qt/qvaluecombobox.h b/src/qt/qvaluecombobox.h index 5f2182913c..821f41716b 100644 --- a/src/qt/qvaluecombobox.h +++ b/src/qt/qvaluecombobox.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef QVALUECOMBOBOX_H -#define QVALUECOMBOBOX_H +#ifndef BITCOIN_QT_QVALUECOMBOBOX_H +#define BITCOIN_QT_QVALUECOMBOBOX_H #include #include @@ -34,4 +34,4 @@ private slots: void handleSelectionChanged(int idx); }; -#endif // QVALUECOMBOBOX_H +#endif // BITCOIN_QT_QVALUECOMBOBOX_H diff --git a/src/qt/receivecoinsdialog.h b/src/qt/receivecoinsdialog.h index 7a7e38e25e..220fb5c7a8 100644 --- a/src/qt/receivecoinsdialog.h +++ b/src/qt/receivecoinsdialog.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef RECEIVECOINSDIALOG_H -#define RECEIVECOINSDIALOG_H +#ifndef BITCOIN_QT_RECEIVECOINSDIALOG_H +#define BITCOIN_QT_RECEIVECOINSDIALOG_H #include "guiutil.h" @@ -73,4 +73,4 @@ private slots: void copyAmount(); }; -#endif // RECEIVECOINSDIALOG_H +#endif // BITCOIN_QT_RECEIVECOINSDIALOG_H diff --git a/src/qt/receiverequestdialog.h b/src/qt/receiverequestdialog.h index 9b78e495c3..6f3b9838e2 100644 --- a/src/qt/receiverequestdialog.h +++ b/src/qt/receiverequestdialog.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef QRCODEDIALOG_H -#define QRCODEDIALOG_H +#ifndef BITCOIN_QT_RECEIVEREQUESTDIALOG_H +#define BITCOIN_QT_RECEIVEREQUESTDIALOG_H #include "walletmodel.h" @@ -67,4 +67,4 @@ private: SendCoinsRecipient info; }; -#endif // QRCODEDIALOG_H +#endif // BITCOIN_QT_RECEIVEREQUESTDIALOG_H diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h index 3df5971823..ec6a49070d 100644 --- a/src/qt/recentrequeststablemodel.h +++ b/src/qt/recentrequeststablemodel.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef RECENTREQUESTSTABLEMODEL_H -#define RECENTREQUESTSTABLEMODEL_H +#ifndef BITCOIN_QT_RECENTREQUESTSTABLEMODEL_H +#define BITCOIN_QT_RECENTREQUESTSTABLEMODEL_H #include "walletmodel.h" @@ -105,4 +105,4 @@ private: QString getAmountTitle(); }; -#endif +#endif // BITCOIN_QT_RECENTREQUESTSTABLEMODEL_H diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 1ffff92758..4bb9b62e93 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef RPCCONSOLE_H -#define RPCCONSOLE_H +#ifndef BITCOIN_QT_RPCCONSOLE_H +#define BITCOIN_QT_RPCCONSOLE_H #include "guiutil.h" #include "peertablemodel.h" @@ -100,4 +100,4 @@ private: NodeId cachedNodeid; }; -#endif // RPCCONSOLE_H +#endif // BITCOIN_QT_RPCCONSOLE_H diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h index 74cc4bde56..eec661cbd0 100644 --- a/src/qt/sendcoinsdialog.h +++ b/src/qt/sendcoinsdialog.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef SENDCOINSDIALOG_H -#define SENDCOINSDIALOG_H +#ifndef BITCOIN_QT_SENDCOINSDIALOG_H +#define BITCOIN_QT_SENDCOINSDIALOG_H #include "walletmodel.h" @@ -83,4 +83,4 @@ signals: void message(const QString &title, const QString &message, unsigned int style); }; -#endif // SENDCOINSDIALOG_H +#endif // BITCOIN_QT_SENDCOINSDIALOG_H diff --git a/src/qt/sendcoinsentry.h b/src/qt/sendcoinsentry.h index 2b696c77fb..69ad1032df 100644 --- a/src/qt/sendcoinsentry.h +++ b/src/qt/sendcoinsentry.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef SENDCOINSENTRY_H -#define SENDCOINSENTRY_H +#ifndef BITCOIN_QT_SENDCOINSENTRY_H +#define BITCOIN_QT_SENDCOINSENTRY_H #include "walletmodel.h" @@ -67,4 +67,4 @@ private: bool updateLabel(const QString &address); }; -#endif // SENDCOINSENTRY_H +#endif // BITCOIN_QT_SENDCOINSENTRY_H diff --git a/src/qt/signverifymessagedialog.h b/src/qt/signverifymessagedialog.h index bba861649a..36550edc8d 100644 --- a/src/qt/signverifymessagedialog.h +++ b/src/qt/signverifymessagedialog.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef SIGNVERIFYMESSAGEDIALOG_H -#define SIGNVERIFYMESSAGEDIALOG_H +#ifndef BITCOIN_QT_SIGNVERIFYMESSAGEDIALOG_H +#define BITCOIN_QT_SIGNVERIFYMESSAGEDIALOG_H #include @@ -48,4 +48,4 @@ private slots: void on_clearButton_VM_clicked(); }; -#endif // SIGNVERIFYMESSAGEDIALOG_H +#endif // BITCOIN_QT_SIGNVERIFYMESSAGEDIALOG_H diff --git a/src/qt/splashscreen.h b/src/qt/splashscreen.h index 128edadbee..4d9651f022 100644 --- a/src/qt/splashscreen.h +++ b/src/qt/splashscreen.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef SPLASHSCREEN_H -#define SPLASHSCREEN_H +#ifndef BITCOIN_QT_SPLASHSCREEN_H +#define BITCOIN_QT_SPLASHSCREEN_H #include @@ -46,4 +46,4 @@ private: int curAlignment; }; -#endif // SPLASHSCREEN_H +#endif // BITCOIN_QT_SPLASHSCREEN_H diff --git a/src/qt/test/paymentservertests.h b/src/qt/test/paymentservertests.h index 9b6400b0d5..0717111f66 100644 --- a/src/qt/test/paymentservertests.h +++ b/src/qt/test/paymentservertests.h @@ -2,8 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef PAYMENTSERVERTESTS_H -#define PAYMENTSERVERTESTS_H +#ifndef BITCOIN_QT_TEST_PAYMENTSERVERTESTS_H +#define BITCOIN_QT_TEST_PAYMENTSERVERTESTS_H #include "../paymentserver.h" @@ -32,4 +32,4 @@ public: SendCoinsRecipient recipient; }; -#endif // PAYMENTSERVERTESTS_H +#endif // BITCOIN_QT_TEST_PAYMENTSERVERTESTS_H diff --git a/src/qt/test/uritests.h b/src/qt/test/uritests.h index 1ea6d9f075..ed30a9f4a7 100644 --- a/src/qt/test/uritests.h +++ b/src/qt/test/uritests.h @@ -2,8 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef URITESTS_H -#define URITESTS_H +#ifndef BITCOIN_QT_TEST_URITESTS_H +#define BITCOIN_QT_TEST_URITESTS_H #include #include @@ -16,4 +16,4 @@ private slots: void uriTests(); }; -#endif // URITESTS_H +#endif // BITCOIN_QT_TEST_URITESTS_H diff --git a/src/qt/trafficgraphwidget.h b/src/qt/trafficgraphwidget.h index efab6e7fc5..50571e0b2d 100644 --- a/src/qt/trafficgraphwidget.h +++ b/src/qt/trafficgraphwidget.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef TRAFFICGRAPHWIDGET_H -#define TRAFFICGRAPHWIDGET_H +#ifndef BITCOIN_QT_TRAFFICGRAPHWIDGET_H +#define BITCOIN_QT_TRAFFICGRAPHWIDGET_H #include #include @@ -45,4 +45,4 @@ private: ClientModel *clientModel; }; -#endif // TRAFFICGRAPHWIDGET_H +#endif // BITCOIN_QT_TRAFFICGRAPHWIDGET_H diff --git a/src/qt/transactiondesc.h b/src/qt/transactiondesc.h index 4bd4293210..fc958a097c 100644 --- a/src/qt/transactiondesc.h +++ b/src/qt/transactiondesc.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef TRANSACTIONDESC_H -#define TRANSACTIONDESC_H +#ifndef BITCOIN_QT_TRANSACTIONDESC_H +#define BITCOIN_QT_TRANSACTIONDESC_H #include #include @@ -28,4 +28,4 @@ private: static QString FormatTxStatus(const CWalletTx& wtx); }; -#endif // TRANSACTIONDESC_H +#endif // BITCOIN_QT_TRANSACTIONDESC_H diff --git a/src/qt/transactiondescdialog.h b/src/qt/transactiondescdialog.h index d4719975b2..c12c18e824 100644 --- a/src/qt/transactiondescdialog.h +++ b/src/qt/transactiondescdialog.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef TRANSACTIONDESCDIALOG_H -#define TRANSACTIONDESCDIALOG_H +#ifndef BITCOIN_QT_TRANSACTIONDESCDIALOG_H +#define BITCOIN_QT_TRANSACTIONDESCDIALOG_H #include @@ -28,4 +28,4 @@ private: Ui::TransactionDescDialog *ui; }; -#endif // TRANSACTIONDESCDIALOG_H +#endif // BITCOIN_QT_TRANSACTIONDESCDIALOG_H diff --git a/src/qt/transactionfilterproxy.h b/src/qt/transactionfilterproxy.h index ca31ee8f87..5836b114ab 100644 --- a/src/qt/transactionfilterproxy.h +++ b/src/qt/transactionfilterproxy.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef TRANSACTIONFILTERPROXY_H -#define TRANSACTIONFILTERPROXY_H +#ifndef BITCOIN_QT_TRANSACTIONFILTERPROXY_H +#define BITCOIN_QT_TRANSACTIONFILTERPROXY_H #include "amount.h" @@ -65,4 +65,4 @@ private: bool showInactive; }; -#endif // TRANSACTIONFILTERPROXY_H +#endif // BITCOIN_QT_TRANSACTIONFILTERPROXY_H diff --git a/src/qt/transactionrecord.h b/src/qt/transactionrecord.h index 9276c9f0af..e26453cda4 100644 --- a/src/qt/transactionrecord.h +++ b/src/qt/transactionrecord.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef TRANSACTIONRECORD_H -#define TRANSACTIONRECORD_H +#ifndef BITCOIN_QT_TRANSACTIONRECORD_H +#define BITCOIN_QT_TRANSACTIONRECORD_H #include "amount.h" #include "uint256.h" @@ -140,4 +140,4 @@ public: bool statusUpdateNeeded(); }; -#endif // TRANSACTIONRECORD_H +#endif // BITCOIN_QT_TRANSACTIONRECORD_H diff --git a/src/qt/transactiontablemodel.h b/src/qt/transactiontablemodel.h index bb517a969c..cfefe4cf19 100644 --- a/src/qt/transactiontablemodel.h +++ b/src/qt/transactiontablemodel.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef TRANSACTIONTABLEMODEL_H -#define TRANSACTIONTABLEMODEL_H +#ifndef BITCOIN_QT_TRANSACTIONTABLEMODEL_H +#define BITCOIN_QT_TRANSACTIONTABLEMODEL_H #include "bitcoinunits.h" @@ -109,4 +109,4 @@ public slots: friend class TransactionTablePriv; }; -#endif // TRANSACTIONTABLEMODEL_H +#endif // BITCOIN_QT_TRANSACTIONTABLEMODEL_H diff --git a/src/qt/transactionview.h b/src/qt/transactionview.h index b249e00411..be6989adee 100644 --- a/src/qt/transactionview.h +++ b/src/qt/transactionview.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef TRANSACTIONVIEW_H -#define TRANSACTIONVIEW_H +#ifndef BITCOIN_QT_TRANSACTIONVIEW_H +#define BITCOIN_QT_TRANSACTIONVIEW_H #include "guiutil.h" @@ -112,4 +112,4 @@ public slots: }; -#endif // TRANSACTIONVIEW_H +#endif // BITCOIN_QT_TRANSACTIONVIEW_H diff --git a/src/qt/utilitydialog.h b/src/qt/utilitydialog.h index ae5045cca9..e10b4dc8af 100644 --- a/src/qt/utilitydialog.h +++ b/src/qt/utilitydialog.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef UTILITYDIALOG_H -#define UTILITYDIALOG_H +#ifndef BITCOIN_QT_UTILITYDIALOG_H +#define BITCOIN_QT_UTILITYDIALOG_H #include #include @@ -49,4 +49,4 @@ protected: void closeEvent(QCloseEvent *event); }; -#endif // UTILITYDIALOG_H +#endif // BITCOIN_QT_UTILITYDIALOG_H diff --git a/src/qt/walletframe.h b/src/qt/walletframe.h index f1830a0d6b..ae8592840d 100644 --- a/src/qt/walletframe.h +++ b/src/qt/walletframe.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef WALLETFRAME_H -#define WALLETFRAME_H +#ifndef BITCOIN_QT_WALLETFRAME_H +#define BITCOIN_QT_WALLETFRAME_H #include #include @@ -77,4 +77,4 @@ public slots: void usedReceivingAddresses(); }; -#endif // WALLETFRAME_H +#endif // BITCOIN_QT_WALLETFRAME_H diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index fe91e9d9fa..0c6077963d 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef WALLETMODEL_H -#define WALLETMODEL_H +#ifndef BITCOIN_QT_WALLETMODEL_H +#define BITCOIN_QT_WALLETMODEL_H #include "paymentrequestplus.h" #include "walletmodeltransaction.h" @@ -261,4 +261,4 @@ public slots: void pollBalanceChanged(); }; -#endif // WALLETMODEL_H +#endif // BITCOIN_QT_WALLETMODEL_H diff --git a/src/qt/walletmodeltransaction.h b/src/qt/walletmodeltransaction.h index 4eadfbe4d1..a880384ed6 100644 --- a/src/qt/walletmodeltransaction.h +++ b/src/qt/walletmodeltransaction.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef WALLETMODELTRANSACTION_H -#define WALLETMODELTRANSACTION_H +#ifndef BITCOIN_QT_WALLETMODELTRANSACTION_H +#define BITCOIN_QT_WALLETMODELTRANSACTION_H #include "walletmodel.h" @@ -41,4 +41,4 @@ private: CAmount fee; }; -#endif // WALLETMODELTRANSACTION_H +#endif // BITCOIN_QT_WALLETMODELTRANSACTION_H diff --git a/src/qt/walletview.h b/src/qt/walletview.h index cafba517fd..95890ccd67 100644 --- a/src/qt/walletview.h +++ b/src/qt/walletview.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef WALLETVIEW_H -#define WALLETVIEW_H +#ifndef BITCOIN_QT_WALLETVIEW_H +#define BITCOIN_QT_WALLETVIEW_H #include "amount.h" @@ -116,4 +116,4 @@ signals: void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address); }; -#endif // WALLETVIEW_H +#endif // BITCOIN_QT_WALLETVIEW_H diff --git a/src/qt/winshutdownmonitor.h b/src/qt/winshutdownmonitor.h index 4c76d2c816..26f5d80361 100644 --- a/src/qt/winshutdownmonitor.h +++ b/src/qt/winshutdownmonitor.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef WINSHUTDOWNMONITOR_H -#define WINSHUTDOWNMONITOR_H +#ifndef BITCOIN_QT_WINSHUTDOWNMONITOR_H +#define BITCOIN_QT_WINSHUTDOWNMONITOR_H #ifdef WIN32 #include @@ -26,4 +26,4 @@ public: #endif #endif -#endif // WINSHUTDOWNMONITOR_H +#endif // BITCOIN_QT_WINSHUTDOWNMONITOR_H diff --git a/src/rpcclient.h b/src/rpcclient.h index 307aa2aab8..cd11f177e8 100644 --- a/src/rpcclient.h +++ b/src/rpcclient.h @@ -3,8 +3,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef _BITCOINRPC_CLIENT_H_ -#define _BITCOINRPC_CLIENT_H_ +#ifndef BITCOIN_RPCCLIENT_H +#define BITCOIN_RPCCLIENT_H #include "json/json_spirit_reader_template.h" #include "json/json_spirit_utils.h" @@ -12,4 +12,4 @@ json_spirit::Array RPCConvertValues(const std::string& strMethod, const std::vector& strParams); -#endif // _BITCOINRPC_CLIENT_H_ +#endif // BITCOIN_RPCCLIENT_H diff --git a/src/rpcprotocol.h b/src/rpcprotocol.h index 9117248506..9926daaf3d 100644 --- a/src/rpcprotocol.h +++ b/src/rpcprotocol.h @@ -3,8 +3,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef _BITCOINRPC_PROTOCOL_H_ -#define _BITCOINRPC_PROTOCOL_H_ +#ifndef BITCOIN_RPCPROTOCOL_H +#define BITCOIN_RPCPROTOCOL_H #include #include @@ -164,4 +164,4 @@ json_spirit::Object JSONRPCReplyObj(const json_spirit::Value& result, const json std::string JSONRPCReply(const json_spirit::Value& result, const json_spirit::Value& error, const json_spirit::Value& id); json_spirit::Object JSONRPCError(int code, const std::string& message); -#endif // _BITCOINRPC_PROTOCOL_H_ +#endif // BITCOIN_RPCPROTOCOL_H diff --git a/src/rpcserver.h b/src/rpcserver.h index dc46637399..2f34b11d22 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -3,8 +3,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef _BITCOINRPC_SERVER_H_ -#define _BITCOINRPC_SERVER_H_ +#ifndef BITCOIN_RPCSERVER_H +#define BITCOIN_RPCSERVER_H #include "amount.h" #include "rpcprotocol.h" @@ -211,4 +211,4 @@ extern json_spirit::Value gettxout(const json_spirit::Array& params, bool fHelp) extern json_spirit::Value verifychain(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getchaintips(const json_spirit::Array& params, bool fHelp); -#endif // _BITCOINRPC_SERVER_H_ +#endif // BITCOIN_RPCSERVER_H diff --git a/src/script/interpreter.h b/src/script/interpreter.h index 5133c80aab..ed899fc411 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -3,8 +3,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef H_BITCOIN_SCRIPT_INTERPRETER -#define H_BITCOIN_SCRIPT_INTERPRETER +#ifndef BITCOIN_SCRIPT_INTERPRETER_H +#define BITCOIN_SCRIPT_INTERPRETER_H #include #include @@ -88,4 +88,4 @@ public: bool EvalScript(std::vector >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker); bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigned int flags, const BaseSignatureChecker& checker); -#endif // H_BITCOIN_SCRIPT_INTERPRETER +#endif // BITCOIN_SCRIPT_INTERPRETER_H diff --git a/src/script/script.h b/src/script/script.h index 05f2e7e3a9..e525ad13ee 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -3,8 +3,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef H_BITCOIN_SCRIPT -#define H_BITCOIN_SCRIPT +#ifndef BITCOIN_SCRIPT_SCRIPT_H +#define BITCOIN_SCRIPT_SCRIPT_H #include #include @@ -592,4 +592,4 @@ public: } }; -#endif // H_BITCOIN_SCRIPT +#endif // BITCOIN_SCRIPT_SCRIPT_H diff --git a/src/script/sigcache.h b/src/script/sigcache.h index 46b8f4d335..df2a2ea13c 100644 --- a/src/script/sigcache.h +++ b/src/script/sigcache.h @@ -3,8 +3,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef H_BITCOIN_SCRIPT_SIGCACHE -#define H_BITCOIN_SCRIPT_SIGCACHE +#ifndef BITCOIN_SCRIPT_SIGCACHE_H +#define BITCOIN_SCRIPT_SIGCACHE_H #include "script/interpreter.h" @@ -23,4 +23,4 @@ public: bool VerifySignature(const std::vector& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const; }; -#endif // H_BITCOIN_SCRIPT_SIGCACHE +#endif // BITCOIN_SCRIPT_SIGCACHE_H diff --git a/src/script/sign.h b/src/script/sign.h index f218a64562..c84d3f9a94 100644 --- a/src/script/sign.h +++ b/src/script/sign.h @@ -3,8 +3,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef H_BITCOIN_SCRIPT_SIGN -#define H_BITCOIN_SCRIPT_SIGN +#ifndef BITCOIN_SCRIPT_SIGN_H +#define BITCOIN_SCRIPT_SIGN_H #include "script/interpreter.h" @@ -21,4 +21,4 @@ bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CMutab // combine them intelligently and return the result. CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2); -#endif // H_BITCOIN_SCRIPT_SIGN +#endif // BITCOIN_SCRIPT_SIGN_H diff --git a/src/script/standard.h b/src/script/standard.h index 504d98c686..495a19de2f 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -3,8 +3,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef H_BITCOIN_SCRIPT_STANDARD -#define H_BITCOIN_SCRIPT_STANDARD +#ifndef BITCOIN_SCRIPT_STANDARD_H +#define BITCOIN_SCRIPT_STANDARD_H #include "key.h" #include "script/script.h" @@ -84,4 +84,4 @@ bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std:: CScript GetScriptForDestination(const CTxDestination& dest); CScript GetScriptForMultisig(int nRequired, const std::vector& keys); -#endif // H_BITCOIN_SCRIPT_STANDARD +#endif // BITCOIN_SCRIPT_STANDARD_H diff --git a/src/test/bignum.h b/src/test/bignum.h index 86980b2af6..f64c987202 100644 --- a/src/test/bignum.h +++ b/src/test/bignum.h @@ -3,8 +3,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_BIGNUM_H -#define BITCOIN_BIGNUM_H +#ifndef BITCOIN_TEST_BIGNUM_H +#define BITCOIN_TEST_BIGNUM_H #include #include @@ -177,4 +177,4 @@ inline bool operator>=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, inline bool operator<(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) < 0); } inline bool operator>(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) > 0); } -#endif +#endif // BITCOIN_TEST_BIGNUM_H diff --git a/src/txdb.h b/src/txdb.h index 8f2bd9af4d..147c186990 100644 --- a/src/txdb.h +++ b/src/txdb.h @@ -3,8 +3,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_TXDB_LEVELDB_H -#define BITCOIN_TXDB_LEVELDB_H +#ifndef BITCOIN_TXDB_H +#define BITCOIN_TXDB_H #include "leveldbwrapper.h" #include "main.h" @@ -62,4 +62,4 @@ public: bool LoadBlockIndexGuts(); }; -#endif // BITCOIN_TXDB_LEVELDB_H +#endif // BITCOIN_TXDB_H diff --git a/src/undo.h b/src/undo.h index 232c193429..4f5f4047dd 100644 --- a/src/undo.h +++ b/src/undo.h @@ -3,8 +3,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef H_BITCOIN_TXUNDO -#define H_BITCOIN_TXUNDO +#ifndef BITCOIN_UNDO_H +#define BITCOIN_UNDO_H #include "compressor.h" #include "core/transaction.h" @@ -68,4 +68,4 @@ public: } }; -#endif // H_BITCOIN_TXUNDO +#endif // BITCOIN_UNDO_H diff --git a/src/univalue/gen.cpp b/src/univalue/gen.cpp index 881948f46e..f0b352eef0 100644 --- a/src/univalue/gen.cpp +++ b/src/univalue/gen.cpp @@ -35,8 +35,8 @@ static void initJsonEscape() static void outputEscape() { printf( "// Automatically generated file. Do not modify.\n" - "#ifndef __UNIVALUE_ESCAPES_H__\n" - "#define __UNIVALUE_ESCAPES_H__\n" + "#ifndef BITCOIN_UNIVALUE_UNIVALUE_ESCAPES_H\n" + "#define BITCOIN_UNIVALUE_UNIVALUE_ESCAPES_H\n" "static const char *escapes[256] = {\n"); for (unsigned int i = 0; i < 256; i++) { @@ -66,7 +66,7 @@ static void outputEscape() } printf( "};\n" - "#endif // __UNIVALUE_ESCAPES_H__\n"); + "#endif // BITCOIN_UNIVALUE_UNIVALUE_ESCAPES_H\n"); } int main (int argc, char *argv[]) diff --git a/src/univalue/univalue.h b/src/univalue/univalue.h index 0a7bf3cceb..5ac301d9e5 100644 --- a/src/univalue/univalue.h +++ b/src/univalue/univalue.h @@ -2,8 +2,8 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef __UNIVALUE_H__ -#define __UNIVALUE_H__ +#ifndef BITCOIN_UNIVALUE_UNIVALUE_H +#define BITCOIN_UNIVALUE_UNIVALUE_H #include #include @@ -152,4 +152,4 @@ extern enum jtokentype getJsonToken(std::string& tokenVal, unsigned int& consumed, const char *raw); extern const char *uvTypeName(UniValue::VType t); -#endif // __UNIVALUE_H__ +#endif // BITCOIN_UNIVALUE_UNIVALUE_H diff --git a/src/univalue/univalue_escapes.h b/src/univalue/univalue_escapes.h index 1d3a70a968..0514118285 100644 --- a/src/univalue/univalue_escapes.h +++ b/src/univalue/univalue_escapes.h @@ -1,6 +1,6 @@ // Automatically generated file. Do not modify. -#ifndef __UNIVALUE_ESCAPES_H__ -#define __UNIVALUE_ESCAPES_H__ +#ifndef BITCOIN_UNIVALUE_UNIVALUE_ESCAPES_H +#define BITCOIN_UNIVALUE_UNIVALUE_ESCAPES_H static const char *escapes[256] = { NULL, NULL, @@ -259,4 +259,4 @@ static const char *escapes[256] = { NULL, NULL, }; -#endif // __UNIVALUE_ESCAPES_H__ +#endif // BITCOIN_UNIVALUE_UNIVALUE_ESCAPES_H diff --git a/src/wallet_ismine.h b/src/wallet_ismine.h index f326b86815..5f0c0c1a01 100644 --- a/src/wallet_ismine.h +++ b/src/wallet_ismine.h @@ -3,8 +3,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef H_BITCOIN_WALLET_ISMINE -#define H_BITCOIN_WALLET_ISMINE +#ifndef BITCOIN_WALLET_ISMINE_H +#define BITCOIN_WALLET_ISMINE_H #include "key.h" #include "script/standard.h" @@ -26,4 +26,4 @@ typedef uint8_t isminefilter; isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey); isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest); -#endif // H_BITCOIN_WALLET_ISMINE +#endif // BITCOIN_WALLET_ISMINE_H From 0d91ae308c5dea9c8e6ac600b94c9c9b53b92b61 Mon Sep 17 00:00:00 2001 From: mruddy Date: Tue, 4 Nov 2014 07:24:47 -0500 Subject: [PATCH 0974/1288] The first thing that SelectParams does is call SelectBaseParams. Therefore, we do not need to call SelectBaseParams immediately prior to calling SelectParams. --- src/chainparams.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 9ffc369b40..e539eb7bd7 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -369,7 +369,6 @@ bool SelectParamsFromCommandLine() if (network == CBaseChainParams::MAX_NETWORK_TYPES) return false; - SelectBaseParams(network); SelectParams(network); return true; } From b4347f60352a7134f95a0f35e74607a167090516 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 4 Nov 2014 14:34:04 +0100 Subject: [PATCH 0975/1288] minor code style cleanup after recent merges - add a missing license header - correct some header orderings etc. --- src/alert.cpp | 4 ++-- src/crypter.h | 4 ++-- src/eccryptoverify.cpp | 5 +++++ src/eccryptoverify.h | 12 +++++++----- src/ecwrapper.h | 2 +- src/hash.h | 3 ++- src/key.h | 2 +- src/leveldbwrapper.cpp | 3 ++- src/pubkey.cpp | 2 +- src/pubkey.h | 4 ++-- src/script/standard.h | 4 ++-- 11 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/alert.cpp b/src/alert.cpp index ce8dfbf507..64399a4260 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -1,14 +1,14 @@ // Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "alert.h" #include "chainparams.h" #include "clientversion.h" -#include "pubkey.h" #include "net.h" +#include "pubkey.h" #include "timedata.h" #include "ui_interface.h" #include "util.h" diff --git a/src/crypter.h b/src/crypter.h index 4d486c4313..b589987c4f 100644 --- a/src/crypter.h +++ b/src/crypter.h @@ -1,13 +1,13 @@ // Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CRYPTER_H #define BITCOIN_CRYPTER_H #include "allocators.h" -#include "serialize.h" #include "keystore.h" +#include "serialize.h" class uint256; diff --git a/src/eccryptoverify.cpp b/src/eccryptoverify.cpp index 0a904f44ba..435154d608 100644 --- a/src/eccryptoverify.cpp +++ b/src/eccryptoverify.cpp @@ -1,3 +1,8 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "eccryptoverify.h" namespace { diff --git a/src/eccryptoverify.h b/src/eccryptoverify.h index 7740e31db1..da7e80c7c3 100644 --- a/src/eccryptoverify.h +++ b/src/eccryptoverify.h @@ -1,13 +1,14 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_EC_CRYPTO_VERIFY_H -#define BITCOIN_EC_CRYPTO_VERIFY_H +#ifndef BITCOIN_ECCRYPTOVERIFY_H +#define BITCOIN_ECCRYPTOVERIFY_H #include #include + class uint256; namespace eccrypto { @@ -16,4 +17,5 @@ bool Check(const unsigned char *vch); bool CheckSignatureElement(const unsigned char *vch, int len, bool half); } // eccrypto namespace -#endif + +#endif // BITCOIN_ECCRYPTOVERIFY_H diff --git a/src/ecwrapper.h b/src/ecwrapper.h index 52e9e5dab0..3457ca5f5a 100644 --- a/src/ecwrapper.h +++ b/src/ecwrapper.h @@ -43,4 +43,4 @@ public: static bool SanityCheck(); }; -#endif // BITCOIN_EC_WRAPPER_H +#endif // BITCOIN_ECWRAPPER_H diff --git a/src/hash.h b/src/hash.h index 53a7672a8f..75695160e6 100644 --- a/src/hash.h +++ b/src/hash.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_HASH_H @@ -160,4 +160,5 @@ uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=PROTOCOL unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector& vDataToHash); void BIP32Hash(const unsigned char chainCode[32], unsigned int nChild, unsigned char header, const unsigned char data[32], unsigned char output[64]); + #endif // BITCOIN_HASH_H diff --git a/src/key.h b/src/key.h index b35cf0cad5..8c2f44801d 100644 --- a/src/key.h +++ b/src/key.h @@ -13,8 +13,8 @@ #include #include -class CPubKey; class CExtPubKey; +class CPubKey; /** * secp256k1: diff --git a/src/leveldbwrapper.cpp b/src/leveldbwrapper.cpp index 8ce3e7b470..70980fede5 100644 --- a/src/leveldbwrapper.cpp +++ b/src/leveldbwrapper.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2012-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "leveldbwrapper.h" @@ -7,6 +7,7 @@ #include "util.h" #include + #include #include #include diff --git a/src/pubkey.cpp b/src/pubkey.cpp index 3f16a4b4be..9c6f536f21 100644 --- a/src/pubkey.cpp +++ b/src/pubkey.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "pubkey.h" diff --git a/src/pubkey.h b/src/pubkey.h index ccf9673453..37351cff0e 100644 --- a/src/pubkey.h +++ b/src/pubkey.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_PUBKEY_H diff --git a/src/script/standard.h b/src/script/standard.h index faa7747604..55a27881aa 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -6,15 +6,15 @@ #ifndef BITCOIN_SCRIPT_STANDARD_H #define BITCOIN_SCRIPT_STANDARD_H -#include "uint256.h" #include "script/interpreter.h" +#include "uint256.h" #include #include -class CScript; class CKeyID; +class CScript; /** A reference to a CScript: the Hash160 of its serialization (see script.h) */ class CScriptID : public uint160 From 70d80cc7bf89211a5aa157cb624fff3b7097c48e Mon Sep 17 00:00:00 2001 From: Francis GASCHET Date: Mon, 3 Nov 2014 11:14:57 +0100 Subject: [PATCH 0976/1288] build: Fix "too many arguments" error Closes #5141 --- share/genbuild.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/genbuild.sh b/share/genbuild.sh index 679566e596..ffa89ca6e4 100755 --- a/share/genbuild.sh +++ b/share/genbuild.sh @@ -16,7 +16,7 @@ fi DESC="" SUFFIX="" LAST_COMMIT_DATE="" -if [ -e "$(which git 2>/dev/null)" -a $(git rev-parse --is-inside-work-tree 2>/dev/null) = "true" ]; then +if [ -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then # clean 'dirty' status of touched files that haven't been modified git diff >/dev/null 2>/dev/null From af82884ab7c485c8b4c5ac93c308127c39c196be Mon Sep 17 00:00:00 2001 From: Daniel Kraft Date: Wed, 29 Oct 2014 18:08:31 +0100 Subject: [PATCH 0977/1288] Add "warmup mode" for RPC server. Start the RPC server before doing all the (expensive) startup initialisations like loading the block index. Until the node is ready, return all calls immediately with a new error signalling "in warmup" with an appropriate status message (similar to the init message). This is useful for RPC clients to know that the server is there (e. g., they don't have to start it) but not yet available. It is used in Namecoin and Huntercoin already for some time, and there exists a UI hooked onto the RPC interface that actively uses this to its advantage. --- doc/release-notes.md | 11 ++++++ src/bitcoin-cli.cpp | 81 +++++++++++++++++++++++++++++--------------- src/init.cpp | 14 ++++++-- src/rpcprotocol.h | 1 + src/rpcserver.cpp | 24 +++++++++++++ src/rpcserver.h | 7 ++++ 6 files changed, 108 insertions(+), 30 deletions(-) diff --git a/doc/release-notes.md b/doc/release-notes.md index 169ad71a0f..6aaea67790 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -84,3 +84,14 @@ Using wildcards will result in the rule being rejected with the following error Error: Invalid -rpcallowip subnet specification: *. Valid are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). +RPC Server "Warm-Up" Mode +========================= + +The RPC server is started earlier now, before most of the expensive +intialisations like loading the block index. It is available now almost +immediately after starting the process. However, until all initialisations +are done, it always returns an immediate error with code -28 to all calls. + +This new behaviour can be useful for clients to know that a server is already +started and will be available soon (for instance, so that they do not +have to start it themselves). diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 38fbc29faf..11840e62a8 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -46,6 +46,21 @@ std::string HelpMessageCli() // // Start // + +// +// Exception thrown on connection error. This error is used to determine +// when to wait if -rpcwait is given. +// +class CConnectionFailed : public std::runtime_error +{ +public: + + explicit inline CConnectionFailed(const std::string& msg) : + std::runtime_error(msg) + {} + +}; + static bool AppInitRPC(int argc, char* argv[]) { // @@ -101,15 +116,9 @@ Object CallRPC(const string& strMethod, const Array& params) SSLIOStreamDevice d(sslStream, fUseSSL); iostreams::stream< SSLIOStreamDevice > stream(d); - bool fWait = GetBoolArg("-rpcwait", false); // -rpcwait means try until server has started - do { - bool fConnected = d.connect(GetArg("-rpcconnect", "127.0.0.1"), GetArg("-rpcport", itostr(BaseParams().RPCPort()))); - if (fConnected) break; - if (fWait) - MilliSleep(1000); - else - throw runtime_error("couldn't connect to server"); - } while (fWait); + const bool fConnected = d.connect(GetArg("-rpcconnect", "127.0.0.1"), GetArg("-rpcport", itostr(BaseParams().RPCPort()))); + if (!fConnected) + throw CConnectionFailed("couldn't connect to server"); // HTTP basic authentication string strUserPass64 = EncodeBase64(mapArgs["-rpcuser"] + ":" + mapArgs["-rpcpassword"]); @@ -168,27 +177,43 @@ int CommandLineRPC(int argc, char *argv[]) std::vector strParams(&argv[2], &argv[argc]); Array params = RPCConvertValues(strMethod, strParams); - // Execute - Object reply = CallRPC(strMethod, params); + // Execute and handle connection failures with -rpcwait + const bool fWait = GetBoolArg("-rpcwait", false); + do { + try { + const Object reply = CallRPC(strMethod, params); - // Parse reply - const Value& result = find_value(reply, "result"); - const Value& error = find_value(reply, "error"); + // Parse reply + const Value& result = find_value(reply, "result"); + const Value& error = find_value(reply, "error"); - if (error.type() != null_type) { - // Error - strPrint = "error: " + write_string(error, false); - int code = find_value(error.get_obj(), "code").get_int(); - nRet = abs(code); - } else { - // Result - if (result.type() == null_type) - strPrint = ""; - else if (result.type() == str_type) - strPrint = result.get_str(); - else - strPrint = write_string(result, true); - } + if (error.type() != null_type) { + // Error + const int code = find_value(error.get_obj(), "code").get_int(); + if (fWait && code == RPC_IN_WARMUP) + throw CConnectionFailed("server in warmup"); + strPrint = "error: " + write_string(error, false); + nRet = abs(code); + } else { + // Result + if (result.type() == null_type) + strPrint = ""; + else if (result.type() == str_type) + strPrint = result.get_str(); + else + strPrint = write_string(result, true); + } + + // Connection succeeded, no need to retry. + break; + } + catch (const CConnectionFailed& e) { + if (fWait) + MilliSleep(1000); + else + throw; + } + } while (fWait); } catch (boost::thread_interrupted) { throw; diff --git a/src/init.cpp b/src/init.cpp index d622af69ef..fe58c68fda 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -752,6 +752,17 @@ bool AppInit2(boost::thread_group& threadGroup) threadGroup.create_thread(&ThreadScriptCheck); } + /* Start the RPC server already. It will be started in "warmup" mode + * and not really process calls already (but it will signify connections + * that the server is there and will be ready later). Warmup mode will + * be disabled when initialisation is finished. + */ + if (fServer) + { + uiInterface.InitMessage.connect(SetRPCWarmupStatus); + StartRPCThreads(); + } + int64_t nStart; // ********************************************************* Step 5: verify wallet database integrity @@ -1248,8 +1259,6 @@ bool AppInit2(boost::thread_group& threadGroup) #endif StartNode(threadGroup); - if (fServer) - StartRPCThreads(); #ifdef ENABLE_WALLET // Generate coins in the background @@ -1259,6 +1268,7 @@ bool AppInit2(boost::thread_group& threadGroup) // ********************************************************* Step 11: finished + SetRPCWarmupFinished(); uiInterface.InitMessage(_("Done loading")); #ifdef ENABLE_WALLET diff --git a/src/rpcprotocol.h b/src/rpcprotocol.h index 9926daaf3d..f0d0f3445c 100644 --- a/src/rpcprotocol.h +++ b/src/rpcprotocol.h @@ -52,6 +52,7 @@ enum RPCErrorCode RPC_VERIFY_ERROR = -25, // General error during transaction or block submission RPC_VERIFY_REJECTED = -26, // Transaction or block was rejected by network rules RPC_VERIFY_ALREADY_IN_CHAIN = -27, // Transaction already in chain + RPC_IN_WARMUP = -28, // Client still warming up // Aliases for backward compatibility RPC_TRANSACTION_ERROR = RPC_VERIFY_ERROR, diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 08ed73f6de..cc80887ba4 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -34,6 +34,10 @@ using namespace std; static std::string strRPCUserColonPass; static bool fRPCRunning = false; +static bool fRPCInWarmup = true; +static std::string rpcWarmupStatus("RPC server started"); +static CCriticalSection cs_rpcWarmup; + //! These are created by StartRPCThreads, destroyed in StopRPCThreads static asio::io_service* rpc_io_service = NULL; static map > deadlineTimers; @@ -744,6 +748,19 @@ bool IsRPCRunning() return fRPCRunning; } +void SetRPCWarmupStatus(const std::string& newStatus) +{ + LOCK(cs_rpcWarmup); + rpcWarmupStatus = newStatus; +} + +void SetRPCWarmupFinished() +{ + LOCK(cs_rpcWarmup); + assert(fRPCInWarmup); + fRPCInWarmup = false; +} + void RPCRunHandler(const boost::system::error_code& err, boost::function func) { if (!err) @@ -870,6 +887,13 @@ static bool HTTPReq_JSONRPC(AcceptedConnection *conn, if (!read_string(strRequest, valRequest)) throw JSONRPCError(RPC_PARSE_ERROR, "Parse error"); + // Return immediately if in warmup + { + LOCK(cs_rpcWarmup); + if (fRPCInWarmup) + throw JSONRPCError(RPC_IN_WARMUP, rpcWarmupStatus); + } + string strReply; // singleton request diff --git a/src/rpcserver.h b/src/rpcserver.h index 2f34b11d22..2a258dd89a 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -45,6 +45,13 @@ void StopRPCThreads(); /* Query whether RPC is running */ bool IsRPCRunning(); +/* Set the RPC warmup status. When this is done, all RPC calls will error out + * immediately with RPC_IN_WARMUP. + */ +void SetRPCWarmupStatus(const std::string& newStatus); +/* Mark warmup as done. RPC calls will be processed from now on. */ +void SetRPCWarmupFinished(); + /** * Type-check arguments; throws JSONRPCError if wrong type given. Does not check that * the right number of arguments are passed, just that any passed are the correct type. From 9b1627d13ecbd6a22c284521ac9351a59af4b129 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 2 Nov 2014 21:25:27 +0100 Subject: [PATCH 0978/1288] [Wallet] Reduce minTxFee for transaction creation to 1000 satoshis --- src/wallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index d392149dbb..99d4ac2e55 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -33,7 +33,7 @@ bool bSpendZeroConfChange = true; * Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) * Override with -mintxfee */ -CFeeRate CWallet::minTxFee = CFeeRate(10000); +CFeeRate CWallet::minTxFee = CFeeRate(1000); /** @defgroup mapWallet * From 1f847936c9622f53fca25a1174961a799174b7fd Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 4 Nov 2014 13:59:41 -0800 Subject: [PATCH 0979/1288] Avoid a bunch of copying/conversion in script/sign --- src/script/sign.cpp | 8 ++++---- src/script/sign.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 0eab0626e5..9dfd640dfb 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -144,9 +144,9 @@ static CScript PushAll(const vector& values) return result; } -static CScript CombineMultisig(CScript scriptPubKey, const CMutableTransaction& txTo, unsigned int nIn, +static CScript CombineMultisig(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, const vector& vSolutions, - vector& sigs1, vector& sigs2) + const vector& sigs1, const vector& sigs2) { // Combine all the signatures we've got: set allsigs; @@ -199,7 +199,7 @@ static CScript CombineMultisig(CScript scriptPubKey, const CMutableTransaction& return result; } -static CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, +static CScript CombineSignatures(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, const txnouttype txType, const vector& vSolutions, vector& sigs1, vector& sigs2) { @@ -244,7 +244,7 @@ static CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, return CScript(); } -CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, +CScript CombineSignatures(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2) { txnouttype txType; diff --git a/src/script/sign.h b/src/script/sign.h index c84d3f9a94..99d5516adb 100644 --- a/src/script/sign.h +++ b/src/script/sign.h @@ -19,6 +19,6 @@ bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CMutab // Given two sets of signatures for scriptPubKey, possibly with OP_0 placeholders, // combine them intelligently and return the result. -CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2); +CScript CombineSignatures(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2); #endif // BITCOIN_SCRIPT_SIGN_H From 84877904c0f4c4d403e2c768f437c81226c1e137 Mon Sep 17 00:00:00 2001 From: mruddy Date: Tue, 4 Nov 2014 13:01:41 -0500 Subject: [PATCH 0980/1288] bitcoin-tx: Add the "-txid" option. Also add the hex-encoded transaction to the JSON output as the "hex" property. --- src/bitcoin-tx.cpp | 10 ++++++++++ src/core_write.cpp | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index c0d21ed36f..b35b8ba53a 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -57,6 +57,7 @@ static bool AppInitRawTx(int argc, char* argv[]) strUsage += " -? " + _("This help message") + "\n"; strUsage += " -create " + _("Create new, empty TX.") + "\n"; strUsage += " -json " + _("Select JSON output") + "\n"; + strUsage += " -txid " + _("Output only the hex-encoded transaction id of the resultant transaction.") + "\n"; strUsage += " -regtest " + _("Enter regression test mode, which uses a special chain in which blocks can be solved instantly.") + "\n"; strUsage += " -testnet " + _("Use the test network") + "\n"; strUsage += "\n"; @@ -488,6 +489,13 @@ static void OutputTxJSON(const CTransaction& tx) fprintf(stdout, "%s\n", jsonOutput.c_str()); } +static void OutputTxHash(const CTransaction& tx) +{ + string strHexHash = tx.GetHash().GetHex(); // the hex-encoded transaction hash (aka the transaction id) + + fprintf(stdout, "%s\n", strHexHash.c_str()); +} + static void OutputTxHex(const CTransaction& tx) { string strHex = EncodeHexTx(tx); @@ -499,6 +507,8 @@ static void OutputTx(const CTransaction& tx) { if (GetBoolArg("-json", false)) OutputTxJSON(tx); + else if (GetBoolArg("-txid", false)) + OutputTxHash(tx); else OutputTxHex(tx); } diff --git a/src/core_write.cpp b/src/core_write.cpp index a3ae8eec07..1d92cf87b5 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -129,4 +129,6 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry) if (hashBlock != 0) entry.pushKV("blockhash", hashBlock.GetHex()); + + entry.pushKV("hex", EncodeHexTx(tx)); // the hex-encoded transaction. used the name "hex" to be consistent with the verbose output of "getrawtransaction". } From 0246ab6088dc45507792fb152f72c42694c4f385 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 5 Nov 2014 00:49:26 -0500 Subject: [PATCH 0981/1288] depends: boost: hard-code hidden symbol visibility tl;dr: This solves boost visibility problems for default/release build configs on non-Linux platforms. When Bitcoin builds against boost's header-only classes, it ends up with objects containing symbols that the upstream boost libs also have. Since Bitcoin builds by default with hidden symbol visibility, it can end up trying to link against a copy of the same symbols with default visibility. This is not a problem on Linux because 3rd party static libs are un-exported by default (--exclude-libs,ALL), but that is not available for MinGW and OSX. Those platforms (and maybe others?) end up confused about which version to use. The OSX linker spews hundreds of: "ld: warning: direct access in to global weak symbol guard variable for means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings." MinGW's linker complains similarly. Since the default symbol visibility for Bitcoin is hidden and releases are built that way as well, build Boost with hidden visibility. Linux builds Boost this way also, but only for the sake of continuity. This means that the linker confusion logic is reversed, so the problem will will now be encountered if Bitcoin is built with --disable-reduce-exports, but that's better than the current situation. --- depends/packages/boost.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 98ed3de772..53c4c3c74e 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -21,6 +21,7 @@ $(package)_archiver_$(host_os)=$($(package)_ar) $(package)_toolset_darwin=darwin $(package)_archiver_darwin=$($(package)_libtool) $(package)_config_libraries=chrono,filesystem,program_options,system,thread,test +$(package)_cxxflags=-fvisibility=hidden $(package)_cxxflags_x86_64_linux=-fPIC $(package)_cxxflags_arm_linux=-fPIC endef From 93a3f0e7fea8699fca7e062156d7a22293d533b8 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Wed, 5 Nov 2014 11:39:47 +0100 Subject: [PATCH 0982/1288] Qt: Network-Traffic-Graph: make some distance between line and text Text directly glued on the graph-line looks not so good. --- src/qt/trafficgraphwidget.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qt/trafficgraphwidget.cpp b/src/qt/trafficgraphwidget.cpp index 74565bb6d0..5f14b80797 100644 --- a/src/qt/trafficgraphwidget.cpp +++ b/src/qt/trafficgraphwidget.cpp @@ -76,10 +76,12 @@ void TrafficGraphWidget::paintEvent(QPaintEvent *) int base = floor(log10(fMax)); float val = pow(10.0f, base); - const QString units = tr("KB/s"); + const QString units = tr("KB/s"); + const float yMarginText = 2.0; + // draw lines painter.setPen(axisCol); - painter.drawText(XMARGIN, YMARGIN + h - h * val / fMax, QString("%1 %2").arg(val).arg(units)); + painter.drawText(XMARGIN, YMARGIN + h - h * val / fMax-yMarginText, QString("%1 %2").arg(val).arg(units)); for(float y = val; y < fMax; y += val) { int yy = YMARGIN + h - h * y / fMax; painter.drawLine(XMARGIN, yy, width() - XMARGIN, yy); @@ -89,7 +91,7 @@ void TrafficGraphWidget::paintEvent(QPaintEvent *) axisCol = axisCol.darker(); val = pow(10.0f, base - 1); painter.setPen(axisCol); - painter.drawText(XMARGIN, YMARGIN + h - h * val / fMax, QString("%1 %2").arg(val).arg(units)); + painter.drawText(XMARGIN, YMARGIN + h - h * val / fMax-yMarginText, QString("%1 %2").arg(val).arg(units)); int count = 1; for(float y = val; y < fMax; y += val, count++) { // don't overwrite lines drawn above From 236d96e0a3702fecfa7fae2e87aa883bdbb035e1 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Wed, 5 Nov 2014 11:45:37 +0100 Subject: [PATCH 0983/1288] Qt: Add support for missing scrollbar in peers table --- src/qt/forms/rpcconsole.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/forms/rpcconsole.ui b/src/qt/forms/rpcconsole.ui index 898df2b080..c5ac371619 100644 --- a/src/qt/forms/rpcconsole.ui +++ b/src/qt/forms/rpcconsole.ui @@ -689,7 +689,7 @@ - Qt::ScrollBarAlwaysOff + Qt::ScrollBarAsNeeded true From 93a602240006aed6bc192b854c3927dba6e01f82 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 5 Nov 2014 12:12:04 -0800 Subject: [PATCH 0984/1288] Reduce bitcoin-cli dependencies --- src/Makefile.am | 5 +---- src/bitcoin-cli.cpp | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 3089b2ff40..a388403205 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -301,13 +301,10 @@ bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) # bitcoin-cli binary # bitcoin_cli_LDADD = \ $(LIBBITCOIN_CLI) \ - $(LIBBITCOIN_COMMON) \ $(LIBBITCOIN_UTIL) \ - $(LIBBITCOIN_CRYPTO) \ $(BOOST_LIBS) \ $(SSL_LIBS) \ - $(CRYPTO_LIBS) \ - $(MINIUPNPC_LIBS) + $(CRYPTO_LIBS) bitcoin_cli_SOURCES = \ bitcoin-cli.cpp diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 11840e62a8..a2b95d5086 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -5,7 +5,6 @@ #include "chainparamsbase.h" #include "clientversion.h" -#include "init.h" #include "rpcclient.h" #include "rpcprotocol.h" #include "util.h" From eefb766c77048127123622bf9972fd5c844b7966 Mon Sep 17 00:00:00 2001 From: kiwigb Date: Thu, 6 Nov 2014 14:30:59 +1300 Subject: [PATCH 0985/1288] Rearrange initial config checks: AC, AM, compiler, libtool. Removed some repeated and unused prog checks. --- configure.ac | 67 +++++++++++++++++++++++----------------------------- 1 file changed, 29 insertions(+), 38 deletions(-) diff --git a/configure.ac b/configure.ac index 17efd987ac..837810401a 100644 --- a/configure.ac +++ b/configure.ac @@ -14,42 +14,14 @@ AC_CONFIG_MACRO_DIR([build-aux/m4]) AC_CANONICAL_HOST -dnl By default, libtool for mingw refuses to link static libs into a dll for -dnl fear of mixing pic/non-pic objects, and import/export complications. Since -dnl we have those under control, re-enable that functionality. - -case $host in - *mingw*) - lt_cv_deplibs_check_method="pass_all" - ;; -esac - -LT_INIT([disable-shared]) - AH_TOP([#ifndef BITCOIN_CONFIG_H]) AH_TOP([#define BITCOIN_CONFIG_H]) AH_BOTTOM([#endif //BITCOIN_CONFIG_H]) -# This m4 will only be used if a system copy cannot be found. This is helpful -# on systems where autotools are installed but the pkg-config macros are not in -# a default location. It is currently used for building on OSX where autotools -# are preinstalled but pkg-config comes from macports or homebrew. It should -# probably be removed when building on <= 10.6 is no longer supported. -m4_include([pkg.m4]) - dnl faketime breaks configure and is only needed for make. Disable it here. unset FAKETIME -if test "x${CXXFLAGS+set}" = "xset"; then - CXXFLAGS_overridden=yes -else - CXXFLAGS_overridden=no -fi - -dnl ============================================================== -dnl Setup for automake -dnl ============================================================== - +dnl Automake init set-up and checks AM_INIT_AUTOMAKE([no-define subdir-objects foreign]) dnl faketime messes with timestamps and causes configure to be re-run. @@ -59,17 +31,27 @@ AM_MAINTAINER_MODE([enable]) dnl make the compilation flags quiet unless V=1 is used m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -dnl Checks for programs. +dnl Compiler checks (here before libtool). +if test "x${CXXFLAGS+set}" = "xset"; then + CXXFLAGS_overridden=yes +else + CXXFLAGS_overridden=no +fi AC_PROG_CXX -AC_PROG_CC -AC_PROG_CPP -AC_PROG_CXXCPP -AC_PROG_INSTALL -AC_PROG_OBJC -AC_PROG_LN_S m4_ifdef([AC_PROG_OBJCXX],[AC_PROG_OBJCXX]) -AC_PROG_MKDIR_P -AC_PROG_SED + +dnl By default, libtool for mingw refuses to link static libs into a dll for +dnl fear of mixing pic/non-pic objects, and import/export complications. Since +dnl we have those under control, re-enable that functionality. +case $host in + *mingw*) + lt_cv_deplibs_check_method="pass_all" + ;; +esac +dnl Libtool init checks. +LT_INIT([disable-shared]) + +dnl Check/return PATH for base programs. AC_PATH_TOOL(AR, ar) AC_PATH_TOOL(RANLIB, ranlib) AC_PATH_TOOL(STRIP, strip) @@ -81,6 +63,15 @@ AC_PATH_PROG([GIT], [git]) AC_PATH_PROG(CCACHE,ccache) AC_PATH_PROG(XGETTEXT,xgettext) AC_PATH_PROG(HEXDUMP,hexdump) + +# This m4 will only be used if a system copy cannot be found. This is helpful +# on systems where autotools are installed but the pkg-config macros are not in +# a default location. It is currently used for building on OSX where autotools +# are preinstalled but pkg-config comes from macports or homebrew. It should +# probably be removed when building on <= 10.6 is no longer supported. +m4_include([pkg.m4]) + +dnl pkg-config check. PKG_PROG_PKG_CONFIG # Enable wallet From 9bdec7603713d269767dfd86dbd9b8342d0120fe Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 6 Nov 2014 08:47:48 +0100 Subject: [PATCH 0986/1288] Always log number of threads for script verification Helps for troubleshooting. --- src/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index fe58c68fda..158713b321 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -746,8 +746,8 @@ bool AppInit2(boost::thread_group& threadGroup) LogPrintf("Using at most %i connections (%i file descriptors available)\n", nMaxConnections, nFD); std::ostringstream strErrors; + LogPrintf("Using %u threads for script verification\n", nScriptCheckThreads); if (nScriptCheckThreads) { - LogPrintf("Using %u threads for script verification\n", nScriptCheckThreads); for (int i=0; i Date: Thu, 6 Nov 2014 08:52:32 +0100 Subject: [PATCH 0987/1288] Change -genproclimit default to 1 This is less surprising. Avoids the overload-the-CPU default of using N threads for script verification as well as N threads for generation where N is number of cores. --- src/init.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 158713b321..22ec80e17b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -320,7 +320,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += ".\n"; #ifdef ENABLE_WALLET strUsage += " -gen " + strprintf(_("Generate coins (default: %u)"), 0) + "\n"; - strUsage += " -genproclimit= " + strprintf(_("Set the processor limit for when generation is on (-1 = unlimited, default: %d)"), -1) + "\n"; + strUsage += " -genproclimit= " + strprintf(_("Set the number of threads for coin generation if enabled (-1 = all cores, default: %d)"), 1) + "\n"; #endif strUsage += " -help-debug " + _("Show all debugging options (usage: --help -help-debug)") + "\n"; strUsage += " -logips " + strprintf(_("Include IP addresses in debug output (default: %u)"), 0) + "\n"; @@ -1263,7 +1263,7 @@ bool AppInit2(boost::thread_group& threadGroup) #ifdef ENABLE_WALLET // Generate coins in the background if (pwalletMain) - GenerateBitcoins(GetBoolArg("-gen", false), pwalletMain, GetArg("-genproclimit", -1)); + GenerateBitcoins(GetBoolArg("-gen", false), pwalletMain, GetArg("-genproclimit", 1)); #endif // ********************************************************* Step 11: finished From bfe029feebc8ff753c829f5f376003e5b90d3c89 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 6 Nov 2014 00:24:41 -0800 Subject: [PATCH 0988/1288] Reduce bitcoin-tx dependencies --- src/Makefile.am | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index a388403205..8b5d009842 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -171,6 +171,7 @@ libbitcoin_server_a_SOURCES = \ rpcnet.cpp \ rpcrawtransaction.cpp \ rpcserver.cpp \ + script/sigcache.cpp \ timedata.cpp \ txdb.cpp \ txmempool.cpp \ @@ -232,7 +233,6 @@ libbitcoin_common_a_SOURCES = \ pubkey.cpp \ script/interpreter.cpp \ script/script.cpp \ - script/sigcache.cpp \ script/sign.cpp \ script/standard.cpp \ $(BITCOIN_CORE_H) @@ -327,9 +327,7 @@ if USE_LIBSECP256K1 endif bitcoin_tx_LDADD += $(BOOST_LIBS) \ - $(SSL_LIBS) \ - $(CRYPTO_LIBS) \ - $(MINIUPNPC_LIBS) + $(CRYPTO_LIBS) bitcoin_tx_SOURCES = bitcoin-tx.cpp bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES) From 5985ba9e61466bbdb8416896ecfaadf040b6e4d9 Mon Sep 17 00:00:00 2001 From: ENikS Date: Thu, 6 Nov 2014 17:53:25 -0500 Subject: [PATCH 0989/1288] Fixing warning C4099: 'CExtPubKey' : type name first seen using 'class' now seen using 'struct' --- src/key.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/key.h b/src/key.h index 8c2f44801d..f36e658dee 100644 --- a/src/key.h +++ b/src/key.h @@ -13,7 +13,7 @@ #include #include -class CExtPubKey; +struct CExtPubKey; class CPubKey; /** From 2db4c8a24d47065bdd6e80560cc5e458088849ff Mon Sep 17 00:00:00 2001 From: Daniel Kraft Date: Fri, 7 Nov 2014 10:23:21 +0100 Subject: [PATCH 0990/1288] Fix node ranges in the test framework. --- qa/rpc-tests/test_framework.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qa/rpc-tests/test_framework.py b/qa/rpc-tests/test_framework.py index c3396a5a83..9591c024fb 100755 --- a/qa/rpc-tests/test_framework.py +++ b/qa/rpc-tests/test_framework.py @@ -44,8 +44,8 @@ class BitcoinTestFramework(object): # on outward. This ensures that chains are properly reorganised. if not split: connect_nodes_bi(self.nodes, 1, 2) - sync_blocks(self.nodes[1:2]) - sync_mempools(self.nodes[1:2]) + sync_blocks(self.nodes[1:3]) + sync_mempools(self.nodes[1:3]) connect_nodes_bi(self.nodes, 0, 1) connect_nodes_bi(self.nodes, 2, 3) @@ -63,9 +63,9 @@ class BitcoinTestFramework(object): def sync_all(self): if self.is_network_split: - sync_blocks(self.nodes[:1]) + sync_blocks(self.nodes[:2]) sync_blocks(self.nodes[2:]) - sync_mempools(self.nodes[:1]) + sync_mempools(self.nodes[:2]) sync_mempools(self.nodes[2:]) else: sync_blocks(self.nodes) From 369be584f9c6d43a074d35e7791f60d91a679734 Mon Sep 17 00:00:00 2001 From: sandakersmann Date: Thu, 6 Nov 2014 13:04:45 +0100 Subject: [PATCH 0991/1288] doc: Correct several typos in bootstrap.md - Also remove references to the blockchain size --- doc/bootstrap.md | 26 ++++++++------------------ doc/img/bootstrap3.png | Bin 56598 -> 0 bytes 2 files changed, 8 insertions(+), 18 deletions(-) delete mode 100644 doc/img/bootstrap3.png diff --git a/doc/bootstrap.md b/doc/bootstrap.md index 7ce71abaad..b84fd24b11 100644 --- a/doc/bootstrap.md +++ b/doc/bootstrap.md @@ -1,41 +1,31 @@ ### Bootstrap the Blockchain Synchronization -Normally the Bitcoin client will download the transaction and network information, called the blockchain, from the network by syncing with the other clients. This can be a process that can take multiple days as the [Bitcoin block chain](https://blockchain.info/charts/blocks-size) has grown to more than 15 gigabytes, and is growing almost a gigabyte every month. Luckily there is a safe and fast way to speed up this process. We’ll show you how to bootstrap your blockchain to bring your client up to speed in just a few simple steps. +Normally the Bitcoin client will download the transaction and network information, called the blockchain, from the network by syncing with the other clients. This process can take quite some time as the [Bitcoin blockchain](https://blockchain.info/charts/blocks-size) is growing bigger and bigger for each day. Luckily there is a safe and fast way to speed up this process. We'll show you how to bootstrap your blockchain to bring your client up to speed in just a few simple steps. ### Requirements - A fresh install of the Bitcoin client software. -### Download the blockchain via Bittorent +### Download the blockchain via BitTorrent -Jeff Garzik, Bitcoin core developer, offers an [torrent file](https://bitcointalk.org/index.php?topic=145386.0) for bootstrapping purposes that is updated often. Bittorrent is a protocol that speeds up the downloading of large files by using the other clients in the network. Examples of free and safe open-source clients are [Deluge](http://deluge-torrent.org/) or [QBittorent](http://www.qbittorrent.org/). A guide to installing and configuring the torrent clients can be found [here](http://dev.deluge-torrent.org/wiki/UserGuide) for Deluge and [here](http://qbforums.shiki.hu/) for QBittorent. A further in-depth tutorial on Bittorent can be found [here](http://www.howtogeek.com/howto/31846/bittorrent-for-beginners-how-get-started-downloading-torrents/). +Jeff Garzik, Bitcoin Core developer, offers an [torrent file](https://bitcointalk.org/index.php?topic=145386.0) for bootstrapping purposes that is updated often. BitTorrent is a protocol that speeds up the downloading of large files by using the other clients in the network. Examples of free and safe open source clients are [Deluge](http://deluge-torrent.org/) or [qBittorrent](http://www.qbittorrent.org/). A guide to installing and configuring the torrent clients can be found [here](http://dev.deluge-torrent.org/wiki/UserGuide) for Deluge and [here](http://qbforums.shiki.hu/) for qBittorrent. A further in-depth tutorial on BitTorrent can be found [here](http://www.howtogeek.com/howto/31846/bittorrent-for-beginners-how-get-started-downloading-torrents/). -With the client installed we’ll proceed to download the blockchain torrent file. Use the following magnet link: +With the client installed we'll proceed to download the blockchain torrent file. Use the following magnet link: magnet:?xt=urn:btih:2d4e6c1f96c5d5fb260dff92aea4e600227f1aea&dn=bootstrap.dat&tr=udp://tracker.openbittorrent.com:80&tr=udp://tracker.publicbt.com:80&tr=udp://tracker.ccc.de:80&tr=udp://tracker.istole.it:80 - or go to [Jeff Garzik's topic](https://bitcointalk.org/index.php?topic=145386.0) for a signed magnet link. Alternately you can use the [.torrent file](http://sourceforge.net/projects/bitcoin/files/Bitcoin/blockchain/bootstrap.dat.torrent/download) found on Sourceforge. + or go to [Jeff Garzik's topic](https://bitcointalk.org/index.php?topic=145386.0) for a signed magnet link. Alternatively you can use the [.torrent file](http://sourceforge.net/projects/bitcoin/files/Bitcoin/blockchain/bootstrap.dat.torrent/download) found on SourceForge. ![Fig1](img/bootstrap1.png) The download page should look like this, with a countdown to the download. If it does not work click the direct download link. -The torrent client installed will recognize the download of the torrent file. Save the bootstrap.dat file to a folder you use for downloads. The image below shows the torrent download in QBittorent, with current speed and ETA highlighted. +The torrent client installed will recognize the download of the torrent file. Save the bootstrap.dat file to the folder you use for downloads. The image below shows the torrent download in qBittorrent, with current speed and ETA highlighted. ![Fig2](img/bootstrap2.png) -### Download the block chain directly from official repositories -The Bittorent version, see above, of the block chain download is refreshed more often than the direct download available. If Bittorent is blocked on your network then you can use the direct download method. Be sure to only use official repositories as the link displayed below. This download will only update the client to March 2013. - -Click [here](http://sourceforge.net/projects/bitcoin/files/Bitcoin/blockchain/bitcoin_blockchain_170000.zip/download) to download or copy and paste the link below. - - http://sourceforge.net/projects/bitcoin/files/Bitcoin/blockchain/bitcoin_blockchain_170000.zip/download - -The download page should look like this, with a countdown to the download. If it does not work directly click the download. Save the file to a folder you use for downloads. -![Fig3](img/bootstrap3.png) - ### Importing the blockchain -Exit the Bitcoin Client software if you have it running. Be sure not to have an actively used wallet in use. We are going to copy the download of the blockchain to the Bitcoin client data directory. You should run the client software at least once so it can generate the data directory. Copy the downloaded bootstrap.dat file into the Bitcoin data folder. +Exit the Bitcoin client software if you have it running. Be sure not to have an actively used wallet in use. We are going to copy the download of the blockchain to the Bitcoin client data directory. You should run the client software at least once so it can generate the data directory. Copy the downloaded bootstrap.dat file into the Bitcoin data folder. **For Windows users:** Open explorer, and type into the address bar: @@ -63,4 +53,4 @@ Wait until the import finishes. The client will download the last days not cover ### Is this safe? -Yes, the above method is safe. The download contains only raw block chain data and the client verifies this on import. Do not download the blockchain from unofficial sources, especially if they provide `*.rev` and `*.sst` files. These files are not verified and can contain malicious edits. +Yes, the above method is safe. The download contains only raw blockchain data and the client verifies this on import. Do not download the blockchain from unofficial sources, especially if they provide `*.rev` and `*.sst` files. These files are not verified and can contain malicious edits. diff --git a/doc/img/bootstrap3.png b/doc/img/bootstrap3.png deleted file mode 100644 index 8a6754e3e00156122dd1b44fe4603e4f2beb67cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 56598 zcmZs?1yoeg_ckn2QX(iJDJcztbV)M|ozf^E(#_DNNJ@uvcXyYFlyv8SFw~F(!%ze7 z;P3bU*7vUWf7fDh@7#N0pR@Nq`#k$O;p(ai1h^Eqj~+cD04U08K6-?%{OHkR+9z13 zUt~^<3{d~jTs0M>A61P}?V%nptfW+=9zCj!!Mpu{iF(FyQq*^S^yq2d!ynp!V~NG1 zM=Rw3St)H#lY>wbo-wZ5#G&4kjP~e+@%jY+4azId9D9m55Q_OrcGC?POXd zKO-U{(y&xotTo3*XU=1+^+7mL^JMxQwSK}uy&=*mqS$`@a6?4oRbaQ=^qo^#7Vza2CM9aGAB5Ybs z@?Y~eh~s%Qt@}IVC^6~{eVH<=7QZyw&VPi?Rer+J zm`zGci%`uJ$<@f0f9RVAL~*gs67OHBlXWR-9yoMS({*y|k!r@XQ+)YU- zLLZoT8xa}le0lQW1u1Es!)n{L{?TH6u|7~%R$G{yhlnW-hM^ou#{K)v09C$ZT(w>` zjm>OX2nD}T6`l^YoSdAH+ivVp8XFjJfs!C;4-|wFG)of~7dM{XY^ml0dX_H?fMoTm z*rJ`^$?|!6xZFH{w%laj_bdE)t;G z)0rR)^U9Bly8Ld^m{97p3WA@#+L_9cLiaN!=h4ui518Kqy}QG51b0z`ea}=<{mH^g zuGux=-w6nBpZe(f2j%g&Cl0IU>vFzTK8~IX@FeEnpLqi;Edwrgc)1p0D{ET&9n=n- ztoa=0`XjI3=)o*x-;}-r?M_JP%@nJof5XHh-Bp{*I3i!79GdaW0BICjEGi^_fQ)H^L zV_yNrbea+(k}zB~b#ch=&x<8D&c-F@$JHC4R)GEkR9*8@-<0pK#si|SgcEPr=THCe zjsJ2CxLN-3r9p8^KQ?f$qJE4Q_z{tPe~WG0?lF7pKgh>{2t<3X!vqs$>b`+}_}&rO z{Ao0e7s>TZ1Kzy1wpZo0Sz7Ial^g-nMBc4ydf{OoWmhEc_*e_}C zp(S+KzHwTAN9A)++XnWoNLoeJzmXeCBaQMUZjb0WMKyb)3x9GX8D53z-)VFq)_mMg zUX7sCxb0n!+luqR9w{?xLb|rJtBVVd`EPtApi4Wgy7R(7{6#~9i}DX1sq6%8Sd8SI zXB4$4sh5{mn-1VH+fet1zHe<HX)YhF9ltMT+n#*Tp~hqQCVEY-IeBUv@_oYgbd zwHsvw=$y*LVt{9iJ7hph<6s&bkE)ixxJF)(By}{g-!Zh+Bd;xOR$AUawaKsiw@2vA zy)JGkhijivqsD?-8{SswLzpwoF8m2c$DO}mN^cRsRz&Qn$fU#ONo=QBSgl|GiAXDw zl=E?Klp8qK+ORccj-XV`2N9R^N0-skr_>ktl7lr;rKxU@vzk%gs=3~x)h7TjWpg?O z2?0k|ievNJT5A?pm66F` z6T`zx+ZZE z`%X6c+(Y<@OD&d_+B(|L=DY87^bVL}j#k^Dpr`^~uCwG@1`bY=sbKnPO+d0PrnP09 znqUCD+!WK`M*&>EEdp@0V$m%ZNxIQbW;&B(i4#!}0_YM|Fo?CoOW1mS1q6l>s5AbE zV?0hX^4=?K8_8;@Qv@cs2`0RgzDRI~NhGx&IK+)1zdl!;;1q~Y5q%bCz1Q^mxa~5t zoykj4ke@Zi?KAN z&@H(Lg`>CFS8tVoS$j0%-ZdfNWgK32tDMRsDcs!C$B&700!&So2rIR|&}J~F6Bst< zkCaD_Qt7w@CVw&x#Sd3^C~`{{N^|=y_A!;-4tvyfW6(9Zu#k9p(aN(8uK6*l;ry|C zMb}~JR1fVK8sT!SPJk(5niza2kmj;XlzPh5e!#ophgkJ~hi>?EnVzBG=R~<)b=VH= z-U`!1!sg%`2$B)tGDh5^sDC@Qn)!9>HCjk4Op!(tr}+vHAJK{tO#Dt!PT`^!66<>) zuvRzX1psCr>}*SP#da`~C-~Zp#5Pm_5Gt+y7s9p6OR(X(^K&=9E|;~Yj`+|HZYIl% zb}SbT;M@q(daa|?L8H!Vuz|xC6)?;|-zWc5$*?kpZmZ02lwPu(unTIh_hj7l$iMj@GTtudSux5Jq;k z;Wany2^fx3brt|G#=(*~si6y#R|gDrBGOv}#IvCN;V=-jN4Mv|;CzNzI=Ij_-O z2jTI&3((gC?%2vM_#l1zcv}X^)q!|xfB-k0*Vp!F-r%f;Pp#GYHCKtR_5GoFOnLi* z$NFl@*JSd9R3(zJI4XLZwcNK&)t~kv2b|oK#O}FI7G^caCNEQtuOpOe#bk!GP12QH z74AnGD;gjbmuFJ}v>z1}kQ*{?Y4;e>Fnv8<<1pQ`*^BY$;Ewb4ZWTMgWm0;nO;LgE zhxmw-pCNegKr9&XJu2`dSLFS;iqe2$1sR{SQ9(Zh883H|z9HHL&|xFl@CaUOx5Iok zwZvqMUzncJaH0r})!tDj~6C?Y__ZMEAiV% z-S-m;2LP%!5wEZ9j#Iikspg}yHoLh#lw#TJ1<$`z0mDgBKYD$OFYORWb(wc+s}U{z zH_pT`@aLgX$4)`iv?(QgHEm5T`=rzs2w=7-rl~8w`A9=nmJw{^ihOy zMQCTN-uQ%wM(ee>uOaR0dcRtx_y7c(dcR;pxjr`KaaWSLL?8LxUNl1U3l+Ege!MaN zy$gyjm{lESAn{vNYeNo+YV&e3`~s*m&FgkO(ph7wLksG_t9RSe>>NvHY)N{>K?M?C z9f|>q;OuVsad`g{p zYIV1Ba==N&nsY3!nd1xLJ%fz9Y04z3w?uN=h>F+Di|8~n3?LEfSJxhKA(DTg5dRzP z>VlAr?gHuspTU5e*oIqYqnn%ik11D(!oQl#M``RqL#9rx4_Z3L6m^Zi_dPMzkDV_S z#zHqT%Dec=!mGtXK#z}Up6Qhira$CUSsLpCVMV@6L(NGZ=_9ML|EWI{XpaBGzp0 z{_gnR?HzqVWQHBXysp0zne?)XdfTr>5Xhoabf}3}QJVfJNQ@B1G5Cna1!eU5CTmrJ z8-u41;MYPOEdwxWuW&9r(im$?4}}2vtK0U=a9gV(^)ygj!M?p>x3_2XB*o`S*t*qP zww0Ba=S+HdGr;UJCN4wCexOGtpw|<4;fIs$pJqN+YQ4DF86zl36kog;%EHbB(qxgdoe6lQEPFL>h39&w=c;X`G6{^oo|((? zJ?9;<+i9<&#~8W#McwPNlB=eibQ6cD0W#04YKr^tAhxPb` z#=fLuBGCDLhj5GbZ);YAYArhhgFZhqsuLGYD8~gz^4`vKFLg!{;-r5B&XmZ3W2Rt$# zZcLX9=(>aHS(C&E%Cw;=Jz|6$qBdJJr>bquLn4M;IQxt_@sE_MYVB;lyt-nYH<|NF z=;U5=d4J^6mH=+5`_pMu#MBbU2;oo>6ir1qFi55NTGzC<=hiH@oyDG|*ca*m)=Cq0 zRI2jDTwT6H@IDqoR1F9r`rkbQ%vF-XZJ$}|iWKdeFo6>A24?p^zwMhX`*89Z*S*ke zMNKI`hqN`F8FV~*;xfmu6T&34Exj!5PRW(%3H?r`*Hai>D?l>857*mB)J90m|8?W& zHOvb843DqeB^gvZyiZnBms8;Awi15>KqBMN_i?)`*OBN~pM%j5NK#`wOUh|?Ydu`m zbe774fd2J7;j)jHJ{`^Fc;BGOh;Z@=3-P;Lwg%S-)t;W|v=ZvMO{DOc^PK(62TTvn zkzNGn;CY_C46*5%az|z5-d}5u)s8 z*;$xEUBI36m}z0pn}b$vnMy~!gY5TQJn#SZJJ6c8&y!^(m($5Q(T5I6ne|H zrO~G`xt<@rTKqJFjeE7bM%d3NexKtn;#D@y-pG3U|G5U2o6RKO>{Gn2rls5QMUH4J zZRs8P)OZ$ixTWw-!Oybv8hrHcv<1lW4sUmy+@MSgZc?-rt?POVO&e|v+ENMr{*`l9 zkGPlM@A@?ACp!4lkAL6HcJ*XQ!g~c>yS0`HdTZH!;0{!;DC_X;?X=bbI$z{RajCf0OiVB}hUj6~US5Qg>7u>-Zy?Dtj&qp8ats+3j3}X_iCXC)1_s zsY`}XIYXU}dcvVi!Tth3PMKy@1f;FNH&@+fQ;?sqrZDV8S>*!Zp5ksmOCNF^(X|si zlO<8ryDSX0V)qiQIf*{w@vhS6PRodJ6?N#Jt88~NJHl4&;ai_4Z_!D1|CK4@#uB8L zZSd{fRc(@_mJ?i|exDhMm@AcW(}02;)Jd$(`UMRw95Y<1ye~4-B)fcXgxxw^qq+JL z*=Ha7L}|?&M@amBcWZ!+K627zL8(T!Q$4j(`^1`DW9KfCOY__2q^_#nyu3S2XblMb zp?J!e(KO6Y@ZxiXVU!{QJ1j=UMm^uJQPMwsH@QW!u9Rup?V+BDwu4B_7tg^;Xs_LM1o`U zfs`ZoK<>pUFE_i+Blqi&1w=D@&Gqft3p5pm5qlzn(-NN3jFYCT(eH zxp&A3l5im2ZJBRvKE3ehBL=&qrrs}qz z{ivIy;>6lTE&@XDt6+tA){GrbP;Zi#dTO!5FGV zYO8aVlBM@mzbS)`oa0T@rCyvQTvI=B!Lprzf}OB#okW@W$)D|sr5DnBb+dkn&ji<<_fZJ@pLSJ`^?Y9xHz4^HhX3zOZE2=fk{R zM&5pss4H0BWKD1(m`eznT0awjccNoLvo^NM+Nf>;;*{M!zFXJUJi8B%9D`Q3-`;tD zIw2P&MLs1n_IQcfW;|YLbqY18drk?H8P7cc(EfD2W3vZ;k*@zvDg=5-J*%Jicg@s* zd`6kWa?WU;w?%m$gO|1=8PoL2^uC8zu818$kyiH$hR@1NeRzdaA=y>#N~>+WSJR2_ zeRIjkS+LSB6aD-QsVxnQa^fCI|9UHE;8MPPCxkp(7cBQ}K2>d>pSK1R++=l<848x9 zY7NjMM`PS0(|}X1wS9+Sa~uw6&_6+zQ~KmrC$ei)$!b za4_c`PB&5z4mjpd6odF$b~56a*>}}dBK#LDz?^mS`u+yQ+JoL7MjV>M;WWR7lV{_5 zrS48+0(O&maMBoS61d!5j8}R!8C|Fg@v=IOnXZhSdNHqsJU+X0L*KjqSl?Tkp0tAx z^di2cWjeG?hcFlG3}Puct`|?MG>h*gC}`W4cKa2@7vDJvNs6l;%t+s_bU38m>Ho}i zvw((Kf4N35l8L4_$PE}%Pc{vyZj}X?3ha8aQts`m4dr%PUyf3p;oLhF$0KLsTZ7Es zzT}yleY{>ENjOy=ui7!PlBcym7AVaK=8w9?m-F$@lQ1P=%$nz(^U)Vro%pz~uzRtc zu>GaYp=4QJ?ek6dmFj)sdT|5e;A7nnXEkf@-Mf^Y7ea78yZwHLOekwE@C*g8P1IYB z|DGw;dSk!TKnyTxNy)A=S)+AnR$Yi_>j*Fhgj}M0_0$a#h3L%R0OED&hX#(RNkPPQ zCh~g;O3fJ0dDnv)<`kPbtnFjDLmQV3*2KOl`;5=0TTogL)fBjIqF^_x^;`Qz`*^Qb z6HVt7zttTsi&PBvsZr;lc&4_fNlh18!{EMF*PXwapfwzf)(h$? z6g;=9%Pg4QEp7_jhM0`NlVD094Pn}2_e38e;7fDBzsMvH&im}kjWL4^X54@oUXw!# zz}=YMJv8CSojC{QQI7Z8CQDZ1QXCo%xIjprgRW-ptF%TaHWSZyrJFSPypg@Yf=0!D znR_pq>V3T#Nc_q3-)&ZW3z#aT`TwdIhVq9 ztG{L9jn)0G<;C`nL6hs7EFYciFY~YpU;$n$SRxlvGGn{TmhI!U z%lE=y?en;rncva!Si5w!gw-0S%LRzG_+Y4dc6SA~viNAxqn39edawjtVw|ciJbB9iKzs_7`R4EM-jtF8gr$FgOonXpQI6@)~@9R~&OFj(tUJeC)?Ti1T%2UhOe;D@b54 zDY+009cz8g&~Y~ZXsGWP!ujP-0DM-@o5lI+j_IXx-?7MWJ>`*?5(Twd@7}2HCc(H5 z&`=U7bQv8777&?m`EIoH)ZfBQbd~A&HHoKaq|)vJ0MbPPRW4|PPp1e)2{Sdjk3*0D z)bEA(>h!l;KRr4iF5>sP@Bh(o$$IYCLBqZ4cNd5Nx%a9>zW%UIW0fsqJl4;u>8jV3 z;g0jP^xl1M{VUmLU)(W%FH>PT7+RON6vTD>*IPO~6Bso#y1Se)NN7MH6l*dxB+Hk4cg zhsMXbO;z}xZc!7xjD5$}9LIKCr^;5O`7*_NQ4Nbeb`I0}FczV`z2MQ|iN!A`L{L6tBuKlafb}5!l=3G=-vo~3a zj*&ce6Uf70d|lvUAmn0%V`O25CtO7}-n25**_tWfT~_H^71Gc%NVYf(PZC?*+2Hz;QO~H) zJipxrt(rbA9%@W+jYC?{TC?74(%zS}<9%ZoKqbh&+|e65URjuoRhxGEUl(t&b2?-P z+_iSah=Pu0Ol8@7Ycq%g&~>XGDXX%BqN!ZInq^f)F44p+ zOT7|XOD%iHA6>dV7&+zjGKr}Qq(YQhu3Mgnll2F09S7ZV4g0+K4?Zfr zI3tr_PMO=3>dL-?WboKk%39n$k+1_dDTIil5>sMrtozs!f~>!eXhE;ubK_SLZs}Cx zMB5iclg6jK&W?3ogL%bhs5Vmk-7SJ|ASPq9J{`9%*I|ulR1ek0YH4B)bR90&?5G#; z-WZPvI*+gK)K;D9dtN5pI2kCK@E$hDG*cyc5&*YoU-*7gGHE78tQvCNRD}J!-?(Ex z`W@im@zcHjF6=C`5MnWG+(IcS5~6)O{BrNwt2xGld*t}WmaFHD0#H=L<=T4rX@j40 zS89G4mz>TFySQ2W9AznwPkXW)eWe5pDaflB)B&VVGA(`Eeex4;0hQ4UkEo{v1&q&)^HTCf|r$c1lKZ zV`zEexSqvc%+P&C;CYyPV5XkrMjXH$&~hPN!0g=9po6JwZ{peaM?)v2&f{=NiSS1O zFFT2UDaUW=JB=jVD!2A{rLu-cicI=rb`8L}v=Is>z zby#~ohv+UW>eV8mBq_df!ec$zNly@iG~Lt zr^B}0WciAexJ41u(15YPg(JzLluC(70~W5W(QILQHL#c&dSH9@3`W>OO)#qa*HRS6 z$u4BZfdR06*s7RSmrd12{phmROQ~Nn8T#r9fN4C;rQ~xY4U4S50y~ z*F=6Owsq<9)P<`y5tZO7z_07h2tD9FfYeFVPc8D zg)B_fF;%Jy1c0v0nQq#S<-8PQUt1;}_p)*BeHuh1|9Ec%hp2gyAfTYKvg^-FM#w{v z4l=`lCHuBXjY|1}SB*jKCOQ5JxJ~)DeiX#4rwEtLd*iS9>AJu1jB6L0{9YR%&)oSG zbc{7IlrH^w^xAoIpU%}NP+9A3Y?sSqBu2ei?GV8srvluxE3)xK+ifVGtPKtLO# zJl+pk>+xQsRto~bZYp$yWDNAWM8ffFM zZm^hv&xIAJJLhWRjZHWI%bIxfP0td$JLq%XUBT6sx@jVk~Z0rL6@vGh&_ zA#XH_we)6?`T_NcWo?PG<$43fMGCXuw3i+dwa`ErgAc0W@R@h>EuNTI;q(D-A?@`R zLasRRjGnQiOst@0hgCO(sC7^rDjBaJF{xVQ8lOyO{Xt~o>+?VH3q$W1c>}Qxf0UHL zns_ST*XAjAVsKevM)x-n+Y<2(Eq^Xkf>tyD4;U-h8c}Z$x{^BSs^MIPY>lk} zBNReimXSYffHfb(MuFCGYNQy-qVC3agxG(J!D4+Xw=S37neP^_iVH2!H$W#cxt|Alq5vSQSP zV)Ed;BsDVlAp$zG`yXP{)j|FELs!B{ISqCLOSOts|A*L=SO`qvePBaz8aBRZV9oJ|5NzG z|GdQg^4~HVY7$>XC+OhxiMc)=Lr+k_}YG{DG`= zH08GglFg5@Ii#-=?PT5sEZL&tt}hj+0D5?Vgy*Kwsu*%3=8J8V=1zk*Z1_ zcu(_Hqo|@`ENGY2wyXg5_y(2-4j8}f+&W6aeiQ>D40(gVHfVeJri+{>DPCK#fRYBq zATwyPdx>KIga!vcK3J?*xHtazFdQ!e@P7;kqBvvPiv=Nj?Z;hxsBdaP$0m2iD8ZGU zb@gd0X|l!*10s_-M~M}h&)qsz*O+1vxR(-WME#K+f>(Fgv_FIg#>d5;i+i8ERZ6yS9(DoOZxp@t5f8D#-N<~`a<8;^^gs|lf% zmX@N}S`4V|nh=%W`DBS zdq4MY;*~0t2!1f;l-MwuEp_?`roFYdNfs)A(N_ZX_4ThiAA4o@=$fF^SwnxJ`VGo< z+lq?Q3!i$0mI70_c4y1U{>gyx@t+LLr5$dl^jCM_p6ju2)OjB%d@~y(+j(pJ*YltK{0b}$ZnT>u3L!M6Nb}ct&Nw6dV9vUuJoBh>;LyTN&XXTLK=LPPOe{$(2-$jjHMr+#^evd-4T3NW!8IK zh#pnN*ZrgE-MZ7&AL`Zy>5SnN63>+BICXvp6f4pYH96C&?V67bELLxABxA2$h0>%y zSbm9!c~2sK#9A-=&CK|9Dfu1;&LO>C9%Yujy-RQ^7@#MfGKvXqc}#DWZu(+|_w4Cn z(MEpIMMbxRz=y6XH!F`Z!Bi^6nq!G{r_Nt2(-gq~X!huz8 zLhSH(ClRXjAekWQNT==EIzP^e>#_g% zZS72*$iTfR57YJ5grokx&b6Lh*QX!UJznEqUIB!k9vpe*?FBQ7!QV(K(= z7e!LJHWGyadL}H-u)NDhCJ}RNkmk`)@L!eZw-4h*6xYp0&9l0+VM^`+^Uj#yd)`R- z_E*ud;NLSfNtv~sks60lgNo66EU+))xyM2EmoNP3Ih#1IH3U38xg0pPnIQ5i>$> zzo3zI-Yil)oIoQp=6}+?Ac1=r*~QbULv^nK`!lhM(!ri}7Guc8q2{tEIK<7<$%@a$ zn8<%)SdEac3g-P;vBiF60FQ41<3W5PozcM3WHvaQdYj>_p^K$#@>zM;`*4(NHV1d1 z3)OT#!^S1dZIM@@5;BTH57ksJ-q0w~C?;+4gOlLmMNV8?dhEIzh+LCJDQ1D3_XVXk z(8>Nhn2t^tGiqn~TL$}A+{|I=Wgoh0<{F~l~Wm$VEor8el zEsqvcp%L|6e+FL~WOEU?rqKMnuEu%Q`(VlNYg!{Tr={dc|9-%7(`{gOmuWQC_w@WL z=hy4I+m#yS9-If@c08XZzeuiB`x;2-@yUE~vAOrYQAH)vHNh3oA2Y|N72Ov~XpT5q z{XErBs{i-$D%C3Qzs_4#WRH;wwBr1*7}?Ave(01_nW@s^^9|JXeczmjIaBdngkNjs z@0XfL+nKV;V7b@W2p3^cqjjtxcYnKz^CaC1tk7-wh8;8tvpgQYK|_M#hGd}9i$zYiz4 zItfJ(LYQ*>a)XA~H2!Q0VaCg#&A_Fq#mRvjxyYj34yY;fysT){PvZQ|)_B3|32^5N zio_SxF3Dagv~zu73WLB?hv&o`ILD{H(bXY_st+Don?MKEgJSPHlKgM*-VK@l%l!c0 zRQvdshRUa!Q!@XT>Ul z%Z)D``aao}KEI0m_%8(B9n@h$FN(Ry3a>uvmd?eEGH4Pb9l1vckak@>?z;T^M#9e# zt?TwLgWKK|Nu}XinY97o%k%ED8kfEH_it~;OMG@;&nN?WL11JcZS!I8Ji)kNEAc;f z5KZL}R)7~#EEA^BLf)z3O zHZ<@0@(w@yD2rQIxG5-oU%I@khb*{XvQ*f)H4Y^`EXrXl+DZ67e$}T}4HUQ9!rK)O zqiw&N$5;nbpa#RO<(UuSsJCjh9mPGTrgEQo^V!8sv|-nYmsfQ}{xE;Z%z7>5edaxS zvOqhTPXuKu)qnN@(mIQQdrPS|I*Tr@+@?;xu4drsZj1{&IBEqQ5i{ar2Vu0n zl+{RuqN<r0yS zHw2*F-sh{9oVKkh`bwSIh7DpXmRy`T$utTM`w$eZ?VC~x13%()pXja5WxWc@>}NHG zv&4NexZjjv{MV!3?z8iew3E6wZzL``=KCDRI4f`9zBpv>F`@cSz`A;>k{|Tm;Ks#{ zTVl?RI{mN0=vO*$TQ}-3%v-7L%dzhB z^(~dlA6_gEL;bA?XQ1Jt#Zkd_`wjFZX3+SZHygyAJqO&8%IJVkMdGEN)Ey%|LCr96N$P%v(a2b)io|S@+s8BN_u-ID-`k(-oeyVm1BwBys>pOjzoNM77_2i(8GDd3=^J z=1AmCYjit4`zLwZ-+NweMKJj+;+8{}3j~Yr7T!O8YtUq4nJkodKZ-inljm6i<5YG? zC#3p*)sDScYp=F`w2J36KDm4{F$q02nii}nnNulzn*0|P$#MC=NNHY+S+Tk+DEn6C z(qhK2Z~6V_?opK)>j~f<-zY0Bav*f1>1S~W!`5@Rt5TTBECmRPL>f?Sk-OG%LLFSA z@M^B=2|i_pX@8>`94iU^PMc0zcRN}(rcb!s<*t;{?IpQyX;EIOEWGXT8&e>rN7zSB z)Jg|UHwij3lIgB$(j!m8B2pOUA>mNS+Px#9kUxCp>A=P%Xqn;MT2>;7;w~rmx5w$I zQ7a9X7!u`YCLkn~VA~rIE?4WS?!2nLJMWj|6UMYp8UB%9ru>1k~`o9*|L~- zx%s6|PkvUt8-IF`0=LH;CTuFnifQTUD~s_JuwPbBt|$sy$4t!pw|UulzmO42Z;hre zIW{3cofwi4weFX=HOkQTqpF*JUaCqZ?&epd!Vm6$KP0^W&Fqt1~T zH*W;;_`RX7$KNKWKbfU{-#7QY>qGIjtmrgbAKWFqS&w#a#8Y9CR^&}kg+~75syzR7 z!kw<7t4>(t)52UG@zTwkStF!e+4+uNyUOgZ**A~l60KEuTqlRseXSjJf>sOIORmxb zbvtLf47)Wpe;f(R%qDbt8~W#G42IlFW5YT`-&;) z+)cH(vDEF`_mme!nQv2RCc)OPLL+=tbyL3xvL{2UTfQ_9-|ET>>G?_4pxskk13Oix zxI-m^3-|R?Zmf^>UK{h^Fcaq0G>ixQIE%RENZhA+SgbJLn3Xv-(WgXsw6SLyI{&x| zn>C1;pjyc=5*wJP#Bm@RR-Xarm=!{#3@o&-xUECAao)kYdgtEBwKULY))TN98CM!r zV%28G0HuekU%1a#GN}r_*)w@<`Bc!xc*_+x!imN?aZzGc*{d+G6MQ31G^PV4eAy#A zHk44b%9TkSg79yb^CqQ_{J*+{-$cJtwd$@bl~~qM%~v1ozR+N*W9(;JRaneEux4Jd zjB!JOVu4ziy~C=po}{mkWq0G+KfrhuDNw3|KC`45;UTv7(~@m{+D?yMPyIRES1HW( z3O!?vxR^3kdl-_Lk9^-aSS&yT$zU_61&hbpmOLIDqnivRxiiYVsU@=A$`At>#QPqn z=#1@1Ue~Kf_@GQccI#&#tG;50aT|W?H|lKBZ5=!HBxr71`48=*AOhM&xYy-$cOQY% zdi8<_5SPlF>vzZgFoVs@3`C&7)^^$>26ULg#IO$K@LUMT(&<*`b1k%a<7SJm{Kh6b z$h49jE$NIA$58@*u-YV@4(t5^XT^dk;mbvdOCjR}2}p>;4#6 zHtOdWs=(+Y;&6hRn3^a9vdg>L&*RcBG_pgcR{re`$gq@$^4_=MuYRwvch%`vZNoDT zMWynb5Dk+~SUe-@P;Le2cMl|=V(TmRgBy`9w`NAf8`2#2*`R%~0 zRH4`TG#3FEKb}*`ioQ0@68l^FOWdgqSCx{QIWWqt>camOSbs7s-L;j_lgvoaUcXjq>b0dK` zY@xBY`I#|#9FS%Ro?xXQK9PZ{j^_N8=zuyVhe&}!YoxF09bz(FfyGgn!8kxN7m;)6 z^udV-i#Bd-Ha(^5^^t8+HZskIoo?rdORK<&?msINTXRLZK9$(<=QEOUa34y^v|Ej4 zvCDWgiOwrKlps@HpdmCg?#DV_i)9Q%wKlIH2a_XyRSiRD_7Q-A};N zv|;GWgWjMCqASm~n?&Q{vy*MwL*I^%tlgZZEqn3OBQL%0#@@`h)bqfEufPh9G`Ss+ z^8;EJB=YOpm(NmC1+MUIosXVA$b)6~HC~ieeiW`A9G5O|84*EvDWszS<2(k`N!x$% zcpeW5%KLYP^!^uAX2Jh|k>Gqy^rB85gziv-BUr)}>%od-wKM;}Be(xciT?#VHv2C+ z{Q~QMYrHgX3yITL-TrhQbIR$Kb-W@nsG&KXg^;>*? z}^T8X^WxLdmtftn@G2scJV_X`4HFfn+ z-RWIP9Ld~~DIC$-{@5Z|mP~-m%5O1lRw5m#H_PVZqZFNQ9BaWhm2`jUy$6BRz+U@8 z^yJ;2A-g{h)Gntkwz!&(4=2WgPst1JADe>jBVk}GdU}z(LKLiByr8Uw|CCk&-+grA zAJlw$#y2jT!exv)+{BGK4gwH5YT2Bq`5-e>p+CK7);~=yfkQ3~5wIA%9R`r!xxJBJ zGl&9=+x?te2>X6xxDmheI%hij+ve#C(!1GP{Pgu9H_ zUVDe><)zWh$L?Dag!8K91?Ns-qk6GC(Nh|>spSrjaraBm2>9c${dKtWSD$G4#|iY} z*bxExM)RgPt@o2vph38+arK|N?U$SN&x9NTI3g|%*zRwjXS>a9r0SxWR?^5;s1GM8 z)jfrXBw>dqwbSTX`=kbEKsOKO^XxV(!La}$0s^A<>LRW1@;(R{UZNYnYGUvn&YtatO} z#@%+qfhRB5!Tj^irGuW1mA22*PK5qqZd6>zfxdlK(k!SK`$-hkQKej$vbM5tXU%t| z{FmQ_pTic-B~q1zDPZ0xzzYOh z4jq`2A}}k_ISHpka_8I6x<&B@jRRkZcG?iZw!6Ysw3o~127ELy324OYbRfPYqW`?jA<7K;b`gl-swe;)X`6HyG z{GAxGUe00I+X(jFY#79?3@qZ}&s}-^Of~HOUH|F13a0gZ!MV%^(kcyea&`@lo?I>l zhYQs_=L}Wr$Kw_Y9?6)E*zq3rsOsjAL1y2I*UT$p>fs6Gxo5Ah8MN%k!(ca=v4_B0 zuEaCYiq=sq@vu85n{+c>O5RCYo8r~BPr<_8@!Wbq-I_^2`>MO z#cKvEOj=!P3gx4Gz8aILl{clqKZj@L5o@GPYq6b6m z??NNt=fWNaY{bR}`D@<-_WY{uRETKcx{9*SAa}9wYHfd4$=^*;8ZEEf3!lD)kybwD z#me!?$*d!nljGHj>I(^locYdQp`z_hdnYnON3xNNxUumG%OQ$=qxPeGXDQoy`W1f8 zQ7@FEQ1uSTc72l4?M6+h6BXX}=l&;_&`k(uFD(t#Pl@0|d z0VyS=Q;<&Sh656Z6clMVbV&&U(%ncOy1S)QQo6ejacJ&7zTbDpJMOr@-~NjMn;p;I z&wkcibFR6(GK4yXWvCaNuryux0#79!gf$fPY5x6Kr6<_r0Fm9cblNv2{QVe!d{dEYh z-6=b>j*uhOY-vQ|Go^gQA_KD$T*Il38t}Z^2wK~)IhST+M}vwM=t@<8W^+_m=`z4O zg-ayqh?_>XR?{Dysd&k!dfb$8(*2mjp`q`V_gdtSWPs;M4m?je5#x6m=_84pK!`Rk zACJYAiYYm~pYg%mOSQtlxDK}vr@(c+J&LAeZjWwO%2#Ze?bs5JQ7Ht4PjRsQN2v;9&t`LNgy=8E#KajjXIn} zbzu8rtgB!faO9|W4PfU-(oMS3vYez zxygUv_~{Cq&tdk%^)XxjSarX=pVz6IRRwQ#_Q&cht9^+iTdY}xG5Ne)9rf(_6syHn zeaB%4ZqZ5(VaHFJt7n*CUbQC7^j(8sOdlLiE_JkYM~uN5u)Rx|)}I?`B2HA1*C*-f zz_h`J3uc99`NZGd5`7w6o#o4GGp1{p>26HJNW(Qel6Aw!Q@a3oQ3;~;@&^m_N=e^ATddy5xkR}lLxfoL8>k8o!HYHL-e;$OKLfQnt_RxM>mxoN z9<{v}f0Nk{+nTQ$@#VwZ8lZUBHME3-`F}nJqB3jzxm5>M>`Y?)z2oF9%0>1YR`@~C zb#0cO?UylXUb3#7-LkeexERp z#clP-r+9SYL5WFI9oFi5jx!OnIm|5$e7^G2oWihz6B3VXsf;dF+^L(xfBxC(ovOcf zWX!(dzu`~4Z)7rsoBpY=V>T!+k$|OZEJ)WeOGm7NqiS#3NX*V6I!2J+jb;8wVkEdA z2QQG7@UgXX18L%pFB!NZokD!ZAFjZmOe3Q*h2+amtex+T(qkTtFH8MpMGZ!Q1U{#c zyZ~u7CzB=F)*hR-W0b=+Pngz)Wr=}h4ol=_#J&q3C5Y(m$#peYTG2zO{-FZjYhQlP zvzO<-wB4zVJj61GY-pM#40b!Y3^AOK(AuGOx_(CV#cDCQAeIHP1GYa{V1UDDKa5#}l8*yLG~9Et%PzU!mojJX?2{U+dWEPUFo@l|2}XI%wvb!wFRr(` z#bwr70TYM#o=!Ftie6f^hJJ-g0>*#DYMQS;e{>z>bk$(jws>I5~GSsP6_B7++L zFpV-*+%HM=ERTnsL-k4CcdC+Fvrmy0Zf6Pt1!@$Z9n^^oLF7vW%A4fsawW8N79b5@ z36m}u3v`-zzY-FmEmvV~=!7LZea-s5;e=6O7EuWQ!<{}|^QwSo@X~vG8?V{9`z@Q+ z%znA!y=Pe=-mRP4K){Ma%@~7^qk+3IUdY!1#ws>_{twTcM86US#&f>TVPQMkY@K2B z)Y))tg^PaQr}(Sw;-Rr^d<2?33tQE(1H(V2gO@GARxk|y?|7wQ4nHktH0kg@?7{j4 zSxaG!XXWs&Evl}Dom;J{kDD4{Ge-?%-9C3TY+5>jw<(U(qoY#WBQU;vTxI@E+G?9A zwC4*xj@5QE6AsdR#hiP#B(o(O_s=#taV+qqZXEp&QcXrwOtrJ%FdA^}Nup`X9_PGmCLLY&A5#NXq9aD@)QMj)9q0jD9&sW->DQ^iTY z9;V+Pl3?DZnCdxpR#R%B61n+orilalb0xLn0?##qn?rg^e%xscO#ze6H=4XE1WlpS z;}Aay0fhfo$%6o0_FDQZ?D0YLfCyq`84o~d1HCSZ@{HrRD1ebt51>1NE;D=qOnp|o z{9@brH1YAem67Of`SK6#dy{f;TKVJvOvVWaV$|!u?E-=hUqCcO&CHAqh*rb^8wiAC zqoE!-uXK0Uyzn17Q|kth4xlsvP8dQx3wu?NV{uf+`a$498c~C^&fS!^35tU@X^*02BpQ-RiMpjx^V`A2*+Yo&NxS zJr9RKf;WU4O)-}?E*=>j#|XIntF08VKu)+icsaKjdi>df-u?f zr3C7E11=Be_uX_x5UBQlbV9l~6aqPVN#1v-GK7SLMu0@heM3mchWVY8)Q{IsV<25I zc&9-A@(lN@It^hd;+W3Ix$Bzi@5rR7XTW6br6aR@HK(g|*n87(j za(>zW9}&|u9q^whzz|DcdLd!P9(bTWiw`cKmK~!76qB*-KaQ0Eo{0_zInSZ|DZW1) zHS`Pbm&%F%8QOnTQE;ab70&+|rndrlhFFy8GDF)uVE1rx3PEQcjedmCOASBrTcO!t zym>g{-s4&I%=4I*elVne$&&zNONH_%iU-j^ECFo)e^@-K(sG6kad6Fkgb5MiCn?OB z;$sd9pSx3YHn&`>#l|?qS?F#7Uj#({K&_M3vVAg7iHtj;S-tiCQV)?qh_mVq|0m*k zYaIQ~=<9gSk0b>HMnH9s7_?vVT7W|qVz*e1+~-?}=X}HUFW|LH%ry#BVJD#=&ZX4)$&1Jq}$KJt=+U%yzhB zH)uv}Z7REBPKLAgtg&{f#V>s5_(c}Ux&E~{ahhs)xUx^nNWQAIy~%ihFubvquV6nk ziJ7Cs$4UlTs-*>ZGokzd{`2i@T#Z8d^XTGnGzDt)_SmE(i>+v4gj^3QPaFJY z`q}V;#Q;_nmwhrkBZO6Njf~~PRI_NF%`84fJna`t=Pn7WX-Bg--xRFcSk8}7^T~@e z`kA`aj%XAz7_8JY|lAnAYP@e>T^JPq3sSAuQ?ZA$nviu zN*s3~XG?C7DAVISqYm2_{J=`|Fd2l{m3)4l{NmHuOOs`xeT8-(8@>hB=f3>DfAPo*&qq*RptoyM9WV$Z97A~ zurWu-_HOL(h>Xy-EN_F}4fVmgHJ+w#iG``Xlr>S*k#pt95(DUg%x|8r$ykk}4Zh&k zaMXZlg|v@^ZVz)dPxG`@ouRI`-f`6Mv&fp`I>br+`ZBO;t;L?nKtQ8zg^Wo}56fOV zODh7L${;J^d8aeGDdAP!QiI-ll~Rdx@~&!!S@)}uHggl%Q-u)$e(!<(ulpE1&pX22 zxZNb`X`b*MLx=EvC3}=mKXRU#tWYx;E-I5C-dOpWZ-c)ZTjQh;- z1r~gr>fiG`$@h(~Wx-|tIX0VSd%~^_UaX}(5tr2%EzwykG@0scTV0wo)0G#e@-h2j z_a_l#Ne%*Li1#rx^R=w<`eHlG-gO+}!~9VMIe*Ub4Xf~adcYy+_Qg%Tirod)tXA9w z^~Hj#t&~o|x5IvWV&g5dk*X%M68Be%CqQw`$lj#rtY&1Sllbr-pX3G{CjOrW$KTzK zEy;la`gG~uDuP0KTK`fC6fF3$GJG=g2jU|GDmP2R5@3_aHy!p2Hs9GOv=qH6^`epl z;oBy>EJ!HV|L~M~i7IFf{TQP;G}eAsq5g02gg#MUScY)HrCtzKnodOM$v73d*yo96 z^iuVT0R}R<7$R36eNM{euHu;WM>SMUcY$X_DEFKnUpMFQ;-LAg@^9m_lr?{*n^@ZX zifZHY7PYLcdO`F>2rzdN;y%)%tFs#{ z0v1LoDNxV;$8EisWk08~A|`{^$uJbHVSywUMXYkU1-3T)I! zOWAF}H=qi#FDt@o@yKarwVWcbW73TmI4NJep}hcQfj{Uzr669y+Yk03>Tp|TBr&?d zY#ABWlir8ON==a>zW2~fsX9U8#pu<--%Y#Ig&M}%hUd|{4=-g;Dep%J{_d{#GU>nG zIKIHg%OS9HOR$X!=Az{Y&E^pQrCF&^t(D|q%)DMpR1gqqZnEXSK34bJLn`BSPJ)gm zKFdWngEYir;00znWsR;u_+m$Q3!i=@`RKM19bsqsVN zNqjJr|KHe2pxNl&y-@GDcWM`7nKi;C^p*#w*>!qp!w9d7bB>*Vo#0UVWsst;;sE zQ@Big+x7^O?!fyydA$fcSTKZ0o=^w9;Ryb1sD=an>yZK`64i9ahcZ}vPGYk}Qz@>| zWA^pI=^3dh`fJq=)#?rm+C&XetCbZL4x-#AgP)sAP1*(}bRCl6^{AE)*iW%)SxqeCKP6k(*lP1~^ z_~()7lHfwyvobVZl42frxZLYCC&Sw)aOIx-s+|zeZlrYMX4m2jTCDqPv3bf;H&ejF ziuLFH2j>ynKFe{Zk=ClsJii4Y?t`X9Ewrw3)P541?`^f4=n@_~g_iuoXi9(v$&LGo z??@SYPud)p16`||&wKkM{+?%U0&BD!H|Z0@qm(pPU0dK&dT_!PpCQyX?$QlrbUO}v&c-~#w%wlX(~8QsEOy=Lu=8_^wIRn*R( zgHMwp-kfhiPunL+G8#LBHfbPU)~@@QlM7104hLyABIV}g}9U9978_y9}T znJgp#%p3i;hOZg1@#qjbb9GDYpW>JY|@*- zmPfIH7b~D$o;C4CEc0h>i$glVcQwSqT&m^k_ooDEfrVO6CpHrd!`(0TcE9Zwm9=&P zzL!I<0QdlE^Y#J=8_NBevfhXL+tV_i`@!NuU8n|7HGwt{hnM>3ZZySsHWlO1y#Zze zQJyZU;y4rnh_QjV&YJ@;R*hBwki$toLxvGhJ#H>Hg9?G(Edj~{T9eJaGjb&nls-l z03-m2?1BsS_-}Tyhcyen5_9xNwn$0!E4JQbHliusb=m;|P{;=MR*`%AZy)r2W)O)onw!DQ~fec zZtd~u2&&&>=ptN>ng%n%!c^Khg+K1J?K-SS1+fP=1cZbivEJ)|pDY)bdb~Qj=(w}$ z?#0FV&}?IUH!>KJy5E0w;5Yx`IJMBhdZ{_--w4PB_={Z8S4ol-w)7a^)EkK0a>g+x z?L&_uA8*uio@6*FbM1TO{+fA@8GnDtEXmc-v)(KbE#yPbaSk5U%tcgns5R4-DlAP$ zoU~tWuX}2{uVk0FgT5wMolk3MzS}g_>T5~MjStp@^oNh8d3opbd(h5*Lja5d*zW~8 zgx#Y#TcrrRCD_9wU*PG)JNUX}m44F$>77UU(dR&&wt6BTmv}TdC+zb*Qr%pfmXRTi z&r9#s#lEJWbUcgJ)n-Z2zn(oLSz){4E!Di2;_T zQ6#i^hbw&_y!R2&+phQAk2s7nb|O^Q78c4n`ex6H`6SBZ`tORz?rYbw(Mx?T`G!+m zRy>2m@=pF^)88;boZ^O*yZhUr94El zPPWTIbd@F0g7oZ!lCHt+^iW4Sz(Y^Aw`Fo^X2m^i`J%o@3R6$?PO^_zRjp5Bn#VUJB>6zDnS2?>OC= z+tw)h9Y=6X`+YP1sQxiIb9tNMKt)+w&n&y$Pfad9rbBXq%sFd)xB0X2c_Ek3{p2La zwoQJ*e5!r@2>hAlT@#Y`K6yDR|Ay-&{2L>6VWj!z^>~YsTCb7AuS`d2cAI*(tE_T9 zJErluzra*A;0$MTZwd!Rvu4+RFOpxd{t-&Q+xU8z+O?>49ixHYt%Ksm1mhrz;Yjhu zMImEXwTd-lqfRmEeke!t_e}HVM%zZoyS%l-x*;uC)nw8S>!2{ZLtf$Ri4Fr!<@p7?>Vu^+@iF}Bw|5=n$E^Am3GWoN=g&JDz-i2l z7hS|0N>nOw_pRhksL!g3KXL8f?|679ylz{`9r*+An_c!g$oC%vZ~tK&M5~Lh8ouZt z=%PBP!WZJC$h@@J-Z&K5ioX3`uq`FbEICx;R6CZ+RapHs)N$Eri9Ic}?t9-^+|M_@ z+khn{qAu*0tHMequCiThnlSfAyo8XFq%dV9tP7f!B!aiUP4@Xdn$Xuw-N53Kk#1qq@^JCqE9bc@UMeye(Yau%(kH+j3y! z$(xsK)h)#>+{NeD9urgwoeRkyQI*@6_n!%D%P-uDb80pCvAHZ|^;^Bx9~7;J4;XoK z`?H3nRf0#EHO3j37(ai~I8QkUGbN4W##fTrN=$+cboAxjuLw(ZE5tjzz*BRI0jBLj z+!1b%@fyBHlG34n7T^0p(JS~@1`-EW=GIkq*W1H7&<(cD*sV7KMs4MBUEBfL331Et z{8i}OXxeB&JFl0WPwj4H&5?#;oY_b!^}Z69!Y@|r^7-GDR(tt*PQ#!}5%{_p_%gx1 z4Z;sO#8>~`?!etvnYmG;?l!AI*xjvR>_LFWe6uIee4t;HphT+m^1U`s&8X`3tD?#6 z2dfE?YT{i>fAQ4abW^mR-8DLJbsh(5TX!IbwBAOQ{F@`ucdjPB_csfVm1o7x2dS2? z3n11SYi{cO#*Lmg8yZ4R@6rBdGS-kbCfz4Si>k@ZX7?hSGC=J*2YNR!-AF_Q=7%)y zI9-8SKxO3{q76N0_JY~r|qeMlP2EMDKfyls*^{TmVl!x8+qkT-E>B%8J$rKtY zKJBySt1t2$+MF;S7|9x7m^NomlxKdv+~;ttkJ0EpW4uMq7c4Q@cd)ayxGBE|Gp8gB zPWrHM`cCb-wmVWd3_VR)uw2&O3wYz666o4K`*zi@SGju^*LB2nQ8Azer15Bxp0VOx zJGAd`5@DBv@X z958uc3E#x2hVq-;$6Jn&!&2%|M0ew$zeG0CTJC03Zr14tFg}VFuB?REkAsJ2;r{m8 znLhnL?T(4oPkd*kVW*3Ek4mo7R@o277>p@ZZ`ZiE8B;GR*kdY}n||}}e{*8bdQ=)k ztHtCv8{w+bR}mPL*JqAXv0FO0?Rc-Bg_J!;Q`)8QW@c4qVe*lVp#J@I%SJM;)wYs( z%Uat~+>o=c18Ow+{9}3(u!P=EojC?#g~{s=Jk;;%z($(&uR)drj#o`no9QMiuzQ)Z#T^N#Va#^}5}e(u!oI2F+u>2bQTtwRX1rrFN6 zNH{eZ}iI{)z%iTW?bw*pWjtn(xsO8z5Mm@ zV4)$#P@n8O3ftLuFO4lPhtny>8R&`fCS_HvY4mSZ_1%%=pW+I{rc%kpDc>N%)_@O; zo-*ZxM|iJ#zc$mFz@Qw);raHQsG&8t?d#fo|K!T&v0SdE|GOzR+{tiS5D@u?-`GCD$EoD8x;1FzkTa zRluPou;1|8Y=a~xJCP!}@Bz z!s}K&?ARinhAg{xdlwFcF{p?wWuEC1!L!UgVkC6E@x@RnL#OQXOcHT;{lF_s_2jwn z5jAe+>I#=Id^`}Ch<68BP4U5*=H~KnKWDIa4Y?{Y82@z%Hy0T5Q^R)d|4<8R+z0#dLbl~*xWsI?~nAjgsH?X)~7X%Opr!h7G0f9!1 zoTlzjHWO{WiHP2l__@EgW9=?>RlLLF1djI`vG(}*WqDM#oyUG6HEa0a=ytDGPcV9Vb0YIdssrlQu8$f;0eR%JR-y?R! z`xEv3nB%{$=D$x=m$+;U057a79F5(@u_M~aGOrg-s-NNmTwc6W{pf@IkX*NjXvcw7 zCeYkPsL@^xc>R7dGfUzJ&ZQams0A`_Kfh__JDszx%T{V}m!*O~2l`I9!ojZ}S1${^ z%JD8Kn56D?Yb3pGN-K~jT6IkwfI<~mFQQJjV4&&C%60wv@b#7PqqisDnkNOz#UVC@ z(7S~{uS#5Uvqz>ceKS~{oh9cUaO$%pwPTP0^mKtB;dU_UcG4bS@5iz%+>Z!eRqm=! zw%xjKJlxSw-V9&t{4J+Ro)Ja^lTi_0%|Z>B=7^odr!TqfWON(*1A!B}BWled0Zq51 zf)!l0{O;*v;5wfBdLMM}1}`j|)JH<^>!FtV(^LDa&Bbi{bz7TWcH34`zK1>YJ6N*e zsWp$vQ{ty-XIW#!j6~Wbo+pQn9P%*%To?h>_b?mlOl^1TR zv*?WD#M~^0$vwI-&@T$Sj5%_964Rs7o+Crqks~S^xc%^;-TdD1mGgad$A&siUbG%G zgtI#eQ?;^(dWNN9T$-f^pw*Bqrd25$rQw{w3(xrM*R z6xB+h^uzm7i=QsSsmJUr1cZ8? zKu_$`;I^9x^@HZFdq9&aNVYJkD;ZFm+@7b^P|P!!35xqdaJd&Nkyz2xpT_Te-C=1_ zgbh)o5M?nhXGWT;gpF^q>*~-@is~mVPCf{{kG&_35YwIX@*K$EMG76Ro!{)dj^oaR zY*Xoo(5sBC;-jT)^OwoLIAD5@J+eMQu$~XKgyu_rXepDDQln)tVq#+ITS9yi^Yx`5>9+=-6BQUIvM>ud5vU9^5Qx zs04vKpaAZ`-`q4&N&%l-PPIU4u{TzOic6El6{>1VxY zar+fuv_RJCthFmZczMSq@#Nlw;r>LVd{r{$0p03mA%|Vl`rIT&;m)ne41{VtSnU7& znxAZG#$Mhry-~q%`lHdEdVXM`-`^FRokSyMyV@l~aMZOh}sEvMN4AsWE6 zW3G4wVcIT~EE{*C`-CRfvOfgH$dNQu5%0K2BN5q52&~7)vqed%W^S5G?A+3iJbBVF z0Lc*oO6UGFddTiLos)%J1rlsM=05|Dz{J)W_^{RHwRK2n)$uK@0S32 zEFx;H=U?u8{hXj+xB;-^`xZLp@G4rBCRSiYiGWkk3%Mpe+}>WM+n!w2=GJ=+`fx%V zalTvWe)AR`67Q*F|23;UinO2JbGps*t|1^w@TCqkI)yH7KC8;eJv&gAj8j@W8rff@ z&qILABxROQRW2TH%=|e>$9&f;`t#_ig4Y>K%onqtkULXy=Gs`5!B(4E*Mk{*bEc!kkIJDa${^tiIiAa67 z;x!!|-HY?d0yRl=;THFcPQU=qZrKaI`!X9)A{YVPcisaA^%V%w0$^zPWud+TC;XGo zKG2$`^RR9ik-1F*++DKd&+3?FH#Rr35Y#Mw^@?y_53%;?7wnM(RL#<&Ia)EDUnIL zkZvV&Ot+wZG=XtH+6kD(gLuos&HgFSLxun_L904)XBf=IUItRcmWml7V3#J#DQH|N zxojrgK3(^V31FGzXVIyYa_OBo<~S4##uY`;ZH43OdY@GK=yGARKJuX}sk|fA#N5Kx zm5iPcKI*f}$q>a;o23Qpz@ErNTN^X6usmzdfJ~~%tll2C$pGG6fHO=X@~`S@o=GSO zd$Gx-ccHvRY72w& z^NV>CgI$X+8V39}I}5VgeCNvz?RF1Q|k}0wa7?0KL{>S=O>u zs4Al@C8w~&uQB?zX&q0^jjlLQPB)BJtPwWAY~S^q&**GxxY0@Oh6zxY^nL-v4okIw z6Wh)9epy>79BA*tE@v6rJV?u`gwOLYgu(+=2S`zmJ5+xjrA!4Z;aqpJf*=V(ZmX6n z?Y^=qD!qg3ZN)N!1mj3fzyVDk?yj%y&PJUqW143sfo540R&vZS8`^nV^oy)VL^+8( zRt-AghprB5dae$u(d~_~q{{+D&EQ>$Ei=)$Q3>tV%8c9h-q(q{48*NO@0SX(7c+*u zLyet%jw=}0Iyjt$A~*j@)4>=@aKeRmJ~#9{z%=PhiANu@J4}E@Cu#S--wXx0I#kVa{Kj>~Y)P%upFqoC z)8EDF6hTwuZzC_qCRQBk(rrQ% zyjl^HlbXU-SAoO^1wq6;8!DSqm=U>89u$}iBzS!(!{1|bEayHgMhU>nB7U>@S9zbdt z&*m)MGj1)*aWhR_Q+%4z)~k>*x5A|{GJ@Q=ibg~`jEw@`Bl$t0^dA$ZPFdhuSrq{5 zFhN-^>Luo~WcxQ zPm0`3Cmb~Y%q5ok@}`9flFC$n4ETFz-LrA1=XJwx@laY4uq$f|(yo zQ-i5EdJpQHuW_#?lN5p4Hg?zM$PQ{m#xJ-)osP!{AOA|WoK`#rMGQ7FPNc2x3wSr_ z;ohAfI*Vz8orr)o5G+Hf`~*BAy=F_#^XQcR^q+||KzO~w@rJiWZ%1EAeNabx&oc&ZwHV7@J?~bs)@@@7D%Dl z_6-bhIY#vdJFAFX(^9%^;8C0a4Pu_ny)IEu5xwX6j!PBJknSphOT~8lPL6{Pe6}H+ z2Y7p}#i)pM)XW%!9=G1Ijm4?J>VeO^T`z@8ra_DQmh9#m8bHVrcVEUK4xnN5+-to! zD;NxRUXbMtETiAIhWT%>0jf(FHYEYu`$=`}J^ddVkts(Z9fcn-zj|-ed@2omp(y|> z_9s0TW6p+)^#BBeUB~vi^TCF5^8-+T$^PbP3<^K~6HH79ErU zwYX;NifjX#w;?2Ul&mU%7wH$kpM~PhxU|vfWj9Hb`PLu}j@xFKRY(-Sx%3(4w1f1o zLMuYYZ}e_FQ;Xx)Si;{W!%NPd#!T@S~eZXQFd-2B$t0G(Q&%Z-Acbg9&|U}0JsE&x#QaMY>XTH!7LYR%-!T} z{LuX*`><+~6U~EZAL=0T#`f*^Ev1vf1DRQEIkJksI<_%$I3yuDG15lA*L1$hZ*n@J zr2axX(-WX15gbB80&K^{D;ojh3*63eISb|2JSrms&3FA>9K4S4{BWUXm!TqoC<;1N zoP7o^apq>F&R~WaVKrjT(S?`;IR(xym*ps^SyHiIfSbu_N(&2MSgxQwX8rlZtE9|!Gc z&yF|-=7{{sY#pr=1)56lm`+Tjb$mb!ugSCTTO-mrlJwl$jcNHv9Xv!N&=s?Bv8tYk zg(m%H6g&EH0A|SAK6eus!^}-jGd7LlXXYswOefrO&vTMCUr8@;2}k&Bs?Q(FOEgD=T<;R;L#NtQlOv127CL# zLKcTT2;!jfJscBFJ3TWc7#be%{N{Cu`1ns{q%;_9zdtK5)j?rJ4vF0Cxc)tVvD)gm z_V@5#md5?o)a<>woC-1a;bWXR@5mBYxTLi*v}(!?jQKv2)Q~4G2Py|$K@4`gYZXk2IH*V-pYj_6UzCL*UNlxbRg(YT>?Vs7{u%i=EZcP6gfN>Wv^BvtO%=r#;t{M{(Lp zOUPYUfFNT#GZR=uO6QHSfmh+rHz9NyQD(7lf4{i<;)xDVoWZIGWNx%Vlk$R9uKGV7ZiE{g%!wq+6c!2GyGddYk&1O!iTv!exPtRsN(7Mw-@|w z%{u>vMiNmNl}*AxvMg74|uUs*aJR-V0m&5?gVh^M@$CrH`ihDAD;R*6xntee^JsWNlQ^w7#_9Lf~ z-}!Jcj`qU|9Hiyz__c|7Q_kTWNlv+>B0?TKJw=(E3NVt|S4qZtiEA%5_MSKiG8OBqFFFe}p*|=7H>$v>O zwA>t78eVEyvRvaJ9D#3@T$(DSS(8I3b8A9twmY8tFQ@=CDuqmsB?E(ll7MJvSib`{(x<)ydn$i;&e;O`w^M#xE>qMRs zU?0ij*dO{&L!#Nz=K=ONr(w3L(!$wNV()&jx*5yOg>A|WmJB0Mi|a(Fc7mZ4i(YJ2 zXHk%eum{xE(_cX*Wr=w#)bigF5qVz_>OW0*tPoT(p*ayb4`@>SFDG05b&3h`vPj7V z90M~Fv4Knx**3)1`G2qJ2F{94^O+V1P(t$V>1mb`MsLus{}kg$8%7%|yCedZg0<|F zzC2acYlRLxhe7>BL=|$8@40%1NPNwR^y3}u6KX0;7XyjCPLv~KcCz#KTp;d)Op5fxgYqx45*1}hC~tuN|+ta?}WUH*oOw5SCh z2jgE3Q>GaHj*Ch*pUQ*%Awjo+JervN4{v;)ntu-Oz;Ll%v?ZmJtwi6E(ge}vC@dk0 z9-I$#H@3HX>EsNef#%g9RDfjgdifoSb#RqCU-AA0>jpKu7gMcmMoz7&xEeqQ$cMH& z$Hj-sEE&NWj+p)?KT(Wxs`_qnvyw-GHan9vN+I|Mv(aP|YsBxVK1YG2fJ4sbrK!LX zqWTY5lmFJ<_OWTFG zR6P0|v5Ms?8GcBBfgZA(?vf{ow3i5DceC-`f00YR>Ie6ZVF-$^`hD6wZoSNwB|$&lSd{_E7I-W zwNP=KbrnPR7^(tD5!{hLU=@hwG|!*}8=CiPxCDt)^x$Am{A5BW=ruh4Ify8 z7+i5(jw&eG|D78Lu|_~$Ez+V2p^s-)wmEnGi5!cdj-Q~w)~;9tQ^pm*T`rl4RC>)C zYW~(-jyXVS9QJy#0j-P0FyvHtI8W_*gUFT%L#G&)9%3v&Qc$06Mr3F6X27F4gpD1q zTMv*BVok3M0X1gEKhCLyz^WnEEXTEvb4FTHS#Z6Ox*--kydPGIDVxGs3}Bp7mJ z9H9*pxC*IhmWrKZVlj#~?jU>jl~DF#Zwg_`J3J?4@q-_3@J;xLrvR@<(H>oj)2hmW z@s;xI&t>#legcBpjh>f0?~X&@N5h>BKu&0<@AWYTt264eCAaQs)%O|AGIPA0o{GmD zfiXXQC6!zl7lqc+h=rpX<}Ac5pv#Voq?6r3efQfi61`a zdBOQzm^^RvDnmA>$+m!pKotSk#IUeFt{q(sXIVX%+!HtBAjZWN-QF2DKUEcoZPNkQw?khwGdU~bg#9TGm z!EhXh=8genA>mEo;)iS0tFsDDs|hb;8@JcQB(xLeHDlMdokU%uoz}y{T+~p_BCQe$ zEv@*ZB3%Gsj#Zi|01F48n*6eq>hpyuy_#B4>_%NBlUTxf!j@G!2*uiauwWq4CQ_$} zQyLdTTxt`fs`?E`NY4!g&Q)6waB*`F>%*YsFX?{_0(DdYK&p2g@F2d)N09(}!ifP& z&#_i7kF-xBh2LKoHsC#qDd->I#0S{$JD@7O0be#RJ}4##ao?W<`No|&mn|RXy&pSiengqo$i#d0=oXd;4oFyG-fRrCnj1x#aTLo5#zDd#a51T}!Q1X8Kc z>hfVKvYCDJRd+b}G`KIj6A3sngLrf`xtypp*=sqdVOy(r1|Ws??koj2K~#yTM34pQ zoBmjET4|KelVUQaQn{>GMQRmD%i6Y*75VT~y?K?zZ1@4-IDzj5K2tT2c8sNcA1(go z(^9R#Y{vK;t#3?DPL^IM?`ln)xri8=e`18*r-o|6Kok(uM{xF6WEcQ)6kh6Pt~cE8Wuy*;-> z2f1fr)c#K@$cg9`ha7e^q#@>s1yBfApi`A+;}o6MXGY?H8E+M;!Ld(NY=3~>-Ry;Ne@+3r$e%#wWUYQZ z9NUvh11LFjvW$J6{_lo^nIr>I6!FRb`EYZD(A9jMlCM+m_x_g`k&4UhTmqQtf8+Wu zCP7?RU=;9XpnVMn{8s+`;R_}yor-j4%rPh=A4tL(0RbC1T|{u_+FLi^DE)!i8`qJ? zI??UY-=9Q$juxV`{r7LbLh#|={UL)F#r9ie z06TZi!>z502_4f8PA6%D2-e!VjIZJCy~_F7zIGV;CZ3Rk zAvEZYt59KBSX#909)Fp>QT(B?p{(k=a&G|i+74fh&KPmN9J&7_0<SIb|Ha zYCzc-QTL8UVqaQz$#S^!W5bzKo=o^bK8y?8Br(7+C{ZT9qVGA{)j;WMoim?gNZcyB ziRyraiZrwTash^k(xUzOwqZVGwV%;iM(~$V*tFG${Wzt+7?73f=hY zZZh_d9SmalF+$+Laz{zu3uFR6XCanIN)Nvr(=gfB37yCGLjx2Z8TZ z%EJYfP^Db1)OTe5o)HA4&$8S$RE~m*E84H{HyvwJY_zlZ#D)5ST0cis-fJD@B`a3b;Kz%x0!z0BHqBfu^I5;}` zE_+MK#uuLGux0FS{u%76s1W2GQMhrdAk66vE&ODT`&)Ix*g7*x3{ez=->{$DGx0qgp^1qnTzXjd&javcM?UxvtxnNGFUOS0pV^~=m{F$>h&#}+$ zOQHrG|9qO6GCRCc8nPJkr~Xc~tIx$^Wj7;$qO(Tht)aoLOiup|^P=l~heAeDwZ=AB|-fMHk+r#FeH$t|L$=%;A!2X;>)8pw`ijLPUqxe{RRe-~)$ce59s==3# zk_m_2)j>Ov>A}7uoqzQ$)aSMUer zB#EZfS*!|2oTA=(|8OB~?RSqt5>3_pr^R-gms^{xMNOgUn{8>2Zheie&i!Zq4`FW^ zRn_}NjVdiE4N{7GY^)xiU@Ve~DFt0GdX~VC%9$ zMA%5s6ZxobX@0@Ev3_u^g2o39Dh84;NLx-&G8gv(drf}CFh#4Rlp#PgGIq8-^T^09&2DEh0zOj;tFwTHs z`7e|RT3P6Uv?deX64;sqy<%U*4g+=>={8%#GnK{|V364;1`E?yA0^ToTGHcKnCVGA zdl9n=R05y}-79F#0*?QeV4J)fY|fAq*TtdgZv}D&&?JpKo`?8Sb0$LbeYR%ycTuf8 zs*BH;^y6HT7pE*5xz3^-W~?hU=R>Kf=j`aBoqEKz>70U_{?j9t;%s%}uVeqWn;MYrRh6r<(rLPXQ`J_5@4a=l8C-jk zxY=~h1Gd`Xk6d>i-#6dCNYno7OZ}tPsh_>zXKNVr*U!UJ{?ba}eIoH&DOZ*R+Ajte zZ;w?ENv_!6-@20H!^ymMJeJEpXWu;zA1$Hfn$7JX$GM(whf@FR*2T-Wbp#16|1$k6 zEUWm}D!P9wNV!BMCeu>+s{#EyWMPnZQM2T7$jo4q&L4feVWouh>!OW-P4l;4>f73h z!t;yk)jOf(O8XTJ@%lRhdfs#y=3Z=`QC@t9D&{l(xmASy_U|>U(ELH3T_yebMEXa+ zGLI*Bl9zpQgp3f--2=^0lDS%o(#XN1g~sXqXgG>%AtKGM-WUT!LNq)4O1e>3P45UI zmpdy<8w(TT-4zgNWmRhx@f%|`$ieYnH6mM2vug)}$Q(UyuQQB4S5Dsgaq zGx{|2Cf(AD6u1m&Q`s{$ZQGu(X(T zg3Ktygrl>-xX;mmvKZ9rs>V1G^lEM3_p{EozvUc?Qm$DnqhDkhE^V00|Mf6F<~lUk z-BE7+X>;87Gbg=g@`&(Xl%7xQY!`V&7Agx-_55Bo zlf}UO^WFiT>`+KV?&)XYez|0k4I+I>D?-Wx`DojCd#3cu9Fcy`n4f*fFAn`9U}32c zVRH(kU~)v1Y@s@qc`a}6SLcvl3y*-IJKJ{=npL3t41~Moc_aoR;iRnJ0uq34d;5n< zRi}Cc+q$Micj~Q9JgP6q$Asr?6O-s;i%!-%#M?1j6C@+Cg)W*e1ed*pVj*EHL-ckc zb0aHoQlHy&V7y-a(|UM$dPD&wt*T*n>G;A+Up`R22+e|*+@zGSH1v=J*OQG{m0jdM z4aURACLy>Eb~j#RLMAEE2zT(}c=+iw;GnNI(7mFOt-p%4nNdrl))qrKBCzNX13CJS zlOQkTTgxmFVFJ9EnzAig9#kAS!#zn2)nRf0ry`?gC(ff?_I{J{s%&+vszVF*l?x1m zQ_J?+X!thF+zKmqcTnNa!5SlsIQ6P7}6+P2wt;G==&WXJqN z>HCD$(6OeU_(Logyi(YQ>1r zZvY3B%NH>|!9P`Ne`r)~SOa`CYn71}kKGj)POhJgD^XP$9g`1_}X*V_PbN>K7Z{gV`Cq5NGM zZU(gqxDX=FZl4#}qm2$03s_VO#T&VU1J-Ix^Ia7GVA@yW4^&%;xDu~DSZ~=65TD3F zZ8Bq*y;gh=;ol_)cAjtAHxK5?Y2k@6ot@9L9L%egFY2FJY8>X2Ann=qNQ5?DBiCnm zmVR%PA80(T+oW)GxuzI_S%JH|q}nVbBWvntW*SF30=UBm&{T$LLWCIB7sVbJ-uY8}d6ndMB2{Z}XAf;^+N+$x$(Xz? zbG*|J7LSa-h8G`0tvgnS9RJ!wF`xDb;ByV-Mwv>4ub{!8w%b9ng}|eDX!>jXF|?&# z@qBvlC-YD;$>Hh#J%)5M_xHl1yTfUEbq?ZpvbCHZOmj!2okLI%&^aSR<;I%i7b*@8gxE6USpaNu-Nf2+h-ulh3b+tE@wfQ^!9r8@CSuA zVKJWRAjAkUv>SmY>UV+V51NJTWkNB5#E7vAzvdY~id(99jWjFA+bnKHvyF1Uz-poT zB=*wm2>!W()HwtFTM5^ZeMOtn0Xy&5WXfl zy#pQ1-FUz12FjkQ-F5M4u2e>shJmDmVa{n%kbV$tuTuB)J+UFgZM2=vpV?lb>|kBj z@GL#|udQSLGXvGD9rm-cTBj^K+Iae$GZrgIq`ey|!&!PFNCsvbYkP(Cv0{7@5l z@OC#oRA^1XU$Y3klax+89)R_XE>hVSCUGy!lwL-HlFiJaS*_Jas5RqKjenG$EKoBQ zuW;YC_4 z_Fog5O1D-a#F96D^w6{%LUyGcSagSF(zbbin|QF`Bt$o7$~c;-ggaP=kh*kd`&wvp z&zXH9bDG2Dqj@A7G09+qK5pyqSdaV!NyTIo+Km3pbo8xYcIdkv#yC$?ZC8qysJ)Nx z8l>e1QWZ8-gh#lWn778m25aCQ3p^|vUC3y=ah6U8oa|eVm$ba`mynt*&M%3WRuh&a zoEE#cwRh|4_|9JD-*Q{Y2n+FhHoTfFC8rsY;m z^0}KlOXl#7XuVo!PaN?nC61!-w2ER} zp2~Ab!Gzzv@kzE*`y&{&%kA%u_u zGcsYsuT#o<_zYv?Lw!HqA(zqnWf)wXK^-Leq%eFop1nhTlE!DH&DCI_zQl4-=QNvc z?(I+`7cApv+#}pCMB6;ZbSq>FVUgNNWT)ukx3${vjQrEKQhWY3Oz?+^>x<;~&2R7) zOAw!#EZ%=7`39GqRl#Yb{e-9eaR2K5@N0|B=bm`$O2tsD4NgO+G*lE8kFJN&T!?$| z+^x;uX^qg*@kyrDGocpY>65qNe6p-Jv?Laf$#mYBEFNKH)9FP#83Pgm(_RJa4x<#1 zvnVdW_h_))$q=iT5`p&1Xt;Y-L3Tu@5h4TDaL2gTQBDWPDIB22#c%Hum986@r^NsH zr5{5|-<~BjAcwks9Tx(B!yOmPiL_-j06|_}zy3~_<47wDNyXcv&?-|Y>YAtHYPfaH zjZXhq6R1B0fhUv+!8cKAbX>55yRWrXnJvw{VC7+6U5 zIw*~$?>3&`XI1gnfVWw>)0to06Gf`QUY7A-6}7L~Ry>CERZnpa>WzmJ&O62-j$*9} zPvp<%Co<0CRikj17ZRr}tq?Ps#D*Adl)(mq)36&J$IT9zJqiZB1uX_WX)(!&QuCLm z6BbPrfr9_0UySryj3t_V_^{M0T5@S20LW*HIDG^?g=}?B3`t zF{D7BQOEiR-BFLE;mgKQEWT!*7m?Zrp-bqT_#aC!Boi&fZ23(nr)IS%!bXm~%{4Uy zH&~)GF-;%!O1+8qY>LVo2kbZ_<%@OvqB-PvR%g-z=>9dC=psQEVdqF)9pY#;lO_=} z01ZK5G%gYDSKrDA-=~{Qw6zu;d?6<0klP6uoa{)tpo{BIV()`foQ=y`GU;c%D_AED zeuH3w#j=6WxYP&b2rw_4RIpg)jig~%EnfwcLkew%DXC$owY_X$ijg0z+9tpI6?z{r z!b7#Du1_x zS9=$|l)TOt#InUOub*@3c=CO)u6x$Q@r1IDr_3Vw#;*x|7ve!Q*x2Q2Qd+V1*QwX- zk@)JO{HD+d%g63${ce!}8|2b~4Q2AB`{UVC;nC4X&@n7Un(+D4R_6EdK? zay7a(IneHla#ET4FgPfm{Y4OdYZ3K+qj*JP&a0ACF$t!fBL}k{O7|yVPAgh^i>Iyj zWFG!puDz+F0m$YVe*KzIzupCq3vxQP7hV;Wm9R^d=fF;M6;Q{=1rM&?_uYPLQ%F;$ z`M{%4CrJCXz~|2j)&0%5s?{w?4m)+;0z3vlh$-74Fz^J8nZX(+jMOQ;!Sf*`OTF84;Wy&LI}wogbYk6~{k^N!>`bFWX|vybaHN0UD%7@;2ZmXuAQdM^Q!e!ms;QyRRKjDLN)?L@~x&2MSm(!6lh(XPI2gVRqPrTq= z{9!>vbaZyhZ?)#tj}04rLcoa>Hv~%3kk6L1ZG|$+i2*5FZFPIRz7mKP&j0!Ir8mh5&TRMsU*9=iBM9 z*`Vu}21=7#GJw#0c~knu+5?D`9$gPvfG?Z6*c6_ULW&f(P6~d{jQ)R&lYi&tCOa3D z_&6Lbl4v#Biw5B_*uKMV+)yUIq5cBQyax;~>$eiJLnrRe$F6*V-q(N3B&B@1x4IF? zPN1D*b=pV0=TY|es2AKif>XJ&zhp1sSoxxVr6yY;K*L*0Zwxq3nd9HB{NH(C;=-z* zHaE&q?ALR}uCnKme^b%v9PJ{7$<`miR91$eB|tA-D`UafAEj_O#f}%X1l_81bS%L6 zxc@z;_Sx3HWJxdsq3j5yrve7~avLJqA3-DS7)8g8dZ1GSmD&V%I{sj>iHMt<+i@dW z)%L2K$O3{H#&_!fNPAYHIW=G}zY#0~$T~8w0*EWQ9<7;KEs3cw5|c0hwWKBI;dSIN z2h=?`)bL-uFc?Fx=G7fSWYF&OVtb*n)_q#CA-3;-C0>xYS2T3Po-fxLAGa-%(d^7R z@4U|5{6fb-8jkRP+Be|s!hh>X&VRhbC>(8mZvTNaDZ~N zRyfj(dfqRZ|K&%U9{o5uvbv=3l0%!f*|W4{k$3FADOFj#IxT(QLoyntX5Azws+m4; zLRh!JtEWuz?~6r3fd!ASNKnCYS^~I+-@Fe(k6)2&MyAa{Wv&w_Tv=)Rc@_Ov1@&x+ z4WJa>!r_jBF`hUuD9uzSKMVn!p|5b`6x)4Zq`RhZfnL|k0xk-$cQ~G%!s$?UCP3LX zV*e|@?$Y-itif;v^=)pf7UO*1Wq7{Ow{m3he>@x2m)HcT`ph|rq79zaVjyFn0Q+Nqp@sZRQK6oXLI>b?l?mpt%q=1J`0$m*$tl>=LQB15jxhc*Ck2^-O z1NJM;b!9$Pm~lMKxf5PEtOT73d0n44K81};F!0|*Qoptsb!xjxWq!})=#%9?_PGcv z{2wdmzwbF$ZR!W`%)K2HCdlWO!gVUJcK+3B+>u&G=oWMk<@H;gYWEd-fo1_(m@f7Q!Ck80nd9(i`U;{cp^9qeJB_+h}`MRX|Fu*jRn?jT=nzV|G38JH`$+}v z1qeLJ>kDsl`T++wDv3)HI8kHe16qO>M^I(k>Ssf&dj-4ft3CigSmLlA z_4f4zgZWx0Da6ykh=5+1 z@yhLYOg5N4gEr?s0xk;_0e?q~CH^l$v_dx;I%RTLsv9GdXm3F|79OZxKp~v~a$&6s_L#Wv~_J1ei;zDnFbQdNGGq8jIC$~!p zT{zHxl~fNvjsqZ|(Po4y)c^0FP-+Eux7ncEMpks*Pbj1ZG;~kU6#m!FQ2-$45VSEV zc{!=7qg;=d1DeWzq`MA*ei{oPl_*716!_+Y9s)S)pW#k_5%7p)p$4B<;18ZQCZ#8C z9QzOA?)vfdF8HrnPU6jxD~ZZ&`qH2TbJrCxgTI+#MO7smg#vHw03EG&sP|s03L|>CZtBU zYqfN&Y}#a7S57(kEJgY3*sh~8{0&*Y6n>6hY6qk%sQgPdnMT~kbD+m6P2cmw^+K?E zD2&0<{+Bx4js0J5PHOJE63MHu;L~)^U10H z$S+xdR7dcMS)lytqc~@|D)Mh9b;P&`->A2rH)*z-R(s@_Z8oRBrT>VFtkx0GX&ml3 zgZQjJW%g0e@!M_b9VK#Fs0qAab301q55-mgx}{!_9idvE(sDdazTVKaGmFf6m+cy| zm6E7t-N@V%xwWI^7;2s>JZt=@orK57Eml?G_YPJ$ui|mO0_27u9xMTB7u4gO!~8oC zCx)_s<#E&KWFr@a*>)l*v@SoTgfOr*X{E9j)q$6j>8ulsOGG!C2i zM>;^I5cg;``Rhk%hgL+)nMq26GVU5;gPTVA2CbWD$~kVI7@M0xD@S-$u6gHvtqS^; z;e`m~8;YWRf$@EOzMh$pLhjoO&KOOo%H4PR@;S5V@&MYq&GkN81RE==6 zMGQBWJmfVzHnQ-7Z`yiv7j)jFbkxyWGGEfqXq^3K~@W-ykrtxfH8 z8PJ-mz$t3&m*F3sW;&*k(N+i*;*_|s8JOKBQmDVe>~KOHuB5kpEKuN=7#7ZsA1Ie# z4ckchRCbC>-HHmwv=WM~oRrdnr8&*;%ar)668FP_u|=6nqj*oG&8$KiV$PRxeUyf) z14e*QG5ze6qCB*tH@X5(lF0puib_Kt1-c1PYxP^G77>#B~%^{UsI5 z{zmJUt%0{IvH+IxorjT1m%p)^WU?y4ZAz19Z4nN=JHAFkV`G+b4(TSbbOa4pX(8Vt zB^lgc$WzxkKi2mr7$z8}@v7+i-acrRXEz2~8M>p?^d40v(8-xeE2;gY4X9=OLVa#VeYxQ3rGVr;x6l26b4JRTnWZ;O1P z>X2)7lrbxQ)ksX}{0G9oHst)k7;u-2{|=UrUs@phCQe|K!JL??X`;w*x;nU-i|9x< z!tAUc50@f-qu@4oX|H@k!Eax0DvDmJXzQiuOoa%KgYq!u*F5`KIm%q|mD50>25EMU z(2b$nZY~P@q+woqY7e_rPn(G?vV)ZF*9OPpwmSKzlS^(mn_O?O&hJH|w@vqPZyb5@ zRN89M@{HUEP8sxI_5&Gt<#)27ibly>Am+@1*=+9^h6mF^z})coGaQMmC$`+QLneA1a1j9Y+}ms!9F$Qne?!A{HlWQtrV%Qci~rGLb>3BSZ;8ak=;G%#xN=6pDO}# z=b+{(RN^EGt^oWY_R9F%sRKuK=j>at&KZ(0|AL^m+`6k!T^$h|SSJk0PkshvfZBxz zt;wK=UKZHOlc73{bh98&=wSrxxu`0vNy;OT8nFGJF$U;=glc9$59GH-;5UYjBmfoq zr$-lipvnmipo~tS1ZDq!pP^Kam!nqa)VfqQHTXRFWY5>5O_wcJ6Jmt6d%x#}U)WRCUzq+)3~IoasJjrQm<8~4CbZ@BiXw7l$tdpVX3|4ci$d|xnww6d3yLRQ2d z+*(GUF)#H)S<&>QcHl8@iX!uscsQ9%1&dlNXIx67x`hx9^;k+Z&Yw}DywuaoKmCm! zCZfD4+)E|32qSjZ90^4aLnX&CdGAD?~)5TweHqV`CZD4 zM>ZTUy)lm460cS$mJZ$tatB%pfh%0%-&%}xDox?ssPSU1Z5A#?W8|z#rn+TPM*;ya zfyF*z=@T6b4jM+(6w});niI+l8obyZ_kTT7uPL{V+dbT7K?*z;-g~svX(*+91Ut@- z!tzm$xZM*BCpat#E6Y^H=(TTbEhpKSH4wIqBpR=LRkOc=n;R(8h5$gVW2aQXa+m!HKbjkkc>8o5mtO@3yb&VJp>>ZTLF+X5qynqjVkjb&(I> z+~L;#=FL|uzjT6cMT1z z{FNlLz#H1L28|F?ZTEd?;ZkG6r!C9sb*C-fnOQrZ1l57{>%Ek&jRq>39v8g51j98# zHwfl-!x_n6!fJh^t}ogxr!xlH8nAm=lS4l=4q4?da1PaU0$}@9hUI8+BpX>u?~r{rv}qS%y1wLFSZVj-I915?oQxgOb|^+5 zIQxM=;=tfWOWW_&^xVa1ZYK#a?7)<-u-=tZZhu2ea9&hk=K73;Qv&`I4D}sLasKi9 zK2lHN@zbhWqV8P*p1oshlkb!=vK_t)hEK3uhVSGb5c8d?2Z^7C?wk?A9OmG+bHX^0 z-e%!t(fIq) z`NViz91s+a1;hwptrG6I->rP-qxNjCOlCgBACF)sG&L+A8VQ^~$q<+Kn98_kByPxP zL7!`Wk2z8F7QE^@idu=^=j_HW+9f*+Oj5*RPY%^aWwtmG{b>sc$)0vQRh`bg^j`%p7X+H zb?RQ~iSF6C!8Chc401+cM8WuAai_bCBdq3*e-Akgt-@j#zGD<+0S}}-4RiKe#hN1Irr#MS??INg zrBPk|b}92Tszr1wau5ev6c!d>GdEeI0L(btZQ$M4HXxttahh+TiuyS^E~5?BcEhYE zqosXz6@~9UVq$1BVJS7wqbBzHdrz&bLpsx@n44Vt=FNr_M&Vx^#b3f09+-TKJvPVb zC28*88s0u&O=M5uik_dw;LL1IaLPF4=%()x_iIp*V;*q7YjYAtHnmRaY4#SqUR{ZO zEyrr_>OJW!W0)yvI)9^1-YH#joMX!^HtcRXP3%>`09SHbuH0YD4!PA$h|2 zLKy)S;?}}=&u{ogxJT-V8Lu=MksO)a7n@S}Mx2J7QfwHv>iL#jQfzL>P>}}3R(F$o zF^GR+a_+7eY2Agp-Ob%vKce4@&ZiZ)_BLI-Fo7Ziv`%uZI1d~#1Kf`Jg%_58jx`Ga^{E%IwyAW`3a@P`#acO!6tRxnYLu-^yMW zC{*ks*kUnDbg2A(#Bx5UYIJ$I_^E1cAzM9c`bB-1>(7C2HV$FCBg|U6ESM7Ab{2NY z+=0$g9woN&Pl&{}CQ2V1AQn*$<(=x|>?=jf2WwJjQCNyX~z$~k=vm2M^RB)iq zR>D?jx=^lpsNZmCdLEr{uTkr5rPgm+QZ$Iqpe}SV^6SUQ$t%@@3z_`OW?e|GQVecp z-W(!s$)%n3J>%W!Cq5Qe%20$)`X@25V>*R@PMT1-+-~0keVr`pNq_~(At56x)Xz;` zm6n5iSS|nPC}w}(Ow;XRl1_CYp3V3e^kAen_+nMzrBxvxJvuv$?c07a^PSEjOLsc6 zywnKEs%mQzA-h-(+K`7A0=2Or~2S%hN5s z5+Lp{D)UK+YyJ)c41BXr>E}aQOd|b>X>IR8(A}0z}A&YRmDA5PaaNQpg3WqLzD$ z7UTcNiK%SH!yOCG)$4~oI#~}Vy zYFJoUOt4V_5%i+AYV5WkNle*U?Fv$-V`8dhV*B>pl~w5U;$kwQrKQC!e)re&$l94> zicgT_5KoVLq>)Scz4v}6w^>^!Yn|p_c(jYj8zP9^Ng`90ykVldE?T-cEDlgZxAdpm zB$gcfwps+=8$z!jfgq-;V-wOZuXs1Yxs(Pti%^OsbQlDWL7n;AcbK6!x~CO|BB;(& zxo^lXnO*@4U4O!A_}%9U75JH3HY}LL#w3i=qX2d7rr( zh(k&F1F@-Pzd5W(NlI3wA|4%v^SXxIRBDH#yZwT#LHbKLkL#K5QodNOne_YKquMSu z!u7s0Z3y3exIZqAkE*yQ(jxbb{;g#2(1=)bO#AU)uXH47jj(A9?)lu5{1J$hBLaw@(}<;7&Ts7PhgZGfPY^7#X0rGrp0d3j7& zDh$0xt?m52!b4_~$9tj~^25&S)DdA@5jqaY%DTa(78|qmx;TSq;s8dA=eKJ2_1!dpVYE&}!?{$16=Om+~ivo9H<q)^#se~1m{WOCwIZ#p`i`%!Vkp}Ck+TY$ChYKzFHV@xft&U zeDQ349Rt@l&s(~RAJ<8q-#}(!b=U%L8_wa~{%&0fsIjS7Izsa0#F)w%gWb9Td|KJ=TV2^gwkVNqX-N3! z9-*-Cm;^<)BG)#NnDUm-Qcc~+Ulm>*cIgyc;FDe7@a$kS?pYZsm(rC8FAn85Ok`#| zRIu3Y=rAw3zZ-Iu{c&ld+CzUd1&=OTBrkStGgIME&1L;>c|^iGiG3=gXmKl&ie*GX zLlgb-g`mBoBYro2eUDm4Obnk?5|1yC{vDp9bN@RTe4!r7s9(}?o%;k*I6#c%i znHGJ^B^`XwkqbIC^$*dcTk+dF%Bz)lZ0z!j&;^3(X5Pi?W!j4u_g7!6m)Lsa%5a0; z;;l7r$?C68aXm!t<0vjdiVnoqJq6+eEb5;elS{j|-80w~pbp;#1wmKDUR^QIBCX4k7i3IvgIp2?<@{&YNfL*k z`NBv~+#*?fahOxDVD7T-(|Ly}8DGdNztZYy$0Nj3F!ZNK{=Iqq^~3$m+4fv` zbat)ISu%IX?9{P@b{@(reTuE80he>M5Y)6;WlIC2$f+ORm7H!^a&D&G+?Lf^Ob z&2SWln79aDmbI^uO!`8q+jQH1fmEV<=rjYpp`cd?VLzRGe%9IdBiJbKbx^AGD*_j9&Feljd| zZx?aAM5KEbqYdOge+~|eqO3c*iHxHuH7y>+Fy}GrIOkonk{&>Ot#BS-Y?%5jKF~;> zExiE_hCFvI<|(8HW3Be}4~PMDZ;#=$QZ8N7Y=70WClX?=d2xnAk9mXvUa+>*PmMfZ zdwA9d>QLT&!b$t$;}CM={yR3d2c#E6ag$Myd5cCFm%|*;sGdv4=kh@Bl@^PLUH? z&Qj2}A8*wMk4KI137J8JuZEYdUby)E9D50|s86^aHIBkT$CQvcgn-4%Ax?AVAF}89 zh8>gL)DK^#jsFS~@~73kZvMmxwMwE)3ZSxot>S3G!>TWH2?}lx<7kQ z>>SOz)Qt@Vj-q>Kk3{68ph@D8x@b8Xh$0=_8Z1cy>OjCtmEPFfAg4ft=l^D!{~D1X z`BYnG``7Cs{S9iT9c~xFuLY7aZEB4vF^d+hDFi<9m&X=@hk(Lt%U&Y|)b_D%@oC(UQY@kTYIE zp!;;4=(rAlQO)|&U9&Xm65!sbPek3z<4@m^ZRhM6}jc92J#D>VC9j&A%KkiZFlsfatkxw3qYR zWKjY4S%9v|Hp2|prD?Se2cGHkS$jUaflt8?>XWtTjxz9SXzsFECmBC!39YVx>Q8yj zd(%id?1(kXrx`Wo;(EC1D$#W-#)E`~_fiKo9-1L0c(EZTj=RlYRv=s2WU zqN?L@{TinH(k6lyFZpt)7&&3^p*g*51Pe1i-@z|jVNH*cTbT)II^Kd>ixVkK6#k9X zO;5^Mx`rYONoYBzhrhXs&hhU@s$Vh)Qzj09&D{f>g%=kbqLbO<`T{hQagcRFD)zJ> zLSMj;i2lHG=kW1mTr*kXI)~Ag6=Uf$O6yrM^eWdConmx{NFwve>_;gcJSr-O2%_nt z!gF&3>z6)<>H01Dj-wZJOBsx-UJprzuY9j(kZ|^0a=*4%I0!wbRo7Z~d)PI>b3= zy66hnL*mm;6}SW2zZ$F^w!D`78i~K=X;oRScF%d&rB(I@*CNd2S^|>wM;yUfnM^km~TEnP^cSoSIKy24|^F}!RM!P@umlekX_P}jYY zaTN9@{iyVrJjO+SbluES^9YB~k4@(hy-(2#lekF1jPh6iRwy}H&k^0$nu_@X=J}!N zelCe`KB!4z&G7@?TnbVDYh0Lhp^?NSe9fwTjUeFUp1YL!AYNJ(G zZxp$+^g0WYU=}RMSpivlPeKmmn_W1zHItomn4D!ZX%>cd(Kbx z(o{)PgDK!y#!=9WS<9y`=$+IFe)ZD-{Na09s{JbgPtV>-a@?^(R%=WyU7TBW?I-=W zPHy;F9S#-r8nn)GTDKX#<9lP2qrVhQ^k@Hi?EZ=A*n2a~d*w#>S?%1yxHOsG`kT#$ zZMns*dy{lz@Bt#qOH30CjR1d05NbkIOIud%u8xlbEEOZO$3fj+O|z>w2lwY9-bf)` z#>T_T!QlcyzK?JUH2Q*UQ(bQkD@R@y;`%Rd1((xv52#M!8BvazCWxEt@}dPFvH-2?X|c6|5g{eR=80E4DM?{J~i4ZN~EJ z8eWp@$*Gvg+l|*!W{n>vQ*+&54q-iXjOQCxncQD<5X-Ud2J{>bF$F%S4S)CJJZv3x zJ+RRF_rog^3hVk_E*dYoJ9fG$)kf`sF;hoDxJ|=v!rhy0v)h9CWar|da4?8wNV{WF zRX^+=Oc_u-xADjaM2=N*o4<(?XWowv>@>zEnwu|%owvU6X9?xD<=`+8j;XxD2$~*t zA5=ES6G8ph()yl&CCBwhqC!-6nSkF6iXR=ViF)|u!_`z8Td7FBE!RXx-JovUNql)# zOg}9rzBC1)j|fZcCF$D5yv;qj`dh8A{!EZeS^Mo|HbeEpVm(3bE*YnOwMxt1vdx;3 z)3ujO2#t=@dB!xP&R2Z>`}3?UYT4=~vsH>^@b<#r0_K`2loqnXozB?5X_ttojgTT$ zkhES}w1|F^Wp)nU^<4hrHlq~(OBxdi^_2!yP2s^U#)saKi`(5P{Eg<#X8kM!E)#5F z$+|TT>%OL%=Am9pUgfk-NB;H7&&KAvYBXwL`3vegyo!lN{47N}ug5Pf#!r`i$ie)Q z?)YY)gAdYygp|rFkVpK%Nvhs6>Ei_jX-de++RzADRE7{b>c?LhI=at?>n>yhzxRjp zo3~fGDTS-K%}HtpBW{tjKQo|9zW33=oeVKE%|c30;xEU%)+@gG;-6%>m2fbN=6OSH zDY7KQ<%NAizP+7aq0--@|JesEp4Wc)Sp#{I(x#22{)s@=C)CbwPHS0Hdo5V_g$r7C zl}zfh^m8%7k`~dW-Ay&Ozu*h4Ise?w#n01=mCi=K48P32cA_xw^N+p7K*JY=PGz5} zEMhW?^8b3{DX4qkJ(+4J?!Jb*UqtLR^WwWG`>Z%8$Ds}WEh1^xCHpS+b(0Ot_tCds zw#)*P=FQ`GX?R{;P|h|I4?ycfoo6Mx%NS+FhSL&RdZTsr$m8EYI<7Mj2Z@KXN1O zV-+C6RBJy`+3f_$ns@J4n;;Qmd6!ootYs9RmV3X{oA<2^nf|!vf}!FT?|s9bH(^S> z%lOLI6Vv3{`UIUKUGUe1_1!v1<^s4I6I+#{#kWYFE1Gb9HUAqjBdepkczr@pIu7{= zTV^;x@5AfvT8I{9Hp6BCc^p#RXkvCTpm&`raI2Q<*f>L$t(%B3c)-^0`guVx6+BhD zKumtdktA(bVSe+a6ZM5i0#6L*{jI9oD<-nmumc~a&KmW`BSVAU2*+U6E)m&!o1wtH zA6*e|dRcB;=ZLM$i}MI=xwK0^&F5%Pz8m5@Zom!L*`ddb7FS z0$i99a}2jDeBC(*_PL%_rQ=2DBfSUEg~& zvJ2!;HVsPcNfGePx&P=WmtL5rS(skT#S@40Sm<11%4>LptxO^p0bX2&Vy-NJzX78x z>w(>Y{8SrA4sdxq@-^7+<@^T~Az@(j{Co~OT5F*L7>MwI_v@XibK%ee^zEB5>RvxN z7T!CX_bp8Gu(RWOBcK(Ws4GU7Hs2zD{G~ZZ))g(72n z?{&c^ytB%TvWu&ZLPP~dP|SQ^Bw%J|M34^gejW);;pIO{XnP@Ud3b*CdAoVWg<8FY zTnH$_8Jop#V5qE%1)eJcR^7_p9*JC@CL?Mbw8CH~zWdX}io+v2Q3x1-8JhUGmu#&CK~HjKF&e@sgqa}I9fb?+f78HPsC2r+)DcNkXXu?fT zPrvSBa`%K%y`l5HfTmEr_1)Fg^^eLrBcW^mbVFVq5~u(4#Qx>{kB=fEaH)FV^{e?i zC_E5ShN&4Cpf>gZkoTwuoWSqRMKDy~d04p)W-Fm$dnfg4_YhQzR$<4nv%!qs^dEBLdXE_D8_@s_@~dgpAC_g9P~Y zMRj#?BcNn7I6eHezjYcP0tCQUm)pGOT2605QSceRc{}Ln=rCBl_ShL*;-iT*Dx+8u z+lUqD-HKgrIpwbfu=<>-Y)CEu4cA9nC!CC0t2XLsTpcxyqDU37j_3I4)(~7s4lFt# z>~gCJZtUR>654@&`1@k%{VLO>wL==-)JzwvHQzEH%+Ja;Bi=c9Pd(BG%Q~XjZLe0( zcx`0}2ygMU2ryn&-mBGJ*?`uqp7zeAz+n$*F=p=NML#WB1m|(fTmhO+!@#4>!Huk z!Ll*Rrii(y_+OA_*A>en0JGQiCDLil1%$b)yKfK6a2eRDAC5?HX&z}Y zeC?X+NQeV^{y4?wIA_C26G5n=!etW$Z7k}-L z>f~5h^IY>3Sz7CNzzZVnuH##DDk7toVzw_{?IqZ%TbRO84R>q38(^Va2@APP_XJHZ z+0aTm1eJ$PHDa>lpG#p%dr8pSec#t84bTW0TH3K@ea%ak_}Dfq*qrXSu;lUTRo~Ll zhBs6LzyQ1Yz}ca~nknA%iE@J;NQU44)7X`VL%FtbA}OSiwT2kUIvB;tE^D$S%Vf#e zCI`pT8D%+PvM(7&vK6uqCSxB(mMo1LLJYF64YH1GGvRx6w(q;H^T+r6`CjjJzxVUp z&vQTb`}}_Q{S?VOk30T3d1G%Tx0Al(tmbSSya*FWt~_n0()>6vC={K9Bf<9aH5Zs( zL3><2skp3WXYy|HX17$821g3jjYo~`V|#Z9_REvyT|0qEd-w3M>8ABG%m&*}a8+gVUCK_(u__}h0!Iw+-Xhsc!epdmhUM0fh}$w_jN- zNZ6`46pxrws=tr>-vLfQ2Gsa_$ej%)?-ard--$C_niYTr!r$L6Dw>vZeDW5D-F$+U zJWj&OY7I6%uk>A*ta+3WY7Cis`KBN;ABKW6whGxM!u1c^uAq~da?I{EWZThn8$TG2D6Uo>F$ zFmpoZ57133IU`#M8dcUY zhj;h(7V2}4{fan(=`3!@odgE??#)hjv%$XQjNRo7D~coJ899+0;;{q3eOX%(NC4~W zjt2>Ee7x1KuzE#+W4S|Q)=2Ee|`pXJ0qRwd_g!W|z zLm{b8e(kIiM65i*@UBO55IGk{k&}(=vF9mMMO5uMp3a3LE-~legX6Eg7-*AZok_eW zU()8;-`MiTbt3b;^UJXLXB+}pVxQP^U4}@CCy6JTlaqsYw30||@42mHBZx9> z<5eiK*wU2-mITt037g(-9|q+;F^%o)=zTKaNSrY~(? z_6bsx4~gGKN%5?iJc}^=QnM-pnN8Jx6D-NNFmh)wEs?8#?@V7x8~-bkDwz8DTv3rB zbxY}liS8;@QDc04;c3XZozzRsLSd*pGl}zhILU^!-%OYbFN+bGaY-`Xmpr8Z&Dg3#;KdX5pz-$9-qni z{h{F3VzELuYr*_3zUUkyG)Kl_kOQu04jfmz5)T?tWbIVOxTaBB+UL@1j7pZCz1+Ev zCDe&~S%?qOVBdc}8-D0pxtv#4RpHHAB_;w>77$12Aaw0ZX=HaqRj>}iW~Z`NMk?^6^}hheHSRJ_o2 zE@s2Pzw&k>C=U=6>ugP3wYDj(4T`vsA|G`!EHZ(!PnSP8!n zXzbCKl0Dv0p}>JSmxKw-DJk%_FEX*=irm%8wAgKdN%+K|a-`wG<*HD`^Ro16SwY4m z3z+`uR8^Vt<9boB@(IpX?BvaF+W(~p(|g1pG+q`i-s=& zwY#Y>CXn}N_|8CxBuNQkh4A|fm~ZF|xF;G2c+@cd%*G?=cToj*qUG<}u($RPiKwWY z>q8hoE`cjnp2aWRKZr@PKxmWKzZNME^Y@=b$a0Uq_nIW>yN)S5CL4`g2w|{8#1{Xo zQXTp?n#q_nX#lozcB`kvtHMHqg){?6@*Jp^g{$&<<&;F6aC6F)iFb&uPP%tnO7p?r zeZ=0{$R=bZ&GGRpx6`oNTWD-5Ar2W~c@v%EP20So-f-f*42?rk&u10rVT5}O`}K~7 zvs+bVA~1+gTcSd%q)=p`b91#va|e_*x~B1ZnS$T;WG(t(yq-DKTqj5_U2XE1;DbiA zInHdhnS$>aQ)TMCftRg)8^yr9ATV5|(bAth#0YT@T`TCeVjX0QJjFdfpO<4SLs&p# zhIXeP4k~j$Pn*As39NZ*^|n+UB}h$IaR?`bQ01$9KYC=k_bz$i4j=V-Y=Jv~k}cE3 z*id5W`_hy=wYjCpL5kK~@w-~-ft~uxIBSEHb3=_tyD%x~pSJt(o`rF zvr082t++qm9FbxOp;$dH+LwxpyE#GNky@tPZlT@+8zzRh__*53az8`dtds``w&55c z!>ClOXI_jkS(xRvTdG-WSC-O>5AG%EJKOIsnuKQxW?yOC6;By99iutj7IcFiaWUJd*{a45 z$k_2=D{c|FItEO&>$3>=52hxyCi(q6L=CT)V#D?NO;@OjU%MjJWcAmk@*{Q)yjf?D zUaL&qJD{&M%KS-J_Bc0j`Hy%V_*4EPG>1U`A@hXw9I>9=e&7xO1~Mi17q{n+ACQ!<#205Y#LV<#?~Oc-Qdi?=jI_CmCkO+|%_L`Lb{%ni z2Gj)Y5{P_voxjmHVU}f|25vWV$c?{1vwOW(&6_~PfJUk+R>a0$mOO)9U9^pUrB`MU@Xoav%hIh(B!Xvb+?Q zY3iX_w#+FPTN|dt(|ZA0yTXiekmbAEqIqMr?$}wuuQpfs15cJ_2VFQ13g(!qL><9ViYTXaDZqm_{KV*Nf)&cTr((vI#t^ExE6lTI+#6o90Q1!Scp~JW%J<5_ zn_#JjgC&lht=HA47!G8Wgy`Ahj9Gm;R^fR<3*eh*W0$B*qiYMGT)AL>Dfsthc0GM{ zq>?L1>xS&m&M;umx4YKX)?q-otk~F+z)O2LJXc3XM(5MT=4`Fj0r`TapLnF3F8jEg zDy?~n&d^K);07fWe=7gijwXSVa?=*C5xQ{ZVbhry>u6&G-%q?~JV-w)5BXb$ayc}2 zCd^?_{K~N9mvmP{bxgvKZ@lIDVZIcdiADhezeU@rjdJA1t^@w7I=C6|bQrQ!@r}&* zN*$LCcp&ZzJwR={MJGVaJcWnEs;?f;-6weMIuTB5({CY^>&mi@&u8UNh&W4f(5*i2 z#2QvC#w$Kes26l11n;&K8+dNQ+DYNKwMt-thHva`kNS`)4uBu&?y9U?ZC%XCvY zc#(-86lyvYm3^G4%evfGB~`a3+5$w(Ig>{YX{LT7{>Pf15Y1=P!Cx6$iw>B4#xgkU zY~q82{+U+~-{;JzgmT|iVF5v|@0H_v>*v4j?OwnBs>T z+NjQN1)aGs^|a35JSy?UksrD From 9ec75c5ef4182a38e261beaafdc94325785cc7c5 Mon Sep 17 00:00:00 2001 From: Ruben Dario Ponticelli Date: Wed, 5 Nov 2014 20:52:27 -0300 Subject: [PATCH 0992/1288] Add a locking mechanism to IsInitialBlockDownload to ensure it never goes from false to true. --- src/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index bf487df39f..0fd8065342 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1177,8 +1177,14 @@ bool IsInitialBlockDownload() LOCK(cs_main); if (fImporting || fReindex || chainActive.Height() < Checkpoints::GetTotalBlocksEstimate()) return true; - return (chainActive.Height() < pindexBestHeader->nHeight - 24 * 6 || + static bool lockIBDState = false; + if (lockIBDState) + return false; + bool state = (chainActive.Height() < pindexBestHeader->nHeight - 24 * 6 || pindexBestHeader->GetBlockTime() < GetTime() - 24 * 60 * 60); + if (!state) + lockIBDState = true; + return state; } bool fLargeWorkForkFound = false; From 65e3a1e76202b9a695fc6319dbd527ac563e0895 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 7 Nov 2014 13:42:52 +0100 Subject: [PATCH 0993/1288] Make sure that GetRandomBytes never fails We're using GetRandomBytes in several contexts where it's either unwieldy to return an error, or an error would mean a fatal exception anyhow. @gmaxwell checked OpenSSL a while ago and discovered that it never actually fails, but it can't hurt to be a bit paranoid here. --- src/random.cpp | 5 ++--- src/random.h | 2 +- src/wallet.cpp | 6 ++---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/random.cpp b/src/random.cpp index 998e7dfb08..fc9505ae73 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -82,13 +82,12 @@ void RandAddSeedPerfmon() #endif } -bool GetRandBytes(unsigned char* buf, int num) +void GetRandBytes(unsigned char* buf, int num) { if (RAND_bytes(buf, num) != 1) { LogPrintf("%s: OpenSSL RAND_bytes() failed with error: %s\n", __func__, ERR_error_string(ERR_get_error(), NULL)); - return false; + assert(false); } - return true; } uint64_t GetRand(uint64_t nMax) diff --git a/src/random.h b/src/random.h index 161ebe8986..ec73d910c4 100644 --- a/src/random.h +++ b/src/random.h @@ -19,7 +19,7 @@ void RandAddSeedPerfmon(); /** * Functions to gather random data via the OpenSSL PRNG */ -bool GetRandBytes(unsigned char* buf, int num); +void GetRandBytes(unsigned char* buf, int num); uint64_t GetRand(uint64_t nMax); int GetRandInt(int nMax); uint256 GetRandHash(); diff --git a/src/wallet.cpp b/src/wallet.cpp index d392149dbb..ec439c5aad 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -422,15 +422,13 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase) RandAddSeedPerfmon(); vMasterKey.resize(WALLET_CRYPTO_KEY_SIZE); - if (!GetRandBytes(&vMasterKey[0], WALLET_CRYPTO_KEY_SIZE)) - return false; + GetRandBytes(&vMasterKey[0], WALLET_CRYPTO_KEY_SIZE); CMasterKey kMasterKey; RandAddSeedPerfmon(); kMasterKey.vchSalt.resize(WALLET_CRYPTO_SALT_SIZE); - if (!GetRandBytes(&kMasterKey.vchSalt[0], WALLET_CRYPTO_SALT_SIZE)) - return false; + GetRandBytes(&kMasterKey.vchSalt[0], WALLET_CRYPTO_SALT_SIZE); CCrypter crypter; int64_t nStartTime = GetTimeMillis(); From 5e2dcaebc44660de1e886e58fd7797318c45ef1e Mon Sep 17 00:00:00 2001 From: dexX7 Date: Fri, 7 Nov 2014 15:47:29 +0100 Subject: [PATCH 0994/1288] gather_inputs: use correct variable in error message "amount" and "fee" do not exist (anymore?). --- qa/rpc-tests/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index c895eb1619..e5383b6c57 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -225,7 +225,7 @@ def gather_inputs(from_node, amount_needed): total_in += t["amount"] inputs.append({ "txid" : t["txid"], "vout" : t["vout"], "address" : t["address"] } ) if total_in < amount_needed: - raise RuntimeError("Insufficient funds: need %d, have %d"%(amount+fee*2, total_in)) + raise RuntimeError("Insufficient funds: need %d, have %d"%(amount_needed, total_in)) return (total_in, inputs) def make_change(from_node, amount_in, amount_out, fee): From 845c86d128fb97d55d125e63653def38729bd2ed Mon Sep 17 00:00:00 2001 From: Gregory Maxwell Date: Sun, 20 Jul 2014 23:32:25 -0700 Subject: [PATCH 0995/1288] Do not use third party services for IP detection. This is a simplified re-do of closed pull #3088. This patch eliminates the privacy and reliability problematic use of centralized web services for discovering the node's addresses for advertisement. The Bitcoin protocol already allows your peers to tell you what IP they think you have, but this data isn't trustworthy since they could lie. So the challenge is using it without creating a DOS vector. To accomplish this we adopt an approach similar to the one used by P2Pool: If we're announcing and don't have a better address discovered (e.g. via UPNP) or configured we just announce to each peer the address that peer told us. Since peers could already replace, forge, or drop our address messages this cannot create a new vulnerability... but if even one of our peers is giving us a good address we'll eventually make a useful advertisement. We also may randomly use the peer-provided address for the daily rebroadcast even if we otherwise have a seemingly routable address, just in case we've been misconfigured (e.g. by UPNP). To avoid privacy problems, we only do these things if discovery is enabled. --- src/init.cpp | 3 + src/main.cpp | 41 +++++++------ src/net.cpp | 161 ++++++++++++--------------------------------------- src/net.h | 4 +- 4 files changed, 61 insertions(+), 148 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index fe58c68fda..ee93fedd25 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -574,6 +574,9 @@ bool AppInit2(boost::thread_group& threadGroup) // to protect privacy, do not listen by default if a default proxy server is specified if (SoftSetBoolArg("-listen", false)) LogPrintf("AppInit2 : parameter interaction: -proxy set -> setting -listen=0\n"); + // to protect privacy, do not discover addresses by default + if (SoftSetBoolArg("-discover", false)) + LogPrintf("AppInit2 : parameter interaction: -proxy set -> setting -discover=0\n"); } if (!GetBoolArg("-listen", true)) { diff --git a/src/main.cpp b/src/main.cpp index 82d52913a0..9f87a11007 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3474,12 +3474,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, else pfrom->fRelayTxes = true; - if (pfrom->fInbound && addrMe.IsRoutable()) - { - pfrom->addrLocal = addrMe; - SeenLocal(addrMe); - } - // Disconnect if we connected to ourself if (nNonce == nLocalHostNonce && nNonce > 1) { @@ -3488,6 +3482,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, return true; } + pfrom->addrLocal = addrMe; + if (pfrom->fInbound && addrMe.IsRoutable()) + { + SeenLocal(addrMe); + } + // Be shy and don't send version until we hear if (pfrom->fInbound) pfrom->PushVersion(); @@ -3508,7 +3508,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, { CAddress addr = GetLocalAddress(&pfrom->addr); if (addr.IsRoutable()) + { pfrom->PushAddress(addr); + } else if (IsPeerAddrLocalGood(pfrom)) { + addr.SetIP(pfrom->addrLocal); + pfrom->PushAddress(addr); + } } // Get recent addresses @@ -4371,24 +4376,18 @@ bool SendMessages(CNode* pto, bool fSendTrickle) static int64_t nLastRebroadcast; if (!IsInitialBlockDownload() && (GetTime() - nLastRebroadcast > 24 * 60 * 60)) { + LOCK(cs_vNodes); + BOOST_FOREACH(CNode* pnode, vNodes) { - LOCK(cs_vNodes); - BOOST_FOREACH(CNode* pnode, vNodes) - { - // Periodically clear setAddrKnown to allow refresh broadcasts - if (nLastRebroadcast) - pnode->setAddrKnown.clear(); + // Periodically clear setAddrKnown to allow refresh broadcasts + if (nLastRebroadcast) + pnode->setAddrKnown.clear(); - // Rebroadcast our address - if (fListen) - { - CAddress addr = GetLocalAddress(&pnode->addr); - if (addr.IsRoutable()) - pnode->PushAddress(addr); - } - } + // Rebroadcast our address + AdvertizeLocal(pnode); } - nLastRebroadcast = GetTime(); + if (!vNodes.empty()) + nLastRebroadcast = GetTime(); } // diff --git a/src/net.cpp b/src/net.cpp index 5ceb82cf8b..a66875a894 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -142,16 +142,19 @@ bool GetLocal(CService& addr, const CNetAddr *paddrPeer) } // get best local address for a particular peer as a CAddress +// Otherwise, return the unroutable 0.0.0.0 but filled in with +// the normal parameters, since the IP may be changed to a useful +// one by discovery. CAddress GetLocalAddress(const CNetAddr *paddrPeer) { - CAddress ret(CService("0.0.0.0",0),0); + CAddress ret(CService("0.0.0.0",GetListenPort()),0); CService addr; if (GetLocal(addr, paddrPeer)) { ret = CAddress(addr); - ret.nServices = nLocalServices; - ret.nTime = GetAdjustedTime(); } + ret.nServices = nLocalServices; + ret.nTime = GetAdjustedTime(); return ret; } @@ -205,21 +208,38 @@ bool RecvLine(SOCKET hSocket, string& strLine) } } -// used when scores of local addresses may have changed -// pushes better local address to peers -void static AdvertizeLocal() +int GetnScore(const CService& addr) { - LOCK(cs_vNodes); - BOOST_FOREACH(CNode* pnode, vNodes) + LOCK(cs_mapLocalHost); + if (mapLocalHost.count(addr) == LOCAL_NONE) + return 0; + return mapLocalHost[addr].nScore; +} + +// Is our peer's addrLocal potentially useful as an external IP source? +bool IsPeerAddrLocalGood(CNode *pnode) +{ + return fDiscover && pnode->addr.IsRoutable() && pnode->addrLocal.IsRoutable() && + !IsLimited(pnode->addrLocal.GetNetwork()); +} + +// pushes our own address to a peer +void AdvertizeLocal(CNode *pnode) +{ + if (fListen && pnode->fSuccessfullyConnected) { - if (pnode->fSuccessfullyConnected) + CAddress addrLocal = GetLocalAddress(&pnode->addr); + // If discovery is enabled, sometimes give our peer the address it + // tells us that it sees us as in case it has a better idea of our + // address than we do. + if (IsPeerAddrLocalGood(pnode) && (!addrLocal.IsRoutable() || + GetRand((GetnScore(addrLocal) > LOCAL_MANUAL) ? 8:2) == 0)) { - CAddress addrLocal = GetLocalAddress(&pnode->addr); - if (addrLocal.IsRoutable() && (CService)addrLocal != (CService)pnode->addrLocal) - { - pnode->PushAddress(addrLocal); - pnode->addrLocal = addrLocal; - } + addrLocal.SetIP(pnode->addrLocal); + } + if (addrLocal.IsRoutable()) + { + pnode->PushAddress(addrLocal); } } } @@ -257,8 +277,6 @@ bool AddLocal(const CService& addr, int nScore) SetReachable(addr.GetNetwork()); } - AdvertizeLocal(); - return true; } @@ -296,12 +314,10 @@ bool SeenLocal(const CService& addr) return false; mapLocalHost[addr].nScore++; } - - AdvertizeLocal(); - return true; } + /** check whether a given address is potentially local */ bool IsLocal(const CService& addr) { @@ -323,114 +339,12 @@ bool IsReachable(const CNetAddr& addr) return IsReachable(net); } -bool GetMyExternalIP2(const CService& addrConnect, const char* pszGet, const char* pszKeyword, CNetAddr& ipRet) -{ - SOCKET hSocket; - if (!ConnectSocket(addrConnect, hSocket)) - return error("GetMyExternalIP() : connection to %s failed", addrConnect.ToString()); - - send(hSocket, pszGet, strlen(pszGet), MSG_NOSIGNAL); - - string strLine; - while (RecvLine(hSocket, strLine)) - { - if (strLine.empty()) // HTTP response is separated from headers by blank line - { - while (true) - { - if (!RecvLine(hSocket, strLine)) - { - CloseSocket(hSocket); - return false; - } - if (pszKeyword == NULL) - break; - if (strLine.find(pszKeyword) != string::npos) - { - strLine = strLine.substr(strLine.find(pszKeyword) + strlen(pszKeyword)); - break; - } - } - CloseSocket(hSocket); - if (strLine.find("<") != string::npos) - strLine = strLine.substr(0, strLine.find("<")); - strLine = strLine.substr(strspn(strLine.c_str(), " \t\n\r")); - while (strLine.size() > 0 && isspace(strLine[strLine.size()-1])) - strLine.resize(strLine.size()-1); - CService addr(strLine,0,true); - LogPrintf("GetMyExternalIP() received [%s] %s\n", strLine, addr.ToString()); - if (!addr.IsValid() || !addr.IsRoutable()) - return false; - ipRet.SetIP(addr); - return true; - } - } - CloseSocket(hSocket); - return error("GetMyExternalIP() : connection closed"); -} - -bool GetMyExternalIP(CNetAddr& ipRet) -{ - CService addrConnect; - const char* pszGet; - const char* pszKeyword; - - for (int nLookup = 0; nLookup <= 1; nLookup++) - for (int nHost = 1; nHost <= 1; nHost++) - { - // We should be phasing out our use of sites like these. If we need - // replacements, we should ask for volunteers to put this simple - // php file on their web server that prints the client IP: - // - if (nHost == 1) - { - addrConnect = CService("91.198.22.70", 80); // checkip.dyndns.org - - if (nLookup == 1) - { - CService addrIP("checkip.dyndns.org", 80, true); - if (addrIP.IsValid()) - addrConnect = addrIP; - } - - pszGet = "GET / HTTP/1.1\r\n" - "Host: checkip.dyndns.org\r\n" - "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\r\n" - "Connection: close\r\n" - "\r\n"; - - pszKeyword = "Address:"; - } - - if (GetMyExternalIP2(addrConnect, pszGet, pszKeyword, ipRet)) - return true; - } - - return false; -} - -void ThreadGetMyExternalIP() -{ - CNetAddr addrLocalHost; - if (GetMyExternalIP(addrLocalHost)) - { - LogPrintf("GetMyExternalIP() returned %s\n", addrLocalHost.ToStringIP()); - AddLocal(addrLocalHost, LOCAL_HTTP); - } -} - - - - - void AddressCurrentlyConnected(const CService& addr) { addrman.Connected(addr); } - - uint64_t CNode::nTotalBytesRecv = 0; uint64_t CNode::nTotalBytesSent = 0; CCriticalSection CNode::cs_totalBytesRecv; @@ -1687,9 +1601,6 @@ void static Discover(boost::thread_group& threadGroup) } #endif - // Don't use external IPv4 discovery, when -onlynet="IPv6" - if (!IsLimited(NET_IPV4)) - threadGroup.create_thread(boost::bind(&TraceThread, "ext-ip", &ThreadGetMyExternalIP)); } void StartNode(boost::thread_group& threadGroup) diff --git a/src/net.h b/src/net.h index 340158512d..e48acf5644 100644 --- a/src/net.h +++ b/src/net.h @@ -60,7 +60,6 @@ unsigned int SendBufferSize(); void AddOneShot(std::string strDest); bool RecvLine(SOCKET hSocket, std::string& strLine); -bool GetMyExternalIP(CNetAddr& ipRet); void AddressCurrentlyConnected(const CService& addr); CNode* FindNode(const CNetAddr& ip); CNode* FindNode(const std::string& addrName); @@ -96,12 +95,13 @@ enum LOCAL_IF, // address a local interface listens on LOCAL_BIND, // address explicit bound to LOCAL_UPNP, // address reported by UPnP - LOCAL_HTTP, // address reported by whatismyip.com and similar LOCAL_MANUAL, // address explicitly specified (-externalip=) LOCAL_MAX }; +bool IsPeerAddrLocalGood(CNode *pnode); +void AdvertizeLocal(CNode *pnode); void SetLimited(enum Network net, bool fLimited = true); bool IsLimited(enum Network net); bool IsLimited(const CNetAddr& addr); From a8a5e0133abbc7cbb3e5d526e626292a2dce5e91 Mon Sep 17 00:00:00 2001 From: sinetek Date: Sat, 8 Nov 2014 15:38:11 -0500 Subject: [PATCH 0996/1288] Adding license. --- src/hash.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hash.cpp b/src/hash.cpp index 29376b45aa..2cca06ae23 100644 --- a/src/hash.cpp +++ b/src/hash.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2013-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "hash.h" inline uint32_t ROTL32(uint32_t x, int8_t r) From 38c62aec0d21a3f5b76df7ba5aa449dfe3bfa038 Mon Sep 17 00:00:00 2001 From: sinetek Date: Sat, 8 Nov 2014 18:09:06 -0500 Subject: [PATCH 0997/1288] Adding const. --- src/coincontrol.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coincontrol.h b/src/coincontrol.h index c9057017d8..c8bdd3b39d 100644 --- a/src/coincontrol.h +++ b/src/coincontrol.h @@ -35,12 +35,12 @@ public: return (setSelected.count(outpt) > 0); } - void Select(COutPoint& output) + void Select(const COutPoint& output) { setSelected.insert(output); } - void UnSelect(COutPoint& output) + void UnSelect(const COutPoint& output) { setSelected.erase(output); } From b9a36b15bff6a6fc0bb7f8bf6e7361dac3919e78 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Mon, 10 Nov 2014 14:40:01 +0800 Subject: [PATCH 0998/1288] Make comments in /src/script doxygen compatible --- src/script/interpreter.cpp | 39 ++++++++++++++++++--------------- src/script/script.h | 44 ++++++++++++++++++++++---------------- src/script/sigcache.cpp | 10 +++++---- src/script/sign.cpp | 12 +++++------ src/script/sign.h | 6 ++++-- src/script/standard.cpp | 6 +++--- src/script/standard.h | 31 ++++++++++++++++----------- 7 files changed, 85 insertions(+), 63 deletions(-) diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 54c2847f79..5fda6248c2 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -41,10 +41,10 @@ bool CastToBool(const valtype& vch) return false; } -// -// Script is a stack machine (like Forth) that evaluates a predicate -// returning a bool indicating valid or not. There are no loops. -// +/** + * Script is a stack machine (like Forth) that evaluates a predicate + * returning a bool indicating valid or not. There are no loops. + */ #define stacktop(i) (stack.at(stack.size()+(i))) #define altstacktop(i) (altstack.at(altstack.size()+(i))) static inline void popstack(vector& stack) @@ -69,12 +69,16 @@ bool static IsCompressedOrUncompressedPubKey(const valtype &vchPubKey) { return true; } +/** + * A canonical signature exists of: <30> <02> <02> + * Where R and S are not negative (their first byte has its highest bit not set), and not + * excessively padded (do not start with a 0 byte, unless an otherwise negative number follows, + * in which case a single 0 byte is necessary and even required). + * + * See https://bitcointalk.org/index.php?topic=8392.msg127623#msg127623 + */ bool static IsDERSignature(const valtype &vchSig) { - // See https://bitcointalk.org/index.php?topic=8392.msg127623#msg127623 - // A canonical signature exists of: <30> <02> <02> - // Where R and S are not negative (their first byte has its highest bit not set), and not - // excessively padded (do not start with a 0 byte, unless an otherwise negative number follows, - // in which case a single 0 byte is necessary and even required). + if (vchSig.size() < 9) return error("Non-canonical signature: too short"); if (vchSig.size() > 73) @@ -862,17 +866,18 @@ bool EvalScript(vector >& stack, const CScript& script, un namespace { -/** Wrapper that serializes like CTransaction, but with the modifications +/** + * Wrapper that serializes like CTransaction, but with the modifications * required for the signature hash done in-place */ class CTransactionSignatureSerializer { private: - const CTransaction &txTo; // reference to the spending transaction (the one being serialized) - const CScript &scriptCode; // output script being consumed - const unsigned int nIn; // input index of txTo being signed - const bool fAnyoneCanPay; // whether the hashtype has the SIGHASH_ANYONECANPAY flag set - const bool fHashSingle; // whether the hashtype is SIGHASH_SINGLE - const bool fHashNone; // whether the hashtype is SIGHASH_NONE + const CTransaction &txTo; //! reference to the spending transaction (the one being serialized) + const CScript &scriptCode; //! output script being consumed + const unsigned int nIn; //! input index of txTo being signed + const bool fAnyoneCanPay; //! whether the hashtype has the SIGHASH_ANYONECANPAY flag set + const bool fHashSingle; //! whether the hashtype is SIGHASH_SINGLE + const bool fHashNone; //! whether the hashtype is SIGHASH_NONE public: CTransactionSignatureSerializer(const CTransaction &txToIn, const CScript &scriptCodeIn, unsigned int nInIn, int nHashTypeIn) : @@ -951,7 +956,7 @@ public: ::WriteCompactSize(s, nOutputs); for (unsigned int nOutput = 0; nOutput < nOutputs; nOutput++) SerializeOutput(s, nOutput, nType, nVersion); - // Serialie nLockTime + // Serialize nLockTime ::Serialize(s, txTo.nLockTime, nType, nVersion); } }; diff --git a/src/script/script.h b/src/script/script.h index e525ad13ee..9c22cb908c 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -179,12 +179,14 @@ public: class CScriptNum { -// Numeric opcodes (OP_1ADD, etc) are restricted to operating on 4-byte integers. -// The semantics are subtle, though: operands must be in the range [-2^31 +1...2^31 -1], -// but results may overflow (and are valid as long as they are not used in a subsequent -// numeric operation). CScriptNum enforces those semantics by storing results as -// an int64 and allowing out-of-range values to be returned as a vector of bytes but -// throwing an exception if arithmetic is done or the result is interpreted as an integer. +/** + * Numeric opcodes (OP_1ADD, etc) are restricted to operating on 4-byte integers. + * The semantics are subtle, though: operands must be in the range [-2^31 +1...2^31 -1], + * but results may overflow (and are valid as long as they are not used in a subsequent + * numeric operation). CScriptNum enforces those semantics by storing results as + * an int64 and allowing out-of-range values to be returned as a vector of bytes but + * throwing an exception if arithmetic is done or the result is interpreted as an integer. + */ public: explicit CScriptNum(const int64_t& n) @@ -516,7 +518,7 @@ public: return true; } - // Encode/decode small integers: + /** Encode/decode small integers: */ static int DecodeOP_N(opcodetype opcode) { if (opcode == OP_0) @@ -560,25 +562,31 @@ public: return nFound; } - // Pre-version-0.6, Bitcoin always counted CHECKMULTISIGs - // as 20 sigops. With pay-to-script-hash, that changed: - // CHECKMULTISIGs serialized in scriptSigs are - // counted more accurately, assuming they are of the form - // ... OP_N CHECKMULTISIG ... + /** + * Pre-version-0.6, Bitcoin always counted CHECKMULTISIGs + * as 20 sigops. With pay-to-script-hash, that changed: + * CHECKMULTISIGs serialized in scriptSigs are + * counted more accurately, assuming they are of the form + * ... OP_N CHECKMULTISIG ... + */ unsigned int GetSigOpCount(bool fAccurate) const; - // Accurately count sigOps, including sigOps in - // pay-to-script-hash transactions: + /** + * Accurately count sigOps, including sigOps in + * pay-to-script-hash transactions: + */ unsigned int GetSigOpCount(const CScript& scriptSig) const; bool IsPayToScriptHash() const; - // Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical). + /** Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical). */ bool IsPushOnly() const; - // Returns whether the script is guaranteed to fail at execution, - // regardless of the initial stack. This allows outputs to be pruned - // instantly when entering the UTXO set. + /** + * Returns whether the script is guaranteed to fail at execution, + * regardless of the initial stack. This allows outputs to be pruned + * instantly when entering the UTXO set. + */ bool IsUnspendable() const { return (size() > 0 && *begin() == OP_RETURN); diff --git a/src/script/sigcache.cpp b/src/script/sigcache.cpp index d76a5acd63..5580a5933e 100644 --- a/src/script/sigcache.cpp +++ b/src/script/sigcache.cpp @@ -15,13 +15,15 @@ namespace { -// Valid signature cache, to avoid doing expensive ECDSA signature checking -// twice for every transaction (once when accepted into memory pool, and -// again when accepted into the block chain) +/** + * Valid signature cache, to avoid doing expensive ECDSA signature checking + * twice for every transaction (once when accepted into memory pool, and + * again when accepted into the block chain) + */ class CSignatureCache { private: - // sigdata_type is (signature hash, signature, public key): + //! sigdata_type is (signature hash, signature, public key): typedef boost::tuple, CPubKey> sigdata_type; std::set< sigdata_type> setValid; boost::shared_mutex cs_sigcache; diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 9dfd640dfb..7dfed751b6 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -46,12 +46,12 @@ bool SignN(const vector& multisigdata, const CKeyStore& keystore, uint2 return nSigned==nRequired; } -// -// Sign scriptPubKey with private keys stored in keystore, given transaction hash and hash type. -// Signatures are returned in scriptSigRet (or returns false if scriptPubKey can't be signed), -// unless whichTypeRet is TX_SCRIPTHASH, in which case scriptSigRet is the redemption script. -// Returns false if scriptPubKey could not be completely satisfied. -// +/** + * Sign scriptPubKey with private keys stored in keystore, given transaction hash and hash type. + * Signatures are returned in scriptSigRet (or returns false if scriptPubKey can't be signed), + * unless whichTypeRet is TX_SCRIPTHASH, in which case scriptSigRet is the redemption script. + * Returns false if scriptPubKey could not be completely satisfied. + */ bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash, int nHashType, CScript& scriptSigRet, txnouttype& whichTypeRet) { diff --git a/src/script/sign.h b/src/script/sign.h index 99d5516adb..45a5e0dea3 100644 --- a/src/script/sign.h +++ b/src/script/sign.h @@ -17,8 +17,10 @@ struct CMutableTransaction; bool SignSignature(const CKeyStore& keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); -// Given two sets of signatures for scriptPubKey, possibly with OP_0 placeholders, -// combine them intelligently and return the result. +/** + * Given two sets of signatures for scriptPubKey, possibly with OP_0 placeholders, + * combine them intelligently and return the result. + */ CScript CombineSignatures(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2); #endif // BITCOIN_SCRIPT_SIGN_H diff --git a/src/script/standard.cpp b/src/script/standard.cpp index e238ecedb0..ab6e6cde0d 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -34,9 +34,9 @@ const char* GetTxnOutputType(txnouttype t) return NULL; } -// -// Return public keys or hashes from scriptPubKey, for 'standard' transaction types. -// +/** + * Return public keys or hashes from scriptPubKey, for 'standard' transaction types. + */ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector >& vSolutionsRet) { // Templates diff --git a/src/script/standard.h b/src/script/standard.h index 55a27881aa..f3dcc75fdc 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -25,27 +25,31 @@ public: CScriptID(const uint160& in) : uint160(in) {} }; -static const unsigned int MAX_OP_RETURN_RELAY = 40; // bytes +static const unsigned int MAX_OP_RETURN_RELAY = 40; //! bytes extern unsigned nMaxDatacarrierBytes; -// Mandatory script verification flags that all new blocks must comply with for -// them to be valid. (but old blocks may not comply with) Currently just P2SH, -// but in the future other flags may be added, such as a soft-fork to enforce -// strict DER encoding. -// -// Failing one of these tests may trigger a DoS ban - see CheckInputs() for -// details. +/** + * Mandatory script verification flags that all new blocks must comply with for + * them to be valid. (but old blocks may not comply with) Currently just P2SH, + * but in the future other flags may be added, such as a soft-fork to enforce + * strict DER encoding. + * + * Failing one of these tests may trigger a DoS ban - see CheckInputs() for + * details. + */ static const unsigned int MANDATORY_SCRIPT_VERIFY_FLAGS = SCRIPT_VERIFY_P2SH; -// Standard script verification flags that standard transactions will comply -// with. However scripts violating these flags may still be present in valid -// blocks and we must accept those blocks. +/** + * Standard script verification flags that standard transactions will comply + * with. However scripts violating these flags may still be present in valid + * blocks and we must accept those blocks. + */ static const unsigned int STANDARD_SCRIPT_VERIFY_FLAGS = MANDATORY_SCRIPT_VERIFY_FLAGS | SCRIPT_VERIFY_STRICTENC | SCRIPT_VERIFY_MINIMALDATA | SCRIPT_VERIFY_NULLDUMMY; -// For convenience, standard but not mandatory verify flags. +/** For convenience, standard but not mandatory verify flags. */ static const unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS = STANDARD_SCRIPT_VERIFY_FLAGS & ~MANDATORY_SCRIPT_VERIFY_FLAGS; enum txnouttype @@ -65,7 +69,8 @@ public: friend bool operator<(const CNoDestination &a, const CNoDestination &b) { return true; } }; -/** A txout script template with a specific destination. It is either: +/** + * A txout script template with a specific destination. It is either: * * CNoDestination: no destination set * * CKeyID: TX_PUBKEYHASH destination * * CScriptID: TX_SCRIPTHASH destination From f4e0aefadcc9f37611a6d5a13e3f7b4b9a37bf76 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 5 Nov 2014 10:53:59 -0800 Subject: [PATCH 0999/1288] Do signature-s negation inside the tests To avoid the need for libsecp256k1 to expose such functionality. --- src/ecwrapper.cpp | 4 ++-- src/ecwrapper.h | 2 +- src/key.cpp | 4 ++-- src/key.h | 2 +- src/test/script_tests.cpp | 47 ++++++++++++++++++++++++++++++++++++++- 5 files changed, 52 insertions(+), 7 deletions(-) diff --git a/src/ecwrapper.cpp b/src/ecwrapper.cpp index ebaa350264..3377dce0c1 100644 --- a/src/ecwrapper.cpp +++ b/src/ecwrapper.cpp @@ -193,7 +193,7 @@ bool CECKey::SetPubKey(const unsigned char* pubkey, size_t size) { return o2i_ECPublicKey(&pkey, &pubkey, size) != NULL; } -bool CECKey::Sign(const uint256 &hash, std::vector& vchSig, bool lowS) { +bool CECKey::Sign(const uint256 &hash, std::vector& vchSig) { vchSig.clear(); ECDSA_SIG *sig = ECDSA_do_sign((unsigned char*)&hash, sizeof(hash), pkey); if (sig == NULL) @@ -205,7 +205,7 @@ bool CECKey::Sign(const uint256 &hash, std::vector& vchSig, bool BIGNUM *halforder = BN_CTX_get(ctx); EC_GROUP_get_order(group, order, ctx); BN_rshift1(halforder, order); - if (lowS && BN_cmp(sig->s, halforder) > 0) { + if (BN_cmp(sig->s, halforder) > 0) { // enforce low S values, by negating the value (modulo the order) if above order/2. BN_sub(sig->s, order, sig->s); } diff --git a/src/ecwrapper.h b/src/ecwrapper.h index 3457ca5f5a..a7847d190c 100644 --- a/src/ecwrapper.h +++ b/src/ecwrapper.h @@ -28,7 +28,7 @@ public: bool SetPrivKey(const unsigned char* privkey, size_t size, bool fSkipCheck=false); void GetPubKey(std::vector& pubkey, bool fCompressed); bool SetPubKey(const unsigned char* pubkey, size_t size); - bool Sign(const uint256 &hash, std::vector& vchSig, bool lowS); + bool Sign(const uint256 &hash, std::vector& vchSig); bool Verify(const uint256 &hash, const std::vector& vchSig); bool SignCompact(const uint256 &hash, unsigned char *p64, int &rec); diff --git a/src/key.cpp b/src/key.cpp index 1b539d073a..0ca9a681a3 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -102,7 +102,7 @@ CPubKey CKey::GetPubKey() const { return result; } -bool CKey::Sign(const uint256 &hash, std::vector& vchSig, bool lowS) const { +bool CKey::Sign(const uint256 &hash, std::vector& vchSig) const { if (!fValid) return false; #ifdef USE_SECP256K1 @@ -119,7 +119,7 @@ bool CKey::Sign(const uint256 &hash, std::vector& vchSig, bool lo #else CECKey key; key.SetSecretBytes(vch); - return key.Sign(hash, vchSig, lowS); + return key.Sign(hash, vchSig); #endif } diff --git a/src/key.h b/src/key.h index f36e658dee..0bb05482c9 100644 --- a/src/key.h +++ b/src/key.h @@ -122,7 +122,7 @@ public: CPubKey GetPubKey() const; //! Create a DER-serialized signature. - bool Sign(const uint256& hash, std::vector& vchSig, bool lowS = true) const; + bool Sign(const uint256& hash, std::vector& vchSig) const; /** * Create a compact signature (65 bytes), which allows reconstructing the used public key. diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index a41552fea1..cff1664a1e 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -95,6 +95,48 @@ void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, int flags, bo BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, flags, SignatureChecker(BuildSpendingTransaction(scriptSig, BuildCreditingTransaction(scriptPubKey)), 0)) == expect, message); } +void static NegateSignatureS(std::vector& vchSig) { + // Parse the signature. + std::vector r, s; + r = std::vector(vchSig.begin() + 4, vchSig.begin() + 4 + vchSig[3]); + s = std::vector(vchSig.begin() + 6 + vchSig[3], vchSig.begin() + 6 + vchSig[3] + vchSig[5 + vchSig[3]]); + unsigned char hashtype = vchSig.back(); + + // Really ugly to implement mod-n negation here, but it would be feature creep to expose such functionality from libsecp256k1. + static const unsigned char order[33] = { + 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, + 0xBA, 0xAE, 0xDC, 0xE6, 0xAF, 0x48, 0xA0, 0x3B, + 0xBF, 0xD2, 0x5E, 0x8C, 0xD0, 0x36, 0x41, 0x41 + }; + while (s.size() < 33) { + s.insert(s.begin(), 0x00); + } + int carry = 0; + for (int p = 32; p >= 1; p--) { + int n = (int)order[p] - s[p] - carry; + s[p] = (n + 256) & 0xFF; + carry = (n < 0); + } + assert(carry == 0); + if (s.size() > 1 && s[0] == 0 && s[1] < 0x80) { + s.erase(s.begin()); + } + + // Reconstruct the signature. + vchSig.clear(); + vchSig.push_back(0x30); + vchSig.push_back(4 + r.size() + s.size()); + vchSig.push_back(0x02); + vchSig.push_back(r.size()); + vchSig.insert(vchSig.end(), r.begin(), r.end()); + vchSig.push_back(0x02); + vchSig.push_back(s.size()); + vchSig.insert(vchSig.end(), s.begin(), s.end()); + vchSig.push_back(hashtype); +} + namespace { const unsigned char vchKey0[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}; @@ -194,7 +236,10 @@ public: uint256 hash = SignatureHash(scriptPubKey, spendTx, 0, nHashType); std::vector vchSig, r, s; do { - key.Sign(hash, vchSig, lenS <= 32); + key.Sign(hash, vchSig); + if ((lenS == 33) != (vchSig[5 + vchSig[3]] == 33)) { + NegateSignatureS(vchSig); + } r = std::vector(vchSig.begin() + 4, vchSig.begin() + 4 + vchSig[3]); s = std::vector(vchSig.begin() + 6 + vchSig[3], vchSig.begin() + 6 + vchSig[3] + vchSig[5 + vchSig[3]]); } while (lenR != r.size() || lenS != s.size()); From d52f07260582f7b1ffef05953bcc821bcee8af61 Mon Sep 17 00:00:00 2001 From: sinetek Date: Sat, 8 Nov 2014 13:48:35 -0500 Subject: [PATCH 1000/1288] Don't show wallet options in the preferences menu when running with -disablewallet --- src/qt/bitcoingui.cpp | 6 +++--- src/qt/bitcoingui.h | 1 + src/qt/optionsdialog.cpp | 7 ++++++- src/qt/optionsdialog.h | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 77cfdceef0..450b83a8c6 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -103,9 +103,9 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) : QString windowTitle = tr("Bitcoin Core") + " - "; #ifdef ENABLE_WALLET /* if compiled with wallet support, -disablewallet can still disable the wallet */ - bool enableWallet = !GetBoolArg("-disablewallet", false); + enableWallet = !GetBoolArg("-disablewallet", false); #else - bool enableWallet = false; + enableWallet = false; #endif // ENABLE_WALLET if(enableWallet) { @@ -554,7 +554,7 @@ void BitcoinGUI::optionsClicked() if(!clientModel || !clientModel->getOptionsModel()) return; - OptionsDialog dlg(this); + OptionsDialog dlg(this, enableWallet); dlg.setModel(clientModel->getOptionsModel()); dlg.exec(); } diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 35b36811c4..662ef9d9e8 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -64,6 +64,7 @@ public: bool setCurrentWallet(const QString& name); void removeAllWallets(); #endif // ENABLE_WALLET + bool enableWallet; protected: void changeEvent(QEvent *e); diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 67be174d55..f5a0759c92 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -30,7 +30,7 @@ #include #include -OptionsDialog::OptionsDialog(QWidget *parent) : +OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) : QDialog(parent), ui(new Ui::OptionsDialog), model(0), @@ -66,6 +66,11 @@ OptionsDialog::OptionsDialog(QWidget *parent) : ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabWindow)); #endif + /* remove Wallet tab in case of -disablewallet */ + if (!enableWallet) { + ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabWallet)); + } + /* Display elements init */ QDir translations(":translations"); ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant("")); diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h index 108609610d..794a39590c 100644 --- a/src/qt/optionsdialog.h +++ b/src/qt/optionsdialog.h @@ -24,7 +24,7 @@ class OptionsDialog : public QDialog Q_OBJECT public: - explicit OptionsDialog(QWidget *parent); + explicit OptionsDialog(QWidget *parent, bool enableWallet); ~OptionsDialog(); void setModel(OptionsModel *model); From e2655e0ab1fc36cd4a58a5145c53500cb7b2d4d0 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 11 Nov 2014 04:52:43 -0500 Subject: [PATCH 1001/1288] Add unauthenticated HTTP REST interface to public blockchain data. --- src/Makefile.am | 1 + src/rest.cpp | 201 ++++++++++++++++++++++++++++++++++++++++++++++ src/rpcserver.cpp | 9 ++- src/rpcserver.h | 6 ++ 4 files changed, 216 insertions(+), 1 deletion(-) create mode 100644 src/rest.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 8b5d009842..2c2a96b198 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -165,6 +165,7 @@ libbitcoin_server_a_SOURCES = \ net.cpp \ noui.cpp \ pow.cpp \ + rest.cpp \ rpcblockchain.cpp \ rpcmining.cpp \ rpcmisc.cpp \ diff --git a/src/rest.cpp b/src/rest.cpp new file mode 100644 index 0000000000..48c1672ae8 --- /dev/null +++ b/src/rest.cpp @@ -0,0 +1,201 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2012 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include +#include "rpcserver.h" +#include "streams.h" +#include "utilstrencodings.h" +#include "core/block.h" +#include "core/transaction.h" +#include "version.h" +#include "main.h" + +using namespace std; +using namespace json_spirit; + +enum RetFormat { + RF_BINARY, + RF_HEX, + RF_JSON, +}; + +static const struct { + enum RetFormat rf; + const char *name; +} rf_names[] = { + { RF_BINARY, "binary" }, // default, if match not found + { RF_HEX, "hex" }, + { RF_JSON, "json" }, +}; + +class RestErr { +public: + enum HTTPStatusCode status; + string message; +}; + +extern void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry); +extern Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex); + +static RestErr RESTERR(enum HTTPStatusCode status, string message) +{ + RestErr re; + re.status = status; + re.message = message; + return re; +} + +static enum RetFormat ParseDataFormat(const string& format) +{ + for (unsigned int i = 0; i < ARRAYLEN(rf_names); i++) + if (format == rf_names[i].name) + return rf_names[i].rf; + + return rf_names[0].rf; +} + +static bool ParseHashStr(string& strReq, uint256& v) +{ + if (!IsHex(strReq) || (strReq.size() != 64)) + return false; + + v.SetHex(strReq); + return true; +} + +static bool rest_block(AcceptedConnection *conn, + string& strReq, + map& mapHeaders, + bool fRun) +{ + vector params; + boost::split(params, strReq, boost::is_any_of("/")); + + enum RetFormat rf = ParseDataFormat(params.size() > 1 ? params[1] : string("")); + + string hashStr = params[0]; + uint256 hash; + if (!ParseHashStr(hashStr, hash)) + throw RESTERR(HTTP_BAD_REQUEST, "Invalid hash: " + hashStr); + + if (mapBlockIndex.count(hash) == 0) + throw RESTERR(HTTP_NOT_FOUND, hashStr + " not found"); + + CBlock block; + CBlockIndex* pblockindex = mapBlockIndex[hash]; + if (!ReadBlockFromDisk(block, pblockindex)) + throw RESTERR(HTTP_NOT_FOUND, hashStr + " not found"); + + CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION); + ssBlock << block; + + switch (rf) { + case RF_BINARY: { + string binaryBlock = ssBlock.str(); + conn->stream() << HTTPReply(HTTP_OK, binaryBlock, fRun, true, "application/octet-stream") << binaryBlock << std::flush; + return true; + } + + case RF_HEX: { + string strHex = HexStr(ssBlock.begin(), ssBlock.end()) + "\n";; + conn->stream() << HTTPReply(HTTP_OK, strHex, fRun, false, "text/plain") << std::flush; + return true; + } + + case RF_JSON: { + Object objBlock = blockToJSON(block, pblockindex); + string strJSON = write_string(Value(objBlock), false) + "\n"; + conn->stream() << HTTPReply(HTTP_OK, strJSON, fRun) << std::flush; + return true; + } + } + + // not reached + return true; // continue to process further HTTP reqs on this cxn +} + +static bool rest_tx(AcceptedConnection *conn, + string& strReq, + map& mapHeaders, + bool fRun) +{ + vector params; + boost::split(params, strReq, boost::is_any_of("/")); + + enum RetFormat rf = ParseDataFormat(params.size() > 1 ? params[1] : string("")); + + string hashStr = params[0]; + uint256 hash; + if (!ParseHashStr(hashStr, hash)) + throw RESTERR(HTTP_BAD_REQUEST, "Invalid hash: " + hashStr); + + CTransaction tx; + uint256 hashBlock = 0; + if (!GetTransaction(hash, tx, hashBlock, true)) + throw RESTERR(HTTP_NOT_FOUND, hashStr + " not found"); + + CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); + ssTx << tx; + + switch (rf) { + case RF_BINARY: { + string binaryTx = ssTx.str(); + conn->stream() << HTTPReply(HTTP_OK, binaryTx, fRun, true, "application/octet-stream") << binaryTx << std::flush; + return true; + } + + case RF_HEX: { + string strHex = HexStr(ssTx.begin(), ssTx.end()) + "\n";; + conn->stream() << HTTPReply(HTTP_OK, strHex, fRun, false, "text/plain") << std::flush; + return true; + } + + case RF_JSON: { + Object objTx; + TxToJSON(tx, hashBlock, objTx); + string strJSON = write_string(Value(objTx), false) + "\n"; + conn->stream() << HTTPReply(HTTP_OK, strJSON, fRun) << std::flush; + return true; + } + } + + // not reached + return true; // continue to process further HTTP reqs on this cxn +} + +static const struct { + const char *prefix; + bool (*handler)(AcceptedConnection *conn, + string& strURI, + map& mapHeaders, + bool fRun); +} uri_prefixes[] = { + { "/rest/tx/", rest_tx }, + { "/rest/block/", rest_block }, +}; + +bool HTTPReq_REST(AcceptedConnection *conn, + string& strURI, + map& mapHeaders, + bool fRun) +{ + try { + for (unsigned int i = 0; i < ARRAYLEN(uri_prefixes); i++) { + unsigned int plen = strlen(uri_prefixes[i].prefix); + if (strURI.substr(0, plen) == uri_prefixes[i].prefix) { + string strReq = strURI.substr(plen); + return uri_prefixes[i].handler(conn, strReq, mapHeaders, fRun); + } + } + } + catch (RestErr& re) { + conn->stream() << HTTPReply(re.status, re.message + "\r\n", false, false, "text/plain") << std::flush; + return false; + } + + conn->stream() << HTTPReply(HTTP_NOT_FOUND, "", false) << std::flush; + return false; +} + diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index cc80887ba4..d072f18e36 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -946,11 +946,18 @@ void ServiceConnection(AcceptedConnection *conn) if (mapHeaders["connection"] == "close") fRun = false; + // Process via JSON-RPC API if (strURI == "/") { if (!HTTPReq_JSONRPC(conn, strRequest, mapHeaders, fRun)) break; + + // Process via HTTP REST API + } else if (strURI.substr(0, 6) == "/rest/") { + if (!HTTPReq_REST(conn, strURI, mapHeaders, fRun)) + break; + } else { - conn->stream() << HTTPError(HTTP_NOT_FOUND, false) << std::flush; + conn->stream() << HTTPReply(HTTP_NOT_FOUND, "", false) << std::flush; break; } } diff --git a/src/rpcserver.h b/src/rpcserver.h index 2a258dd89a..60793f79ae 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -218,4 +218,10 @@ extern json_spirit::Value gettxout(const json_spirit::Array& params, bool fHelp) extern json_spirit::Value verifychain(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getchaintips(const json_spirit::Array& params, bool fHelp); +// in rest.cpp +extern bool HTTPReq_REST(AcceptedConnection *conn, + std::string& strURI, + std::map& mapHeaders, + bool fRun); + #endif // BITCOIN_RPCSERVER_H From cca48f69b04462c5c9bfefd34443e0b8401dbd6c Mon Sep 17 00:00:00 2001 From: 21E14 <21xe14@gmail.com> Date: Sat, 1 Nov 2014 17:42:12 -0400 Subject: [PATCH 1002/1288] Reset setBlockIndexCandidates once block index db loaded --- src/main.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 008a059103..1ba17614df 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1949,6 +1949,16 @@ static CBlockIndex* FindMostWorkChain() { } while(true); } +// Delete all entries in setBlockIndexCandidates that are worse than the current tip. +static void PruneBlockIndexCandidates() { + // Note that we can't delete the current block itself, as we may need to return to it later in case a + // reorganization to a better block fails. + std::set::iterator it = setBlockIndexCandidates.begin(); + while (setBlockIndexCandidates.value_comp()(*it, chainActive.Tip())) { + setBlockIndexCandidates.erase(it++); + } +} + // Try to make some progress towards making pindexMostWork the active block. // pblock is either NULL or a pointer to a CBlock corresponding to pindexMostWork. static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMostWork, CBlock *pblock) { @@ -1996,13 +2006,7 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo return false; } } else { - // Delete all entries in setBlockIndexCandidates that are worse than our new current block. - // Note that we can't delete the current block itself, as we may need to return to it later in case a - // reorganization to a better block fails. - std::set::iterator it = setBlockIndexCandidates.begin(); - while (setBlockIndexCandidates.value_comp()(*it, chainActive.Tip())) { - setBlockIndexCandidates.erase(it++); - } + PruneBlockIndexCandidates(); // Either the current tip or a successor of it we're working towards is left in setBlockIndexCandidates. assert(!setBlockIndexCandidates.empty()); if (!pindexOldTip || chainActive.Tip()->nChainWork > pindexOldTip->nChainWork) { @@ -2860,6 +2864,9 @@ bool static LoadBlockIndexDB() if (it == mapBlockIndex.end()) return true; chainActive.SetTip(it->second); + + PruneBlockIndexCandidates(); + LogPrintf("LoadBlockIndexDB(): hashBestChain=%s height=%d date=%s progress=%f\n", chainActive.Tip()->GetBlockHash().ToString(), chainActive.Height(), DateTimeStrFormat("%Y-%m-%d %H:%M:%S", chainActive.Tip()->GetBlockTime()), From 096efc5812f09f2d858707c6573acd6dbf4eadc3 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 12 Nov 2014 18:35:18 -0500 Subject: [PATCH 1003/1288] travis: install less packages from apt-get --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b685fbb5cd..b0c8580e6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,7 @@ matrix: env: HOST=i686-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" install: - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi - - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-upgrade -qq $PACKAGES; fi + - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES; fi before_script: - unset CC; unset CXX - mkdir -p depends/SDKs depends/sdk-sources From 560e99636c0175044ca098f30e10ee7585654a19 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 12 Nov 2014 17:35:14 -0500 Subject: [PATCH 1004/1288] travis: attempt to fix unlikely build issue This is a long chain of errors, and there are likely other changes that could be made to cope in other places along that chain. If depends don't build successfully, don't bother trying again for the sake of better logging. That's likely to hurt more than help. In this case, qt build failed, and on the second attempt, it appeared to be successful. However, due to a bad object from an internal gcc error on the first build, the resulting lib was unusable. This caused bitcoin-qt to not be built, and tests and packaging which expected bitcoin-qt to be there failed. The root cause: Mingw is especially crashy when using -jX, likely compounded by low-memory environments. I've seen multiple problems with this combo in Gitian as well. In this case: i686-w64-mingw32-g++: internal compiler error: Killed (program cc1plus) ... make[3]: *** [.obj/release/qdrawhelper.o] Error 4 The workaround: Bump Travis down to using -j2 by default. Additionaly, enable --with-gui for the windows builds. This will cause configure to fail if qt is not working while also testing the config flag. Other failures which may be worth revisiting separately: - If a depends package fails, maybe remove the workdir so that it doesn't taint subsequent runs - See if there's anything repeatable about the ICE when building qt --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b685fbb5cd..f6b011ee1c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,9 +35,9 @@ matrix: - compiler: ": Cross-Mac" env: HOST=x86_64-apple-darwin11 PACKAGES="gcc-multilib g++-multilib cmake libcap-dev libz-dev libbz2-dev" OSX_SDK=10.7 GOAL="deploy" - compiler: ": Win64" - env: HOST=x86_64-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" + env: HOST=x86_64-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" BITCOIN_CONFIG="--enable-gui" MAKEJOBS="-j2" - compiler: ": Win32" - env: HOST=i686-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" + env: HOST=i686-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" BITCOIN_CONFIG="--enable-gui" MAKEJOBS="-j2" install: - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-upgrade -qq $PACKAGES; fi @@ -46,7 +46,7 @@ before_script: - mkdir -p depends/SDKs depends/sdk-sources - if [ -n "$OSX_SDK" -a ! -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then wget $SDK_URL/MacOSX${OSX_SDK}.sdk.tar.gz -O depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi - if [ -n "$OSX_SDK" -a -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then tar -C depends/SDKs -xf depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi - - make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS || (echo "Build failure. Verbose build follows." && make -C depends V=1 HOST=$HOST $DEP_OPTS) + - make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS script: - if [ -n "$USE_SHELL" ]; then export CONFIG_SHELL="$USE_SHELL"; fi - OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST From 187739006c3e064b5628719adee02b4fbcb5fabc Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 12 Nov 2014 18:02:08 -0500 Subject: [PATCH 1005/1288] depends: cleanup better after qt and force a bump qt needs to be rebuilt for travis. The previous commit should help ensure that this won't need to be done again. --- depends/packages/qt.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 5fbab57dd4..51f2ea663b 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -93,5 +93,5 @@ endef define $(package)_postprocess_cmds rm -rf mkspecs/ lib/cmake/ && \ - rm lib/libQt5Bootstrap.a lib/lib*.la lib/lib*.prl + rm lib/libQt5Bootstrap.a lib/lib*.la lib/*.prl plugins/*/*.prl endef From c8b115e20ba8bc0deff7d94a91dfadf9822a561e Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 12 Nov 2014 19:24:29 -0500 Subject: [PATCH 1006/1288] travis: temporarily disable the forknotify test It appears to be breaking randomly on Windows --- qa/pull-tester/rpc-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/pull-tester/rpc-tests.sh b/qa/pull-tester/rpc-tests.sh index f07e3c6d9d..a0056c141b 100755 --- a/qa/pull-tester/rpc-tests.sh +++ b/qa/pull-tester/rpc-tests.sh @@ -13,7 +13,7 @@ export BITCOIND=${REAL_BITCOIND} if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then ${BUILDDIR}/qa/rpc-tests/wallet.sh "${BUILDDIR}/src" ${BUILDDIR}/qa/rpc-tests/listtransactions.py --srcdir "${BUILDDIR}/src" - ${BUILDDIR}/qa/rpc-tests/forknotify.py --srcdir "${BUILDDIR}/src" + #${BUILDDIR}/qa/rpc-tests/forknotify.py --srcdir "${BUILDDIR}/src" else echo "No rpc tests to run. Wallet, utils, and bitcoind must all be enabled" fi From 8fa0494e9205e1c2151046010cc200c7c9ee022e Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 13 Nov 2014 15:20:57 +0100 Subject: [PATCH 1007/1288] Win32: log addresses found in Discover() calls --- src/net.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index a66875a894..695adeec54 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1567,7 +1567,8 @@ void static Discover(boost::thread_group& threadGroup) { BOOST_FOREACH (const CNetAddr &addr, vaddr) { - AddLocal(addr, LOCAL_IF); + if (AddLocal(addr, LOCAL_IF)) + LogPrintf("%s: %s - %s\n", __func__, pszHostName, addr.ToString()); } } } @@ -1587,20 +1588,19 @@ void static Discover(boost::thread_group& threadGroup) struct sockaddr_in* s4 = (struct sockaddr_in*)(ifa->ifa_addr); CNetAddr addr(s4->sin_addr); if (AddLocal(addr, LOCAL_IF)) - LogPrintf("IPv4 %s: %s\n", ifa->ifa_name, addr.ToString()); + LogPrintf("%s: IPv4 %s: %s\n", __func__, ifa->ifa_name, addr.ToString()); } else if (ifa->ifa_addr->sa_family == AF_INET6) { struct sockaddr_in6* s6 = (struct sockaddr_in6*)(ifa->ifa_addr); CNetAddr addr(s6->sin6_addr); if (AddLocal(addr, LOCAL_IF)) - LogPrintf("IPv6 %s: %s\n", ifa->ifa_name, addr.ToString()); + LogPrintf("%s: IPv6 %s: %s\n", __func__, ifa->ifa_name, addr.ToString()); } } freeifaddrs(myaddrs); } #endif - } void StartNode(boost::thread_group& threadGroup) From cd4d3f1915f56278d83ca00d7a970d08970f2fa4 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 13 Nov 2014 15:23:15 +0100 Subject: [PATCH 1008/1288] Win32: change buffer size for gethotsname in Discover() - 256 byte is the maximum, as per http://msdn.microsoft.com/en-us/library/windows/desktop/ms738527%28v=vs.85%29.aspx --- src/net.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net.cpp b/src/net.cpp index 695adeec54..6bf72d22c5 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1559,7 +1559,7 @@ void static Discover(boost::thread_group& threadGroup) #ifdef WIN32 // Get local host IP - char pszHostName[1000] = ""; + char pszHostName[256] = ""; if (gethostname(pszHostName, sizeof(pszHostName)) != SOCKET_ERROR) { vector vaddr; From a7af9839d688bee9b0b15add61259140b3c00014 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Fri, 14 Nov 2014 09:12:41 -0600 Subject: [PATCH 1009/1288] don't override dir() in qa rpc tests Replace "dir" with "dirname" in util.py in qa/rpc-tests/ because "dir" is the name of a function in python. --- qa/rpc-tests/util.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index e5383b6c57..0d5eeefa79 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -61,8 +61,8 @@ def sync_mempools(rpc_connections): bitcoind_processes = {} -def initialize_datadir(dir, n): - datadir = os.path.join(dir, "node"+str(n)) +def initialize_datadir(dirname, n): + datadir = os.path.join(dirname, "node"+str(n)) if not os.path.isdir(datadir): os.makedirs(datadir) with open(os.path.join(datadir, "bitcoin.conf"), 'w') as f: @@ -145,11 +145,11 @@ def _rpchost_to_args(rpchost): rv += ['-rpcport=' + rpcport] return rv -def start_node(i, dir, extra_args=None, rpchost=None): +def start_node(i, dirname, extra_args=None, rpchost=None): """ Start a bitcoind and return RPC connection to it """ - datadir = os.path.join(dir, "node"+str(i)) + datadir = os.path.join(dirname, "node"+str(i)) args = [ os.getenv("BITCOIND", "bitcoind"), "-datadir="+datadir, "-keypool=1", "-discover=0" ] if extra_args is not None: args.extend(extra_args) bitcoind_processes[i] = subprocess.Popen(args) @@ -163,15 +163,15 @@ def start_node(i, dir, extra_args=None, rpchost=None): proxy.url = url # store URL on proxy for info return proxy -def start_nodes(num_nodes, dir, extra_args=None, rpchost=None): +def start_nodes(num_nodes, dirname, extra_args=None, rpchost=None): """ Start multiple bitcoinds, return RPC connections to them """ if extra_args is None: extra_args = [ None for i in range(num_nodes) ] - return [ start_node(i, dir, extra_args[i], rpchost) for i in range(num_nodes) ] + return [ start_node(i, dirname, extra_args[i], rpchost) for i in range(num_nodes) ] -def log_filename(dir, n_node, logname): - return os.path.join(dir, "node"+str(n_node), "regtest", logname) +def log_filename(dirname, n_node, logname): + return os.path.join(dirname, "node"+str(n_node), "regtest", logname) def stop_node(node, i): node.stop() From 18379875bf7dd91637e4a206db58cd0968b5d47f Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Thu, 13 Nov 2014 14:52:04 -0500 Subject: [PATCH 1010/1288] Optimize -regtest setgenerate block generation Speed up generating blocks in regression test mode, by moving block-creating and nonce-finding directly into the setgenerate RPC call (instead of starting up a mining thread and waiting for it to find a block). This makes the forknotify RPC test three times quicker, for example (10 seconds runtime instead of 30 seconds, assuming the initial blockchain cache is already built). --- src/rpcmining.cpp | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 879a504115..2bde02c0a1 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -121,6 +121,8 @@ Value setgenerate(const Array& params, bool fHelp) "1. generate (boolean, required) Set to true to turn on generation, off to turn off.\n" "2. genproclimit (numeric, optional) Set the processor limit for when generation is on. Can be -1 for unlimited.\n" " Note: in -regtest mode, genproclimit controls how many blocks are generated immediately.\n" + "\nResult\n" + "[ blockhashes ] (array, -regtest only) hashes of blocks generated\n" "\nExamples:\n" "\nSet the generation on with a limit of one processor\n" + HelpExampleCli("setgenerate", "true 1") + @@ -154,26 +156,38 @@ Value setgenerate(const Array& params, bool fHelp) int nHeightEnd = 0; int nHeight = 0; int nGenerate = (nGenProcLimit > 0 ? nGenProcLimit : 1); + CReserveKey reservekey(pwalletMain); + { // Don't keep cs_main locked LOCK(cs_main); nHeightStart = chainActive.Height(); nHeight = nHeightStart; nHeightEnd = nHeightStart+nGenerate; } - int nHeightLast = -1; + unsigned int nExtraNonce = 0; + Array blockHashes; while (nHeight < nHeightEnd) { - if (nHeightLast != nHeight) + auto_ptr pblocktemplate(CreateNewBlockWithKey(reservekey)); + if (!pblocktemplate.get()) + throw JSONRPCError(RPC_INTERNAL_ERROR, "Wallet keypool empty"); + CBlock *pblock = &pblocktemplate->block; { - nHeightLast = nHeight; - GenerateBitcoins(fGenerate, pwalletMain, 1); - } - MilliSleep(1); - { // Don't keep cs_main locked LOCK(cs_main); - nHeight = chainActive.Height(); + IncrementExtraNonce(pblock, chainActive.Tip(), nExtraNonce); } + while (!CheckProofOfWork(pblock->GetHash(), pblock->nBits)) { + // Yes, there is a chance every nonce could fail to satisfy the -regtest + // target -- 1 in 2^(2^32). That ain't gonna happen. + ++pblock->nNonce; + } + CValidationState state; + if (!ProcessNewBlock(state, NULL, pblock)) + throw JSONRPCError(RPC_INTERNAL_ERROR, "ProcessNewBlock, block not accepted"); + ++nHeight; + blockHashes.push_back(pblock->GetHash().GetHex()); } + return blockHashes; } else // Not -regtest: start generate thread, return immediately { From ab9edbd6b6eb3efbca11f16fa467c3c0ef905708 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 31 Oct 2014 23:29:12 -0400 Subject: [PATCH 1011/1288] script: create sane error return codes for script validation and remove logging Attempt to codify the possible error statuses associated with script validation. script/types.h has been created with the expectation that it will be part of the public lib interface. The other flag enums will be moved here in a future commit. Logging has also been removed in order to drop the dependency on core.h. It can be re-added to bitcoind as-needed. This makes script verification finally free of application state and boost! --- src/Makefile.am | 2 + src/script/interpreter.cpp | 297 ++++++++++++++++++++++-------------- src/script/interpreter.h | 6 +- src/script/script_error.cpp | 67 ++++++++ src/script/script_error.h | 53 +++++++ 5 files changed, 306 insertions(+), 119 deletions(-) create mode 100644 src/script/script_error.cpp create mode 100644 src/script/script_error.h diff --git a/src/Makefile.am b/src/Makefile.am index 8b5d009842..b3b41e3d17 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -112,6 +112,7 @@ BITCOIN_CORE_H = \ script/sigcache.h \ script/sign.h \ script/standard.h \ + script/script_error.h \ serialize.h \ streams.h \ sync.h \ @@ -235,6 +236,7 @@ libbitcoin_common_a_SOURCES = \ script/script.cpp \ script/sign.cpp \ script/standard.cpp \ + script/script_error.cpp \ $(BITCOIN_CORE_H) # util: shared between all executables. diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 5fda6248c2..cf81fe30a2 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -13,7 +13,6 @@ #include "pubkey.h" #include "script/script.h" #include "uint256.h" -#include "util.h" using namespace std; @@ -26,6 +25,24 @@ static const CScriptNum bnOne(1); static const CScriptNum bnFalse(0); static const CScriptNum bnTrue(1); +namespace { + +inline bool set_success(ScriptError* ret) +{ + if (ret) + *ret = SCRIPT_ERR_OK; + return true; +} + +inline bool set_error(ScriptError* ret, const ScriptError serror) +{ + if (ret) + *ret = serror; + return false; +} + +} // anon namespace + bool CastToBool(const valtype& vch) { for (unsigned int i = 0; i < vch.size(); i++) @@ -55,16 +72,23 @@ static inline void popstack(vector& stack) } bool static IsCompressedOrUncompressedPubKey(const valtype &vchPubKey) { - if (vchPubKey.size() < 33) - return error("Non-canonical public key: too short"); + if (vchPubKey.size() < 33) { + // Non-canonical public key: too short + return false; + } if (vchPubKey[0] == 0x04) { - if (vchPubKey.size() != 65) - return error("Non-canonical public key: invalid length for uncompressed key"); + if (vchPubKey.size() != 65) { + // Non-canonical public key: invalid length for uncompressed key + return false; + } } else if (vchPubKey[0] == 0x02 || vchPubKey[0] == 0x03) { - if (vchPubKey.size() != 33) - return error("Non-canonical public key: invalid length for compressed key"); + if (vchPubKey.size() != 33) { + // Non-canonical public key: invalid length for compressed key + return false; + } } else { - return error("Non-canonical public key: neither compressed nor uncompressed"); + // Non-canonical public key: neither compressed nor uncompressed + return false; } return true; } @@ -79,47 +103,74 @@ bool static IsCompressedOrUncompressedPubKey(const valtype &vchPubKey) { */ bool static IsDERSignature(const valtype &vchSig) { - if (vchSig.size() < 9) - return error("Non-canonical signature: too short"); - if (vchSig.size() > 73) - return error("Non-canonical signature: too long"); - if (vchSig[0] != 0x30) - return error("Non-canonical signature: wrong type"); - if (vchSig[1] != vchSig.size()-3) - return error("Non-canonical signature: wrong length marker"); + if (vchSig.size() < 9) { + // Non-canonical signature: too short + return false; + } + if (vchSig.size() > 73) { + // Non-canonical signature: too long + return false; + } + if (vchSig[0] != 0x30) { + // Non-canonical signature: wrong type + return false; + } + if (vchSig[1] != vchSig.size()-3) { + // Non-canonical signature: wrong length marker + return false; + } unsigned int nLenR = vchSig[3]; - if (5 + nLenR >= vchSig.size()) - return error("Non-canonical signature: S length misplaced"); + if (5 + nLenR >= vchSig.size()) { + // Non-canonical signature: S length misplaced + return false; + } unsigned int nLenS = vchSig[5+nLenR]; - if ((unsigned long)(nLenR+nLenS+7) != vchSig.size()) - return error("Non-canonical signature: R+S length mismatch"); + if ((unsigned long)(nLenR+nLenS+7) != vchSig.size()) { + // Non-canonical signature: R+S length mismatch + return false; + } const unsigned char *R = &vchSig[4]; - if (R[-2] != 0x02) - return error("Non-canonical signature: R value type mismatch"); - if (nLenR == 0) - return error("Non-canonical signature: R length is zero"); - if (R[0] & 0x80) - return error("Non-canonical signature: R value negative"); - if (nLenR > 1 && (R[0] == 0x00) && !(R[1] & 0x80)) - return error("Non-canonical signature: R value excessively padded"); + if (R[-2] != 0x02) { + // Non-canonical signature: R value type mismatch + return false; + } + if (nLenR == 0) { + // Non-canonical signature: R length is zero + return false; + } + if (R[0] & 0x80) { + // Non-canonical signature: R value negative + return false; + } + if (nLenR > 1 && (R[0] == 0x00) && !(R[1] & 0x80)) { + // Non-canonical signature: R value excessively padded + return false; + } const unsigned char *S = &vchSig[6+nLenR]; - if (S[-2] != 0x02) - return error("Non-canonical signature: S value type mismatch"); - if (nLenS == 0) - return error("Non-canonical signature: S length is zero"); - if (S[0] & 0x80) - return error("Non-canonical signature: S value negative"); - if (nLenS > 1 && (S[0] == 0x00) && !(S[1] & 0x80)) - return error("Non-canonical signature: S value excessively padded"); - + if (S[-2] != 0x02) { + // Non-canonical signature: S value type mismatch + return false; + } + if (nLenS == 0) { + // Non-canonical signature: S length is zero + return false; + } + if (S[0] & 0x80) { + // Non-canonical signature: S value negative + return false; + } + if (nLenS > 1 && (S[0] == 0x00) && !(S[1] & 0x80)) { + // Non-canonical signature: S value excessively padded + return false; + } return true; } -bool static IsLowDERSignature(const valtype &vchSig) { +bool static IsLowDERSignature(const valtype &vchSig, ScriptError* serror) { if (!IsDERSignature(vchSig)) { - return false; + return set_error(serror, SCRIPT_ERR_SIG_DER); } unsigned int nLenR = vchSig[3]; unsigned int nLenS = vchSig[5+nLenR]; @@ -128,7 +179,7 @@ bool static IsLowDERSignature(const valtype &vchSig) { // complement modulo the order could have been used instead, which is // one byte shorter when encoded correctly. if (!eccrypto::CheckSignatureElement(S, nLenS, true)) - return error("Non-canonical signature: S value is unnecessarily high"); + return set_error(serror, SCRIPT_ERR_SIG_HIGH_S); return true; } @@ -139,18 +190,19 @@ bool static IsDefinedHashtypeSignature(const valtype &vchSig) { } unsigned char nHashType = vchSig[vchSig.size() - 1] & (~(SIGHASH_ANYONECANPAY)); if (nHashType < SIGHASH_ALL || nHashType > SIGHASH_SINGLE) - return error("Non-canonical signature: unknown hashtype byte"); + return false; return true; } -bool static CheckSignatureEncoding(const valtype &vchSig, unsigned int flags) { +bool static CheckSignatureEncoding(const valtype &vchSig, unsigned int flags, ScriptError* serror) { if ((flags & (SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_LOW_S | SCRIPT_VERIFY_STRICTENC)) != 0 && !IsDERSignature(vchSig)) { - return false; - } else if ((flags & SCRIPT_VERIFY_LOW_S) != 0 && !IsLowDERSignature(vchSig)) { + return set_error(serror, SCRIPT_ERR_SIG_DER); + } else if ((flags & SCRIPT_VERIFY_LOW_S) != 0 && !IsLowDERSignature(vchSig, serror)) { + // serror is set return false; } else if ((flags & SCRIPT_VERIFY_STRICTENC) != 0 && !IsDefinedHashtypeSignature(vchSig)) { - return false; + return set_error(serror, SCRIPT_ERR_SIG_HASHTYPE); } return true; } @@ -185,7 +237,7 @@ bool static CheckMinimalPush(const valtype& data, opcodetype opcode) { return true; } -bool EvalScript(vector >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker) +bool EvalScript(vector >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* serror) { CScript::const_iterator pc = script.begin(); CScript::const_iterator pend = script.end(); @@ -194,8 +246,9 @@ bool EvalScript(vector >& stack, const CScript& script, un valtype vchPushValue; vector vfExec; vector altstack; + set_error(serror, SCRIPT_ERR_UNKNOWN_ERROR); if (script.size() > 10000) - return false; + return set_error(serror, SCRIPT_ERR_SCRIPT_SIZE); int nOpCount = 0; bool fRequireMinimal = (flags & SCRIPT_VERIFY_MINIMALDATA) != 0; @@ -209,13 +262,13 @@ bool EvalScript(vector >& stack, const CScript& script, un // Read instruction // if (!script.GetOp(pc, opcode, vchPushValue)) - return false; + return set_error(serror, SCRIPT_ERR_BAD_OPCODE); if (vchPushValue.size() > MAX_SCRIPT_ELEMENT_SIZE) - return false; + return set_error(serror, SCRIPT_ERR_PUSH_SIZE); // Note how OP_RESERVED does not count towards the opcode limit. if (opcode > OP_16 && ++nOpCount > 201) - return false; + return set_error(serror, SCRIPT_ERR_OP_COUNT); if (opcode == OP_CAT || opcode == OP_SUBSTR || @@ -232,11 +285,11 @@ bool EvalScript(vector >& stack, const CScript& script, un opcode == OP_MOD || opcode == OP_LSHIFT || opcode == OP_RSHIFT) - return false; // Disabled opcodes. + return set_error(serror, SCRIPT_ERR_DISABLED_OPCODE); // Disabled opcodes. if (fExec && 0 <= opcode && opcode <= OP_PUSHDATA4) { if (fRequireMinimal && !CheckMinimalPush(vchPushValue, opcode)) { - return false; + return set_error(serror, SCRIPT_ERR_MINIMALDATA); } stack.push_back(vchPushValue); } else if (fExec || (OP_IF <= opcode && opcode <= OP_ENDIF)) @@ -288,7 +341,7 @@ bool EvalScript(vector >& stack, const CScript& script, un if (fExec) { if (stack.size() < 1) - return false; + return set_error(serror, SCRIPT_ERR_UNBALANCED_CONDITIONAL); valtype& vch = stacktop(-1); fValue = CastToBool(vch); if (opcode == OP_NOTIF) @@ -302,7 +355,7 @@ bool EvalScript(vector >& stack, const CScript& script, un case OP_ELSE: { if (vfExec.empty()) - return false; + return set_error(serror, SCRIPT_ERR_UNBALANCED_CONDITIONAL); vfExec.back() = !vfExec.back(); } break; @@ -310,7 +363,7 @@ bool EvalScript(vector >& stack, const CScript& script, un case OP_ENDIF: { if (vfExec.empty()) - return false; + return set_error(serror, SCRIPT_ERR_UNBALANCED_CONDITIONAL); vfExec.pop_back(); } break; @@ -320,18 +373,18 @@ bool EvalScript(vector >& stack, const CScript& script, un // (true -- ) or // (false -- false) and return if (stack.size() < 1) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); bool fValue = CastToBool(stacktop(-1)); if (fValue) popstack(stack); else - return false; + return set_error(serror, SCRIPT_ERR_VERIFY); } break; case OP_RETURN: { - return false; + return set_error(serror, SCRIPT_ERR_OP_RETURN); } break; @@ -342,7 +395,7 @@ bool EvalScript(vector >& stack, const CScript& script, un case OP_TOALTSTACK: { if (stack.size() < 1) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); altstack.push_back(stacktop(-1)); popstack(stack); } @@ -351,7 +404,7 @@ bool EvalScript(vector >& stack, const CScript& script, un case OP_FROMALTSTACK: { if (altstack.size() < 1) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_ALTSTACK_OPERATION); stack.push_back(altstacktop(-1)); popstack(altstack); } @@ -361,7 +414,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (x1 x2 -- ) if (stack.size() < 2) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); popstack(stack); popstack(stack); } @@ -371,7 +424,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (x1 x2 -- x1 x2 x1 x2) if (stack.size() < 2) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); valtype vch1 = stacktop(-2); valtype vch2 = stacktop(-1); stack.push_back(vch1); @@ -383,7 +436,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (x1 x2 x3 -- x1 x2 x3 x1 x2 x3) if (stack.size() < 3) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); valtype vch1 = stacktop(-3); valtype vch2 = stacktop(-2); valtype vch3 = stacktop(-1); @@ -397,7 +450,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (x1 x2 x3 x4 -- x1 x2 x3 x4 x1 x2) if (stack.size() < 4) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); valtype vch1 = stacktop(-4); valtype vch2 = stacktop(-3); stack.push_back(vch1); @@ -409,7 +462,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (x1 x2 x3 x4 x5 x6 -- x3 x4 x5 x6 x1 x2) if (stack.size() < 6) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); valtype vch1 = stacktop(-6); valtype vch2 = stacktop(-5); stack.erase(stack.end()-6, stack.end()-4); @@ -422,7 +475,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (x1 x2 x3 x4 -- x3 x4 x1 x2) if (stack.size() < 4) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); swap(stacktop(-4), stacktop(-2)); swap(stacktop(-3), stacktop(-1)); } @@ -432,7 +485,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (x - 0 | x x) if (stack.size() < 1) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); valtype vch = stacktop(-1); if (CastToBool(vch)) stack.push_back(vch); @@ -451,7 +504,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (x -- ) if (stack.size() < 1) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); popstack(stack); } break; @@ -460,7 +513,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (x -- x x) if (stack.size() < 1) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); valtype vch = stacktop(-1); stack.push_back(vch); } @@ -470,7 +523,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (x1 x2 -- x2) if (stack.size() < 2) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); stack.erase(stack.end() - 2); } break; @@ -479,7 +532,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (x1 x2 -- x1 x2 x1) if (stack.size() < 2) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); valtype vch = stacktop(-2); stack.push_back(vch); } @@ -491,11 +544,11 @@ bool EvalScript(vector >& stack, const CScript& script, un // (xn ... x2 x1 x0 n - xn ... x2 x1 x0 xn) // (xn ... x2 x1 x0 n - ... x2 x1 x0 xn) if (stack.size() < 2) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); int n = CScriptNum(stacktop(-1), fRequireMinimal).getint(); popstack(stack); if (n < 0 || n >= (int)stack.size()) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); valtype vch = stacktop(-n-1); if (opcode == OP_ROLL) stack.erase(stack.end()-n-1); @@ -509,7 +562,7 @@ bool EvalScript(vector >& stack, const CScript& script, un // x2 x1 x3 after first swap // x2 x3 x1 after second swap if (stack.size() < 3) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); swap(stacktop(-3), stacktop(-2)); swap(stacktop(-2), stacktop(-1)); } @@ -519,7 +572,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (x1 x2 -- x2 x1) if (stack.size() < 2) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); swap(stacktop(-2), stacktop(-1)); } break; @@ -528,7 +581,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (x1 x2 -- x2 x1 x2) if (stack.size() < 2) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); valtype vch = stacktop(-1); stack.insert(stack.end()-2, vch); } @@ -539,7 +592,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (in -- in size) if (stack.size() < 1) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); CScriptNum bn(stacktop(-1).size()); stack.push_back(bn.getvch()); } @@ -555,7 +608,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (x1 x2 - bool) if (stack.size() < 2) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); valtype& vch1 = stacktop(-2); valtype& vch2 = stacktop(-1); bool fEqual = (vch1 == vch2); @@ -572,7 +625,7 @@ bool EvalScript(vector >& stack, const CScript& script, un if (fEqual) popstack(stack); else - return false; + return set_error(serror, SCRIPT_ERR_EQUALVERIFY); } } break; @@ -590,7 +643,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (in -- out) if (stack.size() < 1) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); CScriptNum bn(stacktop(-1), fRequireMinimal); switch (opcode) { @@ -623,7 +676,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (x1 x2 -- out) if (stack.size() < 2) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); CScriptNum bn1(stacktop(-2), fRequireMinimal); CScriptNum bn2(stacktop(-1), fRequireMinimal); CScriptNum bn(0); @@ -659,7 +712,7 @@ bool EvalScript(vector >& stack, const CScript& script, un if (CastToBool(stacktop(-1))) popstack(stack); else - return false; + return set_error(serror, SCRIPT_ERR_NUMEQUALVERIFY); } } break; @@ -668,7 +721,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (x min max -- out) if (stack.size() < 3) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); CScriptNum bn1(stacktop(-3), fRequireMinimal); CScriptNum bn2(stacktop(-2), fRequireMinimal); CScriptNum bn3(stacktop(-1), fRequireMinimal); @@ -692,7 +745,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (in -- hash) if (stack.size() < 1) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); valtype& vch = stacktop(-1); valtype vchHash((opcode == OP_RIPEMD160 || opcode == OP_SHA1 || opcode == OP_HASH160) ? 20 : 32); if (opcode == OP_RIPEMD160) @@ -722,7 +775,7 @@ bool EvalScript(vector >& stack, const CScript& script, un { // (sig pubkey -- bool) if (stack.size() < 2) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); valtype& vchSig = stacktop(-2); valtype& vchPubKey = stacktop(-1); @@ -733,10 +786,10 @@ bool EvalScript(vector >& stack, const CScript& script, un // Drop the signature, since there's no way for a signature to sign itself scriptCode.FindAndDelete(CScript(vchSig)); - if (!CheckSignatureEncoding(vchSig, flags)) { + if (!CheckSignatureEncoding(vchSig, flags, serror)) { + //serror is set return false; } - bool fSuccess = CheckPubKeyEncoding(vchPubKey, flags) && checker.CheckSig(vchSig, vchPubKey, scriptCode); popstack(stack); @@ -747,7 +800,7 @@ bool EvalScript(vector >& stack, const CScript& script, un if (fSuccess) popstack(stack); else - return false; + return set_error(serror, SCRIPT_ERR_CHECKSIGVERIFY); } } break; @@ -759,26 +812,26 @@ bool EvalScript(vector >& stack, const CScript& script, un int i = 1; if ((int)stack.size() < i) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); int nKeysCount = CScriptNum(stacktop(-i), fRequireMinimal).getint(); if (nKeysCount < 0 || nKeysCount > 20) - return false; + return set_error(serror, SCRIPT_ERR_PUBKEY_COUNT); nOpCount += nKeysCount; if (nOpCount > 201) - return false; + return set_error(serror, SCRIPT_ERR_OP_COUNT); int ikey = ++i; i += nKeysCount; if ((int)stack.size() < i) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); int nSigsCount = CScriptNum(stacktop(-i), fRequireMinimal).getint(); if (nSigsCount < 0 || nSigsCount > nKeysCount) - return false; + return set_error(serror, SCRIPT_ERR_SIG_COUNT); int isig = ++i; i += nSigsCount; if ((int)stack.size() < i) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); // Subset of script starting at the most recent codeseparator CScript scriptCode(pbegincodehash, pend); @@ -796,7 +849,8 @@ bool EvalScript(vector >& stack, const CScript& script, un valtype& vchSig = stacktop(-isig); valtype& vchPubKey = stacktop(-ikey); - if (!CheckSignatureEncoding(vchSig, flags)) { + if (!CheckSignatureEncoding(vchSig, flags, serror)) { + // serror is set return false; } @@ -827,9 +881,9 @@ bool EvalScript(vector >& stack, const CScript& script, un // so optionally verify it is exactly equal to zero prior // to removing it from the stack. if (stack.size() < 1) - return false; + return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); if ((flags & SCRIPT_VERIFY_NULLDUMMY) && stacktop(-1).size()) - return error("CHECKMULTISIG dummy argument not null"); + return set_error(serror, SCRIPT_ERR_SIG_NULLDUMMY); popstack(stack); stack.push_back(fSuccess ? vchTrue : vchFalse); @@ -839,29 +893,29 @@ bool EvalScript(vector >& stack, const CScript& script, un if (fSuccess) popstack(stack); else - return false; + return set_error(serror, SCRIPT_ERR_CHECKMULTISIGVERIFY); } } break; default: - return false; + return set_error(serror, SCRIPT_ERR_BAD_OPCODE); } // Size limits if (stack.size() + altstack.size() > 1000) - return false; + return set_error(serror, SCRIPT_ERR_STACK_SIZE); } } catch (...) { - return false; + return set_error(serror, SCRIPT_ERR_UNKNOWN_ERROR); } if (!vfExec.empty()) - return false; + return set_error(serror, SCRIPT_ERR_UNBALANCED_CONDITIONAL); - return true; + return set_success(serror); } namespace { @@ -966,14 +1020,14 @@ public: uint256 SignatureHash(const CScript& scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType) { if (nIn >= txTo.vin.size()) { - LogPrintf("ERROR: SignatureHash() : nIn=%d out of range\n", nIn); + // nIn out of range return 1; } // Check for invalid use of SIGHASH_SINGLE if ((nHashType & 0x1f) == SIGHASH_SINGLE) { if (nIn >= txTo.vout.size()) { - LogPrintf("ERROR: SignatureHash() : nOut=%d out of range\n", nIn); + // nOut out of range return 1; } } @@ -1013,30 +1067,35 @@ bool SignatureChecker::CheckSig(const vector& vchSigIn, const vec return true; } -bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigned int flags, const BaseSignatureChecker& checker) +bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* serror) { + set_error(serror, SCRIPT_ERR_UNKNOWN_ERROR); + if ((flags & SCRIPT_VERIFY_SIGPUSHONLY) != 0 && !scriptSig.IsPushOnly()) { - return false; + return set_error(serror, SCRIPT_ERR_SIG_PUSHONLY); } vector > stack, stackCopy; - if (!EvalScript(stack, scriptSig, flags, checker)) + if (!EvalScript(stack, scriptSig, flags, checker, serror)) + // serror is set return false; if (flags & SCRIPT_VERIFY_P2SH) stackCopy = stack; - if (!EvalScript(stack, scriptPubKey, flags, checker)) + if (!EvalScript(stack, scriptPubKey, flags, checker, serror)) + // serror is set return false; if (stack.empty()) - return false; + return set_error(serror, SCRIPT_ERR_EVAL_FALSE); if (CastToBool(stack.back()) == false) - return false; + return set_error(serror, SCRIPT_ERR_EVAL_FALSE); // Additional validation for spend-to-script-hash transactions: if ((flags & SCRIPT_VERIFY_P2SH) && scriptPubKey.IsPayToScriptHash()) { - if (!scriptSig.IsPushOnly()) // scriptSig must be literals-only - return false; // or validation fails + // scriptSig must be literals-only or validation fails + if (!scriptSig.IsPushOnly()) + return set_error(serror, SCRIPT_ERR_SIG_PUSHONLY); // stackCopy cannot be empty here, because if it was the // P2SH HASH <> EQUAL scriptPubKey would be evaluated with @@ -1047,12 +1106,16 @@ bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigne CScript pubKey2(pubKeySerialized.begin(), pubKeySerialized.end()); popstack(stackCopy); - if (!EvalScript(stackCopy, pubKey2, flags, checker)) + if (!EvalScript(stackCopy, pubKey2, flags, checker, serror)) + // serror is set return false; if (stackCopy.empty()) - return false; - return CastToBool(stackCopy.back()); + return set_error(serror, SCRIPT_ERR_EVAL_FALSE); + if (!CastToBool(stackCopy.back())) + return set_error(serror, SCRIPT_ERR_EVAL_FALSE); + else + return set_success(serror); } - return true; + return set_success(serror); } diff --git a/src/script/interpreter.h b/src/script/interpreter.h index ed899fc411..14cccc558f 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -6,6 +6,8 @@ #ifndef BITCOIN_SCRIPT_INTERPRETER_H #define BITCOIN_SCRIPT_INTERPRETER_H +#include "script_error.h" + #include #include #include @@ -85,7 +87,7 @@ public: bool CheckSig(const std::vector& scriptSig, const std::vector& vchPubKey, const CScript& scriptCode) const; }; -bool EvalScript(std::vector >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker); -bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigned int flags, const BaseSignatureChecker& checker); +bool EvalScript(std::vector >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* error = NULL); +bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* error = NULL); #endif // BITCOIN_SCRIPT_INTERPRETER_H diff --git a/src/script/script_error.cpp b/src/script/script_error.cpp new file mode 100644 index 0000000000..4a3df268ec --- /dev/null +++ b/src/script/script_error.cpp @@ -0,0 +1,67 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "script_error.h" + +const char* ScriptErrorString(const ScriptError serror) +{ + switch (serror) + { + case SCRIPT_ERR_OK: + return "No error"; + case SCRIPT_ERR_EVAL_FALSE: + return "Script evaluated without error but finished with a false/empty top stack element"; + case SCRIPT_ERR_VERIFY: + return "Script failed an OP_VERIFY operation"; + case SCRIPT_ERR_EQUALVERIFY: + return "Script failed an OP_EQUALVERIFY operation"; + case SCRIPT_ERR_CHECKMULTISIGVERIFY: + return "Script failed an OP_CHECKMULTISIGVERIFY operation"; + case SCRIPT_ERR_CHECKSIGVERIFY: + return "Script failed an OP_CHECKSIGVERIFY operation"; + case SCRIPT_ERR_NUMEQUALVERIFY: + return "Script failed an OP_NUMEQUALVERIFY operation"; + case SCRIPT_ERR_SCRIPT_SIZE: + return "Script is too big"; + case SCRIPT_ERR_PUSH_SIZE: + return "Push value size limit exceeded"; + case SCRIPT_ERR_OP_COUNT: + return "Operation limit exceeded"; + case SCRIPT_ERR_STACK_SIZE: + return "Stack size limit exceeded"; + case SCRIPT_ERR_SIG_COUNT: + return "Signature count negative or greater than pubkey count"; + case SCRIPT_ERR_PUBKEY_COUNT: + return "Pubkey count negative or limit exceeded"; + case SCRIPT_ERR_BAD_OPCODE: + return "Opcode missing or not understood"; + case SCRIPT_ERR_DISABLED_OPCODE: + return "Attempted to use a disabled opcode"; + case SCRIPT_ERR_INVALID_STACK_OPERATION: + return "Operation not valid with the current stack size"; + case SCRIPT_ERR_INVALID_ALTSTACK_OPERATION: + return "Operation not valid with the current altstack size"; + case SCRIPT_ERR_OP_RETURN: + return "OP_RETURN was encountered"; + case SCRIPT_ERR_UNBALANCED_CONDITIONAL: + return "Invalid OP_IF construction"; + case SCRIPT_ERR_SIG_HASHTYPE: + return "Signature hash type missing or not understood"; + case SCRIPT_ERR_SIG_DER: + return "Non-canonical DER signature"; + case SCRIPT_ERR_MINIMALDATA: + return "Data push larger than necessary"; + case SCRIPT_ERR_SIG_PUSHONLY: + return "Only non-push operators allowed in signatures"; + case SCRIPT_ERR_SIG_HIGH_S: + return "Non-canonical signature: S value is unnecessarily high"; + case SCRIPT_ERR_SIG_NULLDUMMY: + return "Dummy CHECKMULTISIG argument must be zero"; + case SCRIPT_ERR_UNKNOWN_ERROR: + case SCRIPT_ERR_ERROR_COUNT: + default: break; + } + return "unknown error"; +} diff --git a/src/script/script_error.h b/src/script/script_error.h new file mode 100644 index 0000000000..ae6626b257 --- /dev/null +++ b/src/script/script_error.h @@ -0,0 +1,53 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_SCRIPT_ERROR_H +#define BITCOIN_SCRIPT_ERROR_H + +typedef enum ScriptError_t +{ + SCRIPT_ERR_OK = 0, + SCRIPT_ERR_UNKNOWN_ERROR, + SCRIPT_ERR_EVAL_FALSE, + SCRIPT_ERR_OP_RETURN, + + /* Max sizes */ + SCRIPT_ERR_SCRIPT_SIZE, + SCRIPT_ERR_PUSH_SIZE, + SCRIPT_ERR_OP_COUNT, + SCRIPT_ERR_STACK_SIZE, + SCRIPT_ERR_SIG_COUNT, + SCRIPT_ERR_PUBKEY_COUNT, + + /* Failed verify operations */ + SCRIPT_ERR_VERIFY, + SCRIPT_ERR_EQUALVERIFY, + SCRIPT_ERR_CHECKMULTISIGVERIFY, + SCRIPT_ERR_CHECKSIGVERIFY, + SCRIPT_ERR_NUMEQUALVERIFY, + + /* Logical/Format/Canonical errors */ + SCRIPT_ERR_BAD_OPCODE, + SCRIPT_ERR_DISABLED_OPCODE, + SCRIPT_ERR_INVALID_STACK_OPERATION, + SCRIPT_ERR_INVALID_ALTSTACK_OPERATION, + SCRIPT_ERR_UNBALANCED_CONDITIONAL, + + /* BIP62 */ + SCRIPT_ERR_SIG_HASHTYPE, + SCRIPT_ERR_SIG_DER, + SCRIPT_ERR_MINIMALDATA, + SCRIPT_ERR_SIG_PUSHONLY, + SCRIPT_ERR_SIG_HIGH_S, + SCRIPT_ERR_SIG_NULLDUMMY, + + SCRIPT_ERR_ERROR_COUNT +} ScriptError; + +#define SCRIPT_ERR_LAST SCRIPT_ERR_ERROR_COUNT + +const char* ScriptErrorString(const ScriptError error); + +#endif // BITCOIN_SCRIPT_ERROR_H From 219a1470c4ca05579cf5f3d75db0d632d17c13d4 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 13 Nov 2014 14:27:38 -0500 Subject: [PATCH 1012/1288] script: check ScriptError values in script tests --- src/test/multisig_tests.cpp | 37 ++++++++++++++----- src/test/script_P2SH_tests.cpp | 19 ++++++---- src/test/script_tests.cpp | 66 +++++++++++++++++++++++----------- src/test/transaction_tests.cpp | 10 ++++-- 4 files changed, 94 insertions(+), 38 deletions(-) diff --git a/src/test/multisig_tests.cpp b/src/test/multisig_tests.cpp index e9fc86779a..8d06caa147 100644 --- a/src/test/multisig_tests.cpp +++ b/src/test/multisig_tests.cpp @@ -6,6 +6,7 @@ #include "keystore.h" #include "main.h" #include "script/script.h" +#include "script/script_error.h" #include "script/interpreter.h" #include "script/sign.h" #include "uint256.h" @@ -46,6 +47,7 @@ BOOST_AUTO_TEST_CASE(multisig_verify) { unsigned int flags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC; + ScriptError err; CKey key[4]; for (int i = 0; i < 4; i++) key[i].MakeNewKey(true); @@ -82,19 +84,22 @@ BOOST_AUTO_TEST_CASE(multisig_verify) keys.clear(); keys += key[0],key[1]; // magic operator+= from boost.assign s = sign_multisig(a_and_b, keys, txTo[0], 0); - BOOST_CHECK(VerifyScript(s, a_and_b, flags, SignatureChecker(txTo[0], 0))); + BOOST_CHECK(VerifyScript(s, a_and_b, flags, SignatureChecker(txTo[0], 0), &err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); for (int i = 0; i < 4; i++) { keys.clear(); keys += key[i]; s = sign_multisig(a_and_b, keys, txTo[0], 0); - BOOST_CHECK_MESSAGE(!VerifyScript(s, a_and_b, flags, SignatureChecker(txTo[0], 0)), strprintf("a&b 1: %d", i)); + BOOST_CHECK_MESSAGE(!VerifyScript(s, a_and_b, flags, SignatureChecker(txTo[0], 0), &err), strprintf("a&b 1: %d", i)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_INVALID_STACK_OPERATION, ScriptErrorString(err)); keys.clear(); keys += key[1],key[i]; s = sign_multisig(a_and_b, keys, txTo[0], 0); - BOOST_CHECK_MESSAGE(!VerifyScript(s, a_and_b, flags, SignatureChecker(txTo[0], 0)), strprintf("a&b 2: %d", i)); + BOOST_CHECK_MESSAGE(!VerifyScript(s, a_and_b, flags, SignatureChecker(txTo[0], 0), &err), strprintf("a&b 2: %d", i)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); } // Test a OR b: @@ -104,16 +109,24 @@ BOOST_AUTO_TEST_CASE(multisig_verify) keys += key[i]; s = sign_multisig(a_or_b, keys, txTo[1], 0); if (i == 0 || i == 1) - BOOST_CHECK_MESSAGE(VerifyScript(s, a_or_b, flags, SignatureChecker(txTo[1], 0)), strprintf("a|b: %d", i)); + { + BOOST_CHECK_MESSAGE(VerifyScript(s, a_or_b, flags, SignatureChecker(txTo[1], 0), &err), strprintf("a|b: %d", i)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); + } else - BOOST_CHECK_MESSAGE(!VerifyScript(s, a_or_b, flags, SignatureChecker(txTo[1], 0)), strprintf("a|b: %d", i)); + { + BOOST_CHECK_MESSAGE(!VerifyScript(s, a_or_b, flags, SignatureChecker(txTo[1], 0), &err), strprintf("a|b: %d", i)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); + } } s.clear(); s << OP_0 << OP_0; - BOOST_CHECK(!VerifyScript(s, a_or_b, flags, SignatureChecker(txTo[1], 0))); + BOOST_CHECK(!VerifyScript(s, a_or_b, flags, SignatureChecker(txTo[1], 0), &err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_SIG_DER, ScriptErrorString(err)); s.clear(); s << OP_0 << OP_1; - BOOST_CHECK(!VerifyScript(s, a_or_b, flags, SignatureChecker(txTo[1], 0))); + BOOST_CHECK(!VerifyScript(s, a_or_b, flags, SignatureChecker(txTo[1], 0), &err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_SIG_DER, ScriptErrorString(err)); for (int i = 0; i < 4; i++) @@ -123,9 +136,15 @@ BOOST_AUTO_TEST_CASE(multisig_verify) keys += key[i],key[j]; s = sign_multisig(escrow, keys, txTo[2], 0); if (i < j && i < 3 && j < 3) - BOOST_CHECK_MESSAGE(VerifyScript(s, escrow, flags, SignatureChecker(txTo[2], 0)), strprintf("escrow 1: %d %d", i, j)); + { + BOOST_CHECK_MESSAGE(VerifyScript(s, escrow, flags, SignatureChecker(txTo[2], 0), &err), strprintf("escrow 1: %d %d", i, j)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); + } else - BOOST_CHECK_MESSAGE(!VerifyScript(s, escrow, flags, SignatureChecker(txTo[2], 0)), strprintf("escrow 2: %d %d", i, j)); + { + BOOST_CHECK_MESSAGE(!VerifyScript(s, escrow, flags, SignatureChecker(txTo[2], 0), &err), strprintf("escrow 2: %d %d", i, j)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); + } } } diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index fcab652783..a969eefa05 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -6,6 +6,7 @@ #include "keystore.h" #include "main.h" #include "script/script.h" +#include "script/script_error.h" #include "script/sign.h" #ifdef ENABLE_WALLET @@ -27,7 +28,7 @@ Serialize(const CScript& s) } static bool -Verify(const CScript& scriptSig, const CScript& scriptPubKey, bool fStrict) +Verify(const CScript& scriptSig, const CScript& scriptPubKey, bool fStrict, ScriptError& err) { // Create dummy to/from transactions: CMutableTransaction txFrom; @@ -42,7 +43,7 @@ Verify(const CScript& scriptSig, const CScript& scriptPubKey, bool fStrict) txTo.vin[0].scriptSig = scriptSig; txTo.vout[0].nValue = 1; - return VerifyScript(scriptSig, scriptPubKey, fStrict ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE, SignatureChecker(txTo, 0)); + return VerifyScript(scriptSig, scriptPubKey, fStrict ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE, SignatureChecker(txTo, 0), &err); } @@ -124,6 +125,7 @@ BOOST_AUTO_TEST_CASE(sign) BOOST_AUTO_TEST_CASE(norecurse) { + ScriptError err; // Make sure only the outer pay-to-script-hash does the // extra-validation thing: CScript invalidAsScript; @@ -135,7 +137,8 @@ BOOST_AUTO_TEST_CASE(norecurse) scriptSig << Serialize(invalidAsScript); // Should not verify, because it will try to execute OP_INVALIDOPCODE - BOOST_CHECK(!Verify(scriptSig, p2sh, true)); + BOOST_CHECK(!Verify(scriptSig, p2sh, true, err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_BAD_OPCODE, ScriptErrorString(err)); // Try to recur, and verification should succeed because // the inner HASH160 <> EQUAL should only check the hash: @@ -143,7 +146,8 @@ BOOST_AUTO_TEST_CASE(norecurse) CScript scriptSig2; scriptSig2 << Serialize(invalidAsScript) << Serialize(p2sh); - BOOST_CHECK(Verify(scriptSig2, p2sh2, true)); + BOOST_CHECK(Verify(scriptSig2, p2sh2, true, err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); } BOOST_AUTO_TEST_CASE(set) @@ -238,6 +242,7 @@ BOOST_AUTO_TEST_CASE(switchover) { // Test switch over code CScript notValid; + ScriptError err; notValid << OP_11 << OP_12 << OP_EQUALVERIFY; CScript scriptSig; scriptSig << Serialize(notValid); @@ -246,9 +251,11 @@ BOOST_AUTO_TEST_CASE(switchover) // Validation should succeed under old rules (hash is correct): - BOOST_CHECK(Verify(scriptSig, fund, false)); + BOOST_CHECK(Verify(scriptSig, fund, false, err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); // Fail under new: - BOOST_CHECK(!Verify(scriptSig, fund, true)); + BOOST_CHECK(!Verify(scriptSig, fund, true, err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EQUALVERIFY, ScriptErrorString(err)); } BOOST_AUTO_TEST_CASE(AreInputsStandard) diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index cff1664a1e..ede13b23c2 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -10,6 +10,7 @@ #include "keystore.h" #include "main.h" #include "script/script.h" +#include "script/script_error.h" #include "script/sign.h" #include "util.h" @@ -92,7 +93,9 @@ CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CMu void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, int flags, bool expect, const std::string& message) { - BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, flags, SignatureChecker(BuildSpendingTransaction(scriptSig, BuildCreditingTransaction(scriptPubKey)), 0)) == expect, message); + ScriptError err; + BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, flags, SignatureChecker(BuildSpendingTransaction(scriptSig, BuildCreditingTransaction(scriptPubKey)), 0), &err) == expect, message); + BOOST_CHECK_MESSAGE(expect == (err == SCRIPT_ERR_OK), std::string(ScriptErrorString(err)) + ": " + message); } void static NegateSignatureS(std::vector& vchSig) { @@ -590,20 +593,25 @@ BOOST_AUTO_TEST_CASE(script_PushData) static const unsigned char pushdata2[] = { OP_PUSHDATA2, 1, 0, 0x5a }; static const unsigned char pushdata4[] = { OP_PUSHDATA4, 1, 0, 0, 0, 0x5a }; + ScriptError err; vector > directStack; - BOOST_CHECK(EvalScript(directStack, CScript(&direct[0], &direct[sizeof(direct)]), true, BaseSignatureChecker())); + BOOST_CHECK(EvalScript(directStack, CScript(&direct[0], &direct[sizeof(direct)]), true, BaseSignatureChecker(), &err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); vector > pushdata1Stack; - BOOST_CHECK(EvalScript(pushdata1Stack, CScript(&pushdata1[0], &pushdata1[sizeof(pushdata1)]), true, BaseSignatureChecker())); + BOOST_CHECK(EvalScript(pushdata1Stack, CScript(&pushdata1[0], &pushdata1[sizeof(pushdata1)]), true, BaseSignatureChecker(), &err)); BOOST_CHECK(pushdata1Stack == directStack); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); vector > pushdata2Stack; - BOOST_CHECK(EvalScript(pushdata2Stack, CScript(&pushdata2[0], &pushdata2[sizeof(pushdata2)]), true, BaseSignatureChecker())); + BOOST_CHECK(EvalScript(pushdata2Stack, CScript(&pushdata2[0], &pushdata2[sizeof(pushdata2)]), true, BaseSignatureChecker(), &err)); BOOST_CHECK(pushdata2Stack == directStack); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); vector > pushdata4Stack; - BOOST_CHECK(EvalScript(pushdata4Stack, CScript(&pushdata4[0], &pushdata4[sizeof(pushdata4)]), true, BaseSignatureChecker())); + BOOST_CHECK(EvalScript(pushdata4Stack, CScript(&pushdata4[0], &pushdata4[sizeof(pushdata4)]), true, BaseSignatureChecker(), &err)); BOOST_CHECK(pushdata4Stack == directStack); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); } CScript @@ -640,6 +648,7 @@ sign_multisig(CScript scriptPubKey, const CKey &key, CTransaction transaction) BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG12) { + ScriptError err; CKey key1, key2, key3; key1.MakeNewKey(true); key2.MakeNewKey(false); @@ -652,19 +661,24 @@ BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG12) CMutableTransaction txTo12 = BuildSpendingTransaction(CScript(), txFrom12); CScript goodsig1 = sign_multisig(scriptPubKey12, key1, txTo12); - BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey12, flags, SignatureChecker(txTo12, 0))); + BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey12, flags, SignatureChecker(txTo12, 0), &err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); txTo12.vout[0].nValue = 2; - BOOST_CHECK(!VerifyScript(goodsig1, scriptPubKey12, flags, SignatureChecker(txTo12, 0))); + BOOST_CHECK(!VerifyScript(goodsig1, scriptPubKey12, flags, SignatureChecker(txTo12, 0), &err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); CScript goodsig2 = sign_multisig(scriptPubKey12, key2, txTo12); - BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey12, flags, SignatureChecker(txTo12, 0))); + BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey12, flags, SignatureChecker(txTo12, 0), &err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); CScript badsig1 = sign_multisig(scriptPubKey12, key3, txTo12); - BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey12, flags, SignatureChecker(txTo12, 0))); + BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey12, flags, SignatureChecker(txTo12, 0), &err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); } BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG23) { + ScriptError err; CKey key1, key2, key3, key4; key1.MakeNewKey(true); key2.MakeNewKey(false); @@ -680,46 +694,55 @@ BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG23) std::vector keys; keys.push_back(key1); keys.push_back(key2); CScript goodsig1 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey23, flags, SignatureChecker(txTo23, 0))); + BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey23, flags, SignatureChecker(txTo23, 0), &err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); keys.clear(); keys.push_back(key1); keys.push_back(key3); CScript goodsig2 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey23, flags, SignatureChecker(txTo23, 0))); + BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey23, flags, SignatureChecker(txTo23, 0), &err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); keys.clear(); keys.push_back(key2); keys.push_back(key3); CScript goodsig3 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(VerifyScript(goodsig3, scriptPubKey23, flags, SignatureChecker(txTo23, 0))); + BOOST_CHECK(VerifyScript(goodsig3, scriptPubKey23, flags, SignatureChecker(txTo23, 0), &err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); keys.clear(); keys.push_back(key2); keys.push_back(key2); // Can't re-use sig CScript badsig1 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey23, flags, SignatureChecker(txTo23, 0))); + BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey23, flags, SignatureChecker(txTo23, 0), &err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); keys.clear(); keys.push_back(key2); keys.push_back(key1); // sigs must be in correct order CScript badsig2 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig2, scriptPubKey23, flags, SignatureChecker(txTo23, 0))); + BOOST_CHECK(!VerifyScript(badsig2, scriptPubKey23, flags, SignatureChecker(txTo23, 0), &err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); keys.clear(); keys.push_back(key3); keys.push_back(key2); // sigs must be in correct order CScript badsig3 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig3, scriptPubKey23, flags, SignatureChecker(txTo23, 0))); + BOOST_CHECK(!VerifyScript(badsig3, scriptPubKey23, flags, SignatureChecker(txTo23, 0), &err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); keys.clear(); keys.push_back(key4); keys.push_back(key2); // sigs must match pubkeys CScript badsig4 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig4, scriptPubKey23, flags, SignatureChecker(txTo23, 0))); + BOOST_CHECK(!VerifyScript(badsig4, scriptPubKey23, flags, SignatureChecker(txTo23, 0), &err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); keys.clear(); keys.push_back(key1); keys.push_back(key4); // sigs must match pubkeys CScript badsig5 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig5, scriptPubKey23, flags, SignatureChecker(txTo23, 0))); + BOOST_CHECK(!VerifyScript(badsig5, scriptPubKey23, flags, SignatureChecker(txTo23, 0), &err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); keys.clear(); // Must have signatures CScript badsig6 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig6, scriptPubKey23, flags, SignatureChecker(txTo23, 0))); + BOOST_CHECK(!VerifyScript(badsig6, scriptPubKey23, flags, SignatureChecker(txTo23, 0), &err)); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_INVALID_STACK_OPERATION, ScriptErrorString(err)); } BOOST_AUTO_TEST_CASE(script_combineSigs) @@ -833,11 +856,13 @@ BOOST_AUTO_TEST_CASE(script_combineSigs) BOOST_AUTO_TEST_CASE(script_standard_push) { + ScriptError err; for (int i=0; i<67000; i++) { CScript script; script << i; BOOST_CHECK_MESSAGE(script.IsPushOnly(), "Number " << i << " is not pure push."); - BOOST_CHECK_MESSAGE(VerifyScript(script, CScript() << OP_1, SCRIPT_VERIFY_MINIMALDATA, BaseSignatureChecker()), "Number " << i << " push is not minimal data."); + BOOST_CHECK_MESSAGE(VerifyScript(script, CScript() << OP_1, SCRIPT_VERIFY_MINIMALDATA, BaseSignatureChecker(), &err), "Number " << i << " push is not minimal data."); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); } for (unsigned int i=0; i<=MAX_SCRIPT_ELEMENT_SIZE; i++) { @@ -845,7 +870,8 @@ BOOST_AUTO_TEST_CASE(script_standard_push) CScript script; script << data; BOOST_CHECK_MESSAGE(script.IsPushOnly(), "Length " << i << " is not pure push."); - BOOST_CHECK_MESSAGE(VerifyScript(script, CScript() << OP_1, SCRIPT_VERIFY_MINIMALDATA, BaseSignatureChecker()), "Length " << i << " push is not minimal data."); + BOOST_CHECK_MESSAGE(VerifyScript(script, CScript() << OP_1, SCRIPT_VERIFY_MINIMALDATA, BaseSignatureChecker(), &err), "Length " << i << " push is not minimal data."); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); } } diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index d4c9b1a0ea..bf3a60c04f 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -10,6 +10,7 @@ #include "keystore.h" #include "main.h" #include "script/script.h" +#include "script/script_error.h" #include "core_io.h" #include @@ -86,6 +87,7 @@ BOOST_AUTO_TEST_CASE(tx_valid) // verifyFlags is a comma separated list of script verification flags to apply, or "NONE" Array tests = read_json(std::string(json_tests::tx_valid, json_tests::tx_valid + sizeof(json_tests::tx_valid))); + ScriptError err; BOOST_FOREACH(Value& tv, tests) { Array test = tv.get_array(); @@ -142,8 +144,9 @@ BOOST_AUTO_TEST_CASE(tx_valid) unsigned int verify_flags = ParseScriptFlags(test[2].get_str()); BOOST_CHECK_MESSAGE(VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout], - verify_flags, SignatureChecker(tx, i)), + verify_flags, SignatureChecker(tx, i), &err), strTest); + BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); } } } @@ -160,6 +163,7 @@ BOOST_AUTO_TEST_CASE(tx_invalid) // verifyFlags is a comma separated list of script verification flags to apply, or "NONE" Array tests = read_json(std::string(json_tests::tx_invalid, json_tests::tx_invalid + sizeof(json_tests::tx_invalid))); + ScriptError err; BOOST_FOREACH(Value& tv, tests) { Array test = tv.get_array(); @@ -215,10 +219,10 @@ BOOST_AUTO_TEST_CASE(tx_invalid) unsigned int verify_flags = ParseScriptFlags(test[2].get_str()); fValid = VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout], - verify_flags, SignatureChecker(tx, i)); + verify_flags, SignatureChecker(tx, i), &err); } - BOOST_CHECK_MESSAGE(!fValid, strTest); + BOOST_CHECK_MESSAGE(err != SCRIPT_ERR_OK, ScriptErrorString(err)); } } } From 7335ca1a057c49c1c921af0c93b4ea7eeecb9e3f Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 16 Nov 2014 01:07:09 +0100 Subject: [PATCH 1013/1288] [Qt] Fix height of BitcoinAmountField --- src/qt/bitcoinamountfield.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp index 6e35bf17b3..2c100337d2 100644 --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -130,6 +130,7 @@ public: extra += hint - style()->subControlRect(QStyle::CC_SpinBox, &opt, QStyle::SC_SpinBoxEditField, this).size(); hint += extra; + hint.setHeight(h); opt.rect = rect(); From 6c8c704bb43e6bb78a1162468a9075da366e0007 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Fri, 14 Nov 2014 15:04:46 +0100 Subject: [PATCH 1014/1288] [docs] Add mini-"howto" using Qt Creator (osx) --- doc/build-osx.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/build-osx.md b/doc/build-osx.md index dc55f8259e..f07c58fd17 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -85,6 +85,22 @@ After exiting, you'll get a warning that the install is keg-only, which means it make install +Use Qt Creator as IDE +------------------------ +You can use Qt Creator as IDE, for debugging and for manipulating forms, etc. +Download Qt Creator from http://www.qt.io/download/. Download the "community edition" and only install Qt Creator (uncheck the rest during the installation process). + +1. Make sure you installed everything through homebrew mentioned above +2. Do a proper ./configure --with-gui=qt5 --enable-debug +3. In Qt Creator do "New Project" -> Import Project -> Import Existing Project +4. Enter "bitcoin-qt" as project name, enter src/qt as location +5. Leave the file selection as it is +6. Confirm the "summary page" +7. In the "Projects" tab select "Manage Kits..." +8. Select the default "Desktop" kit and select "Clang (x86 64bit in /usr/bin)" as compiler +9. Select LLDB as debugger (you might need to set the path to your installtion) +10. Start debugging with Qt Creator + Creating a release build ------------------------ You can ignore this section if you are building `bitcoind` for your own use. From 5617267cd5dde76848e902bd436a9d21330c6cce Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Sun, 16 Nov 2014 22:02:21 +0800 Subject: [PATCH 1015/1288] Fix typo in listreceivedbyaddress and listaccounts help text --- src/rpcwallet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index f2b5e2061e..4d9e5ea137 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1067,7 +1067,7 @@ Value listreceivedbyaddress(const Array& params, bool fHelp) "\nList balances by receiving address.\n" "\nArguments:\n" "1. minconf (numeric, optional, default=1) The minimum number of confirmations before payments are included.\n" - "2. includeempty (numeric, optional, dafault=false) Whether to include addresses that haven't received any payments.\n" + "2. includeempty (numeric, optional, default=false) Whether to include addresses that haven't received any payments.\n" "3. includeWatchonly (bool, optional, default=false) Whether to include watchonly addresses (see 'importaddress').\n" "\nResult:\n" @@ -1335,7 +1335,7 @@ Value listaccounts(const Array& params, bool fHelp) "listaccounts ( minconf includeWatchonly)\n" "\nReturns Object that has account names as keys, account balances as values.\n" "\nArguments:\n" - "1. minconf (numeric, optional, default=1) Only onclude transactions with at least this many confirmations\n" + "1. minconf (numeric, optional, default=1) Only include transactions with at least this many confirmations\n" "2. includeWatchonly (bool, optional, default=false) Include balances in watchonly addresses (see 'importaddress')\n" "\nResult:\n" "{ (json object where keys are account names, and values are numeric balances\n" From 4ff81d60929df67817a2f3d5d25af3c847e7f24c Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sun, 16 Nov 2014 17:16:14 +0000 Subject: [PATCH 1016/1288] Bugfix: Clarify coin control dialog labels --- src/qt/forms/coincontroldialog.ui | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qt/forms/coincontroldialog.ui b/src/qt/forms/coincontroldialog.ui index cbe58fec65..bc50d73837 100644 --- a/src/qt/forms/coincontroldialog.ui +++ b/src/qt/forms/coincontroldialog.ui @@ -11,7 +11,7 @@ - Coin Control Address Selection + Coin Selection @@ -451,12 +451,12 @@ - Label + Received with label - Address + Received with address From 5d60b694e95fe20b1f3f56ec8bfa55ab8c11bcb6 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sun, 16 Nov 2014 17:27:19 +0000 Subject: [PATCH 1017/1288] Coin Control: Make list mode default --- src/qt/forms/coincontroldialog.ui | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qt/forms/coincontroldialog.ui b/src/qt/forms/coincontroldialog.ui index bc50d73837..c1fef6b9b1 100644 --- a/src/qt/forms/coincontroldialog.ui +++ b/src/qt/forms/coincontroldialog.ui @@ -379,9 +379,6 @@ Tree mode - - true -
@@ -395,6 +392,9 @@ List mode + + true + From 7ab43583b04a21655e000c35316f7be6622bae88 Mon Sep 17 00:00:00 2001 From: Christian von Roques Date: Sun, 16 Nov 2014 13:02:52 -0400 Subject: [PATCH 1018/1288] Update bash-completion for v0.10 * Support new rpc commands. * Several commands now take an optional boolean includeWatchonly argument. * "help" now has section headers, ignore them when compiling list of commands. --- contrib/bitcoind.bash-completion | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/contrib/bitcoind.bash-completion b/contrib/bitcoind.bash-completion index 03ef173c09..37ece25899 100644 --- a/contrib/bitcoind.bash-completion +++ b/contrib/bitcoind.bash-completion @@ -39,6 +39,10 @@ _bitcoind() { if ((cword > 4)); then case ${words[cword-4]} in + listtransactions) + COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) + return 0 + ;; signrawtransaction) COMPREPLY=( $( compgen -W "ALL NONE SINGLE ALL|ANYONECANPAY NONE|ANYONECANPAY SINGLE|ANYONECANPAY" -- "$cur" ) ) return 0 @@ -52,7 +56,7 @@ _bitcoind() { _bitcoin_accounts return 0 ;; - gettxout|importprivkey) + getbalance|gettxout|importaddress|importprivkey|listreceivedbyaccount|listreceivedbyaddress|listsinceblock) COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) return 0 ;; @@ -65,7 +69,7 @@ _bitcoind() { COMPREPLY=( $( compgen -W "add remove onetry" -- "$cur" ) ) return 0 ;; - getblock|getrawtransaction|listreceivedbyaccount|listreceivedbyaddress|sendrawtransaction) + getblock|getrawtransaction|gettransaction|listaccounts|listreceivedbyaccount|listreceivedbyaddress|sendrawtransaction) COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) return 0 ;; @@ -115,7 +119,7 @@ _bitcoind() { # only parse help if senseful if [[ -z "$cur" || "$cur" =~ ^[a-z] ]]; then - commands=$(_bitcoin_rpc help 2>/dev/null | awk '{ print $1; }') + commands=$(_bitcoin_rpc help 2>/dev/null | awk '$1 ~ /^[a-z]/ { print $1; }') fi COMPREPLY=( $( compgen -W "$helpopts $commands" -- "$cur" ) ) From 7329fdd1bae6793fb505994ccd241eca2afc3841 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Mon, 17 Nov 2014 10:29:09 +0800 Subject: [PATCH 1019/1288] Update comments in txmempool to be doxygen compatible Fix typo in Read() error message --- src/txmempool.cpp | 38 ++++++++++++++++++++++++-------------- src/txmempool.h | 44 +++++++++++++++++++++++--------------------- 2 files changed, 47 insertions(+), 35 deletions(-) diff --git a/src/txmempool.cpp b/src/txmempool.cpp index b5070d5104..e13f1cc350 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "txmempool.h" @@ -45,9 +45,9 @@ CTxMemPoolEntry::GetPriority(unsigned int currentHeight) const return dResult; } -// -// Keep track of fee/priority for transactions confirmed within N blocks -// +/** + * Keep track of fee/priority for transactions confirmed within N blocks + */ class CBlockAverage { private: @@ -86,8 +86,10 @@ public: return prioritySamples.size(); } - // Used as belt-and-suspenders check when reading to detect - // file corruption + /** + * Used as belt-and-suspenders check when reading to detect + * file corruption + */ bool AreSane(const std::vector& vecFee, const CFeeRate& minRelayFee) { BOOST_FOREACH(CFeeRate fee, vecFee) @@ -139,16 +141,20 @@ public: class CMinerPolicyEstimator { private: - // Records observed averages transactions that confirmed within one block, two blocks, - // three blocks etc. + /** + * Records observed averages transactions that confirmed within one block, two blocks, + * three blocks etc. + */ std::vector history; std::vector sortedFeeSamples; std::vector sortedPrioritySamples; int nBestSeenHeight; - // nBlocksAgo is 0 based, i.e. transactions that confirmed in the highest seen block are - // nBlocksAgo == 0, transactions in the block before that are nBlocksAgo == 1 etc. + /** + * nBlocksAgo is 0 based, i.e. transactions that confirmed in the highest seen block are + * nBlocksAgo == 0, transactions in the block before that are nBlocksAgo == 1 etc. + */ void seenTxConfirm(const CFeeRate& feeRate, const CFeeRate& minRelayFee, double dPriority, int nBlocksAgo) { // Last entry records "everything else". @@ -248,7 +254,9 @@ public: } } - // Can return CFeeRate(0) if we don't have any data for that many blocks back. nBlocksToConfirm is 1 based. + /** + * Can return CFeeRate(0) if we don't have any data for that many blocks back. nBlocksToConfirm is 1 based. + */ CFeeRate estimateFee(int nBlocksToConfirm) { nBlocksToConfirm--; @@ -332,7 +340,7 @@ public: size_t numEntries; filein >> numEntries; if (numEntries <= 0 || numEntries > 10000) - throw runtime_error("Corrupt estimates file. Must have between 1 and 10k entires."); + throw runtime_error("Corrupt estimates file. Must have between 1 and 10k entries."); std::vector fileHistory; @@ -462,7 +470,9 @@ void CTxMemPool::removeConflicts(const CTransaction &tx, std::list } } -// Called when a block is connected. Removes from mempool and updates the miner fee estimator. +/** + * Called when a block is connected. Removes from mempool and updates the miner fee estimator. + */ void CTxMemPool::removeForBlock(const std::vector& vtx, unsigned int nBlockHeight, std::list& conflicts) { diff --git a/src/txmempool.h b/src/txmempool.h index 2ec80cb860..0d3c8bba6a 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_TXMEMPOOL_H @@ -25,19 +25,19 @@ inline bool AllowFree(double dPriority) /** Fake height value used in CCoins to signify they are only in the memory pool (since 0.8) */ static const unsigned int MEMPOOL_HEIGHT = 0x7FFFFFFF; -/* +/** * CTxMemPool stores these: */ class CTxMemPoolEntry { private: CTransaction tx; - CAmount nFee; // Cached to avoid expensive parent-transaction lookups - size_t nTxSize; // ... and avoid recomputing tx size - size_t nModSize; // ... and modified size for priority - int64_t nTime; // Local time when entering the mempool - double dPriority; // Priority when entering the mempool - unsigned int nHeight; // Chain height when entering the mempool + CAmount nFee; //! Cached to avoid expensive parent-transaction lookups + size_t nTxSize; //! ... and avoid recomputing tx size + size_t nModSize; //! ... and modified size for priority + int64_t nTime; //! Local time when entering the mempool + double dPriority; //! Priority when entering the mempool + unsigned int nHeight; //! Chain height when entering the mempool public: CTxMemPoolEntry(const CTransaction& _tx, const CAmount& _nFee, @@ -68,7 +68,7 @@ public: bool IsNull() const { return (ptx == NULL && n == (uint32_t) -1); } }; -/* +/** * CTxMemPool stores valid-according-to-the-current-best-chain * transactions that may be included in the next block. * @@ -81,12 +81,12 @@ public: class CTxMemPool { private: - bool fSanityCheck; // Normally false, true if -checkmempool or -regtest + bool fSanityCheck; //! Normally false, true if -checkmempool or -regtest unsigned int nTransactionsUpdated; CMinerPolicyEstimator* minerPolicyEstimator; - CFeeRate minRelayFee; // Passed to constructor to avoid dependency on main - uint64_t totalTxSize; // sum of all mempool tx' byte sizes + CFeeRate minRelayFee; //! Passed to constructor to avoid dependency on main + uint64_t totalTxSize; //! sum of all mempool tx' byte sizes public: mutable CCriticalSection cs; @@ -97,7 +97,7 @@ public: CTxMemPool(const CFeeRate& _minRelayFee); ~CTxMemPool(); - /* + /** * If sanity-checking is turned on, check makes sure the pool is * consistent (does not contain two transactions that spend the same inputs, * all inputs are in the mapNextTx array). If sanity-checking is turned off, @@ -141,19 +141,21 @@ public: bool lookup(uint256 hash, CTransaction& result) const; - // Estimate fee rate needed to get into the next - // nBlocks + /** Estimate fee rate needed to get into the next nBlocks */ CFeeRate estimateFee(int nBlocks) const; - // Estimate priority needed to get into the next - // nBlocks + + /** Estimate priority needed to get into the next nBlocks */ double estimatePriority(int nBlocks) const; - // Write/Read estimates to disk + + /** Write/Read estimates to disk */ bool WriteFeeEstimates(CAutoFile& fileout) const; bool ReadFeeEstimates(CAutoFile& filein); }; -/** CCoinsView that brings transactions from a memorypool into view. - It does not check for spendings by memory pool transactions. */ +/** + * CCoinsView that brings transactions from a memorypool into view. + * It does not check for spendings by memory pool transactions. + */ class CCoinsViewMemPool : public CCoinsViewBacked { protected: From c63a73d18aa60207790f24b9a910fd45eb3afaa3 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Mon, 17 Nov 2014 11:04:01 +0800 Subject: [PATCH 1020/1288] Update comments in util to be doxygen compatible --- src/util.cpp | 48 ++++++++++++++++++++++++---------------- src/util.h | 37 ++++++++++++++++++------------- src/utilmoneystr.cpp | 2 +- src/utilmoneystr.h | 2 +- src/utilstrencodings.cpp | 8 ++++--- src/utilstrencodings.h | 9 ++++---- src/utiltime.cpp | 13 ++++++----- src/utiltime.h | 2 +- 8 files changed, 72 insertions(+), 49 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 0f5c036352..0cdf4e614d 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) @@ -105,7 +105,7 @@ bool fLogTimestamps = false; bool fLogIPs = false; volatile bool fReopenDebugLog = false; -// Init OpenSSL library multithreading support +/** Init OpenSSL library multithreading support */ static CCriticalSection** ppmutexOpenSSL; void locking_callback(int mode, int i, const char* file, int line) { @@ -149,18 +149,22 @@ public: } instance_of_cinit; -// LogPrintf() has been broken a couple of times now -// by well-meaning people adding mutexes in the most straightforward way. -// It breaks because it may be called by global destructors during shutdown. -// Since the order of destruction of static/global objects is undefined, -// defining a mutex as a global object doesn't work (the mutex gets -// destroyed, and then some later destructor calls OutputDebugStringF, -// maybe indirectly, and you get a core dump at shutdown trying to lock -// the mutex). +/** + * LogPrintf() has been broken a couple of times now + * by well-meaning people adding mutexes in the most straightforward way. + * It breaks because it may be called by global destructors during shutdown. + * Since the order of destruction of static/global objects is undefined, + * defining a mutex as a global object doesn't work (the mutex gets + * destroyed, and then some later destructor calls OutputDebugStringF, + * maybe indirectly, and you get a core dump at shutdown trying to lock + * the mutex). + */ static boost::once_flag debugPrintInitFlag = BOOST_ONCE_INIT; -// We use boost::call_once() to make sure these are initialized -// in a thread-safe manner the first time called: +/** + * We use boost::call_once() to make sure these are initialized + * in a thread-safe manner the first time called: + */ static FILE* fileout = NULL; static boost::mutex* mutexDebugLog = NULL; @@ -500,9 +504,11 @@ bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest) #endif /* WIN32 */ } -// Ignores exceptions thrown by Boost's create_directory if the requested directory exists. -// Specifically handles case where path p exists, but it wasn't possible for the user to -// write to the parent directory. +/** + * Ignores exceptions thrown by Boost's create_directory if the requested directory exists. + * Specifically handles case where path p exists, but it wasn't possible for the user to + * write to the parent directory. + */ bool TryCreateDirectory(const boost::filesystem::path& p) { try @@ -542,8 +548,10 @@ bool TruncateFile(FILE *file, unsigned int length) { #endif } -// this function tries to raise the file descriptor limit to the requested number. -// It returns the actual file descriptor limit (which may be more or less than nMinFD) +/** + * this function tries to raise the file descriptor limit to the requested number. + * It returns the actual file descriptor limit (which may be more or less than nMinFD) + */ int RaiseFileDescriptorLimit(int nMinFD) { #if defined(WIN32) return 2048; @@ -563,8 +571,10 @@ int RaiseFileDescriptorLimit(int nMinFD) { #endif } -// this function tries to make a particular range of a file allocated (corresponding to disk space) -// it is advisory, and the range specified in the arguments will never contain live data +/** + * this function tries to make a particular range of a file allocated (corresponding to disk space) + * it is advisory, and the range specified in the arguments will never contain live data + */ void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length) { #if defined(WIN32) // Windows-specific version diff --git a/src/util.h b/src/util.h index 4b2415278b..a4aaf29f91 100644 --- a/src/util.h +++ b/src/util.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. /** @@ -40,25 +40,26 @@ extern volatile bool fReopenDebugLog; void SetupEnvironment(); -/* Return true if log accepts specified category */ +/** Return true if log accepts specified category */ bool LogAcceptCategory(const char* category); -/* Send a string to the log output */ +/** Send a string to the log output */ int LogPrintStr(const std::string &str); #define LogPrintf(...) LogPrint(NULL, __VA_ARGS__) -/* When we switch to C++11, this can be switched to variadic templates instead +/** + * When we switch to C++11, this can be switched to variadic templates instead * of this macro-based construction (see tinyformat.h). */ #define MAKE_ERROR_AND_LOG_FUNC(n) \ - /* Print to debug.log if -debug=category switch is given OR category is NULL. */ \ + /** Print to debug.log if -debug=category switch is given OR category is NULL. */ \ template \ static inline int LogPrint(const char* category, const char* format, TINYFORMAT_VARARGS(n)) \ { \ if(!LogAcceptCategory(category)) return 0; \ return LogPrintStr(tfm::format(format, TINYFORMAT_PASSARGS(n))); \ } \ - /* Log error and return false */ \ + /** Log error and return false */ \ template \ static inline bool error(const char* format, TINYFORMAT_VARARGS(n)) \ { \ @@ -68,7 +69,8 @@ int LogPrintStr(const std::string &str); TINYFORMAT_FOREACH_ARGNUM(MAKE_ERROR_AND_LOG_FUNC) -/* Zero-arg versions of logging and error, these are not covered by +/** + * Zero-arg versions of logging and error, these are not covered by * TINYFORMAT_FOREACH_ARGNUM */ static inline int LogPrint(const char* category, const char* format) @@ -162,13 +164,15 @@ bool SoftSetBoolArg(const std::string& strArg, bool fValue); void SetThreadPriority(int nPriority); void RenameThread(const char* name); -// Standard wrapper for do-something-forever thread functions. -// "Forever" really means until the thread is interrupted. -// Use it like: -// new boost::thread(boost::bind(&LoopForever, "dumpaddr", &DumpAddresses, 900000)); -// or maybe: -// boost::function f = boost::bind(&FunctionWithArg, argument); -// threadGroup.create_thread(boost::bind(&LoopForever >, "nothing", f, milliseconds)); +/** + * Standard wrapper for do-something-forever thread functions. + * "Forever" really means until the thread is interrupted. + * Use it like: + * new boost::thread(boost::bind(&LoopForever, "dumpaddr", &DumpAddresses, 900000)); + * or maybe: + * boost::function f = boost::bind(&FunctionWithArg, argument); + * threadGroup.create_thread(boost::bind(&LoopForever >, "nothing", f, milliseconds)); + */ template void LoopForever(const char* name, Callable func, int64_t msecs) { std::string s = strprintf("bitcoin-%s", name); @@ -196,7 +200,10 @@ template void LoopForever(const char* name, Callable func, throw; } } -// .. and a wrapper that just calls func once + +/** + * .. and a wrapper that just calls func once + */ template void TraceThread(const char* name, Callable func) { std::string s = strprintf("bitcoin-%s", name); diff --git a/src/utilmoneystr.cpp b/src/utilmoneystr.cpp index 267a5b845c..085adae85e 100644 --- a/src/utilmoneystr.cpp +++ b/src/utilmoneystr.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "utilmoneystr.h" diff --git a/src/utilmoneystr.h b/src/utilmoneystr.h index 65415afd3f..6a153db5fa 100644 --- a/src/utilmoneystr.h +++ b/src/utilmoneystr.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. /** diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index 15094e5999..a961b3c5cd 100644 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "utilstrencodings.h" @@ -14,8 +14,10 @@ using namespace std; -// safeChars chosen to allow simple messages/URLs/email addresses, but avoid anything -// even possibly remotely dangerous like & or > +/** + * safeChars chosen to allow simple messages/URLs/email addresses, but avoid anything + * even possibly remotely dangerous like & or > + */ static string safeChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 .,;_/:?@()"); string SanitizeString(const string& str) { diff --git a/src/utilstrencodings.h b/src/utilstrencodings.h index 0b8c1a1781..0c0171b894 100644 --- a/src/utilstrencodings.h +++ b/src/utilstrencodings.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. /** @@ -19,7 +19,7 @@ #define UEND(a) ((unsigned char*)&((&(a))[1])) #define ARRAYLEN(array) (sizeof(array)/sizeof((array)[0])) -// This is needed because the foreach macro can't get over the comma in pair +/** This is needed because the foreach macro can't get over the comma in pair */ #define PAIRTYPE(t1, t2) std::pair std::string SanitizeString(const std::string& str); @@ -45,7 +45,7 @@ int atoi(const std::string& str); /** * Convert string to signed 32-bit integer with strict parse error feedback. * @returns true if the entire string could be parsed as valid integer, - * false if not the entire string could be parsed or when overflow or underflow occured. + * false if not the entire string could be parsed or when overflow or underflow occurred. */ bool ParseInt32(const std::string& str, int32_t *out); @@ -74,7 +74,8 @@ inline std::string HexStr(const T& vch, bool fSpaces=false) return HexStr(vch.begin(), vch.end(), fSpaces); } -/** Format a paragraph of text to a fixed width, adding spaces for +/** + * Format a paragraph of text to a fixed width, adding spaces for * indentation to any added line. */ std::string FormatParagraph(const std::string in, size_t width=79, size_t indent=0); diff --git a/src/utiltime.cpp b/src/utiltime.cpp index 78f0342cba..9c137e8aa0 100644 --- a/src/utiltime.cpp +++ b/src/utiltime.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) @@ -14,7 +14,7 @@ using namespace std; -static int64_t nMockTime = 0; // For unit testing +static int64_t nMockTime = 0; //! For unit testing int64_t GetTime() { @@ -42,9 +42,12 @@ int64_t GetTimeMicros() void MilliSleep(int64_t n) { -// Boost's sleep_for was uninterruptable when backed by nanosleep from 1.50 -// until fixed in 1.52. Use the deprecated sleep method for the broken case. -// See: https://svn.boost.org/trac/boost/ticket/7238 + +/** + * Boost's sleep_for was uninterruptable when backed by nanosleep from 1.50 + * until fixed in 1.52. Use the deprecated sleep method for the broken case. + * See: https://svn.boost.org/trac/boost/ticket/7238 + */ #if defined(HAVE_WORKING_BOOST_SLEEP_FOR) boost::this_thread::sleep_for(boost::chrono::milliseconds(n)); #elif defined(HAVE_WORKING_BOOST_SLEEP) diff --git a/src/utiltime.h b/src/utiltime.h index 6f82e5a836..9d7d42fe47 100644 --- a/src/utiltime.h +++ b/src/utiltime.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_UTILTIME_H From 409e9ef04cae479cda547500dfb1937633275b49 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Mon, 10 Nov 2014 13:25:51 +0100 Subject: [PATCH 1021/1288] [OSX, docs] update some release build informations - switching release builds to 10.7 - release binary looks like 64bit only - tested up to 10.10 - gitian builder builds against 10.7. The docs should be consistant. - remove 32bit text because nowadays it's obvious to support 64bit only on OSX. --- doc/README_osx.txt | 8 -------- doc/build-osx.md | 7 +++---- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/doc/README_osx.txt b/doc/README_osx.txt index 2be56c1592..8831649bd8 100644 --- a/doc/README_osx.txt +++ b/doc/README_osx.txt @@ -20,14 +20,6 @@ https://github.com/mingwandroid/toolchain4 In order to build a working toolchain, the following source packages are needed from Apple: cctools, dyld, and ld64. -Beware. This part is ugly. Very very very ugly. In the future, this should be -broken out into a new repository and cleaned up. Additionally, the binaries -only work when built as x86 and not x86_64. This is an especially nasty -limitation because it must be linked with the toolchain's libLTO.so, meaning -that the entire toolchain must be x86. Gitian x86_64 should not be used until -this has been fixed, because it would mean that several native dependencies -(openssl, libuuid, etc) would need to be built as x86 first. - These tools inject timestamps by default, which produce non-deterministic binaries. The ZERO_AR_DATE environment variable is used to disable that. diff --git a/doc/build-osx.md b/doc/build-osx.md index dc55f8259e..c79c1317b0 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -5,8 +5,7 @@ This guide will show you how to build bitcoind(headless client) for OSX. Notes ----- -* Tested on OS X 10.6 through 10.9 on 64-bit Intel processors only. -Older OSX releases or 32-bit processors are no longer supported. +* Tested on OS X 10.7 through 10.10 on 64-bit Intel processors only. * All of the commands should be executed in a Terminal application. The built-in one is located in `/Applications/Utilities`. @@ -96,9 +95,9 @@ as follows for maximum compatibility: All dependencies should be compiled with these flags: - -mmacosx-version-min=10.6 + -mmacosx-version-min=10.7 -arch x86_64 - -isysroot $(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk + -isysroot $(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk Once dependencies are compiled, see release-process.md for how the Bitcoin-Qt.app bundle is packaged and signed to create the .dmg disk image that is distributed. From 6093aa1bb03b03331cc2f48d8f6b749f8817c016 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Mon, 17 Nov 2014 15:51:33 +0100 Subject: [PATCH 1022/1288] [Qt, OSX] QProgressBar CPU-Issue workaround fixes #5295 --- src/qt/bitcoingui.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 450b83a8c6..06e53ea1e6 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -58,6 +58,20 @@ #include #endif +#ifdef Q_OS_MAC +#include + +// workaround for Qt OSX Bug: +// https://bugreports.qt-project.org/browse/QTBUG-15631 +// QProgressBar uses around 10% CPU even when app is in background +class QProgressBarMac : public QProgressBar +{ + bool event(QEvent *e) { + return (e->type() != QEvent::StyleAnimationUpdate) ? QProgressBar::event(e) : false; + } +}; +#endif + const QString BitcoinGUI::DEFAULT_WALLET = "~Default"; BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) : @@ -190,7 +204,11 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) : // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); +#ifdef Q_OS_MAC + progressBar = new QProgressBarMac(); +#else progressBar = new QProgressBar(); +#endif progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); From a8b2ce557dbcee5e75001be0ec3aecf06165775f Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Wed, 12 Nov 2014 18:59:41 -0500 Subject: [PATCH 1023/1288] regression test only setmocktime RPC call --- src/rpcclient.cpp | 1 + src/rpcmisc.cpp | 20 ++++++++++++++++++++ src/rpcserver.cpp | 1 + src/rpcserver.h | 1 + 4 files changed, 23 insertions(+) diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index a9c491cede..7a1f1918f6 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -25,6 +25,7 @@ public: static const CRPCConvertParam vRPCConvertParams[] = { { "stop", 0 }, + { "setmocktime", 0 }, { "getaddednodeinfo", 0 }, { "setgenerate", 0 }, { "setgenerate", 1 }, diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 08e956c961..31eaae6162 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -354,3 +354,23 @@ Value verifymessage(const Array& params, bool fHelp) return (pubkey.GetID() == keyID); } + +Value setmocktime(const Array& params, bool fHelp) +{ + if (fHelp || params.size() != 1) + throw runtime_error( + "setmocktime timestamp\n" + "\nSet the local time to given timestamp (-regtest only)\n" + "\nArguments:\n" + "1. timestamp (integer, required) Unix seconds-since-epoch timestamp\n" + " Pass 0 to go back to using the system time." + ); + + if (!Params().MineBlocksOnDemand()) + throw runtime_error("setmocktime for regression testing (-regtest mode) only"); + + RPCTypeCheck(params, boost::assign::list_of(int_type)); + SetMockTime(params[0].get_int64()); + + return Value::null; +} diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index cc80887ba4..709e9e9402 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -246,6 +246,7 @@ static const CRPCCommand vRPCCommands[] = { "control", "getinfo", &getinfo, true, false, false }, /* uses wallet if enabled */ { "control", "help", &help, true, true, false }, { "control", "stop", &stop, true, true, false }, + { "control", "setmocktime", &setmocktime, true, false, false }, /* P2P networking */ { "network", "getnetworkinfo", &getnetworkinfo, true, false, false }, diff --git a/src/rpcserver.h b/src/rpcserver.h index 2a258dd89a..9a0681bfa3 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -194,6 +194,7 @@ extern json_spirit::Value getinfo(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getwalletinfo(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getblockchaininfo(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getnetworkinfo(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value setmocktime(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getrawtransaction(const json_spirit::Array& params, bool fHelp); // in rcprawtransaction.cpp extern json_spirit::Value listunspent(const json_spirit::Array& params, bool fHelp); From daf03e7c92c155e3c9c010969192c60872af7bdb Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Thu, 13 Nov 2014 13:27:13 -0500 Subject: [PATCH 1024/1288] RPC tests: create initial chain with specific timestamps Use setmocktime to create the initial block chain with 10-minute-apart-blocks starting 1 Jan 2014. --- qa/rpc-tests/util.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index 0d5eeefa79..c6d918a81c 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -103,12 +103,17 @@ def initialize_chain(test_dir): # Create a 200-block-long chain; each of the 4 nodes # gets 25 mature blocks and 25 immature. - for i in range(4): - rpcs[i].setgenerate(True, 25) - sync_blocks(rpcs) - for i in range(4): - rpcs[i].setgenerate(True, 25) - sync_blocks(rpcs) + # blocks are created with timestamps 10 minutes apart, starting + # at 1 Jan 2014 + block_time = 1388534400 + for i in range(2): + for peer in range(4): + for j in range(25): + set_node_times(rpcs, block_time) + rpcs[peer].setgenerate(True, 1) + block_time += 10*60 + # Must sync before next peer starts generating blocks + sync_blocks(rpcs) # Shut them down, and clean up cache directories: stop_nodes(rpcs) @@ -179,10 +184,14 @@ def stop_node(node, i): del bitcoind_processes[i] def stop_nodes(nodes): - for i in range(len(nodes)): - nodes[i].stop() + for node in nodes: + node.stop() del nodes[:] # Emptying array closes connections as a side effect +def set_node_times(nodes, t): + for node in nodes: + node.setmocktime(t) + def wait_bitcoinds(): # Wait for all bitcoinds to cleanly exit for bitcoind in bitcoind_processes.values(): From 3c30f27f342c15af17c6f7e160be5ee60f28194d Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 17 Nov 2014 14:08:08 -0500 Subject: [PATCH 1025/1288] travis: disable rpc tests for windows until they're not so flaky --- qa/pull-tester/rpc-tests.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qa/pull-tester/rpc-tests.sh b/qa/pull-tester/rpc-tests.sh index a0056c141b..0b5ad20642 100755 --- a/qa/pull-tester/rpc-tests.sh +++ b/qa/pull-tester/rpc-tests.sh @@ -8,6 +8,11 @@ CURDIR=$(cd $(dirname "$0"); pwd) export BITCOINCLI=${BUILDDIR}/qa/pull-tester/run-bitcoin-cli export BITCOIND=${REAL_BITCOIND} +if [ "x${EXEEXT}" = "x.exe" ]; then + echo "Win tests currently disabled" + exit 0 +fi + #Run the tests if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then From 03914234b3c9c35d66b51d580fe727a0707394ca Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Sun, 28 Sep 2014 21:17:36 -0400 Subject: [PATCH 1026/1288] Discourage NOPs reserved for soft-fork upgrades NOP1 to NOP10 are reserved for future soft-fork upgrades. In the event of an upgrade such NOPs have *VERIFY behavior, meaning that if their arguments are not correct the script fails. Discouraging these NOPs by rejecting transactions containing them from the mempool ensures that we'll never accept transactions, nor mine blocks, with scripts that are now invalid according to the majority of hashing power even if we're not yet upgraded. Previously this wasn't an issue as the IsStandard() rules didn't allow upgradable NOPs anyway, but 7f3b4e95 relaxed the IsStandard() rules for P2SH redemptions allowing any redeemScript to be spent. We *do* allow upgradable NOPs in scripts so long as they are not executed. This is harmless as there is no opportunity for the script to be invalid post-upgrade. --- src/script/interpreter.cpp | 6 ++++++ src/script/interpreter.h | 13 ++++++++++++- src/script/script_error.cpp | 2 ++ src/script/script_error.h | 3 +++ src/script/standard.h | 3 ++- src/test/data/script_invalid.json | 17 +++++++++++++++++ src/test/data/script_valid.json | 5 +++++ src/test/transaction_tests.cpp | 3 ++- 8 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index cf81fe30a2..760086eaba 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -329,8 +329,14 @@ bool EvalScript(vector >& stack, const CScript& script, un // Control // case OP_NOP: + break; + case OP_NOP1: case OP_NOP2: case OP_NOP3: case OP_NOP4: case OP_NOP5: case OP_NOP6: case OP_NOP7: case OP_NOP8: case OP_NOP9: case OP_NOP10: + { + if (flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS) + return set_error(serror, SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS); + } break; case OP_IF: diff --git a/src/script/interpreter.h b/src/script/interpreter.h index 14cccc558f..12b2719414 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -57,7 +57,18 @@ enum // any other push causes the script to fail (BIP62 rule 3). // In addition, whenever a stack element is interpreted as a number, it must be of minimal length (BIP62 rule 4). // (softfork safe) - SCRIPT_VERIFY_MINIMALDATA = (1U << 6) + SCRIPT_VERIFY_MINIMALDATA = (1U << 6), + + // Discourage use of NOPs reserved for upgrades (NOP1-10) + // + // Provided so that nodes can avoid accepting or mining transactions + // containing executed NOP's whose meaning may change after a soft-fork, + // thus rendering the script invalid; with this flag set executing + // discouraged NOPs fails the script. This verification flag will never be + // a mandatory flag applied to scripts in a block. NOPs that are not + // executed, e.g. within an unexecuted IF ENDIF block, are *not* rejected. + SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS = (1U << 7) + }; uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType); diff --git a/src/script/script_error.cpp b/src/script/script_error.cpp index 4a3df268ec..793fc0da41 100644 --- a/src/script/script_error.cpp +++ b/src/script/script_error.cpp @@ -59,6 +59,8 @@ const char* ScriptErrorString(const ScriptError serror) return "Non-canonical signature: S value is unnecessarily high"; case SCRIPT_ERR_SIG_NULLDUMMY: return "Dummy CHECKMULTISIG argument must be zero"; + case SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS: + return "NOPx reserved for soft-fork upgrades"; case SCRIPT_ERR_UNKNOWN_ERROR: case SCRIPT_ERR_ERROR_COUNT: default: break; diff --git a/src/script/script_error.h b/src/script/script_error.h index ae6626b257..21153f1bd1 100644 --- a/src/script/script_error.h +++ b/src/script/script_error.h @@ -43,6 +43,9 @@ typedef enum ScriptError_t SCRIPT_ERR_SIG_HIGH_S, SCRIPT_ERR_SIG_NULLDUMMY, + /* softfork safeness */ + SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS, + SCRIPT_ERR_ERROR_COUNT } ScriptError; diff --git a/src/script/standard.h b/src/script/standard.h index f3dcc75fdc..c4b82b4c45 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -47,7 +47,8 @@ static const unsigned int MANDATORY_SCRIPT_VERIFY_FLAGS = SCRIPT_VERIFY_P2SH; static const unsigned int STANDARD_SCRIPT_VERIFY_FLAGS = MANDATORY_SCRIPT_VERIFY_FLAGS | SCRIPT_VERIFY_STRICTENC | SCRIPT_VERIFY_MINIMALDATA | - SCRIPT_VERIFY_NULLDUMMY; + SCRIPT_VERIFY_NULLDUMMY | + SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS; /** For convenience, standard but not mandatory verify flags. */ static const unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS = STANDARD_SCRIPT_VERIFY_FLAGS & ~MANDATORY_SCRIPT_VERIFY_FLAGS; diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index 6f451a36ee..0356d0be1c 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -163,6 +163,23 @@ nSequences are max. ["1","NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10 2 EQUAL", "P2SH,STRICTENC"], ["'NOP_1_to_10' NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10","'NOP_1_to_11' EQUAL", "P2SH,STRICTENC"], +["Ensure 100% coverage of discouraged NOPS"], +["1", "NOP1", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "NOP2", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "NOP3", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "NOP4", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "NOP5", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "NOP6", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "NOP7", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "NOP8", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "NOP9", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "NOP10", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], + +["NOP10", "1", "P2SH,DISCOURAGE_UPGRADABLE_NOPS", "Discouraged NOP10 in scriptSig"], + +["1 0x01 0xb9", "HASH160 0x14 0x15727299b05b45fdaf9ac9ecf7565cfe27c3e567 EQUAL", + "P2SH,DISCOURAGE_UPGRADABLE_NOPS", "Discouraged NOP10 in redeemScript"], + ["0x50","1", "P2SH,STRICTENC", "opcode 0x50 is reserved"], ["1", "IF 0xba ELSE 1 ENDIF", "P2SH,STRICTENC", "opcodes above NOP10 invalid if executed"], ["1", "IF 0xbb ELSE 1 ENDIF", "P2SH,STRICTENC"], diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index 439c82ef32..0cf1563163 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -235,6 +235,11 @@ nSequences are max. ["1","NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10 1 EQUAL", "P2SH,STRICTENC"], ["'NOP_1_to_10' NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10","'NOP_1_to_10' EQUAL", "P2SH,STRICTENC"], +["1", "NOP", "P2SH,STRICTENC,DISCOURAGE_UPGRADABLE_NOPS", "Discourage NOPx flag allows OP_NOP"], + +["0", "IF NOP10 ENDIF 1", "P2SH,STRICTENC,DISCOURAGE_UPGRADABLE_NOPS", + "Discouraged NOPs are allowed if not executed"], + ["0", "IF 0xba ELSE 1 ENDIF", "P2SH,STRICTENC", "opcodes above NOP10 invalid if executed"], ["0", "IF 0xbb ELSE 1 ENDIF", "P2SH,STRICTENC"], ["0", "IF 0xbc ELSE 1 ENDIF", "P2SH,STRICTENC"], diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index bf3a60c04f..e939e89972 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -37,7 +37,8 @@ static std::map mapFlagNames = boost::assign::map_list_of (string("LOW_S"), (unsigned int)SCRIPT_VERIFY_LOW_S) (string("SIGPUSHONLY"), (unsigned int)SCRIPT_VERIFY_SIGPUSHONLY) (string("MINIMALDATA"), (unsigned int)SCRIPT_VERIFY_MINIMALDATA) - (string("NULLDUMMY"), (unsigned int)SCRIPT_VERIFY_NULLDUMMY); + (string("NULLDUMMY"), (unsigned int)SCRIPT_VERIFY_NULLDUMMY) + (string("DISCOURAGE_UPGRADABLE_NOPS"), (unsigned int)SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS); unsigned int ParseScriptFlags(string strFlags) { From a7f29410681b367620c780453b0abb9688831766 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Tue, 18 Nov 2014 10:55:55 +0100 Subject: [PATCH 1027/1288] [Qt, OSX] fix usage of osx 10.8+ user notification center Currently Bitcoin-Qts support for OSX User Notification Center is broken. This pull will fix a known issue of non-official-apple-built apps having problems sending user notifications. --- src/qt/macnotificationhandler.mm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/qt/macnotificationhandler.mm b/src/qt/macnotificationhandler.mm index 8a4c94cc5c..aa50a0d9fb 100644 --- a/src/qt/macnotificationhandler.mm +++ b/src/qt/macnotificationhandler.mm @@ -5,8 +5,21 @@ #include "macnotificationhandler.h" #undef slots +#import #include +// Add an obj-c category (extension) to return the expected bundle identifier +@implementation NSBundle(returnCorrectIdentifier) +- (NSString *)__bundleIdentifier +{ + if (self == [NSBundle mainBundle]) { + return @"org.bitcoinfoundation.Bitcoin-Qt"; + } else { + return [self __bundleIdentifier]; + } +} +@end + void MacNotificationHandler::showNotification(const QString &title, const QString &text) { // check if users OS has support for NSUserNotification @@ -63,7 +76,16 @@ bool MacNotificationHandler::hasUserNotificationCenterSupport(void) MacNotificationHandler *MacNotificationHandler::instance() { static MacNotificationHandler *s_instance = NULL; - if (!s_instance) + if (!s_instance) { s_instance = new MacNotificationHandler(); + + Class aPossibleClass = objc_getClass("NSBundle"); + if (aPossibleClass) { + // change NSBundle -bundleIdentifier method to return a correct bundle identifier + // a bundle identifier is required to use OSXs User Notification Center + method_exchangeImplementations(class_getInstanceMethod(aPossibleClass, @selector(bundleIdentifier)), + class_getInstanceMethod(aPossibleClass, @selector(__bundleIdentifier))); + } + } return s_instance; } From 7715c847472f565ca79429db0d8505f126617878 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 18 Nov 2014 10:27:45 -0500 Subject: [PATCH 1028/1288] HTTP REST: minor fixes 1) const-ify internal helper ParseHashStr() 2) use HTTPError() helper when returning HTTP_NOT_FOUND --- src/rest.cpp | 4 ++-- src/rpcserver.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rest.cpp b/src/rest.cpp index 48c1672ae8..89075887a0 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -56,7 +56,7 @@ static enum RetFormat ParseDataFormat(const string& format) return rf_names[0].rf; } -static bool ParseHashStr(string& strReq, uint256& v) +static bool ParseHashStr(const string& strReq, uint256& v) { if (!IsHex(strReq) || (strReq.size() != 64)) return false; @@ -195,7 +195,7 @@ bool HTTPReq_REST(AcceptedConnection *conn, return false; } - conn->stream() << HTTPReply(HTTP_NOT_FOUND, "", false) << std::flush; + conn->stream() << HTTPError(HTTP_NOT_FOUND, false) << std::flush; return false; } diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index d072f18e36..8b042e6003 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -957,7 +957,7 @@ void ServiceConnection(AcceptedConnection *conn) break; } else { - conn->stream() << HTTPReply(HTTP_NOT_FOUND, "", false) << std::flush; + conn->stream() << HTTPError(HTTP_NOT_FOUND, false) << std::flush; break; } } From e2f30d547f733ee33e7814ab500c08d12958e66a Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 18 Nov 2014 16:30:51 +0100 Subject: [PATCH 1029/1288] Properly lock cs_main in rest_block --- src/rest.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/rest.cpp b/src/rest.cpp index 89075887a0..9a8793a517 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -11,6 +11,7 @@ #include "core/transaction.h" #include "version.h" #include "main.h" +#include "sync.h" using namespace std; using namespace json_spirit; @@ -80,13 +81,17 @@ static bool rest_block(AcceptedConnection *conn, if (!ParseHashStr(hashStr, hash)) throw RESTERR(HTTP_BAD_REQUEST, "Invalid hash: " + hashStr); - if (mapBlockIndex.count(hash) == 0) - throw RESTERR(HTTP_NOT_FOUND, hashStr + " not found"); - CBlock block; - CBlockIndex* pblockindex = mapBlockIndex[hash]; - if (!ReadBlockFromDisk(block, pblockindex)) - throw RESTERR(HTTP_NOT_FOUND, hashStr + " not found"); + CBlockIndex* pblockindex = NULL; + { + LOCK(cs_main); + if (mapBlockIndex.count(hash) == 0) + throw RESTERR(HTTP_NOT_FOUND, hashStr + " not found"); + + pblockindex = mapBlockIndex[hash]; + if (!ReadBlockFromDisk(block, pblockindex)) + throw RESTERR(HTTP_NOT_FOUND, hashStr + " not found"); + } CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION); ssBlock << block; From 7a7e10913989aca949a2d42f29e3ffdcd14313f3 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 18 Nov 2014 18:06:36 +0100 Subject: [PATCH 1030/1288] Delete src/secp256k1 before subtree import --- src/secp256k1/.empty | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/secp256k1/.empty diff --git a/src/secp256k1/.empty b/src/secp256k1/.empty deleted file mode 100644 index e69de29bb2..0000000000 From d48555b36ac512161b81f9b6bca7bea16a0cd806 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 18 Nov 2014 18:06:36 +0100 Subject: [PATCH 1031/1288] Squashed 'src/secp256k1/' content from commit ad2028f git-subtree-dir: src/secp256k1 git-subtree-split: ad2028f9890ca40bdd32055aa0fe5c1c9af0e485 --- .gitignore | 35 + .travis.yml | 25 + COPYING | 19 + Makefile.am | 88 ++ README.md | 55 ++ TODO | 3 + autogen.sh | 3 + build-aux/m4/bitcoin_secp.m4 | 90 ++ configure.ac | 259 +++++ include/secp256k1.h | 252 +++++ libsecp256k1.pc.in | 13 + nasm_lt.sh | 57 ++ obj/.gitignore | 0 src/bench_inv.c | 41 + src/bench_sign.c | 49 + src/bench_verify.c | 44 + src/ecdsa.h | 23 + src/ecdsa_impl.h | 183 ++++ src/eckey.h | 25 + src/eckey_impl.h | 200 ++++ src/ecmult.h | 19 + src/ecmult_gen.h | 19 + src/ecmult_gen_impl.h | 118 +++ src/ecmult_impl.h | 222 +++++ src/field.h | 114 +++ src/field_10x26.h | 21 + src/field_10x26_impl.h | 884 +++++++++++++++++ src/field_5x52.h | 21 + src/field_5x52_asm.asm | 469 +++++++++ src/field_5x52_asm_impl.h | 13 + src/field_5x52_impl.h | 260 +++++ src/field_5x52_int128_impl.h | 279 ++++++ src/field_gmp.h | 18 + src/field_gmp_impl.h | 163 ++++ src/field_impl.h | 293 ++++++ src/group.h | 128 +++ src/group_impl.h | 519 ++++++++++ src/java/org/bitcoin/NativeSecp256k1.java | 60 ++ src/java/org_bitcoin_NativeSecp256k1.c | 23 + src/java/org_bitcoin_NativeSecp256k1.h | 21 + src/num.h | 100 ++ src/num_gmp.h | 20 + src/num_gmp_impl.h | 376 +++++++ src/num_impl.h | 22 + src/scalar.h | 63 ++ src/scalar_4x64.h | 17 + src/scalar_4x64_impl.h | 359 +++++++ src/scalar_8x32.h | 17 + src/scalar_8x32_impl.h | 572 +++++++++++ src/scalar_impl.h | 184 ++++ src/secp256k1.c | 305 ++++++ src/testrand.h | 26 + src/testrand_impl.h | 60 ++ src/tests.c | 1080 +++++++++++++++++++++ src/util.h | 64 ++ 55 files changed, 8393 insertions(+) create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 COPYING create mode 100644 Makefile.am create mode 100644 README.md create mode 100644 TODO create mode 100755 autogen.sh create mode 100644 build-aux/m4/bitcoin_secp.m4 create mode 100644 configure.ac create mode 100644 include/secp256k1.h create mode 100644 libsecp256k1.pc.in create mode 100755 nasm_lt.sh create mode 100644 obj/.gitignore create mode 100644 src/bench_inv.c create mode 100644 src/bench_sign.c create mode 100644 src/bench_verify.c create mode 100644 src/ecdsa.h create mode 100644 src/ecdsa_impl.h create mode 100644 src/eckey.h create mode 100644 src/eckey_impl.h create mode 100644 src/ecmult.h create mode 100644 src/ecmult_gen.h create mode 100644 src/ecmult_gen_impl.h create mode 100644 src/ecmult_impl.h create mode 100644 src/field.h create mode 100644 src/field_10x26.h create mode 100644 src/field_10x26_impl.h create mode 100644 src/field_5x52.h create mode 100644 src/field_5x52_asm.asm create mode 100644 src/field_5x52_asm_impl.h create mode 100644 src/field_5x52_impl.h create mode 100644 src/field_5x52_int128_impl.h create mode 100644 src/field_gmp.h create mode 100644 src/field_gmp_impl.h create mode 100644 src/field_impl.h create mode 100644 src/group.h create mode 100644 src/group_impl.h create mode 100644 src/java/org/bitcoin/NativeSecp256k1.java create mode 100644 src/java/org_bitcoin_NativeSecp256k1.c create mode 100644 src/java/org_bitcoin_NativeSecp256k1.h create mode 100644 src/num.h create mode 100644 src/num_gmp.h create mode 100644 src/num_gmp_impl.h create mode 100644 src/num_impl.h create mode 100644 src/scalar.h create mode 100644 src/scalar_4x64.h create mode 100644 src/scalar_4x64_impl.h create mode 100644 src/scalar_8x32.h create mode 100644 src/scalar_8x32_impl.h create mode 100644 src/scalar_impl.h create mode 100644 src/secp256k1.c create mode 100644 src/testrand.h create mode 100644 src/testrand_impl.h create mode 100644 src/tests.c create mode 100644 src/util.h diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..f0a54077a5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +bench_inv +bench_sign +bench_verify +tests +*.exe +*.so +*.a +!.gitignore + +Makefile +configure +.libs/ +Makefile.in +aclocal.m4 +autom4te.cache/ +config.log +config.status +*.tar.gz +*.la +libtool +.deps/ +.dirstamp +build-aux/ +*.lo +*.o +*~ +src/libsecp256k1-config.h +src/libsecp256k1-config.h.in +m4/libtool.m4 +m4/ltoptions.m4 +m4/ltsugar.m4 +m4/ltversion.m4 +m4/lt~obsolete.m4 +src/stamp-h1 +libsecp256k1.pc diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..24a86b561b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,25 @@ +language: cpp +compiler: gcc +install: + - sudo apt-get install -qq libssl-dev + - if [ "$BIGNUM" = "gmp" -o "$BIGNUM" = "auto" -o "$FIELD" = "gmp" ]; then sudo apt-get install -qq libgmp-dev; fi + - if [ "$FIELD" = "64bit_asm" ]; then sudo apt-get install -qq yasm; fi +env: + global: + - FIELD=auto BIGNUM=auto SCALAR=auto ENDOMORPHISM=no BUILD=check EXTRAFLAGS= + matrix: + - SCALAR=32bit + - SCALAR=64bit + - FIELD=gmp + - FIELD=gmp ENDOMORPHISM=yes + - FIELD=64bit_asm + - FIELD=64bit_asm ENDOMORPHISM=yes + - FIELD=64bit + - FIELD=64bit ENDOMORPHISM=yes + - FIELD=32bit + - FIELD=32bit ENDOMORPHISM=yes + - BUILD=distcheck + - EXTRAFLAGS=CFLAGS=-DDETERMINISTIC +before_script: ./autogen.sh +script: ./configure --enable-endomorphism=$ENDOMORPHISM --with-field=$FIELD --with-bignum=$BIGNUM --with-scalar=$SCALAR $EXTRAFLAGS && make -j2 $BUILD +os: linux diff --git a/COPYING b/COPYING new file mode 100644 index 0000000000..4522a5990e --- /dev/null +++ b/COPYING @@ -0,0 +1,19 @@ +Copyright (c) 2013 Pieter Wuille + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000000..d527da6b77 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,88 @@ +ACLOCAL_AMFLAGS = -I build-aux/m4 + +lib_LTLIBRARIES = libsecp256k1.la +if USE_ASM +COMMON_LIB = libsecp256k1_common.la +else +COMMON_LIB = +endif +noinst_LTLIBRARIES = $(COMMON_LIB) +include_HEADERS = include/secp256k1.h +noinst_HEADERS = +noinst_HEADERS += src/scalar.h +noinst_HEADERS += src/scalar_4x64.h +noinst_HEADERS += src/scalar_8x32.h +noinst_HEADERS += src/scalar_impl.h +noinst_HEADERS += src/scalar_4x64_impl.h +noinst_HEADERS += src/scalar_8x32_impl.h +noinst_HEADERS += src/group.h +noinst_HEADERS += src/group_impl.h +noinst_HEADERS += src/num_gmp.h +noinst_HEADERS += src/num_gmp_impl.h +noinst_HEADERS += src/ecdsa.h +noinst_HEADERS += src/ecdsa_impl.h +noinst_HEADERS += src/eckey.h +noinst_HEADERS += src/eckey_impl.h +noinst_HEADERS += src/ecmult.h +noinst_HEADERS += src/ecmult_impl.h +noinst_HEADERS += src/ecmult_gen.h +noinst_HEADERS += src/ecmult_gen_impl.h +noinst_HEADERS += src/num.h +noinst_HEADERS += src/num_impl.h +noinst_HEADERS += src/field_10x26.h +noinst_HEADERS += src/field_10x26_impl.h +noinst_HEADERS += src/field_5x52.h +noinst_HEADERS += src/field_5x52_impl.h +noinst_HEADERS += src/field_5x52_int128_impl.h +noinst_HEADERS += src/field_5x52_asm_impl.h +noinst_HEADERS += src/java/org_bitcoin_NativeSecp256k1.h +noinst_HEADERS += src/util.h +noinst_HEADERS += src/testrand.h +noinst_HEADERS += src/testrand_impl.h +noinst_HEADERS += src/field_gmp.h +noinst_HEADERS += src/field_gmp_impl.h +noinst_HEADERS += src/field.h +noinst_HEADERS += src/field_impl.h + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libsecp256k1.pc + +if USE_ASM +libsecp256k1_common_la_SOURCES = src/field_5x52_asm.asm +endif + +libsecp256k1_la_SOURCES = src/secp256k1.c +libsecp256k1_la_CPPFLAGS = -I$(top_srcdir)/include $(SECP_INCLUDES) +libsecp256k1_la_LIBADD = $(COMMON_LIB) $(SECP_LIBS) + + +noinst_PROGRAMS = +if USE_BENCHMARK +noinst_PROGRAMS += bench_verify bench_sign bench_inv +bench_verify_SOURCES = src/bench_verify.c +bench_verify_LDADD = libsecp256k1.la $(SECP_LIBS) +bench_verify_LDFLAGS = -static +bench_sign_SOURCES = src/bench_sign.c +bench_sign_LDADD = libsecp256k1.la $(SECP_LIBS) +bench_sign_LDFLAGS = -static +bench_inv_SOURCES = src/bench_inv.c +bench_inv_LDADD = $(COMMON_LIB) $(SECP_LIBS) +bench_inv_LDFLAGS = -static +endif + +if USE_TESTS +noinst_PROGRAMS += tests +tests_SOURCES = src/tests.c +tests_CPPFLAGS = -DVERIFY $(SECP_TEST_INCLUDES) +tests_LDADD = $(COMMON_LIB) $(SECP_LIBS) $(SECP_TEST_LIBS) +tests_LDFLAGS = -static +TESTS = tests +endif + +EXTRA_DIST = autogen.sh nasm_lt.sh + +#x86_64 only +if USE_ASM +.asm.lo: + $(LIBTOOL) --mode=compile --tag YASM $(srcdir)/nasm_lt.sh $(YASM) -f $(YASM_BINFMT) $(YAFLAGS) -I$(srcdir) -I. $< -o $@ +endif diff --git a/README.md b/README.md new file mode 100644 index 0000000000..1e49f49416 --- /dev/null +++ b/README.md @@ -0,0 +1,55 @@ +libsecp256k1 +============ + +[![Build Status](https://travis-ci.org/bitcoin/secp256k1.svg?branch=master)](https://travis-ci.org/bitcoin/secp256k1) + +Optimized C library for EC operations on curve secp256k1. + +This library is experimental, so use at your own risk. + +Features: +* Low-level field and group operations on secp256k1. +* ECDSA signing/verification and key generation. +* Adding/multiplying private/public keys. +* Serialization/parsing of private keys, public keys, signatures. +* Very efficient implementation. + +Implementation details +---------------------- + +* General + * Avoid dynamic memory usage almost everywhere. +* Field operations + * Optimized implementation of arithmetic modulo the curve's field size (2^256 - 0x1000003D1). + * Using 5 52-bit limbs (including hand-optimized assembly for x86_64, by Diederik Huys). + * Using 10 26-bit limbs. + * Using GMP. + * Field inverses and square roots using a sliding window over blocks of 1s (by Peter Dettman). +* Scalar operations + * Optimized implementation without data-dependent branches of arithmetic modulo the curve's order. + * Using 4 64-bit limbs (relying on __int128 support in the compiler). + * Using 8 32-bit limbs. +* Group operations + * Point addition formula specifically simplified for the curve equation (y^2 = x^3 + 7). + * Use addition between points in Jacobian and affine coordinates where possible. + * Use a unified addition/doubling formula where necessary to avoid data-dependent branches. +* Point multiplication for verification (a*P + b*G). + * Use wNAF notation for point multiplicands. + * Use a much larger window for multiples of G, using precomputed multiples. + * Use Shamir's trick to do the multiplication with the public key and the generator simultaneously. + * Optionally use secp256k1's efficiently-computable endomorphism to split the multiplicands into 4 half-sized ones first. +* Point multiplication for signing + * Use a precomputed table of multiples of powers of 16 multiplied with the generator, so general multiplication becomes a series of additions. + * Slice the precomputed table in memory per byte, so memory access to the table becomes uniform. + * No data-dependent branches + * The precomputed tables add and eventually subtract points for which no known scalar (private key) is known, preventing even an attacker with control over the private key used to control the data internally. + +Build steps +----------- + +libsecp256k1 is built using autotools: + + $ ./autogen.sh + $ ./configure + $ make + $ sudo make install # optional diff --git a/TODO b/TODO new file mode 100644 index 0000000000..a300e1c5eb --- /dev/null +++ b/TODO @@ -0,0 +1,3 @@ +* Unit tests for fieldelem/groupelem, including ones intended to + trigger fieldelem's boundary cases. +* Complete constant-time operations for signing/keygen diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000000..65286b9353 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,3 @@ +#!/bin/sh +set -e +autoreconf -if --warnings=all diff --git a/build-aux/m4/bitcoin_secp.m4 b/build-aux/m4/bitcoin_secp.m4 new file mode 100644 index 0000000000..e6f3470ed7 --- /dev/null +++ b/build-aux/m4/bitcoin_secp.m4 @@ -0,0 +1,90 @@ +dnl libsecp25k1 helper checks +AC_DEFUN([SECP_INT128_CHECK],[ +has_int128=$ac_cv_type___int128 +if test x"$has_int128" != x"yes" && test x"$set_field" = x"64bit"; then + AC_MSG_ERROR([$set_field field support explicitly requested but is not compatible with this host]) +fi +if test x"$has_int128" != x"yes" && test x"$set_scalar" = x"64bit"; then + AC_MSG_ERROR([$set_scalar scalar support explicitly requested but is not compatible with this host]) +fi +]) + +dnl +AC_DEFUN([SECP_64BIT_ASM_CHECK],[ +if test x"$host_cpu" == x"x86_64"; then + AC_CHECK_PROG(YASM, yasm, yasm) +else + if test x"$set_field" = x"64bit_asm"; then + AC_MSG_ERROR([$set_field field support explicitly requested but is not compatible with this host]) + fi +fi +if test x$YASM = x; then + if test x"$set_field" = x"64bit_asm"; then + AC_MSG_ERROR([$set_field field support explicitly requested but yasm was not found]) + fi + has_64bit_asm=no +else + case x"$host_os" in + xdarwin*) + YASM_BINFMT=macho64 + ;; + x*-gnux32) + YASM_BINFMT=elfx32 + ;; + *) + YASM_BINFMT=elf64 + ;; + esac + if $YASM -f help | grep -q $YASM_BINFMT; then + has_64bit_asm=yes + else + if test x"$set_field" = x"64bit_asm"; then + AC_MSG_ERROR([$set_field field support explicitly requested but yasm doesn't support $YASM_BINFMT format]) + fi + AC_MSG_WARN([yasm too old for $YASM_BINFMT format]) + has_64bit_asm=no + fi +fi +]) + +dnl +AC_DEFUN([SECP_OPENSSL_CHECK],[ +if test x"$use_pkgconfig" = x"yes"; then + : #NOP + m4_ifdef([PKG_CHECK_MODULES],[ + PKG_CHECK_MODULES([CRYPTO], [libcrypto], [has_libcrypto=yes; AC_DEFINE(HAVE_LIBCRYPTO,1,[Define this symbol if libcrypto is installed])],[has_libcrypto=no]) + : #NOP + ]) +else + AC_CHECK_HEADER(openssl/crypto.h,[AC_CHECK_LIB(crypto, main,[has_libcrypto=yes; CRYPTO_LIBS=-lcrypto; AC_DEFINE(HAVE_LIBCRYPTO,1,[Define this symbol if libcrypto is installed])] +)]) + LIBS= +fi +if test x"$has_libcrypto" == x"yes" && test x"$has_openssl_ec" = x; then + AC_MSG_CHECKING(for EC functions in libcrypto) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + #include ]],[[ + EC_KEY *eckey = EC_KEY_new_by_curve_name(NID_secp256k1); + ECDSA_sign(0, NULL, 0, NULL, NULL, eckey); + ECDSA_verify(0, NULL, 0, NULL, 0, eckey); + EC_KEY_free(eckey); + ]])],[has_openssl_ec=yes],[has_openssl_ec=no]) + AC_MSG_RESULT([$has_openssl_ec]) +fi +]) + +dnl +AC_DEFUN([SECP_GMP_CHECK],[ +if test x"$has_gmp" != x"yes"; then + AC_CHECK_HEADER(gmp.h,[AC_CHECK_LIB(gmp, __gmpz_init,[has_gmp=yes; GMP_LIBS=-lgmp; AC_DEFINE(HAVE_LIBGMP,1,[Define this symbol if libgmp is installed])])]) +fi +if test x"$set_field" = x"gmp" && test x"$has_gmp" != x"yes"; then + AC_MSG_ERROR([$set_field field support explicitly requested but libgmp was not found]) +fi +if test x"$set_bignum" = x"gmp" && test x"$has_gmp" != x"yes"; then + AC_MSG_ERROR([$set_bignum field support explicitly requested but libgmp was not found]) +fi +]) + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000000..2da5709834 --- /dev/null +++ b/configure.ac @@ -0,0 +1,259 @@ +AC_PREREQ([2.60]) +AC_INIT([libsecp256k1],[0.1]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_MACRO_DIR([build-aux/m4]) +AC_CANONICAL_HOST +AH_TOP([#ifndef LIBSECP256K1_CONFIG_H]) +AH_TOP([#define LIBSECP256K1_CONFIG_H]) +AH_BOTTOM([#endif //LIBSECP256K1_CONFIG_H]) +AM_INIT_AUTOMAKE([foreign]) +LT_INIT + +dnl make the compilation flags quiet unless V=1 is used +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +PKG_PROG_PKG_CONFIG + +AC_PATH_TOOL(AR, ar) +AC_PATH_TOOL(RANLIB, ranlib) +AC_PATH_TOOL(STRIP, strip) + +AC_PROG_CC_C99 +if test x"$ac_cv_prog_cc_c99" == x"no"; then + AC_MSG_ERROR([c99 compiler support required]) +fi + +case $host in + *mingw*) + use_pkgconfig=no + ;; + *) + use_pkgconfig=yes + ;; +esac + +case $host_os in + darwin*) + CPPFLAGS="$CPPFLAGS -I/opt/local/include" + LDFLAGS="$LDFLAGS -L/opt/local/lib" + ;; +esac + +CFLAGS="$CFLAGS -W" + +warn_CFLAGS="-Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wno-unused-function" +saved_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $warn_CFLAGS" +AC_MSG_CHECKING([if ${CC} supports ${warn_CFLAGS}]) +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])], + [ AC_MSG_RESULT([yes]) ], + [ AC_MSG_RESULT([no]) + CFLAGS="$saved_CFLAGS" + ]) + + +AC_ARG_ENABLE(benchmark, + AS_HELP_STRING([--enable-benchmark],[compile benchmark (default is yes)]), + [use_benchmark=$enableval], + [use_benchmark=yes]) + +AC_ARG_ENABLE(tests, + AS_HELP_STRING([--enable-tests],[compile tests (default is yes)]), + [use_tests=$enableval], + [use_tests=yes]) + +AC_ARG_ENABLE(endomorphism, + AS_HELP_STRING([--enable-endomorphism],[enable endomorphism (default is no)]), + [use_endomorphism=$enableval], + [use_endomorphism=no]) + +AC_ARG_WITH([field], [AS_HELP_STRING([--with-field=gmp|64bit|64bit_asm|32bit|auto], +[Specify Field Implementation. Default is auto])],[req_field=$withval], [req_field=auto]) + +AC_ARG_WITH([bignum], [AS_HELP_STRING([--with-bignum=gmp|auto], +[Specify Bignum Implementation. Default is auto])],[req_bignum=$withval], [req_bignum=auto]) + +AC_ARG_WITH([scalar], [AS_HELP_STRING([--with-scalar=64bit|32bit|auto], +[Specify scalar implementation. Default is auto])],[req_scalar=$withval], [req_scalar=auto]) + +AC_CHECK_TYPES([__int128]) + +AC_CHECK_DECL(__builtin_expect,AC_DEFINE(HAVE_BUILTIN_EXPECT,1,[Define this symbol if __builtin_expect is available]),,) + +if test x"$req_field" = x"auto"; then + SECP_64BIT_ASM_CHECK + if test x"$has_64bit_asm" = x"yes"; then + set_field=64bit_asm + fi + + if test x"$set_field" = x; then + SECP_INT128_CHECK + if test x"$has_int128" = x"yes"; then + set_field=64bit + fi + fi + + if test x"$set_field" = x; then + SECP_GMP_CHECK + if test x"$has_gmp" = x"yes"; then + set_field=gmp + fi + fi + + if test x"$set_field" = x; then + set_field=32bit + fi +else + set_field=$req_field + case $set_field in + 64bit_asm) + SECP_64BIT_ASM_CHECK + ;; + 64bit) + SECP_INT128_CHECK + ;; + gmp) + SECP_GMP_CHECK + ;; + 32bit) + ;; + *) + AC_MSG_ERROR([invalid field implementation selection]) + ;; + esac +fi + +if test x"$req_scalar" = x"auto"; then + if test x"$set_scalar" = x; then + SECP_INT128_CHECK + if test x"$has_int128" = x"yes"; then + set_scalar=64bit + fi + fi + if test x"$set_scalar" = x; then + set_scalar=32bit + fi +else + set_scalar=$req_scalar + case $set_scalar in + 64bit) + SECP_INT128_CHECK + ;; + 32bit) + ;; + *) + AC_MSG_ERROR([invalid scalar implementation selected]) + ;; + esac +fi + +if test x"$req_bignum" = x"auto"; then + SECP_GMP_CHECK + if test x"$has_gmp" = x"yes"; then + set_bignum=gmp + fi + + if test x"$set_bignum" = x; then + AC_MSG_ERROR([no working bignum implementation found]) + fi +else + set_bignum=$req_bignum + case $set_bignum in + gmp) + SECP_GMP_CHECK + ;; + openssl) + SECP_OPENSSL_CHECK + ;; + *) + AC_MSG_ERROR([invalid bignum implementation selection]) + ;; + esac +fi + +# select field implementation +case $set_field in +64bit_asm) + AC_DEFINE(USE_FIELD_5X52_ASM, 1, [Define this symbol to use the assembly version for the 5x52 field implementation]) + AC_DEFINE(USE_FIELD_5X52, 1, [Define this symbol to use the FIELD_5X52 implementation]) + ;; +64bit) + AC_DEFINE(USE_FIELD_5X52_INT128, 1, [Define this symbol to use the __int128 version for the 5x52 field implementation]) + AC_DEFINE(USE_FIELD_5X52, 1, [Define this symbol to use the FIELD_5X52 implementation]) + ;; +gmp) + AC_DEFINE(HAVE_LIBGMP,1,[Define this symbol if libgmp is installed]) + AC_DEFINE(USE_FIELD_GMP, 1, [Define this symbol to use the FIELD_GMP implementation]) + ;; +32bit) + AC_DEFINE(USE_FIELD_10X26, 1, [Define this symbol to use the FIELD_10X26 implementation]) + ;; +*) + AC_MSG_ERROR([invalid field implementation]) + ;; +esac + +# select bignum implementation +case $set_bignum in +gmp) + AC_DEFINE(HAVE_LIBGMP,1,[Define this symbol if libgmp is installed]) + AC_DEFINE(USE_NUM_GMP, 1, [Define this symbol to use the gmp implementation]) + AC_DEFINE(USE_FIELD_INV_NUM, 1, [Define this symbol to use the USE_FIELD_INV_NUM implementation]) + ;; +*) + AC_MSG_ERROR([invalid bignum implementation]) + ;; +esac + +#select scalar implementation +case $set_scalar in +64bit) + AC_DEFINE(USE_SCALAR_4X64, 1, [Define this symbol to use the 4x64 scalar implementation]) + ;; +32bit) + AC_DEFINE(USE_SCALAR_8X32, 1, [Define this symbol to use the 8x32 scalar implementation]) + ;; +*) + AC_MSG_ERROR([invalid scalar implementation]) + ;; +esac + +if test x"$use_tests" = x"yes"; then + SECP_OPENSSL_CHECK + if test x"$has_openssl_ec" == x"yes"; then + AC_DEFINE(ENABLE_OPENSSL_TESTS, 1, [Define this symbol if OpenSSL EC functions are available]) + SECP_TEST_INCLUDES="$SSL_CFLAGS $CRYPTO_CFLAGS" + SECP_TEST_LIBS="$CRYPTO_LIBS" + + case $host in + *mingw*) + SECP_TEST_LIBS="$SECP_TEST_LIBS -lgdi32" + ;; + esac + + fi +fi + +if test x"$set_field" = x"gmp" || test x"$set_bignum" = x"gmp"; then + SECP_LIBS="$SECP_LIBS $GMP_LIBS" +fi + +if test x"$use_endomorphism" = x"yes"; then + AC_DEFINE(USE_ENDOMORPHISM, 1, [Define this symbol to use endomorphism]) +fi + +AC_MSG_NOTICE([Using field implementation: $set_field]) +AC_MSG_NOTICE([Using bignum implementation: $set_bignum]) +AC_MSG_NOTICE([Using scalar implementation: $set_scalar]) + +AC_CONFIG_HEADERS([src/libsecp256k1-config.h]) +AC_CONFIG_FILES([Makefile libsecp256k1.pc]) +AC_SUBST(SECP_INCLUDES) +AC_SUBST(SECP_LIBS) +AC_SUBST(SECP_TEST_LIBS) +AC_SUBST(SECP_TEST_INCLUDES) +AC_SUBST(YASM_BINFMT) +AM_CONDITIONAL([USE_ASM], [test x"$set_field" == x"64bit_asm"]) +AM_CONDITIONAL([USE_TESTS], [test x"$use_tests" != x"no"]) +AM_CONDITIONAL([USE_BENCHMARK], [test x"$use_benchmark" != x"no"]) +AC_OUTPUT diff --git a/include/secp256k1.h b/include/secp256k1.h new file mode 100644 index 0000000000..932bf0279f --- /dev/null +++ b/include/secp256k1.h @@ -0,0 +1,252 @@ +#ifndef _SECP256K1_ +# define _SECP256K1_ + +# ifdef __cplusplus +extern "C" { +# endif + +# if !defined(SECP256K1_GNUC_PREREQ) +# if defined(__GNUC__)&&defined(__GNUC_MINOR__) +# define SECP256K1_GNUC_PREREQ(_maj,_min) \ + ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min)) +# else +# define SECP256K1_GNUC_PREREQ(_maj,_min) 0 +# endif +# endif + +# if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) +# if SECP256K1_GNUC_PREREQ(3,0) +# define SECP256K1_RESTRICT __restrict__ +# elif (defined(_MSC_VER) && _MSC_VER >= 1400) +# define SECP256K1_RESTRICT __restrict +# else +# define SECP256K1_RESTRICT +# endif +# else +# define SECP256K1_RESTRICT restrict +# endif + +# if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) +# if SECP256K1_GNUC_PREREQ(2,7) +# define SECP256K1_INLINE __inline__ +# elif (defined(_MSC_VER)) +# define SECP256K1_INLINE __inline +# else +# define SECP256K1_INLINE +# endif +# else +# define SECP256K1_INLINE inline +# endif + +/**Warning attributes + * NONNULL is not used if SECP256K1_BUILD is set to avoid the compiler optimizing out + * some paranoid null checks. */ +# if defined(__GNUC__) && SECP256K1_GNUC_PREREQ(3, 4) +# define SECP256K1_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__)) +# else +# define SECP256K1_WARN_UNUSED_RESULT +# endif +# if !defined(SECP256K1_BUILD) && defined(__GNUC__) && SECP256K1_GNUC_PREREQ(3, 4) +# define SECP256K1_ARG_NONNULL(_x) __attribute__ ((__nonnull__(_x))) +# else +# define SECP256K1_ARG_NONNULL(_x) +# endif + + +/** Flags to pass to secp256k1_start. */ +# define SECP256K1_START_VERIFY (1 << 0) +# define SECP256K1_START_SIGN (1 << 1) + +/** Initialize the library. This may take some time (10-100 ms). + * You need to call this before calling any other function. + * It cannot run in parallel with any other functions, but once + * secp256k1_start() returns, all other functions are thread-safe. + */ +void secp256k1_start(unsigned int flags); + +/** Free all memory associated with this library. After this, no + * functions can be called anymore, except secp256k1_start() + */ +void secp256k1_stop(void); + +/** Verify an ECDSA signature. + * Returns: 1: correct signature + * 0: incorrect signature + * -1: invalid public key + * -2: invalid signature + * In: msg: the message being verified (cannot be NULL) + * msglen: the length of the message (at most 32) + * sig: the signature being verified (cannot be NULL) + * siglen: the length of the signature + * pubkey: the public key to verify with (cannot be NULL) + * pubkeylen: the length of pubkey + * Requires starting using SECP256K1_START_VERIFY. + */ +SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_verify( + const unsigned char *msg, + int msglen, + const unsigned char *sig, + int siglen, + const unsigned char *pubkey, + int pubkeylen +) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(5); + +/** Create an ECDSA signature. + * Returns: 1: signature created + * 0: nonce invalid, try another one + * In: msg: the message being signed (cannot be NULL) + * msglen: the length of the message being signed (at most 32) + * seckey: pointer to a 32-byte secret key (cannot be NULL, assumed to be valid) + * nonce: pointer to a 32-byte nonce (cannot be NULL, generated with a cryptographic PRNG) + * Out: sig: pointer to an array where the signature will be placed (cannot be NULL) + * In/Out: siglen: pointer to an int with the length of sig, which will be updated + * to contain the actual signature length (<=72). + * Requires starting using SECP256K1_START_SIGN. + */ +SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_sign( + const unsigned char *msg, + int msglen, + unsigned char *sig, + int *siglen, + const unsigned char *seckey, + const unsigned char *nonce +) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(5) SECP256K1_ARG_NONNULL(6); + +/** Create a compact ECDSA signature (64 byte + recovery id). + * Returns: 1: signature created + * 0: nonce invalid, try another one + * In: msg: the message being signed (cannot be NULL) + * msglen: the length of the message being signed (at most 32) + * seckey: pointer to a 32-byte secret key (cannot be NULL, assumed to be valid) + * nonce: pointer to a 32-byte nonce (cannot be NULL, generated with a cryptographic PRNG) + * Out: sig: pointer to a 64-byte array where the signature will be placed (cannot be NULL) + * recid: pointer to an int, which will be updated to contain the recovery id (can be NULL) + * Requires starting using SECP256K1_START_SIGN. + */ +SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_sign_compact( + const unsigned char *msg, + int msglen, + unsigned char *sig64, + const unsigned char *seckey, + const unsigned char *nonce, + int *recid +) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(5); + +/** Recover an ECDSA public key from a compact signature. + * Returns: 1: public key successfully recovered (which guarantees a correct signature). + * 0: otherwise. + * In: msg: the message assumed to be signed (cannot be NULL) + * msglen: the length of the message (at most 32) + * sig64: signature as 64 byte array (cannot be NULL) + * compressed: whether to recover a compressed or uncompressed pubkey + * recid: the recovery id (0-3, as returned by ecdsa_sign_compact) + * Out: pubkey: pointer to a 33 or 65 byte array to put the pubkey (cannot be NULL) + * pubkeylen: pointer to an int that will contain the pubkey length (cannot be NULL) + * Requires starting using SECP256K1_START_VERIFY. + */ +SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_recover_compact( + const unsigned char *msg, + int msglen, + const unsigned char *sig64, + unsigned char *pubkey, + int *pubkeylen, + int compressed, + int recid +) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(5); + +/** Verify an ECDSA secret key. + * Returns: 1: secret key is valid + * 0: secret key is invalid + * In: seckey: pointer to a 32-byte secret key (cannot be NULL) + */ +SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_seckey_verify(const unsigned char *seckey) SECP256K1_ARG_NONNULL(1); + +/** Just validate a public key. + * Returns: 1: valid public key + * 0: invalid public key + * In: pubkey: pointer to a 33-byte or 65-byte public key (cannot be NULL). + * pubkeylen: length of pubkey + */ +SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_verify(const unsigned char *pubkey, int pubkeylen) SECP256K1_ARG_NONNULL(1); + +/** Compute the public key for a secret key. + * In: compressed: whether the computed public key should be compressed + * seckey: pointer to a 32-byte private key (cannot be NULL) + * Out: pubkey: pointer to a 33-byte (if compressed) or 65-byte (if uncompressed) + * area to store the public key (cannot be NULL) + * pubkeylen: pointer to int that will be updated to contains the pubkey's + * length (cannot be NULL) + * Returns: 1: secret was valid, public key stores + * 0: secret was invalid, try again. + * Requires starting using SECP256K1_START_SIGN. + */ +SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_create( + unsigned char *pubkey, + int *pubkeylen, + const unsigned char *seckey, + int compressed +) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3); + +/** Decompress a public key. + * In/Out: pubkey: pointer to a 65-byte array to put the decompressed public key. + It must contain a 33-byte or 65-byte public key already (cannot be NULL) + * pubkeylen: pointer to the size of the public key pointed to by pubkey (cannot be NULL) + It will be updated to reflect the new size. + * Returns: 0 if the passed public key was invalid, 1 otherwise. If 1 is returned, the + pubkey is replaced with its decompressed version. + */ +SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_decompress( + unsigned char *pubkey, + int *pubkeylen +) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2); + +/** Export a private key in DER format. */ +SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_export( + const unsigned char *seckey, + unsigned char *privkey, + int *privkeylen, + int compressed +) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3); + +/** Import a private key in DER format. */ +SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_import( + unsigned char *seckey, + const unsigned char *privkey, + int privkeylen +) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2); + +/** Tweak a private key by adding tweak to it. */ +SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_add( + unsigned char *seckey, + const unsigned char *tweak +) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2); + +/** Tweak a public key by adding tweak times the generator to it. + * Requires starting with SECP256K1_START_VERIFY. + */ +SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_add( + unsigned char *pubkey, + int pubkeylen, + const unsigned char *tweak +) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(3); + +/** Tweak a private key by multiplying it with tweak. */ +SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_mul( + unsigned char *seckey, + const unsigned char *tweak +) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2); + +/** Tweak a public key by multiplying it with tweak. + * Requires starting with SECP256K1_START_VERIFY. + */ +SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_mul( + unsigned char *pubkey, + int pubkeylen, + const unsigned char *tweak +) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(3); + +# ifdef __cplusplus +} +# endif + +#endif diff --git a/libsecp256k1.pc.in b/libsecp256k1.pc.in new file mode 100644 index 0000000000..1c72dd0003 --- /dev/null +++ b/libsecp256k1.pc.in @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libsecp256k1 +Description: Optimized C library for EC operations on curve secp256k1 +URL: https://github.com/bitcoin/secp256k1 +Version: @PACKAGE_VERSION@ +Cflags: -I${includedir} +Libs.private: @SECP_LIBS@ +Libs: -L${libdir} -lsecp256k1 + diff --git a/nasm_lt.sh b/nasm_lt.sh new file mode 100755 index 0000000000..6cd73294c0 --- /dev/null +++ b/nasm_lt.sh @@ -0,0 +1,57 @@ +#! /bin/sh +command="" +infile="" +o_opt=no +pic=no +while [ $# -gt 0 ]; do + case "$1" in + -DPIC|-fPIC|-fpic|-Kpic|-KPIC) + if [ "$pic" != "yes" ] ; then + command="$command -DPIC" + pic=yes + fi + ;; + -f|-fbin|-faout|-faoutb|-fcoff|-felf|-felf64|-fas86| \ + -fobj|-fwin32|-fwin64|-frdf|-fieee|-fmacho|-fmacho64) + # it's a file format specifier for nasm. + command="$command $1" + ;; + -f*) + # maybe a code-generation flag for gcc. + ;; + -[Ii]*) + incdir=`echo "$1" | sed 's/^-[Ii]//'` + if [ "x$incdir" = x -a "x$2" != x ] ; then + case "$2" in + -*) ;; + *) incdir="$2"; shift;; + esac + fi + if [ "x$incdir" != x ] ; then + # In the case of NASM, the trailing slash is necessary. + incdir=`echo "$incdir" | sed 's%/*$%/%'` + command="$command -I$incdir" + fi + ;; + -o*) + o_opt=yes + command="$command $1" + ;; + *.asm) + infile=$1 + command="$command $1" + ;; + *) + command="$command $1" + ;; + esac + shift +done +if [ "$o_opt" != yes ] ; then + # By default, NASM creates an output file + # in the same directory as the input file. + outfile="-o `echo $infile | sed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.o" + command="$command $outfile" +fi +echo $command +exec $command diff --git a/obj/.gitignore b/obj/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/bench_inv.c b/src/bench_inv.c new file mode 100644 index 0000000000..d6f664333f --- /dev/null +++ b/src/bench_inv.c @@ -0,0 +1,41 @@ +/********************************************************************** + * Copyright (c) 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ +#include + +#include "include/secp256k1.h" + +#include "util.h" +#include "num_impl.h" +#include "field_impl.h" +#include "group_impl.h" +#include "scalar_impl.h" + +int main(void) { + static const unsigned char init[32] = { + 0x02, 0x03, 0x05, 0x07, 0x0b, 0x0d, 0x11, 0x13, + 0x17, 0x1d, 0x1f, 0x25, 0x29, 0x2b, 0x2f, 0x35, + 0x3b, 0x3d, 0x43, 0x47, 0x49, 0x4f, 0x53, 0x59, + 0x61, 0x65, 0x67, 0x6b, 0x6d, 0x71, 0x7f, 0x83 + }; + static const unsigned char fini[32] = { + 0xba, 0x28, 0x58, 0xd8, 0xaa, 0x11, 0xd6, 0xf2, + 0xfa, 0xce, 0x50, 0xb1, 0x67, 0x19, 0xb1, 0xa6, + 0xe0, 0xaa, 0x84, 0x53, 0xf6, 0x80, 0xfc, 0x23, + 0x88, 0x3c, 0xd6, 0x74, 0x9f, 0x27, 0x09, 0x03 + }; + secp256k1_ge_start(); + secp256k1_scalar_t base, x; + secp256k1_scalar_set_b32(&base, init, NULL); + secp256k1_scalar_set_b32(&x, init, NULL); + for (int i=0; i<1000000; i++) { + secp256k1_scalar_inverse(&x, &x); + secp256k1_scalar_add(&x, &x, &base); + } + unsigned char res[32]; + secp256k1_scalar_get_b32(res, &x); + CHECK(memcmp(res, fini, 32) == 0); + return 0; +} diff --git a/src/bench_sign.c b/src/bench_sign.c new file mode 100644 index 0000000000..f01f11d689 --- /dev/null +++ b/src/bench_sign.c @@ -0,0 +1,49 @@ +/********************************************************************** + * Copyright (c) 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ +#include +#include + +#include "include/secp256k1.h" +#include "util.h" + +int main(void) { + secp256k1_start(SECP256K1_START_SIGN); + + unsigned char msg[32]; + unsigned char nonce[32]; + unsigned char key[32]; + + for (int i = 0; i < 32; i++) msg[i] = i + 1; + for (int i = 0; i < 32; i++) nonce[i] = i + 33; + for (int i = 0; i < 32; i++) key[i] = i + 65; + + unsigned char sig[64]; + + for (int i=0; i<1000000; i++) { + int recid = 0; + CHECK(secp256k1_ecdsa_sign_compact(msg, 32, sig, key, nonce, &recid)); + for (int j = 0; j < 32; j++) { + nonce[j] = key[j]; /* Move former key to nonce */ + msg[j] = sig[j]; /* Move former R to message. */ + key[j] = sig[j + 32]; /* Move former S to key. */ + } + } + + static const unsigned char fini[64] = { + 0x92, 0x03, 0xef, 0xf1, 0x58, 0x0b, 0x49, 0x8d, + 0x22, 0x3d, 0x49, 0x0e, 0xbf, 0x26, 0x50, 0x0e, + 0x2d, 0x62, 0x90, 0xd7, 0x82, 0xbd, 0x3d, 0x5c, + 0xa9, 0x10, 0xa5, 0x49, 0xb1, 0xd8, 0x8c, 0xc0, + 0x5b, 0x5e, 0x9e, 0x68, 0x51, 0x3d, 0xe8, 0xec, + 0x82, 0x30, 0x82, 0x88, 0x8c, 0xfd, 0xe7, 0x71, + 0x15, 0x92, 0xfc, 0x14, 0x59, 0x78, 0x31, 0xb3, + 0xf6, 0x07, 0x91, 0x18, 0x00, 0x8d, 0x4c, 0xb2 + }; + CHECK(memcmp(sig, fini, 64) == 0); + + secp256k1_stop(); + return 0; +} diff --git a/src/bench_verify.c b/src/bench_verify.c new file mode 100644 index 0000000000..690595516d --- /dev/null +++ b/src/bench_verify.c @@ -0,0 +1,44 @@ +/********************************************************************** + * Copyright (c) 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#include +#include + +#include "include/secp256k1.h" +#include "util.h" + +int main(void) { + secp256k1_start(SECP256K1_START_VERIFY); + + unsigned char msg[32]; + unsigned char sig[64]; + + for (int i = 0; i < 32; i++) msg[i] = 1 + i; + for (int i = 0; i < 64; i++) sig[i] = 65 + i; + + unsigned char pubkey[33]; + for (int i=0; i<1000000; i++) { + int pubkeylen = 33; + CHECK(secp256k1_ecdsa_recover_compact(msg, 32, sig, pubkey, &pubkeylen, 1, i % 2)); + for (int j = 0; j < 32; j++) { + sig[j + 32] = msg[j]; /* Move former message to S. */ + msg[j] = sig[j]; /* Move former R to message. */ + sig[j] = pubkey[j + 1]; /* Move recovered pubkey X coordinate to R (which must be a valid X coordinate). */ + } + } + + static const unsigned char fini[33] = { + 0x02, + 0x52, 0x63, 0xae, 0x9a, 0x9d, 0x47, 0x1f, 0x1a, + 0xb2, 0x36, 0x65, 0x89, 0x11, 0xe7, 0xcc, 0x86, + 0xa3, 0xab, 0x97, 0xb6, 0xf1, 0xaf, 0xfd, 0x8f, + 0x9b, 0x38, 0xb6, 0x18, 0x55, 0xe5, 0xc2, 0x43 + }; + CHECK(memcmp(fini, pubkey, 33) == 0); + + secp256k1_stop(); + return 0; +} diff --git a/src/ecdsa.h b/src/ecdsa.h new file mode 100644 index 0000000000..3b1e0484ea --- /dev/null +++ b/src/ecdsa.h @@ -0,0 +1,23 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_ECDSA_ +#define _SECP256K1_ECDSA_ + +#include "num.h" + +typedef struct { + secp256k1_num_t r, s; +} secp256k1_ecdsa_sig_t; + +static int secp256k1_ecdsa_sig_parse(secp256k1_ecdsa_sig_t *r, const unsigned char *sig, int size); +static int secp256k1_ecdsa_sig_serialize(unsigned char *sig, int *size, const secp256k1_ecdsa_sig_t *a); +static int secp256k1_ecdsa_sig_verify(const secp256k1_ecdsa_sig_t *sig, const secp256k1_ge_t *pubkey, const secp256k1_num_t *message); +static int secp256k1_ecdsa_sig_sign(secp256k1_ecdsa_sig_t *sig, const secp256k1_scalar_t *seckey, const secp256k1_scalar_t *message, const secp256k1_scalar_t *nonce, int *recid); +static int secp256k1_ecdsa_sig_recover(const secp256k1_ecdsa_sig_t *sig, secp256k1_ge_t *pubkey, const secp256k1_num_t *message, int recid); +static void secp256k1_ecdsa_sig_set_rs(secp256k1_ecdsa_sig_t *sig, const secp256k1_num_t *r, const secp256k1_num_t *s); + +#endif diff --git a/src/ecdsa_impl.h b/src/ecdsa_impl.h new file mode 100644 index 0000000000..4c05ec39f8 --- /dev/null +++ b/src/ecdsa_impl.h @@ -0,0 +1,183 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + + +#ifndef _SECP256K1_ECDSA_IMPL_H_ +#define _SECP256K1_ECDSA_IMPL_H_ + +#include "num.h" +#include "field.h" +#include "group.h" +#include "ecmult.h" +#include "ecmult_gen.h" +#include "ecdsa.h" + +static int secp256k1_ecdsa_sig_parse(secp256k1_ecdsa_sig_t *r, const unsigned char *sig, int size) { + if (sig[0] != 0x30) return 0; + int lenr = sig[3]; + if (5+lenr >= size) return 0; + int lens = sig[lenr+5]; + if (sig[1] != lenr+lens+4) return 0; + if (lenr+lens+6 > size) return 0; + if (sig[2] != 0x02) return 0; + if (lenr == 0) return 0; + if (sig[lenr+4] != 0x02) return 0; + if (lens == 0) return 0; + secp256k1_num_set_bin(&r->r, sig+4, lenr); + secp256k1_num_set_bin(&r->s, sig+6+lenr, lens); + return 1; +} + +static int secp256k1_ecdsa_sig_serialize(unsigned char *sig, int *size, const secp256k1_ecdsa_sig_t *a) { + int lenR = (secp256k1_num_bits(&a->r) + 7)/8; + if (lenR == 0 || secp256k1_num_get_bit(&a->r, lenR*8-1)) + lenR++; + int lenS = (secp256k1_num_bits(&a->s) + 7)/8; + if (lenS == 0 || secp256k1_num_get_bit(&a->s, lenS*8-1)) + lenS++; + if (*size < 6+lenS+lenR) + return 0; + *size = 6 + lenS + lenR; + sig[0] = 0x30; + sig[1] = 4 + lenS + lenR; + sig[2] = 0x02; + sig[3] = lenR; + secp256k1_num_get_bin(sig+4, lenR, &a->r); + sig[4+lenR] = 0x02; + sig[5+lenR] = lenS; + secp256k1_num_get_bin(sig+lenR+6, lenS, &a->s); + return 1; +} + +static int secp256k1_ecdsa_sig_recompute(secp256k1_num_t *r2, const secp256k1_ecdsa_sig_t *sig, const secp256k1_ge_t *pubkey, const secp256k1_num_t *message) { + const secp256k1_ge_consts_t *c = secp256k1_ge_consts; + + if (secp256k1_num_is_neg(&sig->r) || secp256k1_num_is_neg(&sig->s)) + return 0; + if (secp256k1_num_is_zero(&sig->r) || secp256k1_num_is_zero(&sig->s)) + return 0; + if (secp256k1_num_cmp(&sig->r, &c->order) >= 0 || secp256k1_num_cmp(&sig->s, &c->order) >= 0) + return 0; + + int ret = 0; + secp256k1_num_t sn, u1, u2; + secp256k1_num_init(&sn); + secp256k1_num_init(&u1); + secp256k1_num_init(&u2); + secp256k1_num_mod_inverse(&sn, &sig->s, &c->order); + secp256k1_num_mod_mul(&u1, &sn, message, &c->order); + secp256k1_num_mod_mul(&u2, &sn, &sig->r, &c->order); + secp256k1_gej_t pubkeyj; secp256k1_gej_set_ge(&pubkeyj, pubkey); + secp256k1_gej_t pr; secp256k1_ecmult(&pr, &pubkeyj, &u2, &u1); + if (!secp256k1_gej_is_infinity(&pr)) { + secp256k1_fe_t xr; secp256k1_gej_get_x_var(&xr, &pr); + secp256k1_fe_normalize(&xr); + unsigned char xrb[32]; secp256k1_fe_get_b32(xrb, &xr); + secp256k1_num_set_bin(r2, xrb, 32); + secp256k1_num_mod(r2, &c->order); + ret = 1; + } + secp256k1_num_free(&sn); + secp256k1_num_free(&u1); + secp256k1_num_free(&u2); + return ret; +} + +static int secp256k1_ecdsa_sig_recover(const secp256k1_ecdsa_sig_t *sig, secp256k1_ge_t *pubkey, const secp256k1_num_t *message, int recid) { + const secp256k1_ge_consts_t *c = secp256k1_ge_consts; + + if (secp256k1_num_is_neg(&sig->r) || secp256k1_num_is_neg(&sig->s)) + return 0; + if (secp256k1_num_is_zero(&sig->r) || secp256k1_num_is_zero(&sig->s)) + return 0; + if (secp256k1_num_cmp(&sig->r, &c->order) >= 0 || secp256k1_num_cmp(&sig->s, &c->order) >= 0) + return 0; + + secp256k1_num_t rx; + secp256k1_num_init(&rx); + secp256k1_num_copy(&rx, &sig->r); + if (recid & 2) { + secp256k1_num_add(&rx, &rx, &c->order); + if (secp256k1_num_cmp(&rx, &secp256k1_fe_consts->p) >= 0) + return 0; + } + unsigned char brx[32]; + secp256k1_num_get_bin(brx, 32, &rx); + secp256k1_num_free(&rx); + secp256k1_fe_t fx; + secp256k1_fe_set_b32(&fx, brx); + secp256k1_ge_t x; + if (!secp256k1_ge_set_xo(&x, &fx, recid & 1)) + return 0; + secp256k1_gej_t xj; + secp256k1_gej_set_ge(&xj, &x); + secp256k1_num_t rn, u1, u2; + secp256k1_num_init(&rn); + secp256k1_num_init(&u1); + secp256k1_num_init(&u2); + secp256k1_num_mod_inverse(&rn, &sig->r, &c->order); + secp256k1_num_mod_mul(&u1, &rn, message, &c->order); + secp256k1_num_sub(&u1, &c->order, &u1); + secp256k1_num_mod_mul(&u2, &rn, &sig->s, &c->order); + secp256k1_gej_t qj; + secp256k1_ecmult(&qj, &xj, &u2, &u1); + secp256k1_ge_set_gej_var(pubkey, &qj); + secp256k1_num_free(&rn); + secp256k1_num_free(&u1); + secp256k1_num_free(&u2); + return !secp256k1_gej_is_infinity(&qj); +} + +static int secp256k1_ecdsa_sig_verify(const secp256k1_ecdsa_sig_t *sig, const secp256k1_ge_t *pubkey, const secp256k1_num_t *message) { + secp256k1_num_t r2; + secp256k1_num_init(&r2); + int ret = 0; + ret = secp256k1_ecdsa_sig_recompute(&r2, sig, pubkey, message) && secp256k1_num_cmp(&sig->r, &r2) == 0; + secp256k1_num_free(&r2); + return ret; +} + +static int secp256k1_ecdsa_sig_sign(secp256k1_ecdsa_sig_t *sig, const secp256k1_scalar_t *seckey, const secp256k1_scalar_t *message, const secp256k1_scalar_t *nonce, int *recid) { + secp256k1_gej_t rp; + secp256k1_ecmult_gen(&rp, nonce); + secp256k1_ge_t r; + secp256k1_ge_set_gej(&r, &rp); + unsigned char b[32]; + secp256k1_fe_normalize(&r.x); + secp256k1_fe_normalize(&r.y); + secp256k1_fe_get_b32(b, &r.x); + int overflow = 0; + secp256k1_scalar_t sigr; + secp256k1_scalar_set_b32(&sigr, b, &overflow); + if (recid) + *recid = (overflow ? 2 : 0) | (secp256k1_fe_is_odd(&r.y) ? 1 : 0); + secp256k1_scalar_t n; + secp256k1_scalar_mul(&n, &sigr, seckey); + secp256k1_scalar_add(&n, &n, message); + secp256k1_scalar_t sigs; + secp256k1_scalar_inverse(&sigs, nonce); + secp256k1_scalar_mul(&sigs, &sigs, &n); + secp256k1_scalar_clear(&n); + secp256k1_gej_clear(&rp); + secp256k1_ge_clear(&r); + if (secp256k1_scalar_is_zero(&sigs)) + return 0; + if (secp256k1_scalar_is_high(&sigs)) { + secp256k1_scalar_negate(&sigs, &sigs); + if (recid) + *recid ^= 1; + } + secp256k1_scalar_get_num(&sig->s, &sigs); + secp256k1_scalar_get_num(&sig->r, &sigr); + return 1; +} + +static void secp256k1_ecdsa_sig_set_rs(secp256k1_ecdsa_sig_t *sig, const secp256k1_num_t *r, const secp256k1_num_t *s) { + secp256k1_num_copy(&sig->r, r); + secp256k1_num_copy(&sig->s, s); +} + +#endif diff --git a/src/eckey.h b/src/eckey.h new file mode 100644 index 0000000000..024c8b821b --- /dev/null +++ b/src/eckey.h @@ -0,0 +1,25 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_ECKEY_ +#define _SECP256K1_ECKEY_ + +#include "group.h" +#include "scalar.h" +#include "num.h" + +static int secp256k1_eckey_pubkey_parse(secp256k1_ge_t *elem, const unsigned char *pub, int size); +static int secp256k1_eckey_pubkey_serialize(secp256k1_ge_t *elem, unsigned char *pub, int *size, int compressed); + +static int secp256k1_eckey_privkey_parse(secp256k1_scalar_t *key, const unsigned char *privkey, int privkeylen); +static int secp256k1_eckey_privkey_serialize(unsigned char *privkey, int *privkeylen, const secp256k1_scalar_t *key, int compressed); + +static int secp256k1_eckey_privkey_tweak_add(secp256k1_scalar_t *key, const secp256k1_scalar_t *tweak); +static int secp256k1_eckey_pubkey_tweak_add(secp256k1_ge_t *key, const secp256k1_num_t *tweak); +static int secp256k1_eckey_privkey_tweak_mul(secp256k1_scalar_t *key, const secp256k1_scalar_t *tweak); +static int secp256k1_eckey_pubkey_tweak_mul(secp256k1_ge_t *key, const secp256k1_num_t *tweak); + +#endif diff --git a/src/eckey_impl.h b/src/eckey_impl.h new file mode 100644 index 0000000000..290b1f0900 --- /dev/null +++ b/src/eckey_impl.h @@ -0,0 +1,200 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_ECKEY_IMPL_H_ +#define _SECP256K1_ECKEY_IMPL_H_ + +#include "eckey.h" + +#include "num.h" +#include "field.h" +#include "group.h" +#include "ecmult_gen.h" + +static int secp256k1_eckey_pubkey_parse(secp256k1_ge_t *elem, const unsigned char *pub, int size) { + if (size == 33 && (pub[0] == 0x02 || pub[0] == 0x03)) { + secp256k1_fe_t x; + secp256k1_fe_set_b32(&x, pub+1); + return secp256k1_ge_set_xo(elem, &x, pub[0] == 0x03); + } else if (size == 65 && (pub[0] == 0x04 || pub[0] == 0x06 || pub[0] == 0x07)) { + secp256k1_fe_t x, y; + secp256k1_fe_set_b32(&x, pub+1); + secp256k1_fe_set_b32(&y, pub+33); + secp256k1_ge_set_xy(elem, &x, &y); + if ((pub[0] == 0x06 || pub[0] == 0x07) && secp256k1_fe_is_odd(&y) != (pub[0] == 0x07)) + return 0; + return secp256k1_ge_is_valid(elem); + } else { + return 0; + } +} + +static int secp256k1_eckey_pubkey_serialize(secp256k1_ge_t *elem, unsigned char *pub, int *size, int compressed) { + if (secp256k1_ge_is_infinity(elem)) { + return 0; + } + secp256k1_fe_normalize(&elem->x); + secp256k1_fe_normalize(&elem->y); + secp256k1_fe_get_b32(&pub[1], &elem->x); + if (compressed) { + *size = 33; + pub[0] = 0x02 | (secp256k1_fe_is_odd(&elem->y) ? 0x01 : 0x00); + } else { + *size = 65; + pub[0] = 0x04; + secp256k1_fe_get_b32(&pub[33], &elem->y); + } + return 1; +} + +static int secp256k1_eckey_privkey_parse(secp256k1_scalar_t *key, const unsigned char *privkey, int privkeylen) { + const unsigned char *end = privkey + privkeylen; + /* sequence header */ + if (end < privkey+1 || *privkey != 0x30) + return 0; + privkey++; + /* sequence length constructor */ + int lenb = 0; + if (end < privkey+1 || !(*privkey & 0x80)) + return 0; + lenb = *privkey & ~0x80; privkey++; + if (lenb < 1 || lenb > 2) + return 0; + if (end < privkey+lenb) + return 0; + /* sequence length */ + int len = 0; + len = privkey[lenb-1] | (lenb > 1 ? privkey[lenb-2] << 8 : 0); + privkey += lenb; + if (end < privkey+len) + return 0; + /* sequence element 0: version number (=1) */ + if (end < privkey+3 || privkey[0] != 0x02 || privkey[1] != 0x01 || privkey[2] != 0x01) + return 0; + privkey += 3; + /* sequence element 1: octet string, up to 32 bytes */ + if (end < privkey+2 || privkey[0] != 0x04 || privkey[1] > 0x20 || end < privkey+2+privkey[1]) + return 0; + int overflow = 0; + unsigned char c[32] = {0}; + memcpy(c + 32 - privkey[1], privkey + 2, privkey[1]); + secp256k1_scalar_set_b32(key, c, &overflow); + memset(c, 0, 32); + return !overflow; +} + +static int secp256k1_eckey_privkey_serialize(unsigned char *privkey, int *privkeylen, const secp256k1_scalar_t *key, int compressed) { + secp256k1_gej_t rp; + secp256k1_ecmult_gen(&rp, key); + secp256k1_ge_t r; + secp256k1_ge_set_gej(&r, &rp); + if (compressed) { + static const unsigned char begin[] = { + 0x30,0x81,0xD3,0x02,0x01,0x01,0x04,0x20 + }; + static const unsigned char middle[] = { + 0xA0,0x81,0x85,0x30,0x81,0x82,0x02,0x01,0x01,0x30,0x2C,0x06,0x07,0x2A,0x86,0x48, + 0xCE,0x3D,0x01,0x01,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFE,0xFF,0xFF,0xFC,0x2F,0x30,0x06,0x04,0x01,0x00,0x04,0x01,0x07,0x04, + 0x21,0x02,0x79,0xBE,0x66,0x7E,0xF9,0xDC,0xBB,0xAC,0x55,0xA0,0x62,0x95,0xCE,0x87, + 0x0B,0x07,0x02,0x9B,0xFC,0xDB,0x2D,0xCE,0x28,0xD9,0x59,0xF2,0x81,0x5B,0x16,0xF8, + 0x17,0x98,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFE,0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B,0xBF,0xD2,0x5E, + 0x8C,0xD0,0x36,0x41,0x41,0x02,0x01,0x01,0xA1,0x24,0x03,0x22,0x00 + }; + unsigned char *ptr = privkey; + memcpy(ptr, begin, sizeof(begin)); ptr += sizeof(begin); + secp256k1_scalar_get_b32(ptr, key); ptr += 32; + memcpy(ptr, middle, sizeof(middle)); ptr += sizeof(middle); + int pubkeylen = 0; + if (!secp256k1_eckey_pubkey_serialize(&r, ptr, &pubkeylen, 1)) { + return 0; + } + ptr += pubkeylen; + *privkeylen = ptr - privkey; + } else { + static const unsigned char begin[] = { + 0x30,0x82,0x01,0x13,0x02,0x01,0x01,0x04,0x20 + }; + static const unsigned char middle[] = { + 0xA0,0x81,0xA5,0x30,0x81,0xA2,0x02,0x01,0x01,0x30,0x2C,0x06,0x07,0x2A,0x86,0x48, + 0xCE,0x3D,0x01,0x01,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFE,0xFF,0xFF,0xFC,0x2F,0x30,0x06,0x04,0x01,0x00,0x04,0x01,0x07,0x04, + 0x41,0x04,0x79,0xBE,0x66,0x7E,0xF9,0xDC,0xBB,0xAC,0x55,0xA0,0x62,0x95,0xCE,0x87, + 0x0B,0x07,0x02,0x9B,0xFC,0xDB,0x2D,0xCE,0x28,0xD9,0x59,0xF2,0x81,0x5B,0x16,0xF8, + 0x17,0x98,0x48,0x3A,0xDA,0x77,0x26,0xA3,0xC4,0x65,0x5D,0xA4,0xFB,0xFC,0x0E,0x11, + 0x08,0xA8,0xFD,0x17,0xB4,0x48,0xA6,0x85,0x54,0x19,0x9C,0x47,0xD0,0x8F,0xFB,0x10, + 0xD4,0xB8,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFE,0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B,0xBF,0xD2,0x5E, + 0x8C,0xD0,0x36,0x41,0x41,0x02,0x01,0x01,0xA1,0x44,0x03,0x42,0x00 + }; + unsigned char *ptr = privkey; + memcpy(ptr, begin, sizeof(begin)); ptr += sizeof(begin); + secp256k1_scalar_get_b32(ptr, key); ptr += 32; + memcpy(ptr, middle, sizeof(middle)); ptr += sizeof(middle); + int pubkeylen = 0; + if (!secp256k1_eckey_pubkey_serialize(&r, ptr, &pubkeylen, 0)) { + return 0; + } + ptr += pubkeylen; + *privkeylen = ptr - privkey; + } + return 1; +} + +static int secp256k1_eckey_privkey_tweak_add(secp256k1_scalar_t *key, const secp256k1_scalar_t *tweak) { + secp256k1_scalar_add(key, key, tweak); + if (secp256k1_scalar_is_zero(key)) + return 0; + return 1; +} + +static int secp256k1_eckey_pubkey_tweak_add(secp256k1_ge_t *key, const secp256k1_num_t *tweak) { + if (secp256k1_num_cmp(tweak, &secp256k1_ge_consts->order) >= 0) + return 0; + + secp256k1_gej_t pt; + secp256k1_gej_set_ge(&pt, key); + secp256k1_num_t one; + secp256k1_num_init(&one); + secp256k1_num_set_int(&one, 1); + secp256k1_ecmult(&pt, &pt, &one, tweak); + secp256k1_num_free(&one); + + if (secp256k1_gej_is_infinity(&pt)) + return 0; + secp256k1_ge_set_gej(key, &pt); + return 1; +} + +static int secp256k1_eckey_privkey_tweak_mul(secp256k1_scalar_t *key, const secp256k1_scalar_t *tweak) { + if (secp256k1_scalar_is_zero(tweak)) + return 0; + + secp256k1_scalar_mul(key, key, tweak); + return 1; +} + +static int secp256k1_eckey_pubkey_tweak_mul(secp256k1_ge_t *key, const secp256k1_num_t *tweak) { + if (secp256k1_num_is_zero(tweak)) + return 0; + if (secp256k1_num_cmp(tweak, &secp256k1_ge_consts->order) >= 0) + return 0; + + secp256k1_num_t zero; + secp256k1_num_init(&zero); + secp256k1_num_set_int(&zero, 0); + secp256k1_gej_t pt; + secp256k1_gej_set_ge(&pt, key); + secp256k1_ecmult(&pt, &pt, tweak, &zero); + secp256k1_num_free(&zero); + secp256k1_ge_set_gej(key, &pt); + return 1; +} + +#endif diff --git a/src/ecmult.h b/src/ecmult.h new file mode 100644 index 0000000000..e3cf18b680 --- /dev/null +++ b/src/ecmult.h @@ -0,0 +1,19 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_ECMULT_ +#define _SECP256K1_ECMULT_ + +#include "num.h" +#include "group.h" + +static void secp256k1_ecmult_start(void); +static void secp256k1_ecmult_stop(void); + +/** Double multiply: R = na*A + ng*G */ +static void secp256k1_ecmult(secp256k1_gej_t *r, const secp256k1_gej_t *a, const secp256k1_num_t *na, const secp256k1_num_t *ng); + +#endif diff --git a/src/ecmult_gen.h b/src/ecmult_gen.h new file mode 100644 index 0000000000..42f822f9ce --- /dev/null +++ b/src/ecmult_gen.h @@ -0,0 +1,19 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_ECMULT_GEN_ +#define _SECP256K1_ECMULT_GEN_ + +#include "scalar.h" +#include "group.h" + +static void secp256k1_ecmult_gen_start(void); +static void secp256k1_ecmult_gen_stop(void); + +/** Multiply with the generator: R = a*G */ +static void secp256k1_ecmult_gen(secp256k1_gej_t *r, const secp256k1_scalar_t *a); + +#endif diff --git a/src/ecmult_gen_impl.h b/src/ecmult_gen_impl.h new file mode 100644 index 0000000000..07859ab04b --- /dev/null +++ b/src/ecmult_gen_impl.h @@ -0,0 +1,118 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_ECMULT_GEN_IMPL_H_ +#define _SECP256K1_ECMULT_GEN_IMPL_H_ + +#include "scalar.h" +#include "group.h" +#include "ecmult_gen.h" + +typedef struct { + /* For accelerating the computation of a*G: + * To harden against timing attacks, use the following mechanism: + * * Break up the multiplicand into groups of 4 bits, called n_0, n_1, n_2, ..., n_63. + * * Compute sum(n_i * 16^i * G + U_i, i=0..63), where: + * * U_i = U * 2^i (for i=0..62) + * * U_i = U * (1-2^63) (for i=63) + * where U is a point with no known corresponding scalar. Note that sum(U_i, i=0..63) = 0. + * For each i, and each of the 16 possible values of n_i, (n_i * 16^i * G + U_i) is + * precomputed (call it prec(i, n_i)). The formula now becomes sum(prec(i, n_i), i=0..63). + * None of the resulting prec group elements have a known scalar, and neither do any of + * the intermediate sums while computing a*G. + * To make memory access uniform, the bytes of prec(i, n_i) are sliced per value of n_i. */ + unsigned char prec[64][sizeof(secp256k1_ge_t)][16]; /* prec[j][k][i] = k'th byte of (16^j * i * G + U_i) */ +} secp256k1_ecmult_gen_consts_t; + +static const secp256k1_ecmult_gen_consts_t *secp256k1_ecmult_gen_consts = NULL; + +static void secp256k1_ecmult_gen_start(void) { + if (secp256k1_ecmult_gen_consts != NULL) + return; + + /* Allocate the precomputation table. */ + secp256k1_ecmult_gen_consts_t *ret = (secp256k1_ecmult_gen_consts_t*)malloc(sizeof(secp256k1_ecmult_gen_consts_t)); + + /* get the generator */ + const secp256k1_ge_t *g = &secp256k1_ge_consts->g; + secp256k1_gej_t gj; secp256k1_gej_set_ge(&gj, g); + + /* Construct a group element with no known corresponding scalar (nothing up my sleeve). */ + secp256k1_gej_t nums_gej; + { + static const unsigned char nums_b32[32] = "The scalar for this x is unknown"; + secp256k1_fe_t nums_x; + secp256k1_fe_set_b32(&nums_x, nums_b32); + secp256k1_ge_t nums_ge; + VERIFY_CHECK(secp256k1_ge_set_xo(&nums_ge, &nums_x, 0)); + secp256k1_gej_set_ge(&nums_gej, &nums_ge); + /* Add G to make the bits in x uniformly distributed. */ + secp256k1_gej_add_ge_var(&nums_gej, &nums_gej, g); + } + + /* compute prec. */ + secp256k1_ge_t prec[1024]; + { + secp256k1_gej_t precj[1024]; /* Jacobian versions of prec. */ + secp256k1_gej_t gbase; gbase = gj; /* 16^j * G */ + secp256k1_gej_t numsbase; numsbase = nums_gej; /* 2^j * nums. */ + for (int j=0; j<64; j++) { + /* Set precj[j*16 .. j*16+15] to (numsbase, numsbase + gbase, ..., numsbase + 15*gbase). */ + precj[j*16] = numsbase; + for (int i=1; i<16; i++) { + secp256k1_gej_add_var(&precj[j*16 + i], &precj[j*16 + i - 1], &gbase); + } + /* Multiply gbase by 16. */ + for (int i=0; i<4; i++) { + secp256k1_gej_double_var(&gbase, &gbase); + } + /* Multiply numbase by 2. */ + secp256k1_gej_double_var(&numsbase, &numsbase); + if (j == 62) { + /* In the last iteration, numsbase is (1 - 2^j) * nums instead. */ + secp256k1_gej_neg(&numsbase, &numsbase); + secp256k1_gej_add_var(&numsbase, &numsbase, &nums_gej); + } + } + secp256k1_ge_set_all_gej_var(1024, prec, precj); + } + for (int j=0; j<64; j++) { + for (int i=0; i<16; i++) { + const unsigned char* raw = (const unsigned char*)(&prec[j*16 + i]); + for (size_t k=0; kprec[j][k][i] = raw[k]; + } + } + + /* Set the global pointer to the precomputation table. */ + secp256k1_ecmult_gen_consts = ret; +} + +static void secp256k1_ecmult_gen_stop(void) { + if (secp256k1_ecmult_gen_consts == NULL) + return; + + secp256k1_ecmult_gen_consts_t *c = (secp256k1_ecmult_gen_consts_t*)secp256k1_ecmult_gen_consts; + secp256k1_ecmult_gen_consts = NULL; + free(c); +} + +static void secp256k1_ecmult_gen(secp256k1_gej_t *r, const secp256k1_scalar_t *gn) { + const secp256k1_ecmult_gen_consts_t *c = secp256k1_ecmult_gen_consts; + secp256k1_gej_set_infinity(r); + secp256k1_ge_t add; + int bits; + for (int j=0; j<64; j++) { + bits = secp256k1_scalar_get_bits(gn, j * 4, 4); + for (size_t k=0; kprec[j][k][bits]; + secp256k1_gej_add_ge(r, r, &add); + } + bits = 0; + secp256k1_ge_clear(&add); +} + +#endif diff --git a/src/ecmult_impl.h b/src/ecmult_impl.h new file mode 100644 index 0000000000..508902564e --- /dev/null +++ b/src/ecmult_impl.h @@ -0,0 +1,222 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_ECMULT_IMPL_H_ +#define _SECP256K1_ECMULT_IMPL_H_ + +#include "num.h" +#include "group.h" +#include "ecmult.h" + +/* optimal for 128-bit and 256-bit exponents. */ +#define WINDOW_A 5 + +/** larger numbers may result in slightly better performance, at the cost of + exponentially larger precomputed tables. WINDOW_G == 14 results in 640 KiB. */ +#define WINDOW_G 14 + +/** Fill a table 'pre' with precomputed odd multiples of a. W determines the size of the table. + * pre will contains the values [1*a,3*a,5*a,...,(2^(w-1)-1)*a], so it needs place for + * 2^(w-2) entries. + * + * There are two versions of this function: + * - secp256k1_ecmult_precomp_wnaf_gej, which operates on group elements in jacobian notation, + * fast to precompute, but slower to use in later additions. + * - secp256k1_ecmult_precomp_wnaf_ge, which operates on group elements in affine notations, + * (much) slower to precompute, but a bit faster to use in later additions. + * To compute a*P + b*G, we use the jacobian version for P, and the affine version for G, as + * G is constant, so it only needs to be done once in advance. + */ +static void secp256k1_ecmult_table_precomp_gej_var(secp256k1_gej_t *pre, const secp256k1_gej_t *a, int w) { + pre[0] = *a; + secp256k1_gej_t d; secp256k1_gej_double_var(&d, &pre[0]); + for (int i=1; i<(1 << (w-2)); i++) + secp256k1_gej_add_var(&pre[i], &d, &pre[i-1]); +} + +static void secp256k1_ecmult_table_precomp_ge_var(secp256k1_ge_t *pre, const secp256k1_gej_t *a, int w) { + const int table_size = 1 << (w-2); + secp256k1_gej_t prej[table_size]; + prej[0] = *a; + secp256k1_gej_t d; secp256k1_gej_double_var(&d, a); + for (int i=1; i= -((1 << ((w)-1)) - 1)); \ + VERIFY_CHECK((n) <= ((1 << ((w)-1)) - 1)); \ + if ((n) > 0) \ + *(r) = (pre)[((n)-1)/2]; \ + else \ + (neg)((r), &(pre)[(-(n)-1)/2]); \ +} while(0) + +#define ECMULT_TABLE_GET_GEJ(r,pre,n,w) ECMULT_TABLE_GET((r),(pre),(n),(w),secp256k1_gej_neg) +#define ECMULT_TABLE_GET_GE(r,pre,n,w) ECMULT_TABLE_GET((r),(pre),(n),(w),secp256k1_ge_neg) + +typedef struct { + /* For accelerating the computation of a*P + b*G: */ + secp256k1_ge_t pre_g[ECMULT_TABLE_SIZE(WINDOW_G)]; /* odd multiples of the generator */ + secp256k1_ge_t pre_g_128[ECMULT_TABLE_SIZE(WINDOW_G)]; /* odd multiples of 2^128*generator */ +} secp256k1_ecmult_consts_t; + +static const secp256k1_ecmult_consts_t *secp256k1_ecmult_consts = NULL; + +static void secp256k1_ecmult_start(void) { + if (secp256k1_ecmult_consts != NULL) + return; + + /* Allocate the precomputation table. */ + secp256k1_ecmult_consts_t *ret = (secp256k1_ecmult_consts_t*)malloc(sizeof(secp256k1_ecmult_consts_t)); + + /* get the generator */ + const secp256k1_ge_t *g = &secp256k1_ge_consts->g; + secp256k1_gej_t gj; secp256k1_gej_set_ge(&gj, g); + + /* calculate 2^128*generator */ + secp256k1_gej_t g_128j = gj; + for (int i=0; i<128; i++) + secp256k1_gej_double_var(&g_128j, &g_128j); + + /* precompute the tables with odd multiples */ + secp256k1_ecmult_table_precomp_ge_var(ret->pre_g, &gj, WINDOW_G); + secp256k1_ecmult_table_precomp_ge_var(ret->pre_g_128, &g_128j, WINDOW_G); + + /* Set the global pointer to the precomputation table. */ + secp256k1_ecmult_consts = ret; +} + +static void secp256k1_ecmult_stop(void) { + if (secp256k1_ecmult_consts == NULL) + return; + + secp256k1_ecmult_consts_t *c = (secp256k1_ecmult_consts_t*)secp256k1_ecmult_consts; + secp256k1_ecmult_consts = NULL; + free(c); +} + +/** Convert a number to WNAF notation. The number becomes represented by sum(2^i * wnaf[i], i=0..bits), + * with the following guarantees: + * - each wnaf[i] is either 0, or an odd integer between -(1<<(w-1) - 1) and (1<<(w-1) - 1) + * - two non-zero entries in wnaf are separated by at least w-1 zeroes. + * - the index of the highest non-zero entry in wnaf (=return value-1) is at most bits, where + * bits is the number of bits necessary to represent the absolute value of the input. + */ +static int secp256k1_ecmult_wnaf(int *wnaf, const secp256k1_num_t *a, int w) { + int ret = 0; + int zeroes = 0; + secp256k1_num_t x; + secp256k1_num_copy(&x, a); + int sign = 1; + if (secp256k1_num_is_neg(&x)) { + sign = -1; + secp256k1_num_negate(&x); + } + while (!secp256k1_num_is_zero(&x)) { + while (!secp256k1_num_is_odd(&x)) { + zeroes++; + secp256k1_num_shift(&x, 1); + } + int word = secp256k1_num_shift(&x, w); + while (zeroes) { + wnaf[ret++] = 0; + zeroes--; + } + if (word & (1 << (w-1))) { + secp256k1_num_inc(&x); + wnaf[ret++] = sign * (word - (1 << w)); + } else { + wnaf[ret++] = sign * word; + } + zeroes = w-1; + } + return ret; +} + +static void secp256k1_ecmult(secp256k1_gej_t *r, const secp256k1_gej_t *a, const secp256k1_num_t *na, const secp256k1_num_t *ng) { + const secp256k1_ecmult_consts_t *c = secp256k1_ecmult_consts; + +#ifdef USE_ENDOMORPHISM + secp256k1_num_t na_1, na_lam; + /* split na into na_1 and na_lam (where na = na_1 + na_lam*lambda, and na_1 and na_lam are ~128 bit) */ + secp256k1_gej_split_exp_var(&na_1, &na_lam, na); + + /* build wnaf representation for na_1 and na_lam. */ + int wnaf_na_1[129]; int bits_na_1 = secp256k1_ecmult_wnaf(wnaf_na_1, &na_1, WINDOW_A); + int wnaf_na_lam[129]; int bits_na_lam = secp256k1_ecmult_wnaf(wnaf_na_lam, &na_lam, WINDOW_A); + int bits = bits_na_1; + if (bits_na_lam > bits) bits = bits_na_lam; +#else + /* build wnaf representation for na. */ + int wnaf_na[257]; int bits_na = secp256k1_ecmult_wnaf(wnaf_na, na, WINDOW_A); + int bits = bits_na; +#endif + + /* calculate odd multiples of a */ + secp256k1_gej_t pre_a[ECMULT_TABLE_SIZE(WINDOW_A)]; + secp256k1_ecmult_table_precomp_gej_var(pre_a, a, WINDOW_A); + +#ifdef USE_ENDOMORPHISM + secp256k1_gej_t pre_a_lam[ECMULT_TABLE_SIZE(WINDOW_A)]; + for (int i=0; i bits) bits = bits_ng_1; + if (bits_ng_128 > bits) bits = bits_ng_128; + + secp256k1_gej_set_infinity(r); + secp256k1_gej_t tmpj; + secp256k1_ge_t tmpa; + + for (int i=bits-1; i>=0; i--) { + secp256k1_gej_double_var(r, r); + int n; +#ifdef USE_ENDOMORPHISM + if (i < bits_na_1 && (n = wnaf_na_1[i])) { + ECMULT_TABLE_GET_GEJ(&tmpj, pre_a, n, WINDOW_A); + secp256k1_gej_add_var(r, r, &tmpj); + } + if (i < bits_na_lam && (n = wnaf_na_lam[i])) { + ECMULT_TABLE_GET_GEJ(&tmpj, pre_a_lam, n, WINDOW_A); + secp256k1_gej_add_var(r, r, &tmpj); + } +#else + if (i < bits_na && (n = wnaf_na[i])) { + ECMULT_TABLE_GET_GEJ(&tmpj, pre_a, n, WINDOW_A); + secp256k1_gej_add_var(r, r, &tmpj); + } +#endif + if (i < bits_ng_1 && (n = wnaf_ng_1[i])) { + ECMULT_TABLE_GET_GE(&tmpa, c->pre_g, n, WINDOW_G); + secp256k1_gej_add_ge_var(r, r, &tmpa); + } + if (i < bits_ng_128 && (n = wnaf_ng_128[i])) { + ECMULT_TABLE_GET_GE(&tmpa, c->pre_g_128, n, WINDOW_G); + secp256k1_gej_add_ge_var(r, r, &tmpa); + } + } +} + +#endif diff --git a/src/field.h b/src/field.h new file mode 100644 index 0000000000..c7feead900 --- /dev/null +++ b/src/field.h @@ -0,0 +1,114 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_FIELD_ +#define _SECP256K1_FIELD_ + +/** Field element module. + * + * Field elements can be represented in several ways, but code accessing + * it (and implementations) need to take certain properaties into account: + * - Each field element can be normalized or not. + * - Each field element has a magnitude, which represents how far away + * its representation is away from normalization. Normalized elements + * always have a magnitude of 1, but a magnitude of 1 doesn't imply + * normality. + */ + +#if defined HAVE_CONFIG_H +#include "libsecp256k1-config.h" +#endif + +#if defined(USE_FIELD_GMP) +#include "field_gmp.h" +#elif defined(USE_FIELD_10X26) +#include "field_10x26.h" +#elif defined(USE_FIELD_5X52) +#include "field_5x52.h" +#else +#error "Please select field implementation" +#endif + +typedef struct { + secp256k1_num_t p; +} secp256k1_fe_consts_t; + +static const secp256k1_fe_consts_t *secp256k1_fe_consts = NULL; + +/** Initialize field element precomputation data. */ +static void secp256k1_fe_start(void); + +/** Unload field element precomputation data. */ +static void secp256k1_fe_stop(void); + +/** Normalize a field element. */ +static void secp256k1_fe_normalize(secp256k1_fe_t *r); + +/** Set a field element equal to a small integer. Resulting field element is normalized. */ +static void secp256k1_fe_set_int(secp256k1_fe_t *r, int a); + +/** Verify whether a field element is zero. Requires the input to be normalized. */ +static int secp256k1_fe_is_zero(const secp256k1_fe_t *a); + +/** Check the "oddness" of a field element. Requires the input to be normalized. */ +static int secp256k1_fe_is_odd(const secp256k1_fe_t *a); + +/** Compare two field elements. Requires both inputs to be normalized */ +static int secp256k1_fe_equal(const secp256k1_fe_t *a, const secp256k1_fe_t *b); + +/** Set a field element equal to 32-byte big endian value. Resulting field element is normalized. */ +static void secp256k1_fe_set_b32(secp256k1_fe_t *r, const unsigned char *a); + +/** Convert a field element to a 32-byte big endian value. Requires the input to be normalized */ +static void secp256k1_fe_get_b32(unsigned char *r, const secp256k1_fe_t *a); + +/** Set a field element equal to the additive inverse of another. Takes a maximum magnitude of the input + * as an argument. The magnitude of the output is one higher. */ +static void secp256k1_fe_negate(secp256k1_fe_t *r, const secp256k1_fe_t *a, int m); + +/** Multiplies the passed field element with a small integer constant. Multiplies the magnitude by that + * small integer. */ +static void secp256k1_fe_mul_int(secp256k1_fe_t *r, int a); + +/** Adds a field element to another. The result has the sum of the inputs' magnitudes as magnitude. */ +static void secp256k1_fe_add(secp256k1_fe_t *r, const secp256k1_fe_t *a); + +/** Sets a field element to be the product of two others. Requires the inputs' magnitudes to be at most 8. + * The output magnitude is 1 (but not guaranteed to be normalized). */ +static void secp256k1_fe_mul(secp256k1_fe_t *r, const secp256k1_fe_t *a, const secp256k1_fe_t *b); + +/** Sets a field element to be the square of another. Requires the input's magnitude to be at most 8. + * The output magnitude is 1 (but not guaranteed to be normalized). */ +static void secp256k1_fe_sqr(secp256k1_fe_t *r, const secp256k1_fe_t *a); + +/** Sets a field element to be the (modular) square root (if any exist) of another. Requires the + * input's magnitude to be at most 8. The output magnitude is 1 (but not guaranteed to be + * normalized). Return value indicates whether a square root was found. */ +static int secp256k1_fe_sqrt(secp256k1_fe_t *r, const secp256k1_fe_t *a); + +/** Sets a field element to be the (modular) inverse of another. Requires the input's magnitude to be + * at most 8. The output magnitude is 1 (but not guaranteed to be normalized). */ +static void secp256k1_fe_inv(secp256k1_fe_t *r, const secp256k1_fe_t *a); + +/** Potentially faster version of secp256k1_fe_inv, without constant-time guarantee. */ +static void secp256k1_fe_inv_var(secp256k1_fe_t *r, const secp256k1_fe_t *a); + +/** Calculate the (modular) inverses of a batch of field elements. Requires the inputs' magnitudes to be + * at most 8. The output magnitudes are 1 (but not guaranteed to be normalized). The inputs and + * outputs must not overlap in memory. */ +static void secp256k1_fe_inv_all(size_t len, secp256k1_fe_t r[len], const secp256k1_fe_t a[len]); + +/** Potentially faster version of secp256k1_fe_inv_all, without constant-time guarantee. */ +static void secp256k1_fe_inv_all_var(size_t len, secp256k1_fe_t r[len], const secp256k1_fe_t a[len]); + + +/** Convert a field element to a hexadecimal string. */ +static void secp256k1_fe_get_hex(char *r, int *rlen, const secp256k1_fe_t *a); + +/** Convert a hexadecimal string to a field element. */ +static void secp256k1_fe_set_hex(secp256k1_fe_t *r, const char *a, int alen); + +#endif diff --git a/src/field_10x26.h b/src/field_10x26.h new file mode 100644 index 0000000000..66fb3f2563 --- /dev/null +++ b/src/field_10x26.h @@ -0,0 +1,21 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_FIELD_REPR_ +#define _SECP256K1_FIELD_REPR_ + +#include + +typedef struct { + /* X = sum(i=0..9, elem[i]*2^26) mod n */ + uint32_t n[10]; +#ifdef VERIFY + int magnitude; + int normalized; +#endif +} secp256k1_fe_t; + +#endif diff --git a/src/field_10x26_impl.h b/src/field_10x26_impl.h new file mode 100644 index 0000000000..c0f1be0b2d --- /dev/null +++ b/src/field_10x26_impl.h @@ -0,0 +1,884 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_FIELD_REPR_IMPL_H_ +#define _SECP256K1_FIELD_REPR_IMPL_H_ + +#include +#include +#include "util.h" +#include "num.h" +#include "field.h" + +static void secp256k1_fe_inner_start(void) {} +static void secp256k1_fe_inner_stop(void) {} + +#ifdef VERIFY +static void secp256k1_fe_verify(const secp256k1_fe_t *a) { + const uint32_t *d = a->n; + int m = a->normalized ? 1 : 2 * a->magnitude, r = 1; + r &= (d[0] <= 0x3FFFFFFUL * m); + r &= (d[1] <= 0x3FFFFFFUL * m); + r &= (d[2] <= 0x3FFFFFFUL * m); + r &= (d[3] <= 0x3FFFFFFUL * m); + r &= (d[4] <= 0x3FFFFFFUL * m); + r &= (d[5] <= 0x3FFFFFFUL * m); + r &= (d[6] <= 0x3FFFFFFUL * m); + r &= (d[7] <= 0x3FFFFFFUL * m); + r &= (d[8] <= 0x3FFFFFFUL * m); + r &= (d[9] <= 0x03FFFFFUL * m); + r &= (a->magnitude >= 0); + if (a->normalized) { + r &= (a->magnitude <= 1); + if (r && (d[9] == 0x03FFFFFUL)) { + uint32_t mid = d[8] & d[7] & d[6] & d[5] & d[4] & d[3] & d[2]; + if (mid == 0x3FFFFFFUL) { + r &= ((d[1] + 0x40UL + ((d[0] + 0x3D1UL) >> 26)) <= 0x3FFFFFFUL); + } + } + } + VERIFY_CHECK(r == 1); +} +#else +static void secp256k1_fe_verify(const secp256k1_fe_t *a) { + (void)a; +} +#endif + +static void secp256k1_fe_normalize(secp256k1_fe_t *r) { + uint32_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4], + t5 = r->n[5], t6 = r->n[6], t7 = r->n[7], t8 = r->n[8], t9 = r->n[9]; + + /* Reduce t9 at the start so there will be at most a single carry from the first pass */ + uint32_t x = t9 >> 22; t9 &= 0x03FFFFFUL; + uint32_t m; + + /* The first pass ensures the magnitude is 1, ... */ + t0 += x * 0x3D1UL; t1 += (x << 6); + t1 += (t0 >> 26); t0 &= 0x3FFFFFFUL; + t2 += (t1 >> 26); t1 &= 0x3FFFFFFUL; + t3 += (t2 >> 26); t2 &= 0x3FFFFFFUL; m = t2; + t4 += (t3 >> 26); t3 &= 0x3FFFFFFUL; m &= t3; + t5 += (t4 >> 26); t4 &= 0x3FFFFFFUL; m &= t4; + t6 += (t5 >> 26); t5 &= 0x3FFFFFFUL; m &= t5; + t7 += (t6 >> 26); t6 &= 0x3FFFFFFUL; m &= t6; + t8 += (t7 >> 26); t7 &= 0x3FFFFFFUL; m &= t7; + t9 += (t8 >> 26); t8 &= 0x3FFFFFFUL; m &= t8; + + /* ... except for a possible carry at bit 22 of t9 (i.e. bit 256 of the field element) */ + VERIFY_CHECK(t9 >> 23 == 0); + + /* At most a single final reduction is needed; check if the value is >= the field characteristic */ + x = (t9 >> 22) | ((t9 == 0x03FFFFFUL) & (m == 0x3FFFFFFUL) + & ((t1 + 0x40UL + ((t0 + 0x3D1UL) >> 26)) > 0x3FFFFFFUL)); + + /* Apply the final reduction (for constant-time behaviour, we do it always) */ + t0 += x * 0x3D1UL; t1 += (x << 6); + t1 += (t0 >> 26); t0 &= 0x3FFFFFFUL; + t2 += (t1 >> 26); t1 &= 0x3FFFFFFUL; + t3 += (t2 >> 26); t2 &= 0x3FFFFFFUL; + t4 += (t3 >> 26); t3 &= 0x3FFFFFFUL; + t5 += (t4 >> 26); t4 &= 0x3FFFFFFUL; + t6 += (t5 >> 26); t5 &= 0x3FFFFFFUL; + t7 += (t6 >> 26); t6 &= 0x3FFFFFFUL; + t8 += (t7 >> 26); t7 &= 0x3FFFFFFUL; + t9 += (t8 >> 26); t8 &= 0x3FFFFFFUL; + + /* If t9 didn't carry to bit 22 already, then it should have after any final reduction */ + VERIFY_CHECK(t9 >> 22 == x); + + /* Mask off the possible multiple of 2^256 from the final reduction */ + t9 &= 0x03FFFFFUL; + + r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4; + r->n[5] = t5; r->n[6] = t6; r->n[7] = t7; r->n[8] = t8; r->n[9] = t9; + +#ifdef VERIFY + r->magnitude = 1; + r->normalized = 1; + secp256k1_fe_verify(r); +#endif +} + +SECP256K1_INLINE static void secp256k1_fe_set_int(secp256k1_fe_t *r, int a) { + r->n[0] = a; + r->n[1] = r->n[2] = r->n[3] = r->n[4] = r->n[5] = r->n[6] = r->n[7] = r->n[8] = r->n[9] = 0; +#ifdef VERIFY + r->magnitude = 1; + r->normalized = 1; + secp256k1_fe_verify(r); +#endif +} + +SECP256K1_INLINE static int secp256k1_fe_is_zero(const secp256k1_fe_t *a) { +#ifdef VERIFY + VERIFY_CHECK(a->normalized); + secp256k1_fe_verify(a); +#endif + const uint32_t *t = a->n; + return (t[0] | t[1] | t[2] | t[3] | t[4] | t[5] | t[6] | t[7] | t[8] | t[9]) == 0; +} + +SECP256K1_INLINE static int secp256k1_fe_is_odd(const secp256k1_fe_t *a) { +#ifdef VERIFY + VERIFY_CHECK(a->normalized); + secp256k1_fe_verify(a); +#endif + return a->n[0] & 1; +} + +SECP256K1_INLINE static void secp256k1_fe_clear(secp256k1_fe_t *a) { +#ifdef VERIFY + a->magnitude = 0; + a->normalized = 1; +#endif + for (int i=0; i<10; i++) { + a->n[i] = 0; + } +} + +SECP256K1_INLINE static int secp256k1_fe_equal(const secp256k1_fe_t *a, const secp256k1_fe_t *b) { +#ifdef VERIFY + VERIFY_CHECK(a->normalized); + VERIFY_CHECK(b->normalized); + secp256k1_fe_verify(a); + secp256k1_fe_verify(b); +#endif + const uint32_t *t = a->n, *u = b->n; + return ((t[0]^u[0]) | (t[1]^u[1]) | (t[2]^u[2]) | (t[3]^u[3]) | (t[4]^u[4]) + | (t[5]^u[5]) | (t[6]^u[6]) | (t[7]^u[7]) | (t[8]^u[8]) | (t[9]^u[9])) == 0; +} + +static void secp256k1_fe_set_b32(secp256k1_fe_t *r, const unsigned char *a) { + r->n[0] = r->n[1] = r->n[2] = r->n[3] = r->n[4] = 0; + r->n[5] = r->n[6] = r->n[7] = r->n[8] = r->n[9] = 0; + for (int i=0; i<32; i++) { + for (int j=0; j<4; j++) { + int limb = (8*i+2*j)/26; + int shift = (8*i+2*j)%26; + r->n[limb] |= (uint32_t)((a[31-i] >> (2*j)) & 0x3) << shift; + } + } +#ifdef VERIFY + r->magnitude = 1; + r->normalized = 1; + secp256k1_fe_verify(r); +#endif +} + +/** Convert a field element to a 32-byte big endian value. Requires the input to be normalized */ +static void secp256k1_fe_get_b32(unsigned char *r, const secp256k1_fe_t *a) { +#ifdef VERIFY + VERIFY_CHECK(a->normalized); + secp256k1_fe_verify(a); +#endif + for (int i=0; i<32; i++) { + int c = 0; + for (int j=0; j<4; j++) { + int limb = (8*i+2*j)/26; + int shift = (8*i+2*j)%26; + c |= ((a->n[limb] >> shift) & 0x3) << (2 * j); + } + r[31-i] = c; + } +} + +SECP256K1_INLINE static void secp256k1_fe_negate(secp256k1_fe_t *r, const secp256k1_fe_t *a, int m) { +#ifdef VERIFY + VERIFY_CHECK(a->magnitude <= m); + secp256k1_fe_verify(a); +#endif + r->n[0] = 0x3FFFC2FUL * 2 * (m + 1) - a->n[0]; + r->n[1] = 0x3FFFFBFUL * 2 * (m + 1) - a->n[1]; + r->n[2] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[2]; + r->n[3] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[3]; + r->n[4] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[4]; + r->n[5] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[5]; + r->n[6] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[6]; + r->n[7] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[7]; + r->n[8] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[8]; + r->n[9] = 0x03FFFFFUL * 2 * (m + 1) - a->n[9]; +#ifdef VERIFY + r->magnitude = m + 1; + r->normalized = 0; + secp256k1_fe_verify(r); +#endif +} + +SECP256K1_INLINE static void secp256k1_fe_mul_int(secp256k1_fe_t *r, int a) { + r->n[0] *= a; + r->n[1] *= a; + r->n[2] *= a; + r->n[3] *= a; + r->n[4] *= a; + r->n[5] *= a; + r->n[6] *= a; + r->n[7] *= a; + r->n[8] *= a; + r->n[9] *= a; +#ifdef VERIFY + r->magnitude *= a; + r->normalized = 0; + secp256k1_fe_verify(r); +#endif +} + +SECP256K1_INLINE static void secp256k1_fe_add(secp256k1_fe_t *r, const secp256k1_fe_t *a) { +#ifdef VERIFY + secp256k1_fe_verify(a); +#endif + r->n[0] += a->n[0]; + r->n[1] += a->n[1]; + r->n[2] += a->n[2]; + r->n[3] += a->n[3]; + r->n[4] += a->n[4]; + r->n[5] += a->n[5]; + r->n[6] += a->n[6]; + r->n[7] += a->n[7]; + r->n[8] += a->n[8]; + r->n[9] += a->n[9]; +#ifdef VERIFY + r->magnitude += a->magnitude; + r->normalized = 0; + secp256k1_fe_verify(r); +#endif +} + +#ifdef VERIFY +#define VERIFY_BITS(x, n) VERIFY_CHECK(((x) >> (n)) == 0) +#else +#define VERIFY_BITS(x, n) do { } while(0) +#endif + +SECP256K1_INLINE static void secp256k1_fe_mul_inner(const uint32_t *a, const uint32_t *b, uint32_t *r) { + VERIFY_BITS(a[0], 30); + VERIFY_BITS(a[1], 30); + VERIFY_BITS(a[2], 30); + VERIFY_BITS(a[3], 30); + VERIFY_BITS(a[4], 30); + VERIFY_BITS(a[5], 30); + VERIFY_BITS(a[6], 30); + VERIFY_BITS(a[7], 30); + VERIFY_BITS(a[8], 30); + VERIFY_BITS(a[9], 26); + VERIFY_BITS(b[0], 30); + VERIFY_BITS(b[1], 30); + VERIFY_BITS(b[2], 30); + VERIFY_BITS(b[3], 30); + VERIFY_BITS(b[4], 30); + VERIFY_BITS(b[5], 30); + VERIFY_BITS(b[6], 30); + VERIFY_BITS(b[7], 30); + VERIFY_BITS(b[8], 30); + VERIFY_BITS(b[9], 26); + + const uint32_t M = 0x3FFFFFFUL, R0 = 0x3D10UL, R1 = 0x400UL; + /** [... a b c] is a shorthand for ... + a<<52 + b<<26 + c<<0 mod n. + * px is a shorthand for sum(a[i]*b[x-i], i=0..x). + * Note that [x 0 0 0 0 0 0 0 0 0 0] = [x*R1 x*R0]. + */ + + uint64_t c, d; + + d = (uint64_t)a[0] * b[9] + + (uint64_t)a[1] * b[8] + + (uint64_t)a[2] * b[7] + + (uint64_t)a[3] * b[6] + + (uint64_t)a[4] * b[5] + + (uint64_t)a[5] * b[4] + + (uint64_t)a[6] * b[3] + + (uint64_t)a[7] * b[2] + + (uint64_t)a[8] * b[1] + + (uint64_t)a[9] * b[0]; + /* VERIFY_BITS(d, 64); */ + /* [d 0 0 0 0 0 0 0 0 0] = [p9 0 0 0 0 0 0 0 0 0] */ + uint32_t t9 = d & M; d >>= 26; + VERIFY_BITS(t9, 26); + VERIFY_BITS(d, 38); + /* [d t9 0 0 0 0 0 0 0 0 0] = [p9 0 0 0 0 0 0 0 0 0] */ + + c = (uint64_t)a[0] * b[0]; + VERIFY_BITS(c, 60); + /* [d t9 0 0 0 0 0 0 0 0 c] = [p9 0 0 0 0 0 0 0 0 p0] */ + d += (uint64_t)a[1] * b[9] + + (uint64_t)a[2] * b[8] + + (uint64_t)a[3] * b[7] + + (uint64_t)a[4] * b[6] + + (uint64_t)a[5] * b[5] + + (uint64_t)a[6] * b[4] + + (uint64_t)a[7] * b[3] + + (uint64_t)a[8] * b[2] + + (uint64_t)a[9] * b[1]; + VERIFY_BITS(d, 63); + /* [d t9 0 0 0 0 0 0 0 0 c] = [p10 p9 0 0 0 0 0 0 0 0 p0] */ + uint64_t u0 = d & M; d >>= 26; c += u0 * R0; + VERIFY_BITS(u0, 26); + VERIFY_BITS(d, 37); + VERIFY_BITS(c, 61); + /* [d u0 t9 0 0 0 0 0 0 0 0 c-u0*R0] = [p10 p9 0 0 0 0 0 0 0 0 p0] */ + uint32_t t0 = c & M; c >>= 26; c += u0 * R1; + VERIFY_BITS(t0, 26); + VERIFY_BITS(c, 37); + /* [d u0 t9 0 0 0 0 0 0 0 c-u0*R1 t0-u0*R0] = [p10 p9 0 0 0 0 0 0 0 0 p0] */ + /* [d 0 t9 0 0 0 0 0 0 0 c t0] = [p10 p9 0 0 0 0 0 0 0 0 p0] */ + + c += (uint64_t)a[0] * b[1] + + (uint64_t)a[1] * b[0]; + VERIFY_BITS(c, 62); + /* [d 0 t9 0 0 0 0 0 0 0 c t0] = [p10 p9 0 0 0 0 0 0 0 p1 p0] */ + d += (uint64_t)a[2] * b[9] + + (uint64_t)a[3] * b[8] + + (uint64_t)a[4] * b[7] + + (uint64_t)a[5] * b[6] + + (uint64_t)a[6] * b[5] + + (uint64_t)a[7] * b[4] + + (uint64_t)a[8] * b[3] + + (uint64_t)a[9] * b[2]; + VERIFY_BITS(d, 63); + /* [d 0 t9 0 0 0 0 0 0 0 c t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */ + uint64_t u1 = d & M; d >>= 26; c += u1 * R0; + VERIFY_BITS(u1, 26); + VERIFY_BITS(d, 37); + VERIFY_BITS(c, 63); + /* [d u1 0 t9 0 0 0 0 0 0 0 c-u1*R0 t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */ + uint32_t t1 = c & M; c >>= 26; c += u1 * R1; + VERIFY_BITS(t1, 26); + VERIFY_BITS(c, 38); + /* [d u1 0 t9 0 0 0 0 0 0 c-u1*R1 t1-u1*R0 t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */ + /* [d 0 0 t9 0 0 0 0 0 0 c t1 t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */ + + c += (uint64_t)a[0] * b[2] + + (uint64_t)a[1] * b[1] + + (uint64_t)a[2] * b[0]; + VERIFY_BITS(c, 62); + /* [d 0 0 t9 0 0 0 0 0 0 c t1 t0] = [p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */ + d += (uint64_t)a[3] * b[9] + + (uint64_t)a[4] * b[8] + + (uint64_t)a[5] * b[7] + + (uint64_t)a[6] * b[6] + + (uint64_t)a[7] * b[5] + + (uint64_t)a[8] * b[4] + + (uint64_t)a[9] * b[3]; + VERIFY_BITS(d, 63); + /* [d 0 0 t9 0 0 0 0 0 0 c t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */ + uint64_t u2 = d & M; d >>= 26; c += u2 * R0; + VERIFY_BITS(u2, 26); + VERIFY_BITS(d, 37); + VERIFY_BITS(c, 63); + /* [d u2 0 0 t9 0 0 0 0 0 0 c-u2*R0 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */ + uint32_t t2 = c & M; c >>= 26; c += u2 * R1; + VERIFY_BITS(t2, 26); + VERIFY_BITS(c, 38); + /* [d u2 0 0 t9 0 0 0 0 0 c-u2*R1 t2-u2*R0 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */ + /* [d 0 0 0 t9 0 0 0 0 0 c t2 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */ + + c += (uint64_t)a[0] * b[3] + + (uint64_t)a[1] * b[2] + + (uint64_t)a[2] * b[1] + + (uint64_t)a[3] * b[0]; + VERIFY_BITS(c, 63); + /* [d 0 0 0 t9 0 0 0 0 0 c t2 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */ + d += (uint64_t)a[4] * b[9] + + (uint64_t)a[5] * b[8] + + (uint64_t)a[6] * b[7] + + (uint64_t)a[7] * b[6] + + (uint64_t)a[8] * b[5] + + (uint64_t)a[9] * b[4]; + VERIFY_BITS(d, 63); + /* [d 0 0 0 t9 0 0 0 0 0 c t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */ + uint64_t u3 = d & M; d >>= 26; c += u3 * R0; + VERIFY_BITS(u3, 26); + VERIFY_BITS(d, 37); + /* VERIFY_BITS(c, 64); */ + /* [d u3 0 0 0 t9 0 0 0 0 0 c-u3*R0 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */ + uint32_t t3 = c & M; c >>= 26; c += u3 * R1; + VERIFY_BITS(t3, 26); + VERIFY_BITS(c, 39); + /* [d u3 0 0 0 t9 0 0 0 0 c-u3*R1 t3-u3*R0 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */ + /* [d 0 0 0 0 t9 0 0 0 0 c t3 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */ + + c += (uint64_t)a[0] * b[4] + + (uint64_t)a[1] * b[3] + + (uint64_t)a[2] * b[2] + + (uint64_t)a[3] * b[1] + + (uint64_t)a[4] * b[0]; + VERIFY_BITS(c, 63); + /* [d 0 0 0 0 t9 0 0 0 0 c t3 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */ + d += (uint64_t)a[5] * b[9] + + (uint64_t)a[6] * b[8] + + (uint64_t)a[7] * b[7] + + (uint64_t)a[8] * b[6] + + (uint64_t)a[9] * b[5]; + VERIFY_BITS(d, 62); + /* [d 0 0 0 0 t9 0 0 0 0 c t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */ + uint64_t u4 = d & M; d >>= 26; c += u4 * R0; + VERIFY_BITS(u4, 26); + VERIFY_BITS(d, 36); + /* VERIFY_BITS(c, 64); */ + /* [d u4 0 0 0 0 t9 0 0 0 0 c-u4*R0 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */ + uint32_t t4 = c & M; c >>= 26; c += u4 * R1; + VERIFY_BITS(t4, 26); + VERIFY_BITS(c, 39); + /* [d u4 0 0 0 0 t9 0 0 0 c-u4*R1 t4-u4*R0 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */ + /* [d 0 0 0 0 0 t9 0 0 0 c t4 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */ + + c += (uint64_t)a[0] * b[5] + + (uint64_t)a[1] * b[4] + + (uint64_t)a[2] * b[3] + + (uint64_t)a[3] * b[2] + + (uint64_t)a[4] * b[1] + + (uint64_t)a[5] * b[0]; + VERIFY_BITS(c, 63); + /* [d 0 0 0 0 0 t9 0 0 0 c t4 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */ + d += (uint64_t)a[6] * b[9] + + (uint64_t)a[7] * b[8] + + (uint64_t)a[8] * b[7] + + (uint64_t)a[9] * b[6]; + VERIFY_BITS(d, 62); + /* [d 0 0 0 0 0 t9 0 0 0 c t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */ + uint64_t u5 = d & M; d >>= 26; c += u5 * R0; + VERIFY_BITS(u5, 26); + VERIFY_BITS(d, 36); + /* VERIFY_BITS(c, 64); */ + /* [d u5 0 0 0 0 0 t9 0 0 0 c-u5*R0 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */ + uint32_t t5 = c & M; c >>= 26; c += u5 * R1; + VERIFY_BITS(t5, 26); + VERIFY_BITS(c, 39); + /* [d u5 0 0 0 0 0 t9 0 0 c-u5*R1 t5-u5*R0 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */ + /* [d 0 0 0 0 0 0 t9 0 0 c t5 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */ + + c += (uint64_t)a[0] * b[6] + + (uint64_t)a[1] * b[5] + + (uint64_t)a[2] * b[4] + + (uint64_t)a[3] * b[3] + + (uint64_t)a[4] * b[2] + + (uint64_t)a[5] * b[1] + + (uint64_t)a[6] * b[0]; + VERIFY_BITS(c, 63); + /* [d 0 0 0 0 0 0 t9 0 0 c t5 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */ + d += (uint64_t)a[7] * b[9] + + (uint64_t)a[8] * b[8] + + (uint64_t)a[9] * b[7]; + VERIFY_BITS(d, 61); + /* [d 0 0 0 0 0 0 t9 0 0 c t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */ + uint64_t u6 = d & M; d >>= 26; c += u6 * R0; + VERIFY_BITS(u6, 26); + VERIFY_BITS(d, 35); + /* VERIFY_BITS(c, 64); */ + /* [d u6 0 0 0 0 0 0 t9 0 0 c-u6*R0 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */ + uint32_t t6 = c & M; c >>= 26; c += u6 * R1; + VERIFY_BITS(t6, 26); + VERIFY_BITS(c, 39); + /* [d u6 0 0 0 0 0 0 t9 0 c-u6*R1 t6-u6*R0 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */ + /* [d 0 0 0 0 0 0 0 t9 0 c t6 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */ + + c += (uint64_t)a[0] * b[7] + + (uint64_t)a[1] * b[6] + + (uint64_t)a[2] * b[5] + + (uint64_t)a[3] * b[4] + + (uint64_t)a[4] * b[3] + + (uint64_t)a[5] * b[2] + + (uint64_t)a[6] * b[1] + + (uint64_t)a[7] * b[0]; + /* VERIFY_BITS(c, 64); */ + VERIFY_CHECK(c <= 0x8000007C00000007ULL); + /* [d 0 0 0 0 0 0 0 t9 0 c t6 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */ + d += (uint64_t)a[8] * b[9] + + (uint64_t)a[9] * b[8]; + VERIFY_BITS(d, 58); + /* [d 0 0 0 0 0 0 0 t9 0 c t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */ + uint64_t u7 = d & M; d >>= 26; c += u7 * R0; + VERIFY_BITS(u7, 26); + VERIFY_BITS(d, 32); + /* VERIFY_BITS(c, 64); */ + VERIFY_CHECK(c <= 0x800001703FFFC2F7ULL); + /* [d u7 0 0 0 0 0 0 0 t9 0 c-u7*R0 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */ + uint32_t t7 = c & M; c >>= 26; c += u7 * R1; + VERIFY_BITS(t7, 26); + VERIFY_BITS(c, 38); + /* [d u7 0 0 0 0 0 0 0 t9 c-u7*R1 t7-u7*R0 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */ + /* [d 0 0 0 0 0 0 0 0 t9 c t7 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */ + + c += (uint64_t)a[0] * b[8] + + (uint64_t)a[1] * b[7] + + (uint64_t)a[2] * b[6] + + (uint64_t)a[3] * b[5] + + (uint64_t)a[4] * b[4] + + (uint64_t)a[5] * b[3] + + (uint64_t)a[6] * b[2] + + (uint64_t)a[7] * b[1] + + (uint64_t)a[8] * b[0]; + /* VERIFY_BITS(c, 64); */ + VERIFY_CHECK(c <= 0x9000007B80000008ULL); + /* [d 0 0 0 0 0 0 0 0 t9 c t7 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + d += (uint64_t)a[9] * b[9]; + VERIFY_BITS(d, 57); + /* [d 0 0 0 0 0 0 0 0 t9 c t7 t6 t5 t4 t3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + uint64_t u8 = d & M; d >>= 26; c += u8 * R0; + VERIFY_BITS(u8, 26); + VERIFY_BITS(d, 31); + /* VERIFY_BITS(c, 64); */ + VERIFY_CHECK(c <= 0x9000016FBFFFC2F8ULL); + /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 t5 t4 t3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + + r[3] = t3; + VERIFY_BITS(r[3], 26); + /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 t5 t4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[4] = t4; + VERIFY_BITS(r[4], 26); + /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 t5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[5] = t5; + VERIFY_BITS(r[5], 26); + /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[6] = t6; + VERIFY_BITS(r[6], 26); + /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[7] = t7; + VERIFY_BITS(r[7], 26); + /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + + r[8] = c & M; c >>= 26; c += u8 * R1; + VERIFY_BITS(r[8], 26); + VERIFY_BITS(c, 39); + /* [d u8 0 0 0 0 0 0 0 0 t9+c-u8*R1 r8-u8*R0 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + /* [d 0 0 0 0 0 0 0 0 0 t9+c r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + c += d * R0 + t9; + VERIFY_BITS(c, 45); + /* [d 0 0 0 0 0 0 0 0 0 c-d*R0 r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[9] = c & (M >> 4); c >>= 22; c += d * (R1 << 4); + VERIFY_BITS(r[9], 22); + VERIFY_BITS(c, 46); + /* [d 0 0 0 0 0 0 0 0 r9+((c-d*R1<<4)<<22)-d*R0 r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + /* [d 0 0 0 0 0 0 0 -d*R1 r9+(c<<22)-d*R0 r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + /* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + + d = c * (R0 >> 4) + t0; + VERIFY_BITS(d, 56); + /* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 t1 d-c*R0>>4] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[0] = d & M; d >>= 26; + VERIFY_BITS(r[0], 26); + VERIFY_BITS(d, 30); + /* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 t1+d r0-c*R0>>4] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + d += c * (R1 >> 4) + t1; + VERIFY_BITS(d, 53); + VERIFY_CHECK(d <= 0x10000003FFFFBFULL); + /* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 d-c*R1>>4 r0-c*R0>>4] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + /* [r9 r8 r7 r6 r5 r4 r3 t2 d r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[1] = d & M; d >>= 26; + VERIFY_BITS(r[1], 26); + VERIFY_BITS(d, 27); + VERIFY_CHECK(d <= 0x4000000ULL); + /* [r9 r8 r7 r6 r5 r4 r3 t2+d r1 r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + d += t2; + VERIFY_BITS(d, 27); + /* [r9 r8 r7 r6 r5 r4 r3 d r1 r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[2] = d; + VERIFY_BITS(r[2], 27); + /* [r9 r8 r7 r6 r5 r4 r3 r2 r1 r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ +} + +SECP256K1_INLINE static void secp256k1_fe_sqr_inner(const uint32_t *a, uint32_t *r) { + VERIFY_BITS(a[0], 30); + VERIFY_BITS(a[1], 30); + VERIFY_BITS(a[2], 30); + VERIFY_BITS(a[3], 30); + VERIFY_BITS(a[4], 30); + VERIFY_BITS(a[5], 30); + VERIFY_BITS(a[6], 30); + VERIFY_BITS(a[7], 30); + VERIFY_BITS(a[8], 30); + VERIFY_BITS(a[9], 26); + + const uint32_t M = 0x3FFFFFFUL, R0 = 0x3D10UL, R1 = 0x400UL; + /** [... a b c] is a shorthand for ... + a<<52 + b<<26 + c<<0 mod n. + * px is a shorthand for sum(a[i]*a[x-i], i=0..x). + * Note that [x 0 0 0 0 0 0 0 0 0 0] = [x*R1 x*R0]. + */ + + uint64_t c, d; + + d = (uint64_t)(a[0]*2) * a[9] + + (uint64_t)(a[1]*2) * a[8] + + (uint64_t)(a[2]*2) * a[7] + + (uint64_t)(a[3]*2) * a[6] + + (uint64_t)(a[4]*2) * a[5]; + /* VERIFY_BITS(d, 64); */ + /* [d 0 0 0 0 0 0 0 0 0] = [p9 0 0 0 0 0 0 0 0 0] */ + uint32_t t9 = d & M; d >>= 26; + VERIFY_BITS(t9, 26); + VERIFY_BITS(d, 38); + /* [d t9 0 0 0 0 0 0 0 0 0] = [p9 0 0 0 0 0 0 0 0 0] */ + + c = (uint64_t)a[0] * a[0]; + VERIFY_BITS(c, 60); + /* [d t9 0 0 0 0 0 0 0 0 c] = [p9 0 0 0 0 0 0 0 0 p0] */ + d += (uint64_t)(a[1]*2) * a[9] + + (uint64_t)(a[2]*2) * a[8] + + (uint64_t)(a[3]*2) * a[7] + + (uint64_t)(a[4]*2) * a[6] + + (uint64_t)a[5] * a[5]; + VERIFY_BITS(d, 63); + /* [d t9 0 0 0 0 0 0 0 0 c] = [p10 p9 0 0 0 0 0 0 0 0 p0] */ + uint64_t u0 = d & M; d >>= 26; c += u0 * R0; + VERIFY_BITS(u0, 26); + VERIFY_BITS(d, 37); + VERIFY_BITS(c, 61); + /* [d u0 t9 0 0 0 0 0 0 0 0 c-u0*R0] = [p10 p9 0 0 0 0 0 0 0 0 p0] */ + uint32_t t0 = c & M; c >>= 26; c += u0 * R1; + VERIFY_BITS(t0, 26); + VERIFY_BITS(c, 37); + /* [d u0 t9 0 0 0 0 0 0 0 c-u0*R1 t0-u0*R0] = [p10 p9 0 0 0 0 0 0 0 0 p0] */ + /* [d 0 t9 0 0 0 0 0 0 0 c t0] = [p10 p9 0 0 0 0 0 0 0 0 p0] */ + + c += (uint64_t)(a[0]*2) * a[1]; + VERIFY_BITS(c, 62); + /* [d 0 t9 0 0 0 0 0 0 0 c t0] = [p10 p9 0 0 0 0 0 0 0 p1 p0] */ + d += (uint64_t)(a[2]*2) * a[9] + + (uint64_t)(a[3]*2) * a[8] + + (uint64_t)(a[4]*2) * a[7] + + (uint64_t)(a[5]*2) * a[6]; + VERIFY_BITS(d, 63); + /* [d 0 t9 0 0 0 0 0 0 0 c t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */ + uint64_t u1 = d & M; d >>= 26; c += u1 * R0; + VERIFY_BITS(u1, 26); + VERIFY_BITS(d, 37); + VERIFY_BITS(c, 63); + /* [d u1 0 t9 0 0 0 0 0 0 0 c-u1*R0 t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */ + uint32_t t1 = c & M; c >>= 26; c += u1 * R1; + VERIFY_BITS(t1, 26); + VERIFY_BITS(c, 38); + /* [d u1 0 t9 0 0 0 0 0 0 c-u1*R1 t1-u1*R0 t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */ + /* [d 0 0 t9 0 0 0 0 0 0 c t1 t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */ + + c += (uint64_t)(a[0]*2) * a[2] + + (uint64_t)a[1] * a[1]; + VERIFY_BITS(c, 62); + /* [d 0 0 t9 0 0 0 0 0 0 c t1 t0] = [p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */ + d += (uint64_t)(a[3]*2) * a[9] + + (uint64_t)(a[4]*2) * a[8] + + (uint64_t)(a[5]*2) * a[7] + + (uint64_t)a[6] * a[6]; + VERIFY_BITS(d, 63); + /* [d 0 0 t9 0 0 0 0 0 0 c t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */ + uint64_t u2 = d & M; d >>= 26; c += u2 * R0; + VERIFY_BITS(u2, 26); + VERIFY_BITS(d, 37); + VERIFY_BITS(c, 63); + /* [d u2 0 0 t9 0 0 0 0 0 0 c-u2*R0 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */ + uint32_t t2 = c & M; c >>= 26; c += u2 * R1; + VERIFY_BITS(t2, 26); + VERIFY_BITS(c, 38); + /* [d u2 0 0 t9 0 0 0 0 0 c-u2*R1 t2-u2*R0 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */ + /* [d 0 0 0 t9 0 0 0 0 0 c t2 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */ + + c += (uint64_t)(a[0]*2) * a[3] + + (uint64_t)(a[1]*2) * a[2]; + VERIFY_BITS(c, 63); + /* [d 0 0 0 t9 0 0 0 0 0 c t2 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */ + d += (uint64_t)(a[4]*2) * a[9] + + (uint64_t)(a[5]*2) * a[8] + + (uint64_t)(a[6]*2) * a[7]; + VERIFY_BITS(d, 63); + /* [d 0 0 0 t9 0 0 0 0 0 c t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */ + uint64_t u3 = d & M; d >>= 26; c += u3 * R0; + VERIFY_BITS(u3, 26); + VERIFY_BITS(d, 37); + /* VERIFY_BITS(c, 64); */ + /* [d u3 0 0 0 t9 0 0 0 0 0 c-u3*R0 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */ + uint32_t t3 = c & M; c >>= 26; c += u3 * R1; + VERIFY_BITS(t3, 26); + VERIFY_BITS(c, 39); + /* [d u3 0 0 0 t9 0 0 0 0 c-u3*R1 t3-u3*R0 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */ + /* [d 0 0 0 0 t9 0 0 0 0 c t3 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */ + + c += (uint64_t)(a[0]*2) * a[4] + + (uint64_t)(a[1]*2) * a[3] + + (uint64_t)a[2] * a[2]; + VERIFY_BITS(c, 63); + /* [d 0 0 0 0 t9 0 0 0 0 c t3 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */ + d += (uint64_t)(a[5]*2) * a[9] + + (uint64_t)(a[6]*2) * a[8] + + (uint64_t)a[7] * a[7]; + VERIFY_BITS(d, 62); + /* [d 0 0 0 0 t9 0 0 0 0 c t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */ + uint64_t u4 = d & M; d >>= 26; c += u4 * R0; + VERIFY_BITS(u4, 26); + VERIFY_BITS(d, 36); + /* VERIFY_BITS(c, 64); */ + /* [d u4 0 0 0 0 t9 0 0 0 0 c-u4*R0 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */ + uint32_t t4 = c & M; c >>= 26; c += u4 * R1; + VERIFY_BITS(t4, 26); + VERIFY_BITS(c, 39); + /* [d u4 0 0 0 0 t9 0 0 0 c-u4*R1 t4-u4*R0 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */ + /* [d 0 0 0 0 0 t9 0 0 0 c t4 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */ + + c += (uint64_t)(a[0]*2) * a[5] + + (uint64_t)(a[1]*2) * a[4] + + (uint64_t)(a[2]*2) * a[3]; + VERIFY_BITS(c, 63); + /* [d 0 0 0 0 0 t9 0 0 0 c t4 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */ + d += (uint64_t)(a[6]*2) * a[9] + + (uint64_t)(a[7]*2) * a[8]; + VERIFY_BITS(d, 62); + /* [d 0 0 0 0 0 t9 0 0 0 c t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */ + uint64_t u5 = d & M; d >>= 26; c += u5 * R0; + VERIFY_BITS(u5, 26); + VERIFY_BITS(d, 36); + /* VERIFY_BITS(c, 64); */ + /* [d u5 0 0 0 0 0 t9 0 0 0 c-u5*R0 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */ + uint32_t t5 = c & M; c >>= 26; c += u5 * R1; + VERIFY_BITS(t5, 26); + VERIFY_BITS(c, 39); + /* [d u5 0 0 0 0 0 t9 0 0 c-u5*R1 t5-u5*R0 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */ + /* [d 0 0 0 0 0 0 t9 0 0 c t5 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */ + + c += (uint64_t)(a[0]*2) * a[6] + + (uint64_t)(a[1]*2) * a[5] + + (uint64_t)(a[2]*2) * a[4] + + (uint64_t)a[3] * a[3]; + VERIFY_BITS(c, 63); + /* [d 0 0 0 0 0 0 t9 0 0 c t5 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */ + d += (uint64_t)(a[7]*2) * a[9] + + (uint64_t)a[8] * a[8]; + VERIFY_BITS(d, 61); + /* [d 0 0 0 0 0 0 t9 0 0 c t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */ + uint64_t u6 = d & M; d >>= 26; c += u6 * R0; + VERIFY_BITS(u6, 26); + VERIFY_BITS(d, 35); + /* VERIFY_BITS(c, 64); */ + /* [d u6 0 0 0 0 0 0 t9 0 0 c-u6*R0 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */ + uint32_t t6 = c & M; c >>= 26; c += u6 * R1; + VERIFY_BITS(t6, 26); + VERIFY_BITS(c, 39); + /* [d u6 0 0 0 0 0 0 t9 0 c-u6*R1 t6-u6*R0 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */ + /* [d 0 0 0 0 0 0 0 t9 0 c t6 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */ + + c += (uint64_t)(a[0]*2) * a[7] + + (uint64_t)(a[1]*2) * a[6] + + (uint64_t)(a[2]*2) * a[5] + + (uint64_t)(a[3]*2) * a[4]; + /* VERIFY_BITS(c, 64); */ + VERIFY_CHECK(c <= 0x8000007C00000007ULL); + /* [d 0 0 0 0 0 0 0 t9 0 c t6 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */ + d += (uint64_t)(a[8]*2) * a[9]; + VERIFY_BITS(d, 58); + /* [d 0 0 0 0 0 0 0 t9 0 c t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */ + uint64_t u7 = d & M; d >>= 26; c += u7 * R0; + VERIFY_BITS(u7, 26); + VERIFY_BITS(d, 32); + /* VERIFY_BITS(c, 64); */ + VERIFY_CHECK(c <= 0x800001703FFFC2F7ULL); + /* [d u7 0 0 0 0 0 0 0 t9 0 c-u7*R0 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */ + uint32_t t7 = c & M; c >>= 26; c += u7 * R1; + VERIFY_BITS(t7, 26); + VERIFY_BITS(c, 38); + /* [d u7 0 0 0 0 0 0 0 t9 c-u7*R1 t7-u7*R0 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */ + /* [d 0 0 0 0 0 0 0 0 t9 c t7 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */ + + c += (uint64_t)(a[0]*2) * a[8] + + (uint64_t)(a[1]*2) * a[7] + + (uint64_t)(a[2]*2) * a[6] + + (uint64_t)(a[3]*2) * a[5] + + (uint64_t)a[4] * a[4]; + /* VERIFY_BITS(c, 64); */ + VERIFY_CHECK(c <= 0x9000007B80000008ULL); + /* [d 0 0 0 0 0 0 0 0 t9 c t7 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + d += (uint64_t)a[9] * a[9]; + VERIFY_BITS(d, 57); + /* [d 0 0 0 0 0 0 0 0 t9 c t7 t6 t5 t4 t3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + uint64_t u8 = d & M; d >>= 26; c += u8 * R0; + VERIFY_BITS(u8, 26); + VERIFY_BITS(d, 31); + /* VERIFY_BITS(c, 64); */ + VERIFY_CHECK(c <= 0x9000016FBFFFC2F8ULL); + /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 t5 t4 t3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + + r[3] = t3; + VERIFY_BITS(r[3], 26); + /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 t5 t4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[4] = t4; + VERIFY_BITS(r[4], 26); + /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 t5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[5] = t5; + VERIFY_BITS(r[5], 26); + /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[6] = t6; + VERIFY_BITS(r[6], 26); + /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[7] = t7; + VERIFY_BITS(r[7], 26); + /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + + r[8] = c & M; c >>= 26; c += u8 * R1; + VERIFY_BITS(r[8], 26); + VERIFY_BITS(c, 39); + /* [d u8 0 0 0 0 0 0 0 0 t9+c-u8*R1 r8-u8*R0 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + /* [d 0 0 0 0 0 0 0 0 0 t9+c r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + c += d * R0 + t9; + VERIFY_BITS(c, 45); + /* [d 0 0 0 0 0 0 0 0 0 c-d*R0 r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[9] = c & (M >> 4); c >>= 22; c += d * (R1 << 4); + VERIFY_BITS(r[9], 22); + VERIFY_BITS(c, 46); + /* [d 0 0 0 0 0 0 0 0 r9+((c-d*R1<<4)<<22)-d*R0 r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + /* [d 0 0 0 0 0 0 0 -d*R1 r9+(c<<22)-d*R0 r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + /* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + + d = c * (R0 >> 4) + t0; + VERIFY_BITS(d, 56); + /* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 t1 d-c*R0>>4] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[0] = d & M; d >>= 26; + VERIFY_BITS(r[0], 26); + VERIFY_BITS(d, 30); + /* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 t1+d r0-c*R0>>4] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + d += c * (R1 >> 4) + t1; + VERIFY_BITS(d, 53); + VERIFY_CHECK(d <= 0x10000003FFFFBFULL); + /* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 d-c*R1>>4 r0-c*R0>>4] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + /* [r9 r8 r7 r6 r5 r4 r3 t2 d r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[1] = d & M; d >>= 26; + VERIFY_BITS(r[1], 26); + VERIFY_BITS(d, 27); + VERIFY_CHECK(d <= 0x4000000ULL); + /* [r9 r8 r7 r6 r5 r4 r3 t2+d r1 r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + d += t2; + VERIFY_BITS(d, 27); + /* [r9 r8 r7 r6 r5 r4 r3 d r1 r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[2] = d; + VERIFY_BITS(r[2], 27); + /* [r9 r8 r7 r6 r5 r4 r3 r2 r1 r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */ +} + + +static void secp256k1_fe_mul(secp256k1_fe_t *r, const secp256k1_fe_t *a, const secp256k1_fe_t *b) { +#ifdef VERIFY + VERIFY_CHECK(a->magnitude <= 8); + VERIFY_CHECK(b->magnitude <= 8); + secp256k1_fe_verify(a); + secp256k1_fe_verify(b); +#endif + secp256k1_fe_mul_inner(a->n, b->n, r->n); +#ifdef VERIFY + r->magnitude = 1; + r->normalized = 0; + secp256k1_fe_verify(r); +#endif +} + +static void secp256k1_fe_sqr(secp256k1_fe_t *r, const secp256k1_fe_t *a) { +#ifdef VERIFY + VERIFY_CHECK(a->magnitude <= 8); + secp256k1_fe_verify(a); +#endif + secp256k1_fe_sqr_inner(a->n, r->n); +#ifdef VERIFY + r->magnitude = 1; + r->normalized = 0; + secp256k1_fe_verify(r); +#endif +} + +#endif diff --git a/src/field_5x52.h b/src/field_5x52.h new file mode 100644 index 0000000000..aeb0a6a1e8 --- /dev/null +++ b/src/field_5x52.h @@ -0,0 +1,21 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_FIELD_REPR_ +#define _SECP256K1_FIELD_REPR_ + +#include + +typedef struct { + /* X = sum(i=0..4, elem[i]*2^52) mod n */ + uint64_t n[5]; +#ifdef VERIFY + int magnitude; + int normalized; +#endif +} secp256k1_fe_t; + +#endif diff --git a/src/field_5x52_asm.asm b/src/field_5x52_asm.asm new file mode 100644 index 0000000000..5e785f7630 --- /dev/null +++ b/src/field_5x52_asm.asm @@ -0,0 +1,469 @@ + ;; Added by Diederik Huys, March 2013 + ;; + ;; Provided public procedures: + ;; secp256k1_fe_mul_inner + ;; secp256k1_fe_sqr_inner + ;; + ;; Needed tools: YASM (http://yasm.tortall.net) + ;; + ;; + + BITS 64 + +%ifidn __OUTPUT_FORMAT__,macho64 +%define SYM(x) _ %+ x +%else +%define SYM(x) x +%endif + + ;; Procedure ExSetMult + ;; Register Layout: + ;; INPUT: rdi = a->n + ;; rsi = b->n + ;; rdx = r->a + ;; + ;; INTERNAL: rdx:rax = multiplication accumulator + ;; r9:r8 = c + ;; r10-r13 = t0-t3 + ;; r14 = b.n[0] / t4 + ;; r15 = b.n[1] / t5 + ;; rbx = b.n[2] / t6 + ;; rcx = b.n[3] / t7 + ;; rbp = Constant 0FFFFFFFFFFFFFh / t8 + ;; rsi = b.n / b.n[4] / t9 + + GLOBAL SYM(secp256k1_fe_mul_inner) + ALIGN 32 +SYM(secp256k1_fe_mul_inner): + push rbp + push rbx + push r12 + push r13 + push r14 + push r15 + push rdx + mov r14,[rsi+8*0] ; preload b.n[0]. This will be the case until + ; b.n[0] is no longer needed, then we reassign + ; r14 to t4 + ;; c=a.n[0] * b.n[0] + mov rax,[rdi+0*8] ; load a.n[0] + mov rbp,0FFFFFFFFFFFFFh + mul r14 ; rdx:rax=a.n[0]*b.n[0] + mov r15,[rsi+1*8] + mov r10,rbp ; load modulus into target register for t0 + mov r8,rax + and r10,rax ; only need lower qword of c + shrd r8,rdx,52 + xor r9,r9 ; c < 2^64, so we ditch the HO part + + ;; c+=a.n[0] * b.n[1] + a.n[1] * b.n[0] + mov rax,[rdi+0*8] + mul r15 + add r8,rax + adc r9,rdx + + mov rax,[rdi+1*8] + mul r14 + mov r11,rbp + mov rbx,[rsi+2*8] + add r8,rax + adc r9,rdx + and r11,r8 + shrd r8,r9,52 + xor r9,r9 + + ;; c+=a.n[0 1 2] * b.n[2 1 0] + mov rax,[rdi+0*8] + mul rbx + add r8,rax + adc r9,rdx + + mov rax,[rdi+1*8] + mul r15 + add r8,rax + adc r9,rdx + + mov rax,[rdi+2*8] + mul r14 + mov r12,rbp + mov rcx,[rsi+3*8] + add r8,rax + adc r9,rdx + and r12,r8 + shrd r8,r9,52 + xor r9,r9 + + ;; c+=a.n[0 1 2 3] * b.n[3 2 1 0] + mov rax,[rdi+0*8] + mul rcx + add r8,rax + adc r9,rdx + + mov rax,[rdi+1*8] + mul rbx + add r8,rax + adc r9,rdx + + mov rax,[rdi+2*8] + mul r15 + add r8,rax + adc r9,rdx + + mov rax,[rdi+3*8] + mul r14 + mov r13,rbp + mov rsi,[rsi+4*8] ; load b.n[4] and destroy pointer + add r8,rax + adc r9,rdx + and r13,r8 + + shrd r8,r9,52 + xor r9,r9 + + + ;; c+=a.n[0 1 2 3 4] * b.n[4 3 2 1 0] + mov rax,[rdi+0*8] + mul rsi + add r8,rax + adc r9,rdx + + mov rax,[rdi+1*8] + mul rcx + add r8,rax + adc r9,rdx + + mov rax,[rdi+2*8] + mul rbx + add r8,rax + adc r9,rdx + + mov rax,[rdi+3*8] + mul r15 + add r8,rax + adc r9,rdx + + mov rax,[rdi+4*8] + mul r14 + mov r14,rbp ; load modulus into t4 and destroy a.n[0] + add r8,rax + adc r9,rdx + and r14,r8 + shrd r8,r9,52 + xor r9,r9 + + ;; c+=a.n[1 2 3 4] * b.n[4 3 2 1] + mov rax,[rdi+1*8] + mul rsi + add r8,rax + adc r9,rdx + + mov rax,[rdi+2*8] + mul rcx + add r8,rax + adc r9,rdx + + mov rax,[rdi+3*8] + mul rbx + add r8,rax + adc r9,rdx + + mov rax,[rdi+4*8] + mul r15 + mov r15,rbp + add r8,rax + adc r9,rdx + + and r15,r8 + shrd r8,r9,52 + xor r9,r9 + + ;; c+=a.n[2 3 4] * b.n[4 3 2] + mov rax,[rdi+2*8] + mul rsi + add r8,rax + adc r9,rdx + + mov rax,[rdi+3*8] + mul rcx + add r8,rax + adc r9,rdx + + mov rax,[rdi+4*8] + mul rbx + mov rbx,rbp + add r8,rax + adc r9,rdx + + and rbx,r8 + shrd r8,r9,52 + xor r9,r9 + + ;; c+=a.n[3 4] * b.n[4 3] + mov rax,[rdi+3*8] + mul rsi + add r8,rax + adc r9,rdx + + mov rax,[rdi+4*8] + mul rcx + mov rcx,rbp + add r8,rax + adc r9,rdx + and rcx,r8 + shrd r8,r9,52 + xor r9,r9 + + ;; c+=a.n[4] * b.n[4] + mov rax,[rdi+4*8] + mul rsi + ;; mov rbp,rbp ; modulus already there! + add r8,rax + adc r9,rdx + and rbp,r8 + shrd r8,r9,52 + xor r9,r9 + + mov rsi,r8 ; load c into t9 and destroy b.n[4] + + ;; ******************************************************* +common_exit_norm: + mov rdi,01000003D10h ; load constant + + mov rax,r15 ; get t5 + mul rdi + add rax,r10 ; +t0 + adc rdx,0 + mov r10,0FFFFFFFFFFFFFh ; modulus. Sadly, we ran out of registers! + mov r8,rax ; +c + and r10,rax + shrd r8,rdx,52 + xor r9,r9 + + mov rax,rbx ; get t6 + mul rdi + add rax,r11 ; +t1 + adc rdx,0 + mov r11,0FFFFFFFFFFFFFh ; modulus + add r8,rax ; +c + adc r9,rdx + and r11,r8 + shrd r8,r9,52 + xor r9,r9 + + mov rax,rcx ; get t7 + mul rdi + add rax,r12 ; +t2 + adc rdx,0 + pop rbx ; retrieve pointer to this.n + mov r12,0FFFFFFFFFFFFFh ; modulus + add r8,rax ; +c + adc r9,rdx + and r12,r8 + mov [rbx+2*8],r12 ; mov into this.n[2] + shrd r8,r9,52 + xor r9,r9 + + mov rax,rbp ; get t8 + mul rdi + add rax,r13 ; +t3 + adc rdx,0 + mov r13,0FFFFFFFFFFFFFh ; modulus + add r8,rax ; +c + adc r9,rdx + and r13,r8 + mov [rbx+3*8],r13 ; -> this.n[3] + shrd r8,r9,52 + xor r9,r9 + + mov rax,rsi ; get t9 + mul rdi + add rax,r14 ; +t4 + adc rdx,0 + mov r14,0FFFFFFFFFFFFh ; !!! + add r8,rax ; +c + adc r9,rdx + and r14,r8 + mov [rbx+4*8],r14 ; -> this.n[4] + shrd r8,r9,48 ; !!! + xor r9,r9 + + mov rax,01000003D1h + mul r8 + add rax,r10 + adc rdx,0 + mov r10,0FFFFFFFFFFFFFh ; modulus + mov r8,rax + and rax,r10 + shrd r8,rdx,52 + mov [rbx+0*8],rax ; -> this.n[0] + add r8,r11 + mov [rbx+1*8],r8 ; -> this.n[1] + + pop r15 + pop r14 + pop r13 + pop r12 + pop rbx + pop rbp + ret + + + ;; PROC ExSetSquare + ;; Register Layout: + ;; INPUT: rdi = a.n + ;; rsi = this.a + ;; INTERNAL: rdx:rax = multiplication accumulator + ;; r9:r8 = c + ;; r10-r13 = t0-t3 + ;; r14 = a.n[0] / t4 + ;; r15 = a.n[1] / t5 + ;; rbx = a.n[2] / t6 + ;; rcx = a.n[3] / t7 + ;; rbp = 0FFFFFFFFFFFFFh / t8 + ;; rsi = a.n[4] / t9 + GLOBAL SYM(secp256k1_fe_sqr_inner) + ALIGN 32 +SYM(secp256k1_fe_sqr_inner): + push rbp + push rbx + push r12 + push r13 + push r14 + push r15 + push rsi + mov rbp,0FFFFFFFFFFFFFh + + ;; c=a.n[0] * a.n[0] + mov r14,[rdi+0*8] ; r14=a.n[0] + mov r10,rbp ; modulus + mov rax,r14 + mul rax + mov r15,[rdi+1*8] ; a.n[1] + add r14,r14 ; r14=2*a.n[0] + mov r8,rax + and r10,rax ; only need lower qword + shrd r8,rdx,52 + xor r9,r9 + + ;; c+=2*a.n[0] * a.n[1] + mov rax,r14 ; r14=2*a.n[0] + mul r15 + mov rbx,[rdi+2*8] ; rbx=a.n[2] + mov r11,rbp ; modulus + add r8,rax + adc r9,rdx + and r11,r8 + shrd r8,r9,52 + xor r9,r9 + + ;; c+=2*a.n[0]*a.n[2]+a.n[1]*a.n[1] + mov rax,r14 + mul rbx + add r8,rax + adc r9,rdx + + mov rax,r15 + mov r12,rbp ; modulus + mul rax + mov rcx,[rdi+3*8] ; rcx=a.n[3] + add r15,r15 ; r15=a.n[1]*2 + add r8,rax + adc r9,rdx + and r12,r8 ; only need lower dword + shrd r8,r9,52 + xor r9,r9 + + ;; c+=2*a.n[0]*a.n[3]+2*a.n[1]*a.n[2] + mov rax,r14 + mul rcx + add r8,rax + adc r9,rdx + + mov rax,r15 ; rax=2*a.n[1] + mov r13,rbp ; modulus + mul rbx + mov rsi,[rdi+4*8] ; rsi=a.n[4] + add r8,rax + adc r9,rdx + and r13,r8 + shrd r8,r9,52 + xor r9,r9 + + ;; c+=2*a.n[0]*a.n[4]+2*a.n[1]*a.n[3]+a.n[2]*a.n[2] + mov rax,r14 ; last time we need 2*a.n[0] + mul rsi + add r8,rax + adc r9,rdx + + mov rax,r15 + mul rcx + mov r14,rbp ; modulus + add r8,rax + adc r9,rdx + + mov rax,rbx + mul rax + add rbx,rbx ; rcx=2*a.n[2] + add r8,rax + adc r9,rdx + and r14,r8 + shrd r8,r9,52 + xor r9,r9 + + ;; c+=2*a.n[1]*a.n[4]+2*a.n[2]*a.n[3] + mov rax,r15 ; last time we need 2*a.n[1] + mul rsi + add r8,rax + adc r9,rdx + + mov rax,rbx + mul rcx + mov r15,rbp ; modulus + add r8,rax + adc r9,rdx + and r15,r8 + shrd r8,r9,52 + xor r9,r9 + + ;; c+=2*a.n[2]*a.n[4]+a.n[3]*a.n[3] + mov rax,rbx ; last time we need 2*a.n[2] + mul rsi + add r8,rax + adc r9,rdx + + mov rax,rcx ; a.n[3] + mul rax + mov rbx,rbp ; modulus + add r8,rax + adc r9,rdx + and rbx,r8 ; only need lower dword + lea rax,[2*rcx] + shrd r8,r9,52 + xor r9,r9 + + ;; c+=2*a.n[3]*a.n[4] + mul rsi + mov rcx,rbp ; modulus + add r8,rax + adc r9,rdx + and rcx,r8 ; only need lower dword + shrd r8,r9,52 + xor r9,r9 + + ;; c+=a.n[4]*a.n[4] + mov rax,rsi + mul rax + ;; mov rbp,rbp ; modulus is already there! + add r8,rax + adc r9,rdx + and rbp,r8 + shrd r8,r9,52 + xor r9,r9 + + mov rsi,r8 + + ;; ******************************************************* + jmp common_exit_norm + end + + diff --git a/src/field_5x52_asm_impl.h b/src/field_5x52_asm_impl.h new file mode 100644 index 0000000000..f29605b11b --- /dev/null +++ b/src/field_5x52_asm_impl.h @@ -0,0 +1,13 @@ +/********************************************************************** + * Copyright (c) 2013 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_FIELD_INNER5X52_IMPL_H_ +#define _SECP256K1_FIELD_INNER5X52_IMPL_H_ + +void __attribute__ ((sysv_abi)) secp256k1_fe_mul_inner(const uint64_t *a, const uint64_t *b, uint64_t *r); +void __attribute__ ((sysv_abi)) secp256k1_fe_sqr_inner(const uint64_t *a, uint64_t *r); + +#endif diff --git a/src/field_5x52_impl.h b/src/field_5x52_impl.h new file mode 100644 index 0000000000..d1b06d05a4 --- /dev/null +++ b/src/field_5x52_impl.h @@ -0,0 +1,260 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_FIELD_REPR_IMPL_H_ +#define _SECP256K1_FIELD_REPR_IMPL_H_ + +#if defined HAVE_CONFIG_H +#include "libsecp256k1-config.h" +#endif + +#include +#include "util.h" +#include "num.h" +#include "field.h" + +#if defined(USE_FIELD_5X52_ASM) +#include "field_5x52_asm_impl.h" +#elif defined(USE_FIELD_5X52_INT128) +#include "field_5x52_int128_impl.h" +#else +#error "Please select field_5x52 implementation" +#endif + +/** Implements arithmetic modulo FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE FFFFFC2F, + * represented as 5 uint64_t's in base 2^52. The values are allowed to contain >52 each. In particular, + * each FieldElem has a 'magnitude' associated with it. Internally, a magnitude M means each element + * is at most M*(2^53-1), except the most significant one, which is limited to M*(2^49-1). All operations + * accept any input with magnitude at most M, and have different rules for propagating magnitude to their + * output. + */ + +static void secp256k1_fe_inner_start(void) {} +static void secp256k1_fe_inner_stop(void) {} + +#ifdef VERIFY +static void secp256k1_fe_verify(const secp256k1_fe_t *a) { + const uint64_t *d = a->n; + int m = a->normalized ? 1 : 2 * a->magnitude, r = 1; + r &= (d[0] <= 0xFFFFFFFFFFFFFULL * m); + r &= (d[1] <= 0xFFFFFFFFFFFFFULL * m); + r &= (d[2] <= 0xFFFFFFFFFFFFFULL * m); + r &= (d[3] <= 0xFFFFFFFFFFFFFULL * m); + r &= (d[4] <= 0x0FFFFFFFFFFFFULL * m); + r &= (a->magnitude >= 0); + if (a->normalized) { + r &= (a->magnitude <= 1); + if (r && (d[4] == 0x0FFFFFFFFFFFFULL) && ((d[3] & d[2] & d[1]) == 0xFFFFFFFFFFFFFULL)) { + r &= (d[0] < 0xFFFFEFFFFFC2FULL); + } + } + VERIFY_CHECK(r == 1); +} +#else +static void secp256k1_fe_verify(const secp256k1_fe_t *a) { + (void)a; +} +#endif + +static void secp256k1_fe_normalize(secp256k1_fe_t *r) { + uint64_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4]; + + /* Reduce t4 at the start so there will be at most a single carry from the first pass */ + uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL; + uint64_t m; + + /* The first pass ensures the magnitude is 1, ... */ + t0 += x * 0x1000003D1ULL; + t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL; + t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; m = t1; + t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; m &= t2; + t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; m &= t3; + + /* ... except for a possible carry at bit 48 of t4 (i.e. bit 256 of the field element) */ + VERIFY_CHECK(t4 >> 49 == 0); + + /* At most a single final reduction is needed; check if the value is >= the field characteristic */ + x = (t4 >> 48) | ((t4 == 0x0FFFFFFFFFFFFULL) & (m == 0xFFFFFFFFFFFFFULL) + & (t0 >= 0xFFFFEFFFFFC2FULL)); + + /* Apply the final reduction (for constant-time behaviour, we do it always) */ + t0 += x * 0x1000003D1ULL; + t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL; + t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; + t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; + t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; + + /* If t4 didn't carry to bit 48 already, then it should have after any final reduction */ + VERIFY_CHECK(t4 >> 48 == x); + + /* Mask off the possible multiple of 2^256 from the final reduction */ + t4 &= 0x0FFFFFFFFFFFFULL; + + r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4; + +#ifdef VERIFY + r->magnitude = 1; + r->normalized = 1; + secp256k1_fe_verify(r); +#endif +} + +SECP256K1_INLINE static void secp256k1_fe_set_int(secp256k1_fe_t *r, int a) { + r->n[0] = a; + r->n[1] = r->n[2] = r->n[3] = r->n[4] = 0; +#ifdef VERIFY + r->magnitude = 1; + r->normalized = 1; + secp256k1_fe_verify(r); +#endif +} + +SECP256K1_INLINE static int secp256k1_fe_is_zero(const secp256k1_fe_t *a) { +#ifdef VERIFY + VERIFY_CHECK(a->normalized); + secp256k1_fe_verify(a); +#endif + const uint64_t *t = a->n; + return (t[0] | t[1] | t[2] | t[3] | t[4]) == 0; +} + +SECP256K1_INLINE static int secp256k1_fe_is_odd(const secp256k1_fe_t *a) { +#ifdef VERIFY + VERIFY_CHECK(a->normalized); + secp256k1_fe_verify(a); +#endif + return a->n[0] & 1; +} + +SECP256K1_INLINE static void secp256k1_fe_clear(secp256k1_fe_t *a) { +#ifdef VERIFY + a->magnitude = 0; + a->normalized = 1; +#endif + for (int i=0; i<5; i++) { + a->n[i] = 0; + } +} + +SECP256K1_INLINE static int secp256k1_fe_equal(const secp256k1_fe_t *a, const secp256k1_fe_t *b) { +#ifdef VERIFY + VERIFY_CHECK(a->normalized); + VERIFY_CHECK(b->normalized); + secp256k1_fe_verify(a); + secp256k1_fe_verify(b); +#endif + const uint64_t *t = a->n, *u = b->n; + return ((t[0]^u[0]) | (t[1]^u[1]) | (t[2]^u[2]) | (t[3]^u[3]) | (t[4]^u[4])) == 0; +} + +static void secp256k1_fe_set_b32(secp256k1_fe_t *r, const unsigned char *a) { + r->n[0] = r->n[1] = r->n[2] = r->n[3] = r->n[4] = 0; + for (int i=0; i<32; i++) { + for (int j=0; j<2; j++) { + int limb = (8*i+4*j)/52; + int shift = (8*i+4*j)%52; + r->n[limb] |= (uint64_t)((a[31-i] >> (4*j)) & 0xF) << shift; + } + } +#ifdef VERIFY + r->magnitude = 1; + r->normalized = 1; + secp256k1_fe_verify(r); +#endif +} + +/** Convert a field element to a 32-byte big endian value. Requires the input to be normalized */ +static void secp256k1_fe_get_b32(unsigned char *r, const secp256k1_fe_t *a) { +#ifdef VERIFY + VERIFY_CHECK(a->normalized); + secp256k1_fe_verify(a); +#endif + for (int i=0; i<32; i++) { + int c = 0; + for (int j=0; j<2; j++) { + int limb = (8*i+4*j)/52; + int shift = (8*i+4*j)%52; + c |= ((a->n[limb] >> shift) & 0xF) << (4 * j); + } + r[31-i] = c; + } +} + +SECP256K1_INLINE static void secp256k1_fe_negate(secp256k1_fe_t *r, const secp256k1_fe_t *a, int m) { +#ifdef VERIFY + VERIFY_CHECK(a->magnitude <= m); + secp256k1_fe_verify(a); +#endif + r->n[0] = 0xFFFFEFFFFFC2FULL * 2 * (m + 1) - a->n[0]; + r->n[1] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[1]; + r->n[2] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[2]; + r->n[3] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[3]; + r->n[4] = 0x0FFFFFFFFFFFFULL * 2 * (m + 1) - a->n[4]; +#ifdef VERIFY + r->magnitude = m + 1; + r->normalized = 0; + secp256k1_fe_verify(r); +#endif +} + +SECP256K1_INLINE static void secp256k1_fe_mul_int(secp256k1_fe_t *r, int a) { + r->n[0] *= a; + r->n[1] *= a; + r->n[2] *= a; + r->n[3] *= a; + r->n[4] *= a; +#ifdef VERIFY + r->magnitude *= a; + r->normalized = 0; + secp256k1_fe_verify(r); +#endif +} + +SECP256K1_INLINE static void secp256k1_fe_add(secp256k1_fe_t *r, const secp256k1_fe_t *a) { +#ifdef VERIFY + secp256k1_fe_verify(a); +#endif + r->n[0] += a->n[0]; + r->n[1] += a->n[1]; + r->n[2] += a->n[2]; + r->n[3] += a->n[3]; + r->n[4] += a->n[4]; +#ifdef VERIFY + r->magnitude += a->magnitude; + r->normalized = 0; + secp256k1_fe_verify(r); +#endif +} + +static void secp256k1_fe_mul(secp256k1_fe_t *r, const secp256k1_fe_t *a, const secp256k1_fe_t *b) { +#ifdef VERIFY + VERIFY_CHECK(a->magnitude <= 8); + VERIFY_CHECK(b->magnitude <= 8); + secp256k1_fe_verify(a); + secp256k1_fe_verify(b); +#endif + secp256k1_fe_mul_inner(a->n, b->n, r->n); +#ifdef VERIFY + r->magnitude = 1; + r->normalized = 0; + secp256k1_fe_verify(r); +#endif +} + +static void secp256k1_fe_sqr(secp256k1_fe_t *r, const secp256k1_fe_t *a) { +#ifdef VERIFY + VERIFY_CHECK(a->magnitude <= 8); + secp256k1_fe_verify(a); +#endif + secp256k1_fe_sqr_inner(a->n, r->n); +#ifdef VERIFY + r->magnitude = 1; + r->normalized = 0; + secp256k1_fe_verify(r); +#endif +} + +#endif diff --git a/src/field_5x52_int128_impl.h b/src/field_5x52_int128_impl.h new file mode 100644 index 0000000000..c476428672 --- /dev/null +++ b/src/field_5x52_int128_impl.h @@ -0,0 +1,279 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_FIELD_INNER5X52_IMPL_H_ +#define _SECP256K1_FIELD_INNER5X52_IMPL_H_ + +#include + +#ifdef VERIFY +#define VERIFY_BITS(x, n) VERIFY_CHECK(((x) >> (n)) == 0) +#else +#define VERIFY_BITS(x, n) do { } while(0) +#endif + +SECP256K1_INLINE static void secp256k1_fe_mul_inner(const uint64_t *a, const uint64_t *b, uint64_t *r) { + VERIFY_BITS(a[0], 56); + VERIFY_BITS(a[1], 56); + VERIFY_BITS(a[2], 56); + VERIFY_BITS(a[3], 56); + VERIFY_BITS(a[4], 52); + VERIFY_BITS(b[0], 56); + VERIFY_BITS(b[1], 56); + VERIFY_BITS(b[2], 56); + VERIFY_BITS(b[3], 56); + VERIFY_BITS(b[4], 52); + + const uint64_t M = 0xFFFFFFFFFFFFFULL, R = 0x1000003D10ULL; + /* [... a b c] is a shorthand for ... + a<<104 + b<<52 + c<<0 mod n. + * px is a shorthand for sum(a[i]*b[x-i], i=0..x). + * Note that [x 0 0 0 0 0] = [x*R]. + */ + + __int128 c, d; + + d = (__int128)a[0] * b[3] + + (__int128)a[1] * b[2] + + (__int128)a[2] * b[1] + + (__int128)a[3] * b[0]; + VERIFY_BITS(d, 114); + /* [d 0 0 0] = [p3 0 0 0] */ + c = (__int128)a[4] * b[4]; + VERIFY_BITS(c, 112); + /* [c 0 0 0 0 d 0 0 0] = [p8 0 0 0 0 p3 0 0 0] */ + d += (c & M) * R; c >>= 52; + VERIFY_BITS(d, 115); + VERIFY_BITS(c, 60); + /* [c 0 0 0 0 0 d 0 0 0] = [p8 0 0 0 0 p3 0 0 0] */ + uint64_t t3 = d & M; d >>= 52; + VERIFY_BITS(t3, 52); + VERIFY_BITS(d, 63); + /* [c 0 0 0 0 d t3 0 0 0] = [p8 0 0 0 0 p3 0 0 0] */ + + d += (__int128)a[0] * b[4] + + (__int128)a[1] * b[3] + + (__int128)a[2] * b[2] + + (__int128)a[3] * b[1] + + (__int128)a[4] * b[0]; + VERIFY_BITS(d, 115); + /* [c 0 0 0 0 d t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */ + d += c * R; + VERIFY_BITS(d, 116); + /* [d t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */ + uint64_t t4 = d & M; d >>= 52; + VERIFY_BITS(t4, 52); + VERIFY_BITS(d, 64); + /* [d t4 t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */ + uint64_t tx = (t4 >> 48); t4 &= (M >> 4); + VERIFY_BITS(tx, 4); + VERIFY_BITS(t4, 48); + /* [d t4+(tx<<48) t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */ + + c = (__int128)a[0] * b[0]; + VERIFY_BITS(c, 112); + /* [d t4+(tx<<48) t3 0 0 c] = [p8 0 0 0 p4 p3 0 0 p0] */ + d += (__int128)a[1] * b[4] + + (__int128)a[2] * b[3] + + (__int128)a[3] * b[2] + + (__int128)a[4] * b[1]; + VERIFY_BITS(d, 115); + /* [d t4+(tx<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */ + uint64_t u0 = d & M; d >>= 52; + VERIFY_BITS(u0, 52); + VERIFY_BITS(d, 63); + /* [d u0 t4+(tx<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */ + /* [d 0 t4+(tx<<48)+(u0<<52) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */ + u0 = (u0 << 4) | tx; + VERIFY_BITS(u0, 56); + /* [d 0 t4+(u0<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */ + c += (__int128)u0 * (R >> 4); + VERIFY_BITS(c, 115); + /* [d 0 t4 t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */ + uint64_t t0 = c & M; c >>= 52; + VERIFY_BITS(t0, 52); + VERIFY_BITS(c, 61); + /* [d 0 t4 t3 0 c t0] = [p8 0 0 p5 p4 p3 0 0 p0] */ + + c += (__int128)a[0] * b[1] + + (__int128)a[1] * b[0]; + VERIFY_BITS(c, 114); + /* [d 0 t4 t3 0 c t0] = [p8 0 0 p5 p4 p3 0 p1 p0] */ + d += (__int128)a[2] * b[4] + + (__int128)a[3] * b[3] + + (__int128)a[4] * b[2]; + VERIFY_BITS(d, 114); + /* [d 0 t4 t3 0 c t0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */ + c += (d & M) * R; d >>= 52; + VERIFY_BITS(c, 115); + VERIFY_BITS(d, 62); + /* [d 0 0 t4 t3 0 c t0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */ + uint64_t t1 = c & M; c >>= 52; + VERIFY_BITS(t1, 52); + VERIFY_BITS(c, 63); + /* [d 0 0 t4 t3 c t1 t0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */ + + c += (__int128)a[0] * b[2] + + (__int128)a[1] * b[1] + + (__int128)a[2] * b[0]; + VERIFY_BITS(c, 114); + /* [d 0 0 t4 t3 c t1 t0] = [p8 0 p6 p5 p4 p3 p2 p1 p0] */ + d += (__int128)a[3] * b[4] + + (__int128)a[4] * b[3]; + VERIFY_BITS(d, 114); + /* [d 0 0 t4 t3 c t1 t0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + c += (d & M) * R; d >>= 52; + VERIFY_BITS(c, 115); + VERIFY_BITS(d, 62); + /* [d 0 0 0 t4 t3 c t1 t0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + + r[0] = t0; + VERIFY_BITS(r[0], 52); + /* [d 0 0 0 t4 t3 c t1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[1] = t1; + VERIFY_BITS(r[1], 52); + /* [d 0 0 0 t4 t3 c r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[2] = c & M; c >>= 52; + VERIFY_BITS(r[2], 52); + VERIFY_BITS(c, 63); + /* [d 0 0 0 t4 t3+c r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + c += d * R + t3;; + VERIFY_BITS(c, 100); + /* [t4 c r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[3] = c & M; c >>= 52; + VERIFY_BITS(r[3], 52); + VERIFY_BITS(c, 48); + /* [t4+c r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + c += t4; + VERIFY_BITS(c, 49); + /* [c r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[4] = c; + VERIFY_BITS(r[4], 49); + /* [r4 r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ +} + +SECP256K1_INLINE static void secp256k1_fe_sqr_inner(const uint64_t *a, uint64_t *r) { + VERIFY_BITS(a[0], 56); + VERIFY_BITS(a[1], 56); + VERIFY_BITS(a[2], 56); + VERIFY_BITS(a[3], 56); + VERIFY_BITS(a[4], 52); + + const uint64_t M = 0xFFFFFFFFFFFFFULL, R = 0x1000003D10ULL; + /** [... a b c] is a shorthand for ... + a<<104 + b<<52 + c<<0 mod n. + * px is a shorthand for sum(a[i]*a[x-i], i=0..x). + * Note that [x 0 0 0 0 0] = [x*R]. + */ + + __int128 c, d; + + uint64_t a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4]; + + d = (__int128)(a0*2) * a3 + + (__int128)(a1*2) * a2; + VERIFY_BITS(d, 114); + /* [d 0 0 0] = [p3 0 0 0] */ + c = (__int128)a4 * a4; + VERIFY_BITS(c, 112); + /* [c 0 0 0 0 d 0 0 0] = [p8 0 0 0 0 p3 0 0 0] */ + d += (c & M) * R; c >>= 52; + VERIFY_BITS(d, 115); + VERIFY_BITS(c, 60); + /* [c 0 0 0 0 0 d 0 0 0] = [p8 0 0 0 0 p3 0 0 0] */ + uint64_t t3 = d & M; d >>= 52; + VERIFY_BITS(t3, 52); + VERIFY_BITS(d, 63); + /* [c 0 0 0 0 d t3 0 0 0] = [p8 0 0 0 0 p3 0 0 0] */ + + a4 *= 2; + d += (__int128)a0 * a4 + + (__int128)(a1*2) * a3 + + (__int128)a2 * a2; + VERIFY_BITS(d, 115); + /* [c 0 0 0 0 d t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */ + d += c * R; + VERIFY_BITS(d, 116); + /* [d t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */ + uint64_t t4 = d & M; d >>= 52; + VERIFY_BITS(t4, 52); + VERIFY_BITS(d, 64); + /* [d t4 t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */ + uint64_t tx = (t4 >> 48); t4 &= (M >> 4); + VERIFY_BITS(tx, 4); + VERIFY_BITS(t4, 48); + /* [d t4+(tx<<48) t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */ + + c = (__int128)a0 * a0; + VERIFY_BITS(c, 112); + /* [d t4+(tx<<48) t3 0 0 c] = [p8 0 0 0 p4 p3 0 0 p0] */ + d += (__int128)a1 * a4 + + (__int128)(a2*2) * a3; + VERIFY_BITS(d, 114); + /* [d t4+(tx<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */ + uint64_t u0 = d & M; d >>= 52; + VERIFY_BITS(u0, 52); + VERIFY_BITS(d, 62); + /* [d u0 t4+(tx<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */ + /* [d 0 t4+(tx<<48)+(u0<<52) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */ + u0 = (u0 << 4) | tx; + VERIFY_BITS(u0, 56); + /* [d 0 t4+(u0<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */ + c += (__int128)u0 * (R >> 4); + VERIFY_BITS(c, 113); + /* [d 0 t4 t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */ + r[0] = c & M; c >>= 52; + VERIFY_BITS(r[0], 52); + VERIFY_BITS(c, 61); + /* [d 0 t4 t3 0 c r0] = [p8 0 0 p5 p4 p3 0 0 p0] */ + + a0 *= 2; + c += (__int128)a0 * a1; + VERIFY_BITS(c, 114); + /* [d 0 t4 t3 0 c r0] = [p8 0 0 p5 p4 p3 0 p1 p0] */ + d += (__int128)a2 * a4 + + (__int128)a3 * a3; + VERIFY_BITS(d, 114); + /* [d 0 t4 t3 0 c r0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */ + c += (d & M) * R; d >>= 52; + VERIFY_BITS(c, 115); + VERIFY_BITS(d, 62); + /* [d 0 0 t4 t3 0 c r0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */ + r[1] = c & M; c >>= 52; + VERIFY_BITS(r[1], 52); + VERIFY_BITS(c, 63); + /* [d 0 0 t4 t3 c r1 r0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */ + + c += (__int128)a0 * a2 + + (__int128)a1 * a1; + VERIFY_BITS(c, 114); + /* [d 0 0 t4 t3 c r1 r0] = [p8 0 p6 p5 p4 p3 p2 p1 p0] */ + d += (__int128)a3 * a4; + VERIFY_BITS(d, 114); + /* [d 0 0 t4 t3 c r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + c += (d & M) * R; d >>= 52; + VERIFY_BITS(c, 115); + VERIFY_BITS(d, 62); + /* [d 0 0 0 t4 t3 c r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[2] = c & M; c >>= 52; + VERIFY_BITS(r[2], 52); + VERIFY_BITS(c, 63); + /* [d 0 0 0 t4 t3+c r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + + c += d * R + t3;; + VERIFY_BITS(c, 100); + /* [t4 c r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[3] = c & M; c >>= 52; + VERIFY_BITS(r[3], 52); + VERIFY_BITS(c, 48); + /* [t4+c r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + c += t4; + VERIFY_BITS(c, 49); + /* [c r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ + r[4] = c; + VERIFY_BITS(r[4], 49); + /* [r4 r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ +} + +#endif diff --git a/src/field_gmp.h b/src/field_gmp.h new file mode 100644 index 0000000000..b390fd9de8 --- /dev/null +++ b/src/field_gmp.h @@ -0,0 +1,18 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_FIELD_REPR_ +#define _SECP256K1_FIELD_REPR_ + +#include + +#define FIELD_LIMBS ((256 + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS) + +typedef struct { + mp_limb_t n[FIELD_LIMBS+1]; +} secp256k1_fe_t; + +#endif diff --git a/src/field_gmp_impl.h b/src/field_gmp_impl.h new file mode 100644 index 0000000000..af4728e5b4 --- /dev/null +++ b/src/field_gmp_impl.h @@ -0,0 +1,163 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_FIELD_REPR_IMPL_H_ +#define _SECP256K1_FIELD_REPR_IMPL_H_ + +#include +#include +#include "num.h" +#include "field.h" + +static mp_limb_t secp256k1_field_p[FIELD_LIMBS]; +static mp_limb_t secp256k1_field_pc[(33+GMP_NUMB_BITS-1)/GMP_NUMB_BITS]; + +static void secp256k1_fe_inner_start(void) { + for (int i=0; i<(33+GMP_NUMB_BITS-1)/GMP_NUMB_BITS; i++) + secp256k1_field_pc[i] = 0; + secp256k1_field_pc[0] += 0x3D1UL; + secp256k1_field_pc[32/GMP_NUMB_BITS] += (((mp_limb_t)1) << (32 % GMP_NUMB_BITS)); + for (int i=0; in[FIELD_LIMBS] != 0) { +#if (GMP_NUMB_BITS >= 40) + mp_limb_t carry = mpn_add_1(r->n, r->n, FIELD_LIMBS, 0x1000003D1ULL * r->n[FIELD_LIMBS]); + mpn_add_1(r->n, r->n, FIELD_LIMBS, 0x1000003D1ULL * carry); +#else + mp_limb_t carry = mpn_add_1(r->n, r->n, FIELD_LIMBS, 0x3D1UL * r->n[FIELD_LIMBS]) + + mpn_add_1(r->n+(32/GMP_NUMB_BITS), r->n+(32/GMP_NUMB_BITS), FIELD_LIMBS-(32/GMP_NUMB_BITS), r->n[FIELD_LIMBS] << (32 % GMP_NUMB_BITS)); + mpn_add_1(r->n, r->n, FIELD_LIMBS, 0x3D1UL * carry); + mpn_add_1(r->n+(32/GMP_NUMB_BITS), r->n+(32/GMP_NUMB_BITS), FIELD_LIMBS-(32/GMP_NUMB_BITS), carry << (32%GMP_NUMB_BITS)); +#endif + r->n[FIELD_LIMBS] = 0; + } + if (mpn_cmp(r->n, secp256k1_field_p, FIELD_LIMBS) >= 0) + mpn_sub(r->n, r->n, FIELD_LIMBS, secp256k1_field_p, FIELD_LIMBS); +} + +SECP256K1_INLINE static void secp256k1_fe_set_int(secp256k1_fe_t *r, int a) { + r->n[0] = a; + for (int i=1; in[i] = 0; +} + +SECP256K1_INLINE static void secp256k1_fe_clear(secp256k1_fe_t *r) { + for (int i=0; in[i] = 0; +} + +SECP256K1_INLINE static int secp256k1_fe_is_zero(const secp256k1_fe_t *a) { + int ret = 1; + for (int i=0; in[i] == 0); + return ret; +} + +SECP256K1_INLINE static int secp256k1_fe_is_odd(const secp256k1_fe_t *a) { + return a->n[0] & 1; +} + +SECP256K1_INLINE static int secp256k1_fe_equal(const secp256k1_fe_t *a, const secp256k1_fe_t *b) { + int ret = 1; + for (int i=0; in[i] == b->n[i]); + return ret; +} + +static void secp256k1_fe_set_b32(secp256k1_fe_t *r, const unsigned char *a) { + for (int i=0; in[i] = 0; + for (int i=0; i<256; i++) { + int limb = i/GMP_NUMB_BITS; + int shift = i%GMP_NUMB_BITS; + r->n[limb] |= (mp_limb_t)((a[31-i/8] >> (i%8)) & 0x1) << shift; + } +} + +/** Convert a field element to a 32-byte big endian value. Requires the input to be normalized */ +static void secp256k1_fe_get_b32(unsigned char *r, const secp256k1_fe_t *a) { + for (int i=0; i<32; i++) { + int c = 0; + for (int j=0; j<8; j++) { + int limb = (8*i+j)/GMP_NUMB_BITS; + int shift = (8*i+j)%GMP_NUMB_BITS; + c |= ((a->n[limb] >> shift) & 0x1) << j; + } + r[31-i] = c; + } +} + +SECP256K1_INLINE static void secp256k1_fe_negate(secp256k1_fe_t *r, const secp256k1_fe_t *a, int m) { + (void)m; + *r = *a; + secp256k1_fe_normalize(r); + for (int i=0; in[i] = ~(r->n[i]); +#if (GMP_NUMB_BITS >= 33) + mpn_sub_1(r->n, r->n, FIELD_LIMBS, 0x1000003D0ULL); +#else + mpn_sub_1(r->n, r->n, FIELD_LIMBS, 0x3D0UL); + mpn_sub_1(r->n+(32/GMP_NUMB_BITS), r->n+(32/GMP_NUMB_BITS), FIELD_LIMBS-(32/GMP_NUMB_BITS), 0x1UL << (32%GMP_NUMB_BITS)); +#endif +} + +SECP256K1_INLINE static void secp256k1_fe_mul_int(secp256k1_fe_t *r, int a) { + mpn_mul_1(r->n, r->n, FIELD_LIMBS+1, a); +} + +SECP256K1_INLINE static void secp256k1_fe_add(secp256k1_fe_t *r, const secp256k1_fe_t *a) { + mpn_add(r->n, r->n, FIELD_LIMBS+1, a->n, FIELD_LIMBS+1); +} + +static void secp256k1_fe_reduce(secp256k1_fe_t *r, mp_limb_t *tmp) { + /** + * B1 B2 B3 B4 + * + C * A1 A2 A3 A4 + * + A1 A2 A3 A4 + */ + +#if (GMP_NUMB_BITS >= 33) + mp_limb_t o = mpn_addmul_1(tmp, tmp+FIELD_LIMBS, FIELD_LIMBS, 0x1000003D1ULL); +#else + mp_limb_t o = mpn_addmul_1(tmp, tmp+FIELD_LIMBS, FIELD_LIMBS, 0x3D1UL) + + mpn_addmul_1(tmp+(32/GMP_NUMB_BITS), tmp+FIELD_LIMBS, FIELD_LIMBS-(32/GMP_NUMB_BITS), 0x1UL << (32%GMP_NUMB_BITS)); +#endif + mp_limb_t q[1+(33+GMP_NUMB_BITS-1)/GMP_NUMB_BITS]; + q[(33+GMP_NUMB_BITS-1)/GMP_NUMB_BITS] = mpn_mul_1(q, secp256k1_field_pc, (33+GMP_NUMB_BITS-1)/GMP_NUMB_BITS, o); +#if (GMP_NUMB_BITS <= 32) + mp_limb_t o2 = tmp[2*FIELD_LIMBS-(32/GMP_NUMB_BITS)] << (32%GMP_NUMB_BITS); + q[(33+GMP_NUMB_BITS-1)/GMP_NUMB_BITS] += mpn_addmul_1(q, secp256k1_field_pc, (33+GMP_NUMB_BITS-1)/GMP_NUMB_BITS, o2); +#endif + r->n[FIELD_LIMBS] = mpn_add(r->n, tmp, FIELD_LIMBS, q, 1+(33+GMP_NUMB_BITS-1)/GMP_NUMB_BITS); +} + +static void secp256k1_fe_mul(secp256k1_fe_t *r, const secp256k1_fe_t *a, const secp256k1_fe_t *b) { + secp256k1_fe_t ac = *a; + secp256k1_fe_t bc = *b; + secp256k1_fe_normalize(&ac); + secp256k1_fe_normalize(&bc); + mp_limb_t tmp[2*FIELD_LIMBS]; + mpn_mul_n(tmp, ac.n, bc.n, FIELD_LIMBS); + secp256k1_fe_reduce(r, tmp); +} + +static void secp256k1_fe_sqr(secp256k1_fe_t *r, const secp256k1_fe_t *a) { + secp256k1_fe_t ac = *a; + secp256k1_fe_normalize(&ac); + mp_limb_t tmp[2*FIELD_LIMBS]; + mpn_sqr(tmp, ac.n, FIELD_LIMBS); + secp256k1_fe_reduce(r, tmp); +} + +#endif diff --git a/src/field_impl.h b/src/field_impl.h new file mode 100644 index 0000000000..3a31e1844e --- /dev/null +++ b/src/field_impl.h @@ -0,0 +1,293 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_FIELD_IMPL_H_ +#define _SECP256K1_FIELD_IMPL_H_ + +#if defined HAVE_CONFIG_H +#include "libsecp256k1-config.h" +#endif + +#include "util.h" + +#if defined(USE_FIELD_GMP) +#include "field_gmp_impl.h" +#elif defined(USE_FIELD_10X26) +#include "field_10x26_impl.h" +#elif defined(USE_FIELD_5X52) +#include "field_5x52_impl.h" +#else +#error "Please select field implementation" +#endif + +static void secp256k1_fe_get_hex(char *r, int *rlen, const secp256k1_fe_t *a) { + if (*rlen < 65) { + *rlen = 65; + return; + } + *rlen = 65; + unsigned char tmp[32]; + secp256k1_fe_t b = *a; + secp256k1_fe_normalize(&b); + secp256k1_fe_get_b32(tmp, &b); + for (int i=0; i<32; i++) { + static const char *c = "0123456789ABCDEF"; + r[2*i] = c[(tmp[i] >> 4) & 0xF]; + r[2*i+1] = c[(tmp[i]) & 0xF]; + } + r[64] = 0x00; +} + +static void secp256k1_fe_set_hex(secp256k1_fe_t *r, const char *a, int alen) { + unsigned char tmp[32] = {}; + static const int cvt[256] = {0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 1, 2, 3, 4, 5, 6,7,8,9,0,0,0,0,0,0, + 0,10,11,12,13,14,15,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0,10,11,12,13,14,15,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0}; + for (int i=0; i<32; i++) { + if (alen > i*2) + tmp[32 - alen/2 + i] = (cvt[(unsigned char)a[2*i]] << 4) + cvt[(unsigned char)a[2*i+1]]; + } + secp256k1_fe_set_b32(r, tmp); +} + +static int secp256k1_fe_sqrt(secp256k1_fe_t *r, const secp256k1_fe_t *a) { + + /** The binary representation of (p + 1)/4 has 3 blocks of 1s, with lengths in + * { 2, 22, 223 }. Use an addition chain to calculate 2^n - 1 for each block: + * 1, [2], 3, 6, 9, 11, [22], 44, 88, 176, 220, [223] + */ + + secp256k1_fe_t x2; + secp256k1_fe_sqr(&x2, a); + secp256k1_fe_mul(&x2, &x2, a); + + secp256k1_fe_t x3; + secp256k1_fe_sqr(&x3, &x2); + secp256k1_fe_mul(&x3, &x3, a); + + secp256k1_fe_t x6 = x3; + for (int j=0; j<3; j++) secp256k1_fe_sqr(&x6, &x6); + secp256k1_fe_mul(&x6, &x6, &x3); + + secp256k1_fe_t x9 = x6; + for (int j=0; j<3; j++) secp256k1_fe_sqr(&x9, &x9); + secp256k1_fe_mul(&x9, &x9, &x3); + + secp256k1_fe_t x11 = x9; + for (int j=0; j<2; j++) secp256k1_fe_sqr(&x11, &x11); + secp256k1_fe_mul(&x11, &x11, &x2); + + secp256k1_fe_t x22 = x11; + for (int j=0; j<11; j++) secp256k1_fe_sqr(&x22, &x22); + secp256k1_fe_mul(&x22, &x22, &x11); + + secp256k1_fe_t x44 = x22; + for (int j=0; j<22; j++) secp256k1_fe_sqr(&x44, &x44); + secp256k1_fe_mul(&x44, &x44, &x22); + + secp256k1_fe_t x88 = x44; + for (int j=0; j<44; j++) secp256k1_fe_sqr(&x88, &x88); + secp256k1_fe_mul(&x88, &x88, &x44); + + secp256k1_fe_t x176 = x88; + for (int j=0; j<88; j++) secp256k1_fe_sqr(&x176, &x176); + secp256k1_fe_mul(&x176, &x176, &x88); + + secp256k1_fe_t x220 = x176; + for (int j=0; j<44; j++) secp256k1_fe_sqr(&x220, &x220); + secp256k1_fe_mul(&x220, &x220, &x44); + + secp256k1_fe_t x223 = x220; + for (int j=0; j<3; j++) secp256k1_fe_sqr(&x223, &x223); + secp256k1_fe_mul(&x223, &x223, &x3); + + /* The final result is then assembled using a sliding window over the blocks. */ + + secp256k1_fe_t t1 = x223; + for (int j=0; j<23; j++) secp256k1_fe_sqr(&t1, &t1); + secp256k1_fe_mul(&t1, &t1, &x22); + for (int j=0; j<6; j++) secp256k1_fe_sqr(&t1, &t1); + secp256k1_fe_mul(&t1, &t1, &x2); + secp256k1_fe_sqr(&t1, &t1); + secp256k1_fe_sqr(r, &t1); + + /* Check that a square root was actually calculated */ + + secp256k1_fe_sqr(&t1, r); + secp256k1_fe_negate(&t1, &t1, 1); + secp256k1_fe_add(&t1, a); + secp256k1_fe_normalize(&t1); + return secp256k1_fe_is_zero(&t1); +} + +static void secp256k1_fe_inv(secp256k1_fe_t *r, const secp256k1_fe_t *a) { + + /** The binary representation of (p - 2) has 5 blocks of 1s, with lengths in + * { 1, 2, 22, 223 }. Use an addition chain to calculate 2^n - 1 for each block: + * [1], [2], 3, 6, 9, 11, [22], 44, 88, 176, 220, [223] + */ + + secp256k1_fe_t x2; + secp256k1_fe_sqr(&x2, a); + secp256k1_fe_mul(&x2, &x2, a); + + secp256k1_fe_t x3; + secp256k1_fe_sqr(&x3, &x2); + secp256k1_fe_mul(&x3, &x3, a); + + secp256k1_fe_t x6 = x3; + for (int j=0; j<3; j++) secp256k1_fe_sqr(&x6, &x6); + secp256k1_fe_mul(&x6, &x6, &x3); + + secp256k1_fe_t x9 = x6; + for (int j=0; j<3; j++) secp256k1_fe_sqr(&x9, &x9); + secp256k1_fe_mul(&x9, &x9, &x3); + + secp256k1_fe_t x11 = x9; + for (int j=0; j<2; j++) secp256k1_fe_sqr(&x11, &x11); + secp256k1_fe_mul(&x11, &x11, &x2); + + secp256k1_fe_t x22 = x11; + for (int j=0; j<11; j++) secp256k1_fe_sqr(&x22, &x22); + secp256k1_fe_mul(&x22, &x22, &x11); + + secp256k1_fe_t x44 = x22; + for (int j=0; j<22; j++) secp256k1_fe_sqr(&x44, &x44); + secp256k1_fe_mul(&x44, &x44, &x22); + + secp256k1_fe_t x88 = x44; + for (int j=0; j<44; j++) secp256k1_fe_sqr(&x88, &x88); + secp256k1_fe_mul(&x88, &x88, &x44); + + secp256k1_fe_t x176 = x88; + for (int j=0; j<88; j++) secp256k1_fe_sqr(&x176, &x176); + secp256k1_fe_mul(&x176, &x176, &x88); + + secp256k1_fe_t x220 = x176; + for (int j=0; j<44; j++) secp256k1_fe_sqr(&x220, &x220); + secp256k1_fe_mul(&x220, &x220, &x44); + + secp256k1_fe_t x223 = x220; + for (int j=0; j<3; j++) secp256k1_fe_sqr(&x223, &x223); + secp256k1_fe_mul(&x223, &x223, &x3); + + /* The final result is then assembled using a sliding window over the blocks. */ + + secp256k1_fe_t t1 = x223; + for (int j=0; j<23; j++) secp256k1_fe_sqr(&t1, &t1); + secp256k1_fe_mul(&t1, &t1, &x22); + for (int j=0; j<5; j++) secp256k1_fe_sqr(&t1, &t1); + secp256k1_fe_mul(&t1, &t1, a); + for (int j=0; j<3; j++) secp256k1_fe_sqr(&t1, &t1); + secp256k1_fe_mul(&t1, &t1, &x2); + for (int j=0; j<2; j++) secp256k1_fe_sqr(&t1, &t1); + secp256k1_fe_mul(r, &t1, a); +} + +static void secp256k1_fe_inv_var(secp256k1_fe_t *r, const secp256k1_fe_t *a) { +#if defined(USE_FIELD_INV_BUILTIN) + secp256k1_fe_inv(r, a); +#elif defined(USE_FIELD_INV_NUM) + unsigned char b[32]; + secp256k1_fe_t c = *a; + secp256k1_fe_normalize(&c); + secp256k1_fe_get_b32(b, &c); + secp256k1_num_t n; + secp256k1_num_set_bin(&n, b, 32); + secp256k1_num_mod_inverse(&n, &n, &secp256k1_fe_consts->p); + secp256k1_num_get_bin(b, 32, &n); + secp256k1_fe_set_b32(r, b); +#else +#error "Please select field inverse implementation" +#endif +} + +static void secp256k1_fe_inv_all(size_t len, secp256k1_fe_t r[len], const secp256k1_fe_t a[len]) { + if (len < 1) + return; + + VERIFY_CHECK((r + len <= a) || (a + len <= r)); + + r[0] = a[0]; + + size_t i = 0; + while (++i < len) { + secp256k1_fe_mul(&r[i], &r[i - 1], &a[i]); + } + + secp256k1_fe_t u; secp256k1_fe_inv(&u, &r[--i]); + + while (i > 0) { + int j = i--; + secp256k1_fe_mul(&r[j], &r[i], &u); + secp256k1_fe_mul(&u, &u, &a[j]); + } + + r[0] = u; +} + +static void secp256k1_fe_inv_all_var(size_t len, secp256k1_fe_t r[len], const secp256k1_fe_t a[len]) { + if (len < 1) + return; + + VERIFY_CHECK((r + len <= a) || (a + len <= r)); + + r[0] = a[0]; + + size_t i = 0; + while (++i < len) { + secp256k1_fe_mul(&r[i], &r[i - 1], &a[i]); + } + + secp256k1_fe_t u; secp256k1_fe_inv_var(&u, &r[--i]); + + while (i > 0) { + int j = i--; + secp256k1_fe_mul(&r[j], &r[i], &u); + secp256k1_fe_mul(&u, &u, &a[j]); + } + + r[0] = u; +} + +static void secp256k1_fe_start(void) { + static const unsigned char secp256k1_fe_consts_p[] = { + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFC,0x2F + }; + if (secp256k1_fe_consts == NULL) { + secp256k1_fe_inner_start(); + secp256k1_fe_consts_t *ret = (secp256k1_fe_consts_t*)malloc(sizeof(secp256k1_fe_consts_t)); + secp256k1_num_set_bin(&ret->p, secp256k1_fe_consts_p, sizeof(secp256k1_fe_consts_p)); + secp256k1_fe_consts = ret; + } +} + +static void secp256k1_fe_stop(void) { + if (secp256k1_fe_consts != NULL) { + secp256k1_fe_consts_t *c = (secp256k1_fe_consts_t*)secp256k1_fe_consts; + free((void*)c); + secp256k1_fe_consts = NULL; + secp256k1_fe_inner_stop(); + } +} + +#endif diff --git a/src/group.h b/src/group.h new file mode 100644 index 0000000000..ba02549821 --- /dev/null +++ b/src/group.h @@ -0,0 +1,128 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_GROUP_ +#define _SECP256K1_GROUP_ + +#include "num.h" +#include "field.h" + +/** A group element of the secp256k1 curve, in affine coordinates. */ +typedef struct { + secp256k1_fe_t x; + secp256k1_fe_t y; + int infinity; /* whether this represents the point at infinity */ +} secp256k1_ge_t; + +/** A group element of the secp256k1 curve, in jacobian coordinates. */ +typedef struct { + secp256k1_fe_t x; /* actual X: x/z^2 */ + secp256k1_fe_t y; /* actual Y: y/z^3 */ + secp256k1_fe_t z; + int infinity; /* whether this represents the point at infinity */ +} secp256k1_gej_t; + +/** Global constants related to the group */ +typedef struct { + secp256k1_num_t order; /* the order of the curve (= order of its generator) */ + secp256k1_num_t half_order; /* half the order of the curve (= order of its generator) */ + secp256k1_ge_t g; /* the generator point */ + +#ifdef USE_ENDOMORPHISM + /* constants related to secp256k1's efficiently computable endomorphism */ + secp256k1_fe_t beta; + secp256k1_num_t lambda, a1b2, b1, a2; +#endif +} secp256k1_ge_consts_t; + +static const secp256k1_ge_consts_t *secp256k1_ge_consts = NULL; + +/** Initialize the group module. */ +static void secp256k1_ge_start(void); + +/** De-initialize the group module. */ +static void secp256k1_ge_stop(void); + +/** Set a group element equal to the point at infinity */ +static void secp256k1_ge_set_infinity(secp256k1_ge_t *r); + +/** Set a group element equal to the point with given X and Y coordinates */ +static void secp256k1_ge_set_xy(secp256k1_ge_t *r, const secp256k1_fe_t *x, const secp256k1_fe_t *y); + +/** Set a group element (affine) equal to the point with the given X coordinate, and given oddness + * for Y. Return value indicates whether the result is valid. */ +static int secp256k1_ge_set_xo(secp256k1_ge_t *r, const secp256k1_fe_t *x, int odd); + +/** Check whether a group element is the point at infinity. */ +static int secp256k1_ge_is_infinity(const secp256k1_ge_t *a); + +/** Check whether a group element is valid (i.e., on the curve). */ +static int secp256k1_ge_is_valid(const secp256k1_ge_t *a); + +static void secp256k1_ge_neg(secp256k1_ge_t *r, const secp256k1_ge_t *a); + +/** Get a hex representation of a point. *rlen will be overwritten with the real length. */ +static void secp256k1_ge_get_hex(char *r, int *rlen, const secp256k1_ge_t *a); + +/** Set a group element equal to another which is given in jacobian coordinates */ +static void secp256k1_ge_set_gej(secp256k1_ge_t *r, secp256k1_gej_t *a); + +/** Set a batch of group elements equal to the inputs given in jacobian coordinates */ +static void secp256k1_ge_set_all_gej_var(size_t len, secp256k1_ge_t r[len], const secp256k1_gej_t a[len]); + + +/** Set a group element (jacobian) equal to the point at infinity. */ +static void secp256k1_gej_set_infinity(secp256k1_gej_t *r); + +/** Set a group element (jacobian) equal to the point with given X and Y coordinates. */ +static void secp256k1_gej_set_xy(secp256k1_gej_t *r, const secp256k1_fe_t *x, const secp256k1_fe_t *y); + +/** Set a group element (jacobian) equal to another which is given in affine coordinates. */ +static void secp256k1_gej_set_ge(secp256k1_gej_t *r, const secp256k1_ge_t *a); + +/** Get the X coordinate of a group element (jacobian). */ +static void secp256k1_gej_get_x_var(secp256k1_fe_t *r, const secp256k1_gej_t *a); + +/** Set r equal to the inverse of a (i.e., mirrored around the X axis) */ +static void secp256k1_gej_neg(secp256k1_gej_t *r, const secp256k1_gej_t *a); + +/** Check whether a group element is the point at infinity. */ +static int secp256k1_gej_is_infinity(const secp256k1_gej_t *a); + +/** Set r equal to the double of a. */ +static void secp256k1_gej_double_var(secp256k1_gej_t *r, const secp256k1_gej_t *a); + +/** Set r equal to the sum of a and b. */ +static void secp256k1_gej_add_var(secp256k1_gej_t *r, const secp256k1_gej_t *a, const secp256k1_gej_t *b); + +/** Set r equal to the sum of a and b (with b given in affine coordinates, and not infinity). */ +static void secp256k1_gej_add_ge(secp256k1_gej_t *r, const secp256k1_gej_t *a, const secp256k1_ge_t *b); + +/** Set r equal to the sum of a and b (with b given in affine coordinates). This is more efficient + than secp256k1_gej_add_var. It is identical to secp256k1_gej_add_ge but without constant-time + guarantee, and b is allowed to be infinity. */ +static void secp256k1_gej_add_ge_var(secp256k1_gej_t *r, const secp256k1_gej_t *a, const secp256k1_ge_t *b); + +/** Get a hex representation of a point. *rlen will be overwritten with the real length. */ +static void secp256k1_gej_get_hex(char *r, int *rlen, const secp256k1_gej_t *a); + +#ifdef USE_ENDOMORPHISM +/** Set r to be equal to lambda times a, where lambda is chosen in a way such that this is very fast. */ +static void secp256k1_gej_mul_lambda(secp256k1_gej_t *r, const secp256k1_gej_t *a); + +/** Find r1 and r2 such that r1+r2*lambda = a, and r1 and r2 are maximum 128 bits long (given that a is + not more than 256 bits). */ +static void secp256k1_gej_split_exp_var(secp256k1_num_t *r1, secp256k1_num_t *r2, const secp256k1_num_t *a); +#endif + +/** Clear a secp256k1_gej_t to prevent leaking sensitive information. */ +static void secp256k1_gej_clear(secp256k1_gej_t *r); + +/** Clear a secp256k1_ge_t to prevent leaking sensitive information. */ +static void secp256k1_ge_clear(secp256k1_ge_t *r); + + +#endif diff --git a/src/group_impl.h b/src/group_impl.h new file mode 100644 index 0000000000..1edbc6e099 --- /dev/null +++ b/src/group_impl.h @@ -0,0 +1,519 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_GROUP_IMPL_H_ +#define _SECP256K1_GROUP_IMPL_H_ + +#include + +#include "num.h" +#include "field.h" +#include "group.h" + +static void secp256k1_ge_set_infinity(secp256k1_ge_t *r) { + r->infinity = 1; +} + +static void secp256k1_ge_set_xy(secp256k1_ge_t *r, const secp256k1_fe_t *x, const secp256k1_fe_t *y) { + r->infinity = 0; + r->x = *x; + r->y = *y; +} + +static int secp256k1_ge_is_infinity(const secp256k1_ge_t *a) { + return a->infinity; +} + +static void secp256k1_ge_neg(secp256k1_ge_t *r, const secp256k1_ge_t *a) { + r->infinity = a->infinity; + r->x = a->x; + r->y = a->y; + secp256k1_fe_normalize(&r->y); + secp256k1_fe_negate(&r->y, &r->y, 1); +} + +static void secp256k1_ge_get_hex(char *r, int *rlen, const secp256k1_ge_t *a) { + char cx[65]; int lx=65; + char cy[65]; int ly=65; + secp256k1_fe_get_hex(cx, &lx, &a->x); + secp256k1_fe_get_hex(cy, &ly, &a->y); + lx = strlen(cx); + ly = strlen(cy); + int len = lx + ly + 3 + 1; + if (*rlen < len) { + *rlen = len; + return; + } + *rlen = len; + r[0] = '('; + memcpy(r+1, cx, lx); + r[1+lx] = ','; + memcpy(r+2+lx, cy, ly); + r[2+lx+ly] = ')'; + r[3+lx+ly] = 0; +} + +static void secp256k1_ge_set_gej(secp256k1_ge_t *r, secp256k1_gej_t *a) { + r->infinity = a->infinity; + secp256k1_fe_inv(&a->z, &a->z); + secp256k1_fe_t z2; secp256k1_fe_sqr(&z2, &a->z); + secp256k1_fe_t z3; secp256k1_fe_mul(&z3, &a->z, &z2); + secp256k1_fe_mul(&a->x, &a->x, &z2); + secp256k1_fe_mul(&a->y, &a->y, &z3); + secp256k1_fe_set_int(&a->z, 1); + r->x = a->x; + r->y = a->y; +} + +static void secp256k1_ge_set_gej_var(secp256k1_ge_t *r, secp256k1_gej_t *a) { + r->infinity = a->infinity; + if (a->infinity) { + return; + } + secp256k1_fe_inv_var(&a->z, &a->z); + secp256k1_fe_t z2; secp256k1_fe_sqr(&z2, &a->z); + secp256k1_fe_t z3; secp256k1_fe_mul(&z3, &a->z, &z2); + secp256k1_fe_mul(&a->x, &a->x, &z2); + secp256k1_fe_mul(&a->y, &a->y, &z3); + secp256k1_fe_set_int(&a->z, 1); + r->x = a->x; + r->y = a->y; +} + +static void secp256k1_ge_set_all_gej_var(size_t len, secp256k1_ge_t r[len], const secp256k1_gej_t a[len]) { + size_t count = 0; + secp256k1_fe_t az[len]; + for (size_t i=0; iinfinity = 1; + secp256k1_fe_set_int(&r->x, 0); + secp256k1_fe_set_int(&r->y, 0); + secp256k1_fe_set_int(&r->z, 0); +} + +static void secp256k1_gej_set_xy(secp256k1_gej_t *r, const secp256k1_fe_t *x, const secp256k1_fe_t *y) { + r->infinity = 0; + r->x = *x; + r->y = *y; + secp256k1_fe_set_int(&r->z, 1); +} + +static void secp256k1_gej_clear(secp256k1_gej_t *r) { + r->infinity = 0; + secp256k1_fe_clear(&r->x); + secp256k1_fe_clear(&r->y); + secp256k1_fe_clear(&r->z); +} + +static void secp256k1_ge_clear(secp256k1_ge_t *r) { + r->infinity = 0; + secp256k1_fe_clear(&r->x); + secp256k1_fe_clear(&r->y); +} + +static int secp256k1_ge_set_xo(secp256k1_ge_t *r, const secp256k1_fe_t *x, int odd) { + r->x = *x; + secp256k1_fe_t x2; secp256k1_fe_sqr(&x2, x); + secp256k1_fe_t x3; secp256k1_fe_mul(&x3, x, &x2); + r->infinity = 0; + secp256k1_fe_t c; secp256k1_fe_set_int(&c, 7); + secp256k1_fe_add(&c, &x3); + if (!secp256k1_fe_sqrt(&r->y, &c)) + return 0; + secp256k1_fe_normalize(&r->y); + if (secp256k1_fe_is_odd(&r->y) != odd) + secp256k1_fe_negate(&r->y, &r->y, 1); + return 1; +} + +static void secp256k1_gej_set_ge(secp256k1_gej_t *r, const secp256k1_ge_t *a) { + r->infinity = a->infinity; + r->x = a->x; + r->y = a->y; + secp256k1_fe_set_int(&r->z, 1); +} + +static void secp256k1_gej_get_x_var(secp256k1_fe_t *r, const secp256k1_gej_t *a) { + secp256k1_fe_t zi2; secp256k1_fe_inv_var(&zi2, &a->z); secp256k1_fe_sqr(&zi2, &zi2); + secp256k1_fe_mul(r, &a->x, &zi2); +} + +static void secp256k1_gej_neg(secp256k1_gej_t *r, const secp256k1_gej_t *a) { + r->infinity = a->infinity; + r->x = a->x; + r->y = a->y; + r->z = a->z; + secp256k1_fe_normalize(&r->y); + secp256k1_fe_negate(&r->y, &r->y, 1); +} + +static int secp256k1_gej_is_infinity(const secp256k1_gej_t *a) { + return a->infinity; +} + +static int secp256k1_gej_is_valid(const secp256k1_gej_t *a) { + if (a->infinity) + return 0; + /** y^2 = x^3 + 7 + * (Y/Z^3)^2 = (X/Z^2)^3 + 7 + * Y^2 / Z^6 = X^3 / Z^6 + 7 + * Y^2 = X^3 + 7*Z^6 + */ + secp256k1_fe_t y2; secp256k1_fe_sqr(&y2, &a->y); + secp256k1_fe_t x3; secp256k1_fe_sqr(&x3, &a->x); secp256k1_fe_mul(&x3, &x3, &a->x); + secp256k1_fe_t z2; secp256k1_fe_sqr(&z2, &a->z); + secp256k1_fe_t z6; secp256k1_fe_sqr(&z6, &z2); secp256k1_fe_mul(&z6, &z6, &z2); + secp256k1_fe_mul_int(&z6, 7); + secp256k1_fe_add(&x3, &z6); + secp256k1_fe_normalize(&y2); + secp256k1_fe_normalize(&x3); + return secp256k1_fe_equal(&y2, &x3); +} + +static int secp256k1_ge_is_valid(const secp256k1_ge_t *a) { + if (a->infinity) + return 0; + /* y^2 = x^3 + 7 */ + secp256k1_fe_t y2; secp256k1_fe_sqr(&y2, &a->y); + secp256k1_fe_t x3; secp256k1_fe_sqr(&x3, &a->x); secp256k1_fe_mul(&x3, &x3, &a->x); + secp256k1_fe_t c; secp256k1_fe_set_int(&c, 7); + secp256k1_fe_add(&x3, &c); + secp256k1_fe_normalize(&y2); + secp256k1_fe_normalize(&x3); + return secp256k1_fe_equal(&y2, &x3); +} + +static void secp256k1_gej_double_var(secp256k1_gej_t *r, const secp256k1_gej_t *a) { + if (a->infinity) { + r->infinity = 1; + return; + } + + secp256k1_fe_t t5 = a->y; + secp256k1_fe_normalize(&t5); + if (secp256k1_fe_is_zero(&t5)) { + r->infinity = 1; + return; + } + + secp256k1_fe_t t1,t2,t3,t4; + secp256k1_fe_mul(&r->z, &t5, &a->z); + secp256k1_fe_mul_int(&r->z, 2); /* Z' = 2*Y*Z (2) */ + secp256k1_fe_sqr(&t1, &a->x); + secp256k1_fe_mul_int(&t1, 3); /* T1 = 3*X^2 (3) */ + secp256k1_fe_sqr(&t2, &t1); /* T2 = 9*X^4 (1) */ + secp256k1_fe_sqr(&t3, &t5); + secp256k1_fe_mul_int(&t3, 2); /* T3 = 2*Y^2 (2) */ + secp256k1_fe_sqr(&t4, &t3); + secp256k1_fe_mul_int(&t4, 2); /* T4 = 8*Y^4 (2) */ + secp256k1_fe_mul(&t3, &a->x, &t3); /* T3 = 2*X*Y^2 (1) */ + r->x = t3; + secp256k1_fe_mul_int(&r->x, 4); /* X' = 8*X*Y^2 (4) */ + secp256k1_fe_negate(&r->x, &r->x, 4); /* X' = -8*X*Y^2 (5) */ + secp256k1_fe_add(&r->x, &t2); /* X' = 9*X^4 - 8*X*Y^2 (6) */ + secp256k1_fe_negate(&t2, &t2, 1); /* T2 = -9*X^4 (2) */ + secp256k1_fe_mul_int(&t3, 6); /* T3 = 12*X*Y^2 (6) */ + secp256k1_fe_add(&t3, &t2); /* T3 = 12*X*Y^2 - 9*X^4 (8) */ + secp256k1_fe_mul(&r->y, &t1, &t3); /* Y' = 36*X^3*Y^2 - 27*X^6 (1) */ + secp256k1_fe_negate(&t2, &t4, 2); /* T2 = -8*Y^4 (3) */ + secp256k1_fe_add(&r->y, &t2); /* Y' = 36*X^3*Y^2 - 27*X^6 - 8*Y^4 (4) */ + r->infinity = 0; +} + +static void secp256k1_gej_add_var(secp256k1_gej_t *r, const secp256k1_gej_t *a, const secp256k1_gej_t *b) { + if (a->infinity) { + *r = *b; + return; + } + if (b->infinity) { + *r = *a; + return; + } + r->infinity = 0; + secp256k1_fe_t z22; secp256k1_fe_sqr(&z22, &b->z); + secp256k1_fe_t z12; secp256k1_fe_sqr(&z12, &a->z); + secp256k1_fe_t u1; secp256k1_fe_mul(&u1, &a->x, &z22); + secp256k1_fe_t u2; secp256k1_fe_mul(&u2, &b->x, &z12); + secp256k1_fe_t s1; secp256k1_fe_mul(&s1, &a->y, &z22); secp256k1_fe_mul(&s1, &s1, &b->z); + secp256k1_fe_t s2; secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z); + secp256k1_fe_normalize(&u1); + secp256k1_fe_normalize(&u2); + if (secp256k1_fe_equal(&u1, &u2)) { + secp256k1_fe_normalize(&s1); + secp256k1_fe_normalize(&s2); + if (secp256k1_fe_equal(&s1, &s2)) { + secp256k1_gej_double_var(r, a); + } else { + r->infinity = 1; + } + return; + } + secp256k1_fe_t h; secp256k1_fe_negate(&h, &u1, 1); secp256k1_fe_add(&h, &u2); + secp256k1_fe_t i; secp256k1_fe_negate(&i, &s1, 1); secp256k1_fe_add(&i, &s2); + secp256k1_fe_t i2; secp256k1_fe_sqr(&i2, &i); + secp256k1_fe_t h2; secp256k1_fe_sqr(&h2, &h); + secp256k1_fe_t h3; secp256k1_fe_mul(&h3, &h, &h2); + secp256k1_fe_mul(&r->z, &a->z, &b->z); secp256k1_fe_mul(&r->z, &r->z, &h); + secp256k1_fe_t t; secp256k1_fe_mul(&t, &u1, &h2); + r->x = t; secp256k1_fe_mul_int(&r->x, 2); secp256k1_fe_add(&r->x, &h3); secp256k1_fe_negate(&r->x, &r->x, 3); secp256k1_fe_add(&r->x, &i2); + secp256k1_fe_negate(&r->y, &r->x, 5); secp256k1_fe_add(&r->y, &t); secp256k1_fe_mul(&r->y, &r->y, &i); + secp256k1_fe_mul(&h3, &h3, &s1); secp256k1_fe_negate(&h3, &h3, 1); + secp256k1_fe_add(&r->y, &h3); +} + +static void secp256k1_gej_add_ge_var(secp256k1_gej_t *r, const secp256k1_gej_t *a, const secp256k1_ge_t *b) { + if (a->infinity) { + r->infinity = b->infinity; + r->x = b->x; + r->y = b->y; + secp256k1_fe_set_int(&r->z, 1); + return; + } + if (b->infinity) { + *r = *a; + return; + } + r->infinity = 0; + secp256k1_fe_t z12; secp256k1_fe_sqr(&z12, &a->z); + secp256k1_fe_t u1 = a->x; secp256k1_fe_normalize(&u1); + secp256k1_fe_t u2; secp256k1_fe_mul(&u2, &b->x, &z12); + secp256k1_fe_t s1 = a->y; secp256k1_fe_normalize(&s1); + secp256k1_fe_t s2; secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z); + secp256k1_fe_normalize(&u1); + secp256k1_fe_normalize(&u2); + if (secp256k1_fe_equal(&u1, &u2)) { + secp256k1_fe_normalize(&s1); + secp256k1_fe_normalize(&s2); + if (secp256k1_fe_equal(&s1, &s2)) { + secp256k1_gej_double_var(r, a); + } else { + r->infinity = 1; + } + return; + } + secp256k1_fe_t h; secp256k1_fe_negate(&h, &u1, 1); secp256k1_fe_add(&h, &u2); + secp256k1_fe_t i; secp256k1_fe_negate(&i, &s1, 1); secp256k1_fe_add(&i, &s2); + secp256k1_fe_t i2; secp256k1_fe_sqr(&i2, &i); + secp256k1_fe_t h2; secp256k1_fe_sqr(&h2, &h); + secp256k1_fe_t h3; secp256k1_fe_mul(&h3, &h, &h2); + r->z = a->z; secp256k1_fe_mul(&r->z, &r->z, &h); + secp256k1_fe_t t; secp256k1_fe_mul(&t, &u1, &h2); + r->x = t; secp256k1_fe_mul_int(&r->x, 2); secp256k1_fe_add(&r->x, &h3); secp256k1_fe_negate(&r->x, &r->x, 3); secp256k1_fe_add(&r->x, &i2); + secp256k1_fe_negate(&r->y, &r->x, 5); secp256k1_fe_add(&r->y, &t); secp256k1_fe_mul(&r->y, &r->y, &i); + secp256k1_fe_mul(&h3, &h3, &s1); secp256k1_fe_negate(&h3, &h3, 1); + secp256k1_fe_add(&r->y, &h3); +} + +static void secp256k1_gej_add_ge(secp256k1_gej_t *r, const secp256k1_gej_t *a, const secp256k1_ge_t *b) { + VERIFY_CHECK(!b->infinity); + VERIFY_CHECK(a->infinity == 0 || a->infinity == 1); + + /** In: + * Eric Brier and Marc Joye, Weierstrass Elliptic Curves and Side-Channel Attacks. + * In D. Naccache and P. Paillier, Eds., Public Key Cryptography, vol. 2274 of Lecture Notes in Computer Science, pages 335-345. Springer-Verlag, 2002. + * we find as solution for a unified addition/doubling formula: + * lambda = ((x1 + x2)^2 - x1 * x2 + a) / (y1 + y2), with a = 0 for secp256k1's curve equation. + * x3 = lambda^2 - (x1 + x2) + * 2*y3 = lambda * (x1 + x2 - 2 * x3) - (y1 + y2). + * + * Substituting x_i = Xi / Zi^2 and yi = Yi / Zi^3, for i=1,2,3, gives: + * U1 = X1*Z2^2, U2 = X2*Z1^2 + * S1 = X1*Z2^3, S2 = X2*Z2^3 + * Z = Z1*Z2 + * T = U1+U2 + * M = S1+S2 + * Q = T*M^2 + * R = T^2-U1*U2 + * X3 = 4*(R^2-Q) + * Y3 = 4*(R*(3*Q-2*R^2)-M^4) + * Z3 = 2*M*Z + * (Note that the paper uses xi = Xi / Zi and yi = Yi / Zi instead.) + */ + + secp256k1_fe_t zz; secp256k1_fe_sqr(&zz, &a->z); /* z = Z1^2 */ + secp256k1_fe_t u1 = a->x; secp256k1_fe_normalize(&u1); /* u1 = U1 = X1*Z2^2 (1) */ + secp256k1_fe_t u2; secp256k1_fe_mul(&u2, &b->x, &zz); /* u2 = U2 = X2*Z1^2 (1) */ + secp256k1_fe_t s1 = a->y; secp256k1_fe_normalize(&s1); /* s1 = S1 = Y1*Z2^3 (1) */ + secp256k1_fe_t s2; secp256k1_fe_mul(&s2, &b->y, &zz); /* s2 = Y2*Z2^2 (1) */ + secp256k1_fe_mul(&s2, &s2, &a->z); /* s2 = S2 = Y2*Z1^3 (1) */ + secp256k1_fe_t z = a->z; /* z = Z = Z1*Z2 (8) */ + secp256k1_fe_t t = u1; secp256k1_fe_add(&t, &u2); /* t = T = U1+U2 (2) */ + secp256k1_fe_t m = s1; secp256k1_fe_add(&m, &s2); /* m = M = S1+S2 (2) */ + secp256k1_fe_t n; secp256k1_fe_sqr(&n, &m); /* n = M^2 (1) */ + secp256k1_fe_t q; secp256k1_fe_mul(&q, &n, &t); /* q = Q = T*M^2 (1) */ + secp256k1_fe_sqr(&n, &n); /* n = M^4 (1) */ + secp256k1_fe_t rr; secp256k1_fe_sqr(&rr, &t); /* rr = T^2 (1) */ + secp256k1_fe_mul(&t, &u1, &u2); secp256k1_fe_negate(&t, &t, 1); /* t = -U1*U2 (2) */ + secp256k1_fe_add(&rr, &t); /* rr = R = T^2-U1*U2 (3) */ + secp256k1_fe_sqr(&t, &rr); /* t = R^2 (1) */ + secp256k1_fe_mul(&r->z, &m, &z); /* r->z = M*Z (1) */ + secp256k1_fe_normalize(&r->z); + int infinity = secp256k1_fe_is_zero(&r->z) * (1 - a->infinity); + secp256k1_fe_mul_int(&r->z, 2 * (1 - a->infinity)); /* r->z = Z3 = 2*M*Z (2) */ + r->x = t; /* r->x = R^2 (1) */ + secp256k1_fe_negate(&q, &q, 1); /* q = -Q (2) */ + secp256k1_fe_add(&r->x, &q); /* r->x = R^2-Q (3) */ + secp256k1_fe_normalize(&r->x); + secp256k1_fe_mul_int(&q, 3); /* q = -3*Q (6) */ + secp256k1_fe_mul_int(&t, 2); /* t = 2*R^2 (2) */ + secp256k1_fe_add(&t, &q); /* t = 2*R^2-3*Q (8) */ + secp256k1_fe_mul(&t, &t, &rr); /* t = R*(2*R^2-3*Q) (1) */ + secp256k1_fe_add(&t, &n); /* t = R*(2*R^2-3*Q)+M^4 (2) */ + secp256k1_fe_negate(&r->y, &t, 2); /* r->y = R*(3*Q-2*R^2)-M^4 (3) */ + secp256k1_fe_normalize(&r->y); + secp256k1_fe_mul_int(&r->x, 4 * (1 - a->infinity)); /* r->x = X3 = 4*(R^2-Q) */ + secp256k1_fe_mul_int(&r->y, 4 * (1 - a->infinity)); /* r->y = Y3 = 4*R*(3*Q-2*R^2)-4*M^4 (4) */ + + /** In case a->infinity == 1, the above code results in r->x, r->y, and r->z all equal to 0. + * Add b->x to x, b->y to y, and 1 to z in that case. + */ + t = b->x; secp256k1_fe_mul_int(&t, a->infinity); + secp256k1_fe_add(&r->x, &t); + t = b->y; secp256k1_fe_mul_int(&t, a->infinity); + secp256k1_fe_add(&r->y, &t); + secp256k1_fe_set_int(&t, a->infinity); + secp256k1_fe_add(&r->z, &t); + r->infinity = infinity; +} + + + +static void secp256k1_gej_get_hex(char *r, int *rlen, const secp256k1_gej_t *a) { + secp256k1_gej_t c = *a; + secp256k1_ge_t t; secp256k1_ge_set_gej(&t, &c); + secp256k1_ge_get_hex(r, rlen, &t); +} + +#ifdef USE_ENDOMORPHISM +static void secp256k1_gej_mul_lambda(secp256k1_gej_t *r, const secp256k1_gej_t *a) { + const secp256k1_fe_t *beta = &secp256k1_ge_consts->beta; + *r = *a; + secp256k1_fe_mul(&r->x, &r->x, beta); +} + +static void secp256k1_gej_split_exp_var(secp256k1_num_t *r1, secp256k1_num_t *r2, const secp256k1_num_t *a) { + const secp256k1_ge_consts_t *c = secp256k1_ge_consts; + secp256k1_num_t bnc1, bnc2, bnt1, bnt2, bnn2; + + secp256k1_num_copy(&bnn2, &c->order); + secp256k1_num_shift(&bnn2, 1); + + secp256k1_num_mul(&bnc1, a, &c->a1b2); + secp256k1_num_add(&bnc1, &bnc1, &bnn2); + secp256k1_num_div(&bnc1, &bnc1, &c->order); + + secp256k1_num_mul(&bnc2, a, &c->b1); + secp256k1_num_add(&bnc2, &bnc2, &bnn2); + secp256k1_num_div(&bnc2, &bnc2, &c->order); + + secp256k1_num_mul(&bnt1, &bnc1, &c->a1b2); + secp256k1_num_mul(&bnt2, &bnc2, &c->a2); + secp256k1_num_add(&bnt1, &bnt1, &bnt2); + secp256k1_num_sub(r1, a, &bnt1); + secp256k1_num_mul(&bnt1, &bnc1, &c->b1); + secp256k1_num_mul(&bnt2, &bnc2, &c->a1b2); + secp256k1_num_sub(r2, &bnt1, &bnt2); +} +#endif + + +static void secp256k1_ge_start(void) { + static const unsigned char secp256k1_ge_consts_order[] = { + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE, + 0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B, + 0xBF,0xD2,0x5E,0x8C,0xD0,0x36,0x41,0x41 + }; + static const unsigned char secp256k1_ge_consts_g_x[] = { + 0x79,0xBE,0x66,0x7E,0xF9,0xDC,0xBB,0xAC, + 0x55,0xA0,0x62,0x95,0xCE,0x87,0x0B,0x07, + 0x02,0x9B,0xFC,0xDB,0x2D,0xCE,0x28,0xD9, + 0x59,0xF2,0x81,0x5B,0x16,0xF8,0x17,0x98 + }; + static const unsigned char secp256k1_ge_consts_g_y[] = { + 0x48,0x3A,0xDA,0x77,0x26,0xA3,0xC4,0x65, + 0x5D,0xA4,0xFB,0xFC,0x0E,0x11,0x08,0xA8, + 0xFD,0x17,0xB4,0x48,0xA6,0x85,0x54,0x19, + 0x9C,0x47,0xD0,0x8F,0xFB,0x10,0xD4,0xB8 + }; +#ifdef USE_ENDOMORPHISM + /* properties of secp256k1's efficiently computable endomorphism */ + static const unsigned char secp256k1_ge_consts_lambda[] = { + 0x53,0x63,0xad,0x4c,0xc0,0x5c,0x30,0xe0, + 0xa5,0x26,0x1c,0x02,0x88,0x12,0x64,0x5a, + 0x12,0x2e,0x22,0xea,0x20,0x81,0x66,0x78, + 0xdf,0x02,0x96,0x7c,0x1b,0x23,0xbd,0x72 + }; + static const unsigned char secp256k1_ge_consts_beta[] = { + 0x7a,0xe9,0x6a,0x2b,0x65,0x7c,0x07,0x10, + 0x6e,0x64,0x47,0x9e,0xac,0x34,0x34,0xe9, + 0x9c,0xf0,0x49,0x75,0x12,0xf5,0x89,0x95, + 0xc1,0x39,0x6c,0x28,0x71,0x95,0x01,0xee + }; + static const unsigned char secp256k1_ge_consts_a1b2[] = { + 0x30,0x86,0xd2,0x21,0xa7,0xd4,0x6b,0xcd, + 0xe8,0x6c,0x90,0xe4,0x92,0x84,0xeb,0x15 + }; + static const unsigned char secp256k1_ge_consts_b1[] = { + 0xe4,0x43,0x7e,0xd6,0x01,0x0e,0x88,0x28, + 0x6f,0x54,0x7f,0xa9,0x0a,0xbf,0xe4,0xc3 + }; + static const unsigned char secp256k1_ge_consts_a2[] = { + 0x01, + 0x14,0xca,0x50,0xf7,0xa8,0xe2,0xf3,0xf6, + 0x57,0xc1,0x10,0x8d,0x9d,0x44,0xcf,0xd8 + }; +#endif + if (secp256k1_ge_consts == NULL) { + secp256k1_ge_consts_t *ret = (secp256k1_ge_consts_t*)malloc(sizeof(secp256k1_ge_consts_t)); + secp256k1_num_set_bin(&ret->order, secp256k1_ge_consts_order, sizeof(secp256k1_ge_consts_order)); + secp256k1_num_copy(&ret->half_order, &ret->order); + secp256k1_num_shift(&ret->half_order, 1); +#ifdef USE_ENDOMORPHISM + secp256k1_num_set_bin(&ret->lambda, secp256k1_ge_consts_lambda, sizeof(secp256k1_ge_consts_lambda)); + secp256k1_num_set_bin(&ret->a1b2, secp256k1_ge_consts_a1b2, sizeof(secp256k1_ge_consts_a1b2)); + secp256k1_num_set_bin(&ret->a2, secp256k1_ge_consts_a2, sizeof(secp256k1_ge_consts_a2)); + secp256k1_num_set_bin(&ret->b1, secp256k1_ge_consts_b1, sizeof(secp256k1_ge_consts_b1)); + secp256k1_fe_set_b32(&ret->beta, secp256k1_ge_consts_beta); +#endif + secp256k1_fe_t g_x, g_y; + secp256k1_fe_set_b32(&g_x, secp256k1_ge_consts_g_x); + secp256k1_fe_set_b32(&g_y, secp256k1_ge_consts_g_y); + secp256k1_ge_set_xy(&ret->g, &g_x, &g_y); + secp256k1_ge_consts = ret; + } +} + +static void secp256k1_ge_stop(void) { + if (secp256k1_ge_consts != NULL) { + secp256k1_ge_consts_t *c = (secp256k1_ge_consts_t*)secp256k1_ge_consts; + free((void*)c); + secp256k1_ge_consts = NULL; + } +} + +#endif diff --git a/src/java/org/bitcoin/NativeSecp256k1.java b/src/java/org/bitcoin/NativeSecp256k1.java new file mode 100644 index 0000000000..90a498eaa2 --- /dev/null +++ b/src/java/org/bitcoin/NativeSecp256k1.java @@ -0,0 +1,60 @@ +package org.bitcoin; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +import com.google.common.base.Preconditions; + + +/** + * This class holds native methods to handle ECDSA verification. + * You can find an example library that can be used for this at + * https://github.com/sipa/secp256k1 + */ +public class NativeSecp256k1 { + public static final boolean enabled; + static { + boolean isEnabled = true; + try { + System.loadLibrary("javasecp256k1"); + } catch (UnsatisfiedLinkError e) { + isEnabled = false; + } + enabled = isEnabled; + } + + private static ThreadLocal nativeECDSABuffer = new ThreadLocal(); + /** + * Verifies the given secp256k1 signature in native code. + * Calling when enabled == false is undefined (probably library not loaded) + * + * @param data The data which was signed, must be exactly 32 bytes + * @param signature The signature + * @param pub The public key which did the signing + */ + public static boolean verify(byte[] data, byte[] signature, byte[] pub) { + Preconditions.checkArgument(data.length == 32 && signature.length <= 520 && pub.length <= 520); + + ByteBuffer byteBuff = nativeECDSABuffer.get(); + if (byteBuff == null) { + byteBuff = ByteBuffer.allocateDirect(32 + 8 + 520 + 520); + byteBuff.order(ByteOrder.nativeOrder()); + nativeECDSABuffer.set(byteBuff); + } + byteBuff.rewind(); + byteBuff.put(data); + byteBuff.putInt(signature.length); + byteBuff.putInt(pub.length); + byteBuff.put(signature); + byteBuff.put(pub); + return secp256k1_ecdsa_verify(byteBuff) == 1; + } + + /** + * @param byteBuff signature format is byte[32] data, + * native-endian int signatureLength, native-endian int pubkeyLength, + * byte[signatureLength] signature, byte[pubkeyLength] pub + * @returns 1 for valid signature, anything else for invalid + */ + private static native int secp256k1_ecdsa_verify(ByteBuffer byteBuff); +} diff --git a/src/java/org_bitcoin_NativeSecp256k1.c b/src/java/org_bitcoin_NativeSecp256k1.c new file mode 100644 index 0000000000..bb4cd70728 --- /dev/null +++ b/src/java/org_bitcoin_NativeSecp256k1.c @@ -0,0 +1,23 @@ +#include "org_bitcoin_NativeSecp256k1.h" +#include "include/secp256k1.h" + +JNIEXPORT jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify + (JNIEnv* env, jclass classObject, jobject byteBufferObject) +{ + unsigned char* data = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject); + int sigLen = *((int*)(data + 32)); + int pubLen = *((int*)(data + 32 + 4)); + + return secp256k1_ecdsa_verify(data, 32, data+32+8, sigLen, data+32+8+sigLen, pubLen); +} + +static void __javasecp256k1_attach(void) __attribute__((constructor)); +static void __javasecp256k1_detach(void) __attribute__((destructor)); + +static void __javasecp256k1_attach(void) { + secp256k1_start(SECP256K1_START_VERIFY); +} + +static void __javasecp256k1_detach(void) { + secp256k1_stop(); +} diff --git a/src/java/org_bitcoin_NativeSecp256k1.h b/src/java/org_bitcoin_NativeSecp256k1.h new file mode 100644 index 0000000000..d7fb004fa8 --- /dev/null +++ b/src/java/org_bitcoin_NativeSecp256k1.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_bitcoin_NativeSecp256k1 */ + +#ifndef _Included_org_bitcoin_NativeSecp256k1 +#define _Included_org_bitcoin_NativeSecp256k1 +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_bitcoin_NativeSecp256k1 + * Method: secp256k1_ecdsa_verify + * Signature: (Ljava/nio/ByteBuffer;)I + */ +JNIEXPORT jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify + (JNIEnv *, jclass, jobject); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/num.h b/src/num.h new file mode 100644 index 0000000000..c86f847858 --- /dev/null +++ b/src/num.h @@ -0,0 +1,100 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_NUM_ +#define _SECP256K1_NUM_ + +#if defined HAVE_CONFIG_H +#include "libsecp256k1-config.h" +#endif + +#if defined(USE_NUM_GMP) +#include "num_gmp.h" +#else +#error "Please select num implementation" +#endif + +/** Clear a number to prevent the leak of sensitive data. */ +static void secp256k1_num_clear(secp256k1_num_t *r); + +/** Copy a number. */ +static void secp256k1_num_copy(secp256k1_num_t *r, const secp256k1_num_t *a); + +/** Convert a number's absolute value to a binary big-endian string. + * There must be enough place. */ +static void secp256k1_num_get_bin(unsigned char *r, unsigned int rlen, const secp256k1_num_t *a); + +/** Set a number to the value of a binary big-endian string. */ +static void secp256k1_num_set_bin(secp256k1_num_t *r, const unsigned char *a, unsigned int alen); + +/** Set a number equal to a (signed) integer. */ +static void secp256k1_num_set_int(secp256k1_num_t *r, int a); + +/** Compute a modular inverse. The input must be less than the modulus. */ +static void secp256k1_num_mod_inverse(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *m); + +/** Multiply two numbers modulo another. */ +static void secp256k1_num_mod_mul(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b, const secp256k1_num_t *m); + +/** Compare the absolute value of two numbers. */ +static int secp256k1_num_cmp(const secp256k1_num_t *a, const secp256k1_num_t *b); + +/** Test whether two number are equal (including sign). */ +static int secp256k1_num_eq(const secp256k1_num_t *a, const secp256k1_num_t *b); + +/** Add two (signed) numbers. */ +static void secp256k1_num_add(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b); + +/** Subtract two (signed) numbers. */ +static void secp256k1_num_sub(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b); + +/** Multiply two (signed) numbers. */ +static void secp256k1_num_mul(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b); + +/** Divide two (signed) numbers. */ +static void secp256k1_num_div(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b); + +/** Replace a number by its remainder modulo m. M's sign is ignored. The result is a number between 0 and m-1, + even if r was negative. */ +static void secp256k1_num_mod(secp256k1_num_t *r, const secp256k1_num_t *m); + +/** Calculate the number of bits in (the absolute value of) a number. */ +static int secp256k1_num_bits(const secp256k1_num_t *a); + +/** Right-shift the passed number by bits bits, and return those bits. */ +static int secp256k1_num_shift(secp256k1_num_t *r, int bits); + +/** Check whether a number is zero. */ +static int secp256k1_num_is_zero(const secp256k1_num_t *a); + +/** Check whether a number is odd. */ +static int secp256k1_num_is_odd(const secp256k1_num_t *a); + +/** Check whether a number is strictly negative. */ +static int secp256k1_num_is_neg(const secp256k1_num_t *a); + +/** Check whether a particular bit is set in a number. */ +static int secp256k1_num_get_bit(const secp256k1_num_t *a, int pos); + +/** Increase a number by 1. */ +static void secp256k1_num_inc(secp256k1_num_t *r); + +/** Set a number equal to the value of a hex string (unsigned). */ +static void secp256k1_num_set_hex(secp256k1_num_t *r, const char *a, int alen); + +/** Convert (the absolute value of) a number to a hexadecimal string. */ +static void secp256k1_num_get_hex(char *r, int rlen, const secp256k1_num_t *a); + +/** Split a number into a low and high part. */ +static void secp256k1_num_split(secp256k1_num_t *rl, secp256k1_num_t *rh, const secp256k1_num_t *a, int bits); + +/** Change a number's sign. */ +static void secp256k1_num_negate(secp256k1_num_t *r); + +/** Get a bunch of bits from a number. */ +static int secp256k1_num_get_bits(const secp256k1_num_t *a, int offset, int count); + +#endif diff --git a/src/num_gmp.h b/src/num_gmp.h new file mode 100644 index 0000000000..baa1f2bf2e --- /dev/null +++ b/src/num_gmp.h @@ -0,0 +1,20 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_NUM_REPR_ +#define _SECP256K1_NUM_REPR_ + +#include + +#define NUM_LIMBS ((256+GMP_NUMB_BITS-1)/GMP_NUMB_BITS) + +typedef struct { + mp_limb_t data[2*NUM_LIMBS]; + int neg; + int limbs; +} secp256k1_num_t; + +#endif diff --git a/src/num_gmp_impl.h b/src/num_gmp_impl.h new file mode 100644 index 0000000000..e45a59e0cd --- /dev/null +++ b/src/num_gmp_impl.h @@ -0,0 +1,376 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_NUM_REPR_IMPL_H_ +#define _SECP256K1_NUM_REPR_IMPL_H_ + +#include +#include +#include + +#include "util.h" +#include "num.h" + +#ifdef VERIFY +static void secp256k1_num_sanity(const secp256k1_num_t *a) { + VERIFY_CHECK(a->limbs == 1 || (a->limbs > 1 && a->data[a->limbs-1] != 0)); +} +#else +#define secp256k1_num_sanity(a) do { } while(0) +#endif + +static void secp256k1_num_init(secp256k1_num_t *r) { + r->neg = 0; + r->limbs = 1; + r->data[0] = 0; +} + +static void secp256k1_num_clear(secp256k1_num_t *r) { + memset(r, 0, sizeof(*r)); +} + +static void secp256k1_num_free(secp256k1_num_t *r) { + (void)r; +} + +static void secp256k1_num_copy(secp256k1_num_t *r, const secp256k1_num_t *a) { + *r = *a; +} + +static int secp256k1_num_bits(const secp256k1_num_t *a) { + int ret=(a->limbs-1)*GMP_NUMB_BITS; + mp_limb_t x=a->data[a->limbs-1]; + while (x) { + x >>= 1; + ret++; + } + return ret; +} + + +static void secp256k1_num_get_bin(unsigned char *r, unsigned int rlen, const secp256k1_num_t *a) { + unsigned char tmp[65]; + int len = 0; + if (a->limbs>1 || a->data[0] != 0) { + len = mpn_get_str(tmp, 256, (mp_limb_t*)a->data, a->limbs); + } + int shift = 0; + while (shift < len && tmp[shift] == 0) shift++; + VERIFY_CHECK(len-shift <= (int)rlen); + memset(r, 0, rlen - len + shift); + if (len > shift) { + memcpy(r + rlen - len + shift, tmp + shift, len - shift); + } + memset(tmp, 0, sizeof(tmp)); +} + +static void secp256k1_num_set_bin(secp256k1_num_t *r, const unsigned char *a, unsigned int alen) { + VERIFY_CHECK(alen > 0); + VERIFY_CHECK(alen <= 64); + int len = mpn_set_str(r->data, a, alen, 256); + VERIFY_CHECK(len <= NUM_LIMBS*2); + r->limbs = len; + r->neg = 0; + while (r->limbs > 1 && r->data[r->limbs-1]==0) r->limbs--; +} + +static void secp256k1_num_set_int(secp256k1_num_t *r, int a) { + r->limbs = 1; + r->neg = (a < 0); + r->data[0] = (a < 0) ? -a : a; +} + +static void secp256k1_num_add_abs(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) { + mp_limb_t c = mpn_add(r->data, a->data, a->limbs, b->data, b->limbs); + r->limbs = a->limbs; + if (c != 0) { + VERIFY_CHECK(r->limbs < 2*NUM_LIMBS); + r->data[r->limbs++] = c; + } +} + +static void secp256k1_num_sub_abs(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) { + mp_limb_t c = mpn_sub(r->data, a->data, a->limbs, b->data, b->limbs); + VERIFY_CHECK(c == 0); + r->limbs = a->limbs; + while (r->limbs > 1 && r->data[r->limbs-1]==0) r->limbs--; +} + +static void secp256k1_num_mod(secp256k1_num_t *r, const secp256k1_num_t *m) { + secp256k1_num_sanity(r); + secp256k1_num_sanity(m); + + if (r->limbs >= m->limbs) { + mp_limb_t t[2*NUM_LIMBS]; + mpn_tdiv_qr(t, r->data, 0, r->data, r->limbs, m->data, m->limbs); + memset(t, 0, sizeof(t)); + r->limbs = m->limbs; + while (r->limbs > 1 && r->data[r->limbs-1]==0) r->limbs--; + } + + if (r->neg && (r->limbs > 1 || r->data[0] != 0)) { + secp256k1_num_sub_abs(r, m, r); + r->neg = 0; + } +} + +static void secp256k1_num_mod_inverse(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *m) { + secp256k1_num_sanity(a); + secp256k1_num_sanity(m); + + /** mpn_gcdext computes: (G,S) = gcdext(U,V), where + * * G = gcd(U,V) + * * G = U*S + V*T + * * U has equal or more limbs than V, and V has no padding + * If we set U to be (a padded version of) a, and V = m: + * G = a*S + m*T + * G = a*S mod m + * Assuming G=1: + * S = 1/a mod m + */ + VERIFY_CHECK(m->limbs <= NUM_LIMBS); + VERIFY_CHECK(m->data[m->limbs-1] != 0); + mp_limb_t g[NUM_LIMBS+1]; + mp_limb_t u[NUM_LIMBS+1]; + mp_limb_t v[NUM_LIMBS+1]; + for (int i=0; i < m->limbs; i++) { + u[i] = (i < a->limbs) ? a->data[i] : 0; + v[i] = m->data[i]; + } + mp_size_t sn = NUM_LIMBS+1; + mp_size_t gn = mpn_gcdext(g, r->data, &sn, u, m->limbs, v, m->limbs); + VERIFY_CHECK(gn == 1); + VERIFY_CHECK(g[0] == 1); + r->neg = a->neg ^ m->neg; + if (sn < 0) { + mpn_sub(r->data, m->data, m->limbs, r->data, -sn); + r->limbs = m->limbs; + while (r->limbs > 1 && r->data[r->limbs-1]==0) r->limbs--; + } else { + r->limbs = sn; + } + memset(g, 0, sizeof(g)); + memset(u, 0, sizeof(u)); + memset(v, 0, sizeof(v)); +} + +static int secp256k1_num_is_zero(const secp256k1_num_t *a) { + return (a->limbs == 1 && a->data[0] == 0); +} + +static int secp256k1_num_is_odd(const secp256k1_num_t *a) { + return a->data[0] & 1; +} + +static int secp256k1_num_is_neg(const secp256k1_num_t *a) { + return (a->limbs > 1 || a->data[0] != 0) && a->neg; +} + +static int secp256k1_num_cmp(const secp256k1_num_t *a, const secp256k1_num_t *b) { + if (a->limbs > b->limbs) return 1; + if (a->limbs < b->limbs) return -1; + return mpn_cmp(a->data, b->data, a->limbs); +} + +static int secp256k1_num_eq(const secp256k1_num_t *a, const secp256k1_num_t *b) { + if (a->limbs > b->limbs) return 0; + if (a->limbs < b->limbs) return 0; + if ((a->neg && !secp256k1_num_is_zero(a)) != (b->neg && !secp256k1_num_is_zero(b))) return 0; + return mpn_cmp(a->data, b->data, a->limbs) == 0; +} + +static void secp256k1_num_subadd(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b, int bneg) { + if (!(b->neg ^ bneg ^ a->neg)) { /* a and b have the same sign */ + r->neg = a->neg; + if (a->limbs >= b->limbs) { + secp256k1_num_add_abs(r, a, b); + } else { + secp256k1_num_add_abs(r, b, a); + } + } else { + if (secp256k1_num_cmp(a, b) > 0) { + r->neg = a->neg; + secp256k1_num_sub_abs(r, a, b); + } else { + r->neg = b->neg ^ bneg; + secp256k1_num_sub_abs(r, b, a); + } + } +} + +static void secp256k1_num_add(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) { + secp256k1_num_sanity(a); + secp256k1_num_sanity(b); + secp256k1_num_subadd(r, a, b, 0); +} + +static void secp256k1_num_sub(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) { + secp256k1_num_sanity(a); + secp256k1_num_sanity(b); + secp256k1_num_subadd(r, a, b, 1); +} + +static void secp256k1_num_mul(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) { + secp256k1_num_sanity(a); + secp256k1_num_sanity(b); + + mp_limb_t tmp[2*NUM_LIMBS+1]; + VERIFY_CHECK(a->limbs + b->limbs <= 2*NUM_LIMBS+1); + if ((a->limbs==1 && a->data[0]==0) || (b->limbs==1 && b->data[0]==0)) { + r->limbs = 1; + r->neg = 0; + r->data[0] = 0; + return; + } + if (a->limbs >= b->limbs) + mpn_mul(tmp, a->data, a->limbs, b->data, b->limbs); + else + mpn_mul(tmp, b->data, b->limbs, a->data, a->limbs); + r->limbs = a->limbs + b->limbs; + if (r->limbs > 1 && tmp[r->limbs - 1]==0) r->limbs--; + VERIFY_CHECK(r->limbs <= 2*NUM_LIMBS); + mpn_copyi(r->data, tmp, r->limbs); + r->neg = a->neg ^ b->neg; + memset(tmp, 0, sizeof(tmp)); +} + +static void secp256k1_num_div(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) { + secp256k1_num_sanity(a); + secp256k1_num_sanity(b); + if (b->limbs > a->limbs) { + r->limbs = 1; + r->data[0] = 0; + r->neg = 0; + return; + } + + mp_limb_t quo[2*NUM_LIMBS+1]; + mp_limb_t rem[2*NUM_LIMBS+1]; + mpn_tdiv_qr(quo, rem, 0, a->data, a->limbs, b->data, b->limbs); + mpn_copyi(r->data, quo, a->limbs - b->limbs + 1); + r->limbs = a->limbs - b->limbs + 1; + while (r->limbs > 1 && r->data[r->limbs - 1]==0) r->limbs--; + r->neg = a->neg ^ b->neg; +} + +static void secp256k1_num_mod_mul(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b, const secp256k1_num_t *m) { + secp256k1_num_mul(r, a, b); + secp256k1_num_mod(r, m); +} + + +static int secp256k1_num_shift(secp256k1_num_t *r, int bits) { + VERIFY_CHECK(bits <= GMP_NUMB_BITS); + mp_limb_t ret = mpn_rshift(r->data, r->data, r->limbs, bits); + if (r->limbs>1 && r->data[r->limbs-1]==0) r->limbs--; + ret >>= (GMP_NUMB_BITS - bits); + return ret; +} + +static int secp256k1_num_get_bit(const secp256k1_num_t *a, int pos) { + return (a->limbs*GMP_NUMB_BITS > pos) && ((a->data[pos/GMP_NUMB_BITS] >> (pos % GMP_NUMB_BITS)) & 1); +} + +static void secp256k1_num_inc(secp256k1_num_t *r) { + mp_limb_t ret = mpn_add_1(r->data, r->data, r->limbs, (mp_limb_t)1); + if (ret) { + VERIFY_CHECK(r->limbs < 2*NUM_LIMBS); + r->data[r->limbs++] = ret; + } +} + +static void secp256k1_num_set_hex(secp256k1_num_t *r, const char *a, int alen) { + static const unsigned char cvt[256] = { + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 1, 2, 3, 4, 5, 6,7,8,9,0,0,0,0,0,0, + 0,10,11,12,13,14,15,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0,10,11,12,13,14,15,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, + 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0 + }; + unsigned char num[257] = {}; + for (int i=0; ilimbs = mpn_set_str(r->data, num, alen, 16); + r->neg = 0; + while (r->limbs > 1 && r->data[r->limbs-1] == 0) r->limbs--; +} + +static void secp256k1_num_get_hex(char *r, int rlen, const secp256k1_num_t *a) { + static const unsigned char cvt[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; + unsigned char *tmp = malloc(257); + mp_size_t len = mpn_get_str(tmp, 16, (mp_limb_t*)a->data, a->limbs); + VERIFY_CHECK(len <= rlen); + for (int i=0; i= 0); + VERIFY_CHECK(rlen-len+i < rlen); + VERIFY_CHECK(tmp[i] < 16); + r[rlen-len+i] = cvt[tmp[i]]; + } + for (int i=0; i= 0); + VERIFY_CHECK(i < rlen); + r[i] = cvt[0]; + } + free(tmp); +} + +static void secp256k1_num_split(secp256k1_num_t *rl, secp256k1_num_t *rh, const secp256k1_num_t *a, int bits) { + VERIFY_CHECK(bits > 0); + rh->neg = a->neg; + if (bits >= a->limbs * GMP_NUMB_BITS) { + *rl = *a; + rh->limbs = 1; + rh->data[0] = 0; + return; + } + rl->limbs = 0; + rl->neg = a->neg; + int left = bits; + while (left >= GMP_NUMB_BITS) { + rl->data[rl->limbs] = a->data[rl->limbs]; + rl->limbs++; + left -= GMP_NUMB_BITS; + } + if (left == 0) { + mpn_copyi(rh->data, a->data + rl->limbs, a->limbs - rl->limbs); + rh->limbs = a->limbs - rl->limbs; + } else { + mpn_rshift(rh->data, a->data + rl->limbs, a->limbs - rl->limbs, left); + rh->limbs = a->limbs - rl->limbs; + while (rh->limbs>1 && rh->data[rh->limbs-1]==0) rh->limbs--; + } + if (left > 0) { + rl->data[rl->limbs] = a->data[rl->limbs] & ((((mp_limb_t)1) << left) - 1); + rl->limbs++; + } + while (rl->limbs>1 && rl->data[rl->limbs-1]==0) rl->limbs--; +} + +static void secp256k1_num_negate(secp256k1_num_t *r) { + r->neg ^= 1; +} + +static int secp256k1_num_get_bits(const secp256k1_num_t *a, int offset, int count) { + int ret = 0; + for (int i = 0; i < count; i++) { + ret |= ((a->data[(offset + i) / GMP_NUMB_BITS] >> ((offset + i) % GMP_NUMB_BITS)) & 1) << i; + } + return ret; +} + +#endif diff --git a/src/num_impl.h b/src/num_impl.h new file mode 100644 index 0000000000..f73d3ceea8 --- /dev/null +++ b/src/num_impl.h @@ -0,0 +1,22 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_NUM_IMPL_H_ +#define _SECP256K1_NUM_IMPL_H_ + +#if defined HAVE_CONFIG_H +#include "libsecp256k1-config.h" +#endif + +#include "num.h" + +#if defined(USE_NUM_GMP) +#include "num_gmp_impl.h" +#else +#error "Please select num implementation" +#endif + +#endif diff --git a/src/scalar.h b/src/scalar.h new file mode 100644 index 0000000000..3baacb3721 --- /dev/null +++ b/src/scalar.h @@ -0,0 +1,63 @@ +/********************************************************************** + * Copyright (c) 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_SCALAR_ +#define _SECP256K1_SCALAR_ + +#include "num.h" + +#if defined HAVE_CONFIG_H +#include "libsecp256k1-config.h" +#endif + +#if defined(USE_SCALAR_4X64) +#include "scalar_4x64.h" +#elif defined(USE_SCALAR_8X32) +#include "scalar_8x32.h" +#else +#error "Please select scalar implementation" +#endif + +/** Clear a scalar to prevent the leak of sensitive data. */ +static void secp256k1_scalar_clear(secp256k1_scalar_t *r); + +/** Access bits from a scalar. */ +static int secp256k1_scalar_get_bits(const secp256k1_scalar_t *a, int offset, int count); + +/** Set a scalar from a big endian byte array. */ +static void secp256k1_scalar_set_b32(secp256k1_scalar_t *r, const unsigned char *bin, int *overflow); + +/** Convert a scalar to a byte array. */ +static void secp256k1_scalar_get_b32(unsigned char *bin, const secp256k1_scalar_t* a); + +/** Add two scalars together (modulo the group order). */ +static void secp256k1_scalar_add(secp256k1_scalar_t *r, const secp256k1_scalar_t *a, const secp256k1_scalar_t *b); + +/** Multiply two scalars (modulo the group order). */ +static void secp256k1_scalar_mul(secp256k1_scalar_t *r, const secp256k1_scalar_t *a, const secp256k1_scalar_t *b); + +/** Compute the square of a scalar (modulo the group order). */ +static void secp256k1_scalar_sqr(secp256k1_scalar_t *r, const secp256k1_scalar_t *a); + +/** Compute the inverse of a scalar (modulo the group order). */ +static void secp256k1_scalar_inverse(secp256k1_scalar_t *r, const secp256k1_scalar_t *a); + +/** Compute the complement of a scalar (modulo the group order). */ +static void secp256k1_scalar_negate(secp256k1_scalar_t *r, const secp256k1_scalar_t *a); + +/** Check whether a scalar equals zero. */ +static int secp256k1_scalar_is_zero(const secp256k1_scalar_t *a); + +/** Check whether a scalar equals one. */ +static int secp256k1_scalar_is_one(const secp256k1_scalar_t *a); + +/** Check whether a scalar is higher than the group order divided by 2. */ +static int secp256k1_scalar_is_high(const secp256k1_scalar_t *a); + +/** Convert a scalar to a number. */ +static void secp256k1_scalar_get_num(secp256k1_num_t *r, const secp256k1_scalar_t *a); + +#endif diff --git a/src/scalar_4x64.h b/src/scalar_4x64.h new file mode 100644 index 0000000000..5a751c6862 --- /dev/null +++ b/src/scalar_4x64.h @@ -0,0 +1,17 @@ +/********************************************************************** + * Copyright (c) 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_SCALAR_REPR_ +#define _SECP256K1_SCALAR_REPR_ + +#include + +/** A scalar modulo the group order of the secp256k1 curve. */ +typedef struct { + uint64_t d[4]; +} secp256k1_scalar_t; + +#endif diff --git a/src/scalar_4x64_impl.h b/src/scalar_4x64_impl.h new file mode 100644 index 0000000000..f78718234f --- /dev/null +++ b/src/scalar_4x64_impl.h @@ -0,0 +1,359 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_SCALAR_REPR_IMPL_H_ +#define _SECP256K1_SCALAR_REPR_IMPL_H_ + +typedef unsigned __int128 uint128_t; + +/* Limbs of the secp256k1 order. */ +#define SECP256K1_N_0 ((uint64_t)0xBFD25E8CD0364141ULL) +#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL) +#define SECP256K1_N_2 ((uint64_t)0xFFFFFFFFFFFFFFFEULL) +#define SECP256K1_N_3 ((uint64_t)0xFFFFFFFFFFFFFFFFULL) + +/* Limbs of 2^256 minus the secp256k1 order. */ +#define SECP256K1_N_C_0 (~SECP256K1_N_0 + 1) +#define SECP256K1_N_C_1 (~SECP256K1_N_1) +#define SECP256K1_N_C_2 (1) + +/* Limbs of half the secp256k1 order. */ +#define SECP256K1_N_H_0 ((uint64_t)0xDFE92F46681B20A0ULL) +#define SECP256K1_N_H_1 ((uint64_t)0x5D576E7357A4501DULL) +#define SECP256K1_N_H_2 ((uint64_t)0xFFFFFFFFFFFFFFFFULL) +#define SECP256K1_N_H_3 ((uint64_t)0x7FFFFFFFFFFFFFFFULL) + +SECP256K1_INLINE static void secp256k1_scalar_clear(secp256k1_scalar_t *r) { + r->d[0] = 0; + r->d[1] = 0; + r->d[2] = 0; + r->d[3] = 0; +} + +SECP256K1_INLINE static int secp256k1_scalar_get_bits(const secp256k1_scalar_t *a, int offset, int count) { + VERIFY_CHECK((offset + count - 1) / 64 == offset / 64); + return (a->d[offset / 64] >> (offset % 64)) & ((((uint64_t)1) << count) - 1); +} + +SECP256K1_INLINE static int secp256k1_scalar_check_overflow(const secp256k1_scalar_t *a) { + int yes = 0; + int no = 0; + no |= (a->d[3] < SECP256K1_N_3); /* No need for a > check. */ + no |= (a->d[2] < SECP256K1_N_2); + yes |= (a->d[2] > SECP256K1_N_2) & ~no; + no |= (a->d[1] < SECP256K1_N_1); + yes |= (a->d[1] > SECP256K1_N_1) & ~no; + yes |= (a->d[0] >= SECP256K1_N_0) & ~no; + return yes; +} + +SECP256K1_INLINE static int secp256k1_scalar_reduce(secp256k1_scalar_t *r, unsigned int overflow) { + VERIFY_CHECK(overflow <= 1); + uint128_t t = (uint128_t)r->d[0] + overflow * SECP256K1_N_C_0; + r->d[0] = t & 0xFFFFFFFFFFFFFFFFULL; t >>= 64; + t += (uint128_t)r->d[1] + overflow * SECP256K1_N_C_1; + r->d[1] = t & 0xFFFFFFFFFFFFFFFFULL; t >>= 64; + t += (uint128_t)r->d[2] + overflow * SECP256K1_N_C_2; + r->d[2] = t & 0xFFFFFFFFFFFFFFFFULL; t >>= 64; + t += (uint64_t)r->d[3]; + r->d[3] = t & 0xFFFFFFFFFFFFFFFFULL; + return overflow; +} + +static void secp256k1_scalar_add(secp256k1_scalar_t *r, const secp256k1_scalar_t *a, const secp256k1_scalar_t *b) { + uint128_t t = (uint128_t)a->d[0] + b->d[0]; + r->d[0] = t & 0xFFFFFFFFFFFFFFFFULL; t >>= 64; + t += (uint128_t)a->d[1] + b->d[1]; + r->d[1] = t & 0xFFFFFFFFFFFFFFFFULL; t >>= 64; + t += (uint128_t)a->d[2] + b->d[2]; + r->d[2] = t & 0xFFFFFFFFFFFFFFFFULL; t >>= 64; + t += (uint128_t)a->d[3] + b->d[3]; + r->d[3] = t & 0xFFFFFFFFFFFFFFFFULL; t >>= 64; + secp256k1_scalar_reduce(r, t + secp256k1_scalar_check_overflow(r)); +} + +static void secp256k1_scalar_set_b32(secp256k1_scalar_t *r, const unsigned char *b32, int *overflow) { + r->d[0] = (uint64_t)b32[31] | (uint64_t)b32[30] << 8 | (uint64_t)b32[29] << 16 | (uint64_t)b32[28] << 24 | (uint64_t)b32[27] << 32 | (uint64_t)b32[26] << 40 | (uint64_t)b32[25] << 48 | (uint64_t)b32[24] << 56; + r->d[1] = (uint64_t)b32[23] | (uint64_t)b32[22] << 8 | (uint64_t)b32[21] << 16 | (uint64_t)b32[20] << 24 | (uint64_t)b32[19] << 32 | (uint64_t)b32[18] << 40 | (uint64_t)b32[17] << 48 | (uint64_t)b32[16] << 56; + r->d[2] = (uint64_t)b32[15] | (uint64_t)b32[14] << 8 | (uint64_t)b32[13] << 16 | (uint64_t)b32[12] << 24 | (uint64_t)b32[11] << 32 | (uint64_t)b32[10] << 40 | (uint64_t)b32[9] << 48 | (uint64_t)b32[8] << 56; + r->d[3] = (uint64_t)b32[7] | (uint64_t)b32[6] << 8 | (uint64_t)b32[5] << 16 | (uint64_t)b32[4] << 24 | (uint64_t)b32[3] << 32 | (uint64_t)b32[2] << 40 | (uint64_t)b32[1] << 48 | (uint64_t)b32[0] << 56; + int over = secp256k1_scalar_reduce(r, secp256k1_scalar_check_overflow(r)); + if (overflow) { + *overflow = over; + } +} + +static void secp256k1_scalar_get_b32(unsigned char *bin, const secp256k1_scalar_t* a) { + bin[0] = a->d[3] >> 56; bin[1] = a->d[3] >> 48; bin[2] = a->d[3] >> 40; bin[3] = a->d[3] >> 32; bin[4] = a->d[3] >> 24; bin[5] = a->d[3] >> 16; bin[6] = a->d[3] >> 8; bin[7] = a->d[3]; + bin[8] = a->d[2] >> 56; bin[9] = a->d[2] >> 48; bin[10] = a->d[2] >> 40; bin[11] = a->d[2] >> 32; bin[12] = a->d[2] >> 24; bin[13] = a->d[2] >> 16; bin[14] = a->d[2] >> 8; bin[15] = a->d[2]; + bin[16] = a->d[1] >> 56; bin[17] = a->d[1] >> 48; bin[18] = a->d[1] >> 40; bin[19] = a->d[1] >> 32; bin[20] = a->d[1] >> 24; bin[21] = a->d[1] >> 16; bin[22] = a->d[1] >> 8; bin[23] = a->d[1]; + bin[24] = a->d[0] >> 56; bin[25] = a->d[0] >> 48; bin[26] = a->d[0] >> 40; bin[27] = a->d[0] >> 32; bin[28] = a->d[0] >> 24; bin[29] = a->d[0] >> 16; bin[30] = a->d[0] >> 8; bin[31] = a->d[0]; +} + +SECP256K1_INLINE static int secp256k1_scalar_is_zero(const secp256k1_scalar_t *a) { + return (a->d[0] | a->d[1] | a->d[2] | a->d[3]) == 0; +} + +static void secp256k1_scalar_negate(secp256k1_scalar_t *r, const secp256k1_scalar_t *a) { + uint64_t nonzero = 0xFFFFFFFFFFFFFFFFULL * (secp256k1_scalar_is_zero(a) == 0); + uint128_t t = (uint128_t)(~a->d[0]) + SECP256K1_N_0 + 1; + r->d[0] = t & nonzero; t >>= 64; + t += (uint128_t)(~a->d[1]) + SECP256K1_N_1; + r->d[1] = t & nonzero; t >>= 64; + t += (uint128_t)(~a->d[2]) + SECP256K1_N_2; + r->d[2] = t & nonzero; t >>= 64; + t += (uint128_t)(~a->d[3]) + SECP256K1_N_3; + r->d[3] = t & nonzero; +} + +SECP256K1_INLINE static int secp256k1_scalar_is_one(const secp256k1_scalar_t *a) { + return ((a->d[0] ^ 1) | a->d[1] | a->d[2] | a->d[3]) == 0; +} + +static int secp256k1_scalar_is_high(const secp256k1_scalar_t *a) { + int yes = 0; + int no = 0; + no |= (a->d[3] < SECP256K1_N_H_3); + yes |= (a->d[3] > SECP256K1_N_H_3) & ~no; + no |= (a->d[2] < SECP256K1_N_H_2) & ~yes; /* No need for a > check. */ + no |= (a->d[1] < SECP256K1_N_H_1) & ~yes; + yes |= (a->d[1] > SECP256K1_N_H_1) & ~no; + yes |= (a->d[0] > SECP256K1_N_H_0) & ~no; + return yes; +} + +/* Inspired by the macros in OpenSSL's crypto/bn/asm/x86_64-gcc.c. */ + +/** Add a*b to the number defined by (c0,c1,c2). c2 must never overflow. */ +#define muladd(a,b) { \ + uint64_t tl, th; \ + { \ + uint128_t t = (uint128_t)a * b; \ + th = t >> 64; /* at most 0xFFFFFFFFFFFFFFFE */ \ + tl = t; \ + } \ + c0 += tl; /* overflow is handled on the next line */ \ + th += (c0 < tl) ? 1 : 0; /* at most 0xFFFFFFFFFFFFFFFF */ \ + c1 += th; /* overflow is handled on the next line */ \ + c2 += (c1 < th) ? 1 : 0; /* never overflows by contract (verified in the next line) */ \ + VERIFY_CHECK((c1 >= th) || (c2 != 0)); \ +} + +/** Add a*b to the number defined by (c0,c1). c1 must never overflow. */ +#define muladd_fast(a,b) { \ + uint64_t tl, th; \ + { \ + uint128_t t = (uint128_t)a * b; \ + th = t >> 64; /* at most 0xFFFFFFFFFFFFFFFE */ \ + tl = t; \ + } \ + c0 += tl; /* overflow is handled on the next line */ \ + th += (c0 < tl) ? 1 : 0; /* at most 0xFFFFFFFFFFFFFFFF */ \ + c1 += th; /* never overflows by contract (verified in the next line) */ \ + VERIFY_CHECK(c1 >= th); \ +} + +/** Add 2*a*b to the number defined by (c0,c1,c2). c2 must never overflow. */ +#define muladd2(a,b) { \ + uint64_t tl, th; \ + { \ + uint128_t t = (uint128_t)a * b; \ + th = t >> 64; /* at most 0xFFFFFFFFFFFFFFFE */ \ + tl = t; \ + } \ + uint64_t th2 = th + th; /* at most 0xFFFFFFFFFFFFFFFE (in case th was 0x7FFFFFFFFFFFFFFF) */ \ + c2 += (th2 < th) ? 1 : 0; /* never overflows by contract (verified the next line) */ \ + VERIFY_CHECK((th2 >= th) || (c2 != 0)); \ + uint64_t tl2 = tl + tl; /* at most 0xFFFFFFFFFFFFFFFE (in case the lowest 63 bits of tl were 0x7FFFFFFFFFFFFFFF) */ \ + th2 += (tl2 < tl) ? 1 : 0; /* at most 0xFFFFFFFFFFFFFFFF */ \ + c0 += tl2; /* overflow is handled on the next line */ \ + th2 += (c0 < tl2) ? 1 : 0; /* second overflow is handled on the next line */ \ + c2 += (c0 < tl2) & (th2 == 0); /* never overflows by contract (verified the next line) */ \ + VERIFY_CHECK((c0 >= tl2) || (th2 != 0) || (c2 != 0)); \ + c1 += th2; /* overflow is handled on the next line */ \ + c2 += (c1 < th2) ? 1 : 0; /* never overflows by contract (verified the next line) */ \ + VERIFY_CHECK((c1 >= th2) || (c2 != 0)); \ +} + +/** Add a to the number defined by (c0,c1,c2). c2 must never overflow. */ +#define sumadd(a) { \ + c0 += (a); /* overflow is handled on the next line */ \ + unsigned int over = (c0 < (a)) ? 1 : 0; \ + c1 += over; /* overflow is handled on the next line */ \ + c2 += (c1 < over) ? 1 : 0; /* never overflows by contract */ \ +} + +/** Add a to the number defined by (c0,c1). c1 must never overflow, c2 must be zero. */ +#define sumadd_fast(a) { \ + c0 += (a); /* overflow is handled on the next line */ \ + c1 += (c0 < (a)) ? 1 : 0; /* never overflows by contract (verified the next line) */ \ + VERIFY_CHECK((c1 != 0) | (c0 >= (a))); \ + VERIFY_CHECK(c2 == 0); \ +} + +/** Extract the lowest 64 bits of (c0,c1,c2) into n, and left shift the number 64 bits. */ +#define extract(n) { \ + (n) = c0; \ + c0 = c1; \ + c1 = c2; \ + c2 = 0; \ +} + +/** Extract the lowest 64 bits of (c0,c1,c2) into n, and left shift the number 64 bits. c2 is required to be zero. */ +#define extract_fast(n) { \ + (n) = c0; \ + c0 = c1; \ + c1 = 0; \ + VERIFY_CHECK(c2 == 0); \ +} + +static void secp256k1_scalar_reduce_512(secp256k1_scalar_t *r, const uint64_t *l) { + uint64_t n0 = l[4], n1 = l[5], n2 = l[6], n3 = l[7]; + + /* 160 bit accumulator. */ + uint64_t c0, c1; + uint32_t c2; + + /* Reduce 512 bits into 385. */ + /* m[0..6] = l[0..3] + n[0..3] * SECP256K1_N_C. */ + c0 = l[0]; c1 = 0; c2 = 0; + muladd_fast(n0, SECP256K1_N_C_0); + uint64_t m0; extract_fast(m0); + sumadd_fast(l[1]); + muladd(n1, SECP256K1_N_C_0); + muladd(n0, SECP256K1_N_C_1); + uint64_t m1; extract(m1); + sumadd(l[2]); + muladd(n2, SECP256K1_N_C_0); + muladd(n1, SECP256K1_N_C_1); + sumadd(n0); + uint64_t m2; extract(m2); + sumadd(l[3]); + muladd(n3, SECP256K1_N_C_0); + muladd(n2, SECP256K1_N_C_1); + sumadd(n1); + uint64_t m3; extract(m3); + muladd(n3, SECP256K1_N_C_1); + sumadd(n2); + uint64_t m4; extract(m4); + sumadd_fast(n3); + uint64_t m5; extract_fast(m5); + VERIFY_CHECK(c0 <= 1); + uint32_t m6 = c0; + + /* Reduce 385 bits into 258. */ + /* p[0..4] = m[0..3] + m[4..6] * SECP256K1_N_C. */ + c0 = m0; c1 = 0; c2 = 0; + muladd_fast(m4, SECP256K1_N_C_0); + uint64_t p0; extract_fast(p0); + sumadd_fast(m1); + muladd(m5, SECP256K1_N_C_0); + muladd(m4, SECP256K1_N_C_1); + uint64_t p1; extract(p1); + sumadd(m2); + muladd(m6, SECP256K1_N_C_0); + muladd(m5, SECP256K1_N_C_1); + sumadd(m4); + uint64_t p2; extract(p2); + sumadd_fast(m3); + muladd_fast(m6, SECP256K1_N_C_1); + sumadd_fast(m5); + uint64_t p3; extract_fast(p3); + uint32_t p4 = c0 + m6; + VERIFY_CHECK(p4 <= 2); + + /* Reduce 258 bits into 256. */ + /* r[0..3] = p[0..3] + p[4] * SECP256K1_N_C. */ + uint128_t c = p0 + (uint128_t)SECP256K1_N_C_0 * p4; + r->d[0] = c & 0xFFFFFFFFFFFFFFFFULL; c >>= 64; + c += p1 + (uint128_t)SECP256K1_N_C_1 * p4; + r->d[1] = c & 0xFFFFFFFFFFFFFFFFULL; c >>= 64; + c += p2 + (uint128_t)p4; + r->d[2] = c & 0xFFFFFFFFFFFFFFFFULL; c >>= 64; + c += p3; + r->d[3] = c & 0xFFFFFFFFFFFFFFFFULL; c >>= 64; + + /* Final reduction of r. */ + secp256k1_scalar_reduce(r, c + secp256k1_scalar_check_overflow(r)); +} + +static void secp256k1_scalar_mul(secp256k1_scalar_t *r, const secp256k1_scalar_t *a, const secp256k1_scalar_t *b) { + /* 160 bit accumulator. */ + uint64_t c0 = 0, c1 = 0; + uint32_t c2 = 0; + + uint64_t l[8]; + + /* l[0..7] = a[0..3] * b[0..3]. */ + muladd_fast(a->d[0], b->d[0]); + extract_fast(l[0]); + muladd(a->d[0], b->d[1]); + muladd(a->d[1], b->d[0]); + extract(l[1]); + muladd(a->d[0], b->d[2]); + muladd(a->d[1], b->d[1]); + muladd(a->d[2], b->d[0]); + extract(l[2]); + muladd(a->d[0], b->d[3]); + muladd(a->d[1], b->d[2]); + muladd(a->d[2], b->d[1]); + muladd(a->d[3], b->d[0]); + extract(l[3]); + muladd(a->d[1], b->d[3]); + muladd(a->d[2], b->d[2]); + muladd(a->d[3], b->d[1]); + extract(l[4]); + muladd(a->d[2], b->d[3]); + muladd(a->d[3], b->d[2]); + extract(l[5]); + muladd_fast(a->d[3], b->d[3]); + extract_fast(l[6]); + VERIFY_CHECK(c1 <= 0); + l[7] = c0; + + secp256k1_scalar_reduce_512(r, l); +} + +static void secp256k1_scalar_sqr(secp256k1_scalar_t *r, const secp256k1_scalar_t *a) { + /* 160 bit accumulator. */ + uint64_t c0 = 0, c1 = 0; + uint32_t c2 = 0; + + uint64_t l[8]; + + /* l[0..7] = a[0..3] * b[0..3]. */ + muladd_fast(a->d[0], a->d[0]); + extract_fast(l[0]); + muladd2(a->d[0], a->d[1]); + extract(l[1]); + muladd2(a->d[0], a->d[2]); + muladd(a->d[1], a->d[1]); + extract(l[2]); + muladd2(a->d[0], a->d[3]); + muladd2(a->d[1], a->d[2]); + extract(l[3]); + muladd2(a->d[1], a->d[3]); + muladd(a->d[2], a->d[2]); + extract(l[4]); + muladd2(a->d[2], a->d[3]); + extract(l[5]); + muladd_fast(a->d[3], a->d[3]); + extract_fast(l[6]); + VERIFY_CHECK(c1 == 0); + l[7] = c0; + + secp256k1_scalar_reduce_512(r, l); +} + +#undef sumadd +#undef sumadd_fast +#undef muladd +#undef muladd_fast +#undef muladd2 +#undef extract +#undef extract_fast + +#endif diff --git a/src/scalar_8x32.h b/src/scalar_8x32.h new file mode 100644 index 0000000000..f70328cfc9 --- /dev/null +++ b/src/scalar_8x32.h @@ -0,0 +1,17 @@ +/********************************************************************** + * Copyright (c) 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_SCALAR_REPR_ +#define _SECP256K1_SCALAR_REPR_ + +#include + +/** A scalar modulo the group order of the secp256k1 curve. */ +typedef struct { + uint32_t d[8]; +} secp256k1_scalar_t; + +#endif diff --git a/src/scalar_8x32_impl.h b/src/scalar_8x32_impl.h new file mode 100644 index 0000000000..e58be1365f --- /dev/null +++ b/src/scalar_8x32_impl.h @@ -0,0 +1,572 @@ +/********************************************************************** + * Copyright (c) 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_SCALAR_REPR_IMPL_H_ +#define _SECP256K1_SCALAR_REPR_IMPL_H_ + +/* Limbs of the secp256k1 order. */ +#define SECP256K1_N_0 ((uint32_t)0xD0364141UL) +#define SECP256K1_N_1 ((uint32_t)0xBFD25E8CUL) +#define SECP256K1_N_2 ((uint32_t)0xAF48A03BUL) +#define SECP256K1_N_3 ((uint32_t)0xBAAEDCE6UL) +#define SECP256K1_N_4 ((uint32_t)0xFFFFFFFEUL) +#define SECP256K1_N_5 ((uint32_t)0xFFFFFFFFUL) +#define SECP256K1_N_6 ((uint32_t)0xFFFFFFFFUL) +#define SECP256K1_N_7 ((uint32_t)0xFFFFFFFFUL) + +/* Limbs of 2^256 minus the secp256k1 order. */ +#define SECP256K1_N_C_0 (~SECP256K1_N_0 + 1) +#define SECP256K1_N_C_1 (~SECP256K1_N_1) +#define SECP256K1_N_C_2 (~SECP256K1_N_2) +#define SECP256K1_N_C_3 (~SECP256K1_N_3) +#define SECP256K1_N_C_4 (1) + +/* Limbs of half the secp256k1 order. */ +#define SECP256K1_N_H_0 ((uint32_t)0x681B20A0UL) +#define SECP256K1_N_H_1 ((uint32_t)0xDFE92F46UL) +#define SECP256K1_N_H_2 ((uint32_t)0x57A4501DUL) +#define SECP256K1_N_H_3 ((uint32_t)0x5D576E73UL) +#define SECP256K1_N_H_4 ((uint32_t)0xFFFFFFFFUL) +#define SECP256K1_N_H_5 ((uint32_t)0xFFFFFFFFUL) +#define SECP256K1_N_H_6 ((uint32_t)0xFFFFFFFFUL) +#define SECP256K1_N_H_7 ((uint32_t)0x7FFFFFFFUL) + +SECP256K1_INLINE static void secp256k1_scalar_clear(secp256k1_scalar_t *r) { + r->d[0] = 0; + r->d[1] = 0; + r->d[2] = 0; + r->d[3] = 0; + r->d[4] = 0; + r->d[5] = 0; + r->d[6] = 0; + r->d[7] = 0; +} + +SECP256K1_INLINE static int secp256k1_scalar_get_bits(const secp256k1_scalar_t *a, int offset, int count) { + VERIFY_CHECK((offset + count - 1) / 32 == offset / 32); + return (a->d[offset / 32] >> (offset % 32)) & ((1 << count) - 1); +} + +SECP256K1_INLINE static int secp256k1_scalar_check_overflow(const secp256k1_scalar_t *a) { + int yes = 0; + int no = 0; + no |= (a->d[7] < SECP256K1_N_7); /* No need for a > check. */ + no |= (a->d[6] < SECP256K1_N_6); /* No need for a > check. */ + no |= (a->d[5] < SECP256K1_N_5); /* No need for a > check. */ + no |= (a->d[4] < SECP256K1_N_4); + yes |= (a->d[4] > SECP256K1_N_4) & ~no; + no |= (a->d[3] < SECP256K1_N_3) & ~yes; + yes |= (a->d[3] > SECP256K1_N_3) & ~no; + no |= (a->d[2] < SECP256K1_N_2) & ~yes; + yes |= (a->d[2] > SECP256K1_N_2) & ~no; + no |= (a->d[1] < SECP256K1_N_1) & ~yes; + yes |= (a->d[1] > SECP256K1_N_1) & ~no; + yes |= (a->d[0] >= SECP256K1_N_0) & ~no; + return yes; +} + +SECP256K1_INLINE static int secp256k1_scalar_reduce(secp256k1_scalar_t *r, uint32_t overflow) { + VERIFY_CHECK(overflow <= 1); + uint64_t t = (uint64_t)r->d[0] + overflow * SECP256K1_N_C_0; + r->d[0] = t & 0xFFFFFFFFUL; t >>= 32; + t += (uint64_t)r->d[1] + overflow * SECP256K1_N_C_1; + r->d[1] = t & 0xFFFFFFFFUL; t >>= 32; + t += (uint64_t)r->d[2] + overflow * SECP256K1_N_C_2; + r->d[2] = t & 0xFFFFFFFFUL; t >>= 32; + t += (uint64_t)r->d[3] + overflow * SECP256K1_N_C_3; + r->d[3] = t & 0xFFFFFFFFUL; t >>= 32; + t += (uint64_t)r->d[4] + overflow * SECP256K1_N_C_4; + r->d[4] = t & 0xFFFFFFFFUL; t >>= 32; + t += (uint64_t)r->d[5]; + r->d[5] = t & 0xFFFFFFFFUL; t >>= 32; + t += (uint64_t)r->d[6]; + r->d[6] = t & 0xFFFFFFFFUL; t >>= 32; + t += (uint64_t)r->d[7]; + r->d[7] = t & 0xFFFFFFFFUL; + return overflow; +} + +static void secp256k1_scalar_add(secp256k1_scalar_t *r, const secp256k1_scalar_t *a, const secp256k1_scalar_t *b) { + uint64_t t = (uint64_t)a->d[0] + b->d[0]; + r->d[0] = t & 0xFFFFFFFFULL; t >>= 32; + t += (uint64_t)a->d[1] + b->d[1]; + r->d[1] = t & 0xFFFFFFFFULL; t >>= 32; + t += (uint64_t)a->d[2] + b->d[2]; + r->d[2] = t & 0xFFFFFFFFULL; t >>= 32; + t += (uint64_t)a->d[3] + b->d[3]; + r->d[3] = t & 0xFFFFFFFFULL; t >>= 32; + t += (uint64_t)a->d[4] + b->d[4]; + r->d[4] = t & 0xFFFFFFFFULL; t >>= 32; + t += (uint64_t)a->d[5] + b->d[5]; + r->d[5] = t & 0xFFFFFFFFULL; t >>= 32; + t += (uint64_t)a->d[6] + b->d[6]; + r->d[6] = t & 0xFFFFFFFFULL; t >>= 32; + t += (uint64_t)a->d[7] + b->d[7]; + r->d[7] = t & 0xFFFFFFFFULL; t >>= 32; + secp256k1_scalar_reduce(r, t + secp256k1_scalar_check_overflow(r)); +} + +static void secp256k1_scalar_set_b32(secp256k1_scalar_t *r, const unsigned char *b32, int *overflow) { + r->d[0] = (uint32_t)b32[31] | (uint32_t)b32[30] << 8 | (uint32_t)b32[29] << 16 | (uint32_t)b32[28] << 24; + r->d[1] = (uint32_t)b32[27] | (uint32_t)b32[26] << 8 | (uint32_t)b32[25] << 16 | (uint32_t)b32[24] << 24; + r->d[2] = (uint32_t)b32[23] | (uint32_t)b32[22] << 8 | (uint32_t)b32[21] << 16 | (uint32_t)b32[20] << 24; + r->d[3] = (uint32_t)b32[19] | (uint32_t)b32[18] << 8 | (uint32_t)b32[17] << 16 | (uint32_t)b32[16] << 24; + r->d[4] = (uint32_t)b32[15] | (uint32_t)b32[14] << 8 | (uint32_t)b32[13] << 16 | (uint32_t)b32[12] << 24; + r->d[5] = (uint32_t)b32[11] | (uint32_t)b32[10] << 8 | (uint32_t)b32[9] << 16 | (uint32_t)b32[8] << 24; + r->d[6] = (uint32_t)b32[7] | (uint32_t)b32[6] << 8 | (uint32_t)b32[5] << 16 | (uint32_t)b32[4] << 24; + r->d[7] = (uint32_t)b32[3] | (uint32_t)b32[2] << 8 | (uint32_t)b32[1] << 16 | (uint32_t)b32[0] << 24; + int over = secp256k1_scalar_reduce(r, secp256k1_scalar_check_overflow(r)); + if (overflow) { + *overflow = over; + } +} + +static void secp256k1_scalar_get_b32(unsigned char *bin, const secp256k1_scalar_t* a) { + bin[0] = a->d[7] >> 24; bin[1] = a->d[7] >> 16; bin[2] = a->d[7] >> 8; bin[3] = a->d[7]; + bin[4] = a->d[6] >> 24; bin[5] = a->d[6] >> 16; bin[6] = a->d[6] >> 8; bin[7] = a->d[6]; + bin[8] = a->d[5] >> 24; bin[9] = a->d[5] >> 16; bin[10] = a->d[5] >> 8; bin[11] = a->d[5]; + bin[12] = a->d[4] >> 24; bin[13] = a->d[4] >> 16; bin[14] = a->d[4] >> 8; bin[15] = a->d[4]; + bin[16] = a->d[3] >> 24; bin[17] = a->d[3] >> 16; bin[18] = a->d[3] >> 8; bin[19] = a->d[3]; + bin[20] = a->d[2] >> 24; bin[21] = a->d[2] >> 16; bin[22] = a->d[2] >> 8; bin[23] = a->d[2]; + bin[24] = a->d[1] >> 24; bin[25] = a->d[1] >> 16; bin[26] = a->d[1] >> 8; bin[27] = a->d[1]; + bin[28] = a->d[0] >> 24; bin[29] = a->d[0] >> 16; bin[30] = a->d[0] >> 8; bin[31] = a->d[0]; +} + +SECP256K1_INLINE static int secp256k1_scalar_is_zero(const secp256k1_scalar_t *a) { + return (a->d[0] | a->d[1] | a->d[2] | a->d[3] | a->d[4] | a->d[5] | a->d[6] | a->d[7]) == 0; +} + +static void secp256k1_scalar_negate(secp256k1_scalar_t *r, const secp256k1_scalar_t *a) { + uint32_t nonzero = 0xFFFFFFFFUL * (secp256k1_scalar_is_zero(a) == 0); + uint64_t t = (uint64_t)(~a->d[0]) + SECP256K1_N_0 + 1; + r->d[0] = t & nonzero; t >>= 32; + t += (uint64_t)(~a->d[1]) + SECP256K1_N_1; + r->d[1] = t & nonzero; t >>= 32; + t += (uint64_t)(~a->d[2]) + SECP256K1_N_2; + r->d[2] = t & nonzero; t >>= 32; + t += (uint64_t)(~a->d[3]) + SECP256K1_N_3; + r->d[3] = t & nonzero; t >>= 32; + t += (uint64_t)(~a->d[4]) + SECP256K1_N_4; + r->d[4] = t & nonzero; t >>= 32; + t += (uint64_t)(~a->d[5]) + SECP256K1_N_5; + r->d[5] = t & nonzero; t >>= 32; + t += (uint64_t)(~a->d[6]) + SECP256K1_N_6; + r->d[6] = t & nonzero; t >>= 32; + t += (uint64_t)(~a->d[7]) + SECP256K1_N_7; + r->d[7] = t & nonzero; +} + +SECP256K1_INLINE static int secp256k1_scalar_is_one(const secp256k1_scalar_t *a) { + return ((a->d[0] ^ 1) | a->d[1] | a->d[2] | a->d[3] | a->d[4] | a->d[5] | a->d[6] | a->d[7]) == 0; +} + +static int secp256k1_scalar_is_high(const secp256k1_scalar_t *a) { + int yes = 0; + int no = 0; + no |= (a->d[7] < SECP256K1_N_H_7); + yes |= (a->d[7] > SECP256K1_N_H_7) & ~no; + no |= (a->d[6] < SECP256K1_N_H_6) & ~yes; /* No need for a > check. */ + no |= (a->d[5] < SECP256K1_N_H_5) & ~yes; /* No need for a > check. */ + no |= (a->d[4] < SECP256K1_N_H_4) & ~yes; /* No need for a > check. */ + no |= (a->d[3] < SECP256K1_N_H_3) & ~yes; + yes |= (a->d[3] > SECP256K1_N_H_3) & ~no; + no |= (a->d[2] < SECP256K1_N_H_2) & ~yes; + yes |= (a->d[2] > SECP256K1_N_H_2) & ~no; + no |= (a->d[1] < SECP256K1_N_H_1) & ~yes; + yes |= (a->d[1] > SECP256K1_N_H_1) & ~no; + yes |= (a->d[0] > SECP256K1_N_H_0) & ~no; + return yes; +} + +/* Inspired by the macros in OpenSSL's crypto/bn/asm/x86_64-gcc.c. */ + +/** Add a*b to the number defined by (c0,c1,c2). c2 must never overflow. */ +#define muladd(a,b) { \ + uint32_t tl, th; \ + { \ + uint64_t t = (uint64_t)a * b; \ + th = t >> 32; /* at most 0xFFFFFFFE */ \ + tl = t; \ + } \ + c0 += tl; /* overflow is handled on the next line */ \ + th += (c0 < tl) ? 1 : 0; /* at most 0xFFFFFFFF */ \ + c1 += th; /* overflow is handled on the next line */ \ + c2 += (c1 < th) ? 1 : 0; /* never overflows by contract (verified in the next line) */ \ + VERIFY_CHECK((c1 >= th) || (c2 != 0)); \ +} + +/** Add a*b to the number defined by (c0,c1). c1 must never overflow. */ +#define muladd_fast(a,b) { \ + uint32_t tl, th; \ + { \ + uint64_t t = (uint64_t)a * b; \ + th = t >> 32; /* at most 0xFFFFFFFE */ \ + tl = t; \ + } \ + c0 += tl; /* overflow is handled on the next line */ \ + th += (c0 < tl) ? 1 : 0; /* at most 0xFFFFFFFF */ \ + c1 += th; /* never overflows by contract (verified in the next line) */ \ + VERIFY_CHECK(c1 >= th); \ +} + +/** Add 2*a*b to the number defined by (c0,c1,c2). c2 must never overflow. */ +#define muladd2(a,b) { \ + uint32_t tl, th; \ + { \ + uint64_t t = (uint64_t)a * b; \ + th = t >> 32; /* at most 0xFFFFFFFE */ \ + tl = t; \ + } \ + uint32_t th2 = th + th; /* at most 0xFFFFFFFE (in case th was 0x7FFFFFFF) */ \ + c2 += (th2 < th) ? 1 : 0; /* never overflows by contract (verified the next line) */ \ + VERIFY_CHECK((th2 >= th) || (c2 != 0)); \ + uint32_t tl2 = tl + tl; /* at most 0xFFFFFFFE (in case the lowest 63 bits of tl were 0x7FFFFFFF) */ \ + th2 += (tl2 < tl) ? 1 : 0; /* at most 0xFFFFFFFF */ \ + c0 += tl2; /* overflow is handled on the next line */ \ + th2 += (c0 < tl2) ? 1 : 0; /* second overflow is handled on the next line */ \ + c2 += (c0 < tl2) & (th2 == 0); /* never overflows by contract (verified the next line) */ \ + VERIFY_CHECK((c0 >= tl2) || (th2 != 0) || (c2 != 0)); \ + c1 += th2; /* overflow is handled on the next line */ \ + c2 += (c1 < th2) ? 1 : 0; /* never overflows by contract (verified the next line) */ \ + VERIFY_CHECK((c1 >= th2) || (c2 != 0)); \ +} + +/** Add a to the number defined by (c0,c1,c2). c2 must never overflow. */ +#define sumadd(a) { \ + c0 += (a); /* overflow is handled on the next line */ \ + unsigned int over = (c0 < (a)) ? 1 : 0; \ + c1 += over; /* overflow is handled on the next line */ \ + c2 += (c1 < over) ? 1 : 0; /* never overflows by contract */ \ +} + +/** Add a to the number defined by (c0,c1). c1 must never overflow, c2 must be zero. */ +#define sumadd_fast(a) { \ + c0 += (a); /* overflow is handled on the next line */ \ + c1 += (c0 < (a)) ? 1 : 0; /* never overflows by contract (verified the next line) */ \ + VERIFY_CHECK((c1 != 0) | (c0 >= (a))); \ + VERIFY_CHECK(c2 == 0); \ +} + +/** Extract the lowest 32 bits of (c0,c1,c2) into n, and left shift the number 32 bits. */ +#define extract(n) { \ + (n) = c0; \ + c0 = c1; \ + c1 = c2; \ + c2 = 0; \ +} + +/** Extract the lowest 32 bits of (c0,c1,c2) into n, and left shift the number 32 bits. c2 is required to be zero. */ +#define extract_fast(n) { \ + (n) = c0; \ + c0 = c1; \ + c1 = 0; \ + VERIFY_CHECK(c2 == 0); \ +} + +static void secp256k1_scalar_reduce_512(secp256k1_scalar_t *r, const uint32_t *l) { + uint32_t n0 = l[8], n1 = l[9], n2 = l[10], n3 = l[11], n4 = l[12], n5 = l[13], n6 = l[14], n7 = l[15]; + + /* 96 bit accumulator. */ + uint32_t c0, c1, c2; + + /* Reduce 512 bits into 385. */ + /* m[0..12] = l[0..7] + n[0..7] * SECP256K1_N_C. */ + c0 = l[0]; c1 = 0; c2 = 0; + muladd_fast(n0, SECP256K1_N_C_0); + uint32_t m0; extract_fast(m0); + sumadd_fast(l[1]); + muladd(n1, SECP256K1_N_C_0); + muladd(n0, SECP256K1_N_C_1); + uint32_t m1; extract(m1); + sumadd(l[2]); + muladd(n2, SECP256K1_N_C_0); + muladd(n1, SECP256K1_N_C_1); + muladd(n0, SECP256K1_N_C_2); + uint32_t m2; extract(m2); + sumadd(l[3]); + muladd(n3, SECP256K1_N_C_0); + muladd(n2, SECP256K1_N_C_1); + muladd(n1, SECP256K1_N_C_2); + muladd(n0, SECP256K1_N_C_3); + uint32_t m3; extract(m3); + sumadd(l[4]); + muladd(n4, SECP256K1_N_C_0); + muladd(n3, SECP256K1_N_C_1); + muladd(n2, SECP256K1_N_C_2); + muladd(n1, SECP256K1_N_C_3); + sumadd(n0); + uint32_t m4; extract(m4); + sumadd(l[5]); + muladd(n5, SECP256K1_N_C_0); + muladd(n4, SECP256K1_N_C_1); + muladd(n3, SECP256K1_N_C_2); + muladd(n2, SECP256K1_N_C_3); + sumadd(n1); + uint32_t m5; extract(m5); + sumadd(l[6]); + muladd(n6, SECP256K1_N_C_0); + muladd(n5, SECP256K1_N_C_1); + muladd(n4, SECP256K1_N_C_2); + muladd(n3, SECP256K1_N_C_3); + sumadd(n2); + uint32_t m6; extract(m6); + sumadd(l[7]); + muladd(n7, SECP256K1_N_C_0); + muladd(n6, SECP256K1_N_C_1); + muladd(n5, SECP256K1_N_C_2); + muladd(n4, SECP256K1_N_C_3); + sumadd(n3); + uint32_t m7; extract(m7); + muladd(n7, SECP256K1_N_C_1); + muladd(n6, SECP256K1_N_C_2); + muladd(n5, SECP256K1_N_C_3); + sumadd(n4); + uint32_t m8; extract(m8); + muladd(n7, SECP256K1_N_C_2); + muladd(n6, SECP256K1_N_C_3); + sumadd(n5); + uint32_t m9; extract(m9); + muladd(n7, SECP256K1_N_C_3); + sumadd(n6); + uint32_t m10; extract(m10); + sumadd_fast(n7); + uint32_t m11; extract_fast(m11); + VERIFY_CHECK(c0 <= 1); + uint32_t m12 = c0; + + /* Reduce 385 bits into 258. */ + /* p[0..8] = m[0..7] + m[8..12] * SECP256K1_N_C. */ + c0 = m0; c1 = 0; c2 = 0; + muladd_fast(m8, SECP256K1_N_C_0); + uint32_t p0; extract_fast(p0); + sumadd_fast(m1); + muladd(m9, SECP256K1_N_C_0); + muladd(m8, SECP256K1_N_C_1); + uint32_t p1; extract(p1); + sumadd(m2); + muladd(m10, SECP256K1_N_C_0); + muladd(m9, SECP256K1_N_C_1); + muladd(m8, SECP256K1_N_C_2); + uint32_t p2; extract(p2); + sumadd(m3); + muladd(m11, SECP256K1_N_C_0); + muladd(m10, SECP256K1_N_C_1); + muladd(m9, SECP256K1_N_C_2); + muladd(m8, SECP256K1_N_C_3); + uint32_t p3; extract(p3); + sumadd(m4); + muladd(m12, SECP256K1_N_C_0); + muladd(m11, SECP256K1_N_C_1); + muladd(m10, SECP256K1_N_C_2); + muladd(m9, SECP256K1_N_C_3); + sumadd(m8); + uint32_t p4; extract(p4); + sumadd(m5); + muladd(m12, SECP256K1_N_C_1); + muladd(m11, SECP256K1_N_C_2); + muladd(m10, SECP256K1_N_C_3); + sumadd(m9); + uint32_t p5; extract(p5); + sumadd(m6); + muladd(m12, SECP256K1_N_C_2); + muladd(m11, SECP256K1_N_C_3); + sumadd(m10); + uint32_t p6; extract(p6); + sumadd_fast(m7); + muladd_fast(m12, SECP256K1_N_C_3); + sumadd_fast(m11); + uint32_t p7; extract_fast(p7); + uint32_t p8 = c0 + m12; + VERIFY_CHECK(p8 <= 2); + + /* Reduce 258 bits into 256. */ + /* r[0..7] = p[0..7] + p[8] * SECP256K1_N_C. */ + uint64_t c = p0 + (uint64_t)SECP256K1_N_C_0 * p8; + r->d[0] = c & 0xFFFFFFFFUL; c >>= 32; + c += p1 + (uint64_t)SECP256K1_N_C_1 * p8; + r->d[1] = c & 0xFFFFFFFFUL; c >>= 32; + c += p2 + (uint64_t)SECP256K1_N_C_2 * p8; + r->d[2] = c & 0xFFFFFFFFUL; c >>= 32; + c += p3 + (uint64_t)SECP256K1_N_C_3 * p8; + r->d[3] = c & 0xFFFFFFFFUL; c >>= 32; + c += p4 + (uint64_t)p8; + r->d[4] = c & 0xFFFFFFFFUL; c >>= 32; + c += p5; + r->d[5] = c & 0xFFFFFFFFUL; c >>= 32; + c += p6; + r->d[6] = c & 0xFFFFFFFFUL; c >>= 32; + c += p7; + r->d[7] = c & 0xFFFFFFFFUL; c >>= 32; + + /* Final reduction of r. */ + secp256k1_scalar_reduce(r, c + secp256k1_scalar_check_overflow(r)); +} + +static void secp256k1_scalar_mul(secp256k1_scalar_t *r, const secp256k1_scalar_t *a, const secp256k1_scalar_t *b) { + /* 96 bit accumulator. */ + uint32_t c0 = 0, c1 = 0, c2 = 0; + + uint32_t l[16]; + + /* l[0..15] = a[0..7] * b[0..7]. */ + muladd_fast(a->d[0], b->d[0]); + extract_fast(l[0]); + muladd(a->d[0], b->d[1]); + muladd(a->d[1], b->d[0]); + extract(l[1]); + muladd(a->d[0], b->d[2]); + muladd(a->d[1], b->d[1]); + muladd(a->d[2], b->d[0]); + extract(l[2]); + muladd(a->d[0], b->d[3]); + muladd(a->d[1], b->d[2]); + muladd(a->d[2], b->d[1]); + muladd(a->d[3], b->d[0]); + extract(l[3]); + muladd(a->d[0], b->d[4]); + muladd(a->d[1], b->d[3]); + muladd(a->d[2], b->d[2]); + muladd(a->d[3], b->d[1]); + muladd(a->d[4], b->d[0]); + extract(l[4]); + muladd(a->d[0], b->d[5]); + muladd(a->d[1], b->d[4]); + muladd(a->d[2], b->d[3]); + muladd(a->d[3], b->d[2]); + muladd(a->d[4], b->d[1]); + muladd(a->d[5], b->d[0]); + extract(l[5]); + muladd(a->d[0], b->d[6]); + muladd(a->d[1], b->d[5]); + muladd(a->d[2], b->d[4]); + muladd(a->d[3], b->d[3]); + muladd(a->d[4], b->d[2]); + muladd(a->d[5], b->d[1]); + muladd(a->d[6], b->d[0]); + extract(l[6]); + muladd(a->d[0], b->d[7]); + muladd(a->d[1], b->d[6]); + muladd(a->d[2], b->d[5]); + muladd(a->d[3], b->d[4]); + muladd(a->d[4], b->d[3]); + muladd(a->d[5], b->d[2]); + muladd(a->d[6], b->d[1]); + muladd(a->d[7], b->d[0]); + extract(l[7]); + muladd(a->d[1], b->d[7]); + muladd(a->d[2], b->d[6]); + muladd(a->d[3], b->d[5]); + muladd(a->d[4], b->d[4]); + muladd(a->d[5], b->d[3]); + muladd(a->d[6], b->d[2]); + muladd(a->d[7], b->d[1]); + extract(l[8]); + muladd(a->d[2], b->d[7]); + muladd(a->d[3], b->d[6]); + muladd(a->d[4], b->d[5]); + muladd(a->d[5], b->d[4]); + muladd(a->d[6], b->d[3]); + muladd(a->d[7], b->d[2]); + extract(l[9]); + muladd(a->d[3], b->d[7]); + muladd(a->d[4], b->d[6]); + muladd(a->d[5], b->d[5]); + muladd(a->d[6], b->d[4]); + muladd(a->d[7], b->d[3]); + extract(l[10]); + muladd(a->d[4], b->d[7]); + muladd(a->d[5], b->d[6]); + muladd(a->d[6], b->d[5]); + muladd(a->d[7], b->d[4]); + extract(l[11]); + muladd(a->d[5], b->d[7]); + muladd(a->d[6], b->d[6]); + muladd(a->d[7], b->d[5]); + extract(l[12]); + muladd(a->d[6], b->d[7]); + muladd(a->d[7], b->d[6]); + extract(l[13]); + muladd_fast(a->d[7], b->d[7]); + extract_fast(l[14]); + VERIFY_CHECK(c1 == 0); + l[15] = c0; + + secp256k1_scalar_reduce_512(r, l); +} + +static void secp256k1_scalar_sqr(secp256k1_scalar_t *r, const secp256k1_scalar_t *a) { + /* 96 bit accumulator. */ + uint32_t c0 = 0, c1 = 0, c2 = 0; + + uint32_t l[16]; + + /* l[0..15] = a[0..7]^2. */ + muladd_fast(a->d[0], a->d[0]); + extract_fast(l[0]); + muladd2(a->d[0], a->d[1]); + extract(l[1]); + muladd2(a->d[0], a->d[2]); + muladd(a->d[1], a->d[1]); + extract(l[2]); + muladd2(a->d[0], a->d[3]); + muladd2(a->d[1], a->d[2]); + extract(l[3]); + muladd2(a->d[0], a->d[4]); + muladd2(a->d[1], a->d[3]); + muladd(a->d[2], a->d[2]); + extract(l[4]); + muladd2(a->d[0], a->d[5]); + muladd2(a->d[1], a->d[4]); + muladd2(a->d[2], a->d[3]); + extract(l[5]); + muladd2(a->d[0], a->d[6]); + muladd2(a->d[1], a->d[5]); + muladd2(a->d[2], a->d[4]); + muladd(a->d[3], a->d[3]); + extract(l[6]); + muladd2(a->d[0], a->d[7]); + muladd2(a->d[1], a->d[6]); + muladd2(a->d[2], a->d[5]); + muladd2(a->d[3], a->d[4]); + extract(l[7]); + muladd2(a->d[1], a->d[7]); + muladd2(a->d[2], a->d[6]); + muladd2(a->d[3], a->d[5]); + muladd(a->d[4], a->d[4]); + extract(l[8]); + muladd2(a->d[2], a->d[7]); + muladd2(a->d[3], a->d[6]); + muladd2(a->d[4], a->d[5]); + extract(l[9]); + muladd2(a->d[3], a->d[7]); + muladd2(a->d[4], a->d[6]); + muladd(a->d[5], a->d[5]); + extract(l[10]); + muladd2(a->d[4], a->d[7]); + muladd2(a->d[5], a->d[6]); + extract(l[11]); + muladd2(a->d[5], a->d[7]); + muladd(a->d[6], a->d[6]); + extract(l[12]); + muladd2(a->d[6], a->d[7]); + extract(l[13]); + muladd_fast(a->d[7], a->d[7]); + extract_fast(l[14]); + VERIFY_CHECK(c1 == 0); + l[15] = c0; + + secp256k1_scalar_reduce_512(r, l); +} + +#undef sumadd +#undef sumadd_fast +#undef muladd +#undef muladd_fast +#undef muladd2 +#undef extract +#undef extract_fast + +#endif diff --git a/src/scalar_impl.h b/src/scalar_impl.h new file mode 100644 index 0000000000..ddc5061c76 --- /dev/null +++ b/src/scalar_impl.h @@ -0,0 +1,184 @@ +/********************************************************************** + * Copyright (c) 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_SCALAR_IMPL_H_ +#define _SECP256K1_SCALAR_IMPL_H_ + +#include + +#include "scalar.h" + +#if defined HAVE_CONFIG_H +#include "libsecp256k1-config.h" +#endif + +#if defined(USE_SCALAR_4X64) +#include "scalar_4x64_impl.h" +#elif defined(USE_SCALAR_8X32) +#include "scalar_8x32_impl.h" +#else +#error "Please select scalar implementation" +#endif + +static void secp256k1_scalar_get_num(secp256k1_num_t *r, const secp256k1_scalar_t *a) { + unsigned char c[32]; + secp256k1_scalar_get_b32(c, a); + secp256k1_num_set_bin(r, c, 32); +} + + +static void secp256k1_scalar_inverse(secp256k1_scalar_t *r, const secp256k1_scalar_t *x) { + /* First compute x ^ (2^N - 1) for some values of N. */ + secp256k1_scalar_t x2, x3, x4, x6, x7, x8, x15, x30, x60, x120, x127; + + secp256k1_scalar_sqr(&x2, x); + secp256k1_scalar_mul(&x2, &x2, x); + + secp256k1_scalar_sqr(&x3, &x2); + secp256k1_scalar_mul(&x3, &x3, x); + + secp256k1_scalar_sqr(&x4, &x3); + secp256k1_scalar_mul(&x4, &x4, x); + + secp256k1_scalar_sqr(&x6, &x4); + secp256k1_scalar_sqr(&x6, &x6); + secp256k1_scalar_mul(&x6, &x6, &x2); + + secp256k1_scalar_sqr(&x7, &x6); + secp256k1_scalar_mul(&x7, &x7, x); + + secp256k1_scalar_sqr(&x8, &x7); + secp256k1_scalar_mul(&x8, &x8, x); + + secp256k1_scalar_sqr(&x15, &x8); + for (int i=0; i<6; i++) + secp256k1_scalar_sqr(&x15, &x15); + secp256k1_scalar_mul(&x15, &x15, &x7); + + secp256k1_scalar_sqr(&x30, &x15); + for (int i=0; i<14; i++) + secp256k1_scalar_sqr(&x30, &x30); + secp256k1_scalar_mul(&x30, &x30, &x15); + + secp256k1_scalar_sqr(&x60, &x30); + for (int i=0; i<29; i++) + secp256k1_scalar_sqr(&x60, &x60); + secp256k1_scalar_mul(&x60, &x60, &x30); + + secp256k1_scalar_sqr(&x120, &x60); + for (int i=0; i<59; i++) + secp256k1_scalar_sqr(&x120, &x120); + secp256k1_scalar_mul(&x120, &x120, &x60); + + secp256k1_scalar_sqr(&x127, &x120); + for (int i=0; i<6; i++) + secp256k1_scalar_sqr(&x127, &x127); + secp256k1_scalar_mul(&x127, &x127, &x7); + + /* Then accumulate the final result (t starts at x127). */ + secp256k1_scalar_t *t = &x127; + for (int i=0; i<2; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, x); /* 1 */ + for (int i=0; i<4; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, &x3); /* 111 */ + for (int i=0; i<2; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, x); /* 1 */ + for (int i=0; i<2; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, x); /* 1 */ + for (int i=0; i<2; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, x); /* 1 */ + for (int i=0; i<4; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, &x3); /* 111 */ + for (int i=0; i<3; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, &x2); /* 11 */ + for (int i=0; i<4; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, &x3); /* 111 */ + for (int i=0; i<5; i++) /* 00 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, &x3); /* 111 */ + for (int i=0; i<4; i++) /* 00 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, &x2); /* 11 */ + for (int i=0; i<2; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, x); /* 1 */ + for (int i=0; i<2; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, x); /* 1 */ + for (int i=0; i<5; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, &x4); /* 1111 */ + for (int i=0; i<2; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, x); /* 1 */ + for (int i=0; i<3; i++) /* 00 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, x); /* 1 */ + for (int i=0; i<4; i++) /* 000 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, x); /* 1 */ + for (int i=0; i<2; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, x); /* 1 */ + for (int i=0; i<10; i++) /* 0000000 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, &x3); /* 111 */ + for (int i=0; i<4; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, &x3); /* 111 */ + for (int i=0; i<9; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, &x8); /* 11111111 */ + for (int i=0; i<2; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, x); /* 1 */ + for (int i=0; i<3; i++) /* 00 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, x); /* 1 */ + for (int i=0; i<3; i++) /* 00 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, x); /* 1 */ + for (int i=0; i<5; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, &x4); /* 1111 */ + for (int i=0; i<2; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, x); /* 1 */ + for (int i=0; i<5; i++) /* 000 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, &x2); /* 11 */ + for (int i=0; i<4; i++) /* 00 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, &x2); /* 11 */ + for (int i=0; i<2; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, x); /* 1 */ + for (int i=0; i<8; i++) /* 000000 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, &x2); /* 11 */ + for (int i=0; i<3; i++) /* 0 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, &x2); /* 11 */ + for (int i=0; i<3; i++) /* 00 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, x); /* 1 */ + for (int i=0; i<6; i++) /* 00000 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(t, t, x); /* 1 */ + for (int i=0; i<8; i++) /* 00 */ + secp256k1_scalar_sqr(t, t); + secp256k1_scalar_mul(r, t, &x6); /* 111111 */ +} + +#endif diff --git a/src/secp256k1.c b/src/secp256k1.c new file mode 100644 index 0000000000..1ab5b3722c --- /dev/null +++ b/src/secp256k1.c @@ -0,0 +1,305 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#define SECP256K1_BUILD (1) + +#include "include/secp256k1.h" + +#include "util.h" +#include "num_impl.h" +#include "field_impl.h" +#include "scalar_impl.h" +#include "group_impl.h" +#include "ecmult_impl.h" +#include "ecmult_gen_impl.h" +#include "ecdsa_impl.h" +#include "eckey_impl.h" + +void secp256k1_start(unsigned int flags) { + secp256k1_fe_start(); + secp256k1_ge_start(); + if (flags & SECP256K1_START_SIGN) { + secp256k1_ecmult_gen_start(); + } + if (flags & SECP256K1_START_VERIFY) { + secp256k1_ecmult_start(); + } +} + +void secp256k1_stop(void) { + secp256k1_ecmult_stop(); + secp256k1_ecmult_gen_stop(); + secp256k1_ge_stop(); + secp256k1_fe_stop(); +} + +int secp256k1_ecdsa_verify(const unsigned char *msg, int msglen, const unsigned char *sig, int siglen, const unsigned char *pubkey, int pubkeylen) { + DEBUG_CHECK(secp256k1_ecmult_consts != NULL); + DEBUG_CHECK(msg != NULL); + DEBUG_CHECK(msglen <= 32); + DEBUG_CHECK(sig != NULL); + DEBUG_CHECK(pubkey != NULL); + + int ret = -3; + secp256k1_num_t m; + secp256k1_ecdsa_sig_t s; + secp256k1_ge_t q; + secp256k1_num_set_bin(&m, msg, msglen); + + if (!secp256k1_eckey_pubkey_parse(&q, pubkey, pubkeylen)) { + ret = -1; + goto end; + } + if (!secp256k1_ecdsa_sig_parse(&s, sig, siglen)) { + ret = -2; + goto end; + } + if (!secp256k1_ecdsa_sig_verify(&s, &q, &m)) { + ret = 0; + goto end; + } + ret = 1; +end: + return ret; +} + +int secp256k1_ecdsa_sign(const unsigned char *message, int messagelen, unsigned char *signature, int *signaturelen, const unsigned char *seckey, const unsigned char *nonce) { + DEBUG_CHECK(secp256k1_ecmult_gen_consts != NULL); + DEBUG_CHECK(message != NULL); + DEBUG_CHECK(messagelen <= 32); + DEBUG_CHECK(signature != NULL); + DEBUG_CHECK(signaturelen != NULL); + DEBUG_CHECK(seckey != NULL); + DEBUG_CHECK(nonce != NULL); + + secp256k1_scalar_t sec, non, msg; + secp256k1_scalar_set_b32(&sec, seckey, NULL); + int overflow = 0; + secp256k1_scalar_set_b32(&non, nonce, &overflow); + { + unsigned char c[32] = {0}; + memcpy(c + 32 - messagelen, message, messagelen); + secp256k1_scalar_set_b32(&msg, c, NULL); + memset(c, 0, 32); + } + int ret = !secp256k1_scalar_is_zero(&non) && !overflow; + secp256k1_ecdsa_sig_t sig; + if (ret) { + ret = secp256k1_ecdsa_sig_sign(&sig, &sec, &msg, &non, NULL); + } + if (ret) { + secp256k1_ecdsa_sig_serialize(signature, signaturelen, &sig); + } + secp256k1_scalar_clear(&msg); + secp256k1_scalar_clear(&non); + secp256k1_scalar_clear(&sec); + return ret; +} + +int secp256k1_ecdsa_sign_compact(const unsigned char *message, int messagelen, unsigned char *sig64, const unsigned char *seckey, const unsigned char *nonce, int *recid) { + DEBUG_CHECK(secp256k1_ecmult_gen_consts != NULL); + DEBUG_CHECK(message != NULL); + DEBUG_CHECK(messagelen <= 32); + DEBUG_CHECK(sig64 != NULL); + DEBUG_CHECK(seckey != NULL); + DEBUG_CHECK(nonce != NULL); + + secp256k1_scalar_t sec, non, msg; + secp256k1_scalar_set_b32(&sec, seckey, NULL); + int overflow = 0; + secp256k1_scalar_set_b32(&non, nonce, &overflow); + { + unsigned char c[32] = {0}; + memcpy(c + 32 - messagelen, message, messagelen); + secp256k1_scalar_set_b32(&msg, c, NULL); + memset(c, 0, 32); + } + int ret = !secp256k1_scalar_is_zero(&non) && !overflow; + secp256k1_ecdsa_sig_t sig; + if (ret) { + ret = secp256k1_ecdsa_sig_sign(&sig, &sec, &msg, &non, recid); + } + if (ret) { + secp256k1_num_get_bin(sig64, 32, &sig.r); + secp256k1_num_get_bin(sig64 + 32, 32, &sig.s); + } + secp256k1_scalar_clear(&msg); + secp256k1_scalar_clear(&non); + secp256k1_scalar_clear(&sec); + return ret; +} + +int secp256k1_ecdsa_recover_compact(const unsigned char *msg, int msglen, const unsigned char *sig64, unsigned char *pubkey, int *pubkeylen, int compressed, int recid) { + DEBUG_CHECK(secp256k1_ecmult_consts != NULL); + DEBUG_CHECK(msg != NULL); + DEBUG_CHECK(msglen <= 32); + DEBUG_CHECK(sig64 != NULL); + DEBUG_CHECK(pubkey != NULL); + DEBUG_CHECK(pubkeylen != NULL); + DEBUG_CHECK(recid >= 0 && recid <= 3); + + int ret = 0; + secp256k1_num_t m; + secp256k1_ecdsa_sig_t sig; + secp256k1_num_set_bin(&sig.r, sig64, 32); + secp256k1_num_set_bin(&sig.s, sig64 + 32, 32); + secp256k1_num_set_bin(&m, msg, msglen); + + secp256k1_ge_t q; + if (secp256k1_ecdsa_sig_recover(&sig, &q, &m, recid)) { + ret = secp256k1_eckey_pubkey_serialize(&q, pubkey, pubkeylen, compressed); + } + return ret; +} + +int secp256k1_ec_seckey_verify(const unsigned char *seckey) { + DEBUG_CHECK(seckey != NULL); + + secp256k1_scalar_t sec; + int overflow; + secp256k1_scalar_set_b32(&sec, seckey, &overflow); + int ret = !secp256k1_scalar_is_zero(&sec) && !overflow; + secp256k1_scalar_clear(&sec); + return ret; +} + +int secp256k1_ec_pubkey_verify(const unsigned char *pubkey, int pubkeylen) { + DEBUG_CHECK(pubkey != NULL); + + secp256k1_ge_t q; + return secp256k1_eckey_pubkey_parse(&q, pubkey, pubkeylen); +} + +int secp256k1_ec_pubkey_create(unsigned char *pubkey, int *pubkeylen, const unsigned char *seckey, int compressed) { + DEBUG_CHECK(secp256k1_ecmult_gen_consts != NULL); + DEBUG_CHECK(pubkey != NULL); + DEBUG_CHECK(pubkeylen != NULL); + DEBUG_CHECK(seckey != NULL); + + secp256k1_scalar_t sec; + secp256k1_scalar_set_b32(&sec, seckey, NULL); + secp256k1_gej_t pj; + secp256k1_ecmult_gen(&pj, &sec); + secp256k1_scalar_clear(&sec); + secp256k1_ge_t p; + secp256k1_ge_set_gej(&p, &pj); + return secp256k1_eckey_pubkey_serialize(&p, pubkey, pubkeylen, compressed); +} + +int secp256k1_ec_pubkey_decompress(unsigned char *pubkey, int *pubkeylen) { + DEBUG_CHECK(pubkey != NULL); + DEBUG_CHECK(pubkeylen != NULL); + + secp256k1_ge_t p; + if (!secp256k1_eckey_pubkey_parse(&p, pubkey, *pubkeylen)) + return 0; + return secp256k1_eckey_pubkey_serialize(&p, pubkey, pubkeylen, 0); +} + +int secp256k1_ec_privkey_tweak_add(unsigned char *seckey, const unsigned char *tweak) { + DEBUG_CHECK(seckey != NULL); + DEBUG_CHECK(tweak != NULL); + + secp256k1_scalar_t term; + int overflow = 0; + secp256k1_scalar_set_b32(&term, tweak, &overflow); + secp256k1_scalar_t sec; + secp256k1_scalar_set_b32(&sec, seckey, NULL); + + int ret = secp256k1_eckey_privkey_tweak_add(&sec, &term) && !overflow; + if (ret) { + secp256k1_scalar_get_b32(seckey, &sec); + } + + secp256k1_scalar_clear(&sec); + secp256k1_scalar_clear(&term); + return ret; +} + +int secp256k1_ec_pubkey_tweak_add(unsigned char *pubkey, int pubkeylen, const unsigned char *tweak) { + DEBUG_CHECK(secp256k1_ecmult_consts != NULL); + DEBUG_CHECK(pubkey != NULL); + DEBUG_CHECK(tweak != NULL); + + secp256k1_num_t term; + secp256k1_num_set_bin(&term, tweak, 32); + secp256k1_ge_t p; + int ret = secp256k1_eckey_pubkey_parse(&p, pubkey, pubkeylen); + if (ret) { + ret = secp256k1_eckey_pubkey_tweak_add(&p, &term); + } + if (ret) { + int oldlen = pubkeylen; + ret = secp256k1_eckey_pubkey_serialize(&p, pubkey, &pubkeylen, oldlen <= 33); + VERIFY_CHECK(pubkeylen == oldlen); + } + + return ret; +} + +int secp256k1_ec_privkey_tweak_mul(unsigned char *seckey, const unsigned char *tweak) { + DEBUG_CHECK(seckey != NULL); + DEBUG_CHECK(tweak != NULL); + + secp256k1_scalar_t factor; + int overflow = 0; + secp256k1_scalar_set_b32(&factor, tweak, &overflow); + secp256k1_scalar_t sec; + secp256k1_scalar_set_b32(&sec, seckey, NULL); + int ret = secp256k1_eckey_privkey_tweak_mul(&sec, &factor) && !overflow; + if (ret) { + secp256k1_scalar_get_b32(seckey, &sec); + } + + secp256k1_scalar_clear(&sec); + secp256k1_scalar_clear(&factor); + return ret; +} + +int secp256k1_ec_pubkey_tweak_mul(unsigned char *pubkey, int pubkeylen, const unsigned char *tweak) { + DEBUG_CHECK(secp256k1_ecmult_consts != NULL); + DEBUG_CHECK(pubkey != NULL); + DEBUG_CHECK(tweak != NULL); + + secp256k1_num_t factor; + secp256k1_num_set_bin(&factor, tweak, 32); + secp256k1_ge_t p; + int ret = secp256k1_eckey_pubkey_parse(&p, pubkey, pubkeylen); + if (ret) { + ret = secp256k1_eckey_pubkey_tweak_mul(&p, &factor); + } + if (ret) { + int oldlen = pubkeylen; + ret = secp256k1_eckey_pubkey_serialize(&p, pubkey, &pubkeylen, oldlen <= 33); + VERIFY_CHECK(pubkeylen == oldlen); + } + + return ret; +} + +int secp256k1_ec_privkey_export(const unsigned char *seckey, unsigned char *privkey, int *privkeylen, int compressed) { + DEBUG_CHECK(seckey != NULL); + DEBUG_CHECK(privkey != NULL); + DEBUG_CHECK(privkeylen != NULL); + + secp256k1_scalar_t key; + secp256k1_scalar_set_b32(&key, seckey, NULL); + int ret = secp256k1_eckey_privkey_serialize(privkey, privkeylen, &key, compressed); + secp256k1_scalar_clear(&key); + return ret; +} + +int secp256k1_ec_privkey_import(unsigned char *seckey, const unsigned char *privkey, int privkeylen) { + DEBUG_CHECK(seckey != NULL); + DEBUG_CHECK(privkey != NULL); + + secp256k1_scalar_t key; + int ret = secp256k1_eckey_privkey_parse(&key, privkey, privkeylen); + if (ret) + secp256k1_scalar_get_b32(seckey, &key); + secp256k1_scalar_clear(&key); + return ret; +} diff --git a/src/testrand.h b/src/testrand.h new file mode 100644 index 0000000000..018b65cd53 --- /dev/null +++ b/src/testrand.h @@ -0,0 +1,26 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_TESTRAND_H_ +#define _SECP256K1_TESTRAND_H_ + +#if defined HAVE_CONFIG_H +#include "libsecp256k1-config.h" +#endif + +/** Seed the pseudorandom number generator. */ +SECP256K1_INLINE static void secp256k1_rand_seed(uint64_t v); + +/** Generate a pseudorandom 32-bit number. */ +static uint32_t secp256k1_rand32(void); + +/** Generate a pseudorandom 32-byte array. */ +static void secp256k1_rand256(unsigned char *b32); + +/** Generate a pseudorandom 32-byte array with long sequences of zero and one bits. */ +static void secp256k1_rand256_test(unsigned char *b32); + +#endif diff --git a/src/testrand_impl.h b/src/testrand_impl.h new file mode 100644 index 0000000000..677c4b9a0e --- /dev/null +++ b/src/testrand_impl.h @@ -0,0 +1,60 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_TESTRAND_IMPL_H_ +#define _SECP256K1_TESTRAND_IMPL_H_ + +#include +#include + +#include "testrand.h" + +static uint32_t secp256k1_Rz = 11, secp256k1_Rw = 11; + +SECP256K1_INLINE static void secp256k1_rand_seed(uint64_t v) { + secp256k1_Rz = v >> 32; + secp256k1_Rw = v; + + if (secp256k1_Rz == 0 || secp256k1_Rz == 0x9068ffffU) { + secp256k1_Rz = 111; + } + if (secp256k1_Rw == 0 || secp256k1_Rw == 0x464fffffU) { + secp256k1_Rw = 111; + } +} + +SECP256K1_INLINE static uint32_t secp256k1_rand32(void) { + secp256k1_Rz = 36969 * (secp256k1_Rz & 0xFFFF) + (secp256k1_Rz >> 16); + secp256k1_Rw = 18000 * (secp256k1_Rw & 0xFFFF) + (secp256k1_Rw >> 16); + return (secp256k1_Rw << 16) + (secp256k1_Rw >> 16) + secp256k1_Rz; +} + +static void secp256k1_rand256(unsigned char *b32) { + for (int i=0; i<8; i++) { + uint32_t r = secp256k1_rand32(); + b32[i*4 + 0] = (r >> 0) & 0xFF; + b32[i*4 + 1] = (r >> 8) & 0xFF; + b32[i*4 + 2] = (r >> 16) & 0xFF; + b32[i*4 + 3] = (r >> 24) & 0xFF; + } +} + +static void secp256k1_rand256_test(unsigned char *b32) { + int bits=0; + memset(b32, 0, 32); + while (bits < 256) { + uint32_t ent = secp256k1_rand32(); + int now = 1 + ((ent % 64)*((ent >> 6) % 32)+16)/31; + uint32_t val = 1 & (ent >> 11); + while (now > 0 && bits < 256) { + b32[bits / 8] |= val << (bits % 8); + now--; + bits++; + } + } +} + +#endif diff --git a/src/tests.c b/src/tests.c new file mode 100644 index 0000000000..5d9b8344d9 --- /dev/null +++ b/src/tests.c @@ -0,0 +1,1080 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#if defined HAVE_CONFIG_H +#include "libsecp256k1-config.h" +#endif + +#include +#include + +#include "secp256k1.c" +#include "testrand_impl.h" + +#ifdef ENABLE_OPENSSL_TESTS +#include "openssl/bn.h" +#include "openssl/ec.h" +#include "openssl/ecdsa.h" +#include "openssl/obj_mac.h" +#endif + +static int count = 64; + +/***** NUM TESTS *****/ + +void random_num_negate(secp256k1_num_t *num) { + if (secp256k1_rand32() & 1) + secp256k1_num_negate(num); +} + +void random_field_element_test(secp256k1_fe_t *fe) { + do { + unsigned char b32[32]; + secp256k1_rand256_test(b32); + secp256k1_num_t num; + secp256k1_num_set_bin(&num, b32, 32); + if (secp256k1_num_cmp(&num, &secp256k1_fe_consts->p) >= 0) + continue; + secp256k1_fe_set_b32(fe, b32); + break; + } while(1); +} + +void random_field_element_magnitude(secp256k1_fe_t *fe) { + secp256k1_fe_normalize(fe); + int n = secp256k1_rand32() % 4; + for (int i = 0; i < n; i++) { + secp256k1_fe_negate(fe, fe, 1 + 2*i); + secp256k1_fe_negate(fe, fe, 2 + 2*i); + } +} + +void random_group_element_test(secp256k1_ge_t *ge) { + secp256k1_fe_t fe; + do { + random_field_element_test(&fe); + if (secp256k1_ge_set_xo(ge, &fe, secp256k1_rand32() & 1)) + break; + } while(1); +} + +void random_group_element_jacobian_test(secp256k1_gej_t *gej, const secp256k1_ge_t *ge) { + do { + random_field_element_test(&gej->z); + if (!secp256k1_fe_is_zero(&gej->z)) { + break; + } + } while(1); + secp256k1_fe_t z2; secp256k1_fe_sqr(&z2, &gej->z); + secp256k1_fe_t z3; secp256k1_fe_mul(&z3, &z2, &gej->z); + secp256k1_fe_mul(&gej->x, &ge->x, &z2); + secp256k1_fe_mul(&gej->y, &ge->y, &z3); + gej->infinity = ge->infinity; +} + +void random_num_order_test(secp256k1_num_t *num) { + do { + unsigned char b32[32]; + secp256k1_rand256_test(b32); + secp256k1_num_set_bin(num, b32, 32); + if (secp256k1_num_is_zero(num)) + continue; + if (secp256k1_num_cmp(num, &secp256k1_ge_consts->order) >= 0) + continue; + break; + } while(1); +} + +void random_scalar_order_test(secp256k1_scalar_t *num) { + do { + unsigned char b32[32]; + secp256k1_rand256_test(b32); + int overflow = 0; + secp256k1_scalar_set_b32(num, b32, &overflow); + if (overflow || secp256k1_scalar_is_zero(num)) + continue; + break; + } while(1); +} + +void random_num_order(secp256k1_num_t *num) { + do { + unsigned char b32[32]; + secp256k1_rand256(b32); + secp256k1_num_set_bin(num, b32, 32); + if (secp256k1_num_is_zero(num)) + continue; + if (secp256k1_num_cmp(num, &secp256k1_ge_consts->order) >= 0) + continue; + break; + } while(1); +} + +void test_num_copy_inc_cmp(void) { + secp256k1_num_t n1,n2; + random_num_order(&n1); + secp256k1_num_copy(&n2, &n1); + CHECK(secp256k1_num_eq(&n1, &n2)); + CHECK(secp256k1_num_eq(&n2, &n1)); + secp256k1_num_inc(&n2); + CHECK(!secp256k1_num_eq(&n1, &n2)); + CHECK(!secp256k1_num_eq(&n2, &n1)); +} + + +void test_num_get_set_hex(void) { + secp256k1_num_t n1,n2; + random_num_order_test(&n1); + char c[64]; + secp256k1_num_get_hex(c, 64, &n1); + secp256k1_num_set_hex(&n2, c, 64); + CHECK(secp256k1_num_eq(&n1, &n2)); + for (int i=0; i<64; i++) { + /* check whether the lower 4 bits correspond to the last hex character */ + int low1 = secp256k1_num_shift(&n1, 4); + int lowh = c[63]; + int low2 = ((lowh>>6)*9+(lowh-'0'))&15; + CHECK(low1 == low2); + /* shift bits off the hex representation, and compare */ + memmove(c+1, c, 63); + c[0] = '0'; + secp256k1_num_set_hex(&n2, c, 64); + CHECK(secp256k1_num_eq(&n1, &n2)); + } +} + +void test_num_get_set_bin(void) { + secp256k1_num_t n1,n2; + random_num_order_test(&n1); + unsigned char c[32]; + secp256k1_num_get_bin(c, 32, &n1); + secp256k1_num_set_bin(&n2, c, 32); + CHECK(secp256k1_num_eq(&n1, &n2)); + for (int i=0; i<32; i++) { + /* check whether the lower 8 bits correspond to the last byte */ + int low1 = secp256k1_num_shift(&n1, 8); + int low2 = c[31]; + CHECK(low1 == low2); + /* shift bits off the byte representation, and compare */ + memmove(c+1, c, 31); + c[0] = 0; + secp256k1_num_set_bin(&n2, c, 32); + CHECK(secp256k1_num_eq(&n1, &n2)); + } +} + +void run_num_int(void) { + secp256k1_num_t n1; + for (int i=-255; i<256; i++) { + unsigned char c1[3] = {}; + c1[2] = abs(i); + unsigned char c2[3] = {0x11,0x22,0x33}; + secp256k1_num_set_int(&n1, i); + secp256k1_num_get_bin(c2, 3, &n1); + CHECK(memcmp(c1, c2, 3) == 0); + } +} + +void test_num_negate(void) { + secp256k1_num_t n1; + secp256k1_num_t n2; + random_num_order_test(&n1); /* n1 = R */ + random_num_negate(&n1); + secp256k1_num_copy(&n2, &n1); /* n2 = R */ + secp256k1_num_sub(&n1, &n2, &n1); /* n1 = n2-n1 = 0 */ + CHECK(secp256k1_num_is_zero(&n1)); + secp256k1_num_copy(&n1, &n2); /* n1 = R */ + secp256k1_num_negate(&n1); /* n1 = -R */ + CHECK(!secp256k1_num_is_zero(&n1)); + secp256k1_num_add(&n1, &n2, &n1); /* n1 = n2+n1 = 0 */ + CHECK(secp256k1_num_is_zero(&n1)); + secp256k1_num_copy(&n1, &n2); /* n1 = R */ + secp256k1_num_negate(&n1); /* n1 = -R */ + CHECK(secp256k1_num_is_neg(&n1) != secp256k1_num_is_neg(&n2)); + secp256k1_num_negate(&n1); /* n1 = R */ + CHECK(secp256k1_num_eq(&n1, &n2)); +} + +void test_num_add_sub(void) { + int r = secp256k1_rand32(); + secp256k1_num_t n1; + secp256k1_num_t n2; + random_num_order_test(&n1); /* n1 = R1 */ + if (r & 1) { + random_num_negate(&n1); + } + random_num_order_test(&n2); /* n2 = R2 */ + if (r & 2) { + random_num_negate(&n2); + } + secp256k1_num_t n1p2, n2p1, n1m2, n2m1; + secp256k1_num_add(&n1p2, &n1, &n2); /* n1p2 = R1 + R2 */ + secp256k1_num_add(&n2p1, &n2, &n1); /* n2p1 = R2 + R1 */ + secp256k1_num_sub(&n1m2, &n1, &n2); /* n1m2 = R1 - R2 */ + secp256k1_num_sub(&n2m1, &n2, &n1); /* n2m1 = R2 - R1 */ + CHECK(secp256k1_num_eq(&n1p2, &n2p1)); + CHECK(!secp256k1_num_eq(&n1p2, &n1m2)); + secp256k1_num_negate(&n2m1); /* n2m1 = -R2 + R1 */ + CHECK(secp256k1_num_eq(&n2m1, &n1m2)); + CHECK(!secp256k1_num_eq(&n2m1, &n1)); + secp256k1_num_add(&n2m1, &n2m1, &n2); /* n2m1 = -R2 + R1 + R2 = R1 */ + CHECK(secp256k1_num_eq(&n2m1, &n1)); + CHECK(!secp256k1_num_eq(&n2p1, &n1)); + secp256k1_num_sub(&n2p1, &n2p1, &n2); /* n2p1 = R2 + R1 - R2 = R1 */ + CHECK(secp256k1_num_eq(&n2p1, &n1)); +} + +void run_num_smalltests(void) { + for (int i=0; i<100*count; i++) { + test_num_copy_inc_cmp(); + test_num_get_set_hex(); + test_num_get_set_bin(); + test_num_negate(); + test_num_add_sub(); + } + run_num_int(); +} + +/***** SCALAR TESTS *****/ + +int secp256k1_scalar_eq(const secp256k1_scalar_t *s1, const secp256k1_scalar_t *s2) { + secp256k1_scalar_t t; + secp256k1_scalar_negate(&t, s2); + secp256k1_scalar_add(&t, &t, s1); + int ret = secp256k1_scalar_is_zero(&t); + return ret; +} + +void scalar_test(void) { + unsigned char c[32]; + + /* Set 's' to a random scalar, with value 'snum'. */ + secp256k1_rand256_test(c); + secp256k1_scalar_t s; + secp256k1_scalar_set_b32(&s, c, NULL); + secp256k1_num_t snum; + secp256k1_num_set_bin(&snum, c, 32); + secp256k1_num_mod(&snum, &secp256k1_ge_consts->order); + + /* Set 's1' to a random scalar, with value 's1num'. */ + secp256k1_rand256_test(c); + secp256k1_scalar_t s1; + secp256k1_scalar_set_b32(&s1, c, NULL); + secp256k1_num_t s1num; + secp256k1_num_set_bin(&s1num, c, 32); + secp256k1_num_mod(&s1num, &secp256k1_ge_consts->order); + + /* Set 's2' to a random scalar, with value 'snum2', and byte array representation 'c'. */ + secp256k1_rand256_test(c); + secp256k1_scalar_t s2; + int overflow = 0; + secp256k1_scalar_set_b32(&s2, c, &overflow); + secp256k1_num_t s2num; + secp256k1_num_set_bin(&s2num, c, 32); + secp256k1_num_mod(&s2num, &secp256k1_ge_consts->order); + + { + /* Test that fetching groups of 4 bits from a scalar and recursing n(i)=16*n(i-1)+p(i) reconstructs it. */ + secp256k1_num_t n, t, m; + secp256k1_num_set_int(&n, 0); + secp256k1_num_set_int(&m, 16); + for (int i = 0; i < 256; i += 4) { + secp256k1_num_set_int(&t, secp256k1_scalar_get_bits(&s, 256 - 4 - i, 4)); + secp256k1_num_mul(&n, &n, &m); + secp256k1_num_add(&n, &n, &t); + } + CHECK(secp256k1_num_eq(&n, &snum)); + } + + { + /* Test that get_b32 returns the same as get_bin on the number. */ + unsigned char r1[32]; + secp256k1_scalar_get_b32(r1, &s2); + unsigned char r2[32]; + secp256k1_num_get_bin(r2, 32, &s2num); + CHECK(memcmp(r1, r2, 32) == 0); + /* If no overflow occurred when assigning, it should also be equal to the original byte array. */ + CHECK((memcmp(r1, c, 32) == 0) == (overflow == 0)); + } + + { + /* Test that adding the scalars together is equal to adding their numbers together modulo the order. */ + secp256k1_num_t rnum; + secp256k1_num_add(&rnum, &snum, &s2num); + secp256k1_num_mod(&rnum, &secp256k1_ge_consts->order); + secp256k1_scalar_t r; + secp256k1_scalar_add(&r, &s, &s2); + secp256k1_num_t r2num; + secp256k1_scalar_get_num(&r2num, &r); + CHECK(secp256k1_num_eq(&rnum, &r2num)); + } + + { + /* Test that multipying the scalars is equal to multiplying their numbers modulo the order. */ + secp256k1_num_t rnum; + secp256k1_num_mul(&rnum, &snum, &s2num); + secp256k1_num_mod(&rnum, &secp256k1_ge_consts->order); + secp256k1_scalar_t r; + secp256k1_scalar_mul(&r, &s, &s2); + secp256k1_num_t r2num; + secp256k1_scalar_get_num(&r2num, &r); + CHECK(secp256k1_num_eq(&rnum, &r2num)); + /* The result can only be zero if at least one of the factors was zero. */ + CHECK(secp256k1_scalar_is_zero(&r) == (secp256k1_scalar_is_zero(&s) || secp256k1_scalar_is_zero(&s2))); + /* The results can only be equal to one of the factors if that factor was zero, or the other factor was one. */ + CHECK(secp256k1_num_eq(&rnum, &snum) == (secp256k1_scalar_is_zero(&s) || secp256k1_scalar_is_one(&s2))); + CHECK(secp256k1_num_eq(&rnum, &s2num) == (secp256k1_scalar_is_zero(&s2) || secp256k1_scalar_is_one(&s))); + } + + { + /* Check that comparison with zero matches comparison with zero on the number. */ + CHECK(secp256k1_num_is_zero(&snum) == secp256k1_scalar_is_zero(&s)); + /* Check that comparison with the half order is equal to testing for high scalar. */ + CHECK(secp256k1_scalar_is_high(&s) == (secp256k1_num_cmp(&snum, &secp256k1_ge_consts->half_order) > 0)); + secp256k1_scalar_t neg; + secp256k1_scalar_negate(&neg, &s); + secp256k1_num_t negnum; + secp256k1_num_sub(&negnum, &secp256k1_ge_consts->order, &snum); + secp256k1_num_mod(&negnum, &secp256k1_ge_consts->order); + /* Check that comparison with the half order is equal to testing for high scalar after negation. */ + CHECK(secp256k1_scalar_is_high(&neg) == (secp256k1_num_cmp(&negnum, &secp256k1_ge_consts->half_order) > 0)); + /* Negating should change the high property, unless the value was already zero. */ + CHECK((secp256k1_scalar_is_high(&s) == secp256k1_scalar_is_high(&neg)) == secp256k1_scalar_is_zero(&s)); + secp256k1_num_t negnum2; + secp256k1_scalar_get_num(&negnum2, &neg); + /* Negating a scalar should be equal to (order - n) mod order on the number. */ + CHECK(secp256k1_num_eq(&negnum, &negnum2)); + secp256k1_scalar_add(&neg, &neg, &s); + /* Adding a number to its negation should result in zero. */ + CHECK(secp256k1_scalar_is_zero(&neg)); + secp256k1_scalar_negate(&neg, &neg); + /* Negating zero should still result in zero. */ + CHECK(secp256k1_scalar_is_zero(&neg)); + } + + { + /* Test that scalar inverses are equal to the inverse of their number modulo the order. */ + if (!secp256k1_scalar_is_zero(&s)) { + secp256k1_scalar_t inv; + secp256k1_scalar_inverse(&inv, &s); + secp256k1_num_t invnum; + secp256k1_num_mod_inverse(&invnum, &snum, &secp256k1_ge_consts->order); + secp256k1_num_t invnum2; + secp256k1_scalar_get_num(&invnum2, &inv); + CHECK(secp256k1_num_eq(&invnum, &invnum2)); + secp256k1_scalar_mul(&inv, &inv, &s); + /* Multiplying a scalar with its inverse must result in one. */ + CHECK(secp256k1_scalar_is_one(&inv)); + secp256k1_scalar_inverse(&inv, &inv); + /* Inverting one must result in one. */ + CHECK(secp256k1_scalar_is_one(&inv)); + } + } + + { + /* Test commutativity of add. */ + secp256k1_scalar_t r1, r2; + secp256k1_scalar_add(&r1, &s1, &s2); + secp256k1_scalar_add(&r2, &s2, &s1); + CHECK(secp256k1_scalar_eq(&r1, &r2)); + } + + { + /* Test commutativity of mul. */ + secp256k1_scalar_t r1, r2; + secp256k1_scalar_mul(&r1, &s1, &s2); + secp256k1_scalar_mul(&r2, &s2, &s1); + CHECK(secp256k1_scalar_eq(&r1, &r2)); + } + + { + /* Test associativity of add. */ + secp256k1_scalar_t r1, r2; + secp256k1_scalar_add(&r1, &s1, &s2); + secp256k1_scalar_add(&r1, &r1, &s); + secp256k1_scalar_add(&r2, &s2, &s); + secp256k1_scalar_add(&r2, &s1, &r2); + CHECK(secp256k1_scalar_eq(&r1, &r2)); + } + + { + /* Test associativity of mul. */ + secp256k1_scalar_t r1, r2; + secp256k1_scalar_mul(&r1, &s1, &s2); + secp256k1_scalar_mul(&r1, &r1, &s); + secp256k1_scalar_mul(&r2, &s2, &s); + secp256k1_scalar_mul(&r2, &s1, &r2); + CHECK(secp256k1_scalar_eq(&r1, &r2)); + } + + { + /* Test distributitivity of mul over add. */ + secp256k1_scalar_t r1, r2, t; + secp256k1_scalar_add(&r1, &s1, &s2); + secp256k1_scalar_mul(&r1, &r1, &s); + secp256k1_scalar_mul(&r2, &s1, &s); + secp256k1_scalar_mul(&t, &s2, &s); + secp256k1_scalar_add(&r2, &r2, &t); + CHECK(secp256k1_scalar_eq(&r1, &r2)); + } + + { + /* Test square. */ + secp256k1_scalar_t r1, r2; + secp256k1_scalar_sqr(&r1, &s1); + secp256k1_scalar_mul(&r2, &s1, &s1); + CHECK(secp256k1_scalar_eq(&r1, &r2)); + } +} + +void run_scalar_tests(void) { + for (int i = 0; i < 128 * count; i++) { + scalar_test(); + } +} + +/***** FIELD TESTS *****/ + +void random_fe(secp256k1_fe_t *x) { + unsigned char bin[32]; + secp256k1_rand256(bin); + secp256k1_fe_set_b32(x, bin); +} + +void random_fe_non_zero(secp256k1_fe_t *nz) { + int tries = 10; + while (--tries >= 0) { + random_fe(nz); + secp256k1_fe_normalize(nz); + if (!secp256k1_fe_is_zero(nz)) + break; + } + /* Infinitesimal probability of spurious failure here */ + CHECK(tries >= 0); +} + +void random_fe_non_square(secp256k1_fe_t *ns) { + random_fe_non_zero(ns); + secp256k1_fe_t r; + if (secp256k1_fe_sqrt(&r, ns)) { + secp256k1_fe_negate(ns, ns, 1); + } +} + +int check_fe_equal(const secp256k1_fe_t *a, const secp256k1_fe_t *b) { + secp256k1_fe_t an = *a; secp256k1_fe_normalize(&an); + secp256k1_fe_t bn = *b; secp256k1_fe_normalize(&bn); + return secp256k1_fe_equal(&an, &bn); +} + +int check_fe_inverse(const secp256k1_fe_t *a, const secp256k1_fe_t *ai) { + secp256k1_fe_t x; secp256k1_fe_mul(&x, a, ai); + secp256k1_fe_t one; secp256k1_fe_set_int(&one, 1); + return check_fe_equal(&x, &one); +} + +void run_field_inv(void) { + secp256k1_fe_t x, xi, xii; + for (int i=0; i<10*count; i++) { + random_fe_non_zero(&x); + secp256k1_fe_inv(&xi, &x); + CHECK(check_fe_inverse(&x, &xi)); + secp256k1_fe_inv(&xii, &xi); + CHECK(check_fe_equal(&x, &xii)); + } +} + +void run_field_inv_var(void) { + secp256k1_fe_t x, xi, xii; + for (int i=0; i<10*count; i++) { + random_fe_non_zero(&x); + secp256k1_fe_inv_var(&xi, &x); + CHECK(check_fe_inverse(&x, &xi)); + secp256k1_fe_inv_var(&xii, &xi); + CHECK(check_fe_equal(&x, &xii)); + } +} + +void run_field_inv_all(void) { + secp256k1_fe_t x[16], xi[16], xii[16]; + /* Check it's safe to call for 0 elements */ + secp256k1_fe_inv_all(0, xi, x); + for (int i=0; iinfinity && b->infinity) + return 1; + return check_fe_equal(&a->x, &b->x) && check_fe_equal(&a->y, &b->y); +} + +void ge_equals_gej(const secp256k1_ge_t *a, const secp256k1_gej_t *b) { + secp256k1_ge_t bb; + secp256k1_gej_t bj = *b; + secp256k1_ge_set_gej_var(&bb, &bj); + CHECK(ge_equals_ge(a, &bb)); +} + +void gej_equals_gej(const secp256k1_gej_t *a, const secp256k1_gej_t *b) { + secp256k1_ge_t aa, bb; + secp256k1_gej_t aj = *a, bj = *b; + secp256k1_ge_set_gej_var(&aa, &aj); + secp256k1_ge_set_gej_var(&bb, &bj); + CHECK(ge_equals_ge(&aa, &bb)); +} + +void test_ge(void) { + secp256k1_ge_t a, b, i, n; + random_group_element_test(&a); + random_group_element_test(&b); + n = a; + secp256k1_fe_normalize(&a.y); + secp256k1_fe_negate(&n.y, &a.y, 1); + secp256k1_ge_set_infinity(&i); + random_field_element_magnitude(&a.x); + random_field_element_magnitude(&a.y); + random_field_element_magnitude(&b.x); + random_field_element_magnitude(&b.y); + random_field_element_magnitude(&n.x); + random_field_element_magnitude(&n.y); + + secp256k1_gej_t aj, bj, ij, nj; + random_group_element_jacobian_test(&aj, &a); + random_group_element_jacobian_test(&bj, &b); + secp256k1_gej_set_infinity(&ij); + random_group_element_jacobian_test(&nj, &n); + random_field_element_magnitude(&aj.x); + random_field_element_magnitude(&aj.y); + random_field_element_magnitude(&aj.z); + random_field_element_magnitude(&bj.x); + random_field_element_magnitude(&bj.y); + random_field_element_magnitude(&bj.z); + random_field_element_magnitude(&nj.x); + random_field_element_magnitude(&nj.y); + random_field_element_magnitude(&nj.z); + + /* gej + gej adds */ + secp256k1_gej_t aaj; secp256k1_gej_add_var(&aaj, &aj, &aj); + secp256k1_gej_t abj; secp256k1_gej_add_var(&abj, &aj, &bj); + secp256k1_gej_t aij; secp256k1_gej_add_var(&aij, &aj, &ij); + secp256k1_gej_t anj; secp256k1_gej_add_var(&anj, &aj, &nj); + secp256k1_gej_t iaj; secp256k1_gej_add_var(&iaj, &ij, &aj); + secp256k1_gej_t iij; secp256k1_gej_add_var(&iij, &ij, &ij); + + /* gej + ge adds */ + secp256k1_gej_t aa; secp256k1_gej_add_ge_var(&aa, &aj, &a); + secp256k1_gej_t ab; secp256k1_gej_add_ge_var(&ab, &aj, &b); + secp256k1_gej_t ai; secp256k1_gej_add_ge_var(&ai, &aj, &i); + secp256k1_gej_t an; secp256k1_gej_add_ge_var(&an, &aj, &n); + secp256k1_gej_t ia; secp256k1_gej_add_ge_var(&ia, &ij, &a); + secp256k1_gej_t ii; secp256k1_gej_add_ge_var(&ii, &ij, &i); + + /* const gej + ge adds */ + secp256k1_gej_t aac; secp256k1_gej_add_ge(&aac, &aj, &a); + secp256k1_gej_t abc; secp256k1_gej_add_ge(&abc, &aj, &b); + secp256k1_gej_t anc; secp256k1_gej_add_ge(&anc, &aj, &n); + secp256k1_gej_t iac; secp256k1_gej_add_ge(&iac, &ij, &a); + + CHECK(secp256k1_gej_is_infinity(&an)); + CHECK(secp256k1_gej_is_infinity(&anj)); + CHECK(secp256k1_gej_is_infinity(&anc)); + gej_equals_gej(&aa, &aaj); + gej_equals_gej(&aa, &aac); + gej_equals_gej(&ab, &abj); + gej_equals_gej(&ab, &abc); + gej_equals_gej(&an, &anj); + gej_equals_gej(&an, &anc); + gej_equals_gej(&ia, &iaj); + gej_equals_gej(&ai, &aij); + gej_equals_gej(&ii, &iij); + ge_equals_gej(&a, &ai); + ge_equals_gej(&a, &ai); + ge_equals_gej(&a, &iaj); + ge_equals_gej(&a, &iaj); + ge_equals_gej(&a, &iac); +} + +void run_ge(void) { + for (int i = 0; i < 2000*count; i++) { + test_ge(); + } +} + +/***** ECMULT TESTS *****/ + +void run_ecmult_chain(void) { + /* random starting point A (on the curve) */ + secp256k1_fe_t ax; secp256k1_fe_set_hex(&ax, "8b30bbe9ae2a990696b22f670709dff3727fd8bc04d3362c6c7bf458e2846004", 64); + secp256k1_fe_t ay; secp256k1_fe_set_hex(&ay, "a357ae915c4a65281309edf20504740f0eb3343990216b4f81063cb65f2f7e0f", 64); + secp256k1_gej_t a; secp256k1_gej_set_xy(&a, &ax, &ay); + /* two random initial factors xn and gn */ + secp256k1_num_t xn; + secp256k1_num_set_hex(&xn, "84cc5452f7fde1edb4d38a8ce9b1b84ccef31f146e569be9705d357a42985407", 64); + secp256k1_num_t gn; + secp256k1_num_set_hex(&gn, "a1e58d22553dcd42b23980625d4c57a96e9323d42b3152e5ca2c3990edc7c9de", 64); + /* two small multipliers to be applied to xn and gn in every iteration: */ + secp256k1_num_t xf; + secp256k1_num_set_hex(&xf, "1337", 4); + secp256k1_num_t gf; + secp256k1_num_set_hex(&gf, "7113", 4); + /* accumulators with the resulting coefficients to A and G */ + secp256k1_num_t ae; + secp256k1_num_set_int(&ae, 1); + secp256k1_num_t ge; + secp256k1_num_set_int(&ge, 0); + /* the point being computed */ + secp256k1_gej_t x = a; + const secp256k1_num_t *order = &secp256k1_ge_consts->order; + for (int i=0; i<200*count; i++) { + /* in each iteration, compute X = xn*X + gn*G; */ + secp256k1_ecmult(&x, &x, &xn, &gn); + /* also compute ae and ge: the actual accumulated factors for A and G */ + /* if X was (ae*A+ge*G), xn*X + gn*G results in (xn*ae*A + (xn*ge+gn)*G) */ + secp256k1_num_mod_mul(&ae, &ae, &xn, order); + secp256k1_num_mod_mul(&ge, &ge, &xn, order); + secp256k1_num_add(&ge, &ge, &gn); + secp256k1_num_mod(&ge, order); + /* modify xn and gn */ + secp256k1_num_mod_mul(&xn, &xn, &xf, order); + secp256k1_num_mod_mul(&gn, &gn, &gf, order); + + /* verify */ + if (i == 19999) { + char res[132]; int resl = 132; + secp256k1_gej_get_hex(res, &resl, &x); + CHECK(strcmp(res, "(D6E96687F9B10D092A6F35439D86CEBEA4535D0D409F53586440BD74B933E830,B95CBCA2C77DA786539BE8FD53354D2D3B4F566AE658045407ED6015EE1B2A88)") == 0); + } + } + /* redo the computation, but directly with the resulting ae and ge coefficients: */ + secp256k1_gej_t x2; secp256k1_ecmult(&x2, &a, &ae, &ge); + char res[132]; int resl = 132; + char res2[132]; int resl2 = 132; + secp256k1_gej_get_hex(res, &resl, &x); + secp256k1_gej_get_hex(res2, &resl2, &x2); + CHECK(strcmp(res, res2) == 0); + CHECK(strlen(res) == 131); +} + +void test_point_times_order(const secp256k1_gej_t *point) { + /* multiplying a point by the order results in O */ + const secp256k1_num_t *order = &secp256k1_ge_consts->order; + secp256k1_num_t zero; + secp256k1_num_set_int(&zero, 0); + secp256k1_gej_t res; + secp256k1_ecmult(&res, point, order, order); /* calc res = order * point + order * G; */ + CHECK(secp256k1_gej_is_infinity(&res)); +} + +void run_point_times_order(void) { + secp256k1_fe_t x; secp256k1_fe_set_hex(&x, "02", 2); + for (int i=0; i<500; i++) { + secp256k1_ge_t p; + if (secp256k1_ge_set_xo(&p, &x, 1)) { + CHECK(secp256k1_ge_is_valid(&p)); + secp256k1_gej_t j; + secp256k1_gej_set_ge(&j, &p); + CHECK(secp256k1_gej_is_valid(&j)); + test_point_times_order(&j); + } + secp256k1_fe_sqr(&x, &x); + } + char c[65]; int cl=65; + secp256k1_fe_get_hex(c, &cl, &x); + CHECK(strcmp(c, "7603CB59B0EF6C63FE6084792A0C378CDB3233A80F8A9A09A877DEAD31B38C45") == 0); +} + +void test_wnaf(const secp256k1_num_t *number, int w) { + secp256k1_num_t x, two, t; + secp256k1_num_set_int(&x, 0); + secp256k1_num_set_int(&two, 2); + int wnaf[257]; + int bits = secp256k1_ecmult_wnaf(wnaf, number, w); + int zeroes = -1; + for (int i=bits-1; i>=0; i--) { + secp256k1_num_mul(&x, &x, &two); + int v = wnaf[i]; + if (v) { + CHECK(zeroes == -1 || zeroes >= w-1); /* check that distance between non-zero elements is at least w-1 */ + zeroes=0; + CHECK((v & 1) == 1); /* check non-zero elements are odd */ + CHECK(v <= (1 << (w-1)) - 1); /* check range below */ + CHECK(v >= -(1 << (w-1)) - 1); /* check range above */ + } else { + CHECK(zeroes != -1); /* check that no unnecessary zero padding exists */ + zeroes++; + } + secp256k1_num_set_int(&t, v); + secp256k1_num_add(&x, &x, &t); + } + CHECK(secp256k1_num_eq(&x, number)); /* check that wnaf represents number */ +} + +void run_wnaf(void) { + secp256k1_num_t n; + for (int i=0; i 1) { + count = strtol(argv[1], NULL, 0); + } + + /* find random seed */ + uint64_t seed; + if (argc > 2) { + seed = strtoull(argv[2], NULL, 0); + } else { + FILE *frand = fopen("/dev/urandom", "r"); + if (!frand || !fread(&seed, sizeof(seed), 1, frand)) { + seed = time(NULL) * 1337; + } + fclose(frand); + } + secp256k1_rand_seed(seed); + + printf("test count = %i\n", count); + printf("random seed = %llu\n", (unsigned long long)seed); + + /* initialize */ + secp256k1_start(SECP256K1_START_SIGN | SECP256K1_START_VERIFY); + + /* num tests */ + run_num_smalltests(); + + /* scalar tests */ + run_scalar_tests(); + + /* field tests */ + run_field_inv(); + run_field_inv_var(); + run_field_inv_all(); + run_field_inv_all_var(); + run_sqr(); + run_sqrt(); + + /* group tests */ + run_ge(); + + /* ecmult tests */ + run_wnaf(); + run_point_times_order(); + run_ecmult_chain(); + + /* ecdsa tests */ + run_ecdsa_sign_verify(); + run_ecdsa_end_to_end(); + run_ecdsa_infinity(); +#ifdef ENABLE_OPENSSL_TESTS + run_ecdsa_openssl(); +#endif + + printf("random run = %llu\n", (unsigned long long)secp256k1_rand32() + ((unsigned long long)secp256k1_rand32() << 32)); + + /* shutdown */ + secp256k1_stop(); + return 0; +} diff --git a/src/util.h b/src/util.h new file mode 100644 index 0000000000..96b47057c0 --- /dev/null +++ b/src/util.h @@ -0,0 +1,64 @@ +/********************************************************************** + * Copyright (c) 2013, 2014 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _SECP256K1_UTIL_H_ +#define _SECP256K1_UTIL_H_ + +#if defined HAVE_CONFIG_H +#include "libsecp256k1-config.h" +#endif + +#include +#include +#include + +#ifdef DETERMINISTIC +#define TEST_FAILURE(msg) do { \ + fprintf(stderr, "%s\n", msg); \ + abort(); \ +} while(0); +#else +#define TEST_FAILURE(msg) do { \ + fprintf(stderr, "%s:%d: %s\n", __FILE__, __LINE__, msg); \ + abort(); \ +} while(0) +#endif + +#ifndef HAVE_BUILTIN_EXPECT +#define EXPECT(x,c) __builtin_expect((x),(c)) +#else +#define EXPECT(x,c) (x) +#endif + +#ifdef DETERMINISTIC +#define CHECK(cond) do { \ + if (EXPECT(!(cond), 0)) { \ + TEST_FAILURE("test condition failed"); \ + } \ +} while(0) +#else +#define CHECK(cond) do { \ + if (EXPECT(!(cond), 0)) { \ + TEST_FAILURE("test condition failed: " #cond); \ + } \ +} while(0) +#endif + +/* Like assert(), but safe to use on expressions with side effects. */ +#ifndef NDEBUG +#define DEBUG_CHECK CHECK +#else +#define DEBUG_CHECK(cond) do { (void)(cond); } while(0) +#endif + +/* Like DEBUG_CHECK(), but when VERIFY is defined instead of NDEBUG not defined. */ +#ifdef VERIFY +#define VERIFY_CHECK CHECK +#else +#define VERIFY_CHECK(cond) do { (void)(cond); } while(0) +#endif + +#endif From 07a99017033b23f840f602d768efa87e0e914e90 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 5 Nov 2014 07:58:37 -0800 Subject: [PATCH 1032/1288] Always build and link libsecp256k1 --- configure.ac | 11 ++++++++++- src/Makefile.am | 30 +++++++++--------------------- src/Makefile.qt.include | 5 +---- src/Makefile.qttest.include | 5 +---- src/Makefile.test.include | 6 +----- 5 files changed, 22 insertions(+), 35 deletions(-) diff --git a/configure.ac b/configure.ac index 837810401a..89b856e664 100644 --- a/configure.ac +++ b/configure.ac @@ -800,7 +800,6 @@ AC_SUBST(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD) AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE) AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR) - AC_SUBST(RELDFLAGS) AC_SUBST(LIBTOOL_LDFLAGS) AC_SUBST(USE_UPNP) @@ -816,6 +815,16 @@ AC_SUBST(MINIUPNPC_LIBS) AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py]) AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh]) AC_CONFIG_FILES([qa/pull-tester/tests-config.sh],[chmod +x qa/pull-tester/tests-config.sh]) + +dnl boost's m4 checks do something really nasty: they export these vars. As a +dnl result, they leak into secp256k1's configure and crazy things happen. +dnl Until this is fixed upstream and we've synced, we'll just un-export them. +export -n CPPFLAGS +export -n LIBS +export -n LDFLAGS +ac_configure_args="${ac_configure_args} --disable-shared --with-pic" +AC_CONFIG_SUBDIRS([src/secp256k1]) + AC_OUTPUT dnl Taken from https://wiki.debian.org/RpathIssue diff --git a/src/Makefile.am b/src/Makefile.am index 3da833d733..517bded369 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,9 +1,5 @@ AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) -if USE_LIBSECP256K1 -secp256k1/libsecp256k1.la: $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*) - @$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) -endif if EMBEDDED_LEVELDB LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include @@ -23,9 +19,7 @@ endif BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS) -if USE_LIBSECP256K1 BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include -endif LIBBITCOIN_SERVER=libbitcoin_server.a LIBBITCOIN_WALLET=libbitcoin_wallet.a @@ -35,6 +29,10 @@ LIBBITCOIN_UTIL=libbitcoin_util.a LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a LIBBITCOIN_UNIVALUE=univalue/libbitcoin_univalue.a LIBBITCOINQT=qt/libbitcoinqt.a +LIBSECP256K1=secp256k1/libsecp256k1.la + +$(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*) + @$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) # Make is not made aware of per-object dependencies to avoid limiting building parallelization # But to build the less dependent modules first, we manually select their order here: @@ -281,11 +279,8 @@ bitcoind_LDADD = \ $(LIBBITCOIN_UTIL) \ $(LIBBITCOIN_CRYPTO) \ $(LIBLEVELDB) \ - $(LIBMEMENV) - -if USE_LIBSECP256K1 - bitcoind_LDADD += secp256k1/libsecp256k1.la -endif + $(LIBMEMENV) \ + $(LIBSECP256K1) if ENABLE_WALLET bitcoind_LDADD += libbitcoin_wallet.a @@ -312,9 +307,6 @@ bitcoin_cli_LDADD = \ bitcoin_cli_SOURCES = \ bitcoin-cli.cpp -if USE_LIBSECP256K1 - bitcoin_cli_LDADD += secp256k1/libsecp256k1.la -endif bitcoin_cli_CPPFLAGS = $(BITCOIN_INCLUDES) # @@ -323,13 +315,9 @@ bitcoin_tx_LDADD = \ $(LIBBITCOIN_UNIVALUE) \ $(LIBBITCOIN_COMMON) \ $(LIBBITCOIN_UTIL) \ - $(LIBBITCOIN_CRYPTO) - -if USE_LIBSECP256K1 - bitcoin_tx_LDADD += secp256k1/libsecp256k1.la -endif - - bitcoin_tx_LDADD += $(BOOST_LIBS) \ + $(LIBBITCOIN_CRYPTO) \ + $(LIBSECP256K1) \ + $(BOOST_LIBS) \ $(CRYPTO_LIBS) bitcoin_tx_SOURCES = bitcoin-tx.cpp diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index ac6d60df03..fac214bdca 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -360,10 +360,7 @@ if ENABLE_WALLET qt_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) endif qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ - $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) -if USE_LIBSECP256K1 - qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la -endif + $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) qt_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) qt_bitcoin_qt_LIBTOOLFLAGS = --tag CXX diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 064b531b93..622411ca68 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -32,10 +32,7 @@ qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) endif qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) \ $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ - $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) -if USE_LIBSECP256K1 - qt_test_test_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la -endif + $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) qt_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) CLEAN_BITCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 6a8d9e58a4..da5c746cc2 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -80,15 +80,11 @@ endif test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES) test_test_bitcoin_CPPFLAGS = $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ - $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) + $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) if ENABLE_WALLET test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) endif -if USE_LIBSECP256K1 - test_test_bitcoin_LDADD += secp256k1/libsecp256k1.la -endif - test_test_bitcoin_LDADD += $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) From 4c97c64bf68a8e57c84fc00a97d16723cf828a0a Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 5 Nov 2014 09:43:44 -0800 Subject: [PATCH 1033/1288] Do not use EC code in global constructors --- src/test/script_tests.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index ede13b23c2..d98154571b 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -175,7 +175,6 @@ struct KeyData } }; -const KeyData keys; class TestBuilder { @@ -317,6 +316,8 @@ public: BOOST_AUTO_TEST_CASE(script_build) { + const KeyData keys; + std::vector good; std::vector bad; From dffb8f81b83e1a10100365c696d6a04fc6344728 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 5 Nov 2014 09:47:06 -0800 Subject: [PATCH 1034/1288] Use libsecp256k1 in key.cpp --- src/key.cpp | 71 +++++------------------------------------------------ 1 file changed, 6 insertions(+), 65 deletions(-) diff --git a/src/key.cpp b/src/key.cpp index 0ca9a681a3..76256b864c 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -9,21 +9,16 @@ #include "pubkey.h" #include "random.h" -#ifdef USE_SECP256K1 #include -#else #include "ecwrapper.h" -#endif //! anonymous namespace namespace { -#ifdef USE_SECP256K1 -#include class CSecp256k1Init { public: CSecp256k1Init() { - secp256k1_start(); + secp256k1_start(SECP256K1_START_SIGN); } ~CSecp256k1Init() { secp256k1_stop(); @@ -31,7 +26,6 @@ public: }; static CSecp256k1Init instance_of_csecp256k1; -#endif } // anon namespace bool CKey::Check(const unsigned char *vch) { @@ -47,15 +41,8 @@ void CKey::MakeNewKey(bool fCompressedIn) { } bool CKey::SetPrivKey(const CPrivKey &privkey, bool fCompressedIn) { -#ifdef USE_SECP256K1 - if (!secp256k1_ecdsa_privkey_import((unsigned char*)begin(), &privkey[0], privkey.size())) + if (!secp256k1_ec_privkey_import((unsigned char*)begin(), &privkey[0], privkey.size())) return false; -#else - CECKey key; - if (!key.SetPrivKey(&privkey[0], privkey.size())) - return false; - key.GetSecretBytes(vch); -#endif fCompressed = fCompressedIn; fValid = true; return true; @@ -65,39 +52,21 @@ CPrivKey CKey::GetPrivKey() const { assert(fValid); CPrivKey privkey; int privkeylen, ret; -#ifdef USE_SECP256K1 privkey.resize(279); privkeylen = 279; - ret = secp256k1_ecdsa_privkey_export(begin(), (unsigned char*)&privkey[0], &privkeylen, fCompressed); + ret = secp256k1_ec_privkey_export(begin(), (unsigned char*)&privkey[0], &privkeylen, fCompressed); assert(ret); privkey.resize(privkeylen); -#else - CECKey key; - key.SetSecretBytes(vch); - privkeylen = key.GetPrivKeySize(fCompressed); - assert(privkeylen); - privkey.resize(privkeylen); - ret = key.GetPrivKey(&privkey[0], fCompressed); - assert(ret == (int)privkey.size()); -#endif return privkey; } CPubKey CKey::GetPubKey() const { assert(fValid); CPubKey result; -#ifdef USE_SECP256K1 int clen = 65; - int ret = secp256k1_ecdsa_pubkey_create((unsigned char*)result.begin(), &clen, begin(), fCompressed); + int ret = secp256k1_ec_pubkey_create((unsigned char*)result.begin(), &clen, begin(), fCompressed); assert((int)result.size() == clen); assert(ret); -#else - std::vector pubkey; - CECKey key; - key.SetSecretBytes(vch); - key.GetPubKey(pubkey, fCompressed); - result.Set(pubkey.begin(), pubkey.end()); -#endif assert(result.IsValid()); return result; } @@ -105,7 +74,6 @@ CPubKey CKey::GetPubKey() const { bool CKey::Sign(const uint256 &hash, std::vector& vchSig) const { if (!fValid) return false; -#ifdef USE_SECP256K1 vchSig.resize(72); int nSigLen = 72; CKey nonce; @@ -116,11 +84,6 @@ bool CKey::Sign(const uint256 &hash, std::vector& vchSig) const { } while(true); vchSig.resize(nSigLen); return true; -#else - CECKey key; - key.SetSecretBytes(vch); - return key.Sign(hash, vchSig); -#endif } bool CKey::SignCompact(const uint256 &hash, std::vector& vchSig) const { @@ -128,34 +91,20 @@ bool CKey::SignCompact(const uint256 &hash, std::vector& vchSig) return false; vchSig.resize(65); int rec = -1; -#ifdef USE_SECP256K1 CKey nonce; do { nonce.MakeNewKey(true); if (secp256k1_ecdsa_sign_compact((const unsigned char*)&hash, 32, &vchSig[1], begin(), nonce.begin(), &rec)) break; } while(true); -#else - CECKey key; - key.SetSecretBytes(vch); - if (!key.SignCompact(hash, &vchSig[1], rec)) - return false; -#endif assert(rec != -1); vchSig[0] = 27 + rec + (fCompressed ? 4 : 0); return true; } bool CKey::Load(CPrivKey &privkey, CPubKey &vchPubKey, bool fSkipCheck=false) { -#ifdef USE_SECP256K1 - if (!secp256k1_ecdsa_privkey_import((unsigned char*)begin(), &privkey[0], privkey.size())) + if (!secp256k1_ec_privkey_import((unsigned char*)begin(), &privkey[0], privkey.size())) return false; -#else - CECKey key; - if (!key.SetPrivKey(&privkey[0], privkey.size(), fSkipCheck)) - return false; - key.GetSecretBytes(vch); -#endif fCompressed = vchPubKey.IsCompressed(); fValid = true; @@ -182,12 +131,8 @@ bool CKey::Derive(CKey& keyChild, unsigned char ccChild[32], unsigned int nChild BIP32Hash(cc, nChild, 0, begin(), out); } memcpy(ccChild, out+32, 32); -#ifdef USE_SECP256K1 memcpy((unsigned char*)keyChild.begin(), begin(), 32); - bool ret = secp256k1_ecdsa_privkey_tweak_add((unsigned char*)keyChild.begin(), out); -#else - bool ret = CECKey::TweakSecret((unsigned char*)keyChild.begin(), begin(), out); -#endif + bool ret = secp256k1_ec_privkey_tweak_add((unsigned char*)keyChild.begin(), out); UnlockObject(out); keyChild.fCompressed = true; keyChild.fValid = ret; @@ -245,9 +190,5 @@ void CExtKey::Decode(const unsigned char code[74]) { } bool ECC_InitSanityCheck() { -#ifdef USE_SECP256K1 - return true; -#else return CECKey::SanityCheck(); -#endif } From cf61b5441bd6d7232a50f66f28c1b5c6bbdb1570 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 5 Nov 2014 11:48:11 -0800 Subject: [PATCH 1035/1288] Don't use bashisms in configure --- configure.ac | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 89b856e664..6fdcc22b47 100644 --- a/configure.ac +++ b/configure.ac @@ -819,9 +819,8 @@ AC_CONFIG_FILES([qa/pull-tester/tests-config.sh],[chmod +x qa/pull-tester/tests- dnl boost's m4 checks do something really nasty: they export these vars. As a dnl result, they leak into secp256k1's configure and crazy things happen. dnl Until this is fixed upstream and we've synced, we'll just un-export them. -export -n CPPFLAGS -export -n LIBS -export -n LDFLAGS +unset CPPFLAGS +unset LDFLAGS ac_configure_args="${ac_configure_args} --disable-shared --with-pic" AC_CONFIG_SUBDIRS([src/secp256k1]) From ff1e5ba8c75254ccfb08f408c607e98859d88a74 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 5 Nov 2014 19:59:29 -0500 Subject: [PATCH 1036/1288] depends: add gmp package --- depends/packages/gmp.mk | 30 +++++++++++++++++++ depends/packages/packages.mk | 2 +- depends/patches/gmp/arm_gmp_build_fix.patch | 21 +++++++++++++ .../patches/gmp/darwin_gmp_build_fix.patch | 29 ++++++++++++++++++ 4 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 depends/packages/gmp.mk create mode 100644 depends/patches/gmp/arm_gmp_build_fix.patch create mode 100644 depends/patches/gmp/darwin_gmp_build_fix.patch diff --git a/depends/packages/gmp.mk b/depends/packages/gmp.mk new file mode 100644 index 0000000000..bcbf50ceae --- /dev/null +++ b/depends/packages/gmp.mk @@ -0,0 +1,30 @@ +package=gmp +$(package)_version=6.0.0a +$(package)_download_path=https://gmplib.org/download/gmp +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=7f8e9a804b9c6d07164cf754207be838ece1219425d64e28cfa3e70d5c759aaf +$(package)_patches=arm_gmp_build_fix.patch darwin_gmp_build_fix.patch + +define $(package)_preprocess_cmds + patch -p1 < $($(package)_patch_dir)/arm_gmp_build_fix.patch && \ + patch -p1 < $($(package)_patch_dir)/darwin_gmp_build_fix.patch +endef + +define $(package)_set_vars + $(package)_config_opts=--disable-shared CC_FOR_BUILD=$(build_CC) + $(package)_config_opts_x86_64_darwin=--with-pic + $(package)_config_opts_x86_64_linux=--with-pic + $(package)_config_opts_arm_linux=--with-pic +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 260cadb214..0e1fbeffaa 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -1,4 +1,4 @@ -packages:=boost openssl +packages:=boost openssl gmp native_packages := native_ccache native_comparisontool qt_native_packages = native_protobuf diff --git a/depends/patches/gmp/arm_gmp_build_fix.patch b/depends/patches/gmp/arm_gmp_build_fix.patch new file mode 100644 index 0000000000..666cf58cf6 --- /dev/null +++ b/depends/patches/gmp/arm_gmp_build_fix.patch @@ -0,0 +1,21 @@ + +# HG changeset patch +# User Torbjorn Granlund +# Date 1396602422 -7200 +# Node ID 676e2d0f0e4dd301a7066079d2c9326c25c34a40 +# Parent 0194a75b56b21a9196626430af86c5bd9110c42d +Conditionalise ARM asm on !__thumb__. + +diff -r 0194a75b56b2 -r 676e2d0f0e4d mpn/generic/div_qr_1n_pi1.c +--- a/mpn/generic/div_qr_1n_pi1.c Thu Apr 03 23:58:51 2014 +0200 ++++ b/mpn/generic/div_qr_1n_pi1.c Fri Apr 04 11:07:02 2014 +0200 +@@ -130,7 +130,7 @@ + "%2" ((UDItype)(a0)), "r" ((UDItype)(b0)) __CLOBBER_CC) + #endif + +-#if defined (__arm__) && W_TYPE_SIZE == 32 ++#if defined (__arm__) && !defined (__thumb__) && W_TYPE_SIZE == 32 + #define add_mssaaaa(m, sh, sl, ah, al, bh, bl) \ + __asm__ ( "adds %2, %5, %6\n\t" \ + "adcs %1, %3, %4\n\t" \ + diff --git a/depends/patches/gmp/darwin_gmp_build_fix.patch b/depends/patches/gmp/darwin_gmp_build_fix.patch new file mode 100644 index 0000000000..b9cfd80e77 --- /dev/null +++ b/depends/patches/gmp/darwin_gmp_build_fix.patch @@ -0,0 +1,29 @@ + +# HG changeset patch +# User Torbjorn Granlund +# Date 1396470504 -7200 +# Node ID 1fab0adc5ff7d9ecddcbda96f407da58347bb49c +# Parent db645603dcdb41afcf78b19b551ecd5a01c3841c +Workaround for Darwin assembler quirk. + +diff -r db645603dcdb -r 1fab0adc5ff7 mpn/x86_64/k8/redc_1.asm +--- a/mpn/x86_64/k8/redc_1.asm Mon Mar 31 23:04:32 2014 +0200 ++++ b/mpn/x86_64/k8/redc_1.asm Wed Apr 02 22:28:24 2014 +0200 +@@ -114,7 +114,7 @@ + + JUMPTABSECT + ALIGN(8) +-L(tab): JMPENT( L(0m4), L(tab)) ++L(tab): JMPENT( L(0), L(tab)) + JMPENT( L(1), L(tab)) + JMPENT( L(2), L(tab)) + JMPENT( L(3), L(tab)) +@@ -397,6 +397,7 @@ + + + ALIGN(16) ++L(0): + L(0m4): + L(lo0): mov (mp,nneg,8), %rax + mov nneg, i + From 54566de29d988a201a6fe2ae6b2b8d54e13bd780 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 5 Nov 2014 20:00:34 -0500 Subject: [PATCH 1037/1288] depends: quit exporting in config.site --- depends/config.site.in | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/depends/config.site.in b/depends/config.site.in index df076956bd..873f66018d 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -48,32 +48,37 @@ if test x@host_os@ = xmingw32; then fi fi -export PATH=$prefix/native/bin:$PATH -export PKG_CONFIG="`which pkg-config` --static" +PATH=$prefix/native/bin:$PATH +PKG_CONFIG="`which pkg-config` --static" + +# These two need to remain exported because pkg-config does not see them +# otherwise. That means they must be unexported at the end of configure.ac to +# avoid ruining the cache. Sigh. + export PKG_CONFIG_LIBDIR=$prefix/lib/pkgconfig export PKG_CONFIG_PATH=$prefix/share/pkgconfig -export CPPFLAGS="-I$prefix/include/ $CPPFLAGS" -export LDFLAGS="-L$prefix/lib $LDFLAGS" +CPPFLAGS="-I$prefix/include/ $CPPFLAGS" +LDFLAGS="-L$prefix/lib $LDFLAGS" -export CC="@CC@" -export CXX="@CXX@" -export OBJC="${CC}" -export OBJCXX="${CXX}" -export CCACHE=$prefix/native/bin/ccache +CC="@CC@" +CXX="@CXX@" +OBJC="${CC}" +OBJCXX="${CXX}" +CCACHE=$prefix/native/bin/ccache if test -n "@AR@"; then - export AR=@AR@ + AR=@AR@ ac_cv_path_ac_pt_AR=${AR} fi if test -n "@RANLIB@"; then - export RANLIB=@RANLIB@ + RANLIB=@RANLIB@ ac_cv_path_ac_pt_RANLIB=${RANLIB} fi if test -n "@NM@"; then - export NM=@NM@ + NM=@NM@ ac_cv_path_ac_pt_NM=${NM} fi @@ -82,14 +87,14 @@ if test -n "@debug@"; then fi if test -n "@CFLAGS@"; then - export CFLAGS="@CFLAGS@ $CFLAGS" + CFLAGS="@CFLAGS@ $CFLAGS" fi if test -n "@CXXFLAGS@"; then - export CXXFLAGS="@CXXFLAGS@ $CXXFLAGS" + CXXFLAGS="@CXXFLAGS@ $CXXFLAGS" fi if test -n "@CPPFLAGS@"; then - export CPPFLAGS="@CPPFLAGS@ $CPPFLAGS" + CPPFLAGS="@CPPFLAGS@ $CPPFLAGS" fi if test -n "@LDFLAGS@"; then - export LDFLAGS="@LDFLAGS@ $LDFLAGS" + LDFLAGS="@LDFLAGS@ $LDFLAGS" fi From 0dc8613864052172447d32338f4492669918cefa Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 5 Nov 2014 20:01:42 -0500 Subject: [PATCH 1038/1288] build: fixup configure to not export anything --- configure.ac | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 6fdcc22b47..4904dd72ca 100644 --- a/configure.ac +++ b/configure.ac @@ -255,7 +255,6 @@ case $host in qt5_prefix=`$BREW --prefix qt5 2>/dev/null` if test x$openssl_prefix != x; then PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" - export PKG_CONFIG_PATH fi if test x$bdb_prefix != x; then CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include" @@ -263,7 +262,6 @@ case $host in fi if test x$qt5_prefix != x; then PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" - export PKG_CONFIG_PATH fi fi else @@ -819,8 +817,26 @@ AC_CONFIG_FILES([qa/pull-tester/tests-config.sh],[chmod +x qa/pull-tester/tests- dnl boost's m4 checks do something really nasty: they export these vars. As a dnl result, they leak into secp256k1's configure and crazy things happen. dnl Until this is fixed upstream and we've synced, we'll just un-export them. +CPPFLAGS_TEMP="$CPPFLAGS" unset CPPFLAGS +CPPFLAGS="$CPPFLAGS_TEMP" + +LDFLAGS_TEMP="$LDFLAGS" unset LDFLAGS +LDFLAGS="$LDFLAGS_TEMP" + +LIBS_TEMP="$LIBS" +unset LIBS +LIBS="$LIBS_TEMP" + +PKGCONFIG_PATH_TEMP="$PKG_CONFIG_PATH" +unset PKG_CONFIG_PATH +PKG_CONFIG_PATH="$PKGCONFIG_PATH_TEMP" + +PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR" +unset PKG_CONFIG_LIBDIR +PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP" + ac_configure_args="${ac_configure_args} --disable-shared --with-pic" AC_CONFIG_SUBDIRS([src/secp256k1]) From 4300876c81c03f90a6f1dfca675e74bc0bcf46a5 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 5 Nov 2014 20:56:45 -0500 Subject: [PATCH 1039/1288] build: secp256k1 as a subdir, since it's required --- src/Makefile.am | 7 ++++--- src/Makefile.test.include | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 517bded369..556fd49c0b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,4 @@ +DIST_SUBDIRS = secp256k1 AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) @@ -32,7 +33,7 @@ LIBBITCOINQT=qt/libbitcoinqt.a LIBSECP256K1=secp256k1/libsecp256k1.la $(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*) - @$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) + $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) # Make is not made aware of per-object dependencies to avoid limiting building parallelization # But to build the less dependent modules first, we manually select their order here: @@ -334,11 +335,11 @@ CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno DISTCLEANFILES = obj/build.h -EXTRA_DIST = leveldb secp256k1 +EXTRA_DIST = leveldb clean-local: -$(MAKE) -C leveldb clean - -$(MAKE) -C secp256k1 clean 2>/dev/null + -$(MAKE) -C secp256k1 clean rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno -rm -f config.h diff --git a/src/Makefile.test.include b/src/Makefile.test.include index da5c746cc2..79509c9a3e 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -104,6 +104,9 @@ bitcoin_test_check: $(TEST_BINARY) FORCE bitcoin_test_clean : FORCE rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY) +check-local: + $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check + %.json.h: %.json @$(MKDIR_P) $(@D) @echo "namespace json_tests{" > $@ From f9e40fb075aa639094213c47e135b2c363e2dc4c Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 6 Nov 2014 15:40:39 -0500 Subject: [PATCH 1040/1288] revert part of 9eda1620b This probably would've broken native OSX builds --- configure.ac | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.ac b/configure.ac index 4904dd72ca..c0489f5be7 100644 --- a/configure.ac +++ b/configure.ac @@ -255,6 +255,7 @@ case $host in qt5_prefix=`$BREW --prefix qt5 2>/dev/null` if test x$openssl_prefix != x; then PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" + export PKG_CONFIG_PATH fi if test x$bdb_prefix != x; then CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include" @@ -262,6 +263,7 @@ case $host in fi if test x$qt5_prefix != x; then PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" + export PKG_CONFIG_PATH fi fi else From a48f2d6ddd8a438a126bfb7940d993f2da598476 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sun, 19 Oct 2014 23:09:50 +0000 Subject: [PATCH 1041/1288] Abstract context-dependent block checking from acceptance --- src/main.cpp | 124 +++++++++++++++++++++++++++++---------------------- src/main.h | 4 ++ 2 files changed, 75 insertions(+), 53 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 82d52913a0..2781c6f3fb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2334,6 +2334,73 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo return true; } +bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, CBlockIndex * const pindexPrev) +{ + uint256 hash = block.GetHash(); + if (hash == Params().HashGenesisBlock()) + return true; + + assert(pindexPrev); + + int nHeight = pindexPrev->nHeight+1; + + // Check proof of work + if ((!Params().SkipProofOfWorkCheck()) && + (block.nBits != GetNextWorkRequired(pindexPrev, &block))) + return state.DoS(100, error("%s : incorrect proof of work", __func__), + REJECT_INVALID, "bad-diffbits"); + + // Check timestamp against prev + if (block.GetBlockTime() <= pindexPrev->GetMedianTimePast()) + return state.Invalid(error("%s : block's timestamp is too early", __func__), + REJECT_INVALID, "time-too-old"); + + // Check that the block chain matches the known block chain up to a checkpoint + if (!Checkpoints::CheckBlock(nHeight, hash)) + return state.DoS(100, error("%s : rejected by checkpoint lock-in at %d", __func__, nHeight), + REJECT_CHECKPOINT, "checkpoint mismatch"); + + // Don't accept any forks from the main chain prior to last checkpoint + CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(); + if (pcheckpoint && nHeight < pcheckpoint->nHeight) + return state.DoS(100, error("%s : forked chain older than last checkpoint (height %d)", __func__, nHeight)); + + // Reject block.nVersion=1 blocks when 95% (75% on testnet) of the network has upgraded: + if (block.nVersion < 2 && + CBlockIndex::IsSuperMajority(2, pindexPrev, Params().RejectBlockOutdatedMajority())) + { + return state.Invalid(error("%s : rejected nVersion=1 block", __func__), + REJECT_OBSOLETE, "bad-version"); + } + + return true; +} + +bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIndex * const pindexPrev) +{ + const int nHeight = pindexPrev == NULL ? 0 : pindexPrev->nHeight + 1; + + // Check that all transactions are finalized + BOOST_FOREACH(const CTransaction& tx, block.vtx) + if (!IsFinalTx(tx, nHeight, block.GetBlockTime())) { + return state.DoS(10, error("%s : contains a non-final transaction", __func__), REJECT_INVALID, "bad-txns-nonfinal"); + } + + // Enforce block.nVersion=2 rule that the coinbase starts with serialized block height + // if 750 of the last 1,000 blocks are version 2 or greater (51/100 if testnet): + if (block.nVersion >= 2 && + CBlockIndex::IsSuperMajority(2, pindexPrev, Params().EnforceBlockUpgradeMajority())) + { + CScript expect = CScript() << nHeight; + if (block.vtx[0].vin[0].scriptSig.size() < expect.size() || + !std::equal(expect.begin(), expect.end(), block.vtx[0].vin[0].scriptSig.begin())) { + return state.DoS(100, error("%s : block height mismatch in coinbase", __func__), REJECT_INVALID, "bad-cb-height"); + } + } + + return true; +} + bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBlockIndex** ppindex) { AssertLockHeld(cs_main); @@ -2353,44 +2420,16 @@ bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBloc // Get prev block index CBlockIndex* pindexPrev = NULL; - int nHeight = 0; if (hash != Params().HashGenesisBlock()) { BlockMap::iterator mi = mapBlockIndex.find(block.hashPrevBlock); if (mi == mapBlockIndex.end()) return state.DoS(10, error("%s : prev block not found", __func__), 0, "bad-prevblk"); pindexPrev = (*mi).second; - nHeight = pindexPrev->nHeight+1; - - // Check proof of work - if ((!Params().SkipProofOfWorkCheck()) && - (block.nBits != GetNextWorkRequired(pindexPrev, &block))) - return state.DoS(100, error("%s : incorrect proof of work", __func__), - REJECT_INVALID, "bad-diffbits"); - - // Check timestamp against prev - if (block.GetBlockTime() <= pindexPrev->GetMedianTimePast()) - return state.Invalid(error("%s : block's timestamp is too early", __func__), - REJECT_INVALID, "time-too-old"); - - // Check that the block chain matches the known block chain up to a checkpoint - if (!Checkpoints::CheckBlock(nHeight, hash)) - return state.DoS(100, error("%s : rejected by checkpoint lock-in at %d", __func__, nHeight), - REJECT_CHECKPOINT, "checkpoint mismatch"); - - // Don't accept any forks from the main chain prior to last checkpoint - CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(); - if (pcheckpoint && nHeight < pcheckpoint->nHeight) - return state.DoS(100, error("%s : forked chain older than last checkpoint (height %d)", __func__, nHeight)); - - // Reject block.nVersion=1 blocks when 95% (75% on testnet) of the network has upgraded: - if (block.nVersion < 2 && - CBlockIndex::IsSuperMajority(2, pindexPrev, Params().RejectBlockOutdatedMajority())) - { - return state.Invalid(error("%s : rejected nVersion=1 block", __func__), - REJECT_OBSOLETE, "bad-version"); - } } + if (!ContextualCheckBlockHeader(block, state, pindexPrev)) + return false; + if (pindex == NULL) pindex = AddToBlockIndex(block); @@ -2415,7 +2454,7 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex, return true; } - if (!CheckBlock(block, state)) { + if ((!CheckBlock(block, state)) || !ContextualCheckBlock(block, state, pindex->pprev)) { if (state.IsInvalid() && !state.CorruptionPossible()) { pindex->nStatus |= BLOCK_FAILED_VALID; } @@ -2424,27 +2463,6 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex, int nHeight = pindex->nHeight; - // Check that all transactions are finalized - BOOST_FOREACH(const CTransaction& tx, block.vtx) - if (!IsFinalTx(tx, nHeight, block.GetBlockTime())) { - pindex->nStatus |= BLOCK_FAILED_VALID; - return state.DoS(10, error("AcceptBlock() : contains a non-final transaction"), - REJECT_INVALID, "bad-txns-nonfinal"); - } - - // Enforce block.nVersion=2 rule that the coinbase starts with serialized block height - // if 750 of the last 1,000 blocks are version 2 or greater (51/100 if testnet): - if (block.nVersion >= 2 && - CBlockIndex::IsSuperMajority(2, pindex->pprev, Params().EnforceBlockUpgradeMajority())) - { - CScript expect = CScript() << nHeight; - if (block.vtx[0].vin[0].scriptSig.size() < expect.size() || - !std::equal(expect.begin(), expect.end(), block.vtx[0].vin[0].scriptSig.begin())) { - pindex->nStatus |= BLOCK_FAILED_VALID; - return state.DoS(100, error("AcceptBlock() : block height mismatch in coinbase"), REJECT_INVALID, "bad-cb-height"); - } - } - // Write block to history file try { unsigned int nBlockSize = ::GetSerializeSize(block, SER_DISK, CLIENT_VERSION); diff --git a/src/main.h b/src/main.h index 1bb0919817..6e684be8c0 100644 --- a/src/main.h +++ b/src/main.h @@ -463,6 +463,10 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool fCheckPOW = true); bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW = true, bool fCheckMerkleRoot = true); +// Context-dependent validity checks +bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, CBlockIndex *pindexPrev); +bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIndex *pindexPrev); + // Store block on disk // if dbp is provided, the file is known to already reside on disk bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex **pindex, CDiskBlockPos* dbp = NULL); From 4ea1be7fb84a397222754473c2bc315e3665ff18 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 16 Oct 2014 03:50:33 +0000 Subject: [PATCH 1042/1288] CreateNewBlock and miner_tests: Also check generated template is valid by CheckBlockHeader, ContextualCheckBlockHeader, CheckBlock, and ContextualCheckBlock --- src/miner.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/miner.cpp b/src/miner.cpp index b5bfa9c7be..d7ecd5e40e 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -326,8 +326,17 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) indexDummy.nHeight = pindexPrev->nHeight + 1; CCoinsViewCache viewNew(pcoinsTip); CValidationState state; + // NOTE: CheckBlockHeader is called by CheckBlock + if (!ContextualCheckBlockHeader(*pblock, state, pindexPrev)) + throw std::runtime_error("CreateNewBlock() : ContextualCheckBlockHeader failed"); + if (!CheckBlock(*pblock, state, false, false)) + throw std::runtime_error("CreateNewBlock() : CheckBlock failed"); + if (!ContextualCheckBlock(*pblock, state, pindexPrev)) + throw std::runtime_error("CreateNewBlock() : ContextualCheckBlock failed"); if (!ConnectBlock(*pblock, state, &indexDummy, viewNew, true)) throw std::runtime_error("CreateNewBlock() : ConnectBlock failed"); + if (!state.IsValid()) + throw std::runtime_error("CreateNewBlock() : State is not valid"); } return pblocktemplate.release(); From df08a626e0440457ae0d1966439fd956c27ae2fe Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Mon, 20 Oct 2014 02:10:03 +0000 Subject: [PATCH 1043/1288] TestBlockValidity function for CBlock proposals (used by CreateNewBlock) --- src/main.cpp | 26 +++++++++++++++++++++++++- src/main.h | 5 ++++- src/miner.cpp | 17 ++--------------- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 2781c6f3fb..fda71a365d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1593,7 +1593,7 @@ static int64_t nTimeIndex = 0; static int64_t nTimeCallbacks = 0; static int64_t nTimeTotal = 0; -bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& view, bool fJustCheck) +bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& view, bool fJustCheck) { AssertLockHeld(cs_main); // Check it again in case a previous version let a bad block in @@ -2573,6 +2573,30 @@ bool ProcessNewBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDis return true; } +bool TestBlockValidity(CValidationState &state, const CBlock& block, CBlockIndex * const pindexPrev, bool fCheckPOW, bool fCheckMerkleRoot) +{ + AssertLockHeld(cs_main); + assert(pindexPrev == chainActive.Tip()); + + CCoinsViewCache viewNew(pcoinsTip); + CBlockIndex indexDummy(block); + indexDummy.pprev = pindexPrev; + indexDummy.nHeight = pindexPrev->nHeight + 1; + + // NOTE: CheckBlockHeader is called by CheckBlock + if (!ContextualCheckBlockHeader(block, state, pindexPrev)) + return false; + if (!CheckBlock(block, state, fCheckPOW, fCheckMerkleRoot)) + return false; + if (!ContextualCheckBlock(block, state, pindexPrev)) + return false; + if (!ConnectBlock(block, state, &indexDummy, viewNew, true)) + return false; + assert(state.IsValid()); + + return true; +} + diff --git a/src/main.h b/src/main.h index 6e684be8c0..b49f0a06eb 100644 --- a/src/main.h +++ b/src/main.h @@ -457,7 +457,7 @@ bool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex); bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& coins, bool* pfClean = NULL); // Apply the effects of this block (with given index) on the UTXO set represented by coins -bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& coins, bool fJustCheck = false); +bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& coins, bool fJustCheck = false); // Context-independent validity checks bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool fCheckPOW = true); @@ -467,6 +467,9 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW = t bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, CBlockIndex *pindexPrev); bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIndex *pindexPrev); +// Check a block is completely valid from start to finish (only works on top of our current best block, with cs_main held) +bool TestBlockValidity(CValidationState &state, const CBlock& block, CBlockIndex *pindexPrev, bool fCheckPOW = true, bool fCheckMerkleRoot = true); + // Store block on disk // if dbp is provided, the file is known to already reside on disk bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex **pindex, CDiskBlockPos* dbp = NULL); diff --git a/src/miner.cpp b/src/miner.cpp index d7ecd5e40e..200498d109 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -321,22 +321,9 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) pblock->nNonce = 0; pblocktemplate->vTxSigOps[0] = GetLegacySigOpCount(pblock->vtx[0]); - CBlockIndex indexDummy(*pblock); - indexDummy.pprev = pindexPrev; - indexDummy.nHeight = pindexPrev->nHeight + 1; - CCoinsViewCache viewNew(pcoinsTip); CValidationState state; - // NOTE: CheckBlockHeader is called by CheckBlock - if (!ContextualCheckBlockHeader(*pblock, state, pindexPrev)) - throw std::runtime_error("CreateNewBlock() : ContextualCheckBlockHeader failed"); - if (!CheckBlock(*pblock, state, false, false)) - throw std::runtime_error("CreateNewBlock() : CheckBlock failed"); - if (!ContextualCheckBlock(*pblock, state, pindexPrev)) - throw std::runtime_error("CreateNewBlock() : ContextualCheckBlock failed"); - if (!ConnectBlock(*pblock, state, &indexDummy, viewNew, true)) - throw std::runtime_error("CreateNewBlock() : ConnectBlock failed"); - if (!state.IsValid()) - throw std::runtime_error("CreateNewBlock() : State is not valid"); + if (!TestBlockValidity(state, *pblock, pindexPrev, false, false)) + throw std::runtime_error("CreateNewBlock() : TestBlockValidity failed"); } return pblocktemplate.release(); From 132ea9b48f65dcb4784a7e9688f3b194d5578c80 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 30 Oct 2014 04:26:31 +0000 Subject: [PATCH 1044/1288] miner_tests: Disable checkpoints so they don't fail the subsidy-change test --- src/test/miner_tests.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index 032ae983ce..1caee13c33 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -56,6 +56,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) uint256 hash; LOCK(cs_main); + Checkpoints::fEnabled = false; // Simple block creation, nothing special yet: BOOST_CHECK(pblocktemplate = CreateNewBlock(scriptPubKey)); @@ -258,6 +259,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) BOOST_FOREACH(CTransaction *tx, txFirst) delete tx; + Checkpoints::fEnabled = true; } BOOST_AUTO_TEST_SUITE_END() From 3dcbb9b6b488f077d4ab7e4296dffbf3aea4a0fb Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 30 Oct 2014 02:56:33 +0000 Subject: [PATCH 1045/1288] Abstract DecodeHexBlk and BIP22ValidationResult functions out of submitblock --- src/core_io.h | 2 ++ src/core_read.cpp | 18 ++++++++++++++++++ src/rpcmining.cpp | 42 +++++++++++++++++++++--------------------- 3 files changed, 41 insertions(+), 21 deletions(-) diff --git a/src/core_io.h b/src/core_io.h index 94848f1c3d..8777aa3b85 100644 --- a/src/core_io.h +++ b/src/core_io.h @@ -8,6 +8,7 @@ #include #include +class CBlock; class CScript; class CTransaction; class uint256; @@ -16,6 +17,7 @@ class UniValue; // core_read.cpp extern CScript ParseScript(std::string s); extern bool DecodeHexTx(CTransaction& tx, const std::string& strHexTx); +extern bool DecodeHexBlk(CBlock&, const std::string& strHexBlk); extern uint256 ParseHashUV(const UniValue& v, const std::string& strName); extern std::vector ParseHexUV(const UniValue& v, const std::string& strName); diff --git a/src/core_read.cpp b/src/core_read.cpp index d39bc9a780..42e2f8d200 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -4,6 +4,7 @@ #include "core_io.h" +#include "core/block.h" #include "core/transaction.h" #include "script/script.h" #include "serialize.h" @@ -108,6 +109,23 @@ bool DecodeHexTx(CTransaction& tx, const std::string& strHexTx) return true; } +bool DecodeHexBlk(CBlock& block, const std::string& strHexBlk) +{ + if (!IsHex(strHexBlk)) + return false; + + std::vector blockData(ParseHex(strHexBlk)); + CDataStream ssBlock(blockData, SER_NETWORK, PROTOCOL_VERSION); + try { + ssBlock >> block; + } + catch (const std::exception &) { + return false; + } + + return true; +} + uint256 ParseHashUV(const UniValue& v, const string& strName) { string strHex; diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 879a504115..577f377796 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -283,6 +283,25 @@ Value prioritisetransaction(const Array& params, bool fHelp) } +// NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller +static Value BIP22ValidationResult(const CValidationState& state) +{ + if (state.IsValid()) + return Value::null; + + std::string strRejectReason = state.GetRejectReason(); + if (state.IsError()) + throw JSONRPCError(RPC_VERIFY_ERROR, strRejectReason); + if (state.IsInvalid()) + { + if (strRejectReason.empty()) + return "rejected"; + return strRejectReason; + } + // Should be impossible + return "valid?"; +} + Value getblocktemplate(const Array& params, bool fHelp) { if (fHelp || params.size() > 1) @@ -566,15 +585,9 @@ Value submitblock(const Array& params, bool fHelp) + HelpExampleRpc("submitblock", "\"mydata\"") ); - vector blockData(ParseHex(params[0].get_str())); - CDataStream ssBlock(blockData, SER_NETWORK, PROTOCOL_VERSION); CBlock pblock; - try { - ssBlock >> pblock; - } - catch (const std::exception &) { + if (!DecodeHexBlk(pblock, params[0].get_str())) throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Block decode failed"); - } CValidationState state; submitblock_StateCatcher sc(pblock.GetHash()); @@ -587,20 +600,7 @@ Value submitblock(const Array& params, bool fHelp) return "inconclusive"; state = sc.state; } - if (state.IsError()) - { - std::string strRejectReason = state.GetRejectReason(); - throw JSONRPCError(RPC_VERIFY_ERROR, strRejectReason); - } - if (state.IsInvalid()) - { - std::string strRejectReason = state.GetRejectReason(); - if (strRejectReason.empty()) - return "rejected"; - return strRejectReason; - } - - return Value::null; + return BIP22ValidationResult(state); } Value estimatefee(const Array& params, bool fHelp) From 60d1ecd378d8aeb366da566d9c791399d77ffafc Mon Sep 17 00:00:00 2001 From: HarryWu Date: Wed, 19 Nov 2014 14:01:18 +0800 Subject: [PATCH 1046/1288] change nSubsidy's type from int64_t to CAmount --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 2bff781bfa..512df775d0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1180,7 +1180,7 @@ bool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex) CAmount GetBlockValue(int nHeight, const CAmount& nFees) { - int64_t nSubsidy = 50 * COIN; + CAmount nSubsidy = 50 * COIN; int halvings = nHeight / Params().SubsidyHalvingInterval(); // Force block reward to zero when right shift is undefined. From 230f7a833d52dcaa6eaeab46fe0a56a6487c86d1 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 19 Nov 2014 12:29:41 +0100 Subject: [PATCH 1047/1288] Remove unused ecwrapper code --- src/ecwrapper.cpp | 164 ---------------------------------------------- src/ecwrapper.h | 8 --- 2 files changed, 172 deletions(-) diff --git a/src/ecwrapper.cpp b/src/ecwrapper.cpp index 3377dce0c1..68cdbf2eda 100644 --- a/src/ecwrapper.cpp +++ b/src/ecwrapper.cpp @@ -13,43 +13,6 @@ namespace { -// Generate a private key from just the secret parameter -int EC_KEY_regenerate_key(EC_KEY *eckey, BIGNUM *priv_key) -{ - int ok = 0; - BN_CTX *ctx = NULL; - EC_POINT *pub_key = NULL; - - if (!eckey) return 0; - - const EC_GROUP *group = EC_KEY_get0_group(eckey); - - if ((ctx = BN_CTX_new()) == NULL) - goto err; - - pub_key = EC_POINT_new(group); - - if (pub_key == NULL) - goto err; - - if (!EC_POINT_mul(group, pub_key, priv_key, NULL, NULL, ctx)) - goto err; - - EC_KEY_set_private_key(eckey,priv_key); - EC_KEY_set_public_key(eckey,pub_key); - - ok = 1; - -err: - - if (pub_key) - EC_POINT_free(pub_key); - if (ctx != NULL) - BN_CTX_free(ctx); - - return(ok); -} - // Perform ECDSA key recovery (see SEC1 4.1.6) for curves over (mod p)-fields // recid selects which key is recovered // if check is non-zero, additional checks are performed @@ -135,48 +98,6 @@ CECKey::~CECKey() { EC_KEY_free(pkey); } -void CECKey::GetSecretBytes(unsigned char vch[32]) const { - const BIGNUM *bn = EC_KEY_get0_private_key(pkey); - assert(bn); - int nBytes = BN_num_bytes(bn); - int n=BN_bn2bin(bn,&vch[32 - nBytes]); - assert(n == nBytes); - memset(vch, 0, 32 - nBytes); -} - -void CECKey::SetSecretBytes(const unsigned char vch[32]) { - bool ret; - BIGNUM bn; - BN_init(&bn); - ret = BN_bin2bn(vch, 32, &bn) != NULL; - assert(ret); - ret = EC_KEY_regenerate_key(pkey, &bn) != 0; - assert(ret); - BN_clear_free(&bn); -} - -int CECKey::GetPrivKeySize(bool fCompressed) { - EC_KEY_set_conv_form(pkey, fCompressed ? POINT_CONVERSION_COMPRESSED : POINT_CONVERSION_UNCOMPRESSED); - return i2d_ECPrivateKey(pkey, NULL); -} -int CECKey::GetPrivKey(unsigned char* privkey, bool fCompressed) { - EC_KEY_set_conv_form(pkey, fCompressed ? POINT_CONVERSION_COMPRESSED : POINT_CONVERSION_UNCOMPRESSED); - return i2d_ECPrivateKey(pkey, &privkey); -} - -bool CECKey::SetPrivKey(const unsigned char* privkey, size_t size, bool fSkipCheck) { - if (d2i_ECPrivateKey(&pkey, &privkey, size)) { - if(fSkipCheck) - return true; - - // d2i_ECPrivateKey returns true if parsing succeeds. - // This doesn't necessarily mean the key is valid. - if (EC_KEY_check_key(pkey)) - return true; - } - return false; -} - void CECKey::GetPubKey(std::vector &pubkey, bool fCompressed) { EC_KEY_set_conv_form(pkey, fCompressed ? POINT_CONVERSION_COMPRESSED : POINT_CONVERSION_UNCOMPRESSED); int nSize = i2o_ECPublicKey(pkey, NULL); @@ -193,33 +114,6 @@ bool CECKey::SetPubKey(const unsigned char* pubkey, size_t size) { return o2i_ECPublicKey(&pkey, &pubkey, size) != NULL; } -bool CECKey::Sign(const uint256 &hash, std::vector& vchSig) { - vchSig.clear(); - ECDSA_SIG *sig = ECDSA_do_sign((unsigned char*)&hash, sizeof(hash), pkey); - if (sig == NULL) - return false; - BN_CTX *ctx = BN_CTX_new(); - BN_CTX_start(ctx); - const EC_GROUP *group = EC_KEY_get0_group(pkey); - BIGNUM *order = BN_CTX_get(ctx); - BIGNUM *halforder = BN_CTX_get(ctx); - EC_GROUP_get_order(group, order, ctx); - BN_rshift1(halforder, order); - if (BN_cmp(sig->s, halforder) > 0) { - // enforce low S values, by negating the value (modulo the order) if above order/2. - BN_sub(sig->s, order, sig->s); - } - BN_CTX_end(ctx); - BN_CTX_free(ctx); - unsigned int nSize = ECDSA_size(pkey); - vchSig.resize(nSize); // Make sure it is big enough - unsigned char *pos = &vchSig[0]; - nSize = i2d_ECDSA_SIG(sig, &pos); - ECDSA_SIG_free(sig); - vchSig.resize(nSize); // Shrink to fit actual size - return true; -} - bool CECKey::Verify(const uint256 &hash, const std::vector& vchSig) { // -1 = error, 0 = bad sig, 1 = good if (ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), &vchSig[0], vchSig.size(), pkey) != 1) @@ -227,37 +121,6 @@ bool CECKey::Verify(const uint256 &hash, const std::vector& vchSi return true; } -bool CECKey::SignCompact(const uint256 &hash, unsigned char *p64, int &rec) { - bool fOk = false; - ECDSA_SIG *sig = ECDSA_do_sign((unsigned char*)&hash, sizeof(hash), pkey); - if (sig==NULL) - return false; - memset(p64, 0, 64); - int nBitsR = BN_num_bits(sig->r); - int nBitsS = BN_num_bits(sig->s); - if (nBitsR <= 256 && nBitsS <= 256) { - std::vector pubkey; - GetPubKey(pubkey, true); - for (int i=0; i<4; i++) { - CECKey keyRec; - if (ECDSA_SIG_recover_key_GFp(keyRec.pkey, sig, (unsigned char*)&hash, sizeof(hash), i, 1) == 1) { - std::vector pubkeyRec; - keyRec.GetPubKey(pubkeyRec, true); - if (pubkeyRec == pubkey) { - rec = i; - fOk = true; - break; - } - } - } - assert(fOk); - BN_bn2bin(sig->r,&p64[32-(nBitsR+7)/8]); - BN_bn2bin(sig->s,&p64[64-(nBitsS+7)/8]); - } - ECDSA_SIG_free(sig); - return fOk; -} - bool CECKey::Recover(const uint256 &hash, const unsigned char *p64, int rec) { if (rec<0 || rec>=3) @@ -270,33 +133,6 @@ bool CECKey::Recover(const uint256 &hash, const unsigned char *p64, int rec) return ret; } -bool CECKey::TweakSecret(unsigned char vchSecretOut[32], const unsigned char vchSecretIn[32], const unsigned char vchTweak[32]) -{ - bool ret = true; - BN_CTX *ctx = BN_CTX_new(); - BN_CTX_start(ctx); - BIGNUM *bnSecret = BN_CTX_get(ctx); - BIGNUM *bnTweak = BN_CTX_get(ctx); - BIGNUM *bnOrder = BN_CTX_get(ctx); - EC_GROUP *group = EC_GROUP_new_by_curve_name(NID_secp256k1); - EC_GROUP_get_order(group, bnOrder, ctx); // what a grossly inefficient way to get the (constant) group order... - BN_bin2bn(vchTweak, 32, bnTweak); - if (BN_cmp(bnTweak, bnOrder) >= 0) - ret = false; // extremely unlikely - BN_bin2bn(vchSecretIn, 32, bnSecret); - BN_add(bnSecret, bnSecret, bnTweak); - BN_nnmod(bnSecret, bnSecret, bnOrder, ctx); - if (BN_is_zero(bnSecret)) - ret = false; // ridiculously unlikely - int nBits = BN_num_bits(bnSecret); - memset(vchSecretOut, 0, 32); - BN_bn2bin(bnSecret, &vchSecretOut[32-(nBits+7)/8]); - EC_GROUP_free(group); - BN_CTX_end(ctx); - BN_CTX_free(ctx); - return ret; -} - bool CECKey::TweakPublic(const unsigned char vchTweak[32]) { bool ret = true; BN_CTX *ctx = BN_CTX_new(); diff --git a/src/ecwrapper.h b/src/ecwrapper.h index a7847d190c..30c3db7931 100644 --- a/src/ecwrapper.h +++ b/src/ecwrapper.h @@ -21,16 +21,9 @@ public: CECKey(); ~CECKey(); - void GetSecretBytes(unsigned char vch[32]) const; - void SetSecretBytes(const unsigned char vch[32]); - int GetPrivKeySize(bool fCompressed); - int GetPrivKey(unsigned char* privkey, bool fCompressed); - bool SetPrivKey(const unsigned char* privkey, size_t size, bool fSkipCheck=false); void GetPubKey(std::vector& pubkey, bool fCompressed); bool SetPubKey(const unsigned char* pubkey, size_t size); - bool Sign(const uint256 &hash, std::vector& vchSig); bool Verify(const uint256 &hash, const std::vector& vchSig); - bool SignCompact(const uint256 &hash, unsigned char *p64, int &rec); // reconstruct public key from a compact signature // This is only slightly more CPU intensive than just verifying it. @@ -38,7 +31,6 @@ public: // (the signature is a valid signature of the given data for that key) bool Recover(const uint256 &hash, const unsigned char *p64, int rec); - static bool TweakSecret(unsigned char vchSecretOut[32], const unsigned char vchSecretIn[32], const unsigned char vchTweak[32]); bool TweakPublic(const unsigned char vchTweak[32]); static bool SanityCheck(); }; From 0ceab00d16a1d23da06a748889db25662b16bfb3 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Tue, 18 Nov 2014 09:55:39 +0100 Subject: [PATCH 1048/1288] [Qt, OSX] move QProgressBarMac to guiutil.h --- src/qt/bitcoingui.cpp | 20 +------------------- src/qt/guiutil.h | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 06e53ea1e6..6a457d361f 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -58,20 +58,6 @@ #include #endif -#ifdef Q_OS_MAC -#include - -// workaround for Qt OSX Bug: -// https://bugreports.qt-project.org/browse/QTBUG-15631 -// QProgressBar uses around 10% CPU even when app is in background -class QProgressBarMac : public QProgressBar -{ - bool event(QEvent *e) { - return (e->type() != QEvent::StyleAnimationUpdate) ? QProgressBar::event(e) : false; - } -}; -#endif - const QString BitcoinGUI::DEFAULT_WALLET = "~Default"; BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) : @@ -204,11 +190,7 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) : // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); -#ifdef Q_OS_MAC - progressBar = new QProgressBarMac(); -#else - progressBar = new QProgressBar(); -#endif + progressBar = new GUIUtil::ProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 5666744bd3..a6ecfbcc82 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -7,9 +7,11 @@ #include "amount.h" +#include #include #include #include +#include #include #include @@ -186,6 +188,21 @@ namespace GUIUtil /* Format a CNodeCombinedStats.dPingTime into a user-readable string or display N/A, if 0*/ QString formatPingTime(double dPingTime); + +#ifdef Q_OS_MAC + // workaround for Qt OSX Bug: + // https://bugreports.qt-project.org/browse/QTBUG-15631 + // QProgressBar uses around 10% CPU even when app is in background + class ProgressBar : public QProgressBar + { + bool event(QEvent *e) { + return (e->type() != QEvent::StyleAnimationUpdate) ? QProgressBar::event(e) : false; + } + }; +#else + typedef QProgressBar ProgressBar; +#endif + } // namespace GUIUtil #endif // BITCOIN_QT_GUIUTIL_H From 8c4185338001b8ba3ef247b09fb63afb65961c10 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Wed, 19 Nov 2014 09:55:51 -0500 Subject: [PATCH 1049/1288] gmp needed to build on OSX --- doc/build-osx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/build-osx.md b/doc/build-osx.md index c41820f2b1..491c5c4683 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -38,7 +38,7 @@ Instructions: Homebrew #### Install dependencies using Homebrew - brew install autoconf automake libtool boost miniupnpc openssl pkg-config protobuf qt + brew install autoconf automake libtool boost miniupnpc openssl pkg-config protobuf qt gmp #### Installing berkeley-db4 using Homebrew From 0ed9675be4a28b6240e10c0d3fdb81373bd56bbc Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 2 Nov 2014 00:43:31 +0100 Subject: [PATCH 1050/1288] [Wallet] Add global boolean whether to send free transactions (default=true) --- src/wallet.cpp | 3 ++- src/wallet.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index ec439c5aad..1b8e387e44 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -28,6 +28,7 @@ using namespace std; CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE); unsigned int nTxConfirmTarget = 1; bool bSpendZeroConfChange = true; +bool fSendFreeTransactions = true; /** * Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) @@ -1502,7 +1503,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, break; // Done, enough fee included. // Too big to send for free? Include more fee and try again: - if (nBytes > MAX_FREE_TRANSACTION_CREATE_SIZE) + if (!fSendFreeTransactions || nBytes > MAX_FREE_TRANSACTION_CREATE_SIZE) { nFeeRet = nFeeNeeded; continue; diff --git a/src/wallet.h b/src/wallet.h index b692ad056b..ebe52d4ab9 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -32,6 +32,7 @@ extern CFeeRate payTxFee; extern unsigned int nTxConfirmTarget; extern bool bSpendZeroConfChange; +extern bool fSendFreeTransactions; //! -paytxfee default static const CAmount DEFAULT_TRANSACTION_FEE = 0; From ed3e5e468c5b7973d71efe51c90c3a301d570e27 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 2 Nov 2014 00:47:39 +0100 Subject: [PATCH 1051/1288] [Wallet] Add global boolean whether to pay at least the custom fee (default=true) --- src/wallet.cpp | 6 +++++- src/wallet.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index 1b8e387e44..f1cf104974 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -29,6 +29,7 @@ CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE); unsigned int nTxConfirmTarget = 1; bool bSpendZeroConfChange = true; bool fSendFreeTransactions = true; +bool fPayAtLeastCustomFee = true; /** * Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) @@ -1383,7 +1384,10 @@ bool CWallet::CreateTransaction(const vector >& vecSend, { LOCK2(cs_main, cs_wallet); { - nFeeRet = payTxFee.GetFeePerK(); + if (fPayAtLeastCustomFee) + nFeeRet = payTxFee.GetFeePerK(); + else + nFeeRet = 0; while (true) { txNew.vin.clear(); diff --git a/src/wallet.h b/src/wallet.h index ebe52d4ab9..0244ce2368 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -33,6 +33,7 @@ extern CFeeRate payTxFee; extern unsigned int nTxConfirmTarget; extern bool bSpendZeroConfChange; extern bool fSendFreeTransactions; +extern bool fPayAtLeastCustomFee; //! -paytxfee default static const CAmount DEFAULT_TRANSACTION_FEE = 0; From e7876b297901a4b49daafc9ccd2b5c34a6214039 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 2 Nov 2014 18:28:43 +0100 Subject: [PATCH 1052/1288] [Wallet] Prevent user from paying a non-sense fee --- src/wallet.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wallet.cpp b/src/wallet.cpp index f1cf104974..2d59506bab 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1633,6 +1633,9 @@ CAmount CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarge { // payTxFee is user-set "I want to pay this much" CAmount nFeeNeeded = payTxFee.GetFee(nTxBytes); + // prevent user from paying a non-sense fee (like 1 satoshi): 0 < fee < minRelayFee + if (nFeeNeeded > 0 && nFeeNeeded < ::minRelayTxFee.GetFee(nTxBytes)) + nFeeNeeded = ::minRelayTxFee.GetFee(nTxBytes); // User didn't set: use -txconfirmtarget to estimate... if (nFeeNeeded == 0) nFeeNeeded = pool.estimateFee(nConfirmTarget).GetFee(nTxBytes); From c1c9d5b415fda7d1310c23857e57d98ac14c3063 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 2 Nov 2014 00:14:47 +0100 Subject: [PATCH 1053/1288] [Qt] Add Smartfee to GUI --- src/init.cpp | 2 + src/qt/bitcoinamountfield.cpp | 6 + src/qt/bitcoinamountfield.h | 3 + src/qt/coincontroldialog.cpp | 93 +++-- src/qt/coincontroldialog.h | 2 +- src/qt/forms/optionsdialog.ui | 78 +--- src/qt/forms/sendcoinsdialog.ui | 600 +++++++++++++++++++++++++++++- src/qt/optionsdialog.cpp | 18 - src/qt/optionsdialog.h | 1 - src/qt/optionsmodel.cpp | 24 -- src/qt/optionsmodel.h | 2 - src/qt/sendcoinsdialog.cpp | 196 +++++++++- src/qt/sendcoinsdialog.h | 13 + src/qt/walletmodel.cpp | 4 + src/qt/walletmodel.h | 3 +- src/qt/walletmodeltransaction.cpp | 5 + src/qt/walletmodeltransaction.h | 1 + src/qt/walletview.cpp | 1 + src/txmempool.h | 7 +- src/wallet.cpp | 10 +- 20 files changed, 903 insertions(+), 166 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index b290d54158..4a9982a1cd 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -290,6 +290,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -paytxfee= " + strprintf(_("Fee (in BTC/kB) to add to transactions you send (default: %s)"), FormatMoney(payTxFee.GetFeePerK())) + "\n"; strUsage += " -rescan " + _("Rescan the block chain for missing wallet transactions") + " " + _("on startup") + "\n"; strUsage += " -salvagewallet " + _("Attempt to recover private keys from a corrupt wallet.dat") + " " + _("on startup") + "\n"; + strUsage += " -sendfreetransactions " + strprintf(_("Send transactions as zero-fee transactions if possible (default: %u)"), 0) + "\n"; strUsage += " -spendzeroconfchange " + strprintf(_("Spend unconfirmed change when sending transactions (default: %u)"), 1) + "\n"; strUsage += " -txconfirmtarget= " + strprintf(_("If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: %u)"), 1) + "\n"; strUsage += " -upgradewallet " + _("Upgrade wallet to latest format") + " " + _("on startup") + "\n"; @@ -704,6 +705,7 @@ bool AppInit2(boost::thread_group& threadGroup) } nTxConfirmTarget = GetArg("-txconfirmtarget", 1); bSpendZeroConfChange = GetArg("-spendzeroconfchange", true); + fSendFreeTransactions = GetArg("-sendfreetransactions", false); std::string strWalletFile = GetArg("-wallet", "wallet.dat"); #endif // ENABLE_WALLET diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp index 2c100337d2..5b8ab23b26 100644 --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -221,6 +221,12 @@ void BitcoinAmountField::clear() unit->setCurrentIndex(0); } +void BitcoinAmountField::setEnabled(bool fEnabled) +{ + amount->setEnabled(fEnabled); + unit->setEnabled(fEnabled); +} + bool BitcoinAmountField::validate() { bool valid = false; diff --git a/src/qt/bitcoinamountfield.h b/src/qt/bitcoinamountfield.h index 4ab66001f0..1bad8ce1b8 100644 --- a/src/qt/bitcoinamountfield.h +++ b/src/qt/bitcoinamountfield.h @@ -48,6 +48,9 @@ public: /** Make field empty and ready for new input. */ void clear(); + /** Enable/Disable. */ + void setEnabled(bool fEnabled); + /** Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907), in these cases we have to set it up manually. */ diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index ba0febe546..85b43b7b1f 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -130,10 +131,22 @@ CoinControlDialog::CoinControlDialog(QWidget *parent) : // default view is sorted by amount desc sortView(COLUMN_AMOUNT_INT64, Qt::DescendingOrder); + + // restore list mode and sortorder as a convenience feature + QSettings settings; + if (settings.contains("nCoinControlMode") && !settings.value("nCoinControlMode").toBool()) + ui->radioTreeMode->click(); + if (settings.contains("nCoinControlSortColumn") && settings.contains("nCoinControlSortOrder")) + sortView(settings.value("nCoinControlSortColumn").toInt(), ((Qt::SortOrder)settings.value("nCoinControlSortOrder").toInt())); } CoinControlDialog::~CoinControlDialog() { + QSettings settings; + settings.setValue("nCoinControlMode", ui->radioListMode->isChecked()); + settings.setValue("nCoinControlSortColumn", sortColumn); + settings.setValue("nCoinControlSortOrder", (int)sortOrder); + delete ui; } @@ -290,19 +303,19 @@ void CoinControlDialog::clipboardAmount() // copy label "Fee" to clipboard void CoinControlDialog::clipboardFee() { - GUIUtil::setClipboard(ui->labelCoinControlFee->text().left(ui->labelCoinControlFee->text().indexOf(" "))); + GUIUtil::setClipboard(ui->labelCoinControlFee->text().left(ui->labelCoinControlFee->text().indexOf(" ")).replace("~", "")); } // copy label "After fee" to clipboard void CoinControlDialog::clipboardAfterFee() { - GUIUtil::setClipboard(ui->labelCoinControlAfterFee->text().left(ui->labelCoinControlAfterFee->text().indexOf(" "))); + GUIUtil::setClipboard(ui->labelCoinControlAfterFee->text().left(ui->labelCoinControlAfterFee->text().indexOf(" ")).replace("~", "")); } // copy label "Bytes" to clipboard void CoinControlDialog::clipboardBytes() { - GUIUtil::setClipboard(ui->labelCoinControlBytes->text()); + GUIUtil::setClipboard(ui->labelCoinControlBytes->text().replace("~", "")); } // copy label "Priority" to clipboard @@ -320,7 +333,7 @@ void CoinControlDialog::clipboardLowOutput() // copy label "Change" to clipboard void CoinControlDialog::clipboardChange() { - GUIUtil::setClipboard(ui->labelCoinControlChange->text().left(ui->labelCoinControlChange->text().indexOf(" "))); + GUIUtil::setClipboard(ui->labelCoinControlChange->text().left(ui->labelCoinControlChange->text().indexOf(" ")).replace("~", "")); } // treeview: sort @@ -402,26 +415,22 @@ void CoinControlDialog::viewItemChanged(QTreeWidgetItem* item, int column) } // return human readable label for priority number -QString CoinControlDialog::getPriorityLabel(const CTxMemPool& pool, double dPriority) +QString CoinControlDialog::getPriorityLabel(double dPriority, double mempoolEstimatePriority) { - // confirmations -> textual description - typedef std::map PriorityDescription; - const static PriorityDescription priorityDescriptions = boost::assign::map_list_of - (1, tr("highest"))(2, tr("higher"))(3, tr("high")) - (5, tr("medium-high"))(6, tr("medium")) - (10, tr("low-medium"))(15, tr("low")) - (20, tr("lower")); + double dPriorityMedium = mempoolEstimatePriority; - BOOST_FOREACH(const PriorityDescription::value_type& i, priorityDescriptions) - { - double p = mempool.estimatePriority(i.first); - if (p > 0 && dPriority >= p) return i.second; - } - // Note: if mempool hasn't accumulated enough history (estimatePriority - // returns -1) we're conservative and classify as "lowest" - if (mempool.estimatePriority(nTxConfirmTarget) <= 0 && AllowFree(dPriority)) - return ">=" + tr("medium"); - return tr("lowest"); + if (dPriorityMedium <= 0) + dPriorityMedium = AllowFreeThreshold(); // not enough data, back to hard-coded + + if (dPriority / 1000000 > dPriorityMedium) return tr("highest"); + else if (dPriority / 100000 > dPriorityMedium) return tr("higher"); + else if (dPriority / 10000 > dPriorityMedium) return tr("high"); + else if (dPriority / 1000 > dPriorityMedium) return tr("medium-high"); + else if (dPriority > dPriorityMedium) return tr("medium"); + else if (dPriority * 10 > dPriorityMedium) return tr("low-medium"); + else if (dPriority * 100 > dPriorityMedium) return tr("low"); + else if (dPriority * 1000 > dPriorityMedium) return tr("lower"); + else return tr("lowest"); } // shows count of locked unspent outputs @@ -470,6 +479,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) double dPriorityInputs = 0; unsigned int nQuantity = 0; int nQuantityUncompressed = 0; + bool fAllowFree = false; vector vCoinControl; vector vOutputs; @@ -522,24 +532,22 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) nBytes = nBytesInputs + ((CoinControlDialog::payAmounts.size() > 0 ? CoinControlDialog::payAmounts.size() + 1 : 2) * 34) + 10; // always assume +1 output for change here // Priority + double mempoolEstimatePriority = mempool.estimatePriority(nTxConfirmTarget); dPriority = dPriorityInputs / (nBytes - nBytesInputs + (nQuantityUncompressed * 29)); // 29 = 180 - 151 (uncompressed public keys are over the limit. max 151 bytes of the input are ignored for priority) - sPriorityLabel = CoinControlDialog::getPriorityLabel(mempool, dPriority); + sPriorityLabel = CoinControlDialog::getPriorityLabel(dPriority, mempoolEstimatePriority); - // Voluntary Fee - nPayFee = payTxFee.GetFee(max((unsigned int)1000, nBytes)); + // Fee + nPayFee = CWallet::GetMinimumFee(nBytes, nTxConfirmTarget, mempool); - // Min Fee - if (nPayFee == 0) - { - nPayFee = CWallet::GetMinimumFee(nBytes, nTxConfirmTarget, mempool); + // Allow free? + double dPriorityNeeded = mempoolEstimatePriority; + if (dPriorityNeeded <= 0) + dPriorityNeeded = AllowFreeThreshold(); // not enough data, back to hard-coded + fAllowFree = (dPriority >= dPriorityNeeded); - double dPriorityNeeded = mempool.estimatePriority(nTxConfirmTarget); - if (dPriorityNeeded <= 0 && !AllowFree(dPriority)) // not enough mempool history: never send free - dPriorityNeeded = std::numeric_limits::max(); - - if (nBytes <= MAX_FREE_TRANSACTION_CREATE_SIZE && dPriority >= dPriorityNeeded) + if (fSendFreeTransactions) + if (fAllowFree && nBytes <= MAX_FREE_TRANSACTION_CREATE_SIZE) nPayFee = 0; - } if (nPayAmount > 0) { @@ -595,7 +603,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) l6->setText(sPriorityLabel); // Priority l7->setText(fDust ? tr("yes") : tr("no")); // Dust l8->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nChange)); // Change - if (nPayFee > 0) + if (nPayFee > 0 && !(payTxFee.GetFeePerK() > 0 && fPayAtLeastCustomFee && nBytes < 1000)) { l3->setText("~" + l3->text()); l4->setText("~" + l4->text()); @@ -605,7 +613,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) // turn labels "red" l5->setStyleSheet((nBytes >= MAX_FREE_TRANSACTION_CREATE_SIZE) ? "color:red;" : "");// Bytes >= 1000 - l6->setStyleSheet((dPriority > 0 && !AllowFree(dPriority)) ? "color:red;" : ""); // Priority < "medium" + l6->setStyleSheet((dPriority > 0 && !fAllowFree) ? "color:red;" : ""); // Priority < "medium" l7->setStyleSheet((fDust) ? "color:red;" : ""); // Dust = "yes" // tool tips @@ -620,7 +628,11 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) QString toolTip3 = tr("This label turns red, if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, ::minRelayTxFee.GetFee(546))); // how many satoshis the estimated fee can vary per byte we guess wrong - double dFeeVary = (double)std::max(CWallet::minTxFee.GetFeePerK(), std::max(payTxFee.GetFeePerK(), mempool.estimateFee(nTxConfirmTarget).GetFeePerK())) / 1000; + double dFeeVary; + if (payTxFee.GetFeePerK() > 0) + dFeeVary = (double)std::max(CWallet::minTxFee.GetFeePerK(), payTxFee.GetFeePerK()) / 1000; + else + dFeeVary = (double)std::max(CWallet::minTxFee.GetFeePerK(), mempool.estimateFee(nTxConfirmTarget).GetFeePerK()) / 1000; QString toolTip4 = tr("Can vary +/- %1 satoshi(s) per input.").arg(dFeeVary); l3->setToolTip(toolTip4); @@ -656,6 +668,7 @@ void CoinControlDialog::updateView() QFlags flgTristate = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsTristate; int nDisplayUnit = model->getOptionsModel()->getDisplayUnit(); + double mempoolEstimatePriority = mempool.estimatePriority(nTxConfirmTarget); map > mapCoins; model->listCoins(mapCoins); @@ -745,7 +758,7 @@ void CoinControlDialog::updateView() // priority double dPriority = ((double)out.tx->vout[out.i].nValue / (nInputSize + 78)) * (out.nDepth+1); // 78 = 2 * 34 + 10 - itemOutput->setText(COLUMN_PRIORITY, CoinControlDialog::getPriorityLabel(mempool, dPriority)); + itemOutput->setText(COLUMN_PRIORITY, CoinControlDialog::getPriorityLabel(dPriority, mempoolEstimatePriority)); itemOutput->setText(COLUMN_PRIORITY_INT64, strPad(QString::number((int64_t)dPriority), 20, " ")); dPrioritySum += (double)out.tx->vout[out.i].nValue * (out.nDepth+1); nInputSum += nInputSize; @@ -778,7 +791,7 @@ void CoinControlDialog::updateView() itemWalletAddress->setText(COLUMN_CHECKBOX, "(" + QString::number(nChildren) + ")"); itemWalletAddress->setText(COLUMN_AMOUNT, BitcoinUnits::format(nDisplayUnit, nSum)); itemWalletAddress->setText(COLUMN_AMOUNT_INT64, strPad(QString::number(nSum), 15, " ")); - itemWalletAddress->setText(COLUMN_PRIORITY, CoinControlDialog::getPriorityLabel(mempool, dPrioritySum)); + itemWalletAddress->setText(COLUMN_PRIORITY, CoinControlDialog::getPriorityLabel(dPrioritySum, mempoolEstimatePriority)); itemWalletAddress->setText(COLUMN_PRIORITY_INT64, strPad(QString::number((int64_t)dPrioritySum), 20, " ")); } } diff --git a/src/qt/coincontroldialog.h b/src/qt/coincontroldialog.h index cc388d626e..bd4f5d7f1e 100644 --- a/src/qt/coincontroldialog.h +++ b/src/qt/coincontroldialog.h @@ -37,7 +37,7 @@ public: // static because also called from sendcoinsdialog static void updateLabels(WalletModel*, QDialog*); - static QString getPriorityLabel(const CTxMemPool& pool, double); + static QString getPriorityLabel(double dPriority, double mempoolEstimatePriority); static QList payAmounts; static CCoinControl *coinControl; diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 9d094c1a73..3446cf5c33 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -137,65 +137,6 @@ W&allet - - - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - Qt::PlainText - - - true - - - - - - - - - Pay transaction &fee - - - Qt::PlainText - - - transactionFee - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -225,6 +166,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -632,12 +586,6 @@ - - BitcoinAmountField - QLineEdit -
bitcoinamountfield.h
- 1 -
QValidatedLineEdit QLineEdit diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui index dce7f4ce4c..0bf04c75eb 100644 --- a/src/qt/forms/sendcoinsdialog.ui +++ b/src/qt/forms/sendcoinsdialog.ui @@ -7,13 +7,13 @@ 0 0 850 - 400 + 526 Send Coins - + 8 @@ -617,7 +617,7 @@ 0 0 830 - 178 + 68 @@ -657,6 +657,590 @@ + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 10 + + + 0 + + + + + 0 + + + + + 0 + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 1 + 4 + + + + + + + + 10 + + + + + + 0 + 0 + + + + + 75 + true + + + + font-weight:bold; + + + Transaction Fee: + + + + + + + + + + + + + + Choose... + + + + + + + collapse fee-settings + + + Minimize + + + + + + + + + Qt::Vertical + + + + 1 + 1 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 10 + + + 4 + + + 10 + + + 4 + + + + + 6 + + + + + + + If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte. + + + per kilobyte + + + true + + + groupCustomFee + + + + + + + If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "total at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte. + + + total at least + + + groupCustomFee + + + + + + + + + + Qt::Horizontal + + + + 1 + 1 + + + + + + + + + + + + Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process. + + + + + + + + + + true + + + Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process. + + + (read the tooltip) + + + 5 + + + + + + + Qt::Horizontal + + + + 1 + 1 + + + + + + + + + + + + + + Recommended: + + + true + + + groupFee + + + + + + + Qt::Vertical + + + + 1 + 1 + + + + + + + + + + + + Custom: + + + groupFee + + + + + + + Qt::Vertical + + + + 1 + 1 + + + + + + + + + + 6 + + + 2 + + + + + + + + + + 2 + + + + + + + + + + + + + + (Smart fee not initialized yet. This usually takes a few blocks...) + + + 2 + + + + + + + Qt::Horizontal + + + + 1 + 1 + + + + + + + + + + + + + + Confirmation time: + + + 2 + + + + + + + Qt::Vertical + + + + 1 + 1 + + + + + + + + + + 30 + + + + + 0 + + + 24 + + + 1 + + + 0 + + + Qt::Horizontal + + + false + + + false + + + QSlider::NoTicks + + + + + + + + + normal + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + fast + + + + + + + + + + + + + Qt::Vertical + + + + 1 + 1 + + + + + + + + + + + + 8 + + + 4 + + + + + Send as zero-fee transaction if possible + + + + + + + (confirmation may take longer) + + + 5 + + + + + + + Qt::Horizontal + + + + 1 + 1 + + + + + + + + + + Qt::Vertical + + + + 1 + 1 + + + + + + + + + + + Qt::Vertical + + + + 800 + 1 + + + + + + + + + @@ -787,9 +1371,19 @@ QLineEdit
qvalidatedlineedit.h
+ + BitcoinAmountField + QLineEdit +
bitcoinamountfield.h
+ 1 +
+ + + + diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index f5a0759c92..069080219e 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -105,9 +105,6 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) : #endif ui->unit->setModel(new BitcoinUnits(this)); -#ifdef ENABLE_WALLET - ui->transactionFee->setSingleStep(CWallet::minTxFee.GetFeePerK()); -#endif /* Widget-to-option mapper */ mapper = new QDataWidgetMapper(this); @@ -139,16 +136,11 @@ void OptionsDialog::setModel(OptionsModel *model) strLabel = tr("none"); ui->overriddenByCommandLineLabel->setText(strLabel); - connect(model, SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); - mapper->setModel(model); setMapper(); mapper->toFirst(); } - /* update the display unit, to not use the default ("BTC") */ - updateDisplayUnit(); - /* warn when one of the following settings changes by user action (placed here so init via mapper doesn't trigger them) */ /* Main */ @@ -172,7 +164,6 @@ void OptionsDialog::setMapper() mapper->addMapping(ui->databaseCache, OptionsModel::DatabaseCache); /* Wallet */ - mapper->addMapping(ui->transactionFee, OptionsModel::Fee); mapper->addMapping(ui->spendZeroConfChange, OptionsModel::SpendZeroConfChange); mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures); @@ -264,15 +255,6 @@ void OptionsDialog::clearStatusLabel() ui->statusLabel->clear(); } -void OptionsDialog::updateDisplayUnit() -{ - if(model) - { - /* Update transactionFee with the current unit */ - ui->transactionFee->setDisplayUnit(model->getDisplayUnit()); - } -} - void OptionsDialog::doProxyIpChecks(QValidatedLineEdit *pUiProxyIp, int nProxyPort) { Q_UNUSED(nProxyPort); diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h index 794a39590c..511719f53c 100644 --- a/src/qt/optionsdialog.h +++ b/src/qt/optionsdialog.h @@ -46,7 +46,6 @@ private slots: void showRestartWarning(bool fPersistent = false); void clearStatusLabel(); - void updateDisplayUnit(); void doProxyIpChecks(QValidatedLineEdit *pUiProxyIp, int nProxyPort); signals: diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index c941ebd4ca..7054509fe6 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -90,12 +90,6 @@ void OptionsModel::Init() // Wallet #ifdef ENABLE_WALLET - if (!settings.contains("nTransactionFee")) - settings.setValue("nTransactionFee", (qint64)DEFAULT_TRANSACTION_FEE); - payTxFee = CFeeRate(settings.value("nTransactionFee").toLongLong()); // if -paytxfee is set, this will be overridden later in init.cpp - if (mapArgs.count("-paytxfee")) - addOverriddenOption("-paytxfee"); - if (!settings.contains("bSpendZeroConfChange")) settings.setValue("bSpendZeroConfChange", true); if (!SoftSetBoolArg("-spendzeroconfchange", settings.value("bSpendZeroConfChange").toBool())) @@ -185,16 +179,6 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const } #ifdef ENABLE_WALLET - case Fee: { - // Attention: Init() is called before payTxFee is set in AppInit2()! - // To ensure we can change the fee on-the-fly update our QSetting when - // opening OptionsDialog, which queries Fee via the mapper. - if (!(payTxFee == CFeeRate(settings.value("nTransactionFee").toLongLong(), 1000))) - settings.setValue("nTransactionFee", (qint64)payTxFee.GetFeePerK()); - // Todo: Consider to revert back to use just payTxFee here, if we don't want - // -paytxfee to update our QSettings! - return settings.value("nTransactionFee"); - } case SpendZeroConfChange: return settings.value("bSpendZeroConfChange"); #endif @@ -276,14 +260,6 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in } break; #ifdef ENABLE_WALLET - case Fee: { // core option - can be changed on-the-fly - // Todo: Add is valid check and warn via message, if not - CAmount nTransactionFee(value.toLongLong()); - payTxFee = CFeeRate(nTransactionFee, 1000); - settings.setValue("nTransactionFee", qint64(nTransactionFee)); - emit transactionFeeChanged(nTransactionFee); - break; - } case SpendZeroConfChange: if (settings.value("bSpendZeroConfChange") != value) { settings.setValue("bSpendZeroConfChange", value); diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index e2dc067edb..84fd49a7b8 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -34,7 +34,6 @@ public: ProxyUse, // bool ProxyIP, // QString ProxyPort, // int - Fee, // qint64 DisplayUnit, // BitcoinUnits::Unit ThirdPartyTxUrls, // QString Language, // QString @@ -84,7 +83,6 @@ private: signals: void displayUnitChanged(int unit); - void transactionFeeChanged(const CAmount&); void coinControlFeaturesChanged(bool); }; diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index ce94131cce..ff39829b95 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -7,10 +7,12 @@ #include "addresstablemodel.h" #include "bitcoinunits.h" +#include "clientmodel.h" #include "coincontroldialog.h" #include "guiutil.h" #include "optionsmodel.h" #include "sendcoinsentry.h" +#include "wallet.h" #include "walletmodel.h" #include "base58.h" @@ -19,6 +21,7 @@ #include #include +#include #include SendCoinsDialog::SendCoinsDialog(QWidget *parent) : @@ -72,9 +75,46 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) : ui->labelCoinControlLowOutput->addAction(clipboardLowOutputAction); ui->labelCoinControlChange->addAction(clipboardChangeAction); + // init transaction fee section + QSettings settings; + if (!settings.contains("fFeeSectionMinimized")) + settings.setValue("fFeeSectionMinimized", true); + if (!settings.contains("nFeeRadio") && settings.contains("nTransactionFee") && settings.value("nTransactionFee").toLongLong() > 0) // compatibility + settings.setValue("nFeeRadio", 1); // custom + if (!settings.contains("nFeeRadio")) + settings.setValue("nFeeRadio", 0); // recommended + if (!settings.contains("nCustomFeeRadio") && settings.contains("nTransactionFee") && settings.value("nTransactionFee").toLongLong() > 0) // compatibility + settings.setValue("nCustomFeeRadio", 1); // total at least + if (!settings.contains("nCustomFeeRadio")) + settings.setValue("nCustomFeeRadio", 0); // per kilobyte + if (!settings.contains("nSmartFeeSliderPosition")) + settings.setValue("nSmartFeeSliderPosition", 0); + if (!settings.contains("nTransactionFee")) + settings.setValue("nTransactionFee", (qint64)DEFAULT_TRANSACTION_FEE); + if (!settings.contains("fPayOnlyMinFee")) + settings.setValue("fPayOnlyMinFee", false); + if (!settings.contains("fSendFreeTransactions")) + settings.setValue("fSendFreeTransactions", false); + ui->groupFee->setId(ui->radioSmartFee, 0); + ui->groupFee->setId(ui->radioCustomFee, 1); + ui->groupFee->button((int)std::max(0, std::min(1, settings.value("nFeeRadio").toInt())))->setChecked(true); + ui->groupCustomFee->setId(ui->radioCustomPerKilobyte, 0); + ui->groupCustomFee->setId(ui->radioCustomAtLeast, 1); + ui->groupCustomFee->button((int)std::max(0, std::min(1, settings.value("nCustomFeeRadio").toInt())))->setChecked(true); + ui->sliderSmartFee->setValue(settings.value("nSmartFeeSliderPosition").toInt()); + ui->customFee->setValue(settings.value("nTransactionFee").toLongLong()); + ui->checkBoxMinimumFee->setChecked(settings.value("fPayOnlyMinFee").toBool()); + ui->checkBoxFreeTx->setChecked(settings.value("fSendFreeTransactions").toBool()); + minimizeFeeSection(settings.value("fFeeSectionMinimized").toBool()); + fNewRecipientAllowed = true; } +void SendCoinsDialog::setClientModel(ClientModel *clientModel) +{ + this->clientModel = clientModel; +} + void SendCoinsDialog::setModel(WalletModel *model) { this->model = model; @@ -94,18 +134,51 @@ void SendCoinsDialog::setModel(WalletModel *model) model->getWatchBalance(), model->getWatchUnconfirmedBalance(), model->getWatchImmatureBalance()); connect(model, SIGNAL(balanceChanged(CAmount,CAmount,CAmount,CAmount,CAmount,CAmount)), this, SLOT(setBalance(CAmount,CAmount,CAmount,CAmount,CAmount,CAmount))); connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); + updateDisplayUnit(); // Coin Control connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(coinControlUpdateLabels())); connect(model->getOptionsModel(), SIGNAL(coinControlFeaturesChanged(bool)), this, SLOT(coinControlFeatureChanged(bool))); - connect(model->getOptionsModel(), SIGNAL(transactionFeeChanged(CAmount)), this, SLOT(coinControlUpdateLabels())); ui->frameCoinControl->setVisible(model->getOptionsModel()->getCoinControlFeatures()); coinControlUpdateLabels(); + + // fee section + connect(clientModel, SIGNAL(numBlocksChanged(int)), this, SLOT(updateSmartFeeLabel())); + connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(updateSmartFeeLabel())); + connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(updateGlobalFeeVariables())); + connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(coinControlUpdateLabels())); + connect(ui->groupFee, SIGNAL(buttonClicked(int)), this, SLOT(updateFeeSectionControls())); + connect(ui->groupFee, SIGNAL(buttonClicked(int)), this, SLOT(updateGlobalFeeVariables())); + connect(ui->groupFee, SIGNAL(buttonClicked(int)), this, SLOT(coinControlUpdateLabels())); + connect(ui->groupCustomFee, SIGNAL(buttonClicked(int)), this, SLOT(updateGlobalFeeVariables())); + connect(ui->groupCustomFee, SIGNAL(buttonClicked(int)), this, SLOT(coinControlUpdateLabels())); + connect(ui->customFee, SIGNAL(valueChanged()), this, SLOT(updateGlobalFeeVariables())); + connect(ui->customFee, SIGNAL(valueChanged()), this, SLOT(coinControlUpdateLabels())); + connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(setMinimumFee())); + connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(updateFeeSectionControls())); + connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(updateGlobalFeeVariables())); + connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(coinControlUpdateLabels())); + connect(ui->checkBoxFreeTx, SIGNAL(stateChanged(int)), this, SLOT(updateGlobalFeeVariables())); + connect(ui->checkBoxFreeTx, SIGNAL(stateChanged(int)), this, SLOT(coinControlUpdateLabels())); + ui->customFee->setSingleStep(CWallet::minTxFee.GetFeePerK()); + updateFeeSectionControls(); + updateMinFeeLabel(); + updateSmartFeeLabel(); + updateGlobalFeeVariables(); } } SendCoinsDialog::~SendCoinsDialog() { + QSettings settings; + settings.setValue("fFeeSectionMinimized", fFeeMinimized); + settings.setValue("nFeeRadio", ui->groupFee->checkedId()); + settings.setValue("nCustomFeeRadio", ui->groupCustomFee->checkedId()); + settings.setValue("nSmartFeeSliderPosition", ui->sliderSmartFee->value()); + settings.setValue("nTransactionFee", (qint64)ui->customFee->value()); + settings.setValue("fPayOnlyMinFee", ui->checkBoxMinimumFee->isChecked()); + settings.setValue("fSendFreeTransactions", ui->checkBoxFreeTx->isChecked()); + delete ui; } @@ -214,6 +287,9 @@ void SendCoinsDialog::on_sendButton_clicked() questionString.append(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee)); questionString.append(" "); questionString.append(tr("added as transaction fee")); + + // append transaction size + questionString.append(" (" + QString::number((double)currentTransaction.getTransactionSize() / 1000) + " kB)"); } // add total amount in all subdivision units @@ -402,6 +478,9 @@ void SendCoinsDialog::setBalance(const CAmount& balance, const CAmount& unconfir void SendCoinsDialog::updateDisplayUnit() { setBalance(model->getBalance(), 0, 0, 0, 0, 0); + ui->customFee->setDisplayUnit(model->getOptionsModel()->getDisplayUnit()); + updateMinFeeLabel(); + updateSmartFeeLabel(); } void SendCoinsDialog::processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg) @@ -438,6 +517,9 @@ void SendCoinsDialog::processSendCoinsReturn(const WalletModel::SendCoinsReturn msgParams.first = tr("The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."); msgParams.second = CClientUIInterface::MSG_ERROR; break; + case WalletModel::InsaneFee: + msgParams.first = tr("A fee higher than %1 is considered an insanely high fee.").arg(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), 10000000)); + break; // included to prevent a compiler warning. case WalletModel::OK: default: @@ -447,6 +529,110 @@ void SendCoinsDialog::processSendCoinsReturn(const WalletModel::SendCoinsReturn emit message(tr("Send Coins"), msgParams.first, msgParams.second); } +void SendCoinsDialog::minimizeFeeSection(bool fMinimize) +{ + ui->labelFeeMinimized->setVisible(fMinimize); + ui->buttonChooseFee ->setVisible(fMinimize); + ui->buttonMinimizeFee->setVisible(!fMinimize); + ui->frameFeeSelection->setVisible(!fMinimize); + ui->horizontalLayoutSmartFee->setContentsMargins(0, (fMinimize ? 0 : 6), 0, 0); + fFeeMinimized = fMinimize; +} + +void SendCoinsDialog::on_buttonChooseFee_clicked() +{ + minimizeFeeSection(false); +} + +void SendCoinsDialog::on_buttonMinimizeFee_clicked() +{ + updateFeeMinimizedLabel(); + minimizeFeeSection(true); +} + +void SendCoinsDialog::setMinimumFee() +{ + ui->radioCustomPerKilobyte->setChecked(true); + ui->customFee->setValue(CWallet::minTxFee.GetFeePerK()); +} + +void SendCoinsDialog::updateFeeSectionControls() +{ + ui->sliderSmartFee ->setEnabled(ui->radioSmartFee->isChecked()); + ui->labelSmartFee ->setEnabled(ui->radioSmartFee->isChecked()); + ui->labelSmartFee2 ->setEnabled(ui->radioSmartFee->isChecked()); + ui->labelSmartFee3 ->setEnabled(ui->radioSmartFee->isChecked()); + ui->labelFeeEstimation ->setEnabled(ui->radioSmartFee->isChecked()); + ui->labelSmartFeeNormal ->setEnabled(ui->radioSmartFee->isChecked()); + ui->labelSmartFeeFast ->setEnabled(ui->radioSmartFee->isChecked()); + ui->checkBoxMinimumFee ->setEnabled(ui->radioCustomFee->isChecked()); + ui->labelMinFeeWarning ->setEnabled(ui->radioCustomFee->isChecked()); + ui->radioCustomPerKilobyte ->setEnabled(ui->radioCustomFee->isChecked() && !ui->checkBoxMinimumFee->isChecked()); + ui->radioCustomAtLeast ->setEnabled(ui->radioCustomFee->isChecked() && !ui->checkBoxMinimumFee->isChecked()); + ui->customFee ->setEnabled(ui->radioCustomFee->isChecked() && !ui->checkBoxMinimumFee->isChecked()); +} + +void SendCoinsDialog::updateGlobalFeeVariables() +{ + if (ui->radioSmartFee->isChecked()) + { + nTxConfirmTarget = (int)25 - (int)std::max(0, std::min(24, ui->sliderSmartFee->value())); + payTxFee = CFeeRate(0); + } + else + { + nTxConfirmTarget = 25; + payTxFee = CFeeRate(ui->customFee->value()); + fPayAtLeastCustomFee = ui->radioCustomAtLeast->isChecked(); + } + + fSendFreeTransactions = ui->checkBoxFreeTx->isChecked(); +} + +void SendCoinsDialog::updateFeeMinimizedLabel() +{ + if(!model || !model->getOptionsModel()) + return; + + if (ui->radioSmartFee->isChecked()) + ui->labelFeeMinimized->setText(ui->labelSmartFee->text()); + else { + ui->labelFeeMinimized->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), ui->customFee->value()) + + ((ui->radioCustomPerKilobyte->isChecked()) ? "/kB" : "")); + } +} + +void SendCoinsDialog::updateMinFeeLabel() +{ + if (model && model->getOptionsModel()) + ui->checkBoxMinimumFee->setText(tr("Pay only the minimum fee of %1").arg( + BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), CWallet::minTxFee.GetFeePerK()) + "/kB") + ); +} + +void SendCoinsDialog::updateSmartFeeLabel() +{ + if(!model || !model->getOptionsModel()) + return; + + int nBlocksToConfirm = (int)25 - (int)std::max(0, std::min(24, ui->sliderSmartFee->value())); + CFeeRate feeRate = mempool.estimateFee(nBlocksToConfirm); + if (feeRate <= CFeeRate(0)) // not enough data => minfee + { + ui->labelSmartFee->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), CWallet::minTxFee.GetFeePerK()) + "/kB"); + ui->labelSmartFee2->show(); // (Smart fee not initialized yet. This usually takes a few blocks...) + ui->labelFeeEstimation->setText(""); + } + else + { + ui->labelSmartFee->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), feeRate.GetFeePerK()) + "/kB"); + ui->labelSmartFee2->hide(); + ui->labelFeeEstimation->setText(tr("Estimated to begin confirmation within %1 block(s).").arg(nBlocksToConfirm)); + } + + updateFeeMinimizedLabel(); +} + // Coin Control: copy label "Quantity" to clipboard void SendCoinsDialog::coinControlClipboardQuantity() { @@ -462,19 +648,19 @@ void SendCoinsDialog::coinControlClipboardAmount() // Coin Control: copy label "Fee" to clipboard void SendCoinsDialog::coinControlClipboardFee() { - GUIUtil::setClipboard(ui->labelCoinControlFee->text().left(ui->labelCoinControlFee->text().indexOf(" "))); + GUIUtil::setClipboard(ui->labelCoinControlFee->text().left(ui->labelCoinControlFee->text().indexOf(" ")).replace("~", "")); } // Coin Control: copy label "After fee" to clipboard void SendCoinsDialog::coinControlClipboardAfterFee() { - GUIUtil::setClipboard(ui->labelCoinControlAfterFee->text().left(ui->labelCoinControlAfterFee->text().indexOf(" "))); + GUIUtil::setClipboard(ui->labelCoinControlAfterFee->text().left(ui->labelCoinControlAfterFee->text().indexOf(" ")).replace("~", "")); } // Coin Control: copy label "Bytes" to clipboard void SendCoinsDialog::coinControlClipboardBytes() { - GUIUtil::setClipboard(ui->labelCoinControlBytes->text()); + GUIUtil::setClipboard(ui->labelCoinControlBytes->text().replace("~", "")); } // Coin Control: copy label "Priority" to clipboard @@ -492,7 +678,7 @@ void SendCoinsDialog::coinControlClipboardLowOutput() // Coin Control: copy label "Change" to clipboard void SendCoinsDialog::coinControlClipboardChange() { - GUIUtil::setClipboard(ui->labelCoinControlChange->text().left(ui->labelCoinControlChange->text().indexOf(" "))); + GUIUtil::setClipboard(ui->labelCoinControlChange->text().left(ui->labelCoinControlChange->text().indexOf(" ")).replace("~", "")); } // Coin Control: settings menu - coin control enabled/disabled by user diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h index eec661cbd0..15d39782a1 100644 --- a/src/qt/sendcoinsdialog.h +++ b/src/qt/sendcoinsdialog.h @@ -10,6 +10,7 @@ #include #include +class ClientModel; class OptionsModel; class SendCoinsEntry; class SendCoinsRecipient; @@ -31,6 +32,7 @@ public: explicit SendCoinsDialog(QWidget *parent = 0); ~SendCoinsDialog(); + void setClientModel(ClientModel *clientModel); void setModel(WalletModel *model); /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907). @@ -52,16 +54,22 @@ public slots: private: Ui::SendCoinsDialog *ui; + ClientModel *clientModel; WalletModel *model; bool fNewRecipientAllowed; + bool fFeeMinimized; // Process WalletModel::SendCoinsReturn and generate a pair consisting // of a message and message flags for use in emit message(). // Additional parameter msgArg can be used via .arg(msgArg). void processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg = QString()); + void minimizeFeeSection(bool fMinimize); + void updateFeeMinimizedLabel(); private slots: void on_sendButton_clicked(); + void on_buttonChooseFee_clicked(); + void on_buttonMinimizeFee_clicked(); void removeEntry(SendCoinsEntry* entry); void updateDisplayUnit(); void coinControlFeatureChanged(bool); @@ -77,6 +85,11 @@ private slots: void coinControlClipboardPriority(); void coinControlClipboardLowOutput(); void coinControlClipboardChange(); + void setMinimumFee(); + void updateFeeSectionControls(); + void updateMinFeeLabel(); + void updateSmartFeeLabel(); + void updateGlobalFeeVariables(); signals: // Fired when a message should be reported to the user diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index f7b1552f3e..b20465794d 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -277,6 +277,10 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact CClientUIInterface::MSG_ERROR); return TransactionCreationFailed; } + + // reject insane fee > 0.1 bitcoin + if (nFeeRequired > 10000000) + return InsaneFee; } return SendCoinsReturn(OK); diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 0c6077963d..d7e391f8d1 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -110,7 +110,8 @@ public: AmountWithFeeExceedsBalance, DuplicateAddress, TransactionCreationFailed, // Error returned when wallet is still locked - TransactionCommitFailed + TransactionCommitFailed, + InsaneFee }; enum EncryptionStatus diff --git a/src/qt/walletmodeltransaction.cpp b/src/qt/walletmodeltransaction.cpp index ddd2d09bb5..e9e20c7d51 100644 --- a/src/qt/walletmodeltransaction.cpp +++ b/src/qt/walletmodeltransaction.cpp @@ -31,6 +31,11 @@ CWalletTx *WalletModelTransaction::getTransaction() return walletTransaction; } +unsigned int WalletModelTransaction::getTransactionSize() +{ + return (!walletTransaction ? 0 : (::GetSerializeSize(*(CTransaction*)walletTransaction, SER_NETWORK, PROTOCOL_VERSION))); +} + CAmount WalletModelTransaction::getTransactionFee() { return fee; diff --git a/src/qt/walletmodeltransaction.h b/src/qt/walletmodeltransaction.h index a880384ed6..4272529abe 100644 --- a/src/qt/walletmodeltransaction.h +++ b/src/qt/walletmodeltransaction.h @@ -25,6 +25,7 @@ public: QList getRecipients(); CWalletTx *getTransaction(); + unsigned int getTransactionSize(); void setTransactionFee(const CAmount& newFee); CAmount getTransactionFee(); diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index 3b8fdd7e5f..9bab180108 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -101,6 +101,7 @@ void WalletView::setClientModel(ClientModel *clientModel) this->clientModel = clientModel; overviewPage->setClientModel(clientModel); + sendCoinsPage->setClientModel(clientModel); } void WalletView::setWalletModel(WalletModel *walletModel) diff --git a/src/txmempool.h b/src/txmempool.h index 0d3c8bba6a..e68b218154 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -15,11 +15,16 @@ class CAutoFile; +inline double AllowFreeThreshold() +{ + return COIN * 144 / 250; +} + inline bool AllowFree(double dPriority) { // Large (in bytes) low-priority (new, small-coin) transactions // need a fee. - return dPriority > COIN * 144 / 250; + return dPriority > AllowFreeThreshold(); } /** Fake height value used in CCoins to signify they are only in the memory pool (since 0.8) */ diff --git a/src/wallet.cpp b/src/wallet.cpp index 2d59506bab..5aea9881cd 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -28,7 +28,7 @@ using namespace std; CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE); unsigned int nTxConfirmTarget = 1; bool bSpendZeroConfChange = true; -bool fSendFreeTransactions = true; +bool fSendFreeTransactions = false; bool fPayAtLeastCustomFee = true; /** @@ -1384,10 +1384,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, { LOCK2(cs_main, cs_wallet); { - if (fPayAtLeastCustomFee) - nFeeRet = payTxFee.GetFeePerK(); - else - nFeeRet = 0; + nFeeRet = 0; while (true) { txNew.vin.clear(); @@ -1636,6 +1633,9 @@ CAmount CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarge // prevent user from paying a non-sense fee (like 1 satoshi): 0 < fee < minRelayFee if (nFeeNeeded > 0 && nFeeNeeded < ::minRelayTxFee.GetFee(nTxBytes)) nFeeNeeded = ::minRelayTxFee.GetFee(nTxBytes); + // user selected total at least (default=true) + if (fPayAtLeastCustomFee && nFeeNeeded > 0 && nFeeNeeded < payTxFee.GetFeePerK()) + nFeeNeeded = payTxFee.GetFeePerK(); // User didn't set: use -txconfirmtarget to estimate... if (nFeeNeeded == 0) nFeeNeeded = pool.estimateFee(nConfirmTarget).GetFee(nTxBytes); From b5d1b1092998bc95313856d535c632ea5a8f9104 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 19 Nov 2014 16:15:39 +0100 Subject: [PATCH 1054/1288] doc: add libgmp dependency for secp256k1 Also reorganize the document a bit. --- doc/build-unix.md | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/doc/build-unix.md b/doc/build-unix.md index fb5eaec431..e03dc8181a 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -27,31 +27,25 @@ This will build bitcoin-qt as well if the dependencies are met. Dependencies --------------------- +These dependencies are required: + Library | Purpose | Description ------------|------------------|---------------------- libssl | SSL Support | Secure communications - libdb4.8 | Berkeley DB | Wallet storage libboost | Boost | C++ Library - miniupnpc | UPnP Support | Optional firewall-jumping support - qt | GUI | GUI toolkit - protobuf | Payments in GUI | Data interchange format used for payment protocol - libqrencode | QR codes in GUI | Optional for generating QR codes + libgmp | secp256k1 | Arbitrary-precision arithmetic (version >= 3.1) -[miniupnpc](http://miniupnp.free.fr/) may be used for UPnP port mapping. It can be downloaded from [here]( -http://miniupnp.tuxfamily.org/files/). UPnP support is compiled in and -turned off by default. See the configure options for upnp behavior desired: +Optional dependencies: - --without-miniupnpc No UPnP support miniupnp not required - --disable-upnp-default (the default) UPnP support turned off by default at runtime - --enable-upnp-default UPnP support turned on by default at runtime + Library | Purpose | Description + ------------|------------------|---------------------- + miniupnpc | UPnP Support | Firewall-jumping support + libdb4.8 | Berkeley DB | Wallet storage (only needed when wallet enabled) + qt | GUI | GUI toolkit (only needed when GUI enabled) + protobuf | Payments in GUI | Data interchange format used for payment protocol (only needed when GUI enabled) + libqrencode | QR codes in GUI | Optional for generating QR codes (only needed when GUI enabled) -Licenses of statically linked libraries: - Berkeley DB New BSD license with additional requirement that linked - software must be free open source - Boost MIT-like license - miniupnpc New (3-clause) BSD license - -- For the versions used in the release, see doc/release-process.md under *Fetch and build inputs*. +For the versions used in the release, see [release-process.md](release-process.md) under *Fetch and build inputs*. System requirements -------------------- @@ -64,7 +58,7 @@ Dependency Build Instructions: Ubuntu & Debian ---------------------------------------------- Build requirements: - sudo apt-get install build-essential libtool autotools-dev autoconf pkg-config libssl-dev + sudo apt-get install build-essential libtool autotools-dev autoconf pkg-config libssl-dev libgmp-dev for Ubuntu 12.04 and later or Debian 7 and later libboost-all-dev has to be installed: @@ -129,6 +123,17 @@ symbols, which reduces the executable size by about 90%. miniupnpc --------- + +[miniupnpc](http://miniupnp.free.fr/) may be used for UPnP port mapping. It can be downloaded from [here]( +http://miniupnp.tuxfamily.org/files/). UPnP support is compiled in and +turned off by default. See the configure options for upnp behavior desired: + + --without-miniupnpc No UPnP support miniupnp not required + --disable-upnp-default (the default) UPnP support turned off by default at runtime + --enable-upnp-default UPnP support turned on by default at runtime + +To build: + tar -xzvf miniupnpc-1.6.tar.gz cd miniupnpc-1.6 make From 8656dbb095bc392d8d348bb68124696a033997f8 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Wed, 19 Nov 2014 15:36:10 -0500 Subject: [PATCH 1055/1288] Port/fix txnmall.sh regression test Ported txnmall.sh to Python, and updated to match recent transaction malleability changes. I also modified it so it tests both double-spending confirmed and unconfirmed (only-in-mempool) transactions. Renamed to txn_doublespend, since that is really what is being tested. And told the pull-tester to run both variations on this test. --- qa/pull-tester/rpc-tests.sh | 2 + qa/rpc-tests/txn_doublespend.py | 120 +++++++++++++++++++++++++ qa/rpc-tests/txnmall.sh | 152 -------------------------------- 3 files changed, 122 insertions(+), 152 deletions(-) create mode 100755 qa/rpc-tests/txn_doublespend.py delete mode 100755 qa/rpc-tests/txnmall.sh diff --git a/qa/pull-tester/rpc-tests.sh b/qa/pull-tester/rpc-tests.sh index 0b5ad20642..cc24a67c08 100755 --- a/qa/pull-tester/rpc-tests.sh +++ b/qa/pull-tester/rpc-tests.sh @@ -18,6 +18,8 @@ fi if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then ${BUILDDIR}/qa/rpc-tests/wallet.sh "${BUILDDIR}/src" ${BUILDDIR}/qa/rpc-tests/listtransactions.py --srcdir "${BUILDDIR}/src" + ${BUILDDIR}/qa/rpc-tests/txn_doublespend.py --srcdir "${BUILDDIR}/src" + ${BUILDDIR}/qa/rpc-tests/txn_doublespend.py --mineblock --srcdir "${BUILDDIR}/src" #${BUILDDIR}/qa/rpc-tests/forknotify.py --srcdir "${BUILDDIR}/src" else echo "No rpc tests to run. Wallet, utils, and bitcoind must all be enabled" diff --git a/qa/rpc-tests/txn_doublespend.py b/qa/rpc-tests/txn_doublespend.py new file mode 100755 index 0000000000..6125147ebc --- /dev/null +++ b/qa/rpc-tests/txn_doublespend.py @@ -0,0 +1,120 @@ +#!/usr/bin/env python +# Copyright (c) 2014 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +# +# Test proper accounting with malleable transactions +# + +from test_framework import BitcoinTestFramework +from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException +from decimal import Decimal +from util import * +import os +import shutil + +class TxnMallTest(BitcoinTestFramework): + + def add_options(self, parser): + parser.add_option("--mineblock", dest="mine_block", default=False, action="store_true", + help="Test double-spend of 1-confirmed transaction") + + def setup_network(self): + # Start with split network: + return super(TxnMallTest, self).setup_network(True) + + def run_test(self): + # All nodes should start with 1,250 BTC: + starting_balance = 1250 + for i in range(4): + assert_equal(self.nodes[i].getbalance(), starting_balance) + self.nodes[i].getnewaddress("") # bug workaround, coins generated assigned to first getnewaddress! + + # Assign coins to foo and bar accounts: + self.nodes[0].move("", "foo", 1220) + self.nodes[0].move("", "bar", 30) + assert_equal(self.nodes[0].getbalance(""), 0) + + # Coins are sent to node1_address + node1_address = self.nodes[1].getnewaddress("from0") + + # First: use raw transaction API to send 1210 BTC to node1_address, + # but don't broadcast: + (total_in, inputs) = gather_inputs(self.nodes[0], 1210) + change_address = self.nodes[0].getnewaddress("foo") + outputs = {} + outputs[change_address] = 40 + outputs[node1_address] = 1210 + rawtx = self.nodes[0].createrawtransaction(inputs, outputs) + doublespend = self.nodes[0].signrawtransaction(rawtx) + assert_equal(doublespend["complete"], True) + + # Create two transaction from node[0] to node[1]; the + # second must spend change from the first because the first + # spends all mature inputs: + txid1 = self.nodes[0].sendfrom("foo", node1_address, 1210, 0) + txid2 = self.nodes[0].sendfrom("bar", node1_address, 20, 0) + + # Have node0 mine a block: + if (self.options.mine_block): + self.nodes[0].setgenerate(True, 1) + sync_blocks(self.nodes[0:2]) + + tx1 = self.nodes[0].gettransaction(txid1) + tx2 = self.nodes[0].gettransaction(txid2) + + # Node0's balance should be starting balance, plus 50BTC for another + # matured block, minus 1210, minus 20, and minus transaction fees: + expected = starting_balance + if self.options.mine_block: expected += 50 + expected += tx1["amount"] + tx1["fee"] + expected += tx2["amount"] + tx2["fee"] + assert_equal(self.nodes[0].getbalance(), expected) + + # foo and bar accounts should be debited: + assert_equal(self.nodes[0].getbalance("foo"), 1220+tx1["amount"]+tx1["fee"]) + assert_equal(self.nodes[0].getbalance("bar"), 30+tx2["amount"]+tx2["fee"]) + + if self.options.mine_block: + assert_equal(tx1["confirmations"], 1) + assert_equal(tx2["confirmations"], 1) + # Node1's "from0" balance should be both transaction amounts: + assert_equal(self.nodes[1].getbalance("from0"), -(tx1["amount"]+tx2["amount"])) + else: + assert_equal(tx1["confirmations"], 0) + assert_equal(tx2["confirmations"], 0) + + # Now give doublespend to miner: + mutated_txid = self.nodes[2].sendrawtransaction(doublespend["hex"]) + # ... mine a block... + self.nodes[2].setgenerate(True, 1) + + # Reconnect the split network, and sync chain: + connect_nodes(self.nodes[1], 2) + self.nodes[2].setgenerate(True, 1) # Mine another block to make sure we sync + sync_blocks(self.nodes) + + # Re-fetch transaction info: + tx1 = self.nodes[0].gettransaction(txid1) + tx2 = self.nodes[0].gettransaction(txid2) + + # Both transactions should be conflicted + assert_equal(tx1["confirmations"], -1) + assert_equal(tx2["confirmations"], -1) + + # Node0's total balance should be starting balance, plus 100BTC for + # two more matured blocks, minus 1210 for the double-spend: + expected = starting_balance + 100 - 1210 + assert_equal(self.nodes[0].getbalance(), expected) + assert_equal(self.nodes[0].getbalance("*"), expected) + + # foo account should be debited, but bar account should not: + assert_equal(self.nodes[0].getbalance("foo"), 1220-1210) + assert_equal(self.nodes[0].getbalance("bar"), 30) + + # Node1's "from" account balance should be just the mutated send: + assert_equal(self.nodes[1].getbalance("from0"), 1210) + +if __name__ == '__main__': + TxnMallTest().main() diff --git a/qa/rpc-tests/txnmall.sh b/qa/rpc-tests/txnmall.sh deleted file mode 100755 index 1296d54d92..0000000000 --- a/qa/rpc-tests/txnmall.sh +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) 2014 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -# Test proper accounting with malleable transactions - -if [ $# -lt 1 ]; then - echo "Usage: $0 path_to_binaries" - echo "e.g. $0 ../../src" - echo "Env vars BITCOIND and BITCOINCLI may be used to specify the exact binaries used" - exit 1 -fi - -set -f - -BITCOIND=${BITCOIND:-${1}/bitcoind} -CLI=${BITCOINCLI:-${1}/bitcoin-cli} - -DIR="${BASH_SOURCE%/*}" -SENDANDWAIT="${DIR}/send.sh" -if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi -. "$DIR/util.sh" - -D=$(mktemp -d test.XXXXX) - -# Two nodes; one will play the part of merchant, the -# other an evil transaction-mutating miner. - -D1=${D}/node1 -CreateDataDir $D1 port=11000 rpcport=11001 -B1ARGS="-datadir=$D1" -$BITCOIND $B1ARGS & -B1PID=$! - -D2=${D}/node2 -CreateDataDir $D2 port=11010 rpcport=11011 -B2ARGS="-datadir=$D2" -$BITCOIND $B2ARGS & -B2PID=$! - -# Wait until both nodes are at the same block number -function WaitBlocks { - while : - do - sleep 1 - declare -i BLOCKS1=$( GetBlocks $B1ARGS ) - declare -i BLOCKS2=$( GetBlocks $B2ARGS ) - if (( BLOCKS1 == BLOCKS2 )) - then - break - fi - done -} - -# Wait until node has $N peers -function WaitPeers { - while : - do - declare -i PEERS=$( $CLI $1 getconnectioncount ) - if (( PEERS == "$2" )) - then - break - fi - sleep 1 - done -} - -echo "Generating test blockchain..." - -# Start with B2 connected to B1: -$CLI $B2ARGS addnode 127.0.0.1:11000 onetry -WaitPeers "$B1ARGS" 1 - -# 1 block, 50 XBT each == 50 XBT -$CLI $B1ARGS setgenerate true 1 - -WaitBlocks -# 100 blocks, 0 mature == 0 XBT -$CLI $B2ARGS setgenerate true 100 -WaitBlocks - -CheckBalance "$B1ARGS" 50 -CheckBalance "$B2ARGS" 0 - -# restart B2 with no connection -$CLI $B2ARGS stop > /dev/null 2>&1 -wait $B2PID -$BITCOIND $B2ARGS & -B2PID=$! - -B2ADDRESS=$( $CLI $B2ARGS getaccountaddress "from1" ) - -# Have B1 create two transactions; second will -# spend change from first, since B1 starts with only a single -# 50 bitcoin output: -$CLI $B1ARGS move "" "foo" 10.0 > /dev/null -$CLI $B1ARGS move "" "bar" 10.0 > /dev/null -TXID1=$( $CLI $B1ARGS sendfrom foo $B2ADDRESS 1.0 0) -TXID2=$( $CLI $B1ARGS sendfrom bar $B2ADDRESS 2.0 0) - -# Mutate TXID1 and add it to B2's memory pool: -RAWTX1=$( $CLI $B1ARGS getrawtransaction $TXID1 ) -# RAWTX1 is hex-encoded, serialized transaction. So each -# byte is two characters; we'll prepend the first -# "push" in the scriptsig with OP_PUSHDATA1 (0x4c), -# and add one to the length of the signature. -# Fields are fixed; from the beginning: -# 4-byte version -# 1-byte varint number-of inputs (one in this case) -# 32-byte previous txid -# 4-byte previous output -# 1-byte varint length-of-scriptsig -# 1-byte PUSH this many bytes onto stack -# ... etc -# So: to mutate, we want to get byte 41 (hex characters 82-83), -# increment it, and insert 0x4c after it. -L=${RAWTX1:82:2} -NEWLEN=$( printf "%x" $(( 16#$L + 1 )) ) -MUTATEDTX1=${RAWTX1:0:82}${NEWLEN}4c${RAWTX1:84} -# ... give mutated tx1 to B2: -MUTATEDTXID=$( $CLI $B2ARGS sendrawtransaction $MUTATEDTX1 ) - -echo "TXID1: " $TXID1 -echo "Mutated: " $MUTATEDTXID - -# Re-connect nodes, and have B2 mine a block -# containing the mutant: -$CLI $B2ARGS addnode 127.0.0.1:11000 onetry -$CLI $B2ARGS setgenerate true 1 -WaitBlocks - -# B1 should have 49 BTC; the 2 BTC send is -# conflicted, and should not count in -# balances. -CheckBalance "$B1ARGS" 49 -CheckBalance "$B1ARGS" 49 "*" -CheckBalance "$B1ARGS" 9 "foo" -CheckBalance "$B1ARGS" 10 "bar" - -# B2 should have 51 BTC -CheckBalance "$B2ARGS" 51 -CheckBalance "$B2ARGS" 1 "from1" - -$CLI $B2ARGS stop > /dev/null 2>&1 -wait $B2PID -$CLI $B1ARGS stop > /dev/null 2>&1 -wait $B1PID - -echo "Tests successful, cleaning up" -rm -rf $D -exit 0 From 77c38bb5cc7349b5b0159f04e769f863e76aad7b Mon Sep 17 00:00:00 2001 From: Glenn Willen Date: Wed, 19 Nov 2014 15:13:02 -0800 Subject: [PATCH 1056/1288] Truthier error message when rpcpassword is missing --- src/rpcserver.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 01005c1cee..7022c50375 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -565,13 +565,8 @@ void StartRPCThreads() { unsigned char rand_pwd[32]; GetRandBytes(rand_pwd, 32); - string strWhatAmI = "To use bitcoind"; - if (mapArgs.count("-server")) - strWhatAmI = strprintf(_("To use the %s option"), "\"-server\""); - else if (mapArgs.count("-daemon")) - strWhatAmI = strprintf(_("To use the %s option"), "\"-daemon\""); uiInterface.ThreadSafeMessageBox(strprintf( - _("%s, you must set a rpcpassword in the configuration file:\n" + _("To use bitcoind, or the -server option to bitcoin-qt, you must set an rpcpassword in the configuration file:\n" "%s\n" "It is recommended you use the following random password:\n" "rpcuser=bitcoinrpc\n" @@ -581,7 +576,6 @@ void StartRPCThreads() "If the file does not exist, create it with owner-readable-only file permissions.\n" "It is also recommended to set alertnotify so you are notified of problems;\n" "for example: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com\n"), - strWhatAmI, GetConfigFile().string(), EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32)), "", CClientUIInterface::MSG_ERROR | CClientUIInterface::SECURE); From 9765a50cbdbcb45cc87c51e301663c2b29ff1bf8 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Mon, 10 Sep 2012 02:55:03 +0000 Subject: [PATCH 1057/1288] Implement BIP 23 Block Proposal --- src/rpcmining.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 577f377796..0d49fb34d2 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -379,6 +379,36 @@ Value getblocktemplate(const Array& params, bool fHelp) else throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode"); lpval = find_value(oparam, "longpollid"); + + if (strMode == "proposal") + { + const Value& dataval = find_value(oparam, "data"); + if (dataval.type() != str_type) + throw JSONRPCError(RPC_TYPE_ERROR, "Missing data String key for proposal"); + + CBlock block; + if (!DecodeHexBlk(block, dataval.get_str())) + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Block decode failed"); + + uint256 hash = block.GetHash(); + BlockMap::iterator mi = mapBlockIndex.find(hash); + if (mi != mapBlockIndex.end()) { + CBlockIndex *pindex = mi->second; + if (pindex->IsValid(BLOCK_VALID_SCRIPTS)) + return "duplicate"; + if (pindex->nStatus & BLOCK_FAILED_MASK) + return "duplicate-invalid"; + return "duplicate-inconclusive"; + } + + CBlockIndex* const pindexPrev = chainActive.Tip(); + // TestBlockValidity only supports blocks built on the current Tip + if (block.hashPrevBlock != pindexPrev->GetBlockHash()) + return "inconclusive-not-best-prevblk"; + CValidationState state; + TestBlockValidity(state, block, pindexPrev, false, true); + return BIP22ValidationResult(state); + } } if (strMode != "template") @@ -481,6 +511,8 @@ Value getblocktemplate(const Array& params, bool fHelp) UpdateTime(pblock, pindexPrev); pblock->nNonce = 0; + static const Array aCaps = boost::assign::list_of("proposal"); + Array transactions; map setTxIndex; int i = 0; @@ -527,6 +559,7 @@ Value getblocktemplate(const Array& params, bool fHelp) } Object result; + result.push_back(Pair("capabilities", aCaps)); result.push_back(Pair("version", pblock->nVersion)); result.push_back(Pair("previousblockhash", pblock->hashPrevBlock.GetHex())); result.push_back(Pair("transactions", transactions)); From bc6cb4177b143bf1c3d0fad065d3a4de6df97ef9 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Mon, 17 Nov 2014 18:47:40 +0000 Subject: [PATCH 1058/1288] QA RPC tests: Add tests block block proposals --- ...mplate.py => getblocktemplate_longpoll.py} | 6 +- qa/rpc-tests/getblocktemplate_proposals.py | 182 ++++++++++++++++++ 2 files changed, 184 insertions(+), 4 deletions(-) rename qa/rpc-tests/{getblocktemplate.py => getblocktemplate_longpoll.py} (96%) create mode 100755 qa/rpc-tests/getblocktemplate_proposals.py diff --git a/qa/rpc-tests/getblocktemplate.py b/qa/rpc-tests/getblocktemplate_longpoll.py similarity index 96% rename from qa/rpc-tests/getblocktemplate.py rename to qa/rpc-tests/getblocktemplate_longpoll.py index 500662bf87..263a5f6d59 100755 --- a/qa/rpc-tests/getblocktemplate.py +++ b/qa/rpc-tests/getblocktemplate_longpoll.py @@ -3,8 +3,6 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -# Exercise the listtransactions API - from test_framework import BitcoinTestFramework from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from util import * @@ -46,7 +44,7 @@ class LongpollThread(threading.Thread): def run(self): self.node.getblocktemplate({'longpollid':self.longpollid}) -class GetBlockTemplateTest(BitcoinTestFramework): +class GetBlockTemplateLPTest(BitcoinTestFramework): ''' Test longpolling with getblocktemplate. ''' @@ -90,5 +88,5 @@ class GetBlockTemplateTest(BitcoinTestFramework): assert(not thr.is_alive()) if __name__ == '__main__': - GetBlockTemplateTest().main() + GetBlockTemplateLPTest().main() diff --git a/qa/rpc-tests/getblocktemplate_proposals.py b/qa/rpc-tests/getblocktemplate_proposals.py new file mode 100755 index 0000000000..0f7859584a --- /dev/null +++ b/qa/rpc-tests/getblocktemplate_proposals.py @@ -0,0 +1,182 @@ +#!/usr/bin/env python +# Copyright (c) 2014 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +from test_framework import BitcoinTestFramework +from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException +from util import * + +from binascii import a2b_hex, b2a_hex +from hashlib import sha256 +from struct import pack + + +def check_array_result(object_array, to_match, expected): + """ + Pass in array of JSON objects, a dictionary with key/value pairs + to match against, and another dictionary with expected key/value + pairs. + """ + num_matched = 0 + for item in object_array: + all_match = True + for key,value in to_match.items(): + if item[key] != value: + all_match = False + if not all_match: + continue + for key,value in expected.items(): + if item[key] != value: + raise AssertionError("%s : expected %s=%s"%(str(item), str(key), str(value))) + num_matched = num_matched+1 + if num_matched == 0: + raise AssertionError("No objects matched %s"%(str(to_match))) + +def b2x(b): + return b2a_hex(b).decode('ascii') + +# NOTE: This does not work for signed numbers (set the high bit) or zero (use b'\0') +def encodeUNum(n): + s = bytearray(b'\1') + while n > 127: + s[0] += 1 + s.append(n % 256) + n //= 256 + s.append(n) + return bytes(s) + +def varlenEncode(n): + if n < 0xfd: + return pack(' 1: + n = [] + if len(cur) & 1: + cur.append(cur[-1]) + for i in range(0, len(cur), 2): + n.append(dblsha(cur[i] + cur[i+1])) + cur = n + return cur[0] + +def template_to_bytes(tmpl, txlist): + blkver = pack(' Date: Tue, 18 Nov 2014 19:09:20 +0000 Subject: [PATCH 1059/1288] submitblock: Check for duplicate submissions explicitly --- src/rpcmining.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 0d49fb34d2..7a2b6c7789 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -618,15 +618,32 @@ Value submitblock(const Array& params, bool fHelp) + HelpExampleRpc("submitblock", "\"mydata\"") ); - CBlock pblock; - if (!DecodeHexBlk(pblock, params[0].get_str())) + CBlock block; + if (!DecodeHexBlk(block, params[0].get_str())) throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Block decode failed"); + uint256 hash = block.GetHash(); + BlockMap::iterator mi = mapBlockIndex.find(hash); + if (mi != mapBlockIndex.end()) { + CBlockIndex *pindex = mi->second; + if (pindex->IsValid(BLOCK_VALID_SCRIPTS)) + return "duplicate"; + if (pindex->nStatus & BLOCK_FAILED_MASK) + return "duplicate-invalid"; + // Otherwise, we might only have the header - process the block before returning + } + CValidationState state; - submitblock_StateCatcher sc(pblock.GetHash()); + submitblock_StateCatcher sc(block.GetHash()); RegisterValidationInterface(&sc); - bool fAccepted = ProcessNewBlock(state, NULL, &pblock); + bool fAccepted = ProcessNewBlock(state, NULL, &block); UnregisterValidationInterface(&sc); + if (mi != mapBlockIndex.end()) + { + if (fAccepted && !sc.found) + return "duplicate-inconclusive"; + return "duplicate"; + } if (fAccepted) { if (!sc.found) From 72fb3d295ab14d7e6b876d709be23bae1289dab2 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Thu, 20 Nov 2014 10:19:29 +0800 Subject: [PATCH 1060/1288] Update comments in src/rpc* to be doxygen compatible --- src/rpcblockchain.cpp | 6 ++-- src/rpcclient.cpp | 10 +++--- src/rpcclient.h | 4 +-- src/rpcdump.cpp | 2 +- src/rpcmining.cpp | 12 ++++--- src/rpcmisc.cpp | 10 +++--- src/rpcnet.cpp | 2 +- src/rpcprotocol.cpp | 34 +++++++++--------- src/rpcprotocol.h | 72 +++++++++++++++++++-------------------- src/rpcrawtransaction.cpp | 2 +- src/rpcserver.h | 7 ++-- src/rpcwallet.cpp | 2 +- 12 files changed, 83 insertions(+), 80 deletions(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index a7cd63bd95..7919fb1a0c 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "checkpoints.h" @@ -468,7 +468,7 @@ Value getblockchaininfo(const Array& params, bool fHelp) return obj; } -/* Comparison function for sorting the getchaintips heads. */ +/** Comparison function for sorting the getchaintips heads. */ struct CompareBlocksByHeight { bool operator()(const CBlockIndex* a, const CBlockIndex* b) const diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index 7a1f1918f6..03ce9acbbf 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "rpcclient.h" @@ -18,8 +18,8 @@ using namespace json_spirit; class CRPCConvertParam { public: - std::string methodName; // method whose params want conversion - int paramIdx; // 0-based idx of param to convert + std::string methodName; //! method whose params want conversion + int paramIdx; //! 0-based idx of param to convert }; static const CRPCConvertParam vRPCConvertParams[] = @@ -116,7 +116,7 @@ CRPCConvertTable::CRPCConvertTable() static CRPCConvertTable rpcCvtTable; -// Convert strings to command-specific RPC representation +/** Convert strings to command-specific RPC representation */ Array RPCConvertValues(const std::string &strMethod, const std::vector &strParams) { Array params; diff --git a/src/rpcclient.h b/src/rpcclient.h index cd11f177e8..a91c2eb033 100644 --- a/src/rpcclient.h +++ b/src/rpcclient.h @@ -1,6 +1,6 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_RPCCLIENT_H diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index 9da0a7d091..c3ffe38cc3 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "base58.h" diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 2bde02c0a1..81120ba981 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "amount.h" @@ -28,9 +28,11 @@ using namespace json_spirit; using namespace std; -// Return average network hashes per second based on the last 'lookup' blocks, -// or from the last difficulty change if 'lookup' is nonpositive. -// If 'height' is nonnegative, compute the estimate at the time when a given block was found. +/** + * Return average network hashes per second based on the last 'lookup' blocks, + * or from the last difficulty change if 'lookup' is nonpositive. + * If 'height' is nonnegative, compute the estimate at the time when a given block was found. + */ Value GetNetworkHashPS(int lookup, int height) { CBlockIndex *pb = chainActive.Tip(); diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 31eaae6162..90b9c99caa 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "base58.h" @@ -30,7 +30,7 @@ using namespace std; /** * @note Do not add or change anything in the information returned by this - * method. `getinfo` exists for backwards-compatibilty only. It combines + * method. `getinfo` exists for backwards-compatibility only. It combines * information from wildly different sources in the program, which is a mess, * and is thus planned to be deprecated eventually. * @@ -198,9 +198,9 @@ Value validateaddress(const Array& params, bool fHelp) return ret; } -// -// Used by addmultisigaddress / createmultisig: -// +/** + * Used by addmultisigaddress / createmultisig: + */ CScript _createmultisig_redeemScript(const Array& params) { int nRequired = params[0].get_int(); diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 46b5f3d7ad..6ddbd62fca 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "rpcserver.h" diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp index c2ce73106f..2f7c491f3d 100644 --- a/src/rpcprotocol.cpp +++ b/src/rpcprotocol.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "rpcprotocol.h" @@ -30,15 +30,15 @@ using namespace boost; using namespace boost::asio; using namespace json_spirit; -// Number of bytes to allocate and read at most at once in post data +//! Number of bytes to allocate and read at most at once in post data const size_t POST_READ_SIZE = 256 * 1024; -// -// HTTP protocol -// -// This ain't Apache. We're just using HTTP header for the length field -// and to be compatible with other JSON-RPC implementations. -// +/** + * HTTP protocol + * + * This ain't Apache. We're just using HTTP header for the length field + * and to be compatible with other JSON-RPC implementations. + */ string HTTPPost(const string& strMsg, const map& mapRequestHeaders) { @@ -246,15 +246,15 @@ int ReadHTTPMessage(std::basic_istream& stream, map class SSLIOStreamDevice : public boost::iostreams::device { public: diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index d3ce3b3191..25734f4930 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "base58.h" diff --git a/src/rpcserver.h b/src/rpcserver.h index b3234f65f2..7395fc23c6 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -40,12 +40,13 @@ void StartRPCThreads(); * If real RPC threads have already been started this is a no-op. */ void StartDummyRPCThread(); -/* Stop RPC threads */ +/** Stop RPC threads */ void StopRPCThreads(); -/* Query whether RPC is running */ +/** Query whether RPC is running */ bool IsRPCRunning(); -/* Set the RPC warmup status. When this is done, all RPC calls will error out +/** + * Set the RPC warmup status. When this is done, all RPC calls will error out * immediately with RPC_IN_WARMUP. */ void SetRPCWarmupStatus(const std::string& newStatus); diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 4d9e5ea137..d2d14ad9f4 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "amount.h" From e0077de5de538dd51b5dbd04e05c998d40b20b30 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 14 Oct 2014 18:03:52 -0400 Subject: [PATCH 1061/1288] build: make a distinction between static app ldflags and static lib ldflags For windows builds, exe's are always static, but libs should still conform to --enabled-shared and --enable-static. --- configure.ac | 7 ++----- src/Makefile.am | 6 +++--- src/Makefile.qt.include | 2 +- src/Makefile.qttest.include | 2 +- src/Makefile.test.include | 2 +- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index c0489f5be7..765b398925 100644 --- a/configure.ac +++ b/configure.ac @@ -201,12 +201,9 @@ case $host in AC_CHECK_LIB([iphlpapi], [main],, AC_MSG_ERROR(lib missing)) AC_CHECK_LIB([crypt32], [main],, AC_MSG_ERROR(lib missing)) - AX_CHECK_LINK_FLAG([[-static-libgcc]],[LDFLAGS="$LDFLAGS -static-libgcc"]) - AX_CHECK_LINK_FLAG([[-static-libstdc++]],[LDFLAGS="$LDFLAGS -static-libstdc++"]) - # -static is interpreted by libtool, where it has a different meaning. # In libtool-speak, it's -all-static. - AX_CHECK_LINK_FLAG([[-static]],[LDFLAGS="$LDFLAGS -static"; LIBTOOL_LDFLAGS="$LIBTOOL_LDFLAGS -all-static"]) + AX_CHECK_LINK_FLAG([[-static]],[LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static"]) AC_PATH_PROG([MAKENSIS], [makensis], none) if test x$MAKENSIS = xnone; then @@ -801,7 +798,7 @@ AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE) AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR) AC_SUBST(RELDFLAGS) -AC_SUBST(LIBTOOL_LDFLAGS) +AC_SUBST(LIBTOOL_APP_LDFLAGS) AC_SUBST(USE_UPNP) AC_SUBST(USE_QRCODE) AC_SUBST(BOOST_LIBS) diff --git a/src/Makefile.am b/src/Makefile.am index 556fd49c0b..83dcaeed79 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -295,7 +295,7 @@ endif bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES) -bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) +bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) # bitcoin-cli binary # bitcoin_cli_LDADD = \ @@ -324,12 +324,12 @@ bitcoin_tx_LDADD = \ bitcoin_tx_SOURCES = bitcoin-tx.cpp bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES) # -bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) +bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) if TARGET_WINDOWS bitcoin_cli_SOURCES += bitcoin-cli-res.rc endif -bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) +bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index fac214bdca..898337ad6f 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -361,7 +361,7 @@ qt_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) endif qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) -qt_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) +qt_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) qt_bitcoin_qt_LIBTOOLFLAGS = --tag CXX #locale/foo.ts -> locale/foo.qm diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 622411ca68..c5392cf307 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -33,7 +33,7 @@ endif qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) \ $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) -qt_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) +qt_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) CLEAN_BITCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 79509c9a3e..c3cd7db143 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -86,7 +86,7 @@ test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) endif test_test_bitcoin_LDADD += $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) -test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) +test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES) From 811a765bef5701b167ce51a047745140df9bd04f Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 14 Oct 2014 18:24:25 -0400 Subject: [PATCH 1062/1288] build: mingw needs libssp for hardening with dlls --- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac index 765b398925..ef759a44b4 100644 --- a/configure.ac +++ b/configure.ac @@ -386,6 +386,12 @@ if test x$use_hardening != xno; then AX_CHECK_LINK_FLAG([[-pie]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"]) fi + case $host in + *mingw*) + AC_CHECK_LIB([ssp], [main],, AC_MSG_ERROR(lib missing)) + ;; + esac + CXXFLAGS="$CXXFLAGS $HARDENED_CXXFLAGS" CPPFLAGS="$CPPFLAGS $HARDENED_CPPFLAGS" LDFLAGS="$LDFLAGS $HARDENED_LDFLAGS" From f36a40f7fd948781656e730338a1ae647e7c4928 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 14 Oct 2014 17:31:16 -0400 Subject: [PATCH 1063/1288] build: check visibility attributes --- build-aux/m4/ax_gcc_func_attribute.m4 | 219 ++++++++++++++++++++++++++ configure.ac | 4 + 2 files changed, 223 insertions(+) create mode 100644 build-aux/m4/ax_gcc_func_attribute.m4 diff --git a/build-aux/m4/ax_gcc_func_attribute.m4 b/build-aux/m4/ax_gcc_func_attribute.m4 new file mode 100644 index 0000000000..de11303e7b --- /dev/null +++ b/build-aux/m4/ax_gcc_func_attribute.m4 @@ -0,0 +1,219 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_GCC_FUNC_ATTRIBUTE(ATTRIBUTE) +# +# DESCRIPTION +# +# This macro checks if the compiler supports one of GCC's function +# attributes; many other compilers also provide function attributes with +# the same syntax. Compiler warnings are used to detect supported +# attributes as unsupported ones are ignored by default so quieting +# warnings when using this macro will yield false positives. +# +# The ATTRIBUTE parameter holds the name of the attribute to be checked. +# +# If ATTRIBUTE is supported define HAVE_FUNC_ATTRIBUTE_. +# +# The macro caches its result in the ax_cv_have_func_attribute_ +# variable. +# +# The macro currently supports the following function attributes: +# +# alias +# aligned +# alloc_size +# always_inline +# artificial +# cold +# const +# constructor +# deprecated +# destructor +# dllexport +# dllimport +# error +# externally_visible +# flatten +# format +# format_arg +# gnu_inline +# hot +# ifunc +# leaf +# malloc +# noclone +# noinline +# nonnull +# noreturn +# nothrow +# optimize +# pure +# unused +# used +# visibility +# warning +# warn_unused_result +# weak +# weakref +# +# Unsuppored function attributes will be tested with a prototype returning +# an int and not accepting any arguments and the result of the check might +# be wrong or meaningless so use with care. +# +# LICENSE +# +# Copyright (c) 2013 Gabriele Svelto +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 2 + +AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ + AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1]) + + AC_CACHE_CHECK([for __attribute__(($1))], [ac_var], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ + m4_case([$1], + [alias], [ + int foo( void ) { return 0; } + int bar( void ) __attribute__(($1("foo"))); + ], + [aligned], [ + int foo( void ) __attribute__(($1(32))); + ], + [alloc_size], [ + void *foo(int a) __attribute__(($1(1))); + ], + [always_inline], [ + inline __attribute__(($1)) int foo( void ) { return 0; } + ], + [artificial], [ + inline __attribute__(($1)) int foo( void ) { return 0; } + ], + [cold], [ + int foo( void ) __attribute__(($1)); + ], + [const], [ + int foo( void ) __attribute__(($1)); + ], + [constructor], [ + int foo( void ) __attribute__(($1)); + ], + [deprecated], [ + int foo( void ) __attribute__(($1(""))); + ], + [destructor], [ + int foo( void ) __attribute__(($1)); + ], + [dllexport], [ + __attribute__(($1)) int foo( void ) { return 0; } + ], + [dllimport], [ + int foo( void ) __attribute__(($1)); + ], + [error], [ + int foo( void ) __attribute__(($1(""))); + ], + [externally_visible], [ + int foo( void ) __attribute__(($1)); + ], + [flatten], [ + int foo( void ) __attribute__(($1)); + ], + [format], [ + int foo(const char *p, ...) __attribute__(($1(printf, 1, 2))); + ], + [format_arg], [ + char *foo(const char *p) __attribute__(($1(1))); + ], + [gnu_inline], [ + inline __attribute__(($1)) int foo( void ) { return 0; } + ], + [hot], [ + int foo( void ) __attribute__(($1)); + ], + [ifunc], [ + int my_foo( void ) { return 0; } + static int (*resolve_foo(void))(void) { return my_foo; } + int foo( void ) __attribute__(($1("resolve_foo"))); + ], + [leaf], [ + __attribute__(($1)) int foo( void ) { return 0; } + ], + [malloc], [ + void *foo( void ) __attribute__(($1)); + ], + [noclone], [ + int foo( void ) __attribute__(($1)); + ], + [noinline], [ + __attribute__(($1)) int foo( void ) { return 0; } + ], + [nonnull], [ + int foo(char *p) __attribute__(($1(1))); + ], + [noreturn], [ + void foo( void ) __attribute__(($1)); + ], + [nothrow], [ + int foo( void ) __attribute__(($1)); + ], + [optimize], [ + __attribute__(($1(3))) int foo( void ) { return 0; } + ], + [pure], [ + int foo( void ) __attribute__(($1)); + ], + [unused], [ + int foo( void ) __attribute__(($1)); + ], + [used], [ + int foo( void ) __attribute__(($1)); + ], + [visibility], [ + int foo_def( void ) __attribute__(($1("default"))); + int foo_hid( void ) __attribute__(($1("hidden"))); + int foo_int( void ) __attribute__(($1("internal"))); + int foo_pro( void ) __attribute__(($1("protected"))); + ], + [warning], [ + int foo( void ) __attribute__(($1(""))); + ], + [warn_unused_result], [ + int foo( void ) __attribute__(($1)); + ], + [weak], [ + int foo( void ) __attribute__(($1)); + ], + [weakref], [ + static int foo( void ) { return 0; } + static int bar( void ) __attribute__(($1("foo"))); + ], + [ + m4_warn([syntax], [Unsupported attribute $1, the test may fail]) + int foo( void ) __attribute__(($1)); + ] + )], []) + ], + dnl GCC doesn't exit with an error if an unknown attribute is + dnl provided but only outputs a warning, so accept the attribute + dnl only if no warning were issued. + [AS_IF([test -s conftest.err], + [AS_VAR_SET([ac_var], [no])], + [AS_VAR_SET([ac_var], [yes])])], + [AS_VAR_SET([ac_var], [no])]) + ]) + + AS_IF([test yes = AS_VAR_GET([ac_var])], + [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_FUNC_ATTRIBUTE_$1), 1, + [Define to 1 if the system has the `$1' function attribute])], []) + + AS_VAR_POPDEF([ac_var]) +]) diff --git a/configure.ac b/configure.ac index ef759a44b4..e2efdf203b 100644 --- a/configure.ac +++ b/configure.ac @@ -346,6 +346,10 @@ fi AX_CHECK_LINK_FLAG([[-Wl,--large-address-aware]], [LDFLAGS="$LDFLAGS -Wl,--large-address-aware"]) +AX_GCC_FUNC_ATTRIBUTE([visibility]) +AX_GCC_FUNC_ATTRIBUTE([dllexport]) +AX_GCC_FUNC_ATTRIBUTE([dllimport]) + if test x$use_glibc_compat != xno; then #__fdelt_chk's params and return type have changed from long unsigned int to long int. From ee64c53c1fdcadf00138b7e6fdf44a1c433db9f8 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 6 Nov 2014 22:18:08 -0500 Subject: [PATCH 1064/1288] build: remove internal/protected build attribute checks They're not necessary, and not always supported. We only need to know about hidden and default. --- build-aux/m4/ax_gcc_func_attribute.m4 | 2 -- 1 file changed, 2 deletions(-) diff --git a/build-aux/m4/ax_gcc_func_attribute.m4 b/build-aux/m4/ax_gcc_func_attribute.m4 index de11303e7b..275ca63a2c 100644 --- a/build-aux/m4/ax_gcc_func_attribute.m4 +++ b/build-aux/m4/ax_gcc_func_attribute.m4 @@ -180,8 +180,6 @@ AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ [visibility], [ int foo_def( void ) __attribute__(($1("default"))); int foo_hid( void ) __attribute__(($1("hidden"))); - int foo_int( void ) __attribute__(($1("internal"))); - int foo_pro( void ) __attribute__(($1("protected"))); ], [warning], [ int foo( void ) __attribute__(($1(""))); From 2cf5f16c25ac81eac3a09c4f15dad9d2154c03d4 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 14 Oct 2014 18:22:55 -0400 Subject: [PATCH 1065/1288] build: add libbitcoinconsensus files and hook up the lib build Credit BlueMatt for libbitcoinsonsensus.h/cpp --- .gitignore | 5 ++ src/Makefile.am | 31 +++++++++++ src/Makefile.test.include | 2 +- src/script/bitcoinconsensus.cpp | 91 +++++++++++++++++++++++++++++++++ src/script/bitcoinconsensus.h | 67 ++++++++++++++++++++++++ 5 files changed, 195 insertions(+), 1 deletion(-) create mode 100644 src/script/bitcoinconsensus.cpp create mode 100644 src/script/bitcoinconsensus.h diff --git a/.gitignore b/.gitignore index c97432df92..7343e722d5 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,7 @@ src/qt/test/moc*.cpp .deps .dirstamp +.libs .*.swp *.*~* *.bak @@ -66,6 +67,10 @@ src/qt/test/moc*.cpp *.json.h *.raw.h +#libtool object files +*.lo +*.la + # Compilation and Qt preprocessor part *.qm Makefile diff --git a/src/Makefile.am b/src/Makefile.am index 83dcaeed79..63f2375c86 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -49,6 +49,8 @@ BITCOIN_INCLUDES += $(BDB_CPPFLAGS) noinst_LIBRARIES += libbitcoin_wallet.a endif +lib_LTLIBRARIES = libbitcoinconsensus.la + bin_PROGRAMS = TESTS = @@ -331,6 +333,35 @@ bitcoin_cli_SOURCES += bitcoin-cli-res.rc endif bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) +if BUILD_BITCOIN_LIBS +include_HEADERS = script/bitcoinconsensus.h +libbitcoinconsensus_la_SOURCES = \ + core/transaction.cpp \ + crypto/sha1.cpp \ + crypto/sha2.cpp \ + crypto/ripemd160.cpp \ + eccryptoverify.cpp \ + ecwrapper.cpp \ + hash.cpp \ + pubkey.cpp \ + script/script.cpp \ + script/interpreter.cpp \ + script/bitcoinconsensus.cpp \ + uint256.cpp \ + utilstrencodings.cpp + +if GLIBC_BACK_COMPAT + libbitcoinconsensus_la_SOURCES += compat/glibc_compat.cpp + libbitcoinconsensus_la_SOURCES += compat/glibcxx_compat.cpp +endif + +libbitcoinconsensus_la_LDFLAGS = -no-undefined $(RELDFLAGS) +libbitcoinconsensus_la_LIBADD = $(CRYPTO_LIBS) +libbitcoinconsensus_la_CPPFLAGS = $(CRYPTO_CFLAGS) -I$(builddir)/obj -DBUILD_BITCOIN_INTERNAL +if USE_LIBSECP256K1 +libbitcoinconsensus_la_LIBADD += secp256k1/libsecp256k1.la +endif + CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno DISTCLEANFILES = obj/build.h diff --git a/src/Makefile.test.include b/src/Makefile.test.include index c3cd7db143..f8711f0387 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -86,7 +86,7 @@ test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) endif test_test_bitcoin_LDADD += $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) -test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) +test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static-libtool-libs nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES) diff --git a/src/script/bitcoinconsensus.cpp b/src/script/bitcoinconsensus.cpp new file mode 100644 index 0000000000..4faa760ad7 --- /dev/null +++ b/src/script/bitcoinconsensus.cpp @@ -0,0 +1,91 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "bitcoinconsensus.h" + +#include "core/transaction.h" +#include "script/interpreter.h" +#include "version.h" + +namespace { + +/** A class that deserializes a single CTransaction one time. */ +class TxInputStream +{ +public: + TxInputStream(int nTypeIn, int nVersionIn, const unsigned char *txTo, size_t txToLen) : + m_type(nTypeIn), + m_version(nVersionIn), + m_data(txTo), + m_remaining(txToLen) + {} + + TxInputStream& read(char* pch, size_t nSize) + { + if (nSize > m_remaining) + throw std::ios_base::failure(std::string(__func__) + ": end of data"); + + if (pch == NULL) + throw std::ios_base::failure(std::string(__func__) + ": bad destination buffer"); + + if (m_data == NULL) + throw std::ios_base::failure(std::string(__func__) + ": bad source buffer"); + + memcpy(pch, m_data, nSize); + m_remaining -= nSize; + m_data += nSize; + return *this; + } + + template + TxInputStream& operator>>(T& obj) + { + ::Unserialize(*this, obj, m_type, m_version); + return *this; + } + +private: + const int m_type; + const int m_version; + const unsigned char* m_data; + size_t m_remaining; +}; + +inline int set_error(bitcoinconsensus_error* ret, bitcoinconsensus_error serror) +{ + if (ret) + *ret = serror; + return 0; +} + +} // anon namespace + +int bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, + const unsigned char *txTo , unsigned int txToLen, + unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err) +{ + try { + TxInputStream stream(SER_NETWORK, PROTOCOL_VERSION, txTo, txToLen); + CTransaction tx; + stream >> tx; + if (nIn >= tx.vin.size()) + return set_error(err, bitcoinconsensus_ERR_TX_INDEX); + if (tx.GetSerializeSize(SER_NETWORK, PROTOCOL_VERSION) != txToLen) + return set_error(err, bitcoinconsensus_ERR_TX_SIZE_MISMATCH); + + // Regardless of the verification result, the tx did not error. + set_error(err, bitcoinconsensus_ERR_OK); + + return VerifyScript(tx.vin[nIn].scriptSig, CScript(scriptPubKey, scriptPubKey + scriptPubKeyLen), flags, SignatureChecker(tx, nIn), NULL); + } catch (std::exception &e) { + return set_error(err, bitcoinconsensus_ERR_TX_DESERIALIZE); // Error deserializing + } +} + +unsigned int bitcoinconsensus_version() +{ + // Just use the API version for now + return BITCOINCONSENSUS_API_VER; +} diff --git a/src/script/bitcoinconsensus.h b/src/script/bitcoinconsensus.h new file mode 100644 index 0000000000..15e3337a8d --- /dev/null +++ b/src/script/bitcoinconsensus.h @@ -0,0 +1,67 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_BITCOINCONSENSUS_H +#define BITCOIN_BITCOINCONSENSUS_H + +#if defined(BUILD_BITCOIN_INTERNAL) && defined(HAVE_CONFIG_H) +#include "config/bitcoin-config.h" + #if defined(_WIN32) + #if defined(DLL_EXPORT) + #if defined(HAVE_FUNC_ATTRIBUTE_DLLEXPORT) + #define EXPORT_SYMBOL __declspec(dllexport) + #else + #define EXPORT_SYMBOL + #endif + #endif + #elif defined(HAVE_FUNC_ATTRIBUTE_VISIBILITY) + #define EXPORT_SYMBOL __attribute__ ((visibility ("default"))) + #endif +#elif defined(MSC_VER) && !defined(STATIC_LIBBITCOINCONSENSUS) + #define EXPORT_SYMBOL __declspec(dllimport) +#endif + +#ifndef EXPORT_SYMBOL + #define EXPORT_SYMBOL +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define BITCOINCONSENSUS_API_VER 0 + +typedef enum bitcoinconsensus_error_t +{ + bitcoinconsensus_ERR_OK = 0, + bitcoinconsensus_ERR_TX_INDEX, + bitcoinconsensus_ERR_TX_SIZE_MISMATCH, + bitcoinconsensus_ERR_TX_DESERIALIZE, +} bitcoinconsensus_error; + +/** Script verification flags */ +enum +{ + bitcoinconsensus_SCRIPT_FLAGS_VERIFY_NONE = 0, + bitcoinconsensus_SCRIPT_FLAGS_VERIFY_P2SH = (1U << 0), // evaluate P2SH (BIP16) subscripts +}; + +/// Returns 1 if the input nIn of the serialized transaction pointed to by +/// txTo correctly spends the scriptPubKey pointed to by scriptPubKey under +/// the additional constraints specified by flags. +/// If not NULL, err will contain an error/success code for the operation +EXPORT_SYMBOL int bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, + const unsigned char *txTo , unsigned int txToLen, + unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err); + +EXPORT_SYMBOL unsigned int bitcoinconsensus_version(); + +#ifdef __cplusplus +} // extern "C" +#endif + +#undef EXPORT_SYMBOL + +#endif // BITCOIN_BITCOINCONSENSUS_H From cdd36c6c5cc309d98f941a4c78d9642c92c1e46f Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 6 Nov 2014 22:43:19 -0500 Subject: [PATCH 1066/1288] build: add --with-libs so that libs are optional --- configure.ac | 17 +++++++++++++++-- src/Makefile.am | 6 ++++++ src/Makefile.test.include | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index e2efdf203b..7a00d57ae9 100644 --- a/configure.ac +++ b/configure.ac @@ -610,6 +610,12 @@ AC_ARG_WITH([utils], [build_bitcoin_utils=$withval], [build_bitcoin_utils=yes]) +AC_ARG_WITH([libs], + [AS_HELP_STRING([--with-libs], + [build libraries (default=yes)])], + [build_bitcoin_libs=$withval], + [build_bitcoin_libs=yes]) + AC_ARG_WITH([daemon], [AS_HELP_STRING([--with-daemon], [build bitcoind daemon (default=yes)])], @@ -660,6 +666,13 @@ AC_MSG_CHECKING([whether to build utils (bitcoin-cli bitcoin-tx)]) AM_CONDITIONAL([BUILD_BITCOIN_UTILS], [test x$build_bitcoin_utils = xyes]) AC_MSG_RESULT($build_bitcoin_utils) +AC_MSG_CHECKING([whether to build libraries]) +AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test x$build_bitcoin_libs = xyes]) +if test x$build_bitcoin_libs = xyes; then + AC_DEFINE(HAVE_CONSENSUS_LIB, 1, [Define this symbol if the consensus lib has been built]) +fi +AC_MSG_RESULT($build_bitcoin_libs) + dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt4]) @@ -776,8 +789,8 @@ else AC_MSG_RESULT([no]) fi -if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests = xnononono; then - AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-daemon --with-gui or --enable-tests]) +if test x$build_bitcoin_utils$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_tests = xnononono; then + AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui or --enable-tests]) fi AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin]) diff --git a/src/Makefile.am b/src/Makefile.am index 63f2375c86..0d45203c90 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -49,7 +49,12 @@ BITCOIN_INCLUDES += $(BDB_CPPFLAGS) noinst_LIBRARIES += libbitcoin_wallet.a endif +if BUILD_BITCOIN_LIBS lib_LTLIBRARIES = libbitcoinconsensus.la +LIBBITCOIN_CONSENSUS=libbitcoinconsensus.la +else +LIBBITCOIN_CONSENSUS= +endif bin_PROGRAMS = TESTS = @@ -361,6 +366,7 @@ libbitcoinconsensus_la_CPPFLAGS = $(CRYPTO_CFLAGS) -I$(builddir)/obj -DBUILD_BIT if USE_LIBSECP256K1 libbitcoinconsensus_la_LIBADD += secp256k1/libsecp256k1.la endif +endif CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno diff --git a/src/Makefile.test.include b/src/Makefile.test.include index f8711f0387..5fd2afe50d 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -85,7 +85,7 @@ if ENABLE_WALLET test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) endif -test_test_bitcoin_LDADD += $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) +test_test_bitcoin_LDADD += $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static-libtool-libs nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES) From 269efa30ed57feb5dd7d4d30c64b98fa7aad4267 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 14 Oct 2014 18:23:46 -0400 Subject: [PATCH 1067/1288] build: add quick consensus lib tests They should be hooked up in other places as well, but this is a start. --- src/test/script_tests.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index d98154571b..36aaa6903f 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -14,6 +14,10 @@ #include "script/sign.h" #include "util.h" +#if defined(HAVE_CONSENSUS_LIB) +#include "script/bitcoinconsensus.h" +#endif + #include #include #include @@ -94,8 +98,15 @@ CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CMu void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, int flags, bool expect, const std::string& message) { ScriptError err; - BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, flags, SignatureChecker(BuildSpendingTransaction(scriptSig, BuildCreditingTransaction(scriptPubKey)), 0), &err) == expect, message); + CMutableTransaction tx = BuildSpendingTransaction(scriptSig, BuildCreditingTransaction(scriptPubKey)); + CMutableTransaction tx2 = tx; + BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, flags, SignatureChecker(tx, 0), &err) == expect, message); BOOST_CHECK_MESSAGE(expect == (err == SCRIPT_ERR_OK), std::string(ScriptErrorString(err)) + ": " + message); +#if defined(HAVE_CONSENSUS_LIB) + CDataStream stream(SER_NETWORK, PROTOCOL_VERSION); + stream << tx2; + BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script(begin_ptr(scriptPubKey), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size(), 0, flags, NULL) == expect,message); +#endif } void static NegateSignatureS(std::vector& vchSig) { From 19df238a7ba7a6cdfbf48bc663c39ddbf9f6c7d0 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 14 Oct 2014 18:25:35 -0400 Subject: [PATCH 1068/1288] build: shared lib build should work reasonably well now --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7a00d57ae9..70a9c15ffb 100644 --- a/configure.ac +++ b/configure.ac @@ -49,7 +49,7 @@ case $host in ;; esac dnl Libtool init checks. -LT_INIT([disable-shared]) +LT_INIT([pic-only]) dnl Check/return PATH for base programs. AC_PATH_TOOL(AR, ar) From 9ed8979e294fb7a42e26a6b6541f614554663bea Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 18 Nov 2014 15:49:56 -0500 Subject: [PATCH 1069/1288] build: fix static dll link for mingw dll's are no longer dynamically linked to libgcc/libstdc++/libssp --- configure.ac | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configure.ac b/configure.ac index 70a9c15ffb..77ab5eb03c 100644 --- a/configure.ac +++ b/configure.ac @@ -226,6 +226,15 @@ case $host in *) AC_MSG_ERROR("Could not determine win32/win64 for installer") ;; esac AC_SUBST(WINDOWS_BITS) + + dnl libtool insists upon adding -nostdlib and a list of objects/libs to link against. + dnl That breaks our ability to build dll's with static libgcc/libstdc++/libssp. Override + dnl its command here, with the predeps/postdeps removed, and -static inserted. Postdeps are + dnl also overridden to prevent their insertion later. + dnl This should only affect dll's. + archive_cmds_CXX="\$CC -shared \$libobjs \$deplibs \$compiler_flags -static -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib" + postdeps_CXX= + ;; *darwin*) TARGET_OS=darwin From 9eb5a5fbef5270fda10c15c60a297b4cd19b681e Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 18 Nov 2014 17:06:23 -0500 Subject: [PATCH 1070/1288] build: pad header for osx libs This ensures that users of the lib will be able to mangle the paths to work in their bundles. --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 77ab5eb03c..6784521d81 100644 --- a/configure.ac +++ b/configure.ac @@ -285,6 +285,7 @@ case $host in esac fi + AX_CHECK_LINK_FLAG([[-Wl,-headerpad_max_install_names]], [LDFLAGS="$LDFLAGS -Wl,-headerpad_max_install_names"]) CPPFLAGS="$CPPFLAGS -DMAC_OSX" ;; *linux*) From 4302fa67b12794648abb40a9e9f18230041691b4 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 11 Nov 2014 18:21:23 -0500 Subject: [PATCH 1071/1288] depends: Use pic for all linux dependencies This avoids textrels, and matches previous gitian behavior. --- depends/packages/bdb.mk | 3 +-- depends/packages/boost.mk | 3 +-- depends/packages/freetype.mk | 2 +- depends/packages/libX11.mk | 2 +- depends/packages/libXau.mk | 2 +- depends/packages/openssl.mk | 7 ++++--- depends/packages/protobuf.mk | 2 +- depends/packages/qrencode.mk | 2 +- depends/packages/xcb_proto.mk | 2 +- depends/packages/xtrans.mk | 2 +- 10 files changed, 13 insertions(+), 14 deletions(-) diff --git a/depends/packages/bdb.mk b/depends/packages/bdb.mk index f39925723b..68841afdb8 100644 --- a/depends/packages/bdb.mk +++ b/depends/packages/bdb.mk @@ -8,8 +8,7 @@ $(package)_build_subdir=build_unix define $(package)_set_vars $(package)_config_opts=--disable-shared --enable-cxx --disable-replication $(package)_config_opts_mingw32=--enable-mingw -$(package)_config_opts_x86_64_linux=--with-pic -$(package)_config_opts_arm_linux=--with-pic +$(package)_config_opts_linux=--with-pic endef define $(package)_preprocess_cmds diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 53c4c3c74e..f50828c546 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -22,8 +22,7 @@ $(package)_toolset_darwin=darwin $(package)_archiver_darwin=$($(package)_libtool) $(package)_config_libraries=chrono,filesystem,program_options,system,thread,test $(package)_cxxflags=-fvisibility=hidden -$(package)_cxxflags_x86_64_linux=-fPIC -$(package)_cxxflags_arm_linux=-fPIC +$(package)_cxxflags_linux=-fPIC endef define $(package)_preprocess_cmds diff --git a/depends/packages/freetype.mk b/depends/packages/freetype.mk index b83cbd93ea..f7d6e0f9fc 100644 --- a/depends/packages/freetype.mk +++ b/depends/packages/freetype.mk @@ -6,7 +6,7 @@ $(package)_sha256_hash=c0848b29d52ef3ca27ad92e08351f023c5e24ce8cea7d8fe69fc96358 define $(package)_set_vars $(package)_config_opts=--without-zlib --without-png --disable-static - $(package)_config_opts_x86_64_linux=--with-pic + $(package)_config_opts_linux=--with-pic endef define $(package)_config_cmds diff --git a/depends/packages/libX11.mk b/depends/packages/libX11.mk index 144021e34b..178d592ee6 100644 --- a/depends/packages/libX11.mk +++ b/depends/packages/libX11.mk @@ -7,7 +7,7 @@ $(package)_dependencies=libxcb xtrans xextproto xproto define $(package)_set_vars $(package)_config_opts=--disable-xkb --disable-static -$(package)_config_opts_x86_64_linux=--with-pic +$(package)_config_opts_linux=--with-pic endef define $(package)_config_cmds diff --git a/depends/packages/libXau.mk b/depends/packages/libXau.mk index 8c9b21846b..e87df2e4de 100644 --- a/depends/packages/libXau.mk +++ b/depends/packages/libXau.mk @@ -7,7 +7,7 @@ $(package)_dependencies=xproto define $(package)_set_vars $(package)_config_opts=--disable-shared - $(package)_config_opts_x86_64_linux=--with-pic + $(package)_config_opts_linux=--with-pic endef define $(package)_config_cmds diff --git a/depends/packages/openssl.mk b/depends/packages/openssl.mk index 70b0b8d39f..6d7a556c11 100644 --- a/depends/packages/openssl.mk +++ b/depends/packages/openssl.mk @@ -10,12 +10,13 @@ $(package)_config_opts=--prefix=$(host_prefix) --openssldir=$(host_prefix)/etc/o $(package)_config_opts+=no-krb5 no-camellia no-capieng no-cast no-cms no-dtls1 no-gost no-gmp no-heartbeats no-idea no-jpake no-md2 $(package)_config_opts+=no-mdc2 no-rc5 no-rdrand no-rfc3779 no-rsax no-sctp no-seed no-sha0 no-static_engine no-whirlpool no-rc2 no-rc4 no-ssl2 no-ssl3 $(package)_config_opts+=$($(package)_cflags) $($(package)_cppflags) -$(package)_config_opts_x86_64_linux=-fPIC linux-x86_64 -$(package)_config_opts_arm_linux=-fPIC linux-generic32 +$(package)_config_opts_linux=-fPIC +$(package)_config_opts_x86_64_linux=linux-x86_64 +$(package)_config_opts_i686_linux=linux-generic32 +$(package)_config_opts_arm_linux=linux-generic32 $(package)_config_opts_x86_64_darwin=darwin64-x86_64-cc $(package)_config_opts_x86_64_mingw32=mingw64 $(package)_config_opts_i686_mingw32=mingw -$(package)_config_opts_i686_linux=linux-generic32 -fPIC endef define $(package)_preprocess_cmds diff --git a/depends/packages/protobuf.mk b/depends/packages/protobuf.mk index 716f837853..5affad2837 100644 --- a/depends/packages/protobuf.mk +++ b/depends/packages/protobuf.mk @@ -7,7 +7,7 @@ $(package)_dependencies=native_$(package) define $(package)_set_vars $(package)_config_opts=--disable-shared --with-protoc=$(build_prefix)/bin/protoc - $(package)_config_opts_x86_64_linux=--with-pic + $(package)_config_opts_linux=--with-pic endef define $(package)_config_cmds diff --git a/depends/packages/qrencode.mk b/depends/packages/qrencode.mk index 69d2982cbc..1ad329e94d 100644 --- a/depends/packages/qrencode.mk +++ b/depends/packages/qrencode.mk @@ -6,7 +6,7 @@ $(package)_sha256_hash=dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b5 define $(package)_set_vars $(package)_config_opts=--disable-shared -without-tools --disable-sdltest -$(package)_config_opts_x86_64_linux=--with-pic +$(package)_config_opts_linux=--with-pic endef define $(package)_config_cmds diff --git a/depends/packages/xcb_proto.mk b/depends/packages/xcb_proto.mk index 726e3048c3..0c7c958d62 100644 --- a/depends/packages/xcb_proto.mk +++ b/depends/packages/xcb_proto.mk @@ -6,7 +6,7 @@ $(package)_sha256_hash=7ef40ddd855b750bc597d2a435da21e55e502a0fefa85b274f2c92280 define $(package)_set_vars $(package)_config_opts=--disable-shared - $(package)_config_opts_x86_64_linux=--with-pic + $(package)_config_opts_linux=--with-pic endef define $(package)_config_cmds diff --git a/depends/packages/xtrans.mk b/depends/packages/xtrans.mk index b973149797..99eefa6d5e 100644 --- a/depends/packages/xtrans.mk +++ b/depends/packages/xtrans.mk @@ -6,7 +6,7 @@ $(package)_sha256_hash=054d4ee3efd52508c753e9f7bc655ef185a29bd2850dd9e2fc2ccc335 $(package)_dependencies= define $(package)_set_vars -$(package)_config_opts_x86_64_linux=--with-pic --disable-static +$(package)_config_opts_linux=--with-pic --disable-static endef define $(package)_config_cmds From 5f93ec202810c1bc082f181fbfe6af4438b395fe Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 28 Aug 2014 23:21:18 -0400 Subject: [PATCH 1072/1288] depends: Add a package for qt4.6. Linux uses it by default. We're not ready to switch to a static qt5 for Linux yet due to missing plugin support. This adds a recipe for building a shared qt4 that we build and link against, but don't distribute. make USE_LINUX_STATIC_QT5=1 can be used to build static qt5 as before. --- depends/Makefile | 1 + depends/README.usage | 1 + depends/packages/libICE.mk | 23 +++++++++++ depends/packages/libSM.mk | 23 +++++++++++ depends/packages/packages.mk | 13 +++++- depends/packages/qt46.mk | 67 +++++++++++++++++++++++++++++++ depends/patches/qt46/stlfix.patch | 10 +++++ 7 files changed, 136 insertions(+), 2 deletions(-) create mode 100644 depends/packages/libICE.mk create mode 100644 depends/packages/libSM.mk create mode 100644 depends/packages/qt46.mk create mode 100644 depends/patches/qt46/stlfix.patch diff --git a/depends/Makefile b/depends/Makefile index fc763bedeb..5de0159714 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -6,6 +6,7 @@ SDK_PATH ?= $(BASEDIR)/SDKs NO_QT ?= NO_WALLET ?= NO_UPNP ?= +USE_LINUX_STATIC_QT5 ?= FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources BUILD = $(shell ./config.guess) diff --git a/depends/README.usage b/depends/README.usage index d3c57956f1..e768feecf7 100644 --- a/depends/README.usage +++ b/depends/README.usage @@ -23,6 +23,7 @@ NO_QT: Don't download/build/cache qt and its dependencies NO_WALLET: Don't download/build/cache libs needed to enable the wallet NO_UPNP: Don't download/build/cache packages needed for enabling upnp DEBUG: disable some optimizations and enable more runtime checking +USE_LINUX_STATIC_QT5: Build a static qt5 rather than shared qt4. Linux only. If some packages are not built, for example 'make NO_WALLET=1', the appropriate options will be passed to bitcoin's configure. In this case, --disable-wallet. diff --git a/depends/packages/libICE.mk b/depends/packages/libICE.mk new file mode 100644 index 0000000000..fc60323b1c --- /dev/null +++ b/depends/packages/libICE.mk @@ -0,0 +1,23 @@ +package=libICE +$(package)_version=1.0.9 +$(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/ +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=8f7032f2c1c64352b5423f6b48a8ebdc339cc63064af34d66a6c9aa79759e202 +$(package)_dependencies=xtrans xproto + +define $(package)_set_vars + $(package)_config_opts=--disable-static --disable-docs --disable-specs --without-xsltproc + $(package)_config_opts_linux=--with-pic +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/libSM.mk b/depends/packages/libSM.mk new file mode 100644 index 0000000000..0f9307ca76 --- /dev/null +++ b/depends/packages/libSM.mk @@ -0,0 +1,23 @@ +package=libSM +$(package)_version=1.2.2 +$(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/ +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=0baca8c9f5d934450a70896c4ad38d06475521255ca63b717a6510fdb6e287bd +$(package)_dependencies=xtrans xproto libICE + +define $(package)_set_vars + $(package)_config_opts=--without-libuuid --without-xsltproc --disable-docs --disable-static + $(package)_config_opts_linux=--with-pic +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 0e1fbeffaa..305d21cb2d 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -2,8 +2,17 @@ packages:=boost openssl gmp native_packages := native_ccache native_comparisontool qt_native_packages = native_protobuf -qt_packages = qt qrencode protobuf -qt_linux_packages=expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans +qt_packages = qrencode protobuf + +qt46_linux_packages = qt46 expat dbus libxcb xcb_proto libXau xproto freetype libX11 xextproto libXext xtrans libICE libSM +qt5_linux_packages= qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans + +qt_darwin_packages=qt +qt_mingw32_packages=qt + +qt_linux_$(USE_LINUX_STATIC_QT5):=$(qt5_linux_packages) +qt_linux_:=$(qt46_linux_packages) +qt_linux_packages:=$(qt_linux_$(USE_LINUX_STATIC_QT5)) wallet_packages=bdb diff --git a/depends/packages/qt46.mk b/depends/packages/qt46.mk new file mode 100644 index 0000000000..6af8052931 --- /dev/null +++ b/depends/packages/qt46.mk @@ -0,0 +1,67 @@ +PACKAGE=qt46 +$(package)_version=4.6.2 +$(package)_download_path=http://download.qt-project.org/archive/qt/4.6/ +$(package)_file_name=qt-everywhere-opensource-src-$($(package)_version).tar.gz +$(package)_sha256_hash=176f51ddb06dce67ab4b2efc6b327dc21ed8f764c5d97acc15ff1f907c2affae +$(package)_dependencies=openssl +$(package)_linux_dependencies=freetype dbus libX11 xproto libXext libICE libSM +$(package)_patches=stlfix.patch + +define $(package)_set_vars +$(package)_config_opts = -prefix $(host_prefix) -headerdir $(host_prefix)/include/qt4 -bindir $(build_prefix)/bin +$(package)_config_opts += -release -no-separate-debug-info -opensource -confirm-license +$(package)_config_opts += -stl -qt-zlib + +$(package)_config_opts += -nomake examples -nomake tests -nomake tools -nomake translations -nomake demos -nomake docs +$(package)_config_opts += -no-audio-backend -no-glib -no-nis -no-cups -no-iconv -no-gif -no-pch +$(package)_config_opts += -no-xkb -no-xrender -no-xrandr -no-xfixes -no-xcursor -no-xinerama -no-xsync -no-xinput -no-mitshm -no-xshape +$(package)_config_opts += -no-libtiff -no-fontconfig -openssl-linked +$(package)_config_opts += -no-sql-db2 -no-sql-ibase -no-sql-oci -no-sql-tds -no-sql-mysql +$(package)_config_opts += -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 +$(package)_config_opts += -no-xmlpatterns -no-multimedia -no-phonon -no-scripttools -no-declarative +$(package)_config_opts += -no-phonon-backend -no-webkit -no-javascript-jit -no-script +$(package)_config_opts += -no-svg -no-libjpeg -no-libtiff -no-libpng -no-libmng -no-qt3support -no-opengl + +$(package)_config_opts_x86_64_linux += -platform linux-g++-64 +$(package)_config_opts_i686_linux = -platform linux-g++-32 +$(package)_build_env = QT_RCC_TEST=1 +endef + +define $(package)_preprocess_cmds + sed -i.old "s|/include /usr/include||" config.tests/unix/freetype/freetype.pri && \ + sed -i.old "s|src_plugins.depends = src_gui src_sql src_svg|src_plugins.depends = src_gui src_sql|" src/src.pro && \ + sed -i.old "s|\.lower(|\.toLower(|g" src/network/ssl/qsslsocket_openssl.cpp && \ + sed -i.old "s|Key_BackSpace|Key_Backspace|" src/gui/itemviews/qabstractitemview.cpp && \ + sed -i.old "s|/usr/X11R6/lib64|$(host_prefix)/lib|" mkspecs/*/*.conf && \ + sed -i.old "s|/usr/X11R6/lib|$(host_prefix)/lib|" mkspecs/*/*.conf && \ + sed -i.old "s|/usr/X11R6/include|$(host_prefix)/include|" mkspecs/*/*.conf && \ + sed -i.old "s|QMAKE_LFLAGS_SHLIB += -shared|QMAKE_LFLAGS_SHLIB += -shared -Wl,--exclude-libs,ALL|" mkspecs/common/g++.conf && \ + sed -i.old "/SSLv2_client_method/d" src/network/ssl/qsslsocket_openssl.cpp src/network/ssl/qsslsocket_openssl_symbols.cpp && \ + sed -i.old "/SSLv2_server_method/d" src/network/ssl/qsslsocket_openssl.cpp src/network/ssl/qsslsocket_openssl_symbols.cpp && \ + patch -p1 < $($(package)_patch_dir)/stlfix.patch +endef + +define $(package)_config_cmds + export PKG_CONFIG_SYSROOT_DIR=/ && \ + export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \ + export PKG_CONFIG_PATH=$(host_prefix)/share/pkgconfig && \ + export CPATH=$(host_prefix)/include && \ + OPENSSL_LIBS='-L$(host_prefix)/lib -lssl -lcrypto' ./configure $($(package)_config_opts) && \ + cd tools/linguist/lrelease; ../../../bin/qmake -o Makefile lrelease.pro +endef + +define $(package)_build_cmds + export CPATH=$(host_prefix)/include && \ + $(MAKE) -C src && \ + $(MAKE) -C tools/linguist/lrelease +endef + +define $(package)_stage_cmds + $(MAKE) -C src INSTALL_ROOT=$($(package)_staging_dir) install && \ + $(MAKE) -C tools/linguist/lrelease INSTALL_ROOT=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds + rm -rf mkspecs/ lib/cmake/ && \ + find native/bin -type f -exec mv {} {}-qt4 \; +endef diff --git a/depends/patches/qt46/stlfix.patch b/depends/patches/qt46/stlfix.patch new file mode 100644 index 0000000000..f8f6fb04b0 --- /dev/null +++ b/depends/patches/qt46/stlfix.patch @@ -0,0 +1,10 @@ +--- old/config.tests/unix/stl/stltest.cpp 2011-06-23 03:45:23.000000000 -0400 ++++ new/config.tests/unix/stl/stltest.cpp 2014-08-28 00:54:04.154837604 -0400 +@@ -49,6 +49,7 @@ + #include + #include + #include ++#include + + // something mean to see if the compiler and C++ standard lib are good enough + template From 1aead42d41178d0eeeae2c1b7d0131af9d6fffd2 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 12 Aug 2014 19:13:04 -0400 Subject: [PATCH 1073/1288] gitian: descriptors overhaul Descriptors now make use of the dependencies builder, so results are cached. A very new version (>= e9741525c) of Gitian should be used in order to take advantage of caching. --- contrib/gitian-descriptors/boost-linux.yml | 55 ---- contrib/gitian-descriptors/boost-win.yml | 86 ------ contrib/gitian-descriptors/deps-linux.yml | 98 ------- contrib/gitian-descriptors/deps-win.yml | 128 --------- contrib/gitian-descriptors/gitian-linux.yml | 128 +++++---- .../gitian-descriptors/gitian-osx-bitcoin.yml | 61 ---- .../gitian-descriptors/gitian-osx-depends.yml | 159 ----------- .../gitian-descriptors/gitian-osx-native.yml | 178 ------------ contrib/gitian-descriptors/gitian-osx-qt.yml | 186 ------------ contrib/gitian-descriptors/gitian-osx.yml | 104 +++++++ contrib/gitian-descriptors/gitian-win.yml | 157 +++++------ contrib/gitian-descriptors/protobuf-win.yml | 65 ----- contrib/gitian-descriptors/qt-linux.yml | 264 ------------------ contrib/gitian-descriptors/qt-win.yml | 92 ------ depends/packages/qt46.mk | 11 +- 15 files changed, 256 insertions(+), 1516 deletions(-) delete mode 100644 contrib/gitian-descriptors/boost-linux.yml delete mode 100644 contrib/gitian-descriptors/boost-win.yml delete mode 100644 contrib/gitian-descriptors/deps-linux.yml delete mode 100644 contrib/gitian-descriptors/deps-win.yml delete mode 100644 contrib/gitian-descriptors/gitian-osx-bitcoin.yml delete mode 100644 contrib/gitian-descriptors/gitian-osx-depends.yml delete mode 100644 contrib/gitian-descriptors/gitian-osx-native.yml delete mode 100644 contrib/gitian-descriptors/gitian-osx-qt.yml create mode 100644 contrib/gitian-descriptors/gitian-osx.yml delete mode 100644 contrib/gitian-descriptors/protobuf-win.yml delete mode 100644 contrib/gitian-descriptors/qt-linux.yml delete mode 100644 contrib/gitian-descriptors/qt-win.yml diff --git a/contrib/gitian-descriptors/boost-linux.yml b/contrib/gitian-descriptors/boost-linux.yml deleted file mode 100644 index bd35346337..0000000000 --- a/contrib/gitian-descriptors/boost-linux.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -name: "boost" -suites: -- "precise" -architectures: -- "i386" -- "amd64" -packages: -- "g++" -- "unzip" -- "pkg-config" -- "libtool" -- "faketime" -- "bsdmainutils" -- "zip" -- "libz-dev" -reference_datetime: "2011-01-30 00:00:00" -remotes: [] -files: -- "boost_1_55_0.tar.bz2" -script: | - STAGING="$HOME/install" - TEMPDIR="$HOME/tmp" - export LIBRARY_PATH="$STAGING/lib" - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME - export TZ=UTC - # Input Integrity Check - echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | shasum -c - - mkdir -p "$STAGING" - tar --warning=no-timestamp -xjf boost_1_55_0.tar.bz2 - cd boost_1_55_0 - GCCVERSION=$(g++ -E -dM $(mktemp --suffix=.h) | grep __VERSION__ | cut -d ' ' -f 3 | cut -d '"' -f 2) - # note: bjam with -d+2 reveals that -O3 is implied by default, no need to provide it in cxxflags - echo "using gcc : $GCCVERSION : g++ - : - \"-frandom-seed=boost1 -fPIC\" - ;" > user-config.jam - - ./bootstrap.sh --without-icu - - ./bjam toolset=gcc threadapi=pthread threading=multi variant=release link=static runtime-link=shared --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 --layout=tagged --build-type=complete --prefix="$STAGING" $MAKEOPTS -d+2 install - - # post-process all generated libraries to be deterministic - # extract them to a temporary directory then re-build them deterministically - for LIB in $(find $STAGING -name \*.a); do - rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR - ar xv $LIB | cut -b5- > /tmp/list.txt - rm $LIB - ar crsD $LIB $(cat /tmp/list.txt) - done - # - cd "$STAGING" - find | sort | zip -X@ $OUTDIR/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip diff --git a/contrib/gitian-descriptors/boost-win.yml b/contrib/gitian-descriptors/boost-win.yml deleted file mode 100644 index 347952e3a6..0000000000 --- a/contrib/gitian-descriptors/boost-win.yml +++ /dev/null @@ -1,86 +0,0 @@ ---- -name: "boost" -suites: -- "precise" -architectures: -- "amd64" -packages: -- "mingw-w64" -- "g++-mingw-w64" -- "faketime" -- "zip" -reference_datetime: "2011-01-30 00:00:00" -remotes: [] -files: -- "boost_1_55_0.tar.bz2" -- "boost-mingw-gas-cross-compile-2013-03-03.patch" -script: | - # Defines - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME - export TZ=UTC - INDIR=$HOME/build - TEMPDIR=$HOME/tmp - # Input Integrity Check - echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | shasum -c - echo "d2b7f6a1d7051faef3c9cf41a92fa3671d905ef1e1da920d07651a43299f6268 boost-mingw-gas-cross-compile-2013-03-03.patch" | shasum -c - - for BITS in 32 64; do # for architectures - # - INSTALLPREFIX=$HOME/staging${BITS} - BUILDDIR=$HOME/build${BITS} - if [ "x$BITS" = "x32" ]; then - HOST=i686-w64-mingw32 - else - HOST=x86_64-w64-mingw32 - fi - # - mkdir -p $INSTALLPREFIX $BUILDDIR - cd $BUILDDIR - # - tar --warning=no-timestamp -xjf $INDIR/boost_1_55_0.tar.bz2 - cd boost_1_55_0 - GCCVERSION=$($HOST-g++ -E -dM $(mktemp --suffix=.h) | grep __VERSION__ | cut -d ' ' -f 3 | cut -d '"' -f 2) - echo "using gcc : $GCCVERSION : $HOST-g++ - : - $HOST-windres - $HOST-ar - -frandom-seed=boost1 - $HOST-ranlib - ;" > user-config.jam - ./bootstrap.sh --without-icu - - # Workaround: Upstream boost dev refuses to include patch that would allow Free Software cross-compile toolchain to work - # This patch was authored by the Fedora package developer and ships in Fedora's mingw32-boost. - # Please obtain the exact patch that matches the above sha256sum from one of the following mirrors. - # - # Read History: https://svn.boost.org/trac/boost/ticket/7262 - # History Mirror: http://rose.makesad.us/~paulproteus/mirrors/7262%20Boost.Context%20fails%20to%20build%20using%20MinGW.html - # - # Patch: https://svn.boost.org/trac/boost/raw-attachment/ticket/7262/boost-mingw.patch - # Patch Mirror: http://wtogami.fedorapeople.org/boost-mingw-gas-cross-compile-2013-03-03.patch - # Patch Mirror: http://mindstalk.net/host/boost-mingw-gas-cross-compile-2013-03-03.patch - # Patch Mirror: http://rose.makesad.us/~paulproteus/mirrors/boost-mingw-gas-cross-compile-2013-03-03.patch - patch -p0 < $INDIR/boost-mingw-gas-cross-compile-2013-03-03.patch - - # Bug Workaround: boost-1.54.0 broke the ability to disable zlib, still broken in 1.55 - # https://svn.boost.org/trac/boost/ticket/9156 - sed -i 's^\[ ac.check-library /zlib//zlib : /zlib//zlib^^' libs/iostreams/build/Jamfile.v2 - sed -i 's^zlib.cpp gzip.cpp \]^^' libs/iostreams/build/Jamfile.v2 - - # http://statmt.org/~s0565741/software/boost_1_52_0/libs/context/doc/html/context/requirements.html - # "For cross-compiling the lib you must specify certain additional properties at bjam command line: target-os, abi, binary-format, architecture and address-model." - ./bjam toolset=gcc binary-format=pe target-os=windows threadapi=win32 address-model=$BITS threading=multi variant=release link=static runtime-link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete --prefix="$INSTALLPREFIX" $MAKEOPTS install - # post-process all generated libraries to be deterministic - # extract them to a temporary directory then re-build them deterministically - for LIB in $(find $INSTALLPREFIX -name \*.a); do - rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR - $HOST-ar xv $LIB | cut -b5- > /tmp/list.txt - rm $LIB - $HOST-ar crsD $LIB $(cat /tmp/list.txt) - done - # - cd "$INSTALLPREFIX" - find | sort | zip -X@ $OUTDIR/boost-win$BITS-1.55.0-gitian-r6.zip - done # for BITS in - diff --git a/contrib/gitian-descriptors/deps-linux.yml b/contrib/gitian-descriptors/deps-linux.yml deleted file mode 100644 index 8221222133..0000000000 --- a/contrib/gitian-descriptors/deps-linux.yml +++ /dev/null @@ -1,98 +0,0 @@ ---- -name: "bitcoin" -suites: -- "precise" -architectures: -- "i386" -- "amd64" -packages: -- "g++" -- "unzip" -- "zip" -- "pkg-config" -- "libtool" -- "faketime" -- "bsdmainutils" -reference_datetime: "2013-06-01 00:00:00" -remotes: [] -files: -- "openssl-1.0.1h.tar.gz" -- "miniupnpc-1.9.tar.gz" -- "qrencode-3.4.3.tar.bz2" -- "protobuf-2.5.0.tar.bz2" -- "db-4.8.30.NC.tar.gz" -script: | - STAGING="$HOME/install" - TEMPDIR="$HOME/tmp" - OPTFLAGS='-O2' - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME - export TZ=UTC - export LIBRARY_PATH="$STAGING/lib" - # Integrity Check - echo "9d1c8a9836aa63e2c6adb684186cbd4371c9e9dcc01d6e3bb447abf2d4d3d093 openssl-1.0.1h.tar.gz" | sha256sum -c - echo "2923e453e880bb949e3d4da9f83dd3cb6f08946d35de0b864d0339cf70934464 miniupnpc-1.9.tar.gz" | sha256sum -c - echo "dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b50597a98 qrencode-3.4.3.tar.bz2" | sha256sum -c - echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c - echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c - - # - tar xzf openssl-1.0.1h.tar.gz - cd openssl-1.0.1h - # need -fPIC to avoid relocation error in 64 bit builds - ./config no-shared no-zlib no-dso no-krb5 --openssldir=$STAGING -fPIC - # need to build OpenSSL with faketime because a timestamp is embedded into cversion.o - make - make install_sw - cd .. - # - tar xzfm miniupnpc-1.9.tar.gz - cd miniupnpc-1.9 - # miniupnpc is always built with -fPIC - INSTALLPREFIX=$STAGING make $MAKEOPTS install - rm -f $STAGING/lib/libminiupnpc.so* # no way to skip shared lib build - cd .. - # - tar xjf qrencode-3.4.3.tar.bz2 - cd qrencode-3.4.3 - unset FAKETIME # unset fake time during configure, as it does some clock sanity tests - # need --with-pic to avoid relocation error in 64 bit builds - ./configure --prefix=$STAGING --enable-static --disable-shared --with-pic --without-tools --disable-dependency-tracking - # Workaround to prevent re-configuring by make; make all files have a date in the past - find . -print0 | xargs -r0 touch -t 200001010000 - export FAKETIME=$REFERENCE_DATETIME - make $MAKEOPTS install - cd .. - # - tar xjf protobuf-2.5.0.tar.bz2 - cd protobuf-2.5.0 - mkdir -p $STAGING/host/bin - unset FAKETIME # unset fake time during configure, as it does some clock sanity tests - # need --with-pic to avoid relocation error in 64 bit builds - ./configure --prefix=$STAGING --bindir=$STAGING/host/bin --enable-static --disable-shared --with-pic --without-zlib - # Workaround to prevent re-configuring by make; make all files have a date in the past - find . -print0 | xargs -r0 touch -t 200001010000 - export FAKETIME=$REFERENCE_DATETIME - make $MAKEOPTS install - cd .. - # - tar xzf db-4.8.30.NC.tar.gz - cd db-4.8.30.NC/build_unix - # need --with-pic to avoid relocation error in 64 bit builds - ../dist/configure --prefix=$STAGING --enable-cxx --disable-shared --with-pic - # Workaround to prevent re-configuring by make; make all files have a date in the past - find . -print0 | xargs -r0 touch -t 200001010000 - make $MAKEOPTS library_build - make install_lib install_include - cd ../.. - # post-process all generated libraries to be deterministic - # extract them to a temporary directory then re-build them deterministically - for LIB in $(find $STAGING -name \*.a); do - rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR - ar xv $LIB | cut -b5- > /tmp/list.txt - rm $LIB - ar crsD $LIB $(cat /tmp/list.txt) - done - # - cd $STAGING - find include lib bin host | sort | zip -X@ $OUTDIR/bitcoin-deps-linux${GBUILD_BITS}-gitian-r6.zip diff --git a/contrib/gitian-descriptors/deps-win.yml b/contrib/gitian-descriptors/deps-win.yml deleted file mode 100644 index fe02950ef9..0000000000 --- a/contrib/gitian-descriptors/deps-win.yml +++ /dev/null @@ -1,128 +0,0 @@ ---- -name: "bitcoin-deps" -suites: -- "precise" -architectures: -- "amd64" -packages: -- "mingw-w64" -- "g++-mingw-w64" -- "git-core" -- "zip" -- "faketime" -- "psmisc" -reference_datetime: "2011-01-30 00:00:00" -remotes: [] -files: -- "openssl-1.0.1h.tar.gz" -- "db-4.8.30.NC.tar.gz" -- "miniupnpc-1.9.tar.gz" -- "zlib-1.2.8.tar.gz" -- "libpng-1.6.8.tar.gz" -- "qrencode-3.4.3.tar.bz2" -script: | - # - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME - export TZ=UTC - INDIR=$HOME/build - TEMPDIR=$HOME/tmp - # Input Integrity Check - echo "9d1c8a9836aa63e2c6adb684186cbd4371c9e9dcc01d6e3bb447abf2d4d3d093 openssl-1.0.1h.tar.gz" | sha256sum -c - echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c - echo "2923e453e880bb949e3d4da9f83dd3cb6f08946d35de0b864d0339cf70934464 miniupnpc-1.9.tar.gz" | sha256sum -c - echo "36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d zlib-1.2.8.tar.gz" | sha256sum -c - echo "32c7acf1608b9c8b71b743b9780adb7a7b347563dbfb4a5263761056da44cc96 libpng-1.6.8.tar.gz" | sha256sum -c - echo "dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b50597a98 qrencode-3.4.3.tar.bz2" | sha256sum -c - - for BITS in 32 64; do # for architectures - # - INSTALLPREFIX=$HOME/staging${BITS} - BUILDDIR=$HOME/build${BITS} - if [ "x$BITS" = "x32" ]; then - HOST=i686-w64-mingw32 - else - HOST=x86_64-w64-mingw32 - fi - # - mkdir -p $INSTALLPREFIX $BUILDDIR - cd $BUILDDIR - # - tar xzf $INDIR/openssl-1.0.1h.tar.gz - cd openssl-1.0.1h - if [ "x$BITS" = "x32" ]; then - OPENSSL_TGT=mingw - else - OPENSSL_TGT=mingw64 - fi - ./Configure --cross-compile-prefix=$HOST- ${OPENSSL_TGT} no-shared no-dso --openssldir=$INSTALLPREFIX - make - make install_sw - cd .. - # - tar xzf $INDIR/db-4.8.30.NC.tar.gz - cd db-4.8.30.NC/build_unix - ../dist/configure --prefix=$INSTALLPREFIX --enable-mingw --enable-cxx --host=$HOST --disable-shared - make $MAKEOPTS library_build - make install_lib install_include - cd ../.. - # - tar xzf $INDIR/miniupnpc-1.9.tar.gz - cd miniupnpc-1.9 - echo " - --- miniupnpc-1.9/Makefile.mingw.orig 2013-09-29 18:52:51.014087958 -1000 - +++ miniupnpc-1.9/Makefile.mingw 2013-09-29 19:09:29.663318691 -1000 - @@ -67,8 +67,8 @@ - - wingenminiupnpcstrings.o: wingenminiupnpcstrings.c - - -miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings - - wingenminiupnpcstrings \$< \$@ - +miniupnpcstrings.h: miniupnpcstrings.h.in - + sed -e 's|OS/version|MSWindows/5.1.2600|' -e 's|MINIUPNPC_VERSION_STRING \"version\"|MINIUPNPC_VERSION_STRING \"VERSIONHERE\"|' \$< > \$@ - - minixml.o: minixml.c minixml.h miniupnpcstrings.h - - " | sed "s/VERSIONHERE/$(cat VERSION)/" | patch -p1 - mkdir -p dll - make -f Makefile.mingw CC=$HOST-gcc AR=$HOST-ar libminiupnpc.a - install -d $INSTALLPREFIX/include/miniupnpc - install *.h $INSTALLPREFIX/include/miniupnpc - install libminiupnpc.a $INSTALLPREFIX/lib - cd .. - # - tar xzf $INDIR/zlib-1.2.8.tar.gz - cd zlib-1.2.8 - CROSS_PREFIX=$HOST- ./configure --prefix=$INSTALLPREFIX --static - make - make install - cd .. - # - tar xzf $INDIR/libpng-1.6.8.tar.gz - cd libpng-1.6.8 - OPT="-O2" - CPPFLAGS="${OPT} -I$INSTALLPREFIX/include" CFLAGS="${OPT} -I$INSTALLPREFIX/include" LDFLAGS="${OPT} -L$INSTALLPREFIX/lib" ./configure --disable-shared --prefix=$INSTALLPREFIX --host=$HOST - make $MAKEOPTS - make install - cd .. - # - tar xjf $INDIR/qrencode-3.4.3.tar.bz2 - cd qrencode-3.4.3 - png_CFLAGS="-I$INSTALLPREFIX/include" png_LIBS="-L$INSTALLPREFIX/lib -lpng" ./configure --prefix=$INSTALLPREFIX --host=$HOST --enable-static --disable-shared --without-tools --disable-dependency-tracking - # Workaround to prevent re-configuring by make (resulting in missing m4 error); make all files have a date in the past - find . -print0 | xargs -r0 touch -t 200001010000 - make - make install - cd .. - # post-process all generated libraries to be deterministic - # extract them to a temporary directory then re-build them deterministically - for LIB in $(find $INSTALLPREFIX -name \*.a); do - rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR - $HOST-ar xv $LIB | cut -b5- > /tmp/list.txt - rm $LIB - $HOST-ar crsD $LIB $(cat /tmp/list.txt) - done - # - cd $INSTALLPREFIX - find include lib | sort | zip -X@ $OUTDIR/bitcoin-deps-win$BITS-gitian-r13.zip - done # for BITS in diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index 30b0227bdd..69de6bf623 100644 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -1,86 +1,94 @@ --- -name: "bitcoin" +name: "bitcoin-linux-0.10" +enable_cache: true suites: - "precise" architectures: -- "i386" - "amd64" packages: -- "g++" +- "g++-multilib" - "git-core" -- "unzip" - "pkg-config" - "autoconf2.13" - "libtool" - "automake" - "faketime" - "bsdmainutils" -- "libqt4-core" -- "libqt4-gui" -- "libqt4-dbus" -- "libqt4-network" -- "libqt4-test" +- "binutils-gold" reference_datetime: "2013-06-01 00:00:00" remotes: - "url": "https://github.com/bitcoin/bitcoin.git" "dir": "bitcoin" -files: -- "bitcoin-deps-linux32-gitian-r6.zip" -- "bitcoin-deps-linux64-gitian-r6.zip" -- "boost-linux32-1.55.0-gitian-r1.zip" -- "boost-linux64-1.55.0-gitian-r1.zip" -- "qt-linux32-4.6.4-gitian-r1.tar.gz" -- "qt-linux64-4.6.4-gitian-r1.tar.gz" +files: [] script: | - STAGING="$HOME/install" - OPTFLAGS='-O2' - BINDIR="${OUTDIR}/bin/${GBUILD_BITS}" # 32/64 bit build specific output directory - TEMPDIR="$HOME/tempdir" - export TZ=UTC - export LIBRARY_PATH="$STAGING/lib" - export PATH="$STAGING/bin:$PATH" - mkdir -p ${BINDIR} - # - mkdir -p $STAGING - cd $STAGING - unzip ../build/bitcoin-deps-linux${GBUILD_BITS}-gitian-r6.zip - unzip ../build/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip - tar -zxf ../build/qt-linux${GBUILD_BITS}-4.6.4-gitian-r1.tar.gz - cd ../build + WRAP_DIR=$HOME/wrapped + HOSTS="i686-pc-linux-gnu x86_64-unknown-linux-gnu" + CONFIGFLAGS="--enable-upnp-default --enable-glibc-back-compat" + FAKETIME_HOST_PROGS="" + FAKETIME_PROGS="date ar ranlib nm strip" + + export QT_RCC_TEST=1 + export GZIP="-9n" + export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" + export TZ="UTC" + export BUILD_DIR=`pwd` + mkdir -p ${WRAP_DIR} + if test -n "$GBUILD_CACHE_ENABLED"; then + export SOURCES_PATH=${GBUILD_COMMON_CACHE} + export BASE_CACHE=${GBUILD_PACKAGE_CACHE} + mkdir -p ${BASE_CACHE} ${SOURCES_PATH} + fi + + # Create global faketime wrappers + for prog in ${FAKETIME_PROGS}; do + echo '#!/bin/bash' > ${WRAP_DIR}/${prog} + echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog} + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} + echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${prog} + chmod +x ${WRAP_DIR}/${prog} + done + + # Create per-host faketime wrappers + for i in $HOSTS; do + for prog in ${FAKETIME_HOST_PROGS}; do + echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog} + echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} + echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${i}-${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} + chmod +x ${WRAP_DIR}/${i}-${prog} + done + done + export PATH=${WRAP_DIR}:${PATH} - # Avoid exporting *any* symbols from the executable - # This avoids conflicts between the libraries statically linked into bitcoin and any - # libraries we may link dynamically (such as Qt and OpenSSL, see issue #4094). - # It also avoids start-up overhead to not export any unnecessary symbols. - # To do this, build a linker script that marks all symbols as local. - LINKER_SCRIPT=$HOME/build/linker_version_script - echo ' - { - local: *; - };' > $LINKER_SCRIPT - function do_configure { - ./configure "$@" --enable-upnp-default --prefix=$STAGING --with-protoc-bindir=$STAGING/host/bin --with-qt-bindir=$STAGING/bin --with-boost=$STAGING --disable-maintainer-mode --disable-dependency-tracking PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib -Wl,--version-script=$LINKER_SCRIPT ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" --enable-glibc-back-compat - } - # cd bitcoin + BASEPREFIX=`pwd`/depends + # Build dependencies for each host + for i in $HOSTS; do + make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" + done + + # Create the release tarball using (arbitrarily) the first host ./autogen.sh - do_configure + ./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'` make dist DISTNAME=`echo bitcoin-*.tar.gz` - # Build dynamic versions of everything - # (with static linking to boost and openssl as well a some non-OS deps) - mkdir -p distsrc - cd distsrc - tar --strip-components=1 -xf ../$DISTNAME - do_configure --bindir=$BINDIR - make $MAKEOPTS - make $MAKEOPTS install-strip - make $MAKEOPTS clean + ORIGPATH="$PATH" + # Extract the release tarball into a dir for each host and build + for i in ${HOSTS}; do + export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH} + mkdir -p distsrc-${i} + cd distsrc-${i} + tar --strip-components=1 -xf ../$DISTNAME - # sort distribution tar file and normalize user/group/mtime information for deterministic output + ./configure --prefix=${BASEPREFIX}/${i} --bindir=${OUTDIR}/${i}/bin --includedir=${OUTDIR}/${i}/include --libdir=${OUTDIR}/${i}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} + make ${MAKEOPTS} + make install-strip + cd .. + done mkdir -p $OUTDIR/src - rm -rf $TEMPDIR - mkdir -p $TEMPDIR - cd $TEMPDIR - tar -xvf $HOME/build/bitcoin/$DISTNAME | sort | tar --no-recursion -cT /dev/stdin --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 --mtime="$REFERENCE_DATETIME" | gzip -n > $OUTDIR/src/$DISTNAME + mv $DISTNAME $OUTDIR/src + mv ${OUTDIR}/x86_64-* ${OUTDIR}/64 + mv ${OUTDIR}/i686-* ${OUTDIR}/32 diff --git a/contrib/gitian-descriptors/gitian-osx-bitcoin.yml b/contrib/gitian-descriptors/gitian-osx-bitcoin.yml deleted file mode 100644 index bc3d561c35..0000000000 --- a/contrib/gitian-descriptors/gitian-osx-bitcoin.yml +++ /dev/null @@ -1,61 +0,0 @@ ---- -name: "bitcoin" -suites: -- "precise" -architectures: -- "i386" -packages: -- "git-core" -- "automake" -- "faketime" -- "bsdmainutils" -- "pkg-config" -- "p7zip-full" -- "libtool" - -reference_datetime: "2013-06-01 00:00:00" -remotes: -- "url": "https://github.com/bitcoin/bitcoin.git" - "dir": "bitcoin" -files: -- "osx-native-depends-r3.tar.gz" -- "osx-depends-r4.tar.gz" -- "osx-depends-qt-5.2.1-r4.tar.gz" -- "MacOSX10.7.sdk.tar.gz" - -script: | - - HOST=x86_64-apple-darwin11 - PREFIX=`pwd`/osx-cross-depends/prefix - SDK=`pwd`/osx-cross-depends/SDKs/MacOSX10.7.sdk - NATIVEPREFIX=`pwd`/osx-cross-depends/native-prefix - export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" - - export SOURCES_PATH=`pwd` - - mkdir -p osx-cross-depends/SDKs - - tar -C osx-cross-depends/SDKs -xf ${SOURCES_PATH}/MacOSX10.7.sdk.tar.gz - - tar -C osx-cross-depends -xf osx-native-depends-r3.tar.gz - tar -C osx-cross-depends -xf osx-depends-r4.tar.gz - tar -C osx-cross-depends -xf osx-depends-qt-5.2.1-r4.tar.gz - export PATH=`pwd`/osx-cross-depends/native-prefix/bin:$PATH - - cd bitcoin - - export ZERO_AR_DATE=1 - export QT_RCC_TEST=1 - ./autogen.sh - ./configure --host=${HOST} --with-boost=${PREFIX} CC=clang CXX=clang++ OBJC=clang OBJCXX=clang++ CFLAGS="-target ${HOST} -mmacosx-version-min=10.6 --sysroot ${SDK} -msse2 -Qunused-arguments" CXXFLAGS="-target ${HOST} -mmacosx-version-min=10.6 --sysroot ${SDK} -msse2 -Qunused-arguments" LDFLAGS="-B${NATIVEPREFIX}/bin -L${PREFIX}/lib -L${SDK}/usr/lib/i686-apple-darwin10/4.2.1" CPPFLAGS="-I${NATIVEPREFIX}/lib/clang/3.2/include -I${PREFIX}/include" SSL_LIBS="-lz -lssl -lcrypto" --disable-tests -with-gui=qt5 PKG_CONFIG_LIBDIR="${PREFIX}/lib/pkgconfig" --disable-dependency-tracking --disable-maintainer-mode - make dist - mkdir -p distsrc - cd distsrc - tar --strip-components=1 -xf ../bitcoin-*.tar* - ./configure --host=${HOST} --with-boost=${PREFIX} CC=clang CXX=clang++ OBJC=clang OBJCXX=clang++ CFLAGS="-target ${HOST} -mmacosx-version-min=10.6 --sysroot ${SDK} -msse2 -Qunused-arguments" CXXFLAGS="-target ${HOST} -mmacosx-version-min=10.6 --sysroot ${SDK} -msse2 -Qunused-arguments" LDFLAGS="-B${NATIVEPREFIX}/bin -L${PREFIX}/lib -L${SDK}/usr/lib/i686-apple-darwin10/4.2.1" CPPFLAGS="-I${NATIVEPREFIX}/lib/clang/3.2/include -I${PREFIX}/include" SSL_LIBS="-lz -lssl -lcrypto" --disable-tests -with-gui=qt5 PKG_CONFIG_LIBDIR="${PREFIX}/lib/pkgconfig" --disable-dependency-tracking --disable-maintainer-mode - make $MAKEOPTS - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME - export TZ=UTC - make deploy - dmg dmg Bitcoin-Qt.dmg $OUTDIR/Bitcoin-Qt.dmg diff --git a/contrib/gitian-descriptors/gitian-osx-depends.yml b/contrib/gitian-descriptors/gitian-osx-depends.yml deleted file mode 100644 index 07a021cf0c..0000000000 --- a/contrib/gitian-descriptors/gitian-osx-depends.yml +++ /dev/null @@ -1,159 +0,0 @@ ---- -name: "osx-depends" -suites: -- "precise" -architectures: -- "i386" -packages: -- "git-core" -- "automake" -- "p7zip-full" - -reference_datetime: "2013-06-01 00:00:00" -remotes: [] -files: -- "boost_1_55_0.tar.bz2" -- "db-4.8.30.NC.tar.gz" -- "miniupnpc-1.9.tar.gz" -- "openssl-1.0.1h.tar.gz" -- "protobuf-2.5.0.tar.bz2" -- "qrencode-3.4.3.tar.bz2" -- "MacOSX10.7.sdk.tar.gz" -- "osx-native-depends-r3.tar.gz" - -script: | - - echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | sha256sum -c - echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c - echo "2923e453e880bb949e3d4da9f83dd3cb6f08946d35de0b864d0339cf70934464 miniupnpc-1.9.tar.gz" | sha256sum -c - echo "9d1c8a9836aa63e2c6adb684186cbd4371c9e9dcc01d6e3bb447abf2d4d3d093 openssl-1.0.1h.tar.gz" | sha256sum -c - echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c - echo "dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b50597a98 qrencode-3.4.3.tar.bz2" | sha256sum -c - - REVISION=r4 - export SOURCES_PATH=`pwd` - export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" - export PATH=$HOME:$PATH - export SOURCES_PATH=`pwd` - export ZERO_AR_DATE=1 - - mkdir -p osx-cross-depends/build - cd osx-cross-depends - - PREFIX=`pwd`/prefix - NATIVEPREFIX=`pwd`/native-prefix - BUILD_BASE=`pwd`/build - SDK=`pwd`/SDKs/MacOSX10.7.sdk - HOST=x86_64-apple-darwin11 - MIN_VERSION=10.6 - - INT_CFLAGS="-target ${HOST} -mmacosx-version-min=${MIN_VERSION} --sysroot ${SDK} -msse2 -Qunused-arguments" - INT_CXXFLAGS="${INT_CFLAGS}" - INT_LDFLAGS="-L${PREFIX}/lib -L${SDK}/usr/lib/i686-apple-darwin10/4.2.1" - INT_LDFLAGS_CLANG="-B${NATIVEPREFIX}/bin" - INT_CPPFLAGS="-I${PREFIX}/include" - INT_CC=clang - INT_CXX=clang++ - INT_OBJC=clang - INT_OBJCXX=clang++ - INT_AR=${HOST}-ar - INT_RANLIB=${HOST}-ranlib - INT_LIBTOOL=${HOST}-libtool - INT_INSTALL_NAME_TOOL=${HOST}-install_name_tool - - export PATH=${NATIVEPREFIX}/bin:${PATH} - - mkdir -p ${NATIVEPREFIX}/bin - mkdir -p ${NATIVEPREFIX}/lib - mkdir -p ${PREFIX}/bin - mkdir -p ${PREFIX}/lib - mkdir -p ${BUILD_BASE} - - mkdir -p SDKs - tar -C SDKs -xf ${SOURCES_PATH}/MacOSX10.7.sdk.tar.gz - - tar xf /home/ubuntu/build/osx-native-depends-r3.tar.gz - - # bdb - SOURCE_FILE=${SOURCES_PATH}/db-4.8.30.NC.tar.gz - BUILD_DIR=${BUILD_BASE}/db-4.8.30.NC - - tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} - sed -i 's/__atomic_compare_exchange/__atomic_compare_exchange_db/g' ${BUILD_DIR}/dbinc/atomic.h - pushd ${BUILD_DIR} - cd build_unix; - ../dist/configure --host=${HOST} --prefix="${PREFIX}" --disable-shared --enable-cxx CC="${INT_CC}" CXX="${INT_CXX}" AR="${INT_AR}" RANLIB="${INT_RANLIB}" OBJC="${INT_OBJC}" OBJCXX="${INT_OBJCXX}" CFLAGS="${INT_CFLAGS}" CXXFLAGS="${INT_CXXFLAGS}" LDFLAGS="${INT_CLANG_LDFLAGS} ${INT_LDFLAGS}" CPPFLAGS="${INT_CPPFLAGS}" - make $MAKEOPTS libdb.a libdb_cxx.a - make install_lib install_include - popd - - # openssl - SOURCE_FILE=${SOURCES_PATH}/openssl-1.0.1h.tar.gz - BUILD_DIR=${BUILD_BASE}/openssl-1.0.1h - - tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} - pushd ${BUILD_DIR} - sed -ie "s|cc:|${INT_CC}:|" ${BUILD_DIR}/Configure - sed -ie "s|\(-arch [_a-zA-Z0-9]*\)|\1 --sysroot ${SDK} -target ${HOST} -msse2|" ${BUILD_DIR}/Configure - AR="${INT_AR}" RANLIB="${INT_RANLIB}" ./Configure --prefix=${PREFIX} --openssldir=${PREFIX}/etc/openssl zlib shared no-krb5 darwin64-x86_64-cc ${INT_LDFLAGS} ${INT_CLANG_LDFLAGS} ${INT_CPPFLAGS} - sed -i "s|engines apps test|engines|" ${BUILD_DIR}/Makefile - sed -i "/define DATE/d" ${BUILD_DIR}/crypto/Makefile - make -j1 build_libs libcrypto.pc libssl.pc openssl.pc - make -j1 install_sw - popd - - #libminiupnpc - SOURCE_FILE=${SOURCES_PATH}/miniupnpc-1.9.tar.gz - BUILD_DIR=${BUILD_BASE}/miniupnpc-1.9 - - tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} - pushd ${BUILD_DIR} - CFLAGS="${INT_CFLAGS} ${INT_CPPFLAGS}" make $MAKEOPTS OS=Darwin CC="${INT_CC}" AR="${INT_AR}" libminiupnpc.a - install -d ${PREFIX}/include/miniupnpc - install *.h ${PREFIX}/include/miniupnpc - install libminiupnpc.a ${PREFIX}/lib - popd - - # qrencode - SOURCE_FILE=${SOURCES_PATH}/qrencode-3.4.3.tar.bz2 - BUILD_DIR=${BUILD_BASE}/qrencode-3.4.3 - tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} - pushd ${BUILD_DIR} - - # m4 folder is not included in the stable release, which can confuse aclocal - # if its timestamp ends up being earlier than configure.ac when extracted - touch aclocal.m4 - ./configure --host=${HOST} --prefix="${PREFIX}" --disable-shared CC="${INT_CC}" CXX="${INT_CXX}" AR="${INT_AR}" RANLIB="${INT_RANLIB}" OBJC="${INT_OBJC}" OBJCXX="${INT_OBJCXX}" CFLAGS="${INT_CFLAGS}" CXXFLAGS="${INT_CXXFLAGS}" LDFLAGS="${INT_CLANG_LDFLAGS} ${INT_LDFLAGS}" CPPFLAGS="${INT_CPPFLAGS}" --disable-shared -without-tools --disable-sdltest --disable-dependency-tracking - make $MAKEOPTS - make install - popd - - # libprotobuf - SOURCE_FILE=${SOURCES_PATH}/protobuf-2.5.0.tar.bz2 - BUILD_DIR=${BUILD_BASE}/protobuf-2.5.0 - - tar -C ${BUILD_BASE} -xjf ${SOURCE_FILE} - pushd ${BUILD_DIR} - ./configure --host=${HOST} --prefix="${PREFIX}" --disable-shared --enable-cxx CC="${INT_CC}" CXX="${INT_CXX}" AR="${INT_AR}" RANLIB="${INT_RANLIB}" OBJC="${INT_OBJC}" OBJCXX="${INT_OBJCXX}" CFLAGS="${INT_CFLAGS}" CXXFLAGS="${INT_CXXFLAGS}" LDFLAGS="${INT_CLANG_LDFLAGS} ${INT_LDFLAGS}" CPPFLAGS="${INT_CPPFLAGS}" --enable-shared=no --disable-dependency-tracking --with-protoc=${NATIVEPREFIX}/bin/protoc - cd src - make $MAKEOPTS libprotobuf.la - make install-libLTLIBRARIES install-nobase_includeHEADERS - cd .. - make install-pkgconfigDATA - popd - - # boost - SOURCE_FILE=${SOURCES_PATH}/boost_1_55_0.tar.bz2 - BUILD_DIR=${BUILD_BASE}/boost_1_55_0 - - tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} - pushd ${BUILD_DIR} - ./bootstrap.sh --with-libraries=chrono,filesystem,program_options,system,thread,test - echo "using darwin : : ${INT_CXX} : \"${INT_CFLAGS} ${INT_CPPFLAGS}\" \"${INT_LDFLAGS} ${INT_CLANG_LDFLAGS}\" \"${INT_LIBTOOL}\" \"${INT_STRIP}\" : ;" > "user-config.jam" - ./b2 -d2 --layout=tagged --build-type=complete --prefix="${PREFIX}" --toolset=darwin-4.2.1 --user-config=user-config.jam variant=release threading=multi link=static install - popd - - export GZIP="-9n" - find prefix | sort | tar --no-recursion -czf osx-depends-${REVISION}.tar.gz -T - - - mv osx-depends-${REVISION}.tar.gz $OUTDIR diff --git a/contrib/gitian-descriptors/gitian-osx-native.yml b/contrib/gitian-descriptors/gitian-osx-native.yml deleted file mode 100644 index a753ad704f..0000000000 --- a/contrib/gitian-descriptors/gitian-osx-native.yml +++ /dev/null @@ -1,178 +0,0 @@ ---- -name: "osx-native" -suites: -- "precise" -architectures: -- "i386" -packages: -- "git-core" -- "automake" -- "faketime" -- "libssl-dev" -- "libbz2-dev" -- "libz-dev" -- "cmake" -- "libcap-dev" -- "p7zip-full" -- "uuid-dev" - -reference_datetime: "2013-06-01 00:00:00" -remotes: [] -files: -- "10cc648683617cca8bcbeae507888099b41b530c.tar.gz" -- "cctools-809.tar.gz" -- "dyld-195.5.tar.gz" -- "ld64-127.2.tar.gz" -- "protobuf-2.5.0.tar.bz2" -- "MacOSX10.7.sdk.tar.gz" -- "cdrkit-1.1.11.tar.gz" -- "libdmg-hfsplus-v0.1.tar.gz" -- "clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz" -- "cdrkit-deterministic.patch" - - -script: | - - echo "18406961fd4a1ec5c7ea35c91d6a80a2f8bb797a2bd243a610bd75e13eff9aca 10cc648683617cca8bcbeae507888099b41b530c.tar.gz" | sha256sum -c - echo "03ba62749b843b131c7304a044a98c6ffacd65b1399b921d69add0375f79d8ad cctools-809.tar.gz" | sha256sum -c - echo "2cf0484c87cf79b606b351a7055a247dae84093ae92c747a74e0cde2c8c8f83c dyld-195.5.tar.gz" | sha256sum -c - echo "97b75547b2bd761306ab3e15ae297f01e7ab9760b922bc657f4ef72e4e052142 ld64-127.2.tar.gz" | sha256sum -c - echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c - echo "d1c030756ecc182defee9fe885638c1785d35a2c2a297b4604c0e0dcc78e47da cdrkit-1.1.11.tar.gz" | sha256sum -c - echo "6569a02eb31c2827080d7d59001869ea14484c281efab0ae7f2b86af5c3120b3 libdmg-hfsplus-v0.1.tar.gz" | sha256sum -c - echo "b9d57a88f9514fa1f327a1a703756d0c1c960f4c58494a5bd80313245d13ffff clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz" | sha256sum -c - echo "cc12bdbd7a09f71cb2a6a3e6ec3e0abe885ca7111c2b47857f5095e5980caf4f cdrkit-deterministic.patch" | sha256sum -c - - - REVISION=r3 - export REFERENCE_DATETIME - export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" - export FAKETIME=$REFERENCE_DATETIME - export TZ=UTC - - REAL_AR=`which ar` - REAL_RANLIB=`which ranlib` - REAL_DATE=`which date` - - echo '#!/bin/bash' > $HOME/ar - echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> $HOME/ar - echo "$REAL_AR \"\$@\"" >> $HOME/ar - - echo '#!/bin/bash' > $HOME/ranlib - echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> $HOME/ranlib - echo "$REAL_RANLIB \"\$@\"" >> $HOME/ranlib - - echo '#!/bin/bash' > $HOME/date - echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> $HOME/date - echo "$REAL_DATE \"\$@\"" >> $HOME/date - - chmod +x $HOME/ar $HOME/ranlib $HOME/date - - - export PATH=$HOME:$PATH - export SOURCES_PATH=`pwd` - - mkdir -p osx-cross-depends/build - cd osx-cross-depends - - NATIVEPREFIX=`pwd`/native-prefix - BUILD_BASE=`pwd`/build - SDK=`pwd`/SDKs/MacOSX10.7.sdk - HOST=x86_64-apple-darwin11 - MIN_VERSION=10.6 - - CFLAGS="" - CXXFLAGS="${CFLAGS}" - LDFLAGS="-L${NATIVEPREFIX}/lib" - - export PATH=${NATIVEPREFIX}/bin:${PATH} - - mkdir -p ${NATIVEPREFIX}/bin - mkdir -p ${NATIVEPREFIX}/lib - - mkdir -p SDKs - tar -C SDKs -xf ${SOURCES_PATH}/MacOSX10.7.sdk.tar.gz - - # Clang - SOURCE_FILE=${SOURCES_PATH}/clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz - BUILD_DIR=${BUILD_BASE}/clang+llvm-3.2-x86-linux-ubuntu-12.04 - - mkdir -p ${NATIVEPREFIX}/lib/clang/3.2/include - tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} - cp ${BUILD_DIR}/bin/clang ${NATIVEPREFIX}/bin/ - cp ${BUILD_DIR}/bin/clang++ ${NATIVEPREFIX}/bin/ - cp ${BUILD_DIR}/lib/libLTO.so ${NATIVEPREFIX}/lib/ - cp ${BUILD_DIR}/lib/clang/3.2/include/* ${NATIVEPREFIX}/lib/clang/3.2/include - - # cctools - SOURCE_FILE=${SOURCES_PATH}/10cc648683617cca8bcbeae507888099b41b530c.tar.gz - BUILD_DIR=${BUILD_BASE}/toolchain4-10cc648683617cca8bcbeae507888099b41b530c - - tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} - mkdir -p ${BUILD_DIR}/sdks - pushd ${BUILD_DIR}/sdks; - ln -sf ${SDK} MacOSX10.7.sdk - ln -sf ${SOURCES_PATH}/cctools-809.tar.gz ${BUILD_DIR}/cctools2odcctools/cctools-809.tar.gz - ln -sf ${SOURCES_PATH}/ld64-127.2.tar.gz ${BUILD_DIR}/cctools2odcctools/ld64-127.2.tar.gz - ln -sf ${SOURCES_PATH}/dyld-195.5.tar.gz ${BUILD_DIR}/cctools2odcctools/dyld-195.5.tar.gz - - tar -C ${BUILD_DIR} -xf ${SOURCES_PATH}/clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz - # Hack in the use of our llvm headers rather than grabbing the old llvm-gcc. - sed -i "s|GCC_DIR|LLVM_CLANG_DIR|g" ${BUILD_DIR}/cctools2odcctools/extract.sh - sed -i "s|llvmgcc42-2336.1|clang+llvm-3.2-x86-linux-ubuntu-12.04|g" ${BUILD_DIR}/cctools2odcctools/extract.sh - sed -i "s|\${LLVM_CLANG_DIR}/llvmCore/include/llvm-c|\${LLVM_CLANG_DIR}/include/llvm-c \${LLVM_CLANG_DIR}/include/llvm |" ${BUILD_DIR}/cctools2odcctools/extract.sh - - sed -i "s|fAC_INIT|AC_INIT|" ${BUILD_DIR}/cctools2odcctools/files/configure.ac - sed -i 's/\# Dynamically linked LTO/\t ;\&\n\t linux*)\n# Dynamically linked LTO/' ${BUILD_DIR}/cctools2odcctools/files/configure.ac - - cd ${BUILD_DIR}/cctools2odcctools - ./extract.sh --osxver 10.7 - cd odcctools-809 - ./configure --prefix=${NATIVEPREFIX} --target=${HOST} CFLAGS="${CFLAGS} -I${NATIVEPREFIX}/include -D__DARWIN_UNIX03 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS" LDFLAGS="${LDFLAGS} -Wl,-rpath=\\\$\$ORIGIN/../lib" --with-sysroot=${SDK} - - # The 'PC' define in sparc/reg.h conflicts but doesn't get used anyway. Just rename it. - sed -i "s|define\tPC|define\tPC_|" ${BUILD_DIR}/cctools2odcctools/odcctools-809/include/architecture/sparc/reg.h - make $MAKEOPTS - make install - popd - - # protoc - SOURCE_FILE=${SOURCES_PATH}/protobuf-2.5.0.tar.bz2 - BUILD_DIR=${BUILD_BASE}/protobuf-2.5.0 - - tar -C ${BUILD_BASE} -xjf ${SOURCE_FILE} - pushd ${BUILD_DIR}; - ./configure --enable-shared=no --disable-dependency-tracking --prefix=${NATIVEPREFIX} - make $MAKEOPTS - cp ${BUILD_DIR}/src/protoc ${NATIVEPREFIX}/bin/ - popd - - # cdrkit - SOURCE_FILE=${SOURCES_PATH}/cdrkit-1.1.11.tar.gz - BUILD_DIR=${BUILD_BASE}/cdrkit-1.1.11 - - tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} - pushd ${BUILD_DIR} - patch -p1 < ${SOURCES_PATH}/cdrkit-deterministic.patch - cmake -DCMAKE_INSTALL_PREFIX=${NATIVEPREFIX} - make $MAKEOPTS genisoimage - make -C genisoimage install - popd - - # libdmg-hfsplus - SOURCE_FILE=${SOURCES_PATH}/libdmg-hfsplus-v0.1.tar.gz - BUILD_DIR=${BUILD_BASE}/libdmg-hfsplus-libdmg-hfsplus-v0.1 - - tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} - mkdir -p ${BUILD_DIR}/build - pushd ${BUILD_DIR}/build - cmake -DCMAKE_INSTALL_PREFIX:PATH=${NATIVEPREFIX}/bin .. - make $MAKEOPTS - make install - popd - - rm -rf native-prefix/docs - - export GZIP="-9n" - find native-prefix | sort | tar --no-recursion -czf osx-native-depends-$REVISION.tar.gz -T - - mv osx-native-depends-$REVISION.tar.gz $OUTDIR diff --git a/contrib/gitian-descriptors/gitian-osx-qt.yml b/contrib/gitian-descriptors/gitian-osx-qt.yml deleted file mode 100644 index 5e0ad9222a..0000000000 --- a/contrib/gitian-descriptors/gitian-osx-qt.yml +++ /dev/null @@ -1,186 +0,0 @@ ---- -name: "osx-qt" -suites: -- "precise" -architectures: -- "i386" -packages: -- "git-core" -- "automake" -- "p7zip-full" - -reference_datetime: "2013-06-01 00:00:00" -remotes: [] -files: -- "qt-everywhere-opensource-src-5.2.1.tar.gz" -- "osx-native-depends-r3.tar.gz" -- "osx-depends-r4.tar.gz" -- "MacOSX10.7.sdk.tar.gz" - -script: | - - echo "84e924181d4ad6db00239d87250cc89868484a14841f77fb85ab1f1dbdcd7da1 qt-everywhere-opensource-src-5.2.1.tar.gz" | sha256sum -c - - REVISION=r4 - export SOURCES_PATH=`pwd` - export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" - export ZERO_AR_DATE=1 - - export TZ=UTC - - REAL_DATE=`which date` - echo '#!/bin/bash' > $HOME/date - echo "$REAL_DATE -d \"${REFERENCE_DATETIME}\" \"\$@\"" >> $HOME/date - - chmod +x $HOME/date - export PATH=$HOME:$PATH - - mkdir -p osx-cross-depends/build - cd osx-cross-depends - - PREFIX=`pwd`/prefix - NATIVEPREFIX=`pwd`/native-prefix - BUILD_BASE=`pwd`/build - SDK=`pwd`/SDKs/MacOSX10.7.sdk - HOST=x86_64-apple-darwin11 - MIN_VERSION=10.6 - - INT_CFLAGS="-target ${HOST} -mmacosx-version-min=${MIN_VERSION} --sysroot ${SDK} -msse2 -Qunused-arguments" - INT_CXXFLAGS="${INT_CFLAGS}" - INT_LDFLAGS="-L${PREFIX}/lib -L${SDK}/usr/lib/i686-apple-darwin10/4.2.1" - INT_LDFLAGS_CLANG="-B${NATIVEPREFIX}/bin" - INT_CPPFLAGS="-I${PREFIX}/include" - INT_CC=clang - INT_CXX=clang++ - INT_OBJC=clang - INT_OBJCXX=clang++ - INT_AR=${HOST}-ar - INT_RANLIB=${HOST}-ranlib - INT_LIBTOOL=${HOST}-libtool - INT_INSTALL_NAME_TOOL=${HOST}-install_name_tool - - export PATH=${NATIVEPREFIX}/bin:${PATH} - - mkdir -p ${NATIVEPREFIX}/bin - mkdir -p ${NATIVEPREFIX}/lib - mkdir -p ${PREFIX}/bin - mkdir -p ${PREFIX}/lib - mkdir -p ${BUILD_BASE} - - mkdir -p SDKs - tar -C SDKs -xf ${SOURCES_PATH}/MacOSX10.7.sdk.tar.gz - - tar xf /home/ubuntu/build/osx-native-depends-r3.tar.gz - - export PATH=`pwd`/native-prefix/bin:$PATH - tar xf /home/ubuntu/build/osx-depends-r4.tar.gz - - SOURCE_FILE=${SOURCES_PATH}/qt-everywhere-opensource-src-5.2.1.tar.gz - BUILD_DIR=${BUILD_BASE}/qt-everywhere-opensource-src-5.2.1 - - - tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} - - # Install our mkspec. All files are pulled from the macx-clang spec, except for - # our custom qmake.conf - SPECFILE=${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux/qmake.conf - - mkdir -p ${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux - cp -f ${BUILD_DIR}/qtbase/mkspecs/macx-clang/Info.plist.lib ${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux/ - cp -f ${BUILD_DIR}/qtbase/mkspecs/macx-clang/Info.plist.app ${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux/ - cp -f ${BUILD_DIR}/qtbase/mkspecs/macx-clang/qplatformdefs.h ${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux/ - - cat > ${SPECFILE} < ${WRAP_DIR}/${prog} + echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog} + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} + echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${prog} + chmod +x ${WRAP_DIR}/${prog} + done + + # Create per-host faketime wrappers + for i in $HOSTS; do + for prog in ${FAKETIME_HOST_PROGS}; do + echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog} + echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} + echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${i}-${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} + chmod +x ${WRAP_DIR}/${i}-${prog} + done + done + export PATH=${WRAP_DIR}:${PATH} + + cd bitcoin + BASEPREFIX=`pwd`/depends + + mkdir -p ${BASEPREFIX}/SDKs + tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/MacOSX10.7.sdk.tar.gz + + # Build dependencies for each host + for i in $HOSTS; do + make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" + done + + # Create the release tarball using (arbitrarily) the first host + ./autogen.sh + ./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'` + make dist + DISTNAME=`echo bitcoin-*.tar.gz` + + ORIGPATH="$PATH" + # Extract the release tarball into a dir for each host and build + for i in ${HOSTS}; do + export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH} + mkdir -p distsrc-${i} + cd distsrc-${i} + tar --strip-components=1 -xf ../$DISTNAME + + ./configure --prefix=${BASEPREFIX}/${i} --bindir=${OUTDIR}/${i}/bin --includedir=${OUTDIR}/${i}/include --libdir=${OUTDIR}/${i}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} + make ${MAKEOPTS} + make install-strip + make deploy + ${WRAP_DIR}/dmg dmg Bitcoin-Qt.dmg ${OUTDIR}/Bitcoin-Qt.dmg + cd .. + done + mkdir -p $OUTDIR/src + mv $DISTNAME $OUTDIR/src diff --git a/contrib/gitian-descriptors/gitian-win.yml b/contrib/gitian-descriptors/gitian-win.yml index b2795c5376..cf5436352b 100644 --- a/contrib/gitian-descriptors/gitian-win.yml +++ b/contrib/gitian-descriptors/gitian-win.yml @@ -1,97 +1,98 @@ --- -name: "bitcoin" +name: "bitcoin-win-0.10" +enable_cache: true suites: - "precise" architectures: - "amd64" -packages: -- "mingw-w64" -- "g++-mingw-w64" +packages: +- "g++" - "git-core" -- "unzip" -- "nsis" -- "faketime" +- "pkg-config" - "autoconf2.13" - "libtool" - "automake" -- "pkg-config" +- "faketime" - "bsdmainutils" - +- "mingw-w64" +- "g++-mingw-w64" +- "nsis" reference_datetime: "2013-06-01 00:00:00" remotes: - "url": "https://github.com/bitcoin/bitcoin.git" "dir": "bitcoin" -files: -- "qt-win32-5.2.0-gitian-r3.zip" -- "qt-win64-5.2.0-gitian-r3.zip" -- "boost-win32-1.55.0-gitian-r6.zip" -- "boost-win64-1.55.0-gitian-r6.zip" -- "bitcoin-deps-win32-gitian-r13.zip" -- "bitcoin-deps-win64-gitian-r13.zip" -- "protobuf-win32-2.5.0-gitian-r4.zip" -- "protobuf-win64-2.5.0-gitian-r4.zip" +files: [] script: | - # Defines - export TZ=UTC - INDIR=$HOME/build - OPTFLAGS='-O2' - TEMPDIR="$HOME/tempdir" - NEEDDIST=1 - # Qt: workaround for determinism in resource ordering - # Qt5's rcc uses a QHash to store the files for the resource. - # A security fix in QHash makes the ordering of keys to be different on every run - # (https://qt.gitorious.org/qt/qtbase/commit/c01eaa438200edc9a3bbcd8ae1e8ded058bea268). - # This is good in general but qrc shouldn't be doing a traversal over a randomized container. - # The thorough solution would be to use QMap instead of QHash, but this requires patching Qt. - # For now luckily there is a test mode that forces a fixed seed. + WRAP_DIR=$HOME/wrapped + HOSTS="x86_64-w64-mingw32 i686-w64-mingw32" + CONFIGFLAGS="--enable-upnp-default" + FAKETIME_HOST_PROGS="g++ ar ranlib nm windres strip" + FAKETIME_PROGS="date makensis" + export QT_RCC_TEST=1 - for BITS in 32 64; do # for architectures - # - STAGING=$HOME/staging${BITS} - BUILDDIR=$HOME/build${BITS} - BINDIR=$OUTDIR/$BITS - if [ "x$BITS" = "x32" ]; then - HOST=i686-w64-mingw32 - else - HOST=x86_64-w64-mingw32 - fi - export PATH=$STAGING/host/bin:$PATH - mkdir -p $STAGING $BUILDDIR $BINDIR - # - cd $STAGING - unzip $INDIR/qt-win${BITS}-5.2.0-gitian-r3.zip - unzip $INDIR/boost-win${BITS}-1.55.0-gitian-r6.zip - unzip $INDIR/bitcoin-deps-win${BITS}-gitian-r13.zip - unzip $INDIR/protobuf-win${BITS}-2.5.0-gitian-r4.zip - if [ "x$NEEDDIST" = "x1" ]; then - # Make source code archive which is architecture independent so it only needs to be done once - cd $HOME/build/bitcoin - ./autogen.sh - ./configure --bindir=$OUTDIR --prefix=$STAGING --host=$HOST --with-qt-plugindir=$STAGING/plugins --with-qt-incdir=$STAGING/include --with-qt-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --with-protoc-bindir=$STAGING/host/bin --disable-dependency-tracking CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" - make dist - DISTNAME=`echo bitcoin-*.tar.gz` - NEEDDIST=0 - fi - # Build platform-dependent executables from source archive - cd $BUILDDIR - mkdir -p distsrc - cd distsrc - tar --strip-components=1 -xf $HOME/build/bitcoin/$DISTNAME - ./configure --enable-upnp-default --bindir=$BINDIR --prefix=$STAGING --host=$HOST --with-qt-plugindir=$STAGING/plugins --with-qt-incdir=$STAGING/include --with-qt-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --with-protoc-bindir=$STAGING/host/bin --disable-dependency-tracking CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME - make $MAKEOPTS + export GZIP="-9n" + export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" + export TZ="UTC" + export BUILD_DIR=`pwd` + mkdir -p ${WRAP_DIR} + if test -n "$GBUILD_CACHE_ENABLED"; then + export SOURCES_PATH=${GBUILD_COMMON_CACHE} + export BASE_CACHE=${GBUILD_PACKAGE_CACHE} + mkdir -p ${BASE_CACHE} ${SOURCES_PATH} + fi + + # Create global faketime wrappers + for prog in ${FAKETIME_PROGS}; do + echo '#!/bin/bash' > ${WRAP_DIR}/${prog} + echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog} + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} + echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${prog} + chmod +x ${WRAP_DIR}/${prog} + done + + # Create per-host faketime wrappers + for i in $HOSTS; do + for prog in ${FAKETIME_HOST_PROGS}; do + echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog} + echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} + echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${i}-${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} + chmod +x ${WRAP_DIR}/${i}-${prog} + done + done + export PATH=${WRAP_DIR}:${PATH} + + cd bitcoin + BASEPREFIX=`pwd`/depends + # Build dependencies for each host + for i in $HOSTS; do + make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" + done + + # Create the release tarball using (arbitrarily) the first host + ./autogen.sh + ./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'` + make dist + DISTNAME=`echo bitcoin-*.tar.gz` + + ORIGPATH="$PATH" + # Extract the release tarball into a dir for each host and build + for i in ${HOSTS}; do + export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH} + mkdir -p distsrc-${i} + cd distsrc-${i} + tar --strip-components=1 -xf ../$DISTNAME + + ./configure --prefix=${BASEPREFIX}/${i} --bindir=${OUTDIR}/${i}/bin --includedir=${OUTDIR}/${i}/include --libdir=${OUTDIR}/${i}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} + make ${MAKEOPTS} make deploy make install-strip - cp -f bitcoin-*setup*.exe $BINDIR/ - unset LD_PRELOAD - unset FAKETIME - done # for BITS in - - # sort distribution tar file and normalize user/group/mtime information for deterministic output + cp -f bitcoin-*setup*.exe $OUTDIR/ + cd .. + done mkdir -p $OUTDIR/src - rm -rf $TEMPDIR - mkdir -p $TEMPDIR - cd $TEMPDIR - tar -xvf $HOME/build/bitcoin/$DISTNAME | sort | tar --no-recursion -cT /dev/stdin --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 --mtime="$REFERENCE_DATETIME" | gzip -n > $OUTDIR/src/$DISTNAME - + mv $DISTNAME $OUTDIR/src + mv ${OUTDIR}/x86_64-* ${OUTDIR}/64 + mv ${OUTDIR}/i686-* ${OUTDIR}/32 diff --git a/contrib/gitian-descriptors/protobuf-win.yml b/contrib/gitian-descriptors/protobuf-win.yml deleted file mode 100644 index 1b7af08843..0000000000 --- a/contrib/gitian-descriptors/protobuf-win.yml +++ /dev/null @@ -1,65 +0,0 @@ ---- -name: "protobuf-win32" -suites: -- "precise" -architectures: -- "amd64" -packages: -- "mingw-w64" -- "g++-mingw-w64" -- "zip" -- "faketime" -reference_datetime: "2013-04-15 00:00:00" -remotes: [] -files: -- "protobuf-2.5.0.tar.bz2" -script: | - # - export TZ=UTC - INDIR=$HOME/build - TEMPDIR=$HOME/tmp - OPTFLAGS="-O2" - # Integrity Check - echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c - - for BITS in 32 64; do # for architectures - # - INSTALLPREFIX=$HOME/staging${BITS} - BUILDDIR=$HOME/build${BITS} - if [ "x$BITS" = "x32" ]; then - HOST=i686-w64-mingw32 - else - HOST=x86_64-w64-mingw32 - fi - # - mkdir -p $INSTALLPREFIX $BUILDDIR - cd $BUILDDIR - # - tar xjf $INDIR/protobuf-2.5.0.tar.bz2 - cd protobuf-2.5.0 - # First: build a native (linux) protoc - ./configure --enable-shared=no --disable-dependency-tracking --without-zlib CXXFLAGS="-frandom-seed=11 ${OPTFLAGS}" - make - mkdir -p $INSTALLPREFIX/host/bin - cp src/protoc $INSTALLPREFIX/host/bin - # Now recompile with the mingw cross-compiler: - make distclean - ./configure --prefix=$INSTALLPREFIX --enable-shared=no --disable-dependency-tracking --without-zlib --with-protoc=$INSTALLPREFIX/host/bin/protoc --host=$HOST CXXFLAGS="-frandom-seed=11 ${OPTFLAGS}" - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME - make - make install - # post-process all generated libraries to be deterministic - # extract them to a temporary directory then re-build them deterministically - for LIB in $(find $INSTALLPREFIX -name \*.a); do - rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR - $HOST-ar xv $LIB | cut -b5- > /tmp/list.txt - rm $LIB - $HOST-ar crsD $LIB $(cat /tmp/list.txt) - done - # - cd $INSTALLPREFIX - find include lib host | sort | zip -X@ $OUTDIR/protobuf-win$BITS-2.5.0-gitian-r4.zip - unset LD_PRELOAD - unset FAKETIME - done # for BITS in diff --git a/contrib/gitian-descriptors/qt-linux.yml b/contrib/gitian-descriptors/qt-linux.yml deleted file mode 100644 index fd86b4df1d..0000000000 --- a/contrib/gitian-descriptors/qt-linux.yml +++ /dev/null @@ -1,264 +0,0 @@ ---- -name: "qt-linux" -suites: -- "precise" -architectures: -- "i386" -- "amd64" -packages: -- "zip" -- "unzip" -- "faketime" -- "unzip" -- "libxext-dev" -reference_datetime: "2011-01-30 00:00:00" -remotes: [] -files: -- "qt-everywhere-opensource-src-4.6.4.tar.gz" -script: | - export FAKETIME=$REFERENCE_DATETIME - export TZ=UTC - if [ "x$GBUILD_BITS" = "x32" ]; then - ARCH='i386-linux-gnu' - else - ARCH='x86_64-linux-gnu' - fi - # The purpose of this gitian build is not to actually build Qt, but to export - # the headers as well as pkgconfig files in a useable format so that we can - # pretend to link against an older version. The goal is to link to the - # system version of Qt 4. - # Also build development tools. - INSTALLPREFIX="$HOME/install" - # Integrity Check - echo "9ad4d46c721b53a429ed5a2eecfd3c239a9ab566562f183f99d3125f1a234250 qt-everywhere-opensource-src-4.6.4.tar.gz" | sha256sum -c - # Make install directories - mkdir -p $INSTALLPREFIX - mkdir -p $INSTALLPREFIX/include - PKGCONFIGDIR=$INSTALLPREFIX/lib/pkgconfig - mkdir -p $PKGCONFIGDIR - # - tar xzf qt-everywhere-opensource-src-4.6.4.tar.gz - cd qt-everywhere-opensource-src-4.6.4 - QTBUILDDIR=$(pwd) - sed 's/TODAY=`date +%Y-%m-%d`/TODAY=2011-01-30/' -i configure - - # Need to build 4.6-versioned host utilities as well (lrelease/qrc/lupdate/...) - ./configure -prefix $INSTALLPREFIX -confirm-license -release -opensource -no-qt3support -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-declarative -no-script -no-scripttools -no-javascript-jit -no-webkit -no-svg -no-xmlpatterns -no-sql-sqlite -no-nis -no-cups -no-iconv -no-dbus -no-gif -no-libtiff -no-opengl -nomake examples -nomake demos -nomake docs - # - make $MAKEOPTS -C src/tools install # (rcc, uic, moc) - make $MAKEOPTS -C tools/linguist/lrelease install # (lrelease) - # install includes and pkgconfig files - for DIR in src/corelib src/gui src/testlib src/dbus src/network; do - ( - cd $DIR - # extract module (QtCore/QtNetwork/...) from Makefile - MODULE=$(grep "QMAKE_TARGET *=" Makefile | cut -d = -f 2 | xargs) - # patch makefile so that not everything is build first - sed -i 's/first: all/first:/g' Makefile - make install_flat_headers install_class_headers install_targ_headers - # create and install pkgconfig descriptor - make ../../lib/pkgconfig/$MODULE.pc - sed -e "s,$QTBUILDDIR,$INSTALLPREFIX,g" ../../lib/pkgconfig/$MODULE.pc > $PKGCONFIGDIR/$MODULE.pc - # create links to existing Qt libraries - ln -sf /usr/lib/${ARCH}/lib${MODULE}.so.4 ${INSTALLPREFIX}/lib/lib${MODULE}.so - ) - done - - # Write our own configuration header, same as Ubuntu - # When we don't do this, the configuration will be without STL support (the QString from/to stdString methods) - QCONFIG=$INSTALLPREFIX/include/Qt/qconfig.h - echo ' - /* Qt Edition */ - #ifndef QT_EDITION - # define QT_EDITION QT_EDITION_OPENSOURCE - #endif - ' > $QCONFIG - - if [ "x$GBUILD_BITS" = "x32" ]; then - echo ' - /* Machine byte-order */ - #define Q_BIG_ENDIAN 4321 - #define Q_LITTLE_ENDIAN 1234 - #define QT_BUILD_KEY "i386 linux g++-4 full-config" - #define QT_BUILD_KEY_COMPAT "i686 Linux g++-4 full-config" - - #ifdef QT_BOOTSTRAPPED - #define Q_BYTE_ORDER Q_LITTLE_ENDIAN - #else - #define Q_BYTE_ORDER Q_LITTLE_ENDIAN - #endif - /* Machine Architecture */ - #ifndef QT_BOOTSTRAPPED - # define QT_ARCH_I386 - #else - # define QT_ARCH_I386 - #endif - /* Compile time features */ - #define QT_LARGEFILE_SUPPORT 64 - #define QT_POINTER_SIZE 4 - ' >> $QCONFIG - else - echo ' - /* Machine byte-order */ - #define Q_BIG_ENDIAN 4321 - #define Q_LITTLE_ENDIAN 1234 - #define QT_BUILD_KEY "x86_64 linux g++-4 full-config" - #define QT_BUILD_KEY_COMPAT "x86_64 Linux g++-4 full-config" - - #ifdef QT_BOOTSTRAPPED - #define Q_BYTE_ORDER Q_LITTLE_ENDIAN - #else - #define Q_BYTE_ORDER Q_LITTLE_ENDIAN - #endif - /* Machine Architecture */ - #ifndef QT_BOOTSTRAPPED - # define QT_ARCH_X86_64 - #else - # define QT_ARCH_X86_64 - #endif - /* Compile time features */ - #define QT_LARGEFILE_SUPPORT 64 - #define QT_POINTER_SIZE 8 - ' >> $QCONFIG - fi - - echo ' - #ifndef QT_BOOTSTRAPPED - - #if defined(QT_NO_EGL) && defined(QT_EGL) - # undef QT_NO_EGL - #elif !defined(QT_NO_EGL) && !defined(QT_EGL) - # define QT_NO_EGL - #endif - - #if defined(QT_NO_GSTREAMER) && defined(QT_GSTREAMER) - # undef QT_NO_GSTREAMER - #elif !defined(QT_NO_GSTREAMER) && !defined(QT_GSTREAMER) - # define QT_NO_GSTREAMER - #endif - - #if defined(QT_NO_ICD) && defined(QT_ICD) - # undef QT_NO_ICD - #elif !defined(QT_NO_ICD) && !defined(QT_ICD) - # define QT_NO_ICD - #endif - - #if defined(QT_NO_IMAGEFORMAT_JPEG) && defined(QT_IMAGEFORMAT_JPEG) - # undef QT_NO_IMAGEFORMAT_JPEG - #elif !defined(QT_NO_IMAGEFORMAT_JPEG) && !defined(QT_IMAGEFORMAT_JPEG) - # define QT_NO_IMAGEFORMAT_JPEG - #endif - - #if defined(QT_NO_IMAGEFORMAT_MNG) && defined(QT_IMAGEFORMAT_MNG) - # undef QT_NO_IMAGEFORMAT_MNG - #elif !defined(QT_NO_IMAGEFORMAT_MNG) && !defined(QT_IMAGEFORMAT_MNG) - # define QT_NO_IMAGEFORMAT_MNG - #endif - - #if defined(QT_NO_IMAGEFORMAT_TIFF) && defined(QT_IMAGEFORMAT_TIFF) - # undef QT_NO_IMAGEFORMAT_TIFF - #elif !defined(QT_NO_IMAGEFORMAT_TIFF) && !defined(QT_IMAGEFORMAT_TIFF) - # define QT_NO_IMAGEFORMAT_TIFF - #endif - - #if defined(QT_NO_MULTIMEDIA) && defined(QT_MULTIMEDIA) - # undef QT_NO_MULTIMEDIA - #elif !defined(QT_NO_MULTIMEDIA) && !defined(QT_MULTIMEDIA) - # define QT_NO_MULTIMEDIA - #endif - - #if defined(QT_NO_OPENVG) && defined(QT_OPENVG) - # undef QT_NO_OPENVG - #elif !defined(QT_NO_OPENVG) && !defined(QT_OPENVG) - # define QT_NO_OPENVG - #endif - - #if defined(QT_NO_PHONON) && defined(QT_PHONON) - # undef QT_NO_PHONON - #elif !defined(QT_NO_PHONON) && !defined(QT_PHONON) - # define QT_NO_PHONON - #endif - - #if defined(QT_NO_PULSEAUDIO) && defined(QT_PULSEAUDIO) - # undef QT_NO_PULSEAUDIO - #elif !defined(QT_NO_PULSEAUDIO) && !defined(QT_PULSEAUDIO) - # define QT_NO_PULSEAUDIO - #endif - - #if defined(QT_NO_S60) && defined(QT_S60) - # undef QT_NO_S60 - #elif !defined(QT_NO_S60) && !defined(QT_S60) - # define QT_NO_S60 - #endif - - #if defined(QT_NO_STYLE_S60) && defined(QT_STYLE_S60) - # undef QT_NO_STYLE_S60 - #elif !defined(QT_NO_STYLE_S60) && !defined(QT_STYLE_S60) - # define QT_NO_STYLE_S60 - #endif - - #if defined(QT_NO_SXE) && defined(QT_SXE) - # undef QT_NO_SXE - #elif !defined(QT_NO_SXE) && !defined(QT_SXE) - # define QT_NO_SXE - #endif - - #if defined(QT_NO_WEBKIT) && defined(QT_WEBKIT) - # undef QT_NO_WEBKIT - #elif !defined(QT_NO_WEBKIT) && !defined(QT_WEBKIT) - # define QT_NO_WEBKIT - #endif - - #if defined(QT_NO_ZLIB) && defined(QT_ZLIB) - # undef QT_NO_ZLIB - #elif !defined(QT_NO_ZLIB) && !defined(QT_ZLIB) - # define QT_NO_ZLIB - #endif - - #if defined(QT_RUNTIME_XCURSOR) && defined(QT_NO_RUNTIME_XCURSOR) - # undef QT_RUNTIME_XCURSOR - #elif !defined(QT_RUNTIME_XCURSOR) && !defined(QT_NO_RUNTIME_XCURSOR) - # define QT_RUNTIME_XCURSOR - #endif - - #if defined(QT_RUNTIME_XFIXES) && defined(QT_NO_RUNTIME_XFIXES) - # undef QT_RUNTIME_XFIXES - #elif !defined(QT_RUNTIME_XFIXES) && !defined(QT_NO_RUNTIME_XFIXES) - # define QT_RUNTIME_XFIXES - #endif - - #if defined(QT_RUNTIME_XINERAMA) && defined(QT_NO_RUNTIME_XINERAMA) - # undef QT_RUNTIME_XINERAMA - #elif !defined(QT_RUNTIME_XINERAMA) && !defined(QT_NO_RUNTIME_XINERAMA) - # define QT_RUNTIME_XINERAMA - #endif - - #if defined(QT_RUNTIME_XINPUT) && defined(QT_NO_RUNTIME_XINPUT) - # undef QT_RUNTIME_XINPUT - #elif !defined(QT_RUNTIME_XINPUT) && !defined(QT_NO_RUNTIME_XINPUT) - # define QT_RUNTIME_XINPUT - #endif - - #if defined(QT_RUNTIME_XRANDR) && defined(QT_NO_RUNTIME_XRANDR) - # undef QT_RUNTIME_XRANDR - #elif !defined(QT_RUNTIME_XRANDR) && !defined(QT_NO_RUNTIME_XRANDR) - # define QT_RUNTIME_XRANDR - #endif - - #if defined(QT_USE_MATH_H_FLOATS) && defined(QT_NO_USE_MATH_H_FLOATS) - # undef QT_USE_MATH_H_FLOATS - #elif !defined(QT_USE_MATH_H_FLOATS) && !defined(QT_NO_USE_MATH_H_FLOATS) - # define QT_USE_MATH_H_FLOATS - #endif - - #endif // QT_BOOTSTRAPPED - - #define QT_VISIBILITY_AVAILABLE - ' >> $QCONFIG - cp $QCONFIG $INSTALLPREFIX/include/QtCore/qconfig.h - - cd $INSTALLPREFIX - # as zip stores file timestamps, use faketime to intercept stat calls to set dates for all files to reference date - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - # Create a .tar.gz because .zip has problems with symbolic links - find | sort | tar --no-recursion -cT /dev/stdin --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 --mtime="$REFERENCE_DATETIME" | gzip -n > $OUTDIR/qt-linux${GBUILD_BITS}-4.6.4-gitian-r1.tar.gz diff --git a/contrib/gitian-descriptors/qt-win.yml b/contrib/gitian-descriptors/qt-win.yml deleted file mode 100644 index 57bc4c3180..0000000000 --- a/contrib/gitian-descriptors/qt-win.yml +++ /dev/null @@ -1,92 +0,0 @@ ---- -name: "qt" -suites: -- "precise" -architectures: -- "amd64" -packages: -- "mingw-w64" -- "g++-mingw-w64" -- "zip" -- "unzip" -- "faketime" -- "libz-dev" -reference_datetime: "2011-01-30 00:00:00" -remotes: [] -files: -- "qt-everywhere-opensource-src-5.2.0.tar.gz" -- "bitcoin-deps-win32-gitian-r13.zip" -- "bitcoin-deps-win64-gitian-r13.zip" -script: | - # Defines - export TZ=UTC - INDIR=$HOME/build - TEMPDIR=$HOME/tmp - # Qt: workaround for determinism in resource ordering - # Qt5's rcc uses a QHash to store the files for the resource. - # A security fix in QHash makes the ordering of keys to be different on every run - # (https://qt.gitorious.org/qt/qtbase/commit/c01eaa438200edc9a3bbcd8ae1e8ded058bea268). - # This is good in general but qrc shouldn't be doing a traversal over a randomized container. - # The thorough solution would be to use QMap instead of QHash, but this requires patching Qt. - # For now luckily there is a test mode that forces a fixed seed. - export QT_RCC_TEST=1 - # Integrity Check - echo "395ec72277c5786c65b8163ef5817fd03d0a1f524a6d47f53624baf8056f1081 qt-everywhere-opensource-src-5.2.0.tar.gz" | sha256sum -c - - for BITS in 32 64; do # for architectures - # - INSTALLPREFIX=$HOME/staging${BITS} - BUILDDIR=$HOME/build${BITS} - DEPSDIR=$HOME/deps${BITS} - if [ "x$BITS" = "x32" ]; then - HOST=i686-w64-mingw32 - else - HOST=x86_64-w64-mingw32 - fi - # - mkdir -p $INSTALLPREFIX $INSTALLPREFIX/host/bin $DEPSDIR $BUILDDIR - # - # Need mingw-compiled openssl from bitcoin-deps: - cd $DEPSDIR - unzip $INDIR/bitcoin-deps-win${BITS}-gitian-r13.zip - # - cd $BUILDDIR - # - tar xzf $INDIR/qt-everywhere-opensource-src-5.2.0.tar.gz - cd qt-everywhere-opensource-src-5.2.0 - SPECNAME="win32-g++" - SPECFILE="qtbase/mkspecs/${SPECNAME}/qmake.conf" - sed 's/qt_instdate=`date +%Y-%m-%d`/qt_instdate=2011-01-30/' -i qtbase/configure - sed --posix "s|QMAKE_CFLAGS = -pipe -fno-keep-inline-dllexport|QMAKE_CFLAGS\t\t= -pipe -fno-keep-inline-dllexport -isystem /usr/$HOST/include/ -frandom-seed=qtbuild -I$DEPSDIR/include|" -i ${SPECFILE} - sed --posix "s|QMAKE_LFLAGS =|QMAKE_LFLAGS\t\t= -L$DEPSDIR/lib|" -i ${SPECFILE} - # Before we tried to pass arguments to ar (static linking) in using QMAKE_LIB, however - # qt removes the arguments for ar and provides a script which makes it impossible to pass the determinism flag - - # so rather than try to replace ar, post-process all libraries and plugins at the end. - # - # Don't load faketime while compiling Qt, qmake will get stuck in nearly infinite loops - #export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - #export FAKETIME=$REFERENCE_DATETIME - # - # Compile static libraries, and use statically linked openssl (-openssl-linked): - OPENSSL_LIBS="-L$DEPSDIR/lib -lssl -lcrypto -lgdi32" ./configure -prefix $INSTALLPREFIX -bindir $INSTALLPREFIX/host/bin -confirm-license -release -opensource -static -xplatform $SPECNAME -device-option CROSS_COMPILE="$HOST-" -no-audio-backend -no-javascript-jit -no-sql-sqlite -no-sql-odbc -no-nis -no-cups -no-iconv -no-dbus -no-gif -no-opengl -no-compile-examples -no-feature-style-windowsce -no-feature-style-windowsmobile -no-qml-debug -openssl-linked -skip qtsvg -skip qtwebkit -skip qtwebkit-examples -skip qtserialport -skip qtdeclarative -skip qtmultimedia -skip qtimageformats -skip qtlocation -skip qtsensors -skip qtquick1 -skip qtquickcontrols -skip qtactiveqt -skip qtconnectivity -skip qtwinextras -skip qtxmlpatterns -skip qtscript -skip qtdoc -system-libpng -system-zlib - make $MAKEOPTS install - # post-process all generated libraries and plugins to be deterministic - # extract them to a temporary directory then re-build them deterministically - for LIB in $(find $INSTALLPREFIX -name *.a); do - rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR - $HOST-ar xv $LIB | cut -b5- > /tmp/list.txt - rm $LIB - $HOST-ar crsD $LIB $(cat /tmp/list.txt) - done - # - cd $INSTALLPREFIX - # Remove unused non-deterministic stuff - rm host/bin/qtpaths.exe lib/libQt5Bootstrap.a lib/libQt5Bootstrap.la - # as zip stores file timestamps, use faketime to intercept stat calls to set dates for all files to reference date - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME - find -print0 | xargs -r0 touch # fix up timestamps before packaging - find | sort | zip -X@ $OUTDIR/qt-win${BITS}-5.2.0-gitian-r3.zip - unset LD_PRELOAD - unset FAKETIME - done # for BITS in diff --git a/depends/packages/qt46.mk b/depends/packages/qt46.mk index 6af8052931..8fb30a5c44 100644 --- a/depends/packages/qt46.mk +++ b/depends/packages/qt46.mk @@ -1,10 +1,9 @@ PACKAGE=qt46 -$(package)_version=4.6.2 +$(package)_version=4.6.4 $(package)_download_path=http://download.qt-project.org/archive/qt/4.6/ $(package)_file_name=qt-everywhere-opensource-src-$($(package)_version).tar.gz -$(package)_sha256_hash=176f51ddb06dce67ab4b2efc6b327dc21ed8f764c5d97acc15ff1f907c2affae -$(package)_dependencies=openssl -$(package)_linux_dependencies=freetype dbus libX11 xproto libXext libICE libSM +$(package)_sha256_hash=9ad4d46c721b53a429ed5a2eecfd3c239a9ab566562f183f99d3125f1a234250 +$(package)_dependencies=openssl freetype dbus libX11 xproto libXext libICE libSM $(package)_patches=stlfix.patch define $(package)_set_vars @@ -35,7 +34,7 @@ define $(package)_preprocess_cmds sed -i.old "s|/usr/X11R6/lib64|$(host_prefix)/lib|" mkspecs/*/*.conf && \ sed -i.old "s|/usr/X11R6/lib|$(host_prefix)/lib|" mkspecs/*/*.conf && \ sed -i.old "s|/usr/X11R6/include|$(host_prefix)/include|" mkspecs/*/*.conf && \ - sed -i.old "s|QMAKE_LFLAGS_SHLIB += -shared|QMAKE_LFLAGS_SHLIB += -shared -Wl,--exclude-libs,ALL|" mkspecs/common/g++.conf && \ + sed -i.old "s|QMAKE_LFLAGS_SHLIB\t+= -shared|QMAKE_LFLAGS_SHLIB\t+= -shared -Wl,--exclude-libs,ALL|" mkspecs/common/g++.conf && \ sed -i.old "/SSLv2_client_method/d" src/network/ssl/qsslsocket_openssl.cpp src/network/ssl/qsslsocket_openssl_symbols.cpp && \ sed -i.old "/SSLv2_server_method/d" src/network/ssl/qsslsocket_openssl.cpp src/network/ssl/qsslsocket_openssl_symbols.cpp && \ patch -p1 < $($(package)_patch_dir)/stlfix.patch @@ -62,6 +61,6 @@ define $(package)_stage_cmds endef define $(package)_postprocess_cmds - rm -rf mkspecs/ lib/cmake/ && \ + rm -rf mkspecs/ lib/cmake/ lib/*.prl lib/*.la && \ find native/bin -type f -exec mv {} {}-qt4 \; endef From 4bbbdf3244e9a71e48a615a36e34de6dc0f85030 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 12 Aug 2014 19:24:05 -0400 Subject: [PATCH 1074/1288] gitian: quick docs update --- contrib/gitian-descriptors/README.md | 1 - doc/release-process.md | 73 +++------------------------- 2 files changed, 6 insertions(+), 68 deletions(-) diff --git a/contrib/gitian-descriptors/README.md b/contrib/gitian-descriptors/README.md index 7a67263ee4..061b897d2a 100644 --- a/contrib/gitian-descriptors/README.md +++ b/contrib/gitian-descriptors/README.md @@ -27,7 +27,6 @@ Once you've got the right hardware and software: # Create base images cd gitian-builder - bin/make-base-vm --suite precise --arch i386 bin/make-base-vm --suite precise --arch amd64 cd .. diff --git a/doc/release-process.md b/doc/release-process.md index 7699af90bd..c6a7266ef1 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -23,6 +23,10 @@ Release Process * * * +###update gitian + + In order to take advantage of the new caching features in gitian, be sure to update to a recent version (e9741525c or higher is recommended) + ###perform gitian builds From a directory containing the bitcoin source, gitian-builder and gitian.sigs @@ -46,71 +50,6 @@ Release Process tar -C /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ -czf MacOSX10.7.sdk.tar.gz MacOSX10.7.sdk - Download remaining inputs, and build everything: - - wget 'http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.9.tar.gz' -O miniupnpc-1.9.tar.gz - wget 'https://www.openssl.org/source/openssl-1.0.1h.tar.gz' - wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz' - wget 'http://zlib.net/zlib-1.2.8.tar.gz' - wget 'ftp://ftp.simplesystems.org/pub/png/src/history/libpng16/libpng-1.6.8.tar.gz' - wget 'https://fukuchi.org/works/qrencode/qrencode-3.4.3.tar.bz2' - wget 'https://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.bz2' - wget 'https://svn.boost.org/trac/boost/raw-attachment/ticket/7262/boost-mingw.patch' -O boost-mingw-gas-cross-compile-2013-03-03.patch - wget 'https://download.qt-project.org/official_releases/qt/5.2/5.2.0/single/qt-everywhere-opensource-src-5.2.0.tar.gz' - wget 'https://download.qt-project.org/official_releases/qt/5.2/5.2.1/single/qt-everywhere-opensource-src-5.2.1.tar.gz' - wget 'https://download.qt-project.org/archive/qt/4.6/qt-everywhere-opensource-src-4.6.4.tar.gz' - wget 'https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.bz2' - wget 'https://github.com/mingwandroid/toolchain4/archive/10cc648683617cca8bcbeae507888099b41b530c.tar.gz' - wget 'http://www.opensource.apple.com/tarballs/cctools/cctools-809.tar.gz' - wget 'http://www.opensource.apple.com/tarballs/dyld/dyld-195.5.tar.gz' - wget 'http://www.opensource.apple.com/tarballs/ld64/ld64-127.2.tar.gz' - wget 'http://pkgs.fedoraproject.org/repo/pkgs/cdrkit/cdrkit-1.1.11.tar.gz/efe08e2f3ca478486037b053acd512e9/cdrkit-1.1.11.tar.gz' - wget 'https://github.com/theuni/libdmg-hfsplus/archive/libdmg-hfsplus-v0.1.tar.gz' - wget 'http://llvm.org/releases/3.2/clang+llvm-3.2-x86-linux-ubuntu-12.04.tar.gz' -O clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz - wget 'https://raw.githubusercontent.com/theuni/osx-cross-depends/master/patches/cdrtools/genisoimage.diff' -O cdrkit-deterministic.patch - cd .. - ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/boost-linux.yml - mv build/out/boost-*.zip inputs/ - ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/deps-linux.yml - mv build/out/bitcoin-deps-*.zip inputs/ - ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/qt-linux.yml - mv build/out/qt-*.tar.gz inputs/ - ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/boost-win.yml - mv build/out/boost-*.zip inputs/ - ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/deps-win.yml - mv build/out/bitcoin-deps-*.zip inputs/ - ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/qt-win.yml - mv build/out/qt-*.zip inputs/ - ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/protobuf-win.yml - mv build/out/protobuf-*.zip inputs/ - ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/gitian-osx-native.yml - mv build/out/osx-*.tar.gz inputs/ - ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/gitian-osx-depends.yml - mv build/out/osx-*.tar.gz inputs/ - ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/gitian-osx-qt.yml - mv build/out/osx-*.tar.gz inputs/ - - The expected SHA256 hashes of the intermediate inputs are: - - f29b7d9577417333fb56e023c2977f5726a7c297f320b175a4108cf7cd4c2d29 boost-linux32-1.55.0-gitian-r1.zip - 88232451c4104f7eb16e469ac6474fd1231bd485687253f7b2bdf46c0781d535 boost-linux64-1.55.0-gitian-r1.zip - 46710f673467e367738d8806e45b4cb5931aaeea61f4b6b55a68eea56d5006c5 bitcoin-deps-linux32-gitian-r6.zip - f03be39fb26670243d3a659e64d18e19d03dec5c11e9912011107768390b5268 bitcoin-deps-linux64-gitian-r6.zip - 57e57dbdadc818cd270e7e00500a5e1085b3bcbdef69a885f0fb7573a8d987e1 qt-linux32-4.6.4-gitian-r1.tar.gz - 60eb4b9c5779580b7d66529efa5b2836ba1a70edde2a0f3f696d647906a826be qt-linux64-4.6.4-gitian-r1.tar.gz - 60dc2d3b61e9c7d5dbe2f90d5955772ad748a47918ff2d8b74e8db9b1b91c909 boost-win32-1.55.0-gitian-r6.zip - f65fcaf346bc7b73bc8db3a8614f4f6bee2f61fcbe495e9881133a7c2612a167 boost-win64-1.55.0-gitian-r6.zip - 70de248cd0dd7e7476194129e818402e974ca9c5751cbf591644dc9f332d3b59 bitcoin-deps-win32-gitian-r13.zip - 9eace4c76f639f4f3580a478eee4f50246e1bbb5ccdcf37a158261a5a3fa3e65 bitcoin-deps-win64-gitian-r13.zip - 963e3e5e85879010a91143c90a711a5d1d5aba992e38672cdf7b54e42c56b2f1 qt-win32-5.2.0-gitian-r3.zip - 751c579830d173ef3e6f194e83d18b92ebef6df03289db13ab77a52b6bc86ef0 qt-win64-5.2.0-gitian-r3.zip - e2e403e1a08869c7eed4d4293bce13d51ec6a63592918b90ae215a0eceb44cb4 protobuf-win32-2.5.0-gitian-r4.zip - a0999037e8b0ef9ade13efd88fee261ba401f5ca910068b7e0cd3262ba667db0 protobuf-win64-2.5.0-gitian-r4.zip - 512bc0622c883e2e0f4cbc3fedfd8c2402d06c004ce6fb32303cc2a6f405b6df osx-native-depends-r3.tar.gz - 927e4b222be6d590b4bc2fc185872a5d0ca5c322adb983764d3ed84be6bdbc81 osx-depends-r4.tar.gz - ec95abef1df2b096a970359787c01d8c45e2a4475b7ae34e12c022634fbdba8a osx-depends-qt-5.2.1-r4.tar.gz - - Build Bitcoin Core for Linux, Windows, and OS X: ./bin/gbuild --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml @@ -125,8 +64,8 @@ Release Process zip -r bitcoin-${VERSION}-win-gitian.zip * mv bitcoin-${VERSION}-win-gitian.zip ../../../ popd - ./bin/gbuild --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-osx-bitcoin.yml - ./bin/gsign --signer $SIGNER --release ${VERSION}-osx --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-osx-bitcoin.yml + ./bin/gbuild --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml + ./bin/gsign --signer $SIGNER --release ${VERSION}-osx --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml pushd build/out mv Bitcoin-Qt.dmg ../../../ popd From c54d647a92c72e44daf886a334250ad1125818e9 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 1 Sep 2014 16:12:16 -0400 Subject: [PATCH 1075/1288] travis: let travis use shared libs for tests --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 567428daf9..1630c1d02a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,6 +59,7 @@ script: - cd bitcoin-$HOST - ./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false) - make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false ) + - export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib - if [ "$RUN_TESTS" = "true" ]; then make check; fi - if [ "$RUN_TESTS" = "true" ]; then qa/pull-tester/rpc-tests.sh; fi after_script: From 246659aff15885e2289ac774debcef932a25f063 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 19 Nov 2014 21:46:40 -0500 Subject: [PATCH 1076/1288] gitian: make tarballs deterministic and nuke .la files from build output --- contrib/gitian-descriptors/gitian-linux.yml | 10 ++++++++++ contrib/gitian-descriptors/gitian-osx.yml | 10 ++++++++++ contrib/gitian-descriptors/gitian-win.yml | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index 69de6bf623..b57a04469c 100644 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -75,6 +75,13 @@ script: | make dist DISTNAME=`echo bitcoin-*.tar.gz` + # Correct tar file order + mkdir -p temp + pushd temp + tar xf ../$DISTNAME + find bitcoin-* | sort | tar --no-recursion -c -T - | gzip -9n > ../$DISTNAME + popd + ORIGPATH="$PATH" # Extract the release tarball into a dir for each host and build for i in ${HOSTS}; do @@ -92,3 +99,6 @@ script: | mv $DISTNAME $OUTDIR/src mv ${OUTDIR}/x86_64-* ${OUTDIR}/64 mv ${OUTDIR}/i686-* ${OUTDIR}/32 + + # Delete unwanted stuff + find ${OUTDIR} -name "lib*.la" -delete diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml index 5c230e80b1..7ec0700ed3 100644 --- a/contrib/gitian-descriptors/gitian-osx.yml +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -85,6 +85,13 @@ script: | make dist DISTNAME=`echo bitcoin-*.tar.gz` + # Correct tar file order + mkdir -p temp + pushd temp + tar xf ../$DISTNAME + find bitcoin-* | sort | tar --no-recursion -c -T - | gzip -9n > ../$DISTNAME + popd + ORIGPATH="$PATH" # Extract the release tarball into a dir for each host and build for i in ${HOSTS}; do @@ -102,3 +109,6 @@ script: | done mkdir -p $OUTDIR/src mv $DISTNAME $OUTDIR/src + + # Delete unwanted stuff + find ${OUTDIR} -name "lib*.la" -delete diff --git a/contrib/gitian-descriptors/gitian-win.yml b/contrib/gitian-descriptors/gitian-win.yml index cf5436352b..172807467a 100644 --- a/contrib/gitian-descriptors/gitian-win.yml +++ b/contrib/gitian-descriptors/gitian-win.yml @@ -77,6 +77,13 @@ script: | make dist DISTNAME=`echo bitcoin-*.tar.gz` + # Correct tar file order + mkdir -p temp + pushd temp + tar xf ../$DISTNAME + find bitcoin-* | sort | tar --no-recursion -c -T - | gzip -9n > ../$DISTNAME + popd + ORIGPATH="$PATH" # Extract the release tarball into a dir for each host and build for i in ${HOSTS}; do @@ -96,3 +103,6 @@ script: | mv $DISTNAME $OUTDIR/src mv ${OUTDIR}/x86_64-* ${OUTDIR}/64 mv ${OUTDIR}/i686-* ${OUTDIR}/32 + + # Delete unwanted stuff + find ${OUTDIR} -name "lib*.la" -delete From 57425a24255c5af439241d59ad5a878b7a3771a7 Mon Sep 17 00:00:00 2001 From: Daniel Kraft Date: Thu, 20 Nov 2014 08:28:19 +0100 Subject: [PATCH 1077/1288] Check block header before accepting it. Previously, AcceptBlockHeader did not check the header (in particular PoW). This made the client accept invalid-PoW-headers from peers in headers-first sync. --- src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 2bff781bfa..ac5d42d5fc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2280,6 +2280,8 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo { // These are checks that are independent of context. + // Check that the header is valid (particularly PoW). This is mostly + // redundant with the call in AcceptBlockHeader. if (!CheckBlockHeader(block, state, fCheckPOW)) return false; @@ -2351,6 +2353,9 @@ bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBloc return true; } + if (!CheckBlockHeader(block, state)) + return false; + // Get prev block index CBlockIndex* pindexPrev = NULL; int nHeight = 0; From e0a25c54ebecf09771d017ccb29c6777192de876 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 20 Nov 2014 12:28:34 +0100 Subject: [PATCH 1078/1288] qt: Make askpassphrase dialog behave more sanely Set minimum sizes appropriately, and make sure that they are enforced. Replaces #5226. --- src/qt/askpassphrasedialog.cpp | 7 +++++-- src/qt/forms/askpassphrasedialog.ui | 11 ++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp index a448d5a9a0..fa9ac6b135 100644 --- a/src/qt/askpassphrasedialog.cpp +++ b/src/qt/askpassphrasedialog.cpp @@ -23,6 +23,10 @@ AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) : { ui->setupUi(this); + ui->passEdit1->setMinimumSize(ui->passEdit1->sizeHint()); + ui->passEdit2->setMinimumSize(ui->passEdit2->sizeHint()); + ui->passEdit3->setMinimumSize(ui->passEdit3->sizeHint()); + ui->passEdit1->setMaxLength(MAX_PASSPHRASE_SIZE); ui->passEdit2->setMaxLength(MAX_PASSPHRASE_SIZE); ui->passEdit3->setMaxLength(MAX_PASSPHRASE_SIZE); @@ -35,9 +39,9 @@ AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) : switch(mode) { case Encrypt: // Ask passphrase x2 + ui->warningLabel->setText(tr("Enter the new passphrase to the wallet.
Please use a passphrase of ten or more random characters, or eight or more words.")); ui->passLabel1->hide(); ui->passEdit1->hide(); - ui->warningLabel->setText(tr("Enter the new passphrase to the wallet.
Please use a passphrase of ten or more random characters, or eight or more words.")); setWindowTitle(tr("Encrypt wallet")); break; case Unlock: // Ask passphrase @@ -61,7 +65,6 @@ AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) : ui->warningLabel->setText(tr("Enter the old and new passphrase to the wallet.")); break; } - textChanged(); connect(ui->passEdit1, SIGNAL(textChanged(QString)), this, SLOT(textChanged())); connect(ui->passEdit2, SIGNAL(textChanged(QString)), this, SLOT(textChanged())); diff --git a/src/qt/forms/askpassphrasedialog.ui b/src/qt/forms/askpassphrasedialog.ui index bc4921455f..a2105ecd0a 100644 --- a/src/qt/forms/askpassphrasedialog.ui +++ b/src/qt/forms/askpassphrasedialog.ui @@ -7,7 +7,7 @@ 0 0 598 - 198 + 222 @@ -26,8 +26,14 @@ Passphrase Dialog + + QLayout::SetMinimumSize + + + Placeholder text + Qt::RichText @@ -38,6 +44,9 @@ + + QLayout::SetMinimumSize + QFormLayout::AllNonFixedFieldsGrow From a01fa3035f161be4327b664a1eebe29a2a7d244d Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 19 Nov 2014 10:53:46 +0100 Subject: [PATCH 1079/1288] minor style cleanup after HTTP rest interface merge - no code changes --- src/key.h | 3 ++- src/rest.cpp | 18 +++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/key.h b/src/key.h index 0bb05482c9..a58cab45ec 100644 --- a/src/key.h +++ b/src/key.h @@ -13,9 +13,10 @@ #include #include -struct CExtPubKey; class CPubKey; +struct CExtPubKey; + /** * secp256k1: * const unsigned int PRIVATE_KEY_SIZE = 279; diff --git a/src/rest.cpp b/src/rest.cpp index 9a8793a517..122b361719 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -1,17 +1,18 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2012 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include -#include "rpcserver.h" -#include "streams.h" -#include "utilstrencodings.h" #include "core/block.h" #include "core/transaction.h" -#include "version.h" #include "main.h" +#include "rpcserver.h" +#include "streams.h" #include "sync.h" +#include "utilstrencodings.h" +#include "version.h" + +#include using namespace std; using namespace json_spirit; @@ -163,7 +164,7 @@ static bool rest_tx(AcceptedConnection *conn, string strJSON = write_string(Value(objTx), false) + "\n"; conn->stream() << HTTPReply(HTTP_OK, strJSON, fRun) << std::flush; return true; - } + } } // not reached @@ -203,4 +204,3 @@ bool HTTPReq_REST(AcceptedConnection *conn, conn->stream() << HTTPError(HTTP_NOT_FOUND, false) << std::flush; return false; } - From 4574248f9f86ac39329768b93186b59c009eb72a Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 20 Nov 2014 12:29:52 +0100 Subject: [PATCH 1080/1288] [Qt] minor ordering cleanup after new fee selection --- src/qt/sendcoinsdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index ff39829b95..813f29f53a 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -12,12 +12,12 @@ #include "guiutil.h" #include "optionsmodel.h" #include "sendcoinsentry.h" -#include "wallet.h" #include "walletmodel.h" #include "base58.h" #include "coincontrol.h" #include "ui_interface.h" +#include "wallet.h" #include #include From 34559c7c73e3ce67baea0d88ba74b0988b55142d Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 20 Nov 2014 12:43:50 +0100 Subject: [PATCH 1081/1288] Make PruneBlockIndexCandidates safer --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 1ba17614df..ac65a4ac2f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1954,9 +1954,11 @@ static void PruneBlockIndexCandidates() { // Note that we can't delete the current block itself, as we may need to return to it later in case a // reorganization to a better block fails. std::set::iterator it = setBlockIndexCandidates.begin(); - while (setBlockIndexCandidates.value_comp()(*it, chainActive.Tip())) { + while (it != setBlockIndexCandidates.end() && setBlockIndexCandidates.value_comp()(*it, chainActive.Tip())) { setBlockIndexCandidates.erase(it++); } + // Either the current tip or a successor of it we're working towards is left in setBlockIndexCandidates. + assert(!setBlockIndexCandidates.empty()); } // Try to make some progress towards making pindexMostWork the active block. @@ -2007,8 +2009,6 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo } } else { PruneBlockIndexCandidates(); - // Either the current tip or a successor of it we're working towards is left in setBlockIndexCandidates. - assert(!setBlockIndexCandidates.empty()); if (!pindexOldTip || chainActive.Tip()->nChainWork > pindexOldTip->nChainWork) { // We're in a better position than we were. Return temporarily to release the lock. fContinue = false; From aabe61cb37373913c9df4c86a7eed4e5b0bbf7a1 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 20 Nov 2014 12:45:38 +0100 Subject: [PATCH 1082/1288] [Qt] explicitly call proxy in GUI settings SOCKS5 proxy - to ensure a consistent wording between core and GUI --- src/qt/forms/optionsdialog.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 3446cf5c33..51156ade4f 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -209,10 +209,10 @@ - Connect to the Bitcoin network through a SOCKS proxy. + Connect to the Bitcoin network through a SOCKS5 proxy. - &Connect through SOCKS proxy (default proxy): + &Connect through SOCKS5 proxy (default proxy): From 98b135f97f16005687f420136114f80555bc8688 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 8 Nov 2014 09:32:29 -0800 Subject: [PATCH 1083/1288] Make STRICTENC invalid pubkeys fail the script rather than the opcode. This turns STRICTENC turn into a softforking-safe change (even though it is not intended as a consensus rule), and as a result guarantee that using it for mempool validation only results in consensus-valid transactions in the mempool. --- src/script/interpreter.cpp | 12 ++++++------ src/script/interpreter.h | 4 ++-- src/script/script_error.cpp | 2 ++ src/script/script_error.h | 1 + src/test/data/script_invalid.json | 18 ++++++++++++++++++ src/test/data/script_valid.json | 18 +++++++++--------- src/test/script_tests.cpp | 21 +++++++++++++++------ 7 files changed, 53 insertions(+), 23 deletions(-) diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 760086eaba..a2a2edce6d 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -207,9 +207,9 @@ bool static CheckSignatureEncoding(const valtype &vchSig, unsigned int flags, Sc return true; } -bool static CheckPubKeyEncoding(const valtype &vchSig, unsigned int flags) { +bool static CheckPubKeyEncoding(const valtype &vchSig, unsigned int flags, ScriptError* serror) { if ((flags & SCRIPT_VERIFY_STRICTENC) != 0 && !IsCompressedOrUncompressedPubKey(vchSig)) { - return false; + return set_error(serror, SCRIPT_ERR_PUBKEYTYPE); } return true; } @@ -792,11 +792,11 @@ bool EvalScript(vector >& stack, const CScript& script, un // Drop the signature, since there's no way for a signature to sign itself scriptCode.FindAndDelete(CScript(vchSig)); - if (!CheckSignatureEncoding(vchSig, flags, serror)) { + if (!CheckSignatureEncoding(vchSig, flags, serror) || !CheckPubKeyEncoding(vchPubKey, flags, serror)) { //serror is set return false; } - bool fSuccess = CheckPubKeyEncoding(vchPubKey, flags) && checker.CheckSig(vchSig, vchPubKey, scriptCode); + bool fSuccess = checker.CheckSig(vchSig, vchPubKey, scriptCode); popstack(stack); popstack(stack); @@ -855,13 +855,13 @@ bool EvalScript(vector >& stack, const CScript& script, un valtype& vchSig = stacktop(-isig); valtype& vchPubKey = stacktop(-ikey); - if (!CheckSignatureEncoding(vchSig, flags, serror)) { + if (!CheckSignatureEncoding(vchSig, flags, serror) || !CheckPubKeyEncoding(vchPubKey, flags, serror)) { // serror is set return false; } // Check signature - bool fOk = CheckPubKeyEncoding(vchPubKey, flags) && checker.CheckSig(vchSig, vchPubKey, scriptCode); + bool fOk = checker.CheckSig(vchSig, vchPubKey, scriptCode); if (fOk) { isig++; diff --git a/src/script/interpreter.h b/src/script/interpreter.h index 12b2719414..35b2f6c65a 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -35,8 +35,8 @@ enum SCRIPT_VERIFY_P2SH = (1U << 0), // Passing a non-strict-DER signature or one with undefined hashtype to a checksig operation causes script failure. - // Passing a pubkey that is not (0x04 + 64 bytes) or (0x02 or 0x03 + 32 bytes) to checksig causes that pubkey to be - // skipped (not softfork safe: this flag can widen the validity of OP_CHECKSIG OP_NOT). + // Evaluating a pubkey that is not (0x04 + 64 bytes) or (0x02 or 0x03 + 32 bytes) by checksig causes script failure. + // (softfork safe, but not used or intended as a consensus rule). SCRIPT_VERIFY_STRICTENC = (1U << 1), // Passing a non-strict-DER signature to a checksig operation causes script failure (softfork safe, BIP62 rule 1) diff --git a/src/script/script_error.cpp b/src/script/script_error.cpp index 793fc0da41..5d24ed98ba 100644 --- a/src/script/script_error.cpp +++ b/src/script/script_error.cpp @@ -61,6 +61,8 @@ const char* ScriptErrorString(const ScriptError serror) return "Dummy CHECKMULTISIG argument must be zero"; case SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS: return "NOPx reserved for soft-fork upgrades"; + case SCRIPT_ERR_PUBKEYTYPE: + return "Public key is neither compressed or uncompressed"; case SCRIPT_ERR_UNKNOWN_ERROR: case SCRIPT_ERR_ERROR_COUNT: default: break; diff --git a/src/script/script_error.h b/src/script/script_error.h index 21153f1bd1..ac1f2deae5 100644 --- a/src/script/script_error.h +++ b/src/script/script_error.h @@ -42,6 +42,7 @@ typedef enum ScriptError_t SCRIPT_ERR_SIG_PUSHONLY, SCRIPT_ERR_SIG_HIGH_S, SCRIPT_ERR_SIG_NULLDUMMY, + SCRIPT_ERR_PUBKEYTYPE, /* softfork safeness */ SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS, diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index 0356d0be1c..96ff0a2911 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -592,6 +592,24 @@ nSequences are max. "", "P2PK NOT with hybrid pubkey but no STRICTENC" ], +[ + "0x47 0x3044022078033e4227aa05ded69d8da579966578e230d8a7fb44d5f1a0620c3853c24f78022006a2e3f4d872ac8dfdc529110aa37301d65a76255a4b6cce2992adacd4d2c4e201", + "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", + "STRICTENC", + "P2PK NOT with hybrid pubkey" +], +[ + "0x47 0x304402207592427de20e315d644839754f2a5cca5b978b983a15e6da82109ede01722baa022032ceaf78590faa3f7743821e1b47b897ed1a57f6ee1c8a7519d23774d8de3c4401", + "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", + "STRICTENC", + "P2PK NOT with invalid hybrid pubkey" +], +[ + "0 0x47 0x304402206797289d3dc81692edae58430276d04641ea5d86967be557163f8494da32fd78022006fc6ab77aaed4ac11ea69cd878ab26e3e24290f47a43e9adf34075d52b7142c01", + "1 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 2 CHECKMULTISIG", + "STRICTENC", + "1-of-2 with the first 1 hybrid pubkey" +], [ "0x47 0x304402201f82b99a813c9c48c8dee8d2c43b8f637b72353fe9bdcc084537bc17e2ab770402200c43b96a5f7e115f0114eabda32e068145965cb6c7b5ef64833bb4fcf9fc1b3b05", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index 0cf1563163..94e1abfaae 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -743,12 +743,6 @@ nSequences are max. "", "P2PK with hybrid pubkey but no STRICTENC" ], -[ - "0x47 0x3044022078033e4227aa05ded69d8da579966578e230d8a7fb44d5f1a0620c3853c24f78022006a2e3f4d872ac8dfdc529110aa37301d65a76255a4b6cce2992adacd4d2c4e201", - "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", - "STRICTENC", - "P2PK NOT with hybrid pubkey" -], [ "0x47 0x3044022078d6c447887e88dcbe1bc5b613645280df6f4e5935648bc226e9d91da71b3216022047d6b7ef0949b228fc1b359afb8d50500268711354298217b983c26970790c7601", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", @@ -756,10 +750,16 @@ nSequences are max. "P2PK NOT with invalid hybrid pubkey but no STRICTENC" ], [ - "0x47 0x304402207592427de20e315d644839754f2a5cca5b978b983a15e6da82109ede01722baa022032ceaf78590faa3f7743821e1b47b897ed1a57f6ee1c8a7519d23774d8de3c4401", - "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", + "0 0x47 0x304402203b269b9fbc0936877bf855b5fb41757218d9548b246370d991442a5f5bd1c3440220235268a4eaa8c67e543c6e37da81dd36d3b1be2de6b4fef04113389ca6ddc04501", + "1 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", + "", + "1-of-2 with the second 1 hybrid pubkey and no STRICTENC" +], +[ + "0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501", + "1 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", "STRICTENC", - "P2PK NOT with invalid hybrid pubkey" + "1-of-2 with the second 1 hybrid pubkey" ], [ "0x47 0x304402204649e9517ef0377a8f8270bd423053fd98ddff62d74ea553e9579558abbb75e4022044a2b2344469c12e35ed898987711272b634733dd0f5e051288eceb04bd4669e05", diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 36aaa6903f..6952f4c584 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -428,15 +428,24 @@ BOOST_AUTO_TEST_CASE(script_build) bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG << OP_NOT, "P2PK NOT with hybrid pubkey but no STRICTENC", 0 ).PushSig(keys.key0, SIGHASH_ALL)); - good.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG << OP_NOT, - "P2PK NOT with hybrid pubkey", SCRIPT_VERIFY_STRICTENC - ).PushSig(keys.key0, SIGHASH_ALL)); + bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG << OP_NOT, + "P2PK NOT with hybrid pubkey", SCRIPT_VERIFY_STRICTENC + ).PushSig(keys.key0, SIGHASH_ALL)); good.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG << OP_NOT, "P2PK NOT with invalid hybrid pubkey but no STRICTENC", 0 ).PushSig(keys.key0, SIGHASH_ALL).DamagePush(10)); - good.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG << OP_NOT, - "P2PK NOT with invalid hybrid pubkey", SCRIPT_VERIFY_STRICTENC - ).PushSig(keys.key0, SIGHASH_ALL).DamagePush(10)); + bad.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG << OP_NOT, + "P2PK NOT with invalid hybrid pubkey", SCRIPT_VERIFY_STRICTENC + ).PushSig(keys.key0, SIGHASH_ALL).DamagePush(10)); + good.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey0H) << ToByteVector(keys.pubkey1C) << OP_2 << OP_CHECKMULTISIG, + "1-of-2 with the second 1 hybrid pubkey and no STRICTENC", 0 + ).Num(0).PushSig(keys.key1, SIGHASH_ALL)); + good.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey0H) << ToByteVector(keys.pubkey1C) << OP_2 << OP_CHECKMULTISIG, + "1-of-2 with the second 1 hybrid pubkey", SCRIPT_VERIFY_STRICTENC + ).Num(0).PushSig(keys.key1, SIGHASH_ALL)); + bad.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey0H) << OP_2 << OP_CHECKMULTISIG, + "1-of-2 with the first 1 hybrid pubkey", SCRIPT_VERIFY_STRICTENC + ).Num(0).PushSig(keys.key1, SIGHASH_ALL)); good.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG, "P2PK with undefined hashtype but no STRICTENC", 0 From ca8158719b17ebdcf1de1e26079b6b896122d0e5 Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Mon, 10 Nov 2014 02:33:19 -0500 Subject: [PATCH 1084/1288] Test the exact order of CHECKMULTISIG sig/pubkey evaluation Possible with STRICTENC --- src/script/interpreter.cpp | 6 +++++- src/test/data/script_invalid.json | 19 +++++++++++++++++++ src/test/data/script_valid.json | 25 +++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index a2a2edce6d..5eda23731d 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -855,6 +855,9 @@ bool EvalScript(vector >& stack, const CScript& script, un valtype& vchSig = stacktop(-isig); valtype& vchPubKey = stacktop(-ikey); + // Note how this makes the exact order of pubkey/signature evaluation + // distinguishable by CHECKMULTISIG NOT if the STRICTENC flag is set. + // See the script_(in)valid tests for details. if (!CheckSignatureEncoding(vchSig, flags, serror) || !CheckPubKeyEncoding(vchPubKey, flags, serror)) { // serror is set return false; @@ -871,7 +874,8 @@ bool EvalScript(vector >& stack, const CScript& script, un nKeysCount--; // If there are more signatures left than keys left, - // then too many signatures have failed + // then too many signatures have failed. Exit early, + // without checking any further signatures. if (nSigsCount > nKeysCount) fSuccess = false; } diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index 96ff0a2911..71e757714c 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -616,6 +616,25 @@ nSequences are max. "STRICTENC", "P2PK with undefined hashtype" ], + +[" +Order of CHECKMULTISIG evaluation tests, inverted by swapping the order of +pubkeys/signatures so they fail due to the STRICTENC rules on validly encoded +signatures and pubkeys. +"], +[ + "0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501", + "2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0 2 CHECKMULTISIG NOT", + "STRICTENC", + "2-of-2 CHECKMULTISIG NOT with the first pubkey invalid, and both signatures validly encoded." +], +[ + "0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 0", + "2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT", + "STRICTENC", + "2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but first signature invalid." +], + [ "0x47 0x30440220166848cd5b82a32b5944d90de3c35249354b43773c2ece1844ee8d1103e2f6c602203b6b046da4243c77adef80ada9201b27bbfdf7f9d5428f40434b060432afd62005", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG NOT", diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index 94e1abfaae..ada45a64ed 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -761,6 +761,31 @@ nSequences are max. "STRICTENC", "1-of-2 with the second 1 hybrid pubkey" ], + +[" +CHECKMULTISIG evaluation order tests. CHECKMULTISIG evaluates signatures and +pubkeys in a specific order, and will exit early if the number of signatures +left to check is greater than the number of keys left. As STRICTENC fails the +script when it reaches an invalidly encoded signature or pubkey, we can use it +to test the exact order in which signatures and pubkeys are evaluated by +distinguishing CHECKMULTISIG returning false on the stack and the script as a +whole failing. + +See also the corresponding inverted versions of these tests in script_invalid.json +"], +[ + "0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501", + "2 0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT", + "STRICTENC", + "2-of-2 CHECKMULTISIG NOT with the second pubkey invalid, and both signatures validly encoded. Valid pubkey fails, and CHECKMULTISIG exits early, prior to evaluation of second invalid pubkey." +], +[ + "0 0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501", + "2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT", + "STRICTENC", + "2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but second signature invalid. Valid pubkey fails, and CHECKMULTISIG exits early, prior to evaluation of second invalid signature." +], + [ "0x47 0x304402204649e9517ef0377a8f8270bd423053fd98ddff62d74ea553e9579558abbb75e4022044a2b2344469c12e35ed898987711272b634733dd0f5e051288eceb04bd4669e05", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", From b867e409e5dd34b84eb9d6d0d8f257dbb19b986d Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 20 Nov 2014 02:23:20 +0000 Subject: [PATCH 1085/1288] CreateNewBlock: Stick height in coinbase so we pass template sanity check --- src/miner.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 200498d109..5ac4b05af8 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -124,6 +124,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) { LOCK2(cs_main, mempool.cs); CBlockIndex* pindexPrev = chainActive.Tip(); + const int nHeight = pindexPrev->nHeight + 1; CCoinsViewCache view(pcoinsTip); // Priority order to process transactions @@ -138,7 +139,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) mi != mempool.mapTx.end(); ++mi) { const CTransaction& tx = mi->second.GetTx(); - if (tx.IsCoinBase() || !IsFinalTx(tx, pindexPrev->nHeight + 1)) + if (tx.IsCoinBase() || !IsFinalTx(tx, nHeight)) continue; COrphan* porphan = NULL; @@ -181,7 +182,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) CAmount nValueIn = coins->vout[txin.prevout.n].nValue; nTotalIn += nValueIn; - int nConf = pindexPrev->nHeight - coins->nHeight + 1; + int nConf = nHeight - coins->nHeight; dPriority += (double)nValueIn * nConf; } @@ -269,7 +270,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) continue; CTxUndo txundo; - UpdateCoins(tx, state, view, txundo, pindexPrev->nHeight+1); + UpdateCoins(tx, state, view, txundo, nHeight); // Added pblock->vtx.push_back(tx); @@ -309,8 +310,8 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) LogPrintf("CreateNewBlock(): total size %u\n", nBlockSize); // Compute final coinbase transaction. - txNew.vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees); - txNew.vin[0].scriptSig = CScript() << OP_0 << OP_0; + txNew.vout[0].nValue = GetBlockValue(nHeight, nFees); + txNew.vin[0].scriptSig = CScript() << nHeight << OP_0; pblock->vtx[0] = txNew; pblocktemplate->vTxFees[0] = -nFees; From 36fa4a78acac0ae6bb0e95c6ef78630120a28bdd Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 26 Oct 2014 01:23:23 -0700 Subject: [PATCH 1086/1288] Split up crypto/sha2 --- src/Makefile.am | 12 +- src/crypto/hmac_sha512.cpp | 34 +++++ src/crypto/hmac_sha512.h | 32 +++++ src/crypto/sha2.h | 64 --------- src/crypto/sha256.cpp | 189 +++++++++++++++++++++++++ src/crypto/sha256.h | 28 ++++ src/crypto/{sha2.cpp => sha512.cpp} | 210 +--------------------------- src/crypto/sha512.h | 28 ++++ src/hash.cpp | 1 + src/hash.h | 2 +- src/key.cpp | 2 +- src/pubkey.cpp | 1 - src/script/interpreter.cpp | 2 +- src/test/crypto_tests.cpp | 4 +- 14 files changed, 330 insertions(+), 279 deletions(-) create mode 100644 src/crypto/hmac_sha512.cpp create mode 100644 src/crypto/hmac_sha512.h delete mode 100644 src/crypto/sha2.h create mode 100644 src/crypto/sha256.cpp create mode 100644 src/crypto/sha256.h rename src/crypto/{sha2.cpp => sha512.cpp} (53%) create mode 100644 src/crypto/sha512.h diff --git a/src/Makefile.am b/src/Makefile.am index 0d45203c90..e1e6915185 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -203,10 +203,14 @@ libbitcoin_wallet_a_SOURCES = \ crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES) crypto_libbitcoin_crypto_a_SOURCES = \ crypto/sha1.cpp \ - crypto/sha2.cpp \ + crypto/sha256.cpp \ + crypto/sha512.cpp \ + crypto/hmac_sha512.cpp \ crypto/ripemd160.cpp \ crypto/common.h \ - crypto/sha2.h \ + crypto/sha256.h \ + crypto/sha512.h \ + crypto/hmac_sha512.h \ crypto/sha1.h \ crypto/ripemd160.h @@ -342,8 +346,10 @@ if BUILD_BITCOIN_LIBS include_HEADERS = script/bitcoinconsensus.h libbitcoinconsensus_la_SOURCES = \ core/transaction.cpp \ + crypto/hmac_sha512.cpp \ crypto/sha1.cpp \ - crypto/sha2.cpp \ + crypto/sha256.cpp \ + crypto/sha512.cpp \ crypto/ripemd160.cpp \ eccryptoverify.cpp \ ecwrapper.cpp \ diff --git a/src/crypto/hmac_sha512.cpp b/src/crypto/hmac_sha512.cpp new file mode 100644 index 0000000000..940a93277c --- /dev/null +++ b/src/crypto/hmac_sha512.cpp @@ -0,0 +1,34 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "crypto/hmac_sha512.h" + +#include + +CHMAC_SHA512::CHMAC_SHA512(const unsigned char* key, size_t keylen) +{ + unsigned char rkey[128]; + if (keylen <= 128) { + memcpy(rkey, key, keylen); + memset(rkey + keylen, 0, 128 - keylen); + } else { + CSHA512().Write(key, keylen).Finalize(rkey); + memset(rkey + 64, 0, 64); + } + + for (int n = 0; n < 128; n++) + rkey[n] ^= 0x5c; + outer.Write(rkey, 128); + + for (int n = 0; n < 128; n++) + rkey[n] ^= 0x5c ^ 0x36; + inner.Write(rkey, 128); +} + +void CHMAC_SHA512::Finalize(unsigned char hash[OUTPUT_SIZE]) +{ + unsigned char temp[64]; + inner.Finalize(temp); + outer.Write(temp, 64).Finalize(hash); +} diff --git a/src/crypto/hmac_sha512.h b/src/crypto/hmac_sha512.h new file mode 100644 index 0000000000..8c65785104 --- /dev/null +++ b/src/crypto/hmac_sha512.h @@ -0,0 +1,32 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_HMAC_SHA512_H +#define BITCOIN_HMAC_SHA512_H + +#include "crypto/sha512.h" + +#include +#include + +/** A hasher class for HMAC-SHA-512. */ +class CHMAC_SHA512 +{ +private: + CSHA512 outer; + CSHA512 inner; + +public: + static const size_t OUTPUT_SIZE = 64; + + CHMAC_SHA512(const unsigned char* key, size_t keylen); + CHMAC_SHA512& Write(const unsigned char* data, size_t len) + { + inner.Write(data, len); + return *this; + } + void Finalize(unsigned char hash[OUTPUT_SIZE]); +}; + +#endif // BITCOIN_HMAC_SHA512_H diff --git a/src/crypto/sha2.h b/src/crypto/sha2.h deleted file mode 100644 index 329c6675ab..0000000000 --- a/src/crypto/sha2.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 2014 The Bitcoin developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_CRYPTO_SHA2_H -#define BITCOIN_CRYPTO_SHA2_H - -#include -#include - -/** A hasher class for SHA-256. */ -class CSHA256 -{ -private: - uint32_t s[8]; - unsigned char buf[64]; - size_t bytes; - -public: - static const size_t OUTPUT_SIZE = 32; - - CSHA256(); - CSHA256& Write(const unsigned char* data, size_t len); - void Finalize(unsigned char hash[OUTPUT_SIZE]); - CSHA256& Reset(); -}; - -/** A hasher class for SHA-512. */ -class CSHA512 -{ -private: - uint64_t s[8]; - unsigned char buf[128]; - size_t bytes; - -public: - static const size_t OUTPUT_SIZE = 64; - - CSHA512(); - CSHA512& Write(const unsigned char* data, size_t len); - void Finalize(unsigned char hash[OUTPUT_SIZE]); - CSHA512& Reset(); -}; - -/** A hasher class for HMAC-SHA-512. */ -class CHMAC_SHA512 -{ -private: - CSHA512 outer; - CSHA512 inner; - -public: - static const size_t OUTPUT_SIZE = 64; - - CHMAC_SHA512(const unsigned char* key, size_t keylen); - CHMAC_SHA512& Write(const unsigned char* data, size_t len) - { - inner.Write(data, len); - return *this; - } - void Finalize(unsigned char hash[OUTPUT_SIZE]); -}; - -#endif // BITCOIN_CRYPTO_SHA2_H diff --git a/src/crypto/sha256.cpp b/src/crypto/sha256.cpp new file mode 100644 index 0000000000..8410e59305 --- /dev/null +++ b/src/crypto/sha256.cpp @@ -0,0 +1,189 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "crypto/sha256.h" + +#include "crypto/common.h" + +#include + +// Internal implementation code. +namespace +{ +/// Internal SHA-256 implementation. +namespace sha256 +{ +uint32_t inline Ch(uint32_t x, uint32_t y, uint32_t z) { return z ^ (x & (y ^ z)); } +uint32_t inline Maj(uint32_t x, uint32_t y, uint32_t z) { return (x & y) | (z & (x | y)); } +uint32_t inline Sigma0(uint32_t x) { return (x >> 2 | x << 30) ^ (x >> 13 | x << 19) ^ (x >> 22 | x << 10); } +uint32_t inline Sigma1(uint32_t x) { return (x >> 6 | x << 26) ^ (x >> 11 | x << 21) ^ (x >> 25 | x << 7); } +uint32_t inline sigma0(uint32_t x) { return (x >> 7 | x << 25) ^ (x >> 18 | x << 14) ^ (x >> 3); } +uint32_t inline sigma1(uint32_t x) { return (x >> 17 | x << 15) ^ (x >> 19 | x << 13) ^ (x >> 10); } + +/** One round of SHA-256. */ +void inline Round(uint32_t a, uint32_t b, uint32_t c, uint32_t& d, uint32_t e, uint32_t f, uint32_t g, uint32_t& h, uint32_t k, uint32_t w) +{ + uint32_t t1 = h + Sigma1(e) + Ch(e, f, g) + k + w; + uint32_t t2 = Sigma0(a) + Maj(a, b, c); + d += t1; + h = t1 + t2; +} + +/** Initialize SHA-256 state. */ +void inline Initialize(uint32_t* s) +{ + s[0] = 0x6a09e667ul; + s[1] = 0xbb67ae85ul; + s[2] = 0x3c6ef372ul; + s[3] = 0xa54ff53aul; + s[4] = 0x510e527ful; + s[5] = 0x9b05688cul; + s[6] = 0x1f83d9abul; + s[7] = 0x5be0cd19ul; +} + +/** Perform one SHA-256 transformation, processing a 64-byte chunk. */ +void Transform(uint32_t* s, const unsigned char* chunk) +{ + uint32_t a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5], g = s[6], h = s[7]; + uint32_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15; + + Round(a, b, c, d, e, f, g, h, 0x428a2f98, w0 = ReadBE32(chunk + 0)); + Round(h, a, b, c, d, e, f, g, 0x71374491, w1 = ReadBE32(chunk + 4)); + Round(g, h, a, b, c, d, e, f, 0xb5c0fbcf, w2 = ReadBE32(chunk + 8)); + Round(f, g, h, a, b, c, d, e, 0xe9b5dba5, w3 = ReadBE32(chunk + 12)); + Round(e, f, g, h, a, b, c, d, 0x3956c25b, w4 = ReadBE32(chunk + 16)); + Round(d, e, f, g, h, a, b, c, 0x59f111f1, w5 = ReadBE32(chunk + 20)); + Round(c, d, e, f, g, h, a, b, 0x923f82a4, w6 = ReadBE32(chunk + 24)); + Round(b, c, d, e, f, g, h, a, 0xab1c5ed5, w7 = ReadBE32(chunk + 28)); + Round(a, b, c, d, e, f, g, h, 0xd807aa98, w8 = ReadBE32(chunk + 32)); + Round(h, a, b, c, d, e, f, g, 0x12835b01, w9 = ReadBE32(chunk + 36)); + Round(g, h, a, b, c, d, e, f, 0x243185be, w10 = ReadBE32(chunk + 40)); + Round(f, g, h, a, b, c, d, e, 0x550c7dc3, w11 = ReadBE32(chunk + 44)); + Round(e, f, g, h, a, b, c, d, 0x72be5d74, w12 = ReadBE32(chunk + 48)); + Round(d, e, f, g, h, a, b, c, 0x80deb1fe, w13 = ReadBE32(chunk + 52)); + Round(c, d, e, f, g, h, a, b, 0x9bdc06a7, w14 = ReadBE32(chunk + 56)); + Round(b, c, d, e, f, g, h, a, 0xc19bf174, w15 = ReadBE32(chunk + 60)); + + Round(a, b, c, d, e, f, g, h, 0xe49b69c1, w0 += sigma1(w14) + w9 + sigma0(w1)); + Round(h, a, b, c, d, e, f, g, 0xefbe4786, w1 += sigma1(w15) + w10 + sigma0(w2)); + Round(g, h, a, b, c, d, e, f, 0x0fc19dc6, w2 += sigma1(w0) + w11 + sigma0(w3)); + Round(f, g, h, a, b, c, d, e, 0x240ca1cc, w3 += sigma1(w1) + w12 + sigma0(w4)); + Round(e, f, g, h, a, b, c, d, 0x2de92c6f, w4 += sigma1(w2) + w13 + sigma0(w5)); + Round(d, e, f, g, h, a, b, c, 0x4a7484aa, w5 += sigma1(w3) + w14 + sigma0(w6)); + Round(c, d, e, f, g, h, a, b, 0x5cb0a9dc, w6 += sigma1(w4) + w15 + sigma0(w7)); + Round(b, c, d, e, f, g, h, a, 0x76f988da, w7 += sigma1(w5) + w0 + sigma0(w8)); + Round(a, b, c, d, e, f, g, h, 0x983e5152, w8 += sigma1(w6) + w1 + sigma0(w9)); + Round(h, a, b, c, d, e, f, g, 0xa831c66d, w9 += sigma1(w7) + w2 + sigma0(w10)); + Round(g, h, a, b, c, d, e, f, 0xb00327c8, w10 += sigma1(w8) + w3 + sigma0(w11)); + Round(f, g, h, a, b, c, d, e, 0xbf597fc7, w11 += sigma1(w9) + w4 + sigma0(w12)); + Round(e, f, g, h, a, b, c, d, 0xc6e00bf3, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, g, h, a, b, c, 0xd5a79147, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, f, g, h, a, b, 0x06ca6351, w14 += sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, e, f, g, h, a, 0x14292967, w15 += sigma1(w13) + w8 + sigma0(w0)); + + Round(a, b, c, d, e, f, g, h, 0x27b70a85, w0 += sigma1(w14) + w9 + sigma0(w1)); + Round(h, a, b, c, d, e, f, g, 0x2e1b2138, w1 += sigma1(w15) + w10 + sigma0(w2)); + Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc, w2 += sigma1(w0) + w11 + sigma0(w3)); + Round(f, g, h, a, b, c, d, e, 0x53380d13, w3 += sigma1(w1) + w12 + sigma0(w4)); + Round(e, f, g, h, a, b, c, d, 0x650a7354, w4 += sigma1(w2) + w13 + sigma0(w5)); + Round(d, e, f, g, h, a, b, c, 0x766a0abb, w5 += sigma1(w3) + w14 + sigma0(w6)); + Round(c, d, e, f, g, h, a, b, 0x81c2c92e, w6 += sigma1(w4) + w15 + sigma0(w7)); + Round(b, c, d, e, f, g, h, a, 0x92722c85, w7 += sigma1(w5) + w0 + sigma0(w8)); + Round(a, b, c, d, e, f, g, h, 0xa2bfe8a1, w8 += sigma1(w6) + w1 + sigma0(w9)); + Round(h, a, b, c, d, e, f, g, 0xa81a664b, w9 += sigma1(w7) + w2 + sigma0(w10)); + Round(g, h, a, b, c, d, e, f, 0xc24b8b70, w10 += sigma1(w8) + w3 + sigma0(w11)); + Round(f, g, h, a, b, c, d, e, 0xc76c51a3, w11 += sigma1(w9) + w4 + sigma0(w12)); + Round(e, f, g, h, a, b, c, d, 0xd192e819, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, g, h, a, b, c, 0xd6990624, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, f, g, h, a, b, 0xf40e3585, w14 += sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, e, f, g, h, a, 0x106aa070, w15 += sigma1(w13) + w8 + sigma0(w0)); + + Round(a, b, c, d, e, f, g, h, 0x19a4c116, w0 += sigma1(w14) + w9 + sigma0(w1)); + Round(h, a, b, c, d, e, f, g, 0x1e376c08, w1 += sigma1(w15) + w10 + sigma0(w2)); + Round(g, h, a, b, c, d, e, f, 0x2748774c, w2 += sigma1(w0) + w11 + sigma0(w3)); + Round(f, g, h, a, b, c, d, e, 0x34b0bcb5, w3 += sigma1(w1) + w12 + sigma0(w4)); + Round(e, f, g, h, a, b, c, d, 0x391c0cb3, w4 += sigma1(w2) + w13 + sigma0(w5)); + Round(d, e, f, g, h, a, b, c, 0x4ed8aa4a, w5 += sigma1(w3) + w14 + sigma0(w6)); + Round(c, d, e, f, g, h, a, b, 0x5b9cca4f, w6 += sigma1(w4) + w15 + sigma0(w7)); + Round(b, c, d, e, f, g, h, a, 0x682e6ff3, w7 += sigma1(w5) + w0 + sigma0(w8)); + Round(a, b, c, d, e, f, g, h, 0x748f82ee, w8 += sigma1(w6) + w1 + sigma0(w9)); + Round(h, a, b, c, d, e, f, g, 0x78a5636f, w9 += sigma1(w7) + w2 + sigma0(w10)); + Round(g, h, a, b, c, d, e, f, 0x84c87814, w10 += sigma1(w8) + w3 + sigma0(w11)); + Round(f, g, h, a, b, c, d, e, 0x8cc70208, w11 += sigma1(w9) + w4 + sigma0(w12)); + Round(e, f, g, h, a, b, c, d, 0x90befffa, w12 += sigma1(w10) + w5 + sigma0(w13)); + Round(d, e, f, g, h, a, b, c, 0xa4506ceb, w13 += sigma1(w11) + w6 + sigma0(w14)); + Round(c, d, e, f, g, h, a, b, 0xbef9a3f7, w14 + sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, e, f, g, h, a, 0xc67178f2, w15 + sigma1(w13) + w8 + sigma0(w0)); + + s[0] += a; + s[1] += b; + s[2] += c; + s[3] += d; + s[4] += e; + s[5] += f; + s[6] += g; + s[7] += h; +} + +} // namespace sha256 +} // namespace + + +////// SHA-256 + +CSHA256::CSHA256() : bytes(0) +{ + sha256::Initialize(s); +} + +CSHA256& CSHA256::Write(const unsigned char* data, size_t len) +{ + const unsigned char* end = data + len; + size_t bufsize = bytes % 64; + if (bufsize && bufsize + len >= 64) { + // Fill the buffer, and process it. + memcpy(buf + bufsize, data, 64 - bufsize); + bytes += 64 - bufsize; + data += 64 - bufsize; + sha256::Transform(s, buf); + bufsize = 0; + } + while (end >= data + 64) { + // Process full chunks directly from the source. + sha256::Transform(s, data); + bytes += 64; + data += 64; + } + if (end > data) { + // Fill the buffer with what remains. + memcpy(buf + bufsize, data, end - data); + bytes += end - data; + } + return *this; +} + +void CSHA256::Finalize(unsigned char hash[OUTPUT_SIZE]) +{ + static const unsigned char pad[64] = {0x80}; + unsigned char sizedesc[8]; + WriteBE64(sizedesc, bytes << 3); + Write(pad, 1 + ((119 - (bytes % 64)) % 64)); + Write(sizedesc, 8); + WriteBE32(hash, s[0]); + WriteBE32(hash + 4, s[1]); + WriteBE32(hash + 8, s[2]); + WriteBE32(hash + 12, s[3]); + WriteBE32(hash + 16, s[4]); + WriteBE32(hash + 20, s[5]); + WriteBE32(hash + 24, s[6]); + WriteBE32(hash + 28, s[7]); +} + +CSHA256& CSHA256::Reset() +{ + bytes = 0; + sha256::Initialize(s); + return *this; +} diff --git a/src/crypto/sha256.h b/src/crypto/sha256.h new file mode 100644 index 0000000000..a57dce0227 --- /dev/null +++ b/src/crypto/sha256.h @@ -0,0 +1,28 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_SHA256_H +#define BITCOIN_SHA256_H + +#include +#include + +/** A hasher class for SHA-256. */ +class CSHA256 +{ +private: + uint32_t s[8]; + unsigned char buf[64]; + size_t bytes; + +public: + static const size_t OUTPUT_SIZE = 32; + + CSHA256(); + CSHA256& Write(const unsigned char* data, size_t len); + void Finalize(unsigned char hash[OUTPUT_SIZE]); + CSHA256& Reset(); +}; + +#endif // BITCOIN_SHA256_H diff --git a/src/crypto/sha2.cpp b/src/crypto/sha512.cpp similarity index 53% rename from src/crypto/sha2.cpp rename to src/crypto/sha512.cpp index 613aac2d71..22c3103bed 100644 --- a/src/crypto/sha2.cpp +++ b/src/crypto/sha512.cpp @@ -2,7 +2,7 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "crypto/sha2.h" +#include "crypto/sha512.h" #include "crypto/common.h" @@ -11,124 +11,6 @@ // Internal implementation code. namespace { -/// Internal SHA-256 implementation. -namespace sha256 -{ -uint32_t inline Ch(uint32_t x, uint32_t y, uint32_t z) { return z ^ (x & (y ^ z)); } -uint32_t inline Maj(uint32_t x, uint32_t y, uint32_t z) { return (x & y) | (z & (x | y)); } -uint32_t inline Sigma0(uint32_t x) { return (x >> 2 | x << 30) ^ (x >> 13 | x << 19) ^ (x >> 22 | x << 10); } -uint32_t inline Sigma1(uint32_t x) { return (x >> 6 | x << 26) ^ (x >> 11 | x << 21) ^ (x >> 25 | x << 7); } -uint32_t inline sigma0(uint32_t x) { return (x >> 7 | x << 25) ^ (x >> 18 | x << 14) ^ (x >> 3); } -uint32_t inline sigma1(uint32_t x) { return (x >> 17 | x << 15) ^ (x >> 19 | x << 13) ^ (x >> 10); } - -/** One round of SHA-256. */ -void inline Round(uint32_t a, uint32_t b, uint32_t c, uint32_t& d, uint32_t e, uint32_t f, uint32_t g, uint32_t& h, uint32_t k, uint32_t w) -{ - uint32_t t1 = h + Sigma1(e) + Ch(e, f, g) + k + w; - uint32_t t2 = Sigma0(a) + Maj(a, b, c); - d += t1; - h = t1 + t2; -} - -/** Initialize SHA-256 state. */ -void inline Initialize(uint32_t* s) -{ - s[0] = 0x6a09e667ul; - s[1] = 0xbb67ae85ul; - s[2] = 0x3c6ef372ul; - s[3] = 0xa54ff53aul; - s[4] = 0x510e527ful; - s[5] = 0x9b05688cul; - s[6] = 0x1f83d9abul; - s[7] = 0x5be0cd19ul; -} - -/** Perform one SHA-256 transformation, processing a 64-byte chunk. */ -void Transform(uint32_t* s, const unsigned char* chunk) -{ - uint32_t a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5], g = s[6], h = s[7]; - uint32_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15; - - Round(a, b, c, d, e, f, g, h, 0x428a2f98, w0 = ReadBE32(chunk + 0)); - Round(h, a, b, c, d, e, f, g, 0x71374491, w1 = ReadBE32(chunk + 4)); - Round(g, h, a, b, c, d, e, f, 0xb5c0fbcf, w2 = ReadBE32(chunk + 8)); - Round(f, g, h, a, b, c, d, e, 0xe9b5dba5, w3 = ReadBE32(chunk + 12)); - Round(e, f, g, h, a, b, c, d, 0x3956c25b, w4 = ReadBE32(chunk + 16)); - Round(d, e, f, g, h, a, b, c, 0x59f111f1, w5 = ReadBE32(chunk + 20)); - Round(c, d, e, f, g, h, a, b, 0x923f82a4, w6 = ReadBE32(chunk + 24)); - Round(b, c, d, e, f, g, h, a, 0xab1c5ed5, w7 = ReadBE32(chunk + 28)); - Round(a, b, c, d, e, f, g, h, 0xd807aa98, w8 = ReadBE32(chunk + 32)); - Round(h, a, b, c, d, e, f, g, 0x12835b01, w9 = ReadBE32(chunk + 36)); - Round(g, h, a, b, c, d, e, f, 0x243185be, w10 = ReadBE32(chunk + 40)); - Round(f, g, h, a, b, c, d, e, 0x550c7dc3, w11 = ReadBE32(chunk + 44)); - Round(e, f, g, h, a, b, c, d, 0x72be5d74, w12 = ReadBE32(chunk + 48)); - Round(d, e, f, g, h, a, b, c, 0x80deb1fe, w13 = ReadBE32(chunk + 52)); - Round(c, d, e, f, g, h, a, b, 0x9bdc06a7, w14 = ReadBE32(chunk + 56)); - Round(b, c, d, e, f, g, h, a, 0xc19bf174, w15 = ReadBE32(chunk + 60)); - - Round(a, b, c, d, e, f, g, h, 0xe49b69c1, w0 += sigma1(w14) + w9 + sigma0(w1)); - Round(h, a, b, c, d, e, f, g, 0xefbe4786, w1 += sigma1(w15) + w10 + sigma0(w2)); - Round(g, h, a, b, c, d, e, f, 0x0fc19dc6, w2 += sigma1(w0) + w11 + sigma0(w3)); - Round(f, g, h, a, b, c, d, e, 0x240ca1cc, w3 += sigma1(w1) + w12 + sigma0(w4)); - Round(e, f, g, h, a, b, c, d, 0x2de92c6f, w4 += sigma1(w2) + w13 + sigma0(w5)); - Round(d, e, f, g, h, a, b, c, 0x4a7484aa, w5 += sigma1(w3) + w14 + sigma0(w6)); - Round(c, d, e, f, g, h, a, b, 0x5cb0a9dc, w6 += sigma1(w4) + w15 + sigma0(w7)); - Round(b, c, d, e, f, g, h, a, 0x76f988da, w7 += sigma1(w5) + w0 + sigma0(w8)); - Round(a, b, c, d, e, f, g, h, 0x983e5152, w8 += sigma1(w6) + w1 + sigma0(w9)); - Round(h, a, b, c, d, e, f, g, 0xa831c66d, w9 += sigma1(w7) + w2 + sigma0(w10)); - Round(g, h, a, b, c, d, e, f, 0xb00327c8, w10 += sigma1(w8) + w3 + sigma0(w11)); - Round(f, g, h, a, b, c, d, e, 0xbf597fc7, w11 += sigma1(w9) + w4 + sigma0(w12)); - Round(e, f, g, h, a, b, c, d, 0xc6e00bf3, w12 += sigma1(w10) + w5 + sigma0(w13)); - Round(d, e, f, g, h, a, b, c, 0xd5a79147, w13 += sigma1(w11) + w6 + sigma0(w14)); - Round(c, d, e, f, g, h, a, b, 0x06ca6351, w14 += sigma1(w12) + w7 + sigma0(w15)); - Round(b, c, d, e, f, g, h, a, 0x14292967, w15 += sigma1(w13) + w8 + sigma0(w0)); - - Round(a, b, c, d, e, f, g, h, 0x27b70a85, w0 += sigma1(w14) + w9 + sigma0(w1)); - Round(h, a, b, c, d, e, f, g, 0x2e1b2138, w1 += sigma1(w15) + w10 + sigma0(w2)); - Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc, w2 += sigma1(w0) + w11 + sigma0(w3)); - Round(f, g, h, a, b, c, d, e, 0x53380d13, w3 += sigma1(w1) + w12 + sigma0(w4)); - Round(e, f, g, h, a, b, c, d, 0x650a7354, w4 += sigma1(w2) + w13 + sigma0(w5)); - Round(d, e, f, g, h, a, b, c, 0x766a0abb, w5 += sigma1(w3) + w14 + sigma0(w6)); - Round(c, d, e, f, g, h, a, b, 0x81c2c92e, w6 += sigma1(w4) + w15 + sigma0(w7)); - Round(b, c, d, e, f, g, h, a, 0x92722c85, w7 += sigma1(w5) + w0 + sigma0(w8)); - Round(a, b, c, d, e, f, g, h, 0xa2bfe8a1, w8 += sigma1(w6) + w1 + sigma0(w9)); - Round(h, a, b, c, d, e, f, g, 0xa81a664b, w9 += sigma1(w7) + w2 + sigma0(w10)); - Round(g, h, a, b, c, d, e, f, 0xc24b8b70, w10 += sigma1(w8) + w3 + sigma0(w11)); - Round(f, g, h, a, b, c, d, e, 0xc76c51a3, w11 += sigma1(w9) + w4 + sigma0(w12)); - Round(e, f, g, h, a, b, c, d, 0xd192e819, w12 += sigma1(w10) + w5 + sigma0(w13)); - Round(d, e, f, g, h, a, b, c, 0xd6990624, w13 += sigma1(w11) + w6 + sigma0(w14)); - Round(c, d, e, f, g, h, a, b, 0xf40e3585, w14 += sigma1(w12) + w7 + sigma0(w15)); - Round(b, c, d, e, f, g, h, a, 0x106aa070, w15 += sigma1(w13) + w8 + sigma0(w0)); - - Round(a, b, c, d, e, f, g, h, 0x19a4c116, w0 += sigma1(w14) + w9 + sigma0(w1)); - Round(h, a, b, c, d, e, f, g, 0x1e376c08, w1 += sigma1(w15) + w10 + sigma0(w2)); - Round(g, h, a, b, c, d, e, f, 0x2748774c, w2 += sigma1(w0) + w11 + sigma0(w3)); - Round(f, g, h, a, b, c, d, e, 0x34b0bcb5, w3 += sigma1(w1) + w12 + sigma0(w4)); - Round(e, f, g, h, a, b, c, d, 0x391c0cb3, w4 += sigma1(w2) + w13 + sigma0(w5)); - Round(d, e, f, g, h, a, b, c, 0x4ed8aa4a, w5 += sigma1(w3) + w14 + sigma0(w6)); - Round(c, d, e, f, g, h, a, b, 0x5b9cca4f, w6 += sigma1(w4) + w15 + sigma0(w7)); - Round(b, c, d, e, f, g, h, a, 0x682e6ff3, w7 += sigma1(w5) + w0 + sigma0(w8)); - Round(a, b, c, d, e, f, g, h, 0x748f82ee, w8 += sigma1(w6) + w1 + sigma0(w9)); - Round(h, a, b, c, d, e, f, g, 0x78a5636f, w9 += sigma1(w7) + w2 + sigma0(w10)); - Round(g, h, a, b, c, d, e, f, 0x84c87814, w10 += sigma1(w8) + w3 + sigma0(w11)); - Round(f, g, h, a, b, c, d, e, 0x8cc70208, w11 += sigma1(w9) + w4 + sigma0(w12)); - Round(e, f, g, h, a, b, c, d, 0x90befffa, w12 += sigma1(w10) + w5 + sigma0(w13)); - Round(d, e, f, g, h, a, b, c, 0xa4506ceb, w13 += sigma1(w11) + w6 + sigma0(w14)); - Round(c, d, e, f, g, h, a, b, 0xbef9a3f7, w14 + sigma1(w12) + w7 + sigma0(w15)); - Round(b, c, d, e, f, g, h, a, 0xc67178f2, w15 + sigma1(w13) + w8 + sigma0(w0)); - - s[0] += a; - s[1] += b; - s[2] += c; - s[3] += d; - s[4] += e; - s[5] += f; - s[6] += g; - s[7] += h; -} - -} // namespace sha256 - /// Internal SHA-512 implementation. namespace sha512 { @@ -249,8 +131,8 @@ void Transform(uint64_t* s, const unsigned char* chunk) Round(f, g, h, a, b, c, d, e, 0x431d67c49c100d4cull, w11 += sigma1(w9) + w4 + sigma0(w12)); Round(e, f, g, h, a, b, c, d, 0x4cc5d4becb3e42b6ull, w12 += sigma1(w10) + w5 + sigma0(w13)); Round(d, e, f, g, h, a, b, c, 0x597f299cfc657e2aull, w13 += sigma1(w11) + w6 + sigma0(w14)); - Round(c, d, e, f, g, h, a, b, 0x5fcb6fab3ad6faecull, w14 += sigma1(w12) + w7 + sigma0(w15)); - Round(b, c, d, e, f, g, h, a, 0x6c44198c4a475817ull, w15 += sigma1(w13) + w8 + sigma0(w0)); + Round(c, d, e, f, g, h, a, b, 0x5fcb6fab3ad6faecull, w14 + sigma1(w12) + w7 + sigma0(w15)); + Round(b, c, d, e, f, g, h, a, 0x6c44198c4a475817ull, w15 + sigma1(w13) + w8 + sigma0(w0)); s[0] += a; s[1] += b; @@ -267,63 +149,6 @@ void Transform(uint64_t* s, const unsigned char* chunk) } // namespace -////// SHA-256 - -CSHA256::CSHA256() : bytes(0) -{ - sha256::Initialize(s); -} - -CSHA256& CSHA256::Write(const unsigned char* data, size_t len) -{ - const unsigned char* end = data + len; - size_t bufsize = bytes % 64; - if (bufsize && bufsize + len >= 64) { - // Fill the buffer, and process it. - memcpy(buf + bufsize, data, 64 - bufsize); - bytes += 64 - bufsize; - data += 64 - bufsize; - sha256::Transform(s, buf); - bufsize = 0; - } - while (end >= data + 64) { - // Process full chunks directly from the source. - sha256::Transform(s, data); - bytes += 64; - data += 64; - } - if (end > data) { - // Fill the buffer with what remains. - memcpy(buf + bufsize, data, end - data); - bytes += end - data; - } - return *this; -} - -void CSHA256::Finalize(unsigned char hash[OUTPUT_SIZE]) -{ - static const unsigned char pad[64] = {0x80}; - unsigned char sizedesc[8]; - WriteBE64(sizedesc, bytes << 3); - Write(pad, 1 + ((119 - (bytes % 64)) % 64)); - Write(sizedesc, 8); - WriteBE32(hash, s[0]); - WriteBE32(hash + 4, s[1]); - WriteBE32(hash + 8, s[2]); - WriteBE32(hash + 12, s[3]); - WriteBE32(hash + 16, s[4]); - WriteBE32(hash + 20, s[5]); - WriteBE32(hash + 24, s[6]); - WriteBE32(hash + 28, s[7]); -} - -CSHA256& CSHA256::Reset() -{ - bytes = 0; - sha256::Initialize(s); - return *this; -} - ////// SHA-512 CSHA512::CSHA512() : bytes(0) @@ -380,32 +205,3 @@ CSHA512& CSHA512::Reset() sha512::Initialize(s); return *this; } - -////// HMAC-SHA-512 - -CHMAC_SHA512::CHMAC_SHA512(const unsigned char* key, size_t keylen) -{ - unsigned char rkey[128]; - if (keylen <= 128) { - memcpy(rkey, key, keylen); - memset(rkey + keylen, 0, 128 - keylen); - } else { - CSHA512().Write(key, keylen).Finalize(rkey); - memset(rkey + 64, 0, 64); - } - - for (int n = 0; n < 128; n++) - rkey[n] ^= 0x5c; - outer.Write(rkey, 128); - - for (int n = 0; n < 128; n++) - rkey[n] ^= 0x5c ^ 0x36; - inner.Write(rkey, 128); -} - -void CHMAC_SHA512::Finalize(unsigned char hash[OUTPUT_SIZE]) -{ - unsigned char temp[64]; - inner.Finalize(temp); - outer.Write(temp, 64).Finalize(hash); -} diff --git a/src/crypto/sha512.h b/src/crypto/sha512.h new file mode 100644 index 0000000000..4d1345e50b --- /dev/null +++ b/src/crypto/sha512.h @@ -0,0 +1,28 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_SHA512_H +#define BITCOIN_SHA512_H + +#include +#include + +/** A hasher class for SHA-512. */ +class CSHA512 +{ +private: + uint64_t s[8]; + unsigned char buf[128]; + size_t bytes; + +public: + static const size_t OUTPUT_SIZE = 64; + + CSHA512(); + CSHA512& Write(const unsigned char* data, size_t len); + void Finalize(unsigned char hash[OUTPUT_SIZE]); + CSHA512& Reset(); +}; + +#endif // BITCOIN_SHA512_H diff --git a/src/hash.cpp b/src/hash.cpp index 2cca06ae23..aaca00ea2d 100644 --- a/src/hash.cpp +++ b/src/hash.cpp @@ -3,6 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "hash.h" +#include "crypto/hmac_sha512.h" inline uint32_t ROTL32(uint32_t x, int8_t r) { diff --git a/src/hash.h b/src/hash.h index 75695160e6..5a34cdc5c3 100644 --- a/src/hash.h +++ b/src/hash.h @@ -7,7 +7,7 @@ #define BITCOIN_HASH_H #include "crypto/ripemd160.h" -#include "crypto/sha2.h" +#include "crypto/sha256.h" #include "serialize.h" #include "uint256.h" #include "version.h" diff --git a/src/key.cpp b/src/key.cpp index 76256b864c..9b3cf8f019 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -4,7 +4,7 @@ #include "key.h" -#include "crypto/sha2.h" +#include "crypto/hmac_sha512.h" #include "eccryptoverify.h" #include "pubkey.h" #include "random.h" diff --git a/src/pubkey.cpp b/src/pubkey.cpp index 9c6f536f21..91979ff4dc 100644 --- a/src/pubkey.cpp +++ b/src/pubkey.cpp @@ -4,7 +4,6 @@ #include "pubkey.h" -#include "crypto/sha2.h" #include "eccryptoverify.h" #ifdef USE_SECP256K1 diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 760086eaba..6038adda94 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -8,7 +8,7 @@ #include "core/transaction.h" #include "crypto/ripemd160.h" #include "crypto/sha1.h" -#include "crypto/sha2.h" +#include "crypto/sha256.h" #include "eccryptoverify.h" #include "pubkey.h" #include "script/script.h" diff --git a/src/test/crypto_tests.cpp b/src/test/crypto_tests.cpp index 68232a2ff1..b3783133d5 100644 --- a/src/test/crypto_tests.cpp +++ b/src/test/crypto_tests.cpp @@ -4,7 +4,9 @@ #include "crypto/ripemd160.h" #include "crypto/sha1.h" -#include "crypto/sha2.h" +#include "crypto/sha256.h" +#include "crypto/sha512.h" +#include "crypto/hmac_sha512.h" #include "random.h" #include "utilstrencodings.h" From a8f5087e5318211b58b0c87ebd4e036e6c6721e5 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 26 Oct 2014 01:38:13 -0700 Subject: [PATCH 1087/1288] Add HMAC-SHA256 --- src/Makefile.am | 2 ++ src/crypto/hmac_sha256.cpp | 34 ++++++++++++++++++++++++++++++ src/crypto/hmac_sha256.h | 32 ++++++++++++++++++++++++++++ src/test/crypto_tests.cpp | 43 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 111 insertions(+) create mode 100644 src/crypto/hmac_sha256.cpp create mode 100644 src/crypto/hmac_sha256.h diff --git a/src/Makefile.am b/src/Makefile.am index e1e6915185..1a5c57a3fa 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -205,11 +205,13 @@ crypto_libbitcoin_crypto_a_SOURCES = \ crypto/sha1.cpp \ crypto/sha256.cpp \ crypto/sha512.cpp \ + crypto/hmac_sha256.cpp \ crypto/hmac_sha512.cpp \ crypto/ripemd160.cpp \ crypto/common.h \ crypto/sha256.h \ crypto/sha512.h \ + crypto/hmac_sha256.h \ crypto/hmac_sha512.h \ crypto/sha1.h \ crypto/ripemd160.h diff --git a/src/crypto/hmac_sha256.cpp b/src/crypto/hmac_sha256.cpp new file mode 100644 index 0000000000..435896538b --- /dev/null +++ b/src/crypto/hmac_sha256.cpp @@ -0,0 +1,34 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "crypto/hmac_sha256.h" + +#include + +CHMAC_SHA256::CHMAC_SHA256(const unsigned char* key, size_t keylen) +{ + unsigned char rkey[64]; + if (keylen <= 64) { + memcpy(rkey, key, keylen); + memset(rkey + keylen, 0, 64 - keylen); + } else { + CSHA256().Write(key, keylen).Finalize(rkey); + memset(rkey + 32, 0, 32); + } + + for (int n = 0; n < 64; n++) + rkey[n] ^= 0x5c; + outer.Write(rkey, 64); + + for (int n = 0; n < 64; n++) + rkey[n] ^= 0x5c ^ 0x36; + inner.Write(rkey, 64); +} + +void CHMAC_SHA256::Finalize(unsigned char hash[OUTPUT_SIZE]) +{ + unsigned char temp[32]; + inner.Finalize(temp); + outer.Write(temp, 32).Finalize(hash); +} diff --git a/src/crypto/hmac_sha256.h b/src/crypto/hmac_sha256.h new file mode 100644 index 0000000000..4ceac70944 --- /dev/null +++ b/src/crypto/hmac_sha256.h @@ -0,0 +1,32 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_HMAC_SHA256_H +#define BITCOIN_HMAC_SHA256_H + +#include "crypto/sha256.h" + +#include +#include + +/** A hasher class for HMAC-SHA-512. */ +class CHMAC_SHA256 +{ +private: + CSHA256 outer; + CSHA256 inner; + +public: + static const size_t OUTPUT_SIZE = 32; + + CHMAC_SHA256(const unsigned char* key, size_t keylen); + CHMAC_SHA256& Write(const unsigned char* data, size_t len) + { + inner.Write(data, len); + return *this; + } + void Finalize(unsigned char hash[OUTPUT_SIZE]); +}; + +#endif // BITCOIN_SHA256_H diff --git a/src/test/crypto_tests.cpp b/src/test/crypto_tests.cpp index b3783133d5..466b38fca9 100644 --- a/src/test/crypto_tests.cpp +++ b/src/test/crypto_tests.cpp @@ -6,6 +6,7 @@ #include "crypto/sha1.h" #include "crypto/sha256.h" #include "crypto/sha512.h" +#include "crypto/hmac_sha256.h" #include "crypto/hmac_sha512.h" #include "random.h" #include "utilstrencodings.h" @@ -50,6 +51,11 @@ void TestSHA256(const std::string &in, const std::string &hexout) { TestVector(C void TestSHA512(const std::string &in, const std::string &hexout) { TestVector(CSHA512(), in, ParseHex(hexout));} void TestRIPEMD160(const std::string &in, const std::string &hexout) { TestVector(CRIPEMD160(), in, ParseHex(hexout));} +void TestHMACSHA256(const std::string &hexkey, const std::string &hexin, const std::string &hexout) { + std::vector key = ParseHex(hexkey); + TestVector(CHMAC_SHA256(&key[0], key.size()), ParseHex(hexin), ParseHex(hexout)); +} + void TestHMACSHA512(const std::string &hexkey, const std::string &hexin, const std::string &hexout) { std::vector key = ParseHex(hexkey); TestVector(CHMAC_SHA512(&key[0], key.size()), ParseHex(hexin), ParseHex(hexout)); @@ -160,6 +166,43 @@ BOOST_AUTO_TEST_CASE(sha512_testvectors) { "37de8c3ef5459d76a52cedc02dc499a3c9ed9dedbfb3281afd9653b8a112fafc"); } +BOOST_AUTO_TEST_CASE(hmac_sha256_testvectors) { + // test cases 1, 2, 3, 4, 6 and 7 of RFC 4231 + TestHMACSHA256("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", + "4869205468657265", + "b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7"); + TestHMACSHA256("4a656665", + "7768617420646f2079612077616e7420666f72206e6f7468696e673f", + "5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843"); + TestHMACSHA256("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" + "dddddddddddddddddddddddddddddddddddd", + "773ea91e36800e46854db8ebd09181a72959098b3ef8c122d9635514ced565fe"); + TestHMACSHA256("0102030405060708090a0b0c0d0e0f10111213141516171819", + "cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd" + "cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd", + "82558a389a443c0ea4cc819899f2083a85f0faa3e578f8077a2e3ff46729665b"); + TestHMACSHA256("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaa", + "54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a" + "65204b6579202d2048617368204b6579204669727374", + "60e431591ee0b67f0d8a26aacbf5b77f8e0bc6213728c5140546040f0ee37f54"); + TestHMACSHA256("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaa", + "5468697320697320612074657374207573696e672061206c6172676572207468" + "616e20626c6f636b2d73697a65206b657920616e642061206c61726765722074" + "68616e20626c6f636b2d73697a6520646174612e20546865206b6579206e6565" + "647320746f20626520686173686564206265666f7265206265696e6720757365" + "642062792074686520484d414320616c676f726974686d2e", + "9b09ffa71b942fcb27635fbcd5b0e944bfdc63644f0713938a7f51535c3a35e2"); +} + BOOST_AUTO_TEST_CASE(hmac_sha512_testvectors) { // test cases 1, 2, 3, 4, 6 and 7 of RFC 4231 TestHMACSHA512("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", From 3060e360980f3e80db1d903085d759338ab27f4a Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 26 Oct 2014 02:28:22 -0700 Subject: [PATCH 1088/1288] Add the RFC6979 PRNG --- src/Makefile.am | 2 ++ src/crypto/rfc6979_hmac_sha256.cpp | 47 ++++++++++++++++++++++++++++++ src/crypto/rfc6979_hmac_sha256.h | 36 +++++++++++++++++++++++ src/test/crypto_tests.cpp | 36 +++++++++++++++++++++++ 4 files changed, 121 insertions(+) create mode 100644 src/crypto/rfc6979_hmac_sha256.cpp create mode 100644 src/crypto/rfc6979_hmac_sha256.h diff --git a/src/Makefile.am b/src/Makefile.am index 1a5c57a3fa..2863a7961e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -206,12 +206,14 @@ crypto_libbitcoin_crypto_a_SOURCES = \ crypto/sha256.cpp \ crypto/sha512.cpp \ crypto/hmac_sha256.cpp \ + crypto/rfc6979_hmac_sha256.cpp \ crypto/hmac_sha512.cpp \ crypto/ripemd160.cpp \ crypto/common.h \ crypto/sha256.h \ crypto/sha512.h \ crypto/hmac_sha256.h \ + crypto/rfc6979_hmac_sha256.h \ crypto/hmac_sha512.h \ crypto/sha1.h \ crypto/ripemd160.h diff --git a/src/crypto/rfc6979_hmac_sha256.cpp b/src/crypto/rfc6979_hmac_sha256.cpp new file mode 100644 index 0000000000..3f935abfea --- /dev/null +++ b/src/crypto/rfc6979_hmac_sha256.cpp @@ -0,0 +1,47 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "crypto/rfc6979_hmac_sha256.h" + +#include + +#include + +static const unsigned char zero[1] = {0x00}; +static const unsigned char one[1] = {0x01}; + +RFC6979_HMAC_SHA256::RFC6979_HMAC_SHA256(const unsigned char* key, size_t keylen, const unsigned char* msg, size_t msglen) : retry(false) +{ + memset(V, 0x01, sizeof(V)); + memset(K, 0x00, sizeof(K)); + + CHMAC_SHA256(K, sizeof(K)).Write(V, sizeof(V)).Write(zero, sizeof(zero)).Write(key, keylen).Write(msg, msglen).Finalize(K); + CHMAC_SHA256(K, sizeof(K)).Write(V, sizeof(V)).Finalize(V); + CHMAC_SHA256(K, sizeof(K)).Write(V, sizeof(V)).Write(one, sizeof(one)).Write(key, keylen).Write(msg, msglen).Finalize(K); + CHMAC_SHA256(K, sizeof(K)).Write(V, sizeof(V)).Finalize(V); +} + +RFC6979_HMAC_SHA256::~RFC6979_HMAC_SHA256() +{ + memset(V, 0x01, sizeof(V)); + memset(K, 0x00, sizeof(K)); +} + +void RFC6979_HMAC_SHA256::Generate(unsigned char* output, size_t outputlen) +{ + if (retry) { + CHMAC_SHA256(K, sizeof(K)).Write(V, sizeof(V)).Write(zero, sizeof(zero)).Finalize(K); + CHMAC_SHA256(K, sizeof(K)).Write(V, sizeof(V)).Finalize(V); + } + + while (outputlen > 0) { + CHMAC_SHA256(K, sizeof(K)).Write(V, sizeof(V)).Finalize(V); + size_t len = std::min(outputlen, sizeof(V)); + memcpy(output, V, len); + output += len; + outputlen -= len; + } + + retry = true; +} diff --git a/src/crypto/rfc6979_hmac_sha256.h b/src/crypto/rfc6979_hmac_sha256.h new file mode 100644 index 0000000000..e67ddcf8fe --- /dev/null +++ b/src/crypto/rfc6979_hmac_sha256.h @@ -0,0 +1,36 @@ +// Copyright (c) 2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_RFC6979_HMAC_SHA256_H +#define BITCOIN_RFC6979_HMAC_SHA256_H + +#include "crypto/hmac_sha256.h" + +#include +#include + +/** The RFC 6979 PRNG using HMAC-SHA256. */ +class RFC6979_HMAC_SHA256 +{ +private: + unsigned char V[CHMAC_SHA256::OUTPUT_SIZE]; + unsigned char K[CHMAC_SHA256::OUTPUT_SIZE]; + bool retry; + +public: + /** + * Construct a new RFC6979 PRNG, using the given key and message. + * The message is assumed to be already hashed. + */ + RFC6979_HMAC_SHA256(const unsigned char* key, size_t keylen, const unsigned char* msg, size_t msglen); + + /** + * Generate a byte array. + */ + void Generate(unsigned char* output, size_t outputlen); + + ~RFC6979_HMAC_SHA256(); +}; + +#endif // BITCOIN_RFC6979_HMAC_SHA256_H diff --git a/src/test/crypto_tests.cpp b/src/test/crypto_tests.cpp index 466b38fca9..26708f5071 100644 --- a/src/test/crypto_tests.cpp +++ b/src/test/crypto_tests.cpp @@ -2,6 +2,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include "crypto/rfc6979_hmac_sha256.h" #include "crypto/ripemd160.h" #include "crypto/sha1.h" #include "crypto/sha256.h" @@ -13,6 +14,7 @@ #include +#include #include BOOST_AUTO_TEST_SUITE(crypto_tests) @@ -246,4 +248,38 @@ BOOST_AUTO_TEST_CASE(hmac_sha512_testvectors) { "b6022cac3c4982b10d5eeb55c3e4de15134676fb6de0446065c97440fa8c6a58"); } +void TestRFC6979(const std::string& hexkey, const std::string& hexmsg, const std::vector& hexout) +{ + std::vector key = ParseHex(hexkey); + std::vector msg = ParseHex(hexmsg); + RFC6979_HMAC_SHA256 rng(&key[0], key.size(), &msg[0], msg.size()); + + for (unsigned int i = 0; i < hexout.size(); i++) { + std::vector out = ParseHex(hexout[i]); + std::vector gen; + gen.resize(out.size()); + rng.Generate(&gen[0], gen.size()); + BOOST_CHECK(out == gen); + } +} + +BOOST_AUTO_TEST_CASE(rfc6979_hmac_sha256) +{ + TestRFC6979( + "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f00", + "4bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459a", + boost::assign::list_of + ("4fe29525b2086809159acdf0506efb86b0ec932c7ba44256ab321e421e67e9fb") + ("2bf0fff1d3c378a22dc5de1d856522325c65b504491a0cbd01cb8f3aa67ffd4a") + ("f528b410cb541f77000d7afb6c5b53c5c471eab43e466d9ac5190c39c82fd82e")); + + TestRFC6979( + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + boost::assign::list_of + ("9c236c165b82ae0cd590659e100b6bab3036e7ba8b06749baf6981e16f1a2b95") + ("df471061625bc0ea14b682feee2c9c02f235da04204c1d62a1536c6e17aed7a9") + ("7597887cbd76321f32e30440679a22cf7f8d9d2eac390e581fea091ce202ba94")); +} + BOOST_AUTO_TEST_SUITE_END() From a53fd4148596f5814409e15647714bdd2a71468b Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 6 Nov 2014 06:54:50 -0800 Subject: [PATCH 1089/1288] Deterministic signing --- src/key.cpp | 29 ++++++++++++++++++----------- src/key.h | 8 ++++++-- src/test/key_tests.cpp | 23 +++++++++++++++++++++++ src/test/script_tests.cpp | 3 ++- 4 files changed, 49 insertions(+), 14 deletions(-) diff --git a/src/key.cpp b/src/key.cpp index 9b3cf8f019..0fb7a5c7c5 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -5,6 +5,7 @@ #include "key.h" #include "crypto/hmac_sha512.h" +#include "crypto/rfc6979_hmac_sha256.h" #include "eccryptoverify.h" #include "pubkey.h" #include "random.h" @@ -71,19 +72,22 @@ CPubKey CKey::GetPubKey() const { return result; } -bool CKey::Sign(const uint256 &hash, std::vector& vchSig) const { +bool CKey::Sign(const uint256 &hash, std::vector& vchSig, uint32_t test_case) const { if (!fValid) return false; vchSig.resize(72); - int nSigLen = 72; - CKey nonce; + RFC6979_HMAC_SHA256 prng(begin(), 32, (unsigned char*)&hash, 32); do { - nonce.MakeNewKey(true); - if (secp256k1_ecdsa_sign((const unsigned char*)&hash, 32, (unsigned char*)&vchSig[0], &nSigLen, begin(), nonce.begin())) - break; + uint256 nonce; + prng.Generate((unsigned char*)&nonce, 32); + nonce += test_case; + int nSigLen = 72; + int ret = secp256k1_ecdsa_sign((const unsigned char*)&hash, 32, (unsigned char*)&vchSig[0], &nSigLen, begin(), (unsigned char*)&nonce); + vchSig.resize(nSigLen); + nonce = 0; + if (ret) + return true; } while(true); - vchSig.resize(nSigLen); - return true; } bool CKey::SignCompact(const uint256 &hash, std::vector& vchSig) const { @@ -91,10 +95,13 @@ bool CKey::SignCompact(const uint256 &hash, std::vector& vchSig) return false; vchSig.resize(65); int rec = -1; - CKey nonce; + RFC6979_HMAC_SHA256 prng(begin(), 32, (unsigned char*)&hash, 32); do { - nonce.MakeNewKey(true); - if (secp256k1_ecdsa_sign_compact((const unsigned char*)&hash, 32, &vchSig[1], begin(), nonce.begin(), &rec)) + uint256 nonce; + prng.Generate((unsigned char*)&nonce, 32); + int ret = secp256k1_ecdsa_sign_compact((const unsigned char*)&hash, 32, &vchSig[1], begin(), (unsigned char*)&nonce, &rec); + nonce = 0; + if (ret) break; } while(true); assert(rec != -1); diff --git a/src/key.h b/src/key.h index 0bb05482c9..463b373153 100644 --- a/src/key.h +++ b/src/key.h @@ -121,8 +121,12 @@ public: */ CPubKey GetPubKey() const; - //! Create a DER-serialized signature. - bool Sign(const uint256& hash, std::vector& vchSig) const; + /** + * Create a DER-serialized signature. + * The test_case parameter tweaks the deterministic nonce, and is only for + * testing. It should be zero for normal use. + */ + bool Sign(const uint256& hash, std::vector& vchSig, uint32_t test_case = 0) const; /** * Create a compact signature (65 bytes), which allows reconstructing the used public key. diff --git a/src/test/key_tests.cpp b/src/test/key_tests.cpp index b32f3774fe..4708936837 100644 --- a/src/test/key_tests.cpp +++ b/src/test/key_tests.cpp @@ -8,6 +8,7 @@ #include "script/script.h" #include "uint256.h" #include "util.h" +#include "utilstrencodings.h" #include #include @@ -142,6 +143,28 @@ BOOST_AUTO_TEST_CASE(key_test1) BOOST_CHECK(rkey1C == pubkey1C); BOOST_CHECK(rkey2C == pubkey2C); } + + // test deterministic signing + + std::vector detsig, detsigc; + string strMsg = "Very deterministic message"; + uint256 hashMsg = Hash(strMsg.begin(), strMsg.end()); + BOOST_CHECK(key1.Sign(hashMsg, detsig)); + BOOST_CHECK(key1C.Sign(hashMsg, detsigc)); + BOOST_CHECK(detsig == detsigc); + BOOST_CHECK(detsig == ParseHex("304402205dbbddda71772d95ce91cd2d14b592cfbc1dd0aabd6a394b6c2d377bbe59d31d022014ddda21494a4e221f0824f0b8b924c43fa43c0ad57dccdaa11f81a6bd4582f6")); + BOOST_CHECK(key2.Sign(hashMsg, detsig)); + BOOST_CHECK(key2C.Sign(hashMsg, detsigc)); + BOOST_CHECK(detsig == detsigc); + BOOST_CHECK(detsig == ParseHex("3044022052d8a32079c11e79db95af63bb9600c5b04f21a9ca33dc129c2bfa8ac9dc1cd5022061d8ae5e0f6c1a16bde3719c64c2fd70e404b6428ab9a69566962e8771b5944d")); + BOOST_CHECK(key1.SignCompact(hashMsg, detsig)); + BOOST_CHECK(key1C.SignCompact(hashMsg, detsigc)); + BOOST_CHECK(detsig == ParseHex("1c5dbbddda71772d95ce91cd2d14b592cfbc1dd0aabd6a394b6c2d377bbe59d31d14ddda21494a4e221f0824f0b8b924c43fa43c0ad57dccdaa11f81a6bd4582f6")); + BOOST_CHECK(detsigc == ParseHex("205dbbddda71772d95ce91cd2d14b592cfbc1dd0aabd6a394b6c2d377bbe59d31d14ddda21494a4e221f0824f0b8b924c43fa43c0ad57dccdaa11f81a6bd4582f6")); + BOOST_CHECK(key2.SignCompact(hashMsg, detsig)); + BOOST_CHECK(key2C.SignCompact(hashMsg, detsigc)); + BOOST_CHECK(detsig == ParseHex("1c52d8a32079c11e79db95af63bb9600c5b04f21a9ca33dc129c2bfa8ac9dc1cd561d8ae5e0f6c1a16bde3719c64c2fd70e404b6428ab9a69566962e8771b5944d")); + BOOST_CHECK(detsigc == ParseHex("2052d8a32079c11e79db95af63bb9600c5b04f21a9ca33dc129c2bfa8ac9dc1cd561d8ae5e0f6c1a16bde3719c64c2fd70e404b6428ab9a69566962e8771b5944d")); } BOOST_AUTO_TEST_SUITE_END() diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 36aaa6903f..d3a48234c6 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -248,8 +248,9 @@ public: { uint256 hash = SignatureHash(scriptPubKey, spendTx, 0, nHashType); std::vector vchSig, r, s; + uint32_t iter = 0; do { - key.Sign(hash, vchSig); + key.Sign(hash, vchSig, iter++); if ((lenS == 33) != (vchSig[5 + vchSig[3]] == 33)) { NegateSignatureS(vchSig); } From 9d8604f36a6f94b3c065a8143952cadd7d97aef5 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 19 Nov 2014 22:17:58 +0100 Subject: [PATCH 1090/1288] Header define style cleanups --- src/crypto/hmac_sha256.h | 6 +++--- src/crypto/hmac_sha512.h | 6 +++--- src/crypto/sha256.h | 6 +++--- src/crypto/sha512.h | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/crypto/hmac_sha256.h b/src/crypto/hmac_sha256.h index 4ceac70944..1fdee5a7cd 100644 --- a/src/crypto/hmac_sha256.h +++ b/src/crypto/hmac_sha256.h @@ -2,8 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_HMAC_SHA256_H -#define BITCOIN_HMAC_SHA256_H +#ifndef BITCOIN_CRYPTO_HMAC_SHA256_H +#define BITCOIN_CRYPTO_HMAC_SHA256_H #include "crypto/sha256.h" @@ -29,4 +29,4 @@ public: void Finalize(unsigned char hash[OUTPUT_SIZE]); }; -#endif // BITCOIN_SHA256_H +#endif // BITCOIN_CRYPTO_HMAC_SHA256_H diff --git a/src/crypto/hmac_sha512.h b/src/crypto/hmac_sha512.h index 8c65785104..17d75021aa 100644 --- a/src/crypto/hmac_sha512.h +++ b/src/crypto/hmac_sha512.h @@ -2,8 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_HMAC_SHA512_H -#define BITCOIN_HMAC_SHA512_H +#ifndef BITCOIN_CRYPTO_HMAC_SHA512_H +#define BITCOIN_CRYPTO_HMAC_SHA512_H #include "crypto/sha512.h" @@ -29,4 +29,4 @@ public: void Finalize(unsigned char hash[OUTPUT_SIZE]); }; -#endif // BITCOIN_HMAC_SHA512_H +#endif // BITCOIN_CRYPTO_HMAC_SHA512_H diff --git a/src/crypto/sha256.h b/src/crypto/sha256.h index a57dce0227..bde1a59bed 100644 --- a/src/crypto/sha256.h +++ b/src/crypto/sha256.h @@ -2,8 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_SHA256_H -#define BITCOIN_SHA256_H +#ifndef BITCOIN_CRYPTO_SHA256_H +#define BITCOIN_CRYPTO_SHA256_H #include #include @@ -25,4 +25,4 @@ public: CSHA256& Reset(); }; -#endif // BITCOIN_SHA256_H +#endif // BITCOIN_CRYPTO_SHA256_H diff --git a/src/crypto/sha512.h b/src/crypto/sha512.h index 4d1345e50b..5566d5db3e 100644 --- a/src/crypto/sha512.h +++ b/src/crypto/sha512.h @@ -2,8 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_SHA512_H -#define BITCOIN_SHA512_H +#ifndef BITCOIN_CRYPTO_SHA512_H +#define BITCOIN_CRYPTO_SHA512_H #include #include @@ -25,4 +25,4 @@ public: CSHA512& Reset(); }; -#endif // BITCOIN_SHA512_H +#endif // BITCOIN_CRYPTO_SHA512_H From f618577029b0c575aeb88d60372f6bb5af4406e2 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 20 Nov 2014 13:40:01 -0500 Subject: [PATCH 1091/1288] build: fix link error on some platforms. Fixes #5235 Some users may have libtool libs (.la) installed in their linker search paths. In this case, using -static-libtool-libs would try to link in .a's instead of shared libs. That would be harmless unless the .a was built in a way that would break linking, like non-fpic. What we really want is "-static" here. Despite its name, it's actually less aggressive than -static-libtool-libs. It causes only internal libs to be linked statically (libbitcoinconsensus is the one were'a after). --- src/Makefile.test.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 5fd2afe50d..9e9f478d8f 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -86,7 +86,7 @@ test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) endif test_test_bitcoin_LDADD += $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) -test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static-libtool-libs +test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES) From 189fb526f188e90eed24840b826b6c6b97f3e479 Mon Sep 17 00:00:00 2001 From: mrbandrews Date: Wed, 19 Nov 2014 15:55:40 -0500 Subject: [PATCH 1092/1288] Port of wallet.sh to python (wallet.py). Also included are minor edits to util.py to create a clean blockchain and add a parameter to gather_inputs to specify number of confirmations. --- qa/rpc-tests/util.py | 16 ++++-- qa/rpc-tests/wallet.py | 100 ++++++++++++++++++++++++++++++++++ qa/rpc-tests/wallet.sh | 118 ----------------------------------------- 3 files changed, 113 insertions(+), 121 deletions(-) create mode 100755 qa/rpc-tests/wallet.py delete mode 100755 qa/rpc-tests/wallet.sh diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index c6d918a81c..bed7fed8ca 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -57,7 +57,6 @@ def sync_mempools(rpc_connections): if num_match == len(rpc_connections): break time.sleep(1) - bitcoind_processes = {} @@ -130,6 +129,15 @@ def initialize_chain(test_dir): shutil.copytree(from_dir, to_dir) initialize_datadir(test_dir, i) # Overwrite port/rpcport in bitcoin.conf +def initialize_chain_clean(test_dir, num_nodes): + """ + Create an empty blockchain and num_nodes wallets. + Useful if a test case wants complete control over initialization. + """ + for i in range(num_nodes): + datadir=initialize_datadir(test_dir, i) + + def _rpchost_to_args(rpchost): '''Convert optional IP:port spec to rpcconnect/rpcport args''' if rpchost is None: @@ -221,11 +229,13 @@ def find_output(node, txid, amount): return i raise RuntimeError("find_output txid %s : %s not found"%(txid,str(amount))) -def gather_inputs(from_node, amount_needed): + +def gather_inputs(from_node, amount_needed, confirmations_required=1): """ Return a random set of unspent txouts that are enough to pay amount_needed """ - utxo = from_node.listunspent(1) + assert(confirmations_required >=0) + utxo = from_node.listunspent(confirmations_required) random.shuffle(utxo) inputs = [] total_in = Decimal("0.00000000") diff --git a/qa/rpc-tests/wallet.py b/qa/rpc-tests/wallet.py new file mode 100755 index 0000000000..4271d96be7 --- /dev/null +++ b/qa/rpc-tests/wallet.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python +# Copyright (c) 2014 The Bitcoin Core developers +# Distributed under the MIT/X11 software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +# +# Exercise the wallet. Ported from wallet.sh. +# Does the following: +# a) creates 3 nodes, with an empty chain (no blocks). +# b) node0 mines a block +# c) node1 mines 101 blocks, so now nodes 0 and 1 have 50btc, node2 has none. +# d) node0 sends 21 btc to node2, in two transactions (11 btc, then 10 btc). +# e) node0 mines a block, collects the fee on the second transaction +# f) node1 mines 100 blocks, to mature node0's just-mined block +# g) check that node0 has 100-21, node2 has 21 +# h) node0 should now have 2 unspent outputs; send these to node2 via raw tx broadcast by node1 +# i) have node1 mine a block +# j) check balances - node0 should have 0, node2 should have 100 +# + +from test_framework import BitcoinTestFramework +from util import * + + +class WalletTest (BitcoinTestFramework): + + def setup_chain(self): + print("Initializing test directory "+self.options.tmpdir) + initialize_chain_clean(self.options.tmpdir, 3) + + def setup_network(self, split=False): + self.nodes = start_nodes(3, self.options.tmpdir) + connect_nodes_bi(self.nodes,0,1) + connect_nodes_bi(self.nodes,1,2) + connect_nodes_bi(self.nodes,0,2) + self.is_network_split=False + self.sync_all() + + def run_test (self): + print "Mining blocks..." + + self.nodes[0].setgenerate(True, 1) + + self.sync_all() + self.nodes[1].setgenerate(True, 101) + self.sync_all() + + assert_equal(self.nodes[0].getbalance(), 50) + assert_equal(self.nodes[1].getbalance(), 50) + assert_equal(self.nodes[2].getbalance(), 0) + + # Send 21 BTC from 0 to 2 using sendtoaddress call. + # Second transaction will be child of first, and will require a fee + self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 11) + self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 10) + + # Have node0 mine a block, thus he will collect his own fee. + self.nodes[0].setgenerate(True, 1) + self.sync_all() + + # Have node1 generate 100 blocks (so node0 can recover the fee) + self.nodes[1].setgenerate(True, 100) + self.sync_all() + + # node0 should end up with 100 btc in block rewards plus fees, but + # minus the 21 plus fees sent to node2 + assert_equal(self.nodes[0].getbalance(), 100-21) + assert_equal(self.nodes[2].getbalance(), 21) + + # Node0 should have two unspent outputs. + # Create a couple of transactions to send them to node2, submit them through + # node1, and make sure both node0 and node2 pick them up properly: + node0utxos = self.nodes[0].listunspent(1) + assert_equal(len(node0utxos), 2) + + # create both transactions + txns_to_send = [] + for utxo in node0utxos: + inputs = [] + outputs = {} + inputs.append({ "txid" : utxo["txid"], "vout" : utxo["vout"]}) + outputs[self.nodes[2].getnewaddress("from1")] = utxo["amount"] + raw_tx = self.nodes[0].createrawtransaction(inputs, outputs) + txns_to_send.append(self.nodes[0].signrawtransaction(raw_tx)) + + # Have node 1 (miner) send the transactions + self.nodes[1].sendrawtransaction(txns_to_send[0]["hex"], True) + self.nodes[1].sendrawtransaction(txns_to_send[1]["hex"], True) + + # Have node1 mine a block to confirm transactions: + self.nodes[1].setgenerate(True, 1) + self.sync_all() + + assert_equal(self.nodes[0].getbalance(), 0) + assert_equal(self.nodes[2].getbalance(), 100) + assert_equal(self.nodes[2].getbalance("from1"), 100-21) + + +if __name__ == '__main__': + WalletTest ().main () diff --git a/qa/rpc-tests/wallet.sh b/qa/rpc-tests/wallet.sh deleted file mode 100755 index c9ad0f2a78..0000000000 --- a/qa/rpc-tests/wallet.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) 2013-2014 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -# Test block generation and basic wallet sending - -if [ $# -lt 1 ]; then - echo "Usage: $0 path_to_binaries" - echo "e.g. $0 ../../src" - echo "Env vars BITCOIND and BITCOINCLI may be used to specify the exact binaries used" - exit 1 -fi - -set -f - -BITCOIND=${BITCOIND:-${1}/bitcoind} -CLI=${BITCOINCLI:-${1}/bitcoin-cli} - -DIR="${BASH_SOURCE%/*}" -SENDANDWAIT="${DIR}/send.sh" -if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi -. "$DIR/util.sh" - -D=$(mktemp -d test.XXXXX) - -D1=${D}/node1 -CreateDataDir "$D1" port=11000 rpcport=11001 -B1ARGS="-datadir=$D1" -$BITCOIND $B1ARGS & -B1PID=$! - -D2=${D}/node2 -CreateDataDir "$D2" port=11010 rpcport=11011 connect=127.0.0.1:11000 -B2ARGS="-datadir=$D2" -$BITCOIND $B2ARGS & -B2PID=$! - -D3=${D}/node3 -CreateDataDir "$D3" port=11020 rpcport=11021 connect=127.0.0.1:11000 -B3ARGS="-datadir=$D3" -$BITCOIND $BITCOINDARGS $B3ARGS & -B3PID=$! - -# Wait until all three nodes are at the same block number -function WaitBlocks { - while : - do - sleep 1 - declare -i BLOCKS1=$( GetBlocks $B1ARGS ) - declare -i BLOCKS2=$( GetBlocks $B2ARGS ) - declare -i BLOCKS3=$( GetBlocks $B3ARGS ) - if (( BLOCKS1 == BLOCKS2 && BLOCKS2 == BLOCKS3 )) - then - break - fi - done -} - -echo "Generating test blockchain..." - -# 1 block, 50 XBT each == 50 XBT -$CLI $B1ARGS setgenerate true 1 -WaitBlocks -# 101 blocks, 1 mature == 50 XBT -$CLI $B2ARGS setgenerate true 101 -WaitBlocks - -CheckBalance "$B1ARGS" 50 -CheckBalance "$B2ARGS" 50 - -# Send 21 XBT from 1 to 3. Second -# transaction will be child of first, and -# will require a fee -Send $B1ARGS $B3ARGS 11 -Send $B1ARGS $B3ARGS 10 - -# Have B1 mine a new block, and mature it -# to recover transaction fees -$CLI $B1ARGS setgenerate true 1 -WaitBlocks - -# Have B2 mine 100 blocks so B1's block is mature: -$CLI $B2ARGS setgenerate true 100 -WaitBlocks - -# B1 should end up with 100 XBT in block rewards plus fees, -# minus the 21 XBT sent to B3: -CheckBalance "$B1ARGS" "100-21" -CheckBalance "$B3ARGS" "21" - -# B1 should have two unspent outputs; create a couple -# of raw transactions to send them to B3, submit them through -# B2, and make sure both B1 and B3 pick them up properly: -RAW1=$(CreateTxn1 $B1ARGS 1 $(Address $B3ARGS "from1" ) ) -RAW2=$(CreateTxn1 $B1ARGS 2 $(Address $B3ARGS "from1" ) ) -RAWTXID1=$(SendRawTxn "$B2ARGS" $RAW1) -RAWTXID2=$(SendRawTxn "$B2ARGS" $RAW2) - -# Have B2 mine a block to confirm transactions: -$CLI $B2ARGS setgenerate true 1 -WaitBlocks - -# Check balances after confirmation -CheckBalance "$B1ARGS" 0 -CheckBalance "$B3ARGS" 100 -CheckBalance "$B3ARGS" "100-21" "from1" - -$CLI $B3ARGS stop > /dev/null 2>&1 -wait $B3PID -$CLI $B2ARGS stop > /dev/null 2>&1 -wait $B2PID -$CLI $B1ARGS stop > /dev/null 2>&1 -wait $B1PID - -echo "Tests successful, cleaning up" -rm -rf $D -exit 0 From e4ef72449349a011110b23e5e26ce2c083801fb0 Mon Sep 17 00:00:00 2001 From: mrbandrews Date: Thu, 20 Nov 2014 14:27:18 -0500 Subject: [PATCH 1093/1288] Edited rpc-tests to run python script not shell script. --- qa/pull-tester/rpc-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/pull-tester/rpc-tests.sh b/qa/pull-tester/rpc-tests.sh index 0b5ad20642..7da7404ad9 100755 --- a/qa/pull-tester/rpc-tests.sh +++ b/qa/pull-tester/rpc-tests.sh @@ -16,7 +16,7 @@ fi #Run the tests if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then - ${BUILDDIR}/qa/rpc-tests/wallet.sh "${BUILDDIR}/src" + ${BUILDDIR}/qa/rpc-tests/wallet.py --srcdir "${BUILDDIR}/src" ${BUILDDIR}/qa/rpc-tests/listtransactions.py --srcdir "${BUILDDIR}/src" #${BUILDDIR}/qa/rpc-tests/forknotify.py --srcdir "${BUILDDIR}/src" else From 7e615f522845fbdd970421bfd8cdd5377b20e45f Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Thu, 20 Nov 2014 15:49:07 -0500 Subject: [PATCH 1094/1288] Fixed mempool sync after sending a transaction --- qa/rpc-tests/receivedby.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qa/rpc-tests/receivedby.py b/qa/rpc-tests/receivedby.py index 9fc661fe80..e3f86d38dc 100755 --- a/qa/rpc-tests/receivedby.py +++ b/qa/rpc-tests/receivedby.py @@ -124,6 +124,7 @@ class ReceivedByTest(BitcoinTestFramework): balance_by_account = rec_by_accountArr = self.nodes[1].getreceivedbyaccount(account) txid = self.nodes[0].sendtoaddress(addr, 0.1) + self.sync_all() # listreceivedbyaccount should return received_by_account_json because of 0 confirmations check_array_result(self.nodes[1].listreceivedbyaccount(), From 4a106eeb33832c822c59aa365b718fd358c99643 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 21 Nov 2014 10:24:30 +0100 Subject: [PATCH 1095/1288] qt: English translation update --- src/qt/bitcoinstrings.cpp | 8 +- src/qt/locale/bitcoin_en.ts | 342 ++++++++++++++++++++++++------------ 2 files changed, 232 insertions(+), 118 deletions(-) diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index 1073b6a472..af85df2020 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -103,6 +103,9 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Maintain a full transaction index, used by the getrawtransaction rpc call " "(default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "" +"Maximum size of data in data carrier transactions we relay and mine " +"(default: %u)"), +QT_TRANSLATE_NOOP("bitcoin-core", "" "Number of seconds to keep misbehaving peers from reconnecting (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Output debugging information (default: %u, supplying is optional)"), @@ -115,8 +118,8 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Set the number of script verification threads (%u to %d, 0 = auto, <0 = " "leave that many cores free, default: %d)"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Set the processor limit for when generation is on (-1 = unlimited, default: " -"%d)"), +"Set the number of threads for coin generation if enabled (-1 = all cores, " +"default: %d)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "This is a pre-release test build - use at your own risk - do not use for " "mining or merchant applications"), @@ -250,6 +253,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Rescanning..."), QT_TRANSLATE_NOOP("bitcoin-core", "Run a thread to flush wallet periodically (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Run in the background as a daemon and accept commands"), QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to console instead of debug.log file"), +QT_TRANSLATE_NOOP("bitcoin-core", "Send transactions as zero-fee transactions if possible (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Server certificate file (default: %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "Server private key (default: %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "Set database cache size in megabytes (%d to %d, default: %d)"), diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index df285441e1..ad63c5c086 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -1,6 +1,6 @@ - + AddressBookPage @@ -150,7 +150,7 @@ Passphrase Dialog - + Enter passphrase Enter passphrase @@ -165,7 +165,7 @@ Repeat new passphrase - + Encrypt wallet Encrypt wallet @@ -200,7 +200,7 @@ Enter the old and new passphrase to the wallet. - + Confirm wallet encryption Confirm wallet encryption @@ -232,12 +232,12 @@ Wallet encrypted - + 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>. - + Bitcoin 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. Bitcoin 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. @@ -286,7 +286,7 @@ BitcoinGUI - + Sign &message... Sign &message... @@ -296,7 +296,7 @@ Synchronizing with network... - + &Overview &Overview @@ -321,7 +321,7 @@ Browse transaction history - + E&xit E&xit @@ -392,12 +392,12 @@ Reindexing blocks on disk... - + Send coins to a Bitcoin address Send coins to a Bitcoin address - + Modify configuration options for Bitcoin Modify configuration options for Bitcoin @@ -432,7 +432,7 @@ Bitcoin - + Wallet Wallet @@ -447,7 +447,7 @@ &Receive - + Show information about Bitcoin Core @@ -497,7 +497,7 @@ Tabs toolbar - + Bitcoin Core Bitcoin Core @@ -507,7 +507,7 @@ - + &About Bitcoin Core @@ -672,7 +672,7 @@ Address: %4 ClientModel - + Network Alert Network Alert @@ -681,7 +681,7 @@ Address: %4 CoinControlDialog - Coin Control Address Selection + Coin Selection @@ -735,19 +735,24 @@ Address: %4 - + List mode - + Amount Amount - - Address - Address + + Received with label + + + + + Received with address + @@ -770,7 +775,7 @@ Address: %4 - + Copy address Copy address @@ -836,17 +841,17 @@ Address: %4 - + highest - + higher - + high @@ -856,18 +861,17 @@ Address: %4 - - + medium - + low-medium - + low @@ -877,7 +881,7 @@ Address: %4 - + lowest @@ -892,12 +896,12 @@ Address: %4 - + Can vary +/- %1 satoshi(s) per input. - + yes @@ -938,7 +942,7 @@ Address: %4 - + (no label) (no label) @@ -1224,17 +1228,7 @@ Address: %4 &Main - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - - - - Pay transaction &fee - Pay transaction &fee - - - + Automatically start Bitcoin after logging in to the system. Automatically start Bitcoin after logging in to the system. @@ -1259,7 +1253,7 @@ Address: %4 - + Accept connections from outside @@ -1269,17 +1263,7 @@ Address: %4 - - Connect to the Bitcoin network through a SOCKS proxy. - - - - - &Connect through SOCKS proxy (default proxy): - - - - + IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) @@ -1315,7 +1299,7 @@ Address: %4 &Network - + (0 = auto, <0 = leave that many cores free) @@ -1325,7 +1309,7 @@ Address: %4 - + Expert @@ -1345,7 +1329,7 @@ Address: %4 - + Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. @@ -1355,7 +1339,17 @@ Address: %4 Map port using &UPnP - + + Connect to the Bitcoin network through a SOCKS5 proxy. + + + + + &Connect through SOCKS5 proxy (default proxy): + + + + Proxy &IP: Proxy &IP: @@ -1420,12 +1414,12 @@ Address: %4 Choose the default subdivision unit to show in the interface and when sending coins. - + Whether to show coin control features or not. - + &OK &OK @@ -1435,17 +1429,17 @@ Address: %4 &Cancel - + default default - + none - + Confirm options reset Confirm options reset @@ -1466,7 +1460,7 @@ Address: %4 - + The supplied proxy address is invalid. The supplied proxy address is invalid. @@ -2268,7 +2262,7 @@ Address: %4 RecentRequestsTableModel - + Date Date @@ -2307,7 +2301,7 @@ Address: %4 SendCoinsDialog - + Send Coins Send Coins @@ -2377,7 +2371,98 @@ Address: %4 - + + Transaction Fee: + + + + + Choose... + + + + + collapse fee-settings + + + + + Minimize + + + + + If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte. + + + + + per kilobyte + + + + + If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "total at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte. + + + + + total at least + + + + + + Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process. + + + + + (read the tooltip) + + + + + Recommended: + + + + + Custom: + + + + + (Smart fee not initialized yet. This usually takes a few blocks...) + + + + + Confirmation time: + + + + + normal + + + + + fast + + + + + Send as zero-fee transaction if possible + + + + + (confirmation may take longer) + + + + Send to multiple recipients at once Send to multiple recipients at once @@ -2392,12 +2477,12 @@ Address: %4 - + Dust: - + Clear &All Clear &All @@ -2417,12 +2502,12 @@ Address: %4 S&end - + Confirm send coins Confirm send coins - + @@ -2430,7 +2515,7 @@ Address: %4 - + Copy quantity @@ -2465,7 +2550,7 @@ Address: %4 - + Total Amount %1 (= %2) @@ -2475,7 +2560,7 @@ Address: %4 - + The recipient address is not valid, please recheck. The recipient address is not valid, please recheck. @@ -2510,7 +2595,22 @@ Address: %4 - + + A fee higher than %1 is considered an insanely high fee. + + + + + Pay only the minimum fee of %1 + + + + + Estimated to begin confirmation within %1 block(s). + + + + Warning: Invalid Bitcoin address @@ -2525,12 +2625,12 @@ Address: %4 - + Copy dust - + Are you sure you want to send? @@ -3087,7 +3187,7 @@ Address: %4 TransactionTableModel - + Date Date @@ -3102,7 +3202,7 @@ Address: %4 Address - + Immature (%1 confirmations, will be available after %2) @@ -3418,7 +3518,7 @@ Address: %4 WalletModel - + Send Coins Send Coins @@ -3436,7 +3536,7 @@ Address: %4 Export the data in the current tab to a file - + Backup Wallet Backup Wallet @@ -3469,27 +3569,27 @@ Address: %4 bitcoin-core - + Options: Options: - + Specify data directory Specify data directory - + Connect to a node to retrieve peer addresses, and disconnect Connect to a node to retrieve peer addresses, and disconnect - + Specify your own public address Specify your own public address - + Accept command line and JSON-RPC commands Accept command line and JSON-RPC commands @@ -3499,17 +3599,17 @@ Address: %4 Run in the background as a daemon and accept commands - + Use the test network Use the test network - + Accept connections from outside (default: 1 if no -proxy or -connect) Accept connections from outside (default: 1 if no -proxy or -connect) - + %s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: @@ -3569,7 +3669,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - + Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) @@ -3744,7 +3844,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Rebuild block chain index from current blk000??.dat files - + Set database cache size in megabytes (%d to %d, default: %d) @@ -3794,12 +3894,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. You need to rebuild the database using -reindex to change -txindex - + Imports blocks from external blk000??.dat file Imports blocks from external blk000??.dat file - + Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times @@ -3864,7 +3964,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - + + Maximum size of data in data carrier transactions we relay and mine (default: %u) + + + + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) @@ -3874,7 +3979,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - + + Set the number of threads for coin generation if enabled (-1 = all cores, default: %d) + + + + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. @@ -4003,6 +4113,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Send trace/debug info to console instead of debug.log file Send trace/debug info to console instead of debug.log file + + + Send transactions as zero-fee transactions if possible (default: %u) + + Show all debugging options (usage: --help -help-debug) @@ -4094,27 +4209,27 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. wallet.dat corrupt, salvage failed - + Password for JSON-RPC connections Password for JSON-RPC connections - + Execute command when the best block changes (%s in cmd is replaced by block hash) Execute command when the best block changes (%s in cmd is replaced by block hash) - + Upgrade wallet to latest format Upgrade wallet to latest format - + Rescan the block chain for missing wallet transactions Rescan the block chain for missing wallet transactions - + Use OpenSSL (https) for JSON-RPC connections Use OpenSSL (https) for JSON-RPC connections @@ -4124,7 +4239,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. This help message - + Allow DNS lookups for -addnode, -seednode and -connect Allow DNS lookups for -addnode, -seednode and -connect @@ -4139,7 +4254,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Error loading wallet.dat: Wallet corrupted - + (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) @@ -4169,7 +4284,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - + Number of seconds to keep misbehaving peers from reconnecting (default: %u) @@ -4179,12 +4294,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - Set the processor limit for when generation is on (-1 = unlimited, default: %d) - - - - + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) @@ -4299,7 +4409,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - + Server certificate file (default: %s) @@ -4364,7 +4474,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Unknown network specified in -onlynet: '%s' - + Cannot resolve -bind address: '%s' Cannot resolve -bind address: '%s' @@ -4424,12 +4534,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. Done loading - + To use the %s option To use the %s option - + Error Error From fa94b9d5623cfd16aa594c28432f25a17b0efb0e Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Fri, 31 Oct 2014 08:43:19 +0800 Subject: [PATCH 1096/1288] Convert remaining comments in /src to doxygen format - Update comments in checkpoints to be doxygen compatible - Update comments in checkqueue to be doxygen compatible - Update coins to be doxygen compatible - Fix comment typo in crypter.h - Update licenses/copyright dates Closes #5325 #5184 #5183 #5182 --- src/base58.cpp | 4 +- src/base58.h | 24 ++++----- src/bloom.cpp | 20 +++++--- src/bloom.h | 36 ++++++++------ src/checkpoints.cpp | 16 +++--- src/checkpoints.h | 13 ++--- src/checkqueue.h | 50 ++++++++++--------- src/coins.cpp | 14 +++--- src/coins.h | 115 ++++++++++++++++++++++++------------------- src/compressor.h | 22 +++++---- src/crypter.h | 49 +++++++++--------- src/db.h | 8 +-- src/ecwrapper.cpp | 8 +-- src/ecwrapper.h | 12 +++-- src/leveldbwrapper.h | 20 ++++---- src/timedata.cpp | 17 +++---- src/timedata.h | 7 +-- src/txdb.h | 10 ++-- src/uint256.h | 49 +++++++++--------- 19 files changed, 269 insertions(+), 225 deletions(-) diff --git a/src/base58.cpp b/src/base58.cpp index d94db2c51b..c594993ea0 100644 --- a/src/base58.cpp +++ b/src/base58.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "base58.h" @@ -15,7 +15,7 @@ #include #include -/* All alphanumeric characters except for "0", "I", "O", and "l" */ +/** All alphanumeric characters except for "0", "I", "O", and "l" */ static const char* pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; bool DecodeBase58(const char* psz, std::vector& vch) diff --git a/src/base58.h b/src/base58.h index 7cd2d651a1..c4cb96814c 100644 --- a/src/base58.h +++ b/src/base58.h @@ -1,16 +1,16 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -// -// Why base-58 instead of standard base-64 encoding? -// - Don't want 0OIl characters that look the same in some fonts and -// could be used to create visually identical looking account numbers. -// - A string with non-alphanumeric characters is not as easily accepted as an account number. -// - E-mail usually won't line-break if there's no punctuation to break at. -// - Double-clicking selects the whole number as one word if it's all alphanumeric. -// +/** + * Why base-58 instead of standard base-64 encoding? + * - Don't want 0OIl characters that look the same in some fonts and + * could be used to create visually identical looking account numbers. + * - A string with non-alphanumeric characters is not as easily accepted as an account number. + * - E-mail usually won't line-break if there's no punctuation to break at. + * - Double-clicking selects the whole number as one word if it's all alphanumeric. + */ #ifndef BITCOIN_BASE58_H #define BITCOIN_BASE58_H @@ -70,10 +70,10 @@ inline bool DecodeBase58Check(const std::string& str, std::vector class CBase58Data { protected: - // the version byte(s) + //! the version byte(s) std::vector vchVersion; - // the actually encoded data + //! the actually encoded data typedef std::vector > vector_uchar; vector_uchar vchData; diff --git a/src/bloom.cpp b/src/bloom.cpp index df8cedaf6a..07b8f2c0ae 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -1,5 +1,5 @@ -// Copyright (c) 2012 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2012-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "bloom.h" @@ -21,13 +21,17 @@ using namespace std; CBloomFilter::CBloomFilter(unsigned int nElements, double nFPRate, unsigned int nTweakIn, unsigned char nFlagsIn) : -// The ideal size for a bloom filter with a given number of elements and false positive rate is: -// - nElements * log(fp rate) / ln(2)^2 -// We ignore filter parameters which will create a bloom filter larger than the protocol limits +/** + * The ideal size for a bloom filter with a given number of elements and false positive rate is: + * - nElements * log(fp rate) / ln(2)^2 + * We ignore filter parameters which will create a bloom filter larger than the protocol limits + */ vData(min((unsigned int)(-1 / LN2SQUARED * nElements * log(nFPRate)), MAX_BLOOM_FILTER_SIZE * 8) / 8), -// The ideal number of hash functions is filter size * ln(2) / number of elements -// Again, we ignore filter parameters which will create a bloom filter with more hash functions than the protocol limits -// See http://en.wikipedia.org/wiki/Bloom_filter for an explanation of these formulas +/** + * The ideal number of hash functions is filter size * ln(2) / number of elements + * Again, we ignore filter parameters which will create a bloom filter with more hash functions than the protocol limits + * See https://en.wikipedia.org/wiki/Bloom_filter for an explanation of these formulas + */ isFull(false), isEmpty(false), nHashFuncs(min((unsigned int)(vData.size() * 8 / nElements * LN2), MAX_HASH_FUNCS)), diff --git a/src/bloom.h b/src/bloom.h index 143e3b4c79..f54922edb9 100644 --- a/src/bloom.h +++ b/src/bloom.h @@ -1,5 +1,5 @@ -// Copyright (c) 2012 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2012-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_BLOOM_H @@ -13,12 +13,14 @@ class COutPoint; class CTransaction; class uint256; -// 20,000 items with fp rate < 0.1% or 10,000 items and <0.0001% +//! 20,000 items with fp rate < 0.1% or 10,000 items and <0.0001% static const unsigned int MAX_BLOOM_FILTER_SIZE = 36000; // bytes static const unsigned int MAX_HASH_FUNCS = 50; -// First two bits of nFlags control how much IsRelevantAndUpdate actually updates -// The remaining bits are reserved +/** + * First two bits of nFlags control how much IsRelevantAndUpdate actually updates + * The remaining bits are reserved + */ enum bloomflags { BLOOM_UPDATE_NONE = 0, @@ -52,13 +54,15 @@ private: unsigned int Hash(unsigned int nHashNum, const std::vector& vDataToHash) const; public: - // Creates a new bloom filter which will provide the given fp rate when filled with the given number of elements - // Note that if the given parameters will result in a filter outside the bounds of the protocol limits, - // the filter created will be as close to the given parameters as possible within the protocol limits. - // This will apply if nFPRate is very low or nElements is unreasonably high. - // nTweak is a constant which is added to the seed value passed to the hash function - // It should generally always be a random value (and is largely only exposed for unit testing) - // nFlags should be one of the BLOOM_UPDATE_* enums (not _MASK) + /** + * Creates a new bloom filter which will provide the given fp rate when filled with the given number of elements + * Note that if the given parameters will result in a filter outside the bounds of the protocol limits, + * the filter created will be as close to the given parameters as possible within the protocol limits. + * This will apply if nFPRate is very low or nElements is unreasonably high. + * nTweak is a constant which is added to the seed value passed to the hash function + * It should generally always be a random value (and is largely only exposed for unit testing) + * nFlags should be one of the BLOOM_UPDATE_* enums (not _MASK) + */ CBloomFilter(unsigned int nElements, double nFPRate, unsigned int nTweak, unsigned char nFlagsIn); CBloomFilter() : isFull(true), isEmpty(false), nHashFuncs(0), nTweak(0), nFlags(0) {} @@ -82,14 +86,14 @@ public: void clear(); - // True if the size is <= MAX_BLOOM_FILTER_SIZE and the number of hash functions is <= MAX_HASH_FUNCS - // (catch a filter which was just deserialized which was too big) + //! True if the size is <= MAX_BLOOM_FILTER_SIZE and the number of hash functions is <= MAX_HASH_FUNCS + //! (catch a filter which was just deserialized which was too big) bool IsWithinSizeConstraints() const; - // Also adds any outputs which match the filter to the filter (to match their spending txes) + //! Also adds any outputs which match the filter to the filter (to match their spending txes) bool IsRelevantAndUpdate(const CTransaction& tx); - // Checks for empty and full filters to avoid wasting cpu + //! Checks for empty and full filters to avoid wasting cpu void UpdateEmptyFull(); }; diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index fbde47339d..0fb4411e63 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "checkpoints.h" @@ -14,11 +14,13 @@ namespace Checkpoints { - // How many times we expect transactions after the last checkpoint to - // be slower. This number is a compromise, as it can't be accurate for - // every system. When reindexing from a fast disk with a slow CPU, it - // can be up to 20, while when downloading from a slow network with a - // fast multicore CPU, it won't be much higher than 1. + /** + * How many times we expect transactions after the last checkpoint to + * be slower. This number is a compromise, as it can't be accurate for + * every system. When reindexing from a fast disk with a slow CPU, it + * can be up to 20, while when downloading from a slow network with a + * fast multicore CPU, it won't be much higher than 1. + */ static const double SIGCHECK_VERIFICATION_FACTOR = 5.0; bool fEnabled = true; @@ -35,7 +37,7 @@ namespace Checkpoints { return hash == i->second; } - // Guess how far we are in the verification process at the given block index + //! Guess how far we are in the verification process at the given block index double GuessVerificationProgress(CBlockIndex *pindex, bool fSigchecks) { if (pindex==NULL) return 0.0; diff --git a/src/checkpoints.h b/src/checkpoints.h index 847524a9f2..65c5165f0f 100644 --- a/src/checkpoints.h +++ b/src/checkpoints.h @@ -1,5 +1,5 @@ -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CHECKPOINTS_H @@ -11,7 +11,8 @@ class CBlockIndex; -/** Block-chain checkpoints are compiled-in sanity checks. +/** + * Block-chain checkpoints are compiled-in sanity checks. * They are updated every release or three. */ namespace Checkpoints @@ -25,13 +26,13 @@ struct CCheckpointData { double fTransactionsPerDay; }; -// Returns true if block passes checkpoint checks +//! Returns true if block passes checkpoint checks bool CheckBlock(int nHeight, const uint256& hash); -// Return conservative estimate of total number of blocks, 0 if unknown +//! Return conservative estimate of total number of blocks, 0 if unknown int GetTotalBlocksEstimate(); -// Returns last CBlockIndex* in mapBlockIndex that is a checkpoint +//! Returns last CBlockIndex* in mapBlockIndex that is a checkpoint CBlockIndex* GetLastCheckpoint(); double GuessVerificationProgress(CBlockIndex* pindex, bool fSigchecks = true); diff --git a/src/checkqueue.h b/src/checkqueue.h index afecfeede5..2ee46a1210 100644 --- a/src/checkqueue.h +++ b/src/checkqueue.h @@ -1,5 +1,5 @@ -// Copyright (c) 2012 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2012-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CHECKQUEUE_H @@ -16,7 +16,8 @@ template class CCheckQueueControl; -/** Queue for verifications that have to be performed. +/** + * Queue for verifications that have to be performed. * The verifications are represented by a type T, which must provide an * operator(), returning a bool. * @@ -29,40 +30,42 @@ template class CCheckQueue { private: - // Mutex to protect the inner state + //! Mutex to protect the inner state boost::mutex mutex; - // Worker threads block on this when out of work + //! Worker threads block on this when out of work boost::condition_variable condWorker; - // Master thread blocks on this when out of work + //! Master thread blocks on this when out of work boost::condition_variable condMaster; - // The queue of elements to be processed. - // As the order of booleans doesn't matter, it is used as a LIFO (stack) + //! The queue of elements to be processed. + //! As the order of booleans doesn't matter, it is used as a LIFO (stack) std::vector queue; - // The number of workers (including the master) that are idle. + //! The number of workers (including the master) that are idle. int nIdle; - // The total number of workers (including the master). + //! The total number of workers (including the master). int nTotal; - // The temporary evaluation result. + //! The temporary evaluation result. bool fAllOk; - // Number of verifications that haven't completed yet. - // This includes elements that are not anymore in queue, but still in - // worker's own batches. + /** + * Number of verifications that haven't completed yet. + * This includes elements that are not anymore in queue, but still in + * worker's own batches. + */ unsigned int nTodo; - // Whether we're shutting down. + //! Whether we're shutting down. bool fQuit; - // The maximum number of elements to be processed in one batch + //! The maximum number of elements to be processed in one batch unsigned int nBatchSize; - // Internal function that does bulk of the verification work. + /** Internal function that does bulk of the verification work. */ bool Loop(bool fMaster = false) { boost::condition_variable& cond = fMaster ? condMaster : condWorker; @@ -124,22 +127,22 @@ private: } public: - // Create a new check queue + //! Create a new check queue CCheckQueue(unsigned int nBatchSizeIn) : nIdle(0), nTotal(0), fAllOk(true), nTodo(0), fQuit(false), nBatchSize(nBatchSizeIn) {} - // Worker thread + //! Worker thread void Thread() { Loop(); } - // Wait until execution finishes, and return whether all evaluations where succesful. + //! Wait until execution finishes, and return whether all evaluations where successful. bool Wait() { return Loop(true); } - // Add a batch of checks to the queue + //! Add a batch of checks to the queue void Add(std::vector& vChecks) { boost::unique_lock lock(mutex); @@ -161,8 +164,9 @@ public: friend class CCheckQueueControl; }; -/** RAII-style controller object for a CCheckQueue that guarantees the passed - * queue is finished before continuing. +/** + * RAII-style controller object for a CCheckQueue that guarantees the passed + * queue is finished before continuing. */ template class CCheckQueueControl diff --git a/src/coins.cpp b/src/coins.cpp index e4f3e67aeb..c2e802c953 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -1,5 +1,5 @@ -// Copyright (c) 2012-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2012-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "coins.h" @@ -8,9 +8,11 @@ #include -// calculate number of bytes for the bitmask, and its number of non-zero bytes -// each bit in the bitmask represents the availability of one output, but the -// availabilities of the first two outputs are encoded separately +/** + * calculate number of bytes for the bitmask, and its number of non-zero bytes + * each bit in the bitmask represents the availability of one output, but the + * availabilities of the first two outputs are encoded separately + */ void CCoins::CalcMaskSize(unsigned int &nBytes, unsigned int &nNonzeroBytes) const { unsigned int nLastUsedByte = 0; for (unsigned int b = 0; 2+b*8 < vout.size(); b++) { @@ -133,7 +135,7 @@ const CCoins* CCoinsViewCache::AccessCoins(const uint256 &txid) const { bool CCoinsViewCache::HaveCoins(const uint256 &txid) const { CCoinsMap::const_iterator it = FetchCoins(txid); // We're using vtx.empty() instead of IsPruned here for performance reasons, - // as we only care about the case where an transaction was replaced entirely + // as we only care about the case where a transaction was replaced entirely // in a reorganization (which wipes vout entirely, as opposed to spending // which just cleans individual outputs). return (it != cacheCoins.end() && !it->second.coins.vout.empty()); diff --git a/src/coins.h b/src/coins.h index ee9051562b..dbe3f8bd31 100644 --- a/src/coins.h +++ b/src/coins.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_COINS_H @@ -17,7 +17,8 @@ #include #include -/** pruned version of CTransaction: only retains metadata and unspent transaction outputs +/** + * Pruned version of CTransaction: only retains metadata and unspent transaction outputs * * Serialized format: * - VARINT(nVersion) @@ -71,17 +72,17 @@ class CCoins { public: - // whether transaction is a coinbase + //! whether transaction is a coinbase bool fCoinBase; - // unspent transaction outputs; spent outputs are .IsNull(); spent outputs at the end of the array are dropped + //! unspent transaction outputs; spent outputs are .IsNull(); spent outputs at the end of the array are dropped std::vector vout; - // at which height this transaction was included in the active block chain + //! at which height this transaction was included in the active block chain int nHeight; - // version of the CTransaction; accesses to this value should probably check for nHeight as well, - // as new tx version will probably only be introduced at certain heights + //! version of the CTransaction; accesses to this value should probably check for nHeight as well, + //! as new tx version will probably only be introduced at certain heights int nVersion; void FromTx(const CTransaction &tx, int nHeightIn) { @@ -92,7 +93,7 @@ public: ClearUnspendable(); } - // construct a CCoins from a CTransaction, at a given height + //! construct a CCoins from a CTransaction, at a given height CCoins(const CTransaction &tx, int nHeightIn) { FromTx(tx, nHeightIn); } @@ -104,10 +105,10 @@ public: nVersion = 0; } - // empty constructor + //! empty constructor CCoins() : fCoinBase(false), vout(0), nHeight(0), nVersion(0) { } - // remove spent outputs at the end of vout + //!remove spent outputs at the end of vout void Cleanup() { while (vout.size() > 0 && vout.back().IsNull()) vout.pop_back(); @@ -130,7 +131,7 @@ public: std::swap(to.nVersion, nVersion); } - // equality test + //! equality test friend bool operator==(const CCoins &a, const CCoins &b) { // Empty CCoins objects are always equal. if (a.IsPruned() && b.IsPruned()) @@ -236,19 +237,19 @@ public: Cleanup(); } - // mark an outpoint spent, and construct undo information + //! mark an outpoint spent, and construct undo information bool Spend(const COutPoint &out, CTxInUndo &undo); - // mark a vout spent + //! mark a vout spent bool Spend(int nPos); - // check whether a particular output is still available + //! check whether a particular output is still available bool IsAvailable(unsigned int nPos) const { return (nPos < vout.size() && !vout[nPos].IsNull()); } - // check whether the entire CCoins is spent - // note that only !IsPruned() CCoins can be serialized + //! check whether the entire CCoins is spent + //! note that only !IsPruned() CCoins can be serialized bool IsPruned() const { BOOST_FOREACH(const CTxOut &out, vout) if (!out.IsNull()) @@ -264,9 +265,12 @@ private: public: CCoinsKeyHasher(); - // This *must* return size_t. With Boost 1.46 on 32-bit systems the - // unordered_map will behave unpredictably if the custom hasher returns a - // uint64_t, resulting in failures when syncing the chain (#4634). + + /** + * This *must* return size_t. With Boost 1.46 on 32-bit systems the + * unordered_map will behave unpredictably if the custom hasher returns a + * uint64_t, resulting in failures when syncing the chain (#4634). + */ size_t operator()(const uint256& key) const { return key.GetHash(salt); } @@ -305,24 +309,24 @@ struct CCoinsStats class CCoinsView { public: - // Retrieve the CCoins (unspent transaction outputs) for a given txid + //! Retrieve the CCoins (unspent transaction outputs) for a given txid virtual bool GetCoins(const uint256 &txid, CCoins &coins) const; - // Just check whether we have data for a given txid. - // This may (but cannot always) return true for fully spent transactions + //! Just check whether we have data for a given txid. + //! This may (but cannot always) return true for fully spent transactions virtual bool HaveCoins(const uint256 &txid) const; - // Retrieve the block hash whose state this CCoinsView currently represents + //! Retrieve the block hash whose state this CCoinsView currently represents virtual uint256 GetBestBlock() const; - // Do a bulk modification (multiple CCoins changes + BestBlock change). - // The passed mapCoins can be modified. + //! Do a bulk modification (multiple CCoins changes + BestBlock change). + //! The passed mapCoins can be modified. virtual bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock); - // Calculate statistics about the unspent transaction output set + //! Calculate statistics about the unspent transaction output set virtual bool GetStats(CCoinsStats &stats) const; - // As we use CCoinsViews polymorphically, have a virtual destructor + //! As we use CCoinsViews polymorphically, have a virtual destructor virtual ~CCoinsView() {} }; @@ -346,9 +350,11 @@ public: class CCoinsViewCache; -/** A reference to a mutable cache entry. Encapsulating it allows us to run +/** + * A reference to a mutable cache entry. Encapsulating it allows us to run * cleanup code after the modification is finished, and keeping track of - * concurrent modifications. */ + * concurrent modifications. + */ class CCoinsModifier { private: @@ -370,8 +376,10 @@ protected: /* Whether this cache has an active modifier. */ bool hasModifier; - /* Make mutable so that we can "fill the cache" even from Get-methods - declared as "const". */ + /** + * Make mutable so that we can "fill the cache" even from Get-methods + * declared as "const". + */ mutable uint256 hashBlock; mutable CCoinsMap cacheCoins; @@ -386,37 +394,44 @@ public: void SetBestBlock(const uint256 &hashBlock); bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock); - // Return a pointer to CCoins in the cache, or NULL if not found. This is - // more efficient than GetCoins. Modifications to other cache entries are - // allowed while accessing the returned pointer. + /** + * Return a pointer to CCoins in the cache, or NULL if not found. This is + * more efficient than GetCoins. Modifications to other cache entries are + * allowed while accessing the returned pointer. + */ const CCoins* AccessCoins(const uint256 &txid) const; - // Return a modifiable reference to a CCoins. If no entry with the given - // txid exists, a new one is created. Simultaneous modifications are not - // allowed. + /** + * Return a modifiable reference to a CCoins. If no entry with the given + * txid exists, a new one is created. Simultaneous modifications are not + * allowed. + */ CCoinsModifier ModifyCoins(const uint256 &txid); - // Push the modifications applied to this cache to its base. - // Failure to call this method before destruction will cause the changes to be forgotten. - // If false is returned, the state of this cache (and its backing view) will be undefined. + /** + * Push the modifications applied to this cache to its base. + * Failure to call this method before destruction will cause the changes to be forgotten. + * If false is returned, the state of this cache (and its backing view) will be undefined. + */ bool Flush(); - // Calculate the size of the cache (in number of transactions) + //! Calculate the size of the cache (in number of transactions) unsigned int GetCacheSize() const; - /** Amount of bitcoins coming in to a transaction - Note that lightweight clients may not know anything besides the hash of previous transactions, - so may not be able to calculate this. - - @param[in] tx transaction for which we are checking input total - @return Sum of value of all inputs (scriptSigs) + /** + * Amount of bitcoins coming in to a transaction + * Note that lightweight clients may not know anything besides the hash of previous transactions, + * so may not be able to calculate this. + * + * @param[in] tx transaction for which we are checking input total + * @return Sum of value of all inputs (scriptSigs) */ CAmount GetValueIn(const CTransaction& tx) const; - // Check whether all prevouts of the transaction are present in the UTXO set represented by this view + //! Check whether all prevouts of the transaction are present in the UTXO set represented by this view bool HaveInputs(const CTransaction& tx) const; - // Return priority of tx at height nHeight + //! Return priority of tx at height nHeight double GetPriority(const CTransaction &tx, int nHeight) const; const CTxOut &GetOutputFor(const CTxIn& input) const; diff --git a/src/compressor.h b/src/compressor.h index 226be620e8..d9cde5de7a 100644 --- a/src/compressor.h +++ b/src/compressor.h @@ -28,19 +28,23 @@ class CScriptID; class CScriptCompressor { private: - // make this static for now (there are only 6 special scripts defined) - // this can potentially be extended together with a new nVersion for - // transactions, in which case this value becomes dependent on nVersion - // and nHeight of the enclosing transaction. + /** + * make this static for now (there are only 6 special scripts defined) + * this can potentially be extended together with a new nVersion for + * transactions, in which case this value becomes dependent on nVersion + * and nHeight of the enclosing transaction. + */ static const unsigned int nSpecialScripts = 6; CScript &script; protected: - // These check for scripts for which a special case with a shorter encoding is defined. - // They are implemented separately from the CScript test, as these test for exact byte - // sequence correspondences, and are more strict. For example, IsToPubKey also verifies - // whether the public key is valid (as invalid ones cannot be represented in compressed - // form). + /** + * These check for scripts for which a special case with a shorter encoding is defined. + * They are implemented separately from the CScript test, as these test for exact byte + * sequence correspondences, and are more strict. For example, IsToPubKey also verifies + * whether the public key is valid (as invalid ones cannot be represented in compressed + * form). + */ bool IsToKeyID(CKeyID &hash) const; bool IsToScriptID(CScriptID &hash) const; bool IsToPubKey(CPubKey &pubkey) const; diff --git a/src/crypter.h b/src/crypter.h index b589987c4f..f7018cfdbe 100644 --- a/src/crypter.h +++ b/src/crypter.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2013 The Bitcoin developers +// Copyright (c) 2009-2014 The Bitcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -14,20 +14,20 @@ class uint256; const unsigned int WALLET_CRYPTO_KEY_SIZE = 32; const unsigned int WALLET_CRYPTO_SALT_SIZE = 8; -/* -Private key encryption is done based on a CMasterKey, -which holds a salt and random encryption key. - -CMasterKeys are encrypted using AES-256-CBC using a key -derived using derivation method nDerivationMethod -(0 == EVP_sha512()) and derivation iterations nDeriveIterations. -vchOtherDerivationParameters is provided for alternative algorithms -which may require more parameters (such as scrypt). - -Wallet Private Keys are then encrypted using AES-256-CBC -with the double-sha256 of the public key as the IV, and the -master key's key as the encryption key (see keystore.[ch]). -*/ +/** + * Private key encryption is done based on a CMasterKey, + * which holds a salt and random encryption key. + * + * CMasterKeys are encrypted using AES-256-CBC using a key + * derived using derivation method nDerivationMethod + * (0 == EVP_sha512()) and derivation iterations nDeriveIterations. + * vchOtherDerivationParameters is provided for alternative algorithms + * which may require more parameters (such as scrypt). + * + * Wallet Private Keys are then encrypted using AES-256-CBC + * with the double-sha256 of the public key as the IV, and the + * master key's key as the encryption key (see keystore.[ch]). + */ /** Master key for wallet encryption */ class CMasterKey @@ -35,12 +35,12 @@ class CMasterKey public: std::vector vchCryptedKey; std::vector vchSalt; - // 0 = EVP_sha512() - // 1 = scrypt() + //! 0 = EVP_sha512() + //! 1 = scrypt() unsigned int nDerivationMethod; unsigned int nDeriveIterations; - // Use this for more parameters to key derivation, - // such as the various parameters to scrypt + //! Use this for more parameters to key derivation, + //! such as the various parameters to scrypt std::vector vchOtherDerivationParameters; ADD_SERIALIZE_METHODS; @@ -120,17 +120,17 @@ private: CKeyingMaterial vMasterKey; - // if fUseCrypto is true, mapKeys must be empty - // if fUseCrypto is false, vMasterKey must be empty + //! if fUseCrypto is true, mapKeys must be empty + //! if fUseCrypto is false, vMasterKey must be empty bool fUseCrypto; - // keeps track of whether Unlock has run a thourough check before + //! keeps track of whether Unlock has run a thorough check before bool fDecryptionThoroughlyChecked; protected: bool SetCrypted(); - // will encrypt previously unencrypted keys + //! will encrypt previously unencrypted keys bool EncryptKeys(CKeyingMaterial& vMasterKeyIn); bool Unlock(const CKeyingMaterial& vMasterKeyIn); @@ -189,7 +189,8 @@ public: } } - /* Wallet status (encrypted, locked) changed. + /** + * Wallet status (encrypted, locked) changed. * Note: Called without locks held. */ boost::signals2::signal NotifyStatusChanged; diff --git a/src/db.h b/src/db.h index 85ffbae1cb..1c572d8970 100644 --- a/src/db.h +++ b/src/db.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_DB_H @@ -50,7 +50,7 @@ public: void MakeMock(); bool IsMock() { return fMockDb; } - /* + /** * Verify that database file strFile is OK. If it is not, * call the callback to try to recover. * This must be called BEFORE strFile is opened. @@ -60,7 +60,7 @@ public: RECOVER_OK, RECOVER_FAIL }; VerifyResult Verify(std::string strFile, bool (*recoverFunc)(CDBEnv& dbenv, std::string strFile)); - /* + /** * Salvage data from a file that Verify says is bad. * fAggressive sets the DB_AGGRESSIVE flag (see berkeley DB->verify() method documentation). * Appends binary key/value pairs to vResult, returns true if successful. diff --git a/src/ecwrapper.cpp b/src/ecwrapper.cpp index 68cdbf2eda..5ce7e61294 100644 --- a/src/ecwrapper.cpp +++ b/src/ecwrapper.cpp @@ -13,9 +13,11 @@ namespace { -// Perform ECDSA key recovery (see SEC1 4.1.6) for curves over (mod p)-fields -// recid selects which key is recovered -// if check is non-zero, additional checks are performed +/** + * Perform ECDSA key recovery (see SEC1 4.1.6) for curves over (mod p)-fields + * recid selects which key is recovered + * if check is non-zero, additional checks are performed + */ int ECDSA_SIG_recover_key_GFp(EC_KEY *eckey, ECDSA_SIG *ecsig, const unsigned char *msg, int msglen, int recid, int check) { if (!eckey) return 0; diff --git a/src/ecwrapper.h b/src/ecwrapper.h index 30c3db7931..4efde51650 100644 --- a/src/ecwrapper.h +++ b/src/ecwrapper.h @@ -12,7 +12,7 @@ class uint256; -// RAII Wrapper around OpenSSL's EC_KEY +/** RAII Wrapper around OpenSSL's EC_KEY */ class CECKey { private: EC_KEY *pkey; @@ -25,10 +25,12 @@ public: bool SetPubKey(const unsigned char* pubkey, size_t size); bool Verify(const uint256 &hash, const std::vector& vchSig); - // reconstruct public key from a compact signature - // This is only slightly more CPU intensive than just verifying it. - // If this function succeeds, the recovered public key is guaranteed to be valid - // (the signature is a valid signature of the given data for that key) + /** + * reconstruct public key from a compact signature + * This is only slightly more CPU intensive than just verifying it. + * If this function succeeds, the recovered public key is guaranteed to be valid + * (the signature is a valid signature of the given data for that key) + */ bool Recover(const uint256 &hash, const unsigned char *p64, int rec); bool TweakPublic(const unsigned char vchTweak[32]); diff --git a/src/leveldbwrapper.h b/src/leveldbwrapper.h index 10b7a2427c..42479206c8 100644 --- a/src/leveldbwrapper.h +++ b/src/leveldbwrapper.h @@ -1,5 +1,5 @@ -// Copyright (c) 2012-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2012-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_LEVELDBWRAPPER_H @@ -24,7 +24,7 @@ public: void HandleError(const leveldb::Status& status) throw(leveldb_error); -// Batch of changes queued to be written to a CLevelDBWrapper +/** Batch of changes queued to be written to a CLevelDBWrapper */ class CLevelDBBatch { friend class CLevelDBWrapper; @@ -64,25 +64,25 @@ public: class CLevelDBWrapper { private: - // custom environment this database is using (may be NULL in case of default environment) + //! custom environment this database is using (may be NULL in case of default environment) leveldb::Env* penv; - // database options used + //! database options used leveldb::Options options; - // options used when reading from the database + //! options used when reading from the database leveldb::ReadOptions readoptions; - // options used when iterating over values of the database + //! options used when iterating over values of the database leveldb::ReadOptions iteroptions; - // options used when writing to the database + //! options used when writing to the database leveldb::WriteOptions writeoptions; - // options used when sync writing to the database + //! options used when sync writing to the database leveldb::WriteOptions syncoptions; - // the database itself + //! the database itself leveldb::DB* pdb; public: diff --git a/src/timedata.cpp b/src/timedata.cpp index 40cdb33f7a..59f7778db1 100644 --- a/src/timedata.cpp +++ b/src/timedata.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "timedata.h" @@ -17,14 +17,13 @@ using namespace std; static CCriticalSection cs_nTimeOffset; static int64_t nTimeOffset = 0; -// -// "Never go to sea with two chronometers; take one or three." -// Our three time sources are: -// - System clock -// - Median of other nodes clocks -// - The user (asking the user to fix the system clock if the first two disagree) -// -// +/** + * "Never go to sea with two chronometers; take one or three." + * Our three time sources are: + * - System clock + * - Median of other nodes clocks + * - The user (asking the user to fix the system clock if the first two disagree) + */ int64_t GetTimeOffset() { LOCK(cs_nTimeOffset); diff --git a/src/timedata.h b/src/timedata.h index 2c20f4efd5..64595ffc37 100644 --- a/src/timedata.h +++ b/src/timedata.h @@ -1,5 +1,5 @@ // Copyright (c) 2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_TIMEDATA_H @@ -12,7 +12,8 @@ class CNetAddr; -/** Median filter over a stream of values. +/** + * Median filter over a stream of values. * Returns the median of the last N numbers */ template @@ -67,7 +68,7 @@ public: } }; -/* Functions to keep track of adjusted P2P time */ +/** Functions to keep track of adjusted P2P time */ int64_t GetTimeOffset(); int64_t GetAdjustedTime(); void AddTimeData(const CNetAddr& ip, int64_t nTime); diff --git a/src/txdb.h b/src/txdb.h index 147c186990..9a98fcc41b 100644 --- a/src/txdb.h +++ b/src/txdb.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_TXDB_H @@ -17,11 +17,11 @@ class CCoins; class uint256; -// -dbcache default (MiB) +//! -dbcache default (MiB) static const int64_t nDefaultDbCache = 100; -// max. -dbcache in (MiB) +//! max. -dbcache in (MiB) static const int64_t nMaxDbCache = sizeof(void*) > 4 ? 4096 : 1024; -// min. -dbcache in (MiB) +//! min. -dbcache in (MiB) static const int64_t nMinDbCache = 4; /** CCoinsView backed by the LevelDB coin database (chainstate/) */ diff --git a/src/uint256.h b/src/uint256.h index 28de540226..56f7f44a16 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_UINT256_H @@ -255,8 +255,10 @@ public: return sizeof(pn); } - // Returns the position of the highest bit set plus one, or zero if the - // value is zero. + /** + * Returns the position of the highest bit set plus one, or zero if the + * value is zero. + */ unsigned int bits() const; uint64_t GetLow64() const @@ -301,26 +303,27 @@ public: uint256(uint64_t b) : base_uint<256>(b) {} explicit uint256(const std::string& str) : base_uint<256>(str) {} explicit uint256(const std::vector& vch) : base_uint<256>(vch) {} - - // The "compact" format is a representation of a whole - // number N using an unsigned 32bit number similar to a - // floating point format. - // The most significant 8 bits are the unsigned exponent of base 256. - // This exponent can be thought of as "number of bytes of N". - // The lower 23 bits are the mantissa. - // Bit number 24 (0x800000) represents the sign of N. - // N = (-1^sign) * mantissa * 256^(exponent-3) - // - // Satoshi's original implementation used BN_bn2mpi() and BN_mpi2bn(). - // MPI uses the most significant bit of the first byte as sign. - // Thus 0x1234560000 is compact (0x05123456) - // and 0xc0de000000 is compact (0x0600c0de) - // (0x05c0de00) would be -0x40de000000 - // - // Bitcoin only uses this "compact" format for encoding difficulty - // targets, which are unsigned 256bit quantities. Thus, all the - // complexities of the sign bit and using base 256 are probably an - // implementation accident. + + /** + * The "compact" format is a representation of a whole + * number N using an unsigned 32bit number similar to a + * floating point format. + * The most significant 8 bits are the unsigned exponent of base 256. + * This exponent can be thought of as "number of bytes of N". + * The lower 23 bits are the mantissa. + * Bit number 24 (0x800000) represents the sign of N. + * N = (-1^sign) * mantissa * 256^(exponent-3) + * + * Satoshi's original implementation used BN_bn2mpi() and BN_mpi2bn(). + * MPI uses the most significant bit of the first byte as sign. + * Thus 0x1234560000 is compact (0x05123456) + * and 0xc0de000000 is compact (0x0600c0de) + * + * Bitcoin only uses this "compact" format for encoding difficulty + * targets, which are unsigned 256bit quantities. Thus, all the + * complexities of the sign bit and using base 256 are probably an + * implementation accident. + */ uint256& SetCompact(uint32_t nCompact, bool *pfNegative = NULL, bool *pfOverflow = NULL); uint32_t GetCompact(bool fNegative = false) const; From 1b2600a13ac5c57f6567ff3909cec4e22acd25bf Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 21 Nov 2014 16:47:11 +0100 Subject: [PATCH 1097/1288] Change MIT/X11 to MIT in license displayed in the program --- src/init.cpp | 2 +- src/qt/bitcoinstrings.cpp | 2 +- src/qt/locale/bitcoin_en.ts | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 4a9982a1cd..2d2a05a936 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -379,7 +379,7 @@ std::string LicenseInfo() "\n" + FormatParagraph(_("This is experimental software.")) + "\n" + "\n" + - FormatParagraph(_("Distributed under the MIT/X11 software license, see the accompanying file COPYING or .")) + "\n" + + FormatParagraph(_("Distributed under the MIT software license, see the accompanying file COPYING or .")) + "\n" + "\n" + FormatParagraph(_("This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.")) + "\n"; diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index af85df2020..548529865a 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -54,7 +54,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Delete all wallet transactions and only recover those parts of the " "blockchain through -rescan on startup"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Distributed under the MIT/X11 software license, see the accompanying file " +"Distributed under the MIT software license, see the accompanying file " "COPYING or ."), QT_TRANSLATE_NOOP("bitcoin-core", "" "Enter regression test mode, which uses a special chain in which blocks can " diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index ad63c5c086..71c626be4b 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -3644,7 +3644,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - + + Distributed under the MIT software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + + + + Enter regression test mode, which uses a special chain in which blocks can be solved instantly. @@ -3934,12 +3939,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. - - Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. - - - - + Error: Listening for incoming connections failed (listen returned error %s) From 730b1ed1a0d2b2b0f278ee808e7e266a50fac94b Mon Sep 17 00:00:00 2001 From: 21E14 <21xe14@gmail.com> Date: Mon, 27 Oct 2014 23:00:55 -0400 Subject: [PATCH 1098/1288] Check pindexBestForkBase for null --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 0cfe90beda..cd4bfbfb92 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1211,13 +1211,13 @@ void CheckForkWarningConditions() if (pindexBestForkTip || (pindexBestInvalid && pindexBestInvalid->nChainWork > chainActive.Tip()->nChainWork + (chainActive.Tip()->GetBlockWork() * 6))) { - if (!fLargeWorkForkFound) + if (!fLargeWorkForkFound && pindexBestForkBase) { std::string warning = std::string("'Warning: Large-work fork detected, forking after block ") + pindexBestForkBase->phashBlock->ToString() + std::string("'"); CAlert::Notify(warning, true); } - if (pindexBestForkTip) + if (pindexBestForkTip && pindexBestForkBase) { LogPrintf("CheckForkWarningConditions: Warning: Large valid fork found\n forking the chain at height %d (%s)\n lasting to height %d (%s).\nChain state database corruption likely.\n", pindexBestForkBase->nHeight, pindexBestForkBase->phashBlock->ToString(), From be4ac91aef4392879542d2b7740e536dde5f1d41 Mon Sep 17 00:00:00 2001 From: Pavel Vasin Date: Sat, 22 Nov 2014 15:39:57 +0300 Subject: [PATCH 1099/1288] docs: ThreadGetMyExternalIP has been removed It was removed in https://github.com/bitcoin/bitcoin/pull/5161 --- doc/coding.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/coding.md b/doc/coding.md index b9d2006e3c..43294dbe4c 100644 --- a/doc/coding.md +++ b/doc/coding.md @@ -115,8 +115,6 @@ Threads - StartNode : Starts other threads. -- ThreadGetMyExternalIP : Determines outside-the-firewall IP address, sends addr message to connected peers when it determines it. - - ThreadDNSAddressSeed : Loads addresses of peers from the DNS. - ThreadMapPort : Universal plug-and-play startup/shutdown From 3d0a1ce193a7f94862027de6df24cad7ce659256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jan=C3=ADk?= Date: Sat, 22 Nov 2014 19:56:25 +0100 Subject: [PATCH 1100/1288] Process help and version arguments before datadir. --- src/bitcoin-cli.cpp | 28 ++++++++++++------------ src/bitcoind.cpp | 53 ++++++++++++++++++++++++--------------------- 2 files changed, 42 insertions(+), 39 deletions(-) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index a2b95d5086..1b638e99e9 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -66,6 +66,20 @@ static bool AppInitRPC(int argc, char* argv[]) // Parameters // ParseParameters(argc, argv); + if (argc<2 || mapArgs.count("-?") || mapArgs.count("-help") || mapArgs.count("-version")) { + std::string strUsage = _("Bitcoin Core RPC client version") + " " + FormatFullVersion() + "\n"; + if (!mapArgs.count("-version")) { + strUsage += "\n" + _("Usage:") + "\n" + + " bitcoin-cli [options] [params] " + _("Send command to Bitcoin Core") + "\n" + + " bitcoin-cli [options] help " + _("List commands") + "\n" + + " bitcoin-cli [options] help " + _("Get help for a command") + "\n"; + + strUsage += "\n" + HelpMessageCli(); + } + + fprintf(stdout, "%s", strUsage.c_str()); + return false; + } if (!boost::filesystem::is_directory(GetDataDir(false))) { fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str()); return false; @@ -81,20 +95,6 @@ static bool AppInitRPC(int argc, char* argv[]) fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n"); return false; } - if (argc<2 || mapArgs.count("-?") || mapArgs.count("-help") || mapArgs.count("-version")) { - std::string strUsage = _("Bitcoin Core RPC client version") + " " + FormatFullVersion() + "\n"; - if (!mapArgs.count("-version")) { - strUsage += "\n" + _("Usage:") + "\n" + - " bitcoin-cli [options] [params] " + _("Send command to Bitcoin Core") + "\n" + - " bitcoin-cli [options] help " + _("List commands") + "\n" + - " bitcoin-cli [options] help " + _("Get help for a command") + "\n"; - - strUsage += "\n" + HelpMessageCli(); - } - - fprintf(stdout, "%s", strUsage.c_str()); - return false; - } return true; } diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index a79e581a80..be7757b0b6 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -59,13 +59,36 @@ bool AppInit(int argc, char* argv[]) boost::thread* detectShutdownThread = NULL; bool fRet = false; + + // + // Parameters + // + // If Qt is used, parameters/bitcoin.conf are parsed in qt/bitcoin.cpp's main() + ParseParameters(argc, argv); + + // Process help and version before taking care about datadir + if (mapArgs.count("-?") || mapArgs.count("-help") || mapArgs.count("-version")) + { + std::string strUsage = _("Bitcoin Core Daemon") + " " + _("version") + " " + FormatFullVersion() + "\n"; + + if (mapArgs.count("-version")) + { + strUsage += LicenseInfo(); + } + else + { + strUsage += "\n" + _("Usage:") + "\n" + + " bitcoind [options] " + _("Start Bitcoin Core Daemon") + "\n"; + + strUsage += "\n" + HelpMessage(HMM_BITCOIND); + } + + fprintf(stdout, "%s", strUsage.c_str()); + return false; + } + try { - // - // Parameters - // - // If Qt is used, parameters/bitcoin.conf are parsed in qt/bitcoin.cpp's main() - ParseParameters(argc, argv); if (!boost::filesystem::is_directory(GetDataDir(false))) { fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str()); @@ -84,26 +107,6 @@ bool AppInit(int argc, char* argv[]) return false; } - if (mapArgs.count("-?") || mapArgs.count("-help") || mapArgs.count("-version")) - { - std::string strUsage = _("Bitcoin Core Daemon") + " " + _("version") + " " + FormatFullVersion() + "\n"; - - if (mapArgs.count("-version")) - { - strUsage += LicenseInfo(); - } - else - { - strUsage += "\n" + _("Usage:") + "\n" + - " bitcoind [options] " + _("Start Bitcoin Core Daemon") + "\n"; - - strUsage += "\n" + HelpMessage(HMM_BITCOIND); - } - - fprintf(stdout, "%s", strUsage.c_str()); - return false; - } - // Command-line RPC bool fCommandLine = false; for (int i = 1; i < argc; i++) From e0535e15ab085e0b989e412ef88a629c028d96d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jan=C3=ADk?= Date: Sat, 22 Nov 2014 18:41:44 +0100 Subject: [PATCH 1101/1288] Remove misleading comment about testnet's message string. --- src/chainparams.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index e539eb7bd7..8a6a061ea1 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -192,11 +192,6 @@ public: CTestNetParams() { networkID = CBaseChainParams::TESTNET; strNetworkID = "test"; - /** - * The message start string is designed to be unlikely to occur in normal data. - * The characters are rarely used upper ASCII, not valid as UTF-8, and produce - * a large 4-byte int at any alignment. - */ pchMessageStart[0] = 0x0b; pchMessageStart[1] = 0x11; pchMessageStart[2] = 0x09; From d0c41a73501a0bf94fca91be5fb38ab039490843 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 6 Nov 2014 01:17:48 -0800 Subject: [PATCH 1102/1288] Add sanity check after key generation Add a sanity check to prevent cosmic rays from flipping a bit in the generated public key, or bugs in the elliptic curve code. This is simply done by signing a (randomized) message, and verifying the result. --- src/key.cpp | 19 +++++++++++++++---- src/key.h | 6 ++++++ src/rpcdump.cpp | 2 ++ src/test/key_tests.cpp | 20 ++++++++++++++++++++ src/wallet.cpp | 1 + 5 files changed, 44 insertions(+), 4 deletions(-) diff --git a/src/key.cpp b/src/key.cpp index 76256b864c..826af7f44a 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -86,6 +86,20 @@ bool CKey::Sign(const uint256 &hash, std::vector& vchSig) const { return true; } +bool CKey::VerifyPubKey(const CPubKey& pubkey) const { + if (pubkey.IsCompressed() != fCompressed) { + return false; + } + unsigned char rnd[8]; + std::string str = "Bitcoin key verification\n"; + GetRandBytes(rnd, sizeof(rnd)); + uint256 hash; + CHash256().Write((unsigned char*)str.data(), str.size()).Write(rnd, sizeof(rnd)).Finalize((unsigned char*)&hash); + std::vector vchSig; + Sign(hash, vchSig); + return pubkey.Verify(hash, vchSig); +} + bool CKey::SignCompact(const uint256 &hash, std::vector& vchSig) const { if (!fValid) return false; @@ -111,10 +125,7 @@ bool CKey::Load(CPrivKey &privkey, CPubKey &vchPubKey, bool fSkipCheck=false) { if (fSkipCheck) return true; - if (GetPubKey() != vchPubKey) - return false; - - return true; + return VerifyPubKey(vchPubKey); } bool CKey::Derive(CKey& keyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const { diff --git a/src/key.h b/src/key.h index 0bb05482c9..d8c82b6f09 100644 --- a/src/key.h +++ b/src/key.h @@ -136,6 +136,12 @@ public: //! Derive BIP32 child key. bool Derive(CKey& keyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const; + /** + * Verify thoroughly whether a private key and a public key match. + * This is done using a different mechanism than just regenerating it. + */ + bool VerifyPubKey(const CPubKey& vchPubKey) const; + //! Load private key and check that public key matches. bool Load(CPrivKey& privkey, CPubKey& vchPubKey, bool fSkipCheck); diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index c3ffe38cc3..8b95373cff 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -112,6 +112,7 @@ Value importprivkey(const Array& params, bool fHelp) if (!key.IsValid()) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Private key outside allowed range"); CPubKey pubkey = key.GetPubKey(); + assert(key.VerifyPubKey(pubkey)); CKeyID vchAddress = pubkey.GetID(); { pwalletMain->MarkDirty(); @@ -253,6 +254,7 @@ Value importwallet(const Array& params, bool fHelp) continue; CKey key = vchSecret.GetKey(); CPubKey pubkey = key.GetPubKey(); + assert(key.VerifyPubKey(pubkey)); CKeyID keyid = pubkey.GetID(); if (pwalletMain->HaveKey(keyid)) { LogPrintf("Skipping import of %s (key already present)\n", CBitcoinAddress(keyid).ToString()); diff --git a/src/test/key_tests.cpp b/src/test/key_tests.cpp index b32f3774fe..f9e35e0166 100644 --- a/src/test/key_tests.cpp +++ b/src/test/key_tests.cpp @@ -82,6 +82,26 @@ BOOST_AUTO_TEST_CASE(key_test1) CPubKey pubkey1C = key1C.GetPubKey(); CPubKey pubkey2C = key2C.GetPubKey(); + BOOST_CHECK(key1.VerifyPubKey(pubkey1)); + BOOST_CHECK(!key1.VerifyPubKey(pubkey1C)); + BOOST_CHECK(!key1.VerifyPubKey(pubkey2)); + BOOST_CHECK(!key1.VerifyPubKey(pubkey2C)); + + BOOST_CHECK(!key1C.VerifyPubKey(pubkey1)); + BOOST_CHECK(key1C.VerifyPubKey(pubkey1C)); + BOOST_CHECK(!key1C.VerifyPubKey(pubkey2)); + BOOST_CHECK(!key1C.VerifyPubKey(pubkey2C)); + + BOOST_CHECK(!key2.VerifyPubKey(pubkey1)); + BOOST_CHECK(!key2.VerifyPubKey(pubkey1C)); + BOOST_CHECK(key2.VerifyPubKey(pubkey2)); + BOOST_CHECK(!key2.VerifyPubKey(pubkey2C)); + + BOOST_CHECK(!key2C.VerifyPubKey(pubkey1)); + BOOST_CHECK(!key2C.VerifyPubKey(pubkey1C)); + BOOST_CHECK(!key2C.VerifyPubKey(pubkey2)); + BOOST_CHECK(key2C.VerifyPubKey(pubkey2C)); + BOOST_CHECK(addr1.Get() == CTxDestination(pubkey1.GetID())); BOOST_CHECK(addr2.Get() == CTxDestination(pubkey2.GetID())); BOOST_CHECK(addr1C.Get() == CTxDestination(pubkey1C.GetID())); diff --git a/src/wallet.cpp b/src/wallet.cpp index 5aea9881cd..353010ae07 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -79,6 +79,7 @@ CPubKey CWallet::GenerateNewKey() SetMinVersion(FEATURE_COMPRPUBKEY); CPubKey pubkey = secret.GetPubKey(); + assert(secret.VerifyPubKey(pubkey)); // Create new metadata int64_t nCreationTime = GetTime(); From f321d6bfff4dbbb4c52d0f175a27d54b287e81ff Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 8 Nov 2014 14:29:45 -0800 Subject: [PATCH 1103/1288] Add key generation/verification to ECC sanity check --- src/key.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/key.cpp b/src/key.cpp index 826af7f44a..a91ed1cc1d 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -201,5 +201,13 @@ void CExtKey::Decode(const unsigned char code[74]) { } bool ECC_InitSanityCheck() { - return CECKey::SanityCheck(); +#if !defined(USE_SECP256K1) + if (!CECKey::SanityCheck()) { + return false; + } +#endif + CKey key; + key.MakeNewKey(true); + CPubKey pubkey = key.GetPubKey(); + return key.VerifyPubKey(pubkey); } From 7357893396eb9ec6aafbce52bede0b7b31a97ddc Mon Sep 17 00:00:00 2001 From: dexX7 Date: Sun, 23 Nov 2014 13:10:31 +0100 Subject: [PATCH 1104/1288] Prioritize and display -testsafemode status in UI Like in a real world situation, a safe mode test should also be visible in the UI. A test of safe mode is furthermore mostly relevant for developers, so it should not be overwritten by a warning about a pre-release test build. --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 17fa765e8f..a3fe53b0e4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3221,12 +3221,12 @@ string GetWarnings(string strFor) string strStatusBar; string strRPC; - if (GetBoolArg("-testsafemode", false)) - strRPC = "test"; - if (!CLIENT_VERSION_IS_RELEASE) strStatusBar = _("This is a pre-release test build - use at your own risk - do not use for mining or merchant applications"); + if (GetBoolArg("-testsafemode", false)) + strStatusBar = strRPC = "testsafemode enabled"; + // Misc warnings like out of disk space and clock is wrong if (strMiscWarning != "") { From 3c777141349ad82d679a278df0619968af53c23f Mon Sep 17 00:00:00 2001 From: Gregory Maxwell Date: Sun, 23 Nov 2014 15:12:50 -0800 Subject: [PATCH 1105/1288] Make -proxy set all network types, avoiding a connect leak. Previously -proxy was not setting the proxy for IsLimited networks, so if you set your configuration to be onlynet=tor you wouldn't get an IPv4 proxy set. The payment protocol gets its proxy configuration from the IPv4 proxy, and so it would experience a connection leak. This addresses issue #5355 and also clears up a cosmetic bug where getinfo proxy output shows nothing when onlynet=tor is set. --- src/init.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 2d2a05a936..d2d6858618 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -854,10 +854,8 @@ bool AppInit2(boost::thread_group& threadGroup) if (!addrProxy.IsValid()) return InitError(strprintf(_("Invalid -proxy address: '%s'"), mapArgs["-proxy"])); - if (!IsLimited(NET_IPV4)) - SetProxy(NET_IPV4, addrProxy); - if (!IsLimited(NET_IPV6)) - SetProxy(NET_IPV6, addrProxy); + SetProxy(NET_IPV4, addrProxy); + SetProxy(NET_IPV6, addrProxy); SetNameProxy(addrProxy); fProxy = true; } From 494f6e7d353c63a85a2c6d4c6b2eb8e643934d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jan=C3=ADk?= Date: Fri, 21 Nov 2014 10:38:27 +0100 Subject: [PATCH 1106/1288] Check for strnlen and provide it if it is not found. --- configure.ac | 2 ++ src/Makefile.am | 1 + src/compat.h | 4 ++++ src/compat/strnlen.cpp | 18 ++++++++++++++++++ 4 files changed, 25 insertions(+) create mode 100644 src/compat/strnlen.cpp diff --git a/configure.ac b/configure.ac index 6784521d81..1814180864 100644 --- a/configure.ac +++ b/configure.ac @@ -421,6 +421,8 @@ AC_CHECK_HEADERS([endian.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/s AC_SEARCH_LIBS([getaddrinfo_a], [anl], [AC_DEFINE(HAVE_GETADDRINFO_A, 1, [Define this symbol if you have getaddrinfo_a])]) AC_SEARCH_LIBS([inet_pton], [nsl resolv], [AC_DEFINE(HAVE_INET_PTON, 1, [Define this symbol if you have inet_pton])]) +AC_CHECK_DECLS([strnlen]) + AC_CHECK_DECLS([le32toh, le64toh, htole32, htole64, be32toh, be64toh, htobe32, htobe64],,, [#if HAVE_ENDIAN_H #include diff --git a/src/Makefile.am b/src/Makefile.am index 0d45203c90..3ec9e2f85d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -251,6 +251,7 @@ libbitcoin_common_a_SOURCES = \ # backward-compatibility objects and their sanity checks are linked. libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_util_a_SOURCES = \ + compat/strnlen.cpp \ compat/glibc_sanity.cpp \ compat/glibcxx_sanity.cpp \ chainparamsbase.cpp \ diff --git a/src/compat.h b/src/compat.h index dade79aae0..80e53fe55e 100644 --- a/src/compat.h +++ b/src/compat.h @@ -84,4 +84,8 @@ typedef u_int SOCKET; #define THREAD_PRIORITY_ABOVE_NORMAL (-2) #endif +#if HAVE_DECL_STRNLEN == 0 +size_t strnlen( const char *start, size_t max_len); +#endif // HAVE_DECL_STRNLEN + #endif // BITCOIN_COMPAT_H diff --git a/src/compat/strnlen.cpp b/src/compat/strnlen.cpp new file mode 100644 index 0000000000..7f3e159887 --- /dev/null +++ b/src/compat/strnlen.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#if defined(HAVE_CONFIG_H) +#include "config/bitcoin-config.h" +#endif + +#include + +#if HAVE_DECL_STRNLEN == 0 +size_t strnlen( const char *start, size_t max_len) +{ + const char *end = (const char *)memchr(start, '\0', max_len); + + return end ? (size_t)(end - start) : max_len; +} +#endif // HAVE_DECL_STRNLEN From 51ce901aa3ca8326bc3fa96e6cc95453c695d4d6 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 7 Nov 2014 02:38:35 -0800 Subject: [PATCH 1107/1288] Improve chainstate/blockindex disk writing policy There are 3 pieces of data that are maintained on disk. The actual block and undo data, the block index (which can refer to positions on disk), and the chainstate (which refers to the best block hash). Earlier, there was no guarantee that blocks were written to disk before block index entries referring to them were written. This commit introduces dirty flags for block index data, and delays writing entries until the actual block data is flushed. With this stricter ordering in writes, it is now safe to not always flush after every block, so there is no need for the IsInitialBlockDownload() check there - instead we just write whenever enough time has passed or the cache size grows too large. Also updating the wallet's best known block is delayed until this is done, otherwise the wallet may end up referring to an unknown block. In addition, only do a write inside the block processing loop if necessary (because of cache size exceeded). Otherwise, move the writing to a point after processing is done, after relaying. --- src/init.cpp | 11 ++--- src/main.cpp | 106 ++++++++++++++++++++++++------------------ src/main.h | 4 ++ src/rpcblockchain.cpp | 2 +- 4 files changed, 68 insertions(+), 55 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 2d2a05a936..6d5ac5ab47 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -150,14 +150,9 @@ void Shutdown() { LOCK(cs_main); -#ifdef ENABLE_WALLET - if (pwalletMain) - pwalletMain->SetBestChain(chainActive.GetLocator()); -#endif - if (pblocktree) - pblocktree->Flush(); - if (pcoinsTip) - pcoinsTip->Flush(); + if (pcoinsTip != NULL) { + FlushStateToDisk(); + } delete pcoinsTip; pcoinsTip = NULL; delete pcoinsdbview; diff --git a/src/main.cpp b/src/main.cpp index 02062c3935..5dd27c7aa8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -130,6 +130,12 @@ namespace { // Number of preferrable block download peers. int nPreferredDownload = 0; + + // Dirty block index entries. + set setDirtyBlockIndex; + + // Dirty block file entries. + set setDirtyFileInfo; } // anon namespace ////////////////////////////////////////////////////////////////////////////// @@ -1137,11 +1143,6 @@ bool WriteBlockToDisk(CBlock& block, CDiskBlockPos& pos) pos.nPos = (unsigned int)fileOutPos; fileout << block; - // Flush stdio buffers and commit to disk before returning - fflush(fileout.Get()); - if (!IsInitialBlockDownload()) - FileCommit(fileout.Get()); - return true; } @@ -1335,7 +1336,7 @@ void static InvalidBlockFound(CBlockIndex *pindex, const CValidationState &state } if (!state.CorruptionPossible()) { pindex->nStatus |= BLOCK_FAILED_VALID; - pblocktree->WriteBlockIndex(CDiskBlockIndex(pindex)); + setDirtyBlockIndex.insert(pindex); setBlockIndexCandidates.erase(pindex); InvalidChainFound(pindex); } @@ -1732,10 +1733,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin } pindex->RaiseValidity(BLOCK_VALID_SCRIPTS); - - CDiskBlockIndex blockindex(pindex); - if (!pblocktree->WriteBlockIndex(blockindex)) - return state.Abort("Failed to write block index"); + setDirtyBlockIndex.insert(pindex); } if (fTxIndex) @@ -1759,10 +1757,16 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin return true; } -// Update the on-disk chain state. -bool static WriteChainState(CValidationState &state, bool forceWrite=false) { +/** + * Update the on-disk chain state. + * The caches and indexes are flushed if either they're too large, forceWrite is set, or + * fast is not set and it's been a while since the last write. + */ +bool static FlushStateToDisk(CValidationState &state, bool fast = false, bool forceWrite = false) { + LOCK(cs_main); static int64_t nLastWrite = 0; - if (forceWrite || pcoinsTip->GetCacheSize() > nCoinCacheSize || (!IsInitialBlockDownload() && GetTimeMicros() > nLastWrite + 600*1000000)) { + if (forceWrite || pcoinsTip->GetCacheSize() > nCoinCacheSize || + (!fast && GetTimeMicros() > nLastWrite + DATABASE_WRITE_INTERVAL * 1000000)) { // Typical CCoins structures on disk are around 100 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 @@ -1770,15 +1774,44 @@ bool static WriteChainState(CValidationState &state, bool forceWrite=false) { // overwrite one. Still, use a conservative safety factor of 2. if (!CheckDiskSpace(100 * 2 * 2 * pcoinsTip->GetCacheSize())) 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). + bool fileschanged = false; + for (set::iterator it = setDirtyFileInfo.begin(); it != setDirtyFileInfo.end(); ) { + if (!pblocktree->WriteBlockFileInfo(*it, vinfoBlockFile[*it])) { + return state.Abort("Failed to write to block index"); + } + fileschanged = true; + setDirtyFileInfo.erase(it++); + } + if (fileschanged && !pblocktree->WriteLastBlockFile(nLastBlockFile)) { + return state.Abort("Failed to write to block index"); + } + for (set::iterator it = setDirtyBlockIndex.begin(); it != setDirtyBlockIndex.end(); ) { + if (!pblocktree->WriteBlockIndex(CDiskBlockIndex(*it))) { + return state.Abort("Failed to write to block index"); + } + setDirtyBlockIndex.erase(it++); + } pblocktree->Sync(); + // Finally flush the chainstate (which may refer to block index entries). if (!pcoinsTip->Flush()) return state.Abort("Failed to write to coin database"); + // Update best block in wallet (so we can detect restored wallets). + if (forceWrite || !fast) { + g_signals.SetBestChain(chainActive.GetLocator()); + } nLastWrite = GetTimeMicros(); } return true; } +void FlushStateToDisk() { + CValidationState state; + FlushStateToDisk(state, false, true); +} + // Update chainActive and related internal data structures. void static UpdateTip(CBlockIndex *pindexNew) { chainActive.SetTip(pindexNew); @@ -1837,7 +1870,7 @@ bool static DisconnectTip(CValidationState &state) { } LogPrint("bench", "- Disconnect block: %.2fms\n", (GetTimeMicros() - nStart) * 0.001); // Write the chain state to disk, if necessary. - if (!WriteChainState(state)) + if (!FlushStateToDisk(state, true)) return false; // Resurrect mempool transactions from the disconnected block. BOOST_FOREACH(const CTransaction &tx, block.vtx) { @@ -1900,7 +1933,7 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock * int64_t nTime4 = GetTimeMicros(); nTimeFlush += nTime4 - nTime3; LogPrint("bench", " - Flush: %.2fms [%.2fs]\n", (nTime4 - nTime3) * 0.001, nTimeFlush * 0.000001); // Write the chain state to disk, if necessary. - if (!WriteChainState(state)) + if (!FlushStateToDisk(state, true)) return false; int64_t nTime5 = GetTimeMicros(); nTimeChainState += nTime5 - nTime4; LogPrint("bench", " - Writing chainstate: %.2fms [%.2fs]\n", (nTime5 - nTime4) * 0.001, nTimeChainState * 0.000001); @@ -1919,10 +1952,6 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock * BOOST_FOREACH(const CTransaction &tx, pblock->vtx) { SyncWithWallets(tx, pblock); } - // Update best block in wallet (so we can detect restored wallets) - // Emit this signal after the SyncWithWallets signals as the wallet relies on that everything up to this point has been synced - if ((chainActive.Height() % 20160) == 0 || ((chainActive.Height() % 144) == 0 && !IsInitialBlockDownload())) - g_signals.SetBestChain(chainActive.GetLocator()); int64_t nTime6 = GetTimeMicros(); nTimePostConnect += nTime6 - nTime5; nTimeTotal += nTime6 - nTime1; LogPrint("bench", " - Connect postprocess: %.2fms [%.2fs]\n", (nTime6 - nTime5) * 0.001, nTimePostConnect * 0.000001); @@ -2043,9 +2072,6 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo else CheckForkWarningConditions(); - if (!pblocktree->Flush()) - return state.Abort("Failed to sync block index"); - return true; } @@ -2086,11 +2112,16 @@ bool ActivateBestChain(CValidationState &state, CBlock *pblock) { if (chainActive.Height() > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : nBlockEstimate)) pnode->PushInventory(CInv(MSG_BLOCK, hashNewTip)); } - + // Notify external listeners about the new tip. uiInterface.NotifyBlockTip(hashNewTip); } } while(pindexMostWork != chainActive.Tip()); + // Write changes periodically to disk, after relay. + if (!FlushStateToDisk(state)) { + return false; + } + return true; } @@ -2123,8 +2154,7 @@ CBlockIndex* AddToBlockIndex(const CBlockHeader& block) if (pindexBestHeader == NULL || pindexBestHeader->nChainWork < pindexNew->nChainWork) pindexBestHeader = pindexNew; - // Ok if it fails, we'll download the header again next time. - pblocktree->WriteBlockIndex(CDiskBlockIndex(pindexNew)); + setDirtyBlockIndex.insert(pindexNew); return pindexNew; } @@ -2143,6 +2173,7 @@ bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBl LOCK(cs_nBlockSequenceId); pindexNew->nSequenceId = nBlockSequenceId++; } + setDirtyBlockIndex.insert(pindexNew); if (pindexNew->pprev == NULL || pindexNew->pprev->nChainTx) { // If pindexNew is the genesis block or all parents are BLOCK_VALID_TRANSACTIONS. @@ -2162,15 +2193,11 @@ bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBl range.first++; mapBlocksUnlinked.erase(it); } - if (!pblocktree->WriteBlockIndex(CDiskBlockIndex(pindex))) - return state.Abort("Failed to write block index"); } } else { if (pindexNew->pprev && pindexNew->pprev->IsValid(BLOCK_VALID_TREE)) { mapBlocksUnlinked.insert(std::make_pair(pindexNew->pprev, pindexNew)); } - if (!pblocktree->WriteBlockIndex(CDiskBlockIndex(pindexNew))) - return state.Abort("Failed to write block index"); } return true; @@ -2178,8 +2205,6 @@ bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBl bool FindBlockPos(CValidationState &state, CDiskBlockPos &pos, unsigned int nAddSize, unsigned int nHeight, uint64_t nTime, bool fKnown = false) { - bool fUpdatedLast = false; - LOCK(cs_LastBlockFile); unsigned int nFile = fKnown ? pos.nFile : nLastBlockFile; @@ -2195,7 +2220,6 @@ bool FindBlockPos(CValidationState &state, CDiskBlockPos &pos, unsigned int nAdd if (vinfoBlockFile.size() <= nFile) { vinfoBlockFile.resize(nFile + 1); } - fUpdatedLast = true; } pos.nFile = nFile; pos.nPos = vinfoBlockFile[nFile].nSize; @@ -2222,11 +2246,7 @@ bool FindBlockPos(CValidationState &state, CDiskBlockPos &pos, unsigned int nAdd } } - if (!pblocktree->WriteBlockFileInfo(nLastBlockFile, vinfoBlockFile[nFile])) - return state.Abort("Failed to write file info"); - if (fUpdatedLast) - pblocktree->WriteLastBlockFile(nLastBlockFile); - + setDirtyFileInfo.insert(nFile); return true; } @@ -2239,9 +2259,7 @@ bool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos, unsigne unsigned int nNewSize; pos.nPos = vinfoBlockFile[nFile].nUndoSize; nNewSize = vinfoBlockFile[nFile].nUndoSize += nAddSize; - if (!pblocktree->WriteBlockFileInfo(nLastBlockFile, vinfoBlockFile[nLastBlockFile])) { - return state.Abort("Failed to write block info"); - } + setDirtyFileInfo.insert(nFile); unsigned int nOldChunks = (pos.nPos + UNDOFILE_CHUNK_SIZE - 1) / UNDOFILE_CHUNK_SIZE; unsigned int nNewChunks = (nNewSize + UNDOFILE_CHUNK_SIZE - 1) / UNDOFILE_CHUNK_SIZE; @@ -2462,6 +2480,7 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex, if ((!CheckBlock(block, state)) || !ContextualCheckBlock(block, state, pindex->pprev)) { if (state.IsInvalid() && !state.CorruptionPossible()) { pindex->nStatus |= BLOCK_FAILED_VALID; + setDirtyBlockIndex.insert(pindex); } return false; } @@ -3070,7 +3089,7 @@ bool InitBlockIndex() { if (!ActivateBestChain(state, &block)) return error("LoadBlockIndex() : genesis block cannot be activated"); // Force a chainstate write so that when we VerifyDB in a moment, it doesnt check stale data - return WriteChainState(state, true); + return FlushStateToDisk(state, false, true); } catch(std::runtime_error &e) { return error("LoadBlockIndex() : failed to initialize block database: %s", e.what()); } @@ -4641,11 +4660,6 @@ bool CBlockUndo::WriteToDisk(CDiskBlockPos &pos, const uint256 &hashBlock) hasher << *this; fileout << hasher.GetHash(); - // Flush stdio buffers and commit to disk before returning - fflush(fileout.Get()); - if (!IsInitialBlockDownload()) - FileCommit(fileout.Get()); - return true; } diff --git a/src/main.h b/src/main.h index b49f0a06eb..c0d6412528 100644 --- a/src/main.h +++ b/src/main.h @@ -94,6 +94,8 @@ static const unsigned int MAX_HEADERS_RESULTS = 2000; * degree of disordering of blocks on disk (which make reindexing and in the future perhaps pruning * harder). We'll probably want to make this a per-peer adaptive value at some point. */ static const unsigned int BLOCK_DOWNLOAD_WINDOW = 1024; +/** Time to wait (in seconds) between writing blockchain state to disk. */ +static const unsigned int DATABASE_WRITE_INTERVAL = 3600; /** "reject" message codes **/ static const unsigned char REJECT_MALFORMED = 0x01; @@ -201,6 +203,8 @@ bool AbortNode(const std::string &msg, const std::string &userMessage=""); bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats); /** Increase a node's misbehavior score. */ void Misbehaving(NodeId nodeid, int howmuch); +/** Flush all state, indexes and buffers to disk. */ +void FlushStateToDisk(); /** (try to) add transaction to memory pool **/ diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 7919fb1a0c..e8b0f62a83 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -319,7 +319,7 @@ Value gettxoutsetinfo(const Array& params, bool fHelp) Object ret; CCoinsStats stats; - pcoinsTip->Flush(); + FlushStateToDisk(); if (pcoinsTip->GetStats(stats)) { ret.push_back(Pair("height", (int64_t)stats.nHeight)); ret.push_back(Pair("bestblock", stats.hashBlock.GetHex())); From a20695001604a8aa9b7baaf52db8642b0b82b0d9 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 14 Nov 2014 18:19:26 +0100 Subject: [PATCH 1108/1288] Introduce separate flushing modes --- src/main.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 5dd27c7aa8..13c568e5e3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1757,16 +1757,23 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin return true; } +enum FlushStateMode { + FLUSH_STATE_IF_NEEDED, + FLUSH_STATE_PERIODIC, + FLUSH_STATE_ALWAYS +}; + /** * Update the on-disk chain state. * The caches and indexes are flushed if either they're too large, forceWrite is set, or * fast is not set and it's been a while since the last write. */ -bool static FlushStateToDisk(CValidationState &state, bool fast = false, bool forceWrite = false) { +bool static FlushStateToDisk(CValidationState &state, FlushStateMode mode) { LOCK(cs_main); static int64_t nLastWrite = 0; - if (forceWrite || pcoinsTip->GetCacheSize() > nCoinCacheSize || - (!fast && GetTimeMicros() > nLastWrite + DATABASE_WRITE_INTERVAL * 1000000)) { + if ((mode == FLUSH_STATE_ALWAYS) || + ((mode == FLUSH_STATE_PERIODIC || mode == FLUSH_STATE_IF_NEEDED) && pcoinsTip->GetCacheSize() > nCoinCacheSize) || + (mode == FLUSH_STATE_PERIODIC && GetTimeMicros() > nLastWrite + DATABASE_WRITE_INTERVAL * 1000000)) { // Typical CCoins structures on disk are around 100 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 @@ -1799,7 +1806,7 @@ bool static FlushStateToDisk(CValidationState &state, bool fast = false, bool fo if (!pcoinsTip->Flush()) return state.Abort("Failed to write to coin database"); // Update best block in wallet (so we can detect restored wallets). - if (forceWrite || !fast) { + if (mode != FLUSH_STATE_IF_NEEDED) { g_signals.SetBestChain(chainActive.GetLocator()); } nLastWrite = GetTimeMicros(); @@ -1809,7 +1816,7 @@ bool static FlushStateToDisk(CValidationState &state, bool fast = false, bool fo void FlushStateToDisk() { CValidationState state; - FlushStateToDisk(state, false, true); + FlushStateToDisk(state, FLUSH_STATE_ALWAYS); } // Update chainActive and related internal data structures. @@ -1870,7 +1877,7 @@ bool static DisconnectTip(CValidationState &state) { } LogPrint("bench", "- Disconnect block: %.2fms\n", (GetTimeMicros() - nStart) * 0.001); // Write the chain state to disk, if necessary. - if (!FlushStateToDisk(state, true)) + if (!FlushStateToDisk(state, FLUSH_STATE_IF_NEEDED)) return false; // Resurrect mempool transactions from the disconnected block. BOOST_FOREACH(const CTransaction &tx, block.vtx) { @@ -1933,7 +1940,7 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock * int64_t nTime4 = GetTimeMicros(); nTimeFlush += nTime4 - nTime3; LogPrint("bench", " - Flush: %.2fms [%.2fs]\n", (nTime4 - nTime3) * 0.001, nTimeFlush * 0.000001); // Write the chain state to disk, if necessary. - if (!FlushStateToDisk(state, true)) + if (!FlushStateToDisk(state, FLUSH_STATE_IF_NEEDED)) return false; int64_t nTime5 = GetTimeMicros(); nTimeChainState += nTime5 - nTime4; LogPrint("bench", " - Writing chainstate: %.2fms [%.2fs]\n", (nTime5 - nTime4) * 0.001, nTimeChainState * 0.000001); @@ -2118,7 +2125,7 @@ bool ActivateBestChain(CValidationState &state, CBlock *pblock) { } while(pindexMostWork != chainActive.Tip()); // Write changes periodically to disk, after relay. - if (!FlushStateToDisk(state)) { + if (!FlushStateToDisk(state, FLUSH_STATE_PERIODIC)) { return false; } @@ -3089,7 +3096,7 @@ bool InitBlockIndex() { if (!ActivateBestChain(state, &block)) return error("LoadBlockIndex() : genesis block cannot be activated"); // Force a chainstate write so that when we VerifyDB in a moment, it doesnt check stale data - return FlushStateToDisk(state, false, true); + return FlushStateToDisk(state, FLUSH_STATE_ALWAYS); } catch(std::runtime_error &e) { return error("LoadBlockIndex() : failed to initialize block database: %s", e.what()); } From c5a22828559bdac8fd347e30a3027dbaf54934ae Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Fri, 21 Nov 2014 20:07:00 +0100 Subject: [PATCH 1109/1288] [Qt, OSX] fix Qt4.8 compatibility with QProgressBar issue Rebased-From: 7f33d2cebfde99ded12c711ef6bd77c91725cfb8 Github-Issue: #5344 --- src/qt/guiutil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index a6ecfbcc82..09c79db2d9 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -189,7 +189,7 @@ namespace GUIUtil /* Format a CNodeCombinedStats.dPingTime into a user-readable string or display N/A, if 0*/ QString formatPingTime(double dPingTime); -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && QT_VERSION >= 0x050000 // workaround for Qt OSX Bug: // https://bugreports.qt-project.org/browse/QTBUG-15631 // QProgressBar uses around 10% CPU even when app is in background From 322317951f2764d3cb55eea7d34f950b9c54e01a Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 24 Nov 2014 14:49:43 -0500 Subject: [PATCH 1110/1288] libbitcoinconsensus: don't require any global constructors These static objects are only used in once place, so declare them there instead. --- src/script/interpreter.cpp | 15 ++++++++------- src/utilstrencodings.cpp | 10 +++++----- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 5eda23731d..a10cefcc0b 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -17,13 +17,6 @@ using namespace std; typedef vector valtype; -static const valtype vchFalse(0); -static const valtype vchZero(0); -static const valtype vchTrue(1, 1); -static const CScriptNum bnZero(0); -static const CScriptNum bnOne(1); -static const CScriptNum bnFalse(0); -static const CScriptNum bnTrue(1); namespace { @@ -239,6 +232,14 @@ bool static CheckMinimalPush(const valtype& data, opcodetype opcode) { bool EvalScript(vector >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* serror) { + static const CScriptNum bnZero(0); + static const CScriptNum bnOne(1); + static const CScriptNum bnFalse(0); + static const CScriptNum bnTrue(1); + static const valtype vchFalse(0); + static const valtype vchZero(0); + static const valtype vchTrue(1, 1); + CScript::const_iterator pc = script.begin(); CScript::const_iterator pend = script.end(); CScript::const_iterator pbegincodehash = script.begin(); diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index a961b3c5cd..d0062d4544 100644 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -14,13 +14,13 @@ using namespace std; -/** - * safeChars chosen to allow simple messages/URLs/email addresses, but avoid anything - * even possibly remotely dangerous like & or > - */ -static string safeChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 .,;_/:?@()"); string SanitizeString(const string& str) { + /** + * safeChars chosen to allow simple messages/URLs/email addresses, but avoid anything + * even possibly remotely dangerous like & or > + */ + static string safeChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 .,;_/:?@()"); string strResult; for (std::string::size_type i = 0; i < str.size(); i++) { From d61dc25c71c960fb623696c4aea8e57f32a4ba2f Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 24 Nov 2014 21:45:42 -0500 Subject: [PATCH 1111/1288] qt: osx: fix hidden symbol visibility Fixes default hidden symbol visibility for our linux->osx cross build. Without this change, the check for working -fvisibility=hidden fails, and all symbols are visible by default. Ugly as this is, it's just a simple find/replace to fix a bug in Qt's configure. They assume in an "XPLATFORM_MAC" block that the builder is capable of running osx programs. This should be "BUILD_ON_MAC" instead. --- depends/packages/qt.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 51f2ea663b..6a8e714a48 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -48,6 +48,7 @@ define $(package)_preprocess_cmds sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \ sed -i.old "s/src_plugins.depends = src_sql src_xml src_network/src_plugins.depends = src_xml src_network/" qtbase/src/src.pro && \ sed -i.old "/XIproto.h/d" qtbase/src/plugins/platforms/xcb/qxcbxsettings.cpp && \ + sed -i.old 's/if \[ "$$$$XPLATFORM_MAC" = "yes" \]; then xspecvals=$$$$(macSDKify/if \[ "$$$$BUILD_ON_MAC" = "yes" \]; then xspecvals=$$$$(macSDKify/' qtbase/configure && \ mkdir -p qtbase/mkspecs/macx-clang-linux &&\ cp -f qtbase/mkspecs/macx-clang/Info.plist.lib qtbase/mkspecs/macx-clang-linux/ &&\ cp -f qtbase/mkspecs/macx-clang/Info.plist.app qtbase/mkspecs/macx-clang-linux/ &&\ From 3a05ba1bfcba72bb91643510d96bd2f49a8420bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jan=C3=ADk?= Date: Tue, 25 Nov 2014 08:18:33 +0100 Subject: [PATCH 1112/1288] Fix typo in doxygen comment. --- src/random.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/random.h b/src/random.h index ec73d910c4..aa55ca2b6f 100644 --- a/src/random.h +++ b/src/random.h @@ -26,7 +26,7 @@ uint256 GetRandHash(); /** * Seed insecure_rand using the random pool. - * @param Deterministic Use a determinstic seed + * @param Deterministic Use a deterministic seed */ void seed_insecure_rand(bool fDeterministic = false); From 798faec3ea208166a5a4e0676b9b565ce9e59c1e Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 19 Nov 2014 09:39:42 +0100 Subject: [PATCH 1113/1288] Add 'invalidateblock' and 'reconsiderblock' RPC commands. These can be used for testing reorganizations or for manual intervention in case of chain forks. --- src/main.cpp | 73 +++++++++++++++++++++++++++++++++++++++++ src/main.h | 6 ++++ src/rpcblockchain.cpp | 76 +++++++++++++++++++++++++++++++++++++++++++ src/rpcserver.cpp | 2 ++ src/rpcserver.h | 2 ++ 5 files changed, 159 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 88fb31980f..025577a940 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2132,6 +2132,79 @@ bool ActivateBestChain(CValidationState &state, CBlock *pblock) { return true; } +bool InvalidateBlock(CValidationState& state, CBlockIndex *pindex) { + AssertLockHeld(cs_main); + + // Mark the block itself as invalid. + pindex->nStatus |= BLOCK_FAILED_VALID; + if (!pblocktree->WriteBlockIndex(CDiskBlockIndex(pindex))) { + return state.Abort("Failed to update block index"); + } + setBlockIndexCandidates.erase(pindex); + + while (chainActive.Contains(pindex)) { + CBlockIndex *pindexWalk = chainActive.Tip(); + pindexWalk->nStatus |= BLOCK_FAILED_CHILD; + if (!pblocktree->WriteBlockIndex(CDiskBlockIndex(pindexWalk))) { + return state.Abort("Failed to update block index"); + } + setBlockIndexCandidates.erase(pindexWalk); + // ActivateBestChain considers blocks already in chainActive + // unconditionally valid already, so force disconnect away from it. + if (!DisconnectTip(state)) { + return false; + } + } + + // The resulting new best tip may not be in setBlockIndexCandidates anymore, so + // add them again. + BlockMap::iterator it = mapBlockIndex.begin(); + while (it != mapBlockIndex.end()) { + if (it->second->IsValid(BLOCK_VALID_TRANSACTIONS) && it->second->nChainTx && setBlockIndexCandidates.value_comp()(chainActive.Tip(), it->second)) { + setBlockIndexCandidates.insert(pindex); + } + it++; + } + + InvalidChainFound(pindex); + return true; +} + +bool ReconsiderBlock(CValidationState& state, CBlockIndex *pindex) { + AssertLockHeld(cs_main); + + int nHeight = pindex->nHeight; + + // Remove the invalidity flag from this block and all its descendants. + BlockMap::iterator it = mapBlockIndex.begin(); + while (it != mapBlockIndex.end()) { + if (!it->second->IsValid() && it->second->GetAncestor(nHeight) == pindex) { + it->second->nStatus &= ~BLOCK_FAILED_MASK; + if (!pblocktree->WriteBlockIndex(CDiskBlockIndex(pindex))) { + return state.Abort("Failed to update block index"); + } + if (it->second->IsValid(BLOCK_VALID_TRANSACTIONS) && it->second->nChainTx && setBlockIndexCandidates.value_comp()(chainActive.Tip(), it->second)) { + setBlockIndexCandidates.insert(it->second); + } + if (it->second == pindexBestInvalid) { + // Reset invalid block marker if it was pointing to one of those. + pindexBestInvalid = NULL; + } + } + it++; + } + + // Remove the invalidity flag from all ancestors too. + while (pindex != NULL) { + pindex->nStatus &= ~BLOCK_FAILED_MASK; + if (!pblocktree->WriteBlockIndex(CDiskBlockIndex(pindex))) { + return state.Abort("Failed to update block index"); + } + pindex = pindex->pprev; + } + return true; +} + CBlockIndex* AddToBlockIndex(const CBlockHeader& block) { // Check for duplicate diff --git a/src/main.h b/src/main.h index c0d6412528..aee8d9234a 100644 --- a/src/main.h +++ b/src/main.h @@ -609,6 +609,12 @@ public: /** Find the last common block between the parameter chain and a locator. */ CBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& locator); +/** Mark a block as invalid. */ +bool InvalidateBlock(CValidationState& state, CBlockIndex *pindex); + +/** Remove invalidity status from a block and its descendants. */ +bool ReconsiderBlock(CValidationState& state, CBlockIndex *pindex); + /** The currently-connected chain of blocks. */ extern CChain chainActive; diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index e8b0f62a83..0ce18e4147 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -561,3 +561,79 @@ Value getmempoolinfo(const Array& params, bool fHelp) return ret; } +Value invalidateblock(const Array& params, bool fHelp) +{ + if (fHelp || params.size() != 1) + throw runtime_error( + "invalidateblock \"hash\"\n" + "\nPermanently marks a block as invalid, as if it violated a consensus rule.\n" + "\nArguments:\n" + "1. hash (string, required) the hash of the block to mark as invalid\n" + "\nResult:\n" + "\nExamples:\n" + + HelpExampleCli("invalidateblock", "\"blockhash\"") + + HelpExampleRpc("invalidateblock", "\"blockhash\"") + ); + + std::string strHash = params[0].get_str(); + uint256 hash(strHash); + CValidationState state; + + { + LOCK(cs_main); + if (mapBlockIndex.count(hash) == 0) + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found"); + + CBlockIndex* pblockindex = mapBlockIndex[hash]; + InvalidateBlock(state, pblockindex); + } + + if (state.IsValid()) { + ActivateBestChain(state); + } + + if (!state.IsValid()) { + throw JSONRPCError(RPC_DATABASE_ERROR, state.GetRejectReason()); + } + + return Value::null; +} + +Value reconsiderblock(const Array& params, bool fHelp) +{ + if (fHelp || params.size() != 1) + throw runtime_error( + "reconsiderblock \"hash\"\n" + "\nRemoves invalidity status of a block and its descendants, reconsider them for activation.\n" + "This can be used to undo the effects of invalidateblock.\n" + "\nArguments:\n" + "1. hash (string, required) the hash of the block to reconsider\n" + "\nResult:\n" + "\nExamples:\n" + + HelpExampleCli("reconsiderblock", "\"blockhash\"") + + HelpExampleRpc("reconsiderblock", "\"blockhash\"") + ); + + std::string strHash = params[0].get_str(); + uint256 hash(strHash); + CValidationState state; + + { + LOCK(cs_main); + if (mapBlockIndex.count(hash) == 0) + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found"); + + CBlockIndex* pblockindex = mapBlockIndex[hash]; + ReconsiderBlock(state, pblockindex); + } + + if (state.IsValid()) { + ActivateBestChain(state); + } + + if (!state.IsValid()) { + throw JSONRPCError(RPC_DATABASE_ERROR, state.GetRejectReason()); + } + + return Value::null; +} diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 7022c50375..6cc96b4da3 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -270,6 +270,8 @@ static const CRPCCommand vRPCCommands[] = { "blockchain", "gettxout", &gettxout, true, false, false }, { "blockchain", "gettxoutsetinfo", &gettxoutsetinfo, true, false, false }, { "blockchain", "verifychain", &verifychain, true, false, false }, + { "blockchain", "invalidateblock", &invalidateblock, true, true, false }, + { "blockchain", "reconsiderblock", &reconsiderblock, true, true, false }, /* Mining */ { "mining", "getblocktemplate", &getblocktemplate, true, false, false }, diff --git a/src/rpcserver.h b/src/rpcserver.h index 7395fc23c6..6969db0287 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -219,6 +219,8 @@ extern json_spirit::Value gettxoutsetinfo(const json_spirit::Array& params, bool extern json_spirit::Value gettxout(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value verifychain(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getchaintips(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value invalidateblock(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value reconsiderblock(const json_spirit::Array& params, bool fHelp); // in rest.cpp extern bool HTTPReq_REST(AcceptedConnection *conn, From 3dd8ed72e570e9289635cfb5c3c12c807c3e8c27 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 25 Nov 2014 12:33:43 +0100 Subject: [PATCH 1114/1288] Delay writing block indexes in invalidate/reconsider --- src/main.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 025577a940..621f213338 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2137,17 +2137,13 @@ bool InvalidateBlock(CValidationState& state, CBlockIndex *pindex) { // Mark the block itself as invalid. pindex->nStatus |= BLOCK_FAILED_VALID; - if (!pblocktree->WriteBlockIndex(CDiskBlockIndex(pindex))) { - return state.Abort("Failed to update block index"); - } + setDirtyBlockIndex.insert(pindex); setBlockIndexCandidates.erase(pindex); while (chainActive.Contains(pindex)) { CBlockIndex *pindexWalk = chainActive.Tip(); pindexWalk->nStatus |= BLOCK_FAILED_CHILD; - if (!pblocktree->WriteBlockIndex(CDiskBlockIndex(pindexWalk))) { - return state.Abort("Failed to update block index"); - } + setDirtyBlockIndex.insert(pindexWalk); setBlockIndexCandidates.erase(pindexWalk); // ActivateBestChain considers blocks already in chainActive // unconditionally valid already, so force disconnect away from it. @@ -2180,9 +2176,7 @@ bool ReconsiderBlock(CValidationState& state, CBlockIndex *pindex) { while (it != mapBlockIndex.end()) { if (!it->second->IsValid() && it->second->GetAncestor(nHeight) == pindex) { it->second->nStatus &= ~BLOCK_FAILED_MASK; - if (!pblocktree->WriteBlockIndex(CDiskBlockIndex(pindex))) { - return state.Abort("Failed to update block index"); - } + setDirtyBlockIndex.insert(it->second); if (it->second->IsValid(BLOCK_VALID_TRANSACTIONS) && it->second->nChainTx && setBlockIndexCandidates.value_comp()(chainActive.Tip(), it->second)) { setBlockIndexCandidates.insert(it->second); } @@ -2196,9 +2190,9 @@ bool ReconsiderBlock(CValidationState& state, CBlockIndex *pindex) { // Remove the invalidity flag from all ancestors too. while (pindex != NULL) { - pindex->nStatus &= ~BLOCK_FAILED_MASK; - if (!pblocktree->WriteBlockIndex(CDiskBlockIndex(pindex))) { - return state.Abort("Failed to update block index"); + if (pindex->nStatus & BLOCK_FAILED_MASK) { + pindex->nStatus &= ~BLOCK_FAILED_MASK; + setDirtyBlockIndex.insert(pindex); } pindex = pindex->pprev; } From a328dd60a7affeb0444f7bd836d70d80b35d9c2a Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 20 Nov 2014 13:06:10 +0100 Subject: [PATCH 1115/1288] [Qt] small changes to sendcoinsdialog - add newly added variables to the constructor init - move an already existing bool also to constructor init - move a connect call to setClientModel and add a NULL pointer check --- src/qt/sendcoinsdialog.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index ff39829b95..46eb58ca43 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -12,12 +12,12 @@ #include "guiutil.h" #include "optionsmodel.h" #include "sendcoinsentry.h" -#include "wallet.h" #include "walletmodel.h" #include "base58.h" #include "coincontrol.h" #include "ui_interface.h" +#include "wallet.h" #include #include @@ -27,7 +27,10 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::SendCoinsDialog), - model(0) + clientModel(0), + model(0), + fNewRecipientAllowed(true), + fFeeMinimized(true) { ui->setupUi(this); @@ -106,13 +109,15 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) : ui->checkBoxMinimumFee->setChecked(settings.value("fPayOnlyMinFee").toBool()); ui->checkBoxFreeTx->setChecked(settings.value("fSendFreeTransactions").toBool()); minimizeFeeSection(settings.value("fFeeSectionMinimized").toBool()); - - fNewRecipientAllowed = true; } void SendCoinsDialog::setClientModel(ClientModel *clientModel) { this->clientModel = clientModel; + + if (clientModel) { + connect(clientModel, SIGNAL(numBlocksChanged(int)), this, SLOT(updateSmartFeeLabel())); + } } void SendCoinsDialog::setModel(WalletModel *model) @@ -143,7 +148,6 @@ void SendCoinsDialog::setModel(WalletModel *model) coinControlUpdateLabels(); // fee section - connect(clientModel, SIGNAL(numBlocksChanged(int)), this, SLOT(updateSmartFeeLabel())); connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(updateSmartFeeLabel())); connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(updateGlobalFeeVariables())); connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(coinControlUpdateLabels())); @@ -460,7 +464,7 @@ bool SendCoinsDialog::handlePaymentRequest(const SendCoinsRecipient &rv) return true; } -void SendCoinsDialog::setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, +void SendCoinsDialog::setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, const CAmount& watchBalance, const CAmount& watchUnconfirmedBalance, const CAmount& watchImmatureBalance) { Q_UNUSED(unconfirmedBalance); From b7f2cdc8a97ba1a2155c0614895701de0f327154 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 21 Nov 2014 21:21:54 -0500 Subject: [PATCH 1116/1288] build: disable static lib stripping during osx make install-strip --- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac index 6784521d81..a9dec32272 100644 --- a/configure.ac +++ b/configure.ac @@ -281,6 +281,12 @@ case $host in AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool) AC_PATH_TOOL([OTOOL], [otool], otool) AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage) + + dnl libtool will try to strip the static lib, which is a problem for + dnl cross-builds because strip attempts to call a hard-coded ld, + dnl which may not exist in the path. Stripping the .a is not + dnl necessary, so just disable it. + old_striplib= ;; esac fi From 52bb7a7e1b69e7cc863621fb04958e0a39066138 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 25 Nov 2014 18:36:55 -0500 Subject: [PATCH 1117/1288] gitian: update descriptors to use a sane uniform output --- contrib/gitian-descriptors/gitian-linux.yml | 29 ++++++++++-------- contrib/gitian-descriptors/gitian-osx.yml | 29 +++++++++++------- contrib/gitian-descriptors/gitian-win.yml | 33 +++++++++++++-------- 3 files changed, 55 insertions(+), 36 deletions(-) diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index b57a04469c..bba2104edb 100644 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -73,13 +73,13 @@ script: | ./autogen.sh ./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'` make dist - DISTNAME=`echo bitcoin-*.tar.gz` - + SOURCEDIST=`echo bitcoin-*.tar.gz` + DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'` # Correct tar file order mkdir -p temp pushd temp - tar xf ../$DISTNAME - find bitcoin-* | sort | tar --no-recursion -c -T - | gzip -9n > ../$DISTNAME + tar xf ../$SOURCEDIST + find bitcoin-* | sort | tar --no-recursion -c -T - | gzip -9n > ../$SOURCEDIST popd ORIGPATH="$PATH" @@ -88,17 +88,22 @@ script: | export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH} mkdir -p distsrc-${i} cd distsrc-${i} - tar --strip-components=1 -xf ../$DISTNAME + INSTALLPATH=`pwd`/installed/${DISTNAME} + mkdir -p ${INSTALLPATH} + tar --strip-components=1 -xf ../$SOURCEDIST - ./configure --prefix=${BASEPREFIX}/${i} --bindir=${OUTDIR}/${i}/bin --includedir=${OUTDIR}/${i}/include --libdir=${OUTDIR}/${i}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} + ./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} make ${MAKEOPTS} make install-strip - cd .. + cd installed + find . -name "lib*.la" -delete + find . -name "lib*.a" -delete + rm -rf ${DISTNAME}/lib/pkgconfig + find . | sort | tar --no-recursion -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz + cd ../../ done mkdir -p $OUTDIR/src - mv $DISTNAME $OUTDIR/src - mv ${OUTDIR}/x86_64-* ${OUTDIR}/64 - mv ${OUTDIR}/i686-* ${OUTDIR}/32 + mv $SOURCEDIST $OUTDIR/src + mv ${OUTDIR}/${DISTNAME}-x86_64-*.tar.gz ${OUTDIR}/${DISTNAME}-linux64.tar.gz + mv ${OUTDIR}/${DISTNAME}-i686-*.tar.gz ${OUTDIR}/${DISTNAME}-linux32.tar.gz - # Delete unwanted stuff - find ${OUTDIR} -name "lib*.la" -delete diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml index 7ec0700ed3..cbe28e4f34 100644 --- a/contrib/gitian-descriptors/gitian-osx.yml +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -83,13 +83,14 @@ script: | ./autogen.sh ./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'` make dist - DISTNAME=`echo bitcoin-*.tar.gz` + SOURCEDIST=`echo bitcoin-*.tar.gz` + DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'` # Correct tar file order mkdir -p temp pushd temp - tar xf ../$DISTNAME - find bitcoin-* | sort | tar --no-recursion -c -T - | gzip -9n > ../$DISTNAME + tar xf ../$SOURCEDIST + find bitcoin-* | sort | tar --no-recursion -c -T - | gzip -9n > ../$SOURCEDIST popd ORIGPATH="$PATH" @@ -98,17 +99,23 @@ script: | export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH} mkdir -p distsrc-${i} cd distsrc-${i} - tar --strip-components=1 -xf ../$DISTNAME + INSTALLPATH=`pwd`/installed/${DISTNAME} + mkdir -p ${INSTALLPATH} + tar --strip-components=1 -xf ../$SOURCEDIST - ./configure --prefix=${BASEPREFIX}/${i} --bindir=${OUTDIR}/${i}/bin --includedir=${OUTDIR}/${i}/include --libdir=${OUTDIR}/${i}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} + ./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} make ${MAKEOPTS} make install-strip make deploy - ${WRAP_DIR}/dmg dmg Bitcoin-Qt.dmg ${OUTDIR}/Bitcoin-Qt.dmg - cd .. + ${WRAP_DIR}/dmg dmg Bitcoin-Qt.dmg ${OUTDIR}/${DISTNAME}-osx.dmg + + cd installed + find . -name "lib*.la" -delete + find . -name "lib*.a" -delete + rm -rf ${DISTNAME}/lib/pkgconfig + find . | sort | tar --no-recursion -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz + cd ../../ done mkdir -p $OUTDIR/src - mv $DISTNAME $OUTDIR/src - - # Delete unwanted stuff - find ${OUTDIR} -name "lib*.la" -delete + mv $SOURCEDIST $OUTDIR/src + mv ${OUTDIR}/${DISTNAME}-x86_64-*.tar.gz ${OUTDIR}/${DISTNAME}-osx64.tar.gz diff --git a/contrib/gitian-descriptors/gitian-win.yml b/contrib/gitian-descriptors/gitian-win.yml index 172807467a..97c823cde6 100644 --- a/contrib/gitian-descriptors/gitian-win.yml +++ b/contrib/gitian-descriptors/gitian-win.yml @@ -17,6 +17,7 @@ packages: - "mingw-w64" - "g++-mingw-w64" - "nsis" +- "zip" reference_datetime: "2013-06-01 00:00:00" remotes: - "url": "https://github.com/bitcoin/bitcoin.git" @@ -27,7 +28,7 @@ script: | HOSTS="x86_64-w64-mingw32 i686-w64-mingw32" CONFIGFLAGS="--enable-upnp-default" FAKETIME_HOST_PROGS="g++ ar ranlib nm windres strip" - FAKETIME_PROGS="date makensis" + FAKETIME_PROGS="date makensis zip" export QT_RCC_TEST=1 export GZIP="-9n" @@ -75,13 +76,14 @@ script: | ./autogen.sh ./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'` make dist - DISTNAME=`echo bitcoin-*.tar.gz` + SOURCEDIST=`echo bitcoin-*.tar.gz` + DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'` # Correct tar file order mkdir -p temp pushd temp - tar xf ../$DISTNAME - find bitcoin-* | sort | tar --no-recursion -c -T - | gzip -9n > ../$DISTNAME + tar xf ../$SOURCEDIST + find bitcoin-* | sort | tar --no-recursion -c -T - | gzip -9n > ../$SOURCEDIST popd ORIGPATH="$PATH" @@ -90,19 +92,24 @@ script: | export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH} mkdir -p distsrc-${i} cd distsrc-${i} - tar --strip-components=1 -xf ../$DISTNAME + INSTALLPATH=`pwd`/installed/${DISTNAME} + mkdir -p ${INSTALLPATH} + tar --strip-components=1 -xf ../$SOURCEDIST - ./configure --prefix=${BASEPREFIX}/${i} --bindir=${OUTDIR}/${i}/bin --includedir=${OUTDIR}/${i}/include --libdir=${OUTDIR}/${i}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} + ./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} make ${MAKEOPTS} make deploy make install-strip cp -f bitcoin-*setup*.exe $OUTDIR/ - cd .. + cd installed + mv ${DISTNAME}/bin/*.dll ${DISTNAME}/lib/ + find . -name "lib*.la" -delete + find . -name "lib*.a" -delete + rm -rf ${DISTNAME}/lib/pkgconfig + find . -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}.zip + cd ../.. done mkdir -p $OUTDIR/src - mv $DISTNAME $OUTDIR/src - mv ${OUTDIR}/x86_64-* ${OUTDIR}/64 - mv ${OUTDIR}/i686-* ${OUTDIR}/32 - - # Delete unwanted stuff - find ${OUTDIR} -name "lib*.la" -delete + mv $SOURCEDIST $OUTDIR/src + mv ${OUTDIR}/${DISTNAME}-x86_64-*.zip ${OUTDIR}/${DISTNAME}-win64.zip + mv ${OUTDIR}/${DISTNAME}-i686-*.zip ${OUTDIR}/${DISTNAME}-win32.zip From 2f327a3c870fd9657bfa45d2c7a74250498ee737 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 30 May 2014 19:17:55 -0400 Subject: [PATCH 1118/1288] build: add the deploydir target for gitian This is a helper target that stops just before the creation of the dmg. --- Makefile.am | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6bc0044313..e144fb11e1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -85,14 +85,30 @@ if BUILD_DARWIN $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2 +deploydir: $(OSX_DMG) else -$(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) - INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -verbose 2 - $(MKDIR_P) dist/.background - $(INSTALL) contrib/macdeploy/background.png dist/.background - $(INSTALL) contrib/macdeploy/DS_Store dist/.DS_Store - cd dist; $(LN_S) /Applications Applications - $(GENISOIMAGE) -no-cache-inodes -l -probe -V "Bitcoin-Qt" -no-pad -r -apple -o $@ dist +APP_DIST_DIR=$(top_builddir)/dist +APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/background.png $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications + +$(APP_DIST_DIR)/Applications: + @rm -f $@ + @cd $(@D); $(LN_S) /Applications $(@F) + +$(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt + +$(OSX_DMG): $(APP_DIST_EXTRAS) + $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "Bitcoin-Qt" -no-pad -r -apple -o $@ dist + +$(APP_DIST_DIR)/.background/background.png: + $(MKDIR_P) $(@D) + $(INSTALL) $(top_srcdir)/contrib/macdeploy/background.png $@ +$(APP_DIST_DIR)/.DS_Store: + $(INSTALL) $(top_srcdir)/contrib/macdeploy/DS_Store $@ + +$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING) + INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2 + +deploydir: $(APP_DIST_EXTRAS) endif if TARGET_DARWIN From d69ed2b2916754bdec7e47864f0ea1407c9eabb9 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 30 May 2014 19:22:16 -0400 Subject: [PATCH 1119/1288] build: Clean up the dmg layout --- contrib/macdeploy/DS_Store | Bin 15364 -> 15364 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/contrib/macdeploy/DS_Store b/contrib/macdeploy/DS_Store index b9a1e1486405136607eedf433af8d469ef7059b8..7527dc671fbe8730abc2497c2717778a19a024c6 100644 GIT binary patch literal 15364 zcmeHMU2Ggz6+Yuk+FjeR*LK>ZX&P3zKoQy9*~7X>B`Q<_y+^up&iy&(-t*19XU^RvBCWV?C5fU$6hdJh>BVCY;(ji>s7tmS0N0>T zZVA$>rCPPp@OF(>4GIB;fI>hapb$_9{5K$gZ#Gk?M{xC22q**;0!;)sK15NN7bM>n z+z%ai_*VdM9nC&Lj<5h8mAoMNw&3UiX+jlTsA}?xp$T=gN9DMJZM8-D*=dOJ^$f=3?aFr0aNQ#j)$Ya>cSSAy9ZRa(HViZ5YR+$-Hstcyuena(X0n=~9Hkp?f}(KKZGV zd-16+f90!Bf9?723kNkBBxs<+;TKTXC|)UVNN@EYieD=X;}4PkroY`iz3?|OFgSGZ zuDcH%zURojM~@y`j0}~`^6GM(S3T)g-FmUQZo|V?>+G7jY)@1xX5+Etdc~TnndOSJ zyx`eScypD{VeDXQtZ(7dw)L4-)BJ_n?e_dJpQzimZvgaDHLv12jWc$=0e;r3*G*^HE?#)NYL@KkDW~Xqp1Zaf>GyTZuJdr+X1#?9 zWM1d+$r}Q4pjaLB03-ge$Yxi@zy;2(ZL7cTII$!(LccQE2~#IuNB`H8|(jYYx!ess$*V(gIyHsctT-TH+wYT6s4P7eh3dm$SK{%bz=M=;kz{@Y>PJ>cJ<6=VxDGzI*J z{izZ>Q=&Oh8`c7;A<_~=cVV49ytlXv7tRWYhYJr#Avgw+uI7mt7F`$~2%(5J@3@W~ z4i6U=WMhavN+;LGnVKcWxoAJXG`PA}*a z`lLRi&+4BPHoAfk_JLp`!Sy+Cgs@t%Xo!HVMGU6=xX+r8tTCS0kXx-J5AJ8Zcif#j zF#Qkg0-pLZ@~VDt9r@HeIMaT}KM*2CAYYeq0rIb;j2A%>4g;XBD3J#{Opz#dxi4Yo zKt3w{8-)CK***lhSGGqX&q%odc}2?FZ;5Wo@e#<^Wmwq0L3CWsi*A9?sz7M}t0mW6 zed7*R(<6q|ekXPlmhQv={*cJ?iW4vDtvyTRM;MH0JM)MgVqE9hk8nHIz<@9kyvsh0 zf>=fRKBCWOAb^5;5buJzExMci=Vd*xTSc9t$kQm#p|BoLHt~~NkMKGVqj1(Nf%M-l z4{0Y2eh2f><a(XHkOQ&+_Sbo&N<3YoinjD!- z7Dto8oTfi-i2izr=l3o8(=rzO;QP0*)%fMHUH=02|TQ4UMFd7@DdaBjU1akc|I zJm`KA`U~{l2%vdV>0~j{57j_#ANT!+P-kuEW+JQEsB>Fy(7A&OaTU z;8+;=^f&bLKPv1)doT>DPz3suEot-t!nc#)-WBbgVh*h$GcO z@tSu-$IfzKwjyQt^8i36Ek7;lR zXI+l(j9RY+_A!q4%3cY=Jo?yQx`DHT^TMI*Kehf~zq0M74Eur1E^xf!z5fOp-$c=I zSebMACHKLHjFqx8B{ON6sgY58w3N%3Su2&dGpSN$$;_mT{OCx!WLV9&zFT-#dx@u~ z_{Ln_sk(l)$qVj5vbIMGH(Pbf@|uGkLg!FUus$aMptsR#yBz&KxGuC^j(Wm9ef>S} z`Q<3gm!m^lTd8ygm!lNljdD5MjYjfm+>O4}c{lp*_k0)qE#^y|cO$+#y$t{z;D!P2 z6wT2h3g=&SvTp}g4xJEm=3(3P^E;aww~zN< z-o>^#dT9drd5x;b$IH<2z+KGMp{La`&vR{heS2o|aae%0jybnGbW!~uCIk|uC}#%` zB8c+WN|8c9A@Ke}K+~t@ri$=cW-GhA=L{u^avp_=$88JltKi`$G2loD{0e8a53r0j zgEhapb$_9 bCy)5Kssx1QY`Qmk9g|T$FB3 literal 15364 zcmeHMU2Ggz6+Yu^8ar|9^-n_RUq*GQ3V3(NJKi7LNZG9IU`wr>){bk_lrTFpyB>Kx zvzZ;+2_e)VBwou~9}vwOs48kz0STfYORZE@f`})?Lsbw$6d@!k0TK_C@|~GGyK6gu ziV#BK9_h~c?%%oheD}_|cXo+LDQ{Y1L@E(=Be72Q;&BJzdQJzVOO*6LE9g&N1?c5U zqwX|=1FdC&WI!??8ITM}1|$Rj3k=}QX6Zf_Y59~4NCqSWEe1F~s7S0!LhnR63>|oc zp8(Ja6o&$wWB{!ST@rdH(x`zbQCH}wt0F!zl&Cw(Rne{_^iHIs?xcv14@Hcuh%Xc+ z93A%6usJEENXw^WKr(QUf#};kUD<9nD)r9qcTM}5(sd|t_?{!(klu?=Ij-exm%UBb zYCgTV=4~%JmR&LYXF?np!Dh2;_+ia?BUnRCh?hLC4t!Cxe#)_ewM)rU*RExAxluJ+ z(65iG*9rw~R2|m~*RS_LlDpj}9!h^|Zprw<^)EiV6U|u>?>!yg=fjtgS19e6Tf%|F zH=`dQH0>A3{@8_{qsMxW_w^?S28V`EoczeCkKQ|Q{{s(RN)A;FbG_!XSJPhI^UL*3 z`%<#M3IFCz&pq$kTaLZG;s7r?pSM>6`%1vzQgU!#&nIo`v+bg#s|~anZWn~sKkeJL z`*h8Btc7Z|X$LDEc=cj9Xkc&5yHyYNdEkXc;COCx+4h^z&(w{IU0-m^UJ!U2d(6*o z7&ZHB-7%W0hVL70%`RUJjW0F~({XDfXWol=>lrDnL};Y+r~q+Yva8i>B&s56f$pTz zvoO&04p-ob@O!lE1g7V>sV5Hp*mL{lPkuP}Nji+ixxO|F>4sa2Eq@rDzkT!eLfqj4 z2+?tI0K}zqEZrW54oqs$zlEXqQs-1agCPU#7!$X20zr8p@%z@h&pwQjm|y;m;By>vA$tA>=04gv^~noO?Bhx9 zK6%Hf_R%M3_yCUq*|Y(s>sSHCX)wPLvVJf1(&OQ}FyjH3Z_*m>4RbUD=1+&iWq7z2 zw|kixA|*p~0`ok^JBrhi>$&zwX_Xy?bkoP_3|8_pSl27`Rr&_KNZ+H^>F4wtdS5xB z3@P_34=9f)8KtO9D$~ki$^~UvSy5IKQ;AY&fx6ycN7->!Jx`i*^aubX&c{I{ z&TmB3*jSN`C1?u?!_g@&LkB@dxI!q}BMRmo+oJQAL-U;H$(+6UtFK)Kd>Dy+o6ySV zX2!DFRPO9pA*G)ipH59o7iUwmT6tn(Rx1|E`dB=s5suqUe>lVAhZfmt=;I;ybpzXl zgDu+)_dRf&uNhm8i#(cz^-bSw)m;uMfr;`VQP<`-&F@MWL6}44vk2RBNGnJdQh*fu zy83-Ig2eg1T;S2$`S;(9{#=ObpR@+|)PMVT_%i|$kM$C4zlQWfNj}-T1KUjEu z+4nz-I`;iB9Fywe;!NC@c2B-@AKGy~T!Zhv@WCGe<2A@l6le3(kSDUDM+=_!9at_xslX!-l*fme8w=u~t^GXjodlV&<}WZNkjwja*f$ z+PbOf`Qq3_PR|wc)oeC9r3q<)D4*4)Om8D?G#YiApQ)zdS{3g~+P4iWwe35B9rqZU z((JHP+nA>5W42*fQ<+T;xtVYWWU%g;aJ@4Xad2M_+N(_T9n7605bq@xe!n;ZJ;x40 zI0F4u;LZrtr4qdo?sOcxz~cfB09yicq?r+zBh8Y)D)4gxYrt`IQFigZiShwp-ghj6 zyLg{PIY*t>1djLbolesw^kcsW?XO_Ja47mu%{ktKY`cYFKgK-mBoeKuhL+Xss%4v%s$rPARmm0$dNEt97+I@e#*44Dz`wt5tbI1} z*f(3^QqtZj2ktJki#bCO?Y9-jq0JNPVy{L_2azP`L&PlsLOzIVEjr7=2YvbQhopl|26$V!n6 z+~o`)7P6>(Z=Xe+`Un62hmGVzG9VeaI~h`BK9fzHmRv7-br37T}W5JCQ~S Date: Tue, 25 Nov 2014 18:37:34 -0500 Subject: [PATCH 1120/1288] release: update docs to reflect new layout - Split linux32/linux64 releases - Split win32/win64 zips - Post-processing should no longer be required. The deterministic outputs are ready for consumption. --- doc/release-process.md | 46 +++++++++--------------------------------- 1 file changed, 10 insertions(+), 36 deletions(-) diff --git a/doc/release-process.md b/doc/release-process.md index c6a7266ef1..df27c5829c 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -54,48 +54,22 @@ Release Process ./bin/gbuild --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml ./bin/gsign --signer $SIGNER --release ${VERSION}-linux --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml - pushd build/out - zip -r bitcoin-${VERSION}-linux-gitian.zip * - mv bitcoin-${VERSION}-linux-gitian.zip ../../../ - popd + mv build/out/bitcoin-*.tar.gz build/out/src/bitcoin-*.tar.gz ../ ./bin/gbuild --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-win.yml ./bin/gsign --signer $SIGNER --release ${VERSION}-win --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-win.yml - pushd build/out - zip -r bitcoin-${VERSION}-win-gitian.zip * - mv bitcoin-${VERSION}-win-gitian.zip ../../../ - popd - ./bin/gbuild --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml - ./bin/gsign --signer $SIGNER --release ${VERSION}-osx --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml - pushd build/out - mv Bitcoin-Qt.dmg ../../../ - popd + mv build/out/bitcoin-*.zip build/out/bitcoin-*.exe ../ + ./bin/gbuild --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml + ./bin/gsign --signer $SIGNER --release ${VERSION}-osx --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml + mv build/out/bitcoin-*.tar.gz build/out/bitcoin-*.dmg ../ popd Build output expected: - 1. linux 32-bit and 64-bit binaries + source (bitcoin-${VERSION}-linux-gitian.zip) - 2. windows 32-bit and 64-bit binaries + installer + source (bitcoin-${VERSION}-win-gitian.zip) - 3. OSX installer (Bitcoin-Qt.dmg) - 4. Gitian signatures (in gitian.sigs/${VERSION}-/(your gitian key)/ - -repackage gitian builds for release as stand-alone zip/tar/installer exe - -**Linux .tar.gz:** - - unzip bitcoin-${VERSION}-linux-gitian.zip -d bitcoin-${VERSION}-linux - tar czvf bitcoin-${VERSION}-linux.tar.gz bitcoin-${VERSION}-linux - rm -rf bitcoin-${VERSION}-linux - -**Windows .zip and setup.exe:** - - unzip bitcoin-${VERSION}-win-gitian.zip -d bitcoin-${VERSION}-win - mv bitcoin-${VERSION}-win/bitcoin-*-setup.exe . - zip -r bitcoin-${VERSION}-win.zip bitcoin-${VERSION}-win - rm -rf bitcoin-${VERSION}-win - -**Mac OS X .dmg:** - - mv Bitcoin-Qt.dmg bitcoin-${VERSION}-osx.dmg + 1. source tarball (bitcoin-${VERSION}.tar.gz) + 2. linux 32-bit and 64-bit binaries dist tarballs (bitcoin-${VERSION}-linux[32|64].tar.gz) + 3. windows 32-bit and 64-bit installers and dist zips (bitcoin-${VERSION}-win[32|64]-setup.exe, bitcoin-${VERSION}-win[32|64].zip) + 4. OSX installer (bitcoin-${VERSION}-osx.dmg) + 5. Gitian signatures (in gitian.sigs/${VERSION}-/(your gitian key)/ ###Next steps: From 914868a05dfcae0f766283e0065aa36762cc5abe Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 21 Nov 2014 19:26:45 -0500 Subject: [PATCH 1121/1288] build: add a deterministic dmg signer --- Makefile.am | 4 +- .../gitian-descriptors/gitian-osx-signer.yml | 37 +++++++++++++ contrib/gitian-descriptors/gitian-osx.yml | 15 +++++- contrib/macdeploy/detached-sig-apply.sh | 53 +++++++++++++++++++ contrib/macdeploy/detached-sig-create.sh | 46 ++++++++++++++++ 5 files changed, 153 insertions(+), 2 deletions(-) create mode 100644 contrib/gitian-descriptors/gitian-osx-signer.yml create mode 100755 contrib/macdeploy/detached-sig-apply.sh create mode 100755 contrib/macdeploy/detached-sig-create.sh diff --git a/Makefile.am b/Makefile.am index e144fb11e1..b51f477b78 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,7 +26,9 @@ WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \ OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \ $(top_srcdir)/contrib/macdeploy/background.png \ - $(top_srcdir)/contrib/macdeploy/DS_Store + $(top_srcdir)/contrib/macdeploy/DS_Store \ + $(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \ + $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \ leveldb_baseline.info test_bitcoin_filtered.info total_coverage.info \ diff --git a/contrib/gitian-descriptors/gitian-osx-signer.yml b/contrib/gitian-descriptors/gitian-osx-signer.yml new file mode 100644 index 0000000000..db9b4af93d --- /dev/null +++ b/contrib/gitian-descriptors/gitian-osx-signer.yml @@ -0,0 +1,37 @@ +--- +name: "bitcoin-dmg-signer" +suites: +- "precise" +architectures: +- "amd64" +packages: +- "libc6:i386" +- "faketime" +reference_datetime: "2013-06-01 00:00:00" +remotes: [] +files: +- "bitcoin-0.9.99-osx-unsigned.tar.gz" +- "signature.tar.gz" +script: | + WRAP_DIR=$HOME/wrapped + mkdir -p ${WRAP_DIR} + export PATH=`pwd`:$PATH + FAKETIME_PROGS="dmg genisoimage" + + # Create global faketime wrappers + for prog in ${FAKETIME_PROGS}; do + echo '#!/bin/bash' > ${WRAP_DIR}/${prog} + echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog} + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} + echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${prog} + chmod +x ${WRAP_DIR}/${prog} + done + + UNSIGNED=`echo bitcoin-*.tar.gz` + SIGNED=`echo ${UNSIGNED} | sed 's/.tar.*//' | sed 's/-unsigned//'`.dmg + + tar -xf ${UNSIGNED} + ./detached-sig-apply.sh ${UNSIGNED} signature.tar.gz + ${WRAP_DIR}/genisoimage -no-cache-inodes -D -l -probe -V "Bitcoin-Qt" -no-pad -r -apple -o uncompressed.dmg signed-app + ${WRAP_DIR}/dmg dmg uncompressed.dmg ${OUTDIR}/${SIGNED} diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml index cbe28e4f34..eb6df2096e 100644 --- a/contrib/gitian-descriptors/gitian-osx.yml +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -106,8 +106,21 @@ script: | ./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} make ${MAKEOPTS} make install-strip + + make deploydir + mkdir -p unsigned-app-${i} + cp contrib/macdeploy/detached-sig-apply.sh unsigned-app-${i} + cp contrib/macdeploy/detached-sig-create.sh unsigned-app-${i} + cp ${BASEPREFIX}/${i}/native/bin/dmg ${BASEPREFIX}/${i}/native/bin/genisoimage unsigned-app-${i} + cp ${BASEPREFIX}/${i}/native/bin/${i}-codesign_allocate unsigned-app-${i}/codesign_allocate + cp ${BASEPREFIX}/${i}/native/bin/${i}-pagestuff unsigned-app-${i}/pagestuff + mv dist unsigned-app-${i} + pushd unsigned-app-${i} + find . | sort | tar --no-recursion -czf ${OUTDIR}/${DISTNAME}-osx-unsigned.tar.gz -T - + popd + make deploy - ${WRAP_DIR}/dmg dmg Bitcoin-Qt.dmg ${OUTDIR}/${DISTNAME}-osx.dmg + ${WRAP_DIR}/dmg dmg Bitcoin-Qt.dmg ${OUTDIR}/${DISTNAME}-osx-unsigned.dmg cd installed find . -name "lib*.la" -delete diff --git a/contrib/macdeploy/detached-sig-apply.sh b/contrib/macdeploy/detached-sig-apply.sh new file mode 100755 index 0000000000..7b3eb1b197 --- /dev/null +++ b/contrib/macdeploy/detached-sig-apply.sh @@ -0,0 +1,53 @@ +#!/bin/sh +set -e + +UNSIGNED=$1 +SIGNATURE=$2 +ARCH=x86_64 +ROOTDIR=dist +BUNDLE=${ROOTDIR}/Bitcoin-Qt.app +TEMPDIR=signed.temp +OUTDIR=signed-app + +if [ -z "$UNSIGNED" ]; then + echo "usage: $0 " + exit 1 +fi + +if [ -z "$SIGNATURE" ]; then + echo "usage: $0 " + exit 1 +fi + +rm -rf ${TEMPDIR} && mkdir -p ${TEMPDIR} +tar -C ${TEMPDIR} -xf ${UNSIGNED} +tar -C ${TEMPDIR} -xf ${SIGNATURE} + +if [ -z "${PAGESTUFF}" ]; then + PAGESTUFF=${TEMPDIR}/pagestuff +fi + +if [ -z "${CODESIGN_ALLOCATE}" ]; then + CODESIGN_ALLOCATE=${TEMPDIR}/codesign_allocate +fi + +for i in `find ${TEMPDIR} -name "*.sign"`; do + SIZE=`stat -c %s ${i}` + TARGET_FILE=`echo ${i} | sed 's/\.sign$//'` + + echo "Allocating space for the signature of size ${SIZE} in ${TARGET_FILE}" + ${CODESIGN_ALLOCATE} -i ${TARGET_FILE} -a ${ARCH} ${SIZE} -o ${i}.tmp + + OFFSET=`${PAGESTUFF} ${i}.tmp -p | tail -2 | grep offset | sed 's/[^0-9]*//g'` + if [ -z ${QUIET} ]; then + echo "Attaching signature at offset ${OFFSET}" + fi + + dd if=$i of=${i}.tmp bs=1 seek=${OFFSET} count=${SIZE} 2>/dev/null + mv ${i}.tmp ${TARGET_FILE} + rm ${i} + echo "Success." +done +mv ${TEMPDIR}/${ROOTDIR} ${OUTDIR} +rm -rf ${TEMPDIR} +echo "Signed: ${OUTDIR}" diff --git a/contrib/macdeploy/detached-sig-create.sh b/contrib/macdeploy/detached-sig-create.sh new file mode 100755 index 0000000000..aff4f08da8 --- /dev/null +++ b/contrib/macdeploy/detached-sig-create.sh @@ -0,0 +1,46 @@ +#!/bin/sh +set -e + +ROOTDIR=dist +BUNDLE=${ROOTDIR}/Bitcoin-Qt.app +CODESIGN=codesign +TEMPDIR=sign.temp +TEMPLIST=${TEMPDIR}/signatures.txt +OUT=signature.tar.gz + +if [ ! -n "$1" ]; then + echo "usage: $0 " + echo "example: $0 -s MyIdentity" + exit 1 +fi + +rm -rf ${TEMPDIR} ${TEMPLIST} +mkdir -p ${TEMPDIR} + +${CODESIGN} -f --file-list ${TEMPLIST} "$@" "${BUNDLE}" + +for i in `grep -v CodeResources ${TEMPLIST}`; do + TARGETFILE="${BUNDLE}/`echo ${i} | sed "s|.*${BUNDLE}/||"`" + SIZE=`pagestuff $i -p | tail -2 | grep size | sed 's/[^0-9]*//g'` + OFFSET=`pagestuff $i -p | tail -2 | grep offset | sed 's/[^0-9]*//g'` + SIGNFILE="${TEMPDIR}/${TARGETFILE}.sign" + DIRNAME="`dirname ${SIGNFILE}`" + mkdir -p "${DIRNAME}" + echo "Adding detached signature for: ${TARGETFILE}. Size: ${SIZE}. Offset: ${OFFSET}" + dd if=$i of=${SIGNFILE} bs=1 skip=${OFFSET} count=${SIZE} 2>/dev/null +done + +for i in `grep CodeResources ${TEMPLIST}`; do + TARGETFILE="${BUNDLE}/`echo ${i} | sed "s|.*${BUNDLE}/||"`" + RESOURCE="${TEMPDIR}/${TARGETFILE}" + DIRNAME="`dirname "${RESOURCE}"`" + mkdir -p "${DIRNAME}" + echo "Adding resource for: "${TARGETFILE}"" + cp "${i}" "${RESOURCE}" +done + +rm ${TEMPLIST} + +tar -C ${TEMPDIR} -czf ${OUT} . +rm -rf ${TEMPDIR} +echo "Created ${OUT}" From 7a9cf80b19f3facabe53bf5a60fd813d7d63a6ff Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 25 Nov 2014 19:23:18 -0500 Subject: [PATCH 1122/1288] docs: add/update docs for osx dmg signing --- doc/README_osx.txt | 15 +++++++++++++++ doc/release-process.md | 34 +++++++++++++++++++++++++++------- 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/doc/README_osx.txt b/doc/README_osx.txt index 8831649bd8..d56234f7d9 100644 --- a/doc/README_osx.txt +++ b/doc/README_osx.txt @@ -65,3 +65,18 @@ Background images and other features can be added to DMG files by inserting a .DS_Store before creation. The easiest way to create this file is to build a DMG without one, move it to a device running OSX, customize the layout, then grab the .DS_Store file for later use. That is the approach taken here. + +As of OSX Mavericks (10.9), using an Apple-blessed key to sign binaries is a +requirement in order to satisfy the new Gatekeeper requirements. Because this +private key cannot be shared, we'll have to be a bit creative in order for the +build process to remain somewhat deterministic. Here's how it works: + +- Builders use gitian to create an unsigned release. This outputs an unsigned + dmg which users may choose to bless and run. It also outputs an unsigned app + structure in the form of a tarball, which also contains all of the tools + that have been previously (deterministically) built in order to create a + final dmg. +- The Apple keyholder uses this unsigned app to create a detached signature, + using the script that is also included there. +- Builders feed the unsigned app + detached signature back into gitian. It + uses the pre-built tools to recombine the pieces into a deterministic dmg. diff --git a/doc/release-process.md b/doc/release-process.md index df27c5829c..a16d4ace4a 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -59,17 +59,18 @@ Release Process ./bin/gsign --signer $SIGNER --release ${VERSION}-win --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-win.yml mv build/out/bitcoin-*.zip build/out/bitcoin-*.exe ../ ./bin/gbuild --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml - ./bin/gsign --signer $SIGNER --release ${VERSION}-osx --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml + ./bin/gsign --signer $SIGNER --release ${VERSION}-osx-unsigned --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml + mv build/out/bitcoin-*-unsigned.tar.gz inputs mv build/out/bitcoin-*.tar.gz build/out/bitcoin-*.dmg ../ popd - +bitcoin-0.9.99-osx-unsigned.tar.gz Build output expected: 1. source tarball (bitcoin-${VERSION}.tar.gz) 2. linux 32-bit and 64-bit binaries dist tarballs (bitcoin-${VERSION}-linux[32|64].tar.gz) 3. windows 32-bit and 64-bit installers and dist zips (bitcoin-${VERSION}-win[32|64]-setup.exe, bitcoin-${VERSION}-win[32|64].zip) - 4. OSX installer (bitcoin-${VERSION}-osx.dmg) - 5. Gitian signatures (in gitian.sigs/${VERSION}-/(your gitian key)/ + 4. OSX unsigned installer (bitcoin-${VERSION}-osx-unsigned.dmg) + 5. Gitian signatures (in gitian.sigs/${VERSION}-/(your gitian key)/ ###Next steps: @@ -78,7 +79,28 @@ Commit your signature to gitian.sigs: pushd gitian.sigs git add ${VERSION}-linux/${SIGNER} git add ${VERSION}-win/${SIGNER} - git add ${VERSION}-osx/${SIGNER} + git add ${VERSION}-osx-unsigned/${SIGNER} + git commit -a + git push # Assuming you can push to the gitian.sigs tree + popd + +Wait for OSX detached signature: + Once the OSX build has 3 matching signatures, Gavin will sign it with the apple App-Store key. + He will then upload a detached signature to be combined with the unsigned app to create a signed binary. + +Create the signed OSX binary: + pushd ./gitian-builder + # Fetch the signature as instructed by Gavin + cp signature.tar.gz inputs/ + ./bin/gbuild -i ../bitcoin/contrib/gitian-descriptors/gitian-osx-signer.yml + ./bin/gsign --signer $SIGNER --release ${VERSION}-osx-signed --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-osx-signer.yml + mv build/out/bitcoin-${VERSION}-osx.dmg ../ + popd + +Commit your signature for the signed OSX binary: + + pushd gitian.sigs + git add ${VERSION}-osx-signed/${SIGNER} git commit -a git push # Assuming you can push to the gitian.sigs tree popd @@ -91,8 +113,6 @@ Commit your signature to gitian.sigs: - Code-sign Windows -setup.exe (in a Windows virtual machine using signtool) - - Code-sign MacOSX .dmg - Note: only Gavin has the code-signing keys currently. - Create `SHA256SUMS.asc` for the builds, and GPG-sign it: From c8ed6130a4f7cfae897220ec093b440d21727cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jan=C3=ADk?= Date: Wed, 26 Nov 2014 08:19:07 +0100 Subject: [PATCH 1123/1288] Include missing config/bitcoin-config.h. --- src/compat.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compat.h b/src/compat.h index 80e53fe55e..dffd4ecf52 100644 --- a/src/compat.h +++ b/src/compat.h @@ -6,6 +6,10 @@ #ifndef BITCOIN_COMPAT_H #define BITCOIN_COMPAT_H +#if defined(HAVE_CONFIG_H) +#include "config/bitcoin-config.h" +#endif + #ifdef WIN32 #ifdef _WIN32_WINNT #undef _WIN32_WINNT From a53d16ac0c0f16b377cd02aaa84f1b9b59822ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jan=C3=ADk?= Date: Wed, 26 Nov 2014 10:37:49 +0100 Subject: [PATCH 1124/1288] Use complete path to include bitcoin-config.h. --- src/netbase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netbase.cpp b/src/netbase.cpp index ea05b8766f..aca5a107fe 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -4,7 +4,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifdef HAVE_CONFIG_H -#include "bitcoin-config.h" +#include "config/bitcoin-config.h" #endif #include "netbase.h" From 210eba9fdb9b4ed28ab0b9dcdbcaf45209a143b4 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Thu, 20 Nov 2014 14:04:16 +0100 Subject: [PATCH 1125/1288] [REST] fix headersonly flag for BINARY responses --- src/rest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rest.cpp b/src/rest.cpp index 122b361719..1aa864a306 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -100,7 +100,7 @@ static bool rest_block(AcceptedConnection *conn, switch (rf) { case RF_BINARY: { string binaryBlock = ssBlock.str(); - conn->stream() << HTTPReply(HTTP_OK, binaryBlock, fRun, true, "application/octet-stream") << binaryBlock << std::flush; + conn->stream() << HTTPReplyHeader(HTTP_OK, fRun, binaryBlock.size(), "application/octet-stream") << binaryBlock << std::flush; return true; } @@ -148,7 +148,7 @@ static bool rest_tx(AcceptedConnection *conn, switch (rf) { case RF_BINARY: { string binaryTx = ssTx.str(); - conn->stream() << HTTPReply(HTTP_OK, binaryTx, fRun, true, "application/octet-stream") << binaryTx << std::flush; + conn->stream() << HTTPReplyHeader(HTTP_OK, fRun, binaryTx.size(), "application/octet-stream") << binaryTx << std::flush; return true; } From 8ba38aba42c3b65f1ad61699197566d99d2b761a Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 26 Nov 2014 13:47:22 +0100 Subject: [PATCH 1126/1288] qt: Update translations from transifex --- src/qt/locale/bitcoin_ach.ts | 2 +- src/qt/locale/bitcoin_af_ZA.ts | 6 +- src/qt/locale/bitcoin_ar.ts | 14 +- src/qt/locale/bitcoin_be_BY.ts | 6 +- src/qt/locale/bitcoin_bg.ts | 10 +- src/qt/locale/bitcoin_bs.ts | 2 +- src/qt/locale/bitcoin_ca.ts | 30 +-- src/qt/locale/bitcoin_ca@valencia.ts | 30 +-- src/qt/locale/bitcoin_ca_ES.ts | 30 +-- src/qt/locale/bitcoin_cmn.ts | 2 +- src/qt/locale/bitcoin_cs.ts | 30 +-- src/qt/locale/bitcoin_cy.ts | 6 +- src/qt/locale/bitcoin_da.ts | 146 ++++++++--- src/qt/locale/bitcoin_de.ts | 152 ++++++++--- src/qt/locale/bitcoin_el_GR.ts | 14 +- src/qt/locale/bitcoin_eo.ts | 14 +- src/qt/locale/bitcoin_es.ts | 96 ++++--- src/qt/locale/bitcoin_es_CL.ts | 10 +- src/qt/locale/bitcoin_es_DO.ts | 22 +- src/qt/locale/bitcoin_es_MX.ts | 6 +- src/qt/locale/bitcoin_es_UY.ts | 6 +- src/qt/locale/bitcoin_et.ts | 10 +- src/qt/locale/bitcoin_eu_ES.ts | 6 +- src/qt/locale/bitcoin_fa.ts | 14 +- src/qt/locale/bitcoin_fa_IR.ts | 6 +- src/qt/locale/bitcoin_fi.ts | 26 +- src/qt/locale/bitcoin_fr.ts | 330 +++++++++++++++++++++--- src/qt/locale/bitcoin_fr_CA.ts | 6 +- src/qt/locale/bitcoin_gl.ts | 14 +- src/qt/locale/bitcoin_gu_IN.ts | 2 +- src/qt/locale/bitcoin_he.ts | 26 +- src/qt/locale/bitcoin_hi_IN.ts | 6 +- src/qt/locale/bitcoin_hr.ts | 10 +- src/qt/locale/bitcoin_hu.ts | 22 +- src/qt/locale/bitcoin_id_ID.ts | 26 +- src/qt/locale/bitcoin_it.ts | 44 ++-- src/qt/locale/bitcoin_ja.ts | 14 +- src/qt/locale/bitcoin_ka.ts | 26 +- src/qt/locale/bitcoin_kk_KZ.ts | 6 +- src/qt/locale/bitcoin_ko_KR.ts | 34 +-- src/qt/locale/bitcoin_ky.ts | 6 +- src/qt/locale/bitcoin_la.ts | 14 +- src/qt/locale/bitcoin_lt.ts | 10 +- src/qt/locale/bitcoin_lv_LV.ts | 32 +-- src/qt/locale/bitcoin_mn.ts | 10 +- src/qt/locale/bitcoin_ms_MY.ts | 6 +- src/qt/locale/bitcoin_nb.ts | 146 ++++++++--- src/qt/locale/bitcoin_nl.ts | 34 +-- src/qt/locale/bitcoin_pam.ts | 10 +- src/qt/locale/bitcoin_pl.ts | 18 +- src/qt/locale/bitcoin_pt_BR.ts | 44 ++-- src/qt/locale/bitcoin_pt_PT.ts | 26 +- src/qt/locale/bitcoin_ro_RO.ts | 22 +- src/qt/locale/bitcoin_ru.ts | 278 +++++++++++++++++++-- src/qt/locale/bitcoin_sah.ts | 2 +- src/qt/locale/bitcoin_sk.ts | 46 ++-- src/qt/locale/bitcoin_sl_SI.ts | 22 +- src/qt/locale/bitcoin_sq.ts | 6 +- src/qt/locale/bitcoin_sr.ts | 6 +- src/qt/locale/bitcoin_sv.ts | 360 +++++++++++++++++++++++++-- src/qt/locale/bitcoin_th_TH.ts | 6 +- src/qt/locale/bitcoin_tr.ts | 146 ++++++++--- src/qt/locale/bitcoin_uk.ts | 50 +--- src/qt/locale/bitcoin_ur_PK.ts | 6 +- src/qt/locale/bitcoin_uz@Cyrl.ts | 26 +- src/qt/locale/bitcoin_vi.ts | 6 +- src/qt/locale/bitcoin_vi_VN.ts | 2 +- src/qt/locale/bitcoin_zh_CN.ts | 26 +- src/qt/locale/bitcoin_zh_HK.ts | 2 +- src/qt/locale/bitcoin_zh_TW.ts | 42 +--- 70 files changed, 1586 insertions(+), 1086 deletions(-) diff --git a/src/qt/locale/bitcoin_ach.ts b/src/qt/locale/bitcoin_ach.ts index 835ddb8eaa..ddb9fb85ce 100644 --- a/src/qt/locale/bitcoin_ach.ts +++ b/src/qt/locale/bitcoin_ach.ts @@ -1,4 +1,4 @@ - + AddressBookPage diff --git a/src/qt/locale/bitcoin_af_ZA.ts b/src/qt/locale/bitcoin_af_ZA.ts index 851c261d0b..c369c3c68f 100644 --- a/src/qt/locale/bitcoin_af_ZA.ts +++ b/src/qt/locale/bitcoin_af_ZA.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -200,10 +200,6 @@ Amount Bedrag - - Address - Adres - Date Datum diff --git a/src/qt/locale/bitcoin_ar.ts b/src/qt/locale/bitcoin_ar.ts index f05270a9fa..101f51f8dc 100644 --- a/src/qt/locale/bitcoin_ar.ts +++ b/src/qt/locale/bitcoin_ar.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -456,10 +456,6 @@ Amount المبلغ - - Address - عنوان - Date التاريخ @@ -524,6 +520,10 @@ high عالي + + medium-high + متوسط-مرتفع + low منخفض @@ -682,10 +682,6 @@ &Main &الرئيسي - - Pay transaction &fee - ادفع &رسوم المعاملة - MB م ب diff --git a/src/qt/locale/bitcoin_be_BY.ts b/src/qt/locale/bitcoin_be_BY.ts index f4b82ce2cc..e63628396c 100644 --- a/src/qt/locale/bitcoin_be_BY.ts +++ b/src/qt/locale/bitcoin_be_BY.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -352,10 +352,6 @@ Address: %4 Amount Колькасць - - Address - Адрас - Date Дата diff --git a/src/qt/locale/bitcoin_bg.ts b/src/qt/locale/bitcoin_bg.ts index a1f3dd092a..3095aa1172 100644 --- a/src/qt/locale/bitcoin_bg.ts +++ b/src/qt/locale/bitcoin_bg.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -364,10 +364,6 @@ Amount Сума - - Address - Адрес - Date Дата @@ -510,10 +506,6 @@ &Main &Основни - - Pay transaction &fee - &Такса за изходяща трансакция - &Start Bitcoin on system login &Пускане на Биткоин при вход в системата diff --git a/src/qt/locale/bitcoin_bs.ts b/src/qt/locale/bitcoin_bs.ts index fc5e6d270e..86526022fe 100644 --- a/src/qt/locale/bitcoin_bs.ts +++ b/src/qt/locale/bitcoin_bs.ts @@ -1,4 +1,4 @@ - + AddressBookPage diff --git a/src/qt/locale/bitcoin_ca.ts b/src/qt/locale/bitcoin_ca.ts index 1e19a3ff18..8f06ac3aa7 100644 --- a/src/qt/locale/bitcoin_ca.ts +++ b/src/qt/locale/bitcoin_ca.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -516,10 +516,6 @@ Address: %4 CoinControlDialog - - Coin Control Address Selection - Selecció de l'adreça de control de monedes - Quantity: Quantitat: @@ -568,10 +564,6 @@ Address: %4 Amount Quantitat - - Address - Adreça - Date Data @@ -938,14 +930,6 @@ Address: %4 &Main &Principal - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Comissió opcional de transacció per kB que ajuda a assegurar que les transaccions es processen ràpidament. La majoria de transaccions són d'1 kB. - - - Pay transaction &fee - Paga &comissió de transacció - Automatically start Bitcoin after logging in to the system. Inicia automàticament el Bitcoin després de l'inici de sessió del sistema. @@ -974,14 +958,6 @@ Address: %4 Allow incoming connections Permet connexions entrants - - Connect to the Bitcoin network through a SOCKS proxy. - Connecta a la xarxa Bitcoin a través d'un proxy SOCKS. - - - &Connect through SOCKS proxy (default proxy): - &Connecta a través d'un proxy SOCKS (proxy per defecte): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Adreça IP del proxy (p. ex. IPv4: 127.0.0.1 / IPv6: ::1) @@ -2929,10 +2905,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) Crea fitxers nous amb els permisos per defecte del sistema, en comptes de l'umask 077 (només efectiu amb la funcionalitat de moneder inhabilitada) - - Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. - Distribuït sota la llicència de programari MIT/X11. Vegeu el fitxer acompanyant COPYING o <http://www.opensource.org/licenses/mit-license.php>. - Error: Listening for incoming connections failed (listen returned error %s) Error: ha fallat escoltar les connexions entrants (l'escoltament ha retornat l'error %s) diff --git a/src/qt/locale/bitcoin_ca@valencia.ts b/src/qt/locale/bitcoin_ca@valencia.ts index 9d49da2dbd..d3bf33ebfb 100644 --- a/src/qt/locale/bitcoin_ca@valencia.ts +++ b/src/qt/locale/bitcoin_ca@valencia.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -496,10 +496,6 @@ Address: %4 CoinControlDialog - - Coin Control Address Selection - Selecció de l'adreça de control de monedes - Quantity: Quantitat: @@ -548,10 +544,6 @@ Address: %4 Amount Quantitat - - Address - Adreça - Date Data @@ -918,14 +910,6 @@ Address: %4 &Main &Principal - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Comissió opcional de transacció per kB que ajuda a assegurar que les transaccions es processen ràpidament. La majoria de transaccions són d'1 kB. - - - Pay transaction &fee - Paga &comissió de transacció - Automatically start Bitcoin after logging in to the system. Inicia automàticament el Bitcoin després de l'inici de sessió del sistema. @@ -954,14 +938,6 @@ Address: %4 Allow incoming connections Permet connexions entrants - - Connect to the Bitcoin network through a SOCKS proxy. - Connecta a la xarxa Bitcoin a través d'un proxy SOCKS. - - - &Connect through SOCKS proxy (default proxy): - &Connecta a través d'un proxy SOCKS (proxy per defecte): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Adreça IP del proxy (p. ex. IPv4: 127.0.0.1 / IPv6: ::1) @@ -2893,10 +2869,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) Crea fitxers nous amb els permisos per defecte del sistema, en comptes de l'umask 077 (només efectiu amb la funcionalitat de moneder inhabilitada) - - Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. - Distribuït sota la llicència de programari MIT/X11. Vegeu el fitxer acompanyant COPYING o <http://www.opensource.org/licenses/mit-license.php>. - Error: Listening for incoming connections failed (listen returned error %s) Error: ha fallat escoltar les connexions entrants (l'escoltament ha retornat l'error %s) diff --git a/src/qt/locale/bitcoin_ca_ES.ts b/src/qt/locale/bitcoin_ca_ES.ts index 5fa69e798d..60c6fa30f4 100644 --- a/src/qt/locale/bitcoin_ca_ES.ts +++ b/src/qt/locale/bitcoin_ca_ES.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -516,10 +516,6 @@ Address: %4 CoinControlDialog - - Coin Control Address Selection - Selecció de l'adreça de control de monedes - Quantity: Quantitat: @@ -568,10 +564,6 @@ Address: %4 Amount Quantitat - - Address - Adreça - Date Data @@ -938,14 +930,6 @@ Address: %4 &Main &Principal - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Comissió opcional de transacció per kB que ajuda a assegurar que les transaccions es processen ràpidament. La majoria de transaccions són d'1 kB. - - - Pay transaction &fee - Paga &comissió de transacció - Automatically start Bitcoin after logging in to the system. Inicia automàticament el Bitcoin després de l'inici de sessió del sistema. @@ -974,14 +958,6 @@ Address: %4 Allow incoming connections Permet connexions entrants - - Connect to the Bitcoin network through a SOCKS proxy. - Connecta a la xarxa Bitcoin a través d'un proxy SOCKS. - - - &Connect through SOCKS proxy (default proxy): - &Connecta a través d'un proxy SOCKS (proxy per defecte): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Adreça IP del proxy (p. ex. IPv4: 127.0.0.1 / IPv6: ::1) @@ -2929,10 +2905,6 @@ per exemple: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) Crea fitxers nous amb els permisos per defecte del sistema, en comptes de l'umask 077 (només efectiu amb la funcionalitat de moneder inhabilitada) - - Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. - Distribuït sota la llicència de programari MIT/X11. Vegeu el fitxer acompanyant COPYING o <http://www.opensource.org/licenses/mit-license.php>. - Error: Listening for incoming connections failed (listen returned error %s) Error: ha fallat escoltar les connexions entrants (l'escoltament ha retornat l'error %s) diff --git a/src/qt/locale/bitcoin_cmn.ts b/src/qt/locale/bitcoin_cmn.ts index 3286f12698..09ff0acf02 100644 --- a/src/qt/locale/bitcoin_cmn.ts +++ b/src/qt/locale/bitcoin_cmn.ts @@ -1,4 +1,4 @@ - + AddressBookPage diff --git a/src/qt/locale/bitcoin_cs.ts b/src/qt/locale/bitcoin_cs.ts index 44fda5afed..bc2a2ef7b5 100644 --- a/src/qt/locale/bitcoin_cs.ts +++ b/src/qt/locale/bitcoin_cs.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -504,10 +504,6 @@ Adresa: %4 CoinControlDialog - - Coin Control Address Selection - Volba adres v rámci ruční správy mincí - Quantity: Počet: @@ -556,10 +552,6 @@ Adresa: %4 Amount Částka - - Address - Adresa - Date Datum @@ -926,14 +918,6 @@ Adresa: %4 &Main &Hlavní - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Dobrovolný transakční poplatek za každý započatý kB dopomáhá k rychlému zpracování tvých transakcí. Většina transakcí má do 1 kB. - - - Pay transaction &fee - Platit &transakční poplatek - Automatically start Bitcoin after logging in to the system. Automaticky spustí Bitcoin po přihlášení do systému. @@ -962,14 +946,6 @@ Adresa: %4 Allow incoming connections Přijímat příchozí spojení - - Connect to the Bitcoin network through a SOCKS proxy. - Připojí se do Bitcoinové sítě přes SOCKS proxy. - - - &Connect through SOCKS proxy (default proxy): - &Připojit přes SOCKS proxy (výchozí proxy): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) IP adresa proxy (např. IPv4: 127.0.0.1/IPv6: ::1) @@ -2918,10 +2894,6 @@ například: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) Vytvářet nové soubory s výchozími systémovými právy namísto umask 077 (uplatní se, pouze pokud je vypnutá funkce peněženky) - - Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. - Šířen pod licencí MIT/X11, viz přiložený soubor COPYING nebo <http://www.opensource.org/licenses/mit-license.php>. - Error: Listening for incoming connections failed (listen returned error %s) Chyba: Nelze naslouchat příchozí spojení (listen vrátil chybu %s) diff --git a/src/qt/locale/bitcoin_cy.ts b/src/qt/locale/bitcoin_cy.ts index cf82f2be27..c68fc274f3 100644 --- a/src/qt/locale/bitcoin_cy.ts +++ b/src/qt/locale/bitcoin_cy.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -196,10 +196,6 @@ CoinControlDialog - - Address - Cyfeiriad - Date Dyddiad diff --git a/src/qt/locale/bitcoin_da.ts b/src/qt/locale/bitcoin_da.ts index 05ee62e020..f733591098 100644 --- a/src/qt/locale/bitcoin_da.ts +++ b/src/qt/locale/bitcoin_da.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -525,8 +525,8 @@ Adresse: %4 CoinControlDialog - Coin Control Address Selection - Adressevalg for coin-styring + Coin Selection + Coin-styring Quantity: @@ -577,8 +577,12 @@ Adresse: %4 Beløb - Address - Adresse + Received with label + Modtaget med mærke + + + Received with address + Modtaget med adresse Date @@ -950,14 +954,6 @@ Adresse: %4 &Main &Generelt - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Valgfrit transaktionsgebyr pr. kB, der hjælper dine transaktioner med at blive behandlet hurtigt. De fleste transaktioner er på 1 kB. - - - Pay transaction &fee - Betal transaktions&gebyr - Automatically start Bitcoin after logging in to the system. Start Bitcoin automatisk, når der logges ind på systemet. @@ -986,14 +982,6 @@ Adresse: %4 Allow incoming connections Tillad indkommende forbindelser - - Connect to the Bitcoin network through a SOCKS proxy. - Forbind til Bitcoin-netværket gennem en SOCKS-proxy. - - - &Connect through SOCKS proxy (default proxy): - &Forbind gennem SOCKS-proxy (standard-proxy): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) IP-adresse for proxyen (fx IPv4: 127.0.0.1 / IPv6: ::1) @@ -1054,6 +1042,14 @@ Adresse: %4 Map port using &UPnP Konfigurér port vha. &UPnP + + Connect to the Bitcoin network through a SOCKS5 proxy. + Forbind til Bitcoin-netværket gennem en SOCKS5-proxy. + + + &Connect through SOCKS5 proxy (default proxy): + &Forbind gennem SOCKS5-proxy (standard-proxy): + Proxy &IP: Proxy-&IP: @@ -1844,6 +1840,78 @@ Adresse: %4 Custom change address Tilpasset byttepengeadresse + + Transaction Fee: + Transaktionsgebyr: + + + Choose... + Vælg … + + + collapse fee-settings + sammenfold gebyropsætning + + + Minimize + Minimér + + + If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte. + Hvis det brugertilpassede gebyr er sat til 1000 satoshis, og transaktionen kun fylder 250 byte, betaler "pr. kilobyte" kun 250 satoshis i gebyr, mens "mindst" betaler 1000 satoshis. For transaktioner større end en kilobyte betaler begge pr. kilobyte. + + + per kilobyte + pr. kilobyte + + + If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "total at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte. + Hvis det brugertilpassede gebyr er sat til 1000 satoshis, og transaktionen kun fylder 250 byte, betaler "pr. kilobyte" kun 250 satoshis i gebyr, mens "total mindst" betaler 1000 satoshis. For transaktioner større end en kilobyte betaler begge pr. kilobyte. + + + total at least + total mindst + + + Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process. + Det er helt fint kun at betale det minimale gebyr, så længe den totale transaktionsvolumen er mindre end den plads, der er tilgængelig i blokkene. Men vær opmærksom på, at dette kan ende ud i transaktioner, der aldrig bliver bekræftet, når der bliver større forespørgsel efter bitcoin-transaktioner, end hvad netværket kan bearbejde. + + + (read the tooltip) + (læs værktøjstippet) + + + Recommended: + Anbefalet: + + + Custom: + Brugertilpasset: + + + (Smart fee not initialized yet. This usually takes a few blocks...) + (Smart-gebyr er ikke initialiseret endnu. Dette tager typisk nogle få blokke …) + + + Confirmation time: + Bekræftelsestid: + + + normal + normal + + + fast + hurtig + + + Send as zero-fee transaction if possible + Send som nul-gebyr-transaktion hvis muligt + + + (confirmation may take longer) + (bekræftelse kan tage længere) + Send to multiple recipients at once Send til flere modtagere på en gang @@ -1948,6 +2016,18 @@ Adresse: %4 The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Transaktionen blev afvist! Dette kan ske, hvis nogle af dine bitcoins i din tegnebog allerede er brugt, som hvis du brugte en kopi af wallet.dat og dine bitcoins er blevet brugt i kopien, men ikke er markeret som brugt her. + + A fee higher than %1 is considered an insanely high fee. + Et gebyr højere end %1 anses som et vanvittigt højt gebyr. + + + Pay only the minimum fee of %1 + Betal kun det minimale gebyr på %1 + + + Estimated to begin confirmation within %1 block(s). + Bekræftelse vurderes at begynde inden for %1 blok(ke). + Warning: Invalid Bitcoin address Advarsel: Ugyldig Bitcoin-adresse @@ -2754,6 +2834,10 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup Slet alle transaktioner i tegnebogen og genskab kun disse dele af blokkæden gennem -rescan under opstart + + Distributed under the MIT software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + Distribueret under MIT-softwarelicensen; se den vedlagte fil COPYING eller <http://www.opensource.org/licenses/mit-license.php>. + Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Start regressionstesttilstand, som bruger en speciel kæde, hvor blokke kan løses med det samme. @@ -2986,10 +3070,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) Opret nye filer med systemstandard for rettigheder i stedet for umask 077 (kun virksomt med tegnebogsfunktionalitet slået fra) - - Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. - Distribueret under MIT/X11-softwarelicensen. Se medfølgende fil COPYING eller <http://www.opensource.org/licenses/mit-license.php>. - Error: Listening for incoming connections failed (listen returned error %s) Fejl: Lytning efter indkommende forbindelser mislykkedes (lytning resultarede i fejl %s) @@ -3010,6 +3090,10 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) Gebyrer (i BTC/Kb) mindre end dette opfattes som nulgebyr for oprettelse af transaktion (standard: %s) + + Maximum size of data in data carrier transactions we relay and mine (default: %u) + Maksimal størrelse på data i transaktioner til dataoverførsel, som vi videresender og miner (standard: %u) + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) Forespørgsel @@ -3018,6 +3102,10 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Sæt maksimumstørrelse for højprioritet/lavgebyr-transaktioner i byte (standard: %d) + + Set the number of threads for coin generation if enabled (-1 = all cores, default: %d) + Sæt antaller af tråde for coin-generering, hvis aktiveret (-1 = alle kerner, standard: %d) + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. Dette produkt indeholder software, der er udviklet af OpenSSL-projektet for brug i OpenSSL-værktøjskassen <https://www.openssl.org/>, samt kryptografisk software, der er skrevet af Eric Young, samt UPnP-software, der er skrevet af Thomas Bernard. @@ -3122,6 +3210,10 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Send trace/debug info to console instead of debug.log file Send sporings-/fejlsøgningsinformation til konsollen i stedet for debug.log filen + + Send transactions as zero-fee transactions if possible (default: %u) + Send transaktioner som nul-gebyr-transaktioner hvis muligt (standard: %u) + Show all debugging options (usage: --help -help-debug) Vis alle tilvalg for fejlsøgning (brug: --help -help-debug) @@ -3262,10 +3354,6 @@ fx: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Output debugging information (default: %u, supplying <category> is optional) Udskriv fejlsøgningsinformation (standard: %u, angivelse af <kategori> er valgfri) - - Set the processor limit for when generation is on (-1 = unlimited, default: %d) - Sæt processorbegrænsning for når generering er slået til (-1 = ubegrænset, standard: %d) - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) Brug separat SOCS5-proxy for at nå andre knuder via Tor skjulte tjenester (standard: %s) diff --git a/src/qt/locale/bitcoin_de.ts b/src/qt/locale/bitcoin_de.ts index 8bc1c046a1..9462f668d3 100644 --- a/src/qt/locale/bitcoin_de.ts +++ b/src/qt/locale/bitcoin_de.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -520,8 +520,8 @@ Adresse: %4 CoinControlDialog - Coin Control Address Selection - "Coin Control"-Adressauswahl + Coin Selection + Münzauswahl ("Coin Control") Quantity: @@ -572,8 +572,12 @@ Adresse: %4 Betrag - Address - Adresse + Received with label + Empfangen über Bezeichnung + + + Received with address + Empfangen über Adresse Date @@ -949,14 +953,6 @@ Adresse: %4 &Main &Allgemein - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Optionale Transaktionsgebühr pro kB, die sicherstellt, dass Ihre Transaktionen schnell bearbeitet werden. Die meisten Transaktionen sind 1 kB groß. - - - Pay transaction &fee - Transaktions&gebühr bezahlen - Automatically start Bitcoin after logging in to the system. Bitcoin nach der Anmeldung am System automatisch ausführen. @@ -985,14 +981,6 @@ Adresse: %4 Allow incoming connections Erlaubt eingehende Verbindungen - - Connect to the Bitcoin network through a SOCKS proxy. - Über einen SOCKS-Proxy mit dem Bitcoin-Netzwerk verbinden. - - - &Connect through SOCKS proxy (default proxy): - Über einen SOCKS-Proxy &verbinden (Standardproxy): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) IP-Adresse des Proxies (z.B. IPv4: 127.0.0.1 / IPv6: ::1) @@ -1053,6 +1041,14 @@ Adresse: %4 Map port using &UPnP Portweiterleitung via &UPnP + + Connect to the Bitcoin network through a SOCKS5 proxy. + Über einen SOCKS5-Proxy mit dem Bitcoin-Netzwerk verbinden. + + + &Connect through SOCKS5 proxy (default proxy): + Über einen SOCKS5-Proxy &verbinden (Standardproxy): + Proxy &IP: Proxy-&IP: @@ -1843,6 +1839,66 @@ Adresse: %4 Custom change address Benutzerdefinierte Wechselgeld-Adresse + + Transaction Fee: + Transaktionsgebühr: + + + Choose... + Auswählen... + + + collapse fee-settings + Transaktionsgebühreneinstellungen ausblenden + + + Minimize + Minimieren + + + per kilobyte + pro Kilobyte + + + total at least + Mindestbetrag + + + (read the tooltip) + (den Hinweistext lesen) + + + Recommended: + Empfehlungen: + + + Custom: + Benutzerdefiniert: + + + (Smart fee not initialized yet. This usually takes a few blocks...) + (Intelligente Gebührenlogik ist noch nicht verfügbar. Normalerweise dauert dies einige Blöcke lang...) + + + Confirmation time: + Bestätigungszeit: + + + normal + normal + + + fast + schnell + + + Send as zero-fee transaction if possible + Wenn möglich als gebührenfreie Transaktion senden + + + (confirmation may take longer) + (Bestätigung kann länger dauern) + Send to multiple recipients at once An mehrere Empfänger auf einmal überweisen @@ -1947,6 +2003,18 @@ Adresse: %4 The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Die Transaktion wurde abgelehnt! Dies kann passieren, wenn einige Bitcoins aus Ihrer Wallet bereits ausgegeben wurden. Beispielsweise weil Sie eine Kopie Ihrer wallet.dat genutzt, die Bitcoins dort ausgegeben haben und dies daher in der derzeit aktiven Wallet nicht vermerkt ist. + + A fee higher than %1 is considered an insanely high fee. + Eine höhere Gebühr als %1 wird als unsinnig hohe Gebühr angesehen. + + + Pay only the minimum fee of %1 + Nur die minimale Gebühr in Höhe von %1 zahlen + + + Estimated to begin confirmation within %1 block(s). + Voraussichtlicher Beginn der Bestätigung innerhalb von %1 Blöcken. + Warning: Invalid Bitcoin address Warnung: Ungültige Bitcoin-Adresse @@ -2805,6 +2873,10 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. Warnung: wallet.dat beschädigt, Datenrettung erfolgreich! Original wallet.dat wurde als wallet.{Zeitstempel}.dat in %s gespeichert. Falls Ihr Kontostand oder Transaktionen nicht korrekt sind, sollten Sie von einer Datensicherung wiederherstellen. + + Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times. + Gegenstellen die sich von der angegebenen Netzmaske oder IP-Adresse aus verbinden immer zulassen. Kann mehrmals angegeben werden. + (default: 1) (Standard: 1) @@ -2981,10 +3053,6 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) Neue Dateien mit Standard-Systemrechten erzeugen, anstatt mit umask 077 (nur mit deaktivierter Walletfunktion nutzbar) - - Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. - Veröffentlicht unter der MIT/X11-Softwarelizenz, siehe beiligende Datei COPYING oder <http://www.opensource.org/licenses/mit-license.php>. - Error: Listening for incoming connections failed (listen returned error %s) Fehler: Abhören nach eingehenden Verbindungen fehlgeschlagen (listen meldete Fehler %s) @@ -3005,13 +3073,21 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) Niedrigere Gebühren (in BTC/Kb) als diese werden bei der Transaktionserstellung als gebührenfrei angesehen (Standard: %s) + + Maximum size of data in data carrier transactions we relay and mine (default: %u) + Maximale Datengröße in "Data Carrier"-Transaktionen die weitergeleitet und erarbeitet werden (Standard: %u) + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) Adressen von Gegenstellen via DNS-Namensauflösung finden, falls zu wenige Adressen verfügbar sind (Standard: 1, außer bei -connect) Set maximum size of high-priority/low-fee transactions in bytes (default: %d) - Maximale Größe in Byte von Transaktionen hoher Priorität/mit niedrigen Gebühren festlegen (Standard: %d) + Maximale Größe in Byte von "high-priority/low-fee"-Transaktionen festlegen (Standard: %d) + + + Set the number of threads for coin generation if enabled (-1 = all cores, default: %d) + Maximale Anzahl an Threads zur Bitcoinerzeugung, wenn aktiviert, festlegen (-1 = alle Kerne, Standard: %d) This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. @@ -3117,6 +3193,10 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Send trace/debug info to console instead of debug.log file Rückverfolgungs- und Debuginformationen an die Konsole senden, anstatt sie in debug.log zu schreiben + + Send transactions as zero-fee transactions if possible (default: %u) + Transaktionen, wenn möglich, als gebührenfreie Transaktion senden (Standard: %u) + Show all debugging options (usage: --help -help-debug) Zeige alle Debuggingoptionen (Benutzung: --help -help-debug) @@ -3225,6 +3305,10 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Error loading wallet.dat: Wallet corrupted Fehler beim Laden von wallet.dat: Wallet beschädigt + + (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + (1 = TX-Metadaten wie z.B. Accountbesitzer und Zahlungsanforderungsinformationen behalten, 2 = TX-Metadaten verwerfen) + Flush database activity from memory pool to disk log every <n> megabytes (default: %u) Datenbankaktivitäten vom Arbeitsspeicher-Pool alle <n> Megabyte auf den Datenträger schreiben (Standard: %u) @@ -3233,6 +3317,10 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com How thorough the block verification of -checkblocks is (0-4, default: %u) Legt fest, wie gründlich die Blockverifikation von -checkblocks ist (0-4, Standard: %u) + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: %u) + Wenn keine Transaktionsgebühr festgelegt wurde eine Gebühr einbeziehen, sodass Transaktionen im Schnitt innerhalb von <n> Blöcken bestätigt werden (Standard: %u) + Log transaction priority and fee per kB when mining blocks (default: %u) Transaktionspriorität und Gebühr pro kB beim Erzeugen von Blöcken protokollieren (Standard: %u) @@ -3249,10 +3337,6 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Output debugging information (default: %u, supplying <category> is optional) Debugginginformationen ausgeben (Standard: %u, <category> anzugeben ist optional) - - Set the processor limit for when generation is on (-1 = unlimited, default: %d) - Legt ein Prozessor-/CPU-Kernlimit fest, wenn CPU-Mining aktiviert ist (-1 = unbegrenzt, Standard: %d) - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) Separaten SOCKS5-Proxy verwenden, um Gegenstellen über versteckte Tor-Dienste zu erreichen (Standard: %s) @@ -3265,6 +3349,10 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Acceptable ciphers (default: %s) Zulässige Chiffren (Standard: %s) + + Always query for peer addresses via DNS lookup (default: %u) + Adressen von Gegenstellen immer über DNS-Namensauflösung abfragen (Standard: %u) + Disable safemode, override a real safe mode event (default: %u) Sicherheitsmodus deaktivieren, übergeht ein echtes Sicherheitsmodusereignis (Standard: %u) @@ -3377,6 +3465,10 @@ zum Beispiel: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com Spend unconfirmed change when sending transactions (default: %u) Unbestätigtes Wechselgeld darf beim Senden von Transaktionen ausgegeben werden (Standard: %u) + + Stop running after importing blocks from disk (default: %u) + Beenden, nachdem Blöcke vom Datenträger importiert wurden (Standard: %u) + Threshold for disconnecting misbehaving peers (default: %u) Schwellenwert, um Verbindungen zu sich nicht konform verhaltenden Gegenstellen zu beenden (Standard: %u) diff --git a/src/qt/locale/bitcoin_el_GR.ts b/src/qt/locale/bitcoin_el_GR.ts index b4e15ae2df..1a1c918c5b 100644 --- a/src/qt/locale/bitcoin_el_GR.ts +++ b/src/qt/locale/bitcoin_el_GR.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -497,10 +497,6 @@ Address: %4 Amount Ποσό - - Address - Διεύθυνση - Date Ημερομηνία @@ -776,14 +772,6 @@ Address: %4 &Main &Κύριο - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Η προαιρετική αμοιβή για κάθε kB επισπεύδει την επεξεργασία των συναλλαγών σας. Οι περισσότερες συναλλαγές είναι 1 kB. - - - Pay transaction &fee - Αμοιβή &συναλλαγής - Automatically start Bitcoin after logging in to the system. Αυτόματη εκκίνηση του Bitcoin μετά την εισαγωγή στο σύστημα diff --git a/src/qt/locale/bitcoin_eo.ts b/src/qt/locale/bitcoin_eo.ts index 4496dcc3d9..5189310e64 100644 --- a/src/qt/locale/bitcoin_eo.ts +++ b/src/qt/locale/bitcoin_eo.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -536,10 +536,6 @@ Adreso: %4 Amount Sumo - - Address - Adreso - Date Dato @@ -882,14 +878,6 @@ Adreso: %4 &Main Ĉ&efa - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Nedeviga krompago por ĉiu kB, kiu helpas plirapidigi la traktadon de via transakcio. Plej multaj transakcioj grandas je 1kB. - - - Pay transaction &fee - Krompago - Automatically start Bitcoin after logging in to the system. Aŭtomate lanĉi Bitmonon post ensaluto al la sistemo. diff --git a/src/qt/locale/bitcoin_es.ts b/src/qt/locale/bitcoin_es.ts index 0cb8991e11..71f7e9f4c9 100644 --- a/src/qt/locale/bitcoin_es.ts +++ b/src/qt/locale/bitcoin_es.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -524,10 +524,6 @@ Dirección: %4 CoinControlDialog - - Coin Control Address Selection - Selección de direcciones bajo Coin Control - Quantity: Cantidad: @@ -576,10 +572,6 @@ Dirección: %4 Amount Cantidad - - Address - Dirección - Date Fecha @@ -954,14 +946,6 @@ Dirección: %4 &Main &Principal - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Comisión de transacción opcional por kB que ayuda a asegurar que sus transacciones sean procesadas rápidamente. La mayoría de transacciones son de 1kB. - - - Pay transaction &fee - Pagar comisión de &transacción - Automatically start Bitcoin after logging in to the system. Iniciar Bitcoin automáticamente al encender el sistema. @@ -990,14 +974,6 @@ Dirección: %4 Allow incoming connections Aceptar conexiones entrantes - - Connect to the Bitcoin network through a SOCKS proxy. - Conectarse a la red Bitcoin a través de un proxy SOCKS. - - - &Connect through SOCKS proxy (default proxy): - &Conectarse a través de proxy SOCKS (proxy predeterminado): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Dirección IP del proxy (p. ej. IPv4: 127.0.0.1 / IPv6: ::1) @@ -2480,6 +2456,10 @@ Dirección: %4 Type of transaction. Tipo de transacción. + + Whether or not a watch-only address is involved in this transaction. + Sea o no una dirección sólo está involucrada en esta transacción. + Destination address of transaction. Dirección de destino de la transacción. @@ -2962,6 +2942,10 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Imports blocks from external blk000??.dat file Importa los bloques desde un archivo blk000??.dat externo + + Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times + Permitir conexiones JSON-RPC de origen especificado. Válido para son una sola IP (por ejemplo 1.2.3.4), una red/máscara de red (por ejemplo 1.2.3.4/255.255.255.0) o una red/CIDR (e.g. 1.2.3.4/24). Esta opción se puede especificar varias veces + An error occurred while setting up the RPC address %s port %u for listening: %s Ocurrió un error al configurar la dirección de RPC %s puerto %u para escuchar en: %s @@ -2986,18 +2970,30 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) Crear nuevos archivos con permisos por defecto del sistema, en lugar de umask 077 (sólo efectivo con la funcionalidad de monedero desactivada) - - Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. - Distribuido bajo la licencia de software MIT/X11, vea la copia del archivo adjunto o <http://www.opensource.org/licenses/mit-license.php>. - Error: Listening for incoming connections failed (listen returned error %s) Error: la escucha para conexiones entrantes falló (la escucha regresó el error %s) + + Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + Error: Unsupported argumento -socks encontrados. SOCKS versión ajuste ya no es posible, sólo SOCKS5 proxies son compatibles. + Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Ejecutar un comando cuando se reciba una alerta importante o cuando veamos un fork demasiado largo (%s en cmd se reemplazará por el mensaje) + + Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) + Tarifas (en BTC/Kb) más pequeños que esto se consideran cero cuota de reinstalación (por defecto: %s) + + + Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) + Tarifas (en BTC/Kb) más pequeños que esto se consideran cero cuota para la creación de la transacción (por defecto: %s) + + + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) + Consulta de direcciones pares mediante búsqueda de DNS, si bajo en direcciones (por defecto: 1 a menos que - conectar) + Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Establecer tamaño máximo de las transacciones de alta prioridad/baja comisión en bytes (predeterminado: %d) @@ -3010,6 +3006,10 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. Aviso: ¡Comprueba la fecha y hora de tu ordenador y verifica si es correcta! Si no es correcta Bitcoin Core no funcionará adecuadamente. + + Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway + A los equipos en lista blanca no se les pueden prohibir los ataques DoS y sus transacciones siempre son retransmitidas, incluso si ya están en el mempool, es útil por ejemplo para un gateway. + Connect through SOCKS5 proxy Conectar usando SOCKS5 proxy @@ -3022,10 +3022,18 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error loading wallet.dat: Wallet requires newer version of Bitcoin Core Error al cargar wallet.dat: El monedero requiere una versión más reciente de Bitcoin Core + + Fee (in BTC/kB) to add to transactions you send (default: %s) + Cuota (in BTC/kB) para añadir a las transacciones que envíes (por defecto: %s) + Information Información + + Initialization sanity check failed. Bitcoin Core is shutting down. + La inicialización de la verificación de validez falló. Se está apagando Bitcoin Core. + Invalid amount for -minrelaytxfee=<amount>: '%s' Cantidad inválida para -minrelaytxfee=<amount>: '%s' @@ -3034,6 +3042,26 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Invalid amount for -mintxfee=<amount>: '%s' Cantidad inválida para -mintxfee=<amount>: '%s' + + Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) + Cantidad inválida para -paytxfee=<amount>: '%s' (debe ser por lo menos %s) + + + Invalid netmask specified in -whitelist: '%s' + Máscara de red inválida especificada en -whitelist: '%s' + + + Keep at most <n> unconnectable blocks in memory (default: %u) + Mantener como máximo <n> bloques no conectables en memoria (por defecto: %u) + + + Keep at most <n> unconnectable transactions in memory (default: %u) + Mantener como máximo <n> transacciones no conectables en memoria (por defecto: %u) + + + Need to specify a port with -whitebind: '%s' + Necesita especificar un puerto con -whitebind: '%s' + Node relay options: Opciones de nodos de retransmisión: @@ -3182,6 +3210,10 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Log transaction priority and fee per kB when mining blocks (default: %u) Registrar prioridad de las transacciones y cuota por kB cuando se minen bloques (por defecto: %u) + + Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u) + Mantener el índice completo de transacciones, usado por la llamada rpc de getrawtransaction (por defecto: %u) + Number of seconds to keep misbehaving peers from reconnecting (default: %u) Número de segundos en que se evita la reconexión de pares con mal comportamiento (predeterminado: %u) @@ -3270,6 +3302,10 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Print block tree on startup (default: %u) Imprimir árbol de bloques al iniciar (predeterminado: %u) + + Relay and mine data carrier transactions (default: %u) + Retransmitir y minar transacciones de transporte de datos (por defecto: %u) + Run a thread to flush wallet periodically (default: %u) Ejecutar un hilo para limpiar de la memoria el monedero periódicamente (predeterminado: %u) @@ -3372,7 +3408,7 @@ Por ejemplo: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Done loading - Generado pero no aceptado + Se terminó de cargar To use the %s option diff --git a/src/qt/locale/bitcoin_es_CL.ts b/src/qt/locale/bitcoin_es_CL.ts index 930aac8449..e6f81e650f 100644 --- a/src/qt/locale/bitcoin_es_CL.ts +++ b/src/qt/locale/bitcoin_es_CL.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -355,10 +355,6 @@ Dirección: %4 Amount Cantidad - - Address - Dirección - Date Fecha @@ -478,10 +474,6 @@ Dirección: %4 &Main &Principal - - Pay transaction &fee - Comisión de &transacciónes - Automatically start Bitcoin after logging in to the system. Inicia Bitcoin automáticamente despues de encender el computador diff --git a/src/qt/locale/bitcoin_es_DO.ts b/src/qt/locale/bitcoin_es_DO.ts index 8099b182ae..2e5daf4cdb 100644 --- a/src/qt/locale/bitcoin_es_DO.ts +++ b/src/qt/locale/bitcoin_es_DO.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -476,10 +476,6 @@ Dirección: %4 CoinControlDialog - - Coin Control Address Selection - Selección de la dirección de control de la moneda - Quantity: Cantidad: @@ -524,10 +520,6 @@ Dirección: %4 Amount Cantidad - - Address - Dirección - Date Fecha @@ -874,14 +866,6 @@ Dirección: %4 &Main &Principal - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Tarifa de transacción opcional por kB que ayuda a asegurar que sus transacciones sean procesadas rápidamente. La mayoría de transacciones son de 1kB. - - - Pay transaction &fee - Comisión de &transacciones - Automatically start Bitcoin after logging in to the system. Iniciar Bitcoin automáticamente al encender el sistema. @@ -894,10 +878,6 @@ Dirección: %4 MB MB - - Connect to the Bitcoin network through a SOCKS proxy. - Conéctese a la red Bitcoin través de un proxy SOCKS. - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Dirección IP del proxy (ej. IPv4: 127.0.0.1 / IPv6: ::1) diff --git a/src/qt/locale/bitcoin_es_MX.ts b/src/qt/locale/bitcoin_es_MX.ts index 93d9f6473d..bedc5d243e 100644 --- a/src/qt/locale/bitcoin_es_MX.ts +++ b/src/qt/locale/bitcoin_es_MX.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -396,10 +396,6 @@ Amount Monto - - Address - Domicilio - Date Fecha diff --git a/src/qt/locale/bitcoin_es_UY.ts b/src/qt/locale/bitcoin_es_UY.ts index 8bca84c219..a5a1583b19 100644 --- a/src/qt/locale/bitcoin_es_UY.ts +++ b/src/qt/locale/bitcoin_es_UY.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -196,10 +196,6 @@ CoinControlDialog - - Address - Direccion - Date Fecha diff --git a/src/qt/locale/bitcoin_et.ts b/src/qt/locale/bitcoin_et.ts index 82ed0337ab..801fcf6258 100644 --- a/src/qt/locale/bitcoin_et.ts +++ b/src/qt/locale/bitcoin_et.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -407,10 +407,6 @@ Aadress: %4⏎ Amount Kogus - - Address - Aadress - Date Kuupäev @@ -549,10 +545,6 @@ Aadress: %4⏎ Options Valikud - - Pay transaction &fee - Tasu tehingu &fee - Automatically start Bitcoin after logging in to the system. Käivita Bitcoin süsteemi logimisel. diff --git a/src/qt/locale/bitcoin_eu_ES.ts b/src/qt/locale/bitcoin_eu_ES.ts index 9a570890a1..ea0ce1a67d 100644 --- a/src/qt/locale/bitcoin_eu_ES.ts +++ b/src/qt/locale/bitcoin_eu_ES.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -212,10 +212,6 @@ Amount Kopurua - - Address - Helbidea - Date Data diff --git a/src/qt/locale/bitcoin_fa.ts b/src/qt/locale/bitcoin_fa.ts index c33bbdf6b4..475515f4b7 100644 --- a/src/qt/locale/bitcoin_fa.ts +++ b/src/qt/locale/bitcoin_fa.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -436,10 +436,6 @@ Address: %4 Amount مبلغ - - Address - نشانی - Date تاریخ @@ -626,14 +622,6 @@ Address: %4 &Main &عمومی - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - کارمزد اختیاریِ هر کیلوبایت برای انتقال سریع‌تر تراکنش. اکثر تراکنش‌ها ۱ کیلوبایتی هستند. - - - Pay transaction &fee - پرداخت &کارمزد تراکنش - Automatically start Bitcoin after logging in to the system. اجرای خودکار بیت‌کوین در زمان ورود به سیستم. diff --git a/src/qt/locale/bitcoin_fa_IR.ts b/src/qt/locale/bitcoin_fa_IR.ts index 5ff33fee1a..1a639a8592 100644 --- a/src/qt/locale/bitcoin_fa_IR.ts +++ b/src/qt/locale/bitcoin_fa_IR.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -289,10 +289,6 @@ Address: %4 Amount میزان - - Address - حساب - Date تاریخ diff --git a/src/qt/locale/bitcoin_fi.ts b/src/qt/locale/bitcoin_fi.ts index 76ec6d4bf5..9a2eadd6ea 100644 --- a/src/qt/locale/bitcoin_fi.ts +++ b/src/qt/locale/bitcoin_fi.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -519,10 +519,6 @@ Osoite: %4 CoinControlDialog - - Coin Control Address Selection - Kolikkokontrollin osoitteen valinta - Quantity: Määrä: @@ -571,10 +567,6 @@ Osoite: %4 Amount Määrä - - Address - Osoite - Date Aika @@ -941,14 +933,6 @@ Osoite: %4 &Main &Yleiset - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Valinnainen rahansiirtopalkkio per kB auttaa varmistamaan että rahansiirtosi prosessoidaan nopeasti. Useimmat rahansiirrot ovat alle 1 kB. - - - Pay transaction &fee - Maksa rahansiirtopalkkio - Automatically start Bitcoin after logging in to the system. Käynnistä Bitcoin kirjautumisen yhteydessä. @@ -977,14 +961,6 @@ Osoite: %4 Allow incoming connections Hyväksy sisääntulevia yhteyksiä - - Connect to the Bitcoin network through a SOCKS proxy. - Yhdistä Bitcoin-verkkoon SOCKS proxyn kautta. - - - &Connect through SOCKS proxy (default proxy): - &Yhdistä SOCKS proxyn kautta (oletus proxy): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) IP osoite proxille (esim. IPv4: 127.0.0.1 / IPv6: ::1) diff --git a/src/qt/locale/bitcoin_fr.ts b/src/qt/locale/bitcoin_fr.ts index 86c23b6c3e..71a1519411 100644 --- a/src/qt/locale/bitcoin_fr.ts +++ b/src/qt/locale/bitcoin_fr.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -478,6 +478,10 @@ Up to date À jour + + Processed %n blocks of transaction history. + %n bloc de l'historique transactionnel a été traité%n blocs de l'historique transactionnel ont été traités + Catching up... Rattrapage en cours… @@ -521,8 +525,8 @@ Adresse : %4 CoinControlDialog - Coin Control Address Selection - Sélection de l'adresse de contrôle des pièces + Coin Selection + Sélection des pièces Quantity: @@ -573,8 +577,12 @@ Adresse : %4 Montant - Address - Adresse + Received with label + Reçu avec une étiquette + + + Received with address + Reçu avec une adresse Date @@ -904,6 +912,10 @@ Adresse : %4 Error Erreur + + %n GB of free space available + %n Go d'espace libre disponible%n Go d'espace libre disponibles + OpenURIDialog @@ -938,14 +950,6 @@ Adresse : %4 &Main Réglages &principaux - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Frais de transaction optionnel par ko qui aident à garantir un traitement rapide des transactions. La plupart des transactions utilisent 1 ko. - - - Pay transaction &fee - Payer des &frais de transaction - Automatically start Bitcoin after logging in to the system. Démarrer Bitcoin automatiquement après avoir ouvert une session sur l'ordinateur. @@ -974,14 +978,6 @@ Adresse : %4 Allow incoming connections Permettre les transactions entrantes - - Connect to the Bitcoin network through a SOCKS proxy. - Se connecter au réseau Bitcoin par un mandataire SOCKS. - - - &Connect through SOCKS proxy (default proxy): - Se &connecter par un mandataire SOCKS (mandataire par défaut) : - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Adresse IP du mandataire (par ex. IPv4 : 127.0.0.1 / IPv6 : ::1) @@ -1042,6 +1038,14 @@ Adresse : %4 Map port using &UPnP Mapper le port avec l'&UPnP + + Connect to the Bitcoin network through a SOCKS5 proxy. + Se connecter au réseau Bitcoin par un mandataire SOCKS5. + + + &Connect through SOCKS5 proxy (default proxy): + Se &connecter par un mandataire SOCKS5 (mandataire par défaut) : + Proxy &IP: &IP du serveur mandataire : @@ -1191,7 +1195,7 @@ Adresse : %4 Spendable: - Disponible: + Disponible : Recent transactions @@ -1832,6 +1836,78 @@ Adresse : %4 Custom change address Adresse personnalisée de monnaie rendue + + Transaction Fee: + Frais de transaction : + + + Choose... + Choisir... + + + collapse fee-settings + réduire les paramètres des frais + + + Minimize + Minimiser + + + If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte. + Si les frais personnalisés sont définis à 1 000 satoshis et que la transaction est seulement de 250 octets, donc le « par kilo-octet » ne paiera que 250 satoshis de frais, alors que le « au moins » paiera 1 000 satoshis. Pour des transactions supérieures à un kilo-octet, les deux paieront par kilo-octets. + + + per kilobyte + par kilo-octet + + + If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "total at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte. + Si les frais personnalisés sont définis à 1 000 satoshis et que la transaction est seulement de 250 octets, donc le « par kilo-octet » ne paiera que 250 satoshis de frais, alors que le « total au moins » paiera 1 000 satoshis. Pour des transactions supérieures à un kilo-octet, les deux paieront par kilo-octets. + + + total at least + total au moins + + + Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process. + Il est correct de payer les frais minimum tant que le volume transactionnel est inférieur à l'espace dans les blocs. Mais soyez conscient que ceci pourrait résulter en une transaction n'étant jamais confirmée une fois qu'il y aura plus de transactions que le réseau ne pourra en traiter. + + + (read the tooltip) + (lire l'infobulle) + + + Recommended: + Recommandés : + + + Custom: + Personnalisés : + + + (Smart fee not initialized yet. This usually takes a few blocks...) + (Les frais intelligents ne sont pas encore initialisés. Ceci prend habituellement quelques blocs...) + + + Confirmation time: + Temps de confirmation : + + + normal + normal + + + fast + rapide + + + Send as zero-fee transaction if possible + Envoyer si possible une transaction sans frais + + + (confirmation may take longer) + (la confirmation pourrait prendre plus longtemps) + Send to multiple recipients at once Envoyer à plusieurs destinataires à la fois @@ -1936,6 +2012,18 @@ Adresse : %4 The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. La transaction a été rejetée ! Ceci peut arriver si certaines pièces de votre portefeuille étaient déjà dépensées, par exemple si vous avez utilisé une copie de wallet.dat et que des pièces ont été dépensées dans la copie sans être marquées comme telles ici. + + A fee higher than %1 is considered an insanely high fee. + Des frais supérieurs à %1 sont considérés comme follement élevés. + + + Pay only the minimum fee of %1 + Payer seulement les frais minimum de %1 + + + Estimated to begin confirmation within %1 block(s). + Début de confirmation estimé à %1 bloc(s). + Warning: Invalid Bitcoin address Avertissement : adresse Bitcoin invalide @@ -2466,7 +2554,7 @@ Adresse : %4 Whether or not a watch-only address is involved in this transaction. - Détermine si une adresse de type watch-only est impliquée dans cette transaction. + Une adresse juste-regarder est-elle impliquée dans cette transaction. Destination address of transaction. @@ -2563,6 +2651,10 @@ Adresse : %4 Export Transaction History Exporter l'historique des transactions + + Watch-only + Juste-regarder : + Exporting Failed L'exportation a échoué @@ -2738,6 +2830,10 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup Supprimer toutes les transactions du portefeuille et ne récupérer que ces parties de la chaîne de bloc avec -rescan au démarrage + + Distributed under the MIT software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + Distribué sous la licence MIT d'utilisation d'un logiciel. Consultez le fichier joint COPYING ou <http://www.opensource.org/licenses/mit-license.php>. + Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Passer en mode de test de régression qui utilise une chaîne spéciale dans laquelle les blocs sont résolus instantanément. @@ -2790,6 +2886,10 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. Avertissement : wallet.dat corrompu, données récupérées ! Le fichier wallet.dat original a été enregistré en tant que wallet.{timestamp}.bak dans %s ; si votre solde ou transactions sont incorrects vous devriez effectuer une restauration depuis une sauvegarde. + + Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times. + Pairs de la liste blanche se connectant à partir du masque réseau ou de l'IP donné. Peut être spécifié plusieurs fois. + (default: 1) (par défaut : 1) @@ -2852,7 +2952,7 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Error: A fatal internal error occured, see debug.log for details - Erreur: Une erreur fatale s'est produite, voir debug.log pour plus de détails + Erreur : une erreur interne fatale s'est produite. Voir debug.log pour des détails Error: Disk space is low! @@ -2888,7 +2988,7 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Only connect to nodes in network <net> (ipv4, ipv6 or onion) - Se connecter uniquement aux nœuds du réseau <net> (IPv4, IPv6 ou Tor) + Seulement se connecter aux nœuds du réseau <net> (IPv4, IPv6 ou oignon) Rebuild block chain index from current blk000??.dat files @@ -2910,6 +3010,10 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com This is intended for regression testing tools and app development. Ceci est à l'intention des outils de test de régression et du développement applicatif. + + Use UPnP to map the listening port (default: %u) + Utiliser l'UPnP pour mapper le port d'écoute (par défaut : %u) + Verifying blocks... Vérification des blocs en cours... @@ -2955,12 +3059,12 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Impossible d’obtenir un verrou sur le répertoire de données %s. Bitcoin Core fonctionne probablement déjà. - Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) - Créer de nouveaux fichiers avec les permissions système par défaut, au lieu de umask 077 (effectif seulement avec la fonction du portefeuille désactivée) + Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:%u) + Limiter continuellement les transactions gratuites à <n>*1000 octets par minute (par défaut : %u) - Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. - Distribué sous la licence logiciel MIT/X11, consultez le fichier joint COPYING ou <http://www.opensource.org/licenses/mit-license.php>. + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) + Créer de nouveaux fichiers avec les permissions système par défaut, au lieu de umask 077 (effectif seulement avec la fonction du portefeuille désactivée) Error: Listening for incoming connections failed (listen returned error %s) @@ -2982,6 +3086,10 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) Les frais (en BTC/Ko) inférieurs à ce seuil sont considérés comme étant nuls pour la création de transactions (par défaut : %s) + + Maximum size of data in data carrier transactions we relay and mine (default: %u) + Quantité maximale de données dans les transactions du porteur de données que nous relayons et minons (par défaut : %u) + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) Demander les adresses des pairs par recherche DNS si l'on manque d'adresses (par défaut : 1 sauf si -connect) @@ -2990,6 +3098,10 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Définir la taille maximale en octets des transactions prioritaires/à frais modiques (par défaut : %d) + + Set the number of threads for coin generation if enabled (-1 = all cores, default: %d) + Définir le nombre de fils de génération de pièces, si elle est activée (-1 = tous les cœurs, par défaut : %d) + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. Ce produit comprend des logiciels développés par le projet OpenSSL pour être utilisés dans la boîte à outils OpenSSL <https://www.openssl.org/> et un logiciel cryptographique écrit par Eric Young, ainsi qu'un logiciel UPnP écrit par Thomas Bernard. @@ -3060,7 +3172,7 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Keep at most <n> unconnectable transactions in memory (default: %u) - Garder au plus <n> blocs non connectables en mémoire (par défaut : %u) + Garder au plus <n> transactions non connectables en mémoire (par défaut : %u) Need to specify a port with -whitebind: '%s' @@ -3094,6 +3206,10 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Send trace/debug info to console instead of debug.log file Envoyer les informations de débogage/trace à la console au lieu du fichier debug.log + + Send transactions as zero-fee transactions if possible (default: %u) + Envoyer si possible les transactions comme étant sans frais (par défaut : %u) + Show all debugging options (usage: --help -help-debug) Montrer toutes les options de débogage (utilisation : --help --help-debug) @@ -3128,7 +3244,7 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Use UPnP to map the listening port (default: 1 when listening) - Utiliser l'UPnP pour rediriger le port d'écoute (par défaut : 1 lors de l'écoute) + Utiliser l'UPnP pour mapper le port d'écoute (par défaut : 1 lors de l'écoute) Username for JSON-RPC connections @@ -3202,14 +3318,166 @@ par exemple : alertnotify=echo %%s | mail -s "Alerte Bitcoin" admin@foo.com Error loading wallet.dat: Wallet corrupted Erreur lors du chargement de wallet.dat : portefeuille corrompu + + (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + (1 = conserver les métadonnées de transmission, par ex. les informations du propriétaire du compte et de la demande de paiement, 2 = abandonner les métadonnées de transmission) + + + Flush database activity from memory pool to disk log every <n> megabytes (default: %u) + Purger l’activité de la base de données de la zone de mémoire vers le journal sur disque tous les <n> mégaoctets (par défaut : %u) + + + How thorough the block verification of -checkblocks is (0-4, default: %u) + Degré de profondeur de la vérification des blocs -checkblocks (0-4, par défaut : %u) + + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: %u) + Si paytxfee n'est pas défini, inclure des frais suffisants afin que les transactions soient confirmées en moyenne en n blocs (par défaut : %u) + + + Log transaction priority and fee per kB when mining blocks (default: %u) + Lors du minage, journaliser la priorité des transactions et les frais par ko (par défaut : %u) + + + Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u) + Maintenir un index complet des transactions, utilisé par l'appel RPC getrawtransaction (obtenir la transaction brute) (par défaut : %u) + + + Number of seconds to keep misbehaving peers from reconnecting (default: %u) + Délai en secondes de refus de reconnexion pour les pairs présentant un mauvais comportement (par défaut : %u) + + + Output debugging information (default: %u, supplying <category> is optional) + Extraire les informations de débogage (par défaut : %u, fournir <category> est optionnel) + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) + Utiliser un serveur mandataire SOCKS5 séparé pour atteindre les pairs par les services cachés de Tor (par défaut : %s) + + + (default: %s) + (par défaut : %s) + + + Acceptable ciphers (default: %s) + Chiffrements acceptables (par défaut : %s) + + + Always query for peer addresses via DNS lookup (default: %u) + Toujours demander les adresses des pairs par recherche DNS (par défaut : %u) + + + Disable safemode, override a real safe mode event (default: %u) + Désactiver le mode sans échec, passer outre un événement sans échec réel (par défaut : %u) + Error loading wallet.dat Erreur lors du chargement de wallet.dat + + Force safe mode (default: %u) + Forcer le mode sans échec (par défaut : %u) + + + Generate coins (default: %u) + Générer des pièces (défaut : %u) + + + How many blocks to check at startup (default: %u, 0 = all) + Nombre de blocs à vérifier au démarrage (par défaut : %u, 0 = tous) + + + Include IP addresses in debug output (default: %u) + Inclure les adresses IP à la sortie de débogage (par défaut : %u) + Invalid -proxy address: '%s' Adresse -proxy invalide : « %s » + + Limit size of signature cache to <n> entries (default: %u) + Limiter la taille du cache des signatures à <n> entrées (par défaut : %u) + + + Listen for JSON-RPC connections on <port> (default: %u or testnet: %u) + Écouter les connexions JSON-RPC sur <port> (par défaut : %u ou tesnet : %u) + + + Listen for connections on <port> (default: %u or testnet: %u) + Écouter les connexions sur <port> (par défaut : %u ou tesnet : %u) + + + Maintain at most <n> connections to peers (default: %u) + Garder au plus <n> connexions avec les pairs (par défaut : %u) + + + Maximum per-connection receive buffer, <n>*1000 bytes (default: %u) + Tampon maximal de réception par connexion, <n>*1000 octets (par défaut : %u) + + + Maximum per-connection send buffer, <n>*1000 bytes (default: %u) + Tampon maximal d'envoi par connexion », <n>*1000 octets (par défaut : %u) + + + Only accept block chain matching built-in checkpoints (default: %u) + N'accepter qu'une chaîne de blocs correspondant aux points de vérification intégrés (par défaut : %u) + + + Prepend debug output with timestamp (default: %u) + Ajouter l'horodatage au début de la sortie de débogage (par défaut : %u) + + + Print block tree on startup (default: %u) + Imprimer l'arborescence des blocs au démarrage (par défaut : %u) + + + Relay and mine data carrier transactions (default: %u) + Relayer et miner les transactions du porteur de données (par défaut : %u) + + + Relay non-P2SH multisig (default: %u) + Relayer les multisignatures non-P2SH (par défaut : %u) + + + Run a thread to flush wallet periodically (default: %u) + Exécuter une tâche pour purger le portefeuille périodiquement (par défaut : %u) + + + Set key pool size to <n> (default: %u) + Définir la taille de la réserve de clefs à <n> (par défaut : %u) + + + Set minimum block size in bytes (default: %u) + Définir la taille de bloc minimale en octets (par défaut : %u) + + + Sets the DB_PRIVATE flag in the wallet db environment (default: %u) + Définit le drapeau DB_PRIVATE dans l'environnement de la BD du portefeuille (par défaut : %u) + + + Specify configuration file (default: %s) + Spécifier le fichier de configuration (par défaut : %s) + + + Specify connection timeout in milliseconds (minimum: 1, default: %d) + Spécifier le délai d'expiration de la connexion en millisecondes (minimum : 1, par défaut : %d) + + + Specify pid file (default: %s) + Spécifier le fichier pid (par défaut : %s) + + + Spend unconfirmed change when sending transactions (default: %u) + Dépenser la monnaie non confirmée lors de l'envoi de transactions (par défaut : %u) + + + Stop running after importing blocks from disk (default: %u) + Cesser l'exécution après l'importation des blocs du disque (par défaut : %u) + + + Threshold for disconnecting misbehaving peers (default: %u) + Seuil de déconnexion des pairs présentant un mauvais comportement (par défaut : %u) + Unknown network specified in -onlynet: '%s' Réseau inconnu spécifié sur -onlynet : « %s » diff --git a/src/qt/locale/bitcoin_fr_CA.ts b/src/qt/locale/bitcoin_fr_CA.ts index 56be717a8d..eae0b00b76 100644 --- a/src/qt/locale/bitcoin_fr_CA.ts +++ b/src/qt/locale/bitcoin_fr_CA.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -76,10 +76,6 @@ CoinControlDialog - - Address - Addresse - (no label) (pas de record) diff --git a/src/qt/locale/bitcoin_gl.ts b/src/qt/locale/bitcoin_gl.ts index 8d9295e5c9..2252baec73 100644 --- a/src/qt/locale/bitcoin_gl.ts +++ b/src/qt/locale/bitcoin_gl.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -512,10 +512,6 @@ Dirección: %4 Amount Cantidade - - Address - Dirección - Date Data @@ -818,14 +814,6 @@ Dirección: %4 &Main &Principal - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Tarifa por kB de transacción opcional que axuda a asegurar que as túas transaccións son procesadas rapidamente. A maioría das transaccións son 1 kB. - - - Pay transaction &fee - Pagar &tarifa da transacción - Automatically start Bitcoin after logging in to the system. Comezar Bitcoin automáticamente despois de loguearse no sistema. diff --git a/src/qt/locale/bitcoin_gu_IN.ts b/src/qt/locale/bitcoin_gu_IN.ts index b7b091aa39..ef99b0dd39 100644 --- a/src/qt/locale/bitcoin_gu_IN.ts +++ b/src/qt/locale/bitcoin_gu_IN.ts @@ -1,4 +1,4 @@ - + AddressBookPage diff --git a/src/qt/locale/bitcoin_he.ts b/src/qt/locale/bitcoin_he.ts index 8c05228dbf..b547058986 100644 --- a/src/qt/locale/bitcoin_he.ts +++ b/src/qt/locale/bitcoin_he.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -507,10 +507,6 @@ Address: %4 CoinControlDialog - - Coin Control Address Selection - בחירת כתובת שליטה במטבעות - Quantity: כמות: @@ -559,10 +555,6 @@ Address: %4 Amount כמות - - Address - כתובת - Date תאריך @@ -921,14 +913,6 @@ Address: %4 &Main &ראשי - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - עמלת העברה כרשות לכל ק״ב תבטיח שההעברה שלך תעובד בזריזות. רוב ההעברות הן בנפח של ק״ב אחד. - - - Pay transaction &fee - תשלום &עמלת העברה - Automatically start Bitcoin after logging in to the system. הפעלת ביטקוין אוטומטית לאחר כניסה למערכת. @@ -957,14 +941,6 @@ Address: %4 Allow incoming connections לאפשר חיבורים נכנסים - - Connect to the Bitcoin network through a SOCKS proxy. - התחברות לרשת ביטקוין דרך מתווך SOCKS. - - - &Connect through SOCKS proxy (default proxy): - הת&חברות באמצעות מתווך SOCKS (מתווך בררת מחדל): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) כתובת ה־IP של המתווך (לדוגמה IPv4: 127.0.0.1‏ / IPv6: ::1) diff --git a/src/qt/locale/bitcoin_hi_IN.ts b/src/qt/locale/bitcoin_hi_IN.ts index fcb094703f..09a8392c27 100644 --- a/src/qt/locale/bitcoin_hi_IN.ts +++ b/src/qt/locale/bitcoin_hi_IN.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -268,10 +268,6 @@ Address: %4 Amount राशि - - Address - पता - Date taareek diff --git a/src/qt/locale/bitcoin_hr.ts b/src/qt/locale/bitcoin_hr.ts index 794a7167e3..22831a0fd5 100644 --- a/src/qt/locale/bitcoin_hr.ts +++ b/src/qt/locale/bitcoin_hr.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -476,10 +476,6 @@ Adresa:%4 Amount Iznos - - Address - Adresa - Date Datum @@ -614,10 +610,6 @@ Adresa:%4 &Main &Glavno - - Pay transaction &fee - Plati &naknadu za transakciju - Automatically start Bitcoin after logging in to the system. Automatski pokreni Bitcoin kad se uključi računalo diff --git a/src/qt/locale/bitcoin_hu.ts b/src/qt/locale/bitcoin_hu.ts index 1edd2511eb..8109542405 100644 --- a/src/qt/locale/bitcoin_hu.ts +++ b/src/qt/locale/bitcoin_hu.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -520,10 +520,6 @@ Cím: %4 CoinControlDialog - - Coin Control Address Selection - Ellenőrző cím kiválasztása - Quantity: Mennyiség: @@ -572,10 +568,6 @@ Cím: %4 Amount Összeg - - Address - Cím - Date Dátum @@ -915,14 +907,6 @@ Cím: %4 &Main &Fő - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Opcionális, kB-onkénti tranzakciós díj a tranzakcióid minél gyorsabb feldolgozásának elősegítésére. A legtöbb tranzakció 1 kB-os. - - - Pay transaction &fee - Tranzakciós &díj fizetése - Automatically start Bitcoin after logging in to the system. Induljon el a Bitcoin a számítógép bekapcsolásakor @@ -935,10 +919,6 @@ Cím: %4 MB MB - - Connect to the Bitcoin network through a SOCKS proxy. - SOCKS proxyn keresztüli csatlakozás a Bitcoin hálózatához. - Reset all client options to default. Minden kliensbeállítás alapértelmezettre állítása. diff --git a/src/qt/locale/bitcoin_id_ID.ts b/src/qt/locale/bitcoin_id_ID.ts index 6056c3a736..ea2750ed08 100644 --- a/src/qt/locale/bitcoin_id_ID.ts +++ b/src/qt/locale/bitcoin_id_ID.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -504,10 +504,6 @@ Alamat: %4 CoinControlDialog - - Coin Control Address Selection - Pilihan alamat pengaturan koin - Quantity: Kuantitas: @@ -552,10 +548,6 @@ Alamat: %4 Amount Nilai - - Address - Alamat - Date Tanggal @@ -890,14 +882,6 @@ Alamat: %4 &Main &Utama - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Biaya transaksi untuk setiap kB yang membantu transaksi Andi diproses cepat (biayanya opsional). Ukuran transaksi biasanya 1kB. - - - Pay transaction &fee - Bayar &biaya transaksi - Automatically start Bitcoin after logging in to the system. Menyalakan Bitcoin secara otomatis setelah masuk ke dalam sistem. @@ -910,14 +894,6 @@ Alamat: %4 MB MB - - Connect to the Bitcoin network through a SOCKS proxy. - Menghubungkan jaringan Bitcoin lewat proxy SOCKS. - - - &Connect through SOCKS proxy (default proxy): - &Hubungkan melalui proxy SOCKS (proxy biasa): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Alamat IP proxy (cth. IPv4: 127.0.0.1 / IPv6: ::1) diff --git a/src/qt/locale/bitcoin_it.ts b/src/qt/locale/bitcoin_it.ts index ddc7e44c47..5dbe98b0f8 100644 --- a/src/qt/locale/bitcoin_it.ts +++ b/src/qt/locale/bitcoin_it.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -521,10 +521,6 @@ Indirizzo: %4 CoinControlDialog - - Coin Control Address Selection - Selezione Indirizzo Coin Control - Quantity: Quantità: @@ -573,10 +569,6 @@ Indirizzo: %4 Amount Importo - - Address - Indirizzo - Date Data @@ -943,14 +935,6 @@ Indirizzo: %4 &Main &Principale - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Commissione di transazione per kB: è opzionale e contribuisce ad assicurare che le transazioni siano elaborate velocemente. La maggior parte della transazioni ha dimensioni pari a 1 kB. - - - Pay transaction &fee - Paga la &commissione - Automatically start Bitcoin after logging in to the system. Avvia automaticamente Bitcoin una volta effettuato l'accesso al sistema. @@ -979,14 +963,6 @@ Indirizzo: %4 Allow incoming connections Permetti connessioni in entrata - - Connect to the Bitcoin network through a SOCKS proxy. - Connessione alla rete Bitcoin attraverso un proxy SOCKS. - - - &Connect through SOCKS proxy (default proxy): - &Connessione attraverso proxy SOCKS (proxy predefinito): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Indirizzo IP del proxy (es: IPv4: 127.0.0.1 / IPv6: ::1) @@ -1207,6 +1183,10 @@ Più URL vengono separati da una barra verticale |. Unconfirmed transactions to watch-only addresses Transazioni non confermate su indirizzi di sola lettura + + Mined balance in watch-only addresses that has not yet matured + l'equilibrio estratto solo nello sguardo degli indirizzi non è ancora maturo + out of sync non sincronizzato @@ -1470,6 +1450,14 @@ Più URL vengono separati da una barra verticale |. Starting Height Blocco di partenza + + Sync Height + valore di sincronizzazione + + + Ban Score + divieto di segnalazione + Connection Time Tempo di connessione @@ -1590,7 +1578,11 @@ Più URL vengono separati da una barra verticale |. Unknown Sconosciuto - + + Fetching... + attraente + + ReceiveCoinsDialog diff --git a/src/qt/locale/bitcoin_ja.ts b/src/qt/locale/bitcoin_ja.ts index c6ba60ec48..dd2d8c8c72 100644 --- a/src/qt/locale/bitcoin_ja.ts +++ b/src/qt/locale/bitcoin_ja.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -523,10 +523,6 @@ Address: %4 Amount 総額 - - Address - アドレス - Date 日付 @@ -773,14 +769,6 @@ Address: %4 &Main メイン (&M) - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - あたなの取引が早く処理されるように任意で kB 毎の取引手数料を設定します。ほとんどの取引は 1 kB です。 - - - Pay transaction &fee - 支払う取引手数料 (&f) - Automatically start Bitcoin after logging in to the system. システムにログインした時に自動的に Bitcoin を起動します。 diff --git a/src/qt/locale/bitcoin_ka.ts b/src/qt/locale/bitcoin_ka.ts index 5a566d4445..3faad159ad 100644 --- a/src/qt/locale/bitcoin_ka.ts +++ b/src/qt/locale/bitcoin_ka.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -484,10 +484,6 @@ Address: %4 CoinControlDialog - - Coin Control Address Selection - მონეტების კონტროლის მისამართის არჩევა - Quantity: რაოდენობა: @@ -532,10 +528,6 @@ Address: %4 Amount თანხა - - Address - მისამართი - Date თარიღი @@ -878,14 +870,6 @@ Address: %4 &Main &მთავარი - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - დამატებითი საკომისიო თითო კილობაიტზე; აჩქარებს ტრანსაქციის შესრულებას. ტრანსაქციების უმეტესობა არის 1 კბ. - - - Pay transaction &fee - ტრანსაქციის სა&ფასურის გადახდა - Automatically start Bitcoin after logging in to the system. სისტემაში შესვლის შემდეგ Bitcoin-ის ავტომატური გაშვება. @@ -906,14 +890,6 @@ Address: %4 Number of script &verification threads სკრიპტის &ვერიფიცირების ნაკადების რაოდენობა - - Connect to the Bitcoin network through a SOCKS proxy. - Bitcoin-ქსელზე მიერთება SOCKS-პროქსით. - - - &Connect through SOCKS proxy (default proxy): - SO&CKS (ნაგულისხმევი) პროქსი მიერთებისათვის: - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) პროქსის IP-მისამართი (მაგ.: IPv4: 127.0.0.1 / IPv6: ::1) diff --git a/src/qt/locale/bitcoin_kk_KZ.ts b/src/qt/locale/bitcoin_kk_KZ.ts index e9eddd503c..3d38b00217 100644 --- a/src/qt/locale/bitcoin_kk_KZ.ts +++ b/src/qt/locale/bitcoin_kk_KZ.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -84,10 +84,6 @@ CoinControlDialog - - Address - Адрес - (no label) (таңбасыз) diff --git a/src/qt/locale/bitcoin_ko_KR.ts b/src/qt/locale/bitcoin_ko_KR.ts index a8a2fbd16a..efc41ec6b7 100644 --- a/src/qt/locale/bitcoin_ko_KR.ts +++ b/src/qt/locale/bitcoin_ko_KR.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -504,10 +504,6 @@ Address: %4 CoinControlDialog - - Coin Control Address Selection - 코인 컨트롤 주소 선택 - Quantity: 수량: @@ -556,10 +552,6 @@ Address: %4 Amount 거래량 - - Address - 주소 - Date 날짜 @@ -894,14 +886,6 @@ Address: %4 &Main 메인(&M) - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - 당신의 거래가 더욱 빠르게 처리될 수 있도록 선택적으로 kBd당 거래 수수료를 지정합니다. 참고로 대부분의 거래들은 1kB입니다. - - - Pay transaction &fee - 송금 수수료(&F) - Automatically start Bitcoin after logging in to the system. 시스템 로그인후에 비트코인을 자동으로 시작합니다. @@ -930,14 +914,6 @@ Address: %4 Allow incoming connections 연결 요청을 허용합니다. - - Connect to the Bitcoin network through a SOCKS proxy. - SOCKS 프록시를 통해 비트코인 네트워크 연결 - - - &Connect through SOCKS proxy (default proxy): - SOCKS 프록시를 거쳐 연결합니다 (기본값 프록시): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) 프록시 아이피 주소(예. IPv4:127.0.0.1 / IPv6: ::1) @@ -1727,6 +1703,10 @@ Address: %4 Enter a label for this address to add it to the list of used addresses 사용된 주소 목록에 새 주소를 추가하기 위해 제목을 입력합니다. + + A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network. + 비트코인에 첨부된 메시지: 참고용으로 거래와 함께 저장될 URI. 메모: 이 메시지는 비트코인 네트워크로 전송되지 않습니다. + This is an unverified payment request. 지급요청 미확인입니다 @@ -2468,6 +2448,10 @@ Address: %4 Failed to listen on any port. Use -listen=0 if you want this. 어떤 포트도 반응하지 않습니다. 사용자 반응=0 만약 원한다면 + + If <category> is not supplied, output all debugging information. + <카테고리>가 제공되지 않을 경우, 모든 디버깅 정보를 출력 + Importing... 들여오기 중... diff --git a/src/qt/locale/bitcoin_ky.ts b/src/qt/locale/bitcoin_ky.ts index 91b3ccaf10..ed7542261c 100644 --- a/src/qt/locale/bitcoin_ky.ts +++ b/src/qt/locale/bitcoin_ky.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -72,10 +72,6 @@ CoinControlDialog - - Address - Дарек - Date Дата diff --git a/src/qt/locale/bitcoin_la.ts b/src/qt/locale/bitcoin_la.ts index cc43762310..c399f36159 100644 --- a/src/qt/locale/bitcoin_la.ts +++ b/src/qt/locale/bitcoin_la.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -416,10 +416,6 @@ Inscriptio: %4 Amount Quantitas - - Address - Inscriptio - Date Dies @@ -562,14 +558,6 @@ Inscriptio: %4 &Main &Princeps - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Optionalis merces transactionum singulis kB quae adiuvat curare tuas transactiones processas esse celeriter. Plurimi transactiones 1kB sunt. - - - Pay transaction &fee - Solve &mercedem transactionis - Automatically start Bitcoin after logging in to the system. Pelle Bitcoin per se postquam in systema inire. diff --git a/src/qt/locale/bitcoin_lt.ts b/src/qt/locale/bitcoin_lt.ts index b195a75d0f..1f70400df6 100644 --- a/src/qt/locale/bitcoin_lt.ts +++ b/src/qt/locale/bitcoin_lt.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -475,10 +475,6 @@ Adresas: %4 Amount Suma - - Address - Adresas - Date Data @@ -705,10 +701,6 @@ Adresas: %4 &Main &Pagrindinės - - Pay transaction &fee - &Mokėti sandorio mokestį - Automatically start Bitcoin after logging in to the system. Automatiškai paleisti Bitkoin programą įjungus sistemą. diff --git a/src/qt/locale/bitcoin_lv_LV.ts b/src/qt/locale/bitcoin_lv_LV.ts index f901b14d36..ac5a1a1396 100644 --- a/src/qt/locale/bitcoin_lv_LV.ts +++ b/src/qt/locale/bitcoin_lv_LV.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -274,6 +274,10 @@ Open &URI... Atvērt &URI... + + Bitcoin Core client + Bitcoin Core klients + Importing blocks from disk... Importē blokus no diska... @@ -324,7 +328,11 @@ &Receive - Saņe&mt + &Saņemt + + + Show information about Bitcoin Core + Parādīt informāciju par Bitcoin Core &Show / Hide @@ -476,10 +484,6 @@ Adrese: %4 CoinControlDialog - - Coin Control Address Selection - Bitcoin Kontroles Adrešu Atlase - Quantity: Daudzums: @@ -524,10 +528,6 @@ Adrese: %4 Amount Daudzums - - Address - Adrese - Date Datums @@ -826,10 +826,6 @@ Adrese: %4 &Main &Galvenais - - Pay transaction &fee - &Maksāt par transakciju - Automatically start Bitcoin after logging in to the system. Automātiski sākt Bitcoin pēc pieteikšanās sistēmā. @@ -850,14 +846,6 @@ Adrese: %4 Number of script &verification threads Skriptu &pārbaudes pavedienu skaits - - Connect to the Bitcoin network through a SOCKS proxy. - Savienoties ar Bitcoin tīklu caur SOCKS starpniekserveri. - - - &Connect through SOCKS proxy (default proxy): - &Savienoties caur SOCKS starpniekserveri (noklusējuma starpniekserveris) - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Starpniekservera IP adrese (piem. IPv4: 127.0.0.1 / IPv6: ::1) diff --git a/src/qt/locale/bitcoin_mn.ts b/src/qt/locale/bitcoin_mn.ts index 515d1b90df..f1b0174111 100644 --- a/src/qt/locale/bitcoin_mn.ts +++ b/src/qt/locale/bitcoin_mn.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -287,10 +287,6 @@ Address: %4 Amount Хэмжээ - - Address - Хаяг - Date Огноо @@ -401,10 +397,6 @@ Address: %4 MB МБ - - Connect to the Bitcoin network through a SOCKS proxy. - Биткойны сүлжээрүү SOCKS проксигоор холбогдох. - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) проксигийн IP хаяг (жишээ нь: IPv4: 127.0.0.1 / IPv6: ::1) diff --git a/src/qt/locale/bitcoin_ms_MY.ts b/src/qt/locale/bitcoin_ms_MY.ts index 47e74111c2..d2e8efbb49 100644 --- a/src/qt/locale/bitcoin_ms_MY.ts +++ b/src/qt/locale/bitcoin_ms_MY.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -72,10 +72,6 @@ CoinControlDialog - - Address - Alamat - EditAddressDialog diff --git a/src/qt/locale/bitcoin_nb.ts b/src/qt/locale/bitcoin_nb.ts index 435a412d09..bdde3da534 100644 --- a/src/qt/locale/bitcoin_nb.ts +++ b/src/qt/locale/bitcoin_nb.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -525,8 +525,8 @@ Adresse: %4 CoinControlDialog - Coin Control Address Selection - Myntkontroll Adresse Valg + Coin Selection + Mynt Valg Quantity: @@ -577,8 +577,12 @@ Adresse: %4 Beløp - Address - Adresse + Received with label + Mottatt med merkelapp + + + Received with address + Mottatt med adresse Date @@ -954,14 +958,6 @@ Adresse: %4 &Main &Hoved - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Valgfritt transaksjonsgebyr per kB som sikrer at dine transaksjoner blir raskt prosessert. De fleste transaksjoner er 1 kB. - - - Pay transaction &fee - Betal &transaksjonsgebyr - Automatically start Bitcoin after logging in to the system. Start Bitcoin automatisk etter innlogging. @@ -990,14 +986,6 @@ Adresse: %4 Allow incoming connections Tillatt innkommende tilkoblinger - - Connect to the Bitcoin network through a SOCKS proxy. - Koble til Bitcoin-nettverket gjennom en SOCKS proxy. - - - &Connect through SOCKS proxy (default proxy): - &Koble til gjennom SOCKS proxy (standardvalg proxy): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) IP-adressen til proxyen (f.eks. IPv4: 127.0.0.1 / IPv6: ::1) @@ -1058,6 +1046,14 @@ Adresse: %4 Map port using &UPnP Sett opp port ved hjelp av &UPnP + + Connect to the Bitcoin network through a SOCKS5 proxy. + Koble til Bitcoin-nettverket gjennom en SOCKS5 proxy. + + + &Connect through SOCKS5 proxy (default proxy): + &Koble til gjennom SOCKS5 proxy (standardvalg proxy): + Proxy &IP: Proxy &IP: @@ -1848,6 +1844,78 @@ Adresse: %4 Custom change address Egendefinert adresse for veksel + + Transaction Fee: + Transaksjonsgebyr: + + + Choose... + Velg... + + + collapse fee-settings + Legg ned gebyrinnstillinger + + + Minimize + Minimer + + + If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte. + Hvis den egendefinerte avgiften er satt til 1000 satoshis og transaksjonen bare er 250 bytes, da vil "per kilobyte" bare betale 250 satoshis i gebyr, mens "minst" betaler 1000 satoshis. For transaksjoner større enn en kilobyte vil begge betale for antall kilobyte. + + + per kilobyte + per kilobyte + + + If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "total at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte. + Hvis den egendefinerte avgiften er satt til 1000 satoshis og transaksjonen bare er 250 bytes, da vil "per kilobyte" bare betale 250 satoshis i gebyr, mens "minstebeløp" betaler 1000 satoshis. For transaksjoner større enn en kilobyte vil begge betale for antall kilobyte. + + + total at least + minstebeløp + + + Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process. + Betaling av bare minimumsavgiften går helt fint så lenge det er mindre transaksjonsvolum enn plass i blokkene. Men vær klar over at dette kan ende opp i en transaksjon som aldri blir bekreftet når det er mer etterspørsel etter Bitcoin-transaksjoner enn nettverket kan behandle. + + + (read the tooltip) + (les verktøytipset) + + + Recommended: + Anbefalt: + + + Custom: + Egendefinert: + + + (Smart fee not initialized yet. This usually takes a few blocks...) + (Smartgebyr ikke innført ennå. Dette tar vanligvis noen blokker...) + + + Confirmation time: + Bekreftelsestid: + + + normal + normal + + + fast + rask + + + Send as zero-fee transaction if possible + Send uten transaksjonsgebyr hvis mulig + + + (confirmation may take longer) + (bekreftelse kan ta lengre tid) + Send to multiple recipients at once Send til flere enn en mottaker @@ -1952,6 +2020,18 @@ Adresse: %4 The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Transaksjonen ble avvist! Dette kan skje hvis noen av myntene i lommeboken allerede er brukt, som hvis du kopierte wallet.dat og mynter ble brukt i kopien uten å bli markert som brukt her. + + A fee higher than %1 is considered an insanely high fee. + Et gebyr høyere enn %1 er ansett som et sinnsykt høyt gebyr. + + + Pay only the minimum fee of %1 + Betal kun minimumsgebyret på %1 + + + Estimated to begin confirmation within %1 block(s). + Beregner å begynne bekreftelse innen %1 blokk(er). + Warning: Invalid Bitcoin address Advarsel: Ugyldig Bitcoin-adresse @@ -2757,6 +2837,10 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comDelete all wallet transactions and only recover those parts of the blockchain through -rescan on startup Slett alle transaksjoner i lommeboken og gjenopprett kun de delene av blokkjeden gjennom -rescan ved oppstart + + Distributed under the MIT software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + Distribuert under MIT programvarelisensen, se medfølgende fil COPYING eller <http://www.opensource.org/licenses/mit-license.php>. + Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Gå til modus for regresjonstesting, som bruker en spesiell blokkjede der blokker kan bli løst momentant. @@ -2989,10 +3073,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comCreate new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) Opprett nye filer med standardtillatelser i systemet, i stedet for umask 077 (kun virksom med lommebokfunksjonalitet slått av) - - Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. - Distribuert under MIT/X11 programvarelisensen, se medfølgende fil COPYING eller <http://www.opensource.org/licenses/mit-license.php>. - Error: Listening for incoming connections failed (listen returned error %s) Feil: Lytting etter innkommende tilkoblinger feilet (lytting returnerte feil %s) @@ -3013,6 +3093,10 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comFees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) Gebyrer (i BTC/Kb) mindre enn dette anses som null gebyr for laging av transaksjoner (standardverdi: %s) + + Maximum size of data in data carrier transactions we relay and mine (default: %u) + Maksimal størrelse på data i databærende transaksjoner vi videresender og ufører graving på (standardverdi: %u) + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) Søk etter nodeadresser via DNS-oppslag, hvis vi har få adresser å koble til (standard: 1 med mindre -connect) @@ -3021,6 +3105,10 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comSet maximum size of high-priority/low-fee transactions in bytes (default: %d) Sett maksimum størrelse for transaksjoner med høy prioritet / lavt gebyr, i bytes (standardverdi: %d) + + Set the number of threads for coin generation if enabled (-1 = all cores, default: %d) + Angi antall tråder for mynt generering hvis aktivert (-1 = alle kjerner, standardverdi: %d) + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. Dette produktet inneholder programvare utviklet av OpenSSL Project for bruk i OpenSSL Toolkit <https://www.openssl.org/> og kryptografisk programvare skrevet av Eric Young og UPnP-programvare skrevet av Thomas Bernard. @@ -3125,6 +3213,10 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comSend trace/debug info to console instead of debug.log file Send spor-/feilsøkingsinformasjon til konsollen istedenfor filen debug.log + + Send transactions as zero-fee transactions if possible (default: %u) + Send transaksjoner uten transaksjonsgebyr hvis mulig (standardverdi: %u) + Show all debugging options (usage: --help -help-debug) Vis alle feilsøkingsvalg (bruk: --help -help-debug) @@ -3265,10 +3357,6 @@ For eksempel: varselmelding=echo %%s | mail -s "Bitcoin Varsel" admin@foo.comOutput debugging information (default: %u, supplying <category> is optional) Ta ut feilsøkingsinformasjon (standardverdi: %u, bruk av <category> er valgfritt) - - Set the processor limit for when generation is on (-1 = unlimited, default: %d) - Sett prosessorgrensen for når blokkutvinning er på (-1 = ubegrenset, standardverdi: %d) - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) Bruk separate SOCKS5 proxyer for å nå noder via Tor skjulte tjenester (standardverdi: %s) diff --git a/src/qt/locale/bitcoin_nl.ts b/src/qt/locale/bitcoin_nl.ts index fb81042d8e..e57362d7fd 100644 --- a/src/qt/locale/bitcoin_nl.ts +++ b/src/qt/locale/bitcoin_nl.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -183,6 +183,10 @@ Wallet encrypted Portemonnee versleuteld + + 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>. + Vul een nieuw + Bitcoin 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. Bitcoin zal nu afsluiten om het versleutelingsproces te voltooien. Onthoud dat het versleutelen van uw portemonnee u niet volledig kan beschermen: Malware kan uw computer infecteren en uw bitcoins stelen. @@ -516,10 +520,6 @@ Adres: %4 CoinControlDialog - - Coin Control Address Selection - Coin controle adres selectie - Quantity: Kwantiteit @@ -568,10 +568,6 @@ Adres: %4 Amount Bedrag - - Address - Adres - Date Datum @@ -942,14 +938,6 @@ Adres: %4 &Main &Algemeen - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Optionele transactiekosten per kB. Transactiekosten helpen ervoor te zorgen dat uw transacties snel verwerkt worden. De meeste transacties zijn 1kB. - - - Pay transaction &fee - Betaal &transactiekosten - Automatically start Bitcoin after logging in to the system. Start Bitcoin automatisch na inloggen in het systeem @@ -978,14 +966,6 @@ Adres: %4 Allow incoming connections Sta inkomende verbindingen toe - - Connect to the Bitcoin network through a SOCKS proxy. - Verbind met het Bitcoin-netwerk via een SOCKS-proxy. - - - &Connect through SOCKS proxy (default proxy): - &Verbind via een SOCKS-proxy (standaardproxy): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) IP-adres van de proxy (bijv. IPv4: 127.0.0.1 / IPv6: ::1) @@ -1149,6 +1129,10 @@ Adres: %4 The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet. De weergegeven informatie kan verouderd zijn. Uw portemonnee synchroniseert automaticsh met het Bitcoinnetwerk nadat een verbinding is gelegd, maar dit proces is nog niet voltooid. + + Watch-only: + Alleen-bekijkbaar: + Available: Beschikbaar: diff --git a/src/qt/locale/bitcoin_pam.ts b/src/qt/locale/bitcoin_pam.ts index c42cc73484..b0a92a1578 100644 --- a/src/qt/locale/bitcoin_pam.ts +++ b/src/qt/locale/bitcoin_pam.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -388,10 +388,6 @@ Address: %4 Amount Alaga - - Address - Address - Date Kaaldauan @@ -534,10 +530,6 @@ Address: %4 &Main &Pun - - Pay transaction &fee - Mamayad &bayad para king transaksion - Automatically start Bitcoin after logging in to the system. Umpisan yang antimu ing Bitcoin kaibat mekapag-log in king sistema. diff --git a/src/qt/locale/bitcoin_pl.ts b/src/qt/locale/bitcoin_pl.ts index 25d04a0d49..c53a9970ef 100644 --- a/src/qt/locale/bitcoin_pl.ts +++ b/src/qt/locale/bitcoin_pl.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -556,10 +556,6 @@ Adres: %4 Amount Kwota - - Address - Adres - Date Data @@ -914,14 +910,6 @@ Adres: %4 &Main Główne - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Opcjonalna prowizja za transakcje za kB, wspomaga ona szybkość przebiegu transakcji. Większość transakcji jest 1 kB. - - - Pay transaction &fee - Płać prowizję za transakcje - Automatically start Bitcoin after logging in to the system. Automatycznie uruchamia Bitcoin po zalogowaniu do systemu. @@ -946,10 +934,6 @@ Adres: %4 Allow incoming connections Zezwól na połączenia przychodzące - - Connect to the Bitcoin network through a SOCKS proxy. - Połącz się z siecią Bitcoin poprzez SOCKS proxy. - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Adres IP serwera proxy (np. IPv4: 127.0.0.1 / IPv6: ::1) diff --git a/src/qt/locale/bitcoin_pt_BR.ts b/src/qt/locale/bitcoin_pt_BR.ts index cbd730bde4..65f07ca59c 100644 --- a/src/qt/locale/bitcoin_pt_BR.ts +++ b/src/qt/locale/bitcoin_pt_BR.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -519,10 +519,6 @@ Endereço: %4 CoinControlDialog - - Coin Control Address Selection - Coin Control Address Selection - Quantity: Quantidade: @@ -571,10 +567,6 @@ Endereço: %4 Amount Quantidade - - Address - Endereço - Date Data @@ -907,7 +899,15 @@ Endereço: %4 Error Erro - + + %n GB of free space available + %n GB de espaço livre disponível%n GB de espaço livre disponível + + + (of %n GB needed) + (de %n GB necessário)(de %n GB necessário) + + OpenURIDialog @@ -941,14 +941,6 @@ Endereço: %4 &Main Principal - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Taxa de transação opcional por kB que ajuda a garantir que suas transações sejam processadas rapidamente. A maioria das transações são de 1 kB. - - - Pay transaction &fee - Pagar taxa de &transação - Automatically start Bitcoin after logging in to the system. Iniciar Bitcoin automaticamente após se logar no sistema. @@ -977,14 +969,6 @@ Endereço: %4 Allow incoming connections Permitir conexões de entrada - - Connect to the Bitcoin network through a SOCKS proxy. - Conectado na rede do Bitcoin através de proxy SOCKS. - - - &Connect through SOCKS proxy (default proxy): - &Conectado via proxy SOCKS (padrão proxy): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Endereço de IP do proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) @@ -1176,6 +1160,10 @@ Endereço: %4 Mined balance that has not yet matured Saldo minerado que ainda não maturou + + Balances + Saldos + Total: Total: @@ -1188,6 +1176,10 @@ Endereço: %4 Your current balance in watch-only addresses Sua balança atual em endereços apenas visualizados + + Recent transactions + Transações recentes + out of sync fora de sincronia diff --git a/src/qt/locale/bitcoin_pt_PT.ts b/src/qt/locale/bitcoin_pt_PT.ts index edb1e87b6f..dc016623e4 100644 --- a/src/qt/locale/bitcoin_pt_PT.ts +++ b/src/qt/locale/bitcoin_pt_PT.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -507,10 +507,6 @@ Endereço: %4 CoinControlDialog - - Coin Control Address Selection - Seleção de Endereço Coin Control - Quantity: Quantidade: @@ -555,10 +551,6 @@ Endereço: %4 Amount Quantia - - Address - Endereço - Date Data @@ -905,14 +897,6 @@ Endereço: %4 &Main &Principal - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Taxa de transação opcional por KB que ajuda a assegurar que as suas transações serão processadas rapidamente. A maioria das transações tem 1 kB. - - - Pay transaction &fee - Pagar &taxa de transação - Automatically start Bitcoin after logging in to the system. Começar o Bitcoin automaticamente ao iniciar sessão no sistema. @@ -933,14 +917,6 @@ Endereço: %4 Number of script &verification threads Número de processos de &verificação de scripts - - Connect to the Bitcoin network through a SOCKS proxy. - Ligar à rede Bitcoin através de um proxy SOCKS. - - - &Connect through SOCKS proxy (default proxy): - Ligar através de um proxy SO&CKS (proxy por defeito): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Endereço IP do proxy (p.ex. IPv4: 127.0.0.1 / IPv6: ::1) diff --git a/src/qt/locale/bitcoin_ro_RO.ts b/src/qt/locale/bitcoin_ro_RO.ts index a20bc677a0..ccae9482da 100644 --- a/src/qt/locale/bitcoin_ro_RO.ts +++ b/src/qt/locale/bitcoin_ro_RO.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -500,10 +500,6 @@ Adresa: %4 CoinControlDialog - - Coin Control Address Selection - Selectare Adresă de Comandă Monedă - Quantity: Cantitate: @@ -548,10 +544,6 @@ Adresa: %4 Amount Sumă - - Address - Adresă - Date Data @@ -882,14 +874,6 @@ Adresa: %4 &Main &Principal - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Taxa optionala de tranzactie per kB care ajuta ca tranzactiile dumneavoastra sa fie procesate rapid. Majoritatea tranzactiilor sunt 1 kB. - - - Pay transaction &fee - Plăteşte comision pentru tranzacţie &f - Automatically start Bitcoin after logging in to the system. Porneşte automat programul Bitcoin la pornirea computerului. @@ -902,10 +886,6 @@ Adresa: %4 MB MB - - Connect to the Bitcoin network through a SOCKS proxy. - Conecteaza-te la reteaua Bitcoin printr-un proxy SOCKS - Reset all client options to default. Resetează toate setările clientului la valorile implicite. diff --git a/src/qt/locale/bitcoin_ru.ts b/src/qt/locale/bitcoin_ru.ts index 93c116d0a2..fa66297779 100644 --- a/src/qt/locale/bitcoin_ru.ts +++ b/src/qt/locale/bitcoin_ru.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -520,10 +520,6 @@ Address: %4 CoinControlDialog - - Coin Control Address Selection - Выбор адреса контроля монет - Quantity: Количество: @@ -573,8 +569,12 @@ Address: %4 Сумма - Address - Адрес + Received with label + Получено с пометкой + + + Received with address + Получено с адреса Date @@ -950,14 +950,6 @@ Address: %4 &Main &Главная - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Необязательная комиссия за каждый КБ транзакции, которая ускоряет обработку Ваших транзакций. Большинство транзакций занимают 1КБ. - - - Pay transaction &fee - Заплатить ко&миссию - Automatically start Bitcoin after logging in to the system. Автоматически запускать Bitcoin после входа в систему @@ -986,14 +978,6 @@ Address: %4 Allow incoming connections Разрешить входящие подключения - - Connect to the Bitcoin network through a SOCKS proxy. - Подключаться к сети Bitcoin через прокси SOCKS. - - - &Connect through SOCKS proxy (default proxy): - &Подключаться через SOCKS прокси (прокси по умолчанию): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) IP-адрес прокси (например IPv4: 127.0.0.1 / IPv6: ::1) @@ -1054,6 +1038,14 @@ Address: %4 Map port using &UPnP Пробросить порт через &UPnP + + Connect to the Bitcoin network through a SOCKS5 proxy. + Подключаться к сети Bitcoin через прокси SOCKS5 + + + &Connect through SOCKS5 proxy (default proxy): + &Подключаться к сети Bitcoin через прокси SOCKS5 (прокси по умолчанию): + Proxy &IP: &IP Прокси: @@ -1844,6 +1836,54 @@ Address: %4 Custom change address Свой адрес для сдачи + + Transaction Fee: + Комиссия + + + Choose... + Выберите... + + + Minimize + Сворачивать + + + per kilobyte + за килобайт + + + total at least + Итого + + + Recommended: + Рекомендовано: + + + Custom: + Выборочно: + + + Confirmation time: + Время подтверждения: + + + normal + обычный + + + fast + ускоренный + + + Send as zero-fee transaction if possible + Осуществить транзакцию бесплатно, если возможно + + + (confirmation may take longer) + (подтверждение может занять больше времени) + Send to multiple recipients at once Отправить нескольким получателям одновременно @@ -1948,6 +1988,14 @@ Address: %4 The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Транзакция была отклонена! Такое может произойти, если некоторые монеты уже были потрачены, например, если Вы используете одну копию бумажника (wallet.dat), а монеты были потрачены из другой копии, но не были отмечены как потраченные в этой. + + A fee higher than %1 is considered an insanely high fee. + Комиссия больше, чем %1, считается невероятно большой. + + + Estimated to begin confirmation within %1 block(s). + Ожидается начать подтверждение через %1 блок(ов). + Warning: Invalid Bitcoin address Внимание: неверный адрес Bitcoin @@ -2802,6 +2850,10 @@ rpcpassword=%s Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. Внимание: wallet.dat повреждён, данные спасены! Оригинальный wallet.dat сохранён как wallet.{timestamp}.bak в %s; если ваш баланс или транзакции некорректны, вы должны восстановить файл из резервной копии. + + Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times. + Вносить в белый список участников, подключающихся с указанной маски сети или IP. Можно использовать многократно. + (default: 1) (по умолчанию: 1) @@ -2922,6 +2974,10 @@ rpcpassword=%s This is intended for regression testing tools and app development. Это рассчитано на инструменты регрессионного тестирования и разработку приложений. + + Use UPnP to map the listening port (default: %u) + Использовать UPnP для проброса порта (по умолчанию: %u) + Verifying blocks... Проверка блоков... @@ -2967,12 +3023,12 @@ rpcpassword=%s Не удалось установить блокировку на каталог данных %s. Возможно, Bitcoin Core уже запущен. - Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) - Создавать новые файлы с системными правами по умолчанию вместо umask 077 (эффективно только при отключенном бумажнике) + Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:%u) + Ограничить скорость передачи бесплатных транзакций до <n>*1000 байт в минуту (по умолчанию: %u) - Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. - Распространяется под лицензией MIT/X11, см. приложенный файл COPYING или <http://www.opensource.org/licenses/mit-license.php>. + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) + Создавать новые файлы с системными правами по умолчанию вместо umask 077 (эффективно только при отключенном бумажнике) Error: Listening for incoming connections failed (listen returned error %s) @@ -2994,6 +3050,10 @@ rpcpassword=%s Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) Комиссии (в BTC/Кб) меньшие этого значения считаются нулевыми для создания транзакции (по умолчанию: %s) + + Maximum size of data in data carrier transactions we relay and mine (default: %u) + Наибольший размер данных в носителе данных транзакций, которые мы передаем и генерируем (по умолчанию: %u) + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) Запрашивать адреса участников с помощью DNS, если адресов мало (по умолчанию: 1, если не указан -connect) @@ -3002,6 +3062,10 @@ rpcpassword=%s Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Задать максимальный размер высокоприоритетных/низкокомиссионных транзакций в байтах (по умолчанию: %d) + + Set the number of threads for coin generation if enabled (-1 = all cores, default: %d) + Задать число потоков генерации монет, если включена (-1 = число ядер процессора, по умолчанию: %d) + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. Этот продукт включает ПО, разработанное OpenSSL Project для использования в OpenSSL Toolkit <https://www.openssl.org/> и криптографическое ПО, написанное Eric Young и ПО для работы с UPnP, написанное Thomas Bernard. @@ -3106,6 +3170,10 @@ rpcpassword=%s Send trace/debug info to console instead of debug.log file Выводить информацию трассировки/отладки на консоль вместо файла debug.log + + Send transactions as zero-fee transactions if possible (default: %u) + Осуществить транзакцию бесплатно, если возможно (по умолчанию: %u) + Show all debugging options (usage: --help -help-debug) Показать все отладочные параметры (использование: --help -help-debug) @@ -3214,18 +3282,174 @@ rpcpassword=%s Error loading wallet.dat: Wallet corrupted Ошибка загрузки wallet.dat: Бумажник поврежден + + (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + (1 = сохранять метаданные транзакции: например, владельца аккаунта и информацию запроса платежа; 2 = отбросить метаданные) + + + Flush database activity from memory pool to disk log every <n> megabytes (default: %u) + Сбрасывать активность базы данных из памяти на диск каждые <n> мегабайт (по умолчанию: %u) + + + How thorough the block verification of -checkblocks is (0-4, default: %u) + Насколько тщательна проверка контрольных блоков -checkblocks (0-4, по умолчанию: %u) + + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: %u) + Если paytxfee не задан, включить достаточную комиссию для подтверждения транзакции в среднем за n блоков (по умолчанию: %u) + + + Log transaction priority and fee per kB when mining blocks (default: %u) + Записывать в лог приоритет транзакции и комиссию на килобайт во время добычи блоков (по умолчанию: %u) + + + Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u) + Держать полный индекс транзакций, используемый RPC-запросом getrawtransaction (по умолчанию: %u) + + + Number of seconds to keep misbehaving peers from reconnecting (default: %u) + Число секунд блокирования неправильно ведущих себя узлов (по умолчанию: %u) + + + Output debugging information (default: %u, supplying <category> is optional) + Выводить отладочную информацию (по умолчанию: %u, указание <category> необязательно) + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) + Использовать отдельный прокси SOCKS5 для соединения с участниками через скрытые сервисы Tor (по умолчанию: %s) + (default: %s) (по умолчанию: %s) + + Acceptable ciphers (default: %s) + Допустимые шифры (по умолчанию: %s) + + + Always query for peer addresses via DNS lookup (default: %u) + Всегда запрашивать адреса участников с помощью DNS (по умолчанию: %u) + + + Disable safemode, override a real safe mode event (default: %u) + Отключить безопасный режим, отклонить реальное событие безопасного режима (по умолчанию: %u) + Error loading wallet.dat Ошибка при загрузке wallet.dat + + Force safe mode (default: %u) + Принудительный безопасный режим (по умолчанию: %u) + + + Generate coins (default: %u) + Включить добычу монет (по умолчанию: %u) + + + How many blocks to check at startup (default: %u, 0 = all) + Сколько блоков проверять при запуске (по умолчанию: %u, 0 = все) + + + Include IP addresses in debug output (default: %u) + Включить IP-адреса в отладочный вывод (по умолчанию: %u) + Invalid -proxy address: '%s' Неверный адрес -proxy: '%s' + + Limit size of signature cache to <n> entries (default: %u) + Ограничить размер кэша подписей <n> записями (по умолчанию: %u) + + + Listen for JSON-RPC connections on <port> (default: %u or testnet: %u) + Прослушивать подключения JSON-RPC на <порту> (по умолчанию: %u или %u в тестовой сети) + + + Listen for connections on <port> (default: %u or testnet: %u) + Принимать входящие подключения на <port> (по умолчанию: %u или %u в тестовой сети) + + + Maintain at most <n> connections to peers (default: %u) + Поддерживать не более <n> подключений к узлам (по умолчанию: %u) + + + Maximum per-connection receive buffer, <n>*1000 bytes (default: %u) + Максимальный размер буфера приёма на соединение, <n>*1000 байт (по умолчанию: %u) + + + Maximum per-connection send buffer, <n>*1000 bytes (default: %u) + Максимальный размер буфера отправки на соединение, <n>*1000 байт (по умолчанию: %u) + + + Only accept block chain matching built-in checkpoints (default: %u) + Принимать цепь блоков, лишь если она соответствует встроенным контрольным точкам (по умолчанию: %u) + + + Prepend debug output with timestamp (default: %u) + Дописывать отметки времени к отладочному выводу (по умолчанию: %u) + + + Print block tree on startup (default: %u) + Печатать дерево блоков при запуске (по умолчанию: %u) + + + Relay and mine data carrier transactions (default: %u) + Транслировать и генерировать транзакции носителей данных (по умолчанию: %u) + + + Relay non-P2SH multisig (default: %u) + Транслировать не-P2SH мультиподпись (по умолчанию: %u) + + + Run a thread to flush wallet periodically (default: %u) + Запустить поток для периодического сохранения бумажника (по умолчанию: %u) + + + Server certificate file (default: %s) + Файл сертификата сервера (по умолчанию: %s) + + + Server private key (default: %s) + Закрытый ключ сервера (по умолчанию: %s) + + + Set key pool size to <n> (default: %u) + Установить размер пула ключей в <n> (по умолчанию: %u) + + + Set the number of threads to service RPC calls (default: %d) + Задать число потоков выполнения запросов RPC (по умолчанию: %d) + + + Sets the DB_PRIVATE flag in the wallet db environment (default: %u) + Установить флаг DB_PRIVATE в окружении базы данных бумажника (по умолчанию: %u) + + + Specify configuration file (default: %s) + Указать конфигурационный файл (по умолчанию: %s) + + + Specify connection timeout in milliseconds (minimum: 1, default: %d) + Указать тайм-аут соединения в миллисекундах (минимум: 1, по умолчанию: %d) + + + Specify pid file (default: %s) + Указать pid-файл (по умолчанию: %s) + + + Spend unconfirmed change when sending transactions (default: %u) + Тратить неподтвержденную сдачу при отправке транзакций (по умолчанию: %u) + + + Stop running after importing blocks from disk (default: %u) + Остановиться после импорта блоков с диска (по умолчанию: %u) + + + Threshold for disconnecting misbehaving peers (default: %u) + Порог для отключения неправильно ведущих себя узлов (по умолчанию: %u) + Unknown network specified in -onlynet: '%s' В параметре -onlynet указана неизвестная сеть: '%s' diff --git a/src/qt/locale/bitcoin_sah.ts b/src/qt/locale/bitcoin_sah.ts index a951e10ab9..84b973bf92 100644 --- a/src/qt/locale/bitcoin_sah.ts +++ b/src/qt/locale/bitcoin_sah.ts @@ -1,4 +1,4 @@ - + AddressBookPage diff --git a/src/qt/locale/bitcoin_sk.ts b/src/qt/locale/bitcoin_sk.ts index 7768288294..fe7c62cd60 100644 --- a/src/qt/locale/bitcoin_sk.ts +++ b/src/qt/locale/bitcoin_sk.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -422,14 +422,34 @@ Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options Zobraziť pomocnú správu od Bitcoin Jadra pre získanie zoznamu dostupných možností príkazového riadku + + %n active connection(s) to Bitcoin network + %n aktívne pripojenie do siete Bitcoin%n aktívne pripojenia do siete Bitcoin%n aktívnych pripojení do siete Bitcoin + No block source available... Nedostupný zdroj blokov... + + %n hour(s) + %n hodina%n hodiny%n hodín + + + %n day(s) + %n deň%n dni%n dní + + + %n week(s) + %n týždeň%n týždne%n týždňov + %1 and %2 %1 a %2 + + %n year(s) + %n rok%n roky%n rokov + %1 behind %1 pozadu @@ -499,10 +519,6 @@ Adresa: %4 CoinControlDialog - - Coin Control Address Selection - Coin Control výber adresy - Quantity: Množstvo: @@ -547,10 +563,6 @@ Adresa: %4 Amount Suma - - Address - Adresa - Date Dátum @@ -905,14 +917,6 @@ Adresa: %4 &Main &Hlavné - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Voliteľný transakčný poplatok za kB ktorý pomôže rýchlemu spracovaniu transakcie. Väčšina transakcií má 1 kB. Poplatok 0.01 je odporúčaný. - - - Pay transaction &fee - Zaplatiť transakčné &poplatky - Automatically start Bitcoin after logging in to the system. Automaticky spustiť Bitcoin po zapnutí počítača @@ -933,14 +937,6 @@ Adresa: %4 Number of script &verification threads Počet skript overujucich vlákien - - Connect to the Bitcoin network through a SOCKS proxy. - Pripojiť k Bitcoin sieti cez SOCKS proxy. - - - &Connect through SOCKS proxy (default proxy): - Pripojiť sa cez SOCKS proxy (predvolené proxy) - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) IP adresy proxy (napr. IPv4: 127.0.0.1 / IPv6: ::1) diff --git a/src/qt/locale/bitcoin_sl_SI.ts b/src/qt/locale/bitcoin_sl_SI.ts index ed6f813e7d..60fc4a93e5 100644 --- a/src/qt/locale/bitcoin_sl_SI.ts +++ b/src/qt/locale/bitcoin_sl_SI.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -520,10 +520,6 @@ Naslov: %4 Amount Količina - - Address - Naslov - Date Datum @@ -874,14 +870,6 @@ Naslov: %4 &Main &Glavno - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Neobvezna pristojbina k transakciji poskrbi, da je transackcija hitro opravljena. Velikost povprečne transakcije je 1 kB. - - - Pay transaction &fee - Nakazilo plačila & provizija - Automatically start Bitcoin after logging in to the system. Po prijavi v sistem samodejno zaženite Bitcoin. @@ -906,14 +894,6 @@ Naslov: %4 Allow incoming connections Dovoli prihajajoče povezave - - Connect to the Bitcoin network through a SOCKS proxy. - V Bitcoin omrežje se poveži skozu SOCKS proxy. - - - &Connect through SOCKS proxy (default proxy): - &Poveži se skozi SOCKS proxy (privzet proxy): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) IP naslov proxy strežnika (npr. IPv4: 127.0.0.1 ali IPv6: ::1) diff --git a/src/qt/locale/bitcoin_sq.ts b/src/qt/locale/bitcoin_sq.ts index 0c60e482fe..7e63f239ca 100644 --- a/src/qt/locale/bitcoin_sq.ts +++ b/src/qt/locale/bitcoin_sq.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -196,10 +196,6 @@ Amount Sasia - - Address - Adresë - Date Data diff --git a/src/qt/locale/bitcoin_sr.ts b/src/qt/locale/bitcoin_sr.ts index c3dc42e2f3..64c68a2226 100644 --- a/src/qt/locale/bitcoin_sr.ts +++ b/src/qt/locale/bitcoin_sr.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -264,10 +264,6 @@ Address: %4 Amount iznos - - Address - Адреса - Date datum diff --git a/src/qt/locale/bitcoin_sv.ts b/src/qt/locale/bitcoin_sv.ts index 39cca4b278..551f6976cf 100644 --- a/src/qt/locale/bitcoin_sv.ts +++ b/src/qt/locale/bitcoin_sv.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -479,6 +479,10 @@ Var vänlig och försök igen. Up to date Uppdaterad + + Processed %n blocks of transaction history. + Bearbetat %n block av transaktionshistoriken.Bearbetat %n block av transaktionshistoriken. + Catching up... Hämtar senaste... @@ -522,8 +526,8 @@ Adress: %4 CoinControlDialog - Coin Control Address Selection - Adressval för myntkontroll + Coin Selection + Myntval Quantity: @@ -574,8 +578,12 @@ Adress: %4 Mängd - Address - Adress + Received with label + Mottagen med etikett + + + Received with address + Mottagen med adress Date @@ -905,7 +913,15 @@ Adress: %4 Error Fel - + + %n GB of free space available + %n GB fritt utrymme kvar%n GB fritt utrymme kvar + + + (of %n GB needed) + (av %n GB behövs)(av %n GB behövs) + + OpenURIDialog @@ -939,14 +955,6 @@ Adress: %4 &Main &Allmänt - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Valfri transaktionsavgift per kB som ser till att dina transaktioner behandlas snabbt. De flesta transaktioner är 1 kB. - - - Pay transaction &fee - Betala överförings&avgift - Automatically start Bitcoin after logging in to the system. Starta Bitcoin automatiskt efter inloggning. @@ -975,14 +983,6 @@ Adress: %4 Allow incoming connections Acceptera inkommande anslutningar - - Connect to the Bitcoin network through a SOCKS proxy. - Anslut till Bitcoin-nätverket genom en SOCKS-proxy. - - - &Connect through SOCKS proxy (default proxy): - &Anslut genom SOCKS-proxy (förvald proxy): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Proxyns IP-adress (t.ex. IPv4: 127.0.0.1 / IPv6: ::1) @@ -1043,6 +1043,14 @@ Adress: %4 Map port using &UPnP Tilldela port med hjälp av &UPnP + + Connect to the Bitcoin network through a SOCKS5 proxy. + Anslut till Bitcoin-nätverket genom en SOCKS5-proxy. + + + &Connect through SOCKS5 proxy (default proxy): + &Anslut genom SOCKS5-proxy (förvald proxy): + Proxy &IP: Proxy-&IP: @@ -1174,6 +1182,10 @@ Adress: %4 Mined balance that has not yet matured Den genererade balansen som ännu inte har mognat + + Balances + Balanser + Total: Totalt: @@ -1186,6 +1198,14 @@ Adress: %4 Your current balance in watch-only addresses Ditt nuvarande saldo i granska-bara adresser + + Spendable: + Spenderbar: + + + Recent transactions + Nyligen genomförda transaktioner + Unconfirmed transactions to watch-only addresses Okonfirmerade transaktioner till granska-bara adresser @@ -1817,6 +1837,78 @@ Adress: %4 Custom change address Specialväxeladress + + Transaction Fee: + Transaktionsavgift: + + + Choose... + Välj... + + + collapse fee-settings + Fäll ihop avgiftsinställningarna + + + Minimize + Minimera + + + If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte. + Om den anpassad avgiften är satt till 1000 satoshi och transaktionen bara är 250 byte, betalar "per kilobyte" bara 250 satoshi i avgift, medans "minst" betalar 1000 satoshi. För transaktioner större än en kilobyte betalar både per kilobyte. + + + per kilobyte + per kilobyte + + + If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "total at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte. + Om den anpassad avgiften är satt till 1000 satoshi och transaktionen bara är 250 byte, betalar "per kilobyte" bara 250 satoshi i avgift, medans "totalt minst" betalar 1000 satoshi. För transaktioner större än en kilobyte betalar både per kilobyte. + + + total at least + totalt minst + + + Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process. + Att betala endast den minsta avgiften är bara bra så länge det är mindre transaktionsvolym än utrymme i blocken. Men tänk på att det kan hamna i en aldrig bekräftar transaktion när det finns mer efterfrågan på bitcoin transaktioner än nätverket kan bearbeta. + + + (read the tooltip) + (läs verktygstips) + + + Recommended: + Rekommenderad: + + + Custom: + Anpassad: + + + (Smart fee not initialized yet. This usually takes a few blocks...) + (Smartavgiften är inte initierad än. Detta tar vanligen några block...) + + + Confirmation time: + Bekräftelsetid: + + + normal + normal + + + fast + snabb + + + Send as zero-fee transaction if possible + Sänd som nollavgiftstransaktion om möjligt + + + (confirmation may take longer) + (bekräftelse kan ta längre tid) + Send to multiple recipients at once Skicka till flera mottagare samtidigt @@ -1921,6 +2013,18 @@ Adress: %4 The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Transaktionen avslogs! Detta kan hända om några av mynten i plånboken redan spenderats, t.ex om du använt en kopia av wallet.dat och mynt spenderades i kopian men inte markerats som spenderade här. + + A fee higher than %1 is considered an insanely high fee. + En avgift högre än %1 anses som en onormalt hög avgift. + + + Pay only the minimum fee of %1 + Betala endast den minimala avgiften på %1 + + + Estimated to begin confirmation within %1 block(s). + Bekräftelsen beräknas börja inom %1 block. + Warning: Invalid Bitcoin address Varning: Felaktig Bitcoinadress @@ -2449,6 +2553,10 @@ Adress: %4 Type of transaction. Transaktionstyp. + + Whether or not a watch-only address is involved in this transaction. + Anger om granska-bara--adresser är involverade i denna transaktion. + Destination address of transaction. Transaktionens destinationsadress. @@ -2544,6 +2652,10 @@ Adress: %4 Export Transaction History Exportera Transaktionshistoriken + + Watch-only + Granska-bara + Exporting Failed Exporteringen misslyckades @@ -2719,6 +2831,10 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup Ta bort alla plånbokstransaktioner och återskapa bara dom som är en del av blockkedjan genom att ange -rescan vid uppstart + + Distributed under the MIT software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + Distribuerad under MIT mjukvarulicens, se den bifogade filen COPYING eller <http://www.opensource.org/licenses/mit-license.php>. + Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Ange regressiontestläge, som använder en speciell kedja i vilka block kan lösas omedelbart. @@ -2771,6 +2887,10 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. Varning: wallet.dat korrupt, datan har räddats! Den ursprungliga wallet.dat har sparas som wallet.{timestamp}.bak i %s; om ditt saldo eller transaktioner är felaktiga ska du återställa från en säkerhetskopia. + + Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times. + Vitlista klienter som ansluter från angivna nätmasker eller IP-adresser. Kan specificeras flera gånger. + (default: 1) (förvalt: 1) @@ -2831,6 +2951,10 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error opening block database Fel vid öppning av blockdatabasen + + Error: A fatal internal error occured, see debug.log for details + Fel: Ett fatalt internt fel inträffade. Se debug.log för detaljer + Error: Disk space is low! Fel: Hårddiskutrymme är lågt! @@ -2863,6 +2987,10 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Not enough file descriptors available. Inte tillräckligt med filbeskrivningar tillgängliga. + + Only connect to nodes in network <net> (ipv4, ipv6 or onion) + Anslut enbart till noder i nätverket <net> (IPv4, IPv6 eller onion) + Rebuild block chain index from current blk000??.dat files Återskapa blockkedjans index från nuvarande blk000??.dat filer @@ -2883,6 +3011,10 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com This is intended for regression testing tools and app development. Detta är avsett för regressionstestningsverktyg och applikationsutveckling. + + Use UPnP to map the listening port (default: %u) + Använd UPnP för att mappa den lyssnande porten (förvalt: %u) + Verifying blocks... Verifierar block... @@ -2928,12 +3060,12 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Kan inte låsa data-mappen %s. Bitcoin Core körs förmodligen redan. - Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) - Skapa nya filer med systemets förvalda rättigheter, istället för umask 077 (bara effektivt med avaktiverad plånboks funktionalitet) + Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:%u) + Antalsbegränsa kontinuerligt fria transaktioner till <n>*1000 bytes per minut (förvalt:%u) - Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. - Distribuerad under MIT/X11 mjukvarulicens, se den bifogade filen COPYING eller <http://www.opensource.org/licenses/mit-license.php>. + Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) + Skapa nya filer med systemets förvalda rättigheter, istället för umask 077 (bara effektivt med avaktiverad plånboks funktionalitet) Error: Listening for incoming connections failed (listen returned error %s) @@ -2955,6 +3087,10 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) Avgifter (i BTC/Kb) mindre än detta betraktas som nollavgift för transaktionsskapande (förvalt: %s) + + Maximum size of data in data carrier transactions we relay and mine (default: %u) + Maximal storlek på data i databärartransaktioner som vi reläar och bryter (förvalt: %u) + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) Sök efter klientadresser med DNS sökningen, om det finns otillräckligt med adresser (förvalt: 1 om inte -connect) @@ -3031,6 +3167,10 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Keep at most <n> unconnectable blocks in memory (default: %u) Håll som mest <n> oanslutningsbara block i minnet (förvalt: %u) + + Keep at most <n> unconnectable transactions in memory (default: %u) + Håll som mest <n> oanslutningsbara transaktioner i minnet (förvalt: %u) + Need to specify a port with -whitebind: '%s' Port måste anges med -whitelist: '%s' @@ -3063,6 +3203,10 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Send trace/debug info to console instead of debug.log file Skicka trace-/debuginformation till terminalen istället för till debug.log + + Send transactions as zero-fee transactions if possible (default: %u) + Sänd transaktioner som nollavgiftstransaktioner om möjligt (förvalt: %u) + Show all debugging options (usage: --help -help-debug) Visa alla avlusningsoptioner (använd: --help -help-debug) @@ -3171,14 +3315,178 @@ till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Error loading wallet.dat: Wallet corrupted Fel vid inläsningen av wallet.dat: Plånboken är skadad + + (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) + (1 = spara tx metadata t.ex. kontoägare och betalningsbegäransinformation, 2 = släng tx metadata) + + + Flush database activity from memory pool to disk log every <n> megabytes (default: %u) + Töm databasens minnespool till disk varje <n> megabytes (förvalt: %u) + + + How thorough the block verification of -checkblocks is (0-4, default: %u) + Hur grundlig blockverifikationen vid -checkblocks är (0-4, förvalt: %u) + + + If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: %u) + Om paytxfee inte är satt, inkludera tillräcklig avgift så att transaktionen konfirmeras inom n blocks (förvalt: %u) + + + Log transaction priority and fee per kB when mining blocks (default: %u) + Logga transaktionsprioritet och avgift per kB vid blockbrytning (förvalt: %u) + + + Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u) + Upprätthåll ett fullständigt transaktionsindex, som används av getrawtransaction rpc-anrop (förval: %u) + + + Number of seconds to keep misbehaving peers from reconnecting (default: %u) + Antal sekunder att hindra klienter som missköter sig från att ansluta (förvalt: %u) + + + Output debugging information (default: %u, supplying <category> is optional) + Skriv ut avlusningsinformation (förvalt: %u, att ange <category> är frivilligt) + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) + Använd separat SOCKS5 proxy för att nå kollegor via dolda tjänster i Tor (förvalt: -%s) + + + (default: %s) + (förvalt: %s) + + + Acceptable ciphers (default: %s) + Accepterbara chiffer (förvalt: %s) + + + Always query for peer addresses via DNS lookup (default: %u) + Sök alltid efter klientadresser med DNS sökningen (förvalt: %u) + + + Disable safemode, override a real safe mode event (default: %u) + Avaktivera säkert läge. Åsidosätt en riktigt säkert läge händelse (förvalt: %u) + Error loading wallet.dat Fel vid inläsning av plånboksfilen wallet.dat + + Force safe mode (default: %u) + Tvångskör i säkert läge (förvalt: %u) + + + Generate coins (default: %u) + Generera mynt (förvalt: %u) + + + How many blocks to check at startup (default: %u, 0 = all) + Hur många block att kontrollera vid uppstart (förvalt: %u, 0 = alla) + + + Include IP addresses in debug output (default: %u) + Inkludera IP-adresser i debugutskrift (förvalt: %u) + Invalid -proxy address: '%s' Ogiltig -proxy adress: '%s' + + Limit size of signature cache to <n> entries (default: %u) + Begränsa signaturcachestorleken till <n> poster (förvalt: %u) + + + Listen for JSON-RPC connections on <port> (default: %u or testnet: %u) + Lyssna på JSON-RPC-anslutningar på <port> (förval: %u eller testnet: %u) + + + Listen for connections on <port> (default: %u or testnet: %u) + Lyssna efter anslutningar på <port> (förvalt: %u eller testnet: %u) + + + Maintain at most <n> connections to peers (default: %u) + Ha som mest <n> anslutningar till andra klienter (förvalt: %u) + + + Maximum per-connection receive buffer, <n>*1000 bytes (default: %u) + Maximal mottagningsbuffert per anslutning, <n>*1000 byte (förvalt: %u) + + + Maximum per-connection send buffer, <n>*1000 bytes (default: %u) + Maximal sändningsbuffert per anslutning, <n>*1000 byte (förvalt: %u) + + + Only accept block chain matching built-in checkpoints (default: %u) + Acceptera bara blockkedjans matchande inbyggda kontrollpunkter (förvalt: %u) + + + Prepend debug output with timestamp (default: %u) + Skriv ut tidsstämpel i avlusningsinformationen (förvalt: %u) + + + Print block tree on startup (default: %u) + Skriv ut blockträdet vid uppstart (förvalt: %u) + + + Relay and mine data carrier transactions (default: %u) + Reläa och bearbeta databärartransaktioner (förvalt: %u) + + + Relay non-P2SH multisig (default: %u) + Reläa icke P2SH multisig (förvalt: %u) + + + Run a thread to flush wallet periodically (default: %u) + Kör en tråd för att tömma plånboken periodiskt (förvalt: %u) + + + Server certificate file (default: %s) + Serverns certifikatfil (förvalt: %s) + + + Server private key (default: %s) + Serverns privata nyckel (förvalt: %s) + + + Set key pool size to <n> (default: %u) + Sätt storleken på nyckelpoolen till <n> (förvalt: %u) + + + Set minimum block size in bytes (default: %u) + Sätt minsta blockstorlek i byte (standard: %u) + + + Set the number of threads to service RPC calls (default: %d) + Ange antalet trådar för att hantera RPC anrop (förvalt: %d) + + + Sets the DB_PRIVATE flag in the wallet db environment (default: %u) + Sätt DB_PRIVATE flaggan i plånbokens databasmiljö (förvalt: %u) + + + Specify configuration file (default: %s) + Ange konfigurationsfil (förvalt: %s) + + + Specify connection timeout in milliseconds (minimum: 1, default: %d) + Ange timeout för uppkoppling i millisekunder (minimum:1, förvalt: %d) + + + Specify pid file (default: %s) + Ange pid-fil (förvalt: %s) + + + Spend unconfirmed change when sending transactions (default: %u) + Spendera okonfirmerad växel när transaktioner sänds (förvalt: %u) + + + Stop running after importing blocks from disk (default: %u) + Sluta köra efter importen av block från disk är klar (förvalt: %u) + + + Threshold for disconnecting misbehaving peers (default: %u) + Tröskelvärde för att koppla ifrån klienter som missköter sig (förvalt: %u) + Unknown network specified in -onlynet: '%s' Okänt nätverk som anges i -onlynet: '%s' diff --git a/src/qt/locale/bitcoin_th_TH.ts b/src/qt/locale/bitcoin_th_TH.ts index e4b1e069cd..174816aaef 100644 --- a/src/qt/locale/bitcoin_th_TH.ts +++ b/src/qt/locale/bitcoin_th_TH.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -196,10 +196,6 @@ CoinControlDialog - - Address - ที่อยู่ - (no label) (ไม่มีชื่อ) diff --git a/src/qt/locale/bitcoin_tr.ts b/src/qt/locale/bitcoin_tr.ts index b5d00bc24e..ab02cc92a6 100644 --- a/src/qt/locale/bitcoin_tr.ts +++ b/src/qt/locale/bitcoin_tr.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -525,8 +525,8 @@ Adres: %4 CoinControlDialog - Coin Control Address Selection - Para kontrolü adres seçimi + Coin Selection + Bitcoin Seçimi Quantity: @@ -577,8 +577,12 @@ Adres: %4 Meblağ - Address - Adres + Received with label + Şu etiketle alındı + + + Received with address + Şu adresle alındı Date @@ -954,14 +958,6 @@ Adres: %4 &Main &Esas ayarlar - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Muamelelerin hızlı işlenmesini garantilemeye yardım eden, seçime dayalı kB başı muamele ücreti. Muamelelerin çoğunluğunun boyutu 1 kB'dir. - - - Pay transaction &fee - Muamele ücreti &öde - Automatically start Bitcoin after logging in to the system. Sistemde oturum açıldığında Bitcoin'i otomatik olarak başlat. @@ -990,14 +986,6 @@ Adres: %4 Allow incoming connections Gelen bağlantılara izin ver - - Connect to the Bitcoin network through a SOCKS proxy. - Bitcoin şebekesine bir SOCKS vekil sunucusu vasıtasıyla bağlan. - - - &Connect through SOCKS proxy (default proxy): - SOCKS vekil sunucusuyla &bağlan (varsayılan vekil): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Vekil sunucusunun IP adresi (mesela IPv4: 127.0.0.1 / IPv6: ::1) @@ -1058,6 +1046,14 @@ Adres: %4 Map port using &UPnP Portları &UPnP kullanarak haritala + + Connect to the Bitcoin network through a SOCKS5 proxy. + Bitcoin şebekesine SOCKS5 vekil sunucusu vasıtasıyla bağlan. + + + &Connect through SOCKS5 proxy (default proxy): + SOCKS5 vekil sunucusu vasıtasıyla &bağlan (varsayılan vekil sunucusu): + Proxy &IP: Vekil &İP: @@ -1848,6 +1844,78 @@ Adres: %4 Custom change address Özel para üstü adresi + + Transaction Fee: + Muamele ücreti: + + + Choose... + Seç... + + + collapse fee-settings + ücret-ayarlarını-küçült + + + Minimize + Küçült + + + If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte. + Eğer özel ücret 1000 satoşi olarak ayarlandıysa ve muamele sadece 250 baytsa, "kilobayt başı" ücret olarak sadece 250 satoşi öder ve "asgari" 1000 satoşi öder. Bir kilobayttan yüksek muameleler için ikisi de kilobayt başı ödeme yapar. + + + per kilobyte + kilobayt başı + + + If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "total at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte. + Eğer özel ücret 1000 satoşi olarak ayarlandıysa ve muamele sadece 250 baytsa, "kilobayt başı" ücret olarak sadece 250 satoşi öder ve "toplam asgari" 1000 satoşi öder. Bir kilobayttan yüksek muameleler için ikisi de kilobayt başı ödeme yapar. + + + total at least + toplam asgari + + + Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process. + Asgari ücreti ödemek, bloklarda boşluktan daha az muamele hacmi olduğu sürece bir sorun çıkarmaz. Fakat şebekenin işleyecebileceğinden daha çok bitcoin muameleleri talebi olduğunda bunun asla teyit edilmeyen bir muamele olabileceğinin farkında olmalısınız. + + + (read the tooltip) + (bilgi balonunu oku) + + + Recommended: + Tavsiye edilen: + + + Custom: + Özel: + + + (Smart fee not initialized yet. This usually takes a few blocks...) + (Zeki ücret henüz başlatılmadı. Bu genelde birkaç blok alır...) + + + Confirmation time: + Teyit süresi: + + + normal + normal + + + fast + çabuk + + + Send as zero-fee transaction if possible + Mümkünse ücretsiz muamele olarak gönder + + + (confirmation may take longer) + (teyit daha uzun süre alabilir) + Send to multiple recipients at once Birçok alıcıya aynı anda gönder @@ -1952,6 +2020,18 @@ Adres: %4 The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. Muamele reddedildi! Cüzdanınızdaki madenî paraların bazıları zaten harcanmış olduğunda bu meydana gelebilir. Örneğin wallet.dat dosyasının bir kopyasını kullandıysanız ve kopyada para harcandığında ancak burada harcandığı işaretlenmediğinde. + + A fee higher than %1 is considered an insanely high fee. + %1 tutarından yüksek ücret delicesine aşırı yüksek bir ücret olarak kabul edilir. + + + Pay only the minimum fee of %1 + Sadece asgari ücret olan %1 tutarını öde + + + Estimated to begin confirmation within %1 block(s). + Tahmini olarak %1 blok içinde teyide başlanacaktır. + Warning: Invalid Bitcoin address Uyarı: geçersiz Bitcoin adresi @@ -2758,6 +2838,10 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup Tüm cüzdan muamelelerini sil ve başlangıçta -rescan ile sadece blok zincirinin parçası olanları geri getir + + Distributed under the MIT software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. + MIT yazılım lisansı kapsamında yayınlanmıştır, ekteki COPYING dosyasına ya da <http://www.opensource.org/licenses/mit-license.php> adresine bakınız. + Enter regression test mode, which uses a special chain in which blocks can be solved instantly. Blokların anında çözülebileceği özel bir zincir kullanan regresyon deneme kipine gir. @@ -2990,10 +3074,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) Yeni dosyaları umask 077 yerine varsayılan izinlerle oluştur (sadece devre dışı cüzdan işlevselliği ile etkilidir) - - Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. - MIT/X11 yazılım lisansı kapsamında yayınlanmıştır, ekteki COPYING dosyasına ya da <http://www.opensource.org/licenses/mit-license.php> adresine bakınız. - Error: Listening for incoming connections failed (listen returned error %s) Hata: İçeri gelen bağlantıların dinlenmesi başarısız oldu (dinleme %s hatasını verdi) @@ -3014,6 +3094,10 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s) Kb başına BTC olarak bundan düşük ücretler muamele oluşturulması için sıfır değerinde ücret olarak kabul edilir (varsayılan: %s) + + Maximum size of data in data carrier transactions we relay and mine (default: %u) + Aktardığımız ve oluşturduğumuz veri taşıyıcı muamelelerindeki azami veri boyutu (varsayılan: %u) + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) Adres sayısı azaldıysa DNS sorgulamasıyla eş adresleri ara (varsayılan: 1 -connect kullanılmadıysa) @@ -3022,6 +3106,10 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Yüksek öncelikli/düşük ücretli muamelelerin azami boyutunu bayt olarak ayarla (varsayılan: %d) + + Set the number of threads for coin generation if enabled (-1 = all cores, default: %d) + Etkinse bitcoin oluşuturulmasına atanan iş parçacığı sayısını ayarla (-1 = tüm çekirdekler, varsayılan: %d) + This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. Bu ürün OpenSSL projesi tarafından OpenSSL araç takımı (http://www.openssl.org/) için geliştirilen yazılımlar, Eric Young (eay@cryptsoft.com) tarafından hazırlanmış şifreleme yazılımları ve Thomas Bernard tarafından programlanmış UPnP yazılımı içerir. @@ -3126,6 +3214,10 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Send trace/debug info to console instead of debug.log file Trace/hata ayıklama verilerini debug.log dosyası yerine konsola gönder + + Send transactions as zero-fee transactions if possible (default: %u) + Muameleleri mümkünse ücretsiz olarak gönder (varsayılan: %u) + Show all debugging options (usage: --help -help-debug) Tüm hata ayıklama seçeneklerini göster (kullanımı: --help -help-debug) @@ -3266,10 +3358,6 @@ mesela: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Output debugging information (default: %u, supplying <category> is optional) Hata ayıklama bilgisi dök (varsayılan: %u, <kategori> sağlanması seçime dayalıdır) - - Set the processor limit for when generation is on (-1 = unlimited, default: %d) - Oluşturma etkinken işlemci sınırını belirle (-1 = sınırsız, varsayılan: %d) - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) Eşlere gizli Tor servisleri ile ulaşmak için ayrı SOCKS5 vekil sunucusu kullan (varsayılan: %s) diff --git a/src/qt/locale/bitcoin_uk.ts b/src/qt/locale/bitcoin_uk.ts index c8fe1df9bf..b6ba507e9b 100644 --- a/src/qt/locale/bitcoin_uk.ts +++ b/src/qt/locale/bitcoin_uk.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -87,7 +87,7 @@ Comma separated file (*.csv) - Файли, розділені комою (*.csv) + Значення, розділені комою (*.csv) Exporting Failed @@ -524,10 +524,6 @@ Address: %4 CoinControlDialog - - Coin Control Address Selection - Вибір адрес для керування монетами - Quantity: Кількість: @@ -576,10 +572,6 @@ Address: %4 Amount Кількість - - Address - Адреса - Date Дата @@ -954,14 +946,6 @@ Address: %4 &Main &Головні - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Необов'язкова комісия за Кб допомагає переконатися, що ваші транзакції обробляються швидше. Більшість транзакцій є 1 Кб. - - - Pay transaction &fee - Заплатити комісі&ю - Automatically start Bitcoin after logging in to the system. Автоматично запускати гаманець при вході до системи. @@ -990,14 +974,6 @@ Address: %4 Allow incoming connections Дозволити вхідні з’єднання - - Connect to the Bitcoin network through a SOCKS proxy. - Підключатись до мережі Bitcoin через SOCKS-проксі. - - - &Connect through SOCKS proxy (default proxy): - &Підключатись через SOCKS-проксі (типовий проксі): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) IP-адреса проксі-сервера (наприклад IPv4: 127.0.0.1 / IPv6: ::1) @@ -1274,7 +1250,7 @@ Address: %4 URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - Неможливо обробити URI! Це може бути викликано неправильною Bitcoin-адресою, чи невірними параметрами URI. + Неможливо обробити URI! Причиною цього може бути некоректна Bitcoin-адреса або неправильні параметри URI. Payment request file handling @@ -2601,7 +2577,7 @@ Address: %4 Comma separated file (*.csv) - Файли, розділені комою (*.csv) + Значення, розділені комою (*.csv) Confirmed @@ -2747,7 +2723,7 @@ rpcpassword=%s Ім’я користувача та пароль ПОВИННІ бути різними. Якщо файлу не існує, створіть його, обмеживши доступ правом читання для власника. Також рекомендується використовувати alertnotify для того, щоб отримувати сповіщення про проблеми; -наприклад: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +наприклад: alertnotify=echo %%s | mail -s "Сповіщення Bitcoin" admin@foo.com @@ -2990,10 +2966,6 @@ rpcpassword=%s Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) Створювати нові файли з типовими для системи атрибутами доступу замість маски 077 (діє тільки при вимкненому гаманці) - - Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. - Поширюється за ліцензією MIT/X11, додаткова інформація міститься у файлі COPYING, а також за адресою <http://www.opensource.org/licenses/mit-license.php>. - Error: Listening for incoming connections failed (listen returned error %s) Помилка: Не вдалося налаштувати прослуховування вхідних підключень (listen повернув помилку: %s) @@ -3004,7 +2976,7 @@ rpcpassword=%s Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - Виконати команду при надходженні важливого попереджувального повідомлення або при спостереженні тривалого розгалуження ланцюжка (замість %s буде підставлено повідомлення) + Виконати команду при надходженні важливого сповіщення або при спостереженні тривалого розгалуження ланцюжка (замість %s буде підставлено повідомлення) Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s) @@ -3072,15 +3044,15 @@ rpcpassword=%s Invalid amount for -minrelaytxfee=<amount>: '%s' - Вказано некоректну суму для параметру -minrelaytxfee: '%s' + Вказано некоректну суму для параметру -minrelaytxfee: «%s» Invalid amount for -mintxfee=<amount>: '%s' - Вказано некоректну суму для параметру -mintxfee: '%s' + Вказано некоректну суму для параметру -mintxfee: «%s» Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s) - Вказано некоректну суму для параметру -paytxfee: '%s' (повинно бути щонайменше %s) + Вказано некоректну суму для параметру -paytxfee: «%s» (повинно бути щонайменше %s) Invalid netmask specified in -whitelist: '%s' @@ -3266,10 +3238,6 @@ rpcpassword=%s Output debugging information (default: %u, supplying <category> is optional) Виводити налагоджувальну інформацію (типово: %u, вказання <category> необов'язкове) - - Set the processor limit for when generation is on (-1 = unlimited, default: %d) - Встановити максимальну кількість процесорів, що будуть використовуватися при ввімкненій генерації (-1 = необмежено, типово: %d) - Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) Використовувати окремий SOCKS5-проксі для з'єднання з учасниками через приховані сервіси Tor (типово: %s) diff --git a/src/qt/locale/bitcoin_ur_PK.ts b/src/qt/locale/bitcoin_ur_PK.ts index 5bf7ce4344..86f3226269 100644 --- a/src/qt/locale/bitcoin_ur_PK.ts +++ b/src/qt/locale/bitcoin_ur_PK.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -100,10 +100,6 @@ Amount رقم - - Address - پتہ - Date تاریخ diff --git a/src/qt/locale/bitcoin_uz@Cyrl.ts b/src/qt/locale/bitcoin_uz@Cyrl.ts index ab4439b419..54e649aede 100644 --- a/src/qt/locale/bitcoin_uz@Cyrl.ts +++ b/src/qt/locale/bitcoin_uz@Cyrl.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -520,10 +520,6 @@ Address: %4 CoinControlDialog - - Coin Control Address Selection - Танга бошқарув манзилини танлаш - Quantity: Сони: @@ -572,10 +568,6 @@ Address: %4 Amount Миқдори - - Address - Манзил - Date Сана @@ -930,14 +922,6 @@ Address: %4 &Main &Асосий - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - Ҳар бир кб учун ўтказма солиғи ўтказмаларингизни тезроқ ўтишига ишонишингизга ёрдам беради. Кўпгина ўтказмалар 1 кб. - - - Pay transaction &fee - Ўтказма &солиғини тўлаш - Automatically start Bitcoin after logging in to the system. Тизимга киргандан сўнг Bitcoin дастури автоматик ишга туширилсин. @@ -966,14 +950,6 @@ Address: %4 Allow incoming connections Кирувчи уланишларга рухсат бериш - - Connect to the Bitcoin network through a SOCKS proxy. - Bitcoin тармоққа SOCKS прокси орқали уланинг. - - - &Connect through SOCKS proxy (default proxy): - SOCKS прокси орқали &уланинг (стандарт прокси): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) Прокси IP манзили (масалан: IPv4: 127.0.0.1 / IPv6: ::1) diff --git a/src/qt/locale/bitcoin_vi.ts b/src/qt/locale/bitcoin_vi.ts index e03349b383..3ca5605883 100644 --- a/src/qt/locale/bitcoin_vi.ts +++ b/src/qt/locale/bitcoin_vi.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -52,10 +52,6 @@ Amount Số lượng - - Address - Địa chỉ - (no label) (chưa có nhãn) diff --git a/src/qt/locale/bitcoin_vi_VN.ts b/src/qt/locale/bitcoin_vi_VN.ts index 20ebd7b594..bf76c8638a 100644 --- a/src/qt/locale/bitcoin_vi_VN.ts +++ b/src/qt/locale/bitcoin_vi_VN.ts @@ -1,4 +1,4 @@ - + AddressBookPage diff --git a/src/qt/locale/bitcoin_zh_CN.ts b/src/qt/locale/bitcoin_zh_CN.ts index 75867460ab..94d0675bfd 100644 --- a/src/qt/locale/bitcoin_zh_CN.ts +++ b/src/qt/locale/bitcoin_zh_CN.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -516,10 +516,6 @@ Address: %4 CoinControlDialog - - Coin Control Address Selection - 选择交易源地址 - Quantity: 总量: @@ -568,10 +564,6 @@ Address: %4 Amount 金额 - - Address - 地址 - Date 日期 @@ -931,14 +923,6 @@ Address: %4 &Main 主要(&M) - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - 可选的每 kB 交易费,这有助于您的交易被更快的处理。大多数交易都是 1 kB。 - - - Pay transaction &fee - 支付交易费用(&F) - Automatically start Bitcoin after logging in to the system. 登录系统后自动开启比特币客户端 @@ -967,14 +951,6 @@ Address: %4 Allow incoming connections 允许流入连接 - - Connect to the Bitcoin network through a SOCKS proxy. - 通过 SOCKS 代理连接到比特币网络。 - - - &Connect through SOCKS proxy (default proxy): - 通过 SO&CKS 代理连接 (默认代理): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) 代理的 IP 地址 (例如 IPv4: 127.0.0.1 / IPv6: ::1) diff --git a/src/qt/locale/bitcoin_zh_HK.ts b/src/qt/locale/bitcoin_zh_HK.ts index dfdbb7d1da..7062377f45 100644 --- a/src/qt/locale/bitcoin_zh_HK.ts +++ b/src/qt/locale/bitcoin_zh_HK.ts @@ -1,4 +1,4 @@ - + AddressBookPage diff --git a/src/qt/locale/bitcoin_zh_TW.ts b/src/qt/locale/bitcoin_zh_TW.ts index 6301bd4587..b70596d83a 100644 --- a/src/qt/locale/bitcoin_zh_TW.ts +++ b/src/qt/locale/bitcoin_zh_TW.ts @@ -1,4 +1,4 @@ - + AddressBookPage @@ -7,7 +7,7 @@ Create a new address - 製造新的位址 + 新增新的位址 &New @@ -520,10 +520,6 @@ Address: %4 CoinControlDialog - - Coin Control Address Selection - 錢幣控制的位址選擇 - Quantity: 數目: @@ -572,10 +568,6 @@ Address: %4 Amount 金額 - - Address - 位址 - Date 日期 @@ -908,7 +900,15 @@ Address: %4 Error 錯誤 - + + %n GB of free space available + 可用空間尚存 %n GB + + + (of %n GB needed) + (需要 %n GB) + + OpenURIDialog @@ -942,14 +942,6 @@ Address: %4 &Main 主要 - - Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. - 每一千位元組(kB)要付的交易手續費,如果有付可以加速網路處理你的交易。大部份交易資料的大小是 1 kB. - - - Pay transaction &fee - 付交易手續費 - Automatically start Bitcoin after logging in to the system. 在登入系統後自動啓動位元幣軟體。 @@ -978,14 +970,6 @@ Address: %4 Allow incoming connections 接受外來連線 - - Connect to the Bitcoin network through a SOCKS proxy. - 透過 SOCKS 代理伺服器來連線到位元幣網路。 - - - &Connect through SOCKS proxy (default proxy): - 透過 SOCKS 代理伺服器連線(預設代理伺服器): - IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) 代理伺服器的網際網路位址(像是 IPv4 的 127.0.0.1 或 IPv6 的 ::1) @@ -2967,10 +2951,6 @@ alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) 用系統預設權限來造出新的檔案,而不是用使用者權限罩遮(umask)值 077 (只有在關掉錢包功能時才有作用)。 - - Distributed under the MIT/X11 software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. - 這套軟體是依據 MIT/X11 軟體授權條款散布,詳情請見附帶的 COPYING 檔案,或是以下網站: <http://www.opensource.org/licenses/mit-license.php>. - Error: Listening for incoming connections failed (listen returned error %s) 錯誤: 聽候外來連線失敗(回傳錯誤 %s) From 78bdc8103ff4c1b2f1f636f9c5564285028f3e19 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Wed, 26 Nov 2014 13:51:02 +0100 Subject: [PATCH 1127/1288] [REST] give an appropriate response in warmup phase --- src/rest.cpp | 4 ++++ src/rpcprotocol.h | 1 + src/rpcserver.cpp | 8 ++++++++ src/rpcserver.h | 3 +++ 4 files changed, 16 insertions(+) diff --git a/src/rest.cpp b/src/rest.cpp index 1aa864a306..4953d7e717 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -188,6 +188,10 @@ bool HTTPReq_REST(AcceptedConnection *conn, bool fRun) { try { + std::string statusmessage; + if(RPCIsInWarmup(&statusmessage)) + throw RESTERR(HTTP_SERVICE_UNAVAILABLE, "Service temporarily unavailable: "+statusmessage); + for (unsigned int i = 0; i < ARRAYLEN(uri_prefixes); i++) { unsigned int plen = strlen(uri_prefixes[i].prefix); if (strURI.substr(0, plen) == uri_prefixes[i].prefix) { diff --git a/src/rpcprotocol.h b/src/rpcprotocol.h index a321338176..f7cd50f9f6 100644 --- a/src/rpcprotocol.h +++ b/src/rpcprotocol.h @@ -28,6 +28,7 @@ enum HTTPStatusCode HTTP_FORBIDDEN = 403, HTTP_NOT_FOUND = 404, HTTP_INTERNAL_SERVER_ERROR = 500, + HTTP_SERVICE_UNAVAILABLE = 503, }; //! Bitcoin RPC error codes diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 7022c50375..c10b05cb04 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -756,6 +756,14 @@ void SetRPCWarmupFinished() fRPCInWarmup = false; } +bool RPCIsInWarmup(std::string *outStatus) +{ + LOCK(cs_rpcWarmup); + if (outStatus) + *outStatus = rpcWarmupStatus; + return fRPCInWarmup; +} + void RPCRunHandler(const boost::system::error_code& err, boost::function func) { if (!err) diff --git a/src/rpcserver.h b/src/rpcserver.h index 7395fc23c6..b0e437057b 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -53,6 +53,9 @@ void SetRPCWarmupStatus(const std::string& newStatus); /* Mark warmup as done. RPC calls will be processed from now on. */ void SetRPCWarmupFinished(); +/* returns the current warmup state. */ +bool RPCIsInWarmup(std::string *statusOut); + /** * Type-check arguments; throws JSONRPCError if wrong type given. Does not check that * the right number of arguments are passed, just that any passed are the correct type. From 5dc713bfc7bf98c8e1d80fec9c5f5e0417a2bdcd Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Wed, 26 Nov 2014 13:53:27 +0100 Subject: [PATCH 1128/1288] [REST] set REST API behind "-rest" option --- src/init.cpp | 1 + src/rpcserver.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index b73c6e8722..63e72c66d2 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -352,6 +352,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += "\n" + _("RPC server options:") + "\n"; strUsage += " -server " + _("Accept command line and JSON-RPC commands") + "\n"; + strUsage += " -rest " + strprintf(_("Accept public REST requests (default: %u)"), 0) + "\n"; strUsage += " -rpcbind= " + _("Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces)") + "\n"; strUsage += " -rpcuser= " + _("Username for JSON-RPC connections") + "\n"; strUsage += " -rpcpassword= " + _("Password for JSON-RPC connections") + "\n"; diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index c10b05cb04..b03016a508 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -955,7 +955,7 @@ void ServiceConnection(AcceptedConnection *conn) break; // Process via HTTP REST API - } else if (strURI.substr(0, 6) == "/rest/") { + } else if (strURI.substr(0, 6) == "/rest/" && GetBoolArg("-rest", false)) { if (!HTTPReq_REST(conn, strURI, mapHeaders, fRun)) break; From 199627c94c2a9f4feaecfda0fe4d8350cf654525 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Thu, 20 Nov 2014 16:39:09 +0100 Subject: [PATCH 1129/1288] [REST] adding basic documentation --- doc/REST-interface.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 doc/REST-interface.md diff --git a/doc/REST-interface.md b/doc/REST-interface.md new file mode 100644 index 0000000000..05c532be54 --- /dev/null +++ b/doc/REST-interface.md @@ -0,0 +1,24 @@ +Unauthenticated REST Interface +============================== + +The REST API can be enabled with the `-rest` option. + +Supported API +------------- +`GET /rest/tx/TX-HASH.{bin|hex|json}` + +Given a transaction hash, +Returns a transaction, in binary, hex-encoded binary or JSON formats. + +`GET /rest/block/BLOCK-HASH.{bin|hex|json}` + +Given a block hash, +Returns a block, in binary, hex-encoded binary or JSON formats. + +The HTTP request and response are both handled entirely in-memory, thus making maximum memory usage at least 2.66MB (1 MB max block, plus hex encoding) per request. + +For full TX query capability, one must enable the transaction index via "txindex=1" command line / configuration option. + +Risks +------------- +Running a webbrowser on the same node with a REST enabled bitcoind can be a risk. Accessing prepared XSS websites could read out tx/block data of your node by placing links like `